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

Unified Diff: experimental/svg/model/SkSVGAttributeParser.h

Issue 2202053002: [SVGDom/experimental] Initial SVGLength support (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review Created 4 years, 4 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
« no previous file with comments | « experimental/svg/model/SkSVGAttribute.cpp ('k') | experimental/svg/model/SkSVGAttributeParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/svg/model/SkSVGAttributeParser.h
diff --git a/experimental/svg/model/SkSVGAttributeParser.h b/experimental/svg/model/SkSVGAttributeParser.h
new file mode 100644
index 0000000000000000000000000000000000000000..aef028650481c8458ce2fa02cd9e3c017999b9e9
--- /dev/null
+++ b/experimental/svg/model/SkSVGAttributeParser.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkSVGAttributeParser_DEFINED
+#define SkSVGAttributeParser_DEFINED
+
+#include "SkSVGTypes.h"
+
+class SkSVGAttributeParser : public SkNoncopyable {
+public:
+ SkSVGAttributeParser(const char[]);
+
+ bool parseColor(SkSVGColor*);
+ bool parseNumber(SkSVGNumber*);
+ bool parseLength(SkSVGLength*);
+
+private:
+ // Stack-only
+ void* operator new(size_t) = delete;
+ void* operator new(size_t, void*) = delete;
+
+ template <typename F>
+ bool advanceWhile(F func);
+
+ bool parseWSToken();
+ bool parseEOSToken();
+ bool parseSepToken();
+ bool parseExpectedStringToken(const char*);
+ bool parseScalarToken(SkScalar*);
+ bool parseHexToken(uint32_t*);
+ bool parseLengthUnitToken(SkSVGLength::Unit*);
+ bool parseNamedColorToken(SkColor*);
+ bool parseHexColorToken(SkColor*);
+
+ // The current position in the input string.
+ const char* fCurPos;
+
+ typedef SkNoncopyable INHERITED;
+};
+
+#endif // SkSVGAttributeParser_DEFINED
« no previous file with comments | « experimental/svg/model/SkSVGAttribute.cpp ('k') | experimental/svg/model/SkSVGAttributeParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698