Bug 900133 - Don't mark textures as being sent to the compositor until after we've drawn to them. r=nical

This commit is contained in:
Matt Woodrow
2013-08-20 11:39:55 +12:00
parent edcc6bbd1a
commit 9feca233fc
4 changed files with 23 additions and 3 deletions

View File

@@ -45,6 +45,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
mBuffer = nullptr;
}
bool bufferCreated = false;
if (!mBuffer) {
bool isOpaque = (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE);
gfxASurface::gfxContentType contentType = isOpaque
@@ -56,7 +57,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
MOZ_ASSERT(mBuffer->AsTextureClientSurface());
mBuffer->AsTextureClientSurface()->AllocateForSurface(aSize);
AddTextureClient(mBuffer);
bufferCreated = true;
}
if (!mBuffer->Lock(OPEN_READ_WRITE)) {
@@ -70,6 +71,10 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
mBuffer->Unlock();
if (bufferCreated) {
AddTextureClient(mBuffer);
}
if (surface) {
GetForwarder()->UpdatedTexture(this, mBuffer, nullptr);
GetForwarder()->UseTexture(this, mBuffer);