diff options
Diffstat (limited to 'Source/WebCore/rendering/svg/RenderSVGShape.h')
-rw-r--r-- | Source/WebCore/rendering/svg/RenderSVGShape.h | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.h b/Source/WebCore/rendering/svg/RenderSVGShape.h index e27b4b42f..f1db416e4 100644 --- a/Source/WebCore/rendering/svg/RenderSVGShape.h +++ b/Source/WebCore/rendering/svg/RenderSVGShape.h @@ -2,7 +2,7 @@ * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> * Copyright (C) 2005 Eric Seidel <eric@webkit.org> - * Copyright (C) 2006 Apple Computer, Inc + * Copyright (C) 2006 Apple Inc. * Copyright (C) 2009 Google, Inc. * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> * Copyright (C) 2011 University of Szeged @@ -23,16 +23,14 @@ * Boston, MA 02110-1301, USA. */ -#ifndef RenderSVGShape_h -#define RenderSVGShape_h +#pragma once -#if ENABLE(SVG) #include "AffineTransform.h" #include "FloatRect.h" #include "RenderSVGModelObject.h" #include "SVGGraphicsElement.h" #include "SVGMarkerData.h" -#include <wtf/OwnPtr.h> +#include <memory> #include <wtf/Vector.h> namespace WebCore { @@ -46,18 +44,18 @@ class SVGGraphicsElement; class RenderSVGShape : public RenderSVGModelObject { public: - RenderSVGShape(SVGGraphicsElement&, PassRef<RenderStyle>); - RenderSVGShape(SVGGraphicsElement&, PassRef<RenderStyle>, Path*, bool); + RenderSVGShape(SVGGraphicsElement&, RenderStyle&&); virtual ~RenderSVGShape(); - SVGGraphicsElement& graphicsElement() const { return toSVGGraphicsElement(RenderSVGModelObject::element()); } + SVGGraphicsElement& graphicsElement() const { return downcast<SVGGraphicsElement>(RenderSVGModelObject::element()); } void setNeedsShapeUpdate() { m_needsShapeUpdate = true; } - virtual void setNeedsBoundariesUpdate() override final { m_needsBoundariesUpdate = true; } - virtual bool needsBoundariesUpdate() override final { return m_needsBoundariesUpdate; } - virtual void setNeedsTransformUpdate() override final { m_needsTransformUpdate = true; } - virtual void fillShape(GraphicsContext*) const; - virtual void strokeShape(GraphicsContext*) const; + void setNeedsBoundariesUpdate() final { m_needsBoundariesUpdate = true; } + bool needsBoundariesUpdate() final { return m_needsBoundariesUpdate; } + void setNeedsTransformUpdate() final { m_needsTransformUpdate = true; } + virtual void fillShape(GraphicsContext&) const; + virtual void strokeShape(GraphicsContext&) const; + virtual bool isRenderingDisabled() const = 0; bool hasPath() const { return m_path.get(); } Path& path() const @@ -70,7 +68,7 @@ protected: void element() const = delete; virtual void updateShapeFromElement(); - virtual bool isEmpty() const override; + virtual bool isEmpty() const; virtual bool shapeDependentStrokeContains(const FloatPoint&); virtual bool shapeDependentFillContains(const FloatPoint&, const WindRule) const; float strokeWidth() const; @@ -88,23 +86,23 @@ private: bool fillContains(const FloatPoint&, bool requiresFill = true, const WindRule fillRule = RULE_NONZERO); bool strokeContains(const FloatPoint&, bool requiresStroke = true); - virtual FloatRect repaintRectInLocalCoordinates() const override final { return m_repaintBoundingBox; } - virtual FloatRect repaintRectInLocalCoordinatesExcludingSVGShadow() const override final { return m_repaintBoundingBoxExcludingShadow; } - virtual const AffineTransform& localToParentTransform() const override final { return m_localTransform; } - virtual AffineTransform localTransform() const override final { return m_localTransform; } + FloatRect repaintRectInLocalCoordinates() const final { return m_repaintBoundingBox; } + FloatRect repaintRectInLocalCoordinatesExcludingSVGShadow() const final { return m_repaintBoundingBoxExcludingShadow; } + const AffineTransform& localToParentTransform() const final { return m_localTransform; } + AffineTransform localTransform() const final { return m_localTransform; } - virtual bool isSVGShape() const override final { return true; } - virtual bool canHaveChildren() const override final { return false; } - virtual const char* renderName() const override { return "RenderSVGShape"; } + bool isSVGShape() const final { return true; } + bool canHaveChildren() const final { return false; } + const char* renderName() const override { return "RenderSVGShape"; } - virtual void layout() override final; - virtual void paint(PaintInfo&, const LayoutPoint&) override final; - virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) override final; + void layout() final; + void paint(PaintInfo&, const LayoutPoint&) final; + void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) final; - virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction) override final; + bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction) final; - virtual FloatRect objectBoundingBox() const override final { return m_fillBoundingBox; } - virtual FloatRect strokeBoundingBox() const override final { return m_strokeBoundingBox; } + FloatRect objectBoundingBox() const final { return m_fillBoundingBox; } + FloatRect strokeBoundingBox() const final { return m_strokeBoundingBox; } FloatRect calculateObjectBoundingBox() const; FloatRect calculateStrokeBoundingBox() const; void updateRepaintBoundingBox(); @@ -115,16 +113,17 @@ private: FloatRect markerRect(float strokeWidth) const; void processMarkerPositions(); - void fillShape(const RenderStyle&, GraphicsContext*); - void strokeShape(const RenderStyle&, GraphicsContext*); - void fillAndStrokeShape(GraphicsContext*); + void fillShape(const RenderStyle&, GraphicsContext&); + void strokeShape(const RenderStyle&, GraphicsContext&); + void strokeShape(GraphicsContext&); + void fillStrokeMarkers(PaintInfo&); void drawMarkers(PaintInfo&); private: FloatRect m_repaintBoundingBox; FloatRect m_repaintBoundingBoxExcludingShadow; AffineTransform m_localTransform; - OwnPtr<Path> m_path; + std::unique_ptr<Path> m_path; Vector<MarkerPosition> m_markerPositions; bool m_needsBoundariesUpdate : 1; @@ -132,9 +131,6 @@ private: bool m_needsTransformUpdate : 1; }; -RENDER_OBJECT_TYPE_CASTS(RenderSVGShape, isSVGShape()) +} // namespace WebCore -} - -#endif // ENABLE(SVG) -#endif +SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGShape, isSVGShape()) |