summaryrefslogtreecommitdiffstats
path: root/compton.h
diff options
context:
space:
mode:
Diffstat (limited to 'compton.h')
-rw-r--r--compton.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/compton.h b/compton.h
index 0479b3d0a..49ffcb88f 100644
--- a/compton.h
+++ b/compton.h
@@ -176,7 +176,7 @@ paint_isvalid(session_t *ps, const paint_t *ppaint) {
return true;
}
/**
- * Bind texture in paint_t if we are using OpenGL backend.
+ * Bind texture in paint_t if we are using GLX backend.
*/
static inline bool
paint_bind_tex(session_t *ps, paint_t *ppaint, int wid, int hei, int depth) {
@@ -542,6 +542,20 @@ win_render(session_t *ps, win *w, int x, int y, int wid, int hei, double opacity
pict, (w ? w->paint.ptex: ps->root_tile_paint.ptex), reg_paint);
}
+static inline void
+set_tgt_clip(session_t *ps, XserverRegion reg) {
+ switch (ps->o.backend) {
+ case BKEND_XRENDER:
+ XFixesSetPictureClipRegion(ps->dpy, ps->tgt_buffer, 0, 0, reg);
+ break;
+#ifdef CONFIG_VSYNC_OPENGL
+ case BKEND_GLX:
+ glx_set_clip(ps, reg);
+ break;
+#endif
+ }
+}
+
static void
paint_all(session_t *ps, XserverRegion region, win *t);