Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
40
51
52 // SkColorFilter code snippets
57
58 // SkBlender code snippets
62
63 // Emits special variable holding the primitiveColor emitted by a RenderStep
65
66 // Dest Read code snippets
69
70 // Clip shader snippet
71 // TODO(b/238763003): Avoid incorporating clip shaders into the actual shader code.
73
75
76 // Fixed-function blend modes are used for the final blend with the dst buffer's color when the
77 // SkPaint is using a coefficient-based SkBlendMode. The actual coefficients are extracted into
78 // the SkBlendInfo associated with each pipeline, but a unique code snippet ID is assigned so
79 // that the pipeline keys remain distinct. They are ordered to match SkBlendMode such
80 // that (id - kFirstFixedFunctionBlendMode) == SkBlendMode).
81 //
82 // NOTE: Pipeline code generation depends on the fixed-function code IDs being contiguous and
83 // be defined last in the enum.
99
102};
103static constexpr int kBuiltInCodeSnippetIDCount = static_cast<int>(BuiltInCodeSnippetID::kLast)+1;
106
108
109} // namespace skgpu::graphite
110
111#endif // skgpu_graphite_BuiltInCodeSnippetID_DEFINED
static constexpr int kFixedFunctionBlendModeIDOffset
static constexpr int kBuiltInCodeSnippetIDCount