summaryrefslogtreecommitdiffstats
path: root/compton.c
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-05-12 18:21:16 +0800
committerRichard Grenville <[email protected]>2013-05-12 18:21:16 +0800
commit2b0dfa9b968ce34f35919f9df216e668fec761b8 (patch)
tree090fa5fd1839dd4f6b395db1cb014fd895153d46 /compton.c
parent060b5ab23c3fb18a8695e8f7e5d145f023b7b3b2 (diff)
downloadtdebase-2b0dfa9b968ce34f35919f9df216e668fec761b8.tar.gz
tdebase-2b0dfa9b968ce34f35919f9df216e668fec761b8.zip
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)
Diffstat (limited to 'compton.c')
-rw-r--r--compton.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/compton.c b/compton.c
index cffee1a30..7e005b638 100644
--- a/compton.c
+++ b/compton.c
@@ -1402,6 +1402,8 @@ render(session_t *ps, int x, int y, int dx, int dy, int wid, int hei,
static inline void
win_paint_win(session_t *ps, win *w, XserverRegion reg_paint,
const reg_data_t *pcache_reg) {
+ glx_mark(ps, w->id, true);
+
// Fetch Pixmap
if (!w->paint.pixmap && ps->has_name_pixmap) {
set_ignore_next(ps);
@@ -1564,6 +1566,8 @@ win_paint_win(session_t *ps, win *w, XserverRegion reg_paint,
#endif
}
}
+
+ glx_mark(ps, w->id, false);
}
/**
@@ -1812,6 +1816,7 @@ paint_all(session_t *ps, XserverRegion region, XserverRegion region_real, win *t
default:
assert(0);
}
+ glx_mark_frame(ps);
if (ps->o.vsync_aggressive)
vsync_wait(ps);
@@ -4050,7 +4055,7 @@ ev_handle(session_t *ps, XEvent *ev) {
* Print usage text and exit.
*/
static void
-usage(void) {
+usage(int ret) {
#define WARNING_DISABLED " (DISABLED AT COMPILE TIME)"
#define WARNING
const static char *usage_text =
@@ -4277,11 +4282,12 @@ usage(void) {
" Specify window ID to repaint in benchmark mode. If omitted or is 0,\n"
" the whole screen is repainted.\n"
;
- fputs(usage_text , stderr);
+ FILE *f = (ret ? stderr: stdout);
+ fputs(usage_text, f);
#undef WARNING
#undef WARNING_DISABLED
- exit(1);
+ exit(ret);
}
/**
@@ -4903,7 +4909,7 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
else if ('d' == o)
ps->o.display = mstrcpy(optarg);
else if ('?' == o || ':' == o)
- usage();
+ usage(1);
}
// Check for abundant positional arguments
@@ -4944,7 +4950,7 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
#define P_CASEBOOL(idx, option) case idx: ps->o.option = true; break
// Short options
case 'h':
- usage();
+ usage(0);
break;
case 'd':
break;
@@ -5118,7 +5124,7 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
break;
P_CASEBOOL(303, glx_use_gpushader4);
default:
- usage();
+ usage(1);
break;
#undef P_CASEBOOL
}