Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: src/utils/debugger/SkDrawCommand.cpp

Issue 80223003: Show basic SkPicture details in debugger. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698