summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-08-10 17:14:00 +0300
committerKonstantin Käfer <mail@kkaefer.com>2015-08-11 16:40:40 +0300
commit21ec5056489f53601b3d45a0b1c79a85add42b0b (patch)
treea408abd442adf33facad99e1c50fdd5c8d3e331d /linux
parentca8ffcc4562b830a02e1087e8d951b556ae315d9 (diff)
downloadqtlocation-mapboxgl-21ec5056489f53601b3d45a0b1c79a85add42b0b.tar.gz
add benchmark mode that shows the real frame time rather than the vsync time
Diffstat (limited to 'linux')
-rw-r--r--linux/main.cpp13
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);