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

Unified Diff: Source/core/svg/SVGPaint.h

Issue 189913012: Merge SVGColor into SVGPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix system color test 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/SVGFEDiffuseLightingElement.h ('k') | Source/core/svg/SVGPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGPaint.h
diff --git a/Source/core/svg/SVGPaint.h b/Source/core/svg/SVGPaint.h
index 9c8ffb8e276a0d693f06a28cfcf9539718549677..7a421136a8d09695e0467d91d4d5d084732b41d3 100644
--- a/Source/core/svg/SVGPaint.h
+++ b/Source/core/svg/SVGPaint.h
@@ -23,14 +23,16 @@
#ifndef SVGPaint_h
#define SVGPaint_h
-#include "core/svg/SVGColor.h"
+#include "core/css/CSSValue.h"
+#include "core/css/StyleColor.h"
+#include "platform/graphics/Color.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
class ExceptionState;
-class SVGPaint : public SVGColor {
+class SVGPaint : public CSSValue {
public:
enum SVGPaintType {
SVG_PAINTTYPE_UNKNOWN = 0,
@@ -63,7 +65,7 @@ public:
static PassRefPtrWillBeRawPtr<SVGPaint> createColor(const Color& color)
{
RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefWillBeRefCountedGarbageCollected(new SVGPaint(SVG_PAINTTYPE_RGBCOLOR));
- paint->setColor(color);
+ paint->m_color = color;
return paint.release();
}
@@ -76,7 +78,7 @@ public:
static PassRefPtrWillBeRawPtr<SVGPaint> createURIAndColor(const String& uri, const Color& color)
{
RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefWillBeRefCountedGarbageCollected(new SVGPaint(SVG_PAINTTYPE_URI_RGBCOLOR, uri));
- paint->setColor(color);
+ paint->m_color = color;
return paint.release();
}
@@ -101,7 +103,12 @@ public:
bool equals(const SVGPaint&) const;
- void traceAfterDispatch(Visitor* visitor) { SVGColor::traceAfterDispatch(visitor); }
+ void traceAfterDispatch(Visitor* visitor) { CSSValue::traceAfterDispatch(visitor); }
+
+ Color color() const { return m_color; }
+ void setColor(const Color& color) { m_color = color; m_paintType = SVG_PAINTTYPE_RGBCOLOR; }
+
+ static StyleColor colorFromRGBColorString(const String&);
private:
friend class CSSComputedStyleDeclaration;
@@ -109,7 +116,7 @@ private:
static PassRefPtrWillBeRawPtr<SVGPaint> create(const SVGPaintType& type, const String& uri, const Color& color)
{
RefPtrWillBeRawPtr<SVGPaint> paint = adoptRefWillBeRefCountedGarbageCollected(new SVGPaint(type, uri));
- paint->setColor(color);
+ paint->m_color = color;
return paint.release();
}
@@ -118,6 +125,7 @@ private:
SVGPaint(const SVGPaint& cloneFrom);
SVGPaintType m_paintType;
+ Color m_color;
String m_uri;
};
« no previous file with comments | « Source/core/svg/SVGFEDiffuseLightingElement.h ('k') | Source/core/svg/SVGPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698