OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2002, 2003 The Karbon Developers | 2 * Copyright (C) 2002, 2003 The Karbon Developers |
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> |
5 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "core/svg/SVGPathSegList.h" | 28 #include "core/svg/SVGPathSegList.h" |
29 #include "platform/geometry/FloatPoint.h" | 29 #include "platform/geometry/FloatPoint.h" |
30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 class SVGPathElement; | 34 class SVGPathElement; |
35 | 35 |
36 class SVGPathSegListBuilder final : public SVGPathConsumer { | 36 class SVGPathSegListBuilder final : public SVGPathConsumer { |
37 public: | 37 public: |
38 SVGPathSegListBuilder(); | 38 SVGPathSegListBuilder(SVGPathElement*, PassRefPtrWillBeRawPtr<SVGPathSegList
>); |
39 | |
40 void setCurrentSVGPathElement(SVGPathElement* pathElement) { m_pathElement =
pathElement; } | |
41 void setCurrentSVGPathSegList(PassRefPtrWillBeRawPtr<SVGPathSegList> pathSeg
List) { m_pathSegList = pathSegList; } | |
42 | 39 |
43 virtual void trace(Visitor*) override; | 40 virtual void trace(Visitor*) override; |
44 | 41 |
45 private: | 42 private: |
46 virtual void incrementPathSegmentCount() override { } | 43 virtual void incrementPathSegmentCount() override { } |
47 virtual bool continueConsuming() override { return true; } | 44 virtual bool continueConsuming() override { return true; } |
48 virtual void cleanup() override | |
49 { | |
50 m_pathElement = nullptr; | |
51 m_pathSegList = nullptr; | |
52 } | |
53 | 45 |
54 // Used in UnalteredParsing/NormalizedParsing modes. | 46 // Used in UnalteredParsing/NormalizedParsing modes. |
55 virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) over
ride; | 47 virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) over
ride; |
56 virtual void lineTo(const FloatPoint&, PathCoordinateMode) override; | 48 virtual void lineTo(const FloatPoint&, PathCoordinateMode) override; |
57 virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatP
oint&, PathCoordinateMode) override; | 49 virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatP
oint&, PathCoordinateMode) override; |
58 virtual void closePath() override; | 50 virtual void closePath() override; |
59 | 51 |
60 // Only used in UnalteredParsing mode. | 52 // Only used in UnalteredParsing mode. |
61 virtual void lineToHorizontal(float, PathCoordinateMode) override; | 53 virtual void lineToHorizontal(float, PathCoordinateMode) override; |
62 virtual void lineToVertical(float, PathCoordinateMode) override; | 54 virtual void lineToVertical(float, PathCoordinateMode) override; |
63 virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCo
ordinateMode) override; | 55 virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCo
ordinateMode) override; |
64 virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoor
dinateMode) override; | 56 virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoor
dinateMode) override; |
65 virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) o
verride; | 57 virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) o
verride; |
66 virtual void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, c
onst FloatPoint&, PathCoordinateMode) override; | 58 virtual void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, c
onst FloatPoint&, PathCoordinateMode) override; |
67 | 59 |
68 RawPtrWillBeMember<SVGPathElement> m_pathElement; | 60 RawPtrWillBeMember<SVGPathElement> m_pathElement; |
69 RefPtrWillBeMember<SVGPathSegList> m_pathSegList; | 61 RefPtrWillBeMember<SVGPathSegList> m_pathSegList; |
70 }; | 62 }; |
71 | 63 |
72 } // namespace blink | 64 } // namespace blink |
73 | 65 |
74 #endif // SVGPathSegListBuilder_h | 66 #endif // SVGPathSegListBuilder_h |
OLD | NEW |