diff options
author | fmalita <fmalita@chromium.org> | 2016-08-08 12:58:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-08 12:58:57 -0700 |
commit | c97796b47b2f3e0ca8c04073c1576db21b58eedb (patch) | |
tree | f77603d9a868ee5f9cc2a9d54d67c2ea57a1ff07 /experimental/svg/model/SkSVGAttributeParser.h | |
parent | 9dcdc352c14eb95a833961b22682ed9900059dae (diff) |
[SVGDom] Improved transform parsing
Update 'transform' attribute parsing to a more robust, SkSVGAttributeParser-based implementation.
R=robertphillips@google.com,stephana@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2220933003
Review-Url: https://codereview.chromium.org/2220933003
Diffstat (limited to 'experimental/svg/model/SkSVGAttributeParser.h')
-rw-r--r-- | experimental/svg/model/SkSVGAttributeParser.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/experimental/svg/model/SkSVGAttributeParser.h b/experimental/svg/model/SkSVGAttributeParser.h index cd50479fee..c616113d6b 100644 --- a/experimental/svg/model/SkSVGAttributeParser.h +++ b/experimental/svg/model/SkSVGAttributeParser.h @@ -18,6 +18,7 @@ public: bool parseNumber(SkSVGNumberType*); bool parseLength(SkSVGLength*); bool parseViewBox(SkSVGViewBoxType*); + bool parseTransform(SkSVGTransformType*); private: // Stack-only @@ -37,6 +38,19 @@ private: bool parseNamedColorToken(SkColor*); bool parseHexColorToken(SkColor*); + // Transform helpers + bool parseMatrixToken(SkMatrix*); + bool parseTranslateToken(SkMatrix*); + bool parseScaleToken(SkMatrix*); + bool parseRotateToken(SkMatrix*); + bool parseSkewXToken(SkMatrix*); + bool parseSkewYToken(SkMatrix*); + + // Parses a sequence of 'WS* <prefix> WS* (<nested>)', where the nested sequence + // is handled by the passed functor. + template <typename Func, typename T> + bool parseParenthesized(const char* prefix, Func, T* result); + // The current position in the input string. const char* fCurPos; |