diff options
author | fmalita <fmalita@chromium.org> | 2016-08-08 11:38:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-08 11:38:55 -0700 |
commit | 397a517d1a5774653fcdd08172f9a6b5eea67621 (patch) | |
tree | ab9c9aaa4121a8033a29f259401bcecf7d178203 /experimental/svg/model/SkSVGAttribute.h | |
parent | f621ff49a288978c272d5ae069a6a1c04c74642b (diff) |
[SVGDom] Add viewBox support
The main feature is <svg> viewBox and proper viewport support, but the CL
touches a few other things:
* refactor SkSVGRenderContext to auto-restore canvas state, and split the
presentation bits into a separate CoW SkSVGPresentationContext
* introduce SkSVGNode::onPrepareToRender(), as a way for nodes to push their
custom state before the actual onRender() call (instead of relying on
non-virtual SkSVGNode to know about all possible state bits)
* add a "Type" suffix to SVG types, to disambiguate (e.g. SkSVGRectType vs.
SkSVGRect)
R=robertphillips@google.com,stephana@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2222793002
Review-Url: https://codereview.chromium.org/2222793002
Diffstat (limited to 'experimental/svg/model/SkSVGAttribute.h')
-rw-r--r-- | experimental/svg/model/SkSVGAttribute.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/experimental/svg/model/SkSVGAttribute.h b/experimental/svg/model/SkSVGAttribute.h index 64465b13c9..d05737b69f 100644 --- a/experimental/svg/model/SkSVGAttribute.h +++ b/experimental/svg/model/SkSVGAttribute.h @@ -11,12 +11,15 @@ #include "SkSVGTypes.h" #include "SkTLazy.h" +class SkSVGRenderContext; + enum class SkSVGAttribute { kD, kFill, kHeight, kStroke, kTransform, + kViewBox, kWidth, kX, kY, @@ -24,21 +27,19 @@ enum class SkSVGAttribute { kUnknown, }; -class SkSVGRenderContext; - class SkSVGPresentationAttributes { public: SkSVGPresentationAttributes(); - void setFill(const SkSVGColor&); - void setStroke(const SkSVGColor&); + void setFill(const SkSVGColorType&); + void setStroke(const SkSVGColorType&); - void applyTo(SkTCopyOnFirstWrite<SkSVGRenderContext>&) const; + void applyTo(SkSVGRenderContext*) const; private: // Color only for now. - SkSVGColor fFill; - SkSVGColor fStroke; + SkSVGColorType fFill; + SkSVGColorType fStroke; unsigned fFillIsSet : 1; unsigned fStrokeIsSet : 1; |