aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/recordopts.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-18 07:25:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-18 07:25:55 -0700
commitca2622ba051829fed5f30facd74c5b41cd4b931c (patch)
tree3d8248b7764e500f857b3d6cfb6866e72b632199 /gm/recordopts.cpp
parenteb75c7db3a7372de68347d0df8d58acebc33a9ad (diff)
return pictures as sk_sp
Diffstat (limited to 'gm/recordopts.cpp')
-rw-r--r--gm/recordopts.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/gm/recordopts.cpp b/gm/recordopts.cpp
index 58cbbf3b9f..97d13cb9c9 100644
--- a/gm/recordopts.cpp
+++ b/gm/recordopts.cpp
@@ -100,7 +100,7 @@ static void draw_svg_opacity_and_filter_layer_sequence(SkCanvas* canvas, SkColor
InstallDetectorFunc installDetector) {
SkRect targetRect(SkRect::MakeWH(SkIntToScalar(kTestRectSize), SkIntToScalar(kTestRectSize)));
- SkAutoTUnref<SkPicture> shape;
+ sk_sp<SkPicture> shape;
{
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kTestRectSize + 2),
@@ -108,7 +108,7 @@ static void draw_svg_opacity_and_filter_layer_sequence(SkCanvas* canvas, SkColor
SkPaint shapePaint;
shapePaint.setColor(shapeColor);
canvas->drawRect(targetRect, shapePaint);
- shape.reset(recorder.endRecordingAsPicture());
+ shape = recorder.finishRecordingAsPicture();
}
SkPaint layerPaint;
@@ -117,7 +117,7 @@ static void draw_svg_opacity_and_filter_layer_sequence(SkCanvas* canvas, SkColor
canvas->save();
canvas->clipRect(targetRect);
SkPaint drawPaint;
- drawPaint.setImageFilter(SkPictureImageFilter::Create(shape))->unref();
+ drawPaint.setImageFilter(SkPictureImageFilter::Create(shape.get()))->unref();
installDetector(&drawPaint);
canvas->saveLayer(&targetRect, &drawPaint);
canvas->restore();
@@ -161,8 +161,7 @@ DEF_SIMPLE_GM(recordopts, canvas, (kTestRectSize+1)*2, (kTestRectSize+1)*15) {
drawTestSequence(recorder.beginRecording(SkIntToScalar(kTestRectSize),
SkIntToScalar(kTestRectSize)),
shapeColor, no_detector_install);
- SkAutoTUnref<SkPicture> optimizedPicture(recorder.endRecordingAsPicture());
- optimizedPicture->playback(canvas);
+ recorder.finishRecordingAsPicture()->playback(canvas);
canvas->flush();
}
canvas->restore();
@@ -203,8 +202,7 @@ DEF_SIMPLE_GM(recordopts, canvas, (kTestRectSize+1)*2, (kTestRectSize+1)*15) {
drawTestSequence(recorder.beginRecording(SkIntToScalar(kTestRectSize),
SkIntToScalar(kTestRectSize)),
shapeColor, detectorInstallFunc);
- SkAutoTUnref<SkPicture> optimizedPicture(recorder.endRecordingAsPicture());
- optimizedPicture->playback(canvas);
+ recorder.finishRecordingAsPicture()->playback(canvas);
canvas->flush();
}