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 #include "core/animation/CSSImageInterpolationType.h" | 5 #include "core/animation/CSSImageInterpolationType.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/animation/ImagePropertyFunctions.h" | 8 #include "core/animation/ImagePropertyFunctions.h" |
9 #include "core/css/CSSCrossfadeValue.h" | 9 #include "core/css/CSSCrossfadeValue.h" |
10 #include "core/css/CSSPrimitiveValue.h" | 10 #include "core/css/CSSPrimitiveValue.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 static PassRefPtr<CSSImageNonInterpolableValue> merge( | 31 static PassRefPtr<CSSImageNonInterpolableValue> merge( |
32 PassRefPtr<NonInterpolableValue> start, | 32 PassRefPtr<NonInterpolableValue> start, |
33 PassRefPtr<NonInterpolableValue> end); | 33 PassRefPtr<NonInterpolableValue> end); |
34 | 34 |
35 CSSValue* crossfade(double progress) const { | 35 CSSValue* crossfade(double progress) const { |
36 if (m_isSingle || progress <= 0) | 36 if (m_isSingle || progress <= 0) |
37 return m_start; | 37 return m_start; |
38 if (progress >= 1) | 38 if (progress >= 1) |
39 return m_end; | 39 return m_end; |
40 return CSSCrossfadeValue::create( | 40 return CSSCrossfadeValue::create( |
41 m_start, m_end, CSSPrimitiveValue::create( | 41 m_start, m_end, |
42 progress, CSSPrimitiveValue::UnitType::Number)); | 42 CSSPrimitiveValue::create(progress, |
| 43 CSSPrimitiveValue::UnitType::Number)); |
43 } | 44 } |
44 | 45 |
45 DECLARE_NON_INTERPOLABLE_VALUE_TYPE(); | 46 DECLARE_NON_INTERPOLABLE_VALUE_TYPE(); |
46 | 47 |
47 private: | 48 private: |
48 CSSImageNonInterpolableValue(CSSValue* start, CSSValue* end) | 49 CSSImageNonInterpolableValue(CSSValue* start, CSSValue* end) |
49 : m_start(start), m_end(end), m_isSingle(m_start == m_end) { | 50 : m_start(start), m_end(end), m_isSingle(m_start == m_end) { |
50 DCHECK(m_start); | 51 DCHECK(m_start); |
51 DCHECK(m_end); | 52 DCHECK(m_end); |
52 } | 53 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 const InterpolableValue& interpolableValue, | 239 const InterpolableValue& interpolableValue, |
239 const NonInterpolableValue* nonInterpolableValue, | 240 const NonInterpolableValue* nonInterpolableValue, |
240 StyleResolverState& state) const { | 241 StyleResolverState& state) const { |
241 ImagePropertyFunctions::setStyleImage( | 242 ImagePropertyFunctions::setStyleImage( |
242 cssProperty(), *state.style(), | 243 cssProperty(), *state.style(), |
243 resolveStyleImage(cssProperty(), interpolableValue, nonInterpolableValue, | 244 resolveStyleImage(cssProperty(), interpolableValue, nonInterpolableValue, |
244 state)); | 245 state)); |
245 } | 246 } |
246 | 247 |
247 } // namespace blink | 248 } // namespace blink |
OLD | NEW |