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

Unified Diff: tools/lua/lua_app.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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
Index: tools/lua/lua_app.cpp
diff --git a/tools/lua/lua_app.cpp b/tools/lua/lua_app.cpp
index 6aea8ee43776a65aad26e7f227ab7b2814dfc86f..92623d0a208659ab22a53ea0870ae1f0a5acbc46 100644
--- a/tools/lua/lua_app.cpp
+++ b/tools/lua/lua_app.cpp
@@ -19,10 +19,10 @@ extern "C" {
#include "lauxlib.h"
}
-static SkData* read_into_data(const char file[]) {
- SkData* data = SkData::NewFromFileName(file);
+static sk_sp<SkData> read_into_data(const char file[]) {
+ sk_sp<SkData> data(SkData::MakeFromFileName(file));
if (!data) {
- data = SkData::NewEmpty();
+ data = SkData::MakeEmpty();
}
return data;
}
@@ -33,7 +33,7 @@ int tool_main(int argc, char** argv) {
SkLua L;
for (int i = 1; i < argc; ++i) {
- SkData* data = nullptr;
+ sk_sp<SkData> data;
const void* ptr;
size_t len;
@@ -50,7 +50,6 @@ int tool_main(int argc, char** argv) {
SkDebugf("failed to load %s\n", argv[i]);
exit(-1);
}
- SkSafeUnref(data);
}
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698