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

Side by Side Diff: experimental/svg/model/SkSVGSVG.h

Issue 2345533002: [SVGDom] Expose intrinsic size info (Closed)
Patch Set: private intrinsicSize() Created 4 years, 3 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/SkSVGSVG.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 SkSVGSVG_DEFINED 8 #ifndef SkSVGSVG_DEFINED
9 #define SkSVGSVG_DEFINED 9 #define SkSVGSVG_DEFINED
10 10
11 #include "SkSVGContainer.h" 11 #include "SkSVGContainer.h"
12 #include "SkSVGTypes.h" 12 #include "SkSVGTypes.h"
13 #include "SkTLazy.h" 13 #include "SkTLazy.h"
14 14
15 class SkSVGLengthContext;
16
15 class SkSVGSVG : public SkSVGContainer { 17 class SkSVGSVG : public SkSVGContainer {
16 public: 18 public:
17 virtual ~SkSVGSVG() = default; 19 virtual ~SkSVGSVG() = default;
18 20
19 static sk_sp<SkSVGSVG> Make() { return sk_sp<SkSVGSVG>(new SkSVGSVG()); } 21 static sk_sp<SkSVGSVG> Make() { return sk_sp<SkSVGSVG>(new SkSVGSVG()); }
20 22
21 void setX(const SkSVGLength&); 23 void setX(const SkSVGLength&);
22 void setY(const SkSVGLength&); 24 void setY(const SkSVGLength&);
23 void setWidth(const SkSVGLength&); 25 void setWidth(const SkSVGLength&);
24 void setHeight(const SkSVGLength&); 26 void setHeight(const SkSVGLength&);
25 void setViewBox(const SkSVGViewBoxType&); 27 void setViewBox(const SkSVGViewBoxType&);
26 28
29 SkSize intrinsicSize(const SkSVGLengthContext&) const;
30
27 protected: 31 protected:
28 bool onPrepareToRender(SkSVGRenderContext*) const override; 32 bool onPrepareToRender(SkSVGRenderContext*) const override;
29 33
30 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override; 34 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
31 35
32 private: 36 private:
33 SkSVGSVG(); 37 SkSVGSVG();
34 38
35 SkSVGLength fX = SkSVGLength(0); 39 SkSVGLength fX = SkSVGLength(0);
36 SkSVGLength fY = SkSVGLength(0); 40 SkSVGLength fY = SkSVGLength(0);
37 SkSVGLength fWidth = SkSVGLength(100, SkSVGLength::Unit::kPercentage); 41 SkSVGLength fWidth = SkSVGLength(100, SkSVGLength::Unit::kPercentage);
38 SkSVGLength fHeight = SkSVGLength(100, SkSVGLength::Unit::kPercentage); 42 SkSVGLength fHeight = SkSVGLength(100, SkSVGLength::Unit::kPercentage);
39 43
40 SkTLazy<SkSVGViewBoxType> fViewBox; 44 SkTLazy<SkSVGViewBoxType> fViewBox;
41 45
42 typedef SkSVGContainer INHERITED; 46 typedef SkSVGContainer INHERITED;
43 }; 47 };
44 48
45 #endif // SkSVGSVG_DEFINED 49 #endif // SkSVGSVG_DEFINED
OLDNEW
« no previous file with comments | « experimental/svg/model/SkSVGDOM.cpp ('k') | experimental/svg/model/SkSVGSVG.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698