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

Unified Diff: Source/core/svg/SVGGradientElement.cpp

Issue 201503002: Simplify Gradient by holding a Color instead of four floats. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use SkColorSetARGB Created 6 years, 9 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
« no previous file with comments | « no previous file | Source/platform/graphics/Gradient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGGradientElement.cpp
diff --git a/Source/core/svg/SVGGradientElement.cpp b/Source/core/svg/SVGGradientElement.cpp
index eea0849fbf32baeae45f8bb46906d9031938faf0..68229f997f43082b32a7c86edaf2ea4796692c0c 100644
--- a/Source/core/svg/SVGGradientElement.cpp
+++ b/Source/core/svg/SVGGradientElement.cpp
@@ -125,19 +125,12 @@ Vector<Gradient::ColorStop> SVGGradientElement::buildStops()
float previousOffset = 0.0f;
for (SVGStopElement* stop = Traversal<SVGStopElement>::firstChild(*this); stop; stop = Traversal<SVGStopElement>::nextSibling(*stop)) {
- Color color = stop->stopColorIncludingOpacity();
-
// Figure out right monotonic offset
float offset = stop->offset()->currentValue()->value();
offset = std::min(std::max(previousOffset, offset), 1.0f);
previousOffset = offset;
- // Extract individual channel values
- // FIXME: Why doesn't ColorStop take a Color and an offset??
- float r, g, b, a;
- color.getRGBA(r, g, b, a);
-
- stops.append(Gradient::ColorStop(offset, r, g, b, a));
+ stops.append(Gradient::ColorStop(offset, stop->stopColorIncludingOpacity()));
}
return stops;
« no previous file with comments | « no previous file | Source/platform/graphics/Gradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698