Bug 1316764 - Update animations on layers whenever the frame generation is not equal; r=hiro
authorBrian Birtles <birtles@gmail.com>
Thu, 22 Dec 2016 08:47:14 +0900
changeset 326882 073d993c46f9dac32dfa5abf9a4eebc66881ed5b
parent 326881 5afd544cec39820f11f437147f693ca6d4de5337
child 326883 7d007364e2cf17c4c31e1c890073e97e54bcf513
push id31114
push usercbook@mozilla.com
push dateThu, 22 Dec 2016 15:19:05 +0000
treeherdermozilla-central@8460203bc93b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1316764, 1229280
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1316764 - Update animations on layers whenever the frame generation is not equal; r=hiro This fixes a problem where we fail to update animations on layers when an EffectSet is destroyed. In this case when we call RestyleManager::GetAnimationGenerationForFrame in ElementRestyler::AddLayerChangesForAnimation(), it will return zero but the animation generation on the layer will be set to some positive non-zero value. If we compare the two generation numbers using < we will think the layer is up-to-date. Using != fixes this. We only used < while we had independent generation numbers of animations and transitions but that was fixed in bug 1229280. MozReview-Commit-ID: Jsunjc145GR
layout/base/RestyleManager.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1525,28 +1525,25 @@ ElementRestyler::ElementRestyler(nsPresC
   , mVisibleKidsOfHiddenElement(aVisibleKidsOfHiddenElement)
 #endif
 {
 }
 
 void
 ElementRestyler::AddLayerChangesForAnimation()
 {
-  // Bug 847286 - We should have separate animation generation counters
-  // on layers for transitions and animations and use != comparison below
-  // rather than a > comparison.
   uint64_t frameGeneration =
     RestyleManager::GetAnimationGenerationForFrame(mFrame);
 
   nsChangeHint hint = nsChangeHint(0);
   for (const LayerAnimationInfo::Record& layerInfo :
          LayerAnimationInfo::sRecords) {
     Layer* layer =
       FrameLayerBuilder::GetDedicatedLayer(mFrame, layerInfo.mLayerType);
-    if (layer && frameGeneration > layer->GetAnimationGeneration()) {
+    if (layer && frameGeneration != layer->GetAnimationGeneration()) {
       // If we have a transform layer but don't have any transform style, we
       // probably just removed the transform but haven't destroyed the layer
       // yet. In this case we will add the appropriate change hint
       // (nsChangeHint_UpdateContainingBlock) when we compare style contexts
       // so we can skip adding any change hint here. (If we *were* to add
       // nsChangeHint_UpdateTransformLayer, ApplyRenderingChangeToTree would
       // complain that we're updating a transform layer without a transform).
       if (layerInfo.mLayerType == nsDisplayItem::TYPE_TRANSFORM &&