aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/lua
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-08-02 14:40:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-02 14:40:46 -0700
commit38d909ec2875f79952de08f36adfaac5680d2c53 (patch)
treea11067146b42f3faa8531d6ef912f7246bbde1f2 /tools/lua
parentada5a44f3bdac10a8a0c53b34f5add7aea9fdbb0 (diff)
Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.
This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004 Review-Url: https://codereview.chromium.org/2206633004
Diffstat (limited to 'tools/lua')
-rw-r--r--tools/lua/lua_app.cpp9
-rw-r--r--tools/lua/lua_pictures.cpp6
2 files changed, 7 insertions, 8 deletions
diff --git a/tools/lua/lua_app.cpp b/tools/lua/lua_app.cpp
index 6aea8ee437..92623d0a20 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;
}
diff --git a/tools/lua/lua_pictures.cpp b/tools/lua/lua_pictures.cpp
index 9776002e7a..eee7088f0d 100644
--- a/tools/lua/lua_pictures.cpp
+++ b/tools/lua/lua_pictures.cpp
@@ -85,9 +85,9 @@ int tool_main(int argc, char** argv) {
SkLua L(summary);
for (int i = 0; i < FLAGS_luaFile.count(); ++i) {
- SkAutoDataUnref data(SkData::NewFromFileName(FLAGS_luaFile[i]));
- if (nullptr == data.get()) {
- data.reset(SkData::NewEmpty());
+ sk_sp<SkData> data(SkData::MakeFromFileName(FLAGS_luaFile[i]));
+ if (!data) {
+ data = SkData::MakeEmpty();
}
if (!FLAGS_quiet) {
SkDebugf("loading %s...\n", FLAGS_luaFile[i]);