profile/ivi/pixman.git
14 years agobits: Fix potential divide-by-zero in projective code
Søren Sandmann Pedersen [Fri, 16 Jul 2010 03:40:28 +0000 (23:40 -0400)]
bits: Fix potential divide-by-zero in projective code

If the homogeneous coordinate is 0, just set the coordinates to 0.

14 years ago[sse2] Add sse2_composite_add_n_8()
Søren Sandmann Pedersen [Mon, 26 Apr 2010 00:25:50 +0000 (20:25 -0400)]
[sse2] Add sse2_composite_add_n_8()

This shows up when epiphany displays the "ImageTest" on
glimr.rubyforge.org/cake/canvas.html

14 years ago[sse2] Add sse2_composite_in_n_8()
Søren Sandmann Pedersen [Sun, 25 Apr 2010 23:54:28 +0000 (19:54 -0400)]
[sse2] Add sse2_composite_in_n_8()

This shows up when epiphany displays the "ImageTest" on
glimr.rubyforge.org/cake/canvas.html

14 years ago[sse2] Add sse2_composite_src_x888_8888()
Søren Sandmann Pedersen [Tue, 13 Jul 2010 04:31:35 +0000 (00:31 -0400)]
[sse2] Add sse2_composite_src_x888_8888()

This operation shows up when Firefox displays
http://dougx.net/plunder/plunder.html

14 years ago[fast] Add fast_composite_src_x888_8888()
Søren Sandmann Pedersen [Tue, 13 Jul 2010 04:08:10 +0000 (00:08 -0400)]
[fast] Add fast_composite_src_x888_8888()

This shows up on when Firefox displays http://dougx.net/plunder/plunder.html

14 years agoFix thinko in configure.ac's macro to test linking.
M Joonas Pihlaja [Wed, 14 Jul 2010 06:51:27 +0000 (09:51 +0300)]
Fix thinko in configure.ac's macro to test linking.

Copy-paste carnage.  Renames save_{cflags,libs,ldflags} to
save_{CFLAGS,LIBS,LDFLAGS}.

14 years agoAvoid trailing slashes on automake install dirs.
M Joonas Pihlaja [Sun, 11 Jul 2010 16:59:01 +0000 (19:59 +0300)]
Avoid trailing slashes on automake install dirs.

The install-sh on a Solaris box couldn't copy with
trailing slashes.

14 years agoCheck for specific flags by actually trying to compile and link.
M Joonas Pihlaja [Sat, 10 Jul 2010 12:36:41 +0000 (15:36 +0300)]
Check for specific flags by actually trying to compile and link.

Instead of relying on preprocessor version checks to see if a
some compiler flags are supported, actually try to compile and
link a test program with the flags.

14 years agoCheck that the OpenMP pragmas don't cause link errors.
M Joonas Pihlaja [Sat, 10 Jul 2010 01:41:01 +0000 (02:41 +0100)]
Check that the OpenMP pragmas don't cause link errors.

This patch adds extra guards around our use of
OpenMP pragmas and checks that the pragmas won't
cause link errors.  This fixes the build on
Tru64 and Solaris with the native compilers and clang.

14 years agoDon't trust OpenBSD's gcc to produce working code for __thread.
M Joonas Pihlaja [Fri, 9 Jul 2010 09:09:07 +0000 (12:09 +0300)]
Don't trust OpenBSD's gcc to produce working code for __thread.

The gcc on OpenBSD 4.5 to 4.7 at least produces bad code for __thread,
without as much as a warning.

See PR #6410 "Using __thread TLS variables compiles ok but segfault at runtime."

http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yes&numbers=6410

14 years agoTry harder to find suitable flags for pthreads.
M Joonas Pihlaja [Fri, 9 Jul 2010 09:07:35 +0000 (12:07 +0300)]
Try harder to find suitable flags for pthreads.

The flags -D_REENTRANT -lpthread work on more systems than
does -pthread unfortunately, so give that a go too.

14 years agoCheck for read accessors before taking the bilinear fast path
Søren Sandmann Pedersen [Mon, 12 Jul 2010 19:13:49 +0000 (15:13 -0400)]
Check for read accessors before taking the bilinear fast path

The bilinear fast path accesses pixels directly, so if the image has a
read accessor, then it can't be used.

14 years agofast-path: Some formatting fixes
Søren Sandmann Pedersen [Sun, 11 Jul 2010 23:58:49 +0000 (19:58 -0400)]
fast-path: Some formatting fixes

Add spaces before parentheses; fix indentation in the macro.

14 years agoIn the FAST_NEAREST macro call the function 8888_8888 and not x888_x888
Søren Sandmann Pedersen [Sun, 11 Jul 2010 23:57:29 +0000 (19:57 -0400)]
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).

14 years agoMake the repeat mode explicit in the FAST_NEAREST macro.
Søren Sandmann Pedersen [Sun, 11 Jul 2010 23:45:22 +0000 (19:45 -0400)]
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.

14 years agoWhen converting indexed formats to 64 bits, don't correct for channel widths
Søren Sandmann Pedersen [Sun, 11 Jul 2010 00:47:01 +0000 (20:47 -0400)]
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

14 years agotest: Make sure the palettes for indexed format roundtrip properly
Søren Sandmann Pedersen [Sat, 10 Jul 2010 22:40:06 +0000 (18:40 -0400)]
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.

14 years agoSplit the fast path caching into its own force_inline function
Søren Sandmann Pedersen [Sat, 10 Jul 2010 20:49:51 +0000 (16:49 -0400)]
Split the fast path caching into its own force_inline function

The do_composite() function is a lot more readable this way.

14 years agoCache the implementation along with the fast paths.
Søren Sandmann Pedersen [Sat, 10 Jul 2010 20:08:51 +0000 (16:08 -0400)]
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.

14 years agoHide the global implementation variable behind a force_inline function.
Søren Sandmann Pedersen [Sat, 10 Jul 2010 19:47:12 +0000 (15:47 -0400)]
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.

14 years agoFix memory leak in the pthreads thread local storage code
Søren Sandmann Pedersen [Wed, 30 Jun 2010 06:31:10 +0000 (02:31 -0400)]
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.

14 years agoMake the combiner macros less likely to cause name collisions.
Søren Sandmann Pedersen [Thu, 1 Jul 2010 20:54:30 +0000 (16:54 -0400)]
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.

14 years agoMinor tweaks to README
Søren Sandmann Pedersen [Mon, 21 Jun 2010 19:30:46 +0000 (15:30 -0400)]
Minor tweaks to README

14 years agoStore the conical angle in floating point radians, not fixed point degrees
Søren Sandmann Pedersen [Sun, 20 Jun 2010 17:12:27 +0000 (13:12 -0400)]
Store the conical angle in floating point radians, not fixed point degrees

This is a slight simplification.

14 years agoFix conical gradients to match QConicalGradient from Qt
Søren Sandmann Pedersen [Sat, 19 Jun 2010 22:57:45 +0000 (18:57 -0400)]
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.

14 years agoMake separate gray scanline storers.
Søren Sandmann Pedersen [Sun, 30 May 2010 22:26:28 +0000 (18:26 -0400)]
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.

14 years agoWhen storing a g1 pixel, store the lowest bit, rather than comparing with 0.
Søren Sandmann Pedersen [Sun, 30 May 2010 20:52:09 +0000 (16:52 -0400)]
When storing a g1 pixel, store the lowest bit, rather than comparing with 0.

14 years agotest: verify that gradients do not crash pixman
Andrea Canciani [Wed, 9 Jun 2010 14:35:37 +0000 (16:35 +0200)]
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.

14 years agosupport single-stop gradients
Andrea Canciani [Tue, 8 Jun 2010 18:36:15 +0000 (20:36 +0200)]
support single-stop gradients

Just like conical gradients, linear and radial gradients can now
have a single stop.

14 years agoEliminate mask_bits from all the scanline fetchers.
Søren Sandmann Pedersen [Wed, 19 May 2010 02:27:46 +0000 (22:27 -0400)]
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.

14 years agocreate getter for component alpha
Jeff Muizelaar [Mon, 15 Mar 2010 12:56:38 +0000 (14:56 +0200)]
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>
14 years agotest: added OpenMP support for better utilization of multiple CPU cores
Siarhei Siamashka [Tue, 11 May 2010 22:34:57 +0000 (01:34 +0300)]
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.

14 years agotest: scaling-test updated to use new fuzzer_test_main() function
Siarhei Siamashka [Tue, 11 May 2010 21:10:04 +0000 (00:10 +0300)]
test: scaling-test updated to use new fuzzer_test_main() function

14 years agotest: blitters-test updated to use new fuzzer_test_main() function
Siarhei Siamashka [Tue, 11 May 2010 20:21:05 +0000 (23:21 +0300)]
test: blitters-test updated to use new fuzzer_test_main() function

14 years agotest: blitters-test-bisect.rb converted to perl
Siarhei Siamashka [Tue, 11 May 2010 19:57:48 +0000 (22:57 +0300)]
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.

14 years agotest: main loop from blitters-test added as a new function to utils.c
Siarhei Siamashka [Tue, 11 May 2010 19:46:47 +0000 (22:46 +0300)]
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).

14 years agoMerge branch 'for-master'
Søren Sandmann Pedersen [Sun, 9 May 2010 18:24:24 +0000 (14:24 -0400)]
Merge branch 'for-master'

14 years agotest/gtk-utils: Set the size of the window to the size of the image
Søren Sandmann Pedersen [Wed, 5 May 2010 22:05:40 +0000 (01:05 +0300)]
test/gtk-utils: Set the size of the window to the size of the image

14 years agoAdd support for compiling pixman without thread/tls support
Jeff Muizelaar [Tue, 4 May 2010 15:55:30 +0000 (11:55 -0400)]
Add support for compiling pixman without thread/tls support

14 years agoAdd macros for thread local storage on MinGW 32
Søren Sandmann Pedersen [Sat, 24 Apr 2010 22:43:38 +0000 (18:43 -0400)]
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
14 years agoDon't use __thread on MinGW.
Søren Sandmann Pedersen [Fri, 23 Apr 2010 16:34:19 +0000 (12:34 -0400)]
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
14 years agoAdd support for 8bpp to pixman_fill_sse2()
Søren Sandmann Pedersen [Mon, 29 Mar 2010 03:02:43 +0000 (23:02 -0400)]
Add support for 8bpp to pixman_fill_sse2()

14 years agosse2: Add sse2_composite_over_reverse_n_8888
Søren Sandmann Pedersen [Sat, 24 Apr 2010 17:11:50 +0000 (13:11 -0400)]
sse2: Add sse2_composite_over_reverse_n_8888

This is a small speed-up for the poppler benchmark:

Before:
[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image                      poppler    4.443    4.474   0.31%    6/6

After:
[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image                      poppler    4.224    4.248   0.42%    6/6

14 years agoDon't consider indexed formats opaque.
Søren Sandmann Pedersen [Sat, 24 Apr 2010 19:15:05 +0000 (15:15 -0400)]
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.

14 years agoAdd an over_8888_8888_8888 sse2 fast path.
Søren Sandmann Pedersen [Thu, 25 Feb 2010 00:21:50 +0000 (19:21 -0500)]
Add an over_8888_8888_8888 sse2 fast path.

14 years agoAdd pixman_region{,32}_intersect_rect()
Søren Sandmann Pedersen [Wed, 18 Feb 2009 04:03:25 +0000 (23:03 -0500)]
Add pixman_region{,32}_intersect_rect()

14 years agoRename fast_composite_src_8888_x888 to fast_composite_src_memcpy()
Søren Sandmann Pedersen [Wed, 22 Jul 2009 00:52:26 +0000 (20:52 -0400)]
Rename fast_composite_src_8888_x888 to fast_composite_src_memcpy()

Then generalize it and use it for SRC copying between various
identical formats.

14 years agoAdd missing HAVE_CONFIG_H guards for config.h inclusion
Jeff Muizelaar [Tue, 27 Apr 2010 19:23:20 +0000 (15:23 -0400)]
Add missing HAVE_CONFIG_H guards for config.h inclusion

14 years agoRemove alphamap from the GTK+ part of tests/Makefile.am
Søren Sandmann Pedersen [Thu, 22 Apr 2010 16:14:23 +0000 (12:14 -0400)]
Remove alphamap from the GTK+ part of tests/Makefile.am

It doesn't use GTK+ and it was already listed in the non-GTK+ part.

14 years agoAdd pixman_image_get_format() accessor
Søren Sandmann Pedersen [Wed, 21 Apr 2010 13:59:29 +0000 (09:59 -0400)]
Add pixman_image_get_format() accessor

14 years agoSome minor updates to README
Søren Sandmann Pedersen [Wed, 21 Apr 2010 13:55:35 +0000 (09:55 -0400)]
Some minor updates to README

14 years agoUpdate README to mention the pixman mailing list
Søren Sandmann Pedersen [Sun, 18 Apr 2010 20:24:39 +0000 (16:24 -0400)]
Update README to mention the pixman mailing list

14 years ago[mmx] Fix mask creation bugs
Søren Sandmann Pedersen [Wed, 7 Apr 2010 23:34:41 +0000 (19:34 -0400)]
[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.

14 years agoFixes for pthread thread local storage.
Søren Sandmann Pedersen [Wed, 7 Apr 2010 05:44:12 +0000 (01:44 -0400)]
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.

14 years agoFix uninitialized cache when pthreads are used
Søren Sandmann Pedersen [Wed, 7 Apr 2010 05:39:14 +0000 (01:39 -0400)]
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.

14 years agoVisual Studio 2010 includes stdint.h
Siddharth Agarwal [Tue, 13 Apr 2010 14:15:29 +0000 (10:15 -0400)]
Visual Studio 2010 includes stdint.h

Use the builtin version instead of defining the types ourselves.

14 years agoPost-release version bump to 0.19.1
Søren Sandmann Pedersen [Thu, 1 Apr 2010 10:21:21 +0000 (06:21 -0400)]
Post-release version bump to 0.19.1

14 years agoPre-release version bump to 0.18.0
Søren Sandmann Pedersen [Thu, 1 Apr 2010 09:23:31 +0000 (05:23 -0400)]
Pre-release version bump to 0.18.0

14 years agoRevert "Improve PIXREGION_NIL to return true on degenerated regions."
Matthias Hopf [Wed, 24 Mar 2010 17:54:29 +0000 (18:54 +0100)]
Revert "Improve PIXREGION_NIL to return true on degenerated regions."

This reverts commit ebba1493136a5a0dd7667073165b2115de203eda.
Scheduled for re-discussion after stable 0.18 has been released.

14 years agoImprove PIXREGION_NIL to return true on degenerated regions.
Matthias Hopf [Wed, 24 Mar 2010 11:00:21 +0000 (12:00 +0100)]
Improve PIXREGION_NIL to return true on degenerated regions.

Fixes Novell bug 568811.

14 years agoPost-release version bump to 0.17.15
Søren Sandmann Pedersen [Tue, 23 Mar 2010 21:25:54 +0000 (17:25 -0400)]
Post-release version bump to 0.17.15

14 years agoPre-release version bump to 0.17.14
Søren Sandmann Pedersen [Tue, 23 Mar 2010 20:52:02 +0000 (16:52 -0400)]
Pre-release version bump to 0.17.14

14 years agoMerge remote branch 'ssvb/arm-fixes'
Søren Sandmann Pedersen [Tue, 23 Mar 2010 15:00:04 +0000 (11:00 -0400)]
Merge remote branch 'ssvb/arm-fixes'

14 years agoARM: SIMD optimizations moved to a separate .S file
Siarhei Siamashka [Mon, 22 Mar 2010 19:56:17 +0000 (21:56 +0200)]
ARM: SIMD optimizations moved to a separate .S file

This should be the last step in providing full armv4t compatibility
with CPU features runtime autodetection in pixman.

14 years agoARM: SIMD optimizations updated to use common assembly calling conventions
Siarhei Siamashka [Mon, 22 Mar 2010 17:51:00 +0000 (19:51 +0200)]
ARM: SIMD optimizations updated to use common assembly calling conventions

14 years agoARM: Helper ARM NEON assembly binding macros moved into a separate header
Siarhei Siamashka [Mon, 22 Mar 2010 16:51:54 +0000 (18:51 +0200)]
ARM: Helper ARM NEON assembly binding macros moved into a separate header

This is needed for future reuse of the same macros for the other
ARM assembly optimizations (armv4t, armv6)

14 years agoARM: Workaround for a NEON bug in assembler from binutils 2.18
Siarhei Siamashka [Sat, 26 Dec 2009 22:27:53 +0000 (00:27 +0200)]
ARM: Workaround for a NEON bug in assembler from binutils 2.18

The problem was reported as bug 25534 against pixman in
freedesktop.org bugzila. Link to a patch for binutils:
http://sourceware.org/ml/binutils/2008-03/msg00260.html

For pixman the impact is a build failure when using
binutils 2.18. Versions 2.19 and higer are fine. Still
some distros may be using older versions of binutils and
this is causing problems.

This patch workarounds the problem by replacing a problematic
"vmov a, b" instruction with equivalent "vorr a, b, b". Actually
they even map to the same instruction opcode in the generated
code, so the resulting binary is identical with and without patch.

14 years agoARM: Use '.object_arch' directive in NEON assembly file
Siarhei Siamashka [Mon, 22 Mar 2010 09:54:51 +0000 (11:54 +0200)]
ARM: Use '.object_arch' directive in NEON assembly file

This can be used to override the architecture recorded in the EABI object
attribute section. We set a minimum arch to 'armv4'. Binutils documentation
recommends to use this directive with the code performing runtime detection
of CPU features.

Additionally NEON/VFP EABI attributes are suppressed. And the instruction
set to use is explicitly set to '.arm'.

Configure test for NEON support is also updated to include a bunch of
these new directives (if any of these is unsupported by the assembler,
it is better to fail configure test than to fail library build).

All these changes are required to fix SIGILL problem on armv4t, reported in
http://lists.freedesktop.org/archives/pixman/2010-March/000123.html

14 years agoAvoid a potential division-by-zero exeception in window-test
Jon TURNEY [Wed, 17 Mar 2010 21:07:06 +0000 (21:07 +0000)]
Avoid a potential division-by-zero exeception in window-test

Avoid a division-by-zero exception if the first number returned by
rand() is a multiple of 500, causing us to create a zero width pixmap,
and then attempt to use get_rand(0) when generating a random stride...

Fixes https://bugs.freedesktop.org/attachment.cgi?id=34162

14 years agoPost-release version bump to 0.17.13
Søren Sandmann Pedersen [Wed, 17 Mar 2010 19:12:06 +0000 (15:12 -0400)]
Post-release version bump to 0.17.13

14 years agoPre-release version bump to 0.17.12
Søren Sandmann Pedersen [Wed, 17 Mar 2010 17:46:44 +0000 (13:46 -0400)]
Pre-release version bump to 0.17.12

14 years agoSpecialize the fast_composite_scaled_nearest_* scalers to positive x units
Søren Sandmann Pedersen [Wed, 17 Mar 2010 14:50:42 +0000 (10:50 -0400)]
Specialize the fast_composite_scaled_nearest_* scalers to positive x units

This avoids a test in the inner loop, which improves performance
especially for tiled sources.

On x86-32, I get these results:

Before:
op=1, src_fmt=20028888, dst_fmt=20028888, speed=306.96 MPix/s (73.18 FPS)
op=1, src_fmt=20028888, dst_fmt=10020565, speed=102.67 MPix/s (24.48 FPS)
op=1, src_fmt=10020565, dst_fmt=10020565, speed=324.85 MPix/s (77.45 FPS)

After:
op=1, src_fmt=20028888, dst_fmt=20028888, speed=332.19 MPix/s (79.20 FPS)
op=1, src_fmt=20028888, dst_fmt=10020565, speed=110.41 MPix/s (26.32 FPS)
op=1, src_fmt=10020565, dst_fmt=10020565, speed=363.28 MPix/s (86.61 FPS)

14 years agoAdd a FAST_PATH_X_UNIT_POSITIVE flag
Søren Sandmann Pedersen [Wed, 17 Mar 2010 14:35:34 +0000 (10:35 -0400)]
Add a FAST_PATH_X_UNIT_POSITIVE flag

This is the common case for a lot of transformed images. If the unit
were negative, the transformation would be a reflection which is
fairly rare.

14 years agoUse the right format for the OVER_8888_565 fast path
Alexander Larsson [Wed, 17 Mar 2010 10:58:05 +0000 (11:58 +0100)]
Use the right format for the OVER_8888_565 fast path

14 years agoAdd specialized fast nearest scalers
Alexander Larsson [Fri, 12 Mar 2010 14:45:04 +0000 (15:45 +0100)]
Add specialized fast nearest scalers

This is a macroized version of SRC/OVER repeat normal/unneeded nearest
neighbour scaling instantiated for some common 8888 and 565 formats.

Based on work by Siarhei Siamashka

14 years agoAdd FAST_PATH_SAMPLES_COVER_CLIP and FAST_PATH_16BIT_SAFE
Alexander Larsson [Fri, 12 Mar 2010 14:41:01 +0000 (15:41 +0100)]
Add FAST_PATH_SAMPLES_COVER_CLIP and FAST_PATH_16BIT_SAFE

FAST_PATH_SAMPLES_COVER_CLIP:

This is set of the source sample grid, unrepeated but transformed
completely completely covers the clip destination. If this is set
you can use a simple scaled that doesn't have to care about the repeat
mode.

FAST_PATH_16BIT_SAFE:

This signifies two things:
1) The size of the src/mask fits in a 16.16 fixed point, so something like:

    max_vx = src_image->bits.width << 16;

    Is allowed and is guaranteed to not overflow max_vx

2) When stepping the source space we're guaranteed to never overflow
   a 16.16 bit fix point variable, even if we step one extra step
   in the destination space. This means that a loop doing:

   x = vx >> 16;
   vx += unit_x;    d = src_row[x];

   will never overflow vx causing x to be negative.

   And additionally, if you track vx like above and apply NORMAL repeat
   after the vx addition with something like:

   while (vx >= max_vx) vx -= max_vx;

   This will never overflow the vx even on the final increment that
   takes vx one past the end of where we will read, which makes the
   repeat loop safe.

14 years agoAdd FAST_PATH_NO_NONE_REPEAT flag
Alexander Larsson [Fri, 12 Mar 2010 14:40:07 +0000 (15:40 +0100)]
Add FAST_PATH_NO_NONE_REPEAT flag

14 years agoAdd CONVERT_8888_TO_8888 and CONVERT_0565_TO_0565 macros
Alexander Larsson [Tue, 16 Mar 2010 13:18:29 +0000 (14:18 +0100)]
Add CONVERT_8888_TO_8888 and CONVERT_0565_TO_0565 macros

These are useful for macroization

14 years agoAdd CONVERT_0565_TO_8888 macro
Alexander Larsson [Fri, 12 Mar 2010 15:23:42 +0000 (16:23 +0100)]
Add CONVERT_0565_TO_8888 macro

This lets us simplify some fast paths since we get a consistent
naming that always has 8888 and gets some value for alpha.

14 years agoEnsure that only the low 4 bit of 4 bit pixels are stored.
Søren Sandmann Pedersen [Mon, 15 Mar 2010 15:51:09 +0000 (11:51 -0400)]
Ensure that only the low 4 bit of 4 bit pixels are stored.

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 off the low 4 bits.

This fixes blitters-test on big-endian machines.

14 years agoFix contact address in configure.ac
Søren Sandmann Pedersen [Tue, 16 Mar 2010 12:17:10 +0000 (08:17 -0400)]
Fix contact address in configure.ac

14 years agoAdd PIXMAN_DEFINE_THREAD_LOCAL() and PIXMAN_GET_THREAD_LOCAL() macros
Søren Sandmann Pedersen [Tue, 16 Mar 2010 16:23:50 +0000 (12:23 -0400)]
Add PIXMAN_DEFINE_THREAD_LOCAL() and PIXMAN_GET_THREAD_LOCAL() macros

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 concoction that uses pthread_once() and
pthread_get/set_specific() to get thread local variables.

14 years agoAdd checks for various types of thread local storage.
Søren Sandmann Pedersen [Tue, 16 Mar 2010 15:01:08 +0000 (11:01 -0400)]
Add checks for various types of thread local storage.

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.

14 years agoAdd Sun cc to thread-local support checks in pixman-compiler.h
Alan Coopersmith [Mon, 15 Mar 2010 22:20:05 +0000 (15:20 -0700)]
Add Sun cc to thread-local support checks in pixman-compiler.h

Clears '#warning: "unknown compiler"' messages when building

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
14 years agoMake .s target asm flag selection more portable
Alan Coopersmith [Mon, 15 Mar 2010 17:52:17 +0000 (10:52 -0700)]
Make .s target asm flag selection more portable

The previous code worked in GNU make, but caused a syntax error in Solaris
make ( https://bugs.freedesktop.org/show_bug.cgi?id=27062 ) - this seems to
work in both, and should hopefully not cause syntax errors in any versions
of make not supporting the macro-substitution-in-macro-name feature, just
cause the macro to expand to nothing.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
14 years agoFix typo: WORDS_BIG_ENDIAN => WORDS_BIGENDIAN in pixman-edge.c
Søren Sandmann Pedersen [Mon, 15 Mar 2010 11:40:46 +0000 (07:40 -0400)]
Fix typo: WORDS_BIG_ENDIAN => WORDS_BIGENDIAN in pixman-edge.c

Pointed out by Andreas Falkenhahn on the cairo mailing list.

14 years agotest: Add support for indexed formats to blitters-test
Søren Sandmann Pedersen [Wed, 3 Mar 2010 18:24:13 +0000 (13:24 -0500)]
test: Add support for indexed formats to blitters-test

These formats work fine, they just need to have a palette set.

14 years agopixman.h: Only define stdint types when PIXMAN_DONT_DEFINE_STDINT is undefined
Søren Sandmann Pedersen [Mon, 1 Mar 2010 15:32:39 +0000 (10:32 -0500)]
pixman.h: Only define stdint types when PIXMAN_DONT_DEFINE_STDINT is undefined

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.

14 years agoMerge branch 'operator-table'
Søren Sandmann Pedersen [Sun, 14 Mar 2010 16:12:05 +0000 (12:12 -0400)]
Merge branch 'operator-table'

14 years agoMerge branch 'fast-path-cache'
Søren Sandmann Pedersen [Sun, 14 Mar 2010 16:12:00 +0000 (12:12 -0400)]
Merge branch 'fast-path-cache'

14 years agoChange operator table to be an array of arrays of four bytes.
Søren Sandmann Pedersen [Sat, 30 Jan 2010 16:37:25 +0000 (11:37 -0500)]
Change operator table to be an array of arrays of four bytes.

This makes gcc generate slightly better code for optimize_operator.

14 years agoStrength reduce certain conjoint/disjoint to their normal counterparts.
Søren Sandmann Pedersen [Sat, 19 Sep 2009 06:40:56 +0000 (02:40 -0400)]
Strength reduce certain conjoint/disjoint to their normal counterparts.

This allows us to not test for them later on.

14 years agoStore the operator table more compactly.
Søren Sandmann Pedersen [Sat, 19 Sep 2009 06:32:28 +0000 (02:32 -0400)]
Store the operator table more compactly.

The four cases for each operator:

    none-are-opaque, src-is-opaque, dest-is-opaque, both-are-opaque

are packed into one uint32_t per operator. The relevant strength
reduced operator can then be found by packing the source-is-opaque and
dest-is-opaque into two bits and shifting that number of bytes.

Chris Wilson pointed out a bug in the original version of this commit:
dest_is_opaque and source_is_opaque were used as booleans, but their
actual values were the results of a logical AND with the
FAST_PATH_OPAQUE flag, so the shift value was wildly wrong.

The only reason it actually passed the test suite (on x86) was that
the compiler computed the shift amount in the cl register, and the low
byte of FAST_PATH_OPAQUE happens to be 0, so no shifting actually took
place, and the original operator was returned.

14 years agoMake the operator strength reduction constant time.
Søren Sandmann Pedersen [Fri, 18 Sep 2009 18:10:31 +0000 (14:10 -0400)]
Make the operator strength reduction constant time.

By extending the operator information table to cover all operators we
can replace the loop with a table look-up. At the same time, base the
operator optimization on the computed flags rather than the ones in
the image struct.

Finally, as an extra optimization, we no longer ignore the case where
there is a mask. Instead we consider the source opaque if both source
and mask are opaque, or if the source is opaque and the mask is
missing.

14 years agoARM: SIMD: Try without any CFLAGS before forcing -mcpu=
Loïc Minier [Tue, 9 Mar 2010 19:57:34 +0000 (20:57 +0100)]
ARM: SIMD: Try without any CFLAGS before forcing -mcpu=

http://bugs.launchpad.net/bugs/535183

14 years agoEliminate trailing comma in enum
Egor Starkov [Fri, 12 Mar 2010 14:47:59 +0000 (09:47 -0500)]
Eliminate trailing comma in enum

https://bugs.freedesktop.org/show_bug.cgi?id=27050

Pixman is not compiling with c++ compiler. During compilation it gives
the following error:

/usr/include/pixman-1/pixman.h:335: error: comma at end of enumerator list

Signed-off-by: Søren Sandmann Pedersen <ssp@redhat.com>
14 years agoAdd a fast path cache
Søren Sandmann Pedersen [Thu, 17 Sep 2009 07:16:27 +0000 (03:16 -0400)]
Add a fast path cache

This patch adds a cache in front of the fast path tables to reduce the
overhead of pixman_composite(). It is fixed size with move-to-front to
make sure the most popular fast paths are at the beginning of the cache.

The cache is thread local to avoid locking.

14 years agoPost-release version bump to 0.17.11
Søren Sandmann Pedersen [Sat, 6 Mar 2010 01:40:41 +0000 (20:40 -0500)]
Post-release version bump to 0.17.11

14 years agoPre-release version bump to 0.17.10
Søren Sandmann Pedersen [Sat, 6 Mar 2010 01:06:08 +0000 (20:06 -0500)]
Pre-release version bump to 0.17.10

14 years agoMove __force_align_arg_pointer workaround before composite32()
Søren Sandmann Pedersen [Fri, 26 Feb 2010 19:15:22 +0000 (14:15 -0500)]
Move __force_align_arg_pointer workaround before composite32()

Since otherwise the workaround won't take effect when you call
pixman_image_composite32() directly.