Bug 1246290 - Add a bit to FrameMetrics to indicate if APZ-scrolling should be disabled on that APZC. r=botond
MozReview-Commit-ID: 2LKOOZkbrkJ
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -710,16 +710,17 @@ struct ParamTraits<mozilla::layers::Fram
WriteParam(aMsg, aParam.mHasScrollgrab);
WriteParam(aMsg, aParam.mUpdateScrollOffset);
WriteParam(aMsg, aParam.mDoSmoothScroll);
WriteParam(aMsg, aParam.mUseDisplayPortMargins);
WriteParam(aMsg, aParam.mAllowVerticalScrollWithWheel);
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)
{
nsCString str;
if (!ReadParam(aMsg, aIter, &str)) {
return false;
}
@@ -771,17 +772,18 @@ struct ParamTraits<mozilla::layers::Fram
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsRootContent) &&
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetHasScrollgrab) &&
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetUpdateScrollOffset) &&
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetDoSmoothScroll) &&
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetUseDisplayPortMargins) &&
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetAllowVerticalScrollWithWheel) &&
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsLayersIdRoot) &&
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetUsesContainerScrolling) &&
- ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsScrollInfoLayer));
+ ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsScrollInfoLayer) &&
+ ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetForceDisableApz));
}
};
template<>
struct ParamTraits<mozilla::layers::TextureFactoryIdentifier>
{
typedef mozilla::layers::TextureFactoryIdentifier paramType;
--- a/gfx/layers/FrameMetrics.h
+++ b/gfx/layers/FrameMetrics.h
@@ -70,16 +70,17 @@ public:
, mHasScrollgrab(false)
, mUpdateScrollOffset(false)
, mDoSmoothScroll(false)
, mUseDisplayPortMargins(false)
, mAllowVerticalScrollWithWheel(false)
, mIsLayersIdRoot(false)
, mUsesContainerScrolling(false)
, mIsScrollInfoLayer(false)
+ , mForceDisableApz(false)
{
}
// Default copy ctor and operator= are fine
bool operator==(const FrameMetrics& aOther) const
{
// Put mScrollId at the top since it's the most likely one to fail.
@@ -111,17 +112,18 @@ public:
mIsRootContent == aOther.mIsRootContent &&
mHasScrollgrab == aOther.mHasScrollgrab &&
mUpdateScrollOffset == aOther.mUpdateScrollOffset &&
mDoSmoothScroll == aOther.mDoSmoothScroll &&
mUseDisplayPortMargins == aOther.mUseDisplayPortMargins &&
mAllowVerticalScrollWithWheel == aOther.mAllowVerticalScrollWithWheel &&
mIsLayersIdRoot == aOther.mIsLayersIdRoot &&
mUsesContainerScrolling == aOther.mUsesContainerScrolling &&
- mIsScrollInfoLayer == aOther.mIsScrollInfoLayer;
+ mIsScrollInfoLayer == aOther.mIsScrollInfoLayer &&
+ mForceDisableApz == aOther.mForceDisableApz;
}
bool operator!=(const FrameMetrics& aOther) const
{
return !operator==(aOther);
}
bool IsDefault() const
@@ -573,16 +575,23 @@ public:
void SetIsScrollInfoLayer(bool aIsScrollInfoLayer) {
mIsScrollInfoLayer = aIsScrollInfoLayer;
}
bool IsScrollInfoLayer() const {
return mIsScrollInfoLayer;
}
+ void SetForceDisableApz(bool aForceDisable) {
+ mForceDisableApz = aForceDisable;
+ }
+ bool IsApzForceDisabled() const {
+ return mForceDisableApz;
+ }
+
private:
// A unique ID assigned to each scrollable frame.
ViewID mScrollId;
// The ViewID of the scrollable frame to which overscroll should be handed off.
ViewID mScrollParentId;
// The pres-shell resolution that has been induced on the document containing
@@ -769,16 +778,20 @@ private:
// True if scrolling using containers, false otherwise. This can be removed
// when containerful scrolling is eliminated.
bool mUsesContainerScrolling:1;
// 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
// updated to include them (as needed):
// FrameMetrics::operator ==
// AsyncPanZoomController::NotifyLayersUpdated
// The ParamTraits specialization in GfxMessageUtils.h
//
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -3432,16 +3432,17 @@ void AsyncPanZoomController::NotifyLayer
mFrameMetrics.SetHasScrollgrab(aLayerMetrics.GetHasScrollgrab());
mFrameMetrics.SetLineScrollAmount(aLayerMetrics.GetLineScrollAmount());
mFrameMetrics.SetPageScrollAmount(aLayerMetrics.GetPageScrollAmount());
mFrameMetrics.SetClipRect(aLayerMetrics.GetClipRect());
mFrameMetrics.SetMaskLayerIndex(aLayerMetrics.GetMaskLayerIndex());
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,
ToString(mFrameMetrics.GetScrollOffset()).c_str(),
ToString(aLayerMetrics.GetScrollOffset()).c_str());
// Send an acknowledgement with the new scroll generation so that any
// repaint requests later in this function go through.