Bug 1321412 - Rename nsDisplayTransform::mIsFullyVisible to mAllowAsyncAnimations. r=mattwoodrow
MozReview-Commit-ID: F7wwQnv5cz9
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -5666,17 +5666,17 @@ nsDisplayTransform::nsDisplayTransform(n
, mTransformGetter(aTransformGetter)
, mAnimatedGeometryRootForChildren(mAnimatedGeometryRoot)
, mAnimatedGeometryRootForScrollMetadata(mAnimatedGeometryRoot)
, mChildrenVisibleRect(aChildrenVisibleRect)
, mIndex(aIndex)
, mNoExtendContext(false)
, mIsTransformSeparator(false)
, mTransformPreserves3DInited(false)
- , mIsFullyVisible(false)
+ , mAllowAsyncAnimation(false)
{
MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!");
Init(aBuilder);
}
void
nsDisplayTransform::SetReferenceFrameToAncestor(nsDisplayListBuilder* aBuilder)
@@ -5722,28 +5722,28 @@ nsDisplayTransform::Init(nsDisplayListBu
mStoredList.SetClip(aBuilder, DisplayItemClip::NoClip());
mStoredList.SetVisibleRect(mChildrenVisibleRect);
}
nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
nsIFrame *aFrame, nsDisplayList *aList,
const nsRect& aChildrenVisibleRect,
uint32_t aIndex,
- bool aIsFullyVisible)
+ bool aAllowAsyncAnimation)
: nsDisplayItem(aBuilder, aFrame)
, mStoredList(aBuilder, aFrame, aList)
, mTransformGetter(nullptr)
, mAnimatedGeometryRootForChildren(mAnimatedGeometryRoot)
, mAnimatedGeometryRootForScrollMetadata(mAnimatedGeometryRoot)
, mChildrenVisibleRect(aChildrenVisibleRect)
, mIndex(aIndex)
, mNoExtendContext(false)
, mIsTransformSeparator(false)
, mTransformPreserves3DInited(false)
- , mIsFullyVisible(aIsFullyVisible)
+ , mAllowAsyncAnimation(aAllowAsyncAnimation)
{
MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!");
SetReferenceFrameToAncestor(aBuilder);
Init(aBuilder);
UpdateBoundsFor3D(aBuilder);
}
@@ -5756,17 +5756,17 @@ nsDisplayTransform::nsDisplayTransform(n
, mTransformGetter(nullptr)
, mAnimatedGeometryRootForChildren(mAnimatedGeometryRoot)
, mAnimatedGeometryRootForScrollMetadata(mAnimatedGeometryRoot)
, mChildrenVisibleRect(aChildrenVisibleRect)
, mIndex(aIndex)
, mNoExtendContext(false)
, mIsTransformSeparator(false)
, mTransformPreserves3DInited(false)
- , mIsFullyVisible(false)
+ , mAllowAsyncAnimation(false)
{
MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!");
SetReferenceFrameToAncestor(aBuilder);
Init(aBuilder);
}
nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
@@ -5780,17 +5780,17 @@ nsDisplayTransform::nsDisplayTransform(n
, mTransformGetter(nullptr)
, mAnimatedGeometryRootForChildren(mAnimatedGeometryRoot)
, mAnimatedGeometryRootForScrollMetadata(mAnimatedGeometryRoot)
, mChildrenVisibleRect(aChildrenVisibleRect)
, mIndex(aIndex)
, mNoExtendContext(false)
, mIsTransformSeparator(true)
, mTransformPreserves3DInited(false)
- , mIsFullyVisible(false)
+ , mAllowAsyncAnimation(false)
{
MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!");
Init(aBuilder);
UpdateBoundsFor3D(aBuilder);
}
/* Returns the delta specified by the transform-origin property.
@@ -6146,17 +6146,17 @@ nsDisplayOpacity::CanUseAsyncAnimations(
AnimationPerformanceWarning::Type::OpacityFrameInactive));
return false;
}
bool
nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
{
- return mIsFullyVisible;
+ return mAllowAsyncAnimation;
}
/* static */ bool
nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame)
{
// Elements whose transform has been modified recently, or which
// have a compositor-animated transform, can be prerendered. An element
@@ -6323,17 +6323,17 @@ already_AddRefed<Layer> nsDisplayTransfo
container->SetContentFlags(container->GetContentFlags() | Layer::CONTENT_EXTEND_3D_CONTEXT);
} else {
container->SetContentFlags(container->GetContentFlags() & ~Layer::CONTENT_EXTEND_3D_CONTEXT);
}
nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(container, aBuilder,
this, mFrame,
eCSSProperty_transform);
- if (mIsFullyVisible && MayBeAnimated(aBuilder)) {
+ if (mAllowAsyncAnimation && 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.
container->SetUserData(nsIFrame::LayerIsPrerenderedDataKey(),
/*the value is irrelevant*/nullptr);
container->SetContentFlags(container->GetContentFlags() | Layer::CONTENT_MAY_CHANGE_TRANSFORM);
} else {
container->RemoveUserData(nsIFrame::LayerIsPrerenderedDataKey());
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -4064,17 +4064,17 @@ public:
*/
typedef Matrix4x4 (* ComputeTransformFunction)(nsIFrame* aFrame, float aAppUnitsPerPixel);
/* Constructor accepts a display list, empties it, and wraps it up. It also
* ferries the underlying frame to the nsDisplayItem constructor.
*/
nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame,
nsDisplayList *aList, const nsRect& aChildrenVisibleRect,
- uint32_t aIndex = 0, bool aIsFullyVisible = false);
+ uint32_t aIndex = 0, bool aAllowAsyncAnimation = false);
nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame,
nsDisplayItem *aItem, const nsRect& aChildrenVisibleRect,
uint32_t aIndex = 0);
nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame,
nsDisplayList *aList, const nsRect& aChildrenVisibleRect,
ComputeTransformFunction aTransformGetter, uint32_t aIndex = 0);
nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame,
nsDisplayList *aList, const nsRect& aChildrenVisibleRect,
@@ -4367,19 +4367,18 @@ private:
// the child preserves3d context doesn't create a transform item.
// With this flags, we force the item not extending 3D context.
bool mNoExtendContext;
// This item is a separator between 3D rendering contexts, and
// mTransform have been presetted by the constructor.
bool mIsTransformSeparator;
// True if mTransformPreserves3D have been initialized.
bool mTransformPreserves3DInited;
- // True if the entire untransformed area has been treated as
- // visible during display list construction.
- bool mIsFullyVisible;
+ // True if async animation of the transform is allowed.
+ bool mAllowAsyncAnimation;
};
/* A display item that applies a perspective transformation to a single
* nsDisplayTransform child item. We keep this as a separate item since the
* perspective-origin is relative to an ancestor of the transformed frame, and
* APZ can scroll the child separately.
*/
class nsDisplayPerspective : public nsDisplayItem