Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: tools/debugger/SkDebugCanvas.cpp

Issue 2146073003: Creating framework for drawShadowedPicture (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Added setLights and getLIghts calls Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 const SkMatrix* matrix,
63 const SkPaint* paint) override {
64 this->SkCanvas::onDrawShadowedPicture(picture, matrix, paint);
65 }
66
61 private: 67 private:
62 sk_sp<SkXfermode> fOverdrawXfermode; 68 sk_sp<SkXfermode> fOverdrawXfermode;
63 69
64 bool fOverrideFilterQuality; 70 bool fOverrideFilterQuality;
65 SkFilterQuality fFilterQuality; 71 SkFilterQuality fFilterQuality;
66 72
67 typedef SkPaintFilterCanvas INHERITED; 73 typedef SkPaintFilterCanvas INHERITED;
68 }; 74 };
69 75
70 SkDebugCanvas::SkDebugCanvas(int width, int height) 76 SkDebugCanvas::SkDebugCanvas(int width, int height)
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 602
597 void SkDebugCanvas::onDrawPicture(const SkPicture* picture, 603 void SkDebugCanvas::onDrawPicture(const SkPicture* picture,
598 const SkMatrix* matrix, 604 const SkMatrix* matrix,
599 const SkPaint* paint) { 605 const SkPaint* paint) {
600 this->addDrawCommand(new SkBeginDrawPictureCommand(picture, matrix, paint)); 606 this->addDrawCommand(new SkBeginDrawPictureCommand(picture, matrix, paint));
601 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); 607 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect());
602 picture->playback(this); 608 picture->playback(this);
603 this->addDrawCommand(new SkEndDrawPictureCommand(SkToBool(matrix) || SkToBoo l(paint))); 609 this->addDrawCommand(new SkEndDrawPictureCommand(SkToBool(matrix) || SkToBoo l(paint)));
604 } 610 }
605 611
612 void SkDebugCanvas::onDrawShadowedPicture(const SkPicture* picture,
613 const SkMatrix* matrix,
614 const SkPaint* paint) {
615 this->addDrawCommand(new SkBeginDrawShadowedPictureCommand(picture, matrix, paint));
616 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect());
617 picture->playback(this);
618 this->addDrawCommand(new SkEndDrawShadowedPictureCommand(SkToBool(matrix) || SkToBool(paint)));
619 }
620
606 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count, 621 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count,
607 const SkPoint pts[], const SkPaint& paint) { 622 const SkPoint pts[], const SkPaint& paint) {
608 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); 623 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint));
609 } 624 }
610 625
611 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP oint pos[], 626 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP oint pos[],
612 const SkPaint& paint) { 627 const SkPaint& paint) {
613 this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint)) ; 628 this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint)) ;
614 } 629 }
615 630
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 832 }
818 833
819 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { 834 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) {
820 if (fCalledAddStackData) { 835 if (fCalledAddStackData) {
821 fClipStackData.appendf("<br>"); 836 fClipStackData.appendf("<br>");
822 addPathData(devPath, "pathOut"); 837 addPathData(devPath, "pathOut");
823 return true; 838 return true;
824 } 839 }
825 return false; 840 return false;
826 } 841 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698