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

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

Issue 23581008: Revert r154797: "Move isValid/isCurrentColor from Color to StyleColor" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 1b1bbe9e17fa6c37257c8cda7467ae10618cf348..3646cc1a480d2a917e6f1bbac871b814b3eafe81 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, StyleColor& color)
+static inline bool inheritColorFromParentStyleIfNeeded(RenderObject* object, bool applyToFill, Color& 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, StyleColor& fallbackColor)
+static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode mode, RenderObject* object, const RenderStyle* style, Color& fallbackColor)
{
ASSERT(object);
ASSERT(style);
@@ -80,7 +80,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
if (paintType == SVGPaint::SVG_PAINTTYPE_NONE)
return 0;
- StyleColor color;
+ Color color;
switch (paintType) {
case SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR:
case SVGPaint::SVG_PAINTTYPE_RGBCOLOR:
@@ -100,7 +100,8 @@ 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();
- color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha());
+ if (visitedColor.isValid())
+ color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha());
}
}
@@ -110,7 +111,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
if (!inheritColorFromParentStyleIfNeeded(object, applyToFill, color))
return 0;
- colorResource->setColor(color.color());
+ colorResource->setColor(color);
return colorResource;
}
@@ -120,7 +121,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
if (paintType == SVGPaint::SVG_PAINTTYPE_URI_NONE || !inheritColorFromParentStyleIfNeeded(object, applyToFill, color))
return 0;
- colorResource->setColor(color.color());
+ colorResource->setColor(color);
return colorResource;
}
@@ -130,7 +131,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
if (!inheritColorFromParentStyleIfNeeded(object, applyToFill, color))
return 0;
- colorResource->setColor(color.color());
+ colorResource->setColor(color);
return colorResource;
}
@@ -140,12 +141,12 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
return uriResource;
}
-RenderSVGResource* RenderSVGResource::fillPaintingResource(RenderObject* object, const RenderStyle* style, StyleColor& fallbackColor)
+RenderSVGResource* RenderSVGResource::fillPaintingResource(RenderObject* object, const RenderStyle* style, Color& fallbackColor)
{
return requestPaintingResource(ApplyToFillMode, object, style, fallbackColor);
}
-RenderSVGResource* RenderSVGResource::strokePaintingResource(RenderObject* object, const RenderStyle* style, StyleColor& fallbackColor)
+RenderSVGResource* RenderSVGResource::strokePaintingResource(RenderObject* object, const RenderStyle* style, Color& fallbackColor)
{
return requestPaintingResource(ApplyToStrokeMode, object, style, fallbackColor);
}

Powered by Google App Engine
This is Rietveld 408576698