aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/debugger
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-21 17:08:12 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-21 17:08:12 +0000
commite898e9c65eb2f10e53c459349b174551b3957545 (patch)
tree953f2c523ac0b9fca107c3ab37af594f4059dc2b /src/utils/debugger
parent866f4e34a943c115ac372c22123a1520aa5f9b06 (diff)
Show basic SkPicture details in debugger.
R=robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/80223003 git-svn-id: http://skia.googlecode.com/svn/trunk@12345 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils/debugger')
-rw-r--r--src/utils/debugger/SkDrawCommand.cpp18
-rw-r--r--src/utils/debugger/SkDrawCommand.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index 1d4bfed7f3..0cde3b537c 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -485,13 +485,29 @@ bool SkDrawPathCommand::render(SkCanvas* canvas) const {
SkDrawPictureCommand::SkDrawPictureCommand(SkPicture& picture) :
fPicture(picture) {
fDrawType = DRAW_PICTURE;
- fInfo.push(SkObjectParser::CustomTextToString("To be implemented."));
+ SkString* temp = new SkString;
+ temp->appendf("SkPicture: W: %d H: %d", picture.width(), picture.height());
+ fInfo.push(temp);
}
void SkDrawPictureCommand::execute(SkCanvas* canvas) {
canvas->drawPicture(fPicture);
}
+bool SkDrawPictureCommand::render(SkCanvas* canvas) const {
+ canvas->clear(0xFFFFFFFF);
+ canvas->save();
+
+ SkRect bounds = SkRect::MakeWH(fPicture.width(), fPicture.height());
+ xlate_and_scale_to_bounds(canvas, bounds);
+
+ canvas->drawPicture(const_cast<SkPicture&>(fPicture));
+
+ canvas->restore();
+
+ return true;
+}
+
SkDrawPointsCommand::SkDrawPointsCommand(SkCanvas::PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
fMode = mode;
diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h
index aabc2e0096..b78dc9c3c4 100644
--- a/src/utils/debugger/SkDrawCommand.h
+++ b/src/utils/debugger/SkDrawCommand.h
@@ -316,6 +316,8 @@ class SkDrawPictureCommand : public SkDrawCommand {
public:
SkDrawPictureCommand(SkPicture& picture);
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+ virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
+
private:
SkPicture fPicture;