Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: gm/pictureimagefilter.cpp

Issue 1811703002: return pictures as sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rely on RVO in picturerecorder Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/picture.cpp ('k') | gm/pictureimagegenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/pictureimagefilter.cpp
diff --git a/gm/pictureimagefilter.cpp b/gm/pictureimagefilter.cpp
index ad479171fd3b2c707a68de6357ceb3c92109f474..f25c86823bd347faaff77ed7b146a107624557f8 100644
--- a/gm/pictureimagefilter.cpp
+++ b/gm/pictureimagefilter.cpp
@@ -33,7 +33,7 @@ protected:
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
canvas->drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
- fPicture.reset(recorder.endRecording());
+ fPicture = recorder.finishRecordingAsPicture();
}
SkISize onISize() override { return SkISize::Make(600, 300); }
@@ -58,16 +58,16 @@ protected:
SkRect emptyRect = SkRect::MakeXYWH(20, 20, 0, 0);
SkRect bounds = SkRect::MakeXYWH(0, 0, 100, 100);
SkAutoTUnref<SkImageFilter> pictureSource(
- SkPictureImageFilter::Create(fPicture));
+ SkPictureImageFilter::Create(fPicture.get()));
SkAutoTUnref<SkImageFilter> pictureSourceSrcRect(
- SkPictureImageFilter::Create(fPicture, srcRect));
+ SkPictureImageFilter::Create(fPicture.get(), srcRect));
SkAutoTUnref<SkImageFilter> pictureSourceEmptyRect(
- SkPictureImageFilter::Create(fPicture, emptyRect));
+ SkPictureImageFilter::Create(fPicture.get(), emptyRect));
SkAutoTUnref<SkImageFilter> pictureSourceResampled(
- SkPictureImageFilter::CreateForLocalSpace(fPicture, fPicture->cullRect(),
+ SkPictureImageFilter::CreateForLocalSpace(fPicture.get(), fPicture->cullRect(),
kLow_SkFilterQuality));
SkAutoTUnref<SkImageFilter> pictureSourcePixelated(
- SkPictureImageFilter::CreateForLocalSpace(fPicture, fPicture->cullRect(),
+ SkPictureImageFilter::CreateForLocalSpace(fPicture.get(), fPicture->cullRect(),
kNone_SkFilterQuality));
canvas->save();
@@ -102,7 +102,7 @@ protected:
}
private:
- SkAutoTUnref<SkPicture> fPicture;
+ sk_sp<SkPicture> fPicture;
typedef GM INHERITED;
};
« no previous file with comments | « gm/picture.cpp ('k') | gm/pictureimagegenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698