| 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_TessellateCurvesRenderStep_DEFINED |
| 9 |
#define skgpu_graphite_render_TessellateCurvesRenderStep_DEFINED |
| 10 |
|
| 11 |
#include "src/base/SkVx.h" |
| 12 |
#include "src/gpu/graphite/Renderer.h" |
| 13 |
#include "src/gpu/graphite/ResourceTypes.h" |
| 14 |
#include <string> |
| 15 |
|
| 16 |
namespace skgpu::graphite { |
| 17 |
|
| 18 |
class DrawParams; |
| 19 |
class DrawWriter; |
| 20 |
class PipelineDataGatherer; |
| 21 |
class StaticBufferManager; |
| 22 |
|
| 23 |
class TessellateCurvesRenderStep final : public RenderStep { |
| 24 |
public: |
| 25 |
// TODO: If this takes DepthStencilSettings directly and a way to adjust the flags to specify |
| 26 |
// that it performs shading, this RenderStep definition can be shared between the stencil and |
| 27 |
// the convex rendering variants. |
| 28 |
TessellateCurvesRenderStep(Layout, bool evenOdd, bool infinitySupport, StaticBufferManager*); |
| 29 |
|
| 30 |
~TessellateCurvesRenderStep() override; |
| 31 |
|
| 32 |
std::string vertexSkSL() const override; |
| 33 |
void writeVertices(DrawWriter*, const DrawParams&, uint32_t ssboIndex) const override; |
| 34 |
void writeUniformsAndTextures(const DrawParams&, PipelineDataGatherer*) const override; |
| 35 |
|
| 36 |
private: |
| 37 |
// Points to the static buffers holding the fixed indexed vertex template for drawing instances. |
| 38 |
BindBufferInfo fVertexBuffer; |
| 39 |
BindBufferInfo fIndexBuffer; |
| 40 |
bool fInfinitySupport; |
| 41 |
}; |
| 42 |
|
| 43 |
} // namespace skgpu::graphite |
| 44 |
|
| 45 |
#endif // skgpu_graphite_render_TessellateCurvesRenderStep_DEFINED |