From 1843dab8397fdb6f1f23b125ebdf5173ec143b6b Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 26 Oct 2011 16:15:53 +1300 Subject: [PATCH] Bug 696517 - Make sure our temporary surface allocation succeeded. r=roc --- gfx/layers/basic/BasicLayers.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gfx/layers/basic/BasicLayers.cpp b/gfx/layers/basic/BasicLayers.cpp index 2c3ea16a3ab0..e35a9e54ed75 100644 --- a/gfx/layers/basic/BasicLayers.cpp +++ b/gfx/layers/basic/BasicLayers.cpp @@ -1868,6 +1868,14 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget, untransformedSurface = gfxPlatform::GetPlatform()->CreateOffscreenSurface(gfxIntSize(bounds.width, bounds.height), gfxASurface::CONTENT_COLOR_ALPHA); + if (!untransformedSurface) { + if (pushedTargetOpaqueRect) { + currentSurface->SetOpaqueRect(gfxRect(0, 0, 0, 0)); + } + NS_ASSERTION(needsSaveRestore, "Should always need to restore with 3d transforms!"); + aTarget->Restore(); + return; + } untransformedSurface->SetDeviceOffset(gfxPoint(-bounds.x, -bounds.y)); groupTarget = new gfxContext(untransformedSurface); } else if (needsGroup) {