Flutter Engine
The Flutter Engine
third_party
skia
modules
svg
src
SkSVGFeMerge.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2024 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 "
modules/svg/include/SkSVGFeMerge.h
"
9
10
#include "
include/core/SkImageFilter.h
"
11
#include "
include/effects/SkImageFilters.h
"
12
#include "
include/private/base/SkTArray.h
"
13
#include "
modules/svg/include/SkSVGFilterContext.h
"
14
#include "
modules/svg/include/SkSVGNode.h
"
15
16
bool
SkSVGFeMergeNode::parseAndSetAttribute
(
const
char
*
name
,
const
char
*
value
) {
17
return
INHERITED::parseAndSetAttribute
(
name
,
value
) ||
18
this->setIn(SkSVGAttributeParser::parse<SkSVGFeInputType>(
"in"
,
name
,
value
));
19
}
20
21
sk_sp<SkImageFilter>
SkSVGFeMerge::onMakeImageFilter
(
const
SkSVGRenderContext
& ctx,
22
const
SkSVGFilterContext
& fctx)
const
{
23
const
SkSVGColorspace
colorspace = this->
resolveColorspace
(ctx, fctx);
24
25
skia_private::STArray<8, sk_sp<SkImageFilter>
> merge_node_filters;
26
merge_node_filters.
reserve
(
fChildren
.
size
());
27
28
this->forEachChild<SkSVGFeMergeNode>([&](
const
SkSVGFeMergeNode
* child) {
29
merge_node_filters.
push_back
(fctx.
resolveInput
(ctx, child->getIn(), colorspace));
30
});
31
32
return
SkImageFilters::Merge
(merge_node_filters.
data
(),
33
merge_node_filters.
size
(),
34
this->resolveFilterSubregion(ctx, fctx));
35
}
36
37
std::vector<SkSVGFeInputType>
SkSVGFeMerge::getInputs
()
const
{
38
std::vector<SkSVGFeInputType>
inputs
;
39
inputs
.reserve(
fChildren
.
size
());
40
41
this->forEachChild<SkSVGFeMergeNode>([&](
const
SkSVGFeMergeNode
* child) {
42
inputs
.push_back(child->getIn());
43
});
44
45
return
inputs
;
46
}
SkImageFilter.h
SkImageFilters.h
SkSVGFeMerge.h
SkSVGFilterContext.h
SkSVGNode.h
SkSVGColorspace
SkSVGColorspace
Definition:
SkSVGTypes.h:719
SkTArray.h
SkImageFilters::Merge
static sk_sp< SkImageFilter > Merge(sk_sp< SkImageFilter > *const filters, int count, const CropRect &cropRect={})
Definition:
SkMergeImageFilter.cpp:55
SkSVGContainer::fChildren
skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren
Definition:
SkSVGContainer.h:39
SkSVGFeMergeNode
Definition:
SkSVGFeMerge.h:17
SkSVGFeMergeNode::parseAndSetAttribute
bool parseAndSetAttribute(const char *, const char *) override
Definition:
SkSVGFeMerge.cpp:16
SkSVGFeMerge::getInputs
std::vector< SkSVGFeInputType > getInputs() const override
Definition:
SkSVGFeMerge.cpp:37
SkSVGFeMerge::onMakeImageFilter
sk_sp< SkImageFilter > onMakeImageFilter(const SkSVGRenderContext &, const SkSVGFilterContext &) const override
Definition:
SkSVGFeMerge.cpp:21
SkSVGFe::resolveColorspace
virtual SkSVGColorspace resolveColorspace(const SkSVGRenderContext &, const SkSVGFilterContext &) const
Definition:
SkSVGFe.cpp:84
SkSVGFilterContext
Definition:
SkSVGFilterContext.h:21
SkSVGFilterContext::resolveInput
sk_sp< SkImageFilter > resolveInput(const SkSVGRenderContext &, const SkSVGFeInputType &) const
Definition:
SkSVGFilterContext.cpp:145
SkSVGNode::parseAndSetAttribute
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition:
SkSVGNode.cpp:90
SkSVGRenderContext
Definition:
SkSVGRenderContext.h:63
sk_sp< SkImageFilter >
skia_private::STArray
Definition:
SkTArray.h:754
skia_private::TArray::reserve
void reserve(int n)
Definition:
SkTArray.h:170
skia_private::TArray::data
T * data()
Definition:
SkTArray.h:419
skia_private::TArray::size
int size() const
Definition:
SkTArray.h:421
skia_private::TArray::push_back
T & push_back()
Definition:
SkTArray.h:205
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
gn.compile_sksl_tests.inputs
inputs
Definition:
compile_sksl_tests.py:24
Generated on Sun Jun 23 2024 21:56:08 for Flutter Engine by
1.9.4