[cairo] Bug in _cairo_xlib_surface_create_similar

Robert O'Callahan rocallahan at novell.com
Thu May 18 13:26:08 PDT 2006


On Thu, 2006-05-18 at 07:39 -0700, Carl Worth wrote:
> I haven't looked closely at the patch yet, but it did receive this
> comment from Owen the first time around:
> 
> > Well, actually one opinion on the patch, from a quick glance.
> > It's very much wrong to create an image surface when you can't
> > create a surface with matching depth... let the X server decide
> > it can't accelerate that.
> 
> And that seems a very legitimate complaint. Do you have any response
> (in an updated patch or further justification)?

My response was (and is) that the patch doesn't do that. If we can't
match the visual and depth, we fall back to
_cairo_xlib_surface_create_similar_with_format, i.e. the existing
behaviour.

Owen's comment was probably based on this comment:
+    /* Try to create a surface with the same visual and depth as the
+       existing surface.
+       Don't bother if the X server doesn't have COMPOSITE, because we
prefer
+       to just fall back to image surfaces in that case. */

where "fall back" refers to the existing fallback-to-image in
_cairo_xlib_surface_create_similar_with_format, not in this function.

Rob



More information about the cairo mailing list