Bug 1316764 - Update animations on layers whenever the frame generation is not equal; r=hiro a=jcristau
authorBrian Birtles <birtles@gmail.com>
Thu, 22 Dec 2016 08:47:14 +0900
changeset 366129 a7e613c48e2ab4a4c6a495dc759acf0bbda20d44
parent 366128 21c5d924faf66dda8fe8aa882194c9091c7b8f8f
child 366130 6a7b2a984a1a5834b8476a75cc97960ff015b719
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro, jcristau
bugs1316764, 1229280
Bug 1316764 - Update animations on layers whenever the frame generation is not equal; r=hiro a=jcristau 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
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1525,28 +1525,25 @@ ElementRestyler::ElementRestyler(nsPresC
   , mVisibleKidsOfHiddenElement(aVisibleKidsOfHiddenElement)
-  // 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 =
   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 &&