From: Soren Sandmann Pedersen Date: Tue, 8 May 2007 14:48:27 +0000 (-0400) Subject: Add a simple test program; fix linking problems X-Git-Tag: pixman-0.9.4~134 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bd9ebc83d5a25141b5c9868513b918befd433d0;p=platform%2Fupstream%2Fpixman.git Add a simple test program; fix linking problems --- diff --git a/Makefile.am b/Makefile.am index 3621cc7..25be5f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = pixman +SUBDIRS = pixman test pkgconfigdir=$(libdir)/pkgconfig pkgconfig_DATA=pixman.pc diff --git a/configure.ac b/configure.ac index 6b68049..fa8a9a9 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,7 @@ if test "x$GCC" = "xyes"; then AC_SUBST(DEP_CFLAGS) AC_SUBST(DEP_LIBS) -AC_OUTPUT([Makefile +AC_OUTPUT([pixman.pc + Makefile pixman/Makefile - pixman.pc]) + test/Makefile]) diff --git a/pixman/Makefile.am b/pixman/Makefile.am index 28584f9..df0ae0a 100644 --- a/pixman/Makefile.am +++ b/pixman/Makefile.am @@ -1,6 +1,6 @@ lib_LTLIBRARIES = libpixman.la -libpixman_la_LIBADD = @DEP_LIBS@ +libpixman_la_LIBADD = @DEP_LIBS@ -lm libpixman_la_SOURCES = \ pixman.h \ diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c index 9de1c92..0232ec6 100644 --- a/pixman/pixman-compose.c +++ b/pixman/pixman-compose.c @@ -45,7 +45,34 @@ */ #define INLINE inline -int PictureTransformPoint3d (pixman_transform_t *trans, pixman_vector_t *vector); +int +PictureTransformPoint3d (pixman_transform_t *transform, + pixman_vector_t *vector) +{ + pixman_vector_t result; + int i, j; + pixman_fixed_32_32_t partial; + pixman_fixed_48_16_t v; + + for (j = 0; j < 3; j++) + { + v = 0; + for (i = 0; i < 3; i++) + { + partial = ((pixman_fixed_48_16_t) transform->matrix[j][i] * + (pixman_fixed_48_16_t) vector->vector[i]); + v += partial >> 16; + } + if (v > pixman_max_fixed_48_16 || v < pixman_min_fixed_48_16) + return FALSE; + result.vector[j] = (pixman_fixed_48_16_t) v; + } + if (!result.vector[2]) + return FALSE; + *vector = result; + return TRUE; +} + #ifdef FB_ACCESS_WRAPPER diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 3197efb..a68ea7e 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -248,7 +248,7 @@ pixman_image_set_clip_region (pixman_image_t *image, } #define SCANLINE_BUFFER_LENGTH 2048 - + void pixman_image_composite (pixman_op_t op, pixman_image_t *src_img, diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index fa6fd79..1bcd888 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -177,6 +177,7 @@ union image solid_fill_t solid; }; +int PictureTransformPoint3d (pixman_transform_t *trans, pixman_vector_t *vector); void fbCompositeRect (const FbComposeData *data, uint32_t *scanline_buffer); diff --git a/pixman/pixman.h b/pixman/pixman.h index b9179e5..fa70d47 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -119,6 +119,8 @@ typedef pixman_fixed_16_16_t pixman_fixed_t; #define pixman_fixed_ceil(f) pixman_fixed_floor ((f) + pixman_fixed_1_minus_e) #define pixman_fixed_fraction(f) ((f) & pixman_fixed_1_minus_e) #define pixman_fixed_mod_2(f) ((f) & (pixman_fixed1 | pixman_fixed_1_minus_e)) +#define pixman_max_fixed_48_16 ((pixman_fixed_48_16_t) 0x7fffffff) +#define pixman_min_fixed_48_16 (-((pixman_fixed_48_16_t) 1 << 31)) /* * Misc structs diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..d9c7c44 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,8 @@ +TESTPROGRAMS = \ + composite-test + +noinst_PROGRAMS = $(TESTPROGRAMS) + +INCLUDES = -I$(top_srcdir)/pixman + +composite_test_LDADD = $(top_builddir)/pixman/libpixman.la diff --git a/test/composite-test.c b/test/composite-test.c new file mode 100644 index 0000000..6037f05 --- /dev/null +++ b/test/composite-test.c @@ -0,0 +1,10 @@ +#include +#include "pixman.h" + +int +main () +{ + printf ("Hello World\n"); + + return 0; +}