[cairo] default rendering engine

Andrew Johnson acjgenius at earthlink.net
Sat May 8 09:06:09 PDT 2004


I just checked this out. you were right. Its cairo in part. 

When I reset the same destination there is still no problem, but I was
doing this with gtk widgets, gtk No Window widgets, aka - all the
widgets in question were using the same X window, so once the cached
context was set all subsequent calls had no issue, but once I tried
making one of the widgets windowed, crash bang. 

Looking at the code cairo doesn't appear to have any code to handle
changing the destination like it should, it only allows setting it once.
So caching will only work in my controlled environment as stands. 

Sorry for the misleading info. :)

Andrew

On Mon, 2004-05-03 at 16:08, Bill Spitzak wrote:
> On Monday 03 May 2004 12:47 pm, Andrew Johnson wrote:
> > I have absolutely no such issues(using current CVS). I have recently
> > tested using a cache of 8 cairo contexts, which I use as needed and I am
> > constantly setting different drawables on them, sometimes the same one
> > sometimes not. And I am testing this within a constantly changing
> > environment and window resizes have yet to affect it.
> >
> > I would presume its not the setting of the target by itself but
> > something else you are performing on the canvas. In which case I would
> > definitely consider a bug.
> 
> Thanks for the info. I suspect now the problem is my Xserver:
> 
> name of display:    :0.0
> version number:    11.0
> vendor string:    Mandrake Linux (XFree86 4.3, patch level 23mdk)
> vendor release number:    40300000
> XFree86 version: 4.3.0
> 
> with the Nvidia driver.
> 
> For me, this simple change of the cairo-demo/X11/cairo-demo will crash the X 
> server immediatly when you resize the window:
> 
> --- cairo-demo.c        Mon May  3 11:17:32 2004
> +++ cairo-demo-new.c    Mon May  3 13:07:03 2004
> @@ -218,7 +218,7 @@
>  {
>  #define NUM_DASH 2
>      static double dash[NUM_DASH] = {SIZE/4.0, SIZE/4.0};
> -    cairo_t *ct;
> +    static cairo_t *ct = 0;
>  #ifndef CAIRO_HAS_XCB_SURFACE
>      Drawable drawable = win->win;
>  #else /* CAIRO_HAS_XCB_SURFACE */
> @@ -232,12 +232,14 @@
>      XCBClearArea(win->dpy, 0, win->win, 0, 0, 0, 0);
>  #endif /* CAIRO_HAS_XCB_SURFACE */
> 
> +    if (!ct) {
>      ct = cairo_create();
>  #ifndef CAIRO_HAS_XCB_SURFACE
>      cairo_set_target_drawable (ct, win->dpy, drawable);
>  #else /* CAIRO_HAS_XCB_SURFACE */
>      cairo_set_target_xcb (ct, win->dpy, drawable, win->visual, 0);
>  #endif /* CAIRO_HAS_XCB_SURFACE */
> +    }
>      cairo_set_rgb_color(ct, 1, 1, 1);
> 
>      cairo_save(ct);
> @@ -301,7 +303,7 @@
>         exit(0);
>      }
> 
> -    cairo_destroy(ct);
> +    //cairo_destroy(ct);
>  }
> 
>  #ifdef CAIRO_HAS_XCB_SURFACE





More information about the cairo mailing list