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

Unified Diff: tools/lua/lua_app.cpp

Issue 565803005: use SkData::NewUninitialized (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: readInData -> NewFromStream Created 6 years, 3 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 | « tests/SurfaceTest.cpp ('k') | tools/lua/lua_pictures.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | tools/lua/lua_pictures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698