Bug 1729087. Remove ScrollFrameHelper::mScrollPosForLayerPixelAlignment as it is unused with webrender. r=botond

gfxVars::UseWebRender() is always true now.

Differential Revision: https://phabricator.services.mozilla.com/D124510
This commit is contained in:
Timothy Nikkel 2021-09-04 03:56:50 +00:00
Родитель 1b8129b091
Коммит 0a19897c13
3 изменённых файлов: 2 добавлений и 33 удалений

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

@ -2199,7 +2199,6 @@ ScrollFrameHelper::ScrollFrameHelper(nsContainerFrame* aOuter, bool aIsRoot)
mRestorePos(-1, -1),
mLastPos(-1, -1),
mApzScrollPos(0, 0),
mScrollPosForLayerPixelAlignment(-1, -1),
mLastUpdateFramesPos(-1, -1),
mDisplayPortAtLastFrameUpdate(),
mScrollParentID(mozilla::layers::ScrollableLayerGuid::NULL_SCROLL_ID),
@ -2950,9 +2949,6 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
gfxSize scale = GetPaintedLayerScaleForFrame(mScrolledFrame);
nsPoint curPos = GetScrollPosition();
nsPoint alignWithPos = mScrollPosForLayerPixelAlignment == nsPoint(-1, -1)
? curPos
: mScrollPosForLayerPixelAlignment;
// Try to align aPt with curPos so they have an integer number of layer
// pixels between them. This gives us the best chance of scrolling without
// having to invalidate due to changes in subpixel rendering.
@ -2963,9 +2959,8 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
// and are relative to the scrollport top-left. This difference doesn't
// actually matter since all we are about is that there be an integer number
// of layer pixels between pt and curPos.
nsPoint pt =
ClampAndAlignWithLayerPixels(aPt, GetLayoutScrollRange(), aRange,
alignWithPos, appUnitsPerDevPixel, scale);
nsPoint pt = ClampAndAlignWithLayerPixels(aPt, GetLayoutScrollRange(), aRange,
curPos, appUnitsPerDevPixel, scale);
if (pt == curPos) {
// Even if we are bailing out due to no-op main-thread scroll position
// change, we might need to cancel an APZ smooth scroll that we already
@ -3640,16 +3635,6 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
mOuter->DisplayBorderBackgroundOutline(aBuilder, aLists);
if (aBuilder->IsPaintingToWindow()) {
if (IsScrollingActive() && !gfxVars::UseWebRender()) {
if (mScrollPosForLayerPixelAlignment == nsPoint(-1, -1)) {
mScrollPosForLayerPixelAlignment = GetScrollPosition();
}
} else {
mScrollPosForLayerPixelAlignment = nsPoint(-1, -1);
}
}
bool isRootContent =
mIsRoot && mOuter->PresContext()->IsRootContentDocumentCrossProcess();

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

@ -395,10 +395,6 @@ class ScrollFrameHelper : public nsIReflowCallback {
return mWillBuildScrollableLayer;
}
void ResetScrollPositionForLayerPixelAlignment() {
mScrollPosForLayerPixelAlignment = GetScrollPosition();
}
bool ComputeCustomOverflow(mozilla::OverflowAreas& aOverflowAreas);
void UpdateSticky();
@ -613,7 +609,6 @@ class ScrollFrameHelper : public nsIReflowCallback {
nsExpirationState mActivityExpirationState;
nsCOMPtr<nsITimer> mScrollActivityTimer;
nsPoint mScrollPosForLayerPixelAlignment;
// The scroll position where we last updated frame visibility.
nsPoint mLastUpdateFramesPos;
@ -1059,9 +1054,6 @@ class nsHTMLScrollFrame : public nsContainerFrame,
bool IsMaybeAsynchronouslyScrolled() final {
return mHelper.IsMaybeAsynchronouslyScrolled();
}
void ResetScrollPositionForLayerPixelAlignment() final {
mHelper.ResetScrollPositionForLayerPixelAlignment();
}
bool DidHistoryRestore() const final { return mHelper.mDidHistoryRestore; }
void ClearDidHistoryRestore() final { mHelper.mDidHistoryRestore = false; }
void MarkEverScrolled() final { mHelper.MarkEverScrolled(); }
@ -1539,9 +1531,6 @@ class nsXULScrollFrame final : public nsBoxFrame,
bool IsMaybeAsynchronouslyScrolled() final {
return mHelper.IsMaybeAsynchronouslyScrolled();
}
void ResetScrollPositionForLayerPixelAlignment() final {
mHelper.ResetScrollPositionForLayerPixelAlignment();
}
bool DidHistoryRestore() const final { return mHelper.mDidHistoryRestore; }
void ClearDidHistoryRestore() final { mHelper.mDidHistoryRestore = false; }
void MarkEverScrolled() final { mHelper.MarkEverScrolled(); }

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

@ -392,11 +392,6 @@ class nsIScrollableFrame : public nsIScrollbarMediator {
*/
virtual bool IsMaybeAsynchronouslyScrolled() = 0;
/**
* Call this when the layer(s) induced by active scrolling are being
* completely redrawn.
*/
virtual void ResetScrollPositionForLayerPixelAlignment() = 0;
/**
* Was the current presentation state for this frame restored from history?
*/