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

Unified Diff: samplecode/SampleHT.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/SampleFilterFuzz.cpp ('k') | samplecode/SamplePictFile.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleHT.cpp
diff --git a/samplecode/SampleHT.cpp b/samplecode/SampleHT.cpp
index 099adcc948db86733e6defd69f655c614c8ee93e..1989c3a7c638163d7faa4ebb1ea73942a7231a4f 100644
--- a/samplecode/SampleHT.cpp
+++ b/samplecode/SampleHT.cpp
@@ -127,7 +127,7 @@ public:
HTDrawable* fDrawable;
};
Rec fArray[N];
- SkAutoTUnref<SkDrawable> fRoot;
+ sk_sp<SkDrawable> fRoot;
SkMSec fTime;
HTView() {
@@ -140,7 +140,7 @@ public:
canvas->drawDrawable(fArray[i].fDrawable);
fArray[i].fDrawable->unref();
}
- fRoot.reset(recorder.endRecordingAsDrawable());
+ fRoot = recorder.finishRecordingAsDrawable();
}
protected:
@@ -153,7 +153,7 @@ protected:
}
void onDrawContent(SkCanvas* canvas) override {
- canvas->drawDrawable(fRoot);
+ canvas->drawDrawable(fRoot.get());
}
bool onAnimate(const SkAnimTimer& timer) override {
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | samplecode/SamplePictFile.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698