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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 61 void onDrawShadowedPicture(const SkPicture* picture, |
62 const SkMatrix* matrix, | 62 const SkMatrix* matrix, |
63 const SkPaint* paint) { | 63 const SkPaint* paint, |
| 64 SkShadowType sType) { |
64 #ifdef SK_EXPERIMENTAL_SHADOWING | 65 #ifdef SK_EXPERIMENTAL_SHADOWING |
65 this->SkCanvas::onDrawShadowedPicture(picture, matrix, paint); | 66 this->SkCanvas::onDrawShadowedPicture(picture, matrix, paint, sType); |
66 #else | 67 #else |
67 this->SkCanvas::onDrawPicture(picture, matrix, paint); | 68 this->SkCanvas::onDrawPicture(picture, matrix, paint); |
68 #endif | 69 #endif |
69 } | 70 } |
70 | 71 |
71 private: | 72 private: |
72 sk_sp<SkXfermode> fOverdrawXfermode; | 73 sk_sp<SkXfermode> fOverdrawXfermode; |
73 | 74 |
74 bool fOverrideFilterQuality; | 75 bool fOverrideFilterQuality; |
75 SkFilterQuality fFilterQuality; | 76 SkFilterQuality fFilterQuality; |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 const SkMatrix* matrix, | 609 const SkMatrix* matrix, |
609 const SkPaint* paint) { | 610 const SkPaint* paint) { |
610 this->addDrawCommand(new SkBeginDrawPictureCommand(picture, matrix, paint)); | 611 this->addDrawCommand(new SkBeginDrawPictureCommand(picture, matrix, paint)); |
611 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); | 612 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); |
612 picture->playback(this); | 613 picture->playback(this); |
613 this->addDrawCommand(new SkEndDrawPictureCommand(SkToBool(matrix) || SkToBoo
l(paint))); | 614 this->addDrawCommand(new SkEndDrawPictureCommand(SkToBool(matrix) || SkToBoo
l(paint))); |
614 } | 615 } |
615 | 616 |
616 void SkDebugCanvas::onDrawShadowedPicture(const SkPicture* picture, | 617 void SkDebugCanvas::onDrawShadowedPicture(const SkPicture* picture, |
617 const SkMatrix* matrix, | 618 const SkMatrix* matrix, |
618 const SkPaint* paint) { | 619 const SkPaint* paint, |
| 620 SkShadowType sType) { |
619 this->addDrawCommand(new SkBeginDrawShadowedPictureCommand(picture, matrix,
paint)); | 621 this->addDrawCommand(new SkBeginDrawShadowedPictureCommand(picture, matrix,
paint)); |
620 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); | 622 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); |
621 picture->playback(this); | 623 picture->playback(this); |
622 this->addDrawCommand(new SkEndDrawShadowedPictureCommand(SkToBool(matrix) ||
SkToBool(paint))); | 624 this->addDrawCommand(new SkEndDrawShadowedPictureCommand(SkToBool(matrix) ||
SkToBool(paint))); |
623 } | 625 } |
624 | 626 |
625 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count, | 627 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count, |
626 const SkPoint pts[], const SkPaint& paint) { | 628 const SkPoint pts[], const SkPaint& paint) { |
627 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); | 629 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); |
628 } | 630 } |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 } | 840 } |
839 | 841 |
840 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 842 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
841 if (fCalledAddStackData) { | 843 if (fCalledAddStackData) { |
842 fClipStackData.appendf("<br>"); | 844 fClipStackData.appendf("<br>"); |
843 addPathData(devPath, "pathOut"); | 845 addPathData(devPath, "pathOut"); |
844 return true; | 846 return true; |
845 } | 847 } |
846 return false; | 848 return false; |
847 } | 849 } |
OLD | NEW |