Index: src/utils/debugger/SkDrawCommand.cpp |
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp |
index 1d4bfed7f3519acd23f2706bdf7e5bc1bd84c44a..0cde3b537c07b2d0bdd29a98dded9a8ba9358952 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); |
+ |
robertphillips
2013/11/21 16:46:38
drawPicture should take a const SkPicture :(
|
+ 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; |