OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkDebugger.h" | 9 #include "SkDebugger.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 for (int i = 0; i < LAST_DRAWTYPE_ENUM+1; ++i) { | 70 for (int i = 0; i < LAST_DRAWTYPE_ENUM+1; ++i) { |
71 if (0 == counts[i]) { | 71 if (0 == counts[i]) { |
72 // if there were no commands of this type then they should've consum
ed no time | 72 // if there were no commands of this type then they should've consum
ed no time |
73 SkASSERT(NULL == typeTimes || 0.0 == (*typeTimes)[i]); | 73 SkASSERT(NULL == typeTimes || 0.0 == (*typeTimes)[i]); |
74 continue; | 74 continue; |
75 } | 75 } |
76 | 76 |
77 overview->append(SkDrawCommand::GetCommandString((DrawType) i)); | 77 overview->append(SkDrawCommand::GetCommandString((DrawType) i)); |
78 overview->append(": "); | 78 overview->append(": "); |
79 overview->appendS32(counts[i]); | 79 overview->appendS32(counts[i]); |
80 if (NULL != typeTimes) { | 80 if (NULL != typeTimes && totTime >= 0.0) { |
81 overview->append(" - "); | 81 overview->append(" - "); |
82 overview->appendf("%.2f", (*typeTimes)[i]/(float)numRuns); | 82 overview->appendf("%.2f", (*typeTimes)[i]/(float)numRuns); |
83 overview->append("ms"); | 83 overview->append("ms"); |
84 overview->append(" - "); | 84 overview->append(" - "); |
85 double percent = 100.0*(*typeTimes)[i]/totTime; | 85 double percent = 100.0*(*typeTimes)[i]/totTime; |
86 overview->appendf("%.2f", percent); | 86 overview->appendf("%.2f", percent); |
87 overview->append("%"); | 87 overview->append("%"); |
88 #ifdef SK_DEBUG | 88 #ifdef SK_DEBUG |
89 totPercent += percent; | 89 totPercent += percent; |
90 tempSum += (*typeTimes)[i]; | 90 tempSum += (*typeTimes)[i]; |
(...skipping 30 matching lines...) Expand all Loading... |
121 overview->insert(0, totalStr); | 121 overview->insert(0, totalStr); |
122 | 122 |
123 overview->append("<br/>"); | 123 overview->append("<br/>"); |
124 overview->append("SkPicture Width: "); | 124 overview->append("SkPicture Width: "); |
125 overview->appendS32(pictureWidth()); | 125 overview->appendS32(pictureWidth()); |
126 overview->append("px<br/>"); | 126 overview->append("px<br/>"); |
127 overview->append("SkPicture Height: "); | 127 overview->append("SkPicture Height: "); |
128 overview->appendS32(pictureHeight()); | 128 overview->appendS32(pictureHeight()); |
129 overview->append("px"); | 129 overview->append("px"); |
130 } | 130 } |
OLD | NEW |