small bug fix for batch asserts
authorjoshualitt <joshualitt@chromium.org>
Mon, 2 Mar 2015 19:23:07 +0000 (11:23 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 2 Mar 2015 19:23:07 +0000 (11:23 -0800)
BUG=skia:

Review URL: https://codereview.chromium.org/969043002

src/gpu/GrInOrderDrawBuffer.cpp

index 1ff018d..d89dd43 100644 (file)
@@ -395,7 +395,7 @@ void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch,
     }
 
     // Check if there is a Batch Draw we can batch with
-    if (Cmd::kDrawBatch_Cmd != fCmdBuffer.back().type()) {
+    if (Cmd::kDrawBatch_Cmd != fCmdBuffer.back().type() || !fDrawBatch) {
         fDrawBatch = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, DrawBatch, (batch, &fBatchTarget));
         this->recordTraceMarkersIfNecessary(fDrawBatch);
         return;