Backed out changeset c2b8107d8468 (bug 1321412)

This commit is contained in:
Sebastian Hengst 2016-12-09 22:27:07 +01:00
Родитель 5cf78e61d1
Коммит 380e39c664
2 изменённых файлов: 11 добавлений и 10 удалений

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

@ -5743,7 +5743,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
, mNoExtendContext(false) , mNoExtendContext(false)
, mIsTransformSeparator(false) , mIsTransformSeparator(false)
, mTransformPreserves3DInited(false) , mTransformPreserves3DInited(false)
, mAllowAsyncAnimation(false) , mIsFullyVisible(false)
{ {
MOZ_COUNT_CTOR(nsDisplayTransform); MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!"); MOZ_ASSERT(aFrame, "Must have a frame!");
@ -5799,7 +5799,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
nsIFrame *aFrame, nsDisplayList *aList, nsIFrame *aFrame, nsDisplayList *aList,
const nsRect& aChildrenVisibleRect, const nsRect& aChildrenVisibleRect,
uint32_t aIndex, uint32_t aIndex,
bool aAllowAsyncAnimation) bool aIsFullyVisible)
: nsDisplayItem(aBuilder, aFrame) : nsDisplayItem(aBuilder, aFrame)
, mStoredList(aBuilder, aFrame, aList) , mStoredList(aBuilder, aFrame, aList)
, mTransformGetter(nullptr) , mTransformGetter(nullptr)
@ -5810,7 +5810,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
, mNoExtendContext(false) , mNoExtendContext(false)
, mIsTransformSeparator(false) , mIsTransformSeparator(false)
, mTransformPreserves3DInited(false) , mTransformPreserves3DInited(false)
, mAllowAsyncAnimation(aAllowAsyncAnimation) , mIsFullyVisible(aIsFullyVisible)
{ {
MOZ_COUNT_CTOR(nsDisplayTransform); MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!"); MOZ_ASSERT(aFrame, "Must have a frame!");
@ -5833,7 +5833,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
, mNoExtendContext(false) , mNoExtendContext(false)
, mIsTransformSeparator(false) , mIsTransformSeparator(false)
, mTransformPreserves3DInited(false) , mTransformPreserves3DInited(false)
, mAllowAsyncAnimation(false) , mIsFullyVisible(false)
{ {
MOZ_COUNT_CTOR(nsDisplayTransform); MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!"); MOZ_ASSERT(aFrame, "Must have a frame!");
@ -5857,7 +5857,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
, mNoExtendContext(false) , mNoExtendContext(false)
, mIsTransformSeparator(true) , mIsTransformSeparator(true)
, mTransformPreserves3DInited(false) , mTransformPreserves3DInited(false)
, mAllowAsyncAnimation(false) , mIsFullyVisible(false)
{ {
MOZ_COUNT_CTOR(nsDisplayTransform); MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!"); MOZ_ASSERT(aFrame, "Must have a frame!");
@ -6223,7 +6223,7 @@ nsDisplayOpacity::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
bool bool
nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
{ {
return mAllowAsyncAnimation; return mIsFullyVisible;
} }
/* static */ bool /* static */ bool
@ -6400,7 +6400,7 @@ already_AddRefed<Layer> nsDisplayTransform::BuildLayer(nsDisplayListBuilder *aBu
nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(container, aBuilder, nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(container, aBuilder,
this, mFrame, this, mFrame,
eCSSProperty_transform); 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 // 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 // triggers us to set the correct AGR in the constructor and makes sure FrameLayerBuilder
// won't compute occlusions for this layer. // won't compute occlusions for this layer.

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

@ -4077,7 +4077,7 @@ public:
*/ */
nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame, nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame,
nsDisplayList *aList, const nsRect& aChildrenVisibleRect, nsDisplayList *aList, const nsRect& aChildrenVisibleRect,
uint32_t aIndex = 0, bool aAllowAsyncAnimation = false); uint32_t aIndex = 0, bool aIsFullyVisible = false);
nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame, nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame,
nsDisplayItem *aItem, const nsRect& aChildrenVisibleRect, nsDisplayItem *aItem, const nsRect& aChildrenVisibleRect,
uint32_t aIndex = 0); uint32_t aIndex = 0);
@ -4380,8 +4380,9 @@ private:
bool mIsTransformSeparator; bool mIsTransformSeparator;
// True if mTransformPreserves3D have been initialized. // True if mTransformPreserves3D have been initialized.
bool mTransformPreserves3DInited; bool mTransformPreserves3DInited;
// True if async animation of the transform is allowed. // True if the entire untransformed area has been treated as
bool mAllowAsyncAnimation; // visible during display list construction.
bool mIsFullyVisible;
}; };
/* A display item that applies a perspective transformation to a single /* A display item that applies a perspective transformation to a single