[Pixman] [PATCH] test: Fix bug in color_correct() in composite.c

2010-03-07 Thread Søren Sandmann
From: Søren Sandmann Pedersen This function was using the number of bits in a channel as if it were a mask, which lead to many spurious errors. With that fixed, we can turn on testing for all formats where all channels have 5 or more bits. Cc: ch...@chris-wilson.co.uk --- test/composite.c

[Pixman] [PATCH] test: Fix eval_diff() so that it provides useful error values.

2010-03-07 Thread Søren Sandmann
From: Søren Sandmann Pedersen Previously, this function would evaluate the error under the assumption that the format was 565 or wider. This patch changes it to take the actual format into account. With that fixed, we can turn on testing for the rest of the formats. Cc: ch...@chris

[Pixman] [PATCH] test: Change composite so that it tests randomly generated images

2010-03-07 Thread Søren Sandmann
From: Søren Sandmann Pedersen Previously this test would try to exhaustively test all combinations of formats and operators, which meant that it would take years to run. Instead, generate random images and test those. The random seed is based on time(), so we will get different tests every time

[Pixman] [PATCH] pixman.h: Only define stdint types when PIXMAN_DONT_DEFINE_STDINT is undefined

2010-03-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen In SPICE, with Microsoft Visual C++, pixman.h is included after another file that defines these types, which causes warnings and errors. This patch allows such code to just define PIXMAN_DONT_DEFINE_STDINT to use its own version of those types. Cc: al

[Pixman] [PATCH] When storing 4 bit pixels, make sure only the low 4 bits are stored.

2010-03-15 Thread Søren Sandmann
From: Søren Sandmann Pedersen In some cases we end up trying to use the STORE_4 macro with an 8 bit values, which resulted in other pixels getting overwritten. Fix this by always masking away the high 4 bits. --- pixman/pixman-access.c | 22 ++ test/blitters-test.c

[Pixman] [PATCH 0/2] Thread local support on OS X

2010-03-16 Thread Søren Sandmann
So apparently OS X does not support __thread which means current pixman does not compile there. See this: http://tinderbox.x.org/builds/2010-03-16-0022/logs/pixman/#build The following patches add some macros that expand to various types of thread local support. On Linux, Unix, and Windows

[Pixman] [PATCH 1/2] Add checks for various types of thread local storage.

2010-03-16 Thread Søren Sandmann
From: Søren Sandmann Pedersen OS X does not support __thread, so we have to check for it before using it. It does however support pthread_get/setspecific(), so if we don't have __thread, check if those are available. --- configure.ac |

[Pixman] [PATCH 2/2] Add PIXMAN_DEFINE_THREAD_LOCAL() and PIXMAN_GET_THREAD_LOCAL() macros

2010-03-16 Thread Søren Sandmann
From: Søren Sandmann Pedersen These macros hide the various types of thread local support. On Linux and Unix, they expand to just __thread. On Microsoft Visual C++, they expand to __declspec(thread). On OS X and other systems that don't have __thread, they expand to a complicated conco

[Pixman] [ANNOUNCE] pixman stable release 0.18.0 now available

2010-04-01 Thread Søren Sandmann
: - Performance was a major theme of this release. Optimizations include: - Faster rescaling with nearest filter [Alexander Larsson, Siarhei Siamashka, Søren Sandmann Pedersen] - Faster rescaling with bilinear filter [André Tupinambá] - Many new fast paths for ARM NEON [Siarhei Siamashka] - Faster unantialised

[Pixman] [ANNOUNCE] pixman release 0.18.0 now available [fixed formatting]

2010-04-01 Thread Søren Sandmann
support for images larger than 16 bits [Benjamin Otte] Performance improvements: - Performance was a major theme of this release. Optimizations include: - Faster rescaling with nearest filter [Alexander Larsson, Siarhei Siamashka, Søren Sandmann Pedersen

[Pixman] [PATCH 1/2] Extend blitters test to first check known failure cases

2010-04-07 Thread Søren Sandmann
From: Søren Sandmann Pedersen This serves to make sure we don't accidentally reintroduce old bugs. --- test/blitters-test.c | 43 +++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/test/blitters-test.c b/test/blitters-test.c

[Pixman] [PATCH 2/2] [mmx] Fix mask creation bugs

2010-04-07 Thread Søren Sandmann
From: Søren Sandmann Pedersen This line: mask = mask | mask >> 8 | mask >> 16 | mask >> 24; only works when mask has 0s in the lower 24 bits, so add mask &= 0xff00; before. Reported by Todd Rinaldo on the #cairo IRC channel. --- pixman/pixman-mmx.c |

[Pixman] [PATCH] Add pixman_image_get_format() accessor

2010-04-21 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-image.c |9 + pixman/pixman.h |1 + 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 9b44aa9..9604bfe 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman

[Pixman] Misc patches

2010-04-24 Thread Søren Sandmann
This is a series of asssorted patches that I've had lying around for a while. Here's what's in it: - Use memcpy() for SRC compositing in various cases. There was already a memcpy() based fast path, but it was only used for SRC__x888. There is no reason not to used for all copying betwee

[Pixman] [PATCH 1/7] Rename fast_composite_src_8888_x888 to fast_composite_src_memcpy()

2010-04-24 Thread Søren Sandmann
From: Søren Sandmann Pedersen Then generalize it and use it for SRC copying between various identical formats. --- pixman/pixman-fast-path.c | 60 1 files changed, 38 insertions(+), 22 deletions(-) diff --git a/pixman/pixman-fast-path.c b/pixman

[Pixman] [PATCH 2/7] Add pixman_region{,32}_intersect_rect()

2010-04-24 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-region.c | 18 ++ pixman/pixman.h| 13 - 2 files changed, 30 insertions(+), 1 deletions(-) diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c index a6a4005..3ea88a0 100644 --- a/pixman/pixman

[Pixman] [PATCH 3/7] Add an over_8888_8888_8888 sse2 fast path.

2010-04-24 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-sse2.c | 168 ++ 1 files changed, 168 insertions(+), 0 deletions(-) diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c index 946e7ba..09da14d 100644 --- a/pixman/pixman-sse2.c +++ b/pixman

[Pixman] [PATCH 4/7] Don't consider indexed formats opaque.

2010-04-24 Thread Søren Sandmann
From: Søren Sandmann Pedersen The indexed formats have 0 bits of alpha, but can't be considered opaque because there may be non-opaque colors in the palette. --- pixman/pixman-image.c |6 -- test/blitters-test.c |2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --

[Pixman] [PATCH 5/7] sse2: Add sse2_composite_over_reverse_n_8888

2010-04-24 Thread Søren Sandmann
From: Søren Sandmann Pedersen This is a small speed-up for the poppler benchmark: Before: [ # ] backend test min(s) median(s) stddev. count [ 0]image poppler4.4434.474 0.31%6/6 After: [ # ] backend test

[Pixman] [PATCH 6/7] Add support for 8bpp to pixman_fill_sse2()

2010-04-24 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-sse2.c | 39 ++- 1 files changed, 34 insertions(+), 5 deletions(-) diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c index 3f474d7..d5349d7 100644 --- a/pixman/pixman-sse2.c +++ b/pixman/pixman-sse2.c

[Pixman] [PATCH 7/7] Add bswap() macros and use them

2010-04-24 Thread Søren Sandmann
From: Benjamin Otte Code taken from Cairo. --- configure.ac|1 + pixman/pixman-access.c | 35 +-- pixman/pixman-private.h | 18 ++ 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/configure.ac b/configure.ac ind

[Pixman] MinGW thread local storage

2010-05-03 Thread Søren Sandmann
Hi, The patches below are supposed to fix the thread local storage issue on MinGW 32. Apparently, __thread is "supported" in the latest GCC, but doesn't actually work. The first patch here simply disables __thread if MinGW32 is detected. The second patch is based on Tor's code from here: ht

[Pixman] [PATCH] Don't use __thread on MinGW.

2010-05-03 Thread Søren Sandmann
From: Søren Sandmann Pedersen It is apparently broken. See this: http://mingw-users.1079350.n2.nabble.com/gcc-4-4-multi-threaded-exception-handling-thread-specifier-not-working-td3440749.html We'll need to support thread local storage on MinGW32 some other way. Cc: t...@i

[Pixman] [PATCH] Add macros for thread local storage on MinGW 32

2010-05-03 Thread Søren Sandmann
From: Søren Sandmann Pedersen These macros are identical to the ones that Tor Lillqvist posted here: http://lists.freedesktop.org/archives/pixman/2010-April/000160.html with one exception: the variable is allocated with calloc() and not malloc(). Cc: t...@iki.fi --- pixman/pixman

[Pixman] [PATCH] Eliminate mask_bits from all the scanline fetchers.

2010-05-31 Thread Søren Sandmann
From: Søren Sandmann Pedersen Back in the day, the mask_bits argument was used to distinguish between masks used for component alpha (where it was 0x) and masks for unified alpha (where it was 0xff00). In this way, the fetchers could check if just the alpha channel was 0 and in that

[Pixman] [PATCH] Make the combiner macros less likely to cause name collisions.

2010-07-06 Thread Søren Sandmann
From: Søren Sandmann Pedersen Protect the arguments to the combiner macros with parentheses, and prefix their temporary variables with underscores to avoid name space collisions with the surrounding code. --- pixman/pixman-combine.h.template | 152 +++--- 1

[Pixman] [PATCH] test: Make sure the palettes for indexed format roundtrip properly

2010-07-13 Thread Søren Sandmann
From: Søren Sandmann Pedersen The palettes for indexed formats must satisfy the condition that if some index maps to a color C, then the 15 bit version of that color must map back to the index. This ensures that the destination operator is always a no-op, which seems like a reasonable assumption

[Pixman] [PATCH] When converting indexed formats to 64 bits, don't correct for channel widths

2010-07-13 Thread Søren Sandmann
From: Søren Sandmann Pedersen Indexed formats are mapped to a8r8g8b8 with full precision, so when expanding we shouldn't correct for the width of the channels --- pixman/pixman-access.c | 31 +-- test/blitters-test.c |2 +- 2 files changed, 30 inser

[Pixman] [PATCH] Make the repeat mode explicit in the FAST_NEAREST macro.

2010-07-13 Thread Søren Sandmann
From: Søren Sandmann Pedersen Before, it was 0 or 1 meaning 'no repeat' and 'normal repeat' respectively. Now we explicitly pass in either NONE or NORMAL. --- pixman/pixman-fast-path.c | 43 ++- 1 files changed, 26 insertions(+), 1

[Pixman] [PATCH] In the FAST_NEAREST macro call the function 8888_8888 and not x888_x888

2010-07-13 Thread Søren Sandmann
From: Søren Sandmann Pedersen The x888 suggests that they have something to do with the x8r8g8b8 formats, but that's not the case; they are assuming a8r8g8b8 formats. (Although in some cases they also work for x8r8g8b8 type formats). --- pixman/pixman-fast-path.c |

[Pixman] [PATCH] fast-path: Some formatting fixes

2010-07-13 Thread Søren Sandmann
From: Søren Sandmann Pedersen Add spaces before parentheses; fix indentation in the macro. --- pixman/pixman-fast-path.c | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c index 2e9d39a

[Pixman] [PATCH] Check for read accessors before taking the bilinear fast path

2010-07-13 Thread Søren Sandmann
From: Søren Sandmann Pedersen The bilinear fast path accesses pixels directly, so if the image has a read accessor, then it can't be used. --- pixman/pixman-bits-image.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/pixman/pixman-bits-image.c b/pixman/pixman

[Pixman] [PATCH] [fast] Add fast_composite_src_x888_8888()

2010-07-15 Thread Søren Sandmann
From: Søren Sandmann Pedersen This shows up on when Firefox displays http://dougx.net/plunder/plunder.html --- pixman/pixman-fast-path.c | 38 ++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast

[Pixman] [PATCH] [sse2] Add sse2_composite_src_x888_8888()

2010-07-15 Thread Søren Sandmann
From: Søren Sandmann Pedersen This operation shows up when Firefox displays http://dougx.net/plunder/plunder.html --- pixman/pixman-sse2.c | 84 ++ 1 files changed, 84 insertions(+), 0 deletions(-) diff --git a/pixman/pixman-sse2.c b/pixman

[Pixman] [PATCH] [sse2] Add sse2_composite_add_n_8()

2010-07-15 Thread Søren Sandmann
From: Søren Sandmann Pedersen This shows up when epiphany displays the "ImageTest" on glimr.rubyforge.org/cake/canvas.html --- pixman/pixman-sse2.c | 98 ++ 1 files changed, 98 insertions(+), 0 deletions(-) diff --git a/pixman/pixma

[Pixman] [PATCH] [sse2] Add sse2_composite_in_n_8()

2010-07-15 Thread Søren Sandmann
From: Søren Sandmann Pedersen This shows up when epiphany displays the "ImageTest" on glimr.rubyforge.org/cake/canvas.html --- pixman/pixman-sse2.c | 109 +- 1 files changed, 108 insertions(+), 1 deletions(-) diff --git a/pixman/pixma

[Pixman] [PATCH] bits: Fix potential divide-by-zero in projective code

2010-07-15 Thread Søren Sandmann
From: Søren Sandmann Pedersen If the homogeneous coordinate is 0, just set the coordinates to 0. --- pixman/pixman-bits-image.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index 95710b4..36ea0af

[Pixman] [PATCH] If we bail out of do_composite, make sure to undo any workarounds.

2010-07-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen The workaround for an old X bug has to be undone if we bail from do_composite, so we can't just return. --- pixman/pixman.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pixman/pixman.c b/pixman/pixman.c index 80a766a..2d06ce2 1

[Pixman] [bits] Some cleanups of fetchers, plus flags for bits-image

2010-07-29 Thread Søren Sandmann
The following patches contain some cleanups of the way the scanline fetching works for bits images. By removing the support for alpha map recursion, there is no longer any need to distinguish between 'raw' and non-raw scanline fetchers. Instead there is only one type of scanline fetcher, and only

[Pixman] [PATCH 1/7] Eliminate recursion from alpha map code

2010-07-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen Alpha maps with alpha maps are no longer supported. It's not a useful feature and it could could lead to infinite recursion. --- pixman/pixman-bits-image.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pixman/pixman-bits-imag

[Pixman] [PATCH 2/7] Eliminate get_pixel_32() and get_pixel_64() from bits_image.

2010-07-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen These functions can simply be passed as arguments to the various pixel fetchers. We don't need to store them. Since they are known at compile time and the pixel fetchers are force_inline, this is not a performance issue. Also temporarily make all pixel acce

[Pixman] [PATCH 3/7] Split bits_image_fetch_transformed() into two functions.

2010-07-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen One function deals with the common affine, no-alpha-map case. The other deals with perspective transformations and alpha maps. --- pixman/pixman-bits-image.c | 222 +--- 1 files changed, 128 insertions(+), 94 deletions

[Pixman] [PATCH 4/7] Eliminate the store_scanline_{32, 64} function pointers.

2010-07-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen Now that we can't recurse on alpha maps, they are not needed anymore. --- pixman/pixman-bits-image.c | 54 +--- pixman/pixman-private.h|4 --- 2 files changed, 16 insertions(+), 42 deletions(-) diff --git a/p

[Pixman] [PATCH 5/7] Remove "_raw_" from all the accessors.

2010-07-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen There are no non-raw accessors anymore. --- pixman/pixman-access.c | 40 pixman/pixman-bits-image.c | 28 ++-- pixman/pixman-private.h| 19 +++ 3 files changed, 41

[Pixman] [PATCH 6/7] Add some new FAST_PATH flags

2010-07-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen The flags are: * AFFINE_TRANSFORM, for affine transforms * Y_UNIT_ZERO, for when the 10 entry in the transformation is zero * FILTER_BILINEAR, for when the image has a bilinear filter * NO_NORMAL_REPEAT, for when the repeat mode is not NORMAL

[Pixman] [PATCH 7/7] Store the various bits image fetchers in a table with formats and flags.

2010-07-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen Similarly to how the fast paths are done, put the various bits_image fetchers in a table, so that we can quickly find the best one based on the image's flags and format. --- pixman/pixman-bits-image.c | 126 ++- 1

[Pixman] [PATCH] Add support for AltiVec detection for OpenBSD/PowerPC.

2010-07-31 Thread Søren Sandmann
From: Brad Smith Bug 29331. --- pixman/pixman-cpu.c | 25 - 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/pixman/pixman-cpu.c b/pixman/pixman-cpu.c index e96b140..1b31885 100644 --- a/pixman/pixman-cpu.c +++ b/pixman/pixman-cpu.c @@ -61,6 +61,29 @@ pix

[Pixman] [PATCH] Use stdint.h on OpenBSD

2010-07-31 Thread Søren Sandmann
From: Brad Smith OpenBSD has had stdint.h for a long time now. Bug 29330. --- pixman/pixman.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/pixman/pixman.h b/pixman/pixman.h index 9981f0d..c1ecedc 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -87,7 +87,7 @@ PI

[Pixman] [PATCH] Add alpha-loop test program

2010-08-04 Thread Søren Sandmann
From: Søren Sandmann Pedersen This tests what happens if you attempt to make an image with an alpha map that has the image as its alpha map. This results in an infinite loop in _pixman_image_validate(), so the test sets up a SIGALRM to exit if it runs for more than five seconds

[Pixman] [PATCH] pixman_image_set_alpha_map(): Disallow alpha map cycles

2010-08-04 Thread Søren Sandmann
From: Søren Sandmann Pedersen If someone tries to set an alpha map that itself has an alpha map, simply return. Also, if someone tries to add an alpha map to an image that is being _used_ as an alpha map, simply return. This ensures that an alpha map can never have an alpha map. --- pixman

[Pixman] [PATCH] Merge pixman_image_composite32() and do_composite().

2010-08-22 Thread Søren Sandmann
From: Søren Sandmann Pedersen There is not much point having a separate function that just validates the images. Also add a boolean return to lookup_composite_function() so that we can return if no composite function is found. --- pixman/pixman.c | 131

[Pixman] [PATCH] Be more paranoid about checking for GTK+

2010-08-23 Thread Søren Sandmann
From: Søren Sandmann Pedersen From time to time peole run into issues where the configure script detects GTK+ when it is either not installed, or not functional due to a missing pixman. Most recently, https://bugs.freedesktop.org/show_bug.cgi?id=29736 This patch makes the configure script

[Pixman] [PATCH] Store a2b2g2r2 pixel through the WRITE macro

2010-08-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen Otherwise, accessor functions won't work. --- pixman/pixman-access.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c index 56de711..f1ce0ba 100644 --- a/pixman/pixman-access.c

[Pixman] [PATCH] When pixman_compute_composite_region32() return FALSE, don't fini the region.

2010-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen The rule is that the region passed in must be initialized and that the region returned will still be valid. Ie., the lifecycle is the responsibility of the caller, regardless of what the function returns. Previously, composite_region32() would finalize the region

[Pixman] [PATCH] Silence some warnings about uninitialized variables

2010-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen Neither were real problems, but GCC were complaining about them. --- pixman/pixman.c |3 +++ test/composite.c |1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/pixman/pixman.c b/pixman/pixman.c index 62b58b8..47ffdd6 100644 --- a/pixman

[Pixman] [PATCH] Add FAST_PATH_NO_ALPHA_MAP to the standard destination flags.

2010-09-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen We can't in general take a fast path if the destination has an alpha map. --- pixman/pixman-private.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index dedea0b..3557fb2 100644

[Pixman] [PATCH] Do opacity computation with shifts instead of comparing with 0

2010-09-12 Thread Søren Sandmann
From: Søren Sandmann Pedersen Also add a COMPILE_TIME_ASSERT() macro and use it to assert that the shift is correct. --- pixman/pixman-private.h |3 +++ pixman/pixman.c | 14 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pixman/pixman-private.h b

[Pixman] [PATCH 1/5] Add fence_malloc() and fence_free().

2010-09-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen These variants of malloc() and free() try to surround the allocated memory with protected pages so that out-of-bounds accessess will cause a segmentation fault. If mprotect() and getpagesize() are not available, these functions are simply equivalent to malloc() and

[Pixman] [PATCH 2/5] Update and extend the alphamap test

2010-09-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen - Test many more combinations of formats - Test destination alpha maps - Test various different alpha origins Also add a transformation to the destination, but comment it out because it is actually broken at the moment (and pretty difficult to fix). --- test

[Pixman] [PATCH 3/5] Rename FAST_PATH_NO_WIDE_FORMAT to FAST_PATH_NARROW_FORMAT

2010-09-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen This avoids a negative in the name. Also, by renaming the "wide" variable in pixman-general.c to "narrow" and fixing up the logic correspondingly, the code there reads a lot more straightforwardly. --- pixman/pixman-fast-path.c |2 +- pix

[Pixman] [PATCH 4/5] Remove FAST_PATH_NARROW_FORMAT flag if there is a wide alpha map

2010-09-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen If an image has an alpha map that has wide components, then we need to use 64 bit processing for that image. We detect this situation in pixman-image.c and remove the FAST_PATH_NARROW_FORMAT flag. In pixman-general, the wide/narrow decision is now based on the

[Pixman] [PATCH 5/5] Clip composite region against the destination alpha map extents.

2010-09-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen Otherwise we can end up writing outside the alpha map. --- pixman/pixman.c | 21 + 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/pixman/pixman.c b/pixman/pixman.c index cdf4b75..285bbfc 100644 --- a/pixman/pixman.c +++ b

[Pixman] [PATCH 0/5] Fix various alpha map related bugs

2010-09-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen Hi, The following patch series contains some fixes for various alpha-map related bugs. The bugs are: - We don't currently clip the composite region against the extents of the alpha map of the destination. This means that if the alpha map doesn't

[Pixman] [PATCH 1/3] Add new FAST_PATH_UNCOMPOSITABLE flag

2010-09-16 Thread Søren Sandmann
From: Søren Sandmann Pedersen This is set if the image can't be used for compositing, such as when it's bigger than 0x or has size 0. --- pixman/pixman-image.c | 10 ++ pixman/pixman-private.h |1 + pixman/pixman.c | 10 +++--- 3 files changed, 14

[Pixman] [PATCH 2/3] Move some of the FAST_PATH_COVERS_CLIP computation to pixman-image.c

2010-09-16 Thread Søren Sandmann
From: Søren Sandmann Pedersen When an image is solid or repeating, the FAST_PATH_COVERS_CLIP flag can be set in compute_image_info(). Also the code that turned this flag off in pixman.c was not correct; it didn't take transformations into account. With this patch, pixman.c doesn't se

[Pixman] [PATCH 3/3] analyze_extents: Fast path for non-transformed BITS images

2010-09-16 Thread Søren Sandmann
From: Søren Sandmann Pedersen Profiling various cairo traces showed that we were spending a lot of time in analyze_extents and compute_sample_extents(). This was especially bad for glyphs where all this computation was completely unnecessary. This patch adds a fast path for the case of non

[Pixman] Fast paths for bilinear transformation

2010-09-16 Thread Søren Sandmann
Hi, The following patches add some fast paths for bilinear transformation for the most important formats: a8, r5g6b5, x8r8g8b8, and a8r8g8b8. The code is actually commented out in the patches. It is enabled in a bunch of trivial commits here: http://cgit.freedesktop.org/~sandmann/pixman/lo

[Pixman] [PATCH 01/19] test: Add affine-test

2010-09-16 Thread Søren Sandmann
From: Søren Sandmann Pedersen This test tests compositing with various affine transformations. It is almost identical to scaling-test, except that it also applies a random rotation in addition to the random scaling and translation. --- test/Makefile.am|4 + test/affine-test.c | 255

[Pixman] [PATCH 02/19] Add nearest scaler for x888 on 8888

2010-09-16 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-fast-path.c | 10 +- pixman/pixman-private.h |5 - 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c index 6dee472..64e69e5 100644 --- a/pixman/pixman-fast

[Pixman] [PATCH 03/19] Use a macro to generate some {a, x}8r8g8b8, a8, and r5g6b5 bilinear fetchers.

2010-09-16 Thread Søren Sandmann
From: Søren Sandmann Pedersen There are versions for all combinations of x8r8g8b8/a8r8g8b8 and pad/repeat/none/normal repeat modes. The bulk of each scaler is an inline function that takes a format and a repeat mode as parameters. The new scalers are all commented out, but the next commits will

[Pixman] [PATCH] Rename all the fast paths with _8000 in their names to _8

2010-09-22 Thread Søren Sandmann
From: Søren Sandmann Pedersen This inconsistent naming somehow survived the refactoring from a while back. --- pixman/pixman-arm-neon-asm.S | 22 +++--- pixman/pixman-arm-neon.c |4 ++-- pixman/pixman-arm-simd-asm.S |2 +- pixman/pixman-arm-simd.c | 16

[Pixman] [PATCH 1/2] Fix bug in FAST_PATH_STD_FAST_PATH

2010-09-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen The standard fast paths deal with two kinds of images: solids and bits. These two image types require different flags, but PIXMAN_STD_FAST_PATH uses the same ones for both. This patch makes it so that solid images just get the standard flags, while bits images must

[Pixman] [PATCH 2/2] Delete simple repeat code

2010-09-29 Thread Søren Sandmann
From: Søren Sandmann Pedersen This was supposedly an optimization, but it has pathological cases where it definitely isn't. For example it has terrible memory access patterns when called with a 1 x n image. With small images in general, it will do lots and lots of modulus operations. Sin

[Pixman] [PATCH] Remove broken optimizations in combine_disjoint_over_u()

2010-10-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen The first broken optimization is that it checks "a != 0x00" where it should check "s != 0x00". The other is that it skips the computation when alpha is 0xff. That is wrong because in the formula: min (1, (1 - Aa)/Ab) the render specificati

[Pixman] [PATCH] Add no-op combiners for DST and the CA versions of the HSL operators.

2010-10-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen We already exit early for DST, but for the HSL operators with component alpha, we crash at the moment. Fix that by adding a dummy combine_dst() function. --- pixman/pixman-combine.c.template | 31 +-- 1 files changed, 21 insertions

[Pixman] [PATCH] Plug leak in the alphamap test.

2010-10-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen The images are being created with non-NULL data, so we have to free it outselves. This is important because the Cygwin tinderbox is running out of memory and produces this: mmap failed on 2 1507328 mmap failed on 4 1507328 mmap failed on 2

[Pixman] [PATCH] Remove workaround for a bug in the 1.6 X server.

2010-10-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen There used to be a bug in the X server where it would rely on out-of-bounds accesses when it was asked to composite with a window as the source. It would create a pixman image pointing to some bogus position in memory, but then set a clip region to the position

[Pixman] [PATCH] [mmx] Mark some of the output variables as earlyclobber.

2010-10-30 Thread Søren Sandmann
From: Søren Sandmann Pedersen GCC assumes that input variables in inline assembly are fully consumed before any output variable is written. This means it may allocate the variables in the same register unless the output variables are marked as early-clobber. From Jeremy Huddleston: I

[Pixman] [PATCH] Delete the source_image_t struct.

2010-10-30 Thread Søren Sandmann
From: Søren Sandmann Pedersen It serves no purpose anymore now that the source_class_t field is gone. --- pixman/pixman-conical-gradient.c | 17 - pixman/pixman-linear-gradient.c | 30 ++ pixman/pixman-private.h | 11

[Pixman] [PATCH] Generate {a, x}8r8g8b8, a8, 565 fetchers for nearest/affine images

2010-11-12 Thread Søren Sandmann
From: Søren Sandmann Pedersen There are versions for all combinations of x8r8g8b8/a8r8g8b8 and pad/repeat/none/normal repeat modes. The bulk of each function is an inline function that takes a format and a repeat mode as parameters. --- pixman/pixman-bits-image.c | 177

[Pixman] [PATCH] Add support for AltiVec detection for OpenBSD/PowerPC.

2010-12-14 Thread Søren Sandmann
From: Brad Smith Bug 29331. --- pixman/pixman-cpu.c | 25 - 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/pixman/pixman-cpu.c b/pixman/pixman-cpu.c index e96b140..1b31885 100644 --- a/pixman/pixman-cpu.c +++ b/pixman/pixman-cpu.c @@ -61,6 +61,29 @@ pix

[Pixman] [PATCH] pixman_image_set_alpha_map(): Disallow alpha map cycles

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen If someone tries to set an alpha map that itself has an alpha map, simply return. Also, if someone tries to add an alpha map to an image that is being _used_ as an alpha map, simply return. This ensures that an alpha map can never have an alpha map. --- pixman

[Pixman] Some test suite improvements

2010-12-14 Thread Søren Sandmann
Here is a set of patches that contain some updates to the test suite. Specifically, - gradient-crash-test is extended to test more scenarios - floating point exceptions are enabled in some cases - The argument to fence_malloc() becomes a signed integer, and it will abort() if someone tries to

[Pixman] [PATCH] Add alpha-loop test program

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen This tests what happens if you attempt to make an image with an alpha map that has the image as its alpha map. This results in an infinite loop in _pixman_image_validate(), so the test sets up a SIGALRM to exit if it runs for more than five seconds

[Pixman] [PATCH] Store a2b2g2r2 pixel through the WRITE macro

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen Otherwise, accessor functions won't work. --- pixman/pixman-access.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c index 56de711..f1ce0ba 100644 --- a/pixman/pixman-access.c

[Pixman] [PATCH] test: Make composite test use some existing macros instead of defining its own

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen Also move the ARRAY_LENGTH macro into utils.h so it can be used elsewhere. --- test/composite.c | 56 + test/utils.h |2 + 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/test

[Pixman] [PATCH] Add enable_fp_exceptions() function in utils.[ch]

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen This function enables floating point traps if possible. --- configure.ac |8 test/utils.c | 26 ++ test/utils.h |3 +++ 3 files changed, 37 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index

[Pixman] [PATCH] When pixman_compute_composite_region32() return FALSE, don't fini the region.

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen The rule is that the region passed in must be initialized and that the region returned will still be valid. Ie., the lifecycle is the responsibility of the caller, regardless of what the function returns. Previously, composite_region32() would finalize the region

[Pixman] [PATCH] bits: Fix potential divide-by-zero in projective code

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen If the homogeneous coordinate is 0, just set the coordinates to 0. --- pixman/pixman-bits-image.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index 95710b4..36ea0af

[Pixman] [PATCH 0/7] Some test suite improvements (second attempt)

2010-12-14 Thread Søren Sandmann
Sorry about the spam I just sent with a jumble of old and new patches. Hopefully this time it will work better. Here is a set of patches that contain some updates to the test suite. Specifically, - gradient-crash-test is extended to test more scenarios - floating point exceptions are enabled in

[Pixman] [PATCH 2/7] Add enable_fp_exceptions() function in utils.[ch]

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen This function enables floating point traps if possible. --- configure.ac |8 test/utils.c | 26 ++ test/utils.h |3 +++ 3 files changed, 37 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index

[Pixman] [PATCH 1/7] test: Make composite test use some existing macros instead of defining its own

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen Also move the ARRAY_LENGTH macro into utils.h so it can be used elsewhere. --- test/composite.c | 56 + test/utils.h |2 + 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/test

[Pixman] [PATCH 3/7] Extend gradient-crash-test

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen Test the gradients with various transformations, and test cases where the gradients are specified with two identical points. --- test/Makefile.am |5 ++- test/gradient-crash-test.c | 124 +-- 2 files changed

[Pixman] [PATCH 4/7] test: Move palette initialization to utils.[ch]

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- test/blitters-test.c | 57 + test/utils.c | 54 +++ test/utils.h |3 ++ 3 files changed, 59 insertions(+), 55 deletions(-) diff --git a/test

[Pixman] [PATCH 6/7] Make the argument to fence_malloc() an int64_t

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen That way we can detect if someone attempts to allocate a negative size and abort instead of just returning NULL and segfaulting later. --- test/utils.c |7 +-- test/utils.h |2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test

[Pixman] [PATCH 5/7] test/utils.c: Initialize palette->rgba to 0.

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen That way it can be used with palettes that are not statically allocated, without causing valgrind issues. --- test/utils.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/test/utils.c b/test/utils.c index 4701bf6..cde9c62 100644 --- a/test

[Pixman] [PATCH 7/7] Add a stress-test program.

2010-12-14 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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. --- test

[Pixman] [PATCH 1/2] Add a test compositing with the various PDF operators.

2010-12-18 Thread Søren Sandmann
From: Søren Sandmann Pedersen The test has floating point exceptions enabled, and currently fails with a divide-by-zero. --- test/Makefile.am |4 ++ test/pdf-op-test.c | 84 2 files changed, 88 insertions(+), 0 deletions(-) create

[Pixman] [PATCH 2/2] Fix divide-by-zero in set_lum().

2010-12-18 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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). --- pixman/pixman-combine.c.template | 30 -- 1 files changed, 24 insertions(+), 6 deletions

[Pixman] [PATCH] sse2: Skip src pixels that are zero in sse2_composite_over_8888_n_8888()

2010-12-20 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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. --- pixman/pixman-sse2.c | 75

  1   2   3   4   5   6   7   8   9   >