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

Side by Side Diff: experimental/svg/model/SkSVGSVG.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/SkSVGRenderContext.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 14
14 class SkSVGSVG : public SkSVGContainer { 15 class SkSVGSVG : public SkSVGContainer {
15 public: 16 public:
16 virtual ~SkSVGSVG() = default; 17 virtual ~SkSVGSVG() = default;
17 18
18 static sk_sp<SkSVGSVG> Make() { return sk_sp<SkSVGSVG>(new SkSVGSVG()); } 19 static sk_sp<SkSVGSVG> Make() { return sk_sp<SkSVGSVG>(new SkSVGSVG()); }
19 20
20 void setX(const SkSVGLength&); 21 void setX(const SkSVGLength&);
21 void setY(const SkSVGLength&); 22 void setY(const SkSVGLength&);
22 void setWidth(const SkSVGLength&); 23 void setWidth(const SkSVGLength&);
23 void setHeight(const SkSVGLength&); 24 void setHeight(const SkSVGLength&);
25 void setViewBox(const SkSVGViewBoxType&);
24 26
25 protected: 27 protected:
28 bool onPrepareToRender(SkSVGRenderContext*) const override;
29
26 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override; 30 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
27 31
28 private: 32 private:
29 SkSVGSVG(); 33 SkSVGSVG();
30 34
31 SkSVGLength fX = SkSVGLength(0); 35 SkSVGLength fX = SkSVGLength(0);
32 SkSVGLength fY = SkSVGLength(0); 36 SkSVGLength fY = SkSVGLength(0);
33 SkSVGLength fWidth = SkSVGLength(100, SkSVGLength::Unit::kPercentage); 37 SkSVGLength fWidth = SkSVGLength(100, SkSVGLength::Unit::kPercentage);
34 SkSVGLength fHeight = SkSVGLength(100, SkSVGLength::Unit::kPercentage); 38 SkSVGLength fHeight = SkSVGLength(100, SkSVGLength::Unit::kPercentage);
35 39
40 SkTLazy<SkSVGViewBoxType> fViewBox;
41
36 typedef SkSVGContainer INHERITED; 42 typedef SkSVGContainer INHERITED;
37 }; 43 };
38 44
39 #endif // SkSVGSVG_DEFINED 45 #endif // SkSVGSVG_DEFINED
OLDNEW
« no previous file with comments | « experimental/svg/model/SkSVGRenderContext.cpp ('k') | experimental/svg/model/SkSVGSVG.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698