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

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

Issue 673753004: Move RenderSVGResource into the inheritance hierarchy (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Non-move changes. 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/RenderSVGResourcePaintServer.h
diff --git a/Source/core/rendering/svg/RenderSVGResource.h b/Source/core/rendering/svg/RenderSVGResourcePaintServer.h
similarity index 75%
rename from Source/core/rendering/svg/RenderSVGResource.h
rename to Source/core/rendering/svg/RenderSVGResourcePaintServer.h
index abad795d2963d2878ce261f0138e67d512b7a27d..dfb684a800fcd7809a144706dab378279b9bb433 100644
--- a/Source/core/rendering/svg/RenderSVGResource.h
+++ b/Source/core/rendering/svg/RenderSVGResourcePaintServer.h
@@ -17,9 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef RenderSVGResource_h
-#define RenderSVGResource_h
+#ifndef RenderSVGResourcePaintServer_h
+#define RenderSVGResourcePaintServer_h
+#include "core/rendering/svg/RenderSVGResourceContainer.h"
#include "platform/graphics/Color.h"
#include "platform/graphics/Gradient.h"
#include "platform/graphics/Pattern.h"
@@ -34,7 +35,7 @@ enum RenderSVGResourceMode {
class GraphicsContext;
class GraphicsContextStateSaver;
class RenderObject;
-class RenderSVGResource;
+class RenderSVGResourcePaintServer;
class RenderStyle;
class SVGPaintServer {
@@ -64,26 +65,28 @@ private:
struct SVGPaintDescription {
SVGPaintDescription() : resource(nullptr), isValid(false), hasFallback(false) { }
SVGPaintDescription(Color color) : resource(nullptr), color(color), isValid(true), hasFallback(false) { }
- SVGPaintDescription(RenderSVGResource* resource) : resource(resource), isValid(true), hasFallback(false) { ASSERT(resource); }
- SVGPaintDescription(RenderSVGResource* resource, Color fallbackColor) : resource(resource), color(fallbackColor), isValid(true), hasFallback(true) { ASSERT(resource); }
+ SVGPaintDescription(RenderSVGResourcePaintServer* resource) : resource(resource), isValid(true), hasFallback(false) { ASSERT(resource); }
+ SVGPaintDescription(RenderSVGResourcePaintServer* resource, Color fallbackColor) : resource(resource), color(fallbackColor), isValid(true), hasFallback(true) { ASSERT(resource); }
- RenderSVGResource* resource;
+ RenderSVGResourcePaintServer* resource;
Color color;
bool isValid;
bool hasFallback;
};
-class RenderSVGResource {
+class RenderSVGResourcePaintServer : public RenderSVGResourceContainer {
public:
- RenderSVGResource() { }
- virtual ~RenderSVGResource() { }
+ RenderSVGResourcePaintServer(SVGElement*);
+ virtual ~RenderSVGResourcePaintServer();
- virtual SVGPaintServer preparePaintServer(const RenderObject&);
+ virtual SVGPaintServer preparePaintServer(const RenderObject&) = 0;
// Helper utilities used in to access the underlying resources for DRT.
static SVGPaintDescription requestPaintDescription(const RenderObject&, const RenderStyle*, RenderSVGResourceMode);
};
+DEFINE_TYPE_CASTS(RenderSVGResourcePaintServer, RenderSVGResourceContainer, resource, resource->isSVGPaintServer(), resource.isSVGPaintServer());
+
}
#endif
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceGradient.cpp ('k') | Source/core/rendering/svg/RenderSVGResourcePaintServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698