=== modified file 'src/composite-canvas-egl.cc'
@@ -268,5 +268,8 @@
void
CompositeCanvasEGL::update_screen()
{
- eglSwapBuffers(egl_display_, egl_surface_);
+ if (Options::swap_buffers)
+ eglSwapBuffers(egl_display_, egl_surface_);
+ else
+ glFinish();
}
=== modified file 'src/composite-canvas-glx.cc'
@@ -199,5 +199,8 @@
void
CompositeCanvasGLX::update_screen()
{
- glXSwapBuffers(xdpy_, canvas_);
+ if (Options::swap_buffers)
+ glXSwapBuffers(xdpy_, canvas_);
+ else
+ glFinish();
}
=== modified file 'src/options.cc'
@@ -43,6 +43,7 @@
bool Options::show_help = false;
bool Options::use_vbo = true;
bool Options::list_tests = false;
+bool Options::swap_buffers = true;
static struct option long_options[] = {
{"ids", 1, 0, 0},
@@ -57,6 +58,7 @@
{"run-forever", 0, 0, 0},
{"num-iters", 1, 0, 0},
{"list-tests", 0, 0, 0},
+ {"no-swap-buffers", 0, 0, 0},
{"debug", 0, 0, 0},
{"help", 0, 0, 0},
{0, 0, 0, 0}
@@ -98,6 +100,8 @@
" --num-iters <NUM> The number of iterations run for each test\n"
" [default: 5]\n"
" --list-tests List the avalaible tests and their options\n"
+ " --no-swap-buffers Don't update the screen by swapping the front and\n"
+ " back buffer, use glFinish() instead\n"
" --debug Display debug messages\n"
" --help Display help\n");
}
@@ -144,6 +148,8 @@
Options::list_tests = true;
else if (!strcmp(optname, "manual-redirect"))
Options::manual_redirect = true;
+ else if (!strcmp(optname, "no-swap-buffers"))
+ Options::swap_buffers = false;
else if (!strcmp(optname, "debug"))
Options::show_debug = true;
else if (!strcmp(optname, "help"))
=== modified file 'src/options.h'
@@ -46,6 +46,7 @@
static bool show_help;
static bool use_vbo;
static bool list_tests;
+ static bool swap_buffers;
};
#endif /* OPTIONS_H_ */