Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 78dac6d

Browse files
csmartdalton86Skia Commit-Bot
authored and
Skia Commit-Bot
committed
Convert FillRRectOp to the new bind/draw API
Change-Id: Ide8f951ec64c245f94ddae5b442a115495b3e3f0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275550 Reviewed-by: Robert Phillips <[email protected]> Commit-Queue: Chris Dalton <[email protected]>
1 parent 2e30796 commit 78dac6d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/gpu/GrOpFlushState.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ class GrOpFlushState final : public GrDeferredUploadTarget, public GrMeshDrawOp:
135135
const GrSurfaceProxyView* outputView() const final { return this->drawOpArgs().outputView(); }
136136
GrRenderTargetProxy* proxy() const final { return this->drawOpArgs().proxy(); }
137137
const GrAppliedClip* appliedClip() const final { return this->drawOpArgs().appliedClip(); }
138+
const SkIRect* scissorRectIfEnabled() const {
139+
return this->appliedClip() ? this->appliedClip()->scissorRectIfEnabled() : nullptr;
140+
}
138141
GrAppliedClip detachAppliedClip() final;
139142
const GrXferProcessor::DstProxyView& dstProxyView() const final {
140143
return this->drawOpArgs().dstProxyView();

src/gpu/ops/GrFillRRectOp.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -900,14 +900,11 @@ void FillRRectOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBound
900900
fProgramInfo = this->createProgramInfo(flushState);
901901
}
902902

903-
GrMesh* mesh = flushState->allocator()->make<GrMesh>();
904-
mesh->setIndexedInstanced(std::move(fIndexBuffer), fIndexCount,
905-
std::move(fInstanceBuffer), fInstanceCount,
906-
fBaseInstance, GrPrimitiveRestart::kNo);
907-
mesh->setVertexData(std::move(fVertexBuffer));
908-
909-
flushState->opsRenderPass()->bindPipeline(*fProgramInfo, this->bounds());
910-
flushState->opsRenderPass()->drawMeshes(*fProgramInfo, mesh, 1);
903+
GrOpsRenderPass* renderPass = flushState->opsRenderPass();
904+
renderPass->bindPipeline(*fProgramInfo, this->bounds(), flushState->scissorRectIfEnabled());
905+
renderPass->bindTextures(fProgramInfo->primProc(), nullptr, fProgramInfo->pipeline());
906+
renderPass->bindBuffers(fIndexBuffer.get(), fInstanceBuffer.get(), fVertexBuffer.get());
907+
renderPass->drawIndexedInstanced(fIndexCount, 0, fInstanceCount, fBaseInstance, 0);
911908
}
912909

913910
// Will the given corner look good if we use HW derivatives?

0 commit comments

Comments
 (0)