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

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

Issue 658333003: Make RenderSVGResource::requestPaintingResource an implementation detail (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop SolidColorResourceType. Created 6 years, 2 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.h
diff --git a/Source/core/rendering/svg/RenderSVGResource.h b/Source/core/rendering/svg/RenderSVGResource.h
index 2b822e0305d69e07ce5c110c90dd8c89bd2fae9d..72662d5c407aee5306a811efca5d0b49b0b862c4 100644
--- a/Source/core/rendering/svg/RenderSVGResource.h
+++ b/Source/core/rendering/svg/RenderSVGResource.h
@@ -32,7 +32,6 @@ enum RenderSVGResourceType {
PatternResourceType,
LinearGradientResourceType,
RadialGradientResourceType,
- SolidColorResourceType,
FilterResourceType,
ClipperResourceType
};
@@ -46,7 +45,6 @@ class GraphicsContext;
class GraphicsContextStateSaver;
class RenderObject;
class RenderStyle;
-class RenderSVGResourceSolidColor;
class SVGPaintServer {
public:
@@ -79,10 +77,21 @@ public:
virtual RenderSVGResourceType resourceType() const = 0;
- // Helper utilities used in the render tree to access resources used for painting shapes/text (gradients & patterns & solid colors only)
- // If hasFallback gets set to true, the sharedSolidPaintingResource is set to a fallback color.
- static RenderSVGResource* requestPaintingResource(RenderSVGResourceMode, const RenderObject&, const RenderStyle*, bool& hasFallback);
- static RenderSVGResourceSolidColor* sharedSolidPaintingResource();
+ // Helper utilities used in the render tree to access resources used for
+ // painting shapes/text (gradients & patterns & solid colors only).
+ // If |PaintDescription::hasFallback| is true, |PaintDescription::color| is set to a fallback color.
+ struct PaintDescription {
f(malita) 2014/10/20 14:51:06 This smells close enough to a paint server to make
fs 2014/10/20 15:20:20 It's the case you mention and the DRT code. For DR
fs 2014/10/20 15:52:24 Oh, and it'll not be possible to tell a fallback c
+ PaintDescription() : resource(nullptr), isValid(false), hasFallback(false) { }
+ PaintDescription(Color color) : resource(nullptr), color(color), isValid(true), hasFallback(false) { }
+ PaintDescription(RenderSVGResource* resource) : resource(resource), isValid(true), hasFallback(false) { ASSERT(resource); }
+ PaintDescription(RenderSVGResource* resource, Color fallbackColor) : resource(resource), color(fallbackColor), isValid(true), hasFallback(true) { ASSERT(resource); }
+
+ RenderSVGResource* resource;
+ Color color;
+ bool isValid;
+ bool hasFallback;
+ };
+ static PaintDescription requestPaint(RenderSVGResourceMode, const RenderObject&, const RenderStyle*);
static void markForLayoutAndParentResourceInvalidation(RenderObject*, bool needsLayout = true);
};

Powered by Google App Engine
This is Rietveld 408576698