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

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

Issue 2327233003: [SVGDom] Initial linear gradient support (Closed)
Patch Set: cleanup 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkSVGLinearGradient_DEFINED
9 #define SkSVGLinearGradient_DEFINED
10
11 #include "SkSVGHiddenContainer.h"
12 #include "SkSVGTypes.h"
13
14 class SkSVGLinearGradient : public SkSVGHiddenContainer {
15 public:
16 virtual ~SkSVGLinearGradient() = default;
17 static sk_sp<SkSVGLinearGradient> Make() {
18 return sk_sp<SkSVGLinearGradient>(new SkSVGLinearGradient());
19 }
20
21 void setHref(const SkSVGStringType&);
22 void setX1(const SkSVGLength&);
23 void setY1(const SkSVGLength&);
24 void setX2(const SkSVGLength&);
25 void setY2(const SkSVGLength&);
26
27 protected:
28 bool onAsPaint(const SkSVGRenderContext&, SkPaint*) const override;
29
30 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
31
32 private:
33 SkSVGLinearGradient();
34
35 void collectColorStops(const SkSVGRenderContext&,
36 SkSTArray<2, SkScalar, true>*,
37 SkSTArray<2, SkColor, true>*) const;
38
39 SkSVGLength fX1 = SkSVGLength(0 , SkSVGLength::Unit::kPercentage);
40 SkSVGLength fY1 = SkSVGLength(0 , SkSVGLength::Unit::kPercentage);
41 SkSVGLength fX2 = SkSVGLength(100, SkSVGLength::Unit::kPercentage);
robertphillips 2016/09/12 19:31:52 fY2 isn't 100 too ?
f(malita) 2016/09/12 19:52:09 Heh, you would think so (and that's how I wrote it
42 SkSVGLength fY2 = SkSVGLength(0 , SkSVGLength::Unit::kPercentage);
43
44 SkSVGStringType fHref;
45
46 typedef SkSVGHiddenContainer INHERITED;
47 };
48
49 #endif // SkSVGLinearGradient_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698