diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index f7969c873ac..3335f602ab3 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -183,7 +183,7 @@ BufferTextureClient::UpdateSurface(gfxASurface* aSurface) tmpCtx->DrawSurface(aSurface, gfxSize(serializer.GetSize().width, serializer.GetSize().height)); - if (TextureRequiresLocking(mFlags)) { + if (TextureRequiresLocking(mFlags) && !ImplementsLocking()) { // We don't have support for proper locking yet, so we'll // have to be immutable instead. MarkImmutable(); diff --git a/gfx/layers/client/TextureClient.h b/gfx/layers/client/TextureClient.h index 3b75639b711..4750020a514 100644 --- a/gfx/layers/client/TextureClient.h +++ b/gfx/layers/client/TextureClient.h @@ -111,6 +111,16 @@ public: virtual void Unlock() {} + /** + * Returns true if this texture has a lock/unlock mechanism. + * Textures that do not implement locking should be immutable or should + * use immediate uploads (see TextureFlags in CompositorTypes.h) + */ + virtual bool ImplementsLocking() const + { + return false; + } + void SetID(uint64_t aID) { MOZ_ASSERT(mID == 0 || aID == 0);