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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGPathBuilder.h

Issue 1635323002: [SVG] Fix SVGPathBuilder subpath point tracking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: specific m_lastCommand initializer no longer required Created 4 years, 10 months 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 19 matching lines...) Expand all
30 30
31 namespace blink { 31 namespace blink {
32 32
33 class FloatSize; 33 class FloatSize;
34 class Path; 34 class Path;
35 35
36 class SVGPathBuilder final : public SVGPathConsumer { 36 class SVGPathBuilder final : public SVGPathConsumer {
37 public: 37 public:
38 SVGPathBuilder(Path& path) 38 SVGPathBuilder(Path& path)
39 : m_path(path) 39 : m_path(path)
40 // Starting in ClosePath state ensures correct handling of the first mov eTo. 40 , m_lastCommand(PathSegUnknown)
41 , m_lastCommand(PathSegClosePath)
42 { } 41 { }
43 42
44 private: 43 private:
45 void emitSegment(const PathSegmentData&) override; 44 void emitSegment(const PathSegmentData&) override;
46 45
47 void emitClose(); 46 void emitClose();
48 void emitMoveTo(const FloatPoint&); 47 void emitMoveTo(const FloatPoint&);
49 void emitLineTo(const FloatPoint&); 48 void emitLineTo(const FloatPoint&);
50 void emitQuadTo(const FloatPoint&, const FloatPoint&); 49 void emitQuadTo(const FloatPoint&, const FloatPoint&);
51 void emitSmoothQuadTo(const FloatPoint&); 50 void emitSmoothQuadTo(const FloatPoint&);
52 void emitCubicTo(const FloatPoint&, const FloatPoint&, const FloatPoint&); 51 void emitCubicTo(const FloatPoint&, const FloatPoint&, const FloatPoint&);
53 void emitSmoothCubicTo(const FloatPoint&, const FloatPoint&); 52 void emitSmoothCubicTo(const FloatPoint&, const FloatPoint&);
54 void emitArcTo(const FloatPoint&, const FloatSize&, float, bool largeArc, bo ol sweep); 53 void emitArcTo(const FloatPoint&, const FloatSize&, float, bool largeArc, bo ol sweep);
55 54
56 FloatPoint smoothControl(bool isSmooth) const; 55 FloatPoint smoothControl(bool isSmooth) const;
57 56
58 Path& m_path; 57 Path& m_path;
59 58
60 SVGPathSegType m_lastCommand; 59 SVGPathSegType m_lastCommand;
61 FloatPoint m_subpathPoint; 60 FloatPoint m_subpathPoint;
62 FloatPoint m_currentPoint; 61 FloatPoint m_currentPoint;
63 FloatPoint m_lastControlPoint; 62 FloatPoint m_lastControlPoint;
64 }; 63 };
65 64
66 } // namespace blink 65 } // namespace blink
67 66
68 #endif // SVGPathBuilder_h 67 #endif // SVGPathBuilder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698