Flutter Engine
The Flutter Engine
|
#include <GrOpFlushState.h>
Classes | |
struct | OpArgs |
Public Member Functions | |
GrOpFlushState (GrGpu *, GrResourceProvider *, skgpu::TokenTracker *, sk_sp< GrBufferAllocPool::CpuBufferCache >=nullptr) | |
~GrOpFlushState () final | |
void | preExecuteDraws () |
void | doUpload (GrDeferredTextureUploadFn &, bool shouldPrepareSurfaceForSampling=false) |
void | executeDrawsAndUploadsForMeshDrawOp (const GrOp *op, const SkRect &chainBounds, const GrPipeline *, const GrUserStencilSettings *) |
GrOpsRenderPass * | opsRenderPass () |
void | setOpsRenderPass (GrOpsRenderPass *renderPass) |
GrGpu * | gpu () |
void | reset () |
void | setOpArgs (OpArgs *opArgs) |
const OpArgs & | drawOpArgs () const |
void | setSampledProxyArray (skia_private::TArray< GrSurfaceProxy *, true > *sampledProxies) |
skia_private::TArray< GrSurfaceProxy *, true > * | sampledProxyArray () override |
const skgpu::TokenTracker * | tokenTracker () final |
skgpu::AtlasToken | addInlineUpload (GrDeferredTextureUploadFn &&) final |
skgpu::AtlasToken | addASAPUpload (GrDeferredTextureUploadFn &&) final |
void | recordDraw (const GrGeometryProcessor *, const GrSimpleMesh[], int meshCnt, const GrSurfaceProxy *const primProcProxies[], GrPrimitiveType) final |
void * | makeVertexSpace (size_t vertexSize, int vertexCount, sk_sp< const GrBuffer > *, int *startVertex) final |
uint16_t * | makeIndexSpace (int indexCount, sk_sp< const GrBuffer > *, int *startIndex) final |
void * | makeVertexSpaceAtLeast (size_t vertexSize, int minVertexCount, int fallbackVertexCount, sk_sp< const GrBuffer > *, int *startVertex, int *actualVertexCount) final |
uint16_t * | makeIndexSpaceAtLeast (int minIndexCount, int fallbackIndexCount, sk_sp< const GrBuffer > *, int *startIndex, int *actualIndexCount) final |
GrDrawIndirectWriter | makeDrawIndirectSpace (int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offset) override |
GrDrawIndexedIndirectWriter | makeDrawIndexedIndirectSpace (int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offset) override |
void | putBackIndices (int indexCount) final |
void | putBackVertices (int vertices, size_t vertexStride) final |
void | putBackIndirectDraws (int drawCount) final |
void | putBackIndexedIndirectDraws (int drawCount) final |
const GrSurfaceProxyView & | writeView () const final |
GrRenderTargetProxy * | rtProxy () const final |
bool | usesMSAASurface () const final |
const GrAppliedClip * | appliedClip () const final |
const GrAppliedHardClip & | appliedHardClip () const |
GrAppliedClip | detachAppliedClip () final |
const GrDstProxyView & | dstProxyView () const final |
GrXferBarrierFlags | renderPassBarriers () const final |
GrLoadOp | colorLoadOp () const final |
GrDeferredUploadTarget * | deferredUploadTarget () final |
const GrCaps & | caps () const final |
GrThreadSafeCache * | threadSafeCache () const final |
GrResourceProvider * | resourceProvider () const final |
sktext::gpu::StrikeCache * | strikeCache () const final |
GrAtlasManager * | atlasManager () const final |
skgpu::ganesh::SmallPathAtlasMgr * | smallPathAtlasManager () const final |
SkArenaAlloc * | allocator () override |
void | bindPipelineAndScissorClip (const GrProgramInfo &programInfo, const SkRect &drawBounds) |
void | bindTextures (const GrGeometryProcessor &geomProc, const GrSurfaceProxy &singleGeomProcTexture, const GrPipeline &pipeline) |
void | drawMesh (const GrSimpleMesh &mesh) |
void | bindPipeline (const GrProgramInfo &programInfo, const SkRect &drawBounds) |
void | setScissorRect (const SkIRect &scissorRect) |
void | bindTextures (const GrGeometryProcessor &geomProc, const GrSurfaceProxy *const geomProcTextures[], const GrPipeline &pipeline) |
void | bindBuffers (sk_sp< const GrBuffer > indexBuffer, sk_sp< const GrBuffer > instanceBuffer, sk_sp< const GrBuffer > vertexBuffer, GrPrimitiveRestart primitiveRestart=GrPrimitiveRestart::kNo) |
void | draw (int vertexCount, int baseVertex) |
void | drawIndexed (int indexCount, int baseIndex, uint16_t minIndexValue, uint16_t maxIndexValue, int baseVertex) |
void | drawInstanced (int instanceCount, int baseInstance, int vertexCount, int baseVertex) |
void | drawIndexedInstanced (int indexCount, int baseIndex, int instanceCount, int baseInstance, int baseVertex) |
void | drawIndirect (const GrBuffer *drawIndirectBuffer, size_t offset, int drawCount) |
void | drawIndexedIndirect (const GrBuffer *drawIndirectBuffer, size_t offset, int drawCount) |
void | drawIndexPattern (int patternIndexCount, int patternRepeatCount, int maxPatternRepetitionsInIndexBuffer, int patternVertexCount, int baseVertex) |
Public Member Functions inherited from GrDeferredUploadTarget | |
virtual | ~GrDeferredUploadTarget () |
virtual const skgpu::TokenTracker * | tokenTracker ()=0 |
virtual skgpu::AtlasToken | addInlineUpload (GrDeferredTextureUploadFn &&)=0 |
virtual skgpu::AtlasToken | addASAPUpload (GrDeferredTextureUploadFn &&upload)=0 |
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 |
GrSimpleMesh * | allocMesh () |
GrSimpleMesh * | allocMeshes (int n) |
const GrSurfaceProxy ** | allocPrimProcProxyPtrs (int n) |
virtual GrRenderTargetProxy * | rtProxy () const =0 |
virtual const GrSurfaceProxyView & | writeView () const =0 |
virtual const GrAppliedClip * | appliedClip () const =0 |
virtual GrAppliedClip | detachAppliedClip ()=0 |
virtual const GrDstProxyView & | dstProxyView () const =0 |
virtual bool | usesMSAASurface () const =0 |
virtual GrXferBarrierFlags | renderPassBarriers () const =0 |
virtual GrLoadOp | colorLoadOp () const =0 |
virtual GrThreadSafeCache * | threadSafeCache () const =0 |
virtual GrResourceProvider * | resourceProvider () const =0 |
uint32_t | contextUniqueID () const |
virtual sktext::gpu::StrikeCache * | strikeCache () const =0 |
virtual GrAtlasManager * | atlasManager () const =0 |
virtual skgpu::ganesh::SmallPathAtlasMgr * | smallPathAtlasManager () const =0 |
virtual skia_private::TArray< GrSurfaceProxy *, true > * | sampledProxyArray ()=0 |
virtual const GrCaps & | caps () const =0 |
virtual GrDeferredUploadTarget * | deferredUploadTarget ()=0 |
virtual SkArenaAlloc * | allocator ()=0 |
Tracks the state across all the GrOps (really just the GrDrawOps) in a OpsTask flush.
Definition at line 58 of file GrOpFlushState.h.
GrOpFlushState::GrOpFlushState | ( | GrGpu * | gpu, |
GrResourceProvider * | resourceProvider, | ||
skgpu::TokenTracker * | tokenTracker, | ||
sk_sp< GrBufferAllocPool::CpuBufferCache > | cpuBufferCache = nullptr |
||
) |
Definition at line 31 of file GrOpFlushState.cpp.
|
inlinefinal |
Definition at line 66 of file GrOpFlushState.h.
|
finalvirtual |
Returns the token of the draw that this upload will occur before. Since ASAP uploads are done first during a flush, this will be the first token since the most recent flush.
Implements GrDeferredUploadTarget.
Definition at line 157 of file GrOpFlushState.cpp.
|
finalvirtual |
Returns the token of the draw that this upload will occur before.
Implements GrDeferredUploadTarget.
Definition at line 152 of file GrOpFlushState.cpp.
|
inlineoverridevirtual |
GrMeshDrawTarget override.
Implements GrMeshDrawTarget.
Definition at line 223 of file GrOpFlushState.h.
|
inlinefinalvirtual |
|
inline |
Definition at line 191 of file GrOpFlushState.h.
|
finalvirtual |
Implements GrMeshDrawTarget.
Definition at line 228 of file GrOpFlushState.cpp.
|
inline |
Definition at line 261 of file GrOpFlushState.h.
|
inline |
Definition at line 250 of file GrOpFlushState.h.
|
inline |
Definition at line 227 of file GrOpFlushState.h.
|
inline |
Definition at line 238 of file GrOpFlushState.h.
|
inline |
Definition at line 256 of file GrOpFlushState.h.
|
finalvirtual |
Implements GrMeshDrawTarget.
Definition at line 41 of file GrOpFlushState.cpp.
|
inlinefinalvirtual |
|
inlinefinalvirtual |
|
finalvirtual |
Implements GrMeshDrawTarget.
Definition at line 220 of file GrOpFlushState.cpp.
void GrOpFlushState::doUpload | ( | GrDeferredTextureUploadFn & | upload, |
bool | shouldPrepareSurfaceForSampling = false |
||
) |
Called to upload data to a texture using the GrDeferredTextureUploadFn. If the uploaded surface needs to be prepared for being sampled in a draw after the upload, the caller should pass in true for shouldPrepareSurfaceForSampling. This feature is needed for Vulkan when doing inline uploads to reset the image layout back to sampled.
Definition at line 110 of file GrOpFlushState.cpp.
Definition at line 267 of file GrOpFlushState.h.
|
inline |
Definition at line 270 of file GrOpFlushState.h.
|
inline |
Definition at line 286 of file GrOpFlushState.h.
|
inline |
Definition at line 278 of file GrOpFlushState.h.
|
inline |
Definition at line 289 of file GrOpFlushState.h.
|
inline |
Definition at line 283 of file GrOpFlushState.h.
|
inline |
Definition at line 275 of file GrOpFlushState.h.
void GrOpFlushState::drawMesh | ( | const GrSimpleMesh & | mesh | ) |
Definition at line 238 of file GrOpFlushState.cpp.
|
inline |
Definition at line 137 of file GrOpFlushState.h.
|
inlinefinalvirtual |
Implements GrMeshDrawTarget.
Definition at line 196 of file GrOpFlushState.h.
void GrOpFlushState::executeDrawsAndUploadsForMeshDrawOp | ( | const GrOp * | op, |
const SkRect & | chainBounds, | ||
const GrPipeline * | pipeline, | ||
const GrUserStencilSettings * | userStencilSettings | ||
) |
Called as ops are executed. Must be called in the same order as the ops were prepared.
Definition at line 49 of file GrOpFlushState.cpp.
|
inline |
Definition at line 85 of file GrOpFlushState.h.
|
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 176 of file GrOpFlushState.h.
|
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 172 of file GrOpFlushState.h.
|
finalvirtual |
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.
Implements GrMeshDrawTarget.
Definition at line 193 of file GrOpFlushState.cpp.
|
finalvirtual |
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.
Implements GrMeshDrawTarget.
Definition at line 205 of file GrOpFlushState.cpp.
|
finalvirtual |
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 188 of file GrOpFlushState.cpp.
|
finalvirtual |
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 198 of file GrOpFlushState.cpp.
|
inline |
Definition at line 82 of file GrOpFlushState.h.
void GrOpFlushState::preExecuteDraws | ( | ) |
This is called after each op has a chance to prepare its draws and before the draws are executed.
Definition at line 84 of file GrOpFlushState.cpp.
|
inlinefinalvirtual |
Implements GrMeshDrawTarget.
Definition at line 184 of file GrOpFlushState.h.
|
finalvirtual |
Helpers for ops which over-allocate and then return excess data to the pool.
Implements GrMeshDrawTarget.
Definition at line 212 of file GrOpFlushState.cpp.
|
inlinefinalvirtual |
Implements GrMeshDrawTarget.
Definition at line 183 of file GrOpFlushState.h.
|
finalvirtual |
Implements GrMeshDrawTarget.
Definition at line 216 of file GrOpFlushState.cpp.
|
finalvirtual |
Overrides of GrMeshDrawTarget.
Implements GrMeshDrawTarget.
Definition at line 162 of file GrOpFlushState.cpp.
|
inlinefinalvirtual |
Implements GrMeshDrawTarget.
Definition at line 200 of file GrOpFlushState.h.
void GrOpFlushState::reset | ( | ) |
Definition at line 97 of file GrOpFlushState.cpp.
|
inlinefinalvirtual |
Implements GrMeshDrawTarget.
Definition at line 211 of file GrOpFlushState.h.
|
inlinefinalvirtual |
Implements GrMeshDrawTarget.
Definition at line 188 of file GrOpFlushState.h.
|
inlineoverridevirtual |
Implements GrMeshDrawTarget.
Definition at line 147 of file GrOpFlushState.h.
|
inline |
Definition at line 135 of file GrOpFlushState.h.
|
inline |
Definition at line 83 of file GrOpFlushState.h.
|
inline |
Definition at line 143 of file GrOpFlushState.h.
|
inline |
Definition at line 253 of file GrOpFlushState.h.
|
finalvirtual |
Implements GrMeshDrawTarget.
Definition at line 233 of file GrOpFlushState.cpp.
|
finalvirtual |
Implements GrMeshDrawTarget.
Definition at line 224 of file GrOpFlushState.cpp.
|
finalvirtual |
Implements GrMeshDrawTarget.
Definition at line 45 of file GrOpFlushState.cpp.
|
inlinefinalvirtual |
Overrides of GrDeferredUploadTarget.
Implements GrDeferredUploadTarget.
Definition at line 153 of file GrOpFlushState.h.
|
inlinefinalvirtual |
|
inlinefinalvirtual |
Implements GrMeshDrawTarget.
Definition at line 187 of file GrOpFlushState.h.