diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-19 19:23:17 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-19 19:23:17 +0000 |
commit | bdc772ebbe5834a2fb6dbc2c152b54cdc5bd47e0 (patch) | |
tree | 59222c77c88333cff1f3427740b8573b1ee6f499 /tools/lua | |
parent | b7b7eb32f41729c136c939702b0c9a484accb541 (diff) |
Add quiet mode to lua_pictures.
This allows:
for i in {0..5}; do
out/Debug/lua_pictures -q --skpPath $SKP_PATH -l $SCRIPT --modulo $i 6
done
to generate output similar to what telemetry will generate.
R=reed@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/197793007
git-svn-id: http://skia.googlecode.com/svn/trunk@13861 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools/lua')
-rw-r--r-- | tools/lua/lua_pictures.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/lua/lua_pictures.cpp b/tools/lua/lua_pictures.cpp index 355a82352a..c8b205d255 100644 --- a/tools/lua/lua_pictures.cpp +++ b/tools/lua/lua_pictures.cpp @@ -36,6 +36,7 @@ DEFINE_string2(skpPath, r, "", "Read this .skp file or .skp files from this dir" DEFINE_string2(luaFile, l, "", "File containing lua script to run"); DEFINE_string2(headCode, s, "", "Optional lua code to call at beginning"); DEFINE_string2(tailFunc, s, "", "Optional lua function to call at end"); +DEFINE_bool2(quiet, q, false, "Silence all non-error related output"); static SkPicture* load_picture(const char path[]) { SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); @@ -97,7 +98,9 @@ int tool_main(int argc, char** argv) { for (int i = 0; i < FLAGS_luaFile.count(); ++i) { SkAutoDataUnref data(read_into_data(FLAGS_luaFile[i])); - SkDebugf("loading %s...\n", FLAGS_luaFile[i]); + if (!FLAGS_quiet) { + SkDebugf("loading %s...\n", FLAGS_luaFile[i]); + } if (!L.runCode(data->data(), data->size())) { SkDebugf("failed to load luaFile %s\n", FLAGS_luaFile[i]); exit(-1); @@ -144,7 +147,9 @@ int tool_main(int argc, char** argv) { moduloStr.printf("[%d.%d] ", i, moduloDivisor); } const char* path = paths[i].c_str(); - SkDebugf("scraping %s %s\n", path, moduloStr.c_str()); + if (!FLAGS_quiet) { + SkDebugf("scraping %s %s\n", path, moduloStr.c_str()); + } SkAutoTUnref<SkPicture> pic(load_picture(path)); if (pic.get()) { |