Bug 703484 - Part 3: Fix android whitelist. r=ajuma
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Wed, 13 Jun 2012 15:54:02 -0400
changeset 101430 ada741a2c92fe4d1b0aba7234aa62af7b30e8bfd
parent 101429 93ae7e5c471c6324dea23081d63691735668a54c
child 101431 ed4548cac45fe74300ef7aa9a20be9e67b4679cc
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersajuma
bugs703484
milestone16.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 703484 - Part 3: Fix android whitelist. r=ajuma
widget/android/GfxInfo.cpp
widget/android/nsWindow.cpp
--- a/widget/android/GfxInfo.cpp
+++ b/widget/android/GfxInfo.cpp
@@ -250,24 +250,27 @@ GfxInfo::AddOpenGLCrashReportAnnotations
 
 const nsTArray<GfxDriverInfo>&
 GfxInfo::GetGfxDriverInfo()
 {
   if (!mDriverInfo->Length()) {
     /* The following entry, when uncommented, will allow us to whitelist a
      * specific device. See the long comment in GetFeatureStatusImpl for more
      * info. */
- // APPEND_TO_DRIVER_BLOCKLIST( DRIVER_OS_ALL,
- //   my_vendor_id, my_device_id,
- //   nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_NO_INFO,
- //   DRIVER_LESS_THAN, GfxDriverInfo::allDevices );
+#ifdef MOZ_JAVA_COMPOSITOR
+    APPEND_TO_DRIVER_BLOCKLIST2( DRIVER_OS_ALL,
+      (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAll), GfxDriverInfo::allDevices,
+      nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_NO_INFO,
+      DRIVER_COMPARISON_IGNORED, GfxDriverInfo::allDriverVersions );
+#else
     APPEND_TO_DRIVER_BLOCKLIST2( DRIVER_OS_ALL,
       (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAll), GfxDriverInfo::allDevices,
       nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
       DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions );
+#endif
   }
   return *mDriverInfo;
 }
 
 nsresult
 GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, 
                               PRInt32 *aStatus, 
                               nsAString & aSuggestedDriverVersion,
@@ -276,17 +279,17 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aF
 {
   NS_ENSURE_ARG_POINTER(aStatus);
   aSuggestedDriverVersion.SetIsVoid(true);
   *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
   OperatingSystem os = DRIVER_OS_ANDROID;
   if (aOS)
     *aOS = os;
 
-  // Don't evaluate special cases when evaluating the downlaoded blocklist.
+  // Don't evaluate special cases when evaluating the downloaded blocklist.
   if (!aDriverInfo.Length()) {
     if (aFeature == FEATURE_OPENGL_LAYERS) {
       /* The following code is an old way to whitelist devices when we're ready.
        * It is staying here for reference. The best way to do this now is to add
        * an entry in the list above. There is a dummy entry which will whitelist a
        * device when uncommented and device/vendor IDs are inserted. It is
        * preferred that we stop whitelisting and instead go to blocklisting, where
        * everything is assumed to be okay as long as it's not in the blocklist. */
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -684,31 +684,33 @@ nsWindow::GetLayerManager(PLayersChild*,
 
     nsWindow *topWindow = TopWindow();
 
     if (!topWindow) {
         printf_stderr(" -- no topwindow\n");
         mLayerManager = CreateBasicLayerManager();
         return mLayerManager;
     }
+
+    mUseAcceleratedRendering = GetShouldAccelerate();
+
 #ifdef MOZ_JAVA_COMPOSITOR
     bool useCompositor = UseOffMainThreadCompositing();
 
     if (useCompositor) {
         CreateCompositor();
         if (mLayerManager) {
             SetCompositor(mCompositorParent, mCompositorChild, mCompositorThread);
             return mLayerManager;
         }
 
         // If we get here, then off main thread compositing failed to initialize.
         sFailedToCreateGLContext = true;
     }
 #endif
-    mUseAcceleratedRendering = GetShouldAccelerate();
 
     if (!mUseAcceleratedRendering ||
         sFailedToCreateGLContext)
     {
         printf_stderr(" -- creating basic, not accelerated\n");
         mLayerManager = CreateBasicLayerManager();
         return mLayerManager;
     }