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

Unified Diff: tools/pinspect.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 | « tools/lua/lua_pictures.cpp ('k') | tools/skiaserve/Request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/pinspect.cpp
diff --git a/tools/pinspect.cpp b/tools/pinspect.cpp
index 419b2ab5d555a112bb029b61a2fc1ccdc420adb9..1cbc2e19c3328d344b12e9edea171f63911911b2 100644
--- a/tools/pinspect.cpp
+++ b/tools/pinspect.cpp
@@ -14,7 +14,7 @@
#include "SkString.h"
#include "SkDumpCanvas.h"
-static SkPicture* inspect(const char path[]) {
+static sk_sp<SkPicture> inspect(const char path[]) {
SkFILEStream stream(path);
if (!stream.isValid()) {
printf("-- Can't open '%s'\n", path);
@@ -33,7 +33,7 @@ static SkPicture* inspect(const char path[]) {
}
stream.rewind();
- SkPicture* pic = SkPicture::CreateFromStream(&stream);
+ auto pic = SkPicture::MakeFromStream(&stream);
if (nullptr == pic) {
SkDebugf("Could not create SkPicture: %s\n", path);
return nullptr;
@@ -71,9 +71,9 @@ int tool_main(int argc, char** argv) {
}
for (; index < argc; ++index) {
- SkAutoTUnref<SkPicture> pic(inspect(argv[index]));
+ auto pic(inspect(argv[index]));
if (doDumpOps) {
- dumpOps(pic);
+ dumpOps(pic.get());
}
if (index < argc - 1) {
printf("\n");
« no previous file with comments | « tools/lua/lua_pictures.cpp ('k') | tools/skiaserve/Request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698