summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGPathTraversalStateBuilder.h
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-25 19:20:41 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:30:55 +0000
commit6882a04fb36642862b11efe514251d32070c3d65 (patch)
treeb7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebCore/svg/SVGPathTraversalStateBuilder.h
parentab6df191029eeeb0b0f16f127d553265659f739e (diff)
downloadqtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/svg/SVGPathTraversalStateBuilder.h')
-rw-r--r--Source/WebCore/svg/SVGPathTraversalStateBuilder.h41
1 files changed, 19 insertions, 22 deletions
diff --git a/Source/WebCore/svg/SVGPathTraversalStateBuilder.h b/Source/WebCore/svg/SVGPathTraversalStateBuilder.h
index d9cac5096..ea930f8af 100644
--- a/Source/WebCore/svg/SVGPathTraversalStateBuilder.h
+++ b/Source/WebCore/svg/SVGPathTraversalStateBuilder.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
* 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
@@ -21,7 +22,6 @@
#ifndef SVGPathTraversalStateBuilder_h
#define SVGPathTraversalStateBuilder_h
-#if ENABLE(SVG)
#include "SVGPathConsumer.h"
#include "SVGPoint.h"
@@ -31,38 +31,35 @@ class PathTraversalState;
class SVGPathTraversalStateBuilder : public SVGPathConsumer {
public:
- SVGPathTraversalStateBuilder();
+ SVGPathTraversalStateBuilder(PathTraversalState&, float desiredLength = 0);
- unsigned pathSegmentIndex();
- float totalLength();
- SVGPoint currentPoint();
+ unsigned pathSegmentIndex() const { return m_segmentIndex; }
+ float totalLength() const;
+ SVGPoint currentPoint() const;
- void setCurrentTraversalState(PathTraversalState* traversalState) { m_traversalState = traversalState; }
- void setDesiredLength(float);
- virtual void incrementPathSegmentCount();
- virtual bool continueConsuming();
- virtual void cleanup() { m_traversalState = 0; }
+ virtual void incrementPathSegmentCount() override { ++m_segmentIndex; }
+ virtual bool continueConsuming() override;
private:
// Used in UnalteredParsing/NormalizedParsing modes.
- virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode);
- virtual void lineTo(const FloatPoint&, PathCoordinateMode);
- virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode);
- virtual void closePath();
+ 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;
private:
// Not used for PathTraversalState.
- virtual void lineToHorizontal(float, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
- virtual void lineToVertical(float, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
- virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
- virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
- virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
- virtual void arcTo(float, float, float, bool, bool, const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void lineToHorizontal(float, PathCoordinateMode) override { ASSERT_NOT_REACHED(); }
+ virtual void lineToVertical(float, PathCoordinateMode) override { ASSERT_NOT_REACHED(); }
+ virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) override { ASSERT_NOT_REACHED(); }
+ virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) override { ASSERT_NOT_REACHED(); }
+ virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) override { ASSERT_NOT_REACHED(); }
+ virtual void arcTo(float, float, float, bool, bool, const FloatPoint&, PathCoordinateMode) override { ASSERT_NOT_REACHED(); }
- PathTraversalState* m_traversalState;
+ PathTraversalState& m_traversalState;
+ unsigned m_segmentIndex { 0 };
};
} // namespace WebCore
-#endif // ENABLE(SVG)
#endif // SVGPathTraversalStateBuilder_h