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 d326226..30920f8 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;
         }