diff --git a/gfx/layers/basic/BasicLayers.cpp b/gfx/layers/basic/BasicLayers.cpp index 2910fc30cb9..1b95d133916 100644 --- a/gfx/layers/basic/BasicLayers.cpp +++ b/gfx/layers/basic/BasicLayers.cpp @@ -1976,7 +1976,8 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget, nsRefPtr groupTarget; nsRefPtr untransformedSurface; - if (!is2D) { + bool clipIsEmpty = aTarget->GetClipExtents().IsEmpty(); + if (!is2D && !clipIsEmpty) { untransformedSurface = gfxPlatform::GetPlatform()->CreateOffscreenSurface(gfxIntSize(bounds.width, bounds.height), gfxASurface::CONTENT_COLOR_ALPHA); @@ -1994,7 +1995,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget, } untransformedSurface->SetDeviceOffset(gfxPoint(-bounds.x, -bounds.y)); groupTarget = new gfxContext(untransformedSurface); - } else if (needsGroup) { + } else if (needsGroup && !clipIsEmpty) { groupTarget = PushGroupForLayer(aTarget, aLayer, aLayer->GetEffectiveVisibleRegion(), &needsClipToVisibleRegion); } else { @@ -2051,9 +2052,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget, // Temporary fast fix for bug 725886 // Revert these changes when 725886 is ready - gfxRect clipExtents; - clipExtents = aTarget->GetClipExtents(); - if (!clipExtents.IsEmpty()) { + if (!clipIsEmpty) { gfxPoint offset; bool dontBlit = needsClipToVisibleRegion || mTransactionIncomplete || aLayer->GetEffectiveOpacity() != 1.0f;