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

Unified Diff: gm/pathopsskpclip.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
Index: gm/pathopsskpclip.cpp
===================================================================
--- gm/pathopsskpclip.cpp (revision 14159)
+++ gm/pathopsskpclip.cpp (working copy)
@@ -32,8 +32,8 @@
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkPicture* pict = SkNEW(SkPicture);
- SkCanvas* rec = pict->beginRecording(1200, 900);
+ SkPictureRecorder recorder;
+ SkCanvas* rec = recorder.beginRecording(1200, 900);
SkPath p;
SkRect r = {
SkIntToScalar(100),
@@ -46,7 +46,7 @@
rec->translate(SkIntToScalar(250), SkIntToScalar(250));
rec->clipPath(p, SkRegion::kIntersect_Op, true);
rec->drawColor(0xffff0000);
- pict->endRecording();
+ SkAutoTUnref<SkPicture> pict(recorder.endRecording());
canvas->setAllowSimplifyClip(true);
canvas->save();
@@ -58,7 +58,6 @@
canvas->translate(SkIntToScalar(1200 / 2), 0);
canvas->drawPicture(*pict);
canvas->restore();
- SkSafeUnref(pict);
}
private:
« no previous file with comments | « gm/optimizations.cpp ('k') | gm/pictureimagefilter.cpp » ('j') | samplecode/SampleTiling.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698