Bug 967794 - Pick up the low resolution preference during the session, not just at start. r=Cwiiis
authorMilan Sreckovic <milan@mozilla.com>
Wed, 05 Feb 2014 14:42:15 -0500
changeset 178114 3515cd83e2aa0296ccfbc3e24b562626458fc33e
parent 178113 26cdcab860cffb608539302e024f8c3701b74153
child 178115 54c21f290a8d0e7bb5fccd4a4f0c4d555db95273
push id5439
push userffxbld
push dateMon, 17 Mar 2014 23:08:15 +0000
treeherdermozilla-aurora@c0befb3c8038 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCwiiis
bugs967794
milestone30.0a1
Bug 967794 - Pick up the low resolution preference during the session, not just at start. r=Cwiiis
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1606,29 +1606,27 @@ gfxPlatform::UseLowPrecisionBuffer()
     }
 
     return sUseLowPrecisionBuffer;
 }
 
 float
 gfxPlatform::GetLowPrecisionResolution()
 {
-    static float sLowPrecisionResolution;
+    static int32_t sLowPrecisionResolutionX1000 = 250;
     static bool sLowPrecisionResolutionPrefCached = false;
 
     if (!sLowPrecisionResolutionPrefCached) {
-        int32_t lowPrecisionResolution = 250;
         sLowPrecisionResolutionPrefCached = true;
-        mozilla::Preferences::AddIntVarCache(&lowPrecisionResolution,
+        mozilla::Preferences::AddIntVarCache(&sLowPrecisionResolutionX1000,
                                              "layers.low-precision-resolution",
-                                             250);
-        sLowPrecisionResolution = lowPrecisionResolution / 1000.f;
+                                             sLowPrecisionResolutionX1000);
     }
 
-    return sLowPrecisionResolution;
+    return sLowPrecisionResolutionX1000/1000.f;
 }
 
 bool
 gfxPlatform::OffMainThreadCompositingEnabled()
 {
   return XRE_GetProcessType() == GeckoProcessType_Default ?
     CompositorParent::CompositorLoop() != nullptr :
     CompositorChild::ChildProcessHasCompositor();