Commit Graph

1757 Commits

Author SHA1 Message Date
Maarten Bosmans
8596408261 Use windows.h directly for mingw32 build
This patch adresses the issue discussed in
http://lists.freedesktop.org/archives/pixman/2010-April/000163.html

There were only two clashing identifiers.  The first one is IN, which
obviously causes problems in Pixman for lines like

    PIXMAN_STD_FAST_PATH (IN, solid, a8, a8, fast_composite_in_n_8_8),

Fortunately the mingw headers provide a solution: by defining
_NO_W32_PSEUDO_MODIFIERS, these stupid symbols are skipped.

The other name is UINT64, used in pixman-mmx.c. I renamed that
function to to_uint64, but may be another name is more appropriate.
2010-08-30 13:39:48 -04:00
Søren Sandmann Pedersen
5b99710042 Be more paranoid about checking for GTK+
From time to time people 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 more paranoid by

- always using PKG_CHECK_MODULES and not PKG_CHECK_EXISTS, since it
seems PKG_CHECK_EXISTS will sometimes return true even if a dependency
of GTK+, such as pixman-1, is missing.

- explicitly checking that pixman-1 is installed before enabling GTK+.

Cc: my.somewhat.lengthy.loginname@gmail.com
2010-08-24 08:12:20 -04:00
Søren Sandmann Pedersen
5530bcab26 Merge pixman_image_composite32() and do_composite().
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.
2010-08-24 08:12:20 -04:00
Benjamin Otte
a8ea889e5e region: Fix pixman_region_translate() clipping bug
Fixes the region-translate test case by clipping region translations to
the newly defined PIXMAN_REGION_MIN/MAX and using the newly introduced
type overflow_int_t to check for the overflow.
Also uses INT16_MAX or INT32_MAX for these values instead of relying on
the size of short and int types.
2010-08-24 12:17:50 +02:00
Benjamin Otte
4d8fb1bc01 region: Add a new test region-translate
This test exercises a bug in pixman_region32_translate(). The function
clips the region to int16 coordinates SHRT_MIN/SHRT_MAX.
2010-08-24 12:17:18 +02:00
Søren Sandmann Pedersen
5ff359b8a0 Post-release version bump to 0.19.3 2010-08-21 06:39:44 -04:00
Søren Sandmann Pedersen
39308ed3b0 Pre-release version bump to 0.19.2 2010-08-21 06:33:19 -04:00
Søren Sandmann Pedersen
393ccab74e Only try to compute the FAST_SAMPLES_COVER_CLIP for bits images
It doesn't make sense in other cases, and the computation would make
use of image->bits.{width,height} which lead to uninitialized memory
accesses when the image wasn't of type BITS.
2010-08-21 06:29:36 -04:00
Robert Hooker
dbc6d202d7 Bump changelogs. 2010-08-16 10:19:25 -04:00
Robert Hooker
637f4b5907 Merge branch 'upstream-experimental' into debian-experimental 2010-08-16 10:10:53 -04:00
Søren Sandmann Pedersen
97336fad32 Pre-release version bump to 0.18.4 2010-08-16 06:34:53 -04:00
Søren Sandmann Pedersen
da6f33a798 Introduce new FAST_PATH_SAMPLES_OPAQUE flag
This flag is set whenever the pixels of a bits image don't have an
alpha channel. Together with FAST_PATH_SAMPLES_COVER_CLIP it implies
that the image effectively is opaque, so we can do operator reductions
such as OVER->SRC.
2010-08-16 06:28:23 -04:00
Søren Sandmann Pedersen
32509aa4da 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.
2010-08-15 22:42:02 -04:00
Søren Sandmann Pedersen
052c5b819c If we bail out of do_composite, make sure to undo any workarounds.
The workaround for an old X bug has to be undone if we bail from
do_composite, so we can't just return.
2010-08-15 22:41:01 -04:00
Søren Sandmann Pedersen
91cb142177 When storing a g1 pixel, store the lowest bit, rather than comparing with 0. 2010-08-15 22:38:40 -04:00
Søren Sandmann Pedersen
a9a084c85c 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-08-15 22:28:01 -04:00
Søren Sandmann Pedersen
4e5d6f00bf pixman_image_set_alpha_map(): Disallow alpha map cycles
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.
2010-08-15 22:08:16 -04:00
Søren Sandmann Pedersen
9fe7d32c4b Add alpha-loop test program
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.
2010-08-15 21:57:18 -04:00
Siarhei Siamashka
8a5d1be1da ARM: 'neon_combine_out_reverse_u' combiner
This operation was seen in mozilla browser profiling logs.
Implemented so that 'over' and 'out_reverse' operations
now reuse common parts of code.
2010-08-14 14:50:02 +00:00
Siarhei Siamashka
731e9feaa6 Code simplification (no need advancing 'vx' at the end of scanline) 2010-08-14 14:49:54 +00:00
Søren Sandmann Pedersen
41584f8fe1 Store the various bits image fetchers in a table with formats and flags.
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.
2010-08-08 13:57:40 -04:00
Søren Sandmann Pedersen
8e33643f44 Add some new FAST_PATH flags
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

 *  HAS_TRANSFORM, for when the transform is not NULL

Also add some new FAST_PATH_REPEAT_* macros. These are just shorthands
for the image not having any of the other repeat modes. For example
REPEAT_NORMAL is (NO_NONE | NO_PAD | NO_REFLECT).
2010-08-08 13:57:40 -04:00
Søren Sandmann Pedersen
6f62231d15 Remove "_raw_" from all the accessors.
There are no non-raw accessors anymore.
2010-08-08 13:57:40 -04:00
Søren Sandmann Pedersen
807fd3c084 Eliminate the store_scanline_{32,64} function pointers.
Now that we can't recurse on alpha maps, they are not needed anymore.
2010-08-08 13:57:40 -04:00
Søren Sandmann Pedersen
e213d5fd62 Split bits_image_fetch_transformed() into two functions.
One function deals with the common affine, no-alpha-map case. The
other deals with perspective transformations and alpha maps.
2010-08-08 13:57:40 -04:00
Søren Sandmann Pedersen
cbb2a0d792 Eliminate get_pixel_32() and get_pixel_64() from bits_image.
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 access go through the alpha path.
2010-08-08 13:57:40 -04:00
Søren Sandmann Pedersen
6480c92312 Eliminate recursion from alpha map code
Alpha maps with alpha maps are no longer supported. It's not a useful
feature and it could could lead to infinite recursion.
2010-08-08 13:57:40 -04:00
Søren Sandmann Pedersen
1cc750ed92 Replace compute_src_extent_flags() with analyze_extents()
This commit fixes two separate problems: 1. Incorrect computation of
the FAST_PATH_SAMPLES_COVER_CLIP flag, and 2. FAST_PATH_16BIT_SAFE is
a nonsensical thing to compute.

== 1. Incorrect computation of SAMPLES_COVER_CLIP:

Previously we were using pixman_transform_bounds() to compute which
source samples would be used for a composite operation. This is
incorrect for several reasons:

(a) pixman_transform_bounds() is transforming the integer bounding box
of the destination samples, where it should be transforming the
bounding box of the samples themselves. In other words, it is too
pessimistic in some cases.

(b) pixman_transform_bounds() is not rounding the same way as we do
during sampling. For example, for a NEAREST filter we subtract
pixman_fixed_e before rounding off to the nearest sample so that a
transformed value of 1 will round to the sample at 0.5 and not to the
one at 1.5. However, pixman_transform_bounds() would simply truncate
to 1 which would imply that the first sample to be used was the one at
1.5. In other words, it is too optimistic in some cases.

(c) The result of pixman_transform_bounds() does not account for the
interpolation filter applied to the source.

== 2. FAST_PATH_16BIT_SAFE is nonsensical

The FAST_PATH_16BIT_SAFE is a flag that indicates that various
computations can be safely done within a 16.16 fixed-point
variable. It was used by certain fast paths who relied on those
computations succeeding. The problem is that many other compositing
functions were making similar assumptions but not actually requiring
the flag to be set. Notably, all the general compositing functions
simply walk the source region using 16.16 variables. If the
transformation happens to overflow, strange things will happen.

So instead of computing this flag in certain cases, it is better to
simply detect that overflows will happen and not try to composite at
all in that case. This has the advantage that most compositing
functions can be written naturally way.

It does have the disadvantage that we are giving up on some cases that
previously worked, but those are all corner cases where the areas
involved were very close to the limits of the coordinate
system. Relying on these working reliably was always a somewhat
dubious proposition. The most important case that might have worked
previously was untransformed compositing involving images larger than
32 bits. But even in those cases, if you had REPEAT_PAD or
REPEAT_REFLECT turned on, you would hit bits_image_fetch_transformed()
which has the 16 bit limitations.

== Fixes

This patch fixes both problems by introducing a new function called
analyze_extents() that has the responsibility to reject corner cases,
and to compute flags based on the extents.

It does this through a new compute_sample_extents() function that will
compute a conservative (but tight) approximation to the bounding box
of the samples that will actually be needed. By basing the computation
on the positions of the _sample_ locations in the destination, and by
taking the interpolation filter into account, it fixes problem one.

The same function is also used with a one-pixel expanded version of
the destination extents. By checking if the transformed bounding box
will overflow 16.16 fixed point, it fixes problem two.
2010-08-08 13:57:39 -04:00
Søren Sandmann Pedersen
5b289d39cf Extend scaling-crash-test in various ways
This extends scaling-crash-test to test some more things:

- All combinations of NEAREST/BILINEAR/CONVOLUTION filters and
  NORMAL/PAD/REFLECT repeat modes.

- Tests various scale factors very close to 1/7th such that the source
  area is very close to edge of the source image.

- The same things, only with scale factors very close to 1/32767th.

- Enables the commented-out tests for accessing memory outside the
  source buffer.

Also there is now a border around the source buffer which has a
different color than the source buffer itself so that if we sample
outside, it will show up.

Finally, the test now allows the destination buffer to not be changed
at all. This allows pixman to simply bail out in cases where the
transformation too strange.
2010-08-08 13:57:39 -04:00
Søren Sandmann Pedersen
71ff55a3e5 Fix Altivec/OpenBSD patch
As Brad pointed out, I pushed the wrong version of this patch.
2010-08-05 19:00:56 -04:00
Brad Smith
cb50e9cc95 Add support for AltiVec detection for OpenBSD/PowerPC.
Bug 29331.
2010-08-05 12:16:40 -04:00
Søren Sandmann Pedersen
664132128e CODING_STYLE: Delete the stuff about trailing spaces
Also fix various other minor issues.
2010-08-04 09:50:30 -04:00
Søren Sandmann Pedersen
cc9221ce96 If we bail out of do_composite, make sure to undo any workarounds.
The workaround for an old X bug has to be undone if we bail from
do_composite, so we can't just return.
2010-08-04 09:12:05 -04:00
Søren Sandmann Pedersen
b243a66041 Add x14r6g6b6 format to blitters-test 2010-08-04 08:58:51 -04:00
Marek Vasut
d6a7b15424 Add support for 32bpp X14R6G6B6 format.
This format is used on PXA framebuffer with some boards. It uses only 18 bits
from the 32 bit framebuffer to interpret color.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2010-08-04 08:44:24 -04:00
Siarhei Siamashka
226a6df4f9 test: 'scaling-test' updated to provide better coverage
Negative scale factors are now also tested. A small additional
translate transform helps to stress the use of fractional
coordinates better.

Also the number of iterations to run by default increased in order
to compensate increased variety of operations to be tested.
2010-07-27 16:07:34 +03:00
Siarhei Siamashka
af3eeaeb13 test: 'scaling-crash-test' added
This test tries to exploit some corner cases and previously known
bugs in nearest neighbor scaling fast path code, attempting to
crash pixman or cause some other nasty effect.
2010-07-27 16:07:07 +03:00
Søren Sandmann Pedersen
90483fcabb bits: Fix potential divide-by-zero in projective code
If the homogeneous coordinate is 0, just set the coordinates to 0.
2010-07-23 19:16:43 -04:00
Søren Sandmann Pedersen
bf125fbbb7 [sse2] Add sse2_composite_add_n_8()
This shows up when epiphany displays the "ImageTest" on
glimr.rubyforge.org/cake/canvas.html
2010-07-22 07:39:49 -04:00
Søren Sandmann Pedersen
16ae3285e6 [sse2] Add sse2_composite_in_n_8()
This shows up when epiphany displays the "ImageTest" on
glimr.rubyforge.org/cake/canvas.html
2010-07-22 07:39:49 -04:00
Søren Sandmann Pedersen
e0b430a13e [sse2] Add sse2_composite_src_x888_8888()
This operation shows up when Firefox displays
http://dougx.net/plunder/plunder.html
2010-07-22 07:39:49 -04:00
Søren Sandmann Pedersen
16bae83475 [fast] Add fast_composite_src_x888_8888()
This shows up on when Firefox displays http://dougx.net/plunder/plunder.html
2010-07-22 07:39:49 -04:00
M Joonas Pihlaja
9399b1a5af Fix thinko in configure.ac's macro to test linking.
Copy-paste carnage.  Renames save_{cflags,libs,ldflags} to
save_{CFLAGS,LIBS,LDFLAGS}.
2010-07-21 23:52:23 +03:00
M Joonas Pihlaja
5537e51cd0 Avoid trailing slashes on automake install dirs.
The install-sh on a Solaris box couldn't copy with
trailing slashes.
2010-07-21 23:52:23 +03:00
M Joonas Pihlaja
1d9c6fa623 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.
2010-07-21 23:52:23 +03:00
M Joonas Pihlaja
d95ae70604 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.
2010-07-21 23:52:23 +03:00
M Joonas Pihlaja
eb247ac377 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
2010-07-21 23:52:22 +03:00
M Joonas Pihlaja
dbf35f1f27 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.
2010-07-21 23:52:22 +03:00
Søren Sandmann Pedersen
9897bb4eee 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.
2010-07-13 15:46:21 -04:00
Søren Sandmann Pedersen
ce3d9fca73 fast-path: Some formatting fixes
Add spaces before parentheses; fix indentation in the macro.
2010-07-12 09:46:37 -04:00