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

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

Issue 2222793002: [SVGDom] Add <svg> viewBox support (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: typo 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/SkSVGDOM.cpp ('k') | experimental/svg/model/SkSVGNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/svg/model/SkSVGNode.h
diff --git a/experimental/svg/model/SkSVGNode.h b/experimental/svg/model/SkSVGNode.h
index 168b03c73bc2e152bdcbe8e9d6eacb46d258998f..38a17d86338efa6197a64f3d86cac0cf05216533 100644
--- a/experimental/svg/model/SkSVGNode.h
+++ b/experimental/svg/model/SkSVGNode.h
@@ -31,18 +31,24 @@ public:
virtual void appendChild(sk_sp<SkSVGNode>) = 0;
- void render(SkCanvas*, const SkSVGRenderContext&) const;
+ void render(const SkSVGRenderContext&) const;
void setAttribute(SkSVGAttribute, const SkSVGValue&);
protected:
SkSVGNode(SkSVGTag);
- virtual void onRender(SkCanvas*, const SkSVGRenderContext&) const = 0;
+ // Called before onRender(), to apply local attributes to the context. Unlike onRender(),
+ // onPrepareToRender() bubbles up the inheritance chain: overriders should always call
+ // INHERITED::onPrepareToRender(), unless they intend to short-circuit rendering
+ // (return false).
+ // Implementations are expected to return true if rendering is to continue, or false if
+ // the node/subtree rendering is disabled.
+ virtual bool onPrepareToRender(SkSVGRenderContext*) const;
- virtual void onSetAttribute(SkSVGAttribute, const SkSVGValue&);
+ virtual void onRender(const SkSVGRenderContext&) const = 0;
- virtual const SkMatrix& onLocalMatrix() const;
+ virtual void onSetAttribute(SkSVGAttribute, const SkSVGValue&);
private:
SkSVGTag fTag;
« no previous file with comments | « experimental/svg/model/SkSVGDOM.cpp ('k') | experimental/svg/model/SkSVGNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698