Bug 1405950 - Corrected bug in SurfaceFactory::NewTextClient preventing matching textures from being located in mRecycleFreePool
- As the aLayersChannel parameter is never passed and now no longer used,
it has been removed from the SurfaceFactory::NewTextClient.
MozReview-Commit-ID: 58K4Tbj92gO
--- 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