summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-03-15 01:59:07 -0700
committerVito Caputo <vcaputo@gnugeneration.com>2017-03-15 02:04:03 -0700
commit5bb2a77b7ef357975346b0380471aedbd775d164 (patch)
treed04aea3ae29ab73640418aa96c9aaeb92de95a32
parentbc04055653fe64c4e8e109beedf96dd608007a3b (diff)
overlays: paramize vwm_overlay_render() Render op
In vwm we were always doing a transparent overlay to preserve underlying window visibility. With vmon this is undesirable and we just want to copy the currently cached composited contents to the window, which is also substantially less costly to perform. Parameterize the operation so vwm and vmon can specify what's appropriate.
-rw-r--r--src/composite.c2
-rw-r--r--src/overlays.c4
-rw-r--r--src/overlays.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/composite.c b/src/composite.c
index a8c0f5d..270174e 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -282,7 +282,7 @@ void vwm_composite_paint_all(vwm_t *vwm)
if (xwin->overlay) {
/* draw the monitoring overlay atop the window, note we stay within the window borders here. */
- vwm_overlay_render(vwm->overlays, xwin->overlay, root_buffer,
+ vwm_overlay_render(vwm->overlays, xwin->overlay, PictOpOver, root_buffer,
xwin->attrs.x + xwin->attrs.border_width,
xwin->attrs.y + xwin->attrs.border_width,
xwin->attrs.width,
diff --git a/src/overlays.c b/src/overlays.c
index 15f351c..18c188b 100644
--- a/src/overlays.c
+++ b/src/overlays.c
@@ -1067,7 +1067,7 @@ void vwm_overlay_compose(vwm_overlays_t *overlays, vwm_overlay_t *overlay, Xserv
/* render the overlay into a picture at the specified coordinates and dimensions */
-void vwm_overlay_render(vwm_overlays_t *overlays, vwm_overlay_t *overlay, Picture dest, int x, int y, int width, int height)
+void vwm_overlay_render(vwm_overlays_t *overlays, vwm_overlay_t *overlay, int op, Picture dest, int x, int y, int width, int height)
{
vwm_xserver_t *xserver = overlays->xserver;
@@ -1075,7 +1075,7 @@ void vwm_overlay_render(vwm_overlays_t *overlays, vwm_overlay_t *overlay, Pictur
return;
/* draw the monitoring overlay atop dest, note we stay within the window borders here. */
- XRenderComposite(xserver->display, PictOpOver, overlay->picture, None, dest,
+ XRenderComposite(xserver->display, op, overlay->picture, None, dest,
0, 0, 0, 0, /* src x,y, maxk x, y */
x, /* dst x */
y, /* dst y */
diff --git a/src/overlays.h b/src/overlays.h
index 0c00101..0e9864c 100644
--- a/src/overlays.h
+++ b/src/overlays.h
@@ -20,6 +20,6 @@ void vwm_overlay_destroy(vwm_overlays_t *overlays, vwm_overlay_t *overlay);
void vwm_overlay_reset_snowflakes(vwm_overlays_t *overlays, vwm_overlay_t *overlay);
int vwm_overlay_set_visible_size(vwm_overlays_t *overlays, vwm_overlay_t *overlay, int width, int height);
void vwm_overlay_compose(vwm_overlays_t *overlays, vwm_overlay_t *overlay, XserverRegion *res_damaged_region);
-void vwm_overlay_render(vwm_overlays_t *overlays, vwm_overlay_t *overlay, Picture dest, int x, int y, int width, int height);
+void vwm_overlay_render(vwm_overlays_t *overlays, vwm_overlay_t *overlay, int op, Picture dest, int x, int y, int width, int height);
#endif
© All Rights Reserved