From 77a3478fd59ff20b1b7ef17293bcd140a4ebd8cc Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Thu, 13 Nov 2014 14:14:51 -0600 Subject: [PATCH] Bug 1089008 - Enable e10s on Windows when acceleration is disabled. r=Mossop, r=felipe --HG-- extra : rebase_source : f24efd7b76e111390de71d74ccace735dc9bbb88 --- browser/components/nsBrowserGlue.js | 3 +++ toolkit/xre/nsAppRunner.cpp | 31 ++++++----------------------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 012b2d14a15..02dc2a6f398 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -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 && diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 0b2a9a72097..3706343b06a 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -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 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)) {