[cairo] subimage_copy.c phylosophy

Frédéric Plourde frederic.plourde at polymtl.ca
Fri Mar 28 15:41:43 PDT 2008

Hi everybody !

   About that only-2X2-subimage-gets-copied issue in subimage_copy.c, it was first done that way more than intentionally, as a nice comment tells us in subimage_copy.c... 

It goes like this :

/* This case exposes a performance bug found by Christopher "Monty"
 * Montgomery in that copying a tiny portion of an image surface to an
 * X surface causes the entire image surface to be copied to an
 * intermediate surface.
 * If the performance bug is fixed, then the time this test takes
 * should be independent of the source and destination surface sizes.

Correct me if I'm wrong, but this bug with X surfaces has been solved on Linux platform since then ?? right ?
If yes, I suggest we just change the subimage_copy perf test to something more appropriate, something that would give us a sense of copy performances as a function of image size.

I would propose, as Mike said, to change line #40 of subimage_copy.c from :
cairo_rectangle (cr, 2, 2, 4, 4);  
cairo_rectangle (cr, (width/4), (height/4), 3*(width/4), 3*(height/4) );

what do you think ?


On Fri, Mar 28, 2008 at 10:45 AM, Frédéric Plourde
<frederic.plourde at polymtl.ca> wrote:

> >  cairo_rectangle (cr, 2, 2, 4, 4);
> >  to
> >  cairo_rectangle (cr, 0, 0, width, height);

Would it make more sense to do something like

cairo_rectangle (cr, width / 4, height / 4, width / 2, height / 2);

so that it's still a subimage, but also scales with the size of the
surface?  Not sure how important the "sub" part of that test is, of
course, so this could be a very silly suggestion!


More information about the cairo mailing list