diff options
author | Richard Grenville <[email protected]> | 2013-03-21 13:05:56 +0800 |
---|---|---|
committer | Richard Grenville <[email protected]> | 2013-03-21 13:05:56 +0800 |
commit | 2dfe9d52ed6d83fd0f2cc6cc0d921701dcb8b017 (patch) | |
tree | 734b354c4c6c1ed99343bd958d53d072c4d776cb /common.h | |
parent | da85de48a9d078eeb5a437482c41c85884496318 (diff) | |
download | tdebase-2dfe9d52ed6d83fd0f2cc6cc0d921701dcb8b017.tar.gz tdebase-2dfe9d52ed6d83fd0f2cc6cc0d921701dcb8b017.zip |
Improvement: --glx-use-copysubbuffermesa
- GLX backend: Add --glx-use-copysubbuffermesa, to use
MESA_copy_sub_buffer to do partial screen update. Huge performance
boost on mesa drivers for partial screen updates, but does not work
for nvidia-drivers and may break VSync. Automagically overrides
--glx-copy-from-front.
- Add rect_is_fullscreen() to reuse code. Misc changes.
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -284,6 +284,8 @@ typedef int (*f_SwapIntervalSGI) (int interval); typedef void (*f_BindTexImageEXT) (Display *display, GLXDrawable drawable, int buffer, const int *attrib_list); typedef void (*f_ReleaseTexImageEXT) (Display *display, GLXDrawable drawable, int buffer); +typedef void (*f_CopySubBuffer) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height); + /// @brief Wrapper of a GLX FBConfig. typedef struct { GLXFBConfig cfg; @@ -344,6 +346,8 @@ typedef struct { bool glx_no_stencil; /// Whether to copy unmodified regions from front buffer. bool glx_copy_from_front; + /// Whether to use glXCopySubBufferMESA() to update screen. + bool glx_use_copysubbuffermesa; /// Whether to try to detect WM windows and mark them as focused. bool mark_wmwin_focused; /// Whether to mark override-redirect windows as focused. @@ -624,6 +628,8 @@ typedef struct { f_BindTexImageEXT glXBindTexImageProc; /// Pointer to glXReleaseTexImageEXT function. f_ReleaseTexImageEXT glXReleaseTexImageProc; + /// Pointer to glXCopySubBufferMESA function. + f_CopySubBuffer glXCopySubBufferProc; /// FBConfig-s for GLX pixmap of different depths. glx_fbconfig_t *glx_fbconfigs[OPENGL_MAX_DEPTH + 1]; #ifdef CONFIG_VSYNC_OPENGL_GLSL @@ -1491,6 +1497,15 @@ free_region(session_t *ps, XserverRegion *p) { } /** + * Check if a rectangle includes the whole screen. + */ +static inline bool +rect_is_fullscreen(session_t *ps, int x, int y, unsigned wid, unsigned hei) { + return (x <= 0 && y <= 0 + && (x + wid) >= ps->root_width && (y + hei) >= ps->root_height); +} + +/** * Determine if a window has a specific property. * * @param ps current session @@ -1621,6 +1636,9 @@ glx_render(session_t *ps, const glx_texture_t *ptex, int x, int y, int dx, int dy, int width, int height, int z, double opacity, bool neg, XserverRegion reg_tgt); +void +glx_swap_copysubbuffermesa(session_t *ps, XserverRegion reg); + #ifdef CONFIG_VSYNC_OPENGL_GLSL GLuint glx_create_shader(GLenum shader_type, const char *shader_str); |