[poppler] Re: poppler profiling on geode with cairo backend

Jeff Muizelaar jeff at infidigm.net
Sat Nov 11 21:34:37 PST 2006


On Thu, Nov 09, 2006 at 12:42:31AM -0800, Carl Worth wrote:
> On Wed, 8 Nov 2006 21:51:36 -0500, Jeff Muizelaar wrote:
> > So I had a look at why pixman_compositeGeneral is being hit during text
> > rendering. It looks like this gets called for text when the document is
> > being rendered at weird scaling factors.
> 
> The short answer is that any time compositeGeneral is called there's a
> bug somewhere. (That function is so slow, we know we never want to use
> it).
> 

I have looked further into developing a small test case for hitting
composteGeneral. The code at the end of this email calls
compositeGeneral in both box_clip() and tri_clip(). I haven't looked
into why this is happening at all. I also haven't written the tests up
as performance tests because they didn't really seem that interesting...

On a slightly related note, to investigate this problem I made a library
that wraps all of the calls to cairo functions and logs them to stdout.
usage is something like the following:

$ LD_PRELOAD=libcairowrap.so ./clip
cairo_image_surface_create(0, 100, 100)
cairo_create(0x80537b0)
cairo_move_to(0x8053898, 50, 50)
cairo_line_to(0x8053898, 50, 90)
cairo_line_to(0x8053898, 90, 90)
cairo_close_path(0x8053898)
cairo_clip(0x8053898)
...

If anyone is interested in such a thing I'd happily share it. The tool
that actually generates the wrapping library is way to ugly/hacky at the
moment, so I'd like to clean it up substantially before releasing it.

------------ clip.c --------------------
#include <cairo.h>

void box_clip(cairo_surface_t *s)
{
    cairo_t *cr = cairo_create(s);
    cairo_scale(cr, 1.1, 1.1);
    cairo_move_to(cr, 55, 55);
    cairo_line_to(cr, 90, 55);
    cairo_line_to(cr, 90, 90);
    cairo_line_to(cr, 90, 55);
    cairo_close_path(cr);
    cairo_clip(cr);
}

void tri_clip(cairo_surface_t *s)
{
    cairo_t *cr = cairo_create(s);
    cairo_move_to(cr, 50, 50);
    cairo_line_to(cr, 50, 90);
    cairo_line_to(cr, 90, 90);
    cairo_close_path(cr);
    cairo_clip(cr);
}

int main()
{
    cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 100, 100);
    box_clip(s);
    tri_clip(s);
    return 0;
}

------------ Makefile ------------------

CFLAGS=`pkg-config --cflags cairo`
LDFLAGS=`pkg-config --libs cairo`
clip:




More information about the poppler mailing list