diff mbox

[Branch,~glcompbench-dev/glcompbench/trunk] Rev 27: Add --no-swap-buffers command line option.

Message ID 20110623142314.3922.46932.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org June 23, 2011, 2:23 p.m. UTC
------------------------------------------------------------
revno: 27
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Thu 2011-06-23 12:49:07 +0300
message:
  Add --no-swap-buffers command line option.
modified:
  src/composite-canvas-egl.cc
  src/composite-canvas-glx.cc
  src/options.cc
  src/options.h


--
lp:glcompbench
https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk

You are subscribed to branch lp:glcompbench.
To unsubscribe from this branch go to https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/composite-canvas-egl.cc'
--- src/composite-canvas-egl.cc	2011-04-26 15:02:03 +0000
+++ src/composite-canvas-egl.cc	2011-06-23 09:49:07 +0000
@@ -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'
--- src/composite-canvas-glx.cc	2011-04-26 15:02:03 +0000
+++ src/composite-canvas-glx.cc	2011-06-23 09:49:07 +0000
@@ -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'
--- src/options.cc	2011-06-23 08:54:28 +0000
+++ src/options.cc	2011-06-23 09:49:07 +0000
@@ -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'
--- src/options.h	2011-06-23 08:54:28 +0000
+++ src/options.h	2011-06-23 09:49:07 +0000
@@ -46,6 +46,7 @@ 
     static bool show_help;
     static bool use_vbo;
     static bool list_tests;
+    static bool swap_buffers;
 };
 
 #endif /* OPTIONS_H_ */