diff options
author | 2015-05-05 08:41:50 -0700 | |
---|---|---|
committer | 2015-05-05 08:41:50 -0700 | |
commit | e46760e8b2b2fc4a11a43a3b7cc9da7166c83c46 (patch) | |
tree | 3352ef7702062da1e143d152ac4a2605d1cff84c /src/gpu/GrInOrderDrawBuffer.cpp | |
parent | f4e0857fe9e7b606c36302a252f23a790427f899 (diff) |
Create GrCommandBuilder
BUG=skia:
Review URL: https://codereview.chromium.org/1113313003
Diffstat (limited to 'src/gpu/GrInOrderDrawBuffer.cpp')
-rw-r--r-- | src/gpu/GrInOrderDrawBuffer.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp index a766af2c7e..1e8f3ae659 100644 --- a/src/gpu/GrInOrderDrawBuffer.cpp +++ b/src/gpu/GrInOrderDrawBuffer.cpp @@ -14,7 +14,7 @@ GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context, GrVertexBufferAllocPool* vertexPool, GrIndexBufferAllocPool* indexPool) : INHERITED(context, vertexPool, indexPool) - , fCommands(context->getGpu(), vertexPool, indexPool) + , fCommands(SkNEW_ARGS(GrCommandBuilder, (context->getGpu(), vertexPool, indexPool))) , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4) , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4) , fPipelineBuffer(kPipelineBufferMinReserve) @@ -272,7 +272,7 @@ void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch, return; } - GrTargetCommands::Cmd* cmd = fCommands.recordDrawBatch(state, batch); + GrTargetCommands::Cmd* cmd = fCommands->recordDrawBatch(state, batch); this->recordTraceMarkersIfNecessary(cmd); } @@ -281,9 +281,9 @@ void GrInOrderDrawBuffer::onStencilPath(const GrPipelineBuilder& pipelineBuilder const GrPath* path, const GrScissorState& scissorState, const GrStencilSettings& stencilSettings) { - GrTargetCommands::Cmd* cmd = fCommands.recordStencilPath(pipelineBuilder, - pathProc, path, scissorState, - stencilSettings); + GrTargetCommands::Cmd* cmd = fCommands->recordStencilPath(pipelineBuilder, + pathProc, path, scissorState, + stencilSettings); this->recordTraceMarkersIfNecessary(cmd); } @@ -295,7 +295,7 @@ void GrInOrderDrawBuffer::onDrawPath(const GrPathProcessor* pathProc, if (!state) { return; } - GrTargetCommands::Cmd* cmd = fCommands.recordDrawPath(state, pathProc, path, stencilSettings); + GrTargetCommands::Cmd* cmd = fCommands->recordDrawPath(state, pathProc, path, stencilSettings); this->recordTraceMarkersIfNecessary(cmd); } @@ -312,23 +312,23 @@ void GrInOrderDrawBuffer::onDrawPaths(const GrPathProcessor* pathProc, if (!state) { return; } - GrTargetCommands::Cmd* cmd = fCommands.recordDrawPaths(state, this, pathProc, pathRange, - indices, indexType, transformValues, - transformType, count, - stencilSettings, pipelineInfo); + GrTargetCommands::Cmd* cmd = fCommands->recordDrawPaths(state, this, pathProc, pathRange, + indices, indexType, transformValues, + transformType, count, + stencilSettings, pipelineInfo); this->recordTraceMarkersIfNecessary(cmd); } void GrInOrderDrawBuffer::onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect, GrRenderTarget* renderTarget) { - GrTargetCommands::Cmd* cmd = fCommands.recordClear(rect, color, canIgnoreRect, renderTarget); + GrTargetCommands::Cmd* cmd = fCommands->recordClear(rect, color, canIgnoreRect, renderTarget); this->recordTraceMarkersIfNecessary(cmd); } void GrInOrderDrawBuffer::clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* renderTarget) { - GrTargetCommands::Cmd* cmd = fCommands.recordClearStencilClip(rect, insideClip, renderTarget); + GrTargetCommands::Cmd* cmd = fCommands->recordClearStencilClip(rect, insideClip, renderTarget); this->recordTraceMarkersIfNecessary(cmd); } @@ -337,12 +337,12 @@ void GrInOrderDrawBuffer::discard(GrRenderTarget* renderTarget) { return; } - GrTargetCommands::Cmd* cmd = fCommands.recordDiscard(renderTarget); + GrTargetCommands::Cmd* cmd = fCommands->recordDiscard(renderTarget); this->recordTraceMarkersIfNecessary(cmd); } void GrInOrderDrawBuffer::onReset() { - fCommands.reset(); + fCommands->reset(); fPathIndexBuffer.rewind(); fPathTransformBuffer.rewind(); fGpuCmdMarkers.reset(); @@ -358,7 +358,7 @@ void GrInOrderDrawBuffer::onReset() { } void GrInOrderDrawBuffer::onFlush() { - fCommands.flush(this); + fCommands->flush(this); ++fDrawID; } @@ -367,7 +367,7 @@ void GrInOrderDrawBuffer::onCopySurface(GrSurface* dst, const SkIRect& srcRect, const SkIPoint& dstPoint) { SkASSERT(this->getGpu()->canCopySurface(dst, src, srcRect, dstPoint)); - GrTargetCommands::Cmd* cmd = fCommands.recordCopySurface(dst, src, srcRect, dstPoint); + GrTargetCommands::Cmd* cmd = fCommands->recordCopySurface(dst, src, srcRect, dstPoint); this->recordTraceMarkersIfNecessary(cmd); } @@ -410,7 +410,8 @@ GrInOrderDrawBuffer::setupPipelineAndShouldDraw(const GrPrimitiveProcessor* prim fPrevState.reset(state); } - fCommands.recordXferBarrierIfNecessary(*fPrevState->getPipeline(), this); + this->recordTraceMarkersIfNecessary( + fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps())); return fPrevState; } @@ -434,6 +435,7 @@ GrInOrderDrawBuffer::setupPipelineAndShouldDraw(GrBatch* batch, fPrevState.reset(state); } - fCommands.recordXferBarrierIfNecessary(*fPrevState->getPipeline(), this); + this->recordTraceMarkersIfNecessary( + fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps())); return fPrevState; } |