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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « experimental/svg/model/SkSVGDOM.cpp ('k') | experimental/svg/model/SkSVGNode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkSVGNode_DEFINED 8 #ifndef SkSVGNode_DEFINED
9 #define SkSVGNode_DEFINED 9 #define SkSVGNode_DEFINED
10 10
(...skipping 13 matching lines...) Expand all
24 }; 24 };
25 25
26 class SkSVGNode : public SkRefCnt { 26 class SkSVGNode : public SkRefCnt {
27 public: 27 public:
28 virtual ~SkSVGNode(); 28 virtual ~SkSVGNode();
29 29
30 SkSVGTag tag() const { return fTag; } 30 SkSVGTag tag() const { return fTag; }
31 31
32 virtual void appendChild(sk_sp<SkSVGNode>) = 0; 32 virtual void appendChild(sk_sp<SkSVGNode>) = 0;
33 33
34 void render(SkCanvas*, const SkSVGRenderContext&) const; 34 void render(const SkSVGRenderContext&) const;
35 35
36 void setAttribute(SkSVGAttribute, const SkSVGValue&); 36 void setAttribute(SkSVGAttribute, const SkSVGValue&);
37 37
38 protected: 38 protected:
39 SkSVGNode(SkSVGTag); 39 SkSVGNode(SkSVGTag);
40 40
41 virtual void onRender(SkCanvas*, const SkSVGRenderContext&) const = 0; 41 // Called before onRender(), to apply local attributes to the context. Unli ke onRender(),
42 // onPrepareToRender() bubbles up the inheritance chain: overriders should a lways call
43 // INHERITED::onPrepareToRender(), unless they intend to short-circuit rende ring
44 // (return false).
45 // Implementations are expected to return true if rendering is to continue, or false if
46 // the node/subtree rendering is disabled.
47 virtual bool onPrepareToRender(SkSVGRenderContext*) const;
48
49 virtual void onRender(const SkSVGRenderContext&) const = 0;
42 50
43 virtual void onSetAttribute(SkSVGAttribute, const SkSVGValue&); 51 virtual void onSetAttribute(SkSVGAttribute, const SkSVGValue&);
44 52
45 virtual const SkMatrix& onLocalMatrix() const;
46
47 private: 53 private:
48 SkSVGTag fTag; 54 SkSVGTag fTag;
49 55
50 // FIXME: this should be sparse 56 // FIXME: this should be sparse
51 SkSVGPresentationAttributes fPresentationAttributes; 57 SkSVGPresentationAttributes fPresentationAttributes;
52 58
53 typedef SkRefCnt INHERITED; 59 typedef SkRefCnt INHERITED;
54 }; 60 };
55 61
56 #endif // SkSVGNode_DEFINED 62 #endif // SkSVGNode_DEFINED
OLDNEW
« 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