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

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: cleanup Created 4 years, 5 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: 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..a99933b7bf2a1a066b518ecbe6333a651517c9d5
--- /dev/null
+++ b/experimental/svg/model/SkSVGAttributeParser.h
@@ -0,0 +1,44 @@
+/*
+ * 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 parseWSAtom();
+ bool parseEOSAtom();
+ bool parseSepAtom();
+ bool parseStringAtom(const char*);
+ bool parseScalarAtom(SkScalar*);
+ bool parseHexAtom(uint32_t*);
+ bool parseLengthUnitAtom(SkSVGLength::Unit*);
+ bool parseNamedColorAtom(SkColor*);
+ bool parseHexColorAtom(SkColor*);
+
robertphillips 2016/08/02 22:25:56 fCurPos ? // The current position in the input st
f(malita) 2016/08/03 16:50:51 Done.
+ const char* fChr;
+
robertphillips 2016/08/02 22:25:56 everyone else uses a typedef here
f(malita) 2016/08/03 16:50:51 I thought 'using' is preferred since c++11, but no
+ using INHERITED = SkNoncopyable;
+};
+
+#endif // SkSVGAttributeParser_DEFINED

Powered by Google App Engine
This is Rietveld 408576698