Index: tools/debugger/SkDebugCanvas.cpp |
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp |
index d8d51fe0ace3b260bf360d27bd62f49cd9af0fb1..8b71c0fb2c44c55d9b7168b97585256372aa2dc9 100644 |
--- a/tools/debugger/SkDebugCanvas.cpp |
+++ b/tools/debugger/SkDebugCanvas.cpp |
@@ -318,11 +318,11 @@ SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() { |
return fCommandVector; |
} |
-Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager) { |
+Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager, int n) { |
Json::Value result = Json::Value(Json::objectValue); |
result[SKDEBUGCANVAS_ATTRIBUTE_VERSION] = Json::Value(SKDEBUGCANVAS_VERSION); |
Json::Value commands = Json::Value(Json::arrayValue); |
- for (int i = 0; i < this->getSize(); i++) { |
+ for (int i = 0; i < this->getSize() && i < n; i++) { |
commands[i] = this->getDrawCommandAt(i)->toJSON(); |
} |
result[SKDEBUGCANVAS_ATTRIBUTE_COMMANDS] = commands; |