diff --git a/gfx/layers/client/CanvasClient.cpp b/gfx/layers/client/CanvasClient.cpp index 0c4f03317935..61ce67505f83 100644 --- a/gfx/layers/client/CanvasClient.cpp +++ b/gfx/layers/client/CanvasClient.cpp @@ -98,8 +98,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer) mBufferProviderTexture = nullptr; AutoRemoveTexture autoRemove(this); - if (mBackBuffer && - (mBackBuffer->IsImmutable() || mBackBuffer->GetSize() != aSize)) { + if (mBackBuffer && (mBackBuffer->IsReadLocked() || mBackBuffer->GetSize() != aSize)) { autoRemove.mTexture = mBackBuffer; mBackBuffer = nullptr; } @@ -122,6 +121,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer) NS_WARNING("Failed to allocate the TextureClient"); return; } + mBackBuffer->EnableReadLock(); MOZ_ASSERT(mBackBuffer->CanExposeDrawTarget()); bufferCreated = true; diff --git a/gfx/layers/client/ClientCanvasLayer.cpp b/gfx/layers/client/ClientCanvasLayer.cpp index 6ded430dbee9..e9fec82c3580 100644 --- a/gfx/layers/client/ClientCanvasLayer.cpp +++ b/gfx/layers/client/ClientCanvasLayer.cpp @@ -90,16 +90,11 @@ ClientCanvasLayer::RenderLayer() RenderMaskLayers(this); if (!mCanvasClient) { - TextureFlags flags = TextureFlags::IMMEDIATE_UPLOAD; + TextureFlags flags = TextureFlags::DEFAULT; if (mOriginPos == gl::OriginPos::BottomLeft) { flags |= TextureFlags::ORIGIN_BOTTOM_LEFT; } - if (!mGLContext) { - // We don't support locking for buffer surfaces currently - flags |= TextureFlags::IMMEDIATE_UPLOAD; - } - if (!mIsAlphaPremultiplied) { flags |= TextureFlags::NON_PREMULTIPLIED; }