Commit Graph

1929 Commits

Author SHA1 Message Date
Julien Cristau
40a04cb1b6 Upload to experimental 2011-10-22 11:09:17 +02:00
Rico Tzschichholz
bdfdaaff5d Bump changelogs. 2011-10-19 17:44:08 +02:00
Rico Tzschichholz
bccb9afc56 Merge branch 'upstream-experimental' into debian-experimental 2011-10-19 17:24:45 +02:00
Søren Sandmann Pedersen
e20ac40bd3 Pre-release version bump to 0.23.6 2011-10-11 06:00:51 -04:00
Taekyun Kim
a43946a51f Simple repeat: Extend too short source scanlines into temporary buffer
Too short scanlines can cause repeat handling overhead and optimized
pixman composite functions usually process a bunch of pixels in a
single loop iteration it might be beneficial to pre-extend source
scanlines. The temporary buffers will usually reside in cache, so
accessing them should be quite efficient.
2011-10-10 12:18:28 +09:00
Taekyun Kim
eaff774a3f Simple repeat fast path
We can implement simple repeat by stitching existing fast path
functions. First lookup COVER_CLIP function for given input and
then stitch horizontally using the function.
2011-10-10 12:18:25 +09:00
Taekyun Kim
a258e33fcb Move _pixman_lookup_composite_function() to pixman-utils.c 2011-10-10 12:18:23 +09:00
Søren Sandmann Pedersen
fc62785aab Add src, mask, and dest flags to the composite args struct.
These flags are useful in the various compositing routines, and the
flags stored in the image structs are missing some bits of information
that can only be computed when pixman_image_composite() is called.
2011-10-10 12:18:21 +09:00
Taekyun Kim
fa6523d13a Add new fast path flag FAST_PATH_BITS_IMAGE
This fast path flag indicate that type of the image is bits image.
2011-10-10 12:18:18 +09:00
Taekyun Kim
7272e2fcd2 init/fini functions for pixman_image_t
pixman_image_t itself can be on stack or heap. So segregating
init/fini from create/unref can be useful when we want to use
pixman_image_t on stack or other memory.
2011-10-10 12:18:14 +09:00
Taekyun Kim
4dcf1b0107 sse2: Bilinear scaled over_8888_8_8888 2011-10-10 12:13:20 +09:00
Taekyun Kim
81050f2784 sse2: Bilinear scaled over_8888_8888 2011-10-10 12:13:17 +09:00
Taekyun Kim
d67c0b883d sse2: Macros for assembling bilinear interpolation code fractions
Primitive bilinear interpolation code is reusable to implement other
bilinear functions.

BILINEAR_DECLARE_VARIABLES
- Declare variables needed to interpolate src pixels.

BILINEAR_INTERPOLATE_ONE_PIXEL
- Interpolate one pixel and advance to next pixel

BILINEAR_SKIP_ONE_PIXEL
- Skip interpolation and just advance to next pixel
  This is useful for skipping zero mask
2011-10-10 12:12:47 +09:00
Matt Turner
741eb8462c Correct the minimum gcc version needed for iwmmxt
Spotted by Søren Sandmann.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-10-06 17:56:09 -04:00
Matt Turner
0a34277180 Make sure iwMMXt is only detected on ARM
iwMMXt is incorrectly detected on x86 and amd64. This happens because
the test uses standard _mm_* intrinsic functions which it compiles with
-march=iwmmxt, but when the user has set CFLAGS=-march=k8 for instance,
no error is generated from -march=iwmmxt, even though it's not a valid
flag on x86/amd64. Passing CFLAGS=-march=native does not override the
-march=iwmmxt flag though, which is why it wasn't noticed before.

So, just #error out in the test if the __arm__ preprocessor directive
isn't defined.

Fixes https://bugs.gentoo.org/show_bug.cgi?id=385179

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-10-06 17:52:12 -04:00
Søren Sandmann Pedersen
879b7c21e4 Don't include stdint.h in scaling-helpers-test.
Fixes bug 41257.
2011-09-28 09:16:23 -04:00
Benjamin Otte
01c2dcbe69 build: replace @VAR@ with $(VAR) in makefiles 2011-09-28 01:48:02 +02:00
Benjamin Otte
100f16eae9 tests: Add PNG_CFLAGS/LIBS to tests
PNG flags were accidentally included by gdk-pixbuf. This has been fixed
recently, so we need to make sure to include it ourselves.
2011-09-28 01:48:01 +02:00
Matt Turner
d1313febbe mmx: optimize unaligned 64-bit ARM/iwmmxt loads
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-27 13:13:22 -04:00
Matt Turner
7ab94c5f99 mmx: compile on ARM for iwmmxt optimizations
Check in configure for at least gcc-4.6, since gcc-4.7 (and hopefully
4.6) will be the eariest version capable of compiling the _mm_*
intrinsics on ARM/iwmmxt. Even for suitable compile versions I use
_mm_srli_si64 which is known to cause unpatched compilers to fail.

Select iwmmxt at runtime only after NEON, since we expect the NEON
optimizations to be more capable and faster than iwmmxt.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-27 13:13:15 -04:00
Matt Turner
f66887d9ea mmx: prepare pixman-mmx.c to be compiled for ARM/iwmmxt
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-27 13:13:07 -04:00
Matt Turner
7c6d5d1999 mmx: fix unaligned accesses
Simply return *p in the unaligned access functions, since alignment
constraints are very relaxed on x86 and this allows us to generate
identical code as before.

Tested with the test suite, lowlevel-blit-test, and cairo-perf-trace on
ARM and Alpha with no unaligned accesses found.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-27 13:13:01 -04:00
Matt Turner
5d98abb14c mmx: wrap x86/MMX inline assembly in ifdef USE_X86_MMX
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-27 13:12:55 -04:00
Matt Turner
02c1f1a022 mmx: rename USE_MMX to USE_X86_MMX
This will make upcoming ARM usage of pixman-mmx.c unambiguous.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-27 13:12:50 -04:00
Matt Turner
57fd8c37aa mmx: convert while (w) to if (w) when possible
gcc isn't able to see that w is no greater than 1, so it generates
unnecessary loop instructions with while (w).

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-26 11:30:05 -04:00
Matt Turner
38a7aae1d9 mmx: fix formats in commented code
b8r8g8 is apparently no longer supported sometime since this code was
commented.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-26 11:29:58 -04:00
Matt Turner
b6b77488a0 lowlevel-blt: add over_x888_8_8888
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-26 11:29:51 -04:00
Siarhei Siamashka
9126f36b96 BILINEAR->NEAREST filter optimization for simple rotation and translation
Simple rotation and translation are the additional cases when BILINEAR
filter can be safely reduced to NEAREST.
2011-09-21 18:55:25 -04:00
Søren Sandmann Pedersen
ad5c6bbb36 Strength-reduce BILINEAR filter to NEAREST filter for identity transforms
An image with a bilinear filter and an identity transform is
equivalent to one with a nearest filter, so there is no reason the
standard fast paths shouldn't be usable.

But because a BILINEAR filter samples a 2x2 pixel block in the source
image, FAST_PATH_SAMPLES_COVER_CLIP can't be set in the case where the
source area is the entire image, because some compositing operations
might then read pixels outside the image.

This patch fixes the problem by splitting the
FAST_PATH_SAMPLES_COVER_CLIP flag into two separate flags
FAST_PATH_SAMPLES_COVER_CLIP_NEAREST and
FAST_PATH_SAMPLES_COVER_CLIP_BILINEAR that indicate that the clip
covers the samples taking into account NEAREST/BILINEAR filters
respectively.

All the existing compositing operations that require
FAST_PATH_SAMPLES_COVER_CLIP then have their flags modified to pick
either COVER_CLIP_NEAREST or COVER_CLIP_BILINEAR depending on which
filter they depend on.

In compute_image_info() both COVER_CILP_NEAREST and
COVER_CLIP_BILINEAR can be set depending on how much room there is
around the clip rectangle.

Finally, images with an identity transform and a bilinear filter get
FAST_PATH_NEAREST_FILTER set as well as FAST_PATH_BILINEAR_FILTER.

Performance measurementas with render_bench against Xephyr:

Before

*** ROUND 1 ***
---------------------------------------------------------------
Test: Test Xrender doing non-scaled Over blends
Time: 5.720 sec.
---------------------------------------------------------------
Test: Test Xrender (offscreen) doing non-scaled Over blends
Time: 5.149 sec.
---------------------------------------------------------------
Test: Test Imlib2 doing non-scaled Over blends
Time: 6.237 sec.

After:

*** ROUND 1 ***
---------------------------------------------------------------
Test: Test Xrender doing non-scaled Over blends
Time: 4.947 sec.
---------------------------------------------------------------
Test: Test Xrender (offscreen) doing non-scaled Over blends
Time: 4.487 sec.
---------------------------------------------------------------
Test: Test Imlib2 doing non-scaled Over blends
Time: 6.235 sec.
2011-09-21 18:55:25 -04:00
Søren Sandmann Pedersen
eb2e7ed81b test: Occasionally use a BILINEAR filter in blitters-test
To test that reductions of BILINEAR->NEAREST for identity
transformations happen correctly, occasionally use a bilinear filter
in blitters test.
2011-09-21 18:55:25 -04:00
Siarhei Siamashka
2a9f88430e test: better coverage for BILINEAR->NEAREST filter optimization
The upcoming optimization which is going to be able to replace BILINEAR filter
with NEAREST where appropriate needs to analyze the transformation matrix
and not to make any mistakes.

The changes to affine-test include:
1. Higher chance of using the same scale factor for x and y axes. This can help
   to stress some special cases (for example the case when both x and y scale
   factors are integer). The same applies to x/y translation.
2. Introduced a small chance for "corrupting" transformation matrix by flipping
   random bits. This supposedly can help to identify the cases when some of the
   fast paths or other code logic is wrongly activated due to insufficient checks.
2011-09-21 18:55:10 -04:00
Søren Sandmann Pedersen
054922e2fc Eliminate compute_sample_extents() function
In analyze_extents(), instead of calling compute_sample_extents() call
compute_transformed_extents() and inline the remaining part of
compute_sample_extents(). The upcoming bilinear->nearest optimization
will do something different with these two pieces of code.
2011-09-21 18:53:03 -04:00
Søren Sandmann Pedersen
577b6c46fd Split computation of sample area into own function
compute_sample_extents() have two parts: one that computes the
transformed extents, and one that checks whether the computed extents
fit within the 16.16 coordinate space.

Split the first part into its own function
compute_transformed_extents().
2011-09-21 18:52:18 -04:00
Søren Sandmann Pedersen
5064f18031 Remove x and y coordinates from analyze_extents() and compute_sample_extents()
These coordinates were only ever used for subtracting from the extents
box to put it into the coordinate space of the image, so we might as
well do this coordinate translation only once before entering the
functions.
2011-09-21 18:48:55 -04:00
Søren Sandmann Pedersen
dbcb4af60d Use MAKE_ACCESSORS() to generate accessors for paletted formats
Add support in convert_pixel_from_a8r8g8b8() and
convert_pixel_to_a8r8g8b8() for conversion to/from paletted formats,
then use MAKE_ACCESSORS() to generate accessors for the indexed
formats: c8, g8, g4, c4, g1
2011-09-20 06:44:05 -04:00
Søren Sandmann Pedersen
c82c2c3853 Use MAKE_ACCESSORS() to generate accessors for the a1 format.
Add FETCH_1 and STORE_1 macros and use them to add support for 1bpp
pixels to fetch_and_convert_pixel() and convert_and_store_pixel(),
then use MAKE_ACCESSORS() to generate the accessors for the a1
format. (Not the g1 format as it is indexed).
2011-09-20 06:44:05 -04:00
Søren Sandmann Pedersen
2114dd8aa1 Use MAKE_ACCESSORS() to generate accessors for 24bpp formats
Add FETCH_24 and STORE_24 macros and use them to add support for 24bpp
pixels in fetch_and_convert_pixel() and
convert_and_store_pixel(). Then use MAKE_ACCESSORS() to generate
accessors for the 24 bpp formats:

    r8g8b8
    b8g8r8
2011-09-20 06:44:05 -04:00
Søren Sandmann Pedersen
f19f5daa1b Use MAKE_ACCESSORS() to generate accessors for 4 bpp RGB formats
Use FETCH_4 and STORE_4 macros to add support for 4bpp pixels to
fetch_and_convert_pixel() and convert_and_store_pixel(), then use
MAKE_ACCESSORS() to generate accessors for 4 bpp formats, except g4 and
c4 which are indexed:

    a4
    r1g2b1
    b1g2r1
    a1r1g1b1
    a1b1g1r1
2011-09-20 06:44:04 -04:00
Søren Sandmann Pedersen
af78fe24e4 Use MAKE_ACCESSORS() to generate accessors for 8bpp RGB formats
Add support for 8 bpp formats to fetch_and_convert_pixel() and
convert_and_store_pixel(), then use MAKE_ACCESSORS() to generate the
accessors for all the 8 bpp formats, except g8 and c8, which are
indexed:

    a8
    r3g3b2
    b2g3r3
    a2r2g2b2
    a2b2g2r2
    x4a4
2011-09-20 06:44:04 -04:00
Søren Sandmann Pedersen
5e1b9f8975 Use MAKE_ACCESSORS() to generate accessors for all the 16bpp formats
Add support for 16bpp pixels to fetch_and_convert_pixel() and
convert_and_store_pixel(), then use MAKE_ACCESSORS() to generate
accessors for all the 16bpp formats:

    r5g6b5
    b5g6r5
    a1r5g5b5
    x1r5g5b5
    a1b5g5r5
    x1b5g5r5
    a4r4g4b4
    x4r4g4b4
    a4b4g4r4
    x4b4g4r4
2011-09-20 06:44:04 -04:00
Søren Sandmann Pedersen
a77597bcb8 Use MAKE_ACCESSORS() to generate all the 32 bit accessors
Add support for 32bpp formats in fetch_and_convert_pixel() and
convert_and_store_pixel(), then use MAKE_ACCESSORS() to generate
accessors for all the 32 bpp formats:

    a8r8g8b8
    x8r8g8b8
    a8b8g8r8
    x8b8g8r8
    x14r6g6b6
    b8g8r8a8
    b8g8r8x8
    r8g8b8x8
    r8g8b8a8
2011-09-20 06:44:04 -04:00
Søren Sandmann Pedersen
814af33df3 Add initial version of the MAKE_ACCESSORS() macro
This macro will eventually allow the fetchers and storers to be
generated automatically. For now, it's just a skeleton that doesn't
actually do anything.
2011-09-20 06:44:04 -04:00
Søren Sandmann Pedersen
5cae7a3fe6 Add general pixel converter
This function can convert between any <= 32 bpp formats. Nothing uses
it yet.
2011-09-20 06:44:04 -04:00
Søren Sandmann Pedersen
22f54dde6b Add a generic unorm_to_unorm() conversion utility
This function can convert between normalized numbers of different
depths. When converting to higher bit depths, it will replicate the
existing bits, when converting to lower bit depths, it will simply
truncate.

This function replaces the expand16() function in pixman-utils.c
2011-09-20 06:44:04 -04:00
Søren Sandmann Pedersen
d842669a46 A few tweaks to a comment in pixman-combine.c.template
Include a link to

	http://marc.info/?l=xfree-render&m=99792000027857&w=2

where Keith explains how the disjoint/conjoint operators work.
2011-09-19 09:08:33 -04:00
Jon TURNEY
3432e1a344 Fix build on cygwin after commit efdf65c0c4
libutils depends on pixman and so needs to preceed it in the link order

Found by tinderbox, see [1]

[1] http://tinderbox.freedesktop.org/builds/2011-09-15-0005/logs/pixman/#build

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
2011-09-19 06:17:58 -04:00
Søren Sandmann Pedersen
f9faf4df44 test: Use smaller boxes in region_contains_test()
The boxes used region_contains_test() sometimes overflow causing

    *** BUG ***
    In pixman_region32_union_rect: Invalid rectangle passed
    Set a breakpoint on '_pixman_log_error' to debug

messages to be printed when pixman is compiled with DEBUG. Fix this by
dividing the x, y, w, h coordinates by 4 to prevent overflows.
2011-09-19 06:15:14 -04:00
Andrea Canciani
9623b478f7 build-win32: Add 'check' target
On win32 the tests are built but they are not run automatically by the
build system.

A minimal 'check' target (depending on the tests being built) can
simply run them and log to the console their success/failure.
2011-09-14 07:03:35 -07:00
Andrea Canciani
479d094485 test: Do not include config.h unless HAVE_CONFIG_H is defined
The win32 build system does not generate config.h and correctly runs
the compiler without defining HAVE_CONFIG_H. Nevertheless some files
include config.h without checking for its availability, breaking the
build from a clean directory:

test\utils.h(2) : fatal error C1083: Cannot open include file:
'config.h': No such file or directory
...
2011-09-14 07:03:35 -07:00
Andrea Canciani
d46a9f3ace build-win32: Add root Makefile.win32
Add Makefile.win32 to the pixman root. This makefile can recursively
run the other ones to compile the library or the test suite.
2011-09-14 07:03:35 -07:00