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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return true; | 51 return true; |
52 } | 52 } |
53 | 53 |
54 void onDrawPicture(const SkPicture* picture, | 54 void onDrawPicture(const SkPicture* picture, |
55 const SkMatrix* matrix, | 55 const SkMatrix* matrix, |
56 const SkPaint* paint) override { | 56 const SkPaint* paint) override { |
57 // We need to replay the picture onto this canvas in order to filter its
internal paints. | 57 // We need to replay the picture onto this canvas in order to filter its
internal paints. |
58 this->SkCanvas::onDrawPicture(picture, matrix, paint); | 58 this->SkCanvas::onDrawPicture(picture, matrix, paint); |
59 } | 59 } |
60 | 60 |
| 61 void onDrawShadowedPicture(const SkPicture* picture, |
| 62 sk_sp<SkLights> lights) override { |
| 63 this->SkCanvas::onDrawShadowedPicture(picture, lights); |
| 64 } |
| 65 |
61 private: | 66 private: |
62 sk_sp<SkXfermode> fOverdrawXfermode; | 67 sk_sp<SkXfermode> fOverdrawXfermode; |
63 | 68 |
64 bool fOverrideFilterQuality; | 69 bool fOverrideFilterQuality; |
65 SkFilterQuality fFilterQuality; | 70 SkFilterQuality fFilterQuality; |
66 | 71 |
67 typedef SkPaintFilterCanvas INHERITED; | 72 typedef SkPaintFilterCanvas INHERITED; |
68 }; | 73 }; |
69 | 74 |
70 SkDebugCanvas::SkDebugCanvas(int width, int height) | 75 SkDebugCanvas::SkDebugCanvas(int width, int height) |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 | 601 |
597 void SkDebugCanvas::onDrawPicture(const SkPicture* picture, | 602 void SkDebugCanvas::onDrawPicture(const SkPicture* picture, |
598 const SkMatrix* matrix, | 603 const SkMatrix* matrix, |
599 const SkPaint* paint) { | 604 const SkPaint* paint) { |
600 this->addDrawCommand(new SkBeginDrawPictureCommand(picture, matrix, paint)); | 605 this->addDrawCommand(new SkBeginDrawPictureCommand(picture, matrix, paint)); |
601 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); | 606 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); |
602 picture->playback(this); | 607 picture->playback(this); |
603 this->addDrawCommand(new SkEndDrawPictureCommand(SkToBool(matrix) || SkToBoo
l(paint))); | 608 this->addDrawCommand(new SkEndDrawPictureCommand(SkToBool(matrix) || SkToBoo
l(paint))); |
604 } | 609 } |
605 | 610 |
| 611 void SkDebugCanvas::onDrawShadowedPicture(const SkPicture* picture, |
| 612 sk_sp<SkLights> lights) { |
| 613 this->addDrawCommand(new SkBeginDrawShadowedPictureCommand(picture, lights))
; |
| 614 SkAutoCanvasMatrixPaint acmp(this, nullptr, nullptr, picture->cullRect()); |
| 615 picture->playback(this); |
| 616 this->addDrawCommand(new SkEndDrawShadowedPictureCommand(SkToBool(lights))); |
| 617 } |
| 618 |
606 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count, | 619 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count, |
607 const SkPoint pts[], const SkPaint& paint) { | 620 const SkPoint pts[], const SkPaint& paint) { |
608 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); | 621 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); |
609 } | 622 } |
610 | 623 |
611 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP
oint pos[], | 624 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP
oint pos[], |
612 const SkPaint& paint) { | 625 const SkPaint& paint) { |
613 this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint))
; | 626 this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint))
; |
614 } | 627 } |
615 | 628 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 } | 830 } |
818 | 831 |
819 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 832 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
820 if (fCalledAddStackData) { | 833 if (fCalledAddStackData) { |
821 fClipStackData.appendf("<br>"); | 834 fClipStackData.appendf("<br>"); |
822 addPathData(devPath, "pathOut"); | 835 addPathData(devPath, "pathOut"); |
823 return true; | 836 return true; |
824 } | 837 } |
825 return false; | 838 return false; |
826 } | 839 } |
OLD | NEW |