Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGPathParser.cpp

Issue 1471943003: Introduce SVGPathQuery to hold SVG path query methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 bool SVGPathParser::parsePath() 45 bool SVGPathParser::parsePath()
46 { 46 {
47 while (m_source->hasMoreData()) { 47 while (m_source->hasMoreData()) {
48 PathSegmentData segment = m_source->parseSegment(); 48 PathSegmentData segment = m_source->parseSegment();
49 if (segment.command == PathSegUnknown) 49 if (segment.command == PathSegUnknown)
50 return false; 50 return false;
51 51
52 m_consumer->emitSegment(segment); 52 m_consumer->emitSegment(segment);
53
54 if (!m_consumer->continueConsuming())
55 return true;
56
57 if (m_source->hasMoreData())
58 m_consumer->incrementPathSegmentCount();
59 } 53 }
60 return true; 54 return true;
61 } 55 }
62 56
63 static FloatPoint reflectedPoint(const FloatPoint& reflectIn, const FloatPoint& pointToReflect) 57 static FloatPoint reflectedPoint(const FloatPoint& reflectIn, const FloatPoint& pointToReflect)
64 { 58 {
65 return FloatPoint(2 * reflectIn.x() - pointToReflect.x(), 2 * reflectIn.y() - pointToReflect.y()); 59 return FloatPoint(2 * reflectIn.x() - pointToReflect.x(), 2 * reflectIn.y() - pointToReflect.y());
66 } 60 }
67 61
68 // Blend the points with a ratio (1/3):(2/3). 62 // Blend the points with a ratio (1/3):(2/3).
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 bool SVGPathParser::parseAndNormalizePath() 301 bool SVGPathParser::parseAndNormalizePath()
308 { 302 {
309 SVGPathNormalizer normalizer(m_consumer); 303 SVGPathNormalizer normalizer(m_consumer);
310 304
311 while (m_source->hasMoreData()) { 305 while (m_source->hasMoreData()) {
312 PathSegmentData segment = m_source->parseSegment(); 306 PathSegmentData segment = m_source->parseSegment();
313 if (segment.command == PathSegUnknown) 307 if (segment.command == PathSegUnknown)
314 return false; 308 return false;
315 309
316 normalizer.emitSegment(segment); 310 normalizer.emitSegment(segment);
317
318 if (!m_consumer->continueConsuming())
319 return true;
320
321 if (m_source->hasMoreData())
322 m_consumer->incrementPathSegmentCount();
323 } 311 }
324 return true; 312 return true;
325 } 313 }
326 314
327 } 315 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGPathQuery.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698