Bug 1412716 - De-templatize Animation::ComposeStyle and relevant stuff. r?emilio
MozReview-Commit-ID: AoDRzqG8hET
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -1021,19 +1021,18 @@ Animation::WillComposeStyle()
MOZ_ASSERT(mEffect);
KeyframeEffectReadOnly* keyframeEffect = mEffect->AsKeyframeEffect();
if (keyframeEffect) {
keyframeEffect->WillComposeStyle();
}
}
-template<typename ComposeAnimationResult>
void
-Animation::ComposeStyle(ComposeAnimationResult&& aComposeResult,
+Animation::ComposeStyle(RawServoAnimationValueMap& aComposeResult,
const nsCSSPropertyIDSet& aPropertiesToSkip)
{
if (!mEffect) {
return;
}
// In order to prevent flicker, there are a few cases where we want to use
// a different time for rendering that would otherwise be returned by
@@ -1083,18 +1082,17 @@ Animation::ComposeStyle(ComposeAnimation
if (!timeToUse.IsNull()) {
mHoldTime = CurrentTimeFromTimelineTime(
timeToUse.Value(), mStartTime.Value(), mPlaybackRate);
}
}
KeyframeEffectReadOnly* keyframeEffect = mEffect->AsKeyframeEffect();
if (keyframeEffect) {
- keyframeEffect->ComposeStyle(Forward<ComposeAnimationResult>(aComposeResult),
- aPropertiesToSkip);
+ keyframeEffect->ComposeStyle(aComposeResult, aPropertiesToSkip);
}
}
MOZ_ASSERT(pending == Pending(),
"Pending state should not change during the course of compositing");
}
void
@@ -1653,16 +1651,10 @@ bool
Animation::IsRunningOnCompositor() const
{
return mEffect &&
mEffect->AsKeyframeEffect() &&
mEffect->AsKeyframeEffect()->IsRunningOnCompositor();
}
-template
-void
-Animation::ComposeStyle<RawServoAnimationValueMap&>(
- RawServoAnimationValueMap& aAnimationValues,
- const nsCSSPropertyIDSet& aPropertiesToSkip);
-
} // namespace dom
} // namespace mozilla
--- a/dom/animation/Animation.h
+++ b/dom/animation/Animation.h
@@ -368,18 +368,17 @@ public:
void WillComposeStyle();
/**
* Updates |aComposeResult| with the animation values of this animation's
* effect, if any.
* Any properties contained in |aPropertiesToSkip| will not be added or
* updated in |aComposeResult|.
*/
- template<typename ComposeAnimationResult>
- void ComposeStyle(ComposeAnimationResult&& aComposeResult,
+ void ComposeStyle(RawServoAnimationValueMap& aComposeResult,
const nsCSSPropertyIDSet& aPropertiesToSkip);
void NotifyEffectTimingUpdated();
void NotifyGeometricAnimationsStartingThisFrame();
/**
* Used by subclasses to synchronously queue a cancel event in situations
* where the Animation may have been cancelled.
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -416,20 +416,19 @@ KeyframeEffectReadOnly::ComposeStyleRule
&mBaseStyleValuesForServo,
aProperty.mProperty,
&aSegment,
&aProperty.mSegments.LastElement(),
&aComputedTiming,
mEffectOptions.mIterationComposite);
}
-template<typename ComposeAnimationResult>
void
KeyframeEffectReadOnly::ComposeStyle(
- ComposeAnimationResult&& aComposeResult,
+ RawServoAnimationValueMap& aComposeResult,
const nsCSSPropertyIDSet& aPropertiesToSkip)
{
MOZ_DIAGNOSTIC_ASSERT(!mIsComposingStyle,
"Should not be called recursively");
if (mIsComposingStyle) {
return;
}
@@ -472,20 +471,17 @@ KeyframeEffectReadOnly::ComposeStyle(
MOZ_ASSERT(segment->mFromKey == (segment-1)->mToKey, "incorrect keys");
}
MOZ_ASSERT(segment->mFromKey <= segment->mToKey, "incorrect keys");
MOZ_ASSERT(segment >= prop.mSegments.Elements() &&
size_t(segment - prop.mSegments.Elements()) <
prop.mSegments.Length(),
"out of array bounds");
- ComposeStyleRule(Forward<ComposeAnimationResult>(aComposeResult),
- prop,
- *segment,
- computedTiming);
+ ComposeStyleRule(aComposeResult, prop, *segment, computedTiming);
}
// If the animation produces a transform change hint that affects the overflow
// region, we need to record the current time to unthrottle the animation
// periodically when the animation is being throttled because it's scrolled
// out of view.
if (HasTransformThatMightAffectOverflow()) {
nsPresContext* presContext =
@@ -1695,16 +1691,10 @@ KeyframeEffectReadOnly::UpdateEffectSet(
effectSet->SetMayHaveTransformAnimation();
if (frame) {
frame->SetMayHaveTransformAnimation();
}
}
}
-template
-void
-KeyframeEffectReadOnly::ComposeStyle<RawServoAnimationValueMap&>(
- RawServoAnimationValueMap& aAnimationValues,
- const nsCSSPropertyIDSet& aPropertiesToSkip);
-
} // namespace dom
} // namespace mozilla
--- a/dom/animation/KeyframeEffectReadOnly.h
+++ b/dom/animation/KeyframeEffectReadOnly.h
@@ -199,18 +199,17 @@ public:
// We need to update this outside ComposeStyle() because we should avoid
// mutating any state in ComposeStyle() since it might be called during
// parallel traversal.
void WillComposeStyle();
// Updates |aComposeResult| with the animation values produced by this
// AnimationEffect for the current time except any properties contained
// in |aPropertiesToSkip|.
- template<typename ComposeAnimationResult>
- void ComposeStyle(ComposeAnimationResult&& aRestultContainer,
+ void ComposeStyle(RawServoAnimationValueMap& aComposeResult,
const nsCSSPropertyIDSet& aPropertiesToSkip);
// Returns true if at least one property is being animated on compositor.
bool IsRunningOnCompositor() const;
void SetIsRunningOnCompositor(nsCSSPropertyID aProperty, bool aIsRunning);
void ResetIsRunningOnCompositor();