OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "wtf/text/WTFString.h" | 25 #include "wtf/text/WTFString.h" |
26 | 26 |
27 namespace blink { | 27 namespace blink { |
28 | 28 |
29 class SVGPathStringSource final : public SVGPathSource { | 29 class SVGPathStringSource final : public SVGPathSource { |
30 public: | 30 public: |
31 explicit SVGPathStringSource(const String&); | 31 explicit SVGPathStringSource(const String&); |
32 | 32 |
33 private: | 33 private: |
34 virtual bool hasMoreData() const override; | 34 virtual bool hasMoreData() const override; |
35 virtual bool moveToNextToken() override; | 35 virtual SVGPathSegType peekSegmentType() override; |
36 virtual bool parseSVGSegmentType(SVGPathSegType&) override; | 36 virtual PathSegmentData parseSegment() override; |
37 virtual SVGPathSegType nextCommand(SVGPathSegType previousCommand) override; | |
38 | 37 |
39 virtual bool parseMoveToSegment(FloatPoint&) override; | 38 void eatWhitespace(); |
40 virtual bool parseLineToSegment(FloatPoint&) override; | 39 float parseNumberWithError(); |
41 virtual bool parseLineToHorizontalSegment(float&) override; | 40 bool parseArcFlagWithError(); |
42 virtual bool parseLineToVerticalSegment(float&) override; | |
43 virtual bool parseCurveToCubicSegment(FloatPoint&, FloatPoint&, FloatPoint&)
override; | |
44 virtual bool parseCurveToCubicSmoothSegment(FloatPoint&, FloatPoint&) overri
de; | |
45 virtual bool parseCurveToQuadraticSegment(FloatPoint&, FloatPoint&) override
; | |
46 virtual bool parseCurveToQuadraticSmoothSegment(FloatPoint&) override; | |
47 virtual bool parseArcToSegment(float&, float&, float&, bool&, bool&, FloatPo
int&) override; | |
48 | 41 |
49 String m_string; | 42 String m_string; |
50 bool m_is8BitSource; | 43 bool m_is8BitSource; |
| 44 bool m_seenError; |
51 | 45 |
52 union { | 46 union { |
53 const LChar* m_character8; | 47 const LChar* m_character8; |
54 const UChar* m_character16; | 48 const UChar* m_character16; |
55 } m_current; | 49 } m_current; |
56 union { | 50 union { |
57 const LChar* m_character8; | 51 const LChar* m_character8; |
58 const UChar* m_character16; | 52 const UChar* m_character16; |
59 } m_end; | 53 } m_end; |
| 54 |
| 55 SVGPathSegType m_previousCommand; |
60 }; | 56 }; |
61 | 57 |
62 } // namespace blink | 58 } // namespace blink |
63 | 59 |
64 #endif // SVGPathStringSource_h | 60 #endif // SVGPathStringSource_h |
OLD | NEW |