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

Unified Diff: gm/image_shader.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/image_pict.cpp ('k') | gm/multipicturedraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/image_shader.cpp
diff --git a/gm/image_shader.cpp b/gm/image_shader.cpp
index e7378c447059a6ce5bb132bc2f3701bca378af88..061539013eb525f35dbc456ff8ec51736c6e477e 100644
--- a/gm/image_shader.cpp
+++ b/gm/image_shader.cpp
@@ -72,7 +72,7 @@ const ImageMakerProc gProcs[] = {
* (correctly) when it is inside an image.
*/
class ImageShaderGM : public skiagm::GM {
- SkAutoTUnref<SkPicture> fPicture;
+ sk_sp<SkPicture> fPicture;
public:
ImageShaderGM() {}
@@ -90,7 +90,7 @@ protected:
const SkRect bounds = SkRect::MakeWH(100, 100);
SkPictureRecorder recorder;
draw_something(recorder.beginRecording(bounds), bounds);
- fPicture.reset(recorder.endRecording());
+ fPicture = recorder.finishRecordingAsPicture();
}
void testImage(SkCanvas* canvas, SkImage* image) {
@@ -113,7 +113,7 @@ protected:
const SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100);
for (size_t i = 0; i < SK_ARRAY_COUNT(gProcs); ++i) {
- sk_sp<SkImage> image(gProcs[i](canvas->getGrContext(), fPicture, info));
+ sk_sp<SkImage> image(gProcs[i](canvas->getGrContext(), fPicture.get(), info));
if (image) {
this->testImage(canvas, image.get());
}
« no previous file with comments | « gm/image_pict.cpp ('k') | gm/multipicturedraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698