[cairo-commit] src/cairo-xlib-surface.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Jun 13 15:59:09 PDT 2007


 src/cairo-xlib-surface.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletion(-)

New commits:
diff-tree 0c5d28a4e5ce5e4dd72c0f416ce5e960e92b808b (from 817d4b0c9a354526389290c6d5a7662713d67cd8)
Author: Ryan Lortie <desrt at desrt.ca>
Date:   Wed Jun 13 18:59:22 2007 -0400

    [xlib] Create source xrender Picture with IncludeInferiors
    
    When an xlib surface is used as the source of a draw operation this
    will cause the contents of child windows to be included in the source
    data.  The semantics of drawing to xlib surfaces are unchanged (ie:
    draws are still clipped by child windows overlapping the destination
    window).

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index db5c155..cbd75ad 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -683,10 +683,18 @@ static void
 _cairo_xlib_surface_ensure_src_picture (cairo_xlib_surface_t    *surface)
 {
     if (!surface->src_picture)
+    {
+	XRenderPictureAttributes pa;
+	int mask = 0;
+
+	pa.subwindow_mode = IncludeInferiors;
+	mask |= CPSubwindowMode;
+
 	surface->src_picture = XRenderCreatePicture (surface->dpy,
 						     surface->drawable,
 						     surface->xrender_format,
-						     0, NULL);
+						     mask, &pa);
+    }
 }
 
 static void
@@ -2074,6 +2082,11 @@ _cairo_xlib_screen_from_visual (Display 
  * cairo_xlib_surface_set_size must be called whenever the size of the
  * window changes.
  *
+ * When @drawable is a Window containing child windows then drawing to
+ * the created surface will be clipped by those child windows.  When
+ * the created surface is used as a source, the contents of the
+ * children will be included.
+ *
  * Return value: the newly created surface
  **/
 cairo_surface_t *


More information about the cairo-commit mailing list