mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 689623. Part 7. Clear the list of visible images on presshells that we don't descend into while building the display list of visible images. r=mats
This commit is contained in:
parent
8729dcd152
commit
4c9c378b53
@ -5315,6 +5315,8 @@ PresShell::MarkImagesInListVisible(const nsDisplayList& aList)
|
||||
void
|
||||
PresShell::RebuildImageVisibility(const nsDisplayList& aList)
|
||||
{
|
||||
MOZ_ASSERT(!mImageVisibilityVisited, "already visited?");
|
||||
mImageVisibilityVisited = true;
|
||||
nsTArray< nsCOMPtr<nsIImageLoadingContent > > beforeimagelist;
|
||||
beforeimagelist.SwapElements(mVisibleImages);
|
||||
MarkImagesInListVisible(aList);
|
||||
@ -5323,6 +5325,22 @@ PresShell::RebuildImageVisibility(const nsDisplayList& aList)
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
PresShell::ClearImageVisibilityVisited(nsView* aView, bool aClear)
|
||||
{
|
||||
nsViewManager* vm = aView->GetViewManager();
|
||||
if (aClear) {
|
||||
PresShell* presShell = static_cast<PresShell*>(vm->GetPresShell());
|
||||
if (!presShell->mImageVisibilityVisited) {
|
||||
presShell->ClearVisibleImagesList();
|
||||
}
|
||||
presShell->mImageVisibilityVisited = false;
|
||||
}
|
||||
for (nsView* v = aView->GetFirstChild(); v; v = v->GetNextSibling()) {
|
||||
ClearImageVisibilityVisited(v, v->GetViewManager() != vm);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::ClearVisibleImagesList()
|
||||
{
|
||||
@ -5363,6 +5381,8 @@ PresShell::UpdateImageVisibility()
|
||||
|
||||
RebuildImageVisibility(list);
|
||||
|
||||
ClearImageVisibilityVisited(rootFrame->GetView(), true);
|
||||
|
||||
list.DeleteAll();
|
||||
}
|
||||
|
||||
@ -5421,6 +5441,8 @@ PresShell::Paint(nsView* aViewToPaint,
|
||||
NS_ASSERTION(!mIsDestroying, "painting a destroyed PresShell");
|
||||
NS_ASSERTION(aViewToPaint, "null view");
|
||||
|
||||
MOZ_ASSERT(!mImageVisibilityVisited, "should have been cleared");
|
||||
|
||||
if (!mIsActive || mIsZombie) {
|
||||
return;
|
||||
}
|
||||
|
@ -712,6 +712,7 @@ protected:
|
||||
nsRevocableEventPtr<nsRunnableMethod<PresShell> > mUpdateImageVisibilityEvent;
|
||||
|
||||
void ClearVisibleImagesList();
|
||||
static void ClearImageVisibilityVisited(nsView* aView, bool aClear);
|
||||
static void MarkImagesInListVisible(const nsDisplayList& aList);
|
||||
|
||||
// A list of images that are visible or almost visible.
|
||||
@ -806,6 +807,8 @@ protected:
|
||||
bool mAsyncResizeTimerIsActive : 1;
|
||||
bool mInResize : 1;
|
||||
|
||||
bool mImageVisibilityVisited : 1;
|
||||
|
||||
static bool sDisableNonTestMouseEvents;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user