Breakdown profile time by command type in the overview pane
https://codereview.appspot.com/6851073/
git-svn-id: http://skia.googlecode.com/svn/trunk@6492 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/debugger/SkDebugCanvas.cpp b/debugger/SkDebugCanvas.cpp
index b970bb9..f6c8082 100644
--- a/debugger/SkDebugCanvas.cpp
+++ b/debugger/SkDebugCanvas.cpp
@@ -142,16 +142,16 @@
return commandVector[index]->isVisible();
}
-SkTDArray <SkDrawCommand*> SkDebugCanvas::getDrawCommands() {
+const SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() const {
return commandVector;
}
// TODO(chudy): Free command string memory.
-SkTDArray<SkString*>* SkDebugCanvas::getDrawCommandsAsStrings() {
- SkTDArray<SkString*>* commandString = new SkTDArray<SkString*>();
+SkTArray<SkString>* SkDebugCanvas::getDrawCommandsAsStrings() const {
+ SkTArray<SkString>* commandString = new SkTArray<SkString>(commandVector.count());
if (!commandVector.isEmpty()) {
for (int i = 0; i < commandVector.count(); i ++) {
- commandString->push(new SkString(commandVector[i]->toString()));
+ commandString->push_back() = commandVector[i]->toString();
}
}
return commandString;