| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #ifndef Animation_h | 31 #ifndef Animation_h |
| 32 #define Animation_h | 32 #define Animation_h |
| 33 | 33 |
| 34 #include <memory> | 34 #include <memory> |
| 35 #include "bindings/core/v8/ExceptionState.h" | 35 #include "bindings/core/v8/ExceptionState.h" |
| 36 #include "bindings/core/v8/ScriptPromise.h" | 36 #include "bindings/core/v8/ScriptPromise.h" |
| 37 #include "bindings/core/v8/ScriptPromiseProperty.h" | 37 #include "bindings/core/v8/ScriptPromiseProperty.h" |
| 38 #include "core/CSSPropertyNames.h" | 38 #include "core/CSSPropertyNames.h" |
| 39 #include "core/CoreExport.h" | 39 #include "core/CoreExport.h" |
| 40 #include "core/animation/AnimationEffectReadOnly.h" | 40 #include "core/animation/AnimationEffectReadOnly.h" |
| 41 #include "core/animation/AnimationTimeline.h" | |
| 42 #include "core/animation/CompositorAnimations.h" | 41 #include "core/animation/CompositorAnimations.h" |
| 42 #include "core/animation/DocumentTimeline.h" |
| 43 #include "core/dom/ContextLifecycleObserver.h" | 43 #include "core/dom/ContextLifecycleObserver.h" |
| 44 #include "core/dom/DOMException.h" | 44 #include "core/dom/DOMException.h" |
| 45 #include "core/events/EventTarget.h" | 45 #include "core/events/EventTarget.h" |
| 46 #include "platform/animation/CompositorAnimationDelegate.h" | 46 #include "platform/animation/CompositorAnimationDelegate.h" |
| 47 #include "platform/animation/CompositorAnimationPlayerClient.h" | 47 #include "platform/animation/CompositorAnimationPlayerClient.h" |
| 48 #include "platform/bindings/ActiveScriptWrappable.h" | 48 #include "platform/bindings/ActiveScriptWrappable.h" |
| 49 #include "platform/graphics/CompositorElementId.h" | 49 #include "platform/graphics/CompositorElementId.h" |
| 50 #include "platform/heap/Handle.h" | 50 #include "platform/heap/Handle.h" |
| 51 #include "platform/wtf/RefPtr.h" | 51 #include "platform/wtf/RefPtr.h" |
| 52 | 52 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 const AtomicString& InterfaceName() const override; | 135 const AtomicString& InterfaceName() const override; |
| 136 ExecutionContext* GetExecutionContext() const override; | 136 ExecutionContext* GetExecutionContext() const override; |
| 137 bool HasPendingActivity() const final; | 137 bool HasPendingActivity() const final; |
| 138 void ContextDestroyed(ExecutionContext*) override; | 138 void ContextDestroyed(ExecutionContext*) override; |
| 139 | 139 |
| 140 double playbackRate() const; | 140 double playbackRate() const; |
| 141 void setPlaybackRate(double); | 141 void setPlaybackRate(double); |
| 142 SuperAnimationTimeline* timeline() { | 142 SuperAnimationTimeline* timeline() { |
| 143 return static_cast<SuperAnimationTimeline*>(timeline_); | 143 return static_cast<SuperAnimationTimeline*>(timeline_); |
| 144 } | 144 } |
| 145 const AnimationTimeline* TimelineInternal() const { return timeline_; } | 145 const DocumentTimeline* TimelineInternal() const { return timeline_; } |
| 146 AnimationTimeline* TimelineInternal() { return timeline_; } | 146 DocumentTimeline* TimelineInternal() { return timeline_; } |
| 147 | 147 |
| 148 double CalculateStartTime(double current_time) const; | 148 double CalculateStartTime(double current_time) const; |
| 149 bool HasStartTime() const { return !IsNull(start_time_); } | 149 bool HasStartTime() const { return !IsNull(start_time_); } |
| 150 double startTime(bool& is_null) const; | 150 double startTime(bool& is_null) const; |
| 151 double startTime() const; | 151 double startTime() const; |
| 152 double StartTimeInternal() const { return start_time_; } | 152 double StartTimeInternal() const { return start_time_; } |
| 153 void setStartTime(double, bool is_null); | 153 void setStartTime(double, bool is_null); |
| 154 void SetStartTimeInternal(double); | 154 void SetStartTimeInternal(double); |
| 155 | 155 |
| 156 const AnimationEffectReadOnly* effect() const { return content_.Get(); } | 156 const AnimationEffectReadOnly* effect() const { return content_.Get(); } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 void InvalidateKeyframeEffect(const TreeScope&); | 210 void InvalidateKeyframeEffect(const TreeScope&); |
| 211 | 211 |
| 212 DECLARE_VIRTUAL_TRACE(); | 212 DECLARE_VIRTUAL_TRACE(); |
| 213 | 213 |
| 214 protected: | 214 protected: |
| 215 DispatchEventResult DispatchEventInternal(Event*) override; | 215 DispatchEventResult DispatchEventInternal(Event*) override; |
| 216 void AddedEventListener(const AtomicString& event_type, | 216 void AddedEventListener(const AtomicString& event_type, |
| 217 RegisteredEventListener&) override; | 217 RegisteredEventListener&) override; |
| 218 | 218 |
| 219 private: | 219 private: |
| 220 Animation(ExecutionContext*, AnimationTimeline&, AnimationEffectReadOnly*); | 220 Animation(ExecutionContext*, DocumentTimeline&, AnimationEffectReadOnly*); |
| 221 | 221 |
| 222 void ClearOutdated(); | 222 void ClearOutdated(); |
| 223 void ForceServiceOnNextFrame(); | 223 void ForceServiceOnNextFrame(); |
| 224 | 224 |
| 225 double EffectEnd() const; | 225 double EffectEnd() const; |
| 226 bool Limited(double current_time) const; | 226 bool Limited(double current_time) const; |
| 227 | 227 |
| 228 AnimationPlayState CalculatePlayState(); | 228 AnimationPlayState CalculatePlayState(); |
| 229 double CalculateCurrentTime() const; | 229 double CalculateCurrentTime() const; |
| 230 | 230 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 261 double playback_rate_; | 261 double playback_rate_; |
| 262 double start_time_; | 262 double start_time_; |
| 263 double hold_time_; | 263 double hold_time_; |
| 264 | 264 |
| 265 unsigned sequence_number_; | 265 unsigned sequence_number_; |
| 266 | 266 |
| 267 Member<AnimationPromise> finished_promise_; | 267 Member<AnimationPromise> finished_promise_; |
| 268 Member<AnimationPromise> ready_promise_; | 268 Member<AnimationPromise> ready_promise_; |
| 269 | 269 |
| 270 Member<AnimationEffectReadOnly> content_; | 270 Member<AnimationEffectReadOnly> content_; |
| 271 Member<AnimationTimeline> timeline_; | 271 Member<DocumentTimeline> timeline_; |
| 272 | 272 |
| 273 // Reflects all pausing, including via pauseForTesting(). | 273 // Reflects all pausing, including via pauseForTesting(). |
| 274 bool paused_; | 274 bool paused_; |
| 275 bool held_; | 275 bool held_; |
| 276 bool is_paused_for_testing_; | 276 bool is_paused_for_testing_; |
| 277 bool is_composited_animation_disabled_for_testing_; | 277 bool is_composited_animation_disabled_for_testing_; |
| 278 | 278 |
| 279 // This indicates timing information relevant to the animation's effect | 279 // This indicates timing information relevant to the animation's effect |
| 280 // has changed by means other than the ordinary progression of time | 280 // has changed by means other than the ordinary progression of time |
| 281 bool outdated_; | 281 bool outdated_; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 bool effect_suppressed_; | 371 bool effect_suppressed_; |
| 372 | 372 |
| 373 FRIEND_TEST_ALL_PREFIXES(AnimationAnimationTest, | 373 FRIEND_TEST_ALL_PREFIXES(AnimationAnimationTest, |
| 374 NoCompositeWithoutCompositedElementId); | 374 NoCompositeWithoutCompositedElementId); |
| 375 }; | 375 }; |
| 376 | 376 |
| 377 } // namespace blink | 377 } // namespace blink |
| 378 | 378 |
| 379 #endif // Animation_h | 379 #endif // Animation_h |
| OLD | NEW |