Bug 1167235 - Part 7 - Don't paint directly into a canvas with DrawWindow when using a shared PersistentBufferProvider. r=lsalzman

This commit is contained in:
Nicolas Silva 2016-07-01 10:58:26 +02:00
Родитель d489dad128
Коммит 3e441f64b1
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -5134,9 +5134,13 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& aWindow, double aX,
RefPtr<DrawTarget> drawDT;
// Rendering directly is faster and can be done if mTarget supports Azure
// and does not need alpha blending.
// Since the pre-transaction callback calls ReturnTarget, we can't have a
// gfxContext wrapped around it when using a shared buffer provider because
// the DrawTarget's shared buffer may be unmapped in ReturnTarget.
if (gfxPlatform::GetPlatform()->SupportsAzureContentForDrawTarget(mTarget) &&
GlobalAlpha() == 1.0f &&
UsedOperation() == CompositionOp::OP_OVER)
UsedOperation() == CompositionOp::OP_OVER &&
(!mBufferProvider || mBufferProvider->GetType() != LayersBackend::LAYERS_CLIENT))
{
thebes = gfxContext::CreateOrNull(mTarget);
MOZ_ASSERT(thebes); // already checked the draw target above