Bug 1246290 - Add a bit to FrameMetrics to indicate if APZ-scrolling should be disabled on that APZC. r=botond

MozReview-Commit-ID: 5NeFP31Y0Qg
This commit is contained in:
Kartikaya Gupta 2016-04-03 13:13:58 -04:00
parent 36b6d35999
commit 967f8c8fb1
3 changed files with 18 additions and 2 deletions

View File

@ -713,6 +713,7 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
WriteParam(aMsg, aParam.mIsLayersIdRoot);
WriteParam(aMsg, aParam.mUsesContainerScrolling);
WriteParam(aMsg, aParam.mIsScrollInfoLayer);
WriteParam(aMsg, aParam.mForceDisableApz);
}
static bool ReadContentDescription(const Message* aMsg, void** aIter, paramType* aResult)
@ -772,7 +773,8 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetAllowVerticalScrollWithWheel) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetIsLayersIdRoot) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetUsesContainerScrolling) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetIsScrollInfoLayer));
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetIsScrollInfoLayer) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetForceDisableApz));
}
};

View File

@ -74,6 +74,7 @@ public:
, mIsLayersIdRoot(false)
, mUsesContainerScrolling(false)
, mIsScrollInfoLayer(false)
, mForceDisableApz(false)
{
}
@ -113,7 +114,8 @@ public:
mAllowVerticalScrollWithWheel == aOther.mAllowVerticalScrollWithWheel &&
mIsLayersIdRoot == aOther.mIsLayersIdRoot &&
mUsesContainerScrolling == aOther.mUsesContainerScrolling &&
mIsScrollInfoLayer == aOther.mIsScrollInfoLayer;
mIsScrollInfoLayer == aOther.mIsScrollInfoLayer &&
mForceDisableApz == aOther.mForceDisableApz;
}
bool operator!=(const FrameMetrics& aOther) const
@ -554,6 +556,13 @@ public:
return mIsScrollInfoLayer;
}
void SetForceDisableApz(bool aForceDisable) {
mForceDisableApz = aForceDisable;
}
bool IsApzForceDisabled() const {
return mForceDisableApz;
}
private:
// A unique ID assigned to each scrollable frame.
ViewID mScrollId;
@ -742,6 +751,10 @@ private:
// Whether or not this frame has a "scroll info layer" to capture events.
bool mIsScrollInfoLayer:1;
// Whether or not the compositor should actually do APZ-scrolling on this
// scrollframe.
bool mForceDisableApz:1;
// WARNING!!!!
//
// When adding new fields to FrameMetrics, the following places should be

View File

@ -3436,6 +3436,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const ScrollMetadata& aScrollMe
mFrameMetrics.SetIsLayersIdRoot(aLayerMetrics.IsLayersIdRoot());
mFrameMetrics.SetUsesContainerScrolling(aLayerMetrics.UsesContainerScrolling());
mFrameMetrics.SetIsScrollInfoLayer(aLayerMetrics.IsScrollInfoLayer());
mFrameMetrics.SetForceDisableApz(aLayerMetrics.IsApzForceDisabled());
if (scrollOffsetUpdated) {
APZC_LOG("%p updating scroll offset from %s to %s\n", this,