Bug 1089008 - Enable e10s on Windows when acceleration is disabled. r=Mossop, r=felipe
authorJim Mathies <jmathies@mozilla.com>
Fri, 14 Nov 2014 10:51:19 -0600
changeset 215869 cbcafb38ad62408208d35c7aaf00f93661c6d5be
parent 215868 fcb277a52bddfdbe352b2aa850267a42f01485c5
child 215870 8890eab664bf0660d4295162457397a42e9fcbb2
push id27829
push usergszorc@mozilla.com
push dateSat, 15 Nov 2014 22:34:49 +0000
treeherderautoland@19f75e1211e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop, felipe
bugs1089008
milestone36.0a1
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
Bug 1089008 - Enable e10s on Windows when acceleration is disabled. r=Mossop, r=felipe
browser/components/nsBrowserGlue.js
toolkit/xre/nsAppRunner.cpp
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2522,21 +2522,24 @@ 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,52 +4608,34 @@ mozilla::BrowserTabsRemoteAutostart()
     } else if (disabledForIME) {
       LogE10sBlockedReason("The keyboard being used has activated IME");
     } else {
       gBrowserTabsRemoteAutostart = true;
     }
   }
 #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;
         }
       }
     }
 
     // Check env flags
     if (accelDisabled) {
       const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
       if (acceleratedEnv && (*acceleratedEnv != '0')) {
@@ -4661,17 +4643,17 @@ mozilla::BrowserTabsRemoteAutostart()
       }
     }
 
     if (accelDisabled) {
       gBrowserTabsRemoteAutostart = false;
       LogE10sBlockedReason("Hardware acceleration is disabled");
     }
   }
-#endif
+#endif // defined(XP_MACOSX)
 
   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,