[cairo] Performance problems in evince with ATI video cards

Vladimir Vukicevic vladimir at pobox.com
Fri Aug 10 12:52:05 PDT 2007


Carlos Garcia Campos wrote:
> Hi all, 
> 
> we have recently ported evince view to cairo, since poppler renders
> pages into a cairo surface, we avoid conversions from
> cairo_image_surface to GdkPixbuf by directly using the cairo_surface to
> paint the page in the evince view. However, since such port to cairo, we
> have received some complaints about the slowness of evince and the high
> cpu usage. It seems that the problem is only reproducible with ATI video
> cards (although, at least, one nvidia user has reported the bug too). 
> 
> The problem has been reported here:
> 
> http://bugzilla.gnome.org/show_bug.cgi?id=453123
> 
> and it seems to be related to this one:
> 
> http://bugs.freedesktop.org/show_bug.cgi?id=4320
> 
> The problem is not reproducible for me and I even don't know where the
> problem actually is (cairo, xorg, ati driver, evince, ...), so it's
> almost impossible to me fixing it. 
> 
> FWIW in evince I'm doing something like this:
> 
> cr = gdk_cairo_create (view->layout.bin_window);
> cairo_translate (cr, overlap.x, overlap.y);
> cairo_surface_set_device_offset (page_surface,                                                                       
>                                                  overlap.x - real_page_area.x,                                                       
>                                                  overlap.y - real_page_area.y);
> cairo_set_source_surface (cr, page_surface, 0, 0);                                                                   
> cairo_paint (cr);

What type of surface is page_surface?

If you're drawing to the display, you may want to try creating it as an 
image surface and see how that goes.  But yes, as Jeff said, profiling 
is your best bet.  (Also, setting a device offset before you draw is odd 
-- you really just want to translate to the right place and draw a 
rectangle that you fill, though that shouldn't be affecting performance.)

     - Vlad


More information about the cairo mailing list