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

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: expectations 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..2dcadb58511d2c76ab8e7b813263c57590b120c7 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_initialPoint;
fs 2016/01/25 19:17:40 I recently asked for something similar to this to
f(malita) 2016/01/25 19:37:06 Done.
+ FloatPoint m_currentPoint;
+ FloatPoint m_lastControlPoint;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698