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 ImageStyleInterpolation_h | 5 #ifndef ImageStyleInterpolation_h |
6 #define ImageStyleInterpolation_h | 6 #define ImageStyleInterpolation_h |
7 | 7 |
8 #include "core/animation/StyleInterpolation.h" | 8 #include "core/animation/StyleInterpolation.h" |
9 #include "core/css/CSSCrossfadeValue.h" | 9 #include "core/css/CSSCrossfadeValue.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 class ImageStyleInterpolation : public StyleInterpolation { | 12 class ImageStyleInterpolation : public StyleInterpolation { |
13 public: | 13 public: |
14 static PassRefPtrWillBeRawPtr<ImageStyleInterpolation> create(CSSValue& star
t, CSSValue& end, CSSPropertyID id) | 14 static PassRefPtr<ImageStyleInterpolation> create(CSSValue& start, CSSValue&
end, CSSPropertyID id) |
15 { | 15 { |
16 return adoptRefWillBeNoop(new ImageStyleInterpolation(&start, &end, id))
; | 16 return adoptRef(new ImageStyleInterpolation(&start, &end, id)); |
17 } | 17 } |
18 | 18 |
19 DECLARE_VIRTUAL_TRACE(); | |
20 | |
21 static bool canCreateFrom(const CSSValue&); | 19 static bool canCreateFrom(const CSSValue&); |
22 void apply(StyleResolverState&) const override; | 20 void apply(StyleResolverState&) const override; |
23 | 21 |
24 private: | 22 private: |
25 ImageStyleInterpolation(PassRefPtrWillBeRawPtr<CSSValue> start, PassRefPtrWi
llBeRawPtr<CSSValue> end, CSSPropertyID id) | 23 ImageStyleInterpolation(PassRefPtrWillBeRawPtr<CSSValue> start, PassRefPtrWi
llBeRawPtr<CSSValue> end, CSSPropertyID id) |
26 : StyleInterpolation(InterpolableNumber::create(0.0), InterpolableNumber
::create(1.0), id) | 24 : StyleInterpolation(InterpolableNumber::create(0.0), InterpolableNumber
::create(1.0), id) |
27 , m_initialImage(start) | 25 , m_initialImage(start) |
28 , m_finalImage(end) | 26 , m_finalImage(end) |
29 { | 27 { |
30 } | 28 } |
31 | 29 |
32 RefPtrWillBeMember<CSSValue> m_initialImage; | 30 RefPtrWillBePersistent<CSSValue> m_initialImage; |
33 RefPtrWillBeMember<CSSValue> m_finalImage; | 31 RefPtrWillBePersistent<CSSValue> m_finalImage; |
34 }; | 32 }; |
35 } | 33 } |
36 | 34 |
37 #endif // ImageStyleInterpolation_h | 35 #endif // ImageStyleInterpolation_h |
OLD | NEW |