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 19 matching lines...) Expand all Loading... |
30 #include "wtf/PassOwnPtr.h" | 30 #include "wtf/PassOwnPtr.h" |
31 #include "wtf/text/WTFString.h" | 31 #include "wtf/text/WTFString.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class SVGPathSource; | 35 class SVGPathSource; |
36 | 36 |
37 class SVGPathParser final : public NoBaseWillBeGarbageCollected<SVGPathParser> { | 37 class SVGPathParser final : public NoBaseWillBeGarbageCollected<SVGPathParser> { |
38 WTF_MAKE_NONCOPYABLE(SVGPathParser); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED
; | 38 WTF_MAKE_NONCOPYABLE(SVGPathParser); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED
; |
39 public: | 39 public: |
40 SVGPathParser(); | 40 SVGPathParser(SVGPathSource* source, SVGPathConsumer* consumer) |
| 41 : m_source(source) |
| 42 , m_consumer(consumer) |
| 43 { |
| 44 ASSERT(m_source); |
| 45 ASSERT(m_consumer); |
| 46 } |
41 | 47 |
42 bool parsePathDataFromSource(PathParsingMode, bool checkForInitialMoveTo = t
rue); | 48 bool parsePathDataFromSource(PathParsingMode, bool checkForInitialMoveTo = t
rue); |
43 void setCurrentConsumer(SVGPathConsumer* consumer) { m_consumer = consumer;
} | |
44 void setCurrentSource(SVGPathSource* source) { m_source = source; } | |
45 void cleanup(); | |
46 | 49 |
47 void trace(Visitor*); | 50 void trace(Visitor*); |
48 | 51 |
49 private: | 52 private: |
50 bool decomposeArcToCubic(float, float, float, FloatPoint&, FloatPoint&, bool
largeArcFlag, bool sweepFlag); | 53 bool decomposeArcToCubic(float, float, float, FloatPoint&, FloatPoint&, bool
largeArcFlag, bool sweepFlag); |
51 void parseClosePathSegment(); | 54 void parseClosePathSegment(); |
52 bool parseMoveToSegment(); | 55 bool parseMoveToSegment(); |
53 bool parseLineToSegment(); | 56 bool parseLineToSegment(); |
54 bool parseLineToHorizontalSegment(); | 57 bool parseLineToHorizontalSegment(); |
55 bool parseLineToVerticalSegment(); | 58 bool parseLineToVerticalSegment(); |
(...skipping 10 matching lines...) Expand all Loading... |
66 SVGPathSegType m_lastCommand; | 69 SVGPathSegType m_lastCommand; |
67 bool m_closePath; | 70 bool m_closePath; |
68 FloatPoint m_controlPoint; | 71 FloatPoint m_controlPoint; |
69 FloatPoint m_currentPoint; | 72 FloatPoint m_currentPoint; |
70 FloatPoint m_subPathPoint; | 73 FloatPoint m_subPathPoint; |
71 }; | 74 }; |
72 | 75 |
73 } // namespace blink | 76 } // namespace blink |
74 | 77 |
75 #endif // SVGPathParser_h | 78 #endif // SVGPathParser_h |
OLD | NEW |