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

Unified Diff: bench/PictureNestingBench.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 | « no previous file | bench/PictureOverheadBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PictureNestingBench.cpp
diff --git a/bench/PictureNestingBench.cpp b/bench/PictureNestingBench.cpp
index a968d51db55511223964d320b0798c9a9b615d47..abe89368f95e7a76f6bbe1bb1fdc7840b643402b 100644
--- a/bench/PictureNestingBench.cpp
+++ b/bench/PictureNestingBench.cpp
@@ -74,8 +74,7 @@ protected:
c->restore();
if (recordPicture) {
- SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- canvas->drawPicture(picture);
+ canvas->drawPicture(recorder.finishRecordingAsPicture());
}
return pics;
@@ -125,7 +124,7 @@ protected:
SkCanvas* c = recorder.beginRecording(SkIntToScalar(canvasSize.x()),
SkIntToScalar(canvasSize.y()));
this->doDraw(c);
- SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+ (void)recorder.finishRecordingAsPicture();
}
}
@@ -148,7 +147,7 @@ protected:
SkIntToScalar(canvasSize.y()));
this->doDraw(c);
- fPicture.reset(recorder.endRecording());
+ fPicture = recorder.finishRecordingAsPicture();
}
void onDraw(int loops, SkCanvas* canvas) override {
@@ -158,7 +157,7 @@ protected:
}
private:
- SkAutoTUnref<SkPicture> fPicture;
+ sk_sp<SkPicture> fPicture;
typedef PictureNesting INHERITED;
};
« no previous file with comments | « no previous file | bench/PictureOverheadBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698