зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1664626 - Remove last usage of FrameMetrics::mScrollUpdateType. r=botond
The only remaining use site only cares about whether or not the transaction was a paint-skip transaction or not, so this patch adds a dedicated bool for that, which unlocks some cleanup. Depends on D90722 Differential Revision: https://phabricator.services.mozilla.com/D90723
This commit is contained in:
Родитель
e984502ba3
Коммит
8b60cda1f4
|
@ -793,6 +793,7 @@ struct ScrollMetadata {
|
|||
mForceDisableApz(false),
|
||||
mResolutionUpdated(false),
|
||||
mIsRDMTouchSimulationActive(false),
|
||||
mDidContentGetPainted(true),
|
||||
mOverscrollBehavior() {}
|
||||
|
||||
bool operator==(const ScrollMetadata& aOther) const {
|
||||
|
@ -809,6 +810,7 @@ struct ScrollMetadata {
|
|||
mForceDisableApz == aOther.mForceDisableApz &&
|
||||
mResolutionUpdated == aOther.mResolutionUpdated &&
|
||||
mIsRDMTouchSimulationActive == aOther.mIsRDMTouchSimulationActive &&
|
||||
mDidContentGetPainted == aOther.mDidContentGetPainted &&
|
||||
mDisregardedDirection == aOther.mDisregardedDirection &&
|
||||
mOverscrollBehavior == aOther.mOverscrollBehavior &&
|
||||
mScrollUpdates == aOther.mScrollUpdates;
|
||||
|
@ -896,6 +898,17 @@ struct ScrollMetadata {
|
|||
return mIsRDMTouchSimulationActive;
|
||||
}
|
||||
|
||||
bool DidContentGetPainted() const {
|
||||
return mDidContentGetPainted;
|
||||
}
|
||||
|
||||
private:
|
||||
// For use in IPC only
|
||||
void SetDidContentGetPainted(bool aValue) {
|
||||
mDidContentGetPainted = aValue;
|
||||
}
|
||||
|
||||
public:
|
||||
// For more details about the concept of a disregarded direction, refer to the
|
||||
// code which defines mDisregardedDirection.
|
||||
Maybe<ScrollDirection> GetDisregardedDirection() const {
|
||||
|
@ -924,6 +937,7 @@ struct ScrollMetadata {
|
|||
void UpdatePendingScrollInfo(const ScrollPositionUpdate& aInfo) {
|
||||
mMetrics.UpdatePendingScrollInfo(aInfo);
|
||||
|
||||
mDidContentGetPainted = false;
|
||||
mScrollUpdates.Clear();
|
||||
mScrollUpdates.AppendElement(aInfo);
|
||||
}
|
||||
|
@ -993,6 +1007,14 @@ struct ScrollMetadata {
|
|||
// the browser UI and RDM controls.
|
||||
bool mIsRDMTouchSimulationActive : 1;
|
||||
|
||||
// Whether this metadata is part of a transaction that also repainted the
|
||||
// content (i.e. updated the displaylist or textures). This gets set to false
|
||||
// for "paint-skip" transactions, where the main thread doesn't repaint but
|
||||
// instead requests APZ to update the compositor scroll offset instead. APZ
|
||||
// needs to be able to distinguish these paint-skip transactions so that it
|
||||
// can use the correct transforms.
|
||||
bool mDidContentGetPainted : 1;
|
||||
|
||||
// The disregarded direction means the direction which is disregarded anyway,
|
||||
// even if the scroll frame overflows in that direction and the direction is
|
||||
// specified as scrollable. This could happen in some scenarios, for instance,
|
||||
|
|
|
@ -4457,8 +4457,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(
|
|||
!FuzzyEqualsAdditive(Metrics().GetVisualScrollOffset().y,
|
||||
lastScrollOffset.y);
|
||||
|
||||
if (aLayerMetrics.GetScrollUpdateType() !=
|
||||
FrameMetrics::ScrollOffsetUpdateType::ePending) {
|
||||
if (aScrollMetadata.DidContentGetPainted()) {
|
||||
mLastContentPaintMetadata = aScrollMetadata;
|
||||
}
|
||||
|
||||
|
|
|
@ -413,6 +413,7 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
|
|||
WriteParam(aMsg, aParam.mForceDisableApz);
|
||||
WriteParam(aMsg, aParam.mResolutionUpdated);
|
||||
WriteParam(aMsg, aParam.mIsRDMTouchSimulationActive);
|
||||
WriteParam(aMsg, aParam.mDidContentGetPainted);
|
||||
WriteParam(aMsg, aParam.mDisregardedDirection);
|
||||
WriteParam(aMsg, aParam.mOverscrollBehavior);
|
||||
WriteParam(aMsg, aParam.mScrollUpdates);
|
||||
|
@ -450,6 +451,8 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
|
|||
¶mType::SetResolutionUpdated) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult,
|
||||
¶mType::SetIsRDMTouchSimulationActive)) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult,
|
||||
¶mType::SetDidContentGetPainted) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mDisregardedDirection) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mOverscrollBehavior) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mScrollUpdates);
|
||||
|
|
Загрузка…
Ссылка в новой задаче