Commit Graph

1850 Commits

Author SHA1 Message Date
Rolland Dudemaine
b61ec0a686 Correct the initialization of 'max_vx'
http://lists.freedesktop.org/archives/pixman/2011-January/000937.html
2011-01-25 14:55:24 +02:00
Rolland Dudemaine
e8a1b1c4e5 test: Fix for mismatched 'fence_malloc' prototype/implementation
Solves compilation problem when 'mprotect' is not available. For
example, when using Green Hills Software MULTI compiler or mingw:
http://lists.freedesktop.org/archives/pixman/2011-January/000939.html
2011-01-25 14:34:56 +02:00
Siarhei Siamashka
a8e4677ecc The code in 'bitmap_addrect' already assumes non-null 'reg->data'
So the check of 'reg->data' pointer can be safely removed.
2011-01-20 02:14:07 +02:00
Cyril Brulebois
8aeb637bb5 Upload to experimental. 2011-01-19 20:31:42 +01:00
Cyril Brulebois
461dacfb5e Update debian/copyright from upstream's COPYING. 2011-01-19 20:25:41 +01:00
Cyril Brulebois
e581626827 Bump changelogs. 2011-01-19 20:24:49 +01:00
Cyril Brulebois
f5216c99bc Merge branch 'upstream-experimental' into debian-experimental 2011-01-19 20:23:47 +01:00
Søren Sandmann Pedersen
a6a04c07c3 Post-release version bump to 0.21.5 2011-01-19 07:47:52 -05:00
Søren Sandmann Pedersen
4e56cec564 Pre-release version bump to 0.21.4 2011-01-19 07:38:24 -05:00
Søren Sandmann Pedersen
1d7195dd6c Fix dangling-pointer bug in bits_image_fetch_bilinear_no_repeat_8888().
The mask_bits variable is only declared in a limited scope, so the
pointer to it becomes invalid instantly. Somehow this didn't actually
trigger any bugs, but Brent Fulgham reported that Bounds Checker was
complaining about it.

Fix the bug by moving mask_bits to the function scope.
2011-01-19 07:22:42 -05:00
Andrea Canciani
2ac4ae1ae2 Add a test for radial gradients
radial-test is a port of the radial-gradient test from the cairo test
suite. It has been modified so that some pixels have 0 in both the a
and b coefficients of the quadratic equation solved by the rasterizer,
to expose a division by zero in the original implementation.
2011-01-19 13:17:03 +01:00
Søren Sandmann Pedersen
7f4eabbeec Fix destination fetching
When fetching from destinations, we need to ignore transformations,
repeat and filtering. Currently we don't ignore them, which means all
kinds of bad things can happen.

This bug fixes this problem by directly calling the scanline fetchers
for destinations instead of going through the full
get_scanline_32/64().
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
9489c2e04a Turn on testing for destination transformation 2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
fffeda703e Skip fetching pixels when possible
Add two new iterator flags, ITER_IGNORE_ALPHA and ITER_IGNORE_RGB that
are set when the alpha and rgb values are not needed. If both are set,
then we can skip fetching entirely and just use
_pixman_iter_get_scanline_noop.
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
3e635d6491 Add direct-write optimization back
Introduce a new ITER_LOCALIZED_ALPHA flag that indicates that the
alpha value computed is used only for the alpha channel of the output;
it doesn't affect the RGB channels.

Then in pixman-bits-image.c, if a destination is either a8r8g8b8 or
x8r8g8b8 with localized alpha, the iterator will return a pointer
directly into the image.
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
0f1a5c4a27 Get rid of the classify methods
They are not used anymore, and the linear gradient is now doing the
optimization in a different way.
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
b66cabb884 Linear: Optimize for horizontal gradients
If the gradient is horizontal, we can reuse the same scanline over and
over. Add support for this optimization to
_pixman_linear_gradient_iter_init().
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
cf14189c69 Consolidate the various get_scanline_32() into get_scanline_narrow()
The separate get_scanline_32() functions in solid, linear, radial and
conical images are no longer necessary because all access to these
images now go through iterators.
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
0a6360a7ee Allow NULL property_changed function
Initialize the field to NULL, and then delete the empty functions from
the solid, linear, radial, and conical images.
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
34b5633105 Move get_scanline_32/64 to the bits part of the image struct
At this point these functions are basically a cache that the bits
image uses for its fetchers, so they can be moved to the bits image.

With the scanline getters only being initialized in the bits image,
the _pixman_image_get_scanline_generic_64 can be moved to
pixman-bits-image.c. That gets rid of the final user of
_pixman_image_get_scanline_32/64, so these can be deleted.
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
d6b13f99b4 Use an iterator in pixman_image_get_solid()
This is a step towards getting rid of the
_pixman_image_get_scanline_32/64() functions.
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
51a5e949f3 Virtualize iterator initialization
Make src_iter_init() and dest_iter_init() virtual methods in the
implementation struct. This allows individual implementations to plug
in their own CPU specific scanline fetchers.
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
6503c6edcc Move iterator initialization to the respective image files
Instead of calling _pixman_image_get_scanline_32/64(), move the
iterator initialization into the respecive image implementations and
call the scanline generators directly.
2011-01-18 12:42:26 -05:00
Søren Sandmann Pedersen
23c6e1d2c0 Eliminate the _pixman_image_store_scanline_32/64 functions
They were only called from next_line_write_narrow/wide, so they could
simply be absorbed into those functions.
2011-01-18 12:42:25 -05:00
Søren Sandmann Pedersen
b2c9eaa502 Move initialization of iterators for bits images to pixman-bits-image.c
pixman_iter_t is now defined in pixman-private.h, and iterators for
bits images are being initialized in pixman-bits-image.c
2011-01-18 12:42:25 -05:00
Søren Sandmann Pedersen
15b1645c7b Add iterators in the general implementation
We add a new structure called a pixman_iter_t that encapsulates the
information required to read scanlines from an image. It contains two
functions, get_scanline() and write_back(). The get_scanline()
function will generate pixels for the current scanline. For iterators
for source images, it will also advance to the next scanline. The
write_back() function is only called for destination images. Its
function is to write back the modified pixels to the image and then
advance to the next scanline.

When an iterator is initialized, it is passed this information:

   - The image to iterate

   - The rectangle to be iterated

   - A buffer that the iterator may (but is not required to) use. This
     buffer is guaranteed to have space for at least width pixels.

   - A flag indicating whether a8r8g8b8 or a16r16g16b16 pixels should
     be fetched

There are a number of (eventual) benefits to the iterators:

   - The initialization of the iterator can be virtualized such that
     implementations can plug in their own CPU specific get_scanline()
     and write_back() functions.

   - If an image is horizontal, it can simply plug in an appropriate
     get_scanline(). This way we can get rid of the annoying
     classify() virtual function.

   - In general, iterators can remember what they did on the last
     scanline, so for example a REPEAT_NONE image might reuse the same
     data for all the empty scanlines generated by the zero-extension.

   - More detailed information can be passed to iterator, allowing
     more specialized fetchers to be used.

   - We can fix the bug where destination filters and transformations
     are not currently being ignored as they should be.

However, this initial implementation is not optimized at all. We lose
several existing optimizations:

   - The ability to composite directly in the destination
   - The ability to only fetch one scanline for horizontal images
   - The ability to avoid fetching the src and mask for the CLEAR
     operator

Later patches will re-introduce these optimizations.
2011-01-18 12:42:25 -05:00
Siarhei Siamashka
255d624e50 ARM: do /proc/self/auxv based cpu features detection only in linux
This method is linux specific, but earlier it was tried for any platform
that did not have _MSC_VER macro defined.
2011-01-16 23:40:38 +02:00
Siarhei Siamashka
2bbd553bd2 A new configure option --enable-static-testprogs
This option can be used for building fully static binaries of the test
programs so that they can be easily run using qemu-user. With binfmt-misc
configured, 'make check' works fine for crosscompiled pixman builds.
2011-01-16 23:40:34 +02:00
Siarhei Siamashka
55bbccf84e Make 'fast_composite_scaled_nearest_*' less suspicious
Taking address of a variable and then using it as an array looks suspicious
to static code analyzers. So change it into an array with 1 element to make
them happy. Both old and new variants of this code are correct because 'vx'
and 'unit_x' arguments are set to 0 and it means that the called scanline
function can only access a single element of 'zero' buffer.
2011-01-16 22:32:33 +02:00
Siarhei Siamashka
ae70b38d40 Bugfix for a corner case in 'pixman_transform_is_inverse'
When 'pixman_transform_multiply' fails, the result of multiplication just
could not have been identity matrix (one of the values in the resulting
matrix can't be represented as 16.16 fixed point value). So it is safe
to return FALSE.
2011-01-16 22:32:02 +02:00
Siarhei Siamashka
ab3809f4da Workaround for a preprocessor issue in old Sun Studio
Patch from Peter O'Gorman with some modifications

https://bugs.freedesktop.org//show_bug.cgi?id=32764
2011-01-16 20:48:39 +02:00
Siarhei Siamashka
f5c0a60ac8 Fix for "syntax error: empty declaration" Solaris Studio warnings 2011-01-16 20:48:13 +02:00
Siarhei Siamashka
c71e24c9fc Revert "Fix "syntax error: empty declaration" warnings."
This reverts commit b924bb1f81.

There is a better fix for these Solaris Studio warnings.
2011-01-16 20:47:56 +02:00
Andrea Canciani
29439bd772 Improve handling of tangent circles
When b is 0, avoid the division by zero and just return transparent
black.

When the solution t would have an invalid radius (negative or outside
[0,1] for none-extended gradients), return transparent black.
2011-01-12 22:04:33 +01:00
Søren Sandmann Pedersen
a484a9c49c sse2: Skip src pixels that are zero in sse2_composite_over_8888_n_8888()
This is a big speed-up in the SVG helicopter game:

   http://ie.microsoft.com/testdrive/Performance/Helicopter/Default.xhtml

when rendered by Firefox 4 since it is compositing big images
consisting almost entirely of zeros.
2010-12-20 19:37:11 -05:00
Søren Sandmann Pedersen
2610323545 Fix divide-by-zero in set_lum().
When (l - min) or (max - l) are zero, simply set all the channels to
the limit, 0 in the case of (l - min), and a in the case of (max - l).
2010-12-20 19:37:11 -05:00
Søren Sandmann Pedersen
3479050216 Add a test compositing with the various PDF operators.
The test has floating point exceptions enabled, and currently fails
with a divide-by-zero.
2010-12-20 19:37:11 -05:00
Cyril Brulebois
45a2d01077 Fix linking issues when HAVE_FEENABLEEXCEPT is set.
All objects using test/util.c fail to link:
|   CCLD   region-test
| /usr/bin/ld: utils.o: in function enable_fp_exceptions:utils.c(.text+0x939): error: undefined reference to 'feenableexcept'

There's indeed no explicit dependency on -lm, and if HAVE_FEENABLEEXCEPT
happens to be set, test/util.c uses feenableexcept(), which is nowhere
to be found while linking.

Fix this by adding -lm to TEST_LDADD, although two alternatives could be
thought of:
 - Only specifying -lm for objects using util.c.
 - Introducing a conditional to add -lm only when configure detects
   have_feenableexcept=yes.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2010-12-20 09:55:07 -05:00
Jon TURNEY
303de045ff Remove stray #include <fenv.h>
Remove a stray #include <fenv.h> added in commit 2444b2265a
to fix compilation on platforms which don't have fenv.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-12-18 16:29:12 -05:00
Søren Sandmann Pedersen
f914cf4486 Add a stress-test program.
This test program tries to use as many rarely-used features as
possible, including alpha maps, accessor functions, oddly-sized
images, strange transformations, conical gradients, etc.

The hope is to provoke crashes or irregular behavior in pixman.
2010-12-17 17:03:29 -05:00
Søren Sandmann Pedersen
7d7b03c091 Make the argument to fence_malloc() an int64_t
That way we can detect if someone attempts to allocate a negative size
and abort instead of just returning NULL and segfaulting later.
2010-12-17 17:01:52 -05:00
Søren Sandmann Pedersen
d41522113e test/utils.c: Initialize palette->rgba to 0.
That way it can be used with palettes that are not statically
allocated, without causing valgrind issues.
2010-12-17 16:57:53 -05:00
Søren Sandmann Pedersen
337f0bff0d test: Move palette initialization to utils.[ch] 2010-12-17 16:57:53 -05:00
Søren Sandmann Pedersen
2444b2265a Extend gradient-crash-test
Test the gradients with various transformations, and test cases where
the gradients are specified with two identical points.
2010-12-17 16:57:38 -05:00
Søren Sandmann Pedersen
de2e51dacb Add enable_fp_exceptions() function in utils.[ch]
This function enables floating point traps if possible.
2010-12-17 16:57:18 -05:00
Søren Sandmann Pedersen
a2afcc9ba4 test: Make composite test use some existing macros instead of defining its own
Also move the ARRAY_LENGTH macro into utils.h so it can be used elsewhere.
2010-12-17 16:57:18 -05:00
Siarhei Siamashka
4d8d2fa47e COPYING: added Nokia to the list of copyright holders 2010-12-17 15:34:16 +02:00
Siarhei Siamashka
3d094997b1 Fix for potential unaligned memory accesses
The temporary scanline buffer allocated on stack was declared
as uint8_t array. As a result, the compiler was free to select
any arbitrary alignment for it (even though there is typically
no reason to use really weird alignments here and the stack is
normally at least 4 bytes aligned on most platforms). Having
improper alignment is non-portable and can impact performance
or even make the code misbehave depending on the target platform.

Using uint64_t type for this array should ensure that any possible
memory accesses done by pixman code are going to be handled correctly
(pixman-combine64.c can access this buffer via uint64_t * pointer).

Some alignment related problem was reported in:
http://lists.freedesktop.org/archives/pixman/2010-November/000747.html
2010-12-07 02:10:51 +02:00
Siarhei Siamashka
985e59a82f ARM: added 'neon_src_rpixbuf_8888' fast path
With this optimization added, pixman assisted conversion from
non-premultiplied to premultiplied alpha format is now fully
NEON optimized (both with and without R/B color components
swapping in the process).
2010-12-07 02:10:35 +02:00
Siarhei Siamashka
733f68912f ARM: added 'neon_composite_in_n_8' fast path 2010-12-03 15:38:04 +02:00