[cairo] Very slow performance

TOKUNAGA Hiroyuki tkng at xem.jp
Sat Dec 25 14:11:19 PST 2004


Oops, previous patch was imcomplete. This attached patch will work.


Regards,

-- 
TOKUNAGA Hiroyuki
tkng at xem.jp
http://kodou.net/


On Sun, 26 Dec 2004 04:58:22 +0900
TOKUNAGA Hiroyuki <tkng at xem.jp> wrote:

> On Thu, 23 Dec 2004 13:46:13 -0500
> Carl Worth <cworth at cworth.org> wrote:
> 
> > On Thu, 23 Dec 2004 12:54:22 -0500, Chris wrote:
> > > Cairo render:
> > > http://www.functionalfuture.com/radical/centi_test.png
> > > 
> > > It seems like it draws everything OK.  At least for the stuff you
> > > can see.  However, the layering/ordering is not correct and some
> > > things are hidden that shouldn't be.
> > 
> > Oh, that is broken.
> > 
> > I had actually viewed it using xsvg and there cairo renders
> > everything just fine.\
> > 
> > Just checked with svg2png and I get results as above.
> > 
> > Thanks for finding this bug. I'll look into it.
> 
> It seems libsvg-cairo's bug. Some elements didn't be drawn, because
> viewport_width was restricted to 450. Attached patch will fix the bug,
> but I'm not confident in this patch is really correct way...

-------------- next part --------------
Index: svg_cairo.c
===================================================================
RCS file: /cvs/cairo/libsvg-cairo/src/svg_cairo.c,v
retrieving revision 1.29
diff -u -r1.29 svg_cairo.c
--- svg_cairo.c	2 Aug 2004 20:16:37 -0000	1.29
+++ svg_cairo.c	25 Dec 2004 22:08:29 -0000
@@ -374,10 +374,11 @@
     cairo_save (svg_cairo->cr);
 
     if (opacity != 1.0) {
+      printf("v%d\n",svg_cairo->state->viewport_width);
 	svg_cairo->state->child_surface = cairo_surface_create_similar (cairo_current_target_surface (svg_cairo->cr),
 							    CAIRO_FORMAT_ARGB32,
-							    svg_cairo->viewport_width,
-							    svg_cairo->viewport_height);
+							    svg_cairo->state->viewport_width,
+							    svg_cairo->state->viewport_height);
 	cairo_set_target_surface (svg_cairo->cr, svg_cairo->state->child_surface);
     }
 
@@ -431,7 +432,7 @@
 	cairo_default_matrix (svg_cairo->cr);
 	cairo_set_alpha (svg_cairo->cr, opacity);
 	cairo_show_surface (svg_cairo->cr, svg_cairo->state->child_surface,
-		       svg_cairo->viewport_width, svg_cairo->viewport_height);
+		       svg_cairo->state->viewport_width, svg_cairo->state->viewport_height);
 	cairo_restore (svg_cairo->cr);
 	cairo_surface_destroy (svg_cairo->state->child_surface);
 	svg_cairo->state->child_surface = NULL;


More information about the cairo mailing list