Bug 1008211 - Backed out changeset 4e1e052624c2 because of a regression on B2G

This commit is contained in:
Nicolas Silva 2014-05-16 14:22:46 +02:00
parent 297d80e262
commit c140d86de1

View File

@ -71,18 +71,17 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
flags |= TextureFlags::NEEDS_Y_FLIP;
}
gfx::SurfaceFormat surfaceFormat = gfx::ImageFormatToSurfaceFormat(format);
if (aLayer->IsGLLayer()) {
// We want a cairo backend here as we don't want to be copying into
// an accelerated backend and we like LockBits to work. This is currently
// the most effective way to make this work.
mBuffer = CreateBufferTextureClient(gfx::ImageFormatToSurfaceFormat(format),
flags,
BackendType::CAIRO);
mBuffer = CreateBufferTextureClient(surfaceFormat, flags, BackendType::CAIRO);
} else {
mBuffer = CreateTextureClientForDrawing(gfx::ImageFormatToSurfaceFormat(format),
flags,
gfxPlatform::GetPlatform()->GetPreferredCanvasBackend(),
aSize);
// XXX - We should use CreateTextureClientForDrawing, but we first need
// to use double buffering.
mBuffer = CreateBufferTextureClient(surfaceFormat, flags,
gfxPlatform::GetPlatform()->GetPreferredCanvasBackend());
}
MOZ_ASSERT(mBuffer->CanExposeDrawTarget());
mBuffer->AllocateForSurface(aSize);