| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 ConstantStyleInterpolation_h | 5 #ifndef ConstantStyleInterpolation_h |
| 6 #define ConstantStyleInterpolation_h | 6 #define ConstantStyleInterpolation_h |
| 7 | 7 |
| 8 #include "core/animation/StyleInterpolation.h" | 8 #include "core/animation/StyleInterpolation.h" |
| 9 #include "core/css/resolver/StyleBuilder.h" | 9 #include "core/css/resolver/StyleBuilder.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class ConstantStyleInterpolation : public StyleInterpolation { | 13 class ConstantStyleInterpolation : public StyleInterpolation { |
| 14 public: | 14 public: |
| 15 static PassRefPtrWillBeRawPtr<ConstantStyleInterpolation> create(CSSValue* v
alue, CSSPropertyID id) | 15 static PassRefPtrWillBeRawPtr<ConstantStyleInterpolation> create(CSSValue va
lue, CSSPropertyID id) |
| 16 { | 16 { |
| 17 return adoptRefWillBeNoop(new ConstantStyleInterpolation(value, id)); | 17 return adoptRefWillBeNoop(new ConstantStyleInterpolation(value, id)); |
| 18 } | 18 } |
| 19 | 19 |
| 20 virtual void apply(StyleResolverState& state) const override | 20 virtual void apply(StyleResolverState& state) const override |
| 21 { | 21 { |
| 22 StyleBuilder::applyProperty(m_id, state, m_value.get()); | 22 StyleBuilder::applyProperty(m_id, state, m_value); |
| 23 } | 23 } |
| 24 | 24 |
| 25 DEFINE_INLINE_VIRTUAL_TRACE() | 25 DEFINE_INLINE_VIRTUAL_TRACE() |
| 26 { | 26 { |
| 27 StyleInterpolation::trace(visitor); | 27 StyleInterpolation::trace(visitor); |
| 28 visitor->trace(m_value); | 28 visitor->trace(m_value); |
| 29 } | 29 } |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 ConstantStyleInterpolation(CSSValue* value, CSSPropertyID id) | 32 ConstantStyleInterpolation(CSSValue value, CSSPropertyID id) |
| 33 : StyleInterpolation(InterpolableList::create(0), InterpolableList::crea
te(0), id) | 33 : StyleInterpolation(InterpolableList::create(0), InterpolableList::crea
te(0), id) |
| 34 , m_value(value) | 34 , m_value(value) |
| 35 { } | 35 { } |
| 36 | 36 |
| 37 RefPtrWillBeMember<CSSValue> m_value; | 37 CSSValue m_value; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } | 40 } |
| 41 | 41 |
| 42 #endif | 42 #endif |
| OLD | NEW |