xref: /aosp_15_r20/external/skia/src/gpu/graphite/render/TessellateStrokesRenderStep.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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_render_TessellateStrokesRenderStep_DEFINED
9 #define skgpu_graphite_render_TessellateStrokesRenderStep_DEFINED
10 
11 #include "src/base/SkVx.h"
12 #include "src/gpu/graphite/Renderer.h"
13 
14 #include <string>
15 
16 namespace skgpu::graphite {
17 
18 class DrawParams;
19 class DrawWriter;
20 class PipelineDataGatherer;
21 
22 class TessellateStrokesRenderStep final : public RenderStep {
23 public:
24     // TODO: If this takes DepthStencilSettings directly and a way to adjust the flags to specify
25     // that it performs shading, this RenderStep definition could be used to handle inverse-filled
26     // stroke draws.
27     explicit TessellateStrokesRenderStep(bool infinitySupport);
28 
29     ~TessellateStrokesRenderStep() override;
30 
31     std::string vertexSkSL() const override;
32     void writeVertices(DrawWriter*, const DrawParams&, skvx::uint2 ssboIndices) const override;
33     void writeUniformsAndTextures(const DrawParams&, PipelineDataGatherer*) const override;
34 
35 private:
36     bool fInfinitySupport;
37 };
38 
39 }  // namespace skgpu::graphite
40 
41 #endif // skgpu_graphite_render_TessellateStrokesRenderStep_DEFINED
42