Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSVGFeBlend.h
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#ifndef SkSVGFeBlend_DEFINED
9#define SkSVGFeBlend_DEFINED
10
13
14class SK_API SkSVGFeBlend : public SkSVGFe {
15public:
16 enum class Mode {
17 kNormal,
19 kScreen,
20 kDarken,
22 };
23
25
26 SVG_ATTR(Mode, Mode, Mode::kNormal)
28
29protected:
30 sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&,
31 const SkSVGFilterContext&) const override;
32
33 std::vector<SkSVGFeInputType> getInputs() const override {
34 return {this->getIn(), this->getIn2()};
35 }
36
37 bool parseAndSetAttribute(const char*, const char*) override;
38
39private:
41
42 using INHERITED = SkSVGFe;
43};
44
45#endif // SkSVGFeBlend_DEFINED
#define SK_API
Definition SkAPI.h:35
@ kLighten
rc = s + d - min(s*da, d*sa), ra = kSrcOver
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kScreen
r = s + d - s*d
@ kDarken
rc = s + d - max(s*da, d*sa), ra = kSrcOver
#define INHERITED(method,...)
SkSVGTag
Definition SkSVGNode.h:23
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition SkSVGNode.h:203
static sk_sp< SkSVGFeBlend > Make()
bool parseAndSetAttribute(const char *, const char *) override
Definition SkSVGFe.cpp:93
@ kNormal
Default priority level.
Definition embedder.h:260
Definition ref_ptr.h:256