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

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

Issue 1303173007: Oilpan: Unship Oilpan from CSSValues Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
OLDNEW
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 #include "config.h" 5 #include "config.h"
6 #include "core/animation/LengthPairStyleInterpolation.h" 6 #include "core/animation/LengthPairStyleInterpolation.h"
7 7
8 #include "core/animation/LengthStyleInterpolation.h" 8 #include "core/animation/LengthStyleInterpolation.h"
9 #include "core/css/Pair.h" 9 #include "core/css/Pair.h"
10 #include "core/css/resolver/StyleBuilder.h" 10 #include "core/css/resolver/StyleBuilder.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 bool LengthPairStyleInterpolation::canCreateFrom(const CSSValue& value) 14 bool LengthPairStyleInterpolation::canCreateFrom(const CSSValue& value)
15 { 15 {
16 return value.isPrimitiveValue() && toCSSPrimitiveValue(value).getPairValue() ; 16 return value.isPrimitiveValue() && toCSSPrimitiveValue(value).getPairValue() ;
17 } 17 }
18 18
19 PassOwnPtrWillBeRawPtr<InterpolableValue> LengthPairStyleInterpolation::lengthPa irToInterpolableValue(const CSSValue& value) 19 PassOwnPtrWillBeRawPtr<InterpolableValue> LengthPairStyleInterpolation::lengthPa irToInterpolableValue(const CSSValue& value)
20 { 20 {
21 OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2); 21 OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2);
22 Pair* pair = toCSSPrimitiveValue(value).getPairValue(); 22 Pair* pair = toCSSPrimitiveValue(value).getPairValue();
23 ASSERT(pair); 23 ASSERT(pair);
24 24
25 result->set(0, LengthStyleInterpolation::toInterpolableValue(*pair->first()) ); 25 result->set(0, LengthStyleInterpolation::toInterpolableValue(*pair->first()) );
26 result->set(1, LengthStyleInterpolation::toInterpolableValue(*pair->second() )); 26 result->set(1, LengthStyleInterpolation::toInterpolableValue(*pair->second() ));
27 return result.release(); 27 return result.release();
28 } 28 }
29 29
30 PassRefPtrWillBeRawPtr<CSSValue> LengthPairStyleInterpolation::interpolableValue ToLengthPair(InterpolableValue* value, InterpolationRange range) 30 PassRefPtr<CSSValue> LengthPairStyleInterpolation::interpolableValueToLengthPair (InterpolableValue* value, InterpolationRange range)
31 { 31 {
32 InterpolableList* lengthPair = toInterpolableList(value); 32 InterpolableList* lengthPair = toInterpolableList(value);
33 RefPtrWillBeRawPtr<CSSPrimitiveValue> first = LengthStyleInterpolation::from InterpolableValue(*lengthPair->get(0), range); 33 RefPtr<CSSPrimitiveValue> first = LengthStyleInterpolation::fromInterpolable Value(*lengthPair->get(0), range);
34 RefPtrWillBeRawPtr<CSSPrimitiveValue> second = LengthStyleInterpolation::fro mInterpolableValue(*lengthPair->get(1), range); 34 RefPtr<CSSPrimitiveValue> second = LengthStyleInterpolation::fromInterpolabl eValue(*lengthPair->get(1), range);
35 RefPtrWillBeRawPtr<Pair> result = Pair::create(first, second, Pair::KeepIden ticalValues); 35 RefPtr<Pair> result = Pair::create(first, second, Pair::KeepIdenticalValues) ;
36 36
37 return CSSPrimitiveValue::create(result.release()); 37 return CSSPrimitiveValue::create(result.release());
38 } 38 }
39 39
40 void LengthPairStyleInterpolation::apply(StyleResolverState& state) const 40 void LengthPairStyleInterpolation::apply(StyleResolverState& state) const
41 { 41 {
42 StyleBuilder::applyProperty(m_id, state, interpolableValueToLengthPair(m_cac hedValue.get(), m_range).get()); 42 StyleBuilder::applyProperty(m_id, state, interpolableValueToLengthPair(m_cac hedValue.get(), m_range).get());
43 } 43 }
44 44
45 } // namespace blink 45 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/LengthPairStyleInterpolation.h ('k') | Source/core/animation/LengthPairStyleInterpolationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698