diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-07-22 14:14:59 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-07-22 14:14:59 -0700 |
commit | 4ee624771ab698e797b4c9d148ee75a3b14a73e7 (patch) | |
tree | 18f40d3b9eb9d17f14e0660aeac3cb9604a83a1e /src | |
parent | a5a97b22c256cdadcfbf0b440474bfdf856e3ace (diff) |
Some drivers will automatically prevent tearing when swapbuffers or
copysubbuffer is called, and will throttle drawing at that time as well
(usually to the refresh rate); the --no-wait option can be used in that
case.
And for testing drivers, the --always-swap option can be nice, since it
will force full screen updates, allowing page flipping paths to be
taken, for example.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/display.c | 9 | ||||
-rw-r--r-- | src/main.c | 14 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/display.c b/src/display.c index caf63d46..dcb05cb9 100644 --- a/src/display.c +++ b/src/display.c @@ -1450,6 +1450,9 @@ eventLoop (void) s->idle ? s->redrawTime : timeDiff); + if (alwaysSwap == TRUE) + damageScreen (s); + /* substract top most overlay window region */ if (s->overlayWindowCount) { @@ -1509,9 +1512,11 @@ eventLoop (void) targetScreen = NULL; targetOutput = &s->outputDev[0]; - waitForVideoSync (s); + if (!noWait) + waitForVideoSync (s); - if (mask & COMP_SCREEN_DAMAGE_ALL_MASK) + if ((mask & COMP_SCREEN_DAMAGE_ALL_MASK) || + (alwaysSwap == TRUE)) { glXSwapBuffers (d->display, s->output); } @@ -63,6 +63,8 @@ Bool strictBinding = TRUE; Bool noDetection = FALSE; Bool useDesktopHints = FALSE; Bool onlyCurrentScreen = FALSE; +Bool noWait = FALSE; +Bool alwaysSwap = FALSE; #ifdef USE_COW Bool useCow = TRUE; @@ -85,7 +87,9 @@ usage (void) "[--replace]\n " "[--sm-disable] " "[--sm-client-id ID] " - "[--only-current-screen]\n " + "[--only-current-screen] " + "[--no-wait]\n " + "[--always-swap]" #ifdef USE_COW " [--use-root-window] " @@ -364,6 +368,14 @@ main (int argc, char **argv) if (i + 1 < argc) backgroundImage = argv[++i]; } + else if (!strcmp (argv[i], "--no-wait")) + { + noWait = TRUE; + } + else if (!strcmp (argv[i], "--always-swap")) + { + alwaysSwap = TRUE; + } else if (*argv[i] == '-') { compLogMessage ("core", CompLogLevelWarn, |