19 this->setSurfaceScale(
20 SkSVGAttributeParser::parse<SkSVGNumberType>(
"surfaceScale", n, v)) ||
21 this->setKernelUnitLength(SkSVGAttributeParser::parse<SkSVGFeLighting::KernelUnitLength>(
22 "kernelUnitLength", n, v));
26bool SkSVGAttributeParser::parse<SkSVGFeLighting::KernelUnitLength>(
28 std::vector<SkSVGNumberType>
values;
29 if (!this->
parse(&values)) {
41 switch (child->tag()) {
57 SkDebugf(
"lighting filter effect needs exactly one light source\n");
62 const auto color = this->getLightingColor();
63 if (!
color.isValue()) {
65 SkDebugf(
"unhandled: lighting-color has no value\n");
78 const auto xy =
SkV2{
x,
y} * obbt.scale + obbt.offset;
87 this->setSpecularConstant(
88 SkSVGAttributeParser::parse<SkSVGNumberType>(
"specularConstant", n, v)) ||
89 this->setSpecularExponent(
90 SkSVGAttributeParser::parse<SkSVGNumberType>(
"specularExponent", n, v));
100 this->resolveLightingColor(ctx),
101 this->getSurfaceScale(),
104 fctx.
resolveInput(ctx, this->getIn(), this->resolveColorspace(ctx, fctx)),
105 this->resolveFilterSubregion(ctx, fctx));
112 this->
resolveXYZ(ctx, fctx, light->getX(), light->getY(), light->getZ()),
113 this->resolveLightingColor(ctx),
114 this->getSurfaceScale(),
117 fctx.
resolveInput(ctx, this->getIn(), this->resolveColorspace(ctx, fctx)),
118 this->resolveFilterSubregion(ctx, fctx));
124 const auto& limitingConeAngle = light->getLimitingConeAngle();
125 const float cutoffAngle = limitingConeAngle.isValid() ? *limitingConeAngle : 180.f;
128 this->
resolveXYZ(ctx, fctx, light->getX(), light->getY(), light->getZ()),
130 ctx, fctx, light->getPointsAtX(), light->getPointsAtY(), light->getPointsAtZ()),
131 light->getSpecularExponent(),
133 this->resolveLightingColor(ctx),
134 this->getSurfaceScale(),
137 fctx.
resolveInput(ctx, this->getIn(), this->resolveColorspace(ctx, fctx)),
138 this->resolveFilterSubregion(ctx, fctx));
143 this->setDiffuseConstant(
144 SkSVGAttributeParser::parse<SkSVGNumberType>(
"diffuseConstant", n, v));
154 this->resolveLightingColor(ctx),
155 this->getSurfaceScale(),
156 this->getDiffuseConstant(),
157 fctx.
resolveInput(ctx, this->getIn(), this->resolveColorspace(ctx, fctx)),
158 this->resolveFilterSubregion(ctx, fctx));
165 this->
resolveXYZ(ctx, fctx, light->getX(), light->getY(), light->getZ()),
166 this->resolveLightingColor(ctx),
167 this->getSurfaceScale(),
168 this->getDiffuseConstant(),
169 fctx.
resolveInput(ctx, this->getIn(), this->resolveColorspace(ctx, fctx)),
170 this->resolveFilterSubregion(ctx, fctx));
176 const auto& limitingConeAngle = light->getLimitingConeAngle();
177 const float cutoffAngle = limitingConeAngle.isValid() ? *limitingConeAngle : 180.f;
180 this->
resolveXYZ(ctx, fctx, light->getX(), light->getY(), light->getZ()),
182 ctx, fctx, light->getPointsAtX(), light->getPointsAtY(), light->getPointsAtZ()),
183 light->getSpecularExponent(),
185 this->resolveLightingColor(ctx),
186 this->getSurfaceScale(),
187 this->getDiffuseConstant(),
188 fctx.
resolveInput(ctx, this->getIn(), this->resolveColorspace(ctx, fctx)),
189 this->resolveFilterSubregion(ctx, fctx));
constexpr SkColor SK_ColorWHITE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static sk_sp< SkImageFilter > PointLitDiffuse(const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DistantLitSpecular(const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DistantLitDiffuse(const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > PointLitSpecular(const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > SpotLitDiffuse(const SkPoint3 &location, const SkPoint3 &target, SkScalar falloffExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > SpotLitSpecular(const SkPoint3 &location, const SkPoint3 &target, SkScalar falloffExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren
sk_sp< SkImageFilter > makeDistantLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFeDistantLight *) const final
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
SkPoint3 computeDirection() const
virtual sk_sp< SkImageFilter > makePointLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFePointLight *) const =0
bool parseAndSetAttribute(const char *, const char *) override
sk_sp< SkImageFilter > onMakeImageFilter(const SkSVGRenderContext &, const SkSVGFilterContext &) const final
SkPoint3 resolveXYZ(const SkSVGRenderContext &, const SkSVGFilterContext &, SkSVGNumberType, SkSVGNumberType, SkSVGNumberType) const
virtual sk_sp< SkImageFilter > makeDistantLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFeDistantLight *) const =0
SkColor resolveLightingColor(const SkSVGRenderContext &) const
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
sk_sp< SkImageFilter > makeDistantLight(const SkSVGRenderContext &, const SkSVGFilterContext &, const SkSVGFeDistantLight *) const final
bool parseAndSetAttribute(const char *, const char *) override
sk_sp< SkImageFilter > resolveInput(const SkSVGRenderContext &, const SkSVGFeInputType &) const
const SkSVGObjectBoundingBoxUnits & primitiveUnits() const
SkSVGColorType resolveSvgColor(const SkSVGColor &) const
OBBTransform transformForCurrentOBB(SkSVGObjectBoundingBoxUnits) const
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
def parse(repo_root, recipes_cfg_path)
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)