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
This commit is contained in:
Richard Grenville
2013-05-08 22:44:36 +08:00
parent 555131101f
commit 1c66237f99
3 changed files with 160 additions and 70 deletions

View File

@@ -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.
*