summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Avison <bavison@riscosopen.org>2014-05-22 15:22:52 +0100
committerBen Avison <bavison@riscosopen.org>2015-10-15 13:55:52 +0100
commit9aa45b6dcb75efb797b7a0f7b96569a409a8d18e (patch)
tree9971c4046bad343016c527a36d26013b21ca3315
parent93f534440266105fdff7e00f34d021b0ccbf4db3 (diff)
pixman-fast-path: Add over_n_0565 fast path
This is a C fast path, useful for reference or for platforms that don't have their own fast path for this operation. lowlevel-blt-bench results on ARMv6: Before After Mean StdDev Mean StdDev Confidence Change L1 8.2 0.0 11.3 0.1 100.0% +38.6% L2 7.9 0.1 10.5 0.0 100.0% +33.3% M 7.3 0.0 10.0 0.0 100.0% +36.7% HT 6.9 0.0 9.2 0.0 100.0% +33.3% VT 6.8 0.0 9.0 0.0 100.0% +32.1% R 6.6 0.1 8.8 0.0 100.0% +31.8% RT 4.5 0.1 6.3 0.1 100.0% +39.7%
-rw-r--r--pixman/pixman-fast-path.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index fccc155..4c099fa 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -1035,6 +1035,39 @@ fast_composite_over_n_1_8888 (pixman_implementation_t *imp,
}
static void
+fast_composite_over_n_0565 (pixman_implementation_t *imp,
+ pixman_composite_info_t *info)
+{
+ PIXMAN_COMPOSITE_ARGS (info);
+ uint32_t src;
+ uint16_t *dst_line, *dst;
+ int dst_stride;
+ int32_t w;
+ uint32_t d;
+
+ src = _pixman_image_get_solid (imp, src_image, dest_image->bits.format);
+
+ if (src == 0)
+ return;
+
+ PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint16_t, dst_stride, dst_line, 1);
+
+ while (height--)
+ {
+ dst = dst_line;
+ dst_line += dst_stride;
+ w = width;
+
+ while (w--)
+ {
+ d = over (src, convert_0565_to_0888 (*dst));
+ *dst = convert_8888_to_0565 (d);
+ dst++;
+ }
+ }
+}
+
+static void
fast_composite_over_n_1_0565 (pixman_implementation_t *imp,
pixman_composite_info_t *info)
{
@@ -1845,6 +1878,8 @@ FAST_SIMPLE_ROTATE (8888, uint32_t)
static const pixman_fast_path_t c_fast_paths[] =
{
+ PIXMAN_STD_FAST_PATH (OVER, solid, null, r5g6b5, fast_composite_over_n_0565),
+ PIXMAN_STD_FAST_PATH (OVER, solid, null, b5g6r5, fast_composite_over_n_0565),
PIXMAN_STD_FAST_PATH (OVER, solid, a8, r5g6b5, fast_composite_over_n_8_0565),
PIXMAN_STD_FAST_PATH (OVER, solid, a8, b5g6r5, fast_composite_over_n_8_0565),
PIXMAN_STD_FAST_PATH (OVER, solid, a8, r8g8b8, fast_composite_over_n_8_0888),