Bug 1071825 - Remove simple tiling code. r=mattwoodrow
authorNicolas Silva <nsilva@mozilla.com>
Tue, 23 Sep 2014 17:44:48 -0400
changeset 206915 7c4f2c66719a5825ea038b17fa7512b54ac7e1d9
parent 206914 447459c9abd155e2e6eb2b9aa8f3992e69764aa4
child 206916 00a3d59e6e9058d2c7dfb5c13445741f162bbca4
push id27544
push userryanvm@gmail.com
push dateWed, 24 Sep 2014 21:10:36 +0000
treeherdermozilla-central@1735ff2bb23e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1071825
milestone35.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 1071825 - Remove simple tiling code. r=mattwoodrow
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/client/ClientLayerManager.h
gfx/layers/client/ClientThebesLayer.cpp
gfx/layers/client/SimpleTextureClientPool.cpp
gfx/layers/client/SimpleTextureClientPool.h
gfx/layers/client/SimpleTiledContentClient.cpp
gfx/layers/client/SimpleTiledContentClient.h
gfx/layers/moz.build
gfx/thebes/gfxPrefs.h
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/layers/CompositableClient.h"
 #include "mozilla/layers/ContentClient.h"
 #include "mozilla/layers/ISurfaceAllocator.h"
 #include "mozilla/layers/LayersMessages.h"  // for EditReply, etc
 #include "mozilla/layers/LayersSurfaces.h"  // for SurfaceDescriptor
 #include "mozilla/layers/PLayerChild.h"  // for PLayerChild
 #include "mozilla/layers/LayerTransactionChild.h"
 #include "mozilla/layers/TextureClientPool.h" // for TextureClientPool
-#include "mozilla/layers/SimpleTextureClientPool.h" // for SimpleTextureClientPool
 #include "ClientReadbackLayer.h"        // for ClientReadbackLayer
 #include "nsAString.h"
 #include "nsIWidget.h"                  // for nsIWidget
 #include "nsIWidgetListener.h"
 #include "nsTArray.h"                   // for AutoInfallibleTArray
 #include "nsXULAppAPI.h"                // for XRE_GetProcessType, etc
 #include "TiledLayerBuffer.h"
 #include "mozilla/dom/WindowBinding.h"  // for Overfill Callback
@@ -642,33 +641,16 @@ ClientLayerManager::GetTexturePool(Surfa
                                              gfxPrefs::LayersTileHeight()),
                             gfxPrefs::LayersTileMaxPoolSize(),
                             gfxPrefs::LayersTileShrinkPoolTimeout(),
                             mForwarder));
 
   return mTexturePools.LastElement();
 }
 
-SimpleTextureClientPool*
-ClientLayerManager::GetSimpleTileTexturePool(SurfaceFormat aFormat)
-{
-  int index = (int) aFormat;
-  mSimpleTilePools.EnsureLengthAtLeast(index+1);
-
-  if (mSimpleTilePools[index].get() == nullptr) {
-    mSimpleTilePools[index] = new SimpleTextureClientPool(aFormat, IntSize(gfxPrefs::LayersTileWidth(),
-                                                                           gfxPrefs::LayersTileHeight()),
-                                                          gfxPrefs::LayersTileMaxPoolSize(),
-                                                          gfxPrefs::LayersTileShrinkPoolTimeout(),
-                                                          mForwarder);
-  }
-
-  return mSimpleTilePools[index];
-}
-
 void
 ClientLayerManager::ReturnTextureClientDeferred(TextureClient& aClient) {
   GetTexturePool(aClient.GetFormat())->ReturnTextureClientDeferred(&aClient);
 }
 
 void
 ClientLayerManager::ReturnTextureClient(TextureClient& aClient) {
   GetTexturePool(aClient.GetFormat())->ReturnTextureClient(&aClient);
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -32,17 +32,16 @@ class nsIWidget;
 namespace mozilla {
 namespace layers {
 
 class ClientThebesLayer;
 class CompositorChild;
 class ImageLayer;
 class PLayerChild;
 class TextureClientPool;
-class SimpleTextureClientPool;
 
 class ClientLayerManager MOZ_FINAL : public LayerManager
 {
   typedef nsTArray<nsRefPtr<Layer> > LayerRefArray;
 
 public:
   explicit ClientLayerManager(nsIWidget* aWidget);
 
@@ -119,17 +118,16 @@ public:
   bool HasShadowManager() const { return mForwarder->HasShadowManager(); }
 
   virtual bool IsCompositingCheap();
   virtual bool HasShadowManagerInternal() const { return HasShadowManager(); }
 
   virtual void SetIsFirstPaint() MOZ_OVERRIDE;
 
   TextureClientPool* GetTexturePool(gfx::SurfaceFormat aFormat);
-  SimpleTextureClientPool* GetSimpleTileTexturePool(gfx::SurfaceFormat aFormat);
 
   /// Utility methods for managing texture clients.
   void ReturnTextureClientDeferred(TextureClient& aClient);
   void ReturnTextureClient(TextureClient& aClient);
   void ReportClientLost(TextureClient& aClient);
 
   // Drop cached resources and ask our shadow manager to do the same,
   // if we have one.
@@ -332,19 +330,16 @@ private:
 
   APZTestData mApzTestData;
 
   RefPtr<ShadowLayerForwarder> mForwarder;
   nsAutoTArray<RefPtr<TextureClientPool>,2> mTexturePools;
   nsAutoTArray<dom::OverfillCallback*,0> mOverfillCallbacks;
   mozilla::TimeStamp mTransactionStart;
 
-  // indexed by gfx::SurfaceFormat
-  nsTArray<RefPtr<SimpleTextureClientPool> > mSimpleTilePools;
-
   nsRefPtr<MemoryPressureObserver> mMemoryPressureObserver;
 };
 
 class ClientLayer : public ShadowableLayer
 {
 public:
   ClientLayer()
   {
--- a/gfx/layers/client/ClientThebesLayer.cpp
+++ b/gfx/layers/client/ClientThebesLayer.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #include "ClientThebesLayer.h"
 #include "ClientTiledThebesLayer.h"     // for ClientTiledThebesLayer
-#include "SimpleTiledContentClient.h"
 #include <stdint.h>                     // for uint32_t
 #include "GeckoProfiler.h"              // for PROFILER_LABEL
 #include "client/ClientLayerManager.h"  // for ClientLayerManager, etc
 #include "gfxContext.h"                 // for gfxContext
 #include "gfxRect.h"                    // for gfxRect
 #include "gfxPrefs.h"                   // for gfxPrefs
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT, etc
 #include "mozilla/gfx/2D.h"             // for DrawTarget
@@ -162,31 +161,21 @@ ClientLayerManager::CreateThebesLayerWit
   if (
 #ifdef MOZ_B2G
       aHint == SCROLLABLE &&
 #endif
       gfxPlatform::GetPlatform()->UseTiling() &&
       (AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_OPENGL ||
        AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D9 ||
        AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D11)) {
-    if (gfxPrefs::LayersUseSimpleTiles()) {
-      nsRefPtr<SimpleClientTiledThebesLayer> layer =
-        new SimpleClientTiledThebesLayer(this, aHint);
-      CREATE_SHADOW(Thebes);
-      return layer.forget();
-    } else {
-      nsRefPtr<ClientTiledThebesLayer> layer =
-        new ClientTiledThebesLayer(this, aHint);
-      CREATE_SHADOW(Thebes);
-      return layer.forget();
-    }
-  } else
-  {
-    nsRefPtr<ClientThebesLayer> layer =
-      new ClientThebesLayer(this, aHint);
+    nsRefPtr<ClientTiledThebesLayer> layer = new ClientTiledThebesLayer(this, aHint);
+    CREATE_SHADOW(Thebes);
+    return layer.forget();
+  } else {
+    nsRefPtr<ClientThebesLayer> layer = new ClientThebesLayer(this, aHint);
     CREATE_SHADOW(Thebes);
     return layer.forget();
   }
 }
 
 
 }
 }
deleted file mode 100644
--- a/gfx/layers/client/SimpleTextureClientPool.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-* This Source Code Form is subject to the terms of the Mozilla Public
-* 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/. */
-
-#include "SimpleTextureClientPool.h"
-#include "CompositableClient.h"
-#include "mozilla/layers/ISurfaceAllocator.h"
-
-#include "gfxPrefs.h"
-
-#include "nsComponentManagerUtils.h"
-
-#if 0
-#define RECYCLE_LOG(...) printf_stderr(__VA_ARGS__)
-#else
-#define RECYCLE_LOG(...) do { } while (0)
-#endif
-
-namespace mozilla {
-namespace layers {
-
-using gfx::SurfaceFormat;
-
-/* static */ void
-SimpleTextureClientPool::ShrinkCallback(nsITimer *aTimer, void *aClosure)
-{
-  static_cast<SimpleTextureClientPool*>(aClosure)->ShrinkToMinimumSize();
-}
-
-/* static */ void
-SimpleTextureClientPool::RecycleCallback(TextureClient* aClient, void* aClosure)
-{
-  SimpleTextureClientPool* pool =
-    static_cast<SimpleTextureClientPool*>(aClosure);
-
-  aClient->ClearRecycleCallback();
-  pool->ReturnTextureClient(aClient);
-}
-
-/* static */ void
-SimpleTextureClientPool::WaitForCompositorRecycleCallback(TextureClient* aClient, void* aClosure)
-{
-  // This will grab a reference that will be released once the compositor
-  // acknowledges the remote recycle. Once it is received the object
-  // will be fully recycled.
-  aClient->WaitForCompositorRecycle();
-  aClient->SetRecycleCallback(SimpleTextureClientPool::RecycleCallback, aClosure);
-}
-
-SimpleTextureClientPool::SimpleTextureClientPool(gfx::SurfaceFormat aFormat, gfx::IntSize aSize,
-                                                 uint32_t aMaxTextureClients,
-                                                 uint32_t aShrinkTimeoutMsec,
-                                                 ISurfaceAllocator *aAllocator)
-  : mFormat(aFormat)
-  , mSize(aSize)
-  , mMaxTextureClients(aMaxTextureClients)
-  , mShrinkTimeoutMsec(aShrinkTimeoutMsec)
-  , mSurfaceAllocator(aAllocator)
-{
-  mTimer = do_CreateInstance("@mozilla.org/timer;1");
-}
-
-TemporaryRef<TextureClient>
-SimpleTextureClientPool::GetTextureClient(bool aAutoRecycle)
-{
-  // Try to fetch a client from the pool
-  RefPtr<TextureClient> textureClient;
-  if (mAvailableTextureClients.size()) {
-    textureClient = mAvailableTextureClients.top();
-    mAvailableTextureClients.pop();
-    RECYCLE_LOG("%s Skip allocate (%i left), returning %p\n", (mFormat == SurfaceFormat::B8G8R8A8?"poolA":"poolX"), mAvailableTextureClients.size(), textureClient.get());
-
-  } else {
-    // No unused clients in the pool, create one
-    if (gfxPrefs::ForceShmemTiles()) {
-      textureClient = TextureClient::CreateForRawBufferAccess(mSurfaceAllocator,
-        mFormat, mSize, gfx::BackendType::NONE,
-        TextureFlags::IMMEDIATE_UPLOAD | TextureFlags::RECYCLE, ALLOC_DEFAULT);
-    } else {
-      textureClient = TextureClient::CreateForDrawing(mSurfaceAllocator,
-        mFormat, mSize, gfx::BackendType::NONE, TextureFlags::DEFAULT | TextureFlags::RECYCLE);
-    }
-    if (!textureClient) {
-      NS_WARNING("Failed to allocate a TextureClient!");
-      return nullptr;
-    }
-    RECYCLE_LOG("%s Must allocate (0 left), returning %p\n", (mFormat == SurfaceFormat::B8G8R8A8?"poolA":"poolX"), textureClient.get());
-  }
-
-  if (aAutoRecycle) {
-    mOutstandingTextureClients.push_back(textureClient);
-    textureClient->SetRecycleCallback(SimpleTextureClientPool::WaitForCompositorRecycleCallback, this);
-  }
-
-  return textureClient;
-}
-
-void
-SimpleTextureClientPool::ReturnTextureClient(TextureClient *aClient)
-{
-  if (!aClient) {
-    return;
-  }
-
-  // If we haven't hit our max cached client limit, add this one
-  if (mAvailableTextureClients.size() < mMaxTextureClients) {
-    mAvailableTextureClients.push(aClient);
-    RECYCLE_LOG("%s recycled %p (have %d)\n", (mFormat == SurfaceFormat::B8G8R8A8?"poolA":"poolX"), aClient, mAvailableTextureClients.size());
-  } else {
-    RECYCLE_LOG("%s did not recycle %p (have %d)\n", (mFormat == SurfaceFormat::B8G8R8A8?"poolA":"poolX"), aClient, mAvailableTextureClients.size());
-  }
-
-  // Kick off the pool shrinking timer if there are still more unused texture
-  // clients than our desired minimum cache size.
-  if (mAvailableTextureClients.size() > sMinCacheSize) {
-    mTimer->InitWithFuncCallback(SimpleTextureClientPool::ShrinkCallback, this, mShrinkTimeoutMsec,
-                                 nsITimer::TYPE_ONE_SHOT);
-  }
-
-  mOutstandingTextureClients.remove(aClient);
-}
-
-void
-SimpleTextureClientPool::ShrinkToMinimumSize()
-{
-  RECYCLE_LOG("%s ShrinkToMinimumSize, removing %d clients", (mFormat == SurfaceFormat::B8G8R8A8?"poolA":"poolX"), mAvailableTextureClients.size() > sMinCacheSize ? mAvailableTextureClients.size() - sMinCacheSize : 0);
-
-  mTimer->Cancel();
-
-  while (mAvailableTextureClients.size() > sMinCacheSize) {
-    mAvailableTextureClients.pop();
-  }
-}
-
-void
-SimpleTextureClientPool::Clear()
-{
-  while (!mAvailableTextureClients.empty()) {
-    mAvailableTextureClients.pop();
-  }
-}
-
-}
-}
deleted file mode 100644
--- a/gfx/layers/client/SimpleTextureClientPool.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-* This Source Code Form is subject to the terms of the Mozilla Public
-* 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 MOZILLA_GFX_SIMPLETEXTURECLIENTPOOL_H
-#define MOZILLA_GFX_SIMPLETEXTURECLIENTPOOL_H
-
-#include "mozilla/gfx/Types.h"
-#include "mozilla/gfx/Point.h"
-#include "mozilla/RefPtr.h"
-#include "TextureClient.h"
-#include "nsITimer.h"
-#include <stack>
-#include <list>
-
-namespace mozilla {
-namespace layers {
-
-class ISurfaceAllocator;
-
-class SimpleTextureClientPool
-{
-  ~SimpleTextureClientPool()
-  {
-    for (auto it = mOutstandingTextureClients.begin(); it != mOutstandingTextureClients.end(); ++it) {
-      (*it)->ClearRecycleCallback();
-    }
-  }
-
-public:
-  NS_INLINE_DECL_REFCOUNTING(SimpleTextureClientPool)
-
-  SimpleTextureClientPool(gfx::SurfaceFormat aFormat, gfx::IntSize aSize,
-                          uint32_t aMaxTextureClients,
-                          uint32_t aShrinkTimeoutMsec,
-                          ISurfaceAllocator *aAllocator);
-
-  /**
-   * If a TextureClient is AutoRecycled, when the last reference is
-   * released this object will be automatically return to the pool as
-   * soon as the compositor informs us it is done with it.
-   */
-  TemporaryRef<TextureClient> GetTextureClient(bool aAutoRecycle = false);
-  TemporaryRef<TextureClient> GetTextureClientWithAutoRecycle() { return GetTextureClient(true); }
-
-  void ReturnTextureClient(TextureClient *aClient);
-
-  void ShrinkToMinimumSize();
-
-  void Clear();
-
-private:
-  // The minimum size of the pool (the number of tiles that will be kept after
-  // shrinking).
-  static const uint32_t sMinCacheSize = 16;
-
-  static void ShrinkCallback(nsITimer *aTimer, void *aClosure);
-  static void RecycleCallback(TextureClient* aClient, void* aClosure);
-  static void WaitForCompositorRecycleCallback(TextureClient* aClient, void* aClosure);
-
-  gfx::SurfaceFormat mFormat;
-  gfx::IntSize mSize;
-
-  // This is the number of cached texture clients we don't want to exceed, even
-  // temporarily (pre-shrink)
-  uint32_t mMaxTextureClients;
-
-  // The time in milliseconds before the pool will be shrunk to the minimum
-  // size after returning a client.
-  uint32_t mShrinkTimeoutMsec;
-
-  // We use a std::stack and make sure to use it the following way:
-  //   new (available to be used) elements are push()'d to the front
-  //   requests are served from the front via pop()
-  //     -- the thinking is that recently-used elements are most likely
-  //     to be in any data cache, so we can get some wins there
-  //     -- the converse though is that if there is some GPU locking going on
-  //     the most recently used elements may also have the most contention;
-  //     if we see that, then we should use push_back() to add new elements
-  //   when we shrink this list, we use pop(), but should use pop_back() to
-  //   nuke the oldest.
-  // We may need to switch to a std::deque
-  // On b2g gonk, std::queue might be a better choice.
-  // On ICS, fence wait happens implicitly before drawing.
-  // Since JB, fence wait happens explicitly when fetching a client from the pool.
-  std::stack<RefPtr<TextureClient> > mAvailableTextureClients;
-  std::list<RefPtr<TextureClient> > mOutstandingTextureClients;
-
-  nsRefPtr<nsITimer> mTimer;
-  RefPtr<ISurfaceAllocator> mSurfaceAllocator;
-};
-
-}
-}
-#endif /* MOZILLA_GFX_SIMPLETEXTURECLIENTPOOL_H */
deleted file mode 100644
--- a/gfx/layers/client/SimpleTiledContentClient.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-#include "mozilla/layers/SimpleTiledContentClient.h"
-
-#include <math.h>                       // for ceil, ceilf, floor
-#include "ClientTiledThebesLayer.h"     // for ClientTiledThebesLayer
-#include "GeckoProfiler.h"              // for PROFILER_LABEL
-#include "Units.h"                      // for ScreenIntRect, CSSPoint, etc
-#include "UnitTransforms.h"             // for TransformTo
-#include "ClientLayerManager.h"         // for ClientLayerManager
-#include "CompositorChild.h"            // for CompositorChild
-#include "gfxContext.h"                 // for gfxContext, etc
-#include "gfxPlatform.h"                // for gfxPlatform
-#include "gfxPrefs.h"                   // for gfxPrefs::LayersTileWidth/Height
-#include "gfxRect.h"                    // for gfxRect
-#include "mozilla/Attributes.h"         // for MOZ_THIS_IN_INITIALIZER_LIST
-#include "mozilla/MathAlgorithms.h"     // for Abs
-#include "mozilla/gfx/Point.h"          // for IntSize
-#include "mozilla/gfx/Rect.h"           // for Rect
-#include "mozilla/layers/CompositableForwarder.h"
-#include "mozilla/layers/ShadowLayers.h"  // for ShadowLayerForwarder
-#include "SimpleTextureClientPool.h"
-#include "nsDebug.h"                    // for NS_ASSERTION
-#include "nsISupportsImpl.h"            // for gfxContext::AddRef, etc
-#include "nsSize.h"                     // for nsIntSize
-#include "gfxReusableSharedImageSurfaceWrapper.h"
-#include "nsMathUtils.h"               // for NS_roundf
-#include "gfx2DGlue.h"
-
-#define ALOG(...)  __android_log_print(ANDROID_LOG_INFO, "SimpleTiles", __VA_ARGS__)
-
-namespace mozilla {
-namespace layers {
-
-using namespace mozilla::gfx;
-
-void
-SimpleTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion,
-                                    const nsIntRegion& aPaintRegion,
-                                    LayerManager::DrawThebesLayerCallback aCallback,
-                                    void* aCallbackData)
-{
-  mCallback = aCallback;
-  mCallbackData = aCallbackData;
-
-#ifdef GFX_TILEDLAYER_PREF_WARNINGS
-  long start = PR_IntervalNow();
-#endif
-
-  // If this region is empty XMost() - 1 will give us a negative value.
-  NS_ASSERTION(!aPaintRegion.GetBounds().IsEmpty(), "Empty paint region\n");
-
-  PROFILER_LABEL("SimpleTiledLayerBuffer", "PaintThebesUpdate",
-    js::ProfileEntry::Category::GRAPHICS);
-
-  Update(aNewValidRegion, aPaintRegion);
-
-#ifdef GFX_TILEDLAYER_PREF_WARNINGS
-  if (PR_IntervalNow() - start > 10) {
-    const nsIntRect bounds = aPaintRegion.GetBounds();
-    printf_stderr("Time to tile [%i, %i, %i, %i] -> %i\n", bounds.x, bounds.y, bounds.width, bounds.height, PR_IntervalNow() - start);
-  }
-#endif
-
-  mLastPaintOpaque = mThebesLayer->CanUseOpaqueSurface();
-  mCallback = nullptr;
-  mCallbackData = nullptr;
-}
-
-SimpleTiledLayerTile
-SimpleTiledLayerBuffer::ValidateTile(SimpleTiledLayerTile aTile,
-                                     const nsIntPoint& aTileOrigin,
-                                     const nsIntRegion& aDirtyRegion)
-{
-  PROFILER_LABEL("SimpleTiledLayerBuffer", "ValidateTile",
-    js::ProfileEntry::Category::GRAPHICS);
-
-  static gfx::IntSize kTileSize(gfxPrefs::LayersTileWidth(), gfxPrefs::LayersTileHeight());
-
-  gfx::SurfaceFormat tileFormat = gfxPlatform::GetPlatform()->Optimal2DFormatForContent(GetContentType());
-
-  // if this is true, we're using a separate buffer to do our drawing first
-  bool doBufferedDrawing = true;
-  bool fullPaint = false;
-
-  RefPtr<TextureClient> textureClient = mManager->GetSimpleTileTexturePool(tileFormat)->GetTextureClientWithAutoRecycle();
-
-  if (!textureClient) {
-    NS_WARNING("TextureClient allocation failed");
-    return SimpleTiledLayerTile();
-  }
-
-  if (!textureClient->Lock(OpenMode::OPEN_READ_WRITE)) {
-    NS_WARNING("TextureClient lock failed");
-    return SimpleTiledLayerTile();
-  }
-
-  if (!textureClient->CanExposeDrawTarget()) {
-    doBufferedDrawing = false;
-  }
-
-  RefPtr<DrawTarget> drawTarget;
-
-  unsigned char *bufferData = nullptr;
-
-  // these are set/updated differently based on doBufferedDrawing
-  nsIntRect drawBounds;
-  nsIntRegion drawRegion;
-  nsIntRegion invalidateRegion;
-
-  RefPtr<DrawTarget> srcDT;
-  uint8_t* srcData = nullptr;
-  int32_t srcStride = 0;
-  gfx::IntSize srcSize;
-  gfx::SurfaceFormat srcFormat = gfx::SurfaceFormat::UNKNOWN;
-
-  if (doBufferedDrawing) {
-    // try to directly access the pixels of the TextureClient
-    srcDT = textureClient->BorrowDrawTarget();
-    if (srcDT->LockBits(&srcData, &srcSize, &srcStride, &srcFormat)) {
-      if (!aTile.mCachedBuffer) {
-        aTile.mCachedBuffer = SharedBuffer::Create(srcStride * srcSize.height);
-        fullPaint = true;
-      }
-      bufferData = (unsigned char*) aTile.mCachedBuffer->Data();
-
-      drawTarget = gfxPlatform::GetPlatform()->CreateDrawTargetForData(bufferData,
-                                                                       kTileSize,
-                                                                       srcStride,
-                                                                       tileFormat);
-
-      if (fullPaint) {
-        drawBounds = nsIntRect(aTileOrigin.x, aTileOrigin.y, GetScaledTileSize().width, GetScaledTileSize().height);
-        drawRegion = nsIntRegion(drawBounds);
-      } else {
-        drawBounds = aDirtyRegion.GetBounds();
-        drawRegion = nsIntRegion(drawBounds);
-        if (GetContentType() == gfxContentType::COLOR_ALPHA)
-          drawTarget->ClearRect(Rect(drawBounds.x - aTileOrigin.x, drawBounds.y - aTileOrigin.y,
-                                     drawBounds.width, drawBounds.height));
-      }
-    } else {
-      // failed to obtain the client as an ImageSurface
-      doBufferedDrawing = false;
-    }
-  }
-
-  // this might get set above if we couldn't extract out a buffer
-  if (!doBufferedDrawing) {
-    drawTarget = textureClient->BorrowDrawTarget();
-
-    fullPaint = true;
-    drawBounds = nsIntRect(aTileOrigin.x, aTileOrigin.y, GetScaledTileSize().width, GetScaledTileSize().height);
-    drawRegion = nsIntRegion(drawBounds);
-
-    if (GetContentType() == gfxContentType::COLOR_ALPHA)
-      drawTarget->ClearRect(Rect(0, 0, drawBounds.width, drawBounds.height));
-  }
-
-  // do the drawing
-  RefPtr<gfxContext> ctxt = new gfxContext(drawTarget);
-
-  ctxt->SetMatrix(
-    ctxt->CurrentMatrix().Scale(mResolution, mResolution).
-                          Translate(-aTileOrigin.x, -aTileOrigin.y));
-
-  mCallback(mThebesLayer, ctxt,
-            drawRegion,
-            fullPaint ? DrawRegionClip::CLIP_NONE : DrawRegionClip::DRAW_SNAPPED, // XXX DRAW or DRAW_SNAPPED?
-            invalidateRegion,
-            mCallbackData);
-
-  ctxt = nullptr;
-
-  if (doBufferedDrawing) {
-    memcpy(srcData, bufferData, srcSize.height * srcStride);
-    bufferData = nullptr;
-    srcDT->ReleaseBits(srcData);
-    srcDT = nullptr;
-  }
-
-  drawTarget = nullptr;
-  textureClient->Unlock();
-
-  if (!mCompositableClient->AddTextureClient(textureClient)) {
-    NS_WARNING("Failed to add tile TextureClient [simple]");
-    return SimpleTiledLayerTile();
-  }
-
-  // aTile.mCachedBuffer was set earlier
-  aTile.mTileBuffer = textureClient;
-  aTile.mManager = mManager;
-  aTile.mLastUpdate = TimeStamp::Now();
-
-  return aTile;
-}
-
-SurfaceDescriptorTiles
-SimpleTiledLayerBuffer::GetSurfaceDescriptorTiles()
-{
-  InfallibleTArray<TileDescriptor> tiles;
-
-  for (size_t i = 0; i < mRetainedTiles.Length(); i++) {
-    tiles.AppendElement(mRetainedTiles[i].GetTileDescriptor());
-  }
-
-  return SurfaceDescriptorTiles(mValidRegion, mPaintedRegion,
-                                tiles, mRetainedWidth, mRetainedHeight,
-                                mResolution, mFrameResolution.scale);
-}
-
-bool
-SimpleTiledLayerBuffer::HasFormatChanged() const
-{
-  return mThebesLayer->CanUseOpaqueSurface() != mLastPaintOpaque;
-}
-
-gfxContentType
-SimpleTiledLayerBuffer::GetContentType() const
-{
-  if (mThebesLayer->CanUseOpaqueSurface())
-    return gfxContentType::COLOR;
-
-  return gfxContentType::COLOR_ALPHA;
-}
-
-SimpleTiledContentClient::SimpleTiledContentClient(SimpleClientTiledThebesLayer* aThebesLayer,
-                                                   ClientLayerManager* aManager)
-  : CompositableClient(aManager->AsShadowForwarder())
-  , mTiledBuffer(aThebesLayer, MOZ_THIS_IN_INITIALIZER_LIST(), aManager)
-{
-  MOZ_COUNT_CTOR(SimpleTiledContentClient);
-}
-
-SimpleTiledContentClient::~SimpleTiledContentClient()
-{
-  MOZ_COUNT_DTOR(SimpleTiledContentClient);
-  mTiledBuffer.Release();
-}
-
-void
-SimpleTiledContentClient::UseTiledLayerBuffer()
-{
-  mForwarder->UseTiledLayerBuffer(this, mTiledBuffer.GetSurfaceDescriptorTiles());
-  mTiledBuffer.ClearPaintedRegion();
-}
-
-SimpleClientTiledThebesLayer::SimpleClientTiledThebesLayer(ClientLayerManager* aManager,
-                                                           ClientLayerManager::ThebesLayerCreationHint aCreationHint)
-  : ThebesLayer(aManager,
-                static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()),
-                aCreationHint)
-  , mContentClient()
-{
-  MOZ_COUNT_CTOR(SimpleClientTiledThebesLayer);
-}
-
-SimpleClientTiledThebesLayer::~SimpleClientTiledThebesLayer()
-{
-  MOZ_COUNT_DTOR(SimpleClientTiledThebesLayer);
-}
-
-void
-SimpleClientTiledThebesLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
-{
-  aAttrs = ThebesLayerAttributes(GetValidRegion());
-}
-
-void
-SimpleClientTiledThebesLayer::RenderLayer()
-{
-  LayerManager::DrawThebesLayerCallback callback =
-    ClientManager()->GetThebesLayerCallback();
-  void *data = ClientManager()->GetThebesLayerCallbackData();
-  if (!callback) {
-    ClientManager()->SetTransactionIncomplete();
-    return;
-  }
-
-  // First time? Create a content client.
-  if (!mContentClient) {
-    mContentClient = new SimpleTiledContentClient(this, ClientManager());
-
-    mContentClient->Connect();
-    ClientManager()->AsShadowForwarder()->Attach(mContentClient, this);
-    MOZ_ASSERT(mContentClient->GetForwarder());
-  }
-
-  // If the format changed, nothing is valid
-  if (mContentClient->mTiledBuffer.HasFormatChanged()) {
-    mValidRegion = nsIntRegion();
-  }
-
-  nsIntRegion invalidRegion = mVisibleRegion;
-  invalidRegion.Sub(invalidRegion, mValidRegion);
-  if (invalidRegion.IsEmpty()) {
-    return;
-  }
-
-  // Only paint the mask layer on the first transaction.
-  if (GetMaskLayer() && !ClientManager()->IsRepeatTransaction()) {
-    ToClientLayer(GetMaskLayer())->RenderLayer();
-  }
-
-  // SimpleTiledContentClient doesn't support progressive updates or the low
-  // precision buffer yet.
-  MOZ_ASSERT(!gfxPrefs::UseProgressiveTilePainting() &&
-             !gfxPrefs::UseLowPrecisionBuffer());
-
-  mValidRegion = mVisibleRegion;
-
-  NS_ASSERTION(!ClientManager()->IsRepeatTransaction(), "Didn't paint our mask layer");
-
-  mContentClient->mTiledBuffer.PaintThebes(mValidRegion, invalidRegion,
-                                           callback, data);
-
-  ClientManager()->Hold(this);
-
-  mContentClient->UseTiledLayerBuffer();
-}
-
-
-}
-}
deleted file mode 100644
--- a/gfx/layers/client/SimpleTiledContentClient.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * 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 MOZILLA_GFX_SIMPLETILEDCONTENTCLIENT_H
-#define MOZILLA_GFX_SIMPLETILEDCONTENTCLIENT_H
-
-// We include this header here so that we don't need to
-// duplicate BasicTiledLayerPaintData
-#include "TiledContentClient.h"
-
-#include "SharedBuffer.h"
-
-namespace mozilla {
-namespace layers {
-
-class ClientTiledThebesLayer;
-
-struct SimpleTiledLayerTile;
-class SimpleTiledLayerBuffer;
-class SimpleClientTiledThebesLayer;
-class SimpleTiledLayerBuffer;
-
-#define GFX_SIMP_TILEDLAYER_DEBUG_OVERLAY
-
-struct SimpleTiledLayerTile
-{
-  RefPtr<TextureClient> mTileBuffer;
-  RefPtr<ClientLayerManager> mManager;
-  nsRefPtr<SharedBuffer> mCachedBuffer;
-  TimeStamp mLastUpdate;
-
-  SimpleTiledLayerTile() { }
-
-  SimpleTiledLayerTile(ClientLayerManager *aManager, TextureClient *aBuffer)
-    : mTileBuffer(aBuffer)
-    , mManager(aManager)
-  { }
-
-  bool operator== (const SimpleTiledLayerTile& o) const
-  {
-    return mTileBuffer == o.mTileBuffer;
-  }
-
-  bool operator!= (const SimpleTiledLayerTile& o) const
-  {
-    return mTileBuffer != o.mTileBuffer;
-  }
-
-  void SetLayerManager(ClientLayerManager *aManager)
-  {
-    mManager = aManager;
-  }
-
-  bool IsPlaceholderTile()
-  {
-    return mTileBuffer == nullptr;
-  }
-
-  TileDescriptor GetTileDescriptor()
-  {
-    if (mTileBuffer)
-      return TexturedTileDescriptor(nullptr, mTileBuffer->GetIPDLActor(), null_t(), 0);
-
-    NS_NOTREACHED("Unhandled SimpleTiledLayerTile type");
-    return PlaceholderTileDescriptor();
-  }
-
-  void Release()
-  {
-    mTileBuffer = nullptr;
-    mCachedBuffer = nullptr;
-  }
-};
-
-class SimpleTiledLayerBuffer
-  : public TiledLayerBuffer<SimpleTiledLayerBuffer, SimpleTiledLayerTile>
-{
-  friend class TiledLayerBuffer<SimpleTiledLayerBuffer, SimpleTiledLayerTile>;
-
-public:
-  SimpleTiledLayerBuffer(SimpleClientTiledThebesLayer* aThebesLayer,
-                         CompositableClient* aCompositableClient,
-                         ClientLayerManager* aManager)
-    : mThebesLayer(aThebesLayer)
-    , mCompositableClient(aCompositableClient)
-    , mManager(aManager)
-    , mLastPaintOpaque(false)
-  {}
-
-  SimpleTiledLayerBuffer()
-    : mLastPaintOpaque(false)
-  {}
-
-  void PaintThebes(const nsIntRegion& aNewValidRegion,
-                   const nsIntRegion& aPaintRegion,
-                   LayerManager::DrawThebesLayerCallback aCallback,
-                   void* aCallbackData);
-
-  SurfaceDescriptorTiles GetSurfaceDescriptorTiles();
-
-  void Release() {
-    for (size_t i = 0; i < mRetainedTiles.Length(); i++) {
-      mRetainedTiles[i].Release();
-    }
-  }
-
-  const CSSToParentLayerScale& GetFrameResolution() const { return mFrameResolution; }
-  void SetFrameResolution(const CSSToParentLayerScale& aResolution) { mFrameResolution = aResolution; }
-
-  bool HasFormatChanged() const;
-private:
-  SimpleClientTiledThebesLayer* mThebesLayer;
-  CompositableClient* mCompositableClient;
-  ClientLayerManager* mManager;
-  LayerManager::DrawThebesLayerCallback mCallback;
-  void* mCallbackData;
-  CSSToParentLayerScale mFrameResolution;
-  bool mLastPaintOpaque;
-
-  gfxContentType GetContentType() const;
-
-  SimpleTiledLayerTile ValidateTile(SimpleTiledLayerTile aTile,
-                                    const nsIntPoint& aTileOrigin,
-                                    const nsIntRegion& aDirtyRect);
-
-  SimpleTiledLayerTile GetPlaceholderTile() const { return SimpleTiledLayerTile(); }
-
-  void ReleaseTile(SimpleTiledLayerTile aTile) { aTile.Release(); }
-
-  void SwapTiles(SimpleTiledLayerTile& aTileA, SimpleTiledLayerTile& aTileB) { std::swap(aTileA, aTileB); }
-
-  void PostValidate(const nsIntRegion& aPaintRegion) {}
-  void UnlockTile(SimpleTiledLayerTile aTile) {}
-};
-
-class SimpleTiledContentClient : public CompositableClient
-{
-  friend class SimpleClientTiledThebesLayer;
-
-public:
-  SimpleTiledContentClient(SimpleClientTiledThebesLayer* aThebesLayer,
-                           ClientLayerManager* aManager);
-
-private:
-  ~SimpleTiledContentClient();
-
-  virtual TextureInfo GetTextureInfo() const MOZ_OVERRIDE
-  {
-    return TextureInfo(CompositableType::BUFFER_SIMPLE_TILED);
-  }
-
-  void UseTiledLayerBuffer();
-
-private:
-  SimpleTiledLayerBuffer mTiledBuffer;
-};
-
-class SimpleClientTiledThebesLayer : public ThebesLayer,
-                                     public ClientLayer
-{
-  typedef ThebesLayer Base;
-
-public:
-  explicit SimpleClientTiledThebesLayer(ClientLayerManager* const aManager,
-                                        ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE);
-protected:
-  ~SimpleClientTiledThebesLayer();
-
-public:
-  // Thebes Layer
-  virtual Layer* AsLayer() { return this; }
-  virtual void InvalidateRegion(const nsIntRegion& aRegion) {
-    mInvalidRegion.Or(mInvalidRegion, aRegion);
-    mValidRegion.Sub(mValidRegion, aRegion);
-  }
-
-  // Shadow methods
-  virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs);
-  virtual ShadowableLayer* AsShadowableLayer() { return this; }
-
-  virtual void Disconnect() { ClientLayer::Disconnect(); }
-
-  virtual void RenderLayer();
-
-protected:
-  ClientLayerManager* ClientManager() { return static_cast<ClientLayerManager*>(mManager); }
-
-  RefPtr<SimpleTiledContentClient> mContentClient;
-};
-
-} // mozilla
-} // layers
-
-#endif
--- a/gfx/layers/moz.build
+++ b/gfx/layers/moz.build
@@ -123,18 +123,16 @@ EXPORTS.mozilla.layers += [
     'AxisPhysicsMSDModel.h',
     'basic/BasicCompositor.h',
     'basic/MacIOSurfaceTextureHostBasic.h',
     'basic/TextureHostBasic.h',
     'client/CanvasClient.h',
     'client/CompositableClient.h',
     'client/ContentClient.h',
     'client/ImageClient.h',
-    'client/SimpleTextureClientPool.h',
-    'client/SimpleTiledContentClient.h',
     'client/TextureClient.h',
     'client/TextureClientPool.h',
     'client/TiledContentClient.h',
     'composite/AsyncCompositionManager.h',
     'composite/CanvasLayerComposite.h',
     'composite/ColorLayerComposite.h',
     'composite/ContainerLayerComposite.h',
     'composite/ContentHost.h',
@@ -267,18 +265,16 @@ UNIFIED_SOURCES += [
     'client/ClientContainerLayer.cpp',
     'client/ClientImageLayer.cpp',
     'client/ClientLayerManager.cpp',
     'client/ClientThebesLayer.cpp',
     'client/ClientTiledThebesLayer.cpp',
     'client/CompositableClient.cpp',
     'client/ContentClient.cpp',
     'client/ImageClient.cpp',
-    'client/SimpleTextureClientPool.cpp',
-    'client/SimpleTiledContentClient.cpp',
     'client/TextureClient.cpp',
     'client/TextureClientPool.cpp',
     'client/TiledContentClient.cpp',
     'composite/AsyncCompositionManager.cpp',
     'composite/CanvasLayerComposite.cpp',
     'composite/ColorLayerComposite.cpp',
     'composite/CompositableHost.cpp',
     'composite/ContainerLayerComposite.cpp',
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -241,17 +241,16 @@ private:
   // 0 is "no change" for contrast, positive values increase it, negative values
   // decrease it until we hit mid gray at -1 contrast, after that it gets weird.
   DECL_GFX_PREF(Live, "layers.effect.contrast",                LayersEffectContrast, float, 0.0f);
   DECL_GFX_PREF(Live, "layers.effect.grayscale",               LayersEffectGrayscale, bool, false);
   DECL_GFX_PREF(Live, "layers.effect.invert",                  LayersEffectInvert, bool, false);
 
   DECL_GFX_PREF(Once, "layers.enable-tiles",                   LayersTilesEnabled, bool, false);
   DECL_GFX_PREF(Once, "layers.force-enable-tiles",             LayersTilesForceEnabled, bool, false);
-  DECL_GFX_PREF(Once, "layers.simple-tiles",                   LayersUseSimpleTiles, bool, false);
   DECL_GFX_PREF(Once, "layers.force-per-tile-drawing",         PerTileDrawing, bool, false);
   DECL_GFX_PREF(Once, "layers.tiled-drawtarget.enabled",       TiledDrawTargetEnabled, bool, false);
   // We allow for configurable and rectangular tile size to avoid wasting memory on devices whose
   // screen size does not align nicely to the default tile size. Although layers can be any size,
   // they are often the same size as the screen, especially for width.
   DECL_GFX_PREF(Once, "layers.tile-width",                     LayersTileWidth, int32_t, 256);
   DECL_GFX_PREF(Once, "layers.tile-height",                    LayersTileHeight, int32_t, 256);
   DECL_GFX_PREF(Once, "layers.tile-max-pool-size",             LayersTileMaxPoolSize, uint32_t, (uint32_t)50);