diff options
Diffstat (limited to 'linux/main.cpp')
-rw-r--r-- | linux/main.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/linux/main.cpp b/linux/main.cpp index c21d7446e8..0892ce8f1e 100644 --- a/linux/main.cpp +++ b/linux/main.cpp @@ -32,17 +32,19 @@ void quit_handler(int) { int main(int argc, char *argv[]) { bool fullscreen = false; + bool benchmark = false; std::string style; const struct option long_options[] = { {"fullscreen", no_argument, 0, 'f'}, + {"benchmark", no_argument, 0, 'b'}, {"style", required_argument, 0, 's'}, {0, 0, 0, 0} }; while (true) { int option_index = 0; - int opt = getopt_long(argc, argv, "fs:", long_options, &option_index); + int opt = getopt_long(argc, argv, "fbs:", long_options, &option_index); if (opt == -1) break; switch (opt) { @@ -52,6 +54,9 @@ int main(int argc, char *argv[]) { case 'f': fullscreen = true; break; + case 'b': + benchmark = true; + break; case 's': style = std::string("asset://") + std::string(optarg); default: @@ -67,7 +72,11 @@ int main(int argc, char *argv[]) { sigIntHandler.sa_flags = 0; sigaction(SIGINT, &sigIntHandler, NULL); - view = std::make_unique<GLFWView>(fullscreen); + if (benchmark) { + mbgl::Log::Info(mbgl::Event::General, "BENCHMARK MODE: Some optimizations are disabled."); + } + + view = std::make_unique<GLFWView>(fullscreen, benchmark); mbgl::SQLiteCache cache("/tmp/mbgl-cache.db"); mbgl::DefaultFileSource fileSource(&cache); |