diff options
Diffstat (limited to 'Source/WebCore/rendering/svg/RenderSVGResource.h')
-rw-r--r-- | Source/WebCore/rendering/svg/RenderSVGResource.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/Source/WebCore/rendering/svg/RenderSVGResource.h b/Source/WebCore/rendering/svg/RenderSVGResource.h index 2c66ffade..c06a30766 100644 --- a/Source/WebCore/rendering/svg/RenderSVGResource.h +++ b/Source/WebCore/rendering/svg/RenderSVGResource.h @@ -17,13 +17,12 @@ * Boston, MA 02110-1301, USA. */ -#ifndef RenderSVGResource_h -#define RenderSVGResource_h +#pragma once -#if ENABLE(SVG) #include "RenderSVGShape.h" #include "RenderStyleConstants.h" #include "SVGDocumentExtensions.h" +#include <wtf/TypeCasts.h> namespace WebCore { @@ -60,7 +59,7 @@ public: virtual ~RenderSVGResource() { } virtual void removeAllClientsFromCache(bool markForInvalidation = true) = 0; - virtual void removeClientFromCache(RenderObject&, bool markForInvalidation = true) = 0; + virtual void removeClientFromCache(RenderElement&, bool markForInvalidation = true) = 0; virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) = 0; virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) { } @@ -68,15 +67,6 @@ public: virtual RenderSVGResourceType resourceType() const = 0; - template<class Renderer> - Renderer* cast() - { - if (Renderer::s_resourceType == resourceType()) - return static_cast<Renderer*>(this); - - return 0; - } - // Helper utilities used in the render tree to access resources used for painting shapes/text (gradients & patterns & solid colors only) static RenderSVGResource* fillPaintingResource(RenderElement&, const RenderStyle&, Color& fallbackColor); static RenderSVGResource* strokePaintingResource(RenderElement&, const RenderStyle&, Color& fallbackColor); @@ -85,7 +75,9 @@ public: static void markForLayoutAndParentResourceInvalidation(RenderObject&, bool needsLayout = true); }; -} +} // namespace WebCore -#endif -#endif +#define SPECIALIZE_TYPE_TRAITS_RENDER_SVG_RESOURCE(ToValueTypeName, ResourceType) \ +SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \ + static bool isType(const WebCore::RenderSVGResource& resource) { return resource.resourceType() == WebCore::ResourceType; } \ +SPECIALIZE_TYPE_TRAITS_END() |