[Pixman] [PATCH 03/18] Eliminate the _pixman_image_store_scanline_32/64 functions.

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen They were only called from next_line_write_narrow/wide, so they could simply be absorbed into those functions. --- pixman/pixman-bits-image.c | 79 pixman/pixman-private.h| 17 - 2 files changed, 36

[Pixman] [PATCH 06/18] Add _pixman_radial_gradient_iter_init() and call it from pixman-general.c

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-general.c |5 + pixman/pixman-private.h | 11 +++ pixman/pixman-radial-gradient.c | 34 ++ 3 files changed, 50 insertions(+), 0 deletions(-) diff --git a/pixman/pixman-general.c

[Pixman] [PATCH 07/18] Add _pixman_conical_gradient_iter_init() and call it from pixman-general.c

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen Also get rid of the remaining iter initialization in pixman-general.c. By now, all image types have iter initializers of their own. --- pixman/pixman-conical-gradient.c | 34 ++ pixman/pixman-general.c | 30

[Pixman] [PATCH 01/18] Add iterators in the general implementation

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen We add a new structure called a pixman_iter_t that encapsulates the information required to read scanlines from an image. It contains two functions, get_scanline() and next_line(), where get_scanline() will generate pixels for the current scanline, and next_line

[Pixman] [PATCH 08/18] Virtualize iterator initialization

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen Make iter_init() a virtual method in the implementation struct. This allows individual implementations to plug in their own CPU specific scanline fetchers. --- pixman/pixman-general.c| 42 ++-- pixman/pixman

[Pixman] [PATCH 09/18] Use iterators in pixman_image_get_solid().

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen This is a step towards getting rid of the _pixman_image_get_scanline_32/64() functions. --- pixman/pixman-arm-common.h |9 ++--- pixman/pixman-fast-path.c | 22 +++--- pixman/pixman-image.c | 12 +--- pixman/pixman-mmx.c

[Pixman] [PATCH 10/18] Move get_scanline_32/64 to the bits part of the image struct.

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen At this point these functions are basically a cache that the bits image uses for its fetchers, so they can be moved to the bits image. With the scanline getters only being initialized in the bits image, the _pixman_image_get_scanline_generic_64 can be moved to

[Pixman] [PATCH 0/18] Add iterators to images

2011-01-05 Thread Søren Sandmann
The following patch series changes the scanline access to be based on iterators instead of direct calls to virtual functions. There are several benefits to this: - Since destination iterators are different from source iterators, we can fix the bug we have currently, where destination transformat

[Pixman] [PATCH 02/18] Move initialization of iterators for bits images to pixman-bits-image.c

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen pixman_iter_t is now defined in pixman-private.h, and iterators for bits images are being. The function next_line_regular() is needed in both pixman-general.c and pixman-bits-image.c, so rename it to _pixman_iter_next_line_regular() and move it to pixman-utils

[Pixman] [PATCH 04/18] Add _pixman_linear_gradient_iter_init().

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen Call it from pixman-general.c to initialize linear gradient iterators. --- pixman/pixman-general.c |5 pixman/pixman-linear-gradient.c | 43 +++ pixman/pixman-private.h |5 3 files changed, 53

[Pixman] [PATCH 05/18] Add _pixman_solid_fill_iter_init() and call it from pixman-general.c

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen Also move next_line_noop() to pixman-utils.c since it is used in both pixman-solid-fill.c and pixman-general.c --- pixman/pixman-general.c| 12 ++-- pixman/pixman-private.h| 12 pixman/pixman-solid-fill.c | 21

[Pixman] [PATCH 17/18] Turn on testing for destination transformation

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- test/alphamap.c | 11 --- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/test/alphamap.c b/test/alphamap.c index 9fb8969..554b309 100644 --- a/test/alphamap.c +++ b/test/alphamap.c @@ -165,20 +165,17 @@ run_test (int s, int d, int sa

[Pixman] [PATCH 11/18] Allow NULL property_changed function.

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen Initialize the field to NULL, and then delete the empty functions from the solid, linear, radial, and conical images. --- pixman/pixman-conical-gradient.c |7 --- pixman/pixman-image.c|4 +++- pixman/pixman-linear-gradient.c |6

[Pixman] [PATCH 13/18] Linear: Optimize for horizontal gradients.

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen If the gradient is horizontal, we can reuse the same scanline over and over. Add support for this optimization to _pixman_linear_gradient_iter_init().; --- pixman/pixman-linear-gradient.c | 22 ++ 1 files changed, 18 insertions(+), 4 deletions

[Pixman] [PATCH 12/18] Consolidate the various get_scanline_32() into get_scanline_narrow().

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen The separate get_scanline_32() functions in solid, linear, radial and conical images are no longer necessary because all access to these images now go through iterators. --- pixman/pixman-conical-gradient.c | 25 +++ pixman/pixman-linear

[Pixman] [PATCH 15/18] Add direct-write optimization back

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen Introduce a new ITER_LOCALIZED_ALPHA flag that indicates that the alpha value computed is used only for the alpha channel of the output; it doesn't affect the RGB channels. Then in pixman-bits-image.c, if a destination is either a8r8g8b8 or x8r8g8b8 with loca

[Pixman] [PATCH 14/18] Get rid of the classify methods.

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen They are not used anymore, and the linear gradient is now doing the optimization in a different way. --- pixman/pixman-image.c | 14 -- pixman/pixman-linear-gradient.c | 28 +--- pixman/pixman-private.h

[Pixman] [PATCH 16/18] Skip fetching pixels when possible

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen Add two new iterator flags, ITER_IGNORE_ALPHA and ITER_IGNORE_RGB that are set when the alpha and rgb values are not needed. If both are set, then we can skip fetching entirely and just use _pixman_iter_get_scanline_noop. --- pixman/pixman-bits-image.c | 11

[Pixman] [PATCH 18/18] Fix destination fetching.

2011-01-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen When fetching from destinations, we need to ignore transformations, repeat and filtering. Currently we don't ignore them, which means all kinds of bad things can happen. This bug fixes this problem by separating the concepts of source and destination ite

[Pixman] [PATCH 01/15] Add iterators in the general implementation

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen We add a new structure called a pixman_iter_t that encapsulates the information required to read scanlines from an image. It contains two functions, get_scanline() and write_back(). The get_scanline() function will generate pixels for the current scanline. For

[Pixman] [PATCH 03/15] Eliminate the _pixman_image_store_scanline_32/64 functions.

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen They were only called from next_line_write_narrow/wide, so they could simply be absorbed into those functions. --- pixman/pixman-bits-image.c | 79 pixman/pixman-private.h| 17 - 2 files changed, 36

[Pixman] [PATCH 04/15] Call the scanline generators directly instead.

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen Instead of calling _pixman_image_get_scanline32/64(), move the iterator initialization to the respective image files and call the scanline generators directly. --- pixman/pixman-conical-gradient.c | 33 pixman/pixman-general.c

[Pixman] [PATCH 05/15] Virtualize iterator initialization

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen Make src_iter_init() and dest_iter_init() virtual methods in the implementation struct. This allows individual implementations to plug in their own CPU specific scanline fetchers. --- pixman/pixman-general.c| 52 +++ pixman/pixman

[Pixman] [PATCH 09/15] Consolidate the various get_scanline_32() into get_scanline_narrow().

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen The separate get_scanline_32() functions in solid, linear, radial and conical images are no longer necessary because all access to these images now go through iterators. --- pixman/pixman-conical-gradient.c | 25 +++ pixman/pixman-linear

[Pixman] [PATCH 10/15] Linear: Optimize for horizontal gradients.

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen If the gradient is horizontal, we can reuse the same scanline over and over. Add support for this optimization to _pixman_linear_gradient_iter_init().; --- pixman/pixman-linear-gradient.c | 19 --- 1 files changed, 16 insertions(+), 3 deletions

[Pixman] [PATCH 06/15] Use an iterator in pixman_image_get_solid().

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen This is a step towards getting rid of the _pixman_image_get_scanline_32/64() functions. --- pixman/pixman-arm-common.h |9 ++--- pixman/pixman-fast-path.c | 22 +++--- pixman/pixman-image.c | 12 +--- pixman/pixman-mmx.c

[Pixman] [PATCH 08/15] Allow NULL property_changed function.

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen Initialize the field to NULL, and then delete the empty functions from the solid, linear, radial, and conical images. --- pixman/pixman-conical-gradient.c |7 --- pixman/pixman-image.c|4 +++- pixman/pixman-linear-gradient.c |6

[Pixman] [PATCH 02/15] Move initialization of iterators for bits images to pixman-bits-image.c

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen pixman_iter_t is now defined in pixman-private.h, and iterators for bits images are being initialized in pixman-bits-image.c --- pixman/pixman-bits-image.c | 80 pixman/pixman-general.c| 69

[Pixman] [PATCH 11/15] Get rid of the classify methods.

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen They are not used anymore, and the linear gradient is now doing the optimization in a different way. --- pixman/pixman-image.c | 14 -- pixman/pixman-linear-gradient.c | 27 +++ pixman/pixman-private.h

[Pixman] [PATCH 07/15] Move get_scanline_32/64 to the bits part of the image struct.

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen At this point these functions are basically a cache that the bits image uses for its fetchers, so they can be moved to the bits image. With the scanline getters only being initialized in the bits image, the _pixman_image_get_scanline_generic_64 can be moved to

[Pixman] [PATCH 12/15] Add direct-write optimization back

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen Introduce a new ITER_LOCALIZED_ALPHA flag that indicates that the alpha value computed is used only for the alpha channel of the output; it doesn't affect the RGB channels. Then in pixman-bits-image.c, if a destination is either a8r8g8b8 or x8r8g8b8 with loca

[Pixman] [PATCH 13/15] Skip fetching pixels when possible

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen Add two new iterator flags, ITER_IGNORE_ALPHA and ITER_IGNORE_RGB that are set when the alpha and rgb values are not needed. If both are set, then we can skip fetching entirely and just use _pixman_iter_get_scanline_noop. --- pixman/pixman-bits-image.c | 11

[Pixman] [PATCH 14/15] Turn on testing for destination transformation

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- test/alphamap.c | 11 --- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/test/alphamap.c b/test/alphamap.c index 9fb8969..554b309 100644 --- a/test/alphamap.c +++ b/test/alphamap.c @@ -165,20 +165,17 @@ run_test (int s, int d, int sa

[Pixman] [PATCH 15/15] Fix destination fetching.

2011-01-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen When fetching from destinations, we need to ignore transformations, repeat and filtering. Currently we don't ignore them, which means all kinds of bad things can happen. This bug fixes this problem by directly calling the scanline fetchers for destinations in

[Pixman] [PATCH 1/1] Fix dangling-pointer bug in bits_image_fetch_bilinear_no_repeat_8888().

2011-01-17 Thread Søren Sandmann
From: Søren Sandmann Pedersen The mask_bits variable is only declared in a limited scope, so the pointer to it becomes invalid instantly. Somehow this didn't actually trigger any bugs, but Brent Fulgham reported that Bounds Checker was complaining about it. Fix the bug by moving mask_bi

[Pixman] [PATCH] Print a warning when a development snapshot is being configured.

2011-01-21 Thread Søren Sandmann
From: Søren Sandmann Pedersen It seems to be relatively common for people to use development snapshots of pixman thinking they are ordinary releases. This patch makes it such that if the current minor version is odd, configure will print a banner explaining the version number scheme plus

[Pixman] [PATCH] Move fallback decisions from implementations into pixman-cpu.c.

2011-01-24 Thread Søren Sandmann
From: Søren Sandmann Pedersen Instead of having each individual implementation decide which fallback to use, move it into pixman-cpu.c, where a more global decision can be made. This is accomplished by adding a "fallback" argument to all the pixman_implementation_create_*() implementa

[Pixman] [PATCH 1/5] Add a test for over_x888_8_0565 in lowlevel_blt_bench().

2011-01-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen The next few commits will speed this up quite a bit. Current output: --- reference memcpy speed = 2217.5MB/s (554.4MP/s for 32bpp fills) --- over_x888_8_0565 = L1: 54.67 L2: 54.01 M: 52.33 ( 18.88%) HT: 37.19 VT: 35.54 R: 29.40 RT: 13.63 ( 162Kops/s

[Pixman] [PATCH 2/5] Add SSE2 fetcher for x8r8g8b8

2011-01-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen New output of lowlevel-blt-bench over_x888_8_0565: over_x888_8_0565 = L1: 55.68 L2: 55.11 M: 52.83 ( 19.04%) HT: 39.62 VT: 37.70 R: 30.88 RT: 14.62 ( 174Kops/s) The fetcher is looked up in a table, so that other fetchers can easily be added. --- pixman

[Pixman] [PATCH 3/5] Add SSE2 fetcher for a8

2011-01-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen New output of lowlevel-blt-bench over_x888_8_0565: over_x888_8_0565 = L1: 57.85 L2: 56.80 M: 54.14 ( 19.50%) HT: 42.64 VT: 40.56 R: 32.67 RT: 16.22 ( 195Kops/s) --- pixman/pixman-sse2.c | 49 - 1 files

[Pixman] [PATCH 4/5] Improve performance of sse2_combine_over_u()

2011-01-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen Split this function into two, one that has a mask, and one that doesn't. This is a fairly substantial speed-up in many cases. New output of lowlevel-blt-bench over_x888_8_0565: over_x888_8_0565 = L1: 63.76 L2: 62.75 M: 59.37 ( 21.55%) HT: 45.89 VT:

[Pixman] [PATCH 5/5] Add SSE2 fetcher for 0565

2011-01-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen Before: add_0565_0565 = L1: 61.08 L2: 61.03 M: 60.57 ( 10.95%) HT: 46.85 VT: 45.25 R: 39.99 RT: 20.41 ( 233Kops/s) After: add_0565_0565 = L1: 77.84 L2: 76.25 M: 75.38 ( 13.71%) HT: 55.99 VT: 54.56 R: 45.41 RT: 21.95 ( 255Kops/s) --- pixman

[Pixman] [PATCH 0/3] Some clean-ups of the test directory

2011-02-10 Thread Søren Sandmann
The following patches add a new directory "demos" and move all the GTK+ based test programs there. This allows the Makefiles in both test and demos to become much simpler with less redundancy. I'm not particularly happy about the "demos" name since the GTK+ tests aren't really demos, but I can't t

[Pixman] [PATCH 2/3] Add @TESTPROGS_EXTRA_LDFLAGS@ to AM_LDFLAGS

2011-02-10 Thread Søren Sandmann
From: Søren Sandmann Pedersen Instead of explicitly adding it to each test program. --- test/Makefile.am | 18 +- 1 files changed, 1 insertions(+), 17 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 92ee8fd..0f03153 100644 --- a/test/Makefile.am +++ b/test

[Pixman] [PATCH 3/3] test/Makefile.am: Move all the TEST_LDADD into a new global LDADD.

2011-02-10 Thread Søren Sandmann
From: Søren Sandmann Pedersen This gets rid of a bunch of replicated *_LDADD clauses --- test/Makefile.am | 35 +-- 1 files changed, 1 insertions(+), 34 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 0f03153..3ce466e 100644 --- a/test

[Pixman] [PATCH] Add forgotten _mm_empty() calls in the SSE2 fetchers.

2011-02-16 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-sse2.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c index 2e135e2..29d2ea8 100644 --- a/pixman/pixman-sse2.c +++ b/pixman/pixman-sse2.c @@ -6200,6 +6200,8

[Pixman] [PATCH 1/2] test: In image_endian_swap() use pixman_image_get_format() to get the bpp.

2011-03-07 Thread Søren Sandmann
From: Søren Sandmann Pedersen There is no reason to pass in the bpp as an argument; it can be gotten directly from the image. --- test/affine-test.c |6 +++--- test/blitters-test.c|4 ++-- test/composite-traps-test.c |2 +- test/scaling-test.c |6

[Pixman] [PATCH 2/2] test: Do endian swapping of the source and destination images.

2011-03-07 Thread Søren Sandmann
From: Søren Sandmann Pedersen Otherwise the test fails on big endian. Fix for bug 34767, reported by Siarhei Siamashka. --- test/composite-traps-test.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/test/composite-traps-test.c b/test/composite-traps-test.c index

[Pixman] Simplify iterator initializer signatures

2011-03-12 Thread Søren Sandmann
Here are three patches that simplify the type signature of the iterator initializers. The signature before: void (*pixman_iter_init_func_t) (pixman_implementation_t *imp, pixman_iter_t *iter, pixman_image_t

[Pixman] [PATCH 1/3] In delegate_{src, dest}_iter_init() call delegate directly.

2011-03-12 Thread Søren Sandmann
From: Søren Sandmann Pedersen There is no reason to go through _pixman_implementation_{src,dest}_iter_init(), especially since _pixman_implementation_src_iter_init() is doing various other checks that only need to be done once. Also call delegate->src_iter_init() directly in pixman-sse

[Pixman] [PATCH 3/3] Simplify the prototype for iterator initializers.

2011-03-12 Thread Søren Sandmann
From: Søren Sandmann Pedersen All of the information previously passed to the iterator initializers is now available in the iterator itself, so there is no need to pass it as arguments anymore. --- pixman/pixman-bits-image.c | 20 +- pixman/pixman-conical-gradient.c |7

[Pixman] [PATCH 2/3] Fill out parts of iters in _pixman_implementation_{src, dest}_iter_init()

2011-03-12 Thread Søren Sandmann
From: Søren Sandmann Pedersen This makes _pixman_implementation_{src,dest}_iter_init() responsible for filling parts of the information in the iterators. Specifically, the information passed as arguments is stored in the iterator. Also add a height field to pixman_iter_t(). --- pixman/pixman

[Pixman] [PATCH] test: Randomize some tests if PIXMAN_RANDOMIZE_TESTS is set

2011-03-15 Thread Søren Sandmann
From: Søren Sandmann Pedersen This patch makes so that composite and stress-test will start from a random seed if the PIXMAN_RANDOMIZE_TESTS environment variable is set. Running the test suite in this mode is useful to get more test coverage. Also, in stress-test.c make it so that setting the

[Pixman] [PATCH] test: Fix infinite loop in composite

2011-03-22 Thread Søren Sandmann
From: Søren Sandmann Pedersen When run in PIXMAN_RANDOMIZE_TESTS mode, this test would go into an infinite loop because the loop started at 'seed' but the stop condition was still N_TESTS. --- test/composite.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --

[Pixman] [PATCH 1/3] mmx: Delete some unused variables

2011-05-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-mmx.c | 17 +++-- 1 files changed, 3 insertions(+), 14 deletions(-) diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index 0272347..62a73d6 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -1267,7 +1267,7

[Pixman] [PATCH 2/3] sse2: Delete some unused variables

2011-05-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-mmx.c |2 +- pixman/pixman-sse2.c | 18 -- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index 62a73d6..0185df6 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman

[Pixman] [PATCH 3/3] demos: Comment out some unused variables

2011-05-28 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- demos/alpha-test.c|4 +++- demos/gradient-test.c |4 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/demos/alpha-test.c b/demos/alpha-test.c index 92c2081..54e30fa 100644 --- a/demos/alpha-test.c +++ b/demos/alpha-test.c

[Pixman] [PATCH 0/3] Composite args in stack allocated struct

2011-06-12 Thread Søren Sandmann
>> I'm actually all for this change if it gets confirmed to work a bit >> better and faster (and I expect that it should, considering that all >> this data can be passed through some nested calls multiple >> times). Hopefully we are not running in circles. > > The FbComposeData struct was used in p

[Pixman] [PATCH 2/3] In pixman-general.c rename image_parameters to {src, mask, dest}_image

2011-06-12 Thread Søren Sandmann
From: Søren Sandmann Pedersen All the fast paths generally use these names as well. --- pixman/pixman-general.c | 33 - 1 files changed, 16 insertions(+), 17 deletions(-) diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c index 8db4d05..090767c

[Pixman] [PATCH 2/2] ARM: Fix two bugs in neon_composite_over_n_8888_0565_ca().

2011-06-20 Thread Søren Sandmann
The first bug is that a vmull.u8 instruction would store its result in the q1 register, clobbering the d2 register used later on. The second is that a vraddhn instruction would overwrite d25, corrupting the q12 register used later. Fixing the second bug caused a pipeline bubble where the d18 regis

[Pixman] [PATCH 1/2] blitters-test: Make common formats more likely to be tested.

2011-06-20 Thread Søren Sandmann
From: Søren Sandmann Pedersen Move the eight most common formats to the top of the list of image formats and make create_random_image() much more likely to select one of those eight formats. This should help catch more bugs in SIMD optimized operations. --- test/blitters-test.c | 22

[Pixman] Speed up pixman_region_contains_{rectangle,point}

2011-08-03 Thread Søren Sandmann
This patch series contains a speed-up for the two functions pixman_region_contains_rectangle() and pixman_region_contains_point(). The main usecase is when you select some text in Firefox and drag it, a shaped window with a complicated shape will be created, and the X server will call pixman_regio

[Pixman] [PATCH 1/4] Fix lcg_rand_u32() to return 32 random bits.

2011-08-03 Thread Søren Sandmann
From: Søren Sandmann Pedersen The lcg_rand() function only returns 15 random bits, so lcg_rand_u32() would always have 0 in bit 31 and bit 15. Fix that by calling lcg_rand() three times, to generate 15, 15, and 2 random bits respectively. --- test/utils.h |5 +++-- 1 files changed, 3

[Pixman] [PATCH 2/4] New test of pixman_region_contains_{rectangle, point}

2011-08-03 Thread Søren Sandmann
From: Søren Sandmann Pedersen This test generates random regions and checks whether random boxes and points are contained within them. The results are combined and a CRC32 value is computed and compared to a known-correct one. --- test/Makefile.am |2 ++ 1 files changed, 2 insertions(+), 0

[Pixman] [PATCH 3/4] Speed up pixman_region{, 32}_contains_rectangle()

2011-08-03 Thread Søren Sandmann
From: Søren Sandmann Pedersen When someone selects some text in Firefox under a non-composited X server and initiates a drag, a shaped window is created with a complex shape corresponding to the outline of the text. Then, on every mouse movement pixman_region_contains_rectangle() is called many

[Pixman] [PATCH 4/4] Use find_box_for_y in pixman_region_contains_point() too

2011-08-03 Thread Søren Sandmann
From: Søren Sandmann Pedersen The same binary search from the previous commit can be used in this function too. --- pixman/pixman-region.c |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c index a199405..35fefc4

[Pixman] [PATCH 1/4] Fix lcg_rand_u32() to return 32 random bits.

2011-08-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen The lcg_rand() function only returns 15 random bits, so lcg_rand_u32() would always have 0 in bit 31 and bit 15. Fix that by calling lcg_rand() three times, to generate 15, 15, and 2 random bits respectively. V2: Use the 10/11 most significant bits from the 3 lcg

[Pixman] [PATCH 2/4] New test of pixman_region_contains_{rectangle, point}

2011-08-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen This test generates random regions and checks whether random boxes and points are contained within them. The results are combined and a CRC32 value is computed and compared to a known-correct one. --- test/Makefile.am|2 + test/region-contains

[Pixman] [PATCH 3/4] Speed up pixman_region{, 32}_contains_rectangle()

2011-08-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen When someone selects some text in Firefox under a non-composited X server and initiates a drag, a shaped window is created with a complex shape corresponding to the outline of the text. Then, on every mouse movement pixman_region_contains_rectangle() is called many

[Pixman] [PATCH 4/4] Use find_box_for_y() in pixman_region_contains_point() too

2011-08-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen The same binary search from the previous commit can be used in this function too. V2: Remove check from loop that is not needed anymore, pointed out by Andrea Canciani. --- pixman/pixman-region.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions

[Pixman] [PATCH] Don't include stdint.h in lowlevel-blt-bench.c

2011-08-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen Some systems don't have the file, and the types are already defined in pixman.h. https://bugs.freedesktop.org//show_bug.cgi?id=37422 --- test/lowlevel-blt-bench.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/test/lowlevel-blt-benc

[Pixman] [PATCH] In pixman_image_create_bits() allow images larger than 2GB

2011-08-11 Thread Søren Sandmann
From: Søren Sandmann Pedersen There is no reason for pixman_image_create_bits() to check that the image size fits in int32_t. The correct check is against size_t since that is what the argument to calloc() is. This patch fixes this by adding a new _pixman_multiply_overflows_size() and using it

[Pixman] Consolidate some inlined functions

2011-08-15 Thread Søren Sandmann
These three patches rename pixman-fast-path.h to pixman-inlines.h, since this file is not really specific to the fast path implementation, and then it moves some code from the general implementation into that file: the repeat functionality, which was duplicated, and the bilinear interpolation code.

[Pixman] [PATCH 2/3] Use repeat() function from pixman-inlines.h in pixman-bits-image.c

2011-08-15 Thread Søren Sandmann
From: Søren Sandmann Pedersen The repeat() functionality was duplicated between pixman-bits-image.c and pixman-inlines.h --- pixman/pixman-bits-image.c | 57 +++ 1 files changed, 15 insertions(+), 42 deletions(-) diff --git a/pixman/pixman-bits-image.c

[Pixman] [PATCH 3/3] Move bilinear interpolation to pixman-inlines.h

2011-08-15 Thread Søren Sandmann
From: Søren Sandmann Pedersen --- pixman/pixman-bits-image.c | 91 pixman/pixman-inlines.h| 91 2 files changed, 91 insertions(+), 91 deletions(-) diff --git a/pixman/pixman-bits-image.c b/pixman

[Pixman] [PATCH 0/11] Use macros to generate fetchers

2011-09-02 Thread Søren Sandmann
This patch series change pixman-access.c to generate most accessors with macros and inline functions instead of writing out the code for all the functions. This is a fairly significant saving in terms of lines of code: pixman-access.c | 3159 +++---

[Pixman] [PATCH 01/11] Add a generic unorm_to_unorm() conversion utility

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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] [PATCH 02/11] Add general pixel converter

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen This function can convert between any <= 32 bpp formats. Nothing uses it yet. --- pixman/pixman-access.c | 100 1 files changed, 100 insertions(+), 0 deletions(-) diff --git a/pixman/pixman-access.c b/pixman/pix

[Pixman] [PATCH 03/11] Add initial version of the MAKE_ACCESSORS() macro

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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. --- pixman/pixman-access.c | 114 1 files ch

[Pixman] [PATCH 04/11] Use MAKE_ACCESSORS() to generate all the 32 bit accessors

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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

[Pixman] [PATCH 05/11] Use MAKE_ACCESSORS() to generate accessors for all the 16bpp formats

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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

[Pixman] [PATCH 06/11] Use MAKE_ACCESSORS() to generate accessors for 8bpp RGB formats

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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

[Pixman] [PATCH 07/11] Use MAKE_ACCESSORS() to generate accessors for 4 bpp RGB formats

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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

[Pixman] [PATCH 08/11] Use MAKE_ACCESSORS() to generate accessors for 24bpp formats

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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 --- pixman/pixman-access.c

[Pixman] [PATCH 09/11] Use MAKE_ACCESSORS() to generate accessors for the a1 format.

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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). --- pixman/pixman

[Pixman] [PATCH 10/11] Use MAKE_ACCESSORS() to generate accessors for paletted formats

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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 --- pixman/pixman-access.c | 276

[Pixman] [PATCH 11/11] Add some fast paths to convert_pixel()

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen All the inlining going on makes gcc generate slightly suboptimal code, so add some special cases for the common formats a8r8g8b8, x8r8g8b8, a8, and r5g6b5. --- pixman/pixman-access.c | 53 1 files changed, 53

[Pixman] [PATCH] test: New function to save a pixman image to .png

2011-09-02 Thread Søren Sandmann
From: Søren Sandmann Pedersen When debugging it is often very useful to be able to save an image as a png file. This commit adds a function "write_png()" that does that. If libpng is not available, then the function becomes a noop. --- configure.ac | 11 + test/Makefile

[Pixman] [PATCH] Eliminate compute_sample_extents() function

2011-09-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen In analyze_extents(), instead of calling compute_sample_extents() twice, just call compute_transformed_extents() once. Instead of calling compute_sample_extents() for the destination rectangle expanded by one, just call compute_transformed_extents() and expand the

[Pixman] [PATCH] Split computation of sample area into own function

2011-09-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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(). --- pixman

[Pixman] [PATCH] test: better coverage for BILINEAR->NEAREST filter optimization

2011-09-05 Thread Søren Sandmann
From: Siarhei Siamashka 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

[Pixman] [PATCH] BILINEAR->NEAREST filter optimization for simple rotation and translation

2011-09-05 Thread Søren Sandmann
From: Siarhei Siamashka Simple rotation and translation are the additional cases when BILINEAR filter can be safely reduced to NEAREST. --- pixman/pixman-image.c | 39 ++- 1 files changed, 38 insertions(+), 1 deletions(-) diff --git a/pixman/pixman-image.c

[Pixman] [PATCH] test: Occasionally use a BILINEAR filter in blitters-test

2011-09-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen To test that reductions of BILINEAR->NEAREST for identity transformations happen correctly, occasionally use a bilinear filter in blitters test. --- test/blitters-test.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/test/blitt

[Pixman] [PATCH] Strength-reduce BILINEAR filter to NEAREST filter for identity transforms

2011-09-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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

[Pixman] [PATCH] Remove x and y coordinates from analyze_extents() and compute_sample_extents()

2011-09-05 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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. --- pixman/pixman.c | 63

[Pixman] [PATCH] Only link with -lpng when libpng is actually available

2011-09-11 Thread Søren Sandmann
From: Søren Sandmann Pedersen Fixes build on systems that don't have libpng --- configure.ac |1 + test/Makefile.am |5 - 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 21613e1..fdb2521 100644 --- a/configure.ac

Re: [Pixman] [PATCH] Only link with -lpng when libpng is actually available

2011-09-11 Thread Søren Sandmann
> How about using pkg-config to detect the availability of libpng and > the flags required to use it? Good idea. New patch to follow. Soren ___ Pixman mailing list Pixman@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pixman

[Pixman] [PATCH] Use pkg-config to determine the flags to use with libpng

2011-09-11 Thread Søren Sandmann
From: Søren Sandmann Pedersen Previously we would unconditionally link with -lpng leading to build failures on systems without libpng. --- configure.ac |2 +- test/Makefile.am |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index

[Pixman] [PATCH] test: Use smaller boxes in region_contains_test()

2011-09-12 Thread Søren Sandmann
From: Søren Sandmann Pedersen 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. F

Re: [Pixman] [PATCH 1/3] Add CLEAR and SRC linear interpolation operators

2011-09-15 Thread Søren Sandmann
Chris Wilson writes: > Cairo, for instance, has a subtly different interpretation of how to use > the mask in combination with the Porter-Duff operators. In particular, > it has the notion of a clip mask, for which pixman has no parallel. > > Quoting Soeren: > > Another aspect is that cairo use

<    1   2   3   4   5   6   7   8   9   >