Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
GrMockOpTarget Class Reference

#include <GrMockOpTarget.h>

Inheritance diagram for GrMockOpTarget:
GrMeshDrawTarget

Public Member Functions

 GrMockOpTarget (sk_sp< GrDirectContext > mockContext)
 
const GrDirectContextmockContext () const
 
const GrCapscaps () const override
 
GrThreadSafeCachethreadSafeCache () const override
 
GrResourceProviderresourceProvider () const override
 
skgpu::ganesh::SmallPathAtlasMgrsmallPathAtlasManager () const override
 
void resetAllocator ()
 
SkArenaAllocallocator () override
 
void putBackVertices (int vertices, size_t vertexStride) override
 
GrAppliedClip detachAppliedClip () override
 
const GrDstProxyViewdstProxyView () const override
 
GrXferBarrierFlags renderPassBarriers () const override
 
GrLoadOp colorLoadOp () const override
 
void * makeVertexSpace (size_t vertexSize, int vertexCount, sk_sp< const GrBuffer > *buffer, int *startVertex) override
 
void * makeVertexSpaceAtLeast (size_t vertexSize, int minVertexCount, int fallbackVertexCount, sk_sp< const GrBuffer > *buffer, int *startVertex, int *actualVertexCount) override
 
GrDrawIndirectWriter makeDrawIndirectSpace (int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offsetInBytes) override
 
void putBackIndirectDraws (int count) override
 
GrDrawIndexedIndirectWriter makeDrawIndexedIndirectSpace (int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offsetInBytes) override
 
void putBackIndexedIndirectDraws (int count) override
 
const void * peekStaticVertexData () const
 
const void * peekStaticIndirectData () const
 
- Public Member Functions inherited from GrMeshDrawTarget
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
 

Public Attributes

UNIMPL(void recordDraw(const GrGeometryProcessor *, const GrSimpleMesh fStaticVertexData [], int, const GrSurfaceProxy *const [], GrPrimitiveType)) private char[6 *1024 *1024]
 
sk_sp< GrGpuBufferfStaticVertexBuffer
 
char fStaticIndirectData [sizeof(GrDrawIndexedIndirectCommand) *32]
 
sk_sp< GrGpuBufferfStaticIndirectBuffer
 
SkSTArenaAllocWithReset< 1024 *1024 > fAllocator
 
GrDstProxyView fDstProxyView
 

Detailed Description

Definition at line 48 of file GrMockOpTarget.h.

Constructor & Destructor Documentation

◆ GrMockOpTarget()

GrMockOpTarget::GrMockOpTarget ( sk_sp< GrDirectContext mockContext)
inline

Definition at line 50 of file GrMockOpTarget.h.

50 : fMockContext(std::move(mockContext)) {
51 fStaticVertexBuffer = fMockContext->priv().getGpu()->createBuffer(
53 fStaticIndirectBuffer = fMockContext->priv().getGpu()->createBuffer(
56 }
@ kDynamic_GrAccessPattern
Definition: GrTypesPriv.h:426
GrGpu * getGpu() const
sk_sp< GrGpuBuffer > createBuffer(size_t size, GrGpuBufferType intendedType, GrAccessPattern accessPattern)
Definition: GrGpu.cpp:393
char fStaticIndirectData[sizeof(GrDrawIndexedIndirectCommand) *32]
sk_sp< GrGpuBuffer > fStaticIndirectBuffer
UNIMPL(void recordDraw(const GrGeometryProcessor *, const GrSimpleMesh fStaticVertexData[], int, const GrSurfaceProxy *const [], GrPrimitiveType)) private char[6 *1024 *1024]
sk_sp< GrGpuBuffer > fStaticVertexBuffer
const GrDirectContext * mockContext() const

Member Function Documentation

◆ allocator()

SkArenaAlloc * GrMockOpTarget::allocator ( )
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 69 of file GrMockOpTarget.h.

69{ return &fAllocator; }
SkSTArenaAllocWithReset< 1024 *1024 > fAllocator

◆ caps()

const GrCaps & GrMockOpTarget::caps ( ) const
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 58 of file GrMockOpTarget.h.

58{ return *fMockContext->priv().caps(); }

◆ colorLoadOp()

GrLoadOp GrMockOpTarget::colorLoadOp ( ) const
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 74 of file GrMockOpTarget.h.

74{ return GrLoadOp::kLoad; }

◆ detachAppliedClip()

GrAppliedClip GrMockOpTarget::detachAppliedClip ( )
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 71 of file GrMockOpTarget.h.

71{ return GrAppliedClip::Disabled(); }
static GrAppliedClip Disabled()
Definition: GrAppliedClip.h:96

◆ dstProxyView()

const GrDstProxyView & GrMockOpTarget::dstProxyView ( ) const
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 72 of file GrMockOpTarget.h.

72{ return fDstProxyView; }
GrDstProxyView fDstProxyView

◆ makeDrawIndexedIndirectSpace()

GrDrawIndexedIndirectWriter GrMockOpTarget::makeDrawIndexedIndirectSpace ( int  drawCount,
sk_sp< const GrBuffer > *  ,
size_t *  offsetInBytes 
)
inlineoverridevirtual

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.

Implements GrMeshDrawTarget.

Definition at line 113 of file GrMockOpTarget.h.

115 {
116 if (sizeof(GrDrawIndexedIndirectCommand) * drawCount > sizeof(fStaticIndirectData)) {
117 SK_ABORT("FATAL: wanted %zu bytes of static indirect data; only have %zu.\n",
118 sizeof(GrDrawIndexedIndirectCommand) * drawCount, sizeof(fStaticIndirectData));
119 }
121 *offsetInBytes = 0;
122 return fStaticIndirectData;
123 }
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126

◆ makeDrawIndirectSpace()

GrDrawIndirectWriter GrMockOpTarget::makeDrawIndirectSpace ( int  drawCount,
sk_sp< const GrBuffer > *  buffer,
size_t *  offsetInBytes 
)
inlineoverridevirtual

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

Implements GrMeshDrawTarget.

Definition at line 100 of file GrMockOpTarget.h.

101 {
102 if (sizeof(GrDrawIndirectCommand) * drawCount > sizeof(fStaticIndirectData)) {
103 SK_ABORT("FATAL: wanted %zu bytes of static indirect data; only have %zu.\n",
104 sizeof(GrDrawIndirectCommand) * drawCount, sizeof(fStaticIndirectData));
105 }
107 *offsetInBytes = 0;
108 return fStaticIndirectData;
109 }

◆ makeVertexSpace()

void * GrMockOpTarget::makeVertexSpace ( size_t  vertexSize,
int  vertexCount,
sk_sp< const GrBuffer > *  ,
int startVertex 
)
inlineoverridevirtual

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.

Implements GrMeshDrawTarget.

Definition at line 76 of file GrMockOpTarget.h.

77 {
78 if (vertexSize * vertexCount > sizeof(fStaticVertexData)) {
79 SK_ABORT("FATAL: wanted %zu bytes of static vertex data; only have %zu.\n",
80 vertexSize * vertexCount, sizeof(fStaticVertexData));
81 }
83 *startVertex = 0;
84 return fStaticVertexData;
85 }

◆ makeVertexSpaceAtLeast()

void * GrMockOpTarget::makeVertexSpaceAtLeast ( size_t  vertexSize,
int  minVertexCount,
int  fallbackVertexCount,
sk_sp< const GrBuffer > *  ,
int startVertex,
int actualVertexCount 
)
inlineoverridevirtual

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.

Implements GrMeshDrawTarget.

Definition at line 87 of file GrMockOpTarget.h.

89 {
90 if (vertexSize * minVertexCount > sizeof(fStaticVertexData)) {
91 SK_ABORT("FATAL: wanted %zu bytes of static vertex data; only have %zu.\n",
92 vertexSize * minVertexCount, sizeof(fStaticVertexData));
93 }
95 *startVertex = 0;
96 *actualVertexCount = sizeof(fStaticVertexData) / vertexSize;
97 return fStaticVertexData;
98 }

◆ mockContext()

const GrDirectContext * GrMockOpTarget::mockContext ( ) const
inline

Definition at line 57 of file GrMockOpTarget.h.

57{ return fMockContext.get(); }

◆ peekStaticIndirectData()

const void * GrMockOpTarget::peekStaticIndirectData ( ) const
inline

Definition at line 129 of file GrMockOpTarget.h.

129{ return fStaticIndirectData; }

◆ peekStaticVertexData()

const void * GrMockOpTarget::peekStaticVertexData ( ) const
inline

Definition at line 128 of file GrMockOpTarget.h.

128{ return fStaticVertexData; }

◆ putBackIndexedIndirectDraws()

void GrMockOpTarget::putBackIndexedIndirectDraws ( int  count)
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 125 of file GrMockOpTarget.h.

125{ /* no-op */ }

◆ putBackIndirectDraws()

void GrMockOpTarget::putBackIndirectDraws ( int  count)
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 111 of file GrMockOpTarget.h.

111{ /* no-op */ }

◆ putBackVertices()

void GrMockOpTarget::putBackVertices ( int  vertices,
size_t  vertexStride 
)
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 70 of file GrMockOpTarget.h.

70{ /* no-op */ }

◆ renderPassBarriers()

GrXferBarrierFlags GrMockOpTarget::renderPassBarriers ( ) const
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 73 of file GrMockOpTarget.h.

◆ resetAllocator()

void GrMockOpTarget::resetAllocator ( )
inline

Definition at line 68 of file GrMockOpTarget.h.

◆ resourceProvider()

GrResourceProvider * GrMockOpTarget::resourceProvider ( ) const
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 62 of file GrMockOpTarget.h.

62 {
63 return fMockContext->priv().resourceProvider();
64 }

◆ smallPathAtlasManager()

skgpu::ganesh::SmallPathAtlasMgr * GrMockOpTarget::smallPathAtlasManager ( ) const
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 66 of file GrMockOpTarget.h.

66{ return nullptr; }

◆ threadSafeCache()

GrThreadSafeCache * GrMockOpTarget::threadSafeCache ( ) const
inlineoverridevirtual

Implements GrMeshDrawTarget.

Definition at line 59 of file GrMockOpTarget.h.

59 {
60 return fMockContext->priv().threadSafeCache();
61 }

Member Data Documentation

◆ fAllocator

SkSTArenaAllocWithReset<1024 * 1024> GrMockOpTarget::fAllocator

Definition at line 153 of file GrMockOpTarget.h.

◆ fDstProxyView

GrDstProxyView GrMockOpTarget::fDstProxyView

Definition at line 154 of file GrMockOpTarget.h.

◆ fStaticIndirectBuffer

sk_sp<GrGpuBuffer> GrMockOpTarget::fStaticIndirectBuffer

Definition at line 152 of file GrMockOpTarget.h.

◆ fStaticIndirectData

char GrMockOpTarget::fStaticIndirectData[sizeof(GrDrawIndexedIndirectCommand) *32]

Definition at line 151 of file GrMockOpTarget.h.

◆ fStaticVertexBuffer

sk_sp<GrGpuBuffer> GrMockOpTarget::fStaticVertexBuffer

Definition at line 150 of file GrMockOpTarget.h.

◆ fStaticVertexData

UNIMPL (void recordDraw(const GrGeometryProcessor*, const GrSimpleMesh GrMockOpTarget::fStaticVertexData[], int, const GrSurfaceProxy* const[], GrPrimitiveType)) private char[6 *1024 *1024]

Definition at line 149 of file GrMockOpTarget.h.


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