[cairo] [PATCH] Image scaling regression test script and 'fbCompositeSrcScaleNearest' bugfixes
sandmann at daimi.au.dk
Tue Mar 31 18:53:23 PDT 2009
> I'm currently working on porting performance optimizations from Xomap
> (X server used in Nokia internet tablets N800 and N810) into the latest
> version of pixman and now also have a permission to submit these patches
> directly upstream :)
Great! Upstream much appreciates this.
> Xomap has optimizations which include fastpath functions for nearest
> neighbour scaling with the support of SRC and OVER operations for
> NONE and NORMAL repeat in the case when no rotation is involved and
> only a single clipping rectangle is used. Also it has a set of ARMv6
> assembly optimizations (they partially overlap with the ARM optimizations
> that pixman also got recently, but still have some useful stuff).
Jeff also has some ARM optimizations here:
Is ARMv6 the version that got neon? ARM names always confuse me; is
there a cheat sheet somewhere that explains the difference between
names like ARM8, ARMv8 and Cortex A8?
> An attempt at developing such script to provide a solid testing base is
> attached. It's quite simple, but already helped to hunt down two bugs
> in 'fbCompositeSrcScaleNearest' function (patch is also attached).
> +#!/usr/bin/env ruby
I didn't really look at the code here, but I applied the patch
anyway. If there are test programs that people find useful, I'm
generally happy enough to add them to pixman/test. (I would be even
happier to add a real regression test suite of course ...)
> From bacba33cc4fe0e4dcd0dc5804b0f6e83367cfb4f Mon Sep 17 00:00:00 2001
> From: Siarhei Siamashka <siarhei.siamashka at nokia.com>
> Date: Tue, 31 Mar 2009 21:02:44 +0300
> Subject: [PATCH] fbCompositeSrcScaleNearest bugfixes
> 'fbCompositeSrcScaleNearest' function had a problem with alpha channel
> in the destination image. Also NORMAL repeat was broken (the optimized
> function can handle repeat operation itself and can be screwed up if
> 'pixman_walk_composite_region' tries to help it by splitting the work
> into handling multiple separate areas).
The srcRepeat = FALSE change looks correct and should give a good
speedup, but does it actually fix a *bug* or just a performance
If fbCompositeSrcScaleNearest() actually renders incorrectly when it
is given 1x1 rectangles, then that's a bug in its own right that we
can't work around by setting srcRepeat to FALSE.
The alpha change I don't understand. Note this line:
&& pSrc->bits.format == pDst->bits.format
down in the if statement; fbCompositeSrcScaleNearest() only gets
called when source and destination have the same format, so copying
pixels directly between them should be correct, and there should be no
need for masking in 0xff in the alpha channel.
More information about the cairo