Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: Source/core/animation/ImageStyleInterpolation.cpp

Issue 803863005: Oilpan: fix build after r188198. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/animation/ImageStyleInterpolation.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "core/animation/ImageStyleInterpolation.h" 6 #include "core/animation/ImageStyleInterpolation.h"
7 7
8 #include "core/css/resolver/StyleBuilder.h" 8 #include "core/css/resolver/StyleBuilder.h"
9 9
10 10
11 namespace blink { 11 namespace blink {
12 12
13 bool ImageStyleInterpolation::canCreateFrom(const CSSValue& value) 13 bool ImageStyleInterpolation::canCreateFrom(const CSSValue& value)
14 { 14 {
15 return value.isImageValue(); 15 return value.isImageValue();
16 } 16 }
17 17
18 void ImageStyleInterpolation::apply(StyleResolverState& state) const 18 void ImageStyleInterpolation::apply(StyleResolverState& state) const
19 { 19 {
20 double cachedValue = toInterpolableNumber(m_cachedValue.get())->value(); 20 double cachedValue = toInterpolableNumber(m_cachedValue.get())->value();
21 if (cachedValue <= 0.0) { 21 if (cachedValue <= 0.0) {
22 StyleBuilder::applyProperty(m_id, state, m_initialImage.get()); 22 StyleBuilder::applyProperty(m_id, state, m_initialImage.get());
23 return; 23 return;
24 } 24 }
25 if (cachedValue >= 1.0) { 25 if (cachedValue >= 1.0) {
26 StyleBuilder::applyProperty(m_id, state, m_finalImage.get()); 26 StyleBuilder::applyProperty(m_id, state, m_finalImage.get());
27 return; 27 return;
28 } 28 }
29 RefPtr<CSSCrossfadeValue> crossfadeValue = CSSCrossfadeValue::create(m_initi alImage, m_finalImage); 29 RefPtrWillBeRawPtr<CSSCrossfadeValue> crossfadeValue = CSSCrossfadeValue::cr eate(m_initialImage, m_finalImage);
30 crossfadeValue->setPercentage(CSSPrimitiveValue::create(cachedValue, CSSPrim itiveValue::CSS_NUMBER)); 30 crossfadeValue->setPercentage(CSSPrimitiveValue::create(cachedValue, CSSPrim itiveValue::CSS_NUMBER));
31 31
32 StyleBuilder::applyProperty(m_id, state, crossfadeValue.get()); 32 StyleBuilder::applyProperty(m_id, state, crossfadeValue.get());
33 } 33 }
34
35 void ImageStyleInterpolation::trace(Visitor* visitor)
36 {
37 visitor->trace(m_initialImage);
38 visitor->trace(m_finalImage);
39 StyleInterpolation::trace(visitor);
34 } 40 }
41
42 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/ImageStyleInterpolation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698