From 21ec5056489f53601b3d45a0b1c79a85add42b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Mon, 10 Aug 2015 17:14:00 +0300 Subject: add benchmark mode that shows the real frame time rather than the vsync time --- linux/main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'linux') 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(fullscreen); + if (benchmark) { + mbgl::Log::Info(mbgl::Event::General, "BENCHMARK MODE: Some optimizations are disabled."); + } + + view = std::make_unique(fullscreen, benchmark); mbgl::SQLiteCache cache("/tmp/mbgl-cache.db"); mbgl::DefaultFileSource fileSource(&cache); -- cgit v1.2.1