Flutter Engine
The Flutter Engine
SkSVGFeLighting.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 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 SkSVGFeLighting_DEFINED
9#define SkSVGFeLighting_DEFINED
10
13
17
19public:
23 };
24
25 SVG_ATTR(SurfaceScale, SkSVGNumberType, 1)
27
28protected:
30
31 std::vector<SkSVGFeInputType> getInputs() const final { return {this->getIn()}; }
32
33 bool parseAndSetAttribute(const char*, const char*) override;
34
36 const SkSVGFilterContext&) const final;
37
39 const SkSVGFilterContext&,
40 const SkSVGFeDistantLight*) const = 0;
41
43 const SkSVGFilterContext&,
44 const SkSVGFePointLight*) const = 0;
45
47 const SkSVGFilterContext&,
48 const SkSVGFeSpotLight*) const = 0;
49
50 SkColor resolveLightingColor(const SkSVGRenderContext&) const;
51
52 SkPoint3 resolveXYZ(const SkSVGRenderContext&,
53 const SkSVGFilterContext&,
56 SkSVGNumberType) const;
57
58private:
59 using INHERITED = SkSVGFe;
60};
61
63public:
66 }
67
68 SVG_ATTR(SpecularConstant, SkSVGNumberType, 1)
69 SVG_ATTR(SpecularExponent, SkSVGNumberType, 1)
70
71protected:
72 bool parseAndSetAttribute(const char*, const char*) override;
73
75 const SkSVGFilterContext&,
76 const SkSVGFeDistantLight*) const final;
77
79 const SkSVGFilterContext&,
80 const SkSVGFePointLight*) const final;
81
83 const SkSVGFilterContext&,
84 const SkSVGFeSpotLight*) const final;
85
86private:
88
89 using INHERITED = SkSVGFeLighting;
90};
91
93public:
96 }
97
98 SVG_ATTR(DiffuseConstant, SkSVGNumberType, 1)
99
100protected:
101 bool parseAndSetAttribute(const char*, const char*) override;
102
104 const SkSVGFilterContext&,
105 const SkSVGFeDistantLight*) const final;
106
108 const SkSVGFilterContext&,
109 const SkSVGFePointLight*) const final;
110
112 const SkSVGFilterContext&,
113 const SkSVGFeSpotLight*) const final;
114
115private:
117
118 using INHERITED = SkSVGFeLighting;
119};
120
121#endif // SkSVGFeLighting_DEFINED
#define SK_API
Definition: SkAPI.h:35
uint32_t SkColor
Definition: SkColor.h:37
#define SVG_OPTIONAL_ATTR(attr_name, attr_type)
Definition: SkSVGNode.h:220
SkSVGTag
Definition: SkSVGNode.h:23
@ kFeSpecularLighting
@ kFeDiffuseLighting
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition: SkSVGNode.h:210
SkScalar SkSVGNumberType
Definition: SkSVGTypes.h:27
sk_sp< SkImageFilter > makeDistantLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFeDistantLight *) const final
static sk_sp< SkSVGFeDiffuseLighting > Make()
sk_sp< SkImageFilter > makePointLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFePointLight *) const final
sk_sp< SkImageFilter > makeSpotLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFeSpotLight *) const final
bool parseAndSetAttribute(const char *, const char *) override
virtual sk_sp< SkImageFilter > makePointLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFePointLight *) const =0
std::vector< SkSVGFeInputType > getInputs() const final
SkSVGFeLighting(SkSVGTag t)
virtual sk_sp< SkImageFilter > makeDistantLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFeDistantLight *) const =0
virtual sk_sp< SkImageFilter > makeSpotLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFeSpotLight *) const =0
sk_sp< SkImageFilter > makeSpotLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFeSpotLight *) const final
bool parseAndSetAttribute(const char *, const char *) override
sk_sp< SkImageFilter > makePointLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFePointLight *) const final
static sk_sp< SkSVGFeSpecularLighting > Make()
sk_sp< SkImageFilter > makeDistantLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFeDistantLight *) const final
bool parseAndSetAttribute(const char *, const char *) override
Definition: SkSVGFe.cpp:93
SkSVGFe(SkSVGTag t)
Definition: SkSVGFe.h:67
virtual sk_sp< SkImageFilter > onMakeImageFilter(const SkSVGRenderContext &, const SkSVGFilterContext &) const =0