bug 887819 - Investigate using the tiled layers backend, create pref to enable tiles r=BenWa
authorBrad Lassey <blassey@mozilla.com>
Tue, 10 Sep 2013 14:21:37 -0400
changeset 146356 efc53394043e9f6492a3ae75640c5c5e2bbcfe26
parent 146355 4d152d0220bea5f414c391231fbf2e28d77d8880
child 146380 ce127f081ebff9025736174b467d04a277fc8eb0
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersBenWa
bugs887819
milestone26.0a1
bug 887819 - Investigate using the tiled layers backend, create pref to enable tiles r=BenWa
b2g/app/b2g.js
gfx/layers/TiledLayerBuffer.h
gfx/layers/client/ClientThebesLayer.cpp
mobile/android/app/mobile.js
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -68,16 +68,17 @@ pref("browser.sessionstore.resume_from_c
 pref("browser.sessionstore.interval", 10000); // milliseconds
 pref("browser.sessionstore.max_tabs_undo", 1);
 
 /* these should help performance */
 pref("mozilla.widget.force-24bpp", true);
 pref("mozilla.widget.use-buffer-pixmap", true);
 pref("mozilla.widget.disable-native-theme", true);
 pref("layout.reflow.synthMouseMove", false);
+pref("layers.force-tiles", false);
 
 /* download manager (don't show the window or alert) */
 pref("browser.download.useDownloadDir", true);
 pref("browser.download.folderList", 1); // Default to ~/Downloads
 pref("browser.download.manager.showAlertOnComplete", false);
 pref("browser.download.manager.showAlertInterval", 2000);
 pref("browser.download.manager.retention", 2);
 pref("browser.download.manager.showWhenStarting", false);
--- a/gfx/layers/TiledLayerBuffer.h
+++ b/gfx/layers/TiledLayerBuffer.h
@@ -2,21 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_TILEDLAYERBUFFER_H
 #define GFX_TILEDLAYERBUFFER_H
 
 #define TILEDLAYERBUFFER_TILE_SIZE 256
 
-#ifdef MOZ_ANDROID_OMTC
-  // This needs to go away as we enabled tiled
-  // layers everywhere.
-  #define FORCE_BASICTILEDTHEBESLAYER
-#endif
 // Debug defines
 //#define GFX_TILEDLAYER_DEBUG_OVERLAY
 //#define GFX_TILEDLAYER_PREF_WARNINGS
 
 #include <stdint.h>                     // for uint16_t, uint32_t
 #include <sys/types.h>                  // for int32_t
 #include "nsDebug.h"                    // for NS_ABORT_IF_FALSE
 #include "nsPoint.h"                    // for nsIntPoint
--- a/gfx/layers/client/ClientThebesLayer.cpp
+++ b/gfx/layers/client/ClientThebesLayer.cpp
@@ -12,16 +12,17 @@
 #include "gfxContext.h"                 // for gfxContext
 #include "gfxRect.h"                    // for gfxRect
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT, etc
 #include "mozilla/gfx/2D.h"             // for DrawTarget
 #include "mozilla/gfx/Matrix.h"         // for Matrix
 #include "mozilla/gfx/Rect.h"           // for Rect, IntRect
 #include "mozilla/gfx/Types.h"          // for Float, etc
 #include "mozilla/layers/LayersTypes.h"
+#include "mozilla/Preferences.h"
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsISupportsImpl.h"            // for Layer::AddRef, etc
 #include "nsRect.h"                     // for nsIntRect
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
@@ -180,24 +181,22 @@ ClientThebesLayer::PaintBuffer(gfxContex
                                mVisibleRegion,
                                aDidSelfCopy);
 }
 
 already_AddRefed<ThebesLayer>
 ClientLayerManager::CreateThebesLayer()
 {
   NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
-#ifdef FORCE_BASICTILEDTHEBESLAYER
-  if (GetCompositorBackendType() == LAYERS_OPENGL) {
+  if (Preferences::GetBool("layers.force-tiles") && GetCompositorBackendType() == LAYERS_OPENGL) {
     nsRefPtr<ClientTiledThebesLayer> layer =
       new ClientTiledThebesLayer(this);
     CREATE_SHADOW(Thebes);
     return layer.forget();
   } else
-#endif
   {
     nsRefPtr<ClientThebesLayer> layer =
       new ClientThebesLayer(this);
     CREATE_SHADOW(Thebes);
     return layer.forget();
   }
 }
 
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -713,16 +713,18 @@ pref("dom.event.touch.coalescing.enabled
 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);
 
 pref("layout.imagevisibility.enabled", false);
 
+pref("layers.force-tiles", true);
+
 // Enable the dynamic toolbar
 pref("browser.chrome.dynamictoolbar", true);
 
 // The mode of browser titlebar
 // 0: Show a current page title.
 // 1: Show a current page url.
 pref("browser.chrome.titlebarMode", 0);