summaryrefslogtreecommitdiffstats
path: root/chromium/cc/animation/animation_events.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-11 11:32:04 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-18 13:40:17 +0000
commit31ccca0778db85c159634478b4ec7997f6704860 (patch)
tree3d33fc3afd9d5ec95541e1bbe074a9cf8da12a0e /chromium/cc/animation/animation_events.cc
parent248b70b82a40964d5594eb04feca0fa36716185d (diff)
BASELINE: Update Chromium to 80.0.3987.136
Change-Id: I98e1649aafae85ba3a83e67af00bb27ef301db7b Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'chromium/cc/animation/animation_events.cc')
-rw-r--r--chromium/cc/animation/animation_events.cc37
1 files changed, 32 insertions, 5 deletions
diff --git a/chromium/cc/animation/animation_events.cc b/chromium/cc/animation/animation_events.cc
index 4d9387aa43e..1382569b09f 100644
--- a/chromium/cc/animation/animation_events.cc
+++ b/chromium/cc/animation/animation_events.cc
@@ -7,20 +7,36 @@
namespace cc {
AnimationEvent::AnimationEvent(AnimationEvent::Type type,
- ElementId element_id,
+ UniqueKeyframeModelId uid,
int group_id,
int target_property,
base::TimeTicks monotonic_time)
: type(type),
- element_id(element_id),
+ uid(uid),
group_id(group_id),
target_property(target_property),
monotonic_time(monotonic_time),
- is_impl_only(false) {}
+ is_impl_only(false),
+ local_time() {}
+
+AnimationEvent::AnimationEvent(int timeline_id,
+ int animation_id,
+ base::Optional<base::TimeDelta> local_time)
+ : type(TIME_UPDATED),
+ // Initializing model_id with an invalid value (0).
+ // Also initializing keyframe_id with 0 which in its case is a valid
+ // value. However this is safe since keyframe_id and model_id are not used
+ // when routing a TIME_UPDATED event.
+ uid({timeline_id, animation_id, 0, 0}),
+ group_id(),
+ target_property(),
+ monotonic_time(),
+ is_impl_only(false),
+ local_time(local_time) {}
AnimationEvent::AnimationEvent(const AnimationEvent& other) {
type = other.type;
- element_id = other.element_id;
+ uid = other.uid;
group_id = other.group_id;
target_property = other.target_property;
monotonic_time = other.monotonic_time;
@@ -28,11 +44,12 @@ AnimationEvent::AnimationEvent(const AnimationEvent& other) {
animation_start_time = other.animation_start_time;
if (other.curve)
curve = other.curve->Clone();
+ local_time = other.local_time;
}
AnimationEvent& AnimationEvent::operator=(const AnimationEvent& other) {
type = other.type;
- element_id = other.element_id;
+ uid = other.uid;
group_id = other.group_id;
target_property = other.target_property;
monotonic_time = other.monotonic_time;
@@ -40,6 +57,7 @@ AnimationEvent& AnimationEvent::operator=(const AnimationEvent& other) {
animation_start_time = other.animation_start_time;
if (other.curve)
curve = other.curve->Clone();
+ local_time = other.local_time;
return *this;
}
@@ -53,4 +71,13 @@ bool AnimationEvents::IsEmpty() const {
return events_.empty();
}
+bool AnimationEvent::ShouldDispatchToKeyframeEffectAndModel() const {
+ // TIME_UPDATED events are used to synchronize effect time between cc and
+ // main thread worklet animations. Keyframe models are not involved in
+ // this process.
+ // is_impl_only events are not dispatched because they don't have
+ // corresponding main thread components.
+ return type != TIME_UPDATED && !is_impl_only;
+}
+
} // namespace cc