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

Unified Diff: samplecode/SampleTiling.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 | « samplecode/SamplePictFile.cpp ('k') | src/c/sk_surface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleTiling.cpp
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index 125155e8d050e3a02713244f42c7a8b9b8445d08..62f055f61ec5c100df71e570a23340d402f3fb29 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -54,7 +54,7 @@ static const int gWidth = 32;
static const int gHeight = 32;
class TilingView : public SampleView {
- SkAutoTUnref<SkPicture> fTextPicture;
+ sk_sp<SkPicture> fTextPicture;
SkAutoTUnref<SkDrawLooper> fLooper;
public:
TilingView()
@@ -153,11 +153,11 @@ protected:
if (textCanvas) {
SkASSERT(nullptr == fTextPicture);
- fTextPicture.reset(recorder.endRecording());
+ fTextPicture = recorder.finishRecordingAsPicture();
}
SkASSERT(fTextPicture);
- canvas->drawPicture(fTextPicture);
+ canvas->drawPicture(fTextPicture.get());
}
private:
« no previous file with comments | « samplecode/SamplePictFile.cpp ('k') | src/c/sk_surface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698