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

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

Issue 313613004: Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add staging entry point for Chromium and Android Created 6 years, 7 months 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
Index: src/utils/debugger/SkDrawCommand.cpp
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index 079961ae701b30eb1b41c4ff72cc8d6437e31c92..7c73cec786cc47fc7019dfcc9b1812a93e58f5f5 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -502,11 +502,11 @@ bool SkDrawPathCommand::render(SkCanvas* canvas) const {
return true;
}
-SkDrawPictureCommand::SkDrawPictureCommand(SkPicture& picture)
+SkDrawPictureCommand::SkDrawPictureCommand(const SkPicture* picture)
: INHERITED(DRAW_PICTURE)
- , fPicture(picture) {
+ , fPicture(SkRef(picture)) {
SkString* temp = new SkString;
- temp->appendf("SkPicture: W: %d H: %d", picture.width(), picture.height());
+ temp->appendf("SkPicture: W: %d H: %d", picture->width(), picture->height());
fInfo.push(temp);
}
@@ -518,11 +518,11 @@ bool SkDrawPictureCommand::render(SkCanvas* canvas) const {
canvas->clear(0xFFFFFFFF);
canvas->save();
- SkRect bounds = SkRect::MakeWH(SkIntToScalar(fPicture.width()),
- SkIntToScalar(fPicture.height()));
+ SkRect bounds = SkRect::MakeWH(SkIntToScalar(fPicture->width()),
+ SkIntToScalar(fPicture->height()));
xlate_and_scale_to_bounds(canvas, bounds);
- canvas->drawPicture(const_cast<SkPicture&>(fPicture));
+ canvas->drawPicture(fPicture.get());
canvas->restore();

Powered by Google App Engine
This is Rietveld 408576698