aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleAll.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 /samplecode/SampleAll.cpp
parentc202ea7cc69476a20ad898d6c76bcdbcb18adf74 (diff)
split SkPictureRecorder out of SkPicture
Diffstat (limited to 'samplecode/SampleAll.cpp')
-rw-r--r--samplecode/SampleAll.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index e0058c4b79..79c6c3658e 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -302,13 +302,17 @@ protected:
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 @@ protected:
do {
canvas->save();
canvas->clipRect(clip);
- picture.draw(canvas);
+ picture->draw(canvas);
canvas->restore();
if (clip.fRight < SkIntToScalar(320))
clip.offset(SkIntToScalar(160), 0);