Backed out changeset dd9790020b89 (bug 1042696) for B2G debug crashes.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 22 Dec 2014 11:15:36 -0500
changeset 220944 daa2d1ac6b18d5167f65dbd2f4a77e2cef93a425
parent 220943 22dfb07a3a35f3866fb984865a1b34c2a93f4d26
child 220945 0076eb0ed38cbac508e839e20b6e061ac31fc12e
push id28004
push userryanvm@gmail.com
push dateMon, 22 Dec 2014 22:55:36 +0000
treeherdermozilla-central@f6d10f05f6e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1042696
milestone37.0a1
backs outdd9790020b8953505836f22fd3f189baec75c77b
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
Backed out changeset dd9790020b89 (bug 1042696) for B2G debug crashes.
gfx/layers/D3D9SurfaceImage.cpp
gfx/layers/MacIOSurfaceImage.cpp
gfx/layers/TextureDIB.cpp
gfx/layers/TextureDIB.h
gfx/layers/basic/TextureClientX11.cpp
gfx/layers/basic/TextureClientX11.h
gfx/layers/client/CanvasClient.cpp
gfx/layers/client/ImageClient.cpp
gfx/layers/client/TextureClient.cpp
gfx/layers/client/TextureClient.h
gfx/layers/d3d11/TextureD3D11.cpp
gfx/layers/d3d11/TextureD3D11.h
gfx/layers/d3d9/TextureD3D9.cpp
gfx/layers/d3d9/TextureD3D9.h
gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp
gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h
gfx/layers/opengl/TextureClientOGL.cpp
gfx/layers/opengl/TextureClientOGL.h
--- a/gfx/layers/D3D9SurfaceImage.cpp
+++ b/gfx/layers/D3D9SurfaceImage.cpp
@@ -1,18 +1,16 @@
 /* -*- 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 "D3D9SurfaceImage.h"
 #include "gfx2DGlue.h"
 #include "mozilla/layers/TextureD3D9.h"
-#include "mozilla/layers/CompositableClient.h"
-#include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/gfx/Types.h"
 
 namespace mozilla {
 namespace layers {
 
 
 D3D9SurfaceImage::D3D9SurfaceImage()
   : Image(nullptr, ImageFormat::D3D9_RGB32_TEXTURE)
@@ -129,19 +127,17 @@ D3D9SurfaceImage::GetSize()
 }
 
 TextureClient*
 D3D9SurfaceImage::GetTextureClient(CompositableClient* aClient)
 {
   EnsureSynchronized();
   if (!mTextureClient) {
     RefPtr<SharedTextureClientD3D9> textureClient =
-      new SharedTextureClientD3D9(aClient->GetForwarder(),
-                                  gfx::SurfaceFormat::B8G8R8X8,
-                                  TextureFlags::DEFAULT);
+      new SharedTextureClientD3D9(gfx::SurfaceFormat::B8G8R8X8, TextureFlags::DEFAULT);
     textureClient->InitWith(mTexture, mShareHandle, mDesc);
     mTextureClient = textureClient;
   }
   return mTextureClient;
 }
 
 TemporaryRef<gfx::SourceSurface>
 D3D9SurfaceImage::GetAsSourceSurface()
--- a/gfx/layers/MacIOSurfaceImage.cpp
+++ b/gfx/layers/MacIOSurfaceImage.cpp
@@ -1,27 +1,25 @@
 /* -*- 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 "MacIOSurfaceImage.h"
-#include "mozilla/layers/CompositableClient.h"
-#include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/MacIOSurfaceTextureClientOGL.h"
 
 using namespace mozilla;
 using namespace mozilla::layers;
 
 TextureClient*
 MacIOSurfaceImage::GetTextureClient(CompositableClient* aClient)
 {
   if (!mTextureClient) {
     RefPtr<MacIOSurfaceTextureClientOGL> buffer =
-      new MacIOSurfaceTextureClientOGL(aClient->GetForwarder(), TextureFlags::DEFAULT);
+      new MacIOSurfaceTextureClientOGL(TextureFlags::DEFAULT);
     buffer->InitWith(mSurface);
     mTextureClient = buffer;
   }
   return mTextureClient;
 }
 
 TemporaryRef<gfx::SourceSurface>
 MacIOSurfaceImage::GetAsSourceSurface()
--- a/gfx/layers/TextureDIB.cpp
+++ b/gfx/layers/TextureDIB.cpp
@@ -7,37 +7,34 @@
 #include "gfx2DGlue.h"
 
 namespace mozilla {
 
 using namespace gfx;
 
 namespace layers {
 
-DIBTextureClient::DIBTextureClient(ISurfaceAllocator* aAllocator,
-                                   gfx::SurfaceFormat aFormat,
-                                   TextureFlags aFlags)
-  : TextureClient(aAllocator, aFlags)
+DIBTextureClient::DIBTextureClient(gfx::SurfaceFormat aFormat, TextureFlags aFlags)
+  : TextureClient(aFlags)
   , mFormat(aFormat)
   , mIsLocked(false)
 {
   MOZ_COUNT_CTOR(DIBTextureClient);
 }
 
 DIBTextureClient::~DIBTextureClient()
 {
   MOZ_COUNT_DTOR(DIBTextureClient);
 }
 
 TemporaryRef<TextureClient>
 DIBTextureClient::CreateSimilar(TextureFlags aFlags,
                                 TextureAllocationFlags aAllocFlags) const
 {
-  RefPtr<TextureClient> tex = new DIBTextureClient(mAllocator, mFormat, 
-                                                   mFlags | aFlags);
+  RefPtr<TextureClient> tex = new DIBTextureClient(mFormat, mFlags | aFlags);
 
   if (!tex->AllocateForSurface(mSize, aAllocFlags)) {
     return nullptr;
   }
 
   return tex;
 }
 
--- a/gfx/layers/TextureDIB.h
+++ b/gfx/layers/TextureDIB.h
@@ -18,19 +18,17 @@ namespace layers {
 /**
   * Can only be drawn into through Cairo.
   * Prefer CairoTextureClient when possible.
   * The coresponding TextureHost depends on the compositor
   */
 class DIBTextureClient : public TextureClient
 {
 public:
-  DIBTextureClient(ISurfaceAllocator* aAllocator,
-                   gfx::SurfaceFormat aFormat,
-                   TextureFlags aFlags);
+  DIBTextureClient(gfx::SurfaceFormat aFormat, TextureFlags aFlags);
 
   virtual ~DIBTextureClient();
 
   // TextureClient
 
   virtual bool IsAllocated() const MOZ_OVERRIDE { return !!mSurface; }
 
   virtual bool Lock(OpenMode aOpenMode) MOZ_OVERRIDE;
--- a/gfx/layers/basic/TextureClientX11.cpp
+++ b/gfx/layers/basic/TextureClientX11.cpp
@@ -14,21 +14,20 @@
 
 #include "mozilla/X11Util.h"
 #include <X11/Xlib.h>
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::layers;
 
-TextureClientX11::TextureClientX11(ISurfaceAllocator* aAllocator,
-                                   SurfaceFormat aFormat,
-                                   TextureFlags aFlags)
-  : TextureClient(aAllocator, aFlags),
+TextureClientX11::TextureClientX11(ISurfaceAllocator* aAllocator, SurfaceFormat aFormat, TextureFlags aFlags)
+  : TextureClient(aFlags),
     mFormat(aFormat),
+    mAllocator(aAllocator),
     mLocked(false)
 {
   MOZ_COUNT_CTOR(TextureClientX11);
 }
 
 TextureClientX11::~TextureClientX11()
 {
   MOZ_COUNT_DTOR(TextureClientX11);
--- a/gfx/layers/basic/TextureClientX11.h
+++ b/gfx/layers/basic/TextureClientX11.h
@@ -50,16 +50,17 @@ class TextureClientX11 : public TextureC
   virtual TemporaryRef<TextureClient>
   CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT,
                 TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const MOZ_OVERRIDE;
 
  private:
   gfx::SurfaceFormat mFormat;
   gfx::IntSize mSize;
   RefPtr<gfxXlibSurface> mSurface;
+  RefPtr<ISurfaceAllocator> mAllocator;
   RefPtr<gfx::DrawTarget> mDrawTarget;
   bool mLocked;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif
--- a/gfx/layers/client/CanvasClient.cpp
+++ b/gfx/layers/client/CanvasClient.cpp
@@ -150,30 +150,29 @@ CanvasClientSharedSurface::CanvasClientS
   : CanvasClient(aLayerForwarder, aFlags)
 {
 }
 
 ////////////////////////////////////////
 // Accelerated backends
 
 static TemporaryRef<TextureClient>
-TexClientFromShSurf(ISurfaceAllocator* aAllocator, SharedSurface* surf,
-                    TextureFlags flags)
+TexClientFromShSurf(SharedSurface* surf, TextureFlags flags)
 {
   switch (surf->mType) {
     case SharedSurfaceType::Basic:
       return nullptr;
 
 #ifdef MOZ_WIDGET_GONK
     case SharedSurfaceType::Gralloc:
       return GrallocTextureClientOGL::FromSharedSurface(surf, flags);
 #endif
 
     default:
-      return new SharedSurfaceTextureClient(aAllocator, flags, surf);
+      return new SharedSurfaceTextureClient(flags, surf);
   }
 }
 
 ////////////////////////////////////////
 // Readback
 
 // For formats compatible with R8G8B8A8.
 static inline void SwapRB_R8G8B8A8(uint8_t* pixel) {
@@ -360,17 +359,17 @@ CanvasClientSharedSurface::Update(gfx::I
   MOZ_ASSERT(mFront);
 
   // Alright, now sort out the IPC goop.
   SharedSurface* surf = mFront->Surf();
   auto forwarder = GetForwarder();
   auto flags = GetTextureFlags() | TextureFlags::IMMUTABLE;
 
   // Get a TexClient from our surf.
-  RefPtr<TextureClient> newTex = TexClientFromShSurf(GetForwarder(), surf, flags);
+  RefPtr<TextureClient> newTex = TexClientFromShSurf(surf, flags);
   if (!newTex) {
     auto manager = aLayer->ClientManager();
     auto shadowForwarder = manager->AsShadowForwarder();
     auto layersBackend = shadowForwarder->GetCompositorBackendType();
 
     newTex = TexClientFromReadback(surf, forwarder, flags, layersBackend);
   }
   MOZ_ASSERT(newTex);
--- a/gfx/layers/client/ImageClient.cpp
+++ b/gfx/layers/client/ImageClient.cpp
@@ -187,27 +187,25 @@ ImageClientSingle::UpdateImage(ImageCont
       }
 
     } else if (image->GetFormat() == ImageFormat::SURFACE_TEXTURE ||
                image->GetFormat() == ImageFormat::EGLIMAGE) {
       gfx::IntSize size = image->GetSize();
 
       if (image->GetFormat() == ImageFormat::EGLIMAGE) {
         EGLImageImage* typedImage = static_cast<EGLImageImage*>(image);
-        texture = new EGLImageTextureClient(GetForwarder(),
-                                            mTextureFlags,
-                                            typedImage,
-                                            size);
+        texture = new EGLImageTextureClient(mTextureFlags,
+                                           typedImage,
+                                           size);
 #ifdef MOZ_WIDGET_ANDROID
       } else if (image->GetFormat() == ImageFormat::SURFACE_TEXTURE) {
         SurfaceTextureImage* typedImage = static_cast<SurfaceTextureImage*>(image);
         const SurfaceTextureImage::Data* data = typedImage->GetData();
-        texture = new SurfaceTextureClient(GetForwarder(), mTextureFlags,
-                                           data->mSurfTex, size,
-                                           data->mInverted);
+        texture = new SurfaceTextureClient(mTextureFlags, data->mSurfTex,
+                                          size, data->mInverted);
 #endif
       } else {
         MOZ_ASSERT(false, "Bad ImageFormat.");
       }
     } else {
       RefPtr<gfx::SourceSurface> surface = image->GetAsSourceSurface();
       MOZ_ASSERT(surface);
       texture = CreateTextureClientForDrawing(surface->GetFormat(), image->GetSize(),
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -230,31 +230,32 @@ TextureClient::SetAddedToCompositableCli
   if (!mAddedToCompositableClient) {
     mAddedToCompositableClient = true;
   }
 }
 
 bool
 TextureClient::InitIPDLActor(CompositableForwarder* aForwarder)
 {
-  MOZ_ASSERT(aForwarder && aForwarder == mAllocator);
+  MOZ_ASSERT(aForwarder);
   if (mActor && mActor->GetForwarder() == aForwarder) {
     return true;
   }
   MOZ_ASSERT(!mActor, "Cannot use a texture on several IPC channels.");
 
   SurfaceDescriptor desc;
   if (!ToSurfaceDescriptor(desc)) {
     return false;
   }
 
   mActor = static_cast<TextureChild*>(aForwarder->CreateTexture(desc, GetFlags()));
   MOZ_ASSERT(mActor);
   mActor->mForwarder = aForwarder;
   mActor->mTextureClient = this;
+  mAllocator = aForwarder;
   mShared = true;
   return mActor->IPCOpen();
 }
 
 PTextureChild*
 TextureClient::GetIPDLActor()
 {
   return mActor;
@@ -325,32 +326,32 @@ TextureClient::CreateForDrawing(ISurface
 #ifdef XP_WIN
   LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
   if (parentBackend == LayersBackend::LAYERS_D3D11 &&
       (aMoz2DBackend == gfx::BackendType::DIRECT2D ||
         aMoz2DBackend == gfx::BackendType::DIRECT2D1_1) &&
       gfxWindowsPlatform::GetPlatform()->GetD2DDevice() &&
       aSize.width <= maxTextureSize &&
       aSize.height <= maxTextureSize) {
-    texture = new TextureClientD3D11(aAllocator, aFormat, aTextureFlags);
+    texture = new TextureClientD3D11(aFormat, aTextureFlags);
   }
   if (parentBackend == LayersBackend::LAYERS_D3D9 &&
       aMoz2DBackend == gfx::BackendType::CAIRO &&
       aAllocator->IsSameProcess() &&
       aSize.width <= maxTextureSize &&
       aSize.height <= maxTextureSize) {
     if (gfxWindowsPlatform::GetPlatform()->GetD3D9Device()) {
-      texture = new CairoTextureClientD3D9(aAllocator, aFormat, aTextureFlags);
+      texture = new CairoTextureClientD3D9(aFormat, aTextureFlags);
     }
   }
 
   if (!texture && aFormat == SurfaceFormat::B8G8R8X8 &&
       aAllocator->IsSameProcess() &&
       aMoz2DBackend == gfx::BackendType::CAIRO) {
-    texture = new DIBTextureClient(aAllocator, aFormat, aTextureFlags);
+    texture = new DIBTextureClient(aFormat, aTextureFlags);
   }
 
 #endif
 
 #ifdef MOZ_X11
   LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
   gfxSurfaceType type =
     gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType();
@@ -473,19 +474,18 @@ TextureClient::CreateWithBufferSize(ISur
 
   if (!texture->Allocate(aSize)) {
     return nullptr;
   }
 
   return texture;
 }
 
-TextureClient::TextureClient(ISurfaceAllocator* aAllocator, TextureFlags aFlags)
-  : mAllocator(aAllocator)
-  , mFlags(aFlags)
+TextureClient::TextureClient(TextureFlags aFlags)
+  : mFlags(aFlags)
   , mShared(false)
   , mValid(true)
   , mAddedToCompositableClient(false)
 #ifdef GFX_DEBUG_TRACK_CLIENTS_IN_POOL
   , mPoolTracker(nullptr)
 #endif
 {}
 
@@ -705,17 +705,18 @@ MemoryTextureClient::~MemoryTextureClien
     delete [] mBuffer;
   }
 }
 
 BufferTextureClient::BufferTextureClient(ISurfaceAllocator* aAllocator,
                                          gfx::SurfaceFormat aFormat,
                                          gfx::BackendType aMoz2DBackend,
                                          TextureFlags aFlags)
-  : TextureClient(aAllocator, aFlags)
+  : TextureClient(aFlags)
+  , mAllocator(aAllocator)
   , mFormat(aFormat)
   , mBackend(aMoz2DBackend)
   , mOpenMode(OpenMode::OPEN_NONE)
   , mLocked(false)
 {}
 
 BufferTextureClient::~BufferTextureClient()
 {}
@@ -728,16 +729,22 @@ BufferTextureClient::CreateSimilar(Textu
   RefPtr<BufferTextureClient> newBufferTex = TextureClient::CreateForRawBufferAccess(
     mAllocator, mFormat, mSize, mBackend, mFlags | aFlags, aAllocFlags
   );
 
   RefPtr<TextureClient> newTex = newBufferTex.get();
   return newTex;
 }
 
+ISurfaceAllocator*
+BufferTextureClient::GetAllocator() const
+{
+  return mAllocator;
+}
+
 bool
 BufferTextureClient::AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlags aFlags)
 {
   MOZ_ASSERT(IsValid());
   MOZ_ASSERT(mFormat != gfx::SurfaceFormat::YUV, "This textureClient cannot use YCbCr data");
   MOZ_ASSERT(aSize.width > 0 && aSize.height > 0);
 
   if (aSize.width <= 0 || aSize.height <= 0) {
@@ -895,20 +902,19 @@ BufferTextureClient::GetAsSurface()
                                                   serializer.GetSize(),
                                                   serializer.GetFormat());
   return gfx::CreateDataSourceSurfaceByCloning(wrappingSurf);
 }
 
 ////////////////////////////////////////////////////////////////////////
 // SharedSurfaceTextureClient
 
-SharedSurfaceTextureClient::SharedSurfaceTextureClient(ISurfaceAllocator* aAllocator,
-                                                       TextureFlags aFlags,
+SharedSurfaceTextureClient::SharedSurfaceTextureClient(TextureFlags aFlags,
                                                        gl::SharedSurface* surf)
-  : TextureClient(aAllocator, aFlags)
+  : TextureClient(aFlags)
   , mIsLocked(false)
   , mSurf(surf)
   , mGL(mSurf->mGL)
 {
 }
 
 SharedSurfaceTextureClient::~SharedSurfaceTextureClient()
 {
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -168,18 +168,17 @@ protected:
  * responsibility of the compositable (which would use two Texture pairs).
  * In order to send several different buffers to the compositor side, use
  * several TextureClients.
  */
 class TextureClient
   : public AtomicRefCountedWithFinalize<TextureClient>
 {
 public:
-  explicit TextureClient(ISurfaceAllocator* aAllocator,
-                         TextureFlags aFlags = TextureFlags::DEFAULT);
+  explicit TextureClient(TextureFlags aFlags = TextureFlags::DEFAULT);
   virtual ~TextureClient();
 
   // Creates and allocates a TextureClient usable with Moz2D.
   static TemporaryRef<TextureClient>
   CreateForDrawing(ISurfaceAllocator* aAllocator,
                    gfx::SurfaceFormat aFormat,
                    gfx::IntSize aSize,
                    gfx::BackendType aMoz2dBackend,
@@ -598,22 +597,25 @@ public:
   // that are overridden in GrallocTextureClient (which does not implement the
   // two methods below)
   virtual bool Allocate(uint32_t aSize) = 0;
 
   virtual size_t GetBufferSize() const = 0;
 
   virtual bool HasInternalBuffer() const MOZ_OVERRIDE { return true; }
 
+  ISurfaceAllocator* GetAllocator() const;
+
   virtual TemporaryRef<TextureClient>
   CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT,
                 TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const MOZ_OVERRIDE;
 
 protected:
   RefPtr<gfx::DrawTarget> mDrawTarget;
+  RefPtr<ISurfaceAllocator> mAllocator;
   gfx::SurfaceFormat mFormat;
   gfx::IntSize mSize;
   gfx::BackendType mBackend;
   OpenMode mOpenMode;
   bool mLocked;
 };
 
 /**
@@ -682,18 +684,17 @@ protected:
 };
 
 /**
  * A TextureClient implementation to share SharedSurfaces.
  */
 class SharedSurfaceTextureClient : public TextureClient
 {
 public:
-  SharedSurfaceTextureClient(ISurfaceAllocator* aAllocator, TextureFlags aFlags,
-                             gl::SharedSurface* surf);
+  SharedSurfaceTextureClient(TextureFlags aFlags, gl::SharedSurface* surf);
 
 protected:
   ~SharedSurfaceTextureClient();
 
 public:
   // Boilerplate start
   virtual bool IsAllocated() const MOZ_OVERRIDE { return true; }
 
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -156,20 +156,18 @@ CreateTextureHostD3D11(const SurfaceDesc
     }
     default: {
       NS_WARNING("Unsupported SurfaceDescriptor type");
     }
   }
   return result;
 }
 
-TextureClientD3D11::TextureClientD3D11(ISurfaceAllocator* aAllocator,
-                                       gfx::SurfaceFormat aFormat,
-                                       TextureFlags aFlags)
-  : TextureClient(aAllocator, aFlags)
+TextureClientD3D11::TextureClientD3D11(gfx::SurfaceFormat aFormat, TextureFlags aFlags)
+  : TextureClient(aFlags)
   , mFormat(aFormat)
   , mIsLocked(false)
   , mNeedsClear(false)
   , mNeedsClearWhite(false)
 {}
 
 TextureClientD3D11::~TextureClientD3D11()
 {
@@ -202,18 +200,17 @@ TextureClientD3D11::~TextureClientD3D11(
   }
 #endif
 }
 
 TemporaryRef<TextureClient>
 TextureClientD3D11::CreateSimilar(TextureFlags aFlags,
                                   TextureAllocationFlags aAllocFlags) const
 {
-  RefPtr<TextureClient> tex = new TextureClientD3D11(mAllocator, mFormat,
-                                                     mFlags | aFlags);
+  RefPtr<TextureClient> tex = new TextureClientD3D11(mFormat, mFlags | aFlags);
 
   if (!tex->AllocateForSurface(mSize, aAllocFlags)) {
     return nullptr;
   }
 
   return tex;
 }
 
--- a/gfx/layers/d3d11/TextureD3D11.h
+++ b/gfx/layers/d3d11/TextureD3D11.h
@@ -23,19 +23,17 @@ class CompositorD3D11;
 
 /**
  * A TextureClient to share a D3D10 texture with the compositor thread.
  * The corresponding TextureHost is DXGITextureHostD3D11
  */
 class TextureClientD3D11 : public TextureClient
 {
 public:
-  TextureClientD3D11(ISurfaceAllocator* aAllocator,
-                     gfx::SurfaceFormat aFormat,
-                     TextureFlags aFlags);
+  TextureClientD3D11(gfx::SurfaceFormat aFormat, TextureFlags aFlags);
 
   virtual ~TextureClientD3D11();
 
   // TextureClient
 
   virtual bool IsAllocated() const MOZ_OVERRIDE { return mTexture || mTexture10; }
 
   virtual bool Lock(OpenMode aOpenMode) MOZ_OVERRIDE;
--- a/gfx/layers/d3d9/TextureD3D9.cpp
+++ b/gfx/layers/d3d9/TextureD3D9.cpp
@@ -545,20 +545,18 @@ DataTextureSourceD3D9::GetTileRect(uint3
 }
 
 nsIntRect
 DataTextureSourceD3D9::GetTileRect()
 {
   return ThebesIntRect(GetTileRect(mCurrentTile));
 }
 
-CairoTextureClientD3D9::CairoTextureClientD3D9(ISurfaceAllocator* aAllocator,
-                                               gfx::SurfaceFormat aFormat,
-                                               TextureFlags aFlags)
-  : TextureClient(aAllocator, aFlags)
+CairoTextureClientD3D9::CairoTextureClientD3D9(gfx::SurfaceFormat aFormat, TextureFlags aFlags)
+  : TextureClient(aFlags)
   , mFormat(aFormat)
   , mIsLocked(false)
   , mNeedsClear(false)
   , mNeedsClearWhite(false)
   , mLockRect(false)
 {
   MOZ_COUNT_CTOR(CairoTextureClientD3D9);
 }
@@ -566,18 +564,17 @@ CairoTextureClientD3D9::CairoTextureClie
 CairoTextureClientD3D9::~CairoTextureClientD3D9()
 {
   MOZ_COUNT_DTOR(CairoTextureClientD3D9);
 }
 
 TemporaryRef<TextureClient>
 CairoTextureClientD3D9::CreateSimilar(TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const
 {
-  RefPtr<TextureClient> tex = new CairoTextureClientD3D9(mAllocator, mFormat,
-                                                         mFlags | aFlags);
+  RefPtr<TextureClient> tex = new CairoTextureClientD3D9(mFormat, mFlags | aFlags);
 
   if (!tex->AllocateForSurface(mSize, aAllocFlags)) {
     return nullptr;
   }
 
   return tex;
 }
 
@@ -720,20 +717,18 @@ CairoTextureClientD3D9::AllocateForSurfa
 
   mNeedsClear = aFlags & ALLOC_CLEAR_BUFFER;
   mNeedsClearWhite = aFlags & ALLOC_CLEAR_BUFFER_WHITE;
 
   MOZ_ASSERT(mTexture);
   return true;
 }
 
-SharedTextureClientD3D9::SharedTextureClientD3D9(ISurfaceAllocator* aAllocator,
-                                                 gfx::SurfaceFormat aFormat,
-                                                 TextureFlags aFlags)
-  : TextureClient(aAllocator, aFlags)
+SharedTextureClientD3D9::SharedTextureClientD3D9(gfx::SurfaceFormat aFormat, TextureFlags aFlags)
+  : TextureClient(aFlags)
   , mFormat(aFormat)
   , mHandle(0)
   , mIsLocked(false)
 {
   MOZ_COUNT_CTOR(SharedTextureClientD3D9);
 }
 
 SharedTextureClientD3D9::~SharedTextureClientD3D9()
--- a/gfx/layers/d3d9/TextureD3D9.h
+++ b/gfx/layers/d3d9/TextureD3D9.h
@@ -182,18 +182,17 @@ protected:
 
 /**
  * Can only be drawn into through Cairo and need a D3D9 context on the client side.
  * The corresponding TextureHost is TextureHostD3D9.
  */
 class CairoTextureClientD3D9 : public TextureClient
 {
 public:
-  CairoTextureClientD3D9(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat,
-                         TextureFlags aFlags);
+  CairoTextureClientD3D9(gfx::SurfaceFormat aFormat, TextureFlags aFlags);
 
   virtual ~CairoTextureClientD3D9();
 
   // TextureClient
 
   virtual bool IsAllocated() const MOZ_OVERRIDE { return !!mTexture; }
 
   virtual bool Lock(OpenMode aOpenMode) MOZ_OVERRIDE;
@@ -237,19 +236,17 @@ private:
 /**
  * Wraps a D3D9 texture, shared with the compositor though DXGI.
  * At the moment it is only used with D3D11 compositing, and the corresponding
  * TextureHost is DXGITextureHostD3D11.
  */
 class SharedTextureClientD3D9 : public TextureClient
 {
 public:
-  SharedTextureClientD3D9(ISurfaceAllocator* aAllocator,
-                          gfx::SurfaceFormat aFormat,
-                          TextureFlags aFlags);
+  SharedTextureClientD3D9(gfx::SurfaceFormat aFormat, TextureFlags aFlags);
 
   virtual ~SharedTextureClientD3D9();
 
   // TextureClient
 
   virtual bool IsAllocated() const MOZ_OVERRIDE { return !!mTexture; }
 
   virtual bool Lock(OpenMode aOpenMode) MOZ_OVERRIDE;
--- a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp
+++ b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp
@@ -4,19 +4,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MacIOSurfaceTextureClientOGL.h"
 #include "mozilla/gfx/MacIOSurface.h"
 
 namespace mozilla {
 namespace layers {
 
-MacIOSurfaceTextureClientOGL::MacIOSurfaceTextureClientOGL(ISurfaceAllocator* aAllcator,
-                                                           TextureFlags aFlags)
-  : TextureClient(aAllcator, aFlags)
+MacIOSurfaceTextureClientOGL::MacIOSurfaceTextureClientOGL(TextureFlags aFlags)
+  : TextureClient(aFlags)
   , mIsLocked(false)
 {}
 
 MacIOSurfaceTextureClientOGL::~MacIOSurfaceTextureClientOGL()
 {}
 
 void
 MacIOSurfaceTextureClientOGL::InitWith(MacIOSurface* aSurface)
--- a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h
+++ b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h
@@ -11,18 +11,17 @@
 class MacIOSurface;
 
 namespace mozilla {
 namespace layers {
 
 class MacIOSurfaceTextureClientOGL : public TextureClient
 {
 public:
-  explicit MacIOSurfaceTextureClientOGL(ISurfaceAllocator* aAllcator,
-                                        TextureFlags aFlags);
+  explicit MacIOSurfaceTextureClientOGL(TextureFlags aFlags);
 
   virtual ~MacIOSurfaceTextureClientOGL();
 
   void InitWith(MacIOSurface* aSurface);
 
   virtual bool Lock(OpenMode aMode) MOZ_OVERRIDE;
 
   virtual void Unlock() MOZ_OVERRIDE;
--- a/gfx/layers/opengl/TextureClientOGL.cpp
+++ b/gfx/layers/opengl/TextureClientOGL.cpp
@@ -15,21 +15,20 @@ using namespace mozilla::gl;
 namespace mozilla {
 namespace layers {
 
 class CompositableForwarder;
 
 ////////////////////////////////////////////////////////////////////////
 // EGLImageTextureClient
 
-EGLImageTextureClient::EGLImageTextureClient(ISurfaceAllocator* aAllocator,
-                                             TextureFlags aFlags,
+EGLImageTextureClient::EGLImageTextureClient(TextureFlags aFlags,
                                              EGLImageImage* aImage,
                                              gfx::IntSize aSize)
-  : TextureClient(aAllocator, aFlags)
+  : TextureClient(aFlags)
   , mImage(aImage)
   , mSize(aSize)
   , mIsLocked(false)
 {
   MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default,
              "Can't pass an `EGLImage` between processes.");
 
   AddFlags(TextureFlags::DEALLOCATE_CLIENT);
@@ -68,22 +67,21 @@ EGLImageTextureClient::Unlock()
   mIsLocked = false;
 }
 
 ////////////////////////////////////////////////////////////////////////
 // SurfaceTextureClient
 
 #ifdef MOZ_WIDGET_ANDROID
 
-SurfaceTextureClient::SurfaceTextureClient(ISurfaceAllocator* aAllocator,
-                                           TextureFlags aFlags,
+SurfaceTextureClient::SurfaceTextureClient(TextureFlags aFlags,
                                            AndroidSurfaceTexture* aSurfTex,
                                            gfx::IntSize aSize,
                                            bool aInverted)
-  : TextureClient(aAllocator, aFlags)
+  : TextureClient(aFlags)
   , mSurfTex(aSurfTex)
   , mSize(aSize)
   , mIsLocked(false)
 {
   MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default,
              "Can't pass pointers between processes.");
 
   // Our data is always owned externally.
--- a/gfx/layers/opengl/TextureClientOGL.h
+++ b/gfx/layers/opengl/TextureClientOGL.h
@@ -20,18 +20,17 @@ namespace mozilla {
 
 namespace layers {
 
 class CompositableForwarder;
 
 class EGLImageTextureClient : public TextureClient
 {
 public:
-  EGLImageTextureClient(ISurfaceAllocator* aAllocator,
-                        TextureFlags aFlags,
+  EGLImageTextureClient(TextureFlags aFlags,
                         EGLImageImage* aImage,
                         gfx::IntSize aSize);
 
   virtual bool IsAllocated() const MOZ_OVERRIDE { return true; }
 
   virtual bool HasInternalBuffer() const MOZ_OVERRIDE { return false; }
 
   virtual gfx::IntSize GetSize() const { return mSize; }
@@ -68,18 +67,17 @@ protected:
   bool mIsLocked;
 };
 
 #ifdef MOZ_WIDGET_ANDROID
 
 class SurfaceTextureClient : public TextureClient
 {
 public:
-  SurfaceTextureClient(ISurfaceAllocator* aAllocator,
-                       TextureFlags aFlags,
+  SurfaceTextureClient(TextureFlags aFlags,
                        gl::AndroidSurfaceTexture* aSurfTex,
                        gfx::IntSize aSize,
                        bool aInverted);
 
   ~SurfaceTextureClient();
 
   virtual bool IsAllocated() const MOZ_OVERRIDE { return true; }