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

Unified Diff: third_party/WebKit/Source/core/animation/ColorStyleInterpolation.cpp

Issue 1399853005: Changed CSSColorValue to return a Color (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_color
Patch Set: Fix for ManifestParser Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/animation/ColorStyleInterpolation.cpp
diff --git a/third_party/WebKit/Source/core/animation/ColorStyleInterpolation.cpp b/third_party/WebKit/Source/core/animation/ColorStyleInterpolation.cpp
index 19a638947bda0753c039c09e4a0c3f6ab69ae221..277a12c9cf012d38eacd00453209fb02c580ecda 100644
--- a/third_party/WebKit/Source/core/animation/ColorStyleInterpolation.cpp
+++ b/third_party/WebKit/Source/core/animation/ColorStyleInterpolation.cpp
@@ -23,26 +23,24 @@ bool ColorStyleInterpolation::canCreateFrom(const CSSValue& value)
PassOwnPtr<InterpolableValue> ColorStyleInterpolation::colorToInterpolableValue(const CSSValue& value)
{
- RGBA32 color;
+ Color color;
if (value.isColorValue()) {
color = toCSSColorValue(value).value();
} else {
const CSSPrimitiveValue& primitive = toCSSPrimitiveValue(value);
if (CSSPropertyParser::isSystemColor(primitive.getValueID())) {
- color = LayoutTheme::theme().systemColor(primitive.getValueID()).rgb();
+ color = LayoutTheme::theme().systemColor(primitive.getValueID());
} else {
- Color colorFromID;
- colorFromID.setNamedColor(getValueName(primitive.getValueID()));
- color = colorFromID.rgb();
+ color.setNamedColor(getValueName(primitive.getValueID()));
}
}
- int alpha = alphaChannel(color);
+ int alpha = color.alpha();
OwnPtr<InterpolableList> list = InterpolableList::create(4);
- list->set(0, InterpolableNumber::create(redChannel(color) * alpha));
- list->set(1, InterpolableNumber::create(greenChannel(color) * alpha));
- list->set(2, InterpolableNumber::create(blueChannel(color) * alpha));
+ list->set(0, InterpolableNumber::create(color.red() * alpha));
+ list->set(1, InterpolableNumber::create(color.green() * alpha));
+ list->set(2, InterpolableNumber::create(color.blue() * alpha));
list->set(3, InterpolableNumber::create(alpha));
return list->clone();

Powered by Google App Engine
This is Rietveld 408576698