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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef Animation_h | 31 #ifndef Animation_h |
32 #define Animation_h | 32 #define Animation_h |
33 | 33 |
| 34 #include <memory> |
34 #include "bindings/core/v8/ActiveScriptWrappable.h" | 35 #include "bindings/core/v8/ActiveScriptWrappable.h" |
35 #include "bindings/core/v8/ExceptionState.h" | 36 #include "bindings/core/v8/ExceptionState.h" |
36 #include "bindings/core/v8/ScriptPromise.h" | 37 #include "bindings/core/v8/ScriptPromise.h" |
37 #include "bindings/core/v8/ScriptPromiseProperty.h" | 38 #include "bindings/core/v8/ScriptPromiseProperty.h" |
38 #include "core/CSSPropertyNames.h" | 39 #include "core/CSSPropertyNames.h" |
39 #include "core/CoreExport.h" | 40 #include "core/CoreExport.h" |
40 #include "core/animation/AnimationEffectReadOnly.h" | 41 #include "core/animation/AnimationEffectReadOnly.h" |
41 #include "core/dom/ContextLifecycleObserver.h" | 42 #include "core/dom/ContextLifecycleObserver.h" |
42 #include "core/dom/DOMException.h" | 43 #include "core/dom/DOMException.h" |
43 #include "core/events/EventTarget.h" | 44 #include "core/events/EventTarget.h" |
44 #include "platform/animation/CompositorAnimationDelegate.h" | 45 #include "platform/animation/CompositorAnimationDelegate.h" |
45 #include "platform/animation/CompositorAnimationPlayerClient.h" | 46 #include "platform/animation/CompositorAnimationPlayerClient.h" |
| 47 #include "platform/graphics/CompositorElementId.h" |
46 #include "platform/heap/Handle.h" | 48 #include "platform/heap/Handle.h" |
47 #include "wtf/RefPtr.h" | 49 #include "wtf/RefPtr.h" |
48 #include <memory> | |
49 | 50 |
50 namespace blink { | 51 namespace blink { |
51 | 52 |
52 class AnimationTimeline; | 53 class AnimationTimeline; |
53 class CompositorAnimationPlayer; | 54 class CompositorAnimationPlayer; |
54 class Element; | 55 class Element; |
55 class ExceptionState; | 56 class ExceptionState; |
56 class TreeScope; | 57 class TreeScope; |
57 | 58 |
58 class CORE_EXPORT Animation final : public EventTargetWithInlineData, | 59 class CORE_EXPORT Animation final : public EventTargetWithInlineData, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // paused() and must never overlap with pausing via pause(). | 143 // paused() and must never overlap with pausing via pause(). |
143 void pauseForTesting(double pauseTime); | 144 void pauseForTesting(double pauseTime); |
144 void disableCompositedAnimationForTesting(); | 145 void disableCompositedAnimationForTesting(); |
145 | 146 |
146 // This should only be used for CSS | 147 // This should only be used for CSS |
147 void unpause(); | 148 void unpause(); |
148 | 149 |
149 void setOutdated(); | 150 void setOutdated(); |
150 bool outdated() { return m_outdated; } | 151 bool outdated() { return m_outdated; } |
151 | 152 |
152 bool canStartAnimationOnCompositor() const; | 153 bool canStartAnimationOnCompositor( |
153 bool isCandidateForAnimationOnCompositor() const; | 154 const Optional<CompositorElementIdSet>& compositedElementIds) const; |
154 bool maybeStartAnimationOnCompositor(); | 155 bool isCandidateForAnimationOnCompositor( |
| 156 const Optional<CompositorElementIdSet>& compositedElementIds) const; |
| 157 bool maybeStartAnimationOnCompositor( |
| 158 const Optional<CompositorElementIdSet>& compositedElementIds); |
155 void cancelAnimationOnCompositor(); | 159 void cancelAnimationOnCompositor(); |
156 void restartAnimationOnCompositor(); | 160 void restartAnimationOnCompositor(); |
157 void cancelIncompatibleAnimationsOnCompositor(); | 161 void cancelIncompatibleAnimationsOnCompositor(); |
158 bool hasActiveAnimationsOnCompositor(); | 162 bool hasActiveAnimationsOnCompositor(); |
159 void setCompositorPending(bool effectChanged = false); | 163 void setCompositorPending(bool effectChanged = false); |
160 void notifyCompositorStartTime(double timelineTime); | 164 void notifyCompositorStartTime(double timelineTime); |
161 void notifyStartTime(double timelineTime); | 165 void notifyStartTime(double timelineTime); |
162 // CompositorAnimationPlayerClient implementation. | 166 // CompositorAnimationPlayerClient implementation. |
163 CompositorAnimationPlayer* compositorPlayer() const override { | 167 CompositorAnimationPlayer* compositorPlayer() const override { |
164 return m_compositorPlayer ? m_compositorPlayer->player() : nullptr; | 168 return m_compositorPlayer ? m_compositorPlayer->player() : nullptr; |
165 } | 169 } |
166 | 170 |
167 bool affects(const Element&, CSSPropertyID) const; | 171 bool affects(const Element&, CSSPropertyID) const; |
168 | 172 |
169 // Returns whether we should continue with the commit for this animation or | 173 // Returns whether we should continue with the commit for this animation or |
170 // wait until next commit. | 174 // wait until next commit. |
171 bool preCommit(int compositorGroup, bool startOnCompositor); | 175 bool preCommit(int compositorGroup, |
| 176 const Optional<CompositorElementIdSet>&, |
| 177 bool startOnCompositor); |
172 void postCommit(double timelineTime); | 178 void postCommit(double timelineTime); |
173 | 179 |
174 unsigned sequenceNumber() const { return m_sequenceNumber; } | 180 unsigned sequenceNumber() const { return m_sequenceNumber; } |
175 int compositorGroup() const { return m_compositorGroup; } | 181 int compositorGroup() const { return m_compositorGroup; } |
176 | 182 |
177 static bool hasLowerPriority(const Animation* animation1, | 183 static bool hasLowerPriority(const Animation* animation1, |
178 const Animation* animation2) { | 184 const Animation* animation2) { |
179 return animation1->sequenceNumber() < animation2->sequenceNumber(); | 185 return animation1->sequenceNumber() < animation2->sequenceNumber(); |
180 } | 186 } |
181 | 187 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 344 |
339 bool m_currentTimePending; | 345 bool m_currentTimePending; |
340 bool m_stateIsBeingUpdated; | 346 bool m_stateIsBeingUpdated; |
341 | 347 |
342 bool m_effectSuppressed; | 348 bool m_effectSuppressed; |
343 }; | 349 }; |
344 | 350 |
345 } // namespace blink | 351 } // namespace blink |
346 | 352 |
347 #endif // Animation_h | 353 #endif // Animation_h |
OLD | NEW |