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

Unified Diff: third_party/WebKit/Source/core/svg/SVGPathBuilder.h

Issue 1623073003: [SVG] Paint unnormalized paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed review comments Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/SVGPathBuilder.h
diff --git a/third_party/WebKit/Source/core/svg/SVGPathBuilder.h b/third_party/WebKit/Source/core/svg/SVGPathBuilder.h
index 6cbe279fb5c1327aa4c667ce5fdce6158dad00c2..522bee4be769ae45792de594e70f13fd33d6a58c 100644
--- a/third_party/WebKit/Source/core/svg/SVGPathBuilder.h
+++ b/third_party/WebKit/Source/core/svg/SVGPathBuilder.h
@@ -25,19 +25,42 @@
#define SVGPathBuilder_h
#include "core/svg/SVGPathConsumer.h"
+#include "core/svg/SVGPathData.h"
+#include "platform/geometry/FloatPoint.h"
namespace blink {
+class FloatSize;
class Path;
class SVGPathBuilder final : public SVGPathConsumer {
public:
- SVGPathBuilder(Path& path) : m_path(path) { }
+ SVGPathBuilder(Path& path)
+ : m_path(path)
+ // Starting in ClosePath state ensures correct handling of the first moveTo.
+ , m_lastCommand(PathSegClosePath)
+ { }
private:
void emitSegment(const PathSegmentData&) override;
+ void emitClose();
+ void emitMoveTo(const FloatPoint&);
+ void emitLineTo(const FloatPoint&);
+ void emitQuadTo(const FloatPoint&, const FloatPoint&);
+ void emitSmoothQuadTo(const FloatPoint&);
+ void emitCubicTo(const FloatPoint&, const FloatPoint&, const FloatPoint&);
+ void emitSmoothCubicTo(const FloatPoint&, const FloatPoint&);
+ void emitArcTo(const FloatPoint&, const FloatSize&, float, bool largeArc, bool sweep);
+
+ FloatPoint smoothControl(bool isSmooth) const;
+
Path& m_path;
+
+ SVGPathSegType m_lastCommand;
+ FloatPoint m_subpathPoint;
+ FloatPoint m_currentPoint;
+ FloatPoint m_lastControlPoint;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h ('k') | third_party/WebKit/Source/core/svg/SVGPathBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698