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

Unified Diff: src/utils/debugger/SkDrawCommand.cpp

Issue 464063003: Add support for new drawPicture entry point to debugger (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkDrawCommand.cpp
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index c50fa2d3f58a4a12b461a2b09314eb04ab818b6f..26d2a85a8a1baac10be3b27e26579e0a12268988 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -273,7 +273,7 @@ void SkConcatCommand::execute(SkCanvas* canvas) {
}
SkDrawBitmapCommand::SkDrawBitmapCommand(const SkBitmap& bitmap, SkScalar left, SkScalar top,
- const SkPaint* paint)
+ const SkPaint* paint)
: INHERITED(DRAW_BITMAP) {
fBitmap = bitmap;
fLeft = left;
@@ -502,16 +502,36 @@ bool SkDrawPathCommand::render(SkCanvas* canvas) const {
return true;
}
-SkDrawPictureCommand::SkDrawPictureCommand(const SkPicture* picture)
+SkDrawPictureCommand::SkDrawPictureCommand(const SkPicture* picture,
+ const SkMatrix* matrix,
+ const SkPaint* paint)
: INHERITED(DRAW_PICTURE)
- , fPicture(SkRef(picture)) {
+ , fPicture(SkRef(picture))
+ , fMatrixPtr(NULL)
+ , fPaintPtr(NULL) {
+
+ if (NULL != matrix) {
+ fMatrix = *matrix;
+ fMatrixPtr = &fMatrix;
+ }
+ if (NULL != paint) {
+ fPaint = *paint;
+ fPaintPtr = &fPaint;
+ }
+
SkString* temp = new SkString;
temp->appendf("SkPicture: W: %d H: %d", picture->width(), picture->height());
fInfo.push(temp);
+ if (NULL != matrix) {
+ fInfo.push(SkObjectParser::MatrixToString(*matrix));
+ }
+ if (NULL != paint) {
+ fInfo.push(SkObjectParser::PaintToString(*paint));
+ }
}
void SkDrawPictureCommand::execute(SkCanvas* canvas) {
- canvas->drawPicture(fPicture);
+ canvas->drawPicture(fPicture, fMatrixPtr, fPaintPtr);
}
bool SkDrawPictureCommand::render(SkCanvas* canvas) const {
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698