Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1031107 - Part 6: Subtract from the visible region in nsDisplaySc…
Browse files Browse the repository at this point in the history
…rollLayer if we're not using APZ. r=tn
  • Loading branch information
mattwoodrow committed Jul 24, 2014
1 parent a369a8a commit dbccf2b
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions layout/base/nsDisplayList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3603,9 +3603,20 @@ nsDisplaySubDocument::ComputeVisibility(nsDisplayListBuilder* aBuilder,
bool visible = mList.ComputeVisibilityForSublist(
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
// definitely need all the content under it.

#ifndef MOZ_WIDGET_ANDROID
// If APZ is enabled then don't allow this computation to influence
// aVisibleRegion, on the assumption that the layer can be asynchronously
// scrolled so we'll definitely need all the content under it.
if (!gfxPrefs::AsyncPanZoomEnabled()) {
bool snap;
nsRect bounds = GetBounds(aBuilder, &snap);
nsRegion removed;
removed.Sub(bounds, childVisibleRegion);

aBuilder->SubtractFromVisibleRegion(aVisibleRegion, removed);
}
#endif

return visible;
}
Expand Down Expand Up @@ -3904,9 +3915,19 @@ nsDisplayScrollLayer::ComputeVisibility(nsDisplayListBuilder* aBuilder,
bool visible = mList.ComputeVisibilityForSublist(
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
// definitely need all the content under it.

#ifndef MOZ_WIDGET_ANDROID
// If APZ is enabled then don't allow this computation to influence
// aVisibleRegion, on the assumption that the layer can be asynchronously
// scrolled so we'll definitely need all the content under it.
if (!gfxPrefs::AsyncPanZoomEnabled()) {
bool snap;
nsRect bounds = GetBounds(aBuilder, &snap);
nsRegion removed;
removed.Sub(bounds, childVisibleRegion);
aBuilder->SubtractFromVisibleRegion(aVisibleRegion, removed);
}
#endif

return visible;
}
Expand Down

0 comments on commit dbccf2b

Please sign in to comment.