зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 6846b610be41 (bug 897409) for suspicion of making Win8 mochitest-mc perma-orange.
This commit is contained in:
Родитель
160a182259
Коммит
7b6ff12193
|
@ -74,6 +74,11 @@ CopyableCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mGLContext) {
|
if (mGLContext) {
|
||||||
|
if (aDestSurface && aDestSurface->GetType() != gfxASurface::SurfaceTypeImage) {
|
||||||
|
MOZ_ASSERT(false, "Destination surface must be ImageSurface type.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nsRefPtr<gfxImageSurface> readSurf;
|
nsRefPtr<gfxImageSurface> readSurf;
|
||||||
nsRefPtr<gfxImageSurface> resultSurf;
|
nsRefPtr<gfxImageSurface> resultSurf;
|
||||||
|
|
||||||
|
@ -88,9 +93,9 @@ CopyableCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
|
||||||
? gfxASurface::ImageFormatRGB24
|
? gfxASurface::ImageFormatRGB24
|
||||||
: gfxASurface::ImageFormatARGB32;
|
: gfxASurface::ImageFormatARGB32;
|
||||||
|
|
||||||
bool needsTempSurface = !aDestSurface ||
|
if (aDestSurface) {
|
||||||
!(resultSurf = aDestSurface->GetAsImageSurface());
|
resultSurf = static_cast<gfxImageSurface*>(aDestSurface);
|
||||||
if (needsTempSurface) {
|
} else {
|
||||||
resultSurf = GetTempSurface(readSize, format);
|
resultSurf = GetTempSurface(readSize, format);
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(resultSurf);
|
MOZ_ASSERT(resultSurf);
|
||||||
|
@ -151,7 +156,7 @@ CopyableCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
|
||||||
}
|
}
|
||||||
|
|
||||||
// stick our surface into mSurface, so that the Paint() path is the same
|
// stick our surface into mSurface, so that the Paint() path is the same
|
||||||
if (needsTempSurface) {
|
if (!aDestSurface) {
|
||||||
mSurface = resultSurf;
|
mSurface = resultSurf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
|
||||||
: gfxASurface::CONTENT_COLOR_ALPHA;
|
: gfxASurface::CONTENT_COLOR_ALPHA;
|
||||||
mDeprecatedTextureClient->EnsureAllocated(aSize, contentType);
|
mDeprecatedTextureClient->EnsureAllocated(aSize, contentType);
|
||||||
|
|
||||||
gfxASurface* surface = mDeprecatedTextureClient->LockSurface();
|
gfxASurface* surface = mDeprecatedTextureClient->LockImageSurface();
|
||||||
aLayer->UpdateSurface(surface);
|
aLayer->UpdateSurface(surface);
|
||||||
mDeprecatedTextureClient->Unlock();
|
mDeprecatedTextureClient->Unlock();
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче