Fix GPU trace marker bug
authorrobertphillips <robertphillips@google.com>
Thu, 5 Mar 2015 16:55:28 +0000 (08:55 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 5 Mar 2015 16:55:28 +0000 (08:55 -0800)
Without this patch the GPU trace markers can be potentially unbalanced when batching occurs.

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

src/gpu/GrTargetCommands.cpp

index d326226d1f37719dae4e996c7dc6152f76bd9725..30920f884d959a6639a0e1f907e077576521d905 100644 (file)
@@ -319,6 +319,10 @@ void GrTargetCommands::flush(GrInOrderDrawBuffer* iodb) {
         if (Cmd::kDrawBatch_Cmd == iter->type()) {
             DrawBatch* db = reinterpret_cast<DrawBatch*>(iter.get());
             fBatchTarget.flushNext(db->fBatch->numberOfDraws());
+
+            if (iter->isTraced()) {
+                gpu->removeGpuTraceMarker(&newMarker);
+            }
             continue;
         }