Bug 1247380: Only copy the background if we can succesfully get a snapshot. r=jrmuizel

MozReview-Commit-ID: uWH7MtJmSp
This commit is contained in:
Bas Schouten 2016-02-11 22:15:11 +01:00
parent cc7eba7dde
commit 693fff053b

View File

@ -854,9 +854,11 @@ gfxContext::PushGroupAndCopyBackground(gfxContentType content, Float aOpacity, S
mDT->PushLayer(content == gfxContentType::COLOR, aOpacity, aMask, aMaskTransform, IntRect(), false);
}
} else {
if (pushOpaqueWithCopiedBG) {
RefPtr<SourceSurface> source;
// This snapshot can be nullptr if the DrawTarget is a cairo target that is currently
// in an error state.
if (pushOpaqueWithCopiedBG && (source = mDT->Snapshot())) {
DrawTarget *oldDT = mDT;
RefPtr<SourceSurface> source = mDT->Snapshot();
Point oldDeviceOffset = CurrentState().deviceOffset;
PushNewDT(gfxContentType::COLOR);