Bug 1662013 - Move some function bodies into .cpp files. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D88746
This commit is contained in:
Kartikaya Gupta 2020-09-12 13:06:20 +00:00
Родитель 9b69abb395
Коммит 0863c04a4d
4 изменённых файлов: 30 добавлений и 22 удалений

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

@ -105,6 +105,15 @@ void FrameMetrics::ApplyScrollUpdateFrom(const ScrollPositionUpdate& aUpdate) {
ClampAndSetVisualScrollOffset(aUpdate.GetDestination() + relativeOffset);
}
CSSPoint FrameMetrics::ApplyRelativeScrollUpdateFrom(
const ScrollPositionUpdate& aUpdate) {
MOZ_ASSERT(aUpdate.GetType() == ScrollUpdateType::Relative);
CSSPoint origin = GetVisualScrollOffset();
CSSPoint delta = (aUpdate.GetDestination() - aUpdate.GetSource());
ClampAndSetVisualScrollOffset(origin + delta);
return GetVisualScrollOffset() - origin;
}
ScrollSnapInfo::ScrollSnapInfo()
: mScrollSnapStrictnessX(StyleScrollSnapStrictness::None),
mScrollSnapStrictnessY(StyleScrollSnapStrictness::None) {}

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

@ -271,13 +271,7 @@ struct FrameMetrics {
*
* @returns The clamped scroll offset delta that was applied
*/
CSSPoint ApplyRelativeScrollUpdateFrom(const ScrollPositionUpdate& aUpdate) {
MOZ_ASSERT(aUpdate.GetType() == ScrollUpdateType::Relative);
CSSPoint origin = GetVisualScrollOffset();
CSSPoint delta = (aUpdate.GetDestination() - aUpdate.GetSource());
ClampAndSetVisualScrollOffset(origin + delta);
return GetVisualScrollOffset() - origin;
}
CSSPoint ApplyRelativeScrollUpdateFrom(const ScrollPositionUpdate& aUpdate);
void UpdatePendingScrollInfo(const ScrollPositionUpdate& aInfo) {
SetLayoutScrollOffset(aInfo.GetDestination());

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

@ -4328,6 +4328,13 @@ bool ScrollFrameHelper::DecideScrollableLayer(
return mWillBuildScrollableLayer;
}
void ScrollFrameHelper::NotifyApzTransaction() {
mAllowScrollOriginDowngrade = true;
mApzScrollPos = GetScrollPosition();
mRelativeOffset.reset();
mScrollUpdates.Clear();
}
Maybe<ScrollMetadata> ScrollFrameHelper::ComputeScrollMetadata(
LayerManager* aLayerManager, const nsIFrame* aContainerReferenceFrame,
const Maybe<ContainerLayerParameters>& aParameters,
@ -7020,6 +7027,17 @@ bool ScrollFrameHelper::IsScrollAnimating(
mRelativeOffset.isSome();
}
void ScrollFrameHelper::ResetScrollInfoIfNeeded(uint32_t aGeneration,
bool aApzAnimationInProgress) {
if (aGeneration == mScrollGeneration) {
mLastScrollOrigin = ScrollOrigin::None;
mLastSmoothScrollOrigin = ScrollOrigin::None;
}
// We can reset this regardless of scroll generation, as this is only set
// here, as a response to APZ requesting a repaint.
mApzAnimationInProgress = aApzAnimationInProgress;
}
UniquePtr<PresState> ScrollFrameHelper::SaveState() const {
nsIScrollbarMediator* mediator = do_QueryFrame(GetScrolledFrame());
if (mediator) {

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

@ -439,12 +439,7 @@ class ScrollFrameHelper : public nsIReflowCallback {
nsRect* aVisibleRect, nsRect* aDirtyRect,
bool aSetBase,
bool* aDirtyRectHasBeenOverriden = nullptr);
void NotifyApzTransaction() {
mAllowScrollOriginDowngrade = true;
mApzScrollPos = GetScrollPosition();
mRelativeOffset.reset();
mScrollUpdates.Clear();
}
void NotifyApzTransaction();
void NotifyApproximateFrameVisibilityUpdate(bool aIgnoreDisplayPort);
bool GetDisplayPortAtLastApproximateFrameVisibilityUpdate(
nsRect* aDisplayPort);
@ -471,15 +466,7 @@ class ScrollFrameHelper : public nsIReflowCallback {
bool IsScrollAnimating(IncludeApzAnimation = IncludeApzAnimation::Yes) const;
void ResetScrollInfoIfNeeded(uint32_t aGeneration,
bool aApzAnimationInProgress) {
if (aGeneration == mScrollGeneration) {
mLastScrollOrigin = ScrollOrigin::None;
mLastSmoothScrollOrigin = ScrollOrigin::None;
}
// We can reset this regardless of scroll generation, as this is only set
// here, as a response to APZ requesting a repaint.
mApzAnimationInProgress = aApzAnimationInProgress;
}
bool aApzAnimationInProgress);
Maybe<nsPoint> GetRelativeOffset() const { return mRelativeOffset; }
bool WantAsyncScroll() const;
Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(