diff options
Diffstat (limited to 'src/utils/debugger')
-rw-r--r-- | src/utils/debugger/SkDrawCommand.cpp | 18 | ||||
-rw-r--r-- | src/utils/debugger/SkDrawCommand.h | 2 |
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; |