[cairo] Pixel consistency? (testing)

Ian Britten britten at caris.com
Wed Aug 19 04:36:15 PDT 2009


Chris Wilson wrote:
> I've done a bit more work in this direction, and I'd like to know if
> this would be more useful to you than the script output.

Chris,
Many thanks for pursuing this!  I must confess that I'm only on the
(production) 1.8.x version of Cairo, and am not that familiar with the
new CairoScript stuff.  As well, until an official release is made
(1.9.0?  1.10.0?), I won't be in a position to use any of the newer
Cairo features, except maybe for some local evaluation.  As such,
my comments may not offer much...

> In
> http://cgit.freedesktop.org/~ickle/cairo/commit/?h=wip/stroke-to-path&id=af99ead4347ac39f920fb41b3b03f087e4c0fcef
> is a very simple XML surface that is merely a (hierarchical) sequence of
> backend operations:
> 
> %!CairoScript
> << /content //COLOR_ALPHA /width 48 /height 48 >> surface context
   [ snip ]
> becomes:
> 
> <surface content='COLOR_ALPHA' width='48' height='48'>
   [ snip ]

> The idea is that this is much easier to interpret than SVG (in
> particular with a view to state bisection, we should be able to operate
> on each operation independently) and has no impedance-mismatch - i.e. it
> should be able to express natively everything Cairo can do. I'm writing
> it so that I can track down a regression, but it may prove useful in
> your test suite.

Could you explain how you'd utilize either format for unit testing?

My first assumption would be to simply do a textual line-by-line diff
of the outputs.  However, it seems that for either format, any
formatting changes by Cairo between versions would trigger failures
(Analogous to the failures I see when just comparing image pixels).

Or are there higher-level tools that can utilize these formats and
do some sort of semantic comparison on them?


Irregardless, I still have an awkward reality:  If I say that my
image-production stuff is 'done and tested', but I'm not actually
producing *images*, I'm sure some eyebrows would be raised.  I
suspect that whatever other testing I may do, I _still_ need to
produce+compare images, and will thus be susceptible pixel
differences in the images triggering failures...

Many thanks for all the info/suggestions though!  I'll go ponder
over what you/Joonas/etc said for a bit...
Ian


More information about the cairo mailing list