aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/debugger/SkDrawCommand.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-08-13 10:46:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-13 10:46:24 -0700
commitb3f319fbb01c74e757846d9fcfbf1da174c0cb17 (patch)
treebfd5c145cb96bd04634df4a99c00a11027b8d442 /src/utils/debugger/SkDrawCommand.cpp
parentc773390eefe70d13faab147a70bd9319b9ac3afb (diff)
Add support for new drawPicture entry point to debugger
R=fmalita@google.com, fmalita@chromium.org Author: robertphillips@google.com Review URL: https://codereview.chromium.org/464063003
Diffstat (limited to 'src/utils/debugger/SkDrawCommand.cpp')
-rw-r--r--src/utils/debugger/SkDrawCommand.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index c50fa2d3f5..26d2a85a8a 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 {