| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 AnimatableValueKeyframe_h | 5 #ifndef AnimatableValueKeyframe_h |
| 6 #define AnimatableValueKeyframe_h | 6 #define AnimatableValueKeyframe_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/animation/Keyframe.h" | 9 #include "core/animation/Keyframe.h" |
| 10 #include "core/animation/animatable/AnimatableValue.h" | 10 #include "core/animation/animatable/AnimatableValue.h" |
| 11 #include "core/css/CSSPropertyIDTemplates.h" | 11 #include "core/css/CSSPropertyIDTemplates.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class CORE_EXPORT AnimatableValueKeyframe : public Keyframe { | 15 class CORE_EXPORT AnimatableValueKeyframe : public Keyframe { |
| 16 public: | 16 public: |
| 17 static PassRefPtr<AnimatableValueKeyframe> create() { | 17 static PassRefPtr<AnimatableValueKeyframe> create() { |
| 18 return adoptRef(new AnimatableValueKeyframe); | 18 return adoptRef(new AnimatableValueKeyframe); |
| 19 } | 19 } |
| 20 void setPropertyValue(CSSPropertyID property, | 20 void setPropertyValue(CSSPropertyID property, |
| 21 PassRefPtr<AnimatableValue> value) { | 21 PassRefPtr<AnimatableValue> value) { |
| 22 m_propertyValues.set(property, std::move(value)); | 22 m_propertyValues.set(property, std::move(value)); |
| 23 } | 23 } |
| 24 void clearPropertyValue(CSSPropertyID property) { | 24 void clearPropertyValue(CSSPropertyID property) { |
| 25 m_propertyValues.remove(property); | 25 m_propertyValues.erase(property); |
| 26 } | 26 } |
| 27 AnimatableValue* propertyValue(CSSPropertyID property) const { | 27 AnimatableValue* propertyValue(CSSPropertyID property) const { |
| 28 DCHECK(m_propertyValues.contains(property)); | 28 DCHECK(m_propertyValues.contains(property)); |
| 29 return m_propertyValues.get(property); | 29 return m_propertyValues.get(property); |
| 30 } | 30 } |
| 31 PropertyHandleSet properties() const override; | 31 PropertyHandleSet properties() const override; |
| 32 | 32 |
| 33 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { | 33 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { |
| 34 public: | 34 public: |
| 35 static PassRefPtr<PropertySpecificKeyframe> create( | 35 static PassRefPtr<PropertySpecificKeyframe> create( |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 value.isAnimatableValueKeyframe()); | 98 value.isAnimatableValueKeyframe()); |
| 99 DEFINE_TYPE_CASTS(AnimatableValuePropertySpecificKeyframe, | 99 DEFINE_TYPE_CASTS(AnimatableValuePropertySpecificKeyframe, |
| 100 Keyframe::PropertySpecificKeyframe, | 100 Keyframe::PropertySpecificKeyframe, |
| 101 value, | 101 value, |
| 102 value->isAnimatableValuePropertySpecificKeyframe(), | 102 value->isAnimatableValuePropertySpecificKeyframe(), |
| 103 value.isAnimatableValuePropertySpecificKeyframe()); | 103 value.isAnimatableValuePropertySpecificKeyframe()); |
| 104 | 104 |
| 105 } // namespace blink | 105 } // namespace blink |
| 106 | 106 |
| 107 #endif | 107 #endif |
| OLD | NEW |