Bug 1022612. Part 37: Remove aAllowVisibleRegionExpansion. r=mattwoodrow

This is no longer needed thanks to the readback simplification.

--HG--
extra : rebase_source : 5c288eec4f5af7b40e6e2545198000fb6e326c25
This commit is contained in:
Robert O'Callahan 2014-06-23 16:24:51 +12:00
parent 612340319b
commit 1ddbeb28d2
5 changed files with 44 additions and 92 deletions

View File

@ -1052,8 +1052,7 @@ nsDisplayList::ComputeVisibilityForRoot(nsDisplayListBuilder* aBuilder,
nsRegion r;
r.And(*aVisibleRegion, GetBounds(aBuilder));
return ComputeVisibilityForSublist(aBuilder, aVisibleRegion,
r.GetBounds(), r.GetBounds(),
aDisplayPortFrame);
r.GetBounds(), aDisplayPortFrame);
}
static nsRegion
@ -1092,7 +1091,6 @@ bool
nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aListVisibleBounds,
const nsRect& aAllowVisibleRegionExpansion,
nsIFrame* aDisplayPortFrame) {
#ifdef DEBUG
nsRegion r;
@ -1114,8 +1112,7 @@ nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder,
itemVisible.And(*aVisibleRegion, bounds);
item->mVisibleRect = itemVisible.GetBounds();
if (item->ComputeVisibility(aBuilder, aVisibleRegion,
aAllowVisibleRegionExpansion.Intersect(bounds))) {
if (item->ComputeVisibility(aBuilder, aVisibleRegion)) {
anyVisible = true;
nsRegion opaque = TreatAsOpaque(item, aBuilder);
@ -1617,8 +1614,7 @@ nsDisplayItem::ZIndex() const
bool
nsDisplayItem::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion)
nsRegion* aVisibleRegion)
{
return !mVisibleRect.IsEmpty() &&
!IsInvisibleInRect(aVisibleRegion->GetBounds());
@ -1636,7 +1632,7 @@ nsDisplayItem::RecomputeVisibility(nsDisplayListBuilder* aBuilder,
// When we recompute visibility within layers we don't need to
// expand the visible region for content behind plugins (the plugin
// is not in the layer).
if (!ComputeVisibility(aBuilder, aVisibleRegion, nsRect())) {
if (!ComputeVisibility(aBuilder, aVisibleRegion)) {
mVisibleRect = nsRect();
return false;
}
@ -2049,11 +2045,9 @@ nsDisplayBackgroundImage::HitTest(nsDisplayListBuilder* aBuilder,
bool
nsDisplayBackgroundImage::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion)
nsRegion* aVisibleRegion)
{
if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion,
aAllowVisibleRegionExpansion)) {
if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion)) {
return false;
}
@ -2798,10 +2792,8 @@ nsDisplayBoxShadowOuter::IsInvisibleInRect(const nsRect& aRect)
bool
nsDisplayBoxShadowOuter::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) {
if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion,
aAllowVisibleRegionExpansion)) {
nsRegion* aVisibleRegion) {
if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion)) {
return false;
}
@ -2860,10 +2852,8 @@ nsDisplayBoxShadowInner::Paint(nsDisplayListBuilder* aBuilder,
bool
nsDisplayBoxShadowInner::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) {
if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion,
aAllowVisibleRegionExpansion)) {
nsRegion* aVisibleRegion) {
if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion)) {
return false;
}
@ -2966,8 +2956,7 @@ nsDisplayWrapList::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) {
bool
nsDisplayWrapList::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) {
nsRegion* aVisibleRegion) {
// Convert the passed in visible region to our appunits.
nsRegion visibleRegion;
// mVisibleRect has been clipped to GetClippedBounds
@ -2976,8 +2965,7 @@ nsDisplayWrapList::ComputeVisibility(nsDisplayListBuilder* aBuilder,
bool retval =
mList.ComputeVisibilityForSublist(aBuilder, &visibleRegion,
mVisibleRect,
aAllowVisibleRegionExpansion);
mVisibleRect);
nsRegion removed;
// removed = originalVisibleRegion - visibleRegion
@ -3250,8 +3238,7 @@ nsDisplayOpacity::GetLayerState(nsDisplayListBuilder* aBuilder,
bool
nsDisplayOpacity::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) {
nsRegion* aVisibleRegion) {
// Our children are translucent so we should not allow them to subtract
// area from aVisibleRegion. We do need to find out what is visible under
// our children in the temporary compositing buffer, because if our children
@ -3260,10 +3247,8 @@ nsDisplayOpacity::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRect bounds = GetClippedBounds(aBuilder);
nsRegion visibleUnderChildren;
visibleUnderChildren.And(*aVisibleRegion, bounds);
nsRect allowExpansion = bounds.Intersect(aAllowVisibleRegionExpansion);
return
nsDisplayWrapList::ComputeVisibility(aBuilder, &visibleUnderChildren,
allowExpansion);
nsDisplayWrapList::ComputeVisibility(aBuilder, &visibleUnderChildren);
}
bool nsDisplayOpacity::TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) {
@ -3341,8 +3326,7 @@ nsDisplayMixBlendMode::BuildLayer(nsDisplayListBuilder* aBuilder,
}
bool nsDisplayMixBlendMode::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) {
nsRegion* aVisibleRegion) {
// Our children are need their backdrop so we should not allow them to subtract
// area from aVisibleRegion. We do need to find out what is visible under
// our children in the temporary compositing buffer, because if our children
@ -3351,10 +3335,7 @@ bool nsDisplayMixBlendMode::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRect bounds = GetClippedBounds(aBuilder);
nsRegion visibleUnderChildren;
visibleUnderChildren.And(*aVisibleRegion, bounds);
nsRect allowExpansion = bounds.Intersect(aAllowVisibleRegionExpansion);
return
nsDisplayWrapList::ComputeVisibility(aBuilder, &visibleUnderChildren,
allowExpansion);
return nsDisplayWrapList::ComputeVisibility(aBuilder, &visibleUnderChildren);
}
bool nsDisplayMixBlendMode::TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) {
@ -3527,16 +3508,14 @@ nsDisplaySubDocument::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
bool
nsDisplaySubDocument::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion)
nsRegion* aVisibleRegion)
{
nsRect displayport;
bool usingDisplayPort =
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext(), &displayport);
if (!(mFlags & GENERATE_SCROLLABLE_LAYER) || !usingDisplayPort) {
return nsDisplayWrapList::ComputeVisibility(aBuilder, aVisibleRegion,
aAllowVisibleRegionExpansion);
return nsDisplayWrapList::ComputeVisibility(aBuilder, aVisibleRegion);
}
nsRegion childVisibleRegion;
@ -3547,9 +3526,8 @@ nsDisplaySubDocument::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRect boundedRect =
childVisibleRegion.GetBounds().Intersect(mList.GetBounds(aBuilder));
nsRect allowExpansion = boundedRect.Intersect(aAllowVisibleRegionExpansion);
bool visible = mList.ComputeVisibilityForSublist(
aBuilder, &childVisibleRegion, boundedRect, allowExpansion,
aBuilder, &childVisibleRegion, boundedRect,
usingDisplayPort ? mFrame : nullptr);
// We don't allow this computation to influence aVisibleRegion, on the
// assumption that the layer can be asynchronously scrolled so we'll
@ -3836,8 +3814,7 @@ nsDisplayScrollLayer::ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBui
bool
nsDisplayScrollLayer::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion)
nsRegion* aVisibleRegion)
{
nsRect displayport;
bool usingDisplayPort =
@ -3846,10 +3823,9 @@ nsDisplayScrollLayer::ComputeVisibility(nsDisplayListBuilder* aBuilder,
usingDisplayPort ? &displayport : nullptr);
nsRect boundedRect = scrolledContentRect.Intersect(mList.GetBounds(aBuilder));
nsRect allowExpansion = boundedRect.Intersect(aAllowVisibleRegionExpansion);
nsRegion childVisibleRegion = scrolledContentRect;
bool visible = mList.ComputeVisibilityForSublist(
aBuilder, &childVisibleRegion, boundedRect, allowExpansion,
aBuilder, &childVisibleRegion, boundedRect,
usingDisplayPort ? mScrollFrame : nullptr);
// We don't allow this computation to influence aVisibleRegion, on the
// assumption that the layer can be asynchronously scrolled so we'll
@ -4107,8 +4083,7 @@ void nsDisplayZoom::Paint(nsDisplayListBuilder* aBuilder,
}
bool nsDisplayZoom::ComputeVisibility(nsDisplayListBuilder *aBuilder,
nsRegion *aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion)
nsRegion *aVisibleRegion)
{
// Convert the passed in visible region to our appunits.
nsRegion visibleRegion;
@ -4119,8 +4094,6 @@ bool nsDisplayZoom::ComputeVisibility(nsDisplayListBuilder *aBuilder,
nsRect transformedVisibleRect =
mVisibleRect.ConvertAppUnitsRoundOut(mParentAPD, mAPD);
nsRect allowExpansion =
aAllowVisibleRegionExpansion.ConvertAppUnitsRoundIn(mParentAPD, mAPD);
bool retval;
// If we are to generate a scrollable layer we call
// nsDisplaySubDocument::ComputeVisibility to make the necessary adjustments
@ -4130,12 +4103,10 @@ bool nsDisplayZoom::ComputeVisibility(nsDisplayListBuilder *aBuilder,
if (!(mFlags & GENERATE_SCROLLABLE_LAYER) || !usingDisplayPort) {
retval =
mList.ComputeVisibilityForSublist(aBuilder, &visibleRegion,
transformedVisibleRect,
allowExpansion);
transformedVisibleRect);
} else {
retval =
nsDisplaySubDocument::ComputeVisibility(aBuilder, &visibleRegion,
allowExpansion);
nsDisplaySubDocument::ComputeVisibility(aBuilder, &visibleRegion);
}
nsRegion removed;
@ -4779,8 +4750,7 @@ nsDisplayTransform::GetLayerState(nsDisplayListBuilder* aBuilder,
}
bool nsDisplayTransform::ComputeVisibility(nsDisplayListBuilder *aBuilder,
nsRegion *aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion)
nsRegion *aVisibleRegion)
{
/* As we do this, we need to be sure to
* untransform the visible rect, since we want everything that's painting to
@ -5246,8 +5216,7 @@ nsDisplaySVGEffects::BuildLayer(nsDisplayListBuilder* aBuilder,
}
bool nsDisplaySVGEffects::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) {
nsRegion* aVisibleRegion) {
nsPoint offset = ToReferenceFrame();
nsRect dirtyRect =
nsSVGIntegrationUtils::GetRequiredSourceForInvalidArea(mFrame,
@ -5258,7 +5227,7 @@ bool nsDisplaySVGEffects::ComputeVisibility(nsDisplayListBuilder* aBuilder,
// not allow them to subtract area from aVisibleRegion.
nsRegion childrenVisible(dirtyRect);
nsRect r = dirtyRect.Intersect(mList.GetBounds(aBuilder));
mList.ComputeVisibilityForSublist(aBuilder, &childrenVisible, r, nsRect());
mList.ComputeVisibilityForSublist(aBuilder, &childrenVisible, r);
return true;
}

View File

@ -1184,8 +1184,7 @@ public:
* is visible.
*/
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion);
nsRegion* aVisibleRegion);
/**
* Try to merge with the other item (which is below us in the display
@ -1273,7 +1272,7 @@ public:
* -- Subtracts bounds from aVisibleRegion if the item is opaque
*/
bool RecomputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion);
nsRegion* aVisibleRegion);
/**
* Returns the result of aBuilder->ToReferenceFrame(GetUnderlyingFrame())
@ -1558,7 +1557,6 @@ public:
bool ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aListVisibleBounds,
const nsRect& aAllowVisibleRegionExpansion,
nsIFrame* aDisplayPortFrame = nullptr);
/**
@ -2138,8 +2136,7 @@ public:
virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
bool* aSnap) MOZ_OVERRIDE;
virtual bool IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) MOZ_OVERRIDE;
@ -2343,8 +2340,7 @@ public:
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE;
virtual bool IsInvisibleInRect(const nsRect& aRect) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
NS_DISPLAY_DECL_NAME("BoxShadowOuter", TYPE_BOX_SHADOW_OUTER)
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
@ -2387,8 +2383,7 @@ public:
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
NS_DISPLAY_DECL_NAME("BoxShadowInner", TYPE_BOX_SHADOW_INNER)
virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE
@ -2558,8 +2553,7 @@ public:
virtual bool IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) MOZ_OVERRIDE;
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) MOZ_OVERRIDE {
return false;
}
@ -2690,8 +2684,7 @@ public:
LayerManager* aManager,
const ContainerLayerParameters& aParameters) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) MOZ_OVERRIDE;
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
@ -2739,8 +2732,7 @@ public:
LayerManager* aManager,
const ContainerLayerParameters& aParameters) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) MOZ_OVERRIDE;
virtual bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE {
return false;
@ -2864,8 +2856,7 @@ public:
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
virtual bool ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE;
@ -2982,8 +2973,7 @@ public:
}
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
@ -3082,8 +3072,7 @@ public:
virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters) MOZ_OVERRIDE
@ -3124,8 +3113,7 @@ public:
return mEffectsBounds + ToReferenceFrame();
}
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
virtual bool TryMerge(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) MOZ_OVERRIDE;
virtual bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE {
@ -3232,8 +3220,7 @@ public:
const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE;
virtual bool ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder *aBuilder,
nsRegion *aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion *aVisibleRegion) MOZ_OVERRIDE;
virtual bool TryMerge(nsDisplayListBuilder *aBuilder, nsDisplayItem *aItem) MOZ_OVERRIDE;
virtual uint32_t GetPerFrameKey() MOZ_OVERRIDE { return (mIndex << nsDisplayItem::TYPE_BITS) | nsDisplayItem::GetPerFrameKey(); }

View File

@ -155,8 +155,7 @@ public:
}
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE
nsRegion* aVisibleRegion) MOZ_OVERRIDE
{
return NS_GET_A(mColor) > 0;
}

View File

@ -959,8 +959,7 @@ nsDisplayPlugin::Paint(nsDisplayListBuilder* aBuilder,
bool
nsDisplayPlugin::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion)
nsRegion* aVisibleRegion)
{
if (aBuilder->IsForPluginGeometry()) {
nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame);
@ -999,8 +998,7 @@ nsDisplayPlugin::ComputeVisibility(nsDisplayListBuilder* aBuilder,
}
}
return nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion,
aAllowVisibleRegionExpansion);
return nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion);
}
nsRegion

View File

@ -319,8 +319,7 @@ public:
virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) MOZ_OVERRIDE;
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
nsRegion* aVisibleRegion) MOZ_OVERRIDE;
NS_DISPLAY_DECL_NAME("Plugin", TYPE_PLUGIN)