OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef KeyframeEffectReadOnly_h | 5 #ifndef KeyframeEffectReadOnly_h |
6 #define KeyframeEffectReadOnly_h | 6 #define KeyframeEffectReadOnly_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/animation/AnimationEffectReadOnly.h" | 9 #include "core/animation/AnimationEffectReadOnly.h" |
10 #include "core/animation/EffectModel.h" | 10 #include "core/animation/EffectModel.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 const KeyframeEffectOptions& timingInput, | 39 const KeyframeEffectOptions& timingInput, |
40 ExceptionState&); | 40 ExceptionState&); |
41 static KeyframeEffectReadOnly* create( | 41 static KeyframeEffectReadOnly* create( |
42 ExecutionContext*, | 42 ExecutionContext*, |
43 Element*, | 43 Element*, |
44 const DictionarySequenceOrDictionary& effectInput, | 44 const DictionarySequenceOrDictionary& effectInput, |
45 ExceptionState&); | 45 ExceptionState&); |
46 | 46 |
47 ~KeyframeEffectReadOnly() override {} | 47 ~KeyframeEffectReadOnly() override {} |
48 | 48 |
| 49 bool isKeyframeEffectReadOnly() const override { return true; } |
| 50 |
49 Priority getPriority() const { return m_priority; } | 51 Priority getPriority() const { return m_priority; } |
50 void downgradeToNormal() { m_priority = DefaultPriority; } | 52 void downgradeToNormal() { m_priority = DefaultPriority; } |
51 | 53 |
52 DECLARE_VIRTUAL_TRACE(); | 54 DECLARE_VIRTUAL_TRACE(); |
53 | 55 |
54 protected: | 56 protected: |
55 KeyframeEffectReadOnly(Element*, | 57 KeyframeEffectReadOnly(Element*, |
56 EffectModel*, | 58 EffectModel*, |
57 const Timing&, | 59 const Timing&, |
58 Priority, | 60 Priority, |
59 EventDelegate*); | 61 EventDelegate*); |
60 | 62 |
61 Member<Element> m_target; | 63 Member<Element> m_target; |
62 Member<EffectModel> m_model; | 64 Member<EffectModel> m_model; |
63 Member<SampledEffect> m_sampledEffect; | 65 Member<SampledEffect> m_sampledEffect; |
64 | 66 |
65 Priority m_priority; | 67 Priority m_priority; |
66 }; | 68 }; |
67 | 69 |
| 70 // TODO(suzyh): Replace calls to toKeyframeEffect with toKeyframeEffectReadOnly |
| 71 // where possible |
| 72 DEFINE_TYPE_CASTS(KeyframeEffectReadOnly, |
| 73 AnimationEffectReadOnly, |
| 74 animationNode, |
| 75 animationNode->isKeyframeEffectReadOnly(), |
| 76 animationNode.isKeyframeEffectReadOnly()); |
| 77 |
68 } // namespace blink | 78 } // namespace blink |
69 | 79 |
70 #endif // KeyframeEffectReadOnly_h | 80 #endif // KeyframeEffectReadOnly_h |
OLD | NEW |