Skip to content

Commit

Permalink
Convert FillRRectOp to the new bind/draw API
Browse files Browse the repository at this point in the history
Change-Id: Ide8f951ec64c245f94ddae5b442a115495b3e3f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275550
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
  • Loading branch information
csmartdalton86 authored and Skia Commit-Bot committed Mar 10, 2020
1 parent 2e30796 commit 78dac6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/gpu/GrOpFlushState.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ class GrOpFlushState final : public GrDeferredUploadTarget, public GrMeshDrawOp:
const GrSurfaceProxyView* outputView() const final { return this->drawOpArgs().outputView(); }
GrRenderTargetProxy* proxy() const final { return this->drawOpArgs().proxy(); }
const GrAppliedClip* appliedClip() const final { return this->drawOpArgs().appliedClip(); }
const SkIRect* scissorRectIfEnabled() const {
return this->appliedClip() ? this->appliedClip()->scissorRectIfEnabled() : nullptr;
}
GrAppliedClip detachAppliedClip() final;
const GrXferProcessor::DstProxyView& dstProxyView() const final {
return this->drawOpArgs().dstProxyView();
Expand Down
13 changes: 5 additions & 8 deletions src/gpu/ops/GrFillRRectOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,14 +900,11 @@ void FillRRectOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBound
fProgramInfo = this->createProgramInfo(flushState);
}

GrMesh* mesh = flushState->allocator()->make<GrMesh>();
mesh->setIndexedInstanced(std::move(fIndexBuffer), fIndexCount,
std::move(fInstanceBuffer), fInstanceCount,
fBaseInstance, GrPrimitiveRestart::kNo);
mesh->setVertexData(std::move(fVertexBuffer));

flushState->opsRenderPass()->bindPipeline(*fProgramInfo, this->bounds());
flushState->opsRenderPass()->drawMeshes(*fProgramInfo, mesh, 1);
GrOpsRenderPass* renderPass = flushState->opsRenderPass();
renderPass->bindPipeline(*fProgramInfo, this->bounds(), flushState->scissorRectIfEnabled());
renderPass->bindTextures(fProgramInfo->primProc(), nullptr, fProgramInfo->pipeline());
renderPass->bindBuffers(fIndexBuffer.get(), fInstanceBuffer.get(), fVertexBuffer.get());
renderPass->drawIndexedInstanced(fIndexCount, 0, fInstanceCount, fBaseInstance, 0);
}

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

0 comments on commit 78dac6d

Please sign in to comment.