Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
graphite
precompile
PrecompileShadersPriv.h
Go to the documentation of this file.
1
/*
2
* Copyright 2024 Google LLC
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 skgpu_graphite_precompile_PrecompileShadersPriv_DEFINED
9
#define skgpu_graphite_precompile_PrecompileShadersPriv_DEFINED
10
11
#include "
include/core/SkRefCnt.h
"
12
#include "
src/base/SkEnumBitMask.h
"
13
14
namespace
skgpu::graphite
{
15
16
class
PrecompileShader;
17
18
enum class
PrecompileImageShaderFlags
{
19
kNone
= 0b00,
20
kExcludeAlpha
= 0b01,
21
kExcludeCubic
= 0b10
22
};
23
SK_MAKE_BITMASK_OPS
(
PrecompileImageShaderFlags
)
24
25
//--------------------------------------------------------------------------------------------------
26
namespace PrecompileShadersPriv {
27
// -- The first 6 factories are used to implement ImageFilters
28
sk_sp<PrecompileShader>
Blur
(
sk_sp<PrecompileShader>
wrapped
);
29
30
sk_sp<PrecompileShader>
Displacement
(
sk_sp<PrecompileShader>
displacement,
31
sk_sp<PrecompileShader>
color
);
32
33
sk_sp<PrecompileShader>
Lighting
(
sk_sp<PrecompileShader>
wrapped
);
34
35
sk_sp<PrecompileShader>
MatrixConvolution
(
sk_sp<PrecompileShader>
wrapped
);
36
37
sk_sp<PrecompileShader>
LinearMorphology
(
sk_sp<PrecompileShader>
wrapped
);
38
39
sk_sp<PrecompileShader>
SparseMorphology
(
sk_sp<PrecompileShader>
wrapped
);
40
41
// TODO: This, technically, doesn't need to take an SkSpan since it is only called from
42
// PaintOptions::setClipShaders with a single PrecompileShader. Leaving it be for now in case
43
// the usage is revised.
44
sk_sp<PrecompileShader>
CTM
(
SkSpan
<
const
sk_sp<PrecompileShader>
>
wrapped
);
45
46
// The remaining factories are special cases used to reduce the combinatorics of the
47
// precompilation system.
48
sk_sp<PrecompileShader>
Image
(
SkEnumBitMask<PrecompileImageShaderFlags>
);
49
50
sk_sp<PrecompileShader>
RawImage
(
SkEnumBitMask<PrecompileImageShaderFlags>
);
51
52
// This factory variant should be used when the existence or non-existence of the local matrix
53
// is known. If 'withLM' is true only the LMShader-wrapped shader will be created while, when
54
// 'withLM' is false, no LMShader will wrap the base shader.
55
sk_sp<PrecompileShader>
Picture
(
bool
withLM);
56
57
// TODO: this factory function should go away (it is only used by the PrecompileShaders::Picture
58
// entry point now).
59
sk_sp<PrecompileShader>
LocalMatrixBothVariants
(
SkSpan
<
const
sk_sp<PrecompileShader>
>
wrapped
);
60
61
}
// namespace PrecompileShadersPriv
62
63
}
// namespace skgpu::graphite
64
65
#endif
// skgpu_graphite_precompile_PrecompileShadersPriv_DEFINED
SkEnumBitMask.h
SkRefCnt.h
wrapped
static sk_sp< GrTextureProxy > wrapped(skiatest::Reporter *reporter, GrRecordingContext *rContext, GrProxyProvider *proxyProvider, SkBackingFit fit)
Definition:
TextureProxyTest.cpp:112
SkEnumBitMask< PrecompileImageShaderFlags >
SkSpan
Definition:
SkSpan_impl.h:65
sk_sp
Definition:
SkRefCnt.h:220
color
DlColor color
Definition:
dl_golden_blur_unittests.cc:23
skgpu::graphite::PrecompileShadersPriv::Lighting
sk_sp< PrecompileShader > Lighting(sk_sp< PrecompileShader > wrapped)
Definition:
PrecompileShader.cpp:1096
skgpu::graphite::PrecompileShadersPriv::Image
sk_sp< PrecompileShader > Image(SkEnumBitMask< PrecompileImageShaderFlags >)
Definition:
PrecompileShader.cpp:432
skgpu::graphite::PrecompileShadersPriv::CTM
sk_sp< PrecompileShader > CTM(SkSpan< const sk_sp< PrecompileShader > > wrapped)
Definition:
PrecompileShader.cpp:831
skgpu::graphite::PrecompileShadersPriv::LocalMatrixBothVariants
sk_sp< PrecompileShader > LocalMatrixBothVariants(SkSpan< const sk_sp< PrecompileShader > > wrapped)
Definition:
PrecompileShader.cpp:664
skgpu::graphite::PrecompileShadersPriv::Displacement
sk_sp< PrecompileShader > Displacement(sk_sp< PrecompileShader > displacement, sk_sp< PrecompileShader > color)
Definition:
PrecompileShader.cpp:1054
skgpu::graphite::PrecompileShadersPriv::LinearMorphology
sk_sp< PrecompileShader > LinearMorphology(sk_sp< PrecompileShader > wrapped)
Definition:
PrecompileShader.cpp:998
skgpu::graphite::PrecompileShadersPriv::Picture
sk_sp< PrecompileShader > Picture(bool withLM)
Definition:
PrecompileShader.cpp:558
skgpu::graphite::PrecompileShadersPriv::RawImage
sk_sp< PrecompileShader > RawImage(SkEnumBitMask< PrecompileImageShaderFlags >)
Definition:
PrecompileShader.cpp:437
skgpu::graphite::PrecompileShadersPriv::MatrixConvolution
sk_sp< PrecompileShader > MatrixConvolution(sk_sp< PrecompileShader > wrapped)
Definition:
PrecompileShader.cpp:958
skgpu::graphite::PrecompileShadersPriv::SparseMorphology
sk_sp< PrecompileShader > SparseMorphology(sk_sp< PrecompileShader > wrapped)
Definition:
PrecompileShader.cpp:1004
skgpu::graphite::PrecompileShadersPriv::Blur
sk_sp< PrecompileShader > Blur(sk_sp< PrecompileShader > wrapped)
Definition:
PrecompileShader.cpp:884
skgpu::graphite
Definition:
BoundsManagerBench.cpp:27
skgpu::graphite::PrecompileImageShaderFlags
PrecompileImageShaderFlags
Definition:
PrecompileShadersPriv.h:18
skgpu::graphite::PrecompileImageShaderFlags::kExcludeAlpha
@ kExcludeAlpha
skgpu::graphite::PrecompileImageShaderFlags::kExcludeCubic
@ kExcludeCubic
skgpu::graphite::SK_MAKE_BITMASK_OPS
SK_MAKE_BITMASK_OPS(DawnErrorType)
skgpu::graphite::kNone
@ kNone
Definition:
GraphiteTypes.h:112
Generated on Sun Jun 23 2024 21:56:27 for Flutter Engine by
1.9.4