aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skpmaker.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-13 19:09:42 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-13 19:09:42 +0000
commit84b18c7e3e042bf206e1ace3d1b6ea5bb929fe51 (patch)
tree7b46e74e6212283d9efe62a7b6feaad2c009972b /tools/skpmaker.cpp
parentc202ea7cc69476a20ad898d6c76bcdbcb18adf74 (diff)
split SkPictureRecorder out of SkPicture
Diffstat (limited to 'tools/skpmaker.cpp')
-rw-r--r--tools/skpmaker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/skpmaker.cpp b/tools/skpmaker.cpp
index 00082075c7..740d522366 100644
--- a/tools/skpmaker.cpp
+++ b/tools/skpmaker.cpp
@@ -26,8 +26,8 @@ DEFINE_string(writePath, "", "Filepath to write the SKP into.");
static void skpmaker(int width, int height, int border, SkColor color,
const char *writePath) {
- SkPicture pict;
- SkCanvas* canvas = pict.beginRecording(width, height);
+ SkPictureRecorder recorder;
+ SkCanvas* canvas = recorder.beginRecording(width, height);
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setColor(SK_ColorBLACK);
@@ -36,9 +36,9 @@ static void skpmaker(int width, int height, int border, SkColor color,
canvas->drawRectCoords(SkIntToScalar(border), SkIntToScalar(border),
SkIntToScalar(width - border*2), SkIntToScalar(height - border*2),
paint);
- pict.endRecording();
+ SkAutoTUnref<SkPicture> pict(recorder.endRecording());
SkFILEWStream stream(writePath);
- pict.serialize(&stream);
+ pict->serialize(&stream);
}
int tool_main(int argc, char** argv);