Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: src/gpu/GrInOrderDrawBuffer.cpp

Issue 1113313003: Create GrCommandBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrInOrderDrawBuffer.cpp
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 76e085dffa2809a6194e150683832565c875a2cc..6de80f868172df2940bfc5fb07e00f0ba55bde54 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)
@@ -306,7 +306,7 @@ void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch,
return;
}
- GrTargetCommands::Cmd* cmd = fCommands.recordDrawBatch(state, batch);
+ GrTargetCommands::Cmd* cmd = fCommands->recordDrawBatch(state, batch);
this->recordTraceMarkersIfNecessary(cmd);
}
@@ -315,9 +315,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);
}
@@ -329,7 +329,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);
}
@@ -346,23 +346,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);
}
@@ -371,12 +371,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();
@@ -392,7 +392,7 @@ void GrInOrderDrawBuffer::onReset() {
}
void GrInOrderDrawBuffer::onFlush() {
- fCommands.flush(this);
+ fCommands->flush(this);
++fDrawID;
}
@@ -401,7 +401,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);
}
@@ -444,7 +444,8 @@ GrInOrderDrawBuffer::setupPipelineAndShouldDraw(const GrPrimitiveProcessor* prim
fPrevState.reset(state);
}
- fCommands.recordXferBarrierIfNecessary(*fPrevState->getPipeline(), this);
+ this->recordTraceMarkersIfNecessary(
+ fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps()));
return fPrevState;
}
@@ -468,6 +469,7 @@ GrInOrderDrawBuffer::setupPipelineAndShouldDraw(GrBatch* batch,
fPrevState.reset(state);
}
- fCommands.recordXferBarrierIfNecessary(*fPrevState->getPipeline(), this);
+ this->recordTraceMarkersIfNecessary(
+ fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps()));
return fPrevState;
}

Powered by Google App Engine
This is Rietveld 408576698