Improvement #7: Add double buffering

Add double buffering with X DBE extension in hope to get rid of the
tearing issue. Thanks to cairo-compmgr for providing hints. Could be
enabled with --dbe. Only very limited tests have been done, I don't know
if it actually solves the tearing issue. My estimation is it is harmful
for performance, but I found no clear evidence. Experimental, so no
configuration file option is available for it.

MONITOR_REPAINT is broken if --dbe is turned on, this is intended for
testing whether DBE is actually working.
This commit is contained in:
Richard Grenville
2012-10-23 13:42:20 +08:00
parent fe2146f1a5
commit 5dd544d29d
2 changed files with 82 additions and 10 deletions

View File

@ -75,6 +75,7 @@
#include <X11/extensions/Xrender.h>
#include <X11/extensions/shape.h>
#include <X11/extensions/Xrandr.h>
#include <X11/extensions/Xdbe.h>
#ifdef CONFIG_VSYNC_DRM
#include <fcntl.h>
@ -314,6 +315,8 @@ typedef struct _options {
int refresh_rate;
/// VSync method to use;
vsync_t vsync;
/// Whether to enable double buffer.
Bool dbe;
// Shadow
Bool wintype_shadow[NUM_WINTYPES];