Index: src/gpu/GrInOrderDrawBuffer.cpp |
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp |
index e59df80e96c1cf7768803f40393a18e44cfdd289..48e01a23248ee63f02ef70929449fe68e8eb183a 100644 |
--- a/src/gpu/GrInOrderDrawBuffer.cpp |
+++ b/src/gpu/GrInOrderDrawBuffer.cpp |
@@ -250,8 +250,6 @@ void GrInOrderDrawBuffer::onDraw(const GrPipelineBuilder& pipelineBuilder, |
const GrScissorState& scissorState, |
const GrDeviceCoordTexture* dstCopy) { |
SkASSERT(info.vertexBuffer() && (!info.isIndexed() || info.indexBuffer())); |
- |
- // This closeBatch call is required because we may introduce new draws when we setup clip |
this->closeBatch(); |
if (!this->recordStateAndShouldDraw(pipelineBuilder, gp, scissorState, dstCopy)) { |
@@ -302,6 +300,8 @@ void GrInOrderDrawBuffer::onStencilPath(const GrPipelineBuilder& pipelineBuilder |
const GrPath* path, |
const GrScissorState& scissorState, |
const GrStencilSettings& stencilSettings) { |
+ this->closeBatch(); |
+ |
StencilPath* sp = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, StencilPath, |
(path, pipelineBuilder.getRenderTarget())); |
sp->fScissor = scissorState; |
@@ -342,7 +342,6 @@ void GrInOrderDrawBuffer::onDrawPaths(const GrPipelineBuilder& pipelineBuilder, |
SkASSERT(pathRange); |
SkASSERT(indices); |
SkASSERT(transformValues); |
- |
this->closeBatch(); |
if (!this->recordStateAndShouldDraw(pipelineBuilder, pathProc, scissorState, dstCopy)) { |
@@ -396,6 +395,8 @@ void GrInOrderDrawBuffer::onDrawPaths(const GrPipelineBuilder& pipelineBuilder, |
void GrInOrderDrawBuffer::onClear(const SkIRect* rect, GrColor color, |
bool canIgnoreRect, GrRenderTarget* renderTarget) { |
SkASSERT(renderTarget); |
+ this->closeBatch(); |
+ |
SkIRect r; |
if (NULL == rect) { |
// We could do something smart and remove previous draws and clears to |
@@ -416,6 +417,8 @@ void GrInOrderDrawBuffer::clearStencilClip(const SkIRect& rect, |
bool insideClip, |
GrRenderTarget* renderTarget) { |
SkASSERT(renderTarget); |
+ this->closeBatch(); |
+ |
ClearStencilClip* clr = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, ClearStencilClip, (renderTarget)); |
clr->fRect = rect; |
clr->fInsideClip = insideClip; |
@@ -424,6 +427,8 @@ void GrInOrderDrawBuffer::clearStencilClip(const SkIRect& rect, |
void GrInOrderDrawBuffer::discard(GrRenderTarget* renderTarget) { |
SkASSERT(renderTarget); |
+ this->closeBatch(); |
+ |
if (!this->caps()->discardRenderTargetSupport()) { |
return; |
} |
@@ -647,15 +652,6 @@ void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary() { |
} |
} |
-void GrInOrderDrawBuffer::closeBatch() { |
- if (fDrawBatch) { |
- fBatchTarget.resetNumberOfDraws(); |
- fDrawBatch->execute(this, fPrevState); |
- fDrawBatch->fBatch->setNumberOfDraws(fBatchTarget.numberOfDraws()); |
- fDrawBatch = NULL; |
- } |
-} |
- |
void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(int vertexCount, |
size_t vertexStride, |
int indexCount) { |