mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Add an acceleration test for Advanced Layers on Windows. (bug 1365879 part 25, r=milan)
This commit is contained in:
parent
4005708b7f
commit
b02d5e2bfd
@ -31,6 +31,7 @@ var xr = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
|
||||
var windows = SpecialPowers.Services.ww.getWindowEnumerator();
|
||||
var windowutils;
|
||||
var acceleratedWindows = 0;
|
||||
var advancedLayersWindows = 0;
|
||||
while (windows.hasMoreElements()) {
|
||||
windowutils = windows.getNext().QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
@ -38,6 +39,9 @@ while (windows.hasMoreElements()) {
|
||||
if (windowutils.layerManagerType != "Basic") {
|
||||
acceleratedWindows++;
|
||||
}
|
||||
if (windowutils.usingAdvancedLayers) {
|
||||
advancedLayersWindows++;
|
||||
}
|
||||
} catch (e) {
|
||||
// The window may not have a layer manager, in which case we get an error.
|
||||
// Don't count it as an accelerated window.
|
||||
@ -77,6 +81,7 @@ switch(osName)
|
||||
todo(false, "Acceleration not supported on Windows XP or newer" +
|
||||
" (This is expected on SeaMonkey (tinderboxes).)");
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,6 +96,22 @@ switch(osName)
|
||||
ok(gfxInfo.D2DEnabled, "Direct2D enabled on Windows 8 or newer");
|
||||
ok(gfxInfo.DWriteEnabled, "DirectWrite enabled on Windows 8 or newer");
|
||||
}
|
||||
|
||||
var advancedLayersEnabled = false;
|
||||
var advancedLayersEnabledOnWin7 = false;
|
||||
try {
|
||||
advancedLayersEnabled = SpecialPowers.getBoolPref("layers.mlgpu.dev-enabled");
|
||||
advancedLayersEnabledOnWin7 = SpecialPowers.getBoolPref("layers.mlgpu.enable-on-windows7");
|
||||
} catch (e) {}
|
||||
var shouldGetAL = advancedLayersEnabled;
|
||||
if (version < 6.2) {
|
||||
shouldGetAL &= advancedLayersEnabledOnWin7;
|
||||
}
|
||||
if (shouldGetAL) {
|
||||
isnot(advancedLayersWindows, 0, "Advanced Layers enabled on Windows");
|
||||
} else {
|
||||
is(advancedLayersWindows, 0, "Advanced Layers disabled on Windows");
|
||||
}
|
||||
break;
|
||||
|
||||
case "Linux":
|
||||
|
Loading…
x
Reference in New Issue
Block a user