From 5987f58036574ccf23049b5fe71f29a441d0641d Mon Sep 17 00:00:00 2001 From: "caryclark@google.com" Date: Tue, 2 Oct 2012 18:33:14 +0000 Subject: build iOS with 'make all' This builds all skia tests by treating iOS tools as executable applications. A few warnings were fixed as well. Removed old trace draw code and remnants. Review URL: https://codereview.appspot.com/6597063 git-svn-id: http://skia.googlecode.com/svn/trunk@5776 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tools/bench_pictures_main.cpp | 9 ++++++++- tools/pinspect.cpp | 9 ++++++++- tools/render_pictures_main.cpp | 9 ++++++++- tools/skdiff_main.cpp | 9 ++++++++- tools/skhello.cpp | 9 ++++++++- tools/skimage_main.cpp | 9 ++++++++- 6 files changed, 48 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp index 7c313cf41d..76d5ad3bd1 100644 --- a/tools/bench_pictures_main.cpp +++ b/tools/bench_pictures_main.cpp @@ -443,7 +443,8 @@ static int process_input(const SkString& input, return failures; } -int main(int argc, char* const argv[]) { +int tool_main(int argc, char** argv); +int tool_main(int argc, char** argv) { #ifdef SK_ENABLE_INST_COUNT gPrintInstCount = true; #endif @@ -466,3 +467,9 @@ int main(int argc, char* const argv[]) { return 1; } } + +#if !defined SK_BUILD_FOR_IOS +int main(int argc, char * const argv[]) { + return tool_main(argc, (char**) argv); +} +#endif diff --git a/tools/pinspect.cpp b/tools/pinspect.cpp index 975eda5aec..b82bd332c7 100644 --- a/tools/pinspect.cpp +++ b/tools/pinspect.cpp @@ -44,7 +44,8 @@ static void dumpOps(SkPicture* pic) { canvas.drawPicture(*pic); } -int main(int argc, char* const argv[]) { +int tool_main(int argc, char** argv); +int tool_main(int argc, char** argv) { if (argc < 2) { printf("Usage: pinspect [--dump-ops] filename [filename ...]\n"); return 1; @@ -69,3 +70,9 @@ int main(int argc, char* const argv[]) { } return 0; } + +#if !defined SK_BUILD_FOR_IOS +int main(int argc, char * const argv[]) { + return tool_main(argc, (char**) argv); +} +#endif diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp index 764bea06a1..55ecf38317 100644 --- a/tools/render_pictures_main.cpp +++ b/tools/render_pictures_main.cpp @@ -287,7 +287,8 @@ static void parse_commandline(int argc, char* const argv[], SkTArray* renderer->setDeviceType(deviceType); } -int main(int argc, char* const argv[]) { +int tool_main(int argc, char** argv); +int tool_main(int argc, char** argv) { SkAutoGraphics ag; SkTArray inputs; sk_tools::PictureRenderer* renderer = NULL; @@ -316,3 +317,9 @@ int main(int argc, char* const argv[]) { SkDELETE(renderer); } + +#if !defined SK_BUILD_FOR_IOS +int main(int argc, char * const argv[]) { + return tool_main(argc, (char**) argv); +} +#endif diff --git a/tools/skdiff_main.cpp b/tools/skdiff_main.cpp index 5fbf3ff515..46d4f006a4 100644 --- a/tools/skdiff_main.cpp +++ b/tools/skdiff_main.cpp @@ -1270,7 +1270,8 @@ static void usage (char * argv0) { const int kNoError = 0; const int kGenericError = -1; -int main (int argc, char ** argv) { +int tool_main(int argc, char** argv); +int tool_main(int argc, char** argv) { DiffMetricProc diffProc = compute_diff_pmcolor; int (*sortProc)(const void*, const void*) = compare; @@ -1446,3 +1447,9 @@ int main (int argc, char ** argv) { // make sure that we only return 0 when there were no failures. return (num_failing_results > 255) ? 255 : num_failing_results; } + +#if !defined SK_BUILD_FOR_IOS +int main(int argc, char * const argv[]) { + return tool_main(argc, (char**) argv); +} +#endif diff --git a/tools/skhello.cpp b/tools/skhello.cpp index 82abf80ba7..465806f8fa 100644 --- a/tools/skhello.cpp +++ b/tools/skhello.cpp @@ -14,7 +14,8 @@ static void show_help() { SkDebugf("usage: skhello [-o out-dir] [-t 'hello']\n default output: skhello.png\n"); } -int main(int argc, char* const argv[]) { +int tool_main(int argc, char** argv); +int tool_main(int argc, char** argv) { SkAutoGraphics ag; SkString path("skhello.png"); SkString text("Hello"); @@ -68,3 +69,9 @@ int main(int argc, char* const argv[]) { } return !success; } + +#if !defined SK_BUILD_FOR_IOS +int main(int argc, char * const argv[]) { + return tool_main(argc, (char**) argv); +} +#endif diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp index 504bc30204..83f115cbb0 100644 --- a/tools/skimage_main.cpp +++ b/tools/skimage_main.cpp @@ -54,7 +54,8 @@ static void make_outname(SkString* dst, const char outDir[], const char src[]) { dst->append(".png"); } -int main (int argc, char * const argv[]) { +int tool_main(int argc, char** argv); +int tool_main(int argc, char** argv) { SkAutoGraphics ag; int i, outDirIndex = 0; SkString outDir; @@ -102,3 +103,9 @@ int main (int argc, char * const argv[]) { return 0; } +#if !defined SK_BUILD_FOR_IOS +int main(int argc, char * const argv[]) { + return tool_main(argc, (char**) argv); +} +#endif + -- cgit v1.2.3