diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 2b9fdbe1b948..0d006149d981 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -5743,7 +5743,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder, , mNoExtendContext(false) , mIsTransformSeparator(false) , mTransformPreserves3DInited(false) - , mAllowAsyncAnimation(false) + , mIsFullyVisible(false) { MOZ_COUNT_CTOR(nsDisplayTransform); MOZ_ASSERT(aFrame, "Must have a frame!"); @@ -5799,7 +5799,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame, nsDisplayList *aList, const nsRect& aChildrenVisibleRect, uint32_t aIndex, - bool aAllowAsyncAnimation) + bool aIsFullyVisible) : nsDisplayItem(aBuilder, aFrame) , mStoredList(aBuilder, aFrame, aList) , mTransformGetter(nullptr) @@ -5810,7 +5810,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder, , mNoExtendContext(false) , mIsTransformSeparator(false) , mTransformPreserves3DInited(false) - , mAllowAsyncAnimation(aAllowAsyncAnimation) + , mIsFullyVisible(aIsFullyVisible) { MOZ_COUNT_CTOR(nsDisplayTransform); MOZ_ASSERT(aFrame, "Must have a frame!"); @@ -5833,7 +5833,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder, , mNoExtendContext(false) , mIsTransformSeparator(false) , mTransformPreserves3DInited(false) - , mAllowAsyncAnimation(false) + , mIsFullyVisible(false) { MOZ_COUNT_CTOR(nsDisplayTransform); MOZ_ASSERT(aFrame, "Must have a frame!"); @@ -5857,7 +5857,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder, , mNoExtendContext(false) , mIsTransformSeparator(true) , mTransformPreserves3DInited(false) - , mAllowAsyncAnimation(false) + , mIsFullyVisible(false) { MOZ_COUNT_CTOR(nsDisplayTransform); MOZ_ASSERT(aFrame, "Must have a frame!"); @@ -6223,7 +6223,7 @@ nsDisplayOpacity::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) bool nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) { - return mAllowAsyncAnimation; + return mIsFullyVisible; } /* static */ bool @@ -6400,7 +6400,7 @@ already_AddRefed nsDisplayTransform::BuildLayer(nsDisplayListBuilder *aBu nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(container, aBuilder, this, mFrame, eCSSProperty_transform); - if (mAllowAsyncAnimation && MayBeAnimated(aBuilder)) { + if (mIsFullyVisible && MayBeAnimated(aBuilder)) { // Only allow async updates to the transform if we're an animated layer, since that's what // triggers us to set the correct AGR in the constructor and makes sure FrameLayerBuilder // won't compute occlusions for this layer. diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index 59076c4330be..7e4d461ad7ba 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -4077,7 +4077,7 @@ public: */ nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame, nsDisplayList *aList, const nsRect& aChildrenVisibleRect, - uint32_t aIndex = 0, bool aAllowAsyncAnimation = false); + uint32_t aIndex = 0, bool aIsFullyVisible = false); nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame, nsDisplayItem *aItem, const nsRect& aChildrenVisibleRect, uint32_t aIndex = 0); @@ -4380,8 +4380,9 @@ private: bool mIsTransformSeparator; // True if mTransformPreserves3D have been initialized. bool mTransformPreserves3DInited; - // True if async animation of the transform is allowed. - bool mAllowAsyncAnimation; + // True if the entire untransformed area has been treated as + // visible during display list construction. + bool mIsFullyVisible; }; /* A display item that applies a perspective transformation to a single