Bug 1078122 part 2 - Encapsulate mIsRunningOnCompositor in AnimationPlayer; r=dholbert

This commit is contained in:
Brian Birtles 2014-10-20 13:55:46 +09:00
parent 75670f2118
commit b46fbc6e51
4 changed files with 9 additions and 6 deletions

View File

@ -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<TimeDuration> mStartTime; // Timeline timescale
bool mIsRunningOnCompositor;
nsRefPtr<AnimationTimeline> mTimeline;
nsRefPtr<Animation> mSource;
@ -111,6 +113,7 @@ protected:
Nullable<TimeDuration> mHoldTime; // Player timescale
bool mIsPaused;
bool mIsRunningOnCompositor;
};
} // namespace dom

View File

@ -412,7 +412,7 @@ AddAnimationsForProperty(nsIFrame* aFrame, nsCSSProperty aProperty,
continue;
}
AddAnimationForProperty(aFrame, aProperty, player, aLayer, aData, aPending);
player->mIsRunningOnCompositor = true;
player->SetIsRunningOnCompositor();
}
}

View File

@ -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,

View File

@ -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);