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

Unified Diff: bench/PicturePlaybackBench.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 | « bench/PictureOverheadBench.cpp ('k') | bench/RecordingBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PicturePlaybackBench.cpp
diff --git a/bench/PicturePlaybackBench.cpp b/bench/PicturePlaybackBench.cpp
index 84951a1665bacf6f37b725422f060458888cdcae..2b2b6ad1fe2ab043cf03d1553b3cf8dd0a352054 100644
--- a/bench/PicturePlaybackBench.cpp
+++ b/bench/PicturePlaybackBench.cpp
@@ -42,7 +42,7 @@ protected:
SkPictureRecorder recorder;
SkCanvas* pCanvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT, nullptr, 0);
this->recordCanvas(pCanvas);
- SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+ sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture());
const SkPoint translateDelta = getTranslateDelta(loops);
@@ -182,7 +182,7 @@ public:
paint.setAlpha(0xFF);
canvas->drawRect(SkRect::MakeXYWH(x,y,w,h), paint);
}
- fPic.reset(recorder.endRecording());
+ fPic = recorder.finishRecordingAsPicture();
}
void onDraw(int loops, SkCanvas* canvas) override {
@@ -207,10 +207,10 @@ public:
}
private:
- BBH fBBH;
- Mode fMode;
- SkString fName;
- SkAutoTUnref<SkPicture> fPic;
+ BBH fBBH;
+ Mode fMode;
+ SkString fName;
+ sk_sp<SkPicture> fPic;
};
DEF_BENCH( return new TiledPlaybackBench(kNone, kRandom); )
« no previous file with comments | « bench/PictureOverheadBench.cpp ('k') | bench/RecordingBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698