Index: tools/lua/lua_app.cpp |
diff --git a/tools/lua/lua_app.cpp b/tools/lua/lua_app.cpp |
index 50b1352c2dccc88061c312b2e8d17576324ad8f5..023ddaeaca51489fd0b93e3841a3e47355df992f 100644 |
--- a/tools/lua/lua_app.cpp |
+++ b/tools/lua/lua_app.cpp |
@@ -18,14 +18,11 @@ extern "C" { |
} |
static SkData* read_into_data(const char file[]) { |
- SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(file)); |
- if (!stream.get()) { |
- return SkData::NewEmpty(); |
+ SkData* data = SkData::NewFromFileName(file); |
+ if (!data) { |
+ data = SkData::NewEmpty(); |
} |
- size_t len = stream->getLength(); |
- void* buffer = sk_malloc_throw(len); |
- stream->read(buffer, len); |
- return SkData::NewFromMalloc(buffer, len); |
+ return data; |
} |
int tool_main(int argc, char** argv); |