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

Chris Wilson ickle at kemper.freedesktop.org
Sun Sep 28 10:00:22 PDT 2008


 AUTHORS                  |    1 +
 src/cairo-xcb-surface.c  |    4 +++-
 src/cairo-xlib-surface.c |    4 +++-
 3 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit d52b55cb1b2a4e9b5fd8dd12592a227f8f6a93fc
Author: Karl Tomlinson <karlt+ at karlt.net>
Date:   Sun Sep 28 17:51:23 2008 +0100

    [xlib] _surfaces_compatible() can return true for different picture formats
    
    _surfaces_compatible in cairo-xlib-surface returns true for surfaces with
    different xrender_format when each has the same depth and no (NULL)
    visual.
    
    Common picture formats will not have the same depth, but
    it is possible to create a surface with a non-standard xrender_format
    having the same depth as another xrender_format with
    cairo_xlib_surface_create_with_xrender_format.
    
    Both cairo_xlib_surface_create_with_xrender_format and
    _cairo_xlib_surface_create_similar_with_format create surfaces with no
    visual.
    
    The same issue exists in the xcb backend.
    
    Fixes bug https://bugs.freedesktop.org/show_bug.cgi?id=16564.

diff --git a/AUTHORS b/AUTHORS
index d9b7721..7ab3cfb 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -83,6 +83,7 @@ Travis Spencer <tspencer at cs.pdx.edu> XCB backend fix
 Bill Spitzak <spitzak at d2.com> Build fix to find Xrender.h without xrender.pc
 Zhe Su <james.su at gmail.com> Add support for fontconfig's embeddedbitmap option
 Owen Taylor <otaylor at redhat.com> Font rewrite, documentation, win32 backend
+Karl Tomlinson <karlt+ at karlt.net>
 Alp Toker <alp at atoker.com> Fix several code/comment typos
 Malcolm Tredinnick <malcolm at commsecure.com.au> Documentation fixes
 David Turner <david at freetype.org> Optimize gradient calculations
diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index 7a84007..fc72604 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -889,7 +889,9 @@ _surfaces_compatible (cairo_xcb_surface_t *dst,
 	return FALSE;
 
     /* if Render is supported, match picture formats */
-    if (src->xrender_format.id != XCB_NONE && src->xrender_format.id == dst->xrender_format.id)
+    if (src->xrender_format.id != dst->xrender_format.id)
+	return FALSE;
+    else if (src->xrender_format.id != XCB_NONE)
 	return TRUE;
 
     /* Without Render, match visuals instead */
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 6012cfe..3e126b7 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1416,7 +1416,9 @@ _surfaces_compatible (cairo_xlib_surface_t *dst,
 	return FALSE;
 
     /* if Render is supported, match picture formats */
-    if (src->xrender_format != NULL && src->xrender_format == dst->xrender_format)
+    if (src->xrender_format != dst->xrender_format)
+	return FALSE;
+    else if (src->xrender_format != NULL)
 	return TRUE;
 
     /* Without Render, match visuals instead */


More information about the cairo-commit mailing list