Bug 874721. Fallback for EnsureAllocated and compositor, and some more sanity checks. r=mattwoodrow

This commit is contained in:
Nicholas Cameron
2013-08-01 16:52:36 +12:00
parent bb96da846c
commit b167448714
19 changed files with 113 additions and 54 deletions

View File

@@ -64,8 +64,16 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
gfxASurface::gfxContentType contentType = isOpaque
? gfxASurface::CONTENT_COLOR
: gfxASurface::CONTENT_COLOR_ALPHA;
mDeprecatedTextureClient->EnsureAllocated(aSize, contentType);
if (!mDeprecatedTextureClient->EnsureAllocated(aSize, contentType)) {
mDeprecatedTextureClient = CreateDeprecatedTextureClient(TEXTURE_FALLBACK);
if (!mDeprecatedTextureClient ||
!mDeprecatedTextureClient->EnsureAllocated(aSize, contentType)) {
NS_WARNING("Could not update texture, even with fallback texture client");
return;
}
}
gfxASurface* surface = mDeprecatedTextureClient->LockSurface();
aLayer->UpdateSurface(surface);
mDeprecatedTextureClient->Unlock();