Notes on testing, and: Re: [cairo] Pattern rewrite

Kristian Høgsberg krh at bitplanet.net
Wed Jan 26 21:44:26 PST 2005


Carl Worth wrote:
> On Tue, 25 Jan 2005 17:20:29 -0500, Kristian Høgsberg wrote:
> 
>>The overall idea of this rewrite is that we want to pass the source
>>pattern all the way down into the backends.
> 
> I've read over your description of this rework and it sounds quite
> good to me.

Sounds good.

> As we recently discussed, the embryonic test suite we have in cairo
> via "make check" does not yet test any patterns. To help you test
> this, I've now committed two new things to cairo/test that I have been
> using:

As discussed on IRC, I've added a new test case, 'coverage', designed to 
exercise the code paths I'm touching with this patch.  The test case 
draw 20 combinations of different patterns, drawing primitives and 
clip/no-clip.  All these tests only count as one test case, which isn't 
optimal, but with the current one-to-one mapping between binaries and 
test cases it's not easy to do better.  But even so, this test case has 
been really helpful, I've found 4 bugs in by patch so far.

I added a new test case, 'clip_twice', which tests that the clipping 
surface is updated properly when setting the clipping path twice.  This 
test case found another bug in my patch and a bug in imagediff.  The 
problem is that unpremultiplying alpha and then premultiplying alpha 
again can't preserve the color channel values due to the precision loss 
inherent in the premultiplied representation.  I.e. we map values from 
0-255 onto 0-alpha and then back to 0-255.  I'd suggest that we store 
the reference images with premultiplied alpha, which means that they 
won't be generally viewable, but I think that's the only way we can have 
a pixel-perfect test suite.  It should be pretty easy to also output a 
viewable PNG for visual inspection, but the imagediff should work on 
PNGs with premultiplied alpha.

...

>>Also, this breaks the XCB, glitz and Quartz backends.
> 
> Is this in reference just to this initial version of the patch? That
> is, were you planning on fixing these before committing, or will you
> need help.

I don't have either of these libraries/platforms readily available so I 
won't be able to compile or test my changes, and would appreciate any 
help from the authors of these backends.  I can try to adjust the code 
to the new backend interface, but I can't guarantee it will compile.

cheers,
Kristian



More information about the cairo mailing list