split SkPictureRecorder out of SkPicture
https://codereview.chromium.org/214953003/
git-svn-id: http://skia.googlecode.com/svn/trunk@14171 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index e0058c4..79c6c36 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -302,13 +302,17 @@
virtual void onDrawContent(SkCanvas* canvas) {
canvas->save();
- drawPicture(canvas, 0);
+ this->drawPicture(canvas, 0);
canvas->restore();
{
- SkPicture picture;
- SkCanvas* record = picture.beginRecording(320, 480);
- drawPicture(record, 120);
+ SkPictureRecorder recorder;
+ {
+ SkCanvas* record = recorder.beginRecording(320, 480);
+ this->drawPicture(record, 120);
+ }
+ SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+
canvas->translate(0, SkIntToScalar(120));
SkRect clip;
@@ -316,7 +320,7 @@
do {
canvas->save();
canvas->clipRect(clip);
- picture.draw(canvas);
+ picture->draw(canvas);
canvas->restore();
if (clip.fRight < SkIntToScalar(320))
clip.offset(SkIntToScalar(160), 0);