Bug 1089008 - Enable e10s on Windows when acceleration is disabled. r=Mossop, r=felipe

--HG--
extra : rebase_source : f24efd7b76e111390de71d74ccace735dc9bbb88
This commit is contained in:
Jim Mathies 2014-11-13 14:14:51 -06:00
parent 556c9de769
commit 77a3478fd5
2 changed files with 9 additions and 25 deletions

View File

@ -2527,11 +2527,14 @@ let E10SUINotification = {
} catch(e) {}
let isHardwareAccelerated = true;
// Linux and Windows are currently ok, mac not so much.
#ifdef XP_MACOSX
try {
let win = RecentWindow.getMostRecentBrowserWindow();
let winutils = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
isHardwareAccelerated = winutils.layerManagerType != "Basic";
} catch (e) {}
#endif
if (!Services.appinfo.inSafeMode &&
!Services.appinfo.accessibilityEnabled &&

View File

@ -4613,43 +4613,24 @@ mozilla::BrowserTabsRemoteAutostart()
}
#endif
#if defined(XP_WIN) || defined(XP_MACOSX)
#if defined(XP_MACOSX)
// If for any reason we suspect acceleration will be disabled, disabled
// e10s auto start. (bug 1068199) THIS IS A TEMPORARY WORKAROUND.
// e10s auto start on mac.
if (gBrowserTabsRemoteAutostart) {
// Check prefs
bool accelDisabled = Preferences::GetBool("layers.acceleration.disabled", false) &&
!Preferences::GetBool("layers.acceleration.force-enabled", false);
#if defined(XP_MACOSX)
accelDisabled = accelDisabled || !nsCocoaFeatures::AccelerateByDefault();
#endif
// Check for blocked drivers
if (!accelDisabled) {
nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
if (gfxInfo) {
int32_t status;
#if defined(XP_WIN)
long flagsToCheck[4] = {
nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS,
nsIGfxInfo::FEATURE_DIRECT3D_10_LAYERS,
nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS,
nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS
};
#elif defined(XP_MACOSX)
long flagsToCheck[1] = {
nsIGfxInfo::FEATURE_OPENGL_LAYERS
};
#endif
for (unsigned int idx = 0; idx < ArrayLength(flagsToCheck); idx++) {
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(flagsToCheck[idx], &status))) {
if (status != nsIGfxInfo::FEATURE_STATUS_OK) {
accelDisabled = true;
break;
}
}
}
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &status)) &&
status != nsIGfxInfo::FEATURE_STATUS_OK) {
accelDisabled = true;
}
}
@ -4666,7 +4647,7 @@ mozilla::BrowserTabsRemoteAutostart()
LogE10sBlockedReason("Hardware acceleration is disabled");
}
}
#endif
#endif // defined(XP_MACOSX)
mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_AUTOSTART, gBrowserTabsRemoteAutostart);
if (Preferences::GetBool("browser.enabledE10SFromPrompt", false)) {