Bug 1004871 part 11 - Move ElementAnimation members closer together for readability and packing; r=dholbert

Also shuffle the initialization of members in
nsAnimationManager::BuildAnimations to roughly match the order in which they
are declared (with the exception that mPlayState needs to be set before calling
IsPaused() which is used to set mPauseStart).
This commit is contained in:
Brian Birtles 2014-05-28 16:51:50 +09:00
parent 5a990f0766
commit 4af2cc49f7
2 changed files with 5 additions and 6 deletions

View File

@ -295,10 +295,6 @@ struct ElementAnimation
return nullptr;
}
nsString mName; // empty string for 'none'
AnimationTiming mTiming;
uint8_t mPlayState;
bool IsPaused() const {
return mPlayState == NS_STYLE_ANIMATION_PLAY_STATE_PAUSED;
}
@ -323,12 +319,15 @@ struct ElementAnimation
static ComputedTiming GetComputedTimingAt(TimeDuration aElapsedDuration,
const AnimationTiming& aTiming);
nsString mName; // empty string for 'none'
AnimationTiming mTiming;
// The beginning of the delay period. This is also used by
// ElementPropertyTransition in its IsRemovedSentinel and
// SetRemovedSentinel methods.
mozilla::TimeStamp mStartTime;
mozilla::TimeStamp mPauseStart;
mozilla::TimeDuration mDelay;
uint8_t mPlayState;
bool mIsRunningOnCompositor;
enum {

View File

@ -688,15 +688,15 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
dest->mTiming.mIterationCount = src.GetIterationCount();
dest->mTiming.mDirection = src.GetDirection();
dest->mTiming.mFillMode = src.GetFillMode();
dest->mPlayState = src.GetPlayState();
dest->mDelay = TimeDuration::FromMilliseconds(src.GetDelay());
dest->mStartTime = now;
dest->mPlayState = src.GetPlayState();
if (dest->IsPaused()) {
dest->mPauseStart = now;
} else {
dest->mPauseStart = TimeStamp();
}
dest->mDelay = TimeDuration::FromMilliseconds(src.GetDelay());
nsCSSKeyframesRule* rule =
mPresContext->StyleSet()->KeyframesRuleForName(mPresContext,