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

Unified Diff: tools/debugger/SkDebugCanvas.cpp

Issue 2146073003: Creating framework for drawShadowedPicture (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Made changes to better hide changes from public 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 side-by-side diff with in-line comments
Download patch
Index: tools/debugger/SkDebugCanvas.cpp
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp
index ae934a16e74267759090f83082df9921371b1bf0..3422726191ea6de3d3f94124a178de7d5551058b 100644
--- a/tools/debugger/SkDebugCanvas.cpp
+++ b/tools/debugger/SkDebugCanvas.cpp
@@ -58,6 +58,20 @@ protected:
this->SkCanvas::onDrawPicture(picture, matrix, paint);
}
+ void onDrawShadowedPicture(const SkPicture* picture,
+ const SkMatrix* matrix,
+ const SkPaint* paint)
+#ifdef SK_USE_SHADOWS
+ override
jvanverth1 2016/07/21 13:56:53 You don't need override in the definition.
vjiaoblack 2016/07/21 15:11:20 Done.
+#endif
+ {
+#ifdef SK_USE_SHADOWS
+ this->SkCanvas::onDrawShadowedPicture(picture, matrix, paint);
+#else
+ this->SkCanvas::onDrawPicture(picture, matrix, paint);
+#endif
+ }
+
private:
sk_sp<SkXfermode> fOverdrawXfermode;
@@ -603,6 +617,15 @@ void SkDebugCanvas::onDrawPicture(const SkPicture* picture,
this->addDrawCommand(new SkEndDrawPictureCommand(SkToBool(matrix) || SkToBool(paint)));
}
+void SkDebugCanvas::onDrawShadowedPicture(const SkPicture* picture,
+ const SkMatrix* matrix,
+ const SkPaint* paint) {
+ this->addDrawCommand(new SkBeginDrawShadowedPictureCommand(picture, matrix, paint));
+ SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect());
+ picture->playback(this);
+ this->addDrawCommand(new SkEndDrawShadowedPictureCommand(SkToBool(matrix) || SkToBool(paint)));
+}
+
void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint));
@@ -691,8 +714,10 @@ void SkDebugCanvas::didSetMatrix(const SkMatrix& matrix) {
}
void SkDebugCanvas::didTranslateZ(SkScalar z) {
+#ifdef SK_USE_SHADOWS
this->addDrawCommand(new SkTranslateZCommand(z));
this->INHERITED::didTranslateZ(z);
+#endif
}
void SkDebugCanvas::toggleCommand(int index, bool toggle) {

Powered by Google App Engine
This is Rietveld 408576698