summaryrefslogtreecommitdiffstats
path: root/opengl.c
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-04-21 22:30:22 +0800
committerRichard Grenville <[email protected]>2013-04-21 22:30:22 +0800
commit39da27613fcfc70764769f5c458183f63a5f3ec5 (patch)
tree7ab17ebbf799b9fcd8a16b0158fa380666b5fb7c /opengl.c
parentb75d417c52d25894e1a2459468ace7de6f39280d (diff)
downloadtdebase-39da27613fcfc70764769f5c458183f63a5f3ec5.tar.gz
tdebase-39da27613fcfc70764769f5c458183f63a5f3ec5.zip
Improvement: --glx-swap-method & --fade-exclude
- GLX backend: Add --glx-swap-method, to reduce painting region if the driver uses exchange or copy buffer swaps. Untested. - Add --fade-exclude, to disable fading on specific windows based on some conditions. Untested. - Expose GLX backend options through configuration file. Add fetching of GLX backend options through D-Bus. - Use NULL pointer instead of element count to delimit string arrays in parse_vsync()/parse_backend()/parse_glx_swap_method(). - Add documentation about "wintypes" section in configuration file.
Diffstat (limited to 'opengl.c')
-rw-r--r--opengl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/opengl.c b/opengl.c
index 6560afe55..2ea8a8c15 100644
--- a/opengl.c
+++ b/opengl.c
@@ -545,10 +545,20 @@ glx_paint_pre(session_t *ps, XserverRegion *preg) {
ps->glx_z = 0.0;
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ // Exchange swap is interested in the raw damaged region only
+ XserverRegion all_damage_last = ps->all_damage_last;
+ ps->all_damage_last = None;
+ if (SWAPM_EXCHANGE == ps->o.glx_swap_method && *preg)
+ ps->all_damage_last = copy_region(ps, *preg);
+
// OpenGL doesn't support partial repaint without GLX_MESA_copy_sub_buffer,
// we could redraw the whole screen or copy unmodified pixels from
// front buffer with --glx-copy-from-front.
- if (ps->o.glx_use_copysubbuffermesa || !*preg) {
+ if (ps->o.glx_use_copysubbuffermesa || SWAPM_COPY == ps->o.glx_swap_method
+ || !*preg) {
+ }
+ else if (SWAPM_EXCHANGE == ps->o.glx_swap_method && all_damage_last) {
+ XFixesUnionRegion(ps->dpy, *preg, *preg, all_damage_last);
}
else if (!ps->o.glx_copy_from_front) {
free_region(ps, preg);
@@ -572,6 +582,8 @@ glx_paint_pre(session_t *ps, XserverRegion *preg) {
}
}
+ free_region(ps, &all_damage_last);
+
glx_set_clip(ps, *preg, NULL);
}