Flutter Engine
The Flutter Engine
BuiltInCodeSnippetID.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 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_BuiltInCodeSnippetID_DEFINED
9#define skgpu_graphite_BuiltInCodeSnippetID_DEFINED
10
12
13namespace skgpu::graphite {
14
15enum class BuiltInCodeSnippetID : int32_t {
16 // This isn't just a signal for a failure during paintparams key creation. It also actually
17 // implements the default behavior for an erroneous draw. Currently it just draws solid
18 // magenta.
19 kError,
20
21 // Snippet that passes through prior stage output
23
24 // SkShader code snippets
44
56
57 // SkColorFilter code snippets
62
63 // SkBlender code snippets
67
68 // Emits special variable holding the primitiveColor emitted by a RenderStep
70
71 // Dest Read code snippets
74
75 // Clip shader snippet
76 // TODO(b/238763003): Avoid incorporating clip shaders into the actual shader code.
78
79 kCompose,
80
81 // Fixed-function blend modes are used for the final blend with the dst buffer's color when the
82 // SkPaint is using a coefficient-based SkBlendMode. The actual coefficients are extracted into
83 // the SkBlendInfo associated with each pipeline, but a unique code snippet ID is assigned so
84 // that the pipeline keys remain distinct. They are ordered to match SkBlendMode such
85 // that (id - kFirstFixedFunctionBlendMode) == SkBlendMode).
86 //
87 // NOTE: Pipeline code generation depends on the fixed-function code IDs being contiguous and
88 // be defined last in the enum.
104
107};
108static constexpr int kBuiltInCodeSnippetIDCount = static_cast<int>(BuiltInCodeSnippetID::kLast)+1;
111
113
114} // namespace skgpu::graphite
115
116#endif // skgpu_graphite_BuiltInCodeSnippetID_DEFINED
static constexpr int kFixedFunctionBlendModeIDOffset
static constexpr int kBuiltInCodeSnippetIDCount