| 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 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 #include "core/animation/Animation.h" | 31 #include "core/animation/Animation.h" |
| 32 | 32 |
| 33 #include "core/animation/AnimationTimeline.h" |
| 33 #include "core/animation/CompositorPendingAnimations.h" | 34 #include "core/animation/CompositorPendingAnimations.h" |
| 34 #include "core/animation/DocumentTimeline.h" | 35 #include "core/animation/DocumentTimeline.h" |
| 35 #include "core/animation/KeyframeEffectReadOnly.h" | 36 #include "core/animation/KeyframeEffectReadOnly.h" |
| 36 #include "core/animation/SuperAnimationTimeline.h" | |
| 37 #include "core/animation/css/CSSAnimations.h" | 37 #include "core/animation/css/CSSAnimations.h" |
| 38 #include "core/dom/DOMNodeIds.h" | 38 #include "core/dom/DOMNodeIds.h" |
| 39 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
| 40 #include "core/dom/ExceptionCode.h" | 40 #include "core/dom/ExceptionCode.h" |
| 41 #include "core/dom/ExecutionContext.h" | 41 #include "core/dom/ExecutionContext.h" |
| 42 #include "core/dom/StyleChangeReason.h" | 42 #include "core/dom/StyleChangeReason.h" |
| 43 #include "core/dom/TaskRunnerHelper.h" | 43 #include "core/dom/TaskRunnerHelper.h" |
| 44 #include "core/events/AnimationPlaybackEvent.h" | 44 #include "core/events/AnimationPlaybackEvent.h" |
| 45 #include "core/frame/UseCounter.h" | 45 #include "core/frame/UseCounter.h" |
| 46 #include "core/inspector/InspectorTraceEvents.h" | 46 #include "core/inspector/InspectorTraceEvents.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 61 | 61 |
| 62 namespace { | 62 namespace { |
| 63 | 63 |
| 64 static unsigned NextSequenceNumber() { | 64 static unsigned NextSequenceNumber() { |
| 65 static unsigned next = 0; | 65 static unsigned next = 0; |
| 66 return ++next; | 66 return ++next; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 Animation* Animation::Create(AnimationEffectReadOnly* effect, | 70 Animation* Animation::Create(AnimationEffectReadOnly* effect, |
| 71 SuperAnimationTimeline* timeline) { | 71 AnimationTimeline* timeline) { |
| 72 if (!timeline || !timeline->IsDocumentTimeline()) { | 72 if (!timeline || !timeline->IsDocumentTimeline()) { |
| 73 // FIXME: Support creating animations without a timeline. | 73 // FIXME: Support creating animations without a timeline. |
| 74 NOTREACHED(); | 74 NOTREACHED(); |
| 75 return nullptr; | 75 return nullptr; |
| 76 } | 76 } |
| 77 | 77 |
| 78 DocumentTimeline* subtimeline = ToDocumentTimeline(timeline); | 78 DocumentTimeline* subtimeline = ToDocumentTimeline(timeline); |
| 79 | 79 |
| 80 Animation* animation = new Animation( | 80 Animation* animation = new Animation( |
| 81 subtimeline->GetDocument()->ContextDocument(), *subtimeline, effect); | 81 subtimeline->GetDocument()->ContextDocument(), *subtimeline, effect); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 92 AnimationEffectReadOnly* effect, | 92 AnimationEffectReadOnly* effect, |
| 93 ExceptionState& exception_state) { | 93 ExceptionState& exception_state) { |
| 94 DCHECK(RuntimeEnabledFeatures::WebAnimationsAPIEnabled()); | 94 DCHECK(RuntimeEnabledFeatures::WebAnimationsAPIEnabled()); |
| 95 | 95 |
| 96 Document* document = ToDocument(execution_context); | 96 Document* document = ToDocument(execution_context); |
| 97 return Create(effect, &document->Timeline()); | 97 return Create(effect, &document->Timeline()); |
| 98 } | 98 } |
| 99 | 99 |
| 100 Animation* Animation::Create(ExecutionContext* execution_context, | 100 Animation* Animation::Create(ExecutionContext* execution_context, |
| 101 AnimationEffectReadOnly* effect, | 101 AnimationEffectReadOnly* effect, |
| 102 SuperAnimationTimeline* timeline, | 102 AnimationTimeline* timeline, |
| 103 ExceptionState& exception_state) { | 103 ExceptionState& exception_state) { |
| 104 DCHECK(RuntimeEnabledFeatures::WebAnimationsAPIEnabled()); | 104 DCHECK(RuntimeEnabledFeatures::WebAnimationsAPIEnabled()); |
| 105 | 105 |
| 106 if (!timeline) { | 106 if (!timeline) { |
| 107 return Create(execution_context, effect, exception_state); | 107 return Create(execution_context, effect, exception_state); |
| 108 } | 108 } |
| 109 | 109 |
| 110 return Create(effect, timeline); | 110 return Create(effect, timeline); |
| 111 } | 111 } |
| 112 | 112 |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 DCHECK(!compositor_player_); | 1286 DCHECK(!compositor_player_); |
| 1287 } | 1287 } |
| 1288 | 1288 |
| 1289 void Animation::CompositorAnimationPlayerHolder::Detach() { | 1289 void Animation::CompositorAnimationPlayerHolder::Detach() { |
| 1290 DCHECK(compositor_player_); | 1290 DCHECK(compositor_player_); |
| 1291 compositor_player_->SetAnimationDelegate(nullptr); | 1291 compositor_player_->SetAnimationDelegate(nullptr); |
| 1292 animation_ = nullptr; | 1292 animation_ = nullptr; |
| 1293 compositor_player_.reset(); | 1293 compositor_player_.reset(); |
| 1294 } | 1294 } |
| 1295 } // namespace blink | 1295 } // namespace blink |
| OLD | NEW |