Bug 1405950 - Corrected bug in SurfaceFactory::NewTextClient preventing matching textures from being located in mRecycleFreePool r=jgilbert
☠☠ backed out by 7c205fdf625d ☠ ☠
authorKearwood "Kip" Gilbert <kgilbert@mozilla.com>
Thu, 05 Oct 2017 12:54:32 -0700
changeset 427510 0b70ead3e555da343acf9f3953fcfd6612d7ff31
parent 427509 32a477bbaf1c077830a0e581e7d1d38c8c9b2f7a
child 427511 f3e41eff3192312b05f0e3762fdc445b0a58e859
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewersjgilbert
bugs1405950
milestone58.0a1
Bug 1405950 - Corrected bug in SurfaceFactory::NewTextClient preventing matching textures from being located in mRecycleFreePool r=jgilbert - As the aLayersChannel parameter is never passed and now no longer used, it has been removed from the SurfaceFactory::NewTextClient. MozReview-Commit-ID: 58K4Tbj92gO
gfx/gl/SharedSurface.cpp
gfx/gl/SharedSurface.h
--- a/gfx/gl/SharedSurface.cpp
+++ b/gfx/gl/SharedSurface.cpp
@@ -311,27 +311,25 @@ SurfaceFactory::~SurfaceFactory()
     MOZ_RELEASE_ASSERT(mRecycleTotalPool.empty(),"GFX: Surface recycle pool not empty.");
 
     // If we mRecycleFreePool.clear() before StopRecycling(), we may try to recycle it,
     // fail, call StopRecycling(), then return here and call it again.
     mRecycleFreePool.clear();
 }
 
 already_AddRefed<layers::SharedSurfaceTextureClient>
-SurfaceFactory::NewTexClient(const gfx::IntSize& size, const layers::LayersIPCChannel* aLayersChannel)
+SurfaceFactory::NewTexClient(const gfx::IntSize& size)
 {
     while (!mRecycleFreePool.empty()) {
         RefPtr<layers::SharedSurfaceTextureClient> cur = mRecycleFreePool.front();
         mRecycleFreePool.pop();
 
-        if (cur->Surf()->mSize == size){
-            if (aLayersChannel && aLayersChannel == cur->GetAllocator()) {
-                cur->Surf()->WaitForBufferOwnership();
-                return cur.forget();
-            }
+        if (cur->Surf()->mSize == size) {
+            cur->Surf()->WaitForBufferOwnership();
+            return cur.forget();
         }
 
         StopRecycling(cur);
     }
 
     UniquePtr<SharedSurface> surf = Move(CreateShared(size));
     if (!surf)
         return nullptr;
--- a/gfx/gl/SharedSurface.h
+++ b/gfx/gl/SharedSurface.h
@@ -298,18 +298,17 @@ protected:
 
     void StartRecycling(layers::SharedSurfaceTextureClient* tc);
     void SetRecycleCallback(layers::SharedSurfaceTextureClient* tc);
     void StopRecycling(layers::SharedSurfaceTextureClient* tc);
 
 public:
     UniquePtr<SharedSurface> NewSharedSurface(const gfx::IntSize& size);
     //already_AddRefed<ShSurfHandle> NewShSurfHandle(const gfx::IntSize& size);
-    already_AddRefed<layers::SharedSurfaceTextureClient> NewTexClient(const gfx::IntSize& size,
-                                                                      const layers::LayersIPCChannel* aLayersChannel = nullptr);
+    already_AddRefed<layers::SharedSurfaceTextureClient> NewTexClient(const gfx::IntSize& size);
 
     static void RecycleCallback(layers::TextureClient* tc, void* /*closure*/);
 
     // Auto-deletes surfs of the wrong type.
     bool Recycle(layers::SharedSurfaceTextureClient* texClient);
 };
 
 class ScopedReadbackFB