| 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 "SkCanvasPriv.h" | 8 #include "SkCanvasPriv.h" |
| 9 #include "SkClipStack.h" | 9 #include "SkClipStack.h" |
| 10 #include "SkDebugCanvas.h" | 10 #include "SkDebugCanvas.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 329 |
| 330 SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() { | 330 SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() { |
| 331 return fCommandVector; | 331 return fCommandVector; |
| 332 } | 332 } |
| 333 | 333 |
| 334 Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager, int n, SkCanva
s* canvas) { | 334 Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager, int n, SkCanva
s* canvas) { |
| 335 Json::Value result = Json::Value(Json::objectValue); | 335 Json::Value result = Json::Value(Json::objectValue); |
| 336 result[SKDEBUGCANVAS_ATTRIBUTE_VERSION] = Json::Value(SKDEBUGCANVAS_VERSION)
; | 336 result[SKDEBUGCANVAS_ATTRIBUTE_VERSION] = Json::Value(SKDEBUGCANVAS_VERSION)
; |
| 337 Json::Value commands = Json::Value(Json::arrayValue); | 337 Json::Value commands = Json::Value(Json::arrayValue); |
| 338 for (int i = 0; i < this->getSize() && i <= n; i++) { | 338 for (int i = 0; i < this->getSize() && i <= n; i++) { |
| 339 commands[i] = this->getDrawCommandAt(i)->drawToAndCollectJSON(canvas, ur
lDataManager); | 339 commands[i] = this->getDrawCommandAt(i)->drawToAndCollectJSON(canvas, ur
lDataManager, |
| 340 i); |
| 340 } | 341 } |
| 341 result[SKDEBUGCANVAS_ATTRIBUTE_COMMANDS] = commands; | 342 result[SKDEBUGCANVAS_ATTRIBUTE_COMMANDS] = commands; |
| 342 return result; | 343 return result; |
| 343 } | 344 } |
| 344 | 345 |
| 345 void SkDebugCanvas::updatePaintFilterCanvas() { | 346 void SkDebugCanvas::updatePaintFilterCanvas() { |
| 346 if (!fOverdrawViz && !fOverrideFilterQuality) { | 347 if (!fOverdrawViz && !fOverrideFilterQuality) { |
| 347 fPaintFilterCanvas.reset(nullptr); | 348 fPaintFilterCanvas.reset(nullptr); |
| 348 return; | 349 return; |
| 349 } | 350 } |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 645 } |
| 645 | 646 |
| 646 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 647 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
| 647 if (fCalledAddStackData) { | 648 if (fCalledAddStackData) { |
| 648 fClipStackData.appendf("<br>"); | 649 fClipStackData.appendf("<br>"); |
| 649 addPathData(devPath, "pathOut"); | 650 addPathData(devPath, "pathOut"); |
| 650 return true; | 651 return true; |
| 651 } | 652 } |
| 652 return false; | 653 return false; |
| 653 } | 654 } |
| OLD | NEW |