summaryrefslogtreecommitdiff
path: root/chromium/ui/compositor/layer_animation_element.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-09-29 16:16:15 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-11-09 10:04:06 +0000
commita95a7417ad456115a1ef2da4bb8320531c0821f1 (patch)
treeedcd59279e486d2fd4a8f88a7ed025bcf925c6e6 /chromium/ui/compositor/layer_animation_element.cc
parent33fc33aa94d4add0878ec30dc818e34e1dd3cc2a (diff)
downloadqtwebengine-chromium-a95a7417ad456115a1ef2da4bb8320531c0821f1.tar.gz
BASELINE: Update Chromium to 106.0.5249.126
Change-Id: Ib0bb21c437a7d1686e21c33f2d329f2ac425b7ab Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/438936 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
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";
}