| 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 "SkClipStack.h" | 9 #include "SkClipStack.h" |
| 9 #include "SkDebugCanvas.h" | 10 #include "SkDebugCanvas.h" |
| 10 #include "SkDrawCommand.h" | 11 #include "SkDrawCommand.h" |
| 11 #include "SkDevice.h" | 12 #include "SkDevice.h" |
| 12 #include "SkPaintFilterCanvas.h" | 13 #include "SkPaintFilterCanvas.h" |
| 13 #include "SkOverdrawMode.h" | 14 #include "SkOverdrawMode.h" |
| 14 | 15 |
| 15 #define SKDEBUGCANVAS_VERSION 1 | 16 #define SKDEBUGCANVAS_VERSION 1 |
| 16 #define SKDEBUGCANVAS_ATTRIBUTE_VERSION "version" | 17 #define SKDEBUGCANVAS_ATTRIBUTE_VERSION "version" |
| 17 #define SKDEBUGCANVAS_ATTRIBUTE_COMMANDS "commands" | 18 #define SKDEBUGCANVAS_ATTRIBUTE_COMMANDS "commands" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 416 } |
| 416 | 417 |
| 417 void SkDebugCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { | 418 void SkDebugCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { |
| 418 this->addDrawCommand(new SkDrawPathCommand(path, paint)); | 419 this->addDrawCommand(new SkDrawPathCommand(path, paint)); |
| 419 } | 420 } |
| 420 | 421 |
| 421 void SkDebugCanvas::onDrawPicture(const SkPicture* picture, | 422 void SkDebugCanvas::onDrawPicture(const SkPicture* picture, |
| 422 const SkMatrix* matrix, | 423 const SkMatrix* matrix, |
| 423 const SkPaint* paint) { | 424 const SkPaint* paint) { |
| 424 this->addDrawCommand(new SkBeginDrawPictureCommand(picture, matrix, paint)); | 425 this->addDrawCommand(new SkBeginDrawPictureCommand(picture, matrix, paint)); |
| 425 this->INHERITED::onDrawPicture(picture, matrix, paint); | 426 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); |
| 427 picture->playback(this); |
| 426 this->addDrawCommand(new SkEndDrawPictureCommand(SkToBool(matrix) || SkToBoo
l(paint))); | 428 this->addDrawCommand(new SkEndDrawPictureCommand(SkToBool(matrix) || SkToBoo
l(paint))); |
| 427 } | 429 } |
| 428 | 430 |
| 429 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count, | 431 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count, |
| 430 const SkPoint pts[], const SkPaint& paint) { | 432 const SkPoint pts[], const SkPaint& paint) { |
| 431 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); | 433 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); |
| 432 } | 434 } |
| 433 | 435 |
| 434 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP
oint pos[], | 436 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP
oint pos[], |
| 435 const SkPaint& paint) { | 437 const SkPaint& paint) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 } | 632 } |
| 631 | 633 |
| 632 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 634 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
| 633 if (fCalledAddStackData) { | 635 if (fCalledAddStackData) { |
| 634 fClipStackData.appendf("<br>"); | 636 fClipStackData.appendf("<br>"); |
| 635 addPathData(devPath, "pathOut"); | 637 addPathData(devPath, "pathOut"); |
| 636 return true; | 638 return true; |
| 637 } | 639 } |
| 638 return false; | 640 return false; |
| 639 } | 641 } |
| OLD | NEW |