Debian Codegraph @

modules/svg/include/SkSVGRadialGradient.h

raw
1 /*
2 * Copyright 2017 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 SkSVGRadialGradient_DEFINED
9 #define SkSVGRadialGradient_DEFINED
10
11 #include "include/core/SkColor.h"
12 #include "include/core/SkRefCnt.h"
13 #include "include/core/SkScalar.h"
14 #include "include/private/base/SkAPI.h"
15 #include "modules/svg/include/SkSVGGradient.h"
16 #include "modules/svg/include/SkSVGNode.h"
17 #include "modules/svg/include/SkSVGTypes.h"
18
19 class SkMatrix;
20 class SkSVGRenderContext;
21 class SkShader;
22 enum class SkTileMode;
23
24 class SK_API SkSVGRadialGradient final : public SkSVGGradient {
25 public:
26 static sk_sp<SkSVGRadialGradient> Make() {
27 return sk_sp<SkSVGRadialGradient>(new SkSVGRadialGradient());
28 }
29
30 SVG_ATTR(Cx, SkSVGLength, SkSVGLength(50, SkSVGLength::Unit::kPercentage))
31 SVG_ATTR(Cy, SkSVGLength, SkSVGLength(50, SkSVGLength::Unit::kPercentage))
32 SVG_ATTR(R, SkSVGLength, SkSVGLength(50, SkSVGLength::Unit::kPercentage))
33 SVG_OPTIONAL_ATTR(Fx, SkSVGLength)
34 SVG_OPTIONAL_ATTR(Fy, SkSVGLength)
35
36 protected:
37 bool parseAndSetAttribute(const char*, const char*) override;
38
39 sk_sp<SkShader> onMakeShader(const SkSVGRenderContext&,
40 const SkColor4f*, const SkScalar*, int count,
41 SkTileMode, const SkMatrix&) const override;
42 private:
43 SkSVGRadialGradient();
44
45 using INHERITED = SkSVGGradient;
46 };
47
48 #endif // SkSVGRadialGradient_DEFINED