diff options
author | David Schleef <ds@schleef.org> | 2010-08-07 12:57:01 -0700 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2011-05-17 10:23:01 -0700 |
commit | 63bbdef0ca2c7b6f67a673b07c35de5a82a92248 (patch) | |
tree | 89d25958f05bd6f0fffb67d1f4b70646ac7daac5 /test | |
parent | 2f73959f22d5b2b07aec8cc98ab9a35f2771ca8b (diff) |
random stuff
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/ds.c | 47 |
2 files changed, 45 insertions, 7 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 3fa6965..6134920 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -27,15 +27,11 @@ TESTPROGRAMS = \ pdf_op_test_SOURCES = pdf-op-test.c utils.c utils.h region_test_SOURCES = region-test.c utils.c utils.h blitters_test_SOURCES = blitters-test.c utils.c utils.h -<<<<<<< HEAD composite_traps_test_SOURCES = composite-traps-test.c utils.c utils.h -======= ds_LDADD = $(TEST_LDADD) ds_SOURCES = ds.c ../pixman/pixman-orccode.c -scaling_test_LDADD = $(TEST_LDADD) ->>>>>>> orc: test program to check orc generated code scaling_test_SOURCES = scaling-test.c utils.c utils.h affine_test_SOURCES = affine-test.c utils.c utils.h alphamap_SOURCES = alphamap.c utils.c utils.h @@ -51,6 +47,7 @@ BENCHMARKS = \ lowlevel-blt-bench lowlevel_blt_bench_SOURCES = lowlevel-blt-bench.c utils.c utils.h +INCLUDES += $(GTK_CFLAGS) $(ORC_CFLAGS) noinst_PROGRAMS = $(TESTPROGRAMS) $(BENCHMARKS) @@ -81,6 +81,46 @@ combine_xor_u (pixman_implementation_t *imp, } } +#if 0 +static void +combine_add_u (pixman_implementation_t *imp, + pixman_op_t op, + uint32_t * dest, + const uint32_t * src, + const uint32_t * mask, + int width) +{ + int i; + + for (i = 0; i < width; ++i) + { + uint32_t s = combine_mask (src, mask, i); + uint32_t d = *(dest + i); + UN8x4_ADD_UN8x4 (d, s); + *(dest + i) = d; + } +} +#endif + +static void +combine_in_u (pixman_implementation_t *imp, + pixman_op_t op, + uint32_t * dest, + const uint32_t * src, + const uint32_t * mask, + int width) +{ + int i; + + for (i = 0; i < width; ++i) + { + uint32_t s = combine_mask (src, mask, i); + uint32_t a = ALPHA_8 (*(dest + i)); + UN8x4_MUL_UN8 (s, a); + *(dest + i) = s; + } +} + uint32_t dest_orig[256]; uint32_t dest[256]; @@ -127,10 +167,11 @@ int main (int argc, char *argv[]) } //combine_xor_u (NULL, 0, dest, src, mask, 256); - combine_xor_u (NULL, 0, dest_ref, src, NULL, 256); - //orc_code_combine_xor_u_n (dest, src, 256); + //combine_xor_u (NULL, 0, dest_ref, src, NULL, 256); + combine_in_u (NULL, 0, dest_ref, src, NULL, 256); + orc_code_combine_in_u_n (dest, src, 256); -#if 1 +#if 0 for(i=0;i<256;i++){ dest[i] = ORC_ARGB( COMPOSITE_XOR(ORC_ARGB_A(src[i]), ORC_ARGB_A(dest[i]), |