From 4dfe8eadc04bbf1ff0215274d6ec448745cffa3b Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Wed, 19 Jul 2017 09:24:24 -0400 Subject: [PATCH] Bug 1382200 - Change implementation of the LayerMetricsWrapper IsScrollInfoLayer to use the metrics flag. r=botond This also updates the WebRenderScrollDataWrapper function as it is meant to be semantically equivalent to the LayerMetricsWrapper one, which allows removal of a flag propagation. MozReview-Commit-ID: 9DBx4qbhq5A --HG-- extra : rebase_source : 3201d8a4bb7192ecdbe95983b605ac53b1a28c50 --- gfx/layers/LayerMetricsWrapper.h | 8 +------- gfx/layers/wr/WebRenderScrollData.cpp | 1 - gfx/layers/wr/WebRenderScrollData.h | 4 ---- gfx/layers/wr/WebRenderScrollDataWrapper.h | 3 +-- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/gfx/layers/LayerMetricsWrapper.h b/gfx/layers/LayerMetricsWrapper.h index 3a7812bb7534..9790bd635496 100644 --- a/gfx/layers/LayerMetricsWrapper.h +++ b/gfx/layers/LayerMetricsWrapper.h @@ -178,13 +178,7 @@ public: { MOZ_ASSERT(IsValid()); - // If we are not at the bottommost layer then it's - // a stack of container layers all the way down to - // mLayer, which we can ignore. We only care about - // non-container descendants. - return Metrics().IsScrollable() - && mLayer->AsContainerLayer() - && !mLayer->GetFirstChild(); + return Metrics().IsScrollInfoLayer(); } LayerMetricsWrapper GetParent() const diff --git a/gfx/layers/wr/WebRenderScrollData.cpp b/gfx/layers/wr/WebRenderScrollData.cpp index ac4417ba92ce..7d269134e7be 100644 --- a/gfx/layers/wr/WebRenderScrollData.cpp +++ b/gfx/layers/wr/WebRenderScrollData.cpp @@ -37,7 +37,6 @@ WebRenderLayerScrollData::Initialize(WebRenderScrollData& aOwner, mScrollIds.AppendElement(aOwner.AddMetadata(aLayer->GetScrollMetadata(i))); } - mIsScrollInfoLayer = aLayer->AsContainerLayer() && !aLayer->GetFirstChild(); mTransform = aLayer->GetTransform(); mTransformIsPerspective = aLayer->GetTransformIsPerspective(); mEventRegions = aLayer->GetEventRegions(); diff --git a/gfx/layers/wr/WebRenderScrollData.h b/gfx/layers/wr/WebRenderScrollData.h index bd3cf98a1732..48c606234d81 100644 --- a/gfx/layers/wr/WebRenderScrollData.h +++ b/gfx/layers/wr/WebRenderScrollData.h @@ -52,7 +52,6 @@ public: const ScrollMetadata& GetScrollMetadata(const WebRenderScrollData& aOwner, size_t aIndex) const; - bool IsScrollInfoLayer() const { return mIsScrollInfoLayer; } gfx::Matrix4x4 GetTransform() const { return mTransform; } CSSTransformMatrix GetTransformTyped() const; bool GetTransformIsPerspective() const { return mTransformIsPerspective; } @@ -84,7 +83,6 @@ private: // Various data that we collect from the Layer in Initialize(), serialize // over IPC, and use on the parent side in APZ. - bool mIsScrollInfoLayer; gfx::Matrix4x4 mTransform; bool mTransformIsPerspective; EventRegions mEventRegions; @@ -188,7 +186,6 @@ struct ParamTraits { WriteParam(aMsg, aParam.mDescendantCount); WriteParam(aMsg, aParam.mScrollIds); - WriteParam(aMsg, aParam.mIsScrollInfoLayer); WriteParam(aMsg, aParam.mTransform); WriteParam(aMsg, aParam.mTransformIsPerspective); WriteParam(aMsg, aParam.mEventRegions); @@ -207,7 +204,6 @@ struct ParamTraits { return ReadParam(aMsg, aIter, &aResult->mDescendantCount) && ReadParam(aMsg, aIter, &aResult->mScrollIds) - && ReadParam(aMsg, aIter, &aResult->mIsScrollInfoLayer) && ReadParam(aMsg, aIter, &aResult->mTransform) && ReadParam(aMsg, aIter, &aResult->mTransformIsPerspective) && ReadParam(aMsg, aIter, &aResult->mEventRegions) diff --git a/gfx/layers/wr/WebRenderScrollDataWrapper.h b/gfx/layers/wr/WebRenderScrollDataWrapper.h index e7d60e132b5b..2911deadaae4 100644 --- a/gfx/layers/wr/WebRenderScrollDataWrapper.h +++ b/gfx/layers/wr/WebRenderScrollDataWrapper.h @@ -129,8 +129,7 @@ public: { MOZ_ASSERT(IsValid()); - return Metrics().IsScrollable() - && mLayer->IsScrollInfoLayer(); + return Metrics().IsScrollInfoLayer(); } WebRenderScrollDataWrapper GetLastChild() const