[cairo] Filling using a surface is not working

Mukund Sivaraman muks at banu.com
Fri Apr 10 04:05:34 PDT 2009

On Fri, Apr 10, 2009 at 11:13:57AM +0100, Mukund Sivaraman wrote:
> Hi all
> Can anyone spot the error in the following code? It creates 'pcontext'
> which is made to hold a tiling pattern, and then uses it to fill
> 'context' whose surface is a GtkDrawingArea. But 'pcontext' appears
> nowhere on 'context' with the following code:
>         cairo_t *context;
>         cairo_surface_t *surface;
>         cairo_t *pcontext;
>         context = gdk_cairo_create (GDK_DRAWABLE (window));
>         surface = cairo_surface_create_similar
>                 (cairo_get_group_target (context),
>                  CAIRO_CONTENT_COLOR_ALPHA, 4, 4);

sanooj helped me with this on IRC. It seems that the xlib surface seems
to be broken with regards pattern surfaces. Replacing the above with
cairo_image_surface_create() fixed things.

FYI, I'm running this on a stock fully updated Fedora 10 x86_64 distro:


(--) PCI:*(0 at 1:0:0) ATI Technologies Inc Radeon Mobility X1400 rev 0,
Mem @ 0xd8000000/134217728, 0xee100000/65536, I/O @ 0x00002000/256,

(II) Loading /usr/lib64/xorg/modules/drivers//radeon_drv.so
(II) Module radeon: vendor="X.Org Foundation"
        compiled for 1.5.3, module version = 6.10.0
        Module class: X.Org Video Driver
        ABI class: X.Org Video Driver, version 4.1


More information about the cairo mailing list