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/src@12345 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/utils/debugger/SkDrawCommand.cpp b/utils/debugger/SkDrawCommand.cpp
index 1d4bfed..0cde3b5 100644
--- a/utils/debugger/SkDrawCommand.cpp
+++ b/utils/debugger/SkDrawCommand.cpp
@@ -485,13 +485,29 @@
 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/utils/debugger/SkDrawCommand.h b/utils/debugger/SkDrawCommand.h
index aabc2e0..b78dc9c 100644
--- a/utils/debugger/SkDrawCommand.h
+++ b/utils/debugger/SkDrawCommand.h
@@ -316,6 +316,8 @@
 public:
     SkDrawPictureCommand(SkPicture& picture);
     virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
+    virtual bool render(SkCanvas* canvas) const SK_OVERRIDE;
+
 private:
     SkPicture fPicture;