Bug 757380 - BasicLayers Paint ignore NULL Clip when render with groupTarget. r=bas, r=roc

This commit is contained in:
Oleg Romashin 2012-05-24 18:36:22 -07:00
parent 5946003fbc
commit 6efd46dfb4

View File

@ -1976,7 +1976,8 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
nsRefPtr<gfxContext> groupTarget;
nsRefPtr<gfxASurface> untransformedSurface;
if (!is2D) {
bool clipIsEmpty = !aTarget || 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;