diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-12-13 11:04:36 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-12-14 04:12:05 -0500 |
commit | f196724e7560ac7b08499f28ce2ff82f5eb69878 (patch) | |
tree | 49829c5064686872788f4d90babc91974cf77145 | |
parent | 6a6c8c51ed9e7272e624b3c99187ddf71d19a0fd (diff) |
Get rid of double-compilation of pixman-edge.ctrap-access
Instead of compiling this file twice (once with accessors and once
without), accessors are dealt with by creating a temporary image,
rasterize into that, and then composite the temporary onto the real
image, relying on the regular composite operation to call the
accessors.
-rw-r--r-- | pixman/Makefile.sources | 1 | ||||
-rw-r--r-- | pixman/pixman-edge-accessors.c | 4 | ||||
-rw-r--r-- | pixman/pixman-edge.c | 57 | ||||
-rw-r--r-- | pixman/pixman-private.h | 7 |
4 files changed, 27 insertions, 42 deletions
diff --git a/pixman/Makefile.sources b/pixman/Makefile.sources index c624eb9a..1e4802d3 100644 --- a/pixman/Makefile.sources +++ b/pixman/Makefile.sources @@ -12,7 +12,6 @@ libpixman_sources = \ pixman-arm.c \ pixman-ppc.c \ pixman-edge.c \ - pixman-edge-accessors.c \ pixman-fast-path.c \ pixman-glyph.c \ pixman-general.c \ diff --git a/pixman/pixman-edge-accessors.c b/pixman/pixman-edge-accessors.c deleted file mode 100644 index ea3a31e2..00000000 --- a/pixman/pixman-edge-accessors.c +++ /dev/null @@ -1,4 +0,0 @@ - -#define PIXMAN_FB_ACCESSORS - -#include "pixman-edge.c" diff --git a/pixman/pixman-edge.c b/pixman/pixman-edge.c index ad6dfc4c..5773f9cb 100644 --- a/pixman/pixman-edge.c +++ b/pixman/pixman-edge.c @@ -57,12 +57,6 @@ } \ } -#ifdef PIXMAN_FB_ACCESSORS -#define PIXMAN_RASTERIZE_EDGES pixman_rasterize_edges_accessors -#else -#define PIXMAN_RASTERIZE_EDGES pixman_rasterize_edges_no_accessors -#endif - /* * 4 bit alpha */ @@ -335,16 +329,32 @@ rasterize_edges_8 (pixman_image_t *image, } } -#ifndef PIXMAN_FB_ACCESSORS -static -#endif -void -PIXMAN_RASTERIZE_EDGES (pixman_image_t *image, +PIXMAN_EXPORT void +pixman_rasterize_edges (pixman_image_t *image, pixman_edge_t * l, pixman_edge_t * r, pixman_fixed_t t, pixman_fixed_t b) { + pixman_image_t *original = NULL; + + return_if_fail (image->type == BITS); + return_if_fail (PIXMAN_FORMAT_TYPE (image->bits.format) == PIXMAN_TYPE_A); + + if (image->bits.read_func || image->bits.write_func) + { + original = image; + + image = pixman_image_create_bits (image->bits.format, + image->bits.width, image->bits.height, + NULL, -1); + + if (!image) + return; + + _pixman_image_validate (image); + } + switch (PIXMAN_FORMAT_BPP (image->bits.format)) { case 1: @@ -362,24 +372,11 @@ PIXMAN_RASTERIZE_EDGES (pixman_image_t *image, default: break; } -} - -#ifndef PIXMAN_FB_ACCESSORS -PIXMAN_EXPORT void -pixman_rasterize_edges (pixman_image_t *image, - pixman_edge_t * l, - pixman_edge_t * r, - pixman_fixed_t t, - pixman_fixed_t b) -{ - return_if_fail (image->type == BITS); - return_if_fail (PIXMAN_FORMAT_TYPE (image->bits.format) == PIXMAN_TYPE_A); - - if (image->bits.read_func || image->bits.write_func) - pixman_rasterize_edges_accessors (image, l, r, t, b); - else - pixman_rasterize_edges_no_accessors (image, l, r, t, b); + if (original) + { + pixman_image_composite32 (PIXMAN_OP_ADD, image, NULL, original, + 0, 0, 0, 0, 0, 0, + original->bits.width, original->bits.height); + } } - -#endif diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 99125a17..8946c3a6 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -372,13 +372,6 @@ _pixman_gradient_walker_pixel (pixman_gradient_walker_t *walker, ((n) == 1? 0 : (pixman_fixed_frac (x) + \ X_FRAC_FIRST (n)) / STEP_X_SMALL (n)) -void -pixman_rasterize_edges_accessors (pixman_image_t *image, - pixman_edge_t * l, - pixman_edge_t * r, - pixman_fixed_t t, - pixman_fixed_t b); - /* * Implementations */ |