Bug 867230 (bug 828876) - Enable hwc by default when colorfill support is detected, r=dwilson a=tef+
authorMichael Wu <mwu@mozilla.com>
Fri, 10 May 2013 15:15:16 -0400
changeset 118960 b965b998af35bf98c462da29e3cb6f7bf138f3e5
parent 118959 0cd2aaaaf6c7f0dcba654a1cae5f26297a50b2e0
child 118961 d02b425087c2bba7d1c1eade97d1a92aa7c0a700
push id170
push usermwu@mozilla.com
push dateFri, 10 May 2013 19:17:19 +0000
reviewersdwilson, tef
bugs867230, 828876
milestone18.0
Bug 867230 (bug 828876) - Enable hwc by default when colorfill support is detected, r=dwilson a=tef+
modules/libpref/src/init/all.js
widget/gonk/nsWindow.cpp
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -3692,19 +3692,16 @@ pref("layers.acceleration.force-enabled"
 
 pref("layers.acceleration.draw-fps", false);
 
 // Whether to animate simple opacity and transforms on the compositor
 pref("layers.offmainthreadcomposition.animate-opacity", false);
 pref("layers.offmainthreadcomposition.animate-transform", false);
 pref("layers.offmainthreadcomposition.log-animations", false);
 
-// Whether to (try) to use a Composer2D if available on this platform.
-pref("layers.composer2d.enabled", false);
-
 #ifdef MOZ_X11
 #ifdef MOZ_WIDGET_GTK2
 pref("gfx.xrender.enabled",true);
 #endif
 #endif
 
 #ifdef XP_WIN
 // Whether to disable the automatic detection and use of direct2d.
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -184,17 +184,20 @@ nsWindow::nsWindow()
         // This is a hack to force initialization of the compositor
         // resources, if we're going to use omtc.
         //
         // NB: GetPlatform() will create the gfxPlatform, which wants
         // to know the color depth, which asks our native window.
         // This has to happen after other init has finished.
         gfxPlatform::GetPlatform();
         sUsingOMTC = UseOffMainThreadCompositing();
-        sUsingHwc = Preferences::GetBool("layers.composer2d.enabled", false);
+
+        property_get("ro.display.colorfill", propValue, "0");
+        sUsingHwc = Preferences::GetBool("layers.composer2d.enabled",
+                                         atoi(propValue) == 1);
 
         if (sUsingOMTC) {
           sOMTCSurface = new gfxImageSurface(gfxIntSize(1, 1),
                                              gfxASurface::ImageFormatRGB24);
         }
     }
 }