diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/svg/RenderSVGResource.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
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() |