Index: tools/iOSShell.cpp |
diff --git a/tools/iOSShell.cpp b/tools/iOSShell.cpp |
index bd709386ec389b5b96d15c8132a71d700621b105..f576e24d5b53da6f3835744d8cdf25af99a63f17 100644 |
--- a/tools/iOSShell.cpp |
+++ b/tools/iOSShell.cpp |
@@ -9,8 +9,9 @@ |
#include "Resources.h" |
#include "SkCanvas.h" |
-#include "SkCommandLineFlags.h" |
+#include "SkCommonFlags.h" |
#include "SkGraphics.h" |
+#include "SkThreadPool.h" |
#include "SkWindow.h" |
#include "sk_tool_utils.h" |
@@ -52,15 +53,23 @@ void ShellWindow::onSizeChange() { |
view->setSize(this->width(), this->height()); |
} |
-void tool_main(int argc, char *argv[]); |
+DEFINE_bool(dm, false, "run dm"); |
+DEFINE_bool(unittests, false, "run unit tests"); |
+ |
+void dm_main(int argc, char *argv[]); |
+void test_main(int argc, char *argv[]); |
bool set_cmd_line_args(int argc, char *argv[], const char* resourceDir) { |
- for (int index = 0; index < argc; ++index) { |
- if (!strcmp("--test", argv[index])) { |
- SetResourcePath(resourceDir); |
- tool_main(argc - 1, argv); |
- return true; |
- } |
+ SkCommandLineFlags::SetUsage(""); |
+ SkCommandLineFlags::Parse(argc, argv); |
+ SetResourcePath(resourceDir); |
+ if (FLAGS_dm) { |
+ dm_main(argc, argv); |
+ return true; |
+ } |
+ if (FLAGS_unittests) { |
+ test_main(argc, argv); |
+ return true; |
} |
return false; |
} |