Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
modules
sksg
include
SkSGMaskEffect.h
Go to the documentation of this file.
1
/*
2
* Copyright 2018 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 SkSGMaskEffect_DEFINED
9
#define SkSGMaskEffect_DEFINED
10
11
#include "
include/core/SkRect.h
"
12
#include "
include/core/SkRefCnt.h
"
13
#include "
modules/sksg/include/SkSGEffectNode.h
"
14
#include "
modules/sksg/include/SkSGRenderNode.h
"
15
16
#include <cstdint>
17
#include <utility>
18
19
class
SkCanvas
;
20
class
SkMatrix
;
21
struct
SkPoint
;
22
23
namespace
sksg
{
24
class
InvalidationController;
25
26
/**
27
* Concrete Effect node, applying a mask to its descendants.
28
*
29
*/
30
class
MaskEffect
final :
public
EffectNode
{
31
public
:
32
enum class
Mode
: uint32_t {
33
kAlphaNormal
,
34
kAlphaInvert
,
35
kLumaNormal
,
36
kLumaInvert
,
37
};
38
39
static
sk_sp<MaskEffect>
Make
(
sk_sp<RenderNode>
child,
sk_sp<RenderNode>
mask,
40
Mode
mode =
Mode::kAlphaNormal
) {
41
return
(child && mask)
42
?
sk_sp<MaskEffect>
(
new
MaskEffect
(std::move(child), std::move(mask), mode))
43
:
nullptr
;
44
}
45
46
~MaskEffect
()
override
;
47
48
protected
:
49
MaskEffect
(
sk_sp<RenderNode>
,
sk_sp<RenderNode>
mask,
Mode
);
50
51
void
onRender
(
SkCanvas
*,
const
RenderContext*)
const override
;
52
const
RenderNode
*
onNodeAt
(
const
SkPoint
&)
const override
;
53
54
SkRect
onRevalidate
(
InvalidationController
*,
const
SkMatrix
&)
override
;
55
56
private
:
57
const
sk_sp<RenderNode>
fMaskNode;
58
const
Mode
fMaskMode;
59
60
using
INHERITED =
EffectNode
;
61
};
62
63
}
// namespace sksg
64
65
#endif
// SkSGMaskEffect_DEFINED
Mode
Mode
Definition
ColorSpaceBench.cpp:18
SkRect.h
SkRefCnt.h
SkSGEffectNode.h
SkSGRenderNode.h
SkCanvas
Definition
SkCanvas.h:106
SkMatrix
Definition
SkMatrix.h:54
sk_sp
Definition
SkRefCnt.h:220
sksg::EffectNode
Definition
SkSGEffectNode.h:30
sksg::InvalidationController
Definition
SkSGInvalidationController.h:24
sksg::MaskEffect
Definition
SkSGMaskEffect.h:30
sksg::MaskEffect::onNodeAt
const RenderNode * onNodeAt(const SkPoint &) const override
Definition
SkSGMaskEffect.cpp:85
sksg::MaskEffect::Make
static sk_sp< MaskEffect > Make(sk_sp< RenderNode > child, sk_sp< RenderNode > mask, Mode mode=Mode::kAlphaNormal)
Definition
SkSGMaskEffect.h:39
sksg::MaskEffect::onRevalidate
SkRect onRevalidate(InvalidationController *, const SkMatrix &) override
Definition
SkSGMaskEffect.cpp:95
sksg::MaskEffect::~MaskEffect
~MaskEffect() override
Definition
SkSGMaskEffect.cpp:39
sksg::MaskEffect::Mode
Mode
Definition
SkSGMaskEffect.h:32
sksg::MaskEffect::Mode::kLumaInvert
@ kLumaInvert
sksg::MaskEffect::Mode::kAlphaNormal
@ kAlphaNormal
sksg::MaskEffect::Mode::kAlphaInvert
@ kAlphaInvert
sksg::MaskEffect::Mode::kLumaNormal
@ kLumaNormal
sksg::MaskEffect::onRender
void onRender(SkCanvas *, const RenderContext *) const override
Definition
SkSGMaskEffect.cpp:43
sksg::RenderNode
Definition
SkSGRenderNode.h:34
sksg
Definition
Skottie.h:32
SkPoint
Definition
SkPoint_impl.h:163
SkRect
Definition
extension.cpp:13
Generated on Fri Apr 26 2024 06:16:23 for Flutter Engine by
1.9.8