Bug 647560. Remove unused MayHaveOverlappingOrTransparentLayers. r=tnikkel

This commit is contained in:
Robert O'Callahan 2011-05-17 11:42:19 +12:00
Родитель 5649b24aa6
Коммит bfdfab0931
1 изменённых файлов: 0 добавлений и 65 удалений

Просмотреть файл

@ -1184,69 +1184,6 @@ ToInsideIntRect(const gfxRect& aRect)
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) :
#ifdef DEBUG
mPhase(PHASE_NONE),
@ -1560,8 +1497,6 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
!(mTarget->GetFlags() & gfxContext::FLAG_DISABLE_SNAPPING);
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()) {
nsIntRegion region;
MarkLayersHidden(mRoot, clipRect, clipRect, region, ALLOW_OPAQUE);