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

Side by Side Diff: Source/core/animation/ColorStyleInterpolation.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/ColorStyleInterpolation.h" 6 #include "core/animation/ColorStyleInterpolation.h"
7 7
8 #include "core/CSSValueKeywords.h" 8 #include "core/CSSValueKeywords.h"
9 #include "core/css/CSSPrimitiveValue.h" 9 #include "core/css/CSSPrimitiveValue.h"
10 #include "core/css/parser/CSSPropertyParser.h" 10 #include "core/css/parser/CSSPropertyParser.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 OwnPtrWillBeRawPtr<InterpolableList> list = InterpolableList::create(4); 44 OwnPtrWillBeRawPtr<InterpolableList> list = InterpolableList::create(4);
45 list->set(0, InterpolableNumber::create(redChannel(color) * alpha)); 45 list->set(0, InterpolableNumber::create(redChannel(color) * alpha));
46 list->set(1, InterpolableNumber::create(greenChannel(color) * alpha)); 46 list->set(1, InterpolableNumber::create(greenChannel(color) * alpha));
47 list->set(2, InterpolableNumber::create(blueChannel(color) * alpha)); 47 list->set(2, InterpolableNumber::create(blueChannel(color) * alpha));
48 list->set(3, InterpolableNumber::create(alpha)); 48 list->set(3, InterpolableNumber::create(alpha));
49 49
50 return list->clone(); 50 return list->clone();
51 } 51 }
52 52
53 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> ColorStyleInterpolation::interpolableV alueToColor(const InterpolableValue& value) 53 PassRefPtr<CSSPrimitiveValue> ColorStyleInterpolation::interpolableValueToColor( const InterpolableValue& value)
54 { 54 {
55 ASSERT(value.isList()); 55 ASSERT(value.isList());
56 const InterpolableList* list = toInterpolableList(&value); 56 const InterpolableList* list = toInterpolableList(&value);
57 57
58 double alpha = toInterpolableNumber(list->get(3))->value(); 58 double alpha = toInterpolableNumber(list->get(3))->value();
59 if (!alpha) 59 if (!alpha)
60 return CSSPrimitiveValue::createColor(Color::transparent); 60 return CSSPrimitiveValue::createColor(Color::transparent);
61 61
62 // Clamping is inside makeRGBA. 62 // Clamping is inside makeRGBA.
63 unsigned rgba = makeRGBA( 63 unsigned rgba = makeRGBA(
(...skipping 25 matching lines...) Expand all
89 bool ColorStyleInterpolation::shouldUseLegacyStyleInterpolation(const CSSValue& start, const CSSValue& end) 89 bool ColorStyleInterpolation::shouldUseLegacyStyleInterpolation(const CSSValue& start, const CSSValue& end)
90 { 90 {
91 if (ColorStyleInterpolation::canCreateFrom(start) && ColorStyleInterpolation ::canCreateFrom(end)) { 91 if (ColorStyleInterpolation::canCreateFrom(start) && ColorStyleInterpolation ::canCreateFrom(end)) {
92 if (toCSSPrimitiveValue(start).colorIsDerivedFromElement() || toCSSPrimi tiveValue(end).colorIsDerivedFromElement()) 92 if (toCSSPrimitiveValue(start).colorIsDerivedFromElement() || toCSSPrimi tiveValue(end).colorIsDerivedFromElement())
93 return true; 93 return true;
94 } 94 }
95 return false; 95 return false;
96 } 96 }
97 97
98 } 98 }
OLDNEW
« no previous file with comments | « Source/core/animation/ColorStyleInterpolation.h ('k') | Source/core/animation/ColorStyleInterpolationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698