Bug 1247380: Only copy the background if we can succesfully get a snapshot. r=jrmuizel
MozReview-Commit-ID: uWH7MtJmSp
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -849,19 +849,19 @@ gfxContext::PushGroupAndCopyBackground(g
Save();
if (pushOpaqueWithCopiedBG) {
mDT->PushLayer(true, aOpacity, aMask, aMaskTransform, IntRect(), true);
} else {
mDT->PushLayer(content == gfxContentType::COLOR, aOpacity, aMask, aMaskTransform, IntRect(), false);
}
} else {
- if (pushOpaqueWithCopiedBG) {
+ RefPtr<SourceSurface> source;
+ if (pushOpaqueWithCopiedBG && (source = mDT->Snapshot())) {
DrawTarget *oldDT = mDT;
- RefPtr<SourceSurface> source = mDT->Snapshot();
Point oldDeviceOffset = CurrentState().deviceOffset;
PushNewDT(gfxContentType::COLOR);
if (oldDT == mDT) {
// Creating new DT failed.
return;
}