7#ifndef GrOpFlushState_DEFINED
8#define GrOpFlushState_DEFINED
51class SmallPathAtlasMgr;
96 , fSurfaceView(surfaceView)
97 , fRenderTargetProxy(surfaceView.asRenderTargetProxy())
101 , fRenderPassXferBarriers(renderPassXferBarriers)
118 void validate()
const {
128 bool fUsesMSAASurface;
144 fSampledProxies = sampledProxies;
148 return fSampledProxies;
164 int* startVertex) final;
168 int* actualVertexCount) final;
171 int* actualIndexCount) final;
173 size_t*
offset)
override {
178 size_t*
offset)
override {
218#if !defined(SK_ENABLE_OPTIMIZE_SIZE)
229 (this->appliedClip() && this->appliedClip()->scissorState().enabled()));
259 fOpsRenderPass->
bindTextures(geomProc, geomProcTextures, pipeline);
264 fOpsRenderPass->
bindBuffers(std::move(indexBuffer), std::move(instanceBuffer),
265 std::move(vertexBuffer), primitiveRestart);
267 void draw(
int vertexCount,
int baseVertex) {
268 fOpsRenderPass->
draw(vertexCount, baseVertex);
270 void drawIndexed(
int indexCount,
int baseIndex, uint16_t minIndexValue, uint16_t maxIndexValue,
272 fOpsRenderPass->
drawIndexed(indexCount, baseIndex, minIndexValue, maxIndexValue,
275 void drawInstanced(
int instanceCount,
int baseInstance,
int vertexCount,
int baseVertex) {
276 fOpsRenderPass->
drawInstanced(instanceCount, baseInstance, vertexCount, baseVertex);
290 int maxPatternRepetitionsInIndexBuffer,
int patternVertexCount,
293 maxPatternRepetitionsInIndexBuffer, patternVertexCount,
298 struct InlineUpload {
300 : fUpload(
std::move(
upload)), fUploadBeforeToken(token) {}
317 const GrOp* fOp =
nullptr;
341 OpArgs* fOpArgs =
nullptr;
std::function< void(GrDeferredTextureUploadWritePixelsFn &)> GrDeferredTextureUploadFn
GrGeometryProcessor * fGeometryProcessor
const GrAppliedHardClip & hardClip() const
static const GrAppliedHardClip & Disabled()
void putBackIndexed(int drawCount)
GrDrawIndirectWriter makeSpace(int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offset)
void putBack(int drawCount)
GrDrawIndexedIndirectWriter makeIndexedSpace(int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offset)
int numTextureSamplers() const
void setScissorRect(const SkIRect &scissorRect)
GrLoadOp colorLoadOp() const final
const GrDstProxyView & dstProxyView() const final
const skgpu::TokenTracker * tokenTracker() final
sktext::gpu::StrikeCache * strikeCache() const final
void putBackIndexedIndirectDraws(int drawCount) final
void bindTextures(const GrGeometryProcessor &geomProc, const GrSurfaceProxy *const geomProcTextures[], const GrPipeline &pipeline)
void setOpArgs(OpArgs *opArgs)
GrDeferredUploadTarget * deferredUploadTarget() final
GrXferBarrierFlags renderPassBarriers() const final
const GrAppliedHardClip & appliedHardClip() const
SkArenaAlloc * allocator() override
skgpu::ganesh::SmallPathAtlasMgr * smallPathAtlasManager() const final
void setOpsRenderPass(GrOpsRenderPass *renderPass)
void drawMesh(const GrSimpleMesh &mesh)
uint16_t * makeIndexSpace(int indexCount, sk_sp< const GrBuffer > *, int *startIndex) final
void drawIndexedInstanced(int indexCount, int baseIndex, int instanceCount, int baseInstance, int baseVertex)
const GrAppliedClip * appliedClip() const final
void bindPipelineAndScissorClip(const GrProgramInfo &programInfo, const SkRect &drawBounds)
GrThreadSafeCache * threadSafeCache() const final
void recordDraw(const GrGeometryProcessor *, const GrSimpleMesh[], int meshCnt, const GrSurfaceProxy *const primProcProxies[], GrPrimitiveType) final
void putBackIndirectDraws(int drawCount) final
void putBackIndices(int indexCount) final
void * makeVertexSpaceAtLeast(size_t vertexSize, int minVertexCount, int fallbackVertexCount, sk_sp< const GrBuffer > *, int *startVertex, int *actualVertexCount) final
void bindBuffers(sk_sp< const GrBuffer > indexBuffer, sk_sp< const GrBuffer > instanceBuffer, sk_sp< const GrBuffer > vertexBuffer, GrPrimitiveRestart primitiveRestart=GrPrimitiveRestart::kNo)
void setSampledProxyArray(skia_private::TArray< GrSurfaceProxy *, true > *sampledProxies)
const GrSurfaceProxyView & writeView() const final
void drawInstanced(int instanceCount, int baseInstance, int vertexCount, int baseVertex)
GrResourceProvider * resourceProvider() const final
GrAppliedClip detachAppliedClip() final
GrAtlasManager * atlasManager() const final
const GrCaps & caps() const final
void drawIndexedIndirect(const GrBuffer *drawIndirectBuffer, size_t offset, int drawCount)
GrDrawIndexedIndirectWriter makeDrawIndexedIndirectSpace(int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offset) override
GrDrawIndirectWriter makeDrawIndirectSpace(int drawCount, sk_sp< const GrBuffer > *buffer, size_t *offset) override
skia_private::TArray< GrSurfaceProxy *, true > * sampledProxyArray() override
GrRenderTargetProxy * rtProxy() const final
skgpu::AtlasToken addInlineUpload(GrDeferredTextureUploadFn &&) final
void drawIndexed(int indexCount, int baseIndex, uint16_t minIndexValue, uint16_t maxIndexValue, int baseVertex)
GrOpsRenderPass * opsRenderPass()
void putBackVertices(int vertices, size_t vertexStride) final
void bindPipeline(const GrProgramInfo &programInfo, const SkRect &drawBounds)
void * makeVertexSpace(size_t vertexSize, int vertexCount, sk_sp< const GrBuffer > *, int *startVertex) final
void executeDrawsAndUploadsForMeshDrawOp(const GrOp *op, const SkRect &chainBounds, const GrPipeline *, const GrUserStencilSettings *)
const OpArgs & drawOpArgs() const
uint16_t * makeIndexSpaceAtLeast(int minIndexCount, int fallbackIndexCount, sk_sp< const GrBuffer > *, int *startIndex, int *actualIndexCount) final
void bindTextures(const GrGeometryProcessor &geomProc, const GrSurfaceProxy &singleGeomProcTexture, const GrPipeline &pipeline)
void drawIndirect(const GrBuffer *drawIndirectBuffer, size_t offset, int drawCount)
void doUpload(GrDeferredTextureUploadFn &, bool shouldPrepareSurfaceForSampling=false)
void draw(int vertexCount, int baseVertex)
bool usesMSAASurface() const final
skgpu::AtlasToken addASAPUpload(GrDeferredTextureUploadFn &&) final
void drawIndexPattern(int patternIndexCount, int patternRepeatCount, int maxPatternRepetitionsInIndexBuffer, int patternVertexCount, int baseVertex)
void bindTextures(const GrGeometryProcessor &, const GrSurfaceProxy *const geomProcTextures[], const GrPipeline &)
void bindPipeline(const GrProgramInfo &, const SkRect &drawBounds)
void draw(int vertexCount, int baseVertex)
void drawInstanced(int instanceCount, int baseInstance, int vertexCount, int baseVertex)
void drawIndexPattern(int patternIndexCount, int patternRepeatCount, int maxPatternRepetitionsInIndexBuffer, int patternVertexCount, int baseVertex)
void bindBuffers(sk_sp< const GrBuffer > indexBuffer, sk_sp< const GrBuffer > instanceBuffer, sk_sp< const GrBuffer > vertexBuffer, GrPrimitiveRestart=GrPrimitiveRestart::kNo)
void setScissorRect(const SkIRect &)
void drawIndexed(int indexCount, int baseIndex, uint16_t minIndexValue, uint16_t maxIndexValue, int baseVertex)
void drawIndexedIndirect(const GrBuffer *drawIndirectBuffer, size_t bufferOffset, int drawCount)
void drawIndexedInstanced(int indexCount, int baseIndex, int instanceCount, int baseInstance, int baseVertex)
void drawIndirect(const GrBuffer *drawIndirectBuffer, size_t bufferOffset, int drawCount)
bool isScissorTestEnabled() const
const GrPipeline & pipeline() const
GrRenderTargetProxy * asRenderTargetProxy() const
static AtlasToken InvalidToken()
static void Draw(SkCanvas *canvas, const SkRect &rect)
static const uint8_t buffer[]
OpArgs(GrOp *op, const GrSurfaceProxyView &surfaceView, bool usesMSAASurface, GrAppliedClip *appliedClip, const GrDstProxyView &dstProxyView, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)
GrXferBarrierFlags renderPassBarriers() const
GrAppliedClip * appliedClip()
GrRenderTargetProxy * rtProxy() const
const GrDstProxyView & dstProxyView() const
GrLoadOp colorLoadOp() const
const GrAppliedClip * appliedClip() const
const GrSurfaceProxyView & writeView() const
bool usesMSAASurface() const