diff options
Diffstat (limited to 'Source/WebCore/svg/SVGPathByteStreamBuilder.h')
-rw-r--r-- | Source/WebCore/svg/SVGPathByteStreamBuilder.h | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/Source/WebCore/svg/SVGPathByteStreamBuilder.h b/Source/WebCore/svg/SVGPathByteStreamBuilder.h index 0f702380f..5021bfe37 100644 --- a/Source/WebCore/svg/SVGPathByteStreamBuilder.h +++ b/Source/WebCore/svg/SVGPathByteStreamBuilder.h @@ -1,5 +1,6 @@ /* * Copyright (C) Research In Motion Limited 2010. All rights reserved. + * Copyright (C) 2015 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -17,10 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#ifndef SVGPathByteStreamBuilder_h -#define SVGPathByteStreamBuilder_h +#pragma once -#if ENABLE(SVG) #include "FloatPoint.h" #include "SVGPathByteStream.h" #include "SVGPathConsumer.h" @@ -28,37 +27,34 @@ namespace WebCore { -class SVGPathByteStreamBuilder : public SVGPathConsumer { +class SVGPathByteStreamBuilder final : public SVGPathConsumer { public: - SVGPathByteStreamBuilder(); - - void setCurrentByteStream(SVGPathByteStream* byteStream) { m_byteStream = byteStream; } + SVGPathByteStreamBuilder(SVGPathByteStream&); private: - virtual void incrementPathSegmentCount() override { } - virtual bool continueConsuming() override { return true; } - virtual void cleanup() override { m_byteStream = 0; } + 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; + 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; template<typename ByteType> void writeType(const ByteType& type) { size_t typeSize = sizeof(ByteType); for (size_t i = 0; i < typeSize; ++i) - m_byteStream->append(type.bytes[i]); + m_byteStream.append(type.bytes[i]); } void writeFlag(bool value) @@ -88,10 +84,7 @@ private: writeType(data); } - SVGPathByteStream* m_byteStream; + SVGPathByteStream& m_byteStream; }; } // namespace WebCore - -#endif // ENABLE(SVG) -#endif // SVGPathByteStreamBuilder_h |