Back out d79c5f78243f (bug 1240073) for reftest and crashtest crashes. CLOSED TREE

This commit is contained in:
Matt Woodrow 2016-01-27 10:46:55 +13:00
parent a10345e651
commit e356835dfb
2 changed files with 10 additions and 40 deletions

View File

@ -5060,7 +5060,6 @@ void
nsDisplayTransform::SetReferenceFrameToAncestor(nsDisplayListBuilder* aBuilder)
{
mAnimatedGeometryRootForChildren = mAnimatedGeometryRoot;
mAnimatedGeometryRootForScrollMetadata = mAnimatedGeometryRoot;
if (mFrame == aBuilder->RootReferenceFrame()) {
return;
}
@ -5082,15 +5081,7 @@ nsDisplayTransform::SetReferenceFrameToAncestor(nsDisplayListBuilder* aBuilder)
// frame, which is our AGR, not the parent AGR.
mAnimatedGeometryRoot = mAnimatedGeometryRootForChildren;
} else if (mAnimatedGeometryRoot->mParentAGR) {
mAnimatedGeometryRootForScrollMetadata = mAnimatedGeometryRoot->mParentAGR;
if (!MayBeAnimated(aBuilder)) {
// If we're an animated transform then we want the same AGR as our children
// so that FrameLayerBuilder knows that this layer moves with the transform
// and won't compute occlusions. If we're not animated then use our parent
// AGR so that inactive transform layers can go in the same PaintedLayer as
// surrounding content.
mAnimatedGeometryRoot = mAnimatedGeometryRoot->mParentAGR;
}
mAnimatedGeometryRoot = mAnimatedGeometryRoot->mParentAGR;
}
mVisibleRect = aBuilder->GetDirtyRect() + mToReferenceFrame;
}
@ -5781,13 +5772,8 @@ already_AddRefed<Layer> nsDisplayTransform::BuildLayer(nsDisplayListBuilder *aBu
this, mFrame,
eCSSProperty_transform);
if (ShouldPrerender(aBuilder)) {
if (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->SetUserData(nsIFrame::LayerIsPrerenderedDataKey(),
/*the value is irrelevant*/nullptr);
container->SetContentFlags(container->GetContentFlags() | Layer::CONTENT_MAY_CHANGE_TRANSFORM);
} else {
container->RemoveUserData(nsIFrame::LayerIsPrerenderedDataKey());
@ -5796,21 +5782,6 @@ already_AddRefed<Layer> nsDisplayTransform::BuildLayer(nsDisplayListBuilder *aBu
return container.forget();
}
bool
nsDisplayTransform::MayBeAnimated(nsDisplayListBuilder* aBuilder)
{
// Here we check if the *post-transform* bounds of this item are big enough
// to justify an active layer.
if (ActiveLayerTracker::IsStyleAnimated(aBuilder, mFrame, eCSSProperty_transform) &&
!IsItemTooSmallForActiveLayer(this))
return true;
if (EffectCompositor::HasAnimationsForCompositor(mFrame,
eCSSProperty_transform)) {
return true;
}
return false;
}
nsDisplayItem::LayerState
nsDisplayTransform::GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
@ -5822,7 +5793,13 @@ nsDisplayTransform::GetLayerState(nsDisplayListBuilder* aBuilder,
mIsTransformSeparator) {
return LAYER_ACTIVE_FORCE;
}
if (MayBeAnimated(aBuilder)) {
// Here we check if the *post-transform* bounds of this item are big enough
// to justify an active layer.
if (ActiveLayerTracker::IsStyleAnimated(aBuilder, mFrame, eCSSProperty_transform) &&
!IsItemTooSmallForActiveLayer(this))
return LAYER_ACTIVE;
if (EffectCompositor::HasAnimationsForCompositor(mFrame,
eCSSProperty_transform)) {
return LAYER_ACTIVE;
}

View File

@ -3956,10 +3956,6 @@ public:
return nsDisplayItem::ReferenceFrameForChildren();
}
AnimatedGeometryRoot* AnimatedGeometryRootForScrollMetadata() const override {
return mAnimatedGeometryRootForScrollMetadata;
}
virtual const nsRect& GetVisibleRectForChildren() const override
{
return mChildrenVisibleRect;
@ -4107,8 +4103,6 @@ public:
bool aLogAnimations = false);
bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) override;
bool MayBeAnimated(nsDisplayListBuilder* aBuilder);
/**
* This will return if it's possible for this element to be prerendered.
* This should never return false if we're going to prerender.
@ -4198,7 +4192,6 @@ private:
Matrix4x4 mTransformPreserves3D;
ComputeTransformFunction mTransformGetter;
AnimatedGeometryRoot* mAnimatedGeometryRootForChildren;
AnimatedGeometryRoot* mAnimatedGeometryRootForScrollMetadata;
nsRect mChildrenVisibleRect;
uint32_t mIndex;
nsRect mBounds;