Bug 647560. Remove unused MayHaveOverlappingOrTransparentLayers. r=tnikkel
This commit is contained in:
@@ -1184,69 +1184,6 @@ ToInsideIntRect(const gfxRect& aRect)
|
|||||||
return nsIntRect(r.X(), r.Y(), r.Width(), r.Height());
|
return nsIntRect(r.X(), r.Y(), r.Width(), r.Height());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns false if there is at most one leaf layer overlapping aBounds
|
|
||||||
* and that layer is opaque.
|
|
||||||
* aDirtyVisibleRegionInContainer is filled in only if we return false.
|
|
||||||
* It contains the union of the visible regions of leaf layers under aLayer.
|
|
||||||
*/
|
|
||||||
static PRBool
|
|
||||||
MayHaveOverlappingOrTransparentLayers(Layer* aLayer,
|
|
||||||
const nsIntRect& aBounds,
|
|
||||||
nsIntRegion* aDirtyVisibleRegionInContainer)
|
|
||||||
{
|
|
||||||
if (static_cast<BasicImplData*>(aLayer->ImplData())->IsHidden()) {
|
|
||||||
// This layer won't be painted, so just ignore it.
|
|
||||||
return PR_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE)) {
|
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
gfxMatrix matrix;
|
|
||||||
if (!aLayer->GetTransform().Is2D(&matrix) ||
|
|
||||||
matrix.HasNonIntegerTranslation()) {
|
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsIntPoint translation = nsIntPoint(PRInt32(matrix.x0), PRInt32(matrix.y0));
|
|
||||||
nsIntRect bounds = aBounds - translation;
|
|
||||||
|
|
||||||
nsIntRect clippedDirtyRect = bounds;
|
|
||||||
const nsIntRect* clipRect = aLayer->GetClipRect();
|
|
||||||
if (clipRect) {
|
|
||||||
clippedDirtyRect.IntersectRect(clippedDirtyRect, *clipRect - translation);
|
|
||||||
}
|
|
||||||
aDirtyVisibleRegionInContainer->And(aLayer->GetVisibleRegion(), clippedDirtyRect);
|
|
||||||
aDirtyVisibleRegionInContainer->MoveBy(translation);
|
|
||||||
|
|
||||||
/* Ignore layers outside the clip rect */
|
|
||||||
if (aDirtyVisibleRegionInContainer->IsEmpty()) {
|
|
||||||
return PR_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsIntRegion region;
|
|
||||||
|
|
||||||
for (Layer* child = aLayer->GetFirstChild(); child;
|
|
||||||
child = child->GetNextSibling()) {
|
|
||||||
nsIntRegion childRegion;
|
|
||||||
if (MayHaveOverlappingOrTransparentLayers(child, bounds, &childRegion)) {
|
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsIntRegion tmp;
|
|
||||||
tmp.And(region, childRegion);
|
|
||||||
if (!tmp.IsEmpty()) {
|
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
region.Or(region, childRegion);
|
|
||||||
}
|
|
||||||
|
|
||||||
return PR_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BasicLayerManager::BasicLayerManager(nsIWidget* aWidget) :
|
BasicLayerManager::BasicLayerManager(nsIWidget* aWidget) :
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
mPhase(PHASE_NONE),
|
mPhase(PHASE_NONE),
|
||||||
@@ -1560,8 +1497,6 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
|||||||
!(mTarget->GetFlags() & gfxContext::FLAG_DISABLE_SNAPPING);
|
!(mTarget->GetFlags() & gfxContext::FLAG_DISABLE_SNAPPING);
|
||||||
mRoot->ComputeEffectiveTransforms(gfx3DMatrix::From2D(mTarget->CurrentMatrix()));
|
mRoot->ComputeEffectiveTransforms(gfx3DMatrix::From2D(mTarget->CurrentMatrix()));
|
||||||
|
|
||||||
// Need to do this before we call MayHaveOverlappingOrTransparentLayers,
|
|
||||||
// which uses information about which layers are going to be drawn.
|
|
||||||
if (IsRetained()) {
|
if (IsRetained()) {
|
||||||
nsIntRegion region;
|
nsIntRegion region;
|
||||||
MarkLayersHidden(mRoot, clipRect, clipRect, region, ALLOW_OPAQUE);
|
MarkLayersHidden(mRoot, clipRect, clipRect, region, ALLOW_OPAQUE);
|
||||||
|
|||||||
Reference in New Issue
Block a user