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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "bindings/core/v8/Dictionary.h" | 33 #include "bindings/core/v8/Dictionary.h" |
34 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
35 #include "core/animation/Animation.h" | 35 #include "core/animation/Animation.h" |
36 #include "core/animation/AnimationTimeline.h" | 36 #include "core/animation/AnimationTimeline.h" |
37 #include "core/animation/CompositorAnimations.h" | 37 #include "core/animation/CompositorAnimations.h" |
38 #include "core/animation/ElementAnimations.h" | 38 #include "core/animation/ElementAnimations.h" |
39 #include "core/animation/Interpolation.h" | 39 #include "core/animation/Interpolation.h" |
40 #include "core/animation/KeyframeEffectModel.h" | 40 #include "core/animation/KeyframeEffectModel.h" |
41 #include "core/animation/KeyframeEffectOptions.h" | 41 #include "core/animation/KeyframeEffectOptions.h" |
| 42 #include "core/animation/KeyframeEffectReadOnly.h" |
42 #include "core/animation/PropertyHandle.h" | 43 #include "core/animation/PropertyHandle.h" |
43 #include "core/dom/Element.h" | 44 #include "core/dom/Element.h" |
44 #include "core/dom/NodeComputedStyle.h" | 45 #include "core/dom/NodeComputedStyle.h" |
45 #include "core/frame/UseCounter.h" | 46 #include "core/frame/UseCounter.h" |
46 #include "core/paint/PaintLayer.h" | 47 #include "core/paint/PaintLayer.h" |
47 #include "core/svg/SVGElement.h" | 48 #include "core/svg/SVGElement.h" |
48 | 49 |
49 namespace blink { | 50 namespace blink { |
50 | 51 |
51 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons
t Timing& timing, Priority priority, EventDelegate* eventDelegate) | 52 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons
t Timing& timing, KeyframeEffect::Priority priority, EventDelegate* eventDelegat
e) |
52 { | 53 { |
53 return new KeyframeEffect(target, model, timing, priority, eventDelegate); | 54 return new KeyframeEffect(target, model, timing, priority, eventDelegate); |
54 } | 55 } |
55 | 56 |
56 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, double duration,
ExceptionState& exceptionState) | 57 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, double duration,
ExceptionState& exceptionState) |
57 { | 58 { |
58 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 59 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
59 if (element) | 60 if (element) |
60 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); | 61 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); |
61 Timing timing; | 62 Timing timing; |
(...skipping 15 matching lines...) Expand all Loading... |
77 } | 78 } |
78 | 79 |
79 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, ExceptionState&
exceptionState) | 80 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, ExceptionState&
exceptionState) |
80 { | 81 { |
81 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 82 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
82 if (element) | 83 if (element) |
83 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); | 84 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); |
84 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), Timing()); | 85 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), Timing()); |
85 } | 86 } |
86 | 87 |
87 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing
& timing, Priority priority, EventDelegate* eventDelegate) | 88 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing
& timing, KeyframeEffect::Priority priority, EventDelegate* eventDelegate) |
88 : AnimationEffectReadOnly(timing, eventDelegate) | 89 : KeyframeEffectReadOnly(target, model, timing, eventDelegate) |
89 , m_target(target) | |
90 , m_model(model) | |
91 , m_sampledEffect(nullptr) | |
92 , m_priority(priority) | 90 , m_priority(priority) |
93 { | 91 { |
94 } | 92 } |
95 | 93 |
96 KeyframeEffect::~KeyframeEffect() | 94 KeyframeEffect::~KeyframeEffect() |
97 { | 95 { |
98 } | 96 } |
99 | 97 |
100 void KeyframeEffect::attach(Animation* animation) | 98 void KeyframeEffect::attach(Animation* animation) |
101 { | 99 { |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 354 |
357 void KeyframeEffect::attachCompositedLayers() | 355 void KeyframeEffect::attachCompositedLayers() |
358 { | 356 { |
359 DCHECK(m_target); | 357 DCHECK(m_target); |
360 DCHECK(animation()); | 358 DCHECK(animation()); |
361 CompositorAnimations::attachCompositedLayers(*m_target, *animation()); | 359 CompositorAnimations::attachCompositedLayers(*m_target, *animation()); |
362 } | 360 } |
363 | 361 |
364 DEFINE_TRACE(KeyframeEffect) | 362 DEFINE_TRACE(KeyframeEffect) |
365 { | 363 { |
366 visitor->trace(m_target); | 364 KeyframeEffectReadOnly::trace(visitor); |
367 visitor->trace(m_model); | |
368 visitor->trace(m_sampledEffect); | |
369 AnimationEffectReadOnly::trace(visitor); | |
370 } | 365 } |
371 | 366 |
372 } // namespace blink | 367 } // namespace blink |
OLD | NEW |