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

Unified Diff: tools/iOSShell.cpp

Issue 389653004: share dm and command flags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address comments Created 6 years, 5 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
« tests/skia_test.cpp ('K') | « tools/flags/SkCommonFlags.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« tests/skia_test.cpp ('K') | « tools/flags/SkCommonFlags.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698