summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-05-08 22:44:36 +0800
committerRichard Grenville <[email protected]>2013-05-08 22:50:02 +0800
commit08b6bfe946b635725fc204c7e8b0e8a10c856e2a (patch)
treece67395627b33d6a64002a3321556f641336f9c1 /common.h
parentc742c97a8c68dc168cca8b135609eb1501ac3225 (diff)
downloadtdebase-08b6bfe946b635725fc204c7e8b0e8a10c856e2a.tar.gz
tdebase-08b6bfe946b635725fc204c7e8b0e8a10c856e2a.zip
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
Diffstat (limited to 'common.h')
-rw-r--r--common.h16
1 files changed, 14 insertions, 2 deletions
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));
@@ -1260,6 +1262,16 @@ mstrjoin3(const char *src1, const char *src2, const char *src3) {
}
/**
+ * 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.
*
* @param i int value to normalize