[cairo] [PATCH] pixman: fast path for nearest neighbour scaled compositing operations.

Siarhei Siamashka siarhei.siamashka at nokia.com
Wed May 27 19:05:55 PDT 2009


Hello,

This is more complete implementation of nearest neighbor scaling fastpath
functions. OVER 8888x8888, OVER 8888x0565, SRC 8888x8888,
SRC 8888x0565 and SRC 0565x0565 cases are supported.

It should be quite stable and have no bugs that I'm aware of. Scaling test
program is updated (it should catch most of the bugs and it should be hard to
break the code so that this breakage is undetected by test).

The immediate practical improvement is much snappier firefox browser
when using 'zoom-in' mode on pages with lots of pictures (extreme case -
scrolling over a single zoomed high resolution picture).

I also pushed these patches to a public git repository:
http://github.com/ssvb/pixman/commits/master/

Below is the log of the somewhat famous 'render_bench' test program:
http://www.rasterman.com/files/render_bench.tar.gz

It was run on beagleboard (ARM Coretex-A8 CPU, 16bpp desktop color depth),
pixman was compiled without ARMv6 and NEON optimizations. This report shows
that the performance of nearest neighbour scaling in pixman becomes roughly
the same as the performance of imlib2 (version 1.4.2) for offscreen rendering.
There is still a huge loss to imlib2 on 'smooth' scaling, but it is to be
expected until bilinear scaler in pixman gets optimized too. Nearest neighbour
scaler still can get additional sppedup from CPU specific optimizations and
more unrolling (for the architectures which have enough registers).

*** ROUND 1 ***
---------------------------------------------------------------
Test: Test Xrender doing non-scaled Over blends
Time: 7.834 sec.
---------------------------------------------------------------
Test: Test Xrender (offscreen) doing non-scaled Over blends
Time: 3.390 sec.
---------------------------------------------------------------
Test: Test Imlib2 doing non-scaled Over blends
Time: 2.590 sec.
*** ROUND 2 ***
---------------------------------------------------------------
Test: Test Xrender doing 1/2 scaled Over blends
Time: 2.290 sec.
---------------------------------------------------------------
Test: Test Xrender (offscreen) doing 1/2 scaled Over blends
Time: 1.207 sec.
---------------------------------------------------------------
Test: Test Imlib2 doing 1/2 scaled Over blends
Time: 1.095 sec.
*** ROUND 3 ***
---------------------------------------------------------------
Test: Test Xrender doing 2* smooth scaled Over blends
Time: 202.632 sec.
---------------------------------------------------------------
Test: Test Xrender (offscreen) doing 2* smooth scaled Over blends
Time: 159.812 sec.
---------------------------------------------------------------
Test: Test Imlib2 doing 2* smooth scaled Over blends
Time: 33.264 sec.
*** ROUND 4 ***
---------------------------------------------------------------
Test: Test Xrender doing 2* nearest scaled Over blends
Time: 31.020 sec.
---------------------------------------------------------------
Test: Test Xrender (offscreen) doing 2* nearest scaled Over blends
Time: 10.831 sec.
---------------------------------------------------------------
Test: Test Imlib2 doing 2* nearest scaled Over blends
Time: 11.980 sec.
*** ROUND 6 ***
---------------------------------------------------------------
Test: Test Xrender doing general nearest scaled Over blends
Time: 46.263 sec.
---------------------------------------------------------------
Test: Test Xrender (offscreen) doing general nearest scaled Over blends
Time: 16.492 sec.
---------------------------------------------------------------
Test: Test Imlib2 doing general nearest scaled Over blends
Time: 19.789 sec.
*** ROUND 7 ***
---------------------------------------------------------------
Test: Test Xrender doing general smooth scaled Over blends
Time: 436.816 sec.
---------------------------------------------------------------
Test: Test Xrender (offscreen) doing general smooth scaled Over blends
Time: 342.439 sec.
---------------------------------------------------------------
Test: Test Imlib2 doing general smooth scaled Over blends
Time: 113.186 sec.

-- 
Best regards,
Siarhei Siamashka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Scaling-test-updated-to-provide-better-coverage-for.patch
Type: text/x-diff
Size: 5815 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20090528/4fa5e652/attachment-0003.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Check-if-we-actually-have-source-clipping-set-for-im.patch
Type: text/x-diff
Size: 1820 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20090528/4fa5e652/attachment-0004.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Fastpath-for-nearest-neighbour-scaled-compositing-op.patch
Type: text/x-diff
Size: 35464 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20090528/4fa5e652/attachment-0005.patch 


More information about the cairo mailing list