Bug 1521644 - Add a layer property that indicates async zoom container layers. r=mattwoodrow

MozReview-Commit-ID: 6qkFXhRDFs

Differential Revision: https://phabricator.services.mozilla.com/D17174

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-02-01 18:29:11 +00:00
Родитель 764c20081e
Коммит 5c1e861efd
3 изменённых файлов: 31 добавлений и 0 удалений

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

@ -179,6 +179,14 @@ class SimpleLayerAttributes final {
return true;
}
bool SetIsAsyncZoomContainer(const Maybe<FrameMetrics::ViewID>& aViewId) {
if (mIsAsyncZoomContainerForViewId == aViewId) {
return false;
}
mIsAsyncZoomContainerForViewId = aViewId;
return true;
}
bool SetScrollbarData(const ScrollbarData& aScrollbarData) {
if (mScrollbarData == aScrollbarData) {
return false;
@ -292,6 +300,10 @@ class SimpleLayerAttributes final {
bool IsFixedPosition() const { return mIsFixedPosition; }
Maybe<FrameMetrics::ViewID> IsAsyncZoomContainer() const {
return mIsAsyncZoomContainerForViewId;
}
const ScrollbarData& GetScrollbarData() const { return mScrollbarData; }
gfx::CompositionOp GetMixBlendMode() const { return mMixBlendMode; }
@ -341,6 +353,8 @@ class SimpleLayerAttributes final {
mContentFlags == aOther.mContentFlags &&
mOpacity == aOther.mOpacity &&
mIsFixedPosition == aOther.mIsFixedPosition &&
mIsAsyncZoomContainerForViewId ==
aOther.mIsAsyncZoomContainerForViewId &&
mScrollbarData == aOther.mScrollbarData &&
mMixBlendMode == aOther.mMixBlendMode &&
mForceIsolatedGroup == aOther.mForceIsolatedGroup;
@ -355,6 +369,7 @@ class SimpleLayerAttributes final {
uint32_t mContentFlags;
float mOpacity;
bool mIsFixedPosition;
Maybe<FrameMetrics::ViewID> mIsAsyncZoomContainerForViewId;
ScrollbarData mScrollbarData;
gfx::CompositionOp mMixBlendMode;
bool mForceIsolatedGroup;

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

@ -1718,6 +1718,11 @@ void Layer::PrintInfo(std::stringstream& aStream, const char* aPrefix) {
if (Is3DContextLeaf()) {
aStream << " [is3DContextLeaf]";
}
if (Maybe<FrameMetrics::ViewID> viewId = IsAsyncZoomContainer()) {
aStream << nsPrintfCString(" [asyncZoomContainer scrollId=%" PRIu64 "]",
*viewId)
.get();
}
if (IsScrollbarContainer()) {
aStream << " [scrollbar]";
}

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

@ -1216,6 +1216,14 @@ class Layer {
}
}
void SetIsAsyncZoomContainer(const Maybe<FrameMetrics::ViewID>& aViewId) {
if (mSimpleAttrs.SetIsAsyncZoomContainer(aViewId)) {
MOZ_LAYERS_LOG_IF_SHADOWABLE(
this, ("Layer::Mutated(%p) IsAsyncZoomContainer", this));
MutatedSimple();
}
}
/**
* CONSTRUCTION PHASE ONLY
* This flag is true when the transform on the layer is a perspective
@ -1359,6 +1367,9 @@ class Layer {
virtual float GetPostXScale() const { return mSimpleAttrs.GetPostXScale(); }
virtual float GetPostYScale() const { return mSimpleAttrs.GetPostYScale(); }
bool GetIsFixedPosition() { return mSimpleAttrs.IsFixedPosition(); }
Maybe<FrameMetrics::ViewID> IsAsyncZoomContainer() {
return mSimpleAttrs.IsAsyncZoomContainer();
}
bool GetTransformIsPerspective() const {
return mSimpleAttrs.GetTransformIsPerspective();
}