diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-02-22 05:16:27 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-02-24 23:20:27 -0500 |
commit | fb0096a282c5b6e7ca9eb59a05d9ff738dccfd4b (patch) | |
tree | 356b5bd327b8bfa00b56ce21696f9eec4c44fef9 | |
parent | a7ad9c7c9dcb78e0c5ad00145b119dfe929eb307 (diff) |
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.
-rw-r--r-- | pixman/pixman-private.h | 1 | ||||
-rw-r--r-- | pixman/pixman.c | 26 |
2 files changed, 12 insertions, 15 deletions
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 2cafe3a..f4f0397 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -580,6 +580,7 @@ _pixman_choose_implementation (void); #define FAST_PATH_UNIFIED_ALPHA (1 << 9) #define FAST_PATH_SCALE_TRANSFORM (1 << 10) #define FAST_PATH_NEAREST_FILTER (1 << 11) +#define FAST_PATH_SIMPLE_REPEAT (1 << 12) #define _FAST_PATH_STANDARD_FLAGS \ (FAST_PATH_ID_TRANSFORM | \ diff --git a/pixman/pixman.c b/pixman/pixman.c index c7d3bcc..09fc7e1 100644 --- a/pixman/pixman.c +++ b/pixman/pixman.c @@ -456,11 +456,20 @@ get_image_info (pixman_image_t *image, *flags = image->common.flags; if (_pixman_image_is_solid (image)) + { *code = PIXMAN_solid; + } else if (image->common.type == BITS) + { *code = image->bits.format; + + if (!image->common.transform && image->common.repeat == PIXMAN_REPEAT_NORMAL) + *flags |= FAST_PATH_SIMPLE_REPEAT; + } else + { *code = PIXMAN_unknown; + } } static force_inline pixman_bool_t @@ -500,7 +509,6 @@ do_composite (pixman_implementation_t *imp, { pixman_format_code_t src_format, mask_format, dest_format; uint32_t src_flags, mask_flags, dest_flags; - pixman_bool_t src_repeat, mask_repeat; pixman_region32_t region; pixman_box32_t *extents; @@ -528,19 +536,6 @@ do_composite (pixman_implementation_t *imp, src_format = mask_format = PIXMAN_rpixbuf; } - src_repeat = - src->type == BITS && - src_flags & FAST_PATH_ID_TRANSFORM && - src->common.repeat == PIXMAN_REPEAT_NORMAL && - src_format != PIXMAN_solid; - - mask_repeat = - mask && - mask->type == BITS && - mask_flags & FAST_PATH_ID_TRANSFORM && - mask->common.repeat == PIXMAN_REPEAT_NORMAL && - mask_format != PIXMAN_solid; - pixman_region32_init (®ion); if (!pixman_compute_composite_region32 ( @@ -583,7 +578,8 @@ do_composite (pixman_implementation_t *imp, src_x, src_y, mask_x, mask_y, dest_x, dest_y, width, height, - src_repeat, mask_repeat, + (src_flags & FAST_PATH_SIMPLE_REPEAT), + (mask_flags & FAST_PATH_SIMPLE_REPEAT), ®ion, info->func); |