Chromium Code Reviews| 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> | |
|
pdr.
2017/03/16 21:20:04
It took me a little while to page this back in. Ca
wkorman
2017/03/16 21:53:31
Will do.
| |
| 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/compositing/PaintArtifactCompositor.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(const Optional<CompositorElementIdSet>& |
| 153 bool isCandidateForAnimationOnCompositor() const; | 154 compositedAnimationElementIds) const; |
| 154 bool maybeStartAnimationOnCompositor(); | 155 bool isCandidateForAnimationOnCompositor( |
| 156 const Optional<CompositorElementIdSet>& compositedAnimationElementIds) | |
| 157 const; | |
| 158 bool maybeStartAnimationOnCompositor( | |
| 159 const Optional<CompositorElementIdSet>& compositedAnimationElementIds); | |
| 155 void cancelAnimationOnCompositor(); | 160 void cancelAnimationOnCompositor(); |
| 156 void restartAnimationOnCompositor(); | 161 void restartAnimationOnCompositor(); |
| 157 void cancelIncompatibleAnimationsOnCompositor(); | 162 void cancelIncompatibleAnimationsOnCompositor(); |
| 158 bool hasActiveAnimationsOnCompositor(); | 163 bool hasActiveAnimationsOnCompositor(); |
| 159 void setCompositorPending(bool effectChanged = false); | 164 void setCompositorPending(bool effectChanged = false); |
| 160 void notifyCompositorStartTime(double timelineTime); | 165 void notifyCompositorStartTime(double timelineTime); |
| 161 void notifyStartTime(double timelineTime); | 166 void notifyStartTime(double timelineTime); |
| 162 // CompositorAnimationPlayerClient implementation. | 167 // CompositorAnimationPlayerClient implementation. |
| 163 CompositorAnimationPlayer* compositorPlayer() const override { | 168 CompositorAnimationPlayer* compositorPlayer() const override { |
| 164 return m_compositorPlayer ? m_compositorPlayer->player() : nullptr; | 169 return m_compositorPlayer ? m_compositorPlayer->player() : nullptr; |
| 165 } | 170 } |
| 166 | 171 |
| 167 bool affects(const Element&, CSSPropertyID) const; | 172 bool affects(const Element&, CSSPropertyID) const; |
| 168 | 173 |
| 169 // Returns whether we should continue with the commit for this animation or | 174 // Returns whether we should continue with the commit for this animation or |
| 170 // wait until next commit. | 175 // wait until next commit. |
| 171 bool preCommit(int compositorGroup, bool startOnCompositor); | 176 bool preCommit(int compositorGroup, |
| 177 const Optional<CompositorElementIdSet>&, | |
| 178 bool startOnCompositor); | |
| 172 void postCommit(double timelineTime); | 179 void postCommit(double timelineTime); |
| 173 | 180 |
| 174 unsigned sequenceNumber() const { return m_sequenceNumber; } | 181 unsigned sequenceNumber() const { return m_sequenceNumber; } |
| 175 int compositorGroup() const { return m_compositorGroup; } | 182 int compositorGroup() const { return m_compositorGroup; } |
| 176 | 183 |
| 177 static bool hasLowerPriority(const Animation* animation1, | 184 static bool hasLowerPriority(const Animation* animation1, |
| 178 const Animation* animation2) { | 185 const Animation* animation2) { |
| 179 return animation1->sequenceNumber() < animation2->sequenceNumber(); | 186 return animation1->sequenceNumber() < animation2->sequenceNumber(); |
| 180 } | 187 } |
| 181 | 188 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 | 345 |
| 339 bool m_currentTimePending; | 346 bool m_currentTimePending; |
| 340 bool m_stateIsBeingUpdated; | 347 bool m_stateIsBeingUpdated; |
| 341 | 348 |
| 342 bool m_effectSuppressed; | 349 bool m_effectSuppressed; |
| 343 }; | 350 }; |
| 344 | 351 |
| 345 } // namespace blink | 352 } // namespace blink |
| 346 | 353 |
| 347 #endif // Animation_h | 354 #endif // Animation_h |
| OLD | NEW |