diff -Nru pixman-0.9.6/aclocal.m4 pixman-0.10.0/aclocal.m4 --- pixman-0.9.6/aclocal.m4 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/aclocal.m4 2008-03-27 15:02:08.000000000 +0100 @@ -18,7 +18,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# serial 51 Debian 1.5.24-1 AC_PROG_LIBTOOL +# serial 51 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) @@ -570,6 +570,7 @@ esac ;; *64-bit*) + libsuff=64 case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" @@ -1628,11 +1629,13 @@ # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -1644,18 +1647,6 @@ dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -2430,7 +2421,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -3464,7 +3455,7 @@ ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= @@ -5145,7 +5136,7 @@ ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in @@ -5520,9 +5511,6 @@ cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' ;; - linux* | k*bsd*-gnu) - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -5728,13 +5716,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -6166,7 +6153,7 @@ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -7276,35 +7263,6 @@ rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file 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. - -# serial 4 - -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) - -AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) - # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/autogen.sh /tmp/JWHn8zaZ1m/pixman-0.10.0/autogen.sh --- pixman-0.9.6/autogen.sh 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/autogen.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -#! /bin/sh - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -ORIGDIR=`pwd` -cd $srcdir - -autoreconf -v --install || exit 1 -cd $ORIGDIR || exit $? - -$srcdir/configure --enable-maintainer-mode "$@" diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/compile /tmp/JWHn8zaZ1m/pixman-0.10.0/compile --- pixman-0.9.6/compile 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/compile 1970-01-01 01:00:00.000000000 +0100 @@ -1,142 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. - -scriptversion=2005-05-14.22 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand `-c -o'. -Remove `-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file `INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; -esac - -ofile= -cfile= -eat= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we strip `-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` - -# Create the lock directory. -# Note: use `[/.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/config.guess /tmp/JWHn8zaZ1m/pixman-0.10.0/config.guess --- pixman-0.9.6/config.guess 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/config.guess 2007-01-23 10:54:35.000000000 +0100 @@ -1,10 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2007-07-22' +timestamp='2003-06-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -18,15 +17,13 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. - # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. @@ -56,7 +53,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -69,11 +66,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; + echo "$timestamp" ; exit 0 ;; --version | -v ) - echo "$version" ; exit ;; + echo "$version" ; exit 0 ;; --help | --h* | -h ) - echo "$usage"; exit ;; + echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -107,7 +104,7 @@ trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -126,7 +123,7 @@ ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -139,6 +136,13 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +## for Red Hat Linux +if test -f /etc/redhat-release ; then + VENDOR=redhat ; +else + VENDOR= ; +fi + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -161,7 +165,6 @@ arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -200,32 +203,50 @@ # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit ;; + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) + if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac + fi # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU @@ -263,49 +284,42 @@ "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac - # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms + exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix - exit ;; + exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit ;; + exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit ;; + exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; + exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit ;; + exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp - exit ;; + exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then @@ -313,32 +327,32 @@ else echo pyramid-pyramid-bsd fi - exit ;; + exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit ;; + exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; + sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + exit 0 ;; + i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -347,10 +361,10 @@ esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; + exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; + exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 @@ -362,10 +376,10 @@ echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit ;; + exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; + exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -376,40 +390,37 @@ # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; + exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit ;; + exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; + exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; + exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; + exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -433,33 +444,32 @@ exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 echo mips-mips-riscos${UNAME_RELEASE} - exit ;; + exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit ;; + exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit ;; + exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit ;; + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit ;; + exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit ;; + exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit ;; + exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit ;; + exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -475,29 +485,29 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit ;; + exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit ;; + exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit ;; + exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit ;; + exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; + exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix - exit ;; + exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -505,7 +515,7 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; + exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -520,18 +530,14 @@ exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi - exit ;; + exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then @@ -545,28 +551,28 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; + exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix - exit ;; + exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit ;; + exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit ;; + exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit ;; + exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit ;; + exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit ;; + exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -628,19 +634,9 @@ esac if [ ${HP_ARCH} = "hppa2.0w" ] then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else @@ -648,11 +644,11 @@ fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; + exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit ;; + exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -680,182 +676,150 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 - exit ;; + exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit ;; + exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit ;; + exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit ;; + exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit ;; + exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit ;; + exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit ;; + exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit ;; + exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; + exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; + exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; + exit 0 ;; + *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) + exit 0 ;; + i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; + exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; + exit 0 ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit ;; + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix - exit ;; + exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; + exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit ;; + exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; *:GNU:*:*) - # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; + exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix - exit ;; + exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; + exit 0 ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu + exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -872,12 +836,8 @@ #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -895,22 +855,15 @@ #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; + echo powerpc-${VENDOR:-unknown}-linux-gnu + exit 0 ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; + echo powerpc64-${VENDOR:-unknown}-linux-gnu + exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -924,7 +877,7 @@ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; + exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -932,31 +885,25 @@ PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit ;; + exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu - exit ;; + exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; + echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu + exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; + exit 0 ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-gnu - exit ;; + echo x86_64-${VENDOR:-unknown}-linux-gnu + exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -974,15 +921,15 @@ ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; + exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; + exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; + exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -999,33 +946,23 @@ LIBC=gnulibc1 # endif #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 - exit ;; + exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -1033,27 +970,24 @@ # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; + exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit ;; + exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; + exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; + exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -1061,16 +995,15 @@ else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + exit 0 ;; + i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; + exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi - exit ;; + exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit ;; + exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit ;; + exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit ;; + exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit ;; + exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit ;; + exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit ;; + exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1162,81 +1095,68 @@ else echo ns32k-sni-sysv fi - exit ;; + exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 - exit ;; + exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit ;; + exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; + exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos - exit ;; + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit ;; + exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit ;; + exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit ;; + exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit ;; + exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit ;; + exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit ;; + exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; + exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; + exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; + exit 0 ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1244,25 +1164,22 @@ UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; + exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) + exit 0 ;; + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; + exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit ;; + exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit ;; + exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; + exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1273,47 +1190,28 @@ UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; + exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit ;; + exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit ;; + exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit ;; + exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit ;; + exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit ;; + exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its - exit ;; + exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1345,7 +1243,7 @@ #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); + printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1434,12 +1332,11 @@ } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) @@ -1448,22 +1345,22 @@ case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit ;; + exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit 0 ;; c34*) echo c34-convex-bsd - exit ;; + exit 0 ;; c38*) echo c38-convex-bsd - exit ;; + exit 0 ;; c4*) echo c4-convex-bsd - exit ;; + exit 0 ;; esac fi @@ -1474,9 +1371,7 @@ the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess -and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub + ftp://ftp.gnu.org/pub/gnu/config/ If the version you run ($0) is already up to date, please send the following data and any information you think might be diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/config.h.in /tmp/JWHn8zaZ1m/pixman-0.10.0/config.h.in --- pixman-0.9.6/config.h.in 2007-10-24 21:47:56.000000000 +0200 +++ pixman-0.10.0/config.h.in 2008-03-27 15:04:20.000000000 +0100 @@ -60,6 +60,9 @@ /* use SSE compiler intrinsics */ #undef USE_SSE +/* use SSE compiler intrinsics */ +#undef USE_SSE2 + /* Version number of package */ #undef VERSION diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/config.sub /tmp/JWHn8zaZ1m/pixman-0.10.0/config.sub --- pixman-0.9.6/config.sub 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/config.sub 2007-01-23 10:54:35.000000000 +0100 @@ -1,10 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2007-06-28' +timestamp='2003-06-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -22,15 +21,14 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. - # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # @@ -72,7 +70,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -85,11 +83,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; + echo "$timestamp" ; exit 0 ;; --version | -v ) - echo "$version" ; exit ;; + echo "$version" ; exit 0 ;; --help | --h* | -h ) - echo "$usage"; exit ;; + echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -101,7 +99,7 @@ *local*) # First pass through any local machine types. echo $1 - exit ;; + exit 0;; * ) break ;; @@ -120,9 +118,7 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -148,7 +144,7 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis) os= basic_machine=$1 ;; @@ -173,10 +169,6 @@ -hiux*) os=-hiuxwe2 ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -193,10 +185,6 @@ # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -240,17 +228,14 @@ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ + | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -259,33 +244,28 @@ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ - | mt \ | msp430 \ - | nios | nios2 \ | ns16k | ns32k \ - | or32 \ + | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | s390 | s390x \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -296,9 +276,6 @@ ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; - ms1) - basic_machine=mt-unknown - ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -318,20 +295,20 @@ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ + | avr-* \ + | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ + | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32c-* | m32r-* | m32rle-* \ + | ip2k-* \ + | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -340,36 +317,31 @@ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | s390-* | s390x-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ | ymp-* \ | z8k-*) ;; @@ -389,9 +361,6 @@ basic_machine=a29k-amd os=-udi ;; - abacus) - basic_machine=abacus-unknown - ;; adobe68k) basic_machine=m68010-adobe os=-scout @@ -409,9 +378,6 @@ amd64) basic_machine=x86_64-pc ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -471,27 +437,12 @@ basic_machine=j90-cray os=-unicos ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16) - basic_machine=cr16-unknown - os=-elf - ;; crds | unos) basic_machine=m68k-crds ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -514,10 +465,6 @@ basic_machine=m88k-motorola os=-sysv3 ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -683,10 +630,6 @@ basic_machine=i386-pc os=-mingw32 ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) basic_machine=m68000-convergent ;; @@ -700,6 +643,10 @@ mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; monitor) basic_machine=m68k-rom68k os=-coff @@ -712,9 +659,6 @@ basic_machine=i386-pc os=-msdos ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; mvs) basic_machine=i370-ibm os=-mvs @@ -783,6 +727,10 @@ np1) basic_machine=np1-gould ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -790,12 +738,9 @@ basic_machine=hppa1.1-oki os=-proelf ;; - openrisc | openrisc-*) + or32 | or32-*) basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 + os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson @@ -822,12 +767,6 @@ pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; @@ -884,10 +823,6 @@ basic_machine=i586-unknown os=-pw32 ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -898,12 +833,6 @@ rtpc | rtpc-*) basic_machine=romp-ibm ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; sa29200) basic_machine=a29k-amd os=-udi @@ -914,10 +843,6 @@ sb1el) basic_machine=mipsisa64sb1el-unknown ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; sei) basic_machine=mips-sei os=-seiux @@ -929,9 +854,6 @@ basic_machine=sh-hitachi os=-hms ;; - sh5el) - basic_machine=sh5le-unknown - ;; sh64) basic_machine=sh64-unknown ;; @@ -1034,10 +956,6 @@ tower | tower-32) basic_machine=m68k-ncr ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; udi29k) basic_machine=a29k-amd os=-udi @@ -1081,10 +999,6 @@ basic_machine=hppa1.1-winbond os=-proelf ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1115,9 +1029,6 @@ romp) basic_machine=romp-ibm ;; - mmix) - basic_machine=mmix-knuth - ;; rs6000) basic_machine=rs6000-ibm ;; @@ -1134,10 +1045,13 @@ we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -1210,23 +1124,19 @@ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1244,15 +1154,12 @@ os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1265,9 +1172,6 @@ -opened*) os=-openedition ;; - -os400*) - os=-os400 - ;; -wince*) os=-wince ;; @@ -1289,9 +1193,6 @@ -atheos*) os=-atheos ;; - -syllable*) - os=-syllable - ;; -386bsd) os=-bsd ;; @@ -1314,9 +1215,6 @@ -sinix*) os=-sysv4 ;; - -tpf*) - os=-tpf - ;; -triton*) os=-sysv3 ;; @@ -1353,9 +1251,6 @@ -kaos*) os=-kaos ;; - -zvmoe) - os=-zvmoe - ;; -none) ;; *) @@ -1378,12 +1273,6 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; *-acorn) os=-riscix1.2 ;; @@ -1393,8 +1282,8 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1421,9 +1310,6 @@ m68*-cisco) os=-aout ;; - mep-*) - os=-elf - ;; mips*-cisco) os=-elf ;; @@ -1442,15 +1328,9 @@ *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; - *-knuth) - os=-mmixware - ;; *-wec) os=-proelf ;; @@ -1583,15 +1463,9 @@ -mvs* | -opened*) vendor=ibm ;; - -os400*) - vendor=ibm - ;; -ptx*) vendor=sequent ;; - -tpf*) - vendor=ibm - ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; @@ -1616,7 +1490,7 @@ esac echo $basic_machine$os -exit +exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/configure /tmp/JWHn8zaZ1m/pixman-0.10.0/configure --- pixman-0.9.6/configure 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/configure 2008-03-27 15:02:11.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for pixman 0.9.6. +# Generated by GNU Autoconf 2.61 for pixman 0.10.0. # # Report bugs to <"sandmann@daimi.au.dk">. # @@ -728,8 +728,8 @@ # Identity of this package. PACKAGE_NAME='pixman' PACKAGE_TARNAME='pixman' -PACKAGE_VERSION='0.9.6' -PACKAGE_STRING='pixman 0.9.6' +PACKAGE_VERSION='0.10.0' +PACKAGE_STRING='pixman 0.10.0' PACKAGE_BUGREPORT='"sandmann@daimi.au.dk"' # Factoring default headers for most tests. @@ -827,9 +827,6 @@ AMTAR am__tar am__untar -MAINTAINER_MODE_TRUE -MAINTAINER_MODE_FALSE -MAINT CC CFLAGS LDFLAGS @@ -873,13 +870,18 @@ FFLAGS ac_ct_F77 LIBTOOL -PIXMAN_MAJOR +PIXMAN_VERSION_MAJOR +PIXMAN_VERSION_MINOR +PIXMAN_VERSION_MICRO LT_VERSION_INFO USE_MMX_TRUE USE_MMX_FALSE USE_SSE_TRUE USE_SSE_FALSE +USE_SSE2_TRUE +USE_SSE2_FALSE MMX_CFLAGS +SSE_CFLAGS PKG_CONFIG GTK_CFLAGS GTK_LIBS @@ -1410,7 +1412,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pixman 0.9.6 to adapt to many kinds of systems. +\`configure' configures pixman 0.10.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1480,15 +1482,13 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pixman 0.9.6:";; + short | recursive ) echo "Configuration of pixman 0.10.0:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1587,7 +1587,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pixman configure 0.9.6 +pixman configure 0.10.0 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1601,7 +1601,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pixman $as_me 0.9.6, which was +It was created by pixman $as_me 0.10.0, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2291,7 +2291,7 @@ # Define the identity of the package. PACKAGE='pixman' - VERSION='0.9.6' + VERSION='0.10.0' cat >>confdefs.h <<_ACEOF @@ -2438,29 +2438,6 @@ -{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 -echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 -echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - ac_config_headers="$ac_config_headers config.h" @@ -4240,7 +4217,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -4361,7 +4338,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4364 "configure"' > conftest.$ac_ext + echo '#line 4341 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4426,6 +4403,7 @@ esac ;; *64-bit*) + libsuff=64 case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" @@ -7103,11 +7081,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7106: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7084: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7110: \$? = $ac_status" >&5 + echo "$as_me:7088: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7393,11 +7371,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7396: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7374: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7400: \$? = $ac_status" >&5 + echo "$as_me:7378: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7497,11 +7475,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7500: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7478: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7504: \$? = $ac_status" >&5 + echo "$as_me:7482: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7761,13 +7739,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi - link_all_deplibs=no else ld_shlibs=no fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -8311,7 +8288,7 @@ link_all_deplibs=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -9006,11 +8983,13 @@ # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -9022,18 +9001,6 @@ dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -9859,7 +9826,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext </dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= @@ -12270,7 +12237,7 @@ ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in @@ -12379,11 +12346,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12382: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12349: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12386: \$? = $ac_status" >&5 + echo "$as_me:12353: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12483,11 +12450,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12486: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12453: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12490: \$? = $ac_status" >&5 + echo "$as_me:12457: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12555,9 +12522,6 @@ cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ;; - linux* | k*bsd*-gnu) - link_all_deplibs_CXX=no - ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -12987,11 +12951,13 @@ # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -13003,18 +12969,6 @@ dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -14060,11 +14014,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14063: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14017: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14067: \$? = $ac_status" >&5 + echo "$as_me:14021: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14164,11 +14118,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14167: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14121: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14171: \$? = $ac_status" >&5 + echo "$as_me:14125: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14428,13 +14382,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi - link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -14958,7 +14911,7 @@ link_all_deplibs_F77=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -15601,11 +15554,13 @@ # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -15617,18 +15572,6 @@ dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -16364,11 +16307,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16367: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16310: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16371: \$? = $ac_status" >&5 + echo "$as_me:16314: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16654,11 +16597,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16657: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16600: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16661: \$? = $ac_status" >&5 + echo "$as_me:16604: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16758,11 +16701,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16761: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16704: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16765: \$? = $ac_status" >&5 + echo "$as_me:16708: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17022,13 +16965,12 @@ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi - link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -17572,7 +17514,7 @@ link_all_deplibs_GCJ=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -18215,11 +18157,13 @@ # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -18231,18 +18175,6 @@ dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -19764,9 +19696,13 @@ -LT_VERSION_INFO="9:6:9" +LT_VERSION_INFO="10:0:10" + +PIXMAN_VERSION_MAJOR=0 -PIXMAN_MAJOR=0 +PIXMAN_VERSION_MINOR=10 + +PIXMAN_VERSION_MICRO=0 @@ -19780,6 +19716,52 @@ *) CFLAGS="$CFLAGS -Wall" ;; esac fi +have_gcc4=no +{ echo "$as_me:$LINENO: checking for -fvisibility" >&5 +echo $ECHO_N "checking for -fvisibility... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#else +#error Need GCC 4.0 for visibility +#endif +int main () { return 0; } + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + have_gcc4=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test "x$have_gcc4" = "xyes"; then + CFLAGS="$CFLAGS -fvisibility=hidden" +fi +{ echo "$as_me:$LINENO: result: $have_gcc4" >&5 +echo "${ECHO_T}$have_gcc4" >&6; } + + MMX_CFLAGS="-mmmx -Winline --param inline-unit-growth=10000 --param large-function-growth=10000" have_mmx_intrinsics=no @@ -19918,6 +19900,74 @@ +SSE_CFLAGS="-mmmx -msse2 -Winline --param inline-unit-growth=10000 --param large-function-growth=10000" + +have_sse2_intrinsics=no +{ echo "$as_me:$LINENO: checking whether to use SSE2 intrinsics" >&5 +echo $ECHO_N "checking whether to use SSE2 intrinsics... $ECHO_C" >&6; } +xserver_save_CFLAGS=$CFLAGS +CFLAGS="$CFLAGS -msse2 $MMX_CFLAGS" + +cat >conftest.$ac_ext <<_ACEOF + +#include +#include +int main () { + __m128i a, b, c; + c = _mm_xor_si128 (a, b); + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + have_sse2_intrinsics=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS=$xserver_save_CFLAGS +{ echo "$as_me:$LINENO: result: $have_sse2_intrinsics" >&5 +echo "${ECHO_T}$have_sse2_intrinsics" >&6; } + +if test $have_sse2_intrinsics = yes ; then + +cat >>confdefs.h <<\_ACEOF +#define USE_SSE2 1 +_ACEOF + +fi + + if test $have_sse2_intrinsics = yes; then + USE_SSE2_TRUE= + USE_SSE2_FALSE='#' +else + USE_SSE2_TRUE='#' + USE_SSE2_FALSE= +fi + + + + + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then @@ -20123,7 +20173,7 @@ -ac_config_files="$ac_config_files pixman-1.pc Makefile pixman/Makefile test/Makefile" +ac_config_files="$ac_config_files pixman-1.pc Makefile pixman/Makefile pixman/pixman-version.h test/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -20221,13 +20271,6 @@ LTLIBOBJS=$ac_ltlibobjs -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -20263,6 +20306,13 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${USE_SSE2_TRUE}" && test -z "${USE_SSE2_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USE_SSE2\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USE_SSE2\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${HAVE_GTK_TRUE}" && test -z "${HAVE_GTK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -20570,7 +20620,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pixman $as_me 0.9.6, which was +This file was extended by pixman $as_me 0.10.0, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20623,7 +20673,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -pixman config.status 0.9.6 +pixman config.status 0.10.0 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -20742,6 +20792,7 @@ "pixman-1.pc") CONFIG_FILES="$CONFIG_FILES pixman-1.pc" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pixman/Makefile") CONFIG_FILES="$CONFIG_FILES pixman/Makefile" ;; + "pixman/pixman-version.h") CONFIG_FILES="$CONFIG_FILES pixman/pixman-version.h" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 @@ -20864,9 +20915,6 @@ AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim -MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim -MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim -MAINT!$MAINT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim @@ -20902,6 +20950,9 @@ CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim +CXXDEPMODE!$CXXDEPMODE$ac_delim +am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim +am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -20943,21 +20994,23 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -CXXDEPMODE!$CXXDEPMODE$ac_delim -am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim -am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim CXXCPP!$CXXCPP$ac_delim F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim ac_ct_F77!$ac_ct_F77$ac_delim LIBTOOL!$LIBTOOL$ac_delim -PIXMAN_MAJOR!$PIXMAN_MAJOR$ac_delim +PIXMAN_VERSION_MAJOR!$PIXMAN_VERSION_MAJOR$ac_delim +PIXMAN_VERSION_MINOR!$PIXMAN_VERSION_MINOR$ac_delim +PIXMAN_VERSION_MICRO!$PIXMAN_VERSION_MICRO$ac_delim LT_VERSION_INFO!$LT_VERSION_INFO$ac_delim USE_MMX_TRUE!$USE_MMX_TRUE$ac_delim USE_MMX_FALSE!$USE_MMX_FALSE$ac_delim USE_SSE_TRUE!$USE_SSE_TRUE$ac_delim USE_SSE_FALSE!$USE_SSE_FALSE$ac_delim +USE_SSE2_TRUE!$USE_SSE2_TRUE$ac_delim +USE_SSE2_FALSE!$USE_SSE2_FALSE$ac_delim MMX_CFLAGS!$MMX_CFLAGS$ac_delim +SSE_CFLAGS!$SSE_CFLAGS$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim GTK_CFLAGS!$GTK_CFLAGS$ac_delim GTK_LIBS!$GTK_LIBS$ac_delim @@ -20969,7 +21022,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 26; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/configure.ac /tmp/JWHn8zaZ1m/pixman-0.10.0/configure.ac --- pixman-0.9.6/configure.ac 2007-10-24 21:45:55.000000000 +0200 +++ pixman-0.10.0/configure.ac 2008-03-27 15:01:45.000000000 +0100 @@ -24,25 +24,40 @@ # Pixman versioning scheme # -# - If the changes don't affect API or ABI, then increment pixman_micro -# - If API is added, then increment PIXMAN_MINOR, and set MICRO to 0 +# - The git version must at all times have an odd MICRO version +# number. # -# - If you break ABI, then -# - In the first development release where you break ABI, find all instances of -# "pixman-n" and change it to pixman-(n+1) +# - If you add API, increment the MICRO version to the next largest +# odd number. +# +# - If you release a version that contains new API, then increment +# MINOR and set MICRO to 0. +# +# - If you release a new version that does not contain new API, then +# increment MICRO to the next even number. +# +# - After doing a release, increment MICRO again to make the version +# number in git odd. +# +# - If you break the ABI, then +# +# - increment MAJOR +# +# - In the first development release where you break ABI, find +# all instances of "pixman-n" and change them to pixman-(n+1) # # This needs to be done at least in # configure.ac # all Makefile.am's # pixman-n.pc.in # -# This ensures that binary incompatible versions can be installed in parallel. -# See http://www106.pair.com/rhp/parallel.html for more information -# +# This ensures that binary incompatible versions can be installed +# in parallel. See http://www106.pair.com/rhp/parallel.html for +# more information m4_define([pixman_major], 0) -m4_define([pixman_minor], 9) -m4_define([pixman_micro], 6) +m4_define([pixman_minor], 10) +m4_define([pixman_micro], 0) m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro]) @@ -68,8 +83,12 @@ LT_VERSION_INFO="lt_current:lt_revision:lt_age" -PIXMAN_MAJOR=pixman_major -AC_SUBST(PIXMAN_MAJOR) +PIXMAN_VERSION_MAJOR=pixman_major() +AC_SUBST(PIXMAN_VERSION_MAJOR) +PIXMAN_VERSION_MINOR=pixman_minor() +AC_SUBST(PIXMAN_VERSION_MINOR) +PIXMAN_VERSION_MICRO=pixman_micro() +AC_SUBST(PIXMAN_VERSION_MICRO) AC_SUBST(LT_VERSION_INFO) @@ -83,6 +102,24 @@ *) CFLAGS="$CFLAGS -Wall" ;; esac fi changequote([,])dnl +dnl ========================================================================= +dnl -fvisibility stuff + +have_gcc4=no +AC_MSG_CHECKING(for -fvisibility) +AC_COMPILE_IFELSE([ +#if defined(__GNUC__) && (__GNUC__ >= 4) +#else +#error Need GCC 4.0 for visibility +#endif +int main () { return 0; } +], have_gcc4=yes) + +if test "x$have_gcc4" = "xyes"; then + CFLAGS="$CFLAGS -fvisibility=hidden" +fi +AC_MSG_RESULT($have_gcc4) + dnl =========================================================================== dnl Check for MMX @@ -147,8 +184,37 @@ AM_CONDITIONAL(USE_SSE, test $have_sse_intrinsics = yes) + +dnl =========================================================================== +dnl Check for SSE2 + +SSE_CFLAGS="-mmmx -msse2 -Winline --param inline-unit-growth=10000 --param large-function-growth=10000" + +have_sse2_intrinsics=no +AC_MSG_CHECKING(whether to use SSE2 intrinsics) +xserver_save_CFLAGS=$CFLAGS +CFLAGS="$CFLAGS -msse2 $MMX_CFLAGS" + +AC_COMPILE_IFELSE([ +#include +#include +int main () { + __m128i a, b, c; + c = _mm_xor_si128 (a, b); + return 0; +}], have_sse2_intrinsics=yes) +CFLAGS=$xserver_save_CFLAGS +AC_MSG_RESULT($have_sse2_intrinsics) + +if test $have_sse2_intrinsics = yes ; then + AC_DEFINE(USE_SSE2, 1, [use SSE compiler intrinsics]) +fi + +AM_CONDITIONAL(USE_SSE2, test $have_sse2_intrinsics = yes) + dnl ======================================================== AC_SUBST(MMX_CFLAGS) +AC_SUBST(SSE_CFLAGS) PKG_CHECK_MODULES(GTK, [gtk+-2.0], [HAVE_GTK=yes], [HAVE_GTK=no]) AM_CONDITIONAL(HAVE_GTK, [test "x$HAVE_GTK" = xyes]) @@ -161,4 +227,5 @@ AC_OUTPUT([pixman-1.pc Makefile pixman/Makefile + pixman/pixman-version.h test/Makefile]) diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/debian/changelog /tmp/JWHn8zaZ1m/pixman-0.10.0/debian/changelog --- pixman-0.9.6/debian/changelog 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/debian/changelog 2008-04-04 15:44:38.000000000 +0200 @@ -1,3 +1,16 @@ +pixman (0.10.0-0ubuntu1) hardy; urgency=low + + * New upstream release (LP: #211785) + * debian/control: + - Move Maintainer to XSBC-Original-Maintainer and set Maintainer + to Ubuntu Core Developers + - bump Standards-Version to 3.7.3 + * add a symbol file and strict symbols checking + - update debian/rules + - add debian/libpixman-1-0.symbols + + -- Fabien Tassin Fri, 04 Apr 2008 13:33:20 +0200 + pixman (0.9.6-1) unstable; urgency=low * New upstream release (closes: #452734). diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/debian/control /tmp/JWHn8zaZ1m/pixman-0.10.0/debian/control --- pixman-0.9.6/debian/control 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/debian/control 2008-04-04 15:44:38.000000000 +0200 @@ -1,10 +1,10 @@ Source: pixman Section: devel Priority: optional -Maintainer: Debian X Strike Force -Uploaders: Julien Cristau , David Nusinow +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Debian X Strike Force Build-Depends: quilt, debhelper -Standards-Version: 3.7.2 +Standards-Version: 3.7.3 Package: libpixman-1-0 Section: libs diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/debian/libpixman-1-0.symbols /tmp/JWHn8zaZ1m/pixman-0.10.0/debian/libpixman-1-0.symbols --- pixman-0.9.6/debian/libpixman-1-0.symbols 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/debian/libpixman-1-0.symbols 2008-04-04 15:44:38.000000000 +0200 @@ -0,0 +1,64 @@ +libpixman-1.so.0 libpixman-1-0 #MINVER# + pixman_add_trapezoids@Base 0.9.6 + pixman_add_traps@Base 0.9.6 + pixman_blt@Base 0.9.6 + pixman_compute_composite_region@Base 0.9.6 + pixman_edge_init@Base 0.9.6 + pixman_edge_step@Base 0.9.6 + pixman_fill@Base 0.9.6 + pixman_format_supported_destination@Base 0.10.0 + pixman_format_supported_source@Base 0.10.0 + pixman_image_composite@Base 0.9.6 + pixman_image_create_bits@Base 0.9.6 + pixman_image_create_conical_gradient@Base 0.9.6 + pixman_image_create_linear_gradient@Base 0.9.6 + pixman_image_create_radial_gradient@Base 0.9.6 + pixman_image_create_solid_fill@Base 0.9.6 + pixman_image_fill_rectangles@Base 0.9.6 + pixman_image_get_data@Base 0.9.6 + pixman_image_get_depth@Base 0.9.6 + pixman_image_get_height@Base 0.9.6 + pixman_image_get_stride@Base 0.9.6 + pixman_image_get_width@Base 0.9.6 + pixman_image_ref@Base 0.9.6 + pixman_image_set_accessors@Base 0.9.6 + pixman_image_set_alpha_map@Base 0.9.6 + pixman_image_set_clip_region@Base 0.9.6 + pixman_image_set_component_alpha@Base 0.9.6 + pixman_image_set_filter@Base 0.9.6 + pixman_image_set_has_client_clip@Base 0.9.6 + pixman_image_set_indexed@Base 0.9.6 + pixman_image_set_repeat@Base 0.9.6 + pixman_image_set_source_clipping@Base 0.9.6 + pixman_image_set_transform@Base 0.9.6 + pixman_image_unref@Base 0.9.6 + pixman_line_fixed_edge_init@Base 0.9.6 + pixman_rasterize_edges@Base 0.9.6 + pixman_rasterize_trapezoid@Base 0.9.6 + pixman_region_contains_point@Base 0.9.6 + pixman_region_contains_rectangle@Base 0.9.6 + pixman_region_copy@Base 0.9.6 + pixman_region_equal@Base 0.9.6 + pixman_region_extents@Base 0.9.6 + pixman_region_fini@Base 0.9.6 + pixman_region_init@Base 0.9.6 + pixman_region_init_rect@Base 0.9.6 + pixman_region_init_rects@Base 0.9.6 + pixman_region_init_with_extents@Base 0.9.6 + pixman_region_intersect@Base 0.9.6 + pixman_region_inverse@Base 0.9.6 + pixman_region_n_rects@Base 0.9.6 + pixman_region_not_empty@Base 0.9.6 + pixman_region_rectangles@Base 0.9.6 + pixman_region_reset@Base 0.9.6 + pixman_region_selfcheck@Base 0.9.6 + pixman_region_set_static_pointers@Base 0.9.6 + pixman_region_subtract@Base 0.9.6 + pixman_region_translate@Base 0.9.6 + pixman_region_union@Base 0.9.6 + pixman_region_union_rect@Base 0.9.6 + pixman_sample_ceil_y@Base 0.9.6 + pixman_sample_floor_y@Base 0.9.6 + pixman_transform_point_3d@Base 0.9.6 + pixman_version@Base 0.10.0 + pixman_version_string@Base 0.10.0 diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/debian/rules /tmp/JWHn8zaZ1m/pixman-0.10.0/debian/rules --- pixman-0.9.6/debian/rules 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/debian/rules 2008-04-04 15:44:38.000000000 +0200 @@ -68,7 +68,7 @@ dh_strip --dbg-package=$(PACKAGE)-dbg dh_compress dh_fixperms - dh_makeshlibs + dh_makeshlibs -a -V 'libpixman-1-0 (>= 0.10.0)' -- -c4 dh_shlibdeps dh_installdeb dh_gencontrol diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/ltmain.sh /tmp/JWHn8zaZ1m/pixman-0.10.0/ltmain.sh --- pixman-0.9.6/ltmain.sh 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/ltmain.sh 2007-01-23 10:54:35.000000000 +0100 @@ -1,8 +1,8 @@ # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify @@ -43,8 +43,8 @@ PROGRAM=ltmain.sh PACKAGE=libtool -VERSION="1.5.24 Debian 1.5.24-1" -TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)" +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -57,8 +57,6 @@ else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh # Check that we have a working $echo. if test "X$1" = X--no-reexec; then @@ -116,10 +114,10 @@ for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - fi" + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + fi" done # Make sure IFS has a sensible default @@ -208,13 +206,7 @@ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{ - / I /{ - s,.*,import, - p - q - } - }'` + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -348,11 +340,11 @@ my_xlib_u=$my_xlib while :; do case " $extracted_archives " in - *" $my_xlib_u "*) - extracted_serial=`expr $extracted_serial + 1` - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac + *" $my_xlib_u "*) + extracted_serial=`expr $extracted_serial + 1` + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" @@ -482,12 +474,11 @@ ;; --version) - echo "\ -$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP - -Copyright (C) 2007 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2005 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; @@ -784,7 +775,7 @@ *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; - *.[fF][09]?) xform=[fF][09]. ;; + *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; *.obj) xform=obj ;; @@ -1169,8 +1160,8 @@ do case $arg in -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) + case $arg in + -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi @@ -1179,19 +1170,19 @@ fi prefer_static_libs=yes ;; - -static) + -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac build_libtool_libs=no build_old_libs=yes break @@ -1639,7 +1630,7 @@ continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" @@ -1659,11 +1650,10 @@ # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin + # -pg pass through profiling flag for GCC # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. @@ -1691,9 +1681,9 @@ -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. + # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no @@ -2122,10 +2112,7 @@ case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then @@ -2137,7 +2124,7 @@ lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" @@ -2533,9 +2520,9 @@ if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. @@ -3242,15 +3229,9 @@ age="0" ;; irix|nonstopux) - current=`expr $number_major + $number_minor` + current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" - lt_irix_increment=no - ;; - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE ;; esac ;; @@ -3309,8 +3290,7 @@ versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) @@ -3324,11 +3304,8 @@ ;; irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - major=`expr $current - $age` - else - major=`expr $current - $age + 1` - fi + major=`expr $current - $age + 1` + case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; @@ -3465,11 +3442,11 @@ fi # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` - # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` - # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` - #done +# for path in $notinst_path; do +# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` +# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` +# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` +# done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. @@ -3570,7 +3547,7 @@ int main() { return 0; } EOF $rm conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then + if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then ldd_output=`ldd conftest` for i in $deplibs; do name=`expr $i : '-l\(.*\)'` @@ -3932,10 +3909,7 @@ test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then - case $archive_cmds in - *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; - *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; - esac + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi @@ -4301,7 +4275,7 @@ if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" @@ -5321,8 +5295,6 @@ else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. @@ -6419,10 +6391,8 @@ if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else - if test ! -f "$dir/$dlname"; then - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE fi ;; @@ -6488,11 +6458,14 @@ # Restore saved environment variables for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - fi" + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" done + # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/Makefile.am /tmp/JWHn8zaZ1m/pixman-0.10.0/Makefile.am --- pixman-0.9.6/Makefile.am 2007-09-12 22:24:35.000000000 +0200 +++ pixman-0.10.0/Makefile.am 2008-03-27 15:08:14.000000000 +0100 @@ -4,3 +4,124 @@ pkgconfig_DATA=pixman-1.pc $(pkgconfig_DATA): pixman-1.pc.in + +snapshot: + distdir="$(distdir)-`date '+%Y%m%d'`"; \ + test -d "$(srcdir)/.git" && distdir=$$distdir-`cd "$(srcdir)" && git-rev-parse HEAD | cut -c 1-6`; \ + $(MAKE) $(AM_MAKEFLAGS) distdir="$$distdir" dist + +USERNAME=$$USER +RELEASE_OR_SNAPSHOT = $$(if test "x$(CAIRO_VERSION_MINOR)" = "x$$(echo "$(CAIRO_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; fi) +RELEASE_CAIRO_HOST = $(USERNAME)@cairographics.org +RELEASE_CAIRO_DIR = /srv/cairo.freedesktop.org/www/releases +RELEASE_CAIRO_URL = http://cairographics.org/releases +RELEASE_XORG_URL = http://xorg.freedesktop.org/archive/individual/lib +RELEASE_XORG_HOST = $(USERNAME)@xorg.freedesktop.org +RELEASE_XORG_DIR = /srv/xorg.freedesktop.org/archive/individual/lib +RELEASE_ANNOUNCE_LIST = cairo-announce@cairographics.org, xorg-announce@lists.freedesktop.org + +tar_gz = $(PACKAGE)-$(VERSION).tar.gz +tar_bz2 = $(PACKAGE)-$(VERSION).tar.bz2 + +sha1_tgz = $(tar_gz).sha1 +md5_tgz = $(tar_gz).md5 + +sha1_tbz2 = $(tar_bz2).sha1 +md5_tbz2 = $(tar_bz2).md5 + +gpg_file = $(sha1_tgz).asc + +$(sha1_tgz): $(tar_gz) + sha1sum $^ > $@ + +$(md5_tgz): $(tar_gz) + md5sum $^ > $@ + +$(sha1_tbz2): $(tar_bz2) + sha1sum $^ > $@ + +$(md5_tbz2): $(tar_bz2) + md5sum $^ > $@ + +$(gpg_file): $(sha1_tgz) + @echo "Please enter your GPG password to sign the checksum." + gpg --armor --sign $^ + +release-verify-newer: + @echo -n "Checking that no $(VERSION) release already exists at $(RELEASE_XORG_HOST)..." + @ssh $(RELEASE_XORG_HOST) test ! -e $(RELEASE_XORG_DIR)/$(tar_gz) \ + || (echo "Ouch." && echo "Found: $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR)/$(tar_gz)" \ + && echo "Refusing to try to generate a new release of the same name." \ + && false) + @ssh $(RELEASE_CAIRO_HOST) test ! -e $(RELEASE_CAIRO_DIR)/$(tar_gz) \ + || (echo "Ouch." && echo "Found: $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR)/$(tar_gz)" \ + && echo "Refusing to try to generate a new release of the same name." \ + && false) + @echo "Good." + +release-remove-old: + $(RM) $(tar_gz) $(tar_bz2) $(sha1_tgz) $(gpg_file) + +ensure-prev: + @if [[ "$(PREV)" == "" ]]; then \ + echo "" && \ + echo "You must set the PREV variable on the make command line to" && \ + echo "the git tag of the last release." && \ + echo "" && \ + echo "For example:" && \ + echo " make PREV=pixman-0.7.3" && \ + echo "" && \ + false; \ + fi + +release-check: ensure-prev release-verify-newer release-remove-old distcheck + +release-upload: release-check $(tar_gz) $(tar_bz2) $(sha1_tgz) $(gpg_file) + mkdir -p releases + scp $(tar_gz) $(sha1_tgz) $(gpg_file) $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR) + scp $(tar_gz) $(tar_bz2) $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR) + ssh $(RELEASE_CAIRO_HOST) "rm -f $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_gz) $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-$(VERSION)" + git-tag -s -m "$(PACKAGE) $(VERSION) release" $(PACKAGE)-$(VERSION) + +release-publish-message: $(sha1_tgz) $(md5_tgz) $(sha1_tbz2) $(md5_tbz2) ensure-prev + @echo "Please follow the instructions in RELEASING to push stuff out and" + @echo "send out the announcement mails. Here is the excerpt you need:" + @echo "" + @echo "Lists: $(RELEASE_ANNOUNCE_LIST)" + @echo "Subject: [ANNOUNCE] $(PACKAGE) release $(VERSION) now available" + @echo "============================== CUT HERE ==============================" + @echo "A new $(PACKAGE) release $(VERSION) is now available" + @echo "" + @echo "tar.gz:" + @echo " $(RELEASE_CAIRO_URL)/$(tar_gz)" + @echo " $(RELEASE_XORG_URL)/$(tar_gz)" + @echo "" + @echo "tar.bz2:" + @echo " $(RELEASE_XORG_URL)/$(tar_bz2)" + @echo "" + @echo "Hashes:" + @echo -n " MD5: " + @cat $(md5_tgz) + @echo -n " MD5: " + @cat $(md5_tbz2) + @echo -n " SHA1: " + @cat $(sha1_tgz) + @echo -n " SHA1: " + @cat $(sha1_tbz2) + @echo "" + @echo "GPG signature:" + @echo " $(RELEASE_CAIRO_URL)/$(gpg_file)" + @echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)" + @echo "" + @echo "Git:" + @echo " git://git.freedesktop.org/git/pixman" + @echo " tag: $(PACKAGE)-$(VERSION)" + @echo "" + @echo "Log:" + @git-log --no-merges "$(PACKAGE)-$(PREV)".."$(PACKAGE)-$(VERSION)" | git shortlog | awk '{ printf "\t"; print ; }' | cut -b0-80 + @echo "============================== CUT HERE ==============================" + @echo "" + +release-publish: release-upload release-publish-message + +.PHONY: release-upload release-publish release-publish-message diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/Makefile.in /tmp/JWHn8zaZ1m/pixman-0.10.0/Makefile.in --- pixman-0.9.6/Makefile.in 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/Makefile.in 2008-03-27 15:09:25.000000000 +0100 @@ -36,8 +36,8 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/pixman-1.pc.in $(top_srcdir)/configure AUTHORS \ - COPYING ChangeLog INSTALL NEWS TODO compile config.guess \ - config.sub depcomp install-sh ltmain.sh missing + COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \ + depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -125,7 +125,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MMX_CFLAGS = @MMX_CFLAGS@ @@ -137,12 +136,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PIXMAN_MAJOR = @PIXMAN_MAJOR@ +PIXMAN_VERSION_MAJOR = @PIXMAN_VERSION_MAJOR@ +PIXMAN_VERSION_MICRO = @PIXMAN_VERSION_MICRO@ +PIXMAN_VERSION_MINOR = @PIXMAN_VERSION_MINOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SSE_CFLAGS = @SSE_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ @@ -199,13 +201,29 @@ SUBDIRS = pixman test pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = pixman-1.pc +USERNAME = $$USER +RELEASE_OR_SNAPSHOT = $$(if test "x$(CAIRO_VERSION_MINOR)" = "x$$(echo "$(CAIRO_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; fi) +RELEASE_CAIRO_HOST = $(USERNAME)@cairographics.org +RELEASE_CAIRO_DIR = /srv/cairo.freedesktop.org/www/releases +RELEASE_CAIRO_URL = http://cairographics.org/releases +RELEASE_XORG_URL = http://xorg.freedesktop.org/archive/individual/lib +RELEASE_XORG_HOST = $(USERNAME)@xorg.freedesktop.org +RELEASE_XORG_DIR = /srv/xorg.freedesktop.org/archive/individual/lib +RELEASE_ANNOUNCE_LIST = cairo-announce@cairographics.org, xorg-announce@lists.freedesktop.org +tar_gz = $(PACKAGE)-$(VERSION).tar.gz +tar_bz2 = $(PACKAGE)-$(VERSION).tar.bz2 +sha1_tgz = $(tar_gz).sha1 +md5_tgz = $(tar_gz).md5 +sha1_tbz2 = $(tar_bz2).sha1 +md5_tbz2 = $(tar_bz2).md5 +gpg_file = $(sha1_tgz).asc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -232,9 +250,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @@ -246,7 +264,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ @@ -667,6 +685,106 @@ $(pkgconfig_DATA): pixman-1.pc.in + +snapshot: + distdir="$(distdir)-`date '+%Y%m%d'`"; \ + test -d "$(srcdir)/.git" && distdir=$$distdir-`cd "$(srcdir)" && git-rev-parse HEAD | cut -c 1-6`; \ + $(MAKE) $(AM_MAKEFLAGS) distdir="$$distdir" dist + +$(sha1_tgz): $(tar_gz) + sha1sum $^ > $@ + +$(md5_tgz): $(tar_gz) + md5sum $^ > $@ + +$(sha1_tbz2): $(tar_bz2) + sha1sum $^ > $@ + +$(md5_tbz2): $(tar_bz2) + md5sum $^ > $@ + +$(gpg_file): $(sha1_tgz) + @echo "Please enter your GPG password to sign the checksum." + gpg --armor --sign $^ + +release-verify-newer: + @echo -n "Checking that no $(VERSION) release already exists at $(RELEASE_XORG_HOST)..." + @ssh $(RELEASE_XORG_HOST) test ! -e $(RELEASE_XORG_DIR)/$(tar_gz) \ + || (echo "Ouch." && echo "Found: $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR)/$(tar_gz)" \ + && echo "Refusing to try to generate a new release of the same name." \ + && false) + @ssh $(RELEASE_CAIRO_HOST) test ! -e $(RELEASE_CAIRO_DIR)/$(tar_gz) \ + || (echo "Ouch." && echo "Found: $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR)/$(tar_gz)" \ + && echo "Refusing to try to generate a new release of the same name." \ + && false) + @echo "Good." + +release-remove-old: + $(RM) $(tar_gz) $(tar_bz2) $(sha1_tgz) $(gpg_file) + +ensure-prev: + @if [[ "$(PREV)" == "" ]]; then \ + echo "" && \ + echo "You must set the PREV variable on the make command line to" && \ + echo "the git tag of the last release." && \ + echo "" && \ + echo "For example:" && \ + echo " make PREV=pixman-0.7.3" && \ + echo "" && \ + false; \ + fi + +release-check: ensure-prev release-verify-newer release-remove-old distcheck + +release-upload: release-check $(tar_gz) $(tar_bz2) $(sha1_tgz) $(gpg_file) + mkdir -p releases + scp $(tar_gz) $(sha1_tgz) $(gpg_file) $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR) + scp $(tar_gz) $(tar_bz2) $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR) + ssh $(RELEASE_CAIRO_HOST) "rm -f $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_gz) $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-$(VERSION)" + git-tag -s -m "$(PACKAGE) $(VERSION) release" $(PACKAGE)-$(VERSION) + +release-publish-message: $(sha1_tgz) $(md5_tgz) $(sha1_tbz2) $(md5_tbz2) ensure-prev + @echo "Please follow the instructions in RELEASING to push stuff out and" + @echo "send out the announcement mails. Here is the excerpt you need:" + @echo "" + @echo "Lists: $(RELEASE_ANNOUNCE_LIST)" + @echo "Subject: [ANNOUNCE] $(PACKAGE) release $(VERSION) now available" + @echo "============================== CUT HERE ==============================" + @echo "A new $(PACKAGE) release $(VERSION) is now available" + @echo "" + @echo "tar.gz:" + @echo " $(RELEASE_CAIRO_URL)/$(tar_gz)" + @echo " $(RELEASE_XORG_URL)/$(tar_gz)" + @echo "" + @echo "tar.bz2:" + @echo " $(RELEASE_XORG_URL)/$(tar_bz2)" + @echo "" + @echo "Hashes:" + @echo -n " MD5: " + @cat $(md5_tgz) + @echo -n " MD5: " + @cat $(md5_tbz2) + @echo -n " SHA1: " + @cat $(sha1_tgz) + @echo -n " SHA1: " + @cat $(sha1_tbz2) + @echo "" + @echo "GPG signature:" + @echo " $(RELEASE_CAIRO_URL)/$(gpg_file)" + @echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)" + @echo "" + @echo "Git:" + @echo " git://git.freedesktop.org/git/pixman" + @echo " tag: $(PACKAGE)-$(VERSION)" + @echo "" + @echo "Log:" + @git-log --no-merges "$(PACKAGE)-$(PREV)".."$(PACKAGE)-$(VERSION)" | git shortlog | awk '{ printf "\t"; print ; }' | cut -b0-80 + @echo "============================== CUT HERE ==============================" + @echo "" + +release-publish: release-upload release-publish-message + +.PHONY: release-upload release-publish release-publish-message # 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. .NOEXPORT: diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/Makefile.am /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/Makefile.am --- pixman-0.9.6/pixman/Makefile.am 2007-09-13 21:51:08.000000000 +0200 +++ pixman-0.10.0/pixman/Makefile.am 2008-03-27 12:05:16.000000000 +0100 @@ -2,27 +2,36 @@ libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO) libpixman_1_la_LIBADD = @DEP_LIBS@ -lm libpixman_1_la_SOURCES = \ - pixman.h \ - pixman-region.c \ - pixman-private.h \ - pixman-image.c \ - pixman-compose.c \ + pixman.h \ + pixman-access.c \ + pixman-access-accessors.c \ + pixman-region.c \ + pixman-private.h \ + pixman-image.c \ + pixman-combine.c \ + pixman-compose.c \ pixman-compose-accessors.c \ - pixman-pict.c \ - pixman-utils.c \ - pixman-edge.c \ + pixman-pict.c \ + pixman-source.c \ + pixman-transformed.c \ + pixman-transformed-accessors.c \ + pixman-utils.c \ + pixman-edge.c \ pixman-edge-accessors.c \ - pixman-edge-imp.h \ - pixman-trap.c \ - pixman-compute-region.c \ + pixman-edge-imp.h \ + pixman-trap.c \ + pixman-compute-region.c \ pixman-timer.c libpixmanincludedir = $(includedir)/pixman-1/ -libpixmaninclude_HEADERS = pixman.h +libpixmaninclude_HEADERS = pixman.h pixman-version.h +noinst_LTLIBRARIES = + +EXTRA_DIST = Makefile.win32 # mmx code if USE_MMX -noinst_LTLIBRARIES = libpixman-mmx.la +noinst_LTLIBRARIES += libpixman-mmx.la libpixman_mmx_la_SOURCES = \ pixman-mmx.c \ pixman-mmx.h @@ -30,3 +39,16 @@ libpixman_mmx_la_LIBADD = $(DEP_LIBS) libpixman_1_la_LIBADD += libpixman-mmx.la endif + + +# sse2 code +if USE_SSE2 +noinst_LTLIBRARIES += libpixman-sse.la +libpixman_sse_la_SOURCES = \ + pixman-sse.c \ + pixman-sse.h +libpixman_sse_la_CFLAGS = $(DEP_CFLAGS) $(SSE_CFLAGS) +libpixman_sse_la_LIBADD = $(DEP_LIBS) +libpixman_1_la_LIBADD += libpixman-sse.la +endif + diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/Makefile.in /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/Makefile.in --- pixman-0.9.6/pixman/Makefile.in 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/pixman/Makefile.in 2008-03-27 15:02:10.000000000 +0100 @@ -33,17 +33,24 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ + +# mmx code @USE_MMX_TRUE@am__append_1 = libpixman-mmx.la +@USE_MMX_TRUE@am__append_2 = libpixman-mmx.la + +# sse2 code +@USE_SSE2_TRUE@am__append_3 = libpixman-sse.la +@USE_SSE2_TRUE@am__append_4 = libpixman-sse.la subdir = pixman DIST_COMMON = $(libpixmaninclude_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in + $(srcdir)/Makefile.in $(srcdir)/pixman-version.h.in 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 = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = pixman-version.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -54,9 +61,12 @@ "$(DESTDIR)$(libpixmanincludedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) -libpixman_1_la_DEPENDENCIES = $(am__append_1) -am_libpixman_1_la_OBJECTS = pixman-region.lo pixman-image.lo \ - pixman-compose.lo pixman-compose-accessors.lo pixman-pict.lo \ +libpixman_1_la_DEPENDENCIES = $(am__append_2) $(am__append_4) +am_libpixman_1_la_OBJECTS = pixman-access.lo \ + pixman-access-accessors.lo pixman-region.lo pixman-image.lo \ + pixman-combine.lo pixman-compose.lo \ + pixman-compose-accessors.lo pixman-pict.lo pixman-source.lo \ + pixman-transformed.lo pixman-transformed-accessors.lo \ pixman-utils.lo pixman-edge.lo pixman-edge-accessors.lo \ pixman-trap.lo pixman-compute-region.lo pixman-timer.lo libpixman_1_la_OBJECTS = $(am_libpixman_1_la_OBJECTS) @@ -73,6 +83,15 @@ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libpixman_mmx_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ @USE_MMX_TRUE@am_libpixman_mmx_la_rpath = +@USE_SSE2_TRUE@libpixman_sse_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am__libpixman_sse_la_SOURCES_DIST = pixman-sse.c pixman-sse.h +@USE_SSE2_TRUE@am_libpixman_sse_la_OBJECTS = \ +@USE_SSE2_TRUE@ libpixman_sse_la-pixman-sse.lo +libpixman_sse_la_OBJECTS = $(am_libpixman_sse_la_OBJECTS) +libpixman_sse_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libpixman_sse_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +@USE_SSE2_TRUE@am_libpixman_sse_la_rpath = DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -85,9 +104,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libpixman_1_la_SOURCES) $(libpixman_mmx_la_SOURCES) +SOURCES = $(libpixman_1_la_SOURCES) $(libpixman_mmx_la_SOURCES) \ + $(libpixman_sse_la_SOURCES) DIST_SOURCES = $(libpixman_1_la_SOURCES) \ - $(am__libpixman_mmx_la_SOURCES_DIST) + $(am__libpixman_mmx_la_SOURCES_DIST) \ + $(am__libpixman_sse_la_SOURCES_DIST) libpixmanincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(libpixmaninclude_HEADERS) ETAGS = etags @@ -137,7 +158,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MMX_CFLAGS = @MMX_CFLAGS@ @@ -149,12 +169,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PIXMAN_MAJOR = @PIXMAN_MAJOR@ +PIXMAN_VERSION_MAJOR = @PIXMAN_VERSION_MAJOR@ +PIXMAN_VERSION_MICRO = @PIXMAN_VERSION_MICRO@ +PIXMAN_VERSION_MINOR = @PIXMAN_VERSION_MINOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SSE_CFLAGS = @SSE_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ @@ -210,39 +233,50 @@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libpixman-1.la libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -libpixman_1_la_LIBADD = @DEP_LIBS@ -lm $(am__append_1) +libpixman_1_la_LIBADD = @DEP_LIBS@ -lm $(am__append_2) $(am__append_4) libpixman_1_la_SOURCES = \ - pixman.h \ - pixman-region.c \ - pixman-private.h \ - pixman-image.c \ - pixman-compose.c \ + pixman.h \ + pixman-access.c \ + pixman-access-accessors.c \ + pixman-region.c \ + pixman-private.h \ + pixman-image.c \ + pixman-combine.c \ + pixman-compose.c \ pixman-compose-accessors.c \ - pixman-pict.c \ - pixman-utils.c \ - pixman-edge.c \ + pixman-pict.c \ + pixman-source.c \ + pixman-transformed.c \ + pixman-transformed-accessors.c \ + pixman-utils.c \ + pixman-edge.c \ pixman-edge-accessors.c \ - pixman-edge-imp.h \ - pixman-trap.c \ - pixman-compute-region.c \ + pixman-edge-imp.h \ + pixman-trap.c \ + pixman-compute-region.c \ pixman-timer.c libpixmanincludedir = $(includedir)/pixman-1/ -libpixmaninclude_HEADERS = pixman.h - -# mmx code -@USE_MMX_TRUE@noinst_LTLIBRARIES = libpixman-mmx.la +libpixmaninclude_HEADERS = pixman.h pixman-version.h +noinst_LTLIBRARIES = $(am__append_1) $(am__append_3) +EXTRA_DIST = Makefile.win32 @USE_MMX_TRUE@libpixman_mmx_la_SOURCES = \ @USE_MMX_TRUE@ pixman-mmx.c \ @USE_MMX_TRUE@ pixman-mmx.h @USE_MMX_TRUE@libpixman_mmx_la_CFLAGS = $(DEP_CFLAGS) $(MMX_CFLAGS) @USE_MMX_TRUE@libpixman_mmx_la_LIBADD = $(DEP_LIBS) +@USE_SSE2_TRUE@libpixman_sse_la_SOURCES = \ +@USE_SSE2_TRUE@ pixman-sse.c \ +@USE_SSE2_TRUE@ pixman-sse.h + +@USE_SSE2_TRUE@libpixman_sse_la_CFLAGS = $(DEP_CFLAGS) $(SSE_CFLAGS) +@USE_SSE2_TRUE@libpixman_sse_la_LIBADD = $(DEP_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -267,10 +301,12 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +pixman-version.h: $(top_builddir)/config.status $(srcdir)/pixman-version.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @@ -311,6 +347,8 @@ $(libpixman_1_la_LINK) -rpath $(libdir) $(libpixman_1_la_OBJECTS) $(libpixman_1_la_LIBADD) $(LIBS) libpixman-mmx.la: $(libpixman_mmx_la_OBJECTS) $(libpixman_mmx_la_DEPENDENCIES) $(libpixman_mmx_la_LINK) $(am_libpixman_mmx_la_rpath) $(libpixman_mmx_la_OBJECTS) $(libpixman_mmx_la_LIBADD) $(LIBS) +libpixman-sse.la: $(libpixman_sse_la_OBJECTS) $(libpixman_sse_la_DEPENDENCIES) + $(libpixman_sse_la_LINK) $(am_libpixman_sse_la_rpath) $(libpixman_sse_la_OBJECTS) $(libpixman_sse_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -319,6 +357,10 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_mmx_la-pixman-mmx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_sse_la-pixman-sse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-access-accessors.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-access.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-combine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-compose-accessors.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-compose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-compute-region.Plo@am__quote@ @@ -327,7 +369,10 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-pict.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-region.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-source.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-timer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-transformed-accessors.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-transformed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-trap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-utils.Plo@am__quote@ @@ -359,6 +404,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_mmx_la_CFLAGS) $(CFLAGS) -c -o libpixman_mmx_la-pixman-mmx.lo `test -f 'pixman-mmx.c' || echo '$(srcdir)/'`pixman-mmx.c +libpixman_sse_la-pixman-sse.lo: pixman-sse.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_sse_la_CFLAGS) $(CFLAGS) -MT libpixman_sse_la-pixman-sse.lo -MD -MP -MF $(DEPDIR)/libpixman_sse_la-pixman-sse.Tpo -c -o libpixman_sse_la-pixman-sse.lo `test -f 'pixman-sse.c' || echo '$(srcdir)/'`pixman-sse.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpixman_sse_la-pixman-sse.Tpo $(DEPDIR)/libpixman_sse_la-pixman-sse.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-sse.c' object='libpixman_sse_la-pixman-sse.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_sse_la_CFLAGS) $(CFLAGS) -c -o libpixman_sse_la-pixman-sse.lo `test -f 'pixman-sse.c' || echo '$(srcdir)/'`pixman-sse.c + mostlyclean-libtool: -rm -f *.lo diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/Makefile.win32 /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/Makefile.win32 --- pixman-0.9.6/pixman/Makefile.win32 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/pixman/Makefile.win32 2008-03-24 14:13:13.000000000 +0100 @@ -1,31 +1,92 @@ -LIBRARY = pixman-1 +LIBRARY = pixman-1 -CC = cl +CC = cl LINK = link -CFLAGS = -MD -Zi -nologo -O2 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT="" +ifeq ($(CFG),) +CFG=release +endif + +ifeq ($(MMX),) +MMX=1 +endif + +CFLAGS = -MD -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT="" +MMX_CFLAGS = -DUSE_MMX -w14710 -w14714 + +# optimization flags +ifeq ($(CFG),debug) +CFLAGS += -Od -Zi +else +CFLAGS += -O2 +endif SOURCES = \ - pixman-region.c \ - pixman-image.c \ - pixman-compose.c \ + pixman-region.c \ + pixman-image.c \ + pixman-access.c \ + pixman-access-accessors.c \ + pixman-combine.c \ + pixman-compose.c \ pixman-compose-accessors.c \ - pixman-pict.c \ - pixman-utils.c \ - pixman-edge.c \ + pixman-pict.c \ + pixman-source.c \ + pixman-transformed.c \ + pixman-transformed-accessors.c \ + pixman-utils.c \ + pixman-edge.c \ pixman-edge-accessors.c \ - pixman-trap.c \ - pixman-compute-region.c \ - pixman-timer.c \ + pixman-trap.c \ + pixman-compute-region.c \ + pixman-timer.c \ $(NULL) -OBJECTS = $(subst .c,.obj,$(SOURCES)) - -%.obj: %.c +# MMX compilation flags +ifeq ($(MMX),1) +CFLAGS += $(MMX_CFLAGS) +SOURCES += pixman-mmx.c +endif + +OBJECTS = $(patsubst %.c, $(CFG)/%.obj, $(SOURCES)) + +# targets +all: inform informMMX $(CFG)/$(LIBRARY).lib + @exit 0 +clean: inform clean_r + @exit 0 +pixman: inform informMMX $(CFG)/$(LIBRARY).lib + @exit 0 + +inform: +ifneq ($(CFG),release) +ifneq ($(CFG),debug) + @echo "Invalid specified configuration option : "$(CFG)"." + @echo + @echo -n "Possible choices for configuration are " + @echo "'release' and 'debug'" + @echo "" + @exit 1 +endif +endif + +informMMX: +ifneq ($(MMX),0) +ifneq ($(MMX),1) + @echo "Invalid specified MMX option : "$(MMX)"." + @echo + @echo -n "Possible choices for MMX are 0 or 1" + @echo "" + @exit 1 +endif +endif + +# pixman compilation and linking +$(CFG)/%.obj: %.c + @mkdir -p $(CFG) @$(CC) -c $(CFLAGS) -Fo"$@" $< -$(LIBRARY).lib: $(OBJECTS) - lib -NOLOGO -OUT:$@ $(OBJECTS) +$(CFG)/$(LIBRARY).lib: $(OBJECTS) + lib -NOLOGO -OUT:$@ $(OBJECTS) || exit 0 -clean: - @rm -f *.obj *.lib *.pdb *.ilk || exit 0 +clean_r: + @rm -f $(CFG)/*.obj $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0 diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-access-accessors.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-access-accessors.c --- pixman-0.9.6/pixman/pixman-access-accessors.c 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-access-accessors.c 2008-03-24 14:13:13.000000000 +0100 @@ -0,0 +1,3 @@ +#define PIXMAN_FB_ACCESSORS + +#include "pixman-access.c" diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-access.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-access.c --- pixman-0.9.6/pixman/pixman-access.c 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-access.c 2008-03-24 14:13:13.000000000 +0100 @@ -0,0 +1,1686 @@ +/* + * + * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. + * 2005 Lars Knoll & Zack Rusin, Trolltech + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "pixman-private.h" + +#ifdef PIXMAN_FB_ACCESSORS +#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture_accessors +#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture_accessors +#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture_accessors +#else +#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture +#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture +#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture +#endif + +/* + * YV12 setup and access macros + */ + +#define YV12_SETUP(pict) \ + uint32_t *bits = pict->bits; \ + int stride = pict->rowstride; \ + int offset0 = stride < 0 ? \ + ((-stride) >> 1) * ((pict->height - 1) >> 1) - stride : \ + stride * pict->height; \ + int offset1 = stride < 0 ? \ + offset0 + ((-stride) >> 1) * ((pict->height) >> 1) : \ + offset0 + (offset0 >> 2) +/* Note n trailing semicolon on the above macro; if it's there, then + * the typical usage of YV12_SETUP(pict); will have an extra trailing ; + * that some compilers will interpret as a statement -- and then any further + * variable declarations will cause an error. + */ + +#define YV12_Y(line) \ + ((uint8_t *) ((bits) + (stride) * (line))) + +#define YV12_U(line) \ + ((uint8_t *) ((bits) + offset1 + \ + ((stride) >> 1) * ((line) >> 1))) + +#define YV12_V(line) \ + ((uint8_t *) ((bits) + offset0 + \ + ((stride) >> 1) * ((line) >> 1))) + +/*********************************** Fetch ************************************/ + +static FASTCALL void +fbFetch_a8r8g8b8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + MEMCPY_WRAPPED(pict, + buffer, (const uint32_t *)bits + x, + width*sizeof(uint32_t)); +} + +static FASTCALL void +fbFetch_x8r8g8b8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint32_t *pixel = (const uint32_t *)bits + x; + const uint32_t *end = pixel + width; + while (pixel < end) { + *buffer++ = READ(pict, pixel++) | 0xff000000; + } +} + +static FASTCALL void +fbFetch_a8b8g8r8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint32_t *pixel = (uint32_t *)bits + x; + const uint32_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + *buffer++ = (p & 0xff00ff00) | + ((p >> 16) & 0xff) | + ((p & 0xff) << 16); + } +} + +static FASTCALL void +fbFetch_x8b8g8r8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint32_t *pixel = (uint32_t *)bits + x; + const uint32_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + *buffer++ = 0xff000000 | + (p & 0x0000ff00) | + ((p >> 16) & 0xff) | + ((p & 0xff) << 16); + } +} + +static FASTCALL void +fbFetch_r8g8b8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint8_t *pixel = (const uint8_t *)bits + 3*x; + const uint8_t *end = pixel + 3*width; + while (pixel < end) { + uint32_t b = Fetch24(pict, pixel) | 0xff000000; + pixel += 3; + *buffer++ = b; + } +} + +static FASTCALL void +fbFetch_b8g8r8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint8_t *pixel = (const uint8_t *)bits + 3*x; + const uint8_t *end = pixel + 3*width; + while (pixel < end) { + uint32_t b = 0xff000000; +#if IMAGE_BYTE_ORDER == MSBFirst + b |= (READ(pict, pixel++)); + b |= (READ(pict, pixel++) << 8); + b |= (READ(pict, pixel++) << 16); +#else + b |= (READ(pict, pixel++) << 16); + b |= (READ(pict, pixel++) << 8); + b |= (READ(pict, pixel++)); +#endif + *buffer++ = b; + } +} + +static FASTCALL void +fbFetch_r5g6b5 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + uint32_t r = (((p) << 3) & 0xf8) | + (((p) << 5) & 0xfc00) | + (((p) << 8) & 0xf80000); + r |= (r >> 5) & 0x70007; + r |= (r >> 6) & 0x300; + *buffer++ = 0xff000000 | r; + } +} + +static FASTCALL void +fbFetch_b5g6r5 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + b = ((p & 0xf800) | ((p & 0xe000) >> 5)) >> 8; + g = ((p & 0x07e0) | ((p & 0x0600) >> 6)) << 5; + r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14; + *buffer++ = 0xff000000 | r | g | b; + } +} + +static FASTCALL void +fbFetch_a1r5g5b5 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b, a; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + a = (uint32_t) ((uint8_t) (0 - ((p & 0x8000) >> 15))) << 24; + r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9; + g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; + b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2; + *buffer++ = a | r | g | b; + } +} + +static FASTCALL void +fbFetch_x1r5g5b5 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9; + g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; + b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2; + *buffer++ = 0xff000000 | r | g | b; + } +} + +static FASTCALL void +fbFetch_a1b5g5r5 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b, a; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + a = (uint32_t) ((uint8_t) (0 - ((p & 0x8000) >> 15))) << 24; + b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7; + g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; + r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14; + *buffer++ = a | r | g | b; + } +} + +static FASTCALL void +fbFetch_x1b5g5r5 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7; + g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; + r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14; + *buffer++ = 0xff000000 | r | g | b; + } +} + +static FASTCALL void +fbFetch_a4r4g4b4 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b, a; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + a = ((p & 0xf000) | ((p & 0xf000) >> 4)) << 16; + r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12; + g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; + b = ((p & 0x000f) | ((p & 0x000f) << 4)); + *buffer++ = a | r | g | b; + } +} + +static FASTCALL void +fbFetch_x4r4g4b4 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12; + g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; + b = ((p & 0x000f) | ((p & 0x000f) << 4)); + *buffer++ = 0xff000000 | r | g | b; + } +} + +static FASTCALL void +fbFetch_a4b4g4r4 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b, a; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + a = ((p & 0xf000) | ((p & 0xf000) >> 4)) << 16; + b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4; + g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; + r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16; + *buffer++ = a | r | g | b; + } +} + +static FASTCALL void +fbFetch_x4b4g4r4 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint16_t *pixel = (const uint16_t *)bits + x; + const uint16_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4; + g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; + r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16; + *buffer++ = 0xff000000 | r | g | b; + } +} + +static FASTCALL void +fbFetch_a8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint8_t *pixel = (const uint8_t *)bits + x; + const uint8_t *end = pixel + width; + while (pixel < end) { + *buffer++ = READ(pict, pixel++) << 24; + } +} + +static FASTCALL void +fbFetch_r3g3b2 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint8_t *pixel = (const uint8_t *)bits + x; + const uint8_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + r = ((p & 0xe0) | ((p & 0xe0) >> 3) | ((p & 0xc0) >> 6)) << 16; + g = ((p & 0x1c) | ((p & 0x18) >> 3) | ((p & 0x1c) << 3)) << 8; + b = (((p & 0x03) ) | + ((p & 0x03) << 2) | + ((p & 0x03) << 4) | + ((p & 0x03) << 6)); + *buffer++ = 0xff000000 | r | g | b; + } +} + +static FASTCALL void +fbFetch_b2g3r3 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint8_t *pixel = (const uint8_t *)bits + x; + const uint8_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + b = (((p & 0xc0) ) | + ((p & 0xc0) >> 2) | + ((p & 0xc0) >> 4) | + ((p & 0xc0) >> 6)); + g = ((p & 0x38) | ((p & 0x38) >> 3) | ((p & 0x30) << 2)) << 8; + r = (((p & 0x07) ) | + ((p & 0x07) << 3) | + ((p & 0x06) << 6)) << 16; + *buffer++ = 0xff000000 | r | g | b; + } +} + +static FASTCALL void +fbFetch_a2r2g2b2 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t a,r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint8_t *pixel = (const uint8_t *)bits + x; + const uint8_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + a = ((p & 0xc0) * 0x55) << 18; + r = ((p & 0x30) * 0x55) << 12; + g = ((p & 0x0c) * 0x55) << 6; + b = ((p & 0x03) * 0x55); + *buffer++ = a|r|g|b; + } +} + +static FASTCALL void +fbFetch_a2b2g2r2 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t a,r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint8_t *pixel = (const uint8_t *)bits + x; + const uint8_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + + a = ((p & 0xc0) * 0x55) << 18; + b = ((p & 0x30) * 0x55) >> 6; + g = ((p & 0x0c) * 0x55) << 6; + r = ((p & 0x03) * 0x55) << 16; + *buffer++ = a|r|g|b; + } +} + +static FASTCALL void +fbFetch_c8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const pixman_indexed_t * indexed = pict->indexed; + const uint8_t *pixel = (const uint8_t *)bits + x; + const uint8_t *end = pixel + width; + while (pixel < end) { + uint32_t p = READ(pict, pixel++); + *buffer++ = indexed->rgba[p]; + } +} + +static FASTCALL void +fbFetch_x4a4 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const uint8_t *pixel = (const uint8_t *)bits + x; + const uint8_t *end = pixel + width; + while (pixel < end) { + uint8_t p = READ(pict, pixel++) & 0xf; + *buffer++ = (p | (p << 4)) << 24; + } +} + +#define Fetch8(img,l,o) (READ(img, (uint8_t *)(l) + ((o) >> 2))) +#if IMAGE_BYTE_ORDER == MSBFirst +#define Fetch4(img,l,o) ((o) & 2 ? Fetch8(img,l,o) & 0xf : Fetch8(img,l,o) >> 4) +#else +#define Fetch4(img,l,o) ((o) & 2 ? Fetch8(img,l,o) >> 4 : Fetch8(img,l,o) & 0xf) +#endif + +static FASTCALL void +fbFetch_a4 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + int i; + for (i = 0; i < width; ++i) { + uint32_t p = Fetch4(pict, bits, i + x); + + p |= p << 4; + *buffer++ = p << 24; + } +} + +static FASTCALL void +fbFetch_r1g2b1 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + int i; + for (i = 0; i < width; ++i) { + uint32_t p = Fetch4(pict, bits, i + x); + + r = ((p & 0x8) * 0xff) << 13; + g = ((p & 0x6) * 0x55) << 7; + b = ((p & 0x1) * 0xff); + *buffer++ = 0xff000000|r|g|b; + } +} + +static FASTCALL void +fbFetch_b1g2r1 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + int i; + for (i = 0; i < width; ++i) { + uint32_t p = Fetch4(pict, bits, i + x); + + b = ((p & 0x8) * 0xff) >> 3; + g = ((p & 0x6) * 0x55) << 7; + r = ((p & 0x1) * 0xff) << 16; + *buffer++ = 0xff000000|r|g|b; + } +} + +static FASTCALL void +fbFetch_a1r1g1b1 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t a,r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + int i; + for (i = 0; i < width; ++i) { + uint32_t p = Fetch4(pict, bits, i + x); + + a = ((p & 0x8) * 0xff) << 21; + r = ((p & 0x4) * 0xff) << 14; + g = ((p & 0x2) * 0xff) << 7; + b = ((p & 0x1) * 0xff); + *buffer++ = a|r|g|b; + } +} + +static FASTCALL void +fbFetch_a1b1g1r1 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + uint32_t a,r,g,b; + const uint32_t *bits = pict->bits + y*pict->rowstride; + int i; + for (i = 0; i < width; ++i) { + uint32_t p = Fetch4(pict, bits, i + x); + + a = ((p & 0x8) * 0xff) << 21; + r = ((p & 0x4) * 0xff) >> 3; + g = ((p & 0x2) * 0xff) << 7; + b = ((p & 0x1) * 0xff) << 16; + *buffer++ = a|r|g|b; + } +} + +static FASTCALL void +fbFetch_c4 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const pixman_indexed_t * indexed = pict->indexed; + int i; + for (i = 0; i < width; ++i) { + uint32_t p = Fetch4(pict, bits, i + x); + + *buffer++ = indexed->rgba[p]; + } +} + + +static FASTCALL void +fbFetch_a1 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + int i; + for (i = 0; i < width; ++i) { + uint32_t p = READ(pict, bits + ((i + x) >> 5)); + uint32_t a; +#if BITMAP_BIT_ORDER == MSBFirst + a = p >> (0x1f - ((i+x) & 0x1f)); +#else + a = p >> ((i+x) & 0x1f); +#endif + a = a & 1; + a |= a << 1; + a |= a << 2; + a |= a << 4; + *buffer++ = a << 24; + } +} + +static FASTCALL void +fbFetch_g1 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer) +{ + const uint32_t *bits = pict->bits + y*pict->rowstride; + const pixman_indexed_t * indexed = pict->indexed; + int i; + for (i = 0; i < width; ++i) { + uint32_t p = READ(pict, bits + ((i+x) >> 5)); + uint32_t a; +#if BITMAP_BIT_ORDER == MSBFirst + a = p >> (0x1f - ((i+x) & 0x1f)); +#else + a = p >> ((i+x) & 0x1f); +#endif + a = a & 1; + *buffer++ = indexed->rgba[a]; + } +} + +static FASTCALL void +fbFetch_yuy2 (bits_image_t *pict, int x, int line, int width, uint32_t *buffer) +{ + int16_t y, u, v; + int32_t r, g, b; + int i; + + const uint32_t *bits = pict->bits + pict->rowstride * line; + + for (i = 0; i < width; i++) + { + y = ((uint8_t *) bits)[(x + i) << 1] - 16; + u = ((uint8_t *) bits)[(((x + i) << 1) & -4) + 1] - 128; + v = ((uint8_t *) bits)[(((x + i) << 1) & -4) + 3] - 128; + + /* R = 1.164(Y - 16) + 1.596(V - 128) */ + r = 0x012b27 * y + 0x019a2e * v; + /* G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128) */ + g = 0x012b27 * y - 0x00d0f2 * v - 0x00647e * u; + /* B = 1.164(Y - 16) + 2.018(U - 128) */ + b = 0x012b27 * y + 0x0206a2 * u; + + WRITE(pict, buffer++, 0xff000000 | + (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) | + (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) | + (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0)); + } +} + +static FASTCALL void +fbFetch_yv12 (bits_image_t *pict, int x, int line, int width, uint32_t *buffer) +{ + YV12_SETUP(pict); + uint8_t *pY = YV12_Y (line); + uint8_t *pU = YV12_U (line); + uint8_t *pV = YV12_V (line); + int16_t y, u, v; + int32_t r, g, b; + int i; + + for (i = 0; i < width; i++) + { + y = pY[x + i] - 16; + u = pU[(x + i) >> 1] - 128; + v = pV[(x + i) >> 1] - 128; + + /* R = 1.164(Y - 16) + 1.596(V - 128) */ + r = 0x012b27 * y + 0x019a2e * v; + /* G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128) */ + g = 0x012b27 * y - 0x00d0f2 * v - 0x00647e * u; + /* B = 1.164(Y - 16) + 2.018(U - 128) */ + b = 0x012b27 * y + 0x0206a2 * u; + + WRITE(pict, buffer++, 0xff000000 | + (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) | + (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) | + (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0)); + } +} + +fetchProc FETCH_PROC_FOR_PICTURE (bits_image_t * pict) +{ + switch(pict->format) { + case PIXMAN_a8r8g8b8: return fbFetch_a8r8g8b8; + case PIXMAN_x8r8g8b8: return fbFetch_x8r8g8b8; + case PIXMAN_a8b8g8r8: return fbFetch_a8b8g8r8; + case PIXMAN_x8b8g8r8: return fbFetch_x8b8g8r8; + + /* 24bpp formats */ + case PIXMAN_r8g8b8: return fbFetch_r8g8b8; + case PIXMAN_b8g8r8: return fbFetch_b8g8r8; + + /* 16bpp formats */ + case PIXMAN_r5g6b5: return fbFetch_r5g6b5; + case PIXMAN_b5g6r5: return fbFetch_b5g6r5; + + case PIXMAN_a1r5g5b5: return fbFetch_a1r5g5b5; + case PIXMAN_x1r5g5b5: return fbFetch_x1r5g5b5; + case PIXMAN_a1b5g5r5: return fbFetch_a1b5g5r5; + case PIXMAN_x1b5g5r5: return fbFetch_x1b5g5r5; + case PIXMAN_a4r4g4b4: return fbFetch_a4r4g4b4; + case PIXMAN_x4r4g4b4: return fbFetch_x4r4g4b4; + case PIXMAN_a4b4g4r4: return fbFetch_a4b4g4r4; + case PIXMAN_x4b4g4r4: return fbFetch_x4b4g4r4; + + /* 8bpp formats */ + case PIXMAN_a8: return fbFetch_a8; + case PIXMAN_r3g3b2: return fbFetch_r3g3b2; + case PIXMAN_b2g3r3: return fbFetch_b2g3r3; + case PIXMAN_a2r2g2b2: return fbFetch_a2r2g2b2; + case PIXMAN_a2b2g2r2: return fbFetch_a2b2g2r2; + case PIXMAN_c8: return fbFetch_c8; + case PIXMAN_g8: return fbFetch_c8; + case PIXMAN_x4a4: return fbFetch_x4a4; + + /* 4bpp formats */ + case PIXMAN_a4: return fbFetch_a4; + case PIXMAN_r1g2b1: return fbFetch_r1g2b1; + case PIXMAN_b1g2r1: return fbFetch_b1g2r1; + case PIXMAN_a1r1g1b1: return fbFetch_a1r1g1b1; + case PIXMAN_a1b1g1r1: return fbFetch_a1b1g1r1; + case PIXMAN_c4: return fbFetch_c4; + case PIXMAN_g4: return fbFetch_c4; + + /* 1bpp formats */ + case PIXMAN_a1: return fbFetch_a1; + case PIXMAN_g1: return fbFetch_g1; + + /* YUV formats */ + case PIXMAN_yuy2: return fbFetch_yuy2; + case PIXMAN_yv12: return fbFetch_yv12; + } + + return NULL; +} + +/**************************** Pixel wise fetching *****************************/ + +static FASTCALL uint32_t +fbFetchPixel_a8r8g8b8 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + return READ(pict, (uint32_t *)bits + offset); +} + +static FASTCALL uint32_t +fbFetchPixel_x8r8g8b8 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + return READ(pict, (uint32_t *)bits + offset) | 0xff000000; +} + +static FASTCALL uint32_t +fbFetchPixel_a8b8g8r8 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint32_t *)bits + offset); + + return ((pixel & 0xff000000) | + ((pixel >> 16) & 0xff) | + (pixel & 0x0000ff00) | + ((pixel & 0xff) << 16)); +} + +static FASTCALL uint32_t +fbFetchPixel_x8b8g8r8 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint32_t *)bits + offset); + + return ((0xff000000) | + ((pixel >> 16) & 0xff) | + (pixel & 0x0000ff00) | + ((pixel & 0xff) << 16)); +} + +static FASTCALL uint32_t +fbFetchPixel_r8g8b8 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint8_t *pixel = ((uint8_t *) bits) + (offset*3); +#if IMAGE_BYTE_ORDER == MSBFirst + return (0xff000000 | + (READ(pict, pixel + 0) << 16) | + (READ(pict, pixel + 1) << 8) | + (READ(pict, pixel + 2))); +#else + return (0xff000000 | + (READ(pict, pixel + 2) << 16) | + (READ(pict, pixel + 1) << 8) | + (READ(pict, pixel + 0))); +#endif +} + +static FASTCALL uint32_t +fbFetchPixel_b8g8r8 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint8_t *pixel = ((uint8_t *) bits) + (offset*3); +#if IMAGE_BYTE_ORDER == MSBFirst + return (0xff000000 | + (READ(pict, pixel + 2) << 16) | + (READ(pict, pixel + 1) << 8) | + (READ(pict, pixel + 0))); +#else + return (0xff000000 | + (READ(pict, pixel + 0) << 16) | + (READ(pict, pixel + 1) << 8) | + (READ(pict, pixel + 2))); +#endif +} + +static FASTCALL uint32_t +fbFetchPixel_r5g6b5 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + r = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) << 8; + g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5; + b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2; + return (0xff000000 | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_b5g6r5 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + b = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) >> 8; + g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5; + r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14; + return (0xff000000 | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_a1r5g5b5 (bits_image_t *pict, int offset, int line) +{ + uint32_t a,r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24; + r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9; + g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6; + b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2; + return (a | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_x1r5g5b5 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9; + g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6; + b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2; + return (0xff000000 | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_a1b5g5r5 (bits_image_t *pict, int offset, int line) +{ + uint32_t a,r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24; + b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7; + g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6; + r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14; + return (a | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_x1b5g5r5 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7; + g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6; + r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14; + return (0xff000000 | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_a4r4g4b4 (bits_image_t *pict, int offset, int line) +{ + uint32_t a,r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16; + r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12; + g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; + b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)); + return (a | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_x4r4g4b4 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12; + g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; + b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)); + return (0xff000000 | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_a4b4g4r4 (bits_image_t *pict, int offset, int line) +{ + uint32_t a,r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16; + b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4; + g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; + r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16; + return (a | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_x4b4g4r4 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint16_t *) bits + offset); + + b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4; + g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; + r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16; + return (0xff000000 | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_a8 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint8_t *) bits + offset); + + return pixel << 24; +} + +static FASTCALL uint32_t +fbFetchPixel_r3g3b2 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint8_t *) bits + offset); + + r = ((pixel & 0xe0) | ((pixel & 0xe0) >> 3) | ((pixel & 0xc0) >> 6)) << 16; + g = ((pixel & 0x1c) | ((pixel & 0x18) >> 3) | ((pixel & 0x1c) << 3)) << 8; + b = (((pixel & 0x03) ) | + ((pixel & 0x03) << 2) | + ((pixel & 0x03) << 4) | + ((pixel & 0x03) << 6)); + return (0xff000000 | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_b2g3r3 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint8_t *) bits + offset); + + b = (((pixel & 0xc0) ) | + ((pixel & 0xc0) >> 2) | + ((pixel & 0xc0) >> 4) | + ((pixel & 0xc0) >> 6)); + g = ((pixel & 0x38) | ((pixel & 0x38) >> 3) | ((pixel & 0x30) << 2)) << 8; + r = (((pixel & 0x07) ) | + ((pixel & 0x07) << 3) | + ((pixel & 0x06) << 6)) << 16; + return (0xff000000 | r | g | b); +} + +static FASTCALL uint32_t +fbFetchPixel_a2r2g2b2 (bits_image_t *pict, int offset, int line) +{ + uint32_t a,r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint8_t *) bits + offset); + + a = ((pixel & 0xc0) * 0x55) << 18; + r = ((pixel & 0x30) * 0x55) << 12; + g = ((pixel & 0x0c) * 0x55) << 6; + b = ((pixel & 0x03) * 0x55); + return a|r|g|b; +} + +static FASTCALL uint32_t +fbFetchPixel_a2b2g2r2 (bits_image_t *pict, int offset, int line) +{ + uint32_t a,r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint8_t *) bits + offset); + + a = ((pixel & 0xc0) * 0x55) << 18; + b = ((pixel & 0x30) * 0x55) >> 6; + g = ((pixel & 0x0c) * 0x55) << 6; + r = ((pixel & 0x03) * 0x55) << 16; + return a|r|g|b; +} + +static FASTCALL uint32_t +fbFetchPixel_c8 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint8_t *) bits + offset); + const pixman_indexed_t * indexed = pict->indexed; + return indexed->rgba[pixel]; +} + +static FASTCALL uint32_t +fbFetchPixel_x4a4 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, (uint8_t *) bits + offset); + + return ((pixel & 0xf) | ((pixel & 0xf) << 4)) << 24; +} + +static FASTCALL uint32_t +fbFetchPixel_a4 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = Fetch4(pict, bits, offset); + + pixel |= pixel << 4; + return pixel << 24; +} + +static FASTCALL uint32_t +fbFetchPixel_r1g2b1 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = Fetch4(pict, bits, offset); + + r = ((pixel & 0x8) * 0xff) << 13; + g = ((pixel & 0x6) * 0x55) << 7; + b = ((pixel & 0x1) * 0xff); + return 0xff000000|r|g|b; +} + +static FASTCALL uint32_t +fbFetchPixel_b1g2r1 (bits_image_t *pict, int offset, int line) +{ + uint32_t r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = Fetch4(pict, bits, offset); + + b = ((pixel & 0x8) * 0xff) >> 3; + g = ((pixel & 0x6) * 0x55) << 7; + r = ((pixel & 0x1) * 0xff) << 16; + return 0xff000000|r|g|b; +} + +static FASTCALL uint32_t +fbFetchPixel_a1r1g1b1 (bits_image_t *pict, int offset, int line) +{ + uint32_t a,r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = Fetch4(pict, bits, offset); + + a = ((pixel & 0x8) * 0xff) << 21; + r = ((pixel & 0x4) * 0xff) << 14; + g = ((pixel & 0x2) * 0xff) << 7; + b = ((pixel & 0x1) * 0xff); + return a|r|g|b; +} + +static FASTCALL uint32_t +fbFetchPixel_a1b1g1r1 (bits_image_t *pict, int offset, int line) +{ + uint32_t a,r,g,b; + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = Fetch4(pict, bits, offset); + + a = ((pixel & 0x8) * 0xff) << 21; + r = ((pixel & 0x4) * 0xff) >> 3; + g = ((pixel & 0x2) * 0xff) << 7; + b = ((pixel & 0x1) * 0xff) << 16; + return a|r|g|b; +} + +static FASTCALL uint32_t +fbFetchPixel_c4 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = Fetch4(pict, bits, offset); + const pixman_indexed_t * indexed = pict->indexed; + + return indexed->rgba[pixel]; +} + + +static FASTCALL uint32_t +fbFetchPixel_a1 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, bits + (offset >> 5)); + uint32_t a; +#if BITMAP_BIT_ORDER == MSBFirst + a = pixel >> (0x1f - (offset & 0x1f)); +#else + a = pixel >> (offset & 0x1f); +#endif + a = a & 1; + a |= a << 1; + a |= a << 2; + a |= a << 4; + return a << 24; +} + +static FASTCALL uint32_t +fbFetchPixel_g1 (bits_image_t *pict, int offset, int line) +{ + uint32_t *bits = pict->bits + line*pict->rowstride; + uint32_t pixel = READ(pict, bits + (offset >> 5)); + const pixman_indexed_t * indexed = pict->indexed; + uint32_t a; +#if BITMAP_BIT_ORDER == MSBFirst + a = pixel >> (0x1f - (offset & 0x1f)); +#else + a = pixel >> (offset & 0x1f); +#endif + a = a & 1; + return indexed->rgba[a]; +} + +static FASTCALL uint32_t +fbFetchPixel_yuy2 (bits_image_t *pict, int offset, int line) +{ + int16_t y, u, v; + int32_t r, g, b; + + const uint32_t *bits = pict->bits + pict->rowstride * line; + + y = ((uint8_t *) bits)[offset << 1] - 16; + u = ((uint8_t *) bits)[((offset << 1) & -4) + 1] - 128; + v = ((uint8_t *) bits)[((offset << 1) & -4) + 3] - 128; + + /* R = 1.164(Y - 16) + 1.596(V - 128) */ + r = 0x012b27 * y + 0x019a2e * v; + /* G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128) */ + g = 0x012b27 * y - 0x00d0f2 * v - 0x00647e * u; + /* B = 1.164(Y - 16) + 2.018(U - 128) */ + b = 0x012b27 * y + 0x0206a2 * u; + + return 0xff000000 | + (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) | + (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) | + (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0); +} + +static FASTCALL uint32_t +fbFetchPixel_yv12 (bits_image_t *pict, int offset, int line) +{ + YV12_SETUP(pict); + int16_t y = YV12_Y (line)[offset] - 16; + int16_t u = YV12_U (line)[offset >> 1] - 128; + int16_t v = YV12_V (line)[offset >> 1] - 128; + int32_t r, g, b; + + /* R = 1.164(Y - 16) + 1.596(V - 128) */ + r = 0x012b27 * y + 0x019a2e * v; + /* G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128) */ + g = 0x012b27 * y - 0x00d0f2 * v - 0x00647e * u; + /* B = 1.164(Y - 16) + 2.018(U - 128) */ + b = 0x012b27 * y + 0x0206a2 * u; + + return 0xff000000 | + (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) | + (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) | + (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0); +} + +fetchPixelProc FETCH_PIXEL_PROC_FOR_PICTURE (bits_image_t * pict) +{ + switch(pict->format) { + case PIXMAN_a8r8g8b8: return fbFetchPixel_a8r8g8b8; + case PIXMAN_x8r8g8b8: return fbFetchPixel_x8r8g8b8; + case PIXMAN_a8b8g8r8: return fbFetchPixel_a8b8g8r8; + case PIXMAN_x8b8g8r8: return fbFetchPixel_x8b8g8r8; + + /* 24bpp formats */ + case PIXMAN_r8g8b8: return fbFetchPixel_r8g8b8; + case PIXMAN_b8g8r8: return fbFetchPixel_b8g8r8; + + /* 16bpp formats */ + case PIXMAN_r5g6b5: return fbFetchPixel_r5g6b5; + case PIXMAN_b5g6r5: return fbFetchPixel_b5g6r5; + + case PIXMAN_a1r5g5b5: return fbFetchPixel_a1r5g5b5; + case PIXMAN_x1r5g5b5: return fbFetchPixel_x1r5g5b5; + case PIXMAN_a1b5g5r5: return fbFetchPixel_a1b5g5r5; + case PIXMAN_x1b5g5r5: return fbFetchPixel_x1b5g5r5; + case PIXMAN_a4r4g4b4: return fbFetchPixel_a4r4g4b4; + case PIXMAN_x4r4g4b4: return fbFetchPixel_x4r4g4b4; + case PIXMAN_a4b4g4r4: return fbFetchPixel_a4b4g4r4; + case PIXMAN_x4b4g4r4: return fbFetchPixel_x4b4g4r4; + + /* 8bpp formats */ + case PIXMAN_a8: return fbFetchPixel_a8; + case PIXMAN_r3g3b2: return fbFetchPixel_r3g3b2; + case PIXMAN_b2g3r3: return fbFetchPixel_b2g3r3; + case PIXMAN_a2r2g2b2: return fbFetchPixel_a2r2g2b2; + case PIXMAN_a2b2g2r2: return fbFetchPixel_a2b2g2r2; + case PIXMAN_c8: return fbFetchPixel_c8; + case PIXMAN_g8: return fbFetchPixel_c8; + case PIXMAN_x4a4: return fbFetchPixel_x4a4; + + /* 4bpp formats */ + case PIXMAN_a4: return fbFetchPixel_a4; + case PIXMAN_r1g2b1: return fbFetchPixel_r1g2b1; + case PIXMAN_b1g2r1: return fbFetchPixel_b1g2r1; + case PIXMAN_a1r1g1b1: return fbFetchPixel_a1r1g1b1; + case PIXMAN_a1b1g1r1: return fbFetchPixel_a1b1g1r1; + case PIXMAN_c4: return fbFetchPixel_c4; + case PIXMAN_g4: return fbFetchPixel_c4; + + /* 1bpp formats */ + case PIXMAN_a1: return fbFetchPixel_a1; + case PIXMAN_g1: return fbFetchPixel_g1; + + /* YUV formats */ + case PIXMAN_yuy2: return fbFetchPixel_yuy2; + case PIXMAN_yv12: return fbFetchPixel_yv12; + } + + return NULL; +} + +/*********************************** Store ************************************/ + +#define Splita(v) uint32_t a = ((v) >> 24), r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff +#define Split(v) uint32_t r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff + +static FASTCALL void +fbStore_a8r8g8b8 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + MEMCPY_WRAPPED(image, ((uint32_t *)bits) + x, values, width*sizeof(uint32_t)); +} + +static FASTCALL void +fbStore_x8r8g8b8 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint32_t *pixel = (uint32_t *)bits + x; + for (i = 0; i < width; ++i) + WRITE(image, pixel++, values[i] & 0xffffff); +} + +static FASTCALL void +fbStore_a8b8g8r8 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint32_t *pixel = (uint32_t *)bits + x; + for (i = 0; i < width; ++i) + WRITE(image, pixel++, (values[i] & 0xff00ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16)); +} + +static FASTCALL void +fbStore_x8b8g8r8 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint32_t *pixel = (uint32_t *)bits + x; + for (i = 0; i < width; ++i) + WRITE(image, pixel++, (values[i] & 0x0000ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16)); +} + +static FASTCALL void +fbStore_r8g8b8 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, + const pixman_indexed_t * indexed) +{ + int i; + uint8_t *pixel = ((uint8_t *) bits) + 3*x; + for (i = 0; i < width; ++i) { + Store24(image, pixel, values[i]); + pixel += 3; + } +} + +static FASTCALL void +fbStore_b8g8r8 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint8_t *pixel = ((uint8_t *) bits) + 3*x; + for (i = 0; i < width; ++i) { + uint32_t val = values[i]; +#if IMAGE_BYTE_ORDER == MSBFirst + WRITE(image, pixel++, Blue(val)); + WRITE(image, pixel++, Green(val)); + WRITE(image, pixel++, Red(val)); +#else + WRITE(image, pixel++, Red(val)); + WRITE(image, pixel++, Green(val)); + WRITE(image, pixel++, Blue(val)); +#endif + } +} + +static FASTCALL void +fbStore_r5g6b5 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + uint32_t s = values[i]; + WRITE(image, pixel++, ((s >> 3) & 0x001f) | + ((s >> 5) & 0x07e0) | + ((s >> 8) & 0xf800)); + } +} + +static FASTCALL void +fbStore_b5g6r5 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + Split(values[i]); + WRITE(image, pixel++, ((b << 8) & 0xf800) | + ((g << 3) & 0x07e0) | + ((r >> 3) )); + } +} + +static FASTCALL void +fbStore_a1r5g5b5 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + Splita(values[i]); + WRITE(image, pixel++, ((a << 8) & 0x8000) | + ((r << 7) & 0x7c00) | + ((g << 2) & 0x03e0) | + ((b >> 3) )); + } +} + +static FASTCALL void +fbStore_x1r5g5b5 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + Split(values[i]); + WRITE(image, pixel++, ((r << 7) & 0x7c00) | + ((g << 2) & 0x03e0) | + ((b >> 3) )); + } +} + +static FASTCALL void +fbStore_a1b5g5r5 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + Splita(values[i]); + WRITE(image, pixel++, ((a << 8) & 0x8000) | + ((b << 7) & 0x7c00) | + ((g << 2) & 0x03e0) | + ((r >> 3) )); + } +} + +static FASTCALL void +fbStore_x1b5g5r5 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + Split(values[i]); + WRITE(image, pixel++, ((b << 7) & 0x7c00) | + ((g << 2) & 0x03e0) | + ((r >> 3) )); + } +} + +static FASTCALL void +fbStore_a4r4g4b4 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + Splita(values[i]); + WRITE(image, pixel++, ((a << 8) & 0xf000) | + ((r << 4) & 0x0f00) | + ((g ) & 0x00f0) | + ((b >> 4) )); + } +} + +static FASTCALL void +fbStore_x4r4g4b4 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + Split(values[i]); + WRITE(image, pixel++, ((r << 4) & 0x0f00) | + ((g ) & 0x00f0) | + ((b >> 4) )); + } +} + +static FASTCALL void +fbStore_a4b4g4r4 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + Splita(values[i]); + WRITE(image, pixel++, ((a << 8) & 0xf000) | + ((b << 4) & 0x0f00) | + ((g ) & 0x00f0) | + ((r >> 4) )); + } +} + +static FASTCALL void +fbStore_x4b4g4r4 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint16_t *pixel = ((uint16_t *) bits) + x; + for (i = 0; i < width; ++i) { + Split(values[i]); + WRITE(image, pixel++, ((b << 4) & 0x0f00) | + ((g ) & 0x00f0) | + ((r >> 4) )); + } +} + +static FASTCALL void +fbStore_a8 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint8_t *pixel = ((uint8_t *) bits) + x; + for (i = 0; i < width; ++i) { + WRITE(image, pixel++, values[i] >> 24); + } +} + +static FASTCALL void +fbStore_r3g3b2 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint8_t *pixel = ((uint8_t *) bits) + x; + for (i = 0; i < width; ++i) { + Split(values[i]); + WRITE(image, pixel++, + ((r ) & 0xe0) | + ((g >> 3) & 0x1c) | + ((b >> 6) )); + } +} + +static FASTCALL void +fbStore_b2g3r3 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint8_t *pixel = ((uint8_t *) bits) + x; + for (i = 0; i < width; ++i) { + Split(values[i]); + WRITE(image, pixel++, + ((b ) & 0xc0) | + ((g >> 2) & 0x1c) | + ((r >> 5) )); + } +} + +static FASTCALL void +fbStore_a2r2g2b2 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint8_t *pixel = ((uint8_t *) bits) + x; + for (i = 0; i < width; ++i) { + Splita(values[i]); + WRITE(image, pixel++, ((a ) & 0xc0) | + ((r >> 2) & 0x30) | + ((g >> 4) & 0x0c) | + ((b >> 6) )); + } +} + +static FASTCALL void +fbStore_c8 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint8_t *pixel = ((uint8_t *) bits) + x; + for (i = 0; i < width; ++i) { + WRITE(image, pixel++, miIndexToEnt24(indexed,values[i])); + } +} + +static FASTCALL void +fbStore_x4a4 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + uint8_t *pixel = ((uint8_t *) bits) + x; + for (i = 0; i < width; ++i) { + WRITE(image, pixel++, values[i] >> 28); + } +} + +#define Store8(img,l,o,v) (WRITE(img, (uint8_t *)(l) + ((o) >> 3), (v))) +#if IMAGE_BYTE_ORDER == MSBFirst +#define Store4(img,l,o,v) Store8(img,l,o,((o) & 4 ? \ + (Fetch8(img,l,o) & 0xf0) | (v) : \ + (Fetch8(img,l,o) & 0x0f) | ((v) << 4))) +#else +#define Store4(img,l,o,v) Store8(img,l,o,((o) & 4 ? \ + (Fetch8(img,l,o) & 0x0f) | ((v) << 4) : \ + (Fetch8(img,l,o) & 0xf0) | (v))) +#endif + +static FASTCALL void +fbStore_a4 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + for (i = 0; i < width; ++i) { + Store4(image, bits, i + x, values[i]>>28); + } +} + +static FASTCALL void +fbStore_r1g2b1 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t pixel; + + Split(values[i]); + pixel = (((r >> 4) & 0x8) | + ((g >> 5) & 0x6) | + ((b >> 7) )); + Store4(image, bits, i + x, pixel); + } +} + +static FASTCALL void +fbStore_b1g2r1 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t pixel; + + Split(values[i]); + pixel = (((b >> 4) & 0x8) | + ((g >> 5) & 0x6) | + ((r >> 7) )); + Store4(image, bits, i + x, pixel); + } +} + +static FASTCALL void +fbStore_a1r1g1b1 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t pixel; + Splita(values[i]); + pixel = (((a >> 4) & 0x8) | + ((r >> 5) & 0x4) | + ((g >> 6) & 0x2) | + ((b >> 7) )); + Store4(image, bits, i + x, pixel); + } +} + +static FASTCALL void +fbStore_a1b1g1r1 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t pixel; + Splita(values[i]); + pixel = (((a >> 4) & 0x8) | + ((b >> 5) & 0x4) | + ((g >> 6) & 0x2) | + ((r >> 7) )); + Store4(image, bits, i + x, pixel); + } +} + +static FASTCALL void +fbStore_c4 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t pixel; + + pixel = miIndexToEnt24(indexed, values[i]); + Store4(image, bits, i + x, pixel); + } +} + +static FASTCALL void +fbStore_a1 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t *pixel = ((uint32_t *) bits) + ((i+x) >> 5); + uint32_t mask = FbStipMask((i+x) & 0x1f, 1); + + uint32_t v = values[i] & 0x80000000 ? mask : 0; + WRITE(image, pixel, (READ(image, pixel) & ~mask) | v); + } +} + +static FASTCALL void +fbStore_g1 (pixman_image_t *image, + uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t *pixel = ((uint32_t *) bits) + ((i+x) >> 5); + uint32_t mask = FbStipMask((i+x) & 0x1f, 1); + + uint32_t v = miIndexToEntY24(indexed,values[i]) ? mask : 0; + WRITE(image, pixel, (READ(image, pixel) & ~mask) | v); + } +} + + +storeProc STORE_PROC_FOR_PICTURE (bits_image_t * pict) +{ + switch(pict->format) { + case PIXMAN_a8r8g8b8: return fbStore_a8r8g8b8; + case PIXMAN_x8r8g8b8: return fbStore_x8r8g8b8; + case PIXMAN_a8b8g8r8: return fbStore_a8b8g8r8; + case PIXMAN_x8b8g8r8: return fbStore_x8b8g8r8; + + /* 24bpp formats */ + case PIXMAN_r8g8b8: return fbStore_r8g8b8; + case PIXMAN_b8g8r8: return fbStore_b8g8r8; + + /* 16bpp formats */ + case PIXMAN_r5g6b5: return fbStore_r5g6b5; + case PIXMAN_b5g6r5: return fbStore_b5g6r5; + + case PIXMAN_a1r5g5b5: return fbStore_a1r5g5b5; + case PIXMAN_x1r5g5b5: return fbStore_x1r5g5b5; + case PIXMAN_a1b5g5r5: return fbStore_a1b5g5r5; + case PIXMAN_x1b5g5r5: return fbStore_x1b5g5r5; + case PIXMAN_a4r4g4b4: return fbStore_a4r4g4b4; + case PIXMAN_x4r4g4b4: return fbStore_x4r4g4b4; + case PIXMAN_a4b4g4r4: return fbStore_a4b4g4r4; + case PIXMAN_x4b4g4r4: return fbStore_x4b4g4r4; + + /* 8bpp formats */ + case PIXMAN_a8: return fbStore_a8; + case PIXMAN_r3g3b2: return fbStore_r3g3b2; + case PIXMAN_b2g3r3: return fbStore_b2g3r3; + case PIXMAN_a2r2g2b2: return fbStore_a2r2g2b2; + case PIXMAN_c8: return fbStore_c8; + case PIXMAN_g8: return fbStore_c8; + case PIXMAN_x4a4: return fbStore_x4a4; + + /* 4bpp formats */ + case PIXMAN_a4: return fbStore_a4; + case PIXMAN_r1g2b1: return fbStore_r1g2b1; + case PIXMAN_b1g2r1: return fbStore_b1g2r1; + case PIXMAN_a1r1g1b1: return fbStore_a1r1g1b1; + case PIXMAN_a1b1g1r1: return fbStore_a1b1g1r1; + case PIXMAN_c4: return fbStore_c4; + case PIXMAN_g4: return fbStore_c4; + + /* 1bpp formats */ + case PIXMAN_a1: return fbStore_a1; + case PIXMAN_g1: return fbStore_g1; + default: + return NULL; + } +} diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-combine.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-combine.c --- pixman-0.9.6/pixman/pixman-combine.c 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-combine.c 2008-03-24 14:13:13.000000000 +0100 @@ -0,0 +1,1260 @@ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "pixman-private.h" +/* + * There are two ways of handling alpha -- either as a single unified value or + * a separate value for each component, hence each macro must have two + * versions. The unified alpha version has a 'U' at the end of the name, + * the component version has a 'C'. Similarly, functions which deal with + * this difference will have two versions using the same convention. + */ + + +/* + * Combine src and mask + */ +FASTCALL void +pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t a = *(mask + i) >> 24; + uint32_t s = *(src + i); + FbByteMul(s, a); + *(src + i) = s; + } +} + +/* + * All of the composing functions + */ + +FASTCALL static void +fbCombineClear (uint32_t *dest, const uint32_t *src, int width) +{ + memset(dest, 0, width*sizeof(uint32_t)); +} + +FASTCALL static void +fbCombineSrcU (uint32_t *dest, const uint32_t *src, int width) +{ + memcpy(dest, src, width*sizeof(uint32_t)); +} + +/* if the Src is opaque, call fbCombineSrcU */ +FASTCALL static void +fbCombineOverU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t d = *(dest + i); + uint32_t ia = Alpha(~s); + + FbByteMulAdd(d, ia, s); + *(dest + i) = d; + } +} + +/* if the Dst is opaque, this is a noop */ +FASTCALL static void +fbCombineOverReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t d = *(dest + i); + uint32_t ia = Alpha(~*(dest + i)); + FbByteMulAdd(s, ia, d); + *(dest + i) = s; + } +} + +/* if the Dst is opaque, call fbCombineSrcU */ +FASTCALL static void +fbCombineInU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t a = Alpha(*(dest + i)); + FbByteMul(s, a); + *(dest + i) = s; + } +} + +/* if the Src is opaque, this is a noop */ +FASTCALL static void +fbCombineInReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t d = *(dest + i); + uint32_t a = Alpha(*(src + i)); + FbByteMul(d, a); + *(dest + i) = d; + } +} + +/* if the Dst is opaque, call fbCombineClear */ +FASTCALL static void +fbCombineOutU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t a = Alpha(~*(dest + i)); + FbByteMul(s, a); + *(dest + i) = s; + } +} + +/* if the Src is opaque, call fbCombineClear */ +FASTCALL static void +fbCombineOutReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t d = *(dest + i); + uint32_t a = Alpha(~*(src + i)); + FbByteMul(d, a); + *(dest + i) = d; + } +} + +/* if the Src is opaque, call fbCombineInU */ +/* if the Dst is opaque, call fbCombineOverU */ +/* if both the Src and Dst are opaque, call fbCombineSrcU */ +FASTCALL static void +fbCombineAtopU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t d = *(dest + i); + uint32_t dest_a = Alpha(d); + uint32_t src_ia = Alpha(~s); + + FbByteAddMul(s, dest_a, d, src_ia); + *(dest + i) = s; + } +} + +/* if the Src is opaque, call fbCombineOverReverseU */ +/* if the Dst is opaque, call fbCombineInReverseU */ +/* if both the Src and Dst are opaque, call fbCombineDstU */ +FASTCALL static void +fbCombineAtopReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t d = *(dest + i); + uint32_t src_a = Alpha(s); + uint32_t dest_ia = Alpha(~d); + + FbByteAddMul(s, dest_ia, d, src_a); + *(dest + i) = s; + } +} + +/* if the Src is opaque, call fbCombineOverU */ +/* if the Dst is opaque, call fbCombineOverReverseU */ +/* if both the Src and Dst are opaque, call fbCombineClear */ +FASTCALL static void +fbCombineXorU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t d = *(dest + i); + uint32_t src_ia = Alpha(~s); + uint32_t dest_ia = Alpha(~d); + + FbByteAddMul(s, dest_ia, d, src_ia); + *(dest + i) = s; + } +} + +FASTCALL static void +fbCombineAddU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t d = *(dest + i); + FbByteAdd(d, s); + *(dest + i) = d; + } +} + +/* if the Src is opaque, call fbCombineAddU */ +/* if the Dst is opaque, call fbCombineAddU */ +/* if both the Src and Dst are opaque, call fbCombineAddU */ +FASTCALL static void +fbCombineSaturateU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t d = *(dest + i); + uint16_t sa, da; + + sa = s >> 24; + da = ~d >> 24; + if (sa > da) + { + sa = FbIntDiv(da, sa); + FbByteMul(s, sa); + }; + FbByteAdd(d, s); + *(dest + i) = d; + } +} + + +/* + * All of the disjoint composing functions + + The four entries in the first column indicate what source contributions + come from each of the four areas of the picture -- areas covered by neither + A nor B, areas covered only by A, areas covered only by B and finally + areas covered by both A and B. + + Disjoint Conjoint + Fa Fb Fa Fb + (0,0,0,0) 0 0 0 0 + (0,A,0,A) 1 0 1 0 + (0,0,B,B) 0 1 0 1 + (0,A,B,A) 1 min((1-a)/b,1) 1 max(1-a/b,0) + (0,A,B,B) min((1-b)/a,1) 1 max(1-b/a,0) 1 + (0,0,0,A) max(1-(1-b)/a,0) 0 min(1,b/a) 0 + (0,0,0,B) 0 max(1-(1-a)/b,0) 0 min(a/b,1) + (0,A,0,0) min(1,(1-b)/a) 0 max(1-b/a,0) 0 + (0,0,B,0) 0 min(1,(1-a)/b) 0 max(1-a/b,0) + (0,0,B,A) max(1-(1-b)/a,0) min(1,(1-a)/b) min(1,b/a) max(1-a/b,0) + (0,A,0,B) min(1,(1-b)/a) max(1-(1-a)/b,0) max(1-b/a,0) min(1,a/b) + (0,A,B,0) min(1,(1-b)/a) min(1,(1-a)/b) max(1-b/a,0) max(1-a/b,0) + +*/ + +#define CombineAOut 1 +#define CombineAIn 2 +#define CombineBOut 4 +#define CombineBIn 8 + +#define CombineClear 0 +#define CombineA (CombineAOut|CombineAIn) +#define CombineB (CombineBOut|CombineBIn) +#define CombineAOver (CombineAOut|CombineBOut|CombineAIn) +#define CombineBOver (CombineAOut|CombineBOut|CombineBIn) +#define CombineAAtop (CombineBOut|CombineAIn) +#define CombineBAtop (CombineAOut|CombineBIn) +#define CombineXor (CombineAOut|CombineBOut) + +/* portion covered by a but not b */ +FASTCALL static uint8_t +fbCombineDisjointOutPart (uint8_t a, uint8_t b) +{ + /* min (1, (1-b) / a) */ + + b = ~b; /* 1 - b */ + if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */ + return 0xff; /* 1 */ + return FbIntDiv(b,a); /* (1-b) / a */ +} + +/* portion covered by both a and b */ +FASTCALL static uint8_t +fbCombineDisjointInPart (uint8_t a, uint8_t b) +{ + /* max (1-(1-b)/a,0) */ + /* = - min ((1-b)/a - 1, 0) */ + /* = 1 - min (1, (1-b)/a) */ + + b = ~b; /* 1 - b */ + if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */ + return 0; /* 1 - 1 */ + return ~FbIntDiv(b,a); /* 1 - (1-b) / a */ +} + +/* portion covered by a but not b */ +FASTCALL static uint8_t +fbCombineConjointOutPart (uint8_t a, uint8_t b) +{ + /* max (1-b/a,0) */ + /* = 1-min(b/a,1) */ + + /* min (1, (1-b) / a) */ + + if (b >= a) /* b >= a -> b/a >= 1 */ + return 0x00; /* 0 */ + return ~FbIntDiv(b,a); /* 1 - b/a */ +} + +/* portion covered by both a and b */ +FASTCALL static uint8_t +fbCombineConjointInPart (uint8_t a, uint8_t b) +{ + /* min (1,b/a) */ + + if (b >= a) /* b >= a -> b/a >= 1 */ + return 0xff; /* 1 */ + return FbIntDiv(b,a); /* b/a */ +} + +FASTCALL static void +fbCombineDisjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8_t combine) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t d = *(dest + i); + uint32_t m,n,o,p; + uint16_t Fa, Fb, t, u, v; + uint8_t sa = s >> 24; + uint8_t da = d >> 24; + + switch (combine & CombineA) { + default: + Fa = 0; + break; + case CombineAOut: + Fa = fbCombineDisjointOutPart (sa, da); + break; + case CombineAIn: + Fa = fbCombineDisjointInPart (sa, da); + break; + case CombineA: + Fa = 0xff; + break; + } + + switch (combine & CombineB) { + default: + Fb = 0; + break; + case CombineBOut: + Fb = fbCombineDisjointOutPart (da, sa); + break; + case CombineBIn: + Fb = fbCombineDisjointInPart (da, sa); + break; + case CombineB: + Fb = 0xff; + break; + } + m = FbGen (s,d,0,Fa,Fb,t, u, v); + n = FbGen (s,d,8,Fa,Fb,t, u, v); + o = FbGen (s,d,16,Fa,Fb,t, u, v); + p = FbGen (s,d,24,Fa,Fb,t, u, v); + s = m|n|o|p; + *(dest + i) = s; + } +} + +FASTCALL static void +fbCombineDisjointOverU (uint32_t *dest, const uint32_t *src, int width) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint16_t a = s >> 24; + + if (a != 0x00) + { + if (a != 0xff) + { + uint32_t d = *(dest + i); + a = fbCombineDisjointOutPart (d >> 24, a); + FbByteMulAdd(d, a, s); + s = d; + } + *(dest + i) = s; + } + } +} + +FASTCALL static void +fbCombineDisjointInU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineDisjointGeneralU (dest, src, width, CombineAIn); +} + +FASTCALL static void +fbCombineDisjointInReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineDisjointGeneralU (dest, src, width, CombineBIn); +} + +FASTCALL static void +fbCombineDisjointOutU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineDisjointGeneralU (dest, src, width, CombineAOut); +} + +FASTCALL static void +fbCombineDisjointOutReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineDisjointGeneralU (dest, src, width, CombineBOut); +} + +FASTCALL static void +fbCombineDisjointAtopU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineDisjointGeneralU (dest, src, width, CombineAAtop); +} + +FASTCALL static void +fbCombineDisjointAtopReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineDisjointGeneralU (dest, src, width, CombineBAtop); +} + +FASTCALL static void +fbCombineDisjointXorU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineDisjointGeneralU (dest, src, width, CombineXor); +} + +FASTCALL static void +fbCombineConjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8_t combine) +{ + int i; + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t d = *(dest + i); + uint32_t m,n,o,p; + uint16_t Fa, Fb, t, u, v; + uint8_t sa = s >> 24; + uint8_t da = d >> 24; + + switch (combine & CombineA) { + default: + Fa = 0; + break; + case CombineAOut: + Fa = fbCombineConjointOutPart (sa, da); + break; + case CombineAIn: + Fa = fbCombineConjointInPart (sa, da); + break; + case CombineA: + Fa = 0xff; + break; + } + + switch (combine & CombineB) { + default: + Fb = 0; + break; + case CombineBOut: + Fb = fbCombineConjointOutPart (da, sa); + break; + case CombineBIn: + Fb = fbCombineConjointInPart (da, sa); + break; + case CombineB: + Fb = 0xff; + break; + } + m = FbGen (s,d,0,Fa,Fb,t, u, v); + n = FbGen (s,d,8,Fa,Fb,t, u, v); + o = FbGen (s,d,16,Fa,Fb,t, u, v); + p = FbGen (s,d,24,Fa,Fb,t, u, v); + s = m|n|o|p; + *(dest + i) = s; + } +} + +FASTCALL static void +fbCombineConjointOverU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineConjointGeneralU (dest, src, width, CombineAOver); +} + + +FASTCALL static void +fbCombineConjointOverReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineConjointGeneralU (dest, src, width, CombineBOver); +} + + +FASTCALL static void +fbCombineConjointInU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineConjointGeneralU (dest, src, width, CombineAIn); +} + + +FASTCALL static void +fbCombineConjointInReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineConjointGeneralU (dest, src, width, CombineBIn); +} + +FASTCALL static void +fbCombineConjointOutU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineConjointGeneralU (dest, src, width, CombineAOut); +} + +FASTCALL static void +fbCombineConjointOutReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineConjointGeneralU (dest, src, width, CombineBOut); +} + +FASTCALL static void +fbCombineConjointAtopU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineConjointGeneralU (dest, src, width, CombineAAtop); +} + +FASTCALL static void +fbCombineConjointAtopReverseU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineConjointGeneralU (dest, src, width, CombineBAtop); +} + +FASTCALL static void +fbCombineConjointXorU (uint32_t *dest, const uint32_t *src, int width) +{ + fbCombineConjointGeneralU (dest, src, width, CombineXor); +} + +/********************************************************************************/ +/*************************** Per Channel functions ******************************/ +/********************************************************************************/ + +FASTCALL static void +fbCombineMaskC (uint32_t *src, uint32_t *mask) +{ + uint32_t a = *mask; + + uint32_t x; + uint16_t xa; + + if (!a) + { + *(src) = 0; + return; + } + + x = *(src); + if (a == 0xffffffff) + { + x = x >> 24; + x |= x << 8; + x |= x << 16; + *(mask) = x; + return; + } + + xa = x >> 24; + FbByteMulC(x, a); + *(src) = x; + FbByteMul(a, xa); + *(mask) = a; +} + +FASTCALL static void +fbCombineMaskValueC (uint32_t *src, const uint32_t *mask) +{ + uint32_t a = *mask; + uint32_t x; + + if (!a) + { + *(src) = 0; + return; + } + + if (a == 0xffffffff) + return; + + x = *(src); + FbByteMulC(x, a); + *(src) =x; +} + +FASTCALL static void +fbCombineMaskAlphaC (const uint32_t *src, uint32_t *mask) +{ + uint32_t a = *(mask); + uint32_t x; + + if (!a) + return; + + x = *(src) >> 24; + if (x == 0xff) + return; + if (a == 0xffffffff) + { + x = x >> 24; + x |= x << 8; + x |= x << 16; + *(mask) = x; + return; + } + + FbByteMul(a, x); + *(mask) = a; +} + + + +FASTCALL static void +fbCombineClearC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + memset(dest, 0, width*sizeof(uint32_t)); +} + +FASTCALL static void +fbCombineSrcC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t m = *(mask + i); + + fbCombineMaskValueC (&s, &m); + + *(dest) = s; + } +} + +FASTCALL static void +fbCombineOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t m = *(mask + i); + uint32_t a; + + fbCombineMaskC (&s, &m); + + a = ~m; + if (a != 0xffffffff) + { + if (a) + { + uint32_t d = *(dest + i); + FbByteMulAddC(d, a, s); + s = d; + } + *(dest + i) = s; + } + } +} + +FASTCALL static void +fbCombineOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t d = *(dest + i); + uint32_t a = ~d >> 24; + + if (a) + { + uint32_t s = *(src + i); + uint32_t m = *(mask + i); + + fbCombineMaskValueC (&s, &m); + + if (a != 0xff) + { + FbByteMulAdd(s, a, d); + } + *(dest + i) = s; + } + } +} + +FASTCALL static void +fbCombineInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t d = *(dest + i); + uint16_t a = d >> 24; + uint32_t s = 0; + if (a) + { + uint32_t m = *(mask + i); + + s = *(src + i); + fbCombineMaskValueC (&s, &m); + if (a != 0xff) + { + FbByteMul(s, a); + } + } + *(dest + i) = s; + } +} + +FASTCALL static void +fbCombineInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t m = *(mask + i); + uint32_t a; + + fbCombineMaskAlphaC (&s, &m); + + a = m; + if (a != 0xffffffff) + { + uint32_t d = 0; + if (a) + { + d = *(dest + i); + FbByteMulC(d, a); + } + *(dest + i) = d; + } + } +} + +FASTCALL static void +fbCombineOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t d = *(dest + i); + uint16_t a = ~d >> 24; + uint32_t s = 0; + if (a) + { + uint32_t m = *(mask + i); + + s = *(src + i); + fbCombineMaskValueC (&s, &m); + + if (a != 0xff) + { + FbByteMul(s, a); + } + } + *(dest + i) = s; + } +} + +FASTCALL static void +fbCombineOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t m = *(mask + i); + uint32_t a; + + fbCombineMaskAlphaC (&s, &m); + + a = ~m; + if (a != 0xffffffff) + { + uint32_t d = 0; + if (a) + { + d = *(dest + i); + FbByteMulC(d, a); + } + *(dest + i) = d; + } + } +} + +FASTCALL static void +fbCombineAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t d = *(dest + i); + uint32_t s = *(src + i); + uint32_t m = *(mask + i); + uint32_t ad; + uint16_t as = d >> 24; + + fbCombineMaskC (&s, &m); + + ad = ~m; + + FbByteAddMulC(d, ad, s, as); + *(dest + i) = d; + } +} + +FASTCALL static void +fbCombineAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + + uint32_t d = *(dest + i); + uint32_t s = *(src + i); + uint32_t m = *(mask + i); + uint32_t ad; + uint16_t as = ~d >> 24; + + fbCombineMaskC (&s, &m); + + ad = m; + + FbByteAddMulC(d, ad, s, as); + *(dest + i) = d; + } +} + +FASTCALL static void +fbCombineXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t d = *(dest + i); + uint32_t s = *(src + i); + uint32_t m = *(mask + i); + uint32_t ad; + uint16_t as = ~d >> 24; + + fbCombineMaskC (&s, &m); + + ad = ~m; + + FbByteAddMulC(d, ad, s, as); + *(dest + i) = d; + } +} + +FASTCALL static void +fbCombineAddC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t s = *(src + i); + uint32_t m = *(mask + i); + uint32_t d = *(dest + i); + + fbCombineMaskValueC (&s, &m); + + FbByteAdd(d, s); + *(dest + i) = d; + } +} + +FASTCALL static void +fbCombineSaturateC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t s, d; + uint16_t sa, sr, sg, sb, da; + uint16_t t, u, v; + uint32_t m,n,o,p; + + d = *(dest + i); + s = *(src + i); + m = *(mask + i); + + fbCombineMaskC (&s, &m); + + sa = (m >> 24); + sr = (m >> 16) & 0xff; + sg = (m >> 8) & 0xff; + sb = (m ) & 0xff; + da = ~d >> 24; + + if (sb <= da) + m = FbAdd(s,d,0,t); + else + m = FbGen (s, d, 0, (da << 8) / sb, 0xff, t, u, v); + + if (sg <= da) + n = FbAdd(s,d,8,t); + else + n = FbGen (s, d, 8, (da << 8) / sg, 0xff, t, u, v); + + if (sr <= da) + o = FbAdd(s,d,16,t); + else + o = FbGen (s, d, 16, (da << 8) / sr, 0xff, t, u, v); + + if (sa <= da) + p = FbAdd(s,d,24,t); + else + p = FbGen (s, d, 24, (da << 8) / sa, 0xff, t, u, v); + + *(dest + i) = m|n|o|p; + } +} + +FASTCALL static void +fbCombineDisjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width, uint8_t combine) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t s, d; + uint32_t m,n,o,p; + uint32_t Fa, Fb; + uint16_t t, u, v; + uint32_t sa; + uint8_t da; + + s = *(src + i); + m = *(mask + i); + d = *(dest + i); + da = d >> 24; + + fbCombineMaskC (&s, &m); + + sa = m; + + switch (combine & CombineA) { + default: + Fa = 0; + break; + case CombineAOut: + m = fbCombineDisjointOutPart ((uint8_t) (sa >> 0), da); + n = fbCombineDisjointOutPart ((uint8_t) (sa >> 8), da) << 8; + o = fbCombineDisjointOutPart ((uint8_t) (sa >> 16), da) << 16; + p = fbCombineDisjointOutPart ((uint8_t) (sa >> 24), da) << 24; + Fa = m|n|o|p; + break; + case CombineAIn: + m = fbCombineDisjointInPart ((uint8_t) (sa >> 0), da); + n = fbCombineDisjointInPart ((uint8_t) (sa >> 8), da) << 8; + o = fbCombineDisjointInPart ((uint8_t) (sa >> 16), da) << 16; + p = fbCombineDisjointInPart ((uint8_t) (sa >> 24), da) << 24; + Fa = m|n|o|p; + break; + case CombineA: + Fa = 0xffffffff; + break; + } + + switch (combine & CombineB) { + default: + Fb = 0; + break; + case CombineBOut: + m = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 0)); + n = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 8)) << 8; + o = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 16)) << 16; + p = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 24)) << 24; + Fb = m|n|o|p; + break; + case CombineBIn: + m = fbCombineDisjointInPart (da, (uint8_t) (sa >> 0)); + n = fbCombineDisjointInPart (da, (uint8_t) (sa >> 8)) << 8; + o = fbCombineDisjointInPart (da, (uint8_t) (sa >> 16)) << 16; + p = fbCombineDisjointInPart (da, (uint8_t) (sa >> 24)) << 24; + Fb = m|n|o|p; + break; + case CombineB: + Fb = 0xffffffff; + break; + } + m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v); + n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v); + o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v); + p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v); + s = m|n|o|p; + *(dest + i) = s; + } +} + +FASTCALL static void +fbCombineDisjointOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOver); +} + +FASTCALL static void +fbCombineDisjointInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineDisjointGeneralC (dest, src, mask, width, CombineAIn); +} + +FASTCALL static void +fbCombineDisjointInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineDisjointGeneralC (dest, src, mask, width, CombineBIn); +} + +FASTCALL static void +fbCombineDisjointOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOut); +} + +FASTCALL static void +fbCombineDisjointOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineDisjointGeneralC (dest, src, mask, width, CombineBOut); +} + +FASTCALL static void +fbCombineDisjointAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineDisjointGeneralC (dest, src, mask, width, CombineAAtop); +} + +FASTCALL static void +fbCombineDisjointAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineDisjointGeneralC (dest, src, mask, width, CombineBAtop); +} + +FASTCALL static void +fbCombineDisjointXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineDisjointGeneralC (dest, src, mask, width, CombineXor); +} + +FASTCALL static void +fbCombineConjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width, uint8_t combine) +{ + int i; + + for (i = 0; i < width; ++i) { + uint32_t s, d; + uint32_t m,n,o,p; + uint32_t Fa, Fb; + uint16_t t, u, v; + uint32_t sa; + uint8_t da; + + s = *(src + i); + m = *(mask + i); + d = *(dest + i); + da = d >> 24; + + fbCombineMaskC (&s, &m); + + sa = m; + + switch (combine & CombineA) { + default: + Fa = 0; + break; + case CombineAOut: + m = fbCombineConjointOutPart ((uint8_t) (sa >> 0), da); + n = fbCombineConjointOutPart ((uint8_t) (sa >> 8), da) << 8; + o = fbCombineConjointOutPart ((uint8_t) (sa >> 16), da) << 16; + p = fbCombineConjointOutPart ((uint8_t) (sa >> 24), da) << 24; + Fa = m|n|o|p; + break; + case CombineAIn: + m = fbCombineConjointInPart ((uint8_t) (sa >> 0), da); + n = fbCombineConjointInPart ((uint8_t) (sa >> 8), da) << 8; + o = fbCombineConjointInPart ((uint8_t) (sa >> 16), da) << 16; + p = fbCombineConjointInPart ((uint8_t) (sa >> 24), da) << 24; + Fa = m|n|o|p; + break; + case CombineA: + Fa = 0xffffffff; + break; + } + + switch (combine & CombineB) { + default: + Fb = 0; + break; + case CombineBOut: + m = fbCombineConjointOutPart (da, (uint8_t) (sa >> 0)); + n = fbCombineConjointOutPart (da, (uint8_t) (sa >> 8)) << 8; + o = fbCombineConjointOutPart (da, (uint8_t) (sa >> 16)) << 16; + p = fbCombineConjointOutPart (da, (uint8_t) (sa >> 24)) << 24; + Fb = m|n|o|p; + break; + case CombineBIn: + m = fbCombineConjointInPart (da, (uint8_t) (sa >> 0)); + n = fbCombineConjointInPart (da, (uint8_t) (sa >> 8)) << 8; + o = fbCombineConjointInPart (da, (uint8_t) (sa >> 16)) << 16; + p = fbCombineConjointInPart (da, (uint8_t) (sa >> 24)) << 24; + Fb = m|n|o|p; + break; + case CombineB: + Fb = 0xffffffff; + break; + } + m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v); + n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v); + o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v); + p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v); + s = m|n|o|p; + *(dest + i) = s; + } +} + +FASTCALL static void +fbCombineConjointOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineConjointGeneralC (dest, src, mask, width, CombineAOver); +} + +FASTCALL static void +fbCombineConjointOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineConjointGeneralC (dest, src, mask, width, CombineBOver); +} + +FASTCALL static void +fbCombineConjointInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineConjointGeneralC (dest, src, mask, width, CombineAIn); +} + +FASTCALL static void +fbCombineConjointInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineConjointGeneralC (dest, src, mask, width, CombineBIn); +} + +FASTCALL static void +fbCombineConjointOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineConjointGeneralC (dest, src, mask, width, CombineAOut); +} + +FASTCALL static void +fbCombineConjointOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineConjointGeneralC (dest, src, mask, width, CombineBOut); +} + +FASTCALL static void +fbCombineConjointAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineConjointGeneralC (dest, src, mask, width, CombineAAtop); +} + +FASTCALL static void +fbCombineConjointAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineConjointGeneralC (dest, src, mask, width, CombineBAtop); +} + +FASTCALL static void +fbCombineConjointXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +{ + fbCombineConjointGeneralC (dest, src, mask, width, CombineXor); +} + +CombineFuncU pixman_fbCombineFuncU[] = { + fbCombineClear, + fbCombineSrcU, + NULL, /* CombineDst */ + fbCombineOverU, + fbCombineOverReverseU, + fbCombineInU, + fbCombineInReverseU, + fbCombineOutU, + fbCombineOutReverseU, + fbCombineAtopU, + fbCombineAtopReverseU, + fbCombineXorU, + fbCombineAddU, + fbCombineSaturateU, + NULL, + NULL, + fbCombineClear, + fbCombineSrcU, + NULL, /* CombineDst */ + fbCombineDisjointOverU, + fbCombineSaturateU, /* DisjointOverReverse */ + fbCombineDisjointInU, + fbCombineDisjointInReverseU, + fbCombineDisjointOutU, + fbCombineDisjointOutReverseU, + fbCombineDisjointAtopU, + fbCombineDisjointAtopReverseU, + fbCombineDisjointXorU, + NULL, + NULL, + NULL, + NULL, + fbCombineClear, + fbCombineSrcU, + NULL, /* CombineDst */ + fbCombineConjointOverU, + fbCombineConjointOverReverseU, + fbCombineConjointInU, + fbCombineConjointInReverseU, + fbCombineConjointOutU, + fbCombineConjointOutReverseU, + fbCombineConjointAtopU, + fbCombineConjointAtopReverseU, + fbCombineConjointXorU, +}; + +CombineFuncC pixman_fbCombineFuncC[] = { + fbCombineClearC, + fbCombineSrcC, + NULL, /* Dest */ + fbCombineOverC, + fbCombineOverReverseC, + fbCombineInC, + fbCombineInReverseC, + fbCombineOutC, + fbCombineOutReverseC, + fbCombineAtopC, + fbCombineAtopReverseC, + fbCombineXorC, + fbCombineAddC, + fbCombineSaturateC, + NULL, + NULL, + fbCombineClearC, /* 0x10 */ + fbCombineSrcC, + NULL, /* Dest */ + fbCombineDisjointOverC, + fbCombineSaturateC, /* DisjointOverReverse */ + fbCombineDisjointInC, + fbCombineDisjointInReverseC, + fbCombineDisjointOutC, + fbCombineDisjointOutReverseC, + fbCombineDisjointAtopC, + fbCombineDisjointAtopReverseC, + fbCombineDisjointXorC, /* 0x1b */ + NULL, + NULL, + NULL, + NULL, + fbCombineClearC, + fbCombineSrcC, + NULL, /* Dest */ + fbCombineConjointOverC, + fbCombineConjointOverReverseC, + fbCombineConjointInC, + fbCombineConjointInReverseC, + fbCombineConjointOutC, + fbCombineConjointOutReverseC, + fbCombineConjointAtopC, + fbCombineConjointAtopReverseC, + fbCombineConjointXorC, +}; diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-compose.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-compose.c --- pixman-0.9.6/pixman/pixman-compose.c 2007-10-24 18:30:17.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-compose.c 2008-03-24 14:13:13.000000000 +0100 @@ -35,2870 +35,112 @@ #include "pixman-private.h" -/* - * FIXME: - * The stuff here is added just to get it to compile. Something sensible needs to - * be done before this can be used. - * - * we should go through this code and clean up some of the weird stuff that have - * resulted from unmacro-ifying it. - * - */ -#define INLINE inline - -/* End of stuff added to get it to compile - */ - -static unsigned int -SourcePictureClassify (source_image_t *pict, - int x, - int y, - int width, - int height) -{ - if (pict->common.type == SOLID) - { - pict->class = SOURCE_IMAGE_CLASS_HORIZONTAL; - } - else if (pict->common.type == LINEAR) - { - linear_gradient_t *linear = (linear_gradient_t *)pict; - pixman_vector_t v; - pixman_fixed_32_32_t l; - pixman_fixed_48_16_t dx, dy, a, b, off; - pixman_fixed_48_16_t factors[4]; - int i; - - dx = linear->p2.x - linear->p1.x; - dy = linear->p2.y - linear->p1.y; - l = dx * dx + dy * dy; - if (l) - { - a = (dx << 32) / l; - b = (dy << 32) / l; - } - else - { - a = b = 0; - } - - off = (-a * linear->p1.x - -b * linear->p1.y) >> 16; - - for (i = 0; i < 3; i++) - { - v.vector[0] = pixman_int_to_fixed ((i % 2) * (width - 1) + x); - v.vector[1] = pixman_int_to_fixed ((i / 2) * (height - 1) + y); - v.vector[2] = pixman_fixed_1; - - if (pict->common.transform) - { - if (!pixman_transform_point_3d (pict->common.transform, &v)) - return SOURCE_IMAGE_CLASS_UNKNOWN; - } - - factors[i] = ((a * v.vector[0] + b * v.vector[1]) >> 16) + off; - } - - if (factors[2] == factors[0]) - pict->class = SOURCE_IMAGE_CLASS_HORIZONTAL; - else if (factors[1] == factors[0]) - pict->class = SOURCE_IMAGE_CLASS_VERTICAL; - } - - return pict->class; -} - -#define SCANLINE_BUFFER_LENGTH 2048 - -typedef FASTCALL void (*fetchProc)(pixman_image_t *image, - const uint32_t *bits, - int x, int width, - uint32_t *buffer, - const pixman_indexed_t * indexed); - -/* - * All of the fetch functions - */ - -static FASTCALL void -fbFetch_a8r8g8b8 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - MEMCPY_WRAPPED(buffer, (const uint32_t *)bits + x, - width*sizeof(uint32_t)); -} - -static FASTCALL void -fbFetch_x8r8g8b8 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - const uint32_t *pixel = (const uint32_t *)bits + x; - const uint32_t *end = pixel + width; - while (pixel < end) { - *buffer++ = READ(pixel++) | 0xff000000; - } -} - -static FASTCALL void -fbFetch_a8b8g8r8 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - const uint32_t *pixel = (uint32_t *)bits + x; - const uint32_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - *buffer++ = (p & 0xff00ff00) | - ((p >> 16) & 0xff) | - ((p & 0xff) << 16); - } -} - -static FASTCALL void -fbFetch_x8b8g8r8 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - const uint32_t *pixel = (uint32_t *)bits + x; - const uint32_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - *buffer++ = 0xff000000 | - (p & 0x0000ff00) | - ((p >> 16) & 0xff) | - ((p & 0xff) << 16); - } -} - -static FASTCALL void -fbFetch_r8g8b8 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - const uint8_t *pixel = (const uint8_t *)bits + 3*x; - const uint8_t *end = pixel + 3*width; - while (pixel < end) { - uint32_t b = Fetch24(pixel) | 0xff000000; - pixel += 3; - *buffer++ = b; - } -} - -static FASTCALL void -fbFetch_b8g8r8 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - const uint8_t *pixel = (const uint8_t *)bits + 3*x; - const uint8_t *end = pixel + 3*width; - while (pixel < end) { - uint32_t b = 0xff000000; -#if IMAGE_BYTE_ORDER == MSBFirst - b |= (READ(pixel++)); - b |= (READ(pixel++) << 8); - b |= (READ(pixel++) << 16); -#else - b |= (READ(pixel++) << 16); - b |= (READ(pixel++) << 8); - b |= (READ(pixel++)); -#endif - *buffer++ = b; - } -} - -static FASTCALL void -fbFetch_r5g6b5 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, - const pixman_indexed_t * indexed) -{ - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - uint32_t r = (((p) << 3) & 0xf8) | - (((p) << 5) & 0xfc00) | - (((p) << 8) & 0xf80000); - r |= (r >> 5) & 0x70007; - r |= (r >> 6) & 0x300; - *buffer++ = 0xff000000 | r; - } -} - -static FASTCALL void -fbFetch_b5g6r5 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, - const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - b = ((p & 0xf800) | ((p & 0xe000) >> 5)) >> 8; - g = ((p & 0x07e0) | ((p & 0x0600) >> 6)) << 5; - r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14; - *buffer++ = 0xff000000 | r | g | b; - } -} - -static FASTCALL void -fbFetch_a1r5g5b5 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b, a; - - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - a = (uint32_t) ((uint8_t) (0 - ((p & 0x8000) >> 15))) << 24; - r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9; - g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; - b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2; - *buffer++ = a | r | g | b; - } -} - -static FASTCALL void -fbFetch_x1r5g5b5 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9; - g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; - b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2; - *buffer++ = 0xff000000 | r | g | b; - } -} - -static FASTCALL void -fbFetch_a1b5g5r5 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b, a; - - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - a = (uint32_t) ((uint8_t) (0 - ((p & 0x8000) >> 15))) << 24; - b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7; - g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; - r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14; - *buffer++ = a | r | g | b; - } -} - -static FASTCALL void -fbFetch_x1b5g5r5 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7; - g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; - r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14; - *buffer++ = 0xff000000 | r | g | b; - } -} - -static FASTCALL void -fbFetch_a4r4g4b4 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b, a; - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - a = ((p & 0xf000) | ((p & 0xf000) >> 4)) << 16; - r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12; - g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; - b = ((p & 0x000f) | ((p & 0x000f) << 4)); - *buffer++ = a | r | g | b; - } -} - -static FASTCALL void -fbFetch_x4r4g4b4 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12; - g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; - b = ((p & 0x000f) | ((p & 0x000f) << 4)); - *buffer++ = 0xff000000 | r | g | b; - } -} - -static FASTCALL void -fbFetch_a4b4g4r4 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b, a; - - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - a = ((p & 0xf000) | ((p & 0xf000) >> 4)) << 16; - b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4; - g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; - r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16; - *buffer++ = a | r | g | b; - } -} - -static FASTCALL void -fbFetch_x4b4g4r4 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - - const uint16_t *pixel = (const uint16_t *)bits + x; - const uint16_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4; - g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; - r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16; - *buffer++ = 0xff000000 | r | g | b; - } -} - -static FASTCALL void -fbFetch_a8 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - const uint8_t *pixel = (const uint8_t *)bits + x; - const uint8_t *end = pixel + width; - while (pixel < end) { - *buffer++ = READ(pixel++) << 24; - } -} - -static FASTCALL void -fbFetch_r3g3b2 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - - const uint8_t *pixel = (const uint8_t *)bits + x; - const uint8_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - r = ((p & 0xe0) | ((p & 0xe0) >> 3) | ((p & 0xc0) >> 6)) << 16; - g = ((p & 0x1c) | ((p & 0x18) >> 3) | ((p & 0x1c) << 3)) << 8; - b = (((p & 0x03) ) | - ((p & 0x03) << 2) | - ((p & 0x03) << 4) | - ((p & 0x03) << 6)); - *buffer++ = 0xff000000 | r | g | b; - } -} - -static FASTCALL void -fbFetch_b2g3r3 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - - const uint8_t *pixel = (const uint8_t *)bits + x; - const uint8_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - b = (((p & 0xc0) ) | - ((p & 0xc0) >> 2) | - ((p & 0xc0) >> 4) | - ((p & 0xc0) >> 6)); - g = ((p & 0x38) | ((p & 0x38) >> 3) | ((p & 0x30) << 2)) << 8; - r = (((p & 0x07) ) | - ((p & 0x07) << 3) | - ((p & 0x06) << 6)) << 16; - *buffer++ = 0xff000000 | r | g | b; - } -} - -static FASTCALL void -fbFetch_a2r2g2b2 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - const uint8_t *pixel = (const uint8_t *)bits + x; - const uint8_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - a = ((p & 0xc0) * 0x55) << 18; - r = ((p & 0x30) * 0x55) << 12; - g = ((p & 0x0c) * 0x55) << 6; - b = ((p & 0x03) * 0x55); - *buffer++ = a|r|g|b; - } -} - -static FASTCALL void -fbFetch_a2b2g2r2 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - const uint8_t *pixel = (const uint8_t *)bits + x; - const uint8_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - - a = ((p & 0xc0) * 0x55) << 18; - b = ((p & 0x30) * 0x55) >> 6; - g = ((p & 0x0c) * 0x55) << 6; - r = ((p & 0x03) * 0x55) << 16; - *buffer++ = a|r|g|b; - } -} - -static FASTCALL void -fbFetch_c8 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - const uint8_t *pixel = (const uint8_t *)bits + x; - const uint8_t *end = pixel + width; - while (pixel < end) { - uint32_t p = READ(pixel++); - *buffer++ = indexed->rgba[p]; - } -} - -static FASTCALL void -fbFetch_x4a4 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - const uint8_t *pixel = (const uint8_t *)bits + x; - const uint8_t *end = pixel + width; - while (pixel < end) { - uint8_t p = READ(pixel++) & 0xf; - *buffer++ = (p | (p << 4)) << 24; - } -} - -#define Fetch8(l,o) (READ((uint8_t *)(l) + ((o) >> 2))) -#if IMAGE_BYTE_ORDER == MSBFirst -#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4) -#else -#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) >> 4 : Fetch8(l,o) & 0xf) -#endif - -static FASTCALL void -fbFetch_a4 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(bits, i + x); - - p |= p << 4; - *buffer++ = p << 24; - } -} - -static FASTCALL void -fbFetch_r1g2b1 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - int i; - for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(bits, i + x); - - r = ((p & 0x8) * 0xff) << 13; - g = ((p & 0x6) * 0x55) << 7; - b = ((p & 0x1) * 0xff); - *buffer++ = 0xff000000|r|g|b; - } -} - -static FASTCALL void -fbFetch_b1g2r1 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - int i; - for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(bits, i + x); - - b = ((p & 0x8) * 0xff) >> 3; - g = ((p & 0x6) * 0x55) << 7; - r = ((p & 0x1) * 0xff) << 16; - *buffer++ = 0xff000000|r|g|b; - } -} - -static FASTCALL void -fbFetch_a1r1g1b1 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - int i; - for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(bits, i + x); - - a = ((p & 0x8) * 0xff) << 21; - r = ((p & 0x4) * 0xff) << 14; - g = ((p & 0x2) * 0xff) << 7; - b = ((p & 0x1) * 0xff); - *buffer++ = a|r|g|b; - } -} - -static FASTCALL void -fbFetch_a1b1g1r1 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - int i; - for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(bits, i + x); - - a = ((p & 0x8) * 0xff) << 21; - r = ((p & 0x4) * 0xff) >> 3; - g = ((p & 0x2) * 0xff) << 7; - b = ((p & 0x1) * 0xff) << 16; - *buffer++ = a|r|g|b; - } -} - -static FASTCALL void -fbFetch_c4 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(bits, i + x); - - *buffer++ = indexed->rgba[p]; - } -} - - -static FASTCALL void -fbFetch_a1 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t p = READ(bits + ((i + x) >> 5)); - uint32_t a; -#if BITMAP_BIT_ORDER == MSBFirst - a = p >> (0x1f - ((i+x) & 0x1f)); -#else - a = p >> ((i+x) & 0x1f); -#endif - a = a & 1; - a |= a << 1; - a |= a << 2; - a |= a << 4; - *buffer++ = a << 24; - } -} - -static FASTCALL void -fbFetch_g1 (pixman_image_t *image, - const uint32_t *bits, int x, int width, uint32_t *buffer, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t p = READ(bits + ((i+x) >> 5)); - uint32_t a; -#if BITMAP_BIT_ORDER == MSBFirst - a = p >> (0x1f - ((i+x) & 0x1f)); -#else - a = p >> ((i+x) & 0x1f); -#endif - a = a & 1; - *buffer++ = indexed->rgba[a]; - } -} - -static fetchProc fetchProcForPicture (bits_image_t * pict) -{ - switch(pict->format) { - case PIXMAN_a8r8g8b8: return fbFetch_a8r8g8b8; - case PIXMAN_x8r8g8b8: return fbFetch_x8r8g8b8; - case PIXMAN_a8b8g8r8: return fbFetch_a8b8g8r8; - case PIXMAN_x8b8g8r8: return fbFetch_x8b8g8r8; - - /* 24bpp formats */ - case PIXMAN_r8g8b8: return fbFetch_r8g8b8; - case PIXMAN_b8g8r8: return fbFetch_b8g8r8; - - /* 16bpp formats */ - case PIXMAN_r5g6b5: return fbFetch_r5g6b5; - case PIXMAN_b5g6r5: return fbFetch_b5g6r5; - - case PIXMAN_a1r5g5b5: return fbFetch_a1r5g5b5; - case PIXMAN_x1r5g5b5: return fbFetch_x1r5g5b5; - case PIXMAN_a1b5g5r5: return fbFetch_a1b5g5r5; - case PIXMAN_x1b5g5r5: return fbFetch_x1b5g5r5; - case PIXMAN_a4r4g4b4: return fbFetch_a4r4g4b4; - case PIXMAN_x4r4g4b4: return fbFetch_x4r4g4b4; - case PIXMAN_a4b4g4r4: return fbFetch_a4b4g4r4; - case PIXMAN_x4b4g4r4: return fbFetch_x4b4g4r4; - - /* 8bpp formats */ - case PIXMAN_a8: return fbFetch_a8; - case PIXMAN_r3g3b2: return fbFetch_r3g3b2; - case PIXMAN_b2g3r3: return fbFetch_b2g3r3; - case PIXMAN_a2r2g2b2: return fbFetch_a2r2g2b2; - case PIXMAN_a2b2g2r2: return fbFetch_a2b2g2r2; - case PIXMAN_c8: return fbFetch_c8; - case PIXMAN_g8: return fbFetch_c8; - case PIXMAN_x4a4: return fbFetch_x4a4; - - /* 4bpp formats */ - case PIXMAN_a4: return fbFetch_a4; - case PIXMAN_r1g2b1: return fbFetch_r1g2b1; - case PIXMAN_b1g2r1: return fbFetch_b1g2r1; - case PIXMAN_a1r1g1b1: return fbFetch_a1r1g1b1; - case PIXMAN_a1b1g1r1: return fbFetch_a1b1g1r1; - case PIXMAN_c4: return fbFetch_c4; - case PIXMAN_g4: return fbFetch_c4; - - /* 1bpp formats */ - case PIXMAN_a1: return fbFetch_a1; - case PIXMAN_g1: return fbFetch_g1; - } - - return NULL; -} - -/* - * Pixel wise fetching - */ - -typedef FASTCALL uint32_t (*fetchPixelProc)(pixman_image_t *image, - const uint32_t *bits, int offset, - const pixman_indexed_t * indexed); - -static FASTCALL uint32_t -fbFetchPixel_a8r8g8b8 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - return READ((uint32_t *)bits + offset); -} - -static FASTCALL uint32_t -fbFetchPixel_x8r8g8b8 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - return READ((uint32_t *)bits + offset) | 0xff000000; -} - -static FASTCALL uint32_t -fbFetchPixel_a8b8g8r8 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t pixel = READ((uint32_t *)bits + offset); - - return ((pixel & 0xff000000) | - ((pixel >> 16) & 0xff) | - (pixel & 0x0000ff00) | - ((pixel & 0xff) << 16)); -} - -static FASTCALL uint32_t -fbFetchPixel_x8b8g8r8 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t pixel = READ((uint32_t *)bits + offset); - - return ((0xff000000) | - ((pixel >> 16) & 0xff) | - (pixel & 0x0000ff00) | - ((pixel & 0xff) << 16)); -} - -static FASTCALL uint32_t -fbFetchPixel_r8g8b8 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint8_t *pixel = ((uint8_t *) bits) + (offset*3); -#if IMAGE_BYTE_ORDER == MSBFirst - return (0xff000000 | - (READ(pixel + 0) << 16) | - (READ(pixel + 1) << 8) | - (READ(pixel + 2))); -#else - return (0xff000000 | - (READ(pixel + 2) << 16) | - (READ(pixel + 1) << 8) | - (READ(pixel + 0))); -#endif -} - -static FASTCALL uint32_t -fbFetchPixel_b8g8r8 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint8_t *pixel = ((uint8_t *) bits) + (offset*3); -#if IMAGE_BYTE_ORDER == MSBFirst - return (0xff000000 | - (READ(pixel + 2) << 16) | - (READ(pixel + 1) << 8) | - (READ(pixel + 0))); -#else - return (0xff000000 | - (READ(pixel + 0) << 16) | - (READ(pixel + 1) << 8) | - (READ(pixel + 2))); -#endif -} - -static FASTCALL uint32_t -fbFetchPixel_r5g6b5 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - r = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) << 8; - g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5; - b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2; - return (0xff000000 | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_b5g6r5 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - b = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) >> 8; - g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5; - r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14; - return (0xff000000 | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_a1r5g5b5 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24; - r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9; - g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6; - b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2; - return (a | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_x1r5g5b5 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9; - g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6; - b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2; - return (0xff000000 | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_a1b5g5r5 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24; - b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7; - g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6; - r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14; - return (a | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_x1b5g5r5 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7; - g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6; - r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14; - return (0xff000000 | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_a4r4g4b4 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16; - r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12; - g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; - b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)); - return (a | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_x4r4g4b4 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12; - g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; - b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)); - return (0xff000000 | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_a4b4g4r4 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16; - b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4; - g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; - r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16; - return (a | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_x4b4g4r4 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = READ((uint16_t *) bits + offset); - - b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4; - g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; - r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16; - return (0xff000000 | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_a8 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t pixel = READ((uint8_t *) bits + offset); - - return pixel << 24; -} - -static FASTCALL uint32_t -fbFetchPixel_r3g3b2 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = READ((uint8_t *) bits + offset); - - r = ((pixel & 0xe0) | ((pixel & 0xe0) >> 3) | ((pixel & 0xc0) >> 6)) << 16; - g = ((pixel & 0x1c) | ((pixel & 0x18) >> 3) | ((pixel & 0x1c) << 3)) << 8; - b = (((pixel & 0x03) ) | - ((pixel & 0x03) << 2) | - ((pixel & 0x03) << 4) | - ((pixel & 0x03) << 6)); - return (0xff000000 | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_b2g3r3 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = READ((uint8_t *) bits + offset); - - b = (((pixel & 0xc0) ) | - ((pixel & 0xc0) >> 2) | - ((pixel & 0xc0) >> 4) | - ((pixel & 0xc0) >> 6)); - g = ((pixel & 0x38) | ((pixel & 0x38) >> 3) | ((pixel & 0x30) << 2)) << 8; - r = (((pixel & 0x07) ) | - ((pixel & 0x07) << 3) | - ((pixel & 0x06) << 6)) << 16; - return (0xff000000 | r | g | b); -} - -static FASTCALL uint32_t -fbFetchPixel_a2r2g2b2 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - uint32_t pixel = READ((uint8_t *) bits + offset); - - a = ((pixel & 0xc0) * 0x55) << 18; - r = ((pixel & 0x30) * 0x55) << 12; - g = ((pixel & 0x0c) * 0x55) << 6; - b = ((pixel & 0x03) * 0x55); - return a|r|g|b; -} - -static FASTCALL uint32_t -fbFetchPixel_a2b2g2r2 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - uint32_t pixel = READ((uint8_t *) bits + offset); - - a = ((pixel & 0xc0) * 0x55) << 18; - b = ((pixel & 0x30) * 0x55) >> 6; - g = ((pixel & 0x0c) * 0x55) << 6; - r = ((pixel & 0x03) * 0x55) << 16; - return a|r|g|b; -} - -static FASTCALL uint32_t -fbFetchPixel_c8 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t pixel = READ((uint8_t *) bits + offset); - return indexed->rgba[pixel]; -} - -static FASTCALL uint32_t -fbFetchPixel_x4a4 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t pixel = READ((uint8_t *) bits + offset); - - return ((pixel & 0xf) | ((pixel & 0xf) << 4)) << 24; -} - -static FASTCALL uint32_t -fbFetchPixel_a4 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t pixel = Fetch4(bits, offset); - - pixel |= pixel << 4; - return pixel << 24; -} - -static FASTCALL uint32_t -fbFetchPixel_r1g2b1 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = Fetch4(bits, offset); - - r = ((pixel & 0x8) * 0xff) << 13; - g = ((pixel & 0x6) * 0x55) << 7; - b = ((pixel & 0x1) * 0xff); - return 0xff000000|r|g|b; -} - -static FASTCALL uint32_t -fbFetchPixel_b1g2r1 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t r,g,b; - uint32_t pixel = Fetch4(bits, offset); - - b = ((pixel & 0x8) * 0xff) >> 3; - g = ((pixel & 0x6) * 0x55) << 7; - r = ((pixel & 0x1) * 0xff) << 16; - return 0xff000000|r|g|b; -} - -static FASTCALL uint32_t -fbFetchPixel_a1r1g1b1 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - uint32_t pixel = Fetch4(bits, offset); - - a = ((pixel & 0x8) * 0xff) << 21; - r = ((pixel & 0x4) * 0xff) << 14; - g = ((pixel & 0x2) * 0xff) << 7; - b = ((pixel & 0x1) * 0xff); - return a|r|g|b; -} - -static FASTCALL uint32_t -fbFetchPixel_a1b1g1r1 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t a,r,g,b; - uint32_t pixel = Fetch4(bits, offset); - - a = ((pixel & 0x8) * 0xff) << 21; - r = ((pixel & 0x4) * 0xff) >> 3; - g = ((pixel & 0x2) * 0xff) << 7; - b = ((pixel & 0x1) * 0xff) << 16; - return a|r|g|b; -} - -static FASTCALL uint32_t -fbFetchPixel_c4 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t pixel = Fetch4(bits, offset); - - return indexed->rgba[pixel]; -} - - -static FASTCALL uint32_t -fbFetchPixel_a1 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t pixel = READ(bits + (offset >> 5)); - uint32_t a; -#if BITMAP_BIT_ORDER == MSBFirst - a = pixel >> (0x1f - (offset & 0x1f)); -#else - a = pixel >> (offset & 0x1f); -#endif - a = a & 1; - a |= a << 1; - a |= a << 2; - a |= a << 4; - return a << 24; -} - -static FASTCALL uint32_t -fbFetchPixel_g1 (pixman_image_t *image, - const uint32_t *bits, int offset, const pixman_indexed_t * indexed) -{ - uint32_t pixel = READ(bits + (offset >> 5)); - uint32_t a; -#if BITMAP_BIT_ORDER == MSBFirst - a = pixel >> (0x1f - (offset & 0x1f)); -#else - a = pixel >> (offset & 0x1f); -#endif - a = a & 1; - return indexed->rgba[a]; -} - -static fetchPixelProc fetchPixelProcForPicture (bits_image_t * pict) -{ - switch(pict->format) { - case PIXMAN_a8r8g8b8: return fbFetchPixel_a8r8g8b8; - case PIXMAN_x8r8g8b8: return fbFetchPixel_x8r8g8b8; - case PIXMAN_a8b8g8r8: return fbFetchPixel_a8b8g8r8; - case PIXMAN_x8b8g8r8: return fbFetchPixel_x8b8g8r8; - - /* 24bpp formats */ - case PIXMAN_r8g8b8: return fbFetchPixel_r8g8b8; - case PIXMAN_b8g8r8: return fbFetchPixel_b8g8r8; - - /* 16bpp formats */ - case PIXMAN_r5g6b5: return fbFetchPixel_r5g6b5; - case PIXMAN_b5g6r5: return fbFetchPixel_b5g6r5; - - case PIXMAN_a1r5g5b5: return fbFetchPixel_a1r5g5b5; - case PIXMAN_x1r5g5b5: return fbFetchPixel_x1r5g5b5; - case PIXMAN_a1b5g5r5: return fbFetchPixel_a1b5g5r5; - case PIXMAN_x1b5g5r5: return fbFetchPixel_x1b5g5r5; - case PIXMAN_a4r4g4b4: return fbFetchPixel_a4r4g4b4; - case PIXMAN_x4r4g4b4: return fbFetchPixel_x4r4g4b4; - case PIXMAN_a4b4g4r4: return fbFetchPixel_a4b4g4r4; - case PIXMAN_x4b4g4r4: return fbFetchPixel_x4b4g4r4; - - /* 8bpp formats */ - case PIXMAN_a8: return fbFetchPixel_a8; - case PIXMAN_r3g3b2: return fbFetchPixel_r3g3b2; - case PIXMAN_b2g3r3: return fbFetchPixel_b2g3r3; - case PIXMAN_a2r2g2b2: return fbFetchPixel_a2r2g2b2; - case PIXMAN_a2b2g2r2: return fbFetchPixel_a2b2g2r2; - case PIXMAN_c8: return fbFetchPixel_c8; - case PIXMAN_g8: return fbFetchPixel_c8; - case PIXMAN_x4a4: return fbFetchPixel_x4a4; - - /* 4bpp formats */ - case PIXMAN_a4: return fbFetchPixel_a4; - case PIXMAN_r1g2b1: return fbFetchPixel_r1g2b1; - case PIXMAN_b1g2r1: return fbFetchPixel_b1g2r1; - case PIXMAN_a1r1g1b1: return fbFetchPixel_a1r1g1b1; - case PIXMAN_a1b1g1r1: return fbFetchPixel_a1b1g1r1; - case PIXMAN_c4: return fbFetchPixel_c4; - case PIXMAN_g4: return fbFetchPixel_c4; - - /* 1bpp formats */ - case PIXMAN_a1: return fbFetchPixel_a1; - case PIXMAN_g1: return fbFetchPixel_g1; - } - - return NULL; -} - - - -/* - * All the store functions - */ - -typedef FASTCALL void (*storeProc) (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed); - -#define Splita(v) uint32_t a = ((v) >> 24), r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff -#define Split(v) uint32_t r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff - -static FASTCALL void -fbStore_a8r8g8b8 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - MEMCPY_WRAPPED(((uint32_t *)bits) + x, values, width*sizeof(uint32_t)); -} - -static FASTCALL void -fbStore_x8r8g8b8 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint32_t *pixel = (uint32_t *)bits + x; - for (i = 0; i < width; ++i) - WRITE(pixel++, values[i] & 0xffffff); -} - -static FASTCALL void -fbStore_a8b8g8r8 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint32_t *pixel = (uint32_t *)bits + x; - for (i = 0; i < width; ++i) - WRITE(pixel++, (values[i] & 0xff00ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16)); -} - -static FASTCALL void -fbStore_x8b8g8r8 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint32_t *pixel = (uint32_t *)bits + x; - for (i = 0; i < width; ++i) - WRITE(pixel++, (values[i] & 0x0000ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16)); -} - -static FASTCALL void -fbStore_r8g8b8 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, - const pixman_indexed_t * indexed) -{ - int i; - uint8_t *pixel = ((uint8_t *) bits) + 3*x; - for (i = 0; i < width; ++i) { - Store24(pixel, values[i]); - pixel += 3; - } -} - -static FASTCALL void -fbStore_b8g8r8 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint8_t *pixel = ((uint8_t *) bits) + 3*x; - for (i = 0; i < width; ++i) { - uint32_t val = values[i]; -#if IMAGE_BYTE_ORDER == MSBFirst - WRITE(pixel++, Blue(val)); - WRITE(pixel++, Green(val)); - WRITE(pixel++, Red(val)); -#else - WRITE(pixel++, Red(val)); - WRITE(pixel++, Green(val)); - WRITE(pixel++, Blue(val)); -#endif - } -} - -static FASTCALL void -fbStore_r5g6b5 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - uint32_t s = values[i]; - WRITE(pixel++, ((s >> 3) & 0x001f) | - ((s >> 5) & 0x07e0) | - ((s >> 8) & 0xf800)); - } -} - -static FASTCALL void -fbStore_b5g6r5 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - Split(values[i]); - WRITE(pixel++, ((b << 8) & 0xf800) | - ((g << 3) & 0x07e0) | - ((r >> 3) )); - } -} - -static FASTCALL void -fbStore_a1r5g5b5 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - Splita(values[i]); - WRITE(pixel++, ((a << 8) & 0x8000) | - ((r << 7) & 0x7c00) | - ((g << 2) & 0x03e0) | - ((b >> 3) )); - } -} - -static FASTCALL void -fbStore_x1r5g5b5 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - Split(values[i]); - WRITE(pixel++, ((r << 7) & 0x7c00) | - ((g << 2) & 0x03e0) | - ((b >> 3) )); - } -} - -static FASTCALL void -fbStore_a1b5g5r5 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - Splita(values[i]); - WRITE(pixel++, ((a << 8) & 0x8000) | - ((b << 7) & 0x7c00) | - ((g << 2) & 0x03e0) | - ((r >> 3) )); - } -} - -static FASTCALL void -fbStore_x1b5g5r5 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - Split(values[i]); - WRITE(pixel++, ((b << 7) & 0x7c00) | - ((g << 2) & 0x03e0) | - ((r >> 3) )); - } -} - -static FASTCALL void -fbStore_a4r4g4b4 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - Splita(values[i]); - WRITE(pixel++, ((a << 8) & 0xf000) | - ((r << 4) & 0x0f00) | - ((g ) & 0x00f0) | - ((b >> 4) )); - } -} - -static FASTCALL void -fbStore_x4r4g4b4 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - Split(values[i]); - WRITE(pixel++, ((r << 4) & 0x0f00) | - ((g ) & 0x00f0) | - ((b >> 4) )); - } -} - -static FASTCALL void -fbStore_a4b4g4r4 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - Splita(values[i]); - WRITE(pixel++, ((a << 8) & 0xf000) | - ((b << 4) & 0x0f00) | - ((g ) & 0x00f0) | - ((r >> 4) )); - } -} - -static FASTCALL void -fbStore_x4b4g4r4 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint16_t *pixel = ((uint16_t *) bits) + x; - for (i = 0; i < width; ++i) { - Split(values[i]); - WRITE(pixel++, ((b << 4) & 0x0f00) | - ((g ) & 0x00f0) | - ((r >> 4) )); - } -} - -static FASTCALL void -fbStore_a8 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint8_t *pixel = ((uint8_t *) bits) + x; - for (i = 0; i < width; ++i) { - WRITE(pixel++, values[i] >> 24); - } -} - -static FASTCALL void -fbStore_r3g3b2 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint8_t *pixel = ((uint8_t *) bits) + x; - for (i = 0; i < width; ++i) { - Split(values[i]); - WRITE(pixel++, - ((r ) & 0xe0) | - ((g >> 3) & 0x1c) | - ((b >> 6) )); - } -} - -static FASTCALL void -fbStore_b2g3r3 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint8_t *pixel = ((uint8_t *) bits) + x; - for (i = 0; i < width; ++i) { - Split(values[i]); - WRITE(pixel++, - ((b ) & 0xc0) | - ((g >> 2) & 0x1c) | - ((r >> 5) )); - } -} - -static FASTCALL void -fbStore_a2r2g2b2 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint8_t *pixel = ((uint8_t *) bits) + x; - for (i = 0; i < width; ++i) { - Splita(values[i]); - WRITE(pixel++, ((a ) & 0xc0) | - ((r >> 2) & 0x30) | - ((g >> 4) & 0x0c) | - ((b >> 6) )); - } -} - -static FASTCALL void -fbStore_c8 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint8_t *pixel = ((uint8_t *) bits) + x; - for (i = 0; i < width; ++i) { - WRITE(pixel++, miIndexToEnt24(indexed,values[i])); - } -} - -static FASTCALL void -fbStore_x4a4 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - uint8_t *pixel = ((uint8_t *) bits) + x; - for (i = 0; i < width; ++i) { - WRITE(pixel++, values[i] >> 28); - } -} - -#define Store8(l,o,v) (WRITE((uint8_t *)(l) + ((o) >> 3), (v))) -#if IMAGE_BYTE_ORDER == MSBFirst -#define Store4(l,o,v) Store8(l,o,((o) & 4 ? \ - (Fetch8(l,o) & 0xf0) | (v) : \ - (Fetch8(l,o) & 0x0f) | ((v) << 4))) -#else -#define Store4(l,o,v) Store8(l,o,((o) & 4 ? \ - (Fetch8(l,o) & 0x0f) | ((v) << 4) : \ - (Fetch8(l,o) & 0xf0) | (v))) -#endif - -static FASTCALL void -fbStore_a4 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - Store4(bits, i + x, values[i]>>28); - } -} - -static FASTCALL void -fbStore_r1g2b1 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t pixel; - - Split(values[i]); - pixel = (((r >> 4) & 0x8) | - ((g >> 5) & 0x6) | - ((b >> 7) )); - Store4(bits, i + x, pixel); - } -} - -static FASTCALL void -fbStore_b1g2r1 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t pixel; - - Split(values[i]); - pixel = (((b >> 4) & 0x8) | - ((g >> 5) & 0x6) | - ((r >> 7) )); - Store4(bits, i + x, pixel); - } -} - -static FASTCALL void -fbStore_a1r1g1b1 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t pixel; - Splita(values[i]); - pixel = (((a >> 4) & 0x8) | - ((r >> 5) & 0x4) | - ((g >> 6) & 0x2) | - ((b >> 7) )); - Store4(bits, i + x, pixel); - } -} - -static FASTCALL void -fbStore_a1b1g1r1 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t pixel; - Splita(values[i]); - pixel = (((a >> 4) & 0x8) | - ((b >> 5) & 0x4) | - ((g >> 6) & 0x2) | - ((r >> 7) )); - Store4(bits, i + x, pixel); - } -} - -static FASTCALL void -fbStore_c4 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t pixel; - - pixel = miIndexToEnt24(indexed, values[i]); - Store4(bits, i + x, pixel); - } -} - -static FASTCALL void -fbStore_a1 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t *pixel = ((uint32_t *) bits) + ((i+x) >> 5); - uint32_t mask = FbStipMask((i+x) & 0x1f, 1); - - uint32_t v = values[i] & 0x80000000 ? mask : 0; - WRITE(pixel, (READ(pixel) & ~mask) | v); - } -} - -static FASTCALL void -fbStore_g1 (pixman_image_t *image, - uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t *pixel = ((uint32_t *) bits) + ((i+x) >> 5); - uint32_t mask = FbStipMask((i+x) & 0x1f, 1); - - uint32_t v = miIndexToEntY24(indexed,values[i]) ? mask : 0; - WRITE(pixel, (READ(pixel) & ~mask) | v); - } -} - - -static storeProc storeProcForPicture (bits_image_t * pict) -{ - switch(pict->format) { - case PIXMAN_a8r8g8b8: return fbStore_a8r8g8b8; - case PIXMAN_x8r8g8b8: return fbStore_x8r8g8b8; - case PIXMAN_a8b8g8r8: return fbStore_a8b8g8r8; - case PIXMAN_x8b8g8r8: return fbStore_x8b8g8r8; - - /* 24bpp formats */ - case PIXMAN_r8g8b8: return fbStore_r8g8b8; - case PIXMAN_b8g8r8: return fbStore_b8g8r8; - - /* 16bpp formats */ - case PIXMAN_r5g6b5: return fbStore_r5g6b5; - case PIXMAN_b5g6r5: return fbStore_b5g6r5; - - case PIXMAN_a1r5g5b5: return fbStore_a1r5g5b5; - case PIXMAN_x1r5g5b5: return fbStore_x1r5g5b5; - case PIXMAN_a1b5g5r5: return fbStore_a1b5g5r5; - case PIXMAN_x1b5g5r5: return fbStore_x1b5g5r5; - case PIXMAN_a4r4g4b4: return fbStore_a4r4g4b4; - case PIXMAN_x4r4g4b4: return fbStore_x4r4g4b4; - case PIXMAN_a4b4g4r4: return fbStore_a4b4g4r4; - case PIXMAN_x4b4g4r4: return fbStore_x4b4g4r4; - - /* 8bpp formats */ - case PIXMAN_a8: return fbStore_a8; - case PIXMAN_r3g3b2: return fbStore_r3g3b2; - case PIXMAN_b2g3r3: return fbStore_b2g3r3; - case PIXMAN_a2r2g2b2: return fbStore_a2r2g2b2; - case PIXMAN_c8: return fbStore_c8; - case PIXMAN_g8: return fbStore_c8; - case PIXMAN_x4a4: return fbStore_x4a4; - - /* 4bpp formats */ - case PIXMAN_a4: return fbStore_a4; - case PIXMAN_r1g2b1: return fbStore_r1g2b1; - case PIXMAN_b1g2r1: return fbStore_b1g2r1; - case PIXMAN_a1r1g1b1: return fbStore_a1r1g1b1; - case PIXMAN_a1b1g1r1: return fbStore_a1b1g1r1; - case PIXMAN_c4: return fbStore_c4; - case PIXMAN_g4: return fbStore_c4; - - /* 1bpp formats */ - case PIXMAN_a1: return fbStore_a1; - case PIXMAN_g1: return fbStore_g1; - default: - return NULL; - } -} - - -/* - * Combine src and mask - */ -static FASTCALL void -pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t a = *(mask + i) >> 24; - uint32_t s = *(src + i); - FbByteMul(s, a); - *(src + i) = s; - } -} - -/* - * All of the composing functions - */ - -static FASTCALL void -fbCombineClear (uint32_t *dest, const uint32_t *src, int width) -{ - memset(dest, 0, width*sizeof(uint32_t)); -} - -static FASTCALL void -fbCombineSrcU (uint32_t *dest, const uint32_t *src, int width) -{ - memcpy(dest, src, width*sizeof(uint32_t)); -} - - -static FASTCALL void -fbCombineOverU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t d = *(dest + i); - uint32_t ia = Alpha(~s); - - FbByteMulAdd(d, ia, s); - *(dest + i) = d; - } -} - -static FASTCALL void -fbCombineOverReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t d = *(dest + i); - uint32_t ia = Alpha(~*(dest + i)); - FbByteMulAdd(s, ia, d); - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineInU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t a = Alpha(*(dest + i)); - FbByteMul(s, a); - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineInReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t d = *(dest + i); - uint32_t a = Alpha(*(src + i)); - FbByteMul(d, a); - *(dest + i) = d; - } -} - -static FASTCALL void -fbCombineOutU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t a = Alpha(~*(dest + i)); - FbByteMul(s, a); - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineOutReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t d = *(dest + i); - uint32_t a = Alpha(~*(src + i)); - FbByteMul(d, a); - *(dest + i) = d; - } -} - -static FASTCALL void -fbCombineAtopU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t d = *(dest + i); - uint32_t dest_a = Alpha(d); - uint32_t src_ia = Alpha(~s); - - FbByteAddMul(s, dest_a, d, src_ia); - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineAtopReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t d = *(dest + i); - uint32_t src_a = Alpha(s); - uint32_t dest_ia = Alpha(~d); - - FbByteAddMul(s, dest_ia, d, src_a); - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineXorU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t d = *(dest + i); - uint32_t src_ia = Alpha(~s); - uint32_t dest_ia = Alpha(~d); - - FbByteAddMul(s, dest_ia, d, src_ia); - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineAddU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t d = *(dest + i); - FbByteAdd(d, s); - *(dest + i) = d; - } -} - -static FASTCALL void -fbCombineSaturateU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t d = *(dest + i); - uint16_t sa, da; - - sa = s >> 24; - da = ~d >> 24; - if (sa > da) - { - sa = FbIntDiv(da, sa); - FbByteMul(s, sa); - }; - FbByteAdd(d, s); - *(dest + i) = d; - } -} - -/* - * All of the disjoint composing functions - - The four entries in the first column indicate what source contributions - come from each of the four areas of the picture -- areas covered by neither - A nor B, areas covered only by A, areas covered only by B and finally - areas covered by both A and B. - - Disjoint Conjoint - Fa Fb Fa Fb - (0,0,0,0) 0 0 0 0 - (0,A,0,A) 1 0 1 0 - (0,0,B,B) 0 1 0 1 - (0,A,B,A) 1 min((1-a)/b,1) 1 max(1-a/b,0) - (0,A,B,B) min((1-b)/a,1) 1 max(1-b/a,0) 1 - (0,0,0,A) max(1-(1-b)/a,0) 0 min(1,b/a) 0 - (0,0,0,B) 0 max(1-(1-a)/b,0) 0 min(a/b,1) - (0,A,0,0) min(1,(1-b)/a) 0 max(1-b/a,0) 0 - (0,0,B,0) 0 min(1,(1-a)/b) 0 max(1-a/b,0) - (0,0,B,A) max(1-(1-b)/a,0) min(1,(1-a)/b) min(1,b/a) max(1-a/b,0) - (0,A,0,B) min(1,(1-b)/a) max(1-(1-a)/b,0) max(1-b/a,0) min(1,a/b) - (0,A,B,0) min(1,(1-b)/a) min(1,(1-a)/b) max(1-b/a,0) max(1-a/b,0) - -*/ - -#define CombineAOut 1 -#define CombineAIn 2 -#define CombineBOut 4 -#define CombineBIn 8 - -#define CombineClear 0 -#define CombineA (CombineAOut|CombineAIn) -#define CombineB (CombineBOut|CombineBIn) -#define CombineAOver (CombineAOut|CombineBOut|CombineAIn) -#define CombineBOver (CombineAOut|CombineBOut|CombineBIn) -#define CombineAAtop (CombineBOut|CombineAIn) -#define CombineBAtop (CombineAOut|CombineBIn) -#define CombineXor (CombineAOut|CombineBOut) - -/* portion covered by a but not b */ -static INLINE uint8_t -fbCombineDisjointOutPart (uint8_t a, uint8_t b) -{ - /* min (1, (1-b) / a) */ - - b = ~b; /* 1 - b */ - if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */ - return 0xff; /* 1 */ - return FbIntDiv(b,a); /* (1-b) / a */ -} - -/* portion covered by both a and b */ -static INLINE uint8_t -fbCombineDisjointInPart (uint8_t a, uint8_t b) -{ - /* max (1-(1-b)/a,0) */ - /* = - min ((1-b)/a - 1, 0) */ - /* = 1 - min (1, (1-b)/a) */ - - b = ~b; /* 1 - b */ - if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */ - return 0; /* 1 - 1 */ - return ~FbIntDiv(b,a); /* 1 - (1-b) / a */ -} - -static FASTCALL void -fbCombineDisjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8_t combine) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t d = *(dest + i); - uint32_t m,n,o,p; - uint16_t Fa, Fb, t, u, v; - uint8_t sa = s >> 24; - uint8_t da = d >> 24; - - switch (combine & CombineA) { - default: - Fa = 0; - break; - case CombineAOut: - Fa = fbCombineDisjointOutPart (sa, da); - break; - case CombineAIn: - Fa = fbCombineDisjointInPart (sa, da); - break; - case CombineA: - Fa = 0xff; - break; - } - - switch (combine & CombineB) { - default: - Fb = 0; - break; - case CombineBOut: - Fb = fbCombineDisjointOutPart (da, sa); - break; - case CombineBIn: - Fb = fbCombineDisjointInPart (da, sa); - break; - case CombineB: - Fb = 0xff; - break; - } - m = FbGen (s,d,0,Fa,Fb,t, u, v); - n = FbGen (s,d,8,Fa,Fb,t, u, v); - o = FbGen (s,d,16,Fa,Fb,t, u, v); - p = FbGen (s,d,24,Fa,Fb,t, u, v); - s = m|n|o|p; - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineDisjointOverU (uint32_t *dest, const uint32_t *src, int width) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint16_t a = s >> 24; - - if (a != 0x00) - { - if (a != 0xff) - { - uint32_t d = *(dest + i); - a = fbCombineDisjointOutPart (d >> 24, a); - FbByteMulAdd(d, a, s); - s = d; - } - *(dest + i) = s; - } - } -} - -static FASTCALL void -fbCombineDisjointInU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineDisjointGeneralU (dest, src, width, CombineAIn); -} - -static FASTCALL void -fbCombineDisjointInReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineDisjointGeneralU (dest, src, width, CombineBIn); -} - -static FASTCALL void -fbCombineDisjointOutU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineDisjointGeneralU (dest, src, width, CombineAOut); -} - -static FASTCALL void -fbCombineDisjointOutReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineDisjointGeneralU (dest, src, width, CombineBOut); -} - -static FASTCALL void -fbCombineDisjointAtopU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineDisjointGeneralU (dest, src, width, CombineAAtop); -} - -static FASTCALL void -fbCombineDisjointAtopReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineDisjointGeneralU (dest, src, width, CombineBAtop); -} - -static FASTCALL void -fbCombineDisjointXorU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineDisjointGeneralU (dest, src, width, CombineXor); -} - -/* portion covered by a but not b */ -static INLINE uint8_t -fbCombineConjointOutPart (uint8_t a, uint8_t b) -{ - /* max (1-b/a,0) */ - /* = 1-min(b/a,1) */ - - /* min (1, (1-b) / a) */ - - if (b >= a) /* b >= a -> b/a >= 1 */ - return 0x00; /* 0 */ - return ~FbIntDiv(b,a); /* 1 - b/a */ -} - -/* portion covered by both a and b */ -static INLINE uint8_t -fbCombineConjointInPart (uint8_t a, uint8_t b) -{ - /* min (1,b/a) */ - - if (b >= a) /* b >= a -> b/a >= 1 */ - return 0xff; /* 1 */ - return FbIntDiv(b,a); /* b/a */ -} - -static FASTCALL void -fbCombineConjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8_t combine) -{ - int i; - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t d = *(dest + i); - uint32_t m,n,o,p; - uint16_t Fa, Fb, t, u, v; - uint8_t sa = s >> 24; - uint8_t da = d >> 24; - - switch (combine & CombineA) { - default: - Fa = 0; - break; - case CombineAOut: - Fa = fbCombineConjointOutPart (sa, da); - break; - case CombineAIn: - Fa = fbCombineConjointInPart (sa, da); - break; - case CombineA: - Fa = 0xff; - break; - } - - switch (combine & CombineB) { - default: - Fb = 0; - break; - case CombineBOut: - Fb = fbCombineConjointOutPart (da, sa); - break; - case CombineBIn: - Fb = fbCombineConjointInPart (da, sa); - break; - case CombineB: - Fb = 0xff; - break; - } - m = FbGen (s,d,0,Fa,Fb,t, u, v); - n = FbGen (s,d,8,Fa,Fb,t, u, v); - o = FbGen (s,d,16,Fa,Fb,t, u, v); - p = FbGen (s,d,24,Fa,Fb,t, u, v); - s = m|n|o|p; - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineConjointOverU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineConjointGeneralU (dest, src, width, CombineAOver); -} - - -static FASTCALL void -fbCombineConjointOverReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineConjointGeneralU (dest, src, width, CombineBOver); -} - - -static FASTCALL void -fbCombineConjointInU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineConjointGeneralU (dest, src, width, CombineAIn); -} - - -static FASTCALL void -fbCombineConjointInReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineConjointGeneralU (dest, src, width, CombineBIn); -} - -static FASTCALL void -fbCombineConjointOutU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineConjointGeneralU (dest, src, width, CombineAOut); -} - -static FASTCALL void -fbCombineConjointOutReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineConjointGeneralU (dest, src, width, CombineBOut); -} - -static FASTCALL void -fbCombineConjointAtopU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineConjointGeneralU (dest, src, width, CombineAAtop); -} - -static FASTCALL void -fbCombineConjointAtopReverseU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineConjointGeneralU (dest, src, width, CombineBAtop); -} - -static FASTCALL void -fbCombineConjointXorU (uint32_t *dest, const uint32_t *src, int width) -{ - fbCombineConjointGeneralU (dest, src, width, CombineXor); -} - -static CombineFuncU pixman_fbCombineFuncU[] = { - fbCombineClear, - fbCombineSrcU, - NULL, /* CombineDst */ - fbCombineOverU, - fbCombineOverReverseU, - fbCombineInU, - fbCombineInReverseU, - fbCombineOutU, - fbCombineOutReverseU, - fbCombineAtopU, - fbCombineAtopReverseU, - fbCombineXorU, - fbCombineAddU, - fbCombineSaturateU, - NULL, - NULL, - fbCombineClear, - fbCombineSrcU, - NULL, /* CombineDst */ - fbCombineDisjointOverU, - fbCombineSaturateU, /* DisjointOverReverse */ - fbCombineDisjointInU, - fbCombineDisjointInReverseU, - fbCombineDisjointOutU, - fbCombineDisjointOutReverseU, - fbCombineDisjointAtopU, - fbCombineDisjointAtopReverseU, - fbCombineDisjointXorU, - NULL, - NULL, - NULL, - NULL, - fbCombineClear, - fbCombineSrcU, - NULL, /* CombineDst */ - fbCombineConjointOverU, - fbCombineConjointOverReverseU, - fbCombineConjointInU, - fbCombineConjointInReverseU, - fbCombineConjointOutU, - fbCombineConjointOutReverseU, - fbCombineConjointAtopU, - fbCombineConjointAtopReverseU, - fbCombineConjointXorU, -}; - -static INLINE void -fbCombineMaskC (uint32_t *src, uint32_t *mask) -{ - uint32_t a = *mask; - - uint32_t x; - uint16_t xa; - - if (!a) - { - *(src) = 0; - return; - } - - x = *(src); - if (a == 0xffffffff) - { - x = x >> 24; - x |= x << 8; - x |= x << 16; - *(mask) = x; - return; - } - - xa = x >> 24; - FbByteMulC(x, a); - *(src) = x; - FbByteMul(a, xa); - *(mask) = a; -} - -static INLINE void -fbCombineMaskValueC (uint32_t *src, const uint32_t *mask) -{ - uint32_t a = *mask; - uint32_t x; - - if (!a) - { - *(src) = 0; - return; - } - - if (a == 0xffffffff) - return; - - x = *(src); - FbByteMulC(x, a); - *(src) =x; -} - -static INLINE void -fbCombineMaskAlphaC (const uint32_t *src, uint32_t *mask) -{ - uint32_t a = *(mask); - uint32_t x; - - if (!a) - return; - - x = *(src) >> 24; - if (x == 0xff) - return; - if (a == 0xffffffff) - { - x = x >> 24; - x |= x << 8; - x |= x << 16; - *(mask) = x; - return; - } - - FbByteMul(a, x); - *(mask) = a; -} - -static FASTCALL void -fbCombineClearC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - memset(dest, 0, width*sizeof(uint32_t)); -} - -static FASTCALL void -fbCombineSrcC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t m = *(mask + i); - - fbCombineMaskValueC (&s, &m); - - *(dest) = s; - } -} - -static FASTCALL void -fbCombineOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t m = *(mask + i); - uint32_t a; - - fbCombineMaskC (&s, &m); - - a = ~m; - if (a != 0xffffffff) - { - if (a) - { - uint32_t d = *(dest + i); - FbByteMulAddC(d, a, s); - s = d; - } - *(dest + i) = s; - } - } -} - -static FASTCALL void -fbCombineOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t d = *(dest + i); - uint32_t a = ~d >> 24; - - if (a) - { - uint32_t s = *(src + i); - uint32_t m = *(mask + i); - - fbCombineMaskValueC (&s, &m); - - if (a != 0xff) - { - FbByteMulAdd(s, a, d); - } - *(dest + i) = s; - } - } -} - -static FASTCALL void -fbCombineInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t d = *(dest + i); - uint16_t a = d >> 24; - uint32_t s = 0; - if (a) - { - uint32_t m = *(mask + i); - - s = *(src + i); - fbCombineMaskValueC (&s, &m); - if (a != 0xff) - { - FbByteMul(s, a); - } - } - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t m = *(mask + i); - uint32_t a; - - fbCombineMaskAlphaC (&s, &m); - - a = m; - if (a != 0xffffffff) - { - uint32_t d = 0; - if (a) - { - d = *(dest + i); - FbByteMulC(d, a); - } - *(dest + i) = d; - } - } -} - -static FASTCALL void -fbCombineOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t d = *(dest + i); - uint16_t a = ~d >> 24; - uint32_t s = 0; - if (a) - { - uint32_t m = *(mask + i); - - s = *(src + i); - fbCombineMaskValueC (&s, &m); - - if (a != 0xff) - { - FbByteMul(s, a); - } - } - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t m = *(mask + i); - uint32_t a; - - fbCombineMaskAlphaC (&s, &m); - - a = ~m; - if (a != 0xffffffff) - { - uint32_t d = 0; - if (a) - { - d = *(dest + i); - FbByteMulC(d, a); - } - *(dest + i) = d; - } - } -} - -static FASTCALL void -fbCombineAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t d = *(dest + i); - uint32_t s = *(src + i); - uint32_t m = *(mask + i); - uint32_t ad; - uint16_t as = d >> 24; - - fbCombineMaskC (&s, &m); - - ad = ~m; - - FbByteAddMulC(d, ad, s, as); - *(dest + i) = d; - } -} - -static FASTCALL void -fbCombineAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - - uint32_t d = *(dest + i); - uint32_t s = *(src + i); - uint32_t m = *(mask + i); - uint32_t ad; - uint16_t as = ~d >> 24; - - fbCombineMaskC (&s, &m); - - ad = m; - - FbByteAddMulC(d, ad, s, as); - *(dest + i) = d; - } -} - -static FASTCALL void -fbCombineXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t d = *(dest + i); - uint32_t s = *(src + i); - uint32_t m = *(mask + i); - uint32_t ad; - uint16_t as = ~d >> 24; - - fbCombineMaskC (&s, &m); - - ad = ~m; - - FbByteAddMulC(d, ad, s, as); - *(dest + i) = d; - } -} - -static FASTCALL void -fbCombineAddC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t s = *(src + i); - uint32_t m = *(mask + i); - uint32_t d = *(dest + i); - - fbCombineMaskValueC (&s, &m); - - FbByteAdd(d, s); - *(dest + i) = d; - } -} - -static FASTCALL void -fbCombineSaturateC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t s, d; - uint16_t sa, sr, sg, sb, da; - uint16_t t, u, v; - uint32_t m,n,o,p; - - d = *(dest + i); - s = *(src + i); - m = *(mask + i); - - fbCombineMaskC (&s, &m); - - sa = (m >> 24); - sr = (m >> 16) & 0xff; - sg = (m >> 8) & 0xff; - sb = (m ) & 0xff; - da = ~d >> 24; - - if (sb <= da) - m = FbAdd(s,d,0,t); - else - m = FbGen (s, d, 0, (da << 8) / sb, 0xff, t, u, v); - - if (sg <= da) - n = FbAdd(s,d,8,t); - else - n = FbGen (s, d, 8, (da << 8) / sg, 0xff, t, u, v); - - if (sr <= da) - o = FbAdd(s,d,16,t); - else - o = FbGen (s, d, 16, (da << 8) / sr, 0xff, t, u, v); - - if (sa <= da) - p = FbAdd(s,d,24,t); - else - p = FbGen (s, d, 24, (da << 8) / sa, 0xff, t, u, v); - - *(dest + i) = m|n|o|p; - } -} - -static FASTCALL void -fbCombineDisjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width, uint8_t combine) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t s, d; - uint32_t m,n,o,p; - uint32_t Fa, Fb; - uint16_t t, u, v; - uint32_t sa; - uint8_t da; - - s = *(src + i); - m = *(mask + i); - d = *(dest + i); - da = d >> 24; - - fbCombineMaskC (&s, &m); - - sa = m; - - switch (combine & CombineA) { - default: - Fa = 0; - break; - case CombineAOut: - m = fbCombineDisjointOutPart ((uint8_t) (sa >> 0), da); - n = fbCombineDisjointOutPart ((uint8_t) (sa >> 8), da) << 8; - o = fbCombineDisjointOutPart ((uint8_t) (sa >> 16), da) << 16; - p = fbCombineDisjointOutPart ((uint8_t) (sa >> 24), da) << 24; - Fa = m|n|o|p; - break; - case CombineAIn: - m = fbCombineDisjointInPart ((uint8_t) (sa >> 0), da); - n = fbCombineDisjointInPart ((uint8_t) (sa >> 8), da) << 8; - o = fbCombineDisjointInPart ((uint8_t) (sa >> 16), da) << 16; - p = fbCombineDisjointInPart ((uint8_t) (sa >> 24), da) << 24; - Fa = m|n|o|p; - break; - case CombineA: - Fa = 0xffffffff; - break; - } - - switch (combine & CombineB) { - default: - Fb = 0; - break; - case CombineBOut: - m = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 0)); - n = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 8)) << 8; - o = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 16)) << 16; - p = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 24)) << 24; - Fb = m|n|o|p; - break; - case CombineBIn: - m = fbCombineDisjointInPart (da, (uint8_t) (sa >> 0)); - n = fbCombineDisjointInPart (da, (uint8_t) (sa >> 8)) << 8; - o = fbCombineDisjointInPart (da, (uint8_t) (sa >> 16)) << 16; - p = fbCombineDisjointInPart (da, (uint8_t) (sa >> 24)) << 24; - Fb = m|n|o|p; - break; - case CombineB: - Fb = 0xffffffff; - break; - } - m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v); - n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v); - o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v); - p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v); - s = m|n|o|p; - *(dest + i) = s; - } -} - -static FASTCALL void -fbCombineDisjointOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOver); -} - -static FASTCALL void -fbCombineDisjointInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineDisjointGeneralC (dest, src, mask, width, CombineAIn); -} - -static FASTCALL void -fbCombineDisjointInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineDisjointGeneralC (dest, src, mask, width, CombineBIn); -} - -static FASTCALL void -fbCombineDisjointOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOut); -} - -static FASTCALL void -fbCombineDisjointOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineDisjointGeneralC (dest, src, mask, width, CombineBOut); -} - -static FASTCALL void -fbCombineDisjointAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineDisjointGeneralC (dest, src, mask, width, CombineAAtop); -} - -static FASTCALL void -fbCombineDisjointAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineDisjointGeneralC (dest, src, mask, width, CombineBAtop); -} - -static FASTCALL void -fbCombineDisjointXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineDisjointGeneralC (dest, src, mask, width, CombineXor); -} - -static FASTCALL void -fbCombineConjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width, uint8_t combine) -{ - int i; - - for (i = 0; i < width; ++i) { - uint32_t s, d; - uint32_t m,n,o,p; - uint32_t Fa, Fb; - uint16_t t, u, v; - uint32_t sa; - uint8_t da; - - s = *(src + i); - m = *(mask + i); - d = *(dest + i); - da = d >> 24; - - fbCombineMaskC (&s, &m); - - sa = m; - - switch (combine & CombineA) { - default: - Fa = 0; - break; - case CombineAOut: - m = fbCombineConjointOutPart ((uint8_t) (sa >> 0), da); - n = fbCombineConjointOutPart ((uint8_t) (sa >> 8), da) << 8; - o = fbCombineConjointOutPart ((uint8_t) (sa >> 16), da) << 16; - p = fbCombineConjointOutPart ((uint8_t) (sa >> 24), da) << 24; - Fa = m|n|o|p; - break; - case CombineAIn: - m = fbCombineConjointInPart ((uint8_t) (sa >> 0), da); - n = fbCombineConjointInPart ((uint8_t) (sa >> 8), da) << 8; - o = fbCombineConjointInPart ((uint8_t) (sa >> 16), da) << 16; - p = fbCombineConjointInPart ((uint8_t) (sa >> 24), da) << 24; - Fa = m|n|o|p; - break; - case CombineA: - Fa = 0xffffffff; - break; - } - - switch (combine & CombineB) { - default: - Fb = 0; - break; - case CombineBOut: - m = fbCombineConjointOutPart (da, (uint8_t) (sa >> 0)); - n = fbCombineConjointOutPart (da, (uint8_t) (sa >> 8)) << 8; - o = fbCombineConjointOutPart (da, (uint8_t) (sa >> 16)) << 16; - p = fbCombineConjointOutPart (da, (uint8_t) (sa >> 24)) << 24; - Fb = m|n|o|p; - break; - case CombineBIn: - m = fbCombineConjointInPart (da, (uint8_t) (sa >> 0)); - n = fbCombineConjointInPart (da, (uint8_t) (sa >> 8)) << 8; - o = fbCombineConjointInPart (da, (uint8_t) (sa >> 16)) << 16; - p = fbCombineConjointInPart (da, (uint8_t) (sa >> 24)) << 24; - Fb = m|n|o|p; - break; - case CombineB: - Fb = 0xffffffff; - break; - } - m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v); - n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v); - o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v); - p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v); - s = m|n|o|p; - *(dest + i) = s; - } -} +#ifdef PIXMAN_FB_ACCESSORS +#define PIXMAN_COMPOSITE_RECT_GENERAL pixman_composite_rect_general_accessors +#define PIXMAN_COMPOSE_FUNCTIONS pixman_composeFunctions_accessors -static FASTCALL void -fbCombineConjointOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineConjointGeneralC (dest, src, mask, width, CombineAOver); -} +#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture_accessors +#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture_accessors +#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture_accessors + +#define FB_FETCH_TRANSFORMED fbFetchTransformed_accessors +#define FB_FETCH_EXTERNAL_ALPHA fbFetchExternalAlpha_accessors +#define FB_STORE_EXTERNAL_ALPHA fbStoreExternalAlpha_accessors -static FASTCALL void -fbCombineConjointOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineConjointGeneralC (dest, src, mask, width, CombineBOver); -} +#else -static FASTCALL void -fbCombineConjointInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineConjointGeneralC (dest, src, mask, width, CombineAIn); -} +#define PIXMAN_COMPOSITE_RECT_GENERAL pixman_composite_rect_general_no_accessors +#define PIXMAN_COMPOSE_FUNCTIONS pixman_composeFunctions -static FASTCALL void -fbCombineConjointInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineConjointGeneralC (dest, src, mask, width, CombineBIn); -} +#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture +#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture +#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture + +#define FB_FETCH_TRANSFORMED fbFetchTransformed +#define FB_FETCH_EXTERNAL_ALPHA fbFetchExternalAlpha +#define FB_STORE_EXTERNAL_ALPHA fbStoreExternalAlpha -static FASTCALL void -fbCombineConjointOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineConjointGeneralC (dest, src, mask, width, CombineAOut); -} +#endif -static FASTCALL void -fbCombineConjointOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) +static unsigned int +SourcePictureClassify (source_image_t *pict, + int x, + int y, + int width, + int height) { - fbCombineConjointGeneralC (dest, src, mask, width, CombineBOut); -} + if (pict->common.type == SOLID) + { + pict->class = SOURCE_IMAGE_CLASS_HORIZONTAL; + } + else if (pict->common.type == LINEAR) + { + linear_gradient_t *linear = (linear_gradient_t *)pict; + pixman_vector_t v; + pixman_fixed_32_32_t l; + pixman_fixed_48_16_t dx, dy, a, b, off; + pixman_fixed_48_16_t factors[4]; + int i; -static FASTCALL void -fbCombineConjointAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineConjointGeneralC (dest, src, mask, width, CombineAAtop); -} + dx = linear->p2.x - linear->p1.x; + dy = linear->p2.y - linear->p1.y; + l = dx * dx + dy * dy; + if (l) + { + a = (dx << 32) / l; + b = (dy << 32) / l; + } + else + { + a = b = 0; + } -static FASTCALL void -fbCombineConjointAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineConjointGeneralC (dest, src, mask, width, CombineBAtop); -} + off = (-a * linear->p1.x + -b * linear->p1.y) >> 16; -static FASTCALL void -fbCombineConjointXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width) -{ - fbCombineConjointGeneralC (dest, src, mask, width, CombineXor); -} + for (i = 0; i < 3; i++) + { + v.vector[0] = pixman_int_to_fixed ((i % 2) * (width - 1) + x); + v.vector[1] = pixman_int_to_fixed ((i / 2) * (height - 1) + y); + v.vector[2] = pixman_fixed_1; -static CombineFuncC pixman_fbCombineFuncC[] = { - fbCombineClearC, - fbCombineSrcC, - NULL, /* Dest */ - fbCombineOverC, - fbCombineOverReverseC, - fbCombineInC, - fbCombineInReverseC, - fbCombineOutC, - fbCombineOutReverseC, - fbCombineAtopC, - fbCombineAtopReverseC, - fbCombineXorC, - fbCombineAddC, - fbCombineSaturateC, - NULL, - NULL, - fbCombineClearC, /* 0x10 */ - fbCombineSrcC, - NULL, /* Dest */ - fbCombineDisjointOverC, - fbCombineSaturateC, /* DisjointOverReverse */ - fbCombineDisjointInC, - fbCombineDisjointInReverseC, - fbCombineDisjointOutC, - fbCombineDisjointOutReverseC, - fbCombineDisjointAtopC, - fbCombineDisjointAtopReverseC, - fbCombineDisjointXorC, /* 0x1b */ - NULL, - NULL, - NULL, - NULL, - fbCombineClearC, - fbCombineSrcC, - NULL, /* Dest */ - fbCombineConjointOverC, - fbCombineConjointOverReverseC, - fbCombineConjointInC, - fbCombineConjointInReverseC, - fbCombineConjointOutC, - fbCombineConjointOutReverseC, - fbCombineConjointAtopC, - fbCombineConjointAtopReverseC, - fbCombineConjointXorC, -}; + if (pict->common.transform) + { + if (!pixman_transform_point_3d (pict->common.transform, &v)) + return SOURCE_IMAGE_CLASS_UNKNOWN; + } + + factors[i] = ((a * v.vector[0] + b * v.vector[1]) >> 16) + off; + } + + if (factors[2] == factors[0]) + pict->class = SOURCE_IMAGE_CLASS_HORIZONTAL; + else if (factors[1] == factors[0]) + pict->class = SOURCE_IMAGE_CLASS_VERTICAL; + } + return pict->class; +} static void fbFetchSolid(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits) { - uint32_t *bits; uint32_t color; uint32_t *end; - fetchPixelProc fetch = fetchPixelProcForPicture(pict); - const pixman_indexed_t * indexed = pict->indexed; - - bits = pict->bits; - - color = fetch((pixman_image_t *)pict, bits, 0, indexed); - + fetchPixelProc fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict); + + color = fetch(pict, 0, 0); + end = buffer + width; while (buffer < end) *(buffer++) = color; - fbFinishAccess (pict->pDrawable); } static void fbFetch(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits) { - uint32_t *bits; - int32_t stride; - fetchProc fetch = fetchProcForPicture(pict); - const pixman_indexed_t * indexed = pict->indexed; - - bits = pict->bits; - stride = pict->rowstride; - - bits += y*stride; - - fetch((pixman_image_t *)pict, bits, x, width, buffer, indexed); -} + fetchProc fetch = FETCH_PROC_FOR_PICTURE(pict); -#ifdef PIXMAN_FB_ACCESSORS -#define PIXMAN_COMPOSITE_RECT_GENERAL pixman_composite_rect_general_accessors -#define PIXMAN_COMPOSE_FUNCTIONS pixman_composeFunctions_accessors -#else -#define PIXMAN_COMPOSITE_RECT_GENERAL pixman_composite_rect_general_no_accessors -#define PIXMAN_COMPOSE_FUNCTIONS pixman_composeFunctions -#endif + fetch(pict, x, y, width, buffer); +} #ifdef PIXMAN_FB_ACCESSORS /* The accessor version can't be parameterized from outside */ static const @@ -2909,1239 +151,18 @@ pixman_fbCombineMaskU }; -typedef struct -{ - uint32_t left_ag; - uint32_t left_rb; - uint32_t right_ag; - uint32_t right_rb; - int32_t left_x; - int32_t right_x; - int32_t stepper; - - pixman_gradient_stop_t *stops; - int num_stops; - unsigned int spread; - - int need_reset; -} GradientWalker; - -static void -_gradient_walker_init (GradientWalker *walker, - gradient_t *gradient, - unsigned int spread) -{ - walker->num_stops = gradient->n_stops; - walker->stops = gradient->stops; - walker->left_x = 0; - walker->right_x = 0x10000; - walker->stepper = 0; - walker->left_ag = 0; - walker->left_rb = 0; - walker->right_ag = 0; - walker->right_rb = 0; - walker->spread = spread; - - walker->need_reset = TRUE; -} - static void -_gradient_walker_reset (GradientWalker *walker, - pixman_fixed_32_32_t pos) -{ - int32_t x, left_x, right_x; - pixman_color_t *left_c, *right_c; - int n, count = walker->num_stops; - pixman_gradient_stop_t * stops = walker->stops; - - static const pixman_color_t transparent_black = { 0, 0, 0, 0 }; - - switch (walker->spread) - { - case PIXMAN_REPEAT_NORMAL: - x = (int32_t)pos & 0xFFFF; - for (n = 0; n < count; n++) - if (x < stops[n].x) - break; - if (n == 0) { - left_x = stops[count-1].x - 0x10000; - left_c = &stops[count-1].color; - } else { - left_x = stops[n-1].x; - left_c = &stops[n-1].color; - } - - if (n == count) { - right_x = stops[0].x + 0x10000; - right_c = &stops[0].color; - } else { - right_x = stops[n].x; - right_c = &stops[n].color; - } - left_x += (pos - x); - right_x += (pos - x); - break; - - case PIXMAN_REPEAT_PAD: - for (n = 0; n < count; n++) - if (pos < stops[n].x) - break; - - if (n == 0) { - left_x = INT32_MIN; - left_c = &stops[0].color; - } else { - left_x = stops[n-1].x; - left_c = &stops[n-1].color; - } - - if (n == count) { - right_x = INT32_MAX; - right_c = &stops[n-1].color; - } else { - right_x = stops[n].x; - right_c = &stops[n].color; - } - break; - - case PIXMAN_REPEAT_REFLECT: - x = (int32_t)pos & 0xFFFF; - if ((int32_t)pos & 0x10000) - x = 0x10000 - x; - for (n = 0; n < count; n++) - if (x < stops[n].x) - break; - - if (n == 0) { - left_x = -stops[0].x; - left_c = &stops[0].color; - } else { - left_x = stops[n-1].x; - left_c = &stops[n-1].color; - } - - if (n == count) { - right_x = 0x20000 - stops[n-1].x; - right_c = &stops[n-1].color; - } else { - right_x = stops[n].x; - right_c = &stops[n].color; - } - - if ((int32_t)pos & 0x10000) { - pixman_color_t *tmp_c; - int32_t tmp_x; - - tmp_x = 0x10000 - right_x; - right_x = 0x10000 - left_x; - left_x = tmp_x; - - tmp_c = right_c; - right_c = left_c; - left_c = tmp_c; - - x = 0x10000 - x; - } - left_x += (pos - x); - right_x += (pos - x); - break; - - default: /* RepeatNone */ - for (n = 0; n < count; n++) - if (pos < stops[n].x) - break; - - if (n == 0) - { - left_x = INT32_MIN; - right_x = stops[0].x; - left_c = right_c = (pixman_color_t*) &transparent_black; - } - else if (n == count) - { - left_x = stops[n-1].x; - right_x = INT32_MAX; - left_c = right_c = (pixman_color_t*) &transparent_black; - } - else - { - left_x = stops[n-1].x; - right_x = stops[n].x; - left_c = &stops[n-1].color; - right_c = &stops[n].color; - } - } - - walker->left_x = left_x; - walker->right_x = right_x; - walker->left_ag = ((left_c->alpha >> 8) << 16) | (left_c->green >> 8); - walker->left_rb = ((left_c->red & 0xff00) << 8) | (left_c->blue >> 8); - walker->right_ag = ((right_c->alpha >> 8) << 16) | (right_c->green >> 8); - walker->right_rb = ((right_c->red & 0xff00) << 8) | (right_c->blue >> 8); - - if ( walker->left_x == walker->right_x || - ( walker->left_ag == walker->right_ag && - walker->left_rb == walker->right_rb ) ) - { - walker->stepper = 0; - } - else - { - int32_t width = right_x - left_x; - walker->stepper = ((1 << 24) + width/2)/width; - } - - walker->need_reset = FALSE; -} - -#define GRADIENT_WALKER_NEED_RESET(w,x) \ - ( (w)->need_reset || (x) < (w)->left_x || (x) >= (w)->right_x) - - -/* the following assumes that GRADIENT_WALKER_NEED_RESET(w,x) is FALSE */ -static uint32_t -_gradient_walker_pixel (GradientWalker *walker, - pixman_fixed_32_32_t x) -{ - int dist, idist; - uint32_t t1, t2, a, color; - - if (GRADIENT_WALKER_NEED_RESET (walker, x)) - _gradient_walker_reset (walker, x); - - dist = ((int)(x - walker->left_x)*walker->stepper) >> 16; - idist = 256 - dist; - - /* combined INTERPOLATE and premultiply */ - t1 = walker->left_rb*idist + walker->right_rb*dist; - t1 = (t1 >> 8) & 0xff00ff; - - t2 = walker->left_ag*idist + walker->right_ag*dist; - t2 &= 0xff00ff00; - - color = t2 & 0xff000000; - a = t2 >> 24; - - t1 = t1*a + 0x800080; - t1 = (t1 + ((t1 >> 8) & 0xff00ff)) >> 8; - - t2 = (t2 >> 8)*a + 0x800080; - t2 = (t2 + ((t2 >> 8) & 0xff00ff)); - - return (color | (t1 & 0xff00ff) | (t2 & 0xff00)); -} - -static void pixmanFetchSourcePict(source_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits) -{ -#if 0 - SourcePictPtr pGradient = pict->pSourcePict; -#endif - GradientWalker walker; - uint32_t *end = buffer + width; - gradient_t *gradient; - - if (pict->common.type == SOLID) - { - register uint32_t color = ((solid_fill_t *)pict)->color; - - while (buffer < end) - *(buffer++) = color; - - return; - } - - gradient = (gradient_t *)pict; - - _gradient_walker_init (&walker, gradient, pict->common.repeat); - - if (pict->common.type == LINEAR) { - pixman_vector_t v, unit; - pixman_fixed_32_32_t l; - pixman_fixed_48_16_t dx, dy, a, b, off; - linear_gradient_t *linear = (linear_gradient_t *)pict; - - /* reference point is the center of the pixel */ - v.vector[0] = pixman_int_to_fixed(x) + pixman_fixed_1/2; - v.vector[1] = pixman_int_to_fixed(y) + pixman_fixed_1/2; - v.vector[2] = pixman_fixed_1; - if (pict->common.transform) { - if (!pixman_transform_point_3d (pict->common.transform, &v)) - return; - unit.vector[0] = pict->common.transform->matrix[0][0]; - unit.vector[1] = pict->common.transform->matrix[1][0]; - unit.vector[2] = pict->common.transform->matrix[2][0]; - } else { - unit.vector[0] = pixman_fixed_1; - unit.vector[1] = 0; - unit.vector[2] = 0; - } - - dx = linear->p2.x - linear->p1.x; - dy = linear->p2.y - linear->p1.y; - l = dx*dx + dy*dy; - if (l != 0) { - a = (dx << 32) / l; - b = (dy << 32) / l; - off = (-a*linear->p1.x - b*linear->p1.y)>>16; - } - if (l == 0 || (unit.vector[2] == 0 && v.vector[2] == pixman_fixed_1)) { - pixman_fixed_48_16_t inc, t; - /* affine transformation only */ - if (l == 0) { - t = 0; - inc = 0; - } else { - t = ((a*v.vector[0] + b*v.vector[1]) >> 16) + off; - inc = (a * unit.vector[0] + b * unit.vector[1]) >> 16; - } - - if (pict->class == SOURCE_IMAGE_CLASS_VERTICAL) - { - register uint32_t color; - - color = _gradient_walker_pixel( &walker, t ); - while (buffer < end) - *(buffer++) = color; - } - else - { - if (!mask) { - while (buffer < end) - { - *(buffer) = _gradient_walker_pixel (&walker, t); - buffer += 1; - t += inc; - } - } else { - while (buffer < end) { - if (*mask++ & maskBits) - { - *(buffer) = _gradient_walker_pixel (&walker, t); - } - buffer += 1; - t += inc; - } - } - } - } - else /* projective transformation */ - { - pixman_fixed_48_16_t t; - - if (pict->class == SOURCE_IMAGE_CLASS_VERTICAL) - { - register uint32_t color; - - if (v.vector[2] == 0) - { - t = 0; - } - else - { - pixman_fixed_48_16_t x, y; - - x = ((pixman_fixed_48_16_t) v.vector[0] << 16) / v.vector[2]; - y = ((pixman_fixed_48_16_t) v.vector[1] << 16) / v.vector[2]; - t = ((a * x + b * y) >> 16) + off; - } - - color = _gradient_walker_pixel( &walker, t ); - while (buffer < end) - *(buffer++) = color; - } - else - { - while (buffer < end) - { - if (!mask || *mask++ & maskBits) - { - if (v.vector[2] == 0) { - t = 0; - } else { - pixman_fixed_48_16_t x, y; - x = ((pixman_fixed_48_16_t)v.vector[0] << 16) / v.vector[2]; - y = ((pixman_fixed_48_16_t)v.vector[1] << 16) / v.vector[2]; - t = ((a*x + b*y) >> 16) + off; - } - *(buffer) = _gradient_walker_pixel (&walker, t); - } - ++buffer; - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } - } - } else { - -/* - * In the radial gradient problem we are given two circles (c₁,r₁) and - * (c₂,r₂) that define the gradient itself. Then, for any point p, we - * must compute the value(s) of t within [0.0, 1.0] representing the - * circle(s) that would color the point. - * - * There are potentially two values of t since the point p can be - * colored by both sides of the circle, (which happens whenever one - * circle is not entirely contained within the other). - * - * If we solve for a value of t that is outside of [0.0, 1.0] then we - * use the extend mode (NONE, REPEAT, REFLECT, or PAD) to map to a - * value within [0.0, 1.0]. - * - * Here is an illustration of the problem: - * - * p₂ - * p • - * • ╲ - * · ╲r₂ - * p₁ · ╲ - * • θ╲ - * ╲ ╌╌• - * ╲r₁ · c₂ - * θ╲ · - * ╌╌• - * c₁ - * - * Given (c₁,r₁), (c₂,r₂) and p, we must find an angle θ such that two - * points p₁ and p₂ on the two circles are collinear with p. Then, the - * desired value of t is the ratio of the length of p₁p to the length - * of p₁p₂. - * - * So, we have six unknown values: (p₁x, p₁y), (p₂x, p₂y), θ and t. - * We can also write six equations that constrain the problem: - * - * Point p₁ is a distance r₁ from c₁ at an angle of θ: - * - * 1. p₁x = c₁x + r₁·cos θ - * 2. p₁y = c₁y + r₁·sin θ - * - * Point p₂ is a distance r₂ from c₂ at an angle of θ: - * - * 3. p₂x = c₂x + r2·cos θ - * 4. p₂y = c₂y + r2·sin θ - * - * Point p lies at a fraction t along the line segment p₁p₂: - * - * 5. px = t·p₂x + (1-t)·p₁x - * 6. py = t·p₂y + (1-t)·p₁y - * - * To solve, first subtitute 1-4 into 5 and 6: - * - * px = t·(c₂x + r₂·cos θ) + (1-t)·(c₁x + r₁·cos θ) - * py = t·(c₂y + r₂·sin θ) + (1-t)·(c₁y + r₁·sin θ) - * - * Then solve each for cos θ and sin θ expressed as a function of t: - * - * cos θ = (-(c₂x - c₁x)·t + (px - c₁x)) / ((r₂-r₁)·t + r₁) - * sin θ = (-(c₂y - c₁y)·t + (py - c₁y)) / ((r₂-r₁)·t + r₁) - * - * To simplify this a bit, we define new variables for several of the - * common terms as shown below: - * - * p₂ - * p • - * • ╲ - * · ┆ ╲r₂ - * p₁ · ┆ ╲ - * • pdy┆ ╲ - * ╲ ┆ •c₂ - * ╲r₁ ┆ · ┆ - * ╲ ·┆ ┆cdy - * •╌╌╌╌┴╌╌╌╌╌╌╌┘ - * c₁ pdx cdx - * - * cdx = (c₂x - c₁x) - * cdy = (c₂y - c₁y) - * dr = r₂-r₁ - * pdx = px - c₁x - * pdy = py - c₁y - * - * Note that cdx, cdy, and dr do not depend on point p at all, so can - * be pre-computed for the entire gradient. The simplifed equations - * are now: - * - * cos θ = (-cdx·t + pdx) / (dr·t + r₁) - * sin θ = (-cdy·t + pdy) / (dr·t + r₁) - * - * Finally, to get a single function of t and eliminate the last - * unknown θ, we use the identity sin²θ + cos²θ = 1. First, square - * each equation, (we knew a quadratic was coming since it must be - * possible to obtain two solutions in some cases): - * - * cos²θ = (cdx²t² - 2·cdx·pdx·t + pdx²) / (dr²·t² + 2·r₁·dr·t + r₁²) - * sin²θ = (cdy²t² - 2·cdy·pdy·t + pdy²) / (dr²·t² + 2·r₁·dr·t + r₁²) - * - * Then add both together, set the result equal to 1, and express as a - * standard quadratic equation in t of the form At² + Bt + C = 0 - * - * (cdx² + cdy² - dr²)·t² - 2·(cdx·pdx + cdy·pdy + r₁·dr)·t + (pdx² + pdy² - r₁²) = 0 - * - * In other words: - * - * A = cdx² + cdy² - dr² - * B = -2·(pdx·cdx + pdy·cdy + r₁·dr) - * C = pdx² + pdy² - r₁² - * - * And again, notice that A does not depend on p, so can be - * precomputed. From here we just use the quadratic formula to solve - * for t: - * - * t = (-2·B ± ⎷(B² - 4·A·C)) / 2·A - */ - /* radial or conical */ - pixman_bool_t affine = TRUE; - double cx = 1.; - double cy = 0.; - double cz = 0.; - double rx = x + 0.5; - double ry = y + 0.5; - double rz = 1.; - - if (pict->common.transform) { - pixman_vector_t v; - /* reference point is the center of the pixel */ - v.vector[0] = pixman_int_to_fixed(x) + pixman_fixed_1/2; - v.vector[1] = pixman_int_to_fixed(y) + pixman_fixed_1/2; - v.vector[2] = pixman_fixed_1; - if (!pixman_transform_point_3d (pict->common.transform, &v)) - return; - - cx = pict->common.transform->matrix[0][0]/65536.; - cy = pict->common.transform->matrix[1][0]/65536.; - cz = pict->common.transform->matrix[2][0]/65536.; - rx = v.vector[0]/65536.; - ry = v.vector[1]/65536.; - rz = v.vector[2]/65536.; - affine = pict->common.transform->matrix[2][0] == 0 && v.vector[2] == pixman_fixed_1; - } - - if (pict->common.type == RADIAL) { - radial_gradient_t *radial = (radial_gradient_t *)pict; - if (affine) { - while (buffer < end) { - if (!mask || *mask++ & maskBits) - { - double pdx, pdy; - double B, C; - double det; - double c1x = radial->c1.x / 65536.0; - double c1y = radial->c1.y / 65536.0; - double r1 = radial->c1.radius / 65536.0; - pixman_fixed_48_16_t t; - - pdx = rx - c1x; - pdy = ry - c1y; - - B = -2 * ( pdx * radial->cdx - + pdy * radial->cdy - + r1 * radial->dr); - C = (pdx * pdx + pdy * pdy - r1 * r1); - - det = (B * B) - (4 * radial->A * C); - if (det < 0.0) - det = 0.0; - - if (radial->A < 0) - t = (pixman_fixed_48_16_t) ((- B - sqrt(det)) / (2.0 * radial->A) * 65536); - else - t = (pixman_fixed_48_16_t) ((- B + sqrt(det)) / (2.0 * radial->A) * 65536); - - *(buffer) = _gradient_walker_pixel (&walker, t); - } - ++buffer; - - rx += cx; - ry += cy; - } - } else { - /* projective */ - while (buffer < end) { - if (!mask || *mask++ & maskBits) - { - double pdx, pdy; - double B, C; - double det; - double c1x = radial->c1.x / 65536.0; - double c1y = radial->c1.y / 65536.0; - double r1 = radial->c1.radius / 65536.0; - pixman_fixed_48_16_t t; - double x, y; - - if (rz != 0) { - x = rx/rz; - y = ry/rz; - } else { - x = y = 0.; - } - - pdx = x - c1x; - pdy = y - c1y; - - B = -2 * ( pdx * radial->cdx - + pdy * radial->cdy - + r1 * radial->dr); - C = (pdx * pdx + pdy * pdy - r1 * r1); - - det = (B * B) - (4 * radial->A * C); - if (det < 0.0) - det = 0.0; - - if (radial->A < 0) - t = (pixman_fixed_48_16_t) ((- B - sqrt(det)) / (2.0 * radial->A) * 65536); - else - t = (pixman_fixed_48_16_t) ((- B + sqrt(det)) / (2.0 * radial->A) * 65536); - - *(buffer) = _gradient_walker_pixel (&walker, t); - } - ++buffer; - - rx += cx; - ry += cy; - rz += cz; - } - } - } else /* SourcePictTypeConical */ { - conical_gradient_t *conical = (conical_gradient_t *)pict; - double a = conical->angle/(180.*65536); - if (affine) { - rx -= conical->center.x/65536.; - ry -= conical->center.y/65536.; - - while (buffer < end) { - double angle; - - if (!mask || *mask++ & maskBits) - { - pixman_fixed_48_16_t t; - - angle = atan2(ry, rx) + a; - t = (pixman_fixed_48_16_t) (angle * (65536. / (2*M_PI))); - - *(buffer) = _gradient_walker_pixel (&walker, t); - } - - ++buffer; - rx += cx; - ry += cy; - } - } else { - while (buffer < end) { - double x, y; - double angle; - - if (!mask || *mask++ & maskBits) - { - pixman_fixed_48_16_t t; - - if (rz != 0) { - x = rx/rz; - y = ry/rz; - } else { - x = y = 0.; - } - x -= conical->center.x/65536.; - y -= conical->center.y/65536.; - angle = atan2(y, x) + a; - t = (pixman_fixed_48_16_t) (angle * (65536. / (2*M_PI))); - - *(buffer) = _gradient_walker_pixel (&walker, t); - } - - ++buffer; - rx += cx; - ry += cy; - rz += cz; - } - } - } - } -} - -static void fbFetchTransformed(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits) -{ - uint32_t *bits; - int32_t stride; - fetchPixelProc fetch; - pixman_vector_t v; - pixman_vector_t unit; - int i; - pixman_box16_t box; - const pixman_indexed_t * indexed = pict->indexed; - pixman_bool_t affine = TRUE; - - fetch = fetchPixelProcForPicture(pict); - - bits = pict->bits; - stride = pict->rowstride; - - /* reference point is the center of the pixel */ - v.vector[0] = pixman_int_to_fixed(x) + pixman_fixed_1 / 2; - v.vector[1] = pixman_int_to_fixed(y) + pixman_fixed_1 / 2; - v.vector[2] = pixman_fixed_1; - - /* when using convolution filters one might get here without a transform */ - if (pict->common.transform) - { - if (!pixman_transform_point_3d (pict->common.transform, &v)) - { - fbFinishAccess (pict->pDrawable); - return; - } - unit.vector[0] = pict->common.transform->matrix[0][0]; - unit.vector[1] = pict->common.transform->matrix[1][0]; - unit.vector[2] = pict->common.transform->matrix[2][0]; - affine = v.vector[2] == pixman_fixed_1 && unit.vector[2] == 0; - } - else - { - unit.vector[0] = pixman_fixed_1; - unit.vector[1] = 0; - unit.vector[2] = 0; - } - - if (pict->common.filter == PIXMAN_FILTER_NEAREST || pict->common.filter == PIXMAN_FILTER_FAST) - { - if (pict->common.repeat == PIXMAN_REPEAT_NORMAL) { - if (pixman_region_n_rects (pict->common.src_clip) == 1) { - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - if (!v.vector[2]) { - *(buffer + i) = 0; - } else { - if (!affine) { - y = MOD(DIV(v.vector[1],v.vector[2]), pict->height); - x = MOD(DIV(v.vector[0],v.vector[2]), pict->width); - } else { - y = MOD(v.vector[1]>>16, pict->height); - x = MOD(v.vector[0]>>16, pict->width); - } - *(buffer + i) = fetch((pixman_image_t *)pict, bits + y * stride, x, indexed); - } - } - - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } else { - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - if (!v.vector[2]) { - *(buffer + i) = 0; - } else { - if (!affine) { - y = MOD(DIV(v.vector[1],v.vector[2]), pict->height); - x = MOD(DIV(v.vector[0],v.vector[2]), pict->width); - } else { - y = MOD(v.vector[1]>>16, pict->height); - x = MOD(v.vector[0]>>16, pict->width); - } - if (pixman_region_contains_point (pict->common.src_clip, x, y, &box)) - *(buffer + i) = fetch ((pixman_image_t *)pict, bits + y*stride, x, indexed); - else - *(buffer + i) = 0; - } - } - - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } - } else { - if (pixman_region_n_rects(pict->common.src_clip) == 1) { - box = pict->common.src_clip->extents; - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - if (!v.vector[2]) { - *(buffer + i) = 0; - } else { - if (!affine) { - y = DIV(v.vector[1],v.vector[2]); - x = DIV(v.vector[0],v.vector[2]); - } else { - y = v.vector[1]>>16; - x = v.vector[0]>>16; - } - *(buffer + i) = ((x < box.x1) | (x >= box.x2) | (y < box.y1) | (y >= box.y2)) ? - 0 : fetch((pixman_image_t *)pict, bits + (y)*stride, x, indexed); - } - } - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } else { - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - if (!v.vector[2]) { - *(buffer + i) = 0; - } else { - if (!affine) { - y = DIV(v.vector[1],v.vector[2]); - x = DIV(v.vector[0],v.vector[2]); - } else { - y = v.vector[1]>>16; - x = v.vector[0]>>16; - } - if (pixman_region_contains_point (pict->common.src_clip, x, y, &box)) - *(buffer + i) = fetch((pixman_image_t *)pict, bits + y*stride, x, indexed); - else - *(buffer + i) = 0; - } - } - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } - } - } else if (pict->common.filter == PIXMAN_FILTER_BILINEAR || - pict->common.filter == PIXMAN_FILTER_GOOD || - pict->common.filter == PIXMAN_FILTER_BEST) - { - /* adjust vector for maximum contribution at 0.5, 0.5 of each texel. */ - v.vector[0] -= v.vector[2] / 2; - v.vector[1] -= v.vector[2] / 2; - unit.vector[0] -= unit.vector[2] / 2; - unit.vector[1] -= unit.vector[2] / 2; - - if (pict->common.repeat == PIXMAN_REPEAT_NORMAL) { - if (pixman_region_n_rects(pict->common.src_clip) == 1) { - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - if (!v.vector[2]) { - *(buffer + i) = 0; - } else { - int x1, x2, y1, y2, distx, idistx, disty, idisty; - uint32_t *b; - uint32_t tl, tr, bl, br, r; - uint32_t ft, fb; - - if (!affine) { - pixman_fixed_48_16_t div; - div = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2]; - x1 = div >> 16; - distx = ((pixman_fixed_t)div >> 8) & 0xff; - div = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2]; - y1 = div >> 16; - disty = ((pixman_fixed_t)div >> 8) & 0xff; - } else { - x1 = v.vector[0] >> 16; - distx = (v.vector[0] >> 8) & 0xff; - y1 = v.vector[1] >> 16; - disty = (v.vector[1] >> 8) & 0xff; - } - x2 = x1 + 1; - y2 = y1 + 1; - - idistx = 256 - distx; - idisty = 256 - disty; - - x1 = MOD (x1, pict->width); - x2 = MOD (x2, pict->width); - y1 = MOD (y1, pict->height); - y2 = MOD (y2, pict->height); - - b = bits + y1*stride; - - tl = fetch((pixman_image_t *)pict, b, x1, indexed); - tr = fetch((pixman_image_t *)pict, b, x2, indexed); - b = bits + y2*stride; - bl = fetch((pixman_image_t *)pict, b, x1, indexed); - br = fetch((pixman_image_t *)pict, b, x2, indexed); - - ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; - fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx; - r = (((ft * idisty + fb * disty) >> 16) & 0xff); - ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx; - fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx; - r |= (((ft * idisty + fb * disty) >> 8) & 0xff00); - ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx; - fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx; - r |= (((ft * idisty + fb * disty)) & 0xff0000); - ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx; - fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx; - r |= (((ft * idisty + fb * disty) << 8) & 0xff000000); - *(buffer + i) = r; - } - } - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } else { - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - if (!v.vector[2]) { - *(buffer + i) = 0; - } else { - int x1, x2, y1, y2, distx, idistx, disty, idisty; - uint32_t *b; - uint32_t tl, tr, bl, br, r; - uint32_t ft, fb; - - if (!affine) { - pixman_fixed_48_16_t div; - div = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2]; - x1 = div >> 16; - distx = ((pixman_fixed_t)div >> 8) & 0xff; - div = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2]; - y1 = div >> 16; - disty = ((pixman_fixed_t)div >> 8) & 0xff; - } else { - x1 = v.vector[0] >> 16; - distx = (v.vector[0] >> 8) & 0xff; - y1 = v.vector[1] >> 16; - disty = (v.vector[1] >> 8) & 0xff; - } - x2 = x1 + 1; - y2 = y1 + 1; - - idistx = 256 - distx; - idisty = 256 - disty; - - x1 = MOD (x1, pict->width); - x2 = MOD (x2, pict->width); - y1 = MOD (y1, pict->height); - y2 = MOD (y2, pict->height); - - b = bits + y1*stride; - - tl = pixman_region_contains_point(pict->common.src_clip, x1, y1, &box) - ? fetch((pixman_image_t *)pict, b, x1, indexed) : 0; - tr = pixman_region_contains_point(pict->common.src_clip, x2, y1, &box) - ? fetch((pixman_image_t *)pict, b, x2, indexed) : 0; - b = bits + (y2)*stride; - bl = pixman_region_contains_point(pict->common.src_clip, x1, y2, &box) - ? fetch((pixman_image_t *)pict, b, x1, indexed) : 0; - br = pixman_region_contains_point(pict->common.src_clip, x2, y2, &box) - ? fetch((pixman_image_t *)pict, b, x2, indexed) : 0; - - ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; - fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx; - r = (((ft * idisty + fb * disty) >> 16) & 0xff); - ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx; - fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx; - r |= (((ft * idisty + fb * disty) >> 8) & 0xff00); - ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx; - fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx; - r |= (((ft * idisty + fb * disty)) & 0xff0000); - ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx; - fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx; - r |= (((ft * idisty + fb * disty) << 8) & 0xff000000); - *(buffer + i) = r; - } - } - - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } - } else { - if (pixman_region_n_rects(pict->common.src_clip) == 1) { - box = pict->common.src_clip->extents; - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - if (!v.vector[2]) { - *(buffer + i) = 0; - } else { - int x1, x2, y1, y2, distx, idistx, disty, idisty, x_off; - uint32_t *b; - uint32_t tl, tr, bl, br, r; - pixman_bool_t x1_out, x2_out, y1_out, y2_out; - uint32_t ft, fb; - - if (!affine) { - pixman_fixed_48_16_t div; - div = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2]; - x1 = div >> 16; - distx = ((pixman_fixed_t)div >> 8) & 0xff; - div = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2]; - y1 = div >> 16; - disty = ((pixman_fixed_t)div >> 8) & 0xff; - } else { - x1 = v.vector[0] >> 16; - distx = (v.vector[0] >> 8) & 0xff; - y1 = v.vector[1] >> 16; - disty = (v.vector[1] >> 8) & 0xff; - } - x2 = x1 + 1; - y2 = y1 + 1; - - idistx = 256 - distx; - idisty = 256 - disty; - - b = bits + (y1)*stride; - x_off = x1; - - x1_out = (x1 < box.x1) | (x1 >= box.x2); - x2_out = (x2 < box.x1) | (x2 >= box.x2); - y1_out = (y1 < box.y1) | (y1 >= box.y2); - y2_out = (y2 < box.y1) | (y2 >= box.y2); - - tl = x1_out|y1_out ? 0 : fetch((pixman_image_t *)pict, b, x_off, indexed); - tr = x2_out|y1_out ? 0 : fetch((pixman_image_t *)pict, b, x_off + 1, indexed); - b += stride; - bl = x1_out|y2_out ? 0 : fetch((pixman_image_t *)pict, b, x_off, indexed); - br = x2_out|y2_out ? 0 : fetch((pixman_image_t *)pict, b, x_off + 1, indexed); - - ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; - fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx; - r = (((ft * idisty + fb * disty) >> 16) & 0xff); - ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx; - fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx; - r |= (((ft * idisty + fb * disty) >> 8) & 0xff00); - ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx; - fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx; - r |= (((ft * idisty + fb * disty)) & 0xff0000); - ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx; - fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx; - r |= (((ft * idisty + fb * disty) << 8) & 0xff000000); - *(buffer + i) = r; - } - } - - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } else { - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - if (!v.vector[2]) { - *(buffer + i) = 0; - } else { - int x1, x2, y1, y2, distx, idistx, disty, idisty, x_off; - uint32_t *b; - uint32_t tl, tr, bl, br, r; - uint32_t ft, fb; - - if (!affine) { - pixman_fixed_48_16_t div; - div = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2]; - x1 = div >> 16; - distx = ((pixman_fixed_t)div >> 8) & 0xff; - div = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2]; - y1 = div >> 16; - disty = ((pixman_fixed_t)div >> 8) & 0xff; - } else { - x1 = v.vector[0] >> 16; - distx = (v.vector[0] >> 8) & 0xff; - y1 = v.vector[1] >> 16; - disty = (v.vector[1] >> 8) & 0xff; - } - x2 = x1 + 1; - y2 = y1 + 1; - - idistx = 256 - distx; - idisty = 256 - disty; - - b = bits + (y1)*stride; - x_off = x1; - - tl = pixman_region_contains_point(pict->common.src_clip, x1, y1, &box) - ? fetch((pixman_image_t *)pict, b, x_off, indexed) : 0; - tr = pixman_region_contains_point(pict->common.src_clip, x2, y1, &box) - ? fetch((pixman_image_t *)pict, b, x_off + 1, indexed) : 0; - b += stride; - bl = pixman_region_contains_point(pict->common.src_clip, x1, y2, &box) - ? fetch((pixman_image_t *)pict, b, x_off, indexed) : 0; - br = pixman_region_contains_point(pict->common.src_clip, x2, y2, &box) - ? fetch((pixman_image_t *)pict, b, x_off + 1, indexed) : 0; - - ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; - fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx; - r = (((ft * idisty + fb * disty) >> 16) & 0xff); - ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx; - fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx; - r |= (((ft * idisty + fb * disty) >> 8) & 0xff00); - ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx; - fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx; - r |= (((ft * idisty + fb * disty)) & 0xff0000); - ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx; - fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx; - r |= (((ft * idisty + fb * disty) << 8) & 0xff000000); - *(buffer + i) = r; - } - } - - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } - } - } else if (pict->common.filter == PIXMAN_FILTER_CONVOLUTION) { - pixman_fixed_t *params = pict->common.filter_params; - int32_t cwidth = pixman_fixed_to_int(params[0]); - int32_t cheight = pixman_fixed_to_int(params[1]); - int xoff = (params[0] - pixman_fixed_1) >> 1; - int yoff = (params[1] - pixman_fixed_1) >> 1; - params += 2; - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - if (!v.vector[2]) { - *(buffer + i) = 0; - } else { - int x1, x2, y1, y2, x, y; - int32_t srtot, sgtot, sbtot, satot; - pixman_fixed_t *p = params; - - if (!affine) { - pixman_fixed_48_16_t tmp; - tmp = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2] - xoff; - x1 = pixman_fixed_to_int(tmp); - tmp = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2] - yoff; - y1 = pixman_fixed_to_int(tmp); - } else { - x1 = pixman_fixed_to_int(v.vector[0] - xoff); - y1 = pixman_fixed_to_int(v.vector[1] - yoff); - } - x2 = x1 + cwidth; - y2 = y1 + cheight; - - srtot = sgtot = sbtot = satot = 0; - - for (y = y1; y < y2; y++) { - int ty = (pict->common.repeat == PIXMAN_REPEAT_NORMAL) ? MOD (y, pict->height) : y; - for (x = x1; x < x2; x++) { - if (*p) { - int tx = (pict->common.repeat == PIXMAN_REPEAT_NORMAL) ? MOD (x, pict->width) : x; - if (pixman_region_contains_point (pict->common.src_clip, tx, ty, &box)) { - uint32_t *b = bits + (ty)*stride; - uint32_t c = fetch((pixman_image_t *)pict, b, tx, indexed); - - srtot += Red(c) * *p; - sgtot += Green(c) * *p; - sbtot += Blue(c) * *p; - satot += Alpha(c) * *p; - } - } - p++; - } - } - - satot >>= 16; - srtot >>= 16; - sgtot >>= 16; - sbtot >>= 16; - - if (satot < 0) satot = 0; else if (satot > 0xff) satot = 0xff; - if (srtot < 0) srtot = 0; else if (srtot > 0xff) srtot = 0xff; - if (sgtot < 0) sgtot = 0; else if (sgtot > 0xff) sgtot = 0xff; - if (sbtot < 0) sbtot = 0; else if (sbtot > 0xff) sbtot = 0xff; - - *(buffer + i) = ((satot << 24) | - (srtot << 16) | - (sgtot << 8) | - (sbtot )); - } - } - v.vector[0] += unit.vector[0]; - v.vector[1] += unit.vector[1]; - v.vector[2] += unit.vector[2]; - } - } - - fbFinishAccess (pict->pDrawable); -} - - -static void fbFetchExternalAlpha(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits) -{ - int i; - uint32_t _alpha_buffer[SCANLINE_BUFFER_LENGTH]; - uint32_t *alpha_buffer = _alpha_buffer; - - if (!pict->common.alpha_map) { - fbFetchTransformed (pict, x, y, width, buffer, mask, maskBits); - return; - } - if (width > SCANLINE_BUFFER_LENGTH) - alpha_buffer = (uint32_t *) pixman_malloc_ab (width, sizeof(uint32_t)); - - fbFetchTransformed(pict, x, y, width, buffer, mask, maskBits); - fbFetchTransformed((bits_image_t *)pict->common.alpha_map, x - pict->common.alpha_origin.x, - y - pict->common.alpha_origin.y, width, alpha_buffer, - mask, maskBits); - for (i = 0; i < width; ++i) { - if (!mask || mask[i] & maskBits) - { - int a = alpha_buffer[i]>>24; - *(buffer + i) = (a << 24) - | (div_255(Red(*(buffer + i)) * a) << 16) - | (div_255(Green(*(buffer + i)) * a) << 8) - | (div_255(Blue(*(buffer + i)) * a)); - } - } - - if (alpha_buffer != _alpha_buffer) - free(alpha_buffer); -} - -static void fbStore(bits_image_t * pict, int x, int y, int width, uint32_t *buffer) +fbStore(bits_image_t * pict, int x, int y, int width, uint32_t *buffer) { uint32_t *bits; int32_t stride; - storeProc store = storeProcForPicture(pict); + storeProc store = STORE_PROC_FOR_PICTURE(pict); const pixman_indexed_t * indexed = pict->indexed; - - bits = pict->bits; - stride = pict->rowstride; - bits += y*stride; - store((pixman_image_t *)pict, bits, buffer, x, width, indexed); - fbFinishAccess (pict->pDrawable); -} -static void fbStoreExternalAlpha(bits_image_t * pict, int x, int y, int width, uint32_t *buffer) -{ - uint32_t *bits, *alpha_bits; - int32_t stride, astride; - int ax, ay; - storeProc store; - storeProc astore; - const pixman_indexed_t * indexed = pict->indexed; - const pixman_indexed_t * aindexed; - - if (!pict->common.alpha_map) { - fbStore(pict, x, y, width, buffer); - return; - } - - store = storeProcForPicture(pict); - astore = storeProcForPicture(pict->common.alpha_map); - aindexed = pict->common.alpha_map->indexed; - - ax = x; - ay = y; - bits = pict->bits; stride = pict->rowstride; - - alpha_bits = pict->common.alpha_map->bits; - astride = pict->common.alpha_map->rowstride; - - bits += y*stride; - alpha_bits += (ay - pict->common.alpha_origin.y)*astride; - - + bits += y*stride; store((pixman_image_t *)pict, bits, buffer, x, width, indexed); - astore((pixman_image_t *)pict->common.alpha_map, - alpha_bits, buffer, ax - pict->common.alpha_origin.x, width, aindexed); - - fbFinishAccess (pict->alpha_map->pDrawable); - fbFinishAccess (pict->pDrawable); } typedef void (*scanStoreProc)(pixman_image_t *, int, int, int, uint32_t *); @@ -4165,7 +186,7 @@ uint32_t *bits; int32_t stride; int xoff, yoff; - + if (data->op == PIXMAN_OP_CLEAR) fetchSrc = NULL; else if (IS_SOURCE_IMAGE (data->src)) @@ -4178,28 +199,29 @@ else { bits_image_t *bits = (bits_image_t *)data->src; - + if (bits->common.alpha_map) { - fetchSrc = (scanFetchProc)fbFetchExternalAlpha; + fetchSrc = (scanFetchProc)FB_FETCH_EXTERNAL_ALPHA; } - else if (bits->common.repeat == PIXMAN_REPEAT_NORMAL && + else if ((bits->common.repeat == PIXMAN_REPEAT_NORMAL || bits->common.repeat == PIXMAN_REPEAT_PAD) && bits->width == 1 && bits->height == 1) { fetchSrc = (scanFetchProc)fbFetchSolid; srcClass = SOURCE_IMAGE_CLASS_HORIZONTAL; } - else if (!bits->common.transform && bits->common.filter != PIXMAN_FILTER_CONVOLUTION) + else if (!bits->common.transform && bits->common.filter != PIXMAN_FILTER_CONVOLUTION + && bits->common.repeat != PIXMAN_REPEAT_PAD) { fetchSrc = (scanFetchProc)fbFetch; } else { - fetchSrc = (scanFetchProc)fbFetchTransformed; + fetchSrc = (scanFetchProc)FB_FETCH_TRANSFORMED; } } - + if (!data->mask || data->op == PIXMAN_OP_CLEAR) { fetchMask = NULL; @@ -4216,29 +238,30 @@ else { bits_image_t *bits = (bits_image_t *)data->mask; - + if (bits->common.alpha_map) { - fetchMask = (scanFetchProc)fbFetchExternalAlpha; + fetchMask = (scanFetchProc)FB_FETCH_EXTERNAL_ALPHA; } - else if (bits->common.repeat == PIXMAN_REPEAT_NORMAL && + else if ((bits->common.repeat == PIXMAN_REPEAT_NORMAL || bits->common.repeat == PIXMAN_REPEAT_PAD) && bits->width == 1 && bits->height == 1) { fetchMask = (scanFetchProc)fbFetchSolid; maskClass = SOURCE_IMAGE_CLASS_HORIZONTAL; } - else if (!bits->common.transform && bits->common.filter != PIXMAN_FILTER_CONVOLUTION) + else if (!bits->common.transform && bits->common.filter != PIXMAN_FILTER_CONVOLUTION + && bits->common.repeat != PIXMAN_REPEAT_PAD) fetchMask = (scanFetchProc)fbFetch; else - fetchMask = (scanFetchProc)fbFetchTransformed; + fetchMask = (scanFetchProc)FB_FETCH_TRANSFORMED; } } - + if (data->dest->common.alpha_map) { - fetchDest = (scanFetchProc)fbFetchExternalAlpha; - store = (scanStoreProc)fbStoreExternalAlpha; - + fetchDest = (scanFetchProc)FB_FETCH_EXTERNAL_ALPHA; + store = (scanStoreProc)FB_STORE_EXTERNAL_ALPHA; + if (data->op == PIXMAN_OP_CLEAR || data->op == PIXMAN_OP_SRC) fetchDest = NULL; } @@ -4246,7 +269,7 @@ { fetchDest = (scanFetchProc)fbFetch; store = (scanStoreProc)fbStore; - + switch (data->op) { case PIXMAN_OP_CLEAR: @@ -4268,7 +291,7 @@ break; } } - + if (!store) { bits = data->dest->bits.bits; @@ -4281,11 +304,11 @@ stride = 0; xoff = yoff = 0; } - + if (fetchSrc && fetchMask && data->mask && - data->mask->common.type == BITS && + data->mask->common.type == BITS && data->mask->common.component_alpha && PIXMAN_FORMAT_RGB (data->mask->bits.format)) { @@ -4293,7 +316,7 @@ CombineFuncC compose = PIXMAN_COMPOSE_FUNCTIONS.combineC[data->op]; if (!compose) return; - + for (i = 0; i < data->height; ++i) { /* fill first half of scanline with source */ if (fetchSrc) @@ -4304,11 +327,11 @@ source can be optimized */ fetchMask (data->mask, data->xMask, data->yMask + i, data->width, mask_buffer, 0, 0); - + if (maskClass == SOURCE_IMAGE_CLASS_HORIZONTAL) fetchMask = NULL; } - + if (srcClass == SOURCE_IMAGE_CLASS_HORIZONTAL) { fetchSrc (data->src, data->xSrc, data->ySrc + i, @@ -4327,17 +350,17 @@ fetchMask (data->mask, data->xMask, data->yMask + i, data->width, mask_buffer, 0, 0); } - + if (store) { /* fill dest into second half of scanline */ if (fetchDest) fetchDest (data->dest, data->xDest, data->yDest + i, data->width, dest_buffer, 0, 0); - + /* blend */ compose (dest_buffer, src_buffer, mask_buffer, data->width); - + /* write back */ store (data->dest, data->xDest, data->yDest + i, data->width, dest_buffer); @@ -4357,10 +380,10 @@ CombineFuncU compose = PIXMAN_COMPOSE_FUNCTIONS.combineU[data->op]; if (!compose) return; - + if (fetchMask) mask_buffer = dest_buffer + data->width; - + for (i = 0; i < data->height; ++i) { /* fill first half of scanline with source */ if (fetchSrc) @@ -4371,24 +394,24 @@ source can be optimized */ fetchMask (data->mask, data->xMask, data->yMask + i, data->width, mask_buffer, 0, 0); - + if (maskClass == SOURCE_IMAGE_CLASS_HORIZONTAL) fetchMask = NULL; } - + if (srcClass == SOURCE_IMAGE_CLASS_HORIZONTAL) { fetchSrc (data->src, data->xSrc, data->ySrc + i, data->width, src_buffer, 0, 0); - + if (mask_buffer) { - fbCombineInU (mask_buffer, src_buffer, data->width); + PIXMAN_COMPOSE_FUNCTIONS.combineU[PIXMAN_OP_IN] (mask_buffer, src_buffer, data->width); src_mask_buffer = mask_buffer; } else src_mask_buffer = src_buffer; - + fetchSrc = NULL; } else @@ -4396,12 +419,12 @@ fetchSrc (data->src, data->xSrc, data->ySrc + i, data->width, src_buffer, mask_buffer, 0xff000000); - + if (mask_buffer) PIXMAN_COMPOSE_FUNCTIONS.combineMaskU (src_buffer, mask_buffer, data->width); - + src_mask_buffer = src_buffer; } } @@ -4409,22 +432,22 @@ { fetchMask (data->mask, data->xMask, data->yMask + i, data->width, mask_buffer, 0, 0); - - fbCombineInU (mask_buffer, src_buffer, data->width); - + + PIXMAN_COMPOSE_FUNCTIONS.combineU[PIXMAN_OP_IN] (mask_buffer, src_buffer, data->width); + src_mask_buffer = mask_buffer; } - + if (store) { /* fill dest into second half of scanline */ if (fetchDest) fetchDest (data->dest, data->xDest, data->yDest + i, data->width, dest_buffer, 0, 0); - + /* blend */ compose (dest_buffer, src_mask_buffer, data->width); - + /* write back */ store (data->dest, data->xDest, data->yDest + i, data->width, dest_buffer); @@ -4438,9 +461,6 @@ } } } - - if (!store) - fbFinishAccess (data->dest->pDrawable); } #ifndef PIXMAN_FB_ACCESSORS diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-edge.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-edge.c --- pixman-0.9.6/pixman/pixman-edge.c 2007-09-13 21:51:08.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-edge.c 2008-02-22 18:57:37.000000000 +0100 @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2004 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -27,7 +25,7 @@ #endif #include -#include "pixman.h" + #include "pixman-private.h" #ifdef PIXMAN_FB_ACCESSORS @@ -58,10 +56,10 @@ #define StepAlpha ((__ap += __ao), (__ao ^= 1)) -#define AddAlpha(a) { \ - uint8_t __o = READ(__ap); \ - uint8_t __a = (a) + Get4(__o, __ao); \ - WRITE(__ap, Put4 (__o, __ao, __a | (0 - ((__a) >> 4)))); \ +#define AddAlpha(a) { \ + uint8_t __o = READ(image, __ap); \ + uint8_t __a = (a) + Get4(__o, __ao); \ + WRITE(image, __ap, Put4 (__o, __ao, __a | (0 - ((__a) >> 4)))); \ } #include "pixman-edge-imp.h" @@ -104,7 +102,7 @@ \ while (i__--) \ { \ - WRITE((buf__), clip255 (READ((buf__)) + (val__))); \ + WRITE(image, (buf__), clip255 (READ(image, (buf__)) + (val__))); \ (buf__)++; \ } \ } while (0) @@ -131,51 +129,55 @@ uint32_t *line; int fill_start = -1, fill_end = -1; int fill_size = 0; - uint32_t *buf = (image)->bits.bits; - int32_t stride = (image)->bits.rowstride; - int32_t width = (image)->bits.width; - + uint32_t *buf = (image)->bits.bits; + int stride = (image)->bits.rowstride; + int width = (image)->bits.width; + line = buf + pixman_fixed_to_int (y) * stride; - + for (;;) { uint8_t *ap = (uint8_t *) line; pixman_fixed_t lx, rx; int lxi, rxi; - + /* clip X */ lx = l->x; if (lx < 0) lx = 0; rx = r->x; if (pixman_fixed_to_int (rx) >= width) - rx = pixman_int_to_fixed (width); - + /* Use the last pixel of the scanline, covered 100%. + * We can't use the first pixel following the scanline, + * because accessing it could result in a buffer overrun. + */ + rx = pixman_int_to_fixed (width) - 1; + /* Skip empty (or backwards) sections */ if (rx > lx) { int lxs, rxs; - + /* Find pixel bounds for span. */ lxi = pixman_fixed_to_int (lx); rxi = pixman_fixed_to_int (rx); - + /* Sample coverage for edge pixels */ lxs = RenderSamplesX (lx, 8); rxs = RenderSamplesX (rx, 8); - + /* Add coverage across row */ if (lxi == rxi) { - WRITE(ap +lxi, clip255 (READ(ap + lxi) + rxs - lxs)); + WRITE(image, ap +lxi, clip255 (READ(image, ap + lxi) + rxs - lxs)); } else { - WRITE(ap + lxi, clip255 (READ(ap + lxi) + N_X_FRAC(8) - lxs)); - + WRITE(image, ap + lxi, clip255 (READ(image, ap + lxi) + N_X_FRAC(8) - lxs)); + /* Move forward so that lxi/rxi is the pixel span */ lxi++; - + /* Don't bother trying to optimize the fill unless * the span is longer than 4 pixels. */ if (rxi - lxi > 4) @@ -213,7 +215,7 @@ add_saturate_8 (ap + lxi, N_X_FRAC(8), fill_start - lxi); } - + /* Update fill_end */ if (rxi < fill_end) { @@ -236,21 +238,17 @@ { add_saturate_8 (ap + lxi, N_X_FRAC(8), rxi - lxi); } - - /* Do not add in a 0 alpha here. This check is - * necessary to avoid a buffer overrun, (when rx - * is exactly on a pixel boundary). */ - if (rxs) - WRITE(ap + rxi, clip255 (READ(ap + rxi) + rxs)); + + WRITE(image, ap + rxi, clip255 (READ(image, ap + rxi) + rxs)); } } - + if (y == b) { /* We're done, make sure we clean up any remaining fill. */ if (fill_start != fill_end) { if (fill_size == N_Y_FRAC(8)) { - MEMSET_WRAPPED (ap + fill_start, 0xff, fill_end - fill_start); + MEMSET_WRAPPED (image, ap + fill_start, 0xff, fill_end - fill_start); } else { @@ -260,7 +258,7 @@ } break; } - + if (pixman_fixed_frac (y) != Y_FRAC_LAST(8)) { RenderEdgeStepSmall (l); @@ -276,7 +274,7 @@ { if (fill_size == N_Y_FRAC(8)) { - MEMSET_WRAPPED (ap + fill_start, 0xff, fill_end - fill_start); + MEMSET_WRAPPED (image, ap + fill_start, 0xff, fill_end - fill_start); } else { diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-edge-imp.h /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-edge-imp.h --- pixman-0.9.6/pixman/pixman-edge-imp.h 2007-09-13 21:50:10.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-edge-imp.h 2008-02-22 18:57:37.000000000 +0100 @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2004 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -35,34 +33,49 @@ pixman_fixed_t y = t; uint32_t *line; uint32_t *buf = (image)->bits.bits; - int32_t stride = (image)->bits.rowstride; - int32_t width = (image)->bits.width; - + int stride = (image)->bits.rowstride; + int width = (image)->bits.width; + line = buf + pixman_fixed_to_int (y) * stride; - + for (;;) { pixman_fixed_t lx; pixman_fixed_t rx; int lxi; int rxi; - - /* clip X */ + lx = l->x; + rx = r->x; +#if N_BITS == 1 + /* For the non-antialiased case, round the coordinates up, in effect + * sampling the center of the pixel. (The AA case does a similar + * adjustment in RenderSamplesX) */ + lx += X_FRAC_FIRST(1); + rx += X_FRAC_FIRST(1); +#endif + /* clip X */ if (lx < 0) lx = 0; - rx = r->x; if (pixman_fixed_to_int (rx) >= width) +#if N_BITS == 1 rx = pixman_int_to_fixed (width); - +#else + /* Use the last pixel of the scanline, covered 100%. + * We can't use the first pixel following the scanline, + * because accessing it could result in a buffer overrun. + */ + rx = pixman_int_to_fixed (width) - 1; +#endif + /* Skip empty (or backwards) sections */ if (rx > lx) { - + /* Find pixel bounds for span */ lxi = pixman_fixed_to_int (lx); rxi = pixman_fixed_to_int (rx); - + #if N_BITS == 1 { uint32_t *a = line; @@ -71,30 +84,30 @@ int nmiddle; int width = rxi - lxi; int x = lxi; - + a += x >> FB_SHIFT; x &= FB_MASK; - + FbMaskBits (x, width, startmask, nmiddle, endmask); if (startmask) { - WRITE(a, READ(a) | startmask); + WRITE(image, a, READ(image, a) | startmask); a++; } while (nmiddle--) - WRITE(a++, FB_ALLONES); + WRITE(image, a++, FB_ALLONES); if (endmask) - WRITE(a, READ(a) | endmask); + WRITE(image, a, READ(image, a) | endmask); } #else { DefineAlpha(line,lxi); int lxs; int rxs; - + /* Sample coverage for edge pixels */ lxs = RenderSamplesX (lx, N_BITS); rxs = RenderSamplesX (rx, N_BITS); - + /* Add coverage across row */ if (lxi == rxi) { @@ -103,7 +116,7 @@ else { int xi; - + AddAlpha (N_X_FRAC(N_BITS) - lxs); StepAlpha; for (xi = lxi + 1; xi < rxi; xi++) @@ -111,20 +124,15 @@ AddAlpha (N_X_FRAC(N_BITS)); StepAlpha; } - /* Do not add in a 0 alpha here. This check is necessary - * to avoid a buffer overrun when rx is exactly on a pixel - * boundary. - */ - if (rxs != 0) - AddAlpha (rxs); + AddAlpha (rxs); } } #endif } - + if (y == b) break; - + #if N_BITS > 1 if (pixman_fixed_frac (y) != Y_FRAC_LAST(N_BITS)) { diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman.h /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman.h --- pixman-0.9.6/pixman/pixman.h 2007-10-24 18:30:17.000000000 +0200 +++ pixman-0.10.0/pixman/pixman.h 2008-03-27 11:58:20.000000000 +0100 @@ -69,6 +69,8 @@ #ifndef PIXMAN_H__ #define PIXMAN_H__ +#include + /* * Standard integers */ @@ -90,6 +92,13 @@ # include #endif +/* GCC visibility */ +#if defined(__GNUC__) && __GNUC__ >= 4 +#define PIXMAN_EXPORT __attribute__ ((visibility("default"))) +#else +#define PIXMAN_EXPORT +#endif + /* * Boolean */ @@ -158,6 +167,7 @@ pixman_fixed_t matrix[3][3]; }; +PIXMAN_EXPORT pixman_bool_t pixman_transform_point_3d (pixman_transform_t *transform, pixman_vector_t *vector); @@ -221,7 +231,9 @@ PIXMAN_OP_CONJOINT_OUT_REVERSE = 0x28, PIXMAN_OP_CONJOINT_ATOP = 0x29, PIXMAN_OP_CONJOINT_ATOP_REVERSE = 0x2a, - PIXMAN_OP_CONJOINT_XOR = 0x2b + PIXMAN_OP_CONJOINT_XOR = 0x2b, + + PIXMAN_OP_NONE } pixman_op_t; /* @@ -262,65 +274,94 @@ PIXMAN_REGION_PART } pixman_region_overlap_t; +PIXMAN_EXPORT +int pixman_version (void); + +PIXMAN_EXPORT +const char* pixman_version_string (void); + /* This function exists only to make it possible to preserve the X ABI - it should * go away at first opportunity. */ +PIXMAN_EXPORT void pixman_region_set_static_pointers (pixman_box16_t *empty_box, pixman_region16_data_t *empty_data, pixman_region16_data_t *broken_data); /* creation/destruction */ +PIXMAN_EXPORT void pixman_region_init (pixman_region16_t *region); +PIXMAN_EXPORT void pixman_region_init_rect (pixman_region16_t *region, int x, int y, unsigned int width, unsigned int height); +PIXMAN_EXPORT void pixman_region_init_with_extents (pixman_region16_t *region, pixman_box16_t *extents); +PIXMAN_EXPORT void pixman_region_fini (pixman_region16_t *region); /* manipulation */ +PIXMAN_EXPORT void pixman_region_translate (pixman_region16_t *region, int x, int y); +PIXMAN_EXPORT pixman_bool_t pixman_region_copy (pixman_region16_t *dest, pixman_region16_t *source); +PIXMAN_EXPORT pixman_bool_t pixman_region_intersect (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_region16_t *reg2); +PIXMAN_EXPORT pixman_bool_t pixman_region_union (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_region16_t *reg2); +PIXMAN_EXPORT pixman_bool_t pixman_region_union_rect (pixman_region16_t *dest, pixman_region16_t *source, int x, int y, unsigned int width, unsigned int height); +PIXMAN_EXPORT pixman_bool_t pixman_region_subtract (pixman_region16_t *regD, pixman_region16_t *regM, pixman_region16_t *regS); +PIXMAN_EXPORT pixman_bool_t pixman_region_inverse (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_box16_t *invRect); +PIXMAN_EXPORT pixman_bool_t pixman_region_contains_point (pixman_region16_t *region, int x, int y, pixman_box16_t *box); +PIXMAN_EXPORT pixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *pixman_region16_t, pixman_box16_t *prect); +PIXMAN_EXPORT pixman_bool_t pixman_region_not_empty (pixman_region16_t *region); +PIXMAN_EXPORT pixman_box16_t * pixman_region_extents (pixman_region16_t *region); +PIXMAN_EXPORT int pixman_region_n_rects (pixman_region16_t *region); +PIXMAN_EXPORT pixman_box16_t * pixman_region_rectangles (pixman_region16_t *region, int *n_rects); +PIXMAN_EXPORT pixman_bool_t pixman_region_equal (pixman_region16_t *region1, pixman_region16_t *region2); +PIXMAN_EXPORT pixman_bool_t pixman_region_selfcheck (pixman_region16_t *region); +PIXMAN_EXPORT void pixman_region_reset (pixman_region16_t *region, pixman_box16_t *box); +PIXMAN_EXPORT pixman_bool_t pixman_region_init_rects (pixman_region16_t *region, pixman_box16_t *boxes, int count); /* Copy / Fill */ +PIXMAN_EXPORT pixman_bool_t pixman_blt (uint32_t *src_bits, uint32_t *dst_bits, int src_stride, @@ -330,6 +371,7 @@ int src_x, int src_y, int dst_x, int dst_y, int width, int height); +PIXMAN_EXPORT pixman_bool_t pixman_fill (uint32_t *bits, int stride, int bpp, @@ -337,7 +379,7 @@ int y, int width, int height, - uint32_t xor); + uint32_t _xor); /* * Images */ @@ -397,6 +439,8 @@ #define PIXMAN_TYPE_ABGR 3 #define PIXMAN_TYPE_COLOR 4 #define PIXMAN_TYPE_GRAY 5 +#define PIXMAN_TYPE_YUY2 6 +#define PIXMAN_TYPE_YV12 7 #define PIXMAN_FORMAT_COLOR(f) (PIXMAN_FORMAT_TYPE(f) & 2) @@ -452,25 +496,41 @@ /* 1bpp formats */ PIXMAN_a1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_A,1,0,0,0), - PIXMAN_g1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_GRAY,0,0,0,0) + PIXMAN_g1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_GRAY,0,0,0,0), + +/* YUV formats */ + PIXMAN_yuy2 = PIXMAN_FORMAT(16,PIXMAN_TYPE_YUY2,0,0,0,0), + PIXMAN_yv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0), } pixman_format_code_t; +/* Querying supported format values. */ +PIXMAN_EXPORT +pixman_bool_t pixman_format_supported_destination (pixman_format_code_t format); + +PIXMAN_EXPORT +pixman_bool_t pixman_format_supported_source (pixman_format_code_t format); + /* Constructors */ +PIXMAN_EXPORT pixman_image_t *pixman_image_create_solid_fill (pixman_color_t *color); +PIXMAN_EXPORT pixman_image_t *pixman_image_create_linear_gradient (pixman_point_fixed_t *p1, pixman_point_fixed_t *p2, const pixman_gradient_stop_t *stops, int n_stops); +PIXMAN_EXPORT pixman_image_t *pixman_image_create_radial_gradient (pixman_point_fixed_t *inner, pixman_point_fixed_t *outer, pixman_fixed_t inner_radius, pixman_fixed_t outer_radius, const pixman_gradient_stop_t *stops, int n_stops); +PIXMAN_EXPORT pixman_image_t *pixman_image_create_conical_gradient (pixman_point_fixed_t *center, pixman_fixed_t angle, const pixman_gradient_stop_t *stops, int n_stops); +PIXMAN_EXPORT pixman_image_t *pixman_image_create_bits (pixman_format_code_t format, int width, int height, @@ -478,44 +538,63 @@ int rowstride_bytes); /* Destructor */ +PIXMAN_EXPORT pixman_image_t *pixman_image_ref (pixman_image_t *image); +PIXMAN_EXPORT pixman_bool_t pixman_image_unref (pixman_image_t *image); /* Set properties */ +PIXMAN_EXPORT pixman_bool_t pixman_image_set_clip_region (pixman_image_t *image, pixman_region16_t *region); +PIXMAN_EXPORT void pixman_image_set_has_client_clip (pixman_image_t *image, pixman_bool_t clien_clip); +PIXMAN_EXPORT pixman_bool_t pixman_image_set_transform (pixman_image_t *image, const pixman_transform_t *transform); +PIXMAN_EXPORT void pixman_image_set_repeat (pixman_image_t *image, pixman_repeat_t repeat); +PIXMAN_EXPORT pixman_bool_t pixman_image_set_filter (pixman_image_t *image, pixman_filter_t filter, const pixman_fixed_t *filter_params, int n_filter_params); +PIXMAN_EXPORT void pixman_image_set_filter_params (pixman_image_t *image, pixman_fixed_t *params, int n_params); +PIXMAN_EXPORT void pixman_image_set_source_clipping (pixman_image_t *image, pixman_bool_t source_clipping); +PIXMAN_EXPORT void pixman_image_set_alpha_map (pixman_image_t *image, pixman_image_t *alpha_map, int16_t x, int16_t y); +PIXMAN_EXPORT void pixman_image_set_component_alpha (pixman_image_t *image, pixman_bool_t component_alpha); +PIXMAN_EXPORT void pixman_image_set_accessors (pixman_image_t *image, pixman_read_memory_func_t read_func, pixman_write_memory_func_t write_func); +PIXMAN_EXPORT void pixman_image_set_indexed (pixman_image_t *image, const pixman_indexed_t *indexed); +PIXMAN_EXPORT uint32_t *pixman_image_get_data (pixman_image_t *image); +PIXMAN_EXPORT int pixman_image_get_width (pixman_image_t *image); +PIXMAN_EXPORT int pixman_image_get_height (pixman_image_t *image); +PIXMAN_EXPORT int pixman_image_get_stride (pixman_image_t *image); +PIXMAN_EXPORT int pixman_image_get_depth (pixman_image_t *image); +PIXMAN_EXPORT pixman_bool_t pixman_image_fill_rectangles (pixman_op_t op, pixman_image_t *image, pixman_color_t *color, @@ -523,6 +602,7 @@ const pixman_rectangle16_t *rects); /* Composite */ +PIXMAN_EXPORT pixman_bool_t pixman_compute_composite_region (pixman_region16_t * pRegion, pixman_image_t * pSrc, pixman_image_t * pMask, @@ -535,6 +615,7 @@ int16_t yDst, uint16_t width, uint16_t height); +PIXMAN_EXPORT void pixman_image_composite (pixman_op_t op, pixman_image_t *src, pixman_image_t *mask, @@ -599,12 +680,16 @@ pixman_span_fix_t top, bot; }; +PIXMAN_EXPORT pixman_fixed_t pixman_sample_ceil_y (pixman_fixed_t y, int bpp); +PIXMAN_EXPORT pixman_fixed_t pixman_sample_floor_y (pixman_fixed_t y, int bpp); +PIXMAN_EXPORT void pixman_edge_step (pixman_edge_t *e, int n); +PIXMAN_EXPORT void pixman_edge_init (pixman_edge_t *e, int bpp, pixman_fixed_t y_start, @@ -612,31 +697,35 @@ pixman_fixed_t y_top, pixman_fixed_t x_bot, pixman_fixed_t y_bot); +PIXMAN_EXPORT void pixman_line_fixed_edge_init (pixman_edge_t *e, int bpp, pixman_fixed_t y, const pixman_line_fixed_t *line, int x_off, int y_off); +PIXMAN_EXPORT void pixman_rasterize_edges (pixman_image_t *image, pixman_edge_t *l, pixman_edge_t *r, pixman_fixed_t t, pixman_fixed_t b); +PIXMAN_EXPORT void pixman_add_traps (pixman_image_t *image, int16_t x_off, int16_t y_off, int ntrap, pixman_trap_t *traps); +PIXMAN_EXPORT void pixman_add_trapezoids (pixman_image_t *image, int16_t x_off, int y_off, int ntraps, const pixman_trapezoid_t *traps); +PIXMAN_EXPORT void pixman_rasterize_trapezoid (pixman_image_t *image, const pixman_trapezoid_t *trap, int x_off, int y_off); - #endif /* PIXMAN_H__ */ diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-image.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-image.c --- pixman-0.9.6/pixman/pixman-image.c 2007-10-24 18:30:17.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-image.c 2008-02-22 18:57:37.000000000 +0100 @@ -28,7 +28,6 @@ #include #include -#include "pixman.h" #include "pixman-private.h" static void @@ -51,7 +50,7 @@ return FALSE; memcpy (gradient->stops, stops, n_stops * sizeof (pixman_gradient_stop_t)); - + gradient->n_stops = n_stops; gradient->stop_range = 0xffff; @@ -75,7 +74,7 @@ allocate_image (void) { pixman_image_t *image = malloc (sizeof (pixman_image_t)); - + if (image) { image_common_t *common = &image->common; @@ -134,7 +133,7 @@ if (image->type == BITS && image->bits.indexed) free (image->bits.indexed); #endif - + #if 0 memset (image, 0xaa, sizeof (pixman_image_t)); #endif @@ -144,10 +143,10 @@ free (image->gradient.stops); } - + if (image->type == BITS && image->bits.free_me) free (image->bits.free_me); - + free (image); return TRUE; @@ -163,9 +162,9 @@ pixman_image_t *img = allocate_image(); if (!img) return NULL; - + init_source_image (&img->solid.common); - + img->type = SOLID; img->solid.color = color_to_uint32 (color); @@ -182,14 +181,14 @@ linear_gradient_t *linear; return_val_if_fail (n_stops >= 2, NULL); - + image = allocate_image(); - + if (!image) return NULL; linear = &image->linear; - + if (!init_gradient (&linear->common, stops, n_stops)) { free (image); @@ -217,7 +216,7 @@ radial_gradient_t *radial; return_val_if_fail (n_stops >= 2, NULL); - + image = allocate_image(); if (!image) @@ -232,7 +231,7 @@ } image->type = RADIAL; - + radial->c1.x = inner->x; radial->c1.y = inner->y; radial->c1.radius = inner_radius; @@ -245,7 +244,7 @@ radial->A = (radial->cdx * radial->cdx + radial->cdy * radial->cdy - radial->dr * radial->dr); - + return image; } @@ -262,7 +261,7 @@ return NULL; conical = &image->conical; - + if (!init_gradient (&conical->common, stops, n_stops)) { free (image); @@ -323,11 +322,11 @@ reset_clip_region (pixman_image_t *image) { pixman_region_fini (&image->common.clip_region); - + if (image->type == BITS) { pixman_region_init_rect (&image->common.clip_region, 0, 0, - image->bits.width, image->bits.height); + image->bits.width, image->bits.height); } else { @@ -345,10 +344,10 @@ pixman_image_t *image; uint32_t *free_me = NULL; - /* must be a whole number of uint32_t's + /* must be a whole number of uint32_t's */ return_val_if_fail (bits == NULL || - (rowstride_bytes % sizeof (uint32_t)) == 0, NULL); + (rowstride_bytes % sizeof (uint32_t)) == 0, NULL); if (!bits && width && height) { @@ -356,7 +355,7 @@ if (!bits) return NULL; } - + image = allocate_image(); if (!image) { @@ -371,8 +370,8 @@ image->bits.height = height; image->bits.bits = bits; image->bits.free_me = free_me; - - image->bits.rowstride = rowstride_bytes / sizeof (uint32_t); /* we store it in number + + image->bits.rowstride = rowstride_bytes / (int) sizeof (uint32_t); /* we store it in number * of uint32_t's */ image->bits.indexed = NULL; @@ -398,7 +397,7 @@ else { reset_clip_region (image); - + return TRUE; } } @@ -423,7 +422,7 @@ { 0, 0, pixman_fixed_1 } } }; - + image_common_t *common = (image_common_t *)image; if (common->transform == transform) @@ -435,7 +434,7 @@ common->transform = NULL; return TRUE; } - + if (common->transform == NULL) common->transform = malloc (sizeof (pixman_transform_t)); if (common->transform == NULL) @@ -453,7 +452,7 @@ image->common.repeat = repeat; } -pixman_bool_t +pixman_bool_t pixman_image_set_filter (pixman_image_t *image, pixman_filter_t filter, const pixman_fixed_t *params, @@ -477,7 +476,7 @@ } common->filter = filter; - + if (common->filter_params) free (common->filter_params); @@ -518,7 +517,7 @@ int16_t y) { image_common_t *common = (image_common_t *)image; - + return_if_fail (!alpha_map || alpha_map->type == BITS); if (common->alpha_map != (bits_image_t *)alpha_map) @@ -586,7 +585,7 @@ pixman_image_get_stride (pixman_image_t *image) { if (image->type == BITS) - return image->bits.rowstride * sizeof (uint32_t); + return image->bits.rowstride * (int) sizeof (uint32_t); return 0; } @@ -617,7 +616,7 @@ { return FALSE; } - + if (PIXMAN_FORMAT_TYPE (format) == PIXMAN_TYPE_ABGR) { c = ((c & 0xff000000) >> 0) | @@ -636,7 +635,7 @@ printf ("color: %x %x %x %x\n", color->alpha, color->red, color->green, color->blue); printf ("pixel: %x\n", c); #endif - + *pixel = c; return TRUE; } @@ -651,7 +650,7 @@ pixman_image_t *solid; pixman_color_t c; int i; - + if (color->alpha == 0xffff) { if (op == PIXMAN_OP_OVER) @@ -666,14 +665,14 @@ c.alpha = 0; color = &c; - + op = PIXMAN_OP_SRC; } if (op == PIXMAN_OP_SRC) { uint32_t pixel; - + if (color_to_pixel (color, &pixel, dest->bits.format)) { for (i = 0; i < n_rects; ++i) @@ -681,7 +680,7 @@ pixman_region16_t fill_region; int n_boxes, j; pixman_box16_t *boxes; - + pixman_region_init_rect (&fill_region, rects[i].x, rects[i].y, rects[i].width, rects[i].height); pixman_region_intersect (&fill_region, &fill_region, &dest->common.clip_region); @@ -699,7 +698,7 @@ return TRUE; } } - + solid = pixman_image_create_solid_fill (color); if (!solid) return FALSE; @@ -707,13 +706,13 @@ for (i = 0; i < n_rects; ++i) { const pixman_rectangle16_t *rect = &(rects[i]); - + pixman_image_composite (op, solid, NULL, dest, 0, 0, 0, 0, rect->x, rect->y, rect->width, rect->height); } - + pixman_image_unref (solid); return TRUE; diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-mmx.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-mmx.c --- pixman-0.9.6/pixman/pixman-mmx.c 2007-10-24 18:30:17.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-mmx.c 2008-03-27 11:58:20.000000000 +0100 @@ -24,7 +24,7 @@ * * Author: Søren Sandmann (sandmann@redhat.com) * Minor Improvements: Nicholas Miell (nmiell@gmail.com) - * MMX code paths for fbcompose.c by Lars Knoll (lars@trolltech.com) + * MMX code paths for fbcompose.c by Lars Knoll (lars@trolltech.com) * * Based on work by Owen Taylor */ @@ -44,8 +44,8 @@ #undef READ #undef WRITE -#define READ(x) *(x) -#define WRITE(ptr,v) (*(ptr) = (v)); +#define READ(img,x) *(x) +#define WRITE(img,ptr,v) (*(ptr) = (v)); #define noVERBOSE @@ -76,9 +76,8 @@ /* --------------- MMX primitivess ------------------------------------ */ -typedef unsigned long long ullong; - #ifdef __GNUC__ +typedef unsigned long long ullong; typedef ullong mmxdatafield; #endif #ifdef _MSC_VER @@ -156,6 +155,36 @@ #endif static inline __m64 +M64 (ullong x) +{ +#ifdef __GNUC__ + return (__m64)x; +#endif + +#ifdef _MSC_VER + __m64 res; + + res.m64_u64 = x; + return res; +#endif +} + +static inline ullong +ULLONG (__m64 x) +{ +#ifdef __GNUC__ + return (ullong)x; +#endif + +#ifdef _MSC_VER + ullong res; + + res = x.m64_u64; + return res; +#endif +} + +static inline __m64 shift (__m64 v, int s) { if (s > 0) @@ -176,12 +205,12 @@ pix_multiply (__m64 a, __m64 b) { __m64 res; - + res = _mm_mullo_pi16 (a, b); res = _mm_adds_pu16 (res, MC(4x0080)); res = _mm_adds_pu16 (res, _mm_srli_pi16 (res, 8)); res = _mm_srli_pi16 (res, 8); - + return res; } @@ -203,7 +232,7 @@ expand_alpha_rev (__m64 pixel) { return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(0, 0, 0, 0)); -} +} static inline __m64 invert_colors (__m64 pixel) @@ -217,7 +246,7 @@ expand_alpha (__m64 pixel) { __m64 t1, t2; - + t1 = shift (pixel, -48); t2 = shift (t1, 16); t1 = _mm_or_si64 (t1, t2); @@ -277,7 +306,7 @@ { __m64 srca = expand_alpha (src); __m64 srcfaaa = _mm_or_si64 (srca, MC(full_alpha)); - + return over(pix_multiply(invert_colors(src), srcfaaa), srca, dest); } @@ -330,14 +359,14 @@ /* Expand 16 bits positioned at @pos (0-3) of a mmx register into * * 00RR00GG00BB - * + * * --- Expanding 565 in the low word --- - * + * * m = (m << (32 - 3)) | (m << (16 - 5)) | m; * m = m & (01f0003f001f); * m = m * (008404100840); * m = m >> 8; - * + * * Note the trick here - the top word is shifted by another nibble to * avoid it bumping into the middle word */ @@ -346,17 +375,17 @@ { __m64 p = pixel; __m64 t1, t2; - + /* move pixel to low 16 bit and zero the rest */ - p = shift (shift (p, (3 - pos) * 16), -48); - + p = shift (shift (p, (3 - pos) * 16), -48); + t1 = shift (p, 36 - 11); t2 = shift (p, 16 - 5); - + p = _mm_or_si64 (t1, p); p = _mm_or_si64 (t2, p); p = _mm_and_si64 (p, MC(565_rgb)); - + pixel = _mm_mullo_pi16 (p, MC(565_unpack_multiplier)); return _mm_srli_pi16 (pixel, 8); } @@ -376,15 +405,15 @@ __m64 p = pixel; __m64 t = target; __m64 r, g, b; - + r = _mm_and_si64 (p, MC(565_r)); g = _mm_and_si64 (p, MC(565_g)); b = _mm_and_si64 (p, MC(565_b)); - + r = shift (r, - (32 - 8) + pos * 16); g = shift (g, - (16 - 3) + pos * 16); b = shift (b, - (0 + 3) + pos * 16); - + if (pos == 0) t = _mm_and_si64 (t, MC(mask_0)); else if (pos == 1) @@ -393,10 +422,10 @@ t = _mm_and_si64 (t, MC(mask_2)); else if (pos == 3) t = _mm_and_si64 (t, MC(mask_3)); - + p = _mm_or_si64 (r, t); p = _mm_or_si64 (g, p); - + return _mm_or_si64 (b, p); } @@ -452,7 +481,7 @@ mmxCombineOverU (uint32_t *dest, const uint32_t *src, int width) { const uint32_t *end = dest + width; - + while (dest < end) { uint32_t ssrc = *src; uint32_t a = ssrc >> 24; @@ -690,9 +719,9 @@ __m64 s = load8888(*src); __m64 d = load8888(*dest); __m64 sa = expand_alpha(s); - + *dest = store8888(in_over (s, sa, a, d)); - + ++src; ++dest; ++mask; @@ -711,7 +740,7 @@ __m64 da = expand_alpha(d); *dest = store8888(over (d, da, in (s, a))); - + ++src; ++dest; ++mask; @@ -807,7 +836,7 @@ __m64 s = load8888(*src); __m64 d = load8888(*dest); __m64 da = expand_alpha(d); - __m64 sa = expand_alpha(s); + __m64 sa = expand_alpha(s); s = pix_multiply(s, a); a = pix_multiply(a, sa); a = negate(a); @@ -883,8 +912,14 @@ _mm_empty(); } -void fbComposeSetupMMX(void) +void +fbComposeSetupMMX(void) { + static pixman_bool_t initialized = FALSE; + + if (initialized) + return; + /* check if we have MMX support and initialize accordingly */ if (pixman_have_mmx()) { @@ -913,7 +948,9 @@ pixman_composeFunctions.combineC[PIXMAN_OP_ADD] = mmxCombineAddC; pixman_composeFunctions.combineMaskU = mmxCombineMaskU; - } + } + + initialized = TRUE; } @@ -938,62 +975,62 @@ uint16_t w; int dstStride; __m64 vsrc, vsrca; - + CHECKPOINT(); - + fbComposeGetSolid(pSrc, src, pDst->bits.format); - + if (src >> 24 == 0) return; - + fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); - + vsrc = load8888 (src); vsrca = expand_alpha (vsrc); - + while (height--) { dst = dstLine; dstLine += dstStride; w = width; - + CHECKPOINT(); - + while (w && (unsigned long)dst & 7) { *dst = store8888(over(vsrc, vsrca, load8888(*dst))); - + w--; dst++; } - + while (w >= 2) { __m64 vdest; __m64 dest0, dest1; - + vdest = *(__m64 *)dst; - + dest0 = over(vsrc, vsrca, expand8888(vdest, 0)); dest1 = over(vsrc, vsrca, expand8888(vdest, 1)); - + *(__m64 *)dst = pack8888(dest0, dest1); - + dst += 2; w -= 2; } - + CHECKPOINT(); - + while (w) { *dst = store8888(over(vsrc, vsrca, load8888(*dst))); - + w--; dst++; } } - + _mm_empty(); } @@ -1016,69 +1053,69 @@ uint16_t w; int dstStride; __m64 vsrc, vsrca; - + CHECKPOINT(); - + fbComposeGetSolid(pSrc, src, pDst->bits.format); - + if (src >> 24 == 0) return; - + fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1); - + vsrc = load8888 (src); vsrca = expand_alpha (vsrc); - + while (height--) { dst = dstLine; dstLine += dstStride; w = width; - + CHECKPOINT(); - + while (w && (unsigned long)dst & 7) { ullong d = *dst; - __m64 vdest = expand565 ((__m64)d, 0); + __m64 vdest = expand565 (M64(d), 0); vdest = pack565(over(vsrc, vsrca, vdest), vdest, 0); - *dst = (ullong)vdest; - + *dst = ULLONG(vdest); + w--; dst++; } - + while (w >= 4) { __m64 vdest; - + vdest = *(__m64 *)dst; - + vdest = pack565 (over(vsrc, vsrca, expand565(vdest, 0)), vdest, 0); vdest = pack565 (over(vsrc, vsrca, expand565(vdest, 1)), vdest, 1); vdest = pack565 (over(vsrc, vsrca, expand565(vdest, 2)), vdest, 2); vdest = pack565 (over(vsrc, vsrca, expand565(vdest, 3)), vdest, 3); - + *(__m64 *)dst = vdest; - + dst += 4; w -= 4; } - + CHECKPOINT(); - + while (w) { ullong d = *dst; - __m64 vdest = expand565 ((__m64)d, 0); + __m64 vdest = expand565 (M64(d), 0); vdest = pack565(over(vsrc, vsrca, vdest), vdest, 0); - *dst = (ullong)vdest; - + *dst = ULLONG(vdest); + w--; dst++; } } - + _mm_empty(); } @@ -1101,87 +1138,87 @@ uint32_t *maskLine; int dstStride, maskStride; __m64 vsrc, vsrca; - + CHECKPOINT(); - + fbComposeGetSolid(pSrc, src, pDst->bits.format); - + srca = src >> 24; if (srca == 0) return; - + fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint32_t, maskStride, maskLine, 1); - + vsrc = load8888(src); vsrca = expand_alpha(vsrc); - + while (height--) { int twidth = width; uint32_t *p = (uint32_t *)maskLine; uint32_t *q = (uint32_t *)dstLine; - + while (twidth && (unsigned long)q & 7) { uint32_t m = *(uint32_t *)p; - + if (m) { __m64 vdest = load8888(*q); vdest = in_over(vsrc, vsrca, load8888(m), vdest); *q = store8888(vdest); } - + twidth--; p++; q++; } - + while (twidth >= 2) { uint32_t m0, m1; m0 = *p; m1 = *(p + 1); - + if (m0 | m1) { __m64 dest0, dest1; __m64 vdest = *(__m64 *)q; - + dest0 = in_over(vsrc, vsrca, load8888(m0), expand8888 (vdest, 0)); dest1 = in_over(vsrc, vsrca, load8888(m1), expand8888 (vdest, 1)); - + *(__m64 *)q = pack8888(dest0, dest1); } - + p += 2; q += 2; twidth -= 2; } - + while (twidth) { uint32_t m = *(uint32_t *)p; - + if (m) { __m64 vdest = load8888(*q); vdest = in_over(vsrc, vsrca, load8888(m), vdest); *q = store8888(vdest); } - + twidth--; p++; q++; } - + dstLine += dstStride; maskLine += maskStride; } - + _mm_empty(); } @@ -1331,7 +1368,7 @@ __m64 vd5 = *(__m64 *)(dst + 10); __m64 vd6 = *(__m64 *)(dst + 12); __m64 vd7 = *(__m64 *)(dst + 14); - + __m64 vs0 = *(__m64 *)(src + 0); __m64 vs1 = *(__m64 *)(src + 2); __m64 vs2 = *(__m64 *)(src + 4); @@ -1340,27 +1377,27 @@ __m64 vs5 = *(__m64 *)(src + 10); __m64 vs6 = *(__m64 *)(src + 12); __m64 vs7 = *(__m64 *)(src + 14); - + vd0 = pack8888 ( in_over (expand8888 (vs0, 0), srca, vmask, expand8888 (vd0, 0)), in_over (expand8888 (vs0, 1), srca, vmask, expand8888 (vd0, 1))); - + vd1 = pack8888 ( in_over (expand8888 (vs1, 0), srca, vmask, expand8888 (vd1, 0)), in_over (expand8888 (vs1, 1), srca, vmask, expand8888 (vd1, 1))); - + vd2 = pack8888 ( in_over (expand8888 (vs2, 0), srca, vmask, expand8888 (vd2, 0)), in_over (expand8888 (vs2, 1), srca, vmask, expand8888 (vd2, 1))); - + vd3 = pack8888 ( in_over (expand8888 (vs3, 0), srca, vmask, expand8888 (vd3, 0)), in_over (expand8888 (vs3, 1), srca, vmask, expand8888 (vd3, 1))); - + vd4 = pack8888 ( in_over (expand8888 (vs4, 0), srca, vmask, expand8888 (vd4, 0)), in_over (expand8888 (vs4, 1), srca, vmask, expand8888 (vd4, 1))); - + vd5 = pack8888 ( in_over (expand8888 (vs5, 0), srca, vmask, expand8888 (vd5, 0)), in_over (expand8888 (vs5, 1), srca, vmask, expand8888 (vd5, 1))); @@ -1386,7 +1423,7 @@ dst += 16; src += 16; } - + while (w) { __m64 s = load8888 (*src | 0xff000000); @@ -1423,9 +1460,9 @@ int dstStride, srcStride; uint8_t a; uint16_t w; - + CHECKPOINT(); - + fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); @@ -1452,7 +1489,7 @@ dst++; } } - _mm_empty(); + _mm_empty(); } void @@ -1473,17 +1510,17 @@ uint32_t *srcLine, *src; int dstStride, srcStride; uint16_t w; - + CHECKPOINT(); - + fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); - + #if 0 /* FIXME */ assert (pSrc->pDrawable == pMask->pDrawable); #endif - + while (height--) { dst = dstLine; @@ -1491,26 +1528,26 @@ src = srcLine; srcLine += srcStride; w = width; - + CHECKPOINT(); - + while (w && (unsigned long)dst & 7) { __m64 vsrc = load8888 (*src); ullong d = *dst; - __m64 vdest = expand565 ((__m64)d, 0); - + __m64 vdest = expand565 (M64(d), 0); + vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0); - - *dst = (ullong)vdest; - + + *dst = ULLONG(vdest); + w--; dst++; src++; } - + CHECKPOINT(); - + while (w >= 4) { __m64 vsrc0, vsrc1, vsrc2, vsrc3; @@ -1522,12 +1559,12 @@ vsrc3 = load8888(*(src + 3)); vdest = *(__m64 *)dst; - + vdest = pack565(over(vsrc0, expand_alpha(vsrc0), expand565(vdest, 0)), vdest, 0); vdest = pack565(over(vsrc1, expand_alpha(vsrc1), expand565(vdest, 1)), vdest, 1); vdest = pack565(over(vsrc2, expand_alpha(vsrc2), expand565(vdest, 2)), vdest, 2); vdest = pack565(over(vsrc3, expand_alpha(vsrc3), expand565(vdest, 3)), vdest, 3); - + *(__m64 *)dst = vdest; w -= 4; @@ -1536,23 +1573,23 @@ } CHECKPOINT(); - + while (w) { __m64 vsrc = load8888 (*src); ullong d = *dst; - __m64 vdest = expand565 ((__m64)d, 0); - + __m64 vdest = expand565 (M64(d), 0); + vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0); - - *dst = (ullong)vdest; - + + *dst = ULLONG(vdest); + w--; dst++; src++; } } - + _mm_empty(); } @@ -1577,23 +1614,23 @@ uint16_t w; __m64 vsrc, vsrca; ullong srcsrc; - + CHECKPOINT(); - + fbComposeGetSolid(pSrc, src, pDst->bits.format); - + srca = src >> 24; if (srca == 0) return; - - srcsrc = (unsigned long long)src << 32 | src; - + + srcsrc = (ullong)src << 32 | src; + fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); - + vsrc = load8888 (src); vsrca = expand_alpha (vsrc); - + while (height--) { dst = dstLine; @@ -1601,73 +1638,73 @@ mask = maskLine; maskLine += maskStride; w = width; - + CHECKPOINT(); - + while (w && (unsigned long)dst & 7) { ullong m = *mask; - + if (m) { - __m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m), load8888(*dst)); + __m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev (M64(m)), load8888(*dst)); *dst = store8888(vdest); } - + w--; mask++; dst++; } - + CHECKPOINT(); - + while (w >= 2) { ullong m0, m1; m0 = *mask; m1 = *(mask + 1); - + if (srca == 0xff && (m0 & m1) == 0xff) { - *(unsigned long long *)dst = srcsrc; + *(ullong *)dst = srcsrc; } else if (m0 | m1) { __m64 vdest; __m64 dest0, dest1; - + vdest = *(__m64 *)dst; - - dest0 = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m0), expand8888(vdest, 0)); - dest1 = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m1), expand8888(vdest, 1)); - + + dest0 = in_over(vsrc, vsrca, expand_alpha_rev (M64(m0)), expand8888(vdest, 0)); + dest1 = in_over(vsrc, vsrca, expand_alpha_rev (M64(m1)), expand8888(vdest, 1)); + *(__m64 *)dst = pack8888(dest0, dest1); } - + mask += 2; dst += 2; w -= 2; } - + CHECKPOINT(); - + while (w) { ullong m = *mask; - + if (m) { __m64 vdest = load8888(*dst); - vdest = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m), vdest); + vdest = in_over(vsrc, vsrca, expand_alpha_rev (M64(m)), vdest); *dst = store8888(vdest); } - + w--; mask++; dst++; } } - + _mm_empty(); } @@ -1688,31 +1725,31 @@ #ifdef __GNUC__ __m64 v1, v2, v3, v4, v5, v6, v7; #endif - + if (bpp == 16 && (xor >> 16 != (xor & 0xffff))) return FALSE; - + if (bpp != 16 && bpp != 32) return FALSE; - + if (bpp == 16) { - stride = stride * sizeof (uint32_t) / 2; + stride = stride * (int) sizeof (uint32_t) / 2; byte_line = (uint8_t *)(((uint16_t *)bits) + stride * y + x); byte_width = 2 * width; stride *= 2; } else { - stride = stride * sizeof (uint32_t) / 4; + stride = stride * (int) sizeof (uint32_t) / 4; byte_line = (uint8_t *)(((uint32_t *)bits) + stride * y + x); byte_width = 4 * width; stride *= 4; } - + fill = ((ullong)xor << 32) | xor; - vfill = (__m64)fill; - + vfill = M64(fill); + #ifdef __GNUC__ __asm__ ( "movq %7, %0\n" @@ -1726,25 +1763,25 @@ "=y" (v4), "=y" (v5), "=y" (v6), "=y" (v7) : "y" (vfill)); #endif - + while (height--) { int w; uint8_t *d = byte_line; byte_line += stride; w = byte_width; - + while (w >= 2 && ((unsigned long)d & 3)) { *(uint16_t *)d = xor; w -= 2; d += 2; } - + while (w >= 4 && ((unsigned long)d & 7)) { *(uint32_t *)d = xor; - + w -= 4; d += 4; } @@ -1775,15 +1812,15 @@ *(__m64*) (d + 40) = vfill; *(__m64*) (d + 48) = vfill; *(__m64*) (d + 56) = vfill; -#endif +#endif w -= 64; d += 64; } - + while (w >= 4) { *(uint32_t *)d = xor; - + w -= 4; d += 4; } @@ -1794,7 +1831,7 @@ d += 2; } } - + _mm_empty(); return TRUE; } @@ -1857,7 +1894,7 @@ if (m) { - __m64 vdest = in(vsrc, expand_alpha_rev ((__m64)m)); + __m64 vdest = in(vsrc, expand_alpha_rev (M64(m))); *dst = store8888(vdest); } else @@ -1889,8 +1926,8 @@ vdest = *(__m64 *)dst; - dest0 = in(vsrc, expand_alpha_rev ((__m64)m0)); - dest1 = in(vsrc, expand_alpha_rev ((__m64)m1)); + dest0 = in(vsrc, expand_alpha_rev (M64(m0))); + dest1 = in(vsrc, expand_alpha_rev (M64(m1))); *(__m64 *)dst = pack8888(dest0, dest1); } @@ -1913,7 +1950,7 @@ if (m) { __m64 vdest = load8888(*dst); - vdest = in(vsrc, expand_alpha_rev ((__m64)m)); + vdest = in(vsrc, expand_alpha_rev (M64(m))); *dst = store8888(vdest); } else @@ -1949,28 +1986,29 @@ uint8_t *maskLine, *mask; int dstStride, maskStride; uint16_t w; - __m64 vsrc, vsrca; - unsigned long long srcsrcsrcsrc, src16; - + __m64 vsrc, vsrca, tmp; + ullong srcsrcsrcsrc, src16; + CHECKPOINT(); - + fbComposeGetSolid(pSrc, src, pDst->bits.format); - + srca = src >> 24; if (srca == 0) return; - + fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); - + vsrc = load8888 (src); vsrca = expand_alpha (vsrc); - - src16 = (ullong)pack565(vsrc, _mm_setzero_si64(), 0); - + + tmp = pack565(vsrc, _mm_setzero_si64(), 0); + src16 = ULLONG(tmp); + srcsrcsrcsrc = (ullong)src16 << 48 | (ullong)src16 << 32 | (ullong)src16 << 16 | (ullong)src16; - + while (height--) { dst = dstLine; @@ -1978,28 +2016,29 @@ mask = maskLine; maskLine += maskStride; w = width; - + CHECKPOINT(); - + while (w && (unsigned long)dst & 7) { ullong m = *mask; - + if (m) { ullong d = *dst; - __m64 vd = (__m64)d; - __m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m), expand565(vd, 0)); - *dst = (ullong)pack565(vdest, _mm_setzero_si64(), 0); + __m64 vd = M64(d); + __m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev (M64 (m)), expand565(vd, 0)); + vd = pack565(vdest, _mm_setzero_si64(), 0); + *dst = ULLONG(vd); } - + w--; mask++; dst++; } - + CHECKPOINT(); - + while (w >= 4) { ullong m0, m1, m2, m3; @@ -2007,55 +2046,56 @@ m1 = *(mask + 1); m2 = *(mask + 2); m3 = *(mask + 3); - + if (srca == 0xff && (m0 & m1 & m2 & m3) == 0xff) { - *(unsigned long long *)dst = srcsrcsrcsrc; + *(ullong *)dst = srcsrcsrcsrc; } else if (m0 | m1 | m2 | m3) { __m64 vdest; __m64 vm0, vm1, vm2, vm3; - + vdest = *(__m64 *)dst; - - vm0 = (__m64)m0; + + vm0 = M64(m0); vdest = pack565(in_over(vsrc, vsrca, expand_alpha_rev(vm0), expand565(vdest, 0)), vdest, 0); - vm1 = (__m64)m1; + vm1 = M64(m1); vdest = pack565(in_over(vsrc, vsrca, expand_alpha_rev(vm1), expand565(vdest, 1)), vdest, 1); - vm2 = (__m64)m2; + vm2 = M64(m2); vdest = pack565(in_over(vsrc, vsrca, expand_alpha_rev(vm2), expand565(vdest, 2)), vdest, 2); - vm3 = (__m64)m3; + vm3 = M64(m3); vdest = pack565(in_over(vsrc, vsrca, expand_alpha_rev(vm3), expand565(vdest, 3)), vdest, 3); - + *(__m64 *)dst = vdest; } - + w -= 4; mask += 4; dst += 4; } - + CHECKPOINT(); - + while (w) { ullong m = *mask; - + if (m) { ullong d = *dst; - __m64 vd = (__m64)d; - __m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev ((__m64)m), expand565(vd, 0)); - *dst = (ullong)pack565(vdest, _mm_setzero_si64(), 0); + __m64 vd = M64(d); + __m64 vdest = in_over(vsrc, vsrca, expand_alpha_rev (M64(m)), expand565(vd, 0)); + vd = pack565(vdest, _mm_setzero_si64(), 0); + *dst = ULLONG(vd); } - + w--; mask++; dst++; } } - + _mm_empty(); } @@ -2077,17 +2117,17 @@ uint32_t *srcLine, *src; int dstStride, srcStride; uint16_t w; - + CHECKPOINT(); - + fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); - + #if 0 /* FIXME */ assert (pSrc->pDrawable == pMask->pDrawable); #endif - + while (height--) { dst = dstLine; @@ -2095,41 +2135,41 @@ src = srcLine; srcLine += srcStride; w = width; - + CHECKPOINT(); - + while (w && (unsigned long)dst & 7) { __m64 vsrc = load8888 (*src); ullong d = *dst; - __m64 vdest = expand565 ((__m64)d, 0); - + __m64 vdest = expand565 (M64(d), 0); + vdest = pack565(over_rev_non_pre(vsrc, vdest), vdest, 0); - - *dst = (ullong)vdest; - + + *dst = ULLONG(vdest); + w--; dst++; src++; } - + CHECKPOINT(); - + while (w >= 4) { uint32_t s0, s1, s2, s3; unsigned char a0, a1, a2, a3; - + s0 = *src; s1 = *(src + 1); s2 = *(src + 2); s3 = *(src + 3); - + a0 = (s0 >> 24); a1 = (s1 >> 24); a2 = (s2 >> 24); a3 = (s3 >> 24); - + if ((a0 & a1 & a2 & a3) == 0xFF) { __m64 vdest; @@ -2137,44 +2177,44 @@ vdest = pack565(invert_colors(load8888(s1)), vdest, 1); vdest = pack565(invert_colors(load8888(s2)), vdest, 2); vdest = pack565(invert_colors(load8888(s3)), vdest, 3); - + *(__m64 *)dst = vdest; } else if (a0 | a1 | a2 | a3) { __m64 vdest = *(__m64 *)dst; - + vdest = pack565(over_rev_non_pre(load8888(s0), expand565(vdest, 0)), vdest, 0); vdest = pack565(over_rev_non_pre(load8888(s1), expand565(vdest, 1)), vdest, 1); vdest = pack565(over_rev_non_pre(load8888(s2), expand565(vdest, 2)), vdest, 2); vdest = pack565(over_rev_non_pre(load8888(s3), expand565(vdest, 3)), vdest, 3); - + *(__m64 *)dst = vdest; } - + w -= 4; dst += 4; src += 4; } - + CHECKPOINT(); - + while (w) { __m64 vsrc = load8888 (*src); ullong d = *dst; - __m64 vdest = expand565 ((__m64)d, 0); - + __m64 vdest = expand565 (M64(d), 0); + vdest = pack565(over_rev_non_pre(vsrc, vdest), vdest, 0); - - *dst = (ullong)vdest; - + + *dst = ULLONG(vdest); + w--; dst++; src++; } } - + _mm_empty(); } @@ -2198,17 +2238,17 @@ uint32_t *srcLine, *src; int dstStride, srcStride; uint16_t w; - + CHECKPOINT(); - + fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); - + #if 0 /* FIXME */ assert (pSrc->pDrawable == pMask->pDrawable); #endif - + while (height--) { dst = dstLine; @@ -2216,66 +2256,66 @@ src = srcLine; srcLine += srcStride; w = width; - + while (w && (unsigned long)dst & 7) { __m64 s = load8888 (*src); __m64 d = load8888 (*dst); - + *dst = store8888 (over_rev_non_pre (s, d)); - + w--; dst++; src++; } - + while (w >= 2) { ullong s0, s1; unsigned char a0, a1; __m64 d0, d1; - + s0 = *src; s1 = *(src + 1); - + a0 = (s0 >> 24); a1 = (s1 >> 24); - + if ((a0 & a1) == 0xFF) { d0 = invert_colors(load8888(s0)); d1 = invert_colors(load8888(s1)); - + *(__m64 *)dst = pack8888 (d0, d1); } else if (a0 | a1) { __m64 vdest = *(__m64 *)dst; - + d0 = over_rev_non_pre (load8888(s0), expand8888 (vdest, 0)); d1 = over_rev_non_pre (load8888(s1), expand8888 (vdest, 1)); - + *(__m64 *)dst = pack8888 (d0, d1); } - + w -= 2; dst += 2; src += 2; } - + while (w) { __m64 s = load8888 (*src); __m64 d = load8888 (*dst); - + *dst = store8888 (over_rev_non_pre (s, d)); - + w--; dst++; src++; } } - + _mm_empty(); } @@ -2298,91 +2338,91 @@ uint32_t *maskLine; int dstStride, maskStride; __m64 vsrc, vsrca; - + CHECKPOINT(); - + fbComposeGetSolid(pSrc, src, pDst->bits.format); - + srca = src >> 24; if (srca == 0) return; - + fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint32_t, maskStride, maskLine, 1); - + vsrc = load8888 (src); vsrca = expand_alpha (vsrc); - + while (height--) { int twidth = width; uint32_t *p = (uint32_t *)maskLine; uint16_t *q = (uint16_t *)dstLine; - + while (twidth && ((unsigned long)q & 7)) { uint32_t m = *(uint32_t *)p; - + if (m) { ullong d = *q; - __m64 vdest = expand565 ((__m64)d, 0); + __m64 vdest = expand565 (M64(d), 0); vdest = pack565 (in_over (vsrc, vsrca, load8888 (m), vdest), vdest, 0); - *q = (ullong)vdest; + *q = ULLONG(vdest); } - + twidth--; p++; q++; } - + while (twidth >= 4) { uint32_t m0, m1, m2, m3; - + m0 = *p; m1 = *(p + 1); m2 = *(p + 2); m3 = *(p + 3); - + if ((m0 | m1 | m2 | m3)) { __m64 vdest = *(__m64 *)q; - + vdest = pack565(in_over(vsrc, vsrca, load8888(m0), expand565(vdest, 0)), vdest, 0); vdest = pack565(in_over(vsrc, vsrca, load8888(m1), expand565(vdest, 1)), vdest, 1); vdest = pack565(in_over(vsrc, vsrca, load8888(m2), expand565(vdest, 2)), vdest, 2); vdest = pack565(in_over(vsrc, vsrca, load8888(m3), expand565(vdest, 3)), vdest, 3); - + *(__m64 *)q = vdest; } twidth -= 4; p += 4; q += 4; } - + while (twidth) { uint32_t m; - + m = *(uint32_t *)p; if (m) { ullong d = *q; - __m64 vdest = expand565((__m64)d, 0); + __m64 vdest = expand565(M64(d), 0); vdest = pack565 (in_over(vsrc, vsrca, load8888(m), vdest), vdest, 0); - *q = (ullong)vdest; + *q = ULLONG(vdest); } - + twidth--; p++; q++; } - + maskLine += maskStride; dstLine += dstStride; } - + _mm_empty (); } @@ -2632,12 +2672,12 @@ uint16_t w; uint8_t s, d; uint16_t t; - + CHECKPOINT(); - + fbComposeGetStart (pSrc, xSrc, ySrc, uint8_t, srcStride, srcLine, 1); fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); - + while (height--) { dst = dstLine; @@ -2645,7 +2685,7 @@ src = srcLine; srcLine += srcStride; w = width; - + while (w && (unsigned long)dst & 7) { s = *src; @@ -2653,12 +2693,12 @@ t = d + s; s = t | (0 - (t >> 8)); *dst = s; - + dst++; src++; w--; } - + while (w >= 8) { *(__m64*)dst = _mm_adds_pu8(*(__m64*)src, *(__m64*)dst); @@ -2666,7 +2706,7 @@ src += 8; w -= 8; } - + while (w) { s = *src; @@ -2674,13 +2714,13 @@ t = d + s; s = t | (0 - (t >> 8)); *dst = s; - + dst++; src++; w--; } } - + _mm_empty(); } @@ -2698,16 +2738,17 @@ uint16_t width, uint16_t height) { + __m64 dst64; uint32_t *dstLine, *dst; uint32_t *srcLine, *src; int dstStride, srcStride; uint16_t w; - + CHECKPOINT(); - + fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); - + while (height--) { dst = dstLine; @@ -2715,7 +2756,7 @@ src = srcLine; srcLine += srcStride; w = width; - + while (w && (unsigned long)dst & 7) { *dst = _mm_cvtsi64_si32(_mm_adds_pu8(_mm_cvtsi32_si64(*src), @@ -2724,27 +2765,28 @@ src++; w--; } - + while (w >= 2) { - *(ullong*)dst = (ullong) _mm_adds_pu8(*(__m64*)src, *(__m64*)dst); + dst64 = _mm_adds_pu8(*(__m64*)src, *(__m64*)dst); + *(ullong*)dst = ULLONG(dst64); dst += 2; src += 2; w -= 2; } - + if (w) { *dst = _mm_cvtsi64_si32(_mm_adds_pu8(_mm_cvtsi32_si64(*src), _mm_cvtsi32_si64(*dst))); - + } } - + _mm_empty(); } -pixman_bool_t +pixman_bool_t pixman_blt_mmx (uint32_t *src_bits, uint32_t *dst_bits, int src_stride, @@ -2758,22 +2800,22 @@ uint8_t * src_bytes; uint8_t * dst_bytes; int byte_width; - + if (src_bpp != dst_bpp) return FALSE; - + if (src_bpp == 16) { - src_stride = src_stride * sizeof (uint32_t) / 2; - dst_stride = dst_stride * sizeof (uint32_t) / 2; + src_stride = src_stride * (int) sizeof (uint32_t) / 2; + dst_stride = dst_stride * (int) sizeof (uint32_t) / 2; src_bytes = (uint8_t *)(((uint16_t *)src_bits) + src_stride * (src_y) + (src_x)); dst_bytes = (uint8_t *)(((uint16_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); byte_width = 2 * width; src_stride *= 2; dst_stride *= 2; } else if (src_bpp == 32) { - src_stride = src_stride * sizeof (uint32_t) / 4; - dst_stride = dst_stride * sizeof (uint32_t) / 4; + src_stride = src_stride * (int) sizeof (uint32_t) / 4; + dst_stride = dst_stride * (int) sizeof (uint32_t) / 4; src_bytes = (uint8_t *)(((uint32_t *)src_bits) + src_stride * (src_y) + (src_x)); dst_bytes = (uint8_t *)(((uint32_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); byte_width = 4 * width; @@ -2791,7 +2833,7 @@ src_bytes += src_stride; dst_bytes += dst_stride; w = byte_width; - + while (w >= 2 && ((unsigned long)d & 3)) { *(uint16_t *)d = *(uint16_t *)s; @@ -2799,16 +2841,16 @@ s += 2; d += 2; } - + while (w >= 4 && ((unsigned long)d & 7)) { *(uint32_t *)d = *(uint32_t *)s; - + w -= 4; s += 4; d += 4; } - + while (w >= 64) { #ifdef __GNUC__ @@ -2852,8 +2894,8 @@ *(__m64 *)(d + 40) = v5; *(__m64 *)(d + 48) = v6; *(__m64 *)(d + 56) = v7; -#endif - +#endif + w -= 64; s += 64; d += 64; @@ -2874,7 +2916,7 @@ d += 2; } } - + _mm_empty(); return TRUE; @@ -2921,8 +2963,6 @@ uint32_t *dst, *dstLine; uint8_t *mask, *maskLine; int srcStride, maskStride, dstStride; - __m64 m; - uint32_t s, d; uint16_t w; fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); @@ -2953,13 +2993,13 @@ else { __m64 sa = expand_alpha (s); - __m64 vm = expand_alpha_rev ((__m64)m); + __m64 vm = expand_alpha_rev (M64(m)); __m64 vdest = in_over(s, sa, vm, load8888 (*dst)); *dst = store8888 (vdest); } } - + mask++; dst++; src++; diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-mmx.h /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-mmx.h --- pixman-0.9.6/pixman/pixman-mmx.h 2007-09-13 21:58:28.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-mmx.h 2008-03-24 14:13:13.000000000 +0100 @@ -26,6 +26,9 @@ * * Based on work by Owen Taylor */ +#ifndef _PIXMAN_MMX_H_ +#define _PIXMAN_MMX_H_ + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -313,3 +316,5 @@ uint16_t height); #endif /* USE_MMX */ + +#endif /* _PIXMAN_MMX_H_ */ diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-pict.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-pict.c --- pixman-0.9.6/pixman/pixman-pict.c 2007-10-24 18:30:17.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-pict.c 2008-03-27 11:58:20.000000000 +0100 @@ -1,3 +1,4 @@ +/* -*- Mode: c; c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t; -*- */ /* * Copyright © 2000 SuSE, Inc. * Copyright © 2007 Red Hat, Inc. @@ -29,16 +30,17 @@ #include #include #include -#include "pixman.h" + #include "pixman-private.h" #include "pixman-mmx.h" +#include "pixman-sse.h" #define FbFullMask(n) ((n) == 32 ? (uint32_t)-1 : ((((uint32_t) 1) << n) - 1)) #undef READ #undef WRITE -#define READ(x) (*(x)) -#define WRITE(ptr,v) ((*(ptr)) = (v)) +#define READ(img,x) (*(x)) +#define WRITE(img,ptr,v) ((*(ptr)) = (v)) typedef void (* CompositeFunc) (pixman_op_t, pixman_image_t *, pixman_image_t *, pixman_image_t *, @@ -130,26 +132,23 @@ w = width; while (w--) { - m = READ(mask++); + m = READ(pMask, mask++); if (m) { - s = READ(src) | 0xff000000; + s = READ(pSrc, src) | 0xff000000; if (m == 0xff) - WRITE (dst, s); + WRITE(pDst, dst, s); else { d = fbIn (s, m); - WRITE(dst, fbOver (d, READ(dst))); + WRITE(pDst, dst, fbOver (d, READ(pDst, dst))); } } src++; dst++; } } - - fbFinishAccess (pMask->pDrawable); - fbFinishAccess (pDst->pDrawable); } static void @@ -172,12 +171,12 @@ int dstStride, maskStride; uint16_t w; uint16_t t; - + fbComposeGetSolid(iSrc, src, iDst->bits.format); dstMask = FbFullMask (PIXMAN_FORMAT_DEPTH (iDst->bits.format)); srca = src >> 24; - + fbComposeGetStart (iDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); fbComposeGetStart (iMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); @@ -254,10 +253,10 @@ uint16_t w; uint8_t s; uint16_t t; - + fbComposeGetStart (iSrc, xSrc, ySrc, uint8_t, srcStride, srcLine, 1); fbComposeGetStart (iDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); - + while (height--) { dst = dstLine; @@ -265,7 +264,7 @@ src = srcLine; srcLine += srcStride; w = width; - + while (w--) { s = *src++; @@ -308,10 +307,10 @@ srca = src >> 24; if (src == 0) return; - + fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); - + while (height--) { dst = dstLine; @@ -319,28 +318,25 @@ mask = maskLine; maskLine += maskStride; w = width; - + while (w--) { - m = READ(mask++); + m = READ(pMask, mask++); if (m == 0xff) { if (srca == 0xff) - WRITE(dst, src & dstMask); + WRITE(pDst, dst, src & dstMask); else - WRITE(dst, fbOver (src, READ(dst)) & dstMask); + WRITE(pDst, dst, fbOver (src, READ(pDst, dst)) & dstMask); } else if (m) { d = fbIn (src, m); - WRITE(dst, fbOver (d, READ(dst)) & dstMask); + WRITE(pDst, dst, fbOver (d, READ(pDst, dst)) & dstMask); } dst++; } } - - fbFinishAccess (pMask->pDrawable); - fbFinishAccess (pDst->pDrawable); } void @@ -384,17 +380,17 @@ while (w--) { - ma = READ(mask++); + ma = READ(pMask, mask++); if (ma == 0xffffffff) { if (srca == 0xff) - WRITE(dst, src & dstMask); + WRITE(pDst, dst, src & dstMask); else - WRITE(dst, fbOver (src, READ(dst)) & dstMask); + WRITE(pDst, dst, fbOver (src, READ(pDst, dst)) & dstMask); } else if (ma) { - d = READ(dst); + d = READ(pDst, dst); #define FbInOverC(src,srca,msk,dst,i,result) { \ uint16_t __a = FbGet8(msk,i); \ uint32_t __t, __ta; \ @@ -409,14 +405,11 @@ FbInOverC (src, srca, ma, d, 8, n); FbInOverC (src, srca, ma, d, 16, o); FbInOverC (src, srca, ma, d, 24, p); - WRITE(dst, m|n|o|p); + WRITE(pDst, dst, m|n|o|p); } dst++; } } - - fbFinishAccess (pMask->pDrawable); - fbFinishAccess (pDst->pDrawable); } void @@ -459,29 +452,26 @@ while (w--) { - m = READ(mask++); + m = READ(pMask, mask++); if (m == 0xff) { if (srca == 0xff) d = src; else { - d = Fetch24(dst); + d = Fetch24(pDst, dst); d = fbOver24 (src, d); } - Store24(dst,d); + Store24(pDst, dst,d); } else if (m) { - d = fbOver24 (fbIn(src,m), Fetch24(dst)); - Store24(dst,d); + d = fbOver24 (fbIn(src,m), Fetch24(pDst, dst)); + Store24(pDst, dst, d); } dst += 3; } } - - fbFinishAccess (pMask->pDrawable); - fbFinishAccess (pDst->pDrawable); } void @@ -524,30 +514,27 @@ while (w--) { - m = READ(mask++); + m = READ(pMask, mask++); if (m == 0xff) { if (srca == 0xff) d = src; else { - d = READ(dst); + d = READ(pDst, dst); d = fbOver24 (src, cvt0565to0888(d)); } - WRITE(dst, cvt8888to0565(d)); + WRITE(pDst, dst, cvt8888to0565(d)); } else if (m) { - d = READ(dst); + d = READ(pDst, dst); d = fbOver24 (fbIn(src,m), cvt0565to0888(d)); - WRITE(dst, cvt8888to0565(d)); + WRITE(pDst, dst, cvt8888to0565(d)); } dst++; } } - - fbFinishAccess (pMask->pDrawable); - fbFinishAccess (pDst->pDrawable); } void @@ -594,36 +581,33 @@ while (w--) { - ma = READ(mask++); + ma = READ(pMask, mask++); if (ma == 0xffffffff) { if (srca == 0xff) { - WRITE(dst, src16); + WRITE(pDst, dst, src16); } else { - d = READ(dst); + d = READ(pDst, dst); d = fbOver24 (src, cvt0565to0888(d)); - WRITE(dst, cvt8888to0565(d)); + WRITE(pDst, dst, cvt8888to0565(d)); } } else if (ma) { - d = READ(dst); + d = READ(pDst, dst); d = cvt0565to0888(d); FbInOverC (src, srca, ma, d, 0, m); FbInOverC (src, srca, ma, d, 8, n); FbInOverC (src, srca, ma, d, 16, o); d = m|n|o; - WRITE(dst, cvt8888to0565(d)); + WRITE(pDst, dst, cvt8888to0565(d)); } dst++; } } - - fbFinishAccess (pMask->pDrawable); - fbFinishAccess (pDst->pDrawable); } void @@ -661,18 +645,15 @@ while (w--) { - s = READ(src++); + s = READ(pSrc, src++); a = s >> 24; if (a == 0xff) - WRITE(dst, s & dstMask); + WRITE(pDst, dst, s & dstMask); else if (a) - WRITE(dst, fbOver (s, READ(dst)) & dstMask); + WRITE(pDst, dst, fbOver (s, READ(pDst, dst)) & dstMask); dst++; } } - - fbFinishAccess (pSrc->pDrawable); - fbFinishAccess (pDst->pDrawable); } void @@ -709,22 +690,19 @@ while (w--) { - s = READ(src++); + s = READ(pSrc, src++); a = s >> 24; if (a) { if (a == 0xff) d = s; else - d = fbOver24 (s, Fetch24(dst)); - Store24(dst,d); + d = fbOver24 (s, Fetch24(pDst, dst)); + Store24(pDst, dst, d); } dst += 3; } } - - fbFinishAccess (pSrc->pDrawable); - fbFinishAccess (pDst->pDrawable); } void @@ -761,7 +739,7 @@ while (w--) { - s = READ(src++); + s = READ(pSrc, src++); a = s >> 24; if (a) { @@ -769,17 +747,14 @@ d = s; else { - d = READ(dst); + d = READ(pDst, dst); d = fbOver24 (s, cvt0565to0888(d)); } - WRITE(dst, cvt8888to0565(d)); + WRITE(pDst, dst, cvt8888to0565(d)); } dst++; } } - - fbFinishAccess (pDst->pDrawable); - fbFinishAccess (pSrc->pDrawable); } void @@ -816,23 +791,20 @@ while (w--) { - s = READ(src++); + s = READ(pSrc, src++); if (s) { if (s != 0xff) { - d = READ(dst); + d = READ(pDst, dst); t = d + s; s = t | (0 - (t >> 8)); } - WRITE(dst, s); + WRITE(pDst, dst, s); } dst++; } } - - fbFinishAccess (pDst->pDrawable); - fbFinishAccess (pSrc->pDrawable); } void @@ -870,12 +842,12 @@ while (w--) { - s = READ(src++); + s = READ(pSrc, src++); if (s) { if (s != 0xffffffff) { - d = READ(dst); + d = READ(pDst, dst); if (d) { m = FbAdd(s,d,0,t); @@ -885,14 +857,11 @@ s = m|n|o|p; } } - WRITE(dst, s); + WRITE(pDst, dst, s); } dst++; } } - - fbFinishAccess (pDst->pDrawable); - fbFinishAccess (pSrc->pDrawable); } static void @@ -936,18 +905,15 @@ uint32_t m, d; uint32_t r; - a = READ(mask++); - d = READ(dst); + a = READ(pMask, mask++); + d = READ(pDst, dst); m = FbInU (sa, 0, a, tmp); r = FbAdd (m, d, 0, tmp); - WRITE(dst++, r); + WRITE(pDst, dst++, r); } } - - fbFinishAccess(pDst->pDrawable); - fbFinishAccess(pMask->pDrawable); } void @@ -966,7 +932,7 @@ { /* FIXME */ #if 0 - + uint32_t *dstBits, *srcBits; int dstStride, srcStride; int dstBpp, srcBpp; @@ -995,8 +961,6 @@ FALSE, FALSE); - fbFinishAccess(pDst->pDrawable); - fbFinishAccess(pSrc->pDrawable); #endif } @@ -1057,8 +1021,6 @@ FB_ALLONES, 0x0); - fbFinishAccess (pDst->pDrawable); - fbFinishAccess (pMask->pDrawable); #endif } @@ -1108,14 +1070,14 @@ int dstBpp; pixman_bool_t reverse = FALSE; pixman_bool_t upsidedown = FALSE; - + fbGetDrawable(pSrc->pDrawable,src,srcStride,srcBpp,srcXoff,srcYoff); fbGetDrawable(pDst->pDrawable,dst,dstStride,dstBpp,dstXoff,dstYoff); - + fbBlt (src + (ySrc + srcYoff) * srcStride, srcStride, (xSrc + srcXoff) * srcBpp, - + dst + (yDst + dstYoff) * dstStride, dstStride, (xDst + dstXoff) * dstBpp, @@ -1129,9 +1091,6 @@ reverse, upsidedown); - - fbFinishAccess(pSrc->pDrawable); - fbFinishAccess(pDst->pDrawable); #endif } @@ -1163,7 +1122,7 @@ uint16_t height) { uint32_t src; - + fbComposeGetSolid(pSrc, src, pDst->bits.format); if (pDst->bits.format == PIXMAN_a8) @@ -1208,9 +1167,6 @@ dst += dstStride; src += srcStride; } - - fbFinishAccess(pSrc->pDrawable); - fbFinishAccess(pDst->pDrawable); } static void @@ -1245,7 +1201,7 @@ } region = ® - + pbox = pixman_region_rectangles (region, &n); while (n--) { @@ -1310,7 +1266,7 @@ { if (image->type == SOLID) return TRUE; - + if (image->type != BITS || image->bits.width != 1 || image->bits.height != 1) @@ -1359,7 +1315,7 @@ return_if_fail (src != NULL); return_if_fail (dest != NULL); - + if (width > SCANLINE_BUFFER_LENGTH) { scanline_buffer = (uint32_t *)pixman_malloc_abc (width, 3, sizeof (uint32_t)); @@ -1367,7 +1323,7 @@ if (!scanline_buffer) return; } - + compose_data.op = op; compose_data.src = src; compose_data.mask = mask; @@ -1385,8 +1341,258 @@ if (scanline_buffer != _scanline_buffer) free (scanline_buffer); -} +} + +/* These "formats" both have depth 0, so they + * will never clash with any real ones + */ +#define PIXMAN_null PIXMAN_FORMAT(0,0,0,0,0,0) +#define PIXMAN_solid PIXMAN_FORMAT(0,1,0,0,0,0) + +#define NEED_COMPONENT_ALPHA (1 << 0) +#define NEED_PIXBUF (1 << 1) +#define NEED_SOLID_MASK (1 << 2) + +typedef struct +{ + pixman_op_t op; + pixman_format_code_t src_format; + pixman_format_code_t mask_format; + pixman_format_code_t dest_format; + CompositeFunc func; + uint32_t flags; +} FastPathInfo; + +#ifdef USE_MMX +static const FastPathInfo mmx_fast_paths[] = +{ + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_r5g6b5, fbCompositeSolidMask_nx8x0565mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_b5g6r5, fbCompositeSolidMask_nx8x0565mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeSolidMask_nx8x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeSolidMask_nx8x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8b8g8r8, fbCompositeSolidMask_nx8x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeSolidMask_nx8x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8, PIXMAN_a8r8g8b8, fbCompositeSolidMask_nx8888x8888Cmmx, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8, PIXMAN_x8r8g8b8, fbCompositeSolidMask_nx8888x8888Cmmx, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8, PIXMAN_r5g6b5, fbCompositeSolidMask_nx8888x0565Cmmx, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8, PIXMAN_a8b8g8r8, fbCompositeSolidMask_nx8888x8888Cmmx, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8, PIXMAN_x8b8g8r8, fbCompositeSolidMask_nx8888x8888Cmmx, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8, PIXMAN_b5g6r5, fbCompositeSolidMask_nx8888x0565Cmmx, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_a8r8g8b8, fbCompositeSrc_8888RevNPx8888mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_a8r8g8b8, fbCompositeSrc_8888RevNPx8888mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_x8r8g8b8, fbCompositeSrc_8888RevNPx8888mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_x8r8g8b8, fbCompositeSrc_8888RevNPx8888mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_r5g6b5, fbCompositeSrc_8888RevNPx0565mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_r5g6b5, fbCompositeSrc_8888RevNPx0565mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_a8b8g8r8, fbCompositeSrc_8888RevNPx8888mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_a8b8g8r8, fbCompositeSrc_8888RevNPx8888mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_x8b8g8r8, fbCompositeSrc_8888RevNPx8888mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_x8b8g8r8, fbCompositeSrc_8888RevNPx8888mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_b5g6r5, fbCompositeSrc_8888RevNPx0565mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_b5g6r5, fbCompositeSrc_8888RevNPx0565mmx, NEED_PIXBUF }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeSrc_x888xnx8888mmx, NEED_SOLID_MASK }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeSrc_x888xnx8888mmx, NEED_SOLID_MASK }, + { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8, PIXMAN_a8b8g8r8, fbCompositeSrc_x888xnx8888mmx, NEED_SOLID_MASK }, + { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeSrc_x888xnx8888mmx, NEED_SOLID_MASK }, + { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeSrc_8888x8x8888mmx, NEED_SOLID_MASK }, + { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeSrc_8888x8x8888mmx, NEED_SOLID_MASK }, + { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_a8, PIXMAN_a8b8g8r8, fbCompositeSrc_8888x8x8888mmx, NEED_SOLID_MASK }, + { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeSrc_8888x8x8888mmx, NEED_SOLID_MASK }, +#if 0 + /* FIXME: This code is commented out since it's apparently not actually faster than the generic code. */ + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeOver_x888x8x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeOver_x888x8x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_x8b8r8g8, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeOver_x888x8x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_x8b8r8g8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeOver_x888x8x8888mmx, 0 }, +#endif + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSolid_nx8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSolid_nx8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeSolid_nx0565mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeCopyAreammx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeCopyAreammx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSrc_8888x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSrc_8888x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeSrc_8888x0565mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeSrc_8888x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeSrc_8888x8888mmx, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_b5g6r5, fbCompositeSrc_8888x0565mmx, 0 }, + + { PIXMAN_OP_ADD, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSrcAdd_8888x8888mmx, 0 }, + { PIXMAN_OP_ADD, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeSrcAdd_8888x8888mmx, 0 }, + { PIXMAN_OP_ADD, PIXMAN_a8, PIXMAN_null, PIXMAN_a8, fbCompositeSrcAdd_8000x8000mmx, 0 }, + { PIXMAN_OP_ADD, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8, fbCompositeSrcAdd_8888x8x8mmx, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeSolidMaskSrc_nx8x8888mmx, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeSolidMaskSrc_nx8x8888mmx, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8b8g8r8, fbCompositeSolidMaskSrc_nx8x8888mmx, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeSolidMaskSrc_nx8x8888mmx, 0 }, + + { PIXMAN_OP_SRC, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeCopyAreammx, 0 }, + { PIXMAN_OP_SRC, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeCopyAreammx, 0 }, + { PIXMAN_OP_SRC, PIXMAN_x8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeCopyAreammx, 0 }, + { PIXMAN_OP_SRC, PIXMAN_x8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeCopyAreammx, 0 }, + { PIXMAN_OP_SRC, PIXMAN_r5g6b5, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeCopyAreammx, 0 }, + { PIXMAN_OP_SRC, PIXMAN_b5g6r5, PIXMAN_null, PIXMAN_b5g6r5, fbCompositeCopyAreammx, 0 }, + { PIXMAN_OP_IN, PIXMAN_a8, PIXMAN_null, PIXMAN_a8, fbCompositeIn_8x8mmx, 0 }, + { PIXMAN_OP_IN, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8, fbCompositeIn_nx8x8mmx, 0 }, + { PIXMAN_OP_NONE }, +}; +#endif + +#ifdef USE_SSE2 +static const FastPathInfo sse_fast_paths[] = +{ + { PIXMAN_OP_NONE }, +}; +#endif + +static const FastPathInfo c_fast_paths[] = +{ + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_r5g6b5, fbCompositeSolidMask_nx8x0565, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_b5g6r5, fbCompositeSolidMask_nx8x0565, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_r8g8b8, fbCompositeSolidMask_nx8x0888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_b8g8r8, fbCompositeSolidMask_nx8x0888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeSolidMask_nx8x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeSolidMask_nx8x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8b8g8r8, fbCompositeSolidMask_nx8x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeSolidMask_nx8x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8, PIXMAN_a8r8g8b8, fbCompositeSolidMask_nx8888x8888C, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8, PIXMAN_x8r8g8b8, fbCompositeSolidMask_nx8888x8888C, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8, PIXMAN_r5g6b5, fbCompositeSolidMask_nx8888x0565C, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8, PIXMAN_a8b8g8r8, fbCompositeSolidMask_nx8888x8888C, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8, PIXMAN_x8b8g8r8, fbCompositeSolidMask_nx8888x8888C, NEED_COMPONENT_ALPHA }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8, PIXMAN_b5g6r5, fbCompositeSolidMask_nx8888x0565C, NEED_COMPONENT_ALPHA }, +#if 0 + /* FIXME: This code is commented out since it's apparently not actually faster than the generic code */ + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeOver_x888x8x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeOver_x888x8x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_x8b8r8g8, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeOver_x888x8x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_x8b8r8g8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeOver_x888x8x8888, 0 }, +#endif + { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSrc_8888x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSrc_8888x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeSrc_8888x0565, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeSrc_8888x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeSrc_8888x8888, 0 }, + { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_b5g6r5, fbCompositeSrc_8888x0565, 0 }, +#if 0 + /* FIXME */ + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a1, PIXMAN_r5g6b5, fbCompositeSolidMask_nx1xn, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a1, PIXMAN_b5g6r5, fbCompositeSolidMask_nx1xn, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a1, PIXMAN_r8g8b8, fbCompositeSolidMask_nx1xn, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a1, PIXMAN_b8g8r8, fbCompositeSolidMask_nx1xn, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a1, PIXMAN_a8r8g8b8, fbCompositeSolidMask_nx1xn, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a1, PIXMAN_a8b8g8r8, fbCompositeSolidMask_nx1xn, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a1, PIXMAN_x8r8g8b8, fbCompositeSolidMask_nx1xn, 0 }, + { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a1, PIXMAN_x8b8g8r8, fbCompositeSolidMask_nx1xn, 0 }, +#endif + { PIXMAN_OP_ADD, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSrcAdd_8888x8888, 0 }, + { PIXMAN_OP_ADD, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeSrcAdd_8888x8888, 0 }, + { PIXMAN_OP_ADD, PIXMAN_a8, PIXMAN_null, PIXMAN_a8, fbCompositeSrcAdd_8000x8000, 0 }, +#if 0 + /* FIXME */ + { PIXMAN_OP_ADD, PIXMAN_a1, PIXMAN_null, PIXMAN_a1, fbCompositeSrcAdd_1000x1000, 0 }, +#endif + { PIXMAN_OP_ADD, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8, fbCompositeSrcAdd_8888x8x8, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSolidFill, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSolidFill, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeSolidFill, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeSolidFill, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_null, PIXMAN_a8, fbCompositeSolidFill, 0 }, + { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeSolidFill, 0 }, + { PIXMAN_OP_SRC, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSrc_8888xx888, 0 }, + { PIXMAN_OP_SRC, PIXMAN_x8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSrc_8888xx888, 0 }, + { PIXMAN_OP_SRC, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeSrc_8888xx888, 0 }, + { PIXMAN_OP_SRC, PIXMAN_x8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeSrc_8888xx888, 0 }, +#if 0 + /* FIXME */ + { PIXMAN_OP_SRC, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSrcSrc_nxn, 0 }, + { PIXMAN_OP_SRC, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeSrcSrc_nxn, 0 }, + { PIXMAN_OP_SRC, PIXMAN_x8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSrcSrc_nxn, 0 }, + { PIXMAN_OP_SRC, PIXMAN_x8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeSrcSrc_nxn, 0 }, + { PIXMAN_OP_SRC, PIXMAN_r5g6b5, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeSrcSrc_nxn, 0 }, + { PIXMAN_OP_SRC, PIXMAN_b5g6r5, PIXMAN_null, PIXMAN_b5g6r5, fbCompositeSrcSrc_nxn, 0 }, +#endif + { PIXMAN_OP_IN, PIXMAN_a8, PIXMAN_null, PIXMAN_a8, fbCompositeSrcIn_8x8, 0 }, + { PIXMAN_OP_IN, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8, fbCompositeSolidMaskIn_nx8x8, 0 }, + { PIXMAN_OP_NONE }, +}; + +static pixman_bool_t +mask_is_solid (pixman_image_t *mask) +{ + if (mask->type == SOLID) + return TRUE; + + if (mask->type == BITS && + mask->common.repeat == PIXMAN_REPEAT_NORMAL && + mask->bits.width == 1 && + mask->bits.height == 1) + { + return TRUE; + } + + return FALSE; +} + +static const FastPathInfo * +get_fast_path (const FastPathInfo *fast_paths, + pixman_op_t op, + pixman_image_t *pSrc, + pixman_image_t *pMask, + pixman_image_t *pDst, + pixman_bool_t is_pixbuf) +{ + const FastPathInfo *info; + + for (info = fast_paths; info->op != PIXMAN_OP_NONE; info++) + { + pixman_bool_t valid_src = FALSE; + pixman_bool_t valid_mask = FALSE; + if (info->op != op) + continue; + + if ((info->src_format == PIXMAN_solid && can_get_solid (pSrc)) || + (pSrc->type == BITS && info->src_format == pSrc->bits.format)) + { + valid_src = TRUE; + } + + if (!valid_src) + continue; + + if ((info->mask_format == PIXMAN_null && !pMask) || + (pMask && pMask->type == BITS && info->mask_format == pMask->bits.format)) + { + valid_mask = TRUE; + + if (info->flags & NEED_SOLID_MASK) + { + if (!pMask || !mask_is_solid (pMask)) + valid_mask = FALSE; + } + + if (info->flags & NEED_COMPONENT_ALPHA) + { + if (!pMask || !pMask->common.component_alpha) + valid_mask = FALSE; + } + } + + if (!valid_mask) + continue; + + if (info->dest_format != pDst->bits.format) + continue; + + if ((info->flags & NEED_PIXBUF) && !is_pixbuf) + continue; + + return info; + } + + return NULL; +} void pixman_image_composite (pixman_op_t op, @@ -1402,29 +1608,30 @@ uint16_t width, uint16_t height) { - pixman_bool_t srcRepeat = pSrc->type == BITS && pSrc->common.repeat == PIXMAN_REPEAT_NORMAL; - pixman_bool_t maskRepeat = FALSE; - pixman_bool_t srcTransform = pSrc->common.transform != NULL; - pixman_bool_t maskTransform = FALSE; - pixman_bool_t srcAlphaMap = pSrc->common.alpha_map != NULL; - pixman_bool_t maskAlphaMap = FALSE; - pixman_bool_t dstAlphaMap = pDst->common.alpha_map != NULL; - CompositeFunc func = NULL; + pixman_bool_t srcRepeat = pSrc->type == BITS && pSrc->common.repeat == PIXMAN_REPEAT_NORMAL; + pixman_bool_t maskRepeat = FALSE; + pixman_bool_t srcTransform = pSrc->common.transform != NULL; + pixman_bool_t maskTransform = FALSE; + pixman_bool_t srcAlphaMap = pSrc->common.alpha_map != NULL; + pixman_bool_t maskAlphaMap = FALSE; + pixman_bool_t dstAlphaMap = pDst->common.alpha_map != NULL; + CompositeFunc func = NULL; +#ifdef USE_SSE2 + fbComposeSetupSSE(); +#endif + #ifdef USE_MMX - static pixman_bool_t mmx_setup = FALSE; - if (!mmx_setup) - { - fbComposeSetupMMX(); - mmx_setup = TRUE; - } + fbComposeSetupMMX(); #endif if (srcRepeat && srcTransform && pSrc->bits.width == 1 && pSrc->bits.height == 1) + { srcTransform = FALSE; - + } + if (pMask && pMask->type == BITS) { maskRepeat = pMask->common.repeat == PIXMAN_REPEAT_NORMAL; @@ -1438,584 +1645,63 @@ if (maskRepeat && maskTransform && pMask->bits.width == 1 && pMask->bits.height == 1) + { maskTransform = FALSE; + } } if ((pSrc->type == BITS || can_get_solid (pSrc)) && (!pMask || pMask->type == BITS) && !srcTransform && !maskTransform && !maskAlphaMap && !srcAlphaMap && !dstAlphaMap && (pSrc->common.filter != PIXMAN_FILTER_CONVOLUTION) - && (!pMask || pMask->common.filter != PIXMAN_FILTER_CONVOLUTION) + && (pSrc->common.repeat != PIXMAN_REPEAT_PAD) + && (!pMask || (pMask->common.filter != PIXMAN_FILTER_CONVOLUTION && pMask->common.repeat != PIXMAN_REPEAT_PAD)) && !pSrc->common.read_func && !pSrc->common.write_func && !(pMask && pMask->common.read_func) && !(pMask && pMask->common.write_func) && !pDst->common.read_func && !pDst->common.write_func) - switch (op) { - case PIXMAN_OP_OVER: - if (pMask) - { - if (can_get_solid(pSrc) && - !maskRepeat) - { - if (pSrc->type == SOLID || PIXMAN_FORMAT_COLOR(pSrc->bits.format)) { - switch (pMask->bits.format) { - case PIXMAN_a8: - switch (pDst->bits.format) { - case PIXMAN_r5g6b5: - case PIXMAN_b5g6r5: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSolidMask_nx8x0565mmx; - else -#endif - func = fbCompositeSolidMask_nx8x0565; - break; - case PIXMAN_r8g8b8: - case PIXMAN_b8g8r8: - func = fbCompositeSolidMask_nx8x0888; - break; - case PIXMAN_a8r8g8b8: - case PIXMAN_x8r8g8b8: - case PIXMAN_a8b8g8r8: - case PIXMAN_x8b8g8r8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSolidMask_nx8x8888mmx; - else -#endif - func = fbCompositeSolidMask_nx8x8888; - break; - default: - break; - } - break; - case PIXMAN_a8r8g8b8: - if (pMask->common.component_alpha) { - switch (pDst->bits.format) { - case PIXMAN_a8r8g8b8: - case PIXMAN_x8r8g8b8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSolidMask_nx8888x8888Cmmx; - else -#endif - func = fbCompositeSolidMask_nx8888x8888C; - break; - case PIXMAN_r5g6b5: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSolidMask_nx8888x0565Cmmx; - else -#endif - func = fbCompositeSolidMask_nx8888x0565C; - break; - default: - break; - } - } - break; - case PIXMAN_a8b8g8r8: - if (pMask->common.component_alpha) { - switch (pDst->bits.format) { - case PIXMAN_a8b8g8r8: - case PIXMAN_x8b8g8r8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSolidMask_nx8888x8888Cmmx; - else -#endif - func = fbCompositeSolidMask_nx8888x8888C; - break; - case PIXMAN_b5g6r5: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSolidMask_nx8888x0565Cmmx; - else -#endif - func = fbCompositeSolidMask_nx8888x0565C; - break; - default: - break; - } - } - break; - case PIXMAN_a1: - switch (pDst->bits.format) { - case PIXMAN_r5g6b5: - case PIXMAN_b5g6r5: - case PIXMAN_r8g8b8: - case PIXMAN_b8g8r8: - case PIXMAN_a8r8g8b8: - case PIXMAN_x8r8g8b8: - case PIXMAN_a8b8g8r8: - case PIXMAN_x8b8g8r8: - { - uint32_t src; + { + const FastPathInfo *info; + pixman_bool_t pixbuf; -#if 0 - /* FIXME */ - fbComposeGetSolid(pSrc, src, pDst->bits.format); - if ((src & 0xff000000) == 0xff000000) - func = fbCompositeSolidMask_nx1xn; -#endif - break; - } - default: - break; - } - break; - default: - break; - } - } - if (func) - srcRepeat = FALSE; - } - else if (!srcRepeat) /* has mask and non-repeating source */ - { - if (pSrc->bits.bits == pMask->bits.bits && - xSrc == xMask && - ySrc == yMask && - !pMask->common.component_alpha && !maskRepeat) - { - /* source == mask: non-premultiplied data */ - switch (pSrc->bits.format) { - case PIXMAN_x8b8g8r8: - switch (pMask->bits.format) { - case PIXMAN_a8r8g8b8: - case PIXMAN_a8b8g8r8: - switch (pDst->bits.format) { - case PIXMAN_a8r8g8b8: - case PIXMAN_x8r8g8b8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrc_8888RevNPx8888mmx; -#endif - break; - case PIXMAN_r5g6b5: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrc_8888RevNPx0565mmx; -#endif - break; - default: - break; - } - break; - default: - break; - } - break; - case PIXMAN_x8r8g8b8: - switch (pMask->bits.format) { - case PIXMAN_a8r8g8b8: - case PIXMAN_a8b8g8r8: - switch (pDst->bits.format) { - case PIXMAN_a8b8g8r8: - case PIXMAN_x8b8g8r8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrc_8888RevNPx8888mmx; -#endif - break; - case PIXMAN_r5g6b5: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrc_8888RevNPx0565mmx; -#endif - break; - default: - break; - } - break; - default: - break; - } - break; - default: - break; - } - break; - } - else if (maskRepeat && - pMask->bits.width == 1 && - pMask->bits.height == 1) - { - switch (pSrc->bits.format) { -#ifdef USE_MMX - case PIXMAN_x8r8g8b8: - if ((pDst->bits.format == PIXMAN_a8r8g8b8 || - pDst->bits.format == PIXMAN_x8r8g8b8) && - pMask->bits.format == PIXMAN_a8 && pixman_have_mmx()) - func = fbCompositeSrc_x888xnx8888mmx; - break; - case PIXMAN_x8b8g8r8: - if ((pDst->bits.format == PIXMAN_a8b8g8r8 || - pDst->bits.format == PIXMAN_x8b8g8r8) && - pMask->bits.format == PIXMAN_a8 && pixman_have_mmx()) - func = fbCompositeSrc_x888xnx8888mmx; - break; - case PIXMAN_a8r8g8b8: - if ((pDst->bits.format == PIXMAN_a8r8g8b8 || - pDst->bits.format == PIXMAN_x8r8g8b8) && - pMask->bits.format == PIXMAN_a8 && pixman_have_mmx()) - func = fbCompositeSrc_8888x8x8888mmx; - break; - case PIXMAN_a8b8g8r8: - if ((pDst->bits.format == PIXMAN_a8b8g8r8 || - pDst->bits.format == PIXMAN_x8b8g8r8) && - pMask->bits.format == PIXMAN_a8 && pixman_have_mmx()) - func = fbCompositeSrc_8888x8x8888mmx; - break; -#endif - default: - break; - } - - if (func) - maskRepeat = FALSE; - } - else - { -#if 0 - /* FIXME: This code is commented out since it's apparently not - * actually faster than the generic code. - */ - if (pMask->bits.format == PIXMAN_a8) - { - if ((pSrc->bits.format == PIXMAN_x8r8g8b8 && - (pDst->bits.format == PIXMAN_x8r8g8b8 || - pDst->bits.format == PIXMAN_a8r8g8b8)) || - (pSrc->bits.format == PIXMAN_x8b8g8r8 && - (pDst->bits.format == PIXMAN_x8b8g8r8 || - pDst->bits.format == PIXMAN_a8b8g8r8))) - { -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeOver_x888x8x8888mmx; - else -#endif - func = fbCompositeOver_x888x8x8888; - } - } -#endif - } - } - } - else /* no mask */ - { - if (can_get_solid(pSrc)) - { - /* no mask and repeating source */ - if (pSrc->type == SOLID || pSrc->bits.format == PIXMAN_a8r8g8b8) - { - switch (pDst->bits.format) { - case PIXMAN_a8r8g8b8: - case PIXMAN_x8r8g8b8: -#ifdef USE_MMX - if (pixman_have_mmx()) - { - srcRepeat = FALSE; - func = fbCompositeSolid_nx8888mmx; - } -#endif - break; - case PIXMAN_r5g6b5: -#ifdef USE_MMX - if (pixman_have_mmx()) - { - srcRepeat = FALSE; - func = fbCompositeSolid_nx0565mmx; - } -#endif - break; - default: - break; - } - break; - } - } - else if (! srcRepeat) - { - /* - * Formats without alpha bits are just Copy with Over - */ - if (pSrc->bits.format == pDst->bits.format && !PIXMAN_FORMAT_A(pSrc->bits.format)) - { -#ifdef USE_MMX - if (pixman_have_mmx() && - (pSrc->bits.format == PIXMAN_x8r8g8b8 || pSrc->bits.format == PIXMAN_x8b8g8r8)) - func = fbCompositeCopyAreammx; - else -#endif -#if 0 - /* FIXME */ - func = fbCompositeSrcSrc_nxn -#endif - ; - } - else switch (pSrc->bits.format) { - case PIXMAN_a8r8g8b8: - switch (pDst->bits.format) { - case PIXMAN_a8r8g8b8: - case PIXMAN_x8r8g8b8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrc_8888x8888mmx; - else -#endif - func = fbCompositeSrc_8888x8888; - break; - case PIXMAN_r8g8b8: - func = fbCompositeSrc_8888x0888; - break; - case PIXMAN_r5g6b5: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrc_8888x0565mmx; - else -#endif - func = fbCompositeSrc_8888x0565; - break; - default: - break; - } - break; - case PIXMAN_x8r8g8b8: - switch (pDst->bits.format) { - case PIXMAN_x8r8g8b8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeCopyAreammx; -#endif - break; - default: - break; - } - case PIXMAN_x8b8g8r8: - switch (pDst->bits.format) { - case PIXMAN_x8b8g8r8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeCopyAreammx; + pixbuf = + pSrc && pSrc->type == BITS && + pMask && pMask->type == BITS && + pSrc->bits.bits == pMask->bits.bits && + xSrc == xMask && + ySrc == yMask && + !pMask->common.component_alpha && + !maskRepeat; + info = NULL; + +#ifdef USE_SSE2 + if (pixman_have_sse ()) + info = get_fast_path (sse_fast_paths, op, pSrc, pMask, pDst, pixbuf); + if (!info) #endif - break; - default: - break; - } - break; - case PIXMAN_a8b8g8r8: - switch (pDst->bits.format) { - case PIXMAN_a8b8g8r8: - case PIXMAN_x8b8g8r8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrc_8888x8888mmx; - else -#endif - func = fbCompositeSrc_8888x8888; - break; - case PIXMAN_b8g8r8: - func = fbCompositeSrc_8888x0888; - break; - case PIXMAN_b5g6r5: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrc_8888x0565mmx; - else -#endif - func = fbCompositeSrc_8888x0565; - break; - default: - break; - } - break; - default: - break; - } - } - } - break; - case PIXMAN_OP_ADD: - if (pMask == 0) - { - switch (pSrc->bits.format) { - case PIXMAN_a8r8g8b8: - switch (pDst->bits.format) { - case PIXMAN_a8r8g8b8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrcAdd_8888x8888mmx; - else -#endif - func = fbCompositeSrcAdd_8888x8888; - break; - default: - break; - } - break; - case PIXMAN_a8b8g8r8: - switch (pDst->bits.format) { - case PIXMAN_a8b8g8r8: -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrcAdd_8888x8888mmx; - else -#endif - func = fbCompositeSrcAdd_8888x8888; - break; - default: - break; - } - break; - case PIXMAN_a8: - switch (pDst->bits.format) { - case PIXMAN_a8: + #ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrcAdd_8000x8000mmx; - else -#endif - func = fbCompositeSrcAdd_8000x8000; - break; - default: - break; - } - break; - case PIXMAN_a1: - switch (pDst->bits.format) { - case PIXMAN_a1: -#if 0 - /* FIXME */ - func = fbCompositeSrcAdd_1000x1000; + + if (pixman_have_mmx()) + info = get_fast_path (mmx_fast_paths, op, pSrc, pMask, pDst, pixbuf); + if (!info) #endif - break; - default: - break; - } - break; - default: - break; - } - } - else + info = get_fast_path (c_fast_paths, op, pSrc, pMask, pDst, pixbuf); + + if (info) { - if (can_get_solid (pSrc) && - pMask->bits.format == PIXMAN_a8 && - pDst->bits.format == PIXMAN_a8) - { + func = info->func; + + if (info->src_format == PIXMAN_solid) srcRepeat = FALSE; -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeSrcAdd_8888x8x8mmx; - else -#endif - func = fbCompositeSrcAdd_8888x8x8; - } - } - break; - case PIXMAN_OP_SRC: - if (pMask) - { -#ifdef USE_MMX - if (can_get_solid (pSrc)) - { - if (pMask->bits.format == PIXMAN_a8) - { - switch (pDst->bits.format) - { - case PIXMAN_a8r8g8b8: - case PIXMAN_x8r8g8b8: - case PIXMAN_a8b8g8r8: - case PIXMAN_x8b8g8r8: - if (pixman_have_mmx()) - { - srcRepeat = FALSE; - func = fbCompositeSolidMaskSrc_nx8x8888mmx; - } - break; - default: - break; - } - } - } -#endif - } - else - { - if (can_get_solid (pSrc)) - { - switch (pDst->bits.format) - { - case PIXMAN_a8r8g8b8: - case PIXMAN_x8r8g8b8: - case PIXMAN_a8b8g8r8: - case PIXMAN_x8b8g8r8: - case PIXMAN_a8: - case PIXMAN_r5g6b5: - func = fbCompositeSolidFill; - srcRepeat = FALSE; - break; - default: - break; - } - } - else if (pSrc->bits.format == pDst->bits.format) - { -#ifdef USE_MMX - if (pSrc->bits.bits != pDst->bits.bits && pixman_have_mmx() && - (PIXMAN_FORMAT_BPP (pSrc->bits.format) == 16 || - PIXMAN_FORMAT_BPP (pSrc->bits.format) == 32)) - func = fbCompositeCopyAreammx; - else -#endif - /* FIXME */ -#if 0 - func = fbCompositeSrcSrc_nxn -#endif - ; - } - else if (((pSrc->bits.format == PIXMAN_a8r8g8b8 || - pSrc->bits.format == PIXMAN_x8r8g8b8) && - pDst->bits.format == PIXMAN_x8r8g8b8) || - ((pSrc->bits.format == PIXMAN_a8b8g8r8 || - pSrc->bits.format == PIXMAN_x8b8g8r8) && - pDst->bits.format == PIXMAN_x8b8g8r8)) + + if (info->mask_format == PIXMAN_solid || + info->flags & NEED_SOLID_MASK) { - func = fbCompositeSrc_8888xx888; + maskRepeat = FALSE; } } - break; - case PIXMAN_OP_IN: - if (pSrc->bits.format == PIXMAN_a8 && - pDst->bits.format == PIXMAN_a8 && - !pMask) - { -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeIn_8x8mmx; - else -#endif - func = fbCompositeSrcIn_8x8; - } - else if (srcRepeat && pMask && !pMask->common.component_alpha && - (pSrc->bits.format == PIXMAN_a8r8g8b8 || - pSrc->bits.format == PIXMAN_a8b8g8r8) && - (pMask->bits.format == PIXMAN_a8) && - pDst->bits.format == PIXMAN_a8) - { -#ifdef USE_MMX - if (pixman_have_mmx()) - func = fbCompositeIn_nx8x8mmx; - else -#endif - func = fbCompositeSolidMaskIn_nx8x8; - srcRepeat = FALSE; - } - break; - default: - break; } - + if ((srcRepeat && pSrc->bits.width == 1 && pSrc->bits.height == 1) || @@ -2033,8 +1719,9 @@ */ func = NULL; } - - if (!func) { + + if (!func) + { func = pixman_image_composite_rect; /* CompositeGeneral optimizes 1x1 repeating images itself */ @@ -2043,7 +1730,7 @@ { srcRepeat = FALSE; } - + if (pMask && pMask->type == BITS && pMask->bits.width == 1 && pMask->bits.height == 1) { @@ -2053,9 +1740,9 @@ /* if we are transforming, repeats are handled in fbFetchTransformed */ if (srcTransform) srcRepeat = FALSE; - + if (maskTransform) - maskTransform = FALSE; + maskRepeat = FALSE; } pixman_walk_composite_region (op, pSrc, pMask, pDst, xSrc, ySrc, @@ -2079,7 +1766,7 @@ enum CPUFeatures { NoFeatures = 0, MMX = 0x1, - MMX_Extensions = 0x2, + MMX_Extensions = 0x2, SSE = 0x6, SSE2 = 0x8, CMOV = 0x10 @@ -2145,9 +1832,9 @@ "pop %%ebx\n" "1:\n" "mov %%edx, %0\n" - : "=r" (result), - "=m" (vendor[0]), - "=m" (vendor[4]), + : "=r" (result), + "=m" (vendor[0]), + "=m" (vendor[4]), "=m" (vendor[8]) : : "%eax", "%ecx", "%edx" @@ -2190,7 +1877,7 @@ #else # error unsupported compiler #endif - + features = 0; if (result) { /* result now contains the standard feature bits */ @@ -2258,8 +1945,27 @@ mmx_present = (features & (MMX|MMX_Extensions)) == (MMX|MMX_Extensions); initialized = TRUE; } - + return mmx_present; } + +#ifdef USE_SSE2 +pixman_bool_t +pixman_have_sse (void) +{ + static pixman_bool_t initialized = FALSE; + static pixman_bool_t sse_present; + + if (!initialized) + { + unsigned int features = detectCPUFeatures(); + sse_present = (features & (MMX|MMX_Extensions|SSE|SSE2)) == (MMX|MMX_Extensions|SSE|SSE2); + initialized = TRUE; + } + + return sse_present; +} +#endif + #endif /* __amd64__ */ -#endif +#endif diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-private.h /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-private.h --- pixman-0.9.6/pixman/pixman-private.h 2007-10-24 18:30:17.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-private.h 2008-03-24 14:13:13.000000000 +0100 @@ -27,6 +27,7 @@ # define BITMAP_BIT_ORDER LSBFirst #endif +#undef DEBUG #define DEBUG 0 #if defined (__GNUC__) @@ -39,16 +40,25 @@ #ifndef INT16_MIN # define INT16_MIN (-32767-1) +#endif + +#ifndef INT16_MAX # define INT16_MAX (32767) #endif #ifndef INT32_MIN # define INT32_MIN (-2147483647-1) +#endif + +#ifndef INT32_MAX # define INT32_MAX (2147483647) #endif #ifndef UINT32_MIN # define UINT32_MIN (0) +#endif + +#ifndef UINT32_MAX # define UINT32_MAX (4294967295U) #endif @@ -65,7 +75,7 @@ #define FB_HALFUNIT (1 << (FB_SHIFT-1)) #define FB_MASK (FB_UNIT - 1) #define FB_ALLONES ((uint32_t) -1) - + /* Memory allocation helpers */ void *pixman_malloc_ab (unsigned int n, unsigned int b); void *pixman_malloc_abc (unsigned int a, unsigned int b, unsigned int c); @@ -136,6 +146,12 @@ typedef FASTCALL void (*CombineMaskU) (uint32_t *src, const uint32_t *mask, int width); typedef FASTCALL void (*CombineFuncU) (uint32_t *dest, const uint32_t *src, int width); typedef FASTCALL void (*CombineFuncC) (uint32_t *dest, uint32_t *src, uint32_t *mask, int width); +typedef FASTCALL void (*fetchProc)(bits_image_t *pict, int x, int y, int width, + uint32_t *buffer); +typedef FASTCALL uint32_t (*fetchPixelProc)(bits_image_t *pict, int offset, int line); +typedef FASTCALL void (*storeProc)(pixman_image_t *, uint32_t *bits, + const uint32_t *values, int x, int width, + const pixman_indexed_t *); typedef struct _FbComposeData { uint8_t op; @@ -165,6 +181,32 @@ void pixman_composite_rect_general (const FbComposeData *data, uint32_t *scanline_buffer); +fetchProc pixman_fetchProcForPicture (bits_image_t *); +fetchPixelProc pixman_fetchPixelProcForPicture (bits_image_t *); +storeProc pixman_storeProcForPicture (bits_image_t *); +fetchProc pixman_fetchProcForPicture_accessors (bits_image_t *); +fetchPixelProc pixman_fetchPixelProcForPicture_accessors (bits_image_t *); +storeProc pixman_storeProcForPicture_accessors (bits_image_t *); + +void pixmanFetchSourcePict(source_image_t *, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, uint32_t maskBits); + +void fbFetchTransformed(bits_image_t *, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, uint32_t maskBits); +void fbStoreExternalAlpha(bits_image_t *, int x, int y, int width, + uint32_t *buffer); +void fbFetchExternalAlpha(bits_image_t *, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, uint32_t maskBits); + +void fbFetchTransformed_accessors(bits_image_t *, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, + uint32_t maskBits); +void fbStoreExternalAlpha_accessors(bits_image_t *, int x, int y, int width, + uint32_t *buffer); +void fbFetchExternalAlpha_accessors(bits_image_t *, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, + uint32_t maskBits); + /* end */ typedef enum @@ -221,7 +263,7 @@ source_image_t common; uint32_t color; /* FIXME: shouldn't this be a pixman_color_t? */ }; - + struct gradient { source_image_t common; @@ -263,7 +305,7 @@ gradient_t common; pixman_point_fixed_t center; pixman_fixed_t angle; -}; +}; struct bits_image { @@ -289,6 +331,11 @@ solid_fill_t solid; }; + +extern CombineFuncU pixman_fbCombineFuncU[]; +extern CombineFuncC pixman_fbCombineFuncC[]; +FASTCALL void pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int width); + #define LOG2_BITMAP_PAD 5 #define FB_STIP_SHIFT LOG2_BITMAP_PAD #define FB_STIP_UNIT (1 << FB_STIP_SHIFT) @@ -331,23 +378,23 @@ } #if IMAGE_BYTE_ORDER == MSBFirst -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - ((READ(a) << 16) | READ((uint16_t *) ((a)+1))) : \ - ((READ((uint16_t *) (a)) << 8) | READ((a)+2))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (uint8_t) ((v) >> 16)), \ - WRITE((uint16_t *) ((a)+1), (uint16_t) (v))) : \ - (WRITE((uint16_t *) (a), (uint16_t) ((v) >> 8)), \ - WRITE((a)+2, (uint8_t) (v)))) +#define Fetch24(img, a) ((unsigned long) (a) & 1 ? \ + ((READ(img, a) << 16) | READ(img, (uint16_t *) ((a)+1))) : \ + ((READ(img, (uint16_t *) (a)) << 8) | READ(img, (a)+2))) +#define Store24(img,a,v) ((unsigned long) (a) & 1 ? \ + (WRITE(img, a, (uint8_t) ((v) >> 16)), \ + WRITE(img, (uint16_t *) ((a)+1), (uint16_t) (v))) : \ + (WRITE(img, (uint16_t *) (a), (uint16_t) ((v) >> 8)), \ + WRITE(img, (a)+2, (uint8_t) (v)))) #else -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - (READ(a) | (READ((uint16_t *) ((a)+1)) << 8)) : \ - (READ((uint16_t *) (a)) | (READ((a)+2) << 16))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (uint8_t) (v)), \ - WRITE((uint16_t *) ((a)+1), (uint16_t) ((v) >> 8))) : \ - (WRITE((uint16_t *) (a), (uint16_t) (v)), \ - WRITE((a)+2, (uint8_t) ((v) >> 16)))) +#define Fetch24(img,a) ((unsigned long) (a) & 1 ? \ + (READ(img, a) | (READ(img, (uint16_t *) ((a)+1)) << 8)) : \ + (READ(img, (uint16_t *) (a)) | (READ(img, (a)+2) << 16))) +#define Store24(img,a,v) ((unsigned long) (a) & 1 ? \ + (WRITE(img, a, (uint8_t) (v)), \ + WRITE(img, (uint16_t *) ((a)+1), (uint16_t) ((v) >> 8))) : \ + (WRITE(img, (uint16_t *) (a), (uint16_t) (v)), \ + WRITE(img, (a)+2, (uint8_t) ((v) >> 16)))) #endif #define Alpha(x) ((x) >> 24) @@ -590,6 +637,8 @@ #define DIV(a,b) ((((a) < 0) == ((b) < 0)) ? (a) / (b) : \ ((a) - (b) + 1 - (((b) < 0) << 1)) / (b)) +#define CLIP(a,b,c) ((a) < (b) ? (b) : ((a) > (c) ? (c) : (a))) + #if 0 /* FIXME: the MOD macro above is equivalent, but faster I think */ #define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b)) @@ -636,43 +685,38 @@ #ifdef PIXMAN_FB_ACCESSORS -#define READ(ptr) \ - (image->common.read_func ((ptr), sizeof(*(ptr)))) -#define WRITE(ptr,val) \ - (image->common.write_func ((ptr), (val), sizeof (*(ptr)))) +#define READ(img, ptr) \ + ((img)->common.read_func ((ptr), sizeof(*(ptr)))) +#define WRITE(img, ptr,val) \ + ((img)->common.write_func ((ptr), (val), sizeof (*(ptr)))) -#define MEMCPY_WRAPPED(dst, src, size) \ +#define MEMCPY_WRAPPED(img, dst, src, size) \ do { \ size_t _i; \ uint8_t *_dst = (uint8_t*)(dst), *_src = (uint8_t*)(src); \ for(_i = 0; _i < size; _i++) { \ - WRITE(_dst +_i, READ(_src + _i)); \ + WRITE((img), _dst +_i, READ((img), _src + _i)); \ } \ } while (0) - -#define MEMSET_WRAPPED(dst, val, size) \ + +#define MEMSET_WRAPPED(img, dst, val, size) \ do { \ size_t _i; \ uint8_t *_dst = (uint8_t*)(dst); \ - for(_i = 0; _i < (size_t) size; _i++) { \ - WRITE(_dst +_i, (val)); \ + for(_i = 0; _i < (size_t) size; _i++) { \ + WRITE((img), _dst +_i, (val)); \ } \ } while (0) -/* FIXME */ -#define fbPrepareAccess(x) -#define fbFinishAccess(x) - #else -#define READ(ptr) (*(ptr)) -#define WRITE(ptr, val) (*(ptr) = (val)) -#define MEMCPY_WRAPPED(dst, src, size) \ +#define READ(img, ptr) (*(ptr)) +#define WRITE(img, ptr, val) (*(ptr) = (val)) +#define MEMCPY_WRAPPED(img, dst, src, size) \ memcpy(dst, src, size) -#define MEMSET_WRAPPED(dst, val, size) \ +#define MEMSET_WRAPPED(img, dst, val, size) \ memset(dst, val, size) -#define fbPrepareAccess(x) -#define fbFinishAccess(x) + #endif #define fbComposeGetSolid(img, res, fmt) \ @@ -692,21 +736,21 @@ switch (PIXMAN_FORMAT_BPP((img)->bits.format)) \ { \ case 32: \ - (res) = READ((uint32_t *)bits__); \ + (res) = READ(img, (uint32_t *)bits__); \ break; \ case 24: \ - (res) = Fetch24 ((uint8_t *) bits__); \ + (res) = Fetch24(img, (uint8_t *) bits__); \ break; \ case 16: \ - (res) = READ((uint16_t *) bits__); \ + (res) = READ(img, (uint16_t *) bits__); \ (res) = cvt0565to0888(res); \ break; \ case 8: \ - (res) = READ((uint8_t *) bits__); \ + (res) = READ(img, (uint8_t *) bits__); \ (res) = (res) << 24; \ break; \ case 1: \ - (res) = READ((uint32_t *) bits__); \ + (res) = READ(img, (uint32_t *) bits__); \ (res) = FbLeftStipBits((res),1) ? 0xff000000 : 0x00000000; \ break; \ default: \ @@ -736,7 +780,7 @@ __bits__ = pict->bits.bits; \ __stride__ = pict->bits.rowstride; \ __bpp__ = PIXMAN_FORMAT_BPP(pict->bits.format); \ - (out_stride) = __stride__ * sizeof (uint32_t) / sizeof (type); \ + (out_stride) = __stride__ * (int) sizeof (uint32_t) / (int) sizeof (type); \ (line) = ((type *) __bits__) + \ (out_stride) * (y) + (mul) * (x); \ } while (0) @@ -748,7 +792,7 @@ #define MAX_ALPHA(n) ((1 << (n)) - 1) #define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1) -#define N_X_FRAC(n) ((1 << ((n)/2)) + 1) +#define N_X_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) + 1) #define STEP_Y_SMALL(n) (pixman_fixed_1 / N_Y_FRAC(n)) #define STEP_Y_BIG(n) (pixman_fixed_1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n)) @@ -838,7 +882,7 @@ \ timer##tname.n_times++; \ begin##tname = OIL_STAMP(); - + #define TIMER_END(tname) \ timer##tname.total += OIL_STAMP() - begin##tname; \ } diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-region.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-region.c --- pixman-0.9.6/pixman/pixman-region.c 2007-09-13 21:51:08.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-region.c 2008-02-22 18:57:37.000000000 +0100 @@ -55,7 +55,6 @@ #include #include "pixman-private.h" -#include "pixman.h" typedef struct pixman_region16_point { int x, y; diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-source.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-source.c --- pixman-0.9.6/pixman/pixman-source.c 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-source.c 2008-03-24 14:13:13.000000000 +0100 @@ -0,0 +1,681 @@ +/* + * + * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. + * 2005 Lars Knoll & Zack Rusin, Trolltech + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "pixman-private.h" + +typedef struct +{ + uint32_t left_ag; + uint32_t left_rb; + uint32_t right_ag; + uint32_t right_rb; + int32_t left_x; + int32_t right_x; + int32_t stepper; + + pixman_gradient_stop_t *stops; + int num_stops; + unsigned int spread; + + int need_reset; +} GradientWalker; + +static void +_gradient_walker_init (GradientWalker *walker, + gradient_t *gradient, + unsigned int spread) +{ + walker->num_stops = gradient->n_stops; + walker->stops = gradient->stops; + walker->left_x = 0; + walker->right_x = 0x10000; + walker->stepper = 0; + walker->left_ag = 0; + walker->left_rb = 0; + walker->right_ag = 0; + walker->right_rb = 0; + walker->spread = spread; + + walker->need_reset = TRUE; +} + +static void +_gradient_walker_reset (GradientWalker *walker, + pixman_fixed_32_32_t pos) +{ + int32_t x, left_x, right_x; + pixman_color_t *left_c, *right_c; + int n, count = walker->num_stops; + pixman_gradient_stop_t * stops = walker->stops; + + static const pixman_color_t transparent_black = { 0, 0, 0, 0 }; + + switch (walker->spread) + { + case PIXMAN_REPEAT_NORMAL: + x = (int32_t)pos & 0xFFFF; + for (n = 0; n < count; n++) + if (x < stops[n].x) + break; + if (n == 0) { + left_x = stops[count-1].x - 0x10000; + left_c = &stops[count-1].color; + } else { + left_x = stops[n-1].x; + left_c = &stops[n-1].color; + } + + if (n == count) { + right_x = stops[0].x + 0x10000; + right_c = &stops[0].color; + } else { + right_x = stops[n].x; + right_c = &stops[n].color; + } + left_x += (pos - x); + right_x += (pos - x); + break; + + case PIXMAN_REPEAT_PAD: + for (n = 0; n < count; n++) + if (pos < stops[n].x) + break; + + if (n == 0) { + left_x = INT32_MIN; + left_c = &stops[0].color; + } else { + left_x = stops[n-1].x; + left_c = &stops[n-1].color; + } + + if (n == count) { + right_x = INT32_MAX; + right_c = &stops[n-1].color; + } else { + right_x = stops[n].x; + right_c = &stops[n].color; + } + break; + + case PIXMAN_REPEAT_REFLECT: + x = (int32_t)pos & 0xFFFF; + if ((int32_t)pos & 0x10000) + x = 0x10000 - x; + for (n = 0; n < count; n++) + if (x < stops[n].x) + break; + + if (n == 0) { + left_x = -stops[0].x; + left_c = &stops[0].color; + } else { + left_x = stops[n-1].x; + left_c = &stops[n-1].color; + } + + if (n == count) { + right_x = 0x20000 - stops[n-1].x; + right_c = &stops[n-1].color; + } else { + right_x = stops[n].x; + right_c = &stops[n].color; + } + + if ((int32_t)pos & 0x10000) { + pixman_color_t *tmp_c; + int32_t tmp_x; + + tmp_x = 0x10000 - right_x; + right_x = 0x10000 - left_x; + left_x = tmp_x; + + tmp_c = right_c; + right_c = left_c; + left_c = tmp_c; + + x = 0x10000 - x; + } + left_x += (pos - x); + right_x += (pos - x); + break; + + default: /* RepeatNone */ + for (n = 0; n < count; n++) + if (pos < stops[n].x) + break; + + if (n == 0) + { + left_x = INT32_MIN; + right_x = stops[0].x; + left_c = right_c = (pixman_color_t*) &transparent_black; + } + else if (n == count) + { + left_x = stops[n-1].x; + right_x = INT32_MAX; + left_c = right_c = (pixman_color_t*) &transparent_black; + } + else + { + left_x = stops[n-1].x; + right_x = stops[n].x; + left_c = &stops[n-1].color; + right_c = &stops[n].color; + } + } + + walker->left_x = left_x; + walker->right_x = right_x; + walker->left_ag = ((left_c->alpha >> 8) << 16) | (left_c->green >> 8); + walker->left_rb = ((left_c->red & 0xff00) << 8) | (left_c->blue >> 8); + walker->right_ag = ((right_c->alpha >> 8) << 16) | (right_c->green >> 8); + walker->right_rb = ((right_c->red & 0xff00) << 8) | (right_c->blue >> 8); + + if ( walker->left_x == walker->right_x || + ( walker->left_ag == walker->right_ag && + walker->left_rb == walker->right_rb ) ) + { + walker->stepper = 0; + } + else + { + int32_t width = right_x - left_x; + walker->stepper = ((1 << 24) + width/2)/width; + } + + walker->need_reset = FALSE; +} + +#define GRADIENT_WALKER_NEED_RESET(w,x) \ + ( (w)->need_reset || (x) < (w)->left_x || (x) >= (w)->right_x) + + +/* the following assumes that GRADIENT_WALKER_NEED_RESET(w,x) is FALSE */ +static uint32_t +_gradient_walker_pixel (GradientWalker *walker, + pixman_fixed_32_32_t x) +{ + int dist, idist; + uint32_t t1, t2, a, color; + + if (GRADIENT_WALKER_NEED_RESET (walker, x)) + _gradient_walker_reset (walker, x); + + dist = ((int)(x - walker->left_x)*walker->stepper) >> 16; + idist = 256 - dist; + + /* combined INTERPOLATE and premultiply */ + t1 = walker->left_rb*idist + walker->right_rb*dist; + t1 = (t1 >> 8) & 0xff00ff; + + t2 = walker->left_ag*idist + walker->right_ag*dist; + t2 &= 0xff00ff00; + + color = t2 & 0xff000000; + a = t2 >> 24; + + t1 = t1*a + 0x800080; + t1 = (t1 + ((t1 >> 8) & 0xff00ff)) >> 8; + + t2 = (t2 >> 8)*a + 0x800080; + t2 = (t2 + ((t2 >> 8) & 0xff00ff)); + + return (color | (t1 & 0xff00ff) | (t2 & 0xff00)); +} + +void pixmanFetchSourcePict(source_image_t * pict, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, uint32_t maskBits) +{ +#if 0 + SourcePictPtr pGradient = pict->pSourcePict; +#endif + GradientWalker walker; + uint32_t *end = buffer + width; + gradient_t *gradient; + + if (pict->common.type == SOLID) + { + register uint32_t color = ((solid_fill_t *)pict)->color; + + while (buffer < end) + *(buffer++) = color; + + return; + } + + gradient = (gradient_t *)pict; + + _gradient_walker_init (&walker, gradient, pict->common.repeat); + + if (pict->common.type == LINEAR) { + pixman_vector_t v, unit; + pixman_fixed_32_32_t l; + pixman_fixed_48_16_t dx, dy, a, b, off; + linear_gradient_t *linear = (linear_gradient_t *)pict; + + /* reference point is the center of the pixel */ + v.vector[0] = pixman_int_to_fixed(x) + pixman_fixed_1/2; + v.vector[1] = pixman_int_to_fixed(y) + pixman_fixed_1/2; + v.vector[2] = pixman_fixed_1; + if (pict->common.transform) { + if (!pixman_transform_point_3d (pict->common.transform, &v)) + return; + unit.vector[0] = pict->common.transform->matrix[0][0]; + unit.vector[1] = pict->common.transform->matrix[1][0]; + unit.vector[2] = pict->common.transform->matrix[2][0]; + } else { + unit.vector[0] = pixman_fixed_1; + unit.vector[1] = 0; + unit.vector[2] = 0; + } + + dx = linear->p2.x - linear->p1.x; + dy = linear->p2.y - linear->p1.y; + l = dx*dx + dy*dy; + if (l != 0) { + a = (dx << 32) / l; + b = (dy << 32) / l; + off = (-a*linear->p1.x - b*linear->p1.y)>>16; + } + if (l == 0 || (unit.vector[2] == 0 && v.vector[2] == pixman_fixed_1)) { + pixman_fixed_48_16_t inc, t; + /* affine transformation only */ + if (l == 0) { + t = 0; + inc = 0; + } else { + t = ((a*v.vector[0] + b*v.vector[1]) >> 16) + off; + inc = (a * unit.vector[0] + b * unit.vector[1]) >> 16; + } + + if (pict->class == SOURCE_IMAGE_CLASS_VERTICAL) + { + register uint32_t color; + + color = _gradient_walker_pixel( &walker, t ); + while (buffer < end) + *(buffer++) = color; + } + else + { + if (!mask) { + while (buffer < end) + { + *(buffer) = _gradient_walker_pixel (&walker, t); + buffer += 1; + t += inc; + } + } else { + while (buffer < end) { + if (*mask++ & maskBits) + { + *(buffer) = _gradient_walker_pixel (&walker, t); + } + buffer += 1; + t += inc; + } + } + } + } + else /* projective transformation */ + { + pixman_fixed_48_16_t t; + + if (pict->class == SOURCE_IMAGE_CLASS_VERTICAL) + { + register uint32_t color; + + if (v.vector[2] == 0) + { + t = 0; + } + else + { + pixman_fixed_48_16_t x, y; + + x = ((pixman_fixed_48_16_t) v.vector[0] << 16) / v.vector[2]; + y = ((pixman_fixed_48_16_t) v.vector[1] << 16) / v.vector[2]; + t = ((a * x + b * y) >> 16) + off; + } + + color = _gradient_walker_pixel( &walker, t ); + while (buffer < end) + *(buffer++) = color; + } + else + { + while (buffer < end) + { + if (!mask || *mask++ & maskBits) + { + if (v.vector[2] == 0) { + t = 0; + } else { + pixman_fixed_48_16_t x, y; + x = ((pixman_fixed_48_16_t)v.vector[0] << 16) / v.vector[2]; + y = ((pixman_fixed_48_16_t)v.vector[1] << 16) / v.vector[2]; + t = ((a*x + b*y) >> 16) + off; + } + *(buffer) = _gradient_walker_pixel (&walker, t); + } + ++buffer; + v.vector[0] += unit.vector[0]; + v.vector[1] += unit.vector[1]; + v.vector[2] += unit.vector[2]; + } + } + } + } else { + +/* + * In the radial gradient problem we are given two circles (c₁,r₁) and + * (c₂,r₂) that define the gradient itself. Then, for any point p, we + * must compute the value(s) of t within [0.0, 1.0] representing the + * circle(s) that would color the point. + * + * There are potentially two values of t since the point p can be + * colored by both sides of the circle, (which happens whenever one + * circle is not entirely contained within the other). + * + * If we solve for a value of t that is outside of [0.0, 1.0] then we + * use the extend mode (NONE, REPEAT, REFLECT, or PAD) to map to a + * value within [0.0, 1.0]. + * + * Here is an illustration of the problem: + * + * p₂ + * p • + * • ╲ + * · ╲r₂ + * p₁ · ╲ + * • θ╲ + * ╲ ╌╌• + * ╲r₁ · c₂ + * θ╲ · + * ╌╌• + * c₁ + * + * Given (c₁,r₁), (c₂,r₂) and p, we must find an angle θ such that two + * points p₁ and p₂ on the two circles are collinear with p. Then, the + * desired value of t is the ratio of the length of p₁p to the length + * of p₁p₂. + * + * So, we have six unknown values: (p₁x, p₁y), (p₂x, p₂y), θ and t. + * We can also write six equations that constrain the problem: + * + * Point p₁ is a distance r₁ from c₁ at an angle of θ: + * + * 1. p₁x = c₁x + r₁·cos θ + * 2. p₁y = c₁y + r₁·sin θ + * + * Point p₂ is a distance r₂ from c₂ at an angle of θ: + * + * 3. p₂x = c₂x + r2·cos θ + * 4. p₂y = c₂y + r2·sin θ + * + * Point p lies at a fraction t along the line segment p₁p₂: + * + * 5. px = t·p₂x + (1-t)·p₁x + * 6. py = t·p₂y + (1-t)·p₁y + * + * To solve, first subtitute 1-4 into 5 and 6: + * + * px = t·(c₂x + r₂·cos θ) + (1-t)·(c₁x + r₁·cos θ) + * py = t·(c₂y + r₂·sin θ) + (1-t)·(c₁y + r₁·sin θ) + * + * Then solve each for cos θ and sin θ expressed as a function of t: + * + * cos θ = (-(c₂x - c₁x)·t + (px - c₁x)) / ((r₂-r₁)·t + r₁) + * sin θ = (-(c₂y - c₁y)·t + (py - c₁y)) / ((r₂-r₁)·t + r₁) + * + * To simplify this a bit, we define new variables for several of the + * common terms as shown below: + * + * p₂ + * p • + * • ╲ + * · ┆ ╲r₂ + * p₁ · ┆ ╲ + * • pdy┆ ╲ + * ╲ ┆ •c₂ + * ╲r₁ ┆ · ┆ + * ╲ ·┆ ┆cdy + * •╌╌╌╌┴╌╌╌╌╌╌╌┘ + * c₁ pdx cdx + * + * cdx = (c₂x - c₁x) + * cdy = (c₂y - c₁y) + * dr = r₂-r₁ + * pdx = px - c₁x + * pdy = py - c₁y + * + * Note that cdx, cdy, and dr do not depend on point p at all, so can + * be pre-computed for the entire gradient. The simplifed equations + * are now: + * + * cos θ = (-cdx·t + pdx) / (dr·t + r₁) + * sin θ = (-cdy·t + pdy) / (dr·t + r₁) + * + * Finally, to get a single function of t and eliminate the last + * unknown θ, we use the identity sin²θ + cos²θ = 1. First, square + * each equation, (we knew a quadratic was coming since it must be + * possible to obtain two solutions in some cases): + * + * cos²θ = (cdx²t² - 2·cdx·pdx·t + pdx²) / (dr²·t² + 2·r₁·dr·t + r₁²) + * sin²θ = (cdy²t² - 2·cdy·pdy·t + pdy²) / (dr²·t² + 2·r₁·dr·t + r₁²) + * + * Then add both together, set the result equal to 1, and express as a + * standard quadratic equation in t of the form At² + Bt + C = 0 + * + * (cdx² + cdy² - dr²)·t² - 2·(cdx·pdx + cdy·pdy + r₁·dr)·t + (pdx² + pdy² - r₁²) = 0 + * + * In other words: + * + * A = cdx² + cdy² - dr² + * B = -2·(pdx·cdx + pdy·cdy + r₁·dr) + * C = pdx² + pdy² - r₁² + * + * And again, notice that A does not depend on p, so can be + * precomputed. From here we just use the quadratic formula to solve + * for t: + * + * t = (-2·B ± ⎷(B² - 4·A·C)) / 2·A + */ + /* radial or conical */ + pixman_bool_t affine = TRUE; + double cx = 1.; + double cy = 0.; + double cz = 0.; + double rx = x + 0.5; + double ry = y + 0.5; + double rz = 1.; + + if (pict->common.transform) { + pixman_vector_t v; + /* reference point is the center of the pixel */ + v.vector[0] = pixman_int_to_fixed(x) + pixman_fixed_1/2; + v.vector[1] = pixman_int_to_fixed(y) + pixman_fixed_1/2; + v.vector[2] = pixman_fixed_1; + if (!pixman_transform_point_3d (pict->common.transform, &v)) + return; + + cx = pict->common.transform->matrix[0][0]/65536.; + cy = pict->common.transform->matrix[1][0]/65536.; + cz = pict->common.transform->matrix[2][0]/65536.; + rx = v.vector[0]/65536.; + ry = v.vector[1]/65536.; + rz = v.vector[2]/65536.; + affine = pict->common.transform->matrix[2][0] == 0 && v.vector[2] == pixman_fixed_1; + } + + if (pict->common.type == RADIAL) { + radial_gradient_t *radial = (radial_gradient_t *)pict; + if (affine) { + while (buffer < end) { + if (!mask || *mask++ & maskBits) + { + double pdx, pdy; + double B, C; + double det; + double c1x = radial->c1.x / 65536.0; + double c1y = radial->c1.y / 65536.0; + double r1 = radial->c1.radius / 65536.0; + pixman_fixed_48_16_t t; + + pdx = rx - c1x; + pdy = ry - c1y; + + B = -2 * ( pdx * radial->cdx + + pdy * radial->cdy + + r1 * radial->dr); + C = (pdx * pdx + pdy * pdy - r1 * r1); + + det = (B * B) - (4 * radial->A * C); + if (det < 0.0) + det = 0.0; + + if (radial->A < 0) + t = (pixman_fixed_48_16_t) ((- B - sqrt(det)) / (2.0 * radial->A) * 65536); + else + t = (pixman_fixed_48_16_t) ((- B + sqrt(det)) / (2.0 * radial->A) * 65536); + + *(buffer) = _gradient_walker_pixel (&walker, t); + } + ++buffer; + + rx += cx; + ry += cy; + } + } else { + /* projective */ + while (buffer < end) { + if (!mask || *mask++ & maskBits) + { + double pdx, pdy; + double B, C; + double det; + double c1x = radial->c1.x / 65536.0; + double c1y = radial->c1.y / 65536.0; + double r1 = radial->c1.radius / 65536.0; + pixman_fixed_48_16_t t; + double x, y; + + if (rz != 0) { + x = rx/rz; + y = ry/rz; + } else { + x = y = 0.; + } + + pdx = x - c1x; + pdy = y - c1y; + + B = -2 * ( pdx * radial->cdx + + pdy * radial->cdy + + r1 * radial->dr); + C = (pdx * pdx + pdy * pdy - r1 * r1); + + det = (B * B) - (4 * radial->A * C); + if (det < 0.0) + det = 0.0; + + if (radial->A < 0) + t = (pixman_fixed_48_16_t) ((- B - sqrt(det)) / (2.0 * radial->A) * 65536); + else + t = (pixman_fixed_48_16_t) ((- B + sqrt(det)) / (2.0 * radial->A) * 65536); + + *(buffer) = _gradient_walker_pixel (&walker, t); + } + ++buffer; + + rx += cx; + ry += cy; + rz += cz; + } + } + } else /* SourcePictTypeConical */ { + conical_gradient_t *conical = (conical_gradient_t *)pict; + double a = conical->angle/(180.*65536); + if (affine) { + rx -= conical->center.x/65536.; + ry -= conical->center.y/65536.; + + while (buffer < end) { + double angle; + + if (!mask || *mask++ & maskBits) + { + pixman_fixed_48_16_t t; + + angle = atan2(ry, rx) + a; + t = (pixman_fixed_48_16_t) (angle * (65536. / (2*M_PI))); + + *(buffer) = _gradient_walker_pixel (&walker, t); + } + + ++buffer; + rx += cx; + ry += cy; + } + } else { + while (buffer < end) { + double x, y; + double angle; + + if (!mask || *mask++ & maskBits) + { + pixman_fixed_48_16_t t; + + if (rz != 0) { + x = rx/rz; + y = ry/rz; + } else { + x = y = 0.; + } + x -= conical->center.x/65536.; + y -= conical->center.y/65536.; + angle = atan2(y, x) + a; + t = (pixman_fixed_48_16_t) (angle * (65536. / (2*M_PI))); + + *(buffer) = _gradient_walker_pixel (&walker, t); + } + + ++buffer; + rx += cx; + ry += cy; + rz += cz; + } + } + } + } +} diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-sse.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-sse.c --- pixman-0.9.6/pixman/pixman-sse.c 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-sse.c 2008-03-24 14:13:13.000000000 +0100 @@ -0,0 +1,51 @@ +/* + * Copyright © 2008 Rodrigo Kumpera + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Red Hat not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Red Hat makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * + * Author: Rodrigo Kumpera (kumpera@gmail.com) + * + */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "pixman-sse.h" + +#ifdef USE_SSE2 + +void +fbComposeSetupSSE(void) +{ + static pixman_bool_t initialized = FALSE; + + if (initialized) + return; + + /* check if we have SSE2 support and initialize accordingly */ + if (pixman_have_sse()) + { + } + + initialized = TRUE; +} + + +#endif /* USE_SSE2 */ diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-sse.h /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-sse.h --- pixman-0.9.6/pixman/pixman-sse.h 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-sse.h 2008-03-24 14:13:13.000000000 +0100 @@ -0,0 +1,53 @@ +/* + * Copyright © 2008 Rodrigo Kumpera + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Red Hat not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Red Hat makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * + * Author: Rodrigo Kumpera (kumpera@gmail.com) + * + */ +#ifndef _PIXMAN_SSE_H_ +#define _PIXMAN_SSE_H_ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "pixman-private.h" + +#ifdef USE_SSE2 + +#if !defined(__amd64__) && !defined(__x86_64__) +pixman_bool_t pixman_have_sse(void); +#else +#define pixman_have_sse() TRUE +#endif + +#else +#define pixman_have_sse() FALSE +#endif + +#ifdef USE_SSE2 + +void fbComposeSetupSSE(void); + +#endif /* USE_SSE2 */ + +#endif /* _PIXMAN_SSE_H_ */ diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-transformed-accessors.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-transformed-accessors.c --- pixman-0.9.6/pixman/pixman-transformed-accessors.c 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-transformed-accessors.c 2008-03-24 14:13:13.000000000 +0100 @@ -0,0 +1,3 @@ +#define PIXMAN_FB_ACCESSORS + +#include "pixman-transformed.c" diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-transformed.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-transformed.c --- pixman-0.9.6/pixman/pixman-transformed.c 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-transformed.c 2008-03-24 14:13:13.000000000 +0100 @@ -0,0 +1,726 @@ +/* + * + * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. + * 2005 Lars Knoll & Zack Rusin, Trolltech + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "pixman-private.h" + +#ifdef PIXMAN_FB_ACCESSORS +#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture_accessors +#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture_accessors +#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture_accessors + +#define FB_FETCH_TRANSFORMED fbFetchTransformed_accessors +#define FB_FETCH_EXTERNAL_ALPHA fbFetchExternalAlpha_accessors +#define FB_STORE_EXTERNAL_ALPHA fbStoreExternalAlpha_accessors + +#else + +#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture +#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture +#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture + +#define FB_FETCH_TRANSFORMED fbFetchTransformed +#define FB_FETCH_EXTERNAL_ALPHA fbFetchExternalAlpha +#define FB_STORE_EXTERNAL_ALPHA fbStoreExternalAlpha + +#endif + +/* + * Fetch from region strategies + */ +typedef FASTCALL uint32_t (*fetchFromRegionProc)(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box); + +static inline uint32_t +fbFetchFromNoRegion(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box) +{ + return fetch (pict, x, y); +} + +static uint32_t +fbFetchFromNRectangles(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box) +{ + pixman_box16_t box2; + if (pixman_region_contains_point (pict->common.src_clip, x, y, &box2)) + return fbFetchFromNoRegion(pict, x, y, buffer, fetch, box); + else + return 0; +} + +static uint32_t +fbFetchFromOneRectangle(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box) +{ + pixman_box16_t box2 = *box; + return ((x < box2.x1) | (x >= box2.x2) | (y < box2.y1) | (y >= box2.y2)) ? + 0 : fbFetchFromNoRegion(pict, x, y, buffer, fetch, box); +} + +/* + * Fetching Algorithms + */ +static void +fbFetchTransformed_Nearest_Normal(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit) +{ + pixman_box16_t* box = NULL; + fetchPixelProc fetch; + fetchFromRegionProc fetchFromRegion; + int x, y, i; + + /* initialize the two function pointers */ + fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict); + + if(pixman_region_n_rects (pict->common.src_clip) == 1) + fetchFromRegion = fbFetchFromNoRegion; + else + fetchFromRegion = fbFetchFromNRectangles; + + for ( i = 0; i < width; ++i) + { + if (!mask || mask[i] & maskBits) + { + if (!v.vector[2]) + { + *(buffer + i) = 0; + } + else + { + if (!affine) + { + y = MOD(DIV(v.vector[1],v.vector[2]), pict->height); + x = MOD(DIV(v.vector[0],v.vector[2]), pict->width); + } + else + { + y = MOD(v.vector[1]>>16, pict->height); + x = MOD(v.vector[0]>>16, pict->width); + } + *(buffer + i) = fetchFromRegion(pict, x, y, buffer, fetch, box); + } + } + + v.vector[0] += unit.vector[0]; + v.vector[1] += unit.vector[1]; + v.vector[2] += unit.vector[2]; + } +} + +static void +fbFetchTransformed_Nearest_Pad(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit) +{ + pixman_box16_t *box = NULL; + fetchPixelProc fetch; + fetchFromRegionProc fetchFromRegion; + int x, y, i; + + /* initialize the two function pointers */ + fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict); + + if(pixman_region_n_rects (pict->common.src_clip) == 1) + fetchFromRegion = fbFetchFromNoRegion; + else + fetchFromRegion = fbFetchFromNRectangles; + + for (i = 0; i < width; ++i) + { + if (!mask || mask[i] & maskBits) + { + if (!v.vector[2]) + { + *(buffer + i) = 0; + } + else + { + if (!affine) + { + y = CLIP(DIV(v.vector[1], v.vector[2]), 0, pict->height-1); + x = CLIP(DIV(v.vector[0], v.vector[2]), 0, pict->width-1); + } + else + { + y = CLIP(v.vector[1]>>16, 0, pict->height-1); + x = CLIP(v.vector[0]>>16, 0, pict->width-1); + } + + *(buffer + i) = fetchFromRegion(pict, x, y, buffer, fetch, box); + } + } + + v.vector[0] += unit.vector[0]; + v.vector[1] += unit.vector[1]; + v.vector[2] += unit.vector[2]; + } +} + +static void +fbFetchTransformed_Nearest_General(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit) +{ + pixman_box16_t *box = NULL; + fetchPixelProc fetch; + fetchFromRegionProc fetchFromRegion; + int x, y, i; + + /* initialize the two function pointers */ + fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict); + + if(pixman_region_n_rects (pict->common.src_clip) == 1) + { + box = &(pict->common.src_clip->extents); + fetchFromRegion = fbFetchFromOneRectangle; + } + else + { + fetchFromRegion = fbFetchFromNRectangles; + } + + for (i = 0; i < width; ++i) { + if (!mask || mask[i] & maskBits) + { + if (!v.vector[2]) { + *(buffer + i) = 0; + } else { + if (!affine) { + y = DIV(v.vector[1],v.vector[2]); + x = DIV(v.vector[0],v.vector[2]); + } else { + y = v.vector[1]>>16; + x = v.vector[0]>>16; + } + *(buffer + i) = fetchFromRegion(pict, x, y, buffer, fetch, box); + } + } + v.vector[0] += unit.vector[0]; + v.vector[1] += unit.vector[1]; + v.vector[2] += unit.vector[2]; + } +} + +static void +fbFetchTransformed_Bilinear_Normal(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit) +{ + pixman_box16_t *box = NULL; + fetchPixelProc fetch; + fetchFromRegionProc fetchFromRegion; + int i; + + /* initialize the two function pointers */ + fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict); + + if(pixman_region_n_rects (pict->common.src_clip) == 1) + fetchFromRegion = fbFetchFromNoRegion; + else + fetchFromRegion = fbFetchFromNRectangles; + + for (i = 0; i < width; ++i) { + if (!mask || mask[i] & maskBits) + { + if (!v.vector[2]) { + *(buffer + i) = 0; + } else { + int x1, x2, y1, y2, distx, idistx, disty, idisty; + uint32_t tl, tr, bl, br, r; + uint32_t ft, fb; + + if (!affine) { + pixman_fixed_48_16_t div; + div = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2]; + x1 = div >> 16; + distx = ((pixman_fixed_t)div >> 8) & 0xff; + div = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2]; + y1 = div >> 16; + disty = ((pixman_fixed_t)div >> 8) & 0xff; + } else { + x1 = v.vector[0] >> 16; + distx = (v.vector[0] >> 8) & 0xff; + y1 = v.vector[1] >> 16; + disty = (v.vector[1] >> 8) & 0xff; + } + x2 = x1 + 1; + y2 = y1 + 1; + + idistx = 256 - distx; + idisty = 256 - disty; + + x1 = MOD (x1, pict->width); + x2 = MOD (x2, pict->width); + y1 = MOD (y1, pict->height); + y2 = MOD (y2, pict->height); + + tl = fetchFromRegion(pict, x1, y1, buffer, fetch, box); + tr = fetchFromRegion(pict, x2, y1, buffer, fetch, box); + bl = fetchFromRegion(pict, x1, y2, buffer, fetch, box); + br = fetchFromRegion(pict, x2, y2, buffer, fetch, box); + + ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; + fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx; + r = (((ft * idisty + fb * disty) >> 16) & 0xff); + ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx; + fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx; + r |= (((ft * idisty + fb * disty) >> 8) & 0xff00); + ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx; + fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx; + r |= (((ft * idisty + fb * disty)) & 0xff0000); + ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx; + fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx; + r |= (((ft * idisty + fb * disty) << 8) & 0xff000000); + *(buffer + i) = r; + } + } + v.vector[0] += unit.vector[0]; + v.vector[1] += unit.vector[1]; + v.vector[2] += unit.vector[2]; + } +} + +static void +fbFetchTransformed_Bilinear_Pad(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit) +{ + pixman_box16_t *box = NULL; + fetchPixelProc fetch; + fetchFromRegionProc fetchFromRegion; + int i; + + /* initialize the two function pointers */ + fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict); + + if(pixman_region_n_rects (pict->common.src_clip) == 1) + fetchFromRegion = fbFetchFromNoRegion; + else + fetchFromRegion = fbFetchFromNRectangles; + + for (i = 0; i < width; ++i) { + if (!mask || mask[i] & maskBits) + { + if (!v.vector[2]) { + *(buffer + i) = 0; + } else { + int x1, x2, y1, y2, distx, idistx, disty, idisty; + uint32_t tl, tr, bl, br, r; + uint32_t ft, fb; + + if (!affine) { + pixman_fixed_48_16_t div; + div = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2]; + x1 = div >> 16; + distx = ((pixman_fixed_t)div >> 8) & 0xff; + div = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2]; + y1 = div >> 16; + disty = ((pixman_fixed_t)div >> 8) & 0xff; + } else { + x1 = v.vector[0] >> 16; + distx = (v.vector[0] >> 8) & 0xff; + y1 = v.vector[1] >> 16; + disty = (v.vector[1] >> 8) & 0xff; + } + x2 = x1 + 1; + y2 = y1 + 1; + + idistx = 256 - distx; + idisty = 256 - disty; + + x1 = CLIP (x1, 0, pict->width-1); + x2 = CLIP (x2, 0, pict->width-1); + y1 = CLIP (y1, 0, pict->height-1); + y2 = CLIP (y2, 0, pict->height-1); + + tl = fetchFromRegion(pict, x1, y1, buffer, fetch, box); + tr = fetchFromRegion(pict, x2, y1, buffer, fetch, box); + bl = fetchFromRegion(pict, x1, y2, buffer, fetch, box); + br = fetchFromRegion(pict, x2, y2, buffer, fetch, box); + + ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; + fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx; + r = (((ft * idisty + fb * disty) >> 16) & 0xff); + ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx; + fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx; + r |= (((ft * idisty + fb * disty) >> 8) & 0xff00); + ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx; + fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx; + r |= (((ft * idisty + fb * disty)) & 0xff0000); + ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx; + fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx; + r |= (((ft * idisty + fb * disty) << 8) & 0xff000000); + *(buffer + i) = r; + } + } + v.vector[0] += unit.vector[0]; + v.vector[1] += unit.vector[1]; + v.vector[2] += unit.vector[2]; + } +} + +static void +fbFetchTransformed_Bilinear_General(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit) +{ + pixman_box16_t *box = NULL; + fetchPixelProc fetch; + fetchFromRegionProc fetchFromRegion; + int i; + + /* initialize the two function pointers */ + fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict); + + if(pixman_region_n_rects (pict->common.src_clip) == 1) + { + box = &(pict->common.src_clip->extents); + fetchFromRegion = fbFetchFromOneRectangle; + } + else + { + fetchFromRegion = fbFetchFromNRectangles; + } + + for (i = 0; i < width; ++i) + { + if (!mask || mask[i] & maskBits) + { + if (!v.vector[2]) { + *(buffer + i) = 0; + } else { + int x1, x2, y1, y2, distx, idistx, disty, idisty; + uint32_t tl, tr, bl, br, r; + uint32_t ft, fb; + + if (!affine) { + pixman_fixed_48_16_t div; + div = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2]; + x1 = div >> 16; + distx = ((pixman_fixed_t)div >> 8) & 0xff; + div = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2]; + y1 = div >> 16; + disty = ((pixman_fixed_t)div >> 8) & 0xff; + } else { + x1 = v.vector[0] >> 16; + distx = (v.vector[0] >> 8) & 0xff; + y1 = v.vector[1] >> 16; + disty = (v.vector[1] >> 8) & 0xff; + } + x2 = x1 + 1; + y2 = y1 + 1; + + idistx = 256 - distx; + idisty = 256 - disty; + + tl = fetchFromRegion(pict, x1, y1, buffer, fetch, box); + tr = fetchFromRegion(pict, x2, y1, buffer, fetch, box); + bl = fetchFromRegion(pict, x1, y2, buffer, fetch, box); + br = fetchFromRegion(pict, x2, y2, buffer, fetch, box); + + ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; + fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx; + r = (((ft * idisty + fb * disty) >> 16) & 0xff); + ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx; + fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx; + r |= (((ft * idisty + fb * disty) >> 8) & 0xff00); + ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx; + fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx; + r |= (((ft * idisty + fb * disty)) & 0xff0000); + ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx; + fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx; + r |= (((ft * idisty + fb * disty) << 8) & 0xff000000); + *(buffer + i) = r; + } + } + + v.vector[0] += unit.vector[0]; + v.vector[1] += unit.vector[1]; + v.vector[2] += unit.vector[2]; + } +} + +static void +fbFetchTransformed_Convolution(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit) +{ + pixman_box16_t dummy; + fetchPixelProc fetch; + int i; + + pixman_fixed_t *params = pict->common.filter_params; + int32_t cwidth = pixman_fixed_to_int(params[0]); + int32_t cheight = pixman_fixed_to_int(params[1]); + int xoff = (params[0] - pixman_fixed_1) >> 1; + int yoff = (params[1] - pixman_fixed_1) >> 1; + fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict); + + params += 2; + for (i = 0; i < width; ++i) { + if (!mask || mask[i] & maskBits) + { + if (!v.vector[2]) { + *(buffer + i) = 0; + } else { + int x1, x2, y1, y2, x, y; + int32_t srtot, sgtot, sbtot, satot; + pixman_fixed_t *p = params; + + if (!affine) { + pixman_fixed_48_16_t tmp; + tmp = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2] - xoff; + x1 = pixman_fixed_to_int(tmp); + tmp = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2] - yoff; + y1 = pixman_fixed_to_int(tmp); + } else { + x1 = pixman_fixed_to_int(v.vector[0] - xoff); + y1 = pixman_fixed_to_int(v.vector[1] - yoff); + } + x2 = x1 + cwidth; + y2 = y1 + cheight; + + srtot = sgtot = sbtot = satot = 0; + + for (y = y1; y < y2; y++) { + int ty; + switch (pict->common.repeat) { + case PIXMAN_REPEAT_NORMAL: + ty = MOD (y, pict->height); + break; + case PIXMAN_REPEAT_PAD: + ty = CLIP (y, 0, pict->height-1); + break; + default: + ty = y; + } + for (x = x1; x < x2; x++) { + if (*p) { + int tx; + switch (pict->common.repeat) { + case PIXMAN_REPEAT_NORMAL: + tx = MOD (x, pict->width); + break; + case PIXMAN_REPEAT_PAD: + tx = CLIP (x, 0, pict->width-1); + break; + default: + tx = x; + } + if (pixman_region_contains_point (pict->common.src_clip, tx, ty, &dummy)) { + uint32_t c = fetch(pict, tx, ty); + + srtot += Red(c) * *p; + sgtot += Green(c) * *p; + sbtot += Blue(c) * *p; + satot += Alpha(c) * *p; + } + } + p++; + } + } + + satot >>= 16; + srtot >>= 16; + sgtot >>= 16; + sbtot >>= 16; + + if (satot < 0) satot = 0; else if (satot > 0xff) satot = 0xff; + if (srtot < 0) srtot = 0; else if (srtot > 0xff) srtot = 0xff; + if (sgtot < 0) sgtot = 0; else if (sgtot > 0xff) sgtot = 0xff; + if (sbtot < 0) sbtot = 0; else if (sbtot > 0xff) sbtot = 0xff; + + *(buffer + i) = ((satot << 24) | + (srtot << 16) | + (sgtot << 8) | + (sbtot )); + } + } + v.vector[0] += unit.vector[0]; + v.vector[1] += unit.vector[1]; + v.vector[2] += unit.vector[2]; + } +} + +static void +adjust (pixman_vector_t *v, pixman_vector_t *u, pixman_fixed_t adjustment) +{ + int delta_v = (adjustment * v->vector[2]) >> 16; + int delta_u = (adjustment * u->vector[2]) >> 16; + + v->vector[0] += delta_v; + v->vector[1] += delta_v; + + u->vector[0] += delta_u; + u->vector[1] += delta_u; +} + +void +FB_FETCH_TRANSFORMED(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits) +{ + uint32_t *bits; + int32_t stride; + pixman_vector_t v; + pixman_vector_t unit; + pixman_bool_t affine = TRUE; + + bits = pict->bits; + stride = pict->rowstride; + + /* reference point is the center of the pixel */ + v.vector[0] = pixman_int_to_fixed(x) + pixman_fixed_1 / 2; + v.vector[1] = pixman_int_to_fixed(y) + pixman_fixed_1 / 2; + v.vector[2] = pixman_fixed_1; + + /* when using convolution filters or PIXMAN_REPEAT_PAD one might get here without a transform */ + if (pict->common.transform) + { + if (!pixman_transform_point_3d (pict->common.transform, &v)) + return; + unit.vector[0] = pict->common.transform->matrix[0][0]; + unit.vector[1] = pict->common.transform->matrix[1][0]; + unit.vector[2] = pict->common.transform->matrix[2][0]; + affine = v.vector[2] == pixman_fixed_1 && unit.vector[2] == 0; + } + else + { + unit.vector[0] = pixman_fixed_1; + unit.vector[1] = 0; + unit.vector[2] = 0; + } + + /* This allows filtering code to pretend that pixels are located at integer coordinates */ + adjust (&v, &unit, -(pixman_fixed_1 / 2)); + + if (pict->common.filter == PIXMAN_FILTER_NEAREST || pict->common.filter == PIXMAN_FILTER_FAST) + { + /* Round down to closest integer, ensuring that 0.5 rounds to 0, not 1 */ + adjust (&v, &unit, pixman_fixed_1 / 2 - pixman_fixed_e); + + if (pict->common.repeat == PIXMAN_REPEAT_NORMAL) + { + fbFetchTransformed_Nearest_Normal(pict, width, buffer, mask, maskBits, affine, v, unit); + + } + else if (pict->common.repeat == PIXMAN_REPEAT_PAD) + { + fbFetchTransformed_Nearest_Pad(pict, width, buffer, mask, maskBits, affine, v, unit); + } + else + { + fbFetchTransformed_Nearest_General(pict, width, buffer, mask, maskBits, affine, v, unit); + } + } else if (pict->common.filter == PIXMAN_FILTER_BILINEAR || + pict->common.filter == PIXMAN_FILTER_GOOD || + pict->common.filter == PIXMAN_FILTER_BEST) + { + if (pict->common.repeat == PIXMAN_REPEAT_NORMAL) + { + fbFetchTransformed_Bilinear_Normal(pict, width, buffer, mask, maskBits, affine, v, unit); + } + else if (pict->common.repeat == PIXMAN_REPEAT_PAD) + { + fbFetchTransformed_Bilinear_Pad(pict, width, buffer, mask, maskBits, affine, v, unit); + } + else + { + fbFetchTransformed_Bilinear_General(pict, width, buffer, mask, maskBits, affine, v, unit); + } + } + else if (pict->common.filter == PIXMAN_FILTER_CONVOLUTION) + { + /* Round to closest integer, ensuring that 0.5 rounds to 0, not 1 */ + adjust (&v, &unit, pixman_fixed_1 / 2 - pixman_fixed_e); + + fbFetchTransformed_Convolution(pict, width, buffer, mask, maskBits, affine, v, unit); + } +} + +#define SCANLINE_BUFFER_LENGTH 2048 + +void +FB_FETCH_EXTERNAL_ALPHA(bits_image_t * pict, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, uint32_t maskBits) +{ + int i; + uint32_t _alpha_buffer[SCANLINE_BUFFER_LENGTH]; + uint32_t *alpha_buffer = _alpha_buffer; + + if (!pict->common.alpha_map) { + FB_FETCH_TRANSFORMED (pict, x, y, width, buffer, mask, maskBits); + return; + } + if (width > SCANLINE_BUFFER_LENGTH) + alpha_buffer = (uint32_t *) pixman_malloc_ab (width, sizeof(uint32_t)); + + FB_FETCH_TRANSFORMED(pict, x, y, width, buffer, mask, maskBits); + FB_FETCH_TRANSFORMED((bits_image_t *)pict->common.alpha_map, x - pict->common.alpha_origin.x, + y - pict->common.alpha_origin.y, width, alpha_buffer, + mask, maskBits); + for (i = 0; i < width; ++i) { + if (!mask || mask[i] & maskBits) + { + int a = alpha_buffer[i]>>24; + *(buffer + i) = (a << 24) + | (div_255(Red(*(buffer + i)) * a) << 16) + | (div_255(Green(*(buffer + i)) * a) << 8) + | (div_255(Blue(*(buffer + i)) * a)); + } + } + + if (alpha_buffer != _alpha_buffer) + free(alpha_buffer); +} + +void +FB_STORE_EXTERNAL_ALPHA(bits_image_t * pict, int x, int y, int width, + uint32_t *buffer) +{ + uint32_t *bits, *alpha_bits; + int32_t stride, astride; + int ax, ay; + storeProc store; + storeProc astore; + const pixman_indexed_t * indexed = pict->indexed; + const pixman_indexed_t * aindexed; + + if (!pict->common.alpha_map) { + // XXX[AGP]: This should never happen! + // fbStore(pict, x, y, width, buffer); + abort(); + return; + } + + store = STORE_PROC_FOR_PICTURE(pict); + astore = STORE_PROC_FOR_PICTURE(pict->common.alpha_map); + aindexed = pict->common.alpha_map->indexed; + + ax = x; + ay = y; + + bits = pict->bits; + stride = pict->rowstride; + + alpha_bits = pict->common.alpha_map->bits; + astride = pict->common.alpha_map->rowstride; + + bits += y*stride; + alpha_bits += (ay - pict->common.alpha_origin.y)*astride; + + + store((pixman_image_t *)pict, bits, buffer, x, width, indexed); + astore((pixman_image_t *)pict->common.alpha_map, + alpha_bits, buffer, ax - pict->common.alpha_origin.x, width, aindexed); +} + diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-trap.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-trap.c --- pixman-0.9.6/pixman/pixman-trap.c 2007-09-13 21:51:08.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-trap.c 2008-03-24 14:13:13.000000000 +0100 @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright © 2004 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -51,7 +49,7 @@ height = image->bits.height; bpp = PIXMAN_FORMAT_BPP (image->bits.format); - x_off_fixed = pixman_int_to_fixed(y_off); + x_off_fixed = pixman_int_to_fixed(x_off); y_off_fixed = pixman_int_to_fixed(y_off); while (ntrap--) @@ -85,8 +83,6 @@ } traps++; } - - fbFinishAccess (pPicture->pDrawable); } static void diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-utils.c /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-utils.c --- pixman-0.9.6/pixman/pixman-utils.c 2007-10-24 18:30:17.000000000 +0200 +++ pixman-0.10.0/pixman/pixman-utils.c 2008-03-27 11:58:20.000000000 +0100 @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, SuSE, Inc. @@ -26,7 +26,7 @@ #endif #include -#include "pixman.h" + #include "pixman-private.h" #include "pixman-mmx.h" @@ -54,10 +54,10 @@ result.vector[j] = (pixman_fixed_48_16_t) v; } - + if (!result.vector[2]) return FALSE; - + *vector = result; return TRUE; } @@ -93,7 +93,7 @@ int height, uint32_t xor) { - int byte_stride = stride * sizeof (uint32_t); + int byte_stride = stride * (int) sizeof (uint32_t); uint8_t *dst = (uint8_t *) bits; uint8_t v = xor & 0xff; int i; @@ -118,7 +118,7 @@ int height, uint32_t xor) { - int short_stride = (stride * sizeof (uint32_t)) / sizeof (uint16_t); + int short_stride = (stride * (int) sizeof (uint32_t)) / (int) sizeof (uint16_t); uint16_t *dst = (uint16_t *)bits; uint16_t v = xor & 0xffff; int i; @@ -144,9 +144,9 @@ uint32_t xor) { int i; - + bits = bits + y * stride + x; - + while (height--) { for (i = 0; i < width; ++i) @@ -170,7 +170,7 @@ printf ("filling: %d %d %d %d (stride: %d, bpp: %d) pixel: %x\n", x, y, width, height, stride, bpp, xor); #endif - + #ifdef USE_MMX if (!pixman_have_mmx() || !pixman_fill_mmx (bits, stride, bpp, x, y, width, height, xor)) #endif @@ -180,11 +180,11 @@ case 8: pixman_fill8 (bits, stride, x, y, width, height, xor); break; - + case 16: pixman_fill16 (bits, stride, x, y, width, height, xor); break; - + case 32: pixman_fill32 (bits, stride, x, y, width, height, xor); break; @@ -194,10 +194,10 @@ break; } } - + return TRUE; } - + /* * Compute the smallest value no less than y which is on a @@ -209,7 +209,7 @@ { pixman_fixed_t f = pixman_fixed_frac(y); pixman_fixed_t i = pixman_fixed_floor(y); - + f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); if (f > Y_FRAC_LAST(n)) { @@ -230,7 +230,7 @@ { pixman_fixed_t f = pixman_fixed_frac(y); pixman_fixed_t i = pixman_fixed_floor (y); - + f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); if (f < Y_FRAC_FIRST(n)) { @@ -249,9 +249,9 @@ pixman_fixed_48_16_t ne; e->x += n * e->stepx; - + ne = e->e + n * (pixman_fixed_48_16_t) e->dx; - + if (n >= 0) { if (ne > 0) @@ -281,7 +281,7 @@ { pixman_fixed_t stepx; pixman_fixed_48_16_t ne; - + ne = n * (pixman_fixed_48_16_t) e->dx; stepx = n * e->stepx; if (ne > 0) @@ -331,7 +331,7 @@ e->dx = -dx % dy; e->e = 0; } - + _pixman_edge_tMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small); _pixman_edge_tMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big); } @@ -407,3 +407,183 @@ else return malloc (a * b * c); } + + +/** + * pixman_version: + * + * Returns the version of the pixman library encoded in a single + * integer as per %PIXMAN_VERSION_ENCODE. The encoding ensures that + * later versions compare greater than earlier versions. + * + * A run-time comparison to check that pixman's version is greater than + * or equal to version X.Y.Z could be performed as follows: + * + * + * if (pixman_version() >= PIXMAN_VERSION_ENCODE(X,Y,Z)) {...} + * + * + * See also pixman_version_string() as well as the compile-time + * equivalents %PIXMAN_VERSION and %PIXMAN_VERSION_STRING. + * + * Return value: the encoded version. + **/ +int +pixman_version (void) +{ + return PIXMAN_VERSION; +} + +/** + * pixman_version_string: + * + * Returns the version of the pixman library as a human-readable string + * of the form "X.Y.Z". + * + * See also pixman_version() as well as the compile-time equivalents + * %PIXMAN_VERSION_STRING and %PIXMAN_VERSION. + * + * Return value: a string containing the version. + **/ +const char* +pixman_version_string (void) +{ + return PIXMAN_VERSION_STRING; +} + +/** + * pixman_format_supported_destination: + * @format: A pixman_format_code_t format + * + * Return value: whether the provided format code is a supported + * format for a pixman surface used as a destination in + * rendering. + * + * Currently, all pixman_format_code_t values are supported + * except for the YUV formats. + **/ +pixman_bool_t +pixman_format_supported_destination (pixman_format_code_t format) +{ + switch (format) { + /* 32 bpp formats */ + case PIXMAN_a8r8g8b8: + case PIXMAN_x8r8g8b8: + case PIXMAN_a8b8g8r8: + case PIXMAN_x8b8g8r8: + case PIXMAN_r8g8b8: + case PIXMAN_b8g8r8: + case PIXMAN_r5g6b5: + case PIXMAN_b5g6r5: + /* 16 bpp formats */ + case PIXMAN_a1r5g5b5: + case PIXMAN_x1r5g5b5: + case PIXMAN_a1b5g5r5: + case PIXMAN_x1b5g5r5: + case PIXMAN_a4r4g4b4: + case PIXMAN_x4r4g4b4: + case PIXMAN_a4b4g4r4: + case PIXMAN_x4b4g4r4: + /* 8bpp formats */ + case PIXMAN_a8: + case PIXMAN_r3g3b2: + case PIXMAN_b2g3r3: + case PIXMAN_a2r2g2b2: + case PIXMAN_a2b2g2r2: + case PIXMAN_c8: + case PIXMAN_g8: + case PIXMAN_x4a4: + /* Collides with PIXMAN_c8 + case PIXMAN_x4c4: + */ + /* Collides with PIXMAN_g8 + case PIXMAN_x4g4: + */ + /* 4bpp formats */ + case PIXMAN_a4: + case PIXMAN_r1g2b1: + case PIXMAN_b1g2r1: + case PIXMAN_a1r1g1b1: + case PIXMAN_a1b1g1r1: + case PIXMAN_c4: + case PIXMAN_g4: + /* 1bpp formats */ + case PIXMAN_a1: + case PIXMAN_g1: + return TRUE; + + /* YUV formats */ + case PIXMAN_yuy2: + case PIXMAN_yv12: + default: + return FALSE; + } +} + +/** + * pixman_format_supported_source: + * @format: A pixman_format_code_t format + * + * Return value: whether the provided format code is a supported + * format for a pixman surface used as a source in + * rendering. + * + * Currently, all pixman_format_code_t values are supported. + **/ +pixman_bool_t +pixman_format_supported_source (pixman_format_code_t format) +{ + switch (format) { + /* 32 bpp formats */ + case PIXMAN_a8r8g8b8: + case PIXMAN_x8r8g8b8: + case PIXMAN_a8b8g8r8: + case PIXMAN_x8b8g8r8: + case PIXMAN_r8g8b8: + case PIXMAN_b8g8r8: + case PIXMAN_r5g6b5: + case PIXMAN_b5g6r5: + /* 16 bpp formats */ + case PIXMAN_a1r5g5b5: + case PIXMAN_x1r5g5b5: + case PIXMAN_a1b5g5r5: + case PIXMAN_x1b5g5r5: + case PIXMAN_a4r4g4b4: + case PIXMAN_x4r4g4b4: + case PIXMAN_a4b4g4r4: + case PIXMAN_x4b4g4r4: + /* 8bpp formats */ + case PIXMAN_a8: + case PIXMAN_r3g3b2: + case PIXMAN_b2g3r3: + case PIXMAN_a2r2g2b2: + case PIXMAN_a2b2g2r2: + case PIXMAN_c8: + case PIXMAN_g8: + case PIXMAN_x4a4: + /* Collides with PIXMAN_c8 + case PIXMAN_x4c4: + */ + /* Collides with PIXMAN_g8 + case PIXMAN_x4g4: + */ + /* 4bpp formats */ + case PIXMAN_a4: + case PIXMAN_r1g2b1: + case PIXMAN_b1g2r1: + case PIXMAN_a1r1g1b1: + case PIXMAN_a1b1g1r1: + case PIXMAN_c4: + case PIXMAN_g4: + /* 1bpp formats */ + case PIXMAN_a1: + case PIXMAN_g1: + /* YUV formats */ + case PIXMAN_yuy2: + case PIXMAN_yv12: + return TRUE; + + default: + return FALSE; + } +} diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-version.h /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-version.h --- pixman-0.9.6/pixman/pixman-version.h 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-version.h 2008-03-27 15:02:26.000000000 +0100 @@ -0,0 +1,50 @@ +/* + * Copyright © 2008 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Author: Carl D. Worth + */ + +#ifndef PIXMAN_VERSION_H__ +#define PIXMAN_VERSION_H__ + +#ifndef PIXMAN_H__ +# error pixman-version.h should only be included by pixman.h +#endif + +#define PIXMAN_VERSION_MAJOR 0 +#define PIXMAN_VERSION_MINOR 10 +#define PIXMAN_VERSION_MICRO 0 + +#define PIXMAN_VERSION_STRING "0.10.0" + +#define PIXMAN_VERSION_ENCODE(major, minor, micro) ( \ + ((major) * 10000) \ + + ((minor) * 100) \ + + ((micro) * 1)) + +#define PIXMAN_VERSION PIXMAN_VERSION_ENCODE( \ + PIXMAN_VERSION_MAJOR, \ + PIXMAN_VERSION_MINOR, \ + PIXMAN_VERSION_MICRO) + +#endif /* PIXMAN_VERSION_H__ */ diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/pixman/pixman-version.h.in /tmp/JWHn8zaZ1m/pixman-0.10.0/pixman/pixman-version.h.in --- pixman-0.9.6/pixman/pixman-version.h.in 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/pixman/pixman-version.h.in 2008-03-27 11:58:20.000000000 +0100 @@ -0,0 +1,50 @@ +/* + * Copyright © 2008 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Author: Carl D. Worth + */ + +#ifndef PIXMAN_VERSION_H__ +#define PIXMAN_VERSION_H__ + +#ifndef PIXMAN_H__ +# error pixman-version.h should only be included by pixman.h +#endif + +#define PIXMAN_VERSION_MAJOR @PIXMAN_VERSION_MAJOR@ +#define PIXMAN_VERSION_MINOR @PIXMAN_VERSION_MINOR@ +#define PIXMAN_VERSION_MICRO @PIXMAN_VERSION_MICRO@ + +#define PIXMAN_VERSION_STRING "@PIXMAN_VERSION_MAJOR@.@PIXMAN_VERSION_MINOR@.@PIXMAN_VERSION_MICRO@" + +#define PIXMAN_VERSION_ENCODE(major, minor, micro) ( \ + ((major) * 10000) \ + + ((minor) * 100) \ + + ((micro) * 1)) + +#define PIXMAN_VERSION PIXMAN_VERSION_ENCODE( \ + PIXMAN_VERSION_MAJOR, \ + PIXMAN_VERSION_MINOR, \ + PIXMAN_VERSION_MICRO) + +#endif /* PIXMAN_VERSION_H__ */ diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/test/fetch-test.c /tmp/JWHn8zaZ1m/pixman-0.10.0/test/fetch-test.c --- pixman-0.9.6/test/fetch-test.c 1970-01-01 01:00:00.000000000 +0100 +++ pixman-0.10.0/test/fetch-test.c 2007-12-15 22:18:13.000000000 +0100 @@ -0,0 +1,163 @@ +#include +#include +#include +#include "pixman.h" + + +#define SIZE 1024 + + +pixman_indexed_t mono_pallete = { + .rgba = { 0x00000000, 0x00ffffff }, +}; + + +typedef struct { + pixman_format_code_t format; + int width, height; + int stride; + uint32_t src[SIZE]; + uint32_t dst[SIZE]; + pixman_indexed_t *indexed; +} testcase_t; + +testcase_t testcases[] = { + { + .format = PIXMAN_a8r8g8b8, + .width = 2, .height = 2, + .stride = 8, + .src = { 0x00112233, 0x44556677, + 0x8899aabb, 0xccddeeff }, + .dst = { 0x00112233, 0x44556677, + 0x8899aabb, 0xccddeeff }, + .indexed = NULL, + }, + { + .format = PIXMAN_g1, + .width = 8, .height = 2, + .stride = 4, + .src = { 0x00000055, + 0x000000aa }, + .dst = { 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000, + 0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff }, + .indexed = &mono_pallete, + }, +#if 0 + { + .format = PIXMAN_g8, + .width = 4, .height = 2, + .stride = 4, + .src = { 0x01234567, + 0x89abcdef }, + .dst = { 0x00010101, 0x00232323, 0x00454545, 0x00676767, + 0x00898989, 0x00ababab, 0x00cdcdcd, 0x00efefef, }, + }, +#endif + { + .format = PIXMAN_yv12, + .width = 8, .height = 2, + .stride = 8, + .src = { 0xff00ff00, 0xff00ff00, + 0x00ff00ff, 0x00ff00ff, + 0x0080ff80, + 0xff800080}, + .dst = { + 0xff000000, 0xffffffff, 0xffb80000, 0xffffe113, + 0xff000000, 0xffffffff, 0xff0023ee, 0xff4affff, + 0xffffffff, 0xff000000, 0xffffe113, 0xffb80000, + 0xffffffff, 0xff000000, 0xff4affff, 0xff0023ee, + }, + }, +}; + +const int ntestcases = sizeof(testcases)/sizeof(testcases[0]); + + +static uint32_t +reader (const void *src, int size) +{ + switch (size) + { + case 1: + return *(uint8_t *)src; + case 2: + return *(uint16_t *)src; + case 4: + return *(uint32_t *)src; + default: + assert(0); + } +} + + +static void +writer (void *src, uint32_t value, int size) +{ + switch (size) + { + case 1: + *(uint8_t *)src = value; + break; + case 2: + *(uint16_t *)src = value; + break; + case 4: + *(uint32_t *)src = value; + break; + default: + assert(0); + } +} + + +int +main (int argc, char **argv) +{ + uint32_t dst[SIZE]; + pixman_image_t *src_img; + pixman_image_t *dst_img; + int i, j, x, y; + int ret = 0; + + for (i = 0; i < ntestcases; ++i) { + for (j = 0; j < 2; ++j) { + src_img = pixman_image_create_bits (testcases[i].format, + testcases[i].width, + testcases[i].height, + testcases[i].src, + testcases[i].stride); + pixman_image_set_indexed(src_img, testcases[i].indexed); + + dst_img = pixman_image_create_bits (PIXMAN_a8r8g8b8, + testcases[i].width, + testcases[i].height, + dst, + testcases[i].width*4); + + if (j) { + pixman_image_set_accessors (src_img, reader, writer); + pixman_image_set_accessors (dst_img, reader, writer); + } + + pixman_image_composite (PIXMAN_OP_SRC, src_img, NULL, dst_img, + 0, 0, 0, 0, 0, 0, testcases[i].width, testcases[i].height); + + pixman_image_unref (src_img); + pixman_image_unref (dst_img); + + for (y = 0; y < testcases[i].height; ++y) + for (x = 0; x < testcases[i].width; ++x) { + int offset = y*testcases[i].width + x; + if (dst[offset] != testcases[i].dst[offset]) { + printf ("test %i%c: pixel mismatch at (x=%d,y=%d): %08x expected, %08x obtained\n", + i + 1, 'a' + j, + x, y, + testcases[i].dst[offset], dst[offset]); + ret = 1; + } + } + } + } + + return ret; +} diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/test/Makefile.am /tmp/JWHn8zaZ1m/pixman-0.10.0/test/Makefile.am --- pixman-0.9.6/test/Makefile.am 2007-09-13 21:58:28.000000000 +0200 +++ pixman-0.10.0/test/Makefile.am 2007-12-15 22:18:13.000000000 +0100 @@ -1,7 +1,8 @@ if HAVE_GTK TESTPROGRAMS = \ composite-test \ - gradient-test + gradient-test \ + fetch-test noinst_PROGRAMS = $(TESTPROGRAMS) @@ -9,5 +10,6 @@ composite_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS) gradient_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS) +fetch_test_LDADD = $(top_builddir)/pixman/libpixman-1.la -endif \ No newline at end of file +endif diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/test/Makefile.in /tmp/JWHn8zaZ1m/pixman-0.10.0/test/Makefile.in --- pixman-0.9.6/test/Makefile.in 2008-04-04 15:44:38.000000000 +0200 +++ pixman-0.10.0/test/Makefile.in 2008-03-27 15:02:10.000000000 +0100 @@ -43,7 +43,7 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @HAVE_GTK_TRUE@am__EXEEXT_1 = composite-test$(EXEEXT) \ -@HAVE_GTK_TRUE@ gradient-test$(EXEEXT) +@HAVE_GTK_TRUE@ gradient-test$(EXEEXT) fetch-test$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) composite_test_SOURCES = composite-test.c composite_test_OBJECTS = composite-test.$(OBJEXT) @@ -51,6 +51,10 @@ @HAVE_GTK_TRUE@composite_test_DEPENDENCIES = \ @HAVE_GTK_TRUE@ $(top_builddir)/pixman/libpixman-1.la \ @HAVE_GTK_TRUE@ $(am__DEPENDENCIES_1) +fetch_test_SOURCES = fetch-test.c +fetch_test_OBJECTS = fetch-test.$(OBJEXT) +@HAVE_GTK_TRUE@fetch_test_DEPENDENCIES = \ +@HAVE_GTK_TRUE@ $(top_builddir)/pixman/libpixman-1.la gradient_test_SOURCES = gradient-test.c gradient_test_OBJECTS = gradient-test.$(OBJEXT) @HAVE_GTK_TRUE@gradient_test_DEPENDENCIES = \ @@ -68,8 +72,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = composite-test.c gradient-test.c -DIST_SOURCES = composite-test.c gradient-test.c +SOURCES = composite-test.c fetch-test.c gradient-test.c +DIST_SOURCES = composite-test.c fetch-test.c gradient-test.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -117,7 +121,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MMX_CFLAGS = @MMX_CFLAGS@ @@ -129,12 +132,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PIXMAN_MAJOR = @PIXMAN_MAJOR@ +PIXMAN_VERSION_MAJOR = @PIXMAN_VERSION_MAJOR@ +PIXMAN_VERSION_MICRO = @PIXMAN_VERSION_MICRO@ +PIXMAN_VERSION_MINOR = @PIXMAN_VERSION_MINOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SSE_CFLAGS = @SSE_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ @@ -190,16 +196,18 @@ top_srcdir = @top_srcdir@ @HAVE_GTK_TRUE@TESTPROGRAMS = \ @HAVE_GTK_TRUE@ composite-test \ -@HAVE_GTK_TRUE@ gradient-test +@HAVE_GTK_TRUE@ gradient-test \ +@HAVE_GTK_TRUE@ fetch-test @HAVE_GTK_TRUE@INCLUDES = -I$(top_srcdir)/pixman $(GTK_CFLAGS) @HAVE_GTK_TRUE@composite_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS) @HAVE_GTK_TRUE@gradient_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS) +@HAVE_GTK_TRUE@fetch_test_LDADD = $(top_builddir)/pixman/libpixman-1.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -224,9 +232,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: @@ -238,6 +246,9 @@ composite-test$(EXEEXT): $(composite_test_OBJECTS) $(composite_test_DEPENDENCIES) @rm -f composite-test$(EXEEXT) $(LINK) $(composite_test_OBJECTS) $(composite_test_LDADD) $(LIBS) +fetch-test$(EXEEXT): $(fetch_test_OBJECTS) $(fetch_test_DEPENDENCIES) + @rm -f fetch-test$(EXEEXT) + $(LINK) $(fetch_test_OBJECTS) $(fetch_test_LDADD) $(LIBS) gradient-test$(EXEEXT): $(gradient_test_OBJECTS) $(gradient_test_DEPENDENCIES) @rm -f gradient-test$(EXEEXT) $(LINK) $(gradient_test_OBJECTS) $(gradient_test_LDADD) $(LIBS) @@ -249,6 +260,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/composite-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fetch-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gradient-test.Po@am__quote@ .c.o: diff -Nru /tmp/1osACeIRcp/pixman-0.9.6/TODO /tmp/JWHn8zaZ1m/pixman-0.10.0/TODO --- pixman-0.9.6/TODO 2007-09-12 22:24:35.000000000 +0200 +++ pixman-0.10.0/TODO 2008-03-27 15:06:07.000000000 +0100 @@ -1,3 +1,43 @@ + - Update the RLEASING file + + - Things to keep in mind if breaking ABI: + + - There should be a guard #ifndef I_AM_EITHER_CAIRO_OR_THE_X_SERVER + + - X server will require 16.16 essentially forever. Can we get + the required precision by simply adding offset_x/y to the + relevant rendering API? + + - pixman_image_set_indexed() should copy its argument, and X + should be ported over to use a pixman_image as the + representation of a Picture, rather than creating one on each + operation. + + - We should get rid of pixman_set_static_pointers() + + - We should get rid of the various trapezoid helper functions(). + (They only exist because they are theoretically available to + drivers). + + - Regions should become 32 bit + + - There should only be one trap rasterization API. + + - The PIXMAN_g8/c8/etc formats should use the A channel + to indicate the actual depth. That way PIXMAN_x4c4 and PIXMAN_c8 + won't collide. + + - Make pixman_region_point_in() survive a NULL box, then fix up + pixman-compose.c + + - Test suite + + - Add a general way of dealing with architecture specific + fast-paths. The current idea is to have each operation that can + be optimized is called through a function pointer that is + initially set to an initialization function that is responsible for + setting the function pointer to the appropriate fast-path. + - Go through things marked FIXME - Add calls to prepare and finish access where necessary. grep for @@ -22,21 +62,23 @@ IC_SHIFT to 5 for all machines. - Consider whether calling regions region16 is really such a great - idea Vlad wants 32 bit regions for Cairo. This will break X server + idea. Vlad wants 32 bit regions for Cairo. This will break X server ABI, but should otherwise be mostly harmless, though a pixman_region_get_boxes16() may be useful. - - Make source clipping optional. - - done: source clipping happens through an indirection. - still needs to make the indirection settable. (And call it - from X) - - Consider optimizing the 8/16 bit solid fills in pixman-util.c by storing more than one value at a time. - Add an image cache to prevent excessive malloc/free. Note that pixman needs to be thread safe when used from cairo. + - Moving to 24.8 coordinates. This is tricky because X is still + defined as 16.16 and will be basically forever. It's possible we + could do this by adding extra offset_x/y parameters to the + trapezoid calls. The X server could then just call the API with + (0, 0). Cairo would have to make sure that the delta *within* a + batch of trapezoids does not exceed 16 bit. + - Review the pixman_format_code_t enum to make sure it will support future formats. Some formats we will probably need: @@ -78,11 +120,26 @@ It may make sense to have a PIXMAN_TYPE_YUV, and then use the channel bits to specify the exact subtype. - What about color spaces such a linear vs. srGB etc.? + Another possibility is to add + PIXMAN_TYPE_ARGB_W + PIXMAN_TYPE_ARGB_WW + + where the channel widths would get 16 and 32 added to them, + respectively. + + What about color spaces such a linear vs. srGB etc.? done: +- Get rid of the switch-of-doom; replace it with a big table + describing the various fast paths. + +- Make source clipping optional. + - done: source clipping happens through an indirection. + still needs to make the indirection settable. (And call it + from X) + - Run cairo test suite; fix bugs - one bug in source-scale-clip