Bug 836058; remove UseTiledThebes; r=BenWa
authorNicholas Cameron <ncameron@mozilla.com>
Tue, 29 Jan 2013 14:38:46 +1300
changeset 130187 fdf8dafb419fc32bc9a3cc7d18d01e7299f0d3b1
parent 130186 c5bdb6d94a5d0018e4dfb1c38d055c84ddb3ad1f
child 130188 8ee1b05b3b86318e76017706aba3685a0333a3b7
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa
bugs836058
milestone21.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 836058; remove UseTiledThebes; r=BenWa
gfx/layers/Layers.cpp
gfx/layers/Layers.h
gfx/layers/TiledLayerBuffer.h
gfx/layers/basic/BasicLayerManager.cpp
gfx/layers/opengl/LayerManagerOGL.cpp
gfx/layers/opengl/ThebesLayerOGL.cpp
mobile/android/app/mobile.js
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -255,23 +255,16 @@ LayerManager::GetScrollableLayers(nsTArr
     Layer* child = containerLayer->GetFirstChild();
     while (child) {
       queue.AppendElement(child);
       child = child->GetNextSibling();
     }
   }
 }
 
-bool ThebesLayer::UseTiledThebes()
-{
-  static bool useTiledThebesLayer =
-    Preferences::GetBool("gfx.use_tiled_thebes", false);
-  return useTiledThebesLayer;
-}
-
 already_AddRefed<gfxASurface>
 LayerManager::CreateOptimalSurface(const gfxIntSize &aSize,
                                    gfxASurface::gfxImageFormat aFormat)
 {
   return gfxPlatform::GetPlatform()->
     CreateOffscreenSurface(aSize, gfxASurface::ContentFromFormat(aFormat));
 }
 
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -1281,18 +1281,16 @@ public:
    * into the ThebesLayer so that when mEffectiveTransform is applied afterwards
    * by layer compositing, the results exactly match the "ideal transform"
    * (the product of the transform of this layer and its ancestors).
    * Returns 0,0 unless SetAllowResidualTranslation(true) has been called.
    * The residual translation components are always in the range [-0.5, 0.5).
    */
   gfxPoint GetResidualTranslation() const { return mResidualTranslation; }
 
-  static bool UseTiledThebes();
-
 protected:
   ThebesLayer(LayerManager* aManager, void* aImplData)
     : Layer(aManager, aImplData)
     , mValidRegion()
     , mUsedForReadback(false)
     , mAllowResidualTranslation(false)
   {
     mContentFlags = 0; // Clear NO_TEXT, NO_TEXT_OVER_TRANSPARENT
--- a/gfx/layers/TiledLayerBuffer.h
+++ b/gfx/layers/TiledLayerBuffer.h
@@ -3,16 +3,21 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_TILEDLAYERBUFFER_H
 #define GFX_TILEDLAYERBUFFER_H
 
 #define TILEDLAYERBUFFER_TILE_SIZE 256
 
 // Debug defines
+#ifdef MOZ_ANDROID_OMTC
+  // This needs to go away as we enabled tiled
+  // layers everywhere.
+  #define FORCE_BASICTILEDTHEBESLAYER
+#endif
 //#define GFX_TILEDLAYER_DEBUG_OVERLAY
 //#define GFX_TILEDLAYER_PREF_WARNINGS
 
 #include "nsRect.h"
 #include "nsRegion.h"
 #include "nsTArray.h"
 
 namespace mozilla {
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -1336,26 +1336,27 @@ BasicShadowLayerManager::ProgressiveUpda
 
   return false;
 }
 
 already_AddRefed<ThebesLayer>
 BasicShadowLayerManager::CreateThebesLayer()
 {
   NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
-  if (HasShadowManager() && GetParentBackendType() == LAYERS_OPENGL &&
-      ThebesLayer::UseTiledThebes()) {
+#ifdef FORCE_BASICTILEDTHEBESLAYER
+  if (HasShadowManager() && GetParentBackendType() == LAYERS_OPENGL) {
     // BasicTiledThebesLayer doesn't support main
     // thread compositing so only return this layer
     // type if we have a shadow manager.
     nsRefPtr<BasicTiledThebesLayer> layer =
       new BasicTiledThebesLayer(this);
     MAYBE_CREATE_SHADOW(Thebes);
     return layer.forget();
   } else
+#endif
   {
     nsRefPtr<BasicShadowableThebesLayer> layer =
       new BasicShadowableThebesLayer(this);
     MAYBE_CREATE_SHADOW(Thebes);
     return layer.forget();
   }
 }
 
--- a/gfx/layers/opengl/LayerManagerOGL.cpp
+++ b/gfx/layers/opengl/LayerManagerOGL.cpp
@@ -1549,19 +1549,21 @@ LayerManagerOGL::CreateFBOWithTexture(co
 
 already_AddRefed<ShadowThebesLayer>
 LayerManagerOGL::CreateShadowThebesLayer()
 {
   if (LayerManagerOGL::mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
     return nullptr;
   }
-  if (ThebesLayer::UseTiledThebes())
-    return nsRefPtr<ShadowThebesLayer>(new TiledThebesLayerOGL(this)).forget();
+#ifdef FORCE_BASICTILEDTHEBESLAYER
+  return nsRefPtr<ShadowThebesLayer>(new TiledThebesLayerOGL(this)).forget();
+#else
   return nsRefPtr<ShadowThebesLayerOGL>(new ShadowThebesLayerOGL(this)).forget();
+#endif
 }
 
 already_AddRefed<ShadowContainerLayer>
 LayerManagerOGL::CreateShadowContainerLayer()
 {
   if (LayerManagerOGL::mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
     return nullptr;
--- a/gfx/layers/opengl/ThebesLayerOGL.cpp
+++ b/gfx/layers/opengl/ThebesLayerOGL.cpp
@@ -1022,18 +1022,19 @@ ShadowBufferOGL::Swap(TextureImage* aNew
 
   return prevBuffer.forget();
 }
 
 ShadowThebesLayerOGL::ShadowThebesLayerOGL(LayerManagerOGL *aManager)
   : ShadowThebesLayer(aManager, nullptr)
   , LayerOGL(aManager)
 {
-  if (ThebesLayer::UseTiledThebes())
-    NS_ABORT();
+#ifdef FORCE_BASICTILEDTHEBESLAYER
+  NS_ABORT();
+#endif
   mImplData = static_cast<LayerOGL*>(this);
 }
 
 ShadowThebesLayerOGL::~ShadowThebesLayerOGL()
 {}
 
 void
 ShadowThebesLayerOGL::Swap(const ThebesBuffer& aNewFront,
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -669,11 +669,8 @@ pref("dom.event.touch.coalescing.enabled
 
 // default orientation for the app, default to undefined
 // the java GeckoScreenOrientationListener needs this to be defined
 pref("app.orientation.default", "");
 
 // On memory pressure, release dirty but unused pages held by jemalloc
 // back to the system.
 pref("memory.free_dirty_pages", true);
-
-// Enable tiled layers rendering by default on android
-pref("gfx.use_tiled_thebes", true);