From 08b6bfe946b635725fc204c7e8b0e8a10c856e2a Mon Sep 17 00:00:00 2001 From: Richard Grenville Date: Wed, 8 May 2013 22:44:36 +0800 Subject: Imp: Fix GL_TEXTURE_RECTANGLE & Enhance --glx-copy-from-front - Fix GL_TEXTURE_RECTANGLE support. Thanks to amonakov for guides. (#107) - Enhance --glx-copy-from-front to improve performance and make it work with --glx-swap-method, copied from kwin patch. Thanks to bwat47 for info. (#107) - Add texture2Doffset() support in blur GLSL shader. Thanks to amonakov for advice. No visible benefit here, though. (#107) - Only limited tests are done and I'm super sleepy. Bugs expected --- common.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index 9a693c65f..6d7cea107 100644 --- a/common.h +++ b/common.h @@ -392,6 +392,8 @@ typedef struct { bool glx_no_rebind_pixmap; /// GLX swap method we assume OpenGL uses. int glx_swap_method; + /// Whether to use GL_EXT_gpu_shader4 to (hopefully) accelerates blurring. + bool glx_use_gpushader4; /// Whether to try to detect WM windows and mark them as focused. bool mark_wmwin_focused; /// Whether to mark override-redirect windows as focused. @@ -1234,7 +1236,7 @@ mstrncpy(const char *src, unsigned len) { /** * Allocate the space and join two strings. */ -static inline char * __attribute__((const)) +static inline char * mstrjoin(const char *src1, const char *src2) { char *str = malloc(sizeof(char) * (strlen(src1) + strlen(src2) + 1)); @@ -1247,7 +1249,7 @@ mstrjoin(const char *src1, const char *src2) { /** * Allocate the space and join two strings; */ -static inline char * __attribute__((const)) +static inline char * mstrjoin3(const char *src1, const char *src2, const char *src3) { char *str = malloc(sizeof(char) * (strlen(src1) + strlen(src2) + strlen(src3) + 1)); @@ -1259,6 +1261,16 @@ mstrjoin3(const char *src1, const char *src2, const char *src3) { return str; } +/** + * Concatenate a string on heap with another string. + */ +static inline void +mstrextend(char **psrc1, const char *src2) { + *psrc1 = realloc(*psrc1, (*psrc1 ? strlen(*psrc1): 0) + strlen(src2) + 1); + + strcat(*psrc1, src2); +} + /** * Normalize an int value to a specific range. * -- cgit v1.2.1