Misc: Add DEBUG_GLX_MARK & Misc

- GLX backend: Add DEBUG_GLX_MARK, to add GL marks around functions with
  glStringMarkerGREMEDY(), and mark frame termination with
  glFrameTerminatorGREMEDY().

- Print output of `compton -h` to stdout. (#110)

- GLX backend: Strip out elements with factor 0 in GLSL blur code.
  Thanks to jrfonseca for guides. (#107)
This commit is contained in:
Richard Grenville
2013-05-12 18:21:16 +08:00
parent 90099d371d
commit 57d8b940e7
5 changed files with 85 additions and 7 deletions

View File

@ -90,6 +90,13 @@ glx_init(session_t *ps, bool need_render) {
// Acquire function addresses
if (need_render) {
#ifdef DEBUG_GLX_MARK
ps->glStringMarkerGREMEDY = (f_StringMarkerGREMEDY)
glXGetProcAddress((const GLubyte *) "glStringMarkerGREMEDY");
ps->glFrameTerminatorGREMEDY = (f_FrameTerminatorGREMEDY)
glXGetProcAddress((const GLubyte *) "glFrameTerminatorGREMEDY");
#endif
ps->glXBindTexImageProc = (f_BindTexImageEXT)
glXGetProcAddress((const GLubyte *) "glXBindTexImageEXT");
ps->glXReleaseTexImageProc = (f_ReleaseTexImageEXT)
@ -249,6 +256,8 @@ glx_init_blur(session_t *ps) {
if (hei / 2 == i && wid / 2 == j)
continue;
double val = XFixedToDouble(ps->o.blur_kern[2 + i * wid + j]);
if (0.0 == val)
continue;
sum += val;
sprintf(pc, shader_add, val, texture_func, j - wid / 2, i - hei / 2);
pc += strlen(pc);