From b18906567ecee5446a54cec674f4908c1f1fde5f Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Fri, 14 Nov 2014 09:50:54 +1100 Subject: [PATCH] Back out 8be2344dcff3 (bug 1089008) for OS X bustage. --- browser/components/nsBrowserGlue.js | 3 --- toolkit/xre/nsAppRunner.cpp | 31 +++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 02dc2a6f398e..012b2d14a155 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -2527,14 +2527,11 @@ 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 3706343b06a3..0b2a9a720974 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -4613,24 +4613,43 @@ mozilla::BrowserTabsRemoteAutostart() } #endif -#if defined(XP_MACOSX) +#if defined(XP_WIN) || defined(XP_MACOSX) // If for any reason we suspect acceleration will be disabled, disabled - // e10s auto start on mac. + // e10s auto start. (bug 1068199) THIS IS A TEMPORARY WORKAROUND. 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 (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &status)) && - status != nsIGfxInfo::FEATURE_STATUS_OK) { - accelDisabled = true; +#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; + } + } + } } } @@ -4647,7 +4666,7 @@ mozilla::BrowserTabsRemoteAutostart() LogE10sBlockedReason("Hardware acceleration is disabled"); } } -#endif // defined(XP_MACOSX) +#endif mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_AUTOSTART, gBrowserTabsRemoteAutostart); if (Preferences::GetBool("browser.enabledE10SFromPrompt", false)) {