Bug 907745 - Prepare for texture locking support. r=mattwodrow

This commit is contained in:
Nicolas Silva 2013-08-26 14:50:16 +02:00
parent a5232da6d6
commit d24669554b
2 changed files with 11 additions and 1 deletions

View File

@ -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();

View File

@ -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);