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

Unified Diff: tools/skpmaker.cpp

Issue 214953003: split SkPictureRecorder out of SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: update to ToT (again) Created 6 years, 8 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
« samplecode/SampleTiling.cpp ('K') | « tools/render_pictures_main.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpmaker.cpp
===================================================================
--- tools/skpmaker.cpp (revision 14159)
+++ tools/skpmaker.cpp (working copy)
@@ -26,8 +26,8 @@
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 @@
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);
« samplecode/SampleTiling.cpp ('K') | « tools/render_pictures_main.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698