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: |