OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 PathSegCurveToQuadraticSmoothRel = 19 | 49 PathSegCurveToQuadraticSmoothRel = 19 |
50 }; | 50 }; |
51 | 51 |
52 static inline SVGPathSegType toAbsolutePathSegType(const SVGPathSegType type) { | 52 static inline SVGPathSegType toAbsolutePathSegType(const SVGPathSegType type) { |
53 // Clear the LSB to get the absolute command. | 53 // Clear the LSB to get the absolute command. |
54 return type >= PathSegMoveToAbs ? static_cast<SVGPathSegType>(type & ~1u) | 54 return type >= PathSegMoveToAbs ? static_cast<SVGPathSegType>(type & ~1u) |
55 : type; | 55 : type; |
56 } | 56 } |
57 | 57 |
58 static inline bool isAbsolutePathSegType(const SVGPathSegType type) { | 58 static inline bool isAbsolutePathSegType(const SVGPathSegType type) { |
59 // For commands with an ordinal >= PathSegMoveToAbs, and odd number => relativ
e command. | 59 // For commands with an ordinal >= PathSegMoveToAbs, and odd number => |
| 60 // relative command. |
60 return type < PathSegMoveToAbs || type % 2 == 0; | 61 return type < PathSegMoveToAbs || type % 2 == 0; |
61 } | 62 } |
62 | 63 |
63 struct PathSegmentData { | 64 struct PathSegmentData { |
64 STACK_ALLOCATED(); | 65 STACK_ALLOCATED(); |
65 PathSegmentData() | 66 PathSegmentData() |
66 : command(PathSegUnknown), arcSweep(false), arcLarge(false) {} | 67 : command(PathSegUnknown), arcSweep(false), arcLarge(false) {} |
67 | 68 |
68 const FloatPoint& arcRadii() const { return point1; } | 69 const FloatPoint& arcRadii() const { return point1; } |
69 FloatPoint& arcRadii() { return point1; } | 70 FloatPoint& arcRadii() { return point1; } |
(...skipping 20 matching lines...) Expand all Loading... |
90 FloatPoint targetPoint; | 91 FloatPoint targetPoint; |
91 FloatPoint point1; | 92 FloatPoint point1; |
92 FloatPoint point2; | 93 FloatPoint point2; |
93 bool arcSweep; | 94 bool arcSweep; |
94 bool arcLarge; | 95 bool arcLarge; |
95 }; | 96 }; |
96 | 97 |
97 } // namespace blink | 98 } // namespace blink |
98 | 99 |
99 #endif // SVGPathData_h | 100 #endif // SVGPathData_h |
OLD | NEW |