diff options
author | Richard Grenville <[email protected]> | 2013-12-10 22:06:02 +0800 |
---|---|---|
committer | Richard Grenville <[email protected]> | 2013-12-10 22:06:02 +0800 |
commit | 44a13b4e767eef1985a4a34723b7cc279e1dc160 (patch) | |
tree | 901b608ef59ace1f0b4a4759b8e353238b209c7e /compton.h | |
parent | 640ef0437814dbc4df57a275cbadecb368ad0950 (diff) | |
download | tdebase-44a13b4e767eef1985a4a34723b7cc279e1dc160.tar.gz tdebase-44a13b4e767eef1985a4a34723b7cc279e1dc160.zip |
Feature: Add XRender-GLX hybird backend
- Add new backend "xr_glx_hybird", which uses X Render for all
compositing but GLX on the last step of rendering to screen. This
makes GLX-backend-specific VSync methods usable while may avoid
certain bugs with GLX backend. The idea comes from ali1234.
Experimental.
- GLX backend: Stop using or rendering to depth buffer.
- Use glFinish() instead of glFlush() before VSync. It probably uses
more CPU but could be more reliable than glFlush().
Diffstat (limited to 'compton.h')
-rw-r--r-- | compton.h | 26 |
1 files changed, 17 insertions, 9 deletions
@@ -219,7 +219,7 @@ paint_isvalid(session_t *ps, const paint_t *ppaint) { if (!ppaint) return false; - if (BKEND_XRENDER == ps->o.backend && !ppaint->pict) + if (bkend_use_xrender(ps) && !ppaint->pict) return false; #ifdef CONFIG_VSYNC_OPENGL @@ -229,25 +229,32 @@ paint_isvalid(session_t *ps, const paint_t *ppaint) { return true; } + /** * Bind texture in paint_t if we are using GLX backend. */ static inline bool -paint_bind_tex(session_t *ps, paint_t *ppaint, +paint_bind_tex_real(session_t *ps, paint_t *ppaint, unsigned wid, unsigned hei, unsigned depth, bool force) { #ifdef CONFIG_VSYNC_OPENGL - if (BKEND_GLX == ps->o.backend) { - if (!ppaint->pixmap) - return false; + if (!ppaint->pixmap) + return false; - if (force || !glx_tex_binded(ppaint->ptex, ppaint->pixmap)) - return glx_bind_pixmap(ps, &ppaint->ptex, ppaint->pixmap, wid, hei, depth); - } + if (force || !glx_tex_binded(ppaint->ptex, ppaint->pixmap)) + return glx_bind_pixmap(ps, &ppaint->ptex, ppaint->pixmap, wid, hei, depth); #endif return true; } +static inline bool +paint_bind_tex(session_t *ps, paint_t *ppaint, + unsigned wid, unsigned hei, unsigned depth, bool force) { + if (BKEND_GLX == ps->o.backend) + return paint_bind_tex_real(ps, ppaint, wid, hei, depth, force); + return true; +} + /** * Free data in a reg_data_t. */ @@ -679,7 +686,8 @@ static inline void set_tgt_clip(session_t *ps, XserverRegion reg, const reg_data_t *pcache_reg) { switch (ps->o.backend) { case BKEND_XRENDER: - XFixesSetPictureClipRegion(ps->dpy, ps->tgt_buffer, 0, 0, reg); + case BKEND_XR_GLX_HYBIRD: + XFixesSetPictureClipRegion(ps->dpy, ps->tgt_buffer.pict, 0, 0, reg); break; #ifdef CONFIG_VSYNC_OPENGL case BKEND_GLX: |