Bug 793923 - Fixed gfxPlatform to use gfx.content.azure.backends properly. r=ncameron,roc
authorAnthony Jones <ajones@mozilla.com>
Tue, 09 Oct 2012 11:45:35 +0200
changeset 109738 8b610742fced63cbbc0bb1e383f69977e476ac7d
parent 109737 41710fe4a03ca4a7f40813dfece13bdf69b24374
child 109739 af631704f1e00119dd2ed92611d0ea23a138e464
push id23652
push userryanvm@gmail.com
push dateWed, 10 Oct 2012 01:10:20 +0000
treeherdermozilla-central@5cca0408a73f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersncameron, roc
bugs793923
milestone19.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 793923 - Fixed gfxPlatform to use gfx.content.azure.backends properly. r=ncameron,roc
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -71,17 +71,16 @@
 
 #include "nsIGfxInfo.h"
 
 using namespace mozilla;
 using namespace mozilla::layers;
 
 gfxPlatform *gPlatform = nullptr;
 static bool gEverInitialized = false;
-static nsTArray<nsCString>* gBackendList = nullptr;
 
 // These two may point to the same profile
 static qcms_profile *gCMSOutputProfile = nullptr;
 static qcms_profile *gCMSsRGBProfile = nullptr;
 
 static qcms_transform *gCMSRGBTransform = nullptr;
 static qcms_transform *gCMSInverseRGBTransform = nullptr;
 static qcms_transform *gCMSRGBATransform = nullptr;
@@ -406,19 +405,16 @@ gfxPlatform::Shutdown()
 #endif
 
     // This will block this thread untill the ImageBridge protocol is completely
     // deleted.
     ImageBridgeChild::ShutDown();
 
     CompositorParent::ShutDown();
 
-    delete gBackendList;
-    gBackendList = nullptr;
-
     delete gPlatform;
     gPlatform = nullptr;
 }
 
 gfxPlatform::~gfxPlatform()
 {
     mScreenReferenceSurface = nullptr;
 
@@ -1225,26 +1221,24 @@ gfxPlatform::GetContentBackendPref(uint3
 
 /* static */ BackendType
 gfxPlatform::GetBackendPref(const char* aEnabledPrefName, const char* aBackendPrefName, uint32_t aBackendBitmask)
 {
     if (!Preferences::GetBool(aEnabledPrefName, false)) {
         return BACKEND_NONE;
     }
 
-    if (!gBackendList) {
-        gBackendList = new nsTArray<nsCString>();
-        nsCString prefString;
-        if (NS_SUCCEEDED(Preferences::GetCString(aBackendPrefName, &prefString))) {
-            ParseString(prefString, ',', *gBackendList);
-        }
+    nsTArray<nsCString> backendList;
+    nsCString prefString;
+    if (NS_SUCCEEDED(Preferences::GetCString(aBackendPrefName, &prefString))) {
+        ParseString(prefString, ',', backendList);
     }
 
-    for (uint32_t i = 0; i < gBackendList->Length(); ++i) {
-        BackendType result = BackendTypeForName((*gBackendList)[i]);
+    for (uint32_t i = 0; i < backendList.Length(); ++i) {
+        BackendType result = BackendTypeForName(backendList[i]);
         if ((1 << result) & aBackendBitmask) {
             return result;
         }
     }
     return BACKEND_NONE;
 }
 
 bool