Commit Graph

1929 Commits

Author SHA1 Message Date
Søren Sandmann Pedersen
d9f80370a4 Rename mmx_composite_add_8888_8_8() to mmx_composite_add_n_8_8(). 2009-08-08 18:50:18 -04:00
Søren Sandmann Pedersen
04619c3636 Fix a couple more alpha==0 vs src==0 bugs in pixman-mmx.c 2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
a075a870fd Make pix_add_mul() in pixman-mmx.c produce exact results.
Previously this routine would compute (x * a + y * b) / 255. Now it
computes (x * a) / 255 + (y * b) / 255, so that the results are
bitwise equivalent to the non-mmx versions.
2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
f7463ffafb Rewrite the two-component arithmetic macros.
Previously they were not bit-for-bit equivalent to the one-component
versions. The new code is also simpler and easier to read because it
factors out some common sub-macros.

The x * a + y * b macro now only uses four multiplications - the
previous version used eight.
2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
04ae08992f Fix a bunch of srca == 0 checks that should be src == 0 in pixman-mmx.c 2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
8bb58a3ce8 Don't run fast paths if the format requires wide compositing.
This could happen because the wide formats would still be considered
solid if the image was 1x1 and repeating.
2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
d937b62238 Fix bug in combine_mask_alpha_ca()
If the mask was 0xffffffff, the source would end up being shifted
twice by A_SHIFT.
2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
0d576b965c Fix another case of changing the solid source.
This time in fast_path_composite_n_8888_8888().
2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
8b82cbb691 Fix incorrect optimization in combine_over_ca().
Previously the code assumed that an alpha of 0 meant that no change
would take place. This is incorrect because an alpha of 0 can happen
as the result of the source having alpha=0, but rgb != 0.
2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
ec8b36f010 Don't change the constant source in fast_composite_over_n_8888_0565. 2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
de8fff746b Fix bugs in combine_over_reverse_ca().
The computation cannot be optimized away when alpha is 0 because that
can happen when the source has alpha zero and rgb non-zero.
2009-08-08 18:50:17 -04:00
Søren Sandmann Pedersen
7b1df41b61 Add a dirty bit to the image struct, and validate before using the image.
This cuts down the number of property_changed calls significantly.
2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
942c4ac282 Add sse2 version of add_n_8888_8888() 2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
23d3820116 Add a fast path for the add_n_8888_8888() operation.
It shows up on gnome-terminal traces.
2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
c606a05213 Move bounds checks for REPEAT_NONE to get_pixel()
On a P4, this is a large speedup for the swfdec-fill-rate-2xaa trace:

After:

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image        swfdec-fill-rate-2xaa   33.061   33.061   0.00%    1/1

Before:

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image        swfdec-fill-rate-2xaa   40.342   40.342   0.00%    1/1

Pixman 0.14.0 produces this:

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image        swfdec-fill-rate-2xaa   36.896   36.896   0.00%    1/1
2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
1bec3e8395 Remove leftover 0xffffffff in repeat() 2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
1b98166b01 Remove unused function 2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
06836d35d2 Misc formatting 2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
7c8959ea3b Change all the fetch_pixels() functions to only fetch one pixel. 2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
31096446b6 Add fetch_pixel_raw_32 and fetch_pixel_32 virtual functions.
By default both are intialized to bits_image_fetch_pixel_raw(), but if
there is an alpha map, then fetch_pixel_32() is set to
bits_image_fetch_pixel_alpha().
2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
a233b332cd Various renamings and clean-ups 2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
073399b09f Change bits_image_fetch_alpha_pixels() to fetch just one pixel. 2009-08-08 16:52:38 -04:00
Søren Sandmann Pedersen
6d1dfc3945 Change bits_image_fetch_pixels_convolution() to fetch just one pixel. 2009-08-08 16:52:37 -04:00
Søren Sandmann Pedersen
b3f849f74f Change bits_image_fetch_bilinear_pixels() to fetch one pixel at a time. 2009-08-08 16:52:37 -04:00
Søren Sandmann Pedersen
a37383a2c6 Make the repeat routine work on only one coordinate at a time. 2009-08-08 16:52:37 -04:00
Søren Sandmann Pedersen
a4f3fd3b25 Make bits_image_fetch_nearest() return one pixel.
Previously it would work on a buffer of coordinates.
2009-08-08 16:52:37 -04:00
Søren Sandmann Pedersen
f382865ebe Change bits_image_fetch_transformed() to work one pixel at a time.
Previously, it would generate a buffer of coordinates, then pass that
off to a pixel fetcher, but this caused a large performance regression
with the swfdec-fill-rate-2xfsaa cairo trace.

This is the first step towards fixing that.
2009-08-08 16:52:37 -04:00
Søren Sandmann Pedersen
4ef2807c3a Only define PIXMAN_TIMERS if timers are actually enabled [bug 23169] 2009-08-07 00:11:20 -04:00
Søren Sandmann Pedersen
9dec2e352b Various updates to the CODING_STYLE document 2009-07-28 09:58:52 -04:00
Søren Sandmann Pedersen
2abd56e9e3 Add a CODING_STYLE document based on the one from cairo. 2009-07-28 04:05:26 -04:00
Søren Sandmann Pedersen
fdd01bcbd4 Remove a couple of unused variables 2009-07-24 05:55:48 -04:00
Søren Sandmann Pedersen
845910c200 Rename source_pict_class_t to source_image_class_t 2009-07-24 05:55:48 -04:00
Søren Sandmann Pedersen
edd476d5be Replace a bunch of 'pict's with 'image' 2009-07-24 05:55:48 -04:00
Chris Wilson
11d888a283 Explain how we can simplify the radial gradient computation
Soeren rightfully complained that I had removed all the comments from
André's patch, most importantly that explain why the transformation is
valid. So add a few details to show that B varies linearly across the
scanline and how we can therefore reduce the per-pixel cost of evaluating
B.
2009-07-24 09:36:08 +01:00
Chris Wilson
20d2df0305 Fix inversion of radial gradients when r2 > r1
Fixes: Bug 22908 -- Invalid output of radial gradient
http://bugs.freedesktop.org/show_bug.cgi?id=22908

We also include a modified patch by André Tupinambá <andrelrt@gmail.com>,
to pull constant expressions out of the inner radial gradient walker.
2009-07-23 19:08:40 +01:00
Benjamin Otte
84b7df0939 Don't warn for empty rectangles, only degenerate ones 2009-07-23 09:54:49 +02:00
Julien Cristau
cb7de5b2f7 Bump shlibs and update symbols file
New pixman_disable_out_of_bounds_workaround API and new formats.
2009-07-21 16:39:02 +02:00
Julien Cristau
044122c11c Update changelogs 2009-07-21 16:23:33 +02:00
Julien Cristau
7df0ced38a Merge commit 'pixman-0.15.18' into debian-experimental 2009-07-21 15:32:27 +02:00
Benjamin Otte
1435c8aa3d Log errors for invalid rectangles passed to region code 2009-07-21 15:00:52 +02:00
Benjamin Otte
1796e6bf17 Simplify code that logs errors 2009-07-21 14:57:59 +02:00
Benjamin Otte
85d56f3f7c Make the text when reporting a broken region more useful 2009-07-21 14:50:30 +02:00
Søren Sandmann Pedersen
a77d4ffeb6 Post-release version bump 2009-07-21 07:24:40 -04:00
Søren Sandmann Pedersen
f3ac136877 Pre-release version bump 2009-07-21 07:20:57 -04:00
Søren Sandmann Pedersen
7c56911e3b Don't assert when malformed regions are detected.
Instead print a message to stderr so that it will end up in the X log
file.
2009-07-21 07:01:10 -04:00
Søren Sandmann Pedersen
f9660ce29e Fix another search and replace issue 2009-07-21 04:23:56 -04:00
Søren Sandmann Pedersen
b3196b6327 Fix search-and-replace issue pointed out by Koen Kooi. 2009-07-21 04:18:35 -04:00
George Yohng
0ff5733c16 Add implementation of MMX __m64 functions for MSVC x64.
Microsoft C++ does not define __m64 and all related MMX functions in
x64.  However, it succeeds in generating object files for SSE2 code
inside pixman.

The real problem happens during linking, when it cannot find MMX functions
(which are not defined as intrinsics for AMD64 platform).

I have implemented those missing functions using general programming.

MMX __m64 is used relatively scarcely within SSE2 implementation, and the
performance impact probably is negligible.

Bug 22390.
2009-07-21 03:43:42 -04:00
Chris Wilson
0b95afd259 Fix read of BITS members from a solid image.
During the fast-path query, the read_func and write_func from the bits
structure are queried for the solid image.

==32723== Conditional jump or move depends on uninitialised value(s)
==32723==    at 0x412AF20: _pixman_run_fast_path (pixman-utils.c:681)
==32723==    by 0x4136319: sse2_composite (pixman-sse2.c:5554)
==32723==    by 0x4100CD2: _pixman_implementation_composite
(pixman-implementation.c:227)
==32723==    by 0x412396E: pixman_image_composite (pixman.c:140)
==32723==    by 0x4123D64: pixman_image_fill_rectangles (pixman.c:322)
==32723==    by 0x40482B7: _cairo_image_surface_fill_rectangles
(cairo-image-surface.c:1180)
==32723==    by 0x4063BE7: _cairo_surface_fill_rectangles
(cairo-surface.c:1883)
==32723==    by 0x4063E38: _cairo_surface_fill_region
(cairo-surface.c:1840)
==32723==    by 0x4067FDC: _clip_and_composite_trapezoids
(cairo-surface-fallback.c:625)
==32723==    by 0x40689C5: _cairo_surface_fallback_paint
(cairo-surface-fallback.c:835)
==32723==    by 0x4065731: _cairo_surface_paint (cairo-surface.c:1923)
==32723==    by 0x4044098: _cairo_gstate_paint (cairo-gstate.c:900)
==32723==  Uninitialised value was created by a heap allocation
==32723==    at 0x402732D: malloc (vg_replace_malloc.c:180)
==32723==    by 0x410099F: _pixman_image_allocate (pixman-image.c:100)
==32723==    by 0x41265B8: pixman_image_create_solid_fill
(pixman-solid-fill.c:75)
==32723==    by 0x4123CE1: pixman_image_fill_rectangles (pixman.c:314)
==32723==    by 0x40482B7: _cairo_image_surface_fill_rectangles
(cairo-image-surface.c:1180)
==32723==    by 0x4063BE7: _cairo_surface_fill_rectangles
(cairo-surface.c:1883)
==32723==    by 0x4063E38: _cairo_surface_fill_region
(cairo-surface.c:1840)
==32723==    by 0x4067FDC: _clip_and_composite_trapezoids
(cairo-surface-fallback.c:625)
==32723==    by 0x40689C5: _cairo_surface_fallback_paint
(cairo-surface-fallback.c:835)
==32723==    by 0x4065731: _cairo_surface_paint (cairo-surface.c:1923)
==32723==    by 0x4044098: _cairo_gstate_paint (cairo-gstate.c:900)
==32723==    by 0x403C10B: cairo_paint (cairo.c:2052)
2009-07-21 07:45:23 +01:00
Søren Sandmann Pedersen
c7b84f8b04 Only apply the workaround if the clip region extends beyond the drawable.
This works because the X server always attempts to set a clip region
within the bounds of the drawable, and it only fails at it when it is
computing the wrong translation and therefore needs the workaround.
2009-07-21 01:27:46 -04:00