Back out 8be2344dcff3 (bug 1089008) for OS X bustage.
authorCameron McCormack <cam@mcc.id.au>
Fri, 14 Nov 2014 09:50:54 +1100
changeset 215654 2e8496d85ba2410228a73b685e39970aff9cbbbe
parent 215653 d65f01b9e6c6a57fb9a49fe246a8d378fa1e4369
child 215655 ee366f6b2d3ec274b34190cb2f37a6bdc5736433
push id51811
push usercmccormack@mozilla.com
push dateThu, 13 Nov 2014 22:51:14 +0000
treeherdermozilla-inbound@2e8496d85ba2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1089008
milestone36.0a1
backs out8be2344dcff3f1ad25f5343c35114548d46d06cc
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out 8be2344dcff3 (bug 1089008) for OS X bustage.
browser/components/nsBrowserGlue.js
toolkit/xre/nsAppRunner.cpp
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2522,24 +2522,21 @@ let E10SUINotification = {
       }
 
       let e10sPromptShownCount = 0;
       try {
         e10sPromptShownCount = Services.prefs.getIntPref(this.CURRENT_PROMPT_PREF);
       } 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 &&
           !Services.appinfo.keyboardMayHaveIME &&
           isHardwareAccelerated &&
           e10sPromptShownCount < 5) {
         Services.tm.mainThread.dispatch(() => {
           try {
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4608,51 +4608,70 @@ mozilla::BrowserTabsRemoteAutostart()
     } else if (disabledForIME) {
       LogE10sBlockedReason("The keyboard being used has activated IME");
     } else {
       gBrowserTabsRemoteAutostart = true;
     }
   }
 #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<nsIGfxInfo> 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;
+            }
+          }
+        }
       }
     }
 
     // Check env flags
     if (accelDisabled) {
       const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
       if (acceleratedEnv && (*acceleratedEnv != '0')) {
         accelDisabled = false;
       }
     }
 
     if (accelDisabled) {
       gBrowserTabsRemoteAutostart = false;
       LogE10sBlockedReason("Hardware acceleration is disabled");
     }
   }
-#endif // defined(XP_MACOSX)
+#endif
 
   mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_AUTOSTART, gBrowserTabsRemoteAutostart);
   if (Preferences::GetBool("browser.enabledE10SFromPrompt", false)) {
     mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_STILL_ACCEPTED_FROM_PROMPT,
                                     gBrowserTabsRemoteAutostart);
   }
   if (prefEnabled) {
     mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_BLOCKED_FROM_RUNNING,