From bde428513ff3bd98a3d4f1c66ac779411233f817 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 21 Dec 2016 11:37:49 -0500 Subject: [PATCH] Rename GrOp::draw to GrOp::execute Change-Id: I36b8532c57d0b6004a5fd283e30a506df89a4fa6 Reviewed-on: https://skia-review.googlesource.com/6387 Commit-Queue: Brian Salomon Reviewed-by: Brian Osman --- src/gpu/GrRenderTargetOpList.cpp | 2 +- src/gpu/GrTextureOpList.cpp | 2 +- src/gpu/instanced/InstancedRendering.cpp | 2 +- src/gpu/instanced/InstancedRendering.h | 2 +- src/gpu/ops/GrClearOp.h | 2 +- src/gpu/ops/GrClearStencilClipOp.h | 2 +- src/gpu/ops/GrCopySurfaceOp.h | 2 +- src/gpu/ops/GrDiscardOp.h | 2 +- src/gpu/ops/GrDrawPathOp.cpp | 4 ++-- src/gpu/ops/GrDrawPathOp.h | 4 ++-- src/gpu/ops/GrMeshDrawOp.cpp | 2 +- src/gpu/ops/GrMeshDrawOp.h | 2 +- src/gpu/ops/GrOp.h | 10 ++++++---- src/gpu/ops/GrStencilPathOp.h | 2 +- 14 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp index 0d380a1..7ca7250 100644 --- a/src/gpu/GrRenderTargetOpList.cpp +++ b/src/gpu/GrRenderTargetOpList.cpp @@ -201,7 +201,7 @@ bool GrRenderTargetOpList::executeOps(GrOpFlushState* flushState) { } flushState->setCommandBuffer(commandBuffer.get()); } - fRecordedOps[i].fOp->draw(flushState, fRecordedOps[i].fClippedBounds); + fRecordedOps[i].fOp->execute(flushState, fRecordedOps[i].fClippedBounds); } if (commandBuffer) { commandBuffer->end(); diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp index 771a006..b17de3f 100644 --- a/src/gpu/GrTextureOpList.cpp +++ b/src/gpu/GrTextureOpList.cpp @@ -65,7 +65,7 @@ bool GrTextureOpList::executeOps(GrOpFlushState* flushState) { } for (int i = 0; i < fRecordedOps.count(); ++i) { - fRecordedOps[i]->draw(flushState, fRecordedOps[i]->bounds()); + fRecordedOps[i]->execute(flushState, fRecordedOps[i]->bounds()); } fGpu->finishOpList(); diff --git a/src/gpu/instanced/InstancedRendering.cpp b/src/gpu/instanced/InstancedRendering.cpp index ec6a9c9..08fdf3e 100644 --- a/src/gpu/instanced/InstancedRendering.cpp +++ b/src/gpu/instanced/InstancedRendering.cpp @@ -460,7 +460,7 @@ void InstancedRendering::beginFlush(GrResourceProvider* rp) { this->onBeginFlush(rp); } -void InstancedRendering::Op::onDraw(GrOpFlushState* state, const SkRect& bounds) { +void InstancedRendering::Op::onExecute(GrOpFlushState* state, const SkRect& bounds) { SkASSERT(State::kFlushing == fInstancedRendering->fState); SkASSERT(state->gpu() == fInstancedRendering->gpu()); diff --git a/src/gpu/instanced/InstancedRendering.h b/src/gpu/instanced/InstancedRendering.h index 09cac98..20d0617 100644 --- a/src/gpu/instanced/InstancedRendering.h +++ b/src/gpu/instanced/InstancedRendering.h @@ -149,7 +149,7 @@ protected: void applyPipelineOptimizations(const GrPipelineOptimizations&) override; bool onCombineIfPossible(GrOp* other, const GrCaps& caps) override; void onPrepare(GrOpFlushState*) override {} - void onDraw(GrOpFlushState*, const SkRect& bounds) override; + void onExecute(GrOpFlushState*, const SkRect& bounds) override; typedef GrDrawOp INHERITED; diff --git a/src/gpu/ops/GrClearOp.h b/src/gpu/ops/GrClearOp.h index 03722ca..1a4b33a 100644 --- a/src/gpu/ops/GrClearOp.h +++ b/src/gpu/ops/GrClearOp.h @@ -113,7 +113,7 @@ private: void onPrepare(GrOpFlushState*) override {} - void onDraw(GrOpFlushState* state, const SkRect& /*bounds*/) override { + void onExecute(GrOpFlushState* state, const SkRect& /*bounds*/) override { state->commandBuffer()->clear(fRenderTarget.get(), fClip, fColor); } diff --git a/src/gpu/ops/GrClearStencilClipOp.h b/src/gpu/ops/GrClearStencilClipOp.h index 1d3b4b1..a5d6a03 100644 --- a/src/gpu/ops/GrClearStencilClipOp.h +++ b/src/gpu/ops/GrClearStencilClipOp.h @@ -57,7 +57,7 @@ private: void onPrepare(GrOpFlushState*) override {} - void onDraw(GrOpFlushState* state, const SkRect& /*bounds*/) override { + void onExecute(GrOpFlushState* state, const SkRect& /*bounds*/) override { state->commandBuffer()->clearStencilClip(fRenderTarget.get(), fClip, fInsideStencilMask); } diff --git a/src/gpu/ops/GrCopySurfaceOp.h b/src/gpu/ops/GrCopySurfaceOp.h index 77b4009..789f7a2 100644 --- a/src/gpu/ops/GrCopySurfaceOp.h +++ b/src/gpu/ops/GrCopySurfaceOp.h @@ -65,7 +65,7 @@ private: void onPrepare(GrOpFlushState*) override {} - void onDraw(GrOpFlushState* state, const SkRect& /*bounds*/) override { + void onExecute(GrOpFlushState* state, const SkRect& /*bounds*/) override { if (!state->commandBuffer()) { state->gpu()->copySurface(fDst.get(), fSrc.get(), fSrcRect, fDstPoint); } else { diff --git a/src/gpu/ops/GrDiscardOp.h b/src/gpu/ops/GrDiscardOp.h index b978790..e7225af 100644 --- a/src/gpu/ops/GrDiscardOp.h +++ b/src/gpu/ops/GrDiscardOp.h @@ -44,7 +44,7 @@ private: void onPrepare(GrOpFlushState*) override {} - void onDraw(GrOpFlushState* state, const SkRect& /*bounds*/) override { + void onExecute(GrOpFlushState* state, const SkRect& /*bounds*/) override { state->commandBuffer()->discard(fRenderTarget.get()); } diff --git a/src/gpu/ops/GrDrawPathOp.cpp b/src/gpu/ops/GrDrawPathOp.cpp index 8ca097e..e60311b 100644 --- a/src/gpu/ops/GrDrawPathOp.cpp +++ b/src/gpu/ops/GrDrawPathOp.cpp @@ -27,7 +27,7 @@ SkString GrDrawPathOp::dumpInfo() const { return string; } -void GrDrawPathOp::onDraw(GrOpFlushState* state, const SkRect& bounds) { +void GrDrawPathOp::onExecute(GrOpFlushState* state, const SkRect& bounds) { GrProgramDesc desc; sk_sp pathProc( @@ -116,7 +116,7 @@ bool GrDrawPathRangeOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) { return true; } -void GrDrawPathRangeOp::onDraw(GrOpFlushState* state, const SkRect& bounds) { +void GrDrawPathRangeOp::onExecute(GrOpFlushState* state, const SkRect& bounds) { const Draw& head = *fDraws.head(); SkMatrix drawMatrix(this->viewMatrix()); diff --git a/src/gpu/ops/GrDrawPathOp.h b/src/gpu/ops/GrDrawPathOp.h index 5d6c35d..95cbc7e 100644 --- a/src/gpu/ops/GrDrawPathOp.h +++ b/src/gpu/ops/GrDrawPathOp.h @@ -77,7 +77,7 @@ private: bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override { return false; } - void onDraw(GrOpFlushState* state, const SkRect& bounds) override; + void onExecute(GrOpFlushState* state, const SkRect& bounds) override; GrPendingIOResource fPath; @@ -170,7 +170,7 @@ private: bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override; - void onDraw(GrOpFlushState* state, const SkRect& bounds) override; + void onExecute(GrOpFlushState* state, const SkRect& bounds) override; struct Draw { void set(const InstanceData* instanceData, SkScalar x, SkScalar y) { diff --git a/src/gpu/ops/GrMeshDrawOp.cpp b/src/gpu/ops/GrMeshDrawOp.cpp index 5f132ee..a8dd8b1 100644 --- a/src/gpu/ops/GrMeshDrawOp.cpp +++ b/src/gpu/ops/GrMeshDrawOp.cpp @@ -59,7 +59,7 @@ void* GrMeshDrawOp::QuadHelper::init(Target* target, size_t vertexStride, int qu quadsToDraw); } -void GrMeshDrawOp::onDraw(GrOpFlushState* state, const SkRect& bounds) { +void GrMeshDrawOp::onExecute(GrOpFlushState* state, const SkRect& bounds) { int currUploadIdx = 0; int currMeshIdx = 0; diff --git a/src/gpu/ops/GrMeshDrawOp.h b/src/gpu/ops/GrMeshDrawOp.h index 20e55c9..25fed02 100644 --- a/src/gpu/ops/GrMeshDrawOp.h +++ b/src/gpu/ops/GrMeshDrawOp.h @@ -64,7 +64,7 @@ protected: private: void onPrepare(GrOpFlushState* state) final; - void onDraw(GrOpFlushState* state, const SkRect& bounds) final; + void onExecute(GrOpFlushState* state, const SkRect& bounds) final; virtual void onPrepareDraws(Target*) const = 0; diff --git a/src/gpu/ops/GrOp.h b/src/gpu/ops/GrOp.h index 586d685..47a8097 100644 --- a/src/gpu/ops/GrOp.h +++ b/src/gpu/ops/GrOp.h @@ -120,12 +120,14 @@ public: } SkDEBUGCODE(bool isUsed() const { return fUsed; }) - /** Called prior to drawing. The op should perform any resource creation necessary to - to quickly issue its draw when draw is called. */ + /** + * Called prior to executing. The op should perform any resource creation or data transfers + * necessary before execute() is called. + */ void prepare(GrOpFlushState* state) { this->onPrepare(state); } /** Issues the op's commands to GrGpu. */ - void draw(GrOpFlushState* state, const SkRect& bounds) { this->onDraw(state, bounds); } + void execute(GrOpFlushState* state, const SkRect& bounds) { this->onExecute(state, bounds); } /** Used to block combining across render target changes. Remove this once we store GrOps for different RTs in different targets. */ @@ -189,7 +191,7 @@ private: virtual bool onCombineIfPossible(GrOp*, const GrCaps& caps) = 0; virtual void onPrepare(GrOpFlushState*) = 0; - virtual void onDraw(GrOpFlushState*, const SkRect& bounds) = 0; + virtual void onExecute(GrOpFlushState*, const SkRect& bounds) = 0; static uint32_t GenID(int32_t* idCounter) { // The atomic inc returns the old value not the incremented value. So we add diff --git a/src/gpu/ops/GrStencilPathOp.h b/src/gpu/ops/GrStencilPathOp.h index 364dc64..fc29402 100644 --- a/src/gpu/ops/GrStencilPathOp.h +++ b/src/gpu/ops/GrStencilPathOp.h @@ -69,7 +69,7 @@ private: void onPrepare(GrOpFlushState*) override {} - void onDraw(GrOpFlushState* state, const SkRect& bounds) override { + void onExecute(GrOpFlushState* state, const SkRect& bounds) override { GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fViewMatrix, &fScissor, &fStencil); state->gpu()->pathRendering()->stencilPath(args, fPath.get()); -- 2.7.4