Flutter Engine
The Flutter Engine
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
9
15
16bool SkSVGFeMergeNode::parseAndSetAttribute(const char* name, const char* value) {
18 this->setIn(SkSVGAttributeParser::parse<SkSVGFeInputType>("in", name, value));
19}
20
22 const SkSVGFilterContext& fctx) const {
23 const SkSVGColorspace colorspace = this->resolveColorspace(ctx, fctx);
24
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
37std::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}
SkSVGColorspace
Definition: SkSVGTypes.h:719
static sk_sp< SkImageFilter > Merge(sk_sp< SkImageFilter > *const filters, int count, const CropRect &cropRect={})
skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren
bool parseAndSetAttribute(const char *, const char *) override
std::vector< SkSVGFeInputType > getInputs() const override
sk_sp< SkImageFilter > onMakeImageFilter(const SkSVGRenderContext &, const SkSVGFilterContext &) const override
virtual SkSVGColorspace resolveColorspace(const SkSVGRenderContext &, const SkSVGFilterContext &) const
Definition: SkSVGFe.cpp:84
sk_sp< SkImageFilter > resolveInput(const SkSVGRenderContext &, const SkSVGFeInputType &) const
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition: SkSVGNode.cpp:90
void reserve(int n)
Definition: SkTArray.h:170
int size() const
Definition: SkTArray.h:421
uint8_t value
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32