[cairo] cairo_xlib_surface_create

Chris Wilson chris at chris-wilson.co.uk
Mon Jul 20 11:10:54 PDT 2009


On Mon, 2009-07-20 at 10:50 -0700, Charles سمير Doutriaux wrote:
> the following command
> 
>          surface = cairo_xlib_surface_create(display,
> 						      drawable,
> 						      visual,
> 						      x,
> 						      y);
> 
> now returns:
> 
> invalid value for an input Visual*
> 
> I checked my visual seems ok and is TrueColor

INVALID_VISUAL should only be raised if the visual does not belong to
the display. Two checks are performed on the visual during
cairo_xlib_surface_create(). The first iterates over the visuals
attached to the display to find to which screen the visual belongs, and
then a second iteration to determine the visual's color depth. If either
search does not find the visual attached to the display, INVALID_VISUAL
is returned.

Attaching gdb and setting a breakpoint on _cairo_error() will tell you
the exact cause for the error. But from a read of the source, cairo
looks to be acting quite sanely.

Hope this helps.
-ickle



More information about the cairo mailing list