Bug 810470. Part 3: Remove code for invalidating background-attachment:fixed content when scrolling. r=mattwoodrow

New invalidation logic takes care of this automatically.

--HG--
extra : rebase_source : f598635e58390ef868a057e8ea8ab0cf2410b8a9
This commit is contained in:
Robert O'Callahan 2012-11-09 18:14:14 -05:00
parent efef937562
commit eea69229e3
3 changed files with 0 additions and 100 deletions

View File

@ -2314,33 +2314,6 @@ ContainerState::InvalidateForLayerChange(nsDisplayItem* aItem,
}
}
bool
FrameLayerBuilder::NeedToInvalidateFixedDisplayItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem)
{
if (!aItem->ShouldFixToViewport(aBuilder)) {
return true;
}
nsRefPtr<LayerManager> layerManager;
nsIFrame* referenceFrame = aBuilder->RootReferenceFrame();
NS_ASSERTION(referenceFrame == nsLayoutUtils::GetDisplayRootFrame(referenceFrame),
"Reference frame must be a display root for us to use the layer manager");
nsIWidget* window = referenceFrame->GetNearestWidget();
if (window) {
layerManager = window->GetLayerManager();
}
if (layerManager) {
DisplayItemData* data = GetDisplayItemDataForManager(aItem, layerManager);
if (data) {
return false;
}
}
return true;
}
void
FrameLayerBuilder::AddThebesDisplayItem(ThebesLayer* aLayer,
nsDisplayItem* aItem,

View File

@ -321,16 +321,6 @@ public:
LayerManager* GetRetainingLayerManager() { return mRetainingManager; }
/**
* Returns true if the given item (which we assume here is
* background-attachment:fixed) needs to be repainted as we scroll in its
* document.
* Returns false if it doesn't need to be repainted because the layer system
* is ensuring its fixed-ness for us.
*/
static bool NeedToInvalidateFixedDisplayItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem);
/**
* Returns true if the given display item was rendered during the previous
* paint. Returns false otherwise.

View File

@ -1671,56 +1671,6 @@ CanScrollWithBlitting(nsIFrame* aFrame)
return true;
}
static void
InvalidateFixedBackgroundFramesFromList(nsDisplayListBuilder* aBuilder,
nsIFrame* aMovingFrame,
const nsDisplayList& aList)
{
for (nsDisplayItem* item = aList.GetBottom(); item; item = item->GetAbove()) {
nsDisplayList* sublist = item->GetSameCoordinateSystemChildren();
if (sublist) {
InvalidateFixedBackgroundFramesFromList(aBuilder, aMovingFrame, *sublist);
continue;
}
nsIFrame* f = item->GetUnderlyingFrame();
if (f &&
item->IsVaryingRelativeToMovingFrame(aBuilder, aMovingFrame)) {
if (FrameLayerBuilder::NeedToInvalidateFixedDisplayItem(aBuilder, item)) {
// FrameLayerBuilder does not take care of scrolling this one
f->InvalidateFrame();
}
}
}
}
static void
InvalidateFixedBackgroundFrames(nsIFrame* aRootFrame,
nsIFrame* aMovingFrame,
const nsRect& aUpdateRect)
{
if (!aMovingFrame->PresContext()->MayHaveFixedBackgroundFrames())
return;
NS_ASSERTION(aRootFrame != aMovingFrame,
"The root frame shouldn't be the one that's moving, that makes no sense");
// Build the 'after' display list over the whole area of interest.
nsDisplayListBuilder builder(aRootFrame, nsDisplayListBuilder::OTHER, true);
builder.EnterPresShell(aRootFrame, aUpdateRect);
nsDisplayList list;
nsresult rv =
aRootFrame->BuildDisplayListForStackingContext(&builder, aUpdateRect, &list);
builder.LeavePresShell(aRootFrame, aUpdateRect);
if (NS_FAILED(rv))
return;
nsRegion visibleRegion(aUpdateRect);
list.ComputeVisibilityForRoot(&builder, &visibleRegion);
InvalidateFixedBackgroundFramesFromList(&builder, aMovingFrame, list);
list.DeleteAll();
}
bool nsGfxScrollFrameInner::IsIgnoringViewportClipping() const
{
if (!mIsRoot)
@ -1796,14 +1746,11 @@ void nsGfxScrollFrameInner::ScrollVisual(nsPoint aOldScrolledFramePos)
AdjustViews(mScrolledFrame);
// We need to call this after fixing up the view positions
// to be consistent with the frame hierarchy.
bool invalidate = false;
bool canScrollWithBlitting = CanScrollWithBlitting(mOuter);
mOuter->RemoveStateBits(NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL);
if (IsScrollingActive()) {
if (!canScrollWithBlitting) {
MarkInactive();
} else {
invalidate = true;
}
}
if (canScrollWithBlitting) {
@ -1811,16 +1758,6 @@ void nsGfxScrollFrameInner::ScrollVisual(nsPoint aOldScrolledFramePos)
}
mOuter->SchedulePaint();
if (invalidate) {
nsIFrame* displayRoot = nsLayoutUtils::GetDisplayRootFrame(mOuter);
nsRect update =
GetScrollPortRect() + mOuter->GetOffsetToCrossDoc(displayRoot);
nsRect displayRootUpdate = update.ConvertAppUnitsRoundOut(
mOuter->PresContext()->AppUnitsPerDevPixel(),
displayRoot->PresContext()->AppUnitsPerDevPixel());
InvalidateFixedBackgroundFrames(displayRoot, mScrolledFrame, displayRootUpdate);
}
}
/**