[cairo] default rendering engine

Bill Spitzak spitzak at d2.com
Mon May 3 13:08:39 PDT 2004


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

-- 
                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com




More information about the cairo mailing list