teach dump_record to recurse into subpictures
authormtklein <mtklein@chromium.org>
Wed, 20 Jan 2016 16:46:40 +0000 (08:46 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 20 Jan 2016 16:46:40 +0000 (08:46 -0800)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1606293002

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

tools/DumpRecord.cpp

index e2662e7..e7d76f0 100644 (file)
@@ -60,6 +60,21 @@ public:
         ++fIndent;
     }
 
+    void print(const SkRecords::DrawPicture& command, double ns) {
+        this->printNameAndTime(command, ns);
+
+        if (auto bp = command.picture->asSkBigPicture()) {
+            ++fIndent;
+
+            const SkRecord& record = *bp->record();
+            for (int i = 0; i < record.count(); i++) {
+                record.visit<void>(i, *this);
+            }
+
+            --fIndent;
+        }
+    }
+
 private:
     template <typename T>
     void printNameAndTime(const T& command, double ns) {