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

Unified Diff: Source/core/rendering/svg/RenderSVGResource.cpp

Issue 20061003: Move isValid/isCurrentColor from Color to StyleColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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: Source/core/rendering/svg/RenderSVGResource.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResource.cpp b/Source/core/rendering/svg/RenderSVGResource.cpp
index 6b13ce7bf58d3ec8ea5a2c504608654c1848a4e1..9ecdfdff143a0d2005eb34f45463062ae70b5b2b 100644
--- a/Source/core/rendering/svg/RenderSVGResource.cpp
+++ b/Source/core/rendering/svg/RenderSVGResource.cpp
@@ -34,7 +34,7 @@
namespace WebCore {
-static inline bool inheritColorFromParentStyleIfNeeded(RenderObject* object, bool applyToFill, Color& color)
+static inline bool inheritColorFromParentStyleIfNeeded(RenderObject* object, bool applyToFill, StyleColor& color)
{
if (color.isValid())
return true;
@@ -45,7 +45,7 @@ static inline bool inheritColorFromParentStyleIfNeeded(RenderObject* object, boo
return true;
}
-static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode mode, RenderObject* object, const RenderStyle* style, Color& fallbackColor)
+static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode mode, RenderObject* object, const RenderStyle* style, StyleColor& fallbackColor)
{
ASSERT(object);
ASSERT(style);
@@ -80,7 +80,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
if (paintType == SVGPaint::SVG_PAINTTYPE_NONE)
return 0;
- Color color;
+ StyleColor color;
switch (paintType) {
case SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR:
case SVGPaint::SVG_PAINTTYPE_RGBCOLOR:
@@ -100,8 +100,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
// For SVG_PAINTTYPE_CURRENTCOLOR, 'color' already contains the 'visitedColor'.
if (visitedPaintType < SVGPaint::SVG_PAINTTYPE_URI_NONE && visitedPaintType != SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR) {
const Color& visitedColor = applyToFill ? svgStyle->visitedLinkFillPaintColor() : svgStyle->visitedLinkStrokePaintColor();
- if (visitedColor.isValid())
- color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha());
+ color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha());
}
}
@@ -111,7 +110,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
if (!inheritColorFromParentStyleIfNeeded(object, applyToFill, color))
return 0;
- colorResource->setColor(color);
+ colorResource->setColor(color.color());
return colorResource;
}
@@ -121,7 +120,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
if (paintType == SVGPaint::SVG_PAINTTYPE_URI_NONE || !inheritColorFromParentStyleIfNeeded(object, applyToFill, color))
return 0;
- colorResource->setColor(color);
+ colorResource->setColor(color.color());
return colorResource;
}
@@ -131,7 +130,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
if (!inheritColorFromParentStyleIfNeeded(object, applyToFill, color))
return 0;
- colorResource->setColor(color);
+ colorResource->setColor(color.color());
return colorResource;
}
@@ -141,12 +140,12 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
return uriResource;
}
-RenderSVGResource* RenderSVGResource::fillPaintingResource(RenderObject* object, const RenderStyle* style, Color& fallbackColor)
+RenderSVGResource* RenderSVGResource::fillPaintingResource(RenderObject* object, const RenderStyle* style, StyleColor& fallbackColor)
{
return requestPaintingResource(ApplyToFillMode, object, style, fallbackColor);
}
-RenderSVGResource* RenderSVGResource::strokePaintingResource(RenderObject* object, const RenderStyle* style, Color& fallbackColor)
+RenderSVGResource* RenderSVGResource::strokePaintingResource(RenderObject* object, const RenderStyle* style, StyleColor& fallbackColor)
{
return requestPaintingResource(ApplyToStrokeMode, object, style, fallbackColor);
}

Powered by Google App Engine
This is Rietveld 408576698