| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkClipStack.h" | 8 #include "SkClipStack.h" |
| 9 #include "SkDebugCanvas.h" | 9 #include "SkDebugCanvas.h" |
| 10 #include "SkDrawCommand.h" | 10 #include "SkDrawCommand.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 | 312 |
| 313 const SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() const { | 313 const SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() const { |
| 314 return fCommandVector; | 314 return fCommandVector; |
| 315 } | 315 } |
| 316 | 316 |
| 317 SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() { | 317 SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() { |
| 318 return fCommandVector; | 318 return fCommandVector; |
| 319 } | 319 } |
| 320 | 320 |
| 321 Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager) { | 321 Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager, int n) { |
| 322 Json::Value result = Json::Value(Json::objectValue); | 322 Json::Value result = Json::Value(Json::objectValue); |
| 323 result[SKDEBUGCANVAS_ATTRIBUTE_VERSION] = Json::Value(SKDEBUGCANVAS_VERSION)
; | 323 result[SKDEBUGCANVAS_ATTRIBUTE_VERSION] = Json::Value(SKDEBUGCANVAS_VERSION)
; |
| 324 Json::Value commands = Json::Value(Json::arrayValue); | 324 Json::Value commands = Json::Value(Json::arrayValue); |
| 325 for (int i = 0; i < this->getSize(); i++) { | 325 for (int i = 0; i < this->getSize() && i < n; i++) { |
| 326 commands[i] = this->getDrawCommandAt(i)->toJSON(); | 326 commands[i] = this->getDrawCommandAt(i)->toJSON(); |
| 327 } | 327 } |
| 328 result[SKDEBUGCANVAS_ATTRIBUTE_COMMANDS] = commands; | 328 result[SKDEBUGCANVAS_ATTRIBUTE_COMMANDS] = commands; |
| 329 return result; | 329 return result; |
| 330 } | 330 } |
| 331 | 331 |
| 332 void SkDebugCanvas::updatePaintFilterCanvas() { | 332 void SkDebugCanvas::updatePaintFilterCanvas() { |
| 333 if (!fOverdrawViz && !fOverrideFilterQuality) { | 333 if (!fOverdrawViz && !fOverrideFilterQuality) { |
| 334 fPaintFilterCanvas.reset(nullptr); | 334 fPaintFilterCanvas.reset(nullptr); |
| 335 return; | 335 return; |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 } | 630 } |
| 631 | 631 |
| 632 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 632 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
| 633 if (fCalledAddStackData) { | 633 if (fCalledAddStackData) { |
| 634 fClipStackData.appendf("<br>"); | 634 fClipStackData.appendf("<br>"); |
| 635 addPathData(devPath, "pathOut"); | 635 addPathData(devPath, "pathOut"); |
| 636 return true; | 636 return true; |
| 637 } | 637 } |
| 638 return false; | 638 return false; |
| 639 } | 639 } |
| OLD | NEW |