summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2009-09-12 02:47:39 -0400
committerSøren Sandmann Pedersen <sandmann@redhat.com>2009-11-17 00:42:21 -0500
commitb7fb7e6c700891a12300aaf5c8a4c4b2584a194f (patch)
tree66de58ab8ae5cfe57d8ebebd7b8908af7ad4aff7
parent542b79c30d88788028d391285aa8cd038e96f2b3 (diff)
Eliminate NEED_PIXBUF flag.
Instead introduce two new fake formats PIXMAN_pixbuf PIXMAN_rpixbuf and compute whether the source and mask have them in find_fast_path(). This lead to some duplicate entries in the fast path tables that could then be removed.
-rw-r--r--pixman/pixman-mmx.c18
-rw-r--r--pixman/pixman-private.h6
-rw-r--r--pixman/pixman-sse2.c30
-rw-r--r--pixman/pixman-utils.c109
4 files changed, 78 insertions, 85 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index a0e8bb0..192ca31 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3236,18 +3236,12 @@ static const pixman_fast_path_t mmx_fast_paths[] =
{ PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8_ca, PIXMAN_a8b8g8r8, mmx_composite_over_n_8888_8888_ca },
{ PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8_ca, PIXMAN_x8b8g8r8, mmx_composite_over_n_8888_8888_ca },
{ PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8_ca, PIXMAN_b5g6r5, mmx_composite_over_n_8888_0565_ca },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_a8r8g8b8, mmx_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_a8r8g8b8, mmx_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_x8r8g8b8, mmx_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_x8r8g8b8, mmx_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_r5g6b5, mmx_composite_over_pixbuf_0565, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_r5g6b5, mmx_composite_over_pixbuf_0565, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_a8b8g8r8, mmx_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_a8b8g8r8, mmx_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_x8b8g8r8, mmx_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_x8b8g8r8, mmx_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_b5g6r5, mmx_composite_over_pixbuf_0565, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_b5g6r5, mmx_composite_over_pixbuf_0565, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_pixbuf, PIXMAN_pixbuf, PIXMAN_a8r8g8b8, mmx_composite_over_pixbuf_8888, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_pixbuf, PIXMAN_pixbuf, PIXMAN_x8r8g8b8, mmx_composite_over_pixbuf_8888, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_pixbuf, PIXMAN_pixbuf, PIXMAN_r5g6b5, mmx_composite_over_pixbuf_0565, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_rpixbuf, PIXMAN_rpixbuf, PIXMAN_a8b8g8r8, mmx_composite_over_pixbuf_8888, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_rpixbuf, PIXMAN_rpixbuf, PIXMAN_x8b8g8r8, mmx_composite_over_pixbuf_8888, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_rpixbuf, PIXMAN_rpixbuf, PIXMAN_b5g6r5, mmx_composite_over_pixbuf_0565, 0 },
{ PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_solid, PIXMAN_a8r8g8b8, mmx_composite_over_x888_n_8888, 0 },
{ PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_solid, PIXMAN_x8r8g8b8, mmx_composite_over_x888_n_8888, 0 },
{ PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_solid, PIXMAN_a8b8g8r8, mmx_composite_over_x888_n_8888, 0 },
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index fb7bde6..dc23de6 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -557,15 +557,15 @@ _pixman_choose_implementation (void);
* Utilities
*/
-/* These "formats" both have depth 0, so they
+/* These "formats" all have depth 0, so they
* will never clash with any real ones
*/
#define PIXMAN_null PIXMAN_FORMAT (0, 0, 0, 0, 0, 0)
#define PIXMAN_solid PIXMAN_FORMAT (0, 1, 0, 0, 0, 0)
#define PIXMAN_a8r8g8b8_ca PIXMAN_FORMAT (0, 2, 0, 0, 0, 0)
#define PIXMAN_a8b8g8r8_ca PIXMAN_FORMAT (0, 3, 0, 0, 0, 0)
-
-#define NEED_PIXBUF (1 << 1)
+#define PIXMAN_pixbuf PIXMAN_FORMAT (0, 4, 0, 0, 0, 0)
+#define PIXMAN_rpixbuf PIXMAN_FORMAT (0, 5, 0, 0, 0, 0)
typedef struct
{
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 4307dd4..fc47e7b 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -5799,24 +5799,18 @@ static const pixman_fast_path_t sse2_fast_paths[] =
{ PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_solid, PIXMAN_x8r8g8b8, sse2_composite_over_8888_n_8888, 0 },
{ PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_solid, PIXMAN_a8b8g8r8, sse2_composite_over_8888_n_8888, 0 },
{ PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_solid, PIXMAN_x8b8g8r8, sse2_composite_over_8888_n_8888, 0 },
- { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8_ca, PIXMAN_a8r8g8b8, sse2_composite_over_n_8888_8888_ca, 0, },
- { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8_ca, PIXMAN_x8r8g8b8, sse2_composite_over_n_8888_8888_ca, 0, },
- { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8_ca, PIXMAN_a8b8g8r8, sse2_composite_over_n_8888_8888_ca, 0, },
- { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8_ca, PIXMAN_x8b8g8r8, sse2_composite_over_n_8888_8888_ca, 0, },
- { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8_ca, PIXMAN_r5g6b5, sse2_composite_over_n_8888_0565_ca, 0, },
- { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8_ca, PIXMAN_b5g6r5, sse2_composite_over_n_8888_0565_ca, 0, },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_a8r8g8b8, sse2_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_a8r8g8b8, sse2_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_x8r8g8b8, sse2_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_x8r8g8b8, sse2_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_a8b8g8r8, sse2_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_a8b8g8r8, sse2_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_x8b8g8r8, sse2_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_x8b8g8r8, sse2_composite_over_pixbuf_8888, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_r5g6b5, sse2_composite_over_pixbuf_0565, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_r5g6b5, sse2_composite_over_pixbuf_0565, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_b5g6r5, sse2_composite_over_pixbuf_0565, NEED_PIXBUF },
- { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_b5g6r5, sse2_composite_over_pixbuf_0565, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8_ca, PIXMAN_a8r8g8b8, sse2_composite_over_n_8888_8888_ca, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8_ca, PIXMAN_x8r8g8b8, sse2_composite_over_n_8888_8888_ca, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8_ca, PIXMAN_a8b8g8r8, sse2_composite_over_n_8888_8888_ca, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8_ca, PIXMAN_x8b8g8r8, sse2_composite_over_n_8888_8888_ca, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8_ca, PIXMAN_r5g6b5, sse2_composite_over_n_8888_0565_ca, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8_ca, PIXMAN_b5g6r5, sse2_composite_over_n_8888_0565_ca, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_pixbuf, PIXMAN_pixbuf, PIXMAN_a8r8g8b8, sse2_composite_over_pixbuf_8888, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_pixbuf, PIXMAN_pixbuf, PIXMAN_x8r8g8b8, sse2_composite_over_pixbuf_8888, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_rpixbuf, PIXMAN_rpixbuf, PIXMAN_a8b8g8r8, sse2_composite_over_pixbuf_8888, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_rpixbuf, PIXMAN_rpixbuf, PIXMAN_x8b8g8r8, sse2_composite_over_pixbuf_8888, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_pixbuf, PIXMAN_pixbuf, PIXMAN_r5g6b5, sse2_composite_over_pixbuf_0565, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_rpixbuf, PIXMAN_rpixbuf, PIXMAN_b5g6r5, sse2_composite_over_pixbuf_0565, 0 },
{ PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, sse2_composite_copy_area, 0 },
{ PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, sse2_composite_copy_area, 0 },
diff --git a/pixman/pixman-utils.c b/pixman/pixman-utils.c
index 1db1b37..6d03f3c 100644
--- a/pixman/pixman-utils.c
+++ b/pixman/pixman-utils.c
@@ -504,59 +504,79 @@ get_fast_path (const pixman_fast_path_t *fast_paths,
pixman_image_t * src_image,
pixman_image_t * mask_image,
pixman_image_t * dst_image,
- pixman_bool_t is_pixbuf)
+ int src_x,
+ int src_y,
+ int mask_x,
+ int mask_y)
{
pixman_format_code_t src_format, mask_format;
const pixman_fast_path_t *info;
- if (_pixman_image_is_solid (src_image))
+ /* Check for pixbufs */
+ if (mask_image && mask_image->type == BITS &&
+ (mask_image->bits.format == PIXMAN_a8r8g8b8 || mask_image->bits.format == PIXMAN_a8b8g8r8) &&
+ (src_image->type == BITS && src_image->bits.bits == mask_image->bits.bits) &&
+ (src_image->common.repeat == mask_image->common.repeat) &&
+ (src_x == mask_x && src_y == mask_y))
{
- src_format = PIXMAN_solid;
- }
- else if (src_image->type == BITS)
- {
- src_format = src_image->bits.format;
+ if (src_image->bits.format == PIXMAN_x8b8g8r8)
+ src_format = mask_format = PIXMAN_pixbuf;
+ else if (src_image->bits.format == PIXMAN_x8r8g8b8)
+ src_format = mask_format = PIXMAN_rpixbuf;
+ else
+ return NULL;
}
else
{
- return NULL;
- }
-
- if (!mask_image)
- {
- mask_format = PIXMAN_null;
- }
- else if (mask_image->common.component_alpha)
- {
- if (mask_image->type == BITS)
+ if (_pixman_image_is_solid (src_image))
+ {
+ src_format = PIXMAN_solid;
+ }
+ else if (src_image->type == BITS)
+ {
+ src_format = src_image->bits.format;
+ }
+ else
+ {
+ return NULL;
+ }
+
+ if (!mask_image)
{
- /* These are the *only* component_alpha formats
- * we support for fast paths
- */
- if (mask_image->bits.format == PIXMAN_a8r8g8b8)
- mask_format = PIXMAN_a8r8g8b8_ca;
- else if (mask_image->bits.format == PIXMAN_a8b8g8r8)
- mask_format = PIXMAN_a8b8g8r8_ca;
+ mask_format = PIXMAN_null;
+ }
+ else if (mask_image->common.component_alpha)
+ {
+ if (mask_image->type == BITS)
+ {
+ /* These are the *only* component_alpha formats
+ * we support for fast paths
+ */
+ if (mask_image->bits.format == PIXMAN_a8r8g8b8)
+ mask_format = PIXMAN_a8r8g8b8_ca;
+ else if (mask_image->bits.format == PIXMAN_a8b8g8r8)
+ mask_format = PIXMAN_a8b8g8r8_ca;
+ else
+ return NULL;
+ }
else
+ {
return NULL;
+ }
+ }
+ else if (_pixman_image_is_solid (mask_image))
+ {
+ mask_format = PIXMAN_solid;
+ }
+ else if (mask_image->common.type == BITS)
+ {
+ mask_format = mask_image->bits.format;
}
else
{
return NULL;
}
}
- else if (_pixman_image_is_solid (mask_image))
- {
- mask_format = PIXMAN_solid;
- }
- else if (mask_image->common.type == BITS)
- {
- mask_format = mask_image->bits.format;
- }
- else
- {
- return NULL;
- }
for (info = fast_paths; info->op != PIXMAN_OP_NONE; info++)
{
@@ -571,9 +591,6 @@ get_fast_path (const pixman_fast_path_t *fast_paths,
if (info->dest_format != dst_image->bits.format)
continue;
- if ((info->flags & NEED_PIXBUF) && !is_pixbuf)
- continue;
-
return info;
}
@@ -682,20 +699,8 @@ _pixman_run_fast_path (const pixman_fast_path_t *paths,
if (has_fast_path)
{
const pixman_fast_path_t *info;
- pixman_bool_t pixbuf;
-
- pixbuf =
- src && src->type == BITS &&
- mask && mask->type == BITS &&
- src->bits.bits == mask->bits.bits &&
- src_x == mask_x &&
- src_y == mask_y &&
- !mask->common.component_alpha &&
- !mask_repeat;
-
- info = get_fast_path (paths, op, src, mask, dest, pixbuf);
- if (info)
+ if ((info = get_fast_path (paths, op, src, mask, dest, src_x, src_y, mask_x, mask_y)))
{
func = info->func;