OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010, 2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010, 2012. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(t
raversalState, 0); | 305 SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(t
raversalState, 0); |
306 | 306 |
307 OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(str
eam); | 307 OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(str
eam); |
308 SVGPathParser* parser = globalSVGPathParser(source.get(), builder); | 308 SVGPathParser* parser = globalSVGPathParser(source.get(), builder); |
309 bool ok = parser->parsePathDataFromSource(NormalizedParsing); | 309 bool ok = parser->parsePathDataFromSource(NormalizedParsing); |
310 totalLength = builder->totalLength(); | 310 totalLength = builder->totalLength(); |
311 parser->cleanup(); | 311 parser->cleanup(); |
312 return ok; | 312 return ok; |
313 } | 313 } |
314 | 314 |
315 bool getPointAtLengthOfSVGPathByteStream(SVGPathByteStream* stream, float length
, FloatPoint& point) | 315 bool getPointAtLengthOfSVGPathByteStream(SVGPathByteStream* stream, float length
, SVGPoint& point) |
316 { | 316 { |
317 ASSERT(stream); | 317 ASSERT(stream); |
318 if (stream->isEmpty()) | 318 if (stream->isEmpty()) |
319 return false; | 319 return false; |
320 | 320 |
321 PathTraversalState traversalState(PathTraversalState::TraversalPointAtLength
); | 321 PathTraversalState traversalState(PathTraversalState::TraversalPointAtLength
); |
322 SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(t
raversalState, length); | 322 SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(t
raversalState, length); |
323 | 323 |
324 OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(str
eam); | 324 OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(str
eam); |
325 SVGPathParser* parser = globalSVGPathParser(source.get(), builder); | 325 SVGPathParser* parser = globalSVGPathParser(source.get(), builder); |
326 bool ok = parser->parsePathDataFromSource(NormalizedParsing); | 326 bool ok = parser->parsePathDataFromSource(NormalizedParsing); |
327 point = builder->currentPoint(); | 327 point = builder->currentPoint(); |
328 parser->cleanup(); | 328 parser->cleanup(); |
329 return ok; | 329 return ok; |
330 } | 330 } |
331 | 331 |
332 } | 332 } |
OLD | NEW |