[cairo] [PATCH v3 0/3] test: Add test for image downscaling

Bryce W. Harrington b.harrington at samsung.com
Wed Sep 11 10:33:34 PDT 2013


On Wed, Sep 11, 2013 at 02:15:52PM +0200, Uli Schlachter wrote:
> Hi (and sorry for being annoying),
> 
> On 10.09.2013 19:06, Bryce W. Harrington wrote:
> > These are tests for the recently integrated downscaling support.  This
> > patchset includes some simple tests for three scaling factors, for each
> > of the filter options.
> 
> I am not sure how this happened, but you sent out the wrong patches. The ones
> you sent are already in master...

Sorry, seems to be my crappy git skills at fault.

> > This patchset is also posted to the 'downscaling' branch in my fdo git
> > repo:
> > 
> >   http://cgit.freedesktop.org/~bryce/cairo/
> [...]
> 
> ...thus I switched to pulling from this branch.
> 
> Then I took another look at this and sadly I found another thing to complain
> about. Looking at the code, I noticed this:
> 
> (test/pixman-downscale.c, line 56ff)
> >     cairo_save (cr);
> >     cairo_pattern_set_filter (cairo_get_source (cr), filter);
> >     cairo_scale (cr, scale, scale);
> >     cairo_set_source_surface (cr, image, 0, 0);
> >     cairo_paint (cr);
> >     cairo_restore (cr);
> 
> You first set the filter on the source and then call cairo_set_source_surface(),
> installing a new source. If I move the call to cairo_pattern_set_filter() after
> the cairo_set_source_surface() call, the resulting PNGs for "fast" and "nearest"
> change a bit:
> P.S.: Sadly it doesn't look like this fixes any test failures.

Thanks for noticing this, didn't realize they were out of order.

This change does actually fix several tests.  It changes behavior for
the 95 pixel case which is why as many new failures show up as fixes.
But we're just using pixman's output as 'truth' here, so have to update
the 95 pixel reference images for the changed behavior.  Once that's
done, the test pass count improves a good bit.

> Could you fix the test? Thanks!
> (And feel free to ping me (psychon) on IRC when you have a new branch up, I
> think the mailing list won't care much and I am stuck with having to merge this
> anyway)

Done,
Bryce
 
> Cheers,
> Uli
> 


More information about the cairo mailing list