diff options
Diffstat (limited to 'Source/WebCore/svg/SVGPathSegListBuilder.h')
-rw-r--r-- | Source/WebCore/svg/SVGPathSegListBuilder.h | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/Source/WebCore/svg/SVGPathSegListBuilder.h b/Source/WebCore/svg/SVGPathSegListBuilder.h index 565c5664b..eb1ab8b18 100644 --- a/Source/WebCore/svg/SVGPathSegListBuilder.h +++ b/Source/WebCore/svg/SVGPathSegListBuilder.h @@ -2,7 +2,7 @@ * Copyright (C) 2002, 2003 The Karbon Developers * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> - * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2009, 2015 Apple Inc. All rights reserved. * Copyright (C) Research In Motion Limited 2010. All rights reserved. * * This library is free software; you can redistribute it and/or @@ -21,56 +21,41 @@ * Boston, MA 02110-1301, USA. */ -#ifndef SVGPathSegListBuilder_h -#define SVGPathSegListBuilder_h +#pragma once -#if ENABLE(SVG) #include "FloatPoint.h" #include "SVGPathConsumer.h" -#include "SVGPathSegList.h" +#include "SVGPathSegListValues.h" namespace WebCore { class SVGPathElement; -class SVGPathSegListBuilder : public SVGPathConsumer { +class SVGPathSegListBuilder final : public SVGPathConsumer { public: - SVGPathSegListBuilder(); - - void setCurrentSVGPathElement(SVGPathElement* pathElement) { m_pathElement = pathElement; } - void setCurrentSVGPathSegList(SVGPathSegList& pathSegList) { m_pathSegList = &pathSegList; } - void setCurrentSVGPathSegRole(SVGPathSegRole pathSegRole) { m_pathSegRole = pathSegRole; } + SVGPathSegListBuilder(SVGPathElement&, SVGPathSegListValues&, SVGPathSegRole); private: - virtual void incrementPathSegmentCount() override { } - virtual bool continueConsuming() override { return true; } - virtual void cleanup() override - { - m_pathElement = 0; - m_pathSegList = 0; - m_pathSegRole = PathSegUndefinedRole; - } + void incrementPathSegmentCount() final { } + bool continueConsuming() final { return true; } // Used in UnalteredParsing/NormalizedParsing modes. - virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) override; - virtual void lineTo(const FloatPoint&, PathCoordinateMode) override; - virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode) override; - virtual void closePath() override; + void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) final; + void lineTo(const FloatPoint&, PathCoordinateMode) final; + void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode) final; + void closePath() final; // Only used in UnalteredParsing mode. - virtual void lineToHorizontal(float, PathCoordinateMode) override; - virtual void lineToVertical(float, PathCoordinateMode) override; - virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) override; - virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) override; - virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) override; - virtual void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, const FloatPoint&, PathCoordinateMode) override; - - SVGPathElement* m_pathElement; - SVGPathSegList* m_pathSegList; - SVGPathSegRole m_pathSegRole; + void lineToHorizontal(float, PathCoordinateMode) final; + void lineToVertical(float, PathCoordinateMode) final; + void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) final; + void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) final; + void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) final; + void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, const FloatPoint&, PathCoordinateMode) final; + + SVGPathElement& m_pathElement; + SVGPathSegListValues& m_pathSegList; + SVGPathSegRole m_pathSegRole { PathSegUndefinedRole }; }; } // namespace WebCore - -#endif // ENABLE(SVG) -#endif // SVGPathSegListBuilder_h |