[Pixman] [PATCH 9/9] test: add "pixbuf" and "rpixbuf" to lowlevel-blt-bench

Nemanja Lukic nemanja.lukic at rt-rk.com
Sat Mar 16 13:00:28 PDT 2013


Add necessary support to lowlevel-blt benchmark for benchmarking pixbuf and
rpixbuf fast paths. Trick is to force benchmark to use same bits for src and
mask images. This feature can be turned on using TEST_PIXBUF_FAST_PATHS build
flag (set to 1). By default it is set to 0.
---
 test/lowlevel-blt-bench.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c
index a1657ea..d70da2d 100644
--- a/test/lowlevel-blt-bench.c
+++ b/test/lowlevel-blt-bench.c
@@ -51,6 +51,8 @@
 
 #define EXCLUDE_OVERHEAD 1
 
+#define TEST_PIXBUF_FAST_PATHS 0
+
 uint32_t *dst;
 uint32_t *src;
 uint32_t *mask;
@@ -427,11 +429,19 @@ bench_composite (char * testname,
         bytes_per_pix += (mask_fmt >> 24) / ((op == PIXMAN_OP_SRC) ? 8.0 : 4.0);
         mask_img = pixman_image_create_bits (mask_fmt,
                                              WIDTH, HEIGHT,
+#if TEST_PIXBUF_FAST_PATHS
+                                             src,
+#else
                                              mask,
+#endif
                                              WIDTH * 4);
         xmask_img = pixman_image_create_bits (mask_fmt,
                                              XWIDTH, XHEIGHT,
+#if TEST_PIXBUF_FAST_PATHS
+                                             src,
+#else
                                              mask,
+#endif
                                              XWIDTH * 4);
     }
     else if (mask_fmt != PIXMAN_null)
@@ -709,6 +719,10 @@ tests_tbl[] =
     { "outrev_n_8888_x888_ca", PIXMAN_a8r8g8b8,    1, PIXMAN_OP_OUT_REV, PIXMAN_a8r8g8b8, 2, PIXMAN_x8r8g8b8 },
     { "outrev_n_8888_8888_ca", PIXMAN_a8r8g8b8,    1, PIXMAN_OP_OUT_REV, PIXMAN_a8r8g8b8, 2, PIXMAN_a8r8g8b8 },
     { "over_reverse_n_8888",   PIXMAN_a8r8g8b8,    0, PIXMAN_OP_OVER_REVERSE, PIXMAN_null, 0, PIXMAN_a8r8g8b8 },
+#if TEST_PIXBUF_FAST_PATHS
+    { "pixbuf",                PIXMAN_x8b8g8r8,    0, PIXMAN_OP_SRC,     PIXMAN_a8b8g8r8, 0, PIXMAN_a8r8g8b8 },
+    { "rpixbuf",               PIXMAN_x8b8g8r8,    0, PIXMAN_OP_SRC,     PIXMAN_a8b8g8r8, 0, PIXMAN_a8b8g8r8 },
+#endif
 };
 
 int
-- 
1.7.3



More information about the Pixman mailing list