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

Unified Diff: tools/iOSShell.cpp

Issue 389653004: share dm and command flags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: sync up with latest dm 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
« no previous file with comments | « 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..49be34d65b3865274d2899166465d7c9452cdc38 100644
--- a/tools/iOSShell.cpp
+++ b/tools/iOSShell.cpp
@@ -8,9 +8,11 @@
#include "iOSShell.h"
#include "Resources.h"
+#include "SkApplication.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,17 +54,22 @@ void ShellWindow::onSizeChange() {
view->setSize(this->width(), this->height());
}
-void tool_main(int argc, char *argv[]);
+DEFINE_bool(dm, false, "run dm");
+DEFINE_bool(nanobench, false, "run nanobench");
-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;
- }
+int nanobench_main();
+int dm_main();
+
+IOS_launch_type set_cmd_line_args(int argc, char *argv[], const char* resourceDir) {
+ SkCommandLineFlags::Parse(argc, argv);
+ SetResourcePath(resourceDir);
+ if (FLAGS_nanobench) {
+ return nanobench_main() ? kError_iOSLaunchType : kTool_iOSLaunchType;
+ }
+ if (FLAGS_dm) {
+ return dm_main() ? kError_iOSLaunchType : kTool_iOSLaunchType;
}
- return false;
+ return kError_iOSLaunchType;
}
// FIXME: this should be in a header
« no previous file with comments | « tools/flags/SkCommonFlags.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698