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

Side by Side Diff: src/gpu/GrInOrderDrawBuffer.cpp

Issue 969043002: small bug fix for batch asserts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrInOrderDrawBuffer.h" 8 #include "GrInOrderDrawBuffer.h"
9 9
10 #include "GrBufferAllocPool.h" 10 #include "GrBufferAllocPool.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 this->recordTraceMarkersIfNecessary(draw); 392 this->recordTraceMarkersIfNecessary(draw);
393 } 393 }
394 394
395 void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch, 395 void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch,
396 const PipelineInfo& pipelineInfo) { 396 const PipelineInfo& pipelineInfo) {
397 if (!this->setupPipelineAndShouldDraw(batch, pipelineInfo)) { 397 if (!this->setupPipelineAndShouldDraw(batch, pipelineInfo)) {
398 return; 398 return;
399 } 399 }
400 400
401 // Check if there is a Batch Draw we can batch with 401 // Check if there is a Batch Draw we can batch with
402 if (Cmd::kDrawBatch_Cmd != fCmdBuffer.back().type()) { 402 if (Cmd::kDrawBatch_Cmd != fCmdBuffer.back().type() || !fDrawBatch) {
403 fDrawBatch = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, DrawBatch, (batch, &fB atchTarget)); 403 fDrawBatch = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, DrawBatch, (batch, &fB atchTarget));
404 this->recordTraceMarkersIfNecessary(fDrawBatch); 404 this->recordTraceMarkersIfNecessary(fDrawBatch);
405 return; 405 return;
406 } 406 }
407 407
408 SkASSERT(&fCmdBuffer.back() == fDrawBatch); 408 SkASSERT(&fCmdBuffer.back() == fDrawBatch);
409 if (!fDrawBatch->fBatch->combineIfPossible(batch)) { 409 if (!fDrawBatch->fBatch->combineIfPossible(batch)) {
410 this->closeBatch(); 410 this->closeBatch();
411 fDrawBatch = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, DrawBatch, (batch, &fB atchTarget)); 411 fDrawBatch = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, DrawBatch, (batch, &fB atchTarget));
412 } 412 }
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 } 772 }
773 } 773 }
774 774
775 void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(int vertexCount, 775 void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(int vertexCount,
776 size_t vertexStride, 776 size_t vertexStride,
777 int indexCount) { 777 int indexCount) {
778 this->closeBatch(); 778 this->closeBatch();
779 779
780 this->INHERITED::willReserveVertexAndIndexSpace(vertexCount, vertexStride, i ndexCount); 780 this->INHERITED::willReserveVertexAndIndexSpace(vertexCount, vertexStride, i ndexCount);
781 } 781 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698