diff --git a/dom/animation/AnimationPlayer.h b/dom/animation/AnimationPlayer.h index de652b23956..c4f3ac884e8 100644 --- a/dom/animation/AnimationPlayer.h +++ b/dom/animation/AnimationPlayer.h @@ -35,9 +35,9 @@ protected: public: explicit AnimationPlayer(AnimationTimeline* aTimeline) - : mIsRunningOnCompositor(false) - , mTimeline(aTimeline) + : mTimeline(aTimeline) , mIsPaused(false) + , mIsRunningOnCompositor(false) { } @@ -92,6 +92,9 @@ public: return GetSource() && GetSource()->IsInEffect(); } + void SetIsRunningOnCompositor() { mIsRunningOnCompositor = true; } + void ClearIsRunningOnCompositor() { mIsRunningOnCompositor = false; } + // Returns true if this animation does not currently need to update // style on the main thread (e.g. because it is empty, or is // running on the compositor). @@ -99,7 +102,6 @@ public: // The beginning of the delay period. Nullable mStartTime; // Timeline timescale - bool mIsRunningOnCompositor; nsRefPtr mTimeline; nsRefPtr mSource; @@ -111,6 +113,7 @@ protected: Nullable mHoldTime; // Player timescale bool mIsPaused; + bool mIsRunningOnCompositor; }; } // namespace dom diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index c258b35828d..7f3db0a27fe 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -412,7 +412,7 @@ AddAnimationsForProperty(nsIFrame* aFrame, nsCSSProperty aProperty, continue; } AddAnimationForProperty(aFrame, aProperty, player, aLayer, aData, aPending); - player->mIsRunningOnCompositor = true; + player->SetIsRunningOnCompositor(); } } diff --git a/layout/style/nsAnimationManager.cpp b/layout/style/nsAnimationManager.cpp index 322a5b7105b..352b991abca 100644 --- a/layout/style/nsAnimationManager.cpp +++ b/layout/style/nsAnimationManager.cpp @@ -311,7 +311,7 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext, } // Reset compositor state so animation will be re-synchronized. - oldPlayer->mIsRunningOnCompositor = false; + oldPlayer->ClearIsRunningOnCompositor(); // Handle changes in play state. // CSSAnimationPlayer takes care of override behavior so that, diff --git a/layout/style/nsTransitionManager.cpp b/layout/style/nsTransitionManager.cpp index 20eb9aeea54..19da9324a65 100644 --- a/layout/style/nsTransitionManager.cpp +++ b/layout/style/nsTransitionManager.cpp @@ -834,7 +834,7 @@ nsTransitionManager::FlushTransitions(FlushFlags aFlags) } else if ((computedTiming.mPhase == ComputedTiming::AnimationPhase_Active) && canThrottleTick && - !player->mIsRunningOnCompositor) { + !player->IsRunningOnCompositor()) { // Start a transition with a delay where we should start the // transition proper. collection->UpdateAnimationGeneration(mPresContext);