Flutter Engine
The Flutter Engine
third_party
skia
modules
svg
src
SkSVGFeGaussianBlur.cpp
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
#include "
include/effects/SkImageFilters.h
"
9
#include "
modules/svg/include/SkSVGAttributeParser.h
"
10
#include "
modules/svg/include/SkSVGFeGaussianBlur.h
"
11
#include "
modules/svg/include/SkSVGFilterContext.h
"
12
#include "
modules/svg/include/SkSVGRenderContext.h
"
13
#include "
modules/svg/include/SkSVGValue.h
"
14
15
bool
SkSVGFeGaussianBlur::parseAndSetAttribute
(
const
char
*
name
,
const
char
*
value
) {
16
return
INHERITED::parseAndSetAttribute
(
name
,
value
) ||
17
this->setStdDeviation(SkSVGAttributeParser::parse<SkSVGFeGaussianBlur::StdDeviation>(
18
"stdDeviation"
,
name
,
value
));
19
}
20
21
sk_sp<SkImageFilter>
SkSVGFeGaussianBlur::onMakeImageFilter
(
const
SkSVGRenderContext
& ctx,
22
const
SkSVGFilterContext
& fctx)
const
{
23
const
auto
sigma =
SkV2
{fStdDeviation.fX, fStdDeviation.fY}
24
* ctx.
transformForCurrentOBB
(fctx.
primitiveUnits
()).
scale
;
25
26
return
SkImageFilters::Blur
(
27
sigma.x, sigma.y,
28
fctx.
resolveInput
(ctx, this->getIn(), this->resolveColorspace(ctx, fctx)),
29
this->resolveFilterSubregion(ctx, fctx));
30
}
31
32
template
<>
33
bool
SkSVGAttributeParser::parse<SkSVGFeGaussianBlur::StdDeviation>(
34
SkSVGFeGaussianBlur::StdDeviation
* stdDeviation) {
35
std::vector<SkSVGNumberType>
values
;
36
if
(!this->
parse
(&values)) {
37
return
false
;
38
}
39
40
stdDeviation->
fX
=
values
[0];
41
stdDeviation->
fY
=
values
.size() > 1 ?
values
[1] :
values
[0];
42
return
true
;
43
}
SkImageFilters.h
SkSVGAttributeParser.h
SkSVGFeGaussianBlur.h
SkSVGFilterContext.h
SkSVGRenderContext.h
SkSVGValue.h
SkImageFilters::Blur
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
Definition:
SkBlurImageFilter.cpp:107
SkSVGFeGaussianBlur::onMakeImageFilter
sk_sp< SkImageFilter > onMakeImageFilter(const SkSVGRenderContext &, const SkSVGFilterContext &) const override
Definition:
SkSVGFeGaussianBlur.cpp:21
SkSVGFeGaussianBlur::parseAndSetAttribute
bool parseAndSetAttribute(const char *, const char *) override
Definition:
SkSVGFeGaussianBlur.cpp:15
SkSVGFe::parseAndSetAttribute
bool parseAndSetAttribute(const char *, const char *) override
Definition:
SkSVGFe.cpp:93
SkSVGFilterContext
Definition:
SkSVGFilterContext.h:21
SkSVGFilterContext::resolveInput
sk_sp< SkImageFilter > resolveInput(const SkSVGRenderContext &, const SkSVGFeInputType &) const
Definition:
SkSVGFilterContext.cpp:145
SkSVGFilterContext::primitiveUnits
const SkSVGObjectBoundingBoxUnits & primitiveUnits() const
Definition:
SkSVGFilterContext.h:33
SkSVGRenderContext
Definition:
SkSVGRenderContext.h:63
SkSVGRenderContext::transformForCurrentOBB
OBBTransform transformForCurrentOBB(SkSVGObjectBoundingBoxUnits) const
Definition:
SkSVGRenderContext.cpp:493
sk_sp< SkImageFilter >
value
uint8_t value
Definition:
fl_standard_message_codec.cc:36
flutter::name
DEF_SWITCHES_START aot vmservice shared library name
Definition:
switches.h:32
import_conformance_tests.values
tuple values
Definition:
import_conformance_tests.py:49
recipes.parse
def parse(repo_root, recipes_cfg_path)
Definition:
recipes.py:56
SkSVGFeGaussianBlur::StdDeviation
Definition:
SkSVGFeGaussianBlur.h:16
SkSVGFeGaussianBlur::StdDeviation::fX
SkSVGNumberType fX
Definition:
SkSVGFeGaussianBlur.h:17
SkSVGFeGaussianBlur::StdDeviation::fY
SkSVGNumberType fY
Definition:
SkSVGFeGaussianBlur.h:18
SkSVGRenderContext::OBBTransform::scale
SkV2 scale
Definition:
SkSVGRenderContext.h:156
SkV2
Definition:
SkM44.h:19
Generated on Sun Jun 23 2024 21:56:08 for Flutter Engine by
1.9.4