aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/pathopsskpclip.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 /gm/pathopsskpclip.cpp
parentc202ea7cc69476a20ad898d6c76bcdbcb18adf74 (diff)
split SkPictureRecorder out of SkPicture
Diffstat (limited to 'gm/pathopsskpclip.cpp')
-rw-r--r--gm/pathopsskpclip.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/gm/pathopsskpclip.cpp b/gm/pathopsskpclip.cpp
index b85b294fef..0d936983b9 100644
--- a/gm/pathopsskpclip.cpp
+++ b/gm/pathopsskpclip.cpp
@@ -32,8 +32,8 @@ protected:
}
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 @@ protected:
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 @@ protected:
canvas->translate(SkIntToScalar(1200 / 2), 0);
canvas->drawPicture(*pict);
canvas->restore();
- SkSafeUnref(pict);
}
private: