summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/animation/css/css_animation_update.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/animation/css/css_animation_update.h')
-rw-r--r--chromium/third_party/blink/renderer/core/animation/css/css_animation_update.h90
1 files changed, 34 insertions, 56 deletions
diff --git a/chromium/third_party/blink/renderer/core/animation/css/css_animation_update.h b/chromium/third_party/blink/renderer/core/animation/css/css_animation_update.h
index d2143017e86..024f65b5583 100644
--- a/chromium/third_party/blink/renderer/core/animation/css/css_animation_update.h
+++ b/chromium/third_party/blink/renderer/core/animation/css/css_animation_update.h
@@ -5,7 +5,6 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_CSS_CSS_ANIMATION_UPDATE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_CSS_CSS_ANIMATION_UPDATE_H_
-#include "base/macros.h"
#include "third_party/blink/renderer/core/animation/animation_timeline.h"
#include "third_party/blink/renderer/core/animation/effect_stack.h"
#include "third_party/blink/renderer/core/animation/inert_effect.h"
@@ -29,7 +28,7 @@ class NewCSSAnimation {
public:
NewCSSAnimation(AtomicString name,
size_t name_index,
- size_t position_index,
+ wtf_size_t position_index,
const InertEffect& effect,
Timing timing,
StyleRuleKeyframes* style_rule,
@@ -53,7 +52,7 @@ class NewCSSAnimation {
AtomicString name;
size_t name_index;
- size_t position_index;
+ wtf_size_t position_index;
Member<const InertEffect> effect;
Timing timing;
Member<StyleRuleKeyframes> style_rule;
@@ -114,6 +113,8 @@ class CORE_EXPORT CSSAnimationUpdate final {
public:
CSSAnimationUpdate();
+ CSSAnimationUpdate(const CSSAnimationUpdate&) = delete;
+ CSSAnimationUpdate& operator=(const CSSAnimationUpdate&) = delete;
~CSSAnimationUpdate();
void Copy(const CSSAnimationUpdate&);
@@ -210,58 +211,35 @@ class CORE_EXPORT CSSAnimationUpdate final {
return finished_transitions_;
}
- void AdoptActiveInterpolationsForCustomAnimations(
+ void AdoptActiveInterpolationsForAnimations(
ActiveInterpolationsMap& new_map) {
- new_map.swap(active_interpolations_for_custom_animations_);
+ new_map.swap(active_interpolations_for_animations_);
}
- void AdoptActiveInterpolationsForStandardAnimations(
+ void AdoptActiveInterpolationsForTransitions(
ActiveInterpolationsMap& new_map) {
- new_map.swap(active_interpolations_for_standard_animations_);
+ new_map.swap(active_interpolations_for_transitions_);
}
- void AdoptActiveInterpolationsForCustomTransitions(
- ActiveInterpolationsMap& new_map) {
- new_map.swap(active_interpolations_for_custom_transitions_);
- }
- void AdoptActiveInterpolationsForStandardTransitions(
- ActiveInterpolationsMap& new_map) {
- new_map.swap(active_interpolations_for_standard_transitions_);
- }
- const ActiveInterpolationsMap& ActiveInterpolationsForCustomAnimations()
- const {
- return active_interpolations_for_custom_animations_;
- }
- ActiveInterpolationsMap& ActiveInterpolationsForCustomAnimations() {
- return active_interpolations_for_custom_animations_;
+ const ActiveInterpolationsMap& ActiveInterpolationsForAnimations() const {
+ return active_interpolations_for_animations_;
}
- const ActiveInterpolationsMap& ActiveInterpolationsForStandardAnimations()
- const {
- return active_interpolations_for_standard_animations_;
+ ActiveInterpolationsMap& ActiveInterpolationsForAnimations() {
+ return active_interpolations_for_animations_;
}
- ActiveInterpolationsMap& ActiveInterpolationsForStandardAnimations() {
- return active_interpolations_for_standard_animations_;
- }
- const ActiveInterpolationsMap& ActiveInterpolationsForCustomTransitions()
- const {
- return active_interpolations_for_custom_transitions_;
- }
- const ActiveInterpolationsMap& ActiveInterpolationsForStandardTransitions()
- const {
- return active_interpolations_for_standard_transitions_;
+ const ActiveInterpolationsMap& ActiveInterpolationsForTransitions() const {
+ return active_interpolations_for_transitions_;
}
- bool IsEmpty() const {
- return new_animations_.IsEmpty() &&
- cancelled_animation_indices_.IsEmpty() &&
- suppressed_animations_.IsEmpty() &&
- animation_indices_with_pause_toggled_.IsEmpty() &&
- animations_with_updates_.IsEmpty() && new_transitions_.IsEmpty() &&
- cancelled_transitions_.IsEmpty() &&
- finished_transitions_.IsEmpty() &&
- active_interpolations_for_custom_animations_.IsEmpty() &&
- active_interpolations_for_standard_animations_.IsEmpty() &&
- active_interpolations_for_custom_transitions_.IsEmpty() &&
- active_interpolations_for_standard_transitions_.IsEmpty() &&
- updated_compositor_keyframes_.IsEmpty();
+ bool IsEmpty() const { return !HasUpdates() && !HasActiveInterpolations(); }
+
+ bool HasUpdates() const {
+ return !new_animations_.IsEmpty() ||
+ !cancelled_animation_indices_.IsEmpty() ||
+ !suppressed_animations_.IsEmpty() ||
+ !animation_indices_with_pause_toggled_.IsEmpty() ||
+ !animations_with_updates_.IsEmpty() || !new_transitions_.IsEmpty() ||
+ !cancelled_transitions_.IsEmpty() ||
+ !finished_transitions_.IsEmpty() ||
+ !updated_compositor_keyframes_.IsEmpty();
}
void Trace(Visitor* visitor) const {
@@ -270,13 +248,16 @@ class CORE_EXPORT CSSAnimationUpdate final {
visitor->Trace(suppressed_animations_);
visitor->Trace(animations_with_updates_);
visitor->Trace(updated_compositor_keyframes_);
- visitor->Trace(active_interpolations_for_custom_animations_);
- visitor->Trace(active_interpolations_for_standard_animations_);
- visitor->Trace(active_interpolations_for_custom_transitions_);
- visitor->Trace(active_interpolations_for_standard_transitions_);
+ visitor->Trace(active_interpolations_for_animations_);
+ visitor->Trace(active_interpolations_for_transitions_);
}
private:
+ bool HasActiveInterpolations() const {
+ return !active_interpolations_for_animations_.IsEmpty() ||
+ !active_interpolations_for_transitions_.IsEmpty();
+ }
+
// Order is significant since it defines the order in which new animations
// will be started. Note that there may be multiple animations present
// with the same name, due to the way in which we split up animations with
@@ -292,13 +273,10 @@ class CORE_EXPORT CSSAnimationUpdate final {
HashSet<PropertyHandle> cancelled_transitions_;
HashSet<PropertyHandle> finished_transitions_;
- ActiveInterpolationsMap active_interpolations_for_custom_animations_;
- ActiveInterpolationsMap active_interpolations_for_standard_animations_;
- ActiveInterpolationsMap active_interpolations_for_custom_transitions_;
- ActiveInterpolationsMap active_interpolations_for_standard_transitions_;
+ ActiveInterpolationsMap active_interpolations_for_animations_;
+ ActiveInterpolationsMap active_interpolations_for_transitions_;
friend class PendingAnimationUpdate;
- DISALLOW_COPY_AND_ASSIGN(CSSAnimationUpdate);
};
} // namespace blink