/src/skia/modules/svg/include/SkSVGFeComposite.h
Line | Count | Source |
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 SkSVGFeComposite_DEFINED |
9 | | #define SkSVGFeComposite_DEFINED |
10 | | |
11 | | #include "include/core/SkBlendMode.h" |
12 | | #include "modules/svg/include/SkSVGFe.h" |
13 | | #include "modules/svg/include/SkSVGTypes.h" |
14 | | |
15 | | class SK_API SkSVGFeComposite final : public SkSVGFe { |
16 | | public: |
17 | 1 | static sk_sp<SkSVGFeComposite> Make() { |
18 | 1 | return sk_sp<SkSVGFeComposite>(new SkSVGFeComposite()); |
19 | 1 | } |
20 | | |
21 | | SVG_ATTR(In2, SkSVGFeInputType, SkSVGFeInputType()) |
22 | | SVG_ATTR(K1, SkSVGNumberType, SkSVGNumberType(0)) |
23 | | SVG_ATTR(K2, SkSVGNumberType, SkSVGNumberType(0)) |
24 | | SVG_ATTR(K3, SkSVGNumberType, SkSVGNumberType(0)) |
25 | | SVG_ATTR(K4, SkSVGNumberType, SkSVGNumberType(0)) |
26 | | SVG_ATTR(Operator, SkSVGFeCompositeOperator, SkSVGFeCompositeOperator::kOver) |
27 | | |
28 | | protected: |
29 | | sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&, |
30 | | const SkSVGFilterContext&) const override; |
31 | | |
32 | 22 | std::vector<SkSVGFeInputType> getInputs() const override { |
33 | 22 | return {this->getIn(), this->getIn2()}; |
34 | 22 | } |
35 | | |
36 | | bool parseAndSetAttribute(const char*, const char*) override; |
37 | | |
38 | | private: |
39 | 1 | SkSVGFeComposite() : INHERITED(SkSVGTag::kFeComposite) {} |
40 | | |
41 | | static SkBlendMode BlendModeForOperator(SkSVGFeCompositeOperator); |
42 | | |
43 | | using INHERITED = SkSVGFe; |
44 | | }; |
45 | | |
46 | | #endif // SkSVGFeComposite_DEFINED |