summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-03-20 17:29:45 +0800
committerRichard Grenville <[email protected]>2013-03-20 17:29:45 +0800
commitda85de48a9d078eeb5a437482c41c85884496318 (patch)
treee9617a3e23a497c7ad23f42b90e966d0e26634a0 /common.h
parentcdd6a73836cc2c1943cdbceab4328dec96949d51 (diff)
downloadtdebase-da85de48a9d078eeb5a437482c41c85884496318.tar.gz
tdebase-da85de48a9d078eeb5a437482c41c85884496318.zip
Feature #69: GLX: Blur background
- GLX backend: Add blur background support using a GLSL shader. Only tested with nvidia-drivers-313.26. Known to cause quite some decrease in performance (~10%?). - Detach shaders in glx_create_program(). Misc changes.
Diffstat (limited to 'common.h')
-rw-r--r--common.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/common.h b/common.h
index 978a9ecb8..977643b60 100644
--- a/common.h
+++ b/common.h
@@ -626,6 +626,18 @@ typedef struct {
f_ReleaseTexImageEXT glXReleaseTexImageProc;
/// FBConfig-s for GLX pixmap of different depths.
glx_fbconfig_t *glx_fbconfigs[OPENGL_MAX_DEPTH + 1];
+#ifdef CONFIG_VSYNC_OPENGL_GLSL
+ /// Fragment shader for blur.
+ GLuint glx_frag_shader_blur;
+ /// GLSL program for blur.
+ GLuint glx_prog_blur;
+ /// Location of uniform "offset_x" in blur GLSL program.
+ GLint glx_prog_blur_unifm_offset_x;
+ /// Location of uniform "offset_y" in blur GLSL program.
+ GLint glx_prog_blur_unifm_offset_y;
+ /// Location of uniform "factor_center" in blur GLSL program.
+ GLint glx_prog_blur_unifm_factor_center;
+#endif
#endif
// === X extension related ===
@@ -1601,9 +1613,21 @@ void
glx_set_clip(session_t *ps, XserverRegion reg);
bool
+glx_blur_dst(session_t *ps, int dx, int dy, int width, int height, float z,
+ GLfloat factor_center);
+
+bool
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);
+
+#ifdef CONFIG_VSYNC_OPENGL_GLSL
+GLuint
+glx_create_shader(GLenum shader_type, const char *shader_str);
+
+GLuint
+glx_create_program(const GLuint * const shaders, int nshaders);
+#endif
#endif
static inline void