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

Unified Diff: Source/platform/graphics/Gradient.h

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 | « Source/core/svg/SVGGradientElement.cpp ('k') | Source/platform/graphics/Gradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/Gradient.h
diff --git a/Source/platform/graphics/Gradient.h b/Source/platform/graphics/Gradient.h
index 697f8fb0261c96acfb177229cd81325f851e23c1..5434fe314f4709bcd6fff859972dd2bf958eb798 100644
--- a/Source/platform/graphics/Gradient.h
+++ b/Source/platform/graphics/Gradient.h
@@ -31,6 +31,7 @@
#include "platform/PlatformExport.h"
#include "platform/geometry/FloatPoint.h"
+#include "platform/graphics/Color.h"
#include "platform/graphics/GraphicsTypes.h"
#include "platform/transforms/AffineTransform.h"
#include "wtf/PassRefPtr.h"
@@ -42,7 +43,6 @@ class SkShader;
namespace WebCore {
-class Color;
class FloatRect;
class IntSize;
@@ -60,13 +60,9 @@ public:
struct ColorStop {
float stop;
- float red;
- float green;
- float blue;
- float alpha;
+ Color color;
- ColorStop() : stop(0), red(0), green(0), blue(0), alpha(0) { }
- ColorStop(float s, float r, float g, float b, float a) : stop(s), red(r), green(g), blue(b), alpha(a) { }
+ ColorStop(float s, const Color& c) : stop(s), color(c) { }
};
void addColorStop(const ColorStop&);
void addColorStop(float, const Color&);
« no previous file with comments | « Source/core/svg/SVGGradientElement.cpp ('k') | Source/platform/graphics/Gradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698