Add mask details to the output.
[Pekka: redo whitespace and print src,dst,mask x and y.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ben Avison <bavison@riscosopen.org>
Pixman supports negative strides, but up until now they haven't been
tested outside of stress-test. This commit adds testing of negative
strides to blitters-test, scaling-test, affine-test, rotate-test, and
composite-traps-test.
The affine-test, blitters-test, and scaling-test all have the ability
to print out the bytes of the destination image. Share this code by
moving it to utils.c.
At the same time make the code work correctly with negative strides.
The default has been 7-bit for a while now, and the quality
improvement with 8-bit precision is not enough to justify keeping the
code around as a compile-time option.
This function returns the name of the given format code, which is
useful for printing out debug information. The function is written as
a switch without a default value so that the compiler will warn if new
formats are added in the future. The fake formats used in the fast
path tables are also recognized.
The function is used in alpha_map.c, where it replaces an existing
format_name() function, and in blitters-test.c, affine-test.c, and
scaling-test.c.
This function returns the name of the given operator, which is useful
for printing out debug information. The function is done as a switch
without a default value so that the compiler will warn if new
operators are added in the future.
The function is used in affine-test.c, scaling-test.c, and
blitters-test.c.
After two fixed-point numbers are multiplied, the result is shifted
into place, but up until now pixman has simply discarded the low-order
bits instead of rounding to the closest number.
Fix that by adding 0x8000 (or 0x2 in one place) before shifting and
update the test checksums to match.
Update the CRC values based on what the general implementation
reports. This reveals a bug in the fast implementation:
% env PIXMAN_DISABLE="mmx sse2" ./test/scaling-test
pixman: Disabled mmx implementation
pixman: Disabled sse2 implementation
scaling test failed! (checksum=AA722B06, expected 03A23E0C)
vs.
% env PIXMAN_DISABLE="mmx sse2 fast" ./test/scaling-test
pixman: Disabled fast implementation
pixman: Disabled mmx implementation
pixman: Disabled sse2 implementation
scaling test passed (checksum=03A23E0C)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Macro BILINEAR_INTERPOLATION_BITS in pixman-private.h selects
the number of fractional bits used for bilinear interpolation.
scaling-test and affine-test have checksums for 4-bit, 7-bit
and 8-bit configurations.
All the tests are linked to libutil, hence it makes sence to always
include utils.h and reuse what it provides (config.h inclusion, access
to private pixman APIs, ARRAY_LENGTH, ...).
Green Hills Software MULTI compiler was producing a number
of warnings due to incorrect uses of int instead of the correct
corresponding pixman_*_t type.
Added a pair of macros which can help to detect corruption
of floating point registers after a function call. This may
happen if _mm_empty() call is forgotten in MMX/SSE2 fast
path code, or ARM NEON assembly optimized function
forgets to save/restore d8-d15 registers before use.
Negative scale factors are now also tested. A small additional
translate transform helps to stress the use of fractional
coordinates better.
Also the number of iterations to run by default increased in order
to compensate increased variety of operations to be tested.
Old X servers rely on out-of-bounds accesses when they are asked
to composite with a window as the source. They create a pixman image
pointing to some bogus position in memory, but then they set a clip
region to the position where the actual bits are.
Due to a bug in old versions of pixman, where it would not clip
against the image bounds when a clip region was set, this would
actually work.
The workaround added by this commit is to try and detect whether a
source drawable is actually a window without a client clip set. Such a
window will generally have a clip region that corresponds exactly to
the hierarchy clip in the server, whereas pixmaps will have a clip
region that is an exact match to the drawable.
When we detect such a window, we allow a fast path to run that would
normally be rejected due to the sources not completely subsuming the
composite region.
Fixed X servers should call the new function
pixman_disable_out_of_bounds_workaround() to disable the workaround.
This was reported in bug 22484.
The changes in pixman behavior justifying this are:
- New clipping rules
- Bug fixes in region code. In particular, when
pixman_region_init_rects() is called on these two boxes:
{ 2, 6, 7, 6 }
{ 4, 1, 6, 7 }
it now ignores the first one, which is empty and produces
{ 4, 1, 6, 7 }
Previously, it would produce:
{ 2, 1, 7, 7 }
for some reason.
Now scaling test should reliably detect problems in new scaling code.
Maximum image size reduced to improve performance (more tests can be
run per second) and also simplify detected errors analysis.
Now test provides better coverage for various image scaling
cases. Unused byte for x8r8g8b8 format is ignored. Running
the test program without any command line options provides
a PASS/FAIL verdict based on the precalculated crc32 value
for using pixman with all the fastpath functions disabled,
which should simplify testing for correcteness.
This test script can help in finding regressions in image scaling
fastpath implementations. It uses test program compiled with
and without fastpath code and can compare results of execution
for different pseudorandom compositing operations involving scaling.
Signed-off-by: Søren Sandmann Pedersen <sandmann@redhat.com>