[cairo-commit] 3 commits - src/cairo-xcb-surface.c src/cairo-xcb-surface-render.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Oct 13 04:47:48 PDT 2010


 src/cairo-xcb-surface-render.c |    5 +++--
 src/cairo-xcb-surface.c        |    3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit e6ce65fb82c2df09330f31fd9251fdf96f0cab50
Author: Uli Schlachter <psychon at znc.in>
Date:   Tue Oct 5 19:40:52 2010 +0200

    xcb: Correctly handle ARGB visuals
    
    We want surface->depth to end up as "32", so we have to invent an alpha mask.
    This mask is not used anyway (only its popcount), but still this should get a
    less ugly fix.
    
    This was found because "assert (reply->depth == surface->depth);" in
    _get_image() failed.
    
    Original-patch-by: Ross Alexander <Ross.Alexander at EU.NEC.COM>
    Signed-off-by: Uli Schlachter <psychon at znc.in>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index d852f50..656e589 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -1177,6 +1177,9 @@ cairo_xcb_surface_create (xcb_connection_t  *xcb_connection,
     image_masks.red_mask   = visual->red_mask;
     image_masks.green_mask = visual->green_mask;
     image_masks.blue_mask  = visual->blue_mask;
+    if (depth == 32) /* XXX visuals have no alpha! */
+	image_masks.alpha_mask =
+	    0xffffffff & ~(visual->red_mask | visual->green_mask | visual->blue_mask);
     if (depth > 16)
 	image_masks.bpp = 32;
     else if (depth > 8)
commit da62cc21da4f250850050d0ead947858fb804223
Author: Uli Schlachter <psychon at znc.in>
Date:   Tue Oct 12 21:59:14 2010 +0200

    _cairo_xcb_surface_picture: Check for fallback
    
    If a cairo surface's fallback member is set, the current content of that surface
    is in-memory and the X server has an outdated version of stuff. Our
    optimizations for doing in-server copies are wrong in this case and we should do
    stuff in cairo instead of the X server.
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index 40682c0..afc812e 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -1178,7 +1178,7 @@ _cairo_xcb_surface_picture (cairo_xcb_surface_t *target,
 	picture = NULL;
     }
 
-    if (source->type == CAIRO_SURFACE_TYPE_XCB)
+    if (source->type == CAIRO_SURFACE_TYPE_XCB && ((cairo_xcb_surface_t *) source)->fallback == NULL)
     {
 	if (source->backend->type == CAIRO_SURFACE_TYPE_XCB) {
 	    if (((cairo_xcb_surface_t *) source)->screen == target->screen) {
@@ -1224,7 +1224,7 @@ _cairo_xcb_surface_picture (cairo_xcb_surface_t *target,
 	}
     }
 #if CAIRO_HAS_XLIB_XCB_FUNCTIONS
-    else if (source->type == CAIRO_SURFACE_TYPE_XLIB)
+    else if (source->type == CAIRO_SURFACE_TYPE_XLIB && ((cairo_xlib_xcb_surface_t *) source)->xcb->fallback == NULL)
     {
 	if (source->backend->type == CAIRO_SURFACE_TYPE_XLIB) {
 	    if (((cairo_xlib_xcb_surface_t *) source)->xcb->screen == target->screen) {
commit 5a0f8f7320c916c86c4fd66a5aa8cb8545c00643
Author: Uli Schlachter <psychon at znc.in>
Date:   Tue Oct 12 21:56:46 2010 +0200

    _cairo_xcb_surface_ensure_picture: Check fallback
    
    When an XCB surface's fallback member is not NULL, we did some rendering that
    the X server couldn't do for us and thus did that internally in cairo instead.
    This means the X drawable's content is out of date and should not be used for
    drawing anything.
    
    This adds an assert which checks for that situation.
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index 2ce8c9e..40682c0 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -301,6 +301,7 @@ static void
 _cairo_xcb_surface_ensure_picture (cairo_xcb_surface_t *surface)
 {
     if (surface->picture == XCB_NONE) {
+	assert (surface->fallback == NULL);
 	surface->picture = _cairo_xcb_connection_get_xid (surface->connection);
 	_cairo_xcb_connection_render_create_picture (surface->connection,
 						     surface->picture,


More information about the cairo-commit mailing list