Debian Codegraph @

modules/svg/include/SkSVGFeBlend.h

raw
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 SkSVGFeBlend_DEFINED
9 #define SkSVGFeBlend_DEFINED
10
11 #include "include/core/SkRefCnt.h"
12 #include "include/private/base/SkAPI.h"
13 #include "modules/svg/include/SkSVGFe.h"
14 #include "modules/svg/include/SkSVGNode.h"
15 #include "modules/svg/include/SkSVGTypes.h"
16
17 #include <vector>
18
19 class SkImageFilter;
20 class SkSVGFilterContext;
21 class SkSVGRenderContext;
22
23 class SK_API SkSVGFeBlend : public SkSVGFe {
24 public:
25 enum class Mode {
26 kNormal,
27 kMultiply,
28 kScreen,
29 kDarken,
30 kLighten,
31 };
32
33 static sk_sp<SkSVGFeBlend> Make() { return sk_sp<SkSVGFeBlend>(new SkSVGFeBlend()); }
34
35 SVG_ATTR(Mode, Mode, Mode::kNormal)
36 SVG_ATTR(In2, SkSVGFeInputType, SkSVGFeInputType())
37
38 protected:
39 sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&,
40 const SkSVGFilterContext&) const override;
41
42 std::vector<SkSVGFeInputType> getInputs() const override {
43 return {this->getIn(), this->getIn2()};
44 }
45
46 bool parseAndSetAttribute(const char*, const char*) override;
47
48 private:
49 SkSVGFeBlend() : INHERITED(SkSVGTag::kFeBlend) {}
50
51 using INHERITED = SkSVGFe;
52 };
53
54 #endif // SkSVGFeBlend_DEFINED