OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 | 9 |
10 #include "SkRecord.h" | 10 #include "SkRecord.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 const SkRecord& record = *bp->record(); | 69 const SkRecord& record = *bp->record(); |
70 for (int i = 0; i < record.count(); i++) { | 70 for (int i = 0; i < record.count(); i++) { |
71 record.visit(i, *this); | 71 record.visit(i, *this); |
72 } | 72 } |
73 | 73 |
74 --fIndent; | 74 --fIndent; |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
| 78 #if 0 |
| 79 void print(const SkRecords::DrawAnnotation& command, double ns) { |
| 80 int us = (int)(ns * 1e-3); |
| 81 if (!fTimeWithCommand) { |
| 82 printf("%6dus ", us); |
| 83 } |
| 84 printf("%*d ", fDigits, fIndex++); |
| 85 for (int i = 0; i < fIndent; i++) { |
| 86 printf(" "); |
| 87 } |
| 88 if (fTimeWithCommand) { |
| 89 printf("%6dus ", us); |
| 90 } |
| 91 printf("DrawAnnotation [%g %g %g %g] %s\n", |
| 92 command.rect.left(), command.rect.top(), command.rect.right(), co
mmand.rect.bottom(), |
| 93 command.key.c_str()); |
| 94 } |
| 95 #endif |
| 96 |
78 private: | 97 private: |
79 template <typename T> | 98 template <typename T> |
80 void printNameAndTime(const T& command, double ns) { | 99 void printNameAndTime(const T& command, double ns) { |
81 int us = (int)(ns * 1e-3); | 100 int us = (int)(ns * 1e-3); |
82 if (!fTimeWithCommand) { | 101 if (!fTimeWithCommand) { |
83 printf("%6dus ", us); | 102 printf("%6dus ", us); |
84 } | 103 } |
85 printf("%*d ", fDigits, fIndex++); | 104 printf("%*d ", fDigits, fIndex++); |
86 for (int i = 0; i < fIndent; i++) { | 105 for (int i = 0; i < fIndent; i++) { |
87 printf(" "); | 106 printf(" "); |
(...skipping 27 matching lines...) Expand all Loading... |
115 } // namespace | 134 } // namespace |
116 | 135 |
117 void DumpRecord(const SkRecord& record, | 136 void DumpRecord(const SkRecord& record, |
118 SkCanvas* canvas, | 137 SkCanvas* canvas, |
119 bool timeWithCommand) { | 138 bool timeWithCommand) { |
120 Dumper dumper(canvas, record.count(), timeWithCommand); | 139 Dumper dumper(canvas, record.count(), timeWithCommand); |
121 for (int i = 0; i < record.count(); i++) { | 140 for (int i = 0; i < record.count(); i++) { |
122 record.visit(i, dumper); | 141 record.visit(i, dumper); |
123 } | 142 } |
124 } | 143 } |
OLD | NEW |