summaryrefslogtreecommitdiff
path: root/lib/pixman/test
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2012-08-17 16:15:21 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2012-08-17 16:15:21 +0000
commit37da4cecdf3203bcfabf74bf395998b00d4c5cd8 (patch)
treed8f259a6c100c468563b3888f2079192d1984ad7 /lib/pixman/test
parentd132ce7ce146d081d443903392ab338af89a1c08 (diff)
Update to pixman 0.26.2. tested at least by ajacoutot@, mpi@, shadchin@.
Diffstat (limited to 'lib/pixman/test')
-rw-r--r--lib/pixman/test/Makefile.in472
-rw-r--r--lib/pixman/test/a1-trap-test.c2
-rw-r--r--lib/pixman/test/alphamap.c144
-rw-r--r--lib/pixman/test/blitters-test.c7
-rw-r--r--lib/pixman/test/composite-traps-test.c1
-rw-r--r--lib/pixman/test/composite.c354
-rw-r--r--lib/pixman/test/fetch-test.c8
-rw-r--r--lib/pixman/test/gradient-crash-test.c6
-rw-r--r--lib/pixman/test/lowlevel-blt-bench.c10
-rw-r--r--lib/pixman/test/oob-test.c4
-rw-r--r--lib/pixman/test/region-contains-test.c5
-rw-r--r--lib/pixman/test/region-translate-test.c2
-rw-r--r--lib/pixman/test/scaling-crash-test.c14
-rw-r--r--lib/pixman/test/scaling-test.c1
-rw-r--r--lib/pixman/test/stress-test.c20
-rw-r--r--lib/pixman/test/trap-crasher.c4
-rw-r--r--lib/pixman/test/utils.c211
-rw-r--r--lib/pixman/test/utils.h45
18 files changed, 790 insertions, 520 deletions
diff --git a/lib/pixman/test/Makefile.in b/lib/pixman/test/Makefile.in
index 994690bd7..97b47c812 100644
--- a/lib/pixman/test/Makefile.in
+++ b/lib/pixman/test/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,18 +16,32 @@
@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
-install_sh_PROGRAM = ${SHELL} $(install_sh) -c
-install_sh_SCRIPT = ${SHELL} $(install_sh) -c
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
@@ -38,22 +53,27 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/test/Makefile.sources
+ $(top_srcdir)/depcomp $(top_srcdir)/test/Makefile.sources
noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
+TESTS = $(am__EXEEXT_1)
subdir = test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(install_sh) -d
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libutils_la_LIBADD =
am__objects_1 = utils.lo
am__objects_2 =
am_libutils_la_OBJECTS = $(am__objects_1) $(am__objects_2)
libutils_la_OBJECTS = $(am_libutils_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
am__EXEEXT_1 = a1-trap-test$(EXEEXT) pdf-op-test$(EXEEXT) \
region-test$(EXEEXT) region-translate-test$(EXEEXT) \
fetch-test$(EXEEXT) oob-test$(EXEEXT) trap-crasher$(EXEEXT) \
@@ -166,17 +186,32 @@ trap_crasher_OBJECTS = trap-crasher.$(OBJEXT)
trap_crasher_LDADD = $(LDADD)
trap_crasher_DEPENDENCIES = libutils.la \
$(top_builddir)/pixman/libpixman-1.la $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(libutils_la_SOURCES) a1-trap-test.c affine-test.c \
alpha-loop.c alphamap.c blitters-test.c composite.c \
composite-traps-test.c fetch-test.c gradient-crash-test.c \
@@ -191,13 +226,21 @@ DIST_SOURCES = $(libutils_la_SOURCES) a1-trap-test.c affine-test.c \
region-contains-test.c region-test.c region-translate-test.c \
scaling-crash-test.c scaling-helpers-test.c scaling-test.c \
stress-test.c trap-crasher.c
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
ETAGS = etags
CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = $(am__tty_colors_dummy)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -205,6 +248,7 @@ AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -227,14 +271,14 @@ FGREP = @FGREP@
GREP = @GREP@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
-HAVE_GTK_FALSE = @HAVE_GTK_FALSE@
-HAVE_GTK_TRUE = @HAVE_GTK_TRUE@
HAVE_LIBPNG = @HAVE_LIBPNG@
HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IWMMXT_CFLAGS = @IWMMXT_CFLAGS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
@@ -242,10 +286,12 @@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
+LS_CFLAGS = @LS_CFLAGS@
LTLIBOBJS = @LTLIBOBJS@
LT_VERSION_INFO = @LT_VERSION_INFO@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
MMX_CFLAGS = @MMX_CFLAGS@
MMX_LDFLAGS = @MMX_LDFLAGS@
NM = @NM@
@@ -260,6 +306,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
@@ -279,32 +326,18 @@ SHELL = @SHELL@
SSE2_CFLAGS = @SSE2_CFLAGS@
SSE2_LDFLAGS = @SSE2_LDFLAGS@
STRIP = @STRIP@
-STUBS_CFLAGS = @STUBS_CFLAGS@
-STUBS_LIBS = @STUBS_LIBS@
TESTPROGS_EXTRA_LDFLAGS = @TESTPROGS_EXTRA_LDFLAGS@
TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR = @TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR@
TOOLCHAIN_SUPPORTS__THREAD = @TOOLCHAIN_SUPPORTS__THREAD@
-USE_ARM_IWMMXT_FALSE = @USE_ARM_IWMMXT_FALSE@
-USE_ARM_IWMMXT_TRUE = @USE_ARM_IWMMXT_TRUE@
-USE_ARM_NEON_FALSE = @USE_ARM_NEON_FALSE@
-USE_ARM_NEON_TRUE = @USE_ARM_NEON_TRUE@
-USE_ARM_SIMD_FALSE = @USE_ARM_SIMD_FALSE@
-USE_ARM_SIMD_TRUE = @USE_ARM_SIMD_TRUE@
-USE_GCC_INLINE_ASM_FALSE = @USE_GCC_INLINE_ASM_FALSE@
-USE_GCC_INLINE_ASM_TRUE = @USE_GCC_INLINE_ASM_TRUE@
-USE_SSE2_FALSE = @USE_SSE2_FALSE@
-USE_SSE2_TRUE = @USE_SSE2_TRUE@
-USE_VMX_FALSE = @USE_VMX_FALSE@
-USE_VMX_TRUE = @USE_VMX_TRUE@
-USE_X86_MMX_FALSE = @USE_X86_MMX_FALSE@
-USE_X86_MMX_TRUE = @USE_X86_MMX_TRUE@
VERSION = @VERSION@
VMX_CFLAGS = @VMX_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -316,6 +349,7 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
@@ -343,8 +377,12 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
# Tests (sorted by expected completion time)
TESTPROGRAMS = \
@@ -391,7 +429,6 @@ LDADD = libutils.la $(top_builddir)/pixman/libpixman-1.la -lm $(PNG_LIBS)
INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman $(PNG_CFLAGS)
libutils_la_SOURCES = $(libutils_sources) $(libutils_headers)
noinst_LTLIBRARIES = libutils.la
-TESTS = $(TESTPROGRAMS)
all: all-am
.SUFFIXES:
@@ -400,14 +437,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/test/Makefile.source
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign test/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -417,6 +454,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
+$(top_srcdir)/test/Makefile.sources:
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -425,84 +463,89 @@ $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-libutils.la: $(libutils_la_OBJECTS) $(libutils_la_DEPENDENCIES)
- $(LINK) $(libutils_la_LDFLAGS) $(libutils_la_OBJECTS) $(libutils_la_LIBADD) $(LIBS)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+libutils.la: $(libutils_la_OBJECTS) $(libutils_la_DEPENDENCIES) $(EXTRA_libutils_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(libutils_la_OBJECTS) $(libutils_la_LIBADD) $(LIBS)
clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-a1-trap-test$(EXEEXT): $(a1_trap_test_OBJECTS) $(a1_trap_test_DEPENDENCIES)
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+a1-trap-test$(EXEEXT): $(a1_trap_test_OBJECTS) $(a1_trap_test_DEPENDENCIES) $(EXTRA_a1_trap_test_DEPENDENCIES)
@rm -f a1-trap-test$(EXEEXT)
- $(LINK) $(a1_trap_test_LDFLAGS) $(a1_trap_test_OBJECTS) $(a1_trap_test_LDADD) $(LIBS)
-affine-test$(EXEEXT): $(affine_test_OBJECTS) $(affine_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(a1_trap_test_OBJECTS) $(a1_trap_test_LDADD) $(LIBS)
+affine-test$(EXEEXT): $(affine_test_OBJECTS) $(affine_test_DEPENDENCIES) $(EXTRA_affine_test_DEPENDENCIES)
@rm -f affine-test$(EXEEXT)
- $(LINK) $(affine_test_LDFLAGS) $(affine_test_OBJECTS) $(affine_test_LDADD) $(LIBS)
-alpha-loop$(EXEEXT): $(alpha_loop_OBJECTS) $(alpha_loop_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(affine_test_OBJECTS) $(affine_test_LDADD) $(LIBS)
+alpha-loop$(EXEEXT): $(alpha_loop_OBJECTS) $(alpha_loop_DEPENDENCIES) $(EXTRA_alpha_loop_DEPENDENCIES)
@rm -f alpha-loop$(EXEEXT)
- $(LINK) $(alpha_loop_LDFLAGS) $(alpha_loop_OBJECTS) $(alpha_loop_LDADD) $(LIBS)
-alphamap$(EXEEXT): $(alphamap_OBJECTS) $(alphamap_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(alpha_loop_OBJECTS) $(alpha_loop_LDADD) $(LIBS)
+alphamap$(EXEEXT): $(alphamap_OBJECTS) $(alphamap_DEPENDENCIES) $(EXTRA_alphamap_DEPENDENCIES)
@rm -f alphamap$(EXEEXT)
- $(LINK) $(alphamap_LDFLAGS) $(alphamap_OBJECTS) $(alphamap_LDADD) $(LIBS)
-blitters-test$(EXEEXT): $(blitters_test_OBJECTS) $(blitters_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(alphamap_OBJECTS) $(alphamap_LDADD) $(LIBS)
+blitters-test$(EXEEXT): $(blitters_test_OBJECTS) $(blitters_test_DEPENDENCIES) $(EXTRA_blitters_test_DEPENDENCIES)
@rm -f blitters-test$(EXEEXT)
- $(LINK) $(blitters_test_LDFLAGS) $(blitters_test_OBJECTS) $(blitters_test_LDADD) $(LIBS)
-composite$(EXEEXT): $(composite_OBJECTS) $(composite_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(blitters_test_OBJECTS) $(blitters_test_LDADD) $(LIBS)
+composite$(EXEEXT): $(composite_OBJECTS) $(composite_DEPENDENCIES) $(EXTRA_composite_DEPENDENCIES)
@rm -f composite$(EXEEXT)
- $(LINK) $(composite_LDFLAGS) $(composite_OBJECTS) $(composite_LDADD) $(LIBS)
-composite-traps-test$(EXEEXT): $(composite_traps_test_OBJECTS) $(composite_traps_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(composite_OBJECTS) $(composite_LDADD) $(LIBS)
+composite-traps-test$(EXEEXT): $(composite_traps_test_OBJECTS) $(composite_traps_test_DEPENDENCIES) $(EXTRA_composite_traps_test_DEPENDENCIES)
@rm -f composite-traps-test$(EXEEXT)
- $(LINK) $(composite_traps_test_LDFLAGS) $(composite_traps_test_OBJECTS) $(composite_traps_test_LDADD) $(LIBS)
-fetch-test$(EXEEXT): $(fetch_test_OBJECTS) $(fetch_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(composite_traps_test_OBJECTS) $(composite_traps_test_LDADD) $(LIBS)
+fetch-test$(EXEEXT): $(fetch_test_OBJECTS) $(fetch_test_DEPENDENCIES) $(EXTRA_fetch_test_DEPENDENCIES)
@rm -f fetch-test$(EXEEXT)
- $(LINK) $(fetch_test_LDFLAGS) $(fetch_test_OBJECTS) $(fetch_test_LDADD) $(LIBS)
-gradient-crash-test$(EXEEXT): $(gradient_crash_test_OBJECTS) $(gradient_crash_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(fetch_test_OBJECTS) $(fetch_test_LDADD) $(LIBS)
+gradient-crash-test$(EXEEXT): $(gradient_crash_test_OBJECTS) $(gradient_crash_test_DEPENDENCIES) $(EXTRA_gradient_crash_test_DEPENDENCIES)
@rm -f gradient-crash-test$(EXEEXT)
- $(LINK) $(gradient_crash_test_LDFLAGS) $(gradient_crash_test_OBJECTS) $(gradient_crash_test_LDADD) $(LIBS)
-lowlevel-blt-bench$(EXEEXT): $(lowlevel_blt_bench_OBJECTS) $(lowlevel_blt_bench_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(gradient_crash_test_OBJECTS) $(gradient_crash_test_LDADD) $(LIBS)
+lowlevel-blt-bench$(EXEEXT): $(lowlevel_blt_bench_OBJECTS) $(lowlevel_blt_bench_DEPENDENCIES) $(EXTRA_lowlevel_blt_bench_DEPENDENCIES)
@rm -f lowlevel-blt-bench$(EXEEXT)
- $(LINK) $(lowlevel_blt_bench_LDFLAGS) $(lowlevel_blt_bench_OBJECTS) $(lowlevel_blt_bench_LDADD) $(LIBS)
-oob-test$(EXEEXT): $(oob_test_OBJECTS) $(oob_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(lowlevel_blt_bench_OBJECTS) $(lowlevel_blt_bench_LDADD) $(LIBS)
+oob-test$(EXEEXT): $(oob_test_OBJECTS) $(oob_test_DEPENDENCIES) $(EXTRA_oob_test_DEPENDENCIES)
@rm -f oob-test$(EXEEXT)
- $(LINK) $(oob_test_LDFLAGS) $(oob_test_OBJECTS) $(oob_test_LDADD) $(LIBS)
-pdf-op-test$(EXEEXT): $(pdf_op_test_OBJECTS) $(pdf_op_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(oob_test_OBJECTS) $(oob_test_LDADD) $(LIBS)
+pdf-op-test$(EXEEXT): $(pdf_op_test_OBJECTS) $(pdf_op_test_DEPENDENCIES) $(EXTRA_pdf_op_test_DEPENDENCIES)
@rm -f pdf-op-test$(EXEEXT)
- $(LINK) $(pdf_op_test_LDFLAGS) $(pdf_op_test_OBJECTS) $(pdf_op_test_LDADD) $(LIBS)
-region-contains-test$(EXEEXT): $(region_contains_test_OBJECTS) $(region_contains_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(pdf_op_test_OBJECTS) $(pdf_op_test_LDADD) $(LIBS)
+region-contains-test$(EXEEXT): $(region_contains_test_OBJECTS) $(region_contains_test_DEPENDENCIES) $(EXTRA_region_contains_test_DEPENDENCIES)
@rm -f region-contains-test$(EXEEXT)
- $(LINK) $(region_contains_test_LDFLAGS) $(region_contains_test_OBJECTS) $(region_contains_test_LDADD) $(LIBS)
-region-test$(EXEEXT): $(region_test_OBJECTS) $(region_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(region_contains_test_OBJECTS) $(region_contains_test_LDADD) $(LIBS)
+region-test$(EXEEXT): $(region_test_OBJECTS) $(region_test_DEPENDENCIES) $(EXTRA_region_test_DEPENDENCIES)
@rm -f region-test$(EXEEXT)
- $(LINK) $(region_test_LDFLAGS) $(region_test_OBJECTS) $(region_test_LDADD) $(LIBS)
-region-translate-test$(EXEEXT): $(region_translate_test_OBJECTS) $(region_translate_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(region_test_OBJECTS) $(region_test_LDADD) $(LIBS)
+region-translate-test$(EXEEXT): $(region_translate_test_OBJECTS) $(region_translate_test_DEPENDENCIES) $(EXTRA_region_translate_test_DEPENDENCIES)
@rm -f region-translate-test$(EXEEXT)
- $(LINK) $(region_translate_test_LDFLAGS) $(region_translate_test_OBJECTS) $(region_translate_test_LDADD) $(LIBS)
-scaling-crash-test$(EXEEXT): $(scaling_crash_test_OBJECTS) $(scaling_crash_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(region_translate_test_OBJECTS) $(region_translate_test_LDADD) $(LIBS)
+scaling-crash-test$(EXEEXT): $(scaling_crash_test_OBJECTS) $(scaling_crash_test_DEPENDENCIES) $(EXTRA_scaling_crash_test_DEPENDENCIES)
@rm -f scaling-crash-test$(EXEEXT)
- $(LINK) $(scaling_crash_test_LDFLAGS) $(scaling_crash_test_OBJECTS) $(scaling_crash_test_LDADD) $(LIBS)
-scaling-helpers-test$(EXEEXT): $(scaling_helpers_test_OBJECTS) $(scaling_helpers_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(scaling_crash_test_OBJECTS) $(scaling_crash_test_LDADD) $(LIBS)
+scaling-helpers-test$(EXEEXT): $(scaling_helpers_test_OBJECTS) $(scaling_helpers_test_DEPENDENCIES) $(EXTRA_scaling_helpers_test_DEPENDENCIES)
@rm -f scaling-helpers-test$(EXEEXT)
- $(LINK) $(scaling_helpers_test_LDFLAGS) $(scaling_helpers_test_OBJECTS) $(scaling_helpers_test_LDADD) $(LIBS)
-scaling-test$(EXEEXT): $(scaling_test_OBJECTS) $(scaling_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(scaling_helpers_test_OBJECTS) $(scaling_helpers_test_LDADD) $(LIBS)
+scaling-test$(EXEEXT): $(scaling_test_OBJECTS) $(scaling_test_DEPENDENCIES) $(EXTRA_scaling_test_DEPENDENCIES)
@rm -f scaling-test$(EXEEXT)
- $(LINK) $(scaling_test_LDFLAGS) $(scaling_test_OBJECTS) $(scaling_test_LDADD) $(LIBS)
-stress-test$(EXEEXT): $(stress_test_OBJECTS) $(stress_test_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(scaling_test_OBJECTS) $(scaling_test_LDADD) $(LIBS)
+stress-test$(EXEEXT): $(stress_test_OBJECTS) $(stress_test_DEPENDENCIES) $(EXTRA_stress_test_DEPENDENCIES)
@rm -f stress-test$(EXEEXT)
- $(LINK) $(stress_test_LDFLAGS) $(stress_test_OBJECTS) $(stress_test_LDADD) $(LIBS)
-trap-crasher$(EXEEXT): $(trap_crasher_OBJECTS) $(trap_crasher_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(stress_test_OBJECTS) $(stress_test_LDADD) $(LIBS)
+trap-crasher$(EXEEXT): $(trap_crasher_OBJECTS) $(trap_crasher_DEPENDENCIES) $(EXTRA_trap_crasher_DEPENDENCIES)
@rm -f trap-crasher$(EXEEXT)
- $(LINK) $(trap_crasher_LDFLAGS) $(trap_crasher_OBJECTS) $(trap_crasher_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(trap_crasher_OBJECTS) $(trap_crasher_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -533,25 +576,25 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
-@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -559,54 +602,68 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -614,58 +671,73 @@ distclean-tags:
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
- list='$(TESTS)'; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
- *" $$tst "*) \
+ *[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
- echo "XPASS: $$tst"; \
+ col=$$red; res=XPASS; \
;; \
*) \
- echo "PASS: $$tst"; \
+ col=$$grn; res=PASS; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
- *" $$tst "*) \
+ *[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
- echo "XFAIL: $$tst"; \
+ col=$$lgn; res=XFAIL; \
;; \
*) \
failed=`expr $$failed + 1`; \
- echo "FAIL: $$tst"; \
+ col=$$red; res=FAIL; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
- echo "SKIP: $$tst"; \
+ col=$$blu; res=SKIP; \
fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
- banner="All $$all tests passed"; \
+ banner="$$All$$all $$tests passed"; \
else \
- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all tests failed"; \
+ banner="$$failed of $$all $$tests failed"; \
else \
- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
- skipped="($$skip tests were not run)"; \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
@@ -676,39 +748,46 @@ check-TESTS: $(TESTS)
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
- echo "$$dashes"; \
- echo "$$banner"; \
- test -z "$$skipped" || echo "$$skipped"; \
- test -z "$$report" || echo "$$report"; \
- echo "$$dashes"; \
+ if test "$$failed" -eq 0; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ fi; \
+ echo "$${col}$$dashes$${std}"; \
+ echo "$${col}$$banner$${std}"; \
+ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+ test -z "$$report" || echo "$${col}$$report$${std}"; \
+ echo "$${col}$$dashes$${std}"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
- $(mkdir_p) $(distdir)/../test
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -727,16 +806,22 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -750,7 +835,7 @@ distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
+ distclean-tags
dvi: dvi-am
@@ -758,18 +843,38 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
install-data-am:
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
install-exec-am:
+install-html: install-html-am
+
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -790,19 +895,24 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
clean-generic clean-libtool clean-noinstLTLIBRARIES \
- clean-noinstPROGRAMS ctags distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-exec install-exec-am \
- install-info install-info-am install-man install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am
+ clean-noinstPROGRAMS cscopelist ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/lib/pixman/test/a1-trap-test.c b/lib/pixman/test/a1-trap-test.c
index 6163e7c61..93c6caa14 100644
--- a/lib/pixman/test/a1-trap-test.c
+++ b/lib/pixman/test/a1-trap-test.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "pixman.h"
+#include "utils.h"
int
main (int argc, char **argv)
diff --git a/lib/pixman/test/alphamap.c b/lib/pixman/test/alphamap.c
index 554b309fb..0c5757ea3 100644
--- a/lib/pixman/test/alphamap.c
+++ b/lib/pixman/test/alphamap.c
@@ -2,8 +2,8 @@
#include <stdlib.h>
#include "utils.h"
-#define WIDTH 100
-#define HEIGHT 100
+#define WIDTH 48
+#define HEIGHT 48
static const pixman_format_code_t formats[] =
{
@@ -70,24 +70,6 @@ make_image (pixman_format_code_t format)
return image;
}
-static pixman_image_t *
-create_image (pixman_format_code_t format, pixman_format_code_t alpha_format,
- int alpha_origin_x, int alpha_origin_y)
-{
- pixman_image_t *image = make_image (format);
-
- if (alpha_format != PIXMAN_null)
- {
- pixman_image_t *alpha = make_image (alpha_format);
-
- pixman_image_set_alpha_map (image, alpha,
- alpha_origin_x, alpha_origin_y);
- pixman_image_unref (alpha);
- }
-
- return image;
-}
-
static uint8_t
get_alpha (pixman_image_t *image, int x, int y, int orig_x, int orig_y)
{
@@ -139,7 +121,44 @@ get_alpha (pixman_image_t *image, int x, int y, int orig_x, int orig_y)
return r;
}
-#define ARRAY_LENGTH(A) ((int) (sizeof (A) / sizeof ((A) [0])))
+static uint16_t
+get_red (pixman_image_t *image, int x, int y, int orig_x, int orig_y)
+{
+ uint8_t *bits;
+ uint16_t r;
+
+ bits = (uint8_t *)image->bits.bits;
+
+ if (image->bits.format == PIXMAN_a8)
+ {
+ r = 0x00;
+ }
+ else if (image->bits.format == PIXMAN_a2r10g10b10)
+ {
+ r = ((uint32_t *)bits)[y * WIDTH + x] >> 14;
+ r &= 0xffc0;
+ r |= (r >> 10);
+ }
+ else if (image->bits.format == PIXMAN_a8r8g8b8)
+ {
+ r = ((uint32_t *)bits)[y * WIDTH + x] >> 16;
+ r &= 0xff;
+ r |= r << 8;
+ }
+ else if (image->bits.format == PIXMAN_a4r4g4b4)
+ {
+ r = ((uint16_t *)bits)[y * WIDTH + x] >> 8;
+ r &= 0xf;
+ r |= r << 4;
+ r |= r << 8;
+ }
+ else
+ {
+ assert (0);
+ }
+
+ return r;
+}
static int
run_test (int s, int d, int sa, int da, int soff, int doff)
@@ -148,10 +167,10 @@ run_test (int s, int d, int sa, int da, int soff, int doff)
pixman_format_code_t df = formats[d];
pixman_format_code_t saf = alpha_formats[sa];
pixman_format_code_t daf = alpha_formats[da];
- pixman_image_t *src, *dst, *orig_dst;
+ pixman_image_t *src, *dst, *orig_dst, *alpha, *orig_alpha;
pixman_transform_t t1;
int j, k;
- int n_alpha_bits;
+ int n_alpha_bits, n_red_bits;
soff = origins[soff];
doff = origins[doff];
@@ -160,10 +179,37 @@ run_test (int s, int d, int sa, int da, int soff, int doff)
if (daf != PIXMAN_null)
n_alpha_bits = PIXMAN_FORMAT_A (daf);
+ n_red_bits = PIXMAN_FORMAT_R (df);
+
+ /* Source */
+ src = make_image (sf);
+ if (saf != PIXMAN_null)
+ {
+ alpha = make_image (saf);
+ pixman_image_set_alpha_map (src, alpha, soff, soff);
+ pixman_image_unref (alpha);
+ }
+
+ /* Destination */
+ orig_dst = make_image (df);
+ dst = make_image (df);
+ pixman_image_composite (PIXMAN_OP_SRC, orig_dst, NULL, dst,
+ 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+
+ if (daf != PIXMAN_null)
+ {
+ orig_alpha = make_image (daf);
+ alpha = make_image (daf);
+
+ pixman_image_composite (PIXMAN_OP_SRC, orig_alpha, NULL, alpha,
+ 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
- src = create_image (sf, saf, soff, soff);
- orig_dst = create_image (df, daf, doff, doff);
- dst = create_image (df, daf, doff, doff);
+ pixman_image_set_alpha_map (orig_dst, orig_alpha, doff, doff);
+ pixman_image_set_alpha_map (dst, alpha, doff, doff);
+
+ pixman_image_unref (orig_alpha);
+ pixman_image_unref (alpha);
+ }
/* Transformations, repeats and filters on destinations should be ignored,
* so just set some random ones.
@@ -177,9 +223,6 @@ run_test (int s, int d, int sa, int da, int soff, int doff)
pixman_image_set_filter (dst, PIXMAN_FILTER_BILINEAR, NULL, 0);
pixman_image_set_repeat (dst, PIXMAN_REPEAT_REFLECT);
- pixman_image_composite (PIXMAN_OP_SRC, orig_dst, NULL, dst,
- 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
-
pixman_image_composite (PIXMAN_OP_ADD, src, NULL, dst,
0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
@@ -187,21 +230,22 @@ run_test (int s, int d, int sa, int da, int soff, int doff)
{
for (k = MAX (doff, 0); k < MIN (WIDTH, WIDTH + doff); ++k)
{
- uint8_t sa, da, oda, ref;
+ uint8_t sa, da, oda, refa;
+ uint16_t sr, dr, odr, refr;
sa = get_alpha (src, k, j, soff, soff);
da = get_alpha (dst, k, j, doff, doff);
oda = get_alpha (orig_dst, k, j, doff, doff);
if (sa + oda > 255)
- ref = 255;
+ refa = 255;
else
- ref = sa + oda;
+ refa = sa + oda;
- if (da >> (8 - n_alpha_bits) != ref >> (8 - n_alpha_bits))
+ if (da >> (8 - n_alpha_bits) != refa >> (8 - n_alpha_bits))
{
printf ("\nWrong alpha value at (%d, %d). Should be 0x%x; got 0x%x. Source was 0x%x, original dest was 0x%x\n",
- k, j, ref, da, sa, oda);
+ k, j, refa, da, sa, oda);
printf ("src: %s, alpha: %s, origin %d %d\ndst: %s, alpha: %s, origin: %d %d\n\n",
format_name (sf),
@@ -212,6 +256,38 @@ run_test (int s, int d, int sa, int da, int soff, int doff)
doff, doff);
return 1;
}
+
+ /* There are cases where we go through the 8 bit compositing
+ * path even with 10bpc formats. This results in incorrect
+ * results here, so only do the red check for narrow formats
+ */
+ if (n_red_bits <= 8)
+ {
+ sr = get_red (src, k, j, soff, soff);
+ dr = get_red (dst, k, j, doff, doff);
+ odr = get_red (orig_dst, k, j, doff, doff);
+
+ if (sr + odr > 0xffff)
+ refr = 0xffff;
+ else
+ refr = sr + odr;
+
+ if (abs ((dr >> (16 - n_red_bits)) - (refr >> (16 - n_red_bits))) > 1)
+ {
+ printf ("%d red bits\n", n_red_bits);
+ printf ("\nWrong red value at (%d, %d). Should be 0x%x; got 0x%x. Source was 0x%x, original dest was 0x%x\n",
+ k, j, refr, dr, sr, odr);
+
+ printf ("src: %s, alpha: %s, origin %d %d\ndst: %s, alpha: %s, origin: %d %d\n\n",
+ format_name (sf),
+ format_name (saf),
+ soff, soff,
+ format_name (df),
+ format_name (daf),
+ doff, doff);
+ return 1;
+ }
+ }
}
}
diff --git a/lib/pixman/test/blitters-test.c b/lib/pixman/test/blitters-test.c
index 0252fd4d2..feea308c2 100644
--- a/lib/pixman/test/blitters-test.c
+++ b/lib/pixman/test/blitters-test.c
@@ -5,7 +5,6 @@
* Script 'fuzzer-find-diff.pl' can be used to narrow down the problem in
* the case of test failure.
*/
-#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "utils.h"
@@ -104,7 +103,7 @@ free_random_image (uint32_t initcrc,
mask <<= (PIXMAN_FORMAT_BPP (fmt) - PIXMAN_FORMAT_DEPTH (fmt));
}
- for (i = 0; i < 32; i++)
+ for (i = 0; i * PIXMAN_FORMAT_BPP (fmt) < 32; i++)
mask |= mask << (i * PIXMAN_FORMAT_BPP (fmt));
for (i = 0; i < stride * height / 4; i++)
@@ -281,7 +280,7 @@ test_composite (int testnum, int verbose)
lcg_srand (testnum);
- op = op_list[lcg_rand_n (sizeof (op_list) / sizeof (op_list[0]))];
+ op = op_list[lcg_rand_n (ARRAY_LENGTH (op_list))];
if (lcg_rand_n (8))
{
@@ -425,6 +424,6 @@ main (int argc, const char *argv[])
}
return fuzzer_test_main("blitters", 2000000,
- 0x3EDA4108,
+ 0xA364B5BF,
test_composite, argc, argv);
}
diff --git a/lib/pixman/test/composite-traps-test.c b/lib/pixman/test/composite-traps-test.c
index fa6d8a988..ff03b50d9 100644
--- a/lib/pixman/test/composite-traps-test.c
+++ b/lib/pixman/test/composite-traps-test.c
@@ -1,6 +1,5 @@
/* Based loosely on scaling-test */
-#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "utils.h"
diff --git a/lib/pixman/test/composite.c b/lib/pixman/test/composite.c
index 408c363a3..bdecd75a7 100644
--- a/lib/pixman/test/composite.c
+++ b/lib/pixman/test/composite.c
@@ -22,24 +22,16 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
-#define PIXMAN_USE_INTERNAL_API
-#include <pixman.h>
#include <stdio.h>
#include <stdlib.h> /* abort() */
#include <math.h>
#include <time.h>
#include "utils.h"
-typedef struct color_t color_t;
typedef struct format_t format_t;
typedef struct image_t image_t;
typedef struct operator_t operator_t;
-struct color_t
-{
- double r, g, b, a;
-};
-
struct format_t
{
pixman_format_code_t format;
@@ -482,147 +474,19 @@ do_composite (pixman_op_t op,
result->a = calc_op (op, srcval.a, dst->a, srcalpha.a, dst->a);
}
-static void
-color_correct (pixman_format_code_t format,
- color_t *color)
+static uint32_t
+get_value (pixman_image_t *image)
{
-#define MASK(x) ((1 << (x)) - 1)
-#define round_pix(pix, m) \
- ((int)((pix) * (MASK(m)) + .5) / (double) (MASK(m)))
-
- if (PIXMAN_FORMAT_R (format) == 0)
- {
- color->r = 0.0;
- color->g = 0.0;
- color->b = 0.0;
- }
- else
- {
- color->r = round_pix (color->r, PIXMAN_FORMAT_R (format));
- color->g = round_pix (color->g, PIXMAN_FORMAT_G (format));
- color->b = round_pix (color->b, PIXMAN_FORMAT_B (format));
- }
-
- if (PIXMAN_FORMAT_A (format) == 0)
- color->a = 1.0;
- else
- color->a = round_pix (color->a, PIXMAN_FORMAT_A (format));
+ uint32_t value = *(uint32_t *)pixman_image_get_data (image);
-#undef round_pix
-#undef MASK
-}
-
-static void
-get_pixel (pixman_image_t *image,
- pixman_format_code_t format,
- color_t *color)
-{
-#define MASK(N) ((1UL << (N))-1)
-
- unsigned long rs, gs, bs, as;
- int a, r, g, b;
- unsigned long val;
-
- val = *(unsigned long *) pixman_image_get_data (image);
#ifdef WORDS_BIGENDIAN
- val >>= 8 * sizeof(val) - PIXMAN_FORMAT_BPP (format);
-#endif
-
- /* Number of bits in each channel */
- a = PIXMAN_FORMAT_A (format);
- r = PIXMAN_FORMAT_R (format);
- g = PIXMAN_FORMAT_G (format);
- b = PIXMAN_FORMAT_B (format);
-
- switch (PIXMAN_FORMAT_TYPE (format))
{
- case PIXMAN_TYPE_ARGB:
- bs = 0;
- gs = b + bs;
- rs = g + gs;
- as = r + rs;
- break;
-
- case PIXMAN_TYPE_ABGR:
- rs = 0;
- gs = r + rs;
- bs = g + gs;
- as = b + bs;
- break;
-
- case PIXMAN_TYPE_BGRA:
- as = 0;
- rs = PIXMAN_FORMAT_BPP (format) - (b + g + r);
- gs = r + rs;
- bs = g + gs;
- break;
-
- case PIXMAN_TYPE_RGBA:
- as = 0;
- bs = PIXMAN_FORMAT_BPP (format) - (b + g + r);
- gs = b + bs;
- rs = g + gs;
- break;
-
- case PIXMAN_TYPE_A:
- as = 0;
- rs = 0;
- gs = 0;
- bs = 0;
- break;
-
- case PIXMAN_TYPE_OTHER:
- case PIXMAN_TYPE_COLOR:
- case PIXMAN_TYPE_GRAY:
- case PIXMAN_TYPE_YUY2:
- case PIXMAN_TYPE_YV12:
- default:
- abort ();
- as = 0;
- rs = 0;
- gs = 0;
- bs = 0;
- break;
- }
-
- if (MASK (a) != 0)
- color->a = ((val >> as) & MASK (a)) / (double) MASK (a);
- else
- color->a = 1.0;
-
- if (MASK (r) != 0)
- {
- color->r = ((val >> rs) & MASK (r)) / (double) MASK (r);
- color->g = ((val >> gs) & MASK (g)) / (double) MASK (g);
- color->b = ((val >> bs) & MASK (b)) / (double) MASK (b);
+ pixman_format_code_t format = pixman_image_get_format (image);
+ value >>= 8 * sizeof(value) - PIXMAN_FORMAT_BPP (format);
}
- else
- {
- color->r = 0.0;
- color->g = 0.0;
- color->b = 0.0;
- }
-
-#undef MASK
-}
-
-static double
-eval_diff (color_t *expected, color_t *test, pixman_format_code_t format)
-{
- double rscale, gscale, bscale, ascale;
- double rdiff, gdiff, bdiff, adiff;
-
- rscale = 1.0 * ((1 << PIXMAN_FORMAT_R (format)) - 1);
- gscale = 1.0 * ((1 << PIXMAN_FORMAT_G (format)) - 1);
- bscale = 1.0 * ((1 << PIXMAN_FORMAT_B (format)) - 1);
- ascale = 1.0 * ((1 << PIXMAN_FORMAT_A (format)) - 1);
-
- rdiff = fabs (test->r - expected->r) * rscale;
- bdiff = fabs (test->g - expected->g) * gscale;
- gdiff = fabs (test->b - expected->b) * bscale;
- adiff = fabs (test->a - expected->a) * ascale;
+#endif
- return MAX (MAX (MAX (rdiff, gdiff), bdiff), adiff);
+ return value;
}
static char *
@@ -630,10 +494,10 @@ describe_image (image_t *info, char *buf)
{
if (info->size)
{
- sprintf (buf, "%s %dx%d%s",
+ sprintf (buf, "%s, %dx%d%s",
info->format->name,
info->size, info->size,
- info->repeat ? "R" :"");
+ info->repeat ? " R" :"");
}
else
{
@@ -643,52 +507,41 @@ describe_image (image_t *info, char *buf)
return buf;
}
-/* Test a composite of a given operation, source, mask, and destination
- * picture.
- * Fills the window, and samples from the 0,0 pixel corner.
- */
+static char *
+describe_color (const color_t *color, char *buf)
+{
+ sprintf (buf, "%.3f %.3f %.3f %.3f",
+ color->r, color->g, color->b, color->a);
+
+ return buf;
+}
+
static pixman_bool_t
composite_test (image_t *dst,
const operator_t *op,
image_t *src,
image_t *mask,
- pixman_bool_t component_alpha)
+ pixman_bool_t component_alpha,
+ int testno)
{
pixman_color_t fill;
- pixman_rectangle16_t rect;
- color_t expected, result, tdst, tsrc, tmsk;
- double diff;
- pixman_bool_t success = TRUE;
+ color_t expected, tdst, tsrc, tmsk;
+ pixel_checker_t checker;
+ pixman_image_t *solid;
+ /* Initialize dst */
compute_pixman_color (dst->color, &fill);
- rect.x = rect.y = 0;
- rect.width = rect.height = dst->size;
- pixman_image_fill_rectangles (PIXMAN_OP_SRC, dst->image,
- &fill, 1, &rect);
+ solid = pixman_image_create_solid_fill (&fill);
+ pixman_image_composite32 (PIXMAN_OP_SRC, solid, NULL, dst->image,
+ 0, 0, 0, 0, 0, 0, dst->size, dst->size);
+ pixman_image_unref (solid);
- if (mask != NULL)
+ if (mask)
{
pixman_image_set_component_alpha (mask->image, component_alpha);
- pixman_image_composite (op->op, src->image, mask->image, dst->image,
- 0, 0,
- 0, 0,
- 0, 0,
- dst->size, dst->size);
- tmsk = *mask->color;
- if (mask->size)
- {
- color_correct (mask->format->format, &tmsk);
-
- if (component_alpha &&
- PIXMAN_FORMAT_R (mask->format->format) == 0)
- {
- /* Ax component-alpha masks expand alpha into
- * all color channels.
- */
- tmsk.r = tmsk.g = tmsk.b = tmsk.a;
- }
- }
+ pixman_image_composite (op->op, src->image, mask->image, dst->image,
+ 0, 0, 0, 0, 0, 0, dst->size, dst->size);
}
else
{
@@ -698,71 +551,81 @@ composite_test (image_t *dst,
0, 0,
dst->size, dst->size);
}
- get_pixel (dst->image, dst->format->format, &result);
tdst = *dst->color;
- color_correct (dst->format->format, &tdst);
+ round_color (dst->format->format, &tdst);
+
tsrc = *src->color;
if (src->size)
- color_correct (src->format->format, &tsrc);
- do_composite (op->op, &tsrc, mask ? &tmsk : NULL, &tdst,
- &expected, component_alpha);
- color_correct (dst->format->format, &expected);
-
- diff = eval_diff (&expected, &result, dst->format->format);
-
- /* FIXME: We should find out what deviation is acceptable. 3.0
- * is clearly absurd for 2 bit formats for example. On the other
- * hand currently 1.0 does not work.
- */
- if (diff > 3.0)
+ round_color (src->format->format, &tsrc);
+
+ if (mask)
{
- char buf[40];
+ tmsk = *mask->color;
+ if (mask->size)
+ round_color (mask->format->format, &tmsk);
+ if (component_alpha && PIXMAN_FORMAT_R (mask->format->format) == 0)
+ {
+ /* Ax component-alpha masks expand alpha into
+ * all color channels.
+ */
+ tmsk.r = tmsk.g = tmsk.b = tmsk.a;
+ }
+ }
- sprintf (buf, "%s %scomposite",
- op->name,
- component_alpha ? "CA " : "");
+ do_composite (op->op,
+ &tsrc,
+ mask? &tmsk : NULL,
+ &tdst,
+ &expected,
+ component_alpha);
- printf ("%s test error of %.4f --\n"
- " R G B A\n"
- "got: %.2f %.2f %.2f %.2f [%08lx]\n"
- "expected: %.2f %.2f %.2f %.2f\n",
- buf, diff,
- result.r, result.g, result.b, result.a,
- *(unsigned long *) pixman_image_get_data (dst->image),
- expected.r, expected.g, expected.b, expected.a);
+ pixel_checker_init (&checker, dst->format->format);
+ if (!pixel_checker_check (&checker, get_value (dst->image), &expected))
+ {
+ char buf[40], buf2[40];
+ int a, r, g, b;
+ uint32_t pixel;
+
+ printf ("---- Test %d failed ----\n", testno);
+ printf ("Operator: %s %s\n",
+ op->name, component_alpha ? "CA" : "");
+
+ printf ("Source: %s\n", describe_image (src, buf));
if (mask != NULL)
+ printf ("Mask: %s\n", describe_image (mask, buf));
+
+ printf ("Destination: %s\n\n", describe_image (dst, buf));
+ printf (" R G B A Rounded\n");
+ printf ("Source color: %s %s\n",
+ describe_color (src->color, buf),
+ describe_color (&tsrc, buf2));
+ if (mask)
{
- printf ("src color: %.2f %.2f %.2f %.2f\n"
- "msk color: %.2f %.2f %.2f %.2f\n"
- "dst color: %.2f %.2f %.2f %.2f\n",
- src->color->r, src->color->g,
- src->color->b, src->color->a,
- mask->color->r, mask->color->g,
- mask->color->b, mask->color->a,
- dst->color->r, dst->color->g,
- dst->color->b, dst->color->a);
- printf ("src: %s, ", describe_image (src, buf));
- printf ("mask: %s, ", describe_image (mask, buf));
- printf ("dst: %s\n\n", describe_image (dst, buf));
- }
- else
- {
- printf ("src color: %.2f %.2f %.2f %.2f\n"
- "dst color: %.2f %.2f %.2f %.2f\n",
- src->color->r, src->color->g,
- src->color->b, src->color->a,
- dst->color->r, dst->color->g,
- dst->color->b, dst->color->a);
- printf ("src: %s, ", describe_image (src, buf));
- printf ("dst: %s\n\n", describe_image (dst, buf));
+ printf ("Mask color: %s %s\n",
+ describe_color (mask->color, buf),
+ describe_color (&tmsk, buf2));
}
+ printf ("Dest. color: %s %s\n",
+ describe_color (dst->color, buf),
+ describe_color (&tdst, buf2));
- success = FALSE;
- }
+ pixel = get_value (dst->image);
+
+ printf ("Expected: %s\n", describe_color (&expected, buf));
- return success;
+ pixel_checker_split_pixel (&checker, pixel, &a, &r, &g, &b);
+
+ printf ("Got: %5d %5d %5d %5d [pixel: 0x%08x]\n", r, g, b, a, pixel);
+ pixel_checker_get_min (&checker, &expected, &a, &r, &g, &b);
+ printf ("Min accepted: %5d %5d %5d %5d\n", r, g, b, a);
+ pixel_checker_get_max (&checker, &expected, &a, &r, &g, &b);
+ printf ("Max accepted: %5d %5d %5d %5d\n", r, g, b, a);
+
+ return FALSE;
+ }
+ return TRUE;
}
static void
@@ -782,18 +645,18 @@ image_init (image_t *info,
if (info->size)
{
- pixman_rectangle16_t rect;
+ pixman_image_t *solid;
info->image = pixman_image_create_bits (info->format->format,
info->size, info->size,
NULL, 0);
- rect.x = rect.y = 0;
- rect.width = rect.height = info->size;
- pixman_image_fill_rectangles (PIXMAN_OP_SRC, info->image, &fill,
- 1, &rect);
+ solid = pixman_image_create_solid_fill (&fill);
+ pixman_image_composite32 (PIXMAN_OP_SRC, solid, NULL, info->image,
+ 0, 0, 0, 0, 0, 0, info->size, info->size);
+ pixman_image_unref (solid);
- if (size & REPEAT)
+ if (sizes[size] & REPEAT)
{
pixman_image_set_repeat (info->image, PIXMAN_REPEAT_NORMAL);
info->repeat = PIXMAN_REPEAT_NORMAL;
@@ -838,7 +701,7 @@ run_test (uint32_t seed)
int ok;
lcg_srand (seed);
-
+
image_init (&dst, random_color(), random_format(), 1);
image_init (&src, random_color(), random_format(), random_size());
image_init (&mask, random_color(), random_format(), random_size());
@@ -850,14 +713,14 @@ run_test (uint32_t seed)
switch (ca)
{
case 0:
- ok = composite_test (&dst, op, &src, NULL, FALSE);
+ ok = composite_test (&dst, op, &src, NULL, FALSE, seed);
break;
case 1:
- ok = composite_test (&dst, op, &src, &mask, FALSE);
+ ok = composite_test (&dst, op, &src, &mask, FALSE, seed);
break;
case 2:
ok = composite_test (&dst, op, &src, &mask,
- mask.size? TRUE : FALSE);
+ mask.size? TRUE : FALSE, seed);
break;
default:
ok = FALSE;
@@ -876,12 +739,13 @@ main (int argc, char **argv)
{
#define N_TESTS (8 * 1024 * 1024)
int result = 0;
- uint32_t i, seed;
+ uint32_t seed;
+ int32_t i;
if (argc > 1)
{
char *end;
-
+
i = strtol (argv[1], &end, 0);
if (end != argv[1])
@@ -902,7 +766,7 @@ main (int argc, char **argv)
seed = get_random_seed();
else
seed = 1;
-
+
#ifdef USE_OPENMP
# pragma omp parallel for default(none) shared(result, argv, seed)
#endif
@@ -911,10 +775,10 @@ main (int argc, char **argv)
if (!result && !run_test (i + seed))
{
printf ("Test 0x%08X failed.\n", seed + i);
-
+
result = seed + i;
}
}
-
+
return result;
}
diff --git a/lib/pixman/test/fetch-test.c b/lib/pixman/test/fetch-test.c
index 9f80eec1b..04e8cc583 100644
--- a/lib/pixman/test/fetch-test.c
+++ b/lib/pixman/test/fetch-test.c
@@ -1,11 +1,7 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
-#include "pixman.h"
+#include "utils.h"
#define SIZE 1024
@@ -107,7 +103,7 @@ static testcase_t testcases[] =
},
};
-int n_test_cases = sizeof(testcases)/sizeof(testcases[0]);
+int n_test_cases = ARRAY_LENGTH (testcases);
static uint32_t
diff --git a/lib/pixman/test/gradient-crash-test.c b/lib/pixman/test/gradient-crash-test.c
index c85712d69..73e5bbcd5 100644
--- a/lib/pixman/test/gradient-crash-test.c
+++ b/lib/pixman/test/gradient-crash-test.c
@@ -106,17 +106,17 @@ main (int argc, char **argv)
if (i == 0)
{
stops = onestop;
- num_stops = sizeof(onestop) / sizeof(onestop[0]);
+ num_stops = ARRAY_LENGTH (onestop);
}
else if (i == 1)
{
stops = subsetstops;
- num_stops = sizeof(subsetstops) / sizeof(subsetstops[0]);
+ num_stops = ARRAY_LENGTH (subsetstops);
}
else
{
stops = stops01;
- num_stops = sizeof(stops01) / sizeof(stops01[0]);
+ num_stops = ARRAY_LENGTH (stops01);
}
for (j = 0; j < 3; ++j)
diff --git a/lib/pixman/test/lowlevel-blt-bench.c b/lib/pixman/test/lowlevel-blt-bench.c
index bdafb3592..8a39a4615 100644
--- a/lib/pixman/test/lowlevel-blt-bench.c
+++ b/lib/pixman/test/lowlevel-blt-bench.c
@@ -25,10 +25,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#define PIXMAN_USE_INTERNAL_API
-#include <pixman.h>
-
#include "utils.h"
#define SOLID_FLAG 1
@@ -586,6 +582,8 @@ tests_tbl[] =
{ "add_1555_1555", PIXMAN_a1r5g5b5, 0, PIXMAN_OP_ADD, PIXMAN_null, 0, PIXMAN_a1r5g5b5 },
{ "add_0565_2x10", PIXMAN_r5g6b5, 0, PIXMAN_OP_ADD, PIXMAN_null, 0, PIXMAN_x2r10g10b10 },
{ "add_2a10_2a10", PIXMAN_a2r10g10b10, 0, PIXMAN_OP_ADD, PIXMAN_null, 0, PIXMAN_a2r10g10b10 },
+ { "in_n_8_8", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_IN, PIXMAN_a8, 0, PIXMAN_a8 },
+ { "in_8_8", PIXMAN_a8, 0, PIXMAN_OP_IN, PIXMAN_null, 0, PIXMAN_a8 },
{ "src_n_2222", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_a2r2g2b2 },
{ "src_n_0565", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_r5g6b5 },
{ "src_n_1555", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_SRC, PIXMAN_null, 0, PIXMAN_a1r5g5b5 },
@@ -630,6 +628,7 @@ tests_tbl[] =
{ "over_n_0565", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OVER, PIXMAN_null, 0, PIXMAN_r5g6b5 },
{ "over_n_1555", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OVER, PIXMAN_null, 0, PIXMAN_a1r5g5b5 },
{ "over_8888_0565", PIXMAN_a8r8g8b8, 0, PIXMAN_OP_OVER, PIXMAN_null, 0, PIXMAN_r5g6b5 },
+ { "over_8888_8888", PIXMAN_a8r8g8b8, 0, PIXMAN_OP_OVER, PIXMAN_null, 0, PIXMAN_a8r8g8b8 },
{ "over_8888_x888", PIXMAN_a8r8g8b8, 0, PIXMAN_OP_OVER, PIXMAN_null, 0, PIXMAN_x8r8g8b8 },
{ "over_x888_8_0565", PIXMAN_x8r8g8b8, 0, PIXMAN_OP_OVER, PIXMAN_a8, 0, PIXMAN_r5g6b5 },
{ "over_x888_8_8888", PIXMAN_x8r8g8b8, 0, PIXMAN_OP_OVER, PIXMAN_a8, 0, PIXMAN_a8r8g8b8 },
@@ -653,6 +652,7 @@ tests_tbl[] =
{ "over_8888_n_x888", PIXMAN_a8r8g8b8, 0, PIXMAN_OP_OVER, PIXMAN_a8, 1, PIXMAN_x8r8g8b8 },
{ "over_8888_n_0565", PIXMAN_a8r8g8b8, 0, PIXMAN_OP_OVER, PIXMAN_a8, 1, PIXMAN_r5g6b5 },
{ "over_8888_n_1555", PIXMAN_a8r8g8b8, 0, PIXMAN_OP_OVER, PIXMAN_a8, 1, PIXMAN_a1r5g5b5 },
+ { "over_x888_n_8888", PIXMAN_x8r8g8b8, 0, PIXMAN_OP_OVER, PIXMAN_a8, 1, PIXMAN_a8r8g8b8 },
{ "outrev_n_8_0565", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OUT_REV, PIXMAN_a8, 0, PIXMAN_r5g6b5 },
{ "outrev_n_8_1555", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OUT_REV, PIXMAN_a8, 0, PIXMAN_a1r5g5b5 },
{ "outrev_n_8_x888", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OUT_REV, PIXMAN_a8, 0, PIXMAN_x8r8g8b8 },
@@ -707,7 +707,7 @@ main (int argc, char *argv[])
x / 1000000., x / 4000000);
printf ("---\n");
- for (i = 0; i < sizeof(tests_tbl) / sizeof(tests_tbl[0]); i++)
+ for (i = 0; i < ARRAY_LENGTH (tests_tbl); i++)
{
if (strcmp (pattern, "all") == 0 || strstr (tests_tbl[i].testname, pattern))
{
diff --git a/lib/pixman/test/oob-test.c b/lib/pixman/test/oob-test.c
index 4f9e5a244..0d19b504a 100644
--- a/lib/pixman/test/oob-test.c
+++ b/lib/pixman/test/oob-test.c
@@ -1,6 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include "pixman.h"
+#include "utils.h"
typedef struct
{
@@ -94,7 +94,7 @@ main (int argc, char **argv)
{
int i;
- for (i = 0; i < sizeof (info) / sizeof (info[0]); ++i)
+ for (i = 0; i < ARRAY_LENGTH (info); ++i)
test_composite (&info[i]);
return 0;
diff --git a/lib/pixman/test/region-contains-test.c b/lib/pixman/test/region-contains-test.c
index b660fdf0b..9524e2888 100644
--- a/lib/pixman/test/region-contains-test.c
+++ b/lib/pixman/test/region-contains-test.c
@@ -1,4 +1,3 @@
-#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "utils.h"
@@ -74,7 +73,7 @@ random_coord (pixman_region32_t *region, pixman_bool_t x)
case 3:
return begin;
default:
- return (begin + end) / 2;
+ return (end - begin) / 2 + begin;
}
return 0;
}
@@ -164,7 +163,7 @@ main (int argc, const char *argv[])
{
return fuzzer_test_main ("region_contains",
1000000,
- 0xD7C297CC,
+ 0xD2BF8C73,
test_region_contains_rectangle,
argc, argv);
}
diff --git a/lib/pixman/test/region-translate-test.c b/lib/pixman/test/region-translate-test.c
index 0e96a5eb9..5a03027e8 100644
--- a/lib/pixman/test/region-translate-test.c
+++ b/lib/pixman/test/region-translate-test.c
@@ -1,5 +1,5 @@
-#include <pixman.h>
#include <assert.h>
+#include "utils.h"
/* Pixman had a bug where 32bit regions where clipped to 16bit sizes when
* pixman_region32_translate() was called. This test exercises that bug.
diff --git a/lib/pixman/test/scaling-crash-test.c b/lib/pixman/test/scaling-crash-test.c
index 40323d416..0dac892b5 100644
--- a/lib/pixman/test/scaling-crash-test.c
+++ b/lib/pixman/test/scaling-crash-test.c
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include "pixman.h"
+#include "utils.h"
/*
* We have a source image filled with solid color, set NORMAL or PAD repeat,
@@ -32,8 +32,8 @@ run_test (int32_t dst_width,
pixman_transform_t transform;
uint32_t * srcbuf;
uint32_t * dstbuf;
- pixman_box32_t box = { 0, 0, src_width, src_height };
pixman_color_t color_cc = { 0xcccc, 0xcccc, 0xcccc, 0xcccc };
+ pixman_image_t * solid;
int result;
int i;
@@ -62,7 +62,10 @@ run_test (int32_t dst_width,
PIXMAN_a8r8g8b8, src_width, src_height,
srcbuf + (src_width + 10) * 5 + 5, (src_width + 10) * 4);
- pixman_image_fill_boxes (PIXMAN_OP_SRC, src_img, &color_cc, 1, &box);
+ solid = pixman_image_create_solid_fill (&color_cc);
+ pixman_image_composite32 (PIXMAN_OP_SRC, solid, NULL, src_img,
+ 0, 0, 0, 0, 0, 0, src_width, src_height);
+ pixman_image_unref (solid);
dst_img = pixman_image_create_bits (
PIXMAN_a8r8g8b8, dst_width, dst_height, dstbuf, dst_width * 4);
@@ -130,12 +133,11 @@ do_test (int32_t dst_size,
int32_t src_offs,
int32_t scale_factor)
{
-#define N_ELEMENTS(a) (sizeof (a) / sizeof ((a)[0]))
int i, j;
- for (i = 0; i < N_ELEMENTS(filters); ++i)
+ for (i = 0; i < ARRAY_LENGTH (filters); ++i)
{
- for (j = 0; j < N_ELEMENTS (repeats); ++j)
+ for (j = 0; j < ARRAY_LENGTH (repeats); ++j)
{
/* horizontal test */
if (run_test (dst_size, 1,
diff --git a/lib/pixman/test/scaling-test.c b/lib/pixman/test/scaling-test.c
index 82370f77a..6f2da1432 100644
--- a/lib/pixman/test/scaling-test.c
+++ b/lib/pixman/test/scaling-test.c
@@ -7,7 +7,6 @@
* Script 'fuzzer-find-diff.pl' can be used to narrow down the problem in
* the case of test failure.
*/
-#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "utils.h"
diff --git a/lib/pixman/test/stress-test.c b/lib/pixman/test/stress-test.c
index 571420ab0..7fc067e82 100644
--- a/lib/pixman/test/stress-test.c
+++ b/lib/pixman/test/stress-test.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include "utils.h"
#include <sys/types.h>
@@ -165,7 +166,8 @@ fake_reader (const void *src, int size)
uint32_t r = lcg_rand_u32 ();
assert (size == 1 || size == 2 || size == 4);
- return r & ((1 << (size * 8)) - 1);
+
+ return r >> (32 - (size * 8));
}
static void
@@ -410,6 +412,7 @@ set_general_properties (pixman_image_t *image, pixman_bool_t allow_alpha_map)
case 6: case 7:
n_rects = 3;
+ break;
default:
n_rects = lcg_rand_n (100);
@@ -795,10 +798,10 @@ main (int argc, char **argv)
{
int verbose = FALSE;
uint32_t seed = 1;
- uint32_t n_tests = 0xffffffff;
+ uint32_t n_tests = 8000;
uint32_t mod = 0;
pixman_bool_t use_threads = TRUE;
- uint32_t i;
+ int32_t i;
pixman_disable_out_of_bounds_workaround ();
@@ -845,9 +848,6 @@ main (int argc, char **argv)
}
}
- if (n_tests == 0xffffffff)
- n_tests = 8000;
-
if (getenv ("PIXMAN_RANDOMIZE_TESTS"))
{
seed = get_random_seed();
@@ -859,13 +859,13 @@ main (int argc, char **argv)
#ifdef USE_OPENMP
# pragma omp parallel for default(none) shared(verbose, n_tests, mod, seed)
#endif
- for (i = seed; i < seed + n_tests; ++i)
- run_test (i, verbose, mod);
+ for (i = 0; i < (int32_t)n_tests; ++i)
+ run_test (seed + i, verbose, mod);
}
else
{
- for (i = seed; i < seed + n_tests; ++i)
- run_test (i, verbose, mod);
+ for (i = 0; i < (int32_t)n_tests; ++i)
+ run_test (seed + i, verbose, mod);
}
return 0;
diff --git a/lib/pixman/test/trap-crasher.c b/lib/pixman/test/trap-crasher.c
index 7485e62fd..4e4cac297 100644
--- a/lib/pixman/test/trap-crasher.c
+++ b/lib/pixman/test/trap-crasher.c
@@ -1,5 +1,5 @@
#include <stdlib.h>
-#include <pixman.h>
+#include "utils.h"
int
main()
@@ -22,6 +22,6 @@ main()
dst = pixman_image_create_bits (PIXMAN_a8, 1, 1, NULL, -1);
- pixman_add_trapezoids (dst, 0, 0, sizeof (traps)/sizeof (traps[0]), traps);
+ pixman_add_trapezoids (dst, 0, 0, ARRAY_LENGTH (traps), traps);
return (0);
}
diff --git a/lib/pixman/test/utils.c b/lib/pixman/test/utils.c
index adabd75dd..c1bf6dc2c 100644
--- a/lib/pixman/test/utils.c
+++ b/lib/pixman/test/utils.c
@@ -2,6 +2,7 @@
#include "utils.h"
#include <signal.h>
+#include <stdlib.h>
#ifdef HAVE_GETTIMEOFDAY
#include <sys/time.h>
@@ -339,17 +340,15 @@ make_random_bytes (int n_bytes)
return bytes;
}
-#ifdef HAVE_LIBPNG
-
-static void
-pngify_pixels (uint32_t *pixels, int n_pixels)
+void
+a8r8g8b8_to_rgba_np (uint32_t *dst, uint32_t *src, int n_pixels)
{
+ uint8_t *dst8 = (uint8_t *)dst;
int i;
for (i = 0; i < n_pixels; ++i)
{
- uint32_t p = pixels[i];
- uint8_t *out = (uint8_t *)&(pixels[i]);
+ uint32_t p = src[i];
uint8_t a, r, g, b;
a = (p & 0xff000000) >> 24;
@@ -359,18 +358,27 @@ pngify_pixels (uint32_t *pixels, int n_pixels)
if (a != 0)
{
- r = (r * 255) / a;
- g = (g * 255) / a;
- b = (b * 255) / a;
+#define DIVIDE(c, a) \
+ do \
+ { \
+ int t = ((c) * 255) / a; \
+ (c) = t < 0? 0 : t > 255? 255 : t; \
+ } while (0)
+
+ DIVIDE (r, a);
+ DIVIDE (g, a);
+ DIVIDE (b, a);
}
- *out++ = r;
- *out++ = g;
- *out++ = b;
- *out++ = a;
+ *dst8++ = r;
+ *dst8++ = g;
+ *dst8++ = b;
+ *dst8++ = a;
}
}
+#ifdef HAVE_LIBPNG
+
pixman_bool_t
write_png (pixman_image_t *image, const char *filename)
{
@@ -397,7 +405,7 @@ write_png (pixman_image_t *image, const char *filename)
pixman_image_composite32 (
PIXMAN_OP_SRC, image, NULL, copy, 0, 0, 0, 0, 0, 0, width, height);
- pngify_pixels (data, height * width);
+ a8r8g8b8_to_rgba_np (data, data, height * width);
for (i = 0; i < height; ++i)
row_pointers[i] = (png_bytep)(data + i * width);
@@ -702,3 +710,178 @@ initialize_palette (pixman_indexed_t *palette, uint32_t depth, int is_rgb)
assert (palette->ent[CONVERT_15 (palette->rgba[i], is_rgb)] == i);
}
}
+
+static double
+round_channel (double p, int m)
+{
+ int t;
+ double r;
+
+ t = p * ((1 << m));
+ t -= t >> m;
+
+ r = t / (double)((1 << m) - 1);
+
+ return r;
+}
+
+void
+round_color (pixman_format_code_t format, color_t *color)
+{
+ if (PIXMAN_FORMAT_R (format) == 0)
+ {
+ color->r = 0.0;
+ color->g = 0.0;
+ color->b = 0.0;
+ }
+ else
+ {
+ color->r = round_channel (color->r, PIXMAN_FORMAT_R (format));
+ color->g = round_channel (color->g, PIXMAN_FORMAT_G (format));
+ color->b = round_channel (color->b, PIXMAN_FORMAT_B (format));
+ }
+
+ if (PIXMAN_FORMAT_A (format) == 0)
+ color->a = 1;
+ else
+ color->a = round_channel (color->a, PIXMAN_FORMAT_A (format));
+}
+
+/* Check whether @pixel is a valid quantization of the a, r, g, b
+ * parameters. Some slack is permitted.
+ */
+void
+pixel_checker_init (pixel_checker_t *checker, pixman_format_code_t format)
+{
+ assert (PIXMAN_FORMAT_VIS (format));
+
+ checker->format = format;
+
+ switch (PIXMAN_FORMAT_TYPE (format))
+ {
+ case PIXMAN_TYPE_A:
+ checker->bs = 0;
+ checker->gs = 0;
+ checker->rs = 0;
+ checker->as = 0;
+ break;
+
+ case PIXMAN_TYPE_ARGB:
+ checker->bs = 0;
+ checker->gs = checker->bs + PIXMAN_FORMAT_B (format);
+ checker->rs = checker->gs + PIXMAN_FORMAT_G (format);
+ checker->as = checker->rs + PIXMAN_FORMAT_R (format);
+ break;
+
+ case PIXMAN_TYPE_ABGR:
+ checker->rs = 0;
+ checker->gs = checker->rs + PIXMAN_FORMAT_R (format);
+ checker->bs = checker->gs + PIXMAN_FORMAT_G (format);
+ checker->as = checker->bs + PIXMAN_FORMAT_B (format);
+ break;
+
+ case PIXMAN_TYPE_BGRA:
+ /* With BGRA formats we start counting at the high end of the pixel */
+ checker->bs = PIXMAN_FORMAT_BPP (format) - PIXMAN_FORMAT_B (format);
+ checker->gs = checker->bs - PIXMAN_FORMAT_B (format);
+ checker->rs = checker->gs - PIXMAN_FORMAT_G (format);
+ checker->as = checker->rs - PIXMAN_FORMAT_R (format);
+ break;
+
+ case PIXMAN_TYPE_RGBA:
+ /* With BGRA formats we start counting at the high end of the pixel */
+ checker->rs = PIXMAN_FORMAT_BPP (format) - PIXMAN_FORMAT_R (format);
+ checker->gs = checker->rs - PIXMAN_FORMAT_R (format);
+ checker->bs = checker->gs - PIXMAN_FORMAT_G (format);
+ checker->as = checker->bs - PIXMAN_FORMAT_B (format);
+ break;
+
+ default:
+ assert (0);
+ break;
+ }
+
+ checker->am = ((1 << PIXMAN_FORMAT_A (format)) - 1) << checker->as;
+ checker->rm = ((1 << PIXMAN_FORMAT_R (format)) - 1) << checker->rs;
+ checker->gm = ((1 << PIXMAN_FORMAT_G (format)) - 1) << checker->gs;
+ checker->bm = ((1 << PIXMAN_FORMAT_B (format)) - 1) << checker->bs;
+
+ checker->aw = PIXMAN_FORMAT_A (format);
+ checker->rw = PIXMAN_FORMAT_R (format);
+ checker->gw = PIXMAN_FORMAT_G (format);
+ checker->bw = PIXMAN_FORMAT_B (format);
+}
+
+void
+pixel_checker_split_pixel (const pixel_checker_t *checker, uint32_t pixel,
+ int *a, int *r, int *g, int *b)
+{
+ *a = (pixel & checker->am) >> checker->as;
+ *r = (pixel & checker->rm) >> checker->rs;
+ *g = (pixel & checker->gm) >> checker->gs;
+ *b = (pixel & checker->bm) >> checker->bs;
+}
+
+static int32_t
+convert (double v, uint32_t width, uint32_t mask, uint32_t shift, double def)
+{
+ int32_t r;
+
+ if (!mask)
+ v = def;
+
+ r = (v * ((mask >> shift) + 1));
+ r -= r >> width;
+
+ return r;
+}
+
+static void
+get_limits (const pixel_checker_t *checker, double limit,
+ color_t *color,
+ int *ao, int *ro, int *go, int *bo)
+{
+ *ao = convert (color->a + limit, checker->aw, checker->am, checker->as, 1.0);
+ *ro = convert (color->r + limit, checker->rw, checker->rm, checker->rs, 0.0);
+ *go = convert (color->g + limit, checker->gw, checker->gm, checker->gs, 0.0);
+ *bo = convert (color->b + limit, checker->bw, checker->bm, checker->bs, 0.0);
+}
+
+/* The acceptable deviation in units of [0.0, 1.0]
+ */
+#define DEVIATION (0.004)
+
+void
+pixel_checker_get_max (const pixel_checker_t *checker, color_t *color,
+ int *am, int *rm, int *gm, int *bm)
+{
+ get_limits (checker, DEVIATION, color, am, rm, gm, bm);
+}
+
+void
+pixel_checker_get_min (const pixel_checker_t *checker, color_t *color,
+ int *am, int *rm, int *gm, int *bm)
+{
+ get_limits (checker, - DEVIATION, color, am, rm, gm, bm);
+}
+
+pixman_bool_t
+pixel_checker_check (const pixel_checker_t *checker, uint32_t pixel,
+ color_t *color)
+{
+ int32_t a_lo, a_hi, r_lo, r_hi, g_lo, g_hi, b_lo, b_hi;
+ int32_t ai, ri, gi, bi;
+ pixman_bool_t result;
+
+ pixel_checker_get_min (checker, color, &a_lo, &r_lo, &g_lo, &b_lo);
+ pixel_checker_get_max (checker, color, &a_hi, &r_hi, &g_hi, &b_hi);
+ pixel_checker_split_pixel (checker, pixel, &ai, &ri, &gi, &bi);
+
+ result =
+ a_lo <= ai && ai <= a_hi &&
+ r_lo <= ri && ri <= r_hi &&
+ g_lo <= gi && gi <= g_hi &&
+ b_lo <= bi && bi <= b_hi;
+
+ return result;
+}
diff --git a/lib/pixman/test/utils.h b/lib/pixman/test/utils.h
index b23925c4a..01af316d2 100644
--- a/lib/pixman/test/utils.h
+++ b/lib/pixman/test/utils.h
@@ -2,7 +2,6 @@
#include <config.h>
#endif
-#include <stdlib.h>
#include <assert.h>
#include "pixman-private.h" /* For 'inline' definition */
@@ -108,6 +107,15 @@ fail_after (int seconds, const char *msg);
/* If possible, enable traps for floating point exceptions */
void enable_fp_exceptions(void);
+/* Converts a8r8g8b8 pixels to pixels that
+ * - are not premultiplied,
+ * - are stored in this order in memory: R, G, B, A, regardless of
+ * the endianness of the computer.
+ * It is allowed for @src and @dst to point to the same memory buffer.
+ */
+void
+a8r8g8b8_to_rgba_np (uint32_t *dst, uint32_t *src, int n_pixels);
+
pixman_bool_t
write_png (pixman_image_t *image, const char *filename);
@@ -152,3 +160,38 @@ aligned_malloc (size_t align, size_t size);
void
initialize_palette (pixman_indexed_t *palette, uint32_t depth, int is_rgb);
+
+typedef struct
+{
+ double r, g, b, a;
+} color_t;
+
+void
+round_color (pixman_format_code_t format, color_t *color);
+
+typedef struct
+{
+ pixman_format_code_t format;
+ uint32_t am, rm, gm, bm;
+ uint32_t as, rs, gs, bs;
+ uint32_t aw, rw, gw, bw;
+} pixel_checker_t;
+
+void
+pixel_checker_init (pixel_checker_t *checker, pixman_format_code_t format);
+
+void
+pixel_checker_split_pixel (const pixel_checker_t *checker, uint32_t pixel,
+ int *a, int *r, int *g, int *b);
+
+void
+pixel_checker_get_max (const pixel_checker_t *checker, color_t *color,
+ int *a, int *r, int *g, int *b);
+
+void
+pixel_checker_get_min (const pixel_checker_t *checker, color_t *color,
+ int *a, int *r, int *g, int *b);
+
+pixman_bool_t
+pixel_checker_check (const pixel_checker_t *checker,
+ uint32_t pixel, color_t *color);