-SUBDIRS = pixman
+SUBDIRS = pixman test
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA=pixman.pc
AC_SUBST(DEP_CFLAGS)
AC_SUBST(DEP_LIBS)
-AC_OUTPUT([Makefile
+AC_OUTPUT([pixman.pc
+ Makefile
pixman/Makefile
- pixman.pc])
+ test/Makefile])
lib_LTLIBRARIES = libpixman.la
-libpixman_la_LIBADD = @DEP_LIBS@
+libpixman_la_LIBADD = @DEP_LIBS@ -lm
libpixman_la_SOURCES = \
pixman.h \
*/
#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
}
#define SCANLINE_BUFFER_LENGTH 2048
-
+
void
pixman_image_composite (pixman_op_t op,
pixman_image_t *src_img,
solid_fill_t solid;
};
+int PictureTransformPoint3d (pixman_transform_t *trans, pixman_vector_t *vector);
void fbCompositeRect (const FbComposeData *data, uint32_t *scanline_buffer);
#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
--- /dev/null
+TESTPROGRAMS = \
+ composite-test
+
+noinst_PROGRAMS = $(TESTPROGRAMS)
+
+INCLUDES = -I$(top_srcdir)/pixman
+
+composite_test_LDADD = $(top_builddir)/pixman/libpixman.la
--- /dev/null
+#include <stdio.h>
+#include "pixman.h"
+
+int
+main ()
+{
+ printf ("Hello World\n");
+
+ return 0;
+}