Commit Graph

1757 Commits

Author SHA1 Message Date
Søren Sandmann Pedersen
f534509d00 Change operator table to be an array of arrays of four bytes.
This makes gcc generate slightly better code for optimize_operator.
2010-03-14 12:11:48 -04:00
Søren Sandmann Pedersen
94d75ebd21 Strength reduce certain conjoint/disjoint to their normal counterparts.
This allows us to not test for them later on.
2010-03-14 12:11:47 -04:00
Søren Sandmann Pedersen
58be9c71d2 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.
2010-03-14 12:11:47 -04:00
Søren Sandmann Pedersen
7fe35f0e6b 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.
2010-03-14 12:11:47 -04:00
Loïc Minier
18f0de452d ARM: SIMD: Try without any CFLAGS before forcing -mcpu=
http://bugs.launchpad.net/bugs/535183
2010-03-14 13:15:34 +02:00
Egor Starkov
9335408613 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>
2010-03-12 10:50:18 -05:00
Søren Sandmann Pedersen
54e39e0038 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.
2010-03-06 11:58:02 -05:00
Søren Sandmann Pedersen
84b009ae9f Post-release version bump to 0.17.11 2010-03-05 20:40:41 -05:00
Søren Sandmann Pedersen
14fd287efb Pre-release version bump to 0.17.10 2010-03-05 20:06:08 -05:00
Søren Sandmann Pedersen
bd9934551f Move __force_align_arg_pointer workaround before composite32()
Since otherwise the workaround won't take effect when you call
pixman_image_composite32() directly.
2010-03-04 04:15:44 -05:00
Søren Sandmann Pedersen
14bb054d96 Merge branch 'more-flags' 2010-03-04 02:30:22 -05:00
Søren Sandmann Pedersen
9a8e404d44 test: Remove obsolete comment 2010-03-03 13:37:20 -05:00
Siarhei Siamashka
182e4c2635 ARM: added 'neon_composite_over_reverse_n_8888' fast path
This fast path function improves performance of 'poppler' cairo-perf trace.

Benchmark from ARM Cortex-A8 @720MHz

before:

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image                      poppler   38.986   39.158   0.23%    6/6

after:

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image                      poppler   24.981   25.136   0.28%    6/6
2010-03-03 19:43:00 +02:00
Siarhei Siamashka
072a7d31a8 ARM: added 'neon_composite_src_x888_8888' fast path
This fast path function improves performance of 'gnome-system-monitor'
cairo-perf trace.

Benchmark from ARM Cortex-A8 @720MHz

before:

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image         gnome-system-monitor   68.838   68.899   0.05%    5/6

after:

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image         gnome-system-monitor   53.336   53.384   0.09%    6/6
2010-03-03 19:42:34 +02:00
Siarhei Siamashka
2ed7c13922 ARM: added 'neon_composite_over_n_8888_8888_ca' fast path
This fast path function improves performance of 'firefox-talos-gfx'
cairo-perf trace.

Benchmark from ARM Cortex-A8 @720MHz

before:

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image            firefox-talos-gfx  139.969  141.176   0.35%    6/6

after:

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]    image            firefox-talos-gfx  111.810  112.196   0.23%    6/6
2010-03-03 19:42:29 +02:00
Søren Sandmann Pedersen
3db76b9004 Restructure the flags computation in compute_image_info().
Restructure the code to use switches instead of ifs. This saves a few
comparisons and make the code slightly easier to follow. Also add some
comments.
2010-02-24 23:23:52 -05:00
Søren Sandmann Pedersen
ac44db3340 Move workaround code to pixman-image.c
It is more natural to put it where all the other flags are computed.
2010-02-24 23:20:28 -05:00
Søren Sandmann Pedersen
35af45d5e3 Turn need_workaround into another flag.
Instead of storing it as a boolean in the image struct, just use
another flag for it.
2010-02-24 23:20:28 -05:00
Søren Sandmann Pedersen
f27f17ce22 Eliminate _pixman_image_is_opaque() in favor of a new FAST_PATH_IS_OPAQUE flag
The new FAST_PATH_IS_OPAQUE flag is computed along with the others in
_pixman_image_validate().
2010-02-24 23:20:27 -05:00
Søren Sandmann Pedersen
2a6ba862ab Eliminate _pixman_image_is_solid()
Instead of calling this function in compute_image_info(), just do the
relevant checks when the extended format is computed.

Move computation of solidness to validate
2010-02-24 23:20:27 -05:00
Søren Sandmann Pedersen
45006e5e64 Move computation of extended format code to validate.
Instead of computing the extended format on every composite, just
compute it once and store it in the image.
2010-02-24 23:20:27 -05:00
Søren Sandmann Pedersen
fb0096a282 Add new FAST_PATH_SIMPLE_REPEAT flag
This flags indicates that the image is untransformed an
repeating. Such images can be composited quickly by simply repeating
the composite operation.
2010-02-24 23:20:27 -05:00
Søren Sandmann Pedersen
a7ad9c7c9d Compute the image flags at validation time instead of composite time
Instead of computing all the image flags at composite time, we compute
them once in _pixman_image_validate() and cache them in the image.
2010-02-24 23:20:27 -05:00
Søren Sandmann Pedersen
7bc4cd42c3 RELEASING: Update the release instructions. 2010-02-24 22:10:24 -05:00
Søren Sandmann Pedersen
7392a350f2 Post-release version bump 2010-02-24 22:02:13 -05:00
Søren Sandmann Pedersen
4d1c216af3 Pre-release version bump 2010-02-24 21:52:30 -05:00
Søren Sandmann Pedersen
e0f1d84107 Merge branch 'trap-fixes' 2010-02-24 21:01:29 -05:00
Søren Sandmann Pedersen
16ef3ab230 Add a1-trap-test
When a trapezoid sample point is exactly on a polygon edge, the rule
is that it is considered inside the trapezoid if the edge is a top or
left edge, but outside for bottom and right edges.

This program tests that for a1 trapezoids.
2010-02-24 21:01:24 -05:00
Søren Sandmann Pedersen
ad5cbba4c0 Hide the C++ extern "C" declarations behind macros.
That way they don't confuse the indenting algorithm in editors such as
Emacs.
2010-02-21 02:07:32 -05:00
Søren Sandmann Pedersen
14f201dc47 Merge branch 'eliminate-composite'
Conflicts:
	pixman/pixman-sse2.c
2010-02-20 13:09:01 -05:00
Søren Sandmann Pedersen
94f585916a Move all code to do debugging spew into pixman-private.
Rather than the region code having its own little debug system, move
all of it into pixman-private where there is already return_if_fail()
macros etc. These macros are now enabled in development snapshots and
nowhere else. Previously they were never enabled unless you modified
the code.

At the same time, remove all the asserts from the region code since we
can never turn them on anyway, and replace them with
critical_if_fail() macros that will print spew to standard error when
DEBUG is defined.

Finally, also change the debugging spew in pixman-bits-image.c to use
return_val_if_fail() instead of its own fprintf().
2010-02-20 11:57:58 -05:00
Alexander Larsson
f32d585069 Test pixman_region32_init_from_image in region-test 2010-02-19 11:25:41 +01:00
Alexander Larsson
48ef4befd8 Add pixman_region{32}_init_from_image
This creates a region from an image in PIXMAN_a1 format.
2010-02-19 11:25:41 +01:00
Alexander Larsson
5dee05fcab Move SCREEN_SHIFT_LEFT/RIGHT to pixman-private.h
This is needed for later use in other code.
2010-02-19 11:25:41 +01:00
Makoto Kato
61f4ed9c7a Compile by USE_SSE2 only without USE_MMX
Although we added MMX emulation for Microsoft Visual C++ compiler for x64,
USE_SSE2 still requires USE_MMX.  So we remove dependency of USE_MMX
for Windows x64.

Signed-off-by: Makoto Kato <m_kato@ga2.so-net.ne.jp>
2010-02-18 13:09:08 -05:00
Søren Sandmann Pedersen
6b2da683de Move NULL check out of get_image_info()
The NULL check is only necessary for masks, so there is no reason to
do it for destinations and sources.
2010-02-14 21:45:25 -05:00
Søren Sandmann Pedersen
1dd8744f40 Add a fast path for non-repeating sources in walk_region_internal().
In the common case where there is no repeating, the loop in
walk_region_internal() reduces to just walking of the boxes involved
and calling the composite function.
2010-02-14 21:45:25 -05:00
Søren Sandmann Pedersen
362a9f564a Move more things out of the inner loop in do_composite().
Specifically,

- the src_ and mask_repeat computations

- the check for whether the involved images cover the composite
  region.
2010-02-14 21:45:25 -05:00
Søren Sandmann Pedersen
129d9c1871 Move region computation out of the loop in do_composite()
We only need to compute the composite region once, not on every
iteration.
2010-02-14 21:45:25 -05:00
Søren Sandmann Pedersen
4c185503d2 Move get_image_info() out of the loop in do_composite
The computation of image formats and flags is invariant to the loop,
so it can all be moved out.
2010-02-14 21:45:13 -05:00
Søren Sandmann Pedersen
81b7d7b180 Manually inline _pixman_run_fast_path()
Move all of the code into do_composite().
2010-02-14 21:15:48 -05:00
Søren Sandmann Pedersen
e914cccb24 Move compositing functionality from pixman-utils.c into pixman.c
_pixman_run_fast_path() and pixman_compute_composite_region() are both
moved to pixman-image, since at this point that's the only place they
are being called from.
2010-02-14 20:43:25 -05:00
Søren Sandmann Pedersen
0eeb197599 Move compositing to its own function, do_composite() 2010-02-14 11:12:41 -05:00
Søren Sandmann Pedersen
f831552bce Optimize for the common case wrt. the workaround.
In the common case no images need the workaround, so we check for that
first, and only if an image does need a workaround do we check which
one of the images actually need it.
2010-02-14 11:12:41 -05:00
Søren Sandmann Pedersen
fa4df6225d Eliminate all the composite methods.
They are no longer necessary because we will just walk the fast path
tables, and the general composite path is treated as another fast
path.

This unfortunately means that sse2_composite() can no longer be
responsible for realigning the stack to 16 bytes, so we have to move
that to pixman_image_composite().
2010-02-14 11:12:38 -05:00
Søren Sandmann Pedersen
c3d7b51255 Delete unused _pixman_walk_composite_region() function 2010-02-14 11:12:20 -05:00
Søren Sandmann Pedersen
488480301c Don't call _pixman_implementation_composite() anymore.
Instead just call _pixman_run_fast_path(). Since we view
general_composite() as a fast path now, we know that it will find
*some* compositing routine.
2010-02-14 11:12:20 -05:00
Søren Sandmann Pedersen
06ae5ed597 Delete unused sources_cover() function 2010-02-14 11:12:20 -05:00
Søren Sandmann Pedersen
543a04a3bb Store a pointer to the array of fast paths in the implementation struct.
Also add an empty fast path table to the vmx implementation, so that
we can assume sure the pointer is never NULL.
2010-02-14 11:12:16 -05:00
Søren Sandmann Pedersen
376f2a3f85 Make fast_composite_scaled_nearest() another fast path.
This requires another couple of flags

     FAST_PATH_SCALE_TRANSFORM
     FAST_PATH_NEAREST_FILTER
2010-02-14 11:10:39 -05:00