| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
| 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 ASSERT(segment.command != PathSegUnknown); | 93 ASSERT(segment.command != PathSegUnknown); |
| 94 | 94 |
| 95 normalizer.emitSegment(segment); | 95 normalizer.emitSegment(segment); |
| 96 | 96 |
| 97 hasMoreData = source.hasMoreData(); | 97 hasMoreData = source.hasMoreData(); |
| 98 if (traversalState.processSegment(hasMoreData)) | 98 if (traversalState.processSegment(hasMoreData)) |
| 99 break; | 99 break; |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 } | 103 } // namespace |
| 104 | 104 |
| 105 SVGPathQuery::SVGPathQuery(const SVGPathByteStream& pathByteStream) | 105 SVGPathQuery::SVGPathQuery(const SVGPathByteStream& pathByteStream) |
| 106 : m_pathByteStream(pathByteStream) | 106 : m_pathByteStream(pathByteStream) |
| 107 { | 107 { |
| 108 } | 108 } |
| 109 | 109 |
| 110 unsigned SVGPathQuery::getPathSegIndexAtLength(float length) const | 110 unsigned SVGPathQuery::getPathSegIndexAtLength(float length) const |
| 111 { | 111 { |
| 112 SVGPathTraversalState traversalState(PathTraversalState::TraversalSegmentAtL
ength, length); | 112 SVGPathTraversalState traversalState(PathTraversalState::TraversalSegmentAtL
ength, length); |
| 113 executeQuery(m_pathByteStream, traversalState); | 113 executeQuery(m_pathByteStream, traversalState); |
| 114 return traversalState.segmentIndex(); | 114 return traversalState.segmentIndex(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 float SVGPathQuery::getTotalLength() const | 117 float SVGPathQuery::getTotalLength() const |
| 118 { | 118 { |
| 119 SVGPathTraversalState traversalState(PathTraversalState::TraversalTotalLengt
h); | 119 SVGPathTraversalState traversalState(PathTraversalState::TraversalTotalLengt
h); |
| 120 executeQuery(m_pathByteStream, traversalState); | 120 executeQuery(m_pathByteStream, traversalState); |
| 121 return traversalState.totalLength(); | 121 return traversalState.totalLength(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 FloatPoint SVGPathQuery::getPointAtLength(float length) const | 124 FloatPoint SVGPathQuery::getPointAtLength(float length) const |
| 125 { | 125 { |
| 126 SVGPathTraversalState traversalState(PathTraversalState::TraversalPointAtLen
gth, length); | 126 SVGPathTraversalState traversalState(PathTraversalState::TraversalPointAtLen
gth, length); |
| 127 executeQuery(m_pathByteStream, traversalState); | 127 executeQuery(m_pathByteStream, traversalState); |
| 128 return traversalState.computedPoint(); | 128 return traversalState.computedPoint(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 } | 131 } // namespace blink |
| OLD | NEW |