Commit Graph

1757 Commits

Author SHA1 Message Date
Søren Sandmann Pedersen
839326e471 In the FAST_NEAREST macro call the function 8888_8888 and not x888_x888
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).
2010-07-12 09:46:37 -04:00
Søren Sandmann Pedersen
e13d9f9684 Make the repeat mode explicit in the FAST_NEAREST macro.
Before, it was 0 or 1 meaning 'no repeat' and 'normal repeat'
respectively. Now we explicitly pass in either NONE or NORMAL.
2010-07-12 09:46:37 -04:00
Søren Sandmann Pedersen
2e7fb66553 When converting indexed formats to 64 bits, don't correct for channel widths
Indexed formats are mapped to a8r8g8b8 with full precision, so when
expanding we shouldn't correct for the width of the channels
2010-07-11 09:43:56 -04:00
Søren Sandmann Pedersen
2df6dac0be test: Make sure the palettes for indexed format roundtrip properly
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 to make.
2010-07-11 09:43:56 -04:00
Søren Sandmann Pedersen
5dd59c8b7c Split the fast path caching into its own force_inline function
The do_composite() function is a lot more readable this way.
2010-07-11 09:43:56 -04:00
Søren Sandmann Pedersen
98d19d9abd Cache the implementation along with the fast paths.
When calling a fast path, we need to pass the corresponding
implementation since it might contain information necessary to run the
fast path.
2010-07-11 09:43:55 -04:00
Søren Sandmann Pedersen
f18bcf1f6e Hide the global implementation variable behind a force_inline function.
Previously the global variable was called 'imp' which was confusing
with the argument to various other functions also being called imp.
2010-07-11 09:43:55 -04:00
Søren Sandmann Pedersen
5c935473d8 Fix memory leak in the pthreads thread local storage code
When a thread exits, we leak whatever is stored in thread local
variables, so install a destructor to free it.
2010-07-10 21:05:27 -04:00
Søren Sandmann Pedersen
7114b2d63b Make the combiner macros less likely to cause name collisions.
Protect the arguments to the combiner macros with parentheses, and
postfix their temporary variables with underscores to avoid name space
collisions with the surrounding code.

Alexander Shulgin pointed out that underscore-prefixed identifiers are
reserved for the C implementation, so we use postfix underscores
instead.
2010-07-07 06:50:45 -04:00
Søren Sandmann Pedersen
a92e4a6a94 Minor tweaks to README 2010-07-06 19:15:29 -04:00
Søren Sandmann Pedersen
ca846806cb Store the conical angle in floating point radians, not fixed point degrees
This is a slight simplification.
2010-06-24 14:56:09 -04:00
Søren Sandmann Pedersen
3074d57b56 Fix conical gradients to match QConicalGradient from Qt
Under the assumption that pixman gradients are supposed to match
QConicalgradient, described here:

        http://doc.trolltech.com/4.4/qconicalgradient.html

this patch fixes two separate bugs in pixman-conical-gradient.c.

The first bug is that the output of atan2() is in the range of [-pi,
pi], which means the parameter into the gradient can be negative. This
is wrong since a QConicalGradient always interpolates around the
center from 0 to 1. The fix for that is to (a) make sure the given
angle is between 0 and 360, and (b) add or subtract 2 * M_PI if the
computed angle ends up outside [0, 2 * pi].

The other bug is that we were interpolating clockwise, whereas
QConicalGradient calls for a counter-clockwise interpolation. This is
easily fixed by subtracting the parameter from 1.

Finally, this patch encapsulates the computation in a new force-inline
function so that it can be reused in both the affine and non-affine
case.
2010-06-20 04:45:20 -04:00
Søren Sandmann Pedersen
66365b5ef1 Make separate gray scanline storers.
For gray formats the palettes are indexed by luminance, not RGB, so we
can't use the color storers for gray too.
2010-06-18 20:33:02 -04:00
Søren Sandmann Pedersen
4e1d4847c9 When storing a g1 pixel, store the lowest bit, rather than comparing with 0. 2010-06-18 20:33:02 -04:00
Andrea Canciani
445eb6385f test: verify that gradients do not crash pixman
Test gradients under particular conditions (no stops, all the stops
at the same offset) to check that pixman does not misbehave.
2010-06-09 17:30:41 +02:00
Andrea Canciani
de03202581 support single-stop gradients
Just like conical gradients, linear and radial gradients can now
have a single stop.
2010-06-09 17:30:41 +02:00
Søren Sandmann Pedersen
32bd31d677 Eliminate mask_bits from all the scanline fetchers.
Back in the day, the mask_bits argument was used to distinguish
between masks used for component alpha (where it was 0xffffffff) and
masks for unified alpha (where it was 0xff000000). In this way, the
fetchers could check if just the alpha channel was 0 and in that case
avoid fetching the source.

However, we haven't actually used it like that for a long time; it is
currently always either 0xffffffff or 0 (if the mask is NULL). It also
doesn't seem worthwhile resurrecting it because for premultiplied
buffers, if alpha is 0, then so are the color channels
normally.

This patch eliminates the mask_bits and changes the fetchers to just
assume it is 0xffffffff if mask is non-NULL.
2010-06-09 07:17:59 -04:00
Jeff Muizelaar
78778e5963 create getter for component alpha
This patch comes from the mozilla central tree. See
http://hg.mozilla.org/mozilla-central/rev/89338a224278 for the
original changeset.

Signed-off-by: Jeff Muizelaar <jmuizelaar@mozilla.com>
Signed-off-by: Egor Starkov <egor.starkov@nokia.com>
Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Signed-off-by: Siarhei Siamashka <siarhei.siamashka@nokia.com>
2010-06-03 23:18:16 +03:00
Robert Hooker
8814afc5fd Prepare changelog for upload 2010-05-14 13:06:08 -04:00
Robert Hooker
1773c6829c Bump changelogs. 2010-05-14 12:57:58 -04:00
Robert Hooker
c42434196b Merge branch 'upstream-experimental' into debian-experimental 2010-05-14 12:31:03 -04:00
Siarhei Siamashka
cfc4e38852 test: added OpenMP support for better utilization of multiple CPU cores
Some of the tests are quite heavy CPU users and may benefit from
using multiple CPU cores, so the programs from 'test' directory
are now built with OpenMP support. OpenMP is easy to use, portable
and also takes care of making a decision about how many threads
to spawn.
2010-05-13 21:04:55 +03:00
Siarhei Siamashka
f905ebb03d test: scaling-test updated to use new fuzzer_test_main() function 2010-05-13 21:04:36 +03:00
Siarhei Siamashka
be387701a5 test: blitters-test updated to use new fuzzer_test_main() function 2010-05-13 21:04:31 +03:00
Siarhei Siamashka
9ed9abd154 test: blitters-test-bisect.rb converted to perl
This new script can be used to run continuously to compare two test
programs based on fuzzer_test_main() function from 'util.c' and
narrow down to a single problematic test from the batch which results
in different behavior.
2010-05-13 21:03:07 +03:00
Siarhei Siamashka
30c3e91c3f test: main loop from blitters-test added as a new function to utils.c
This new generalized function can be reused in both blitters-test
and scaling-test. Final checksum calculation changed in order to make
it parallelizable (it is a sum of individual 32-bit values returned
by a callback function, which is now responsible for running test-specific
code). Return values may be crc32, some other hash or even just zero on
success and non-zero on error (in this case, the expected result of the
whole test run should be 0).
2010-05-13 21:02:27 +03:00
Søren Sandmann Pedersen
872c915dcb Post-release version bump to 0.18.3 2010-05-12 16:33:35 -04:00
Søren Sandmann Pedersen
b48d8b5201 Pre-release version bump to 0.18.2 2010-05-12 16:27:02 -04:00
Søren Sandmann Pedersen
970c183c33 Add macros for thread local storage on MinGW 32
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: tml@iki.fi
2010-05-12 16:15:42 -04:00
Søren Sandmann Pedersen
61ff1a3214 Don't use __thread on MinGW.
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: tml@iki.fi
2010-05-12 16:15:41 -04:00
Søren Sandmann Pedersen
f973be464d Don't consider indexed formats opaque.
The indexed formats have 0 bits of alpha, but can't be considered
opaque because there may be non-opaque colors in the palette.
2010-05-12 16:15:41 -04:00
Jeff Muizelaar
34fb38554f Add missing HAVE_CONFIG_H guards for config.h inclusion 2010-05-12 16:15:41 -04:00
Søren Sandmann Pedersen
38928afaa1 Update README to mention the pixman mailing list 2010-05-12 16:15:41 -04:00
Søren Sandmann Pedersen
664984206d [mmx] Fix mask creation bugs
This line:

    mask = mask | mask >> 8 | mask >> 16 | mask >> 24;

only works when mask has 0s in the lower 24 bits, so add

     mask &= 0xff000000;

before.

Reported by Todd Rinaldo on the #cairo IRC channel.
2010-05-12 16:15:41 -04:00
Søren Sandmann Pedersen
d197dc5e8d Fixes for pthread thread local storage.
The tls_name_key variable is passed to tls_name_get(), and the first
time this happens it isn't initialized. tls_name_get() then passes it
on to tls_name_alloc() which passes it on to pthread_setspecific()
leading to undefined behavior.

None of this is actually necessary at all because there is only one
such variable per thread local variable, so it doesn't need to passed
as a parameter at all.

All of this was pointed out by Tor Lillqvist on the cairo mailing
list.
2010-05-12 16:15:40 -04:00
Søren Sandmann Pedersen
9babaab404 Fix uninitialized cache when pthreads are used
The thread local cache is allocated with malloc(), but we rely on it
being initialized to zero, so allocate it with calloc() instead.
2010-05-12 16:15:40 -04:00
Siddharth Agarwal
4fe0a40e75 Visual Studio 2010 includes stdint.h
Use the builtin version instead of defining the types ourselves.
2010-05-12 16:15:40 -04:00
Søren Sandmann Pedersen
9a46eddc92 Post-release version bump to 0.18.1 2010-05-12 16:15:40 -04:00
Julien Cristau
68b6e0e095 Prepare changelog for upload 2010-05-11 14:16:18 +02:00
Søren Sandmann Pedersen
164fe215f2 Merge branch 'for-master' 2010-05-09 14:24:24 -04:00
Julien Cristau
c6afb1f264 add bug closer 2010-05-08 17:23:17 +02:00
Julien Cristau
92ac0adbbf Drop pixman-arm-don-t-use-env-vars-to-get-hwcap-platform.patch, obsolete. 2010-05-08 17:19:53 +02:00
Julien Cristau
b24ef53fa7 rules: use find .. -delete instead of rm $(find ..) 2010-05-08 17:18:00 +02:00
Julien Cristau
df082450b1 Update symbols file for new API, bump shlibs. 2010-05-08 17:17:27 +02:00
Julien Cristau
a2009cec77 Bump changelogs 2010-05-08 17:06:51 +02:00
Julien Cristau
e91730b91b Merge branch 'upstream-experimental' into debian-experimental 2010-05-08 17:05:21 +02:00
Julien Cristau
1300217b90 Merge branch 'upstream-unstable' into upstream-experimental 2010-05-08 17:04:51 +02:00
Søren Sandmann Pedersen
e1594f204d test/gtk-utils: Set the size of the window to the size of the image 2010-05-06 01:05:40 +03:00
Jeff Muizelaar
2f4f2fb485 Add support for compiling pixman without thread/tls support 2010-05-04 11:55:30 -04:00
Søren Sandmann Pedersen
5158d6740c Add macros for thread local storage on MinGW 32
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: tml@iki.fi
2010-05-03 11:12:43 +03:00