summaryrefslogtreecommitdiff
path: root/chromium/ui/compositor/layer_animation_element.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/compositor/layer_animation_element.cc')
-rw-r--r--chromium/ui/compositor/layer_animation_element.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/chromium/ui/compositor/layer_animation_element.cc b/chromium/ui/compositor/layer_animation_element.cc
index 1b070f923f5..82bfcc56ba5 100644
--- a/chromium/ui/compositor/layer_animation_element.cc
+++ b/chromium/ui/compositor/layer_animation_element.cc
@@ -385,10 +385,10 @@ class GradientMaskTransition : public LayerAnimationElement {
DCHECK_EQ(start_.step_count(), target_.step_count());
for (auto i = 0; i < static_cast<int>(start_.step_count()); ++i) {
gradient_mask.AddStep(
- gfx::Tween::FloatValueBetween(t, start_.steps()[i].percent,
- target_.steps()[i].percent),
+ gfx::Tween::FloatValueBetween(t, start_.steps()[i].fraction,
+ target_.steps()[i].fraction),
gfx::Tween::IntValueBetween(t, start_.steps()[i].alpha,
- target_.steps()[i].alpha));
+ target_.steps()[i].alpha));
}
delegate->SetGradientMaskFromAnimation(
@@ -404,7 +404,7 @@ class GradientMaskTransition : public LayerAnimationElement {
private:
gfx::LinearGradient start_;
- gfx::LinearGradient target_;
+ const gfx::LinearGradient target_;
};
// ThreadedLayerAnimationElement -----------------------------------------------
@@ -521,6 +521,9 @@ class ThreadedOpacityTransition : public ThreadedLayerAnimationElement {
}
std::unique_ptr<cc::KeyframeModel> CreateCCKeyframeModel() override {
+ // Ensures that we don't remove and add a model with the same id in a single
+ // frame.
+ UpdateKeyframeModelId();
std::unique_ptr<gfx::AnimationCurve> animation_curve(
new FloatAnimationCurveAdapter(tween_type(), start_, target_,
duration()));
@@ -594,6 +597,9 @@ class ThreadedTransformTransition : public ThreadedLayerAnimationElement {
}
std::unique_ptr<cc::KeyframeModel> CreateCCKeyframeModel() override {
+ // Ensures that we don't remove and add a model with the same id in a single
+ // frame.
+ UpdateKeyframeModelId();
std::unique_ptr<gfx::AnimationCurve> animation_curve(
new TransformAnimationCurveAdapter(tween_type(), start_, target_,
duration()));
@@ -766,6 +772,10 @@ std::string LayerAnimationElement::ToString() const {
last_progressed_fraction_);
}
+void LayerAnimationElement::UpdateKeyframeModelId() {
+ keyframe_model_id_ = cc::AnimationIdProvider::NextKeyframeModelId();
+}
+
std::string LayerAnimationElement::DebugName() const {
return "Default";
}