Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
skgpu::ganesh::PathWedgeTessellator Class Referencefinal

#include <PathTessellator.h>

Inheritance diagram for skgpu::ganesh::PathWedgeTessellator:
skgpu::ganesh::PathTessellator

Public Member Functions

 PathWedgeTessellator (bool infinitySupport, PatchAttribs attribs=PatchAttribs::kNone)
 
void prepare (GrMeshDrawTarget *target, const SkMatrix &shaderMatrix, const PathDrawList &pathDrawList, int totalCombinedPathVerbCnt) final
 
void draw (GrOpFlushState *) const final
 
- Public Member Functions inherited from skgpu::ganesh::PathTessellator
virtual ~PathTessellator ()
 
PatchAttribs patchAttribs () const
 

Static Public Member Functions

static PathWedgeTessellatorMake (SkArenaAlloc *arena, bool infinitySupport, PatchAttribs attribs=PatchAttribs::kNone)
 

Additional Inherited Members

- Public Types inherited from skgpu::ganesh::PathTessellator
using PatchAttribs = tess::PatchAttribs
 
- Protected Member Functions inherited from skgpu::ganesh::PathTessellator
 PathTessellator (bool infinitySupport, PatchAttribs attribs)
 
- Protected Attributes inherited from skgpu::ganesh::PathTessellator
PatchAttribs fAttribs
 
GrVertexChunkArray fVertexChunkArray
 
int fMaxVertexCount = 0
 
sk_sp< const GrGpuBufferfFixedVertexBuffer
 
sk_sp< const GrGpuBufferfFixedIndexBuffer
 

Detailed Description

Definition at line 130 of file PathTessellator.h.

Constructor & Destructor Documentation

◆ PathWedgeTessellator()

skgpu::ganesh::PathWedgeTessellator::PathWedgeTessellator ( bool  infinitySupport,
PatchAttribs  attribs = PatchAttribs::kNone 
)
inline

Definition at line 138 of file PathTessellator.h.

139 : PathTessellator(infinitySupport, attribs) {
140 fAttribs |= PatchAttribs::kFanPoint;
141 }
PathTessellator(bool infinitySupport, PatchAttribs attribs)

Member Function Documentation

◆ draw()

void skgpu::ganesh::PathWedgeTessellator::draw ( GrOpFlushState flushState) const
finalvirtual

Implements skgpu::ganesh::PathTessellator.

Definition at line 272 of file PathTessellator.cpp.

272 {
274 return;
275 }
276 for (const GrVertexChunk& chunk : fVertexChunkArray) {
277 flushState->bindBuffers(fFixedIndexBuffer, chunk.fBuffer, fFixedVertexBuffer);
278 flushState->drawIndexedInstanced(fMaxVertexCount, 0, chunk.fCount, chunk.fBase, 0);
279 }
280}
void drawIndexedInstanced(int indexCount, int baseIndex, int instanceCount, int baseInstance, int baseVertex)
void bindBuffers(sk_sp< const GrBuffer > indexBuffer, sk_sp< const GrBuffer > instanceBuffer, sk_sp< const GrBuffer > vertexBuffer, GrPrimitiveRestart primitiveRestart=GrPrimitiveRestart::kNo)
GrVertexChunkArray fVertexChunkArray
sk_sp< const GrGpuBuffer > fFixedIndexBuffer
sk_sp< const GrGpuBuffer > fFixedVertexBuffer

◆ Make()

static PathWedgeTessellator * skgpu::ganesh::PathWedgeTessellator::Make ( SkArenaAlloc arena,
bool  infinitySupport,
PatchAttribs  attribs = PatchAttribs::kNone 
)
inlinestatic

Definition at line 132 of file PathTessellator.h.

134 {
135 return arena->make<PathWedgeTessellator>(infinitySupport, attribs);
136 }
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
PathWedgeTessellator(bool infinitySupport, PatchAttribs attribs=PatchAttribs::kNone)

◆ prepare()

void skgpu::ganesh::PathWedgeTessellator::prepare ( GrMeshDrawTarget target,
const SkMatrix shaderMatrix,
const PathDrawList pathDrawList,
int  totalCombinedPathVerbCnt 
)
finalvirtual

Implements skgpu::ganesh::PathTessellator.

Definition at line 244 of file PathTessellator.cpp.

247 {
248 if (int patchPreallocCount = FixedCountWedges::PreallocCount(totalCombinedPathVerbCnt)) {
249 LinearTolerances worstCase;
250 WedgeWriter writer{fAttribs, &worstCase, target, &fVertexChunkArray, patchPreallocCount};
251 write_wedge_patches(std::move(writer), shaderMatrix, pathDrawList);
253 }
254
255 GrResourceProvider* rp = target->resourceProvider();
256
257 SKGPU_DEFINE_STATIC_UNIQUE_KEY(gFixedCountWedgesVertexBufferKey);
258
261 gFixedCountWedgesVertexBufferKey,
263
264 SKGPU_DEFINE_STATIC_UNIQUE_KEY(gFixedCountWedgesIndexBufferKey);
265
268 gFixedCountWedgesIndexBufferKey,
270}
#define SKGPU_DEFINE_STATIC_UNIQUE_KEY(name)
sk_sp< const GrGpuBuffer > findOrMakeStaticBuffer(GrGpuBufferType intendedType, size_t size, const skgpu::UniqueKey &key, InitializeBufferFn)
static constexpr size_t IndexBufferSize()
static int VertexCount(const LinearTolerances &tolerances)
static constexpr int PreallocCount(int totalCombinedPathVerbCnt)
static constexpr size_t VertexBufferSize()
static void WriteVertexBuffer(VertexWriter, size_t bufferSize)
static void WriteIndexBuffer(VertexWriter, size_t bufferSize)
uint32_t * target

The documentation for this class was generated from the following files: