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

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

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, 1 month 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/SVGPathQuery.h
diff --git a/third_party/WebKit/Source/core/svg/SVGPathByteStreamBuilder.h b/third_party/WebKit/Source/core/svg/SVGPathQuery.h
similarity index 67%
copy from third_party/WebKit/Source/core/svg/SVGPathByteStreamBuilder.h
copy to third_party/WebKit/Source/core/svg/SVGPathQuery.h
index 94cb937366856877711549988918200f68b19bb1..93295f16780409147830d3e9e7c39b0b141f7885 100644
--- a/third_party/WebKit/Source/core/svg/SVGPathByteStreamBuilder.h
+++ b/third_party/WebKit/Source/core/svg/SVGPathQuery.h
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -17,28 +18,26 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGPathByteStreamBuilder_h
-#define SVGPathByteStreamBuilder_h
-
-#include "core/svg/SVGPathConsumer.h"
+#ifndef SVGPathQuery_h
+#define SVGPathQuery_h
namespace blink {
+class FloatPoint;
class SVGPathByteStream;
-class SVGPathByteStreamBuilder final : public SVGPathConsumer {
+class SVGPathQuery {
public:
- SVGPathByteStreamBuilder(SVGPathByteStream&);
-
-private:
- void incrementPathSegmentCount() override { }
- bool continueConsuming() override { return true; }
+ explicit SVGPathQuery(const SVGPathByteStream&);
- void emitSegment(const PathSegmentData&) override;
+ float getTotalLength() const;
+ FloatPoint getPointAtLength(float length) const;
+ unsigned getPathSegIndexAtLength(float length) const;
- SVGPathByteStream& m_byteStream;
+private:
+ const SVGPathByteStream& m_pathByteStream;
};
} // namespace blink
-#endif // SVGPathByteStreamBuilder_h
+#endif // SVGPathQuery_h
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathParser.cpp ('k') | third_party/WebKit/Source/core/svg/SVGPathQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698