Spruce up batch info printouts
authorrobertphillips <robertphillips@google.com>
Tue, 28 Jun 2016 21:45:31 +0000 (14:45 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 28 Jun 2016 21:45:31 +0000 (14:45 -0700)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2107013002

Review-Url: https://codereview.chromium.org/2107013002

src/gpu/GrDrawTarget.cpp
src/gpu/GrDrawingManager.cpp
src/gpu/batches/GrTInstanceBatch.h

index d498d49..7ddcf1c 100644 (file)
@@ -114,17 +114,13 @@ void GrDrawTarget::dump() const {
     SkDebugf("\n");
     SkDebugf("batches (%d):\n", fBatches.count());
     for (int i = 0; i < fBatches.count(); ++i) {
-#if 0
         SkDebugf("*******************************\n");
-#endif
-        if (fBatches[i]) {
+        if (!fBatches[i]) {
             SkDebugf("%d: <combined forward>\n", i);
         } else {
             SkDebugf("%d: %s\n", i, fBatches[i]->name());
-#if 0
             SkString str = fBatches[i]->dumpInfo();
             SkDebugf("%s\n", str.c_str());
-#endif
         }
     }
 }
index ea5c18b..f0a9a16 100644 (file)
@@ -67,6 +67,7 @@ void GrDrawingManager::flush() {
                         SkTTopoSort<GrDrawTarget, GrDrawTarget::TopoSortTraits>(&fDrawTargets);
     SkASSERT(result);
 
+    // Enable this to print out verbose batching information
 #if 0
     for (int i = 0; i < fDrawTargets.count(); ++i) {
         SkDEBUGCODE(fDrawTargets[i]->dump();)
index c501fd9..e63f2e5 100644 (file)
@@ -52,6 +52,7 @@ public:
 
     SkString dumpInfo() const override {
         SkString str;
+        str.appendf("# batched: %d\n", fGeoData.count());
         for (int i = 0; i < fGeoData.count(); ++i) {
             str.append(Impl::DumpInfo(fGeoData[i], i));
         }