Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GrMeshDrawTarget Class Referenceabstract

#include <GrMeshDrawTarget.h>

Inheritance diagram for GrMeshDrawTarget:
GrMockOpTarget GrOpFlushState

Public Member Functions

virtual ~GrMeshDrawTarget ()
 
virtual void recordDraw (const GrGeometryProcessor *, const GrSimpleMesh[], int meshCnt, const GrSurfaceProxy *const primProcProxies[], GrPrimitiveType)=0
 
void recordDraw (const GrGeometryProcessor *gp, const GrSimpleMesh meshes[], int meshCnt, GrPrimitiveType primitiveType)
 
virtual void * makeVertexSpace (size_t vertexSize, int vertexCount, sk_sp< const GrBuffer > *, int *startVertex)=0
 
virtual uint16_t * makeIndexSpace (int indexCount, sk_sp< const GrBuffer > *, int *startIndex)=0
 
virtual void * makeVertexSpaceAtLeast (size_t vertexSize, int minVertexCount, int fallbackVertexCount, sk_sp< const GrBuffer > *, int *startVertex, int *actualVertexCount)=0
 
virtual uint16_t * makeIndexSpaceAtLeast (int minIndexCount, int fallbackIndexCount, sk_sp< const GrBuffer > *, int *startIndex, int *actualIndexCount)=0
 
virtual GrDrawIndirectWriter makeDrawIndirectSpace (int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offsetInBytes)=0
 
virtual GrDrawIndexedIndirectWriter makeDrawIndexedIndirectSpace (int drawCount, sk_sp< const GrBuffer > *, size_t *offsetInBytes)=0
 
skgpu::VertexWriter makeVertexWriter (size_t vertexSize, int vertexCount, sk_sp< const GrBuffer > *, int *startVertex)
 
skgpu::IndexWriter makeIndexWriter (int indexCount, sk_sp< const GrBuffer > *, int *startIndex)
 
skgpu::VertexWriter makeVertexWriterAtLeast (size_t vertexSize, int minVertexCount, int fallbackVertexCount, sk_sp< const GrBuffer > *, int *startVertex, int *actualVertexCount)
 
skgpu::IndexWriter makeIndexWriterAtLeast (int minIndexCount, int fallbackIndexCount, sk_sp< const GrBuffer > *, int *startIndex, int *actualIndexCount)
 
virtual void putBackIndices (int indices)=0
 
virtual void putBackVertices (int vertices, size_t vertexStride)=0
 
virtual void putBackIndirectDraws (int count)=0
 
virtual void putBackIndexedIndirectDraws (int count)=0
 
GrSimpleMeshallocMesh ()
 
GrSimpleMeshallocMeshes (int n)
 
const GrSurfaceProxy ** allocPrimProcProxyPtrs (int n)
 
virtual GrRenderTargetProxyrtProxy () const =0
 
virtual const GrSurfaceProxyViewwriteView () const =0
 
virtual const GrAppliedClipappliedClip () const =0
 
virtual GrAppliedClip detachAppliedClip ()=0
 
virtual const GrDstProxyViewdstProxyView () const =0
 
virtual bool usesMSAASurface () const =0
 
virtual GrXferBarrierFlags renderPassBarriers () const =0
 
virtual GrLoadOp colorLoadOp () const =0
 
virtual GrThreadSafeCachethreadSafeCache () const =0
 
virtual GrResourceProviderresourceProvider () const =0
 
uint32_t contextUniqueID () const
 
virtual sktext::gpu::StrikeCachestrikeCache () const =0
 
virtual GrAtlasManageratlasManager () const =0
 
virtual skgpu::ganesh::SmallPathAtlasMgrsmallPathAtlasManager () const =0
 
virtual skia_private::TArray< GrSurfaceProxy *, true > * sampledProxyArray ()=0
 
virtual const GrCapscaps () const =0
 
virtual GrDeferredUploadTargetdeferredUploadTarget ()=0
 
virtual SkArenaAllocallocator ()=0
 

Detailed Description

Definition at line 53 of file GrMeshDrawTarget.h.

Constructor & Destructor Documentation

◆ ~GrMeshDrawTarget()

virtual GrMeshDrawTarget::~GrMeshDrawTarget ( )
inlinevirtual

Definition at line 55 of file GrMeshDrawTarget.h.

55{}

Member Function Documentation

◆ allocator()

virtual SkArenaAlloc * GrMeshDrawTarget::allocator ( )
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ allocMesh()

GrSimpleMesh * GrMeshDrawTarget::allocMesh ( )
inline

Definition at line 143 of file GrMeshDrawTarget.h.

143{ return this->allocator()->make<GrSimpleMesh>(); }
virtual SkArenaAlloc * allocator()=0
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))

◆ allocMeshes()

GrSimpleMesh * GrMeshDrawTarget::allocMeshes ( int  n)
inline

Definition at line 144 of file GrMeshDrawTarget.h.

144{ return this->allocator()->makeArray<GrSimpleMesh>(n); }
T * makeArray(size_t count)

◆ allocPrimProcProxyPtrs()

const GrSurfaceProxy ** GrMeshDrawTarget::allocPrimProcProxyPtrs ( int  n)
inline

Definition at line 145 of file GrMeshDrawTarget.h.

145 {
146 return this->allocator()->makeArray<const GrSurfaceProxy*>(n);
147 }

◆ appliedClip()

virtual const GrAppliedClip * GrMeshDrawTarget::appliedClip ( ) const
pure virtual

Implemented in GrOpFlushState.

◆ atlasManager()

virtual GrAtlasManager * GrMeshDrawTarget::atlasManager ( ) const
pure virtual

Implemented in GrOpFlushState.

◆ caps()

virtual const GrCaps & GrMeshDrawTarget::caps ( ) const
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ colorLoadOp()

virtual GrLoadOp GrMeshDrawTarget::colorLoadOp ( ) const
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ contextUniqueID()

uint32_t GrMeshDrawTarget::contextUniqueID ( ) const

Definition at line 13 of file GrMeshDrawTarget.cpp.

13 {
14 return this->resourceProvider()->contextUniqueID();
15}
virtual GrResourceProvider * resourceProvider() const =0
uint32_t contextUniqueID() const

◆ deferredUploadTarget()

virtual GrDeferredUploadTarget * GrMeshDrawTarget::deferredUploadTarget ( )
pure virtual

Implemented in GrOpFlushState.

◆ detachAppliedClip()

virtual GrAppliedClip GrMeshDrawTarget::detachAppliedClip ( )
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ dstProxyView()

virtual const GrDstProxyView & GrMeshDrawTarget::dstProxyView ( ) const
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ makeDrawIndexedIndirectSpace()

virtual GrDrawIndexedIndirectWriter GrMeshDrawTarget::makeDrawIndexedIndirectSpace ( int  drawCount,
sk_sp< const GrBuffer > *  ,
size_t *  offsetInBytes 
)
pure virtual

Makes space for elements in a draw-indexed-indirect buffer. Upon success, the returned pointer is a CPU mapping where the data should be written.

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ makeDrawIndirectSpace()

virtual GrDrawIndirectWriter GrMeshDrawTarget::makeDrawIndirectSpace ( int  drawCount,
sk_sp< const GrBuffer > *  buffer,
size_t *  offsetInBytes 
)
pure virtual

Makes space for elements in a draw-indirect buffer. Upon success, the returned pointer is a CPU mapping where the data should be written.

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ makeIndexSpace()

virtual uint16_t * GrMeshDrawTarget::makeIndexSpace ( int  indexCount,
sk_sp< const GrBuffer > *  ,
int startIndex 
)
pure virtual

Makes space for index data. The returned pointer is the location where index data should be written. On return the buffer that will hold the data as well as an offset into the buffer (in uint16_t units) where the data will be placed.

Implemented in GrOpFlushState.

◆ makeIndexSpaceAtLeast()

virtual uint16_t * GrMeshDrawTarget::makeIndexSpaceAtLeast ( int  minIndexCount,
int  fallbackIndexCount,
sk_sp< const GrBuffer > *  ,
int startIndex,
int actualIndexCount 
)
pure virtual

This is similar to makeIndexSpace. It allows the caller to use up to 'actualIndexCount' indices in the returned pointer, which may exceed 'minIndexCount'. 'fallbackIndexCount' is the maximum number of indices that should be allocated if a new buffer is allocated on behalf of this request.

Implemented in GrOpFlushState.

◆ makeIndexWriter()

skgpu::IndexWriter GrMeshDrawTarget::makeIndexWriter ( int  indexCount,
sk_sp< const GrBuffer > *  buffer,
int startIndex 
)

Definition at line 30 of file GrMeshDrawTarget.cpp.

31 {
32 void* p = this->makeIndexSpace(indexCount, buffer, startIndex);
33 return make_writer<skgpu::IndexWriter>(p, indexCount, sizeof(uint16_t));
34}
virtual uint16_t * makeIndexSpace(int indexCount, sk_sp< const GrBuffer > *, int *startIndex)=0
static const uint8_t buffer[]

◆ makeIndexWriterAtLeast()

skgpu::IndexWriter GrMeshDrawTarget::makeIndexWriterAtLeast ( int  minIndexCount,
int  fallbackIndexCount,
sk_sp< const GrBuffer > *  buffer,
int startIndex,
int actualIndexCount 
)

Definition at line 44 of file GrMeshDrawTarget.cpp.

46 {
47 void* p = this->makeIndexSpaceAtLeast(minIndexCount, fallbackIndexCount, buffer,
48 startIndex, actualIndexCount);
49 return make_writer<skgpu::IndexWriter>(p, *actualIndexCount, sizeof(uint16_t));
50}
virtual uint16_t * makeIndexSpaceAtLeast(int minIndexCount, int fallbackIndexCount, sk_sp< const GrBuffer > *, int *startIndex, int *actualIndexCount)=0

◆ makeVertexSpace()

virtual void * GrMeshDrawTarget::makeVertexSpace ( size_t  vertexSize,
int  vertexCount,
sk_sp< const GrBuffer > *  ,
int startVertex 
)
pure virtual

Makes space for vertex data. The returned pointer is the location where vertex data should be written. On return the buffer that will hold the data as well as an offset into the buffer (in 'vertexSize' units) where the data will be placed.

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ makeVertexSpaceAtLeast()

virtual void * GrMeshDrawTarget::makeVertexSpaceAtLeast ( size_t  vertexSize,
int  minVertexCount,
int  fallbackVertexCount,
sk_sp< const GrBuffer > *  ,
int startVertex,
int actualVertexCount 
)
pure virtual

This is similar to makeVertexSpace. It allows the caller to use up to 'actualVertexCount' vertices in the returned pointer, which may exceed 'minVertexCount'. 'fallbackVertexCount' is the maximum number of vertices that should be allocated if a new buffer is allocated on behalf of this request.

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ makeVertexWriter()

skgpu::VertexWriter GrMeshDrawTarget::makeVertexWriter ( size_t  vertexSize,
int  vertexCount,
sk_sp< const GrBuffer > *  buffer,
int startVertex 
)

Helpers for ops that only need to use the VertexWriter to fill the data directly.

Definition at line 24 of file GrMeshDrawTarget.cpp.

25 {
26 void* p = this->makeVertexSpace(vertexSize, vertexCount, buffer, startVertex);
27 return make_writer<skgpu::VertexWriter>(p, vertexCount, vertexSize);
28}
virtual void * makeVertexSpace(size_t vertexSize, int vertexCount, sk_sp< const GrBuffer > *, int *startVertex)=0

◆ makeVertexWriterAtLeast()

skgpu::VertexWriter GrMeshDrawTarget::makeVertexWriterAtLeast ( size_t  vertexSize,
int  minVertexCount,
int  fallbackVertexCount,
sk_sp< const GrBuffer > *  buffer,
int startVertex,
int actualVertexCount 
)

Definition at line 36 of file GrMeshDrawTarget.cpp.

38 {
39 void* p = this->makeVertexSpaceAtLeast(vertexSize, minVertexCount, fallbackVertexCount,
40 buffer, startVertex, actualVertexCount);
41 return make_writer<skgpu::VertexWriter>(p, *actualVertexCount, vertexSize);
42}
virtual void * makeVertexSpaceAtLeast(size_t vertexSize, int minVertexCount, int fallbackVertexCount, sk_sp< const GrBuffer > *, int *startVertex, int *actualVertexCount)=0

◆ putBackIndexedIndirectDraws()

virtual void GrMeshDrawTarget::putBackIndexedIndirectDraws ( int  count)
pure virtual

Implemented in GrMockOpTarget, and GrOpFlushState.

◆ putBackIndices()

virtual void GrMeshDrawTarget::putBackIndices ( int  indices)
pure virtual

Helpers for ops which over-allocate and then return excess data to the pool.

Implemented in GrOpFlushState.

◆ putBackIndirectDraws()

virtual void GrMeshDrawTarget::putBackIndirectDraws ( int  count)
pure virtual

Implemented in GrMockOpTarget, and GrOpFlushState.

◆ putBackVertices()

virtual void GrMeshDrawTarget::putBackVertices ( int  vertices,
size_t  vertexStride 
)
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ recordDraw() [1/2]

virtual void GrMeshDrawTarget::recordDraw ( const GrGeometryProcessor ,
const GrSimpleMesh  [],
int  meshCnt,
const GrSurfaceProxy *const  primProcProxies[],
GrPrimitiveType   
)
pure virtual

Adds a draw of a mesh. 'primProcProxies' must have GrGeometryProcessor::numTextureSamplers() entries. Can be null if no samplers.

Implemented in GrOpFlushState.

◆ recordDraw() [2/2]

void GrMeshDrawTarget::recordDraw ( const GrGeometryProcessor gp,
const GrSimpleMesh  meshes[],
int  meshCnt,
GrPrimitiveType  primitiveType 
)
inline

Helper for drawing GrSimpleMesh(es) with zero primProc textures.

Definition at line 69 of file GrMeshDrawTarget.h.

72 {
73 this->recordDraw(gp, meshes, meshCnt, nullptr, primitiveType);
74 }
virtual void recordDraw(const GrGeometryProcessor *, const GrSimpleMesh[], int meshCnt, const GrSurfaceProxy *const primProcProxies[], GrPrimitiveType)=0

◆ renderPassBarriers()

virtual GrXferBarrierFlags GrMeshDrawTarget::renderPassBarriers ( ) const
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ resourceProvider()

virtual GrResourceProvider * GrMeshDrawTarget::resourceProvider ( ) const
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ rtProxy()

virtual GrRenderTargetProxy * GrMeshDrawTarget::rtProxy ( ) const
pure virtual

Implemented in GrOpFlushState.

◆ sampledProxyArray()

virtual skia_private::TArray< GrSurfaceProxy *, true > * GrMeshDrawTarget::sampledProxyArray ( )
pure virtual

Implemented in GrOpFlushState.

◆ smallPathAtlasManager()

virtual skgpu::ganesh::SmallPathAtlasMgr * GrMeshDrawTarget::smallPathAtlasManager ( ) const
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ strikeCache()

virtual sktext::gpu::StrikeCache * GrMeshDrawTarget::strikeCache ( ) const
pure virtual

Implemented in GrOpFlushState.

◆ threadSafeCache()

virtual GrThreadSafeCache * GrMeshDrawTarget::threadSafeCache ( ) const
pure virtual

Implemented in GrOpFlushState, and GrMockOpTarget.

◆ usesMSAASurface()

virtual bool GrMeshDrawTarget::usesMSAASurface ( ) const
pure virtual

Implemented in GrOpFlushState.

◆ writeView()

virtual const GrSurfaceProxyView & GrMeshDrawTarget::writeView ( ) const
pure virtual

Implemented in GrOpFlushState.


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