aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/debugger/SkDrawCommand.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-06-04 05:40:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-04 05:40:44 -0700
commit9b14f26d0f3a974f3dd626c8354e1db1cfcd322f (patch)
tree542d5f1d7a1266454675745139e956b4424fde4b /src/utils/debugger/SkDrawCommand.cpp
parent232f7259a939c70ce447a729a5094fcc272b679d (diff)
Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer)
R=reed@google.com, bsalomon@google.com, mtklein@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/313613004
Diffstat (limited to 'src/utils/debugger/SkDrawCommand.cpp')
-rw-r--r--src/utils/debugger/SkDrawCommand.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index 079961ae70..7c73cec786 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();