This patch should be applied to an un-modified XFree86 version 4.3.0 source tree. It is patch 2 of 4 patches that will will convert the source tree to XFree86 version 4.4.0. To apply this patch, run the following from the directory containing your 'xc' directory: patch -p0 -E < XFree86-4.3.0-4.4.0.diff1 patch -p0 -E < XFree86-4.3.0-4.4.0.diff2 patch -p0 -E < XFree86-4.3.0-4.4.0.diff3 patch -p0 -E < XFree86-4.3.0-4.4.0.diff4 sh XFree86-4.3.0-4.4.0-cleanup.sh gzip -d < XFree86-4.3.0-4.4.0-diff0.tgz | tar vxf - ------------------------------------------------------------------------------- Index: xc/extras/freetype2/builds/unix/configure.ac diff -u xc/extras/freetype2/builds/unix/configure.ac:1.1.1.5 xc/extras/freetype2/builds/unix/configure.ac:1.1.1.6 --- xc/extras/freetype2/builds/unix/configure.ac:1.1.1.5 Thu Jun 20 04:16:02 2002 +++ xc/extras/freetype2/builds/unix/configure.ac Wed May 28 22:01:42 2003 @@ -9,7 +9,8 @@ dnl configuration file -- stay in 8.3 limit AC_CONFIG_HEADER(ftconfig.h:ftconfig.in) -version_info='9:1:3' +dnl Don't forget to update VERSION.DLL! +version_info='9:3:3' AC_SUBST(version_info) ft_version=`echo $version_info | tr : .` AC_SUBST(ft_version) @@ -80,6 +81,25 @@ AC_CHECK_FUNCS(memcpy memmove) + +dnl Check for system zlib +AC_ARG_WITH(zlib, + [ --without-zlib use internal zlib instead of system-wide]) +if test x$with_zlib != xno && test -z "$LIBZ"; then + AC_CHECK_LIB(z, gzsetparams, [AC_CHECK_HEADER(zlib.h, LIBZ='-lz')]) +fi +if test x$with_zlib != xno && test -n "$LIBZ"; then + CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB" + LDFLAGS="$LDFLAGS $LIBZ" + SYSTEM_ZLIB=yes +fi +AC_SUBST(LIBZ) +AC_SUBST(CFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(SYSTEM_ZLIB) + + + AC_PROG_LIBTOOL dnl create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk' Index: xc/extras/freetype2/builds/unix/detect.mk diff -u xc/extras/freetype2/builds/unix/detect.mk:1.1.1.4 xc/extras/freetype2/builds/unix/detect.mk:1.1.1.5 --- xc/extras/freetype2/builds/unix/detect.mk:1.1.1.4 Thu Jun 20 04:16:02 2002 +++ xc/extras/freetype2/builds/unix/detect.mk Wed May 28 22:01:42 2003 @@ -75,10 +75,10 @@ have_mk := $(strip $(wildcard $(OBJ_DIR)/Makefile)) ifneq ($(have_mk),) # we are building FT2 not in the src tree - unix-def.mk: $(TOP)/builds/unix/unix-def.in - $(TOP)/builds/unix/configure $(CFG) + unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in + $(TOP_DIR)/builds/unix/configure $(CFG) else - unix-def.mk: $(TOP)/builds/unix/unix-def.in + unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in cd builds/unix; ./configure $(CFG) endif Index: xc/extras/freetype2/builds/unix/freetype-config.in diff -u xc/extras/freetype2/builds/unix/freetype-config.in:1.1.1.4 xc/extras/freetype2/builds/unix/freetype-config.in:1.5 --- xc/extras/freetype2/builds/unix/freetype-config.in:1.1.1.4 Thu Feb 14 19:33:20 2002 +++ xc/extras/freetype2/builds/unix/freetype-config.in Fri Oct 31 15:49:04 2003 @@ -1,7 +1,10 @@ #! /bin/sh +# $XFree86: xc/extras/freetype2/builds/unix/freetype-config.in,v 1.5 2003/10/31 20:49:04 herrb Exp $ + prefix=@prefix@ exec_prefix=@exec_prefix@ +hardcode_libdir_flag_spec=@hardcode_libdir_flag_spec@ usage() { @@ -88,9 +91,9 @@ fi if test "$echo_libs" = "yes" ; then - libs="-lfreetype" + libs="-lfreetype @LIBZ@" if test "@libdir@" != "/usr/lib" ; then - echo -L@libdir@ $libs + echo ${hardcode_libdir_flag_spec} -L@libdir@ $libs else echo $libs fi Index: xc/extras/freetype2/builds/unix/install-sh diff -u xc/extras/freetype2/builds/unix/install-sh:1.1.1.1 xc/extras/freetype2/builds/unix/install-sh:1.1.1.2 --- xc/extras/freetype2/builds/unix/install-sh:1.1.1.1 Fri Dec 8 16:26:08 2000 +++ xc/extras/freetype2/builds/unix/install-sh Wed May 28 22:01:42 2003 @@ -1,9 +1,11 @@ -#! /bin/sh -# +#!/bin/sh # install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# +# This originally came from X11R5 (mit/util/scripts/install.sh). + +scriptversion=2003-01-17.15 + # Copyright 1991 by the Massachusetts Institute of Technology +# (FSF changes in the public domain.) # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that @@ -23,13 +25,11 @@ # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. - # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" - # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" @@ -41,210 +41,229 @@ rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" -transformbasename="" -transform_arg="" +transformbasename= +transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" +chowncmd= +chgrpcmd= +stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac +src= +dst= +dir_arg= + +usage="Usage: $0 [OPTION]... SRCFILE DSTFILE + or: $0 -d DIR1 DIR2... + +In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. +In the second, create the directory path DIR. + +Options: +-b=TRANSFORMBASENAME +-c copy source (using $cpprog) instead of moving (using $mvprog). +-d create directories instead of installing files. +-g GROUP $chgrp installed files to GROUP. +-m MODE $chmod installed files to MODE. +-o USER $chown installed files to USER. +-s strip installed files (using $stripprog). +-t=TRANSFORM +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + -c) instcmd=$cpprog + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit 0;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + --version) echo "$0 $scriptversion"; exit 0;; + + *) if test -z "$src"; then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac done -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true +if test -z "$src"; then + echo "$0: no input file specified." >&2 + exit 1 fi -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi +if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + instcmd=: + chmodcmd= + else + instcmd=$mkdirprog + fi else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi + # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + dst=$dst/`basename "$src"` + fi fi ## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` +dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script +# (this part is taken from Noah Friedman's mkinstalldirs script.) # Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done +if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + test -d "$pathcomp" || $mkdirprog "$pathcomp" + pathcomp=$pathcomp/ + done fi -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi +if test -n "$dir_arg"; then + $doit $instcmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile +else + # If we're going to rename the final executable, determine the name now. + if test -z "$transformarg"; then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename \ + | sed $transformarg`$transformbasename + fi + + # don't allow the sed command to completely eliminate the filename. + test -z "$dstfile" && dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/#inst.$$# + rmtmp=$dstdir/#rm.$$# + + # Trap to clean up those temp files at exit. + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Move or copy the file name to the temp name + $doit $instcmd "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $instcmd $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now remove or move aside any old file at destination location. We + # try this two ways since rm can't unlink itself on some systems and + # the destination file might be busy for other reasons. In this case, + # the final cleanup might fail but the new file should still install + # successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi + } && + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && - -exit 0 +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Index: xc/extras/freetype2/builds/unix/install.mk diff -u xc/extras/freetype2/builds/unix/install.mk:1.1.1.4 xc/extras/freetype2/builds/unix/install.mk:1.1.1.5 --- xc/extras/freetype2/builds/unix/install.mk:1.1.1.4 Thu Jun 20 04:16:03 2002 +++ xc/extras/freetype2/builds/unix/install.mk Wed May 28 22:01:42 2003 @@ -3,7 +3,7 @@ # -# Copyright 1996-2000 by +# Copyright 1996-2000, 2002 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -12,47 +12,63 @@ # indicate that you have read the license and understand and accept it # fully. +# If you say +# +# make install DESTDIR=/tmp/somewhere/ +# +# don't forget the final backslash (this command is mainly for package +# maintainers). + .PHONY: install uninstall check # Unix installation and deinstallation targets. install: $(PROJECT_LIBRARY) - $(MKINSTALLDIRS) $(libdir) \ - $(includedir)/freetype2/freetype/config \ - $(includedir)/freetype2/freetype/internal \ - $(includedir)/freetype2/freetype/cache \ - $(bindir) - $(LIBTOOL) --mode=install $(INSTALL) $(PROJECT_LIBRARY) $(libdir) - -for P in $(PUBLIC_H) ; do \ - $(INSTALL_DATA) $$P $(includedir)/freetype2/freetype ; \ + $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \ + $(DESTDIR)$(includedir)/freetype2/freetype/config \ + $(DESTDIR)$(includedir)/freetype2/freetype/internal \ + $(DESTDIR)$(includedir)/freetype2/freetype/cache \ + $(DESTDIR)$(bindir) \ + $(DESTDIR)$(datadir)/aclocal + $(LIBTOOL) --mode=install $(INSTALL) \ + $(PROJECT_LIBRARY) $(DESTDIR)$(libdir) + -for P in $(PUBLIC_H) ; do \ + $(INSTALL_DATA) \ + $$P $(DESTDIR)$(includedir)/freetype2/freetype ; \ done - -for P in $(BASE_H) ; do \ - $(INSTALL_DATA) $$P $(includedir)/freetype2/freetype/internal ; \ + -for P in $(BASE_H) ; do \ + $(INSTALL_DATA) \ + $$P $(DESTDIR)$(includedir)/freetype2/freetype/internal ; \ done - -for P in $(CONFIG_H) ; do \ - $(INSTALL_DATA) $$P $(includedir)/freetype2/freetype/config ; \ + -for P in $(CONFIG_H) ; do \ + $(INSTALL_DATA) \ + $$P $(DESTDIR)$(includedir)/freetype2/freetype/config ; \ done - -for P in $(CACHE_H) ; do \ - $(INSTALL_DATA) $$P $(includedir)/freetype2/freetype/cache ; \ + -for P in $(CACHE_H) ; do \ + $(INSTALL_DATA) \ + $$P $(DESTDIR)$(includedir)/freetype2/freetype/cache ; \ done - $(INSTALL_DATA) $(BUILD)/ft2unix.h $(includedir)/ft2build.h + $(INSTALL_DATA) $(BUILD)/ft2unix.h $(DESTDIR)$(includedir)/ft2build.h $(INSTALL_SCRIPT) -m 755 $(OBJ_BUILD)/freetype-config \ - $(bindir)/freetype-config + $(DESTDIR)$(bindir)/freetype-config + $(INSTALL_SCRIPT) -m 644 $(BUILD)/freetype2.m4 \ + $(DESTDIR)$(datadir)/aclocal/freetype2.m4 uninstall: - -$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/$(LIBRARY).$A - -$(DELETE) $(includedir)/freetype2/freetype/cache/* - -$(DELDIR) $(includedir)/freetype2/freetype/cache - -$(DELETE) $(includedir)/freetype2/freetype/config/* - -$(DELDIR) $(includedir)/freetype2/freetype/config - -$(DELETE) $(includedir)/freetype2/freetype/internal/* - -$(DELDIR) $(includedir)/freetype2/freetype/internal - -$(DELETE) $(includedir)/freetype2/freetype/* - -$(DELDIR) $(includedir)/freetype2/freetype - -$(DELDIR) $(includedir)/freetype2 - -$(DELETE) $(includedir)/ft2build.h - -$(DELETE) $(bindir)/freetype-config + -$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/$(LIBRARY).$A + -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/cache/* + -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype/cache + -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/config/* + -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype/config + -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/internal/* + -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype/internal + -$(DELETE) $(DESTDIR)$(includedir)/freetype2/freetype/* + -$(DELDIR) $(DESTDIR)$(includedir)/freetype2/freetype + -$(DELDIR) $(DESTDIR)$(includedir)/freetype2 + -$(DELETE) $(DESTDIR)$(includedir)/ft2build.h + -$(DELETE) $(DESTDIR)$(bindir)/freetype-config + -$(DELETE) $(DESTDIR)$(datadir)/aclocal/freetype2.m4 check: Index: xc/extras/freetype2/builds/unix/ltmain.sh diff -u xc/extras/freetype2/builds/unix/ltmain.sh:1.1.1.3 xc/extras/freetype2/builds/unix/ltmain.sh:1.1.1.4 --- xc/extras/freetype2/builds/unix/ltmain.sh:1.1.1.3 Tue Mar 26 23:35:43 2002 +++ xc/extras/freetype2/builds/unix/ltmain.sh Wed May 28 22:01:42 2003 @@ -49,14 +49,14 @@ fi # The name of this program. -progname=`$echo "$0" | sed 's%^.*/%%'` +progname=`$echo "$0" | ${SED} 's%^.*/%%'` modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.4.2 -TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)" +VERSION=1.4.3 +TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)" default_mode= help="Try \`$progname --help' for more information." @@ -67,10 +67,19 @@ # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' +Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -SP2NL='tr \040 \012' -NL2SP='tr \015\012 \040\040' +# test EBCDIC or ASCII +case `echo A|od -x` in + *[Cc]1*) # EBCDIC based system + SP2NL="tr '\100' '\n'" + NL2SP="tr '\r\n' '\100\100'" + ;; + *) # Assume ASCII based system + SP2NL="tr '\040' '\012'" + NL2SP="tr '\015\012' '\040\040'" + ;; +esac # NLS nuisances. # Only set LANG and LC_ALL to C if already set. @@ -144,7 +153,7 @@ ;; --config) - sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; @@ -177,6 +186,8 @@ --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; + --preserve-dup-deps) duplicate_deps="yes" ;; + --quiet | --silent) show=: ;; @@ -215,7 +226,7 @@ # Infer the operation mode. if test -z "$mode"; then case $nonopt in - *cc | *++ | gcc* | *-gcc*) + *cc | *++ | gcc* | *-gcc* | xlc*) mode=link for arg do @@ -467,7 +478,7 @@ pic_mode=default ;; esac - if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi @@ -992,7 +1003,7 @@ # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in - no/*-*-irix*) + no/*-*-irix* | no/*-*-nonstopux*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; @@ -1043,14 +1054,14 @@ # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; - *-*-openbsd*) + *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in - *-*-openbsd*) + *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -1330,9 +1341,11 @@ # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi libs="$libs $deplib" done deplibs= @@ -1461,10 +1474,12 @@ lib) if test "$deplibs_check_method" != pass_all; then echo - echo "*** Warning: This library needs some functionality provided by $deplib." + echo "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not used here." else echo echo "*** Warning: Linking the shared library $output against the" @@ -1508,7 +1523,7 @@ fi # Check to see that this really is a libtool archive. - if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 @@ -1555,9 +1570,11 @@ tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi tmp_libs="$tmp_libs $deplib" done elif test $linkmode != prog && test $linkmode != lib; then @@ -1680,9 +1697,11 @@ # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi tmp_libs="$tmp_libs $deplib" done # for deplib continue @@ -1766,8 +1785,8 @@ # Make a new name for the extract_expsyms_cmds to use soroot="$soname" - soname=`echo $soroot | sed -e 's/^.*\///'` - newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" + soname=`echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : @@ -1926,13 +1945,14 @@ # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo - echo "*** Warning: This library needs some functionality provided by $lib." + echo "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then - echo "*** Therefore, libtool will create a static module, that should work " - echo "*** as long as the dlopening application is linked with the -dlopen flag." + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" @@ -1981,9 +2001,11 @@ tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi tmp_libs="$tmp_libs $deplib" done @@ -2009,7 +2031,7 @@ if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 @@ -2273,16 +2295,21 @@ versuffix=".$current"; ;; - irix) + irix | nonstopux) major=`expr $current - $age + 1` - verstring="sgi$major.$revision" + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` - verstring="sgi$major.$iface:$verstring" + verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. @@ -2296,7 +2323,7 @@ ;; osf) - major=`expr $current - $age` + major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" @@ -2388,9 +2415,9 @@ # 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'` + 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 @@ -2441,7 +2468,7 @@ *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd*) + *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. ;; *) @@ -2502,18 +2529,20 @@ else droppeddeps=yes echo - echo "*** Warning: This library needs some functionality provided by $i." + echo "*** Warning: dynamic linker does not accept needed library $i." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." + echo "*** shared version of the library, which I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." fi else newdeplibs="$newdeplibs $i" fi done else - # Error occured in the first compile. Let's try to salvage the situation: - # Compile a seperate program for each library. + # Error occured in the first compile. Let's try to salvage + # the situation: Compile a separate program for each library. for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. @@ -2532,10 +2561,12 @@ else droppeddeps=yes echo - echo "*** Warning: This library needs some functionality provided by $i." + echo "*** Warning: dynamic linker does not accept needed library $i." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." + echo "*** shared version of the library, which you do not appear to have" + echo "*** because a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi else droppeddeps=yes @@ -2574,14 +2605,14 @@ # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | sed 's/.* -> //'` + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | sed 10q \ + | ${SED} 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" @@ -2592,10 +2623,17 @@ if test -n "$a_deplib" ; then droppeddeps=yes echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." + echo "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + echo "*** with $libname but no candidates were found. (...for file magic test)" + else + echo "*** with $libname and none of the candidates passed a file format test" + echo "*** using a file magic. Last file checked: $potlib" + fi fi else # Add a -L argument. @@ -2614,8 +2652,9 @@ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check below in file_magic test if eval echo \"$potent_lib\" 2>/dev/null \ - | sed 10q \ + | ${SED} 10q \ | egrep "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" @@ -2626,10 +2665,17 @@ if test -n "$a_deplib" ; then droppeddeps=yes echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." + echo "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + echo "*** with $libname and none of the candidates passed a file format test" + echo "*** using a regex pattern. Last file checked: $potlib" + fi fi else # Add a -L argument. @@ -2894,7 +2940,18 @@ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else + save_deplibs="$deplibs" + for conv in $convenience; do + tmp_deplibs= + for test_deplib in $deplibs; do + if test "$test_deplib" != "$conv"; then + tmp_deplibs="$tmp_deplibs $test_deplib" + fi + done + deplibs="$tmp_deplibs" + done eval cmds=\"$archive_cmds\" + deplibs="$save_deplibs" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do @@ -3093,7 +3150,7 @@ prog) case $host in - *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; + *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 @@ -3115,6 +3172,13 @@ # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac ;; esac @@ -3281,9 +3345,9 @@ if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols - $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi @@ -3291,7 +3355,7 @@ for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" - name=`echo "$arg" | sed -e 's%^.*/%%'` + name=`echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done @@ -3306,7 +3370,13 @@ fi # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S @@ -3528,7 +3598,7 @@ relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done - relink_command="cd `pwd`; $relink_command" + relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi @@ -3548,7 +3618,7 @@ # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in - *.exe) output=`echo $output|sed 's,.exe$,,'` ;; + *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in @@ -3572,7 +3642,7 @@ # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' +Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -3610,7 +3680,7 @@ test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` @@ -3623,7 +3693,7 @@ fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. @@ -3637,7 +3707,7 @@ progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" @@ -3683,7 +3753,7 @@ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed + # The second colon is a workaround for a bug in BeOS R4 ${SED} $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var @@ -3858,7 +3928,7 @@ fi done # Quote the link command for shipping. - relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" + relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. @@ -3875,7 +3945,7 @@ case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 @@ -3889,7 +3959,7 @@ newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 @@ -3900,7 +3970,7 @@ newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 @@ -4124,7 +4194,7 @@ *.la) # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 @@ -4273,19 +4343,27 @@ fi # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + case $host in + *cygwin*|*mingw*) + wrapper=`echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # If there is no directory component, then add one. case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; + */* | *\\*) . $wrapper ;; + *) . ./$wrapper ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit 1 fi @@ -4310,8 +4388,8 @@ relink_command= # If there is no directory component, then add one. case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; + */* | *\\*) . $wrapper ;; + *) . ./$wrapper ;; esac outputname= @@ -4359,7 +4437,7 @@ destfile=$destfile.exe ;; *:*.exe) - destfile=`echo $destfile | sed -e 's,.exe$,,'` + destfile=`echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; @@ -4507,7 +4585,7 @@ case $file in *.la) # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 @@ -4578,7 +4656,7 @@ -*) ;; *) # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; @@ -4610,7 +4688,7 @@ fi # Now prepare to actually exec the command. - exec_cmd='"$cmd"$args' + exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then @@ -4687,7 +4765,7 @@ case $name in *.la) # Possibly a libtool archive, so verify it. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. @@ -4742,7 +4820,7 @@ *) # Do a test to see if this is a libtool program. if test $mode = clean && - (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file Index: xc/extras/freetype2/builds/unix/mkinstalldirs diff -u xc/extras/freetype2/builds/unix/mkinstalldirs:1.1.1.1 xc/extras/freetype2/builds/unix/mkinstalldirs:1.1.1.2 --- xc/extras/freetype2/builds/unix/mkinstalldirs:1.1.1.1 Fri Dec 8 16:26:09 2000 +++ xc/extras/freetype2/builds/unix/mkinstalldirs Wed May 28 22:01:43 2003 @@ -4,37 +4,108 @@ # Created: 1993-05-16 # Public domain -# $Id: mkinstalldirs,v 1.3 2000/07/24 06:03:58 werner Exp $ - errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" 1>&2 + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi + ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi + ;; +esac for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi - pathcomp="$pathcomp/" - done + pathcomp="$pathcomp/" + done done exit $errstatus +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# End: # mkinstalldirs ends here Index: xc/extras/freetype2/builds/unix/unix-cc.in diff -u xc/extras/freetype2/builds/unix/unix-cc.in:1.1.1.2 xc/extras/freetype2/builds/unix/unix-cc.in:1.1.1.3 --- xc/extras/freetype2/builds/unix/unix-cc.in:1.1.1.2 Thu Jun 20 04:16:04 2002 +++ xc/extras/freetype2/builds/unix/unix-cc.in Wed May 28 22:01:43 2003 @@ -78,6 +78,7 @@ # Library linking # LINK_LIBRARY = $(LIBTOOL) --mode=link $(CCraw) -o $@ $(OBJECTS_LIST) \ - -rpath $(libdir) -version-info $(version_info) + -rpath $(libdir) -version-info $(version_info) \ + $(LDFLAGS) # EOF Index: xc/extras/freetype2/builds/unix/unix-def.in diff -u xc/extras/freetype2/builds/unix/unix-def.in:1.1.1.3 xc/extras/freetype2/builds/unix/unix-def.in:1.1.1.4 --- xc/extras/freetype2/builds/unix/unix-def.in:1.1.1.3 Thu Jun 20 04:16:04 2002 +++ xc/extras/freetype2/builds/unix/unix-def.in Wed May 28 22:01:43 2003 @@ -13,16 +13,16 @@ # fully. -ifndef TOP - TOP := . +ifndef TOP_DIR + TOP_DIR := . endif -TOP := $(shell cd $(TOP); pwd) +TOP_DIR := $(shell cd $(TOP_DIR); pwd) DELETE := @RMF@ DELDIR := @RMDIR@ SEP := / HOSTSEP := $(SEP) -BUILD := $(TOP)/builds/unix +BUILD := $(TOP_DIR)/builds/unix PLATFORM := unix # this is used for `make distclean' and `make install' @@ -58,6 +58,7 @@ libdir := @libdir@ bindir := @bindir@ includedir := @includedir@ +datadir := @datadir@ version_info := @version_info@ @@ -66,13 +67,13 @@ # # This lets you build the library in your own directory with something like # -# set TOP=.../path/to/freetype2/top/dir... +# set TOP_DIR=.../path/to/freetype2/top/dir... # set OBJ_DIR=.../path/to/obj/dir -# make -f $TOP/Makefile setup [options] -# make -f $TOP/Makefile +# make -f $TOP_DIR/Makefile setup [options] +# make -f $TOP_DIR/Makefile # ifndef OBJ_DIR - OBJ_DIR := $(shell cd $(TOP)/objs; pwd) + OBJ_DIR := $(shell cd $(TOP_DIR)/objs; pwd) endif @@ -84,6 +85,12 @@ LIB_DIR := $(OBJ_DIR) +# The SYSTEM_ZLIB macro is defined if the user wishes to link dynamically +# with its system wide zlib. If SYSTEM_ZLIB is 'yes', the zlib part of the +# ftgzip module is not compiled in. +SYSTEM_ZLIB := @SYSTEM_ZLIB@ + + # The NO_OUTPUT macro is appended to command lines in order to ignore # the output of some programs. # Index: xc/extras/freetype2/builds/unix/unix-dev.mk diff -u xc/extras/freetype2/builds/unix/unix-dev.mk:1.1.1.2 xc/extras/freetype2/builds/unix/unix-dev.mk:1.1.1.3 --- xc/extras/freetype2/builds/unix/unix-dev.mk:1.1.1.2 Tue May 15 23:45:49 2001 +++ xc/extras/freetype2/builds/unix/unix-dev.mk Wed May 28 22:01:43 2003 @@ -16,10 +16,10 @@ # fully. -include $(TOP)/builds/unix/unixddef.mk -BUILD := $(TOP)/builds/devel +include $(TOP_DIR)/builds/unix/unixddef.mk +BUILD := $(TOP_DIR)/builds/devel -include $(TOP)/builds/compiler/gcc-dev.mk -include $(TOP)/builds/link_std.mk +include $(TOP_DIR)/builds/compiler/gcc-dev.mk +include $(TOP_DIR)/builds/link_std.mk # EOF Index: xc/extras/freetype2/builds/unix/unix-lcc.mk diff -u xc/extras/freetype2/builds/unix/unix-lcc.mk:1.1.1.1 xc/extras/freetype2/builds/unix/unix-lcc.mk:1.1.1.2 --- xc/extras/freetype2/builds/unix/unix-lcc.mk:1.1.1.1 Fri Dec 8 16:26:09 2000 +++ xc/extras/freetype2/builds/unix/unix-lcc.mk Wed May 28 22:01:43 2003 @@ -16,8 +16,8 @@ # fully. -include $(TOP)/builds/unix/unixddef.mk -include $(TOP)/builds/compiler/unix-lcc.mk -include $(TOP)/builds/link_std.mk +include $(TOP_DIR)/builds/unix/unixddef.mk +include $(TOP_DIR)/builds/compiler/unix-lcc.mk +include $(TOP_DIR)/builds/link_std.mk # EOF Index: xc/extras/freetype2/builds/unix/unix.mk diff -u xc/extras/freetype2/builds/unix/unix.mk:1.1.1.3 xc/extras/freetype2/builds/unix/unix.mk:1.1.1.4 --- xc/extras/freetype2/builds/unix/unix.mk:1.1.1.3 Thu Jun 20 04:16:04 2002 +++ xc/extras/freetype2/builds/unix/unix.mk Wed May 28 22:01:43 2003 @@ -12,10 +12,10 @@ # indicate that you have read the license and understand and accept it # fully. -have_mk := $(strip $(wildcard $(TOP)/builds/unix/unix-def.mk)) +have_mk := $(strip $(wildcard $(TOP_DIR)/builds/unix/unix-def.mk)) ifneq ($(have_mk),) - include $(TOP)/builds/unix/unix-def.mk - include $(TOP)/builds/unix/unix-cc.mk + include $(TOP_DIR)/builds/unix/unix-def.mk + include $(TOP_DIR)/builds/unix/unix-cc.mk else # we are building FT2 not in the src tree include $(OBJ_DIR)/unix-def.mk @@ -29,7 +29,7 @@ # Now include the main sub-makefile. It contains all the rules used to # build the library with the previous variables defined. # - include $(TOP)/builds/$(PROJECT).mk + include $(TOP_DIR)/builds/$(PROJECT).mk # The cleanup targets. @@ -52,6 +52,6 @@ endif -include $(TOP)/builds/unix/install.mk +include $(TOP_DIR)/builds/unix/install.mk # EOF Index: xc/extras/freetype2/builds/unix/unixddef.mk diff -u xc/extras/freetype2/builds/unix/unixddef.mk:1.1.1.2 xc/extras/freetype2/builds/unix/unixddef.mk:1.1.1.3 --- xc/extras/freetype2/builds/unix/unixddef.mk:1.1.1.2 Tue May 15 23:45:49 2001 +++ xc/extras/freetype2/builds/unix/unixddef.mk Wed May 28 22:01:43 2003 @@ -14,17 +14,17 @@ # fully. -ifndef TOP - TOP := . +ifndef TOP_DIR + TOP_DIR := . endif -TOP := $(shell cd $(TOP); pwd) +TOP_DIR := $(shell cd $(TOP_DIR); pwd) DELETE := rm -f SEP := / HOSTSEP := $(SEP) # we use a special devel ftoption.h -BUILD := $(TOP)/builds/devel +BUILD := $(TOP_DIR)/builds/devel # do not set the platform to `unix', or libtool will trick you PLATFORM := unixdev @@ -33,7 +33,7 @@ # The directory where all object files are placed. # ifndef OBJ_DIR - OBJ_DIR := $(shell cd $(TOP)/objs; pwd) + OBJ_DIR := $(shell cd $(TOP_DIR)/objs; pwd) endif Index: xc/extras/freetype2/builds/win32/ftdebug.c diff -u xc/extras/freetype2/builds/win32/ftdebug.c:1.1.1.2 xc/extras/freetype2/builds/win32/ftdebug.c:1.1.1.3 --- xc/extras/freetype2/builds/win32/ftdebug.c:1.1.1.2 Thu Jun 20 04:16:04 2002 +++ xc/extras/freetype2/builds/win32/ftdebug.c Wed May 28 22:01:43 2003 @@ -107,9 +107,9 @@ /* */ /* Initialize the tracing sub-system. This is done by retrieving the */ /* value of the "FT2_DEBUG" environment variable. It must be a list of */ - /* toggles, separated by spaces, `;' or `:'. Example: */ + /* toggles, separated by spaces, `;' or `,'. Example: */ /* */ - /* "any=3 memory=6 stream=5" */ + /* "any:3 memory:6 stream:5" */ /* */ /* This will request that all levels be set to 3, except the trace level */ /* for the memory and stream components which are set to 6 and 5, */ @@ -136,15 +136,15 @@ for ( ; *p; p++ ) { /* skip leading whitespace and separators */ - if ( *p == ' ' || *p == '\t' || *p == ':' || *p == ';' || *p == '=' ) + if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' ) continue; - /* read toggle name, followed by '=' */ + /* read toggle name, followed by ':' */ q = p; - while ( *p && *p != '=' ) + while ( *p && *p != ':' ) p++; - if ( *p == '=' && p > q ) + if ( *p == ':' && p > q ) { int n, i, len = p - q; int level = -1, found = -1; Index: xc/extras/freetype2/builds/win32/w32-bcc.mk diff -u xc/extras/freetype2/builds/win32/w32-bcc.mk:1.1.1.1 xc/extras/freetype2/builds/win32/w32-bcc.mk:1.1.1.2 --- xc/extras/freetype2/builds/win32/w32-bcc.mk:1.1.1.1 Fri Dec 8 16:26:10 2000 +++ xc/extras/freetype2/builds/win32/w32-bcc.mk Wed May 28 22:01:43 2003 @@ -14,10 +14,10 @@ SEP := / -include $(TOP)/builds/win32/win32-def.mk -include $(TOP)/builds/compiler/bcc.mk +include $(TOP_DIR)/builds/win32/win32-def.mk +include $(TOP_DIR)/builds/compiler/bcc.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk # EOF Index: xc/extras/freetype2/builds/win32/w32-bccd.mk diff -u xc/extras/freetype2/builds/win32/w32-bccd.mk:1.1.1.2 xc/extras/freetype2/builds/win32/w32-bccd.mk:1.1.1.3 --- xc/extras/freetype2/builds/win32/w32-bccd.mk:1.1.1.2 Tue May 15 23:45:49 2001 +++ xc/extras/freetype2/builds/win32/w32-bccd.mk Wed May 28 22:01:43 2003 @@ -15,12 +15,12 @@ SEP := / -include $(TOP)/builds/win32/win32-def.mk -BUILD := $(TOP)/builds/devel +include $(TOP_DIR)/builds/win32/win32-def.mk +BUILD := $(TOP_DIR)/builds/devel -include $(TOP)/builds/compiler/bcc-dev.mk +include $(TOP_DIR)/builds/compiler/bcc-dev.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk # EOF Index: xc/extras/freetype2/builds/win32/w32-dev.mk diff -u xc/extras/freetype2/builds/win32/w32-dev.mk:1.1.1.2 xc/extras/freetype2/builds/win32/w32-dev.mk:1.1.1.3 --- xc/extras/freetype2/builds/win32/w32-dev.mk:1.1.1.2 Tue May 15 23:45:49 2001 +++ xc/extras/freetype2/builds/win32/w32-dev.mk Wed May 28 22:01:43 2003 @@ -19,19 +19,19 @@ # Shell (_not_ Cygwin BASH)! # -ifndef TOP - TOP := . +ifndef TOP_DIR + TOP_DIR := . endif SEP := / -include $(TOP)/builds/win32/win32-def.mk -BUILD := $(TOP)/builds/devel +include $(TOP_DIR)/builds/win32/win32-def.mk +BUILD := $(TOP_DIR)/builds/devel -include $(TOP)/builds/compiler/gcc-dev.mk +include $(TOP_DIR)/builds/compiler/gcc-dev.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk Index: xc/extras/freetype2/builds/win32/w32-gcc.mk diff -u xc/extras/freetype2/builds/win32/w32-gcc.mk:1.1.1.1 xc/extras/freetype2/builds/win32/w32-gcc.mk:1.1.1.2 --- xc/extras/freetype2/builds/win32/w32-gcc.mk:1.1.1.1 Fri Dec 8 16:26:10 2000 +++ xc/extras/freetype2/builds/win32/w32-gcc.mk Wed May 28 22:01:43 2003 @@ -18,12 +18,12 @@ SEP := / # include Win32-specific definitions -include $(TOP)/builds/win32/win32-def.mk +include $(TOP_DIR)/builds/win32/win32-def.mk # include gcc-specific definitions -include $(TOP)/builds/compiler/gcc.mk +include $(TOP_DIR)/builds/compiler/gcc.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk # EOF Index: xc/extras/freetype2/builds/win32/w32-icc.mk diff -u xc/extras/freetype2/builds/win32/w32-icc.mk:1.1.1.1 xc/extras/freetype2/builds/win32/w32-icc.mk:1.1.1.2 --- xc/extras/freetype2/builds/win32/w32-icc.mk:1.1.1.1 Fri Dec 8 16:26:10 2000 +++ xc/extras/freetype2/builds/win32/w32-icc.mk Wed May 28 22:01:43 2003 @@ -13,10 +13,10 @@ # fully. -include $(TOP)/builds/win32/win32-def.mk -include $(TOP)/builds/compiler/visualage.mk +include $(TOP_DIR)/builds/win32/win32-def.mk +include $(TOP_DIR)/builds/compiler/visualage.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk # EOF Index: xc/extras/freetype2/builds/win32/w32-intl.mk diff -u xc/extras/freetype2/builds/win32/w32-intl.mk:1.1.1.1 xc/extras/freetype2/builds/win32/w32-intl.mk:1.1.1.2 --- xc/extras/freetype2/builds/win32/w32-intl.mk:1.1.1.1 Tue May 15 23:45:49 2001 +++ xc/extras/freetype2/builds/win32/w32-intl.mk Wed May 28 22:01:43 2003 @@ -14,10 +14,10 @@ SEP := / -include $(TOP)/builds/win32/win32-def.mk -include $(TOP)/builds/compiler/intelc.mk +include $(TOP_DIR)/builds/win32/win32-def.mk +include $(TOP_DIR)/builds/compiler/intelc.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk # EOF Index: xc/extras/freetype2/builds/win32/w32-lcc.mk diff -u xc/extras/freetype2/builds/win32/w32-lcc.mk:1.1.1.1 xc/extras/freetype2/builds/win32/w32-lcc.mk:1.1.1.2 --- xc/extras/freetype2/builds/win32/w32-lcc.mk:1.1.1.1 Fri Dec 8 16:26:10 2000 +++ xc/extras/freetype2/builds/win32/w32-lcc.mk Wed May 28 22:01:43 2003 @@ -14,11 +14,11 @@ SEP := / -include $(TOP)/builds/win32/win32-def.mk -include $(TOP)/builds/compiler/win-lcc.mk +include $(TOP_DIR)/builds/win32/win32-def.mk +include $(TOP_DIR)/builds/compiler/win-lcc.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk # EOF Index: xc/extras/freetype2/builds/win32/w32-mingw32.mk diff -u xc/extras/freetype2/builds/win32/w32-mingw32.mk:1.1.1.1 xc/extras/freetype2/builds/win32/w32-mingw32.mk:1.1.1.2 --- xc/extras/freetype2/builds/win32/w32-mingw32.mk:1.1.1.1 Fri Dec 8 16:26:10 2000 +++ xc/extras/freetype2/builds/win32/w32-mingw32.mk Wed May 28 22:01:43 2003 @@ -18,14 +18,14 @@ SEP := / # include Win32-specific definitions -include $(TOP)/builds/win32/win32-def.mk +include $(TOP_DIR)/builds/win32/win32-def.mk LIBRARY := lib$(PROJECT) # include gcc-specific definitions -include $(TOP)/builds/compiler/gcc.mk +include $(TOP_DIR)/builds/compiler/gcc.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk # EOF Index: xc/extras/freetype2/builds/win32/w32-vcc.mk diff -u xc/extras/freetype2/builds/win32/w32-vcc.mk:1.1.1.1 xc/extras/freetype2/builds/win32/w32-vcc.mk:1.1.1.2 --- xc/extras/freetype2/builds/win32/w32-vcc.mk:1.1.1.1 Fri Dec 8 16:26:10 2000 +++ xc/extras/freetype2/builds/win32/w32-vcc.mk Wed May 28 22:01:43 2003 @@ -14,10 +14,10 @@ SEP := / -include $(TOP)/builds/win32/win32-def.mk -include $(TOP)/builds/compiler/visualc.mk +include $(TOP_DIR)/builds/win32/win32-def.mk +include $(TOP_DIR)/builds/compiler/visualc.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk # EOF Index: xc/extras/freetype2/builds/win32/w32-wat.mk diff -u xc/extras/freetype2/builds/win32/w32-wat.mk:1.1.1.1 xc/extras/freetype2/builds/win32/w32-wat.mk:1.1.1.2 --- xc/extras/freetype2/builds/win32/w32-wat.mk:1.1.1.1 Tue May 15 23:45:49 2001 +++ xc/extras/freetype2/builds/win32/w32-wat.mk Wed May 28 22:01:43 2003 @@ -16,11 +16,11 @@ SEP := / ISEP := $(strip \ ) -include $(TOP)/builds/win32/win32-def.mk -include $(TOP)/builds/compiler/watcom.mk +include $(TOP_DIR)/builds/win32/win32-def.mk +include $(TOP_DIR)/builds/compiler/watcom.mk # include linking instructions -include $(TOP)/builds/link_dos.mk +include $(TOP_DIR)/builds/link_dos.mk # EOF Index: xc/extras/freetype2/builds/win32/win32-def.mk diff -u xc/extras/freetype2/builds/win32/win32-def.mk:1.1.1.3 xc/extras/freetype2/builds/win32/win32-def.mk:1.1.1.4 --- xc/extras/freetype2/builds/win32/win32-def.mk:1.1.1.3 Sun Sep 9 22:55:53 2001 +++ xc/extras/freetype2/builds/win32/win32-def.mk Wed May 28 22:01:43 2003 @@ -15,7 +15,7 @@ DELETE := del HOSTSEP := $(strip \ ) -BUILD := $(TOP)$(SEP)builds$(SEP)win32 +BUILD := $(TOP_DIR)$(SEP)builds$(SEP)win32 PLATFORM := win32 # by default, we use "\" as a separator on Win32 @@ -30,13 +30,13 @@ # # This lets you build the library in your own directory with something like # -# set TOP=.../path/to/freetype2/top/dir... +# set TOP_DIR=.../path/to/freetype2/top/dir... # set OBJ_DIR=.../path/to/obj/dir -# make -f %TOP%/Makefile setup [options] -# make -f %TOP%/Makefile +# make -f %TOP_DIR%/Makefile setup [options] +# make -f %TOP_DIR%/Makefile # ifndef OBJ_DIR - OBJ_DIR := $(TOP)$(SEP)objs + OBJ_DIR := $(TOP_DIR)$(SEP)objs endif Index: xc/extras/freetype2/builds/win32/visualc/freetype.dsp diff -u xc/extras/freetype2/builds/win32/visualc/freetype.dsp:1.1.1.4 xc/extras/freetype2/builds/win32/visualc/freetype.dsp:1.1.1.5 --- xc/extras/freetype2/builds/win32/visualc/freetype.dsp:1.1.1.4 Thu Jun 20 04:16:04 2002 +++ xc/extras/freetype2/builds/win32/visualc/freetype.dsp Wed May 28 22:01:43 2003 @@ -54,7 +54,7 @@ # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug" @@ -78,7 +78,7 @@ # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" @@ -103,7 +103,7 @@ # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"lib\freetype200b8_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211MT_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214MT_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" @@ -127,7 +127,7 @@ # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211MT.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214MT.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded" @@ -152,7 +152,7 @@ # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206.lib" -# ADD LIB32 /out:"..\..\..\objs\freetype211ST.lib" +# ADD LIB32 /out:"..\..\..\objs\freetype214ST.lib" # SUBTRACT LIB32 /nologo !ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded" @@ -178,7 +178,7 @@ # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211ST_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214ST_D.lib" !ENDIF @@ -231,6 +231,10 @@ # End Source File # Begin Source File +SOURCE=..\..\..\src\gzip\ftgzip.c +# End Source File +# Begin Source File + SOURCE=..\..\..\src\base\ftinit.c # SUBTRACT CPP /Fr # End Source File @@ -251,6 +255,10 @@ # End Source File # Begin Source File +SOURCE=..\..\..\src\pfr\pfr.c +# End Source File +# Begin Source File + SOURCE=..\..\..\src\psaux\psaux.c # SUBTRACT CPP /Fr # End Source File Index: xc/extras/freetype2/builds/win32/visualc/index.html diff -u xc/extras/freetype2/builds/win32/visualc/index.html:1.1.1.2 xc/extras/freetype2/builds/win32/visualc/index.html:1.1.1.3 --- xc/extras/freetype2/builds/win32/visualc/index.html:1.1.1.2 Sun Sep 9 22:55:53 2001 +++ xc/extras/freetype2/builds/win32/visualc/index.html Wed May 28 22:01:43 2003 @@ -1,4 +1,4 @@ - +
FreeType 2 Project Files for Visual C++
@@ -8,14 +8,14 @@

This directory contains a project file for Visual C++, named freetype.dsp. It will compile the following libraries - from the FreeType 2.0.4 sources:

- + from the FreeType 2.1.4 sources:

+ Index: xc/extras/freetype2/devel/ft2build.h diff -u /dev/null xc/extras/freetype2/devel/ft2build.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/devel/ft2build.h Wed May 28 22:01:43 2003 @@ -0,0 +1,41 @@ +/***************************************************************************/ +/* */ +/* ft2build.h */ +/* */ +/* FreeType 2 build and setup macros. */ +/* (Generic version) */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /* + * this is a development version of that is used + * to build the library in debug mode. Its only difference with + * the reference is that is forces the use of the local "ftoption.h" + * which contains different settings for all configuration macros + * + * to use it, you must define the environment variable FT2_BUILD_INCLUDE + * to point to the directory containing these two files ("ft2build.h" and + * "ftoption.h"), then invoke Jam as usual + */ + +#ifndef __FT2_BUILD_GENERIC_H__ +#define __FT2_BUILD_GENERIC_H__ + +#define FT_CONFIG_OPTIONS_H + +#include + +#endif /* __FT2_BUILD_GENERIC_H__ */ + + +/* END */ Index: xc/extras/freetype2/devel/ftoption.h diff -u /dev/null xc/extras/freetype2/devel/ftoption.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/devel/ftoption.h Wed May 28 22:01:43 2003 @@ -0,0 +1,502 @@ +/***************************************************************************/ +/* */ +/* ftoption.h */ +/* */ +/* User-selectable configuration macros (specification only). */ +/* */ +/* Copyright 1996-2001, 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTOPTION_H__ +#define __FTOPTION_H__ + + +#include + + /* + * this is a special developer version of "ftoption.h", it is used + * to define all debugging options, as well as the TrueType bytecode + * interpreter + */ + +FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* USER-SELECTABLE CONFIGURATION MACROS */ + /* */ + /* This file contains the default configuration macro definitions for */ + /* a standard build of the FreeType library. There are three ways to */ + /* use this file to build project-specific versions of the library: */ + /* */ + /* - You can modify this file by hand, but this is not recommended in */ + /* cases where you would like to build several versions of the */ + /* library from a single source directory. */ + /* */ + /* - You can put a copy of this file in your build directory, more */ + /* precisely in "$BUILD/freetype/config/ftoption.h", where "$BUILD" */ + /* is the name of a directory that is included _before_ the FreeType */ + /* include path during compilation. */ + /* */ + /* The default FreeType Makefiles and Jamfiles use the build */ + /* directory "builds/" by default, but you can easily change */ + /* that for your own projects. */ + /* */ + /* - Copy the file to "$BUILD/ft2build.h" and modify it */ + /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */ + /* locate this file during the build. For example, */ + /* */ + /* #define FT_CONFIG_OPTIONS_H */ + /* #include */ + /* */ + /* will use "$BUILD/myftoptions.h" instead of this file for macro */ + /* definitions. */ + /* */ + /* Note also that you can similarly pre-define the macro */ + /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */ + /* that are statically linked to the library at compile time. By */ + /* default, this file is . */ + /* */ + /* We highly recommend using the third method whenever possible. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Many compilers provide a non-ANSI 64-bit data type that can be used */ + /* by FreeType to speed up some computations. However, this will create */ + /* some problems when compiling the library in strict ANSI mode. */ + /* */ + /* For this reason, the use of 64-bit ints is normally disabled when */ + /* the __STDC__ macro is defined. You can however disable this by */ + /* defining here the macro FT_CONFIG_OPTION_FORCE_INT64. */ + /* */ + /* For most compilers, this will only create compilation warnings */ + /* when building the library. */ + /* */ + /* ObNote: The compiler-specific 64-bit integers are detected in the */ + /* file "ftconfig.h" either statically, or through Autoconf */ + /* on platforms that support it. */ + /* */ +#undef FT_CONFIG_OPTION_FORCE_INT64 + + + /*************************************************************************/ + /* */ + /* Gzip-compressed file support. */ + /* */ + /* FreeType now handles font files that have been compressed with the */ + /* 'gzip' program. This is mostly used to parse many of the PCF files */ + /* that come with XFree86. The implementation uses 'zlib' to */ + /* partially uncompress the file on the fly (see src/base/ftgzip.c). */ + /* */ + /* Define this macro if you want to enable this "feature". Note that */ + /* this will however force you to link the zlib to any program that */ + /* also uses FreeType. */ + /* */ +#define FT_CONFIG_OPTION_USE_ZLIB + + + /*************************************************************************/ + /* */ + /* ZLib library selection */ + /* */ + /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */ + /* It allows FreeType's "ftgzip" component to link to the system's */ + /* installation of the ZLib library. This is useful on systems like */ + /* Unix or VMS where it generally is already available. */ + /* */ + /* If you let it undefined, the component will use its own copy */ + /* of the zlib sources instead. These have been modified to be */ + /* included directly within the component and *not* export external */ + /* function names. This allows you to link any program with FreeType */ + /* _and_ ZLib without linking conflicts. */ + /* */ + /* do not #undef this macro here, since the build system might */ + /* define for certain configurations */ + /* */ +/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ + + + /*************************************************************************/ + /* */ + /* DLL export compilation */ + /* */ + /* When compiling FreeType as a DLL, some systems/compilers need a */ + /* special keyword in front OR after the return type of function */ + /* declarations. */ + /* */ + /* Two macros are used within the FreeType source code to define */ + /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ + /* */ + /* FT_EXPORT( return_type ) */ + /* */ + /* is used in a function declaration, as in */ + /* */ + /* FT_EXPORT( FT_Error ) */ + /* FT_Init_FreeType( FT_Library* alibrary ); */ + /* */ + /* */ + /* FT_EXPORT_DEF( return_type ) */ + /* */ + /* is used in a function definition, as in */ + /* */ + /* FT_EXPORT_DEF( FT_Error ) */ + /* FT_Init_FreeType( FT_Library* alibrary ) */ + /* { */ + /* ... some code ... */ + /* return FT_Err_Ok; */ + /* } */ + /* */ + /* You can provide your own implementation of FT_EXPORT and */ + /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */ + /* will be later automatically defined as `extern return_type' to */ + /* allow normal compilation. */ + /* */ +/* #define FT_EXPORT(x) extern x */ +/* #define FT_EXPORT_DEF(x) x */ + + + /*************************************************************************/ + /* */ + /* Glyph Postscript Names handling */ + /* */ + /* By default, FreeType 2 is compiled with the `PSNames' module. This */ + /* module is in charge of converting a glyph name string into a */ + /* Unicode value, or return a Macintosh standard glyph name for the */ + /* use with the TrueType `post' table. */ + /* */ + /* Undefine this macro if you do not want `PSNames' compiled in your */ + /* build of FreeType. This has the following effects: */ + /* */ + /* - The TrueType driver will provide its own set of glyph names, */ + /* if you build it to support postscript names in the TrueType */ + /* `post' table. */ + /* */ + /* - The Type 1 driver will not be able to synthetize a Unicode */ + /* charmap out of the glyphs found in the fonts. */ + /* */ + /* You would normally undefine this configuration macro when building */ + /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */ + /* */ +#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES + + + /*************************************************************************/ + /* */ + /* Postscript Names to Unicode Values support */ + /* */ + /* By default, FreeType 2 is built with the `PSNames' module compiled */ + /* in. Among other things, the module is used to convert a glyph name */ + /* into a Unicode value. This is especially useful in order to */ + /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */ + /* through a big table named the `Adobe Glyph List' (AGL). */ + /* */ + /* Undefine this macro if you do not want the Adobe Glyph List */ + /* compiled in your `PSNames' module. The Type 1 driver will not be */ + /* able to synthetize a Unicode charmap out of the glyphs found in the */ + /* fonts. */ + /* */ +#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + + + /*************************************************************************/ + /* */ + /* Allow the use of FT_Incremental_Interface to load typefaces that */ + /* contain no glyph data, but supply it via a callback function. */ + /* This allows FreeType to be used with the PostScript language, using */ + /* the GhostScript interpreter. */ + /* */ +/* #define FT_CONFIG_OPTION_INCREMENTAL */ + + + /*************************************************************************/ + /* */ + /* The size in bytes of the render pool used by the scan-line converter */ + /* to do all of its work. */ + /* */ + /* This must be greater than 4kByte. */ + /* */ +#define FT_RENDER_POOL_SIZE 16384L + + + /*************************************************************************/ + /* */ + /* FT_MAX_MODULES */ + /* */ + /* The maximum number of modules that can be registered in a single */ + /* FreeType library object. 32 is the default. */ + /* */ +#define FT_MAX_MODULES 32 + + + /*************************************************************************/ + /* */ + /* Debug level */ + /* */ + /* FreeType can be compiled in debug or trace mode. In debug mode, */ + /* errors are reported through the `ftdebug' component. In trace */ + /* mode, additional messages are sent to the standard output during */ + /* execution. */ + /* */ + /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */ + /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */ + /* */ + /* Don't define any of these macros to compile in `release' mode! */ + /* */ +#define FT_DEBUG_LEVEL_ERROR +#define FT_DEBUG_LEVEL_TRACE + + + /*************************************************************************/ + /* */ + /* Memory Debugging */ + /* */ + /* FreeType now comes with an integrated memory debugger that is */ + /* capable of detecting simple errors like memory leaks or double */ + /* deletes. To compile it within your build of the library, you */ + /* should define FT_DEBUG_MEMORY here. */ + /* */ + /* Note that the memory debugger is only activated at runtime when */ + /* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */ + /* */ +#define FT_DEBUG_MEMORY + + + + /*************************************************************************/ + /* */ + /* Module errors */ + /* */ + /* If this macro is set (which is _not_ the default), the higher byte */ + /* of an error code gives the module in which the error has occurred, */ + /* while the lower byte is the real error code. */ + /* */ + /* Setting this macro makes sense for debugging purposes only, since */ + /* it would break source compatibility of certain programs that use */ + /* FreeType 2. */ + /* */ + /* More details can be found in the files ftmoderr.h and fterrors.h. */ + /* */ +#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS + + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** S F N T D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */ + /* embedded bitmaps in all formats using the SFNT module (namely */ + /* TrueType & OpenType). */ + /* */ +#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */ + /* load and enumerate the glyph Postscript names in a TrueType or */ + /* OpenType file. */ + /* */ + /* Note that when you do not compile the `PSNames' module by undefining */ + /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */ + /* contain additional code used to read the PS Names table from a font. */ + /* */ + /* (By default, the module uses `PSNames' to extract glyph names.) */ + /* */ +#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */ + /* access the internal name table in a SFNT-based format like TrueType */ + /* or OpenType. The name table contains various strings used to */ + /* describe the font, like family name, copyright, version, etc. It */ + /* does not contain any glyph name though. */ + /* */ + /* Accessing SFNT names is done through the functions declared in */ + /* `freetype/ftnames.h'. */ + /* */ +#define TT_CONFIG_OPTION_SFNT_NAMES + + + /*************************************************************************/ + /* */ + /* TrueType CMap support */ + /* */ + /* Here you can fine-tune which TrueType CMap table format shall be */ + /* supported. */ +#define TT_CONFIG_CMAP_FORMAT_0 +#define TT_CONFIG_CMAP_FORMAT_2 +#define TT_CONFIG_CMAP_FORMAT_4 +#define TT_CONFIG_CMAP_FORMAT_6 +#define TT_CONFIG_CMAP_FORMAT_8 +#define TT_CONFIG_CMAP_FORMAT_10 +#define TT_CONFIG_CMAP_FORMAT_12 + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ + /* a bytecode interpreter in the TrueType driver. Note that there are */ + /* important patent issues related to the use of the interpreter. */ + /* */ + /* By undefining this, you will only compile the code necessary to load */ + /* TrueType glyphs without hinting. */ + /* */ + /* do not #undef this macro here, since the build system might */ + /* define for certain configurations */ + /* */ +#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */ + /* bytecode interpreter with a huge switch statement, rather than a call */ + /* table. This results in smaller and faster code for a number of */ + /* architectures. */ + /* */ + /* Note however that on some compiler/processor combinations, undefining */ + /* this macro will generate faster, though larger, code. */ + /* */ +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ + /* TrueType glyph loader to use Apple's definition of how to handle */ + /* component offsets in composite glyphs. */ + /* */ + /* Apple and MS disagree on the default behavior of component offsets */ + /* in composites. Apple says that they should be scaled by the scale */ + /* factors in the transformation matrix (roughly, it's more complex) */ + /* while MS says they should not. OpenType defines two bits in the */ + /* composite flags array which can be used to disambiguate, but old */ + /* fonts will not have them. */ + /* */ + /* http://partners.adobe.com/asn/developer/opentype/glyf.html */ + /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ + /* */ +#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */ + /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */ + /* required. */ + /* */ +#define T1_MAX_DICT_DEPTH 5 + + + /*************************************************************************/ + /* */ + /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */ + /* calls during glyph loading. */ + /* */ +#define T1_MAX_SUBRS_CALLS 16 + + + /*************************************************************************/ + /* */ + /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */ + /* minimum of 16 is required. */ + /* */ + /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */ + /* */ +#define T1_MAX_CHARSTRINGS_OPERANDS 256 + + + /*************************************************************************/ + /* */ + /* Define this configuration macro if you want to prevent the */ + /* compilation of `t1afm', which is in charge of reading Type 1 AFM */ + /* files into an existing face. Note that if set, the T1 driver will be */ + /* unable to produce kerning distances. */ + /* */ +#undef T1_CONFIG_OPTION_NO_AFM + + + /*************************************************************************/ + /* */ + /* Define this configuration macro if you want to prevent the */ + /* compilation of the Multiple Masters font support in the Type 1 */ + /* driver. */ + /* */ +#undef T1_CONFIG_OPTION_NO_MM_SUPPORT + + /* */ + +/* + * the FT_CONFIG_OPTION_CHESTER_XXXX macros are used to toggle some recent + * improvements to the auto-hinter contributed by David Chester. They will + * most likely disappear completely in the next release. For now, you should + * always keep them defined + * + */ +#define FT_CONFIG_OPTION_CHESTER_HINTS + +#ifdef FT_CONFIG_OPTION_CHESTER_HINTS + +# define FT_CONFIG_CHESTER_SMALL_F +# define FT_CONFIG_CHESTER_ASCENDER +# define FT_CONFIG_CHESTER_SERIF +# define FT_CONFIG_CHESTER_STEM +# define FT_CONFIG_CHESTER_BLUE_SCALE + +#endif /* FT_CONFIG_OPTION_CHESTER_HINTS */ + +FT_END_HEADER + + +#endif /* __FTOPTION_H__ */ + + +/* END */ Index: xc/extras/freetype2/docs/BUGS diff -u xc/extras/freetype2/docs/BUGS:1.1.1.3 xc/extras/freetype2/docs/BUGS:removed --- xc/extras/freetype2/docs/BUGS:1.1.1.3 Thu Feb 14 19:33:22 2002 +++ xc/extras/freetype2/docs/BUGS Sat Feb 28 21:40:13 2004 @@ -1,275 +0,0 @@ -List of known FreeType 2 Bugs ------------------------------ - -"Identifier" is a string to uniquely identify the bug. A more detailed -description of the bug is found below the table of opened bugs. - -"Date" is the date when the bug was first reported or entered in this -document. Dates are in _European_ format, i.e day/month/year. - -"Opened By" is the name of the person who first spotted the bug. Note that -we can use abbreviations here, like: - - "David" for David Turner - "Werner" for Werner Lemberg - etc. - -"Reproduceable" indicates whether the bug could be reproduced by the -development team or not (it can be specific to a given platform), whether it -always happens, or only sporadically, etc. - - - -I. Open bugs -============ - - -Identifier Date Opened by Reproduceable ------------------------------------------------------------------------------- -NO-CID-CMAPS 13-09-2001 David always -BAD-TT-RENDERING 12-09-2001 Paul Pedriana ? -BAD-THIN-LINES 13-09-2001 David ? -NOT-WINDOWS-METRICS 07-10-2001 David always -ADVANCED-COMPOSITES 25-10-2001 George Williams always - ---------------------END-OF-OPENED-BUGS-TABLE---------------------------------- - - - -II. Closed bugs -=============== - - -Identifier Date Closed by Closure date ------------------------------------------------------------------------------- -BAD-TTNAMEID.H 12-09-2001 Antoine N/A -BAD-T1-CHARMAP 15-06-2001 David 2.0.5 -BAD-UNIXXXX-NAMES 30-07-2001 David 2.0.5 -GLYPH_TO_BITMAP-BUG 05-12-2001 David 05-12-2001 -AUTOHINT-NO-SBITS 13-09-2001 David 2.0.6 -TT-GLYPH-CRASH 01-01-2002 David 2.0.6 -T1-FONT-CRASH 01-01-2002 David 2.0.6 -BAD-ADVANCES 30-11-2001 David 2.0.6 -GLYPH-TO-BITMAP-BUG 15-12-2001 David 2.0.6 ---------------------END-OF-CLOSED-BUGS-TABLE---------------------------------- - - - -III. Bug descriptions -===================== - - ---- START OF OPEN BUGS --- - - -NO-CID-CMAPS - - Not exactly a bug, but the CFF font driver doesn't build a Unicode charmap - from the contents of font files, which prevents efficiently using fonts in - this format. - - - -BAD-TT-RENDERING - - According to Paul Pedriana , there is a rather - important difference between the rendering of TrueType-hinted glyphs of - current FT2 and old betas. - - Tests and comparisons show a _major_ discrepancy of monochrome truetype - bytecode-hinted glyphs! Something seems to be really broken here! - - Some of this has been fixed in 2.0.6; there was a bug in the TrueType - loader that prevented it from loading composites correctly. However, - there are still _subtle_ differences between FT1 and FT2 when it comes to - monochrome TrueType-hinted glyphs (the major differences are gone though). - - - -BAD-THIN-LINES - - It seems that the anti-aliased renderer in FreeType has problems rendering - extremely thin straight lines correctly, at least when using the - FT_Outline_Render() function. - - - -NOT-WINDOWS-METRICS - - FreeType doesn't always return the same metrics as Windows for ascender, - descender, and text height, depending on character pixel sizes. A lot of - testing on Windows is needed to debug this properly. It might be due to a - rounding bug when computing the "x_scale" and "y_scale" values. - - - -ADVANCED-COMPOSITES - - Provided by George Williams : - - I notice that truetype/ttgload.c only supports Apple's definition of - offsets for composite glyphs. Apple and Microsoft behave differently if - there is a scale factor. OpenType defines some bits to disambiguate. - - (A problem in both 2.0.4 and 2.0.5.) - - Apple says (http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html) that if - flags&ARGS_ARE_XY is set then the offsets should be scaled by the scale - factors (as you have done), but they also say something very cryptic - about what happens when the component is rotated at 45° (which you do - not support) -- See the "Important" note at the bottom. - - The old truetype spec from Microsoft did not mention this. The OpenType - spec (http://www.microsoft.com/typography/otspec/glyf.htm, - http://partners.adobe.com/asn/developer/opentype/glyf.html) defines two - new bits to disambiguate: - - SCALED_COMPONENT_OFFSET 11 - Composite designed to have the component offset scaled (designed for - Apple rasterizer) - - UNSCALED_COMPONENT_OFFSET 12 - Composite designed not to have the component offset scaled (designed - for the Microsoft TrueType rasterizer) - - Perhaps you could add a load_flag to allow the user to define the - default setting? - - David says: - - Wow, I was not even aware of this, it will probably take a little time - to implement since I don't have any font that implement these - "features", and also because I believe that we're running out of bits - for "load_flag", some other way to set preferences is probably needed. - - - ---- END OF OPEN BUGS --- - - - -BAD-TTNAMEID.H - - The file "ttnameid.h" contains various constant macro definitions - corresponding to important values defined by the TrueType specification. - - Joe Man reports that: - - According to the information from TrueType v1.66: - - Platform ID = 3 (Microsoft) - the Encoding ID of GB2312 = 4 - the Encoding ID of big5 = 3 - - However, I have found that in ttnameid.h: - - TT_MS_ID_GB2312 = 3 - TT_MS_ID_BIG_5 = 4 - - Which one is correct? - - Antoine replied that this was a bug in the TT 1.66 specification, and that - FreeType followed the most recent TrueType/OpenType specification here. - - - -AUTOHINT-SBITS - - When trying to load a glyph, with the auto-hinter activated (i.e., when - using FT_LOAD_FORCE_AUTOHINT, or when the font driver doesn't provide its - own hinter), embedded bitmaps are _never_ loaded, unlike the default - behaviour described by the API specification. - - This seems to be a bug in FT_Load_Glyph(), but there is no way to solve it - efficiently without making a few important internal changes to the - library's design (more importantly, to the font driver interface). - - This has been corrected with a hack in FT_Load_Glyph(). More important - internal changes should help get rid of it with a clean solution in a - further release like FreeType 2.1. - - - -BAD-T1-CHARMAP - - Type1 driver doesn't read "cacute" and "lslash" characters from iso8859-2 - charset. Those characters are mapped as MAC-one in glnames.py, so they - cannot be shown in Adobe Type1 fonts. - - (This was due to a bug in the "glnames.py" script used to generate the - table of glyph names in 'src/psaux/pstables.h'.) - - - -BAD-UNIXXXX-NAMES - - Glyph names like uniXXXX are not recognized as they should be. It seems - that code in psmodule.c for uniXXXX glyph names was never tested. The - patch is very simple. - - (A simple bug that was left un-noticed due to the fact that I don't have - any Postscript font that use this convention, unfortunately.) - - - -GLYPH_TO_BITMAP-BUG - - Calling FT_Glyph_To_Bitmap() sometimes modifies the original glyph - outline, creating weird alignment artefacts. - - This subtle bug was really in the file `src/smooth/ftsmooth.c'. - Basically, the outline was shifted before rendering it into a new bitmap - buffer. However, it wasn't properly un-shifted after that operation. - - This was only noticeable with certain glyphs or certain fonts; it crept in - a long time ago. - - The same bug has been fixed in src/raster/ftrender1.c also. - - - -TT-GLYPH-CRASH - - The library crashed when trying to load certain glyphs from an - automatically generated TrueType file (tt1095m_.ttf submitted by Scott - Long). - - It turned out that the font contained invalid glyph data (i.e. was - broken), but the TrueType glyph loader in FreeType wasn't paranoid enough, - which resulted in nasty memory overwrites all over the place. - - - -T1-FONT-CRASH - - The library crashed when trying to load the "Stalingrad Regular" face from - the "sadn.pfb" font file provided by Anthony Fok (and the Gnome-Print team - I believe). - - This was due to the fact that the font missed a full font name entry, - though boasted a family name and postscript name. The Type 1 face loader - didn't check for these pathetic cases and seg-faulted. - - - -BAD-ADVANCES - - All scalable font drivers returned un-fitted glyph advances when - FT_LOAD_DEFAULT was used, which was incorrect. This problem was pretty - old but hadn't been spotted because all test programs actually explicitly - or implicitly (i.e. through the cache) rounded the advance widths of - glyphs. - - This resulted in poor rendering of a number of client applications however - (it is strange to see they took so long to notify the FreeType team). - - - -GLYPH-TO-BITMAP-BUG - - FT_Glyph_To_Bitmap() did incorrectly modify the source glyph in certain - cases, which resulted in random behaviour and bad text rendering. This - was spotted to bugs in both the monochrome and smooth rasterizer. - - -=== end of file === Index: xc/extras/freetype2/docs/BUILD diff -u xc/extras/freetype2/docs/BUILD:1.1.1.2 xc/extras/freetype2/docs/BUILD:removed --- xc/extras/freetype2/docs/BUILD:1.1.1.2 Tue May 15 23:45:44 2001 +++ xc/extras/freetype2/docs/BUILD Sat Feb 28 21:40:13 2004 @@ -1,276 +0,0 @@ - - FreeType 2 compilation how-to - ============================= - - -Introduction ------------- - -Welcome to the FreeType 2 library. You'll find in this document -instructions on how to compile the library on your favorite platform. - - -I. QUICK COMMAND-LINE GUIDE ---------------------------- - - THE FOLLOWING WILL ONLY WORK WITH GNU MAKE, IT WILL FAIL MISERABLY - WITH OTHER MAKE TOOLS, FOR EXAMPLE "BSD MAKE". - - Install GNU Make (version 3.78.1 or newer), then try the following - on Unix or any system with gcc: - - make // this will setup the build - make // this will build the library - - On Win32 + Visual C++: - - make setup visualc // setup the build for VisualC++ on Win32 - make // build the library - - Then, go to the `demos' directory and type - - make - - - Note that on Unix, the first `make' invocation will run a configure - script (which is located in `freetype2/builds/unix/'. You can also - pass parameters to this script with the CFG variable, as in: - - make CFG="--prefix=/usr/local" - make - - - If this doesn't work, read the following. - - -II. COMMAND-LINE COMPILATION ----------------------------- - - Note that if you do not want to compile FreeType 2 from a command - line shell, please skip to section III below (DETAILED COMPILATION). - - FreeType 2 includes a powerful and flexible build system that allows - you to easily compile it on a great variety of platforms from the - command line. To do so, just follow these simple instructions: - - a. Install GNU Make - - Because GNU Make is the only Make tool supported to compile - FreeType 2, you should install it on your machine. - - The FreeType 2 build system relies on many features special to GNU - Make -- trying to build the library with any other Make tool will - *fail*. - - NEARLY ALL OTHER MAKE TOOLS WILL FAIL, INCLUDING "BSD MAKE", SO - REALLY INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM! - - Make sure that you are invoking GNU Make from the command line, by - typing something like: - - make -v - - to display its version number. - - VERSION 3.78.1 OR NEWER IS NEEDED! - - b. Invoke `make' - - Go to the root directory of FreeType 2, then simply invoke GNU - Make from the command line. This will launch the FreeType 2 host - platform detection routines. A summary will be displayed, for - example, on Win32: - - - ============================================================== - FreeType build system -- automatic system detection - - The following settings are used: - - platform win32 - compiler gcc - configuration directory ./builds/win32 - configuration rules ./builds/win32/w32-gcc.mk - - If this does not correspond to your system or settings please - remove the file 'config.mk' from this directory then read the - INSTALL file for help. - - Otherwise, simply type 'make' again to build the library. - ============================================================= - - - If the detected settings correspond to your platform and compiler, - skip to step e. Note that if your platform is completely alien to - the build system, the detected platform will be `ansi'. - - c. Configure the build system for a different compiler - - If the build system correctly detected your platform, but you want - to use a different compiler than the one specified in the summary - (for most platforms, gcc is the defaut compiler), invoke GNU Make - with - - make setup - - For example: - - to use Visual C++ on Win32, type: "make setup visualc" - to use LCC-Win32 on Win32, type: "make setup lcc" - - The name to use is platform-dependent. The list of - available compilers for your system is available in the file - `builds//detect.mk' (note that we hope to make the list - displayed at user demand in the final release). - - If you are satisfied by the new configuration summary, skip to - step e. - - d. Configure the build system for an unknown platform/compiler - - The auto-detection/setup phase of the build system copies a file - to the current directory under the name `config.mk'. - - For example, on OS/2+gcc, it would simply copy - `builds/os2/os2-gcc.mk' to `./config.mk'. - - If for some reason your platform isn't correctly detected, copy - manually the configuration sub-makefile to `./config.mk' and go to - step e. - - Note that this file is a sub-Makefile used to specify Make - variables for compiler and linker invocation during the build. - You can easily create your own version from one of the existing - configuration files, then copy it to the current directory under - the name `./config.mk'. - - e. Build the library - - The auto-detection/setup phase should have copied a file in the - current directory, called `./config.mk'. This file contains - definitions of various Make variables used to invoke the compiler - and linker during the build. - - To launch the build, simply invoke GNU Make again: The top - Makefile will detect the configuration file and run the build with - it. - - f. Build the demonstration programs - - -III. DETAILED COMPILATION PROCEDURE ------------------------------------ - - If you don't want to compile FreeType 2 from the command-line (for - example if you use a graphical IDE on a Mac or Windows), you will - need to understand how the FreeType files are organized. - - FreeType 2 has a very modular design, and it is made of several - components. Each component must be compiled as a stand-alone object - file, even if it is really made of several C source files. For - example, the `base layer' component is made of the following C - files: - - src/ - base/ - ftcalc.c - computations - ftextend.c - extensions support - ftlist.c - simple list management - ftobjs.c - object management - ftoutln.c - simple outline processing - ftstream.c - stream input - - However, you can create a single object file by compiling the file - `src/base/ftbase.c', which basically contains - - #include "ftcalc.c" - #include "ftobjs.c" - #include "ftstream.c" - #include "ftlist.c" - #include "ftoutln.c" - #include "ftextend.c" - - Similarly, each component has a single `englobing' C file to compile - it as a stand-alone object: - - src/autohint/autohint.c - the autohinting module - src/base/ftbase.c - the base layer, high-level interface - src/cache/ftcache.c - a glyph and image caching system - (still experimental) - src/cff/cff.c - the OpenType font driver - src/cid/type1cid.c - the CID-keyed font driver - src/psaux/psaux.c - the PS support module - src/psnames/psnames.c - a support module to handle PS glyph - names - src/raster1/raster1.c - the monochrome raster module - src/sfnt/sfnt.c - the `sfnt' module - src/smooth/smooth.c - the anti-aliasing raster module - src/truetype/truetype.c - the TrueType font driver - src/type1/type1.c - the Type 1 font driver - - The last module of FreeType 2, `winfonts' (implementing support for - Windows FNT format), is a single file. - - To compile one component, do the following: - - - Add the top-level `include' directory to your compilation - include path - - - Add the `src/' directory to your compilation include - path, or simply `cd' to the component's source directory. - - - Compile the component `source' file (see list below); you don't - need to be in the component's directory if you added - `src/' to your include path. - - For example, the following line can be used to compile the truetype - driver on Unix: - - cd freetype2/ - cc -c -Iinclude -Isrc/truetype src/truetype/truetype.c - - Alternatively: - - cd freetype2/src/truetype - cc -c -I../../include truetype.c - - Finally, FreeType 2 contains some other components: - - src/base/ftsystem.c - system-specific memory and i/o support - src/base/ftinit.c - initialization layer - src/base/ftdebug.c - debugging component (empty in release - build) - src/base/ftglyph.c - optional convenience functions - - All font drivers are optional. The `sfnt', `psaux', and `psnames' - modules are mandatory for certain drivers. However, you may need to - update the list of drivers that are statically linked to the - library, which is located in the configuration file - `include/freetype/config/ftmodule.h'. - - -IV. Support for flat-directory compilation ------------------------------------------- - - It is possible to put all FreeType 2 source files into a single - directory, with the exception of the `include' hierarchy. - - 1. Copy all files in current directory: - - cp freetype2/src/base/*.[hc] . - cp freetype2/src/raster1/*.[hc] . - cp freetype2/src/smooth/*.[hc] . - etc. - - 2. Compile sources: - - cc -c -Ifreetype2/include ftsystem.c - cc -c -Ifreetype2/include ftinit.c - cc -c -Ifreetype2/include ftdebug.c - cc -c -Ifreetype2/include ftbase.c - etc. - - You don't need to define the FT_FLAT_COMPILATION macro (as this was - required in previous releases of FreeType 2). - -End of file Index: xc/extras/freetype2/docs/CHANGES diff -u xc/extras/freetype2/docs/CHANGES:1.1.1.6 xc/extras/freetype2/docs/CHANGES:1.1.1.7 --- xc/extras/freetype2/docs/CHANGES:1.1.1.6 Thu Jun 20 04:16:05 2002 +++ xc/extras/freetype2/docs/CHANGES Wed May 28 22:01:43 2003 @@ -1,3 +1,266 @@ +LATEST CHANGES BETWEEN 2.1.4 and 2.1.3 + + I. IMPORTANT BUG FIXES + + - updated to newest libtool version, fixes build problems on various + platforms. + + - a fix in the Gzip stream reader, it couldn't read certain .gz files + properly due to a small typo. In certain cases, FreeType could also + loop endlessly when trying to load tiny gzipped files. + + - the configure script now tries to use the system-wide zlib when + it finds one (instead of the copy found in src/gzip). And + "freetype-config" has been updated to return relevant flags in this + case when invoked with "--libs" (e.g. "-lzlib") + + - certain fonts couldn't be loaded by 2.1.3 because they lacked a + Unicode charmap (e.g. SYMBOL.TTF). FreeType erroneously rejected + them. + + - the CFF loader was modified to accept fonts which only + contain a subset of their reference charset. This prevented the + correct use of PDF-embedded fonts. + + - the logic to detect Unicode charmaps has been modified. this is required + to support fonts which include both 16-bit and 32-bit charmaps (like + very recent asian ones) using the new 10 and 12 SFNT formats. + + - the TrueType loader now limits the depth of composite glyphs. This is + necessary to prevent broken fonts to break the engine by blowing the + stack with recursive glyph definitions. + + - the CMap cache is now capable of managing UCS-4 character codes that + are mapped through extended charmaps in recent TrueType/OpenType fonts + + - the cache sub-system now properly manages out-of-memory conditions, + instead of blindly reporting them to the caller. This means that it + will try to empty the cache before restarting its allocations to see + if that can help. + + - the PFR driver didn't return the list of available embedded bitmaps + properly. + + II. IMPORTANT CHANGES + + - David Chester contributed some enhancements to the auto-hinter that + significantly increase the quality of its output. The Postscript hinter + was also improved in several ways.. + + - the FT_RENDER_MODE_LIGHT render mode was implemented + + - a new API, called FT_Get_BDF_Property has been added to FT_BDF_H to + retrieve BDF properties from BDF _and_ PCF font files. THIS IS STILL + EXPERIMENTAL, since it hasn't been properly tested yet. + + - a Windows FNT specific API has been added, mostly to access font + headers. This is used by Wine + + - TrueType tables without a "hmtx" table are now tolerated when an + incremental interface is used. This happens for certain Type42 fonts + passed from Ghostscript to FreeType. + + - the PFR font driver is now capable of returning the font family and + style names when they're available (instead of the sole "FontID"). This + is performed by parsing an *undocumented* portion of the font file !! + + III. MISCELLANEOUS + + - the path stroker in FT_STROKER_H has entered beta stage. It now works + very well, but it's interface might change a bit in the future. More + on this in later releases + + - the documentation for FT_Size_Metrics didn't appear properly in the + API reference + + - the file docs/VERSION.DLL has been updated to explain versioning + with FreeType (i.e. comparing release/libtool/so numbers, and how + to use them in Autoconf scripts) + + - the installation documentation has been seriously revamped. Everything + is now in the "docs" directory. + +============================================================================== +LATEST CHANGES BETWEEN 2.1.3 and 2.1.2 + + I. IMPORTANT BUG FIXES + + - FT_Vector_Transform had been incorrectly modified in 2.1.2, resulting + in incorrect transformations being applied (for example, rotations + were processed in opposite angles). + + - The format 8 and 12 TrueType charmap enumeration routines have been + fixed (FT_Get_Next_Char returned invalid values). + + - The PFR font driver returned incorrect advance widths if the outline + and metrics resolution defined in the font file were different. + + - FT_Glyph_To_Bitmap now returns successfully when called with an + FT_BitmapGlyph argument (it previously returned an error). + + - A bug in the Type 1 loader that prevented valid font bounding boxes to + be loaded from multiple master fonts. + + - The SFNT validation code has been rewritten. FreeType can now load + "broken" fonts that were usable on Windows, but not with previous + versions of the library. + + - The computation of bearings in the BDF driver has been fixed. + + - The Postscript hinter crashed when trying to hint certain glyphs (more + precisely, when trying to apply hints to an empty glyph outline). + + - The TrueType glyph loader now supports composites in "Apple format" + (they differ slightly from Microsoft/OpenType ones in the way transform + offsets are computed). + + - FreeType was very slow at opening certain asian CID/CFF fonts, due + to fixed increment in dynamic array re-allocations. This has been + changed to exponential behaviour to get acceptable performance + + II. IMPORTANT CHANGES + + - the PCF driver now supports gzip-compressed font files natively. This + means that you'll be able to use all these bitmap fonts that come + with XFree86 with FreeType (and libXft/libXft2, by extension). + + - The automatic and postscript hinters have both been updated. This + results in a relatively important increase of rendering quality since + many nasty defaults have been supressed. Please visit the web page: + + http://www.freetype.org/hinting/smooth-hinting.html + + for additional details on this topic. + + - The "load_flags" parameter of FT_Load_Glyph is now an FT_Int32 + (instead of just being an FT_Int). This breaks source and binary + compatibility for 16bit systems only, while retaining both of them for + 32 and 64 bit ones. + + Some new flags have been added consequently: + + FT_LOAD_NO_AUTOHINT :: Disable the use of the auto-hinter + (but not native format hinters). + + FT_LOAD_TARGET_NORMAL :: Hint and render for normal anti-aliased + displays. + + FT_LOAD_TARGET_MONO :: Hint and render for 1-bit displays. + + FT_LOAD_TARGET_LCD :: Hint and render for horizontal RGB or BGR + sub-pixel displays (like LCD screens). + THIS IS STILL EXPERIMENTAL! + + FT_LOAD_TARGET_LCD_V :: Same as FT_LOAD_TARGET_LCD, for vertical + sub-pixel displays (like rotated LCD + screens). THIS IS STILL EXPERIMENTAL! + + FT_LOAD_MONOCHROME is still supported, but only affects rendering, not + the hinting. + + Note that the 'ftview' demo program available in the 'ft2demos' package + has been updated to support LCD-optimized display on non-paletted + displays (under Win32 and X11) + + - The PFR driver now supports embedded bitmaps (all formats supported), + and returns correct kerning metrics for all glyphs + + - The TrueType charmap loader now supports certain "broken" fonts that + load under Windows without problems. + + - The cache API has been slightly modified (it's still a beta!): + + - The type FTC_ImageDesc has been removed; it is now replaced by + FTC_ImageTypeRec. Note that one of its fields is a `load_flag' + parameter for FT_Load_Glyph. + + - The field "num_grays" of FT_SBitRec has been changed to "max_grays" + in order to fit within a single byte. Its maximum value is thus 255 + (instead of 256 as previously). + + + III. MISCELLANEOUS + + - Added support for the DESTDIR variable during "make install". This + simplifies packaging of FreeType. + + - included modified copies of the ZLib sources in 'src/gzip' in order + to support gzip-compressed PCF fonts. We do not use the system-provided + zlib for now, though this is a probable enhancement for future releases + + - The DocMaker tool used to generate the on-line API reference has been + completely rewritten. It is now located in + "src/tools/docmaker/docmaker.py". Features: + + - better cross-referenced output + - more polished output + - uses Python regular expressions (though it didn't speed the + program) + - much more modular structure, which allows for different "backends" + in order to generate HTML, XML, or whatever format. + + One can regenerate the API reference by calling: + + python src/tools/docmaker/docmaker.py \ + --prefix=ft2 \ + --title=FreeType-2.1.3 \ + --output= + include/freetype/*.h \ + include/freetype/config/*.h \ + include/freetype/cache/*.h + + - A new, experimental, support for incremental font loading (i.e., + loading of fonts where the glyphs are not in the font file itself, but + provided by an external component, like a Postscript interpreter) has + been added by Graham Asher. This is still work in progress, however. + + - A new, EXPERIMENTAL, path stroker has been added. It doesn't suffer + from severe rounding errors and treat bezier arcs directly. Still + work in progress (i.e. not part of the official API). See the file + for some of the details. + + - The massive re-formatting of sources and internal re-design is still + under-way. Many internal functions, constants, and types have been + renamed. + + +======================================================================== + +LATEST CHANGES BETWEEN 2.1.2 and 2.1.1 + + I. IMPORTANT BUG FIXES + + - Many font drivers didn't select a Unicode charmap by default when + a new face was opened (with the FT_CONFIG_OPTION_USE_CMAPS options + enabled), causing many applications to not be able to display text + correctly with the 2.1.x releases. + + - The PFR driver had a bug in its composite loading code that produces + incorrectly placed accents with many fonts. + + - The Type42 driver crashed sometimes due to a nasty bug. + + - The Type 1 custom encoding charmap didn't handle the case where the + first glyph index wasn't 0. + + - A serious typo in the TrueType composite loader produced incorrectly + placed glyphs in fonts like "Wingdings" and a few others. + + + II. MISCELLANEOUS + + - The Win32 Visual C++ project file has been updated to include the + PFR driver as well. + + - "freetype.m4" is now installed by default by "make install" on Unix + systems. + + - The function FT_Get_PS_Font_Info now works with CID and Type42 fonts + as well. + + +======================================================================== + LATEST CHANGES BETWEEN 2.1.1 and 2.1.0 I. IMPORTANT BUG FIXES @@ -36,7 +299,7 @@ - Three new font drivers in this release: - * A BDF font driver, contributed by Franco Narda Zapelli, heavily + * A BDF font driver, contributed by Franco Zappa Nardelli, heavily modified by Werner Lemberg. It also supports anti-aliased bitmaps (using a slightly extended BDF format). @@ -52,7 +315,7 @@ - The cache sub-system has been optimized in important ways. Cache hits are now significantly faster. For example, using the CMap cache is - about twice faster than calling FT_Get_Char_Index on most platforms. + about twice faster than calling FT_Get_Char_Index on most platforms. Similarly, using an SBit cache is about five times faster than loading the bitmaps from a bitmap file, and 300 to 500 times faster than generating them from a scalable format. @@ -1270,7 +1533,7 @@ Here's a layout of the new directory hierarchy: - TOP + TOP_DIR include/ freetype/ freetype.h @@ -1298,7 +1561,7 @@ Compiling a module is now much easier, for example, the following - should work when in the TOP directory on an ANSI build: + should work when in the TOP_DIR directory on an ANSI build: gcc -c -I./include -I./src/base src/base/ftbase.c gcc -c -I./include -I./src/sfnt src/sfnt/sfnt.c Index: xc/extras/freetype2/docs/CUSTOMIZE diff -u /dev/null xc/extras/freetype2/docs/CUSTOMIZE:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/docs/CUSTOMIZE Wed May 28 22:01:43 2003 @@ -0,0 +1,117 @@ +How to customize the compilation of the library: +================================================ + + FreeType is highly customizable to fit various needs, and this document + details how it is possible to select options and components at compilation + time. + + +I. Configuration macros: + + the file found in "include/freetype/config/ftoption.h" contains a list + of commented configuration macros that can be toggled by developers to + indicate which features to activate in their build of the library. + + these options range from debug level to availability of certain + features, like native TrueType hinting through a bytecode interpreter. + + we invite you to read this file for more information. You can change + the file's content to suit your needs, or override it with one of the + techniques described below.. + + +II. Modules list: + + the file found in "include/freetype/config/ftmodule.h" contains a list + of names corresponding to the modules / font drivers to be statically + compiled in the FreeType library during the build. + + you can change it to suit your own preferences. Be aware that certain + modules depend on others, as described by the file "modules.txt" in + this directory. + + you can modify the file's content to suit your needs, or override it + at compile time with one of the methods described below + + +III. System interface: + + FreeType's default interface to the system (i.e. the parts that deal with + memory management and i/o streams) is located in "src/base/ftsystem.c". + + the current implementation uses standard C library calls to manage + memory and read font files. It is however possible to write custom + implementations to suit specific systems. + + to tell the GNU Make-based build system to use a custom system interface, + you'll need to define the environment variable FTSYS_SRC to point to + the relevant implementation, like in: + + on Unix: + ./configure + export FTSYS_SRC=foo/my_ftsystem.c + make + make install + + on Windows: + make setup + set FTSYS_SRC=foo/my_ftsystem.c + make + + +IV. Overriding default configuration and module headers: + + it is possible to over-ride the default configuration and module headers + without changing the original files. There are two ways to do that: + + 1. Using the C include path: + + use the C include path to ensure that your own versions of the + files are used at compile time when the lines: + + #include FT_CONFIG_OPTIONS_H + #include FT_CONFIG_MODULES_H + + are compiled. Their default values being + and , you can do something like: + + custom/ + freetype/ + config/ + ftoption.h => custom options header + ftmodule.h => custom modules list + + include/ => normal FreeType 2 include + freetype/ + ... + + then change the C include path to always give the path to "custom" + before the FreeType 2 "include" + + + 2. Re-defining FT_CONFIG_OPTIONS_H and FT_CONFIG_MODULES_H + + another way to do the same thing is to re-define the macros used + to name the configuration headers. To do so, you'll need a custom + "ft2build.h", whose content can be as simple as: + + #ifndef __FT2_BUILD_GENERIC_H__ + #define __FT2_BUILD_GENERIC_H__ + + #define FT_CONFIG_OPTIONS_H + #define FT_CONFIG_MACROS_H + + #include + + #endif /* __FT2_BUILD_GENERIC_H__ */ + + place them in: + + custom/ + ft2build.h => custom version described above + my-ftoption.h => custom options header + my-ftmodule.h => custom modules list header + + and change the C include path to ensure that "custom" is always placed + before the FT2 "include" during compilation. + Index: xc/extras/freetype2/docs/DEBUG diff -u /dev/null xc/extras/freetype2/docs/DEBUG:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/docs/DEBUG Wed May 28 22:01:43 2003 @@ -0,0 +1,183 @@ +Debugging within the FreeType sources: +====================================== + +I. Configuration macros +----------------------- + +There are several ways to enable debugging features in a FreeType 2 +builds. This is controlled through the definition of special macros +located in the file "ftoptions.h". The macros are: + + + FT_DEBUG_LEVEL_ERROR + + #define this macro if you want to compile the FT_ERROR macro calls + used to print error messages during program execution. This will + not stop the program, but is very useful to spot invalid fonts + during development and code workarounds for them. + + FT_DEBUG_LEVEL_TRACE + + #define this macro if you want to compile both the FT_ERROR macro + and the FT_TRACE one. This also includes the variants FT_TRACE0, + FT_TRACE1, FT_TRACE2, ..., FT_TRACE6. + + The trace macros are used to send debugging messages when an + appropriate "debug level" is configured at runtime through the + FT2_DEBUG environment variable (more on this later). + + FT_DEBUG_MEMORY + + If this macro is #defined, the FreeType engines is linked with a + small but effective debugging memory manager that tracks all + allocations and frees that are performed within the font engine. + + When the FT2_DEBUG_MEMORY environment variable is defined at + runtime, a call to FT_Done_FreeType will dump memory statistics, + including the list of leaked memory blocks with the source locations + where these were allocated. It's always a very good idea to define + this in development builds. This works with _any_ program linked to + FreeType, but requires a big deal of memory (the debugging memory + manager never frees the blocks to the heap in order to detect double + frees). + + When FT2_DEBUG_MEMORY isn't defined at runtime, the debugging memory + manager is ignored, and performance is un-affected. + + +II. Debugging macros +-------------------- + +Several macros can be used within the FreeType sources to help debugging +its code: + + 1. FT_ERROR(( ... )) + + This macro is used to send debug messages that indicate relatively + serious errors (like broken font files), but will not stop the + execution of the running program. Its code is compiled only when + either FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined in + "ftoption.h". + + Note that you must use with a printf-like signature, but with double + parentheses, like in: + + FT_ERROR(( "your %s is not %s\n", "foo", "bar" )); + + + 2. FT_ASSERT( condition ) + + This macro is used to check strong assertions at runtime. If its + condition isn't TRUE, the program will abort with a panic message. + Its code is compiled when either FT_DEBUG_LEVEL_ERROR or + FT_DEBUG_LEVEL_TRACE are defined. You don't need double-parentheses + here. For example: + + FT_ASSERT( ptr != NULL ); + + + 3. FT_TRACE( level, (message...) ) + + The FT_TRACE macro is used to send general-purpose debugging + messages during program execution. This macro uses an *implicit* + macro named FT_COMPONENT used to name the current FreeType component + being run. + + The developer should always define FT_COMPONENT as appropriate, for + example as in: + + #undef FT_COMPONENT + #define FT_COMPONENT trace_io + + The value of the FT_COMPONENT macro is an enumeration named + trace_XXXX where XXXX is one of the component names defined in the + internal file . + + Each such component is assigned a "debug level", ranging from 0 to 6 + when a program linked with FreeType starts, through the use of the + FT2_DEBUG environment variable, described later. + + When FT_TRACE is called, its level is compared to the one of the + corresponding component. Messages with trace levels *higher* than + the corresponding component level are filtered and never printed. + + This means that trace messages with level 0 are always printed, + those with level 2 are only printed when the component level is *at + least* 2. + + The second parameter to FT_TRACE must contain parentheses and + correspond to a print-like call, as in: + + FT_TRACE( 2, ( "your %s is not %s\n", "foo", "bar" ) ) + + The shortcut macros FT_TRACE0, FT_TRACE1, FT_TRACE2_, ... FT_TRACE6 + can be used with constant level indices, and are much cleaner to + use, as in + + FT_TRACE2(( "your %s is not %s\n", "foo", "bar" )); + + +III. Environment variables +-------------------------- + +The following environment variables control debugging output and +behaviour of FreeType at runtime: + + + FT2_DEBUG + + This variable is only used when FreeType is built with + FT_DEBUG_LEVEL_TRACE defined. It contains a list of component level + definitions, following this format: + + component1:level1 component2:level2 component3:level3 ... + + where "componentX" is the name of a tracing component, as defined in + "fttrace.h", but without the "trace_" prefix, and "levelX" is the + corresponding level to use at runtime. + + "any" is a special component name that will be interpreted as + "any/all components". For example, the following definitions + + set FT2_DEBUG=any:2 memory:5 io:4 (on Windows) + export FT2_DEBUG="any:2 memory:5 io:4" (on Linux) + + both stipulate that all components should have level 2, except for + the memory and io components which will be set to trace levels 5 and + 4 respectively. + + FT2_DEBUG_MEMORY + + This environment variable, when defined, tells FreeType to use a + debugging memory manager that will track leaked memory blocks as + well as other common errors like double frees. It is also capable + of reporting _where_ the leaked blocks were allocated, which + considerably saves time when debugging new additions to the library. + + This code is only compiled when FreeType is built with the + FT_DEBUG_MEMORY macro #defined in "ftoption.h" though, it will be + ignored in other builds. + + + FT2_ALLOC_TOTAL_MAX + + this variable is ignored if FT2_DEBUG_MEMORY is not defined. It allows + you to specify a maximum heap size for all memory allocations performed + by FreeType. This is very useful to test the robustness of the font + engine and programs that use it in tight memory conditions. + + If it is undefined, or if its value is not strictly positive, then no + allocation bounds are checked at runtime. + + + FT2_ALLOC_COUNT_MAX + + this variable is ignored if FT2_DEBUG_MEMORY is not defined. It allows + you to sepcify a maximum number of memory allocations performed by + FreeType before returning the error FT_Err_Out_Of_Memory. This is + useful for debugging and testing the engine's robustness. + + If it is undefined, or if its value is not strictly positive, then no + allocation bounsd are checked at runtime. + +End of file Index: xc/extras/freetype2/docs/INSTALL diff -u xc/extras/freetype2/docs/INSTALL:1.1.1.2 xc/extras/freetype2/docs/INSTALL:1.1.1.3 --- xc/extras/freetype2/docs/INSTALL:1.1.1.2 Thu Jun 20 04:16:06 2002 +++ xc/extras/freetype2/docs/INSTALL Wed May 28 22:01:44 2003 @@ -1,185 +1,65 @@ -In order to build the library, read the `BUILD' document in the `docs' -directory. This is only a quick starter. +Welcome +There are several ways to build the FreeType library, depending on your +system and the level of customization you need. Here's a short overview +of the documentation available: -I. Unix systems ---------------- +I. Normal installation and upgrades: - If you have GNU Make installed, simply type + 1. Native TrueType Hinting: + + Native TrueType hinting is disabled by default[1]. If you really need it, + read the file "TRUETYPE" for information. - ./configure - make - make install + + 2. Unix Systems (as well as Cygwin or MSys on Windows): - on the command line to configure, build and install FreeType on your - system. Note that the default installation path is "/usr/local". + Please read *both* UPGRADE.UNX and INSTALL.UNX to install or upgrade + FreeType 2 on a Unix system. Note that you *will* need GNU Make, since + other make tools won't work (this includes BSD Make !!) - Please read the file README.UNX, it contains _critical_ information - regarding the installation of FreeType on many Unix systems. + 3. On VMS with the "mms" build tool: + + see INSTALL.VMS for installation instructions on this platform + 4. Other systems using GNU Make: + + on non-Unix platforms, it's possible to build the library using + GNU Make utility. Note that *NO OTHER MAKE TOOL WILL WORK* !! + This methods supports several compilers on Windows, OS/2 and BeOS, + including Mingw, Visual C++, Borland C++, and more. -II. From the command line -------------------------- + instructions are provided in the file "INSTALL.GNU" - If you are not using Unix, there are two ways to quickly build - FreeType 2 from the command line. - The first, and favorite one, is to use the "Jam" build tool. Jam is - a highly portable replacement for Make whose control files do not - depend on the current platform or compiler toolset. + 5. With an IDE Project File (e.g. for Visual Studio or CodeWarrior): + + we provide a small number of "project files" for various IDEs to + automatically build the library as well. Note that these files are + not supported and sporadically maintained by FreeType developers, + so don't expect them to work in each release. + + to find them, have a look at the content of the "builds/" + directory, where stands for your OS or environment. - For more information, please see: - http://www.freetype.org/jam/index.html + 6. From you own IDE, or own Makefiles: + + If you want to create your own project file, follow the instructions + given in the "INSTALL.ANY" document of this directory. - The second one is to use "GNU Make" (and NO OTHER MAKE TOOL). +II. Custom builds of the library: - 1. Building FT2 with "Jam" - -------------------------- + Customizing the compilation of FreeType is easy, and allows you to select + only the components of the font engine that you really need. For more details + read the file "CUSTOMIZE" - Once you've got *our version* of the Jam tool installed on your - system, simply go to the top-level FT2 directory, then type - "jam" +-------------------------------------------------------------------- - on the command line. This will build the library and place it in - the "objs" directory. +[1] More details on: http://www.freetype.org/patents.html - By default, a static library is built. On Unix systems, it is - possible to build a shared library through the "libtool" script. - You need to have libtool installed on your system, then re-define - a few environment variables before invoking Jam, as in +End of file - export CC="libtool --mode=compile cc" - export LINK="libtool --mode=link cc" - jam - - In later releases of FT2, building shared libraries with Jam - should become automatic on Unix systems. - - - 2. Building FT2 with "GNU Make" - ------------------------------- - - You need to have GNU Make (version 3.78.1 or newer) installed on - your system to compile the library from the command line. This will - _NOT_ work with other make tools (including BSD make)! - - [Well, this is not really correct. Recently, a perl implementation - of make called `makepp' has appeared which can also build FreeType 2 - successfully on Unix platforms. See http://makepp.sourceforge.net - for more details.] - - - Go to the `freetype2' directory. - - - Unix (any C compiler should work): - - - make setup (don't worry, this will invoke a configure script) - - make - - make install - - Alternatively, you can pass parameters to the configure script - within the CFG variable, as in: - - - make setup CFG="--prefix=/usr" - - make - - make install - - If the configure script isn't run, try to add `unix' as a target - on the command line, e.g.: - - - make setup unix CFG="--prefix=/opt/experimental" - - - - Windows: - - We provide a version of GNU Make for Win32 on the FreeType site. - See http://www.freetype.org/download.html for details. - - - gcc (Mingw, _not_ CygWin): - - - make setup - - make - - - - Visual C++: - - - make setup visualc - - make - - - - other compilers: - - - make setup bcc32 -> Borland C++ 32 bits - - make setup intelc -> Intel C++ - - make setup watcom -> Watcom C++ - - make setup lcc -> Win32-LCC - - - If you want to build FreeType 2 in another directory, you must set - two environment variables, `OJB_DIR' and `TOP'. The former gives - the directory where the object files and the library should be - created (this directory must exist), the latter the top directory of - the FreeType 2 source tree. Example: - - OBJ_DIR=~/freetype2.compiled TOP=~/freetype2 \ - make -f$TOP/Makefile setup ansi - OBJ_DIR=~/freetype2.compiled TOP=~/freetype2 \ - make -f$TOP/Makefile - - On Unix boxes, calling `configure' from the build directory is - sufficient; it will build a small Makefile which calls the - FreeType 2 Makefile with the necessary parameters. - - -III. In your own environment (IDE) ----------------------------------- - - You need to add the directories "freetype2/include" to your include - path when compiling the library. - - FreeType 2 is made of several components; each one of them is - located in a subdirectory of "freetype2/src". For example, - `freetype2/src/truetype/' contains the TrueType font driver. - - DO NOT COMPILE ALL C FILES! Rather, compile the following ones: - - -- base components (required) - - src/base/ftsystem.c - src/base/ftinit.c - src/base/ftdebug.c - src/base/ftbase.c - src/base/ftglyph.c - src/base/ftbbox.c - src/base/ftmm.c - - src/base/ftmac.c -- only on the Macintosh - - -- other components are optional - - src/autohint/autohint.c -- auto hinting module - src/cache/ftcache.c -- cache sub-system (in beta) - src/sfnt/sfnt.c -- SFNT files support - (TrueType & OpenType) - src/cff/cff.c -- CFF/OpenType font driver - src/psnames/psnames.c -- Postscript glyph names support - src/psaux/psaux.c -- Postscript Type 1 parsing - src/truetype/truetype.c -- TrueType font driver - src/type1/type1.c -- Type 1 font driver - src/cid/type1cid.c -- Type 1 CID-keyed font driver - src/winfonts/winfonts.c -- Windows FONT / FNT font driver - - Note: - - `truetype.c' needs `sfnt.c' and `psnames.c' - `type1.c' needs `psaux.c' and `psnames.c' - `type1cid.c' needs `psaux.c' and `psnames.c' - `cff.c' needs `sfnt.c', `psaux.c', and `psnames.c' - - etc. - -For more information, please consult "docs/BUILD". - ---- end of INSTALL -- + \ No newline at end of file Index: xc/extras/freetype2/docs/INSTALL.ANY diff -u /dev/null xc/extras/freetype2/docs/INSTALL.ANY:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/docs/INSTALL.ANY Wed May 28 22:01:43 2003 @@ -0,0 +1,96 @@ +Instructions on how to build FreeType with your own build tool: + + see the file "CUSTOMIZE" to learn how to customize FreeType to + specific environments. + + follow these simple steps: + +I. Normal way: +-------------- + + * DISABLE PRE-COMPILED HEADERS ! This is very important for Visual + C++, because FreeType uses lines like: + + #include FT_FREETYPE_H + + which are not correctly supported by this compiler, while being + ISO C compliant !! + + * You need to add the directories "freetype2/include" to your include + path when compiling the library. + + * FreeType 2 is made of several components; each one of them is + located in a subdirectory of "freetype2/src". For example, + 'freetype2/src/truetype/' contains the TrueType font driver. + + * DO NOT COMPILE ALL C FILES! Rather, compile the following ones: + + -- base components (required) + + src/base/ftsystem.c + src/base/ftinit.c + src/base/ftdebug.c + src/base/ftbase.c + src/base/ftglyph.c + src/base/ftbbox.c + src/base/ftmm.c + src/base/ftpfr.c -- optional, see + src/base/ftbdf.c -- optional, see + src/base/ftwinfnt.c -- optional, see + + src/base/ftmac.c -- only on the Macintosh + + -- other components are optional + + src/autohint/autohint.c -- auto hinting module + src/cache/ftcache.c -- cache sub-system (in beta) + src/sfnt/sfnt.c -- SFNT files support + (TrueType & OpenType) + src/cff/cff.c -- CFF/OpenType font driver + src/pfr/pfr.c -- PFR/TrueDoc font driver + src/bdf/bdf.c -- BDF font driver + src/pcf/pcf.c -- PCF font driver + src/psnames/psnames.c -- Postscript glyph names support + src/psaux/psaux.c -- Postscript Type 1 parsing + src/truetype/truetype.c -- TrueType font driver + src/type1/type1.c -- Type 1 font driver + src/cid/type1cid.c -- Type 1 CID-keyed font driver + src/winfonts/winfonts.c -- Windows FONT / FNT font driver + src/raster1/raster1.c -- monochrome rasterizer + src/smooth/smooth.c -- anti-aliasing rasterizer + + Note: + + `truetype.c' needs `sfnt.c' and `psnames.c' + `type1.c' needs `psaux.c' and `psnames.c' + `type1cid.c' needs `psaux.c' and `psnames.c' + `cff.c' needs `sfnt.c', `psaux.c', and `psnames.c' + + that should be it ! in case of problems, see the archives of + the FreeType development mailing list. + + +II. Support for flat-directory compilation +------------------------------------------ + + It is possible to put all FreeType 2 source files into a single + directory, with the *exception* of the `include' hierarchy. + + 1. Copy all files in current directory: + + cp freetype2/src/base/*.[hc] . + cp freetype2/src/raster1/*.[hc] . + cp freetype2/src/smooth/*.[hc] . + etc. + + 2. Compile sources: + + cc -c -Ifreetype2/include ftsystem.c + cc -c -Ifreetype2/include ftinit.c + cc -c -Ifreetype2/include ftdebug.c + cc -c -Ifreetype2/include ftbase.c + etc. + + You don't need to define the FT_FLAT_COMPILATION macro (as this was + required in previous releases of FreeType 2). + Index: xc/extras/freetype2/docs/INSTALL.GNU diff -u /dev/null xc/extras/freetype2/docs/INSTALL.GNU:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/docs/INSTALL.GNU Wed May 28 22:01:44 2003 @@ -0,0 +1,128 @@ +This document contains instructions on how to build the FreeType library +on non-Unix systems with the help of GNU Make. Note that if you're running +Cygwin or MSys in Windows, you should follow the instructions of INSTALL.UNX +instead. + + + FreeType 2 includes a powerful and flexible build system that allows + you to easily compile it on a great variety of platforms from the + command line. To do so, just follow these simple instructions: + + a. Install GNU Make + + Because GNU Make is the only Make tool supported to compile + FreeType 2, you should install it on your machine. + + The FreeType 2 build system relies on many features special to GNU + Make -- trying to build the library with any other Make tool will + *fail*. + + NEARLY ALL OTHER MAKE TOOLS WILL FAIL, INCLUDING "BSD MAKE", SO + REALLY INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM! + + Make sure that you are invoking GNU Make from the command line, by + typing something like: + + make -v + + to display its version number. + + VERSION 3.78.1 OR NEWER IS NEEDED! + + + + b. Invoke 'make' + + Go to the root directory of FreeType 2, then simply invoke GNU + Make from the command line. This will launch the FreeType 2 host + platform detection routines. A summary will be displayed, for + example, on Win32: + + + ============================================================== + FreeType build system -- automatic system detection + + The following settings are used: + + platform win32 + compiler gcc + configuration directory ./builds/win32 + configuration rules ./builds/win32/w32-gcc.mk + + If this does not correspond to your system or settings please + remove the file 'config.mk' from this directory then read the + INSTALL file for help. + + Otherwise, simply type 'make' again to build the library. + ============================================================= + + + If the detected settings correspond to your platform and compiler, + skip to step e. Note that if your platform is completely alien to + the build system, the detected platform will be 'ansi'. + + + c. Configure the build system for a different compiler + + If the build system correctly detected your platform, but you want + to use a different compiler than the one specified in the summary + (for most platforms, gcc is the defaut compiler), invoke GNU Make + with + + make setup + + For example: + + to use Visual C++ on Win32, type: "make setup visualc" + to use Borland C++ on Win32, type "make setup bcc32" + to use Watcom C++ on Win32, type "make setup watcom" + to use Intel C++ on Win32, type "make setup intelc" + to use LCC-Win32 on Win32, type: "make setup lcc" + to use Watcom C++ on OS/2, type "make setup watcom" + to use VisualAge C++ on OS/2, type "make setup visualage" + + The name to use is platform-dependent. The list of + available compilers for your system is available in the file + `builds//detect.mk' + + If you are satisfied by the new configuration summary, skip to + step e. + + d. Configure the build system for an unknown platform/compiler + + The auto-detection/setup phase of the build system copies a file + to the current directory under the name `config.mk'. + + For example, on OS/2+gcc, it would simply copy + `builds/os2/os2-gcc.mk' to `./config.mk'. + + If for some reason your platform isn't correctly detected, copy + manually the configuration sub-makefile to `./config.mk' and go to + step e. + + Note that this file is a sub-Makefile used to specify Make + variables for compiler and linker invocation during the build. + You can easily create your own version from one of the existing + configuration files, then copy it to the current directory under + the name `./config.mk'. + + e. Build the library + + The auto-detection/setup phase should have copied a file in the + current directory, called `./config.mk'. This file contains + definitions of various Make variables used to invoke the compiler + and linker during the build. + + To launch the build, simply invoke GNU Make again: The top + Makefile will detect the configuration file and run the build with + it. + + + + Final note: + + the build system builds a statically linked library of the font engine + in the "objs" directory. It does _not_ support the build of DLLs on + Windows and OS/2, if you need these, you'll have to either use + a IDE-specific project file, or follow the instructions in + "INSTALL.ANY" to create your own Makefiles. Index: xc/extras/freetype2/docs/INSTALL.UNX diff -u /dev/null xc/extras/freetype2/docs/INSTALL.UNX:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/docs/INSTALL.UNX Wed May 28 22:01:44 2003 @@ -0,0 +1,181 @@ +This document contains instructions on how to build the FreeType library +on Unix systems. This also works for emulations like Cygwin or MSys on +Win32: + + + I. Ensure that you are using GNU Make + ------------------------------------- + + The FreeType build system _exclusively_ works with GNU Make. You + will not be able to compile the library with the instructions + below using any other alternative (including BSD Make). + + Trying to compile the library with a different Make tool will + print a message like: + + Sorry, GNU make is required to build FreeType2. + + and the build process will be aborted. If this happens, install + GNU Make on your system, and use the GNUMAKE environment variable + to name it. + + + + IV. Build and install the library + --------------------------------- + + The following should work on all Unix systems where the 'make' + command invokes GNU Make: + + ./configure --prefix= + make + make install (as root) + + where "" must be replaced by the prefix returned by + the "freetype-config" command. + + When using a different command to invoke GNU Make, use the GNUMAKE + variable. For example, if `gmake' is the command to use on your + system, do something like: + + GNUMAKE=gmake ./configure --prefix= + gmake + gmake install (as root) + + If this still doesn't work, something's rotten on your system( + (e.g. you're using a very old version of GNU Make) + + + +I. Unix systems +--------------- + + If you have GNU Make installed, simply type + + ./configure + make + make install + + on the command line to configure, build and install FreeType on your + system. Note that the default installation path is "/usr/local". + + Please read the file README.UNX, it contains _critical_ information + regarding the installation of FreeType on many Unix systems. + + +II. From the command line +------------------------- + + If you are not using Unix, there are two ways to quickly build + FreeType 2 from the command line. + + The first, and favorite one, is to use the "Jam" build tool. Jam is + a highly portable replacement for Make whose control files do not + depend on the current platform or compiler toolset. + + For more information, please see: + + http://www.freetype.org/jam/index.html + + The second one is to use "GNU Make" (and NO OTHER MAKE TOOL). + + + 1. Building FT2 with "Jam" + -------------------------- + + Once you've got *our version* of the Jam tool installed on your + system, simply go to the top-level FT2 directory, then type + + "jam" + + on the command line. This will build the library and place it in + the "objs" directory. + + By default, a static library is built. On Unix systems, it is + possible to build a shared library through the "libtool" script. + You need to have libtool installed on your system, then re-define + a few environment variables before invoking Jam, as in + + export CC="libtool --mode=compile cc" + export LINK="libtool --mode=link cc" + jam + + In later releases of FT2, building shared libraries with Jam + should become automatic on Unix systems. + + + 2. Building FT2 with "GNU Make" + ------------------------------- + + You need to have GNU Make (version 3.78.1 or newer) installed on + your system to compile the library from the command line. This will + _NOT_ work with other make tools (including BSD make)! + + [Well, this is not really correct. Recently, a perl implementation + of make called `makepp' has appeared which can also build FreeType 2 + successfully on Unix platforms. See http://makepp.sourceforge.net + for more details.] + + - Go to the `freetype2' directory. + + - Unix (any C compiler should work): + + - make setup (don't worry, this will invoke a configure script) + - make + - make install + + Alternatively, you can pass parameters to the configure script + within the CFG variable, as in: + + - make setup CFG="--prefix=/usr" + - make + - make install + + If the configure script isn't run, try to add `unix' as a target + on the command line, e.g.: + + - make setup unix CFG="--prefix=/opt/experimental" + + + - Windows: + + We provide a version of GNU Make for Win32 on the FreeType site. + See http://www.freetype.org/download.html for details. + + - gcc (Mingw, _not_ CygWin): + + - make setup + - make + + + - Visual C++: + + - make setup visualc + - make + + + - other compilers: + + - make setup bcc32 -> Borland C++ 32 bits + - make setup intelc -> Intel C++ + - make setup watcom -> Watcom C++ + - make setup lcc -> Win32-LCC + + + If you want to build FreeType 2 in another directory, you must set + two environment variables, `OJB_DIR' and `TOP_DIR'. The former + gives the directory where the object files and the library should be + created (this directory must exist), the latter the top directory of + the FreeType 2 source tree. Example: + + OBJ_DIR=~/freetype2.compiled TOP_DIR=~/freetype2 \ + make -f$TOP_DIR/Makefile setup ansi + OBJ_DIR=~/freetype2.compiled TOP_DIR=~/freetype2 \ + make -f$TOP_DIR/Makefile + + On Unix boxes, calling `configure' from the build directory is + sufficient; it will build a small Makefile which calls the + FreeType 2 Makefile with the necessary parameters. + + +--- end of INSTALL -- Index: xc/extras/freetype2/docs/INSTALL.VMS diff -u /dev/null xc/extras/freetype2/docs/INSTALL.VMS:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/docs/INSTALL.VMS Wed May 28 22:01:44 2003 @@ -0,0 +1,35 @@ +How to build the freetype2 library on VMS +----------------------------------------- + +Just type one of the following depending on the type of external entries you +want: + + mms + +or + + mms/macro=("COMP_FLAGS=/name=(as_is,short)") + +The library is avalaible in the directory + + [.LIB] + +To compile applications using freetype2 you'll need to define the logical +FREETYPE pointing to the directory + + [.INCLUDE.FREETYPE] + +(i.e., if the directory in which this README.VMS file is located is +$disk:[freetype] then define the logical with + + define freetype $disk:[freetype.include.freetype] + +This version has been tested with Compaq C V6.2-006 on OpenVMS Alpha V7.2-1. + + + Any problems can be reported to + + joukj@hrem.stm.tudelft.nl + + + Jouk Jansen Index: xc/extras/freetype2/docs/TODO diff -u xc/extras/freetype2/docs/TODO:1.1.1.1 xc/extras/freetype2/docs/TODO:1.1.1.2 --- xc/extras/freetype2/docs/TODO:1.1.1.1 Mon Jan 14 11:52:03 2002 +++ xc/extras/freetype2/docs/TODO Wed May 28 22:01:44 2003 @@ -4,6 +4,10 @@ Here is a list of items that need to be addressed in FreeType 2; they are not exactly bugs, but should be considered though: -* Add synthesized Unicode charmap processing to the CFF driver. - * Implement stem3/counter hints properly in the Postscript hinter. + +* FInalize the cache sub-system. If has been in beta for too long :-) + +* The automatic and Postscript hinters have been improved to increase + the quality of AA text, but Monochrome and LCD hinting still suck. we + need to do something about that.. Index: xc/extras/freetype2/docs/TRUETYPE diff -u /dev/null xc/extras/freetype2/docs/TRUETYPE:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/docs/TRUETYPE Wed May 28 22:01:44 2003 @@ -0,0 +1,23 @@ +How to enable the TrueType native hinter if you need it +-------------------------------------------------------- + + The TrueType bytecode interpreter is disabled in all public + releases of the FreeType packages for patents reasons (see + http://www.freetype.org/patents.html for more details). + + However, many Linux distributions do enable the interpreter in the + FreeType packages (DEB/RPM/etc.) they produce for their platforms. + If you are using TrueType fonts on your system, you most probably + want to enable it manually by doing the following: + + - open the file "include/freetype/config/ftoption.h" + + - locate a line that says: + + #undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + - change it to: + + #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + of course, this must be done _before_ compiling the library Index: xc/extras/freetype2/docs/UPGRADE.UNX diff -u /dev/null xc/extras/freetype2/docs/UPGRADE.UNX:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/docs/UPGRADE.UNX Wed May 28 22:01:44 2003 @@ -0,0 +1,124 @@ + +SPECIAL NOTE FOR UNIX USERS +=========================== + + If you are installing this release of FreeType on a system that + already uses release 2.0.5 (or even an older version), you have to + perform a few special steps to ensure that everything goes well. + + + I. Enable the TrueType bytecode hinter if you need it + ----------------------------------------------------- + + See the instructions in the file "TRUETYPE" of this directory. + + Note that FreeType supports TrueType fonts without the bytecode + interpreter through its auto-hinter, which now generate relatively good + results with most fonts. + + + II. Determine the correct installation path + -------------------------------------------- + + By default, the source package will install the library in + "/usr/local". However, many Unix distributions now install the + library in "/usr", since FreeType is becoming a critical system + component. + + If FreeType is already installed on your system, type + + freetype-config --prefix + + on the command line. This should return the installation path to + use below (e.g. "/usr" or "/usr/local"). Otherwise, simply use + "/usr" (or what you think is adequate for your installation). + + + + III. Ensure that you are using GNU Make + --------------------------------------- + + The FreeType build system _exclusively_ works with GNU Make. You + will not be able to compile the library with the instructions + below using any other alternative (including BSD Make). + + Trying to compile the library with a different Make tool will + print a message like: + + Sorry, GNU make is required to build FreeType2. + + and the build process will be aborted. If this happens, install + GNU Make on your system, and use the GNUMAKE environment variable + to name it. + + + + IV. Build and install the library + --------------------------------- + + The following should work on all Unix systems where the `make' + command invokes GNU Make: + + ./configure --prefix= + make + make install (as root) + + where "" must be replaced by the prefix returned by + the "freetype-config" command. + + When using a different command to invoke GNU Make, use the GNUMAKE + variable. For example, if `gmake' is the command to use on your + system, do something like: + + GNUMAKE=gmake ./configure --prefix= + gmake + gmake install (as root) + + If this still doesn't work, read the detailed compilation + procedure available in the file "docs/BUILD" for troubleshooting. + + + V. Take care of XFree86 version 4 + --------------------------------- + + Certain recent Linux distributions will install _several_ versions + of FreeType on your system. For example, on a fresh Mandrake 8.1 + system, you can find the following files: + + /usr/lib/libfreetype.so which links to + /usr/lib/libfreetype.6.1.0.so + + and + + /usr/X11R6/lib/libfreetype.so which links to + /usr/X11R6/lib/libfreetype.6.0.so + + Note that these files correspond to two distinct versions of the + library! It seems that this surprising issue is due to the + install scripts of recent XFree86 servers (from 4.1.0) which + irremediably install their own (dated) version of the library in + "/usr/X11R6/lib". + + In certain _rare_ cases you may experience minor problems if you + install this release of the library in "/usr" only, namely, that + certain applications will not benefit from the bug fixes and + rendering improvements you'd expect. + + There are two good ways to deal with this situation: + + - Install the library _twice_, in "/usr" and in "/usr/X11R6" + (you have to do that each time you install a new FreeType + release though). + + - Change the link in /usr/X11R6/lib/libfreetype.so to point to + + /usr/lib/libfreetype.so, + + and get rid of + + /usr/X11R6/lib/libfreetype.6.0.so + + The FreeType Team is not responsible for this problem, so please + contact either the XFree86 development team or your Linux + distributor to help clear this issue in case the information given + here doesn't help. Index: xc/extras/freetype2/docs/VERSION.DLL diff -u /dev/null xc/extras/freetype2/docs/VERSION.DLL:1.1.1.1 --- /dev/null Sat Feb 28 21:40:13 2004 +++ xc/extras/freetype2/docs/VERSION.DLL Wed May 28 22:01:44 2003 @@ -0,0 +1,90 @@ +Due to our use of "libtool" to generate and install the FreeType 2 libraries +on Unix systems, as well as other historical events, it is generally very +difficult to know precisely which release of the font engine is installed +on a given system. + +This file tries to explain why and to document ways to properly detect +FreeType on Unix. + + +I. Version & Release numbers: + +For each new public release of FreeType 2, there are generally *three* +distinct "version" numbers to consider: + + * the official FT2 release number, like 2.0.9, or 2.1.3 + + * the libtool (and Unix) specific version number, like "9.2.3". This + is what "freetype-config --version" will return + + * the platform-specific shared object number, used for example when + the library is installed as "/usr/lib/libfreetype.so.6.3.2" + + +the platform-specific number is, unsurprisingly, platform-specific and varies +with the operating system you're using (several variants of Linux, FreeBSD, +Solaris, etc...). You should thus _never_ use it, even for simple tests. + +the libtool-specific number does not equal the release number but is tied +to it. + +the release number is available at *compile* time through the following +macros defined in FT_FREETYPE_H: + + - FREETYPE_MAJOR : major release number + - FREETYPE_MINOR : minor release number + - FREETYPE_PATCH : patch release number + +see below for some Autoconf fragment to + + +the release number is also available at *runtime* through the +"FT_Library_Version" API. Unfortunately, this one wasn't available or +working correctly before the 2.1.3 official release !! + + +II. Table: + +the following is a simple table that gives, for each official release, +the corresponding libtool number, as well as the shared object number +found on _most_ systems, but not all of them: + + release libtool so +------------------------------------- + 2.1.4 9.3.3 6.3.3 + 2.1.3 9.2.3 6.3.2 + 2.1.2 9.1.3 6.3.1 + 2.1.1 9.0.3 ? + 2.1.0 8.0.2 ? + 2.0.9 9.0.3 ? + 2.0.8 8.0.2 ? + +the libtool numbers are a bit inconsistent due to the library's history: + + - 2.1.0 was created as a development branch from 2.0.8 + (hence the same libtool numbers) + + - 2.0.9 was a bug-fix release of the "stable" branch, we + apparently incorrectly increased its libtool number + + - 2.1.4 is still in the "development" branch, however it's stable enough + to be the basis of an upcoming 2.2.0 release + + + +III. AutoConf Code Fragment: + +Lars Clausen contributed the following Autoconf fragment to detect at +which version of FreeType is installed on your system. This one tests +for a version that is at least 2.0.9, you should change the last line to +check against other release numbers. + + AC_MSG_CHECKING([for version of FreeType]) + FREETYPE_INCLUDE=`freetype-config --cflags | cut -c3-` + FREETYPE_MAJOR=`grep '^#define FREETYPE_MAJOR' $FREETYPE_INCLUDE/freetype/freetype.h | cut -d' ' -f3` + FREETYPE_MINOR=`grep '^#define FREETYPE_MINOR' $FREETYPE_INCLUDE/freetype/freetype.h | cut -d' ' -f3` + FREETYPE_PATCH=`grep '^#define FREETYPE_PATCH' $FREETYPE_INCLUDE/freetype/freetype.h | cut -d' ' -f3` + FREETYPE_VERSION=`echo | awk "BEGIN { printf \"%d\", ($FREETYPE_MAJOR * 1000 + $FREETYPE_MINOR) * 1000 + $FREETYPE_PATCH;}"` + AC_MSG_RESULT([$FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH]) + if test "$FREETYPE_VERSION" -ge 2000009; then + Index: xc/extras/freetype2/docs/license.txt diff -u xc/extras/freetype2/docs/license.txt:1.1.1.2 xc/extras/freetype2/docs/license.txt:1.1.1.3 --- xc/extras/freetype2/docs/license.txt:1.1.1.2 Mon Jan 14 11:52:02 2002 +++ xc/extras/freetype2/docs/license.txt Wed May 28 22:01:44 2003 @@ -1,11 +1,28 @@ -FreeType comes with two licenses from which you can choose the one which -fits your needs best: + The FreeType 2 font engine is copyrighted work, and cannot be + used legally without a software license. In order to make this + project usable to a vast majority of developers, we distribute it + under two dual licenses. - . The FreeType License, in file `docs/FTL.txt'. + What this means is that *you* must choose *one* license among those + described below, then obey all its terms and conditions when using + FreeType 2 in any of your projects or products: - . The GNU General Public License, in file `docs/GPL.txt'. -The contributed PCF driver comes with a license similar to that of X Window -System which is compatible to the above two licenses (see file -src/pcf/readme). + - The FreeType License, found in the file "FTL.TXT", which is + an BSD-style open-source license *with* an advertising + clause that forces you to explicitely cite the + FreeType project in your product's documentation. All + details are in the license file + + + - The GNU General Public License, found in "GPL.TXT", which is + the traditionnal and "viral" GPL license, that + forces you to redistribute the _complete_ sources of all + your products that simply use FreeType 2. + + + Note that the contributed PCF driver comes with a license similar to + that of X Window System which is compatible to the above two + licenses (see file src/pcf/readme). + Index: xc/extras/freetype2/docs/readme.vms diff -u xc/extras/freetype2/docs/readme.vms:1.1.1.1 xc/extras/freetype2/docs/readme.vms:removed --- xc/extras/freetype2/docs/readme.vms:1.1.1.1 Sun Sep 9 22:55:42 2001 +++ xc/extras/freetype2/docs/readme.vms Sat Feb 28 21:40:13 2004 @@ -1,35 +0,0 @@ -How to build the freetype2 library on VMS ------------------------------------------ - -Just type one of the following depending on the type of external entries you -want: - - mms - -or - - mms/macro=("COMP_FLAGS=/name=(as_is,short)") - -The library is avalaible in the directory - - [.LIB] - -To compile applications using freetype2 you'll need to define the logical -FREETYPE pointing to the directory - - [.INCLUDE.FREETYPE] - -(i.e., if the directory in which this README.VMS file is located is -$disk:[freetype] then define the logical with - - define freetype $disk:[freetype.include.freetype] - -This version has been tested with Compaq C V6.2-006 on OpenVMS Alpha V7.2-1. - - - Any problems can be reported to - - joukj@hrem.stm.tudelft.nl - - - Jouk Jansen Index: xc/extras/freetype2/include/freetype/freetype.h diff -u xc/extras/freetype2/include/freetype/freetype.h:1.1.1.8 xc/extras/freetype2/include/freetype/freetype.h:1.1.1.9 --- xc/extras/freetype2/include/freetype/freetype.h:1.1.1.8 Thu Jun 20 04:16:06 2002 +++ xc/extras/freetype2/include/freetype/freetype.h Wed May 28 22:01:44 2003 @@ -35,7 +35,7 @@ /* */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 1 -#define FREETYPE_PATCH 0 +#define FREETYPE_PATCH 4 #include @@ -241,11 +241,12 @@ /* completely independent from the others; it is the `root' of a set */ /* of objects like fonts, faces, sizes, etc. */ /* */ - /* It also embeds a system object (see FT_System), as well as a */ - /* scan-line converter object (see FT_Raster). */ + /* It also embeds a memory manager (see @FT_Memory), as well as a */ + /* scan-line converter object (see @FT_Raster). */ /* */ /* */ - /* Library objects are created through FT_Init_FreeType(). */ + /* Library objects are normally created by @FT_Init_FreeType, and */ + /* destroyed with @FT_Done_FreeType. */ /* */ typedef struct FT_LibraryRec_ *FT_Library; @@ -270,11 +271,7 @@ /* */ /* */ /* A handle to a given FreeType font driver object. Each font driver */ - /* is able to create faces, sizes, glyph slots, and charmaps from the */ - /* resources whose format it supports. */ - /* */ - /* A driver can support either bitmap, graymap, or scalable font */ - /* formats. */ + /* is a special module capable of creating faces from font files. */ /* */ typedef struct FT_DriverRec_* FT_Driver; @@ -285,10 +282,10 @@ /* FT_Renderer */ /* */ /* */ - /* A handle to a given FreeType renderer. A renderer is in charge of */ - /* converting a glyph image to a bitmap, when necessary. Each */ - /* supports a given glyph image format, and one or more target */ - /* surface depths. */ + /* A handle to a given FreeType renderer. A renderer is a special */ + /* module in charge of converting a glyph image to a bitmap, when */ + /* necessary. Each renderer supports a given glyph image format, and */ + /* one or more target surface depths. */ /* */ typedef struct FT_RendererRec_* FT_Renderer; @@ -299,12 +296,21 @@ /* FT_Face */ /* */ /* */ - /* A handle to a given driver face object. A face object contains */ - /* all the instance and glyph independent data of a font file */ - /* typeface. */ + /* A handle to a given typographic face object. A face object models */ + /* a given typeface, in a given style. */ + /* */ + /* */ + /* Each face object also owns a single @FT_GlyphSlot object, as well */ + /* as one or more @FT_Size objects. */ /* */ - /* A face object is created from a resource object through the */ - /* new_face() method of a given driver. */ + /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */ + /* a given filepathname or a custom input stream. */ + /* */ + /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ + /* */ + /* */ + /* The @FT_FaceRec details the publicly accessible fields of a given */ + /* face object. */ /* */ typedef struct FT_FaceRec_* FT_Face; @@ -315,12 +321,21 @@ /* FT_Size */ /* */ /* */ - /* A handle to a given driver size object. Such an object models the */ - /* _resolution_ AND _size_ dependent state of a given driver face */ - /* size. */ + /* A handle to a given size object. Such an object models the data */ + /* that depends on the current _resolution_ and _character size_ in a */ + /* given @FT_Face. */ /* */ - /* A size object is always created from a given face object. It is */ - /* discarded automatically by its parent face. */ + /* */ + /* Each face object owns one or more sizes. There is however a */ + /* single _active_ size for the face at any time that will be used by */ + /* functions like @FT_Load_Glyph, @FT_Get_Kerning, etc. */ + /* */ + /* You can use the @FT_Activate_Size API to change the current */ + /* active size of any given face. */ + /* */ + /* */ + /* The @FT_SizeRec structure details the publicly accessible fields */ + /* of a given face object. */ /* */ typedef struct FT_SizeRec_* FT_Size; @@ -332,11 +347,16 @@ /* */ /* */ /* A handle to a given `glyph slot'. A slot is a container where it */ - /* is possible to load any of the glyphs contained within its parent */ + /* is possible to load any one of the glyphs contained in its parent */ /* face. */ /* */ - /* A glyph slot is created from a given face object. It is discarded */ - /* automatically by its parent face. */ + /* In other words, each time you call @FT_Load_Glyph or */ + /* @FT_Load_Char, the slot's content is erased by the new glyph data, */ + /* i.e. the glyph's metrics, its image (bitmap or outline), and */ + /* other control information. */ + /* */ + /* */ + /* @FT_GlyphSlotRec details the publicly accessible glyph fields. */ /* */ typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; @@ -352,8 +372,19 @@ /* parent's face. Some font formats may provide several charmaps per */ /* font. */ /* */ - /* A charmap is created from a given face object. It is discarded */ - /* automatically by its parent face. */ + /* Each face object owns zero or more charmaps, but only one of them */ + /* can be "active" and used by @FT_Get_Char_Index or @FT_Load_Char. */ + /* */ + /* The list of available charmaps in a face is available through the */ + /* "face->num_charmaps" and "face->charmaps" fields of @FT_FaceRec. */ + /* */ + /* The currently active charmap is available as "face->charmap". */ + /* You should call @FT_Set_Charmap to change it. */ + /* */ + /* */ + /* When a new face is created (either through @FT_New_Face or */ + /* @FT_Open_Face), the library looks for a Unicode charmap within */ + /* the list and automatically activates it. */ /* */ typedef struct FT_CharMapRec_* FT_CharMap; @@ -364,14 +395,26 @@ /* FT_ENC_TAG */ /* */ /* */ - /* This macro converts four letter tags into an unsigned long. */ + /* This macro converts four letter tags into an unsigned long. It is */ + /* used to define "encoding" identifiers (see @FT_Encoding). */ + /* */ + /* */ + /* Since many 16bit compilers don't like 32bit enumerations, you */ + /* should redefine this macro in case of problems to something like */ + /* this: */ + /* */ + /* #define FT_ENC_TAG( value, a, b, c, d ) (value) */ /* */ + /* to get a simple enumeration without assigning special numbers. */ + /* */ + #ifndef FT_ENC_TAG -#define FT_ENC_TAG( value, _x1, _x2, _x3, _x4 ) \ - value = ( ( (unsigned long)_x1 << 24 ) | \ - ( (unsigned long)_x2 << 16 ) | \ - ( (unsigned long)_x3 << 8 ) | \ - (unsigned long)_x4 ) +#define FT_ENC_TAG( value, a, b, c, d ) \ + value = ( ( (FT_UInt32)(a) << 24 ) | \ + ( (FT_UInt32)(b) << 16 ) | \ + ( (FT_UInt32)(c) << 8 ) | \ + (FT_UInt32)(d) ) + #endif /* FT_ENC_TAG */ @@ -382,50 +425,174 @@ /* */ /* */ /* An enumeration used to specify encodings supported by charmaps. */ - /* Used in the FT_Select_Charmap() API function. */ + /* Used in the @FT_Select_Charmap API function. */ /* */ /* */ /* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */ /* all character codes must be expressed as FT_Longs. */ /* */ + /* The values of this type correspond to specific character */ + /* repertories (i.e. charsets), and not to text encoding methods */ + /* (like UTF-8, UTF-16, GB2312_EUC, etc.). */ + /* */ /* Other encodings might be defined in the future. */ /* */ + /* */ + /* FT_ENCODING_NONE :: */ + /* The encoding value 0 is reserved. */ + /* */ + /* FT_ENCODING_UNICODE :: */ + /* Corresponds to the Unicode character set. This value covers */ + /* all versions of the Unicode repertoire, including ASCII and */ + /* Latin-1. Most fonts include a Unicode charmap, but not all */ + /* of them. */ + /* */ + /* FT_ENCODING_MS_SYMBOL :: */ + /* Corresponds to the Microsoft Symbol encoding, used to encode */ + /* mathematical symbols in the 32..255 character code range. For */ + /* more information, see `http://www.ceviz.net/symbol.htm'. */ + /* */ + /* FT_ENCODING_MS_SJIS :: */ + /* Corresponds to Microsoft's Japanese SJIS encoding. More info */ + /* at `http://langsupport.japanreference.com/encoding.shtml'. */ + /* See note on multi-byte encodings below. */ + /* */ + /* FT_ENCODING_MS_GB2312 :: */ + /* Corresponds to the encoding system for Simplified Chinese, as */ + /* used in China. Only found in some TrueType fonts. */ + /* */ + /* FT_ENCODING_MS_BIG5 :: */ + /* Corresponds to the encoding system for Traditional Chinese, as */ + /* used in Taiwan and Hong Kong. Only found in some TrueType fonts. */ + /* */ + /* FT_ENCODING_MS_WANSUNG :: */ + /* Corresponds to the Korean encoding system known as Wansung. */ + /* This is a Microsoft encoding that is only found in some TrueType */ + /* fonts. For more information, see */ + /* `http://www.microsoft.com/typography/unicode/949.txt'. */ + /* */ + /* FT_ENCODING_MS_JOHAB :: */ + /* The Korean standard character set (KS C-5601-1992), which */ + /* corresponds to Windows code page 1361. This character set */ + /* includes all possible Hangeul character combinations. */ + /* Only found on some rare TrueType fonts. */ + /* */ + /* FT_ENCODING_ADOBE_LATIN_1 :: */ + /* Corresponds to a Latin-1 encoding as defined in a Type 1 */ + /* Postscript font. It is limited to 256 character codes. */ + /* */ + /* FT_ENCODING_ADOBE_STANDARD :: */ + /* Corresponds to the Adobe Standard encoding, as found in Type 1, */ + /* CFF, and OpenType/CFF fonts. It is limited to 256character */ + /* codes. */ + /* */ + /* FT_ENCODING_ADOBE_EXPERT :: */ + /* Corresponds to the Adobe Expert encoding, as found in Type 1, */ + /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ + /* codes. */ + /* */ + /* FT_ENCODING_ADOBE_CUSTOM :: */ + /* Corresponds to a custom encoding, as found in Type 1, CFF, and */ + /* OpenType/CFF fonts. It is limited to 256 character codes. */ + /* */ + /* FT_ENCODING_APPLE_ROMAN :: */ + /* Corresponds to the 8-bit Apple roman encoding. Many TrueType and */ + /* OpenType fonts contain a charmap for this encoding, since older */ + /* versions of Mac OS are able to use it. */ + /* */ + /* FT_ENCODING_OLD_LATIN_2 :: */ + /* This value is deprecated and was never used nor reported by */ + /* FreeType. Don't use or test for it. */ + /* */ + /* */ + /* By default, FreeType automatically synthetizes a Unicode charmap */ + /* for Postscript fonts, using their glyph names dictionaries. */ + /* However, it will also report the encodings defined explicitly in */ + /* the font file, for the cases when they are needed, with the Adobe */ + /* values as well. */ + /* */ typedef enum FT_Encoding_ { - FT_ENC_TAG( ft_encoding_none, 0, 0, 0, 0 ), + FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ), - FT_ENC_TAG( ft_encoding_symbol, 's', 'y', 'm', 'b' ), - FT_ENC_TAG( ft_encoding_unicode, 'u', 'n', 'i', 'c' ), - FT_ENC_TAG( ft_encoding_latin_1, 'l', 'a', 't', '1' ), - FT_ENC_TAG( ft_encoding_latin_2, 'l', 'a', 't', '2' ), - FT_ENC_TAG( ft_encoding_sjis, 's', 'j', 'i', 's' ), - FT_ENC_TAG( ft_encoding_gb2312, 'g', 'b', ' ', ' ' ), - FT_ENC_TAG( ft_encoding_big5, 'b', 'i', 'g', '5' ), - FT_ENC_TAG( ft_encoding_wansung, 'w', 'a', 'n', 's' ), - FT_ENC_TAG( ft_encoding_johab, 'j', 'o', 'h', 'a' ), - - FT_ENC_TAG( ft_encoding_adobe_standard, 'A', 'D', 'O', 'B' ), - FT_ENC_TAG( ft_encoding_adobe_expert, 'A', 'D', 'B', 'E' ), - FT_ENC_TAG( ft_encoding_adobe_custom, 'A', 'D', 'B', 'C' ), + FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ), + FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ), - FT_ENC_TAG( ft_encoding_apple_roman, 'a', 'r', 'm', 'n' ) + FT_ENC_TAG( FT_ENCODING_MS_SJIS, 's', 'j', 'i', 's' ), + FT_ENC_TAG( FT_ENCODING_MS_GB2312, 'g', 'b', ' ', ' ' ), + FT_ENC_TAG( FT_ENCODING_MS_BIG5, 'b', 'i', 'g', '5' ), + FT_ENC_TAG( FT_ENCODING_MS_WANSUNG, 'w', 'a', 'n', 's' ), + FT_ENC_TAG( FT_ENCODING_MS_JOHAB, 'j', 'o', 'h', 'a' ), + + FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ), + FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ), + FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ), + FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ), + + FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ), + + FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' ) } FT_Encoding; /*************************************************************************/ /* */ + /* */ + /* ft_encoding_xxx */ + /* */ + /* */ + /* These constants are deprecated; use the corresponding @FT_Encoding */ + /* values instead. */ + /* */ + /* */ + /* ft_encoding_none :: see @FT_ENCODING_NONE */ + /* ft_encoding_unicode :: see @FT_ENCODING_UNICODE */ + /* ft_encoding_latin_2 :: see @FT_ENCODING_OLD_LATIN_2 */ + /* ft_encoding_symbol :: see @FT_ENCODING_MS_SYMBOL */ + /* ft_encoding_sjis :: see @FT_ENCODING_MS_SJIS */ + /* ft_encoding_gb2312 :: see @FT_ENCODING_MS_GB2312 */ + /* ft_encoding_big5 :: see @FT_ENCODING_MS_BIG5 */ + /* ft_encoding_wansung :: see @FT_ENCODING_MS_WANSUNG */ + /* ft_encoding_johab :: see @FT_ENCODING_MS_JOHAB */ + /* */ + /* ft_encoding_adobe_standard :: see @FT_ENCODING_ADOBE_STANDARD */ + /* ft_encoding_adobe_expert :: see @FT_ENCODING_ADOBE_EXPERT */ + /* ft_encoding_adobe_custom :: see @FT_ENCODING_ADOBE_CUSTOM */ + /* ft_encoding_latin_1 :: see @FT_ENCODING_ADOBE_LATIN_1 */ + /* */ + /* ft_encoding_apple_roman :: see @FT_ENCODING_APPLE_ROMAN */ + /* */ +#define ft_encoding_none FT_ENCODING_NONE +#define ft_encoding_unicode FT_ENCODING_UNICODE +#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL +#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1 +#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2 +#define ft_encoding_sjis FT_ENCODING_MS_SJIS +#define ft_encoding_gb2312 FT_ENCODING_MS_GB2312 +#define ft_encoding_big5 FT_ENCODING_MS_BIG5 +#define ft_encoding_wansung FT_ENCODING_MS_WANSUNG +#define ft_encoding_johab FT_ENCODING_MS_JOHAB + +#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD +#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT +#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM +#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN + + + /*************************************************************************/ + /* */ /* */ /* FT_CharMapRec */ /* */ /* */ - /* The base charmap class. */ + /* The base charmap structure. */ /* */ /* */ /* face :: A handle to the parent face object. */ /* */ - /* encoding :: A tag which identifies the charmap. Use this with */ - /* FT_Select_Charmap(). */ + /* encoding :: An @FT_Encoding tag identifying the charmap. Use */ + /* this with @FT_Select_Charmap. */ /* */ /* platform_id :: An ID number describing the platform for the */ /* following encoding ID. This comes directly from */ @@ -436,10 +603,6 @@ /* comes from the TrueType specification and should be */ /* emulated similarly. */ /* */ - /* */ - /* We STRONGLY recommmend emulating a Unicode charmap for drivers */ - /* that do not support TrueType or OpenType. */ - /* */ typedef struct FT_CharMapRec_ { FT_Face face; @@ -466,9 +629,9 @@ /* */ /* */ /* An opaque handle to an FT_Face_InternalRec structure, used to */ - /* model private data of a given FT_Face object. */ + /* model private data of a given @FT_Face object. */ /* */ - /* This field might change between releases of FreeType 2 and are */ + /* This structure might change between releases of FreeType 2 and is */ /* not generally available to client applications. */ /* */ typedef struct FT_Face_InternalRec_* FT_Face_Internal; @@ -476,8 +639,6 @@ /*************************************************************************/ /* */ - /* FreeType base face class */ - /* */ /* */ /* FT_FaceRec */ /* */ @@ -487,11 +648,11 @@ /* */ /* */ /* num_faces :: In the case where the face is located in a */ - /* collection (i.e., a resource which embeds */ + /* collection (i.e., a file which embeds */ /* several faces), this is the total number of */ /* faces found in the resource. 1 by default. */ /* */ - /* face_index :: The index of the face in its resource. */ + /* face_index :: The index of the face in its font file. */ /* Usually, this is 0 for all normal font */ /* formats. It can be more in the case of */ /* collections (which embed several fonts in a */ @@ -499,11 +660,12 @@ /* */ /* face_flags :: A set of bit flags that give important */ /* information about the face; see the */ - /* FT_FACE_FLAG_XXX macros for details. */ + /* @FT_FACE_FLAG_XXX constants for details. */ /* */ /* style_flags :: A set of bit flags indicating the style of */ /* the face (i.e., italic, bold, underline, */ - /* etc). */ + /* etc). See the @FT_STYLE_FLAG_XXX */ + /* constants. */ /* */ /* num_glyphs :: The total number of glyphs in the face. */ /* */ @@ -530,15 +692,14 @@ /* */ /* num_fixed_sizes :: The number of fixed sizes available in this */ /* face. This should be set to 0 for scalable */ - /* fonts, unless its resource includes a */ - /* complete set of glyphs (called a `strike') */ - /* for the specified size. */ + /* fonts, unless its face includes a complete */ + /* set of glyphs (called a `strike') for the */ + /* specified sizes. */ /* */ /* available_sizes :: An array of sizes specifying the available */ /* bitmap/graymap sizes that are contained in */ - /* in the font resource. Should be set to */ - /* NULL if the field `num_fixed_sizes' is set */ - /* to 0. */ + /* in the font face. Should be set to NULL if */ + /* the field `num_fixed_sizes' is set to 0. */ /* */ /* num_charmaps :: The total number of character maps in the */ /* face. */ @@ -546,12 +707,12 @@ /* charmaps :: A table of pointers to the face's charmaps. */ /* Used to scan the list of available charmaps */ /* -- this table might change after a call to */ - /* FT_Attach_File/Stream (e.g. when used to */ - /* hook an additional encoding/CMap to the */ - /* face object). */ + /* @FT_Attach_File or @FT_Attach_Stream (e.g. */ + /* if used to hook an additional encoding or */ + /* CMap to the face object). */ /* */ /* generic :: A field reserved for client uses. See the */ - /* FT_Generic type description. */ + /* @FT_Generic type description. */ /* */ /* bbox :: The font bounding box. Coordinates are */ /* expressed in font units (see units_per_EM). */ @@ -582,9 +743,9 @@ /* descender :: The face's descender is the vertical */ /* distance from the baseline to the */ /* bottommost point of any glyph in the face. */ - /* This field's value is positive, expressed */ + /* This field's value is *negative*, expressed */ /* in font units. Some font designs use a */ - /* value different from `-bbox.yMin'. Only */ + /* value different from `bbox.yMin'. Only */ /* relevant for scalable formats. */ /* */ /* height :: The face's height is the vertical distance */ @@ -619,15 +780,6 @@ /* underline for this face. Only relevant for */ /* scalable formats. */ /* */ - /* driver :: A handle to the face's parent driver */ - /* object. */ - /* */ - /* memory :: A handle to the face's parent memory */ - /* object. Used for the allocation of */ - /* subsequent objects. */ - /* */ - /* stream :: A handle to the face's stream. */ - /* */ /* glyph :: The face's associated glyph slot(s). This */ /* object is created automatically with a new */ /* face object. However, certain kinds of */ @@ -635,12 +787,9 @@ /* can need more than one slot to ease their */ /* task. */ /* */ - /* sizes_list :: The list of child sizes for this face. */ + /* size :: The current active size for this face. */ /* */ - /* internal :: A pointer to internal fields of the face */ - /* object. These fields can change freely */ - /* between releases of FreeType and are not */ - /* publicly available. */ + /* charmap :: The current active charmap for this face. */ /* */ typedef struct FT_FaceRec_ { @@ -701,164 +850,92 @@ /*************************************************************************/ /* */ - /* */ - /* FT_FACE_FLAG_SCALABLE */ - /* */ - /* */ - /* A bit-field constant, used to indicate that a given face provides */ - /* vectorial outlines (i.e., TrueType or Type1). This doesn't */ - /* prevent embedding of bitmap strikes though, i.e., a given face can */ - /* have both this bit set, and a `num_fixed_sizes' property > 0. */ - /* */ -#define FT_FACE_FLAG_SCALABLE 1 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_FIXED_SIZES */ - /* */ - /* */ - /* A bit-field constant, used to indicate that a given face contains */ - /* `fixed sizes', i.e., bitmap strikes for some given pixel sizes. */ - /* See the `num_fixed_sizes' and `available_sizes' face properties */ - /* for more information. */ - /* */ -#define FT_FACE_FLAG_FIXED_SIZES 2 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_FIXED_WIDTH */ - /* */ - /* */ - /* A bit-field constant, used to indicate that a given face contains */ - /* fixed-width characters (like Courier, Lucida, MonoType, etc.). */ - /* */ -#define FT_FACE_FLAG_FIXED_WIDTH 4 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_SFNT */ - /* */ - /* */ - /* A bit-field constant, used to indicate that a given face uses the */ - /* `sfnt' storage fomat. For now, this means TrueType or OpenType. */ - /* */ -#define FT_FACE_FLAG_SFNT 8 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_HORIZONTAL */ - /* */ - /* */ - /* A bit-field constant, used to indicate that a given face contains */ - /* horizontal glyph metrics. This should be set for all common */ - /* formats, but who knows. */ - /* */ -#define FT_FACE_FLAG_HORIZONTAL 0x10 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_VERTICAL */ - /* */ - /* */ - /* A bit-field constant, used to indicate that a given face contains */ - /* vertical glyph metrics. If not set, the glyph loader will */ - /* synthetize vertical metrics itself to help display vertical text */ - /* correctly. */ - /* */ -#define FT_FACE_FLAG_VERTICAL 0x20 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_KERNING */ - /* */ - /* */ - /* A bit-field constant, used to indicate that a given face contains */ - /* kerning information. When set, this information can be retrieved */ - /* through the function FT_Get_Kerning(). Note that when unset, this */ - /* function will always return the kerning vector (0,0). */ - /* */ -#define FT_FACE_FLAG_KERNING 0x40 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_FAST_GLYPHS */ - /* */ - /* */ - /* A bit-field constant, used to indicate that the glyphs in a given */ - /* font can be retrieved very quickly, and that a glyph cache is thus */ - /* not necessary for any of its child size objects. */ - /* */ - /* This flag should really be set for fixed-size formats like FNT, */ - /* where each glyph bitmap is available directly in binary form */ - /* without any kind of compression. */ - /* */ -#define FT_FACE_FLAG_FAST_GLYPHS 0x80 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_MULTIPLE_MASTERS */ - /* */ - /* */ - /* A bit-field constant, used to indicate that the font contains */ - /* multiple masters and is capable of interpolating between them. */ - /* */ -#define FT_FACE_FLAG_MULTIPLE_MASTERS 0x100 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_GLYPH_NAMES */ - /* */ - /* */ - /* A bit-field constant, used to indicate that the font contains */ - /* glyph names that can be retrieved through FT_Get_Glyph_Name(). */ - /* */ -#define FT_FACE_FLAG_GLYPH_NAMES 0x200 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_FACE_FLAG_EXTERNAL_STREAM */ + /* */ + /* FT_FACE_FLAG_XXX */ /* */ /* */ - /* This bit field is used internally by FreeType to indicate that */ - /* a face's stream was provided by the client application and should */ - /* not be destroyed by FT_Done_Face(). */ - /* */ -#define FT_FACE_FLAG_EXTERNAL_STREAM 0x4000 - + /* A list of bit flags used in the 'face_flags' field of the */ + /* @FT_FaceRec structure. They inform client applications of */ + /* properties of the corresponding face. */ + /* */ + /* */ + /* FT_FACE_FLAG_SCALABLE :: */ + /* Indicates that the face provides vectorial outlines. This */ + /* doesn't prevent embedded bitmaps, i.e., a face can have both */ + /* this bit and @FT_FACE_FLAG_FIXED_SIZES set */ + /* */ + /* FT_FACE_FLAG_FIXED_SIZES :: */ + /* Indicates that the face contains `fixed sizes', i.e., bitmap */ + /* strikes for some given pixel sizes. See the `num_fixed_sizes' */ + /* and `available_sizes' fields of @FT_FaceRec. */ + /* */ + /* FT_FACE_FLAG_FIXED_WIDTH :: */ + /* Indicates that the face contains fixed-width characters (like */ + /* Courier, Lucido, MonoType, etc.). */ + /* */ + /* FT_FACE_FLAG_SFNT :: */ + /* Indicates that the face uses the `sfnt' storage scheme. For */ + /* now, this means TrueType and OpenType. */ + /* */ + /* FT_FACE_FLAG_HORIZONTAL :: */ + /* Indicates that the face contains horizontal glyph metrics. This */ + /* should be set for all common formats. */ + /* */ + /* FT_FACE_FLAG_VERTICAL :: */ + /* Indicates that the face contains vertical glyph metrics. This */ + /* is only available in some formats, not all of them. */ + /* */ + /* FT_FACE_FLAG_KERNING :: */ + /* Indicates that the face contains kerning information. If set, */ + /* the kerning distance can be retrieved through the function */ + /* @FT_Get_Kerning. Note that if unset, this function will always */ + /* return the vector (0,0). */ + /* */ + /* FT_FACE_FLAG_FAST_GLYPHS :: */ + /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */ + /* */ + /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */ + /* Indicates that the font contains multiple masters and is capable */ + /* of interpolating between them. See the multiple-masters */ + /* specific API for details. */ + /* */ + /* FT_FACE_FLAG_GLYPH_NAMES :: */ + /* Indicates that the font contains glyph names that can be */ + /* retrieved through @FT_Get_Glyph_Names. Note that some TrueType */ + /* fonts contain broken glyph name tables. Use the function */ + /* @FT_Has_PS_Glyph_Name when needed. */ + /* */ + /* FT_FACE_FLAG_EXTERNAL_STREAM :: */ + /* Used internally by FreeType to indicate that a face's stream was */ + /* provided by the client application and should not be destroyed */ + /* when @FT_Done_Face is called. Don't read or test this flag. */ + /* */ +#define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) +#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) +#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) +#define FT_FACE_FLAG_SFNT ( 1L << 3 ) +#define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 ) +#define FT_FACE_FLAG_VERTICAL ( 1L << 5 ) +#define FT_FACE_FLAG_KERNING ( 1L << 6 ) +#define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 ) +#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 ) +#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 ) +#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 ) /* */ /*************************************************************************/ /* */ - /* @macro: FT_HAS_HORIZONTAL (face) */ + /* @macro: */ + /* FT_HAS_HORIZONTAL( face ) */ /* */ /* @description: */ - /* A macro that returns true whenever a face object contains */ - /* horizontal metrics (this is true for all font formats though). */ + /* A macro that returns true whenever a face object contains */ + /* horizontal metrics (this is true for all font formats though). */ /* */ /* @also: */ - /* @FT_HAS_VERTICAL can be used to check for vertical metrics. */ + /* @FT_HAS_VERTICAL can be used to check for vertical metrics. */ /* */ #define FT_HAS_HORIZONTAL( face ) \ ( face->face_flags & FT_FACE_FLAG_HORIZONTAL ) @@ -866,11 +943,12 @@ /*************************************************************************/ /* */ - /* @macro: FT_HAS_VERTICAL (face) */ + /* @macro: */ + /* FT_HAS_VERTICAL( face ) */ /* */ /* @description: */ - /* A macro that returns true whenever a face object contains vertical */ - /* metrics. */ + /* A macro that returns true whenever a face object contains vertical */ + /* metrics. */ /* */ #define FT_HAS_VERTICAL( face ) \ ( face->face_flags & FT_FACE_FLAG_VERTICAL ) @@ -878,11 +956,12 @@ /*************************************************************************/ /* */ - /* @macro: FT_HAS_KERNING (face) */ + /* @macro: */ + /* FT_HAS_KERNING( face ) */ /* */ /* @description: */ - /* A macro that returns true whenever a face object contains kerning */ - /* data that can be accessed with @FT_Get_Kerning. */ + /* A macro that returns true whenever a face object contains kerning */ + /* data that can be accessed with @FT_Get_Kerning. */ /* */ #define FT_HAS_KERNING( face ) \ ( face->face_flags & FT_FACE_FLAG_KERNING ) @@ -890,12 +969,13 @@ /*************************************************************************/ /* */ - /* @macro: FT_IS_SCALABLE (face) */ + /* @macro: */ + /* FT_IS_SCALABLE( face ) */ /* */ /* @description: */ - /* A macro that returns true whenever a face object contains a */ - /* scalable font face (true for TrueType, Type 1, CID, and */ - /* OpenType/CFF font formats. */ + /* A macro that returns true whenever a face object contains a */ + /* scalable font face (true for TrueType, Type 1, CID, and */ + /* OpenType/CFF font formats. */ /* */ #define FT_IS_SCALABLE( face ) \ ( face->face_flags & FT_FACE_FLAG_SCALABLE ) @@ -903,16 +983,17 @@ /*************************************************************************/ /* */ - /* @macro: FT_IS_SFNT (face) */ + /* @macro: */ + /* FT_IS_SFNT( face ) */ /* */ /* @description: */ - /* A macro that returns true whenever a face object contains a font */ - /* whose format is based on the SFNT storage scheme. This usually */ - /* means: TrueType fonts, OpenType fonts, as well as SFNT-based */ - /* embedded bitmap fonts. */ + /* A macro that returns true whenever a face object contains a font */ + /* whose format is based on the SFNT storage scheme. This usually */ + /* means: TrueType fonts, OpenType fonts, as well as SFNT-based */ + /* embedded bitmap fonts. */ /* */ - /* If this macro is true, all functions defined in @FT_SFNT_NAMES_H */ - /* and @FT_TRUETYPE_TABLES_H are available. */ + /* If this macro is true, all functions defined in @FT_SFNT_NAMES_H */ + /* and @FT_TRUETYPE_TABLES_H are available. */ /* */ #define FT_IS_SFNT( face ) \ ( face->face_flags & FT_FACE_FLAG_SFNT ) @@ -920,12 +1001,13 @@ /*************************************************************************/ /* */ - /* @macro: FT_IS_FIXED_WIDTH (face) */ + /* @macro: */ + /* FT_IS_FIXED_WIDTH( face ) */ /* */ /* @description: */ - /* A macro that returns true whenever a face object contains a font */ - /* face that contains fixed-width (or "monospace", "fixed-pitch", */ - /* etc.) glyphs. */ + /* A macro that returns true whenever a face object contains a font */ + /* face that contains fixed-width (or "monospace", "fixed-pitch", */ + /* etc.) glyphs. */ /* */ #define FT_IS_FIXED_WIDTH( face ) \ ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) @@ -933,12 +1015,13 @@ /*************************************************************************/ /* */ - /* @macro: FT_IS_FIXED_SIZES (face) */ + /* @macro: */ + /* FT_IS_FIXED_SIZES( face ) */ /* */ /* @description: */ - /* A macro that returns true whenever a face object contains some */ - /* embedded bitmaps. See the `fixed_sizes' field of the @FT_FaceRec */ - /* structure. */ + /* A macro that returns true whenever a face object contains some */ + /* embedded bitmaps. See the `fixed_sizes' field of the @FT_FaceRec */ + /* structure. */ /* */ #define FT_HAS_FIXED_SIZES( face ) \ ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) @@ -949,10 +1032,12 @@ /*************************************************************************/ /* */ - /* @macro: FT_HAS_FAST_GLYPHS (face) */ + /* @macro: */ + /* FT_HAS_FAST_GLYPHS( face ) */ /* */ /* @description: */ - /* XXX */ + /* Deprecated; indicates that the face contains so-called "fast" */ + /* glyph bitmaps. */ /* */ #define FT_HAS_FAST_GLYPHS( face ) \ ( face->face_flags & FT_FACE_FLAG_FAST_GLYPHS ) @@ -960,11 +1045,12 @@ /*************************************************************************/ /* */ - /* @macro: FT_HAS_GLYPH_NAMES (face) */ + /* @macro: */ + /* FT_HAS_GLYPH_NAMES( face ) */ /* */ /* @description: */ - /* A macro that returns true whenever a face object contains some */ - /* glyph names that can be accessed through @FT_Get_Glyph_Names. */ + /* A macro that returns true whenever a face object contains some */ + /* glyph names that can be accessed through @FT_Get_Glyph_Names. */ /* */ #define FT_HAS_GLYPH_NAMES( face ) \ ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) @@ -972,13 +1058,14 @@ /*************************************************************************/ /* */ - /* @macro: FT_HAS_MULTIPLE_MASTERS (face) */ + /* @macro: */ + /* FT_HAS_MULTIPLE_MASTERS( face ) */ /* */ /* @description: */ - /* A macro that returns true whenever a face object contains some */ - /* multiple masters. The functions provided by */ - /* @FT_MULTIPLE_MASTERS_H are then available to choose the exact */ - /* design you want. */ + /* A macro that returns true whenever a face object contains some */ + /* multiple masters. The functions provided by */ + /* @FT_MULTIPLE_MASTERS_H are then available to choose the exact */ + /* design you want. */ /* */ #define FT_HAS_MULTIPLE_MASTERS( face ) \ ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) @@ -987,25 +1074,21 @@ /*************************************************************************/ /* */ /* */ - /* FT_STYLE_FLAG_ITALIC */ + /* FT_STYLE_FLAG_XXX */ /* */ /* */ - /* A bit-field constant, used to indicate that a given face is */ - /* italicized. */ - /* */ -#define FT_STYLE_FLAG_ITALIC 1 - - - /*************************************************************************/ + /* A list of bit-flags used to indicate the style of a given face. */ + /* These are used in the `style_flags' field of @FT_FaceRec. */ /* */ - /* */ - /* FT_STYLE_FLAG_BOLD */ + /* */ + /* FT_STYLE_FLAG_ITALIC :: */ + /* Indicates that a given face is italicized. */ /* */ - /* */ - /* A bit-field constant, used to indicate that a given face is */ - /* emboldened. */ + /* FT_STYLE_FLAG_BOLD :: */ + /* Indicates that a given face is bold. */ /* */ -#define FT_STYLE_FLAG_BOLD 2 +#define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) +#define FT_STYLE_FLAG_BOLD ( 1 << 1 ) /*************************************************************************/ @@ -1022,8 +1105,6 @@ /*************************************************************************/ /* */ - /* FreeType base size metrics */ - /* */ /* */ /* FT_Size_Metrics */ /* */ @@ -1052,7 +1133,7 @@ /* pixels. Always positive. */ /* */ /* descender :: The descender, expressed in 26.6 fixed point */ - /* pixels. Always positive. */ + /* pixels. Always negative. */ /* */ /* height :: The text height, expressed in 26.6 fixed point */ /* pixels. Always positive. */ @@ -1092,8 +1173,6 @@ /*************************************************************************/ /* */ - /* FreeType base size class */ - /* */ /* */ /* FT_SizeRec */ /* */ @@ -1151,8 +1230,6 @@ /*************************************************************************/ /* */ - /* FreeType Glyph Slot base class */ - /* */ /* */ /* FT_GlyphSlotRec */ /* */ @@ -1180,7 +1257,7 @@ /* */ /* metrics :: The metrics of the last loaded glyph in the */ /* slot. The returned values depend on the last */ - /* load flags (see the FT_Load_Glyph() API */ + /* load flags (see the @FT_Load_Glyph API */ /* function) and can be expressed either in 26.6 */ /* fractional pixels or font units. */ /* */ @@ -1209,22 +1286,22 @@ /* */ /* format :: This field indicates the format of the image */ /* contained in the glyph slot. Typically */ - /* ft_glyph_format_bitmap, */ - /* ft_glyph_format_outline, and */ - /* ft_glyph_format_composite, but others are */ + /* FT_GLYPH_FORMAT_BITMAP, */ + /* FT_GLYPH_FORMAT_OUTLINE, and */ + /* FT_GLYPH_FORMAT_COMPOSITE, but others are */ /* possible. */ /* */ /* bitmap :: This field is used as a bitmap descriptor */ /* when the slot format is */ - /* ft_glyph_format_bitmap. Note that the */ + /* FT_GLYPH_FORMAT_BITMAP. Note that the */ /* address and content of the bitmap buffer can */ - /* change between calls of FT_Load_Glyph() and a */ + /* change between calls of @FT_Load_Glyph and a */ /* few other functions. */ /* */ /* bitmap_left :: This is the bitmap's left bearing expressed */ /* in integer pixels. Of course, this is only */ /* valid if the format is */ - /* ft_glyph_format_bitmap. */ + /* FT_GLYPH_FORMAT_BITMAP. */ /* */ /* bitmap_top :: This is the bitmap's top bearing expressed in */ /* integer pixels. Remember that this is the */ @@ -1259,13 +1336,13 @@ /* image format. */ /* */ /* */ - /* If @FT_Load_Glyph() is called with default flags (see */ - /* @FT_LOAD_DEFAULT ) the glyph image is loaded in the glyph slot in */ + /* If @FT_Load_Glyph is called with default flags (see */ + /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */ /* its native format (e.g. a vectorial outline for TrueType and */ /* Type 1 formats). */ /* */ /* This image can later be converted into a bitmap by calling */ - /* FT_Render_Glyph(). This function finds the current renderer for */ + /* @FT_Render_Glyph. This function finds the current renderer for */ /* the native image's format then invokes it. */ /* */ /* The renderer is in charge of transforming the native image through */ @@ -1275,7 +1352,7 @@ /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */ /* to specify the position of the bitmap relative to the current pen */ /* position (e.g. coordinates [0,0] on the baseline). Of course, */ - /* `slot->format' is also changed to `ft_glyph_format_bitmap' . */ + /* `slot->format' is also changed to `FT_GLYPH_FORMAT_BITMAP' . */ /* */ typedef struct FT_GlyphSlotRec_ { @@ -1326,7 +1403,7 @@ /* FT_Init_FreeType */ /* */ /* */ - /* Initializes a new FreeType library object. The set of drivers */ + /* Initializes a new FreeType library object. The set of modules */ /* that are registered by this function is determined at build time. */ /* */ /* */ @@ -1365,8 +1442,8 @@ /* certain programs implement library initialization in a custom way */ /* that doesn't use `FT_Init_FreeType'. */ /* */ - /* In such cases it can happen that the library version is not known */ - /* until the library object has been created. */ + /* In such cases, the library version might not be available before */ + /* the library object has been created. */ /* */ FT_EXPORT( void ) FT_Library_Version( FT_Library library, @@ -1404,30 +1481,47 @@ /* `flags' field of the @FT_Open_Args structure. */ /* */ /* */ - /* ft_open_memory :: This is a memory-based stream. */ + /* FT_OPEN_MEMORY :: This is a memory-based stream. */ + /* */ + /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ + /* */ + /* FT_OPEN_PATHNAME :: Create a new input stream from a C */ + /* path name. */ + /* */ + /* FT_OPEN_DRIVER :: Use the `driver' field. */ /* */ - /* ft_open_stream :: Copy the stream from the `stream' field. */ + /* FT_OPEN_PARAMS :: Use the `num_params' & `params' field. */ /* */ - /* ft_open_pathname :: Create a new input stream from a C pathname. */ + /* ft_open_memory :: deprecated. use @FT_OPEN_MEMORY instead */ /* */ - /* ft_open_driver :: Use the `driver' field. */ + /* ft_open_stream :: deprecated. use @FT_OPEN_STREAM instead */ /* */ - /* ft_open_params :: Use the `num_params' & `params' field. */ + /* ft_open_pathname :: deprecated. use @FT_OPEN_PATHNAME instead */ + /* */ + /* ft_open_driver :: deprecated, use @FT_OPEN_DRIVER instead */ + /* */ + /* ft_open_params :: deprecated, use @FT_OPEN_PARAMS instead */ /* */ /* */ - /* The `ft_open_memory', `ft_open_stream', and `ft_open_pathname' */ + /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ /* flags are mutually exclusive. */ /* */ typedef enum { - ft_open_memory = 1, - ft_open_stream = 2, - ft_open_pathname = 4, - ft_open_driver = 8, - ft_open_params = 16 + FT_OPEN_MEMORY = 1, + FT_OPEN_STREAM = 2, + FT_OPEN_PATHNAME = 4, + FT_OPEN_DRIVER = 8, + FT_OPEN_PARAMS = 16 } FT_Open_Flags; +#define ft_open_memory FT_OPEN_MEMORY /* deprecated */ +#define ft_open_stream FT_OPEN_STREAM /* deprecated */ +#define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */ +#define ft_open_driver FT_OPEN_DRIVER /* deprecated */ +#define ft_open_params FT_OPEN_PARAMS /* deprecated */ + /*************************************************************************/ /* */ @@ -1436,7 +1530,7 @@ /* */ /* */ /* A simple structure used to pass more or less generic parameters */ - /* to FT_Open_Face(). */ + /* to @FT_Open_Face. */ /* */ /* */ /* tag :: A 4-byte identification tag. */ @@ -1462,7 +1556,7 @@ /* */ /* A structure used to indicate how to open a new font file/stream. */ /* A pointer to such a structure can be used as a parameter for the */ - /* functions @FT_Open_Face() & @FT_Attach_Stream(). */ + /* functions @FT_Open_Face and @FT_Attach_Stream. */ /* */ /* */ /* flags :: A set of bit flags indicating how to use the */ @@ -1476,7 +1570,7 @@ /* */ /* stream :: A handle to a source stream object. */ /* */ - /* driver :: This field is exclusively used by FT_Open_Face(); */ + /* driver :: This field is exclusively used by @FT_Open_Face; */ /* it simply specifies the font driver to use to open */ /* the face. If set to 0, FreeType will try to load */ /* the face with each one of the drivers in its list. */ @@ -1490,32 +1584,32 @@ /* The stream type is determined by the contents of `flags' which */ /* are tested in the following order by @FT_Open_Face: */ /* */ - /* If the `ft_open_memory' bit is set, assume that this is a */ + /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */ /* memory file of `memory_size' bytes,located at `memory_address'. */ /* */ - /* Otherwise, if the `ft_open_stream' bit is set, assume that a */ + /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */ /* custom input stream `stream' is used. */ /* */ - /* Otherwise, if the `ft_open_pathname' bit is set, assume that this */ + /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */ /* is a normal file and use `pathname' to open it. */ /* */ - /* If the `ft_open_driver' bit is set, @FT_Open_Face() will only */ - /* try to open the file with the driver whose handler is in `driver'. */ + /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face will only try to */ + /* open the file with the driver whose handler is in `driver'. */ /* */ - /* If the `ft_open_params' bit is set, the parameters given by */ + /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */ /* `num_params' and `params' will be used. They are ignored */ /* otherwise. */ /* */ typedef struct FT_Open_Args_ { - FT_Open_Flags flags; - const FT_Byte* memory_base; - FT_Long memory_size; - FT_String* pathname; - FT_Stream stream; - FT_Module driver; - FT_Int num_params; - FT_Parameter* params; + FT_Open_Flags flags; + const FT_Byte* memory_base; + FT_Long memory_size; + FT_String* pathname; + FT_Stream stream; + FT_Module driver; + FT_Int num_params; + FT_Parameter* params; } FT_Open_Args; @@ -1548,11 +1642,14 @@ /* slot for the face object which can be accessed directly through */ /* `face->glyph'. */ /* */ - /* FT_New_Face() can be used to determine and/or check the font */ - /* format of a given font resource. If the `face_index' field is */ - /* negative, the function will _not_ return any face handle in */ - /* `aface'. Its return value should be 0 if the font format is */ - /* recognized, or non-zero otherwise. */ + /* @FT_New_Face can be used to determine and/or check the font format */ + /* of a given font resource. If the `face_index' field is negative, */ + /* the function will _not_ return any face handle in `aface'. Its */ + /* return value should be 0 if the font format is recognized, or */ + /* non-zero otherwise. */ + /* */ + /* Each new face object created with this function also owns a */ + /* default @FT_Size object, accessible as `face->size'. */ /* */ FT_EXPORT( FT_Error ) FT_New_Face( FT_Library library, @@ -1596,9 +1693,9 @@ /* slot for the face object which can be accessed directly through */ /* `face->glyph'. */ /* */ - /* FT_New_Memory_Face() can be used to determine and/or check the */ - /* font format of a given font resource. If the `face_index' field */ - /* is negative, the function will _not_ return any face handle in */ + /* @FT_New_Memory_Face can be used to determine and/or check the font */ + /* format of a given font resource. If the `face_index' field is */ + /* negative, the function will _not_ return any face handle in */ /* `aface'. Its return value should be 0 if the font format is */ /* recognized, or non-zero otherwise. */ /* */ @@ -1640,17 +1737,17 @@ /* slot for the face object which can be accessed directly through */ /* `face->glyph'. */ /* */ - /* FT_Open_Face() can be used to determine and/or check the font */ + /* @FT_Open_Face can be used to determine and/or check the font */ /* format of a given font resource. If the `face_index' field is */ /* negative, the function will _not_ return any face handle in */ /* `*face'. Its return value should be 0 if the font format is */ /* recognized, or non-zero otherwise. */ /* */ FT_EXPORT( FT_Error ) - FT_Open_Face( FT_Library library, - FT_Open_Args* args, - FT_Long face_index, - FT_Face *aface ); + FT_Open_Face( FT_Library library, + const FT_Open_Args* args, + FT_Long face_index, + FT_Face *aface ); /*************************************************************************/ @@ -1675,7 +1772,7 @@ /* */ /* */ /* If your font file is in memory, or if you want to provide your */ - /* own input stream object, use FT_Attach_Stream(). */ + /* own input stream object, use @FT_Attach_Stream. */ /* */ /* The meaning of the `attach' action (i.e., what really happens when */ /* the new file is read) is not fixed by FreeType itself. It really */ @@ -1696,7 +1793,7 @@ /* FT_Attach_Stream */ /* */ /* */ - /* This function is similar to FT_Attach_File() with the exception */ + /* This function is similar to @FT_Attach_File with the exception */ /* that it reads the attachment from an arbitrary stream. */ /* */ /* */ @@ -1773,7 +1870,7 @@ /* */ /* */ /* When dealing with fixed-size faces (i.e., non-scalable formats), */ - /* use the function FT_Set_Pixel_Sizes(). */ + /* use the function @FT_Set_Pixel_Sizes. */ /* */ FT_EXPORT( FT_Error ) FT_Set_Char_Size( FT_Face face, @@ -1845,7 +1942,7 @@ /* glyph_index :: The index of the glyph in the font file. */ /* */ /* load_flags :: A flag indicating what to load for this glyph. The */ - /* FT_LOAD_XXX constants can be used to control the */ + /* @FT_LOAD_XXX constants can be used to control the */ /* glyph loading process (e.g., whether the outline */ /* should be scaled, whether to load bitmaps or not, */ /* whether to hint the outline, etc). */ @@ -1857,15 +1954,15 @@ /* If the glyph image is not a bitmap, and if the bit flag */ /* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */ /* transformed with the information passed to a previous call to */ - /* FT_Set_Transform(). */ + /* @FT_Set_Transform. */ /* */ /* Note that this also transforms the `face.glyph.advance' field, but */ /* *not* the values in `face.glyph.metrics'. */ /* */ FT_EXPORT( FT_Error ) - FT_Load_Glyph( FT_Face face, - FT_UInt glyph_index, - FT_Int load_flags ); + FT_Load_Glyph( FT_Face face, + FT_UInt glyph_index, + FT_Int32 load_flags ); /*************************************************************************/ @@ -1886,7 +1983,7 @@ /* current charmap used in the face. */ /* */ /* load_flags :: A flag indicating what to load for this glyph. The */ - /* FT_LOAD_XXX constants can be used to control the */ + /* @FT_LOAD_XXX constants can be used to control the */ /* glyph loading process (e.g., whether the outline */ /* should be scaled, whether to load bitmaps or not, */ /* whether to hint the outline, etc). */ @@ -1902,7 +1999,7 @@ /* If the glyph image is not a bitmap, and if the bit flag */ /* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */ /* transformed with the information passed to a previous call to */ - /* FT_Set_Transform(). */ + /* @FT_Set_Transform. */ /* */ /* Note that this also transforms the `face.glyph.advance' field, but */ /* *not* the values in `face.glyph.metrics'. */ @@ -1910,218 +2007,160 @@ FT_EXPORT( FT_Error ) FT_Load_Char( FT_Face face, FT_ULong char_code, - FT_Int load_flags ); + FT_Int32 load_flags ); - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_NO_SCALE */ - /* */ - /* */ - /* A bit field constant, used with FT_Load_Glyph() to indicate that */ - /* the vector outline being loaded should not be scaled to 26.6 */ - /* fractional pixels, but kept in notional units. */ - /* */ -#define FT_LOAD_NO_SCALE 1 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_NO_HINTING */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the vector outline being loaded should not be fitted to the pixel */ - /* grid but simply scaled to 26.6 fractional pixels. */ - /* */ - /* This flag is ignored if FT_LOAD_NO_SCALE is set. */ - /* */ -#define FT_LOAD_NO_HINTING 2 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_RENDER */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the function should load the glyph and immediately convert it into */ - /* a bitmap, if necessary, by calling FT_Render_Glyph(). */ - /* */ - /* Note that by default, FT_Load_Glyph() loads the glyph image in its */ - /* native format. */ - /* */ -#define FT_LOAD_RENDER 4 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_NO_BITMAP */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the function should not load the bitmap or pixmap of a given */ - /* glyph. This is useful when you do not want to load the embedded */ - /* bitmaps of scalable formats, as the native glyph image will be */ - /* loaded, and can then be rendered through FT_Render_Glyph(). */ - /* */ -#define FT_LOAD_NO_BITMAP 8 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_VERTICAL_LAYOUT */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the glyph image should be prepared for vertical layout. This */ - /* basically means that `face.glyph.advance' will correspond to the */ - /* vertical advance height (instead of the default horizontal */ - /* advance width), and that the glyph image will translated to match */ - /* the vertical bearings positions. */ - /* */ -#define FT_LOAD_VERTICAL_LAYOUT 16 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_FORCE_AUTOHINT */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the function should try to auto-hint the glyphs, even if a driver */ - /* specific hinter is available. */ - /* */ -#define FT_LOAD_FORCE_AUTOHINT 32 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_CROP_BITMAP */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the font driver should try to crop the bitmap (i.e. remove all */ - /* space around its black bits) when loading it. For now, this */ - /* really only works with embedded bitmaps in TrueType fonts. */ - /* */ -#define FT_LOAD_CROP_BITMAP 64 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_PEDANTIC */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the glyph loader should perform a pedantic bytecode */ - /* interpretation. Many popular fonts come with broken glyph */ - /* programs. When this flag is set, loading them will return an */ - /* error. Otherwise, errors are ignored by the loader, sometimes */ - /* resulting in ugly glyphs. */ - /* */ -#define FT_LOAD_PEDANTIC 128 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the glyph loader should ignore the global advance width defined */ - /* in the font. As far as we know, this is only used by the */ - /* X-TrueType font server, in order to deal correctly with the */ - /* incorrect metrics contained in DynaLab's TrueType CJK fonts. */ - /* */ -#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 512 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_NO_RECURSE */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the glyph loader should not load composite glyph recursively. */ - /* Rather, when a composite glyph is encountered, it should set */ - /* the values of `num_subglyphs' and `subglyphs', as well as set */ - /* `face->glyph.format' to ft_glyph_format_composite. */ - /* */ - /* This is for use by the auto-hinter and possibly other tools. */ - /* For nearly all applications, this flags should be left unset */ - /* when invoking FT_Load_Glyph(). */ - /* */ - /* Note that the flag forces the load of unscaled glyphs. */ - /* */ -#define FT_LOAD_NO_RECURSE 1024 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_IGNORE_TRANSFORM */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the glyph loader should not try to transform the loaded glyph */ - /* image. */ - /* */ -#define FT_LOAD_IGNORE_TRANSFORM 2048 - - - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_MONOCHROME */ - /* */ - /* */ - /* Only used with FT_LOAD_RENDER set, it indicates that the returned */ - /* glyph image should be 1-bit monochrome. This really tells the */ - /* glyph loader to use `ft_render_mode_mono' when calling */ - /* FT_Render_Glyph(). */ - /* */ -#define FT_LOAD_MONOCHROME 4096 + /**************************************************************************** + * + * @enum: + * FT_LOAD_XXX + * + * @description: + * A list of bit-field constants, used with @FT_Load_Glyph to indicate + * what kind of operations to perform during glyph loading. + * + * @values: + * FT_LOAD_DEFAULT :: + * Corresponding to 0, this value is used a default glyph load. In this + * case, the following will happen: + * + * 1. FreeType looks for a bitmap for the glyph corresponding to the + * face's current size. If one is found, the function returns. The + * bitmap data can be accessed from the glyph slot (see note below). + * + * 2. If no embedded bitmap is searched or found, FreeType looks for a + * scalable outline. If one is found, it is loaded from the font + * file, scaled to device pixels, then "hinted" to the pixel grid in + * order to optimize it. The outline data can be accessed from the + * glyph slot (see note below). + * + * Note that by default, the glyph loader doesn't render outlines into + * bitmaps. The following flags are used to modify this default + * behaviour to more specific and useful cases. + * + * FT_LOAD_NO_SCALE :: + * Don't scale the vector outline being loaded to 26.6 fractional + * pixels, but kept in font units. Note that this also disables + * hinting and the loading of embedded bitmaps. You should only use it + * when you want to retrieve the original glyph outlines in font units. + * + * FT_LOAD_NO_HINTING :: + * Don't hint glyph outlines after their scaling to device pixels. + * This generally generates "blurrier" glyphs in anti-aliased modes. + * + * This flag is ignored if @FT_LOAD_NO_SCALE is set. + * + * FT_LOAD_RENDER :: + * Render the glyph outline immediately into a bitmap before the glyph + * loader returns. By default, the glyph is rendered for the + * @FT_RENDER_MODE_NORMAL mode, which corresponds to 8-bit anti-aliased + * bitmaps using 256 opacity levels. You can use either + * @FT_LOAD_TARGET_MONO or @FT_LOAD_MONOCHROME to render 1-bit + * monochrome bitmaps. + * + * This flag is ignored if @FT_LOAD_NO_SCALE is set. + * + * FT_LOAD_NO_BITMAP :: + * Don't look for bitmaps when loading the glyph. Only scalable + * outlines will be loaded when available, and scaled, hinted, or + * rendered depending on other bit flags. + * + * This does not prevent you from rendering outlines to bitmaps + * with @FT_LOAD_RENDER, however. + * + * FT_LOAD_VERTICAL_LAYOUT :: + * Prepare the glyph image for vertical text layout. This basically + * means that `face.glyph.advance' will correspond to the vertical + * advance height (instead of the default horizontal advance width), + * and that the glyph image will be translated to match the vertical + * bearings positions. + * + * FT_LOAD_FORCE_AUTOHINT :: + * Force the use of the FreeType auto-hinter when a glyph outline is + * loaded. You shouldn't need this in a typical application, since it + * is mostly used to experiment with its algorithm. + * + * FT_LOAD_CROP_BITMAP :: + * Indicates that the glyph loader should try to crop the bitmap (i.e., + * remove all space around its black bits) when loading it. This is + * only useful when loading embedded bitmaps in certain fonts, since + * bitmaps rendered with @FT_LOAD_RENDER are always cropped by default. + * + * FT_LOAD_PEDANTIC :: + * Indicates that the glyph loader should perform pedantic + * verifications during glyph loading, rejecting invalid fonts. This + * is mostly used to detect broken glyphs in fonts. By default, + * FreeType tries to handle broken fonts also. + * + * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH :: + * Indicates that the glyph loader should ignore the global advance + * width defined in the font. As far as we know, this is only used by + * the X-TrueType font server, in order to deal correctly with the + * incorrect metrics contained in DynaLab's TrueType CJK fonts. + * + * FT_LOAD_NO_RECURSE :: + * This flag is only used internally. It merely indicates that the + * glyph loader should not load composite glyphs recursively. Instead, + * it should set the `num_subglyph' and `subglyphs' values of the glyph + * slot accordingly, and set "glyph->format" to + * @FT_GLYPH_FORMAT_COMPOSITE. + * + * The description of sub-glyphs is not available to client + * applications for now. + * + * FT_LOAD_IGNORE_TRANSFORM :: + * Indicates that the glyph loader should not try to transform the + * loaded glyph image. This doesn't prevent scaling, hinting, or + * rendering. + * + * FT_LOAD_MONOCHROME :: + * This flag is used with @FT_LOAD_RENDER to indicate that you want + * to render a 1-bit monochrome glyph bitmap from a vectorial outline. + * + * Note that this has no effect on the hinting algorithm used by the + * glyph loader. You should better use @FT_LOAD_TARGET_MONO if you + * want to render monochrome-optimized glyph images instead. + * + * FT_LOAD_LINEAR_DESIGN :: + * Return the linearly scaled metrics expressed in original font units + * instead of the default 16.16 pixel values. + * + * FT_LOAD_NO_AUTOHINT :: + * Indicates that the auto-hinter should never be used to hint glyph + * outlines. This doesn't prevent native format-specific hinters from + * being used. This can be important for certain fonts where unhinted + * output is better than auto-hinted one. + */ +#define FT_LOAD_NO_SCALE 0x1 +#define FT_LOAD_NO_HINTING 0x2 +#define FT_LOAD_RENDER 0x4 +#define FT_LOAD_NO_BITMAP 0x8 +#define FT_LOAD_VERTICAL_LAYOUT 0x10 +#define FT_LOAD_FORCE_AUTOHINT 0x20 +#define FT_LOAD_CROP_BITMAP 0x40 +#define FT_LOAD_PEDANTIC 0x80 +#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 0x200 +#define FT_LOAD_NO_RECURSE 0x400 +#define FT_LOAD_IGNORE_TRANSFORM 0x800 +#define FT_LOAD_MONOCHROME 0x1000 +#define FT_LOAD_LINEAR_DESIGN 0x2000 + /* temporary hack! */ +#define FT_LOAD_SBITS_ONLY 0x4000 +#define FT_LOAD_NO_AUTOHINT 0x8000U - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_LINEAR_DESIGN */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the function should return the linearly scaled metrics expressed */ - /* in original font units, instead of the default 16.16 pixel values. */ - /* */ -#define FT_LOAD_LINEAR_DESIGN 8192 + /* */ - /* temporary hack! */ -#define FT_LOAD_SBITS_ONLY 16384 +#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) +#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) ) +#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) +#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) +#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) +#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) +#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) - /*************************************************************************/ - /* */ - /* */ - /* FT_LOAD_DEFAULT */ - /* */ - /* */ - /* A bit-field constant, used with FT_Load_Glyph() to indicate that */ - /* the function should try to load the glyph normally, i.e., */ - /* embedded bitmaps are favored over outlines, vectors are always */ - /* scaled and grid-fitted. */ - /* */ -#define FT_LOAD_DEFAULT 0 +#define FT_LOAD_DEFAULT 0x0 /*************************************************************************/ @@ -2132,7 +2171,7 @@ /* */ /* A function used to set the transformation that is applied to glyph */ /* images just before they are converted to bitmaps in a glyph slot */ - /* when FT_Render_Glyph() is called. */ + /* when @FT_Render_Glyph is called. */ /* */ /* */ /* face :: A handle to the source face object. */ @@ -2147,7 +2186,7 @@ /* The transformation is only applied to scalable image formats after */ /* the glyph has been loaded. It means that hinting is unaltered by */ /* the transformation and is performed on the character size given in */ - /* the last call to FT_Set_Char_Sizes() or FT_Set_Pixel_Sizes(). */ + /* the last call to @FT_Set_Char_Sizes or @FT_Set_Pixel_Sizes. */ /* */ FT_EXPORT( void ) FT_Set_Transform( FT_Face face, @@ -2161,37 +2200,78 @@ /* FT_Render_Mode */ /* */ /* */ - /* An enumeration type that lists the render modes supported by the */ - /* FreeType 2 renderer(s). A renderer is in charge of converting a */ - /* glyph image into a bitmap. */ - /* */ - /* */ - /* ft_render_mode_normal :: This is the default render mode; it */ - /* corresponds to 8-bit anti-aliased */ - /* bitmaps, using 256 levels of gray. */ - /* */ - /* ft_render_mode_mono :: This render mode is used to produce 1-bit */ - /* monochrome bitmaps. */ - /* */ - /* */ - /* There is no render mode to produce 8-bit `monochrome' bitmaps -- */ - /* you have to make the conversion yourself if you need such things */ - /* (besides, FreeType is not a graphics library). */ - /* */ - /* More modes might appear later for specific display modes (e.g. TV, */ - /* LCDs, etc.). They will be supported through the simple addition */ - /* of a renderer module, with no changes to the rest of the engine. */ + /* An enumeration type that lists the render modes supported by */ + /* FreeType 2. Each mode corresponds to a specific type of scanline */ + /* conversion performed on the outline, as well as specific */ + /* hinting optimizations. */ + /* */ + /* */ + /* FT_RENDER_MODE_NORMAL :: */ + /* This is the default render mode; it corresponds to 8-bit */ + /* anti-aliased bitmaps, using 256 levels of opacity. */ + /* */ + /* FT_RENDER_MODE_LIGHT :: */ + /* This is similar to @FT_RENDER_MODE_NORMAL, except that this */ + /* changes the hinting to prevent stem width quantization. This */ + /* results in glyph shapes that are more similar to the original, */ + /* while being a bit more fuzzy ("better shapes", instead of */ + /* "better contrast" if you want :-) THIS IS STILL EXPERIMENTAL, */ + /* FOR NOW, THIS WILL PRODUCE RESULTS SIMILAR TO NORMAL MODE !! */ + /* */ + /* FT_RENDER_MODE_MONO :: */ + /* This mode corresponds to 1-bit bitmaps. */ + /* */ + /* FT_RENDER_MODE_LCD :: */ + /* This mode corresponds to horizontal RGB/BGR sub-pixel displays, */ + /* like LCD-screens. It produces 8-bit bitmaps that are 3 times */ + /* the width of the original glyph outline in pixels, and which use */ + /* the @FT_PIXEL_MODE_LCD mode. THIS IS STILL EXPERIMENTAL, DO NOT */ + /* USE FOR NOW !! */ + /* */ + /* FT_RENDER_MODE_LCD_V :: */ + /* This mode corresponds to vertical RGB/BGR sub-pixel displays */ + /* (like PDA screens, rotated LCD displays, etc.). It produces */ + /* 8-bit bitmaps that are 3 times the height of the original */ + /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ + /* */ + /* */ + /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph are */ + /* _not filtered_ to reduce color-fringes. It is up to the caller to */ + /* perform this pass. THIS IS STILL EXPERIMENTAL, DO NOT USE FOR NOW */ + /* !! */ /* */ typedef enum FT_Render_Mode_ { - ft_render_mode_normal = 0, - ft_render_mode_mono = 1 + FT_RENDER_MODE_NORMAL = 0, + FT_RENDER_MODE_LIGHT, + FT_RENDER_MODE_MONO, + FT_RENDER_MODE_LCD, + FT_RENDER_MODE_LCD_V, + + FT_RENDER_MODE_MAX } FT_Render_Mode; /*************************************************************************/ /* */ + /* */ + /* ft_render_mode_xxx */ + /* */ + /* */ + /* These constats are deprecated. Use the corresponding */ + /* @FT_Render_Mode values instead. */ + /* */ + /* */ + /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ + /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ + /* */ +#define ft_render_mode_normal FT_RENDER_MODE_NORMAL +#define ft_render_mode_mono FT_RENDER_MODE_MONO + + + /*************************************************************************/ + /* */ /* */ /* FT_Render_Glyph */ /* */ @@ -2213,8 +2293,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_EXPORT( FT_Error ) - FT_Render_Glyph( FT_GlyphSlot slot, - FT_UInt render_mode ); + FT_Render_Glyph( FT_GlyphSlot slot, + FT_Render_Mode render_mode ); /*************************************************************************/ @@ -2224,29 +2304,65 @@ /* */ /* */ /* An enumeration used to specify which kerning values to return in */ - /* FT_Get_Kerning(). */ + /* @FT_Get_Kerning. */ /* */ - /* */ - /* ft_kerning_default :: Return scaled and grid-fitted kerning */ + /* */ + /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */ /* distances (value is 0). */ /* */ - /* ft_kerning_unfitted :: Return scaled but un-grid-fitted kerning */ + /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */ /* distances. */ /* */ - /* ft_kerning_unscaled :: Return the kerning vector in original font */ + /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */ /* units. */ /* */ typedef enum FT_Kerning_Mode_ { - ft_kerning_default = 0, - ft_kerning_unfitted, - ft_kerning_unscaled + FT_KERNING_DEFAULT = 0, + FT_KERNING_UNFITTED, + FT_KERNING_UNSCALED } FT_Kerning_Mode; /*************************************************************************/ /* */ + /* */ + /* ft_kerning_default */ + /* */ + /* */ + /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */ + /* instead. */ + /* */ +#define ft_kerning_default FT_KERNING_DEFAULT + + + /*************************************************************************/ + /* */ + /* */ + /* ft_kerning_unfitted */ + /* */ + /* */ + /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */ + /* instead. */ + /* */ +#define ft_kerning_unfitted FT_KERNING_UNFITTED + + + /*************************************************************************/ + /* */ + /* */ + /* ft_kerning_unscaled */ + /* */ + /* */ + /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */ + /* instead. */ + /* */ +#define ft_kerning_unscaled FT_KERNING_UNSCALED + + + /*************************************************************************/ + /* */ /* */ /* FT_Get_Kerning */ /* */ @@ -2260,7 +2376,7 @@ /* */ /* right_glyph :: The index of the right glyph in the kern pair. */ /* */ - /* kern_mode :: See FT_Kerning_Mode() for more information. */ + /* kern_mode :: See @FT_Kerning_Mode for more information. */ /* Determines the scale/dimension of the returned */ /* kerning vector. */ /* */ @@ -2424,6 +2540,12 @@ /* */ /* The glyph index. 0 means `undefined character code'. */ /* */ + /* */ + /* FreeType computes its own glyph indices which are not necessarily */ + /* the same as used in the font in case the font is based on glyph */ + /* indices. Reason for this behaviour is to assure that index 0 is */ + /* never used, representing the missing glyph. */ + /* */ FT_EXPORT( FT_UInt ) FT_Get_Char_Index( FT_Face face, FT_ULong charcode ); @@ -2648,7 +2770,7 @@ /* */ /* The optimization for FT_DivFix() is simple: If (a << 16) fits in */ /* 32 bits, then the division is computed directly. Otherwise, we */ - /* use a specialized version of the old FT_MulDiv64(). */ + /* use a specialized version of the old @FT_MulDiv64. */ /* */ FT_EXPORT( FT_Long ) FT_DivFix( FT_Long a, @@ -2735,6 +2857,7 @@ /* */ + FT_END_HEADER #endif /* __FREETYPE_H__ */ Index: xc/extras/freetype2/include/freetype/ftbdf.h diff -u xc/extras/freetype2/include/freetype/ftbdf.h:1.1.1.1 xc/extras/freetype2/include/freetype/ftbdf.h:1.1.1.2 --- xc/extras/freetype2/include/freetype/ftbdf.h:1.1.1.1 Thu Jun 20 04:16:06 2002 +++ xc/extras/freetype2/include/freetype/ftbdf.h Wed May 28 22:01:44 2003 @@ -45,6 +45,73 @@ /********************************************************************** * + * @enum: + * FT_PropertyType + * + * @description: + * list of BDF property types + * + * @values: + * BDF_PROPERTY_TYPE_NONE :: + * value 0 is used to indicate a missing property + * + * BDF_PROPERTY_TYPE_ATOM :: + * property is a string atom + * + * BDF_PROPERTY_TYPE_INTEGER :: + * property is a 32-bit signed integer + * + * BDF_PROPERTY_TYPE_CARDINAL :: + * property is a 32-bit unsigned integer + */ + typedef enum + { + BDF_PROPERTY_TYPE_NONE = 0, + BDF_PROPERTY_TYPE_ATOM = 1, + BDF_PROPERTY_TYPE_INTEGER = 2, + BDF_PROPERTY_TYPE_CARDINAL = 3 + + } BDF_PropertyType; + + + /********************************************************************** + * + * @type: BDF_Property + * + * @description: + * handle to a @BDF_PropertyRec structure used to model a given + * BDF/PCF property + */ + typedef struct BDF_PropertyRec_* BDF_Property; + + /********************************************************************** + * + * @struct: BDF_PropertyRec + * + * @description: + * models a given BDF/PCF property + * + * @note: + * type :: property type + * u.atom :: atom string, when type is @BDF_PROPERTY_TYPE_ATOM + * u.integer :: signed integer, when type is @BDF_PROPERTY_TYPE_INTEGER + * u.cardinal :: unsigned integer, when type is @BDF_PROPERTY_TYPE_CARDINAL + */ + typedef struct BDF_PropertyRec_ + { + BDF_PropertyType type; + union { + const char* atom; + FT_Int32 integer; + FT_UInt32 cardinal; + + } u; + + } BDF_PropertyRec; + + + /********************************************************************** + * * @function: * FT_Get_BDF_Charset_ID * @@ -74,6 +141,37 @@ const char* *acharset_encoding, const char* *acharset_registry ); + /********************************************************************** + * + * @function: + * FT_Get_BDF_Property + * + * @description: + * Retrieves a BDF property from a BDF or PCF font file + * + * @input: + * face :: handle to input face + * name :: property name + * + * @output: + * aproperty :: the property + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This function works with BDF _and_ PCF fonts. It returns an error + * otherwise. it also returns an error when the property is not in the + * font. + * + * in case of error, "aproperty->type" is always set to + * @BDF_PROPERTY_TYPE_NONE + */ + FT_EXPORT( FT_Error ) + FT_Get_BDF_Property( FT_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ); + /* */ FT_END_HEADER Index: xc/extras/freetype2/include/freetype/ftcache.h diff -u xc/extras/freetype2/include/freetype/ftcache.h:1.5 xc/extras/freetype2/include/freetype/ftcache.h:1.6 --- xc/extras/freetype2/include/freetype/ftcache.h:1.5 Mon Jan 14 12:00:58 2002 +++ xc/extras/freetype2/include/freetype/ftcache.h Wed May 28 22:13:02 2003 @@ -183,7 +183,11 @@ (f1)->pix_width == (f2)->pix_width && \ (f1)->pix_height == (f2)->pix_height ) -#define FTC_FACE_ID_HASH( i ) ((FT_UInt32)(FT_Pointer)( i )) +#define FT_POINTER_TO_ULONG( p ) ((FT_ULong)(FT_Pointer)(p)) + +#define FTC_FACE_ID_HASH( i ) \ + ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \ + ( FT_POINTER_TO_ULONG( i ) << 7 ) ) ) #define FTC_FONT_HASH( f ) \ (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \ Index: xc/extras/freetype2/include/freetype/ftchapters.h diff -u xc/extras/freetype2/include/freetype/ftchapters.h:1.1.1.2 xc/extras/freetype2/include/freetype/ftchapters.h:1.1.1.3 --- xc/extras/freetype2/include/freetype/ftchapters.h:1.1.1.2 Sun Dec 16 12:49:21 2001 +++ xc/extras/freetype2/include/freetype/ftchapters.h Wed May 28 22:01:45 2003 @@ -11,14 +11,26 @@ /* base_interface */ /* glyph_management */ /* mac_specific */ +/* sizes_management */ +/* header_file_macros */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* */ +/* format_specific */ +/* */ +/* */ +/* Format-Specific API */ +/* */ +/* <Sections> */ /* multiple_masters */ /* truetype_tables */ /* type1_tables */ /* sfnt_names */ -/* sizes_management */ -/* module_management */ -/* system_interface */ -/* header_file_macros */ +/* bdf_fonts */ +/* pfr_fonts */ /* */ /***************************************************************************/ @@ -50,6 +62,8 @@ /* list_processing */ /* outline_processing */ /* raster */ +/* system_interface */ +/* module_management */ /* */ /***************************************************************************/ Index: xc/extras/freetype2/include/freetype/ftglyph.h diff -u xc/extras/freetype2/include/freetype/ftglyph.h:1.1.1.4 xc/extras/freetype2/include/freetype/ftglyph.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/ftglyph.h:1.1.1.4 Mon Jan 14 11:52:04 2002 +++ xc/extras/freetype2/include/freetype/ftglyph.h Wed May 28 22:01:45 2003 @@ -145,7 +145,7 @@ /* */ /* <Note> */ /* You can typecast FT_Glyph to FT_BitmapGlyph if you have */ - /* glyph->format == ft_glyph_format_bitmap. This lets you access */ + /* glyph->format == FT_GLYPH_FORMAT_BITMAP. This lets you access */ /* the bitmap's contents easily. */ /* */ /* The corresponding pixel buffer is always owned by the BitmapGlyph */ @@ -189,7 +189,7 @@ /* */ /* <Note> */ /* You can typecast FT_Glyph to FT_OutlineGlyph if you have */ - /* glyph->format == ft_glyph_format_outline. This lets you access */ + /* glyph->format == FT_GLYPH_FORMAT_OUTLINE. This lets you access */ /* the outline's content easily. */ /* */ /* As the outline is extracted from a glyph slot, its coordinates are */ @@ -374,8 +374,8 @@ /* the_glyph :: A pointer to a handle to the target glyph. */ /* */ /* <Input> */ - /* render_mode :: A set of bit flags that describe how the data is */ - /* */ + /* render_mode :: An enumeration that describe how the data is */ + /* rendered. */ /* */ /* origin :: A pointer to a vector used to translate the glyph */ /* image before rendering. Can be 0 (if no */ @@ -411,7 +411,7 @@ /* error = FT_Get_Glyph( face->glyph, &glyph ); */ /* */ /* // convert to a bitmap (default render mode + destroy old) */ - /* if ( glyph->format != ft_glyph_format_bitmap ) */ + /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */ /* { */ /* error = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_default, */ /* 0, 1 ); */ @@ -434,10 +434,10 @@ /* scalable. */ /* */ FT_EXPORT( FT_Error ) - FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, - FT_ULong render_mode, - FT_Vector* origin, - FT_Bool destroy ); + FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, + FT_Render_Mode render_mode, + FT_Vector* origin, + FT_Bool destroy ); /*************************************************************************/ @@ -483,7 +483,7 @@ /* The result is undefined if either `a' or `b' is zero. */ /* */ FT_EXPORT( void ) - FT_Matrix_Multiply( FT_Matrix* a, + FT_Matrix_Multiply( const FT_Matrix* a, FT_Matrix* b ); Index: xc/extras/freetype2/include/freetype/ftgzip.h diff -u /dev/null xc/extras/freetype2/include/freetype/ftgzip.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:15 2004 +++ xc/extras/freetype2/include/freetype/ftgzip.h Wed May 28 22:01:45 2003 @@ -0,0 +1,86 @@ +/***************************************************************************/ +/* */ +/* ftgzip.h */ +/* */ +/* Gzip-compressed stream support. */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTGZIP_H__ +#define __FTGZIP_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* gzip */ + /* */ + /* <Title> */ + /* GZIP Streams */ + /* */ + /* <Abstract> */ + /* Using gzip-compressed font files */ + /* */ + /* <Description> */ + /* This section contains the declaration of Gzip-specific functions. */ + /* */ + /*************************************************************************/ + + /************************************************************************ + * + * @type: FT_Stream_OpenGzip + * + * @description: + * open a new stream to parse gzip-compressed font files. This is + * mainly used to support the compressed *.pcf.gz fonts that come + * with XFree86 + * + * @input: + * stream :: target embedding stream + * source :: source stream, used to + * + * @return: + * error code. 0 means success + * + * @note: + * the source stream must be opened _before_ calling this function. + * + * calling @FT_Stream_Close on the new stream will *not* call + * @FT_Stream_Close on the source stream. None of the stream objects + * will be released to the heap. + * + * the stream implementation is very basic, and resets the decompression + * process each time seeking backwards is needed within the stream + * + * in certain builds of the library, gzip compression recognition is + * automatic when calling @FT_New_Face or @FT_Open_Face. This means that + * if no font driver is capable of handling the raw compressed file, + * the library will try to open a gzip stream from it and re-open + * the face with it. + * + * this function may return "FT_Err_Unimplemented" if your build of + * FreeType was not compiled with zlib support. + */ + FT_EXPORT( FT_Error ) + FT_Stream_OpenGzip( FT_Stream stream, + FT_Stream source ); + + /* */ + +FT_END_HEADER + +#endif /* __FTGZIP_H__ */ Index: xc/extras/freetype2/include/freetype/ftimage.h diff -u xc/extras/freetype2/include/freetype/ftimage.h:1.1.1.6 xc/extras/freetype2/include/freetype/ftimage.h:1.1.1.7 --- xc/extras/freetype2/include/freetype/ftimage.h:1.1.1.6 Thu Feb 14 19:33:25 2002 +++ xc/extras/freetype2/include/freetype/ftimage.h Wed May 28 22:01:45 2003 @@ -5,7 +5,7 @@ /* FreeType glyph image formats and default raster interface */ /* (specification). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -28,7 +28,10 @@ #define __FTIMAGE_H__ +/* _STANDALONE_ is from ftgrays.c */ +#ifndef _STANDALONE_ #include <ft2build.h> +#endif FT_BEGIN_HEADER @@ -114,54 +117,54 @@ /* given bitmap. Note that additional formats may be added in the */ /* future. */ /* */ - /* <Fields> */ - /* ft_pixel_mode_mono :: A monochrome bitmap (1 bit/pixel). */ - /* */ - /* ft_pixel_mode_grays :: An 8-bit gray-levels bitmap. Note that the */ - /* total number of gray levels is given in the */ - /* `num_grays' field of the FT_Bitmap */ - /* structure. */ - /* */ - /* ft_pixel_mode_pal2 :: A 2-bit paletted bitmap. */ - /* Currently unused by FreeType. */ - /* */ - /* ft_pixel_mode_pal4 :: A 4-bit paletted bitmap. */ - /* Currently unused by FreeType. */ - /* */ - /* ft_pixel_mode_pal8 :: An 8-bit paletted bitmap. */ - /* Currently unused by FreeType. */ - /* */ - /* ft_pixel_mode_rgb15 :: A 15-bit RGB bitmap. Uses 5:5:5 encoding. */ - /* Currently unused by FreeType. */ - /* */ - /* ft_pixel_mode_rgb16 :: A 16-bit RGB bitmap. Uses 5:6:5 encoding. */ - /* Currently unused by FreeType. */ - /* */ - /* ft_pixel_mode_rgb24 :: A 24-bit RGB bitmap. */ - /* Currently unused by FreeType. */ - /* */ - /* ft_pixel_mode_rgb32 :: A 32-bit RGB bitmap. */ - /* Currently unused by FreeType. */ - /* */ - /* <Note> */ - /* Some anti-aliased bitmaps might be embedded in TrueType fonts */ - /* using formats pal2 or pal4, though no fonts presenting those have */ - /* been found to date. */ + /* <Values> */ + /* FT_PIXEL_MODE_NONE :: */ + /* Value 0 is reserved. */ + /* */ + /* FT_PIXEL_MODE_MONO :: */ + /* A monochrome bitmap, using 1 bit per pixel. Note that pixels */ + /* are stored in most-significant order (MSB), which means that */ + /* the left-most pixel in a byte has value 128. */ + /* */ + /* FT_PIXEL_MODE_GRAY :: */ + /* An 8-bit bitmap, generally used to represent anti-aliased glyph */ + /* images. Each pixel is stored in one byte. Note that the number */ + /* of value "gray" levels is stored in the `num_bytes' field of */ + /* the @FT_Bitmap structure (it generally is 256). */ + /* */ + /* FT_PIXEL_MODE_GRAY2 :: */ + /* A 2-bit/pixel bitmap, used to represent embedded anti-aliased */ + /* bitmaps in font files according to the OpenType specification. */ + /* We haven't found a single font using this format, however. */ + /* */ + /* FT_PIXEL_MODE_GRAY4 :: */ + /* A 4-bit/pixel bitmap, used to represent embedded anti-aliased */ + /* bitmaps in font files according to the OpenType specification. */ + /* We haven't found a single font using this format, however. */ + /* */ + /* FT_PIXEL_MODE_LCD :: */ + /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */ + /* images used for display on LCD displays; the bitmap's width is */ + /* three times wider than the original glyph image. See also */ + /* @FT_RENDER_MODE_LCD. */ + /* */ + /* FT_PIXEL_MODE_LCD_V :: */ + /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */ + /* images used for display on rotated LCD displays; the bitmap's */ + /* height is three times taller than the original glyph image. */ + /* See also @FT_RENDER_MODE_LCD_V. */ /* */ typedef enum FT_Pixel_Mode_ { - ft_pixel_mode_none = 0, - ft_pixel_mode_mono, - ft_pixel_mode_grays, - ft_pixel_mode_pal2, - ft_pixel_mode_pal4, - ft_pixel_mode_pal8, - ft_pixel_mode_rgb15, - ft_pixel_mode_rgb16, - ft_pixel_mode_rgb24, - ft_pixel_mode_rgb32, + FT_PIXEL_MODE_NONE = 0, + FT_PIXEL_MODE_MONO, + FT_PIXEL_MODE_GRAY, + FT_PIXEL_MODE_GRAY2, + FT_PIXEL_MODE_GRAY4, + FT_PIXEL_MODE_LCD, + FT_PIXEL_MODE_LCD_V, - ft_pixel_mode_max /* do not remove */ + FT_PIXEL_MODE_MAX /* do not remove */ } FT_Pixel_Mode; @@ -169,9 +172,37 @@ /*************************************************************************/ /* */ /* <Enum> */ + /* ft_pixel_mode_xxx */ + /* */ + /* <Description> */ + /* A list of deprecated constants. Use the corresponding */ + /* @FT_Pixel_Mode values instead. */ + /* */ + /* <Values> */ + /* ft_pixel_mode_none :: see @FT_PIXEL_MODE_NONE */ + /* ft_pixel_mode_mono :: see @FT_PIXEL_MODE_MONO */ + /* ft_pixel_mode_grays :: see @FT_PIXEL_MODE_GRAY */ + /* ft_pixel_mode_pal2 :: see @FT_PIXEL_MODE_GRAY2 */ + /* ft_pixel_mode_pal4 :: see @FT_PIXEL_MODE_GRAY4 */ + /* */ +#define ft_pixel_mode_none FT_PIXEL_MODE_NONE +#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO +#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY +#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2 +#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4 + + /* */ + +#if 0 + + /*************************************************************************/ + /* */ + /* <Enum> */ /* FT_Palette_Mode */ /* */ /* <Description> */ + /* THIS TYPE IS DEPRECATED. DO NOT USE IT! */ + /* */ /* An enumeration type used to describe the format of a bitmap */ /* palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */ /* */ @@ -195,6 +226,10 @@ } FT_Palette_Mode; + /* */ + +#endif + /*************************************************************************/ /* */ @@ -223,7 +258,7 @@ /* most cases. */ /* */ /* num_grays :: This field is only used with */ - /* `ft_pixel_mode_grays'; it gives the number of gray */ + /* `FT_PIXEL_MODE_GRAY'; it gives the number of gray */ /* levels used in the bitmap. */ /* */ /* pixel_mode :: The pixel_mode, i.e., how pixel bits are stored. */ @@ -328,21 +363,23 @@ /* A simple type used to enumerates the flags in an outline's */ /* `outline_flags' field. */ /* */ - /* <Fields> */ - /* ft_outline_owner :: If set, this flag indicates that the */ + /* <Values> */ + /* FT_OUTLINE_NONE :: Value 0 is reserved. */ + /* */ + /* FT_OUTLINE_OWNER :: If set, this flag indicates that the */ /* outline's field arrays (i.e. */ /* `points', `flags' & `contours') are */ /* `owned' by the outline object, and */ /* should thus be freed when it is */ /* destroyed. */ /* */ - /* ft_outline_even_odd_fill :: By default, outlines are filled using */ + /* FT_OUTLINE_EVEN_ODD_FILL :: By default, outlines are filled using */ /* the non-zero winding rule. If set to */ /* 1, the outline will be filled using */ /* the even-odd fill rule (only works */ /* with the smooth raster). */ /* */ - /* ft_outline_reverse_fill :: By default, outside contours of an */ + /* FT_OUTLINE_REVERSE_FILL :: By default, outside contours of an */ /* outline are oriented in clock-wise */ /* direction, as defined in the TrueType */ /* specification. This flag is set if */ @@ -352,14 +389,14 @@ /* scan-converter. However, it is very */ /* important for the auto-hinter. */ /* */ - /* ft_outline_ignore_dropouts :: By default, the scan converter will */ + /* FT_OUTLINE_IGNORE_DROPOUTS :: By default, the scan converter will */ /* try to detect drop-outs in an outline */ /* and correct the glyph bitmap to */ /* ensure consistent shape continuity. */ /* If set, this flag hints the scan-line */ /* converter to ignore such cases. */ /* */ - /* ft_outline_high_precision :: This flag indicates that the */ + /* FT_OUTLINE_HIGH_PRECISION :: This flag indicates that the */ /* scan-line converter should try to */ /* convert this outline to bitmaps with */ /* the highest possible quality. It is */ @@ -368,7 +405,7 @@ /* hint, that might be completely */ /* ignored by a given scan-converter. */ /* */ - /* ft_outline_single_pass :: This flag is set to force a given */ + /* FT_OUTLINE_SINGLE_PASS :: This flag is set to force a given */ /* scan-converter to only use a single */ /* pass over the outline to render a */ /* bitmap glyph image. Normally, it is */ @@ -379,35 +416,67 @@ /* */ typedef enum FT_Outline_Flags_ { - ft_outline_none = 0, - ft_outline_owner = 1, - ft_outline_even_odd_fill = 2, - ft_outline_reverse_fill = 4, - ft_outline_ignore_dropouts = 8, - ft_outline_high_precision = 256, - ft_outline_single_pass = 512 + FT_OUTLINE_NONE = 0, + FT_OUTLINE_OWNER = 1, + FT_OUTLINE_EVEN_ODD_FILL = 2, + FT_OUTLINE_REVERSE_FILL = 4, + FT_OUTLINE_IGNORE_DROPOUTS = 8, + FT_OUTLINE_HIGH_PRECISION = 256, + FT_OUTLINE_SINGLE_PASS = 512 } FT_Outline_Flags; - /* */ -#define FT_CURVE_TAG( flag ) ( flag & 3 ) - -#define FT_Curve_Tag_On 1 -#define FT_Curve_Tag_Conic 0 -#define FT_Curve_Tag_Cubic 2 + /************************************************************************* + * + * @enum: + * ft_outline_xxx + * + * @description: + * These constants are deprecated. Please use the corresponding + * @FT_OUTLINE_XXX values. + * + * @values: + * ft_outline_none :: See @FT_OUTLINE_NONE. + * ft_outline_owner :: See @FT_OUTLINE_OWNER. + * ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL. + * ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL. + * ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS. + * ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION. + * ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS. + */ +#define ft_outline_none FT_OUTLINE_NONE +#define ft_outline_owner FT_OUTLINE_OWNER +#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL +#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL +#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS +#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION +#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS -#define FT_Curve_Tag_Touch_X 8 /* reserved for the TrueType hinter */ -#define FT_Curve_Tag_Touch_Y 16 /* reserved for the TrueType hinter */ + /* */ -#define FT_Curve_Tag_Touch_Both ( FT_Curve_Tag_Touch_X | \ - FT_Curve_Tag_Touch_Y ) +#define FT_CURVE_TAG( flag ) ( flag & 3 ) +#define FT_CURVE_TAG_ON 1 +#define FT_CURVE_TAG_CONIC 0 +#define FT_CURVE_TAG_CUBIC 2 + +#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */ +#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */ + +#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \ + FT_CURVE_TAG_TOUCH_Y ) + +#define FT_Curve_Tag_On FT_CURVE_TAG_ON +#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC +#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC +#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X +#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Outline_MoveTo_Func */ + /* FT_Outline_MoveToFunc */ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `move */ @@ -425,14 +494,15 @@ /* Error code. 0 means success. */ /* */ typedef int - (*FT_Outline_MoveTo_Func)( FT_Vector* to, - void* user ); + (*FT_Outline_MoveToFunc)( FT_Vector* to, + void* user ); +#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Outline_LineTo_Func */ + /* FT_Outline_LineToFunc */ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `line */ @@ -450,14 +520,15 @@ /* Error code. 0 means success. */ /* */ typedef int - (*FT_Outline_LineTo_Func)( FT_Vector* to, - void* user ); + (*FT_Outline_LineToFunc)( FT_Vector* to, + void* user ); +#define FT_Outline_LineTo_Func FT_Outline_LineToFunc /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Outline_ConicTo_Func */ + /* FT_Outline_ConicToFunc */ /* */ /* <Description> */ /* A function pointer type use to describe the signature of a `conic */ @@ -479,15 +550,16 @@ /* Error code. 0 means success. */ /* */ typedef int - (*FT_Outline_ConicTo_Func)( FT_Vector* control, - FT_Vector* to, - void* user ); + (*FT_Outline_ConicToFunc)( FT_Vector* control, + FT_Vector* to, + void* user ); +#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Outline_CubicTo_Func */ + /* FT_Outline_CubicToFunc */ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `cubic */ @@ -509,10 +581,12 @@ /* Error code. 0 means success. */ /* */ typedef int - (*FT_Outline_CubicTo_Func)( FT_Vector* control1, - FT_Vector* control2, - FT_Vector* to, - void* user ); + (*FT_Outline_CubicToFunc)( FT_Vector* control1, + FT_Vector* control2, + FT_Vector* to, + void* user ); + +#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc /*************************************************************************/ @@ -553,13 +627,13 @@ /* */ typedef struct FT_Outline_Funcs_ { - FT_Outline_MoveTo_Func move_to; - FT_Outline_LineTo_Func line_to; - FT_Outline_ConicTo_Func conic_to; - FT_Outline_CubicTo_Func cubic_to; + FT_Outline_MoveToFunc move_to; + FT_Outline_LineToFunc line_to; + FT_Outline_ConicToFunc conic_to; + FT_Outline_CubicToFunc cubic_to; - int shift; - FT_Pos delta; + int shift; + FT_Pos delta; } FT_Outline_Funcs; @@ -580,6 +654,15 @@ /* <Description> */ /* This macro converts four letter tags into an unsigned long. */ /* */ + /* <Note> */ + /* Since many 16bit compilers don't like 32bit enumerations, you */ + /* should redefine this macro in case of problems to something like */ + /* this: */ + /* */ + /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) (value) */ + /* */ + /* to get a simple enumeration without assigning special numbers. */ + /* */ #ifndef FT_IMAGE_TAG #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \ value = ( ( (unsigned long)_x1 << 24 ) | \ @@ -600,38 +683,69 @@ /* formats, even though future font drivers will be able to register */ /* their own format. */ /* */ - /* <Fields> */ - /* ft_glyph_format_composite :: The glyph image is a composite of */ - /* several other images. This glyph */ - /* format is _only_ used with the */ - /* FT_LOAD_FLAG_NO_RECURSE flag (XXX: */ - /* Which is currently unimplemented). */ - /* */ - /* ft_glyph_format_bitmap :: The glyph image is a bitmap, and can */ - /* be described as a FT_Bitmap. */ - /* */ - /* ft_glyph_format_outline :: The glyph image is a vectorial image */ - /* made of bezier control points, and */ - /* can be described as a FT_Outline. */ - /* */ - /* ft_glyph_format_plotter :: The glyph image is a vectorial image */ - /* made of plotter lines (some T1 fonts */ - /* like Hershey contain glyph in this */ - /* format). */ + /* <Values> */ + /* FT_GLYPH_FORMAT_NONE :: */ + /* The value 0 is reserved and does describe a glyph format. */ + /* */ + /* FT_GLYPH_FORMAT_COMPOSITE :: */ + /* The glyph image is a composite of several other images. This */ + /* format is _only_ used with @FT_LOAD_FLAG_NO_RECURSE, and is */ + /* used to report compound glyphs (like accented characters). */ + /* */ + /* FT_GLYPH_FORMAT_BITMAP :: */ + /* The glyph image is a bitmap, and can be described as an */ + /* @FT_Bitmap. You generally need to access the `bitmap' field of */ + /* the @FT_GlyphSlotRec structure to read it. */ + /* */ + /* FT_GLYPH_FORMAT_OUTLINE :: */ + /* The glyph image is a vertorial outline made of line segments */ + /* and Bezier arcs; it can be described as an @FT_Outline; you */ + /* generally want to access the `outline' field of the */ + /* @FT_GlyphSlotRec structure to read it. */ + /* */ + /* FT_GLYPH_FORMAT_PLOTTER :: */ + /* The glyph image is a vectorial path with no inside/outside */ + /* contours. Some Type 1 fonts, like those in the Hershey family, */ + /* contain glyphs in this format. These are described as */ + /* @FT_Outline, but FreeType isn't currently capable of rendering */ + /* them correctly. */ /* */ typedef enum FT_Glyph_Format_ { - FT_IMAGE_TAG( ft_glyph_format_none, 0, 0, 0, 0 ), + FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ), - FT_IMAGE_TAG( ft_glyph_format_composite, 'c', 'o', 'm', 'p' ), - FT_IMAGE_TAG( ft_glyph_format_bitmap, 'b', 'i', 't', 's' ), - FT_IMAGE_TAG( ft_glyph_format_outline, 'o', 'u', 't', 'l' ), - FT_IMAGE_TAG( ft_glyph_format_plotter, 'p', 'l', 'o', 't' ) + FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ), + FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ), + FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ), + FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' ) } FT_Glyph_Format; /*************************************************************************/ + /* */ + /* <Enum> */ + /* ft_glyph_format_xxx */ + /* */ + /* <Description> */ + /* A list of decprecated constants. Use the corresponding */ + /* @FT_Glyph_Format values instead. */ + /* */ + /* <Values> */ + /* ft_glyph_format_none :: see @FT_GLYPH_FORMAT_NONE */ + /* ft_glyph_format_composite :: see @FT_GLYPH_FORMAT_COMPOSITE */ + /* ft_glyph_format_bitmap :: see @FT_GLYPH_FORMAT_BITMAP */ + /* ft_glyph_format_outline :: see @FT_GLYPH_FORMAT_OUTLINE */ + /* ft_glyph_format_plotter :: see @FT_GLYPH_FORMAT_PLOTTER */ + /* */ +#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE +#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE +#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP +#define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE +#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER + + + /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -657,7 +771,7 @@ /*************************************************************************/ /* */ /* <Section> */ - /* Raster */ + /* raster */ /* */ /* <Title> */ /* Scanline converter */ @@ -703,7 +817,7 @@ /* */ /* <Note> */ /* This structure is used by the span drawing callback type named */ - /* FT_Raster_Span_Func(), which takes the y-coordinate of the span as */ + /* FT_SpanFunc which takes the y-coordinate of the span as a */ /* a parameter. */ /* */ /* The coverage value is always between 0 and 255, even if the number */ @@ -721,7 +835,7 @@ /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Raster_Span_Func */ + /* FT_SpanFunc */ /* */ /* <Description> */ /* A function used as a call-back by the anti-aliased renderer in */ @@ -755,10 +869,12 @@ /* only for those scanlines that do have `gray' pixels on them. */ /* */ typedef void - (*FT_Raster_Span_Func)( int y, - int count, - FT_Span* spans, - void* user ); + (*FT_SpanFunc)( int y, + int count, + FT_Span* spans, + void* user ); + +#define FT_Raster_Span_Func FT_SpanFunc /*************************************************************************/ @@ -767,6 +883,8 @@ /* FT_Raster_BitTest_Func */ /* */ /* <Description> */ + /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ + /* */ /* A function used as a call-back by the monochrome scan-converter */ /* to test whether a given target pixel is already set to the drawing */ /* `color'. These tests are crucial to implement drop-out control */ @@ -794,6 +912,8 @@ /* FT_Raster_BitSet_Func */ /* */ /* <Description> */ + /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ + /* */ /* A function used as a call-back by the monochrome scan-converter */ /* to set an individual target pixel. This is crucial to implement */ /* drop-out control according to the TrueType specification. */ @@ -823,15 +943,15 @@ /* An enumeration to list the bit flags as used in the `flags' field */ /* of a FT_Raster_Params structure. */ /* */ - /* <Fields> */ - /* ft_raster_flag_default :: This value is 0. */ + /* <Values> */ + /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */ /* */ - /* ft_raster_flag_aa :: This flag is set to indicate that an */ + /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */ /* anti-aliased glyph image should be */ /* generated. Otherwise, it will be */ /* monochrome (1-bit) */ /* */ - /* ft_raster_flag_direct :: This flag is set to indicate direct */ + /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */ /* rendering. In this mode, client */ /* applications must provide their own span */ /* callback. This lets them directly */ @@ -843,7 +963,7 @@ /* Note that for now, direct rendering is */ /* only possible with anti-aliased glyphs. */ /* */ - /* ft_raster_flag_clip :: This flag is only used in direct */ + /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */ /* rendering mode. If set, the output will */ /* be clipped to a box specified in the */ /* "clip_box" field of the FT_Raster_Params */ @@ -856,13 +976,18 @@ /* */ typedef enum { - ft_raster_flag_default = 0, - ft_raster_flag_aa = 1, - ft_raster_flag_direct = 2, - ft_raster_flag_clip = 4 + FT_RASTER_FLAG_DEFAULT = 0, + FT_RASTER_FLAG_AA = 1, + FT_RASTER_FLAG_DIRECT = 2, + FT_RASTER_FLAG_CLIP = 4 } FT_Raster_Flag; +#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT +#define ft_raster_flag_aa FT_RASTER_FLAG_AA +#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT +#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP + /*************************************************************************/ /* */ @@ -885,9 +1010,9 @@ /* */ /* black_spans :: The black span drawing callback. */ /* */ - /* bit_test :: The bit test callback. */ + /* bit_test :: The bit test callback. UNIMPLEMENTED! */ /* */ - /* bit_set :: The bit set callback. */ + /* bit_set :: The bit set callback. UNIMPLEMENTED! */ /* */ /* user :: User-supplied data that is passed to each drawing */ /* callback. */ @@ -898,11 +1023,11 @@ /* 26.6 fixed-point units). */ /* */ /* <Note> */ - /* An anti-aliased glyph bitmap is drawn if the ft_raster_flag_aa bit */ + /* An anti-aliased glyph bitmap is drawn if the FT_RASTER_FLAG_AA bit */ /* flag is set in the `flags' field, otherwise a monochrome bitmap */ /* will be generated. */ /* */ - /* If the ft_raster_flag_direct bit flag is set in `flags', the */ + /* If the FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */ /* raster will call the `gray_spans' callback to draw gray pixel */ /* spans, in the case of an aa glyph bitmap, it will call */ /* `black_spans', and `bit_test' and `bit_set' in the case of a */ @@ -919,10 +1044,10 @@ FT_Bitmap* target; void* source; int flags; - FT_Raster_Span_Func gray_spans; - FT_Raster_Span_Func black_spans; - FT_Raster_BitTest_Func bit_test; - FT_Raster_BitSet_Func bit_set; + FT_SpanFunc gray_spans; + FT_SpanFunc black_spans; + FT_Raster_BitTest_Func bit_test; /* doesn't work! */ + FT_Raster_BitSet_Func bit_set; /* doesn't work! */ void* user; FT_BBox clip_box; @@ -932,7 +1057,7 @@ /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Raster_New_Func */ + /* FT_Raster_NewFunc */ /* */ /* <Description> */ /* A function used to create a new raster object. */ @@ -954,14 +1079,15 @@ /* ignored by a given raster implementation. */ /* */ typedef int - (*FT_Raster_New_Func)( void* memory, - FT_Raster* raster ); + (*FT_Raster_NewFunc)( void* memory, + FT_Raster* raster ); +#define FT_Raster_New_Func FT_Raster_NewFunc /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Raster_Done_Func */ + /* FT_Raster_DoneFunc */ /* */ /* <Description> */ /* A function used to destroy a given raster object. */ @@ -970,13 +1096,14 @@ /* raster :: A handle to the raster object. */ /* */ typedef void - (*FT_Raster_Done_Func)( FT_Raster raster ); + (*FT_Raster_DoneFunc)( FT_Raster raster ); +#define FT_Raster_Done_Func FT_Raster_DoneFunc /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Raster_Reset_Func */ + /* FT_Raster_ResetFunc */ /* */ /* <Description> */ /* FreeType provides an area of memory called the `render pool', */ @@ -1001,15 +1128,16 @@ /* recommended for efficiency purposes. */ /* */ typedef void - (*FT_Raster_Reset_Func)( FT_Raster raster, - unsigned char* pool_base, - unsigned long pool_size ); + (*FT_Raster_ResetFunc)( FT_Raster raster, + unsigned char* pool_base, + unsigned long pool_size ); +#define FT_Raster_Reset_Func FT_Raster_ResetFunc /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Raster_Set_Mode_Func */ + /* FT_Raster_SetModeFunc */ /* */ /* <Description> */ /* This function is a generic facility to change modes or attributes */ @@ -1025,15 +1153,16 @@ /* args :: A pointer to the new mode/property to use. */ /* */ typedef int - (*FT_Raster_Set_Mode_Func)( FT_Raster raster, - unsigned long mode, - void* args ); + (*FT_Raster_SetModeFunc)( FT_Raster raster, + unsigned long mode, + void* args ); +#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc /*************************************************************************/ /* */ /* <FuncType> */ - /* FT_Raster_Render_Func */ + /* FT_Raster_RenderFunc */ /* */ /* <Description> */ /* Invokes a given raster to scan-convert a given glyph image into a */ @@ -1065,9 +1194,10 @@ /* composition). */ /* */ typedef int - (*FT_Raster_Render_Func)( FT_Raster raster, - FT_Raster_Params* params ); + (*FT_Raster_RenderFunc)( FT_Raster raster, + FT_Raster_Params* params ); +#define FT_Raster_Render_Func FT_Raster_RenderFunc /*************************************************************************/ /* */ @@ -1090,12 +1220,12 @@ /* */ typedef struct FT_Raster_Funcs_ { - FT_Glyph_Format glyph_format; - FT_Raster_New_Func raster_new; - FT_Raster_Reset_Func raster_reset; - FT_Raster_Set_Mode_Func raster_set_mode; - FT_Raster_Render_Func raster_render; - FT_Raster_Done_Func raster_done; + FT_Glyph_Format glyph_format; + FT_Raster_NewFunc raster_new; + FT_Raster_ResetFunc raster_reset; + FT_Raster_SetModeFunc raster_set_mode; + FT_Raster_RenderFunc raster_render; + FT_Raster_DoneFunc raster_done; } FT_Raster_Funcs; Index: xc/extras/freetype2/include/freetype/ftincrem.h diff -u /dev/null xc/extras/freetype2/include/freetype/ftincrem.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:15 2004 +++ xc/extras/freetype2/include/freetype/ftincrem.h Wed May 28 22:01:45 2003 @@ -0,0 +1,287 @@ +/***************************************************************************/ +/* */ +/* ftincrem.h */ +/* */ +/* FreeType incremental loading (specification). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTINCREM_H__ +#define __FTINCREM_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + + +FT_BEGIN_HEADER + + + /*************************************************************************** + * + * @type: + * FT_Incremental + * + * @description: + * An opaque type describing a user-provided object used to implement + * "incremental" glyph loading within FreeType. This is used to support + * embedded fonts in certain environments (e.g. Postscript interpreters), + * where the glyph data isn't in the font file, or must be overridden by + * different values. + * + * @note: + * It is up to client applications to create and implement @FT_Incremental + * objects, as long as they provide implementations for the methods + * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc + * and @FT_Incremental_GetGlyphMetricsFunc. + * + * See the description of @FT_Incremental_InterfaceRec to understand how + * to use incremental objects with FreeType. + */ + typedef struct FT_IncrementalRec_* FT_Incremental; + + + /*************************************************************************** + * + * @struct: + * FT_Incremental_Metrics + * + * @description: + * A small structure used to contain the basic glyph metrics returned + * by the @FT_Incremental_GetGlyphMetricsFunc method. + * + * @fields: + * bearing_x :: + * Left bearing, in font units. + * + * bearing_y :: + * Top bearing, in font units. + * + * advance :: + * Glyph advance, in font units. + * + * @note: + * These correspond to horizontal or vertical metrics depending on the + * value of the 'vertical' argument to the function + * @FT_Incremental_GetGlyphMetricsFunc. + */ + typedef struct FT_Incremental_MetricsRec_ + { + FT_Long bearing_x; + FT_Long bearing_y; + FT_Long advance; + + } FT_Incremental_MetricsRec, *FT_Incremental_Metrics; + + + /*************************************************************************** + * + * @type: + * FT_Incremental_GetGlyphDataFunc + * + * @description: + * A function called by FreeType to access a given glyph's data bytes + * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is + * enabled. + * + * Note that the format of the glyph's data bytes depends on the font + * file format. For TrueType, it must correspond to the raw bytes within + * the 'glyf' table. For Postscript formats, it must correspond to the + * *unencrypted* charstring bytes, without any 'lenIV' header. It is + * undefined for any other format. + * + * @input: + * incremental :: + * Handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * glyph_index :: + * Index of relevant glyph. + * + * @output: + * adata :: + * A structure describing the returned glyph data bytes (which will be + * accessed as a read-only byte block). + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * If this function returns succesfully the method + * @FT_Incremental_FreeGlyphDataFunc will be called later to release + * the data bytes. + * + * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for + * compound glyphs. + */ + typedef FT_Error + (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental, + FT_UInt glyph_index, + FT_Data* adata ); + + + /*************************************************************************** + * + * @type: + * FT_Incremental_FreeGlyphDataFunc + * + * @description: + * A function used to release the glyph data bytes returned by a + * successful call to @FT_Incremental_GetGlyphDataFunc. + * + * @input: + * incremental :: + * A handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * data :: + * A structure describing the glyph data bytes (which will be accessed + * as a read-only byte block). + */ + typedef void + (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental, + FT_Data* data ); + + + /*************************************************************************** + * + * @type: + * FT_Incremental_GetGlyphMetricsFunc + * + * @description: + * A function used to retrieve the basic metrics of a given glyph index + * before accessing its data. This is necessary because, in certain + * formats like TrueType, the metrics are stored in a different place from + * the glyph images proper. + * + * @input: + * incremental :: + * A handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * glyph_index :: + * Index of relevant glyph. + * + * vertical :: + * If true, return vertical metrics. + * + * ametrics :: + * This parameter is used for both input and output. + * The original glyph metrics, if any, in font units. If metrics are + * not available all the values must be set to zero. + * + * @output: + * ametrics :: + * The replacement glyph metrics in font units. + * + */ + typedef FT_Error + (*FT_Incremental_GetGlyphMetricsFunc) + ( FT_Incremental incremental, + FT_UInt glyph_index, + FT_Bool vertical, + FT_Incremental_MetricsRec *ametrics ); + + + /************************************************************************** + * + * @struct: + * FT_Incremental_FuncsRec + * + * @description: + * A table of functions for accessing fonts that load data + * incrementally. Used in @FT_Incremental_Interface. + * + * @fields: + * get_glyph_data :: + * The function to get glyph data. Must not be null. + * + * free_glyph_data :: + * The function to release glyph data. Must not be null. + * + * get_glyph_metrics :: + * The function to get glyph metrics. May be null if the font does + * not provide overriding glyph metrics. + */ + typedef struct FT_Incremental_FuncsRec_ + { + FT_Incremental_GetGlyphDataFunc get_glyph_data; + FT_Incremental_FreeGlyphDataFunc free_glyph_data; + FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics; + + } FT_Incremental_FuncsRec; + + + /*************************************************************************** + * + * @struct: + * FT_Incremental_InterfaceRec + * + * @description: + * A structure to be used with @FT_Open_Face to indicate that the user + * wants to support incremental glyph loading. You should use it with + * @FT_PARAM_TAG_INCREMENTAL as in the following example: + * + * { + * FT_Incremental_InterfaceRec inc_int; + * FT_Parameter parameter; + * FT_Open_Args open_args; + * + * + * // set up incremental descriptor + * inc_int.funcs = my_funcs; + * inc_int.object = my_object; + * + * // set up optional parameter + * parameter.tag = FT_PARAM_TAG_INCREMENTAL; + * parameter.data = &inc_int; + * + * // set up FT_Open_Args structure + * open_args.flags = (FT_Open_Flags)( FT_OPEN_PATHNAME | + * FT_OPEN_PARAMS ); + * open_args.pathname = my_font_pathname; + * open_args.num_params = 1; + * open_args.params = ¶meter; // we use one optional argument + * + * // open the font + * error = FT_Open_Face( library, &open_args, index, &face ); + * ... + * } + */ + typedef struct FT_Incremental_InterfaceRec_ + { + const FT_Incremental_FuncsRec* funcs; + FT_Incremental object; + + } FT_Incremental_InterfaceRec; + + + /*************************************************************************** + * + * @constant: + * FT_PARAM_TAG_INCREMENTAL + * + * @description: + * A constant used as the tag of @FT_Parameter structures to indicate + * an incremental loading object to be used by FreeType. + * + */ +#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) + + /* */ + +FT_END_HEADER + +#endif /* __FTINCREM_H__ */ + + +/* END */ Index: xc/extras/freetype2/include/freetype/ftmodule.h diff -u xc/extras/freetype2/include/freetype/ftmodule.h:1.1.1.3 xc/extras/freetype2/include/freetype/ftmodule.h:1.1.1.4 --- xc/extras/freetype2/include/freetype/ftmodule.h:1.1.1.3 Sun Dec 16 12:49:22 2001 +++ xc/extras/freetype2/include/freetype/ftmodule.h Wed May 28 22:01:45 2003 @@ -111,7 +111,7 @@ typedef struct FT_Module_Class_ { FT_ULong module_flags; - FT_Int module_size; + FT_Long module_size; const FT_String* module_name; FT_Fixed module_version; FT_Fixed module_requires; Index: xc/extras/freetype2/include/freetype/ftoutln.h diff -u xc/extras/freetype2/include/freetype/ftoutln.h:1.1.1.5 xc/extras/freetype2/include/freetype/ftoutln.h:1.1.1.6 --- xc/extras/freetype2/include/freetype/ftoutln.h:1.1.1.5 Thu Jun 20 04:16:07 2002 +++ xc/extras/freetype2/include/freetype/ftoutln.h Wed May 28 22:01:45 2003 @@ -310,7 +310,7 @@ /* outline :: A pointer to the target outline descriptor. */ /* */ /* <Note> */ - /* This functions toggles the bit flag `ft_outline_reverse_fill' in */ + /* This functions toggles the bit flag `FT_OUTLINE_REVERSE_FILL' in */ /* the outline's `flags' field. */ /* */ /* It shouldn't be used by a normal client application, unless it */ Index: xc/extras/freetype2/include/freetype/ftpfr.h diff -u /dev/null xc/extras/freetype2/include/freetype/ftpfr.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:15 2004 +++ xc/extras/freetype2/include/freetype/ftpfr.h Wed May 28 22:01:45 2003 @@ -0,0 +1,156 @@ +/***************************************************************************/ +/* */ +/* ftpfr.h */ +/* */ +/* FreeType API for accessing PFR-specific data */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTPFR_H__ +#define __FTPFR_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* pfr_fonts */ + /* */ + /* <Title> */ + /* PFR Fonts */ + /* */ + /* <Abstract> */ + /* PFR/TrueDoc specific APIs */ + /* */ + /* <Description> */ + /* This section contains the declaration of PFR-specific functions. */ + /* */ + /*************************************************************************/ + + + /********************************************************************** + * + * @function: + * FT_Get_PFR_Metrics + * + * @description: + * returns the outline and metrics resolutions of a given PFR + * face. + * + * @input: + * face :: handle to input face. It can be a non-PFR face. + * + * @output: + * aoutline_resolution :: + * outline resolution. This is equivalent to "face->units_per_EM". + * optional (parameter can be NULL) + * + * ametrics_resolution :: + * metrics_resolution. This is equivalent to "outline_resolution" + * for non-PFR fonts. can be NULL + * optional (parameter can be NULL) + * + * ametrics_x_scale :: + * a 16.16 fixed-point number used to scale distance expressed + * in metrics units to device sub-pixels. This is equivalent to + * 'face->size->x_scale', but for metrics only. + * optional (parameter can be NULL) + * + * ametrics_y_scale :: + * same as 'ametrics_x_scale', but for the vertical direction. + * optional (parameter can be NULL) + * + * @note: + * if the input face is not a PFR, this function will return an error. + * However, in all cases, it will return valid values. + */ + FT_EXPORT( FT_Error ) + FT_Get_PFR_Metrics( FT_Face face, + FT_UInt *aoutline_resolution, + FT_UInt *ametrics_resolution, + FT_Fixed *ametrics_x_scale, + FT_Fixed *ametrics_y_scale ); + + /********************************************************************** + * + * @function: + * FT_Get_PFR_Kerning + * + * @description: + * returns the kerning pair corresponding to two glyphs in + * a PFR face. The distance is expressed in metrics units, unlike + * the result of @FT_Get_Kerning. + * + * @input: + * face :: handle to input face. + * left :: left glyph index + * right :: right glyph index + * + * @output: + * avector :: kerning vector + * + * @note: + * this function always return distances in original PFR metrics + * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED + * mode, which always return distances converted to outline units. + * + * you can use the value of the 'x_scale' and 'y_scale' parameters + * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels + */ + FT_EXPORT( FT_Error ) + FT_Get_PFR_Kerning( FT_Face face, + FT_UInt left, + FT_UInt right, + FT_Vector *avector ); + + /********************************************************************** + * + * @function: + * FT_Get_PFR_Advance + * + * @description: + * returns a given glyph advance, expressed in original metrics units, + * from a PFR font. + * + * @input: + * face :: handle to input face. + * gindex :: glyph index + * + * @output: + * aadvance :: glyph advance in metrics units + * + * @return: + * error code. 0 means success + * + * @note: + * you can use the 'x_scale' or 'y_scale' results of @FT_Get_PFR_Metrics + * to convert the advance to device sub-pixels (i.e. 1/64th of pixels) + */ + FT_EXPORT( FT_Error ) + FT_Get_PFR_Advance( FT_Face face, + FT_UInt gindex, + FT_Pos *aadvance ); + + /* */ + +FT_END_HEADER + +#endif /* __FTBDF_H__ */ + + +/* END */ Index: xc/extras/freetype2/include/freetype/ftrender.h diff -u xc/extras/freetype2/include/freetype/ftrender.h:1.1.1.3 xc/extras/freetype2/include/freetype/ftrender.h:1.1.1.4 --- xc/extras/freetype2/include/freetype/ftrender.h:1.1.1.3 Sun Dec 16 12:49:22 2001 +++ xc/extras/freetype2/include/freetype/ftrender.h Wed May 28 22:01:45 2003 @@ -38,65 +38,81 @@ /* create a new glyph object */ typedef FT_Error - (*FT_Glyph_Init_Func)( FT_Glyph glyph, - FT_GlyphSlot slot ); + (*FT_Glyph_InitFunc)( FT_Glyph glyph, + FT_GlyphSlot slot ); /* destroys a given glyph object */ typedef void - (*FT_Glyph_Done_Func)( FT_Glyph glyph ); + (*FT_Glyph_DoneFunc)( FT_Glyph glyph ); typedef void - (*FT_Glyph_Transform_Func)( FT_Glyph glyph, - FT_Matrix* matrix, - FT_Vector* delta ); + (*FT_Glyph_TransformFunc)( FT_Glyph glyph, + FT_Matrix* matrix, + FT_Vector* delta ); typedef void - (*FT_Glyph_BBox_Func)( FT_Glyph glyph, - FT_BBox* abbox ); + (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, + FT_BBox* abbox ); typedef FT_Error - (*FT_Glyph_Copy_Func)( FT_Glyph source, - FT_Glyph target ); + (*FT_Glyph_CopyFunc)( FT_Glyph source, + FT_Glyph target ); typedef FT_Error - (*FT_Glyph_Prepare_Func)( FT_Glyph glyph, - FT_GlyphSlot slot ); + (*FT_Glyph_PrepareFunc)( FT_Glyph glyph, + FT_GlyphSlot slot ); + +/* deprecated */ +#define FT_Glyph_Init_Func FT_Glyph_InitFunc +#define FT_Glyph_Done_Func FT_Glyph_DoneFunc +#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc +#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc +#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc +#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc struct FT_Glyph_Class_ { - FT_UInt glyph_size; - FT_Glyph_Format glyph_format; - FT_Glyph_Init_Func glyph_init; - FT_Glyph_Done_Func glyph_done; - FT_Glyph_Copy_Func glyph_copy; - FT_Glyph_Transform_Func glyph_transform; - FT_Glyph_BBox_Func glyph_bbox; - FT_Glyph_Prepare_Func glyph_prepare; + FT_Long glyph_size; + FT_Glyph_Format glyph_format; + FT_Glyph_InitFunc glyph_init; + FT_Glyph_DoneFunc glyph_done; + FT_Glyph_CopyFunc glyph_copy; + FT_Glyph_TransformFunc glyph_transform; + FT_Glyph_GetBBoxFunc glyph_bbox; + FT_Glyph_PrepareFunc glyph_prepare; }; typedef FT_Error - (*FTRenderer_render)( FT_Renderer renderer, - FT_GlyphSlot slot, - FT_UInt mode, - FT_Vector* origin ); + (*FT_Renderer_RenderFunc)( FT_Renderer renderer, + FT_GlyphSlot slot, + FT_UInt mode, + FT_Vector* origin ); typedef FT_Error - (*FTRenderer_transform)( FT_Renderer renderer, - FT_GlyphSlot slot, - FT_Matrix* matrix, - FT_Vector* delta ); + (*FT_Renderer_TransformFunc)( FT_Renderer renderer, + FT_GlyphSlot slot, + FT_Matrix* matrix, + FT_Vector* delta ); + typedef void - (*FTRenderer_getCBox)( FT_Renderer renderer, - FT_GlyphSlot slot, - FT_BBox* cbox ); + (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer, + FT_GlyphSlot slot, + FT_BBox* cbox ); + typedef FT_Error - (*FTRenderer_setMode)( FT_Renderer renderer, - FT_ULong mode_tag, - FT_Pointer mode_ptr ); + (*FT_Renderer_SetModeFunc)( FT_Renderer renderer, + FT_ULong mode_tag, + FT_Pointer mode_ptr ); + +/* deprecated identifiers */ +#define FTRenderer_render FT_Renderer_RenderFunc +#define FTRenderer_transform FT_Renderer_TransformFunc +#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc +#define FTRenderer_setMode FT_Renderer_SetModeFunc /*************************************************************************/ @@ -117,10 +133,10 @@ /* */ /* set_mode :: A method used to pass additional parameters. */ /* */ - /* raster_class :: For `ft_glyph_format_outline' renderers only, this */ + /* raster_class :: For `FT_GLYPH_FORMAT_OUTLINE' renderers only, this */ /* is a pointer to its raster's class. */ /* */ - /* raster :: For `ft_glyph_format_outline' renderers only. this */ + /* raster :: For `FT_GLYPH_FORMAT_OUTLINE' renderers only. this */ /* is a pointer to the corresponding raster object, */ /* if any. */ /* */ @@ -130,12 +146,12 @@ FT_Glyph_Format glyph_format; - FTRenderer_render render_glyph; - FTRenderer_transform transform_glyph; - FTRenderer_getCBox get_glyph_cbox; - FTRenderer_setMode set_mode; + FT_Renderer_RenderFunc render_glyph; + FT_Renderer_TransformFunc transform_glyph; + FT_Renderer_GetCBoxFunc get_glyph_cbox; + FT_Renderer_SetModeFunc set_mode; - FT_Raster_Funcs* raster_class; + FT_Raster_Funcs* raster_class; } FT_Renderer_Class; Index: xc/extras/freetype2/include/freetype/ftsizes.h diff -u xc/extras/freetype2/include/freetype/ftsizes.h:1.1.1.1 xc/extras/freetype2/include/freetype/ftsizes.h:1.1.1.2 --- xc/extras/freetype2/include/freetype/ftsizes.h:1.1.1.1 Sun Dec 16 12:49:22 2001 +++ xc/extras/freetype2/include/freetype/ftsizes.h Wed May 28 22:01:45 2003 @@ -57,7 +57,7 @@ /* mostly in order to manage several character pixel sizes of the */ /* same font family and style. See @FT_New_Size and @FT_Done_Size. */ /* */ - /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Character_Size only */ + /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */ /* modify the contents of the current "active" size; you thus need */ /* to use @FT_Activate_Size to change it. */ /* */ Index: xc/extras/freetype2/include/freetype/ftstroker.h diff -u /dev/null xc/extras/freetype2/include/freetype/ftstroker.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:15 2004 +++ xc/extras/freetype2/include/freetype/ftstroker.h Wed May 28 22:01:45 2003 @@ -0,0 +1,139 @@ +#ifndef __FT_STROKER_H__ +#define __FT_STROKER_H__ + +#include <ft2build.h> +#include FT_OUTLINE_H + +FT_BEGIN_HEADER + +/*@************************************************************* + * + * @type: FT_Stroker + * + * @description: + * opaque handler to a path stroker object + */ + typedef struct FT_StrokerRec_* FT_Stroker; + + +/*@************************************************************* + * + * @enum: FT_Stroker_LineJoin + * + * @description: + * these values determine how two joining lines are rendered + * in a stroker. + * + * @values: + * FT_STROKER_LINEJOIN_ROUND :: + * used to render rounded line joins. circular arcs are used + * to join two lines smoothly + * + * FT_STROKER_LINEJOIN_BEVEL :: + * used to render beveled line joins; i.e. the two joining lines + * are extended until they intersect + * + * FT_STROKER_LINEJOIN_MITER :: + * same as beveled rendering, except that an additional line + * break is added if the angle between the two joining lines + * is too closed (this is useful to avoid unpleasant spikes + * in beveled rendering). + */ + typedef enum + { + FT_STROKER_LINEJOIN_ROUND = 0, + FT_STROKER_LINEJOIN_BEVEL, + FT_STROKER_LINEJOIN_MITER + + } FT_Stroker_LineJoin; + + +/*@************************************************************* + * + * @enum: FT_Stroker_LineCap + * + * @description: + * these values determine how the end of opened sub-paths are + * rendered in a stroke + * + * @values: + * FT_STROKER_LINECAP_BUTT :: + * the end of lines is rendered as a full stop on the last + * point itself + * + * FT_STROKER_LINECAP_ROUND :: + * the end of lines is rendered as a half-circle around the + * last point + * + * FT_STROKER_LINECAP_SQUARE :: + * the end of lines is rendered as a square around the + * last point + */ + typedef enum + { + FT_STROKER_LINECAP_BUTT = 0, + FT_STROKER_LINECAP_ROUND, + FT_STROKER_LINECAP_SQUARE + + } FT_Stroker_LineCap; + + /* */ + + FT_EXPORT( FT_Error ) + FT_Stroker_New( FT_Memory memory, + FT_Stroker *astroker ); + + FT_EXPORT( void ) + FT_Stroker_Set( FT_Stroker stroker, + FT_Fixed radius, + FT_Stroker_LineCap line_cap, + FT_Stroker_LineJoin line_join, + FT_Fixed miter_limit ); + + + FT_EXPORT( FT_Error ) + FT_Stroker_ParseOutline( FT_Stroker stroker, + FT_Outline* outline, + FT_Bool opened ); + + FT_EXPORT( FT_Error ) + FT_Stroker_BeginSubPath( FT_Stroker stroker, + FT_Vector* to, + FT_Bool open ); + + FT_EXPORT( FT_Error ) + FT_Stroker_EndSubPath( FT_Stroker stroker ); + + + FT_EXPORT( FT_Error ) + FT_Stroker_LineTo( FT_Stroker stroker, + FT_Vector* to ); + + FT_EXPORT( FT_Error ) + FT_Stroker_ConicTo( FT_Stroker stroker, + FT_Vector* control, + FT_Vector* to ); + + FT_EXPORT( FT_Error ) + FT_Stroker_CubicTo( FT_Stroker stroker, + FT_Vector* control1, + FT_Vector* control2, + FT_Vector* to ); + + + FT_EXPORT( FT_Error ) + FT_Stroker_GetCounts( FT_Stroker stroker, + FT_UInt *anum_points, + FT_UInt *anum_contours ); + + FT_EXPORT( void ) + FT_Stroker_Export( FT_Stroker stroker, + FT_Outline* outline ); + + FT_EXPORT( void ) + FT_Stroker_Done( FT_Stroker stroker ); + + +FT_END_HEADER + +#endif /* __FT_STROKER_H__ */ Index: xc/extras/freetype2/include/freetype/ftsynth.h diff -u xc/extras/freetype2/include/freetype/ftsynth.h:1.1.1.3 xc/extras/freetype2/include/freetype/ftsynth.h:1.1.1.4 --- xc/extras/freetype2/include/freetype/ftsynth.h:1.1.1.3 Sun Dec 16 12:49:22 2001 +++ xc/extras/freetype2/include/freetype/ftsynth.h Wed May 28 22:01:45 2003 @@ -48,17 +48,15 @@ /* This code is completely experimental -- use with care! */ /* It will probably be completely rewritten in the future */ /* or even integrated into the library. */ - FT_EXPORT( FT_Error ) - FT_Outline_Embolden( FT_GlyphSlot original, - FT_Outline* outline, - FT_Pos* advance ); - - FT_EXPORT( FT_Error ) - FT_Outline_Oblique( FT_GlyphSlot original, - FT_Outline* outline, - FT_Pos* advance ); + FT_EXPORT( void ) + FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); + FT_EXPORT( void ) + FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); + + /* */ + FT_END_HEADER #endif /* __FTSYNTH_H__ */ Index: xc/extras/freetype2/include/freetype/ftsysio.h diff -u xc/extras/freetype2/include/freetype/ftsysio.h:1.1.1.1 xc/extras/freetype2/include/freetype/ftsysio.h:1.1.1.2 --- xc/extras/freetype2/include/freetype/ftsysio.h:1.1.1.1 Thu Jun 20 04:16:07 2002 +++ xc/extras/freetype2/include/freetype/ftsysio.h Wed May 28 22:01:45 2003 @@ -1,6 +1,16 @@ #ifndef __FT_SYSTEM_IO_H__ #define __FT_SYSTEM_IO_H__ + /************************************************************************/ + /************************************************************************/ + /***** *****/ + /***** NOTE: THE CONTENT OF THIS FILE IS NOT CURRENTLY USED *****/ + /***** IN NORMAL BUILDS. CONSIDER IT EXPERIMENTAL. *****/ + /***** *****/ + /************************************************************************/ + /************************************************************************/ + + /******************************************************************** * * designing custom streams is a bit different now @@ -35,7 +45,7 @@ FT_BEGIN_HEADER - /******************************************************************** + /*@******************************************************************* * * @type: FT_Stream * @@ -45,7 +55,7 @@ typedef struct FT_StreamRec_* FT_Stream; - /******************************************************************** + /*@******************************************************************* * * @type: FT_Stream_Class * @@ -56,7 +66,7 @@ typedef const struct FT_Stream_ClassRec_* FT_Stream_Class; - /******************************************************************** + /*@******************************************************************* * * @functype: FT_Stream_ReadFunc * @@ -76,7 +86,7 @@ FT_ULong size ); - /******************************************************************** + /*@******************************************************************* * * @functype: FT_Stream_SeekFunc * @@ -93,7 +103,8 @@ typedef FT_Error (*FT_Stream_SeekFunc)( FT_Stream stream, FT_ULong pos ); - /******************************************************************** + + /*@******************************************************************* * * @struct: FT_Stream_ClassRec * @@ -119,7 +130,7 @@ #define FT_STREAM_CLASS__READ(x) FT_STREAM_CLASS(x)->stream_read #define FT_STREAM_CLASS__SEEK(x) FT_STREAM_CLASS(x)->stream_seek; - /******************************************************************** + /*@******************************************************************* * * @struct: FT_StreamRec * Index: xc/extras/freetype2/include/freetype/ftsysmem.h diff -u xc/extras/freetype2/include/freetype/ftsysmem.h:1.1.1.1 xc/extras/freetype2/include/freetype/ftsysmem.h:1.1.1.2 --- xc/extras/freetype2/include/freetype/ftsysmem.h:1.1.1.1 Thu Jun 20 04:16:08 2002 +++ xc/extras/freetype2/include/freetype/ftsysmem.h Wed May 28 22:01:45 2003 @@ -5,7 +5,17 @@ FT_BEGIN_HEADER - /*********************************************************************** + /************************************************************************/ + /************************************************************************/ + /***** *****/ + /***** NOTE: THE CONTENT OF THIS FILE IS NOT CURRENTLY USED *****/ + /***** IN NORMAL BUILDS. CONSIDER IT EXPERIMENTAL. *****/ + /***** *****/ + /************************************************************************/ + /************************************************************************/ + + + /*@********************************************************************** * * @type: FT_Memory * @@ -20,7 +30,7 @@ typedef struct FT_MemoryRec_* FT_Memory; - /*********************************************************************** + /*@********************************************************************** * * @functype: FT_Memory_AllocFunc * @@ -39,7 +49,7 @@ FT_Pointer mem_data ); - /*********************************************************************** + /*@********************************************************************** * * @functype: FT_Memory_FreeFunc * @@ -56,7 +66,7 @@ FT_Pointer mem_data ); - /*********************************************************************** + /*@********************************************************************** * * @functype: FT_Memory_ReallocFunc * @@ -76,7 +86,7 @@ FT_Pointer mem_data ); - /*********************************************************************** + /*@********************************************************************** * * @functype: FT_Memory_CreateFunc * @@ -100,7 +110,7 @@ FT_Pointer *amem_data ); - /*********************************************************************** + /*@********************************************************************** * * @functype: FT_Memory_DestroyFunc * @@ -115,7 +125,7 @@ FT_Pointer mem_data ); - /*********************************************************************** + /*@********************************************************************** * * @struct: FT_Memory_FuncsRec * @@ -141,7 +151,7 @@ } FT_Memory_FuncsRec, *FT_Memory_Funcs; - /*********************************************************************** + /*@********************************************************************** * * @type: FT_Memory_Funcs * @@ -152,7 +162,7 @@ typedef const FT_Memory_FuncsRec* FT_Memory_Funcs; - /*********************************************************************** + /*@********************************************************************** * * @function: ft_memory_new * @@ -172,7 +182,7 @@ FT_Pointer mem_init_data ); - /*********************************************************************** + /*@********************************************************************** * * @function: ft_memory_destroy * Index: xc/extras/freetype2/include/freetype/ftsystem.h diff -u xc/extras/freetype2/include/freetype/ftsystem.h:1.1.1.5 xc/extras/freetype2/include/freetype/ftsystem.h:1.1.1.6 --- xc/extras/freetype2/include/freetype/ftsystem.h:1.1.1.5 Thu Jun 20 04:16:08 2002 +++ xc/extras/freetype2/include/freetype/ftsystem.h Wed May 28 22:01:45 2003 @@ -280,7 +280,7 @@ /* limit :: This field is set and used internally by FreeType */ /* when parsing frames. */ /* */ - struct FT_StreamRec_ + typedef struct FT_StreamRec_ { unsigned char* base; unsigned long size; @@ -294,7 +294,8 @@ FT_Memory memory; unsigned char* cursor; unsigned char* limit; - }; + + } FT_StreamRec; /* */ Index: xc/extras/freetype2/include/freetype/fttrigon.h diff -u xc/extras/freetype2/include/freetype/fttrigon.h:1.1.1.2 xc/extras/freetype2/include/freetype/fttrigon.h:1.1.1.3 --- xc/extras/freetype2/include/freetype/fttrigon.h:1.1.1.2 Sun Dec 16 12:49:22 2001 +++ xc/extras/freetype2/include/freetype/fttrigon.h Wed May 28 22:01:45 2003 @@ -176,6 +176,28 @@ /*************************************************************************/ /* */ /* @function: */ + /* FT_Angle_Diff */ + /* */ + /* @description: */ + /* Return the difference between two angles. The result is always */ + /* constrained to the ]-PI..PI] interval. */ + /* */ + /* @input: */ + /* angle1 :: First angle. */ + /* */ + /* angle2 :: Second angle. */ + /* */ + /* @return: */ + /* Contrainted value of `value2-value1'. */ + /* */ + FT_EXPORT( FT_Angle ) + FT_Angle_Diff( FT_Angle angle1, + FT_Angle angle2 ); + + + /*************************************************************************/ + /* */ + /* @function: */ /* FT_Vector_Unit */ /* */ /* @description: */ @@ -270,6 +292,28 @@ FT_Vector_Polarize( FT_Vector* vec, FT_Fixed *length, FT_Angle *angle ); + + + /*************************************************************************/ + /* */ + /* @function: */ + /* FT_Vector_From_Polar */ + /* */ + /* @description: */ + /* Compute vector coordinates from a length and angle. */ + /* */ + /* @output: */ + /* vec :: The address of source vector. */ + /* */ + /* @input: */ + /* length :: The vector length. */ + /* angle :: The vector angle. */ + /* */ + FT_EXPORT( void ) + FT_Vector_From_Polar( FT_Vector* vec, + FT_Fixed length, + FT_Angle angle ); + /* */ Index: xc/extras/freetype2/include/freetype/fttypes.h diff -u xc/extras/freetype2/include/freetype/fttypes.h:1.1.1.4 xc/extras/freetype2/include/freetype/fttypes.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/fttypes.h:1.1.1.4 Sun Dec 16 12:49:22 2001 +++ xc/extras/freetype2/include/freetype/fttypes.h Wed May 28 22:01:45 2003 @@ -21,6 +21,7 @@ #include <ft2build.h> +#include FT_CONFIG_CONFIG_H #include FT_SYSTEM_H #include FT_IMAGE_H @@ -36,14 +37,15 @@ /* basic_types */ /* */ /* <Title> */ - /* Basic Types */ + /* Basic Data Types */ /* */ /* <Abstract> */ /* The basic data types defined by the library. */ /* */ /* <Description> */ /* This section contains the basic data types defined by FreeType 2, */ - /* ranging from simple scalar types to font specific ones. */ + /* ranging from simple scalar types to bitmap descriptors. More */ + /* font-specific structures are defined in a different section. */ /* */ /* <Order> */ /* FT_Byte */ @@ -57,6 +59,7 @@ /* FT_Bool */ /* FT_Offset */ /* FT_PtrDist */ + /* FT_String */ /* FT_Error */ /* FT_Fixed */ /* FT_Pointer */ @@ -64,6 +67,12 @@ /* FT_Vector */ /* FT_BBox */ /* FT_Matrix */ + /* FT_FWord */ + /* FT_UFWord */ + /* FT_F2Dot14 */ + /* FT_UnitVector */ + /* FT_F26Dot6 */ + /* */ /* */ /* FT_Generic */ /* FT_Generic_Finalizer */ @@ -73,7 +82,6 @@ /* FT_Palette_Mode */ /* FT_Glyph_Format */ /* FT_IMAGE_TAG */ - /* FT_Glyph_Format */ /* */ /*************************************************************************/ @@ -351,6 +359,27 @@ /*************************************************************************/ /* */ + /* <Struct> */ + /* FT_Data */ + /* */ + /* <Description> */ + /* Read-only binary data represented as a pointer and a length. */ + /* */ + /* <Fields> */ + /* pointer :: The data. */ + /* */ + /* length :: The length of the data in bytes. */ + /* */ + typedef struct FT_Data_ + { + const FT_Byte* pointer; + FT_Int length; + + } FT_Data; + + + /*************************************************************************/ + /* */ /* <FuncType> */ /* FT_Generic_Finalizer */ /* */ @@ -411,6 +440,10 @@ /* This macro converts four letter tags which are used to label */ /* TrueType tables into an unsigned long to be used within FreeType. */ /* */ + /* <Note> */ + /* The produced values *must* be 32bit integers. Don't redefine this */ + /* macro. */ + /* */ #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ ( ( (FT_ULong)_x1 << 24 ) | \ ( (FT_ULong)_x2 << 16 ) | \ Index: xc/extras/freetype2/include/freetype/ftwinfnt.h diff -u /dev/null xc/extras/freetype2/include/freetype/ftwinfnt.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:15 2004 +++ xc/extras/freetype2/include/freetype/ftwinfnt.h Wed May 28 22:01:45 2003 @@ -0,0 +1,129 @@ +/***************************************************************************/ +/* */ +/* ftwinfnt.h */ +/* */ +/* FreeType API for accessing Windows fnt-specific data. */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTWINFNT_H__ +#define __FTWINFNT_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* winfnt_fonts */ + /* */ + /* <Title> */ + /* Window FNT Fonts */ + /* */ + /* <Abstract> */ + /* Windows FNT specific APIs */ + /* */ + /* <Description> */ + /* This section contains the declaration of Windows FNT specific */ + /* functions. */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_WinFNT_HeaderRec_ */ + /* */ + /* <Description> */ + /* Windows FNT Header info. */ + /* */ + typedef struct FT_WinFNT_HeaderRec_ + { + FT_UShort version; + FT_ULong file_size; + FT_Byte copyright[60]; + FT_UShort file_type; + FT_UShort nominal_point_size; + FT_UShort vertical_resolution; + FT_UShort horizontal_resolution; + FT_UShort ascent; + FT_UShort internal_leading; + FT_UShort external_leading; + FT_Byte italic; + FT_Byte underline; + FT_Byte strike_out; + FT_UShort weight; + FT_Byte charset; + FT_UShort pixel_width; + FT_UShort pixel_height; + FT_Byte pitch_and_family; + FT_UShort avg_width; + FT_UShort max_width; + FT_Byte first_char; + FT_Byte last_char; + FT_Byte default_char; + FT_Byte break_char; + FT_UShort bytes_per_row; + FT_ULong device_offset; + FT_ULong face_name_offset; + FT_ULong bits_pointer; + FT_ULong bits_offset; + FT_Byte reserved; + FT_ULong flags; + FT_UShort A_space; + FT_UShort B_space; + FT_UShort C_space; + FT_UShort color_table_offset; + FT_ULong reserved1[4]; + + } FT_WinFNT_HeaderRec, *FT_WinFNT_Header; + + + + /********************************************************************** + * + * @function: + * FT_Get_WinFNT_Header + * + * @description: + * Retrieves a Windows FNT font info header. + * + * @input: + * face :: handle to input face + * + * @output: + * header :: WinFNT header. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This function only works with Windows FNT faces, returning an erro + * otherwise. + */ + FT_EXPORT( FT_Error ) + FT_Get_WinFNT_Header( FT_Face face, + FT_WinFNT_HeaderRec *header ); + + /* */ + +FT_END_HEADER + +#endif /* __FTWINFNT_H__ */ + + +/* END */ Index: xc/extras/freetype2/include/freetype/t1tables.h diff -u xc/extras/freetype2/include/freetype/t1tables.h:1.1.1.5 xc/extras/freetype2/include/freetype/t1tables.h:1.1.1.6 --- xc/extras/freetype2/include/freetype/t1tables.h:1.1.1.5 Thu Jun 20 04:16:08 2002 +++ xc/extras/freetype2/include/freetype/t1tables.h Wed May 28 22:01:45 2003 @@ -208,7 +208,7 @@ #define T1_MAX_MM_DESIGNS 16 /* maximum number of Multiple Masters axes, as defined in the spec */ -#define T1_MAX_MM_AXIS 4 +#define T1_MAX_MM_AXIS 4 /* maximum number of elements in a design map */ #define T1_MAX_MM_MAP_POINTS 20 @@ -244,6 +244,8 @@ FT_ULong blend_bitflags; + FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1]; + } PS_BlendRec, *PS_Blend; Index: xc/extras/freetype2/include/freetype/ttnameid.h diff -u xc/extras/freetype2/include/freetype/ttnameid.h:1.1.1.4 xc/extras/freetype2/include/freetype/ttnameid.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/ttnameid.h:1.1.1.4 Mon Jan 14 11:52:05 2002 +++ xc/extras/freetype2/include/freetype/ttnameid.h Wed May 28 22:01:45 2003 @@ -4,7 +4,7 @@ /* */ /* TrueType name ID definitions (specification only). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -31,34 +31,134 @@ /* Possible values for the `platform' identifier code in the name */ /* records of the TTF `name' table. */ /* */ + /*************************************************************************/ + + + /*********************************************************************** + * + * @enum: + * TT_PLATFORM_XXX + * + * @description: + * A list of valid values for the `platform_id' identifier code in + * @FT_CharmapRec and @FT_SfntName structures. + * + * @values: + * TT_PLATFORM_APPLE_UNICODE :: + * Used by Apple to indicate a Unicode character map and/or name entry. + * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note + * that name entries in this format are coded as big-endian UCS-2 + * character codes _only_. + * + * TT_PLATFORM_MACINTOSH :: + * Used by Apple to indicate a MacOS-specific charmap and/or name entry. + * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that + * most TrueType fonts contain an Apple roman charmap to be usable on + * MacOS systems (even if they contain a Microsoft charmap as well). + * + * TT_PLATFORM_ISO :: + * This value was used to specify Unicode charmaps. It is however + * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding + * `encoding_id' values. + * + * TT_PLATFORM_MICROSOFT :: + * Used by Microsoft to indicate Windows-specific charmaps. See + * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values. + * Note that most fonts contain a Unicode charmap using + * (@TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS). + * + * TT_PLATFORM_CUSTOM :: + * Used to indicate application-specific charmaps. + * + * TT_PLATFORM_ADOBE :: + * This value isn't part of any font format specification, but is used + * by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec + * structure. See @TT_ADOBE_ID_XXX. + */ + #define TT_PLATFORM_APPLE_UNICODE 0 #define TT_PLATFORM_MACINTOSH 1 #define TT_PLATFORM_ISO 2 /* deprecated */ #define TT_PLATFORM_MICROSOFT 3 #define TT_PLATFORM_CUSTOM 4 +#define TT_PLATFORM_ADOBE 7 /* artificial */ - /* artificial values defined ad-hoc by FreeType */ -#define TT_PLATFORM_ADOBE 7 + /*********************************************************************** + * + * @enum: + * TT_APPLE_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries. + * + * @values: + * TT_APPLE_ID_DEFAULT :: + * Unicode version 1.0. + * TT_APPLE_ID_UNICODE_1_1 :: + * Unicode 1.1; specifies Hangul characters starting at U+34xx. + * TT_APPLE_ID_ISO_10646 :: + * Deprecated (identical to preceding.) + * TT_APPLE_ID_UNICODE_2_0 :: + * Unicode 2.0 and beyond (UTF-16 BMP only.) + * TT_APPLE_ID_UNICODE_32 :: + * Unicode 3.1 and beyond, using UTF-32 + */ - /*************************************************************************/ - /* */ - /* Possible values of the platform specific encoding identifier field in */ - /* the name records of the TTF `name' table if the `platform' identifier */ - /* code is TT_PLATFORM_APPLE_UNICODE. */ - /* */ #define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ #define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ #define TT_APPLE_ID_ISO_10646 2 /* deprecated */ #define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ +#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ - /*************************************************************************/ - /* */ - /* Possible values of the platform specific encoding identifier field in */ - /* the name records of the TTF `name' table if the `platform' identifier */ - /* code is TT_PLATFORM_MACINTOSH. */ - /* */ + /*********************************************************************** + * + * @enum: + * TT_MAC_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_MACINTOSH charmaps and name entries. + * + * @values: + * TT_MAC_ID_ROMAN :: + * TT_MAC_ID_JAPANESE :: + * TT_MAC_ID_TRADITIONAL_CHINESE :: + * TT_MAC_ID_KOREAN :: + * TT_MAC_ID_ARABIC :: + * TT_MAC_ID_HEBREW :: + * TT_MAC_ID_GREEK :: + * TT_MAC_ID_RUSSIAN :: + * TT_MAC_ID_RSYMBOL :: + * TT_MAC_ID_DEVANAGARI :: + * TT_MAC_ID_GURMUKHI :: + * TT_MAC_ID_GUJARATI :: + * TT_MAC_ID_ORIYA :: + * TT_MAC_ID_BENGALI :: + * TT_MAC_ID_TAMIL :: + * TT_MAC_ID_TELUGU :: + * TT_MAC_ID_KANNADA :: + * TT_MAC_ID_MALAYALAM :: + * TT_MAC_ID_SINHALESE :: + * TT_MAC_ID_BURMESE :: + * TT_MAC_ID_KHMER :: + * TT_MAC_ID_THAI :: + * TT_MAC_ID_LAOTIAN :: + * TT_MAC_ID_GEORGIAN :: + * TT_MAC_ID_ARMENIAN :: + * TT_MAC_ID_MALDIVIAN :: + * TT_MAC_ID_SIMPLIFIED_CHINESE :: + * TT_MAC_ID_TIBETAN :: + * TT_MAC_ID_MONGOLIAN :: + * TT_MAC_ID_GEEZ :: + * TT_MAC_ID_SLAVIC :: + * TT_MAC_ID_VIETNAMESE :: + * TT_MAC_ID_SINDHI :: + * TT_MAC_ID_UNINTERP :: + */ + #define TT_MAC_ID_ROMAN 0 #define TT_MAC_ID_JAPANESE 1 #define TT_MAC_ID_TRADITIONAL_CHINESE 2 @@ -95,25 +195,72 @@ #define TT_MAC_ID_UNINTERP 32 - /*************************************************************************/ - /* */ - /* Possible values of the platform specific encoding identifier field in */ - /* the name records of the TTF `name' table if the `platform' identifier */ - /* code is TT_PLATFORM_ISO. */ - /* */ - /* This use is now deprecated. */ - /* */ + /*********************************************************************** + * + * @enum: + * TT_ISO_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_ISO charmaps and name entries. + * + * Their use is now deprecated. + * + * @values: + * TT_ISO_ID_7BIT_ASCII :: + * ASCII. + * TT_ISO_ID_10646 :: + * ISO/10646. + * TT_ISO_ID_8859_1 :: + * Also known as Latin-1. + */ + #define TT_ISO_ID_7BIT_ASCII 0 #define TT_ISO_ID_10646 1 #define TT_ISO_ID_8859_1 2 - /*************************************************************************/ - /* */ - /* possible values of the platform specific encoding identifier field in */ - /* the name records of the TTF `name' table if the `platform' identifier */ - /* code is TT_PLATFORM_MICROSOFT. */ - /* */ + /*********************************************************************** + * + * @enum: + * TT_MS_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_MICROSOFT charmaps and name entries. + * + * @values: + * TT_MS_ID_SYMBOL_CS :: + * Corresponds to symbol encodings. see @FT_ENCODING_MS_SYMBOL. + * + * TT_MS_ID_UNICODE_CS :: + * Corresponds to a Microsoft WGL4 charmap, matching Unicode. See + * @FT_ENCODING_UNICODE. + * + * TT_MS_ID_SJIS :: + * Corresponds to Microsoft SJIS Japanese encoding. + * See @FT_ENCODING_MS_SJIS. + * + * TT_MS_ID_GB2312 :: + * Corresponds to Microsoft Simplified Chinese as used in Mainland + * China. See @FT_ENCODING_MS_GB2312. + * + * TT_MS_ID_BIG_5 :: + * Corresponds to Microsoft Traditional Chinese as used in Taiwan and + * Hong Kong. See @FT_ENCODING_MS_BIG5. + * + * TT_MS_ID_WANSUNG :: + * Corresponds to Microsoft Korean Wansung encoding. See + * @FT_ENCODING_MS_WANSUNG. + * + * TT_MS_ID_JOHAB :: + * Corresponds to Microsoft Johab encoding. See @FT_ENCODING_MS_JOHAB. + * + * TT_MS_ID_UCS_4 :: + * Corresponds to UCS-4 or UTF-32 charmaps. This has been added into + * OpenType specification as of version 1.4 (mid-2001.) + */ + #define TT_MS_ID_SYMBOL_CS 0 #define TT_MS_ID_UNICODE_CS 1 #define TT_MS_ID_SJIS 2 @@ -124,14 +271,24 @@ #define TT_MS_ID_UCS_4 10 - /*************************************************************************/ - /* */ - /* possible values of the platform specific encoding identifier field in */ - /* the name records of the TTF `name' table if the `platform' identifier */ - /* code is TT_PLATFORM_ADOBE. */ - /* */ - /* These are artificial values defined ad-hoc by FreeType. */ - /* */ + /*********************************************************************** + * + * @enum: + * TT_ADOBE_ID_XXX + * + * @description: + * A list of valid values for the `encoding_id' for + * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension! + * + * @values: + * TT_ADOBE_ID_STANDARD :: + * Adobe standard encoding. + * TT_ADOBE_ID_EXPERT :: + * Adobe expert encoding. + * TT_ADOBE_ID_CUSTOM :: + * Adobe custom encoding. + */ + #define TT_ADOBE_ID_STANDARD 0 #define TT_ADOBE_ID_EXPERT 1 #define TT_ADOBE_ID_CUSTOM 2 @@ -286,10 +443,15 @@ /* of the TTF `name' table if the `platform' identifier code is */ /* TT_PLATFORM_MICROSOFT. */ /* */ - /* The canonical source for the MS assigned LCID's is at */ + /* The canonical source for the MS assigned LCID's used to be at */ /* */ /* http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt */ /* */ + /* Now (2002-11-15), the Microsoft site directs to */ + /* */ + /* http://www.microsoft.com/globaldev/reference/loclanghome.asp */ + /* http://support.microsoft.com/support/kb/articles/Q224/8/04.ASP */ + /* */ #define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 #define TT_MS_LANGID_ARABIC_IRAQ 0x0801 #define TT_MS_LANGID_ARABIC_EGYPT 0x0c01 @@ -545,7 +707,7 @@ /* sublanguage > 0x1F. */ #define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40a #define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40c - + #define TT_MS_LANGID_FRENCH_MOROCCO 0x380c #define TT_MS_LANGID_FRENCH_HAITI 0x3c0c #define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 @@ -630,8 +792,10 @@ /* Bit 7 Greek and Coptic */ #define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ /* Bit 8 is reserved (was: Greek Symbols and Coptic) */ - /* Bit 9 Cyrillic */ + /* Bit 9 Cyrillic + */ + /* Cyrillic Supplementary */ #define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ + /* U+0500-U+052F */ /* Bit 10 Armenian */ #define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ /* Bit 11 Hebrew */ @@ -686,10 +850,20 @@ #define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ /* Bit 36 Number Forms */ #define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ - /* Bit 37 Arrows */ + /* Bit 37 Arrows + */ + /* Supplemental Arrows-A + */ + /* Supplemental Arrows-B */ #define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ - /* Bit 38 Mathematical Operators */ + /* U+27F0-U+27FF */ + /* U+2900-U+297F */ + /* Bit 38 Mathematical Operators + */ + /* Supplemental Mathematical Operators + */ + /* Miscellaneous Mathematical Symbols-A + */ + /* Miscellaneous Mathematical Symbols-B */ #define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ + /* U+2A00-U+2AFF */ + /* U+27C0-U+27EF */ + /* U+2980-U+29FF */ /* Bit 39 Miscellaneous Technical */ #define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ /* Bit 40 Control Pictures */ @@ -715,8 +889,10 @@ #define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ /* Bit 49 Hiragana */ #define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ - /* Bit 50 Katakana */ + /* Bit 50 Katakana + */ + /* Katakana Phonetic Extensions */ #define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ + /* U+31F0-U+31FF */ /* Bit 51 Bopomofo + */ /* Bopomofo Extended */ #define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ @@ -757,11 +933,16 @@ /* Kangxi Radicals + */ /* Ideographic Description Characters + */ /* CJK Unified Ideographs Extension A */ + /* CJK Unified Ideographs Extension A + */ + /* CJK Unified Ideographs Extension B + */ + /* Kanbun */ #define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ /* U+2E80-U+2EFF */ /* U+2F00-U+2FDF */ /* U+2FF0-U+2FFF */ /* U+3400-U+4DB5 */ + /*U+20000-U+2A6DF*/ + /* U+3190-U+319F */ /* Private Use Area */ @@ -770,8 +951,10 @@ /* Compatibility Area and Specials */ - /* Bit 61 CJK Compatibility Ideographs */ + /* Bit 61 CJK Compatibility Ideographs + */ + /* CJK Compatibility Ideographs Supplement */ #define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+F900-U+FAFF */ + /*U+2F800-U+2FA1F*/ /* Bit 62 Alphabetic Presentation Forms */ #define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ /* Bit 63 Arabic Presentation Forms-A */ @@ -818,6 +1001,34 @@ /* Yi Radicals */ #define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ /* U+A490-U+A4CF */ + /* Bit 84 Tagalog + */ + /* Hanunoo + */ + /* Buhid + */ + /* Tagbanwa */ +#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ + /* U+1720-U+173F */ + /* U+1740-U+175F */ + /* U+1760-U+177F */ + /* Bit 85 Old Italic */ +#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ + /* Bit 86 Gothic */ +#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ + /* Bit 87 Deseret */ +#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ + /* Bit 88 Byzantine Musical Symbols + */ + /* Musical Symbols */ +#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ + /*U+1D100-U+1D1FF*/ + /* Bit 89 Mathematical Alphanumeric Symbols */ +#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ + /* Bit 90 Private Use (plane 15) + */ + /* Private Use (plane 16) */ +#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ + /*U+100000-U+10FFFD*/ + /* Bit 91 Variation Selectors */ +#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ + /* Bit 92 Tags */ +#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ /*************************************************************************/ Index: xc/extras/freetype2/include/freetype/tttables.h diff -u xc/extras/freetype2/include/freetype/tttables.h:1.1.1.4 xc/extras/freetype2/include/freetype/tttables.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/tttables.h:1.1.1.4 Sun Dec 16 12:49:22 2001 +++ xc/extras/freetype2/include/freetype/tttables.h Wed May 28 22:01:46 2003 @@ -593,6 +593,63 @@ FT_Get_Sfnt_Table( FT_Face face, FT_Sfnt_Tag tag ); + /************************************************************************** + * + * <Function> + * FT_Load_Sfnt_Table + * + * <Description> + * Loads any font table into client memory. + * + * <Input> + * face :: handle to source face. + * tag :: the 4-byte tag of the table to load. Use the value 0 if + * you want to access the whole font file. Else, you can use + * one of the definitions found in the @FT_TRUETYPE_TAGS_H + * file, or forge a new one with @FT_MAKE_TAG + * + * offset :: the starting offset in the table (or file if tag == 0) + * + * <Output> + * buffer :: target buffer address. client must ensure that there are + * enough bytes in it. + * + * <InOut> + * length :: if the 'length' parameter is NULL, then try to load the whole + * table, and return an error code if it fails. + * + * else, if '*length' is 0, then exit immediately while returning + * the table's (or file) full size in it. + * + * else, the number of bytes to read from the table or file, + * from the starting offset. + * + * <Return> + * error code. 0 means success + * + * <Note> + * if you need to determine the table's length you should first call this + * function with "*length" set to 0, as in the following example: + * + * { + * FT_ULong length = 0; + * + * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); + * if ( error ) { ... table does not exist ... } + * + * buffer = malloc( length ); + * if ( buffer == NULL ) { ... not enough memory ... } + * + * error = FT_Load_Sfnt_Table( face,tag, 0, buffer, &length ); + * if ( error ) { ... could not load table ... } + * } + */ + FT_EXPORT( FT_Error ) + FT_Load_Sfnt_Table( FT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ); /* */ Index: xc/extras/freetype2/include/freetype/cache/ftccache.h diff -u xc/extras/freetype2/include/freetype/cache/ftccache.h:1.1.1.2 xc/extras/freetype2/include/freetype/cache/ftccache.h:1.1.1.3 --- xc/extras/freetype2/include/freetype/cache/ftccache.h:1.1.1.2 Thu Jun 20 04:16:08 2002 +++ xc/extras/freetype2/include/freetype/cache/ftccache.h Wed May 28 22:01:46 2003 @@ -23,9 +23,6 @@ /* define to allow cache lookup inlining */ #define FTC_CACHE_USE_INLINE -/* define to use linear hash table */ -#define FTC_CACHE_USE_LINEAR_HASHING - FT_BEGIN_HEADER @@ -181,14 +178,9 @@ FT_UInt cache_index; /* in manager's table */ FT_Pointer cache_data; /* used by cache node methods */ -#ifdef FTC_CACHE_USE_LINEAR_HASHING FT_UFast p; FT_UFast mask; FT_Long slack; -#else - FT_UFast nodes; - FT_UFast size; -#endif FTC_Node* buckets; FT_LruList_ClassRec family_class; Index: xc/extras/freetype2/include/freetype/cache/ftccmap.h diff -u xc/extras/freetype2/include/freetype/cache/ftccmap.h:1.1.1.1 xc/extras/freetype2/include/freetype/cache/ftccmap.h:1.1.1.2 --- xc/extras/freetype2/include/freetype/cache/ftccmap.h:1.1.1.1 Mon Jan 14 11:52:05 2002 +++ xc/extras/freetype2/include/freetype/cache/ftccmap.h Wed May 28 22:01:46 2003 @@ -28,6 +28,13 @@ /*************************************************************************/ /* */ + /* <Section> */ + /* cache_subsystem */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ + /* */ /* @type: */ /* FTC_CmapCache */ /* */ Index: xc/extras/freetype2/include/freetype/cache/ftcimage.h diff -u xc/extras/freetype2/include/freetype/cache/ftcimage.h:1.1.1.4 xc/extras/freetype2/include/freetype/cache/ftcimage.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/cache/ftcimage.h:1.1.1.4 Mon Jan 14 11:52:06 2002 +++ xc/extras/freetype2/include/freetype/cache/ftcimage.h Wed May 28 22:01:46 2003 @@ -4,7 +4,7 @@ /* */ /* FreeType Image cache (specification). */ /* */ -/* Copyright 2000-2001 by */ +/* Copyright 2000-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -53,65 +53,43 @@ /*************************************************************************/ -#define FTC_IMAGE_FORMAT( x ) ( (x) & 7 ) - - -#define ftc_image_format_bitmap 0x0000 -#define ftc_image_format_outline 0x0001 - -#define ftc_image_format_mask 0x000F - -#define ftc_image_flag_monochrome 0x0010 -#define ftc_image_flag_unhinted 0x0020 -#define ftc_image_flag_autohinted 0x0040 -#define ftc_image_flag_unscaled 0x0080 -#define ftc_image_flag_no_sbits 0x0100 - - /* monochrome bitmap */ -#define ftc_image_mono ftc_image_format_bitmap | \ - ftc_image_flag_monochrome - - /* anti-aliased bitmap */ -#define ftc_image_grays ftc_image_format_bitmap - - /* scaled outline */ -#define ftc_image_outline ftc_image_format_outline - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FTC_ImageDesc */ - /* */ - /* <Description> */ - /* A simple structure used to describe a given glyph image category. */ - /* Note that this is different from @FTC_Image_Desc. */ - /* */ - /* <Fields> */ - /* size :: An @FTC_SizeRec used to describe the glyph's face and */ - /* size. */ - /* */ - /* type :: The glyph image's type. Note that it is a 32-bit uint. */ - /* */ - /* <Note> */ - /* This type deprecates @FTC_Image_Desc. */ - /* */ - typedef struct FTC_ImageDesc_ + /************************************************************************** + * + * @struct: + * FTC_ImageTypeRec + * + * @description: + * A simple structure used to describe the type of glyph image to be + * loaded into the cache. + * + * @fields: + * font :: An @FTC_FontRec used to describe the glyph's face and size. + * + * flags :: The load flags to be applied when loading the glyph; see + * the @FT_LOAD_XXX constants for details. + * + * @note: + * This type completely replaces the @FTC_Image_Desc structure which is + * now obsolete. + */ + typedef struct FTC_ImageTypeRec_ { FTC_FontRec font; - FT_UInt32 type; + FT_Int32 flags; - } FTC_ImageDesc; + } FTC_ImageTypeRec; + + typedef struct FTC_ImageTypeRec_* FTC_ImageType; /* */ -#define FTC_IMAGE_DESC_COMPARE( d1, d2 ) \ +#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \ ( FTC_FONT_COMPARE( &(d1)->font, &(d2)->font ) && \ - (d1)->type == (d2)->type ) + (d1)->flags == (d2)->flags ) -#define FTC_IMAGE_DESC_HASH( d ) \ +#define FTC_IMAGE_TYPE_HASH( d ) \ (FT_UFast)( FTC_FONT_HASH( &(d)->font ) ^ \ - ( (d)->type << 4 ) ) + ( (d)->flags << 4 ) ) /*************************************************************************/ @@ -160,7 +138,7 @@ /* <Input> */ /* cache :: A handle to the source glyph image cache. */ /* */ - /* desc :: A pointer to a glyph image descriptor. */ + /* type :: A pointer to a glyph image type descriptor. */ /* */ /* gindex :: The glyph index to retrieve. */ /* */ @@ -193,13 +171,36 @@ /* */ FT_EXPORT( FT_Error ) FTC_ImageCache_Lookup( FTC_ImageCache cache, - FTC_ImageDesc* desc, + FTC_ImageType type, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); /* */ +#define ftc_image_format( x ) ( (x) & 7 ) + + +#define ftc_image_format_bitmap 0x0000 +#define ftc_image_format_outline 0x0001 + +#define ftc_image_format_mask 0x000F + +#define ftc_image_flag_monochrome 0x0010 +#define ftc_image_flag_unhinted 0x0020 +#define ftc_image_flag_autohinted 0x0040 +#define ftc_image_flag_unscaled 0x0080 +#define ftc_image_flag_no_sbits 0x0100 + + /* monochrome bitmap */ +#define ftc_image_mono ftc_image_format_bitmap | \ + ftc_image_flag_monochrome + + /* anti-aliased bitmap */ +#define ftc_image_grays ftc_image_format_bitmap + + /* scaled outline */ +#define ftc_image_outline ftc_image_format_outline /*************************************************************************/ /* */ Index: xc/extras/freetype2/include/freetype/cache/ftcsbits.h diff -u xc/extras/freetype2/include/freetype/cache/ftcsbits.h:1.1.1.5 xc/extras/freetype2/include/freetype/cache/ftcsbits.h:1.1.1.6 --- xc/extras/freetype2/include/freetype/cache/ftcsbits.h:1.1.1.5 Thu Jun 20 04:16:09 2002 +++ xc/extras/freetype2/include/freetype/cache/ftcsbits.h Wed May 28 22:01:46 2003 @@ -4,7 +4,7 @@ /* */ /* A small-bitmap cache (specification). */ /* */ -/* Copyright 2000-2001 by */ +/* Copyright 2000-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -72,7 +72,7 @@ /* */ /* format :: The format of the glyph bitmap (monochrome or gray). */ /* */ - /* num_grays :: The number of gray levels. */ + /* max_grays :: Maximum gray level value (in the range 1 to 255). */ /* */ /* pitch :: The number of bytes per bitmap line. May be positive */ /* or negative. */ @@ -91,8 +91,8 @@ FT_Char top; FT_Byte format; - FT_Short num_grays; /* XXX: Should be FT_Byte. See ftcsbits.c */ - FT_Char pitch; + FT_Byte max_grays; + FT_Short pitch; FT_Char xadvance; FT_Char yadvance; @@ -113,7 +113,7 @@ /* implemented by @FTC_ImageCache. */ /* */ typedef struct FTC_SBitCacheRec_* FTC_SBitCache; - + /*************************************************************************/ /* */ @@ -160,7 +160,7 @@ /* <Input> */ /* cache :: A handle to the source sbit cache. */ /* */ - /* desc :: A pointer to the glyph image descriptor. */ + /* type :: A pointer to the glyph image type descriptor. */ /* */ /* gindex :: The glyph index. */ /* */ @@ -195,7 +195,7 @@ /* */ FT_EXPORT( FT_Error ) FTC_SBitCache_Lookup( FTC_SBitCache cache, - FTC_ImageDesc* desc, + FTC_ImageType type, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); Index: xc/extras/freetype2/include/freetype/config/ftconfig.h diff -u xc/extras/freetype2/include/freetype/config/ftconfig.h:1.4 xc/extras/freetype2/include/freetype/config/ftconfig.h:1.5 --- xc/extras/freetype2/include/freetype/config/ftconfig.h:1.4 Tue Jan 7 13:41:00 2003 +++ xc/extras/freetype2/include/freetype/config/ftconfig.h Wed Oct 22 14:51:24 2003 @@ -14,7 +14,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ - +/* $XFree86: xc/extras/freetype2/include/freetype/config/ftconfig.h,v 1.5 2003/10/22 18:51:24 tsi Exp $ */ /*************************************************************************/ /* */ Index: xc/extras/freetype2/include/freetype/config/ftheader.h diff -u xc/extras/freetype2/include/freetype/config/ftheader.h:1.1.1.5 xc/extras/freetype2/include/freetype/config/ftheader.h:1.1.1.6 --- xc/extras/freetype2/include/freetype/config/ftheader.h:1.1.1.5 Thu Jun 20 04:16:09 2002 +++ xc/extras/freetype2/include/freetype/config/ftheader.h Wed May 28 22:01:46 2003 @@ -18,7 +18,7 @@ #ifndef __FT_HEADER_H__ #define __FT_HEADER_H__ - /*************************************************************************/ + /*@***********************************************************************/ /* */ /* <Macro> */ /* FT_BEGIN_HEADER */ @@ -36,7 +36,7 @@ #endif - /*************************************************************************/ + /*@***********************************************************************/ /* */ /* <Macro> */ /* FT_END_HEADER */ @@ -361,6 +361,28 @@ /* */ #define FT_BDF_H <freetype/ftbdf.h> + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_GZIP_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the definitions of an API to support for gzip-compressed files. */ + /* */ +#define FT_GZIP_H <freetype/ftgzip.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_WINFONTS_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the definitions of an API to support Windows .FNT files */ + /* */ +#define FT_WINFONTS_H <freetype/ftwinfnt.h> /*************************************************************************/ /* */ @@ -487,6 +509,7 @@ /* */ #define FT_TRIGONOMETRY_H <freetype/fttrigon.h> +#define FT_STROKER_H <freetype/ftstroker.h> #define FT_SYNTHESIS_H <freetype/ftsynth.h> #define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h> @@ -498,6 +521,8 @@ #define FT_XFREE86_H <freetype/ftxf86.h> +#define FT_INCREMENTAL_H <freetype/ftincrem.h> + /* now include internal headers definitions from <freetype/internal/...> */ #define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h> Index: xc/extras/freetype2/include/freetype/config/ftmodule.h diff -u xc/extras/freetype2/include/freetype/config/ftmodule.h:1.1.1.4 xc/extras/freetype2/include/freetype/config/ftmodule.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/config/ftmodule.h:1.1.1.4 Thu Jun 20 04:16:09 2002 +++ xc/extras/freetype2/include/freetype/config/ftmodule.h Wed May 28 22:01:46 2003 @@ -9,8 +9,11 @@ FT_USE_MODULE(ft_raster1_renderer_class) FT_USE_MODULE(sfnt_module_class) FT_USE_MODULE(ft_smooth_renderer_class) +FT_USE_MODULE(ft_smooth_lcd_renderer_class) +FT_USE_MODULE(ft_smooth_lcdv_renderer_class) FT_USE_MODULE(tt_driver_class) FT_USE_MODULE(t1_driver_class) FT_USE_MODULE(t42_driver_class) FT_USE_MODULE(pfr_driver_class) FT_USE_MODULE(winfnt_driver_class) + Index: xc/extras/freetype2/include/freetype/config/ftoption.h diff -u xc/extras/freetype2/include/freetype/config/ftoption.h:1.5 xc/extras/freetype2/include/freetype/config/ftoption.h:1.7 --- xc/extras/freetype2/include/freetype/config/ftoption.h:1.5 Thu Jun 20 04:25:26 2002 +++ xc/extras/freetype2/include/freetype/config/ftoption.h Wed Oct 22 14:51:24 2003 @@ -1,4 +1,3 @@ -/* $XFree86: xc/extras/freetype2/include/freetype/config/ftoption.h,v 1.5 2002/06/20 08:25:26 keithp Exp $ */ /***************************************************************************/ /* */ /* ftoption.h */ @@ -26,7 +25,6 @@ FT_BEGIN_HEADER - /*************************************************************************/ /* */ /* USER-SELECTABLE CONFIGURATION MACROS */ @@ -79,68 +77,98 @@ /*************************************************************************/ /* */ - /* CMap support */ + /* Many compilers provide a non-ANSI 64-bit data type that can be used */ + /* by FreeType to speed up some computations. However, this will create */ + /* some problems when compiling the library in strict ANSI mode. */ + /* */ + /* For this reason, the use of 64-bit ints is normally disabled when */ + /* the __STDC__ macro is defined. You can however disable this by */ + /* defining here the macro FT_CONFIG_OPTION_FORCE_INT64. */ + /* */ + /* For most compilers, this will only create compilation warnings */ + /* when building the library. */ /* */ - /* Define this if you want generic cmap support. */ + /* ObNote: The compiler-specific 64-bit integers are detected in the */ + /* file "ftconfig.h" either statically, or through Autoconf */ + /* on platforms that support it. */ /* */ -#define FT_CONFIG_OPTION_USE_CMAPS +#undef FT_CONFIG_OPTION_FORCE_INT64 /*************************************************************************/ /* */ - /* Convenience functions support */ + /* Gzip-compressed file support. */ /* */ - /* Some functions of the FreeType 2 API are provided as a convenience */ - /* for client applications and developers. However, they are not */ - /* required to build and run the library itself. */ + /* FreeType now handles font files that have been compressed with the */ + /* 'gzip' program. This is mostly used to parse many of the PCF files */ + /* that come with XFree86. The implementation uses 'zlib' to */ + /* partially uncompress the file on the fly (see src/base/ftgzip.c). */ /* */ - /* By defining this configuration macro, you'll disable the */ - /* compilation of these functions at build time. This can be useful */ - /* to reduce the library's code size when you don't need any of */ - /* these functions. */ + /* Define this macro if you want to enable this "feature". Note that */ + /* this will however force you to link the zlib to any program that */ + /* also uses FreeType. */ /* */ - /* All convenience functions are declared as such in their */ - /* documentation. */ - /* */ -#undef FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS +#define FT_CONFIG_OPTION_USE_ZLIB /*************************************************************************/ /* */ - /* Module errors */ + /* ZLib library selection */ /* */ - /* If this macro is set (which is _not_ the default), the higher byte */ - /* of an error code gives the module in which the error has occurred, */ - /* while the lower byte is the real error code. */ + /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */ + /* It allows FreeType's "ftgzip" component to link to the system's */ + /* installation of the ZLib library. This is useful on systems like */ + /* Unix or VMS where it generally is already available. */ /* */ - /* Setting this macro makes sense for debugging purposes only, since */ - /* it would break source compatibility of certain programs that use */ - /* FreeType 2. */ + /* If you let it undefined, the component will use its own copy */ + /* of the zlib sources instead. These have been modified to be */ + /* included directly within the component and *not* export external */ + /* function names. This allows you to link any program with FreeType */ + /* _and_ ZLib without linking conflicts. */ /* */ - /* More details can be found in the files ftmoderr.h and fterrors.h. */ + /* do not #undef this macro here, since the build system might */ + /* define for certain configurations */ /* */ -#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS +/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ /*************************************************************************/ /* */ - /* Alternate Glyph Image Format support */ + /* DLL export compilation */ + /* */ + /* When compiling FreeType as a DLL, some systems/compilers need a */ + /* special keyword in front OR after the return type of function */ + /* declarations. */ + /* */ + /* Two macros are used within the FreeType source code to define */ + /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ /* */ - /* By default, the glyph images returned by the FreeType glyph loader */ - /* can either be a pixmap or a vectorial outline defined through */ - /* Bezier control points. When defining the following configuration */ - /* macro, some font drivers will be able to register alternate */ - /* glyph image formats. */ - /* */ - /* Unset this macro if you are sure that you will never use a font */ - /* driver with an alternate glyph format; this will reduce the size of */ - /* the base layer code. */ - /* */ - /* Note that a few Type 1 fonts, as well as Windows `vector' fonts */ - /* use a vector `plotter' format that isn't supported when this */ - /* macro is undefined. */ + /* FT_EXPORT( return_type ) */ + /* */ + /* is used in a function declaration, as in */ /* */ -#define FT_CONFIG_OPTION_ALTERNATE_GLYPH_FORMATS + /* FT_EXPORT( FT_Error ) */ + /* FT_Init_FreeType( FT_Library* alibrary ); */ + /* */ + /* */ + /* FT_EXPORT_DEF( return_type ) */ + /* */ + /* is used in a function definition, as in */ + /* */ + /* FT_EXPORT_DEF( FT_Error ) */ + /* FT_Init_FreeType( FT_Library* alibrary ) */ + /* { */ + /* ... some code ... */ + /* return FT_Err_Ok; */ + /* } */ + /* */ + /* You can provide your own implementation of FT_EXPORT and */ + /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */ + /* will be later automatically defined as `extern return_type' to */ + /* allow normal compilation. */ + /* */ +/* #define FT_EXPORT(x) extern x */ +/* #define FT_EXPORT_DEF(x) x */ /*************************************************************************/ @@ -188,61 +216,33 @@ /*************************************************************************/ /* */ - /* Many compilers provide a non-ANSI 64-bit data type that can be used */ - /* by FreeType to speed up some computations. However, this will create */ - /* some problems when compiling the library in strict ANSI mode. */ + /* Allow the use of FT_Incremental_Interface to load typefaces that */ + /* contain no glyph data, but supply it via a callback function. */ + /* This allows FreeType to be used with the PostScript language, using */ + /* the GhostScript interpreter. */ /* */ - /* For this reason, the use of 64-bit ints is normally disabled when */ - /* the __STDC__ macro is defined. You can however disable this by */ - /* defining here the macro FT_CONFIG_OPTION_FORCE_INT64. */ - /* */ - /* For most compilers, this will only create compilation warnings */ - /* when building the library. */ - /* */ - /* ObNote: The compiler-specific 64-bit integers are detected in the */ - /* file "ftconfig.h" either statically, or through Autoconf */ - /* on platforms that support it. */ - /* */ -#undef FT_CONFIG_OPTION_FORCE_INT64 +/* #define FT_CONFIG_OPTION_INCREMENTAL */ /*************************************************************************/ /* */ - /* DLL export compilation */ - /* */ - /* When compiling FreeType as a DLL, some systems/compilers need a */ - /* special keyword in front OR after the return type of function */ - /* declarations. */ - /* */ - /* Two macros are used within the FreeType source code to define */ - /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ - /* */ - /* FT_EXPORT( return_type ) */ - /* */ - /* is used in a function declaration, as in */ - /* */ - /* FT_EXPORT( FT_Error ) */ - /* FT_Init_FreeType( FT_Library* alibrary ); */ - /* */ + /* The size in bytes of the render pool used by the scan-line converter */ + /* to do all of its work. */ /* */ - /* FT_EXPORT_DEF( return_type ) */ + /* This must be greater than 4kByte. */ /* */ - /* is used in a function definition, as in */ +#define FT_RENDER_POOL_SIZE 16384L + + + /*************************************************************************/ /* */ - /* FT_EXPORT_DEF( FT_Error ) */ - /* FT_Init_FreeType( FT_Library* alibrary ) */ - /* { */ - /* ... some code ... */ - /* return FT_Err_Ok; */ - /* } */ + /* FT_MAX_MODULES */ /* */ - /* You can provide your own implementation of FT_EXPORT and */ - /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */ - /* will be later automatically defined as `extern return_type' to */ - /* allow normal compilation. */ + /* The maximum number of modules that can be registered in a single */ + /* FreeType library object. 32 is the default. */ /* */ -#undef FT_EXPORT -#undef FT_EXPORT_DEF +#define FT_MAX_MODULES 32 + /*************************************************************************/ /* */ @@ -258,8 +258,8 @@ /* */ /* Don't define any of these macros to compile in `release' mode! */ /* */ -#undef FT_DEBUG_LEVEL_ERROR -#undef FT_DEBUG_LEVEL_TRACE +/* #define FT_DEBUG_LEVEL_ERROR */ +/* #define FT_DEBUG_LEVEL_TRACE */ /*************************************************************************/ @@ -274,27 +274,26 @@ /* Note that the memory debugger is only activated at runtime when */ /* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */ /* */ -#undef FT_DEBUG_MEMORY +/* #define FT_DEBUG_MEMORY */ + /*************************************************************************/ /* */ - /* The size in bytes of the render pool used by the scan-line converter */ - /* to do all of its work. */ - /* */ - /* This must be greater than 4kByte. */ + /* Module errors */ /* */ -#define FT_RENDER_POOL_SIZE 16384L - - - /*************************************************************************/ + /* If this macro is set (which is _not_ the default), the higher byte */ + /* of an error code gives the module in which the error has occurred, */ + /* while the lower byte is the real error code. */ /* */ - /* FT_MAX_MODULES */ + /* Setting this macro makes sense for debugging purposes only, since */ + /* it would break source compatibility of certain programs that use */ + /* FreeType 2. */ /* */ - /* The maximum number of modules that can be registered in a single */ - /* FreeType library object. 16 is the default. */ + /* More details can be found in the files ftmoderr.h and fterrors.h. */ /* */ -#define FT_MAX_MODULES 16 +#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS + /*************************************************************************/ @@ -376,7 +375,10 @@ /* By undefining this, you will only compile the code necessary to load */ /* TrueType glyphs without hinting. */ /* */ -#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + /* do not #undef this macro here, since the build system might */ + /* define for certain configurations */ + /* */ +/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ /*************************************************************************/ @@ -393,6 +395,25 @@ /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ + /* TrueType glyph loader to use Apple's definition of how to handle */ + /* component offsets in composite glyphs. */ + /* */ + /* Apple and MS disagree on the default behavior of component offsets */ + /* in composites. Apple says that they should be scaled by the scale */ + /* factors in the transformation matrix (roughly, it's more complex) */ + /* while MS says they should not. OpenType defines two bits in the */ + /* composite flags array which can be used to disambiguate, but old */ + /* fonts will not have them. */ + /* */ + /* http://partners.adobe.com/asn/developer/opentype/glyf.html */ + /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ + /* */ +#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED + + + /*************************************************************************/ /*************************************************************************/ /**** ****/ /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ @@ -430,14 +451,6 @@ /*************************************************************************/ /* */ - /* Define T1_CONFIG_OPTION_DISABLE_HINTER if you want to generate a */ - /* driver with no hinter. This can be useful to debug the parser. */ - /* */ -#undef T1_CONFIG_OPTION_DISABLE_HINTER - - - /*************************************************************************/ - /* */ /* Define this configuration macro if you want to prevent the */ /* compilation of `t1afm', which is in charge of reading Type 1 AFM */ /* files into an existing face. Note that if set, the T1 driver will be */ @@ -456,6 +469,25 @@ /* */ +/* + * the FT_CONFIG_OPTION_CHESTER_XXXX macros are used to toggle some recent + * improvements to the auto-hinter contributed by David Chester. They will + * most likely disappear completely in the next release. For now, you should + * always keep them defined + * + */ +#define FT_CONFIG_OPTION_CHESTER_HINTS + +#ifdef FT_CONFIG_OPTION_CHESTER_HINTS + +# define FT_CONFIG_CHESTER_SMALL_F +# define FT_CONFIG_CHESTER_ASCENDER +# define FT_CONFIG_CHESTER_SERIF +# define FT_CONFIG_CHESTER_STEM +# define FT_CONFIG_CHESTER_BLUE_SCALE + +#endif /* FT_CONFIG_OPTION_CHESTER_HINTS */ + FT_END_HEADER Index: xc/extras/freetype2/include/freetype/internal/autohint.h diff -u xc/extras/freetype2/include/freetype/internal/autohint.h:1.1.1.4 xc/extras/freetype2/include/freetype/internal/autohint.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/internal/autohint.h:1.1.1.4 Thu Jun 20 04:16:09 2002 +++ xc/extras/freetype2/include/freetype/internal/autohint.h Wed May 28 22:01:46 2003 @@ -176,7 +176,7 @@ FT_GlyphSlot slot, FT_Size size, FT_UInt glyph_index, - FT_ULong load_flags ); + FT_Int32 load_flags ); /*************************************************************************/ Index: xc/extras/freetype2/include/freetype/internal/bdftypes.h diff -u xc/extras/freetype2/include/freetype/internal/bdftypes.h:1.1.1.1 xc/extras/freetype2/include/freetype/internal/bdftypes.h:1.1.1.2 --- xc/extras/freetype2/include/freetype/internal/bdftypes.h:1.1.1.1 Thu Jun 20 04:16:09 2002 +++ xc/extras/freetype2/include/freetype/internal/bdftypes.h Wed May 28 22:01:46 2003 @@ -29,6 +29,7 @@ #include <ft2build.h> #include FT_FREETYPE_H +#include FT_BDF_H FT_BEGIN_HEADER @@ -44,6 +45,10 @@ } BDF_Public_FaceRec, *BDF_Public_Face; + typedef FT_Error (*BDF_GetPropertyFunc)( FT_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ); + FT_END_HEADER Index: xc/extras/freetype2/include/freetype/internal/cfftypes.h diff -u xc/extras/freetype2/include/freetype/internal/cfftypes.h:1.1.1.4 xc/extras/freetype2/include/freetype/internal/cfftypes.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/internal/cfftypes.h:1.1.1.4 Thu Jun 20 04:16:09 2002 +++ xc/extras/freetype2/include/freetype/internal/cfftypes.h Wed May 28 22:01:46 2003 @@ -68,8 +68,9 @@ FT_UInt format; FT_ULong offset; - FT_UShort* sids; - FT_UShort* codes; + FT_UInt count; + FT_UShort sids [256]; /* avoid dynamic allocations */ + FT_UShort codes[256]; } CFF_EncodingRec, *CFF_Encoding; @@ -241,6 +242,9 @@ /* interface to PostScript hinter */ void* pshinter; + /* interface to Postscript Names service */ + void* psnames; + } CFF_FontRec, *CFF_Font; Index: xc/extras/freetype2/include/freetype/internal/fnttypes.h diff -u xc/extras/freetype2/include/freetype/internal/fnttypes.h:1.1.1.4 xc/extras/freetype2/include/freetype/internal/fnttypes.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/internal/fnttypes.h:1.1.1.4 Thu Jun 20 04:16:09 2002 +++ xc/extras/freetype2/include/freetype/internal/fnttypes.h Wed May 28 22:01:46 2003 @@ -23,6 +23,7 @@ #include <ft2build.h> #include FT_FREETYPE_H +#include FT_WINFONTS_H FT_BEGIN_HEADER @@ -71,57 +72,15 @@ #define WINFNT_NE_MAGIC 0x454E - typedef struct WinFNT_HeaderRec_ - { - FT_UShort version; - FT_ULong file_size; - FT_Byte copyright[60]; - FT_UShort file_type; - FT_UShort nominal_point_size; - FT_UShort vertical_resolution; - FT_UShort horizontal_resolution; - FT_UShort ascent; - FT_UShort internal_leading; - FT_UShort external_leading; - FT_Byte italic; - FT_Byte underline; - FT_Byte strike_out; - FT_UShort weight; - FT_Byte charset; - FT_UShort pixel_width; - FT_UShort pixel_height; - FT_Byte pitch_and_family; - FT_UShort avg_width; - FT_UShort max_width; - FT_Byte first_char; - FT_Byte last_char; - FT_Byte default_char; - FT_Byte break_char; - FT_UShort bytes_per_row; - FT_ULong device_offset; - FT_ULong face_name_offset; - FT_ULong bits_pointer; - FT_ULong bits_offset; - FT_Byte reserved; - FT_ULong flags; - FT_UShort A_space; - FT_UShort B_space; - FT_UShort C_space; - FT_UShort color_table_offset; - FT_Byte reserved2[4]; - - } WinFNT_HeaderRec, *WinFNT_Header; - - typedef struct FNT_FontRec_ { - FT_ULong offset; - FT_Int size_shift; + FT_ULong offset; + FT_Int size_shift; - WinFNT_HeaderRec header; + FT_WinFNT_HeaderRec header; - FT_Byte* fnt_frame; - FT_ULong fnt_size; + FT_Byte* fnt_frame; + FT_ULong fnt_size; } FNT_FontRec, *FNT_Font; Index: xc/extras/freetype2/include/freetype/internal/ftdebug.h diff -u xc/extras/freetype2/include/freetype/internal/ftdebug.h:1.7 xc/extras/freetype2/include/freetype/internal/ftdebug.h:1.8 --- xc/extras/freetype2/include/freetype/internal/ftdebug.h:1.7 Thu Jun 20 04:25:27 2002 +++ xc/extras/freetype2/include/freetype/internal/ftdebug.h Wed May 28 22:13:03 2003 @@ -13,6 +13,11 @@ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ +/* */ +/* IMPORTANT: A description of FreeType's debugging support can be */ +/* found in "docs/DEBUG.TXT". Read it if you need to use or */ +/* understand this code. */ +/* */ /***************************************************************************/ @@ -47,10 +52,10 @@ #define FT_TRACE_DEF( x ) trace_ ## x , - /* defining the enumeration */ + /* defining the enumeration */ typedef enum { -#include FT_INTERNAL_TRACE_H +#include FT_INTERNAL_TRACE_H trace_count } FT_Trace; Index: xc/extras/freetype2/include/freetype/internal/ftdriver.h diff -u xc/extras/freetype2/include/freetype/internal/ftdriver.h:1.1.1.5 xc/extras/freetype2/include/freetype/internal/ftdriver.h:1.1.1.6 --- xc/extras/freetype2/include/freetype/internal/ftdriver.h:1.1.1.5 Thu Jun 20 04:16:09 2002 +++ xc/extras/freetype2/include/freetype/internal/ftdriver.h Wed May 28 22:01:46 2003 @@ -68,7 +68,7 @@ (*FT_Slot_LoadFunc)( FT_GlyphSlot slot, FT_Size size, FT_UInt glyph_index, - FT_Int load_flags ); + FT_Int32 load_flags ); typedef FT_UInt @@ -186,12 +186,10 @@ FT_Size_ResetPixelsFunc set_pixel_sizes; FT_Slot_LoadFunc load_glyph; - FT_CharMap_CharIndexFunc get_char_index; FT_Face_GetKerningFunc get_kerning; FT_Face_AttachFunc attach_file; FT_Face_GetAdvancesFunc get_advances; - FT_CharMap_CharNextFunc get_next_char; } FT_Driver_ClassRec, *FT_Driver_Class; Index: xc/extras/freetype2/include/freetype/internal/ftexcept.h diff -u xc/extras/freetype2/include/freetype/internal/ftexcept.h:1.2 xc/extras/freetype2/include/freetype/internal/ftexcept.h:1.3 --- xc/extras/freetype2/include/freetype/internal/ftexcept.h:1.2 Fri Oct 25 11:01:04 2002 +++ xc/extras/freetype2/include/freetype/internal/ftexcept.h Wed Oct 22 14:51:24 2003 @@ -1,3 +1,4 @@ +/* $XFree86: xc/extras/freetype2/include/freetype/internal/ftexcept.h,v 1.3 2003/10/22 18:51:24 tsi Exp $ */ #ifndef __FT_EXCEPT_H__ #define __FT_EXCEPT_H__ Index: xc/extras/freetype2/include/freetype/internal/ftextend.h diff -u xc/extras/freetype2/include/freetype/internal/ftextend.h:1.1.1.3 xc/extras/freetype2/include/freetype/internal/ftextend.h:removed --- xc/extras/freetype2/include/freetype/internal/ftextend.h:1.1.1.3 Sun Dec 16 12:49:23 2001 +++ xc/extras/freetype2/include/freetype/internal/ftextend.h Sat Feb 28 21:40:16 2004 @@ -1,211 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftextend.h */ -/* */ -/* FreeType extensions implementation (specification). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTEXTEND_H__ -#define __FTEXTEND_H__ - - -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* The extensions don't need to be integrated at compile time into the */ - /* engine, only at link time. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Extension_Initializer */ - /* */ - /* <Description> */ - /* Each new face object can have several extensions associated with */ - /* it at creation time. This function is used to initialize given */ - /* extension data for a given face. */ - /* */ - /* <InOut> */ - /* ext :: A typeless pointer to the extension data. */ - /* */ - /* face :: A handle to the source face object the extension is */ - /* associated with. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* In case of error, the initializer should not destroy the extension */ - /* data, as the finalizer will get called later by the function's */ - /* caller. */ - /* */ - typedef FT_Error - (*FT_Extension_Initializer)( void* ext, - FT_Face face ); - - - /*************************************************************************/ - /* */ - /* <FuncType> */ - /* FT_Extension_Finalizer */ - /* */ - /* <Description> */ - /* Each new face object can have several extensions associated with */ - /* it at creation time. This function is used to finalize given */ - /* extension data for a given face; it occurs before the face object */ - /* itself is finalized. */ - /* */ - /* <InOut> */ - /* ext :: A typeless pointer to the extension data. */ - /* */ - /* face :: A handle to the source face object the extension is */ - /* associated with. */ - /* */ - typedef void - (*FT_Extension_Finalizer)( void* ext, - FT_Face face ); - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Extension_Class */ - /* */ - /* <Description> */ - /* A simple structure used to describe a given extension to the */ - /* FreeType base layer. An FT_Extension_Class is used as a parameter */ - /* for FT_Register_Extension(). */ - /* */ - /* <Fields> */ - /* id :: The extension's ID. This is a normal C string that */ - /* is used to uniquely reference the extension's */ - /* interface. */ - /* */ - /* size :: The size in bytes of the extension data that must be */ - /* associated with each face object. */ - /* */ - /* init :: A pointer to the extension data's initializer. */ - /* */ - /* finalize :: A pointer to the extension data's finalizer. */ - /* */ - /* interface :: This pointer can be anything, but should usually */ - /* point to a table of function pointers which implement */ - /* the extension's interface. */ - /* */ - /* offset :: This field is set and used within the base layer and */ - /* should be set to 0 when registering an extension */ - /* through FT_Register_Extension(). It contains an */ - /* offset within the face's extension block for the */ - /* current extension's data. */ - /* */ - typedef struct FT_Extension_Class_ - { - const char* id; - FT_ULong size; - FT_Extension_Initializer init; - FT_Extension_Finalizer finalize; - void* interface; - - FT_ULong offset; - - } FT_Extension_Class; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Register_Extension */ - /* */ - /* <Description> */ - /* Registers a new extension. */ - /* */ - /* <InOut> */ - /* driver :: A handle to the driver object. */ - /* */ - /* class :: A pointer to a class describing the extension. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - FT_EXPORT( FT_Error ) - FT_Register_Extension( FT_Driver driver, - FT_Extension_Class* clazz ); - - -#ifdef FT_CONFIG_OPTION_EXTEND_ENGINE - - - /* Initialize the extension component */ - FT_LOCAL FT_Error - FT_Init_Extensions( FT_Library library ); - - /* Finalize the extension component */ - FT_LOCAL FT_Error - FT_Done_Extensions( FT_Library library ); - - /* Create an extension within a face object. Called by the */ - /* face object constructor. */ - FT_LOCAL FT_Error - FT_Create_Extensions( FT_Face face ); - - /* Destroy all extensions within a face object. Called by the */ - /* face object destructor. */ - FT_LOCAL FT_Error - FT_Destroy_Extensions( FT_Face face ); - - -#endif - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Get_Extension */ - /* */ - /* <Description> */ - /* Queries an extension block by an extension ID string. */ - /* */ - /* <Input> */ - /* face :: A handle to the face object. */ - /* extension_id :: An ID string identifying the extension. */ - /* */ - /* <Output> */ - /* extension_interface :: A generic pointer, usually pointing to a */ - /* table of functions implementing the */ - /* extension interface. */ - /* */ - /* <Return> */ - /* A generic pointer to the extension block. */ - /* */ - FT_EXPORT( void* ) - FT_Get_Extension( FT_Face face, - const char* extension_id, - void** extension_interface ); - - -FT_END_HEADER - -#endif /* __FTEXTEND_H__ */ - - -/* END */ Index: xc/extras/freetype2/include/freetype/internal/fthash.h diff -u xc/extras/freetype2/include/freetype/internal/fthash.h:1.1.1.1 xc/extras/freetype2/include/freetype/internal/fthash.h:1.1.1.2 --- xc/extras/freetype2/include/freetype/internal/fthash.h:1.1.1.1 Thu Jun 20 04:16:09 2002 +++ xc/extras/freetype2/include/freetype/internal/fthash.h Wed May 28 22:01:46 2003 @@ -59,7 +59,19 @@ /*********************************************************** * - * @type: FT_Hash_CompareFunc + * @type: FT_HashLookup + * + * @description: + * handle to a @FT_HashNode pointer. This is returned by + * the @ft_hash_lookup function and can later be used by + * @ft_hash_add or @ft_hash_remove + */ + typedef FT_HashNode* FT_HashLookup; + + + /*********************************************************** + * + * @type: FT_Hash_EqualFunc * * @description: * a function used to compare two nodes of the hash table @@ -72,8 +84,8 @@ * 1 iff the 'keys' in 'node1' and 'node2' are identical. * 0 otherwise. */ - typedef FT_Int (*FT_Hash_CompareFunc)( const FT_HashNode node1, - const FT_HashNode node2 ); + typedef FT_Int (*FT_Hash_EqualFunc)( FT_HashNode node1, + FT_HashNode node2 ); /*********************************************************** @@ -106,18 +118,14 @@ */ typedef struct FT_HashRec_ { - FT_Memory memory; FT_HashNode* buckets; FT_UInt p; FT_UInt mask; /* really maxp-1 */ - FT_UInt slack; - - - FT_UInt node_size; - FT_Hash_CompareFunc node_compare; - FT_Hash_ComputeFunc node_hash; + FT_Long slack; + FT_Hash_EqualFunc node_equal; + FT_Memory memory; - } FT_HashRec, *FT_Hash; + } FT_HashRec; /*********************************************************** @@ -168,36 +176,39 @@ * initialize a dynamic hash table * * @input: - * table :: handle to target hash table structure - * compare :: node comparison function - * memory :: memory manager handle used to allocate the - * buckets array within the hash table + * table :: handle to target hash table structure + * node_equal :: node comparison function + * memory :: memory manager handle used to allocate the + * buckets array within the hash table + * + * @return: + * error code. 0 means success * * @note: * the node comparison function should only compare node _keys_ * and ignore values !! with good hashing computation (which the * user must perform itself), the comparison function should be - * pretty selfom called. + * pretty seldom called. * * here is a simple example: * * { - * static int my_compare( const MyNode node1, - * const MyNode node2 ) + * static int my_equal( MyNode node1, + * MyNode node2 ) * { * // compare keys of 'node1' and 'node2' - * return strcmp( node1->key, node2->key ); + * return (strcmp( node1->key, node2->key ) == 0); * } * * .... * - * ft_hash_init( &hash, (FT_Hash_CompareFunc) my_compare, memory ); + * ft_hash_init( &hash, (FT_Hash_EqualFunc) my_compare, memory ); * .... * } */ - FT_BASE( void ) + FT_BASE( FT_Error ) ft_hash_init( FT_Hash table, - FT_Hash_CompareFunc compare, + FT_Hash_EqualFunc compare, FT_Memory memory ); @@ -257,9 +268,9 @@ * } * } */ - FT_BASE_DEF( FT_HashNode* ) + FT_BASE_DEF( FT_HashLookup ) ft_hash_lookup( FT_Hash table, - FT_HashNode keynode ) + FT_HashNode keynode ); /**************************************************************** @@ -273,10 +284,13 @@ * * @input: * table :: hash table handle - * pnode :: pointer-to-hash-node value returned by @ft_hash_lookup + * lookup :: pointer-to-hash-node value returned by @ft_hash_lookup * new_node :: handle to new hash node. All its fields must be correctly * set, including 'hash'. * + * @return: + * error code. 0 means success + * * @note: * this function should always be used _after_ a call to @ft_hash_lookup * that returns a pointer to a NULL handle. Here's an example: @@ -308,18 +322,21 @@ * * // allocate a new node - and set it up * node = (MyNode) malloc( sizeof(*node) ); + * if ( node == NULL ) ..... + * * node->hnode.hash = noderec.hnode.hash; * node->key = key; * node->value = value; * * // add it to the hash table - * ft_hash_add( table, pnode, node ); + * error = ft_hash_add( table, pnode, node ); + * if (error) .... * } */ - FT_BASE( void ) - ft_hash_add( FT_Hash table, - FT_HashNode* pnode, - FT_HashNode new_node ); + FT_BASE( FT_Error ) + ft_hash_add( FT_Hash table, + FT_HashLookup lookup, + FT_HashNode new_node ); /**************************************************************** @@ -332,7 +349,7 @@ * * @input: * table :: hash table handle - * pnode :: pointer-to-hash-node value returned by @ft_hash_lookup + * lookup :: pointer-to-hash-node value returned by @ft_hash_lookup * * @note: * this function doesn't free the node itself !! Here's an example: @@ -354,15 +371,16 @@ * node = *pnode; * if ( node != NULL ) * { - * ft_hash_remove( table, pnode ); - * free( node ); + * error = ft_hash_remove( table, pnode ); + * if ( !error ) + * free( node ); * } * } * } */ - FT_BASE( void ) - ft_hash_remove( FT_Hash table, - FT_HashNode* pnode ); + FT_BASE( FT_Error ) + ft_hash_remove( FT_Hash table, + FT_HashLookup lookup ); Index: xc/extras/freetype2/include/freetype/internal/ftobject.h diff -u xc/extras/freetype2/include/freetype/internal/ftobject.h:1.1.1.1 xc/extras/freetype2/include/freetype/internal/ftobject.h:1.1.1.2 --- xc/extras/freetype2/include/freetype/internal/ftobject.h:1.1.1.1 Thu Jun 20 04:16:10 2002 +++ xc/extras/freetype2/include/freetype/internal/ftobject.h Wed May 28 22:01:47 2003 @@ -140,14 +140,11 @@ * object :: target object handle * init_data :: optional pointer to initialization data * - * @throws: any - * - * the object is _assumed_ to be reachable from the cleanup - * stack when the constructor is called. This means that - * any exception can be thrown safely in it. + * @return: + * error code. 0 means success */ - typedef void (*FT_Object_InitFunc)( FT_Object object, - FT_Pointer init_data ); + typedef FT_Error (*FT_Object_InitFunc)( FT_Object object, + FT_Pointer init_data ); /************************************************************** * @@ -158,8 +155,6 @@ * * @input: * object :: handle to target object - * - * @throws: *never* !! */ typedef void (*FT_Object_DoneFunc)( FT_Object object ); @@ -179,12 +174,15 @@ * object sub-system.) * * magic :: a 32-bit magic number used for decoding + * super :: pointer to super class * type :: the @FT_Type descriptor of this class * memory :: the current memory manager handle * library :: the current library handle * info :: an opaque pointer to class-specific information * managed by the FreeType object sub-system * + * class_done :: the class destructor function + * * obj_size :: size of class instances in bytes * obj_init :: class instance constructor * obj_done :: class instance destructor @@ -193,11 +191,14 @@ { FT_ObjectRec object; FT_UInt32 magic; + FT_Class super; FT_Type type; FT_Memory memory; FT_Library library; FT_Pointer info; + FT_Object_DoneFunc class_done; + FT_UInt obj_size; FT_Object_InitFunc obj_init; FT_Object_DoneFunc obj_done; @@ -287,14 +288,17 @@ * * @note: * if 'obj_init' is NULL, the class will use it's parent - * constructor. + * constructor, if any * * if 'obj_done' is NULL, the class will use it's parent - * finalizer. + * finalizer, if any * * the object sub-system allocates a new class, copies * the content of its super-class into the new structure, * _then_ calls 'clazz_init'. + * + * 'class_init' and 'class_done' can be NULL, in which case + * the parent's class constructor and destructor wil be used */ typedef struct FT_TypeRec_ { @@ -336,7 +340,7 @@ * @return: * 1 iff the handle points to a valid object. 0 otherwise */ - FT_BASE_DEF( FT_Int ) + FT_BASE( FT_Int ) ft_object_check( FT_Pointer obj ); @@ -356,88 +360,174 @@ * 1 iff the handle points to a valid 'clazz' instance. 0 * otherwise. */ - FT_BASE_DEF( FT_Int ) + FT_BASE( FT_Int ) ft_object_is_a( FT_Pointer obj, FT_Class clazz ); /************************************************************** * - * @function: ft_object_new + * @function: ft_object_create * * @description: * create a new object (class instance) * + * @output: + * aobject :: new object handle. NULL in case of error + * * @input: * clazz :: object's class pointer * init_data :: optional pointer to initialization data * * @return: - * handle to new object. Cannot be NULL ! + * error code. 0 means success */ - FT_BASE_DEF( FT_Object ) - ft_object_new( FT_Class clazz, - FT_Pointer init_data ); + FT_BASE( FT_Error ) + ft_object_create( FT_Object *aobject, + FT_Class clazz, + FT_Pointer init_data ); /************************************************************** * - * @function: ft_object_create + * @function: ft_object_create_from_type * * @description: - * a variation of @ft_object_new that should be used when - * creating a new object that is owned by another object - * which is reachable from the cleanup stack. - * - * this function is a bit more akward to use but completely - * avoids push/pop pairs during object construction and is - * therefore faster. + * create a new object (class instance) from a @FT_Type * * @output: - * pobject :: new object handle + * aobject :: new object handle. NULL in case of error * * @input: - * clazz :: object's class pointer + * type :: object's type descriptor * init_data :: optional pointer to initialization data - * push :: boolean. If true, the new object is pushed - * on top of the cleanup stack. + * + * @return: + * error code. 0 means success + * + * @note: + * this function is slower than @ft_object_create + * + * this is equivalent to calling @ft_class_from_type followed by + * @ft_object_create */ - FT_BASE_DEF( void ) - ft_object_create( FT_Object *pobject, - FT_Class clazz, - FT_Pointer init_data ); + FT_BASE( FT_Error ) + ft_object_create_from_type( FT_Object *aobject, + FT_Type type, + FT_Pointer init_data, + FT_Library library ); + + + + /************************************************************** + * + * @macro FT_OBJ_CREATE (object,class,init) + * + * @description: + * a convenient macro used to create new objects. see + * @ft_object_create for details + */ +#define FT_OBJ_CREATE( _obj, _clazz, _init ) \ + ft_object_create( FT_OBJECT_P(&(_obj)), _clazz, _init ) + + + /************************************************************** + * + * @macro FT_CREATE (object,class,init) + * + * @description: + * a convenient macro used to create new objects. It also + * sets an _implicit_ local variable named "error" to the error + * code returned by the object constructor. + */ +#define FT_CREATE( _obj, _clazz, _init ) \ + FT_SET_ERROR( FT_OBJ_CREATE( _obj, _clazz, _init ) ) + + /************************************************************** + * + * @macro FT_OBJ_CREATE_FROM_TYPE (object,type,init) + * + * @description: + * a convenient macro used to create new objects. see + * @ft_object_create_from_type for details + */ +#define FT_OBJ_CREATE_FROM_TYPE( _obj, _type, _init, _lib ) \ + ft_object_create_from_type( FT_OBJECT_P(&(_obj)), _type, _init, _lib ) + + + /************************************************************** + * + * @macro FT_CREATE_FROM_TYPE (object,type,init) + * + * @description: + * a convenient macro used to create new objects. It also + * sets an _implicit_ local variable named "error" to the error + * code returned by the object constructor. + */ +#define FT_CREATE_FROM_TYPE( _obj, _type, _init, _lib ) \ + FT_SET_ERROR( FT_OBJ_CREATE_FROM_TYPE( _obj, _type, _init, _lib ) ) + + + /* */ + + /************************************************************** + * + * @function: ft_class_from_type + * + * @description: + * retrieves the class object corresponding to a given type + * descriptor. The class is created when needed + * + * @output: + * aclass :: handle to corresponding class object. NULL in + * case of error + * + * @input: + * type :: type descriptor handle + * library :: library handle + * + * @return: + * error code. 0 means success + */ + FT_BASE( FT_Error ) + ft_class_from_type( FT_Class *aclass, + FT_Type type, + FT_Library library ); + /* */ - FT_BASE_DEF( FT_Class ) - ft_class_find_by_type( FT_Type type, - FT_Memory memory ); - - FT_BASE_DEF( FT_Class ) - ft_class_find_by_name( FT_CString class_name, - FT_Memory memory ); - - FT_BASE_DEF( FT_Object ) - ft_object_new_from_type( FT_Type type, - FT_Pointer data, - FT_Memory memory ); +#include FT_INTERNAL_HASH_H - FT_BASE_DEF( void ) - ft_object_create_from_type( FT_Object *pobject, - FT_Type type, - FT_Pointer init_data, - FT_Memory memory ); + typedef struct FT_ClassHNodeRec_* FT_ClassHNode; - FT_BASE_DEF( void ) - ft_object_push( FT_Object object ); + typedef struct FT_ClassHNodeRec_ + { + FT_HashNodeRec hnode; + FT_Type type; + FT_Class clazz; - FT_BASE_DEF( void ) - ft_object_pop( FT_Object object ); + } FT_ClassHNodeRec; + + typedef struct FT_MetaClassRec_ + { + FT_ClassRec clazz; /* the meta-class is a class itself */ + FT_HashRec type_to_class; /* the type => class hash table */ - FT_BASE_DEF( void ) - ft_object_pop_destroy( FT_Object object ); + } FT_MetaClassRec, *FT_MetaClass; + /* initialize meta class */ + FT_BASE( FT_Error ) + ft_metaclass_init( FT_MetaClass meta, + FT_Library library ); + + /* finalize meta class - destroy all registered class objects */ + FT_BASE( void ) + ft_metaclass_done( FT_MetaClass meta ); + + /* */ + FT_END_HEADER #endif /* __FT_OBJECT_H__ */ Index: xc/extras/freetype2/include/freetype/internal/ftobjs.h diff -u xc/extras/freetype2/include/freetype/internal/ftobjs.h:1.1.1.6 xc/extras/freetype2/include/freetype/internal/ftobjs.h:1.1.1.7 --- xc/extras/freetype2/include/freetype/internal/ftobjs.h:1.1.1.6 Thu Jun 20 04:16:10 2002 +++ xc/extras/freetype2/include/freetype/internal/ftobjs.h Wed May 28 22:01:47 2003 @@ -34,6 +34,11 @@ #include FT_INTERNAL_GLYPH_LOADER_H #include FT_INTERNAL_DRIVER_H #include FT_INTERNAL_AUTOHINT_H +#include FT_INTERNAL_OBJECT_H + +#ifdef FT_CONFIG_OPTION_INCREMENTAL +#include FT_INCREMENTAL_H +#endif FT_BEGIN_HEADER @@ -291,8 +296,19 @@ /* transform_flags :: Some flags used to classify the transform. */ /* Only used by the convenience functions. */ /* */ + /* hint_flags :: Some flags used to change the hinters' */ + /* behaviour. Only used for debugging for now. */ + /* */ /* postscript_name :: Postscript font name for this face. */ /* */ + /* incremental_interface :: */ + /* If non-null, the interface through */ + /* which glyph data and metrics are loaded */ + /* incrementally for faces that do not provide */ + /* all of this data when first opened. */ + /* This field exists only if */ + /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */ + /* */ typedef struct FT_Face_InternalRec_ { FT_UShort max_points; @@ -302,8 +318,14 @@ FT_Vector transform_delta; FT_Int transform_flags; + FT_UInt32 hint_flags; + const char* postscript_name; +#ifdef FT_CONFIG_OPTION_INCREMENTAL + FT_Incremental_InterfaceRec* incremental_interface; +#endif + } FT_Face_InternalRec; @@ -440,6 +462,8 @@ FT_Get_Module_Interface( FT_Library library, const char* mod_name ); + /* */ + /*************************************************************************/ /*************************************************************************/ @@ -512,6 +536,30 @@ FT_BASE( void ) FT_Done_GlyphSlot( FT_GlyphSlot slot ); + /* */ + + /* + * free the bitmap of a given glyphslot when needed + * (i.e. only when it was allocated with ft_glyphslot_alloc_bitmap) + */ + FT_BASE( void ) + ft_glyphslot_free_bitmap( FT_GlyphSlot slot ); + + /* + * allocate a new bitmap buffer in a glyph slot + */ + FT_BASE( FT_Error ) + ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot, + FT_ULong size ); + + /* + * set the bitmap buffer in a glyph slot to a given pointer. + * the buffer will not be freed by a later call to ft_glyphslot_free_bitmap + */ + FT_BASE( void ) + ft_glyphslot_set_bitmap( FT_GlyphSlot slot, + FT_Pointer buffer ); + /*************************************************************************/ /*************************************************************************/ @@ -534,14 +582,14 @@ typedef struct FT_RendererRec_ { - FT_ModuleRec root; - FT_Renderer_Class* clazz; - FT_Glyph_Format glyph_format; - FT_Glyph_Class glyph_class; - - FT_Raster raster; - FT_Raster_Render_Func raster_render; - FTRenderer_render render; + FT_ModuleRec root; + FT_Renderer_Class* clazz; + FT_Glyph_Format glyph_format; + FT_Glyph_Class glyph_class; + + FT_Raster raster; + FT_Raster_Render_Func raster_render; + FT_Renderer_RenderFunc render; } FT_RendererRec; @@ -656,7 +704,7 @@ /* shortcut used to avoid parsing the list on */ /* each call to FT_Outline_Render(). It is a */ /* handle to the current renderer for the */ - /* ft_glyph_format_outline format. */ + /* FT_GLYPH_FORMAT_OUTLINE format. */ /* */ /* auto_hinter :: XXX */ /* */ @@ -690,6 +738,8 @@ FT_DebugHook_Func debug_hooks[4]; + FT_MetaClassRec meta_class; + } FT_LibraryRec; @@ -699,9 +749,9 @@ FT_ListNode* node ); FT_BASE( FT_Error ) - FT_Render_Glyph_Internal( FT_Library library, - FT_GlyphSlot slot, - FT_UInt render_mode ); + FT_Render_Glyph_Internal( FT_Library library, + FT_GlyphSlot slot, + FT_Render_Mode render_mode ); typedef const char* (*FT_Face_GetPostscriptNameFunc)( FT_Face face ); Index: xc/extras/freetype2/include/freetype/internal/ftstream.h diff -u xc/extras/freetype2/include/freetype/internal/ftstream.h:1.1.1.6 xc/extras/freetype2/include/freetype/internal/ftstream.h:1.1.1.7 --- xc/extras/freetype2/include/freetype/internal/ftstream.h:1.1.1.6 Thu Jun 20 04:16:10 2002 +++ xc/extras/freetype2/include/freetype/internal/ftstream.h Wed May 28 22:01:47 2003 @@ -21,6 +21,7 @@ #include <ft2build.h> +#include FT_SYSTEM_H #include FT_INTERNAL_OBJECTS_H @@ -387,7 +388,7 @@ FT_BASE( void ) FT_Stream_ReleaseFrame( FT_Stream stream, FT_Byte** pbytes ); - + /* read a byte from an entered frame */ FT_BASE( FT_Char ) FT_Stream_GetChar( FT_Stream stream ); Index: xc/extras/freetype2/include/freetype/internal/internal.h diff -u xc/extras/freetype2/include/freetype/internal/internal.h:1.8 xc/extras/freetype2/include/freetype/internal/internal.h:1.10 --- xc/extras/freetype2/include/freetype/internal/internal.h:1.8 Thu Jun 20 04:25:27 2002 +++ xc/extras/freetype2/include/freetype/internal/internal.h Wed Oct 22 14:51:24 2003 @@ -14,7 +14,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ -/* $XFree86: xc/extras/freetype2/include/freetype/internal/internal.h,v 1.8 2002/06/20 08:25:27 keithp Exp $ */ +/* $XFree86: xc/extras/freetype2/include/freetype/internal/internal.h,v 1.10 2003/10/22 18:51:24 tsi Exp $ */ /*************************************************************************/ /* */ @@ -27,14 +27,14 @@ #define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h> #define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h> #define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h> -#define FT_INTERNAL_EXTENSION_H <freetype/internal/ftextend.h> #define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h> #define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h> #define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h> -#define FT_INTERNAL_EXTEND_H <freetype/internal/ftextend.h> #define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h> #define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h> #define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h> +#define FT_INTERNAL_HASH_H <freetype/internal/fthash.h> +#define FT_INTERNAL_OBJECT_H <freetype/internal/ftobject.h> #define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h> #define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h> @@ -42,12 +42,11 @@ #define FT_INTERNAL_CFF_TYPES_H <freetype/internal/cfftypes.h> #define FT_INTERNAL_FNT_TYPES_H <freetype/internal/fnttypes.h> #define FT_INTERNAL_BDF_TYPES_H <freetype/internal/bdftypes.h> -#define FT_INTERNAL_PCF_TYPES_H <freetype/internal/pcftypes.h> +#define FT_INTERNAL_PFR_H <freetype/internal/pfr.h> #define FT_INTERNAL_POSTSCRIPT_NAMES_H <freetype/internal/psnames.h> #define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h> #define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h> -#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h> #define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h> Index: xc/extras/freetype2/include/freetype/internal/pcftypes.h diff -u xc/extras/freetype2/include/freetype/internal/pcftypes.h:1.1.1.2 xc/extras/freetype2/include/freetype/internal/pcftypes.h:1.1.1.3 --- xc/extras/freetype2/include/freetype/internal/pcftypes.h:1.1.1.2 Sun Dec 16 12:49:24 2001 +++ xc/extras/freetype2/include/freetype/internal/pcftypes.h Wed May 28 22:01:47 2003 @@ -38,10 +38,12 @@ typedef struct PCF_Public_FaceRec_ { - FT_FaceRec root; + FT_FaceRec root; + FT_StreamRec gzip_stream; + FT_Stream gzip_source; - char* charset_encoding; - char* charset_registry; + char* charset_encoding; + char* charset_registry; } PCF_Public_FaceRec, *PCF_Public_Face; Index: xc/extras/freetype2/include/freetype/internal/pfr.h diff -u /dev/null xc/extras/freetype2/include/freetype/internal/pfr.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:16 2004 +++ xc/extras/freetype2/include/freetype/internal/pfr.h Wed May 28 22:01:47 2003 @@ -0,0 +1,36 @@ +#ifndef __FT_INTERNAL_PFR_H__ +#define __FT_INTERNAL_PFR_H__ + +#include <ft2build.h> +#include FT_FREETYPE_H + +FT_BEGIN_HEADER + + typedef FT_Error (*FT_PFR_GetMetricsFunc)( FT_Face face, + FT_UInt *aoutline, + FT_UInt *ametrics, + FT_Fixed *ax_scale, + FT_Fixed *ay_scale ); + + typedef FT_Error (*FT_PFR_GetKerningFunc)( FT_Face face, + FT_UInt left, + FT_UInt right, + FT_Vector *avector ); + + typedef FT_Error (*FT_PFR_GetAdvanceFunc)( FT_Face face, + FT_UInt gindex, + FT_Pos *aadvance ); + + typedef struct FT_PFR_ServiceRec_ + { + FT_PFR_GetMetricsFunc get_metrics; + FT_PFR_GetKerningFunc get_kerning; + FT_PFR_GetAdvanceFunc get_advance; + + } FT_PFR_ServiceRec, *FT_PFR_Service; + +#define FT_PFR_SERVICE_NAME "pfr" + +FT_END_HEADER + +#endif /* __FT_INTERNAL_PFR_H__ */ Index: xc/extras/freetype2/include/freetype/internal/psaux.h diff -u xc/extras/freetype2/include/freetype/internal/psaux.h:1.1.1.5 xc/extras/freetype2/include/freetype/internal/psaux.h:1.1.1.6 --- xc/extras/freetype2/include/freetype/internal/psaux.h:1.1.1.5 Thu Jun 20 04:16:10 2002 +++ xc/extras/freetype2/include/freetype/internal/psaux.h Wed May 28 22:01:47 2003 @@ -142,10 +142,10 @@ typedef struct PS_ParserRec_* PS_Parser; typedef struct T1_TokenRec_* T1_Token; - + typedef struct T1_FieldRec_* T1_Field; - + /* simple enumeration type used to identify token types */ typedef enum T1_TokenType_ { @@ -178,6 +178,7 @@ T1_FIELD_TYPE_INTEGER, T1_FIELD_TYPE_FIXED, T1_FIELD_TYPE_STRING, + T1_FIELD_TYPE_BBOX, T1_FIELD_TYPE_INTEGER_ARRAY, T1_FIELD_TYPE_FIXED_ARRAY, T1_FIELD_TYPE_CALLBACK, @@ -194,6 +195,7 @@ T1_FIELD_LOCATION_FONT_DICT, T1_FIELD_LOCATION_FONT_INFO, T1_FIELD_LOCATION_PRIVATE, + T1_FIELD_LOCATION_BBOX, /* do not remove */ T1_FIELD_LOCATION_MAX @@ -271,6 +273,10 @@ #define T1_FIELD_STRING( _ident, _fname ) \ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname ) +#define T1_FIELD_BBOX( _ident, _fname ) \ + T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname ) + + #define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax ) \ T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \ _fname, _fmax ) @@ -388,7 +394,7 @@ FT_Memory memory; PS_Parser_FuncsRec funcs; - + } PS_ParserRec; @@ -544,7 +550,7 @@ void* hints_globals; /* hinter-specific */ T1_Builder_FuncsRec funcs; - + } T1_BuilderRec; @@ -604,6 +610,7 @@ FT_Byte** glyph_names, PS_Blend blend, FT_Bool hinting, + FT_Render_Mode hint_mode, T1_Decoder_Callback callback ); void @@ -613,7 +620,7 @@ (*parse_charstrings)( T1_Decoder decoder, FT_Byte* base, FT_UInt len ); - + } T1_Decoder_FuncsRec; @@ -645,9 +652,12 @@ PS_Blend blend; /* for multiple master support */ + FT_UInt32 hint_flags; + FT_Render_Mode hint_mode; + T1_Decoder_Callback parse_callback; T1_Decoder_FuncsRec funcs; - + } T1_DecoderRec; @@ -667,9 +677,9 @@ FT_CMap_Class expert; FT_CMap_Class custom; FT_CMap_Class unicode; - + } T1_CMap_ClassesRec; - + /*************************************************************************/ /*************************************************************************/ Index: xc/extras/freetype2/include/freetype/internal/psglobal.h diff -u xc/extras/freetype2/include/freetype/internal/psglobal.h:1.1.1.1 xc/extras/freetype2/include/freetype/internal/psglobal.h:removed --- xc/extras/freetype2/include/freetype/internal/psglobal.h:1.1.1.1 Mon Jan 14 11:52:07 2002 +++ xc/extras/freetype2/include/freetype/internal/psglobal.h Sat Feb 28 21:40:16 2004 @@ -1,186 +0,0 @@ -/***************************************************************************/ -/* */ -/* psglobal.h */ -/* */ -/* Global PostScript hinting structures (specification only). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PSGLOBAL_H__ -#define __PSGLOBAL_H__ - - -FT_BEGIN_HEADER - - - /**********************************************************************/ - /**********************************************************************/ - /***** *****/ - /***** PUBLIC STRUCTURES & API *****/ - /***** *****/ - /**********************************************************************/ - /**********************************************************************/ - -#if 0 - - /*************************************************************************/ - /* */ - /* @constant: */ - /* PS_GLOBALS_MAX_BLUE_ZONES */ - /* */ - /* @description: */ - /* The maximum number of blue zones in a font global hints structure. */ - /* See @PS_Globals_BluesRec. */ - /* */ -#define PS_GLOBALS_MAX_BLUE_ZONES 16 - - - /*************************************************************************/ - /* */ - /* @constant: */ - /* PS_GLOBALS_MAX_STD_WIDTHS */ - /* */ - /* @description: */ - /* The maximum number of standard and snap widths in either the */ - /* horizontal or vertical direction. See @PS_Globals_WidthsRec. */ - /* */ -#define PS_GLOBALS_MAX_STD_WIDTHS 16 - - - /*************************************************************************/ - /* */ - /* @type: */ - /* PS_Globals */ - /* */ - /* @description: */ - /* A handle to a @PS_GlobalsRec structure used to describe the global */ - /* hints of a given font. */ - /* */ - typedef struct PS_GlobalsRec_* PS_Globals; - - - /*************************************************************************/ - /* */ - /* @struct: */ - /* PS_Globals_BluesRec */ - /* */ - /* @description: */ - /* A structure used to model the global blue zones of a given font. */ - /* */ - /* @fields: */ - /* count :: The number of blue zones. */ - /* */ - /* zones :: An array of (count*2) coordinates describing the */ - /* zones. */ - /* */ - /* count_family :: The number of family blue zones. */ - /* */ - /* zones_family :: An array of (count_family*2) coordinates describing */ - /* the family blue zones. */ - /* */ - /* scale :: The blue scale to be used (fixed float). */ - /* */ - /* shift :: The blue shift to be used. */ - /* */ - /* fuzz :: Te blue fuzz to be used. */ - /* */ - /* @note: */ - /* Each blue zone is modeled by a (reference,overshoot) coordinate */ - /* pair in the table. Zones can be placed in any order. */ - /* */ - typedef struct PS_Globals_BluesRec_ - { - FT_UInt count; - FT_Int16 zones[2 * PS_GLOBALS_MAX_BLUE_ZONES]; - - FT_UInt count_family; - FT_Int16 zones_family[2 * PS_GLOBALS_MAX_BLUE_ZONES]; - - FT_Fixed scale; - FT_Int16 shift; - FT_Int16 fuzz; - - } PS_Globals_BluesRec, *PS_Globals_Blues; - - - /*************************************************************************/ - /* */ - /* @type: */ - /* PS_Global_Widths */ - /* */ - /* @description: */ - /* A handle to a @PS_Globals_WidthsRec structure used to model the */ - /* global standard and snap widths in a given direction. */ - /* */ - typedef struct PS_Globals_WidthsRec_* PS_Globals_Widths; - - - /*************************************************************************/ - /* */ - /* @struct: */ - /* PS_Globals_WidthsRec */ - /* */ - /* @description: */ - /* A structure used to model the global standard and snap widths in a */ - /* given font. */ - /* */ - /* @fields: */ - /* count :: The number of widths. */ - /* */ - /* widths :: An array of `count' widths in font units. */ - /* */ - /* @note: */ - /* `widths[0]' must be the standard width or height, while remaining */ - /* elements of the array are snap widths or heights. */ - /* */ - typedef struct PS_Globals_WidthsRec_ - { - FT_UInt count; - FT_Int16 widths[PS_GLOBALS_MAX_STD_WIDTHS]; - - } PS_Globals_WidthsRec; - - - /*************************************************************************/ - /* */ - /* @struct: */ - /* PS_GlobalsRec */ - /* */ - /* @description: */ - /* A structure used to model the global hints for a given font. */ - /* */ - /* @fields: */ - /* horizontal :: The horizontal widths. */ - /* */ - /* vertical :: The vertical heights. */ - /* */ - /* blues :: The blue zones. */ - /* */ - typedef struct PS_GlobalsRec_ - { - PS_Globals_WidthsRec horizontal; - PS_Globals_WidthsRec vertical; - PS_Globals_BluesRec blues; - - } PS_GlobalsRec; - -#endif - - /* */ - -FT_END_HEADER - -#endif /* __PS_GLOBAL_H__ */ - - -/* END */ Index: xc/extras/freetype2/include/freetype/internal/pshints.h diff -u xc/extras/freetype2/include/freetype/internal/pshints.h:1.1.1.2 xc/extras/freetype2/include/freetype/internal/pshints.h:1.1.1.3 --- xc/extras/freetype2/include/freetype/internal/pshints.h:1.1.1.2 Thu Jun 20 04:16:10 2002 +++ xc/extras/freetype2/include/freetype/internal/pshints.h Wed May 28 22:01:47 2003 @@ -261,11 +261,13 @@ /* been recorded. */ /* */ /* @input: */ - /* hints :: A handle to the Type 1 hints recorder. */ + /* hints :: A handle to the Type 1 hints recorder. */ /* */ - /* outline :: A pointer to the target outline descriptor. */ + /* outline :: A pointer to the target outline descriptor. */ /* */ - /* globals :: The hinter globals for this font. */ + /* globals :: The hinter globals for this font. */ + /* */ + /* hint_flags :: Hinter bit flags. */ /* */ /* @return: */ /* FreeType error code. 0 means success. */ @@ -278,9 +280,10 @@ /* which must correspond to the same font as the glyph. */ /* */ typedef FT_Error - (*T1_Hints_ApplyFunc)( T1_Hints hints, - FT_Outline* outline, - PSH_Globals globals ); + (*T1_Hints_ApplyFunc)( T1_Hints hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ); /*************************************************************************/ @@ -539,11 +542,13 @@ /* method. */ /* */ /* @input: */ - /* hints :: A handle to the Type 2 hints recorder. */ + /* hints :: A handle to the Type 2 hints recorder. */ + /* */ + /* outline :: A pointer to the target outline descriptor. */ /* */ - /* outline :: A pointer to the target outline descriptor. */ + /* globals :: The hinter globals for this font. */ /* */ - /* globals :: The hinter globals for this font. */ + /* hint_flags :: Hinter bit flags. */ /* */ /* @return: */ /* FreeType error code. 0 means success. */ @@ -556,9 +561,10 @@ /* which must correspond to the same font than the glyph. */ /* */ typedef FT_Error - (*T2_Hints_ApplyFunc)( T2_Hints hints, - FT_Outline* outline, - PSH_Globals globals ); + (*T2_Hints_ApplyFunc)( T2_Hints hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ); /*************************************************************************/ Index: xc/extras/freetype2/include/freetype/internal/psnames.h diff -u xc/extras/freetype2/include/freetype/internal/psnames.h:1.1.1.5 xc/extras/freetype2/include/freetype/internal/psnames.h:1.1.1.6 --- xc/extras/freetype2/include/freetype/internal/psnames.h:1.1.1.5 Thu Jun 20 04:16:10 2002 +++ xc/extras/freetype2/include/freetype/internal/psnames.h Wed May 28 22:01:47 2003 @@ -52,7 +52,7 @@ /* This function will not be compiled if the configuration macro */ /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined. */ /* */ - typedef FT_ULong + typedef FT_UInt32 (*PS_Unicode_Value_Func)( const char* glyph_name ); Index: xc/extras/freetype2/include/freetype/internal/sfnt.h diff -u xc/extras/freetype2/include/freetype/internal/sfnt.h:1.1.1.4 xc/extras/freetype2/include/freetype/internal/sfnt.h:1.1.1.5 --- xc/extras/freetype2/include/freetype/internal/sfnt.h:1.1.1.4 Thu Jun 20 04:16:10 2002 +++ xc/extras/freetype2/include/freetype/internal/sfnt.h Wed May 28 22:01:47 2003 @@ -459,6 +459,21 @@ /*************************************************************************/ /* */ + /* <FuncType> */ + /* SFNT_Load_Table_Func */ + /* */ + /* <Description> */ + /* Loads a given SFNT table in memory */ + /* */ + typedef FT_Error + (*SFNT_Load_Table_Func)( FT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ); + + /*************************************************************************/ + /* */ /* <Struct> */ /* SFNT_Interface */ /* */ Index: xc/extras/freetype2/include/freetype/internal/t42types.h diff -u xc/extras/freetype2/include/freetype/internal/t42types.h:1.1.1.1 xc/extras/freetype2/include/freetype/internal/t42types.h:1.1.1.2 --- xc/extras/freetype2/include/freetype/internal/t42types.h:1.1.1.1 Thu Jun 20 04:16:10 2002 +++ xc/extras/freetype2/include/freetype/internal/t42types.h Wed May 28 22:01:47 2003 @@ -30,40 +30,10 @@ FT_BEGIN_HEADER - typedef struct T42_FontRec_ - { - /* font info dictionary */ - PS_FontInfoRec font_info; - - /* top-level dictionary */ - FT_String* font_name; - - T1_EncodingType encoding_type; - T1_EncodingRec encoding; - - FT_Byte* charstrings_block; - FT_Byte* glyph_names_block; - - FT_Int num_glyphs; - FT_String** glyph_names; /* array of glyph names */ - FT_Byte** charstrings; /* array of glyph charstrings */ - FT_Int* charstrings_len; - - FT_Byte paint_type; - FT_Byte font_type; - FT_Matrix font_matrix; /* From FontMatrix field: a, b, c, d */ - FT_Vector font_offset; /* From FontMatrix field: tx, ty */ - FT_BBox font_bbox; - - FT_Int stroke_width; - - } T42_FontRec, *T42_Font; - - typedef struct T42_FaceRec_ { FT_FaceRec root; - T42_FontRec type42; + T1_FontRec type1; const void* psnames; const void* psaux; const void* afm_data; Index: xc/extras/freetype2/include/freetype/internal/tttypes.h diff -u xc/extras/freetype2/include/freetype/internal/tttypes.h:1.1.1.7 xc/extras/freetype2/include/freetype/internal/tttypes.h:1.1.1.8 --- xc/extras/freetype2/include/freetype/internal/tttypes.h:1.1.1.7 Thu Jun 20 04:16:11 2002 +++ xc/extras/freetype2/include/freetype/internal/tttypes.h Wed May 28 22:01:47 2003 @@ -100,6 +100,8 @@ FT_UShort entry_selector; FT_UShort range_shift; + FT_ULong offset; /* not in file */ + } SFNT_HeaderRec, *SFNT_Header; @@ -1481,18 +1483,9 @@ TT_OS2 os2; /* TrueType OS/2 table */ TT_Postscript postscript; /* TrueType Postscript table */ -#ifdef FT_CONFIG_OPTION_USE_CMAPS - FT_Byte* cmap_table; /* extracted 'cmap' table */ FT_ULong cmap_size; -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - FT_Int num_charmaps; - TT_CharMap charmaps; /* array of TT_CharMapRec */ - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ - TT_Loader_GotoTableFunc goto_table; TT_Loader_StartGlyphFunc access_glyph_frame; @@ -1525,10 +1518,10 @@ TT_PCLT pclt; /* embedded bitmaps support */ - FT_Int num_sbit_strikes; + FT_ULong num_sbit_strikes; TT_SBit_Strike sbit_strikes; - FT_Int num_sbit_scales; + FT_ULong num_sbit_scales; TT_SBit_Scale sbit_scales; /* postscript names table */ Index: xc/extras/freetype2/src/Jamfile diff -u xc/extras/freetype2/src/Jamfile:1.1.1.3 xc/extras/freetype2/src/Jamfile:1.1.1.4 --- xc/extras/freetype2/src/Jamfile:1.1.1.3 Thu Jun 20 04:16:11 2002 +++ xc/extras/freetype2/src/Jamfile Wed May 28 22:01:48 2003 @@ -1,36 +1,17 @@ # FreeType 2 src Jamfile (c) 2001, 2002 David Turner # -SubDir FT2_TOP src ; - -# We need to add "freetype/src" to the current include path in order to -# compile any part of FreeType 2. -# -SubDirHdrs [ FT2_SubDir src ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) ; # The file <freetype/internal/internal.h> is used to define macros that are # later used in #include statements. It needs to be parsed in order to # record these definitions. # -HDRMACRO [ FT2_SubDir include internal internal.h ] ; +HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) internal internal.h ] ; -SubInclude FT2_TOP src autohint ; -SubInclude FT2_TOP src base ; -SubInclude FT2_TOP src bdf ; -SubInclude FT2_TOP src cache ; -SubInclude FT2_TOP src cff ; -SubInclude FT2_TOP src cid ; -SubInclude FT2_TOP src pcf ; -SubInclude FT2_TOP src pfr ; -SubInclude FT2_TOP src psaux ; -SubInclude FT2_TOP src pshinter ; -SubInclude FT2_TOP src psnames ; -SubInclude FT2_TOP src raster ; -SubInclude FT2_TOP src sfnt ; -SubInclude FT2_TOP src smooth ; -SubInclude FT2_TOP src truetype ; -SubInclude FT2_TOP src type1 ; -SubInclude FT2_TOP src type42 ; -SubInclude FT2_TOP src winfonts ; +for xx in $(FT2_COMPONENTS) +{ + SubInclude FT2_TOP $(FT2_SRC_DIR) $(xx) ; +} # end of src Jamfile Index: xc/extras/freetype2/src/autohint/Jamfile diff -u xc/extras/freetype2/src/autohint/Jamfile:1.1.1.1 xc/extras/freetype2/src/autohint/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/autohint/Jamfile:1.1.1.1 Sun Sep 9 22:56:00 2001 +++ xc/extras/freetype2/src/autohint/Jamfile Wed May 28 22:01:48 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/autohint Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src autohint ; - -SubDirHdrs [ FT2_SubDir src autohint ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) autohint ; { local _sources ; Index: xc/extras/freetype2/src/autohint/ahangles.c diff -u xc/extras/freetype2/src/autohint/ahangles.c:1.1.1.4 xc/extras/freetype2/src/autohint/ahangles.c:1.1.1.5 --- xc/extras/freetype2/src/autohint/ahangles.c:1.1.1.4 Thu Jun 20 04:16:11 2002 +++ xc/extras/freetype2/src/autohint/ahangles.c Wed May 28 22:01:48 2003 @@ -127,4 +127,21 @@ } + FT_LOCAL_DEF( AH_Angle ) + ah_angle_diff( AH_Angle angle1, + AH_Angle angle2 ) + { + AH_Angle delta; + + + delta = ( angle2 - angle1 ); + if ( delta < 0 ) + delta += AH_2PI; + + if ( delta > AH_PI ) + delta -= AH_2PI; + + return delta; + } + /* END */ Index: xc/extras/freetype2/src/autohint/ahangles.h diff -u xc/extras/freetype2/src/autohint/ahangles.h:1.1.1.4 xc/extras/freetype2/src/autohint/ahangles.h:1.1.1.5 --- xc/extras/freetype2/src/autohint/ahangles.h:1.1.1.4 Thu Jun 20 04:16:11 2002 +++ xc/extras/freetype2/src/autohint/ahangles.h Wed May 28 22:01:48 2003 @@ -51,6 +51,11 @@ ah_angle( FT_Vector* v ); + FT_LOCAL( AH_Angle ) + ah_angle_diff( AH_Angle angle1, + AH_Angle angle2 ); + + FT_END_HEADER #endif /* __AHANGLES_H__ */ Index: xc/extras/freetype2/src/autohint/ahglobal.c diff -u xc/extras/freetype2/src/autohint/ahglobal.c:1.1.1.5 xc/extras/freetype2/src/autohint/ahglobal.c:1.1.1.6 --- xc/extras/freetype2/src/autohint/ahglobal.c:1.1.1.5 Thu Jun 20 04:16:11 2002 +++ xc/extras/freetype2/src/autohint/ahglobal.c Wed May 28 22:01:48 2003 @@ -28,10 +28,13 @@ #define MAX_TEST_CHARACTERS 12 static - const char* blue_chars[ah_blue_max] = + const char* blue_chars[AH_BLUE_MAX] = { "THEZOCQS", "HEZLOCUS", +#ifdef FT_CONFIG_CHESTER_SMALL_F + "fijkdbh", +#endif "xzroesc", "xzroesc", "pqgjy" @@ -43,7 +46,8 @@ sort_values( FT_Int count, FT_Pos* table ) { - FT_Int i, j, swap; + FT_Int i, j; + FT_Pos swap; for ( i = 1; i < count; i++ ) @@ -62,10 +66,10 @@ static FT_Error - ah_hinter_compute_blues( AH_Hinter* hinter ) + ah_hinter_compute_blues( AH_Hinter hinter ) { AH_Blue blue; - AH_Globals* globals = &hinter->globals->design; + AH_Globals globals = &hinter->globals->design; FT_Pos flats [MAX_TEST_CHARACTERS]; FT_Pos rounds[MAX_TEST_CHARACTERS]; FT_Int num_flats; @@ -84,7 +88,7 @@ charmap = face->charmap; /* do we have a Unicode charmap in there? */ - error = FT_Select_Charmap( face, ft_encoding_unicode ); + error = FT_Select_Charmap( face, FT_ENCODING_UNICODE ); if ( error ) goto Exit; @@ -95,7 +99,7 @@ AH_LOG(( "blue zones computation\n" )); AH_LOG(( "------------------------------------------------\n" )); - for ( blue = ah_blue_capital_top; blue < ah_blue_max; blue++ ) + for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ ) { const char* p = blue_chars[blue]; const char* limit = p + MAX_TEST_CHARACTERS; @@ -216,8 +220,8 @@ /* now, set the `round' flag depending on the segment's kind */ round = FT_BOOL( - FT_CURVE_TAG( glyph->outline.tags[prev] ) != FT_Curve_Tag_On || - FT_CURVE_TAG( glyph->outline.tags[next] ) != FT_Curve_Tag_On ); + FT_CURVE_TAG( glyph->outline.tags[prev] ) != FT_CURVE_TAG_ON || + FT_CURVE_TAG( glyph->outline.tags[next] ) != FT_CURVE_TAG_ON ); AH_LOG(( "%c ", round ? 'r' : 'f' )); } @@ -286,18 +290,18 @@ static FT_Error - ah_hinter_compute_widths( AH_Hinter* hinter ) + ah_hinter_compute_widths( AH_Hinter hinter ) { /* scan the array of segments in each direction */ - AH_Outline* outline = hinter->glyph; - AH_Segment* segments; - AH_Segment* limit; - AH_Globals* globals = &hinter->globals->design; - FT_Pos* widths; - FT_Int dimension; - FT_Int* p_num_widths; - FT_Error error = 0; - FT_Pos edge_distance_threshold = 32000; + AH_Outline outline = hinter->glyph; + AH_Segment segments; + AH_Segment limit; + AH_Globals globals = &hinter->globals->design; + FT_Pos* widths; + FT_Int dimension; + FT_Int* p_num_widths; + FT_Error error = 0; + FT_Pos edge_distance_threshold = 32000; globals->num_widths = 0; @@ -319,7 +323,7 @@ if ( error ) goto Exit; - error = ah_outline_load( hinter->glyph, hinter->face ); + error = ah_outline_load( hinter->glyph, 0x10000L, 0x10000L, hinter->face ); if ( error ) goto Exit; @@ -334,9 +338,9 @@ for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Segment* seg = segments; - AH_Segment* link; - FT_Int num_widths = 0; + AH_Segment seg = segments; + AH_Segment link; + FT_Int num_widths = 0; for ( ; seg < limit; seg++ ) @@ -345,14 +349,14 @@ /* we only consider stem segments there! */ if ( link && link->link == seg && link > seg ) { - FT_Int dist; + FT_Pos dist; dist = seg->pos - link->pos; if ( dist < 0 ) dist = -dist; - if ( num_widths < 12 ) + if ( num_widths < AH_MAX_WIDTHS ) widths[num_widths++] = dist; } } @@ -368,7 +372,6 @@ limit = segments + outline->num_vsegments; widths = globals->widths; p_num_widths = &globals->num_widths; - } /* Now, compute the edge distance threshold as a fraction of the */ @@ -385,7 +388,7 @@ FT_LOCAL_DEF( FT_Error ) - ah_hinter_compute_globals( AH_Hinter* hinter ) + ah_hinter_compute_globals( AH_Hinter hinter ) { return ah_hinter_compute_widths( hinter ) || ah_hinter_compute_blues ( hinter ); Index: xc/extras/freetype2/src/autohint/ahglobal.h diff -u xc/extras/freetype2/src/autohint/ahglobal.h:1.1.1.4 xc/extras/freetype2/src/autohint/ahglobal.h:1.1.1.5 --- xc/extras/freetype2/src/autohint/ahglobal.h:1.1.1.4 Thu Jun 20 04:16:11 2002 +++ xc/extras/freetype2/src/autohint/ahglobal.h Wed May 28 22:01:48 2003 @@ -32,13 +32,23 @@ FT_BEGIN_HEADER -#define AH_IS_TOP_BLUE( b ) ( (b) == ah_blue_capital_top || \ - (b) == ah_blue_small_top ) +#ifdef FT_CONFIG_CHESTER_SMALL_F + +# define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || \ + (b) == AH_BLUE_SMALL_F_TOP || \ + (b) == AH_BLUE_SMALL_TOP ) + +#else /* !CHESTER_SMALL_F */ + +# define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || \ + (b) == AH_BLUE_SMALL_TOP ) + +#endif /* !CHESTER_SMALL_F */ /* compute global metrics automatically */ FT_LOCAL( FT_Error ) - ah_hinter_compute_globals( AH_Hinter* hinter ); + ah_hinter_compute_globals( AH_Hinter hinter ); FT_END_HEADER Index: xc/extras/freetype2/src/autohint/ahglyph.c diff -u xc/extras/freetype2/src/autohint/ahglyph.c:1.1.1.6 xc/extras/freetype2/src/autohint/ahglyph.c:1.1.1.7 --- xc/extras/freetype2/src/autohint/ahglyph.c:1.1.1.6 Thu Jun 20 04:16:11 2002 +++ xc/extras/freetype2/src/autohint/ahglyph.c Wed May 28 22:01:48 2003 @@ -32,12 +32,12 @@ #include <stdio.h> void - ah_dump_edges( AH_Outline* outline ) + ah_dump_edges( AH_Outline outline ) { - AH_Edge* edges; - AH_Edge* edge_limit; - AH_Segment* segments; - FT_Int dimension; + AH_Edge edges; + AH_Edge edge_limit; + AH_Segment segments; + FT_Int dimension; edges = outline->horz_edges; @@ -46,7 +46,7 @@ for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Edge* edge; + AH_Edge edge; printf ( "Table of %s edges:\n", @@ -59,13 +59,13 @@ printf ( " [ %5d | %4d | %5s | %4d | %5d | %c | %5.2f | %5.2f ]\n", edge - edges, (int)edge->fpos, - edge->dir == ah_dir_up + edge->dir == AH_DIR_UP ? "up" - : ( edge->dir == ah_dir_down + : ( edge->dir == AH_DIR_DOWN ? "down" - : ( edge->dir == ah_dir_left + : ( edge->dir == AH_DIR_LEFT ? "left" - : ( edge->dir == ah_dir_right + : ( edge->dir == AH_DIR_RIGHT ? "right" : "none" ) ) ), edge->link ? ( edge->link - edges ) : -1, @@ -84,12 +84,12 @@ /* A function used to dump the array of linked segments */ void - ah_dump_segments( AH_Outline* outline ) + ah_dump_segments( AH_Outline outline ) { - AH_Segment* segments; - AH_Segment* segment_limit; - AH_Point* points; - FT_Int dimension; + AH_Segment segments; + AH_Segment segment_limit; + AH_Point points; + FT_Int dimension; points = outline->points; @@ -98,7 +98,7 @@ for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Segment* seg; + AH_Segment seg; printf ( "Table of %s segments:\n", @@ -111,13 +111,13 @@ printf ( " [ %5d | %4d | %5s | %4d | %5d | %4d | %5d | %5d ]\n", seg - segments, (int)seg->pos, - seg->dir == ah_dir_up + seg->dir == AH_DIR_UP ? "up" - : ( seg->dir == ah_dir_down + : ( seg->dir == AH_DIR_DOWN ? "down" - : ( seg->dir == ah_dir_left + : ( seg->dir == AH_DIR_LEFT ? "left" - : ( seg->dir == ah_dir_right + : ( seg->dir == AH_DIR_RIGHT ? "right" : "none" ) ) ), seg->link ? (seg->link-segments) : -1, @@ -145,17 +145,17 @@ FT_Pos ay = ABS( dy ); - dir = ah_dir_none; + dir = AH_DIR_NONE; /* test for vertical direction */ if ( ax * 12 < ay ) { - dir = dy > 0 ? ah_dir_up : ah_dir_down; + dir = dy > 0 ? AH_DIR_UP : AH_DIR_DOWN; } /* test for horizontal direction */ else if ( ay * 12 < ax ) { - dir = dx > 0 ? ah_dir_right : ah_dir_left; + dir = dx > 0 ? AH_DIR_RIGHT : AH_DIR_LEFT; } return dir; @@ -164,13 +164,14 @@ /* this function is used by ah_get_orientation (see below) to test */ /* the fill direction of a given bbox extrema */ - static int + static FT_Int ah_test_extrema( FT_Outline* outline, - int n ) + FT_Int n ) { FT_Vector *prev, *cur, *next; FT_Pos product; FT_Int first, last, c; + FT_Int retval; /* we need to compute the `previous' and `next' point */ @@ -201,15 +202,16 @@ next->x - cur->x, /* out.x */ 0x40 ); + retval = 0; if ( product ) - product = product > 0 ? 2 : 1; + retval = product > 0 ? 2 : 1; - return product; + return retval; } /* Compute the orientation of path filling. It differs between TrueType */ - /* and Type1 formats. We could use the `ft_outline_reverse_fill' flag, */ + /* and Type1 formats. We could use the `FT_OUTLINE_REVERSE_FILL' flag, */ /* but it is better to re-compute it directly (it seems that this flag */ /* isn't correctly set for some weird composite glyphs currently). */ /* */ @@ -218,18 +220,18 @@ /* */ /* The function returns either 1 or -1. */ /* */ - static int + static FT_Int ah_get_orientation( FT_Outline* outline ) { FT_BBox box; - FT_BBox indices; - int n, last; + FT_Int indices_xMin, indices_yMin, indices_xMax, indices_yMax; + FT_Int n, last; - indices.xMin = -1; - indices.yMin = -1; - indices.xMax = -1; - indices.yMax = -1; + indices_xMin = -1; + indices_yMin = -1; + indices_xMax = -1; + indices_yMax = -1; box.xMin = box.yMin = 32767L; box.xMax = box.yMax = -32768L; @@ -249,41 +251,41 @@ if ( x < box.xMin ) { box.xMin = x; - indices.xMin = n; + indices_xMin = n; } if ( x > box.xMax ) { box.xMax = x; - indices.xMax = n; + indices_xMax = n; } y = outline->points[n].y; if ( y < box.yMin ) { box.yMin = y; - indices.yMin = n; + indices_yMin = n; } if ( y > box.yMax ) { box.yMax = y; - indices.yMax = n; + indices_yMax = n; } } /* test orientation of the xmin */ - n = ah_test_extrema( outline, indices.xMin ); + n = ah_test_extrema( outline, indices_xMin ); if ( n ) goto Exit; - n = ah_test_extrema( outline, indices.yMin ); + n = ah_test_extrema( outline, indices_yMin ); if ( n ) goto Exit; - n = ah_test_extrema( outline, indices.xMax ); + n = ah_test_extrema( outline, indices_xMax ); if ( n ) goto Exit; - n = ah_test_extrema( outline, indices.yMax ); + n = ah_test_extrema( outline, indices_yMax ); if ( !n ) n = 1; @@ -298,14 +300,14 @@ /* ah_outline_new */ /* */ /* <Description> */ - /* Creates a new and empty AH_Outline object. */ + /* Creates a new and empty AH_OutlineRec object. */ /* */ FT_LOCAL_DEF( FT_Error ) - ah_outline_new( FT_Memory memory, - AH_Outline** aoutline ) + ah_outline_new( FT_Memory memory, + AH_Outline* aoutline ) { FT_Error error; - AH_Outline* outline; + AH_Outline outline; if ( !FT_NEW( outline ) ) @@ -324,10 +326,10 @@ /* ah_outline_done */ /* */ /* <Description> */ - /* Destroys a given AH_Outline object. */ + /* Destroys a given AH_OutlineRec object. */ /* */ FT_LOCAL_DEF( void ) - ah_outline_done( AH_Outline* outline ) + ah_outline_done( AH_Outline outline ) { FT_Memory memory = outline->memory; @@ -347,15 +349,15 @@ /* ah_outline_save */ /* */ /* <Description> */ - /* Saves the content of a given AH_Outline object into a face's glyph */ - /* slot. */ + /* Saves the contents of a given AH_OutlineRec object into a face's */ + /* glyph slot. */ /* */ FT_LOCAL_DEF( void ) - ah_outline_save( AH_Outline* outline, - AH_Loader gloader ) + ah_outline_save( AH_Outline outline, + AH_Loader gloader ) { - AH_Point* point = outline->points; - AH_Point* point_limit = point + outline->num_points; + AH_Point point = outline->points; + AH_Point point_limit = point + outline->num_points; FT_Vector* vec = gloader->current.outline.points; char* tag = gloader->current.outline.tags; @@ -366,12 +368,12 @@ vec->x = point->x; vec->y = point->y; - if ( point->flags & ah_flag_conic ) - tag[0] = FT_Curve_Tag_Conic; - else if ( point->flags & ah_flag_cubic ) - tag[0] = FT_Curve_Tag_Cubic; + if ( point->flags & AH_FLAG_CONIC ) + tag[0] = FT_CURVE_TAG_CONIC; + else if ( point->flags & AH_FLAG_CUBIC ) + tag[0] = FT_CURVE_TAG_CUBIC; else - tag[0] = FT_Curve_Tag_On; + tag[0] = FT_CURVE_TAG_ON; } } @@ -382,25 +384,27 @@ /* ah_outline_load */ /* */ /* <Description> */ - /* Loads an unscaled outline from a glyph slot into an AH_Outline */ + /* Loads an unscaled outline from a glyph slot into an AH_OutlineRec */ /* object. */ /* */ FT_LOCAL_DEF( FT_Error ) - ah_outline_load( AH_Outline* outline, - FT_Face face ) + ah_outline_load( AH_Outline outline, + FT_Fixed x_scale, + FT_Fixed y_scale, + FT_Face face ) { - FT_Memory memory = outline->memory; - FT_Error error = AH_Err_Ok; - FT_Outline* source = &face->glyph->outline; - FT_Int num_points = source->n_points; - FT_Int num_contours = source->n_contours; - AH_Point* points; + FT_Memory memory = outline->memory; + FT_Error error = AH_Err_Ok; + FT_Outline* source = &face->glyph->outline; + FT_Int num_points = source->n_points; + FT_Int num_contours = source->n_contours; + AH_Point points; /* check arguments */ if ( !face || !face->size || - face->glyph->format != ft_glyph_format_outline ) + face->glyph->format != FT_GLYPH_FORMAT_OUTLINE ) return AH_Err_Invalid_Argument; /* first of all, reallocate the contours array if necessary */ @@ -450,17 +454,17 @@ /* direction used for a glyph, given that some fonts are broken (e.g. */ /* the Arphic ones). We thus recompute it each time we need to. */ /* */ - outline->vert_major_dir = ah_dir_up; - outline->horz_major_dir = ah_dir_left; + outline->vert_major_dir = AH_DIR_UP; + outline->horz_major_dir = AH_DIR_LEFT; if ( ah_get_orientation( source ) > 1 ) { - outline->vert_major_dir = ah_dir_down; - outline->horz_major_dir = ah_dir_right; + outline->vert_major_dir = AH_DIR_DOWN; + outline->horz_major_dir = AH_DIR_RIGHT; } - outline->x_scale = face->size->metrics.x_scale; - outline->y_scale = face->size->metrics.y_scale; + outline->x_scale = x_scale; + outline->y_scale = y_scale; points = outline->points; if ( outline->num_points == 0 ) @@ -469,15 +473,13 @@ { /* do one thing at a time -- it is easier to understand, and */ /* the code is clearer */ - AH_Point* point; - AH_Point* point_limit = points + outline->num_points; + AH_Point point; + AH_Point point_limit = points + outline->num_points; /* compute coordinates */ { FT_Vector* vec = source->points; - FT_Fixed x_scale = outline->x_scale; - FT_Fixed y_scale = outline->y_scale; for ( point = points; point < point_limit; vec++, point++ ) @@ -500,10 +502,10 @@ { switch ( FT_CURVE_TAG( *tag ) ) { - case FT_Curve_Tag_Conic: - point->flags = ah_flag_conic; break; - case FT_Curve_Tag_Cubic: - point->flags = ah_flag_cubic; break; + case FT_CURVE_TAG_CONIC: + point->flags = AH_FLAG_CONIC; break; + case FT_CURVE_TAG_CUBIC: + point->flags = AH_FLAG_CUBIC; break; default: ; } @@ -512,10 +514,10 @@ /* compute `next' and `prev' */ { - FT_Int contour_index; - AH_Point* prev; - AH_Point* first; - AH_Point* end; + FT_Int contour_index; + AH_Point prev; + AH_Point first; + AH_Point end; contour_index = 0; @@ -548,10 +550,10 @@ /* set-up the contours array */ { - AH_Point** contour = outline->contours; - AH_Point** contour_limit = contour + outline->num_contours; - short* end = source->contours; - short idx = 0; + AH_Point* contour = outline->contours; + AH_Point* contour_limit = contour + outline->num_contours; + short* end = source->contours; + short idx = 0; for ( ; contour < contour_limit; contour++, end++ ) @@ -565,8 +567,8 @@ { for ( point = points; point < point_limit; point++ ) { - AH_Point* prev; - AH_Point* next; + AH_Point prev; + AH_Point next; FT_Vector ivec, ovec; @@ -583,17 +585,17 @@ point->out_dir = ah_compute_direction( ovec.x, ovec.y ); #ifndef AH_OPTION_NO_WEAK_INTERPOLATION - if ( point->flags & (ah_flag_conic | ah_flag_cubic) ) + if ( point->flags & (AH_FLAG_CONIC | AH_FLAG_CUBIC) ) { Is_Weak_Point: - point->flags |= ah_flag_weak_interpolation; + point->flags |= AH_FLAG_WEAK_INTERPOLATION; } else if ( point->out_dir == point->in_dir ) { AH_Angle angle_in, angle_out, delta; - if ( point->out_dir != ah_dir_none ) + if ( point->out_dir != AH_DIR_NONE ) goto Is_Weak_Point; angle_in = ah_angle( &ivec ); @@ -622,11 +624,11 @@ FT_LOCAL_DEF( void ) - ah_setup_uv( AH_Outline* outline, - AH_UV source ) + ah_setup_uv( AH_Outline outline, + AH_UV source ) { - AH_Point* point = outline->points; - AH_Point* point_limit = point + outline->num_points; + AH_Point point = outline->points; + AH_Point point_limit = point + outline->num_points; for ( ; point < point_limit; point++ ) @@ -636,31 +638,31 @@ switch ( source ) { - case ah_uv_fxy: + case AH_UV_FXY: u = point->fx; v = point->fy; break; - case ah_uv_fyx: + case AH_UV_FYX: u = point->fy; v = point->fx; break; - case ah_uv_oxy: + case AH_UV_OXY: u = point->ox; v = point->oy; break; - case ah_uv_oyx: + case AH_UV_OYX: u = point->oy; v = point->ox; break; - case ah_uv_yx: + case AH_UV_YX: u = point->y; v = point->x; break; - case ah_uv_ox: + case AH_UV_OX: u = point->x; v = point->ox; break; - case ah_uv_oy: + case AH_UV_OY: u = point->y; v = point->oy; break; @@ -675,11 +677,127 @@ } + /* compute all inflex points in a given glyph */ + static void + ah_outline_compute_inflections( AH_Outline outline ) + { + AH_Point* contour = outline->contours; + AH_Point* contour_limit = contour + outline->num_contours; + + + /* load original coordinates in (u,v) */ + ah_setup_uv( outline, AH_UV_FXY ); + + /* do each contour separately */ + for ( ; contour < contour_limit; contour++ ) + { + FT_Vector vec; + AH_Point point = contour[0]; + AH_Point first = point; + AH_Point start = point; + AH_Point end = point; + AH_Point before; + AH_Point after; + AH_Angle angle_in, angle_seg, angle_out; + AH_Angle diff_in, diff_out; + FT_Int finished = 0; + + + /* compute first segment in contour */ + first = point; + + start = end = first; + do + { + end = end->next; + if ( end == first ) + goto Skip; + + } while ( end->u == first->u && end->v == first->v ); + + vec.x = end->u - start->u; + vec.y = end->v - start->v; + angle_seg = ah_angle( &vec ); + + /* extend the segment start whenever possible */ + before = start; + do + { + do + { + start = before; + before = before->prev; + if ( before == first ) + goto Skip; + + } while ( before->u == start->u && before->v == start->v ); + + vec.x = start->u - before->u; + vec.y = start->v - before->v; + angle_in = ah_angle( &vec ); + + } while ( angle_in == angle_seg ); + + first = start; + diff_in = ah_angle_diff( angle_in, angle_seg ); + + /* now, process all segments in the contour */ + do + { + /* first, extend current segment's end whenever possible */ + after = end; + do + { + do + { + end = after; + after = after->next; + if ( after == first ) + finished = 1; + + } while ( end->u == after->u && end->v == after->v ); + + vec.x = after->u - end->u; + vec.y = after->v - end->v; + angle_out = ah_angle( &vec ); + + } while ( angle_out == angle_seg ); + + diff_out = ah_angle_diff( angle_seg, angle_out ); + + if ( ( diff_in ^ diff_out ) < 0 ) + { + /* diff_in and diff_out have different signs, we have */ + /* inflection points here... */ + + do + { + start->flags |= AH_FLAG_INFLECTION; + start = start->next; + + } while ( start != end ); + + start->flags |= AH_FLAG_INFLECTION; + } + + start = end; + end = after; + angle_seg = angle_out; + diff_in = diff_out; + + } while ( !finished ); + + Skip: + ; + } + } + + FT_LOCAL_DEF( void ) - ah_outline_compute_segments( AH_Outline* outline ) + ah_outline_compute_segments( AH_Outline outline ) { int dimension; - AH_Segment* segments; + AH_Segment segments; FT_Int* p_num_segments; AH_Direction segment_dir; AH_Direction major_dir; @@ -687,36 +805,36 @@ segments = outline->horz_segments; p_num_segments = &outline->num_hsegments; - major_dir = ah_dir_right; /* This value must be positive! */ + major_dir = AH_DIR_RIGHT; /* This value must be positive! */ segment_dir = major_dir; /* set up (u,v) in each point */ - ah_setup_uv( outline, ah_uv_fyx ); + ah_setup_uv( outline, AH_UV_FYX ); for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Point** contour = outline->contours; - AH_Point** contour_limit = contour + outline->num_contours; - AH_Segment* segment = segments; - FT_Int num_segments = 0; + AH_Point* contour = outline->contours; + AH_Point* contour_limit = contour + outline->num_contours; + AH_Segment segment = segments; + FT_Int num_segments = 0; #ifdef AH_HINT_METRICS - AH_Point* min_point = 0; - AH_Point* max_point = 0; - FT_Pos min_coord = 32000; - FT_Pos max_coord = -32000; + AH_Point min_point = 0; + AH_Point max_point = 0; + FT_Pos min_coord = 32000; + FT_Pos max_coord = -32000; #endif /* do each contour separately */ for ( ; contour < contour_limit; contour++ ) { - AH_Point* point = contour[0]; - AH_Point* last = point->prev; - int on_edge = 0; - FT_Pos min_pos = +32000; /* minimum segment pos != min_coord */ - FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */ - FT_Bool passed; + AH_Point point = contour[0]; + AH_Point last = point->prev; + int on_edge = 0; + FT_Pos min_pos = +32000; /* minimum segment pos != min_coord */ + FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */ + FT_Bool passed; #ifdef AH_HINT_METRICS @@ -779,8 +897,8 @@ /* a segment is round if either its first or last point */ /* is a control point */ if ( ( segment->first->flags | point->flags ) & - ah_flag_control ) - segment->flags |= ah_edge_round; + AH_FLAG_CONTROL ) + segment->flags |= AH_EDGE_ROUND; /* compute segment size */ min_pos = max_pos = point->v; @@ -815,10 +933,10 @@ segment_dir = point->out_dir; /* clear all segment fields */ - FT_MEM_SET( segment, 0, sizeof ( *segment ) ); + FT_ZERO( segment ); segment->dir = segment_dir; - segment->flags = ah_edge_normal; + segment->flags = AH_EDGE_NORMAL; min_pos = max_pos = point->u; segment->first = point; segment->last = point; @@ -845,11 +963,11 @@ /* we do this by inserting fake segments when needed */ if ( dimension == 0 ) { - AH_Point* point = outline->points; - AH_Point* point_limit = point + outline->num_points; + AH_Point point = outline->points; + AH_Point point_limit = point + outline->num_points; - FT_Pos min_pos = 32000; - FT_Pos max_pos = -32000; + FT_Pos min_pos = 32000; + FT_Pos max_pos = -32000; min_point = 0; @@ -877,10 +995,10 @@ if ( min_point ) { /* clear all segment fields */ - FT_MEM_SET( segment, 0, sizeof ( *segment ) ); + FT_ZERO( segment ); segment->dir = segment_dir; - segment->flags = ah_edge_normal; + segment->flags = AH_EDGE_NORMAL; segment->first = min_point; segment->last = min_point; segment->pos = min_pos; @@ -893,10 +1011,10 @@ if ( max_point ) { /* clear all segment fields */ - FT_MEM_SET( segment, 0, sizeof ( *segment ) ); + FT_ZERO( segment ); segment->dir = segment_dir; - segment->flags = ah_edge_normal; + segment->flags = AH_EDGE_NORMAL; segment->first = max_point; segment->last = max_point; segment->pos = max_pos; @@ -910,36 +1028,38 @@ *p_num_segments = num_segments; segments = outline->vert_segments; - major_dir = ah_dir_up; + major_dir = AH_DIR_UP; p_num_segments = &outline->num_vsegments; - ah_setup_uv( outline, ah_uv_fxy ); + ah_setup_uv( outline, AH_UV_FXY ); } } FT_LOCAL_DEF( void ) - ah_outline_link_segments( AH_Outline* outline ) + ah_outline_link_segments( AH_Outline outline ) { - AH_Segment* segments; - AH_Segment* segment_limit; - int dimension; + AH_Segment segments; + AH_Segment segment_limit; + int dimension; - ah_setup_uv( outline, ah_uv_fyx ); + ah_setup_uv( outline, AH_UV_FYX ); segments = outline->horz_segments; segment_limit = segments + outline->num_hsegments; for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Segment* seg1; - AH_Segment* seg2; + AH_Segment seg1; + AH_Segment seg2; + /* now compare each segment to the others */ for ( seg1 = segments; seg1 < segment_limit; seg1++ ) { - FT_Pos best_score; - AH_Segment* best_segment; + FT_Pos best_score; + AH_Segment best_segment; + /* the fake segments are introduced to hint the metrics -- */ /* we must never link them to anything */ @@ -983,20 +1103,20 @@ if ( max > seg2->max_coord ) max = seg2->max_coord; - len = max - min; - dist = seg2->pos - seg1->pos; - if ( dist < 0 ) - dist = -dist; - - if ( len < 8 ) - score = 300*8 + dist - len*3; - else - score = dist + 300/len; - - if ( score < best_score ) + len = max - min; + if ( len >= 8 ) { - best_score = score; - best_segment = seg2; + dist = seg2->pos - seg1->pos; + if ( dist < 0 ) + dist = -dist; + + score = dist + 3000 / len; + + if ( score < best_score ) + { + best_score = score; + best_segment = seg2; + } } } } @@ -1009,7 +1129,6 @@ best_segment->num_linked++; } - } /* edges 1 */ /* now, compute the `serif' segments */ @@ -1024,7 +1143,7 @@ } } - ah_setup_uv( outline, ah_uv_fxy ); + ah_setup_uv( outline, AH_UV_FXY ); segments = outline->vert_segments; segment_limit = segments + outline->num_vsegments; @@ -1033,11 +1152,11 @@ static void - ah_outline_compute_edges( AH_Outline* outline ) + ah_outline_compute_edges( AH_Outline outline ) { - AH_Edge* edges; - AH_Segment* segments; - AH_Segment* segment_limit; + AH_Edge edges; + AH_Segment segments; + AH_Segment segment_limit; AH_Direction up_dir; FT_Int* p_num_edges; FT_Int dimension; @@ -1049,14 +1168,14 @@ segments = outline->horz_segments; segment_limit = segments + outline->num_hsegments; p_num_edges = &outline->num_hedges; - up_dir = ah_dir_right; + up_dir = AH_DIR_RIGHT; scale = outline->y_scale; for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Edge* edge; - AH_Edge* edge_limit; /* really == edge + num_edges */ - AH_Segment* seg; + AH_Edge edge; + AH_Edge edge_limit; /* really == edge + num_edges */ + AH_Segment seg; /*********************************************************************/ @@ -1083,7 +1202,7 @@ edge_limit = edges; for ( seg = segments; seg < segment_limit; seg++ ) { - AH_Edge* found = 0; + AH_Edge found = 0; /* look for an edge corresponding to the segment */ @@ -1116,7 +1235,7 @@ edge_limit++; /* clear all edge fields */ - FT_MEM_SET( edge, 0, sizeof ( *edge ) ); + FT_MEM_ZERO( edge, sizeof ( *edge ) ); /* add the segment to the new edge's list */ edge->first = seg; @@ -1167,10 +1286,10 @@ /* now, compute each edge properties */ for ( edge = edges; edge < edge_limit; edge++ ) { - int is_round = 0; /* does it contain round segments? */ - int is_straight = 0; /* does it contain straight segments? */ - int ups = 0; /* number of upwards segments */ - int downs = 0; /* number of downwards segments */ + FT_Int is_round = 0; /* does it contain round segments? */ + FT_Int is_straight = 0; /* does it contain straight segments? */ + FT_Pos ups = 0; /* number of upwards segments */ + FT_Pos downs = 0; /* number of downwards segments */ seg = edge->first; @@ -1181,7 +1300,7 @@ /* check for roundness of segment */ - if ( seg->flags & ah_edge_round ) + if ( seg->flags & AH_EDGE_ROUND ) is_round++; else is_straight++; @@ -1198,8 +1317,8 @@ if ( seg->link || is_serif ) { - AH_Edge* edge2; - AH_Segment* seg2; + AH_Edge edge2; + AH_Segment seg2; edge2 = edge->link; @@ -1231,10 +1350,20 @@ else edge2 = seg2->edge; +#ifdef FT_CONFIG_CHESTER_SERIF + if ( is_serif ) + { + edge->serif = edge2; + edge2->flags |= AH_EDGE_SERIF; + } + else + edge->link = edge2; +#else /* !CHESTER_SERIF */ if ( is_serif ) edge->serif = edge2; else edge->link = edge2; +#endif } seg = seg->edge_next; @@ -1242,13 +1371,13 @@ } while ( seg != edge->first ); /* set the round/straight flags */ - edge->flags = ah_edge_normal; + edge->flags = AH_EDGE_NORMAL; if ( is_round > 0 && is_round >= is_straight ) - edge->flags |= ah_edge_round; + edge->flags |= AH_EDGE_ROUND; /* set the edge's main direction */ - edge->dir = ah_dir_none; + edge->dir = AH_DIR_NONE; if ( ups > downs ) edge->dir = up_dir; @@ -1271,7 +1400,7 @@ segments = outline->vert_segments; segment_limit = segments + outline->num_vsegments; p_num_edges = &outline->num_vedges; - up_dir = ah_dir_up; + up_dir = AH_DIR_UP; scale = outline->x_scale; } } @@ -1283,14 +1412,15 @@ /* ah_outline_detect_features */ /* */ /* <Description> */ - /* Performs feature detection on a given AH_Outline object. */ + /* Performs feature detection on a given AH_OutlineRec object. */ /* */ FT_LOCAL_DEF( void ) - ah_outline_detect_features( AH_Outline* outline ) + ah_outline_detect_features( AH_Outline outline ) { - ah_outline_compute_segments( outline ); - ah_outline_link_segments ( outline ); - ah_outline_compute_edges ( outline ); + ah_outline_compute_segments ( outline ); + ah_outline_link_segments ( outline ); + ah_outline_compute_edges ( outline ); + ah_outline_compute_inflections( outline ); } @@ -1304,15 +1434,15 @@ /* be snapped to a blue zone edge (top or bottom). */ /* */ FT_LOCAL_DEF( void ) - ah_outline_compute_blue_edges( AH_Outline* outline, - AH_Face_Globals* face_globals ) + ah_outline_compute_blue_edges( AH_Outline outline, + AH_Face_Globals face_globals ) { - AH_Edge* edge = outline->horz_edges; - AH_Edge* edge_limit = edge + outline->num_hedges; - AH_Globals* globals = &face_globals->design; - FT_Fixed y_scale = outline->y_scale; + AH_Edge edge = outline->horz_edges; + AH_Edge edge_limit = edge + outline->num_hedges; + AH_Globals globals = &face_globals->design; + FT_Fixed y_scale = outline->y_scale; - FT_Bool blue_active[ah_blue_max]; + FT_Bool blue_active[AH_BLUE_MAX]; /* compute which blue zones are active, i.e. have their scaled */ @@ -1322,7 +1452,7 @@ FT_Bool check = 0; - for ( blue = ah_blue_capital_top; blue < ah_blue_max; blue++ ) + for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ ) { FT_Pos ref, shoot, dist; @@ -1357,10 +1487,16 @@ /* compute the initial threshold as a fraction of the EM size */ best_dist = FT_MulFix( face_globals->face->units_per_EM / 40, y_scale ); + +#ifdef FT_CONFIG_CHESTER_SMALL_F + if ( best_dist > 64 / 2 ) + best_dist = 64 / 2; +#else if ( best_dist > 64 / 4 ) - best_dist = 64 / 4; + best_dist = 64 / 4; +#endif - for ( blue = ah_blue_capital_top; blue < ah_blue_max; blue++ ) + for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ ) { /* if it is a top zone, check for right edges -- if it is a bottom */ /* zone, check for left edges */ @@ -1398,7 +1534,7 @@ /* now, compare it to the overshoot position if the edge is */ /* rounded, and if the edge is over the reference position of a */ /* top zone, or under the reference position of a bottom zone */ - if ( edge->flags & ah_edge_round && dist != 0 ) + if ( edge->flags & AH_EDGE_ROUND && dist != 0 ) { FT_Bool is_under_ref = FT_BOOL( edge->fpos < *blue_pos ); @@ -1438,12 +1574,12 @@ /* edge' pointer from `design units' to `scaled ones'). */ /* */ FT_LOCAL_DEF( void ) - ah_outline_scale_blue_edges( AH_Outline* outline, - AH_Face_Globals* globals ) + ah_outline_scale_blue_edges( AH_Outline outline, + AH_Face_Globals globals ) { - AH_Edge* edge = outline->horz_edges; - AH_Edge* edge_limit = edge + outline->num_hedges; - FT_Int delta; + AH_Edge edge = outline->horz_edges; + AH_Edge edge_limit = edge + outline->num_hedges; + FT_Pos delta; delta = globals->scaled.blue_refs - globals->design.blue_refs; Index: xc/extras/freetype2/src/autohint/ahglyph.h diff -u xc/extras/freetype2/src/autohint/ahglyph.h:1.1.1.4 xc/extras/freetype2/src/autohint/ahglyph.h:1.1.1.5 --- xc/extras/freetype2/src/autohint/ahglyph.h:1.1.1.4 Thu Jun 20 04:16:11 2002 +++ xc/extras/freetype2/src/autohint/ahglyph.h Wed May 28 22:01:48 2003 @@ -33,56 +33,58 @@ typedef enum AH_UV_ { - ah_uv_fxy, - ah_uv_fyx, - ah_uv_oxy, - ah_uv_oyx, - ah_uv_ox, - ah_uv_oy, - ah_uv_yx, - ah_uv_xy /* should always be last! */ + AH_UV_FXY, + AH_UV_FYX, + AH_UV_OXY, + AH_UV_OYX, + AH_UV_OX, + AH_UV_OY, + AH_UV_YX, + AH_UV_XY /* should always be last! */ } AH_UV; FT_LOCAL( void ) - ah_setup_uv( AH_Outline* outline, - AH_UV source ); + ah_setup_uv( AH_Outline outline, + AH_UV source ); - /* AH_Outline functions - they should be typically called in this order */ + /* AH_OutlineRec functions - they should be typically called in this order */ FT_LOCAL( FT_Error ) - ah_outline_new( FT_Memory memory, - AH_Outline** aoutline ); + ah_outline_new( FT_Memory memory, + AH_Outline* aoutline ); FT_LOCAL( FT_Error ) - ah_outline_load( AH_Outline* outline, - FT_Face face ); + ah_outline_load( AH_Outline outline, + FT_Fixed x_scale, + FT_Fixed y_scale, + FT_Face face ); FT_LOCAL( void ) - ah_outline_compute_segments( AH_Outline* outline ); + ah_outline_compute_segments( AH_Outline outline ); FT_LOCAL( void ) - ah_outline_link_segments( AH_Outline* outline ); + ah_outline_link_segments( AH_Outline outline ); FT_LOCAL( void ) - ah_outline_detect_features( AH_Outline* outline ); + ah_outline_detect_features( AH_Outline outline ); FT_LOCAL( void ) - ah_outline_compute_blue_edges( AH_Outline* outline, - AH_Face_Globals* globals ); + ah_outline_compute_blue_edges( AH_Outline outline, + AH_Face_Globals globals ); FT_LOCAL( void ) - ah_outline_scale_blue_edges( AH_Outline* outline, - AH_Face_Globals* globals ); + ah_outline_scale_blue_edges( AH_Outline outline, + AH_Face_Globals globals ); FT_LOCAL( void ) - ah_outline_save( AH_Outline* outline, - AH_Loader loader ); + ah_outline_save( AH_Outline outline, + AH_Loader loader ); FT_LOCAL( void ) - ah_outline_done( AH_Outline* outline ); + ah_outline_done( AH_Outline outline ); FT_END_HEADER Index: xc/extras/freetype2/src/autohint/ahhint.c diff -u xc/extras/freetype2/src/autohint/ahhint.c:1.1.1.7 xc/extras/freetype2/src/autohint/ahhint.c:1.1.1.8 --- xc/extras/freetype2/src/autohint/ahhint.c:1.1.1.7 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/autohint/ahhint.c Wed May 28 22:01:48 2003 @@ -27,10 +27,10 @@ #include FT_OUTLINE_H -#define FACE_GLOBALS( face ) ((AH_Face_Globals*)(face)->autohint.data) +#define FACE_GLOBALS( face ) ((AH_Face_Globals)(face)->autohint.data) #define AH_USE_IUP - +#define OPTIM_STEM_SNAP /*************************************************************************/ /*************************************************************************/ @@ -40,7 +40,6 @@ /*************************************************************************/ /*************************************************************************/ - /* snap a given width in scaled coordinates to one of the */ /* current standard widths */ static FT_Pos @@ -51,6 +50,7 @@ int n; FT_Pos best = 64 + 32 + 2; FT_Pos reference = width; + FT_Pos scaled; for ( n = 0; n < count; n++ ) @@ -70,16 +70,16 @@ } } + scaled = (reference+32) & -64; + if ( width >= reference ) { - width -= 0x21; - if ( width < reference ) + if ( width < scaled + 48 ) width = reference; } else { - width += 0x21; - if ( width > reference ) + if ( width > scaled - 48 ) width = reference; } @@ -87,79 +87,289 @@ } - /* align one stem edge relative to the previous stem edge */ - static void - ah_align_linked_edge( AH_Hinter* hinter, - AH_Edge* base_edge, - AH_Edge* stem_edge, - int vertical ) - { - FT_Pos dist = stem_edge->opos - base_edge->opos; - AH_Globals* globals = &hinter->globals->scaled; - FT_Pos sign = 1; + /* compute the snapped width of a given stem */ +#ifdef FT_CONFIG_CHESTER_SERIF + static FT_Pos + ah_compute_stem_width( AH_Hinter hinter, + int vertical, + FT_Pos width, + AH_Edge_Flags base_flags, + AH_Edge_Flags stem_flags ) + { + AH_Globals globals = &hinter->globals->scaled; + FT_Pos dist = width; + FT_Int sign = 0; if ( dist < 0 ) { - dist = -dist; - sign = -1; + dist = -width; + sign = 1; } - if ( vertical ) + if ( !hinter->do_stem_adjust ) { - dist = ah_snap_width( globals->heights, globals->num_heights, dist ); - - /* in the case of vertical hinting, always round */ - /* the stem heights to integer pixels */ - if ( dist >= 64 ) - dist = ( dist + 16 ) & -64; - else - dist = 64; + /* leave stem widths unchanged */ } - else + else if ( ( vertical && !hinter->do_vert_snapping ) || + ( !vertical && !hinter->do_horz_snapping ) ) { - dist = ah_snap_width( globals->widths, globals->num_widths, dist ); + /* smooth hinting process, very lightly quantize the stem width */ + /* */ + + /* leave the widths of serifs alone */ - if ( hinter->flags & ah_hinter_monochrome ) + if ( ( stem_flags & AH_EDGE_SERIF ) && vertical && ( dist < 3 * 64 ) ) + goto Done_Width; + + else if ( ( base_flags & AH_EDGE_ROUND ) ) { - /* monochrome horizontal hinting: snap widths to integer pixels */ - /* with a different threshold */ - if ( dist < 64 ) + if ( dist < 80 ) dist = 64; + } + else if ( dist < 56 ) + dist = 56; + + { + FT_Pos delta = dist - globals->stds[vertical]; + + + if ( delta < 0 ) + delta = -delta; + + if ( delta < 40 ) + { + dist = globals->stds[vertical]; + if ( dist < 48 ) + dist = 48; + + goto Done_Width; + } + + if ( dist < 3 * 64 ) + { + delta = ( dist & 63 ); + dist &= -64; + + if ( delta < 10 ) + dist += delta; + + else if ( delta < 32 ) + dist += 10; + + else if ( delta < 54 ) + dist += 54; + + else + dist += delta; + } else dist = ( dist + 32 ) & -64; } + } + else + { + /* strong hinting process, snap the stem width to integer pixels */ + /* */ + if ( vertical ) + { + dist = ah_snap_width( globals->heights, globals->num_heights, dist ); + + /* in the case of vertical hinting, always round */ + /* the stem heights to integer pixels */ + if ( dist >= 64 ) + dist = ( dist + 16 ) & -64; + else + dist = 64; + } else { - /* for horizontal anti-aliased hinting, we adopt a more subtle */ - /* approach: we strengthen small stems, round stems whose size */ - /* is between 1 and 2 pixels to an integer, otherwise nothing */ - if ( dist < 48 ) - dist = ( dist + 64 ) >> 1; + dist = ah_snap_width( globals->widths, globals->num_widths, dist ); + + if ( hinter->flags & AH_HINTER_MONOCHROME ) + { + /* monochrome horizontal hinting: snap widths to integer pixels */ + /* with a different threshold */ + if ( dist < 64 ) + dist = 64; + else + dist = ( dist + 32 ) & -64; + } + else + { + /* for horizontal anti-aliased hinting, we adopt a more subtle */ + /* approach: we strengthen small stems, round stems whose size */ + /* is between 1 and 2 pixels to an integer, otherwise nothing */ + if ( dist < 48 ) + dist = ( dist + 64 ) >> 1; + + else if ( dist < 128 ) + dist = ( dist + 22 ) & -64; + else + /* XXX: round otherwise, prevent color fringes in LCD mode */ + dist = ( dist + 32 ) & -64; + } + } + } + + Done_Width: + if ( sign ) + dist = -dist; + + return dist; + } +#else /* !CHESTER_SERIF */ + static FT_Pos + ah_compute_stem_width( AH_Hinter hinter, + int vertical, + FT_Pos width ) + { + AH_Globals globals = &hinter->globals->scaled; + FT_Pos dist = width; + FT_Int sign = 0; + + + if ( dist < 0 ) + { + dist = -width; + sign = 1; + } + + if ( !hinter->do_stem_adjust ) + { + /* leave stem widths unchanged */ + } + else if ( ( vertical && !hinter->do_vert_snapping ) || + ( !vertical && !hinter->do_horz_snapping ) ) + { + /* smooth hinting process, very lightly quantize the stem width */ + /* */ + if ( dist < 64 ) + dist = 64; + + { + FT_Pos delta = dist - globals->stds[vertical]; + - else if ( dist < 128 ) - dist = ( dist + 42 ) & -64; + if ( delta < 0 ) + delta = -delta; + + if ( delta < 40 ) + { + dist = globals->stds[vertical]; + if ( dist < 48 ) + dist = 48; + } + + if ( dist < 3 * 64 ) + { + delta = ( dist & 63 ); + dist &= -64; + + if ( delta < 10 ) + dist += delta; + + else if ( delta < 32 ) + dist += 10; + + else if ( delta < 54 ) + dist += 54; + + else + dist += delta; + } else - /* XXX: round otherwise, prevent color fringes in LCD mode */ dist = ( dist + 32 ) & -64; } } + else + { + /* strong hinting process, snap the stem width to integer pixels */ + /* */ + if ( vertical ) + { + dist = ah_snap_width( globals->heights, globals->num_heights, dist ); + + /* in the case of vertical hinting, always round */ + /* the stem heights to integer pixels */ + if ( dist >= 64 ) + dist = ( dist + 16 ) & -64; + else + dist = 64; + } + else + { + dist = ah_snap_width( globals->widths, globals->num_widths, dist ); + + if ( hinter->flags & AH_HINTER_MONOCHROME ) + { + /* monochrome horizontal hinting: snap widths to integer pixels */ + /* with a different threshold */ + if ( dist < 64 ) + dist = 64; + else + dist = ( dist + 32 ) & -64; + } + else + { + /* for horizontal anti-aliased hinting, we adopt a more subtle */ + /* approach: we strengthen small stems, round stems whose size */ + /* is between 1 and 2 pixels to an integer, otherwise nothing */ + if ( dist < 48 ) + dist = ( dist + 64 ) >> 1; + + else if ( dist < 128 ) + dist = ( dist + 22 ) & -64; + else + /* XXX: round otherwise, prevent color fringes in LCD mode */ + dist = ( dist + 32 ) & -64; + } + } + } - stem_edge->pos = base_edge->pos + sign * dist; + if ( sign ) + dist = -dist; + + return dist; } +#endif /* !CHESTER_SERIF */ + /* align one stem edge relative to the previous stem edge */ static void - ah_align_serif_edge( AH_Hinter* hinter, - AH_Edge* base, - AH_Edge* serif, - int vertical ) + ah_align_linked_edge( AH_Hinter hinter, + AH_Edge base_edge, + AH_Edge stem_edge, + int vertical ) + { + FT_Pos dist = stem_edge->opos - base_edge->opos; + +#ifdef FT_CONFIG_CHESTER_SERIF + FT_Pos fitted_width = ah_compute_stem_width( hinter, + vertical, + dist, + base_edge->flags, + stem_edge->flags ); + + stem_edge->pos = base_edge->pos + fitted_width; +#else + stem_edge->pos = base_edge->pos + + ah_compute_stem_width( hinter, vertical, dist ); +#endif + } + + + static void + ah_align_serif_edge( AH_Hinter hinter, + AH_Edge base, + AH_Edge serif, + int vertical ) { FT_Pos dist; FT_Pos sign = 1; FT_UNUSED( hinter ); - + FT_UNUSED( vertical ); dist = serif->opos - base->opos; if ( dist < 0 ) @@ -168,8 +378,9 @@ sign = -1; } - /* do not strengthen serifs */ - if ( base->flags & ah_edge_done ) + /* do not touch serifs widths !! */ +#if 0 + if ( base->flags & AH_EDGE_DONE ) { if ( dist >= 64 ) dist = (dist+8) & -64; @@ -179,6 +390,7 @@ else dist = 0; } +#endif serif->pos = base->pos + sign * dist; } @@ -197,12 +409,12 @@ /* Another alternative edge hinting algorithm */ static void - ah_hint_edges_3( AH_Hinter* hinter ) + ah_hint_edges_3( AH_Hinter hinter ) { - AH_Edge* edges; - AH_Edge* edge_limit; - AH_Outline* outline = hinter->glyph; - FT_Int dimension; + AH_Edge edges; + AH_Edge edge_limit; + AH_Outline outline = hinter->glyph; + FT_Int dimension; edges = outline->horz_edges; @@ -210,15 +422,15 @@ for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Edge* edge; - AH_Edge* anchor = 0; - int has_serifs = 0; + AH_Edge edge; + AH_Edge anchor = 0; + int has_serifs = 0; - if ( ah_debug_disable_vert && !dimension ) + if ( !hinter->do_horz_hints && !dimension ) goto Next_Dimension; - if ( ah_debug_disable_horz && dimension ) + if ( !hinter->do_vert_hints && dimension ) goto Next_Dimension; /* we begin by aligning all stems relative to the blue zone */ @@ -227,11 +439,11 @@ { for ( edge = edges; edge < edge_limit; edge++ ) { - FT_Pos* blue; - AH_Edge *edge1, *edge2; + FT_Pos* blue; + AH_EdgeRec *edge1, *edge2; - if ( edge->flags & ah_edge_done ) + if ( edge->flags & AH_EDGE_DONE ) continue; blue = edge->blue_edge; @@ -253,12 +465,12 @@ continue; edge1->pos = blue[0]; - edge1->flags |= ah_edge_done; + edge1->flags |= AH_EDGE_DONE; if ( edge2 && !edge2->blue_edge ) { ah_align_linked_edge( hinter, edge1, edge2, dimension ); - edge2->flags |= ah_edge_done; + edge2->flags |= AH_EDGE_DONE; } if ( !anchor ) @@ -270,10 +482,10 @@ /* relative order of stems in the glyph.. */ for ( edge = edges; edge < edge_limit; edge++ ) { - AH_Edge *edge2; + AH_EdgeRec* edge2; - if ( edge->flags & ah_edge_done ) + if ( edge->flags & AH_EDGE_DONE ) continue; /* skip all non-stem edges */ @@ -286,54 +498,168 @@ /* now, align the stem */ - /* this should not happen, but it's better to be safe.. */ + /* this should not happen, but it's better to be safe. */ if ( edge2->blue_edge || edge2 < edge ) { -#if 0 - printf( "strange blue alignement, edge %d to %d\n", - edge - edges, edge2 - edges ); -#endif - ah_align_linked_edge( hinter, edge2, edge, dimension ); - edge->flags |= ah_edge_done; + edge->flags |= AH_EDGE_DONE; continue; } + if ( !anchor ) { - FT_Bool min = 0; - FT_Pos delta; +#ifdef FT_CONFIG_CHESTER_STEM + FT_Pos org_len, org_center, cur_len; + FT_Pos cur_pos1, error1, error2, u_off, d_off; + + org_len = edge2->opos - edge->opos; + cur_len = ah_compute_stem_width( hinter, dimension, org_len, + edge->flags, edge2->flags ); - if ( !anchor ) + if (cur_len <= 64 ) + u_off = d_off = 32; + else { - edge->pos = ( edge->opos + 32 ) & -64; - anchor = edge; + u_off = 38; + d_off = 26; + } + + if ( cur_len < 96 ) + { + org_center = edge->opos + ( org_len >> 1 ); + + cur_pos1 = ( org_center + 32 ) & -64; + + error1 = org_center - ( cur_pos1 - u_off ); + if ( error1 < 0 ) + error1 = -error1; + + error2 = org_center - ( cur_pos1 + d_off ); + if ( error2 < 0 ) + error2 = -error2; + + if ( error1 < error2 ) + cur_pos1 -= u_off; + else + cur_pos1 += d_off; + + edge->pos = cur_pos1 - cur_len / 2; + edge2->pos = cur_pos1 + cur_len / 2; + } else - edge->pos = anchor->pos + - ( ( edge->opos - anchor->opos + 32 ) & -64 ); + edge->pos = ( edge->opos + 32 ) & -64; - edge->flags |= ah_edge_done; + anchor = edge; - if ( edge > edges && edge->pos < edge[-1].pos ) + edge->flags |= AH_EDGE_DONE; + + ah_align_linked_edge( hinter, edge, edge2, dimension ); +#else /* !CHESTER_STEM */ + edge->pos = ( edge->opos + 32 ) & -64; + anchor = edge; + + edge->flags |= AH_EDGE_DONE; + + ah_align_linked_edge( hinter, edge, edge2, dimension ); +#endif /* !CHESTER_STEM */ + } + else + { + FT_Pos org_pos, org_len, org_center, cur_len; + FT_Pos cur_pos1, cur_pos2, delta1, delta2; + + + org_pos = anchor->pos + (edge->opos - anchor->opos); + org_len = edge2->opos - edge->opos; + org_center = org_pos + ( org_len >> 1 ); + +#ifdef FT_CONFIG_CHESTER_SERIF + cur_len = ah_compute_stem_width( hinter, dimension, org_len, + edge->flags, edge2->flags ); +#else /* !CHESTER_SERIF */ + cur_len = ah_compute_stem_width( hinter, dimension, org_len ); +#endif /* !CHESTER_SERIF */ + +#ifdef FT_CONFIG_CHESTER_STEM + if ( cur_len < 96 ) { - edge->pos = edge[-1].pos; - min = 1; + FT_Pos u_off, d_off; + + + cur_pos1 = ( org_center + 32 ) & -64; + + if (cur_len <= 64 ) + u_off = d_off = 32; + else + { + u_off = 38; + d_off = 26; + } + + delta1 = org_center - (cur_pos1 - u_off); + if ( delta1 < 0 ) + delta1 = -delta1; + + delta2 = org_center - (cur_pos1 + d_off); + if ( delta2 < 0 ) + delta2 = -delta2; + + if ( delta1 < delta2 ) + cur_pos1 -= u_off; + else + cur_pos1 += d_off; + + edge->pos = cur_pos1 - cur_len / 2; + edge2->pos = cur_pos1 + cur_len / 2; } + else + { - ah_align_linked_edge( hinter, edge, edge2, dimension ); - delta = 0; - if ( edge2 + 1 < edge_limit && - edge2[1].flags & ah_edge_done ) - delta = edge2[1].pos - edge2->pos; - - if ( delta < 0 ) - { - edge2->pos += delta; - if ( !min ) - edge->pos += delta; + org_pos = anchor->pos + (edge->opos - anchor->opos); + org_len = edge2->opos - edge->opos; + org_center = org_pos + ( org_len >> 1 ); + + cur_len = ah_compute_stem_width( hinter, dimension, org_len, + edge->flags, edge2->flags ); + + cur_pos1 = ( org_pos + 32 ) & -64; + delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center ); + if ( delta1 < 0 ) + delta1 = -delta1; + + cur_pos2 = ( ( org_pos + org_len + 32 ) & -64 ) - cur_len; + delta2 = ( cur_pos2 + ( cur_len >> 1 ) - org_center ); + if ( delta2 < 0 ) + delta2 = -delta2; + + edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2; + edge2->pos = edge->pos + cur_len; } - edge2->flags |= ah_edge_done; + +#else /* !CHESTER_STEM */ + + cur_pos1 = ( org_pos + 32 ) & -64; + delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center ); + if ( delta1 < 0 ) + delta1 = -delta1; + + cur_pos2 = ( ( org_pos + org_len + 32 ) & -64 ) - cur_len; + delta2 = ( cur_pos2 + ( cur_len >> 1 ) - org_center ); + if ( delta2 < 0 ) + delta2 = -delta2; + + edge->pos = ( delta1 <= delta2 ) ? cur_pos1 : cur_pos2; + edge2->pos = edge->pos + cur_len; + +#endif /* !CHESTER_STEM */ + + edge->flags |= AH_EDGE_DONE; + edge2->flags |= AH_EDGE_DONE; + + if ( edge > edges && edge->pos < edge[-1].pos ) + edge->pos = edge[-1].pos; } } @@ -344,13 +670,11 @@ /* to complete our processing */ for ( edge = edges; edge < edge_limit; edge++ ) { - if ( edge->flags & ah_edge_done ) + if ( edge->flags & AH_EDGE_DONE ) continue; if ( edge->serif ) - { ah_align_serif_edge( hinter, edge->serif, edge, dimension ); - } else if ( !anchor ) { edge->pos = ( edge->opos + 32 ) & -64; @@ -360,13 +684,13 @@ edge->pos = anchor->pos + ( ( edge->opos-anchor->opos + 32 ) & -64 ); - edge->flags |= ah_edge_done; + edge->flags |= AH_EDGE_DONE; if ( edge > edges && edge->pos < edge[-1].pos ) edge->pos = edge[-1].pos; if ( edge + 1 < edge_limit && - edge[1].flags & ah_edge_done && + edge[1].flags & AH_EDGE_DONE && edge->pos > edge[1].pos ) edge->pos = edge[1].pos; } @@ -379,38 +703,13 @@ FT_LOCAL_DEF( void ) - ah_hinter_hint_edges( AH_Hinter* hinter, - FT_Bool no_horz_edges, - FT_Bool no_vert_edges ) + ah_hinter_hint_edges( AH_Hinter hinter ) { -#if 0 - ah_debug_disable_horz = no_horz_edges; - ah_debug_disable_vert = no_vert_edges; -#else - FT_UNUSED( no_horz_edges ); - FT_UNUSED( no_vert_edges ); -#endif /* AH_Interpolate_Blue_Edges( hinter ); -- doesn't seem to help */ /* reduce the problem of the disappearing eye in the `e' of Times... */ /* also, creates some artifacts near the blue zones? */ { ah_hint_edges_3( hinter ); - -#if 0 - /* outline optimizer removed temporarily */ - if ( hinter->flags & ah_hinter_optimize ) - { - AH_Optimizer opt; - - - if ( !AH_Optimizer_Init( &opt, hinter->glyph, hinter->memory ) ) - { - AH_Optimizer_Compute( &opt ); - AH_Optimizer_Done( &opt ); - } - } -#endif - } } @@ -426,12 +725,12 @@ /*************************************************************************/ static void - ah_hinter_align_edge_points( AH_Hinter* hinter ) + ah_hinter_align_edge_points( AH_Hinter hinter ) { - AH_Outline* outline = hinter->glyph; - AH_Edge* edges; - AH_Edge* edge_limit; - FT_Int dimension; + AH_Outline outline = hinter->glyph; + AH_Edge edges; + AH_Edge edge_limit; + FT_Int dimension; edges = outline->horz_edges; @@ -439,7 +738,7 @@ for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Edge* edge; + AH_Edge edge; edge = edges; @@ -447,12 +746,12 @@ { /* move the points of each segment */ /* in each edge to the edge's position */ - AH_Segment* seg = edge->first; + AH_Segment seg = edge->first; do { - AH_Point* point = seg->first; + AH_Point point = seg->first; for (;;) @@ -460,12 +759,12 @@ if ( dimension ) { point->y = edge->pos; - point->flags |= ah_flag_touch_y; + point->flags |= AH_FLAG_TOUCH_Y; } else { point->x = edge->pos; - point->flags |= ah_flag_touch_x; + point->flags |= AH_FLAG_TOUCH_X; } if ( point == seg->last ) @@ -487,15 +786,15 @@ /* hint the strong points -- this is equivalent to the TrueType `IP' */ static void - ah_hinter_align_strong_points( AH_Hinter* hinter ) + ah_hinter_align_strong_points( AH_Hinter hinter ) { - AH_Outline* outline = hinter->glyph; - FT_Int dimension; - AH_Edge* edges; - AH_Edge* edge_limit; - AH_Point* points; - AH_Point* point_limit; - AH_Flags touch_flag; + AH_Outline outline = hinter->glyph; + FT_Int dimension; + AH_Edge edges; + AH_Edge edge_limit; + AH_Point points; + AH_Point point_limit; + AH_Flags touch_flag; points = outline->points; @@ -503,12 +802,12 @@ edges = outline->horz_edges; edge_limit = edges + outline->num_hedges; - touch_flag = ah_flag_touch_y; + touch_flag = AH_FLAG_TOUCH_Y; for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Point* point; - AH_Edge* edge; + AH_Point point; + AH_Edge edge; if ( edges < edge_limit ) @@ -524,7 +823,8 @@ #ifndef AH_OPTION_NO_WEAK_INTERPOLATION /* if this point is candidate to weak interpolation, we will */ /* interpolate it after all strong points have been processed */ - if ( point->flags & ah_flag_weak_interpolation ) + if ( ( point->flags & AH_FLAG_WEAK_INTERPOLATION ) && + !( point->flags & AH_FLAG_INFLECTION ) ) continue; #endif @@ -561,8 +861,8 @@ /* otherwise, interpolate the point in between */ { - AH_Edge* before = 0; - AH_Edge* after = 0; + AH_Edge before = 0; + AH_Edge after = 0; for ( edge = edges; edge < edge_limit; edge++ ) @@ -608,7 +908,7 @@ edges = outline->vert_edges; edge_limit = edges + outline->num_vedges; - touch_flag = ah_flag_touch_x; + touch_flag = AH_FLAG_TOUCH_X; } } @@ -616,12 +916,12 @@ #ifndef AH_OPTION_NO_WEAK_INTERPOLATION static void - ah_iup_shift( AH_Point* p1, - AH_Point* p2, - AH_Point* ref ) + ah_iup_shift( AH_Point p1, + AH_Point p2, + AH_Point ref ) { - AH_Point* p; - FT_Pos delta = ref->u - ref->v; + AH_Point p; + FT_Pos delta = ref->u - ref->v; for ( p = p1; p < ref; p++ ) @@ -633,17 +933,17 @@ static void - ah_iup_interp( AH_Point* p1, - AH_Point* p2, - AH_Point* ref1, - AH_Point* ref2 ) - { - AH_Point* p; - FT_Pos u; - FT_Pos v1 = ref1->v; - FT_Pos v2 = ref2->v; - FT_Pos d1 = ref1->u - v1; - FT_Pos d2 = ref2->u - v2; + ah_iup_interp( AH_Point p1, + AH_Point p2, + AH_Point ref1, + AH_Point ref2 ) + { + AH_Point p; + FT_Pos u; + FT_Pos v1 = ref1->v; + FT_Pos v2 = ref2->v; + FT_Pos d1 = ref1->u - v1; + FT_Pos d2 = ref2->u - v2; if ( p1 > p2 ) @@ -702,14 +1002,14 @@ /* interpolate weak points -- this is equivalent to the TrueType `IUP' */ static void - ah_hinter_align_weak_points( AH_Hinter* hinter ) + ah_hinter_align_weak_points( AH_Hinter hinter ) { - AH_Outline* outline = hinter->glyph; - FT_Int dimension; - AH_Point* points; - AH_Point* point_limit; - AH_Point** contour_limit; - AH_Flags touch_flag; + AH_Outline outline = hinter->glyph; + FT_Int dimension; + AH_Point points; + AH_Point point_limit; + AH_Point* contour_limit; + AH_Flags touch_flag; points = outline->points; @@ -717,18 +1017,18 @@ /* PASS 1: Move segment points to edge positions */ - touch_flag = ah_flag_touch_y; + touch_flag = AH_FLAG_TOUCH_Y; contour_limit = outline->contours + outline->num_contours; - ah_setup_uv( outline, ah_uv_oy ); + ah_setup_uv( outline, AH_UV_OY ); for ( dimension = 1; dimension >= 0; dimension-- ) { - AH_Point* point; - AH_Point* end_point; - AH_Point* first_point; - AH_Point** contour; + AH_Point point; + AH_Point end_point; + AH_Point first_point; + AH_Point* contour; point = points; @@ -745,8 +1045,8 @@ if ( point <= end_point ) { - AH_Point* first_touched = point; - AH_Point* cur_touched = point; + AH_Point first_touched = point; + AH_Point cur_touched = point; point++; @@ -791,8 +1091,8 @@ for ( point = points; point < point_limit; point++ ) point->y = point->u; - touch_flag = ah_flag_touch_x; - ah_setup_uv( outline, ah_uv_ox ); + touch_flag = AH_FLAG_TOUCH_X; + ah_setup_uv( outline, AH_UV_OX ); } else { @@ -808,7 +1108,7 @@ FT_LOCAL_DEF( void ) - ah_hinter_align_points( AH_Hinter* hinter ) + ah_hinter_align_points( AH_Hinter hinter ) { ah_hinter_align_edge_points( hinter ); @@ -835,14 +1135,14 @@ /* scale and fit the global metrics */ static void - ah_hinter_scale_globals( AH_Hinter* hinter, - FT_Fixed x_scale, - FT_Fixed y_scale ) - { - FT_Int n; - AH_Face_Globals* globals = hinter->globals; - AH_Globals* design = &globals->design; - AH_Globals* scaled = &globals->scaled; + ah_hinter_scale_globals( AH_Hinter hinter, + FT_Fixed x_scale, + FT_Fixed y_scale ) + { + FT_Int n; + AH_Face_Globals globals = hinter->globals; + AH_Globals design = &globals->design; + AH_Globals scaled = &globals->scaled; /* copy content */ @@ -855,8 +1155,11 @@ for ( n = 0; n < design->num_heights; n++ ) scaled->heights[n] = FT_MulFix( design->heights[n], y_scale ); + scaled->stds[0] = ( design->num_widths > 0 ) ? scaled->widths[0] : 32000; + scaled->stds[1] = ( design->num_heights > 0 ) ? scaled->heights[0] : 32000; + /* scale the blue zones */ - for ( n = 0; n < ah_blue_max; n++ ) + for ( n = 0; n < AH_BLUE_MAX; n++ ) { FT_Pos delta, delta2; @@ -888,7 +1191,7 @@ static void - ah_hinter_align( AH_Hinter* hinter ) + ah_hinter_align( AH_Hinter hinter ) { ah_hinter_align_edge_points( hinter ); ah_hinter_align_points( hinter ); @@ -897,7 +1200,7 @@ /* finalize a hinter object */ FT_LOCAL_DEF( void ) - ah_hinter_done( AH_Hinter* hinter ) + ah_hinter_done( AH_Hinter hinter ) { if ( hinter ) { @@ -920,12 +1223,12 @@ /* create a new empty hinter object */ FT_LOCAL_DEF( FT_Error ) - ah_hinter_new( FT_Library library, - AH_Hinter** ahinter ) + ah_hinter_new( FT_Library library, + AH_Hinter *ahinter ) { - AH_Hinter* hinter = 0; - FT_Memory memory = library->memory; - FT_Error error; + AH_Hinter hinter = 0; + FT_Memory memory = library->memory; + FT_Error error; *ahinter = 0; @@ -956,13 +1259,13 @@ /* create a face's autohint globals */ FT_LOCAL_DEF( FT_Error ) - ah_hinter_new_face_globals( AH_Hinter* hinter, - FT_Face face, - AH_Globals* globals ) + ah_hinter_new_face_globals( AH_Hinter hinter, + FT_Face face, + AH_Globals globals ) { - FT_Error error; - FT_Memory memory = hinter->memory; - AH_Face_Globals* face_globals; + FT_Error error; + FT_Memory memory = hinter->memory; + AH_Face_Globals face_globals; if ( FT_NEW( face_globals ) ) @@ -988,7 +1291,7 @@ /* discard a face's autohint globals */ FT_LOCAL_DEF( void ) - ah_hinter_done_face_globals( AH_Face_Globals* globals ) + ah_hinter_done_face_globals( AH_Face_Globals globals ) { FT_Face face = globals->face; FT_Memory memory = face->memory; @@ -999,23 +1302,19 @@ static FT_Error - ah_hinter_load( AH_Hinter* hinter, - FT_UInt glyph_index, - FT_UInt load_flags, - FT_UInt depth ) + ah_hinter_load( AH_Hinter hinter, + FT_UInt glyph_index, + FT_Int32 load_flags, + FT_UInt depth ) { FT_Face face = hinter->face; FT_GlyphSlot slot = face->glyph; FT_Slot_Internal internal = slot->internal; - FT_Fixed x_scale = face->size->metrics.x_scale; - FT_Fixed y_scale = face->size->metrics.y_scale; + FT_Fixed x_scale = hinter->globals->x_scale; + FT_Fixed y_scale = hinter->globals->y_scale; FT_Error error; - AH_Outline* outline = hinter->glyph; + AH_Outline outline = hinter->glyph; AH_Loader gloader = hinter->loader; - FT_Bool no_horz_hints = FT_BOOL( - ( load_flags & AH_HINT_NO_HORZ_EDGES ) != 0 ); - FT_Bool no_vert_hints = FT_BOOL( - ( load_flags & AH_HINT_NO_VERT_EDGES ) != 0 ); /* load the glyph */ @@ -1030,6 +1329,7 @@ { FT_Matrix imatrix; + imatrix = internal->glyph_matrix; hinter->trans_delta = internal->glyph_delta; hinter->trans_matrix = imatrix; @@ -1044,7 +1344,7 @@ switch ( slot->format ) { - case ft_glyph_format_outline: + case FT_GLYPH_FORMAT_OUTLINE: /* translate glyph outline if we need to */ if ( hinter->transformed ) @@ -1091,21 +1391,21 @@ /* now, load the slot image into the auto-outline, and run the */ /* automatic hinting process */ - error = ah_outline_load( outline, face ); /* XXX: change to slot */ + error = ah_outline_load( outline, x_scale, y_scale, face ); if ( error ) goto Exit; /* perform feature detection */ ah_outline_detect_features( outline ); - if ( !no_horz_hints ) + if ( hinter->do_vert_hints ) { ah_outline_compute_blue_edges( outline, hinter->globals ); ah_outline_scale_blue_edges( outline, hinter->globals ); } /* perform alignment control */ - ah_hinter_hint_edges( hinter, no_horz_hints, no_vert_hints ); + ah_hinter_hint_edges( hinter ); ah_hinter_align( hinter ); /* now save the current outline into the loader's current table */ @@ -1114,10 +1414,10 @@ /* we now need to hint the metrics according to the change in */ /* width/positioning that occured during the hinting process */ { - FT_Pos old_advance, old_rsb, old_lsb, new_lsb; - AH_Edge* edge1 = outline->vert_edges; /* leftmost edge */ - AH_Edge* edge2 = edge1 + - outline->num_vedges - 1; /* rightmost edge */ + FT_Pos old_advance, old_rsb, old_lsb, new_lsb; + AH_Edge edge1 = outline->vert_edges; /* leftmost edge */ + AH_Edge edge2 = edge1 + + outline->num_vedges - 1; /* rightmost edge */ old_advance = hinter->pp2.x; @@ -1128,16 +1428,18 @@ hinter->pp1.x = ( ( new_lsb - old_lsb ) + 32 ) & -64; hinter->pp2.x = ( ( edge2->pos + old_rsb ) + 32 ) & -64; +#if 0 /* try to fix certain bad advance computations */ if ( hinter->pp2.x + hinter->pp1.x == edge2->pos && old_rsb > 4 ) hinter->pp2.x += 64; +#endif } /* good, we simply add the glyph to our loader's base */ ah_loader_add( gloader ); break; - case ft_glyph_format_composite: + case FT_GLYPH_FORMAT_COMPOSITE: { FT_UInt nn, num_subglyphs = slot->num_subglyphs; FT_UInt num_base_subgs, start_point; @@ -1314,7 +1616,7 @@ goto Exit; slot->outline = slot->internal->loader->base.outline; - slot->format = ft_glyph_format_outline; + slot->format = FT_GLYPH_FORMAT_OUTLINE; } #ifdef DEBUG_HINTER @@ -1328,17 +1630,18 @@ /* load and hint a given glyph */ FT_LOCAL_DEF( FT_Error ) - ah_hinter_load_glyph( AH_Hinter* hinter, + ah_hinter_load_glyph( AH_Hinter hinter, FT_GlyphSlot slot, FT_Size size, FT_UInt glyph_index, - FT_Int load_flags ) + FT_Int32 load_flags ) { - FT_Face face = slot->face; - FT_Error error; - FT_Fixed x_scale = size->metrics.x_scale; - FT_Fixed y_scale = size->metrics.y_scale; - AH_Face_Globals* face_globals = FACE_GLOBALS( face ); + FT_Face face = slot->face; + FT_Error error; + FT_Fixed x_scale = size->metrics.x_scale; + FT_Fixed y_scale = size->metrics.y_scale; + AH_Face_Globals face_globals = FACE_GLOBALS( face ); + FT_Render_Mode hint_mode = FT_LOAD_TARGET_MODE(load_flags); /* first of all, we need to check that we're using the correct face and */ @@ -1358,6 +1661,36 @@ } +#ifdef FT_CONFIG_CHESTER_BLUE_SCALE + /* try to optimize the y_scale so that the top of non-capital letters + * is aligned on a pixel boundary whenever possible + */ + { + AH_Globals design = &face_globals->design; + FT_Pos shoot = design->blue_shoots[ AH_BLUE_SMALL_TOP ]; + + /* the value of 'shoot' will be -1000 if the font doesn't have */ + /* small latin letters; we simply check the sign here... */ + if ( shoot > 0 ) + { + FT_Pos scaled = FT_MulFix( shoot, y_scale ); + FT_Pos fitted = ( scaled + 32 ) & -64; + + if ( scaled != fitted ) + { + /* adjust y_scale + */ + y_scale = FT_MulDiv( y_scale, fitted, scaled ); + + /* adust x_scale + */ + if ( fitted < scaled ) + x_scale -= x_scale/50; /* x_scale*0.98 with integers */ + } + } + } +#endif /* FT_CONFIG_CHESTER_BLUE_SCALE */ + /* now, we must check the current character pixel size to see if we */ /* need to rescale the global metrics */ if ( face_globals->x_scale != x_scale || @@ -1366,6 +1699,27 @@ ah_loader_rewind( hinter->loader ); + /* reset hinting flags according to load flags and current render target */ + hinter->do_horz_hints = FT_BOOL( !(load_flags & FT_LOAD_NO_AUTOHINT) ); + hinter->do_vert_hints = FT_BOOL( !(load_flags & FT_LOAD_NO_AUTOHINT) ); + +#ifdef DEBUG_HINTER + hinter->do_horz_hints = !ah_debug_disable_vert; /* not a bug, the meaning */ + hinter->do_vert_hints = !ah_debug_disable_horz; /* of h/v is inverted! */ +#endif + + /* we snap the width of vertical stems for the monochrome and */ + /* horizontal LCD rendering targets only. Corresponds to X snapping. */ + hinter->do_horz_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || + hint_mode == FT_RENDER_MODE_LCD ); + + /* we snap the width of horizontal stems for the monochrome and */ + /* vertical LCD rendering targets only. Corresponds to Y snapping. */ + hinter->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || + hint_mode == FT_RENDER_MODE_LCD_V ); + + hinter->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT ); + #if 1 load_flags = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM ; @@ -1382,14 +1736,14 @@ /* retrieve a face's autohint globals for client applications */ FT_LOCAL_DEF( void ) - ah_hinter_get_global_hints( AH_Hinter* hinter, - FT_Face face, - void** global_hints, - long* global_len ) + ah_hinter_get_global_hints( AH_Hinter hinter, + FT_Face face, + void** global_hints, + long* global_len ) { - AH_Globals* globals = 0; - FT_Memory memory = hinter->memory; - FT_Error error; + AH_Globals globals = 0; + FT_Memory memory = hinter->memory; + FT_Error error; /* allocate new master globals */ @@ -1419,8 +1773,8 @@ FT_LOCAL_DEF( void ) - ah_hinter_done_global_hints( AH_Hinter* hinter, - void* global_hints ) + ah_hinter_done_global_hints( AH_Hinter hinter, + void* global_hints ) { FT_Memory memory = hinter->memory; Index: xc/extras/freetype2/src/autohint/ahhint.h diff -u xc/extras/freetype2/src/autohint/ahhint.h:1.1.1.4 xc/extras/freetype2/src/autohint/ahhint.h:1.1.1.5 --- xc/extras/freetype2/src/autohint/ahhint.h:1.1.1.4 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/autohint/ahhint.h Wed May 28 22:01:48 2003 @@ -32,39 +32,39 @@ #define AH_HINT_DEFAULT 0 #define AH_HINT_NO_ALIGNMENT 1 -#define AH_HINT_NO_HORZ_EDGES 0x20000L -#define AH_HINT_NO_VERT_EDGES 0x40000L +#define AH_HINT_NO_HORZ_EDGES 0x200000L /* temporary hack */ +#define AH_HINT_NO_VERT_EDGES 0x400000L /* temporary hack */ /* create a new empty hinter object */ FT_LOCAL( FT_Error ) - ah_hinter_new( FT_Library library, - AH_Hinter** ahinter ); + ah_hinter_new( FT_Library library, + AH_Hinter* ahinter ); /* Load a hinted glyph in the hinter */ FT_LOCAL( FT_Error ) - ah_hinter_load_glyph( AH_Hinter* hinter, + ah_hinter_load_glyph( AH_Hinter hinter, FT_GlyphSlot slot, FT_Size size, FT_UInt glyph_index, - FT_Int load_flags ); + FT_Int32 load_flags ); /* finalize a hinter object */ FT_LOCAL( void ) - ah_hinter_done( AH_Hinter* hinter ); + ah_hinter_done( AH_Hinter hinter ); FT_LOCAL( void ) - ah_hinter_done_face_globals( AH_Face_Globals* globals ); + ah_hinter_done_face_globals( AH_Face_Globals globals ); FT_LOCAL( void ) - ah_hinter_get_global_hints( AH_Hinter* hinter, - FT_Face face, - void** global_hints, - long* global_len ); + ah_hinter_get_global_hints( AH_Hinter hinter, + FT_Face face, + void** global_hints, + long* global_len ); FT_LOCAL( void ) - ah_hinter_done_global_hints( AH_Hinter* hinter, - void* global_hints ); + ah_hinter_done_global_hints( AH_Hinter hinter, + void* global_hints ); FT_END_HEADER Index: xc/extras/freetype2/src/autohint/ahmodule.c diff -u xc/extras/freetype2/src/autohint/ahmodule.c:1.1.1.6 xc/extras/freetype2/src/autohint/ahmodule.c:1.1.1.7 --- xc/extras/freetype2/src/autohint/ahmodule.c:1.1.1.6 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/autohint/ahmodule.c Wed May 28 22:01:48 2003 @@ -25,15 +25,15 @@ #ifdef DEBUG_HINTER - extern AH_Hinter* ah_debug_hinter = NULL; - extern FT_Bool ah_debug_disable_horz = 0; - extern FT_Bool ah_debug_disable_vert = 0; + AH_Hinter ah_debug_hinter = NULL; + FT_Bool ah_debug_disable_horz = 0; + FT_Bool ah_debug_disable_vert = 0; #endif typedef struct FT_AutoHinterRec_ { FT_ModuleRec root; - AH_Hinter* hinter; + AH_Hinter hinter; } FT_AutoHinterRec; @@ -69,7 +69,7 @@ FT_GlyphSlot slot, FT_Size size, FT_UInt glyph_index, - FT_ULong load_flags ) + FT_Int32 load_flags ) { return ah_hinter_load_glyph( module->hinter, slot, size, glyph_index, load_flags ); @@ -83,7 +83,7 @@ FT_UNUSED( module ); if ( face->autohint.data ) - ah_hinter_done_face_globals( (AH_Face_Globals*)(face->autohint.data) ); + ah_hinter_done_face_globals( (AH_Face_Globals)(face->autohint.data) ); } Index: xc/extras/freetype2/src/autohint/ahoptim.c diff -u xc/extras/freetype2/src/autohint/ahoptim.c:1.1.1.4 xc/extras/freetype2/src/autohint/ahoptim.c:1.1.1.5 --- xc/extras/freetype2/src/autohint/ahoptim.c:1.1.1.4 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/autohint/ahoptim.c Wed May 28 22:01:48 2003 @@ -157,8 +157,8 @@ static int - valid_stem_segments( AH_Segment* seg1, - AH_Segment* seg2 ) + valid_stem_segments( AH_Segment seg1, + AH_Segment seg2 ) { return seg1->serif == 0 && seg2 && @@ -173,15 +173,15 @@ static int optim_compute_stems( AH_Optimizer* optimizer ) { - AH_Outline* outline = optimizer->outline; - FT_Fixed scale; - FT_Memory memory = optimizer->memory; - FT_Error error = 0; - FT_Int dimension; - AH_Edge* edges; - AH_Edge* edge_limit; - AH_Stem** p_stems; - FT_Int* p_num_stems; + AH_Outline outline = optimizer->outline; + FT_Fixed scale; + FT_Memory memory = optimizer->memory; + FT_Error error = 0; + FT_Int dimension; + AH_Edge edges; + AH_Edge edge_limit; + AH_Stem** p_stems; + FT_Int* p_num_stems; edges = outline->horz_edges; @@ -195,13 +195,13 @@ { AH_Stem* stems = 0; FT_Int num_stems = 0; - AH_Edge* edge; + AH_Edge edge; /* first of all, count the number of stems in this direction */ for ( edge = edges; edge < edge_limit; edge++ ) { - AH_Segment* seg = edge->first; + AH_Segment seg = edge->first; do @@ -226,8 +226,8 @@ stem = stems; for ( edge = edges; edge < edge_limit; edge++ ) { - AH_Segment* seg = edge->first; - AH_Segment* seg2; + AH_Segment seg = edge->first; + AH_Segment seg2; do @@ -235,8 +235,8 @@ seg2 = seg->link; if ( valid_stem_segments( seg, seg2 ) ) { - AH_Edge* edge1 = seg->edge; - AH_Edge* edge2 = seg2->edge; + AH_Edge edge1 = seg->edge; + AH_Edge edge2 = seg2->edge; stem->edge1 = edge1; @@ -721,8 +721,8 @@ stem->edge1->pos = pos; stem->edge2->pos = pos + stem->width; - stem->edge1->flags |= ah_edge_done; - stem->edge2->flags |= ah_edge_done; + stem->edge1->flags |= AH_EDGE_DONE; + stem->edge2->flags |= AH_EDGE_DONE; } } @@ -768,8 +768,8 @@ stem->edge1->pos = pos; stem->edge2->pos = pos + stem->width; - stem->edge1->flags |= ah_edge_done; - stem->edge2->flags |= ah_edge_done; + stem->edge1->flags |= AH_EDGE_DONE; + stem->edge2->flags |= AH_EDGE_DONE; } } @@ -808,13 +808,13 @@ /* loads the outline into the optimizer */ int AH_Optimizer_Init( AH_Optimizer* optimizer, - AH_Outline* outline, + AH_Outline outline, FT_Memory memory ) { FT_Error error; - FT_MEM_SET( optimizer, 0, sizeof ( *optimizer ) ); + FT_MEM_ZERO( optimizer, sizeof ( *optimizer ) ); optimizer->outline = outline; optimizer->memory = memory; Index: xc/extras/freetype2/src/autohint/ahoptim.h diff -u xc/extras/freetype2/src/autohint/ahoptim.h:1.1.1.3 xc/extras/freetype2/src/autohint/ahoptim.h:1.1.1.4 --- xc/extras/freetype2/src/autohint/ahoptim.h:1.1.1.3 Sun Dec 16 12:49:26 2001 +++ xc/extras/freetype2/src/autohint/ahoptim.h Wed May 28 22:01:48 2003 @@ -37,22 +37,22 @@ typedef struct AH_Stem_ { - FT_Pos pos; /* current position */ - FT_Pos velocity; /* current velocity */ - FT_Pos force; /* sum of current forces */ - FT_Pos width; /* normalized width */ - - FT_Pos min_pos; /* minimum grid position */ - FT_Pos max_pos; /* maximum grid position */ + FT_Pos pos; /* current position */ + FT_Pos velocity; /* current velocity */ + FT_Pos force; /* sum of current forces */ + FT_Pos width; /* normalized width */ + + FT_Pos min_pos; /* minimum grid position */ + FT_Pos max_pos; /* maximum grid position */ - AH_Edge* edge1; /* left/bottom edge */ - AH_Edge* edge2; /* right/top edge */ + AH_Edge edge1; /* left/bottom edge */ + AH_Edge edge2; /* right/top edge */ - FT_Pos opos; /* original position */ - FT_Pos owidth; /* original width */ + FT_Pos opos; /* original position */ + FT_Pos owidth; /* original width */ - FT_Pos min_coord; /* minimum coordinate */ - FT_Pos max_coord; /* maximum coordinate */ + FT_Pos min_coord; /* minimum coordinate */ + FT_Pos max_coord; /* maximum coordinate */ } AH_Stem; @@ -81,7 +81,7 @@ typedef struct AH_Optimizer_ { FT_Memory memory; - AH_Outline* outline; + AH_Outline outline; FT_Int num_hstems; AH_Stem* horz_stems; @@ -115,7 +115,7 @@ /* loads the outline into the optimizer */ int AH_Optimizer_Init( AH_Optimizer* optimizer, - AH_Outline* outline, + AH_Outline outline, FT_Memory memory ); Index: xc/extras/freetype2/src/autohint/ahtypes.h diff -u xc/extras/freetype2/src/autohint/ahtypes.h:1.1.1.5 xc/extras/freetype2/src/autohint/ahtypes.h:1.1.1.6 --- xc/extras/freetype2/src/autohint/ahtypes.h:1.1.1.5 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/autohint/ahtypes.h Wed May 28 22:01:48 2003 @@ -92,7 +92,7 @@ /* no reason to do this (at least for non-CJK scripts), except for */ /* experimentation. */ /* */ -#define AH_HINT_METRICS +#undef AH_HINT_METRICS /*************************************************************************/ @@ -126,63 +126,65 @@ /* hint flags */ -#define ah_flag_none 0 +#define AH_FLAG_NONE 0 /* bezier control points flags */ -#define ah_flag_conic 1 -#define ah_flag_cubic 2 -#define ah_flag_control ( ah_flag_conic | ah_flag_cubic ) +#define AH_FLAG_CONIC 1 +#define AH_FLAG_CUBIC 2 +#define AH_FLAG_CONTROL ( AH_FLAG_CONIC | AH_FLAG_CUBIC ) /* extrema flags */ -#define ah_flag_extrema_x 4 -#define ah_flag_extrema_y 8 +#define AH_FLAG_EXTREMA_X 4 +#define AH_FLAG_EXTREMA_Y 8 /* roundness */ -#define ah_flag_round_x 16 -#define ah_flag_round_y 32 +#define AH_FLAG_ROUND_X 16 +#define AH_FLAG_ROUND_Y 32 /* touched */ -#define ah_flag_touch_x 64 -#define ah_flag_touch_y 128 +#define AH_FLAG_TOUCH_X 64 +#define AH_FLAG_TOUCH_Y 128 /* weak interpolation */ -#define ah_flag_weak_interpolation 256 +#define AH_FLAG_WEAK_INTERPOLATION 256 +#define AH_FLAG_INFLECTION 512 typedef FT_Int AH_Flags; /* edge hint flags */ -#define ah_edge_normal 0 -#define ah_edge_round 1 -#define ah_edge_serif 2 -#define ah_edge_done 4 +#define AH_EDGE_NORMAL 0 +#define AH_EDGE_ROUND 1 +#define AH_EDGE_SERIF 2 +#define AH_EDGE_DONE 4 typedef FT_Int AH_Edge_Flags; /* hint directions -- the values are computed so that two vectors are */ /* in opposite directions iff `dir1+dir2 == 0' */ -#define ah_dir_none 4 -#define ah_dir_right 1 -#define ah_dir_left -1 -#define ah_dir_up 2 -#define ah_dir_down -2 +#define AH_DIR_NONE 4 +#define AH_DIR_RIGHT 1 +#define AH_DIR_LEFT -1 +#define AH_DIR_UP 2 +#define AH_DIR_DOWN -2 typedef FT_Int AH_Direction; - typedef struct AH_Point AH_Point; - typedef struct AH_Segment AH_Segment; - typedef struct AH_Edge AH_Edge; + typedef struct AH_PointRec_* AH_Point; + typedef struct AH_SegmentRec_* AH_Segment; + typedef struct AH_EdgeRec_* AH_Edge; /*************************************************************************/ /* */ /* <Struct> */ - /* AH_Point */ + /* AH_PointRec */ /* */ /* <Description> */ - /* A structure used to model an outline point to the AH_Outline type. */ + /* A structure used to model an outline point to the AH_OutlineRec */ + /* type. */ /* */ /* <Fields> */ /* flags :: The current point hint flags. */ @@ -207,7 +209,7 @@ /* */ /* prev :: The previous point in same contour. */ /* */ - struct AH_Point + typedef struct AH_PointRec_ { AH_Flags flags; /* point flags used by hinter */ FT_Pos ox, oy; @@ -221,15 +223,16 @@ AH_Angle in_angle; AH_Angle out_angle; - AH_Point* next; /* next point in contour */ - AH_Point* prev; /* previous point in contour */ - }; + AH_Point next; /* next point in contour */ + AH_Point prev; /* previous point in contour */ + + } AH_PointRec; /*************************************************************************/ /* */ /* <Struct> */ - /* AH_Segment */ + /* AH_SegmentRec */ /* */ /* <Description> */ /* A structure used to describe an edge segment to the auto-hinter. */ @@ -264,33 +267,34 @@ /* */ /* score :: Used to score the segment when selecting them. */ /* */ - struct AH_Segment + typedef struct AH_SegmentRec_ { AH_Edge_Flags flags; AH_Direction dir; - AH_Point* first; /* first point in edge segment */ - AH_Point* last; /* last point in edge segment */ - AH_Point** contour; /* ptr to first point of segment's contour */ + AH_Point first; /* first point in edge segment */ + AH_Point last; /* last point in edge segment */ + AH_Point* contour; /* ptr to first point of segment's contour */ FT_Pos pos; /* position of segment */ FT_Pos min_coord; /* minimum coordinate of segment */ FT_Pos max_coord; /* maximum coordinate of segment */ - AH_Edge* edge; - AH_Segment* edge_next; + AH_Edge edge; + AH_Segment edge_next; - AH_Segment* link; /* link segment */ - AH_Segment* serif; /* primary segment for serifs */ + AH_Segment link; /* link segment */ + AH_Segment serif; /* primary segment for serifs */ FT_Pos num_linked; /* number of linked segments */ - FT_Int score; - }; + FT_Pos score; + + } AH_SegmentRec; /*************************************************************************/ /* */ /* <Struct> */ - /* AH_Edge */ + /* AH_EdgeRec */ /* */ /* <Description> */ /* A structure used to describe an edge, which really is a horizontal */ @@ -324,29 +328,30 @@ /* Only set for some of the horizontal edges in a Latin */ /* font. */ /* */ - struct AH_Edge + typedef struct AH_EdgeRec_ { AH_Edge_Flags flags; AH_Direction dir; - AH_Segment* first; - AH_Segment* last; + AH_Segment first; + AH_Segment last; FT_Pos fpos; FT_Pos opos; FT_Pos pos; - AH_Edge* link; - AH_Edge* serif; + AH_Edge link; + AH_Edge serif; FT_Int num_linked; FT_Int score; FT_Pos* blue_edge; - }; + + } AH_EdgeRec; /* an outline as seen by the hinter */ - typedef struct AH_Outline_ + typedef struct AH_OutlineRec_ { FT_Memory memory; @@ -359,39 +364,53 @@ FT_Int max_points; FT_Int num_points; - AH_Point* points; + AH_Point points; FT_Int max_contours; FT_Int num_contours; - AH_Point** contours; + AH_Point * contours; FT_Int num_hedges; - AH_Edge* horz_edges; + AH_Edge horz_edges; FT_Int num_vedges; - AH_Edge* vert_edges; + AH_Edge vert_edges; FT_Int num_hsegments; - AH_Segment* horz_segments; + AH_Segment horz_segments; FT_Int num_vsegments; - AH_Segment* vert_segments; + AH_Segment vert_segments; + + } AH_OutlineRec, *AH_Outline; - } AH_Outline; +#ifdef FT_CONFIG_CHESTER_SMALL_F -#define ah_blue_capital_top 0 /* THEZOCQS */ -#define ah_blue_capital_bottom ( ah_blue_capital_top + 1 ) /* HEZLOCUS */ -#define ah_blue_small_top ( ah_blue_capital_bottom + 1 ) /* xzroesc */ -#define ah_blue_small_bottom ( ah_blue_small_top + 1 ) /* xzroesc */ -#define ah_blue_small_minor ( ah_blue_small_bottom + 1 ) /* pqgjy */ -#define ah_blue_max ( ah_blue_small_minor + 1 ) +# define AH_BLUE_CAPITAL_TOP 0 /* THEZOCQS */ +# define AH_BLUE_CAPITAL_BOTTOM ( AH_BLUE_CAPITAL_TOP + 1 ) /* HEZLOCUS */ +# define AH_BLUE_SMALL_F_TOP ( AH_BLUE_CAPITAL_BOTTOM + 1 ) /* fijkdbh */ +# define AH_BLUE_SMALL_TOP ( AH_BLUE_SMALL_F_TOP + 1 ) /* xzroesc */ +# define AH_BLUE_SMALL_BOTTOM ( AH_BLUE_SMALL_TOP + 1 ) /* xzroesc */ +# define AH_BLUE_SMALL_MINOR ( AH_BLUE_SMALL_BOTTOM + 1 ) /* pqgjy */ +# define AH_BLUE_MAX ( AH_BLUE_SMALL_MINOR + 1 ) + +#else /* !CHESTER_SMALL_F */ + +# define AH_BLUE_CAPITAL_TOP 0 /* THEZOCQS */ +# define AH_BLUE_CAPITAL_BOTTOM ( AH_BLUE_CAPITAL_TOP + 1 ) /* HEZLOCUS */ +# define AH_BLUE_SMALL_TOP ( AH_BLUE_CAPITAL_BOTTOM + 1) /* xzroesc */ +# define AH_BLUE_SMALL_BOTTOM ( AH_BLUE_SMALL_TOP + 1 ) /* xzroesc */ +# define AH_BLUE_SMALL_MINOR ( AH_BLUE_SMALL_BOTTOM + 1 ) /* pqgjy */ +# define AH_BLUE_MAX ( AH_BLUE_SMALL_MINOR + 1 ) + +#endif /* !CHESTER_SMALL_F */ typedef FT_Int AH_Blue; -#define ah_hinter_monochrome 1 -#define ah_hinter_optimize 2 +#define AH_HINTER_MONOCHROME 1 +#define AH_HINTER_OPTIMIZE 2 typedef FT_Int AH_Hinter_Flags; @@ -399,7 +418,7 @@ /*************************************************************************/ /* */ /* <Struct> */ - /* AH_Globals */ + /* AH_GlobalsRec */ /* */ /* <Description> */ /* Holds the global metrics for a given font face (be it in design */ @@ -418,24 +437,26 @@ /* */ /* blue_shoots :: The overshoot positions of blue zones. */ /* */ - typedef struct AH_Globals_ + typedef struct AH_GlobalsRec_ { FT_Int num_widths; FT_Int num_heights; + FT_Pos stds[2]; + FT_Pos widths [AH_MAX_WIDTHS]; FT_Pos heights[AH_MAX_HEIGHTS]; - FT_Pos blue_refs [ah_blue_max]; - FT_Pos blue_shoots[ah_blue_max]; + FT_Pos blue_refs [AH_BLUE_MAX]; + FT_Pos blue_shoots[AH_BLUE_MAX]; - } AH_Globals; + } AH_GlobalsRec, *AH_Globals; /*************************************************************************/ /* */ /* <Struct> */ - /* AH_Face_Globals */ + /* AH_Face_GlobalsRec */ /* */ /* <Description> */ /* Holds the complete global metrics for a given font face (i.e., the */ @@ -453,19 +474,19 @@ /* */ /* y_scale :: The current vertical scale. */ /* */ - typedef struct AH_Face_Globals_ + typedef struct AH_Face_GlobalsRec_ { - FT_Face face; - AH_Globals design; - AH_Globals scaled; - FT_Fixed x_scale; - FT_Fixed y_scale; - FT_Bool control_overshoot; + FT_Face face; + AH_GlobalsRec design; + AH_GlobalsRec scaled; + FT_Fixed x_scale; + FT_Fixed y_scale; + FT_Bool control_overshoot; - } AH_Face_Globals; + } AH_Face_GlobalsRec, *AH_Face_Globals; - typedef struct AH_Hinter + typedef struct AH_HinterRec { FT_Memory memory; AH_Hinter_Flags flags; @@ -473,9 +494,9 @@ FT_Int algorithm; FT_Face face; - AH_Face_Globals* globals; + AH_Face_Globals globals; - AH_Outline* glyph; + AH_Outline glyph; AH_Loader loader; FT_Vector pp1; @@ -485,11 +506,17 @@ FT_Vector trans_delta; FT_Matrix trans_matrix; - } AH_Hinter; + FT_Bool do_horz_hints; /* disable X hinting */ + FT_Bool do_vert_hints; /* disable Y hinting */ + FT_Bool do_horz_snapping; /* disable X stem size snapping */ + FT_Bool do_vert_snapping; /* disable Y stem size snapping */ + FT_Bool do_stem_adjust; /* disable light stem snapping */ + + } AH_HinterRec, *AH_Hinter; #ifdef DEBUG_HINTER - extern AH_Hinter* ah_debug_hinter; + extern AH_Hinter ah_debug_hinter; extern FT_Bool ah_debug_disable_horz; extern FT_Bool ah_debug_disable_vert; #else Index: xc/extras/freetype2/src/base/Jamfile diff -u xc/extras/freetype2/src/base/Jamfile:1.1.1.3 xc/extras/freetype2/src/base/Jamfile:1.1.1.4 --- xc/extras/freetype2/src/base/Jamfile:1.1.1.3 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/base/Jamfile Wed May 28 22:01:48 2003 @@ -1,9 +1,8 @@ # FreeType 2 src/base Jamfile (c) 2001, 2002 David Turner # -SubDir FT2_TOP src base ; +SubDir FT2_TOP $(FT2_SRC_DIR) base ; -SubDirHdrs [ FT2_SubDir src base ] ; { local _sources ; @@ -23,8 +22,10 @@ # Add the optional/replaceable files. # -Library $(FT2_LIB) : ftsystem.c ftinit.c ftglyph.c ftmm.c ftbdf.c - ftbbox.c ftdebug.c ftxf86.c fttype1.c ; +Library $(FT2_LIB) : ftsystem.c ftinit.c ftglyph.c ftmm.c ftbdf.c + ftbbox.c ftdebug.c ftxf86.c fttype1.c ftpfr.c + ftstroker.c ftwinfnt.c + ; # Add Macintosh-specific file to the library when necessary. # Index: xc/extras/freetype2/src/base/descrip.mms diff -u xc/extras/freetype2/src/base/descrip.mms:1.1.1.4 xc/extras/freetype2/src/base/descrip.mms:1.1.1.5 --- xc/extras/freetype2/src/base/descrip.mms:1.1.1.4 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/base/descrip.mms Wed May 28 22:01:48 2003 @@ -15,7 +15,7 @@ CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.builds.vms],[--.include],[--.src.base]) -OBJS=ftbase.obj,ftinit.obj,ftglyph.obj,ftdebug.obj,ftbdf.obj,ftmm.obj,fttype1.obj,ftxf86.obj +OBJS=ftbase.obj,ftinit.obj,ftglyph.obj,ftdebug.obj,ftbdf.obj,ftmm.obj,fttype1.obj,ftxf86.obj,ftpfr.obj,ftstroker.obj,ftwinfnt.obj all : $(OBJS) library [--.lib]freetype.olb $(OBJS) Index: xc/extras/freetype2/src/base/ftbbox.c diff -u xc/extras/freetype2/src/base/ftbbox.c:1.1.1.5 xc/extras/freetype2/src/base/ftbbox.c:1.1.1.6 --- xc/extras/freetype2/src/base/ftbbox.c:1.1.1.5 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/base/ftbbox.c Wed May 28 22:01:48 2003 @@ -602,7 +602,7 @@ if ( y < cbox.yMin ) cbox.yMin = y; if ( y > cbox.yMax ) cbox.yMax = y; - if ( FT_CURVE_TAG( outline->tags[n] ) == FT_Curve_Tag_On ) + if ( FT_CURVE_TAG( outline->tags[n] ) == FT_CURVE_TAG_ON ) { /* update bbox for `on' points only */ if ( x < bbox.xMin ) bbox.xMin = x; Index: xc/extras/freetype2/src/base/ftbdf.c diff -u xc/extras/freetype2/src/base/ftbdf.c:1.1.1.1 xc/extras/freetype2/src/base/ftbdf.c:1.1.1.2 --- xc/extras/freetype2/src/base/ftbdf.c:1.1.1.1 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/base/ftbdf.c Wed May 28 22:01:48 2003 @@ -20,6 +20,22 @@ #include FT_INTERNAL_BDF_TYPES_H #include FT_INTERNAL_OBJECTS_H + static FT_Bool + test_font_type( FT_Face face, const char* name ) + { + if ( face && face->driver ) + { + FT_Module driver = (FT_Module)face->driver; + + if ( driver->clazz && driver->clazz->module_name ) + { + if ( ft_strcmp( driver->clazz->module_name, name ) == 0 ) + return 1; + } + } + return 0; + } + FT_EXPORT_DEF( FT_Error ) FT_Get_BDF_Charset_ID( FT_Face face, @@ -29,35 +45,52 @@ FT_Error error; const char* encoding = NULL; const char* registry = NULL; - + error = FT_Err_Invalid_Argument; - - if ( face != NULL && face->driver != NULL ) + + if ( test_font_type( face, "bdf" ) ) { - FT_Module driver = (FT_Module) face->driver; - + BDF_Public_Face bdf_face = (BDF_Public_Face)face; - if ( driver->clazz && driver->clazz->module_name && - ft_strcmp( driver->clazz->module_name, "bdf" ) == 0 ) - { - BDF_Public_Face bdf_face = (BDF_Public_Face)face; - - encoding = (const char*) bdf_face->charset_encoding; - registry = (const char*) bdf_face->charset_registry; - error = 0; - } + encoding = (const char*) bdf_face->charset_encoding; + registry = (const char*) bdf_face->charset_registry; + error = 0; } - + if ( acharset_encoding ) *acharset_encoding = encoding; - + if ( acharset_registry ) *acharset_registry = registry; - + return error; - } + } + + + FT_EXPORT( FT_Error ) + FT_Get_BDF_Property( FT_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ) + { + FT_Error error; + + error = FT_Err_Invalid_Argument; + aproperty->type = BDF_PROPERTY_TYPE_NONE; + + if ( face != NULL && face->driver != NULL ) + { + FT_Driver driver = face->driver; + BDF_GetPropertyFunc func; + + func = (BDF_GetPropertyFunc) driver->root.clazz->get_interface( + FT_MODULE( driver ), "get_bdf_property" ); + if ( func ) + error = func( face, prop_name, aproperty ); + } + return error; + } /* END */ Index: xc/extras/freetype2/src/base/ftdbgmem.c diff -u xc/extras/freetype2/src/base/ftdbgmem.c:1.1.1.2 xc/extras/freetype2/src/base/ftdbgmem.c:1.1.1.3 --- xc/extras/freetype2/src/base/ftdbgmem.c:1.1.1.2 Thu Jun 20 04:16:12 2002 +++ xc/extras/freetype2/src/base/ftdbgmem.c Wed May 28 22:01:48 2003 @@ -62,6 +62,13 @@ FT_ULong alloc_total; FT_ULong alloc_current; FT_ULong alloc_max; + FT_ULong alloc_count; + + FT_Bool bound_total; + FT_ULong alloc_total_max; + + FT_Bool bound_count; + FT_ULong alloc_count_max; const char* file_name; FT_Long line_no; @@ -202,7 +209,7 @@ if ( new_buckets == NULL ) return; - FT_MEM_SET( new_buckets, 0, sizeof ( FT_MemNode ) * new_size ); + FT_MEM_ZERO( new_buckets, sizeof ( FT_MemNode ) * new_size ); for ( i = 0; i < table->size; i++ ) { @@ -243,7 +250,7 @@ if ( table == NULL ) goto Exit; - FT_MEM_SET( table, 0, sizeof ( *table ) ); + FT_MEM_ZERO( table, sizeof ( *table ) ); table->size = FT_MEM_SIZE_MIN; table->nodes = 0; @@ -260,7 +267,7 @@ memory->alloc( memory, table->size * sizeof ( FT_MemNode ) ); if ( table->buckets ) - FT_MEM_SET( table->buckets, 0, sizeof ( FT_MemNode ) * table->size ); + FT_MEM_ZERO( table->buckets, sizeof ( FT_MemNode ) * table->size ); else { memory->free( memory, table ); @@ -476,10 +483,22 @@ if ( size <= 0 ) ft_mem_debug_panic( "negative block size allocation (%ld)", size ); + /* return NULL if the maximum number of allocations was reached */ + if ( table->bound_count && + table->alloc_count >= table->alloc_count_max ) + return NULL; + + /* return NULL if this allocation would overflow the maximum heap size */ + if ( table->bound_total && + table->alloc_current + (FT_ULong)size > table->alloc_total_max ) + return NULL; + block = (FT_Byte *)ft_mem_table_alloc( table, size ); if ( block ) ft_mem_table_set( table, block, (FT_ULong)size ); + table->alloc_count++; + table->file_name = NULL; table->line_no = 0; @@ -570,15 +589,42 @@ FT_Int result = 0; - if ( getenv( "FT_DEBUG_MEMORY" ) ) + if ( getenv( "FT2_DEBUG_MEMORY" ) ) { table = ft_mem_table_new( memory ); if ( table ) { + const char* p; + memory->user = table; memory->alloc = ft_mem_debug_alloc; memory->realloc = ft_mem_debug_realloc; memory->free = ft_mem_debug_free; + + p = getenv( "FT2_ALLOC_TOTAL_MAX" ); + if ( p != NULL ) + { + FT_Long total_max = atol(p); + + if ( total_max > 0 ) + { + table->bound_total = 1; + table->alloc_total_max = (FT_ULong) total_max; + } + } + + p = getenv( "FT2_ALLOC_COUNT_MAX" ); + if ( p != NULL ) + { + FT_Long total_count = atol(p); + + if ( total_count > 0 ) + { + table->bound_count = 1; + table->alloc_count_max = (FT_ULong) total_count; + } + } + result = 1; } } Index: xc/extras/freetype2/src/base/ftdebug.c diff -u xc/extras/freetype2/src/base/ftdebug.c:1.1.1.4 xc/extras/freetype2/src/base/ftdebug.c:1.1.1.5 --- xc/extras/freetype2/src/base/ftdebug.c:1.1.1.4 Thu Jun 20 04:16:13 2002 +++ xc/extras/freetype2/src/base/ftdebug.c Wed May 28 22:01:49 2003 @@ -86,7 +86,7 @@ #define FT_TRACE_DEF(x) #x , static const char* ft_trace_toggles[trace_count + 1] = - { + { #include FT_INTERNAL_TRACE_H NULL }; @@ -98,9 +98,9 @@ /* */ /* Initialize the tracing sub-system. This is done by retrieving the */ /* value of the "FT2_DEBUG" environment variable. It must be a list of */ - /* toggles, separated by spaces, `;' or `:'. Example: */ + /* toggles, separated by spaces, `;' or `,'. Example: */ /* */ - /* "any=3 memory=6 stream=5" */ + /* "any:3 memory:6 stream:5" */ /* */ /* This will request that all levels be set to 3, except the trace level */ /* for the memory and stream components which are set to 6 and 5, */ @@ -116,48 +116,48 @@ ft_debug_init( void ) { const char* ft2_debug = getenv( "FT2_DEBUG" ); - + if ( ft2_debug ) { const char* p = ft2_debug; const char* q; - + for ( ; *p; p++ ) { /* skip leading whitespace and separators */ - if ( *p == ' ' || *p == '\t' || *p == ':' || *p == ';' || *p == '=' ) + if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' ) continue; - - /* read toggle name, followed by '=' */ + + /* read toggle name, followed by ':' */ q = p; - while ( *p && *p != '=' ) + while ( *p && *p != ':' ) p++; - if ( *p == '=' && p > q ) + if ( *p == ':' && p > q ) { - int n, i, len = p - q; - int level = -1, found = -1; - + FT_Int n, i, len = (FT_Int)(p - q); + FT_Int level = -1, found = -1; + for ( n = 0; n < trace_count; n++ ) { const char* toggle = ft_trace_toggles[n]; - + for ( i = 0; i < len; i++ ) { if ( toggle[i] != q[i] ) break; } - + if ( i == len && toggle[i] == 0 ) { found = n; break; } } - + /* read level */ p++; if ( *p ) @@ -166,7 +166,7 @@ if ( level < 0 || level > 6 ) level = -1; } - + if ( found >= 0 && level >= 0 ) { if ( found == trace_any ) Index: xc/extras/freetype2/src/base/ftextend.c diff -u xc/extras/freetype2/src/base/ftextend.c:1.1.1.3 xc/extras/freetype2/src/base/ftextend.c:removed --- xc/extras/freetype2/src/base/ftextend.c:1.1.1.3 Sun Dec 16 12:49:26 2001 +++ xc/extras/freetype2/src/base/ftextend.c Sat Feb 28 21:40:17 2004 @@ -1,302 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftextend.c */ -/* */ -/* FreeType extensions implementation (body). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - /*************************************************************************/ - /* */ - /* This is an updated version of the extension component, now located */ - /* in the main library's source directory. It allows the dynamic */ - /* registration/use of various face object extensions through a simple */ - /* API. */ - /* */ - /*************************************************************************/ - - -#include <ft2build.h> -#include FT_INTERNAL_EXTEND_H -#include FT_INTERNAL_DEBUG_H - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_extend - - - typedef struct FT_Extension_Registry_ - { - FT_Int num_extensions; - FT_Long cur_offset; - FT_Extension_Class classes[FT_MAX_EXTENSIONS]; - - } FT_Extension_Registry; - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Init_Extensions */ - /* */ - /* <Description> */ - /* Initializes the extension component. */ - /* */ - /* <InOut> */ - /* driver :: A handle to the driver object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF FT_Error - FT_Init_Extensions( FT_Driver driver ) - { - FT_Error error; - FT_Memory memory; - FT_Extension_Registry* registry; - - - memory = driver->root.library->memory; - if ( ALLOC( registry, sizeof ( *registry ) ) ) - return error; - - registry->num_extensions = 0; - registry->cur_offset = 0; - driver->extensions = registry; - - FT_TRACE2(( "FT_Init_Extensions: success\n" )); - - return FT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Done_Extensions */ - /* */ - /* <Description> */ - /* Finalizes the extension component. */ - /* */ - /* <InOut> */ - /* driver :: A handle to the driver object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF FT_Error - FT_Done_Extensions( FT_Driver driver ) - { - FT_Memory memory = driver->root.memory; - - - FREE( driver->extensions ); - return FT_Err_Ok; - } - - - /* documentation is in ftextend.h */ - - FT_EXPORT_DEF( FT_Error ) - FT_Register_Extension( FT_Driver driver, - FT_Extension_Class* clazz ) - { - FT_Extension_Registry* registry; - - - if ( !driver ) - return FT_Err_Invalid_Driver_Handle; - - if ( !clazz ) - return FT_Err_Invalid_Argument; - - registry = (FT_Extension_Registry*)driver->extensions; - if ( registry ) - { - FT_Int n = registry->num_extensions; - FT_Extension_Class* cur = registry->classes + n; - - - if ( n >= FT_MAX_EXTENSIONS ) - return FT_Err_Too_Many_Extensions; - - *cur = *clazz; - - cur->offset = registry->cur_offset; - - registry->num_extensions++; - registry->cur_offset += - ( cur->size + FT_ALIGNMENT - 1 ) & -FT_ALIGNMENT; - - FT_TRACE1(( "FT_Register_Extension: `%s' successfully registered\n", - cur->id )); - } - - return FT_Err_Ok; - } - - - /* documentation is in ftextend.h */ - - FT_EXPORT_DEF( void* ) - FT_Get_Extension( FT_Face face, - const char* extension_id, - void** extension_interface ) - { - FT_Extension_Registry* registry; - - - if ( !face || !extension_id || !extension_interface ) - return 0; - - registry = (FT_Extension_Registry*)face->driver->extensions; - if ( registry && face->extensions ) - { - FT_Extension_Class* cur = registry->classes; - FT_Extension_Class* limit = cur + registry->num_extensions; - - - for ( ; cur < limit; cur++ ) - if ( strcmp( cur->id, extension_id ) == 0 ) - { - *extension_interface = cur->interface; - - FT_TRACE1(( "FT_Get_Extension: got `%s'\n", extension_id )); - - return (void*)((char*)face->extensions + cur->offset); - } - } - - /* could not find the extension id */ - - FT_ERROR(( "FT_Get_Extension: couldn't find `%s'\n", extension_id )); - - *extension_interface = 0; - - return 0; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Destroy_Extensions */ - /* */ - /* <Description> */ - /* Destroys all extensions within a face object. */ - /* */ - /* <InOut> */ - /* face :: A handle to the face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* Called by the face object destructor. */ - /* */ - FT_LOCAL_DEF FT_Error - FT_Destroy_Extensions( FT_Face face ) - { - FT_Extension_Registry* registry; - FT_Memory memory; - - - registry = (FT_Extension_Registry*)face->driver->extensions; - if ( registry && face->extensions ) - { - FT_Extension_Class* cur = registry->classes; - FT_Extension_Class* limit = cur + registry->num_extensions; - - - for ( ; cur < limit; cur++ ) - { - char* ext = (char*)face->extensions + cur->offset; - - if ( cur->finalize ) - cur->finalize( ext, face ); - } - - memory = face->driver->root.memory; - FREE( face->extensions ); - } - - return FT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Create_Extensions */ - /* */ - /* <Description> */ - /* Creates an extension object within a face object for all */ - /* registered extensions. */ - /* */ - /* <InOut> */ - /* face :: A handle to the face object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* Called by the face object constructor. */ - /* */ - FT_LOCAL_DEF FT_Error - FT_Create_Extensions( FT_Face face ) - { - FT_Extension_Registry* registry; - FT_Memory memory; - FT_Error error; - - - face->extensions = 0; - - /* load extensions registry; exit successfully if none is there */ - - registry = (FT_Extension_Registry*)face->driver->extensions; - if ( !registry ) - return FT_Err_Ok; - - memory = face->driver->root.memory; - if ( ALLOC( face->extensions, registry->cur_offset ) ) - return error; - - { - FT_Extension_Class* cur = registry->classes; - FT_Extension_Class* limit = cur + registry->num_extensions; - - - for ( ; cur < limit; cur++ ) - { - char* ext = (char*)face->extensions + cur->offset; - - if ( cur->init ) - { - error = cur->init( ext, face ); - if ( error ) - break; - } - } - } - - return error; - } - - -/* END */ Index: xc/extras/freetype2/src/base/ftglyph.c diff -u xc/extras/freetype2/src/base/ftglyph.c:1.1.1.6 xc/extras/freetype2/src/base/ftglyph.c:1.1.1.7 --- xc/extras/freetype2/src/base/ftglyph.c:1.1.1.6 Thu Jun 20 04:16:13 2002 +++ xc/extras/freetype2/src/base/ftglyph.c Wed May 28 22:01:49 2003 @@ -56,7 +56,7 @@ /* documentation is in ftglyph.h */ FT_EXPORT_DEF( void ) - FT_Matrix_Multiply( FT_Matrix* a, + FT_Matrix_Multiply( const FT_Matrix* a, FT_Matrix* b ) { FT_Fixed xx, xy, yx, yy; @@ -147,7 +147,7 @@ FT_Memory memory = library->memory; - if ( slot->format != ft_glyph_format_bitmap ) + if ( slot->format != FT_GLYPH_FORMAT_BITMAP ) { error = FT_Err_Invalid_Glyph_Format; goto Exit; @@ -209,14 +209,14 @@ const FT_Glyph_Class ft_bitmap_glyph_class = { sizeof( FT_BitmapGlyphRec ), - ft_glyph_format_bitmap, + FT_GLYPH_FORMAT_BITMAP, - (FT_Glyph_Init_Func) ft_bitmap_glyph_init, - (FT_Glyph_Done_Func) ft_bitmap_glyph_done, - (FT_Glyph_Copy_Func) ft_bitmap_glyph_copy, - (FT_Glyph_Transform_Func)0, - (FT_Glyph_BBox_Func) ft_bitmap_glyph_bbox, - (FT_Glyph_Prepare_Func) 0 + (FT_Glyph_InitFunc) ft_bitmap_glyph_init, + (FT_Glyph_DoneFunc) ft_bitmap_glyph_done, + (FT_Glyph_CopyFunc) ft_bitmap_glyph_copy, + (FT_Glyph_TransformFunc)0, + (FT_Glyph_GetBBoxFunc) ft_bitmap_glyph_bbox, + (FT_Glyph_PrepareFunc) 0 }; @@ -240,7 +240,7 @@ /* check format in glyph slot */ - if ( slot->format != ft_glyph_format_outline ) + if ( slot->format != FT_GLYPH_FORMAT_OUTLINE ) { error = FT_Err_Invalid_Glyph_Format; goto Exit; @@ -262,8 +262,8 @@ FT_MEM_COPY( target->contours, source->contours, source->n_contours * sizeof ( FT_Short ) ); - /* copy all flags, except the `ft_outline_owner' one */ - target->flags = source->flags | ft_outline_owner; + /* copy all flags, except the `FT_OUTLINE_OWNER' one */ + target->flags = source->flags | FT_OUTLINE_OWNER; Exit: return error; @@ -319,9 +319,9 @@ ft_outline_glyph_prepare( FT_OutlineGlyph glyph, FT_GlyphSlot slot ) { - slot->format = ft_glyph_format_outline; + slot->format = FT_GLYPH_FORMAT_OUTLINE; slot->outline = glyph->outline; - slot->outline.flags &= ~ft_outline_owner; + slot->outline.flags &= ~FT_OUTLINE_OWNER; return FT_Err_Ok; } @@ -330,14 +330,14 @@ const FT_Glyph_Class ft_outline_glyph_class = { sizeof( FT_OutlineGlyphRec ), - ft_glyph_format_outline, + FT_GLYPH_FORMAT_OUTLINE, - (FT_Glyph_Init_Func) ft_outline_glyph_init, - (FT_Glyph_Done_Func) ft_outline_glyph_done, - (FT_Glyph_Copy_Func) ft_outline_glyph_copy, - (FT_Glyph_Transform_Func)ft_outline_glyph_transform, - (FT_Glyph_BBox_Func) ft_outline_glyph_bbox, - (FT_Glyph_Prepare_Func) ft_outline_glyph_prepare + (FT_Glyph_InitFunc) ft_outline_glyph_init, + (FT_Glyph_DoneFunc) ft_outline_glyph_done, + (FT_Glyph_CopyFunc) ft_outline_glyph_copy, + (FT_Glyph_TransformFunc)ft_outline_glyph_transform, + (FT_Glyph_GetBBoxFunc) ft_outline_glyph_bbox, + (FT_Glyph_PrepareFunc) ft_outline_glyph_prepare }; @@ -435,11 +435,11 @@ return FT_Err_Invalid_Argument; /* if it is a bitmap, that's easy :-) */ - if ( slot->format == ft_glyph_format_bitmap ) + if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) clazz = &ft_bitmap_glyph_class; /* it it is an outline too */ - else if ( slot->format == ft_glyph_format_outline ) + else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) clazz = &ft_outline_glyph_class; else @@ -566,13 +566,13 @@ /* documentation is in ftglyph.h */ FT_EXPORT_DEF( FT_Error ) - FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, - FT_ULong render_mode, - FT_Vector* origin, - FT_Bool destroy ) + FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, + FT_Render_Mode render_mode, + FT_Vector* origin, + FT_Bool destroy ) { FT_GlyphSlotRec dummy; - FT_Error error; + FT_Error error = FT_Err_Ok; FT_Glyph glyph; FT_BitmapGlyph bitmap = NULL; @@ -591,10 +591,15 @@ goto Bad; clazz = glyph->clazz; + + /* when called with a bitmap glyph, do nothing and return succesfully */ + if ( clazz == &ft_bitmap_glyph_class ) + goto Exit; + if ( !clazz || !clazz->glyph_prepare ) goto Bad; - FT_MEM_SET( &dummy, 0, sizeof ( dummy ) ); + FT_MEM_ZERO( &dummy, sizeof ( dummy ) ); dummy.library = glyph->library; dummy.format = clazz->glyph_format; Index: xc/extras/freetype2/src/base/fthash.c diff -u xc/extras/freetype2/src/base/fthash.c:1.1.1.1 xc/extras/freetype2/src/base/fthash.c:1.1.1.2 --- xc/extras/freetype2/src/base/fthash.c:1.1.1.1 Thu Jun 20 04:16:13 2002 +++ xc/extras/freetype2/src/base/fthash.c Wed May 28 22:01:49 2003 @@ -1,4 +1,6 @@ -#include "fthash.h" +#include <ft2build.h> +#include FT_TYPES_H +#include FT_INTERNAL_HASH_H #include FT_INTERNAL_MEMORY_H #include FT_INTERNAL_DEBUG_H @@ -27,7 +29,7 @@ table->mask = 0; table->slack = 0; - table->compare = NULL; + table->node_equal = NULL; } } @@ -45,18 +47,22 @@ - FT_BASE_DEF( void ) - ft_hash_init( FT_Hash table, - FT_Hash_CompareFunc compare, - FT_Memory memory ) - { - hash->memory = memory; - hash->compare = node_compare; - hash->p = 0; - hash->mask = FT_HASH_INITIAL_SIZE-1; - hash->slack = FT_HASH_INITIAL_SIZE*FT_HASH_MAX_LOAD; + FT_BASE_DEF( FT_Error ) + ft_hash_init( FT_Hash table, + FT_Hash_EqualFunc equal, + FT_Memory memory ) + { + FT_Error error; + + table->memory = memory; + table->p = 0; + table->mask = FT_HASH_INITIAL_SIZE-1; + table->slack = FT_HASH_INITIAL_SIZE*FT_HASH_MAX_LOAD; + table->node_equal = equal; + + (void)FT_NEW_ARRAY( table->buckets, FT_HASH_INITIAL_SIZE*2 ); - FT_NEW_ARRAY( hash->buckets, FT_HASH_INITIAL_SIZE*2 ); + return error; } @@ -84,12 +90,13 @@ - FT_BASE_DEF( FT_HashNode* ) + FT_BASE_DEF( FT_HashLookup ) ft_hash_lookup( FT_Hash table, FT_HashNode keynode ) { - FT_UInt index; - FT_UInt23 hash = keynode->hash; + FT_UInt index; + FT_UInt32 hash = keynode->hash; + FT_HashNode node, *pnode; index = (FT_UInt)(hash & table->mask); if ( index < table->p ) @@ -102,7 +109,7 @@ if ( node == NULL ) break; - if ( node->hash == hash && table->compare( node, keynode ) ) + if ( node->hash == hash && table->node_equal( node, keynode ) ) break; pnode = &node->link; @@ -114,20 +121,22 @@ - FT_BASE_DEF( void ) - ft_hash_add( FT_Hash table, - FT_HashNode* pnode, - FT_HashNode new_node ) + FT_BASE_DEF( FT_Error ) + ft_hash_add( FT_Hash table, + FT_HashLookup lookup, + FT_HashNode new_node ) { + FT_Error error = 0; + /* add it to the hash table */ - new_node->link = *pnode; - *pnode = new_node; + new_node->link = *lookup; + *lookup = new_node; if ( --table->slack < 0 ) { FT_UInt p = table->p; FT_UInt mask = table->mask; - FT_HashNode new_list; + FT_HashNode new_list, node, *pnode; /* split a single bucket */ new_list = NULL; @@ -154,33 +163,41 @@ if ( p >= mask ) { - FT_RENEW_ARRAY( hash->buckets, (mask+1)*2, (mask+1)*4 ); + FT_Memory memory = table->memory; + + + if (FT_RENEW_ARRAY( table->buckets, (mask+1)*2, (mask+1)*4 )) + goto Exit; + table->mask = 2*mask + 1; table->p = 0; } else table->p = p + 1; } + Exit: + return error; } - FT_BASE_DEF( FT_Int ) - ft_hash_remove( FT_Hash table, - FT_HashNode* pnode ) + FT_BASE_DEF( FT_Error ) + ft_hash_remove( FT_Hash table, + FT_HashLookup lookup ) { FT_HashNode node; FT_UInt num_buckets; + FT_Error error = 0; FT_ASSERT( pnode != NULL && node != NULL ); - node = *pnode; - *pnode->link = node->link; - node->link = NULL; + node = *lookup; + *lookup = node->link; + node->link = NULL; num_buckets = ( table->p + table->mask + 1) ; - if ( ++ table->slack > num_buckets*FT_HASH_SUB_LOAD ) + if ( ++ table->slack > (FT_Long)num_buckets*FT_HASH_SUB_LOAD ) { FT_UInt p = table->p; FT_UInt mask = table->mask; @@ -189,14 +206,26 @@ FT_HashNode* pold; if ( old_index < FT_HASH_INITIAL_SIZE ) - return; + goto Exit; if ( p == 0 ) { + FT_Memory memory = table->memory; + table->mask >>= 1; p = table->mask; - FT_RENEW_ARRAY( hash->buckets, (mask+1)*2, (mask) ); + if ( FT_RENEW_ARRAY( table->buckets, (mask+1)*2, (mask+1) ) ) + { + /* this should never happen normally, but who knows :-) */ + /* we need to re-inject the node in the hash table before */ + /* returning there, since it's safer */ + pnode = table->buckets; + node->link = *pnode; + *pnode = node; + + goto Exit; + } } else p--; @@ -212,4 +241,6 @@ table->slack -= FT_HASH_MAX_LOAD; table->p = p; } + Exit: + return error; } Index: xc/extras/freetype2/src/base/ftinit.c diff -u xc/extras/freetype2/src/base/ftinit.c:1.1.1.5 xc/extras/freetype2/src/base/ftinit.c:1.1.1.6 --- xc/extras/freetype2/src/base/ftinit.c:1.1.1.5 Thu Jun 20 04:16:13 2002 +++ xc/extras/freetype2/src/base/ftinit.c Wed May 28 22:01:49 2003 @@ -93,7 +93,7 @@ /* notify errors, but don't stop */ if ( error ) { - FT_ERROR(( "FT_Add_Default_Module: Cannot install `%s', error = %x\n", + FT_ERROR(( "FT_Add_Default_Module: Cannot install `%s', error = 0x%x\n", (*cur)->module_name, error )); } cur++; Index: xc/extras/freetype2/src/base/ftmac.c diff -u xc/extras/freetype2/src/base/ftmac.c:1.2 xc/extras/freetype2/src/base/ftmac.c:1.5 --- xc/extras/freetype2/src/base/ftmac.c:1.2 Wed Jan 1 17:08:40 2003 +++ xc/extras/freetype2/src/base/ftmac.c Wed May 28 22:13:03 2003 @@ -14,7 +14,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ - +/* $XFree86: xc/extras/freetype2/src/base/ftmac.c,v 1.5 2003/05/29 02:13:03 dawes Exp $ */ /* Notes @@ -534,22 +534,17 @@ return error; } - args.flags = ft_open_stream; + args.flags = FT_OPEN_STREAM; args.stream = stream; if ( driver_name ) { - args.flags = args.flags | ft_open_driver; + args.flags = args.flags | FT_OPEN_DRIVER; args.driver = FT_Get_Module( library, driver_name ); } error = FT_Open_Face( library, &args, face_index, aface ); if ( error == FT_Err_Ok ) (*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM; - else - { - FT_Stream_CloseFunc( stream ); - FT_FREE( stream ); - } return error; } @@ -914,7 +909,7 @@ #endif /* let it fall through to normal loader (.ttf, .otf, etc.) */ - args.flags = ft_open_pathname; + args.flags = FT_OPEN_PATHNAME; args.pathname = (char*)pathname; return FT_Open_Face( library, &args, face_index, aface ); } Index: xc/extras/freetype2/src/base/ftobject.c diff -u xc/extras/freetype2/src/base/ftobject.c:1.1.1.1 xc/extras/freetype2/src/base/ftobject.c:1.1.1.2 --- xc/extras/freetype2/src/base/ftobject.c:1.1.1.1 Thu Jun 20 04:16:13 2002 +++ xc/extras/freetype2/src/base/ftobject.c Wed May 28 22:01:49 2003 @@ -1,14 +1,23 @@ -#include "ftobject.c" +#include <ft2build.h> +#include FT_INTERNAL_OBJECT_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_OBJECTS_H #define FT_MAGIC_DEATH 0xDEADdead #define FT_MAGIC_CLASS 0x12345678 +#define FT_TYPE_HASH(x) (( (FT_UInt32)(x) >> 2 )^( (FT_UInt32)(x) >> 10 )) + #define FT_OBJECT_CHECK(o) \ - ( FT_OBJECT(o) != NULL && \ - FT_OBJECT(o)->clazz != NULL && \ - FT_OBJECT(o)->ref_count >= 1 && \ + ( FT_OBJECT(o) != NULL && \ + FT_OBJECT(o)->clazz != NULL && \ + FT_OBJECT(o)->ref_count >= 1 && \ FT_OBJECT(o)->clazz->magic == FT_MAGIC_CLASS ) +#define FT_CLASS_CHECK(c) \ + ( FT_CLASS(c) != NULL && FT_CLASS(c)->magic == FT_MAGIC_CLASS ) + +#define FT_ASSERT_IS_CLASS(c) FT_ASSERT( FT_CLASS_CHECK(c) ) /*******************************************************************/ /*******************************************************************/ @@ -20,42 +29,43 @@ /*******************************************************************/ /*******************************************************************/ - /* we use a dynamic hash table to map types to classes */ - /* this structure defines the layout of each node of */ - /* this table */ - typedef struct FT_ClassHNodeRec_ - { - FT_HashNodeRec hnode; - FT_Type ctype; - FT_Class clazz; + /* forward declaration */ + FT_BASE_DEF( FT_Error ) + ft_metaclass_init( FT_MetaClass meta, + FT_Library library ); - } FT_ClassHNodeRec, *FT_ClassHNode; + /* forward declaration */ + FT_BASE_DEF( void ) + ft_metaclass_done( FT_MetaClass meta ); - /* the meta class contains a type -> class mapping */ - /* and owns all class objects.. */ - /* */ - typedef struct FT_MetaClassRec_ + /* class type for the meta-class itself */ + static const FT_TypeRec ft_meta_class_type = { - FT_ClassRec clazz; - FT_HashRec type_to_class; + "FT2.MetaClass", + NULL, + + sizeof( FT_MetaClassRec ), + (FT_Object_InitFunc) ft_metaclass_init, + (FT_Object_DoneFunc) ft_metaclass_done, + + sizeof( FT_ClassRec ), + (FT_Object_InitFunc) NULL, + (FT_Object_DoneFunc) NULL + }; - } FT_MetaClassRec, *FT_MetaClass; - /* forward declaration */ - static const FT_TypeRec ft_meta_class_type; /* destroy a given class */ static void ft_class_hnode_destroy( FT_ClassHNode node ) { - FT_Clazz clazz = node->clazz; + FT_Class clazz = node->clazz; FT_Memory memory = clazz->memory; - FT_Type ctype = clazz->type; - if ( ctype->class_done ) - ctype->class_done( clazz ); + if ( clazz->class_done ) + clazz->class_done( (FT_Object) clazz ); FT_FREE( clazz ); @@ -67,32 +77,81 @@ static FT_Int - ft_class_hnode_compare( const FT_ClassHNode node1, - const FT_ClassHNode node2 ) + ft_type_equal( FT_Type type1, + FT_Type type2 ) + { + if ( type1 == type2 ) + goto Ok; + + if ( type1 == NULL || type2 == NULL ) + goto Fail; + + /* compare parent types */ + if ( type1->super != type2->super ) + { + if ( type1->super == NULL || + type2->super == NULL || + !ft_type_equal( type1, type2 ) ) + goto Fail; + } + + /* compare type names */ + if ( type1->name != type2->name ) + { + if ( type1->name == NULL || + type2->name == NULL || + ft_strcmp( type1->name, type2->name ) != 0 ) + goto Fail; + } + + /* compare the other type fields */ + if ( type1->class_size != type2->class_size || + type1->class_init != type2->class_init || + type1->class_done != type2->class_done || + type1->obj_size != type2->obj_size || + type1->obj_init != type2->obj_init || + type1->obj_done != type2->obj_done ) + goto Fail; + + Ok: + return 1; + + Fail: + return 0; + } + + + static FT_Int + ft_class_hnode_equal( const FT_ClassHNode node1, + const FT_ClassHNode node2 ) { - return ( node1->type == node2->type ); + FT_Type type1 = node1->type; + FT_Type type2 = node2->type; + + /* comparing the pointers should work in 99% of cases */ + return ( type1 == type2 ) ? 1 : ft_type_equal( type1, type2 ); } - static void + FT_BASE_DEF( void ) ft_metaclass_done( FT_MetaClass meta ) { - /* clear all objects */ + /* clear all classes */ ft_hash_done( &meta->type_to_class, - (FT_Hash_ForeachFunc) ft_class_destroy, + (FT_Hash_ForeachFunc) ft_class_hnode_destroy, NULL ); - meta->clazz->object.clazz = NULL; - meta->clazz->object.ref_count = 0; - meta->clazz->magic = FT_MAGIC_DEATH; + meta->clazz.object.clazz = NULL; + meta->clazz.object.ref_count = 0; + meta->clazz.magic = FT_MAGIC_DEATH; } - static void + FT_BASE_DEF( FT_Error ) ft_metaclass_init( FT_MetaClass meta, FT_Library library ) { - FT_ClassRec* clazz = meta->clazz; + FT_ClassRec* clazz = (FT_ClassRec*) &meta->clazz; /* the meta-class is its OWN class !! */ clazz->object.clazz = (FT_Class) clazz; @@ -100,65 +159,131 @@ clazz->magic = FT_MAGIC_CLASS; clazz->library = library; clazz->memory = library->memory; - clazz->type = &ft_metaclass_type; + clazz->type = &ft_meta_class_type; clazz->info = NULL; + clazz->class_done = (FT_Object_DoneFunc) ft_metaclass_done; + clazz->obj_size = sizeof( FT_ClassRec ); clazz->obj_init = NULL; clazz->obj_done = NULL; - ft_hash_init( &meta->type_to_class, - (FT_Hash_CompareFunc) ft_class_hnode_compare, - library->memory ); + return ft_hash_init( &meta->type_to_class, + (FT_Hash_EqualFunc) ft_class_hnode_equal, + library->memory ); } /* find or create the class corresponding to a given type */ + /* note that this function will retunr NULL in case of */ + /* memory overflow */ + /* */ static FT_Class ft_metaclass_get_class( FT_MetaClass meta, FT_Type ctype ) { FT_ClassHNodeRec keynode, *node, **pnode; FT_Memory memory; + FT_ClassRec* clazz; + FT_Class parent; + FT_Error error; - keynode.hnode.hash = (FT_UInt32)( ctype >> 2 ); - keynode.type = type; + keynode.hnode.hash = FT_TYPE_HASH( ctype ); + keynode.type = ctype; - pnode = (FT_ClassHNode) ft_hash_lookup( &meta->type_to_class, - &noderec ); + pnode = (FT_ClassHNode*) ft_hash_lookup( &meta->type_to_class, + (FT_HashNode) &keynode ); node = *pnode; if ( node != NULL ) - return node->clazz; + { + clazz = (FT_ClassRec*) node->clazz; + goto Exit; + } memory = FT_CLASS__MEMORY(meta); - node = FT_MEM_SAFE_ALLOC( sizeof(*node) ); - if ( node != NULL ) + clazz = NULL; + parent = NULL; + if ( ctype->super != NULL ) { - FT_ClassRec* clazz; + FT_ASSERT( ctype->super->class_size <= ctype->class_size ); + FT_ASSERT( ctype->super->obj_size <= ctype->obj_size ); - clazz = FT_MEM_SAFE_ALLOC( ctype->class_size ); - if ( clazz == NULL ) - { - FT_FREE( node ); - FT_XTHROW( FT_Err_Out_Of_Memory ); - } + parent = ft_metaclass_get_class( meta, ctype->super ); } - } + if ( !FT_NEW( node ) ) + { + if ( !FT_ALLOC( clazz, ctype->class_size ) ) + { + if ( parent ) + FT_MEM_COPY( (FT_ClassRec*)clazz, parent, parent->type->class_size ); - static const FT_TypeRec ft_meta_class_type = - { - "FT2.MetaClass", - NULL, + clazz->object.clazz = (FT_Class) meta; + clazz->object.ref_count = 1; - sizeof( FT_MetaClassRec ), - (FT_Object_InitFunc) ft_metaclass_init, - (FT_Object_DoneFunc) ft_metaclass_done, + clazz->memory = memory; + clazz->library = FT_CLASS__LIBRARY(meta); + clazz->super = parent; + clazz->type = ctype; + clazz->info = NULL; + clazz->magic = FT_MAGIC_CLASS; + + clazz->class_done = ctype->class_done; + clazz->obj_size = ctype->obj_size; + clazz->obj_init = ctype->obj_init; + clazz->obj_done = ctype->obj_done; + + if ( parent ) + { + if ( clazz->class_done == NULL ) + clazz->class_done = parent->class_done; + + if ( clazz->obj_init == NULL ) + clazz->obj_init = parent->obj_init; + + if ( clazz->obj_done == NULL ) + clazz->obj_done = parent->obj_done; + } + + /* find class initializer, if any */ + { + FT_Type ztype = ctype; + FT_Object_InitFunc cinit = NULL; + + do + { + cinit = ztype->class_init; + if ( cinit != NULL ) + break; + + ztype = ztype->super; + } + while ( ztype != NULL ); + + /* then call it when needed */ + if ( cinit != NULL ) + error = cinit( (FT_Object) clazz, NULL ); + } + } - sizeof( FT_ClassRec ), - (FT_Object_InitFunc) ft_class_init, - (FT_Object_DoneFunc) ft_class_done - }; + if (error) + { + if ( clazz ) + { + /* we always call the class destructor when */ + /* an error was detected in the constructor !! */ + if ( clazz->class_done ) + clazz->class_done( (FT_Object) clazz ); + + FT_FREE( clazz ); + } + FT_FREE( node ); + } + } + + Exit: + return (FT_Class) clazz; + } @@ -186,7 +311,6 @@ { if ( FT_OBJECT_CHECK(obj) ) { - FT_Object o = FT_OBJECT(obj); FT_Class c = FT_OBJECT__CLASS(obj); do @@ -200,103 +324,73 @@ return (clazz == NULL); } + return 0; } - /* the cleanup routine for all objects */ - static void - ft_object_cleanup( FT_Object object ) - { - FT_Memory memory = FT_OBJECT__MEMORY(object); - FT_Class clazz = FT_OBJECT__CLASS(object); - - if ( clazz->obj_done ) - clazz->obj_done( object ); - - FT_FREE( object ); - } - - - FT_BASE_DEF( FT_Object ) - ft_object_new( FT_Class clazz, - FT_Pointer init_data ) - { - FT_Memory memory; - FT_Object obj; - - - FT_ASSERT_IS_CLASS(clazz); - - memory = FT_CLASS__MEMORY(clazz); - obj = ft_mem_alloc( clazz->obj_size, memory ); - obj->clazz = clazz; - obj->ref_count = 1; - - if ( clazz->obj_init ) - { - FT_CleanupStack stack = FT_MEMORY__CLEANUP(memory); - - - ft_cleanup_push( stack, obj, (FT_CleanupFunc) ft_object_cleanup, NULL ); - - clazz->obj_init( obj, init_data ); - - ft_cleanup_pop( stack, obj, 0 ); - } - return obj; - } - - - - FT_BASE_DEF( void ) + FT_BASE_DEF( FT_Error ) ft_object_create( FT_Object *pobject, FT_Class clazz, FT_Pointer init_data ) { FT_Memory memory; + FT_Error error; FT_Object obj; FT_ASSERT_IS_CLASS(clazz); - memory = FT_CLASS__MEMORY(memory); - obj = ft_mem_alloc( clazz->obj_size, memory ); - obj->clazz = clazz; - obj->ref_count = 1; - *pobject = obj; + memory = FT_CLASS__MEMORY(clazz); + if ( !FT_ALLOC( obj, clazz->obj_size ) ) + { + obj->clazz = clazz; + obj->ref_count = 1; + + if ( clazz->obj_init ) + { + error = clazz->obj_init( obj, init_data ); + if ( error ) + { + /* IMPORTANT: call the destructor when an error */ + /* was detected in the constructor !! */ + if ( clazz->obj_done ) + clazz->obj_done( obj ); - if ( clazz->obj_init ) - clazz->obj_init( obj, init_data ); + FT_FREE( obj ); + } + } + } + *pobject = obj; + return error; } FT_BASE_DEF( FT_Class ) - ft_class_find_by_type( FT_Type type, - FT_Memory memory ) + ft_class_find_by_type( FT_Type type, + FT_Library library ) { - } + FT_MetaClass meta = &library->meta_class; + return ft_metaclass_get_class( meta, type ); + } - FT_BASE_DEF( FT_Class ) - ft_class_find_by_name( FT_CString class_name, - FT_Memory memory ); - - FT_BASE_DEF( FT_Object ) - ft_object_new_from_type( FT_Type type, - FT_Pointer data, - FT_Memory memory ); - FT_BASE_DEF( void ) + FT_BASE_DEF( FT_Error ) ft_object_create_from_type( FT_Object *pobject, FT_Type type, FT_Pointer init_data, - FT_Memory memory ); - - FT_BASE_DEF( void ) - ft_object_push( FT_Object object ); - - FT_BASE_DEF( void ) - ft_object_pop( FT_Object object ); + FT_Library library ) + { + FT_Class clazz; + FT_Error error; - FT_BASE_DEF( void ) - ft_object_pop_destroy( FT_Object object ); + clazz = ft_class_find_by_type( type, library ); + if ( clazz ) + error = ft_object_create( pobject, clazz, init_data ); + else + { + *pobject = NULL; + error = FT_Err_Out_Of_Memory; + } + return error; + } Index: xc/extras/freetype2/src/base/ftobjs.c diff -u xc/extras/freetype2/src/base/ftobjs.c:1.1.1.8 xc/extras/freetype2/src/base/ftobjs.c:1.1.1.9 --- xc/extras/freetype2/src/base/ftobjs.c:1.1.1.8 Thu Jun 20 04:16:14 2002 +++ xc/extras/freetype2/src/base/ftobjs.c Wed May 28 22:01:49 2003 @@ -22,7 +22,9 @@ #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H /* for SFNT_Load_Table_Func */ #include FT_TRUETYPE_TABLES_H +#include FT_TRUETYPE_IDS_H #include FT_OUTLINE_H @@ -75,9 +77,9 @@ /* create a new input stream from a FT_Open_Args structure */ /* */ static FT_Error - ft_input_stream_new( FT_Library library, - FT_Open_Args* args, - FT_Stream* astream ) + ft_input_stream_new( FT_Library library, + const FT_Open_Args* args, + FT_Stream* astream ) { FT_Error error; FT_Memory memory; @@ -98,20 +100,20 @@ stream->memory = memory; - if ( args->flags & ft_open_memory ) + if ( args->flags & FT_OPEN_MEMORY ) { /* create a memory-based stream */ FT_Stream_OpenMemory( stream, (const FT_Byte*)args->memory_base, args->memory_size ); } - else if ( args->flags & ft_open_pathname ) + else if ( args->flags & FT_OPEN_PATHNAME ) { /* create a normal system stream */ error = FT_Stream_Open( stream, args->pathname ); stream->pathname.pointer = args->pathname; } - else if ( ( args->flags & ft_open_stream ) && args->stream ) + else if ( ( args->flags & FT_OPEN_STREAM ) && args->stream ) { /* use an existing, user-provided stream */ @@ -196,24 +198,69 @@ return error; } - - static void - ft_glyphslot_clear( FT_GlyphSlot slot ) + FT_BASE_DEF( void ) + ft_glyphslot_free_bitmap( FT_GlyphSlot slot ) { - /* free bitmap if needed */ if ( slot->flags & FT_GLYPH_OWN_BITMAP ) { FT_Memory memory = FT_FACE_MEMORY( slot->face ); - - + + FT_FREE( slot->bitmap.buffer ); slot->flags &= ~FT_GLYPH_OWN_BITMAP; } + else + { + /* assume that the bitmap buffer was stolen or not */ + /* allocated from the heap */ + slot->bitmap.buffer = NULL; + } + } + + + FT_BASE_DEF( void ) + ft_glyphslot_set_bitmap( FT_GlyphSlot slot, + FT_Pointer buffer ) + { + ft_glyphslot_free_bitmap( slot ); + + slot->bitmap.buffer = buffer; + + FT_ASSERT( (slot->flags & FT_GLYPH_OWN_BITMAP) == 0 ); + } + + + FT_BASE_DEF( FT_Error ) + ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot, + FT_ULong size ) + { + FT_Memory memory = FT_FACE_MEMORY( slot->face ); + + + if ( slot->flags & FT_GLYPH_OWN_BITMAP ) + FT_FREE( slot->bitmap.buffer ); + else + slot->flags |= FT_GLYPH_OWN_BITMAP; + + return FT_MEM_ALLOC( slot->bitmap.buffer, size ); + } + + + static void + ft_glyphslot_clear( FT_GlyphSlot slot ) + { + /* free bitmap if needed */ + ft_glyphslot_free_bitmap( slot ); /* clear all public fields in the glyph slot */ - FT_MEM_SET( &slot->metrics, 0, sizeof ( slot->metrics ) ); - FT_MEM_SET( &slot->outline, 0, sizeof ( slot->outline ) ); - FT_MEM_SET( &slot->bitmap, 0, sizeof ( slot->bitmap ) ); + FT_ZERO( &slot->metrics ); + FT_ZERO( &slot->outline ); + + slot->bitmap.width = 0; + slot->bitmap.rows = 0; + slot->bitmap.pitch = 0; + slot->bitmap.pixel_mode = 0; + /* don't touch 'slot->bitmap.buffer' !! */ slot->bitmap_left = 0; slot->bitmap_top = 0; @@ -222,7 +269,7 @@ slot->control_data = 0; slot->control_len = 0; slot->other = 0; - slot->format = ft_glyph_format_none; + slot->format = FT_GLYPH_FORMAT_NONE; slot->linearHoriAdvance = 0; slot->linearVertAdvance = 0; @@ -241,8 +288,7 @@ clazz->done_slot( slot ); /* free bitmap buffer if needed */ - if ( slot->flags & FT_GLYPH_OWN_BITMAP ) - FT_FREE( slot->bitmap.buffer ); + ft_glyphslot_free_bitmap( slot ); /* free glyph loader */ if ( FT_DRIVER_USES_OUTLINES( driver ) ) @@ -380,6 +426,23 @@ } + /* documentation is in freetype.h */ + + FT_EXPORT_DEF( void ) + FT_Set_Hint_Flags( FT_Face face, + FT_ULong flags ) + { + FT_Face_Internal internal; + + if ( !face ) + return; + + internal = face->internal; + + internal->hint_flags = (FT_UInt)flags; + } + + static FT_Renderer ft_lookup_glyph_renderer( FT_GlyphSlot slot ); @@ -387,9 +450,9 @@ /* documentation is in freetype.h */ FT_EXPORT_DEF( FT_Error ) - FT_Load_Glyph( FT_Face face, - FT_UInt glyph_index, - FT_Int load_flags ) + FT_Load_Glyph( FT_Face face, + FT_UInt glyph_index, + FT_Int32 load_flags ) { FT_Error error; FT_Driver driver; @@ -402,7 +465,7 @@ if ( !face || !face->size || !face->glyph ) return FT_Err_Invalid_Face_Handle; - if ( glyph_index >= (FT_UInt)face->num_glyphs ) + if ( glyph_index > (FT_UInt)face->num_glyphs ) return FT_Err_Invalid_Argument; slot = face->glyph; @@ -416,6 +479,7 @@ /* disable scaling, hinting, and transformation */ load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING | + FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM; /* disable bitmap rendering */ @@ -426,10 +490,12 @@ library = driver->root.library; hinter = library->auto_hinter; autohint = - FT_BOOL( hinter && - !( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) ) && - FT_DRIVER_IS_SCALABLE( driver ) && - FT_DRIVER_USES_OUTLINES( driver ) ); + FT_BOOL( hinter && + !( load_flags & ( FT_LOAD_NO_SCALE | + FT_LOAD_NO_HINTING | + FT_LOAD_NO_AUTOHINT ) ) && + FT_DRIVER_IS_SCALABLE( driver ) && + FT_DRIVER_USES_OUTLINES( driver ) ); if ( autohint ) { if ( FT_DRIVER_HAS_HINTER( driver ) && @@ -447,13 +513,14 @@ /* XXX: This is really a temporary hack that should disappear */ /* promptly with FreeType 2.1! */ /* */ - if ( FT_HAS_FIXED_SIZES( face ) ) + if ( FT_HAS_FIXED_SIZES( face ) && + ( load_flags & FT_LOAD_NO_BITMAP ) == 0 ) { error = driver->clazz->load_glyph( slot, face->size, glyph_index, load_flags | FT_LOAD_SBITS_ONLY ); - if ( !error && slot->format == ft_glyph_format_bitmap ) + if ( !error && slot->format == FT_GLYPH_FORMAT_BITMAP ) goto Load_Ok; } @@ -530,14 +597,18 @@ /* do we need to render the image now? */ if ( !error && - slot->format != ft_glyph_format_bitmap && - slot->format != ft_glyph_format_composite && + slot->format != FT_GLYPH_FORMAT_BITMAP && + slot->format != FT_GLYPH_FORMAT_COMPOSITE && load_flags & FT_LOAD_RENDER ) { - error = FT_Render_Glyph( slot, - ( load_flags & FT_LOAD_MONOCHROME ) - ? ft_render_mode_mono - : ft_render_mode_normal ); + FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags ); + + + if ( mode == FT_RENDER_MODE_NORMAL && + (load_flags & FT_LOAD_MONOCHROME ) ) + mode = FT_RENDER_MODE_MONO; + + error = FT_Render_Glyph( slot, mode ); } Exit: @@ -550,7 +621,7 @@ FT_EXPORT_DEF( FT_Error ) FT_Load_Char( FT_Face face, FT_ULong char_code, - FT_Int load_flags ) + FT_Int32 load_flags ) { FT_UInt glyph_index; @@ -614,8 +685,6 @@ if ( face->generic.finalizer ) face->generic.finalizer( face ); -#ifdef FT_CONFIG_OPTION_USE_CMAPS - /* discard charmaps */ { FT_Int n; @@ -635,8 +704,6 @@ face->num_charmaps = 0; } -#endif /* FT_CONFIG_OPTION_USE_CMAPS */ - /* finalize format-specific stuff */ if ( clazz->done_face ) @@ -676,6 +743,100 @@ /*************************************************************************/ /* */ /* <Function> */ + /* find_unicode_charmap */ + /* */ + /* <Description> */ + /* This function finds a Unicode charmap, if there is one. */ + /* And if there is more than one, it tries to favour the more */ + /* extensive one, i.e. one that supports UCS-4 against those which */ + /* are limited to the BMP (said UCS-2 encoding.) */ + /* */ + /* This function is called from open_face() (just below), and also */ + /* from FT_Select_Charmap( , FT_ENCODING_UNICODE). */ + /* */ + static FT_Error + find_unicode_charmap( FT_Face face ) + { + FT_CharMap* first; + FT_CharMap* cur; + FT_CharMap* unicmap = NULL; /* some UCS-2 map, if we found it */ + + + /* caller should have already checked that `face' is valid */ + FT_ASSERT ( face ); + + first = face->charmaps; + + if ( !first ) + return FT_Err_Invalid_CharMap_Handle; + + /* + * the original TrueType specification(s) only specified charmap + * formats that are capable of mapping 8 or 16 bit character codes to + * glyph indices. + * + * however, recent updates to the Apple and OpenType specifications + * introduced new formats that are capable of mapping 32-bit character + * codes as well. And these are already used on some fonts, mainly to + * map non-BMP Asian ideographs as defined in Unicode. + * + * for compatibility purposes, these fonts generally come with + * *several* Unicode charmaps: + * + * - one of them in the "old" 16-bit format, that cannot access + * all glyphs in the font + * + * - another one in the "new" 32-bit format, that can access all + * the glyphs. + * + * this function has been written to always favor a 32-bit charmap + * when found. Otherwise, a 16-bit one is returned when found + */ + + /* since the `interesting' table, with id's 3,10, is normally the */ + /* last one, we loop backwards. This looses with type1 fonts with */ + /* non-BMP characters (<.0001%), this wins with .ttf with non-BMP */ + /* chars (.01% ?), and this is the same about 99.99% of the time! */ + + cur = first + face->num_charmaps; /* points after the last one */ + + for ( ; --cur >= first; ) + { + if ( cur[0]->encoding == FT_ENCODING_UNICODE ) + { + unicmap = cur; /* record we found a Unicode charmap */ + + /* XXX If some new encodings to represent UCS-4 are added, */ + /* they should be added here. */ + if ( ( cur[0]->platform_id == TT_PLATFORM_MICROSOFT && + cur[0]->encoding_id == TT_MS_ID_UCS_4 ) || + ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && + cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) ) + + /* Hurray! We found a UCS-4 charmap. We can stop the scan! */ + { + face->charmap = cur[0]; + return 0; + } + } + } + + /* We do not have any UCS-4 charmap. Sigh. */ + /* Let's see if we have some other kind of Unicode charmap, though. */ + if ( unicmap != NULL ) + { + face->charmap = unicmap[0]; + return 0; + } + + /* Chou blanc! */ + return FT_Err_Invalid_CharMap_Handle; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ /* open_face */ /* */ /* <Description> */ @@ -692,7 +853,7 @@ FT_Memory memory; FT_Driver_Class clazz; FT_Face face = 0; - FT_Error error; + FT_Error error, error2; FT_Face_Internal internal; @@ -712,14 +873,41 @@ face->memory = memory; face->stream = stream; +#ifdef FT_CONFIG_OPTION_INCREMENTAL + { + int i; + + + face->internal->incremental_interface = 0; + for ( i = 0; i < num_params && !face->internal->incremental_interface; + i++ ) + if ( params[i].tag == FT_PARAM_TAG_INCREMENTAL ) + face->internal->incremental_interface = params[i].data; + } +#endif + error = clazz->init_face( stream, face, - face_index, + (FT_Int)face_index, num_params, params ); if ( error ) goto Fail; + /* select Unicode charmap by default */ + error2 = find_unicode_charmap( face ); + + /* if no Unicode charmap can be found, FT_Err_Invalid_CharMap_Handle is + * returned. + */ + + /* no error should happen, but we want to play safe. */ + if ( error2 && error2 != FT_Err_Invalid_CharMap_Handle ) + { + error = error2; + goto Fail; + } + *aface = face; Fail: @@ -755,7 +943,7 @@ if ( !pathname ) return FT_Err_Invalid_Argument; - args.flags = ft_open_pathname; + args.flags = FT_OPEN_PATHNAME; args.pathname = (char*)pathname; return FT_Open_Face( library, &args, face_index, aface ); @@ -780,7 +968,7 @@ if ( !file_base ) return FT_Err_Invalid_Argument; - args.flags = ft_open_memory; + args.flags = FT_OPEN_MEMORY; args.memory_base = file_base; args.memory_size = file_size; @@ -791,10 +979,10 @@ /* documentation is in freetype.h */ FT_EXPORT_DEF( FT_Error ) - FT_Open_Face( FT_Library library, - FT_Open_Args* args, - FT_Long face_index, - FT_Face *aface ) + FT_Open_Face( FT_Library library, + const FT_Open_Args* args, + FT_Long face_index, + FT_Face *aface ) { FT_Error error; FT_Driver driver; @@ -813,7 +1001,7 @@ *aface = 0; - external_stream = FT_BOOL( ( args->flags & ft_open_stream ) && + external_stream = FT_BOOL( ( args->flags & FT_OPEN_STREAM ) && args->stream ); /* create input stream */ @@ -825,7 +1013,7 @@ /* If the font driver is specified in the `args' structure, use */ /* it. Otherwise, we scan the list of registered drivers. */ - if ( ( args->flags & ft_open_driver ) && args->driver ) + if ( ( args->flags & FT_OPEN_DRIVER ) && args->driver ) { driver = FT_DRIVER( args->driver ); @@ -836,7 +1024,7 @@ FT_Parameter* params = 0; - if ( args->flags & ft_open_params ) + if ( args->flags & FT_OPEN_PARAMS ) { num_params = args->num_params; params = args->params; @@ -871,14 +1059,14 @@ driver = FT_DRIVER( cur[0] ); - if ( args->flags & ft_open_params ) + if ( args->flags & FT_OPEN_PARAMS ) { num_params = args->num_params; params = args->params; } error = open_face( driver, stream, face_index, - num_params, params, &face ); + num_params, params, &face ); if ( !error ) goto Success; @@ -980,7 +1168,7 @@ if ( !filepathname ) return FT_Err_Invalid_Argument; - open.flags = ft_open_pathname; + open.flags = FT_OPEN_PATHNAME; open.pathname = (char*)filepathname; return FT_Attach_Stream( face, &open ); @@ -1024,7 +1212,7 @@ /* close the attached stream */ ft_input_stream_free( stream, (FT_Bool)( parameters->stream && - ( parameters->flags & ft_open_stream ) ) ); + ( parameters->flags & FT_OPEN_STREAM ) ) ); Exit: return error; @@ -1181,10 +1369,10 @@ /* Compute root ascender, descender, test height, and max_advance */ metrics->ascender = ( FT_MulFix( face->ascender, - metrics->y_scale ) + 32 ) & -64; + metrics->y_scale ) + 63 ) & -64; metrics->descender = ( FT_MulFix( face->descender, - metrics->y_scale ) + 32 ) & -64; + metrics->y_scale ) + 0 ) & -64; metrics->height = ( FT_MulFix( face->height, metrics->y_scale ) + 32 ) & -64; @@ -1237,9 +1425,10 @@ if ( char_height < 1 * 64 ) char_height = 1 * 64; - /* Compute pixel sizes in 26.6 units */ - dim_x = ( ( ( char_width * horz_resolution ) / 72 ) + 32 ) & -64; - dim_y = ( ( ( char_height * vert_resolution ) / 72 ) + 32 ) & -64; + /* Compute pixel sizes in 26.6 units. we use rounding + */ + dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; + dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); @@ -1350,12 +1539,12 @@ akerning ); if ( !error ) { - if ( kern_mode != ft_kerning_unscaled ) + if ( kern_mode != FT_KERNING_UNSCALED ) { akerning->x = FT_MulFix( akerning->x, face->size->metrics.x_scale ); akerning->y = FT_MulFix( akerning->y, face->size->metrics.y_scale ); - if ( kern_mode != ft_kerning_unfitted ) + if ( kern_mode != FT_KERNING_UNFITTED ) { akerning->x = ( akerning->x + 32 ) & -64; akerning->y = ( akerning->y + 32 ) & -64; @@ -1381,6 +1570,13 @@ if ( !face ) return FT_Err_Invalid_Face_Handle; + /* FT_ENCODING_UNICODE is special. We try to find the `best' Unicode */ + /* charmap available, i.e. one with UCS-4 characters, if possible. */ + /* */ + /* This is done by find_unicode_charmap() above, to share code. */ + if ( encoding == FT_ENCODING_UNICODE ) + return find_unicode_charmap( face ); + cur = face->charmaps; if ( !cur ) return FT_Err_Invalid_CharMap_Handle; @@ -1503,8 +1699,6 @@ /* documentation is in freetype.h */ -#ifdef FT_CONFIG_OPTION_USE_CMAPS - FT_EXPORT_DEF( FT_UInt ) FT_Get_Char_Index( FT_Face face, FT_ULong charcode ) @@ -1522,25 +1716,6 @@ return result; } -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - FT_EXPORT_DEF( FT_UInt ) - FT_Get_Char_Index( FT_Face face, - FT_ULong charcode ) - { - FT_UInt result = 0; - FT_Driver driver; - - - if ( face && face->charmap ) - { - driver = face->driver; - result = driver->clazz->get_char_index( face->charmap, charcode ); - } - return result; - } - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ /* documentation is in freetype.h */ @@ -1569,8 +1744,6 @@ /* documentation is in freetype.h */ -#ifdef FT_CONFIG_OPTION_USE_CMAPS - FT_EXPORT_DEF( FT_ULong ) FT_Get_Next_Char( FT_Face face, FT_ULong charcode, @@ -1596,37 +1769,6 @@ return result; } -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - FT_EXPORT_DEF( FT_ULong ) - FT_Get_Next_Char( FT_Face face, - FT_ULong charcode, - FT_UInt *agindex ) - { - FT_ULong result = 0; - FT_UInt gindex = 0; - FT_Driver driver; - - - if ( face && face->charmap ) - { - driver = face->driver; - result = driver->clazz->get_next_char( face->charmap, charcode ); - if ( result != 0 ) - { - gindex = driver->clazz->get_char_index( face->charmap, result ); - if ( gindex == 0 ) - result = 0; - } - } - - if ( agindex ) - *agindex = gindex; - - return result; - } - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ /* documentation is in freetype.h */ @@ -1676,9 +1818,9 @@ if ( buffer && buffer_max > 0 ) ((FT_Byte*)buffer)[0] = 0; - if ( face && - glyph_index < (FT_UInt)face->num_glyphs && - FT_HAS_GLYPH_NAMES( face ) ) + if ( face && + glyph_index <= (FT_UInt)face->num_glyphs && + FT_HAS_GLYPH_NAMES( face ) ) { /* now, lookup for glyph name */ FT_Driver driver = face->driver; @@ -1761,6 +1903,32 @@ } + /* documentation is in tttables.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Load_Sfnt_Table( FT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ) + { + SFNT_Load_Table_Func func; + FT_Driver driver; + + + if ( !face || !FT_IS_SFNT( face ) ) + return FT_Err_Invalid_Face_Handle; + + driver = face->driver; + func = (SFNT_Load_Table_Func) driver->root.clazz->get_interface( + FT_MODULE( driver ), "load_sfnt" ); + if ( !func ) + return FT_Err_Unimplemented_Feature; + + return func( face, tag, offset, buffer, length ); + } + + FT_EXPORT_DEF( FT_Error ) FT_Activate_Size( FT_Size size ) { @@ -1858,7 +2026,7 @@ FT_Renderer renderer; - renderer = FT_Lookup_Renderer( library, ft_glyph_format_outline, 0 ); + renderer = FT_Lookup_Renderer( library, FT_GLYPH_FORMAT_OUTLINE, 0 ); library->cur_renderer = renderer; } @@ -1884,7 +2052,7 @@ render->glyph_format = clazz->glyph_format; /* allocate raster object if needed */ - if ( clazz->glyph_format == ft_glyph_format_outline && + if ( clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE && clazz->raster_class->raster_new ) { error = clazz->raster_class->raster_new( memory, &render->raster ); @@ -1977,12 +2145,12 @@ FT_List_Up( &library->renderers, node ); - if ( renderer->glyph_format == ft_glyph_format_outline ) + if ( renderer->glyph_format == FT_GLYPH_FORMAT_OUTLINE ) library->cur_renderer = renderer; if ( num_params > 0 ) { - FTRenderer_setMode set_mode = renderer->clazz->set_mode; + FT_Renderer_SetModeFunc set_mode = renderer->clazz->set_mode; for ( ; num_params > 0; num_params-- ) @@ -1999,9 +2167,9 @@ FT_BASE_DEF( FT_Error ) - FT_Render_Glyph_Internal( FT_Library library, - FT_GlyphSlot slot, - FT_UInt render_mode ) + FT_Render_Glyph_Internal( FT_Library library, + FT_GlyphSlot slot, + FT_Render_Mode render_mode ) { FT_Error error = FT_Err_Ok; FT_Renderer renderer; @@ -2010,7 +2178,7 @@ /* if it is already a bitmap, no need to do anything */ switch ( slot->format ) { - case ft_glyph_format_bitmap: /* already a bitmap, don't do anything */ + case FT_GLYPH_FORMAT_BITMAP: /* already a bitmap, don't do anything */ break; default: @@ -2020,7 +2188,7 @@ /* small shortcut for the very common case */ - if ( slot->format == ft_glyph_format_outline ) + if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) { renderer = library->cur_renderer; node = library->renderers.head; @@ -2060,8 +2228,8 @@ /* documentation is in freetype.h */ FT_EXPORT_DEF( FT_Error ) - FT_Render_Glyph( FT_GlyphSlot slot, - FT_UInt render_mode ) + FT_Render_Glyph( FT_GlyphSlot slot, + FT_Render_Mode render_mode ) { FT_Library library; @@ -2187,7 +2355,7 @@ } /* allocate module object */ - if ( FT_ALLOC( module,clazz->module_size ) ) + if ( FT_ALLOC( module, clazz->module_size ) ) goto Exit; /* base initialization */ @@ -2422,13 +2590,13 @@ patch = library->version_patch; } - if ( *amajor ) + if ( amajor ) *amajor = major; - if ( *aminor ) + if ( aminor ) *aminor = minor; - if ( *apatch ) + if ( apatch ) *apatch = patch; } Index: xc/extras/freetype2/src/base/ftoutln.c diff -u xc/extras/freetype2/src/base/ftoutln.c:1.1.1.6 xc/extras/freetype2/src/base/ftoutln.c:1.1.1.7 --- xc/extras/freetype2/src/base/ftoutln.c:1.1.1.6 Thu Jun 20 04:16:14 2002 +++ xc/extras/freetype2/src/base/ftoutln.c Wed May 28 22:01:49 2003 @@ -98,14 +98,14 @@ tag = FT_CURVE_TAG( tags[0] ); /* A contour cannot start with a cubic control point! */ - if ( tag == FT_Curve_Tag_Cubic ) + if ( tag == FT_CURVE_TAG_CUBIC ) goto Invalid_Outline; /* check first point to determine origin */ - if ( tag == FT_Curve_Tag_Conic ) + if ( tag == FT_CURVE_TAG_CONIC ) { /* first point is conic control. Yes, this happens. */ - if ( FT_CURVE_TAG( outline->tags[last] ) == FT_Curve_Tag_On ) + if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON ) { /* start at last point if it is on the curve */ v_start = v_last; @@ -137,7 +137,7 @@ tag = FT_CURVE_TAG( tags[0] ); switch ( tag ) { - case FT_Curve_Tag_On: /* emit a single line_to */ + case FT_CURVE_TAG_ON: /* emit a single line_to */ { FT_Vector vec; @@ -151,7 +151,7 @@ continue; } - case FT_Curve_Tag_Conic: /* consume conic arcs */ + case FT_CURVE_TAG_CONIC: /* consume conic arcs */ v_control.x = SCALED( point->x ); v_control.y = SCALED( point->y ); @@ -169,7 +169,7 @@ vec.x = SCALED( point->x ); vec.y = SCALED( point->y ); - if ( tag == FT_Curve_Tag_On ) + if ( tag == FT_CURVE_TAG_ON ) { error = func_interface->conic_to( &v_control, &vec, user ); if ( error ) @@ -177,7 +177,7 @@ continue; } - if ( tag != FT_Curve_Tag_Conic ) + if ( tag != FT_CURVE_TAG_CONIC ) goto Invalid_Outline; v_middle.x = ( v_control.x + vec.x ) / 2; @@ -194,13 +194,13 @@ error = func_interface->conic_to( &v_control, &v_start, user ); goto Close; - default: /* FT_Curve_Tag_Cubic */ + default: /* FT_CURVE_TAG_CUBIC */ { FT_Vector vec1, vec2; if ( point + 1 > limit || - FT_CURVE_TAG( tags[1] ) != FT_Curve_Tag_Cubic ) + FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) goto Invalid_Outline; point += 2; @@ -270,12 +270,12 @@ anoutline->n_points = (FT_UShort)numPoints; anoutline->n_contours = (FT_Short)numContours; - anoutline->flags |= ft_outline_owner; + anoutline->flags |= FT_OUTLINE_OWNER; return FT_Err_Ok; Fail: - anoutline->flags |= ft_outline_owner; + anoutline->flags |= FT_OUTLINE_OWNER; FT_Outline_Done_Internal( memory, anoutline ); return error; @@ -334,7 +334,7 @@ if ( end != n_points - 1 ) goto Bad; - /* XXX: check the that array */ + /* XXX: check the tags array */ return 0; } @@ -366,11 +366,11 @@ FT_MEM_COPY( target->contours, source->contours, source->n_contours * sizeof ( FT_Short ) ); - /* copy all flags, except the `ft_outline_owner' one */ - is_owner = target->flags & ft_outline_owner; + /* copy all flags, except the `FT_OUTLINE_OWNER' one */ + is_owner = target->flags & FT_OUTLINE_OWNER; target->flags = source->flags; - target->flags &= ~ft_outline_owner; + target->flags &= ~FT_OUTLINE_OWNER; target->flags |= is_owner; return FT_Err_Ok; @@ -383,7 +383,7 @@ { if ( outline ) { - if ( outline->flags & ft_outline_owner ) + if ( outline->flags & FT_OUTLINE_OWNER ) { FT_FREE( outline->points ); FT_FREE( outline->tags ); @@ -535,7 +535,7 @@ first = last + 1; } - outline->flags ^= ft_outline_reverse_fill; + outline->flags ^= FT_OUTLINE_REVERSE_FILL; } @@ -576,7 +576,7 @@ /* now, look for another renderer that supports the same */ /* format */ - renderer = FT_Lookup_Renderer( library, ft_glyph_format_outline, + renderer = FT_Lookup_Renderer( library, FT_GLYPH_FORMAT_OUTLINE, &node ); update = 1; } @@ -608,8 +608,10 @@ params.target = abitmap; params.flags = 0; - if ( abitmap->pixel_mode == ft_pixel_mode_grays ) - params.flags |= ft_raster_flag_aa; + if ( abitmap->pixel_mode == FT_PIXEL_MODE_GRAY || + abitmap->pixel_mode == FT_PIXEL_MODE_LCD || + abitmap->pixel_mode == FT_PIXEL_MODE_LCD_V ) + params.flags |= FT_RASTER_FLAG_AA; return FT_Outline_Render( library, outline, ¶ms ); } Index: xc/extras/freetype2/src/base/ftpfr.c diff -u /dev/null xc/extras/freetype2/src/base/ftpfr.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:17 2004 +++ xc/extras/freetype2/src/base/ftpfr.c Wed May 28 22:01:49 2003 @@ -0,0 +1,105 @@ +/***************************************************************************/ +/* */ +/* ftpfr.c */ +/* */ +/* FreeType API for accessing PFR-specific data */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#include <ft2build.h> +#include FT_INTERNAL_PFR_H +#include FT_INTERNAL_OBJECTS_H + + + /* check the format */ + static FT_Error + ft_pfr_check( FT_Face face, + FT_PFR_Service *aservice ) + { + FT_Error error = FT_Err_Bad_Argument; + + if ( face && face->driver ) + { + FT_Module module = (FT_Module) face->driver; + const char* name = module->clazz->module_name; + + if ( name[0] == 'p' && + name[1] == 'f' && + name[2] == 'r' && + name[4] == 0 ) + { + *aservice = (FT_PFR_Service) module->clazz->module_interface; + error = 0; + } + } + return error; + } + + + + FT_EXPORT_DEF( FT_Error ) + FT_Get_PFR_Metrics( FT_Face face, + FT_UInt *aoutline_resolution, + FT_UInt *ametrics_resolution, + FT_Fixed *ametrics_x_scale, + FT_Fixed *ametrics_y_scale ) + { + FT_Error error; + FT_PFR_Service service; + + error = ft_pfr_check( face, &service ); + if ( !error ) + { + error = service->get_metrics( face, + aoutline_resolution, + ametrics_resolution, + ametrics_x_scale, + ametrics_y_scale ); + } + return error; + } + + FT_EXPORT_DEF( FT_Error ) + FT_Get_PFR_Kerning( FT_Face face, + FT_UInt left, + FT_UInt right, + FT_Vector *avector ) + { + FT_Error error; + FT_PFR_Service service; + + error = ft_pfr_check( face, &service ); + if ( !error ) + { + error = service->get_kerning( face, left, right, avector ); + } + return error; + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Get_PFR_Advance( FT_Face face, + FT_UInt gindex, + FT_Pos *aadvance ) + { + FT_Error error; + FT_PFR_Service service; + + error = ft_pfr_check( face, &service ); + if ( !error ) + { + error = service->get_advance( face, gindex, aadvance ); + } + return error; + } + +/* END */ Index: xc/extras/freetype2/src/base/ftstroker.c diff -u /dev/null xc/extras/freetype2/src/base/ftstroker.c:1.2 --- /dev/null Sat Feb 28 21:40:17 2004 +++ xc/extras/freetype2/src/base/ftstroker.c Sun Aug 24 15:34:21 2003 @@ -0,0 +1,1573 @@ +#include <ft2build.h> +#include FT_STROKER_H +#include FT_TRIGONOMETRY_H +#include FT_INTERNAL_MEMORY_H +#include FT_INTERNAL_DEBUG_H + + /***************************************************************************/ + /***************************************************************************/ + /***** *****/ + /***** BEZIER COMPUTATIONS *****/ + /***** *****/ + /***************************************************************************/ + /***************************************************************************/ +/* $XFree86: xc/extras/freetype2/src/base/ftstroker.c,v 1.2 2003/08/24 19:34:21 tsi Exp $ */ + +#define FT_SMALL_CONIC_THRESHOLD (FT_ANGLE_PI/6) +#define FT_SMALL_CUBIC_THRESHOLD (FT_ANGLE_PI/6) +#define FT_EPSILON 2 + +#define FT_IS_SMALL(x) ((x) > -FT_EPSILON && (x) < FT_EPSILON) + + static FT_Pos + ft_pos_abs( FT_Pos x ) + { + return x >= 0 ? x : -x ; + } + + static void + ft_conic_split( FT_Vector* base ) + { + FT_Pos a, b; + + + base[4].x = base[2].x; + b = base[1].x; + a = base[3].x = ( base[2].x + b )/2; + b = base[1].x = ( base[0].x + b )/2; + base[2].x = ( a + b )/2; + + base[4].y = base[2].y; + b = base[1].y; + a = base[3].y = ( base[2].y + b )/2; + b = base[1].y = ( base[0].y + b )/2; + base[2].y = ( a + b )/2; + } + + + static FT_Bool + ft_conic_is_small_enough( FT_Vector* base, + FT_Angle *angle_in, + FT_Angle *angle_out ) + { + FT_Vector d1, d2; + FT_Angle theta; + FT_Int close1, close2; + + d1.x = base[1].x - base[2].x; + d1.y = base[1].y - base[2].y; + d2.x = base[0].x - base[1].x; + d2.y = base[0].y - base[1].y; + + close1 = FT_IS_SMALL(d1.x) && FT_IS_SMALL(d1.y); + close2 = FT_IS_SMALL(d2.x) && FT_IS_SMALL(d2.y); + + if (close1) + { + if (close2) + *angle_in = *angle_out = 0; + else + *angle_in = *angle_out = FT_Atan2( d2.x, d2.y ); + } + else if (close2) + { + *angle_in = *angle_out = FT_Atan2( d1.x, d1.y ); + } + else + { + *angle_in = FT_Atan2( d1.x, d1.y ); + *angle_out = FT_Atan2( d2.x, d2.y ); + } + + theta = ft_pos_abs( FT_Angle_Diff( *angle_in, *angle_out ) ); + + return FT_BOOL( theta < FT_SMALL_CONIC_THRESHOLD ); + } + + + static void + ft_cubic_split( FT_Vector* base ) + { + FT_Pos a, b, c, d; + + + base[6].x = base[3].x; + c = base[1].x; + d = base[2].x; + base[1].x = a = ( base[0].x + c )/2; + base[5].x = b = ( base[3].x + d )/2; + c = ( c + d )/2; + base[2].x = a = ( a + c )/2; + base[4].x = b = ( b + c )/2; + base[3].x = ( a + b )/2; + + base[6].y = base[3].y; + c = base[1].y; + d = base[2].y; + base[1].y = a = ( base[0].y + c )/2; + base[5].y = b = ( base[3].y + d )/2; + c = ( c + d )/2; + base[2].y = a = ( a + c )/2; + base[4].y = b = ( b + c )/2; + base[3].y = ( a + b )/2; + } + + + static FT_Bool + ft_cubic_is_small_enough( FT_Vector* base, + FT_Angle *angle_in, + FT_Angle *angle_mid, + FT_Angle *angle_out ) + { + FT_Vector d1, d2, d3; + FT_Angle theta1, theta2; + FT_Int close1, close2, close3; + + d1.x = base[2].x - base[3].x; + d1.y = base[2].y - base[3].y; + d2.x = base[1].x - base[2].x; + d2.y = base[1].y - base[2].y; + d3.x = base[0].x - base[1].x; + d3.y = base[0].y - base[1].y; + + close1 = FT_IS_SMALL(d1.x) && FT_IS_SMALL(d1.y); + close2 = FT_IS_SMALL(d2.x) && FT_IS_SMALL(d2.y); + close3 = FT_IS_SMALL(d3.x) && FT_IS_SMALL(d3.y); + + if (close1 || close3) + { + if (close2) + { + /* basically a point */ + *angle_in = *angle_out = *angle_mid = 0; + } + else if (close1) + { + *angle_in = *angle_mid = FT_Atan2( d2.x, d2.y ); + *angle_out = FT_Atan2( d3.x, d3.y ); + } + else /* close2 */ + { + *angle_in = FT_Atan2( d1.x, d1.y ); + *angle_mid = *angle_out = FT_Atan2( d2.x, d2.y ); + } + } + else if (close2) + { + *angle_in = *angle_mid = FT_Atan2( d1.x, d1.y ); + *angle_out = FT_Atan2( d3.x, d3.y ); + } + else + { + *angle_in = FT_Atan2( d1.x, d1.y ); + *angle_mid = FT_Atan2( d2.x, d2.y ); + *angle_out = FT_Atan2( d3.x, d3.y ); + } + theta1 = ft_pos_abs( FT_Angle_Diff( *angle_in, *angle_mid ) ); + theta2 = ft_pos_abs( FT_Angle_Diff( *angle_mid, *angle_out ) ); + + return FT_BOOL( theta1 < FT_SMALL_CUBIC_THRESHOLD && + theta2 < FT_SMALL_CUBIC_THRESHOLD ); + } + + + + /***************************************************************************/ + /***************************************************************************/ + /***** *****/ + /***** STROKE BORDERS *****/ + /***** *****/ + /***************************************************************************/ + /***************************************************************************/ + + typedef enum + { + FT_STROKE_TAG_ON = 1, /* on-curve point */ + FT_STROKE_TAG_CUBIC = 2, /* cubic off-point */ + FT_STROKE_TAG_BEGIN = 4, /* sub-path start */ + FT_STROKE_TAG_END = 8 /* sub-path end */ + + } FT_StrokeTags; + + + typedef struct FT_StrokeBorderRec_ + { + FT_UInt num_points; + FT_UInt max_points; + FT_Vector* points; + FT_Byte* tags; + FT_Bool movable; + FT_Int start; /* index of current sub-path start point */ + FT_Memory memory; + + } FT_StrokeBorderRec, *FT_StrokeBorder; + + + static FT_Error + ft_stroke_border_grow( FT_StrokeBorder border, + FT_UInt new_points ) + { + FT_UInt old_max = border->max_points; + FT_UInt new_max = border->num_points + new_points; + FT_Error error = 0; + + if ( new_max > old_max ) + { + FT_UInt cur_max = old_max; + FT_Memory memory = border->memory; + + while ( cur_max < new_max ) + cur_max += (cur_max >> 1) + 16; + + if ( FT_RENEW_ARRAY( border->points, old_max, cur_max ) || + FT_RENEW_ARRAY( border->tags, old_max, cur_max ) ) + goto Exit; + + border->max_points = cur_max; + } + Exit: + return error; + } + + static void + ft_stroke_border_close( FT_StrokeBorder border ) + { + FT_ASSERT( border->start >= 0 ); + + /* don't record empty paths !! */ + if ( border->num_points > (FT_UInt)border->start ) + { + border->tags[ border->start ] |= FT_STROKE_TAG_BEGIN; + border->tags[ border->num_points-1 ] |= FT_STROKE_TAG_END; + } + + border->start = -1; + border->movable = 0; + } + + + static FT_Error + ft_stroke_border_lineto( FT_StrokeBorder border, + FT_Vector* to, + FT_Bool movable ) + { + FT_Error error = 0; + + FT_ASSERT( border->start >= 0 ); + + if ( border->movable ) + { + /* move last point */ + border->points[ border->num_points-1 ] = *to; + } + else + { + /* add one point */ + error = ft_stroke_border_grow( border, 1 ); + if (!error) + { + FT_Vector* vec = border->points + border->num_points; + FT_Byte* tag = border->tags + border->num_points; + + vec[0] = *to; + tag[0] = FT_STROKE_TAG_ON; + + border->num_points += 1; + } + } + border->movable = movable; + return error; + } + + + static FT_Error + ft_stroke_border_conicto( FT_StrokeBorder border, + FT_Vector* control, + FT_Vector* to ) + { + FT_Error error; + + FT_ASSERT( border->start >= 0 ); + + error = ft_stroke_border_grow( border, 2 ); + if (!error) + { + FT_Vector* vec = border->points + border->num_points; + FT_Byte* tag = border->tags + border->num_points; + + vec[0] = *control; + vec[1] = *to; + + tag[0] = 0; + tag[1] = FT_STROKE_TAG_ON; + + border->num_points += 2; + } + border->movable = 0; + return error; + } + + + static FT_Error + ft_stroke_border_cubicto( FT_StrokeBorder border, + FT_Vector* control1, + FT_Vector* control2, + FT_Vector* to ) + { + FT_Error error; + + FT_ASSERT( border->start >= 0 ); + + error = ft_stroke_border_grow( border, 3 ); + if (!error) + { + FT_Vector* vec = border->points + border->num_points; + FT_Byte* tag = border->tags + border->num_points; + + vec[0] = *control1; + vec[1] = *control2; + vec[2] = *to; + + tag[0] = FT_STROKE_TAG_CUBIC; + tag[1] = FT_STROKE_TAG_CUBIC; + tag[2] = FT_STROKE_TAG_ON; + + border->num_points += 3; + } + border->movable = 0; + return error; + } + + +#define FT_ARC_CUBIC_ANGLE (FT_ANGLE_PI/2) + + + static FT_Error + ft_stroke_border_arcto( FT_StrokeBorder border, + FT_Vector* center, + FT_Fixed radius, + FT_Angle angle_start, + FT_Angle angle_diff ) + { + FT_Angle total, angle, step, rotate, next, theta; + FT_Vector a, b, a2, b2; + FT_Fixed length; + FT_Error error = 0; + + /* compute start point */ + FT_Vector_From_Polar( &a, radius, angle_start ); + a.x += center->x; + a.y += center->y; + + total = angle_diff; + angle = angle_start; + rotate = ( angle_diff >= 0 ) ? FT_ANGLE_PI2 : -FT_ANGLE_PI2; + + while (total != 0) + { + step = total; + if ( step > FT_ARC_CUBIC_ANGLE ) + step = FT_ARC_CUBIC_ANGLE; + + else if ( step < -FT_ARC_CUBIC_ANGLE ) + step = -FT_ARC_CUBIC_ANGLE; + + next = angle + step; + theta = step; + if ( theta < 0 ) + theta = -theta; + + theta >>= 1; + + /* compute end point */ + FT_Vector_From_Polar( &b, radius, next ); + b.x += center->x; + b.y += center->y; + + /* compute first and second control points */ + length = FT_MulDiv( radius, FT_Sin(theta)*4, + (0x10000L + FT_Cos(theta))*3 ); + + FT_Vector_From_Polar( &a2, length, angle + rotate ); + a2.x += a.x; + a2.y += a.y; + + FT_Vector_From_Polar( &b2, length, next - rotate ); + b2.x += b.x; + b2.y += b.y; + + /* add cubic arc */ + error = ft_stroke_border_cubicto( border, &a2, &b2, &b ); + if (error) break; + + /* process the rest of the arc ?? */ + a = b; + total -= step; + angle = next; + } + return error; + } + + + static FT_Error + ft_stroke_border_moveto( FT_StrokeBorder border, + FT_Vector* to ) + { + /* close current open path if any ? */ + if ( border->start >= 0 ) + ft_stroke_border_close( border ); + + border->start = border->num_points; + border->movable = 0; + + return ft_stroke_border_lineto( border, to, 0 ); + } + + + static void + ft_stroke_border_init( FT_StrokeBorder border, + FT_Memory memory ) + { + border->memory = memory; + border->points = NULL; + border->tags = NULL; + + border->num_points = 0; + border->max_points = 0; + border->start = -1; + } + + + static void + ft_stroke_border_reset( FT_StrokeBorder border ) + { + border->num_points = 0; + border->start = -1; + } + + + static void + ft_stroke_border_done( FT_StrokeBorder border ) + { + FT_Memory memory = border->memory; + + FT_FREE( border->points ); + FT_FREE( border->tags ); + + border->num_points = 0; + border->max_points = 0; + border->start = -1; + } + + + static FT_Error + ft_stroke_border_get_counts( FT_StrokeBorder border, + FT_UInt *anum_points, + FT_UInt *anum_contours ) + { + FT_Error error = 0; + FT_UInt num_points = 0; + FT_UInt num_contours = 0; + + FT_UInt count = border->num_points; + FT_Vector* point = border->points; + FT_Byte* tags = border->tags; + FT_Int in_contour = 0; + + for ( ; count > 0; count--, num_points++, point++, tags++ ) + { + if ( tags[0] & FT_STROKE_TAG_BEGIN ) + { + if ( in_contour != 0 ) + goto Fail; + + in_contour = 1; + } + else if ( in_contour == 0 ) + goto Fail; + + if ( tags[0] & FT_STROKE_TAG_END ) + { + if ( in_contour == 0 ) + goto Fail; + + in_contour = 0; + num_contours++; + } + } + if ( in_contour != 0 ) + goto Fail; + + Exit: + *anum_points = num_points; + *anum_contours = num_contours; + return error; + + Fail: + num_points = 0; + num_contours = 0; + goto Exit; + } + + + static void + ft_stroke_border_export( FT_StrokeBorder border, + FT_Outline* outline ) + { + /* copy point locations */ + FT_MEM_COPY( outline->points + outline->n_points, + border->points, + border->num_points * sizeof(FT_Vector) ); + + /* copy tags */ + { + FT_UInt count = border->num_points; + FT_Byte* read = border->tags; + FT_Byte* write = (FT_Byte*) outline->tags + outline->n_points; + + for ( ; count > 0; count--, read++, write++ ) + { + if ( *read & FT_STROKE_TAG_ON ) + *write = FT_CURVE_TAG_ON; + else if ( *read & FT_STROKE_TAG_CUBIC ) + *write = FT_CURVE_TAG_CUBIC; + else + *write = FT_CURVE_TAG_CONIC; + } + } + + /* copy contours */ + { + FT_UInt count = border->num_points; + FT_Byte* tags = border->tags; + FT_Short* write = outline->contours + outline->n_contours; + FT_Short index = (FT_Short) outline->n_points; + + for ( ; count > 0; count--, tags++, index++ ) + { + if ( *tags & FT_STROKE_TAG_END ) + { + *write++ = index; + outline->n_contours++; + } + } + } + + outline->n_points = (short)( outline->n_points + border->num_points ); + + FT_ASSERT( FT_Outline_Check( outline ) == 0 ); + } + + + /***************************************************************************/ + /***************************************************************************/ + /***** *****/ + /***** STROKER *****/ + /***** *****/ + /***************************************************************************/ + /***************************************************************************/ + +#define FT_SIDE_TO_ROTATE(s) (FT_ANGLE_PI2 - (s)*FT_ANGLE_PI) + + typedef struct FT_StrokerRec_ + { + FT_Angle angle_in; + FT_Angle angle_out; + FT_Vector center; + FT_Bool first_point; + FT_Bool subpath_open; + FT_Angle subpath_angle; + FT_Vector subpath_start; + + FT_Stroker_LineCap line_cap; + FT_Stroker_LineJoin line_join; + FT_Fixed miter_limit; + FT_Fixed radius; + + FT_Bool valid; + FT_StrokeBorderRec borders[2]; + FT_Memory memory; + + } FT_StrokerRec; + + + FT_EXPORT_DEF( FT_Error ) + FT_Stroker_New( FT_Memory memory, + FT_Stroker *astroker ) + { + FT_Error error; + FT_Stroker stroker; + + if ( !FT_NEW( stroker ) ) + { + stroker->memory = memory; + + ft_stroke_border_init( &stroker->borders[0], memory ); + ft_stroke_border_init( &stroker->borders[1], memory ); + } + *astroker = stroker; + return error; + } + + + FT_EXPORT_DEF( void ) + FT_Stroker_Set( FT_Stroker stroker, + FT_Fixed radius, + FT_Stroker_LineCap line_cap, + FT_Stroker_LineJoin line_join, + FT_Fixed miter_limit ) + { + stroker->radius = radius; + stroker->line_cap = line_cap; + stroker->line_join = line_join; + stroker->miter_limit = miter_limit; + + stroker->valid = 0; + + ft_stroke_border_reset( &stroker->borders[0] ); + ft_stroke_border_reset( &stroker->borders[1] ); + } + + + FT_EXPORT_DEF( void ) + FT_Stroker_Done( FT_Stroker stroker ) + { + if ( stroker ) + { + FT_Memory memory = stroker->memory; + + ft_stroke_border_done( &stroker->borders[0] ); + ft_stroke_border_done( &stroker->borders[1] ); + + stroker->memory = NULL; + FT_FREE( stroker ); + } + } + + + + /* creates a circular arc at a corner or cap */ + static FT_Error + ft_stroker_arcto( FT_Stroker stroker, + FT_Int side ) + { + FT_Angle total, rotate; + FT_Fixed radius = stroker->radius; + FT_Error error = 0; + FT_StrokeBorder border = stroker->borders + side; + + rotate = FT_SIDE_TO_ROTATE(side); + + total = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ); + if (total == FT_ANGLE_PI) + total = -rotate*2; + + error = ft_stroke_border_arcto( border, + &stroker->center, + radius, + stroker->angle_in + rotate, + total ); + border->movable = 0; + return error; + } + + + /* adds a cap at the end of an opened path */ + static FT_Error + ft_stroker_cap( FT_Stroker stroker, + FT_Angle angle, + FT_Int side ) + { + FT_Error error = 0; + + if ( stroker->line_cap == FT_STROKER_LINECAP_ROUND ) + { + /* add a round cap */ + stroker->angle_in = angle; + stroker->angle_out = angle + FT_ANGLE_PI; + error = ft_stroker_arcto( stroker, side ); + } + else if ( stroker->line_cap == FT_STROKER_LINECAP_SQUARE ) + { + /* add a square cap */ + FT_Vector delta, delta2; + FT_Angle rotate = FT_SIDE_TO_ROTATE(side); + FT_Fixed radius = stroker->radius; + FT_StrokeBorder border = stroker->borders + side; + + FT_Vector_From_Polar( &delta2, radius, angle+rotate ); + FT_Vector_From_Polar( &delta, radius, angle ); + + delta.x += stroker->center.x + delta2.x; + delta.y += stroker->center.y + delta2.y; + + error = ft_stroke_border_lineto( border, &delta, 0 ); + if (error) goto Exit; + + FT_Vector_From_Polar( &delta2, radius, angle-rotate ); + FT_Vector_From_Polar( &delta, radius, angle ); + + delta.x += delta2.x + stroker->center.x; + delta.y += delta2.y + stroker->center.y; + + error = ft_stroke_border_lineto( border, &delta, 0 ); + } + Exit: + return error; + } + + + + /* process an inside corner, i.e. compute intersection */ + static FT_Error + ft_stroker_inside( FT_Stroker stroker, + FT_Int side) + { + FT_StrokeBorder border = stroker->borders + side; + FT_Angle phi, theta, rotate; + FT_Fixed length, thcos, sigma; + FT_Vector delta; + FT_Error error = 0; + + + rotate = FT_SIDE_TO_ROTATE(side); + + /* compute median angle */ + theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ); + if ( theta == FT_ANGLE_PI ) + theta = rotate; + else + theta = theta/2; + + phi = stroker->angle_in + theta; + + thcos = FT_Cos( theta ); + sigma = FT_MulFix( stroker->miter_limit, thcos ); + + if ( sigma < 0x10000L ) + { + FT_Vector_From_Polar( &delta, stroker->radius, stroker->angle_out + rotate ); + delta.x += stroker->center.x; + delta.y += stroker->center.y; + border->movable = 0; + } + else + { + length = FT_DivFix( stroker->radius, thcos ); + + FT_Vector_From_Polar( &delta, length, phi + rotate ); + delta.x += stroker->center.x; + delta.y += stroker->center.y; + } + + error = ft_stroke_border_lineto( border, &delta, 0 ); + + return error; + } + + + /* process an outside corner, i.e. compute bevel/miter/round */ + static FT_Error + ft_stroker_outside( FT_Stroker stroker, + FT_Int side ) + { + FT_StrokeBorder border = stroker->borders + side; + FT_Error error; + FT_Angle rotate; + + if ( stroker->line_join == FT_STROKER_LINEJOIN_ROUND ) + { + error = ft_stroker_arcto( stroker, side ); + } + else + { + /* this is a mitered or beveled corner */ + FT_Fixed sigma, radius = stroker->radius; + FT_Angle theta, phi; + FT_Fixed thcos; + FT_Bool miter; + + rotate = FT_SIDE_TO_ROTATE(side); + miter = FT_BOOL( stroker->line_join == FT_STROKER_LINEJOIN_MITER ); + + theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ); + if (theta == FT_ANGLE_PI) + { + theta = rotate; + phi = stroker->angle_in; + } + else + { + theta = theta/2; + phi = stroker->angle_in + theta + rotate; + } + + thcos = FT_Cos( theta ); + sigma = FT_MulFix( stroker->miter_limit, thcos ); + + if ( sigma >= 0x10000L ) + miter = 0; + + + if (miter) /* this is a miter (broken angle) */ + { + FT_Vector middle, delta; + FT_Fixed length; + + /* compute middle point */ + FT_Vector_From_Polar( &middle, FT_MulFix( radius, stroker->miter_limit ), + phi ); + middle.x += stroker->center.x; + middle.y += stroker->center.y; + + /* compute first angle point */ + length = FT_MulFix( radius, FT_DivFix( 0x10000L - sigma, + ft_pos_abs( FT_Sin( theta ) ) ) ); + + FT_Vector_From_Polar( &delta, length, phi + rotate ); + delta.x += middle.x; + delta.y += middle.y; + + error = ft_stroke_border_lineto( border, &delta, 0 ); + if (error) goto Exit; + + /* compute second angle point */ + FT_Vector_From_Polar( &delta, length, phi - rotate ); + delta.x += middle.x; + delta.y += middle.y; + + error = ft_stroke_border_lineto( border, &delta, 0 ); + if (error) goto Exit; + + /* finally, add a movable end point */ + FT_Vector_From_Polar( &delta, radius, stroker->angle_out + rotate ); + delta.x += stroker->center.x; + delta.y += stroker->center.y; + + error = ft_stroke_border_lineto( border, &delta, 1 ); + } + else /* this is a bevel (intersection) */ + { + FT_Fixed length; + FT_Vector delta; + + length = FT_DivFix( stroker->radius, thcos ); + + FT_Vector_From_Polar( &delta, length, phi ); + delta.x += stroker->center.x; + delta.y += stroker->center.y; + + error = ft_stroke_border_lineto( border, &delta, 0 ); + if (error) goto Exit; + + /* now add end point */ + FT_Vector_From_Polar( &delta, stroker->radius, stroker->angle_out + rotate ); + delta.x += stroker->center.x; + delta.y += stroker->center.y; + + error = ft_stroke_border_lineto( border, &delta, 1 ); + } + } + Exit: + return error; + } + + + static FT_Error + ft_stroker_process_corner( FT_Stroker stroker ) + { + FT_Error error = 0; + FT_Angle turn; + FT_Int inside_side; + + turn = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ); + + /* no specific corner processing is required if the turn is 0 */ + if (turn == 0) + goto Exit; + + /* when we turn to the right, the inside side is 0 */ + inside_side = 0; + + /* otherwise, the inside side is 1 */ + if (turn < 0) + inside_side = 1; + + /* process the inside side */ + error = ft_stroker_inside( stroker, inside_side ); + if (error) goto Exit; + + /* process the outside side */ + error = ft_stroker_outside( stroker, 1-inside_side ); + + Exit: + return error; + } + + + /* add two points to the left and right borders corresponding to the */ + /* start of the subpath.. */ + static FT_Error + ft_stroker_subpath_start( FT_Stroker stroker, + FT_Angle start_angle ) + { + FT_Vector delta; + FT_Vector point; + FT_Error error; + FT_StrokeBorder border; + + FT_Vector_From_Polar( &delta, stroker->radius, start_angle + FT_ANGLE_PI2 ); + + point.x = stroker->center.x + delta.x; + point.y = stroker->center.y + delta.y; + + border = stroker->borders; + error = ft_stroke_border_moveto( border, &point ); + if (error) goto Exit; + + point.x = stroker->center.x - delta.x; + point.y = stroker->center.y - delta.y; + + border++; + error = ft_stroke_border_moveto( border, &point ); + + /* save angle for last cap */ + stroker->subpath_angle = start_angle; + stroker->first_point = 0; + + Exit: + return error; + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Stroker_LineTo( FT_Stroker stroker, + FT_Vector* to ) + { + FT_Error error = 0; + FT_StrokeBorder border; + FT_Vector delta; + FT_Angle angle; + FT_Int side; + + delta.x = to->x - stroker->center.x; + delta.y = to->y - stroker->center.y; + + angle = FT_Atan2( delta.x, delta.y ); + FT_Vector_From_Polar( &delta, stroker->radius, angle + FT_ANGLE_PI2 ); + + /* process corner if necessary */ + if ( stroker->first_point ) + { + /* this is the first segment of a subpath. We need to */ + /* add a point to each border at their respective starting */ + /* point locations.. */ + error = ft_stroker_subpath_start( stroker, angle ); + if (error) goto Exit; + } + else + { + /* process the current corner */ + stroker->angle_out = angle; + error = ft_stroker_process_corner( stroker ); + if (error) goto Exit; + } + + /* now add a line segment to both the "inside" and "outside" paths */ + + for ( border = stroker->borders, side = 1; side >= 0; side--, border++ ) + { + FT_Vector point; + + point.x = to->x + delta.x; + point.y = to->y + delta.y; + + error = ft_stroke_border_lineto( border, &point, 1 ); + if (error) goto Exit; + + delta.x = -delta.x; + delta.y = -delta.y; + } + + stroker->angle_in = angle; + stroker->center = *to; + + Exit: + return error; + } + + + + FT_EXPORT_DEF( FT_Error ) + FT_Stroker_ConicTo( FT_Stroker stroker, + FT_Vector* control, + FT_Vector* to ) + { + FT_Error error = 0; + FT_Vector bez_stack[34]; + FT_Vector* arc; + FT_Vector* limit = bez_stack + 30; + FT_Angle start_angle; + FT_Bool first_arc = 1; + + arc = bez_stack; + arc[0] = *to; + arc[1] = *control; + arc[2] = stroker->center; + + while ( arc >= bez_stack ) + { + FT_Angle angle_in, angle_out; + + angle_in = angle_out = 0; /* remove compiler warnings */ + + if ( arc < limit && + !ft_conic_is_small_enough( arc, &angle_in, &angle_out ) ) + { + ft_conic_split( arc ); + arc += 2; + continue; + } + + if ( first_arc ) + { + first_arc = 0; + + start_angle = angle_in; + + /* process corner if necessary */ + if ( stroker->first_point ) + error = ft_stroker_subpath_start( stroker, start_angle ); + else + { + stroker->angle_out = start_angle; + error = ft_stroker_process_corner( stroker ); + } + } + + /* the arc's angle is small enough, we can add it directly to each */ + /* border.. */ + { + FT_Vector ctrl, end; + FT_Angle theta, phi, rotate; + FT_Fixed length; + FT_Int side; + + theta = FT_Angle_Diff( angle_in, angle_out )/2; + phi = angle_in + theta; + length = FT_DivFix( stroker->radius, FT_Cos(theta) ); + + for ( side = 0; side <= 1; side++ ) + { + rotate = FT_SIDE_TO_ROTATE(side); + + /* compute control point */ + FT_Vector_From_Polar( &ctrl, length, phi + rotate ); + ctrl.x += arc[1].x; + ctrl.y += arc[1].y; + + /* compute end point */ + FT_Vector_From_Polar( &end, stroker->radius, angle_out + rotate ); + end.x += arc[0].x; + end.y += arc[0].y; + + error = ft_stroke_border_conicto( stroker->borders + side, &ctrl, &end ); + if (error) goto Exit; + } + } + + arc -= 2; + + if (arc < bez_stack) + stroker->angle_in = angle_out; + } + + stroker->center = *to; + + Exit: + return error; + } + + + + FT_EXPORT_DEF( FT_Error ) + FT_Stroker_CubicTo( FT_Stroker stroker, + FT_Vector* control1, + FT_Vector* control2, + FT_Vector* to ) + { + FT_Error error = 0; + FT_Vector bez_stack[37]; + FT_Vector* arc; + FT_Vector* limit = bez_stack + 32; + FT_Angle start_angle; + FT_Bool first_arc = 1; + + arc = bez_stack; + arc[0] = *to; + arc[1] = *control2; + arc[2] = *control1; + arc[3] = stroker->center; + + while ( arc >= bez_stack ) + { + FT_Angle angle_in, angle_mid, angle_out; + + /* remove compiler warnings */ + angle_in = angle_out = angle_mid = 0; + + if ( arc < limit && + !ft_cubic_is_small_enough( arc, &angle_in, &angle_mid, &angle_out ) ) + { + ft_cubic_split( arc ); + arc += 3; + continue; + } + + if ( first_arc ) + { + first_arc = 0; + + /* process corner if necessary */ + start_angle = angle_in; + + if ( stroker->first_point ) + error = ft_stroker_subpath_start( stroker, start_angle ); + else + { + stroker->angle_out = start_angle; + error = ft_stroker_process_corner( stroker ); + } + if (error) goto Exit; + } + + /* the arc's angle is small enough, we can add it directly to each */ + /* border.. */ + { + FT_Vector ctrl1, ctrl2, end; + FT_Angle theta1, phi1, theta2, phi2, rotate; + FT_Fixed length1, length2; + FT_Int side; + + theta1 = ft_pos_abs( angle_mid - angle_in )/2; + theta2 = ft_pos_abs( angle_out - angle_mid )/2; + phi1 = (angle_mid+angle_in)/2; + phi2 = (angle_mid+angle_out)/2; + length1 = FT_DivFix( stroker->radius, FT_Cos(theta1) ); + length2 = FT_DivFix( stroker->radius, FT_Cos(theta2) ); + + for ( side = 0; side <= 1; side++ ) + { + rotate = FT_SIDE_TO_ROTATE(side); + + /* compute control points */ + FT_Vector_From_Polar( &ctrl1, length1, phi1 + rotate ); + ctrl1.x += arc[2].x; + ctrl1.y += arc[2].y; + + FT_Vector_From_Polar( &ctrl2, length2, phi2 + rotate ); + ctrl2.x += arc[1].x; + ctrl2.y += arc[1].y; + + /* compute end point */ + FT_Vector_From_Polar( &end, stroker->radius, angle_out + rotate ); + end.x += arc[0].x; + end.y += arc[0].y; + + error = ft_stroke_border_cubicto( stroker->borders + side, &ctrl1, &ctrl2, &end ); + if (error) goto Exit; + } + } + + arc -= 3; + if (arc < bez_stack) + stroker->angle_in = angle_out; + } + + stroker->center = *to; + + Exit: + return error; + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Stroker_BeginSubPath( FT_Stroker stroker, + FT_Vector* to, + FT_Bool open ) + { + /* we cannot process the first point, because there is not enough */ + /* information regarding its corner/cap. The latter will be processed */ + /* in the "end_subpath" routine */ + /* */ + stroker->first_point = 1; + stroker->center = *to; + stroker->subpath_open = open; + + /* record the subpath start point index for each border */ + stroker->subpath_start = *to; + return 0; + } + + + static + FT_Error ft_stroker_add_reverse_left( FT_Stroker stroker, + FT_Bool open ) + { + FT_StrokeBorder right = stroker->borders + 0; + FT_StrokeBorder left = stroker->borders + 1; + FT_Int new_points; + FT_Error error = 0; + + FT_ASSERT( left->start >= 0 ); + + new_points = left->num_points - left->start; + if ( new_points > 0 ) + { + error = ft_stroke_border_grow( right, (FT_UInt)new_points ); + if (error) goto Exit; + { + FT_Vector* dst_point = right->points + right->num_points; + FT_Byte* dst_tag = right->tags + right->num_points; + FT_Vector* src_point = left->points + left->num_points - 1; + FT_Byte* src_tag = left->tags + left->num_points - 1; + + while ( src_point >= left->points + left->start ) + { + *dst_point = *src_point; + *dst_tag = *src_tag; + + if (open) + dst_tag[0] &= ~(FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END); + else + { + /* switch begin/end tags if necessary.. */ + if (dst_tag[0] & (FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END)) + dst_tag[0] ^= (FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END); + } + + src_point--; + src_tag--; + dst_point++; + dst_tag++; + } + } + left->num_points = left->start; + right->num_points += new_points; + + right->movable = 0; + left->movable = 0; + } + Exit: + return error; + } + + + /* there's a lot of magic in this function !! */ + FT_EXPORT_DEF( FT_Error ) + FT_Stroker_EndSubPath( FT_Stroker stroker ) + { + FT_Error error = 0; + + if ( stroker->subpath_open ) + { + FT_StrokeBorder right = stroker->borders; + + /* all right, this is an opened path, we need to add a cap between */ + /* right & left, add the reverse of left, then add a final cap between */ + /* left & right.. */ + error = ft_stroker_cap( stroker, stroker->angle_in, 0 ); + if (error) goto Exit; + + /* add reversed points from "left" to "right" */ + error = ft_stroker_add_reverse_left( stroker, 1 ); + if (error) goto Exit; + + /* now add the final cap */ + stroker->center = stroker->subpath_start; + error = ft_stroker_cap( stroker, stroker->subpath_angle+FT_ANGLE_PI, 0 ); + if (error) goto Exit; + + /* now, end the right subpath accordingly. the left one is */ + /* rewind and doesn't need further processing.. */ + ft_stroke_border_close( right ); + } + else + { + FT_Angle turn; + FT_Int inside_side; + + /* process the corner ... */ + stroker->angle_out = stroker->subpath_angle; + turn = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ); + + /* no specific corner processing is required if the turn is 0 */ + if (turn != 0) + { + /* when we turn to the right, the inside side is 0 */ + inside_side = 0; + + /* otherwise, the inside side is 1 */ + if (turn < 0) + inside_side = 1; + + /* IMPORTANT: WE DO NOT PROCESS THE INSIDE BORDER HERE !! */ + /* process the inside side */ + /* error = ft_stroker_inside( stroker, inside_side ); + if (error) goto Exit; */ + + /* process the outside side */ + error = ft_stroker_outside( stroker, 1-inside_side ); + if (error) goto Exit; + } + + /* we will first end our two subpaths */ + ft_stroke_border_close( stroker->borders + 0 ); + ft_stroke_border_close( stroker->borders + 1 ); + + /* now, add the reversed left subpath to "right" */ + error = ft_stroker_add_reverse_left( stroker, 0 ); + if (error) goto Exit; + } + + Exit: + return error; + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Stroker_GetCounts( FT_Stroker stroker, + FT_UInt *anum_points, + FT_UInt *anum_contours ) + { + FT_UInt count1, count2, num_points = 0; + FT_UInt count3, count4, num_contours = 0; + FT_Error error; + + error = ft_stroke_border_get_counts( stroker->borders+0, &count1, &count2 ); + if (error) goto Exit; + + error = ft_stroke_border_get_counts( stroker->borders+1, &count3, &count4 ); + if (error) goto Exit; + + num_points = count1 + count3; + num_contours = count2 + count4; + + stroker->valid = 1; + + Exit: + *anum_points = num_points; + *anum_contours = num_contours; + return error; + } + + + FT_EXPORT_DEF( void ) + FT_Stroker_Export( FT_Stroker stroker, + FT_Outline* outline ) + { + if ( stroker->valid ) + { + ft_stroke_border_export( stroker->borders+0, outline ); + ft_stroke_border_export( stroker->borders+1, outline ); + } + } + + + + + + /* + * the following is very similar to FT_Outline_Decompose, except + * that we do support opened paths, and do not scale the outline + */ + FT_EXPORT_DEF( FT_Error ) + FT_Stroker_ParseOutline( FT_Stroker stroker, + FT_Outline* outline, + FT_Bool opened ) + { + FT_Vector v_last; + FT_Vector v_control; + FT_Vector v_start; + + FT_Vector* point; + FT_Vector* limit; + char* tags; + + FT_Error error; + + FT_Int n; /* index of contour in outline */ + FT_UInt first; /* index of first point in contour */ + FT_Int tag; /* current point's state */ + + if ( !outline || !stroker ) + return FT_Err_Invalid_Argument; + + first = 0; + + for ( n = 0; n < outline->n_contours; n++ ) + { + FT_Int last; /* index of last point in contour */ + + + last = outline->contours[n]; + limit = outline->points + last; + + v_start = outline->points[first]; + v_last = outline->points[last]; + + v_control = v_start; + + point = outline->points + first; + tags = outline->tags + first; + tag = FT_CURVE_TAG( tags[0] ); + + /* A contour cannot start with a cubic control point! */ + if ( tag == FT_CURVE_TAG_CUBIC ) + goto Invalid_Outline; + + /* check first point to determine origin */ + if ( tag == FT_CURVE_TAG_CONIC ) + { + /* first point is conic control. Yes, this happens. */ + if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON ) + { + /* start at last point if it is on the curve */ + v_start = v_last; + limit--; + } + else + { + /* if both first and last points are conic, */ + /* start at their middle and record its position */ + /* for closure */ + v_start.x = ( v_start.x + v_last.x ) / 2; + v_start.y = ( v_start.y + v_last.y ) / 2; + + v_last = v_start; + } + point--; + tags--; + } + + error = FT_Stroker_BeginSubPath( stroker, &v_start, opened ); + if ( error ) + goto Exit; + + while ( point < limit ) + { + point++; + tags++; + + tag = FT_CURVE_TAG( tags[0] ); + switch ( tag ) + { + case FT_CURVE_TAG_ON: /* emit a single line_to */ + { + FT_Vector vec; + + + vec.x = point->x; + vec.y = point->y; + + error = FT_Stroker_LineTo( stroker, &vec ); + if ( error ) + goto Exit; + continue; + } + + case FT_CURVE_TAG_CONIC: /* consume conic arcs */ + v_control.x = point->x; + v_control.y = point->y; + + Do_Conic: + if ( point < limit ) + { + FT_Vector vec; + FT_Vector v_middle; + + + point++; + tags++; + tag = FT_CURVE_TAG( tags[0] ); + + vec = point[0]; + + if ( tag == FT_CURVE_TAG_ON ) + { + error = FT_Stroker_ConicTo( stroker, &v_control, &vec ); + if ( error ) + goto Exit; + continue; + } + + if ( tag != FT_CURVE_TAG_CONIC ) + goto Invalid_Outline; + + v_middle.x = ( v_control.x + vec.x ) / 2; + v_middle.y = ( v_control.y + vec.y ) / 2; + + error = FT_Stroker_ConicTo( stroker, &v_control, &v_middle ); + if ( error ) + goto Exit; + + v_control = vec; + goto Do_Conic; + } + + error = FT_Stroker_ConicTo( stroker, &v_control, &v_start ); + goto Close; + + default: /* FT_CURVE_TAG_CUBIC */ + { + FT_Vector vec1, vec2; + + + if ( point + 1 > limit || + FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) + goto Invalid_Outline; + + point += 2; + tags += 2; + + vec1 = point[-2]; + vec2 = point[-1]; + + if ( point <= limit ) + { + FT_Vector vec; + + + vec = point[0]; + + error = FT_Stroker_CubicTo( stroker, &vec1, &vec2, &vec ); + if ( error ) + goto Exit; + continue; + } + + error = FT_Stroker_CubicTo( stroker, &vec1, &vec2, &v_start ); + goto Close; + } + } + } + + Close: + if ( error ) + goto Exit; + + error = FT_Stroker_EndSubPath( stroker ); + if ( error ) + goto Exit; + + first = last + 1; + } + + return 0; + + Exit: + return error; + + Invalid_Outline: + return FT_Err_Invalid_Outline; + } Index: xc/extras/freetype2/src/base/ftsynth.c diff -u xc/extras/freetype2/src/base/ftsynth.c:1.4 xc/extras/freetype2/src/base/ftsynth.c:1.5 --- xc/extras/freetype2/src/base/ftsynth.c:1.4 Mon Jan 14 12:00:59 2002 +++ xc/extras/freetype2/src/base/ftsynth.c Wed May 28 22:13:03 2003 @@ -20,6 +20,7 @@ #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_CALC_H #include FT_OUTLINE_H +#include FT_TRIGONOMETRY_H #include FT_SYNTHESIS_H @@ -34,18 +35,18 @@ /*************************************************************************/ /*************************************************************************/ - FT_EXPORT_DEF( FT_Error ) - FT_Outline_Oblique( FT_GlyphSlot original, - FT_Outline* outline, - FT_Pos* advance ) + FT_EXPORT_DEF( void ) + FT_GlyphSlot_Oblique( FT_GlyphSlot slot ) { - FT_Matrix transform; + FT_Matrix transform; + FT_Outline* outline = &slot->outline; - FT_UNUSED( original ); - /* we don't touch the advance width */ - FT_UNUSED( advance ); + /* only oblique outline glyphs */ + if ( slot->format != FT_GLYPH_FORMAT_OUTLINE ) + return; + /* we don't touch the advance width */ /* For italic, simply apply a shear transform, with an angle */ /* of about 12 degrees. */ @@ -57,8 +58,6 @@ transform.yy = 0x10000L; FT_Outline_Transform( outline, &transform ); - - return 0; } @@ -71,97 +70,6 @@ /*************************************************************************/ - /* Compute the norm of a vector */ - -#ifdef FT_CONFIG_OPTION_OLD_CALCS - - static FT_Pos - ft_norm( FT_Vector* vec ) - { - FT_Int64 t1, t2; - - - MUL_64( vec->x, vec->x, t1 ); - MUL_64( vec->y, vec->y, t2 ); - ADD_64( t1, t2, t1 ); - - return (FT_Pos)SQRT_64( t1 ); - } - -#else /* FT_CONFIG_OPTION_OLD_CALCS */ - - static FT_Pos - ft_norm( FT_Vector* vec ) - { - FT_F26Dot6 u, v, d; - FT_Int shift; - FT_ULong H, L, L2, hi, lo, med; - - - u = vec->x; if ( u < 0 ) u = -u; - v = vec->y; if ( v < 0 ) v = -v; - - if ( u < v ) - { - d = u; - u = v; - v = d; - } - - /* check that we are not trying to normalize zero! */ - if ( u == 0 ) - return 0; - - /* compute (u*u + v*v) on 64 bits with two 32-bit registers [H:L] */ - hi = (FT_ULong)u >> 16; - lo = (FT_ULong)u & 0xFFFF; - med = hi * lo; - - H = hi * hi + ( med >> 15 ); - med <<= 17; - L = lo * lo + med; - if ( L < med ) - H++; - - hi = (FT_ULong)v >> 16; - lo = (FT_ULong)v & 0xFFFF; - med = hi * lo; - - H += hi * hi + ( med >> 15 ); - med <<= 17; - L2 = lo * lo + med; - if ( L2 < med ) - H++; - - L += L2; - if ( L < L2 ) - H++; - - /* if the value is smaller than 32 bits */ - shift = 0; - if ( H == 0 ) - { - while ( ( L & 0xC0000000UL ) == 0 ) - { - L <<= 2; - shift++; - } - return ( FT_Sqrt32( L ) >> shift ); - } - else - { - while ( H ) - { - L = ( L >> 2 ) | ( H << 30 ); - H >>= 2; - shift++; - } - return ( FT_Sqrt32( L ) << shift ); - } - } - -#endif /* FT_CONFIG_OPTION_OLD_CALCS */ - static int ft_test_extrema( FT_Outline* outline, @@ -208,7 +116,7 @@ /* Compute the orientation of path filling. It differs between TrueType */ - /* and Type1 formats. We could use the `ft_outline_reverse_fill' flag, */ + /* and Type1 formats. We could use the `FT_OUTLINE_REVERSE_FILL' flag, */ /* but it is better to re-compute it directly (it seems that this flag */ /* isn't correctly set for some weird composite glyphs currently). */ /* */ @@ -291,28 +199,30 @@ } - FT_EXPORT_DEF( FT_Error ) - FT_Outline_Embolden( FT_GlyphSlot original, - FT_Outline* outline, - FT_Pos* advance ) + FT_EXPORT_DEF( void ) + FT_GlyphSlot_Embolden( FT_GlyphSlot slot ) { - FT_Vector u, v; - FT_Vector* points; - FT_Vector cur, prev, next; - FT_Pos distance; - FT_Face face = FT_SLOT_FACE( original ); - int c, n, first, orientation; + FT_Vector* points; + FT_Vector v_prev, v_first, v_next, v_cur; + FT_Pos distance; + FT_Outline* outline = &slot->outline; + FT_Face face = FT_SLOT_FACE( slot ); + FT_Angle rotate, angle_in, angle_out; + FT_Int c, n, first, orientation; - FT_UNUSED( advance ); + /* only embolden outline glyph images */ + if ( slot->format != FT_GLYPH_FORMAT_OUTLINE ) + return; /* compute control distance */ distance = FT_MulFix( face->units_per_EM / 60, face->size->metrics.y_scale ); - orientation = ft_get_orientation( &original->outline ); + orientation = ft_get_orientation( outline ); + rotate = FT_ANGLE_PI2*orientation; - points = original->outline.points; + points = outline->points; first = 0; for ( c = 0; c < outline->n_contours; c++ ) @@ -320,79 +230,56 @@ int last = outline->contours[c]; - prev = points[last]; + v_first = points[first]; + v_prev = points[last]; + v_cur = v_first; for ( n = first; n <= last; n++ ) { - FT_Pos norm, delta, d; + FT_Pos d; FT_Vector in, out; + FT_Fixed scale; + FT_Angle angle_diff; - cur = points[n]; - if ( n < last ) next = points[n + 1]; - else next = points[first]; + if ( n < last ) v_next = points[n + 1]; + else v_next = v_first; /* compute the in and out vectors */ - in.x = cur.x - prev.x; - in.y = cur.y - prev.y; + in.x = v_cur.x - v_prev.x; + in.y = v_cur.y - v_prev.y; - out.x = next.x - cur.x; - out.y = next.y - cur.y; + out.x = v_next.x - v_cur.x; + out.y = v_next.y - v_cur.y; - /* compute U and V */ - norm = ft_norm( &in ); - u.x = orientation * FT_DivFix( in.y, norm ); - u.y = orientation * -FT_DivFix( in.x, norm ); + angle_in = FT_Atan2( in.x, in.y ); + angle_out = FT_Atan2( out.x, out.y ); + angle_diff = FT_Angle_Diff( angle_in, angle_out ); + scale = FT_Cos( angle_diff/2 ); - norm = ft_norm( &out ); - v.x = orientation * FT_DivFix( out.y, norm ); - v.y = orientation * -FT_DivFix( out.x, norm ); - - d = distance; - - if ( ( outline->tags[n] & FT_Curve_Tag_On ) == 0 ) - d *= 2; - - /* Check discriminant for parallel vectors */ - delta = FT_MulFix( u.x, v.y ) - FT_MulFix( u.y, v.x ); - if ( delta > FT_BOLD_THRESHOLD || delta < -FT_BOLD_THRESHOLD ) + if ( scale < 0x400L && scale > -0x400L ) { - /* Move point -- compute A and B */ - FT_Pos x, y, A, B; - - - A = d + FT_MulFix( cur.x, u.x ) + FT_MulFix( cur.y, u.y ); - B = d + FT_MulFix( cur.x, v.x ) + FT_MulFix( cur.y, v.y ); - - x = FT_MulFix( A, v.y ) - FT_MulFix( B, u.y ); - y = FT_MulFix( B, u.x ) - FT_MulFix( A, v.x ); - - outline->points[n].x = distance + FT_DivFix( x, delta ); - outline->points[n].y = distance + FT_DivFix( y, delta ); + if ( scale >= 0 ) + scale = 0x400L; + else + scale = -0x400L; } - else - { - /* Vectors are nearly parallel */ - FT_Pos x, y; + d = FT_DivFix( distance, scale ); - x = distance + cur.x + FT_MulFix( d, u.x + v.x ) / 2; - y = distance + cur.y + FT_MulFix( d, u.y + v.y ) / 2; + FT_Vector_From_Polar( &in, d, angle_in + angle_diff/2 - rotate ); - outline->points[n].x = x; - outline->points[n].y = y; - } + outline->points[n].x = v_cur.x + distance + in.x; + outline->points[n].y = v_cur.y + distance + in.y; - prev = cur; + v_prev = v_cur; + v_cur = v_next; } first = last + 1; } - if ( advance ) - *advance = ( *advance + distance * 4 ) & -64; - - return 0; + slot->metrics.horiAdvance = ( slot->metrics.horiAdvance + distance*4 ) & -64; } Index: xc/extras/freetype2/src/base/fttrigon.c diff -u xc/extras/freetype2/src/base/fttrigon.c:1.1.1.4 xc/extras/freetype2/src/base/fttrigon.c:1.1.1.5 --- xc/extras/freetype2/src/base/fttrigon.c:1.1.1.4 Thu Jun 20 04:16:14 2002 +++ xc/extras/freetype2/src/base/fttrigon.c Wed May 28 22:01:49 2003 @@ -451,4 +451,37 @@ } + /* documentation is in fttrigon.h */ + + FT_EXPORT_DEF( void ) + FT_Vector_From_Polar( FT_Vector* vec, + FT_Fixed length, + FT_Angle angle ) + { + vec->x = length; + vec->y = 0; + + FT_Vector_Rotate( vec, angle ); + } + + + /* documentation is in fttrigon.h */ + + FT_EXPORT_DEF( FT_Angle ) + FT_Angle_Diff( FT_Angle angle1, + FT_Angle angle2 ) + { + FT_Angle delta = angle2 - angle1; + + delta %= FT_ANGLE_2PI; + if ( delta < 0 ) + delta += FT_ANGLE_2PI; + + if ( delta > FT_ANGLE_PI ) + delta -= FT_ANGLE_2PI; + + return delta; + } + + /* END */ Index: xc/extras/freetype2/src/base/fttype1.c diff -u xc/extras/freetype2/src/base/fttype1.c:1.1.1.1 xc/extras/freetype2/src/base/fttype1.c:1.1.1.2 --- xc/extras/freetype2/src/base/fttype1.c:1.1.1.1 Thu Jun 20 04:16:14 2002 +++ xc/extras/freetype2/src/base/fttype1.c Wed May 28 22:01:49 2003 @@ -18,49 +18,35 @@ #include <ft2build.h> #include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_TYPE42_TYPES_H #include FT_INTERNAL_OBJECTS_H - /* Cast a FT_Face to a T1_Face if necessary. */ - /* This implementation sucks, but a lot of things should change in the */ - /* future anyway... */ - /* */ - static T1_Face - t1_face_check_cast( FT_Face face ) - { - FT_Module driver; - T1_Face result = NULL; - - - if ( face && face->driver != NULL ) - { - driver = (FT_Module)face->driver; - - if ( driver->clazz && driver->clazz->module_name && - ft_strcmp( driver->clazz->module_name, "type1" ) == 0 ) - { - /* correct typecast! */ - result = (T1_Face)face; - } - } - return result; - } - - /* documentation is in t1tables.h */ FT_EXPORT_DEF( FT_Error ) FT_Get_PS_Font_Info( FT_Face face, PS_FontInfoRec* afont_info ) { - FT_Error error = FT_Err_Invalid_Argument; - T1_Face t1_face = t1_face_check_cast( face ); + PS_FontInfo font_info = NULL; + FT_Error error = FT_Err_Invalid_Argument; + const char* driver_name; - if ( t1_face != NULL ) + if ( face && face->driver && face->driver->root.clazz ) + { + driver_name = face->driver->root.clazz->module_name; + if ( ft_strcmp( driver_name, "type1" ) == 0 ) + font_info = &((T1_Face)face)->type1.font_info; + else if ( ft_strcmp( driver_name, "t1cid" ) == 0 ) + font_info = &((CID_Face)face)->cid.font_info; + else if ( ft_strcmp( driver_name, "type42" ) == 0 ) + font_info = &((T42_Face)face)->type1.font_info; + } + if ( font_info != NULL ) { - *afont_info = t1_face->type1.font_info; - error = FT_Err_Ok; + *afont_info = *font_info; + error = FT_Err_Ok; } return error; @@ -80,8 +66,8 @@ if ( face && face->driver && face->driver->root.clazz ) { - /* Currently, only the type1 and cff drivers provide reliable */ - /* glyph names... */ + /* Currently, only the type1, type42, and cff drivers provide */ + /* reliable glyph names... */ /* We could probably hack the TrueType driver to recognize */ /* certain cases where the glyph names are most certainly */ @@ -89,8 +75,9 @@ /* this will probably happen later... */ driver_name = face->driver->root.clazz->module_name; - result = ( ft_strcmp( driver_name, "type1" ) == 0 || - ft_strcmp( driver_name, "cff" ) == 0 ); + result = ( ft_strcmp( driver_name, "type1" ) == 0 || + ft_strcmp( driver_name, "type42" ) == 0 || + ft_strcmp( driver_name, "cff" ) == 0 ); } return result; Index: xc/extras/freetype2/src/base/ftutil.c diff -u xc/extras/freetype2/src/base/ftutil.c:1.1.1.1 xc/extras/freetype2/src/base/ftutil.c:1.1.1.2 --- xc/extras/freetype2/src/base/ftutil.c:1.1.1.1 Thu Jun 20 04:16:14 2002 +++ xc/extras/freetype2/src/base/ftutil.c Wed May 28 22:01:49 2003 @@ -64,7 +64,7 @@ return FT_Err_Out_Of_Memory; } - FT_MEM_SET( *P, 0, size ); + FT_MEM_ZERO( *P, size ); } else *P = NULL; @@ -106,7 +106,7 @@ goto Fail; if ( size > current ) - FT_MEM_SET( (char*)Q + current, 0, size - current ); + FT_MEM_ZERO( (char*)Q + current, size - current ); *P = Q; return FT_Err_Ok; Index: xc/extras/freetype2/src/base/ftwinfnt.c diff -u /dev/null xc/extras/freetype2/src/base/ftwinfnt.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:17 2004 +++ xc/extras/freetype2/src/base/ftwinfnt.c Wed May 28 22:01:49 2003 @@ -0,0 +1,55 @@ +/***************************************************************************/ +/* */ +/* ftwinfnt.c */ +/* */ +/* FreeType API for accessing Windows FNT specific info (body). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +#include FT_WINFONTS_H +#include FT_INTERNAL_FNT_TYPES_H +#include FT_INTERNAL_OBJECTS_H + + + FT_EXPORT_DEF( FT_Error ) + FT_Get_WinFNT_Header( FT_Face face, + FT_WinFNT_HeaderRec *header ) + { + FT_Error error; + + error = FT_Err_Invalid_Argument; + + if ( face != NULL && face->driver != NULL ) + { + FT_Module driver = (FT_Module) face->driver; + + + if ( driver->clazz && driver->clazz->module_name && + ft_strcmp( driver->clazz->module_name, "winfonts" ) == 0 ) + { + FNT_Size size = (FNT_Size)face->size; + FNT_Font font = size->font; + + if (font) + { + FT_MEM_COPY( header, &font->header, sizeof(*header) ); + error = 0; + } + } + } + return error; + } + + +/* END */ Index: xc/extras/freetype2/src/base/rules.mk diff -u xc/extras/freetype2/src/base/rules.mk:1.1.1.4 xc/extras/freetype2/src/base/rules.mk:1.1.1.5 --- xc/extras/freetype2/src/base/rules.mk:1.1.1.4 Thu Jun 20 04:16:14 2002 +++ xc/extras/freetype2/src/base/rules.mk Wed May 28 22:01:49 2003 @@ -49,11 +49,14 @@ # object. It will then be linked to the final executable only if one of its # symbols is used by the application. # -BASE_EXT_SRC := $(BASE_)ftglyph.c \ - $(BASE_)ftmm.c \ - $(BASE_)ftbdf.c \ - $(BASE_)fttype1.c \ - $(BASE_)ftxf86.c \ +BASE_EXT_SRC := $(BASE_)ftglyph.c \ + $(BASE_)ftmm.c \ + $(BASE_)ftbdf.c \ + $(BASE_)fttype1.c \ + $(BASE_)ftxf86.c \ + $(BASE_)ftpfr.c \ + $(BASE_)ftstroker.c \ + $(BASE_)ftwinfnt.c \ $(BASE_)ftbbox.c # Default extensions objects Index: xc/extras/freetype2/src/bdf/Jamfile diff -u xc/extras/freetype2/src/bdf/Jamfile:1.1.1.1 xc/extras/freetype2/src/bdf/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/bdf/Jamfile:1.1.1.1 Thu Jun 20 04:16:14 2002 +++ xc/extras/freetype2/src/bdf/Jamfile Wed May 28 22:01:49 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/bdf Jamfile (c) 2002 David Turner # -SubDir FT2_TOP src bdf ; - -SubDirHdrs [ FT2_SubDir src bdf ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) bdf ; { local _sources ; Index: xc/extras/freetype2/src/bdf/bdfdrivr.c diff -u xc/extras/freetype2/src/bdf/bdfdrivr.c:1.1.1.1 xc/extras/freetype2/src/bdf/bdfdrivr.c:1.2 --- xc/extras/freetype2/src/bdf/bdfdrivr.c:1.1.1.1 Thu Jun 20 04:16:14 2002 +++ xc/extras/freetype2/src/bdf/bdfdrivr.c Sun Jun 15 12:45:50 2003 @@ -23,12 +23,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/* $XFree86: xc/extras/freetype2/src/bdf/bdfdrivr.c,v 1.2 2003/06/15 16:45:50 tsi Exp $ */ #include <ft2build.h> #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_OBJECTS_H +#include FT_BDF_H #include "bdf.h" #include "bdfdrivr.h" @@ -46,6 +48,130 @@ #define FT_COMPONENT trace_bdfdriver + typedef struct BDF_CMapRec_ + { + FT_CMapRec cmap; + FT_UInt num_encodings; + BDF_encoding_el* encodings; + + } BDF_CMapRec, *BDF_CMap; + + + FT_CALLBACK_DEF( FT_Error ) + bdf_cmap_init( BDF_CMap cmap ) + { + BDF_Face face = (BDF_Face)FT_CMAP_FACE( cmap ); + + + cmap->num_encodings = face->bdffont->glyphs_used; + cmap->encodings = face->en_table; + + return FT_Err_Ok; + } + + + FT_CALLBACK_DEF( void ) + bdf_cmap_done( BDF_CMap cmap ) + { + cmap->encodings = NULL; + cmap->num_encodings = 0; + } + + + FT_CALLBACK_DEF( FT_UInt ) + bdf_cmap_char_index( BDF_CMap cmap, + FT_UInt32 charcode ) + { + BDF_encoding_el* encodings = cmap->encodings; + FT_UInt min, max, mid; + FT_UInt result = 0; + + + min = 0; + max = cmap->num_encodings; + + while ( min < max ) + { + FT_UInt32 code; + + + mid = ( min + max ) >> 1; + code = encodings[mid].enc; + + if ( charcode == code ) + { + result = encodings[mid].glyph + 1; + break; + } + + if ( charcode < code ) + max = mid; + else + min = mid + 1; + } + + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + bdf_cmap_char_next( BDF_CMap cmap, + FT_UInt32 *acharcode ) + { + BDF_encoding_el* encodings = cmap->encodings; + FT_UInt min, max, mid; + FT_UInt32 charcode = *acharcode + 1; + FT_UInt result = 0; + + + min = 0; + max = cmap->num_encodings; + + while ( min < max ) + { + FT_UInt32 code; + + + mid = ( min + max ) >> 1; + code = encodings[mid].enc; + + if ( charcode == code ) + { + result = encodings[mid].glyph + 1; + goto Exit; + } + + if ( charcode < code ) + max = mid; + else + min = mid + 1; + } + + charcode = 0; + if ( min < cmap->num_encodings ) + { + charcode = encodings[min].enc; + result = encodings[min].glyph + 1; + } + + Exit: + *acharcode = charcode; + return result; + } + + + FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec bdf_cmap_class = + { + sizeof( BDF_CMapRec ), + (FT_CMap_InitFunc) bdf_cmap_init, + (FT_CMap_DoneFunc) bdf_cmap_done, + (FT_CMap_CharIndexFunc)bdf_cmap_char_index, + (FT_CMap_CharNextFunc) bdf_cmap_char_next + }; + + + + FT_CALLBACK_DEF( FT_Error ) BDF_Face_Done( BDF_Face face ) { @@ -182,34 +308,45 @@ if ( FT_NEW_ARRAY( root->available_sizes, 1 ) ) goto Exit; + prop = bdf_get_font_property( font, (char *)"AVERAGE_WIDTH" ); + if ( ( prop != NULL ) && ( prop->value.int32 >= 10 ) ) + root->available_sizes->width = (short)( prop->value.int32 / 10 ); + prop = bdf_get_font_property( font, (char *)"PIXEL_SIZE" ); if ( prop != NULL ) + root->available_sizes->height = (short) prop->value.int32; + else { - bdf_property_t *xres = 0, *yres = 0; + prop = bdf_get_font_property( font, (char *)"POINT_SIZE" ); + if ( prop != NULL ) + { + bdf_property_t *yres; - xres = bdf_get_font_property( font, (char *)"RESOLUTION_X" ); - yres = bdf_get_font_property( font, (char *)"RESOLUTION_Y" ); - if ( ( xres != NULL ) && ( yres != NULL ) ) - { - FT_TRACE4(( "PIXEL_SIZE: %d RESOLUTION_X: %d RESOLUTION_Y: %d\n", - prop->value.int32, - xres->value.int32, - yres->value.int32 )); - root->available_sizes->width = - (FT_Short)( prop->value.int32 * 75 / xres->value.int32 ); - - root->available_sizes->height = - (FT_Short)( prop->value.int32 * 75 / yres->value.int32 ); + yres = bdf_get_font_property( font, (char *)"RESOLUTION_Y" ); + if ( yres != NULL ) + { + FT_TRACE4(( "POINT_SIZE: %d RESOLUTION_Y: %d\n", + prop->value.int32, yres->value.int32 )); + root->available_sizes->height = + (FT_Short)( prop->value.int32 * yres->value.int32 / 720 ); + } } } - else + + if ( root->available_sizes->width == 0 ) { - /* some fonts have broken SIZE declaration (jiskan24.bdf) */ - FT_ERROR(( "BDF_Face_Init: reading size\n" )); - root->available_sizes->width = (FT_Short)font->point_size ; - root->available_sizes->height = (FT_Short)font->point_size ; + if ( root->available_sizes->height == 0 ) + { + /* some fonts have broken SIZE declaration (jiskan24.bdf) */ + FT_ERROR(( "BDF_Face_Init: reading size\n" )); + root->available_sizes->width = (FT_Short)font->point_size; + } + else + root->available_sizes->width = root->available_sizes->height; } + if ( root->available_sizes->height == 0 ) + root->available_sizes->height = root->available_sizes->width; /* encoding table */ { @@ -231,6 +368,7 @@ /* charmaps */ { bdf_property_t *charset_registry = 0, *charset_encoding = 0; + FT_Bool unicode_charmap = 0; charset_registry = @@ -245,34 +383,64 @@ ( charset_encoding->value.atom != NULL ) ) { if ( FT_NEW_ARRAY( face->charset_encoding, - strlen( charset_encoding->value.atom ) + 1 ) ) + ft_strlen( charset_encoding->value.atom ) + 1 ) ) goto Exit; - if (FT_NEW_ARRAY( face->charset_registry, - strlen( charset_registry->value.atom ) + 1 ) ) + if ( FT_NEW_ARRAY( face->charset_registry, + ft_strlen( charset_registry->value.atom ) + 1 ) ) goto Exit; ft_strcpy( face->charset_registry, charset_registry->value.atom ); ft_strcpy( face->charset_encoding, charset_encoding->value.atom ); - - face->charmap.encoding = ft_encoding_none; - face->charmap.platform_id = 0; - face->charmap.encoding_id = 0; - face->charmap.face = root; - face->charmap_handle = &face->charmap; - - root->charmap = face->charmap_handle; + if ( !ft_strcmp( face->charset_registry, "ISO10646" ) || + ( !ft_strcmp( face->charset_registry, "ISO8859" ) && + !ft_strcmp( face->charset_encoding, "1" ) ) ) + unicode_charmap = 1; + + { + FT_CharMapRec charmap; + + + charmap.face = FT_FACE( face ); + charmap.encoding = FT_ENCODING_NONE; + charmap.platform_id = 0; + charmap.encoding_id = 0; + + if ( unicode_charmap ) + { + charmap.encoding = FT_ENCODING_UNICODE; + charmap.platform_id = 3; + charmap.encoding_id = 1; + } + + error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL ); + +#if 0 + /* Select default charmap */ + if (root->num_charmaps) + root->charmap = root->charmaps[0]; +#endif + } goto Exit; } } - /* otherwise assume adobe standard encoding */ - face->charmap.encoding = ft_encoding_adobe_standard; - face->charmap.platform_id = 7; /* taken from t1objs.c */ - face->charmap.encoding_id = 0; - face->charmap.face = root; - face->charmap_handle = &face->charmap; + /* otherwise assume Adobe standard encoding */ + + { + FT_CharMapRec charmap; - root->charmap = face->charmap_handle; + + charmap.face = FT_FACE( face ); + charmap.encoding = FT_ENCODING_ADOBE_STANDARD; + charmap.platform_id = 7; + charmap.encoding_id = 0; + + error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL ); + + /* Select default charmap */ + if (root->num_charmaps) + root->charmap = root->charmaps[0]; + } } } @@ -285,8 +453,8 @@ } - static - FT_Error BDF_Set_Pixel_Size( FT_Size size ) + static FT_Error + BDF_Set_Pixel_Size( FT_Size size ) { BDF_Face face = (BDF_Face)FT_SIZE_FACE( size ); FT_Face root = FT_FACE( face ); @@ -312,7 +480,7 @@ BDF_Glyph_Load( FT_GlyphSlot slot, FT_Size size, FT_UInt glyph_index, - FT_Int load_flags ) + FT_Int32 load_flags ) { BDF_Face face = (BDF_Face)FT_SIZE_FACE( size ); FT_Error error = BDF_Err_Ok; @@ -322,8 +490,6 @@ int i, j, count; unsigned char *p, *pp; - FT_Memory memory = face->bdffont->memory; - FT_UNUSED( load_flags ); @@ -333,28 +499,32 @@ goto Exit; } + if ( glyph_index > 0 ) + glyph_index--; + /* slot, bitmap => freetype, glyph => bdflib */ glyph = face->bdffont->glyphs[glyph_index]; - bitmap->rows = glyph.bbx.height; - bitmap->width = glyph.bbx.width; + bitmap->rows = glyph.bbx.height; + bitmap->width = glyph.bbx.width; if ( bpp == 1 ) { - bitmap->pixel_mode = ft_pixel_mode_mono; + bitmap->pixel_mode = FT_PIXEL_MODE_MONO; bitmap->pitch = glyph.bpr; - if ( FT_NEW_ARRAY( bitmap->buffer, glyph.bytes ) ) - goto Exit; - FT_MEM_COPY( bitmap->buffer, glyph.bitmap, glyph.bytes ); + /* note: we don't allocate a new array to hold the bitmap, we */ + /* can simply point to it */ + ft_glyphslot_set_bitmap( slot, glyph.bitmap ); } else { /* blow up pixmap to have 8 bits per pixel */ - bitmap->pixel_mode = ft_pixel_mode_grays; + bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; bitmap->pitch = bitmap->width; - if ( FT_NEW_ARRAY( bitmap->buffer, bitmap->rows * bitmap->pitch ) ) + error = ft_glyphslot_alloc_bitmap( slot, bitmap->rows * bitmap->pitch ); + if ( error ) goto Exit; switch ( bpp ) @@ -448,45 +618,68 @@ /* FZ XXX: TODO: vertical metrics */ slot->metrics.horiAdvance = glyph.dwidth << 6; slot->metrics.horiBearingX = glyph.bbx.x_offset << 6; - slot->metrics.horiBearingY = glyph.bbx.y_offset << 6; + slot->metrics.horiBearingY = ( glyph.bbx.y_offset + + glyph.bbx.height ) << 6; slot->metrics.width = bitmap->width << 6; slot->metrics.height = bitmap->rows << 6; slot->linearHoriAdvance = (FT_Fixed)glyph.dwidth << 16; - slot->format = ft_glyph_format_bitmap; - slot->flags = FT_GLYPH_OWN_BITMAP; + slot->format = FT_GLYPH_FORMAT_BITMAP; Exit: return error; } - static - FT_UInt BDF_Get_Char_Index( FT_CharMap charmap, - FT_ULong char_code ) + static FT_Error + bdf_get_bdf_property( BDF_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ) { - BDF_Face face = (BDF_Face)charmap->face; - BDF_encoding_el* en_table = face->en_table; - int low, high, mid; - + bdf_property_t* prop; - FT_TRACE4(( "BDF_Get_Char_Index %ld\n", char_code )); + FT_ASSERT( face && face->bdffont ); - low = 0; - high = face->bdffont->glyphs_used - 1; - - while ( low <= high ) + prop = bdf_get_font_property( face->bdffont, (char*)prop_name ); + if ( prop != NULL ) { - mid = ( low + high ) / 2; - if ( char_code < en_table[mid].enc ) - high = mid - 1; - else if ( char_code > en_table[mid].enc ) - low = mid + 1; - else - return en_table[mid].glyph; + switch ( prop->format ) + { + case BDF_ATOM: + aproperty->type = BDF_PROPERTY_TYPE_ATOM; + aproperty->u.atom = prop->value.atom; + break; + + case BDF_INTEGER: + aproperty->type = BDF_PROPERTY_TYPE_INTEGER; + aproperty->u.integer = prop->value.int32; + break; + + case BDF_CARDINAL: + aproperty->type = BDF_PROPERTY_TYPE_CARDINAL; + aproperty->u.cardinal = prop->value.card32; + break; + + default: + goto Fail; + } + return 0; } + Fail: + return FT_Err_Invalid_Argument; + } + + + static FT_Module_Interface + bdf_driver_requester( FT_Module module, + const char* name ) + { + FT_UNUSED( module ); + + if ( name && ft_strcmp( name, "get_bdf_property" ) == 0 ) + return (FT_Module_Interface) bdf_get_bdf_property; - return face->bdffont->default_glyph; + return NULL; } @@ -505,12 +698,12 @@ (FT_Module_Constructor)0, (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 + (FT_Module_Requester) bdf_driver_requester }, - sizeof( BDF_FaceRec ), - sizeof( FT_SizeRec ), - sizeof( FT_GlyphSlotRec ), + sizeof ( BDF_FaceRec ), + sizeof ( FT_SizeRec ), + sizeof ( FT_GlyphSlotRec ), (FT_Face_InitFunc) BDF_Face_Init, (FT_Face_DoneFunc) BDF_Face_Done, @@ -524,21 +717,9 @@ (FT_Slot_LoadFunc) BDF_Glyph_Load, -#ifndef FT_CONFIG_OPTION_USE_CMAPS - (FT_CharMap_CharIndexFunc)0, -#else - (FT_CharMap_CharIndexFunc)BDF_Get_Char_Index, -#endif - (FT_Face_GetKerningFunc) 0, (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc) 0, - -#ifndef FT_CONFIG_OPTION_USE_CMAPS - (FT_CharMap_CharNextFunc) 0, /* BDF_Char_Get_Next,*/ -#else - (FT_CharMap_CharNextFunc) 0 -#endif + (FT_Face_GetAdvancesFunc) 0 }; Index: xc/extras/freetype2/src/bdf/bdflib.c diff -u xc/extras/freetype2/src/bdf/bdflib.c:1.1.1.1 xc/extras/freetype2/src/bdf/bdflib.c:1.3 --- xc/extras/freetype2/src/bdf/bdflib.c:1.1.1.1 Thu Jun 20 04:16:15 2002 +++ xc/extras/freetype2/src/bdf/bdflib.c Wed May 28 22:13:04 2003 @@ -20,6 +20,7 @@ * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/* $XFree86: xc/extras/freetype2/src/bdf/bdflib.c,v 1.3 2003/05/29 02:13:04 dawes Exp $ */ /*************************************************************************/ /* */ @@ -224,7 +225,7 @@ if ( FT_NEW_ARRAY( ht->table, ht->size ) ) goto Exit; - FT_MEM_SET( ht->table, 0, sizeof ( hashnode ) * ht->size ); + FT_MEM_ZERO( ht->table, sizeof ( hashnode ) * ht->size ); for ( i = 0, bp = obp; i < sz; i++, bp++ ) { @@ -255,7 +256,7 @@ if ( FT_NEW_ARRAY( ht->table, sz ) ) goto Exit; - FT_MEM_SET( ht->table, 0, sizeof ( hashnode ) * sz ); + FT_MEM_ZERO( ht->table, sizeof ( hashnode ) * sz ); Exit: return error; @@ -427,7 +428,7 @@ } /* Prepare the separator bitmap. */ - FT_MEM_SET( seps, 0, 32 ); + FT_MEM_ZERO( seps, 32 ); /* If the very last character of the separator string is a plus, then */ /* set the `mult' flag to indicate that multiple separators should be */ @@ -641,7 +642,7 @@ { _bdf_line_func_t cb; unsigned long lineno; - int n, res, done, refill, bytes, hold; + int n, done, refill, bytes, hold; char *ls, *le, *pp, *pe, *hp; char *buf = 0; FT_Memory memory = stream->memory; @@ -661,7 +662,7 @@ lineno = 1; buf[0] = 0; - res = done = 0; + done = 0; pp = ls = le = buf; bytes = 65536L; @@ -993,7 +994,7 @@ } p = font->user_props + font->nuser_props; - FT_MEM_SET( p, 0, sizeof ( bdf_property_t ) ); + FT_MEM_ZERO( p, sizeof ( bdf_property_t ) ); n = (unsigned long)( ft_strlen( name ) + 1 ); if ( FT_NEW_ARRAY( p->name, n ) ) @@ -1341,7 +1342,7 @@ } fp = font->props + font->props_size; - FT_MEM_SET( fp, 0, sizeof ( bdf_property_t ) ); + FT_MEM_ZERO( fp, sizeof ( bdf_property_t ) ); font->props_size++; } @@ -1443,7 +1444,6 @@ unsigned char* bp; unsigned long i, slen, nibbles; - _bdf_line_func_t* next; _bdf_parse_t* p; bdf_glyph_t* glyph; bdf_font_t* font; @@ -1454,7 +1454,6 @@ FT_UNUSED( lineno ); /* only used in debug mode */ - next = (_bdf_line_func_t *)call_data; p = (_bdf_parse_t *) client_data; font = p->font; @@ -1599,9 +1598,8 @@ font->glyphs_size, font->glyphs_size + 64 ) ) goto Exit; - FT_MEM_SET( font->glyphs + font->glyphs_size, - 0, - sizeof ( bdf_glyph_t ) * 64 ); /* FZ inutile */ + FT_MEM_ZERO( font->glyphs + font->glyphs_size, + sizeof ( bdf_glyph_t ) * 64 ); /* FZ inutile */ font->glyphs_size += 64; } @@ -1772,14 +1770,14 @@ /* Determine the overall font bounding box as the characters are */ /* loaded so corrections can be done later if indicated. */ - p->maxas = (FT_Short) MAX( glyph->bbx.ascent, p->maxas ); - p->maxds = (FT_Short) MAX( glyph->bbx.descent, p->maxds ); + p->maxas = (short)MAX( glyph->bbx.ascent, p->maxas ); + p->maxds = (short)MAX( glyph->bbx.descent, p->maxds ); p->rbearing = (short)( glyph->bbx.width + glyph->bbx.x_offset ); - p->maxrb = (FT_Short) MAX( p->rbearing, p->maxrb ); - p->minlb = (FT_Short) MIN( glyph->bbx.x_offset, p->minlb ); - p->maxlb = (FT_Short) MAX( glyph->bbx.x_offset, p->maxlb ); + p->maxrb = (short)MAX( p->rbearing, p->maxrb ); + p->minlb = (short)MIN( glyph->bbx.x_offset, p->minlb ); + p->maxlb = (short)MAX( glyph->bbx.x_offset, p->maxlb ); if ( !( p->flags & _BDF_DWIDTH ) ) { @@ -2165,12 +2163,12 @@ shift >>= 1; } - shift = (FT_UShort)(( bitcount > 3 ) ? 8 : ( 1 << bitcount )); + shift = (short)( ( bitcount > 3 ) ? 8 : ( 1 << bitcount ) ); if ( p->font->bpp > shift || p->font->bpp != shift ) { /* select next higher value */ - p->font->bpp = (FT_UShort)(shift << 1); + p->font->bpp = (unsigned short)( shift << 1 ); FT_TRACE2(( "_bdf_parse_start: " ACMSG11, p->font->bpp )); } } @@ -2203,96 +2201,98 @@ bdf_font_t* *font ) { unsigned long lineno; - _bdf_parse_t p; + _bdf_parse_t *p; - FT_Memory memory = NULL; + FT_Memory memory = extmemory; FT_Error error = BDF_Err_Ok; - FT_MEM_SET( &p, 0, sizeof ( _bdf_parse_t ) ); + if ( FT_ALLOC( p, sizeof ( _bdf_parse_t ) ) ) + goto Exit; - p.opts = (bdf_options_t*)( ( opts != 0 ) ? opts : &_bdf_opts ); - p.minlb = 32767; - p.memory = extmemory; /* only during font creation */ + memory = NULL; + p->opts = (bdf_options_t*)( ( opts != 0 ) ? opts : &_bdf_opts ); + p->minlb = 32767; + p->memory = extmemory; /* only during font creation */ error = _bdf_readstream( stream, _bdf_parse_start, - (void *)&p, &lineno ); + (void *)p, &lineno ); if ( error ) goto Exit; - if ( p.font != 0 ) + if ( p->font != 0 ) { /* If the font is not proportional, set the font's monowidth */ /* field to the width of the font bounding box. */ - memory = p.font->memory; + memory = p->font->memory; - if ( p.font->spacing != BDF_PROPORTIONAL ) - p.font->monowidth = p.font->bbx.width; + if ( p->font->spacing != BDF_PROPORTIONAL ) + p->font->monowidth = p->font->bbx.width; /* If the number of glyphs loaded is not that of the original count, */ /* indicate the difference. */ - if ( p.cnt != p.font->glyphs_used + p.font->unencoded_used ) + if ( p->cnt != p->font->glyphs_used + p->font->unencoded_used ) { - FT_TRACE2(( "bdf_load_font: " ACMSG15, p.cnt, - p.font->glyphs_used + p.font->unencoded_used )); - p.font->modified = 1; + FT_TRACE2(( "bdf_load_font: " ACMSG15, p->cnt, + p->font->glyphs_used + p->font->unencoded_used )); + p->font->modified = 1; } /* Once the font has been loaded, adjust the overall font metrics if */ /* necessary. */ - if ( p.opts->correct_metrics != 0 && - ( p.font->glyphs_used > 0 || p.font->unencoded_used > 0 ) ) + if ( p->opts->correct_metrics != 0 && + ( p->font->glyphs_used > 0 || p->font->unencoded_used > 0 ) ) { - if ( p.maxrb - p.minlb != p.font->bbx.width ) + if ( p->maxrb - p->minlb != p->font->bbx.width ) { FT_TRACE2(( "bdf_load_font: " ACMSG3, - p.font->bbx.width, p.maxrb - p.minlb )); - p.font->bbx.width = (unsigned short)( p.maxrb - p.minlb ); - p.font->modified = 1; + p->font->bbx.width, p->maxrb - p->minlb )); + p->font->bbx.width = (unsigned short)( p->maxrb - p->minlb ); + p->font->modified = 1; } - if ( p.font->bbx.x_offset != p.minlb ) + if ( p->font->bbx.x_offset != p->minlb ) { FT_TRACE2(( "bdf_load_font: " ACMSG4, - p.font->bbx.x_offset, p.minlb )); - p.font->bbx.x_offset = p.minlb; - p.font->modified = 1; + p->font->bbx.x_offset, p->minlb )); + p->font->bbx.x_offset = p->minlb; + p->font->modified = 1; } - if ( p.font->bbx.ascent != p.maxas ) + if ( p->font->bbx.ascent != p->maxas ) { FT_TRACE2(( "bdf_load_font: " ACMSG5, - p.font->bbx.ascent, p.maxas )); - p.font->bbx.ascent = p.maxas; - p.font->modified = 1; + p->font->bbx.ascent, p->maxas )); + p->font->bbx.ascent = p->maxas; + p->font->modified = 1; } - if ( p.font->bbx.descent != p.maxds ) + if ( p->font->bbx.descent != p->maxds ) { FT_TRACE2(( "bdf_load_font: " ACMSG6, - p.font->bbx.descent, p.maxds )); - p.font->bbx.descent = p.maxds; - p.font->bbx.y_offset = (short)( -p.maxds ); - p.font->modified = 1; + p->font->bbx.descent, p->maxds )); + p->font->bbx.descent = p->maxds; + p->font->bbx.y_offset = (short)( -p->maxds ); + p->font->modified = 1; } - if ( p.maxas + p.maxds != p.font->bbx.height ) + if ( p->maxas + p->maxds != p->font->bbx.height ) { FT_TRACE2(( "bdf_load_font: " ACMSG7, - p.font->bbx.height, p.maxas + p.maxds )); - p.font->bbx.height = (unsigned short)( p.maxas + p.maxds ); + p->font->bbx.height, p->maxas + p->maxds )); + p->font->bbx.height = (unsigned short)( p->maxas + p->maxds ); } - if ( p.flags & _BDF_SWIDTH_ADJ ) + if ( p->flags & _BDF_SWIDTH_ADJ ) FT_TRACE2(( "bdf_load_font: " ACMSG8 )); } } - if ( p.flags & _BDF_START ) + if ( p->flags & _BDF_START ) { { /* The ENDFONT field was never reached or did not exist. */ - if ( !( p.flags & _BDF_GLYPHS ) ) + if ( !( p->flags & _BDF_GLYPHS ) ) /* Error happened while parsing header. */ FT_ERROR(( "bdf_load_font: " ERRMSG2, lineno )); else @@ -2303,28 +2303,34 @@ /* Free up the list used during the parsing. */ if ( memory != NULL ) - FT_FREE( p.list.field ); + FT_FREE( p->list.field ); - if ( p.font != 0 ) + if ( p->font != 0 ) { /* Make sure the comments are NULL terminated if they exist. */ - memory = p.font->memory; + memory = p->font->memory; - if ( p.font->comments_len > 0 ) { - if ( FT_RENEW_ARRAY( p.font->comments, - p.font->comments_len, - p.font->comments_len + 1 ) ) + if ( p->font->comments_len > 0 ) { + if ( FT_RENEW_ARRAY( p->font->comments, + p->font->comments_len, + p->font->comments_len + 1 ) ) goto Exit; - p.font->comments[p.font->comments_len] = 0; + p->font->comments[p->font->comments_len] = 0; } } else if ( error == BDF_Err_Ok ) error = BDF_Err_Invalid_File_Format; - *font = p.font; + *font = p->font; Exit: + if ( p ) + { + memory = extmemory; + FT_FREE( p ); + } + return error; } Index: xc/extras/freetype2/src/cache/Jamfile diff -u xc/extras/freetype2/src/cache/Jamfile:1.1.1.2 xc/extras/freetype2/src/cache/Jamfile:1.1.1.3 --- xc/extras/freetype2/src/cache/Jamfile:1.1.1.2 Mon Jan 14 11:52:11 2002 +++ xc/extras/freetype2/src/cache/Jamfile Wed May 28 22:01:50 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/cache Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src cache ; - -SubDirHdrs [ FT2_SubDir src cache ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) cache ; # The file <freetype/ftcache.h> contains some macro definitions that are # later used in #include statements related to the cache sub-system. It Index: xc/extras/freetype2/src/cache/ftccache.c diff -u xc/extras/freetype2/src/cache/ftccache.c:1.1.1.3 xc/extras/freetype2/src/cache/ftccache.c:1.1.1.4 --- xc/extras/freetype2/src/cache/ftccache.c:1.1.1.3 Thu Jun 20 04:16:15 2002 +++ xc/extras/freetype2/src/cache/ftccache.c Wed May 28 22:01:50 2003 @@ -24,8 +24,6 @@ #include "ftcerror.h" -#ifdef FTC_CACHE_USE_LINEAR_HASHING - #define FTC_HASH_MAX_LOAD 2 #define FTC_HASH_MIN_LOAD 1 #define FTC_HASH_SUB_LOAD ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD ) @@ -33,7 +31,6 @@ /* this one _must_ be a power of 2! */ #define FTC_HASH_INITIAL_SIZE 8 -#endif /* FTC_CACHE_USE_LINEAR_HASHING */ /*************************************************************************/ /*************************************************************************/ @@ -155,8 +152,6 @@ } -#ifdef FTC_CACHE_USE_LINEAR_HASHING - /* remove a node from its cache's hash table */ static FT_Error ftc_node_hash_unlink( FTC_Node node, @@ -164,14 +159,14 @@ { FT_Error error = 0; FTC_Node *pnode; - FT_UInt index, num_buckets; + FT_UInt idx, num_buckets; + - - index = (FT_UInt)( node->hash & cache->mask ); - if ( index < cache->p ) - index = (FT_UInt)( node->hash & ( 2 * cache->mask + 1 ) ); + idx = (FT_UInt)( node->hash & cache->mask ); + if ( idx < cache->p ) + idx = (FT_UInt)( node->hash & ( 2 * cache->mask + 1 ) ); - pnode = cache->buckets + index; + pnode = cache->buckets + idx; for (;;) { @@ -201,7 +196,8 @@ FTC_Node* pold; - FT_ASSERT( old_index >= FTC_HASH_INITIAL_SIZE ); + if ( old_index+1 <= FTC_HASH_INITIAL_SIZE ) + goto Exit; if ( p == 0 ) { @@ -236,57 +232,23 @@ return error; } -#else /* !FTC_CACHE_USE_LINEAR_HASHING */ - - /* remove a node from its cache's hash table */ - static void - ftc_node_hash_unlink( FTC_Node node, - FTC_Cache cache ) - { - FTC_Node *pnode = cache->buckets + ( node->hash % cache->size ); - - - for (;;) - { - if ( *pnode == NULL ) - { - FT_ERROR(( "FreeType.cache.hash_unlink: unknown node!\n" )); - return; - } - - if ( *pnode == node ) - { - *pnode = node->link; - node->link = NULL; - - cache->nodes--; - return; - } - - pnode = &(*pnode)->link; - } - } - -#endif /* !FTC_CACHE_USE_LINEAR_HASHING */ -#ifdef FTC_CACHE_USE_LINEAR_HASHING - /* add a node to the "top" of its cache's hash table */ static FT_Error ftc_node_hash_link( FTC_Node node, FTC_Cache cache ) { FTC_Node *pnode; - FT_UInt index; + FT_UInt idx; FT_Error error = 0; - index = (FT_UInt)( node->hash & cache->mask ); - if ( index < cache->p ) - index = (FT_UInt)( node->hash & (2 * cache->mask + 1 ) ); + idx = (FT_UInt)( node->hash & cache->mask ); + if ( idx < cache->p ) + idx = (FT_UInt)( node->hash & (2 * cache->mask + 1 ) ); - pnode = cache->buckets + index; + pnode = cache->buckets + idx; node->link = *pnode; *pnode = node; @@ -345,23 +307,6 @@ return error; } -#else /* !FTC_CACHE_USE_LINEAR_HASHING */ - - /* add a node to the "top" of its cache's hash table */ - static void - ftc_node_hash_link( FTC_Node node, - FTC_Cache cache ) - { - FTC_Node *pnode = cache->buckets + ( node->hash % cache->size ); - - - node->link = *pnode; - *pnode = node; - - cache->nodes++; - } - -#endif /* !FTC_CACHE_USE_LINEAR_HASHING */ @@ -412,10 +357,12 @@ FT_FREE( node ); +#if 0 /* check, just in case of general corruption :-) */ if ( manager->num_nodes == 0 ) FT_ERROR(( "ftc_node_destroy: invalid cache node count! = %d\n", manager->num_nodes )); +#endif } @@ -460,11 +407,14 @@ FT_EXPORT_DEF( void ) ftc_family_done( FTC_Family family ) { - FTC_Manager manager = family->cache->manager; + if ( family && family->cache ) + { + FTC_Manager manager = family->cache->manager; - /* remove from manager's family table */ - ftc_family_table_free( &manager->families, family->fam_index ); + /* remove from manager's family table */ + ftc_family_table_free( &manager->families, family->fam_index ); + } } @@ -476,125 +426,6 @@ /*************************************************************************/ /*************************************************************************/ -#ifdef FTC_CACHE_USE_LINEAR_HASHING - - /* nothing */ - -#else /* !FTC_CACHE_USE_LINEAR_HASHING */ - -#define FTC_PRIMES_MIN 7 -#define FTC_PRIMES_MAX 13845163 - - static const FT_UInt ftc_primes[] = - { - 7, - 11, - 19, - 37, - 73, - 109, - 163, - 251, - 367, - 557, - 823, - 1237, - 1861, - 2777, - 4177, - 6247, - 9371, - 14057, - 21089, - 31627, - 47431, - 71143, - 106721, - 160073, - 240101, - 360163, - 540217, - 810343, - 1215497, - 1823231, - 2734867, - 4102283, - 6153409, - 9230113, - 13845163, - }; - - - static FT_UFast - ftc_prime_closest( FT_UFast num ) - { - FT_UInt i; - - - for ( i = 0; i < sizeof ( ftc_primes ) / sizeof ( ftc_primes[0] ); i++ ) - if ( ftc_primes[i] > num ) - return ftc_primes[i]; - - return FTC_PRIMES_MAX; - } - - -#define FTC_CACHE_RESIZE_TEST( c ) \ - ( (c)->nodes*3 < (c)->size || \ - (c)->size*3 < (c)->nodes ) - - - static void - ftc_cache_resize( FTC_Cache cache ) - { - FT_UFast new_size; - - - new_size = ftc_prime_closest( cache->nodes ); - if ( new_size != cache->size ) - { - FT_Memory memory = cache->memory; - FT_Error error; - FTC_Node* new_buckets ; - FT_ULong i; - - - /* no need to report an error; we'll simply keep using the same */ - /* buckets number / size */ - if ( FT_NEW_ARRAY( new_buckets, new_size ) ) - return; - - for ( i = 0; i < cache->size; i++ ) - { - FTC_Node node, next, *pnode; - FT_UFast hash; - - - node = cache->buckets[i]; - while ( node ) - { - next = node->link; - hash = node->hash % new_size; - pnode = new_buckets + hash; - - node->link = pnode[0]; - pnode[0] = node; - - node = next; - } - } - - if ( cache->buckets ) - FT_FREE( cache->buckets ); - - cache->buckets = new_buckets; - cache->size = new_size; - - FT_UNUSED( error ); - } - } - -#endif /* !FTC_CACHE_USE_LINEAR_HASHING */ FT_EXPORT_DEF( FT_Error ) @@ -605,8 +436,6 @@ FT_Error error; -#ifdef FTC_CACHE_USE_LINEAR_HASHING - cache->p = 0; cache->mask = FTC_HASH_INITIAL_SIZE - 1; cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD; @@ -614,16 +443,6 @@ if ( FT_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 ) ) goto Exit; -#else /* !FTC_CACHE_USE_LINEAR_HASHING */ - - cache->nodes = 0; - cache->size = FTC_PRIMES_MIN; - - if ( FT_NEW_ARRAY( cache->buckets, cache->size ) ) - goto Exit; - -#endif /* !FTC_CACHE_USE_LINEAR_HASHING */ - /* now, initialize the lru list of families for this cache */ if ( clazz->family_size > 0 ) { @@ -665,11 +484,7 @@ FT_UFast i; FT_UInt count; -#ifdef FTC_CACHE_USE_LINEAR_HASHING count = cache->p + cache->mask + 1; -#else - count = cache->size; -#endif for ( i = 0; i < count; i++ ) { @@ -696,11 +511,8 @@ cache->buckets[i] = NULL; } -#ifdef FTC_CACHE_USE_LINEAR_HASHING cache->p = 0; -#else - cache->nodes = 0; -#endif + /* destroy the families */ if ( cache->families ) FT_LruList_Reset( cache->families ); @@ -719,12 +531,8 @@ ftc_cache_clear( cache ); FT_FREE( cache->buckets ); -#ifdef FTC_CACHE_USE_LINEAR_HASHING cache->mask = 0; cache->slack = 0; -#else - cache->size = 0; -#endif if ( cache->families ) { @@ -743,8 +551,10 @@ FTC_Query query, FTC_Node *anode ) { - FT_Error error = FT_Err_Ok; - FT_LruNode lru; + FT_Error error = FT_Err_Ok; + FTC_Manager manager; + FT_LruNode lru; + FT_UInt free_count = 0; if ( !cache || !query || !anode ) @@ -755,179 +565,237 @@ query->hash = 0; query->family = NULL; -#if 1 + manager = cache->manager; - /* XXX: we break encapsulation for the sake of speed! */ - { - /* first of all, find the relevant family */ - FT_LruList list = cache->families; - FT_LruNode fam, *pfam; - FT_LruNode_CompareFunc compare = list->clazz->node_compare; + /* here's a small note explaining what's hapenning in the code below. + * + * we need to deal intelligently with out-of-memory (OOM) conditions + * when trying to create a new family or cache node during the lookup. + * + * when an OOM is detected, we'll try to free one or more "old" nodes + * from the cache, then try again. it may be necessary to do that several + * times, so a loop is needed. + * + * the local variable "free_count" holds the number of "old" nodes to + * discard on each attempt. it starts at 1 and doubles on each iteration. + * the loop stops when: + * + * - a non-OOM error is detected + * - a succesful lookup is performed + * - there are no more unused nodes in the cache + * + * for the record, remember that all used nodes appear _before_ + * unused ones in the manager's MRU node list. + */ - pfam = &list->nodes; - for (;;) + for (;;) + { { - fam = *pfam; - if ( fam == NULL ) + /* first of all, find the relevant family */ + FT_LruList list = cache->families; + FT_LruNode fam, *pfam; + FT_LruNode_CompareFunc compare = list->clazz->node_compare; + + pfam = &list->nodes; + for (;;) { - error = FT_LruList_Lookup( list, query, &lru ); - if ( error ) - goto Exit; + fam = *pfam; + if ( fam == NULL ) + { + error = FT_LruList_Lookup( list, query, &lru ); + if ( error ) + goto Fail; + + goto Skip; + } + + if ( compare( fam, query, list->data ) ) + break; - goto Skip; + pfam = &fam->next; } - if ( compare( fam, query, list->data ) ) - break; + FT_ASSERT( fam != NULL ); - pfam = &fam->next; - } + /* move to top of list when needed */ + if ( fam != list->nodes ) + { + *pfam = fam->next; + fam->next = list->nodes; + list->nodes = fam; + } - FT_ASSERT( fam != NULL ); + lru = fam; - /* move to top of list when needed */ - if ( fam != list->nodes ) - { - *pfam = fam->next; - fam->next = list->nodes; - list->nodes = fam; + Skip: + ; } - lru = fam; + { + FTC_Manager manager = cache->manager; + FTC_Family family = (FTC_Family) lru; + FT_UFast hash = query->hash; + FTC_Node* bucket; + FT_UInt idx; - Skip: - ; - } -#else + idx = hash & cache->mask; + if ( idx < cache->p ) + idx = hash & ( cache->mask * 2 + 1 ); - error = FT_LruList_Lookup( cache->families, query, &lru ); - if ( !error ) - -#endif - { - FTC_Family family = (FTC_Family) lru; - FT_UFast hash = query->hash; - FTC_Node* bucket; + bucket = cache->buckets + idx; -#ifdef FTC_CACHE_USE_LINEAR_HASHING - FT_UInt index; + if ( query->family != family || + family->fam_index >= manager->families.size ) + { + FT_ERROR(( + "ftc_cache_lookup: invalid query (bad 'family' field)\n" )); + error = FTC_Err_Invalid_Argument; + goto Exit; + } + if ( *bucket ) + { + FTC_Node* pnode = bucket; + FTC_Node_CompareFunc compare = cache->clazz->node_compare; - index = hash & cache->mask; - if ( index < cache->p ) - index = hash & ( cache->mask * 2 + 1 ); - bucket = cache->buckets + index; + for ( ;; ) + { + FTC_Node node; -#else - bucket = cache->buckets + (hash % cache->size); + node = *pnode; + if ( node == NULL ) + break; -#endif + if ( node->hash == hash && + (FT_UInt)node->fam_index == family->fam_index && + compare( node, query, cache ) ) + { + /* move to head of bucket list */ + if ( pnode != bucket ) + { + *pnode = node->link; + node->link = *bucket; + *bucket = node; + } + + /* move to head of MRU list */ + if ( node != manager->nodes_list ) + ftc_node_mru_up( node, manager ); + *anode = node; + goto Exit; + } - if ( query->family != family || - family->fam_index >= cache->manager->families.size ) - { - FT_ERROR(( - "ftc_cache_lookup: invalid query (bad 'family' field)\n" )); - return FTC_Err_Invalid_Argument; - } + pnode = &node->link; + } + } - if ( *bucket ) - { - FTC_Node* pnode = bucket; - FTC_Node_CompareFunc compare = cache->clazz->node_compare; + /* didn't find a node, create a new one */ + { + FTC_Cache_Class clazz = cache->clazz; + FT_Memory memory = cache->memory; + FTC_Node node; - for ( ;; ) - { - FTC_Node node; + if ( FT_ALLOC( node, clazz->node_size ) ) + goto Fail; + node->fam_index = (FT_UShort) family->fam_index; + node->hash = query->hash; + node->ref_count = 0; - node = *pnode; - if ( node == NULL ) - break; + error = clazz->node_init( node, query, cache ); + if ( error ) + { + FT_FREE( node ); + goto Fail; + } - if ( node->hash == hash && - (FT_UInt)node->fam_index == family->fam_index && - compare( node, query, cache ) ) + error = ftc_node_hash_link( node, cache ); + if ( error ) { - /* move to head of bucket list */ - if ( pnode != bucket ) - { - *pnode = node->link; - node->link = *bucket; - *bucket = node; - } + clazz->node_done( node, cache ); + FT_FREE( node ); + goto Fail; + } - /* move to head of MRU list */ - if ( node != cache->manager->nodes_list ) - ftc_node_mru_up( node, cache->manager ); + ftc_node_mru_link( node, cache->manager ); - *anode = node; - goto Exit; + cache->manager->cur_weight += clazz->node_weight( node, cache ); + + /* now try to compress the node pool when necessary */ + if ( manager->cur_weight >= manager->max_weight ) + { + node->ref_count++; + FTC_Manager_Compress( manager ); + node->ref_count--; } - pnode = &node->link; + *anode = node; } + + /* all is well, exit now + */ + goto Exit; } - /* didn't find a node, create a new one */ + Fail: + if ( error != FT_Err_Out_Of_Memory ) + goto Exit; + + /* there is not enough memory, try to release some unused nodes + * from the cache to make room for a new one. + */ { - FTC_Cache_Class clazz = cache->clazz; - FTC_Manager manager = cache->manager; - FT_Memory memory = cache->memory; - FTC_Node node; + FT_UInt new_count; + new_count = 1 + free_count*2; - if ( FT_ALLOC( node, clazz->node_size ) ) + /* check overflow and bounds */ + if ( new_count < free_count || free_count > manager->num_nodes ) goto Exit; - node->fam_index = (FT_UShort) family->fam_index; - node->hash = query->hash; - node->ref_count = 0; + free_count = new_count; - error = clazz->node_init( node, query, cache ); - if ( error ) + /* try to remove "new_count" nodes from the list */ { - FT_FREE( node ); - goto Exit; - } + FTC_Node first = manager->nodes_list; + FTC_Node node; -#ifdef FTC_CACHE_USE_LINEAR_HASHING - error = ftc_node_hash_link( node, cache ); - if ( error ) - { - clazz->node_done( node, cache ); - FT_FREE( node ); - goto Exit; - } -#else - ftc_node_hash_link( node, cache ); -#endif + if ( first == NULL ) /* empty list ! */ + goto Exit; - ftc_node_mru_link( node, cache->manager ); + /* go to last node - it's a circular list */ + node = first->mru_prev; + for ( ; node && new_count > 0; new_count-- ) + { + FTC_Node prev = node->mru_prev; - cache->manager->cur_weight += clazz->node_weight( node, cache ); + /* used nodes always appear before unused one in the MRU + * list. if we find one here, we'd better stop right now + * our iteration + */ + if ( node->ref_count > 0 ) + { + /* if there are no unused nodes in the list, we'd better exit */ + if ( new_count == free_count ) + goto Exit; - /* now try to compress the node pool when necessary */ - if ( manager->cur_weight >= manager->max_weight ) - { - node->ref_count++; - FTC_Manager_Compress( manager ); - node->ref_count--; - } + break; + } -#ifndef FTC_CACHE_USE_LINEAR_HASHING - /* try to resize the hash table if appropriate */ - if ( FTC_CACHE_RESIZE_TEST( cache ) ) - ftc_cache_resize( cache ); -#endif + ftc_node_destroy( node, manager ); + + if ( node == first ) + break; - *anode = node; + node = prev; + } + } } } Index: xc/extras/freetype2/src/cache/ftccache.i diff -u xc/extras/freetype2/src/cache/ftccache.i:1.1.1.1 xc/extras/freetype2/src/cache/ftccache.i:1.1.1.2 --- xc/extras/freetype2/src/cache/ftccache.i:1.1.1.1 Thu Jun 20 04:16:15 2002 +++ xc/extras/freetype2/src/cache/ftccache.i Wed May 28 22:01:50 2003 @@ -78,30 +78,16 @@ family = (FTC_Family)lru; hash = query->hash; -#ifdef FTC_CACHE_USE_LINEAR_HASHING { - FT_UInt index; + FT_UInt idx; - index = hash & cache->mask; - if ( index < cache->p ) - index = hash & ( cache->mask * 2 + 1 ); + idx = hash & cache->mask; + if ( idx < cache->p ) + idx = hash & ( cache->mask * 2 + 1 ); - bucket = cache->buckets + index; + bucket = cache->buckets + idx; } -#else - bucket = cache->buckets + ( hash % cache->size ); -#endif - -#ifdef FT_DEBUG_LEVEL_ERROR - if ( query->family != family || - family->fam_index >= cache->manager->families.size ) - { - FT_ERROR(( - "ftc_cache_lookup: invalid query (bad 'family' field)\n" )); - return FTC_Err_Invalid_Argument; - } -#endif pnode = bucket; Index: xc/extras/freetype2/src/cache/ftccmap.c diff -u xc/extras/freetype2/src/cache/ftccmap.c:1.1.1.3 xc/extras/freetype2/src/cache/ftccmap.c:1.1.1.4 --- xc/extras/freetype2/src/cache/ftccmap.c:1.1.1.3 Thu Jun 20 04:16:15 2002 +++ xc/extras/freetype2/src/cache/ftccmap.c Wed May 28 22:01:50 2003 @@ -23,9 +23,13 @@ #include FT_CACHE_MANAGER_H #include FT_INTERNAL_MEMORY_H #include FT_INTERNAL_DEBUG_H +#include FT_TRUETYPE_IDS_H #include "ftcerror.h" +#undef FT_COMPONENT +#define FT_COMPONENT trace_cache + /*************************************************************************/ /* */ /* Each FTC_CMapNode contains a simple array to map a range of character */ @@ -131,7 +135,7 @@ ftc_cmap_node_weight( FTC_CMapNode cnode ) { FT_UNUSED( cnode ); - + return sizeof ( *cnode ); } @@ -189,10 +193,54 @@ break; case FTC_CMAP_BY_ENCODING: - for ( idx = 0; idx < count; idx++, cur++ ) - if ( cur[0]->encoding == desc->u.encoding ) - break; + if (desc->u.encoding == FT_ENCODING_UNICODE) + { + /* since the `interesting' table, with id's 3,10, is normally the + * last one, we loop backwards. This looses with type1 fonts with + * non-BMP characters (<.0001%), this wins with .ttf with non-BMP + * chars (.01% ?), and this is the same about 99.99% of the time! + */ + + FT_UInt unicmap_idx = count; /* some UCS-2 map, if we found it */ + + cur += count - 1; + + for ( idx = 0; idx < count; idx++, cur-- ) + { + if ( cur[0]->encoding == FT_ENCODING_UNICODE ) + { + unicmap_idx = idx; /* record we found a Unicode charmap */ + + /* XXX If some new encodings to represent UCS-4 are added, + * they should be added here. + */ + if ( ( cur[0]->platform_id == TT_PLATFORM_MICROSOFT && + cur[0]->encoding_id == TT_MS_ID_UCS_4 ) || + ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && + cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) ) + + /* Hurray! We found a UCS-4 charmap. We can stop the scan! */ + { + idx = count - 1 - idx; + goto Found_idx_for_FTC_CMAP_BY_ENCODING; + } + } + } + + /* We do not have any UCS-4 charmap. Sigh. + * Let's see if we have some other kind of Unicode charmap, though. + */ + if ( unicmap_idx < count ) + idx = count - 1 - unicmap_idx; + } + else + { + for ( idx = 0; idx < count; idx++, cur++ ) + if ( cur[0]->encoding == desc->u.encoding ) + break; + } + Found_idx_for_FTC_CMAP_BY_ENCODING: hash = idx * 67; break; @@ -227,7 +275,7 @@ return error; Bad_Descriptor: - FT_ERROR(( "ftp_cmap_family_init: invalid charmap descriptor\n" )); + FT_TRACE1(( "ftp_cmap_family_init: invalid charmap descriptor\n" )); return FTC_Err_Invalid_Argument; } Index: xc/extras/freetype2/src/cache/ftcimage.c diff -u xc/extras/freetype2/src/cache/ftcimage.c:1.1.1.7 xc/extras/freetype2/src/cache/ftcimage.c:1.1.1.8 --- xc/extras/freetype2/src/cache/ftcimage.c:1.1.1.7 Thu Jun 20 04:16:15 2002 +++ xc/extras/freetype2/src/cache/ftcimage.c Wed May 28 22:01:50 2003 @@ -42,7 +42,7 @@ typedef struct FTC_ImageQueryRec_ { FTC_GlyphQueryRec gquery; - FTC_ImageDesc desc; + FTC_ImageTypeRec type; } FTC_ImageQueryRec, *FTC_ImageQuery; @@ -54,7 +54,7 @@ typedef struct FTC_ImageFamilyRec_ { FTC_GlyphFamilyRec gfam; - FTC_ImageDesc desc; + FTC_ImageTypeRec type; } FTC_ImageFamilyRec, *FTC_ImageFamily; @@ -106,45 +106,18 @@ /* we will now load the glyph image */ error = FTC_Manager_Lookup_Size( FTC_FAMILY( ifam )->cache->manager, - &ifam->desc.font, + &ifam->type.font, &face, &size ); if ( !error ) { - FT_UInt gindex = FTC_GLYPH_NODE_GINDEX( inode ); - FT_UInt load_flags = FT_LOAD_DEFAULT; - FT_UInt type = ifam->desc.type; - - - if ( FTC_IMAGE_FORMAT( type ) == ftc_image_format_bitmap ) - { - load_flags |= FT_LOAD_RENDER; - if ( type & ftc_image_flag_monochrome ) - load_flags |= FT_LOAD_MONOCHROME; - - /* disable embedded bitmaps loading if necessary */ - if ( type & ftc_image_flag_no_sbits ) - load_flags |= FT_LOAD_NO_BITMAP; - } - else if ( FTC_IMAGE_FORMAT( type ) == ftc_image_format_outline ) - { - /* disable embedded bitmaps loading */ - load_flags |= FT_LOAD_NO_BITMAP; + FT_UInt gindex = FTC_GLYPH_NODE_GINDEX( inode ); - if ( type & ftc_image_flag_unscaled ) - load_flags |= FT_LOAD_NO_SCALE; - } - if ( type & ftc_image_flag_unhinted ) - load_flags |= FT_LOAD_NO_HINTING; - - if ( type & ftc_image_flag_autohinted ) - load_flags |= FT_LOAD_FORCE_AUTOHINT; - - error = FT_Load_Glyph( face, gindex, load_flags ); + error = FT_Load_Glyph( face, gindex, ifam->type.flags ); if ( !error ) { - if ( face->glyph->format == ft_glyph_format_bitmap || - face->glyph->format == ft_glyph_format_outline ) + if ( face->glyph->format == FT_GLYPH_FORMAT_BITMAP || + face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) { /* ok, copy it */ FT_Glyph glyph; @@ -179,7 +152,7 @@ switch ( glyph->format ) { - case ft_glyph_format_bitmap: + case FT_GLYPH_FORMAT_BITMAP: { FT_BitmapGlyph bitg; @@ -190,7 +163,7 @@ } break; - case ft_glyph_format_outline: + case FT_GLYPH_FORMAT_OUTLINE: { FT_OutlineGlyph outg; @@ -231,16 +204,16 @@ FT_Face face; - ifam->desc = iquery->desc; + ifam->type = iquery->type; /* we need to compute "iquery.item_total" now */ error = FTC_Manager_Lookup_Face( manager, - iquery->desc.font.face_id, + iquery->type.font.face_id, &face ); if ( !error ) { error = ftc_glyph_family_init( FTC_GLYPH_FAMILY( ifam ), - FTC_IMAGE_DESC_HASH( &ifam->desc ), + FTC_IMAGE_TYPE_HASH( &ifam->type ), 1, face->num_glyphs, FTC_GLYPH_QUERY( iquery ), @@ -258,7 +231,7 @@ FT_Bool result; - result = FT_BOOL( FTC_IMAGE_DESC_COMPARE( &ifam->desc, &iquery->desc ) ); + result = FT_BOOL( FTC_IMAGE_TYPE_COMPARE( &ifam->type, &iquery->type ) ); if ( result ) FTC_GLYPH_FAMILY_FOUND( ifam, iquery ); @@ -314,7 +287,7 @@ FT_EXPORT_DEF( FT_Error ) FTC_ImageCache_Lookup( FTC_ImageCache cache, - FTC_ImageDesc* desc, + FTC_ImageType type, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ) @@ -332,7 +305,7 @@ *anode = NULL; iquery.gquery.gindex = gindex; - iquery.desc = *desc; + iquery.type = *type; error = ftc_cache_lookup( FTC_CACHE( cache ), FTC_QUERY( &iquery ), @@ -368,17 +341,55 @@ FT_UInt gindex, FT_Glyph *aglyph ) { - FTC_ImageDesc desc0; + FTC_ImageTypeRec type0; if ( !desc ) return FTC_Err_Invalid_Argument; - desc0.font = desc->font; - desc0.type = (FT_UInt32)desc->image_type; + type0.font = desc->font; + + /* convert image type flags to load flags */ + { + FT_UInt load_flags = FT_LOAD_DEFAULT; + FT_UInt type = desc->image_type; + + + /* determine load flags, depending on the font description's */ + /* image type */ + + if ( ftc_image_format( type ) == ftc_image_format_bitmap ) + { + if ( type & ftc_image_flag_monochrome ) + load_flags |= FT_LOAD_MONOCHROME; + + /* disable embedded bitmaps loading if necessary */ + if ( type & ftc_image_flag_no_sbits ) + load_flags |= FT_LOAD_NO_BITMAP; + } + else + { + /* we want an outline, don't load embedded bitmaps */ + load_flags |= FT_LOAD_NO_BITMAP; + + if ( type & ftc_image_flag_unscaled ) + load_flags |= FT_LOAD_NO_SCALE; + } + + /* always render glyphs to bitmaps */ + load_flags |= FT_LOAD_RENDER; + + if ( type & ftc_image_flag_unhinted ) + load_flags |= FT_LOAD_NO_HINTING; + + if ( type & ftc_image_flag_autohinted ) + load_flags |= FT_LOAD_FORCE_AUTOHINT; + + type0.flags = load_flags; + } return FTC_ImageCache_Lookup( (FTC_ImageCache)icache, - &desc0, + &type0, gindex, aglyph, NULL ); Index: xc/extras/freetype2/src/cache/ftcsbits.c diff -u xc/extras/freetype2/src/cache/ftcsbits.c:1.1.1.6 xc/extras/freetype2/src/cache/ftcsbits.c:1.1.1.7 --- xc/extras/freetype2/src/cache/ftcsbits.c:1.1.1.6 Thu Jun 20 04:16:15 2002 +++ xc/extras/freetype2/src/cache/ftcsbits.c Wed May 28 22:01:50 2003 @@ -46,7 +46,7 @@ typedef struct FTC_SBitQueryRec_ { FTC_GlyphQueryRec gquery; - FTC_ImageDesc desc; + FTC_ImageTypeRec type; } FTC_SBitQueryRec, *FTC_SBitQuery; @@ -60,7 +60,7 @@ typedef struct FTC_SBitFamilyRec_ { FTC_GlyphFamilyRec gfam; - FTC_ImageDesc desc; + FTC_ImageTypeRec type; } FTC_SBitFamilyRec; @@ -104,8 +104,8 @@ ftc_sbit_node_done( FTC_SBitNode snode, FTC_Cache cache ) { - FTC_SBit sbit = snode->sbits; - FT_UInt count = FTC_GLYPH_NODE( snode )->item_count; + FTC_SBit sbit = snode->sbits; + FT_UInt count = FTC_GLYPH_NODE( snode )->item_count; FT_Memory memory = cache->memory; @@ -142,48 +142,14 @@ sbit = snode->sbits + ( gindex - gnode->item_start ); - error = FTC_Manager_Lookup_Size( manager, &sfam->desc.font, + error = FTC_Manager_Lookup_Size( manager, &sfam->type.font, &face, &size ); if ( !error ) { - FT_UInt load_flags = FT_LOAD_DEFAULT; - FT_UInt type = sfam->desc.type; - - - /* determine load flags, depending on the font description's */ - /* image type */ - - if ( FTC_IMAGE_FORMAT( type ) == ftc_image_format_bitmap ) - { - if ( type & ftc_image_flag_monochrome ) - load_flags |= FT_LOAD_MONOCHROME; - - /* disable embedded bitmaps loading if necessary */ - if ( type & ftc_image_flag_no_sbits ) - load_flags |= FT_LOAD_NO_BITMAP; - } - else - { - FT_ERROR(( - "ftc_sbit_node_load: cannot load scalable glyphs in an" - " sbit cache, please check your arguments!\n" )); - error = FTC_Err_Invalid_Argument; - goto Exit; - } - - /* always render glyphs to bitmaps */ - load_flags |= FT_LOAD_RENDER; - - if ( type & ftc_image_flag_unhinted ) - load_flags |= FT_LOAD_NO_HINTING; - - if ( type & ftc_image_flag_autohinted ) - load_flags |= FT_LOAD_FORCE_AUTOHINT; - /* by default, indicates a `missing' glyph */ sbit->buffer = 0; - error = FT_Load_Glyph( face, gindex, load_flags ); + error = FT_Load_Glyph( face, gindex, sfam->type.flags | FT_LOAD_RENDER ); if ( !error ) { FT_Int temp; @@ -221,13 +187,9 @@ sbit->xadvance = (FT_Char)xadvance; sbit->yadvance = (FT_Char)yadvance; sbit->format = (FT_Byte)bitmap->pixel_mode; - /* XXX: Fixme: We don't handle the number of gray levels */ - /* consistently -- we say num_grays == 1 for */ - /* monochrome but num_grays == 256 for gray. It */ - /* would be better to make this variable hold the */ - /* highest possible value so that it fits into */ - /* a single byte. */ - sbit->num_grays = bitmap->num_grays; + sbit->max_grays = (FT_Byte)(bitmap->num_grays - 1); + +#if 0 /* this doesn't work well with embedded bitmaps !! */ /* grab the bitmap when possible - this is a hack! */ if ( slot->flags & FT_GLYPH_OWN_BITMAP ) @@ -236,6 +198,7 @@ sbit->buffer = bitmap->buffer; } else +#endif { /* copy the bitmap into a new buffer -- ignore error */ error = ftc_sbit_copy_bitmap( sbit, bitmap, memory ); @@ -253,7 +216,7 @@ /* we mark unloaded glyphs with `sbit.buffer == 0' */ /* and 'width == 255', 'height == 0' */ /* */ - if ( error ) + if ( error && error != FT_Err_Out_Of_Memory ) { sbit->width = 255; error = 0; @@ -261,7 +224,6 @@ } } - Exit: return error; } @@ -380,16 +342,16 @@ FT_Face face; - sfam->desc = squery->desc; + sfam->type = squery->type; /* we need to compute "cquery.item_total" now */ error = FTC_Manager_Lookup_Face( manager, - squery->desc.font.face_id, + squery->type.font.face_id, &face ); if ( !error ) { error = ftc_glyph_family_init( FTC_GLYPH_FAMILY( sfam ), - FTC_IMAGE_DESC_HASH( &sfam->desc ), + FTC_IMAGE_TYPE_HASH( &sfam->type ), FTC_SBIT_ITEMS_PER_NODE, face->num_glyphs, FTC_GLYPH_QUERY( squery ), @@ -410,7 +372,7 @@ /* we need to set the "cquery.cset" field or our query for */ /* faster glyph comparisons in ftc_sbit_node_compare */ /* */ - result = FT_BOOL( FTC_IMAGE_DESC_COMPARE( &sfam->desc, &squery->desc ) ); + result = FT_BOOL( FTC_IMAGE_TYPE_COMPARE( &sfam->type, &squery->type ) ); if ( result ) FTC_GLYPH_FAMILY_FOUND( sfam, squery ); @@ -481,7 +443,7 @@ FT_EXPORT_DEF( FT_Error ) FTC_SBitCache_Lookup( FTC_SBitCache cache, - FTC_ImageDesc* desc, + FTC_ImageType type, FT_UInt gindex, FTC_SBit *ansbit, FTC_Node *anode ) @@ -501,7 +463,7 @@ *anode = NULL; squery.gquery.gindex = gindex; - squery.desc = *desc; + squery.type = *type; error = ftc_sbit_cache_lookup( FTC_CACHE( cache ), FTC_QUERY( &squery ), @@ -536,17 +498,56 @@ FT_UInt gindex, FTC_SBit *ansbit ) { - FTC_ImageDesc desc0; + FTC_ImageTypeRec type0; if ( !desc ) return FTC_Err_Invalid_Argument; - desc0.font = desc->font; - desc0.type = (FT_UInt32)desc->image_type; + type0.font = desc->font; + type0.flags = 0; + + /* convert image type flags to load flags */ + { + FT_UInt load_flags = FT_LOAD_DEFAULT; + FT_UInt type = desc->image_type; + + + /* determine load flags, depending on the font description's */ + /* image type */ + + if ( ftc_image_format( type ) == ftc_image_format_bitmap ) + { + if ( type & ftc_image_flag_monochrome ) + load_flags |= FT_LOAD_MONOCHROME; + + /* disable embedded bitmaps loading if necessary */ + if ( type & ftc_image_flag_no_sbits ) + load_flags |= FT_LOAD_NO_BITMAP; + } + else + { + /* we want an outline, don't load embedded bitmaps */ + load_flags |= FT_LOAD_NO_BITMAP; + + if ( type & ftc_image_flag_unscaled ) + load_flags |= FT_LOAD_NO_SCALE; + } + + /* always render glyphs to bitmaps */ + load_flags |= FT_LOAD_RENDER; + + if ( type & ftc_image_flag_unhinted ) + load_flags |= FT_LOAD_NO_HINTING; + + if ( type & ftc_image_flag_autohinted ) + load_flags |= FT_LOAD_FORCE_AUTOHINT; + + type0.flags = load_flags; + } return FTC_SBitCache_Lookup( (FTC_SBitCache)cache, - &desc0, + &type0, gindex, ansbit, NULL ); Index: xc/extras/freetype2/src/cache/ftlru.c diff -u xc/extras/freetype2/src/cache/ftlru.c:1.1.1.6 xc/extras/freetype2/src/cache/ftlru.c:1.1.1.7 --- xc/extras/freetype2/src/cache/ftlru.c:1.1.1.6 Thu Jun 20 04:16:16 2002 +++ xc/extras/freetype2/src/cache/ftlru.c Wed May 28 22:01:50 2003 @@ -21,6 +21,7 @@ #include FT_CACHE_INTERNAL_LRU_H #include FT_LIST_H #include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H #include "ftcerror.h" @@ -187,80 +188,135 @@ goto Exit; } - /* we haven't found the relevant element. We will now try */ - /* to create a new one. */ - /* */ - - /* first, check if our list if full, when appropriate */ - if ( list->max_nodes > 0 && list->num_nodes >= list->max_nodes ) + /* since we haven't found the relevant element in our LRU list, + * we're going to "create" a new one. + * + * the following code is a bit special, because it tries to handle + * out-of-memory conditions (OOM) in an intelligent way. + * + * more precisely, if not enough memory is available to create a + * new node or "flush" an old one, we need to remove the oldest + * elements from our list, and try again. since several tries may + * be necessary, a loop is needed + * + * this loop will only exit when: + * + * - a new node was succesfully created, or an old node flushed + * - an error other than FT_Err_Out_Of_Memory is detected + * - the list of nodes is empty, and it isn't possible to create + * new nodes + * + * on each unsucesful attempt, one node will be removed from the list + * + */ + { - /* this list list is full; we will now flush */ - /* the oldest node, if there's one! */ - FT_LruNode last = *plast; - + FT_Int drop_last = ( list->max_nodes > 0 && + list->num_nodes >= list->max_nodes ); - if ( last ) + for (;;) { - if ( clazz->node_flush ) + node = NULL; + + /* when "drop_last" is true, we should free the last node in + * the list to make room for a new one. note that we re-use + * its memory block to save allocation calls. + */ + if ( drop_last ) { - error = clazz->node_flush( last, key, list->data ); + /* find the last node in the list + */ + pnode = &list->nodes; + node = *pnode; + + if ( node == NULL ) + { + FT_ASSERT( list->nodes == 0 ); + error = FT_Err_Out_Of_Memory; + goto Exit; + } + + FT_ASSERT( list->num_nodes > 0 ); + + while ( node->next ) + { + pnode = &node->next; + node = *pnode; + } + + /* remove it from the list, and try to "flush" it. doing this will + * save a significant number of dynamic allocations compared to + * a classic destroy/create cycle + */ + *pnode = NULL; + list->num_nodes -= 1; + + if ( clazz->node_flush ) + { + error = clazz->node_flush( node, key, list->data ); + if ( !error ) + goto Success; + + /* note that if an error occured during the flush, we need to + * finalize it since it is potentially in incomplete state. + */ + } + + /* we finalize, but do not destroy the last node, we + * simply re-use its memory block ! + */ + if ( clazz->node_done ) + clazz->node_done( node, list->data ); + + FT_MEM_ZERO( node, clazz->node_size ); } else { - if ( clazz->node_done ) - clazz->node_done( last, list->data ); - - last->key = key; - error = clazz->node_init( last, key, list->data ); + /* try to allocate a new node when "drop_last" is not TRUE + * this usually happens on the first pass, when the LRU list + * is not already full. + */ + if ( FT_ALLOC( node, clazz->node_size ) ) + goto Fail; } + + FT_ASSERT( node != NULL ); - if ( !error ) + node->key = key; + error = clazz->node_init( node, key, list->data ); + if ( error ) { - /* move it to the top of the list */ - *plast = NULL; - last->next = list->nodes; - list->nodes = last; + if ( clazz->node_done ) + clazz->node_done( node, list->data ); - result = last; - goto Exit; + FT_FREE( node ); + goto Fail; } - /* in case of error during the flush or done/init cycle, */ - /* we need to discard the node */ - if ( clazz->node_done ) - clazz->node_done( last, list->data ); - - *plast = NULL; - list->num_nodes--; + Success: + result = node; - FT_FREE( last ); + node->next = list->nodes; + list->nodes = node; + list->num_nodes++; goto Exit; + + Fail: + if ( error != FT_Err_Out_Of_Memory ) + goto Exit; + + drop_last = 1; + continue; } } - /* otherwise, simply allocate a new node */ - if ( FT_ALLOC( node, clazz->node_size ) ) - goto Exit; - - node->key = key; - error = clazz->node_init( node, key, list->data ); - if ( error ) - { - FT_FREE( node ); - goto Exit; - } - - result = node; - node->next = list->nodes; - list->nodes = node; - list->num_nodes++; - Exit: *anode = result; return error; } + FT_EXPORT_DEF( void ) FT_LruList_Remove( FT_LruList list, FT_LruNode node ) Index: xc/extras/freetype2/src/cff/Jamfile diff -u xc/extras/freetype2/src/cff/Jamfile:1.1.1.1 xc/extras/freetype2/src/cff/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/cff/Jamfile:1.1.1.1 Sun Sep 9 22:56:01 2001 +++ xc/extras/freetype2/src/cff/Jamfile Wed May 28 22:01:50 2003 @@ -1,16 +1,14 @@ # FreeType 2 src/cff Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src cff ; - -SubDirHdrs [ FT2_SubDir src cff ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) cff ; { local _sources ; if $(FT2_MULTI) { - _sources = cffdrivr cffgload cffload cffobjs cffparse ; + _sources = cffdrivr cffgload cffload cffobjs cffparse cffcmap ; } else { Index: xc/extras/freetype2/src/cff/cff.c diff -u xc/extras/freetype2/src/cff/cff.c:1.1.1.3 xc/extras/freetype2/src/cff/cff.c:1.1.1.4 --- xc/extras/freetype2/src/cff/cff.c:1.1.1.3 Sun Dec 16 12:49:28 2001 +++ xc/extras/freetype2/src/cff/cff.c Wed May 28 22:01:50 2003 @@ -24,6 +24,6 @@ #include "cffload.c" #include "cffobjs.c" #include "cffgload.c" - +#include "cffcmap.c" /* END */ Index: xc/extras/freetype2/src/cff/cffcmap.c diff -u /dev/null xc/extras/freetype2/src/cff/cffcmap.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/cff/cffcmap.c Wed May 28 22:01:50 2003 @@ -0,0 +1,326 @@ +/***************************************************************************/ +/* */ +/* cffcmap.c */ +/* */ +/* CFF character mapping table (cmap) support (body). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "cffcmap.h" +#include "cffload.h" + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** CFF STANDARD (AND EXPERT) ENCODING CMAPS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_CALLBACK_DEF( FT_Error ) + cff_cmap_encoding_init( CFF_CMapStd cmap ) + { + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); + CFF_Font cff = (CFF_Font)face->extra.data; + CFF_Encoding encoding = &cff->encoding; + + + cmap->count = encoding->count; + cmap->gids = encoding->codes; + + return 0; + } + + + FT_CALLBACK_DEF( void ) + cff_cmap_encoding_done( CFF_CMapStd cmap ) + { + cmap->count = 0; + cmap->gids = NULL; + } + + + FT_CALLBACK_DEF( FT_UInt ) + cff_cmap_encoding_char_index( CFF_CMapStd cmap, + FT_UInt32 char_code ) + { + FT_UInt result = 0; + + + if ( char_code < cmap->count ) + result = cmap->gids[char_code]; + + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + cff_cmap_encoding_char_next( CFF_CMapStd cmap, + FT_UInt32 *pchar_code ) + { + FT_UInt result = 0; + FT_UInt32 char_code = *pchar_code; + + + *pchar_code = 0; + + if ( char_code < cmap->count ) + { + FT_UInt code = (FT_UInt)(char_code + 1); + + + for (;;) + { + if ( code >= cmap->count ) + break; + + result = cmap->gids[code]; + if ( result != 0 ) + { + *pchar_code = code; + break; + } + + code++; + } + } + return result; + } + + + FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec + cff_cmap_encoding_class_rec = + { + sizeof ( CFF_CMapStdRec ), + + (FT_CMap_InitFunc) cff_cmap_encoding_init, + (FT_CMap_DoneFunc) cff_cmap_encoding_done, + (FT_CMap_CharIndexFunc)cff_cmap_encoding_char_index, + (FT_CMap_CharNextFunc) cff_cmap_encoding_char_next + }; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** CFF SYNTHETIC UNICODE ENCODING CMAP *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_CALLBACK_DEF( FT_Int ) + cff_cmap_uni_pair_compare( const void* pair1, + const void* pair2 ) + { + FT_UInt32 u1 = ((CFF_CMapUniPair)pair1)->unicode; + FT_UInt32 u2 = ((CFF_CMapUniPair)pair2)->unicode; + + + if ( u1 < u2 ) + return -1; + + if ( u1 > u2 ) + return +1; + + return 0; + } + + + FT_CALLBACK_DEF( FT_Error ) + cff_cmap_unicode_init( CFF_CMapUnicode cmap ) + { + FT_Error error; + FT_UInt count; + TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); + CFF_Font cff = (CFF_Font)face->extra.data; + CFF_Charset charset = &cff->charset; + PSNames_Service psnames = (PSNames_Service)cff->psnames; + + + cmap->num_pairs = 0; + cmap->pairs = NULL; + + count = (FT_UInt)face->root.num_glyphs; + + if ( !FT_NEW_ARRAY( cmap->pairs, count ) ) + { + FT_UInt n, new_count; + CFF_CMapUniPair pair; + FT_UInt32 uni_code; + + + pair = cmap->pairs; + for ( n = 0; n < count; n++ ) + { + FT_UInt sid = charset->sids[n]; + const char* gname; + + + gname = cff_index_get_sid_string( &cff->string_index, sid, psnames ); + + /* build unsorted pair table by matching glyph names */ + if ( gname ) + { + uni_code = psnames->unicode_value( gname ); + + if ( uni_code != 0 ) + { + pair->unicode = uni_code; + pair->gindex = n; + pair++; + } + + FT_FREE( gname ); + } + } + + new_count = (FT_UInt)( pair - cmap->pairs ); + if ( new_count == 0 ) + { + /* there are no unicode characters in here! */ + FT_FREE( cmap->pairs ); + error = FT_Err_Invalid_Argument; + } + else + { + /* re-allocate if the new array is much smaller than the original */ + /* one */ + if ( new_count != count && new_count < count / 2 ) + { + (void)FT_RENEW_ARRAY( cmap->pairs, count, new_count ); + error = 0; + } + + /* sort the pairs table to allow efficient binary searches */ + ft_qsort( cmap->pairs, + new_count, + sizeof ( CFF_CMapUniPairRec ), + cff_cmap_uni_pair_compare ); + + cmap->num_pairs = new_count; + } + } + + return error; + } + + + FT_CALLBACK_DEF( void ) + cff_cmap_unicode_done( CFF_CMapUnicode cmap ) + { + FT_Face face = FT_CMAP_FACE( cmap ); + FT_Memory memory = FT_FACE_MEMORY( face ); + + + FT_FREE( cmap->pairs ); + cmap->num_pairs = 0; + } + + + FT_CALLBACK_DEF( FT_UInt ) + cff_cmap_unicode_char_index( CFF_CMapUnicode cmap, + FT_UInt32 char_code ) + { + FT_UInt min = 0; + FT_UInt max = cmap->num_pairs; + FT_UInt mid; + CFF_CMapUniPair pair; + + + while ( min < max ) + { + mid = min + ( max - min ) / 2; + pair = cmap->pairs + mid; + + if ( pair->unicode == char_code ) + return pair->gindex; + + if ( pair->unicode < char_code ) + min = mid + 1; + else + max = mid; + } + return 0; + } + + + FT_CALLBACK_DEF( FT_UInt ) + cff_cmap_unicode_char_next( CFF_CMapUnicode cmap, + FT_UInt32 *pchar_code ) + { + FT_UInt result = 0; + FT_UInt32 char_code = *pchar_code + 1; + + + Restart: + { + FT_UInt min = 0; + FT_UInt max = cmap->num_pairs; + FT_UInt mid; + CFF_CMapUniPair pair; + + + while ( min < max ) + { + mid = min + ( ( max - min ) >> 1 ); + pair = cmap->pairs + mid; + + if ( pair->unicode == char_code ) + { + result = pair->gindex; + if ( result != 0 ) + goto Exit; + + char_code++; + goto Restart; + } + + if ( pair->unicode < char_code ) + min = mid+1; + else + max = mid; + } + + /* we didn't find it, but we have a pair just above it */ + char_code = 0; + + if ( min < cmap->num_pairs ) + { + pair = cmap->pairs + min; + result = pair->gindex; + if ( result != 0 ) + char_code = pair->unicode; + } + } + + Exit: + *pchar_code = char_code; + return result; + } + + + FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec + cff_cmap_unicode_class_rec = + { + sizeof ( CFF_CMapUnicodeRec ), + + (FT_CMap_InitFunc) cff_cmap_unicode_init, + (FT_CMap_DoneFunc) cff_cmap_unicode_done, + (FT_CMap_CharIndexFunc)cff_cmap_unicode_char_index, + (FT_CMap_CharNextFunc) cff_cmap_unicode_char_next + }; + + +/* END */ Index: xc/extras/freetype2/src/cff/cffcmap.h diff -u /dev/null xc/extras/freetype2/src/cff/cffcmap.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/cff/cffcmap.h Wed May 28 22:01:50 2003 @@ -0,0 +1,88 @@ +/***************************************************************************/ +/* */ +/* cffcmap.h */ +/* */ +/* CFF character mapping table (cmap) support (specification). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __CFFCMAP_H__ +#define __CFFCMAP_H__ + +#include "cffobjs.h" + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* standard (and expert) encoding cmaps */ + typedef struct CFF_CMapStdRec_* CFF_CMapStd; + + typedef struct CFF_CMapStdRec_ + { + FT_CMapRec cmap; + FT_UInt count; + FT_UShort* gids; /* up to 256 elements */ + + } CFF_CMapStdRec; + + + FT_CALLBACK_TABLE const FT_CMap_ClassRec + cff_cmap_encoding_class_rec; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** CFF SYNTHETIC UNICODE ENCODING CMAP *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* unicode (synthetic) cmaps */ + typedef struct CFF_CMapUnicodeRec_* CFF_CMapUnicode; + + typedef struct CFF_CMapUniPairRec_ + { + FT_UInt32 unicode; + FT_UInt gindex; + + } CFF_CMapUniPairRec, *CFF_CMapUniPair; + + + typedef struct CFF_CMapUnicodeRec_ + { + FT_CMapRec cmap; + FT_UInt num_pairs; + CFF_CMapUniPair pairs; + + } CFF_CMapUnicodeRec; + + + FT_CALLBACK_TABLE const FT_CMap_ClassRec + cff_cmap_unicode_class_rec; + + +FT_END_HEADER + +#endif /* __CFFCMAP_H__ */ + + +/* END */ Index: xc/extras/freetype2/src/cff/cffdrivr.c diff -u xc/extras/freetype2/src/cff/cffdrivr.c:1.1.1.7 xc/extras/freetype2/src/cff/cffdrivr.c:1.1.1.8 --- xc/extras/freetype2/src/cff/cffdrivr.c:1.1.1.7 Thu Jun 20 04:16:16 2002 +++ xc/extras/freetype2/src/cff/cffdrivr.c Wed May 28 22:01:50 2003 @@ -118,7 +118,7 @@ while ( left <= right ) { - FT_Int middle = left + ( ( right - left ) >> 1 ); + FT_Long middle = left + ( ( right - left ) >> 1 ); FT_ULong cur_pair; @@ -177,7 +177,7 @@ Load_Glyph( CFF_GlyphSlot slot, CFF_Size size, FT_UShort glyph_index, - FT_UInt load_flags ) + FT_Int32 load_flags ) { FT_Error error; @@ -201,7 +201,7 @@ } /* now load the glyph outline if necessary */ - error = CFF_Load_Glyph( slot, size, glyph_index, load_flags ); + error = cff_slot_load( slot, size, glyph_index, load_flags ); /* force drop-out mode to 2 - irrelevant now */ /* slot->outline.dropout_mode = 2; */ @@ -253,11 +253,11 @@ sid = font->charset.sids[glyph_index]; /* now, lookup the name itself */ - gname = CFF_Get_String( &font->string_index, sid, psnames ); + gname = cff_index_get_sid_string( &font->string_index, sid, psnames ); if ( buffer_max > 0 ) { - FT_UInt len = ft_strlen( gname ); + FT_UInt len = (FT_UInt)ft_strlen( gname ); if ( len >= buffer_max ) @@ -275,94 +275,6 @@ } - /*************************************************************************/ - /* */ - /* <Function> */ - /* cff_get_char_index */ - /* */ - /* <Description> */ - /* Uses a charmap to return a given character code's glyph index. */ - /* */ - /* <Input> */ - /* charmap :: A handle to the source charmap object. */ - /* charcode :: The character code. */ - /* */ - /* <Return> */ - /* Glyph index. 0 means `undefined character code'. */ - /* */ - static FT_UInt - cff_get_char_index( TT_CharMap charmap, - FT_Long charcode ) - { - FT_Error error; - CFF_Face face; - TT_CMapTable cmap; - - - cmap = &charmap->cmap; - face = (CFF_Face)charmap->root.face; - - /* Load table if needed */ - if ( !cmap->loaded ) - { - SFNT_Service sfnt = (SFNT_Service)face->sfnt; - - - error = sfnt->load_charmap( face, cmap, face->root.stream ); - if ( error ) - return 0; - - cmap->loaded = TRUE; - } - - return ( cmap->get_index ? cmap->get_index( cmap, charcode ) : 0 ); - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* cff_get_next_char */ - /* */ - /* <Description> */ - /* Uses a charmap to return the next encoded charcode. */ - /* */ - /* <Input> */ - /* charmap :: A handle to the source charmap object. */ - /* charcode :: The character code. */ - /* */ - /* <Return> */ - /* Char code. 0 means `no encoded chars above the given one'. */ - /* */ - static FT_Long - cff_get_next_char( TT_CharMap charmap, - FT_Long charcode ) - { - FT_Error error; - CFF_Face face; - TT_CMapTable cmap; - - - cmap = &charmap->cmap; - face = (CFF_Face)charmap->root.face; - - /* Load table if needed */ - if ( !cmap->loaded ) - { - SFNT_Service sfnt = (SFNT_Service)face->sfnt; - - - error = sfnt->load_charmap( face, cmap, face->root.stream ); - if ( error ) - return 0; - - cmap->loaded = TRUE; - } - - return ( cmap->get_next_char ? cmap->get_next_char( cmap, charcode ) - : 0 ); - } - /*************************************************************************/ /* */ @@ -406,7 +318,7 @@ sid = charset->sids[i]; if ( sid > 390 ) - name = CFF_Get_Name( &cff->string_index, sid - 391 ); + name = cff_index_get_name( &cff->string_index, sid - 391 ); else name = (FT_String *)psnames->adobe_std_strings( sid ); @@ -469,7 +381,7 @@ ft_module_font_driver | ft_module_driver_scalable | ft_module_driver_has_hinter, - + sizeof( CFF_DriverRec ), "cff", 0x10000L, @@ -477,8 +389,8 @@ 0, /* module-specific interface */ - (FT_Module_Constructor)CFF_Driver_Init, - (FT_Module_Destructor) CFF_Driver_Done, + (FT_Module_Constructor)cff_driver_init, + (FT_Module_Destructor) cff_driver_done, (FT_Module_Requester) cff_get_interface, }, @@ -487,24 +399,21 @@ sizeof( FT_SizeRec ), sizeof( CFF_GlyphSlotRec ), - (FT_Face_InitFunc) CFF_Face_Init, - (FT_Face_DoneFunc) CFF_Face_Done, - (FT_Size_InitFunc) CFF_Size_Init, - (FT_Size_DoneFunc) CFF_Size_Done, - (FT_Slot_InitFunc) CFF_GlyphSlot_Init, - (FT_Slot_DoneFunc) CFF_GlyphSlot_Done, - - (FT_Size_ResetPointsFunc) CFF_Size_Reset, - (FT_Size_ResetPixelsFunc) CFF_Size_Reset, - - (FT_Slot_LoadFunc) Load_Glyph, - (FT_CharMap_CharIndexFunc)cff_get_char_index, - - (FT_Face_GetKerningFunc) Get_Kerning, - (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc) 0, - - (FT_CharMap_CharNextFunc) cff_get_next_char + (FT_Face_InitFunc) cff_face_init, + (FT_Face_DoneFunc) cff_face_done, + (FT_Size_InitFunc) cff_size_init, + (FT_Size_DoneFunc) cff_size_done, + (FT_Slot_InitFunc) cff_slot_init, + (FT_Slot_DoneFunc) cff_slot_done, + + (FT_Size_ResetPointsFunc)cff_size_reset, + (FT_Size_ResetPixelsFunc)cff_size_reset, + + (FT_Slot_LoadFunc) Load_Glyph, + + (FT_Face_GetKerningFunc) Get_Kerning, + (FT_Face_AttachFunc) 0, + (FT_Face_GetAdvancesFunc)0, }; Index: xc/extras/freetype2/src/cff/cffgload.c diff -u xc/extras/freetype2/src/cff/cffgload.c:1.1.1.5 xc/extras/freetype2/src/cff/cffgload.c:1.3 --- xc/extras/freetype2/src/cff/cffgload.c:1.1.1.5 Thu Jun 20 04:16:16 2002 +++ xc/extras/freetype2/src/cff/cffgload.c Wed Oct 22 13:26:28 2003 @@ -15,6 +15,8 @@ /* */ /***************************************************************************/ +/* $XFree86: xc/extras/freetype2/src/cff/cffgload.c,v 1.3 2003/10/22 17:26:28 tsi Exp $ */ + #include <ft2build.h> #include FT_INTERNAL_DEBUG_H @@ -207,7 +209,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* CFF_Builder_Init */ + /* cff_builder_init */ /* */ /* <Description> */ /* Initializes a given glyph builder. */ @@ -223,7 +225,7 @@ /* glyph :: The current glyph object. */ /* */ static void - CFF_Builder_Init( CFF_Builder* builder, + cff_builder_init( CFF_Builder* builder, TT_Face face, CFF_Size size, CFF_GlyphSlot glyph, @@ -246,6 +248,7 @@ builder->current = &loader->current.outline; FT_GlyphLoader_Rewind( loader ); + builder->hint_flags = FT_FACE(face)->internal->hint_flags; builder->hints_globals = 0; builder->hints_funcs = 0; @@ -275,7 +278,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* CFF_Builder_Done */ + /* cff_builder_done */ /* */ /* <Description> */ /* Finalizes a given glyph builder. Its contents can still be used */ @@ -286,7 +289,7 @@ /* builder :: A pointer to the glyph builder to finalize. */ /* */ static void - CFF_Builder_Done( CFF_Builder* builder ) + cff_builder_done( CFF_Builder* builder ) { CFF_GlyphSlot glyph = builder->glyph; @@ -330,7 +333,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* CFF_Init_Decoder */ + /* cff_decoder_init */ /* */ /* <Description> */ /* Initializes a given glyph decoder. */ @@ -346,31 +349,34 @@ /* slot :: The current glyph object. */ /* */ FT_LOCAL_DEF( void ) - CFF_Init_Decoder( CFF_Decoder* decoder, - TT_Face face, - CFF_Size size, - CFF_GlyphSlot slot, - FT_Bool hinting ) + cff_decoder_init( CFF_Decoder* decoder, + TT_Face face, + CFF_Size size, + CFF_GlyphSlot slot, + FT_Bool hinting, + FT_Render_Mode hint_mode ) { CFF_Font cff = (CFF_Font)face->extra.data; /* clear everything */ - FT_MEM_SET( decoder, 0, sizeof ( *decoder ) ); + FT_MEM_ZERO( decoder, sizeof ( *decoder ) ); /* initialize builder */ - CFF_Builder_Init( &decoder->builder, face, size, slot, hinting ); + cff_builder_init( &decoder->builder, face, size, slot, hinting ); /* initialize Type2 decoder */ decoder->num_globals = cff->num_global_subrs; decoder->globals = cff->global_subrs; decoder->globals_bias = cff_compute_bias( decoder->num_globals ); + + decoder->hint_mode = hint_mode; } /* this function is used to select the locals subrs array */ FT_LOCAL_DEF( void ) - CFF_Prepare_Decoder( CFF_Decoder* decoder, + cff_decoder_prepare( CFF_Decoder* decoder, FT_UInt glyph_index ) { CFF_Font cff = (CFF_Font)decoder->builder.face->extra.data; @@ -380,7 +386,7 @@ /* manage CID fonts */ if ( cff->num_subfonts >= 1 ) { - FT_Byte fd_index = CFF_Get_FD( &cff->fd_select, glyph_index ); + FT_Byte fd_index = cff_fd_select_get( &cff->fd_select, glyph_index ); sub = cff->subfonts[fd_index]; @@ -406,10 +412,10 @@ /* add a new point, do not check space */ static void - add_point( CFF_Builder* builder, - FT_Pos x, - FT_Pos y, - FT_Byte flag ) + cff_builder_add_point( CFF_Builder* builder, + FT_Pos x, + FT_Pos y, + FT_Byte flag ) { FT_Outline* outline = builder->current; @@ -422,7 +428,7 @@ point->x = x >> 16; point->y = y >> 16; - *control = (FT_Byte)( flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic ); + *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC ); builder->last = *point; } @@ -433,16 +439,16 @@ /* check space for a new on-curve point, then add it */ static FT_Error - add_point1( CFF_Builder* builder, - FT_Pos x, - FT_Pos y ) + cff_builder_add_point1( CFF_Builder* builder, + FT_Pos x, + FT_Pos y ) { FT_Error error; error = check_points( builder, 1 ); if ( !error ) - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); return error; } @@ -450,7 +456,7 @@ /* check room for a new contour, then add it */ static FT_Error - add_contour( CFF_Builder* builder ) + cff_builder_add_contour( CFF_Builder* builder ) { FT_Outline* outline = builder->current; FT_Error error; @@ -478,9 +484,9 @@ /* if a path was begun, add its first on-curve point */ static FT_Error - start_point( CFF_Builder* builder, - FT_Pos x, - FT_Pos y ) + cff_builder_start_point( CFF_Builder* builder, + FT_Pos x, + FT_Pos y ) { FT_Error error = 0; @@ -489,9 +495,9 @@ if ( !builder->path_begun ) { builder->path_begun = 1; - error = add_contour( builder ); + error = cff_builder_add_contour( builder ); if ( !error ) - error = add_point1( builder, x, y ); + error = cff_builder_add_point1( builder, x, y ); } return error; @@ -500,7 +506,7 @@ /* close the current contour */ static void - close_contour( CFF_Builder* builder ) + cff_builder_close_contour( CFF_Builder* builder ) { FT_Outline* outline = builder->current; @@ -524,7 +530,7 @@ /* `delete' last point only if it coincides with the first */ /* point and if it is not a control point (which can happen). */ if ( p1->x == p2->x && p1->y == p2->y ) - if ( *control == FT_Curve_Tag_On ) + if ( *control == FT_CURVE_TAG_ON ) outline->n_points--; } @@ -547,7 +553,7 @@ return -1; /* Get code to SID mapping from `cff_standard_encoding'. */ - glyph_sid = CFF_Get_Standard_Encoding( (FT_UInt)charcode ); + glyph_sid = cff_get_standard_encoding( (FT_UInt)charcode ); for ( n = 0; n < cff->num_glyphs; n++ ) { @@ -560,6 +566,77 @@ static FT_Error + cff_get_glyph_data( TT_Face face, + FT_UInt glyph_index, + FT_Byte** pointer, + FT_ULong* length ) + { +#ifdef FT_CONFIG_OPTION_INCREMENTAL + /* For incremental fonts get the character data using the */ + /* callback function. */ + if ( face->root.internal->incremental_interface ) + { + FT_Data data; + FT_Error error = + face->root.internal->incremental_interface->funcs->get_glyph_data( + face->root.internal->incremental_interface->object, + glyph_index, &data ); + + + *pointer = (FT_Byte*)data.pointer; + *length = data.length; + + return error; + } + else +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + { + CFF_Font cff = (CFF_Font)(face->extra.data); + + + return cff_index_access_element( &cff->charstrings_index, glyph_index, + pointer, length ); + } + } + + + static void + cff_free_glyph_data( TT_Face face, + FT_Byte** pointer, + FT_ULong length ) + { +#ifndef FT_CONFIG_OPTION_INCREMENTAL + FT_UNUSED( length ); +#endif + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + /* For incremental fonts get the character data using the */ + /* callback function. */ + if ( face->root.internal->incremental_interface ) + { + FT_Data data; + + + data.pointer = *pointer; + data.length = length; + + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object,&data ); + } + else +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + { + CFF_Font cff = (CFF_Font)(face->extra.data); + + + cff_index_forget_element( &cff->charstrings_index, pointer ); + } + } + + + static FT_Error cff_operator_seac( CFF_Decoder* decoder, FT_Pos adx, FT_Pos ady, @@ -570,14 +647,28 @@ FT_Int bchar_index, achar_index, n_base_points; FT_Outline* base = decoder->builder.base; TT_Face face = decoder->builder.face; - CFF_Font cff = (CFF_Font)(face->extra.data); FT_Vector left_bearing, advance; FT_Byte* charstring; FT_ULong charstring_len; - bchar_index = cff_lookup_glyph_by_stdcharcode( cff, bchar ); - achar_index = cff_lookup_glyph_by_stdcharcode( cff, achar ); +#ifdef FT_CONFIG_OPTION_INCREMENTAL + /* Incremental fonts don't necessarily have valid charsets. */ + /* They use the character code, not the glyph index, in this case. */ + if ( face->root.internal->incremental_interface ) + { + bchar_index = bchar; + achar_index = achar; + } + else +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + { + CFF_Font cff = (CFF_Font)(face->extra.data); + + + bchar_index = cff_lookup_glyph_by_stdcharcode( cff, bchar ); + achar_index = cff_lookup_glyph_by_stdcharcode( cff, achar ); + } if ( bchar_index < 0 || achar_index < 0 ) { @@ -613,28 +704,29 @@ /* subglyph 1 = accent character */ subg->index = achar_index; subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES; - subg->arg1 = adx; - subg->arg2 = ady; + subg->arg1 = (FT_Int)adx; + subg->arg2 = (FT_Int)ady; /* set up remaining glyph fields */ glyph->num_subglyphs = 2; glyph->subglyphs = loader->base.subglyphs; - glyph->format = ft_glyph_format_composite; + glyph->format = FT_GLYPH_FORMAT_COMPOSITE; loader->current.num_subglyphs = 2; } /* First load `bchar' in builder */ - error = CFF_Access_Element( &cff->charstrings_index, bchar_index, + error = cff_get_glyph_data( face, bchar_index, &charstring, &charstring_len ); if ( !error ) { - error = CFF_Parse_CharStrings( decoder, charstring, charstring_len ); + error = cff_decoder_parse_charstrings( decoder, charstring, + charstring_len ); if ( error ) goto Exit; - CFF_Forget_Element( &cff->charstrings_index, &charstring ); + cff_free_glyph_data( face, &charstring, charstring_len ); } n_base_points = base->n_points; @@ -649,16 +741,17 @@ decoder->builder.left_bearing.y = 0; /* Now load `achar' on top of the base outline. */ - error = CFF_Access_Element( &cff->charstrings_index, achar_index, + error = cff_get_glyph_data( face, achar_index, &charstring, &charstring_len ); if ( !error ) { - error = CFF_Parse_CharStrings( decoder, charstring, charstring_len ); + error = cff_decoder_parse_charstrings( decoder, charstring, + charstring_len ); if ( error ) goto Exit; - CFF_Forget_Element( &cff->charstrings_index, &charstring ); + cff_free_glyph_data( face, &charstring, charstring_len ); } /* Restore the left side bearing and advance width */ @@ -686,7 +779,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* CFF_Parse_CharStrings */ + /* cff_decoder_parse_charstrings */ /* */ /* <Description> */ /* Parses a given Type 2 charstrings program. */ @@ -703,9 +796,9 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - CFF_Parse_CharStrings( CFF_Decoder* decoder, - FT_Byte* charstring_base, - FT_Int charstring_len ) + cff_decoder_parse_charstrings( CFF_Decoder* decoder, + FT_Byte* charstring_base, + FT_ULong charstring_len ) { FT_Error error; CFF_Decoder_Zone* zone; @@ -822,7 +915,7 @@ else { FT_Fixed* args = decoder->top; - FT_Int num_args = args - decoder->stack; + FT_Int num_args = (FT_Int)( args - decoder->stack ); FT_Int req_args; @@ -1146,7 +1239,7 @@ case cff_op_rmoveto: FT_TRACE4(( " rmoveto" )); - close_contour( builder ); + cff_builder_close_contour( builder ); builder->path_begun = 0; x += args[0]; y += args[1]; @@ -1156,7 +1249,7 @@ case cff_op_vmoveto: FT_TRACE4(( " vmoveto" )); - close_contour( builder ); + cff_builder_close_contour( builder ); builder->path_begun = 0; y += args[0]; args = stack; @@ -1165,7 +1258,7 @@ case cff_op_hmoveto: FT_TRACE4(( " hmoveto" )); - close_contour( builder ); + cff_builder_close_contour( builder ); builder->path_begun = 0; x += args[0]; args = stack; @@ -1174,8 +1267,8 @@ case cff_op_rlineto: FT_TRACE4(( " rlineto" )); - if ( start_point ( builder, x, y ) || - check_points( builder, num_args / 2 ) ) + if ( cff_builder_start_point ( builder, x, y ) || + check_points( builder, num_args / 2 ) ) goto Memory_Error; if ( num_args < 2 || num_args & 1 ) @@ -1186,7 +1279,7 @@ { x += args[0]; y += args[1]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args += 2; } args = stack; @@ -1201,7 +1294,7 @@ FT_TRACE4(( op == cff_op_hlineto ? " hlineto" : " vlineto" )); - if ( start_point ( builder, x, y ) || + if ( cff_builder_start_point ( builder, x, y ) || check_points( builder, num_args ) ) goto Memory_Error; @@ -1213,7 +1306,7 @@ else y += args[0]; - if ( add_point1( builder, x, y ) ) + if ( cff_builder_add_point1( builder, x, y ) ) goto Memory_Error; args++; @@ -1230,8 +1323,8 @@ if ( num_args % 6 != 0 ) goto Stack_Underflow; - if ( start_point ( builder, x, y ) || - check_points( builder, num_args / 2 ) ) + if ( cff_builder_start_point ( builder, x, y ) || + check_points( builder, num_args / 2 ) ) goto Memory_Error; args = stack; @@ -1239,13 +1332,13 @@ { x += args[0]; y += args[1]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[2]; y += args[3]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[4]; y += args[5]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args += 6; } args = stack; @@ -1254,7 +1347,7 @@ case cff_op_vvcurveto: FT_TRACE4(( " vvcurveto" )); - if ( start_point ( builder, x, y ) ) + if ( cff_builder_start_point ( builder, x, y ) ) goto Memory_Error; args = stack; @@ -1274,12 +1367,12 @@ while ( args < decoder->top ) { y += args[0]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[1]; y += args[2]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); y += args[3]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args += 4; } args = stack; @@ -1288,7 +1381,7 @@ case cff_op_hhcurveto: FT_TRACE4(( " hhcurveto" )); - if ( start_point ( builder, x, y ) ) + if ( cff_builder_start_point ( builder, x, y ) ) goto Memory_Error; args = stack; @@ -1308,12 +1401,12 @@ while ( args < decoder->top ) { x += args[0]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[1]; y += args[2]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[3]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args += 4; } args = stack; @@ -1328,7 +1421,7 @@ FT_TRACE4(( op == cff_op_vhcurveto ? " vhcurveto" : " hvcurveto" )); - if ( start_point ( builder, x, y ) ) + if ( cff_builder_start_point ( builder, x, y ) ) goto Memory_Error; args = stack; @@ -1346,26 +1439,26 @@ if ( phase ) { x += args[0]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[1]; y += args[2]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); y += args[3]; if ( num_args == 1 ) x += args[4]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); } else { y += args[0]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[1]; y += args[2]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[3]; if ( num_args == 1 ) y += args[4]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); } args += 4; phase ^= 1; @@ -1384,8 +1477,8 @@ if ( num_args < 8 || ( num_args - 6 ) & 1 ) goto Stack_Underflow; - if ( start_point( builder, x, y ) || - check_points( builder, num_lines + 3 ) ) + if ( cff_builder_start_point( builder, x, y ) || + check_points( builder, num_lines + 3 ) ) goto Memory_Error; args = stack; @@ -1395,7 +1488,7 @@ { x += args[0]; y += args[1]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args += 2; num_lines--; } @@ -1403,13 +1496,13 @@ /* then the curve */ x += args[0]; y += args[1]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[2]; y += args[3]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[4]; y += args[5]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args = stack; } break; @@ -1424,7 +1517,7 @@ if ( num_args < 8 || ( num_args - 2 ) % 6 ) goto Stack_Underflow; - if ( start_point ( builder, x, y ) || + if ( cff_builder_start_point ( builder, x, y ) || check_points( builder, num_curves*3 + 2 ) ) goto Memory_Error; @@ -1435,13 +1528,13 @@ { x += args[0]; y += args[1]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[2]; y += args[3]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); x += args[4]; y += args[5]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args += 6; num_curves--; } @@ -1449,7 +1542,7 @@ /* then the final line */ x += args[0]; y += args[1]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args = stack; } break; @@ -1466,8 +1559,8 @@ /* adding five more points; 4 control points, 1 on-curve point */ /* make sure we have enough space for the start point if it */ /* needs to be added.. */ - if ( start_point( builder, x, y ) || - check_points( builder, 6 ) ) + if ( cff_builder_start_point( builder, x, y ) || + check_points( builder, 6 ) ) goto Memory_Error; /* Record the starting point's y postion for later use */ @@ -1476,32 +1569,32 @@ /* first control point */ x += args[0]; y += args[1]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); /* second control point */ x += args[2]; y += args[3]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); /* join point; on curve, with y-value the same as the last */ /* control point's y-value */ x += args[4]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); /* third control point, with y-value the same as the join */ /* point's y-value */ x += args[5]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); /* fourth control point */ x += args[6]; y += args[7]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); /* ending point, with y-value the same as the start */ x += args[8]; y = start_y; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args = stack; break; @@ -1517,8 +1610,8 @@ args = stack; /* adding six more points; 4 control points, 2 on-curve points */ - if ( start_point( builder, x, y ) || - check_points ( builder, 6 ) ) + if ( cff_builder_start_point( builder, x, y ) || + check_points ( builder, 6 ) ) goto Memory_Error; /* record the starting point's y-position for later use */ @@ -1526,32 +1619,32 @@ /* first control point */ x += args[0]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); /* second control point */ x += args[1]; y += args[2]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); /* join point; on curve, with y-value the same as the last */ /* control point's y-value */ x += args[3]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); /* third control point, with y-value the same as the join */ /* point's y-value */ x += args[4]; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); /* fourth control point */ x += args[5]; y = start_y; - add_point( builder, x, y, 0 ); + cff_builder_add_point( builder, x, y, 0 ); /* ending point, with y-value the same as the start point's */ /* y-value -- we don't add this point, though */ x += args[6]; - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args = stack; break; @@ -1569,8 +1662,8 @@ FT_TRACE4(( " flex1" )); /* adding six more points; 4 control points, 2 on-curve points */ - if ( start_point( builder, x, y ) || - check_points( builder, 6 ) ) + if ( cff_builder_start_point( builder, x, y ) || + check_points( builder, 6 ) ) goto Memory_Error; /* record the starting point's x, y postion for later use */ @@ -1585,8 +1678,8 @@ /* grab up to the last argument */ for ( count = 5; count > 0; count-- ) { - dx += args[0]; - dy += args[1]; + dx += (FT_Int)args[0]; + dy += (FT_Int)args[1]; args += 2; } @@ -1603,7 +1696,7 @@ { x += args[0]; y += args[1]; - add_point( builder, x, y, (FT_Bool)( count == 3 ) ); + cff_builder_add_point( builder, x, y, (FT_Bool)( count == 3 ) ); args += 2; } @@ -1619,7 +1712,7 @@ y += args[0]; } - add_point( builder, x, y, 1 ); + cff_builder_add_point( builder, x, y, 1 ); args = stack; break; @@ -1632,8 +1725,8 @@ FT_TRACE4(( " flex" )); - if ( start_point( builder, x, y ) || - check_points( builder, 6 ) ) + if ( cff_builder_start_point( builder, x, y ) || + check_points( builder, 6 ) ) goto Memory_Error; args = stack; @@ -1641,8 +1734,8 @@ { x += args[0]; y += args[1]; - add_point( builder, x, y, - (FT_Bool)( count == 3 || count == 0 ) ); + cff_builder_add_point( builder, x, y, + (FT_Bool)( count == 3 || count == 0 ) ); args += 2; } @@ -1657,15 +1750,17 @@ if ( num_args == 4 ) { error = cff_operator_seac( decoder, - args[0] >> 16, args[1] >> 16, - args[2] >> 16, args[3] >> 16 ); + args[0] >> 16, + args[1] >> 16, + (FT_Int)( args[2] >> 16 ), + (FT_Int)( args[3] >> 16 ) ); args += 4; } if ( !error ) error = CFF_Err_Ok; - close_contour( builder ); + cff_builder_close_contour( builder ); /* close hints recording session */ if ( hinter ) @@ -1676,7 +1771,8 @@ /* apply hints to the loaded glyph outline now */ hinter->apply( hinter->hints, builder->current, - (PSH_Globals)builder->hints_globals ); + (PSH_Globals)builder->hints_globals, + (FT_Render_Mode)builder->hint_flags ); } /* add current outline to the glyph slot */ @@ -1794,7 +1890,7 @@ case cff_op_index: { - FT_Int idx = args[0] >> 16; + FT_Int idx = (FT_Int)( args[0] >> 16 ); FT_TRACE4(( " index" )); @@ -1965,14 +2061,15 @@ if ( idx >= decoder->num_locals ) { - FT_ERROR(( "CFF_Parse_CharStrings:" )); + FT_ERROR(( "cff_decoder_parse_charstrings:" )); FT_ERROR(( " invalid local subr index\n" )); goto Syntax_Error; } if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS ) { - FT_ERROR(( "CFF_Parse_CharStrings: too many nested subrs\n" )); + FT_ERROR(( "cff_decoder_parse_charstrings:" + " too many nested subrs\n" )); goto Syntax_Error; } @@ -1985,7 +2082,8 @@ if ( !zone->base ) { - FT_ERROR(( "CFF_Parse_CharStrings: invoking empty subrs!\n" )); + FT_ERROR(( "cff_decoder_parse_charstrings:" + " invoking empty subrs!\n" )); goto Syntax_Error; } @@ -2005,14 +2103,15 @@ if ( idx >= decoder->num_globals ) { - FT_ERROR(( "CFF_Parse_CharStrings:" )); + FT_ERROR(( "cff_decoder_parse_charstrings:" )); FT_ERROR(( " invalid global subr index\n" )); goto Syntax_Error; } if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS ) { - FT_ERROR(( "CFF_Parse_CharStrings: too many nested subrs\n" )); + FT_ERROR(( "cff_decoder_parse_charstrings:" + " too many nested subrs\n" )); goto Syntax_Error; } @@ -2025,7 +2124,8 @@ if ( !zone->base ) { - FT_ERROR(( "CFF_Parse_CharStrings: invoking empty subrs!\n" )); + FT_ERROR(( "cff_decoder_parse_charstrings:" + " invoking empty subrs!\n" )); goto Syntax_Error; } @@ -2040,7 +2140,8 @@ if ( decoder->zone <= decoder->zones ) { - FT_ERROR(( "CFF_Parse_CharStrings: unexpected return\n" )); + FT_ERROR(( "cff_decoder_parse_charstrings:" + " unexpected return\n" )); goto Syntax_Error; } @@ -2072,15 +2173,15 @@ return error; Syntax_Error: - FT_TRACE4(( "CFF_Parse_CharStrings: syntax error!" )); + FT_TRACE4(( "cff_decoder_parse_charstrings: syntax error!" )); return CFF_Err_Invalid_File_Format; Stack_Underflow: - FT_TRACE4(( "CFF_Parse_CharStrings: stack underflow!" )); + FT_TRACE4(( "cff_decoder_parse_charstrings: stack underflow!" )); return CFF_Err_Too_Few_Arguments; Stack_Overflow: - FT_TRACE4(( "CFF_Parse_CharStrings: stack overflow!" )); + FT_TRACE4(( "cff_decoder_parse_charstrings: stack overflow!" )); return CFF_Err_Stack_Overflow; Memory_Error: @@ -2110,7 +2211,7 @@ FT_LOCAL_DEF( FT_Error ) - CFF_Compute_Max_Advance( TT_Face face, + cff_compute_max_advance( TT_Face face, FT_Int* max_advance ) { FT_Error error = 0; @@ -2122,7 +2223,7 @@ *max_advance = 0; /* Initialize load decoder */ - CFF_Init_Decoder( &decoder, face, 0, 0, 0 ); + cff_decoder_init( &decoder, face, 0, 0, 0, 0 ); decoder.builder.metrics_only = 1; decoder.builder.load_points = 0; @@ -2137,14 +2238,15 @@ /* now get load the unscaled outline */ - error = CFF_Access_Element( &cff->charstrings_index, glyph_index, + error = cff_get_glyph_data( face, glyph_index, &charstring, &charstring_len ); if ( !error ) { - CFF_Prepare_Decoder( &decoder, glyph_index ); - error = CFF_Parse_CharStrings( &decoder, charstring, charstring_len ); + cff_decoder_prepare( &decoder, glyph_index ); + error = cff_decoder_parse_charstrings( &decoder, + charstring, charstring_len ); - CFF_Forget_Element( &cff->charstrings_index, &charstring ); + cff_free_glyph_data( face, &charstring, &charstring_len ); } /* ignore the error if one has occurred -- skip to next glyph */ @@ -2177,10 +2279,10 @@ FT_LOCAL_DEF( FT_Error ) - CFF_Load_Glyph( CFF_GlyphSlot glyph, - CFF_Size size, - FT_Int glyph_index, - FT_Int load_flags ) + cff_slot_load( CFF_GlyphSlot glyph, + CFF_Size size, + FT_Int glyph_index, + FT_Int32 load_flags ) { FT_Error error; CFF_Decoder decoder; @@ -2209,44 +2311,83 @@ hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 && ( load_flags & FT_LOAD_NO_HINTING ) == 0 ); - glyph->root.format = ft_glyph_format_outline; /* by default */ + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; /* by default */ { FT_Byte* charstring; FT_ULong charstring_len; - CFF_Init_Decoder( &decoder, face, size, glyph, hinting ); + cff_decoder_init( &decoder, face, size, glyph, hinting, + FT_LOAD_TARGET_MODE(load_flags) ); decoder.builder.no_recurse = (FT_Bool)( ( load_flags & FT_LOAD_NO_RECURSE ) != 0 ); /* now load the unscaled outline */ - error = CFF_Access_Element( &cff->charstrings_index, glyph_index, + error = cff_get_glyph_data( face, glyph_index, &charstring, &charstring_len ); if ( !error ) { - CFF_IndexRec csindex = cff->charstrings_index; + cff_decoder_prepare( &decoder, glyph_index ); + error = cff_decoder_parse_charstrings( &decoder, + charstring, charstring_len ); + cff_free_glyph_data( face, &charstring, charstring_len ); - CFF_Prepare_Decoder( &decoder, glyph_index ); - error = CFF_Parse_CharStrings( &decoder, charstring, charstring_len ); - CFF_Forget_Element( &cff->charstrings_index, &charstring ); +#ifdef FT_CONFIG_OPTION_INCREMENTAL + /* Control data and length may not be available for incremental */ + /* fonts. */ + if ( face->root.internal->incremental_interface ) + { + glyph->root.control_data = 0; + glyph->root.control_len = 0; + } + else +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ /* We set control_data and control_len if charstrings is loaded. */ - /* See how charstring loads at CFF_Access_Element() in cffload.c. */ + /* See how charstring loads at cff_index_access_element() in */ + /* cffload.c. */ + { + CFF_IndexRec csindex = cff->charstrings_index; + - glyph->root.control_data = - csindex.bytes + csindex.offsets[glyph_index] - 1; - glyph->root.control_len = - charstring_len; + glyph->root.control_data = + csindex.bytes + csindex.offsets[glyph_index] - 1; + glyph->root.control_len = + charstring_len; + } } /* save new glyph tables */ - CFF_Builder_Done( &decoder.builder ); + cff_builder_done( &decoder.builder ); } +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* Incremental fonts can optionally override the metrics. */ + if ( !error && + face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs->get_glyph_metrics ) + { + FT_Incremental_MetricsRec metrics; + + metrics.bearing_x = decoder.builder.left_bearing.x; + metrics.bearing_y = decoder.builder.left_bearing.y; + metrics.advance = decoder.builder.advance.x; + error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, FALSE, &metrics ); + decoder.builder.left_bearing.x = metrics.bearing_x; + decoder.builder.left_bearing.y = metrics.bearing_y; + decoder.builder.advance.x = metrics.advance; + decoder.builder.advance.y = 0; + } + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + font_matrix = cff->top_font.font_dict.font_matrix; font_offset = cff->top_font.font_dict.font_offset; @@ -2286,13 +2427,13 @@ glyph->root.linearVertAdvance = 0; - glyph->root.format = ft_glyph_format_outline; + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; glyph->root.outline.flags = 0; if ( size && size->metrics.y_ppem < 24 ) - glyph->root.outline.flags |= ft_outline_high_precision; + glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION; - glyph->root.outline.flags |= ft_outline_reverse_fill; + glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL; /* apply the font matrix */ FT_Outline_Transform( &glyph->root.outline, &font_matrix ); Index: xc/extras/freetype2/src/cff/cffgload.h diff -u xc/extras/freetype2/src/cff/cffgload.h:1.1.1.4 xc/extras/freetype2/src/cff/cffgload.h:1.1.1.5 --- xc/extras/freetype2/src/cff/cffgload.h:1.1.1.4 Thu Jun 20 04:16:16 2002 +++ xc/extras/freetype2/src/cff/cffgload.h Wed May 28 22:01:51 2003 @@ -114,6 +114,8 @@ FT_Error error; /* only used for memory errors */ FT_Bool metrics_only; + FT_UInt32 hint_flags; + void* hints_funcs; /* hinter-specific */ void* hints_globals; /* hinter-specific */ @@ -166,39 +168,42 @@ FT_Byte** glyph_names; /* for pure CFF fonts only */ FT_UInt num_glyphs; /* number of glyphs in font */ + FT_Render_Mode hint_mode; + } CFF_Decoder; FT_LOCAL( void ) - CFF_Init_Decoder( CFF_Decoder* decoder, - TT_Face face, - CFF_Size size, - CFF_GlyphSlot slot, - FT_Bool hinting ); + cff_decoder_init( CFF_Decoder* decoder, + TT_Face face, + CFF_Size size, + CFF_GlyphSlot slot, + FT_Bool hinting, + FT_Render_Mode hint_mode ); FT_LOCAL( void ) - CFF_Prepare_Decoder( CFF_Decoder* decoder, + cff_decoder_prepare( CFF_Decoder* decoder, FT_UInt glyph_index ); #if 0 /* unused until we support pure CFF fonts */ /* Compute the maximum advance width of a font through quick parsing */ FT_LOCAL( FT_Error ) - CFF_Compute_Max_Advance( TT_Face face, + cff_compute_max_advance( TT_Face face, FT_Int* max_advance ); #endif /* 0 */ FT_LOCAL( FT_Error ) - CFF_Parse_CharStrings( CFF_Decoder* decoder, - FT_Byte* charstring_base, - FT_Int charstring_len ); + cff_decoder_parse_charstrings( CFF_Decoder* decoder, + FT_Byte* charstring_base, + FT_ULong charstring_len ); FT_LOCAL( FT_Error ) - CFF_Load_Glyph( CFF_GlyphSlot glyph, - CFF_Size size, - FT_Int glyph_index, - FT_Int load_flags ); + cff_slot_load( CFF_GlyphSlot glyph, + CFF_Size size, + FT_Int glyph_index, + FT_Int32 load_flags ); FT_END_HEADER Index: xc/extras/freetype2/src/cff/cffload.c diff -u xc/extras/freetype2/src/cff/cffload.c:1.1.1.5 xc/extras/freetype2/src/cff/cffload.c:1.1.1.6 --- xc/extras/freetype2/src/cff/cffload.c:1.1.1.5 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cff/cffload.c Wed May 28 22:01:51 2003 @@ -1047,7 +1047,7 @@ FT_LOCAL_DEF( FT_UShort ) - CFF_Get_Standard_Encoding( FT_UInt charcode ) + cff_get_standard_encoding( FT_UInt charcode ) { return (FT_UShort)(charcode < 256 ? cff_standard_encoding[charcode] : 0); } @@ -1091,7 +1091,7 @@ FT_UShort count; - FT_MEM_SET( idx, 0, sizeof ( *idx ) ); + FT_MEM_ZERO( idx, sizeof ( *idx ) ); idx->stream = stream; if ( !FT_READ_USHORT( count ) && @@ -1167,18 +1167,19 @@ FT_FRAME_RELEASE( idx->bytes ); FT_FREE( idx->offsets ); - FT_MEM_SET( idx, 0, sizeof ( *idx ) ); + FT_MEM_ZERO( idx, sizeof ( *idx ) ); } } + /* allocate a table containing pointers to an index's elements */ static FT_Error - cff_explicit_index( CFF_Index idx, - FT_Byte*** table ) + cff_index_get_pointers( CFF_Index idx, + FT_Byte*** table ) { FT_Error error = 0; FT_Memory memory = idx->stream->memory; - FT_UInt n, offset, old_offset; + FT_ULong n, offset, old_offset; FT_Byte** t; @@ -1205,10 +1206,10 @@ FT_LOCAL_DEF( FT_Error ) - CFF_Access_Element( CFF_Index idx, - FT_UInt element, - FT_Byte** pbytes, - FT_ULong* pbyte_len ) + cff_index_access_element( CFF_Index idx, + FT_UInt element, + FT_Byte** pbytes, + FT_ULong* pbyte_len ) { FT_Error error = 0; @@ -1270,8 +1271,8 @@ FT_LOCAL_DEF( void ) - CFF_Forget_Element( CFF_Index idx, - FT_Byte** pbytes ) + cff_index_forget_element( CFF_Index idx, + FT_Byte** pbytes ) { if ( idx->bytes == 0 ) { @@ -1284,8 +1285,8 @@ FT_LOCAL_DEF( FT_String* ) - CFF_Get_Name( CFF_Index idx, - FT_UInt element ) + cff_index_get_name( CFF_Index idx, + FT_UInt element ) { FT_Memory memory = idx->stream->memory; FT_Byte* bytes; @@ -1294,7 +1295,7 @@ FT_String* name = 0; - error = CFF_Access_Element( idx, element, &bytes, &byte_len ); + error = cff_index_access_element( idx, element, &bytes, &byte_len ); if ( error ) goto Exit; @@ -1303,7 +1304,7 @@ FT_MEM_COPY( name, bytes, byte_len ); name[byte_len] = 0; } - CFF_Forget_Element( idx, &bytes ); + cff_index_forget_element( idx, &bytes ); Exit: return name; @@ -1311,18 +1312,18 @@ FT_LOCAL_DEF( FT_String* ) - CFF_Get_String( CFF_Index idx, - FT_UInt sid, - PSNames_Service psnames_interface ) + cff_index_get_sid_string( CFF_Index idx, + FT_UInt sid, + PSNames_Service psnames_service ) { /* if it is not a standard string, return it */ if ( sid > 390 ) - return CFF_Get_Name( idx, sid - 391 ); + return cff_index_get_name( idx, sid - 391 ); /* that's a standard string, fetch a copy from the PSName module */ { FT_String* name = 0; - const char* adobe_name = psnames_interface->adobe_std_strings( sid ); + const char* adobe_name = psnames_service->adobe_std_strings( sid ); FT_UInt len; @@ -1357,20 +1358,20 @@ static void - CFF_Done_FD_Select( CFF_FDSelect select, + CFF_Done_FD_Select( CFF_FDSelect fdselect, FT_Stream stream ) { - if ( select->data ) - FT_FRAME_RELEASE( select->data ); + if ( fdselect->data ) + FT_FRAME_RELEASE( fdselect->data ); - select->data_size = 0; - select->format = 0; - select->range_count = 0; + fdselect->data_size = 0; + fdselect->format = 0; + fdselect->range_count = 0; } static FT_Error - CFF_Load_FD_Select( CFF_FDSelect select, + CFF_Load_FD_Select( CFF_FDSelect fdselect, FT_UInt num_glyphs, FT_Stream stream, FT_ULong offset ) @@ -1384,23 +1385,23 @@ if ( FT_STREAM_SEEK( offset ) || FT_READ_BYTE( format ) ) goto Exit; - select->format = format; - select->cache_count = 0; /* clear cache */ + fdselect->format = format; + fdselect->cache_count = 0; /* clear cache */ switch ( format ) { case 0: /* format 0, that's simple */ - select->data_size = num_glyphs; + fdselect->data_size = num_glyphs; goto Load_Data; case 3: /* format 3, a tad more complex */ if ( FT_READ_USHORT( num_ranges ) ) goto Exit; - select->data_size = num_ranges * 3 + 2; + fdselect->data_size = num_ranges * 3 + 2; Load_Data: - if ( FT_FRAME_EXTRACT( select->data_size, select->data ) ) + if ( FT_FRAME_EXTRACT( fdselect->data_size, fdselect->data ) ) goto Exit; break; @@ -1414,30 +1415,31 @@ FT_LOCAL_DEF( FT_Byte ) - CFF_Get_FD( CFF_FDSelect select, - FT_UInt glyph_index ) + cff_fd_select_get( CFF_FDSelect fdselect, + FT_UInt glyph_index ) { FT_Byte fd = 0; - switch ( select->format ) + switch ( fdselect->format ) { case 0: - fd = select->data[glyph_index]; + fd = fdselect->data[glyph_index]; break; case 3: /* first, compare to cache */ - if ( (FT_UInt)(glyph_index-select->cache_first) < select->cache_count ) + if ( (FT_UInt)( glyph_index - fdselect->cache_first ) < + fdselect->cache_count ) { - fd = select->cache_fd; + fd = fdselect->cache_fd; break; } /* then, lookup the ranges array */ { - FT_Byte* p = select->data; - FT_Byte* p_limit = p + select->data_size; + FT_Byte* p = fdselect->data; + FT_Byte* p_limit = p + fdselect->data_size; FT_Byte fd2; FT_UInt first, limit; @@ -1456,9 +1458,9 @@ fd = fd2; /* update cache */ - select->cache_first = first; - select->cache_count = limit-first; - select->cache_fd = fd2; + fdselect->cache_first = first; + fdselect->cache_count = limit-first; + fdselect->cache_fd = fd2; break; } first = limit; @@ -1484,23 +1486,7 @@ /*************************************************************************/ static void - CFF_Done_Encoding( CFF_Encoding encoding, - FT_Stream stream ) - { - FT_Memory memory = stream->memory; - - - FT_FREE( encoding->codes ); - FT_FREE( encoding->sids ); - encoding->format = 0; - encoding->offset = 0; - encoding->codes = 0; - encoding->sids = 0; - } - - - static void - CFF_Done_Charset( CFF_Charset charset, + cff_charset_done( CFF_Charset charset, FT_Stream stream ) { FT_Memory memory = stream->memory; @@ -1509,12 +1495,11 @@ FT_FREE( charset->sids ); charset->format = 0; charset->offset = 0; - charset->sids = 0; } static FT_Error - CFF_Load_Charset( CFF_Charset charset, + cff_charset_load( CFF_Charset charset, FT_UInt num_glyphs, FT_Stream stream, FT_ULong base_offset, @@ -1525,13 +1510,6 @@ FT_UShort glyph_sid; - charset->offset = base_offset + offset; - - /* Get the format of the table. */ - if ( FT_STREAM_SEEK( charset->offset ) || - FT_READ_BYTE( charset->format ) ) - goto Exit; - /* If the the offset is greater than 2, we have to parse the */ /* charset table. */ if ( offset > 2 ) @@ -1539,6 +1517,13 @@ FT_UInt j; + charset->offset = base_offset + offset; + + /* Get the format of the table. */ + if ( FT_STREAM_SEEK( charset->offset ) || + FT_READ_BYTE( charset->format ) ) + goto Exit; + /* Allocate memory for sids. */ if ( FT_NEW_ARRAY( charset->sids, num_glyphs ) ) goto Exit; @@ -1549,12 +1534,15 @@ switch ( charset->format ) { case 0: - for ( j = 1; j < num_glyphs; j++ ) + if ( num_glyphs > 0 ) { - if ( FT_READ_USHORT( glyph_sid ) ) + if ( FT_FRAME_ENTER( ( num_glyphs - 1 ) * 2 ) ) goto Exit; - charset->sids[j] = glyph_sid; + for ( j = 1; j < num_glyphs; j++ ) + charset->sids[j] = FT_GET_USHORT(); + + FT_FRAME_EXIT(); } break; @@ -1587,14 +1575,14 @@ } /* Fill in the range of sids -- `nleft + 1' glyphs. */ - for ( i = 0; i <= nleft; i++, j++, glyph_sid++ ) + for ( i = 0; j < num_glyphs && i <= nleft; i++, j++, glyph_sid++ ) charset->sids[j] = glyph_sid; } } break; default: - FT_ERROR(( "CFF_Load_Charset: invalid table format!\n" )); + FT_ERROR(( "cff_charset_load: invalid table format!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; } @@ -1607,15 +1595,16 @@ /* In order to use a predefined charset, the following must be */ /* true: The charset constructed for the glyphs in the font's */ /* charstrings dictionary must match the predefined charset in */ - /* the first num_glyphs, and hence must match the predefined */ - /* charset *exactly*. */ + /* the first num_glyphs */ - switch ( offset ) + charset->offset = offset; /* record charset type */ + + switch ( (FT_UInt)offset ) { case 0: - if ( num_glyphs != 229 ) + if ( num_glyphs > 229 ) { - FT_ERROR(("CFF_Load_Charset: implicit charset not equal to\n" + FT_ERROR(("cff_charset_load: implicit charset larger than\n" "predefined charset (Adobe ISO-Latin)!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; @@ -1632,9 +1621,9 @@ break; case 1: - if ( num_glyphs != 166 ) + if ( num_glyphs > 166 ) { - FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to\n" + FT_ERROR(( "cff_charset_load: implicit charset larger than\n" "predefined charset (Adobe Expert)!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; @@ -1651,9 +1640,9 @@ break; case 2: - if ( num_glyphs != 87 ) + if ( num_glyphs > 87 ) { - FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to\n" + FT_ERROR(( "cff_charset_load: implicit charset larger than\n" "predefined charset (Adobe Expert Subset)!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; @@ -1681,8 +1670,7 @@ if ( error ) if ( charset->sids ) { - if ( charset->sids ) - FT_FREE( charset->sids ); + FT_FREE( charset->sids ); charset->format = 0; charset->offset = 0; charset->sids = 0; @@ -1692,20 +1680,30 @@ } + + static void + cff_encoding_done( CFF_Encoding encoding ) + { + encoding->format = 0; + encoding->offset = 0; + encoding->count = 0; + } + + + static FT_Error - CFF_Load_Encoding( CFF_Encoding encoding, + cff_encoding_load( CFF_Encoding encoding, CFF_Charset charset, FT_UInt num_glyphs, FT_Stream stream, FT_ULong base_offset, FT_ULong offset ) { - FT_Memory memory = stream->memory; FT_Error error = 0; FT_UInt count; FT_UInt j; FT_UShort glyph_sid; - FT_Byte glyph_code; + FT_UInt glyph_code; /* Check for charset->sids. If we do not have this, we fail. */ @@ -1715,14 +1713,8 @@ goto Exit; } - /* Allocate memory for sids/codes -- there are at most 256 sids/codes */ - /* for an encoding. */ - if ( FT_NEW_ARRAY( encoding->sids, 256 ) || - FT_NEW_ARRAY( encoding->codes, 256 ) ) - goto Exit; - /* Zero out the code to gid/sid mappings. */ - for ( j = 0; j < 255; j++ ) + for ( j = 0; j < 256; j++ ) { encoding->sids [j] = 0; encoding->codes[j] = 0; @@ -1754,22 +1746,37 @@ switch ( encoding->format & 0x7F ) { case 0: - for ( j = 1; j <= count; j++ ) { - if ( FT_READ_BYTE( glyph_code ) ) - goto Exit; + FT_Byte* p; + + /* by convention, GID 0 is always ".notdef" and is never */ + /* coded in the font. Hence, the number of codes found */ + /* in the table is 'count+1' */ + /* */ + encoding->count = count + 1; - /* Make sure j is not too big. */ - if ( j > num_glyphs ) + if ( FT_FRAME_ENTER( count ) ) goto Exit; - /* Assign code to GID mapping. */ - encoding->codes[glyph_code] = (FT_UShort)j; + p = (FT_Byte*)stream->cursor; - /* Assign code to SID mapping. */ - encoding->sids[glyph_code] = charset->sids[j]; - } + for ( j = 1; j <= count; j++ ) + { + glyph_code = *p++; + + /* Make sure j is not too big. */ + if ( j < num_glyphs ) + { + /* Assign code to GID mapping. */ + encoding->codes[glyph_code] = (FT_UShort)j; + + /* Assign code to SID mapping. */ + encoding->sids[glyph_code] = charset->sids[j]; + } + } + FT_FRAME_EXIT(); + } break; case 1: @@ -1779,6 +1786,8 @@ FT_UInt k; + encoding->count = 0; + /* Parse the Format1 ranges. */ for ( j = 0; j < count; j++, i += nleft ) { @@ -1793,25 +1802,33 @@ /* Increment nleft, so we read `nleft + 1' codes/sids. */ nleft++; + /* compute max number of character codes */ + if ( (FT_UInt)nleft > encoding->count ) + encoding->count = nleft; + /* Fill in the range of codes/sids. */ for ( k = i; k < nleft + i; k++, glyph_code++ ) { /* Make sure k is not too big. */ - if ( k > num_glyphs ) - goto Exit; - - /* Assign code to GID mapping. */ - encoding->codes[glyph_code] = (FT_UShort)k; - - /* Assign code to SID mapping. */ - encoding->sids[glyph_code] = charset->sids[k]; + if ( k < num_glyphs && glyph_code < 256 ) + { + /* Assign code to GID mapping. */ + encoding->codes[glyph_code] = (FT_UShort)k; + + /* Assign code to SID mapping. */ + encoding->sids[glyph_code] = charset->sids[k]; + } } } + + /* simple check, one never knows what can be found in a font */ + if ( encoding->count > 256 ) + encoding->count = 256; } break; default: - FT_ERROR(( "CFF_Load_Encoding: invalid table format!\n" )); + FT_ERROR(( "cff_encoding_load: invalid table format!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; } @@ -1819,7 +1836,7 @@ /* Parse supplemental encodings, if any. */ if ( encoding->format & 0x80 ) { - FT_UInt glyph_id; + FT_UInt gindex; /* count supplements */ @@ -1841,14 +1858,14 @@ /* First, lookup GID which has been assigned to */ /* SID glyph_sid. */ - for ( glyph_id = 0; glyph_id < num_glyphs; glyph_id++ ) + for ( gindex = 0; gindex < num_glyphs; gindex++ ) { - if ( charset->sids[glyph_id] == glyph_sid ) + if ( charset->sids[gindex] == glyph_sid ) + { + encoding->codes[glyph_code] = (FT_UShort) gindex; break; + } } - - /* Now, make the assignment. */ - encoding->codes[glyph_code] = (FT_UShort)glyph_id; } } } @@ -1862,46 +1879,27 @@ /* encoding (see the note at the end of section 12 in the CFF */ /* specification). */ - switch ( offset ) + switch ( (FT_UInt)offset ) { case 0: /* First, copy the code to SID mapping. */ FT_MEM_COPY( encoding->sids, cff_standard_encoding, 256 * sizeof ( FT_UShort ) ); - /* Construct code to GID mapping from code */ - /* to SID mapping and charset. */ - for ( j = 0; j < 256; j++ ) - { - /* If j is encoded, find the GID for it. */ - if ( encoding->sids[j] ) - { - for ( i = 1; i < num_glyphs; i++ ) - /* We matched, so break. */ - if ( charset->sids[i] == encoding->sids[j] ) - break; - - /* i will be equal to num_glyphs if we exited the above */ - /* loop without a match. In this case, we also have to */ - /* fix the code to SID mapping. */ - if ( i == num_glyphs ) - { - encoding->codes[j] = 0; - encoding->sids [j] = 0; - } - else - encoding->codes[j] = (FT_UShort)i; - } - } - break; + goto Populate; case 1: /* First, copy the code to SID mapping. */ FT_MEM_COPY( encoding->sids, cff_expert_encoding, 256 * sizeof ( FT_UShort ) ); + Populate: /* Construct code to GID mapping from code to SID mapping */ /* and charset. */ + + encoding->count = 0; + + for ( j = 0; j < 256; j++ ) { /* If j is encoded, find the GID for it. */ @@ -1921,13 +1919,19 @@ encoding->sids [j] = 0; } else + { encoding->codes[j] = (FT_UShort)i; + + /* update encoding count */ + if ( encoding->count < j+1 ) + encoding->count = j+1; + } } } break; default: - FT_ERROR(( "CFF_Load_Encoding: invalid table format!\n" )); + FT_ERROR(( "cff_encoding_load: invalid table format!\n" )); error = CFF_Err_Invalid_File_Format; goto Exit; } @@ -1936,28 +1940,12 @@ Exit: /* Clean up if there was an error. */ - if ( error ) - { - if ( encoding->sids || encoding->codes ) - { - if ( encoding->sids ) - FT_FREE( encoding->sids ); - - if ( encoding->codes ) - FT_FREE( encoding->codes ); - - charset->format = 0; - charset->offset = 0; - charset->sids = 0; - } - } - return error; } static FT_Error - CFF_Load_SubFont( CFF_SubFont font, + cff_subfont_load( CFF_SubFont font, CFF_Index idx, FT_UInt font_index, FT_Stream stream, @@ -1971,10 +1959,10 @@ CFF_Private priv = &font->private_dict; - CFF_Parser_Init( &parser, CFF_CODE_TOPDICT, &font->font_dict ); + cff_parser_init( &parser, CFF_CODE_TOPDICT, &font->font_dict ); /* set defaults */ - FT_MEM_SET( top, 0, sizeof ( *top ) ); + FT_MEM_ZERO( top, sizeof ( *top ) ); top->underline_position = -100; top->underline_thickness = 50; @@ -1983,10 +1971,10 @@ top->font_matrix.yy = 0x10000L; top->cid_count = 8720; - error = CFF_Access_Element( idx, font_index, &dict, &dict_len ) || - CFF_Parser_Run( &parser, dict, dict + dict_len ); + error = cff_index_access_element( idx, font_index, &dict, &dict_len ) || + cff_parser_run( &parser, dict, dict + dict_len ); - CFF_Forget_Element( idx, &dict ); + cff_index_forget_element( idx, &dict ); if ( error ) goto Exit; @@ -1999,7 +1987,7 @@ if ( top->private_offset && top->private_size ) { /* set defaults */ - FT_MEM_SET( priv, 0, sizeof ( *priv ) ); + FT_MEM_ZERO( priv, sizeof ( *priv ) ); priv->blue_shift = 7; priv->blue_fuzz = 1; @@ -2007,15 +1995,15 @@ priv->expansion_factor = (FT_Fixed)0.06 * 0x10000L; priv->blue_scale = (FT_Fixed)0.039625 * 0x10000L; - CFF_Parser_Init( &parser, CFF_CODE_PRIVATE, priv ); + cff_parser_init( &parser, CFF_CODE_PRIVATE, priv ); if ( FT_STREAM_SEEK( base_offset + font->font_dict.private_offset ) || FT_FRAME_ENTER( font->font_dict.private_size ) ) goto Exit; - error = CFF_Parser_Run( &parser, - (FT_Byte*)stream->cursor, - (FT_Byte*)stream->limit ); + error = cff_parser_run( &parser, + (FT_Byte*)stream->cursor, + (FT_Byte*)stream->limit ); FT_FRAME_EXIT(); if ( error ) goto Exit; @@ -2033,8 +2021,8 @@ goto Exit; font->num_local_subrs = font->local_subrs_index.count; - error = cff_explicit_index( &font->local_subrs_index, - &font->local_subrs ); + error = cff_index_get_pointers( &font->local_subrs_index, + &font->local_subrs ); if ( error ) goto Exit; } @@ -2045,7 +2033,7 @@ static void - CFF_Done_SubFont( FT_Memory memory, + cff_subfont_done( FT_Memory memory, CFF_SubFont subfont ) { if ( subfont ) @@ -2057,7 +2045,7 @@ FT_LOCAL_DEF( FT_Error ) - CFF_Load_Font( FT_Stream stream, + cff_font_load( FT_Stream stream, FT_Int face_index, CFF_Font font ) { @@ -2079,8 +2067,7 @@ FT_ULong base_offset; CFF_FontRecDict dict; - - FT_MEM_SET( font, 0, sizeof ( *font ) ); + FT_ZERO( font ); font->stream = stream; font->memory = memory; @@ -2116,7 +2103,7 @@ font->num_faces = font->name_index.count; if ( face_index >= (FT_Int)font->num_faces ) { - FT_ERROR(( "CFF_Load_Font: incorrect face index = %d\n", + FT_ERROR(( "cff_font_load: incorrect face index = %d\n", face_index )); error = CFF_Err_Invalid_Argument; } @@ -2126,7 +2113,7 @@ goto Exit; /* now, parse the top-level font dictionary */ - error = CFF_Load_SubFont( &font->top_font, + error = cff_subfont_load( &font->top_font, &font->font_dict_index, face_index, stream, @@ -2153,7 +2140,7 @@ if ( fd_index.count > CFF_MAX_CID_FONTS ) { - FT_ERROR(( "CFF_Load_Font: FD array too large in CID font\n" )); + FT_ERROR(( "cff_font_load: FD array too large in CID font\n" )); goto Fail_CID; } @@ -2170,7 +2157,7 @@ for ( idx = 0; idx < fd_index.count; idx++ ) { sub = font->subfonts[idx]; - error = CFF_Load_SubFont( sub, &fd_index, idx, + error = cff_subfont_load( sub, &fd_index, idx, stream, base_offset ); if ( error ) goto Fail_CID; @@ -2178,7 +2165,7 @@ /* now load the FD Select array */ error = CFF_Load_FD_Select( &font->fd_select, - dict->cid_count, + (FT_UInt)dict->cid_count, stream, base_offset + dict->cid_fd_select_offset ); @@ -2194,7 +2181,7 @@ /* read the charstrings index now */ if ( dict->charstrings_offset == 0 ) { - FT_ERROR(( "CFF_Load_Font: no charstrings offset!\n" )); + FT_ERROR(( "cff_font_load: no charstrings offset!\n" )); error = CFF_Err_Unknown_File_Format; goto Exit; } @@ -2210,29 +2197,32 @@ font->num_global_subrs = font->global_subrs_index.count; font->num_glyphs = font->charstrings_index.count; - error = cff_explicit_index( &font->global_subrs_index, - &font->global_subrs ) ; + error = cff_index_get_pointers( &font->global_subrs_index, + &font->global_subrs ) ; if ( error ) goto Exit; /* read the Charset and Encoding tables when available */ - error = CFF_Load_Charset( &font->charset, font->num_glyphs, stream, + if ( font->num_glyphs > 0 ) + { + error = cff_charset_load( &font->charset, font->num_glyphs, stream, base_offset, dict->charset_offset ); - if ( error ) - goto Exit; + if ( error ) + goto Exit; - error = CFF_Load_Encoding( &font->encoding, - &font->charset, - font->num_glyphs, - stream, - base_offset, - dict->encoding_offset ); - if ( error ) - goto Exit; + error = cff_encoding_load( &font->encoding, + &font->charset, + font->num_glyphs, + stream, + base_offset, + dict->encoding_offset ); + if ( error ) + goto Exit; + } /* get the font name */ - font->font_name = CFF_Get_Name( &font->name_index, face_index ); + font->font_name = cff_index_get_name( &font->name_index, face_index ); Exit: return error; @@ -2240,7 +2230,7 @@ FT_LOCAL_DEF( void ) - CFF_Done_Font( CFF_Font font ) + cff_font_done( CFF_Font font ) { FT_Memory memory = font->memory; FT_UInt idx; @@ -2257,15 +2247,15 @@ if ( font->num_subfonts > 0 ) { for ( idx = 0; idx < font->num_subfonts; idx++ ) - CFF_Done_SubFont( memory, font->subfonts[idx] ); + cff_subfont_done( memory, font->subfonts[idx] ); FT_FREE( font->subfonts ); } - CFF_Done_Encoding( &font->encoding, font->stream ); - CFF_Done_Charset( &font->charset, font->stream ); + cff_encoding_done( &font->encoding ); + cff_charset_done( &font->charset, font->stream ); - CFF_Done_SubFont( memory, &font->top_font ); + cff_subfont_done( memory, &font->top_font ); CFF_Done_FD_Select( &font->fd_select, font->stream ); Index: xc/extras/freetype2/src/cff/cffload.h diff -u xc/extras/freetype2/src/cff/cffload.h:1.1.1.5 xc/extras/freetype2/src/cff/cffload.h:1.1.1.6 --- xc/extras/freetype2/src/cff/cffload.h:1.1.1.5 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cff/cffload.h Wed May 28 22:01:51 2003 @@ -28,42 +28,42 @@ FT_BEGIN_HEADER FT_LOCAL( FT_UShort ) - CFF_Get_Standard_Encoding( FT_UInt charcode ); + cff_get_standard_encoding( FT_UInt charcode ); FT_LOCAL( FT_String* ) - CFF_Get_Name( CFF_Index idx, - FT_UInt element ); + cff_index_get_name( CFF_Index idx, + FT_UInt element ); FT_LOCAL( FT_String* ) - CFF_Get_String( CFF_Index idx, - FT_UInt sid, - PSNames_Service psnames_interface ); + cff_index_get_sid_string( CFF_Index idx, + FT_UInt sid, + PSNames_Service psnames_interface ); FT_LOCAL( FT_Error ) - CFF_Access_Element( CFF_Index idx, - FT_UInt element, - FT_Byte** pbytes, - FT_ULong* pbyte_len ); + cff_index_access_element( CFF_Index idx, + FT_UInt element, + FT_Byte** pbytes, + FT_ULong* pbyte_len ); FT_LOCAL( void ) - CFF_Forget_Element( CFF_Index idx, - FT_Byte** pbytes ); + cff_index_forget_element( CFF_Index idx, + FT_Byte** pbytes ); FT_LOCAL( FT_Error ) - CFF_Load_Font( FT_Stream stream, + cff_font_load( FT_Stream stream, FT_Int face_index, CFF_Font font ); FT_LOCAL( void ) - CFF_Done_Font( CFF_Font font ); + cff_font_done( CFF_Font font ); FT_LOCAL( FT_Byte ) - CFF_Get_FD( CFF_FDSelect select, - FT_UInt glyph_index ); + cff_fd_select_get( CFF_FDSelect select, + FT_UInt glyph_index ); FT_END_HEADER Index: xc/extras/freetype2/src/cff/cffobjs.c diff -u xc/extras/freetype2/src/cff/cffobjs.c:1.1.1.7 xc/extras/freetype2/src/cff/cffobjs.c:1.1.1.8 --- xc/extras/freetype2/src/cff/cffobjs.c:1.1.1.7 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cff/cffobjs.c Wed May 28 22:01:51 2003 @@ -28,7 +28,7 @@ #include FT_INTERNAL_POSTSCRIPT_HINTS_H #include "cffobjs.h" #include "cffload.h" - +#include "cffcmap.h" #include "cfferrs.h" @@ -53,7 +53,7 @@ static PSH_Globals_Funcs - CFF_Size_Get_Globals_Funcs( CFF_Size size ) + cff_size_get_globals_funcs( CFF_Size size ) { CFF_Face face = (CFF_Face)size->face; CFF_Font font = (CFF_FontRec *)face->extra.data; @@ -70,14 +70,14 @@ FT_LOCAL_DEF( void ) - CFF_Size_Done( CFF_Size size ) + cff_size_done( CFF_Size size ) { if ( size->internal ) { PSH_Globals_Funcs funcs; - funcs = CFF_Size_Get_Globals_Funcs( size ); + funcs = cff_size_get_globals_funcs( size ); if ( funcs ) funcs->destroy( (PSH_Globals)size->internal ); @@ -87,10 +87,10 @@ FT_LOCAL_DEF( FT_Error ) - CFF_Size_Init( CFF_Size size ) + cff_size_init( CFF_Size size ) { FT_Error error = 0; - PSH_Globals_Funcs funcs = CFF_Size_Get_Globals_Funcs( size ); + PSH_Globals_Funcs funcs = cff_size_get_globals_funcs( size ); if ( funcs ) @@ -112,7 +112,7 @@ FT_UInt n, count; - FT_MEM_SET( &priv, 0, sizeof ( priv ) ); + FT_MEM_ZERO( &priv, sizeof ( priv ) ); count = priv.num_blue_values = cpriv->num_blue_values; for ( n = 0; n < count; n++ ) @@ -131,8 +131,8 @@ priv.family_other_blues[n] = (FT_Short)cpriv->family_other_blues[n]; priv.blue_scale = cpriv->blue_scale; - priv.blue_shift = cpriv->blue_shift; - priv.blue_fuzz = cpriv->blue_fuzz; + priv.blue_shift = (FT_Int)cpriv->blue_shift; + priv.blue_fuzz = (FT_Int)cpriv->blue_fuzz; priv.standard_width[0] = (FT_UShort)cpriv->standard_width; priv.standard_height[0] = (FT_UShort)cpriv->standard_height; @@ -160,9 +160,9 @@ FT_LOCAL_DEF( FT_Error ) - CFF_Size_Reset( CFF_Size size ) + cff_size_reset( CFF_Size size ) { - PSH_Globals_Funcs funcs = CFF_Size_Get_Globals_Funcs( size ); + PSH_Globals_Funcs funcs = cff_size_get_globals_funcs( size ); FT_Error error = 0; @@ -182,14 +182,14 @@ /*************************************************************************/ FT_LOCAL_DEF( void ) - CFF_GlyphSlot_Done( CFF_GlyphSlot slot ) + cff_slot_done( CFF_GlyphSlot slot ) { slot->root.internal->glyph_hints = 0; } FT_LOCAL_DEF( FT_Error ) - CFF_GlyphSlot_Init( CFF_GlyphSlot slot ) + cff_slot_init( CFF_GlyphSlot slot ) { CFF_Face face = (CFF_Face)slot->root.face; CFF_Font font = (CFF_FontRec *)face->extra.data; @@ -224,8 +224,8 @@ /*************************************************************************/ static FT_String* - CFF_StrCopy( FT_Memory memory, - const FT_String* source ) + cff_strcpy( FT_Memory memory, + const FT_String* source ) { FT_Error error; FT_String* result = 0; @@ -245,8 +245,9 @@ + FT_LOCAL_DEF( FT_Error ) - CFF_Face_Init( FT_Stream stream, + cff_face_init( FT_Stream stream, CFF_Face face, FT_Int face_index, FT_Int num_params, @@ -334,18 +335,19 @@ CFF_Font cff; FT_Memory memory = face->root.memory; FT_Face root; - FT_UInt flags; + FT_Int32 flags; if ( FT_NEW( cff ) ) goto Exit; face->extra.data = cff; - error = CFF_Load_Font( stream, face_index, cff ); + error = cff_font_load( stream, face_index, cff ); if ( error ) goto Exit; cff->pshinter = pshinter; + cff->psnames = psnames; /* Complement the root flags with some interesting information. */ /* Note that this is only necessary for pure CFF and CEF fonts. */ @@ -361,7 +363,7 @@ /* we need the `PSNames' module for pure-CFF and CEF formats */ if ( !psnames ) { - FT_ERROR(( "CFF_Face_Init:" )); + FT_ERROR(( "cff_face_init:" )); FT_ERROR(( " cannot open CFF & CEF fonts\n" )); FT_ERROR(( " " )); FT_ERROR(( " without the `PSNames' module\n" )); @@ -395,13 +397,13 @@ root->units_per_EM = 1000; /* retrieve font family & style name */ - root->family_name = CFF_Get_Name( &cff->name_index, face_index ); + root->family_name = cff_index_get_name( &cff->name_index, face_index ); if ( dict->cid_registry ) - root->style_name = CFF_StrCopy( memory, "Regular" ); /* XXXX */ + root->style_name = cff_strcpy( memory, "Regular" ); /* XXXX */ else - root->style_name = CFF_Get_String( &cff->string_index, - dict->weight, - psnames ); + root->style_name = cff_index_get_sid_string( &cff->string_index, + dict->weight, + psnames ); /*******************************************************************/ /* */ @@ -444,8 +446,81 @@ flags |= FT_STYLE_FLAG_BOLD; root->style_flags = flags; - - /* XXX: no charmaps for pure CFF fonts currently! */ + } + + /*******************************************************************/ + /* */ + /* Compute char maps. */ + /* */ + + /* Try to synthetize a Unicode charmap if there is none available */ + /* already. If an OpenType font contains a Unicode "cmap", we */ + /* will use it, whatever be in the CFF part of the file. */ + { + FT_CharMapRec cmaprec; + FT_CharMap cmap; + FT_UInt nn; + CFF_Encoding encoding = &cff->encoding; + + + for ( nn = 0; nn < (FT_UInt) root->num_charmaps; nn++ ) + { + cmap = root->charmaps[nn]; + + /* Windows Unicode (3,1)? */ + if ( cmap->platform_id == 3 && cmap->encoding_id == 1 ) + goto Skip_Unicode; + + /* Deprecated Unicode platform id? */ + if ( cmap->platform_id == 0 ) + goto Skip_Unicode; /* Standard Unicode (deprecated) */ + } + + /* we didn't find a Unicode charmap, synthetize one */ + cmaprec.face = root; + cmaprec.platform_id = 3; + cmaprec.encoding_id = 1; + cmaprec.encoding = FT_ENCODING_UNICODE; + + nn = (FT_UInt) root->num_charmaps; + + FT_CMap_New( &cff_cmap_unicode_class_rec, NULL, &cmaprec, NULL ); + + /* if no Unicode charmap was previously selected, select this one */ + if ( root->charmap == NULL && nn != (FT_UInt) root->num_charmaps ) + root->charmap = root->charmaps[nn]; + + Skip_Unicode: + if ( encoding->count > 0 ) + { + FT_CMap_Class clazz; + + + cmaprec.face = root; + cmaprec.platform_id = 7; /* Adobe platform id */ + + if ( encoding->offset == 0 ) + { + cmaprec.encoding_id = 0; + cmaprec.encoding = FT_ENCODING_ADOBE_STANDARD; + clazz = &cff_cmap_encoding_class_rec; + } + else if ( encoding->offset == 1 ) + { + cmaprec.encoding_id = 1; + cmaprec.encoding = FT_ENCODING_ADOBE_EXPERT; + clazz = &cff_cmap_encoding_class_rec; + } + else + { + cmaprec.encoding_id = 3; + cmaprec.encoding = FT_ENCODING_ADOBE_CUSTOM; + clazz = &cff_cmap_encoding_class_rec; + } + + FT_CMap_New( clazz, NULL, &cmaprec, NULL ); + } + } } @@ -459,7 +534,7 @@ FT_LOCAL_DEF( void ) - CFF_Face_Done( CFF_Face face ) + cff_face_done( CFF_Face face ) { FT_Memory memory = face->root.memory; SFNT_Service sfnt = (SFNT_Service)face->sfnt; @@ -474,7 +549,7 @@ if ( cff ) { - CFF_Done_Font( cff ); + cff_font_done( cff ); FT_FREE( face->extra.data ); } } @@ -482,7 +557,7 @@ FT_LOCAL_DEF( FT_Error ) - CFF_Driver_Init( CFF_Driver driver ) + cff_driver_init( CFF_Driver driver ) { FT_UNUSED( driver ); @@ -491,7 +566,7 @@ FT_LOCAL_DEF( void ) - CFF_Driver_Done( CFF_Driver driver ) + cff_driver_done( CFF_Driver driver ) { FT_UNUSED( driver ); } Index: xc/extras/freetype2/src/cff/cffobjs.h diff -u xc/extras/freetype2/src/cff/cffobjs.h:1.1.1.5 xc/extras/freetype2/src/cff/cffobjs.h:1.1.1.6 --- xc/extras/freetype2/src/cff/cffobjs.h:1.1.1.5 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cff/cffobjs.h Wed May 28 22:01:51 2003 @@ -23,6 +23,7 @@ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_CFF_TYPES_H +#include FT_INTERNAL_TRUETYPE_TYPES_H #include FT_INTERNAL_POSTSCRIPT_NAMES_H @@ -110,19 +111,19 @@ FT_LOCAL( FT_Error ) - CFF_Size_Init( CFF_Size size ); + cff_size_init( CFF_Size size ); FT_LOCAL( void ) - CFF_Size_Done( CFF_Size size ); + cff_size_done( CFF_Size size ); FT_LOCAL( FT_Error ) - CFF_Size_Reset( CFF_Size size ); + cff_size_reset( CFF_Size size ); FT_LOCAL( void ) - CFF_GlyphSlot_Done( CFF_GlyphSlot slot ); + cff_slot_done( CFF_GlyphSlot slot ); FT_LOCAL( FT_Error ) - CFF_GlyphSlot_Init( CFF_GlyphSlot slot ); + cff_slot_init( CFF_GlyphSlot slot ); /*************************************************************************/ @@ -130,14 +131,14 @@ /* Face functions */ /* */ FT_LOCAL( FT_Error ) - CFF_Face_Init( FT_Stream stream, + cff_face_init( FT_Stream stream, CFF_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( void ) - CFF_Face_Done( CFF_Face face ); + cff_face_done( CFF_Face face ); /*************************************************************************/ @@ -145,10 +146,10 @@ /* Driver functions */ /* */ FT_LOCAL( FT_Error ) - CFF_Driver_Init( CFF_Driver driver ); + cff_driver_init( CFF_Driver driver ); FT_LOCAL( void ) - CFF_Driver_Done( CFF_Driver driver ); + cff_driver_done( CFF_Driver driver ); FT_END_HEADER Index: xc/extras/freetype2/src/cff/cffparse.c diff -u xc/extras/freetype2/src/cff/cffparse.c:1.1.1.4 xc/extras/freetype2/src/cff/cffparse.c:1.1.1.5 --- xc/extras/freetype2/src/cff/cffparse.c:1.1.1.4 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cff/cffparse.c Wed May 28 22:01:51 2003 @@ -64,11 +64,11 @@ FT_LOCAL_DEF( void ) - CFF_Parser_Init( CFF_Parser parser, + cff_parser_init( CFF_Parser parser, FT_UInt code, void* object ) { - FT_MEM_SET( parser, 0, sizeof ( *parser ) ); + FT_MEM_ZERO( parser, sizeof ( *parser ) ); parser->top = parser->stack; parser->object_code = code; @@ -244,7 +244,7 @@ if ( exp_sign ) exp = -exp; - power_ten += exp; + power_ten += (FT_Int)exp; } /* raise to power of ten if needed */ @@ -480,7 +480,7 @@ FT_LOCAL_DEF( FT_Error ) - CFF_Parser_Run( CFF_Parser parser, + cff_parser_run( CFF_Parser parser, FT_Byte* start, FT_Byte* limit ) { @@ -542,16 +542,15 @@ const CFF_Field_Handler* field; - /* first of all, a trivial check */ - if ( num_args < 1 ) - goto Stack_Underflow; - *parser->top = p; code = v; if ( v == 12 ) { /* two byte operator */ p++; + if ( p >= limit ) + goto Syntax_Error; + code = 0x100 | p[0]; } code = code | parser->object_code; @@ -565,6 +564,11 @@ FT_Byte* q = (FT_Byte*)parser->object + field->offset; + /* check that we have enough arguments -- except for */ + /* delta encoded arrays, which can be empty */ + if ( field->kind != cff_kind_delta && num_args < 1 ) + goto Stack_Underflow; + switch ( field->kind ) { case cff_kind_bool: Index: xc/extras/freetype2/src/cff/cffparse.h diff -u xc/extras/freetype2/src/cff/cffparse.h:1.1.1.3 xc/extras/freetype2/src/cff/cffparse.h:1.1.1.4 --- xc/extras/freetype2/src/cff/cffparse.h:1.1.1.3 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cff/cffparse.h Wed May 28 22:01:51 2003 @@ -50,12 +50,12 @@ FT_LOCAL( void ) - CFF_Parser_Init( CFF_Parser parser, + cff_parser_init( CFF_Parser parser, FT_UInt code, void* object ); FT_LOCAL( FT_Error ) - CFF_Parser_Run( CFF_Parser parser, + cff_parser_run( CFF_Parser parser, FT_Byte* start, FT_Byte* limit ); Index: xc/extras/freetype2/src/cff/rules.mk diff -u xc/extras/freetype2/src/cff/rules.mk:1.1.1.4 xc/extras/freetype2/src/cff/rules.mk:1.1.1.5 --- xc/extras/freetype2/src/cff/rules.mk:1.1.1.4 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cff/rules.mk Wed May 28 22:01:51 2003 @@ -28,6 +28,7 @@ $(CFF_DIR_)cffload.c \ $(CFF_DIR_)cffgload.c \ $(CFF_DIR_)cffparse.c \ + $(CFF_DIR_)cffcmap.c \ $(CFF_DIR_)cffdrivr.c # CFF driver headers Index: xc/extras/freetype2/src/cid/Jamfile diff -u xc/extras/freetype2/src/cid/Jamfile:1.1.1.1 xc/extras/freetype2/src/cid/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/cid/Jamfile:1.1.1.1 Sun Sep 9 22:56:03 2001 +++ xc/extras/freetype2/src/cid/Jamfile Wed May 28 22:01:51 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/cid Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src cid ; - -SubDirHdrs [ FT2_SubDir src cid ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) cid ; { local _sources ; Index: xc/extras/freetype2/src/cid/cidgload.c diff -u xc/extras/freetype2/src/cid/cidgload.c:1.1.1.6 xc/extras/freetype2/src/cid/cidgload.c:1.1.1.7 --- xc/extras/freetype2/src/cid/cidgload.c:1.1.1.6 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cid/cidgload.c Wed May 28 22:01:51 2003 @@ -43,76 +43,141 @@ CID_Face face = (CID_Face)decoder->builder.face; CID_FaceInfo cid = &face->cid; FT_Byte* p; - FT_UInt entry_len = cid->fd_bytes + cid->gd_bytes; FT_UInt fd_select; - FT_ULong off1, glyph_len; FT_Stream stream = face->root.stream; FT_Error error = 0; + FT_Byte* charstring = 0; + FT_Memory memory = face->root.memory; + FT_UInt glyph_length = 0; - /* read the CID font dict index and charstring offset from the CIDMap */ - if ( FT_STREAM_SEEK( cid->data_offset + cid->cidmap_offset + - glyph_index * entry_len ) || - FT_FRAME_ENTER( 2 * entry_len ) ) - goto Exit; - - p = (FT_Byte*)stream->cursor; - fd_select = (FT_UInt) cid_get_offset( &p, (FT_Byte)cid->fd_bytes ); - off1 = (FT_ULong)cid_get_offset( &p, (FT_Byte)cid->gd_bytes ); - p += cid->fd_bytes; - glyph_len = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ) - off1; - - FT_FRAME_EXIT(); - - /* now, if the glyph is not empty, set up the subrs array, and parse */ - /* the charstrings */ - if ( glyph_len > 0 ) +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* For incremental fonts get the character data using */ + /* the callback function. */ + if ( face->root.internal->incremental_interface ) + { + FT_Data glyph_data; + + + error = face->root.internal->incremental_interface->funcs->get_glyph_data( + face->root.internal->incremental_interface->object, + glyph_index, + &glyph_data ); + if ( error ) + goto Exit; + + p = (FT_Byte*)glyph_data.pointer; + fd_select = (FT_UInt)cid_get_offset( &p, (FT_Byte)cid->fd_bytes ); + + if ( glyph_data.length != 0 ) + { + glyph_length = glyph_data.length - cid->fd_bytes; + FT_ALLOC( charstring, glyph_length ); + if ( !error ) + ft_memcpy( charstring, glyph_data.pointer + cid->fd_bytes, + glyph_length ); + } + + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object, + &glyph_data ); + + if ( error ) + goto Exit; + } + + else + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + /* For ordinary fonts read the CID font dictionary index */ + /* and charstring offset from the CIDMap. */ + { + FT_UInt entry_len = cid->fd_bytes + cid->gd_bytes; + FT_ULong off1; + + + if ( FT_STREAM_SEEK( cid->data_offset + cid->cidmap_offset + + glyph_index * entry_len ) || + FT_FRAME_ENTER( 2 * entry_len ) ) + goto Exit; + + p = (FT_Byte*)stream->cursor; + fd_select = (FT_UInt) cid_get_offset( &p, (FT_Byte)cid->fd_bytes ); + off1 = (FT_ULong)cid_get_offset( &p, (FT_Byte)cid->gd_bytes ); + p += cid->fd_bytes; + glyph_length = (FT_UInt) cid_get_offset( + &p, (FT_Byte)cid->gd_bytes ) - off1; + FT_FRAME_EXIT(); + + if ( glyph_length == 0 ) + goto Exit; + if ( FT_ALLOC( charstring, glyph_length ) ) + goto Exit; + if ( FT_STREAM_READ_AT( cid->data_offset + off1, + charstring, glyph_length ) ) + goto Exit; + } + + /* Now set up the subrs array and parse the charstrings. */ { CID_FaceDict dict; CID_Subrs cid_subrs = face->subrs + fd_select; - FT_Byte* charstring; - FT_Memory memory = face->root.memory; + FT_Int cs_offset; - /* setup subrs */ + /* Set up subrs */ decoder->num_subrs = cid_subrs->num_subrs; decoder->subrs = cid_subrs->code; decoder->subrs_len = 0; - /* setup font matrix */ + /* Set up font matrix */ dict = cid->font_dicts + fd_select; decoder->font_matrix = dict->font_matrix; decoder->font_offset = dict->font_offset; decoder->lenIV = dict->private_dict.lenIV; - /* the charstrings are encoded (stupid!) */ - /* load the charstrings, then execute it */ - - if ( FT_ALLOC( charstring, glyph_len ) ) - goto Exit; + /* Decode the charstring. */ - if ( !FT_STREAM_READ_AT( cid->data_offset + off1, - charstring, glyph_len ) ) - { - FT_Int cs_offset; + /* Adjustment for seed bytes. */ + cs_offset = ( decoder->lenIV >= 0 ? decoder->lenIV : 0 ); + /* Decrypt only if lenIV >= 0. */ + if ( decoder->lenIV >= 0 ) + cid_decrypt( charstring, glyph_length, 4330 ); + + error = decoder->funcs.parse_charstrings( decoder, + charstring + cs_offset, + glyph_length - cs_offset ); + } - /* Adjustment for seed bytes. */ - cs_offset = ( decoder->lenIV >= 0 ? decoder->lenIV : 0 ); + FT_FREE( charstring ); - /* Decrypt only if lenIV >= 0. */ - if ( decoder->lenIV >= 0 ) - cid_decrypt( charstring, glyph_len, 4330 ); +#ifdef FT_CONFIG_OPTION_INCREMENTAL - error = decoder->funcs.parse_charstrings( decoder, - charstring + cs_offset, - glyph_len - cs_offset ); - } + /* Incremental fonts can optionally override the metrics. */ + if ( !error && + face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs->get_glyph_metrics ) + { + FT_Incremental_MetricsRec metrics; - FT_FREE( charstring ); + metrics.bearing_x = decoder->builder.left_bearing.x; + metrics.bearing_y = decoder->builder.left_bearing.y; + metrics.advance = decoder->builder.advance.x; + error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, FALSE, &metrics ); + decoder->builder.left_bearing.x = metrics.bearing_x; + decoder->builder.left_bearing.y = metrics.bearing_y; + decoder->builder.advance.x = metrics.advance; + decoder->builder.advance.y = 0; } +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + Exit: return error; } @@ -140,8 +205,8 @@ FT_LOCAL_DEF( FT_Error ) - CID_Compute_Max_Advance( CID_Face face, - FT_Int* max_advance ) + cid_face_compute_max_advance( CID_Face face, + FT_Int* max_advance ) { FT_Error error; T1_DecoderRec decoder; @@ -203,10 +268,10 @@ FT_LOCAL_DEF( FT_Error ) - CID_Load_Glyph( CID_GlyphSlot glyph, - CID_Size size, - FT_Int glyph_index, - FT_Int load_flags ) + cid_slot_load_glyph( CID_GlyphSlot glyph, + CID_Size size, + FT_Int glyph_index, + FT_Int32 load_flags ) { FT_Error error; T1_DecoderRec decoder; @@ -230,7 +295,7 @@ hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 && ( load_flags & FT_LOAD_NO_HINTING ) == 0 ); - glyph->root.format = ft_glyph_format_outline; + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; { error = psaux->t1_decoder_funcs->init( &decoder, @@ -240,6 +305,7 @@ 0, /* glyph names -- XXX */ 0, /* blend == 0 */ hinting, + FT_LOAD_TARGET_MODE(load_flags), cid_load_glyph ); /* set up the decoder */ @@ -260,8 +326,8 @@ /* bearing the yMax */ if ( !error ) { - glyph->root.outline.flags &= ft_outline_owner; - glyph->root.outline.flags |= ft_outline_reverse_fill; + glyph->root.outline.flags &= FT_OUTLINE_OWNER; + glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL; /* for composite glyphs, return only left side bearing and */ /* advance width */ @@ -294,10 +360,10 @@ metrics->vertAdvance = 0; glyph->root.linearVertAdvance = 0; - glyph->root.format = ft_glyph_format_outline; + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; if ( size && size->root.metrics.y_ppem < 24 ) - glyph->root.outline.flags |= ft_outline_high_precision; + glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION; /* apply the font matrix */ FT_Outline_Transform( &glyph->root.outline, &font_matrix ); Index: xc/extras/freetype2/src/cid/cidgload.h diff -u xc/extras/freetype2/src/cid/cidgload.h:1.1.1.4 xc/extras/freetype2/src/cid/cidgload.h:1.1.1.5 --- xc/extras/freetype2/src/cid/cidgload.h:1.1.1.4 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cid/cidgload.h Wed May 28 22:01:51 2003 @@ -31,16 +31,16 @@ /* Compute the maximum advance width of a font through quick parsing */ FT_LOCAL( FT_Error ) - CID_Compute_Max_Advance( CID_Face face, - FT_Int* max_advance ); + cid_face_compute_max_advance( CID_Face face, + FT_Int* max_advance ); #endif /* 0 */ FT_LOCAL( FT_Error ) - CID_Load_Glyph( CID_GlyphSlot glyph, - CID_Size size, - FT_Int glyph_index, - FT_Int load_flags ); + cid_slot_load_glyph( CID_GlyphSlot glyph, + CID_Size size, + FT_Int glyph_index, + FT_Int32 load_flags ); FT_END_HEADER Index: xc/extras/freetype2/src/cid/cidload.c diff -u xc/extras/freetype2/src/cid/cidload.c:1.1.1.6 xc/extras/freetype2/src/cid/cidload.c:1.1.1.7 --- xc/extras/freetype2/src/cid/cidload.c:1.1.1.6 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cid/cidload.c Wed May 28 22:01:51 2003 @@ -146,10 +146,10 @@ /* now, load the keyword data in the object's field(s) */ if ( keyword->type == T1_FIELD_TYPE_INTEGER_ARRAY || keyword->type == T1_FIELD_TYPE_FIXED_ARRAY ) - error = CID_Load_Field_Table( &loader->parser, keyword, + error = cid_parser_load_field_table( &loader->parser, keyword, &dummy_object ); else - error = CID_Load_Field( &loader->parser, keyword, &dummy_object ); + error = cid_parser_load_field( &loader->parser, keyword, &dummy_object ); Exit: return error; } @@ -163,7 +163,7 @@ FT_BBox* bbox = &face->cid.font_bbox; - (void)CID_ToFixedArray( parser, 4, temp, 0 ); + (void)cid_parser_to_fixed_array( parser, 4, temp, 0 ); bbox->xMin = FT_RoundFix( temp[0] ); bbox->yMin = FT_RoundFix( temp[1] ); bbox->xMax = FT_RoundFix( temp[2] ); @@ -192,7 +192,7 @@ matrix = &dict->font_matrix; offset = &dict->font_offset; - (void)CID_ToFixedArray( parser, 6, temp, 3 ); + (void)cid_parser_to_fixed_array( parser, 6, temp, 3 ); temp_scale = ABS( temp[3] ); @@ -238,7 +238,7 @@ FT_Long num_dicts; - num_dicts = CID_ToInt( parser ); + num_dicts = cid_parser_to_int( parser ); if ( !cid->font_dicts ) { @@ -362,7 +362,7 @@ { /* we found it - run the parsing callback */ parser->root.cursor = cur2; - CID_Skip_Spaces( parser ); + cid_parser_skip_spaces( parser ); parser->root.error = cid_load_keyword( face, loader, keyword ); @@ -448,7 +448,7 @@ /* set up pointers */ for ( count = 1; count <= num_subrs; count++ ) { - FT_UInt len; + FT_ULong len; len = offsets[count] - offsets[count - 1]; @@ -460,7 +460,7 @@ { for ( count = 0; count < num_subrs; count++ ) { - FT_UInt len; + FT_ULong len; len = offsets[count + 1] - offsets[count]; @@ -497,7 +497,7 @@ { FT_UNUSED( face ); - FT_MEM_SET( loader, 0, sizeof ( *loader ) ); + FT_MEM_ZERO( loader, sizeof ( *loader ) ); } @@ -508,12 +508,12 @@ /* finalize parser */ - CID_Done_Parser( parser ); + cid_parser_done( parser ); } FT_LOCAL_DEF( FT_Error ) - CID_Open_Face( CID_Face face ) + cid_face_open( CID_Face face ) { CID_Loader loader; CID_Parser* parser; @@ -523,7 +523,7 @@ t1_init_loader( &loader, face ); parser = &loader.parser; - error = CID_New_Parser( parser, face->root.stream, face->root.memory, + error = cid_parser_new( parser, face->root.stream, face->root.memory, (PSAux_Service)face->psaux ); if ( error ) goto Exit; Index: xc/extras/freetype2/src/cid/cidload.h diff -u xc/extras/freetype2/src/cid/cidload.h:1.1.1.4 xc/extras/freetype2/src/cid/cidload.h:1.1.1.5 --- xc/extras/freetype2/src/cid/cidload.h:1.1.1.4 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cid/cidload.h Wed May 28 22:01:51 2003 @@ -46,7 +46,7 @@ FT_UShort seed ); FT_LOCAL( FT_Error ) - CID_Open_Face( CID_Face face ); + cid_face_open( CID_Face face ); FT_END_HEADER Index: xc/extras/freetype2/src/cid/cidobjs.c diff -u xc/extras/freetype2/src/cid/cidobjs.c:1.1.1.7 xc/extras/freetype2/src/cid/cidobjs.c:1.1.1.8 --- xc/extras/freetype2/src/cid/cidobjs.c:1.1.1.7 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cid/cidobjs.c Wed May 28 22:01:51 2003 @@ -45,14 +45,14 @@ /*************************************************************************/ FT_LOCAL_DEF( void ) - CID_GlyphSlot_Done( CID_GlyphSlot slot ) + cid_slot_done( CID_GlyphSlot slot ) { slot->root.internal->glyph_hints = 0; } FT_LOCAL_DEF( FT_Error ) - CID_GlyphSlot_Init( CID_GlyphSlot slot ) + cid_slot_init( CID_GlyphSlot slot ) { CID_Face face; PSHinter_Service pshinter; @@ -90,7 +90,7 @@ static PSH_Globals_Funcs - CID_Size_Get_Globals_Funcs( CID_Size size ) + cid_size_get_globals_funcs( CID_Size size ) { CID_Face face = (CID_Face)size->root.face; PSHinter_Service pshinter = (PSHinter_Service)face->pshinter; @@ -106,14 +106,14 @@ FT_LOCAL_DEF( void ) - CID_Size_Done( CID_Size size ) + cid_size_done( CID_Size size ) { if ( size->root.internal ) { PSH_Globals_Funcs funcs; - funcs = CID_Size_Get_Globals_Funcs( size ); + funcs = cid_size_get_globals_funcs( size ); if ( funcs ) funcs->destroy( (PSH_Globals)size->root.internal ); @@ -123,10 +123,10 @@ FT_LOCAL_DEF( FT_Error ) - CID_Size_Init( CID_Size size ) + cid_size_init( CID_Size size ) { FT_Error error = 0; - PSH_Globals_Funcs funcs = CID_Size_Get_Globals_Funcs( size ); + PSH_Globals_Funcs funcs = cid_size_get_globals_funcs( size ); if ( funcs ) @@ -147,9 +147,9 @@ FT_LOCAL_DEF( FT_Error ) - CID_Size_Reset( CID_Size size ) + cid_size_reset( CID_Size size ) { - PSH_Globals_Funcs funcs = CID_Size_Get_Globals_Funcs( size ); + PSH_Globals_Funcs funcs = cid_size_get_globals_funcs( size ); FT_Error error = 0; @@ -171,7 +171,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* CID_Face_Done */ + /* cid_face_done */ /* */ /* <Description> */ /* Finalizes a given face object. */ @@ -180,7 +180,7 @@ /* face :: A pointer to the face object to destroy. */ /* */ FT_LOCAL_DEF( void ) - CID_Face_Done( CID_Face face ) + cid_face_done( CID_Face face ) { FT_Memory memory; @@ -239,7 +239,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* CID_Face_Init */ + /* cid_face_init */ /* */ /* <Description> */ /* Initializes a given CID face object. */ @@ -260,7 +260,7 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - CID_Face_Init( FT_Stream stream, + cid_face_init( FT_Stream stream, CID_Face face, FT_Int face_index, FT_Int num_params, @@ -310,7 +310,7 @@ if ( FT_STREAM_SEEK( 0 ) ) goto Exit; - error = CID_Open_Face( face ); + error = cid_face_open( face ); if ( error ) goto Exit; @@ -321,7 +321,7 @@ /* check the face index */ if ( face_index != 0 ) { - FT_ERROR(( "CID_Face_Init: invalid face index\n" )); + FT_ERROR(( "cid_face_init: invalid face index\n" )); error = CID_Err_Invalid_Argument; goto Exit; } @@ -407,7 +407,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* CID_Driver_Init */ + /* cid_driver_init */ /* */ /* <Description> */ /* Initializes a given CID driver object. */ @@ -419,7 +419,7 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - CID_Driver_Init( CID_Driver driver ) + cid_driver_init( CID_Driver driver ) { FT_UNUSED( driver ); @@ -430,7 +430,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* CID_Driver_Done */ + /* cid_driver_done */ /* */ /* <Description> */ /* Finalizes a given CID driver. */ @@ -439,7 +439,7 @@ /* driver :: A handle to the target CID driver. */ /* */ FT_LOCAL_DEF( void ) - CID_Driver_Done( CID_Driver driver ) + cid_driver_done( CID_Driver driver ) { FT_UNUSED( driver ); } Index: xc/extras/freetype2/src/cid/cidobjs.h diff -u xc/extras/freetype2/src/cid/cidobjs.h:1.1.1.6 xc/extras/freetype2/src/cid/cidobjs.h:1.1.1.7 --- xc/extras/freetype2/src/cid/cidobjs.h:1.1.1.6 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cid/cidobjs.h Wed May 28 22:01:51 2003 @@ -112,26 +112,26 @@ FT_LOCAL( void ) - CID_GlyphSlot_Done( CID_GlyphSlot slot ); + cid_slot_done( CID_GlyphSlot slot ); FT_LOCAL( FT_Error ) - CID_GlyphSlot_Init( CID_GlyphSlot slot ); + cid_slot_init( CID_GlyphSlot slot ); FT_LOCAL( void ) - CID_Size_Done( CID_Size size ); + cid_size_done( CID_Size size ); FT_LOCAL( FT_Error ) - CID_Size_Init( CID_Size size ); + cid_size_init( CID_Size size ); FT_LOCAL( FT_Error ) - CID_Size_Reset( CID_Size size ); + cid_size_reset( CID_Size size ); FT_LOCAL( FT_Error ) - CID_Face_Init( FT_Stream stream, + cid_face_init( FT_Stream stream, CID_Face face, FT_Int face_index, FT_Int num_params, @@ -139,15 +139,15 @@ FT_LOCAL( void ) - CID_Face_Done( CID_Face face ); + cid_face_done( CID_Face face ); FT_LOCAL( FT_Error ) - CID_Driver_Init( CID_Driver driver ); + cid_driver_init( CID_Driver driver ); FT_LOCAL( void ) - CID_Driver_Done( CID_Driver driver ); + cid_driver_done( CID_Driver driver ); FT_END_HEADER Index: xc/extras/freetype2/src/cid/cidparse.c diff -u xc/extras/freetype2/src/cid/cidparse.c:1.1.1.5 xc/extras/freetype2/src/cid/cidparse.c:1.1.1.6 --- xc/extras/freetype2/src/cid/cidparse.c:1.1.1.5 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cid/cidparse.c Wed May 28 22:01:51 2003 @@ -49,7 +49,7 @@ FT_LOCAL_DEF( FT_Error ) - CID_New_Parser( CID_Parser* parser, + cid_parser_new( CID_Parser* parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux ) @@ -60,7 +60,7 @@ FT_Int buff_len; - FT_MEM_SET( parser, 0, sizeof ( *parser ) ); + FT_MEM_ZERO( parser, sizeof ( *parser ) ); psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory ); parser->stream = stream; @@ -138,7 +138,7 @@ FT_LOCAL_DEF( void ) - CID_Done_Parser( CID_Parser* parser ) + cid_parser_done( CID_Parser* parser ) { /* always free the private dictionary */ if ( parser->postscript ) Index: xc/extras/freetype2/src/cid/cidparse.h diff -u xc/extras/freetype2/src/cid/cidparse.h:1.1.1.4 xc/extras/freetype2/src/cid/cidparse.h:1.1.1.5 --- xc/extras/freetype2/src/cid/cidparse.h:1.1.1.4 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cid/cidparse.h Wed May 28 22:01:51 2003 @@ -61,7 +61,7 @@ FT_Stream stream; FT_Byte* postscript; - FT_Int postscript_len; + FT_Long postscript_len; FT_ULong data_offset; @@ -72,13 +72,13 @@ FT_LOCAL( FT_Error ) - CID_New_Parser( CID_Parser* parser, + cid_parser_new( CID_Parser* parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux ); FT_LOCAL( void ) - CID_Done_Parser( CID_Parser* parser ); + cid_parser_done( CID_Parser* parser ); /*************************************************************************/ @@ -87,24 +87,24 @@ /* */ /*************************************************************************/ -#define CID_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) -#define CID_Skip_Alpha( p ) (p)->root.funcs.skip_alpha ( &(p)->root ) +#define cid_parser_skip_spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) +#define cid_parser_skip_alpha( p ) (p)->root.funcs.skip_alpha ( &(p)->root ) -#define CID_ToInt( p ) (p)->root.funcs.to_int( &(p)->root ) -#define CID_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) +#define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root ) +#define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) -#define CID_ToCoordArray( p, m, c ) \ +#define cid_parser_to_coord_array( p, m, c ) \ (p)->root.funcs.to_coord_array( &(p)->root, m, c ) -#define CID_ToFixedArray( p, m, f, t ) \ +#define cid_parser_to_fixed_array( p, m, f, t ) \ (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t ) -#define CID_ToToken( p, t ) \ +#define cid_parser_to_token( p, t ) \ (p)->root.funcs.to_token( &(p)->root, t ) -#define CID_ToTokenArray( p, t, m, c ) \ +#define cid_parser_to_token_array( p, t, m, c ) \ (p)->root.funcs.to_token_array( &(p)->root, t, m, c ) -#define CID_Load_Field( p, f, o ) \ +#define cid_parser_load_field( p, f, o ) \ (p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 ) -#define CID_Load_Field_Table( p, f, o ) \ +#define cid_parser_load_field_table( p, f, o ) \ (p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 ) Index: xc/extras/freetype2/src/cid/cidriver.c diff -u xc/extras/freetype2/src/cid/cidriver.c:1.1.1.8 xc/extras/freetype2/src/cid/cidriver.c:1.1.1.9 --- xc/extras/freetype2/src/cid/cidriver.c:1.1.1.8 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/cid/cidriver.c Wed May 28 22:01:51 2003 @@ -40,17 +40,17 @@ cid_get_postscript_name( CID_Face face ) { const char* result = face->cid.cid_font_name; - + if ( result && result[0] == '/' ) result++; - + return result; } static FT_Module_Interface - CID_Get_Interface( FT_Driver driver, + cid_get_interface( FT_Driver driver, const FT_String* cid_interface ) { FT_UNUSED( driver ); @@ -63,227 +63,6 @@ } -#if 0 /* unimplemented yet */ - - static FT_Error - cid_Get_Kerning( T1_Face face, - FT_UInt left_glyph, - FT_UInt right_glyph, - FT_Vector* kerning ) - { - CID_AFM* afm; - - - kerning->x = 0; - kerning->y = 0; - - afm = (CID_AFM*)face->afm_data; - if ( afm ) - CID_Get_Kerning( afm, left_glyph, right_glyph, kerning ); - - return CID_Err_Ok; - } - -#endif /* 0 */ - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* Cid_Get_Char_Index */ - /* */ - /* <Description> */ - /* Uses a charmap to return a given character code's glyph index. */ - /* */ - /* <Input> */ - /* charmap :: A handle to the source charmap object. */ - /* */ - /* charcode :: The character code. */ - /* */ - /* <Return> */ - /* Glyph index. 0 means `undefined character code'. */ - /* */ - static FT_UInt - CID_Get_Char_Index( FT_CharMap charmap, - FT_Long charcode ) - { - T1_Face face; - FT_UInt result = 0; - PSNames_Service psnames; - - - face = (T1_Face)charmap->face; - psnames = (PSNames_Service)face->psnames; - if ( psnames ) - switch ( charmap->encoding ) - { - /*******************************************************************/ - /* */ - /* Unicode encoding support */ - /* */ - case ft_encoding_unicode: - /* use the `PSNames' module to synthetize the Unicode charmap */ - result = psnames->lookup_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /* the function returns 0xFFFF if the Unicode charcode has */ - /* no corresponding glyph. */ - if ( result == 0xFFFF ) - result = 0; - goto Exit; - - /*******************************************************************/ - /* */ - /* Custom Type 1 encoding */ - /* */ - case ft_encoding_adobe_custom: - { - T1_Encoding encoding = &face->type1.encoding; - - - if ( charcode >= encoding->code_first && - charcode <= encoding->code_last ) - result = encoding->char_index[charcode]; - goto Exit; - } - - /*******************************************************************/ - /* */ - /* Adobe Standard & Expert encoding support */ - /* */ - default: - if ( charcode < 256 ) - { - FT_UInt code; - FT_Int n; - const char* glyph_name; - - - code = psnames->adobe_std_encoding[charcode]; - if ( charmap->encoding == ft_encoding_adobe_expert ) - code = psnames->adobe_expert_encoding[charcode]; - - glyph_name = psnames->adobe_std_strings( code ); - if ( !glyph_name ) - break; - - for ( n = 0; n < face->type1.num_glyphs; n++ ) - { - const char* gname = face->type1.glyph_names[n]; - - - if ( gname && gname[0] == glyph_name[0] && - ft_strcmp( gname, glyph_name ) == 0 ) - { - result = n; - break; - } - } - } - } - - Exit: - return result; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* Cid_Get_Next_Char */ - /* */ - /* <Description> */ - /* Uses a charmap to return the next encoded char after. */ - /* */ - /* <Input> */ - /* charmap :: A handle to the source charmap object. */ - /* */ - /* charcode :: The character code. */ - /* */ - /* <Return> */ - /* Next char code. 0 means `no more char codes'. */ - /* */ - static FT_Long - CID_Get_Next_Char( FT_CharMap charmap, - FT_Long charcode ) - { - T1_Face face; - PSNames_Service psnames; - - - face = (T1_Face)charmap->face; - psnames = (PSNames_Service)face->psnames; - - if ( psnames ) - switch ( charmap->encoding ) - { - /*******************************************************************/ - /* */ - /* Unicode encoding support */ - /* */ - case ft_encoding_unicode: - /* use the `PSNames' module to synthetize the Unicode charmap */ - return psnames->next_unicode (&face->unicode_map, - (FT_ULong)charcode ); - - /*******************************************************************/ - /* */ - /* Custom Type 1 encoding */ - /* */ - case ft_encoding_adobe_custom: - { - T1_Encoding encoding = &face->type1.encoding; - - - charcode++; - if ( charcode < encoding->code_first ) - charcode = encoding->code_first; - while ( charcode <= encoding->code_last ) - { - if ( encoding->char_index[charcode] ) - return charcode; - charcode++; - } - } - break; - - /*******************************************************************/ - /* */ - /* Adobe Standard & Expert encoding support */ - /* */ - default: - while ( ++charcode < 256 ) - { - FT_UInt code; - FT_Int n; - const char* glyph_name; - - - code = psnames->adobe_std_encoding[charcode]; - if ( charmap->encoding == ft_encoding_adobe_expert ) - code = psnames->adobe_expert_encoding[charcode]; - - glyph_name = psnames->adobe_std_strings( code ); - if ( !glyph_name ) - continue; - - for ( n = 0; n < face->type1.num_glyphs; n++ ) - { - const char* gname = face->type1.glyph_names[n]; - - - if ( gname && gname[0] == glyph_name[0] && - ft_strcmp( gname, glyph_name ) == 0 ) - { - return charcode; - } - } - } - } - - return 0; - } - FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec t1cid_driver_class = @@ -293,7 +72,7 @@ ft_module_font_driver | ft_module_driver_scalable | ft_module_driver_has_hinter , - + sizeof( FT_DriverRec ), "t1cid", /* module name */ 0x10000L, /* version 1.0 of driver */ @@ -301,9 +80,9 @@ 0, - (FT_Module_Constructor)CID_Driver_Init, - (FT_Module_Destructor) CID_Driver_Done, - (FT_Module_Requester) CID_Get_Interface + (FT_Module_Constructor)cid_driver_init, + (FT_Module_Destructor) cid_driver_done, + (FT_Module_Requester) cid_get_interface }, /* then the other font drivers fields */ @@ -311,26 +90,23 @@ sizeof( CID_SizeRec ), sizeof( CID_GlyphSlotRec ), - (FT_Face_InitFunc) CID_Face_Init, - (FT_Face_DoneFunc) CID_Face_Done, + (FT_Face_InitFunc) cid_face_init, + (FT_Face_DoneFunc) cid_face_done, + + (FT_Size_InitFunc) cid_size_init, + (FT_Size_DoneFunc) cid_size_done, + (FT_Slot_InitFunc) cid_slot_init, + (FT_Slot_DoneFunc) cid_slot_done, + + (FT_Size_ResetPointsFunc)cid_size_reset, + (FT_Size_ResetPixelsFunc)cid_size_reset, + + (FT_Slot_LoadFunc) cid_slot_load_glyph, + + (FT_Face_GetKerningFunc) 0, + (FT_Face_AttachFunc) 0, - (FT_Size_InitFunc) CID_Size_Init, - (FT_Size_DoneFunc) CID_Size_Done, - (FT_Slot_InitFunc) CID_GlyphSlot_Init, - (FT_Slot_DoneFunc) CID_GlyphSlot_Done, - - (FT_Size_ResetPointsFunc) CID_Size_Reset, - (FT_Size_ResetPixelsFunc) CID_Size_Reset, - - (FT_Slot_LoadFunc) CID_Load_Glyph, - (FT_CharMap_CharIndexFunc)CID_Get_Char_Index, - - (FT_Face_GetKerningFunc) 0, - (FT_Face_AttachFunc) 0, - - (FT_Face_GetAdvancesFunc) 0, - - (FT_CharMap_CharNextFunc) CID_Get_Next_Char + (FT_Face_GetAdvancesFunc)0, }; Index: xc/extras/freetype2/src/gzip/Jamfile diff -u /dev/null xc/extras/freetype2/src/gzip/Jamfile:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/Jamfile Wed May 28 22:01:52 2003 @@ -0,0 +1,8 @@ +# FreeType 2 src/gzip Jamfile (c) 2001 David Turner +# + +SubDir FT2_TOP $(FT2_SRC_DIR) gzip ; + +Library $(FT2_LIB) : ftgzip.c ; + +# end of src/pcf Jamfile Index: xc/extras/freetype2/src/gzip/adler32.c diff -u /dev/null xc/extras/freetype2/src/gzip/adler32.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/adler32.c Wed May 28 22:01:52 2003 @@ -0,0 +1,48 @@ +/* adler32.c -- compute the Adler-32 checksum of a data stream + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id: adler32.c,v 1.4 2003/01/30 23:24:18 davidT Exp $ */ + +#include "zlib.h" + +#define BASE 65521L /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* ========================================================================= */ +ZEXPORT(uLong) adler32( /* adler, buf, len) */ + uLong adler, + const Bytef *buf, + uInt len ) +{ + unsigned long s1 = adler & 0xffff; + unsigned long s2 = (adler >> 16) & 0xffff; + int k; + + if (buf == Z_NULL) return 1L; + + while (len > 0) { + k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) { + DO16(buf); + buf += 16; + k -= 16; + } + if (k != 0) do { + s1 += *buf++; + s2 += s1; + } while (--k); + s1 %= BASE; + s2 %= BASE; + } + return (s2 << 16) | s1; +} Index: xc/extras/freetype2/src/gzip/descrip.mms diff -u /dev/null xc/extras/freetype2/src/gzip/descrip.mms:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/descrip.mms Wed May 28 22:01:52 2003 @@ -0,0 +1,23 @@ +# +# FreeType 2 GZip support compilation rules for VMS +# + + +# Copyright 2002 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.gzip]) + +OBJS=ftgzip.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF Index: xc/extras/freetype2/src/gzip/ftgzip.c diff -u /dev/null xc/extras/freetype2/src/gzip/ftgzip.c:1.2 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/ftgzip.c Thu May 29 10:53:28 2003 @@ -0,0 +1,567 @@ +/***************************************************************************/ +/* */ +/* ftgzip.c */ +/* */ +/* FreeType support for .gz compressed fileds */ +/* */ +/* this optional component relies on zlib. It should mainly be used to */ +/* parse compressed PCF fonts, as found with many X11 server */ +/* distributions. */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ +/* $XFree86: xc/extras/freetype2/src/gzip/ftgzip.c,v 1.2 2003/05/29 14:53:28 dawes Exp $ */ + +#include <ft2build.h> +#include FT_INTERNAL_MEMORY_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_DEBUG_H +#if 0 +#include <string.h> +#endif + +#ifdef FT_CONFIG_OPTION_USE_ZLIB + +#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB + +# include <zlib.h> + +#else /* !SYSTEM_ZLIB */ + + /* in this case, we include our own modified sources of the ZLib */ + /* within the "ftgzip" component. The modifications were necessary */ + /* to #include all files without conflicts, as well as preventing */ + /* the definition of "extern" functions that may cause linking */ + /* conflicts when a program is linked with both FreeType and the */ + /* original ZLib */ + +# define NO_DUMMY_DECL +# define BUILDFIXED /* save code size */ +# define MY_ZCALLOC + +# include "zlib.h" + +# undef SLOW +# define SLOW 1 /* we can't use asm-optimized sources here !! */ + +# include "zutil.c" +# include "inftrees.c" +# include "infcodes.c" +# include "infutil.c" +# include "infblock.c" +# include "inflate.c" +# include "adler32.c" + +#endif /* !SYSTEM_ZLIB */ + + +/***************************************************************************/ +/***************************************************************************/ +/***** *****/ +/***** Z L I B M E M O R Y M A N A G E M E N T *****/ +/***** *****/ +/***************************************************************************/ +/***************************************************************************/ + + /* it's better to use FreeType memory routines instead of raw 'malloc/free' */ + + + static voidpf + ft_gzip_alloc( FT_Memory memory, + uInt items, + uInt size ) + { + FT_ULong sz = (FT_ULong)size * items; + FT_Pointer p; + + FT_MEM_ALLOC( p, sz ); + + return (voidpf) p; + } + + + static void + ft_gzip_free( FT_Memory memory, + voidpf address ) + { + FT_MEM_FREE( address ); + } + + +#ifndef FT_CONFIG_OPTION_SYSTEM_ZLIB + + local voidpf + zcalloc ( /* opaque, items, size) */ + voidpf opaque, + unsigned items, + unsigned size ) + { + return ft_gzip_alloc( opaque, items, size ); + } + + local void + zcfree( voidpf opaque, + voidpf ptr ) + { + ft_gzip_free( opaque, ptr ); + } + +#endif /* !SYSTEM_ZLIB */ + + +/***************************************************************************/ +/***************************************************************************/ +/***** *****/ +/***** Z L I B F I L E D E S C R I P T O R *****/ +/***** *****/ +/***************************************************************************/ +/***************************************************************************/ + +#define FT_GZIP_BUFFER_SIZE 4096 + + typedef struct FT_GZipFileRec_ + { + FT_Stream source; /* parent/source stream */ + FT_Stream stream; /* embedding stream */ + FT_Memory memory; /* memory allocator */ + z_stream zstream; /* zlib input stream */ + + FT_ULong start; /* starting position, after .gz header */ + FT_Byte input[ FT_GZIP_BUFFER_SIZE ]; /* input read buffer */ + + FT_Byte buffer[ FT_GZIP_BUFFER_SIZE ]; /* output buffer */ + FT_ULong pos; /* position in output */ + FT_Byte* cursor; + FT_Byte* limit; + + } FT_GZipFileRec, *FT_GZipFile; + + +/* gzip flag byte */ +#define FT_GZIP_ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ +#define FT_GZIP_HEAD_CRC 0x02 /* bit 1 set: header CRC present */ +#define FT_GZIP_EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ +#define FT_GZIP_ORIG_NAME 0x08 /* bit 3 set: original file name present */ +#define FT_GZIP_COMMENT 0x10 /* bit 4 set: file comment present */ +#define FT_GZIP_RESERVED 0xE0 /* bits 5..7: reserved */ + + + /* check and skip .gz header - we don't support "transparent" compression */ + static FT_Error + ft_gzip_check_header( FT_Stream stream ) + { + FT_Error error; + FT_Byte head[4]; + + if ( FT_STREAM_SEEK( 0 ) || + FT_STREAM_READ( head, 4 ) ) + goto Exit; + + /* head[0] && head[1] are the magic numbers */ + /* head[2] is the method, and head[3] the flags */ + if ( head[0] != 0x1f || + head[1] != 0x8b || + head[2] != Z_DEFLATED || + (head[3] & FT_GZIP_RESERVED) ) + { + error = FT_Err_Invalid_File_Format; + goto Exit; + } + + /* skip time, xflags and os code */ + (void)FT_STREAM_SKIP( 6 ); + + /* skip the extra field */ + if ( head[3] & FT_GZIP_EXTRA_FIELD ) + { + FT_UInt len; + + if ( FT_READ_USHORT_LE( len ) || + FT_STREAM_SKIP( len ) ) + goto Exit; + } + + /* skip original file name */ + if ( head[3] & FT_GZIP_ORIG_NAME ) + for (;;) + { + FT_UInt c; + + if ( FT_READ_BYTE( c) ) + goto Exit; + + if ( c == 0 ) + break; + } + + /* skip .gz comment */ + if ( head[3] & FT_GZIP_COMMENT ) + for (;;) + { + FT_UInt c; + + if ( FT_READ_BYTE( c) ) + goto Exit; + + if ( c == 0 ) + break; + } + + /* skip CRC */ + if ( head[3] & FT_GZIP_HEAD_CRC ) + if ( FT_STREAM_SKIP( 2 ) ) + goto Exit; + + Exit: + return error; + } + + + + static FT_Error + ft_gzip_file_init( FT_GZipFile zip, + FT_Stream stream, + FT_Stream source ) + { + z_stream* zstream = &zip->zstream; + FT_Error error = 0; + + zip->stream = stream; + zip->source = source; + zip->memory = stream->memory; + + zip->limit = zip->buffer + FT_GZIP_BUFFER_SIZE; + zip->cursor = zip->limit; + zip->pos = 0; + + /* check and skip .gz header */ + { + stream = source; + + error = ft_gzip_check_header( stream ); + if (error) + goto Exit; + + zip->start = FT_STREAM_POS(); + } + + /* initialize zlib - there is no zlib header in the compressed stream */ + zstream->zalloc = (alloc_func) ft_gzip_alloc; + zstream->zfree = (free_func) ft_gzip_free; + zstream->opaque = stream->memory; + + zstream->avail_in = 0; + zstream->next_in = zip->buffer; + + if ( inflateInit2( zstream, -MAX_WBITS ) != Z_OK || + zstream->next_in == NULL ) + { + error = FT_Err_Invalid_File_Format; + goto Exit; + } + + Exit: + return error; + } + + + + static void + ft_gzip_file_done( FT_GZipFile zip ) + { + z_stream* zstream = &zip->zstream; + + inflateEnd( zstream ); + + /* clear the rest */ + zstream->zalloc = NULL; + zstream->zfree = NULL; + zstream->opaque = NULL; + zstream->next_in = NULL; + zstream->next_out = NULL; + zstream->avail_in = 0; + zstream->avail_out = 0; + + zip->memory = NULL; + zip->source = NULL; + zip->stream = NULL; + } + + + static FT_Error + ft_gzip_file_reset( FT_GZipFile zip ) + { + FT_Stream stream = zip->source; + FT_Error error; + + if ( !FT_STREAM_SEEK( zip->start ) ) + { + z_stream* zstream = &zip->zstream; + + inflateReset( zstream ); + + zstream->avail_in = 0; + zstream->next_in = zip->input; + zstream->avail_out = 0; + zstream->next_out = zip->buffer; + + zip->limit = zip->buffer + FT_GZIP_BUFFER_SIZE; + zip->cursor = zip->limit; + zip->pos = 0; + } + return error; + } + + + static FT_Error + ft_gzip_file_fill_input( FT_GZipFile zip ) + { + z_stream* zstream = &zip->zstream; + FT_Stream stream = zip->source; + FT_ULong size; + + if ( stream->read ) + { + size = stream->read( stream, stream->pos, zip->input, FT_GZIP_BUFFER_SIZE ); + if ( size == 0 ) + return FT_Err_Invalid_Stream_Operation; + } + else + { + size = stream->size - stream->pos; + if ( size > FT_GZIP_BUFFER_SIZE ) + size = FT_GZIP_BUFFER_SIZE; + + if ( size == 0 ) + return FT_Err_Invalid_Stream_Operation; + + FT_MEM_COPY( zip->input, stream->base + stream->pos, size ); + } + stream->pos += size; + + zstream->next_in = zip->input; + zstream->avail_in = size; + + return 0; + } + + + + static FT_Error + ft_gzip_file_fill_output( FT_GZipFile zip ) + { + z_stream* zstream = &zip->zstream; + FT_Error error = 0; + + zip->cursor = zip->buffer; + zstream->next_out = zip->cursor; + zstream->avail_out = FT_GZIP_BUFFER_SIZE; + + while ( zstream->avail_out > 0 ) + { + int err; + + if ( zstream->avail_in == 0 ) + { + error = ft_gzip_file_fill_input( zip ); + if ( error ) + break; + } + + err = inflate( zstream, Z_NO_FLUSH ); + + if ( err == Z_STREAM_END ) + { + zip->limit = zstream->next_out; + error = FT_Err_Invalid_Stream_Operation; + break; + } + else if ( err != Z_OK ) + { + error = FT_Err_Invalid_Stream_Operation; + break; + } + } + return error; + } + + + /* fill output buffer, 'count' must be <= FT_GZIP_BUFFER_SIZE */ + static FT_Error + ft_gzip_file_skip_output( FT_GZipFile zip, + FT_ULong count ) + { + FT_Error error = 0; + FT_ULong delta; + + for (;;) + { + delta = (FT_ULong)( zip->limit - zip->cursor ); + if ( delta >= count ) + delta = count; + + zip->cursor += delta; + zip->pos += delta; + + count -= delta; + if ( count == 0 ) + break; + + error = ft_gzip_file_fill_output( zip ); + if ( error ) + break; + } + + return error; + } + + + static FT_ULong + ft_gzip_file_io( FT_GZipFile zip, + FT_ULong pos, + FT_Byte* buffer, + FT_ULong count ) + { + FT_ULong result = 0; + FT_Error error; + + /* reset inflate stream if we're seeking backwards */ + /* yes, that's not too efficient, but it saves memory :-) */ + if ( pos < zip->pos ) + { + error = ft_gzip_file_reset( zip ); + if ( error ) goto Exit; + } + + /* skip unwanted bytes */ + if ( pos > zip->pos ) + { + error = ft_gzip_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) ); + if (error) + goto Exit; + } + + if ( count == 0 ) + goto Exit; + + /* now read the data */ + for (;;) + { + FT_ULong delta; + + delta = (FT_ULong)( zip->limit - zip->cursor ); + if ( delta >= count ) + delta = count; + + FT_MEM_COPY( buffer, zip->cursor, delta ); + buffer += delta; + result += delta; + zip->cursor += delta; + zip->pos += delta; + + count -= delta; + if ( count == 0 ) + break; + + error = ft_gzip_file_fill_output( zip ); + if (error) + break; + } + + Exit: + return result; + } + + +/***************************************************************************/ +/***************************************************************************/ +/***** *****/ +/***** G Z E M B E D D I N G S T R E A M *****/ +/***** *****/ +/***************************************************************************/ +/***************************************************************************/ + + static void + ft_gzip_stream_close( FT_Stream stream ) + { + FT_GZipFile zip = stream->descriptor.pointer; + FT_Memory memory = stream->memory; + + if ( zip ) + { + /* finalize gzip file descriptor */ + ft_gzip_file_done( zip ); + + FT_FREE( zip ); + + stream->descriptor.pointer = NULL; + } + } + + + static FT_ULong + ft_gzip_stream_io( FT_Stream stream, + FT_ULong pos, + FT_Byte* buffer, + FT_ULong count ) + { + FT_GZipFile zip = stream->descriptor.pointer; + + return ft_gzip_file_io( zip, pos, buffer, count ); + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Stream_OpenGzip( FT_Stream stream, + FT_Stream source ) + { + FT_Error error; + FT_Memory memory = source->memory; + FT_GZipFile zip; + + FT_ZERO( stream ); + stream->memory = memory; + + if ( !FT_NEW( zip ) ) + { + error = ft_gzip_file_init( zip, stream, source ); + if ( error ) + { + FT_FREE( zip ); + goto Exit; + } + + stream->descriptor.pointer = zip; + } + + stream->size = 0x7FFFFFFF; /* don't know the real size !! */ + stream->pos = 0; + stream->base = 0; + stream->read = ft_gzip_stream_io; + stream->close = ft_gzip_stream_close; + + Exit: + return error; + } + +#else /* !FT_CONFIG_OPTION_USE_ZLIB */ + + FT_EXPORT_DEF( FT_Error ) + FT_Stream_OpenGzip( FT_Stream stream, + FT_Stream source ) + { + FT_UNUSED( stream ); + FT_UNUSED( source ); + + return FT_Err_Unimplemented_Feature; + } + +#endif /* !FT_CONFIG_OPTION_USE_ZLIB */ Index: xc/extras/freetype2/src/gzip/infblock.c diff -u /dev/null xc/extras/freetype2/src/gzip/infblock.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/infblock.c Wed May 28 22:01:52 2003 @@ -0,0 +1,386 @@ +/* infblock.c -- interpret and process block types to last block + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infblock.h" +#include "inftrees.h" +#include "infcodes.h" +#include "infutil.h" + + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +/* Table for deflate from PKZIP's appnote.txt. */ +local const uInt border[] = { /* Order of the bit length code lengths */ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + +/* + Notes beyond the 1.93a appnote.txt: + + 1. Distance pointers never point before the beginning of the output + stream. + 2. Distance pointers can point back across blocks, up to 32k away. + 3. There is an implied maximum of 7 bits for the bit length table and + 15 bits for the actual data. + 4. If only one code exists, then it is encoded using one bit. (Zero + would be more efficient, but perhaps a little confusing.) If two + codes exist, they are coded using one bit each (0 and 1). + 5. There is no way of sending zero distance codes--a dummy must be + sent if there are none. (History: a pre 2.0 version of PKZIP would + store blocks with no distance codes, but this was discovered to be + too harsh a criterion.) Valid only for 1.93a. 2.04c does allow + zero distance codes, which is sent as one code of zero bits in + length. + 6. There are up to 286 literal/length codes. Code 256 represents the + end-of-block. Note however that the static length tree defines + 288 codes just to fill out the Huffman codes. Codes 286 and 287 + cannot be used though, since there is no length base or extra bits + defined for them. Similarily, there are up to 30 distance codes. + However, static trees define 32 codes (all 5 bits) to fill out the + Huffman codes, but the last two had better not show up in the data. + 7. Unzip can check dynamic Huffman blocks for complete code sets. + The exception is that a single code would not be complete (see #4). + 8. The five bits following the block type is really the number of + literal codes sent minus 257. + 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits + (1+6+6). Therefore, to output three times the length, you output + three codes (1+1+1), whereas to output four times the same length, + you only need two codes (1+3). Hmm. + 10. In the tree reconstruction algorithm, Code = Code + Increment + only if BitLength(i) is not zero. (Pretty obvious.) + 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) + 12. Note: length code 284 can represent 227-258, but length code 285 + really is 258. The last length deserves its own, short code + since it gets used a lot in very redundant files. The length + 258 is special since 258 - 3 (the min match length) is 255. + 13. The literal/length and distance code bit lengths are read as a + single stream of lengths. It is possible (and advantageous) for + a repeat code (16, 17, or 18) to go across the boundary between + the two sets of lengths. + */ + + +local void inflate_blocks_reset( /* s, z, c) */ +inflate_blocks_statef *s, +z_streamp z, +uLongf *c ) +{ + if (c != Z_NULL) + *c = s->check; + if (s->mode == BTREE || s->mode == DTREE) + ZFREE(z, s->sub.trees.blens); + if (s->mode == CODES) + inflate_codes_free(s->sub.decode.codes, z); + s->mode = TYPE; + s->bitk = 0; + s->bitb = 0; + s->read = s->write = s->window; + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0); + Tracev((stderr, "inflate: blocks reset\n")); +} + + +local inflate_blocks_statef *inflate_blocks_new( /* z, c, w) */ +z_streamp z, +check_func c, +uInt w ) +{ + inflate_blocks_statef *s; + + if ((s = (inflate_blocks_statef *)ZALLOC + (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL) + return s; + if ((s->hufts = + (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL) + { + ZFREE(z, s); + return Z_NULL; + } + if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL) + { + ZFREE(z, s->hufts); + ZFREE(z, s); + return Z_NULL; + } + s->end = s->window + w; + s->checkfn = c; + s->mode = TYPE; + Tracev((stderr, "inflate: blocks allocated\n")); + inflate_blocks_reset(s, z, Z_NULL); + return s; +} + + +local int inflate_blocks( /* s, z, r) */ +inflate_blocks_statef *s, +z_streamp z, +int r ) +{ + uInt t; /* temporary storage */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Bytef *p; /* input data pointer */ + uInt n; /* bytes available there */ + Bytef *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input based on current state */ + while (1) switch (s->mode) + { + case TYPE: + NEEDBITS(3) + t = (uInt)b & 7; + s->last = t & 1; + switch (t >> 1) + { + case 0: /* stored */ + Tracev((stderr, "inflate: stored block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + t = k & 7; /* go to byte boundary */ + DUMPBITS(t) + s->mode = LENS; /* get length of stored block */ + break; + case 1: /* fixed */ + Tracev((stderr, "inflate: fixed codes block%s\n", + s->last ? " (last)" : "")); + { + uInt bl, bd; + inflate_huft *tl, *td; + + inflate_trees_fixed(&bl, &bd, &tl, &td, z); + s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); + if (s->sub.decode.codes == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + } + DUMPBITS(3) + s->mode = CODES; + break; + case 2: /* dynamic */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + s->mode = TABLE; + break; + case 3: /* illegal */ + DUMPBITS(3) + s->mode = BAD; + z->msg = (char*)"invalid block type"; + r = Z_DATA_ERROR; + LEAVE + } + break; + case LENS: + NEEDBITS(32) + if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) + { + s->mode = BAD; + z->msg = (char*)"invalid stored block lengths"; + r = Z_DATA_ERROR; + LEAVE + } + s->sub.left = (uInt)b & 0xffff; + b = k = 0; /* dump bits */ + Tracev((stderr, "inflate: stored length %u\n", s->sub.left)); + s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE); + break; + case STORED: + if (n == 0) + LEAVE + NEEDOUT + t = s->sub.left; + if (t > n) t = n; + if (t > m) t = m; + zmemcpy(q, p, t); + p += t; n -= t; + q += t; m -= t; + if ((s->sub.left -= t) != 0) + break; + Tracev((stderr, "inflate: stored end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + s->mode = s->last ? DRY : TYPE; + break; + case TABLE: + NEEDBITS(14) + s->sub.trees.table = t = (uInt)b & 0x3fff; +#ifndef PKZIP_BUG_WORKAROUND + if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) + { + s->mode = BAD; + z->msg = (char*)"too many length or distance symbols"; + r = Z_DATA_ERROR; + LEAVE + } +#endif + t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); + if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + DUMPBITS(14) + s->sub.trees.index = 0; + Tracev((stderr, "inflate: table sizes ok\n")); + s->mode = BTREE; + case BTREE: + while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) + { + NEEDBITS(3) + s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7; + DUMPBITS(3) + } + while (s->sub.trees.index < 19) + s->sub.trees.blens[border[s->sub.trees.index++]] = 0; + s->sub.trees.bb = 7; + t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, + &s->sub.trees.tb, s->hufts, z); + if (t != Z_OK) + { + r = t; + if (r == Z_DATA_ERROR) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + } + LEAVE + } + s->sub.trees.index = 0; + Tracev((stderr, "inflate: bits tree ok\n")); + s->mode = DTREE; + case DTREE: + while (t = s->sub.trees.table, + s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) + { + inflate_huft *h; + uInt i, j, c; + + t = s->sub.trees.bb; + NEEDBITS(t) + h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); + t = h->bits; + c = h->base; + if (c < 16) + { + DUMPBITS(t) + s->sub.trees.blens[s->sub.trees.index++] = c; + } + else /* c == 16..18 */ + { + i = c == 18 ? 7 : c - 14; + j = c == 18 ? 11 : 3; + NEEDBITS(t + i) + DUMPBITS(t) + j += (uInt)b & inflate_mask[i]; + DUMPBITS(i) + i = s->sub.trees.index; + t = s->sub.trees.table; + if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || + (c == 16 && i < 1)) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + z->msg = (char*)"invalid bit length repeat"; + r = Z_DATA_ERROR; + LEAVE + } + c = c == 16 ? s->sub.trees.blens[i - 1] : 0; + do { + s->sub.trees.blens[i++] = c; + } while (--j); + s->sub.trees.index = i; + } + } + s->sub.trees.tb = Z_NULL; + { + uInt bl, bd; + inflate_huft *tl, *td; + inflate_codes_statef *c; + + bl = 9; /* must be <= 9 for lookahead assumptions */ + bd = 6; /* must be <= 9 for lookahead assumptions */ + t = s->sub.trees.table; + t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), + s->sub.trees.blens, &bl, &bd, &tl, &td, + s->hufts, z); + if (t != Z_OK) + { + if (t == (uInt)Z_DATA_ERROR) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + } + r = t; + LEAVE + } + Tracev((stderr, "inflate: trees ok\n")); + if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + s->sub.decode.codes = c; + } + ZFREE(z, s->sub.trees.blens); + s->mode = CODES; + case CODES: + UPDATE + if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) + return inflate_flush(s, z, r); + r = Z_OK; + inflate_codes_free(s->sub.decode.codes, z); + LOAD + Tracev((stderr, "inflate: codes end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + if (!s->last) + { + s->mode = TYPE; + break; + } + s->mode = DRY; + case DRY: + FLUSH + if (s->read != s->write) + LEAVE + s->mode = DONE; + case DONE: + r = Z_STREAM_END; + LEAVE + case BAD: + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +#ifdef NEED_DUMMY_RETURN + return 0; +#endif +} + + +local int inflate_blocks_free( /* s, z) */ +inflate_blocks_statef *s, +z_streamp z ) +{ + inflate_blocks_reset(s, z, Z_NULL); + ZFREE(z, s->window); + ZFREE(z, s->hufts); + ZFREE(z, s); + Tracev((stderr, "inflate: blocks freed\n")); + return Z_OK; +} + + Index: xc/extras/freetype2/src/gzip/infblock.h diff -u /dev/null xc/extras/freetype2/src/gzip/infblock.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/infblock.h Wed May 28 22:01:52 2003 @@ -0,0 +1,36 @@ +/* infblock.h -- header to use infblock.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFBLOCK_H +#define _INFBLOCK_H + +struct inflate_blocks_state; +typedef struct inflate_blocks_state FAR inflate_blocks_statef; + +local inflate_blocks_statef * inflate_blocks_new OF(( + z_streamp z, + check_func c, /* check function */ + uInt w)); /* window size */ + +local int inflate_blocks OF(( + inflate_blocks_statef *, + z_streamp , + int)); /* initial return code */ + +local void inflate_blocks_reset OF(( + inflate_blocks_statef *, + z_streamp , + uLongf *)); /* check value on output */ + +local int inflate_blocks_free OF(( + inflate_blocks_statef *, + z_streamp)); + +#endif /* _INFBLOCK_H */ Index: xc/extras/freetype2/src/gzip/infcodes.c diff -u /dev/null xc/extras/freetype2/src/gzip/infcodes.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/infcodes.c Wed May 28 22:01:52 2003 @@ -0,0 +1,250 @@ +/* infcodes.c -- process literals and length/distance pairs + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" +#include "infblock.h" +#include "infcodes.h" +#include "infutil.h" + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + START, /* x: set up for LEN */ + LEN, /* i: get length/literal/eob next */ + LENEXT, /* i: getting length extra (have base) */ + DIST, /* i: get distance next */ + DISTEXT, /* i: getting distance extra */ + COPY, /* o: copying bytes in window, waiting for space */ + LIT, /* o: got literal, waiting for output space */ + WASH, /* o: got eob, possibly still output waiting */ + END, /* x: got eob and all data flushed */ + BADCODE} /* x: got error */ +inflate_codes_mode; + +/* inflate codes private state */ +struct inflate_codes_state { + + /* mode */ + inflate_codes_mode mode; /* current inflate_codes mode */ + + /* mode dependent information */ + uInt len; + union { + struct { + inflate_huft *tree; /* pointer into tree */ + uInt need; /* bits needed */ + } code; /* if LEN or DIST, where in tree */ + uInt lit; /* if LIT, literal */ + struct { + uInt get; /* bits to get for extra */ + uInt dist; /* distance back to copy from */ + } copy; /* if EXT or COPY, where and how much */ + } sub; /* submode */ + + /* mode independent information */ + Byte lbits; /* ltree bits decoded per branch */ + Byte dbits; /* dtree bits decoder per branch */ + inflate_huft *ltree; /* literal/length/eob tree */ + inflate_huft *dtree; /* distance tree */ + +}; + + +local inflate_codes_statef *inflate_codes_new( /* bl, bd, tl, td, z) */ +uInt bl, uInt bd, +inflate_huft *tl, +inflate_huft *td, /* need separate declaration for Borland C++ */ +z_streamp z ) +{ + inflate_codes_statef *c; + + if ((c = (inflate_codes_statef *) + ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL) + { + c->mode = START; + c->lbits = (Byte)bl; + c->dbits = (Byte)bd; + c->ltree = tl; + c->dtree = td; + Tracev((stderr, "inflate: codes new\n")); + } + return c; +} + + +local int inflate_codes( /* s, z, r) */ +inflate_blocks_statef *s, +z_streamp z, +int r ) +{ + uInt j; /* temporary storage */ + inflate_huft *t; /* temporary pointer */ + uInt e; /* extra bits or operation */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Bytef *p; /* input data pointer */ + uInt n; /* bytes available there */ + Bytef *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + Bytef *f; /* pointer to copy strings from */ + inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input and output based on current state */ + while (1) switch (c->mode) + { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + case START: /* x: set up for LEN */ +#ifndef SLOW + if (m >= 258 && n >= 10) + { + UPDATE + r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); + LOAD + if (r != Z_OK) + { + c->mode = r == Z_STREAM_END ? WASH : BADCODE; + break; + } + } +#endif /* !SLOW */ + c->sub.code.need = c->lbits; + c->sub.code.tree = c->ltree; + c->mode = LEN; + case LEN: /* i: get length/literal/eob next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e == 0) /* literal */ + { + c->sub.lit = t->base; + Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", t->base)); + c->mode = LIT; + break; + } + if (e & 16) /* length */ + { + c->sub.copy.get = e & 15; + c->len = t->base; + c->mode = LENEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + if (e & 32) /* end of block */ + { + Tracevv((stderr, "inflate: end of block\n")); + c->mode = WASH; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid literal/length code"; + r = Z_DATA_ERROR; + LEAVE + case LENEXT: /* i: getting length extra (have base) */ + j = c->sub.copy.get; + NEEDBITS(j) + c->len += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + c->sub.code.need = c->dbits; + c->sub.code.tree = c->dtree; + Tracevv((stderr, "inflate: length %u\n", c->len)); + c->mode = DIST; + case DIST: /* i: get distance next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e & 16) /* distance */ + { + c->sub.copy.get = e & 15; + c->sub.copy.dist = t->base; + c->mode = DISTEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid distance code"; + r = Z_DATA_ERROR; + LEAVE + case DISTEXT: /* i: getting distance extra */ + j = c->sub.copy.get; + NEEDBITS(j) + c->sub.copy.dist += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist)); + c->mode = COPY; + case COPY: /* o: copying bytes in window, waiting for space */ + f = q - c->sub.copy.dist; + while (f < s->window) /* modulo window size-"while" instead */ + f += s->end - s->window; /* of "if" handles invalid distances */ + while (c->len) + { + NEEDOUT + OUTBYTE(*f++) + if (f == s->end) + f = s->window; + c->len--; + } + c->mode = START; + break; + case LIT: /* o: got literal, waiting for output space */ + NEEDOUT + OUTBYTE(c->sub.lit) + c->mode = START; + break; + case WASH: /* o: got eob, possibly more output */ + if (k > 7) /* return unused byte, if any */ + { + Assert(k < 16, "inflate_codes grabbed too many bytes") + k -= 8; + n++; + p--; /* can always return one */ + } + FLUSH + if (s->read != s->write) + LEAVE + c->mode = END; + case END: + r = Z_STREAM_END; + LEAVE + case BADCODE: /* x: got error */ + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + + +local void inflate_codes_free( /* c, z) */ +inflate_codes_statef *c, +z_streamp z ) +{ + ZFREE(z, c); + Tracev((stderr, "inflate: codes free\n")); +} Index: xc/extras/freetype2/src/gzip/infcodes.h diff -u /dev/null xc/extras/freetype2/src/gzip/infcodes.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/infcodes.h Wed May 28 22:01:52 2003 @@ -0,0 +1,31 @@ +/* infcodes.h -- header to use infcodes.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFCODES_H +#define _INFCODES_H + +struct inflate_codes_state; +typedef struct inflate_codes_state FAR inflate_codes_statef; + +local inflate_codes_statef *inflate_codes_new OF(( + uInt, uInt, + inflate_huft *, inflate_huft *, + z_streamp )); + +local int inflate_codes OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +local void inflate_codes_free OF(( + inflate_codes_statef *, + z_streamp )); + +#endif /* _INFCODES_H */ Index: xc/extras/freetype2/src/gzip/inffixed.h diff -u /dev/null xc/extras/freetype2/src/gzip/inffixed.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/inffixed.h Wed May 28 22:01:52 2003 @@ -0,0 +1,151 @@ +/* inffixed.h -- table for decoding fixed codes + * Generated automatically by the maketree.c program + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +local uInt fixed_bl = 9; +local uInt fixed_bd = 5; +local inflate_huft fixed_tl[] = { + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254}, + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} + }; +local inflate_huft fixed_td[] = { + {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, + {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, + {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, + {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577}, + {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145}, + {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, + {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, + {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} + }; Index: xc/extras/freetype2/src/gzip/inflate.c diff -u /dev/null xc/extras/freetype2/src/gzip/inflate.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/inflate.c Wed May 28 22:01:52 2003 @@ -0,0 +1,273 @@ +/* inflate.c -- zlib interface to inflate modules + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infblock.h" + +#define DONE INFLATE_DONE +#define BAD INFLATE_BAD + +typedef enum { + METHOD, /* waiting for method byte */ + FLAG, /* waiting for flag byte */ + DICT4, /* four dictionary check bytes to go */ + DICT3, /* three dictionary check bytes to go */ + DICT2, /* two dictionary check bytes to go */ + DICT1, /* one dictionary check byte to go */ + DICT0, /* waiting for inflateSetDictionary */ + BLOCKS, /* decompressing blocks */ + CHECK4, /* four check bytes to go */ + CHECK3, /* three check bytes to go */ + CHECK2, /* two check bytes to go */ + CHECK1, /* one check byte to go */ + DONE, /* finished check, done */ + BAD} /* got an error--stay here */ +inflate_mode; + +/* inflate private state */ +struct internal_state { + + /* mode */ + inflate_mode mode; /* current inflate mode */ + + /* mode dependent information */ + union { + uInt method; /* if FLAGS, method byte */ + struct { + uLong was; /* computed check value */ + uLong need; /* stream check value */ + } check; /* if CHECK, check values to compare */ + uInt marker; /* if BAD, inflateSync's marker bytes count */ + } sub; /* submode */ + + /* mode independent information */ + int nowrap; /* flag for no wrapper */ + uInt wbits; /* log2(window size) (8..15, defaults to 15) */ + inflate_blocks_statef + *blocks; /* current inflate_blocks state */ + +}; + + +ZEXPORT(int) inflateReset( /* z) */ +z_streamp z ) +{ + if (z == Z_NULL || z->state == Z_NULL) + return Z_STREAM_ERROR; + z->total_in = z->total_out = 0; + z->msg = Z_NULL; + z->state->mode = z->state->nowrap ? BLOCKS : METHOD; + inflate_blocks_reset(z->state->blocks, z, Z_NULL); + Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + + +ZEXPORT(int) inflateEnd( /* z) */ +z_streamp z ) +{ + if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL) + return Z_STREAM_ERROR; + if (z->state->blocks != Z_NULL) + inflate_blocks_free(z->state->blocks, z); + ZFREE(z, z->state); + z->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} + + +ZEXPORT(int) inflateInit2_( /* z, w, version, stream_size) */ +z_streamp z, +int w, +const char *version, +int stream_size ) +{ + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != sizeof(z_stream)) + return Z_VERSION_ERROR; + + /* initialize state */ + if (z == Z_NULL) + return Z_STREAM_ERROR; + z->msg = Z_NULL; + if (z->zalloc == Z_NULL) + { + z->zalloc = zcalloc; + z->opaque = (voidpf)0; + } + if (z->zfree == Z_NULL) z->zfree = zcfree; + if ((z->state = (struct internal_state FAR *) + ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL) + return Z_MEM_ERROR; + z->state->blocks = Z_NULL; + + /* handle undocumented nowrap option (no zlib header or check) */ + z->state->nowrap = 0; + if (w < 0) + { + w = - w; + z->state->nowrap = 1; + } + + /* set window size */ + if (w < 8 || w > 15) + { + inflateEnd(z); + return Z_STREAM_ERROR; + } + z->state->wbits = (uInt)w; + + /* create inflate_blocks state */ + if ((z->state->blocks = + inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w)) + == Z_NULL) + { + inflateEnd(z); + return Z_MEM_ERROR; + } + Tracev((stderr, "inflate: allocated\n")); + + /* reset state */ + inflateReset(z); + return Z_OK; +} + + + +#undef NEEDBYTE +#define NEEDBYTE {if(z->avail_in==0)return r;r=f;} + +#undef NEXTBYTE +#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) + + +ZEXPORT(int) inflate( /* z, f) */ +z_streamp z, +int f ) +{ + int r; + uInt b; + + if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL) + return Z_STREAM_ERROR; + f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK; + r = Z_BUF_ERROR; + while (1) switch (z->state->mode) + { + case METHOD: + NEEDBYTE + if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED) + { + z->state->mode = BAD; + z->msg = (char*)"unknown compression method"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + if ((z->state->sub.method >> 4) + 8 > z->state->wbits) + { + z->state->mode = BAD; + z->msg = (char*)"invalid window size"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + z->state->mode = FLAG; + case FLAG: + NEEDBYTE + b = NEXTBYTE; + if (((z->state->sub.method << 8) + b) % 31) + { + z->state->mode = BAD; + z->msg = (char*)"incorrect header check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev((stderr, "inflate: zlib header ok\n")); + if (!(b & PRESET_DICT)) + { + z->state->mode = BLOCKS; + break; + } + z->state->mode = DICT4; + case DICT4: + NEEDBYTE + z->state->sub.check.need = (uLong)NEXTBYTE << 24; + z->state->mode = DICT3; + case DICT3: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 16; + z->state->mode = DICT2; + case DICT2: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 8; + z->state->mode = DICT1; + case DICT1: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE; + z->adler = z->state->sub.check.need; + z->state->mode = DICT0; + return Z_NEED_DICT; + case DICT0: + z->state->mode = BAD; + z->msg = (char*)"need dictionary"; + z->state->sub.marker = 0; /* can try inflateSync */ + return Z_STREAM_ERROR; + case BLOCKS: + r = inflate_blocks(z->state->blocks, z, r); + if (r == Z_DATA_ERROR) + { + z->state->mode = BAD; + z->state->sub.marker = 0; /* can try inflateSync */ + break; + } + if (r == Z_OK) + r = f; + if (r != Z_STREAM_END) + return r; + r = f; + inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); + if (z->state->nowrap) + { + z->state->mode = DONE; + break; + } + z->state->mode = CHECK4; + case CHECK4: + NEEDBYTE + z->state->sub.check.need = (uLong)NEXTBYTE << 24; + z->state->mode = CHECK3; + case CHECK3: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 16; + z->state->mode = CHECK2; + case CHECK2: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 8; + z->state->mode = CHECK1; + case CHECK1: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE; + + if (z->state->sub.check.was != z->state->sub.check.need) + { + z->state->mode = BAD; + z->msg = (char*)"incorrect data check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev((stderr, "inflate: zlib check ok\n")); + z->state->mode = DONE; + case DONE: + return Z_STREAM_END; + case BAD: + return Z_DATA_ERROR; + default: + return Z_STREAM_ERROR; + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + Index: xc/extras/freetype2/src/gzip/inftrees.c diff -u /dev/null xc/extras/freetype2/src/gzip/inftrees.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/inftrees.c Wed May 28 22:01:52 2003 @@ -0,0 +1,460 @@ +/* inftrees.c -- generate Huffman trees for efficient decoding + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" + +#if !defined(BUILDFIXED) && !defined(STDC) +# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */ +#endif + + +#if 0 +local const char inflate_copyright[] = + " inflate 1.1.4 Copyright 1995-2002 Mark Adler "; +#endif +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + + +local int huft_build OF(( + uIntf *, /* code lengths in bits */ + uInt, /* number of codes */ + uInt, /* number of "simple" codes */ + const uIntf *, /* list of base values for non-simple codes */ + const uIntf *, /* list of extra bits for non-simple codes */ + inflate_huft * FAR*,/* result: starting table */ + uIntf *, /* maximum lookup bits (returns actual) */ + inflate_huft *, /* space for trees */ + uInt *, /* hufts used in space */ + uIntf * )); /* space for values */ + +/* Tables for deflate from PKZIP's appnote.txt. */ +local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + /* see note #13 above about 258 */ +local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */ +local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; +local const uInt cpdext[30] = { /* Extra bits for distance codes */ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + +/* + Huffman code decoding is performed using a multi-level table lookup. + The fastest way to decode is to simply build a lookup table whose + size is determined by the longest code. However, the time it takes + to build this table can also be a factor if the data being decoded + is not very long. The most common codes are necessarily the + shortest codes, so those codes dominate the decoding time, and hence + the speed. The idea is you can have a shorter table that decodes the + shorter, more probable codes, and then point to subsidiary tables for + the longer codes. The time it costs to decode the longer codes is + then traded against the time it takes to make longer tables. + + This results of this trade are in the variables lbits and dbits + below. lbits is the number of bits the first level table for literal/ + length codes can decode in one step, and dbits is the same thing for + the distance codes. Subsequent tables are also less than or equal to + those sizes. These values may be adjusted either when all of the + codes are shorter than that, in which case the longest code length in + bits is used, or when the shortest code is *longer* than the requested + table size, in which case the length of the shortest code in bits is + used. + + There are two different values for the two tables, since they code a + different number of possibilities each. The literal/length table + codes 286 possible values, or in a flat code, a little over eight + bits. The distance table codes 30 possible values, or a little less + than five bits, flat. The optimum values for speed end up being + about one bit more than those, so lbits is 8+1 and dbits is 5+1. + The optimum values may differ though from machine to machine, and + possibly even between compilers. Your mileage may vary. + */ + + +/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */ +#define BMAX 15 /* maximum bit length of any code */ + +local int huft_build( /* b, n, s, d, e, t, m, hp, hn, v) */ +uIntf *b, /* code lengths in bits (all assumed <= BMAX) */ +uInt n, /* number of codes (assumed <= 288) */ +uInt s, /* number of simple-valued codes (0..s-1) */ +const uIntf *d, /* list of base values for non-simple codes */ +const uIntf *e, /* list of extra bits for non-simple codes */ +inflate_huft * FAR *t, /* result: starting table */ +uIntf *m, /* maximum lookup bits, returns actual */ +inflate_huft *hp, /* space for trees */ +uInt *hn, /* hufts used in space */ +uIntf *v /* working area: values in order of bit length */ +/* Given a list of code lengths and a maximum table size, make a set of + tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + if the given code set is incomplete (the tables are still built in this + case), or Z_DATA_ERROR if the input is invalid. */ +) +{ + + uInt a; /* counter for codes of length k */ + uInt c[BMAX+1]; /* bit length count table */ + uInt f; /* i repeats in table every f entries */ + int g; /* maximum code length */ + int h; /* table level */ + register uInt i; /* counter, current code */ + register uInt j; /* counter */ + register int k; /* number of bits in current code */ + int l; /* bits per table (returned in m) */ + uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ + register uIntf *p; /* pointer into c[], b[], or v[] */ + inflate_huft *q; /* points to current table */ + struct inflate_huft_s r; /* table entry for structure assignment */ + inflate_huft *u[BMAX]; /* table stack */ + register int w; /* bits before this table == (l * h) */ + uInt x[BMAX+1]; /* bit offsets, then code stack */ + uIntf *xp; /* pointer into x */ + int y; /* number of dummy codes added */ + uInt z; /* number of entries in current table */ + + + /* Generate counts for each bit length */ + p = c; +#define C0 *p++ = 0; +#define C2 C0 C0 C0 C0 +#define C4 C2 C2 C2 C2 + C4 /* clear c[]--assume BMAX+1 is 16 */ + p = b; i = n; + do { + c[*p++]++; /* assume all entries <= BMAX */ + } while (--i); + if (c[0] == n) /* null input--all zero length codes */ + { + *t = (inflate_huft *)Z_NULL; + *m = 0; + return Z_OK; + } + + + /* Find minimum and maximum length, bound *m by those */ + l = *m; + for (j = 1; j <= BMAX; j++) + if (c[j]) + break; + k = j; /* minimum code length */ + if ((uInt)l < j) + l = j; + for (i = BMAX; i; i--) + if (c[i]) + break; + g = i; /* maximum code length */ + if ((uInt)l > i) + l = i; + *m = l; + + + /* Adjust last length count to fill out codes, if needed */ + for (y = 1 << j; j < i; j++, y <<= 1) + if ((y -= c[j]) < 0) + return Z_DATA_ERROR; + if ((y -= c[i]) < 0) + return Z_DATA_ERROR; + c[i] += y; + + + /* Generate starting offsets into the value table for each length */ + x[1] = j = 0; + p = c + 1; xp = x + 2; + while (--i) { /* note that i == g from above */ + *xp++ = (j += *p++); + } + + + /* Make a table of values in order of bit lengths */ + p = b; i = 0; + do { + if ((j = *p++) != 0) + v[x[j]++] = i; + } while (++i < n); + n = x[g]; /* set n to length of v */ + + + /* Generate the Huffman codes and for each, make the table entries */ + x[0] = i = 0; /* first Huffman code is zero */ + p = v; /* grab values in bit order */ + h = -1; /* no tables yet--level -1 */ + w = -l; /* bits decoded == (l * h) */ + u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */ + q = (inflate_huft *)Z_NULL; /* ditto */ + z = 0; /* ditto */ + + /* go through the bit lengths (k already is bits in shortest code) */ + for (; k <= g; k++) + { + a = c[k]; + while (a--) + { + /* here i is the Huffman code of length k bits for value *p */ + /* make tables up to required level */ + while (k > w + l) + { + h++; + w += l; /* previous table always l bits */ + + /* compute minimum size table less than or equal to l bits */ + z = g - w; + z = z > (uInt)l ? (uInt)l : z; /* table size upper limit */ + if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ + { /* too few codes for k-w bit table */ + f -= a + 1; /* deduct codes from patterns left */ + xp = c + k; + if (j < z) + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } + } + z = 1 << j; /* table entries for j-bit table */ + + /* allocate new table */ + if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ + return Z_DATA_ERROR; /* overflow of MANY */ + u[h] = q = hp + *hn; + *hn += z; + + /* connect to last table, if there is one */ + if (h) + { + x[h] = i; /* save pattern for backing up */ + r.bits = (Byte)l; /* bits to dump before this table */ + r.exop = (Byte)j; /* bits in this table */ + j = i >> (w - l); + r.base = (uInt)(q - u[h-1] - j); /* offset to this table */ + u[h-1][j] = r; /* connect to last table */ + } + else + *t = q; /* first table is returned result */ + } + + /* set up table entry in r */ + r.bits = (Byte)(k - w); + if (p >= v + n) + r.exop = 128 + 64; /* out of values--invalid code */ + else if (*p < s) + { + r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */ + r.base = *p++; /* simple code is just the value */ + } + else + { + r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */ + r.base = d[*p++ - s]; + } + + /* fill code-like entries with r */ + f = 1 << (k - w); + for (j = i >> w; j < z; j += f) + q[j] = r; + + /* backwards increment the k-bit code i */ + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + i ^= j; + + /* backup over finished tables */ + mask = (1 << w) - 1; /* needed on HP, cc -O bug */ + while ((i & mask) != x[h]) + { + h--; /* don't need to update q */ + w -= l; + mask = (1 << w) - 1; + } + } + } + + + /* Return Z_BUF_ERROR if we were given an incomplete table */ + return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; +} + + +local int inflate_trees_bits( /* c, bb, tb, hp, z) */ +uIntf *c, /* 19 code lengths */ +uIntf *bb, /* bits tree desired/actual depth */ +inflate_huft * FAR *tb, /* bits tree result */ +inflate_huft *hp, /* space for trees */ +z_streamp z /* for messages */ +) +{ + int r; + uInt hn = 0; /* hufts used in space */ + uIntf *v; /* work area for huft_build */ + + if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, + tb, bb, hp, &hn, v); + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed dynamic bit lengths tree"; + else if (r == Z_BUF_ERROR || *bb == 0) + { + z->msg = (char*)"incomplete dynamic bit lengths tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +} + + +local int inflate_trees_dynamic( /* nl, nd, c, bl, bd, tl, td, hp, z) */ +uInt nl, /* number of literal/length codes */ +uInt nd, /* number of distance codes */ +uIntf *c, /* that many (total) code lengths */ +uIntf *bl, /* literal desired/actual bit depth */ +uIntf *bd, /* distance desired/actual bit depth */ +inflate_huft * FAR *tl, /* literal/length tree result */ +inflate_huft * FAR *td, /* distance tree result */ +inflate_huft *hp, /* space for trees */ +z_streamp z /* for messages */ +) +{ + int r; + uInt hn = 0; /* hufts used in space */ + uIntf *v; /* work area for huft_build */ + + /* allocate work area */ + if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + + /* build literal/length tree */ + r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v); + if (r != Z_OK || *bl == 0) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed literal/length tree"; + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"incomplete literal/length tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; + } + + /* build distance tree */ + r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v); + if (r != Z_OK || (*bd == 0 && nl > 257)) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed distance tree"; + else if (r == Z_BUF_ERROR) { +#ifdef PKZIP_BUG_WORKAROUND + r = Z_OK; + } +#else + z->msg = (char*)"incomplete distance tree"; + r = Z_DATA_ERROR; + } + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"empty distance tree with lengths"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +#endif + } + + /* done */ + ZFREE(z, v); + return Z_OK; +} + + +/* build fixed tables only once--keep them here */ +#ifdef BUILDFIXED +local int fixed_built = 0; +#define FIXEDH 544 /* number of hufts used by fixed tables */ +local inflate_huft fixed_mem[FIXEDH]; +local uInt fixed_bl; +local uInt fixed_bd; +local inflate_huft *fixed_tl; +local inflate_huft *fixed_td; +#else +#include "inffixed.h" +#endif + + +local int inflate_trees_fixed( /* bl, bd, tl, td, z) */ +uIntf *bl, /* literal desired/actual bit depth */ +uIntf *bd, /* distance desired/actual bit depth */ +inflate_huft * FAR *tl, /* literal/length tree result */ +inflate_huft * FAR *td, /* distance tree result */ +z_streamp z /* for memory allocation */ +) +{ +#ifdef BUILDFIXED + /* build fixed tables if not already */ + if (!fixed_built) + { + int k; /* temporary variable */ + uInt f = 0; /* number of hufts used in fixed_mem */ + uIntf *c; /* length list for huft_build */ + uIntf *v; /* work area for huft_build */ + + /* allocate memory */ + if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + { + ZFREE(z, c); + return Z_MEM_ERROR; + } + + /* literal table */ + for (k = 0; k < 144; k++) + c[k] = 8; + for (; k < 256; k++) + c[k] = 9; + for (; k < 280; k++) + c[k] = 7; + for (; k < 288; k++) + c[k] = 8; + fixed_bl = 9; + huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, + fixed_mem, &f, v); + + /* distance table */ + for (k = 0; k < 30; k++) + c[k] = 5; + fixed_bd = 5; + huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, + fixed_mem, &f, v); + + /* done */ + ZFREE(z, v); + ZFREE(z, c); + fixed_built = 1; + } +#endif + *bl = fixed_bl; + *bd = fixed_bd; + *tl = fixed_tl; + *td = fixed_td; + return Z_OK; +} Index: xc/extras/freetype2/src/gzip/inftrees.h diff -u /dev/null xc/extras/freetype2/src/gzip/inftrees.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/inftrees.h Wed May 28 22:01:52 2003 @@ -0,0 +1,63 @@ +/* inftrees.h -- header to use inftrees.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Huffman code lookup table entry--this entry is four bytes for machines + that have 16-bit pointers (e.g. PC's in the small or medium model). */ + +#ifndef _INFTREES_H +#define _INFTREES_H + +typedef struct inflate_huft_s FAR inflate_huft; + +struct inflate_huft_s { + union { + struct { + Byte Exop; /* number of extra bits or operation */ + Byte Bits; /* number of bits in this code or subcode */ + } what; + uInt pad; /* pad structure to a power of 2 (4 bytes for */ + } word; /* 16-bit, 8 bytes for 32-bit int's) */ + uInt base; /* literal, length base, distance base, + or table offset */ +}; + +/* Maximum size of dynamic tree. The maximum found in a long but non- + exhaustive search was 1004 huft structures (850 for length/literals + and 154 for distances, the latter actually the result of an + exhaustive search). The actual maximum is not known, but the + value below is more than safe. */ +#define MANY 1440 + +local int inflate_trees_bits OF(( + uIntf *, /* 19 code lengths */ + uIntf *, /* bits tree desired/actual depth */ + inflate_huft * FAR *, /* bits tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +local int inflate_trees_dynamic OF(( + uInt, /* number of literal/length codes */ + uInt, /* number of distance codes */ + uIntf *, /* that many (total) code lengths */ + uIntf *, /* literal desired/actual bit depth */ + uIntf *, /* distance desired/actual bit depth */ + inflate_huft * FAR *, /* literal/length tree result */ + inflate_huft * FAR *, /* distance tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +local int inflate_trees_fixed OF(( + uIntf *, /* literal desired/actual bit depth */ + uIntf *, /* distance desired/actual bit depth */ + inflate_huft * FAR *, /* literal/length tree result */ + inflate_huft * FAR *, /* distance tree result */ + z_streamp)); /* for memory allocation */ + +#endif /* _INFTREES_H */ Index: xc/extras/freetype2/src/gzip/infutil.c diff -u /dev/null xc/extras/freetype2/src/gzip/infutil.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/infutil.c Wed May 28 22:01:52 2003 @@ -0,0 +1,86 @@ +/* inflate_util.c -- data and routines common to blocks and codes + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infblock.h" +#include "inftrees.h" +#include "infcodes.h" +#include "infutil.h" + + +/* And'ing with mask[n] masks the lower n bits */ +local uInt inflate_mask[17] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + + +/* copy as much as possible from the sliding window to the output area */ +local int inflate_flush( /* s, z, r) */ +inflate_blocks_statef *s, +z_streamp z, +int r ) +{ + uInt n; + Bytef *p; + Bytef *q; + + /* local copies of source and destination pointers */ + p = z->next_out; + q = s->read; + + /* compute number of bytes to copy as far as end of window */ + n = (uInt)((q <= s->write ? s->write : s->end) - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy as far as end of window */ + zmemcpy(p, q, n); + p += n; + q += n; + + /* see if more to copy at beginning of window */ + if (q == s->end) + { + /* wrap pointers */ + q = s->window; + if (s->write == s->end) + s->write = s->window; + + /* compute bytes to copy */ + n = (uInt)(s->write - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy */ + zmemcpy(p, q, n); + p += n; + q += n; + } + + /* update pointers */ + z->next_out = p; + s->read = q; + + /* done */ + return r; +} Index: xc/extras/freetype2/src/gzip/infutil.h diff -u /dev/null xc/extras/freetype2/src/gzip/infutil.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/infutil.h Wed May 28 22:01:52 2003 @@ -0,0 +1,96 @@ +/* infutil.h -- types and macros common to blocks and codes + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFUTIL_H +#define _INFUTIL_H + +typedef enum { + TYPE, /* get type bits (3, including end bit) */ + LENS, /* get lengths for stored */ + STORED, /* processing stored block */ + TABLE, /* get table lengths */ + BTREE, /* get bit lengths tree for a dynamic block */ + DTREE, /* get length, distance trees for a dynamic block */ + CODES, /* processing fixed or dynamic block */ + DRY, /* output remaining window bytes */ + DONE, /* finished last block, done */ + BAD} /* got a data error--stuck here */ +inflate_block_mode; + +/* inflate blocks semi-private state */ +struct inflate_blocks_state { + + /* mode */ + inflate_block_mode mode; /* current inflate_block mode */ + + /* mode dependent information */ + union { + uInt left; /* if STORED, bytes left to copy */ + struct { + uInt table; /* table lengths (14 bits) */ + uInt index; /* index into blens (or border) */ + uIntf *blens; /* bit lengths of codes */ + uInt bb; /* bit length tree depth */ + inflate_huft *tb; /* bit length decoding tree */ + } trees; /* if DTREE, decoding info for trees */ + struct { + inflate_codes_statef + *codes; + } decode; /* if CODES, current state */ + } sub; /* submode */ + uInt last; /* true if this block is the last block */ + + /* mode independent information */ + uInt bitk; /* bits in bit buffer */ + uLong bitb; /* bit buffer */ + inflate_huft *hufts; /* single malloc for tree space */ + Bytef *window; /* sliding window */ + Bytef *end; /* one byte after sliding window */ + Bytef *read; /* window read pointer */ + Bytef *write; /* window write pointer */ + check_func checkfn; /* check function */ + uLong check; /* check on output */ + +}; + + +/* defines for inflate input/output */ +/* update pointers and return */ +#define UPDBITS {s->bitb=b;s->bitk=k;} +#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} +#define UPDOUT {s->write=q;} +#define UPDATE {UPDBITS UPDIN UPDOUT} +#define LEAVE {UPDATE return inflate_flush(s,z,r);} +/* get bytes and bits */ +#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} +#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} +#define NEXTBYTE (n--,*p++) +#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}} +#define DUMPBITS(j) {b>>=(j);k-=(j);} +/* output bytes */ +#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q) +#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} +#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} +#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} +#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} +#define OUTBYTE(a) {*q++=(Byte)(a);m--;} +/* load local pointers */ +#define LOAD {LOADIN LOADOUT} + +/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ +local uInt inflate_mask[17]; + +/* copy as much as possible from the sliding window to the output area */ +local int inflate_flush OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +#endif Index: xc/extras/freetype2/src/gzip/rules.mk diff -u /dev/null xc/extras/freetype2/src/gzip/rules.mk:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/rules.mk Wed May 28 22:01:52 2003 @@ -0,0 +1,74 @@ +# +# FreeType 2 GZip support configuration rules +# + + +# Copyright 2002 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +# gzip driver directory +# +GZIP_DIR := $(SRC_)gzip +GZIP_DIR_ := $(GZIP_DIR)$(SEP) + + +# compilation flags for the driver +# +ifeq ($(SYSTEM_ZLIB),) + GZIP_COMPILE := $(FT_COMPILE) $I$(GZIP_DIR) +else + GZIP_COMPILE := $(FT_COMPILE) +endif + + +# gzip support sources (i.e., C files) +# +GZIP_DRV_SRC := $(GZIP_DIR_)ftgzip.c + +# gzip support headers +# +GZIP_DRV_H := + + +# gzip driver object(s) +# +# GZIP_DRV_OBJ_M is used during `multi' builds +# GZIP_DRV_OBJ_S is used during `single' builds +# +ifeq ($(SYSTEM_ZLIB),) + GZIP_DRV_OBJ_M := $(GZIP_DRV_SRC:$(GZIP_DIR_)%.c=$(OBJ_)%.$O) +else + GZIP_DRV_OBJ_M := $(OBJ_)ftgzip.$O +endif +GZIP_DRV_OBJ_S := $(OBJ_)ftgzip.$O + +# gzip support source file for single build +# +GZIP_DRV_SRC_S := $(GZIP_DIR_)ftgzip.c + + +# gzip support - single object +# +$(GZIP_DRV_OBJ_S): $(GZIP_DRV_SRC_S) $(GZIP_DRV_SRC) $(FREETYPE_H) $(GZIP_DRV_H) + $(GZIP_COMPILE) $T$@ $(GZIP_DRV_SRC_S) + + +# gzip support - multiple objects +# +$(OBJ_)%.$O: $(GZIP_DIR_)%.c $(FREETYPE_H) $(GZIP_DRV_H) + $(GZIP_COMPILE) $T$@ $< + + +# update main driver object lists +# +DRV_OBJS_S += $(GZIP_DRV_OBJ_S) +DRV_OBJS_M += $(GZIP_DRV_OBJ_M) + +# EOF Index: xc/extras/freetype2/src/gzip/zconf.h diff -u /dev/null xc/extras/freetype2/src/gzip/zconf.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:18 2004 +++ xc/extras/freetype2/src/gzip/zconf.h Wed May 28 22:01:52 2003 @@ -0,0 +1,278 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id: zconf.h,v 1.3 2002/12/26 20:50:40 davidT Exp $ */ + +#ifndef _ZCONF_H +#define _ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateReset z_inflateReset +# define compress z_compress +# define compress2 z_compress2 +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table + +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) +# define WIN32 +#endif +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) +# ifndef __32BIT__ +# define __32BIT__ +# endif +#endif +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#if defined(MSDOS) && !defined(__32BIT__) +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) +# define STDC +#endif +#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) +# ifndef STDC +# define STDC +# endif +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Old Borland C and LCC incorrectly complains about missing returns: */ +#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) +# define NEED_DUMMY_RETURN +#endif + +#if defined(__LCC__) +# define NEED_DUMMY_RETURN +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +#endif +#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) +# ifndef __32BIT__ +# define SMALL_MEDIUM +# define FAR _far +# endif +#endif + +/* Compile with -DZLIB_DLL for Windows DLL support */ +#if defined(ZLIB_DLL) +# if defined(_WINDOWS) || defined(WINDOWS) +# ifdef FAR +# undef FAR +# endif +# include <windows.h> +# define ZEXPORT(x) x WINAPI +# ifdef WIN32 +# define ZEXPORTVA(x) x WINAPIV +# else +# define ZEXPORTVA(x) x FAR _cdecl _export +# endif +# endif +# if defined (__BORLANDC__) +# if (__BORLANDC__ >= 0x0500) && defined (WIN32) +# include <windows.h> +# define ZEXPORT(x) x __declspec(dllexport) WINAPI +# define ZEXPORTRVA(x) x __declspec(dllexport) WINAPIV +# else +# if defined (_Windows) && defined (__DLL__) +# define ZEXPORT(x) x _export +# define ZEXPORTVA(x) x _export +# endif +# endif +# endif +#endif + + +#ifndef ZEXPORT +# define ZEXPORT(x) static x +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA(x) static x +#endif +#ifndef ZEXTERN +# define ZEXTERN(x) static x +#endif +#ifndef ZEXTERNDEF +# define ZEXTERNDEF(x) static x +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(MACOS) && !defined(TARGET_OS_MAC) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#ifdef HAVE_UNISTD_H +# include <sys/types.h> /* for off_t */ +# include <unistd.h> /* for SEEK_* and off_t */ +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(inflate_blocks,"INBL") +# pragma map(inflate_blocks_new,"INBLNE") +# pragma map(inflate_blocks_free,"INBLFR") +# pragma map(inflate_blocks_reset,"INBLRE") +# pragma map(inflate_codes_free,"INCOFR") +# pragma map(inflate_codes,"INCO") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_flush,"INFLU") +# pragma map(inflate_mask,"INMA") +# pragma map(inflate_set_dictionary,"INSEDI2") +# pragma map(inflate_copyright,"INCOPY") +# pragma map(inflate_trees_bits,"INTRBI") +# pragma map(inflate_trees_dynamic,"INTRDY") +# pragma map(inflate_trees_fixed,"INTRFI") +# pragma map(inflate_trees_free,"INTRFR") +#endif + +#endif /* _ZCONF_H */ Index: xc/extras/freetype2/src/gzip/zlib.h diff -u /dev/null xc/extras/freetype2/src/gzip/zlib.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/gzip/zlib.h Wed May 28 22:01:52 2003 @@ -0,0 +1,830 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.4, March 11th, 2002 + + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef _ZLIB_H +#define _ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.1.4" + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: ascii or binary */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +/* Allowed flush values; see deflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_ASCII 1 +#define Z_UNKNOWN 2 +/* Possible values of the data_type field */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + + + /* basic functions */ + +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN(int) deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +*/ + + +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN(int) inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +ZEXTERN(int) inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + it sets strm->adler to the adler32 checksum of all output produced + so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +*/ + + +ZEXTERN(int) inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN(int) deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. + + Upon return of this function, strm->adler is set to the Adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +/* +ZEXTERN(int) inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.) +*/ + +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary). + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +ZEXTERN(int) inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ + + +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ + +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +ZEXTERN(uLong) adler32 OF((uLong adler, const Bytef *buf, uInt len)); + +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +/* + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN(int) inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + + +#ifdef __cplusplus +} +#endif + +#endif /* _ZLIB_H */ Index: xc/extras/freetype2/src/gzip/zutil.c diff -u /dev/null xc/extras/freetype2/src/gzip/zutil.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/gzip/zutil.c Wed May 28 22:01:52 2003 @@ -0,0 +1,181 @@ +/* zutil.c -- target dependent utility functions for the compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id: zutil.c,v 1.2 2002/11/06 22:32:54 davidT Exp $ */ + +#include "zutil.h" + +#ifndef STDC +extern void exit OF((int)); +#endif + + +#ifndef HAVE_MEMCPY + +void zmemcpy(dest, source, len) + Bytef* dest; + const Bytef* source; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = *source++; /* ??? to be unrolled */ + } while (--len != 0); +} + +int zmemcmp(s1, s2, len) + const Bytef* s1; + const Bytef* s2; + uInt len; +{ + uInt j; + + for (j = 0; j < len; j++) { + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + } + return 0; +} + +void zmemzero(dest, len) + Bytef* dest; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = 0; /* ??? to be unrolled */ + } while (--len != 0); +} +#endif + +#ifdef __TURBOC__ +#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__) +/* Small and medium model in Turbo C are for now limited to near allocation + * with reduced MAX_WBITS and MAX_MEM_LEVEL + */ +# define MY_ZCALLOC + +/* Turbo C malloc() does not allow dynamic allocation of 64K bytes + * and farmalloc(64K) returns a pointer with an offset of 8, so we + * must fix the pointer. Warning: the pointer must be put back to its + * original form in order to free it, use zcfree(). + */ + +#define MAX_PTR 10 +/* 10*64K = 640K */ + +local int next_ptr = 0; + +typedef struct ptr_table_s { + voidpf org_ptr; + voidpf new_ptr; +} ptr_table; + +local ptr_table table[MAX_PTR]; +/* This table is used to remember the original form of pointers + * to large buffers (64K). Such pointers are normalized with a zero offset. + * Since MSDOS is not a preemptive multitasking OS, this table is not + * protected from concurrent access. This hack doesn't work anyway on + * a protected system like OS/2. Use Microsoft C instead. + */ + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + voidpf buf = opaque; /* just to make some compilers happy */ + ulg bsize = (ulg)items*size; + + /* If we allocate less than 65520 bytes, we assume that farmalloc + * will return a usable pointer which doesn't have to be normalized. + */ + if (bsize < 65520L) { + buf = farmalloc(bsize); + if (*(ush*)&buf != 0) return buf; + } else { + buf = farmalloc(bsize + 16L); + } + if (buf == NULL || next_ptr >= MAX_PTR) return NULL; + table[next_ptr].org_ptr = buf; + + /* Normalize the pointer to seg:0 */ + *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; + *(ush*)&buf = 0; + table[next_ptr++].new_ptr = buf; + return buf; +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + int n; + if (*(ush*)&ptr != 0) { /* object < 64K */ + farfree(ptr); + return; + } + /* Find the original pointer */ + for (n = 0; n < next_ptr; n++) { + if (ptr != table[n].new_ptr) continue; + + farfree(table[n].org_ptr); + while (++n < next_ptr) { + table[n-1] = table[n]; + } + next_ptr--; + return; + } + ptr = opaque; /* just to make some compilers happy */ + Assert(0, "zcfree: ptr not found"); +} +#endif +#endif /* __TURBOC__ */ + + +#if defined(M_I86) && !defined(__32BIT__) +/* Microsoft C in 16-bit mode */ + +# define MY_ZCALLOC + +#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) +# define _halloc halloc +# define _hfree hfree +#endif + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + return _halloc((long)items, size); +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + _hfree(ptr); +} + +#endif /* MSC */ + + +#ifndef MY_ZCALLOC /* Any system without a special alloc function */ + +#ifndef STDC +extern voidp calloc OF((uInt items, uInt size)); +extern void free OF((voidpf ptr)); +#endif + +voidpf zcalloc (opaque, items, size) + voidpf opaque; + unsigned items; + unsigned size; +{ + if (opaque) items += size - size; /* make compiler happy */ + return (voidpf)calloc(items, size); +} + +void zcfree (opaque, ptr) + voidpf opaque; + voidpf ptr; +{ + free(ptr); + if (opaque) return; /* make compiler happy */ +} + +#endif /* MY_ZCALLOC */ Index: xc/extras/freetype2/src/gzip/zutil.h diff -u /dev/null xc/extras/freetype2/src/gzip/zutil.h:1.2 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/gzip/zutil.h Thu May 29 10:53:28 2003 @@ -0,0 +1,220 @@ +/* zutil.h -- internal interface and configuration of the compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id: zutil.h,v 1.3 2002/12/26 20:50:40 davidT Exp $ */ + +/* $XFree86: xc/extras/freetype2/src/gzip/zutil.h,v 1.2 2003/05/29 14:53:28 dawes Exp $ */ + +#ifndef _Z_UTIL_H +#define _Z_UTIL_H + +#include "zlib.h" + +#if 0 +#ifdef STDC +# include <stddef.h> +# include <string.h> +# include <stdlib.h> +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include <errno.h> +#endif +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + + +#define ERR_RETURN(strm,err) \ + return (strm->msg = (char*)ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + +#ifdef MSDOS +# define OS_CODE 0x00 +# if defined(__TURBOC__) || defined(__BORLANDC__) +# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) + /* Allow compilation with ANSI keywords only enabled */ + void _Cdecl farfree( void *block ); + void *_Cdecl farmalloc( unsigned long nbytes ); +# else +# include <alloc.h> +# endif +# else /* MSC or DJGPP */ +# include <malloc.h> +# endif +#endif + +#ifdef OS2 +# define OS_CODE 0x06 +#endif + +#ifdef WIN32 /* Window 95 & Windows NT */ +# define OS_CODE 0x0b +#endif + +#if defined(VAXC) || defined(VMS) +# define OS_CODE 0x02 +# define F_OPEN(name, mode) \ + fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") +#endif + +#ifdef AMIGA +# define OS_CODE 0x01 +#endif + +#if defined(ATARI) || defined(atarist) +# define OS_CODE 0x05 +#endif + +#if defined(MACOS) || defined(TARGET_OS_MAC) +# define OS_CODE 0x07 +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include <unix.h> /* for fdopen */ +# else +# ifndef fdopen +# define fdopen(fd,mode) NULL /* No fdopen() */ +# endif +# endif +#endif + +#ifdef __50SERIES /* Prime/PRIMOS */ +# define OS_CODE 0x0F +#endif + +#ifdef TOPS20 +# define OS_CODE 0x0a +#endif + +#if defined(_BEOS_) || defined(RISCOS) +# define fdopen(fd,mode) NULL /* No fdopen() */ +#endif + +#if (defined(_MSC_VER) && (_MSC_VER > 600)) +# define fdopen(fd,type) _fdopen(fd,type) +#endif + + + /* Common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#ifdef HAVE_STRERROR + extern char *strerror OF((int)); +# define zstrerror(errnum) strerror(errnum) +#else +# define zstrerror(errnum) "" +#endif + +#if defined(pyr) +# define NO_MEMCPY +#endif +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) + /* Use our own functions for small and medium model with MSC <= 5.0. + * You may have to use the same strategy for Borland C (untested). + * The __SC__ check is for Symantec. + */ +# define NO_MEMCPY +#endif +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) +# define HAVE_MEMCPY +#endif +#ifdef HAVE_MEMCPY +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ +# define zmemcpy _fmemcpy +# define zmemcmp _fmemcmp +# define zmemzero(dest, len) _fmemset(dest, 0, len) +# else +# define zmemcpy ft_memcpy +# define zmemcmp memcmp +# define zmemzero(dest, len) memset(dest, 0, len) +# endif +#else + extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + extern void zmemzero OF((Bytef* dest, uInt len)); +#endif + +/* Diagnostic functions */ +#ifdef DEBUG +# include <stdio.h> + extern int z_verbose; + extern void z_error OF((char *m)); +# define Assert(cond,msg) {if(!(cond)) z_error(msg);} +# define Trace(x) {if (z_verbose>=0) fprintf x ;} +# define Tracev(x) {if (z_verbose>0) fprintf x ;} +# define Tracevv(x) {if (z_verbose>1) fprintf x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + + +typedef uLong (*check_func) OF((uLong check, const Bytef *buf, + uInt len)); +local voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); +local void zcfree OF((voidpf opaque, voidpf ptr)); + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + +#endif /* _Z_UTIL_H */ Index: xc/extras/freetype2/src/otlayout/otlayout.h diff -u xc/extras/freetype2/src/otlayout/otlayout.h:1.1.1.1 xc/extras/freetype2/src/otlayout/otlayout.h:1.1.1.2 --- xc/extras/freetype2/src/otlayout/otlayout.h:1.1.1.1 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/otlayout/otlayout.h Wed May 28 22:01:52 2003 @@ -24,9 +24,13 @@ typedef int OTL_Int; typedef unsigned int OTL_UInt; + typedef long OTL_Long; + typedef unsigned long OTL_ULong; + typedef short OTL_Int16; typedef unsigned short OTL_UInt16; + #if OTL_SIZEOF_INT == 4 typedef int OTL_Int32; @@ -58,22 +62,55 @@ OTL_Err_InvalidFormat, OTL_Err_InvalidOffset, + OTL_Err_Max + } OTL_Error; /************************************************************************/ /************************************************************************/ /***** *****/ + /***** MEMORY MANAGEMENT *****/ + /***** *****/ + /************************************************************************/ + /************************************************************************/ + + typedef OTL_Pointer (*OTL_AllocFunc)( OTL_ULong size, + OTL_Pointer data ); + + typedef OTL_Pointer (*OTL_ReallocFunc)( OTL_Pointer block, + OTL_ULong size, + OTL_Pointer data ); + + typedef void (*OTL_FreeFunc)( OTL_Pointer block, + OTL_Pointer data ); + + typedef struct OTL_MemoryRec_ + { + OTL_Pointer mem_data; + OTL_AllocFunc mem_alloc; + OTL_ReallocFunc mem_realloc; + OTL_FreeFunc mem_free; + + } OTL_MemoryRec, *OTL_Memory; + + /************************************************************************/ + /************************************************************************/ + /***** *****/ /***** ENUMERATIONS *****/ /***** *****/ /************************************************************************/ /************************************************************************/ +/* re-define OTL_MAKE_TAG to something different if you're not */ +/* using an ASCII-based character set (Vaxes anyone ?) */ +#ifndef OTL_MAKE_TAG #define OTL_MAKE_TAG(c1,c2,c3,c4) \ ( ( (OTL_UInt32)(c1) << 24 ) | \ (OTL_UInt32)(c2) << 16 ) | \ (OTL_UInt32)(c3) << 8 ) | \ (OTL_UInt32)(c4) ) +#endif typedef enum OTL_ScriptTag_ { @@ -153,8 +190,8 @@ #define OTL_INVALID(e) otl_validator_error( valid, e ) -#define OTL_INVALID_TOO_SHORT OTL_INVALID( OTL_Err_InvalidOffset ); -#define OTL_INVALID_DATA OTL_INVALID( OTL_Err_InvalidFormat ); +#define OTL_INVALID_TOO_SHORT OTL_INVALID( OTL_Err_InvalidOffset ) +#define OTL_INVALID_DATA OTL_INVALID( OTL_Err_InvalidFormat ) #define OTL_CHECK(_count) OTL_BEGIN_STMNT \ if ( p + (_count) > valid->limit ) \ Index: xc/extras/freetype2/src/otlayout/otlconf.h diff -u xc/extras/freetype2/src/otlayout/otlconf.h:1.1.1.1 xc/extras/freetype2/src/otlayout/otlconf.h:1.1.1.2 --- xc/extras/freetype2/src/otlayout/otlconf.h:1.1.1.1 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/otlayout/otlconf.h Wed May 28 22:01:52 2003 @@ -43,10 +43,10 @@ #define OTL_BEGIN_STMNT do { #define OTL_END_STMNT } while (0) -#define OTL_DUMMY_STMNT do { } while (0) +#define OTL_DUMMY_STMNT OTL_BEGIN_STMNT OTL_END_STMNT #define OTL_UNUSED( x ) (x)=(x) -#define OTL_UNUSED_CONST(x) (void)(x) +#define OTL_UNUSED_CONST(x) (void)(x) #include <limits.h> @@ -68,6 +68,11 @@ # error "unsupported number of bytes in 'long' type!" #endif +#include <setjmp.h> +#define OTL_jmp_buf jmp_buf +#define otl_setjmp setjmp +#define otl_longjmp longjmp + /* */ #endif /* __OT_LAYOUT_CONFIG_H__ */ Index: xc/extras/freetype2/src/otlayout/otlgsub.c diff -u xc/extras/freetype2/src/otlayout/otlgsub.c:1.1.1.1 xc/extras/freetype2/src/otlayout/otlgsub.c:1.1.1.2 --- xc/extras/freetype2/src/otlayout/otlgsub.c:1.1.1.1 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/otlayout/otlgsub.c Wed May 28 22:01:52 2003 @@ -9,6 +9,28 @@ /************************************************************************/ /************************************************************************/ + /* + * 1: Single Substitution - Table format(s) + * + * This table is used to substiture individual glyph indices + * with another one. There are only two sub-formats: + * + * Name Offset Size Description + * ------------------------------------------ + * format 0 2 sub-table format (1) + * offset 2 2 offset to coverage table + * delta 4 2 16-bit delta to apply on all + * covered glyph indices + * + * Name Offset Size Description + * ------------------------------------------ + * format 0 2 sub-table format (2) + * offset 2 2 offset to coverage table + * count 4 2 coverage table count + * substs[] 6 2*count substituted glyph indices, + * + */ + static void otl_gsub_lookup1_validate( OTL_Bytes table, OTL_Validator valid ) @@ -42,6 +64,10 @@ otl_coverage_validate( table + coverage, valid ); OTL_CHECK( 2*count ); + + /* NB: we don't check that there are at most 'count' */ + /* elements in the coverage table. This is delayed */ + /* to the lookup function... */ } break; @@ -51,6 +77,63 @@ } + static OTL_Bool + otl_gsub_lookup1_apply( OTL_Bytes table, + OTL_Parser parser ) + { + OTL_Bytes p = table; + OTL_Bytes coverage; + OTL_UInt format, gindex, property; + OTL_Int index; + OTL_Bool subst = 0; + + if ( parser->context_len != 0xFFFF && parser->context_len < 1 ) + goto Exit; + + gindex = otl_parser_get_gindex( parser ); + + if ( !otl_parser_check_property( parser, gindex, &property ) ) + goto Exit; + + format = OTL_NEXT_USHORT(p); + coverage = table + OTL_NEXT_USHORT(p); + index = otl_coverage_lookup( coverage, gindex ); + + if ( index >= 0 ) + { + switch ( format ) + { + case 1: + { + OTL_Int delta = OTL_NEXT_SHORT(p); + + gindex = ( gindex + delta ) & 0xFFFF; + otl_parser_replace_1( parser, gindex ); + subst = 1; + } + break; + + case 2: + { + OTL_UInt count = OTL_NEXT_USHORT(p); + + if ( (OTL_UInt) index < count ) + { + p += index*2; + otl_parser_replace_1( parser, OTL_PEEK_USHORT(p) ); + subst = 1; + } + } + break; + + default: + ; + } + } + Exit: + return subst; + } + /************************************************************************/ /************************************************************************/ /***** *****/ @@ -59,6 +142,26 @@ /************************************************************************/ /************************************************************************/ + /* + * 2: Multiple Substitution - Table format(s) + * + * Replaces a single glyph with one or more glyphs. + * + * Name Offset Size Description + * ----------------------------------------------------------- + * format 0 2 sub-table format (1) + * offset 2 2 offset to coverage table + * count 4 2 coverage table count + * sequencess[] 6 2*count offsets to sequence items + * + * each sequence item has the following format: + * + * Name Offset Size Description + * ----------------------------------------------------------- + * count 0 2 number of replacement glyphs + * gindices[] 2 2*count string of glyph indices + */ + static void otl_seq_validate( OTL_Bytes table, OTL_Validator valid ) @@ -69,6 +172,9 @@ OTL_CHECK( 2 ); count = OTL_NEXT_USHORT( p ); + /* XXX: according to the spec, 'count' should be > 0 */ + /* we can deal with these cases pretty well however */ + OTL_CHECK( 2*count ); /* check glyph indices */ } @@ -106,6 +212,45 @@ } } + + static OTL_Bool + otl_gsub_lookup2_apply( OTL_Bytes table, + OTL_Parser parser ) + { + OTL_Bytes p = table; + OTL_Bytes coverage, sequence; + OTL_UInt format, gindex, index, property; + OTL_Int index; + OTL_Bool subst = 0; + + if ( context_len != 0xFFFF && context_len < 1 ) + goto Exit; + + gindex = otl_parser_get_gindex( parser ); + + if ( !otl_parser_check_property( parser, gindex, &property ) ) + goto Exit; + + p += 2; /* skip format */ + coverage = table + OTL_NEXT_USHORT(p); + seq_count = OTL_NEXT_USHORT(p); + index = otl_coverage_lookup( coverage, gindex ); + + if ( (OTL_UInt) index >= seq_count ) + goto Exit; + + p += index*2; + sequence = table + OTL_PEEK_USHORT(p); + p = sequence; + count = OTL_NEXT_USHORT(p); + + otl_parser_replace_n( parser, count, p ); + subst = 1; + + Exit: + return subst; + } + /************************************************************************/ /************************************************************************/ /***** *****/ @@ -114,6 +259,28 @@ /************************************************************************/ /************************************************************************/ + /* + * 3: Alternate Substitution - Table format(s) + * + * Replaces a single glyph by another one taken liberally + * in a list of alternatives + * + * Name Offset Size Description + * ----------------------------------------------------------- + * format 0 2 sub-table format (1) + * offset 2 2 offset to coverage table + * count 4 2 coverage table count + * alternates[] 6 2*count offsets to alternate items + * + * each alternate item has the following format: + * + * Name Offset Size Description + * ----------------------------------------------------------- + * count 0 2 number of replacement glyphs + * gindices[] 2 2*count string of glyph indices, each one + * is a valid alternative + */ + static void otl_alternate_set_validate( OTL_Bytes table, OTL_Validator valid ) @@ -162,6 +329,52 @@ } + static OTL_Bool + otl_gsub_lookup3_apply( OTL_Bytes table, + OTL_Parser parser ) + { + OTL_Bytes p = table; + OTL_Bytes coverage, alternates; + OTL_UInt format, gindex, index, property; + OTL_Int index; + OTL_Bool subst = 0; + + OTL_GSUB_Alternate alternate = parser->alternate; + + if ( context_len != 0xFFFF && context_len < 1 ) + goto Exit; + + if ( alternate == NULL ) + goto Exit; + + gindex = otl_parser_get_gindex( parser ); + + if ( !otl_parser_check_property( parser, gindex, &property ) ) + goto Exit; + + p += 2; /* skip format */ + coverage = table + OTL_NEXT_USHORT(p); + seq_count = OTL_NEXT_USHORT(p); + index = otl_coverage_lookup( coverage, gindex ); + + if ( (OTL_UInt) index >= seq_count ) + goto Exit; + + p += index*2; + alternates = table + OTL_PEEK_USHORT(p); + p = alternates; + count = OTL_NEXT_USHORT(p); + + gindex = alternate->handler_func( + gindex, count, p, alternate->handler_data ); + + otl_parser_replace_1( parser, gindex ); + subst = 1; + + Exit: + return subst; + } + /************************************************************************/ /************************************************************************/ /***** *****/ Index: xc/extras/freetype2/src/otlayout/otlgsub.h diff -u xc/extras/freetype2/src/otlayout/otlgsub.h:1.1.1.1 xc/extras/freetype2/src/otlayout/otlgsub.h:1.1.1.2 --- xc/extras/freetype2/src/otlayout/otlgsub.h:1.1.1.1 Thu Jun 20 04:16:17 2002 +++ xc/extras/freetype2/src/otlayout/otlgsub.h Wed May 28 22:01:52 2003 @@ -5,6 +5,18 @@ OTL_BEGIN_HEADER + typedef OTL_UInt (*OTL_GSUB_AlternateFunc)( OTL_UInt gindex, + OTL_UInt count, + OTL_Bytes alternates, + OTL_Pointer data ); + + typedef struct OTL_GSUB_AlternateRec_ + { + OTL_GSUB_AlternateFunc handler_func; + OTL_Pointer handler_data; + + } OTL_GSUB_AlternateRec, *OTL_GSUB_Alternate; + OTL_LOCAL( void ) otl_gsub_validate( OTL_Bytes table, OTL_Validator valid ); Index: xc/extras/freetype2/src/otlayout/otlparse.c diff -u /dev/null xc/extras/freetype2/src/otlayout/otlparse.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/otlayout/otlparse.c Wed May 28 22:01:52 2003 @@ -0,0 +1,142 @@ +#include "otlparse.h" +#include "otlutils.h" + + static void + otl_string_ensure( OTL_String string, + OTL_UInt count, + OTL_Parser parser ) + { + count += string->length; + + if ( count > string->capacity ) + { + OTL_UInt old_count = string->capacity; + OTL_UInt new_count = old_count; + OTL_Memory memory = parser->memory; + + while ( new_count < count ) + new_count += (new_count >> 1) + 16; + + if ( OTL_MEM_RENEW_ARRAY( string->glyphs, old_count, new_count ) ) + otl_parser_error( parser, OTL_Parse_Err_Memory ); + + string->capacity = new_count; + } + } + +#define OTL_STRING_ENSURE(str,count,parser) \ + OTL_BEGIN_STMNT \ + if ( (str)->length + (count) > (str)>capacity ) \ + otl_string_ensure( str, count, parser ); \ + OTL_END_STMNT + + + OTL_LOCALDEF( OTL_UInt ) + otl_parser_get_gindex( OTL_Parser parser ) + { + OTL_String in = parser->str_in; + + if ( in->cursor >= in->num_glyphs ) + otl_parser_error( parser, OTL_Err_Parser_Internal ); + + return in->str[ in->cursor ].gindex; + } + + + OTL_LOCALDEF( void ) + otl_parser_error( OTL_Parser parser, + OTL_ParseError error; ) + { + parser->error = error; + otl_longjmp( parser->jump_buffer, 1 ); + } + +#define OTL_PARSER_UNCOVERED(x) otl_parser_error( x, OTL_Parse_Err_UncoveredGlyph ); + + OTL_LOCAL( void ) + otl_parser_check_property( OTL_Parser parser, + OTL_UInt gindex, + OTL_UInt flags, + OTL_UInt *aproperty ); + + OTL_LOCALDEF( void ) + otl_parser_replace_1( OTL_Parser parser, + OTL_UInt gindex ) + { + OTL_String in = parser->str_in; + OTL_String out = parser->str_out; + OTL_StringGlyph glyph, in_glyph; + + /* sanity check */ + if ( in == NULL || + out == NULL || + in->length == 0 || + in->cursor >= in->length ) + { + /* report as internal error, since these should */ + /* never happen !! */ + otl_parser_error( parser, OTL_Err_Parse_Internal ); + } + + OTL_STRING_ENSURE( out, 1, parser ); + glyph = out->glyphs + out->length; + in_glyph = in->glyphs + in->cursor; + + glyph->gindex = gindex; + glyph->property = in_glyph->property; + glyph->lig_component = in_glyph->lig_component; + glyph->lig_id = in_glyph->lig_id; + + out->length += 1; + out->cursor = out->length; + in->cursor += 1; + } + + OTL_LOCALDEF( void ) + otl_parser_replace_n( OTL_Parser parser, + OTL_UInt count, + OTL_Bytes indices ) + { + OTL_UInt lig_component, lig_id, property; + OTL_String in = parser->str_in; + OTL_String out = parser->str_out; + OTL_StringGlyph glyph, in_glyph; + OTL_Bytes p = indices; + + /* sanity check */ + if ( in == NULL || + out == NULL || + in->length == 0 || + in->cursor >= in->length ) + { + /* report as internal error, since these should */ + /* never happen !! */ + otl_parser_error( parser, OTL_Err_Parse_Internal ); + } + + OTL_STRING_ENSURE( out, count, parser ); + glyph = out->glyphs + out->length; + in_glyph = in->glyphs + in->cursor; + + glyph->gindex = gindex; + + lig_component = in_glyph->lig_component; + lig_id = in_glyph->lid_id; + property = in_glyph->property; + + for ( ; count > 0; count-- ) + { + glyph->gindex = OTL_NEXT_USHORT(p); + glyph->property = property; + glyph->lig_component = lig_component; + glyph->lig_id = lig_id; + + out->length ++; + } + + out->cursor = out->length; + in->cursor += 1; + } + + + Index: xc/extras/freetype2/src/otlayout/otlparse.h diff -u /dev/null xc/extras/freetype2/src/otlayout/otlparse.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/otlayout/otlparse.h Wed May 28 22:01:52 2003 @@ -0,0 +1,99 @@ +#ifndef __OTL_PARSER_H__ +#define __OTL_PARSER_H__ + +#include "otlayout.h" +#include "otlgdef.h" +#include "otlgsub.h" +#include "otlgpos.h" + +OTL_BEGIN_HEADER + + typedef struct OTL_ParserRec_* OTL_Parser; + + typedef struct OTL_StringRec_* OTL_String; + + typedef struct OTL_StringGlyphRec_ + { + OTL_UInt gindex; + OTL_UInt properties; + OTL_UInt lig_component; + OTL_UInt lig_id; + + } OTL_StringGlyphRec, *OTL_StringGlyph; + + typedef struct OTL_StringRec_ + { + OTL_StringGlyph glyphs; + OTL_UInt cursor; + OTL_UInt length; + OTL_UInt capacity; + + } OTL_StringRec; + + typedef struct OTL_ParserRec_ + { + OTL_Bytes tab_gdef; + OTL_Bytes tab_gsub; + OTL_Bytes tab_gpos; + OTL_Bytes tab_base; + OTL_Bytes tab_jstf; + + OTL_Alternate alternate; /* external alternate handler */ + + OTL_UInt context_len; + OTL_UInt markup_flags; + + OTL_jmp_buf jump_buffer; + OTL_Memory memory; + OTL_Error error; + + OTL_StringRec strings[2]; + OTL_String str_in; + OTL_String str_out; + + } OTL_ParserRec; + + typedef enum + { + OTL_Err_Parser_Ok = 0, + OTL_Err_Parser_InvalidData, + OTL_Err_Parser_UncoveredGlyph + + } OTL_ParseError; + + OTL_LOCAL( OTL_UInt ) + otl_parser_get_gindex( OTL_Parser parser ); + + + OTL_LOCAL( void ) + otl_parser_error( OTL_Parser parser, OTL_ParserError error ); + +#define OTL_PARSER_UNCOVERED(x) \ + otl_parser_error( x, OTL_Err_Parser_UncoveredGlyph ) + + OTL_LOCAL( void ) + otl_parser_check_property( OTL_Parser parser, + OTL_UInt gindex, + OTL_UInt flags, + OTL_UInt *aproperty ); + + /* copy current input glyph to output */ + OTL_LOCAL( void ) + otl_parser_copy_1( OTL_Parser parser ); + + /* copy current input glyph to output, replacing its index */ + OTL_LOCAL( void ) + otl_parser_replace_1( OTL_Parser parser, + OTL_UInt gindex ); + + /* copy current input glyph to output, replacing it by several indices */ + /* read directly from the table */ + OTL_LOCAL( void ) + otl_parser_replace_n( OTL_Parser parser, + OTL_UInt count, + OTL_Bytes indices ); + +OTL_END_HEADER + +#endif /* __OTL_PARSER_H__ */ + Index: xc/extras/freetype2/src/otlayout/otltags.h diff -u xc/extras/freetype2/src/otlayout/otltags.h:1.1.1.1 xc/extras/freetype2/src/otlayout/otltags.h:1.1.1.2 --- xc/extras/freetype2/src/otlayout/otltags.h:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/otlayout/otltags.h Wed May 28 22:01:52 2003 @@ -19,10 +19,12 @@ OTL_SCRIPT_TAG( 'b','e','n','g', "Bengali", BENGALI ) OTL_SCRIPT_TAG( 'b','o','p','o', "Bopomofo", BOPOMOFO ) OTL_SCRIPT_TAG( 'b','r','a','i', "Braille", BRAILLE ) +OTL_SCRIPT_TAG( 'b','y','z','m', "Byzantine Music", BYZANTINE_MUSIC ) OTL_SCRIPT_TAG( 'c','a','n','s', "Canadian Syllabic", CANADIAN ) OTL_SCRIPT_TAG( 'c','h','e','r', "Cherokee", CHEROKEE ) OTL_SCRIPT_TAG( 'h','a','n','i', "CJK Ideographic", CJK ) OTL_SCRIPT_TAG( 'c','y','r','l', "Cyrillic", CYRILLIC ) +OTL_SCRIPT_TAG( 'd','f','l','t', "Default", DEFAULT ) OTL_SCRIPT_TAG( 'd','e','v','a', "Devanagari", DEVANAGARI ) OTL_SCRIPT_TAG( 'e','t','h','i', "Ethiopic", ETHIOPIC ) OTL_SCRIPT_TAG( 'g','e','o','r', "Georgian", GEORGIAN ) @@ -32,9 +34,9 @@ OTL_SCRIPT_TAG( 'j','a','m','o', "Hangul Jamo", JAMO ) OTL_SCRIPT_TAG( 'h','a','n','g', "Hangul", HANGUL ) OTL_SCRIPT_TAG( 'h','e','b','r', "Hebrew", HEBREW ) -OTL_SCRIPT_TAG( 'h','i','r','a', "Hiragana", HIRAGANA ) +OTL_SCRIPT_TAG( 'h','i','r','a', "Hiragana", HIRAGANA ) /* not in TAGS.txt */ OTL_SCRIPT_TAG( 'k','n','d','a', "Kannada", KANNADA ) -OTL_SCRIPT_TAG( 'k','a','n','a', "Katakana", KATAKANA ) +OTL_SCRIPT_TAG( 'k','a','n','a', "Katakana", KATAKANA ) /* in TAGS.txt, means Hiragana _and_ Katakana */ OTL_SCRIPT_TAG( 'k','h','m','r', "Khmer", KHMER ) OTL_SCRIPT_TAG( 'l','a','o',' ', "Lao", LAO ) OTL_SCRIPT_TAG( 'l','a','t','n', "Latin", LATIN ) Index: xc/extras/freetype2/src/otlayout/otlutils.h diff -u /dev/null xc/extras/freetype2/src/otlayout/otlutils.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/otlayout/otlutils.h Wed May 28 22:01:52 2003 @@ -0,0 +1,33 @@ +#ifndef __OTLAYOUT_UTILS_H__ +#define __OTLAYOUT_UTILS_H__ + +#include "otlayout.h" + +OTL_BEGIN_HEADER + + OTL_LOCAL( OTL_Error ) + otl_mem_alloc( OTL_Pointer* pblock, + OTL_ULong size, + OTL_Memory memory ); + + OTL_LOCAL( void ) + otl_mem_free( OTL_Pointer* pblock, + OTL_Memory memory ); + + OTL_LOCAL( OTL_Error ) + otl_mem_realloc( OTL_Pointer *pblock, + OTL_ULong cur_size, + OTL_ULong new_size, + OTL_Memory memory ); + +#define OTL_MEM_ALLOC(p,s) otl_mem_alloc( (void**)&(p), (s), memory ) +#define OTL_MEM_FREE(p) otl_mem_free( (void**)&(p), memory ) +#define OTL_MEM_REALLOC(p,c,n) otl_mem_realloc( (void**)&(p), (c), (s), memory ) + +#define OTL_MEM_NEW(p) OTL_MEM_ALLOC(p,sizeof(*(p))) +#define OTL_MEM_NEW_ARRAY(p,c) OTL_MEM_ALLOC(p,(c)*sizeof(*(p))) +#define OTL_MEM_RENEW_ARRAY(p,c,n) OTL_MEM_REALLOC(p,(c)*sizeof(*(p)),(n)*sizeof(*(p))) + +OTL_END_HEADER + +#endif /* __OTLAYOUT_UTILS_H__ */ Index: xc/extras/freetype2/src/pcf/Jamfile diff -u xc/extras/freetype2/src/pcf/Jamfile:1.1.1.1 xc/extras/freetype2/src/pcf/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/pcf/Jamfile:1.1.1.1 Sun Sep 9 22:56:04 2001 +++ xc/extras/freetype2/src/pcf/Jamfile Wed May 28 22:01:52 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/pcf Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src pcf ; - -SubDirHdrs [ FT2_SubDir src pcf ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) pcf ; { local _sources ; Index: xc/extras/freetype2/src/pcf/pcf.h diff -u xc/extras/freetype2/src/pcf/pcf.h:1.1.1.5 xc/extras/freetype2/src/pcf/pcf.h:1.1.1.6 --- xc/extras/freetype2/src/pcf/pcf.h:1.1.1.5 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pcf/pcf.h Wed May 28 22:01:52 2003 @@ -31,6 +31,7 @@ #include <ft2build.h> #include FT_INTERNAL_DRIVER_H +#include FT_INTERNAL_STREAM_H FT_BEGIN_HEADER @@ -135,6 +136,9 @@ { FT_FaceRec root; + FT_StreamRec gzip_stream; + FT_Stream gzip_source; + char* charset_encoding; char* charset_registry; @@ -225,7 +229,6 @@ pcf_load_font( FT_Stream, PCF_Face ); - FT_END_HEADER #endif /* __PCF_H__ */ Index: xc/extras/freetype2/src/pcf/pcfdriver.c diff -u xc/extras/freetype2/src/pcf/pcfdriver.c:1.4 xc/extras/freetype2/src/pcf/pcfdriver.c:1.5 --- xc/extras/freetype2/src/pcf/pcfdriver.c:1.4 Thu Jun 20 04:25:27 2002 +++ xc/extras/freetype2/src/pcf/pcfdriver.c Wed May 28 22:13:04 2003 @@ -30,10 +30,14 @@ #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_OBJECTS_H +#include FT_GZIP_H +#include FT_ERRORS_H +#include FT_BDF_H #include "pcf.h" #include "pcfdriver.h" #include "pcfutil.h" +#include "pcfread.h" #include "pcferror.h" @@ -41,8 +45,6 @@ #define FT_COMPONENT trace_pcfread -#ifdef FT_CONFIG_OPTION_USE_CMAPS - typedef struct PCF_CMapRec_ { FT_CMapRec cmap; @@ -95,7 +97,7 @@ if ( charcode == code ) { - result = encodings[mid].glyph; + result = encodings[mid].glyph + 1; break; } @@ -132,7 +134,7 @@ if ( charcode == code ) { - result = encodings[mid].glyph; + result = encodings[mid].glyph + 1; goto Exit; } @@ -146,7 +148,7 @@ if ( min < cmap->num_encodings ) { charcode = encodings[min].enc; - result = encodings[min].glyph; + result = encodings[min].glyph + 1; } Exit: @@ -164,77 +166,6 @@ (FT_CMap_CharNextFunc) pcf_cmap_char_next }; -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - static FT_UInt - PCF_Char_Get_Index( FT_CharMap charmap, - FT_Long char_code ) - { - PCF_Face face = (PCF_Face)charmap->face; - PCF_Encoding en_table = face->encodings; - int low, high, mid; - - - FT_TRACE4(( "get_char_index %ld\n", char_code )); - - low = 0; - high = face->nencodings - 1; - while ( low <= high ) - { - mid = ( low + high ) / 2; - if ( char_code < en_table[mid].enc ) - high = mid - 1; - else if ( char_code > en_table[mid].enc ) - low = mid + 1; - else - return en_table[mid].glyph; - } - - return 0; - } - - - static FT_Long - PCF_Char_Get_Next( FT_CharMap charmap, - FT_Long char_code ) - { - PCF_Face face = (PCF_Face)charmap->face; - PCF_Encoding en_table = face->encodings; - int low, high, mid; - - - FT_TRACE4(( "get_next_char %ld\n", char_code )); - - char_code++; - low = 0; - high = face->nencodings - 1; - - while ( low <= high ) - { - mid = ( low + high ) / 2; - if ( char_code < en_table[mid].enc ) - high = mid - 1; - else if ( char_code > en_table[mid].enc ) - low = mid + 1; - else - return char_code; - } - - if ( high < 0 ) - high = 0; - - while ( high < face->nencodings ) - { - if ( en_table[high].enc >= char_code ) - return en_table[high].enc; - high++; - } - - return 0; - } - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ - /*************************************************************************/ /* */ @@ -279,7 +210,14 @@ FT_FREE( face->charset_encoding ); FT_FREE( face->charset_registry ); - FT_TRACE4(( "DONE_FACE!!!\n" )); + FT_TRACE4(( "PCF_Face_Done: done face\n" )); + + /* close gzip stream if any */ + if ( face->root.stream == &face->gzip_stream ) + { + FT_Stream_Close( &face->gzip_stream ); + face->root.stream = face->gzip_source; + } return PCF_Err_Ok; } @@ -301,7 +239,27 @@ error = pcf_load_font( stream, face ); if ( error ) - goto Fail; + { + FT_Error error2; + + /* this didn't work, try gzip support !! */ + error2 = FT_Stream_OpenGzip( &face->gzip_stream, stream ); + if ( error2 == FT_Err_Unimplemented_Feature ) + goto Fail; + + error = error2; + if ( error ) + goto Fail; + + face->gzip_source = stream; + face->root.stream = &face->gzip_stream; + + stream = face->root.stream; + + error = pcf_load_font( stream, face ); + if ( error ) + goto Fail; + } /* set-up charmap */ { @@ -321,50 +279,30 @@ unicode_charmap = 1; } -#ifdef FT_CONFIG_OPTION_USE_CMAPS - { FT_CharMapRec charmap; charmap.face = FT_FACE( face ); - charmap.encoding = ft_encoding_none; + charmap.encoding = FT_ENCODING_NONE; charmap.platform_id = 0; charmap.encoding_id = 0; if ( unicode_charmap ) { - charmap.encoding = ft_encoding_unicode; + charmap.encoding = FT_ENCODING_UNICODE; charmap.platform_id = 3; charmap.encoding_id = 1; } error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL ); - } - -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - /* XXX: charmaps. For now, report unicode for Unicode and Latin 1 */ - face->root.charmaps = &face->charmap_handle; - face->root.num_charmaps = 1; - face->charmap.encoding = ft_encoding_none; - face->charmap.platform_id = 0; - face->charmap.encoding_id = 0; - - if ( unicode_charmap ) - { - face->charmap.encoding = ft_encoding_unicode; - face->charmap.platform_id = 3; - face->charmap.encoding_id = 1; +#if 0 + /* Select default charmap */ + if (face->root.num_charmaps) + face->root.charmap = face->root.charmaps[0]; +#endif } - - face->charmap.face = &face->root; - face->charmap_handle = &face->charmap; - face->root.charmap = face->charmap_handle; - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ - } Exit: @@ -412,12 +350,11 @@ PCF_Glyph_Load( FT_GlyphSlot slot, FT_Size size, FT_UInt glyph_index, - FT_Int load_flags ) + FT_Int32 load_flags ) { PCF_Face face = (PCF_Face)FT_SIZE_FACE( size ); FT_Stream stream = face->root.stream; FT_Error error = PCF_Err_Ok; - FT_Memory memory = FT_FACE( face )->memory; FT_Bitmap* bitmap = &slot->bitmap; PCF_Metric metric; int bytes; @@ -433,12 +370,15 @@ goto Exit; } + if ( glyph_index > 0 ) + glyph_index--; + metric = face->metrics + glyph_index; bitmap->rows = metric->ascent + metric->descent; bitmap->width = metric->rightSideBearing - metric->leftSideBearing; bitmap->num_grays = 1; - bitmap->pixel_mode = ft_pixel_mode_mono; + bitmap->pixel_mode = FT_PIXEL_MODE_MONO; FT_TRACE6(( "BIT_ORDER %d ; BYTE_ORDER %d ; GLYPH_PAD %d\n", PCF_BIT_ORDER( face->bitmapsFormat ), @@ -470,7 +410,8 @@ /* XXX: to do: are there cases that need repadding the bitmap? */ bytes = bitmap->pitch * bitmap->rows; - if ( FT_ALLOC( bitmap->buffer, bytes ) ) + error = ft_glyphslot_alloc_bitmap( slot, bytes ); + if ( error ) goto Exit; if ( FT_STREAM_SEEK( metric->bits ) || @@ -478,7 +419,7 @@ goto Exit; if ( PCF_BIT_ORDER( face->bitmapsFormat ) != MSBFirst ) - BitOrderInvert( bitmap->buffer,bytes ); + BitOrderInvert( bitmap->buffer, bytes ); if ( ( PCF_BYTE_ORDER( face->bitmapsFormat ) != PCF_BIT_ORDER( face->bitmapsFormat ) ) ) @@ -502,14 +443,14 @@ slot->bitmap_top = metric->ascent; slot->metrics.horiAdvance = metric->characterWidth << 6 ; - slot->metrics.horiBearingX = metric->rightSideBearing << 6 ; + slot->metrics.horiBearingX = metric->leftSideBearing << 6 ; slot->metrics.horiBearingY = metric->ascent << 6 ; - slot->metrics.width = metric->characterWidth << 6 ; + slot->metrics.width = ( metric->rightSideBearing - + metric->leftSideBearing ) << 6; slot->metrics.height = bitmap->rows << 6; slot->linearHoriAdvance = (FT_Fixed)bitmap->width << 16; - slot->format = ft_glyph_format_bitmap; - slot->flags = FT_GLYPH_OWN_BITMAP; + slot->format = FT_GLYPH_FORMAT_BITMAP; FT_TRACE4(( " --- ok\n" )); @@ -518,6 +459,49 @@ } + static FT_Error + pcf_get_bdf_property( PCF_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ) + { + PCF_Property prop; + + prop = pcf_find_property( face, prop_name ); + if ( prop != NULL ) + { + if ( prop->isString ) + { + aproperty->type = BDF_PROPERTY_TYPE_ATOM; + aproperty->u.atom = prop->value.atom; + } + else + { + /* apparently, the PCF driver loads all properties as signed integers ! + * this really doesn't seem to be a problem, because this is + * sufficient for any meaningful values + */ + aproperty->type = BDF_PROPERTY_TYPE_INTEGER; + aproperty->u.integer = prop->value.integer; + } + return 0; + } + return FT_Err_Invalid_Argument; + } + + + static FT_Module_Interface + pcf_driver_requester( FT_Module module, + const char* name ) + { + FT_UNUSED( module ); + + if ( name && ft_strcmp( name, "get_bdf_property" ) == 0 ) + return (FT_Module_Interface) pcf_get_bdf_property; + + return NULL; + } + + FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec pcf_driver_class = { @@ -533,7 +517,7 @@ (FT_Module_Constructor)0, (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 + (FT_Module_Requester) pcf_driver_requester }, sizeof( PCF_FaceRec ), @@ -552,21 +536,9 @@ (FT_Slot_LoadFunc) PCF_Glyph_Load, -#ifndef FT_CONFIG_OPTION_USE_CMAPS - (FT_CharMap_CharIndexFunc)PCF_Char_Get_Index, -#else - (FT_CharMap_CharIndexFunc)0, -#endif - (FT_Face_GetKerningFunc) 0, (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc) 0, - -#ifndef FT_CONFIG_OPTION_USE_CMAPS - (FT_CharMap_CharNextFunc) PCF_Char_Get_Next, -#else - (FT_CharMap_CharNextFunc) 0 -#endif + (FT_Face_GetAdvancesFunc) 0 }; Index: xc/extras/freetype2/src/pcf/pcfread.c diff -u xc/extras/freetype2/src/pcf/pcfread.c:1.1.1.6 xc/extras/freetype2/src/pcf/pcfread.c:1.4 --- xc/extras/freetype2/src/pcf/pcfread.c:1.1.1.6 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pcf/pcfread.c Wed Oct 22 13:26:29 2003 @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - +/* $XFree86: xc/extras/freetype2/src/pcf/pcfread.c,v 1.4 2003/10/22 17:26:29 tsi Exp $ */ #include <ft2build.h> @@ -33,6 +33,7 @@ #include "pcf.h" #include "pcfdriver.h" +#include "pcfread.h" #include "pcferror.h" @@ -249,7 +250,7 @@ FT_ULong *aformat, FT_ULong *asize ) { - FT_Error error = 0; + FT_Error error; FT_Int i; @@ -260,7 +261,7 @@ return PCF_Err_Invalid_Stream_Skip; if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) ) - return PCF_Err_Invalid_Stream_Skip; + return error; *asize = tables[i].size; /* unused - to be removed */ *aformat = tables[i].format; @@ -316,7 +317,7 @@ }; - static PCF_Property + FT_LOCAL_DEF( PCF_Property ) pcf_find_property( PCF_Face face, const FT_String* prop ) { @@ -716,7 +717,6 @@ } FT_Stream_ExitFrame( stream ); - j--; if ( FT_NEW_ARRAY( encoding, j ) ) goto Bail; @@ -986,12 +986,11 @@ prop = pcf_find_property( face, "POINT_SIZE" ); if ( prop != NULL ) { - PCF_Property xres, yres, avgw; + PCF_Property xres, yres; xres = pcf_find_property( face, "RESOLUTION_X" ); yres = pcf_find_property( face, "RESOLUTION_Y" ); - avgw = pcf_find_property( face, "AVERAGE_WIDTH" ); if ( ( yres != NULL ) && ( xres != NULL ) ) { Index: xc/extras/freetype2/src/pcf/pcfread.h diff -u /dev/null xc/extras/freetype2/src/pcf/pcfread.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/pcf/pcfread.h Wed May 28 22:01:53 2003 @@ -0,0 +1,45 @@ +/* pcfread.h + + FreeType font driver for pcf fonts + + Copyright 2000-2001 by + Francesco Zappa Nardelli + +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. +*/ + + +#ifndef __PCFREAD_H__ +#define __PCFREAD_H__ + + +#include <ft2build.h> + +FT_BEGIN_HEADER + + FT_LOCAL( PCF_Property ) + pcf_find_property( PCF_Face face, + const FT_String* prop ); + +FT_END_HEADER + +#endif /* __PCFUTIL_H__ */ + + +/* END */ Index: xc/extras/freetype2/src/pcf/pcfutil.c diff -u xc/extras/freetype2/src/pcf/pcfutil.c:1.4 xc/extras/freetype2/src/pcf/pcfutil.c:1.5 --- xc/extras/freetype2/src/pcf/pcfutil.c:1.4 Mon Dec 16 22:28:26 2002 +++ xc/extras/freetype2/src/pcf/pcfutil.c Mon Dec 22 12:48:01 2003 @@ -23,7 +23,7 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/extras/freetype2/src/pcf/pcfutil.c,v 1.4 2002/12/17 03:28:26 dawes Exp $ */ +/* $XFree86: xc/extras/freetype2/src/pcf/pcfutil.c,v 1.5 2003/12/22 17:48:01 tsi Exp $ */ /* * Author: Keith Packard, MIT X Consortium @@ -131,6 +131,7 @@ } +# ifdef UNUSED /* * Repad a bitmap. */ @@ -214,6 +215,6 @@ return dstWidthBytes * height; } - +# endif /* END */ Index: xc/extras/freetype2/src/pcf/pcfutil.h diff -u xc/extras/freetype2/src/pcf/pcfutil.h:1.2 xc/extras/freetype2/src/pcf/pcfutil.h:1.4 --- xc/extras/freetype2/src/pcf/pcfutil.h:1.2 Wed Dec 18 10:39:36 2002 +++ xc/extras/freetype2/src/pcf/pcfutil.h Mon Dec 22 12:48:01 2003 @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - +/* $XFree86: xc/extras/freetype2/src/pcf/pcfutil.h,v 1.4 2003/12/22 17:48:01 tsi Exp $ */ #ifndef __PCFUTIL_H__ #define __PCFUTIL_H__ @@ -44,6 +44,7 @@ FourByteSwap( unsigned char* buf, int nbytes); +# ifdef UNUSED static int RepadBitmap( char* pSrc, char* pDst, @@ -51,6 +52,7 @@ unsigned int dstPad, int width, int height); +# endif #endif /* __PCFUTIL_H__ */ Index: xc/extras/freetype2/src/pfr/Jamfile diff -u xc/extras/freetype2/src/pfr/Jamfile:1.1.1.1 xc/extras/freetype2/src/pfr/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/pfr/Jamfile:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/Jamfile Wed May 28 22:01:53 2003 @@ -1,16 +1,14 @@ # FreeType 2 src/pfr Jamfile (c) 2002 David Turner # -SubDir FT2_TOP src pfr ; - -SubDirHdrs [ FT2_SubDir src pfr ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) pfr ; { local _sources ; if $(FT2_MULTI) { - _sources = pfrdrivr pfrgload pfrload pfrobjs pfrcmap ; + _sources = pfrdrivr pfrgload pfrload pfrobjs pfrcmap pfrsbit ; } else { Index: xc/extras/freetype2/src/pfr/pfr.c diff -u xc/extras/freetype2/src/pfr/pfr.c:1.1.1.1 xc/extras/freetype2/src/pfr/pfr.c:1.1.1.2 --- xc/extras/freetype2/src/pfr/pfr.c:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/pfr.c Wed May 28 22:01:53 2003 @@ -24,5 +24,6 @@ #include "pfrcmap.c" #include "pfrobjs.c" #include "pfrdrivr.c" +#include "pfrsbit.c" /* END */ Index: xc/extras/freetype2/src/pfr/pfrcmap.c diff -u xc/extras/freetype2/src/pfr/pfrcmap.c:1.1.1.1 xc/extras/freetype2/src/pfr/pfrcmap.c:1.1.1.2 --- xc/extras/freetype2/src/pfr/pfrcmap.c:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/pfrcmap.c Wed May 28 22:01:53 2003 @@ -71,7 +71,7 @@ gchar = cmap->chars + mid; if ( gchar->char_code == char_code ) - return mid; + return mid + 1; if ( gchar->char_code < char_code ) min = mid + 1; @@ -107,7 +107,10 @@ { result = mid; if ( result != 0 ) + { + result++; goto Exit; + } char_code++; goto Restart; @@ -127,7 +130,10 @@ gchar = cmap->chars + min; result = min; if ( result != 0 ) + { + result++; char_code = gchar->char_code; + } } } Index: xc/extras/freetype2/src/pfr/pfrdrivr.c diff -u xc/extras/freetype2/src/pfr/pfrdrivr.c:1.1.1.1 xc/extras/freetype2/src/pfr/pfrdrivr.c:1.1.1.2 --- xc/extras/freetype2/src/pfr/pfrdrivr.c:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/pfrdrivr.c Wed May 28 22:01:53 2003 @@ -19,10 +19,111 @@ #include <ft2build.h> #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_PFR_H #include "pfrdrivr.h" #include "pfrobjs.h" + static FT_Error + pfr_get_kerning( PFR_Face face, + FT_UInt left, + FT_UInt right, + FT_Vector *avector ) + { + FT_Error error; + + error = pfr_face_get_kerning( face, left, right, avector ); + if ( !error ) + { + PFR_PhyFont phys = &face->phy_font; + + /* convert from metrics to outline units when necessary */ + if ( phys->outline_resolution != phys->metrics_resolution ) + { + if ( avector->x != 0 ) + avector->x = FT_MulDiv( avector->x, phys->outline_resolution, + phys->metrics_resolution ); + + if ( avector->y != 0 ) + avector->y = FT_MulDiv( avector->x, phys->outline_resolution, + phys->metrics_resolution ); + } + } + return error; + } + + + static FT_Error + pfr_get_advance( PFR_Face face, + FT_UInt gindex, + FT_Pos *aadvance ) + { + FT_Error error = FT_Err_Bad_Argument; + + *aadvance = 0; + if ( face ) + { + PFR_PhyFont phys = &face->phy_font; + + if ( gindex < phys->num_chars ) + { + *aadvance = phys->chars[ gindex ].advance; + error = 0; + } + } + + return error; + } + + + static FT_Error + pfr_get_metrics( PFR_Face face, + FT_UInt *aoutline_resolution, + FT_UInt *ametrics_resolution, + FT_Fixed *ametrics_x_scale, + FT_Fixed *ametrics_y_scale ) + { + PFR_PhyFont phys = &face->phy_font; + FT_Fixed x_scale, y_scale; + FT_Size size = face->root.size; + + if ( aoutline_resolution ) + *aoutline_resolution = phys->outline_resolution; + + if ( ametrics_resolution ) + *ametrics_resolution = phys->metrics_resolution; + + x_scale = 0x10000L; + y_scale = 0x10000L; + + if ( size ) + { + x_scale = FT_DivFix( size->metrics.x_ppem << 6, + phys->metrics_resolution ); + + y_scale = FT_DivFix( size->metrics.y_ppem << 6, + phys->metrics_resolution ); + } + + if ( ametrics_x_scale ) + *ametrics_x_scale = x_scale; + + if ( ametrics_y_scale ) + *ametrics_y_scale = y_scale; + + return 0; + } + + + FT_CALLBACK_TABLE_DEF + const FT_PFR_ServiceRec pfr_service_rec = + { + (FT_PFR_GetMetricsFunc) pfr_get_metrics, + (FT_PFR_GetKerningFunc) pfr_get_kerning, + (FT_PFR_GetAdvanceFunc) pfr_get_advance + }; + + FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec pfr_driver_class = { @@ -36,7 +137,7 @@ 0x10000L, 0x20000L, - 0, /* format interface */ + (FT_PFR_Service) &pfr_service_rec, /* format interface */ (FT_Module_Constructor)NULL, (FT_Module_Destructor) NULL, @@ -57,13 +158,10 @@ (FT_Size_ResetPointsFunc) NULL, (FT_Size_ResetPixelsFunc) NULL, (FT_Slot_LoadFunc) pfr_slot_load, - (FT_CharMap_CharIndexFunc)NULL, - (FT_Face_GetKerningFunc) 0, + (FT_Face_GetKerningFunc) pfr_get_kerning, (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc) 0, - - (FT_CharMap_CharNextFunc) NULL + (FT_Face_GetAdvancesFunc) 0 }; Index: xc/extras/freetype2/src/pfr/pfrgload.c diff -u xc/extras/freetype2/src/pfr/pfrgload.c:1.1.1.1 xc/extras/freetype2/src/pfr/pfrgload.c:1.1.1.2 --- xc/extras/freetype2/src/pfr/pfrgload.c:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/pfrgload.c Wed May 28 22:01:53 2003 @@ -17,6 +17,7 @@ #include "pfrgload.h" +#include "pfrsbit.h" #include "pfrload.h" /* for macro definitions */ #include FT_INTERNAL_DEBUG_H @@ -139,7 +140,7 @@ outline->points[n] = *to; - outline->tags [n] = FT_Curve_Tag_On; + outline->tags [n] = FT_CURVE_TAG_ON; outline->n_points++; } @@ -172,9 +173,9 @@ vec[0] = *control1; vec[1] = *control2; vec[2] = *to; - tag[0] = FT_Curve_Tag_Cubic; - tag[1] = FT_Curve_Tag_Cubic; - tag[2] = FT_Curve_Tag_On; + tag[0] = FT_CURVE_TAG_CUBIC; + tag[1] = FT_CURVE_TAG_CUBIC; + tag[2] = FT_CURVE_TAG_ON; outline->n_points = (FT_Short)( outline->n_points + 3 ); } @@ -298,7 +299,7 @@ PFR_CHECK( 1 ); mask = PFR_NEXT_BYTE( p ); } - + if ( mask & 1 ) { PFR_CHECK( 2 ); @@ -309,7 +310,7 @@ PFR_CHECK( 1 ); x += PFR_NEXT_BYTE( p ); } - + glyph->x_control[i] = x; mask >>= 1; @@ -409,7 +410,7 @@ cur = pos; for ( n = 0; n < args_count; n++ ) { - FT_Int index, delta; + FT_Int idx, delta; /* read the X argument */ @@ -417,9 +418,9 @@ { case 0: /* 8-bit index */ PFR_CHECK( 1 ); - index = PFR_NEXT_BYTE( p ); - cur->x = glyph->x_control[index]; - FT_TRACE7(( " cx#%d", index )); + idx = PFR_NEXT_BYTE( p ); + cur->x = glyph->x_control[idx]; + FT_TRACE7(( " cx#%d", idx )); break; case 1: /* 16-bit value */ @@ -445,9 +446,9 @@ { case 0: /* 8-bit index */ PFR_CHECK( 1 ); - index = PFR_NEXT_BYTE( p ); - cur->y = glyph->y_control[index]; - FT_TRACE7(( " cy#%d", index )); + idx = PFR_NEXT_BYTE( p ); + cur->y = glyph->y_control[idx]; + FT_TRACE7(( " cy#%d", idx )); break; case 1: /* 16-bit absolute value */ @@ -577,14 +578,15 @@ } subglyph = glyph->subs + org_count; - x_pos = 0; - y_pos = 0; for ( i = 0; i < count; i++, subglyph++ ) { FT_UInt format; + x_pos = 0; + y_pos = 0; + PFR_CHECK( 1 ); format = PFR_NEXT_BYTE( p ); @@ -635,7 +637,7 @@ default: ; } - + subglyph->x_delta = x_pos; subglyph->y_delta = y_pos; @@ -675,6 +677,9 @@ } + + + static FT_Error pfr_glyph_load_rec( PFR_Glyph glyph, FT_Stream stream, @@ -775,6 +780,9 @@ } + + + FT_LOCAL_DEF( FT_Error ) pfr_glyph_load( PFR_Glyph glyph, FT_Stream stream, Index: xc/extras/freetype2/src/pfr/pfrgload.h diff -u xc/extras/freetype2/src/pfr/pfrgload.h:1.1.1.1 xc/extras/freetype2/src/pfr/pfrgload.h:1.1.1.2 --- xc/extras/freetype2/src/pfr/pfrgload.h:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/pfrgload.h Wed May 28 22:01:53 2003 @@ -44,3 +44,6 @@ #endif /* __PFRGLOAD_H__ */ + + +/* END */ Index: xc/extras/freetype2/src/pfr/pfrload.c diff -u xc/extras/freetype2/src/pfr/pfrload.c:1.1.1.1 xc/extras/freetype2/src/pfr/pfrload.c:1.1.1.2 --- xc/extras/freetype2/src/pfr/pfrload.c:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/pfrload.c Wed May 28 22:01:53 2003 @@ -52,7 +52,7 @@ FT_Error error = 0; FT_Byte* p = *pp; FT_UInt num_items, item_type, item_size; - + PFR_CHECK( 1 ); num_items = PFR_NEXT_BYTE( p ); @@ -62,13 +62,13 @@ PFR_CHECK( 2 ); item_size = PFR_NEXT_BYTE( p ); item_type = PFR_NEXT_BYTE( p ); - + PFR_CHECK( item_size ); if ( item_list ) - { + { PFR_ExtraItem extra = item_list; - + for ( extra = item_list; extra->parser != NULL; extra++ ) { @@ -76,19 +76,19 @@ { error = extra->parser( p, p + item_size, item_data ); if ( error ) goto Exit; - + break; } } } - + p += item_size; } Exit: *pp = p; return error; - + Too_Short: FT_ERROR(( "pfr_extra_items_parse: invalid extra items table\n" )); error = PFR_Err_Invalid_Table; @@ -204,23 +204,23 @@ FT_Error error; FT_UInt count; FT_UInt result = 0; - + if ( FT_STREAM_SEEK( section_offset ) || FT_READ_USHORT( count ) ) goto Exit; - + result = count; - + Exit: *acount = result; return error; - } + } FT_LOCAL_DEF( FT_Error ) pfr_log_font_load( PFR_LogFont log_font, FT_Stream stream, - FT_UInt index, + FT_UInt idx, FT_UInt32 section_offset, FT_Bool size_increment ) { @@ -235,10 +235,10 @@ FT_READ_USHORT( num_log_fonts ) ) goto Exit; - if ( index >= num_log_fonts ) + if ( idx >= num_log_fonts ) return PFR_Err_Invalid_Argument; - if ( FT_STREAM_SKIP( index * 5 ) || + if ( FT_STREAM_SKIP( idx * 5 ) || FT_READ_USHORT( size ) || FT_READ_UOFF3 ( offset ) ) goto Exit; @@ -252,30 +252,30 @@ FT_Byte* p; FT_Byte* limit; FT_UInt local; - + if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) ) goto Exit; p = stream->cursor; limit = p + size; - + PFR_CHECK(13); - + log_font->matrix[0] = PFR_NEXT_LONG( p ); log_font->matrix[1] = PFR_NEXT_LONG( p ); log_font->matrix[2] = PFR_NEXT_LONG( p ); log_font->matrix[3] = PFR_NEXT_LONG( p ); - + flags = PFR_NEXT_BYTE( p ); - + local = 0; if ( flags & PFR_LOG_STROKE ) { local++; if ( flags & PFR_LOG_2BYTE_STROKE ) local++; - + if ( (flags & PFR_LINE_JOIN_MASK) == PFR_LINE_JOIN_MITER ) local += 3; } @@ -293,18 +293,18 @@ log_font->stroke_thickness = ( flags & PFR_LOG_2BYTE_STROKE ) ? PFR_NEXT_SHORT( p ) : PFR_NEXT_BYTE( p ); - + if ( ( flags & PFR_LINE_JOIN_MASK ) == PFR_LINE_JOIN_MITER ) log_font->miter_limit = PFR_NEXT_LONG( p ); } - + if ( flags & PFR_LOG_BOLD ) { log_font->bold_thickness = ( flags & PFR_LOG_2BYTE_BOLD ) ? PFR_NEXT_SHORT( p ) : PFR_NEXT_BYTE( p ); } - + if ( flags & PFR_LOG_EXTRA_ITEMS ) { error = pfr_extra_items_skip( &p, limit ); @@ -326,7 +326,7 @@ Exit: return error; - + Too_Short: FT_ERROR(( "pfr_log_font_load: invalid logical font table\n" )); error = PFR_Err_Invalid_Table; @@ -355,7 +355,7 @@ FT_UInt n, count, size1; FT_Error error = 0; - + PFR_CHECK( 5 ); p += 3; /* skip bctSize */ @@ -366,12 +366,12 @@ if ( phy_font->num_strikes + count > phy_font->max_strikes ) { FT_UInt new_max = (phy_font->num_strikes + count + 3) & -4; - + if ( FT_RENEW_ARRAY( phy_font->strikes, phy_font->num_strikes, new_max ) ) goto Exit; - + phy_font->max_strikes = new_max; } @@ -421,18 +421,27 @@ } phy_font->num_strikes += count; - + Exit: return error; - + Too_Short: error = PFR_Err_Invalid_Table; FT_ERROR(( "pfr_extra_item_load_bitmap_info: invalid bitmap info table\n" )); goto Exit; - } + } - /* load font ID, i.e. name */ + /* load font ID, this is a so-called "unique" name that is rather + * long and descriptive (like "Tiresias ScreenFont v7.51"). + * + * note that a PFR font's family name is contained in an *undocumented* + * string of the "auxiliary data" portion of a physical font record. this + * may also contain the "real" style name ! + * + * if no family name is present, the font id is used instead for the + * family + */ FT_CALLBACK_DEF( FT_Error ) pfr_extra_item_load_font_id( FT_Byte* p, FT_Byte* limit, @@ -441,18 +450,18 @@ FT_Error error = 0; FT_Memory memory = phy_font->memory; FT_UInt len = (FT_UInt)( limit - p ); - + if ( phy_font->font_id != NULL ) goto Exit; - + if ( FT_ALLOC( phy_font->font_id, len+1 ) ) goto Exit; /* copy font ID name, and terminate it for safety */ FT_MEM_COPY( phy_font->font_id, p, len ); phy_font->font_id[len] = 0; - + Exit: return error; } @@ -472,33 +481,215 @@ if ( phy_font->vertical.stem_snaps != NULL ) goto Exit; - + PFR_CHECK( 1 ); count = PFR_NEXT_BYTE( p ); - + num_vert = count & 15; num_horz = count >> 4; count = num_vert + num_horz; - + PFR_CHECK( count * 2 ); - + if ( FT_NEW_ARRAY( snaps, count ) ) goto Exit; - + phy_font->vertical.stem_snaps = snaps; phy_font->horizontal.stem_snaps = snaps + num_vert; - + for ( ; count > 0; count--, snaps++ ) *snaps = FT_NEXT_SHORT( p ); - + Exit: return error; - + Too_Short: error = PFR_Err_Invalid_Table; FT_ERROR(( "pfr_exta_item_load_stem_snaps: invalid stem snaps table\n" )); goto Exit; - } + } + + +#if 0 + + /* load kerning pair data */ + FT_CALLBACK_DEF( FT_Error ) + pfr_extra_item_load_kerning_pairs( FT_Byte* p, + FT_Byte* limit, + PFR_PhyFont phy_font ) + { + FT_Int count; + FT_UShort base_adj; + FT_UInt flags; + FT_UInt num_pairs; + PFR_KernPair pairs; + FT_Error error = 0; + FT_Memory memory = phy_font->memory; + + + /* allocate a new kerning item */ + /* XXX: there may be multiple extra items for kerning */ + if ( phy_font->kern_pairs != NULL ) + goto Exit; + + FT_TRACE2(( "pfr_extra_item_load_kerning_pairs()\n" )); + + PFR_CHECK( 4 ); + + num_pairs = PFR_NEXT_BYTE( p ); + base_adj = PFR_NEXT_SHORT( p ); + flags = PFR_NEXT_BYTE( p ); + +#ifndef PFR_CONFIG_NO_CHECKS + count = 3; + + if ( flags & PFR_KERN_2BYTE_CHAR ) + count += 2; + + if ( flags & PFR_KERN_2BYTE_ADJ ) + count += 1; + + PFR_CHECK( num_pairs * count ); +#endif + + if ( FT_NEW_ARRAY( pairs, num_pairs ) ) + goto Exit; + + phy_font->num_kern_pairs = num_pairs; + phy_font->kern_pairs = pairs; + + for (count = num_pairs ; count > 0; count--, pairs++ ) + { + if ( flags & PFR_KERN_2BYTE_CHAR ) + { + pairs->glyph1 = PFR_NEXT_USHORT( p ); + pairs->glyph2 = PFR_NEXT_USHORT( p ); + } + else + { + pairs->glyph1 = PFR_NEXT_BYTE( p ); + pairs->glyph2 = PFR_NEXT_BYTE( p ); + } + + if ( flags & PFR_KERN_2BYTE_ADJ ) + pairs->kerning.x = base_adj + PFR_NEXT_SHORT( p ); + else + pairs->kerning.x = base_adj + PFR_NEXT_INT8( p ); + + pairs->kerning.y = 0; + + FT_TRACE2(( "kerning %d <-> %d : %ld\n", + pairs->glyph1, pairs->glyph2, pairs->kerning.x )); + } + + Exit: + return error; + + Too_Short: + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_extra_item_load_kerning_pairs: " + "invalid kerning pairs table\n" )); + goto Exit; + } + +#else /* 0 */ + + /* load kerning pair data */ + FT_CALLBACK_DEF( FT_Error ) + pfr_extra_item_load_kerning_pairs( FT_Byte* p, + FT_Byte* limit, + PFR_PhyFont phy_font ) + { + PFR_KernItem item; + FT_Error error = 0; + FT_Memory memory = phy_font->memory; + + + FT_TRACE2(( "pfr_extra_item_load_kerning_pairs()\n" )); + + if ( FT_NEW( item ) ) + goto Exit; + + PFR_CHECK( 4 ); + + item->pair_count = PFR_NEXT_BYTE( p ); + item->base_adj = PFR_NEXT_SHORT( p ); + item->flags = PFR_NEXT_BYTE( p ); + item->offset = phy_font->offset + ( p - phy_font->cursor ); + +#ifndef PFR_CONFIG_NO_CHECKS + item->pair_size = 3; + + if ( item->flags & PFR_KERN_2BYTE_CHAR ) + item->pair_size += 2; + + if ( item->flags & PFR_KERN_2BYTE_ADJ ) + item->pair_size += 1; + + PFR_CHECK( item->pair_count * item->pair_size ); +#endif + + /* load first and last pairs into the item to speed up */ + /* lookup later... */ + if ( item->pair_count > 0 ) + { + FT_UInt char1, char2; + FT_Byte* q; + + + if ( item->flags & PFR_KERN_2BYTE_CHAR ) + { + q = p; + char1 = PFR_NEXT_USHORT( q ); + char2 = PFR_NEXT_USHORT( q ); + + item->pair1 = PFR_KERN_INDEX( char1, char2 ); + + q = p + item->pair_size * ( item->pair_count - 1 ); + char1 = PFR_NEXT_USHORT( q ); + char2 = PFR_NEXT_USHORT( q ); + + item->pair2 = PFR_KERN_INDEX( char1, char2 ); + } + else + { + q = p; + char1 = PFR_NEXT_BYTE( q ); + char2 = PFR_NEXT_BYTE( q ); + + item->pair1 = PFR_KERN_INDEX( char1, char2 ); + + q = p + item->pair_size * ( item->pair_count - 1 ); + char1 = PFR_NEXT_BYTE( q ); + char2 = PFR_NEXT_BYTE( q ); + + item->pair2 = PFR_KERN_INDEX( char1, char2 ); + } + + /* add new item to the current list */ + item->next = NULL; + *phy_font->kern_items_tail = item; + phy_font->kern_items_tail = &item->next; + phy_font->num_kern_pairs += item->pair_count; + } + else + { + /* empty item! */ + FT_FREE( item ); + } + + Exit: + return error; + + Too_Short: + FT_FREE( item ); + + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_extra_item_load_kerning_pairs: " + "invalid kerning pairs table\n" )); + goto Exit; + } +#endif /* 0 */ static const PFR_ExtraItemRec pfr_phy_font_extra_items[] = @@ -506,16 +697,59 @@ { 1, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_bitmap_info }, { 2, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_font_id }, { 3, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_stem_snaps }, + { 4, (PFR_ExtraItem_ParseFunc) pfr_extra_item_load_kerning_pairs }, { 0, NULL } }; + /* loads a name from the auxiliary data. Since this extracts undocumented + * strings from the font file, we need to be careful here + */ + static FT_Error + pfr_aux_name_load( FT_Byte* p, + FT_UInt len, + FT_Memory memory, + FT_String* *astring ) + { + FT_Error error = 0; + FT_String* result = NULL; + FT_UInt n, ok; + + if ( len > 0 && p[len-1] == 0 ) + len--; + + /* check that each character is ASCII, that's to be sure + * to not load garbage.. + */ + ok = (len > 0); + for ( n = 0; n < len; n++ ) + if ( p[n] < 32 || p[n] > 127 ) + { + ok = 0; + break; + } + + if ( ok ) + { + if ( FT_ALLOC( result, len+1 ) ) + goto Exit; + + FT_MEM_COPY( result, p, len ); + result[len] = 0; + } + Exit: + *astring = result; + return error; + } + + FT_LOCAL_DEF( void ) pfr_phy_font_done( PFR_PhyFont phy_font, FT_Memory memory ) { - if ( phy_font->font_id ) - FT_FREE( phy_font->font_id ); + FT_FREE( phy_font->font_id ); + FT_FREE( phy_font->family_name ); + FT_FREE( phy_font->style_name ); FT_FREE( phy_font->vertical.stem_snaps ); phy_font->vertical.num_stem_snaps = 0; @@ -526,15 +760,33 @@ FT_FREE( phy_font->strikes ); phy_font->num_strikes = 0; phy_font->max_strikes = 0; - + FT_FREE( phy_font->chars ); phy_font->num_chars = 0; phy_font->chars_offset = 0; FT_FREE( phy_font->blue_values ); phy_font->num_blue_values = 0; + + { + PFR_KernItem item, next; + + + item = phy_font->kern_items; + while ( item ) + { + next = item->next; + FT_FREE( item ); + item = next; + } + phy_font->kern_items = NULL; + phy_font->kern_items_tail = NULL; + } + + phy_font->num_kern_pairs = 0; } - + + FT_LOCAL_DEF( FT_Error ) pfr_phy_font_load( PFR_PhyFont phy_font, @@ -552,9 +804,14 @@ phy_font->memory = memory; phy_font->offset = offset; + phy_font->kern_items = NULL; + phy_font->kern_items_tail = &phy_font->kern_items; + if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) ) goto Exit; + phy_font->cursor = stream->cursor; + p = stream->cursor; limit = p + size; @@ -580,17 +837,85 @@ { error = pfr_extra_items_parse( &p, limit, pfr_phy_font_extra_items, phy_font ); - + if ( error ) goto Fail; } - - /* skip the aux bytes */ + + /* in certain fonts, the auxiliary bytes contain interesting */ + /* information. These are not in the specification but can be */ + /* guessed by looking at the content of a few PFR0 fonts */ PFR_CHECK( 3 ); num_aux = PFR_NEXT_ULONG( p ); - - PFR_CHECK( num_aux ); - p += num_aux; + + if ( num_aux > 0 ) + { + FT_Byte* q = p; + FT_Byte* q2; + + PFR_CHECK( num_aux ); + p += num_aux; + + while ( num_aux > 0 ) + { + FT_UInt length, type; + + if ( q + 4 > p ) + break; + + length = PFR_NEXT_USHORT(q); + if ( length < 4 || length > num_aux ) + break; + + q2 = q + length - 2; + type = PFR_NEXT_USHORT(q); + + switch ( type ) + { + case 1: + { + /* this seems to correspond to the font's family name, + * padded to 16-bits with one zero when necessary + */ + error = pfr_aux_name_load( q, length-4U, memory, + &phy_font->family_name ); + if ( error ) + goto Exit; + } + break; + + case 2: + { + if ( q + 32 > q2 ) + break; + + q += 10; + phy_font->ascent = PFR_NEXT_SHORT(q); + phy_font->descent = PFR_NEXT_SHORT(q); + phy_font->leading = PFR_NEXT_SHORT(q); + q += 16; + } + break; + + case 3: + { + /* this seems to correspond to the font's style name, + * padded to 16-bits with one zero when necessary + */ + error = pfr_aux_name_load( q, length-4U, memory, + &phy_font->style_name ); + if ( error ) + goto Exit; + } + break; + + default: + ; + } + q = q2; + num_aux -= length; + } + } /* read the blue values */ { @@ -600,7 +925,7 @@ phy_font->num_blue_values = count = PFR_NEXT_BYTE( p ); PFR_CHECK( count * 2 ); - + if ( FT_NEW_ARRAY( phy_font->blue_values, count ) ) goto Fail; @@ -629,19 +954,19 @@ Size = 1 + 1 + 2; if ( flags & PFR_PHY_2BYTE_CHARCODE ) Size += 1; - + if ( flags & PFR_PHY_PROPORTIONAL ) Size += 2; - + if ( flags & PFR_PHY_ASCII_CODE ) Size += 1; - + if ( flags & PFR_PHY_2BYTE_GPS_SIZE ) Size += 1; - + if ( flags & PFR_PHY_3BYTE_GPS_OFFSET ) Size += 1; - + PFR_CHECK( count * Size ); for ( n = 0; n < count; n++ ) @@ -655,7 +980,7 @@ cur->advance = ( flags & PFR_PHY_PROPORTIONAL ) ? PFR_NEXT_SHORT( p ) - : phy_font->standard_advance; + : (FT_Int) phy_font->standard_advance; #if 0 cur->ascii = ( flags & PFR_PHY_ASCII_CODE ) @@ -679,9 +1004,13 @@ Fail: FT_FRAME_EXIT(); + /* save position of bitmap info */ + phy_font->bct_offset = FT_STREAM_POS(); + phy_font->cursor = NULL; + Exit: return error; - + Too_Short: error = PFR_Err_Invalid_Table; FT_ERROR(( "pfr_phy_font_load: invalid physical font table\n" )); Index: xc/extras/freetype2/src/pfr/pfrobjs.c diff -u xc/extras/freetype2/src/pfr/pfrobjs.c:1.1.1.1 xc/extras/freetype2/src/pfr/pfrobjs.c:1.2 --- xc/extras/freetype2/src/pfr/pfrobjs.c:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/pfrobjs.c Wed Oct 22 13:26:30 2003 @@ -14,12 +14,13 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ - +/* $XFree86: xc/extras/freetype2/src/pfr/pfrobjs.c,v 1.2 2003/10/22 17:26:30 tsi Exp $ */ #include "pfrobjs.h" #include "pfrload.h" #include "pfrgload.h" #include "pfrcmap.h" +#include "pfrsbit.h" #include FT_OUTLINE_H #include FT_INTERNAL_DEBUG_H @@ -40,20 +41,32 @@ FT_LOCAL_DEF( void ) pfr_face_done( PFR_Face face ) { + FT_Memory memory = face->root.driver->root.memory; + + /* we don't want dangling pointers */ + face->root.family_name = NULL; + face->root.style_name = NULL; + /* finalize the physical font record */ pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) ); /* no need to finalize the logical font or the header */ + FT_FREE( face->root.available_sizes ); } FT_LOCAL_DEF( FT_Error ) - pfr_face_init( FT_Stream stream, - PFR_Face face, - FT_Int face_index ) + pfr_face_init( FT_Stream stream, + PFR_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) { FT_Error error; + FT_UNUSED( num_params ); + FT_UNUSED( params ); + /* load the header and check it */ error = pfr_header_load( &face->header, stream ); @@ -120,14 +133,28 @@ root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; if ( phy_font->flags & PFR_PHY_VERTICAL ) - root->face_flags |= FT_FACE_FLAG_HORIZONTAL; - else root->face_flags |= FT_FACE_FLAG_VERTICAL; + else + root->face_flags |= FT_FACE_FLAG_HORIZONTAL; + + if ( phy_font->num_strikes > 0 ) + root->face_flags |= FT_FACE_FLAG_FIXED_SIZES; - /* XXX: kerning and embedded bitmap support isn't there yet */ + if ( phy_font->num_kern_pairs > 0 ) + root->face_flags |= FT_FACE_FLAG_KERNING; - root->family_name = phy_font->font_id; - root->style_name = NULL; /* no style name in font file */ + /* if no family name was found in the "undocumented" auxiliary + * data, use the font ID instead. This sucks but is better than + * nothing + */ + root->family_name = phy_font->family_name; + if ( root->family_name == NULL ) + root->family_name = phy_font->font_id; + + /* note that the style name can be NULL in certain PFR fonts, + * probably meaning "Regular" + */ + root->style_name = phy_font->style_name; root->num_fixed_sizes = 0; root->available_sizes = 0; @@ -140,6 +167,26 @@ ( ( ( root->ascender - root->descender ) * 12 ) / 10 ); + if ( phy_font->num_strikes > 0 ) + { + FT_UInt n, count = phy_font->num_strikes; + FT_Bitmap_Size* size; + PFR_Strike strike; + FT_Memory memory = root->stream->memory; + + if ( FT_NEW_ARRAY( root->available_sizes, count ) ) + goto Exit; + + size = root->available_sizes; + strike = phy_font->strikes; + for ( n = 0; n < count; n++, size++, strike++ ) + { + size->height = (FT_UShort) strike->y_ppm; + size->width = (FT_UShort) strike->x_ppm; + } + root->num_fixed_sizes = count; + } + /* now compute maximum advance width */ if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 ) root->max_advance_width = (FT_Short)phy_font->standard_advance; @@ -167,15 +214,25 @@ /* create charmap */ { FT_CharMapRec charmap; - + charmap.face = root; charmap.platform_id = 3; charmap.encoding_id = 1; - charmap.encoding = ft_encoding_unicode; - + charmap.encoding = FT_ENCODING_UNICODE; + FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL ); + +#if 0 + /* Select default charmap */ + if (root->num_charmaps) + root->charmap = root->charmaps[0]; +#endif } + + /* check whether we've loaded any kerning pairs */ + if ( phy_font->num_kern_pairs ) + root->face_flags |= FT_FACE_FLAG_KERNING; } Exit: @@ -213,19 +270,36 @@ pfr_slot_load( PFR_Slot slot, PFR_Size size, FT_UInt gindex, - FT_Int load_flags ) + FT_Int32 load_flags ) { FT_Error error; PFR_Face face = (PFR_Face)slot->root.face; - PFR_Char gchar = face->phy_font.chars + gindex; + PFR_Char gchar; FT_Outline* outline = &slot->root.outline; FT_ULong gps_offset; + if (gindex > 0) + gindex--; /* check that the glyph index is correct */ FT_ASSERT( gindex < face->phy_font.num_chars ); - slot->root.format = ft_glyph_format_outline; + /* try to load an embedded bitmap */ + if ( ( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP ) ) == 0 ) + { + error = pfr_slot_load_bitmap( slot, size, gindex ); + if ( error == 0 ) + goto Exit; + } + + if ( load_flags & FT_LOAD_SBITS_ONLY ) + { + error = FT_Err_Invalid_Argument; + goto Exit; + } + + gchar = face->phy_font.chars + gindex; + slot->root.format = FT_GLYPH_FORMAT_OUTLINE; outline->n_points = 0; outline->n_contours = 0; gps_offset = face->header.gps_section_offset; @@ -248,11 +322,11 @@ /* copy outline data */ *outline = slot->glyph.loader->base.outline; - outline->flags &= ~ft_outline_owner; - outline->flags |= ft_outline_reverse_fill; + outline->flags &= ~FT_OUTLINE_OWNER; + outline->flags |= FT_OUTLINE_REVERSE_FILL; if ( size && size->root.metrics.y_ppem < 24 ) - outline->flags |= ft_outline_high_precision; + outline->flags |= FT_OUTLINE_HIGH_PRECISION; /* compute the advance vector */ metrics->horiAdvance = 0; @@ -266,9 +340,9 @@ advance = FT_MulDiv( advance, em_outline, em_metrics ); if ( face->phy_font.flags & PFR_PHY_VERTICAL ) - metrics->vertAdvance = gchar->advance; + metrics->vertAdvance = advance; else - metrics->horiAdvance = gchar->advance; + metrics->horiAdvance = advance; slot->root.linearHoriAdvance = metrics->horiAdvance; slot->root.linearVertAdvance = metrics->vertAdvance; @@ -307,8 +381,100 @@ metrics->horiBearingY = cbox.yMax - metrics->height; } + Exit: return error; } + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** KERNING METHOD *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( FT_Error ) + pfr_face_get_kerning( PFR_Face face, + FT_UInt glyph1, + FT_UInt glyph2, + FT_Vector* kerning ) + { + FT_Error error = 0; + PFR_PhyFont phy_font = &face->phy_font; + PFR_KernItem item = phy_font->kern_items; + FT_UInt32 idx = PFR_KERN_INDEX( glyph1, glyph2 ); + + + kerning->x = 0; + kerning->y = 0; + + /* find the kerning item containing our pair */ + while ( item ) + { + if ( item->pair1 <= idx && idx <= item->pair2 ) + goto Found_Item; + + item = item->next; + } + + /* not found */ + goto Exit; + + Found_Item: + { + /* perform simply binary search within the item */ + FT_UInt min, mid, max; + FT_Stream stream = face->root.stream; + FT_Byte* p; + + + if ( FT_STREAM_SEEK( item->offset ) || + FT_FRAME_ENTER( item->pair_count * item->pair_size ) ) + goto Exit; + + min = 0; + max = item->pair_count; + while ( min < max ) + { + FT_UInt char1, char2, charcode; + + + mid = ( min + max ) >> 1; + p = stream->cursor + mid*item->pair_size; + + if ( item->flags & PFR_KERN_2BYTE_CHAR ) + { + char1 = FT_NEXT_USHORT( p ); + char2 = FT_NEXT_USHORT( p ); + } + else + { + char1 = FT_NEXT_USHORT( p ); + char2 = FT_NEXT_USHORT( p ); + } + charcode = PFR_KERN_INDEX( char1, char2 ); + + if ( idx == charcode ) + { + if ( item->flags & PFR_KERN_2BYTE_ADJ ) + kerning->x = item->base_adj + FT_NEXT_SHORT( p ); + else + kerning->x = item->base_adj + FT_NEXT_CHAR( p ); + + break; + } + if ( idx > charcode ) + min = mid + 1; + else + max = mid; + } + + FT_FRAME_EXIT(); + } + + Exit: + return error; + } + /* END */ Index: xc/extras/freetype2/src/pfr/pfrobjs.h diff -u xc/extras/freetype2/src/pfr/pfrobjs.h:1.1.1.1 xc/extras/freetype2/src/pfr/pfrobjs.h:1.1.1.2 --- xc/extras/freetype2/src/pfr/pfrobjs.h:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/pfrobjs.h Wed May 28 22:01:53 2003 @@ -25,9 +25,9 @@ FT_BEGIN_HEADER typedef struct PFR_FaceRec_* PFR_Face; - + typedef struct PFR_SizeRec_* PFR_Size; - + typedef struct PFR_SlotRec_* PFR_Slot; @@ -44,7 +44,7 @@ typedef struct PFR_SizeRec_ { FT_SizeRec root; - + } PFR_SizeRec; @@ -52,20 +52,29 @@ { FT_GlyphSlotRec root; PFR_GlyphRec glyph; - + } PFR_SlotRec; FT_LOCAL( FT_Error ) - pfr_face_init( FT_Stream stream, - PFR_Face face, - FT_Int face_index ); + pfr_face_init( FT_Stream stream, + PFR_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ); FT_LOCAL( void ) pfr_face_done( PFR_Face face ); FT_LOCAL( FT_Error ) + pfr_face_get_kerning( PFR_Face face, + FT_UInt glyph1, + FT_UInt glyph2, + FT_Vector* kerning ); + + + FT_LOCAL( FT_Error ) pfr_slot_init( PFR_Slot slot ); FT_LOCAL( void ) @@ -76,9 +85,12 @@ pfr_slot_load( PFR_Slot slot, PFR_Size size, FT_UInt gindex, - FT_Int load_flags ); + FT_Int32 load_flags ); FT_END_HEADER #endif /* __PFROBJS_H__ */ + + +/* END */ Index: xc/extras/freetype2/src/pfr/pfrsbit.c diff -u /dev/null xc/extras/freetype2/src/pfr/pfrsbit.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/pfr/pfrsbit.c Wed May 28 22:01:53 2003 @@ -0,0 +1,669 @@ +/***************************************************************************/ +/* */ +/* pfrsbit.c */ +/* */ +/* FreeType PFR bitmap loader (body). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "pfrsbit.h" +#include "pfrload.h" +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H + +#include "pfrerror.h" + +#undef FT_COMPONENT +#define FT_COMPONENT trace_pfr + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PFR BIT WRITER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + typedef struct PFR_BitWriter_ + { + FT_Byte* line; /* current line start */ + FT_Int pitch; /* line size in bytes */ + FT_Int width; /* width in pixels/bits */ + FT_Int rows; /* number of remaining rows to scan */ + FT_Int total; /* total number of bits to draw */ + + } PFR_BitWriterRec, *PFR_BitWriter; + + + static void + pfr_bitwriter_init( PFR_BitWriter writer, + FT_Bitmap* target, + FT_UInt decreasing ) + { + writer->line = target->buffer; + writer->pitch = target->pitch; + writer->width = target->width; + writer->rows = target->rows; + writer->total = writer->width * writer->rows; + + if ( !decreasing ) + { + writer->line += writer->pitch * ( target->rows-1 ); + writer->pitch = -writer->pitch; + } + } + + + static void + pfr_bitwriter_decode_bytes( PFR_BitWriter writer, + FT_Byte* p, + FT_Byte* limit ) + { + FT_Int n, reload; + FT_Int left = writer->width; + FT_Byte* cur = writer->line; + FT_UInt mask = 0x80; + FT_UInt val = 0; + FT_UInt c = 0; + + + n = (FT_Int)( limit - p ) * 8; + if ( n > writer->total ) + n = writer->total; + + reload = n & 7; + + for ( ; n > 0; n-- ) + { + if ( ( n & 7 ) == reload ) + val = *p++; + + if ( val & 0x80 ) + c |= mask; + + val <<= 1; + mask >>= 1; + + if ( --left <= 0 ) + { + cur[0] = (FT_Byte)c; + left = writer->width; + mask = 0x80; + + writer->line += writer->pitch; + cur = writer->line; + c = 0; + } + else if ( mask == 0 ) + { + cur[0] = (FT_Byte)c; + mask = 0x80; + c = 0; + cur ++; + } + } + + if ( mask != 0x80 ) + cur[0] = (FT_Byte) c; + } + + + static void + pfr_bitwriter_decode_rle1( PFR_BitWriter writer, + FT_Byte* p, + FT_Byte* limit ) + { + FT_Int n, phase, count, counts[2], reload; + FT_Int left = writer->width; + FT_Byte* cur = writer->line; + FT_UInt mask = 0x80; + FT_UInt c = 0; + + + n = writer->total; + + phase = 1; + counts[0] = 0; + counts[1] = 0; + count = 0; + reload = 1; + + for ( ; n > 0; n-- ) + { + if ( reload ) + { + do + { + if ( phase ) + { + FT_Int v; + + + if ( p >= limit ) + break; + + v = *p++; + counts[0] = v >> 4; + counts[1] = v & 15; + phase = 0; + count = counts[0]; + } + else + { + phase = 1; + count = counts[1]; + } + + } while ( count == 0 ); + } + + if ( phase ) + c |= mask; + + mask >>= 1; + + if ( --left <= 0 ) + { + cur[0] = (FT_Byte) c; + left = writer->width; + mask = 0x80; + + writer->line += writer->pitch; + cur = writer->line; + c = 0; + } + else if ( mask == 0 ) + { + cur[0] = (FT_Byte) c; + mask = 0x80; + c = 0; + cur ++; + } + + reload = ( --count <= 0 ); + } + + if ( mask != 0x80 ) + cur[0] = (FT_Byte) c; + } + + + static void + pfr_bitwriter_decode_rle2( PFR_BitWriter writer, + FT_Byte* p, + FT_Byte* limit ) + { + FT_Int n, phase, count, reload; + FT_Int left = writer->width; + FT_Byte* cur = writer->line; + FT_UInt mask = 0x80; + FT_UInt c = 0; + + + n = writer->total; + + phase = 1; + count = 0; + reload = 1; + + for ( ; n > 0; n-- ) + { + if ( reload ) + { + do + { + if ( p >= limit ) + break; + + count = *p++; + phase = phase ^ 1; + + } while ( count == 0 ); + } + + if ( phase ) + c |= mask; + + mask >>= 1; + + if ( --left <= 0 ) + { + cur[0] = (FT_Byte) c; + c = 0; + mask = 0x80; + left = writer->width; + + writer->line += writer->pitch; + cur = writer->line; + } + else if ( mask == 0 ) + { + cur[0] = (FT_Byte) c; + c = 0; + mask = 0x80; + cur ++; + } + + reload = ( --count <= 0 ); + } + + if ( mask != 0x80 ) + cur[0] = (FT_Byte) c; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** BITMAP DATA DECODING *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + pfr_lookup_bitmap_data( FT_Byte* base, + FT_Byte* limit, + FT_Int count, + FT_Byte flags, + FT_UInt char_code, + FT_ULong* found_offset, + FT_ULong* found_size ) + { + FT_UInt left, right, char_len; + FT_Bool two = FT_BOOL( flags & 1 ); + FT_Byte* buff; + + + char_len = 4; + if ( two ) char_len += 1; + if ( flags & 2 ) char_len += 1; + if ( flags & 4 ) char_len += 1; + + left = 0; + right = count; + + while ( left < right ) + { + FT_UInt middle, code; + + + middle = ( left + right ) >> 1; + buff = base + middle * char_len; + + /* check that we are not outside of the table -- */ + /* this is possible with broken fonts... */ + if ( buff + char_len > limit ) + goto Fail; + + if ( two ) + code = PFR_NEXT_USHORT( buff ); + else + code = PFR_NEXT_BYTE( buff ); + + if ( code == char_code ) + goto Found_It; + + if ( code < char_code ) + left = middle; + else + right = middle; + } + + Fail: + /* Not found */ + *found_size = 0; + *found_offset = 0; + return; + + Found_It: + if ( flags & 2 ) + *found_size = PFR_NEXT_USHORT( buff ); + else + *found_size = PFR_NEXT_BYTE( buff ); + + if ( flags & 4 ) + *found_offset = PFR_NEXT_ULONG( buff ); + else + *found_offset = PFR_NEXT_USHORT( buff ); + } + + + /* load bitmap metrics. "*padvance" must be set to the default value */ + /* before calling this function... */ + /* */ + static FT_Error + pfr_load_bitmap_metrics( FT_Byte** pdata, + FT_Byte* limit, + FT_Long scaled_advance, + FT_Long *axpos, + FT_Long *aypos, + FT_UInt *axsize, + FT_UInt *aysize, + FT_Long *aadvance, + FT_UInt *aformat ) + { + FT_Error error = 0; + FT_Byte flags; + FT_Char b; + FT_Byte* p = *pdata; + FT_Long xpos, ypos, advance; + FT_UInt xsize, ysize; + + + PFR_CHECK( 1 ); + flags = PFR_NEXT_BYTE( p ); + + xpos = 0; + ypos = 0; + xsize = 0; + ysize = 0; + advance = 0; + + switch ( flags & 3 ) + { + case 0: + PFR_CHECK( 1 ); + b = PFR_NEXT_INT8( p ); + xpos = b >> 4; + ypos = ( (FT_Char)( b << 4 ) ) >> 4; + break; + + case 1: + PFR_CHECK( 2 ); + xpos = PFR_NEXT_INT8( p ); + ypos = PFR_NEXT_INT8( p ); + break; + + case 2: + PFR_CHECK( 4 ); + xpos = PFR_NEXT_SHORT( p ); + ypos = PFR_NEXT_SHORT( p ); + break; + + case 3: + PFR_CHECK( 6 ); + xpos = PFR_NEXT_LONG( p ); + ypos = PFR_NEXT_LONG( p ); + break; + + default: + ; + } + + flags >>= 2; + switch ( flags & 3 ) + { + case 0: + /* blank image */ + xsize = 0; + ysize = 0; + break; + + case 1: + PFR_CHECK( 1 ); + b = PFR_NEXT_BYTE( p ); + xsize = ( b >> 4 ) & 0xF; + ysize = b & 0xF; + break; + + case 2: + PFR_CHECK( 2 ); + xsize = PFR_NEXT_BYTE( p ); + ysize = PFR_NEXT_BYTE( p ); + break; + + case 3: + PFR_CHECK( 4 ); + xsize = PFR_NEXT_USHORT( p ); + ysize = PFR_NEXT_USHORT( p ); + break; + + default: + ; + } + + flags >>= 2; + switch ( flags & 3 ) + { + case 0: + advance = scaled_advance; + break; + + case 1: + PFR_CHECK( 1 ); + advance = PFR_NEXT_INT8( p ) << 8; + break; + + case 2: + PFR_CHECK( 2 ); + advance = PFR_NEXT_SHORT( p ); + break; + + case 3: + PFR_CHECK( 3 ); + advance = PFR_NEXT_LONG( p ); + break; + + default: + ; + } + + *axpos = xpos; + *aypos = ypos; + *axsize = xsize; + *aysize = ysize; + *aadvance = advance; + *aformat = flags >> 2; + *pdata = p; + + Exit: + return error; + + Too_Short: + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_load_bitmap_metrics: invalid glyph data\n" )); + goto Exit; + } + + + static FT_Error + pfr_load_bitmap_bits( FT_Byte* p, + FT_Byte* limit, + FT_UInt format, + FT_UInt decreasing, + FT_Bitmap* target ) + { + FT_Error error = 0; + PFR_BitWriterRec writer; + + + if ( target->rows > 0 && target->width > 0 ) + { + pfr_bitwriter_init( &writer, target, decreasing ); + + switch ( format ) + { + case 0: /* packed bits */ + pfr_bitwriter_decode_bytes( &writer, p, limit ); + break; + + case 1: /* RLE1 */ + pfr_bitwriter_decode_rle1( &writer, p, limit ); + break; + + case 2: /* RLE2 */ + pfr_bitwriter_decode_rle2( &writer, p, limit ); + break; + + default: + FT_ERROR(( "pfr_read_bitmap_data: invalid image type\n" )); + error = FT_Err_Invalid_File_Format; + } + } + + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** BITMAP LOADING *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( FT_Error ) + pfr_slot_load_bitmap( PFR_Slot glyph, + PFR_Size size, + FT_UInt glyph_index ) + { + FT_Error error; + PFR_Face face = (PFR_Face) glyph->root.face; + FT_Stream stream = face->root.stream; + PFR_PhyFont phys = &face->phy_font; + FT_ULong gps_offset; + FT_ULong gps_size; + PFR_Char character; + PFR_Strike strike; + + + character = &phys->chars[glyph_index]; + + /* Look-up a bitmap strike corresponding to the current */ + /* character dimensions */ + { + FT_UInt n; + + + strike = phys->strikes; + for ( n = 0; n < phys->num_strikes; n++ ) + { + if ( strike->x_ppm == (FT_UInt)size->root.metrics.x_ppem && + strike->y_ppm == (FT_UInt)size->root.metrics.y_ppem ) + { + goto Found_Strike; + } + + strike++; + } + + /* couldn't find it */ + return FT_Err_Invalid_Argument; + } + + Found_Strike: + + /* Now lookup the glyph's position within the file */ + { + FT_UInt char_len; + + + char_len = 4; + if ( strike->flags & 1 ) char_len += 1; + if ( strike->flags & 2 ) char_len += 1; + if ( strike->flags & 4 ) char_len += 1; + + /* Access data directly in the frame to speed lookups */ + if ( FT_STREAM_SEEK( phys->bct_offset + strike->bct_offset ) || + FT_FRAME_ENTER( char_len * strike->num_bitmaps ) ) + goto Exit; + + pfr_lookup_bitmap_data( stream->cursor, + stream->limit, + strike->num_bitmaps, + (FT_Byte) strike->flags, + character->char_code, + &gps_offset, + &gps_size ); + + FT_FRAME_EXIT(); + + if ( gps_size == 0 ) + { + /* Could not find a bitmap program string for this glyph */ + error = FT_Err_Invalid_Argument; + goto Exit; + } + } + + /* get the bitmap metrics */ + { + FT_Long xpos, ypos, advance; + FT_UInt xsize, ysize, format; + FT_Byte* p; + + + advance = FT_MulDiv( size->root.metrics.x_ppem << 8, + character->advance, + phys->metrics_resolution ); + + /* XXX: handle linearHoriAdvance correctly! */ + + if ( FT_STREAM_SEEK( face->header.gps_section_offset + gps_offset ) || + FT_FRAME_ENTER( gps_size ) ) + goto Exit; + + p = stream->cursor; + error = pfr_load_bitmap_metrics( &p, stream->limit, + advance, + &xpos, &ypos, + &xsize, &ysize, + &advance, &format ); + if ( !error ) + { + glyph->root.format = FT_GLYPH_FORMAT_BITMAP; + + /* Set up glyph bitmap and metrics */ + glyph->root.bitmap.width = (FT_Int)xsize; + glyph->root.bitmap.rows = (FT_Int)ysize; + glyph->root.bitmap.pitch = (FT_Long)( xsize + 7 ) >> 3; + glyph->root.bitmap.pixel_mode = FT_PIXEL_MODE_MONO; + + glyph->root.metrics.width = (FT_Long)xsize << 6; + glyph->root.metrics.height = (FT_Long)ysize << 6; + glyph->root.metrics.horiBearingX = xpos << 6; + glyph->root.metrics.horiBearingY = ypos << 6; + glyph->root.metrics.horiAdvance = ( ( advance >> 2 ) + 32 ) & -64; + glyph->root.metrics.vertBearingX = - glyph->root.metrics.width >> 1; + glyph->root.metrics.vertBearingY = 0; + glyph->root.metrics.vertAdvance = size->root.metrics.height; + + glyph->root.bitmap_left = xpos; + glyph->root.bitmap_top = ypos + ysize; + + /* Allocate and read bitmap data */ + { + FT_ULong len = glyph->root.bitmap.pitch * ysize; + + error = ft_glyphslot_alloc_bitmap( &glyph->root, len ); + if ( !error ) + { + error = pfr_load_bitmap_bits( p, + stream->limit, + format, + face->header.color_flags & 2, + &glyph->root.bitmap ); + } + } + } + + FT_FRAME_EXIT(); + } + + Exit: + return error; + } + +/* END */ Index: xc/extras/freetype2/src/pfr/pfrsbit.h diff -u /dev/null xc/extras/freetype2/src/pfr/pfrsbit.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/pfr/pfrsbit.h Wed May 28 22:01:53 2003 @@ -0,0 +1,36 @@ +/***************************************************************************/ +/* */ +/* pfrsbit.h */ +/* */ +/* FreeType PFR bitmap loader (specification). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PFRSBIT_H__ +#define __PFRSBIT_H__ + +#include "pfrobjs.h" + +FT_BEGIN_HEADER + + FT_LOCAL( FT_Error ) + pfr_slot_load_bitmap( PFR_Slot glyph, + PFR_Size size, + FT_UInt glyph_index ); + +FT_END_HEADER + +#endif /* __PFR_SBIT_H__ */ + + +/* END */ Index: xc/extras/freetype2/src/pfr/pfrtypes.h diff -u xc/extras/freetype2/src/pfr/pfrtypes.h:1.1.1.1 xc/extras/freetype2/src/pfr/pfrtypes.h:1.1.1.2 --- xc/extras/freetype2/src/pfr/pfrtypes.h:1.1.1.1 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/pfr/pfrtypes.h Wed May 28 22:01:53 2003 @@ -52,19 +52,19 @@ FT_UInt max_blue_values; FT_UInt max_x_orus; FT_UInt max_y_orus; - + FT_UInt phy_font_max_size_high; FT_UInt color_flags; - + FT_UInt32 bct_max_size; - FT_UInt32 bct_set_max_size; + FT_UInt32 bct_set_max_size; FT_UInt32 phy_bct_set_max_size; - + FT_UInt num_phy_fonts; FT_UInt max_vert_stem_snap; FT_UInt max_horz_stem_snap; FT_UInt max_chars; - + } PFR_HeaderRec, *PFR_Header; @@ -73,7 +73,7 @@ { PFR_FLAG_BLACK_PIXEL = 1, PFR_FLAG_INVERT_BITMAP = 2 - + } PFR_HeaderFlags; @@ -83,16 +83,16 @@ { FT_UInt32 size; FT_UInt32 offset; - + FT_Int32 matrix[4]; FT_UInt stroke_flags; FT_Int stroke_thickness; FT_Int bold_thickness; FT_Int32 miter_limit; - + FT_UInt32 phys_size; FT_UInt32 phys_offset; - + } PFR_LogFontRec, *PFR_LogFont; @@ -104,7 +104,7 @@ PFR_LOG_2BYTE_STROKE = 8, PFR_LOG_STROKE = 4, PFR_LINE_JOIN_MASK = 3 - + } PFR_LogFlags; @@ -113,7 +113,7 @@ PFR_LINE_JOIN_MITER = 0, PFR_LINE_JOIN_ROUND = 1, PFR_LINE_JOIN_BEVEL = 2 - + } PFR_LineJoinFlags; @@ -124,7 +124,7 @@ PFR_BITMAP_3BYTE_OFFSET = 4, PFR_BITMAP_2BYTE_SIZE = 2, PFR_BITMAP_2BYTE_CHARCODE = 1 - + } PFR_BitmapFlags; @@ -133,7 +133,7 @@ FT_UInt char_code; FT_UInt gps_size; FT_UInt32 gps_offset; - + } PFR_BitmapCharRec, *PFR_BitmapChar; @@ -153,17 +153,17 @@ FT_UInt x_ppm; FT_UInt y_ppm; FT_UInt flags; - + FT_UInt32 gps_size; FT_UInt32 gps_offset; - + FT_UInt32 bct_size; FT_UInt32 bct_offset; - + /* optional */ FT_UInt num_bitmaps; PFR_BitmapChar bitmaps; - + } PFR_StrikeRec, *PFR_Strike; @@ -175,7 +175,7 @@ FT_Int advance; FT_UInt gps_size; FT_UInt32 gps_offset; - + } PFR_CharRec, *PFR_Char; @@ -186,9 +186,36 @@ FT_UInt standard; FT_UInt num_stem_snaps; FT_Int* stem_snaps; - + } PFR_DimensionRec, *PFR_Dimension; + /************************************************************************/ + + typedef struct PFR_KernItemRec_* PFR_KernItem; + + typedef struct PFR_KernItemRec_ + { + PFR_KernItem next; + FT_UInt pair_count; + FT_UInt pair_size; + FT_Int base_adj; + FT_UInt flags; + FT_UInt32 offset; + FT_UInt32 pair1; + FT_UInt32 pair2; + + } PFR_KernItemRec; + +#define PFR_KERN_INDEX( g1, g2 ) \ + ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) ) + + typedef struct PFR_KernPairRec_ + { + FT_UInt glyph1; + FT_UInt glyph2; + FT_Vector kerning; + + } PFR_KernPairRec, *PFR_KernPair; /************************************************************************/ @@ -204,24 +231,38 @@ FT_UInt flags; FT_UInt standard_advance; + FT_Int ascent; /* optional, bbox.yMax if not present */ + FT_Int descent; /* optional, bbox.yMin if not present */ + FT_Int leading; /* optional, 0 if not present */ + PFR_DimensionRec horizontal; PFR_DimensionRec vertical; FT_String* font_id; + FT_String* family_name; + FT_String* style_name; FT_UInt num_strikes; FT_UInt max_strikes; PFR_StrikeRec* strikes; - + FT_UInt num_blue_values; FT_Int *blue_values; FT_UInt blue_fuzz; FT_UInt blue_scale; - + FT_UInt num_chars; FT_UInt32 chars_offset; PFR_Char chars; - + + FT_UInt num_kern_pairs; + PFR_KernItem kern_items; + PFR_KernItem* kern_items_tail; + + /* not part of the spec, but used during load */ + FT_UInt32 bct_offset; + FT_Byte* cursor; + } PFR_PhyFontRec, *PFR_PhyFont; @@ -238,6 +279,14 @@ } PFR_PhyFlags; + typedef enum PFR_KernFlags_ + { + PFR_KERN_2BYTE_ADJ = 0x01, + PFR_KERN_2BYTE_CHAR = 0x02 + + } PFR_KernFlags; + + /************************************************************************/ typedef enum PFR_GlyphFlags_ @@ -247,7 +296,7 @@ PFR_GLYPH_1BYTE_XYCOUNT = 0x04, PFR_GLYPH_XCOUNT = 0x02, PFR_GLYPH_YCOUNT = 0x01 - + } PFR_GlyphFlags; @@ -256,7 +305,7 @@ { FT_UInt org; FT_UInt cur; - + } PFR_CoordRec, *PFR_Coord; @@ -268,7 +317,7 @@ FT_Int y_delta; FT_UInt32 gps_offset; FT_UInt gps_size; - + } PFR_SubGlyphRec, *PFR_SubGlyph; @@ -278,14 +327,14 @@ PFR_SUBGLYPH_2BYTE_SIZE = 0x40, PFR_SUBGLYPH_YSCALE = 0x20, PFR_SUBGLYPH_XSCALE = 0x10 - + } PFR_SubGlyphFlags; typedef struct PFR_GlyphRec_ { FT_Byte format; - + FT_UInt num_x_control; FT_UInt num_y_control; FT_UInt max_xy_control; @@ -296,10 +345,10 @@ FT_UInt num_subs; FT_UInt max_subs; PFR_SubGlyphRec* subs; - + FT_GlyphLoader loader; FT_Bool path_begun; - + } PFR_GlyphRec, *PFR_Glyph; Index: xc/extras/freetype2/src/psaux/Jamfile diff -u xc/extras/freetype2/src/psaux/Jamfile:1.1.1.2 xc/extras/freetype2/src/psaux/Jamfile:1.1.1.3 --- xc/extras/freetype2/src/psaux/Jamfile:1.1.1.2 Thu Jun 20 04:16:18 2002 +++ xc/extras/freetype2/src/psaux/Jamfile Wed May 28 22:01:53 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/psaux Jamfile (c) 2001, 2002 David Turner # -SubDir FT2_TOP src psaux ; - -SubDirHdrs [ FT2_SubDir src psaux ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) psaux ; { local _sources ; Index: xc/extras/freetype2/src/psaux/psauxmod.c diff -u xc/extras/freetype2/src/psaux/psauxmod.c:1.1.1.4 xc/extras/freetype2/src/psaux/psauxmod.c:1.1.1.5 --- xc/extras/freetype2/src/psaux/psauxmod.c:1.1.1.4 Thu Jun 20 04:16:19 2002 +++ xc/extras/freetype2/src/psaux/psauxmod.c Wed May 28 22:01:53 2003 @@ -26,51 +26,51 @@ FT_CALLBACK_TABLE_DEF const PS_Table_FuncsRec ps_table_funcs = { - PS_Table_New, - PS_Table_Done, - PS_Table_Add, - PS_Table_Release + ps_table_new, + ps_table_done, + ps_table_add, + ps_table_release }; FT_CALLBACK_TABLE_DEF const PS_Parser_FuncsRec ps_parser_funcs = { - PS_Parser_Init, - PS_Parser_Done, - PS_Parser_SkipSpaces, - PS_Parser_SkipAlpha, - PS_Parser_ToInt, - PS_Parser_ToFixed, - PS_Parser_ToCoordArray, - PS_Parser_ToFixedArray, - PS_Parser_ToToken, - PS_Parser_ToTokenArray, - PS_Parser_LoadField, - PS_Parser_LoadFieldTable + ps_parser_init, + ps_parser_done, + ps_parser_skip_spaces, + ps_parser_skip_alpha, + ps_parser_to_int, + ps_parser_to_fixed, + ps_parser_to_coord_array, + ps_parser_to_fixed_array, + ps_parser_to_token, + ps_parser_to_token_array, + ps_parser_load_field, + ps_parser_load_field_table }; FT_CALLBACK_TABLE_DEF const T1_Builder_FuncsRec t1_builder_funcs = { - T1_Builder_Init, - T1_Builder_Done, - T1_Builder_Check_Points, - T1_Builder_Add_Point, - T1_Builder_Add_Point1, - T1_Builder_Add_Contour, - T1_Builder_Start_Point, - T1_Builder_Close_Contour + t1_builder_init, + t1_builder_done, + t1_builder_check_points, + t1_builder_add_point, + t1_builder_add_point1, + t1_builder_add_contour, + t1_builder_start_point, + t1_builder_close_contour }; FT_CALLBACK_TABLE_DEF const T1_Decoder_FuncsRec t1_decoder_funcs = { - T1_Decoder_Init, - T1_Decoder_Done, - T1_Decoder_Parse_Charstrings + t1_decoder_init, + t1_decoder_done, + t1_decoder_parse_charstrings }; @@ -92,7 +92,7 @@ &t1_builder_funcs, &t1_decoder_funcs, - T1_Decrypt, + t1_decrypt, (const T1_CMap_ClassesRec*) &t1_cmap_classes, }; Index: xc/extras/freetype2/src/psaux/psobjs.c diff -u xc/extras/freetype2/src/psaux/psobjs.c:1.1.1.6 xc/extras/freetype2/src/psaux/psobjs.c:1.1.1.7 --- xc/extras/freetype2/src/psaux/psobjs.c:1.1.1.6 Thu Jun 20 04:16:19 2002 +++ xc/extras/freetype2/src/psaux/psobjs.c Wed May 28 22:01:53 2003 @@ -36,7 +36,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* PS_Table_New */ + /* ps_table_new */ /* */ /* <Description> */ /* Initializes a PS_Table. */ @@ -54,7 +54,7 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - PS_Table_New( PS_Table table, + ps_table_new( PS_Table table, FT_Int count, FT_Memory memory ) { @@ -72,7 +72,7 @@ table->block = 0; table->capacity = 0; table->cursor = 0; - + *(PS_Table_FuncsRec*)&table->funcs = ps_table_funcs; Exit: @@ -102,7 +102,7 @@ static FT_Error reallocate_t1_table( PS_Table table, - FT_Int new_size ) + FT_Long new_size ) { FT_Memory memory = table->memory; FT_Byte* old_base = table->block; @@ -111,7 +111,10 @@ /* allocate new base block */ if ( FT_ALLOC( table->block, new_size ) ) + { + table->block = old_base; return error; + } /* copy elements and shift offsets */ if (old_base ) @@ -130,7 +133,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* PS_Table_Add */ + /* ps_table_add */ /* */ /* <Description> */ /* Adds an object to a PS_Table, possibly growing its memory block. */ @@ -150,14 +153,14 @@ /* reallocation fails. */ /* */ FT_LOCAL_DEF( FT_Error ) - PS_Table_Add( PS_Table table, + ps_table_add( PS_Table table, FT_Int idx, void* object, FT_Int length ) { if ( idx < 0 || idx > table->max_elems ) { - FT_ERROR(( "PS_Table_Add: invalid index\n" )); + FT_ERROR(( "ps_table_add: invalid index\n" )); return PSaux_Err_Invalid_Argument; } @@ -174,7 +177,11 @@ in_offset = -1; while ( new_size < table->cursor + length ) - new_size += 1024; + { + /* increase size by 25% and round up to the nearest multiple of 1024 */ + new_size += (new_size >> 2) + 1; + new_size = ( new_size + 1023 ) & -1024; + } error = reallocate_t1_table( table, new_size ); if ( error ) @@ -197,7 +204,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* PS_Table_Done */ + /* ps_table_done */ /* */ /* <Description> */ /* Finalizes a PS_TableRec (i.e., reallocate it to its current */ @@ -211,7 +218,7 @@ /* to the caller to clean it, or reference it in its own structures. */ /* */ FT_LOCAL_DEF( void ) - PS_Table_Done( PS_Table table ) + ps_table_done( PS_Table table ) { FT_Memory memory = table->memory; FT_Error error; @@ -235,7 +242,7 @@ FT_LOCAL_DEF( void ) - PS_Table_Release( PS_Table table ) + ps_table_release( PS_Table table ) { FT_Memory memory = table->memory; @@ -266,7 +273,7 @@ FT_LOCAL_DEF( void ) - PS_Parser_SkipSpaces( PS_Parser parser ) + ps_parser_skip_spaces( PS_Parser parser ) { FT_Byte* cur = parser->cursor; FT_Byte* limit = parser->limit; @@ -286,7 +293,7 @@ FT_LOCAL_DEF( void ) - PS_Parser_SkipAlpha( PS_Parser parser ) + ps_parser_skip_alpha( PS_Parser parser ) { FT_Byte* cur = parser->cursor; FT_Byte* limit = parser->limit; @@ -306,8 +313,8 @@ FT_LOCAL_DEF( void ) - PS_Parser_ToToken( PS_Parser parser, - T1_Token token ) + ps_parser_to_token( PS_Parser parser, + T1_Token token ) { FT_Byte* cur; FT_Byte* limit; @@ -320,7 +327,7 @@ token->limit = 0; /* first of all, skip space */ - PS_Parser_SkipSpaces( parser ); + ps_parser_skip_spaces( parser ); cur = parser->cursor; limit = parser->limit; @@ -389,17 +396,17 @@ FT_LOCAL_DEF( void ) - PS_Parser_ToTokenArray( PS_Parser parser, - T1_Token tokens, - FT_UInt max_tokens, - FT_Int* pnum_tokens ) + ps_parser_to_token_array( PS_Parser parser, + T1_Token tokens, + FT_UInt max_tokens, + FT_Int* pnum_tokens ) { T1_TokenRec master; *pnum_tokens = -1; - PS_Parser_ToToken( parser, &master ); + ps_parser_to_token( parser, &master ); if ( master.type == T1_TOKEN_TYPE_ARRAY ) { FT_Byte* old_cursor = parser->cursor; @@ -416,7 +423,7 @@ T1_TokenRec token; - PS_Parser_ToToken( parser, &token ); + ps_parser_to_token( parser, &token ); if ( !token.type ) break; @@ -739,7 +746,7 @@ FT_Memory memory ) { FT_Byte* cur = *cursor; - FT_Int len = 0; + FT_PtrDist len = 0; FT_Int count; FT_String* result; FT_Error error; @@ -829,11 +836,11 @@ /* Load a simple field (i.e. non-table) into the current list of objects */ FT_LOCAL_DEF( FT_Error ) - PS_Parser_LoadField( PS_Parser parser, - const T1_Field field, - void** objects, - FT_UInt max_objects, - FT_ULong* pflags ) + ps_parser_load_field( PS_Parser parser, + const T1_Field field, + void** objects, + FT_UInt max_objects, + FT_ULong* pflags ) { T1_TokenRec token; FT_Byte* cur; @@ -843,7 +850,7 @@ FT_Error error; - PS_Parser_ToToken( parser, &token ); + ps_parser_to_token( parser, &token ); if ( !token.type ) goto Fail; @@ -852,8 +859,27 @@ cur = token.start; limit = token.limit; - if ( token.type == T1_TOKEN_TYPE_ARRAY ) + /* we must detect arrays */ + if ( field->type == T1_FIELD_TYPE_BBOX ) + { + T1_TokenRec token2; + FT_Byte* old_cur = parser->cursor; + FT_Byte* old_limit = parser->limit; + + + parser->cursor = token.start; + parser->limit = token.limit; + + ps_parser_to_token( parser, &token2 ); + parser->cursor = old_cur; + parser->limit = old_limit; + + if ( token2.type == T1_TOKEN_TYPE_ARRAY ) + goto FieldArray; + } + else if ( token.type == T1_TOKEN_TYPE_ARRAY ) { + FieldArray: /* if this is an array, and we have no blend, an error occurs */ if ( max_objects == 0 ) goto Fail; @@ -922,6 +948,24 @@ } break; + case T1_FIELD_TYPE_BBOX: + { + FT_Fixed temp[4]; + FT_BBox* bbox = (FT_BBox*)q; + + + /* we need the '[' and ']' delimiters */ + token.start--; + token.limit++; + (void)t1_tofixedarray( &token.start, token.limit, 4, temp, 0 ); + + bbox->xMin = FT_RoundFix( temp[0] ); + bbox->yMin = FT_RoundFix( temp[1] ); + bbox->xMax = FT_RoundFix( temp[2] ); + bbox->yMax = FT_RoundFix( temp[3] ); + } + break; + default: /* an error occured */ goto Fail; @@ -950,11 +994,11 @@ FT_LOCAL_DEF( FT_Error ) - PS_Parser_LoadFieldTable( PS_Parser parser, - const T1_Field field, - void** objects, - FT_UInt max_objects, - FT_ULong* pflags ) + ps_parser_load_field_table( PS_Parser parser, + const T1_Field field, + void** objects, + FT_UInt max_objects, + FT_ULong* pflags ) { T1_TokenRec elements[T1_MAX_TABLE_ELEMENTS]; T1_Token token; @@ -971,7 +1015,7 @@ fieldrec.type = T1_FIELD_TYPE_FIXED; #endif - PS_Parser_ToTokenArray( parser, elements, 32, &num_elements ); + ps_parser_to_token_array( parser, elements, 32, &num_elements ); if ( num_elements < 0 ) goto Fail; @@ -991,7 +1035,7 @@ { parser->cursor = token->start; parser->limit = token->limit; - PS_Parser_LoadField( parser, &fieldrec, objects, max_objects, 0 ); + ps_parser_load_field( parser, &fieldrec, objects, max_objects, 0 ); fieldrec.offset += fieldrec.size; } @@ -1015,24 +1059,24 @@ FT_LOCAL_DEF( FT_Long ) - PS_Parser_ToInt( PS_Parser parser ) + ps_parser_to_int( PS_Parser parser ) { return t1_toint( &parser->cursor, parser->limit ); } FT_LOCAL_DEF( FT_Fixed ) - PS_Parser_ToFixed( PS_Parser parser, - FT_Int power_ten ) + ps_parser_to_fixed( PS_Parser parser, + FT_Int power_ten ) { return t1_tofixed( &parser->cursor, parser->limit, power_ten ); } FT_LOCAL_DEF( FT_Int ) - PS_Parser_ToCoordArray( PS_Parser parser, - FT_Int max_coords, - FT_Short* coords ) + ps_parser_to_coord_array( PS_Parser parser, + FT_Int max_coords, + FT_Short* coords ) { return t1_tocoordarray( &parser->cursor, parser->limit, max_coords, coords ); @@ -1040,10 +1084,10 @@ FT_LOCAL_DEF( FT_Int ) - PS_Parser_ToFixedArray( PS_Parser parser, - FT_Int max_values, - FT_Fixed* values, - FT_Int power_ten ) + ps_parser_to_fixed_array( PS_Parser parser, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ) { return t1_tofixedarray( &parser->cursor, parser->limit, max_values, values, power_ten ); @@ -1069,7 +1113,7 @@ FT_LOCAL_DEF( void ) - PS_Parser_Init( PS_Parser parser, + ps_parser_init( PS_Parser parser, FT_Byte* base, FT_Byte* limit, FT_Memory memory ) @@ -1084,7 +1128,7 @@ FT_LOCAL_DEF( void ) - PS_Parser_Done( PS_Parser parser ) + ps_parser_done( PS_Parser parser ) { FT_UNUSED( parser ); } @@ -1101,7 +1145,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* T1_Builder_Init */ + /* t1_builder_init */ /* */ /* <Description> */ /* Initializes a given glyph builder. */ @@ -1119,7 +1163,7 @@ /* hinting :: Whether hinting should be applied. */ /* */ FT_LOCAL_DEF( void ) - T1_Builder_Init( T1_Builder builder, + t1_builder_init( T1_Builder builder, FT_Face face, FT_Size size, FT_GlyphSlot glyph, @@ -1170,7 +1214,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* T1_Builder_Done */ + /* t1_builder_done */ /* */ /* <Description> */ /* Finalizes a given glyph builder. Its contents can still be used */ @@ -1181,7 +1225,7 @@ /* builder :: A pointer to the glyph builder to finalize. */ /* */ FT_LOCAL_DEF( void ) - T1_Builder_Done( T1_Builder builder ) + t1_builder_done( T1_Builder builder ) { FT_GlyphSlot glyph = builder->glyph; @@ -1193,7 +1237,7 @@ /* check that there is enough space for `count' more points */ FT_LOCAL_DEF( FT_Error ) - T1_Builder_Check_Points( T1_Builder builder, + t1_builder_check_points( T1_Builder builder, FT_Int count ) { return FT_GlyphLoader_CheckPoints( builder->loader, count, 0 ); @@ -1202,7 +1246,7 @@ /* add a new point, do not check space */ FT_LOCAL_DEF( void ) - T1_Builder_Add_Point( T1_Builder builder, + t1_builder_add_point( T1_Builder builder, FT_Pos x, FT_Pos y, FT_Byte flag ) @@ -1223,7 +1267,7 @@ } point->x = x; point->y = y; - *control = (FT_Byte)( flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic ); + *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC ); builder->last = *point; } @@ -1233,16 +1277,16 @@ /* check space for a new on-curve point, then add it */ FT_LOCAL_DEF( FT_Error ) - T1_Builder_Add_Point1( T1_Builder builder, + t1_builder_add_point1( T1_Builder builder, FT_Pos x, FT_Pos y ) { FT_Error error; - error = T1_Builder_Check_Points( builder, 1 ); + error = t1_builder_check_points( builder, 1 ); if ( !error ) - T1_Builder_Add_Point( builder, x, y, 1 ); + t1_builder_add_point( builder, x, y, 1 ); return error; } @@ -1250,7 +1294,7 @@ /* check room for a new contour, then add it */ FT_LOCAL_DEF( FT_Error ) - T1_Builder_Add_Contour( T1_Builder builder ) + t1_builder_add_contour( T1_Builder builder ) { FT_Outline* outline = builder->current; FT_Error error; @@ -1278,7 +1322,7 @@ /* if a path was begun, add its first on-curve point */ FT_LOCAL_DEF( FT_Error ) - T1_Builder_Start_Point( T1_Builder builder, + t1_builder_start_point( T1_Builder builder, FT_Pos x, FT_Pos y ) { @@ -1289,9 +1333,9 @@ if ( !builder->path_begun ) { builder->path_begun = 1; - error = T1_Builder_Add_Contour( builder ); + error = t1_builder_add_contour( builder ); if ( !error ) - error = T1_Builder_Add_Point1( builder, x, y ); + error = t1_builder_add_point1( builder, x, y ); } return error; } @@ -1299,7 +1343,7 @@ /* close the current contour */ FT_LOCAL_DEF( void ) - T1_Builder_Close_Contour( T1_Builder builder ) + t1_builder_close_contour( T1_Builder builder ) { FT_Outline* outline = builder->current; @@ -1323,7 +1367,7 @@ /* `delete' last point only if it coincides with the first */ /* point and it is not a control point (which can happen). */ if ( p1->x == p2->x && p1->y == p2->y ) - if ( *control == FT_Curve_Tag_On ) + if ( *control == FT_CURVE_TAG_ON ) outline->n_points--; } @@ -1342,7 +1386,7 @@ /*************************************************************************/ FT_LOCAL_DEF( void ) - T1_Decrypt( FT_Byte* buffer, + t1_decrypt( FT_Byte* buffer, FT_Offset length, FT_UShort seed ) { Index: xc/extras/freetype2/src/psaux/psobjs.h diff -u xc/extras/freetype2/src/psaux/psobjs.h:1.1.1.5 xc/extras/freetype2/src/psaux/psobjs.h:1.1.1.6 --- xc/extras/freetype2/src/psaux/psobjs.h:1.1.1.5 Thu Jun 20 04:16:19 2002 +++ xc/extras/freetype2/src/psaux/psobjs.h Wed May 28 22:01:53 2003 @@ -47,22 +47,22 @@ FT_LOCAL( FT_Error ) - PS_Table_New( PS_Table table, + ps_table_new( PS_Table table, FT_Int count, FT_Memory memory ); FT_LOCAL( FT_Error ) - PS_Table_Add( PS_Table table, + ps_table_add( PS_Table table, FT_Int idx, void* object, FT_Int length ); FT_LOCAL( void ) - PS_Table_Done( PS_Table table ); + ps_table_done( PS_Table table ); FT_LOCAL( void ) - PS_Table_Release( PS_Table table ); + ps_table_release( PS_Table table ); /*************************************************************************/ @@ -75,64 +75,64 @@ FT_LOCAL( void ) - PS_Parser_SkipSpaces( PS_Parser parser ); + ps_parser_skip_spaces( PS_Parser parser ); FT_LOCAL( void ) - PS_Parser_SkipAlpha( PS_Parser parser ); + ps_parser_skip_alpha( PS_Parser parser ); FT_LOCAL( void ) - PS_Parser_ToToken( PS_Parser parser, - T1_Token token ); + ps_parser_to_token( PS_Parser parser, + T1_Token token ); FT_LOCAL( void ) - PS_Parser_ToTokenArray( PS_Parser parser, - T1_Token tokens, - FT_UInt max_tokens, - FT_Int* pnum_tokens ); + ps_parser_to_token_array( PS_Parser parser, + T1_Token tokens, + FT_UInt max_tokens, + FT_Int* pnum_tokens ); FT_LOCAL( FT_Error ) - PS_Parser_LoadField( PS_Parser parser, - const T1_Field field, - void** objects, - FT_UInt max_objects, - FT_ULong* pflags ); + ps_parser_load_field( PS_Parser parser, + const T1_Field field, + void** objects, + FT_UInt max_objects, + FT_ULong* pflags ); FT_LOCAL( FT_Error ) - PS_Parser_LoadFieldTable( PS_Parser parser, - const T1_Field field, - void** objects, - FT_UInt max_objects, - FT_ULong* pflags ); + ps_parser_load_field_table( PS_Parser parser, + const T1_Field field, + void** objects, + FT_UInt max_objects, + FT_ULong* pflags ); FT_LOCAL( FT_Long ) - PS_Parser_ToInt( PS_Parser parser ); + ps_parser_to_int( PS_Parser parser ); FT_LOCAL( FT_Fixed ) - PS_Parser_ToFixed( PS_Parser parser, - FT_Int power_ten ); + ps_parser_to_fixed( PS_Parser parser, + FT_Int power_ten ); FT_LOCAL( FT_Int ) - PS_Parser_ToCoordArray( PS_Parser parser, - FT_Int max_coords, - FT_Short* coords ); + ps_parser_to_coord_array( PS_Parser parser, + FT_Int max_coords, + FT_Short* coords ); FT_LOCAL( FT_Int ) - PS_Parser_ToFixedArray( PS_Parser parser, - FT_Int max_values, - FT_Fixed* values, - FT_Int power_ten ); + ps_parser_to_fixed_array( PS_Parser parser, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ); FT_LOCAL( void ) - PS_Parser_Init( PS_Parser parser, + ps_parser_init( PS_Parser parser, FT_Byte* base, FT_Byte* limit, FT_Memory memory ); FT_LOCAL( void ) - PS_Parser_Done( PS_Parser parser ); + ps_parser_done( PS_Parser parser ); /*************************************************************************/ @@ -144,42 +144,42 @@ /*************************************************************************/ FT_LOCAL( void ) - T1_Builder_Init( T1_Builder builder, + t1_builder_init( T1_Builder builder, FT_Face face, FT_Size size, FT_GlyphSlot glyph, FT_Bool hinting ); FT_LOCAL( void ) - T1_Builder_Done( T1_Builder builder ); + t1_builder_done( T1_Builder builder ); FT_LOCAL( FT_Error ) - T1_Builder_Check_Points( T1_Builder builder, + t1_builder_check_points( T1_Builder builder, FT_Int count ); FT_LOCAL( void ) - T1_Builder_Add_Point( T1_Builder builder, + t1_builder_add_point( T1_Builder builder, FT_Pos x, FT_Pos y, FT_Byte flag ); FT_LOCAL( FT_Error ) - T1_Builder_Add_Point1( T1_Builder builder, + t1_builder_add_point1( T1_Builder builder, FT_Pos x, FT_Pos y ); FT_LOCAL( FT_Error ) - T1_Builder_Add_Contour( T1_Builder builder ); + t1_builder_add_contour( T1_Builder builder ); FT_LOCAL( FT_Error ) - T1_Builder_Start_Point( T1_Builder builder, + t1_builder_start_point( T1_Builder builder, FT_Pos x, FT_Pos y ); FT_LOCAL( void ) - T1_Builder_Close_Contour( T1_Builder builder ); + t1_builder_close_contour( T1_Builder builder ); /*************************************************************************/ @@ -191,7 +191,7 @@ /*************************************************************************/ FT_LOCAL( void ) - T1_Decrypt( FT_Byte* buffer, + t1_decrypt( FT_Byte* buffer, FT_Offset length, FT_UShort seed ); Index: xc/extras/freetype2/src/psaux/t1cmap.c diff -u xc/extras/freetype2/src/psaux/t1cmap.c:1.1.1.1 xc/extras/freetype2/src/psaux/t1cmap.c:1.1.1.2 --- xc/extras/freetype2/src/psaux/t1cmap.c:1.1.1.1 Thu Jun 20 04:16:19 2002 +++ xc/extras/freetype2/src/psaux/t1cmap.c Wed May 28 22:01:53 2003 @@ -197,12 +197,11 @@ FT_UInt32 char_code ) { FT_UInt result = 0; - FT_UInt32 idx; - idx = (FT_UInt32)( char_code - cmap->first ); - if ( idx < cmap->count ) - result = cmap->indices[idx]; + if ( ( char_code >= cmap->first ) && + ( char_code < ( cmap->first + cmap->count ) ) ) + result = cmap->indices[char_code]; return result; } @@ -214,7 +213,6 @@ { FT_UInt result = 0; FT_UInt32 char_code = *pchar_code; - FT_UInt32 idx; ++char_code; @@ -222,10 +220,9 @@ if ( char_code < cmap->first ) char_code = cmap->first; - idx = (FT_UInt32)( char_code - cmap->first ); - for ( ; idx < cmap->count; idx++, char_code++ ) + for ( ; char_code < ( cmap->first + cmap->count ); char_code++ ) { - result = cmap->indices[idx]; + result = cmap->indices[char_code]; if ( result != 0 ) goto Exit; } Index: xc/extras/freetype2/src/psaux/t1decode.c diff -u xc/extras/freetype2/src/psaux/t1decode.c:1.1.1.6 xc/extras/freetype2/src/psaux/t1decode.c:1.1.1.7 --- xc/extras/freetype2/src/psaux/t1decode.c:1.1.1.6 Thu Jun 20 04:16:19 2002 +++ xc/extras/freetype2/src/psaux/t1decode.c Wed May 28 22:01:54 2003 @@ -247,7 +247,7 @@ /* set up remaining glyph fields */ glyph->num_subglyphs = 2; glyph->subglyphs = loader->base.subglyphs; - glyph->format = ft_glyph_format_composite; + glyph->format = FT_GLYPH_FORMAT_COMPOSITE; loader->current.num_subglyphs = 2; goto Exit; @@ -258,7 +258,7 @@ FT_GlyphLoader_Prepare( decoder->builder.loader ); /* prepare loader */ - error = T1_Decoder_Parse_Glyph( decoder, bchar_index ); + error = t1_decoder_parse_glyph( decoder, bchar_index ); if ( error ) goto Exit; @@ -280,7 +280,7 @@ /* Now load `achar' on top of */ /* the base outline */ - error = T1_Decoder_Parse_Glyph( decoder, achar_index ); + error = t1_decoder_parse_glyph( decoder, achar_index ); if ( error ) goto Exit; @@ -316,7 +316,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* T1_Decoder_Parse_Charstrings */ + /* t1_decoder_parse_charstrings */ /* */ /* <Description> */ /* Parses a given Type 1 charstrings program. */ @@ -332,7 +332,7 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - T1_Decoder_Parse_Charstrings( T1_Decoder decoder, + t1_decoder_parse_charstrings( T1_Decoder decoder, FT_Byte* charstring_base, FT_UInt charstring_len ) { @@ -347,12 +347,12 @@ /* we don't want to touch the source code -- use macro trick */ -#define start_point T1_Builder_Start_Point -#define check_points T1_Builder_Check_Points -#define add_point T1_Builder_Add_Point -#define add_point1 T1_Builder_Add_Point1 -#define add_contour T1_Builder_Add_Contour -#define close_contour T1_Builder_Close_Contour +#define start_point t1_builder_start_point +#define check_points t1_builder_check_points +#define add_point t1_builder_add_point +#define add_point1 t1_builder_add_point1 +#define add_contour t1_builder_add_contour +#define close_contour t1_builder_close_contour /* First of all, initialize the decoder */ decoder->top = decoder->stack; @@ -453,7 +453,7 @@ case 12: if ( ip > limit ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "invalid escape (12+EOF)\n" )); goto Syntax_Error; } @@ -489,7 +489,7 @@ break; default: - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "invalid escape (12+%d)\n", ip[-1] )); goto Syntax_Error; @@ -499,7 +499,7 @@ case 255: /* four bytes integer */ if ( ip + 4 > limit ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "unexpected EOF in integer\n" )); goto Syntax_Error; } @@ -520,7 +520,7 @@ { if ( ++ip > limit ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " )); + FT_ERROR(( "t1_decoder_parse_charstrings: " )); FT_ERROR(( "unexpected EOF in integer\n" )); goto Syntax_Error; } @@ -533,7 +533,7 @@ } else { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "invalid byte (%d)\n", ip[-1] )); goto Syntax_Error; } @@ -548,7 +548,7 @@ { if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: stack overflow!\n" )); + FT_ERROR(( "t1_decoder_parse_charstrings: stack overflow!\n" )); goto Syntax_Error; } @@ -605,7 +605,7 @@ if ( decoder->flex_state == 0 || decoder->num_flex_vectors != 7 ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "unexpected flex end\n" )); goto Syntax_Error; } @@ -616,7 +616,7 @@ ip[2] != 12 || ip[3] != 17 || /* pop */ ip[4] != 12 || ip[5] != 33 ) /* setcurpoint */ { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "invalid flex charstring\n" )); goto Syntax_Error; } @@ -632,14 +632,14 @@ /* eat the following `pop' */ if ( ip + 2 > limit ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "invalid escape (12+%d)\n", ip[-1] )); goto Syntax_Error; } if ( ip[0] != 12 || ip[1] != 17 ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " )); + FT_ERROR(( "t1_decoder_parse_charstrings: " )); FT_ERROR(( "`pop' expected, found (%d %d)\n", ip[0], ip[1] )); goto Syntax_Error; } @@ -670,15 +670,15 @@ if ( !blend ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " )); + FT_ERROR(( "t1_decoder_parse_charstrings: " )); FT_ERROR(( "unexpected multiple masters operator!\n" )); goto Syntax_Error; } - num_points = top[1] - 13 + ( top[1] == 18 ); + num_points = (FT_UInt)top[1] - 13 + ( top[1] == 18 ); if ( top[0] != (FT_Int)( num_points * blend->num_designs ) ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " )); + FT_ERROR(( "t1_decoder_parse_charstrings: " )); FT_ERROR(( "incorrect number of mm arguments\n" )); goto Syntax_Error; } @@ -720,7 +720,7 @@ default: Unexpected_OtherSubr: - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "invalid othersubr [%d %d]!\n", top[0], top[1] )); goto Syntax_Error; } @@ -752,7 +752,8 @@ /* apply hints to the loaded glyph outline now */ hinter->apply( hinter->hints, builder->current, - (PSH_Globals)builder->hints_globals ); + (PSH_Globals) builder->hints_globals, + decoder->hint_mode ); } /* add current outline to the glyph slot */ @@ -932,7 +933,7 @@ } else { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: division by 0\n" )); + FT_ERROR(( "t1_decoder_parse_charstrings: division by 0\n" )); goto Syntax_Error; } break; @@ -947,14 +948,14 @@ idx = top[0]; if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "invalid subrs index\n" )); goto Syntax_Error; } if ( zone - decoder->zones >= T1_MAX_SUBRS_CALLS ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "too many nested subrs\n" )); goto Syntax_Error; } @@ -982,7 +983,7 @@ if ( !zone->base ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "invoking empty subrs!\n" )); goto Syntax_Error; } @@ -1005,7 +1006,7 @@ if ( zone <= decoder->zones ) { - FT_ERROR(( "T1_Decoder_Parse_Charstrings: unexpected return\n" )); + FT_ERROR(( "t1_decoder_parse_charstrings: unexpected return\n" )); goto Syntax_Error; } @@ -1072,12 +1073,12 @@ case op_setcurrentpoint: FT_TRACE4(( " setcurrentpoint" )); - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " )); + FT_ERROR(( "t1_decoder_parse_charstrings: " )); FT_ERROR(( "unexpected `setcurrentpoint'\n" )); goto Syntax_Error; default: - FT_ERROR(( "T1_Decoder_Parse_Charstrings: " + FT_ERROR(( "t1_decoder_parse_charstrings: " "unhandled opcode %d\n", op )); goto Syntax_Error; } @@ -1105,7 +1106,7 @@ /* parse a single Type 1 glyph */ FT_LOCAL_DEF( FT_Error ) - T1_Decoder_Parse_Glyph( T1_Decoder decoder, + t1_decoder_parse_glyph( T1_Decoder decoder, FT_UInt glyph ) { return decoder->parse_callback( decoder, glyph ); @@ -1114,16 +1115,17 @@ /* initialize T1 decoder */ FT_LOCAL_DEF( FT_Error ) - T1_Decoder_Init( T1_Decoder decoder, + t1_decoder_init( T1_Decoder decoder, FT_Face face, FT_Size size, FT_GlyphSlot slot, FT_Byte** glyph_names, PS_Blend blend, FT_Bool hinting, + FT_Render_Mode hint_mode, T1_Decoder_Callback parse_callback ) { - FT_MEM_SET( decoder, 0, sizeof ( *decoder ) ); + FT_MEM_ZERO( decoder, sizeof ( *decoder ) ); /* retrieve PSNames interface from list of current modules */ { @@ -1134,7 +1136,7 @@ FT_FACE_LIBRARY(face), "psnames" ); if ( !psnames ) { - FT_ERROR(( "T1_Decoder_Init: " )); + FT_ERROR(( "t1_decoder_init: " )); FT_ERROR(( "the `psnames' module is not available\n" )); return PSaux_Err_Unimplemented_Feature; } @@ -1142,10 +1144,12 @@ decoder->psnames = psnames; } - T1_Builder_Init( &decoder->builder, face, size, slot, hinting ); + t1_builder_init( &decoder->builder, face, size, slot, hinting ); - decoder->num_glyphs = face->num_glyphs; + decoder->num_glyphs = (FT_UInt)face->num_glyphs; decoder->glyph_names = glyph_names; + decoder->hint_flags = face->internal->hint_flags; + decoder->hint_mode = hint_mode; decoder->blend = blend; decoder->parse_callback = parse_callback; @@ -1157,9 +1161,9 @@ /* finalize T1 decoder */ FT_LOCAL_DEF( void ) - T1_Decoder_Done( T1_Decoder decoder ) + t1_decoder_done( T1_Decoder decoder ) { - T1_Builder_Done( &decoder->builder ); + t1_builder_done( &decoder->builder ); } Index: xc/extras/freetype2/src/psaux/t1decode.h diff -u xc/extras/freetype2/src/psaux/t1decode.h:1.1.1.5 xc/extras/freetype2/src/psaux/t1decode.h:1.1.1.6 --- xc/extras/freetype2/src/psaux/t1decode.h:1.1.1.5 Thu Jun 20 04:16:19 2002 +++ xc/extras/freetype2/src/psaux/t1decode.h Wed May 28 22:01:54 2003 @@ -34,26 +34,27 @@ FT_LOCAL( FT_Error ) - T1_Decoder_Parse_Glyph( T1_Decoder decoder, + t1_decoder_parse_glyph( T1_Decoder decoder, FT_UInt glyph_index ); FT_LOCAL( FT_Error ) - T1_Decoder_Parse_Charstrings( T1_Decoder decoder, + t1_decoder_parse_charstrings( T1_Decoder decoder, FT_Byte* base, FT_UInt len ); FT_LOCAL( FT_Error ) - T1_Decoder_Init( T1_Decoder decoder, + t1_decoder_init( T1_Decoder decoder, FT_Face face, FT_Size size, FT_GlyphSlot slot, FT_Byte** glyph_names, PS_Blend blend, FT_Bool hinting, + FT_Render_Mode hint_mode, T1_Decoder_Callback parse_glyph ); FT_LOCAL( void ) - T1_Decoder_Done( T1_Decoder decoder ); + t1_decoder_done( T1_Decoder decoder ); FT_END_HEADER Index: xc/extras/freetype2/src/pshinter/Jamfile diff -u xc/extras/freetype2/src/pshinter/Jamfile:1.1.1.1 xc/extras/freetype2/src/pshinter/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/pshinter/Jamfile:1.1.1.1 Mon Jan 14 11:52:14 2002 +++ xc/extras/freetype2/src/pshinter/Jamfile Wed May 28 22:01:54 2003 @@ -1,16 +1,14 @@ # FreeType 2 src/pshinter Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src pshinter ; - -SubDirHdrs [ FT2_SubDir src pshinter ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) pshinter ; { local _sources ; if $(FT2_MULTI) { - _sources = pshrec pshglob pshalgo1 pshalgo2 pshmod ; + _sources = pshrec pshglob pshalgo1 pshalgo2 pshalgo3 pshmod ; } else { Index: xc/extras/freetype2/src/pshinter/pshalgo.h diff -u xc/extras/freetype2/src/pshinter/pshalgo.h:1.1.1.1 xc/extras/freetype2/src/pshinter/pshalgo.h:1.1.1.2 --- xc/extras/freetype2/src/pshinter/pshalgo.h:1.1.1.1 Mon Jan 14 11:52:14 2002 +++ xc/extras/freetype2/src/pshinter/pshalgo.h Wed May 28 22:01:54 2003 @@ -22,17 +22,26 @@ FT_BEGIN_HEADER /* define to choose hinting algorithm */ -#define PSH_ALGORITHM_2 +#define PSH_ALGORITHM_3 -#ifdef PSH_ALGORITHM_1 +#if defined(PSH_ALGORITHM_1) -#include "pshalgo1.h" -#define PS_HINTS_APPLY_FUNC ps1_hints_apply +# include "pshalgo1.h" +# define PS_HINTS_APPLY_FUNC ps1_hints_apply + +#elif defined(PSH_ALGORITHM_2) + +# include "pshalgo2.h" +# define PS_HINTS_APPLY_FUNC ps2_hints_apply + +#elif defined(PSH_ALGORITHM_3) + +# include "pshalgo3.h" +# define PS_HINTS_APPLY_FUNC ps3_hints_apply #else -#include "pshalgo2.h" -#define PS_HINTS_APPLY_FUNC ps2_hints_apply +# error "invalid Postscript Hinter algorithm selection" #endif Index: xc/extras/freetype2/src/pshinter/pshalgo1.c diff -u xc/extras/freetype2/src/pshinter/pshalgo1.c:1.1.1.3 xc/extras/freetype2/src/pshinter/pshalgo1.c:1.1.1.4 --- xc/extras/freetype2/src/pshinter/pshalgo1.c:1.1.1.3 Thu Jun 20 04:16:19 2002 +++ xc/extras/freetype2/src/pshinter/pshalgo1.c Wed May 28 22:01:54 2003 @@ -25,8 +25,8 @@ #define FT_COMPONENT trace_pshalgo1 #ifdef DEBUG_HINTER - extern PSH1_Hint_Table ps1_debug_hint_table = 0; - extern PSH1_HintFunc ps1_debug_hint_func = 0; + PSH1_Hint_Table ps1_debug_hint_table = 0; + PSH1_HintFunc ps1_debug_hint_func = 0; #endif @@ -742,22 +742,25 @@ /*************************************************************************/ FT_Error - ps1_hints_apply( PS_Hints ps_hints, - FT_Outline* outline, - PSH_Globals globals ) + ps1_hints_apply( PS_Hints ps_hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ) { PSH1_Hint_TableRec hints; FT_Error error = 0; FT_Int dimension; + FT_UNUSED( hint_mode ); + for ( dimension = 1; dimension >= 0; dimension-- ) { PS_Dimension dim = &ps_hints->dimension[dimension]; /* initialize hints table */ - ft_memset( &hints, 0, sizeof ( hints ) ); + FT_MEM_ZERO( &hints, sizeof ( hints ) ); error = psh1_hint_table_init( &hints, &dim->hints, &dim->masks, Index: xc/extras/freetype2/src/pshinter/pshalgo1.h diff -u xc/extras/freetype2/src/pshinter/pshalgo1.h:1.1.1.1 xc/extras/freetype2/src/pshinter/pshalgo1.h:1.1.1.2 --- xc/extras/freetype2/src/pshinter/pshalgo1.h:1.1.1.1 Mon Jan 14 11:52:14 2002 +++ xc/extras/freetype2/src/pshinter/pshalgo1.h Wed May 28 22:01:54 2003 @@ -86,9 +86,10 @@ extern FT_Error - ps1_hints_apply( PS_Hints ps_hints, - FT_Outline* outline, - PSH_Globals globals ); + ps1_hints_apply( PS_Hints ps_hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ); #ifdef DEBUG_HINTER Index: xc/extras/freetype2/src/pshinter/pshalgo2.c diff -u xc/extras/freetype2/src/pshinter/pshalgo2.c:1.1.1.4 xc/extras/freetype2/src/pshinter/pshalgo2.c:1.1.1.5 --- xc/extras/freetype2/src/pshinter/pshalgo2.c:1.1.1.4 Thu Jun 20 04:16:19 2002 +++ xc/extras/freetype2/src/pshinter/pshalgo2.c Wed May 28 22:01:54 2003 @@ -25,9 +25,9 @@ #define FT_COMPONENT trace_pshalgo2 #ifdef DEBUG_HINTER - extern PSH2_Hint_Table ps2_debug_hint_table = 0; - extern PSH2_HintFunc ps2_debug_hint_func = 0; - extern PSH2_Glyph ps2_debug_glyph = 0; + PSH2_Hint_Table ps2_debug_hint_table = 0; + PSH2_HintFunc ps2_debug_hint_func = 0; + PSH2_Glyph ps2_debug_glyph = 0; #endif @@ -861,7 +861,7 @@ /* clear all fields */ - ft_memset( glyph, 0, sizeof ( *glyph ) ); + FT_MEM_ZERO( glyph, sizeof ( *glyph ) ); memory = globals->memory; @@ -927,7 +927,7 @@ FT_Pos dxi, dyi, dxo, dyo; - if ( !( outline->tags[n] & FT_Curve_Tag_On ) ) + if ( !( outline->tags[n] & FT_CURVE_TAG_ON ) ) point->flags = PSH2_POINT_OFF; dxi = vec[n].x - vec[n_prev].x; @@ -1128,8 +1128,9 @@ /* process secondary hints to "selected" points */ - if ( num_masks > 1 ) + if ( num_masks > 1 && glyph->num_points > 0 ) { + first = mask->end_point; mask++; for ( ; num_masks > 1; num_masks--, mask++ ) { @@ -1491,9 +1492,10 @@ /*************************************************************************/ FT_Error - ps2_hints_apply( PS_Hints ps_hints, - FT_Outline* outline, - PSH_Globals globals ) + ps2_hints_apply( PS_Hints ps_hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ) { PSH2_GlyphRec glyphrec; PSH2_Glyph glyph = &glyphrec; @@ -1503,6 +1505,7 @@ #endif FT_Int dimension; + FT_UNUSED( hint_mode ); #ifdef DEBUG_HINTER memory = globals->memory; Index: xc/extras/freetype2/src/pshinter/pshalgo2.h diff -u xc/extras/freetype2/src/pshinter/pshalgo2.h:1.1.1.1 xc/extras/freetype2/src/pshinter/pshalgo2.h:1.1.1.2 --- xc/extras/freetype2/src/pshinter/pshalgo2.h:1.1.1.1 Mon Jan 14 11:52:14 2002 +++ xc/extras/freetype2/src/pshinter/pshalgo2.h Wed May 28 22:01:54 2003 @@ -188,9 +188,10 @@ extern FT_Error - ps2_hints_apply( PS_Hints ps_hints, - FT_Outline* outline, - PSH_Globals globals ); + ps2_hints_apply( PS_Hints ps_hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ); FT_END_HEADER Index: xc/extras/freetype2/src/pshinter/pshalgo3.c diff -u /dev/null xc/extras/freetype2/src/pshinter/pshalgo3.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:19 2004 +++ xc/extras/freetype2/src/pshinter/pshalgo3.c Wed May 28 22:01:54 2003 @@ -0,0 +1,1958 @@ +/***************************************************************************/ +/* */ +/* pshalgo3.c */ +/* */ +/* PostScript hinting algorithm 3 (body). */ +/* */ +/* Copyright 2001, 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used */ +/* modified and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H +#include "pshalgo3.h" + + +#undef FT_COMPONENT +#define FT_COMPONENT trace_pshalgo2 + + +#ifdef DEBUG_HINTER + PSH3_Hint_Table ps3_debug_hint_table = 0; + PSH3_HintFunc ps3_debug_hint_func = 0; + PSH3_Glyph ps3_debug_glyph = 0; +#endif + + +#define COMPUTE_INFLEXS /* compute inflection points to optimize "S" and others */ +#define STRONGER /* slightly increase the contrast of smooth hinting */ + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** BASIC HINTS RECORDINGS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* return true iff two stem hints overlap */ + static FT_Int + psh3_hint_overlap( PSH3_Hint hint1, + PSH3_Hint hint2 ) + { + return ( hint1->org_pos + hint1->org_len >= hint2->org_pos && + hint2->org_pos + hint2->org_len >= hint1->org_pos ); + } + + + /* destroy hints table */ + static void + psh3_hint_table_done( PSH3_Hint_Table table, + FT_Memory memory ) + { + FT_FREE( table->zones ); + table->num_zones = 0; + table->zone = 0; + + FT_FREE( table->sort ); + FT_FREE( table->hints ); + table->num_hints = 0; + table->max_hints = 0; + table->sort_global = 0; + } + + + /* deactivate all hints in a table */ + static void + psh3_hint_table_deactivate( PSH3_Hint_Table table ) + { + FT_UInt count = table->max_hints; + PSH3_Hint hint = table->hints; + + + for ( ; count > 0; count--, hint++ ) + { + psh3_hint_deactivate( hint ); + hint->order = -1; + } + } + + + /* internal function used to record a new hint */ + static void + psh3_hint_table_record( PSH3_Hint_Table table, + FT_UInt idx ) + { + PSH3_Hint hint = table->hints + idx; + + + if ( idx >= table->max_hints ) + { + FT_ERROR(( "psh3_hint_table_record: invalid hint index %d\n", idx )); + return; + } + + /* ignore active hints */ + if ( psh3_hint_is_active( hint ) ) + return; + + psh3_hint_activate( hint ); + + /* now scan the current active hint set in order to determine */ + /* if we are overlapping with another segment */ + { + PSH3_Hint* sorted = table->sort_global; + FT_UInt count = table->num_hints; + PSH3_Hint hint2; + + + hint->parent = 0; + for ( ; count > 0; count--, sorted++ ) + { + hint2 = sorted[0]; + + if ( psh3_hint_overlap( hint, hint2 ) ) + { + hint->parent = hint2; + break; + } + } + } + + if ( table->num_hints < table->max_hints ) + table->sort_global[table->num_hints++] = hint; + else + FT_ERROR(( "psh3_hint_table_record: too many sorted hints! BUG!\n" )); + } + + + static void + psh3_hint_table_record_mask( PSH3_Hint_Table table, + PS_Mask hint_mask ) + { + FT_Int mask = 0, val = 0; + FT_Byte* cursor = hint_mask->bytes; + FT_UInt idx, limit; + + + limit = hint_mask->num_bits; + + for ( idx = 0; idx < limit; idx++ ) + { + if ( mask == 0 ) + { + val = *cursor++; + mask = 0x80; + } + + if ( val & mask ) + psh3_hint_table_record( table, idx ); + + mask >>= 1; + } + } + + + /* create hints table */ + static FT_Error + psh3_hint_table_init( PSH3_Hint_Table table, + PS_Hint_Table hints, + PS_Mask_Table hint_masks, + PS_Mask_Table counter_masks, + FT_Memory memory ) + { + FT_UInt count = hints->num_hints; + FT_Error error; + + FT_UNUSED( counter_masks ); + + + /* allocate our tables */ + if ( FT_NEW_ARRAY( table->sort, 2 * count ) || + FT_NEW_ARRAY( table->hints, count ) || + FT_NEW_ARRAY( table->zones, 2 * count + 1 ) ) + goto Exit; + + table->max_hints = count; + table->sort_global = table->sort + count; + table->num_hints = 0; + table->num_zones = 0; + table->zone = 0; + + /* now, initialize the "hints" array */ + { + PSH3_Hint write = table->hints; + PS_Hint read = hints->hints; + + + for ( ; count > 0; count--, write++, read++ ) + { + write->org_pos = read->pos; + write->org_len = read->len; + write->flags = read->flags; + } + } + + /* we now need to determine the initial "parent" stems; first */ + /* activate the hints that are given by the initial hint masks */ + if ( hint_masks ) + { + FT_UInt Count = hint_masks->num_masks; + PS_Mask Mask = hint_masks->masks; + + + table->hint_masks = hint_masks; + + for ( ; Count > 0; Count--, Mask++ ) + psh3_hint_table_record_mask( table, Mask ); + } + + /* now, do a linear parse in case some hints were left alone */ + if ( table->num_hints != table->max_hints ) + { + FT_UInt Index, Count; + + + FT_ERROR(( "psh3_hint_table_init: missing/incorrect hint masks!\n" )); + Count = table->max_hints; + for ( Index = 0; Index < Count; Index++ ) + psh3_hint_table_record( table, Index ); + } + + Exit: + return error; + } + + + static void + psh3_hint_table_activate_mask( PSH3_Hint_Table table, + PS_Mask hint_mask ) + { + FT_Int mask = 0, val = 0; + FT_Byte* cursor = hint_mask->bytes; + FT_UInt idx, limit, count; + + + limit = hint_mask->num_bits; + count = 0; + + psh3_hint_table_deactivate( table ); + + for ( idx = 0; idx < limit; idx++ ) + { + if ( mask == 0 ) + { + val = *cursor++; + mask = 0x80; + } + + if ( val & mask ) + { + PSH3_Hint hint = &table->hints[idx]; + + + if ( !psh3_hint_is_active( hint ) ) + { + FT_UInt count2; + +#if 0 + PSH3_Hint* sort = table->sort; + PSH3_Hint hint2; + + + for ( count2 = count; count2 > 0; count2--, sort++ ) + { + hint2 = sort[0]; + if ( psh3_hint_overlap( hint, hint2 ) ) + FT_ERROR(( "psh3_hint_table_activate_mask:" + " found overlapping hints\n" )) + } +#else + count2 = 0; +#endif + + if ( count2 == 0 ) + { + psh3_hint_activate( hint ); + if ( count < table->max_hints ) + table->sort[count++] = hint; + else + FT_ERROR(( "psh3_hint_tableactivate_mask:" + " too many active hints\n" )); + } + } + } + + mask >>= 1; + } + table->num_hints = count; + + /* now, sort the hints; they are guaranteed to not overlap */ + /* so we can compare their "org_pos" field directly */ + { + FT_Int i1, i2; + PSH3_Hint hint1, hint2; + PSH3_Hint* sort = table->sort; + + + /* a simple bubble sort will do, since in 99% of cases, the hints */ + /* will be already sorted -- and the sort will be linear */ + for ( i1 = 1; i1 < (FT_Int)count; i1++ ) + { + hint1 = sort[i1]; + for ( i2 = i1 - 1; i2 >= 0; i2-- ) + { + hint2 = sort[i2]; + + if ( hint2->org_pos < hint1->org_pos ) + break; + + sort[i2 + 1] = hint2; + sort[i2] = hint1; + } + } + } + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** HINTS GRID-FITTING AND OPTIMIZATION *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#if 1 + static FT_Pos + psh3_dimension_quantize_len( PSH_Dimension dim, + FT_Pos len, + FT_Bool do_snapping ) + { + if ( len <= 64 ) + len = 64; + else + { + FT_Pos delta = len - dim->stdw.widths[0].cur; + + + if ( delta < 0 ) + delta = -delta; + + if ( delta < 40 ) + { + len = dim->stdw.widths[0].cur; + if ( len < 48 ) + len = 48; + } + + if ( len < 3 * 64 ) + { + delta = ( len & 63 ); + len &= -64; + + if ( delta < 10 ) + len += delta; + + else if ( delta < 32 ) + len += 10; + + else if ( delta < 54 ) + len += 54; + + else + len += delta; + } + else + len = ( len + 32 ) & -64; + } + + if ( do_snapping ) + len = ( len + 32 ) & -64; + + return len; + } +#endif /* 0 */ + + +#ifdef DEBUG_HINTER + + static void + ps3_simple_scale( PSH3_Hint_Table table, + FT_Fixed scale, + FT_Fixed delta, + FT_Int dimension ) + { + PSH3_Hint hint; + FT_UInt count; + + + for ( count = 0; count < table->max_hints; count++ ) + { + hint = table->hints + count; + + hint->cur_pos = FT_MulFix( hint->org_pos, scale ) + delta; + hint->cur_len = FT_MulFix( hint->org_len, scale ); + + if ( ps3_debug_hint_func ) + ps3_debug_hint_func( hint, dimension ); + } + } + +#endif /* DEBUG_HINTER */ + + + static FT_Fixed + psh3_hint_snap_stem_side_delta( FT_Fixed pos, + FT_Fixed len ) + { + FT_Fixed delta1 = ( ( pos + 32 ) & -64 ) - pos; + FT_Fixed delta2 = ( ( pos + len + 32 ) & -64 ) - pos - len; + + + if ( ABS( delta1 ) <= ABS( delta2 ) ) + return delta1; + else + return delta2; + } + + + static void + psh3_hint_align( PSH3_Hint hint, + PSH_Globals globals, + FT_Int dimension, + PSH3_Glyph glyph ) + { + PSH_Dimension dim = &globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Fixed delta = dim->scale_delta; + + + if ( !psh3_hint_is_fitted( hint ) ) + { + FT_Pos pos = FT_MulFix( hint->org_pos, scale ) + delta; + FT_Pos len = FT_MulFix( hint->org_len, scale ); + + FT_Int do_snapping; + FT_Pos fit_len; + PSH_AlignmentRec align; + + + /* ignore stem alignments when requested through the hint flags */ + if ( ( dimension == 0 && !glyph->do_horz_hints ) || + ( dimension == 1 && !glyph->do_vert_hints ) ) + { + hint->cur_pos = pos; + hint->cur_len = len; + + psh3_hint_set_fitted( hint ); + return; + } + + /* perform stem snapping when requested - this is necessary + * for monochrome and LCD hinting modes only + */ + do_snapping = ( dimension == 0 && glyph->do_horz_snapping ) || + ( dimension == 1 && glyph->do_vert_snapping ); + + hint->cur_len = fit_len = len; + + /* check blue zones for horizontal stems */ + align.align = PSH_BLUE_ALIGN_NONE; + align.align_bot = align.align_top = 0; + + if ( dimension == 1 ) + psh_blues_snap_stem( &globals->blues, + hint->org_pos + hint->org_len, + hint->org_pos, + &align ); + + switch ( align.align ) + { + case PSH_BLUE_ALIGN_TOP: + /* the top of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_top - fit_len; + break; + + case PSH_BLUE_ALIGN_BOT: + /* the bottom of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_bot; + break; + + case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT: + /* both edges of the stem are aligned against blue zones */ + hint->cur_pos = align.align_bot; + hint->cur_len = align.align_top - align.align_bot; + break; + + default: + { + PSH3_Hint parent = hint->parent; + + + if ( parent ) + { + FT_Pos par_org_center, par_cur_center; + FT_Pos cur_org_center, cur_delta; + + + /* ensure that parent is already fitted */ + if ( !psh3_hint_is_fitted( parent ) ) + psh3_hint_align( parent, globals, dimension, glyph ); + + par_org_center = parent->org_pos + ( parent->org_len >> 1 ); + par_cur_center = parent->cur_pos + ( parent->cur_len >> 1 ); + cur_org_center = hint->org_pos + ( hint->org_len >> 1 ); + + cur_delta = FT_MulFix( cur_org_center - par_org_center, scale ); + pos = par_cur_center + cur_delta - ( len >> 1 ); + } + + hint->cur_pos = pos; + hint->cur_len = fit_len; + + /* stem adjustment tries to snap stem widths to standard + * ones. this is important to prevent unpleasant rounding + * artefacts... + */ + if ( glyph->do_stem_adjust ) + { + if ( len <= 64 ) + { + /* the stem is less than one pixel, we will center it + * around the nearest pixel center + */ +#if 1 + pos = ( pos + (len >> 1) ) & -64; +#else + /* this seems to be a bug !! */ + pos = ( pos + ( (len >> 1) & -64 ) ); +#endif + len = 64; + } + else + { + len = psh3_dimension_quantize_len( dim, len, 0 ); + } + } + + /* now that we have a good hinted stem width, try to position */ + /* the stem along a pixel grid integer coordinate */ + hint->cur_pos = pos + psh3_hint_snap_stem_side_delta( pos, len ); + hint->cur_len = len; + } + } + + if ( do_snapping ) + { + pos = hint->cur_pos; + len = hint->cur_len; + + if ( len < 64 ) + len = 64; + else + len = ( len + 32 ) & -64; + + switch ( align.align ) + { + case PSH_BLUE_ALIGN_TOP: + hint->cur_pos = align.align_top - len; + hint->cur_len = len; + break; + + case PSH_BLUE_ALIGN_BOT: + hint->cur_len = len; + break; + + case PSH_BLUE_ALIGN_BOT | PSH_BLUE_ALIGN_TOP: + /* don't touch */ + break; + + + default: + hint->cur_len = len; + if ( len & 64 ) + pos = ( ( pos + ( len >> 1 ) ) & -64 ) + 32; + else + pos = ( pos + ( len >> 1 ) + 32 ) & -64; + + hint->cur_pos = pos - ( len >> 1 ); + hint->cur_len = len; + } + } + + psh3_hint_set_fitted( hint ); + +#ifdef DEBUG_HINTER + if ( ps3_debug_hint_func ) + ps3_debug_hint_func( hint, dimension ); +#endif + } + } + + +#if 0 /* not used for now, experimental */ + + /* + * A variant to perform "light" hinting (i.e. FT_RENDER_MODE_LIGHT) + * of stems + */ + static void + psh3_hint_align_light( PSH3_Hint hint, + PSH_Globals globals, + FT_Int dimension, + PSH3_Glyph glyph ) + { + PSH_Dimension dim = &globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Fixed delta = dim->scale_delta; + + + if ( !psh3_hint_is_fitted(hint) ) + { + FT_Pos pos = FT_MulFix( hint->org_pos, scale ) + delta; + FT_Pos len = FT_MulFix( hint->org_len, scale ); + + FT_Pos fit_len; + + PSH_AlignmentRec align; + + /* ignore stem alignments when requested through the hint flags */ + if ( ( dimension == 0 && !glyph->do_horz_hints ) || + ( dimension == 1 && !glyph->do_vert_hints ) ) + { + hint->cur_pos = pos; + hint->cur_len = len; + + psh3_hint_set_fitted( hint ); + return; + } + + fit_len = len; + + hint->cur_len = fit_len; + + /* check blue zones for horizontal stems */ + align.align = PSH_BLUE_ALIGN_NONE; + align.align_bot = align.align_top = 0; + + if ( dimension == 1 ) + psh_blues_snap_stem( &globals->blues, + hint->org_pos + hint->org_len, + hint->org_pos, + &align ); + + switch ( align.align ) + { + case PSH_BLUE_ALIGN_TOP: + /* the top of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_top - fit_len; + break; + + case PSH_BLUE_ALIGN_BOT: + /* the bottom of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_bot; + break; + + case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT: + /* both edges of the stem are aligned against blue zones */ + hint->cur_pos = align.align_bot; + hint->cur_len = align.align_top - align.align_bot; + break; + + default: + { + PSH3_Hint parent = hint->parent; + + + if ( parent ) + { + FT_Pos par_org_center, par_cur_center; + FT_Pos cur_org_center, cur_delta; + + + /* ensure that parent is already fitted */ + if ( !psh3_hint_is_fitted( parent ) ) + psh3_hint_align_light( parent, globals, dimension, glyph ); + + par_org_center = parent->org_pos + ( parent->org_len / 2); + par_cur_center = parent->cur_pos + ( parent->cur_len / 2); + cur_org_center = hint->org_pos + ( hint->org_len / 2); + + cur_delta = FT_MulFix( cur_org_center - par_org_center, scale ); + pos = par_cur_center + cur_delta - ( len >> 1 ); + } + + /* Stems less than one pixel wide are easy - we want to + * make them as dark as possible, so they must fall within + * one pixel. If the stem is split between two pixels + * then snap the edge that is nearer to the pixel boundary + * to the pixel boundary + */ + if (len <= 64) + { + if ( ( pos + len + 63 ) / 64 != pos / 64 + 1 ) + pos += psh3_hint_snap_stem_side_delta ( pos, len ); + } + /* Position stems other to minimize the amount of mid-grays. + * There are, in general, two positions that do this, + * illustrated as A) and B) below. + * + * + + + + + * + * A) |--------------------------------| + * B) |--------------------------------| + * C) |--------------------------------| + * + * Position A) (split the excess stem equally) should be better + * for stems of width N + f where f < 0.5 + * + * Position B) (split the deficiency equally) should be better + * for stems of width N + f where f > 0.5 + * + * It turns out though that minimizing the total number of lit + * pixels is also important, so position C), with one edge + * aligned with a pixel boundary is actually preferable + * to A). There are also more possibile positions for C) than + * for A) or B), so it involves less distortion of the overall + * character shape. + */ + else /* len > 64 */ + { + FT_Fixed frac_len = len & 63; + FT_Fixed center = pos + ( len >> 1 ); + FT_Fixed delta_a, delta_b; + + if ( ( len / 64 ) & 1 ) + { + delta_a = ( center & -64 ) + 32 - center; + delta_b = ( ( center + 32 ) & - 64 ) - center; + } + else + { + delta_a = ( ( center + 32 ) & - 64 ) - center; + delta_b = ( center & -64 ) + 32 - center; + } + + /* We choose between B) and C) above based on the amount + * of fractinal stem width; for small amounts, choose + * C) always, for large amounts, B) always, and inbetween, + * pick whichever one involves less stem movement. + */ + if (frac_len < 32) + { + pos += psh3_hint_snap_stem_side_delta ( pos, len ); + } + else if (frac_len < 48) + { + FT_Fixed side_delta = psh3_hint_snap_stem_side_delta ( pos, len ); + + if ( ABS( side_delta ) < ABS( delta_b ) ) + pos += side_delta; + else + pos += delta_b; + } + else + { + pos += delta_b; + } + } + + hint->cur_pos = pos; + } + } /* switch */ + + psh3_hint_set_fitted( hint ); + +#ifdef DEBUG_HINTER + if ( ps3_debug_hint_func ) + ps3_debug_hint_func( hint, dimension ); +#endif + } + } + +#endif /* 0 */ + + + static void + psh3_hint_table_align_hints( PSH3_Hint_Table table, + PSH_Globals globals, + FT_Int dimension, + PSH3_Glyph glyph ) + { + PSH3_Hint hint; + FT_UInt count; + +#ifdef DEBUG_HINTER + + PSH_Dimension dim = &globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Fixed delta = dim->scale_delta; + + + if ( ps_debug_no_vert_hints && dimension == 0 ) + { + ps3_simple_scale( table, scale, delta, dimension ); + return; + } + + if ( ps_debug_no_horz_hints && dimension == 1 ) + { + ps3_simple_scale( table, scale, delta, dimension ); + return; + } + +#endif /* DEBUG_HINTER*/ + + hint = table->hints; + count = table->max_hints; + + for ( ; count > 0; count--, hint++ ) + psh3_hint_align( hint, globals, dimension, glyph ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** POINTS INTERPOLATION ROUTINES *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#define PSH3_ZONE_MIN -3200000L +#define PSH3_ZONE_MAX +3200000L + +#define xxDEBUG_ZONES + + +#ifdef DEBUG_ZONES + +#include <stdio.h> + + static void + psh3_print_zone( PSH3_Zone zone ) + { + printf( "zone [scale,delta,min,max] = [%.3f,%.3f,%d,%d]\n", + zone->scale / 65536.0, + zone->delta / 64.0, + zone->min, + zone->max ); + } + +#else + +#define psh3_print_zone( x ) do { } while ( 0 ) + +#endif /* DEBUG_ZONES */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** HINTER GLYPH MANAGEMENT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#ifdef COMPUTE_INFLEXS + + /* compute all inflex points in a given glyph */ + static void + psh3_glyph_compute_inflections( PSH3_Glyph glyph ) + { + FT_UInt n; + + + for ( n = 0; n < glyph->num_contours; n++ ) + { + PSH3_Point first, start, end, before, after; + FT_Angle angle_in, angle_seg, angle_out; + FT_Angle diff_in, diff_out; + FT_Int finished = 0; + + + /* we need at least 4 points to create an inflection point */ + if ( glyph->contours[n].count < 4 ) + continue; + + /* compute first segment in contour */ + first = glyph->contours[n].start; + + start = end = first; + do + { + end = end->next; + if ( end == first ) + goto Skip; + + } while ( PSH3_POINT_EQUAL_ORG( end, first ) ); + + angle_seg = PSH3_POINT_ANGLE( start, end ); + + /* extend the segment start whenever possible */ + before = start; + do + { + do + { + start = before; + before = before->prev; + if ( before == first ) + goto Skip; + + } while ( PSH3_POINT_EQUAL_ORG( before, start ) ); + + angle_in = PSH3_POINT_ANGLE( before, start ); + + } while ( angle_in == angle_seg ); + + first = start; + diff_in = FT_Angle_Diff( angle_in, angle_seg ); + + /* now, process all segments in the contour */ + do + { + /* first, extend current segment's end whenever possible */ + after = end; + do + { + do + { + end = after; + after = after->next; + if ( after == first ) + finished = 1; + + } while ( PSH3_POINT_EQUAL_ORG( end, after ) ); + + angle_out = PSH3_POINT_ANGLE( end, after ); + + } while ( angle_out == angle_seg ); + + diff_out = FT_Angle_Diff( angle_seg, angle_out ); + + if ( ( diff_in ^ diff_out ) < 0 ) + { + /* diff_in and diff_out have different signs, we have */ + /* inflection points here... */ + + do + { + psh3_point_set_inflex( start ); + start = start->next; + } + while ( start != end ); + + psh3_point_set_inflex( start ); + } + + start = end; + end = after; + angle_seg = angle_out; + diff_in = diff_out; + + } while ( !finished ); + + Skip: + ; + } + } + +#endif /* COMPUTE_INFLEXS */ + + + static void + psh3_glyph_done( PSH3_Glyph glyph ) + { + FT_Memory memory = glyph->memory; + + + psh3_hint_table_done( &glyph->hint_tables[1], memory ); + psh3_hint_table_done( &glyph->hint_tables[0], memory ); + + FT_FREE( glyph->points ); + FT_FREE( glyph->contours ); + + glyph->num_points = 0; + glyph->num_contours = 0; + + glyph->memory = 0; + } + + + static int + psh3_compute_dir( FT_Pos dx, + FT_Pos dy ) + { + FT_Pos ax, ay; + int result = PSH3_DIR_NONE; + + + ax = ( dx >= 0 ) ? dx : -dx; + ay = ( dy >= 0 ) ? dy : -dy; + + if ( ay * 12 < ax ) + { + /* |dy| <<< |dx| means a near-horizontal segment */ + result = ( dx >= 0 ) ? PSH3_DIR_RIGHT : PSH3_DIR_LEFT; + } + else if ( ax * 12 < ay ) + { + /* |dx| <<< |dy| means a near-vertical segment */ + result = ( dy >= 0 ) ? PSH3_DIR_UP : PSH3_DIR_DOWN; + } + + return result; + } + + + /* load outline point coordinates into hinter glyph */ + static void + psh3_glyph_load_points( PSH3_Glyph glyph, + FT_Int dimension ) + { + FT_Vector* vec = glyph->outline->points; + PSH3_Point point = glyph->points; + FT_UInt count = glyph->num_points; + + + for ( ; count > 0; count--, point++, vec++ ) + { + point->flags2 = 0; + point->hint = NULL; + if ( dimension == 0 ) + { + point->org_u = vec->x; + point->org_v = vec->y; + } + else + { + point->org_u = vec->y; + point->org_v = vec->x; + } + +#ifdef DEBUG_HINTER + point->org_x = vec->x; + point->org_y = vec->y; +#endif + + } + } + + + /* save hinted point coordinates back to outline */ + static void + psh3_glyph_save_points( PSH3_Glyph glyph, + FT_Int dimension ) + { + FT_UInt n; + PSH3_Point point = glyph->points; + FT_Vector* vec = glyph->outline->points; + char* tags = glyph->outline->tags; + + + for ( n = 0; n < glyph->num_points; n++ ) + { + if ( dimension == 0 ) + vec[n].x = point->cur_u; + else + vec[n].y = point->cur_u; + + if ( psh3_point_is_strong( point ) ) + tags[n] |= (char)( ( dimension == 0 ) ? 32 : 64 ); + +#ifdef DEBUG_HINTER + + if ( dimension == 0 ) + { + point->cur_x = point->cur_u; + point->flags_x = point->flags2 | point->flags; + } + else + { + point->cur_y = point->cur_u; + point->flags_y = point->flags2 | point->flags; + } + +#endif + + point++; + } + } + + + static FT_Error + psh3_glyph_init( PSH3_Glyph glyph, + FT_Outline* outline, + PS_Hints ps_hints, + PSH_Globals globals ) + { + FT_Error error; + FT_Memory memory; + + + /* clear all fields */ + FT_MEM_ZERO( glyph, sizeof ( *glyph ) ); + + memory = globals->memory; + + /* allocate and setup points + contours arrays */ + if ( FT_NEW_ARRAY( glyph->points, outline->n_points ) || + FT_NEW_ARRAY( glyph->contours, outline->n_contours ) ) + goto Exit; + + glyph->num_points = outline->n_points; + glyph->num_contours = outline->n_contours; + + { + FT_UInt first = 0, next, n; + PSH3_Point points = glyph->points; + PSH3_Contour contour = glyph->contours; + + + for ( n = 0; n < glyph->num_contours; n++ ) + { + FT_Int count; + PSH3_Point point; + + + next = outline->contours[n] + 1; + count = next - first; + + contour->start = points + first; + contour->count = (FT_UInt)count; + + if ( count > 0 ) + { + point = points + first; + + point->prev = points + next - 1; + point->contour = contour; + + for ( ; count > 1; count-- ) + { + point[0].next = point + 1; + point[1].prev = point; + point++; + point->contour = contour; + } + point->next = points + first; + } + + contour++; + first = next; + } + } + + { + PSH3_Point points = glyph->points; + PSH3_Point point = points; + FT_Vector* vec = outline->points; + FT_UInt n; + + + for ( n = 0; n < glyph->num_points; n++, point++ ) + { + FT_Int n_prev = point->prev - points; + FT_Int n_next = point->next - points; + FT_Pos dxi, dyi, dxo, dyo; + + + if ( !( outline->tags[n] & FT_CURVE_TAG_ON ) ) + point->flags = PSH3_POINT_OFF; + + dxi = vec[n].x - vec[n_prev].x; + dyi = vec[n].y - vec[n_prev].y; + + point->dir_in = (FT_Char)psh3_compute_dir( dxi, dyi ); + + dxo = vec[n_next].x - vec[n].x; + dyo = vec[n_next].y - vec[n].y; + + point->dir_out = (FT_Char)psh3_compute_dir( dxo, dyo ); + + /* detect smooth points */ + if ( point->flags & PSH3_POINT_OFF ) + point->flags |= PSH3_POINT_SMOOTH; + else if ( point->dir_in != PSH3_DIR_NONE || + point->dir_out != PSH3_DIR_NONE ) + { + if ( point->dir_in == point->dir_out ) + point->flags |= PSH3_POINT_SMOOTH; + } + else + { + FT_Angle angle_in, angle_out, diff; + + + angle_in = FT_Atan2( dxi, dyi ); + angle_out = FT_Atan2( dxo, dyo ); + + diff = angle_in - angle_out; + if ( diff < 0 ) + diff = -diff; + + if ( diff > FT_ANGLE_PI ) + diff = FT_ANGLE_2PI - diff; + + if ( diff < FT_ANGLE_PI / 16 ) + point->flags |= PSH3_POINT_SMOOTH; + } + } + } + + glyph->memory = memory; + glyph->outline = outline; + glyph->globals = globals; + +#ifdef COMPUTE_INFLEXS + psh3_glyph_load_points( glyph, 0 ); + psh3_glyph_compute_inflections( glyph ); +#endif /* COMPUTE_INFLEXS */ + + /* now deal with hints tables */ + error = psh3_hint_table_init( &glyph->hint_tables [0], + &ps_hints->dimension[0].hints, + &ps_hints->dimension[0].masks, + &ps_hints->dimension[0].counters, + memory ); + if ( error ) + goto Exit; + + error = psh3_hint_table_init( &glyph->hint_tables [1], + &ps_hints->dimension[1].hints, + &ps_hints->dimension[1].masks, + &ps_hints->dimension[1].counters, + memory ); + if ( error ) + goto Exit; + + Exit: + return error; + } + + + /* compute all extrema in a glyph for a given dimension */ + static void + psh3_glyph_compute_extrema( PSH3_Glyph glyph ) + { + FT_UInt n; + + + /* first of all, compute all local extrema */ + for ( n = 0; n < glyph->num_contours; n++ ) + { + PSH3_Point first = glyph->contours[n].start; + PSH3_Point point, before, after; + + + point = first; + before = point; + after = point; + + do + { + before = before->prev; + if ( before == first ) + goto Skip; + + } while ( before->org_u == point->org_u ); + + first = point = before->next; + + for (;;) + { + after = point; + do + { + after = after->next; + if ( after == first ) + goto Next; + + } while ( after->org_u == point->org_u ); + + if ( before->org_u < point->org_u ) + { + if ( after->org_u < point->org_u ) + { + /* local maximum */ + goto Extremum; + } + } + else /* before->org_u > point->org_u */ + { + if ( after->org_u > point->org_u ) + { + /* local minimum */ + Extremum: + do + { + psh3_point_set_extremum( point ); + point = point->next; + + } while ( point != after ); + } + } + + before = after->prev; + point = after; + + } /* for */ + + Next: + ; + } + + /* for each extrema, determine its direction along the */ + /* orthogonal axis */ + for ( n = 0; n < glyph->num_points; n++ ) + { + PSH3_Point point, before, after; + + + point = &glyph->points[n]; + before = point; + after = point; + + if ( psh3_point_is_extremum( point ) ) + { + do + { + before = before->prev; + if ( before == point ) + goto Skip; + + } while ( before->org_v == point->org_v ); + + do + { + after = after->next; + if ( after == point ) + goto Skip; + + } while ( after->org_v == point->org_v ); + } + + if ( before->org_v < point->org_v && + after->org_v > point->org_v ) + { + psh3_point_set_positive( point ); + } + else if ( before->org_v > point->org_v && + after->org_v < point->org_v ) + { + psh3_point_set_negative( point ); + } + + Skip: + ; + } + } + + +#define PSH3_STRONG_THRESHOLD 30 + + + /* major_dir is the direction for points on the bottom/left of the stem; */ + /* Points on the top/right of the stem will have a direction of */ + /* -major_dir. */ + + static void + psh3_hint_table_find_strong_point( PSH3_Hint_Table table, + PSH3_Point point, + FT_Int major_dir ) + { + PSH3_Hint* sort = table->sort; + FT_UInt num_hints = table->num_hints; + FT_Int point_dir = 0; + + + if ( PSH3_DIR_COMPARE( point->dir_in, major_dir ) ) + point_dir = point->dir_in; + + else if ( PSH3_DIR_COMPARE( point->dir_out, major_dir ) ) + point_dir = point->dir_out; + + if ( point_dir ) + { + FT_UInt flag; + + + for ( ; num_hints > 0; num_hints--, sort++ ) + { + PSH3_Hint hint = sort[0]; + FT_Pos d; + + + if ( point_dir == major_dir ) + { + flag = PSH3_POINT_EDGE_MIN; + d = point->org_u - hint->org_pos; + + if ( ABS( d ) < PSH3_STRONG_THRESHOLD ) + { + Is_Strong: + psh3_point_set_strong( point ); + point->flags2 |= flag; + point->hint = hint; + break; + } + } + else if ( point_dir == -major_dir ) + { + flag = PSH3_POINT_EDGE_MAX; + d = point->org_u - hint->org_pos - hint->org_len; + + if ( ABS( d ) < PSH3_STRONG_THRESHOLD ) + goto Is_Strong; + } + } + } + +#if 1 + else if ( psh3_point_is_extremum( point ) ) + { + /* treat extrema as special cases for stem edge alignment */ + FT_UInt min_flag, max_flag; + + + if ( major_dir == PSH3_DIR_HORIZONTAL ) + { + min_flag = PSH3_POINT_POSITIVE; + max_flag = PSH3_POINT_NEGATIVE; + } + else + { + min_flag = PSH3_POINT_NEGATIVE; + max_flag = PSH3_POINT_POSITIVE; + } + + for ( ; num_hints > 0; num_hints--, sort++ ) + { + PSH3_Hint hint = sort[0]; + FT_Pos d, flag; + + + if ( point->flags2 & min_flag ) + { + flag = PSH3_POINT_EDGE_MIN; + d = point->org_u - hint->org_pos; + + if ( ABS( d ) < PSH3_STRONG_THRESHOLD ) + { + Is_Strong2: + point->flags2 |= flag; + point->hint = hint; + psh3_point_set_strong( point ); + break; + } + } + else if ( point->flags2 & max_flag ) + { + flag = PSH3_POINT_EDGE_MAX; + d = point->org_u - hint->org_pos - hint->org_len; + + if ( ABS( d ) < PSH3_STRONG_THRESHOLD ) + goto Is_Strong2; + } + + if ( point->org_u >= hint->org_pos && + point->org_u <= hint->org_pos + hint->org_len ) + { + point->hint = hint; + } + } + } + +#endif /* 1 */ + } + + + /* find strong points in a glyph */ + static void + psh3_glyph_find_strong_points( PSH3_Glyph glyph, + FT_Int dimension ) + { + /* a point is strong if it is located on a stem */ + /* edge and has an "in" or "out" tangent to the hint's direction */ + { + PSH3_Hint_Table table = &glyph->hint_tables[dimension]; + PS_Mask mask = table->hint_masks->masks; + FT_UInt num_masks = table->hint_masks->num_masks; + FT_UInt first = 0; + FT_Int major_dir = dimension == 0 ? PSH3_DIR_VERTICAL + : PSH3_DIR_HORIZONTAL; + + + /* process secondary hints to "selected" points */ + if ( num_masks > 1 && glyph->num_points > 0 ) + { + first = mask->end_point; + mask++; + for ( ; num_masks > 1; num_masks--, mask++ ) + { + FT_UInt next; + FT_Int count; + + + next = mask->end_point; + count = next - first; + if ( count > 0 ) + { + PSH3_Point point = glyph->points + first; + + + psh3_hint_table_activate_mask( table, mask ); + + for ( ; count > 0; count--, point++ ) + psh3_hint_table_find_strong_point( table, point, major_dir ); + } + first = next; + } + } + + /* process primary hints for all points */ + if ( num_masks == 1 ) + { + FT_UInt count = glyph->num_points; + PSH3_Point point = glyph->points; + + + psh3_hint_table_activate_mask( table, table->hint_masks->masks ); + for ( ; count > 0; count--, point++ ) + { + if ( !psh3_point_is_strong( point ) ) + psh3_hint_table_find_strong_point( table, point, major_dir ); + } + } + + /* now, certain points may have been attached to hint and */ + /* not marked as strong; update their flags then */ + { + FT_UInt count = glyph->num_points; + PSH3_Point point = glyph->points; + + + for ( ; count > 0; count--, point++ ) + if ( point->hint && !psh3_point_is_strong( point ) ) + psh3_point_set_strong( point ); + } + } + } + + + /* interpolate strong points with the help of hinted coordinates */ + static void + psh3_glyph_interpolate_strong_points( PSH3_Glyph glyph, + FT_Int dimension ) + { + PSH_Dimension dim = &glyph->globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + + + { + FT_UInt count = glyph->num_points; + PSH3_Point point = glyph->points; + + + for ( ; count > 0; count--, point++ ) + { + PSH3_Hint hint = point->hint; + + + if ( hint ) + { + FT_Pos delta; + + + if ( psh3_point_is_edge_min( point ) ) + { + point->cur_u = hint->cur_pos; + } + else if ( psh3_point_is_edge_max( point ) ) + { + point->cur_u = hint->cur_pos + hint->cur_len; + } + else + { + delta = point->org_u - hint->org_pos; + + if ( delta <= 0 ) + point->cur_u = hint->cur_pos + FT_MulFix( delta, scale ); + + else if ( delta >= hint->org_len ) + point->cur_u = hint->cur_pos + hint->cur_len + + FT_MulFix( delta - hint->org_len, scale ); + + else if ( hint->org_len > 0 ) + point->cur_u = hint->cur_pos + + FT_MulDiv( delta, hint->cur_len, + hint->org_len ); + else + point->cur_u = hint->cur_pos; + } + psh3_point_set_fitted( point ); + } + } + } + } + + + static void + psh3_glyph_interpolate_normal_points( PSH3_Glyph glyph, + FT_Int dimension ) + { + +#if 1 + + PSH_Dimension dim = &glyph->globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + + + /* first technique: a point is strong if it is a local extrema */ + { + FT_UInt count = glyph->num_points; + PSH3_Point point = glyph->points; + + + for ( ; count > 0; count--, point++ ) + { + if ( psh3_point_is_strong( point ) ) + continue; + + /* sometimes, some local extremas are smooth points */ + if ( psh3_point_is_smooth( point ) ) + { + if ( point->dir_in == PSH3_DIR_NONE || + point->dir_in != point->dir_out ) + continue; + + if ( !psh3_point_is_extremum( point ) && + !psh3_point_is_inflex( point ) ) + continue; + + point->flags &= ~PSH3_POINT_SMOOTH; + } + + /* find best enclosing point coordinates */ + { + PSH3_Point before = 0; + PSH3_Point after = 0; + + FT_Pos diff_before = -32000; + FT_Pos diff_after = 32000; + FT_Pos u = point->org_u; + + FT_Int count2 = glyph->num_points; + PSH3_Point cur = glyph->points; + + + for ( ; count2 > 0; count2--, cur++ ) + { + if ( psh3_point_is_strong( cur ) ) + { + FT_Pos diff = cur->org_u - u;; + + + if ( diff <= 0 ) + { + if ( diff > diff_before ) + { + diff_before = diff; + before = cur; + } + } + else if ( diff >= 0 ) + { + if ( diff < diff_after ) + { + diff_after = diff; + after = cur; + } + } + } + } + + if ( !before ) + { + if ( !after ) + continue; + + /* we are before the first strong point coordinate; */ + /* simply translate the point */ + point->cur_u = after->cur_u + + FT_MulFix( point->org_u - after->org_u, scale ); + } + else if ( !after ) + { + /* we are after the last strong point coordinate; */ + /* simply translate the point */ + point->cur_u = before->cur_u + + FT_MulFix( point->org_u - before->org_u, scale ); + } + else + { + if ( diff_before == 0 ) + point->cur_u = before->cur_u; + + else if ( diff_after == 0 ) + point->cur_u = after->cur_u; + + else + point->cur_u = before->cur_u + + FT_MulDiv( u - before->org_u, + after->cur_u - before->cur_u, + after->org_u - before->org_u ); + } + + psh3_point_set_fitted( point ); + } + } + } + +#endif /* 1 */ + + } + + + /* interpolate other points */ + static void + psh3_glyph_interpolate_other_points( PSH3_Glyph glyph, + FT_Int dimension ) + { + PSH_Dimension dim = &glyph->globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Fixed delta = dim->scale_delta; + PSH3_Contour contour = glyph->contours; + FT_UInt num_contours = glyph->num_contours; + + + for ( ; num_contours > 0; num_contours--, contour++ ) + { + PSH3_Point start = contour->start; + PSH3_Point first, next, point; + FT_UInt fit_count; + + + /* count the number of strong points in this contour */ + next = start + contour->count; + fit_count = 0; + first = 0; + + for ( point = start; point < next; point++ ) + if ( psh3_point_is_fitted( point ) ) + { + if ( !first ) + first = point; + + fit_count++; + } + + /* if there are less than 2 fitted points in the contour, we */ + /* simply scale and eventually translate the contour points */ + if ( fit_count < 2 ) + { + if ( fit_count == 1 ) + delta = first->cur_u - FT_MulFix( first->org_u, scale ); + + for ( point = start; point < next; point++ ) + if ( point != first ) + point->cur_u = FT_MulFix( point->org_u, scale ) + delta; + + goto Next_Contour; + } + + /* there are more than 2 strong points in this contour; we */ + /* need to interpolate weak points between them */ + start = first; + do + { + point = first; + + /* skip consecutive fitted points */ + for (;;) + { + next = first->next; + if ( next == start ) + goto Next_Contour; + + if ( !psh3_point_is_fitted( next ) ) + break; + + first = next; + } + + /* find next fitted point after unfitted one */ + for (;;) + { + next = next->next; + if ( psh3_point_is_fitted( next ) ) + break; + } + + /* now interpolate between them */ + { + FT_Pos org_a, org_ab, cur_a, cur_ab; + FT_Pos org_c, org_ac, cur_c; + FT_Fixed scale_ab; + + + if ( first->org_u <= next->org_u ) + { + org_a = first->org_u; + cur_a = first->cur_u; + org_ab = next->org_u - org_a; + cur_ab = next->cur_u - cur_a; + } + else + { + org_a = next->org_u; + cur_a = next->cur_u; + org_ab = first->org_u - org_a; + cur_ab = first->cur_u - cur_a; + } + + scale_ab = 0x10000L; + if ( org_ab > 0 ) + scale_ab = FT_DivFix( cur_ab, org_ab ); + + point = first->next; + do + { + org_c = point->org_u; + org_ac = org_c - org_a; + + if ( org_ac <= 0 ) + { + /* on the left of the interpolation zone */ + cur_c = cur_a + FT_MulFix( org_ac, scale ); + } + else if ( org_ac >= org_ab ) + { + /* on the right on the interpolation zone */ + cur_c = cur_a + cur_ab + FT_MulFix( org_ac - org_ab, scale ); + } + else + { + /* within the interpolation zone */ + cur_c = cur_a + FT_MulFix( org_ac, scale_ab ); + } + + point->cur_u = cur_c; + + point = point->next; + + } while ( point != next ); + } + + /* keep going until all points in the contours have been processed */ + first = next; + + } while ( first != start ); + + Next_Contour: + ; + } + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** HIGH-LEVEL INTERFACE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_Error + ps3_hints_apply( PS_Hints ps_hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ) + { + PSH3_GlyphRec glyphrec; + PSH3_Glyph glyph = &glyphrec; + FT_Error error; +#ifdef DEBUG_HINTER + FT_Memory memory; +#endif + FT_Int dimension; + + +#ifdef DEBUG_HINTER + + memory = globals->memory; + + if ( ps3_debug_glyph ) + { + psh3_glyph_done( ps3_debug_glyph ); + FT_FREE( ps3_debug_glyph ); + } + + if ( FT_NEW( glyph ) ) + return error; + + ps3_debug_glyph = glyph; + +#endif /* DEBUG_HINTER */ + + error = psh3_glyph_init( glyph, outline, ps_hints, globals ); + if ( error ) + goto Exit; + + glyph->do_horz_hints = 1; + glyph->do_vert_hints = 1; + + glyph->do_horz_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || + hint_mode == FT_RENDER_MODE_LCD ); + + glyph->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || + hint_mode == FT_RENDER_MODE_LCD_V ); + + glyph->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT ); + + for ( dimension = 0; dimension < 2; dimension++ ) + { + /* load outline coordinates into glyph */ + psh3_glyph_load_points( glyph, dimension ); + + /* compute local extrema */ + psh3_glyph_compute_extrema( glyph ); + + /* compute aligned stem/hints positions */ + psh3_hint_table_align_hints( &glyph->hint_tables[dimension], + glyph->globals, + dimension, + glyph ); + + /* find strong points, align them, then interpolate others */ + psh3_glyph_find_strong_points( glyph, dimension ); + psh3_glyph_interpolate_strong_points( glyph, dimension ); + psh3_glyph_interpolate_normal_points( glyph, dimension ); + psh3_glyph_interpolate_other_points( glyph, dimension ); + + /* save hinted coordinates back to outline */ + psh3_glyph_save_points( glyph, dimension ); + } + + Exit: + +#ifndef DEBUG_HINTER + psh3_glyph_done( glyph ); +#endif + + return error; + } + + +/* END */ Index: xc/extras/freetype2/src/pshinter/pshalgo3.h diff -u /dev/null xc/extras/freetype2/src/pshinter/pshalgo3.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:20 2004 +++ xc/extras/freetype2/src/pshinter/pshalgo3.h Wed May 28 22:01:54 2003 @@ -0,0 +1,255 @@ +/***************************************************************************/ +/* */ +/* pshalgo3.h */ +/* */ +/* PostScript hinting algorithm 3 (specification). */ +/* */ +/* Copyright 2001, 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PSHALGO3_H__ +#define __PSHALGO3_H__ + + +#include "pshrec.h" +#include "pshglob.h" +#include FT_TRIGONOMETRY_H + + +FT_BEGIN_HEADER + + + /* handle to Hint structure */ + typedef struct PSH3_HintRec_* PSH3_Hint; + + /* hint bit-flags */ + typedef enum + { + PSH3_HINT_GHOST = PS_HINT_FLAG_GHOST, + PSH3_HINT_BOTTOM = PS_HINT_FLAG_BOTTOM, + PSH3_HINT_ACTIVE = 4, + PSH3_HINT_FITTED = 8 + + } PSH3_Hint_Flags; + + +#define psh3_hint_is_active( x ) ( ( (x)->flags & PSH3_HINT_ACTIVE ) != 0 ) +#define psh3_hint_is_ghost( x ) ( ( (x)->flags & PSH3_HINT_GHOST ) != 0 ) +#define psh3_hint_is_fitted( x ) ( ( (x)->flags & PSH3_HINT_FITTED ) != 0 ) + +#define psh3_hint_activate( x ) (x)->flags |= PSH3_HINT_ACTIVE +#define psh3_hint_deactivate( x ) (x)->flags &= ~PSH3_HINT_ACTIVE +#define psh3_hint_set_fitted( x ) (x)->flags |= PSH3_HINT_FITTED + + /* hint structure */ + typedef struct PSH3_HintRec_ + { + FT_Int org_pos; + FT_Int org_len; + FT_Pos cur_pos; + FT_Pos cur_len; + FT_UInt flags; + PSH3_Hint parent; + FT_Int order; + + } PSH3_HintRec; + + + /* this is an interpolation zone used for strong points; */ + /* weak points are interpolated according to their strong */ + /* neighbours */ + typedef struct PSH3_ZoneRec_ + { + FT_Fixed scale; + FT_Fixed delta; + FT_Pos min; + FT_Pos max; + + } PSH3_ZoneRec, *PSH3_Zone; + + + typedef struct PSH3_Hint_TableRec_ + { + FT_UInt max_hints; + FT_UInt num_hints; + PSH3_Hint hints; + PSH3_Hint* sort; + PSH3_Hint* sort_global; + FT_UInt num_zones; + PSH3_ZoneRec* zones; + PSH3_Zone zone; + PS_Mask_Table hint_masks; + PS_Mask_Table counter_masks; + + } PSH3_Hint_TableRec, *PSH3_Hint_Table; + + + typedef struct PSH3_PointRec_* PSH3_Point; + typedef struct PSH3_ContourRec_* PSH3_Contour; + + enum + { + PSH3_DIR_NONE = 4, + PSH3_DIR_UP = -1, + PSH3_DIR_DOWN = 1, + PSH3_DIR_LEFT = -2, + PSH3_DIR_RIGHT = 2 + }; + +#define PSH3_DIR_HORIZONTAL 2 +#define PSH3_DIR_VERTICAL 1 + +#define PSH3_DIR_COMPARE( d1, d2 ) ( (d1) == (d2) || (d1) == -(d2) ) +#define PSH3_DIR_IS_HORIZONTAL( d ) PSH3_DIR_COMPARE( d, PSH3_DIR_HORIZONTAL ) +#define PSH3_DIR_IS_VERTICAL( d ) PSH3_DIR_COMPARE( d, PSH3_DIR_VERTICAL ) + + + /* the following bit-flags are computed once by the glyph */ + /* analyzer, for both dimensions */ + enum + { + PSH3_POINT_OFF = 1, /* point is off the curve */ + PSH3_POINT_SMOOTH = 2, /* point is smooth */ + PSH3_POINT_INFLEX = 4 /* point is inflection */ + }; + +#define psh3_point_is_smooth( p ) ( (p)->flags & PSH3_POINT_SMOOTH ) +#define psh3_point_is_off( p ) ( (p)->flags & PSH3_POINT_OFF ) +#define psh3_point_is_inflex( p ) ( (p)->flags & PSH3_POINT_INFLEX ) + +#define psh3_point_set_smooth( p ) (p)->flags |= PSH3_POINT_SMOOTH +#define psh3_point_set_off( p ) (p)->flags |= PSH3_POINT_OFF +#define psh3_point_set_inflex( p ) (p)->flags |= PSH3_POINT_INFLEX + + /* the following bit-flags are re-computed for each dimension */ + enum + { + PSH3_POINT_STRONG = 16, /* point is strong */ + PSH3_POINT_FITTED = 32, /* point is already fitted */ + PSH3_POINT_EXTREMUM = 64, /* point is local extremum */ + PSH3_POINT_POSITIVE = 128, /* extremum has positive contour flow */ + PSH3_POINT_NEGATIVE = 256, /* extremum has negative contour flow */ + PSH3_POINT_EDGE_MIN = 512, /* point is aligned to left/bottom stem edge */ + PSH3_POINT_EDGE_MAX = 1024 /* point is aligned to top/right stem edge */ + }; + +#define psh3_point_is_strong( p ) ( (p)->flags2 & PSH3_POINT_STRONG ) +#define psh3_point_is_fitted( p ) ( (p)->flags2 & PSH3_POINT_FITTED ) +#define psh3_point_is_extremum( p ) ( (p)->flags2 & PSH3_POINT_EXTREMUM ) +#define psh3_point_is_positive( p ) ( (p)->flags2 & PSH3_POINT_POSITIVE ) +#define psh3_point_is_negative( p ) ( (p)->flags2 & PSH3_POINT_NEGATIVE ) +#define psh3_point_is_edge_min( p ) ( (p)->flags2 & PSH3_POINT_EDGE_MIN ) +#define psh3_point_is_edge_max( p ) ( (p)->flags2 & PSH3_POINT_EDGE_MAX ) + +#define psh3_point_set_strong( p ) (p)->flags2 |= PSH3_POINT_STRONG +#define psh3_point_set_fitted( p ) (p)->flags2 |= PSH3_POINT_FITTED +#define psh3_point_set_extremum( p ) (p)->flags2 |= PSH3_POINT_EXTREMUM +#define psh3_point_set_positive( p ) (p)->flags2 |= PSH3_POINT_POSITIVE +#define psh3_point_set_negative( p ) (p)->flags2 |= PSH3_POINT_NEGATIVE +#define psh3_point_set_edge_min( p ) (p)->flags2 |= PSH3_POINT_EDGE_MIN +#define psh3_point_set_edge_max( p ) (p)->flags2 |= PSH3_POINT_EDGE_MAX + + + typedef struct PSH3_PointRec_ + { + PSH3_Point prev; + PSH3_Point next; + PSH3_Contour contour; + FT_UInt flags; + FT_UInt flags2; + FT_Char dir_in; + FT_Char dir_out; + FT_Angle angle_in; + FT_Angle angle_out; + PSH3_Hint hint; + FT_Pos org_u; + FT_Pos org_v; + FT_Pos cur_u; +#ifdef DEBUG_HINTER + FT_Pos org_x; + FT_Pos cur_x; + FT_Pos org_y; + FT_Pos cur_y; + FT_UInt flags_x; + FT_UInt flags_y; +#endif + + } PSH3_PointRec; + + +#define PSH3_POINT_EQUAL_ORG( a, b ) ( (a)->org_u == (b)->org_u && \ + (a)->org_v == (b)->org_v ) + +#define PSH3_POINT_ANGLE( a, b ) FT_Atan2( (b)->org_u - (a)->org_u, \ + (b)->org_v - (a)->org_v ) + + typedef struct PSH3_ContourRec_ + { + PSH3_Point start; + FT_UInt count; + + } PSH3_ContourRec; + + + typedef struct PSH3_GlyphRec_ + { + FT_UInt num_points; + FT_UInt num_contours; + + PSH3_Point points; + PSH3_Contour contours; + + FT_Memory memory; + FT_Outline* outline; + PSH_Globals globals; + PSH3_Hint_TableRec hint_tables[2]; + + FT_Bool vertical; + FT_Int major_dir; + FT_Int minor_dir; + + FT_Bool do_horz_hints; + FT_Bool do_vert_hints; + FT_Bool do_horz_snapping; + FT_Bool do_vert_snapping; + FT_Bool do_stem_adjust; + + } PSH3_GlyphRec, *PSH3_Glyph; + + +#ifdef DEBUG_HINTER + extern PSH3_Hint_Table ps3_debug_hint_table; + + typedef void + (*PSH3_HintFunc)( PSH3_Hint hint, + FT_Bool vertical ); + + extern PSH3_HintFunc ps3_debug_hint_func; + + extern PSH3_Glyph ps3_debug_glyph; +#endif + + + extern FT_Error + ps3_hints_apply( PS_Hints ps_hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ); + + +FT_END_HEADER + + +#endif /* __PSHALGO3_H__ */ + + +/* END */ Index: xc/extras/freetype2/src/pshinter/pshglob.c diff -u xc/extras/freetype2/src/pshinter/pshglob.c:1.1.1.3 xc/extras/freetype2/src/pshinter/pshglob.c:1.1.1.4 --- xc/extras/freetype2/src/pshinter/pshglob.c:1.1.1.3 Thu Jun 20 04:16:20 2002 +++ xc/extras/freetype2/src/pshinter/pshglob.c Wed May 28 22:01:54 2003 @@ -23,7 +23,7 @@ #include "pshglob.h" #ifdef DEBUG_HINTER - extern PSH_Globals ps_debug_globals = 0; + PSH_Globals ps_debug_globals = 0; #endif @@ -534,10 +534,10 @@ for ( ; count > 0; count--, zone++ ) { delta = stem_top - zone->org_bottom; - if ( delta < 0 ) + if ( delta < -blues->blue_fuzz ) break; - if ( stem_top <= zone->org_top ) + if ( stem_top <= zone->org_top + blues->blue_fuzz ) { if ( no_shoots || delta <= blues->blue_threshold ) { @@ -556,10 +556,10 @@ for ( ; count > 0; count--, zone-- ) { delta = zone->org_top - stem_bot; - if ( delta < 0 ) + if ( delta < -blues->blue_fuzz ) break; - if ( stem_bot >= zone->org_bottom ) + if ( stem_bot >= zone->org_bottom - blues->blue_fuzz ) { if ( no_shoots || delta < blues->blue_shift ) { @@ -629,7 +629,7 @@ PSH_Width write = dim->stdw.widths; - write->org = priv->standard_width[1]; + write->org = priv->standard_width[0]; write++; read = priv->snap_widths; @@ -649,9 +649,8 @@ PSH_Width write = dim->stdw.widths; - write->org = priv->standard_height[1]; - write++; - + write->org = priv->standard_height[0]; + write++; read = priv->snap_heights; for ( count = priv->num_snap_heights; count > 0; count-- ) { @@ -680,6 +679,8 @@ ? priv->blue_shift : 7; + globals->blues.blue_fuzz = priv->blue_fuzz; + globals->dimension[0].scale_mult = 0; globals->dimension[0].scale_delta = 0; globals->dimension[1].scale_mult = 0; Index: xc/extras/freetype2/src/pshinter/pshglob.h diff -u xc/extras/freetype2/src/pshinter/pshglob.h:1.1.1.3 xc/extras/freetype2/src/pshinter/pshglob.h:1.1.1.4 --- xc/extras/freetype2/src/pshinter/pshglob.h:1.1.1.3 Thu Jun 20 04:16:20 2002 +++ xc/extras/freetype2/src/pshinter/pshglob.h Wed May 28 22:01:54 2003 @@ -123,6 +123,7 @@ FT_Fixed blue_scale; FT_Int blue_shift; FT_Int blue_threshold; + FT_Int blue_fuzz; FT_Bool no_overshoots; } PSH_BluesRec, *PSH_Blues; Index: xc/extras/freetype2/src/pshinter/pshinter.c diff -u xc/extras/freetype2/src/pshinter/pshinter.c:1.1.1.1 xc/extras/freetype2/src/pshinter/pshinter.c:1.1.1.2 --- xc/extras/freetype2/src/pshinter/pshinter.c:1.1.1.1 Mon Jan 14 11:52:14 2002 +++ xc/extras/freetype2/src/pshinter/pshinter.c Wed May 28 22:01:54 2003 @@ -23,6 +23,7 @@ #include "pshglob.c" #include "pshalgo1.c" #include "pshalgo2.c" +#include "pshalgo3.c" #include "pshmod.c" Index: xc/extras/freetype2/src/pshinter/pshrec.c diff -u xc/extras/freetype2/src/pshinter/pshrec.c:1.1.1.2 xc/extras/freetype2/src/pshinter/pshrec.c:1.1.1.3 --- xc/extras/freetype2/src/pshinter/pshrec.c:1.1.1.2 Thu Jun 20 04:16:20 2002 +++ xc/extras/freetype2/src/pshinter/pshrec.c Wed May 28 22:01:55 2003 @@ -27,9 +27,9 @@ #define FT_COMPONENT trace_pshrec #ifdef DEBUG_HINTER - extern PS_Hints ps_debug_hints = 0; - extern int ps_debug_no_horz_hints = 0; - extern int ps_debug_no_vert_hints = 0; + PS_Hints ps_debug_hints = 0; + int ps_debug_no_horz_hints = 0; + int ps_debug_no_vert_hints = 0; #endif @@ -797,7 +797,7 @@ ps_hints_init( PS_Hints hints, FT_Memory memory ) { - ft_memset( hints, 0, sizeof ( *hints ) ); + FT_MEM_ZERO( hints, sizeof ( *hints ) ); hints->memory = memory; return 0; } @@ -1132,7 +1132,7 @@ FT_LOCAL_DEF( void ) t1_hints_funcs_init( T1_Hints_FuncsRec* funcs ) { - ft_memset( (char*)funcs, 0, sizeof ( *funcs ) ); + FT_MEM_ZERO( (char*)funcs, sizeof ( *funcs ) ); funcs->open = (T1_Hints_OpenFunc) t1_hints_open; funcs->close = (T1_Hints_CloseFunc) ps_hints_close; @@ -1197,7 +1197,7 @@ FT_LOCAL_DEF( void ) t2_hints_funcs_init( T2_Hints_FuncsRec* funcs ) { - ft_memset( funcs, 0, sizeof ( *funcs ) ); + FT_MEM_ZERO( funcs, sizeof ( *funcs ) ); funcs->open = (T2_Hints_OpenFunc) t2_hints_open; funcs->close = (T2_Hints_CloseFunc) ps_hints_close; Index: xc/extras/freetype2/src/pshinter/rules.mk diff -u xc/extras/freetype2/src/pshinter/rules.mk:1.1.1.1 xc/extras/freetype2/src/pshinter/rules.mk:1.1.1.2 --- xc/extras/freetype2/src/pshinter/rules.mk:1.1.1.1 Mon Jan 14 11:52:15 2002 +++ xc/extras/freetype2/src/pshinter/rules.mk Wed May 28 22:01:55 2003 @@ -30,7 +30,8 @@ $(PSHINTER_DIR_)pshglob.c \ $(PSHINTER_DIR_)pshmod.c \ $(PSHINTER_DIR_)pshalgo1.c \ - $(PSHINTER_DIR_)pshalgo2.c + $(PSHINTER_DIR_)pshalgo2.c \ + $(PSHINTER_DIR_)pshalgo3.c # PSHINTER driver headers Index: xc/extras/freetype2/src/psnames/Jamfile diff -u xc/extras/freetype2/src/psnames/Jamfile:1.1.1.1 xc/extras/freetype2/src/psnames/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/psnames/Jamfile:1.1.1.1 Sun Sep 9 22:56:05 2001 +++ xc/extras/freetype2/src/psnames/Jamfile Wed May 28 22:01:55 2003 @@ -1,13 +1,11 @@ # FreeType 2 src/psnames Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src psnames ; - -SubDirHdrs [ FT2_SubDir src psnames ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) psnames ; { local _sources ; - + if $(FT2_MULTI) { _sources = psmodule ; @@ -16,7 +14,7 @@ { _sources = psnames ; } - + Library $(FT2_LIB) : $(_sources).c ; } Index: xc/extras/freetype2/src/psnames/psmodule.c diff -u xc/extras/freetype2/src/psnames/psmodule.c:1.1.1.7 xc/extras/freetype2/src/psnames/psmodule.c:1.1.1.8 --- xc/extras/freetype2/src/psnames/psmodule.c:1.1.1.7 Thu Jun 20 04:16:20 2002 +++ xc/extras/freetype2/src/psnames/psmodule.c Wed May 28 22:01:55 2003 @@ -36,8 +36,8 @@ /* we do deal with glyph variants by detecting a non-initial dot in */ /* the name, as in `A.swash' or `e.final', etc. */ /* */ - static FT_ULong - PS_Unicode_Value( const char* glyph_name ) + static FT_UInt32 + ps_unicode_value( const char* glyph_name ) { FT_Int n; char first = glyph_name[0]; @@ -139,7 +139,7 @@ /* Builds a table that maps Unicode values to glyph indices */ static FT_Error - PS_Build_Unicode_Table( FT_Memory memory, + ps_build_unicode_table( FT_Memory memory, FT_UInt num_glyphs, const char** glyph_names, PS_Unicodes* table ) @@ -156,7 +156,7 @@ FT_UInt n; FT_UInt count; PS_UniMap* map; - FT_ULong uni_char; + FT_UInt32 uni_char; map = table->maps; @@ -168,7 +168,7 @@ if ( gname ) { - uni_char = PS_Unicode_Value( gname ); + uni_char = ps_unicode_value( gname ); if ( uni_char != 0 && uni_char != 0xFFFF ) { @@ -205,7 +205,7 @@ static FT_UInt - PS_Lookup_Unicode( PS_Unicodes* table, + ps_lookup_unicode( PS_Unicodes* table, FT_ULong unicode ) { PS_UniMap *min, *max, *mid; @@ -236,7 +236,7 @@ static FT_ULong - PS_Next_Unicode( PS_Unicodes* table, + ps_next_unicode( PS_Unicodes* table, FT_ULong unicode ) { PS_UniMap *min, *max, *mid; @@ -265,7 +265,7 @@ if ( max < table->maps ) max = table->maps; - + while ( max < table->maps + table->num_maps ) { if ( unicode < max->unicode ) @@ -281,7 +281,7 @@ static const char* - PS_Macintosh_Name( FT_UInt name_index ) + ps_get_macintosh_name( FT_UInt name_index ) { if ( name_index >= 258 ) name_index = 0; @@ -291,7 +291,7 @@ static const char* - PS_Standard_Strings( FT_UInt sid ) + ps_get_standard_strings( FT_UInt sid ) { return ( sid < NUM_SID_GLYPHS ? sid_standard_names[sid] : 0 ); } @@ -302,9 +302,9 @@ { #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST - (PS_Unicode_Value_Func) PS_Unicode_Value, - (PS_Build_Unicodes_Func) PS_Build_Unicode_Table, - (PS_Lookup_Unicode_Func) PS_Lookup_Unicode, + (PS_Unicode_Value_Func) ps_unicode_value, + (PS_Build_Unicodes_Func) ps_build_unicode_table, + (PS_Lookup_Unicode_Func) ps_lookup_unicode, #else @@ -314,14 +314,14 @@ #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ - (PS_Macintosh_Name_Func) PS_Macintosh_Name, - (PS_Adobe_Std_Strings_Func)PS_Standard_Strings, + (PS_Macintosh_Name_Func) ps_get_macintosh_name, + (PS_Adobe_Std_Strings_Func) ps_get_standard_strings, t1_standard_encoding, t1_expert_encoding, #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST - (PS_Next_Unicode_Func) PS_Next_Unicode + (PS_Next_Unicode_Func) ps_next_unicode #else 0 #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ Index: xc/extras/freetype2/src/raster/Jamfile diff -u xc/extras/freetype2/src/raster/Jamfile:1.1.1.1 xc/extras/freetype2/src/raster/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/raster/Jamfile:1.1.1.1 Sun Sep 9 22:56:05 2001 +++ xc/extras/freetype2/src/raster/Jamfile Wed May 28 22:01:55 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/raster Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src raster ; - -SubDirHdrs [ FT2_SubDir src raster ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) raster ; { local _sources ; Index: xc/extras/freetype2/src/raster/ftraster.c diff -u xc/extras/freetype2/src/raster/ftraster.c:1.1.1.6 xc/extras/freetype2/src/raster/ftraster.c:1.1.1.7 --- xc/extras/freetype2/src/raster/ftraster.c:1.1.1.6 Thu Jun 20 04:16:21 2002 +++ xc/extras/freetype2/src/raster/ftraster.c Wed May 28 22:01:55 2003 @@ -539,7 +539,7 @@ FT_TRACE6(( "Set_High_Precision(%s)\n", High ? "true" : "false" )); - ras.precision = 1L << ras.precision_bits; + ras.precision = 1 << ras.precision_bits; ras.precision_half = ras.precision / 2; ras.precision_shift = ras.precision_bits - Pixel_Bits; ras.precision_mask = -ras.precision; @@ -702,7 +702,7 @@ if ( n >= 0 && y > y_turns[n] ) while ( n >= 0 ) { - y2 = y_turns[n]; + y2 = (Int)y_turns[n]; y_turns[n] = y; y = y2; n--; @@ -758,16 +758,16 @@ switch ( p->flow ) { case Flow_Down: - bottom = p->start - p->height+1; - top = p->start; + bottom = (Int)( p->start - p->height + 1 ); + top = (Int)p->start; p->start = bottom; p->offset += p->height - 1; break; case Flow_Up: default: - bottom = p->start; - top = p->start + p->height - 1; + bottom = (Int)p->start; + top = (Int)( p->start + p->height - 1 ); } if ( Insert_Y_Turn( RAS_VARS bottom ) || @@ -922,20 +922,20 @@ } else { - e1 = TRUNC( y1 ); - f1 = FRAC( y1 ); + e1 = (Int)TRUNC( y1 ); + f1 = (Int)FRAC( y1 ); } if ( y2 > maxy ) { /* x2 += FMulDiv( Dx, maxy - y2, Dy ); UNNECESSARY */ - e2 = TRUNC( maxy ); + e2 = (Int)TRUNC( maxy ); f2 = 0; } else { - e2 = TRUNC( y2 ); - f2 = FRAC( y2 ); + e2 = (Int)TRUNC( y2 ); + f2 = (Int)FRAC( y2 ); } if ( f1 > 0 ) @@ -1635,14 +1635,14 @@ tag = FT_CURVE_TAG( tags[0] ); /* A contour cannot start with a cubic control point! */ - if ( tag == FT_Curve_Tag_Cubic ) + if ( tag == FT_CURVE_TAG_CUBIC ) goto Invalid_Outline; /* check first point to determine origin */ - if ( tag == FT_Curve_Tag_Conic ) + if ( tag == FT_CURVE_TAG_CONIC ) { /* first point is conic control. Yes, this happens. */ - if ( FT_CURVE_TAG( ras.outline.tags[last] ) == FT_Curve_Tag_On ) + if ( FT_CURVE_TAG( ras.outline.tags[last] ) == FT_CURVE_TAG_ON ) { /* start at last point if it is on the curve */ v_start = v_last; @@ -1674,7 +1674,7 @@ switch ( tag ) { - case FT_Curve_Tag_On: /* emit a single line_to */ + case FT_CURVE_TAG_ON: /* emit a single line_to */ { Long x, y; @@ -1689,7 +1689,7 @@ continue; } - case FT_Curve_Tag_Conic: /* consume conic arcs */ + case FT_CURVE_TAG_CONIC: /* consume conic arcs */ v_control.x = SCALED( point[0].x ); v_control.y = SCALED( point[0].y ); @@ -1713,14 +1713,14 @@ if ( flipped ) SWAP_( x, y ); - if ( tag == FT_Curve_Tag_On ) + if ( tag == FT_CURVE_TAG_ON ) { if ( Conic_To( RAS_VARS v_control.x, v_control.y, x, y ) ) goto Fail; continue; } - if ( tag != FT_Curve_Tag_Conic ) + if ( tag != FT_CURVE_TAG_CONIC ) goto Invalid_Outline; v_middle.x = ( v_control.x + x ) / 2; @@ -1742,13 +1742,13 @@ goto Close; - default: /* FT_Curve_Tag_Cubic */ + default: /* FT_CURVE_TAG_CUBIC */ { Long x1, y1, x2, y2, x3, y3; if ( point + 1 > limit || - FT_CURVE_TAG( tags[1] ) != FT_Curve_Tag_Cubic ) + FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) goto Invalid_Outline; point += 2; @@ -2652,13 +2652,13 @@ Long x1, x2, xs, e1, e2; - TProfileList wait; + TProfileList waiting; TProfileList draw_left, draw_right; /* Init empty linked lists */ - Init_Linked( &wait ); + Init_Linked( &waiting ); Init_Linked( &draw_left ); Init_Linked( &draw_right ); @@ -2680,7 +2680,7 @@ if ( max_Y < top ) max_Y = top; P->X = 0; - InsNew( &wait, P ); + InsNew( &waiting, P ); P = Q; } @@ -2698,7 +2698,7 @@ /* Then compute the distance of each profile from min_Y */ - P = wait; + P = waiting; while ( P ) { @@ -2717,9 +2717,9 @@ while ( ras.numTurns > 0 ) { - /* look in the wait list for new activations */ + /* look in the waiting list for new activations */ - P = wait; + P = waiting; while ( P ) { @@ -2727,7 +2727,7 @@ P->countL -= y_height; if ( P->countL == 0 ) { - DelOld( &wait, P ); + DelOld( &waiting, P ); switch ( P->flow ) { @@ -2972,11 +2972,11 @@ Set_High_Precision( RAS_VARS ras.outline.flags & - ft_outline_high_precision ); + FT_OUTLINE_HIGH_PRECISION ); ras.scale_shift = ras.precision_shift; ras.dropOutControl = 2; ras.second_pass = (FT_Byte)( !( ras.outline.flags & - ft_outline_single_pass ) ); + FT_OUTLINE_SINGLE_PASS ) ); /* Vertical Sweep */ ras.Proc_Sweep_Init = Vertical_Sweep_Init; @@ -3036,10 +3036,10 @@ Set_High_Precision( RAS_VARS ras.outline.flags & - ft_outline_high_precision ); + FT_OUTLINE_HIGH_PRECISION ); ras.scale_shift = ras.precision_shift + 1; ras.dropOutControl = 2; - ras.second_pass = !( ras.outline.flags & ft_outline_single_pass ); + ras.second_pass = !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS ); /* Vertical Sweep */ @@ -3116,7 +3116,7 @@ ( ( c << 2 ) & 0x0030 ) | (c & 0x0003 ); - raster->count_table[n] = c; + raster->count_table[n] = (UInt)c; } #ifdef FT_RASTER_OPTION_ANTI_ALIASING @@ -3146,7 +3146,7 @@ *araster = &the_raster; - FT_MEM_SET( &the_raster, sizeof ( the_raster ), 0 ); + FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) ); ft_black_init( &the_raster ); return 0; @@ -3259,7 +3259,7 @@ return Raster_Err_Invalid; /* this version of the raster does not support direct rendering, sorry */ - if ( params->flags & ft_raster_flag_direct ) + if ( params->flags & FT_RASTER_FLAG_DIRECT ) return Raster_Err_Unsupported; if ( !target_map || !target_map->buffer ) @@ -3268,7 +3268,7 @@ ras.outline = *outline; ras.target = *target_map; - return ( ( params->flags & ft_raster_flag_aa ) + return ( ( params->flags & FT_RASTER_FLAG_AA ) ? Render_Gray_Glyph( raster ) : Render_Glyph( raster ) ); } @@ -3276,7 +3276,7 @@ const FT_Raster_Funcs ft_standard_raster = { - ft_glyph_format_outline, + FT_GLYPH_FORMAT_OUTLINE, (FT_Raster_New_Func) ft_black_new, (FT_Raster_Reset_Func) ft_black_reset, (FT_Raster_Set_Mode_Func)ft_black_set_mode, Index: xc/extras/freetype2/src/raster/ftrend1.c diff -u xc/extras/freetype2/src/raster/ftrend1.c:1.1.1.6 xc/extras/freetype2/src/raster/ftrend1.c:1.1.1.7 --- xc/extras/freetype2/src/raster/ftrend1.c:1.1.1.6 Thu Jun 20 04:16:21 2002 +++ xc/extras/freetype2/src/raster/ftrend1.c Wed May 28 22:01:55 2003 @@ -86,7 +86,7 @@ FT_GlyphSlot slot, FT_BBox* cbox ) { - FT_MEM_SET( cbox, 0, sizeof ( *cbox ) ); + FT_MEM_ZERO( cbox, sizeof ( *cbox ) ); if ( slot->format == render->glyph_format ) FT_Outline_Get_CBox( &slot->outline, cbox ); @@ -95,10 +95,10 @@ /* convert a slot's glyph image into a bitmap */ static FT_Error - ft_raster1_render( FT_Renderer render, - FT_GlyphSlot slot, - FT_UInt mode, - FT_Vector* origin ) + ft_raster1_render( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + FT_Vector* origin ) { FT_Error error; FT_Outline* outline; @@ -118,7 +118,7 @@ } /* check rendering mode */ - if ( mode != ft_render_mode_mono ) + if ( mode != FT_RENDER_MODE_MONO ) { /* raster1 is only capable of producing monochrome bitmaps */ if ( render->clazz == &ft_raster1_renderer_class ) @@ -145,8 +145,8 @@ cbox.xMax = ( cbox.xMax + 63 ) & -64; cbox.yMax = ( cbox.yMax + 63 ) & -64; - width = ( cbox.xMax - cbox.xMin ) >> 6; - height = ( cbox.yMax - cbox.yMin ) >> 6; + width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); + height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); bitmap = &slot->bitmap; memory = render->root.memory; @@ -158,17 +158,17 @@ } /* allocate new one, depends on pixel format */ - if ( !( mode & ft_render_mode_mono ) ) + if ( !( mode & FT_RENDER_MODE_MONO ) ) { /* we pad to 32 bits, only for backwards compatibility with FT 1.x */ pitch = ( width + 3 ) & -4; - bitmap->pixel_mode = ft_pixel_mode_grays; + bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; bitmap->num_grays = 256; } else { pitch = ( ( width + 15 ) >> 4 ) << 1; - bitmap->pixel_mode = ft_pixel_mode_mono; + bitmap->pixel_mode = FT_PIXEL_MODE_MONO; } bitmap->width = width; @@ -188,8 +188,8 @@ params.source = outline; params.flags = 0; - if ( bitmap->pixel_mode == ft_pixel_mode_grays ) - params.flags |= ft_raster_flag_aa; + if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY ) + params.flags |= FT_RASTER_FLAG_AA; /* render outline into the bitmap */ error = render->raster_render( render->raster, ¶ms ); @@ -199,9 +199,9 @@ if ( error ) goto Exit; - slot->format = ft_glyph_format_bitmap; - slot->bitmap_left = cbox.xMin >> 6; - slot->bitmap_top = cbox.yMax >> 6; + slot->format = FT_GLYPH_FORMAT_BITMAP; + slot->bitmap_left = (FT_Int)( cbox.xMin >> 6 ); + slot->bitmap_top = (FT_Int)( cbox.yMax >> 6 ); Exit: return error; @@ -226,12 +226,12 @@ (FT_Module_Requester) 0 }, - ft_glyph_format_outline, + FT_GLYPH_FORMAT_OUTLINE, - (FTRenderer_render) ft_raster1_render, - (FTRenderer_transform)ft_raster1_transform, - (FTRenderer_getCBox) ft_raster1_get_cbox, - (FTRenderer_setMode) ft_raster1_set_mode, + (FT_Renderer_RenderFunc) ft_raster1_render, + (FT_Renderer_TransformFunc)ft_raster1_transform, + (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, + (FT_Renderer_SetModeFunc) ft_raster1_set_mode, (FT_Raster_Funcs*) &ft_standard_raster }; @@ -259,12 +259,12 @@ (FT_Module_Requester) 0 }, - ft_glyph_format_outline, + FT_GLYPH_FORMAT_OUTLINE, - (FTRenderer_render) ft_raster1_render, - (FTRenderer_transform)ft_raster1_transform, - (FTRenderer_getCBox) ft_raster1_get_cbox, - (FTRenderer_setMode) ft_raster1_set_mode, + (FT_Renderer_RenderFunc) ft_raster1_render, + (FT_Renderer_TransformFunc)ft_raster1_transform, + (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, + (FT_Renderer_SetModeFunc) ft_raster1_set_mode, (FT_Raster_Funcs*) &ft_standard_raster }; Index: xc/extras/freetype2/src/sfnt/Jamfile diff -u xc/extras/freetype2/src/sfnt/Jamfile:1.1.1.2 xc/extras/freetype2/src/sfnt/Jamfile:1.1.1.3 --- xc/extras/freetype2/src/sfnt/Jamfile:1.1.1.2 Thu Jun 20 04:16:21 2002 +++ xc/extras/freetype2/src/sfnt/Jamfile Wed May 28 22:01:55 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/sfnt Jamfile (c) 2001, 2002 David Turner # -SubDir FT2_TOP src sfnt ; - -SubDirHdrs [ FT2_SubDir src sfnt ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) sfnt ; { local _sources ; Index: xc/extras/freetype2/src/sfnt/sfdriver.c diff -u xc/extras/freetype2/src/sfnt/sfdriver.c:1.1.1.8 xc/extras/freetype2/src/sfnt/sfdriver.c:1.3 --- xc/extras/freetype2/src/sfnt/sfdriver.c:1.1.1.8 Thu Jun 20 04:16:21 2002 +++ xc/extras/freetype2/src/sfnt/sfdriver.c Wed May 28 22:13:05 2003 @@ -14,7 +14,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ - +/* $XFree86: xc/extras/freetype2/src/sfnt/sfdriver.c,v 1.3 2003/05/29 02:13:05 dawes Exp $ */ #include <ft2build.h> #include FT_INTERNAL_SFNT_H @@ -92,7 +92,7 @@ FT_Error error; - error = TT_Get_PS_Name( face, glyph_index, &gname ); + error = tt_face_get_ps_name( face, glyph_index, &gname ); if ( !error && buffer_max > 0 ) { FT_UInt len = (FT_UInt)( ft_strlen( gname ) ); @@ -181,6 +181,9 @@ FT_FRAME_EXIT(); } + + (void)error; /* Muffle compiler */ + goto Exit; } @@ -208,6 +211,8 @@ } ((char*)result)[len] = '\0'; } + + (void)error; /* Muffle compiler */ } Exit: @@ -220,7 +225,7 @@ FT_CALLBACK_DEF( FT_Module_Interface ) - SFNT_Get_Interface( FT_Module module, + sfnt_get_interface( FT_Module module, const char* module_interface ) { FT_UNUSED( module ); @@ -228,6 +233,9 @@ if ( ft_strcmp( module_interface, "get_sfnt" ) == 0 ) return (FT_Module_Interface)get_sfnt_table; + if ( ft_strcmp( module_interface, "load_sfnt" ) == 0 ) + return (FT_Module_Interface)tt_face_load_any; + #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES if ( ft_strcmp( module_interface, "glyph_name" ) == 0 ) return (FT_Module_Interface)get_sfnt_glyph_name; @@ -243,44 +251,44 @@ static const SFNT_Interface sfnt_interface = { - TT_Goto_Table, + tt_face_goto_table, - SFNT_Init_Face, - SFNT_Load_Face, - SFNT_Done_Face, - SFNT_Get_Interface, - - TT_Load_Any, - TT_Load_SFNT_HeaderRec, - TT_Load_Directory, - - TT_Load_Header, - TT_Load_Metrics_Header, - TT_Load_CMap, - TT_Load_MaxProfile, - TT_Load_OS2, - TT_Load_PostScript, - - TT_Load_Names, - TT_Free_Names, - - TT_Load_Hdmx, - TT_Free_Hdmx, - - TT_Load_Kern, - TT_Load_Gasp, - TT_Load_PCLT, + sfnt_init_face, + sfnt_load_face, + sfnt_done_face, + sfnt_get_interface, + + tt_face_load_any, + tt_face_load_sfnt_header, + tt_face_load_directory, + + tt_face_load_header, + tt_face_load_metrics_header, + tt_face_load_cmap, + tt_face_load_max_profile, + tt_face_load_os2, + tt_face_load_postscript, + + tt_face_load_names, + tt_face_free_names, + + tt_face_load_hdmx, + tt_face_free_hdmx, + + tt_face_load_kern, + tt_face_load_gasp, + tt_face_load_pclt, #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS /* see `ttload.h' */ - TT_Load_Bitmap_Header, + tt_face_load_bitmap_header, /* see `ttsbit.h' */ - TT_Set_SBit_Strike, - TT_Load_SBit_Strikes, - TT_Load_SBit_Image, - TT_Free_SBit_Strikes, + tt_face_set_sbit_strike, + tt_face_load_sbit_strikes, + tt_face_load_sbit_image, + tt_face_free_sbit_strikes, #else /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ @@ -295,8 +303,8 @@ #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES /* see `ttpost.h' */ - TT_Get_PS_Name, - TT_Free_Post_Names, + tt_face_get_ps_name, + tt_face_free_ps_names, #else /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ @@ -306,8 +314,8 @@ #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ /* see `ttcmap.h' */ - TT_CharMap_Load, - TT_CharMap_Free, + tt_face_load_charmap, + tt_face_free_charmap, }; @@ -325,7 +333,7 @@ (FT_Module_Constructor)0, (FT_Module_Destructor) 0, - (FT_Module_Requester) SFNT_Get_Interface + (FT_Module_Requester) sfnt_get_interface }; Index: xc/extras/freetype2/src/sfnt/sfobjs.c diff -u xc/extras/freetype2/src/sfnt/sfobjs.c:1.1.1.8 xc/extras/freetype2/src/sfnt/sfobjs.c:1.3 --- xc/extras/freetype2/src/sfnt/sfobjs.c:1.1.1.8 Thu Jun 20 04:16:21 2002 +++ xc/extras/freetype2/src/sfnt/sfobjs.c Wed May 28 22:13:05 2003 @@ -14,7 +14,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ - +/* $XFree86: xc/extras/freetype2/src/sfnt/sfobjs.c,v 1.3 2003/05/29 02:13:05 dawes Exp $ */ #include <ft2build.h> #include "sfobjs.h" @@ -86,7 +86,7 @@ for ( n = 0; n < len; n++ ) { - code = FT_NEXT_ULONG( read ); + code = (FT_UInt)FT_NEXT_ULONG( read ); if ( code < 32 || code > 127 ) code = '?'; @@ -271,6 +271,8 @@ result = NULL; goto Exit; } + + (void)error; /* Muffle compiler */ } result = convert( rec, memory ); @@ -296,20 +298,20 @@ static const TEncoding tt_encodings[] = { - { TT_PLATFORM_ISO, -1, ft_encoding_unicode }, + { TT_PLATFORM_ISO, -1, FT_ENCODING_UNICODE }, - { TT_PLATFORM_APPLE_UNICODE, -1, ft_encoding_unicode }, + { TT_PLATFORM_APPLE_UNICODE, -1, FT_ENCODING_UNICODE }, - { TT_PLATFORM_MACINTOSH, TT_MAC_ID_ROMAN, ft_encoding_apple_roman }, + { TT_PLATFORM_MACINTOSH, TT_MAC_ID_ROMAN, FT_ENCODING_APPLE_ROMAN }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_SYMBOL_CS, ft_encoding_symbol }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_UCS_4, ft_encoding_unicode }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, ft_encoding_unicode }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_SJIS, ft_encoding_sjis }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_GB2312, ft_encoding_gb2312 }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_BIG_5, ft_encoding_big5 }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_WANSUNG, ft_encoding_wansung }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_JOHAB, ft_encoding_johab } + { TT_PLATFORM_MICROSOFT, TT_MS_ID_SYMBOL_CS, FT_ENCODING_MS_SYMBOL }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_UCS_4, FT_ENCODING_UNICODE }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, FT_ENCODING_UNICODE }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_SJIS, FT_ENCODING_MS_SJIS }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_GB2312, FT_ENCODING_MS_GB2312 }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_BIG_5, FT_ENCODING_MS_BIG5 }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_WANSUNG, FT_ENCODING_MS_WANSUNG }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_JOHAB, FT_ENCODING_MS_JOHAB } }; const TEncoding *cur, *limit; @@ -328,12 +330,12 @@ } } - return ft_encoding_none; + return FT_ENCODING_NONE; } FT_LOCAL_DEF( FT_Error ) - SFNT_Init_Face( FT_Stream stream, + sfnt_init_face( FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, @@ -397,7 +399,7 @@ FT_LOCAL_DEF( FT_Error ) - SFNT_Load_Face( FT_Stream stream, + sfnt_load_face( FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, @@ -432,8 +434,15 @@ /* */ /* do we have outlines in there? */ - has_outline = FT_BOOL( ( TT_LookUp_Table( face, TTAG_glyf ) != 0 ) || - ( TT_LookUp_Table( face, TTAG_CFF ) != 0 ) ); +#ifdef FT_CONFIG_OPTION_INCREMENTAL + has_outline = FT_BOOL( face->root.internal->incremental_interface != 0 || + tt_face_lookup_table( face, TTAG_glyf ) != 0 || + tt_face_lookup_table( face, TTAG_CFF ) != 0 ); +#else + has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != 0 || + tt_face_lookup_table( face, TTAG_CFF ) != 0 ); +#endif + is_apple_sbit = 0; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS @@ -508,8 +517,7 @@ /* now set up root fields */ { FT_Face root = &face->root; - FT_Int flags = 0; - FT_Int n; + FT_Int32 flags = 0; FT_Memory memory; @@ -578,9 +586,8 @@ /* Try to set the charmap encoding according to the platform & */ /* encoding ID of each charmap. */ /* */ -#ifdef FT_CONFIG_OPTION_USE_CMAPS - TT_Build_CMaps( face ); /* ignore errors */ + tt_face_build_cmaps( face ); /* ignore errors */ /* set the encoding fields */ @@ -596,56 +603,25 @@ charmap->encoding = sfnt_find_encoding( charmap->platform_id, charmap->encoding_id ); +#if 0 if ( root->charmap == NULL && - charmap->encoding == ft_encoding_unicode ) + charmap->encoding == FT_ENCODING_UNICODE ) { /* set 'root->charmap' to the first Unicode encoding we find */ root->charmap = charmap; } +#endif } } -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - { - TT_CharMap charmap = face->charmaps; - - - charmap = face->charmaps; - root->num_charmaps = face->num_charmaps; - - /* allocate table of pointers */ - if ( FT_NEW_ARRAY( root->charmaps, root->num_charmaps ) ) - goto Exit; - - for ( n = 0; n < root->num_charmaps; n++, charmap++ ) - { - FT_Int platform = charmap->cmap.platformID; - FT_Int encoding = charmap->cmap.platformEncodingID; - - - charmap->root.face = (FT_Face)face; - charmap->root.platform_id = (FT_UShort)platform; - charmap->root.encoding_id = (FT_UShort)encoding; - charmap->root.encoding = sfnt_find_encoding( platform, encoding ); - - /* now, set root->charmap with a unicode charmap */ - /* wherever available */ - if ( !root->charmap && - charmap->root.encoding == ft_encoding_unicode ) - root->charmap = (FT_CharMap)charmap; - - root->charmaps[n] = (FT_CharMap)charmap; - } - } - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ - #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS if ( face->num_sbit_strikes ) { + FT_ULong n; + + root->face_flags |= FT_FACE_FLAG_FIXED_SIZES; #if 0 @@ -779,7 +755,7 @@ FT_LOCAL_DEF( void ) - SFNT_Done_Face( TT_Face face ) + sfnt_done_face( TT_Face face ) { FT_Memory memory = face->root.memory; SFNT_Service sfnt = (SFNT_Service)face->sfnt; @@ -808,8 +784,6 @@ FT_FREE( face->dir_tables ); face->num_tables = 0; -#ifdef FT_CONFIG_OPTION_USE_CMAPS - { FT_Stream stream = FT_FACE_STREAM( face ); @@ -819,27 +793,6 @@ face->cmap_size = 0; } -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - /* freeing the character mapping tables */ - if ( sfnt && sfnt->load_charmaps ) - { - FT_UShort n; - - - for ( n = 0; n < face->num_charmaps; n++ ) - sfnt->free_charmap( face, &face->charmaps[n].cmap ); - } - - FT_FREE( face->charmaps ); - face->num_charmaps = 0; - - FT_FREE( face->root.charmaps ); - face->root.num_charmaps = 0; - face->root.charmap = 0; - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ - /* freeing the horizontal metrics */ FT_FREE( face->horizontal.long_metrics ); FT_FREE( face->horizontal.short_metrics ); Index: xc/extras/freetype2/src/sfnt/sfobjs.h diff -u xc/extras/freetype2/src/sfnt/sfobjs.h:1.1.1.4 xc/extras/freetype2/src/sfnt/sfobjs.h:1.1.1.5 --- xc/extras/freetype2/src/sfnt/sfobjs.h:1.1.1.4 Thu Jun 20 04:16:21 2002 +++ xc/extras/freetype2/src/sfnt/sfobjs.h Wed May 28 22:01:55 2003 @@ -29,21 +29,21 @@ FT_LOCAL( FT_Error ) - SFNT_Init_Face( FT_Stream stream, + sfnt_init_face( FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( FT_Error ) - SFNT_Load_Face( FT_Stream stream, + sfnt_load_face( FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( void ) - SFNT_Done_Face( TT_Face face ); + sfnt_done_face( TT_Face face ); FT_END_HEADER Index: xc/extras/freetype2/src/sfnt/ttcmap.c diff -u xc/extras/freetype2/src/sfnt/ttcmap.c:1.1.1.6 xc/extras/freetype2/src/sfnt/ttcmap.c:1.1.1.7 --- xc/extras/freetype2/src/sfnt/ttcmap.c:1.1.1.6 Thu Jun 20 04:16:21 2002 +++ xc/extras/freetype2/src/sfnt/ttcmap.c Wed May 28 22:01:55 2003 @@ -86,7 +86,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_CharMap_Load */ + /* tt_face_load_charmap */ /* */ /* <Description> */ /* Loads a given TrueType character map into memory. */ @@ -108,9 +108,9 @@ /* released. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_CharMap_Load( TT_Face face, - TT_CMapTable cmap, - FT_Stream stream ) + tt_face_load_charmap( TT_Face face, + TT_CMapTable cmap, + FT_Stream stream ) { FT_Error error; FT_Memory memory; @@ -391,7 +391,7 @@ return SFNT_Err_Ok; Fail: - TT_CharMap_Free( face, cmap ); + tt_face_free_charmap( face, cmap ); return error; } @@ -399,7 +399,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_CharMap_Free */ + /* tt_face_free_charmap */ /* */ /* <Description> */ /* Destroys a character mapping table. */ @@ -413,8 +413,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_CharMap_Free( TT_Face face, - TT_CMapTable cmap ) + tt_face_free_charmap( TT_Face face, + TT_CMapTable cmap ) { FT_Memory memory; @@ -629,11 +629,11 @@ * This is relatively simplistic -- look for a subHeader containing * glyphs and then walk to the first glyph in that subHeader. */ - while ( charCode < 0x10000 ) + while ( charCode < 0x10000L ) { char_lo = (FT_UInt)( charCode & 0xFF ); char_hi = charCode >> 8; - + if ( char_hi == 0 ) { /* an 8-bit character code -- we use the subHeader 0 in this case */ @@ -655,16 +655,16 @@ continue; } } - + sh2 = cmap2->subHeaders + index1; char_lo -= sh2->firstCode; - + if ( char_lo > (FT_UInt)sh2->entryCount ) { charCode = ( char_hi + 1 ) << 8; continue; } - + offset = sh2->idRangeOffset / 2 + char_lo; if ( offset >= (FT_UInt)cmap2->numGlyphId || cmap2->glyphIdArray[offset] == 0 ) @@ -672,7 +672,7 @@ charCode++; continue; } - + return charCode; } return 0; @@ -746,7 +746,7 @@ /* directly */ if ( seg4->idRangeOffset == 0 ) - result = ( charCode + seg4->idDelta ) & 0xFFFFU; + result = (FT_UInt)( charCode + seg4->idDelta ) & 0xFFFFU; else { /* otherwise, we must use the glyphIdArray to do it */ @@ -813,7 +813,7 @@ if ( seg4->idRangeOffset == 0 ) return ( charCode ); - + while ( charCode <= (FT_UInt) seg4->endCount ) { /* otherwise, we must use the glyphIdArray to do it */ @@ -890,12 +890,12 @@ charCode++; - + cmap6 = &cmap->c.cmap6; - + if ( charCode < (FT_ULong) cmap6->firstCode ) charCode = cmap6->firstCode; - + charCode -= cmap6->firstCode; while ( charCode < (FT_UInt)cmap6->entryCount ) @@ -971,7 +971,8 @@ cmap8_12->last_group = group; Found1: - return group->startGlyphID + (FT_UInt)( charCode - group->startCharCode ); + return (FT_UInt)( group->startGlyphID + + ( charCode - group->startCharCode ) ); } @@ -1016,7 +1017,7 @@ Found: if ( charCode < group->startCharCode ) charCode = group->startCharCode; - + return charCode; } @@ -1085,10 +1086,10 @@ charCode++; cmap10 = &cmap->c.cmap10; - + if ( charCode < cmap10->startCharCode ) charCode = cmap10->startCharCode; - + charCode -= cmap10->startCharCode; /* the overflow trick for comparison works here also since the number */ Index: xc/extras/freetype2/src/sfnt/ttcmap.c.save diff -u xc/extras/freetype2/src/sfnt/ttcmap.c.save:1.2 xc/extras/freetype2/src/sfnt/ttcmap.c.save:removed --- xc/extras/freetype2/src/sfnt/ttcmap.c.save:1.2 Fri Oct 25 11:01:04 2002 +++ xc/extras/freetype2/src/sfnt/ttcmap.c.save Sat Feb 28 21:40:20 2004 @@ -1,1099 +0,0 @@ -/***************************************************************************/ -/* */ -/* ttcmap.c */ -/* */ -/* TrueType character mapping table (cmap) support (body). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include "ttload.h" -#include "ttcmap.h" - -#include "sferrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttcmap - - - FT_CALLBACK_DEF( FT_UInt ) - code_to_index0( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_ULong ) - code_to_next0( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_UInt ) - code_to_index2( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_ULong ) - code_to_next2( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_UInt ) - code_to_index4( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_ULong ) - code_to_next4( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_UInt ) - code_to_index6( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_ULong ) - code_to_next6( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_UInt ) - code_to_index8_12( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_ULong ) - code_to_next8_12( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_UInt ) - code_to_index10( TT_CMapTable* charmap, - FT_ULong char_code ); - - FT_CALLBACK_DEF( FT_ULong ) - code_to_next10( TT_CMapTable* charmap, - FT_ULong char_code ); - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* TT_CharMap_Load */ - /* */ - /* <Description> */ - /* Loads a given TrueType character map into memory. */ - /* */ - /* <Input> */ - /* face :: A handle to the parent face object. */ - /* stream :: A handle to the current stream object. */ - /* */ - /* <InOut> */ - /* table :: A pointer to a cmap object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - /* <Note> */ - /* The function assumes that the stream is already in use (i.e., */ - /* opened). In case of error, all partially allocated tables are */ - /* released. */ - /* */ - FT_LOCAL_DEF FT_Error - TT_CharMap_Load( TT_Face face, - TT_CMapTable* cmap, - FT_Stream stream ) - { - FT_Error error; - FT_Memory memory; - FT_UShort num_SH, num_Seg, i; - FT_ULong j, n; - - FT_UShort u, l; - - TT_CMap0* cmap0; - TT_CMap2* cmap2; - TT_CMap4* cmap4; - TT_CMap6* cmap6; - TT_CMap8_12* cmap8_12; - TT_CMap10* cmap10; - - TT_CMap2SubHeader* cmap2sub; - TT_CMap4Segment* segments; - TT_CMapGroup* groups; - - - if ( cmap->loaded ) - return SFNT_Err_Ok; - - memory = stream->memory; - - if ( FILE_Seek( cmap->offset ) ) - return error; - - switch ( cmap->format ) - { - case 0: - cmap0 = &cmap->c.cmap0; - - if ( READ_UShort( cmap0->language ) || - ALLOC( cmap0->glyphIdArray, 256L ) || - FILE_Read( cmap0->glyphIdArray, 256L ) ) - goto Fail; - - cmap->get_index = code_to_index0; - cmap->get_next_char = code_to_next0; - break; - - case 2: - num_SH = 0; - cmap2 = &cmap->c.cmap2; - - /* allocate subheader keys */ - - if ( ALLOC_ARRAY( cmap2->subHeaderKeys, 256, FT_UShort ) || - ACCESS_Frame( 2L + 512L ) ) - goto Fail; - - cmap2->language = GET_UShort(); - - for ( i = 0; i < 256; i++ ) - { - u = (FT_UShort)( GET_UShort() / 8 ); - cmap2->subHeaderKeys[i] = u; - - if ( num_SH < u ) - num_SH = u; - } - - FORGET_Frame(); - - /* load subheaders */ - - cmap2->numGlyphId = l = (FT_UShort)( - ( ( cmap->length - 2L * ( 256 + 3 ) - num_SH * 8L ) & 0xFFFF ) / 2 ); - - if ( ALLOC_ARRAY( cmap2->subHeaders, - num_SH + 1, - TT_CMap2SubHeader ) || - ACCESS_Frame( ( num_SH + 1 ) * 8L ) ) - { - FREE( cmap2->subHeaderKeys ); - goto Fail; - } - - cmap2sub = cmap2->subHeaders; - - for ( i = 0; i <= num_SH; i++ ) - { - cmap2sub->firstCode = GET_UShort(); - cmap2sub->entryCount = GET_UShort(); - cmap2sub->idDelta = GET_Short(); - /* we apply the location offset immediately */ - cmap2sub->idRangeOffset = (FT_UShort)( - GET_UShort() - ( num_SH - i ) * 8 - 2 ); - - cmap2sub++; - } - - FORGET_Frame(); - - /* load glyph IDs */ - - if ( ALLOC_ARRAY( cmap2->glyphIdArray, l, FT_UShort ) || - ACCESS_Frame( l * 2L ) ) - { - FREE( cmap2->subHeaders ); - FREE( cmap2->subHeaderKeys ); - goto Fail; - } - - for ( i = 0; i < l; i++ ) - cmap2->glyphIdArray[i] = GET_UShort(); - - FORGET_Frame(); - - cmap->get_index = code_to_index2; - cmap->get_next_char = code_to_next2; - break; - - case 4: - cmap4 = &cmap->c.cmap4; - - /* load header */ - - if ( ACCESS_Frame( 10L ) ) - goto Fail; - - cmap4->language = GET_UShort(); - cmap4->segCountX2 = GET_UShort(); - cmap4->searchRange = GET_UShort(); - cmap4->entrySelector = GET_UShort(); - cmap4->rangeShift = GET_UShort(); - - num_Seg = (FT_UShort)( cmap4->segCountX2 / 2 ); - - FORGET_Frame(); - - /* load segments */ - - if ( ALLOC_ARRAY( cmap4->segments, - num_Seg, - TT_CMap4Segment ) || - ACCESS_Frame( ( num_Seg * 4 + 1 ) * 2L ) ) - goto Fail; - - segments = cmap4->segments; - - for ( i = 0; i < num_Seg; i++ ) - segments[i].endCount = GET_UShort(); - - (void)GET_UShort(); - - for ( i = 0; i < num_Seg; i++ ) - segments[i].startCount = GET_UShort(); - - for ( i = 0; i < num_Seg; i++ ) - segments[i].idDelta = GET_Short(); - - for ( i = 0; i < num_Seg; i++ ) - segments[i].idRangeOffset = GET_UShort(); - - FORGET_Frame(); - - cmap4->numGlyphId = l = (FT_UShort)( - ( ( cmap->length - ( 16L + 8L * num_Seg ) ) & 0xFFFF ) / 2 ); - - /* load IDs */ - - if ( ALLOC_ARRAY( cmap4->glyphIdArray, l, FT_UShort ) || - ACCESS_Frame( l * 2L ) ) - { - FREE( cmap4->segments ); - goto Fail; - } - - for ( i = 0; i < l; i++ ) - cmap4->glyphIdArray[i] = GET_UShort(); - - FORGET_Frame(); - - cmap4->last_segment = cmap4->segments; - - cmap->get_index = code_to_index4; - cmap->get_next_char = code_to_next4; - break; - - case 6: - cmap6 = &cmap->c.cmap6; - - if ( ACCESS_Frame( 6L ) ) - goto Fail; - - cmap6->language = GET_UShort(); - cmap6->firstCode = GET_UShort(); - cmap6->entryCount = GET_UShort(); - - FORGET_Frame(); - - l = cmap6->entryCount; - - if ( ALLOC_ARRAY( cmap6->glyphIdArray, l, FT_Short ) || - ACCESS_Frame( l * 2L ) ) - goto Fail; - - for ( i = 0; i < l; i++ ) - cmap6->glyphIdArray[i] = GET_UShort(); - - FORGET_Frame(); - cmap->get_index = code_to_index6; - cmap->get_next_char = code_to_next6; - break; - - case 8: - case 12: - cmap8_12 = &cmap->c.cmap8_12; - - if ( ACCESS_Frame( 8L ) ) - goto Fail; - - cmap->length = GET_ULong(); - cmap8_12->language = GET_ULong(); - - FORGET_Frame(); - - if ( cmap->format == 8 ) - if ( FILE_Skip( 8192L ) ) - goto Fail; - - if ( READ_ULong( cmap8_12->nGroups ) ) - goto Fail; - - n = cmap8_12->nGroups; - - if ( ALLOC_ARRAY( cmap8_12->groups, n, TT_CMapGroup ) || - ACCESS_Frame( n * 3 * 4L ) ) - goto Fail; - - groups = cmap8_12->groups; - - for ( j = 0; j < n; j++ ) - { - groups[j].startCharCode = GET_ULong(); - groups[j].endCharCode = GET_ULong(); - groups[j].startGlyphID = GET_ULong(); - } - - FORGET_Frame(); - - cmap8_12->last_group = cmap8_12->groups; - - cmap->get_index = code_to_index8_12; - cmap->get_next_char = code_to_next8_12; - break; - - case 10: - cmap10 = &cmap->c.cmap10; - - if ( ACCESS_Frame( 16L ) ) - goto Fail; - - cmap->length = GET_ULong(); - cmap10->language = GET_ULong(); - cmap10->startCharCode = GET_ULong(); - cmap10->numChars = GET_ULong(); - - FORGET_Frame(); - - n = cmap10->numChars; - - if ( ALLOC_ARRAY( cmap10->glyphs, n, FT_Short ) || - ACCESS_Frame( n * 2L ) ) - goto Fail; - - for ( j = 0; j < n; j++ ) - cmap10->glyphs[j] = GET_UShort(); - - FORGET_Frame(); - cmap->get_index = code_to_index10; - cmap->get_next_char = code_to_next10; - break; - - default: /* corrupt character mapping table */ - return SFNT_Err_Invalid_CharMap_Format; - - } - - return SFNT_Err_Ok; - - Fail: - TT_CharMap_Free( face, cmap ); - return error; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* TT_CharMap_Free */ - /* */ - /* <Description> */ - /* Destroys a character mapping table. */ - /* */ - /* <Input> */ - /* face :: A handle to the parent face object. */ - /* cmap :: A handle to a cmap object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF FT_Error - TT_CharMap_Free( TT_Face face, - TT_CMapTable* cmap ) - { - FT_Memory memory; - - - if ( !cmap ) - return SFNT_Err_Ok; - - memory = face->root.driver->root.memory; - - switch ( cmap->format ) - { - case 0: - FREE( cmap->c.cmap0.glyphIdArray ); - break; - - case 2: - FREE( cmap->c.cmap2.subHeaderKeys ); - FREE( cmap->c.cmap2.subHeaders ); - FREE( cmap->c.cmap2.glyphIdArray ); - break; - - case 4: - FREE( cmap->c.cmap4.segments ); - FREE( cmap->c.cmap4.glyphIdArray ); - cmap->c.cmap4.segCountX2 = 0; - break; - - case 6: - FREE( cmap->c.cmap6.glyphIdArray ); - cmap->c.cmap6.entryCount = 0; - break; - - case 8: - case 12: - FREE( cmap->c.cmap8_12.groups ); - cmap->c.cmap8_12.nGroups = 0; - break; - - case 10: - FREE( cmap->c.cmap10.glyphs ); - cmap->c.cmap10.numChars = 0; - break; - - default: - /* invalid table format, do nothing */ - ; - } - - cmap->loaded = FALSE; - return SFNT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_index0 */ - /* */ - /* <Description> */ - /* Converts the character code into a glyph index. Uses format 0. */ - /* `charCode' must be in the range 0x00-0xFF (otherwise 0 is */ - /* returned). */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap0 :: A pointer to a cmap table in format 0. */ - /* */ - /* <Return> */ - /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ - /* */ - FT_CALLBACK_DEF( FT_UInt ) - code_to_index0( TT_CMapTable* cmap, - FT_ULong charCode ) - { - TT_CMap0* cmap0 = &cmap->c.cmap0; - - - return ( charCode <= 0xFF ? cmap0->glyphIdArray[charCode] : 0 ); - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_next0 */ - /* */ - /* <Description> */ - /* Finds the next encoded character after the given one. Uses */ - /* format 0. `charCode' must be in the range 0x00-0xFF (otherwise 0 */ - /* is returned). */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap0 :: A pointer to a cmap table in format 0. */ - /* */ - /* <Return> */ - /* Next char code. 0 if no higher one is encoded. */ - /* */ - FT_CALLBACK_DEF( FT_ULong ) - code_to_next0( TT_CMapTable* cmap, - FT_ULong charCode ) - { - TT_CMap0* cmap0 = &cmap->c.cmap0; - - - while ( ++charCode <= 0xFF ) - if ( cmap0->glyphIdArray[charCode] ) - return ( charCode ); - return ( 0 ); - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_index2 */ - /* */ - /* <Description> */ - /* Converts the character code into a glyph index. Uses format 2. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap2 :: A pointer to a cmap table in format 2. */ - /* */ - /* <Return> */ - /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ - /* */ - FT_CALLBACK_DEF( FT_UInt ) - code_to_index2( TT_CMapTable* cmap, - FT_ULong charCode ) - { - FT_UInt result, index1, offset; - FT_UInt char_lo; - FT_ULong char_hi; - TT_CMap2SubHeader* sh2; - TT_CMap2* cmap2; - - - cmap2 = &cmap->c.cmap2; - result = 0; - char_lo = (FT_UInt)( charCode & 0xFF ); - char_hi = charCode >> 8; - - if ( char_hi == 0 ) - { - /* an 8-bit character code -- we use the subHeader 0 in this case */ - /* to test whether the character code is in the charmap */ - index1 = cmap2->subHeaderKeys[char_lo]; - if ( index1 != 0 ) - return 0; - } - else - { - /* a 16-bit character code */ - index1 = cmap2->subHeaderKeys[char_hi & 0xFF]; - if ( index1 == 0 ) - return 0; - } - - sh2 = cmap2->subHeaders + index1; - char_lo -= sh2->firstCode; - - if ( char_lo < (FT_UInt)sh2->entryCount ) - { - offset = sh2->idRangeOffset / 2 + char_lo; - if ( offset < (FT_UInt)cmap2->numGlyphId ) - { - result = cmap2->glyphIdArray[offset]; - if ( result ) - result = ( result + sh2->idDelta ) & 0xFFFF; - } - } - - return result; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_next2 */ - /* */ - /* <Description> */ - /* Find the next encoded character. Uses format 2. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap2 :: A pointer to a cmap table in format 2. */ - /* */ - /* <Return> */ - /* Next encoded character. 0 if none exists. */ - /* */ - FT_CALLBACK_DEF( FT_ULong ) - code_to_next2( TT_CMapTable* cmap, - FT_ULong charCode ) - { - FT_UInt index1, offset; - FT_UInt char_lo; - FT_ULong char_hi; - TT_CMap2SubHeader* sh2; - TT_CMap2* cmap2; - - - cmap2 = &cmap->c.cmap2; - charCode++; - - /* - * This is relatively simplistic -- look for a subHeader containing - * glyphs and then walk to the first glyph in that subHeader. - */ - while ( charCode < 0x10000 ) - { - char_lo = (FT_UInt)( charCode & 0xFF ); - char_hi = charCode >> 8; - - if ( char_hi == 0 ) - { - /* an 8-bit character code -- we use the subHeader 0 in this case */ - /* to test whether the character code is in the charmap */ - index1 = cmap2->subHeaderKeys[char_lo]; - if ( index1 != 0 ) - { - charCode++; - continue; - } - } - else - { - /* a 16-bit character code */ - index1 = cmap2->subHeaderKeys[char_hi & 0xFF]; - if ( index1 == 0 ) - { - charCode = ( char_hi + 1 ) << 8; - continue; - } - } - - sh2 = cmap2->subHeaders + index1; - char_lo -= sh2->firstCode; - - if ( char_lo > (FT_UInt)sh2->entryCount ) - { - charCode = ( char_hi + 1 ) << 8; - continue; - } - - offset = sh2->idRangeOffset / 2 + char_lo; - if ( offset >= (FT_UInt)cmap2->numGlyphId || - cmap2->glyphIdArray[offset] == 0 ) - { - charCode++; - continue; - } - - return charCode; - } - return 0; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_index4 */ - /* */ - /* <Description> */ - /* Converts the character code into a glyph index. Uses format 4. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap4 :: A pointer to a cmap table in format 4. */ - /* */ - /* <Return> */ - /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ - /* */ - FT_CALLBACK_DEF( FT_UInt ) - code_to_index4( TT_CMapTable* cmap, - FT_ULong charCode ) - { - FT_UInt result, index1, segCount; - TT_CMap4* cmap4; - TT_CMap4Segment *seg4, *limit; - - - cmap4 = &cmap->c.cmap4; - result = 0; - segCount = cmap4->segCountX2 / 2; - limit = cmap4->segments + segCount; - - /* first, check against the last used segment */ - - seg4 = cmap4->last_segment; - - /* the following is equivalent to performing two tests, as in */ - /* */ - /* if ( charCode >= seg4->startCount && charCode <= seg4->endCount ) */ - /* */ - /* This is a bit strange, but it is faster, and the idea behind the */ - /* cache is to significantly speed up charcode to glyph index */ - /* conversion. */ - - if ( (FT_ULong)( charCode - seg4->startCount ) < - (FT_ULong)( seg4->endCount - seg4->startCount ) ) - goto Found1; - - for ( seg4 = cmap4->segments; seg4 < limit; seg4++ ) - { - /* the ranges are sorted in increasing order. If we are out of */ - /* the range here, the char code isn't in the charmap, so exit. */ - - if ( charCode > (FT_UInt)seg4->endCount ) - continue; - - if ( charCode >= (FT_UInt)seg4->startCount ) - goto Found; - } - return 0; - - Found: - cmap4->last_segment = seg4; - - Found1: - /* if the idRangeOffset is 0, we can compute the glyph index */ - /* directly */ - - if ( seg4->idRangeOffset == 0 ) - result = ( charCode + seg4->idDelta ) & 0xFFFF; - else - { - /* otherwise, we must use the glyphIdArray to do it */ - index1 = (FT_UInt)( seg4->idRangeOffset / 2 - + ( charCode - seg4->startCount ) - + ( seg4 - cmap4->segments ) - - segCount ); - - if ( index1 < (FT_UInt)cmap4->numGlyphId && - cmap4->glyphIdArray[index1] != 0 ) - result = ( cmap4->glyphIdArray[index1] + seg4->idDelta ) & 0xFFFF; - } - - return result; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_next4 */ - /* */ - /* <Description> */ - /* Find the next encoded character. Uses format 4. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap :: A pointer to a cmap table in format 4. */ - /* */ - /* <Return> */ - /* Next encoded character. 0 if none exists. */ - /* */ - FT_CALLBACK_DEF( FT_ULong ) - code_to_next4( TT_CMapTable* cmap, - FT_ULong charCode ) - { - FT_UInt index1, segCount; - TT_CMap4* cmap4; - TT_CMap4Segment *seg4, *limit; - - - cmap4 = &cmap->c.cmap4; - segCount = cmap4->segCountX2 / 2; - limit = cmap4->segments + segCount; - - charCode++; - - for ( seg4 = cmap4->segments; seg4 < limit; seg4++ ) - { - /* The ranges are sorted in increasing order. If we are out of */ - /* the range here, the char code isn't in the charmap, so exit. */ - - if ( charCode <= (FT_UInt)seg4->endCount ) - goto Found; - } - return 0; - - Found: - if ( charCode < (FT_ULong) seg4->startCount ) - charCode = seg4->startCount; - - /* if the idRangeOffset is 0, all chars in the map exist */ - - if ( seg4->idRangeOffset == 0 ) - return ( charCode ); - - while ( charCode <= (FT_UInt) seg4->endCount ) - { - /* otherwise, we must use the glyphIdArray to do it */ - index1 = (FT_UInt)( seg4->idRangeOffset / 2 - + ( charCode - seg4->startCount ) - + ( seg4 - cmap4->segments ) - - segCount ); - - if ( index1 < (FT_UInt)cmap4->numGlyphId && - cmap4->glyphIdArray[index1] != 0 ) - return ( charCode ); - charCode++; - } - - return 0; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_index6 */ - /* */ - /* <Description> */ - /* Converts the character code into a glyph index. Uses format 6. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap6 :: A pointer to a cmap table in format 6. */ - /* */ - /* <Return> */ - /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ - /* */ - FT_CALLBACK_DEF( FT_UInt ) - code_to_index6( TT_CMapTable* cmap, - FT_ULong charCode ) - { - TT_CMap6* cmap6; - FT_UInt result = 0; - - - cmap6 = &cmap->c.cmap6; - charCode -= cmap6->firstCode; - - if ( charCode < (FT_UInt)cmap6->entryCount ) - result = cmap6->glyphIdArray[charCode]; - - return result; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_next6 */ - /* */ - /* <Description> */ - /* Find the next encoded character. Uses format 6. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap :: A pointer to a cmap table in format 6. */ - /* */ - /* <Return> */ - /* Next encoded character. 0 if none exists. */ - /* */ - FT_CALLBACK_DEF( FT_ULong ) - code_to_next6( TT_CMapTable* cmap, - FT_ULong charCode ) - { - TT_CMap6* cmap6; - - - charCode++; - - cmap6 = &cmap->c.cmap6; - - if ( charCode < (FT_ULong) cmap6->firstCode ) - charCode = cmap6->firstCode; - - charCode -= cmap6->firstCode; - - while ( charCode < (FT_UInt)cmap6->entryCount ) - { - if ( cmap6->glyphIdArray[charCode] != 0 ) - return charCode + cmap6->firstCode; - charCode++; - } - - return 0; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_index8_12 */ - /* */ - /* <Description> */ - /* Converts the (possibly 32bit) character code into a glyph index. */ - /* Uses format 8 or 12. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap8_12 :: A pointer to a cmap table in format 8 or 12. */ - /* */ - /* <Return> */ - /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ - /* */ - FT_CALLBACK_DEF( FT_UInt ) - code_to_index8_12( TT_CMapTable* cmap, - FT_ULong charCode ) - { - TT_CMap8_12* cmap8_12; - TT_CMapGroup *group, *limit; - - - cmap8_12 = &cmap->c.cmap8_12; - limit = cmap8_12->groups + cmap8_12->nGroups; - - /* first, check against the last used group */ - - group = cmap8_12->last_group; - - /* the following is equivalent to performing two tests, as in */ - /* */ - /* if ( charCode >= group->startCharCode && */ - /* charCode <= group->endCharCode ) */ - /* */ - /* This is a bit strange, but it is faster, and the idea behind the */ - /* cache is to significantly speed up charcode to glyph index */ - /* conversion. */ - - if ( (FT_ULong)( charCode - group->startCharCode ) < - (FT_ULong)( group->endCharCode - group->startCharCode ) ) - goto Found1; - - for ( group = cmap8_12->groups; group < limit; group++ ) - { - /* the ranges are sorted in increasing order. If we are out of */ - /* the range here, the char code isn't in the charmap, so exit. */ - - if ( charCode > group->endCharCode ) - continue; - - if ( charCode >= group->startCharCode ) - goto Found; - } - return 0; - - Found: - cmap8_12->last_group = group; - - Found1: - return group->startGlyphID + (FT_UInt)( charCode - group->startCharCode ); - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_next8_12 */ - /* */ - /* <Description> */ - /* Find the next encoded character. Uses format 8 or 12. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap :: A pointer to a cmap table in format 8 or 12. */ - /* */ - /* <Return> */ - /* Next encoded character. 0 if none exists. */ - /* */ - FT_CALLBACK_DEF( FT_ULong ) - code_to_next8_12( TT_CMapTable* cmap, - FT_ULong charCode ) - { - TT_CMap8_12* cmap8_12; - TT_CMapGroup *group, *limit; - - - charCode++; - cmap8_12 = &cmap->c.cmap8_12; - limit = cmap8_12->groups + cmap8_12->nGroups; - - for ( group = cmap8_12->groups; group < limit; group++ ) - { - /* the ranges are sorted in increasing order. If we are out of */ - /* the range here, the char code isn't in the charmap, so exit. */ - - if ( charCode <= group->endCharCode ) - goto Found; - } - return 0; - - Found: - if ( charCode < group->startCharCode ) - charCode = group->startCharCode; - - return charCode; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_index10 */ - /* */ - /* <Description> */ - /* Converts the (possibly 32bit) character code into a glyph index. */ - /* Uses format 10. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap10 :: A pointer to a cmap table in format 10. */ - /* */ - /* <Return> */ - /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ - /* */ - FT_CALLBACK_DEF( FT_UInt ) - code_to_index10( TT_CMapTable* cmap, - FT_ULong charCode ) - { - TT_CMap10* cmap10; - FT_UInt result = 0; - - - cmap10 = &cmap->c.cmap10; - charCode -= cmap10->startCharCode; - - /* the overflow trick for comparison works here also since the number */ - /* of glyphs (even if numChars is specified as ULong in the specs) in */ - /* an OpenType font is limited to 64k */ - - if ( charCode < cmap10->numChars ) - result = cmap10->glyphs[charCode]; - - return result; - } - - - /*************************************************************************/ - /* */ - /* <Function> */ - /* code_to_next10 */ - /* */ - /* <Description> */ - /* Find the next encoded character. Uses format 10. */ - /* */ - /* <Input> */ - /* charCode :: The wanted character code. */ - /* cmap :: A pointer to a cmap table in format 10. */ - /* */ - /* <Return> */ - /* Next encoded character. 0 if none exists. */ - /* */ - FT_CALLBACK_DEF( FT_ULong ) - code_to_next10( TT_CMapTable* cmap, - FT_ULong charCode ) - { - TT_CMap10* cmap10; - - - charCode++; - cmap10 = &cmap->c.cmap10; - - if ( charCode < cmap10->startCharCode ) - charCode = cmap10->startCharCode; - - charCode -= cmap10->startCharCode; - - /* the overflow trick for comparison works here also since the number */ - /* of glyphs (even if numChars is specified as ULong in the specs) in */ - /* an OpenType font is limited to 64k */ - - while ( charCode < cmap10->numChars ) - { - if ( cmap10->glyphs[charCode] ) - return ( charCode + cmap10->startCharCode ); - charCode++; - } - - return 0; - } - - -/* END */ Index: xc/extras/freetype2/src/sfnt/ttcmap.h diff -u xc/extras/freetype2/src/sfnt/ttcmap.h:1.1.1.4 xc/extras/freetype2/src/sfnt/ttcmap.h:1.1.1.5 --- xc/extras/freetype2/src/sfnt/ttcmap.h:1.1.1.4 Thu Jun 20 04:16:22 2002 +++ xc/extras/freetype2/src/sfnt/ttcmap.h Wed May 28 22:01:55 2003 @@ -28,13 +28,13 @@ FT_LOCAL( FT_Error ) - TT_CharMap_Load( TT_Face face, - TT_CMapTable cmap, - FT_Stream input ); + tt_face_load_charmap( TT_Face face, + TT_CMapTable cmap, + FT_Stream input ); FT_LOCAL( FT_Error ) - TT_CharMap_Free( TT_Face face, - TT_CMapTable cmap ); + tt_face_free_charmap( TT_Face face, + TT_CMapTable cmap ); FT_END_HEADER Index: xc/extras/freetype2/src/sfnt/ttcmap0.c diff -u xc/extras/freetype2/src/sfnt/ttcmap0.c:1.2 xc/extras/freetype2/src/sfnt/ttcmap0.c:1.4 --- xc/extras/freetype2/src/sfnt/ttcmap0.c:1.2 Mon Jul 1 00:53:14 2002 +++ xc/extras/freetype2/src/sfnt/ttcmap0.c Wed May 28 22:13:05 2003 @@ -14,7 +14,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ - +/* $XFree86: xc/extras/freetype2/src/sfnt/ttcmap0.c,v 1.4 2003/05/29 02:13:05 dawes Exp $ */ #include <ft2build.h> #include FT_INTERNAL_DEBUG_H @@ -579,6 +579,12 @@ /* Otherwise, a glyph index is taken from the glyph ids sub-array for */ /* the segment, and the value of `idDelta' is added to it. */ /* */ + /* */ + /* Finally, note that certain fonts contain invalid charmaps that */ + /* contain end=0xFFFF, start=0xFFFF, delta=0x0001, offset=0xFFFF at the */ + /* of their charmaps (e.g. opens___.ttf which comes with OpenOffice.org) */ + /* we need special code to deal with them correctly... */ + /* */ #ifdef TT_CONFIG_CMAP_FORMAT_4 @@ -592,9 +598,19 @@ FT_UInt num_segs; - if ( table + length > valid->limit || length < 16 ) + /* in certain fonts, the `length' field is invalid and goes */ + /* out of bound. We try to correct this here... */ + if ( length < 16 ) FT_INVALID_TOO_SHORT; + if ( table + length > valid->limit ) + { + if ( valid->level >= FT_VALIDATE_TIGHT ) + FT_INVALID_TOO_SHORT; + + length = (FT_UInt)( valid->limit - table ); + } + p = table + 6; num_segs = TT_NEXT_USHORT( p ); /* read segCountX2 */ @@ -680,7 +696,7 @@ FT_INVALID_DATA; } - if ( offset ) + if ( offset && offset != 0xFFFFU ) { p += offset; /* start of glyph id array */ @@ -692,10 +708,10 @@ /* check glyph indices within the segment range */ if ( valid->level >= FT_VALIDATE_TIGHT ) { - FT_UInt idx; + FT_UInt i, idx; - for ( ; start < end; ) + for ( i = start; i < end; i++ ) { idx = FT_NEXT_USHORT( p ); if ( idx != 0 ) @@ -708,6 +724,16 @@ } } } + else if ( offset == 0xFFFFU ) + { + /* Some fonts (erroneously?) use a range offset of 0xFFFF */ + /* to mean missing glyph in cmap table */ + /* */ + if ( valid->level >= FT_VALIDATE_PARANOID || + n != num_segs - 1 || + !( start == 0xFFFFU && end == 0xFFFFU && delta == 0x1U ) ) + FT_INVALID_DATA; + } last = end; } @@ -769,6 +795,9 @@ p += num_segs2; offset = TT_PEEK_USHORT( p ); + if ( offset == 0xFFFFU ) + goto Exit; + if ( offset != 0 ) { p += offset + 2 * ( idx - start ); @@ -813,6 +842,9 @@ p += num_segs2; offset = TT_PEEK_USHORT( p ); + if ( offset == 0xFFFFU ) + goto Exit; + if ( offset != 0 ) { p += offset + 2 * ( idx - start ); @@ -879,7 +911,7 @@ p += num_segs2; offset = TT_PEEK_USHORT( p ); - if ( offset != 0 ) + if ( offset != 0 && offset != 0xFFFFU ) { /* parse the glyph ids array for non-0 index */ p += offset + ( code - start ) * 2; @@ -895,6 +927,12 @@ code++; } } + else if ( offset == 0xFFFFU ) + { + /* an offset of 0xFFFF means an empty glyph in certain fonts! */ + code = end; + break; + } else gindex = (FT_UInt)( code + delta ) & 0xFFFFU; @@ -912,7 +950,7 @@ code++; } - return result; + return (FT_UInt)result; Exit: *pchar_code = result; @@ -971,7 +1009,7 @@ FT_Validator valid ) { FT_Byte* p; - FT_UInt length, start, count; + FT_UInt length, count; if ( table + 10 > valid->limit ) @@ -981,7 +1019,7 @@ length = TT_NEXT_USHORT( p ); p = table + 6; /* skip language */ - start = TT_NEXT_USHORT( p ); + (void) TT_NEXT_USHORT( p ); count = TT_NEXT_USHORT( p ); if ( table + length > valid->limit || length < 10 + count * 2 ) @@ -1253,7 +1291,7 @@ if ( char_code <= end ) { - result = start_id + char_code - start; + result = (FT_UInt)( start_id + char_code - start ); break; } } @@ -1352,7 +1390,7 @@ FT_Validator valid ) { FT_Byte* p = table + 4; - FT_ULong length, start, count; + FT_ULong length, count; if ( table + 20 > valid->limit ) @@ -1360,7 +1398,7 @@ length = TT_NEXT_ULONG( p ); p = table + 12; - start = TT_NEXT_ULONG( p ); + (void) TT_NEXT_ULONG( p ); count = TT_NEXT_ULONG( p ); if ( table + length > valid->limit || length < 20 + count * 2 ) @@ -1408,7 +1446,6 @@ FT_UInt32 *pchar_code ) { FT_Byte* table = cmap->data; - FT_UInt32 result = 0; FT_UInt32 char_code = *pchar_code + 1; FT_UInt gindex = 0; FT_Byte* p = table + 12; @@ -1428,7 +1465,6 @@ gindex = TT_NEXT_USHORT( p ); if ( gindex != 0 ) { - result = char_code; break; } char_code++; @@ -1560,7 +1596,7 @@ if ( char_code <= end ) { - result = start_id + char_code - start; + result = (FT_UInt)( start_id + char_code - start ); break; } } @@ -1628,8 +1664,6 @@ #endif /* TT_CONFIG_CMAP_FORMAT_12 */ -#ifdef FT_CONFIG_OPTION_USE_CMAPS - static const TT_CMap_Class tt_cmap_classes[] = { #ifdef TT_CONFIG_CMAP_FORMAT_0 @@ -1668,12 +1702,12 @@ /* in the current face */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Build_CMaps( TT_Face face ) + tt_face_build_cmaps( TT_Face face ) { FT_Byte* table = face->cmap_table; FT_Byte* limit = table + face->cmap_size; - volatile FT_UInt num_cmaps; - volatile FT_Byte* p = table; + FT_UInt volatile num_cmaps; + FT_Byte* volatile p = table; if ( p + 4 > limit ) @@ -1683,7 +1717,7 @@ if ( TT_NEXT_USHORT( p ) != 0 ) { p -= 2; - FT_ERROR(( "TT_Build_CMaps: unsupported `cmap' table format = %d\n", + FT_ERROR(( "tt_face_build_cmaps: unsupported `cmap' table format = %d\n", TT_PEEK_USHORT( p ) )); return FT_Err_Invalid_Table; } @@ -1699,14 +1733,14 @@ charmap.platform_id = TT_NEXT_USHORT( p ); charmap.encoding_id = TT_NEXT_USHORT( p ); charmap.face = FT_FACE( face ); - charmap.encoding = ft_encoding_none; /* will be filled later */ + charmap.encoding = FT_ENCODING_NONE; /* will be filled later */ offset = TT_NEXT_ULONG( p ); if ( offset && table + offset + 2 < limit ) { FT_Byte* cmap = table + offset; FT_UInt format = TT_PEEK_USHORT( cmap ); - volatile const TT_CMap_Class* pclazz = tt_cmap_classes; + const TT_CMap_Class* volatile pclazz = tt_cmap_classes; TT_CMap_Class clazz; @@ -1721,7 +1755,7 @@ ft_validator_init( FT_VALIDATOR( &valid ), cmap, limit, FT_VALIDATE_DEFAULT ); - valid.num_glyphs = face->root.num_glyphs; + valid.num_glyphs = (FT_UInt)face->root.num_glyphs; if ( ft_setjmp( FT_VALIDATOR( &valid )->jump_buffer ) == 0 ) { @@ -1733,7 +1767,7 @@ (void)FT_CMap_New( (FT_CMap_Class)clazz, cmap, &charmap, NULL ); else { - FT_ERROR(( "TT_Build_CMaps:" )); + FT_ERROR(( "tt_face_build_cmaps:" )); FT_ERROR(( " broken cmap sub-table ignored!\n" )); } } @@ -1744,7 +1778,5 @@ return 0; } -#endif /* FT_CONFIG_OPTION_USE_CMAPS */ - /* END */ Index: xc/extras/freetype2/src/sfnt/ttcmap0.h diff -u xc/extras/freetype2/src/sfnt/ttcmap0.h:1.1.1.1 xc/extras/freetype2/src/sfnt/ttcmap0.h:1.1.1.2 --- xc/extras/freetype2/src/sfnt/ttcmap0.h:1.1.1.1 Thu Jun 20 04:16:22 2002 +++ xc/extras/freetype2/src/sfnt/ttcmap0.h Wed May 28 22:01:56 2003 @@ -54,7 +54,7 @@ { FT_ValidatorRec validator; FT_UInt num_glyphs; - + } TT_ValidatorRec, *TT_Validator; @@ -62,12 +62,8 @@ #define TT_VALID_GLYPH_COUNT( x ) TT_VALIDATOR( x )->num_glyphs -#ifdef FT_CONFIG_OPTION_USE_CMAPS - FT_LOCAL( FT_Error ) - TT_Build_CMaps( TT_Face face ); - -#endif + tt_face_build_cmaps( TT_Face face ); FT_END_HEADER Index: xc/extras/freetype2/src/sfnt/ttload.c diff -u xc/extras/freetype2/src/sfnt/ttload.c:1.1.1.8 xc/extras/freetype2/src/sfnt/ttload.c:1.2 --- xc/extras/freetype2/src/sfnt/ttload.c:1.1.1.8 Thu Jun 20 04:16:22 2002 +++ xc/extras/freetype2/src/sfnt/ttload.c Wed Oct 22 13:26:30 2003 @@ -15,7 +15,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ - +/* $XFree86: xc/extras/freetype2/src/sfnt/ttload.c,v 1.2 2003/10/22 17:26:30 tsi Exp $ */ #include <ft2build.h> #include FT_INTERNAL_DEBUG_H @@ -40,7 +40,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_LookUp_Table */ + /* tt_face_lookup_table */ /* */ /* <Description> */ /* Looks for a TrueType table by name. */ @@ -54,14 +54,14 @@ /* A pointer to the table directory entry. 0 if not found. */ /* */ FT_LOCAL_DEF( TT_Table ) - TT_LookUp_Table( TT_Face face, - FT_ULong tag ) + tt_face_lookup_table( TT_Face face, + FT_ULong tag ) { TT_Table entry; TT_Table limit; - FT_TRACE3(( "TT_LookUp_Table: %08p, `%c%c%c%c' -- ", + FT_TRACE3(( "tt_face_lookup_table: %08p, `%c%c%c%c' -- ", face, (FT_Char)( tag >> 24 ), (FT_Char)( tag >> 16 ), @@ -90,7 +90,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Goto_Table */ + /* tt_face_goto_table */ /* */ /* <Description> */ /* Looks for a TrueType table by name, then seek a stream to it. */ @@ -109,16 +109,16 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Goto_Table( TT_Face face, - FT_ULong tag, - FT_Stream stream, - FT_ULong* length ) + tt_face_goto_table( TT_Face face, + FT_ULong tag, + FT_Stream stream, + FT_ULong* length ) { TT_Table table; FT_Error error; - table = TT_LookUp_Table( face, tag ); + table = tt_face_lookup_table( face, tag ); if ( table ) { if ( length ) @@ -135,10 +135,119 @@ } + /* In theory, we should check the values of `search_range', */ + /* `entry_selector', and `range_shift' to detect non-SFNT based files */ + /* whose header might also start with 0x100000L (yes, these exist). */ + /* */ + /* Very unfortunately, many TrueType fonts don't have these fields */ + /* set correctly and we must ignore them to support them. An alternative */ + /* way to check the font file is thus to: */ + /* */ + /* - check that `num_tables' is valid */ + /* - look for a "head" table, check its size, and parse it to */ + /* see if its "magic" field is correctly set */ + /* */ + /* When checking directory entries, ignore the tables `glyx' and `locx' */ + /* which are hacked-out versions of `glyf' and `loca' in some PostScript */ + /* Type 42 fonts, and will generally be invalid. */ + /* */ + static FT_Error + sfnt_dir_check( FT_Stream stream, + FT_ULong offset, + FT_UInt num_tables ) + { + FT_Error error; + FT_UInt nn, has_head = 0; + + const FT_ULong glyx_tag = FT_MAKE_TAG( 'g', 'l', 'y', 'x' ); + const FT_ULong locx_tag = FT_MAKE_TAG( 'l', 'o', 'c', 'x' ); + + static const FT_Frame_Field sfnt_dir_entry_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_TableRec + + FT_FRAME_START( 16 ), + FT_FRAME_ULONG( Tag ), + FT_FRAME_ULONG( CheckSum ), + FT_FRAME_ULONG( Offset ), + FT_FRAME_ULONG( Length ), + FT_FRAME_END + }; + + + /* if 'num_tables' is 0, read the table count from the file */ + if ( num_tables == 0 ) + { + FT_ULong format_tag; + + if ( FT_STREAM_SEEK( offset ) || + FT_READ_ULONG ( format_tag ) || + FT_READ_USHORT( num_tables ) || + FT_STREAM_SKIP( 6 ) ) + goto Bad_Format; + + (void) format_tag; + + if ( offset + 12 + num_tables*16 > stream->size ) + goto Bad_Format; + } + else if ( FT_STREAM_SEEK( offset + 12 ) ) + goto Bad_Format; + + for ( nn = 0; nn < num_tables; nn++ ) + { + TT_TableRec table; + + + if ( FT_STREAM_READ_FIELDS( sfnt_dir_entry_fields, &table ) ) + goto Bad_Format; + + if ( table.Offset + table.Length > stream->size && + table.Tag != glyx_tag && table.Tag != locx_tag ) + goto Bad_Format; + + if ( table.Tag == TTAG_head ) + { + FT_UInt32 magic; + + + has_head = 1; + + /* the table length should be 0x36, but certain font tools + * make it 0x38, so we will just check that it is greater. + * + * note that according to the specification, + * the table must be padded to 32-bit lengths, but this doesn't + * apply to the value of its "Length" field !! + */ + if ( table.Length < 0x36 || + FT_STREAM_SEEK( table.Offset + 12 ) || + FT_READ_ULONG( magic ) || + magic != 0x5F0F3CF5UL ) + goto Bad_Format; + + if ( FT_STREAM_SEEK( offset + 28 + 16*nn ) ) + goto Bad_Format; + } + } + + if ( has_head == 0 ) + goto Bad_Format; + + Exit: + return error; + + Bad_Format: + error = FT_Err_Unknown_File_Format; + goto Exit; + } + + /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_SFNT_HeaderRec */ + /* tt_face_load_sfnt_header */ /* */ /* <Description> */ /* Loads the header of a SFNT font file. Supports collections. */ @@ -166,16 +275,16 @@ /* values of `search_range', `entry_selector', and `range_shift'. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_SFNT_HeaderRec( TT_Face face, - FT_Stream stream, - FT_Long face_index, - SFNT_Header sfnt ) + tt_face_load_sfnt_header( TT_Face face, + FT_Stream stream, + FT_Long face_index, + SFNT_Header sfnt ) { FT_Error error; - FT_ULong format_tag; + FT_ULong format_tag, offset; FT_Memory memory = stream->memory; - const FT_Frame_Field sfnt_header_fields[] = + static const FT_Frame_Field sfnt_header_fields[] = { #undef FT_STRUCTURE #define FT_STRUCTURE SFNT_HeaderRec @@ -188,7 +297,7 @@ FT_FRAME_END }; - const FT_Frame_Field ttc_header_fields[] = + static const FT_Frame_Field ttc_header_fields[] = { #undef FT_STRUCTURE #define FT_STRUCTURE TTC_HeaderRec @@ -200,7 +309,7 @@ }; - FT_TRACE2(( "TT_Load_SFNT_HeaderRec: %08p, %ld\n", + FT_TRACE2(( "tt_face_load_sfnt_header: %08p, %ld\n", face, face_index )); face->ttc_header.tag = 0; @@ -213,6 +322,8 @@ /* file is a TrueType collection, otherwise it can be any other */ /* kind of font. */ /* */ + offset = FT_STREAM_POS(); + if ( FT_READ_ULONG( format_tag ) ) goto Exit; @@ -221,7 +332,7 @@ FT_Int n; - FT_TRACE3(( "TT_Load_SFNT_HeaderRec: file is a collection\n" )); + FT_TRACE3(( "tt_face_load_sfnt_header: file is a collection\n" )); /* It is a TrueType collection, i.e. a file containing several */ /* font files. Read the font directory now */ @@ -246,32 +357,26 @@ } /* seek to the appropriate TrueType file, then read tag */ - if ( FT_STREAM_SEEK( face->ttc_header.offsets[face_index] ) || + offset = face->ttc_header.offsets[face_index]; + + if ( FT_STREAM_SEEK( offset ) || FT_READ_LONG( format_tag ) ) goto Exit; } /* the format tag was read, now check the rest of the header */ sfnt->format_tag = format_tag; + sfnt->offset = offset; + if ( FT_STREAM_READ_FIELDS( sfnt_header_fields, sfnt ) ) goto Exit; - /* now, check the values of `num_tables', `seach_range', etc. */ + /* now check the sfnt directory */ + error = sfnt_dir_check( stream, offset, sfnt->num_tables ); + if ( error ) { - FT_UInt num_tables = sfnt->num_tables; - FT_ULong entry_selector = 1L << sfnt->entry_selector; - - - /* IMPORTANT: Many fonts have an incorrect `search_range' value, so */ - /* we only check the `entry_selector' correctness here. */ - /* */ - if ( num_tables == 0 || - entry_selector > num_tables || - entry_selector * 2 <= num_tables ) - { - FT_TRACE2(( "TT_Load_SFNT_HeaderRec: file is not SFNT!\n" )); - error = SFNT_Err_Unknown_File_Format; - } + FT_TRACE2(( "tt_face_load_sfnt_header: file is not SFNT!\n" )); + error = SFNT_Err_Unknown_File_Format; } Exit: @@ -282,7 +387,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Directory */ + /* tt_face_load_directory */ /* */ /* <Description> */ /* Loads the table directory into a face object. */ @@ -302,9 +407,9 @@ /* The stream cursor must be at the font file's origin. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_Directory( TT_Face face, - FT_Stream stream, - SFNT_Header sfnt ) + tt_face_load_directory( TT_Face face, + FT_Stream stream, + SFNT_Header sfnt ) { FT_Error error; FT_Memory memory = stream->memory; @@ -312,7 +417,7 @@ TT_TableRec *entry, *limit; - FT_TRACE2(( "TT_Load_Directory: %08p\n", face )); + FT_TRACE2(( "tt_face_load_directory: %08p\n", face )); FT_TRACE2(( "-- Tables count: %12u\n", sfnt->num_tables )); FT_TRACE2(( "-- Format version: %08lx\n", sfnt->format_tag )); @@ -322,7 +427,8 @@ if ( FT_NEW_ARRAY( face->dir_tables, face->num_tables ) ) goto Exit; - if ( FT_FRAME_ENTER( face->num_tables * 16L ) ) + if ( FT_STREAM_SEEK( sfnt->offset + 12 ) || + FT_FRAME_ENTER( face->num_tables * 16L ) ) goto Exit; entry = face->dir_tables; @@ -356,7 +462,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Any */ + /* tt_face_load_any */ /* */ /* <Description> */ /* Loads any font table into client memory. */ @@ -394,11 +500,11 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_Any( TT_Face face, - FT_ULong tag, - FT_Long offset, - FT_Byte* buffer, - FT_ULong* length ) + tt_face_load_any( TT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ) { FT_Error error; FT_Stream stream; @@ -409,7 +515,7 @@ if ( tag != 0 ) { /* look for tag in font directory */ - table = TT_LookUp_Table( face, tag ); + table = tt_face_lookup_table( face, tag ); if ( !table ) { error = SFNT_Err_Table_Missing; @@ -446,7 +552,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Generic_Header */ + /* tt_face_load_generic_header */ /* */ /* <Description> */ /* Loads the TrueType table `head' or `bhed'. */ @@ -460,9 +566,9 @@ /* FreeType error code. 0 means success. */ /* */ static FT_Error - TT_Load_Generic_Header( TT_Face face, - FT_Stream stream, - FT_ULong tag ) + tt_face_load_generic_header( TT_Face face, + FT_Stream stream, + FT_ULong tag ) { FT_Error error; TT_Header* header; @@ -496,7 +602,7 @@ }; - FT_TRACE2(( "TT_Load_Generic_Header: " + FT_TRACE2(( "tt_face_load_generic_header: " "%08p, looking up font table `%c%c%c%c'.\n", face, (FT_Char)( tag >> 24 ), @@ -507,7 +613,7 @@ error = face->goto_table( face, tag, stream, 0 ); if ( error ) { - FT_TRACE2(( "TT_Load_Generic_Header: Font table is missing!\n" )); + FT_TRACE2(( "tt_face_load_generic_header: Font table is missing!\n" )); goto Exit; } @@ -518,7 +624,7 @@ FT_TRACE2(( " Units per EM: %8u\n", header->Units_Per_EM )); FT_TRACE2(( " IndexToLoc: %8d\n", header->Index_To_Loc_Format )); - FT_TRACE2(( "TT_Load_Generic_Header: Font table loaded.\n" )); + FT_TRACE2(( "tt_face_load_generic_header: Font table loaded.\n" )); Exit: return error; @@ -526,20 +632,20 @@ FT_LOCAL_DEF( FT_Error ) - TT_Load_Header( TT_Face face, - FT_Stream stream ) + tt_face_load_header( TT_Face face, + FT_Stream stream ) { - return TT_Load_Generic_Header( face, stream, TTAG_head ); + return tt_face_load_generic_header( face, stream, TTAG_head ); } #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS FT_LOCAL_DEF( FT_Error ) - TT_Load_Bitmap_Header( TT_Face face, - FT_Stream stream ) + tt_face_load_bitmap_header( TT_Face face, + FT_Stream stream ) { - return TT_Load_Generic_Header( face, stream, TTAG_bhed ); + return tt_face_load_generic_header( face, stream, TTAG_bhed ); } #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ @@ -548,7 +654,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_MaxProfile */ + /* tt_face_load_max_profile */ /* */ /* <Description> */ /* Loads the maximum profile into a face object. */ @@ -562,8 +668,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_MaxProfile( TT_Face face, - FT_Stream stream ) + tt_face_load_max_profile( TT_Face face, + FT_Stream stream ) { FT_Error error; TT_MaxProfile* maxProfile = &face->max_profile; @@ -670,7 +776,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Metrics */ + /* tt_face_load_metrics */ /* */ /* <Description> */ /* Loads the horizontal or vertical metrics table into a face object. */ @@ -686,9 +792,9 @@ /* FreeType error code. 0 means success. */ /* */ static FT_Error - TT_Load_Metrics( TT_Face face, - FT_Stream stream, - FT_Bool vertical ) + tt_face_load_metrics( TT_Face face, + FT_Stream stream, + FT_Bool vertical ) { FT_Error error; FT_Memory memory = stream->memory; @@ -733,6 +839,20 @@ error = face->goto_table( face, TTAG_hmtx, stream, &table_len ); if ( error ) { + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + /* If this is an incrementally loaded font and there are */ + /* overriding metrics tolerate a missing 'hmtx' table. */ + if ( face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs-> + get_glyph_metrics ) + { + face->horizontal.number_Of_HMetrics = 0; + error = SFNT_Err_Ok; + goto Exit; + } +#endif + FT_ERROR(( " no horizontal metrics in file!\n" )); error = SFNT_Err_Hmtx_Table_Missing; goto Exit; @@ -813,7 +933,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Metrics_Header */ + /* tt_face_load_metrics_header */ /* */ /* <Description> */ /* Loads the horizontal or vertical header in a face object. */ @@ -829,9 +949,9 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_Metrics_Header( TT_Face face, - FT_Stream stream, - FT_Bool vertical ) + tt_face_load_metrics_header( TT_Face face, + FT_Stream stream, + FT_Bool vertical ) { FT_Error error; TT_HoriHeader* header; @@ -905,7 +1025,7 @@ /* Now try to load the corresponding metrics */ - error = TT_Load_Metrics( face, stream, vertical ); + error = tt_face_load_metrics( face, stream, vertical ); Exit: return error; @@ -915,7 +1035,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Names */ + /* tt_face_load_names */ /* */ /* <Description> */ /* Loads the name records. */ @@ -929,8 +1049,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_Names( TT_Face face, - FT_Stream stream ) + tt_face_load_names( TT_Face face, + FT_Stream stream ) { FT_Error error; FT_Memory memory = stream->memory; @@ -987,7 +1107,7 @@ if ( FT_STREAM_READ_FIELDS( name_table_fields, table ) ) goto Exit; - /* Some popular asian fonts have an invalid `storageOffset' value */ + /* Some popular Asian fonts have an invalid `storageOffset' value */ /* (it should be at least "6 + 12*num_names"). However, the string */ /* offsets, computed as "storageOffset + entry->stringOffset", are */ /* valid pointers within the name table... */ @@ -999,7 +1119,7 @@ if ( storage_start > storage_limit ) { - FT_ERROR(( "TT_Load_Names: invalid `name' table\n" )); + FT_ERROR(( "tt_face_load_names: invalid `name' table\n" )); error = SFNT_Err_Name_Table_Missing; goto Exit; } @@ -1041,7 +1161,7 @@ entry++; } - table->numNameRecords = entry - table->names; + table->numNameRecords = (FT_UInt)( entry - table->names ); } FT_FRAME_EXIT(); @@ -1059,7 +1179,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Free_Names */ + /* tt_face_free_names */ /* */ /* <Description> */ /* Frees the name records. */ @@ -1068,7 +1188,7 @@ /* face :: A handle to the target face object. */ /* */ FT_LOCAL_DEF( void ) - TT_Free_Names( TT_Face face ) + tt_face_free_names( TT_Face face ) { FT_Memory memory = face->root.driver->root.memory; TT_NameTable table = &face->name_table; @@ -1094,7 +1214,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_CMap */ + /* tt_face_load_cmap */ /* */ /* <Description> */ /* Loads the cmap directory in a face object. The cmaps itselves are */ @@ -1109,11 +1229,9 @@ /* FreeType error code. 0 means success. */ /* */ -#ifdef FT_CONFIG_OPTION_USE_CMAPS - FT_LOCAL_DEF( FT_Error ) - TT_Load_CMap( TT_Face face, - FT_Stream stream ) + tt_face_load_cmap( TT_Face face, + FT_Stream stream ) { FT_Error error; @@ -1138,111 +1256,12 @@ return error; } -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - FT_LOCAL_DEF( FT_Error ) - TT_Load_CMap( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - FT_Memory memory = stream->memory; - FT_Long table_start; - TT_CMapDirRec cmap_dir; - - const FT_Frame_Field cmap_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_CMapDirRec - - FT_FRAME_START( 4 ), - FT_FRAME_USHORT( tableVersionNumber ), - FT_FRAME_USHORT( numCMaps ), - FT_FRAME_END - }; - - const FT_Frame_Field cmap_rec_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_CMapTableRec - - FT_FRAME_START( 4 ), - FT_FRAME_USHORT( format ), - FT_FRAME_USHORT( length ), - FT_FRAME_END - }; - - - FT_TRACE2(( "CMaps " )); - - error = face->goto_table( face, TTAG_cmap, stream, 0 ); - if ( error ) - { - error = SFNT_Err_CMap_Table_Missing; - goto Exit; - } - - table_start = FT_STREAM_POS(); - - if ( FT_STREAM_READ_FIELDS( cmap_fields, &cmap_dir ) ) - goto Exit; - - /* reserve space in face table for cmap tables */ - if ( FT_NEW_ARRAY( face->charmaps, cmap_dir.numCMaps ) ) - goto Exit; - - face->num_charmaps = cmap_dir.numCMaps; - { - TT_CharMap charmap = face->charmaps; - TT_CharMap limit = charmap + face->num_charmaps; - - - /* read the header of each charmap first */ - if ( FT_FRAME_ENTER( face->num_charmaps * 8L ) ) - goto Exit; - - for ( ; charmap < limit; charmap++ ) - { - TT_CMapTable cmap; - - - charmap->root.face = (FT_Face)face; - cmap = &charmap->cmap; - - cmap->loaded = FALSE; - cmap->platformID = FT_GET_USHORT(); - cmap->platformEncodingID = FT_GET_USHORT(); - cmap->offset = (FT_ULong)FT_GET_LONG(); - } - - FT_FRAME_EXIT(); - - /* now read the rest of each table */ - for ( charmap = face->charmaps; charmap < limit; charmap++ ) - { - TT_CMapTable cmap = &charmap->cmap; - - - if ( FT_STREAM_SEEK( table_start + (FT_Long)cmap->offset ) || - FT_STREAM_READ_FIELDS( cmap_rec_fields, cmap ) ) - goto Exit; - - cmap->offset = FT_STREAM_POS(); - } - } - - FT_TRACE2(( "loaded\n" )); - - Exit: - return error; - } - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_OS2 */ + /* tt_face_load_os2 */ /* */ /* <Description> */ /* Loads the OS2 table. */ @@ -1256,8 +1275,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_OS2( TT_Face face, - FT_Stream stream ) + tt_face_load_os2( TT_Face face, + FT_Stream stream ) { FT_Error error; TT_OS2* os2; @@ -1385,7 +1404,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Postscript */ + /* tt_face_load_postscript */ /* */ /* <Description> */ /* Loads the Postscript table. */ @@ -1399,8 +1418,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_PostScript( TT_Face face, - FT_Stream stream ) + tt_face_load_postscript( TT_Face face, + FT_Stream stream ) { FT_Error error; TT_Postscript* post = &face->postscript; @@ -1444,7 +1463,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_PCLT */ + /* tt_face_load_pclt */ /* */ /* <Description> */ /* Loads the PCL 5 Table. */ @@ -1458,8 +1477,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_PCLT( TT_Face face, - FT_Stream stream ) + tt_face_load_pclt( TT_Face face, + FT_Stream stream ) { static const FT_Frame_Field pclt_fields[] = { @@ -1512,7 +1531,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Gasp */ + /* tt_face_load_gasp */ /* */ /* <Description> */ /* Loads the `gasp' table into a face object. */ @@ -1526,8 +1545,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_Gasp( TT_Face face, - FT_Stream stream ) + tt_face_load_gasp( TT_Face face, + FT_Stream stream ) { FT_Error error; FT_Memory memory = stream->memory; @@ -1536,7 +1555,7 @@ TT_GaspRange gaspranges; - FT_TRACE2(( "TT_Load_Gasp: %08p\n", face )); + FT_TRACE2(( "tt_face_load_gasp: %08p\n", face )); /* the gasp table is optional */ error = face->goto_table( face, TTAG_gasp, stream, 0 ); @@ -1587,7 +1606,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Kern */ + /* tt_face_load_kern */ /* */ /* <Description> */ /* Loads the first kerning table with format 0 in the font. Only */ @@ -1604,8 +1623,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_Kern( TT_Face face, - FT_Stream stream ) + tt_face_load_kern( TT_Face face, + FT_Stream stream ) { FT_Error error; FT_Memory memory = stream->memory; @@ -1740,7 +1759,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_Hdmx */ + /* tt_face_load_hdmx */ /* */ /* <Description> */ /* Loads the horizontal device metrics table. */ @@ -1754,8 +1773,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_Hdmx( TT_Face face, - FT_Stream stream ) + tt_face_load_hdmx( TT_Face face, + FT_Stream stream ) { FT_Error error; FT_Memory memory = stream->memory; @@ -1823,7 +1842,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Free_Hdmx */ + /* tt_face_free_hdmx */ /* */ /* <Description> */ /* Frees the horizontal device metrics table. */ @@ -1832,7 +1851,7 @@ /* face :: A handle to the target face object. */ /* */ FT_LOCAL_DEF( void ) - TT_Free_Hdmx( TT_Face face ) + tt_face_free_hdmx( TT_Face face ) { if ( face ) { Index: xc/extras/freetype2/src/sfnt/ttload.h diff -u xc/extras/freetype2/src/sfnt/ttload.h:1.1.1.4 xc/extras/freetype2/src/sfnt/ttload.h:1.1.1.5 --- xc/extras/freetype2/src/sfnt/ttload.h:1.1.1.4 Thu Jun 20 04:16:22 2002 +++ xc/extras/freetype2/src/sfnt/ttload.h Wed May 28 22:01:56 2003 @@ -30,101 +30,101 @@ FT_LOCAL( TT_Table ) - TT_LookUp_Table( TT_Face face, - FT_ULong tag ); + tt_face_lookup_table( TT_Face face, + FT_ULong tag ); FT_LOCAL( FT_Error ) - TT_Goto_Table( TT_Face face, - FT_ULong tag, - FT_Stream stream, - FT_ULong* length ); + tt_face_goto_table( TT_Face face, + FT_ULong tag, + FT_Stream stream, + FT_ULong* length ); FT_LOCAL( FT_Error ) - TT_Load_SFNT_HeaderRec( TT_Face face, - FT_Stream stream, - FT_Long face_index, - SFNT_Header sfnt ); + tt_face_load_sfnt_header( TT_Face face, + FT_Stream stream, + FT_Long face_index, + SFNT_Header sfnt ); FT_LOCAL( FT_Error ) - TT_Load_Directory( TT_Face face, - FT_Stream stream, - SFNT_Header sfnt ); + tt_face_load_directory( TT_Face face, + FT_Stream stream, + SFNT_Header sfnt ); FT_LOCAL( FT_Error ) - TT_Load_Any( TT_Face face, - FT_ULong tag, - FT_Long offset, - FT_Byte* buffer, - FT_ULong* length ); + tt_face_load_any( TT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ); FT_LOCAL( FT_Error ) - TT_Load_Header( TT_Face face, - FT_Stream stream ); + tt_face_load_header( TT_Face face, + FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_Metrics_Header( TT_Face face, - FT_Stream stream, - FT_Bool vertical ); + tt_face_load_metrics_header( TT_Face face, + FT_Stream stream, + FT_Bool vertical ); FT_LOCAL( FT_Error ) - TT_Load_CMap( TT_Face face, - FT_Stream stream ); + tt_face_load_cmap( TT_Face face, + FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_MaxProfile( TT_Face face, - FT_Stream stream ); + tt_face_load_max_profile( TT_Face face, + FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_Names( TT_Face face, - FT_Stream stream ); + tt_face_load_names( TT_Face face, + FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_OS2( TT_Face face, - FT_Stream stream ); + tt_face_load_os2( TT_Face face, + FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_PostScript( TT_Face face, - FT_Stream stream ); + tt_face_load_postscript( TT_Face face, + FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_Hdmx( TT_Face face, - FT_Stream stream ); + tt_face_load_hdmx( TT_Face face, + FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_PCLT( TT_Face face, - FT_Stream stream ); + tt_face_load_pclt( TT_Face face, + FT_Stream stream ); FT_LOCAL( void ) - TT_Free_Names( TT_Face face ); + tt_face_free_names( TT_Face face ); FT_LOCAL( void ) - TT_Free_Hdmx ( TT_Face face ); + tt_face_free_hdmx ( TT_Face face ); FT_LOCAL( FT_Error ) - TT_Load_Kern( TT_Face face, - FT_Stream stream ); + tt_face_load_kern( TT_Face face, + FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_Gasp( TT_Face face, - FT_Stream stream ); + tt_face_load_gasp( TT_Face face, + FT_Stream stream ); #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS FT_LOCAL( FT_Error ) - TT_Load_Bitmap_Header( TT_Face face, - FT_Stream stream ); + tt_face_load_bitmap_header( TT_Face face, + FT_Stream stream ); #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ Index: xc/extras/freetype2/src/sfnt/ttpost.c diff -u xc/extras/freetype2/src/sfnt/ttpost.c:1.1.1.5 xc/extras/freetype2/src/sfnt/ttpost.c:1.1.1.6 --- xc/extras/freetype2/src/sfnt/ttpost.c:1.1.1.5 Thu Jun 20 04:16:22 2002 +++ xc/extras/freetype2/src/sfnt/ttpost.c Wed May 28 22:01:56 2003 @@ -62,11 +62,11 @@ /* table of Mac names. Thus, it is possible to build a version of */ /* FreeType without the Type 1 driver & PSNames module. */ -#define MAC_NAME( x ) TT_Post_Default_Names[x] +#define MAC_NAME( x ) tt_post_default_names[x] /* the 258 default Mac PS glyph names */ - FT_String* TT_Post_Default_Names[258] = + static const FT_String* tt_post_default_names[258] = { /* 0 */ ".notdef", ".null", "CR", "space", "exclam", @@ -153,7 +153,7 @@ static FT_Error - Load_Format_20( TT_Face face, + load_format_20( TT_Face face, FT_Stream stream ) { FT_Memory memory = stream->memory; @@ -271,7 +271,7 @@ static FT_Error - Load_Format_25( TT_Face face, + load_format_25( TT_Face face, FT_Stream stream ) { FT_Memory memory = stream->memory; @@ -334,7 +334,7 @@ static FT_Error - Load_Post_Names( TT_Face face ) + load_post_names( TT_Face face ) { FT_Stream stream; FT_Error error; @@ -356,19 +356,12 @@ goto Exit; /* now read postscript table */ - switch ( format ) - { - case 0x00020000L: - error = Load_Format_20( face, stream ); - break; - - case 0x00028000L: - error = Load_Format_25( face, stream ); - break; - - default: + if ( format == 0x00020000L ) + error = load_format_20( face, stream ); + else if ( format == 0x00028000L ) + error = load_format_25( face, stream ); + else error = SFNT_Err_Invalid_File_Format; - } face->postscript_names.loaded = 1; @@ -378,42 +371,39 @@ FT_LOCAL_DEF( void ) - TT_Free_Post_Names( TT_Face face ) + tt_face_free_ps_names( TT_Face face ) { FT_Memory memory = face->root.memory; TT_Post_Names names = &face->postscript_names; + FT_Fixed format; if ( names->loaded ) { - switch ( face->postscript.FormatType ) - { - case 0x00020000L: - { - TT_Post_20 table = &names->names.format_20; - FT_UShort n; + format = face->postscript.FormatType; + if ( format == 0x00020000L ) + { + TT_Post_20 table = &names->names.format_20; + FT_UShort n; - FT_FREE( table->glyph_indices ); - table->num_glyphs = 0; - for ( n = 0; n < table->num_names; n++ ) - FT_FREE( table->glyph_names[n] ); + FT_FREE( table->glyph_indices ); + table->num_glyphs = 0; - FT_FREE( table->glyph_names ); - table->num_names = 0; - } - break; + for ( n = 0; n < table->num_names; n++ ) + FT_FREE( table->glyph_names[n] ); - case 0x00028000L: - { - TT_Post_25 table = &names->names.format_25; + FT_FREE( table->glyph_names ); + table->num_names = 0; + } + else if ( format == 0x00028000L ) + { + TT_Post_25 table = &names->names.format_25; - FT_FREE( table->offsets ); - table->num_glyphs = 0; - } - break; + FT_FREE( table->offsets ); + table->num_glyphs = 0; } } names->loaded = 0; @@ -423,7 +413,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Get_PS_Name */ + /* tt_face_get_ps_name */ /* */ /* <Description> */ /* Gets the PostScript glyph name of a glyph. */ @@ -442,12 +432,13 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Get_PS_Name( TT_Face face, - FT_UInt idx, - FT_String** PSname ) + tt_face_get_ps_name( TT_Face face, + FT_UInt idx, + FT_String** PSname ) { FT_Error error; TT_Post_Names names; + FT_Fixed format; #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES PSNames_Service psnames; @@ -471,62 +462,58 @@ /* `.notdef' by default */ *PSname = MAC_NAME( 0 ); - switch ( face->postscript.FormatType ) + format = face->postscript.FormatType; + + if ( format == 0x00010000L ) { - case 0x00010000L: if ( idx < 258 ) /* paranoid checking */ *PSname = MAC_NAME( idx ); - break; + } + else if ( format == 0x00020000L ) + { + TT_Post_20 table = &names->names.format_20; - case 0x00020000L: + + if ( !names->loaded ) { - TT_Post_20 table = &names->names.format_20; + error = load_post_names( face ); + if ( error ) + goto End; + } + if ( idx < (FT_UInt)table->num_glyphs ) + { + FT_UShort name_index = table->glyph_indices[idx]; - if ( !names->loaded ) - { - error = Load_Post_Names( face ); - if ( error ) - break; - } - if ( idx < (FT_UInt)table->num_glyphs ) - { - FT_UShort name_index = table->glyph_indices[idx]; + if ( name_index < 258 ) + *PSname = MAC_NAME( name_index ); + else + *PSname = (FT_String*)table->glyph_names[name_index - 258]; + } + } + else if ( format == 0x00028000L ) + { + TT_Post_25 table = &names->names.format_25; - if ( name_index < 258 ) - *PSname = MAC_NAME( name_index ); - else - *PSname = (FT_String*)table->glyph_names[name_index - 258]; - } + if ( !names->loaded ) + { + error = load_post_names( face ); + if ( error ) + goto End; } - break; - case 0x00028000L: + if ( idx < (FT_UInt)table->num_glyphs ) /* paranoid checking */ { - TT_Post_25 table = &names->names.format_25; - - - if ( !names->loaded ) - { - error = Load_Post_Names( face ); - if ( error ) - break; - } - - if ( idx < (FT_UInt)table->num_glyphs ) /* paranoid checking */ - { - idx += table->offsets[idx]; - *PSname = MAC_NAME( idx ); - } + idx += table->offsets[idx]; + *PSname = MAC_NAME( idx ); } - break; - - case 0x00030000L: - break; /* nothing to do */ } + + /* nothing to do for format == 0x00030000L */ + End: return SFNT_Err_Ok; } Index: xc/extras/freetype2/src/sfnt/ttpost.h diff -u xc/extras/freetype2/src/sfnt/ttpost.h:1.1.1.5 xc/extras/freetype2/src/sfnt/ttpost.h:1.1.1.6 --- xc/extras/freetype2/src/sfnt/ttpost.h:1.1.1.5 Thu Jun 20 04:16:22 2002 +++ xc/extras/freetype2/src/sfnt/ttpost.h Wed May 28 22:01:56 2003 @@ -30,12 +30,12 @@ FT_LOCAL( FT_Error ) - TT_Get_PS_Name( TT_Face face, - FT_UInt idx, - FT_String** PSname ); + tt_face_get_ps_name( TT_Face face, + FT_UInt idx, + FT_String** PSname ); FT_LOCAL( void ) - TT_Free_Post_Names( TT_Face face ); + tt_face_free_ps_names( TT_Face face ); FT_END_HEADER Index: xc/extras/freetype2/src/sfnt/ttsbit.c diff -u xc/extras/freetype2/src/sfnt/ttsbit.c:1.1.1.7 xc/extras/freetype2/src/sfnt/ttsbit.c:1.1.1.8 --- xc/extras/freetype2/src/sfnt/ttsbit.c:1.1.1.7 Thu Jun 20 04:16:23 2002 +++ xc/extras/freetype2/src/sfnt/ttsbit.c Wed May 28 22:01:56 2003 @@ -377,7 +377,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_SBit_Strikes */ + /* tt_face_load_sbit_strikes */ /* */ /* <Description> */ /* Loads the table of embedded bitmap sizes for this face. */ @@ -391,8 +391,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_SBit_Strikes( TT_Face face, - FT_Stream stream ) + tt_face_load_sbit_strikes( TT_Face face, + FT_Stream stream ) { FT_Error error = 0; FT_Memory memory = stream->memory; @@ -471,7 +471,7 @@ if ( version != 0x00020000L || num_strikes >= 0x10000L ) { - FT_ERROR(( "TT_Load_SBit_Strikes: invalid table version!\n" )); + FT_ERROR(( "tt_face_load_sbit_strikes: invalid table version!\n" )); error = SFNT_Err_Invalid_File_Format; goto Exit; @@ -577,7 +577,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Free_SBit_Strikes */ + /* tt_face_free_sbit_strikes */ /* */ /* <Description> */ /* Releases the embedded bitmap tables. */ @@ -586,7 +586,7 @@ /* face :: The target face object. */ /* */ FT_LOCAL_DEF( void ) - TT_Free_SBit_Strikes( TT_Face face ) + tt_face_free_sbit_strikes( TT_Face face ) { FT_Memory memory = face->root.memory; TT_SBit_Strike strike = face->sbit_strikes; @@ -621,12 +621,12 @@ FT_LOCAL_DEF( FT_Error ) - TT_Set_SBit_Strike( TT_Face face, - FT_Int x_ppem, - FT_Int y_ppem, - FT_ULong *astrike_index ) + tt_face_set_sbit_strike( TT_Face face, + FT_Int x_ppem, + FT_Int y_ppem, + FT_ULong *astrike_index ) { - FT_Int i; + FT_ULong i; if ( x_ppem < 0 || x_ppem > 255 || @@ -651,7 +651,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* Find_SBit_Range */ + /* find_sbit_range */ /* */ /* <Description> */ /* Scans a given strike's ranges and return, for a given glyph */ @@ -671,7 +671,7 @@ /* FreeType error code. 0 means the glyph index was found. */ /* */ static FT_Error - Find_SBit_Range( FT_UInt glyph_index, + find_sbit_range( FT_UInt glyph_index, TT_SBit_Strike strike, TT_SBit_Range *arange, FT_ULong *aglyph_offset ) @@ -754,7 +754,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* Find_SBit_Image */ + /* find_sbit_image */ /* */ /* <Description> */ /* Checks whether an embedded bitmap (an `sbit') exists for a given */ @@ -780,7 +780,7 @@ /* glyph. */ /* */ static FT_Error - Find_SBit_Image( TT_Face face, + find_sbit_image( TT_Face face, FT_UInt glyph_index, FT_ULong strike_index, TT_SBit_Range *arange, @@ -791,13 +791,13 @@ TT_SBit_Strike strike; - if ( !face->sbit_strikes || - ( face->num_sbit_strikes <= (FT_Int)strike_index ) ) + if ( !face->sbit_strikes || + ( face->num_sbit_strikes <= strike_index ) ) goto Fail; strike = &face->sbit_strikes[strike_index]; - error = Find_SBit_Range( glyph_index, strike, + error = find_sbit_range( glyph_index, strike, arange, aglyph_offset ); if ( error ) goto Fail; @@ -819,7 +819,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* Load_SBit_Metrics */ + /* load_sbit_metrics */ /* */ /* <Description> */ /* Gets the big metrics for a given SBit. */ @@ -844,7 +844,7 @@ /* function exit. */ /* */ static FT_Error - Load_SBit_Metrics( FT_Stream stream, + load_sbit_metrics( FT_Stream stream, TT_SBit_Range range, TT_SBit_Metrics metrics ) { @@ -918,7 +918,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* Crop_Bitmap */ + /* crop_bitmap */ /* */ /* <Description> */ /* Crops a bitmap to its tightest bounding box, and adjusts its */ @@ -930,7 +930,7 @@ /* metrics :: The corresponding metrics structure. */ /* */ static void - Crop_Bitmap( FT_Bitmap* map, + crop_bitmap( FT_Bitmap* map, TT_SBit_Metrics metrics ) { /***********************************************************************/ @@ -1116,7 +1116,7 @@ map->width = 0; map->rows = 0; map->pitch = 0; - map->pixel_mode = ft_pixel_mode_mono; + map->pixel_mode = FT_PIXEL_MODE_MONO; } @@ -1212,29 +1212,30 @@ TT_SBit_Range range, FT_ULong ebdt_pos, FT_ULong glyph_offset, - FT_Bitmap* map, + FT_GlyphSlot slot, FT_Int x_offset, FT_Int y_offset, FT_Stream stream, - TT_SBit_Metrics metrics ) + TT_SBit_Metrics metrics, + FT_Int depth ) { - FT_Memory memory = stream->memory; - FT_Error error; + FT_Memory memory = stream->memory; + FT_Bitmap* map = &slot->bitmap; + FT_Error error; /* place stream at beginning of glyph data and read metrics */ if ( FT_STREAM_SEEK( ebdt_pos + glyph_offset ) ) goto Exit; - error = Load_SBit_Metrics( stream, range, metrics ); + error = load_sbit_metrics( stream, range, metrics ); if ( error ) goto Exit; - /* this function is recursive. At the top-level call, the */ - /* field map.buffer is NULL. We thus begin by finding the */ - /* dimensions of the higher-level glyph to allocate the */ - /* final pixmap buffer */ - if ( map->buffer == 0 ) + /* this function is recursive. At the top-level call, we */ + /* compute the dimensions of the higher-level glyph to */ + /* allocate the final pixmap buffer */ + if ( depth == 0 ) { FT_Long size; @@ -1245,22 +1246,22 @@ switch ( strike->bit_depth ) { case 1: - map->pixel_mode = ft_pixel_mode_mono; + map->pixel_mode = FT_PIXEL_MODE_MONO; map->pitch = ( map->width + 7 ) >> 3; break; case 2: - map->pixel_mode = ft_pixel_mode_pal2; + map->pixel_mode = FT_PIXEL_MODE_GRAY2; map->pitch = ( map->width + 3 ) >> 2; break; case 4: - map->pixel_mode = ft_pixel_mode_pal4; + map->pixel_mode = FT_PIXEL_MODE_GRAY4; map->pitch = ( map->width + 1 ) >> 1; break; case 8: - map->pixel_mode = ft_pixel_mode_grays; + map->pixel_mode = FT_PIXEL_MODE_GRAY; map->pitch = map->width; break; @@ -1274,7 +1275,8 @@ if ( size == 0 ) goto Exit; /* exit successfully! */ - if ( FT_ALLOC( map->buffer, size ) ) + error = ft_glyphslot_alloc_bitmap( slot, size ); + if (error) goto Exit; } @@ -1336,7 +1338,7 @@ /* find the range for this element */ - error = Find_SBit_Range( comp->glyph_code, + error = find_sbit_range( comp->glyph_code, strike, &elem_range, &elem_offset ); @@ -1348,11 +1350,12 @@ elem_range, ebdt_pos, elem_offset, - map, + slot, x_offset + comp->x_offset, y_offset + comp->y_offset, stream, - &elem_metrics ); + &elem_metrics, + depth+1 ); if ( error ) goto Fail_Memory; } @@ -1369,7 +1372,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* TT_Load_SBit_Image */ + /* tt_face_load_sbit_image */ /* */ /* <Description> */ /* Loads a given glyph sbit image from the font resource. This also */ @@ -1400,16 +1403,15 @@ /* The `map.buffer' field is always freed before the glyph is loaded. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_SBit_Image( TT_Face face, - FT_ULong strike_index, - FT_UInt glyph_index, - FT_UInt load_flags, - FT_Stream stream, - FT_Bitmap *map, - TT_SBit_MetricsRec *metrics ) + tt_face_load_sbit_image( TT_Face face, + FT_ULong strike_index, + FT_UInt glyph_index, + FT_UInt load_flags, + FT_Stream stream, + FT_Bitmap *map, + TT_SBit_MetricsRec *metrics ) { FT_Error error; - FT_Memory memory = stream->memory; FT_ULong ebdt_pos, glyph_offset; TT_SBit_Strike strike; @@ -1417,7 +1419,7 @@ /* Check whether there is a glyph sbit for the current index */ - error = Find_SBit_Image( face, glyph_index, strike_index, + error = find_sbit_image( face, glyph_index, strike_index, &range, &strike, &glyph_offset ); if ( error ) goto Exit; @@ -1432,20 +1434,11 @@ ebdt_pos = FT_STREAM_POS(); - /* clear the bitmap & load the bitmap */ - if ( face->root.glyph->flags & FT_GLYPH_OWN_BITMAP ) - FT_FREE( map->buffer ); - - map->rows = map->pitch = map->width = 0; - error = Load_SBit_Image( strike, range, ebdt_pos, glyph_offset, - map, 0, 0, stream, metrics ); + face->root.glyph, 0, 0, stream, metrics, 0 ); if ( error ) goto Exit; - /* the glyph slot owns this bitmap buffer */ - face->root.glyph->flags |= FT_GLYPH_OWN_BITMAP; - /* setup vertical metrics if needed */ if ( strike->flags & 1 ) { @@ -1464,7 +1457,7 @@ /* Crop the bitmap now, unless specified otherwise */ if ( load_flags & FT_LOAD_CROP_BITMAP ) - Crop_Bitmap( map, metrics ); + crop_bitmap( map, metrics ); Exit: return error; Index: xc/extras/freetype2/src/sfnt/ttsbit.h diff -u xc/extras/freetype2/src/sfnt/ttsbit.h:1.1.1.4 xc/extras/freetype2/src/sfnt/ttsbit.h:1.1.1.5 --- xc/extras/freetype2/src/sfnt/ttsbit.h:1.1.1.4 Thu Jun 20 04:16:23 2002 +++ xc/extras/freetype2/src/sfnt/ttsbit.h Wed May 28 22:01:56 2003 @@ -28,27 +28,27 @@ FT_LOCAL( FT_Error ) - TT_Load_SBit_Strikes( TT_Face face, - FT_Stream stream ); + tt_face_load_sbit_strikes( TT_Face face, + FT_Stream stream ); FT_LOCAL( void ) - TT_Free_SBit_Strikes( TT_Face face ); + tt_face_free_sbit_strikes( TT_Face face ); FT_LOCAL( FT_Error ) - TT_Set_SBit_Strike( TT_Face face, - FT_Int x_ppem, - FT_Int y_ppem, - FT_ULong *astrike_index ); + tt_face_set_sbit_strike( TT_Face face, + FT_Int x_ppem, + FT_Int y_ppem, + FT_ULong *astrike_index ); FT_LOCAL( FT_Error ) - TT_Load_SBit_Image( TT_Face face, - FT_ULong strike_index, - FT_UInt glyph_index, - FT_UInt load_flags, - FT_Stream stream, - FT_Bitmap *map, - TT_SBit_MetricsRec *metrics ); + tt_face_load_sbit_image( TT_Face face, + FT_ULong strike_index, + FT_UInt glyph_index, + FT_UInt load_flags, + FT_Stream stream, + FT_Bitmap *map, + TT_SBit_MetricsRec *metrics ); FT_END_HEADER Index: xc/extras/freetype2/src/smooth/Jamfile diff -u xc/extras/freetype2/src/smooth/Jamfile:1.1.1.1 xc/extras/freetype2/src/smooth/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/smooth/Jamfile:1.1.1.1 Sun Sep 9 22:56:07 2001 +++ xc/extras/freetype2/src/smooth/Jamfile Wed May 28 22:01:56 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/smooth Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src smooth ; - -SubDirHdrs [ FT2_SubDir src smooth ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) smooth ; { local _sources ; Index: xc/extras/freetype2/src/smooth/ftgrays.c diff -u xc/extras/freetype2/src/smooth/ftgrays.c:1.1.1.7 xc/extras/freetype2/src/smooth/ftgrays.c:1.1.1.8 --- xc/extras/freetype2/src/smooth/ftgrays.c:1.1.1.7 Thu Jun 20 04:16:23 2002 +++ xc/extras/freetype2/src/smooth/ftgrays.c Wed May 28 22:01:57 2003 @@ -22,18 +22,18 @@ /* put the files `ftgrays.h' and `ftimage.h' into the current */ /* compilation directory. Typically, you could do something like */ /* */ - /* - copy `src/base/ftgrays.c' to your current directory */ + /* - copy `src/smooth/ftgrays.c' (this file) to your current directory */ /* */ - /* - copy `include/freetype/ftimage.h' and `include/freetype/ftgrays.h' */ - /* to the same directory */ + /* - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the */ + /* same directory */ /* */ /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */ /* */ /* cc -c -D_STANDALONE_ ftgrays.c */ /* */ /* The renderer can be initialized with a call to */ - /* `ft_gray_raster.gray_raster_new'; an anti-aliased bitmap can be */ - /* generated with a call to `ft_gray_raster.gray_raster_render'. */ + /* `ft_gray_raster.raster_new'; an anti-aliased bitmap can be generated */ + /* with a call to `ft_gray_raster.raster_render'. */ /* */ /* See the comments and documentation in the file `ftimage.h' for more */ /* details on how the raster works. */ @@ -106,14 +106,19 @@ #include <limits.h> #define FT_UINT_MAX UINT_MAX -#define ft_setjmp setjmp -#define ft_longjmp longjmp -#define ft_jmp_buf jmp_buf +#define ft_memset memset + +#define ft_setjmp setjmp +#define ft_longjmp longjmp +#define ft_jmp_buf jmp_buf #define ErrRaster_Invalid_Mode -2 #define ErrRaster_Invalid_Outline -1 +#define FT_BEGIN_HEADER +#define FT_END_HEADER + #include "ftimage.h" #include "ftgrays.h" @@ -156,6 +161,10 @@ #define FT_MEM_SET( d, s, c ) ft_memset( d, s, c ) #endif +#ifndef FT_MEM_ZERO +#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count ) +#endif + /* define this to dump debugging information */ #define xxxDEBUG_GRAYS @@ -192,8 +201,8 @@ #define ONE_PIXEL ( 1L << PIXEL_BITS ) #define PIXEL_MASK ( -1L << PIXEL_BITS ) -#define TRUNC( x ) ( (x) >> PIXEL_BITS ) -#define SUBPIXELS( x ) ( (x) << PIXEL_BITS ) +#define TRUNC( x ) ( (TCoord)((x) >> PIXEL_BITS) ) +#define SUBPIXELS( x ) ( (TPos)(x) << PIXEL_BITS ) #define FLOOR( x ) ( (x) & -ONE_PIXEL ) #define CEILING( x ) ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL ) #define ROUND( x ) ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL ) @@ -210,7 +219,7 @@ /* increases the number of cells available in the render pool but slows */ /* down the rendering a bit. It is useful if you have a really tiny */ /* render pool. */ -#undef GRAYS_COMPACT +#undef GRAYS_COMPACT /*************************************************************************/ @@ -280,8 +289,8 @@ int max_cells; int num_cells; - TCoord min_ex, max_ex; - TCoord min_ey, max_ey; + TPos min_ex, max_ex; + TPos min_ey, max_ey; TArea area; int cover; @@ -291,7 +300,7 @@ TCoord cx, cy; TPos x, y; - TCoord last_ey; + TPos last_ey; FT_Vector bez_stack[32 * 3 + 1]; int lev_stack[32]; @@ -316,7 +325,7 @@ ft_jmp_buf jump_buffer; #ifdef GRAYS_USE_GAMMA - FT_Byte gamma[257]; + unsigned char gamma[257]; #endif } TRaster, *PRaster; @@ -399,8 +408,8 @@ ft_longjmp( ras.jump_buffer, 1 ); cell = ras.cells + ras.num_cells++; - cell->x = ras.ex - ras.min_ex; - cell->y = ras.ey - ras.min_ey; + cell->x = (TCoord)(ras.ex - ras.min_ex); + cell->y = (TCoord)(ras.ey - ras.min_ey); cell->area = ras.area; cell->cover = ras.cover; } @@ -437,7 +446,7 @@ /* All cells that are on the left of the clipping region go to the */ /* min_ex - 1 horizontal position. */ if ( ex < ras.min_ex ) - ex = ras.min_ex - 1; + ex = (TCoord)(ras.min_ex - 1); /* if our position is new, then record the previous cell */ if ( ex != ras.ex || ey != ras.ey ) @@ -473,7 +482,7 @@ TCoord ey ) { if ( ex < ras.min_ex ) - ex = ras.min_ex - 1; + ex = (TCoord)(ras.min_ex - 1); ras.area = 0; ras.cover = 0; @@ -506,8 +515,8 @@ ex1 = TRUNC( x1 ); /* if (ex1 >= ras.max_ex) ex1 = ras.max_ex-1; */ ex2 = TRUNC( x2 ); /* if (ex2 >= ras.max_ex) ex2 = ras.max_ex-1; */ - fx1 = x1 - SUBPIXELS( ex1 ); - fx2 = x2 - SUBPIXELS( ex2 ); + fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) ); + fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) ); /* trivial case. Happens often */ if ( y1 == y2 ) @@ -541,12 +550,12 @@ dx = -dx; } - delta = p / dx; - mod = p % dx; + delta = (TCoord)( p / dx ); + mod = (TCoord)( p % dx ); if ( mod < 0 ) { delta--; - mod += dx; + mod += (TCoord)dx; } ras.area += (TArea)( fx1 + first ) * delta; @@ -559,12 +568,12 @@ if ( ex1 != ex2 ) { p = ONE_PIXEL * ( y2 - y1 + delta ); - lift = p / dx; - rem = p % dx; + lift = (TCoord)( p / dx ); + rem = (TCoord)( p % dx ); if ( rem < 0 ) { lift--; - rem += dx; + rem += (TCoord)dx; } mod -= dx; @@ -575,7 +584,7 @@ mod += rem; if ( mod >= 0 ) { - mod -= dx; + mod -= (TCoord)dx; delta++; } @@ -603,13 +612,14 @@ { TCoord ey1, ey2, fy1, fy2; TPos dx, dy, x, x2; - int p, rem, mod, lift, delta, first, incr; + long p, first; + int delta, rem, mod, lift, incr; ey1 = TRUNC( ras.last_ey ); ey2 = TRUNC( to_y ); /* if (ey2 >= ras.max_ey) ey2 = ras.max_ey-1; */ - fy1 = ras.y - ras.last_ey; - fy2 = to_y - SUBPIXELS( ey2 ); + fy1 = (TCoord)( ras.y - ras.last_ey ); + fy2 = (TCoord)( to_y - SUBPIXELS( ey2 ) ); dx = to_x - ras.x; dy = to_y - ras.y; @@ -646,7 +656,7 @@ if ( dx == 0 ) { TCoord ex = TRUNC( ras.x ); - TCoord two_fx = ( ras.x - SUBPIXELS( ex ) ) << 1; + TCoord two_fx = (TCoord)( ( ras.x - SUBPIXELS( ex ) ) << 1 ); TPos area; @@ -657,16 +667,16 @@ incr = -1; } - delta = first - fy1; + delta = (int)( first - fy1 ); ras.area += (TArea)two_fx * delta; ras.cover += delta; ey1 += incr; gray_set_cell( raster, ex, ey1 ); - delta = first + first - ONE_PIXEL; + delta = (int)( first + first - ONE_PIXEL ); area = (TArea)two_fx * delta; - while( ey1 != ey2 ) + while ( ey1 != ey2 ) { ras.area += area; ras.cover += delta; @@ -674,7 +684,7 @@ gray_set_cell( raster, ex, ey1 ); } - delta = fy2 - ONE_PIXEL + first; + delta = (int)( fy2 - ONE_PIXEL + first ); ras.area += (TArea)two_fx * delta; ras.cover += delta; goto End; @@ -693,16 +703,16 @@ dy = -dy; } - delta = p / dy; - mod = p % dy; + delta = (int)( p / dy ); + mod = (int)( p % dy ); if ( mod < 0 ) { delta--; - mod += dy; + mod += (TCoord)dy; } x = ras.x + delta; - gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, x, first ); + gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, x, (TCoord)first ); ey1 += incr; gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 ); @@ -710,14 +720,14 @@ if ( ey1 != ey2 ) { p = ONE_PIXEL * dx; - lift = p / dy; - rem = p % dy; + lift = (int)( p / dy ); + rem = (int)( p % dy ); if ( rem < 0 ) { lift--; - rem += dy; + rem += (int)dy; } - mod -= dy; + mod -= (int)dy; while ( ey1 != ey2 ) { @@ -725,12 +735,14 @@ mod += rem; if ( mod >= 0 ) { - mod -= dy; + mod -= (int)dy; delta++; } x2 = x + delta; - gray_render_scanline( RAS_VAR_ ey1, x, ONE_PIXEL - first, x2, first ); + gray_render_scanline( RAS_VAR_ ey1, x, + (TCoord)( ONE_PIXEL - first ), x2, + (TCoord)first ); x = x2; ey1 += incr; @@ -738,7 +750,9 @@ } } - gray_render_scanline( RAS_VAR_ ey1, x, ONE_PIXEL - first, to_x, fy2 ); + gray_render_scanline( RAS_VAR_ ey1, x, + (TCoord)( ONE_PIXEL - first ), to_x, + fy2 ); End: ras.x = to_x; @@ -843,7 +857,7 @@ if ( y < min ) min = y; if ( y > max ) max = y; - if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < 0 ) + if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) goto Draw; gray_split_conic( arc ); @@ -1284,11 +1298,11 @@ for ( ; count > 0; count--, spans++ ) { - FT_UInt coverage = spans->coverage; + unsigned char coverage = spans->coverage; #ifdef GRAYS_USE_GAMMA - coverage = raster->gamma[(FT_Byte)coverage]; + coverage = raster->gamma[coverage]; #endif if ( coverage ) @@ -1352,12 +1366,12 @@ /* */ /* the coverage percentage is area/(PIXEL_BITS*PIXEL_BITS*2) */ /* */ - coverage = area >> ( PIXEL_BITS * 2 + 1 - 8); /* use range 0..256 */ - + coverage = (int)( area >> ( PIXEL_BITS * 2 + 1 - 8 ) ); + /* use range 0..256 */ if ( coverage < 0 ) coverage = -coverage; - if ( ras.outline.flags & ft_outline_even_odd_fill ) + if ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) { coverage &= 511; @@ -1373,9 +1387,8 @@ coverage = 255; } - - y += ras.min_ey; - x += ras.min_ex; + y += (TCoord)ras.min_ey; + x += (TCoord)ras.min_ex; if ( coverage ) { @@ -1489,15 +1502,15 @@ /* draw a gray span between the start cell and the current one */ if ( cur->x > x ) gray_hline( RAS_VAR_ x, y, - cover * ( ONE_PIXEL * 2 ), cur->x - x ); + cover * ( ONE_PIXEL * 2 ), cur->x - x ); } else { /* draw a gray span until the end of the clipping region */ if ( cover && x < ras.max_ex - ras.min_ex ) gray_hline( RAS_VAR_ x, y, - cover * ( ONE_PIXEL * 2 ), - ras.max_ex - x - ras.min_ex ); + cover * ( ONE_PIXEL * 2 ), + (int)( ras.max_ex - x - ras.min_ex ) ); cover = 0; } @@ -1584,14 +1597,14 @@ FT_Vector* limit; char* tags; - int n; /* index of contour in outline */ - int first; /* index of first point in contour */ - int error; - char tag; /* current point's state */ + int n; /* index of contour in outline */ + int first; /* index of first point in contour */ + int error; + char tag; /* current point's state */ #if 0 - int shift = func_interface->shift; - FT_Pos delta = func_interface->delta; + int shift = func_interface->shift; + TPos delta = func_interface->delta; #endif @@ -1618,14 +1631,14 @@ tag = FT_CURVE_TAG( tags[0] ); /* A contour cannot start with a cubic control point! */ - if ( tag == FT_Curve_Tag_Cubic ) + if ( tag == FT_CURVE_TAG_CUBIC ) goto Invalid_Outline; /* check first point to determine origin */ - if ( tag == FT_Curve_Tag_Conic ) + if ( tag == FT_CURVE_TAG_CONIC ) { /* first point is conic control. Yes, this happens. */ - if ( FT_CURVE_TAG( outline->tags[last] ) == FT_Curve_Tag_On ) + if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON ) { /* start at last point if it is on the curve */ v_start = v_last; @@ -1657,7 +1670,7 @@ tag = FT_CURVE_TAG( tags[0] ); switch ( tag ) { - case FT_Curve_Tag_On: /* emit a single line_to */ + case FT_CURVE_TAG_ON: /* emit a single line_to */ { FT_Vector vec; @@ -1671,7 +1684,7 @@ continue; } - case FT_Curve_Tag_Conic: /* consume conic arcs */ + case FT_CURVE_TAG_CONIC: /* consume conic arcs */ { v_control.x = SCALED( point->x ); v_control.y = SCALED( point->y ); @@ -1690,7 +1703,7 @@ vec.x = SCALED( point->x ); vec.y = SCALED( point->y ); - if ( tag == FT_Curve_Tag_On ) + if ( tag == FT_CURVE_TAG_ON ) { error = func_interface->conic_to( &v_control, &vec, user ); if ( error ) @@ -1698,7 +1711,7 @@ continue; } - if ( tag != FT_Curve_Tag_Conic ) + if ( tag != FT_CURVE_TAG_CONIC ) goto Invalid_Outline; v_middle.x = ( v_control.x + vec.x ) / 2; @@ -1716,13 +1729,13 @@ goto Close; } - default: /* FT_Curve_Tag_Cubic */ + default: /* FT_CURVE_TAG_CUBIC */ { FT_Vector vec1, vec2; if ( point + 1 > limit || - FT_CURVE_TAG( tags[1] ) != FT_Curve_Tag_Cubic ) + FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) goto Invalid_Outline; point += 2; @@ -1775,7 +1788,7 @@ typedef struct TBand_ { - FT_Pos min, max; + TPos min, max; } TBand; @@ -1813,11 +1826,11 @@ static int gray_convert_glyph( RAS_ARG ) { - TBand bands[40]; - volatile TBand* band; - volatile int n, num_bands; - volatile TPos min, max, max_y; - FT_BBox* clip; + TBand bands[40]; + TBand* volatile band; + int volatile n, num_bands; + TPos volatile min, max, max_y; + FT_BBox* clip; /* Set up state in the raster object */ @@ -1856,7 +1869,7 @@ } /* setup vertical bands */ - num_bands = ( ras.max_ey - ras.min_ey ) / ras.band_size; + num_bands = (int)( ( ras.max_ey - ras.min_ey ) / ras.band_size ); if ( num_bands == 0 ) num_bands = 1; if ( num_bands >= 39 ) num_bands = 39; @@ -1877,8 +1890,8 @@ while ( band >= bands ) { - FT_Pos bottom, top, middle; - int error; + TPos bottom, top, middle; + int error; ras.num_cells = 0; @@ -1969,16 +1982,16 @@ return ErrRaster_Invalid_Outline; /* if direct mode is not set, we must have a target bitmap */ - if ( ( params->flags & ft_raster_flag_direct ) == 0 && + if ( ( params->flags & FT_RASTER_FLAG_DIRECT ) == 0 && ( !target_map || !target_map->buffer ) ) return -1; /* this version does not support monochrome rendering */ - if ( !( params->flags & ft_raster_flag_aa ) ) + if ( !( params->flags & FT_RASTER_FLAG_AA ) ) return ErrRaster_Invalid_Mode; /* compute clipping box */ - if ( ( params->flags & ft_raster_flag_direct ) == 0 ) + if ( ( params->flags & FT_RASTER_FLAG_DIRECT ) == 0 ) { /* compute clip box from target pixmap */ ras.clip_box.xMin = 0; @@ -1986,7 +1999,7 @@ ras.clip_box.xMax = target_map->width; ras.clip_box.yMax = target_map->rows; } - else if ( params->flags & ft_raster_flag_clip ) + else if ( params->flags & FT_RASTER_FLAG_CLIP ) { ras.clip_box = params->clip_box; } @@ -2008,7 +2021,7 @@ ras.render_span = (FT_Raster_Span_Func)gray_render_span; ras.render_span_data = &ras; - if ( params->flags & ft_raster_flag_direct ) + if ( params->flags & FT_RASTER_FLAG_DIRECT ) { ras.render_span = (FT_Raster_Span_Func)params->gray_spans; ras.render_span_data = params->user; @@ -2033,7 +2046,7 @@ static void grays_init_gamma( PRaster raster ) { - FT_UInt x, a; + unsigned int x, a; for ( x = 0; x < 256; x++ ) @@ -2044,7 +2057,7 @@ a = M_Y + ( ( x - M_X ) * ( M_MAX - M_Y ) + ( M_MAX - M_X ) / 2 ) / ( M_MAX - M_X ); - raster->gamma[x] = (FT_Byte)a; + raster->gamma[x] = (unsigned char)a; } } @@ -2062,7 +2075,7 @@ *araster = (FT_Raster)&the_raster; - FT_MEM_SET( &the_raster, 0, sizeof ( the_raster ) ); + FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) ); #ifdef GRAYS_USE_GAMMA grays_init_gamma( (PRaster)*araster ); @@ -2127,13 +2140,13 @@ if ( raster && pool_base && pool_size >= 4096 ) gray_init_cells( rast, (char*)pool_base, pool_size ); - rast->band_size = ( pool_size / sizeof ( TCell ) ) / 8; + rast->band_size = (int)( ( pool_size / sizeof ( TCell ) ) / 8 ); } const FT_Raster_Funcs ft_grays_raster = { - ft_glyph_format_outline, + FT_GLYPH_FORMAT_OUTLINE, (FT_Raster_New_Func) gray_raster_new, (FT_Raster_Reset_Func) gray_raster_reset, Index: xc/extras/freetype2/src/smooth/ftsmooth.c diff -u xc/extras/freetype2/src/smooth/ftsmooth.c:1.1.1.6 xc/extras/freetype2/src/smooth/ftsmooth.c:1.1.1.7 --- xc/extras/freetype2/src/smooth/ftsmooth.c:1.1.1.6 Thu Jun 20 04:16:23 2002 +++ xc/extras/freetype2/src/smooth/ftsmooth.c Wed May 28 22:01:57 2003 @@ -85,7 +85,7 @@ FT_GlyphSlot slot, FT_BBox* cbox ) { - FT_MEM_SET( cbox, 0, sizeof ( *cbox ) ); + FT_MEM_ZERO( cbox, sizeof ( *cbox ) ); if ( slot->format == render->glyph_format ) FT_Outline_Get_CBox( &slot->outline, cbox ); @@ -94,10 +94,13 @@ /* convert a slot's glyph image into a bitmap */ static FT_Error - ft_smooth_render( FT_Renderer render, - FT_GlyphSlot slot, - FT_UInt mode, - FT_Vector* origin ) + ft_smooth_render_generic( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + FT_Vector* origin, + FT_Render_Mode required_mode, + FT_Int hmul, + FT_Int vmul ) { FT_Error error; FT_Outline* outline = NULL; @@ -117,7 +120,7 @@ } /* check mode */ - if ( mode != ft_render_mode_normal ) + if ( mode != required_mode ) return Smooth_Err_Cannot_Render_Glyph; outline = &slot->outline; @@ -148,7 +151,16 @@ /* allocate new one, depends on pixel format */ pitch = width; - bitmap->pixel_mode = ft_pixel_mode_grays; + if ( hmul ) + { + width = width * hmul; + pitch = ( width + 3 ) & -4; + } + + if ( vmul ) + height *= vmul; + + bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; bitmap->num_grays = 256; bitmap->width = width; bitmap->rows = height; @@ -165,19 +177,49 @@ /* set up parameters */ params.target = bitmap; params.source = outline; - params.flags = ft_raster_flag_aa; + params.flags = FT_RASTER_FLAG_AA; + + /* implode outline if needed */ + { + FT_Int n; + FT_Vector* vec; + + + if ( hmul ) + for ( vec = outline->points, n = 0; n < outline->n_points; n++, vec++ ) + vec->x *= hmul; + + if ( vmul ) + for ( vec = outline->points, n = 0; n < outline->n_points; n++, vec++ ) + vec->y *= vmul; + } /* render outline into the bitmap */ error = render->raster_render( render->raster, ¶ms ); - + + /* deflate outline if needed */ + { + FT_Int n; + FT_Vector* vec; + + + if ( hmul ) + for ( vec = outline->points, n = 0; n < outline->n_points; n++, vec++ ) + vec->x /= hmul; + + if ( vmul ) + for ( vec = outline->points, n = 0; n < outline->n_points; n++, vec++ ) + vec->y /= vmul; + } + FT_Outline_Translate( outline, cbox.xMin, cbox.yMin ); if ( error ) goto Exit; - slot->format = ft_glyph_format_bitmap; - slot->bitmap_left = cbox.xMin >> 6; - slot->bitmap_top = cbox.yMax >> 6; + slot->format = FT_GLYPH_FORMAT_BITMAP; + slot->bitmap_left = (FT_Int)( cbox.xMin >> 6 ); + slot->bitmap_top = (FT_Int)( cbox.yMax >> 6 ); Exit: if ( outline && origin ) @@ -187,6 +229,57 @@ } + /* convert a slot's glyph image into a bitmap */ + static FT_Error + ft_smooth_render( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + FT_Vector* origin ) + { + return ft_smooth_render_generic( render, slot, mode, origin, + FT_RENDER_MODE_NORMAL, + 0, 0 ); + } + + + /* convert a slot's glyph image into a horizontal LCD bitmap */ + static FT_Error + ft_smooth_render_lcd( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + FT_Vector* origin ) + { + FT_Error error; + + error = ft_smooth_render_generic( render, slot, mode, origin, + FT_RENDER_MODE_LCD, + 3, 0 ); + if ( !error ) + slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD; + + return error; + } + + + /* convert a slot's glyph image into a vertical LCD bitmap */ + static FT_Error + ft_smooth_render_lcd_v( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + FT_Vector* origin ) + { + FT_Error error; + + error = ft_smooth_render_generic( render, slot, mode, origin, + FT_RENDER_MODE_LCD_V, + 0, 3 ); + if ( !error ) + slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD_V; + + return error; + } + + FT_CALLBACK_TABLE_DEF const FT_Renderer_Class ft_smooth_renderer_class = { @@ -205,12 +298,71 @@ (FT_Module_Requester) 0 }, - ft_glyph_format_outline, + FT_GLYPH_FORMAT_OUTLINE, + + (FT_Renderer_RenderFunc) ft_smooth_render, + (FT_Renderer_TransformFunc)ft_smooth_transform, + (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, + (FT_Renderer_SetModeFunc) ft_smooth_set_mode, + + (FT_Raster_Funcs*) &ft_grays_raster + }; + + + FT_CALLBACK_TABLE_DEF + const FT_Renderer_Class ft_smooth_lcd_renderer_class = + { + { + ft_module_renderer, + sizeof( FT_RendererRec ), + + "smooth-lcd", + 0x10000L, + 0x20000L, + + 0, /* module specific interface */ + + (FT_Module_Constructor)ft_smooth_init, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 + }, + + FT_GLYPH_FORMAT_OUTLINE, + + (FT_Renderer_RenderFunc) ft_smooth_render_lcd, + (FT_Renderer_TransformFunc)ft_smooth_transform, + (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, + (FT_Renderer_SetModeFunc) ft_smooth_set_mode, + + (FT_Raster_Funcs*) &ft_grays_raster + }; + + + + FT_CALLBACK_TABLE_DEF + const FT_Renderer_Class ft_smooth_lcdv_renderer_class = + { + { + ft_module_renderer, + sizeof( FT_RendererRec ), + + "smooth-lcdv", + 0x10000L, + 0x20000L, + + 0, /* module specific interface */ + + (FT_Module_Constructor)ft_smooth_init, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 + }, + + FT_GLYPH_FORMAT_OUTLINE, - (FTRenderer_render) ft_smooth_render, - (FTRenderer_transform)ft_smooth_transform, - (FTRenderer_getCBox) ft_smooth_get_cbox, - (FTRenderer_setMode) ft_smooth_set_mode, + (FT_Renderer_RenderFunc) ft_smooth_render_lcd_v, + (FT_Renderer_TransformFunc)ft_smooth_transform, + (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, + (FT_Renderer_SetModeFunc) ft_smooth_set_mode, (FT_Raster_Funcs*) &ft_grays_raster }; Index: xc/extras/freetype2/src/smooth/ftsmooth.h diff -u xc/extras/freetype2/src/smooth/ftsmooth.h:1.1.1.3 xc/extras/freetype2/src/smooth/ftsmooth.h:1.1.1.4 --- xc/extras/freetype2/src/smooth/ftsmooth.h:1.1.1.3 Sun Dec 16 12:49:33 2001 +++ xc/extras/freetype2/src/smooth/ftsmooth.h Wed May 28 22:01:57 2003 @@ -33,9 +33,14 @@ #ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_renderer_class; + + FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_lcd_renderer_class; + + FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_lcd_v_renderer_class; #endif + FT_END_HEADER #endif /* __FTSMOOTH_H__ */ Index: xc/extras/freetype2/src/tools/cordic.py diff -u xc/extras/freetype2/src/tools/cordic.py:1.3 xc/extras/freetype2/src/tools/cordic.py:1.4 --- xc/extras/freetype2/src/tools/cordic.py:1.3 Thu Jun 20 04:25:28 2002 +++ xc/extras/freetype2/src/tools/cordic.py Wed May 28 22:13:05 2003 @@ -1,7 +1,7 @@ # compute arctangent table for CORDIC computations in fttrigon.c import sys, math -units = 180*65536 # don't change !! +units = 64*65536.0 # don't change !! scale = units/math.pi shrink = 1.0 comma = "" Index: xc/extras/freetype2/src/tools/docmaker.py diff -u xc/extras/freetype2/src/tools/docmaker.py:1.1.1.2 xc/extras/freetype2/src/tools/docmaker.py:removed --- xc/extras/freetype2/src/tools/docmaker.py:1.1.1.2 Mon Jan 14 11:52:23 2002 +++ xc/extras/freetype2/src/tools/docmaker.py Sat Feb 28 21:40:20 2004 @@ -1,1665 +0,0 @@ -#!/usr/bin/env python -# -# DocMaker 0.1 (c) 2000-2001 David Turner <david@freetype.org> -# -# DocMaker is a very simple program used to generate the API Reference -# of programs by extracting comments from source files, and generating -# the equivalent HTML documentation. -# -# DocMaker is very similar to other tools like Doxygen, with the -# following differences: -# -# - It is written in Python (so it is slow, but easy to maintain and -# improve). -# -# - The comment syntax used by DocMaker is simpler and makes for -# clearer comments. -# -# Of course, it doesn't have all the goodies of most similar tools, -# (e.g. C++ class hierarchies), but hey, it is only 2000 lines of -# Python. -# -# DocMaker is mainly used to generate the API references of several -# FreeType packages. -# -# - David -# - -import fileinput, sys, os, time, string, glob, getopt - -# The Project's title. This can be overridden from the command line with -# the options "-t" or "--title". -# -project_title = "Project" - -# The project's filename prefix. This can be set from the command line with -# the options "-p" or "--prefix" -# -project_prefix = "" - -# The project's documentation output directory. This can be set from the -# command line with the options "-o" or "--output". -# -output_dir = None - - -# The following defines the HTML header used by all generated pages. -# -html_header_1 = """\ -<html> -<header> -<title>""" - -html_header_2= """ API Reference - - - - -

""" - -html_header_3=""" API Reference

-""" - -# This is recomputed later when the project title changes. -# -html_header = html_header_1 + project_title + html_header_2 + project_title + html_header_3 - - -# The HTML footer used by all generated pages. -# -html_footer = """\ - -""" - -# The header and footer used for each section. -# -section_title_header = "

" -section_title_footer = "

" - -# The header and footer used for code segments. -# -code_header = "
"
-code_footer = "
" - -# Paragraph header and footer. -# -para_header = "

" -para_footer = "

" - -# Block header and footer. -# -block_header = "
" -block_footer = "

" - -# Description header/footer. -# -description_header = "
" -description_footer = "

" - -# Marker header/inter/footer combination. -# -marker_header = "
" -marker_inter = "
" -marker_footer = "
" - -# Source code extracts header/footer. -# -source_header = "
"
-source_footer = "

" - -# Chapter header/inter/footer. -# -chapter_header = "

" -chapter_inter = "

    " -chapter_footer = "
" - -current_section = None - - -# This function is used to sort the index. It is a simple lexicographical -# sort, except that it places capital letters before lowercase ones. -# -def index_sort( s1, s2 ): - if not s1: - return -1 - - if not s2: - return 1 - - l1 = len( s1 ) - l2 = len( s2 ) - m1 = string.lower( s1 ) - m2 = string.lower( s2 ) - - for i in range( l1 ): - if i >= l2 or m1[i] > m2[i]: - return 1 - - if m1[i] < m2[i]: - return -1 - - if s1[i] < s2[i]: - return -1 - - if s1[i] > s2[i]: - return 1 - - if l2 > l1: - return -1 - - return 0 - - -# Sort input_list, placing the elements of order_list in front. -# -def sort_order_list( input_list, order_list ): - new_list = order_list[:] - for id in input_list: - if not id in order_list: - new_list.append( id ) - return new_list - - -# Translate a single line of source to HTML. This will convert -# a "<" into "<.", ">" into ">.", etc. -# -def html_quote( line ): - result = string.replace( line, "&", "&" ) - result = string.replace( result, "<", "<" ) - result = string.replace( result, ">", ">" ) - return result - -# same as 'html_quote', but ignores left and right brackets -# -def html_quote0( line ): - return string.replace( line, "&", "&" ) - - -# Open the standard output to a given project documentation file. Use -# "output_dir" to determine the filename location if necessary and save the -# old stdout in a tuple that is returned by this function. -# -def open_output( filename ): - global output_dir - - if output_dir and output_dir != "": - filename = output_dir + os.sep + filename - - old_stdout = sys.stdout - new_file = open( filename, "w" ) - sys.stdout = new_file - - return ( new_file, old_stdout ) - - -# Close the output that was returned by "close_output". -# -def close_output( output ): - output[0].close() - sys.stdout = output[1] - - -# Check output directory. -# -def check_output( ): - global output_dir - if output_dir: - if output_dir != "": - if not os.path.isdir( output_dir ): - sys.stderr.write( "argument" + " '" + output_dir + "' " + - "is not a valid directory" ) - sys.exit( 2 ) - else: - output_dir = None - - -def compute_time_html( ): - global html_footer - time_string = time.asctime( time.localtime( time.time() ) ) - html_footer = "

generated on " + time_string + "

" + html_footer - -# The FreeType 2 reference is extracted from the source files. These -# contain various comment blocks that follow one of the following formats: -# -# /************************** -# * -# * FORMAT1 -# * -# * -# * -# * -# *************************/ -# -# /**************************/ -# /* */ -# /* FORMAT2 */ -# /* */ -# /* */ -# /* */ -# /* */ -# -# /**************************/ -# /* */ -# /* FORMAT3 */ -# /* */ -# /* */ -# /* */ -# /* */ -# /**************************/ -# -# Each block contains a list of markers; each one can be followed by -# some arbitrary text or a list of fields. Here an example: -# -# -# MyStruct -# -# -# this structure holds some data -# -# -# x :: horizontal coordinate -# y :: vertical coordinate -# -# -# This example defines three markers: 'Struct', 'Description' & 'Fields'. -# The first two markers contain arbitrary text, while the last one contains -# a list of fields. -# -# Each field is simply of the format: WORD :: TEXT... -# -# Note that typically each comment block is followed by some source code -# declaration that may need to be kept in the reference. -# -# Note that markers can alternatively be written as "@MARKER:" instead of -# "". All marker identifiers are converted to lower case during -# parsing in order to simply sorting. -# -# We associate with each block the following source lines that do not begin -# with a comment. For example, the following: -# -# /********************************** -# * -# * blabla -# * -# */ -# -# bla_bla_bla -# bilip_bilip -# -# /* - this comment acts as a separator - */ -# -# blo_blo_blo -# -# -# will only keep the first two lines of sources with -# the "blabla" block. -# -# However, the comment will be kept, with following source lines if it -# contains a starting '#' or '@' as in: -# -# /*@.....*/ -# /*#.....*/ -# /* @.....*/ -# /* #.....*/ -# - - - -############################################################################# -# -# The DocCode class is used to store source code lines. -# -# 'self.lines' contains a set of source code lines that will be dumped as -# HTML in a
 tag.
-#
-#   The object is filled line by line by the parser; it strips the leading
-#   "margin" space from each input line before storing it in 'self.lines'.
-#
-class DocCode:
-
-    def __init__( self, margin = 0 ):
-        self.lines  = []
-        self.margin = margin
-
-
-    def add( self, line ):
-        # remove margin whitespace
-        #
-        if string.strip( line[: self.margin] ) == "":
-            line = line[self.margin :]
-        self.lines.append( line )
-
-
-    def dump( self ):
-        for line in self.lines:
-            print "--" + line
-        print ""
-
-
-    def get_identifier( self ):
-        # this function should never be called
-        #
-        return "UNKNOWN_CODE_IDENTIFIER!"
-
-
-    def dump_html( self, identifiers = None ):
-        # clean the last empty lines
-        #
-        l = len( self.lines ) - 1
-        while l > 0 and string.strip( self.lines[l - 1] ) == "":
-            l = l - 1
-
-        # The code footer should be directly appended to the last code
-        # line to avoid an additional blank line.
-        #
-        print code_header,
-        for line in self.lines[0 : l+1]:
-            print '\n' + html_quote(line),
-        print code_footer,
-
-
-
-#############################################################################
-#
-# The DocParagraph is used to store text paragraphs.
-# 'self.words' is simply a list of words for the paragraph.
-#
-# The paragraph is filled line by line by the parser.
-#
-class DocParagraph:
-
-    def __init__( self ):
-        self.words = []
-
-
-    def add( self, line ):
-        # Get rid of unwanted spaces in the paragraph.
-        #
-        # The following two lines are the same as
-        #
-        #   self.words.extend( string.split( line ) )
-        #
-        # but older Python versions don't have the `extend' attribute.
-        #
-        last = len( self.words )
-        self.words[last : last] = string.split( line )
-
-
-    # This function is used to retrieve the first word of a given
-    # paragraph.
-    #
-    def get_identifier( self ):
-        if self.words:
-            return self.words[0]
-
-        # should never happen
-        #
-        return "UNKNOWN_PARA_IDENTIFIER!"
-
-
-    def get_words( self ):
-        return self.words[:]
-
-
-    def dump( self, identifiers = None ):
-        max_width = 50
-        cursor    = 0
-        line      = ""
-        extra     = None
-        alphanum  = string.lowercase + string.uppercase + string.digits + '_'
-
-        for word in self.words:
-            # process cross references if needed
-            #
-            if identifiers and word and word[0] == '@':
-                word = word[1 :]
-
-                # we need to find non-alphanumeric characters
-                #
-                l = len( word )
-                i = 0
-                while i < l and word[i] in alphanum:
-                    i = i + 1
-
-                if i < l:
-                    extra = word[i :]
-                    word  = word[0 : i]
-
-                block = identifiers.get( word )
-                if block:
-                    word = '' + word + ''
-                else:
-                    word = '?' + word
-
-            if cursor + len( word ) + 1 > max_width:
-                print html_quote0(line)
-                cursor = 0
-                line   = ""
-
-            line = line + word
-            if not extra:
-                line = line + " "
-
-            cursor = cursor + len( word ) + 1
-
-
-            # Handle trailing periods, commas, etc. at the end of cross
-            # references.
-            #
-            if extra:
-                if cursor + len( extra ) + 1 > max_width:
-                    print html_quote0(line)
-                    cursor = 0
-                    line   = ""
-
-                line   = line + extra + " "
-                cursor = cursor + len( extra ) + 1
-                extra  = None
-
-        if cursor > 0:
-            print html_quote0(line)
-
-        # print "§" # for debugging only
-
-
-    def dump_string( self ):
-        s     = ""
-        space = ""
-        for word in self.words:
-            s     = s + space + word
-            space = " "
-
-        return s
-
-
-    def dump_html( self, identifiers = None ):
-        print para_header
-        self.dump( identifiers )
-        print para_footer
-
-
-
-#############################################################################
-#
-# DocContent is used to store the content of a given marker.
-#
-# The "self.items" list contains (field,elements) records, where "field"
-# corresponds to a given structure field or function parameter (indicated
-# by a "::"), or NULL for a normal section of text/code.
-#
-# Hence, the following example:
-#
-#   
-#      This is an example of what can be put in a content section,
-#
-#      A second line of example text.
-#
-#      x :: A simple test field, with some contents.
-#      y :: Even before, this field has some code contents.
-#           {
-#             y = x+2;
-#           }
-#
-# should be stored as
-#
-#     [ ( None, [ DocParagraph, DocParagraph] ),
-#       ( "x",  [ DocParagraph ] ),
-#       ( "y",  [ DocParagraph, DocCode ] ) ]
-#
-# in 'self.items'.
-#
-# The DocContent object is entirely built at creation time; you must pass a
-# list of input text lines in the "lines_list" parameter.
-#
-class DocContent:
-
-    def __init__( self, lines_list ):
-        self.items  = []
-        code_mode   = 0
-        code_margin = 0
-        text        = []
-        paragraph   = None   # represents the current DocParagraph
-        code        = None   # represents the current DocCode
-
-        elements    = []     # the list of elements for the current field;
-                             # contains DocParagraph or DocCode objects
-
-        field       = None   # the current field
-
-        for aline in lines_list:
-            if code_mode == 0:
-                line   = string.lstrip( aline )
-                l      = len( line )
-                margin = len( aline ) - l
-
-                # if the line is empty, this is the end of the current
-                # paragraph
-                #
-                if l == 0 or line == '{':
-                    if paragraph:
-                        elements.append( paragraph )
-                        paragraph = None
-
-                    if line == "":
-                        continue
-
-                    code_mode   = 1
-                    code_margin = margin
-                    code        = None
-                    continue
-
-                words = string.split( line )
-
-                # test for a field delimiter on the start of the line, i.e.
-                # the token `::'
-                #
-                if len( words ) >= 2 and words[1] == "::":
-                    # start a new field - complete current paragraph if any
-                    #
-                    if paragraph:
-                        elements.append( paragraph )
-                        paragraph = None
-
-                    # append previous "field" to self.items
-                    #
-                    self.items.append( ( field, elements ) )
-
-                    # start new field and elements list
-                    #
-                    field    = words[0]
-                    elements = []
-                    words    = words[2 :]
-
-                # append remaining words to current paragraph
-                #
-                if len( words ) > 0:
-                    line = string.join( words )
-                    if not paragraph:
-                        paragraph = DocParagraph()
-                    paragraph.add( line )
-
-            else:
-                # we are in code mode...
-                #
-                line = aline
-
-                # the code block ends with a line that has a single '}' on
-                # it that is located at the same column that the opening
-                # accolade...
-                #
-                if line == " " * code_margin + '}':
-                    if code:
-                        elements.append( code )
-                        code = None
-
-                    code_mode   = 0
-                    code_margin = 0
-
-                # otherwise, add the line to the current paragraph
-                #
-                else:
-                    if not code:
-                        code = DocCode()
-                    code.add( line )
-
-        if paragraph:
-            elements.append( paragraph )
-
-        if code:
-            elements.append( code )
-
-        self.items.append( ( field, elements ) )
-
-
-    def get_identifier( self ):
-        if self.items:
-            item = self.items[0]
-            for element in item[1]:
-                return element.get_identifier()
-
-        # should never happen
-        #
-        return "UNKNOWN_CONTENT_IDENTIFIER!"
-
-
-    def get_title( self ):
-        if self.items:
-            item = self.items[0]
-            for element in item[1]:
-                return element.dump_string()
-
-        # should never happen
-        #
-        return "UNKNOWN_CONTENT_TITLE!"
-
-
-    def dump( self ):
-        for item in self.items:
-            field = item[0]
-            if field:
-                print ""
-
-            for element in item[1]:
-                element.dump()
-
-            if field:
-                print ""
-
-
-    def dump_html( self, identifiers = None ):
-        n        = len( self.items )
-        in_table = 0
-
-        for i in range( n ):
-            item  = self.items[i]
-            field = item[0]
-
-            if not field:
-                if in_table:
-                    print ""
-                    in_table = 0
-
-                for element in item[1]:
-                    element.dump_html( identifiers )
-
-            else:
-                if not in_table:
-                    print "
" - in_table = 1 - else: - print "
" - - print "" + field + "" - - for element in item[1]: - element.dump_html( identifiers ) - - if in_table: - print "
" - - - def dump_html_in_table( self, identifiers = None ): - n = len( self.items ) - in_table = 0 - - for i in range( n ): - item = self.items[i] - field = item[0] - - if not field: - if item[1]: - print "" - for element in item[1]: - element.dump_html( identifiers ) - print "" - - else: - print "" + field + "" - - for element in item[1]: - element.dump_html( identifiers ) - - print "" - - - -############################################################################# -# -# The DocBlock class is used to store a given comment block. It contains -# a list of markers, as well as a list of contents for each marker. -# -# "self.items" is a list of (marker, contents) elements, where 'marker' is -# a lowercase marker string, and 'contents' is a DocContent object. -# -# "self.source" is simply a list of text lines taken from the uncommented -# source itself. -# -# Finally, "self.name" is a simple identifier used to uniquely identify -# the block. It is taken from the first word of the first paragraph of the -# first marker of a given block, i.e: -# -# Goo -# Bla bla bla -# -# will have a name of "Goo" -# -class DocBlock: - - def __init__( self, block_line_list = [], source_line_list = [] ): - self.items = [] # current ( marker, contents ) list - self.section = None # section this block belongs to - self.filename = "unknown" # filename defining this block - self.lineno = 0 # line number in filename - - marker = None # current marker - content = [] # current content lines list - alphanum = string.letters + string.digits + "_" - self.name = None - - for line in block_line_list: - line2 = string.lstrip( line ) - l = len( line2 ) - margin = len( line ) - l - - if l > 3: - ender = None - if line2[0] == '<': - ender = '>' - elif line2[0] == '@': - ender = ':' - - if ender: - i = 1 - while i < l and line2[i] in alphanum: - i = i + 1 - if i < l and line2[i] == ender: - if marker and content: - self.add( marker, content ) - marker = line2[1 : i] - content = [] - line2 = string.lstrip( line2[i+1 :] ) - l = len( line2 ) - line = " " * margin + line2 - - content.append( line ) - - if marker and content: - self.add( marker, content ) - - self.source = [] - if self.items: - self.source = source_line_list - - # now retrieve block name when possible - # - if self.items: - first = self.items[0] - self.name = first[1].get_identifier() - - - # This function adds a new element to 'self.items'. - # - # 'marker' is a marker string, or None. - # 'lines' is a list of text lines used to compute a list of - # DocContent objects. - # - def add( self, marker, lines ): - # remove the first and last empty lines from the content list - # - l = len( lines ) - if l > 0: - i = 0 - while l > 0 and string.strip( lines[l - 1] ) == "": - l = l - 1 - while i < l and string.strip( lines[i] ) == "": - i = i + 1 - lines = lines[i : l] - l = len( lines ) - - # add a new marker only if its marker and its content list - # are not empty - # - if l > 0 and marker: - content = DocContent( lines ) - self.items.append( ( string.lower( marker ), content ) ) - - - def find_content( self, marker ): - for item in self.items: - if ( item[0] == marker ): - return item[1] - return None - - - def html_address( self ): - section = self.section - if section and section.filename: - return section.filename + '#' + self.name - - return "" # this block is not in a section? - - - def location( self ): - return self.filename + ':' + str( self.lineno ) - - - def print_warning( self, message ): - sys.stderr.write( "WARNING:" + - self.location() + ": " + message + '\n' ) - - - def print_error( self, message ): - sys.stderr.write( "ERROR:" + - self.location() + ": " + message + '\n' ) - sys.exit() - - - def dump( self ): - for i in range( len( self.items ) ): - print "[" + self.items[i][0] + "]" - content = self.items[i][1] - content.dump() - - - def dump_html( self, identifiers = None ): - types = ['type', 'struct', 'functype', 'function', - 'constant', 'enum', 'macro', 'structure', 'also'] - - parameters = ['input', 'inout', 'output', 'return'] - - if not self.items: - return - - # start of a block - # - print block_header - - # place html anchor if needed - # - if self.name: - print '' - print "

" + self.name + "

" - print "
" - - # print source code - # - if not self.source: - print block_footer - return - - lines = self.source - l = len( lines ) - 1 - while l >= 0 and string.strip( lines[l] ) == "": - l = l - 1 - print source_header - print "" - for line in lines[0 : l+1]: - print html_quote(line) - print source_footer - - in_table = 0 - - # dump each (marker,content) element - # - for element in self.items: - marker = element[0] - content = element[1] - - if marker == "description": - print description_header - content.dump_html( identifiers ) - print description_footer - - elif not ( marker in types ): - sys.stdout.write( marker_header ) - sys.stdout.write( marker ) - sys.stdout.write( marker_inter + '\n' ) - content.dump_html( identifiers ) - print marker_footer - - print "" - - print block_footer - - - -############################################################################# -# -# The DocSection class is used to store a given documentation section. -# -# Each section is made of an identifier, an abstract and a description. -# -# For example, look at: -# -#
Basic_Data_Types -# -# FreeType 2 Basic Data Types -# -# <Abstract> -# Definitions of basic FreeType data types -# -# <Description> -# FreeType defines several basic data types for all its -# operations... -# -class DocSection: - - def __init__( self, block ): - self.block = block - self.name = string.lower( block.name ) - self.abstract = block.find_content( "abstract" ) - self.description = block.find_content( "description" ) - self.elements = {} - self.list = [] - self.filename = self.name + ".html" - self.chapter = None - - # sys.stderr.write( "new section '" + self.name + "'" ) - - - def add_element( self, block ): - # check that we don't have a duplicate element in this - # section - # - if self.elements.has_key( block.name ): - block.print_error( "duplicate element definition for " + - "'" + block.name + "' " + - "in section " + - "'" + self.name + "'\n" + - "previous definition in " + - "'" + self.elements[block.name].location() + "'" ) - - self.elements[block.name] = block - self.list.append( block ) - - - def print_warning( self, message ): - self.block.print_warning( message ) - - - def print_error( self, message ): - self.block.print_error( message ) - - - def dump_html( self, identifiers = None ): - """make an HTML page from a given DocSection""" - - # print HTML header - # - print html_header - - # print title - # - print section_title_header - print self.title - print section_title_footer - - # print description - # - print block_header - self.description.dump_html( identifiers ) - print block_footer - - # print elements - # - for element in self.list: - element.dump_html( identifiers ) - - print html_footer - - -class DocSectionList: - - def __init__( self ): - self.sections = {} # map section names to section objects - self.list = [] # list of sections (in creation order) - self.current_section = None # current section - self.identifiers = {} # map identifiers to blocks - - - def append_section( self, block ): - name = string.lower( block.name ) - abstract = block.find_content( "abstract" ) - - if self.sections.has_key( name ): - # There is already a section with this name in our list. We - # will try to complete it. - # - section = self.sections[name] - if section.abstract: - # This section already has an abstract defined; simply check - # that the new section doesn't provide a new one. - # - if abstract: - section.block.print_error( - "duplicate section definition for " + - "'" + name + "'\n" + - "previous definition in " + - "'" + section.block.location() + "'\n" + - "second definition in " + - "'" + block.location() + "'" ) - else: - # The old section didn't contain an abstract; we are now - # going to replace it. - # - section.abstract = abstract - section.description = block.find_content( "description" ) - section.block = block - - else: - # a new section - # - section = DocSection( block ) - self.sections[name] = section - self.list.append( section ) - - self.current_section = section - - - def append_block( self, block ): - if block.name: - section = block.find_content( "section" ) - if section: - self.append_section( block ) - - elif self.current_section: - self.current_section.add_element( block ) - block.section = self.current_section - self.identifiers[block.name] = block - - - def prepare_files( self, file_prefix = None ): - # prepare the section list, by computing section filenames and the - # index - # - if file_prefix: - prefix = file_prefix + "-" - else: - prefix = "" - - # compute section names - # - for section in self.sections.values(): - title_content = section.block.find_content( "title" ) - if title_content: - section.title = title_content.get_title() - else: - section.title = "UNKNOWN_SECTION_TITLE!" - - - # sort section elements according to the <order> marker if available - # - for section in self.sections.values(): - order = section.block.find_content( "order" ) - if order: - # sys.stderr.write( "<order> found at " - # + section.block.location() + '\n' ) - order_list = [] - for item in order.items: - for element in item[1]: - words = None - try: - words = element.get_words() - except: - section.block.print_warning( - "invalid content in <order> marker\n" ) - if words: - for word in words: - block = self.identifiers.get( word ) - if block: - if block.section == section: - order_list.append( block ) - else: - section.block.print_warning( - "invalid reference to " + - "'" + word + "' " + - "defined in other section" ) - else: - section.block.print_warning( - "invalid reference to " + - "'" + word + "'" ) - - # now sort the list of blocks according to the order list - # - new_list = order_list[:] - for block in section.list: - if not block in order_list: - new_list.append( block ) - - section.list = new_list - - # compute section filenames - # - for section in self.sections.values(): - section.filename = prefix + section.name + ".html" - - self.toc_filename = prefix + "toc.html" - self.index_filename = prefix + "index.html" - - # compute the sorted list of identifiers for the index - # - self.index = self.identifiers.keys() - self.index.sort( index_sort ) - - - def dump_html_sections( self ): - for section in self.sections.values(): - if section.filename: - output = open_output( section.filename ) - - section.dump_html( self.identifiers ) - - close_output( output ) - - - def dump_html_index( self ): - output = open_output( self.index_filename ) - - num_columns = 3 - total = len( self.index ) - line = 0 - - print html_header - print "<center><h1>General Index</h1></center>" - print "<center><table cellpadding=5><tr valign=top><td>" - - for ident in self.index: - block = self.identifiers[ident] - if block: - sys.stdout.write( '<a href="' + block.html_address() + '">' ) - sys.stdout.write( block.name ) - sys.stdout.write( '</a><br>' + '\n' ) - - if line * num_columns >= total: - print "</td><td>" - line = 0 - else: - line = line + 1 - else: - sys.stderr.write( "identifier '" + ident + - "' has no definition" + '\n' ) - - print "</tr></table></center>" - print html_footer - - close_output( output ) - - - -# Filter a given list of DocBlocks. Returns a new list of DocBlock objects -# that only contains element whose "type" (i.e. first marker) is in the -# "types" parameter. -# -class DocChapter: - - def __init__( self, block ): - self.sections_names = [] # ordered list of section names - self.sections = [] # ordered list of DocSection objects - # for this chapter - self.block = block - - # look for chapter title - content = block.find_content( "title" ) - if content: - self.title = content.get_title() - else: - self.title = "UNKNOWN CHAPTER TITLE" - - # look for section list - content = block.find_content( "sections" ) - if not content: - block.print_error( "chapter has no <sections> content" ) - - # compute list of section names - slist = [] - for item in content.items: - for element in item[1]: - try: - words = element.get_words() - l = len( slist ) - slist[l : l] = words - except: - block.print_warning( - "invalid content in <sections> marker" ) - - self.section_names = slist - - -class DocDocument: - - def __init__( self ): - self.section_list = DocSectionList() # section list object - self.chapters = [] # list of chapters - self.lost_sections = [] # list of sections with - # no chapter - - def append_block( self, block ): - if block.name: - content = block.find_content( "chapter" ) - if content: - # a chapter definition -- add it to our list - # - chapter = DocChapter( block ) - self.chapters.append( chapter ) - else: - self.section_list.append_block( block ) - - - def prepare_chapters( self ): - # check section names - # - for chapter in self.chapters: - slist = [] - for name in chapter.section_names: - section = self.section_list.sections.get( name ) - if not section: - chapter.block.print_warning( - "invalid reference to unknown section '" + name + "'" ) - else: - section.chapter = chapter - slist.append( section ) - - chapter.sections = slist - - for section in self.section_list.list: - if not section.chapter: - section.block.print_warning( - "section '" + section.name + "' is not in any chapter" ) - self.lost_sections.append( section ) - - - def prepare_files( self, file_prefix = None ): - self.section_list.prepare_files( file_prefix ) - self.prepare_chapters() - - - def dump_toc_html( self ): - # dump an html table of contents - # - output = open_output( self.section_list.toc_filename ) - - print html_header - - print "<center><h1>Table of Contents</h1></center>" - - for chapter in self.chapters: - print chapter_header + chapter.title + chapter_inter - - print "<table cellpadding=5>" - for section in chapter.sections: - if section.abstract: - print "<tr valign=top><td>" - sys.stdout.write( '<a href="' + section.filename + '">' ) - sys.stdout.write( section.title ) - sys.stdout.write( "</a></td><td>" + '\n' ) - section.abstract.dump_html( self.section_list.identifiers ) - print "</td></tr>" - - print "</table>" - - print chapter_footer - - # list lost sections - # - if self.lost_sections: - print chapter_header + "OTHER SECTIONS:" + chapter_inter - - print "<table cellpadding=5>" - for section in self.lost_sections: - if section.abstract: - print "<tr valign=top><td>" - sys.stdout.write( '<a href="' + section.filename + '">' ) - sys.stdout.write( section.title ) - sys.stdout.write( "</a></td><td>" + '\n' ) - section.abstract.dump_html( self.section_list.identifiers ) - print "</td></tr>" - - print "</table>" - - print chapter_footer - - # index - # - print chapter_header + '<a href="' + self.section_list.index_filename + '">Index</a>' + chapter_footer - - print html_footer - - close_output( output ) - - - def dump_index_html( self ): - self.section_list.dump_html_index() - - - def dump_sections_html( self ): - self.section_list.dump_html_sections() - - -def filter_blocks_by_type( block_list, types ): - new_list = [] - for block in block_list: - if block.items: - element = block.items[0] - marker = element[0] - if marker in types: - new_list.append( block ) - - return new_list - - -def filter_section_blocks( block ): - return block.section != None - - -# Perform a lexicographical comparison of two DocBlock objects. Returns -1, -# 0 or 1. -# -def block_lexicographical_compare( b1, b2 ): - if not b1.name: - return -1 - if not b2.name: - return 1 - - id1 = string.lower( b1.name ) - id2 = string.lower( b2.name ) - - if id1 < id2: - return -1 - elif id1 == id2: - return 0 - else: - return 1 - - -# Dump a list block as a single HTML page. -# -def dump_html_1( block_list ): - print html_header - - for block in block_list: - block.dump_html() - - print html_footer - - -def file_exists( pathname ): - result = 1 - try: - file = open( pathname, "r" ) - file.close() - except: - result = None - - return result - - -def add_new_block( list, filename, lineno, block_lines, source_lines ): - """add a new block to the list""" - block = DocBlock( block_lines, source_lines ) - block.filename = filename - block.lineno = lineno - list.append( block ) - - -def make_block_list( args = None ): - """parse a file and extract comments blocks from it""" - - file_list = [] - # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' ) - - if not args: - args = sys.argv[1 :] - - for pathname in args: - if string.find( pathname, '*' ) >= 0: - newpath = glob.glob( pathname ) - newpath.sort() # sort files -- this is important because - # of the order of files - else: - newpath = [pathname] - - last = len( file_list ) - file_list[last : last] = newpath - - if len( file_list ) == 0: - file_list = None - else: - # now filter the file list to remove non-existing ones - file_list = filter( file_exists, file_list ) - - list = [] - block = [] - format = 0 - lineno = 0 - - # We use "format" to store the state of our parser: - # - # 0 - wait for beginning of comment - # 1 - parse comment format 1 - # 2 - parse comment format 2 - # - # 4 - wait for beginning of source (or comment?) - # 5 - process source - # - comment = [] - source = [] - state = 0 - - fileinput.close() - for line in fileinput.input( file_list ): - l = len( line ) - if l > 0 and line[l - 1] == '\012': - line = line[0 : l-1] - - # stripped version of the line - # - line2 = string.strip( line ) - l = len( line2 ) - - # if this line begins with a comment and we are processing some - # source, exit to state 0 - # - # unless we encounter something like: - # - # /*@..... - # /*#..... - # - # /* @..... - # /* #..... - # - if format >= 4 and l > 2 and line2[0 : 2] == '/*': - if l < 4 or ( line2[2] != '@' and line2[2 : 4] != ' @' and - line2[2] != '#' and line2[2 : 4] != ' #'): - add_new_block( list, fileinput.filename(), - lineno, block, source ) - format = 0 - - if format == 0: #### wait for beginning of comment #### - if l > 3 and line2[0 : 3] == '/**': - i = 3 - while i < l and line2[i] == '*': - i = i + 1 - - if i == l: - # this is '/**' followed by any number of '*', the - # beginning of a Format 1 block - # - block = [] - source = [] - format = 1 - lineno = fileinput.filelineno() - - elif i == l - 1 and line2[i] == '/': - # this is '/**' followed by any number of '*', followed - # by a '/', i.e. the beginning of a Format 2 or 3 block - # - block = [] - source = [] - format = 2 - lineno = fileinput.filelineno() - - ############################################################## - # - # FORMAT 1 - # - elif format == 1: - - # If the line doesn't begin with a "*", something went wrong, - # and we must exit, and forget the current block. - # - if l == 0 or line2[0] != '*': - block = [] - format = 0 - - # Otherwise, we test for an end of block, which is an arbitrary - # number of '*', followed by '/'. - # - else: - i = 1 - while i < l and line2[i] == '*': - i = i + 1 - - # test for the end of the block - # - if i < l and line2[i] == '/': - if block != []: - format = 4 - else: - format = 0 - else: - # otherwise simply append line to current block - # - block.append( line2[i :] ) - - continue - - ############################################################## - # - # FORMAT 2 - # - elif format == 2: - - # If the line doesn't begin with '/*' and end with '*/', this is - # the end of the format 2 format. - # - if l < 4 or line2[: 2] != '/*' or line2[-2 :] != '*/': - if block != []: - format = 4 - else: - format = 0 - else: - # remove the start and end comment delimiters, then - # right-strip the line - # - line2 = string.rstrip( line2[2 : -2] ) - - # check for end of a format2 block, i.e. a run of '*' - # - if string.count( line2, '*' ) == l - 4: - if block != []: - format = 4 - else: - format = 0 - else: - # otherwise, add the line to the current block - # - block.append( line2 ) - - continue - - if format >= 4: #### source processing #### - if l > 0: - format = 5 - - if format == 5: - source.append( line ) - - if format >= 4: - add_new_block( list, fileinput.filename(), lineno, block, source ) - - return list - - - -# This function is only used for debugging -# -def dump_block_list( list ): - """dump a comment block list""" - for block in list: - print "----------------------------------------" - for line in block[0]: - print line - for line in block[1]: - print line - - print "---------the end-----------------------" - - -def usage(): - print "\nDocMaker 0.1 Usage information\n" - print " docmaker [options] file1 [ file2 ... ]\n" - print "using the following options:\n" - print " -h : print this page" - print " -t : set project title, as in '-t \"My Project\"'" - print " -o : set output directory, as in '-o mydir'" - print " -p : set documentation prefix, as in '-p ft2'" - print "" - print " --title : same as -t, as in '--title=\"My Project\"'" - print " --output : same as -o, as in '--output=mydir'" - print " --prefix : same as -p, as in '--prefix=ft2'" - - -def main( argv ): - """main program loop""" - - global output_dir, project_title, project_prefix - global html_header, html_header1, html_header2, html_header3 - - try: - opts, args = getopt.getopt( sys.argv[1:], - "ht:o:p:", - [ "help", "title=", "output=", "prefix=" ] ) - - except getopt.GetoptError: - usage() - sys.exit( 2 ) - - if args == []: - usage() - sys.exit( 1 ) - - # process options - # - project_title = "Project" - project_prefix = None - output_dir = None - - for opt in opts: - if opt[0] in ( "-h", "--help" ): - usage() - sys.exit( 0 ) - - if opt[0] in ( "-t", "--title" ): - project_title = opt[1] - - if opt[0] in ( "-o", "--output" ): - output_dir = opt[1] - - if opt[0] in ( "-p", "--prefix" ): - project_prefix = opt[1] - - html_header = html_header_1 + project_title + html_header_2 + project_title + html_header_3 - check_output( ) - compute_time_html() - - # we begin by simply building a list of DocBlock elements - # - list = make_block_list( args ) - - # now, sort the blocks into sections - # - document = DocDocument() - for block in list: - document.append_block( block ) - - document.prepare_files( project_prefix ) - - document.dump_toc_html() - document.dump_sections_html() - document.dump_index_html() - -# if called from the command line -# -if __name__ == '__main__': - main( sys.argv ) - - -# eof Index: xc/extras/freetype2/src/tools/test_bbox.c diff -u xc/extras/freetype2/src/tools/test_bbox.c:1.1.1.2 xc/extras/freetype2/src/tools/test_bbox.c:1.1.1.3 --- xc/extras/freetype2/src/tools/test_bbox.c:1.1.1.2 Sun Dec 16 12:49:34 2001 +++ xc/extras/freetype2/src/tools/test_bbox.c Wed May 28 22:01:57 2003 @@ -46,10 +46,10 @@ static char dummy_tag_1[4] = { - FT_Curve_Tag_On, - FT_Curve_Tag_Cubic, - FT_Curve_Tag_Cubic, - FT_Curve_Tag_On + FT_CURVE_TAG_ON, + FT_CURVE_TAG_CUBIC, + FT_CURVE_TAG_CUBIC, + FT_CURVE_TAG_ON }; static short dummy_contour_1[1] = Index: xc/extras/freetype2/src/tools/docmaker/content.py diff -u /dev/null xc/extras/freetype2/src/tools/docmaker/content.py:1.1.1.1 --- /dev/null Sat Feb 28 21:40:21 2004 +++ xc/extras/freetype2/src/tools/docmaker/content.py Wed May 28 22:01:57 2003 @@ -0,0 +1,547 @@ +# +# this file contains routines used to parse the content of documentation +# comment block and build a more structured objects out of them +# + +from sources import * +from utils import * +import string, re + + +# this regular expresion is used to detect code sequences. these +# are simply code fragments embedded in '{' and '}' like in: +# +# { +# x = y + z; +# if ( zookoo == 2 ) +# { +# foobar(); +# } +# } +# +# note that identation of the starting and ending accolades must be +# exactly the same. the code sequence can contain accolades at greater +# indentation +# +re_code_start = re.compile( r"(\s*){\s*$" ) +re_code_end = re.compile( r"(\s*)}\s*$" ) + + +# this regular expression is used to isolate identifiers from +# other text +# +re_identifier = re.compile( r'(\w*)' ) + + +############################################################################# +# +# The DocCode class is used to store source code lines. +# +# 'self.lines' contains a set of source code lines that will be dumped as +# HTML in a <PRE> tag. +# +# The object is filled line by line by the parser; it strips the leading +# "margin" space from each input line before storing it in 'self.lines'. +# +class DocCode: + + def __init__( self, margin, lines ): + self.lines = [] + self.words = None + + # remove margin spaces + for l in lines: + if string.strip( l[:margin] ) == "": + l = l[margin:] + self.lines.append( l ) + + def dump( self, prefix = "", width=60 ): + for l in self.lines: + print prefix + l + + +############################################################################# +# +# The DocPara class is used to store "normal" text paragraph. +# +# 'self.words' contains the list of words that make up the paragraph +# +class DocPara: + + def __init__( self, lines ): + self.lines = None + self.words = [] + for l in lines: + l = string.strip(l) + self.words.extend( string.split( l ) ) + + def dump( self, prefix = "", width = 60 ): + cur = "" # current line + col = 0 # current width + + for word in self.words: + ln = len(word) + if col > 0: + ln = ln+1 + + if col + ln > width: + print prefix + cur + cur = word + col = len(word) + else: + if col > 0: + cur = cur + " " + cur = cur + word + col = col + ln + + if col > 0: + print prefix + cur + + + +############################################################################# +# +# The DocField class is used to store a list containing either DocPara or +# DocCode objects. Each DocField also has an optional "name" which is used +# when the object corresponds to a field of value definition +# +class DocField: + + def __init__( self, name, lines ): + + self.name = name # can be None for normal paragraphs/sources + self.items = [] # list of items + + mode_none = 0 # start parsing mode + mode_code = 1 # parsing code sequences + mode_para = 3 # parsing normal paragraph + + margin = -1 # current code sequence indentation + cur_lines = [] + + # now analyze the markup lines to see if they contain paragraphs, + # code sequences or fields definitions + # + start = 0 + mode = mode_none + for l in lines: + + # are we parsing a code sequence ? + if mode == mode_code: + + m = re_code_end.match( l ) + if m and len(m.group(1)) <= margin: + # that's it, we finised the code sequence + code = DocCode( 0, cur_lines ) + self.items.append( code ) + margin = -1 + cur_lines = [] + mode = mode_none + else: + # nope, continue the code sequence + cur_lines.append( l[margin:] ) + else: + # start of code sequence ? + m = re_code_start.match( l ) + if m: + # save current lines + if cur_lines: + para = DocPara( cur_lines ) + self.items.append( para ) + cur_lines = [] + + # switch to code extraction mode + margin = len(m.group(1)) + mode = mode_code + + else: + if not string.split( l ) and cur_lines: + # if the line is empty, we end the current paragraph, + # if any + para = DocPara( cur_lines ) + self.items.append( para ) + cur_lines = [] + else: + # otherwise, simply add the line to the current + # paragraph + cur_lines.append( l ) + + if mode == mode_code: + # unexpected end of code sequence + code = DocCode( margin, cur_lines ) + self.items.append( code ) + + elif cur_lines: + para = DocPara( cur_lines ) + self.items.append( para ) + + def dump( self, prefix = "" ): + if self.field: + print prefix + self.field + " ::" + prefix = prefix + "----" + + first = 1 + for p in self.items: + if not first: + print "" + p.dump( prefix ) + first = 0 + + +# this regular expression is used to detect field definitions +# +re_field = re.compile( r"\s*(\w*)\s*::" ) + + + +class DocMarkup: + + def __init__( self, tag, lines ): + self.tag = string.lower(tag) + self.fields = [] + + cur_lines = [] + field = None + mode = 0 + + for l in lines: + m = re_field.match( l ) + if m: + # we detected the start of a new field definition + + # first, save the current one + if cur_lines: + f = DocField( field, cur_lines ) + self.fields.append( f ) + cur_lines = [] + field = None + + field = m.group(1) # record field name + ln = len(m.group(0)) + l = " "*ln + l[ln:] + cur_lines = [ l ] + else: + cur_lines.append( l ) + + if field or cur_lines: + f = DocField( field, cur_lines ) + self.fields.append( f ) + + def get_name( self ): + try: + return self.fields[0].items[0].words[0] + + except: + return None + + def dump( self, margin ): + print " "*margin + "<" + self.tag + ">" + for f in self.fields: + f.dump( " " ) + print " "*margin + "</" + self.tag + ">" + + + + +class DocChapter: + + def __init__( self, block ): + self.block = block + self.sections = [] + if block: + self.name = block.name + self.title = block.get_markup_words( "title" ) + self.order = block.get_markup_words( "sections" ) + else: + self.name = "Other" + self.title = string.split( "Miscellaneous" ) + self.order = [] + + + +class DocSection: + + def __init__( self, name = "Other" ): + self.name = name + self.blocks = {} + self.block_names = [] # ordered block names in section + self.defs = [] + self.abstract = "" + self.description = "" + self.order = [] + self.title = "ERROR" + self.chapter = None + + def add_def( self, block ): + self.defs.append( block ) + + def add_block( self, block ): + self.block_names.append( block.name ) + self.blocks[ block.name ] = block + + def process( self ): + # lookup one block that contains a valid section description + for block in self.defs: + title = block.get_markup_text( "Title" ) + if title: + self.title = title + self.abstract = block.get_markup_words( "abstract" ) + self.description = block.get_markup_items( "description" ) + self.order = block.get_markup_words( "order" ) + return + + def reorder( self ): + + self.block_names = sort_order_list( self.block_names, self.order ) + + +class ContentProcessor: + + def __init__( self ): + """initialize a block content processor""" + self.reset() + + self.sections = {} # dictionary of documentation sections + self.section = None # current documentation section + + self.chapters = [] # list of chapters + + def set_section( self, section_name ): + """set current section during parsing""" + if not self.sections.has_key( section_name ): + section = DocSection( section_name ) + self.sections[ section_name ] = section + self.section = section + else: + self.section = self.sections[ section_name ] + + def add_chapter( self, block ): + chapter = DocChapter( block ) + self.chapters.append( chapter ) + + + def reset( self ): + """reset the content processor for a new block""" + self.markups = [] + self.markup = None + self.markup_lines = [] + + def add_markup( self ): + """add a new markup section""" + if self.markup and self.markup_lines: + + # get rid of last line of markup if it's empty + marks = self.markup_lines + if len(marks) > 0 and not string.strip(marks[-1]): + self.markup_lines = marks[:-1] + + m = DocMarkup( self.markup, self.markup_lines ) + + self.markups.append( m ) + + self.markup = None + self.markup_lines = [] + + + def process_content( self, content ): + """process a block content and return a list of DocMarkup objects + corresponding to it""" + markup = None + markup_lines = [] + first = 1 + + for line in content: + found = None + for t in re_markup_tags: + m = t.match( line ) + if m: + found = string.lower(m.group(1)) + prefix = len(m.group(0)) + line = " "*prefix + line[prefix:] # remove markup from line + break + + # is it the start of a new markup section ? + if found: + first = 0 + self.add_markup() # add current markup content + self.markup = found + if len(string.strip( line )) > 0: + self.markup_lines.append( line ) + elif first == 0: + self.markup_lines.append( line ) + + self.add_markup() + + return self.markups + + + def parse_sources( self, source_processor ): + blocks = source_processor.blocks + count = len(blocks) + for n in range(count): + + source = blocks[n] + if source.content: + # this is a documentation comment, we need to catch + # all following normal blocks in the "follow" list + # + follow = [] + m = n+1 + while m < count and not blocks[m].content: + follow.append( blocks[m] ) + m = m+1 + + doc_block = DocBlock( source, follow, self ) + + + def finish( self ): + + # process all sections to extract their abstract, description + # and ordered list of items + # + for sec in self.sections.values(): + sec.process() + + # process chapters to check that all sections are correctly + # listed there + for chap in self.chapters: + for sec in chap.order: + if self.sections.has_key(sec): + section = self.sections[ sec ] + section.chapter = chap + section.reorder() + chap.sections.append( section ) + else: + sys.stderr.write( "WARNING: chapter '" + + chap.name + "' in " + chap.block.location() + \ + " lists unknown section '" + sec + "'\n" ) + + # check that all sections are in a chapter + # + others = [] + for sec in self.sections.values(): + if not sec.chapter: + others.append(sec) + + # create a new special chapter for all remaining sections + # when necessary + # + if others: + chap = DocChapter( None ) + chap.sections = others + self.chapters.append( chap ) + + + +class DocBlock: + + def __init__( self, source, follow, processor ): + + processor.reset() + + self.source = source + self.code = [] + self.type = "ERRTYPE" + self.name = "ERRNAME" + self.section = processor.section + self.markups = processor.process_content( source.content ) + + # compute block type from first markup tag + try: + self.type = self.markups[0].tag + except: + pass + + + # compute block name from first markup paragraph + try: + markup = self.markups[0] + para = markup.fields[0].items[0] + name = para.words[0] + m = re_identifier.match( name ) + if m: + name = m.group(1) + self.name = name + except: + pass + + # detect new section starts + if self.type == "section": + processor.set_section( self.name ) + processor.section.add_def( self ) + + # detect new chapter + elif self.type == "chapter": + processor.add_chapter( self ) + + else: + processor.section.add_block( self ) + + # now, compute the source lines relevant to this documentation + # block. We keep normal comments in for obvious reasons (??) + source = [] + for b in follow: + if b.format: + break + for l in b.lines: + # we use "/* */" as a separator + if re_source_sep.match( l ): + break + source.append( l ) + + # now strip the leading and trailing empty lines from the sources + start = 0 + end = len( source )-1 + + while start < end and not string.strip( source[start] ): + start = start + 1 + + while start < end and not string.strip( source[end] ): + end = end - 1 + + source = source[start:end+1] + + self.code = source + + + def location( self ): + return self.source.location() + + + + def get_markup( self, tag_name ): + """return the DocMarkup corresponding to a given tag in a block""" + for m in self.markups: + if m.tag == string.lower(tag_name): + return m + return None + + + def get_markup_name( self, tag_name ): + """return the name of a given primary markup in a block""" + try: + m = self.get_markup( tag_name ) + return m.get_name() + except: + return None + + + def get_markup_words( self, tag_name ): + try: + m = self.get_markup( tag_name ) + return m.fields[0].items[0].words + except: + return [] + + + def get_markup_text( self, tag_name ): + result = self.get_markup_words( tag_name ) + return string.join( result ) + + + def get_markup_items( self, tag_name ): + try: + m = self.get_markup( tag_name ) + return m.fields[0].items + except: + return None \ No newline at end of file Index: xc/extras/freetype2/src/tools/docmaker/docmaker.py diff -u /dev/null xc/extras/freetype2/src/tools/docmaker/docmaker.py:1.1.1.1 --- /dev/null Sat Feb 28 21:40:21 2004 +++ xc/extras/freetype2/src/tools/docmaker/docmaker.py Wed May 28 22:01:57 2003 @@ -0,0 +1,149 @@ +#!/usr/bin/env python +# +# DocMaker 0.2 (c) 2002 David Turner <david@freetype.org> +# +# This program is a re-write of the original DocMaker took used +# to generate the API Reference of the FreeType font engine +# by converting in-source comments into structured HTML +# +# This new version is capable of outputting XML data, as well +# as accepts more liberal formatting options +# +# It also uses regular expression matching and substitution +# to speed things significantly +# + +from sources import * +from content import * +from utils import * +from formatter import * +from tohtml import * + +import utils + +import sys, os, time, string, glob, getopt + + +def file_exists( pathname ): + """checks that a given file exists""" + result = 1 + try: + file = open( pathname, "r" ) + file.close() + except: + result = None + sys.stderr.write( pathname + " couldn't be accessed\n" ) + + return result + + +def make_file_list( args = None ): + """builds a list of input files from command-line arguments""" + + file_list = [] + # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' ) + + if not args: + args = sys.argv[1 :] + + for pathname in args: + if string.find( pathname, '*' ) >= 0: + newpath = glob.glob( pathname ) + newpath.sort() # sort files -- this is important because + # of the order of files + else: + newpath = [pathname] + + file_list.extend( newpath ) + + if len( file_list ) == 0: + file_list = None + else: + # now filter the file list to remove non-existing ones + file_list = filter( file_exists, file_list ) + + return file_list + + + +def usage(): + print "\nDocMaker 0.2 Usage information\n" + print " docmaker [options] file1 [ file2 ... ]\n" + print "using the following options:\n" + print " -h : print this page" + print " -t : set project title, as in '-t \"My Project\"'" + print " -o : set output directory, as in '-o mydir'" + print " -p : set documentation prefix, as in '-p ft2'" + print "" + print " --title : same as -t, as in '--title=\"My Project\"'" + print " --output : same as -o, as in '--output=mydir'" + print " --prefix : same as -p, as in '--prefix=ft2'" + + +def main( argv ): + """main program loop""" + + global output_dir + + try: + opts, args = getopt.getopt( sys.argv[1:], + "ht:o:p:", + [ "help", "title=", "output=", "prefix=" ] ) + + except getopt.GetoptError: + usage() + sys.exit( 2 ) + + if args == []: + usage() + sys.exit( 1 ) + + # process options + # + project_title = "Project" + project_prefix = None + output_dir = None + + for opt in opts: + if opt[0] in ( "-h", "--help" ): + usage() + sys.exit( 0 ) + + if opt[0] in ( "-t", "--title" ): + project_title = opt[1] + + if opt[0] in ( "-o", "--output" ): + utils.output_dir = opt[1] + + if opt[0] in ( "-p", "--prefix" ): + project_prefix = opt[1] + + check_output( ) + + # create context and processor + source_processor = SourceProcessor() + content_processor = ContentProcessor() + + # retrieve the list of files to process + file_list = make_file_list( args ) + for filename in file_list: + source_processor.parse_file( filename ) + content_processor.parse_sources( source_processor ) + + # process sections + content_processor.finish() + + formatter = HtmlFormatter( content_processor, project_title, project_prefix ) + + formatter.toc_dump() + formatter.index_dump() + formatter.section_dump_all() + + +# if called from the command line +# +if __name__ == '__main__': + main( sys.argv ) + + +# eof Index: xc/extras/freetype2/src/tools/docmaker/formatter.py diff -u /dev/null xc/extras/freetype2/src/tools/docmaker/formatter.py:1.1.1.1 --- /dev/null Sat Feb 28 21:40:21 2004 +++ xc/extras/freetype2/src/tools/docmaker/formatter.py Wed May 28 22:01:57 2003 @@ -0,0 +1,194 @@ +from sources import * +from content import * +from utils import * + +class Formatter: + + def __init__( self, processor ): + + self.processor = processor + self.identifiers = {} + self.chapters = processor.chapters + self.sections = processor.sections.values() + self.block_index = [] + + # store all blocks in a dictionary + self.blocks = [] + for section in self.sections: + for block in section.blocks.values(): + self.add_identifier( block.name, block ) + + # add enumeration values to the index, since this is useful + for markup in block.markups: + if markup.tag == 'values': + for field in markup.fields: + self.add_identifier( field.name, block ) + + + self.block_index = self.identifiers.keys() + self.block_index.sort( index_sort ) + + + def add_identifier( self, name, block ): + if self.identifiers.has_key( name ): + # duplicate name !! + sys.stderr.write( \ + "WARNING: duplicate definition for '" + name + "' in " + \ + block.location() + ", previous definition in " + \ + self.identifiers[ name ].location() + "\n" ) + else: + self.identifiers[name] = block + + + # + # Formatting the table of contents + # + + def toc_enter( self ): + pass + + def toc_chapter_enter( self, chapter ): + pass + + def toc_section_enter( self, section ): + pass + + def toc_section_exit( self, section ): + pass + + def toc_chapter_exit( self, chapter ): + pass + + def toc_index( self, index_filename ): + pass + + def toc_exit( self ): + pass + + def toc_dump( self, toc_filename = None, index_filename = None ): + + output = None + if toc_filename: + output = open_output( toc_filename ) + + self.toc_enter() + + for chap in self.processor.chapters: + + self.toc_chapter_enter( chap ) + + for section in chap.sections: + self.toc_section_enter( section ) + self.toc_section_exit( section ) + + self.toc_chapter_exit ( chap ) + + self.toc_index( index_filename ) + + self.toc_exit() + + if output: + close_output( output ) + + # + # Formatting the index + # + + def index_enter( self ): + pass + + def index_name_enter( self, name ): + pass + + def index_name_exit( self, name ): + pass + + def index_exit( self ): + pass + + def index_dump( self, index_filename = None ): + + output = None + if index_filename: + output = open_output( index_filename ) + + self.index_enter() + + for name in self.block_index: + self.index_name_enter( name ) + self.index_name_exit ( name ) + + self.index_exit() + + if output: + close_output( output ) + + # + # Formatting a section + # + def section_enter( self, section ): + pass + + def block_enter( self, block ): + pass + + def markup_enter( self, markup, block = None ): + pass + + def field_enter( self, field, markup = None, block = None ): + pass + + def field_exit( self, field, markup = None, block = None ): + pass + + def markup_exit( self, markup, block = None ): + pass + + def block_exit( self, block ): + pass + + def section_exit( self, section ): + pass + + + def section_dump( self, section, section_filename = None ): + + output = None + if section_filename: + output = open_output( section_filename ) + + self.section_enter( section ) + + for name in section.block_names: + block = self.identifiers[ name ] + self.block_enter( block ) + + for markup in block.markups[1:]: # always ignore first markup !! + self.markup_enter( markup, block ) + + for field in markup.fields: + self.field_enter( field, markup, block ) + + self.field_exit ( field, markup, block ) + + self.markup_exit( markup, block ) + + self.block_exit( block ) + + self.section_exit ( section ) + + if output: + close_output( output ) + + + def section_dump_all( self ): + for section in self.sections: + self.section_dump( section ) + + # + # Formatting a block + # + + + + Index: xc/extras/freetype2/src/tools/docmaker/sources.py diff -u /dev/null xc/extras/freetype2/src/tools/docmaker/sources.py:1.1.1.1 --- /dev/null Sat Feb 28 21:40:21 2004 +++ xc/extras/freetype2/src/tools/docmaker/sources.py Wed May 28 22:01:57 2003 @@ -0,0 +1,355 @@ +# +# this file contains definitions of classes needed to decompose +# C sources files into a series of multi-line "blocks". There are +# two kinds of blocks: +# +# - normal blocks, which contain source code or ordinary comments +# +# - documentation blocks, which have restricted formatting, and +# whose text always start with a documentation markup tag like +# "<Function>", "<Type>", etc.. +# +# the routines used to process the content of documentation blocks +# are not contained here, but in "content.py" +# +# the classes and methods found here only deal with text parsing +# and basic documentation block extraction +# +import fileinput, re, sys, os, string + + + + + + +################################################################ +## +## BLOCK FORMAT PATTERN +## +## A simple class containing compiled regular expressions used +## to detect potential documentation format block comments within +## C source code +## +## note that the 'column' pattern must contain a group that will +## be used to "unbox" the content of documentation comment blocks +## +class SourceBlockFormat: + + def __init__( self, id, start, column, end ): + """create a block pattern, used to recognize special documentation blocks""" + + self.id = id + self.start = re.compile( start, re.VERBOSE ) + self.column = re.compile( column, re.VERBOSE ) + self.end = re.compile( end, re.VERBOSE ) + + + +# +# format 1 documentation comment blocks look like the following: +# +# /************************************/ +# /* */ +# /* */ +# /* */ +# /************************************/ +# +# we define a few regular expressions here to detect them +# + +start = r''' + \s* # any number of whitespace + /\*{2,}/ # followed by '/' and at least two asterisks then '/' + \s*$ # eventually followed by whitespace +''' + +column = r''' + \s* # any number of whitespace + /\*{1} # followed by '/' and precisely one asterisk + ([^*].*) # followed by anything (group 1) + \*{1}/ # followed by one asterisk and a '/' + \s*$ # enventually followed by whitespace +''' + +re_source_block_format1 = SourceBlockFormat( 1, start, column, start ) + +# +# format 2 documentation comment blocks look like the following: +# +# /************************************ (at least 2 asterisks) +# * +# * +# * +# * +# **/ (1 or more asterisks at the end) +# +# we define a few regular expressions here to detect them +# +start = r''' + \s* # any number of whitespace + /\*{2,} # followed by '/' and at least two asterisks + \s*$ # eventually followed by whitespace +''' + +column = r''' + \s* # any number of whitespace + \*{1} # followed by precisely one asterisk + (.*) # then anything (group1) +''' + +end = r''' + \s* # any number of whitespace + \*+/ # followed by at least one asterisk, then '/' +''' + +re_source_block_format2 = SourceBlockFormat( 2, start, column, end ) + +# +# the list of supported documentation block formats, we could add new ones +# relatively easily +# +re_source_block_formats = [ re_source_block_format1, re_source_block_format2 ] + + +# +# the following regular expressions corresponds to markup tags +# within the documentation comment blocks. they're equivalent +# despite their different syntax +# +# notice how each markup tag _must_ begin a new line +# +re_markup_tag1 = re.compile( r'''\s*<(\w*)>''' ) # <xxxx> format +re_markup_tag2 = re.compile( r'''\s*@(\w*):''' ) # @xxxx: format + +# +# the list of supported markup tags, we could add new ones relatively +# easily +# +re_markup_tags = [ re_markup_tag1, re_markup_tag2 ] + +# +# used to detect a cross-reference, after markup tags have been stripped +# +re_crossref = re.compile( r'@(\w*)' ) + +# +# used to detect italic and bold styles in paragraph text +# +re_italic = re.compile( r'_(\w+)_' ) +re_bold = re.compile( r'\*(\w+)\*' ) + +# +# used to detect the end of commented source lines +# +re_source_sep = re.compile( r'\s*/\*\s*\*/' ) + +# +# used to perform cross-reference within source output +# +re_source_crossref = re.compile( r'(\W*)(\w*)' ) + +# +# a list of reserved source keywords +# +re_source_keywords = re.compile( '''( typedef | + struct | + enum | + union | + const | + char | + int | + short | + long | + void | + signed | + unsigned | + \#include | + \#define | + \#undef | + \#if | + \#ifdef | + \#ifndef | + \#else | + \#endif )''', re.VERBOSE ) + +################################################################ +## +## SOURCE BLOCK CLASS +## +## A SourceProcessor is in charge or reading a C source file +## and decomposing it into a series of different "SourceBlocks". +## each one of these blocks can be made of the following data: +## +## - A documentation comment block that starts with "/**" and +## whose exact format will be discussed later +## +## - normal sources lines, include comments +## +## the important fields in a text block are the following ones: +## +## self.lines : a list of text lines for the corresponding block +## +## self.content : for documentation comment blocks only, this is the +## block content that has been "unboxed" from its +## decoration. This is None for all other blocks +## (i.e. sources or ordinary comments with no starting +## markup tag) +## +class SourceBlock: + def __init__( self, processor, filename, lineno, lines ): + self.processor = processor + self.filename = filename + self.lineno = lineno + self.lines = lines + self.format = processor.format + self.content = [] + + if self.format == None: + return + + words = [] + + # extract comment lines + lines = [] + + for line0 in self.lines[1:]: + m = self.format.column.match( line0 ) + if m: + lines.append( m.group(1) ) + + # now, look for a markup tag + for l in lines: + l = string.strip(l) + if len(l) > 0: + for tag in re_markup_tags: + if tag.match( l ): + self.content = lines + return + + def location( self ): + return "(" + self.filename + ":" + repr(self.lineno) + ")" + + + # debugging only - not used in normal operations + def dump( self ): + + if self.content: + print "{{{content start---" + for l in self.content: + print l + print "---content end}}}" + return + + fmt = "" + if self.format: + fmt = repr(self.format.id) + " " + + for line in self.lines: + print line + + +################################################################ +## +## SOURCE PROCESSOR CLASS +## +## The SourceProcessor is in charge or reading a C source file +## and decomposing it into a series of different "SourceBlock" +## objects. +## +## each one of these blocks can be made of the following data: +## +## - A documentation comment block that starts with "/**" and +## whose exact format will be discussed later +## +## - normal sources lines, include comments +## +## +class SourceProcessor: + + def __init__( self ): + """initialize a source processor""" + self.blocks = [] + self.filename = None + self.format = None + self.lines = [] + + def reset( self ): + """reset a block processor, clean all its blocks""" + self.blocks = [] + self.format = None + + + def parse_file( self, filename ): + """parse a C source file, and adds its blocks to the processor's list""" + + self.reset() + + self.filename = filename + + fileinput.close() + self.format = None + self.lineno = 0 + self.lines = [] + + for line in fileinput.input( filename ): + + # strip trailing newlines, important on Windows machines !! + if line[-1] == '\012': + line = line[0:-1] + + if self.format == None: + self.process_normal_line( line ) + + else: + if self.format.end.match( line ): + # that's a normal block end, add it to lines and + # create a new block + # self.lines.append( line ) + self.add_block_lines() + + elif self.format.column.match( line ): + # that's a normal column line, add it to 'lines' + self.lines.append( line ) + + else: + # humm.. this is an unexcepted block end, + # create a new block, but don't process the line + self.add_block_lines() + + # we need to process the line again + self.process_normal_line( line ) + + # record the last lines + self.add_block_lines() + + + + def process_normal_line( self, line ): + """process a normal line and check if it's the start of a new block""" + for f in re_source_block_formats: + if f.start.match( line ): + self.add_block_lines() + self.format = f + self.lineno = fileinput.filelineno() + + self.lines.append( line ) + + + + def add_block_lines( self ): + """add the current accumulated lines, and create a new block""" + if self.lines != []: + block = SourceBlock( self, self.filename, self.lineno, self.lines ) + + self.blocks.append( block ) + self.format = None + self.lines = [] + + + # debugging only, not used in normal operations + def dump( self ): + """print all blocks in a processor""" + for b in self.blocks: + b.dump() + +# eof Index: xc/extras/freetype2/src/tools/docmaker/tohtml.py diff -u /dev/null xc/extras/freetype2/src/tools/docmaker/tohtml.py:1.1.1.1 --- /dev/null Sat Feb 28 21:40:21 2004 +++ xc/extras/freetype2/src/tools/docmaker/tohtml.py Wed May 28 22:01:57 2003 @@ -0,0 +1,476 @@ +from sources import * +from content import * +from formatter import * + +import time + +# The following defines the HTML header used by all generated pages. +# +html_header_1 = """\ +<html> +<header> +<title>""" + +html_header_2= """ API Reference + + + + +

""" + +html_header_3=""" API Reference

+""" + + + +# The HTML footer used by all generated pages. +# +html_footer = """\ + +""" + +# The header and footer used for each section. +# +section_title_header = "

" +section_title_footer = "

" + +# The header and footer used for code segments. +# +code_header = "
"
+code_footer = "
" + +# Paragraph header and footer. +# +para_header = "

" +para_footer = "

" + +# Block header and footer. +# +block_header = "
" +block_footer = "

" + +# Description header/footer. +# +description_header = "
" +description_footer = "

" + +# Marker header/inter/footer combination. +# +marker_header = "
" +marker_inter = "
" +marker_footer = "
" + +# Source code extracts header/footer. +# +source_header = "
\n"
+source_footer = "\n

" + +# Chapter header/inter/footer. +# +chapter_header = "

" +chapter_inter = "

    " +chapter_footer = "
" + + +# source language keyword coloration/styling +# +keyword_prefix = '' +keyword_suffix = '' + +section_synopsis_header = '

Synopsys

' +section_synopsis_footer = '' + +# Translate a single line of source to HTML. This will convert +# a "<" into "<.", ">" into ">.", etc. +# +def html_quote( line ): + result = string.replace( line, "&", "&" ) + result = string.replace( result, "<", "<" ) + result = string.replace( result, ">", ">" ) + return result + + +# same as 'html_quote', but ignores left and right brackets +# +def html_quote0( line ): + return string.replace( line, "&", "&" ) + + +def dump_html_code( lines, prefix = "" ): + # clean the last empty lines + # + l = len( self.lines ) + while l > 0 and string.strip( self.lines[l - 1] ) == "": + l = l - 1 + + # The code footer should be directly appended to the last code + # line to avoid an additional blank line. + # + print prefix + code_header, + for line in self.lines[0 : l+1]: + print '\n' + prefix + html_quote(line), + print prefix + code_footer, + + + +class HtmlFormatter(Formatter): + + def __init__( self, processor, project_title, file_prefix ): + + Formatter.__init__( self, processor ) + + global html_header_1, html_header_2, html_header_3, html_footer + + if file_prefix: + file_prefix = file_prefix + "-" + else: + file_prefix = "" + + self.project_title = project_title + self.file_prefix = file_prefix + self.html_header = html_header_1 + project_title + html_header_2 + \ + project_title + html_header_3 + + self.html_footer = "

generated on " + \ + time.asctime( time.localtime( time.time() ) ) + \ + "

" + html_footer + + self.columns = 3 + + def make_section_url( self, section ): + return self.file_prefix + section.name + ".html" + + + def make_block_url( self, block ): + return self.make_section_url( block.section ) + "#" + block.name + + + def make_html_words( self, words ): + """ convert a series of simple words into some HTML text """ + line = "" + if words: + line = html_quote( words[0] ) + for w in words[1:]: + line = line + " " + html_quote( w ) + + return line + + + def make_html_word( self, word ): + """analyze a simple word to detect cross-references and styling""" + # look for cross-references + # + m = re_crossref.match( word ) + if m: + try: + name = m.group(1) + block = self.identifiers[ name ] + url = self.make_block_url( block ) + return '' + name + '' + except: + return '?' + name + '?' + + # look for italics and bolds + m = re_italic.match( word ) + if m: + name = m.group(1) + return ''+name+'' + + m = re_bold.match( word ) + if m: + name = m.group(1) + return ''+name+'' + + return html_quote(word) + + + def make_html_para( self, words ): + """ convert a paragraph's words into tagged HTML text, handle xrefs """ + line = "" + if words: + line = self.make_html_word( words[0] ) + for word in words[1:]: + line = line + " " + self.make_html_word( word ) + + return "

" + line + "

" + + + def make_html_code( self, lines ): + """ convert a code sequence to HTML """ + line = code_header + '\n' + for l in lines: + line = line + html_quote( l ) + '\n' + + return line + code_footer + + + def make_html_items( self, items ): + """ convert a field's content into some valid HTML """ + lines = [] + for item in items: + if item.lines: + lines.append( self.make_html_code( item.lines ) ) + else: + lines.append( self.make_html_para( item.words ) ) + + return string.join( lines, '\n' ) + + + def print_html_items( self, items ): + print self.make_html_items( items ) + + + def print_html_field( self, field ): + if field.name: + print "
"+field.name+"" + + print self.make_html_items( field.items ) + + if field.name: + print "
" + + + def html_source_quote( self, line, block_name = None ): + result = "" + while line: + m = re_source_crossref.match( line ) + if m: + name = m.group(2) + prefix = html_quote( m.group(1) ) + length = len( m.group(0) ) + + if name == block_name: + # this is the current block name, if any + result = result + prefix + '' + name + '' + + elif re_source_keywords.match(name): + # this is a C keyword + result = result + prefix + keyword_prefix + name + keyword_suffix + + elif self.identifiers.has_key(name): + # this is a known identifier + block = self.identifiers[name] + result = result + prefix + '' + name + '' + else: + result = result + html_quote(line[ : length ]) + + line = line[ length : ] + else: + result = result + html_quote(line) + line = [] + + return result + + + def print_html_field_list( self, fields ): + print "" + for field in fields: + print "" + print "
" + field.name + "" + self.print_html_items( field.items ) + print "
" + + + def print_html_markup( self, markup ): + table_fields = [] + for field in markup.fields: + if field.name: + # we begin a new series of field or value definitions, we + # will record them in the 'table_fields' list before outputting + # all of them as a single table + # + table_fields.append( field ) + + else: + if table_fields: + self.print_html_field_list( table_fields ) + table_fields = [] + + self.print_html_items( field.items ) + + if table_fields: + self.print_html_field_list( table_fields ) + + # + # Formatting the index + # + + def index_enter( self ): + print self.html_header + self.index_items = {} + + def index_name_enter( self, name ): + block = self.identifiers[ name ] + url = self.make_block_url( block ) + self.index_items[ name ] = url + + def index_exit( self ): + + # block_index already contains the sorted list of index names + count = len( self.block_index ) + rows = (count + self.columns - 1)/self.columns + + print "
" + for r in range(rows): + line = "" + for c in range(self.columns): + i = r + c*rows + if i < count: + bname = self.block_index[ r + c*rows ] + url = self.index_items[ bname ] + line = line + '' + else: + line = line + '' + line = line + "" + print line + + print "
' + bname + '
" + print self.html_footer + self.index_items = {} + + def index_dump( self, index_filename = None ): + + if index_filename == None: + index_filename = self.file_prefix + "index.html" + + Formatter.index_dump( self, index_filename ) + + # + # Formatting the table of content + # + def toc_enter( self ): + print self.html_header + print "

Table of Contents

" + + def toc_chapter_enter( self, chapter ): + print chapter_header + string.join(chapter.title) + chapter_inter + print "" + + def toc_section_enter( self, section ): + print "" + + def toc_chapter_exit( self, chapter ): + print "
" + print '' + \ + section.title + '' + + print self.make_html_para( section.abstract ) + + def toc_section_exit( self, section ): + print "
" + print chapter_footer + + def toc_index( self, index_filename ): + print chapter_header + 'Global Index' + chapter_inter + chapter_footer + + def toc_exit( self ): + print "" + print self.html_footer + + def toc_dump( self, toc_filename = None, index_filename = None ): + if toc_filename == None: + toc_filename = self.file_prefix + "toc.html" + + if index_filename == None: + index_filename = self.file_prefix + "index.html" + + Formatter.toc_dump( self, toc_filename, index_filename ) + + # + # Formatting sections + # + def section_enter( self, section ): + print self.html_header + + print section_title_header + print section.title + print section_title_footer + + # print section synopsys + print section_synopsis_header + print "
" + + maxwidth = 0 + for b in section.blocks.values(): + if len(b.name) > maxwidth: + maxwidth = len(b.name) + + width = 70 # XXX magic number + columns = width / maxwidth + if columns < 1: + columns = 1 + + count = len(section.block_names) + rows = (count + columns-1)/columns + for r in range(rows): + line = "" + for c in range(columns): + i = r + c*rows + line = line + '' + line = line + "" + print line + + print "
' + if i < count: + name = section.block_names[i] + line = line + '' + name + '' + + line = line + '


" + print section_synopsis_footer + + print description_header + print self.make_html_items( section.description ) + print description_footer + + def block_enter( self, block ): + print block_header + + # place html anchor if needed + if block.name: + print '' + print "

" + block.name + "

" + print "
" + + # dump the block C source lines now + if block.code: + print source_header + for l in block.code: + print self.html_source_quote( l, block.name ) + print source_footer + + + def markup_enter( self, markup, block ): + if markup.tag == "description": + print description_header + else: + print marker_header + markup.tag + marker_inter + + self.print_html_markup( markup ) + + def markup_exit( self, markup, block ): + if markup.tag == "description": + print description_footer + else: + print marker_footer + + def block_exit( self, block ): + print block_footer + + + def section_exit( self, section ): + print html_footer + + + def section_dump_all( self ): + for section in self.sections: + self.section_dump( section, self.file_prefix + section.name + '.html' ) + \ No newline at end of file Index: xc/extras/freetype2/src/tools/docmaker/utils.py diff -u /dev/null xc/extras/freetype2/src/tools/docmaker/utils.py:1.1.1.1 --- /dev/null Sat Feb 28 21:40:21 2004 +++ xc/extras/freetype2/src/tools/docmaker/utils.py Wed May 28 22:01:57 2003 @@ -0,0 +1,87 @@ +import string, sys, os + +# current output directory +# +output_dir = None + + +# This function is used to sort the index. It is a simple lexicographical +# sort, except that it places capital letters before lowercase ones. +# +def index_sort( s1, s2 ): + if not s1: + return -1 + + if not s2: + return 1 + + l1 = len( s1 ) + l2 = len( s2 ) + m1 = string.lower( s1 ) + m2 = string.lower( s2 ) + + for i in range( l1 ): + if i >= l2 or m1[i] > m2[i]: + return 1 + + if m1[i] < m2[i]: + return -1 + + if s1[i] < s2[i]: + return -1 + + if s1[i] > s2[i]: + return 1 + + if l2 > l1: + return -1 + + return 0 + +# Sort input_list, placing the elements of order_list in front. +# +def sort_order_list( input_list, order_list ): + new_list = order_list[:] + for id in input_list: + if not id in order_list: + new_list.append( id ) + return new_list + + + +# Open the standard output to a given project documentation file. Use +# "output_dir" to determine the filename location if necessary and save the +# old stdout in a tuple that is returned by this function. +# +def open_output( filename ): + global output_dir + + if output_dir and output_dir != "": + filename = output_dir + os.sep + filename + + old_stdout = sys.stdout + new_file = open( filename, "w" ) + sys.stdout = new_file + + return ( new_file, old_stdout ) + + +# Close the output that was returned by "close_output". +# +def close_output( output ): + output[0].close() + sys.stdout = output[1] + + +# Check output directory. +# +def check_output( ): + global output_dir + if output_dir: + if output_dir != "": + if not os.path.isdir( output_dir ): + sys.stderr.write( "argument" + " '" + output_dir + "' " + + "is not a valid directory" ) + sys.exit( 2 ) + else: + output_dir = None Index: xc/extras/freetype2/src/truetype/Jamfile diff -u xc/extras/freetype2/src/truetype/Jamfile:1.1.1.1 xc/extras/freetype2/src/truetype/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/truetype/Jamfile:1.1.1.1 Sun Sep 9 22:56:09 2001 +++ xc/extras/freetype2/src/truetype/Jamfile Wed May 28 22:01:57 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/truetype Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src truetype ; - -SubDirHdrs [ FT2_SubDir src truetype ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) truetype ; { local _sources ; Index: xc/extras/freetype2/src/truetype/ttdriver.c diff -u xc/extras/freetype2/src/truetype/ttdriver.c:1.1.1.7 xc/extras/freetype2/src/truetype/ttdriver.c:1.1.1.8 --- xc/extras/freetype2/src/truetype/ttdriver.c:1.1.1.7 Thu Jun 20 04:16:24 2002 +++ xc/extras/freetype2/src/truetype/ttdriver.c Wed May 28 22:01:57 2003 @@ -190,39 +190,46 @@ FT_UInt horz_resolution, FT_UInt vert_resolution ) { - FT_Size_Metrics* metrics = &size->root.metrics; - TT_Face face = (TT_Face)size->root.face; + FT_Size_Metrics* metrics = &size->root.metrics; + FT_Size_Metrics* metrics2 = &size->metrics; + TT_Face face = (TT_Face)size->root.face; FT_Long dim_x, dim_y; + *metrics2 = *metrics; + /* This bit flag, when set, indicates that the pixel size must be */ /* truncated to an integer. Nearly all TrueType fonts have this */ /* bit set, as hinting won't work really well otherwise. */ /* */ - /* However, for those rare fonts who do not set it, we override */ - /* the default computations performed by the base layer. I */ - /* really don't know whether this is useful, but hey, that's the */ - /* spec :-) */ - /* */ - if ( ( face->header.Flags & 8 ) == 0 ) + if ( ( face->header.Flags & 8 ) != 0 ) { - /* Compute pixel sizes in 26.6 units */ - dim_x = ( char_width * horz_resolution + 36 ) / 72; - dim_y = ( char_height * vert_resolution + 36 ) / 72; - - metrics->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); - metrics->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); - - metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); - metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); + /* we need to use rounding in the following computations. Otherwise, + * the resulting hinted outlines will be very slightly distorted + */ + dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64; + dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64; + } + else + { + dim_x = ( ( char_width * horz_resolution + 36 ) / 72 ); + dim_y = ( ( char_height * vert_resolution + 36 ) / 72 ); } + /* we only modify "metrics2", not "metrics", so these changes have */ + /* no effect on the result of the auto-hinter when it is used */ + /* */ + metrics2->x_ppem = (FT_UShort)( dim_x >> 6 ); + metrics2->y_ppem = (FT_UShort)( dim_y >> 6 ); + metrics2->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); + metrics2->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); + size->ttmetrics.valid = FALSE; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS size->strike_index = 0xFFFF; #endif - return TT_Size_Reset( size ); + return tt_size_reset( size ); } @@ -256,12 +263,13 @@ /* many things have been pre-computed by the base layer */ + size->metrics = size->root.metrics; size->ttmetrics.valid = FALSE; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS size->strike_index = 0xFFFF; #endif - return TT_Size_Reset( size ); + return tt_size_reset( size ); } @@ -295,7 +303,7 @@ Load_Glyph( TT_GlyphSlot slot, TT_Size size, FT_UShort glyph_index, - FT_UInt load_flags ) + FT_Int32 load_flags ) { FT_Error error; @@ -319,7 +327,7 @@ if ( !size->ttmetrics.valid ) { - if ( FT_SET_ERROR( TT_Size_Reset( size ) ) ) + if ( FT_SET_ERROR( tt_size_reset( size ) ) ) return error; } } @@ -339,112 +347,6 @@ /*************************************************************************/ /**** ****/ /**** ****/ - /**** C H A R A C T E R M A P P I N G S ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* */ - /* Get_Char_Index */ - /* */ - /* */ - /* Uses a charmap to return a given character code's glyph index. */ - /* */ - /* */ - /* charmap :: A handle to the source charmap object. */ - /* charcode :: The character code. */ - /* */ - /* */ - /* Glyph index. 0 means `undefined character code'. */ - /* */ - static FT_UInt - Get_Char_Index( TT_CharMap charmap, - FT_Long charcode ) - { - FT_Error error; - TT_Face face; - TT_CMapTable cmap; - - - cmap = &charmap->cmap; - face = (TT_Face)charmap->root.face; - - /* Load table if needed */ - if ( !cmap->loaded ) - { - SFNT_Service sfnt = (SFNT_Service)face->sfnt; - - - error = sfnt->load_charmap( face, cmap, face->root.stream ); - if ( error ) - return 0; - - cmap->loaded = TRUE; - } - - if ( cmap->get_index ) - return cmap->get_index( cmap, charcode ); - else - return 0; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Get_Next_Char */ - /* */ - /* */ - /* Uses a charmap to return the next encoded char. */ - /* */ - /* */ - /* charmap :: A handle to the source charmap object. */ - /* charcode :: The character code. */ - /* */ - /* */ - /* Next char code. 0 means `no more encoded characters'. */ - /* */ - static FT_UInt - Get_Next_Char( TT_CharMap charmap, - FT_Long charcode ) - { - FT_Error error; - TT_Face face; - TT_CMapTable cmap; - - - cmap = &charmap->cmap; - face = (TT_Face)charmap->root.face; - - /* Load table if needed */ - if ( !cmap->loaded ) - { - SFNT_Service sfnt = (SFNT_Service)face->sfnt; - - - error = sfnt->load_charmap( face, cmap, face->root.stream ); - if ( error ) - return 0; - - cmap->loaded = TRUE; - } - - if ( cmap->get_next_char ) - return cmap->get_next_char ( cmap, charcode ); - else - return 0; - } - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ /**** D R I V E R I N T E R F A C E ****/ /**** ****/ /**** ****/ @@ -496,8 +398,8 @@ (void*)0, /* driver specific interface */ - (FT_Module_Constructor)TT_Driver_Init, - (FT_Module_Destructor) TT_Driver_Done, + (FT_Module_Constructor)tt_driver_init, + (FT_Module_Destructor) tt_driver_done, (FT_Module_Requester) tt_get_interface, }, @@ -506,23 +408,20 @@ sizeof ( FT_GlyphSlotRec ), - (FT_Face_InitFunc) TT_Face_Init, - (FT_Face_DoneFunc) TT_Face_Done, - (FT_Size_InitFunc) TT_Size_Init, - (FT_Size_DoneFunc) TT_Size_Done, + (FT_Face_InitFunc) tt_face_init, + (FT_Face_DoneFunc) tt_face_done, + (FT_Size_InitFunc) tt_size_init, + (FT_Size_DoneFunc) tt_size_done, (FT_Slot_InitFunc) 0, (FT_Slot_DoneFunc) 0, (FT_Size_ResetPointsFunc) Set_Char_Sizes, (FT_Size_ResetPixelsFunc) Set_Pixel_Sizes, (FT_Slot_LoadFunc) Load_Glyph, - (FT_CharMap_CharIndexFunc)Get_Char_Index, (FT_Face_GetKerningFunc) Get_Kerning, (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc) 0, - - (FT_CharMap_CharNextFunc) Get_Next_Char + (FT_Face_GetAdvancesFunc) 0 }; Index: xc/extras/freetype2/src/truetype/ttdriver.c.save diff -u xc/extras/freetype2/src/truetype/ttdriver.c.save:1.2 xc/extras/freetype2/src/truetype/ttdriver.c.save:removed --- xc/extras/freetype2/src/truetype/ttdriver.c.save:1.2 Fri Oct 25 11:01:05 2002 +++ xc/extras/freetype2/src/truetype/ttdriver.c.save Sat Feb 28 21:40:21 2004 @@ -1,560 +0,0 @@ -/***************************************************************************/ -/* */ -/* ttdriver.c */ -/* */ -/* TrueType font driver implementation (body). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_TRUETYPE_IDS_H - -#include "ttdriver.h" -#include "ttgload.h" - -#include "tterrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttdriver - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ - /**** F A C E S ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - -#undef PAIR_TAG -#define PAIR_TAG( left, right ) ( ( (FT_ULong)left << 16 ) | \ - (FT_ULong)right ) - - - /*************************************************************************/ - /* */ - /* */ - /* Get_Kerning */ - /* */ - /* */ - /* A driver method used to return the kerning vector between two */ - /* glyphs of the same face. */ - /* */ - /* */ - /* face :: A handle to the source face object. */ - /* */ - /* left_glyph :: The index of the left glyph in the kern pair. */ - /* */ - /* right_glyph :: The index of the right glyph in the kern pair. */ - /* */ - /* */ - /* kerning :: The kerning vector. This is in font units for */ - /* scalable formats, and in pixels for fixed-sizes */ - /* formats. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Only horizontal layouts (left-to-right & right-to-left) are */ - /* supported by this function. Other layouts, or more sophisticated */ - /* kernings, are out of scope of this method (the basic driver */ - /* interface is meant to be simple). */ - /* */ - /* They can be implemented by format-specific interfaces. */ - /* */ - static FT_Error - Get_Kerning( TT_Face face, - FT_UInt left_glyph, - FT_UInt right_glyph, - FT_Vector* kerning ) - { - TT_Kern_0_Pair* pair; - - - if ( !face ) - return TT_Err_Invalid_Face_Handle; - - kerning->x = 0; - kerning->y = 0; - - if ( face->kern_pairs ) - { - /* there are some kerning pairs in this font file! */ - FT_ULong search_tag = PAIR_TAG( left_glyph, right_glyph ); - FT_Long left, right; - - - left = 0; - right = face->num_kern_pairs - 1; - - while ( left <= right ) - { - FT_Int middle = left + ( ( right - left ) >> 1 ); - FT_ULong cur_pair; - - - pair = face->kern_pairs + middle; - cur_pair = PAIR_TAG( pair->left, pair->right ); - - if ( cur_pair == search_tag ) - goto Found; - - if ( cur_pair < search_tag ) - left = middle + 1; - else - right = middle - 1; - } - } - - Exit: - return TT_Err_Ok; - - Found: - kerning->x = pair->value; - goto Exit; - } - - -#undef PAIR_TAG - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ - /**** S I Z E S ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* Set_Char_Sizes */ - /* */ - /* */ - /* A driver method used to reset a size's character sizes (horizontal */ - /* and vertical) expressed in fractional points. */ - /* */ - /* */ - /* char_width :: The character width expressed in 26.6 */ - /* fractional points. */ - /* */ - /* char_height :: The character height expressed in 26.6 */ - /* fractional points. */ - /* */ - /* horz_resolution :: The horizontal resolution of the output device. */ - /* */ - /* vert_resolution :: The vertical resolution of the output device. */ - /* */ - /* */ - /* size :: A handle to the target size object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - Set_Char_Sizes( TT_Size size, - FT_F26Dot6 char_width, - FT_F26Dot6 char_height, - FT_UInt horz_resolution, - FT_UInt vert_resolution ) - { - FT_Size_Metrics* metrics = &size->root.metrics; - TT_Face face = (TT_Face)size->root.face; - FT_Long dim_x, dim_y; - - - /* This bit flag, when set, indicates that the pixel size must be */ - /* truncated to an integer. Nearly all TrueType fonts have this */ - /* bit set, as hinting won't work really well otherwise. */ - /* */ - /* However, for those rare fonts who do not set it, we override */ - /* the default computations performed by the base layer. I */ - /* really don't know whether this is useful, but hey, that's the */ - /* spec :-) */ - /* */ - if ( ( face->header.Flags & 8 ) == 0 ) - { - /* Compute pixel sizes in 26.6 units */ - dim_x = ( char_width * horz_resolution + 36 ) / 72; - dim_y = ( char_height * vert_resolution + 36 ) / 72; - - metrics->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); - metrics->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); - - metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); - metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); - } - - size->ttmetrics.valid = FALSE; -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - size->strike_index = 0xFFFF; -#endif - - return TT_Reset_Size( size ); - } - - - /*************************************************************************/ - /* */ - /* */ - /* Set_Pixel_Sizes */ - /* */ - /* */ - /* A driver method used to reset a size's character sizes (horizontal */ - /* and vertical) expressed in integer pixels. */ - /* */ - /* */ - /* pixel_width :: The character width expressed in integer pixels. */ - /* */ - /* pixel_height :: The character height expressed in integer pixels. */ - /* */ - /* */ - /* size :: A handle to the target size object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - Set_Pixel_Sizes( TT_Size size, - FT_UInt pixel_width, - FT_UInt pixel_height ) - { - FT_UNUSED( pixel_width ); - FT_UNUSED( pixel_height ); - - /* many things have been pre-computed by the base layer */ - - size->ttmetrics.valid = FALSE; -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - size->strike_index = 0xFFFF; -#endif - - return TT_Reset_Size( size ); - } - - - /*************************************************************************/ - /* */ - /* */ - /* Load_Glyph */ - /* */ - /* */ - /* A driver method used to load a glyph within a given glyph slot. */ - /* */ - /* */ - /* slot :: A handle to the target slot object where the glyph */ - /* will be loaded. */ - /* */ - /* size :: A handle to the source face size at which the glyph */ - /* must be scaled, loaded, etc. */ - /* */ - /* glyph_index :: The index of the glyph in the font file. */ - /* */ - /* load_flags :: A flag indicating what to load for this glyph. The */ - /* FTLOAD_??? constants can be used to control the */ - /* glyph loading process (e.g., whether the outline */ - /* should be scaled, whether to load bitmaps or not, */ - /* whether to hint the outline, etc). */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - Load_Glyph( TT_GlyphSlot slot, - TT_Size size, - FT_UShort glyph_index, - FT_UInt load_flags ) - { - FT_Error error; - - - if ( !slot ) - return TT_Err_Invalid_Slot_Handle; - - /* check whether we want a scaled outline or bitmap */ - if ( !size ) - load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; - - if ( load_flags & FT_LOAD_NO_SCALE ) - size = NULL; - - /* reset the size object if necessary */ - if ( size ) - { - /* these two object must have the same parent */ - if ( size->root.face != slot->face ) - return TT_Err_Invalid_Face_Handle; - - if ( !size->ttmetrics.valid ) - { - if ( FT_SET_ERROR( TT_Reset_Size( size ) ) ) - return error; - } - } - - /* now load the glyph outline if necessary */ - error = TT_Load_Glyph( size, slot, glyph_index, load_flags ); - - /* force drop-out mode to 2 - irrelevant now */ - /* slot->outline.dropout_mode = 2; */ - - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ - /**** C H A R A C T E R M A P P I N G S ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* */ - /* Get_Char_Index */ - /* */ - /* */ - /* Uses a charmap to return a given character code's glyph index. */ - /* */ - /* */ - /* charmap :: A handle to the source charmap object. */ - /* charcode :: The character code. */ - /* */ - /* */ - /* Glyph index. 0 means `undefined character code'. */ - /* */ - static FT_UInt - Get_Char_Index( TT_CharMap charmap, - FT_Long charcode ) - { - FT_Error error; - TT_Face face; - TT_CMapTable* cmap; - - - cmap = &charmap->cmap; - face = (TT_Face)charmap->root.face; - - /* Load table if needed */ - if ( !cmap->loaded ) - { - SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt; - - - error = sfnt->load_charmap( face, cmap, face->root.stream ); - if ( error ) - return 0; - - cmap->loaded = TRUE; - } - - if ( cmap->get_index ) - return cmap->get_index( cmap, charcode ); - else - return 0; - } - - /*************************************************************************/ - /* */ - /* */ - /* Get_Next_Char */ - /* */ - /* */ - /* Uses a charmap to return the next encoded char. */ - /* */ - /* */ - /* charmap :: A handle to the source charmap object. */ - /* charcode :: The character code. */ - /* */ - /* */ - /* Next char code. 0 means `no more encoded characters'. */ - /* */ - static FT_UInt - Get_Next_Char( TT_CharMap charmap, - FT_Long charcode ) - { - FT_Error error; - TT_Face face; - TT_CMapTable* cmap; - - - cmap = &charmap->cmap; - face = (TT_Face)charmap->root.face; - - /* Load table if needed */ - if ( !cmap->loaded ) - { - SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt; - - - error = sfnt->load_charmap( face, cmap, face->root.stream ); - if ( error ) - return 0; - - cmap->loaded = TRUE; - } - - if ( cmap->get_next_char ) - return cmap->get_next_char ( cmap, charcode ); - else - return 0; - } - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ - /**** D R I V E R I N T E R F A C E ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - static FT_Module_Interface - tt_get_interface( TT_Driver driver, - const char* interface ) - { - FT_Module sfntd = FT_Get_Module( driver->root.root.library, - "sfnt" ); - SFNT_Interface* sfnt; - - - /* only return the default interface from the SFNT module */ - if ( sfntd ) - { - sfnt = (SFNT_Interface*)( sfntd->clazz->module_interface ); - if ( sfnt ) - return sfnt->get_interface( FT_MODULE( driver ), interface ); - } - - return 0; - } - - - /* The FT_DriverInterface structure is defined in ftdriver.h. */ - - FT_CALLBACK_TABLE_DEF - const FT_Driver_Class tt_driver_class = - { - { - ft_module_font_driver | - ft_module_driver_scalable | -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - ft_module_driver_has_hinter, -#else - 0, -#endif - - sizeof ( TT_DriverRec ), - - "truetype", /* driver name */ - 0x10000L, /* driver version == 1.0 */ - 0x20000L, /* driver requires FreeType 2.0 or above */ - - (void*)0, /* driver specific interface */ - - (FT_Module_Constructor)TT_Init_Driver, - (FT_Module_Destructor) TT_Done_Driver, - (FT_Module_Requester) tt_get_interface, - }, - - sizeof ( TT_FaceRec ), - sizeof ( TT_SizeRec ), - sizeof ( FT_GlyphSlotRec ), - - - (FTDriver_initFace) TT_Init_Face, - (FTDriver_doneFace) TT_Done_Face, - (FTDriver_initSize) TT_Init_Size, - (FTDriver_doneSize) TT_Done_Size, - (FTDriver_initGlyphSlot)0, - (FTDriver_doneGlyphSlot)0, - - (FTDriver_setCharSizes) Set_Char_Sizes, - (FTDriver_setPixelSizes)Set_Pixel_Sizes, - (FTDriver_loadGlyph) Load_Glyph, - (FTDriver_getCharIndex) Get_Char_Index, - - (FTDriver_getKerning) Get_Kerning, - (FTDriver_attachFile) 0, - (FTDriver_getAdvances) 0, - - (FTDriver_getNextChar) Get_Next_Char - }; - - -#ifdef FT_CONFIG_OPTION_DYNAMIC_DRIVERS - - - /*************************************************************************/ - /* */ - /* */ - /* getDriverClass */ - /* */ - /* */ - /* This function is used when compiling the TrueType driver as a */ - /* shared library (`.DLL' or `.so'). It will be used by the */ - /* high-level library of FreeType to retrieve the address of the */ - /* driver's generic interface. */ - /* */ - /* It shouldn't be implemented in a static build, as each driver must */ - /* have the same function as an exported entry point. */ - /* */ - /* */ - /* The address of the TrueType's driver generic interface. The */ - /* format-specific interface can then be retrieved through the method */ - /* interface->get_format_interface. */ - /* */ - FT_EXPORT_DEF( const FT_Driver_Class* ) - getDriverClass( void ) - { - return &tt_driver_class; - } - - -#endif /* CONFIG_OPTION_DYNAMIC_DRIVERS */ - - -/* END */ Index: xc/extras/freetype2/src/truetype/ttgload.c diff -u xc/extras/freetype2/src/truetype/ttgload.c:1.9 xc/extras/freetype2/src/truetype/ttgload.c:1.11 --- xc/extras/freetype2/src/truetype/ttgload.c:1.9 Thu Jun 20 04:25:29 2002 +++ xc/extras/freetype2/src/truetype/ttgload.c Wed Oct 22 14:51:24 2003 @@ -14,7 +14,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ -/* $XFree86: xc/extras/freetype2/src/truetype/ttgload.c,v 1.9 2002/06/20 08:25:29 keithp Exp $ */ + #include #include FT_INTERNAL_DEBUG_H @@ -43,16 +43,27 @@ /* */ /* Composite font flags. */ /* */ -#define ARGS_ARE_WORDS 0x001 -#define ARGS_ARE_XY_VALUES 0x002 -#define ROUND_XY_TO_GRID 0x004 -#define WE_HAVE_A_SCALE 0x008 -/* reserved 0x010 */ -#define MORE_COMPONENTS 0x020 -#define WE_HAVE_AN_XY_SCALE 0x040 -#define WE_HAVE_A_2X2 0x080 -#define WE_HAVE_INSTR 0x100 -#define USE_MY_METRICS 0x200 +#define ARGS_ARE_WORDS 0x0001 +#define ARGS_ARE_XY_VALUES 0x0002 +#define ROUND_XY_TO_GRID 0x0004 +#define WE_HAVE_A_SCALE 0x0008 +/* reserved 0x0010 */ +#define MORE_COMPONENTS 0x0020 +#define WE_HAVE_AN_XY_SCALE 0x0040 +#define WE_HAVE_A_2X2 0x0080 +#define WE_HAVE_INSTR 0x0100 +#define USE_MY_METRICS 0x0200 +#define OVERLAP_COMPOUND 0x0400 +#define SCALED_COMPONENT_OFFSET 0x0800 +#define UNSCALED_COMPONENT_OFFSET 0x1000 + + +/* Maximum recursion depth we allow for composite glyphs. + * The TrueType spec doesn't say anything about recursion, + * so it isn't clear that recursion is allowed at all. But + * we'll be generous. + */ +#define TT_MAX_COMPOSITE_RECURSE 5 @@ -91,6 +102,12 @@ FT_UShort k = header->number_Of_HMetrics; + if ( k == 0 ) + { + *bearing = *advance = 0; + return; + } + if ( idx < (FT_UInt)k ) { longs_m = (TT_LongMetrics )header->long_metrics + idx; @@ -450,7 +467,7 @@ /* clear the touch tags */ for ( n = 0; n < n_points; n++ ) - outline->tags[n] &= FT_Curve_Tag_On; + outline->tags[n] &= FT_CURVE_TAG_ON; outline->n_points = (FT_UShort)n_points; outline->n_contours = (FT_Short) n_contours; @@ -544,8 +561,8 @@ else if ( subglyph->flags & WE_HAVE_A_2X2 ) { xx = (FT_Fixed)FT_GET_SHORT() << 2; - xy = (FT_Fixed)FT_GET_SHORT() << 2; yx = (FT_Fixed)FT_GET_SHORT() << 2; + xy = (FT_Fixed)FT_GET_SHORT() << 2; yy = (FT_Fixed)FT_GET_SHORT() << 2; } @@ -739,7 +756,8 @@ /* */ static FT_Error load_truetype_glyph( TT_Loader loader, - FT_UInt glyph_index ) + FT_UInt glyph_index, + FT_UInt recurse_count ) { #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER @@ -750,15 +768,25 @@ TT_Face face = (TT_Face)loader->face; FT_ULong offset; FT_Int contours_count; - FT_UInt idx, num_points, count; + FT_UInt num_points, count; FT_Fixed x_scale, y_scale; FT_GlyphLoader gloader = loader->gloader; FT_Bool opened_frame = 0; +#ifdef FT_CONFIG_OPTION_INCREMENTAL + struct FT_StreamRec_ inc_stream; + FT_Data glyph_data; + FT_Bool glyph_data_loaded = 0; +#endif + + if ( recurse_count >= TT_MAX_COMPOSITE_RECURSE ) + { + error = TT_Err_Invalid_Composite; + goto Exit; + } /* check glyph index */ - idx = glyph_index; - if ( idx >= (FT_UInt)face->root.num_glyphs ) + if ( glyph_index >= (FT_UInt)face->root.num_glyphs ) { error = TT_Err_Invalid_Glyph_Index; goto Exit; @@ -777,16 +805,38 @@ /* get horizontal metrics */ { - FT_Short left_bearing; - FT_UShort advance_width; - + FT_Short left_bearing = 0; + FT_UShort advance_width = 0; - Get_HMetrics( face, idx, + Get_HMetrics( face, glyph_index, (FT_Bool)!( loader->load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ), &left_bearing, &advance_width ); +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* If this is an incrementally loaded font see if there are */ + /* overriding metrics for this glyph. */ + if ( face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs->get_glyph_metrics ) + { + FT_Incremental_MetricsRec metrics; + + metrics.bearing_x = left_bearing; + metrics.bearing_y = 0; + metrics.advance = advance_width; + error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, FALSE, &metrics ); + if ( error ) + goto Exit; + left_bearing = (FT_Short)metrics.bearing_x; + advance_width = (FT_UShort)metrics.advance; + } + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + loader->left_bearing = left_bearing; loader->advance = advance_width; @@ -797,11 +847,45 @@ } } - offset = face->glyph_locations[idx]; - count = 0; +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* Set `offset' to the start of the glyph program relative to the */ + /* start of the 'glyf' table, and `count' to the length of the */ + /* glyph program in bytes. */ + /* */ + /* If we are loading glyph data via the incremental interface, set */ + /* the loader stream to a memory stream reading the data returned */ + /* by the interface. */ + + if ( face->root.internal->incremental_interface ) + { + error = face->root.internal->incremental_interface->funcs->get_glyph_data( + face->root.internal->incremental_interface->object, + glyph_index, &glyph_data ); + if ( error ) + goto Exit; + + glyph_data_loaded = 1; + offset = 0; + count = glyph_data.length; + + FT_MEM_ZERO( &inc_stream, sizeof ( inc_stream ) ); + FT_Stream_OpenMemory( &inc_stream, + glyph_data.pointer, glyph_data.length ); + + loader->stream = &inc_stream; + } + else + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ - if ( idx < (FT_UInt)face->num_locations - 1 ) - count = face->glyph_locations[idx + 1] - offset; + { + offset = face->glyph_locations[glyph_index]; + count = 0; + + if ( glyph_index < (FT_UInt)face->num_locations - 1 ) + count = face->glyph_locations[glyph_index + 1] - offset; + } if ( count == 0 ) { @@ -907,7 +991,7 @@ /***********************************************************************/ /* otherwise, load a composite! */ - else + else if ( contours_count == -1 ) { TT_GlyphSlot glyph = (TT_GlyphSlot)loader->glyph; FT_UInt start_point; @@ -935,7 +1019,7 @@ /* if the flag FT_LOAD_NO_RECURSE is set, we return the subglyph */ /* `as is' in the glyph slot (the client application will be */ - /* responsible for interpreting this data)... */ + /* responsible for interpreting these data)... */ /* */ if ( loader->load_flags & FT_LOAD_NO_RECURSE ) { @@ -943,7 +1027,7 @@ FT_GlyphLoader_Add( gloader ); glyph->num_subglyphs = gloader->base.num_subglyphs; - glyph->format = ft_glyph_format_composite; + glyph->format = FT_GLYPH_FORMAT_COMPOSITE; glyph->subglyphs = gloader->base.subglyphs; goto Exit; @@ -981,7 +1065,8 @@ num_base_points = gloader->base.outline.n_points; - error = load_truetype_glyph( loader, subglyph->index ); + error = load_truetype_glyph( loader, subglyph->index, + recurse_count+1 ); if ( error ) goto Fail; @@ -1053,6 +1138,68 @@ x = subglyph->arg1; y = subglyph->arg2; + /* Use a default value dependent on */ + /* TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED. This is useful for old TT */ + /* fonts which don't set the xxx_COMPONENT_OFFSET bit. */ + +#ifdef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED + if ( !( subglyph->flags & UNSCALED_COMPONENT_OFFSET ) && +#else + if ( ( subglyph->flags & SCALED_COMPONENT_OFFSET ) && +#endif + ( subglyph->flags & ( WE_HAVE_A_SCALE | + WE_HAVE_AN_XY_SCALE | + WE_HAVE_A_2X2 )) ) + { +#if 0 + + /*************************************************************************/ + /* */ + /* This algorithm is what Apple documents. But it doesn't work. */ + /* */ + int a = subglyph->transform.xx > 0 ? subglyph->transform.xx + : -subglyph->transform.xx; + int b = subglyph->transform.yx > 0 ? subglyph->transform.yx + : -subglyph->transform.yx; + int c = subglyph->transform.xy > 0 ? subglyph->transform.xy + : -subglyph->transform.xy; + int d = subglyph->transform.yy > 0 ? subglyph->transform.yy + : -subglyph->transform.yy; + int m = a > b ? a : b; + int n = c > d ? c : d; + + + if ( a - b <= 33 && a - b >= -33 ) + m *= 2; + if ( c - d <= 33 && c - d >= -33 ) + n *= 2; + x = FT_MulFix( x, m ); + y = FT_MulFix( y, n ); + +#else /* 0 */ + + /*************************************************************************/ + /* */ + /* This algorithm is a guess and works much better than the above. */ + /* */ + int mac_xscale = FT_SqrtFixed( + FT_MulFix( subglyph->transform.xx, + subglyph->transform.xx ) + + FT_MulFix( subglyph->transform.xy, + subglyph->transform.xy) ); + int mac_yscale = FT_SqrtFixed( + FT_MulFix( subglyph->transform.yy, + subglyph->transform.yy ) + + FT_MulFix( subglyph->transform.yx, + subglyph->transform.yx ) ); + + + x = FT_MulFix( x, mac_xscale ); + y = FT_MulFix( y, mac_yscale ); +#endif /* 0 */ + + } + if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) ) { x = FT_MulFix( x, x_scale ); @@ -1066,7 +1213,7 @@ } } - if ( x | y ) + if ( x || y ) { translate_array( num_new_points, gloader->base.outline.points + num_base_points, @@ -1159,7 +1306,7 @@ for ( k = 0; k < num_points; k++ ) - pts->tags[k] &= FT_Curve_Tag_On; + pts->tags[k] &= FT_CURVE_TAG_ON; } cur_to_org( num_points + 2, pts ); @@ -1170,7 +1317,6 @@ exec->is_composite = TRUE; exec->pedantic_hinting = (FT_Bool)( loader->load_flags & FT_LOAD_PEDANTIC ); - error = TT_Run_Context( exec, ((TT_Size)loader->size)->debug ); if ( error && exec->pedantic_hinting ) goto Fail; @@ -1186,6 +1332,12 @@ } /* end of composite loading */ } + else + { + /* invalid composite count ( negative but not -1 ) */ + error = TT_Err_Invalid_Outline; + goto Fail; + } /***********************************************************************/ /***********************************************************************/ @@ -1196,11 +1348,19 @@ face->forget_glyph_frame( loader ); Exit: + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + if ( glyph_data_loaded ) + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object, + &glyph_data ); +#endif + return error; } - static void + static FT_Error compute_glyph_metrics( TT_Loader loader, FT_UInt glyph_index ) { @@ -1215,9 +1375,9 @@ if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) y_scale = size->root.metrics.y_scale; - if ( glyph->format != ft_glyph_format_composite ) + if ( glyph->format != FT_GLYPH_FORMAT_COMPOSITE ) { - glyph->outline.flags &= ~ft_outline_single_pass; + glyph->outline.flags &= ~FT_OUTLINE_SINGLE_PASS; /* copy outline to our glyph slot */ FT_GlyphLoader_CopyPoints( glyph->internal->loader, loader->gloader ); @@ -1280,9 +1440,8 @@ FT_Pos top; /* scaled vertical top side bearing */ FT_Pos advance; /* scaled vertical advance height */ - - /* Get the unscaled `tsb' and `ah' */ - if ( face->vertical_info && + /* Get the unscaled top bearing and advance height. */ + if ( face->vertical_info && face->vertical.number_Of_VMetrics > 0 ) { /* Don't assume that both the vertical header and vertical */ @@ -1323,8 +1482,35 @@ } } +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* If this is an incrementally loaded font see if there are */ + /* overriding metrics for this glyph. */ + if ( face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs->get_glyph_metrics ) + { + FT_Incremental_MetricsRec metrics; + FT_Error error = 0; + + metrics.bearing_x = 0; + metrics.bearing_y = top_bearing; + metrics.advance = advance_height; + error = + face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, TRUE, &metrics ); + + if ( error ) + return error; + + top_bearing = (FT_Short)metrics.bearing_y; + advance_height = (FT_UShort)metrics.advance; + } + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + /* We must adjust the top_bearing value from the bounding box given */ - /* in the glyph header to te bounding box calculated with */ + /* in the glyph header to the bounding box calculated with */ /* FT_Get_Outline_CBox(). */ /* scale the metrics */ @@ -1377,6 +1563,8 @@ /* set glyph dimensions */ glyph->metrics.width = bbox.xMax - bbox.xMin; glyph->metrics.height = bbox.yMax - bbox.yMin; + + return 0; } @@ -1411,7 +1599,7 @@ TT_Load_Glyph( TT_Size size, TT_GlyphSlot glyph, FT_UShort glyph_index, - FT_UInt load_flags ) + FT_Int32 load_flags ) { SFNT_Service sfnt; TT_Face face; @@ -1474,7 +1662,7 @@ glyph->metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6; glyph->metrics.vertAdvance = (FT_Pos)metrics.vertAdvance << 6; - glyph->format = ft_glyph_format_bitmap; + glyph->format = FT_GLYPH_FORMAT_BITMAP; if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) { glyph->bitmap_left = metrics.vertBearingX; @@ -1499,14 +1687,23 @@ /* the table might be accessed from a Postscript stream or something */ /* else... */ - error = face->goto_table( face, TTAG_glyf, stream, 0 ); - if ( error ) +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* Don't look for the glyph table if this is an incremental font. */ + if ( !face->root.internal->incremental_interface ) + +#endif + { - FT_ERROR(( "TT_Load_Glyph: could not access glyph table\n" )); - goto Exit; + error = face->goto_table( face, TTAG_glyf, stream, 0 ); + if ( error ) + { + FT_ERROR(( "TT_Load_Glyph: could not access glyph table\n" )); + goto Exit; + } } - FT_MEM_SET( &loader, 0, sizeof ( loader ) ); + FT_MEM_ZERO( &loader, sizeof ( loader ) ); /* update the glyph zone bounds */ { @@ -1552,7 +1749,15 @@ loader.glyph = (FT_GlyphSlot)glyph; loader.stream = stream; - loader.glyf_offset = FT_STREAM_POS(); +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + if ( face->root.internal->incremental_interface ) + loader.glyf_offset = 0; + else + +#endif + + loader.glyf_offset = FT_STREAM_POS(); #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER @@ -1564,10 +1769,10 @@ #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ /* Main loading loop */ - glyph->format = ft_glyph_format_outline; + glyph->format = FT_GLYPH_FORMAT_OUTLINE; glyph->num_subglyphs = 0; - error = load_truetype_glyph( &loader, glyph_index ); + error = load_truetype_glyph( &loader, glyph_index, 0 ); if ( !error ) compute_glyph_metrics( &loader, glyph_index ); @@ -1583,7 +1788,7 @@ /* TrueType glyphs at all sizes using the bytecode interpreter. */ /* */ if ( size && size->root.metrics.y_ppem < 24 ) - glyph->outline.flags |= ft_outline_high_precision; + glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION; Exit: return error; Index: xc/extras/freetype2/src/truetype/ttgload.h diff -u xc/extras/freetype2/src/truetype/ttgload.h:1.1.1.4 xc/extras/freetype2/src/truetype/ttgload.h:1.1.1.5 --- xc/extras/freetype2/src/truetype/ttgload.h:1.1.1.4 Thu Jun 20 04:16:25 2002 +++ xc/extras/freetype2/src/truetype/ttgload.h Wed May 28 22:01:57 2003 @@ -44,7 +44,7 @@ TT_Load_Glyph( TT_Size size, TT_GlyphSlot glyph, FT_UShort glyph_index, - FT_UInt load_flags ); + FT_Int32 load_flags ); FT_END_HEADER Index: xc/extras/freetype2/src/truetype/ttinterp.c diff -u xc/extras/freetype2/src/truetype/ttinterp.c:1.1.1.5 xc/extras/freetype2/src/truetype/ttinterp.c:1.1.1.6 --- xc/extras/freetype2/src/truetype/ttinterp.c:1.1.1.5 Thu Jun 20 04:16:26 2002 +++ xc/extras/freetype2/src/truetype/ttinterp.c Wed May 28 22:01:57 2003 @@ -568,7 +568,7 @@ exec->FDefs = size->function_defs; exec->IDefs = size->instruction_defs; exec->tt_metrics = size->ttmetrics; - exec->metrics = size->root.metrics; + exec->metrics = size->metrics; exec->maxFunc = size->max_func; exec->maxIns = size->max_ins; @@ -1175,15 +1175,15 @@ { FT_Int32 m, s, hi; FT_UInt32 l, lo; - + /* compute ax*bx as 64-bit value */ l = (FT_UInt32)( ( a & 0xFFFFU ) * b ); m = ( a >> 16 ) * b; - + lo = l + (FT_UInt32)( m << 16 ); hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l ); - + /* divide the result by 2^14 with rounding */ s = hi >> 31; l = lo + (FT_UInt32)s; @@ -1192,7 +1192,7 @@ l = lo + 0x2000U; hi += (l < lo); - + return ( hi << 18 ) | ( l >> 14 ); } @@ -1206,26 +1206,26 @@ { FT_Int32 m, s, hi1, hi2, hi; FT_UInt32 l, lo1, lo2, lo; - + /* compute ax*bx as 64-bit value */ l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx ); m = ( ax >> 16 ) * bx; - + lo1 = l + (FT_UInt32)( m << 16 ); hi1 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo1 < l ); - + /* compute ay*by as 64-bit value */ l = (FT_UInt32)( ( ay & 0xFFFFU ) * by ); m = ( ay >> 16 ) * by; - + lo2 = l + (FT_UInt32)( m << 16 ); hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l ); - + /* add them */ lo = lo1 + lo2; hi = hi1 + hi2 + ( lo < lo1 ); - + /* divide the result by 2^14 with rounding */ s = hi >> 31; l = lo + (FT_UInt32)s; @@ -1234,7 +1234,7 @@ l = lo + 0x2000U; hi += ( l < lo ); - + return ( hi << 18 ) | ( l >> 14 ); } @@ -1250,33 +1250,33 @@ FT_Int32 m, hi1, hi2, hi; FT_UInt32 l, lo1, lo2, lo; - + /* compute x*x as 64-bit value */ lo = (FT_UInt32)( x & 0xFFFFU ); hi = x >> 16; - + l = lo * lo; m = hi * lo; hi = hi * hi; - + lo1 = l + (FT_UInt32)( m << 17 ); hi1 = hi + ( m >> 15 ) + ( lo1 < l ); - + /* compute y*y as 64-bit value */ lo = (FT_UInt32)( y & 0xFFFFU ); hi = y >> 16; - + l = lo * lo; m = hi * lo; hi = hi * hi; - + lo2 = l + (FT_UInt32)( m << 17 ); hi2 = hi + ( m >> 15 ) + ( lo2 < l ); - + /* add them to get 'x*x+y*y' as 64-bit value */ lo = lo1 + lo2; hi = hi1 + hi2 + ( lo < lo1 ); - + /* compute the square root of this value */ { FT_UInt32 root, rem, test_div; @@ -1303,13 +1303,13 @@ } } while ( --count ); } - + return (FT_Int32)root; } } #else - + /* this version uses FT_Vector_Length which computes the same value */ /* much, much faster.. */ /* */ @@ -1325,7 +1325,7 @@ return FT_Vector_Length( &v ); } - + #endif @@ -1550,7 +1550,7 @@ #endif - zone->tags[point] |= FT_Curve_Tag_Touch_X; + zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; } v = CUR.GS.freeVector.y; @@ -1571,7 +1571,7 @@ #endif - zone->tags[point] |= FT_Curve_Tag_Touch_Y; + zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; } } @@ -1594,7 +1594,7 @@ FT_UNUSED_EXEC; zone->cur[point].x += distance; - zone->tags[point] |= FT_Curve_Tag_Touch_X; + zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; } @@ -1606,7 +1606,7 @@ FT_UNUSED_EXEC; zone->cur[point].y += distance; - zone->tags[point] |= FT_Curve_Tag_Touch_Y; + zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; } @@ -5023,7 +5023,7 @@ } } else - CUR.pts.tags[point] ^= FT_Curve_Tag_On; + CUR.pts.tags[point] ^= FT_CURVE_TAG_ON; CUR.GS.loop--; } @@ -5057,7 +5057,7 @@ } for ( I = L; I <= K; I++ ) - CUR.pts.tags[I] |= FT_Curve_Tag_On; + CUR.pts.tags[I] |= FT_CURVE_TAG_ON; } @@ -5085,7 +5085,7 @@ } for ( I = L; I <= K; I++ ) - CUR.pts.tags[I] &= ~FT_Curve_Tag_On; + CUR.pts.tags[I] &= ~FT_CURVE_TAG_ON; } @@ -5153,14 +5153,14 @@ { CUR.zp2.cur[point].x += dx; if ( touch ) - CUR.zp2.tags[point] |= FT_Curve_Tag_Touch_X; + CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X; } if ( CUR.GS.freeVector.y != 0 ) { CUR.zp2.cur[point].y += dy; if ( touch ) - CUR.zp2.tags[point] |= FT_Curve_Tag_Touch_Y; + CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y; } } @@ -5828,7 +5828,7 @@ dx = CUR.zp0.cur[b0].x - CUR.zp1.cur[a0].x; dy = CUR.zp0.cur[b0].y - CUR.zp1.cur[a0].y; - CUR.zp2.tags[point] |= FT_Curve_Tag_Touch_Both; + CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH; discriminant = TT_MULDIV( dax, -dby, 0x40 ) + TT_MULDIV( day, dbx, 0x40 ); @@ -6006,10 +6006,10 @@ mask = 0xFF; if ( CUR.GS.freeVector.x != 0 ) - mask &= ~FT_Curve_Tag_Touch_X; + mask &= ~FT_CURVE_TAG_TOUCH_X; if ( CUR.GS.freeVector.y != 0 ) - mask &= ~FT_Curve_Tag_Touch_Y; + mask &= ~FT_CURVE_TAG_TOUCH_Y; CUR.zp0.tags[point] &= mask; } @@ -6149,13 +6149,13 @@ if ( CUR.opcode & 1 ) { - mask = FT_Curve_Tag_Touch_X; + mask = FT_CURVE_TAG_TOUCH_X; V.orgs = CUR.pts.org; V.curs = CUR.pts.cur; } else { - mask = FT_Curve_Tag_Touch_Y; + mask = FT_CURVE_TAG_TOUCH_Y; V.orgs = (FT_Vector*)( (FT_Pos*)CUR.pts.org + 1 ); V.curs = (FT_Vector*)( (FT_Pos*)CUR.pts.cur + 1 ); } Index: xc/extras/freetype2/src/truetype/ttobjs.c diff -u xc/extras/freetype2/src/truetype/ttobjs.c:1.1.1.5 xc/extras/freetype2/src/truetype/ttobjs.c:1.1.1.6 --- xc/extras/freetype2/src/truetype/ttobjs.c:1.1.1.5 Thu Jun 20 04:16:26 2002 +++ xc/extras/freetype2/src/truetype/ttobjs.c Wed May 28 22:01:58 2003 @@ -57,7 +57,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Done_GlyphZone */ + /* tt_glyphzone_done */ /* */ /* */ /* Deallocates a glyph zone. */ @@ -66,25 +66,28 @@ /* zone :: A pointer to the target glyph zone. */ /* */ FT_LOCAL_DEF( void ) - TT_Done_GlyphZone( TT_GlyphZone zone ) + tt_glyphzone_done( TT_GlyphZone zone ) { FT_Memory memory = zone->memory; - - FT_FREE( zone->contours ); - FT_FREE( zone->tags ); - FT_FREE( zone->cur ); - FT_FREE( zone->org ); - - zone->max_points = zone->n_points = 0; - zone->max_contours = zone->n_contours = 0; + if ( memory ) + { + FT_FREE( zone->contours ); + FT_FREE( zone->tags ); + FT_FREE( zone->cur ); + FT_FREE( zone->org ); + + zone->max_points = zone->n_points = 0; + zone->max_contours = zone->n_contours = 0; + zone->memory = NULL; + } } /*************************************************************************/ /* */ /* */ - /* TT_New_GlyphZone */ + /* tt_glyphzone_new */ /* */ /* */ /* Allocates a new glyph zone. */ @@ -103,7 +106,7 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_New_GlyphZone( FT_Memory memory, + tt_glyphzone_new( FT_Memory memory, FT_UShort maxPoints, FT_Short maxContours, TT_GlyphZone zone ) @@ -114,7 +117,7 @@ if ( maxPoints > 0 ) maxPoints += 2; - FT_MEM_SET( zone, 0, sizeof ( *zone ) ); + FT_MEM_ZERO( zone, sizeof ( *zone ) ); zone->memory = memory; if ( FT_NEW_ARRAY( zone->org, maxPoints * 2 ) || @@ -122,7 +125,7 @@ FT_NEW_ARRAY( zone->tags, maxPoints ) || FT_NEW_ARRAY( zone->contours, maxContours ) ) { - TT_Done_GlyphZone( zone ); + tt_glyphzone_done( zone ); } return error; @@ -133,7 +136,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Face_Init */ + /* tt_face_init */ /* */ /* */ /* Initializes a given TrueType face object. */ @@ -154,7 +157,7 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Face_Init( FT_Stream stream, + tt_face_init( FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, @@ -197,9 +200,26 @@ goto Exit; if ( face->root.face_flags & FT_FACE_FLAG_SCALABLE ) - error = TT_Load_Locations( face, stream ) || - TT_Load_CVT ( face, stream ) || - TT_Load_Programs ( face, stream ); + { + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + if ( !face->root.internal->incremental_interface ) + error = tt_face_load_loca( face, stream ); + if ( !error ) + error = tt_face_load_cvt ( face, stream ) || + tt_face_load_fpgm ( face, stream ); + +#else + + if ( !error ) + error = tt_face_load_loca( face, stream ) || + tt_face_load_cvt ( face, stream ) || + tt_face_load_fpgm ( face, stream ); + +#endif + + } /* initialize standard glyph loading routines */ TT_Init_Glyph_Loading( face ); @@ -216,7 +236,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Face_Done */ + /* tt_face_done */ /* */ /* */ /* Finalizes a given face object. */ @@ -225,7 +245,7 @@ /* face :: A pointer to the face object to destroy. */ /* */ FT_LOCAL_DEF( void ) - TT_Face_Done( TT_Face face ) + tt_face_done( TT_Face face ) { FT_Memory memory = face->root.memory; FT_Stream stream = face->root.stream; @@ -266,7 +286,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Size_Init */ + /* tt_size_init */ /* */ /* */ /* Initializes a new TrueType size object. */ @@ -278,7 +298,7 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Size_Init( TT_Size size ) + tt_size_init( TT_Size size ) { FT_Error error = TT_Err_Ok; @@ -335,7 +355,7 @@ /* reserve twilight zone */ n_twilight = maxp->maxTwilightPoints; - error = TT_New_GlyphZone( memory, n_twilight, 0, &size->twilight ); + error = tt_glyphzone_new( memory, n_twilight, 0, &size->twilight ); if ( error ) goto Fail_Memory; @@ -436,7 +456,7 @@ Fail_Memory: - TT_Size_Done( size ); + tt_size_done( size ); return error; #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ @@ -447,7 +467,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Size_Done */ + /* tt_size_done */ /* */ /* */ /* The TrueType size object finalizer. */ @@ -456,7 +476,7 @@ /* size :: A handle to the target size object. */ /* */ FT_LOCAL_DEF( void ) - TT_Size_Done( TT_Size size ) + tt_size_done( TT_Size size ) { #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER @@ -479,7 +499,7 @@ size->storage_size = 0; /* twilight zone */ - TT_Done_GlyphZone( &size->twilight ); + tt_glyphzone_done( &size->twilight ); FT_FREE( size->function_defs ); FT_FREE( size->instruction_defs ); @@ -524,7 +544,7 @@ face = (TT_Face)size->root.face; - metrics = &size->root.metrics; + metrics = &size->metrics; if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 ) return TT_Err_Invalid_PPem; @@ -559,6 +579,7 @@ metrics->max_advance = ( FT_MulFix( face->root.max_advance_width, metrics->x_scale ) + 32 ) & -64; + #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS /* set to `invalid' by default */ size->strike_index = 0xFFFFU; @@ -673,7 +694,7 @@ SFNT_Service sfnt; - metrics = &size->root.metrics; + metrics = &size->metrics; if ( size->strike_index != 0xFFFFU ) return TT_Err_Ok; @@ -703,7 +724,7 @@ sbit_metrics->y_scale = 1 << 16; #endif - sbit_metrics->ascender = strike->hori.ascender << 6; + sbit_metrics->ascender = strike->hori.ascender << 6; sbit_metrics->descender = strike->hori.descender << 6; /* XXX: Is this correct? */ @@ -711,8 +732,8 @@ sbit_metrics->descender; /* XXX: Is this correct? */ - sbit_metrics->max_advance = ( strike->hori.min_origin_SB + - strike->hori.max_width + + sbit_metrics->max_advance = ( strike->hori.min_origin_SB + + strike->hori.max_width + strike->hori.min_advance_SB ) << 6; size->strike_index = strike_index; @@ -738,7 +759,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Size_Reset */ + /* tt_size_reset */ /* */ /* */ /* Resets a TrueType size when resolutions and character dimensions */ @@ -748,7 +769,7 @@ /* size :: A handle to the target size object. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Size_Reset( TT_Size size ) + tt_size_reset( TT_Size size ) { FT_Face face; FT_Error error = TT_Err_Ok; @@ -788,7 +809,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Driver_Init */ + /* tt_driver_init */ /* */ /* */ /* Initializes a given TrueType driver object. */ @@ -800,7 +821,7 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Driver_Init( TT_Driver driver ) + tt_driver_init( TT_Driver driver ) { FT_Error error; @@ -815,7 +836,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Driver_Done */ + /* tt_driver_done */ /* */ /* */ /* Finalizes a given TrueType driver. */ @@ -824,7 +845,7 @@ /* driver :: A handle to the target TrueType driver. */ /* */ FT_LOCAL_DEF( void ) - TT_Driver_Done( TT_Driver driver ) + tt_driver_done( TT_Driver driver ) { #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER Index: xc/extras/freetype2/src/truetype/ttobjs.h diff -u xc/extras/freetype2/src/truetype/ttobjs.h:1.1.1.5 xc/extras/freetype2/src/truetype/ttobjs.h:1.1.1.6 --- xc/extras/freetype2/src/truetype/ttobjs.h:1.1.1.5 Thu Jun 20 04:16:26 2002 +++ xc/extras/freetype2/src/truetype/ttobjs.h Wed May 28 22:01:58 2003 @@ -108,10 +108,10 @@ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER FT_LOCAL( void ) - TT_Done_GlyphZone( TT_GlyphZone zone ); + tt_glyphzone_done( TT_GlyphZone zone ); FT_LOCAL( FT_Error ) - TT_New_GlyphZone( FT_Memory memory, + tt_glyphzone_new( FT_Memory memory, FT_UShort maxPoints, FT_Short maxContours, TT_GlyphZone zone ); @@ -311,6 +311,7 @@ { FT_SizeRec root; + FT_Size_Metrics metrics; /* slightly different from the root metrics */ TT_Size_Metrics ttmetrics; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS @@ -379,14 +380,14 @@ /* Face functions */ /* */ FT_LOCAL( FT_Error ) - TT_Face_Init( FT_Stream stream, + tt_face_init( FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( void ) - TT_Face_Done( TT_Face face ); + tt_face_done( TT_Face face ); /*************************************************************************/ @@ -394,13 +395,13 @@ /* Size functions */ /* */ FT_LOCAL( FT_Error ) - TT_Size_Init( TT_Size size ); + tt_size_init( TT_Size size ); FT_LOCAL( void ) - TT_Size_Done( TT_Size size ); + tt_size_done( TT_Size size ); FT_LOCAL( FT_Error ) - TT_Size_Reset( TT_Size size ); + tt_size_reset( TT_Size size ); /*************************************************************************/ @@ -408,10 +409,10 @@ /* Driver functions */ /* */ FT_LOCAL( FT_Error ) - TT_Driver_Init( TT_Driver driver ); + tt_driver_init( TT_Driver driver ); FT_LOCAL( void ) - TT_Driver_Done( TT_Driver driver ); + tt_driver_done( TT_Driver driver ); FT_END_HEADER Index: xc/extras/freetype2/src/truetype/ttpload.c diff -u xc/extras/freetype2/src/truetype/ttpload.c:1.1.1.5 xc/extras/freetype2/src/truetype/ttpload.c:1.1.1.6 --- xc/extras/freetype2/src/truetype/ttpload.c:1.1.1.5 Thu Jun 20 04:16:26 2002 +++ xc/extras/freetype2/src/truetype/ttpload.c Wed May 28 22:01:58 2003 @@ -40,7 +40,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Load_Locations */ + /* tt_face_load_loca */ /* */ /* */ /* Loads the locations table. */ @@ -55,7 +55,7 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_Locations( TT_Face face, + tt_face_load_loca( TT_Face face, FT_Stream stream ) { FT_Error error; @@ -129,7 +129,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Load_CVT */ + /* tt_face_load_cvt */ /* */ /* */ /* Loads the control value table into a face object. */ @@ -144,8 +144,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_CVT( TT_Face face, - FT_Stream stream ) + tt_face_load_cvt( TT_Face face, + FT_Stream stream ) { FT_Error error; FT_Memory memory = stream->memory; @@ -194,7 +194,7 @@ /*************************************************************************/ /* */ /* */ - /* TT_Load_Progams */ + /* tt_face_load_fpgm */ /* */ /* */ /* Loads the font program and the cvt program. */ @@ -209,8 +209,8 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_Load_Programs( TT_Face face, - FT_Stream stream ) + tt_face_load_fpgm( TT_Face face, + FT_Stream stream ) { FT_Error error; FT_ULong table_len; Index: xc/extras/freetype2/src/truetype/ttpload.h diff -u xc/extras/freetype2/src/truetype/ttpload.h:1.1.1.4 xc/extras/freetype2/src/truetype/ttpload.h:1.1.1.5 --- xc/extras/freetype2/src/truetype/ttpload.h:1.1.1.4 Thu Jun 20 04:16:26 2002 +++ xc/extras/freetype2/src/truetype/ttpload.h Wed May 28 22:01:58 2003 @@ -28,16 +28,16 @@ FT_LOCAL( FT_Error ) - TT_Load_Locations( TT_Face face, + tt_face_load_loca( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_CVT( TT_Face face, - FT_Stream stream ); + tt_face_load_cvt( TT_Face face, + FT_Stream stream ); FT_LOCAL( FT_Error ) - TT_Load_Programs( TT_Face face, - FT_Stream stream ); + tt_face_load_fpgm( TT_Face face, + FT_Stream stream ); FT_END_HEADER Index: xc/extras/freetype2/src/type1/Jamfile diff -u xc/extras/freetype2/src/type1/Jamfile:1.1.1.1 xc/extras/freetype2/src/type1/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/type1/Jamfile:1.1.1.1 Sun Sep 9 22:56:11 2001 +++ xc/extras/freetype2/src/type1/Jamfile Wed May 28 22:01:58 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/type1 Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src type1 ; - -SubDirHdrs [ FT2_SubDir src type1 ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) type1 ; { local _sources ; Index: xc/extras/freetype2/src/type1/t1afm.c diff -u xc/extras/freetype2/src/type1/t1afm.c:1.1.1.5 xc/extras/freetype2/src/type1/t1afm.c:1.1.1.6 --- xc/extras/freetype2/src/type1/t1afm.c:1.1.1.5 Thu Jun 20 04:16:26 2002 +++ xc/extras/freetype2/src/type1/t1afm.c Wed May 28 22:01:58 2003 @@ -56,10 +56,10 @@ FT_Byte* limit, T1_Font type1 ) { - FT_Byte* p = *start; - FT_Int len; - FT_UInt result = 0; - char temp[64]; + FT_Byte* p = *start; + FT_PtrDist len; + FT_UInt result = 0; + char temp[64]; /* skip whitespace */ @@ -72,7 +72,7 @@ while ( IS_ALPHANUM( *p ) && p < limit ) p++; - len = (FT_Int)( p - *start ); + len = p - *start; if ( len > 0 && len < 64 ) { Index: xc/extras/freetype2/src/type1/t1driver.c diff -u xc/extras/freetype2/src/type1/t1driver.c:1.1.1.8 xc/extras/freetype2/src/type1/t1driver.c:1.1.1.9 --- xc/extras/freetype2/src/type1/t1driver.c:1.1.1.8 Thu Jun 20 04:16:26 2002 +++ xc/extras/freetype2/src/type1/t1driver.c Wed May 28 22:01:59 2003 @@ -227,233 +227,6 @@ #endif /* T1_CONFIG_OPTION_NO_AFM */ - /*************************************************************************/ - /* */ - /* */ - /* Get_Char_Index */ - /* */ - /* */ - /* Uses a charmap to return a given character code's glyph index. */ - /* */ - /* */ - /* charmap :: A handle to the source charmap object. */ - /* */ - /* charcode :: The character code. */ - /* */ - /* */ - /* Glyph index. 0 means `undefined character code'. */ - /* */ - static FT_UInt - Get_Char_Index( FT_CharMap charmap, - FT_Long charcode ) - { - T1_Face face; - FT_UInt result = 0; - PSNames_Service psnames; - - - face = (T1_Face)charmap->face; - psnames = (PSNames_Service)face->psnames; - if ( psnames ) - switch ( charmap->encoding ) - { - /*******************************************************************/ - /* */ - /* Unicode encoding support */ - /* */ - case ft_encoding_unicode: - /* use the `PSNames' module to synthetize the Unicode charmap */ - result = psnames->lookup_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /* the function returns 0xFFFF if the Unicode charcode has */ - /* no corresponding glyph */ - if ( result == 0xFFFFU ) - result = 0; - goto Exit; - - /*******************************************************************/ - /* */ - /* ISOLatin1 encoding support */ - /* */ - case ft_encoding_latin_1: - /* ISOLatin1 is the first page of Unicode */ - if ( charcode < 256 && psnames->unicode_value ) - { - result = psnames->lookup_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /* the function returns 0xFFFF if the Unicode charcode has */ - /* no corresponding glyph */ - if ( result == 0xFFFFU ) - result = 0; - } - goto Exit; - - /*******************************************************************/ - /* */ - /* Custom Type 1 encoding */ - /* */ - case ft_encoding_adobe_custom: - { - T1_Encoding encoding = &face->type1.encoding; - - - if ( charcode >= encoding->code_first && - charcode <= encoding->code_last ) - result = encoding->char_index[charcode]; - goto Exit; - } - - /*******************************************************************/ - /* */ - /* Adobe Standard & Expert encoding support */ - /* */ - default: - if ( charcode < 256 ) - { - FT_UInt code; - FT_Int n; - const char* glyph_name; - - - code = psnames->adobe_std_encoding[charcode]; - if ( charmap->encoding == ft_encoding_adobe_expert ) - code = psnames->adobe_expert_encoding[charcode]; - - glyph_name = psnames->adobe_std_strings( code ); - if ( !glyph_name ) - break; - - for ( n = 0; n < face->type1.num_glyphs; n++ ) - { - const char* gname = face->type1.glyph_names[n]; - - - if ( gname && gname[0] == glyph_name[0] && - ft_strcmp( gname, glyph_name ) == 0 ) - { - result = n; - break; - } - } - } - } - Exit: - return result; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Get_Next_Char */ - /* */ - /* */ - /* Uses a charmap to return the next encoded char. */ - /* */ - /* */ - /* charmap :: A handle to the source charmap object. */ - /* */ - /* charcode :: The character code. */ - /* */ - /* */ - /* Next char code. 0 means `no more char codes'. */ - /* */ - static FT_Long - Get_Next_Char( FT_CharMap charmap, - FT_Long charcode ) - { - T1_Face face; - PSNames_Service psnames; - - - face = (T1_Face)charmap->face; - psnames = (PSNames_Service)face->psnames; - - if ( psnames ) - switch ( charmap->encoding ) - { - /*******************************************************************/ - /* */ - /* Unicode encoding support */ - /* */ - case ft_encoding_unicode: - /* use the `PSNames' module to synthetize the Unicode charmap */ - return psnames->next_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /*******************************************************************/ - /* */ - /* ISOLatin1 encoding support */ - /* */ - case ft_encoding_latin_1: - { - FT_Long code; - - - /* use the `PSNames' module to synthetize the Unicode charmap */ - code = psnames->next_unicode( &face->unicode_map, - (FT_ULong)charcode ); - if ( code < 256 ) - return code; - break; - } - - /*******************************************************************/ - /* */ - /* Custom Type 1 encoding */ - /* */ - case ft_encoding_adobe_custom: - { - T1_Encoding encoding = &face->type1.encoding; - - - charcode++; - if ( charcode < encoding->code_first ) - charcode = encoding->code_first; - while ( charcode <= encoding->code_last ) - { - if ( encoding->char_index[charcode] ) - return charcode; - charcode++; - } - } - - /*******************************************************************/ - /* */ - /* Adobe Standard & Expert encoding support */ - /* */ - default: - while ( ++charcode < 256 ) - { - FT_UInt code; - FT_Int n; - const char* glyph_name; - - - code = psnames->adobe_std_encoding[charcode]; - if ( charmap->encoding == ft_encoding_adobe_expert ) - code = psnames->adobe_expert_encoding[charcode]; - - glyph_name = psnames->adobe_std_strings( code ); - if ( !glyph_name ) - continue; - - for ( n = 0; n < face->type1.num_glyphs; n++ ) - { - const char* gname = face->type1.glyph_names[n]; - - - if ( gname && gname[0] == glyph_name[0] && - ft_strcmp( gname, glyph_name ) == 0 ) - return charcode; - } - } - } - - return 0; - } FT_CALLBACK_TABLE_DEF @@ -491,7 +264,6 @@ (FT_Size_ResetPointsFunc) T1_Size_Reset, (FT_Size_ResetPixelsFunc) T1_Size_Reset, (FT_Slot_LoadFunc) T1_Load_Glyph, - (FT_CharMap_CharIndexFunc)Get_Char_Index, #ifdef T1_CONFIG_OPTION_NO_AFM (FT_Face_GetKerningFunc) 0, @@ -500,9 +272,7 @@ (FT_Face_GetKerningFunc) Get_Kerning, (FT_Face_AttachFunc) T1_Read_AFM, #endif - (FT_Face_GetAdvancesFunc) 0, - - (FT_CharMap_CharNextFunc) Get_Next_Char + (FT_Face_GetAdvancesFunc) 0 }; Index: xc/extras/freetype2/src/type1/t1driver.c.save diff -u xc/extras/freetype2/src/type1/t1driver.c.save:1.2 xc/extras/freetype2/src/type1/t1driver.c.save:removed --- xc/extras/freetype2/src/type1/t1driver.c.save:1.2 Fri Oct 25 11:01:05 2002 +++ xc/extras/freetype2/src/type1/t1driver.c.save Sat Feb 28 21:40:21 2004 @@ -1,541 +0,0 @@ -/***************************************************************************/ -/* */ -/* t1driver.c */ -/* */ -/* Type 1 driver interface (body). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include "t1driver.h" -#include "t1gload.h" -#include "t1load.h" - -#include "t1errors.h" - -#ifndef T1_CONFIG_OPTION_NO_AFM -#include "t1afm.h" -#endif - -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_NAMES_H - -#include /* for strcmp() */ - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_t1driver - - - static FT_Error - t1_get_glyph_name( T1_Face face, - FT_UInt glyph_index, - FT_Pointer buffer, - FT_UInt buffer_max ) - { - FT_String* gname; - - - gname = face->type1.glyph_names[glyph_index]; - - if ( buffer_max > 0 ) - { - FT_UInt len = (FT_UInt)( strlen( gname ) ); - - - if (len >= buffer_max) - len = buffer_max - 1; - - MEM_Copy( buffer, gname, len ); - ((FT_Byte*)buffer)[len] = 0; - } - - return T1_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* t1_get_name_index */ - /* */ - /* */ - /* Uses the Type 1 font's `glyph_names' table to find a given glyph */ - /* name's glyph index. */ - /* */ - /* */ - /* face :: A handle to the source face object. */ - /* */ - /* glyph_name :: The glyph name. */ - /* */ - /* */ - /* Glyph index. 0 means `undefined character code'. */ - /* */ - static FT_UInt - t1_get_name_index( T1_Face face, - FT_String* glyph_name ) - { - FT_Int i; - FT_String* gname; - - - for ( i = 0; i < face->type1.num_glyphs; i++ ) - { - gname = face->type1.glyph_names[i]; - - if ( !strcmp( glyph_name, gname ) ) - return (FT_UInt)i; - } - - return 0; - } - - - static const char* - t1_get_ps_name( T1_Face face ) - { - return (const char*) face->type1.font_name; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Get_Interface */ - /* */ - /* */ - /* Each driver can provide one or more extensions to the base */ - /* FreeType API. These can be used to access format specific */ - /* features (e.g., all TrueType/OpenType resources share a common */ - /* file structure and common tables which can be accessed through the */ - /* `sfnt' interface), or more simply generic ones (e.g., the */ - /* `postscript names' interface which can be used to retrieve the */ - /* PostScript name of a given glyph index). */ - /* */ - /* */ - /* driver :: A handle to a driver object. */ - /* */ - /* */ - /* interface :: A string designing the interface. Examples are */ - /* `sfnt', `post_names', `charmaps', etc. */ - /* */ - /* */ - /* A typeless pointer to the extension's interface (normally a table */ - /* of function pointers). Returns NULL if the requested extension */ - /* isn't available (i.e., wasn't compiled in the driver at build */ - /* time). */ - /* */ - static FT_Module_Interface - Get_Interface( FT_Driver driver, - const FT_String* interface ) - { - FT_UNUSED( driver ); - FT_UNUSED( interface ); - - if ( strcmp( (const char*)interface, "glyph_name" ) == 0 ) - return (FT_Module_Interface)t1_get_glyph_name; - - if ( strcmp( (const char*)interface, "name_index" ) == 0 ) - return (FT_Module_Interface)t1_get_name_index; - - if ( strcmp( (const char*)interface, "postscript_name" ) == 0 ) - return (FT_Module_Interface)t1_get_ps_name; - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - if ( strcmp( (const char*)interface, "get_mm" ) == 0 ) - return (FT_Module_Interface)T1_Get_Multi_Master; - - if ( strcmp( (const char*)interface, "set_mm_design") == 0 ) - return (FT_Module_Interface)T1_Set_MM_Design; - - if ( strcmp( (const char*)interface, "set_mm_blend") == 0 ) - return (FT_Module_Interface)T1_Set_MM_Blend; -#endif - return 0; - } - - -#ifndef T1_CONFIG_OPTION_NO_AFM - - /*************************************************************************/ - /* */ - /* */ - /* Get_Kerning */ - /* */ - /* */ - /* A driver method used to return the kerning vector between two */ - /* glyphs of the same face. */ - /* */ - /* */ - /* face :: A handle to the source face object. */ - /* */ - /* left_glyph :: The index of the left glyph in the kern pair. */ - /* */ - /* right_glyph :: The index of the right glyph in the kern pair. */ - /* */ - /* */ - /* kerning :: The kerning vector. This is in font units for */ - /* scalable formats, and in pixels for fixed-sizes */ - /* formats. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Only horizontal layouts (left-to-right & right-to-left) are */ - /* supported by this function. Other layouts, or more sophisticated */ - /* kernings are out of scope of this method (the basic driver */ - /* interface is meant to be simple). */ - /* */ - /* They can be implemented by format-specific interfaces. */ - /* */ - static FT_Error - Get_Kerning( T1_Face face, - FT_UInt left_glyph, - FT_UInt right_glyph, - FT_Vector* kerning ) - { - T1_AFM* afm; - - - kerning->x = 0; - kerning->y = 0; - - afm = (T1_AFM*)face->afm_data; - if ( afm ) - T1_Get_Kerning( afm, left_glyph, right_glyph, kerning ); - - return T1_Err_Ok; - } - - -#endif /* T1_CONFIG_OPTION_NO_AFM */ - - - /*************************************************************************/ - /* */ - /* */ - /* Get_Char_Index */ - /* */ - /* */ - /* Uses a charmap to return a given character code's glyph index. */ - /* */ - /* */ - /* charmap :: A handle to the source charmap object. */ - /* charcode :: The character code. */ - /* */ - /* */ - /* Glyph index. 0 means `undefined character code'. */ - /* */ - static FT_UInt - Get_Char_Index( FT_CharMap charmap, - FT_Long charcode ) - { - T1_Face face; - FT_UInt result = 0; - PSNames_Interface* psnames; - - - face = (T1_Face)charmap->face; - psnames = (PSNames_Interface*)face->psnames; - if ( psnames ) - switch ( charmap->encoding ) - { - /*******************************************************************/ - /* */ - /* Unicode encoding support */ - /* */ - case ft_encoding_unicode: - /* use the `PSNames' module to synthetize the Unicode charmap */ - result = psnames->lookup_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /* the function returns 0xFFFF if the Unicode charcode has */ - /* no corresponding glyph */ - if ( result == 0xFFFF ) - result = 0; - goto Exit; - - /*******************************************************************/ - /* */ - /* ISOLatin1 encoding support */ - /* */ - case ft_encoding_latin_1: - /* ISOLatin1 is the first page of Unicode */ - if ( charcode < 256 && psnames->unicode_value ) - { - result = psnames->lookup_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /* the function returns 0xFFFF if the Unicode charcode has */ - /* no corresponding glyph */ - if ( result == 0xFFFF ) - result = 0; - } - goto Exit; - - /*******************************************************************/ - /* */ - /* Custom Type 1 encoding */ - /* */ - case ft_encoding_adobe_custom: - { - T1_Encoding* encoding = &face->type1.encoding; - - - if ( charcode >= encoding->code_first && - charcode <= encoding->code_last ) - result = encoding->char_index[charcode]; - goto Exit; - } - - /*******************************************************************/ - /* */ - /* Adobe Standard & Expert encoding support */ - /* */ - default: - if ( charcode < 256 ) - { - FT_UInt code; - FT_Int n; - const char* glyph_name; - - - code = psnames->adobe_std_encoding[charcode]; - if ( charmap->encoding == ft_encoding_adobe_expert ) - code = psnames->adobe_expert_encoding[charcode]; - - glyph_name = psnames->adobe_std_strings( code ); - if ( !glyph_name ) - break; - - for ( n = 0; n < face->type1.num_glyphs; n++ ) - { - const char* gname = face->type1.glyph_names[n]; - - - if ( gname && gname[0] == glyph_name[0] && - strcmp( gname, glyph_name ) == 0 ) - { - result = n; - break; - } - } - } - } - Exit: - return result; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Get_Next_Char */ - /* */ - /* */ - /* Uses a charmap to return the next encoded char. */ - /* */ - /* */ - /* charmap :: A handle to the source charmap object. */ - /* charcode :: The character code. */ - /* */ - /* */ - /* Next char code. 0 means `no more char codes'. */ - /* */ - static FT_Long - Get_Next_Char( FT_CharMap charmap, - FT_Long charcode ) - { - T1_Face face; - PSNames_Interface* psnames; - - - face = (T1_Face)charmap->face; - psnames = (PSNames_Interface*)face->psnames; - - if ( psnames ) - switch ( charmap->encoding ) - { - /*******************************************************************/ - /* */ - /* Unicode encoding support */ - /* */ - case ft_encoding_unicode: - /* use the `PSNames' module to synthetize the Unicode charmap */ - return psnames->next_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /*******************************************************************/ - /* */ - /* ISOLatin1 encoding support */ - /* */ - case ft_encoding_latin_1: - { - FT_Long code; - - - /* use the `PSNames' module to synthetize the Unicode charmap */ - code = psnames->next_unicode( &face->unicode_map, - (FT_ULong)charcode ); - if ( code < 256 ) - return code; - break; - } - - /*******************************************************************/ - /* */ - /* Custom Type 1 encoding */ - /* */ - case ft_encoding_adobe_custom: - { - T1_Encoding* encoding = &face->type1.encoding; - - - charcode++; - if ( charcode < encoding->code_first ) - charcode = encoding->code_first; - while ( charcode <= encoding->code_last ) - { - if ( encoding->char_index[charcode] ) - return charcode; - charcode++; - } - } - - /*******************************************************************/ - /* */ - /* Adobe Standard & Expert encoding support */ - /* */ - default: - while ( ++charcode < 256 ) - { - FT_UInt code; - FT_Int n; - const char* glyph_name; - - - code = psnames->adobe_std_encoding[charcode]; - if ( charmap->encoding == ft_encoding_adobe_expert ) - code = psnames->adobe_expert_encoding[charcode]; - - glyph_name = psnames->adobe_std_strings( code ); - if ( !glyph_name ) - continue; - - for ( n = 0; n < face->type1.num_glyphs; n++ ) - { - const char* gname = face->type1.glyph_names[n]; - - - if ( gname && gname[0] == glyph_name[0] && - strcmp( gname, glyph_name ) == 0 ) - return charcode; - } - } - } - - return 0; - } - - - FT_CALLBACK_TABLE_DEF - const FT_Driver_Class t1_driver_class = - { - { - ft_module_font_driver | - ft_module_driver_scalable | - ft_module_driver_has_hinter, - - sizeof( FT_DriverRec ), - - "type1", - 0x10000L, - 0x20000L, - - 0, /* format interface */ - - (FT_Module_Constructor)T1_Driver_Init, - (FT_Module_Destructor) T1_Driver_Done, - (FT_Module_Requester) Get_Interface, - }, - - sizeof( T1_FaceRec ), - sizeof( T1_SizeRec ), - sizeof( T1_GlyphSlotRec ), - - (FTDriver_initFace) T1_Face_Init, - (FTDriver_doneFace) T1_Face_Done, - (FTDriver_initSize) T1_Size_Init, - (FTDriver_doneSize) T1_Size_Done, - (FTDriver_initGlyphSlot)T1_GlyphSlot_Init, - (FTDriver_doneGlyphSlot)T1_GlyphSlot_Done, - - (FTDriver_setCharSizes) T1_Size_Reset, - (FTDriver_setPixelSizes)T1_Size_Reset, - (FTDriver_loadGlyph) T1_Load_Glyph, - (FTDriver_getCharIndex) Get_Char_Index, - -#ifdef T1_CONFIG_OPTION_NO_AFM - (FTDriver_getKerning) 0, - (FTDriver_attachFile) 0, -#else - (FTDriver_getKerning) Get_Kerning, - (FTDriver_attachFile) T1_Read_AFM, -#endif - (FTDriver_getAdvances) 0, - - (FTDriver_getNextChar) Get_Next_Char - }; - - -#ifdef FT_CONFIG_OPTION_DYNAMIC_DRIVERS - - - /*************************************************************************/ - /* */ - /* */ - /* getDriverClass */ - /* */ - /* */ - /* This function is used when compiling the TrueType driver as a */ - /* shared library (`.DLL' or `.so'). It will be used by the */ - /* high-level library of FreeType to retrieve the address of the */ - /* driver's generic interface. */ - /* */ - /* It shouldn't be implemented in a static build, as each driver must */ - /* have the same function as an exported entry point. */ - /* */ - /* */ - /* The address of the TrueType's driver generic interface. The */ - /* format-specific interface can then be retrieved through the method */ - /* interface->get_format_interface. */ - /* */ - FT_EXPORT_DEF( const FT_Driver_Class* ) - getDriverClass( void ) - { - return &t1_driver_class; - } - - -#endif /* FT_CONFIG_OPTION_DYNAMIC_DRIVERS */ - - -/* END */ Index: xc/extras/freetype2/src/type1/t1gload.c diff -u xc/extras/freetype2/src/type1/t1gload.c:1.1.1.6 xc/extras/freetype2/src/type1/t1gload.c:1.2 --- xc/extras/freetype2/src/type1/t1gload.c:1.1.1.6 Thu Jun 20 04:16:26 2002 +++ xc/extras/freetype2/src/type1/t1gload.c Wed Oct 22 13:26:31 2003 @@ -14,7 +14,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ - +/* $XFree86: xc/extras/freetype2/src/type1/t1gload.c,v 1.2 2003/10/22 17:26:31 tsi Exp $ */ #include #include "t1gload.h" @@ -53,21 +53,91 @@ /*************************************************************************/ + FT_LOCAL_DEF( FT_Error ) + T1_Parse_Glyph_And_Get_Char_String( T1_Decoder decoder, + FT_UInt glyph_index, + FT_Data* char_string ) + { + T1_Face face = (T1_Face)decoder->builder.face; + T1_Font type1 = &face->type1; + FT_Error error = 0; + + + decoder->font_matrix = type1->font_matrix; + decoder->font_offset = type1->font_offset; + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* For incremental fonts get the character data using the */ + /* callback function. */ + if ( face->root.internal->incremental_interface ) + error = face->root.internal->incremental_interface->funcs->get_glyph_data( + face->root.internal->incremental_interface->object, + glyph_index, char_string ); + else + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + /* For ordinary fonts get the character data stored in the face record. */ + { + char_string->pointer = type1->charstrings[glyph_index]; + char_string->length = type1->charstrings_len[glyph_index]; + } + + if ( !error ) + error = decoder->funcs.parse_charstrings( + decoder, (FT_Byte*)char_string->pointer, + char_string->length ); + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* Incremental fonts can optionally override the metrics. */ + if ( !error && face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs->get_glyph_metrics ) + { + FT_Incremental_MetricsRec metrics; + + metrics.bearing_x = decoder->builder.left_bearing.x; + metrics.bearing_y = decoder->builder.left_bearing.y; + metrics.advance = decoder->builder.advance.x; + error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, FALSE, &metrics ); + decoder->builder.left_bearing.x = metrics.bearing_x; + decoder->builder.left_bearing.y = metrics.bearing_y; + decoder->builder.advance.x = metrics.advance; + decoder->builder.advance.y = 0; + } + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + return error; + } + + FT_CALLBACK_DEF( FT_Error ) T1_Parse_Glyph( T1_Decoder decoder, FT_UInt glyph_index ) { - T1_Face face = (T1_Face)decoder->builder.face; - T1_Font type1 = &face->type1; + FT_Data glyph_data; + FT_Error error = T1_Parse_Glyph_And_Get_Char_String( + decoder, glyph_index, &glyph_data ); - decoder->font_matrix = type1->font_matrix; - decoder->font_offset = type1->font_offset; +#ifdef FT_CONFIG_OPTION_INCREMENTAL + if ( !error ) + { + T1_Face face = (T1_Face)decoder->builder.face; + - return decoder->funcs.parse_charstrings( - decoder, - type1->charstrings [glyph_index], - type1->charstrings_len[glyph_index] ); + if ( face->root.internal->incremental_interface ) + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object, + &glyph_data ); + } +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + return error; } @@ -92,6 +162,7 @@ (FT_Byte**)type1->glyph_names, face->blend, 0, + FT_RENDER_MODE_NORMAL, T1_Parse_Glyph ); if ( error ) return error; @@ -113,7 +184,7 @@ error = T1_Parse_Glyph( &decoder, glyph_index ); if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance ) *max_advance = decoder.builder.advance.x; - + /* ignore the error if one occured - skip to next glyph */ } @@ -142,7 +213,7 @@ T1_Load_Glyph( T1_GlyphSlot glyph, T1_Size size, FT_UInt glyph_index, - FT_Int load_flags ) + FT_Int32 load_flags ) { FT_Error error; T1_DecoderRec decoder; @@ -154,6 +225,10 @@ FT_Matrix font_matrix; FT_Vector font_offset; + FT_Data glyph_data; +#ifdef FT_CONFIG_OPTION_INCREMENTAL + FT_Bool glyph_data_loaded = 0; +#endif if ( load_flags & FT_LOAD_NO_RECURSE ) @@ -168,7 +243,7 @@ hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 && ( load_flags & FT_LOAD_NO_HINTING ) == 0 ); - glyph->root.format = ft_glyph_format_outline; + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; error = decoder_funcs->init( &decoder, (FT_Face)face, @@ -177,6 +252,7 @@ (FT_Byte**)type1->glyph_names, face->blend, FT_BOOL( hinting ), + FT_LOAD_TARGET_MODE(load_flags), T1_Parse_Glyph ); if ( error ) goto Exit; @@ -188,11 +264,14 @@ decoder.subrs = type1->subrs; decoder.subrs_len = type1->subrs_len; - /* now load the unscaled outline */ - error = T1_Parse_Glyph( &decoder, glyph_index ); + error = T1_Parse_Glyph_And_Get_Char_String( &decoder, glyph_index, + &glyph_data ); if ( error ) goto Exit; +#ifdef FT_CONFIG_OPTION_INCREMENTAL + glyph_data_loaded = 1; +#endif font_matrix = decoder.font_matrix; font_offset = decoder.font_offset; @@ -205,8 +284,8 @@ /* bearing the yMax */ if ( !error ) { - glyph->root.outline.flags &= ft_outline_owner; - glyph->root.outline.flags |= ft_outline_reverse_fill; + glyph->root.outline.flags &= FT_OUTLINE_OWNER; + glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL; /* for composite glyphs, return only left side bearing and */ /* advance width */ @@ -239,10 +318,10 @@ glyph->root.linearVertAdvance = 0; - glyph->root.format = ft_glyph_format_outline; + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; if ( size && size->root.metrics.y_ppem < 24 ) - glyph->root.outline.flags |= ft_outline_high_precision; + glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION; #if 1 /* apply the font matrix, if any */ @@ -311,11 +390,27 @@ /* Set control data to the glyph charstrings. Note that this is */ /* _not_ zero-terminated. */ - glyph->root.control_data = type1->charstrings [glyph_index]; - glyph->root.control_len = type1->charstrings_len[glyph_index]; + glyph->root.control_data = (FT_Byte*)glyph_data.pointer; + glyph->root.control_len = glyph_data.length; } + Exit: + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + if ( glyph_data_loaded && face->root.internal->incremental_interface ) + { + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object, + &glyph_data ); + + /* Set the control data to null - it is no longer available if */ + /* loaded incrementally. */ + glyph->root.control_data = 0; + glyph->root.control_len = 0; + } +#endif + return error; } Index: xc/extras/freetype2/src/type1/t1gload.h diff -u xc/extras/freetype2/src/type1/t1gload.h:1.1.1.4 xc/extras/freetype2/src/type1/t1gload.h:1.1.1.5 --- xc/extras/freetype2/src/type1/t1gload.h:1.1.1.4 Thu Jun 20 04:16:26 2002 +++ xc/extras/freetype2/src/type1/t1gload.h Wed May 28 22:01:59 2003 @@ -35,7 +35,7 @@ T1_Load_Glyph( T1_GlyphSlot glyph, T1_Size size, FT_UInt glyph_index, - FT_Int load_flags ); + FT_Int32 load_flags ); FT_END_HEADER Index: xc/extras/freetype2/src/type1/t1load.c diff -u xc/extras/freetype2/src/type1/t1load.c:1.1.1.8 xc/extras/freetype2/src/type1/t1load.c:1.1.1.9 --- xc/extras/freetype2/src/type1/t1load.c:1.1.1.8 Thu Jun 20 04:16:27 2002 +++ xc/extras/freetype2/src/type1/t1load.c Wed May 28 22:01:59 2003 @@ -123,6 +123,7 @@ /* allocate the blend `private' and `font_info' dictionaries */ if ( FT_NEW_ARRAY( blend->font_infos[1], num_designs ) || FT_NEW_ARRAY( blend->privates[1], num_designs ) || + FT_NEW_ARRAY( blend->bboxes[1], num_designs ) || FT_NEW_ARRAY( blend->weight_vector, num_designs * 2 ) ) goto Exit; @@ -130,11 +131,13 @@ blend->font_infos[0] = &face->type1.font_info; blend->privates [0] = &face->type1.private_dict; + blend->bboxes [0] = &face->type1.font_bbox; for ( nn = 2; nn <= num_designs; nn++ ) { blend->privates[nn] = blend->privates [nn - 1] + 1; blend->font_infos[nn] = blend->font_infos[nn - 1] + 1; + blend->bboxes[nn] = blend->bboxes [nn - 1] + 1; } blend->num_designs = num_designs; @@ -347,11 +350,13 @@ /* release blend `private' and `font info' dictionaries */ FT_FREE( blend->privates[1] ); FT_FREE( blend->font_infos[1] ); + FT_FREE( blend->bboxes[1] ); for ( n = 0; n < num_designs; n++ ) { blend->privates [n] = 0; blend->font_infos[n] = 0; + blend->bboxes [n] = 0; } /* release weight vectors */ @@ -410,16 +415,16 @@ /* each token is an immediate containing the name of the axis */ for ( n = 0; n < num_axis; n++ ) { - T1_Token token = axis_tokens + n; - FT_Byte* name; - FT_Int len; + T1_Token token = axis_tokens + n; + FT_Byte* name; + FT_PtrDist len; /* skip first slash, if any */ if ( token->start[0] == '/' ) token->start++; - len = (FT_Int)( token->limit - token->start ); + len = token->limit - token->start; if ( len <= 0 ) { error = T1_Err_Invalid_File_Format; @@ -735,6 +740,18 @@ } break; + case T1_FIELD_LOCATION_BBOX: + dummy_object = &face->type1.font_bbox; + objects = &dummy_object; + max_objects = 0; + + if ( blend ) + { + objects = (void**)blend->bboxes; + max_objects = blend->num_designs; + } + break; + default: dummy_object = &face->type1; objects = &dummy_object; @@ -762,22 +779,30 @@ static int - is_alpha( FT_Byte c ) + is_name_char( FT_Byte c ) { - /* Note: we must accept "+" as a valid character, as it is used in */ - /* embedded type1 fonts in PDF documents. */ - /* */ - return ( ft_isalnum( c ) || - c == '.' || - c == '_' || - c == '-' || - c == '+' ); - } + /* Note: PostScript allows any non-delimiting, non-whitespace */ + /* in a name (PS Ref Manual, 3rd Ed, p31) */ + /* PostScript delimiters include (,),<,>,[,],{,},/ and % */ + + return ( c != '(' && + c != ')' && + c != '<' && + c != '>' && + c != '[' && + c != ']' && + c != '{' && + c != '}' && + c != '/' && + c != '%' && + ! is_space( c ) + ); + } static int read_binary_data( T1_Parser parser, - FT_Int* size, + FT_Long* size, FT_Byte** base ) { FT_Byte* cur; @@ -821,13 +846,13 @@ parse_font_name( T1_Face face, T1_Loader loader ) { - T1_Parser parser = &loader->parser; - FT_Error error; - FT_Memory memory = parser->root.memory; - FT_Int len; - FT_Byte* cur; - FT_Byte* cur2; - FT_Byte* limit; + T1_Parser parser = &loader->parser; + FT_Error error; + FT_Memory memory = parser->root.memory; + FT_PtrDist len; + FT_Byte* cur; + FT_Byte* cur2; + FT_Byte* limit; if ( face->type1.font_name ) @@ -844,10 +869,10 @@ cur++; cur2 = cur; - while ( cur2 < limit && is_alpha( *cur2 ) ) + while ( cur2 < limit && is_name_char( *cur2 ) ) cur2++; - len = (FT_Int)( cur2 - cur ); + len = cur2 - cur; if ( len > 0 ) { if ( FT_ALLOC( face->type1.font_name, len + 1 ) ) @@ -863,6 +888,7 @@ } +#if 0 static void parse_font_bbox( T1_Face face, T1_Loader loader ) @@ -878,6 +904,7 @@ bbox->xMax = FT_RoundFix( temp[2] ); bbox->yMax = FT_RoundFix( temp[3] ); } +#endif static void @@ -968,7 +995,7 @@ return; /* read the number of entries in the encoding, should be 256 */ - count = T1_ToInt( parser ); + count = (FT_Int)T1_ToInt( parser ); if ( parser->root.error ) return; @@ -1036,7 +1063,7 @@ parser->root.cursor = cur; - charcode = T1_ToInt( parser ); + charcode = (FT_Int)T1_ToInt( parser ); cur = parser->root.cursor; /* skip whitespace */ @@ -1047,14 +1074,14 @@ { /* bingo, we have an immediate name -- it must be a */ /* character name */ - FT_Byte* cur2 = cur + 1; - FT_Int len; + FT_Byte* cur2 = cur + 1; + FT_PtrDist len; - while ( cur2 < limit && is_alpha( *cur2 ) ) + while ( cur2 < limit && is_name_char( *cur2 ) ) cur2++; - len = (FT_Int)( cur2 - cur - 1 ); + len = cur2 - cur - 1; parser->root.error = T1_Add_Table( char_table, charcode, cur + 1, len + 1 ); @@ -1114,7 +1141,15 @@ /* with synthetic fonts, it's possible we get here twice */ return; - loader->num_subrs = T1_ToInt( parser ); + if ( parser->root.cursor + 2 > parser->root.limit && + parser->root.cursor[0] == '[' && + parser->root.cursor[1] == ']' ) + { + /* empty array */ + return; + } + + loader->num_subrs = (FT_Int)T1_ToInt( parser ); if ( parser->root.error ) return; @@ -1134,7 +1169,7 @@ /* */ for ( n = 0; n < loader->num_subrs; n++ ) { - FT_Int idx, size; + FT_Long idx, size; FT_Byte* base; @@ -1218,7 +1253,7 @@ /* with synthetic fonts, it's possible we get here twice */ return; - loader->num_glyphs = T1_ToInt( parser ); + loader->num_glyphs = (FT_Int)T1_ToInt( parser ); if ( parser->root.error ) return; @@ -1249,7 +1284,7 @@ for (;;) { - FT_Int size; + FT_Long size; FT_Byte* base; @@ -1281,13 +1316,13 @@ T1_Skip_Alpha( parser ); else { - FT_Byte* cur2 = cur + 1; - FT_Int len; + FT_Byte* cur2 = cur + 1; + FT_PtrDist len; - while ( cur2 < limit && is_alpha( *cur2 ) ) + while ( cur2 < limit && is_name_char( *cur2 ) ) cur2++; - len = (FT_Int)( cur2 - cur - 1 ); + len = cur2 - cur - 1; error = T1_Add_Table( name_table, n, cur + 1, len + 1 ); if ( error ) @@ -1464,7 +1499,9 @@ /* now add the special functions... */ T1_FIELD_CALLBACK( "FontName", parse_font_name ) +#if 0 T1_FIELD_CALLBACK( "FontBBox", parse_font_bbox ) +#endif T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix ) T1_FIELD_CALLBACK( "Encoding", parse_encoding ) T1_FIELD_CALLBACK( "Subrs", parse_subrs ) @@ -1537,16 +1574,16 @@ /* look for immediates */ else if ( *cur == '/' && cur + 2 < limit ) { - FT_Byte* cur2; - FT_Int len; + FT_Byte* cur2; + FT_PtrDist len; cur++; cur2 = cur; - while ( cur2 < limit && is_alpha( *cur2 ) ) + while ( cur2 < limit && is_name_char( *cur2 ) ) cur2++; - len = (FT_Int)( cur2 - cur ); + len = cur2 - cur; if ( len > 0 && len < 22 ) { { @@ -1563,10 +1600,10 @@ if ( !name ) break; - if ( cur[0] == name[0] && - len == (FT_Int)ft_strlen( (const char*)name ) ) + if ( cur[0] == name[0] && + len == ft_strlen( (const char*)name ) ) { - FT_Int n; + FT_PtrDist n; for ( n = 1; n < len; n++ ) @@ -1605,7 +1642,7 @@ { FT_UNUSED( face ); - FT_MEM_SET( loader, 0, sizeof ( *loader ) ); + FT_MEM_ZERO( loader, sizeof ( *loader ) ); loader->num_glyphs = 0; loader->num_chars = 0; @@ -1653,6 +1690,9 @@ /* default lenIV */ type1->private_dict.lenIV = 4; + /* default blue fuzz, we put it there since 0 is a valid value */ + type1->private_dict.blue_fuzz = 1; + parser = &loader.parser; error = T1_New_Parser( parser, face->root.stream, @@ -1687,11 +1727,14 @@ type1->subrs_len = loader.subrs.lengths; } - if ( !loader.charstrings.init ) - { - FT_ERROR(( "T1_Open_Face: no charstrings array in face!\n" )); - error = T1_Err_Invalid_File_Format; - } +#ifdef FT_CONFIG_OPTION_INCREMENTAL + if ( !face->root.internal->incremental_interface ) +#endif + if ( !loader.charstrings.init ) + { + FT_ERROR(( "T1_Open_Face: no charstrings array in face!\n" )); + error = T1_Err_Invalid_File_Format; + } loader.charstrings.init = 0; type1->charstrings_block = loader.charstrings.block; Index: xc/extras/freetype2/src/type1/t1objs.c diff -u xc/extras/freetype2/src/type1/t1objs.c:1.1.1.8 xc/extras/freetype2/src/type1/t1objs.c:1.3 --- xc/extras/freetype2/src/type1/t1objs.c:1.1.1.8 Thu Jun 20 04:16:27 2002 +++ xc/extras/freetype2/src/type1/t1objs.c Wed May 28 22:13:06 2003 @@ -14,7 +14,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ - +/* $XFree86: xc/extras/freetype2/src/type1/t1objs.c,v 1.3 2003/05/29 02:13:06 dawes Exp $ */ #include #include FT_INTERNAL_DEBUG_H @@ -278,7 +278,6 @@ FT_Error error; PSNames_Service psnames; PSAux_Service psaux; - PSHinter_Service pshinter; FT_UNUSED( num_params ); FT_UNUSED( params ); @@ -298,7 +297,6 @@ face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), "pshinter" ); - pshinter = (PSHinter_Service)face->pshinter; /* open the tokenizer, this will also check the font format */ error = T1_Open_Face( face ); @@ -427,8 +425,6 @@ root->internal->max_contours = 0; } -#ifdef FT_CONFIG_OPTION_USE_CMAPS - { FT_Face root = &face->root; @@ -445,7 +441,7 @@ /* first of all, try to synthetize a Unicode charmap */ charmap.platform_id = 3; charmap.encoding_id = 1; - charmap.encoding = ft_encoding_unicode; + charmap.encoding = FT_ENCODING_UNICODE; FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); @@ -456,25 +452,25 @@ switch ( face->type1.encoding_type ) { case T1_ENCODING_TYPE_STANDARD: - charmap.encoding = ft_encoding_adobe_standard; + charmap.encoding = FT_ENCODING_ADOBE_STANDARD; charmap.encoding_id = 0; clazz = cmap_classes->standard; break; case T1_ENCODING_TYPE_EXPERT: - charmap.encoding = ft_encoding_adobe_expert; + charmap.encoding = FT_ENCODING_ADOBE_EXPERT; charmap.encoding_id = 1; clazz = cmap_classes->expert; break; case T1_ENCODING_TYPE_ARRAY: - charmap.encoding = ft_encoding_adobe_custom; + charmap.encoding = FT_ENCODING_ADOBE_CUSTOM; charmap.encoding_id = 2; clazz = cmap_classes->custom; break; case T1_ENCODING_TYPE_ISOLATIN1: - charmap.encoding = ft_encoding_latin_1; + charmap.encoding = FT_ENCODING_ADOBE_LATIN_1; charmap.encoding_id = 3; clazz = cmap_classes->unicode; break; @@ -485,84 +481,15 @@ if ( clazz ) FT_CMap_New( clazz, NULL, &charmap, NULL ); - } - } -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - /* charmap support -- synthetize unicode charmap if possible */ - { - FT_Face root = &face->root; - FT_CharMap charmap = face->charmaprecs; - - - /* synthesize a Unicode charmap if there is support in the `PSNames' */ - /* module */ - if ( psnames ) - { - if ( psnames->unicode_value ) - { - error = psnames->build_unicodes( - root->memory, - face->type1.num_glyphs, - (const char**)face->type1.glyph_names, - &face->unicode_map ); - if ( !error ) - { - root->charmap = charmap; - charmap->face = (FT_Face)face; - charmap->encoding = ft_encoding_unicode; - charmap->platform_id = 3; - charmap->encoding_id = 1; - charmap++; - } - - /* simply clear the error in case of failure (which really) */ - /* means that out of memory or no unicode glyph names */ - error = T1_Err_Ok; - } - } - - /* now, support either the standard, expert, or custom encoding */ - charmap->face = (FT_Face)face; - charmap->platform_id = 7; /* a new platform id for Adobe fonts? */ - - switch ( face->type1.encoding_type ) - { - case T1_ENCODING_TYPE_STANDARD: - charmap->encoding = ft_encoding_adobe_standard; - charmap->encoding_id = 0; - break; - - case T1_ENCODING_TYPE_EXPERT: - charmap->encoding = ft_encoding_adobe_expert; - charmap->encoding_id = 1; - break; - - case T1_ENCODING_TYPE_ARRAY: - charmap->encoding = ft_encoding_adobe_custom; - charmap->encoding_id = 2; - break; - - case T1_ENCODING_TYPE_ISOLATIN1: - charmap->encoding = ft_encoding_latin_1; - charmap->encoding_id = 3; - break; - - default: - FT_ERROR(( "T1_Face_Init: invalid encoding\n" )); - error = T1_Err_Invalid_File_Format; - goto Exit; +#if 0 + /* Select default charmap */ + if (root->num_charmaps) + root->charmap = root->charmaps[0]; +#endif } - - root->charmaps = face->charmaps; - root->num_charmaps = charmap - face->charmaprecs + 1; - face->charmaps[0] = &face->charmaprecs[0]; - face->charmaps[1] = &face->charmaprecs[1]; } -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ - Exit: return error; } Index: xc/extras/freetype2/src/type1/t1parse.c diff -u xc/extras/freetype2/src/type1/t1parse.c:1.1.1.5 xc/extras/freetype2/src/type1/t1parse.c:1.1.1.6 --- xc/extras/freetype2/src/type1/t1parse.c:1.1.1.5 Thu Jun 20 04:16:27 2002 +++ xc/extras/freetype2/src/type1/t1parse.c Wed May 28 22:01:59 2003 @@ -440,7 +440,7 @@ } /* put a safeguard */ - parser->private_len = (FT_Int)( write - parser->private_dict ); + parser->private_len = write - parser->private_dict; *write++ = 0; } } Index: xc/extras/freetype2/src/type1/t1parse.h diff -u xc/extras/freetype2/src/type1/t1parse.h:1.1.1.4 xc/extras/freetype2/src/type1/t1parse.h:1.1.1.5 --- xc/extras/freetype2/src/type1/t1parse.h:1.1.1.4 Thu Jun 20 04:16:27 2002 +++ xc/extras/freetype2/src/type1/t1parse.h Wed May 28 22:01:59 2003 @@ -64,10 +64,10 @@ FT_Stream stream; FT_Byte* base_dict; - FT_Int base_len; + FT_Long base_len; FT_Byte* private_dict; - FT_Int private_len; + FT_Long private_len; FT_Byte in_pfb; FT_Byte in_memory; Index: xc/extras/freetype2/src/type1/t1tokens.h diff -u xc/extras/freetype2/src/type1/t1tokens.h:1.1.1.3 xc/extras/freetype2/src/type1/t1tokens.h:1.1.1.4 --- xc/extras/freetype2/src/type1/t1tokens.h:1.1.1.3 Thu Jun 20 04:16:27 2002 +++ xc/extras/freetype2/src/type1/t1tokens.h Wed May 28 22:01:59 2003 @@ -69,5 +69,12 @@ T1_FIELD_NUM( "FontType", font_type ) T1_FIELD_NUM( "StrokeWidth", stroke_width ) +#undef FT_STRUCTURE +#define FT_STRUCTURE FT_BBox +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_BBOX + + T1_FIELD_BBOX("FontBBox", xMin ) + /* END */ Index: xc/extras/freetype2/src/type42/Jamfile diff -u xc/extras/freetype2/src/type42/Jamfile:1.1.1.1 xc/extras/freetype2/src/type42/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/type42/Jamfile:1.1.1.1 Thu Jun 20 04:16:27 2002 +++ xc/extras/freetype2/src/type42/Jamfile Wed May 28 22:01:59 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/type42 Jamfile (c) 2002 David Turner # -SubDir FT2_TOP src type42 ; - -SubDirHdrs [ FT2_SubDir src type42 ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) type42 ; { local _sources ; Index: xc/extras/freetype2/src/type42/t42drivr.c diff -u xc/extras/freetype2/src/type42/t42drivr.c:1.1.1.1 xc/extras/freetype2/src/type42/t42drivr.c:1.1.1.2 --- xc/extras/freetype2/src/type42/t42drivr.c:1.1.1.1 Thu Jun 20 04:16:27 2002 +++ xc/extras/freetype2/src/type42/t42drivr.c Wed May 28 22:01:59 2003 @@ -15,6 +15,27 @@ /***************************************************************************/ + /*************************************************************************/ + /* */ + /* This driver implements Type42 fonts as described in the */ + /* Technical Note #5012 from Adobe, with these limitations: */ + /* */ + /* 1) CID Fonts are not currently supported. */ + /* 2) Incremental fonts making use of the GlyphDirectory keyword */ + /* will be loaded, but the rendering will be using the TrueType */ + /* tables. */ + /* 3) The sfnts array is expected to be ASCII, not binary. */ + /* 4) As for Type1 fonts, CDevProc is not supported. */ + /* 5) The Metrics dictionary is not supported. */ + /* 6) AFM metrics are not supported. */ + /* */ + /* In other words, this driver supports Type42 fonts derived from */ + /* TrueType fonts in a non-CID manner, as done by usual conversion */ + /* programs. */ + /* */ + /*************************************************************************/ + + #include "t42drivr.h" #include "t42objs.h" #include "t42error.h" @@ -40,10 +61,10 @@ { FT_UInt len = (FT_UInt)( ft_strlen( gname ) ); - + if ( len >= buffer_max ) len = buffer_max - 1; - + FT_MEM_COPY( buffer, gname, len ); ((FT_Byte*)buffer)[len] = 0; } @@ -137,14 +158,11 @@ (FT_Size_ResetPointsFunc) T42_Size_SetChars, (FT_Size_ResetPixelsFunc) T42_Size_SetPixels, (FT_Slot_LoadFunc) T42_GlyphSlot_Load, - (FT_CharMap_CharIndexFunc)T42_CMap_CharIndex, (FT_Face_GetKerningFunc) 0, (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc) 0, - - (FT_CharMap_CharNextFunc) T42_CMap_CharNext, + (FT_Face_GetAdvancesFunc) 0 }; Index: xc/extras/freetype2/src/type42/t42objs.c diff -u xc/extras/freetype2/src/type42/t42objs.c:1.1.1.1 xc/extras/freetype2/src/type42/t42objs.c:1.1.1.2 --- xc/extras/freetype2/src/type42/t42objs.c:1.1.1.1 Thu Jun 20 04:16:27 2002 +++ xc/extras/freetype2/src/type42/t42objs.c Wed May 28 22:01:59 2003 @@ -147,7 +147,7 @@ T42_Face face, FT_Int face_index, FT_Int num_params, - FT_Parameter* params) + FT_Parameter* params ) { FT_Error error; PSNames_Service psnames; @@ -283,8 +283,6 @@ if ( face->ttf_face->face_flags & FT_FACE_FLAG_VERTICAL ) root->face_flags |= FT_FACE_FLAG_VERTICAL; -#ifdef FT_CONFIG_OPTION_USE_CMAPS - { if ( psnames && psaux ) { @@ -298,7 +296,7 @@ /* first of all, try to synthetize a Unicode charmap */ charmap.platform_id = 3; charmap.encoding_id = 1; - charmap.encoding = ft_encoding_unicode; + charmap.encoding = FT_ENCODING_UNICODE; FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); @@ -309,25 +307,25 @@ switch ( face->type1.encoding_type ) { case T1_ENCODING_TYPE_STANDARD: - charmap.encoding = ft_encoding_adobe_standard; + charmap.encoding = FT_ENCODING_ADOBE_STANDARD; charmap.encoding_id = 0; clazz = cmap_classes->standard; break; case T1_ENCODING_TYPE_EXPERT: - charmap.encoding = ft_encoding_adobe_expert; + charmap.encoding = FT_ENCODING_ADOBE_EXPERT; charmap.encoding_id = 1; clazz = cmap_classes->expert; break; case T1_ENCODING_TYPE_ARRAY: - charmap.encoding = ft_encoding_adobe_custom; + charmap.encoding = FT_ENCODING_ADOBE_CUSTOM; charmap.encoding_id = 2; clazz = cmap_classes->custom; break; case T1_ENCODING_TYPE_ISOLATIN1: - charmap.encoding = ft_encoding_latin_1; + charmap.encoding = FT_ENCODING_ADOBE_LATIN_1; charmap.encoding_id = 3; clazz = cmap_classes->unicode; break; @@ -339,84 +337,13 @@ if ( clazz ) FT_CMap_New( clazz, NULL, &charmap, NULL ); +#if 0 /* Select default charmap */ if (root->num_charmaps) root->charmap = root->charmaps[0]; +#endif } } - -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - /* charmap support -- synthetize unicode charmap if possible */ - { - FT_CharMap charmap = face->charmaprecs; - - - /* synthesize a Unicode charmap if there is support in the `PSNames' */ - /* module */ - if ( psnames && psnames->unicode_value ) - { - error = psnames->build_unicodes( root->memory, - face->type1.num_glyphs, - (const char**)face->type1.glyph_names, - &face->unicode_map ); - if ( !error ) - { - root->charmap = charmap; - charmap->face = (FT_Face)face; - charmap->encoding = ft_encoding_unicode; - charmap->platform_id = 3; - charmap->encoding_id = 1; - charmap++; - } - - /* XXX: Is the following code correct? It is used in t1objs.c */ - - /* simply clear the error in case of failure (which really) */ - /* means that out of memory or no unicode glyph names */ - error = T42_Err_Ok; - } - - /* now, support either the standard, expert, or custom encoding */ - charmap->face = (FT_Face)face; - charmap->platform_id = 7; /* a new platform id for Adobe fonts? */ - - switch ( face->type1.encoding_type ) - { - case T1_ENCODING_TYPE_STANDARD: - charmap->encoding = ft_encoding_adobe_standard; - charmap->encoding_id = 0; - break; - - case T1_ENCODING_TYPE_EXPERT: - charmap->encoding = ft_encoding_adobe_expert; - charmap->encoding_id = 1; - break; - - case T1_ENCODING_TYPE_ARRAY: - charmap->encoding = ft_encoding_adobe_custom; - charmap->encoding_id = 2; - break; - - case T1_ENCODING_TYPE_ISOLATIN1: - charmap->encoding = ft_encoding_latin_1; - charmap->encoding_id = 3; - break; - - default: - FT_ERROR(( "T42_Face_Init: invalid encoding\n" )); - error = T42_Err_Invalid_File_Format; - goto Exit; - } - - root->charmaps = face->charmaps; - root->num_charmaps = charmap - face->charmaprecs + 1; - face->charmaps[0] = &face->charmaprecs[0]; - face->charmaps[1] = &face->charmaprecs[1]; - } - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ - Exit: return error; } @@ -511,118 +438,6 @@ } - FT_LOCAL_DEF( FT_UInt ) - T42_CMap_CharIndex( FT_CharMap charmap, - FT_Long charcode ) - { - T42_Face face; - FT_UInt result = 0; - PSNames_Service psnames; - - - face = (T42_Face)charmap->face; - psnames = (PSNames_Service)face->psnames; - if (!psnames ) - goto Exit; - - switch ( charmap->encoding ) - { - /*******************************************************************/ - /* */ - /* Unicode encoding support */ - /* */ - case ft_encoding_unicode: - /* if this charmap is used, we ignore the encoding of the font and */ - /* use the `PSNames' module to synthetize the Unicode charmap */ - result = psnames->lookup_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /* the function returns 0xFFFF if the Unicode charcode has */ - /* no corresponding glyph */ - if ( result == 0xFFFFU ) - result = 0; - - /* The result returned is the index (position)in the CharStrings */ - /* array. This must be used now to get the value associated to */ - /* that glyph_name, which is the real index within the truetype */ - /* structure. */ - result = ft_atoi( (const char*)face->type1.charstrings[result] ); - goto Exit; - - /*******************************************************************/ - /* */ - /* ISOLatin1 encoding support */ - /* */ - case ft_encoding_latin_1: - /* ISOLatin1 is the first page of Unicode */ - if ( charcode < 256 && psnames->unicode_value ) - { - result = psnames->lookup_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /* the function returns 0xFFFF if the Unicode charcode has */ - /* no corresponding glyph */ - if ( result == 0xFFFFU ) - result = 0; - } - goto Exit; - - /*******************************************************************/ - /* */ - /* Custom Type 1 encoding */ - /* */ - case ft_encoding_adobe_custom: - { - T1_Encoding encoding = &face->type1.encoding; - - - if ( charcode >= encoding->code_first && - charcode <= encoding->code_last ) - { - FT_UInt idx = encoding->char_index[charcode]; - - - result = ft_atoi( (const char *)face->type1.charstrings[idx] ); - } - goto Exit; - } - - /*******************************************************************/ - /* */ - /* Adobe Standard & Expert encoding support */ - /* */ - default: - if ( charcode < 256 ) - { - FT_UInt code; - FT_Int n; - const char* glyph_name; - - - code = psnames->adobe_std_encoding[charcode]; - if ( charmap->encoding == ft_encoding_adobe_expert ) - code = psnames->adobe_expert_encoding[charcode]; - - glyph_name = psnames->adobe_std_strings( code ); - if ( !glyph_name ) - break; - - for ( n = 0; n < face->type1.num_glyphs; n++ ) - { - const char* gname = face->type1.glyph_names[n]; - - if ( gname && ( ft_strcmp( gname, glyph_name ) == 0 ) ) - { - result = ft_atoi( (const char *)face->type1.charstrings[n] ); - break; - } - } - } - } - - Exit: - return result; - } FT_LOCAL_DEF( FT_Error ) @@ -705,16 +520,6 @@ } - static void - t42_check_size_change( FT_Face face ) - { - FT_Face tt_face = ((T42_Face)face)->ttf_face; - FT_Size tt_size = ((T42_Size)face->size)->ttsize; - - if ( tt_face->size != tt_size ) - FT_Activate_Size( tt_size ); - } - FT_LOCAL_DEF( FT_Error ) T42_Size_SetChars( T42_Size size, @@ -727,8 +532,8 @@ T42_Face t42face = (T42_Face)face; - t42_check_size_change( t42face->ttf_face ); - + FT_Activate_Size(size->ttsize); + return FT_Set_Char_Size( t42face->ttf_face, char_width, char_height, @@ -746,9 +551,8 @@ T42_Face t42face = (T42_Face)face; + FT_Activate_Size(size->ttsize); - t42_check_size_change( t42face->ttf_face ); - return FT_Set_Pixel_Sizes( t42face->ttf_face, pixel_width, pixel_height ); @@ -756,17 +560,10 @@ static void - ft_glyphslot_clear( FT_GlyphSlot slot ) + t42_glyphslot_clear( FT_GlyphSlot slot ) { /* free bitmap if needed */ - if ( slot->flags & FT_GLYPH_OWN_BITMAP ) - { - FT_Memory memory = FT_FACE_MEMORY( slot->face ); - - - FT_FREE( slot->bitmap.buffer ); - slot->flags &= ~FT_GLYPH_OWN_BITMAP; - } + ft_glyphslot_free_bitmap( slot ); /* clear all public fields in the glyph slot */ FT_ZERO( &slot->metrics ); @@ -780,7 +577,7 @@ slot->control_data = 0; slot->control_len = 0; slot->other = 0; - slot->format = ft_glyph_format_none; + slot->format = FT_GLYPH_FORMAT_NONE; slot->linearHoriAdvance = 0; slot->linearVertAdvance = 0; @@ -791,17 +588,15 @@ T42_GlyphSlot_Load( FT_GlyphSlot glyph, FT_Size size, FT_Int glyph_index, - FT_Int load_flags ) + FT_Int32 load_flags ) { FT_Error error; T42_GlyphSlot t42slot = (T42_GlyphSlot)glyph; T42_Size t42size = (T42_Size)size; - FT_Face tt_face = ((T42_Face) glyph->face)->ttf_face; FT_Driver_Class ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz; - t42_check_size_change( tt_face ); - ft_glyphslot_clear( t42slot->ttslot ); + t42_glyphslot_clear( t42slot->ttslot ); error = ttclazz->load_glyph( t42slot->ttslot, t42size->ttsize, glyph_index, @@ -820,10 +615,10 @@ glyph->bitmap = t42slot->ttslot->bitmap; glyph->bitmap_left = t42slot->ttslot->bitmap_left; glyph->bitmap_top = t42slot->ttslot->bitmap_top; - + glyph->num_subglyphs = t42slot->ttslot->num_subglyphs; glyph->subglyphs = t42slot->ttslot->subglyphs; - + glyph->control_data = t42slot->ttslot->control_data; glyph->control_len = t42slot->ttslot->control_len; } @@ -832,101 +627,4 @@ } - - FT_LOCAL_DEF( FT_Long ) - T42_CMap_CharNext( FT_CharMap charmap, - FT_Long charcode ) - { - T42_Face face; - PSNames_Service psnames; - - - face = (T42_Face)charmap->face; - psnames = (PSNames_Service)face->psnames; - - if ( psnames ) - switch ( charmap->encoding ) - { - /*******************************************************************/ - /* */ - /* Unicode encoding support */ - /* */ - case ft_encoding_unicode: - /* use the `PSNames' module to synthetize the Unicode charmap */ - return psnames->next_unicode( &face->unicode_map, - (FT_ULong)charcode ); - - /*******************************************************************/ - /* */ - /* ISOLatin1 encoding support */ - /* */ - case ft_encoding_latin_1: - { - FT_ULong code; - - - /* use the `PSNames' module to synthetize the Unicode charmap */ - code = psnames->next_unicode( &face->unicode_map, - (FT_ULong)charcode ); - if ( code < 256 ) - return code; - break; - } - - /*******************************************************************/ - /* */ - /* Custom Type 1 encoding */ - /* */ - case ft_encoding_adobe_custom: - { - T1_Encoding encoding = &face->type1.encoding; - - - charcode++; - if ( charcode < encoding->code_first ) - charcode = encoding->code_first; - while ( charcode <= encoding->code_last ) { - if ( encoding->char_index[charcode] ) - return charcode; - charcode++; - } - } - - - /*******************************************************************/ - /* */ - /* Adobe Standard & Expert encoding support */ - /* */ - default: - while ( ++charcode < 256 ) - { - FT_UInt code; - FT_Int n; - const char* glyph_name; - - - code = psnames->adobe_std_encoding[charcode]; - if ( charmap->encoding == ft_encoding_adobe_expert ) - code = psnames->adobe_expert_encoding[charcode]; - - glyph_name = psnames->adobe_std_strings( code ); - if ( !glyph_name ) - continue; - - for ( n = 0; n < face->type1.num_glyphs; n++ ) - { - const char* gname = face->type1.glyph_names[n]; - - - if ( gname && gname[0] == glyph_name[0] && - ft_strcmp( gname, glyph_name ) == 0 ) - return charcode; - } - } - } - - return 0; - } - - /* END */ Index: xc/extras/freetype2/src/type42/t42objs.h diff -u xc/extras/freetype2/src/type42/t42objs.h:1.1.1.1 xc/extras/freetype2/src/type42/t42objs.h:1.1.1.2 --- xc/extras/freetype2/src/type42/t42objs.h:1.1.1.1 Thu Jun 20 04:16:27 2002 +++ xc/extras/freetype2/src/type42/t42objs.h Wed May 28 22:01:59 2003 @@ -22,6 +22,7 @@ #include FT_FREETYPE_H #include FT_TYPE1_TABLES_H #include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_TYPE42_TYPES_H #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DRIVER_H #include FT_INTERNAL_POSTSCRIPT_NAMES_H @@ -30,25 +31,6 @@ FT_BEGIN_HEADER - /* Type42 face */ - typedef struct T42_FaceRec_ - { - FT_FaceRec root; - T1_FontRec type1; - const void* psnames; - const void* psaux; - const void* afm_data; - - FT_CharMapRec charmaprecs[2]; - FT_CharMap charmaps[2]; - PS_Unicodes unicode_map; - - FT_Byte* ttf_data; - FT_ULong ttf_size; - FT_Face ttf_face; - - } T42_FaceRec, *T42_Face; - /* Type42 size */ typedef struct T42_SizeRec_ @@ -121,21 +103,12 @@ T42_GlyphSlot_Load( FT_GlyphSlot glyph, FT_Size size, FT_Int glyph_index, - FT_Int load_flags ); + FT_Int32 load_flags ); FT_LOCAL( void ) T42_GlyphSlot_Done( T42_GlyphSlot slot ); - FT_LOCAL( FT_UInt ) - T42_CMap_CharIndex( FT_CharMap charmap, - FT_Long charcode ); - - FT_LOCAL( FT_Long ) - T42_CMap_CharNext( FT_CharMap charmap, - FT_Long charcode ); - - FT_LOCAL( FT_Error ) T42_Driver_Init( T42_Driver driver ); Index: xc/extras/freetype2/src/type42/t42parse.c diff -u xc/extras/freetype2/src/type42/t42parse.c:1.2 xc/extras/freetype2/src/type42/t42parse.c:1.4 --- xc/extras/freetype2/src/type42/t42parse.c:1.2 Wed Sep 18 13:11:39 2002 +++ xc/extras/freetype2/src/type42/t42parse.c Wed Oct 22 14:51:25 2003 @@ -13,7 +13,7 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ -/* $XFree86: xc/extras/freetype2/src/type42/t42parse.c,v 1.2 2002/09/18 17:11:39 tsi Exp $ */ + #include "t42parse.h" #include "t42error.h" @@ -629,9 +629,8 @@ goto Fail; } - v = (FT_Byte)( 16 * t42_hexval( *cur ) + t42_hexval( *(cur + 1) ) ); - cur++; - cur++; + v = (FT_Byte)( 16 * t42_hexval( cur[0] ) + t42_hexval( cur[1] ) ); + cur += 2; string_size++; } @@ -965,7 +964,7 @@ { FT_UNUSED( face ); - FT_MEM_SET( loader, 0, sizeof ( *loader ) ); + FT_MEM_ZERO( loader, sizeof ( *loader ) ); loader->num_glyphs = 0; loader->num_chars = 0; Index: xc/extras/freetype2/src/winfonts/Jamfile diff -u xc/extras/freetype2/src/winfonts/Jamfile:1.1.1.1 xc/extras/freetype2/src/winfonts/Jamfile:1.1.1.2 --- xc/extras/freetype2/src/winfonts/Jamfile:1.1.1.1 Sun Sep 9 22:56:12 2001 +++ xc/extras/freetype2/src/winfonts/Jamfile Wed May 28 22:01:59 2003 @@ -1,9 +1,7 @@ # FreeType 2 src/winfonts Jamfile (c) 2001 David Turner # -SubDir FT2_TOP src winfonts ; - -SubDirHdrs [ FT2_SubDir src winfonts ] ; +SubDir FT2_TOP $(FT2_SRC_DIR) winfonts ; Library $(FT2_LIB) : winfnt.c ; Index: xc/extras/freetype2/src/winfonts/winfnt.c diff -u xc/extras/freetype2/src/winfonts/winfnt.c:1.1.1.6 xc/extras/freetype2/src/winfonts/winfnt.c:1.1.1.7 --- xc/extras/freetype2/src/winfonts/winfnt.c:1.1.1.6 Thu Jun 20 04:16:28 2002 +++ xc/extras/freetype2/src/winfonts/winfnt.c Wed May 28 22:01:59 2003 @@ -17,6 +17,7 @@ #include +#include FT_WINFONTS_H #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_OBJECTS_H @@ -68,9 +69,9 @@ const FT_Frame_Field winfnt_header_fields[] = { #undef FT_STRUCTURE -#define FT_STRUCTURE WinFNT_HeaderRec +#define FT_STRUCTURE FT_WinFNT_HeaderRec - FT_FRAME_START( 134 ), + FT_FRAME_START( 146 ), FT_FRAME_USHORT_LE( version ), FT_FRAME_ULONG_LE ( file_size ), FT_FRAME_BYTES ( copyright, 60 ), @@ -106,7 +107,7 @@ FT_FRAME_USHORT_LE( B_space ), FT_FRAME_USHORT_LE( C_space ), FT_FRAME_USHORT_LE( color_table_offset ), - FT_FRAME_BYTES ( reserved, 4 ), + FT_FRAME_BYTES ( reserved1, 16 ), FT_FRAME_END }; @@ -127,8 +128,8 @@ fnt_font_load( FNT_Font font, FT_Stream stream ) { - FT_Error error; - WinFNT_Header header = &font->header; + FT_Error error; + FT_WinFNT_Header header = &font->header; /* first of all, read the FNT header */ @@ -145,6 +146,17 @@ goto Exit; } + /* Version 2 doesn't have these fields */ + if ( header->version == 0x200 ) + { + header->flags = 0; + header->A_space = 0; + header->B_space = 0; + header->C_space = 0; + + header->color_table_offset = 0; + } + if ( header->file_type & 1 ) { FT_TRACE2(( "[can't handle vector FNT fonts]\n" )); @@ -310,8 +322,6 @@ } -#ifdef FT_CONFIG_OPTION_USE_CMAPS - typedef struct FNT_CMapRec_ { @@ -393,57 +403,6 @@ static FT_CMap_Class fnt_cmap_class = &fnt_cmap_class_rec; -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - - static FT_UInt - FNT_Get_Char_Index( FT_CharMap charmap, - FT_Long char_code ) - { - FT_Long result = char_code; - - - if ( charmap ) - { - FNT_Font font = ((FNT_Face)charmap->face)->fonts; - FT_Long first = font->header.first_char; - FT_Long count = font->header.last_char - first + 1; - - - char_code -= first; - if ( char_code < count ) - result = char_code + 1; - else - result = 0; - } - - return result; - } - - - static FT_Long - FNT_Get_Next_Char( FT_CharMap charmap, - FT_Long char_code ) - { - char_code++; - if ( charmap ) - { - FNT_Font font = ((FNT_Face)charmap->face)->fonts; - FT_Long first = font->header.first_char; - - - if ( char_code < first ) - char_code = first; - if ( char_code <= font->header.last_char ) - return char_code; - } - else - return char_code; - return 0; - } - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ - static void FNT_Face_Done( FNT_Face face ) @@ -534,12 +493,10 @@ } } -#ifdef FT_CONFIG_OPTION_USE_CMAPS - { FT_CharMapRec charmap; - charmap.encoding = ft_encoding_unicode; + charmap.encoding = FT_ENCODING_UNICODE; charmap.platform_id = 3; charmap.encoding_id = 1; charmap.face = root; @@ -548,25 +505,13 @@ NULL, &charmap, NULL ); - if (error) goto Fail; - } - -#else /* !FT_CONFIG_OPTION_USE_CMAPS */ - - /* Setup the `charmaps' array */ - root->charmaps = &face->charmap_handle; - root->num_charmaps = 1; - - face->charmap.encoding = ft_encoding_unicode; - face->charmap.platform_id = 3; - face->charmap.encoding_id = 1; - face->charmap.face = root; - - face->charmap_handle = &face->charmap; + if ( error ) + goto Fail; - root->charmap = face->charmap_handle; - -#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ + /* Select default charmap */ + if ( root->num_charmaps ) + root->charmap = root->charmaps[0]; + } /* setup remaining flags */ root->num_glyphs = fonts->header.last_char - @@ -630,7 +575,7 @@ FNT_Load_Glyph( FT_GlyphSlot slot, FNT_Size size, FT_UInt glyph_index, - FT_Int load_flags ) + FT_Int32 load_flags ) { FNT_Font font = size->font; FT_Error error = 0; @@ -659,7 +604,7 @@ len = new_format ? 6 : 4; /* jump to glyph entry */ - p = font->fnt_frame + 118 + len * glyph_index; + p = font->fnt_frame + ( new_format ? 146 : 118 ) + len * glyph_index; bitmap->width = FT_NEXT_SHORT_LE( p ); @@ -673,35 +618,21 @@ /* allocate and build bitmap */ { - FT_Memory memory = FT_FACE_MEMORY( slot->face ); FT_Int pitch = ( bitmap->width + 7 ) >> 3; - FT_Byte* column; - FT_Byte* write; bitmap->pitch = pitch; bitmap->rows = font->header.pixel_height; - bitmap->pixel_mode = ft_pixel_mode_mono; - - if ( FT_ALLOC( bitmap->buffer, pitch * bitmap->rows ) ) - goto Exit; - - column = (FT_Byte*)bitmap->buffer; + bitmap->pixel_mode = FT_PIXEL_MODE_MONO; - for ( ; pitch > 0; pitch--, column++ ) - { - FT_Byte* limit = p + bitmap->rows; - - - for ( write = column; p < limit; p++, write += bitmap->pitch ) - write[0] = p[0]; - } + /* note: we don't allocate a new buffer for the bitmap since we */ + /* already store the images in the FT_Face */ + ft_glyphslot_set_bitmap( slot, p ); } - slot->flags = FT_GLYPH_OWN_BITMAP; slot->bitmap_left = 0; slot->bitmap_top = font->header.ascent; - slot->format = ft_glyph_format_bitmap; + slot->format = FT_GLYPH_FORMAT_BITMAP; /* now set up metrics */ slot->metrics.horiAdvance = bitmap->width << 6; @@ -709,7 +640,7 @@ slot->metrics.horiBearingY = slot->bitmap_top << 6; slot->linearHoriAdvance = (FT_Fixed)bitmap->width << 16; - slot->format = ft_glyph_format_bitmap; + slot->format = FT_GLYPH_FORMAT_BITMAP; Exit: return error; @@ -749,22 +680,9 @@ (FT_Size_ResetPixelsFunc) FNT_Size_Set_Pixels, (FT_Slot_LoadFunc) FNT_Load_Glyph, -#ifdef FT_CONFIG_OPTION_USE_CMAPS - (FT_CharMap_CharIndexFunc)0, -#else - (FT_CharMap_CharIndexFunc)FNT_Get_Char_Index, -#endif - - (FT_Face_GetKerningFunc) 0, (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc) 0, - -#ifdef FT_CONFIG_OPTION_USE_CMAPS - (FT_CharMap_CharNextFunc) 0 -#else - (FT_CharMap_CharNextFunc) FNT_Get_Next_Char -#endif + (FT_Face_GetAdvancesFunc) 0 }; Index: xc/extras/freetype2/src/winfonts/winfnt.c.save diff -u xc/extras/freetype2/src/winfonts/winfnt.c.save:1.2 xc/extras/freetype2/src/winfonts/winfnt.c.save:removed --- xc/extras/freetype2/src/winfonts/winfnt.c.save:1.2 Fri Oct 25 11:01:06 2002 +++ xc/extras/freetype2/src/winfonts/winfnt.c.save Sat Feb 28 21:40:22 2004 @@ -1,684 +0,0 @@ -/***************************************************************************/ -/* */ -/* winfnt.c */ -/* */ -/* FreeType font driver for Windows FNT/FON files */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_FNT_TYPES_H - -#include "winfnt.h" - -#include "fnterrs.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_winfnt - - - static - const FT_Frame_Field winmz_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinMZ_Header - - FT_FRAME_START( 64 ), - FT_FRAME_USHORT_LE ( magic ), - FT_FRAME_SKIP_BYTES( 29 * 2 ), - FT_FRAME_ULONG_LE ( lfanew ), - FT_FRAME_END - }; - - static - const FT_Frame_Field winne_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinNE_Header - - FT_FRAME_START( 40 ), - FT_FRAME_USHORT_LE ( magic ), - FT_FRAME_SKIP_BYTES( 34 ), - FT_FRAME_USHORT_LE ( resource_tab_offset ), - FT_FRAME_USHORT_LE ( rname_tab_offset ), - FT_FRAME_END - }; - - static - const FT_Frame_Field winfnt_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinFNT_Header - - FT_FRAME_START( 134 ), - FT_FRAME_USHORT_LE( version ), - FT_FRAME_ULONG_LE ( file_size ), - FT_FRAME_BYTES ( copyright, 60 ), - FT_FRAME_USHORT_LE( file_type ), - FT_FRAME_USHORT_LE( nominal_point_size ), - FT_FRAME_USHORT_LE( vertical_resolution ), - FT_FRAME_USHORT_LE( horizontal_resolution ), - FT_FRAME_USHORT_LE( ascent ), - FT_FRAME_USHORT_LE( internal_leading ), - FT_FRAME_USHORT_LE( external_leading ), - FT_FRAME_BYTE ( italic ), - FT_FRAME_BYTE ( underline ), - FT_FRAME_BYTE ( strike_out ), - FT_FRAME_USHORT_LE( weight ), - FT_FRAME_BYTE ( charset ), - FT_FRAME_USHORT_LE( pixel_width ), - FT_FRAME_USHORT_LE( pixel_height ), - FT_FRAME_BYTE ( pitch_and_family ), - FT_FRAME_USHORT_LE( avg_width ), - FT_FRAME_USHORT_LE( max_width ), - FT_FRAME_BYTE ( first_char ), - FT_FRAME_BYTE ( last_char ), - FT_FRAME_BYTE ( default_char ), - FT_FRAME_BYTE ( break_char ), - FT_FRAME_USHORT_LE( bytes_per_row ), - FT_FRAME_ULONG_LE ( device_offset ), - FT_FRAME_ULONG_LE ( face_name_offset ), - FT_FRAME_ULONG_LE ( bits_pointer ), - FT_FRAME_ULONG_LE ( bits_offset ), - FT_FRAME_BYTE ( reserved ), - FT_FRAME_ULONG_LE ( flags ), - FT_FRAME_USHORT_LE( A_space ), - FT_FRAME_USHORT_LE( B_space ), - FT_FRAME_USHORT_LE( C_space ), - FT_FRAME_USHORT_LE( color_table_offset ), - FT_FRAME_BYTES ( reserved, 4 ), - FT_FRAME_END - }; - - - static void - fnt_font_done( FNT_Font* font, - FT_Stream stream ) - { - if ( font->fnt_frame ) - RELEASE_Frame( font->fnt_frame ); - - font->fnt_size = 0; - font->fnt_frame = 0; - } - - - static FT_Error - fnt_font_load( FNT_Font* font, - FT_Stream stream ) - { - FT_Error error; - WinFNT_Header* header = &font->header; - - - /* first of all, read the FNT header */ - if ( FILE_Seek( font->offset ) || - READ_Fields( winfnt_header_fields, header ) ) - goto Exit; - - /* check header */ - if ( header->version != 0x200 && - header->version != 0x300 ) - { - FT_TRACE2(( "[not a valid FNT file]\n" )); - error = FNT_Err_Unknown_File_Format; - goto Exit; - } - - if ( header->file_type & 1 ) - { - FT_TRACE2(( "[can't handle vector FNT fonts]\n" )); - error = FNT_Err_Unknown_File_Format; - goto Exit; - } - - /* small fixup -- some fonts have the `pixel_width' field set to 0 */ - if ( header->pixel_width == 0 ) - header->pixel_width = header->pixel_height; - - /* this is a FNT file/table, we now extract its frame */ - if ( FILE_Seek( font->offset ) || - EXTRACT_Frame( header->file_size, font->fnt_frame ) ) - goto Exit; - - Exit: - return error; - } - - - static void - fnt_face_done_fonts( FNT_Face face ) - { - FT_Memory memory = FT_FACE(face)->memory; - FT_Stream stream = FT_FACE(face)->stream; - FNT_Font* cur = face->fonts; - FNT_Font* limit = cur + face->num_fonts; - - - for ( ; cur < limit; cur++ ) - fnt_font_done( cur, stream ); - - FREE( face->fonts ); - face->num_fonts = 0; - } - - - static FT_Error - fnt_face_get_dll_fonts( FNT_Face face ) - { - FT_Error error; - FT_Stream stream = FT_FACE(face)->stream; - FT_Memory memory = FT_FACE(face)->memory; - WinMZ_Header mz_header; - - - face->fonts = 0; - face->num_fonts = 0; - - /* does it begin with a MZ header? */ - if ( FILE_Seek( 0 ) || - READ_Fields( winmz_header_fields, &mz_header ) ) - goto Exit; - - error = FNT_Err_Unknown_File_Format; - if ( mz_header.magic == WINFNT_MZ_MAGIC ) - { - /* yes, now look for a NE header in the file */ - WinNE_Header ne_header; - - - if ( FILE_Seek( mz_header.lfanew ) || - READ_Fields( winne_header_fields, &ne_header ) ) - goto Exit; - - error = FNT_Err_Unknown_File_Format; - if ( ne_header.magic == WINFNT_NE_MAGIC ) - { - /* good, now look in the resource table for each FNT resource */ - FT_ULong res_offset = mz_header.lfanew + - ne_header.resource_tab_offset; - - FT_UShort size_shift; - FT_UShort font_count = 0; - FT_ULong font_offset = 0; - - - if ( FILE_Seek( res_offset ) || - ACCESS_Frame( ne_header.rname_tab_offset - - ne_header.resource_tab_offset ) ) - goto Exit; - - size_shift = GET_UShortLE(); - - for (;;) - { - FT_UShort type_id, count; - - - type_id = GET_UShortLE(); - if ( !type_id ) - break; - - count = GET_UShortLE(); - - if ( type_id == 0x8008 ) - { - font_count = count; - font_offset = (FT_ULong)( FILE_Pos() + 4 + - ( stream->cursor - stream->limit ) ); - break; - } - - stream->cursor += 4 + count * 12; - } - FORGET_Frame(); - - if ( !font_count || !font_offset ) - { - FT_TRACE2(( "this file doesn't contain any FNT resources!\n" )); - error = FNT_Err_Unknown_File_Format; - goto Exit; - } - - if ( FILE_Seek( font_offset ) || - ALLOC_ARRAY( face->fonts, font_count, FNT_Font ) ) - goto Exit; - - face->num_fonts = font_count; - - if ( ACCESS_Frame( (FT_Long)font_count * 12 ) ) - goto Exit; - - /* now read the offset and position of each FNT font */ - { - FNT_Font* cur = face->fonts; - FNT_Font* limit = cur + font_count; - - - for ( ; cur < limit; cur++ ) - { - cur->offset = (FT_ULong)GET_UShortLE() << size_shift; - cur->fnt_size = (FT_ULong)GET_UShortLE() << size_shift; - cur->size_shift = size_shift; - stream->cursor += 8; - } - } - FORGET_Frame(); - - /* finally, try to load each font there */ - { - FNT_Font* cur = face->fonts; - FNT_Font* limit = cur + font_count; - - - for ( ; cur < limit; cur++ ) - { - error = fnt_font_load( cur, stream ); - if ( error ) - goto Fail; - } - } - } - } - - Fail: - if ( error ) - fnt_face_done_fonts( face ); - - Exit: - return error; - } - - - static void - FNT_Face_Done( FNT_Face face ) - { - FT_Memory memory = FT_FACE_MEMORY( face ); - - - fnt_face_done_fonts( face ); - - FREE( face->root.available_sizes ); - face->root.num_fixed_sizes = 0; - } - - - static FT_Error - FNT_Face_Init( FT_Stream stream, - FNT_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ) - { - FT_Error error; - FT_Memory memory = FT_FACE_MEMORY( face ); - - FT_UNUSED( num_params ); - FT_UNUSED( params ); - FT_UNUSED( face_index ); - - - /* try to load several fonts from a DLL */ - error = fnt_face_get_dll_fonts( face ); - if ( error ) - { - /* this didn't work, now try to load a single FNT font */ - FNT_Font* font; - - if ( ALLOC( face->fonts, sizeof ( *face->fonts ) ) ) - goto Exit; - - face->num_fonts = 1; - font = face->fonts; - - font->offset = 0; - font->fnt_size = stream->size; - - error = fnt_font_load( font, stream ); - if ( error ) - goto Fail; - } - - /* all right, one or more fonts were loaded; we now need to */ - /* fill the root FT_Face fields with relevant information */ - { - FT_Face root = FT_FACE( face ); - FNT_Font* fonts = face->fonts; - FNT_Font* limit = fonts + face->num_fonts; - FNT_Font* cur; - - - root->num_faces = 1; - root->face_flags = FT_FACE_FLAG_FIXED_SIZES | - FT_FACE_FLAG_HORIZONTAL; - - if ( fonts->header.avg_width == fonts->header.max_width ) - root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; - - if ( fonts->header.italic ) - root->style_flags |= FT_STYLE_FLAG_ITALIC; - - if ( fonts->header.weight >= 800 ) - root->style_flags |= FT_STYLE_FLAG_BOLD; - - /* Setup the `fixed_sizes' array */ - if ( ALLOC_ARRAY( root->available_sizes, face->num_fonts, - FT_Bitmap_Size ) ) - goto Fail; - - root->num_fixed_sizes = face->num_fonts; - - { - FT_Bitmap_Size* size = root->available_sizes; - - - for ( cur = fonts; cur < limit; cur++, size++ ) - { - size->width = cur->header.pixel_width; - size->height = cur->header.pixel_height; - } - } - - /* Setup the `charmaps' array */ - root->charmaps = &face->charmap_handle; - root->num_charmaps = 1; - - face->charmap.encoding = ft_encoding_unicode; - face->charmap.platform_id = 3; - face->charmap.encoding_id = 1; - face->charmap.face = root; - - face->charmap_handle = &face->charmap; - - root->charmap = face->charmap_handle; - - /* setup remaining flags */ - root->num_glyphs = fonts->header.last_char - - fonts->header.first_char + 1; - - root->family_name = (FT_String*)fonts->fnt_frame + - fonts->header.face_name_offset; - root->style_name = (char *)"Regular"; - - if ( root->style_flags & FT_STYLE_FLAG_BOLD ) - { - if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) - root->style_name = (char *)"Bold Italic"; - else - root->style_name = (char *)"Bold"; - } - else if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) - root->style_name = (char *)"Italic"; - } - - Fail: - if ( error ) - FNT_Face_Done( face ); - - Exit: - return error; - } - - - static FT_Error - FNT_Size_Set_Pixels( FNT_Size size ) - { - /* look up a font corresponding to the current pixel size */ - FNT_Face face = (FNT_Face)FT_SIZE_FACE( size ); - FNT_Font* cur = face->fonts; - FNT_Font* limit = cur + face->num_fonts; - - - size->font = 0; - for ( ; cur < limit; cur++ ) - { - /* we only compare the character height, as fonts used some strange */ - /* values */ - if ( cur->header.pixel_height == size->root.metrics.y_ppem ) - { - size->font = cur; - - size->root.metrics.ascender = cur->header.ascent * 64; - size->root.metrics.descender = ( cur->header.pixel_height - - cur->header.ascent ) * 64; - size->root.metrics.height = cur->header.pixel_height * 64; - break; - } - } - - return ( size->font ? FNT_Err_Ok : FNT_Err_Invalid_Pixel_Size ); - } - - - static FT_UInt - FNT_Get_Char_Index( FT_CharMap charmap, - FT_Long char_code ) - { - FT_Long result = char_code; - - - if ( charmap ) - { - FNT_Font* font = ((FNT_Face)charmap->face)->fonts; - FT_Long first = font->header.first_char; - FT_Long count = font->header.last_char - first + 1; - - - char_code -= first; - if ( char_code < count ) - result = char_code + 1; - else - result = 0; - } - - return result; - } - - static FT_Long - FNT_Get_Next_Char( FT_CharMap charmap, - FT_Long char_code ) - { - char_code++; - if ( charmap ) - { - FNT_Font* font = ((FNT_Face)charmap->face)->fonts; - FT_Long first = font->header.first_char; - - - if ( char_code < first ) - char_code = first; - if ( char_code <= font->header.last_char ) - return char_code; - } - else - return char_code; - return 0; - } - - - static FT_Error - FNT_Load_Glyph( FT_GlyphSlot slot, - FNT_Size size, - FT_UInt glyph_index, - FT_Int load_flags ) - { - FNT_Font* font = size->font; - FT_Error error = 0; - FT_Byte* p; - FT_Int len; - FT_Bitmap* bitmap = &slot->bitmap; - FT_ULong offset; - FT_Bool new_format; - - FT_UNUSED( slot ); - FT_UNUSED( load_flags ); - - - if ( !font ) - { - error = FNT_Err_Invalid_Argument; - goto Exit; - } - - if ( glyph_index > 0 ) - glyph_index--; - else - glyph_index = font->header.default_char - font->header.first_char; - - new_format = FT_BOOL( font->header.version == 0x300 ); - len = new_format ? 6 : 4; - - /* jump to glyph entry */ - p = font->fnt_frame + 118 + len * glyph_index; - - bitmap->width = NEXT_ShortLE(p); - - if ( new_format ) - offset = NEXT_ULongLE(p); - else - offset = NEXT_UShortLE(p); - - /* jump to glyph data */ - p = font->fnt_frame + /* font->header.bits_offset */ + offset; - - /* allocate and build bitmap */ - { - FT_Memory memory = FT_FACE_MEMORY( slot->face ); - FT_Int pitch = ( bitmap->width + 7 ) >> 3; - FT_Byte* column; - FT_Byte* write; - - - bitmap->pitch = pitch; - bitmap->rows = font->header.pixel_height; - bitmap->pixel_mode = ft_pixel_mode_mono; - - if ( ALLOC( bitmap->buffer, pitch * bitmap->rows ) ) - goto Exit; - - column = (FT_Byte*)bitmap->buffer; - - for ( ; pitch > 0; pitch--, column++ ) - { - FT_Byte* limit = p + bitmap->rows; - - - for ( write = column; p < limit; p++, write += bitmap->pitch ) - write[0] = p[0]; - } - } - - slot->flags = ft_glyph_own_bitmap; - slot->bitmap_left = 0; - slot->bitmap_top = font->header.ascent; - slot->format = ft_glyph_format_bitmap; - - /* now set up metrics */ - slot->metrics.horiAdvance = bitmap->width << 6; - slot->metrics.horiBearingX = 0; - slot->metrics.horiBearingY = slot->bitmap_top << 6; - - slot->linearHoriAdvance = (FT_Fixed)bitmap->width << 16; - slot->format = ft_glyph_format_bitmap; - - Exit: - return error; - } - - - FT_CALLBACK_TABLE_DEF - const FT_Driver_Class winfnt_driver_class = - { - { - ft_module_font_driver, - sizeof ( FT_DriverRec ), - - "winfonts", - 0x10000L, - 0x20000L, - - 0, - - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 - }, - - sizeof( FNT_FaceRec ), - sizeof( FNT_SizeRec ), - sizeof( FT_GlyphSlotRec ), - - (FTDriver_initFace) FNT_Face_Init, - (FTDriver_doneFace) FNT_Face_Done, - (FTDriver_initSize) 0, - (FTDriver_doneSize) 0, - (FTDriver_initGlyphSlot)0, - (FTDriver_doneGlyphSlot)0, - - (FTDriver_setCharSizes) FNT_Size_Set_Pixels, - (FTDriver_setPixelSizes)FNT_Size_Set_Pixels, - - (FTDriver_loadGlyph) FNT_Load_Glyph, - (FTDriver_getCharIndex) FNT_Get_Char_Index, - - (FTDriver_getKerning) 0, - (FTDriver_attachFile) 0, - (FTDriver_getAdvances) 0, - - (FTDriver_getNextChar) FNT_Get_Next_Char - }; - - -#ifdef FT_CONFIG_OPTION_DYNAMIC_DRIVERS - - - /*************************************************************************/ - /* */ - /* */ - /* getDriverClass */ - /* */ - /* */ - /* This function is used when compiling the TrueType driver as a */ - /* shared library (`.DLL' or `.so'). It will be used by the */ - /* high-level library of FreeType to retrieve the address of the */ - /* driver's generic interface. */ - /* */ - /* It shouldn't be implemented in a static build, as each driver must */ - /* have the same function as an exported entry point. */ - /* */ - /* */ - /* The address of the TrueType's driver generic interface. The */ - /* format-specific interface can then be retrieved through the method */ - /* interface->get_format_interface. */ - /* */ - FT_EXPORT_DEF( const FT_Driver_Class* ) - getDriverClass( void ) - { - return &winfnt_driver_class; - } - - -#endif /* FT_CONFIG_OPTION_DYNAMIC_DRIVERS */ - - -/* END */ Index: xc/extras/freetype2/tests/Jamfile diff -u xc/extras/freetype2/tests/Jamfile:1.1.1.1 xc/extras/freetype2/tests/Jamfile:1.1.1.2 --- xc/extras/freetype2/tests/Jamfile:1.1.1.1 Mon Jan 14 11:52:27 2002 +++ xc/extras/freetype2/tests/Jamfile Wed May 28 22:02:00 2003 @@ -7,28 +7,35 @@ SubDirHdrs [ FT2_SubDir .. nirvana include ] ; -NV_TOP = [ FT2_SubDir .. .. nirvana ] ; +NV_TOP = [ FT2_SubDir .. .. nirvana ] ; -NIRVANA_LINKLIBS = $(NV_TOP)\\objs\\nirvana$(SUFLIB) ; +NIRVANA_LINKLIBS = $(NV_TOP)/objs/libnirvana$(SUFLIB) ; { local t ; - + for t in $(test_programs) { Main $(t) : $(t).c ; - + LinkLibraries $(t) : $(FT2_LIB) ; - - if $(TOOLSET) = MINGW + + if $(WIN) { - LINKKLIBS on $(t)$(SUFEXE) = "-luser32 -lgdi32" ; + if $(TOOLSET) = MINGW + { + LINKKLIBS on $(t)$(SUFEXE) = "-luser32 -lgdi32" ; + } + else + { + LINKLIBS on $(t)$(SUFEXE) = user32.lib gdi32.lib ; + } } else { - LINKLIBS on $(t)$(SUFEXE) = user32.lib gdi32.lib ; + LINKLIBS on $(t)$(SUFEXE) = -L/usr/X11R6/lib -lX11 -lm ; } - + NEEDLIBS on $(t)$(SUFEXE) += $(NIRVANA_LINKLIBS) ; } } Index: xc/extras/freetype2/tests/gview.c diff -u xc/extras/freetype2/tests/gview.c:1.1.1.1 xc/extras/freetype2/tests/gview.c:1.1.1.2 --- xc/extras/freetype2/tests/gview.c:1.1.1.1 Mon Jan 14 11:52:27 2002 +++ xc/extras/freetype2/tests/gview.c Wed May 28 22:02:00 2003 @@ -9,6 +9,7 @@ #include <../src/pshinter/pshrec.h> #include <../src/pshinter/pshalgo1.h> #include <../src/pshinter/pshalgo2.h> +#include <../src/pshinter/pshalgo3.h> #include <../src/autohint/ahtypes.h> @@ -130,15 +131,17 @@ nv_path_new_rectangle( renderer, -1, -1, 3, 3, 0, 0, &symbol_square ); nv_path_new_rectangle( renderer, -1, -6, 2, 12, 0, 0, &symbol_rect_v ); nv_path_new_rectangle( renderer, -6, -1, 12, 2, 0, 0, &symbol_rect_h ); + nv_path_new_circle( renderer, 0, 0, 3., &symbol_dot ); + nv_path_stroke( symbol_dot, 0.6, nv_path_linecap_butt, nv_path_linejoin_miter, 1., &symbol_circle ); nv_path_destroy( symbol_dot ); - nv_path_new_circle( renderer, 0, 0, 2., &symbol_dot ); + nv_path_new_circle( renderer, 0, 0, 2., &symbol_dot ); } static void @@ -608,6 +611,155 @@ } } + /************************************************************************/ + /************************************************************************/ + /***** *****/ + /***** POSTSCRIPT HINTER ALGORITHM 3 ROUTINES *****/ + /***** *****/ + /************************************************************************/ + /************************************************************************/ + +#include <../src/pshinter/pshalgo3.h> + +static void +draw_ps3_hint( PSH3_Hint hint, FT_Bool vertical ) +{ + int x1, x2; + NV_Vector v; + + if ( pshint_vertical != vertical ) + { + if (vertical) + pshint_cpos = 40; + else + pshint_cpos = 10; + + pshint_vertical = vertical; + } + + if (!vertical) + { + if ( !option_show_vert_hints ) + return; + + v.x = hint->cur_pos; + v.y = 0; + nv_vector_transform( &v, &size_transform ); + x1 = (int)(v.x + 0.5); + + v.x = hint->cur_pos + hint->cur_len; + v.y = 0; + nv_vector_transform( &v, &size_transform ); + x2 = (int)(v.x + 0.5); + + nv_pixmap_fill_rect( target, x1, 0, 1, target->height, + psh3_hint_is_ghost(hint) + ? GHOST_HINT_COLOR : STEM_HINT_COLOR ); + + if ( psh3_hint_is_ghost(hint) ) + { + x1 --; + x2 = x1 + 2; + } + else + nv_pixmap_fill_rect( target, x2, 0, 1, target->height, + psh3_hint_is_ghost(hint) + ? GHOST_HINT_COLOR : STEM_HINT_COLOR ); + + nv_pixmap_fill_rect( target, x1, pshint_cpos, x2+1-x1, 1, + STEM_JOIN_COLOR ); + } + else + { + if (!option_show_horz_hints) + return; + + v.y = hint->cur_pos; + v.x = 0; + nv_vector_transform( &v, &size_transform ); + x1 = (int)(v.y + 0.5); + + v.y = hint->cur_pos + hint->cur_len; + v.x = 0; + nv_vector_transform( &v, &size_transform ); + x2 = (int)(v.y + 0.5); + + nv_pixmap_fill_rect( target, 0, x1, target->width, 1, + psh3_hint_is_ghost(hint) + ? GHOST_HINT_COLOR : STEM_HINT_COLOR ); + + if ( psh3_hint_is_ghost(hint) ) + { + x1 --; + x2 = x1 + 2; + } + else + nv_pixmap_fill_rect( target, 0, x2, target->width, 1, + psh3_hint_is_ghost(hint) + ? GHOST_HINT_COLOR : STEM_HINT_COLOR ); + + nv_pixmap_fill_rect( target, pshint_cpos, x2, 1, x1+1-x2, + STEM_JOIN_COLOR ); + } + +#if 0 + printf( "[%7.3f %7.3f] %c\n", hint->cur_pos/64.0, (hint->cur_pos+hint->cur_len)/64.0, vertical ? 'v' : 'h' ); +#endif + + pshint_cpos += 10; +} + + +static void +ps3_draw_control_points( void ) +{ + if ( ps3_debug_glyph ) + { + PSH3_Glyph glyph = ps3_debug_glyph; + PSH3_Point point = glyph->points; + FT_UInt count = glyph->num_points; + NV_Transform transform, *trans = &transform; + NV_Path vert_rect; + NV_Path horz_rect; + NV_Path dot, circle; + + for ( ; count > 0; count--, point++ ) + { + NV_Vector vec; + + vec.x = point->cur_x; + vec.y = point->cur_y; + nv_vector_transform( &vec, &size_transform ); + + nv_transform_set_translate( trans, vec.x, vec.y ); + + if ( option_show_smooth && !psh3_point_is_smooth(point) ) + { + nv_painter_set_color( painter, SMOOTH_COLOR, 256 ); + nv_painter_fill_path( painter, trans, 0, symbol_circle ); + } + + if (option_show_horz_hints) + { + if ( point->flags_y & PSH3_POINT_STRONG ) + { + nv_painter_set_color( painter, STRONG_COLOR, 256 ); + nv_painter_fill_path( painter, trans, 0, symbol_rect_h ); + } + } + + if (option_show_vert_hints) + { + if ( point->flags_x & PSH3_POINT_STRONG ) + { + nv_painter_set_color( painter, STRONG_COLOR, 256 ); + nv_painter_fill_path( painter, trans, 0, symbol_rect_v ); + } + } + } + } +} + static void ps_print_hints( void ) @@ -701,15 +853,15 @@ { if ( ah_debug_hinter && option_show_smooth ) { - AH_Outline* glyph = ah_debug_hinter->glyph; + AH_Outline glyph = ah_debug_hinter->glyph; FT_UInt count = glyph->num_points; - AH_Point* point = glyph->points; + AH_Point point = glyph->points; nv_painter_set_color( painter, SMOOTH_COLOR, 256 ); for ( ; count > 0; count--, point++ ) { - if ( !( point->flags & ah_flag_weak_interpolation ) ) + if ( !( point->flags & AH_FLAG_WEAK_INTERPOLATION ) ) { NV_Transform transform, *trans = &transform; NV_Vector vec; @@ -731,16 +883,16 @@ { if ( ah_debug_hinter ) { - AH_Outline* glyph = ah_debug_hinter->glyph; + AH_Outline glyph = ah_debug_hinter->glyph; FT_UInt count; - AH_Edge* edge; + AH_Edge edge; FT_Pos pp1 = ah_debug_hinter->pp1.x; nv_painter_set_color( painter, EDGE_COLOR, 256 ); if ( option_show_edges ) { - /* draw verticla edges */ + /* draw vertical edges */ if ( option_show_vert_hints ) { count = glyph->num_vedges; @@ -786,12 +938,12 @@ /* draw vertical segments */ if ( option_show_vert_hints ) { - AH_Segment* seg = glyph->vert_segments; + AH_Segment seg = glyph->vert_segments; FT_UInt count = glyph->num_vsegments; for ( ; count > 0; count--, seg++ ) { - AH_Point *first, *last; + AH_PointRec *first, *last; NV_Vector v1, v2; NV_Pos y1, y2, x; @@ -825,12 +977,12 @@ /* draw horizontal segments */ if ( option_show_horz_hints ) { - AH_Segment* seg = glyph->horz_segments; + AH_Segment seg = glyph->horz_segments; FT_UInt count = glyph->num_hsegments; for ( ; count > 0; count--, seg++ ) { - AH_Point *first, *last; + AH_PointRec *first, *last; NV_Vector v1, v2; NV_Pos y1, y2, x; @@ -864,12 +1016,12 @@ if ( option_show_vert_hints && option_show_links ) { - AH_Segment* seg = glyph->vert_segments; + AH_Segment seg = glyph->vert_segments; FT_UInt count = glyph->num_vsegments; for ( ; count > 0; count--, seg++ ) { - AH_Segment* seg2 = NULL; + AH_Segment seg2 = NULL; NV_Path link; NV_Vector v1, v2; @@ -900,12 +1052,12 @@ if ( option_show_horz_hints && option_show_links ) { - AH_Segment* seg = glyph->horz_segments; + AH_Segment seg = glyph->horz_segments; FT_UInt count = glyph->num_hsegments; for ( ; count > 0; count--, seg++ ) { - AH_Segment* seg2 = NULL; + AH_Segment seg2 = NULL; NV_Path link; NV_Vector v1, v2; @@ -954,15 +1106,14 @@ ps1_debug_hint_func = option_show_ps_hints ? draw_ps1_hint : 0; ps2_debug_hint_func = option_show_ps_hints ? draw_ps2_hint : 0; + ps3_debug_hint_func = option_show_ps_hints ? draw_ps3_hint : 0; ah_debug_hinter = NULL; - error = FT_Load_Glyph( face, glyph_index, option_hinting - ? FT_LOAD_NO_BITMAP - : FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING ); + error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_BITMAP ); if (error) Panic( "could not load glyph" ); - if ( face->glyph->format != ft_glyph_format_outline ) + if ( face->glyph->format != FT_GLYPH_FORMAT_OUTLINE ) Panic( "could not load glyph outline" ); error = nv_path_new_from_outline( renderer, @@ -1016,7 +1167,7 @@ for ( m = first; m <= last; m++ ) { - color = (out.tags[m] & FT_Curve_Tag_On) + color = (out.tags[m] & FT_CURVE_TAG_ON) ? ON_COLOR : OFF_COLOR; @@ -1180,6 +1331,9 @@ TOGGLE_OPTION( option_show_blues, "blue zones display" ); case NVV_KEY('h'): + ps_debug_no_horz_hints = option_hinting; + ps_debug_no_vert_hints = option_hinting; + TOGGLE_OPTION( option_hinting, "hinting" ) case NVV_KEY('H'): @@ -1300,7 +1454,7 @@ draw_ps_blue_zones(); draw_glyph( glyph_index ); - ps2_draw_control_points(); + ps3_draw_control_points(); nvv_surface_refresh( surface, NULL ); Index: xc/extras/ogl-sample/main/doc/man/mandefs diff -u xc/extras/ogl-sample/main/doc/man/mandefs:1.3 xc/extras/ogl-sample/main/doc/man/mandefs:1.4 --- xc/extras/ogl-sample/main/doc/man/mandefs:1.3 Tue Feb 6 12:45:07 2001 +++ xc/extras/ogl-sample/main/doc/man/mandefs Wed Oct 22 15:45:56 2003 @@ -30,8 +30,7 @@ # published by SGI, but has not been independently verified as being # compliant with the OpenGL(R) version 1.2.1 Specification. # -# $Date$ $Revision$ -# $Header: //depot/main/doc/man/mandefs#8 $ +# $XFree86: xc/extras/ogl-sample/main/doc/man/mandefs,v 1.4 2003/10/22 19:45:56 tsi Exp $ # Common definitions for man page Makefiles Index: xc/extras/ogl-sample/main/doc/man/tools/mmdoc diff -u xc/extras/ogl-sample/main/doc/man/tools/mmdoc:1.3 xc/extras/ogl-sample/main/doc/man/tools/mmdoc:1.4 --- xc/extras/ogl-sample/main/doc/man/tools/mmdoc:1.3 Tue Feb 6 12:45:09 2001 +++ xc/extras/ogl-sample/main/doc/man/tools/mmdoc Wed Oct 22 15:45:56 2003 @@ -1,4 +1,8 @@ -#! /bin/sh -x +#! /bin/sh + +# $XFree86: xc/extras/ogl-sample/main/doc/man/tools/mmdoc,v 1.4 2003/10/22 19:45:56 tsi Exp $ + +set -x # @(#)mmdoc 1.21 /doccenter/tmadm/src/shell/s.mmdoc # general documentation generator Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc:1.1.1.1 Mon Jan 15 16:48:11 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc Wed Oct 22 15:20:55 2003 @@ -33,6 +33,7 @@ ** ** $Date$ $Revision$ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc,v 1.2 2003/10/22 19:20:55 tsi Exp $ */ /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/interface/bezierEval.cc#3 $ */ @@ -55,7 +56,9 @@ static void normalize(float vec[3]); static void crossProduct(float x[3], float y[3], float ret[3]); +#ifdef UNUSED static void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]); +#endif static float binomialCoefficients[8][8] = { {1,0,0,0,0,0,0,0}, @@ -88,11 +91,10 @@ } } - - /*order = degree +1 >=1. */ -void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]) +#ifdef UNUSED +static void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]) { float uprime = (u-u0)/(u1-u0); float buf[MAX_ORDER][MAX_ORDER][MAX_DIMENSION]; @@ -113,7 +115,7 @@ for(j=0; j=1. @@ -171,7 +173,7 @@ */ void bezierSurfEvalDerGen(int uder, int vder, float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[]) { - int i,j,k; + int i; float newPoints[MAX_ORDER][MAX_DIMENSION]; for(i=0; i @@ -426,7 +426,7 @@ } extern "C" void GLAPIENTRY -gluNurbsCallback(GLUnurbs *r, GLenum which, GLvoid (*fn)(GLvoid)) +gluNurbsCallback(GLUnurbs *r, GLenum which, GLvoid (*fn)()) { switch (which) { case GLU_NURBS_BEGIN: Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc:1.1.1.1 Mon Jan 15 16:48:16 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc Wed Oct 22 15:20:55 2003 @@ -31,6 +31,7 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/glsurfeval.cc,v 1.2 2003/10/22 19:20:55 tsi Exp $ */ /* * glsurfeval.c++ @@ -815,8 +816,6 @@ inBPMListEvalEM(global_bpm); - - /* global_bpm = bezierPatchMeshListReverse(global_bpm); { @@ -972,7 +971,6 @@ REAL du, dv; long i,j; - long row; if(global_grid_nu == 0 || global_grid_nv == 0) return; /*no points need to be output*/ du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc:1.1.1.1 Mon Jan 15 16:48:18 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc Wed Oct 22 15:20:55 2003 @@ -33,6 +33,8 @@ ** ** $Date$ $Revision$ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc,v 1.2 2003/10/22 19:20:55 tsi Exp $ */ + /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/interface/incurveeval.cc#4 $ */ @@ -97,7 +99,7 @@ int uorder, REAL *ctlpoints) { - int i,j,x; + int i,x; curveEvalMachine *temp_em; switch(which){ case 0: //vertex @@ -139,7 +141,6 @@ { int j, row; REAL the_uprime; - REAL p; REAL *data; if(em->u2 == em->u1) Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc:1.2 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc:1.3 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc:1.2 Sat Jan 11 22:55:45 2003 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc Wed Oct 22 15:20:55 2003 @@ -36,7 +36,7 @@ /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc#4 $ */ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc,v 1.2 2003/01/12 03:55:45 tsi Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/interface/insurfeval.cc,v 1.3 2003/10/22 19:20:55 tsi Exp $ */ #include "gluos.h" #include @@ -404,7 +404,6 @@ { REAL du, dv; int i,j; - int row; REAL point[4]; REAL normal[3]; if(global_grid_nu == 0 || global_grid_nv == 0) @@ -442,7 +441,6 @@ endqstrip(); } } - } void OpenGLSurfaceEvaluator::inMap2f(int k, @@ -549,7 +547,6 @@ REAL du[4]; REAL dv[4]; - assert(global_ev_k>=3 && global_ev_k <= 4); /*compute homegeneous point and partial derivatives*/ inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); @@ -613,9 +610,6 @@ #ifdef DEBUG printf("vertex(%f,%f,%f)\n", retPoint[0],retPoint[1],retPoint[2]); #endif - - - } /*Compute point and normal @@ -629,7 +623,6 @@ REAL du[4]; REAL dv[4]; - assert(global_ev_k>=3 && global_ev_k <= 4); /*compute homegeneous point and partial derivatives*/ // inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); @@ -692,7 +685,6 @@ REAL du[4]; REAL dv[4]; - assert(global_ev_k>=3 && global_ev_k <= 4); /*compute homegeneous point and partial derivatives*/ // inPreEvaluateBV(global_ev_k, global_ev_uorder, global_ev_vorder, (v-global_ev_v1)/(global_ev_v2-global_ev_v1), global_ev_ctlPoints); @@ -757,7 +749,6 @@ REAL du[4]; REAL dv[4]; - assert(global_ev_k>=3 && global_ev_k <= 4); /*compute homegeneous point and partial derivatives*/ inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); @@ -875,7 +866,7 @@ REAL *baseData, REAL *retPoint, REAL* retdu, REAL *retdv) { - int j, row, col; + int j, col; REAL vprime; @@ -910,7 +901,7 @@ REAL *baseData, REAL *retPoint, REAL* retdu, REAL *retdv) { - int j, row, col; + int j, row; REAL uprime; @@ -1170,7 +1161,6 @@ void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val) { int i,j,k,l; - REAL leftMostV[2]; typedef REAL REAL3[3]; REAL3* upperXYZ = (REAL3*) malloc(sizeof(REAL3)*n_upper); @@ -1192,19 +1182,13 @@ /* *the algorithm works by scanning from left to right. - *leftMostV: the left most of the remaining verteces (on both upper and lower). - * it could an element of upperVerts or lowerVerts. - *i: upperVerts[i] is the first vertex to the right of leftMostV on upper line *j: lowerVerts[j] is the first vertex to the right of leftMostV on lower line */ - - /*initialize i,j,and leftMostV */ + if(upper_val[0] <= lower_val[0]) { i=1; j=0; - leftMostV[0] = upper_val[0]; - leftMostV[1] = v_upper; leftMostXYZ = upperXYZ[0]; leftMostNormal = upperNormal[0]; } @@ -1213,17 +1197,11 @@ i=0; j=1; - leftMostV[0] = lower_val[0]; - leftMostV[1] = v_lower; - leftMostXYZ = lowerXYZ[0]; leftMostNormal = lowerNormal[0]; } /*the main loop. - *the invariance is that: - *at the beginning of each loop, the meaning of i,j,and leftMostV are - *maintained */ while(1) { @@ -1263,7 +1241,7 @@ } break; /*exit the main loop*/ } - else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/ + else /* case3: neither is empty, there is at least one triangle to output*/ { if(upper_val[i] <= lower_val[j]) { @@ -1298,12 +1276,10 @@ endtfan(); - /*update i and leftMostV for next loop + /*update i for next loop */ i = k+1; - leftMostV[0] = upper_val[k]; - leftMostV[1] = v_upper; leftMostNormal = upperNormal[k]; leftMostXYZ = upperXYZ[k]; } @@ -1332,11 +1308,9 @@ } endtfan(); - /*update j and leftMostV for next loop + /*update j for next loop */ j=k; - leftMostV[0] = lower_val[j-1]; - leftMostV[1] = v_lower; leftMostNormal = lowerNormal[j-1]; leftMostXYZ = lowerXYZ[j-1]; @@ -1359,7 +1333,6 @@ void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val) { int i,j,k,l; - REAL botMostV[2]; typedef REAL REAL3[3]; REAL3* leftXYZ = (REAL3*) malloc(sizeof(REAL3)*n_left); @@ -1381,20 +1354,13 @@ /* *the algorithm works by scanning from bot to top. - *botMostV: the bot most of the remaining verteces (on both left and right). - * it could an element of leftVerts or rightVerts. - *i: leftVerts[i] is the first vertex to the top of botMostV on left line - *j: rightVerts[j] is the first vertex to the top of botMostV on rightline */ - - /*initialize i,j,and botMostV */ + if(left_val[0] <= right_val[0]) { i=1; j=0; - botMostV[0] = u_left; - botMostV[1] = left_val[0]; botMostXYZ = leftXYZ[0]; botMostNormal = leftNormal[0]; } @@ -1403,17 +1369,11 @@ i=0; j=1; - botMostV[0] = u_right; - botMostV[1] = right_val[0]; - botMostXYZ = rightXYZ[0]; botMostNormal = rightNormal[0]; } /*the main loop. - *the invariance is that: - *at the beginning of each loop, the meaning of i,j,and botMostV are - *maintained */ while(1) { @@ -1453,7 +1413,7 @@ } break; /*exit the main loop*/ } - else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/ + else /* case3: neither is empty, there is at least one triangle to output*/ { if(left_val[i] <= right_val[j]) { @@ -1488,12 +1448,10 @@ endtfan(); - /*update i and botMostV for next loop + /*update i for next loop */ i = k+1; - botMostV[0] = u_left; - botMostV[1] = left_val[k]; botMostNormal = leftNormal[k]; botMostXYZ = leftXYZ[k]; } @@ -1522,11 +1480,9 @@ } endtfan(); - /*update j and botMostV for next loop + /*update j for next loop */ j=k; - botMostV[0] = u_right; - botMostV[1] = right_val[j-1]; botMostNormal = rightNormal[j-1]; botMostXYZ = rightXYZ[j-1]; @@ -1806,7 +1762,6 @@ temp_vertex[3] = u; temp_vertex[4] = v; vertexCallBack(temp_vertex, userData); - }/*end if auto_normal*/ else //no normal map, and no normal callback function { @@ -1829,7 +1784,7 @@ void OpenGLSurfaceEvaluator::inBPMEvalEM(bezierPatchMesh* bpm) { - int i,j,k,l; + int i,j,k; float u,v; int ustride; Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc:1.1.1.1 Mon Jan 15 16:48:21 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc Wed Oct 22 15:20:56 2003 @@ -38,6 +38,7 @@ * $Date$ $Revision$ * $Header: //depot/main/gfx/lib/glu/libnurbs/internals/arc.cc#4 $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arc.cc,v 1.2 2003/10/22 19:20:56 tsi Exp $ */ #include #include "glimports.h" @@ -224,6 +225,7 @@ } } +#ifndef NDEBUG /*------------------------------------------------------------------------- * neq_vert - assert that two 2D vertices are not equal *------------------------------------------------------------------------- @@ -234,6 +236,7 @@ { return ((v1[0] != v2[0]) || (v1[1] != v2[1] )) ? 1 : 0; } +#endif /*------------------------------------------------------------------------- * check - verify consistency of a loop, including @@ -330,7 +333,7 @@ #define TOL 0.00001 -inline long tooclose( REAL x, REAL y ) +long tooclose( REAL x, REAL y ) { return (abs(x-y) < TOL) ? 1 : 0; } Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc:1.1.1.1 Mon Jan 15 16:48:23 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc Wed Oct 22 15:20:56 2003 @@ -31,6 +31,7 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/arctess.cc,v 1.2 2003/10/22 19:20:56 tsi Exp $ */ /* * arctessellator.c++ @@ -380,7 +381,9 @@ /* strength reduction on p = dp * step would introduce error */ int step; +#ifndef NOELIMINATION int ocanremove = 0; +#endif register long order = bezierArc->order; for( step=1, ++vert; steporder; for( step=1, ++vert; stepnuid; +#endif const REAL u = t->param[0]; const REAL v = t->param[1]; @@ -355,9 +358,7 @@ surfaceEvaluator.evalcoord2f( nuid, u, v ); } #else - surfaceEvaluator.evalcoord2f( 0, u, v ); -//for uninitial memory read surfaceEvaluator.evalcoord2f( nuid, u, v ); #endif } @@ -365,11 +366,9 @@ void Backend::tmeshvert( REAL u, REAL v ) { - +#ifndef NOWIREFRAME const long nuid = 0; - -#ifndef NOWIREFRAME npts++; if( wireframetris ) { if( npts >= 3 ) { @@ -394,7 +393,6 @@ surfaceEvaluator.evalcoord2f( nuid, u, v ); } #else - surfaceEvaluator.evalcoord2f( 0, u, v ); #endif } Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc:1.1.1.1 Mon Jan 15 16:48:26 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc Wed Oct 22 15:20:56 2003 @@ -31,6 +31,7 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/bin.cc,v 1.2 2003/10/22 19:20:56 tsi Exp $ */ /* * bin.c++ @@ -154,12 +155,12 @@ for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) { if( jarc->isbezier( ) ) { assert( jarc->pwlArc->npts == 2 ); +#ifndef NDEBUG TrimVertex *pts = jarc->pwlArc->pts; REAL s1 = pts[0].param[0]; REAL t1 = pts[0].param[1]; REAL s2 = pts[1].param[0]; REAL t2 = pts[1].param[1]; -#ifndef NDEBUG dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 ); #endif } Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc:1.3 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc:1.4 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc:1.3 Fri Apr 27 08:58:28 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc Wed Oct 22 15:20:57 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc,v 1.3 2001/04/27 12:58:28 dawes Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/curve.cc,v 1.4 2003/10/22 19:20:57 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -69,7 +69,6 @@ Quiltspec_ptr qs = geo->qspec; ps += qs->offset; ps += qs->index * qs->order * qs->stride; - REAL *pend = ps + qs->order * qs->stride; if( needsSampling ) mapdesc->xformSampling( ps, qs->order, qs->stride, spts, stride ); Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc:1.1.1.1 Mon Jan 15 16:48:28 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc Wed Oct 22 15:20:57 2003 @@ -36,6 +36,7 @@ /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc#4 $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/dataTransform.cc,v 1.2 2003/10/22 19:20:57 tsi Exp $ */ #include #include @@ -47,6 +48,7 @@ extern directedLine* arcLoopToDLineLoop(Arc_ptr loop); +/* static directedLine* copy_loop(Arc_ptr loop, Real2* vertArray, int& index, directedLine dline_buf[], sampledLine sline_buf[], int& index_dline) { directedLine *ret; @@ -103,7 +105,7 @@ sum += jarc->pwlArc->npts-1; return sum; } -/* + directedLine* bin_to_DLineLoops(Bin& bin) { directedLine *ret=NULL; Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc:1.1.1.1 Mon Jan 15 16:48:28 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc Wed Oct 22 15:20:57 2003 @@ -31,6 +31,7 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/intersect.cc,v 1.2 2003/10/22 19:20:57 tsi Exp $ */ /* * intersect.c++ @@ -53,7 +54,9 @@ enum i_result { INTERSECT_VERTEX, INTERSECT_EDGE }; /* local functions */ +#ifndef NDEBUG static int arc_classify( Arc_ptr, int, REAL ); +#endif static enum i_result pwlarc_intersect( PwlArc *, int, REAL, int, int[3] ); @@ -175,7 +178,10 @@ Subdivider::arc_split( Arc_ptr jarc, int param, REAL value, int dir ) { int maxvertex = jarc->pwlArc->npts; - Arc_ptr jarc1, jarc2, jarc3; + Arc_ptr jarc1; +#ifdef NOTDEF + Arc_ptr jarc2, jarc3; +#endif TrimVertex* v = jarc->pwlArc->pts; int loc[3]; @@ -394,6 +400,7 @@ } } +#ifndef NDEBUG /*---------------------------------------------------------------------------- * arc_classify - determine which side of a line a jarc lies *---------------------------------------------------------------------------- @@ -437,6 +444,7 @@ } } } +#endif void Subdivider::classify_tailonleft_s( Bin& bin, Bin& in, Bin& out, REAL val ) Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc:1.3 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc:1.4 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc:1.3 Fri Apr 27 08:58:28 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc Wed Oct 22 15:20:57 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc,v 1.3 2001/04/27 12:58:28 dawes Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mapdescv.cc,v 1.4 2003/10/22 19:20:57 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -129,12 +129,10 @@ REAL *mp = &mag[0][0]; const int istride = sizeof( tmp[0]) / sizeof( tmp[0][0][0] ); const int jstride = sizeof( tmp[0][0]) / sizeof( tmp[0][0][0] ); - const int kstride = sizeof( tmp[0][0][0]) / sizeof( tmp[0][0][0] ); const int mistride = sizeof( mag[0]) / sizeof( mag[0][0] ); const int mjstride = sizeof( mag[0][0]) / sizeof( mag[0][0] ); const int idist = nrows * istride; const int jdist = ncols * jstride; - const int kdist = inhcoords * kstride; const int id = idist - spartial * istride; const int jd = jdist - tpartial * jstride; Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc:1.1.1.1 Mon Jan 15 16:48:33 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc Wed Oct 22 15:20:57 2003 @@ -36,6 +36,7 @@ /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc#3 $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/monoTriangulationBackend.cc,v 1.2 2003/10/22 19:20:57 tsi Exp $ */ #include "monoTriangulation.h" #include "polyUtil.h" @@ -45,7 +46,9 @@ void reflexChain::outputFan(Real v[2], Backend* backend) { Int i; + /* TrimVertex trimVert; + */ backend->bgntfan(); /* @@ -84,7 +87,10 @@ { Int i,j,k; Int isReflex; + /* TrimVertex trimVert; + */ + /*if there are at most one vertex in the queue, then simply insert */ if(index_queue <=1){ Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h:1.4 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h:1.1.1.1 Mon Jan 15 16:48:33 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h Wed Oct 22 15:20:57 2003 @@ -31,6 +31,7 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/mysetjmp.h,v 1.4 2003/10/22 19:20:57 tsi Exp $ */ /* * mysetjmp.h @@ -55,13 +56,34 @@ #define longjmp gl_longjmp #endif -#if LIBRARYBUILD | GLBUILD +#if defined(LIBRARYBUILD) || defined(GLBUILD) #include #include +/* Fix up for libc5 Linux systems */ +#ifndef LIBC5BUILD +#if defined(setjmp) && defined(__GNU_LIBRARY__) && \ + (!defined(__GLIBC__) || (__GLIBC__ < 2)) +#define LIBC5BUILD 1 +#else +#if !LIBC5BUILD +#undef LIBC5BUILD +#endif +#endif +#endif + +#ifndef LIBC5BUILD struct JumpBuffer { jmp_buf buf; }; +#else +struct JumpBuffer { + union { + jmp_buf jbuf; + sigjmp_buf sbuf; + } buf; +}; +#endif inline JumpBuffer * newJumpbuffer( void ) @@ -78,13 +100,22 @@ inline void mylongjmp( JumpBuffer *j, int code ) { - ::longjmp( j->buf, code ); +#ifndef LIBC5BUILD + longjmp( j->buf, code ); +#else + longjmp( j->buf.jbuf, code); +#endif } inline int mysetjmp( JumpBuffer *j ) { - return ::setjmp( j->buf ); +#ifndef LIBC5BUILD + return setjmp( j->buf ); +#else + __sigjmp_save( j->buf.sbuf, 1); + return __setjmp( j->buf.sbuf->__jmpbuf ); +#endif } #endif Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc:1.2 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc:1.3 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc:1.2 Sat Jan 11 22:55:45 2003 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc Wed Oct 22 15:20:57 2003 @@ -31,7 +31,7 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc,v 1.2 2003/01/12 03:55:45 tsi Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/slicer.cc,v 1.3 2003/10/22 19:20:57 tsi Exp $ */ /* * slicer.c++ @@ -84,6 +84,7 @@ #define ZERO 0.00001 /*determing whether a loop is a rectngle or not*/ #define equalRect(a,b) ((fabs(a-b) <= ZERO)? 1:0) //only used in tessellating a rectangle +#ifdef UNUSED static Int is_Convex(Arc_ptr loop) { if(area(loop->tail(), loop->head(), loop->next->head()) <0 ) @@ -95,9 +96,11 @@ } return 1; } +#endif /******triangulate a monotone polygon**************/ #include "monoTriangulation.h" +#ifdef UNUSED static int is_U_monotone(Arc_ptr loop) { int n_changes=0; @@ -126,6 +129,7 @@ else return 0; } +#endif inline int compInY(REAL a[2], REAL b[2]) { @@ -192,7 +196,6 @@ { inc_chain.appendVertex(jarc->pwlArc->pts[i].param); } - } vertexArray dec_chain(50); for(jarc = top->prev; jarc != bot; jarc = jarc->prev) @@ -257,7 +260,7 @@ return 0; } - +#ifdef USE_OPTTT //a line with the same u for opt static void evalLineNOGE_BU(TrimVertex *verts, int n, Backend& backend) { @@ -290,7 +293,7 @@ backend.tmeshvertNOGE(&verts[i]); } } - +#endif inline void OPT_OUTVERT(TrimVertex& vv, Backend& backend) { @@ -310,7 +313,6 @@ static void triangulateRect(Arc_ptr loop, Backend& backend, int TB_or_LR, int ulinear, int vlinear) { - int i; //we know the loop is a rectangle, but not sure which is top Arc_ptr top, bot, left, right; if(loop->tail()[1] == loop->head()[1]) @@ -464,9 +466,7 @@ for(i=d; i< right->npts; i++) { // backend.tmeshvert(& right->pts[i]); - OPT_OUTVERT(right->pts[i], backend); - } backend.endtfan(); } @@ -478,7 +478,6 @@ { // backend.tmeshvert(& right->pts[i]); OPT_OUTVERT(right->pts[i], backend); - } // backend.tmeshvert(& top->pts[1]); @@ -493,7 +492,6 @@ botd_left = 1; botd_right = bot->npts-2; //botd_left<= bot_dright - if(top->npts < bot->npts) { int delta=bot->npts - top->npts; @@ -563,18 +561,18 @@ OPT_OUTVERT(bot->pts[j], backend); } backend.endqstrip(); - } } } - static void triangulateRectCenter(int n_ulines, REAL* u_val, int n_vlines, REAL* v_val, Backend& backend) { + /* TrimVertex trimVert; - trimVert.nuid = 0;//???? + trimVert.nuid = 0; + */ backend.surfgrid(u_val[0], u_val[n_ulines-1], n_ulines-1, v_val[n_vlines-1], v_val[0], n_vlines-1); @@ -752,13 +750,8 @@ trimVert.param[0] = v; } backend.tmeshvert(&trimVert); - - - } backend.endqstrip(); - - } if(dir == 0) //temp_u_val was mallocated free(temp_u_val); @@ -854,12 +847,9 @@ free(u_val); free(v_val); - } - - - +#ifdef USE_READ_FLAG /**********for reading newtess_flag from a file**********/ static Int read_flag(char* name) { @@ -874,7 +864,7 @@ fclose(fp); return ret; } - +#endif /***********nextgen tess****************/ #include "sampleMonoPoly.h" @@ -934,8 +924,6 @@ } } - - directedLine* arcLoopToDLineLoop(Arc_ptr loop) { directedLine* ret; @@ -1053,9 +1041,6 @@ free(trimVert); } - - - void Slicer::slice_new(Arc_ptr loop) { //count++; @@ -1164,8 +1149,6 @@ } - - Slicer::Slicer( Backend &b ) : CoveAndTiler( b ), Mesher( b ), backend( b ) { Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc:1.1.1.1 Mon Jan 15 16:48:46 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc Wed Oct 22 15:20:57 2003 @@ -31,6 +31,7 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/trimline.cc,v 1.2 2003/10/22 19:20:57 tsi Exp $ */ /* * trimline.c++ @@ -162,13 +163,9 @@ { reset(); swap(); append( tinterp ); - PwlArc *lastpwl = botarc->prev->pwlArc; - TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1]; - TrimVertex *lastpt2 = botarc->pwlArc->pts; - register TrimVertex *p = jarcl.getnextpt(); - for( append( p ); p != lastpt2; append( p ) ) { - assert( p != lastpt1 ); + for( append( p ); p != botarc->pwlArc->pts; append( p ) ) { + assert( p != &botarc->prev->pwlArc->pts[botarc->prev->pwlArc->npts-1] ); p = jarcl.getnextpt(); } } @@ -179,12 +176,10 @@ reset(); swap(); append( tinterp ); PwlArc *lastpwl = botarc->prev->pwlArc; - TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1]; - TrimVertex *lastpt2 = botarc->pwlArc->pts; register TrimVertex *q = jarcl.getprevpt(); - for( append( q ); q != lastpt1; append( q ) ) { - assert( q != lastpt2 ); + for( append( q ); q != &lastpwl->pts[lastpwl->npts-1]; append( q ) ) { + assert( q != botarc->pwlArc->pts ); q = jarcl.getprevpt(); } } Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc:1.1.1.1 Mon Jan 15 16:48:51 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc Wed Oct 22 15:20:57 2003 @@ -33,6 +33,8 @@ ** ** $Date$ $Revision$ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc,v 1.2 2003/10/22 19:20:57 tsi Exp $ */ + /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/nurbtess/monoChain.cc#4 $ */ @@ -61,17 +63,17 @@ extern Int deleteRepeatDiagonals(Int num_diagonals, directedLine** diagonal_vertices, directedLine** new_vertices); //for debug purpose only -static void drawDiagonals(Int num_diagonals, directedLine** diagonal_vertices) -{ - Int i,k; - for(i=0; ihead()); - glVertex2fv(diagonal_vertices[2*i+1]->head()); - glEnd(); - } -} +//static void drawDiagonals(Int num_diagonals, directedLine** diagonal_vertices) +//{ +// Int i; +// for(i=0; ihead()); +// glVertex2fv(diagonal_vertices[2*i+1]->head()); +// glEnd(); +// } +//} /*given (x_1, y_1) and (x_2, y_2), and y *return x such that (x,y) is on the line @@ -346,7 +348,6 @@ e2_Ymin = head2[1]; } - /*Real e1_Ymax = max(head1[1], tail1[1]);*/ /*max(e1->head()[1], e1->tail()[1]);*/ /*Real e1_Ymin = min(head1[1], tail1[1]);*/ /*min(e1->head()[1], e1->tail()[1]);*/ /*Real e2_Ymax = max(head2[1], tail2[1]);*/ /*max(e2->head()[1], e2->tail()[1]);*/ @@ -549,10 +550,12 @@ { //printf("%i,%i\n", isAbove(dline, dline), isAbove(dline, dlinePrev)); errOccur = 1; +#if 1 goto JUMP_HERE; - +#else fprintf(stderr, "error in MC_sweepY\n"); exit(1); +#endif } } @@ -639,9 +642,6 @@ num_diagonals = k/2; } - - - directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines) { //printf("enter mc_partitionY\n"); @@ -930,5 +930,3 @@ *retSampledLines = newSampledLines; return ret_polygons; } - - Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc:1.1.1.1 Mon Jan 15 16:48:53 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc Wed Oct 22 15:20:57 2003 @@ -33,6 +33,8 @@ ** ** $Date$ $Revision$ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc,v 1.2 2003/10/22 19:20:57 tsi Exp $ */ + /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/nurbtess/monoTriangulation.cc#4 $ */ @@ -215,7 +217,6 @@ pStream->insert(rightVerts[j]); pStream->end(PRIMITIVE_STREAM_FAN); - } break; @@ -296,6 +297,7 @@ } } +#if 0 static int chainConvex(vertexArray* inc_chain, Int inc_current, Int inc_end) { Int i; @@ -321,13 +323,13 @@ } return 1; } +#endif void monoTriangulationRecGenInU(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, primStream* pStream) { - } void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, @@ -439,7 +441,6 @@ } //clean up list->deletePolygonListWithSline(); - } free(cusps); @@ -453,7 +454,8 @@ poly->deleteSinglePolygonWithSline(); return; } - + +#if 0 //apparently the following code is not reachable, //it is for test purpose if(inc_current > inc_end || dec_current>dec_end) @@ -485,6 +487,7 @@ dec_chain, dec_current, dec_end, pStream); } +#endif } /*if inc_current>inc_end, then inc_chain has no points to be considered @@ -739,8 +742,6 @@ assert( inc_chain != NULL && dec_chain != NULL); assert( ! (inc_current> inc_end && dec_current> dec_end)); - Int inc_nVertices; - Int dec_nVertices; Real** inc_array ; Real** dec_array ; Int i; Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h:1.1.1.1 Mon Jan 15 16:48:53 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h Wed Oct 22 15:20:57 2003 @@ -38,12 +38,13 @@ * $Date$ $Revision$ * $Header: //depot/main/gfx/lib/glu/include/mystdio.h#1 $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/mystdio.h,v 1.2 2003/10/22 19:20:57 tsi Exp $ */ #ifndef __glumystdio_h_ #define __glumystdio_h_ #ifdef STANDALONE -inline void dprintf( char *, ... ) { } +static inline void dprintf( char *fmt, ... ) { } #endif #ifdef LIBRARYBUILD @@ -51,12 +52,12 @@ #include #define dprintf printf #else -inline void dprintf( char *, ... ) { } +static inline void dprintf( char *fmt, ... ) { } #endif #endif #ifdef GLBUILD -inline void dprintf( char *, ... ) { } +static inline void dprintf( char *fmt, ... ) { } #endif #ifndef NULL Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc:1.1.1.1 Mon Jan 15 16:48:56 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc Wed Oct 22 15:20:57 2003 @@ -33,6 +33,7 @@ ** ** $Date$ $Revision$ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc,v 1.2 2003/10/22 19:20:57 tsi Exp $ */ /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/nurbtess/polyDBG.cc#3 $ */ @@ -165,10 +166,8 @@ (l1->tail()[0] == l2->tail()[0] && l1->tail()[1] == l2->tail()[1])) return 1; - } - if( ( area(l1->head(), l1->tail(), l2->head()) @@ -235,7 +234,6 @@ { return 1; } - } for(temp1=poly->getNext(); temp1 != poly; temp1 = temp1->getNext()) @@ -615,6 +613,7 @@ return begin; } +#ifdef UNUSED //given a polygon, cut the edges off and finally obtain a //a polygon without intersections. The cut-off edges are //dealloated. The new polygon is returned. @@ -668,8 +667,9 @@ return crt; else find = 0; //go to next loop + } } -} +#endif directedLine* DBG_cutIntersectionAllPoly(directedLine* list) { @@ -716,7 +716,6 @@ void DBG_collectSampledLinesPoly(directedLine *polygon, sampledLine*& retHead, sampledLine*& retTail) { directedLine *temp; - sampledLine *ret = NULL; retHead = NULL; retTail = NULL; if(polygon == NULL) Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc:1.1.1.1 Mon Jan 15 16:49:01 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc Wed Oct 22 15:20:58 2003 @@ -33,6 +33,7 @@ ** ** $Date$ $Revision$ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc,v 1.2 2003/10/22 19:20:58 tsi Exp $ */ /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompRight.cc#4 $ */ @@ -497,7 +498,8 @@ return; } - + +#if 0 //this following code cannot be reached, but leave it for debuggig purpose. Int i; //find the maximal U-monotone chain of beginRightIndex, beginRightIndex+1,... @@ -575,6 +577,7 @@ j+1, 0, ///a decreae chain pStream); +#endif } #endif Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc:1.2 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc:1.3 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc:1.2 Sun Apr 1 09:59:57 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc Wed Oct 22 15:20:58 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc,v 1.2 2001/04/01 13:59:57 tsi Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleCompTop.cc,v 1.3 2003/10/22 19:20:58 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -324,7 +324,6 @@ pStream); } - //return 1 if saprator exits, 0 otherwise Int findTopSeparator(vertexArray* leftChain, Int leftStartIndex, @@ -335,7 +334,6 @@ Int& ret_sep_left, Int& ret_sep_right) { - Int oldLeftI, oldRightI, newLeftI, newRightI; Int i,j,k; Real leftMax /*= leftChain->getVertex(leftEndIndex)[0]*/; @@ -467,7 +465,6 @@ } } - void sampleCompTop(Real* topVertex, vertexArray* leftChain, Int leftStartIndex, @@ -514,6 +511,7 @@ } else if(up_rightCornerWhere != 2) { +/* Real* tempTop; Int tempLeftStart; if(up_rightCornerWhere == 1) @@ -521,12 +519,11 @@ tempLeftStart = leftStartIndex; tempTop = topVertex; } - else //0 + else { tempLeftStart = up_rightCornerIndex+1; tempTop = leftChain->getVertex(up_rightCornerIndex); } -/* sampleTopLeftWithGridLine(tempTop, leftChain, tempLeftStart, up_leftCornerIndex, leftGridChain->getGrid(), leftGridChain->getVlineIndex(gridIndex1), @@ -770,7 +767,6 @@ }//end if 0,2 }//end if the function - static void sampleCompTopSimpleOpt(gridWrap* grid, Int gridV, Real* topVertex, Real* botVertex, @@ -1005,7 +1001,6 @@ 0, ActualRightChain.getNumElements()-1, pStream); - } else { @@ -1023,11 +1018,7 @@ &ActualRightChain, 0, ActualRightChain.getNumElements()-2, //the last is the bot. pStream); - - } free(gridPoints); - } - Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc:1.2 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc:1.3 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc:1.2 Sun Apr 1 09:59:58 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc Wed Oct 22 15:20:58 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc,v 1.2 2001/04/01 13:59:58 tsi Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampleMonoPoly.cc,v 1.3 2003/10/22 19:20:58 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -2104,10 +2104,7 @@ return; } - - - - +#if 0 Int i; if(1/*leftGridChain->getUlineIndex(leftGridChainStartIndex) >= leftGridChain->getUlineIndex(leftGridChainStartIndex+1)*/ @@ -2249,6 +2246,7 @@ pStream); } +#endif } /*n_upper>=1 Index: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc:1.1.1.1 xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc:1.2 --- xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc:1.1.1.1 Mon Jan 15 16:49:08 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc Wed Oct 22 15:20:58 2003 @@ -33,6 +33,8 @@ ** ** $Date$ $Revision$ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc,v 1.2 2003/10/22 19:20:58 tsi Exp $ */ + /* ** $Header: //depot/main/gfx/lib/glu/libnurbs/nurbtess/sampledLine.cc#4 $ */ @@ -96,7 +98,6 @@ sampledLine::sampledLine(Real pt1[2], Real pt2[2]) { - int i; npoints = 2; points = (Real2*) malloc(sizeof(Real2) * 2); assert(points); Index: xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c:1.3 xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c:1.4 --- xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c:1.3 Fri Feb 22 16:32:49 2002 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c Mon Dec 22 12:48:01 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c,v 1.3 2002/02/22 21:32:49 dawes Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libtess/normal.c,v 1.4 2003/12/22 17:48:01 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -50,6 +50,7 @@ #define Dot(u,v) (u[0]*v[0] + u[1]*v[1] + u[2]*v[2]) +#if defined(FOR_TRITE_TEST_PROGRAM) || defined(TRUE_PROJECT) static void Normalize( GLdouble v[3] ) { GLdouble len = v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; @@ -60,6 +61,7 @@ v[1] /= len; v[2] /= len; } +#endif #define ABS(x) ((x) < 0 ? -(x) : (x)) Index: xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c diff -u xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c:1.3 xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c:1.4 --- xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c:1.3 Sat Oct 27 23:32:24 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c Tue Mar 4 11:25:05 2003 @@ -32,7 +32,7 @@ ** compliant with the OpenGL(R) version 1.2.1 Specification. ** */ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c,v 1.3 2001/10/28 03:32:24 tsi Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glu/libutil/quad.c,v 1.4 2003/03/04 16:25:05 tsi Exp $ */ #include "gluos.h" #include "gluint.h" @@ -45,6 +45,7 @@ /* Make it not a power of two to avoid cache thrashing on the chip */ #define CACHE_SIZE 240 +#undef PI #define PI 3.14159265358979323846 struct GLUquadric { Index: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c diff -u xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c:1.3 xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c:1.4 --- xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c:1.3 Wed May 2 09:37:45 2001 +++ xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c Thu Nov 6 13:37:54 2003 @@ -38,7 +38,7 @@ * */ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c,v 1.3 2001/05/02 13:37:45 dawes Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c,v 1.4 2003/11/06 18:37:54 tsi Exp $ */ #include #include @@ -61,7 +61,7 @@ #pragma weak _XmStrings = _Xm_Stub_Pointer_ #pragma weak xmPrimitiveClassRec = _Xm_Stub_Pointer_ -static XtPointer _Xm_Stub_Pointer_ = NULL; +XtPointer _Xm_Stub_Pointer_ = NULL; #endif void GLwDrawingAreaMakeCurrent (Widget w, GLXContext ctx) Index: xc/extras/rman/rman.1 diff -u xc/extras/rman/rman.1:1.1.1.1 xc/extras/rman/rman.1:1.3 --- xc/extras/rman/rman.1:1.1.1.1 Mon Mar 20 19:47:34 2000 +++ xc/extras/rman/rman.1 Wed Oct 22 15:55:02 2003 @@ -1,3 +1,4 @@ +.\" $XFree86: xc/extras/rman/rman.1,v 1.3 2003/10/22 19:55:02 tsi Exp $ .TH PolyglotMan 1 .SH "NAME " PolyglotMan, rman - reverse compile man pages from formatted @@ -159,7 +160,7 @@ of text-tags pairs, where tag names roughly correspond to HTML. This output can be inserted into a Tk text widget by doing an \fI eval insert end \fR. This format should be -relatively easily parsible by other programs that want both the +relatively easily parsable by other programs that want both the text and the tags. Also see ASCII. .SS "ASCII " When printed on a line printer, man pages try to produce special @@ -174,12 +175,12 @@ Dumps section and (optionally) subsection titles. This might be useful for another program that processes man pages. .SS "HTML " -With a simple extention to an HTTP server for Mosaic or other +With a simple extension to an HTTP server for Mosaic or other World Wide Web browser, \fIPolyglotMan \fR can produce high quality HTML on the fly. Several such extensions and pointers to several others are included in \fIPolyglotMan \fR's \fIcontrib \fR directory. .SS "SGML " -This is appoaching the Docbook DTD, but I'm hoping that someone +This is approaching the Docbook DTD, but I'm hoping that someone that someone with a real interest in this will polish the tags generated. Try it to see how close the tags are now. .SS "MIME " Index: xc/extras/rman/rman.c diff -u xc/extras/rman/rman.c:1.15 xc/extras/rman/rman.c:1.19 --- xc/extras/rman/rman.c:1.15 Fri Nov 16 11:47:51 2001 +++ xc/extras/rman/rman.c Wed Dec 31 19:47:45 2003 @@ -1,48 +1,24 @@ #ifdef UNDEF -static char rcsid[] = "Header: /home/cs/phelps/spine/rman/RCS/rman.c,v 1.144 1999/08/10 00:41:55 phelps Exp phelps $"; +static char cvsid[] = "Header: /usr/build/rman/rman-031225/phelps/RCS/rman.c,v 1.154 2003/07/26 19:00:48 phelps Exp $"; #endif /* PolyglotMan by Thomas A. Phelps (phelps@ACM.org) accept man pages as formatted by (10) - Hewlett-Packard HP-UX, AT&T System V, SunOS, Sun Solaris, OSF/1, DEC Ultrix, - SGI IRIX, Linux, FreeBSD, SCO + Hewlett-Packard HP-UX, AT&T System V, SunOS, Sun Solaris, OSF/1, + DEC Ultrix, SGI IRIX, Linux, FreeBSD, SCO output as (9) printable ASCII, section headers only, TkMan, [tn]roff, HTML, - LaTeX, LaTeX2e, RTF, Perl pod, MIME, and soon SGML + LaTeX, LaTeX2e, RTF, Perl pod, MIME, DocBook XML - written March 24, 1993 - bs2tk transformed into RosettaMan November 4-5, 1993 - source interpretation added September 24, 1996 + written March 24, 1993 + bs2tk generalized into RosettaMan November 4-5, 1993 + source interpretation added September 24, 1996 renamed PolyglotMan due to lawsuit by Rosetta, Inc. August 8, 1997 */ -/* $XFree86: xc/extras/rman/rman.c,v 1.15 2001/11/16 16:47:51 dawes Exp $ */ - - -/* TO DO **** - - clean up relationship between source and formatted filtering support routines - - output to SGML with Davenport DTD - - don't give SHORTLINE if just finished bullet of bultxt, ended section head, ... other cases? - make sure text following bullet is aligned correctly - - output to WinHelp? don't have specs (anybody interested?) - collect header and footer until hit blank line? - what to do about tables? count second gap of spaces & average gap? ==> - good idea but tables too variable for this to work - internal, outline-like header section for HTML documents? how to put this *first*? (can't in single pass) - one line look ahead to enable better parsing (item lists, et cetera) - alluc (==nonlc) flag, copy curline to last line vector (works well with lookahead cache) - ?? collect sundry globals into vectors (i.e., arrays and enum indexes) - (if compiler has good constant propagation, then shouldn't slow access) - collect scattered globals into vectors (e.g., curline[ispcnt]): array + enum - curline, lastline, flags, pending, bufs+lens -*/ - +/* $XFree86: xc/extras/rman/rman.c,v 1.19 2004/01/01 00:47:45 dickey Exp $ */ #include #include @@ -50,8 +26,6 @@ #include #include #include -/* I'm sure I'll need some #ifdef's here to include the right headers */ -/* ... but compiles swell on Solaris, DEC Alpha, HP, SunOS */ #include #include #include @@ -67,20 +41,19 @@ /*** make #define's into consts? => can't because compilers not smart enough ***/ /* maximum number of tags per line */ #define MAXTAGS 50*100 -/* BUFSIZ = 1024 on Solaris */ #define MAXBUF 2*5000 #define MAXLINES 20000 #define MAXTOC 500 #define xputchar(c) (fcharout? putchar(c): (c)) #define sputchar(c) (fcharout? plain[sI++]=(char)c: (char)(c)) #define stagadd(tag) tagadd(tag,sI,0) -enum { c_rsquote='\''/*\x27*/, c_lsquote='`'/*\x60*/, c_dagger='\xa7', c_bullet='\xb7', c_plusminus='\xb1' }; +enum { c_dagger='\xa7', c_bullet='\xb7', c_plusminus='\xb1' }; /*** tag management ***/ enum tagtype { NOTAG, TITLE, ITALICS, BOLD, SYMBOL, SMALLCAPS, BOLDITALICS, MONO, MANREF }; /* MANREF last */ -struct { enum tagtype type; int first; int last; } tags[MAXTAGS]; +struct { enum tagtype type; int first; int last; } tags[MAXTAGS], tagtmp; int tagc=0; struct { char *text; int type; int line; } toc[MAXTOC]; int tocc=0; @@ -94,6 +67,7 @@ char *manrefsect; enum command { + NOCOMMAND=-1, /*BEGINCHARTAGS,*/ CHARTAB='\t', @@ -103,7 +77,7 @@ CHARDAGGER=0xad, CHARREGTM=0xae, CHARDEG=0xb0, CHARPLUSMINUS=0xb1, CHARACUTE=0xb4, CHARBULLET=0xb7, CHAR14=0xbc, CHAR12=0xbd, CHAR34=0xbe, CHARMUL=0xd7, CHARDIV=0xf7, - CHANGEBAR=0x100, CHARLQUOTE, CHARRQUOTE, HR, + CHANGEBAR=0x100, CHARLQUOTE, CHARRQUOTE, /*ENDCHARTAGS,*/ /*BEGINFONTTAGS,*/ @@ -113,11 +87,11 @@ /*ENDFONTTAGS*/ /*BEGINLAYOUTTAGS,*/ - ITAB, BEGINCENTER, ENDCENTER, + ITAB, BEGINCENTER, ENDCENTER, HR, /*ENDLAYOUTTAGS,*/ /*BEGINSTRUCTTAGS,*/ - BEGINDOC, ENDDOC, BEGINCOMMENT, ENDCOMMENT, COMMENTLINE, BEGINBODY, ENDBODY, + BEGINDOC, ENDDOC, BEGINCOMMENT, ENDCOMMENT, COMMENTLINE, BEGINBODY, ENDBODY, BEGINHEADER, ENDHEADER, BEGINFOOTER, ENDFOOTER, BEGINLINE, ENDLINE, SHORTLINE, BEGINSECTION, ENDSECTION, BEGINSUBSECTION, ENDSUBSECTION, BEGINSECTHEAD, ENDSECTHEAD, BEGINSUBSECTHEAD, ENDSUBSECTHEAD, @@ -143,14 +117,14 @@ enum command tagbeginend[][2] = { /* parallel to enum tagtype */ - { -1,-1 }, - { -1,-1 }, + { NOCOMMAND, NOCOMMAND }, + { NOCOMMAND, NOCOMMAND }, { BEGINITALICS, ENDITALICS }, { BEGINBOLD, ENDBOLD }, { BEGINY, ENDY }, { BEGINSC, ENDSC }, { BEGINBOLDITALICS, ENDBOLDITALICS }, - { -1,-1 }, + { NOCOMMAND, NOCOMMAND }, { BEGINMANREF, ENDMANREF } }; @@ -159,12 +133,9 @@ /*** globals ***/ -/* move all flags into an array? -enum { fSubsX, fLast }; -int flags[fLast]; -*/ int fSource=-1; /* -1 => not determined yet */ +int finlist=0; int fDiff=0; FILE *difffd; char diffline[MAXBUF]; @@ -195,7 +166,7 @@ char *lcexceptions[] = { /* new rule: double/all consonants == UC? */ /* articles, verbs, conjunctions, prepositions, pronouns */ - "a", "an", "the", + "a", "an", "the", "am", "are", "is", "were", "and", "or", "by", "for", "from", "in", "into", "it", "of", "on", "to", "with", @@ -203,33 +174,33 @@ /* terms */ "API", "CD", "GUI", "UI", /*I/O=>I/O already*/ "ID", "IDs", "OO", - "IOCTLS", "IPC", "RPC", + "IOCTLs", "IPC", "RPC", /* system names */ "AWK", "cvs", "rcs", "GL", "vi", "PGP", "QuickTime", "DDD", "XPG/3", - "NFS", "NIS", "NIS+", "AFS", - "UNIX", "SysV", + "NFS", "NIS", "NIS+", "AFS", + "UNIX", "SysV", "XFree86", "ICCCM", "MH", "MIME", "TeX", "LaTeX", "PicTeX", - "PostScript", "EPS", "EPSF", "EPSI", + "PostScript", "EPS", "EPSF", "EPSI", "HTML", "URL", "WWW", /* institution names */ "ANSI", "CERN", "GNU", "ISO", "NCSA", - /* Sun-specific */ + /* Sun-specific */ "MT-Level", "SPARC", NULL }; -/* what exceptions have you encountered? */ + int TabStops=8; int hanging=0; /* location of hanging indent (if ==0, none) */ -enum { NAME, SYNOPSIS, DESCRIPTION, SEEALSO, FILES, AUTHOR, RANDOM }; /* RANDOM last */ +enum { NAME, SYNOPSIS, DESCRIPTION, SEEALSO, FILES, AUTHOR, RANDOM/*last!*/ }; char *sectheadname[] = { - "NAME", "SYNOPSIS", "DESCRIPTION:INTRODUCTION", "SEE ALSO:RELATED INFORMATION", "FILES", "AUTHOR:AUTHORS", "RANDOM" + "NAME:NOMBRE", "SYNOPSIS", "DESCRIPTION:INTRODUCTION", "SEE ALSO:RELATED INFORMATION", "FILES", "AUTHOR:AUTHORS", "RANDOM" }; int sectheadid = RANDOM; int oldsectheadid = RANDOM; @@ -239,27 +210,26 @@ int fNORM=0; /* normalize? initial space => tabs, no changebars, exactly one blank line between sections */ const char TABLEOFCONTENTS[] = "Table of Contents"; const char HEADERANDFOOTER[] = "Header and Footer"; -char manName[80]="man page"; -char manSect[10]="1"; -const char provenance[] = +char manName[80] = "man page"; +char manSect[10] = "1"; +const char PROVENANCE[] = "manual page source format generated by PolyglotMan v" POLYGLOTMANVERSION; -const char anonftp[] = - "available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z"; +const char HOME[] = "available at http://polyglotman.sourceforge.net/"; const char horizontalrule[] = "------------------------------------------------------------"; -const int LINEBREAK=70; -int linelen=0; /* length of result in plain[] */ -int spcsqz; /* number of spaces squeezed out */ -int ccnt=0; /* # of changebars */ -int scnt,scnt2; /* counts of initial spaces in line */ -int s_sum,s_cnt; +const int LINEBREAK = 70; +int linelen = 0; /* length of result in plain[] */ +int spcsqz; /* number of spaces squeezed out */ +int ccnt = 0; /* # of changebars */ +int scnt, scnt2; /* counts of initial spaces in line */ +int s_sum, s_cnt; int bs_sum, bs_cnt; -int ncnt=0,oncnt=0; /* count of interline newlines */ +int ncnt=0, oncnt=0; /* count of interline newlines */ int CurLine=1; -int AbsLine=1-1; /* absolute line number */ -int indent=0; /* global indentation */ -int lindent=0; /* usual local indent */ -int auxindent=0; /* aux indent */ +int AbsLine=1-1; /* absolute line number */ +int indent=0; /* global indentation */ +int lindent=0; /* usual local indent */ +int auxindent=0; /* aux indent */ int I; /* index into line/paragraph */ int fcharout=1; /* show text or not */ char lookahead; @@ -267,13 +237,15 @@ char buf[MAXBUF]; char plain[MAXBUF]; /* current text line with control characters stripped out */ char hitxt[MAXBUF]; /* highlighted text (available at time of BEGIN signal */ -char header[MAXBUF]/*=""*/; /* complete line */ -char header2[MAXBUF]/*=""*/; /* SGIs have two lines of headers and footers */ -char header3[MAXBUF]/*=""*/; /* GNU and some others have a third! */ -char footer[MAXBUF]/*=""*/; -char footer2[MAXBUF]/*=""*/; + +char header[MAXBUF]; /* complete line */ +char header2[MAXBUF]; /* SGIs have two lines of headers and footers */ +char header3[MAXBUF]; /* GNU and some others have a third! */ +char footer[MAXBUF]; +char footer2[MAXBUF]; #define CRUFTS 5 char *cruft[CRUFTS] = { header, header2, header3, footer, footer2 }; + char *File, *in; /* File = pointer to full file contents, in = current file pointer */ char *argv0; int finTable=0; @@ -409,7 +381,7 @@ if (isspace(*p) || strchr("&/",*p)!=NULL) fuc=1; else if (fuc) { /* usually */ - if (p[1] && isupper(p[1]) /*&& p[2] && isupper(p[2])*/) fuc=0; + if (p[1] && isupper(p[1]) /*&& p[2] && isupper(p[2])*/) fuc=0; /* check for exceptions */ for (q=p; *q && !isspace(*q); q++) /*nada*/; tmpch = *q; *q='\0'; @@ -432,7 +404,7 @@ assert(type!=NOTAG); if (tagc0 && scnt>0 && scnt<=5) para[paracnt++] = CurLine; + if ((ncnt || lastsect) && linelen>0 && scnt>0 && scnt<=7/*used to be <=5 until groff spontaneously started putting in 7*/) para[paracnt++] = CurLine; lastsect=0; @@ -885,7 +855,7 @@ case ENDDOC: if (fHeadfoot) { printf("\n%s\n", HEADERANDFOOTER); - for (i=0; i\n"); - escchars = "{}\\"; - break; - case ENDDOC: printf("\n"); break; - - case BEGINCOMMENT: printf("\n\n"); break; - case COMMENTLINE: break; - - case BEGINBODY: - printf("{"); - break; - case ENDBODY: - CurLine++; - EnsembleDumpTags(); printf("}\n"); - tagc=0; - break; - case BEGINSECTION: printf("
"); break; - case ENDSECTION: printf("
\n"); break; - case BEGINSECTHEAD: printf("{"); break; - case ENDSECTHEAD: tagc=0; I=0; printf("}\n"); break; - case BEGINSUBSECTHEAD: printf("{"); break; - case ENDSUBSECTHEAD: tagc=0; I=0; printf("}\n"); break; - case BEGINBULPAIR: - printf(""); - break; - case ENDBULPAIR: - printf("\n"); - break; - case BEGINBULLET: printf("{"); break; - case ENDBULLET: tagc=0; I=0; printf("}"); break; - case BEGINBULTXT: printf("{"); break; - case ENDBULTXT: - EnsembleDumpTags(); - CurLine++; - printf("}"); - break; - case BEGINSUBSECTION: printf("\n"); break; - case ENDSUBSECTION: printf("\n"); break; - case SHORTLINE: /*poppush(prevcmd);*/ break; - - - case CHARRQUOTE: - case CHARLQUOTE: - putchar('"'); I++; - break; - case CHARLSQUOTE: - putchar('\''); - break; - case CHARRSQUOTE: - putchar('\''); - break; - case CHARPERIOD: - case CHARTAB: - case CHARDASH: - case CHARBACKSLASH: - case CHARLT: - case CHARGT: - case CHARHAT: - case CHARVBAR: - case CHARAMP: - case CHARBULLET: - case CHARDAGGER: - case CHARPLUSMINUS: - case CHARNBSP: - case CHARCENT: - case CHARSECT: - case CHARCOPYR: - case CHARNOT: - case CHARREGTM: - case CHARDEG: - case CHARACUTE: - case CHAR14: - case CHAR12: - case CHAR34: - case CHARMUL: - case CHARDIV: - putchar(cmd); I++; break; - - case ENDLINE: putchar(' '); I++; break; - case HR: /*printf("\n%s\n", horizontalrule);*/ break; - case CHANGEBAR: - /* maybe something later */ - case BEGINLINE: - case BEGINY: case ENDY: - case BEGINHEADER: case ENDHEADER: - case BEGINFOOTER: case ENDFOOTER: - case BEGINBOLD: case ENDBOLD: - case BEGINCODE: case ENDCODE: - case BEGINITALICS: case ENDITALICS: - case BEGINBOLDITALICS: case ENDBOLDITALICS: - case BEGINSC: case ENDSC: - case BEGINTABLE: case ENDTABLE: - case BEGINTABLELINE: case ENDTABLELINE: case BEGINTABLEENTRY: case ENDTABLEENTRY: - case BEGININDENT: case ENDINDENT: - case FONTSIZE: - - case BEGINMANREF: - case ENDMANREF: - /* easy strike for hypertext--want to dynamically generate, though */ - /* nothing */ - break; - default: - DefaultPara(cmd); - } -} -#endif - - /* * HTML @@ -1493,43 +1291,47 @@ /* always respond to these signals */ switch (cmd) { - case CHARNBSP: printf(" "); I++; break; - case CHARTAB: printf("    "); break; - /* old browsers--who uses these?--don't understand symbolic codes */ - /* - case CHARNBSP: printf(" "); I++; break; - case CHARLQUOTE: printf("«"); break; - case CHARRQUOTE: printf("»"); break; - case CHARTAB: printf("    "); break; - */ + case CHARNBSP: printf(" "); I++; break; + case CHARTAB: printf("    "); break; +#ifdef XFree86 + /* using named entities for ASCII quote characters is redundant */ case CHARLQUOTE: case CHARRQUOTE: case CHARLSQUOTE: case CHARRSQUOTE: + putchar(cmd); break; +#else + case CHARLQUOTE: printf("“"); break; + case CHARRQUOTE: printf("”"); break; + case CHARLSQUOTE: printf("‘"); break; + case CHARRSQUOTE: printf("’"); break; +#endif case CHARPERIOD: case CHARDASH: case CHARBACKSLASH: - case CHARVBAR: /*printf("¦"); -- broken bar no good */ + case CHARVBAR: /*printf("¦"); -- broken bar no good */ case CHARHAT: - putchar(cmd); break; - case CHARDAGGER: printf("*"); break; - case CHARBULLET: printf("·"/*"·"*//*§--middot hardly visible*/); break; - case CHARPLUSMINUS: printf("±"/*"±"*/); break; + putchar(cmd); + break; + case CHARDAGGER: printf("†"); break; + case CHARBULLET: if (I>0 || !finlist) printf("·"/*"·"*//*§--middot hardly visible*/); + break; + case CHARPLUSMINUS: printf("±"); break; case CHARGT: printf(">"); break; case CHARLT: printf("<"); break; - case CHARAMP: printf("&"); break; - case CHARCENT: printf("¢"); break; /* translate these to symbolic forms, sometime */ - case CHARSECT: printf("§"); break; - case CHARCOPYR: printf("©"); break; - case CHARNOT: printf("¬"); break; - case CHARREGTM: printf("®"); break; - case CHARDEG: printf("°"); break; - case CHARACUTE: printf("´"); break; - case CHAR14: printf("¼"); break; - case CHAR12: printf("½"); break; - case CHAR34: printf("¾"); break; - case CHARMUL: printf("×"); break; - case CHARDIV: printf("÷"); break; + case CHARAMP: printf("&"); break; + case CHARCENT: printf("¢"); break; + case CHARSECT: printf("§"); break; + case CHARCOPYR: printf("©"); break; + case CHARNOT: printf("¬"); break; + case CHARREGTM: printf("®"); break; + case CHARDEG: printf("°"); break; + case CHARACUTE: printf("´"); break; + case CHAR14: printf("¼"); break; + case CHAR12: printf("½"); break; + case CHAR34: printf("¾"); break; + case CHARMUL: printf("×"); break; + case CHARDIV: printf("÷"); break; default: break; } @@ -1537,23 +1339,23 @@ /* while in pre mode... */ if (pre) { switch (cmd) { - case ENDLINE: I=0; CurLine++; if (!fPara && scnt) printf("
"); printf("\n"); break; + case ENDLINE: I=0; CurLine++; if (!fPara && scnt) printf("
"); printf("\n"); break; case ENDTABLE: if (fSource) { - printf("\n"); + printf("\n"); } else { - printf("

\n"); pre=0; fQS=fIQS=fPara=1; + printf("
\n"); pre=0; fQS=fIQS=fPara=1; } break; - case ENDCODEBLOCK: printf(""); pre=0; break; + case ENDCODEBLOCK: printf(""); pre=0; break; case SHORTLINE: case ENDBODY: printf("\n"); break; - case BEGINBOLD: printf(""); break; - case ENDBOLD: printf(""); break; - case BEGINITALICS: printf(""); break; - case ENDITALICS: printf(""); break; + case BEGINBOLD: printf(""); break; + case ENDBOLD: printf(""); break; + case BEGINITALICS: printf(""); break; + case ENDITALICS: printf(""); break; default: /* nothing */ break; @@ -1565,49 +1367,49 @@ switch (cmd) { case BEGINDOC: /* escchars = ... => HTML doesn't backslash-quote metacharacters */ - printf("\n",provenance); - printf("\n\n",anonftp); - printf("\n\n"); -/* printf("\n");*/ + printf("\n", PROVENANCE); + printf("\n\n", HOME); + printf("\n\n"); +/* printf("\n");*/ /* better title possible? */ - printf(""); printf(manTitle, manName, manSect); printf("\n"); + printf(""); printf(manTitle, manName, manSect); printf("\n"); #ifdef XFree86 - printf("\n\n"); + printf("\n\n"); #else - printf("\n\n"); + printf("\n\n"); #endif - printf("%s

\n", TABLEOFCONTENTS); + printf("%s

\n", TABLEOFCONTENTS); I=0; break; case ENDDOC: /* header and footer wanted? */ - printf("

\n"); + printf("

\n"); if (fHeadfoot) { - printf("


%s

\n", HEADERANDFOOTER); - for (i=0; i\n",cruft[i]); + printf("

%s

\n", HEADERANDFOOTER); + for (i=0; i\n", cruft[i]); } if (!tocc) { - /*printf("\n

ERROR: Empty man page

\n");*/ + /*printf("\n

ERROR: Empty man page

\n");*/ } else { - printf("\n

\n"); - printf("%s

\n", TABLEOFCONTENTS); - printf("

    \n"); + printf("\n

    \n"); + printf("%s

    \n", TABLEOFCONTENTS); + printf("

      \n"); for (i=0, lasttoc=BEGINSECTION; i\n"); - else printf("
    \n"); + if (toc[i].type==BEGINSUBSECTION) printf("
      \n"); + else printf("
    \n"); } - printf("
  • %s
  • \n", i, i, toc[i].text); + printf("
  • %s
  • \n", i, i, toc[i].text); } - if (lasttoc==BEGINSUBSECTION) printf("
"); - printf("\n"); + if (lasttoc==BEGINSUBSECTION) printf(""); + printf("\n"); } - printf("\n"); + printf("\n\n"); break; case BEGINBODY: - printf("

\n"); + printf("

\n"); break; case ENDBODY: break; @@ -1616,17 +1418,17 @@ case COMMENTLINE: printf(" "); break; case BEGINSECTHEAD: - printf("\n

", tocc, tocc); + printf("\n

", tocc, tocc); break; case ENDSECTHEAD: - printf("

\n"); + printf("

\n"); /* useful extraction from FILES, ENVIRONMENT? */ break; case BEGINSUBSECTHEAD: - printf("\n

", tocc, tocc); + printf("\n

", tocc, tocc); break; case ENDSUBSECTHEAD: - printf("

\n"); + printf("

\n"); break; case BEGINSECTION: break; case ENDSECTION: @@ -1636,39 +1438,39 @@ case ENDSUBSECTION: break; case BEGINBULPAIR: - if (listtype==OL) printf("\n
    \n"); - else if (listtype==UL) printf("\n
      \n"); - else printf("\n
      \n"); + if (listtype==OL) printf("\n
        \n"); + else if (listtype==UL) printf("\n
          \n"); + else printf("\n
          \n"); break; case ENDBULPAIR: - if (listtype==OL) printf("\n
      \n"); - else if (listtype==UL) printf("\n
    \n"); - else printf("\n"); + if (listtype==OL) printf("\n
\n"); + else if (listtype==UL) printf("\n\n"); + else printf("\n"); break; case BEGINBULLET: if (listtype==OL || listtype==UL) fcharout=0; - else printf("\n
"); + else printf("\n
"); break; case ENDBULLET: if (listtype==OL || listtype==UL) fcharout=1; - else printf("
"); + else printf(""); break; case BEGINBULTXT: - if (listtype==OL || listtype==UL) printf("
  • "); - else printf("\n
    "); + if (listtype==OL || listtype==UL) printf("
  • "); + else printf("\n
    "); break; case ENDBULTXT: - if (listtype==OL || listtype==UL) printf("
  • "); - else printf("
    \n"); + if (listtype==OL || listtype==UL) printf("
  • "); + else printf("\n"); break; case BEGINLINE: - /* if (ncnt) printf("

    \n"); -- if haven't already generated structural tag */ - if (ncnt) printf("

    \n"); + /* if (ncnt) printf("

    \n"); -- if haven't already generated structural tag */ + if (ncnt) printf("\n

    "); /* trailing spaces already trimmed off, so look for eol now */ if (fCodeline) { - printf(""); + printf(""); for (i=0; i
    "); fCodeline=0; } - I=0; CurLine++; if (!fPara && scnt) printf("
    "); printf("\n"); + if (fCodeline) { printf("

    "); fCodeline=0; } + I=0; CurLine++; if (!fPara && scnt) printf("
    "); printf("\n"); break; case SHORTLINE: - if (fCodeline) { printf("
    "); fCodeline=0; } - if (!fIP) printf("
    \n"); + if (fCodeline) { printf(""); fCodeline=0; } + if (!fIP) printf("
    \n"); break; case BEGINTABLE: if (fSource) { - /*printf("

    \n");*/ - printf("
    \n"); + /*printf("
    \n");*/ + printf("
    \n"); } else { - printf("
    \n"); pre=1; fQS=fIQS=fPara=0;
    +		  printf("
    \n"); pre=1; fQS=fIQS=fPara=0;
     		}
     		break;
     	   case ENDTABLE:
     		if (fSource) {
    -		  printf("
    \n"); + printf("\n"); } else { - printf("
    \n"); pre=0; fQS=fIQS=fPara=1; + printf("
    \n"); pre=0; fQS=fIQS=fPara=1; } break; - case BEGINTABLELINE: printf(""); break; - case ENDTABLELINE: printf("\n"); break; + case BEGINTABLELINE: printf(""); break; + case ENDTABLELINE: printf("\n"); break; case BEGINTABLEENTRY: - printf("1) printf(" COLSPAN=%d", tblcellspan); - printf(">"); + if (tblcellspan>1) printf(" colspan=%d", tblcellspan); + printf("'>"); break; case ENDTABLEENTRY: - printf(""); + printf(""); break; /* something better with CSS */ @@ -1734,36 +1536,36 @@ case FONTSIZE: /* HTML font step sizes are bigger than troff's */ - if ((fontdelta+=intArg)!=0) printf("", (intArg>0)?'+':'-'); else printf("\n"); + if ((fontdelta+=intArg)!=0) printf("", (intArg>0)?'+':'-'); else printf("\n"); break; - case BEGINBOLD: printf(""); break; - case ENDBOLD: printf(""); break; - case BEGINITALICS: printf(""); break; - case ENDITALICS: printf(""); break; + case BEGINBOLD: printf(""); break; + case ENDBOLD: printf(""); break; + case BEGINITALICS: printf(""); break; + case ENDITALICS: printf(""); break; case BEGINBOLDITALICS: - case BEGINCODE: printf(""); break; + case BEGINCODE: printf(""); break; case ENDBOLDITALICS: - case ENDCODE: printf(""); break; - case BEGINCODEBLOCK: printf("
    "); pre=1; break;	/* wrong for two-column lists in kermit.1, pine.1, perl4.1 */
    -	   case ENDCODEBLOCK:	printf("
    "); pre=0; break; - case BEGINCENTER: printf("
    "); break; - case ENDCENTER: printf("
    "); break; + case ENDCODE: printf("
    "); break; + case BEGINCODEBLOCK: printf("
    "); pre=1; break;	/* wrong for two-column lists in kermit.1, pine.1, perl4.1 */
    +	   case ENDCODEBLOCK:	printf("
    "); pre=0; break; + case BEGINCENTER: printf("
    "); break; + case ENDCENTER: printf("
    "); break; case BEGINMANREF: manrefextract(hitxt); - if (fmanRef) { printf(""); } - else printf(""); + if (fmanRef) { printf(""); } + else printf(""); break; case ENDMANREF: - if (fmanRef) printf("\n"); else printf(""); + if (fmanRef) printf("\n"); else printf(""); break; - case HR: printf("\n
    \n"); break; + case HR: printf("\n
    \n"); break; /* U (was B, I), strike -- all temporary until HTML 4.0's INS and DEL widespread */ - case BEGINDIFFA: printf(""); break; - case ENDDIFFA: printf(""); break; - case BEGINDIFFD: printf(""); break; - case ENDDIFFD: printf(""); break; + case BEGINDIFFA: printf(""); break; + case ENDDIFFA: printf(""); break; + case BEGINDIFFD: printf(""); break; + case ENDDIFFD: printf(""); break; case BEGINSC: case ENDSC: case BEGINY: case ENDY: @@ -1780,73 +1582,67 @@ /* - * SGML + * DocBook XML + * improvements by Aaron Hawley applied 2003 June 5 + * + * N.B. The framework for XML is in place but not done. If you + * are familiar with the DocBook DTD, however, it shouldn't be + * too difficult to finish it. If you do so, please send your + * code to me so that I may share the wealth in the next release. */ -/* same as HTML but just has man page-specific DTD */ -/* follows the Davenport DocBook DTD v2.3, availble from ftp.ora.com */ - -/*char *docbookpath = "docbook.dtd";*/ +const char *DOCBOOKPATH = "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"; static void -SGML(enum command cmd) +XML(enum command cmd) { static int pre=0; int i; char *p; static int fRefEntry=0; static int fRefPurpose=0; - /*static char *bads => SGML doesn't backslash-quote metacharacters */ + /*static char *bads => XML doesn't backslash-quote metacharacters */ /* - fprintf(stderr, - "The framework for SGML is in place but not done. If you\n" - "are familiar with the DocBook DTD, however, it shouldn't be\n" - "too difficult to finish it. If you do so, please send your\n" - "code to me so that I may share the wealth in the next release.\n" - ); - exit(1); */ /* always respond to these signals */ switch (cmd) { - case CHARLQUOTE: - case CHARRQUOTE: - printf("""); + case CHARLQUOTE: case CHARRQUOTE: printf("""); break; + case CHARBULLET: printf("•"); break; + case CHARDAGGER: printf("†"); break; + case CHARPLUSMINUS: printf("±"); break; + case CHARCOPYR: printf("©"); break; + case CHARNOT: printf("¬"); break; + case CHARMUL: printf("×"); break; + case CHARDIV: printf("÷"); break; + case CHARAMP: printf("&"); break; + case CHARDASH: + if (sectheadid==NAME && !fRefPurpose) { + printf(""); + fRefPurpose=1; + } else putchar('-'); break; + case CHARBACKSLASH: putchar('\\'); break; + case CHARGT: printf(">"); break; + case CHARLT: printf("<"); break; case CHARLSQUOTE: case CHARRSQUOTE: case CHARPERIOD: case CHARTAB: case CHARHAT: case CHARVBAR: - case CHARBULLET: - case CHARDAGGER: - case CHARPLUSMINUS: case CHARNBSP: case CHARCENT: case CHARSECT: - case CHARCOPYR: - case CHARNOT: case CHARREGTM: case CHARDEG: case CHARACUTE: case CHAR14: case CHAR12: case CHAR34: - case CHARMUL: - case CHARDIV: - putchar(cmd); break; - case CHARAMP: printf("&"); break; - case CHARDASH: - if (sectheadid==NAME && !fRefPurpose) { - printf(""); - fRefPurpose=1; - } else putchar('-'); - break; - case CHARBACKSLASH: putchar('\\'); break; - case CHARGT: printf(">"); break; - case CHARLT: printf("<"); break; + putchar(cmd); + break; default: break; } @@ -1854,13 +1650,10 @@ /* while in pre mode... */ if (pre) { switch (cmd) { - case ENDLINE: I=0; CurLine++; if (!fPara && scnt) printf("
    "); printf("\n"); break; + case ENDLINE: I=0; CurLine++; if (!fPara && scnt) putchar(' '); break; case ENDTABLE: - if (fSource) { - printf("\n"); - } else { - printf("
    \n"); pre=0; fQS=fIQS=fPara=1; - } + if (fSource) printf("\n"); + else { printf("\n"); pre=0; fQS=fIQS=fPara=1; } break; default: /* nothing */ @@ -1872,15 +1665,18 @@ /* usual operation */ switch (cmd) { case BEGINDOC: - /*printf("\n", docbookpath);*/ - printf("\n"); + printf("\n\n", DOCBOOKPATH); + + printf("\n"); - printf("\n\n",anonftp); + printf("\n\n",HOME); /* better title possible? */ - printf("\n", manName, manSect); - printf("%s", manName); - printf("%s\n\n", manSect); + for (p=manName; *p; p++) *p = tolower(*p); + printf("\n", manName, manSect); + printf("\n%s\n", manName); + printf("%s\n\n\n", manSect); I=0; break; @@ -1888,17 +1684,23 @@ case ENDDOC: /* header and footer wanted? */ if (fHeadfoot) { - printf("%s\n", HEADERANDFOOTER); - for (i=0; i%s\n",cruft[i]); - printf(""); + printf("\n\n%s\n", HEADERANDFOOTER); + for (i=0; i%s\n", cruft[i]); + printf("\n"); } - /* table of contents, such as found in HTML, can be generated automatically by SGML software */ + /* table of contents, such as found in HTML, can be generated automatically by XML software */ - printf("\n"); + printf("\n"); break; - case BEGINBODY: printf("\n\n"); break; - case ENDBODY: break; + case BEGINBODY: + if (fPara) printf("\n"); + printf(""); fPara = 1; + break; + case ENDBODY: + if (fRefPurpose) { printf("
    "); fRefPurpose=0; } + else { printf("\n"); fPara=0; } + break; case BEGINCOMMENT: printf("\n\n"); break; @@ -1906,35 +1708,42 @@ case BEGINSECTHEAD: case BEGINSUBSECTHEAD: - printf(""); + if (sectheadid != NAME && sectheadid != SYNOPSIS) printf("<title>"); break; case ENDSECTHEAD: case ENDSUBSECTHEAD: - printf(""); + if (sectheadid == NAME) printf(""); + else if (sectheadid == SYNOPSIS) {} + else { printf("\n"); fPara=1; } break; case BEGINSECTION: - if (sectheadid==NAME) printf(""); + if (sectheadid==NAME) printf("\n"); /*printf(""); -- do lotsa parsing here for RefName, RefPurpose*/ - else if (sectheadid==SYNOPSIS) printf(""); - else printf(""); + else if (sectheadid==SYNOPSIS) printf("\n\n"); + else printf("\n\n"); break; case ENDSECTION: - if (oldsectheadid==NAME) printf("\n\n"); - else if (oldsectheadid==SYNOPSIS) printf("\n\n"); - else printf("\n\n"); + if (sectheadid==NAME) { + if (fRefPurpose) { printf("
    "); fRefPurpose=0; } + printf("\n\n\n"); + } else if (sectheadid==SYNOPSIS) printf("\n\n\n"); + else { + if (fPara) { printf("\n"); fPara=0; } + printf("\n\n"); + } break; - case BEGINSUBSECTION: printf(""); break; - case ENDSUBSECTION: printf(""); break; + case BEGINSUBSECTION: printf("\n"); break; + case ENDSUBSECTION: printf("\n"); break; /* need to update this for enumerated and plain lists */ - case BEGINBULPAIR: printf("\n"); break; - case ENDBULPAIR: printf("\n"); break; - case BEGINBULLET: printf(""); break; - case ENDBULLET: printf(""); break; - case BEGINBULTXT: printf(""); break; - case ENDBULTXT: printf("\n"); break; + case BEGINBULPAIR: printf("\n"); break; + case ENDBULPAIR: printf("\n"); break; + case BEGINBULLET: printf(""); break; + case ENDBULLET: printf("\n"); break; + case BEGINBULTXT: printf("\n"); break; + case ENDBULTXT: printf("\n\n"); break; case BEGINLINE: /* remember, get BEGINBODY call at start of paragraph */ @@ -1950,63 +1759,48 @@ case ENDLINE: /*if (fCodeline) { fIQS=1; fCodeline=0; }*/ - if (fCodeline) { printf("
    "); fCodeline=0; } - I=0; CurLine++; if (!fPara && scnt) printf("
    "); printf("\n"); + if (fCodeline) { printf(""); fCodeline=0; } /* */ + I=0; CurLine++; if (!fPara && scnt) printf(""); else putchar(' '); break; case SHORTLINE: - if (fCodeline) { printf(""); fCodeline=0; } - if (!fIP) printf("
    \n"); + if (fCodeline) { printf(""); fCodeline=0; } + if (!fIP && !fPara) printf("\n"); break; case BEGINTABLE: - if (fSource) { - printf("\n"); - } else { - printf("
    \n"); pre=1; fQS=fIQS=fPara=0;
    -		}
    +		if (fSource) printf("
    \n"); + else { printf("\n"); pre=1; fQS=fIQS=fPara=0; } break; case ENDTABLE: - if (fSource) { - printf("
    \n"); - } else { - printf("
    \n"); pre=0; fQS=fIQS=fPara=1; - } + if (fSource) printf("\n"); + else { printf("\n"); pre=0; fQS=fIQS=fPara=1; } break; - case BEGINTABLELINE: printf(""); break; - case ENDTABLELINE: printf("\n"); break; - case BEGINTABLEENTRY: printf(""); break; - case ENDTABLEENTRY: printf(""); break; + case BEGINTABLELINE: printf(""); break; + case ENDTABLELINE: printf("\n"); break; + case BEGINTABLEENTRY: printf(""); break; + case ENDTABLEENTRY: printf(""); break; case BEGININDENT: case ENDINDENT: case FONTSIZE: break; /* have to make some guess about bold and italics */ - case BEGINBOLD: printf(""); break; - case ENDBOLD: printf(""); break; - case BEGINITALICS: printf(""); break; - case ENDITALICS: printf(""); break; - case BEGINBOLDITALICS: - case BEGINCODE: printf(""); break; - case ENDBOLDITALICS: - case ENDCODE: printf(""); break; + case BEGINBOLD: printf(""); break; + case ENDBOLD: printf(""); break; + case BEGINITALICS: printf(""); break; /* could be literal or arg */ + case ENDITALICS: printf(""); break; + case BEGINBOLDITALICS: case BEGINCODE: printf(""); break; + case ENDBOLDITALICS: case ENDCODE: printf(""); break; case BEGINMANREF: -/* manrefextract(hitxt); - if (fmanRef) { printf("\n"); } - else printf(""); - break; -*/ - printf(""); + if (fmanRef) { printf(""); } break; case ENDMANREF: -/* if (fmanRef) printf(""); else printf("");*/ - printf(""); + if (fmanRef) printf(""); break; - case HR: /*printf("\n
    \n", horizontalrule);*/ break; - + case HR: case BEGINSC: case ENDSC: case BEGINY: case ENDY: case BEGINHEADER: case ENDHEADER: @@ -2019,282 +1813,6 @@ } } -#if 0 -/* - * GNU Texinfo -- somebody should finish this up - */ - -static void -Texinfo(enum command cmd) -{ - static int pre=0; - int i; - - /* always respond to these signals */ - switch (cmd) { - case CHARNBSP: printf(" "); I++; break; - case CHARLQUOTE: printf("«"); break; - case CHARRQUOTE: printf("»"); break; - case CHARTAB: printf("    "); break; - /* old browsers--who uses these?--don't understand symbolic codes */ - /* - case CHARNBSP: printf(" "); I++; break; - case CHARLQUOTE: printf("«"); break; - case CHARRQUOTE: printf("»"); break; - case CHARTAB: printf("    "); break; - */ - case CHARLSQUOTE: - case CHARRSQUOTE: - case CHARPERIOD: - case CHARDASH: - case CHARBACKSLASH: - case CHARVBAR: /*printf("¦"); -- broken bar no good */ - case CHARHAT: - putchar(cmd); break; - case CHARDAGGER: printf("*"); break; - case CHARBULLET: printf("·"/*"·"*//*§--middot hardly visible*/); break; - case CHARPLUSMINUS: printf("±"/*"±"*/); break; - case CHARGT: printf(">"); break; - case CHARLT: printf("<"); break; - case CHARAMP: printf("&"); break; - case CHARCENT: printf("¢"); break; /* translate these to symbolic forms, sometime */ - case CHARSECT: printf("§"); break; - case CHARCOPYR: printf("©"); break; - case CHARNOT: printf("¬"); break; - case CHARREGTM: printf("®"); break; - case CHARDEG: printf("°"); break; - case CHARACUTE: printf("´"); break; - case CHAR14: printf("¼"); break; - case CHAR12: printf("½"); break; - case CHAR34: printf("¾"); break; - case CHARMUL: printf("×"); break; - case CHARDIV: printf("÷"); break; - default: - break; - } - - /* while in pre mode... */ - if (pre) { - switch (cmd) { - case ENDLINE: I=0; CurLine++; if (!fPara && scnt) printf("
    "); printf("\n"); break; - case ENDTABLE: - if (fSource) { - printf("\n"); - } else { - printf("
    \n"); pre=0; fQS=fIQS=fPara=1; - } - break; - default: - /* nothing */ - break; - } - return; - } - - /* usual operation */ - switch (cmd) { - case BEGINDOC: - /* escchars = ... => HTML doesn't backslash-quote metacharacters */ - printf("\n",provenance); - printf("\n\n",anonftp); - printf("\n\n"); -/* printf("\n");*/ - /* better title possible? */ - printf(""); printf(manTitle, manName, manSect); printf("\n"); - printf("\n\n"); - printf("%s

    \n", TABLEOFCONTENTS); - I=0; - break; - case ENDDOC: - /* header and footer wanted? */ - printf("

    \n"); - if (fHeadfoot) { - printf("


    %s

    \n", HEADERANDFOOTER); - for (i=0; i\n",cruft[i]); - } - - if (!tocc) { - /*printf("\n

    ERROR: Empty man page

    \n");*/ - } else { - printf("\n

    \n"); - printf("%s

    \n", TABLEOFCONTENTS); - printf("

      \n"); - for (i=0, lasttoc=BEGINSECTION; i\n"); - else printf("
    \n"); - } - printf("
  • %s
  • \n", i, i, toc[i].text); - } - if (lasttoc==BEGINSUBSECTION) printf(""); - printf("\n"); - } - printf("\n"); - break; - case BEGINBODY: - printf("

    \n"); - break; - case ENDBODY: break; - - case BEGINCOMMENT: - case ENDCOMMENT: - break; - case COMMENTLINE: printf("@c "); break; - - case BEGINSECTHEAD: - break; - case ENDSECTHEAD: - printf("\n@node %s\n", toc[tocc].text); - printf("\n@section %s\n\n", toc[tocc].text); - /* useful extraction from FILES, ENVIRONMENT? */ - break; - case BEGINSUBSECTHEAD: - break; - case ENDSUBSECTHEAD: - printf("\n@node %s\n", toc[tocc].text); - printf("\n@subsection %s\n\n", toc[tocc].text); - break; - case BEGINSECTION: break; - case ENDSECTION: break; - case BEGINSUBSECTION: break; - case ENDSUBSECTION: break; - - case BEGINBULPAIR: - if (listtype==OL) printf("\n

      \n"); - else if (listtype==UL) printf("\n
        \n"); - else printf("\n
        \n"); - break; - case ENDBULPAIR: - if (listtype==OL) printf("\n
    \n"); - else if (listtype==UL) printf("\n\n"); - else printf("\n"); - break; - case BEGINBULLET: - if (listtype==OL || listtype==UL) fcharout=0; - else printf("\n
    "); - break; - case ENDBULLET: - if (listtype==OL || listtype==UL) fcharout=1; - else printf("
    "); - break; - case BEGINBULTXT: - if (listtype==OL || listtype==UL) printf("
  • "); - else printf("\n
    "); - break; - case ENDBULTXT: - if (listtype==OL || listtype==UL) printf("
  • "); - else printf("\n"); - break; - - case BEGINLINE: - /* if (ncnt) printf("

    \n");*/ - - /* trailing spaces already trimmed off, so look for eol now */ - if (fCodeline) { - printf(""); - for (i=0; i
    "); fCodeline=0; } - I=0; CurLine++; if (!fPara && scnt) printf("
    "); printf("\n"); - break; - - case SHORTLINE: - if (fCodeline) { printf("
    "); fCodeline=0; } - if (!fIP) printf("
    \n"); - break; - - - case BEGINTABLE: - if (fSource) { - /*printf("

    \n");*/ - printf("
    \n"); - } else { - printf("
    \n"); pre=1; fQS=fIQS=fPara=0;
    -		}
    -		break;
    -	   case ENDTABLE:
    -		if (fSource) {
    -		  printf("
    \n"); - } else { - printf("
    \n"); pre=0; fQS=fIQS=fPara=1; - } - break; - case BEGINTABLELINE: printf(""); break; - case ENDTABLELINE: printf("\n"); break; - case BEGINTABLEENTRY: - printf("1) printf(" COLSPAN=%d", tblcellspan); - printf(">"); - break; - case ENDTABLEENTRY: - printf(""); - break; - - /* something better with CSS */ - case BEGININDENT: printf("
    "); break; - case ENDINDENT: printf("
    \n"); break; - - case FONTSIZE: - /* HTML font step sizes are bigger than troff's */ - if ((fontdelta+=intArg)!=0) printf("", (intArg>0)?'+':'-'); else printf("\n"); - break; - - case BEGINBOLD: printf("@b{"); break; /* } */ - case BEGINITALICS: printf("@i{"); break; - case BEGINSC: printf("@sc{"); break; /* } */ - case ENDITALICS: - case ENDBOLD: - case ENDSC: /* { */ - printf("}"); - break; - case BEGINBOLDITALICS: - case BEGINCODE: printf(""); break; - case ENDBOLDITALICS: - case ENDCODE: printf(""); break; - case BEGINMANREF: - manrefextract(hitxt); - if (fmanRef) { printf("@xref{}"); } -/*"); }*/ - else printf(""); - break; - case ENDMANREF: - if (fmanRef) printf("\n"); else printf(""); - break; - case HR: printf("\n
    \n"); break; - - case BEGINY: case ENDY: - case BEGINHEADER: case ENDHEADER: - case BEGINFOOTER: case ENDFOOTER: - case CHANGEBAR: - /* nothing */ - break; - default: - DefaultPara(cmd); - } -} -#endif - /* generates MIME compliant to RFC 1563 */ @@ -2372,12 +1890,12 @@ if (fHeadfoot) { printf("\n"); MIME(BEGINSECTHEAD); printf("%s",HEADERANDFOOTER); MIME(ENDSECTHEAD); - for (i=0; i\n"); - printf("%s\n%s\n", provenance, anonftp); + printf("%s\n%s\n", PROVENANCE, HOME); printf("\n\n"); */ @@ -2507,8 +2025,8 @@ switch (cmd) { case BEGINDOC: escchars = "$&%#_{}"; /* and more to come? */ - printf("%% %s,\n", provenance); - printf("%% %s\n\n", anonftp); + printf("%% %s,\n", PROVENANCE); + printf("%% %s\n\n", HOME); /* definitions */ printf( "\\documentstyle{article}\n" @@ -2638,8 +2156,8 @@ /* replace selected commands ... */ case BEGINDOC: escchars = "$&%#_{}"; - printf("%% %s,\n", provenance); - printf("%% %s\n\n", anonftp); + printf("%% %s,\n", PROVENANCE); + printf("%% %s\n\n", HOME); /* definitions */ printf( "\\documentclass{article}\n" @@ -2703,7 +2221,7 @@ break; case ENDDOC: /* header and footer wanted? */ - printf("\\par{\\f150 %s,\n%s}", provenance, anonftp); + printf("\\par{\\f150 %s,\n%s}", PROVENANCE, HOME); printf("}\n"); break; case BEGINBODY: @@ -3010,11 +2528,6 @@ /*** Kong ***/ -/* - I hope the compiler has good common subexpression elimination - for all the pointer arithmetic. -*/ - char phrase[MAXBUF]; /* first "phrase" (space of >=3 spaces) */ int phraselen; @@ -3033,6 +2546,7 @@ int etype; int efirst; enum tagtype tag = NOTAG; + int esccode; assert(buf!=NULL && plain!=NULL); @@ -3159,25 +2673,33 @@ } else if (*p=='\b') { /* supress unattended backspaces */ continue; - } else if (*p=='\x1b' /*&& (p[1]=='9'||p[1]=='8')*/) { + } else if (*p=='\x1b') { p++; - if (*p=='[') { - p++; - if (*p=='1' && hl==-1) { - /* stash attributes in "invalid" array element */ - efirst=I+iq; etype=BOLD; - /*hl=I+iq; tag=BOLD; -- faces immediate end of range */ - } else if (*p=='0' /*&& hl>=0 && hl2==-1 && tags[MAXTAGS].first=0 /*&& (esccode==0 || esccode==1 || esccode==4 || esccode==22 || esccode==24) **&& hl>=0 && hl2==-1 && tags[MAXTAGS].first=0 || isupper(p[1]) || (p[1]=='_' && p[2]!='\b') || p[1]=='&')) { if (hl==-1 && efirst==-1) { hl=I+iq; tag=SMALLCAPS; } @@ -3215,7 +2737,7 @@ /* else ref to a function? */ /* maybe save position of opening paren so don't highlight it later */ } else if (*p==')' && hl2!=-1) { - /* don't overlap tags on man page referenes */ + /* don't overlap tags on man page references */ while (tagc>0 && tags[tagc-1].last>hl2) tagc--; tagadd(MANREF, hl2, I+iq+1); hl2=hl=-1; @@ -3281,9 +2803,6 @@ linelen = length result in plain[] */ -/*#define MAXINDENT 15*/ -/*#define HEADFOOTMATCH 20*/ - int fHead=0; int fFoot=0; @@ -3305,7 +2824,7 @@ int sect=0,subsect=0,bulpair=0,osubsect=0; int title=1; int oscnt=-1; - int empty=0,oempty; + int empty=0; int fcont=0; int Pnew=0,I0; float s_avg=0.0; @@ -3397,13 +2916,13 @@ /* if (indent==-1) continue;*/ } if (!lindent && scnt) lindent=scnt; -/*printf("lindent = %d, scnt=%d\n",lindent,scnt);*/ +/*printf("lindent = %d, scnt=%d\n", lindent,scnt);*/ /**** for each ordinary line... *****/ /*** skip over global indentation */ - oempty=empty; empty=(linelen==0); + empty=(linelen==0); if (empty) {ncnt++; continue;} /*** strip out per-page titles ***/ @@ -3501,7 +3020,7 @@ /* decode the below */ bulpair = ((!auxindent || scnt!=lindent+auxindent) /*!bulpair*/ && ((scnt>=2 && scnt2>5) || scnt>=5 || (tagc>0 && tags[0].first==scnt) ) /* scnt>=2?? */ - && (((*p==c_bullet || strchr("-+.",*p)!=NULL || falluc) && (ncnt || scnt2>4)) || + && (((*p==c_bullet || strchr("-+.",*p)!=NULL || falluc) && (ncnt || scnt2>4)) || (scnt2-s_avg>=2 && phrase[phraselen-1]!='.') || (scnt2>3 && s_cnt==1) )); @@ -3521,7 +3040,7 @@ } else hanging=0; /* hanging = bulpair? phraselen+scnt2 : 0;*/ -/*if (bulpair) printf("hanging = %d\n",hanging);*/ +/*if (bulpair) printf("hanging = %d\n", hanging);*/ /* maybe, bulpair=0 would be best */ /*end fMan}*/ @@ -3608,7 +3127,7 @@ if (strchr(escchars,c)!=NULL) { putchar('\\'); putchar(c); I++; } else if (strchr((char *)trouble,c)!=NULL) { - (*fn)(c); fcont=1; + (*fn)((enum command)c); fcont=1; } else { putchar(c); I++; } @@ -3672,14 +3191,6 @@ * * Macros derived empirically, except for weird register ones that were looked up in groff * - * to do - * X fix up output modules to be aware of Source: they need to do own formatting (Tk, ASCII, ...) - * X profile if's and reorder, or centralized id (fast enough already?), - * X how to format tables for Tk? - * + coalese lists, distinguish DL vs OL vs UL, - * + recognize more table ops (differences across flavors) - * make lines with tabs into tables (tabs make no sense to HTML) - * * buffer usage * buf = incoming text from man page file * plain = "second pass" buffer used to identify man page references @@ -3772,7 +3283,7 @@ { "ul", "_" } }; #define speccnt (sizeof spec / sizeof spec[0]) - + /* tbl line descriptions */ char *tbl[20][20]; /* space enough for twenty description lines, twenty parts each */ int tblc=0; @@ -3781,7 +3292,6 @@ int fsourceTab = 0, fosourceTab=0; int supresseol=0; int finitDoc=0; -int finlist=0; int sublevel=0; static char * @@ -3911,6 +3421,8 @@ /* add MANREF tags */ strcpy(hitxt,r); tagadd(BEGINMANREF, posn, 0); + /* already generated other start tags, so move BEGINMANREF to start in order to be well nested (ugh) */ + tagtmp = tags[tagc-1]; for (j=tagc-1; j>0; j--) tags[j]=tags[j-1]; tags[0]=tagtmp; tagadd(ENDMANREF, sI-manoff-1+1, 0); } } @@ -3918,7 +3430,7 @@ /* HTML hyperlinks */ } else if (fURL && sI>=4 && (p=strstr(plain,"http"))!=NULL) { i = p-plain; - tagadd(BEGINMANREF, i, 0); + tagadd(BEGINMANREF, i, 0); tagtmp = tags[tagc-1]; for (j=tagc-1; j>0; j--) tags[j]=tags[j-1]; tags[0]=tagtmp; for (j=0; i=LINEBREAK && c==' ') { (*fn)(ENDLINE); linelen=0; } else { /* normal character */ xputchar(c); @@ -3951,7 +3463,7 @@ } /* dump tags at end */ /*for ( ; j=0; style--) { - if (styles[style]==BOLD) { - stagadd(ENDBOLD); - } else if (styles[style]==ITALICS) { - stagadd(ENDITALICS); - } else { - stagadd(ENDBOLDITALICS); - } + if (styles[style]==BOLD) stagadd(ENDBOLD); + else if (styles[style]==ITALICS) stagadd(ENDITALICS); + else stagadd(ENDBOLDITALICS); } /* else error */ assert(style==-1); @@ -4133,7 +3643,7 @@ /* postpone check until after following character so catch closing tags */ if ((sI>=4+1 && plain[sI-1-1]==')') || /* (plain[sI-1]==' ' && (q=strchr(plain,' '))!=NULL && q<&plain[sI-1])) */ - (plain[sI-1]==' ' && !isalnum(plain[sI-1-1]))) { + (sI>=2 && plain[sI-1]==' ' && !isalnum(plain[sI-1-1]))) { /* regardless, flush buffer */ source_flush(); } @@ -4219,9 +3729,9 @@ /* try to determine type of list: DL, OL, UL */ q=plain; plain[sI]='\0'; - if (((int)*q&0xff)==CHARBULLET /*||*/) { + if (/*c==CHARBULLET || q=='-' -- command line opts! ||*/ *q=='.' || *q&0x80) { listtype=UL; - q+=4; + q++; } else { if (strchr("[(",*q)) q++; while (isdigit(*q)) { listtype=OL; q++; } /* I hope this gives the right number */ @@ -4298,18 +3808,16 @@ if (!finitDoc) { while (isspace(*p)) p++; if (*p) { - q=strchr(p, ' '); - if (q!=NULL) - { - *q++='\0'; - strcpy(manName, p); - for (p=q; isspace(*p); p++) /*nada*/; - if (*p) { - q=strchr(p,' '); - if (q!=NULL) *q++='\0'; - strcpy(manSect, p); - } + /* name */ + q=strchr(p, ' '); if (q!=NULL) *q++='\0'; + strcpy(manName, p); + /* number */ + p = q; + if (p!=NULL) { + while (isspace(*p)) p++; + if (*p) { q=strchr(p,' '); if (q!=NULL) *q++='\0'; } } + strcpy(manSect, p!=NULL? p: "?"); } sI=0; finitDoc=1; @@ -4394,7 +3902,7 @@ #endif } else if (checkcmd("nf")) { - source_struct(SHORTLINE); + source_struct(SHORTLINE); finnf=1; source_struct(BEGINCODEBLOCK); } else if (checkcmd("fi")) { @@ -4798,7 +4306,7 @@ source_struct(BEGINBODY); for (i=0; i<3; i++) { if (fcharout) { source_out(tcltkOP[i]); source_out(": "); } - stagadd(BEGINBOLD); p=source_out_word(p); stagadd(ENDBOLD); + stagadd(BEGINBOLD); p=source_out_word(p); stagadd(ENDBOLD); source_struct(SHORTLINE); } source_struct(BEGINBODY); @@ -5038,7 +4546,7 @@ insertcnt0=insertcnt+1; /* eat duplicate insert lines and '---' too */ diffline2[0] = '\0'; while (insertcnt && deletecnt) { - if (ungetc(fgetc(difffd),difffd)=='<') { fgetc(difffd); fgetc(difffd); } /* skip '<' */ + if (ungetc(fgetc(difffd),difffd)=='<') { fgetc(difffd); fgetc(difffd); } /* skip '<' */ /* fill buffer with old line -- but replace if command */ /* stay away from commands -- too careful if .B */ do { @@ -5168,14 +4676,12 @@ { Sections, 0, 0, 0, 0, 0, 0, "sections" }, { Roff, 0, 1, 1, 1, -1, 0, "roff:troff:nroff" }, { HTML, 1, 1, 1, 1, 1, 1, "HTML:WWW:htm" }, - { SGML, 1, 1, 1, 1, 1, 1, "SGML:XML" }, -/* { Texinfo, 1, 1, 1, 1, 1, 1, "Texinfo:info:GNU" },*/ + { XML, 1, 1, 1, 1, 1, 1, "XML:docbook:DocBook" }, { MIME, 1, 1, 1, 1, 1, 0, "MIME:Emacs:enriched" }, { LaTeX, 1, 1, 1, 1, 1, 0, "LaTeX:LaTeX209:209:TeX" }, { LaTeX2e, 1, 1, 1, 1, 1, 0, "LaTeX2e:2e" }, { RTF, 1, 1, 1, 1, 1, 0, "RTF" }, { pod, 0, 0, 1, 0, -1, 0, "pod:Perl" }, - /*{ Ensemble, 1, 1, 1, 1, 1, 0, "Ensemble" },*/ { PostScript, 0, 0, 0, 0, 0, 0, "PostScript:ps" }, { FrameMaker, 0, 0, 0, 0, 0, 0, "FrameMaker:Frame:Maker:MIF" }, @@ -5232,14 +4738,12 @@ int helplen=0; int desclen; char **argvch; /* remapped argv */ - char *argvbuf; - char *processing = "stdin"; /* FILE *macros; -- interpret -man macros? */ char strgetopt[80]; /* options with an arg must have a '<' in the description */ static struct { char letter; int arg; char *longnames; char *desc; } option[] = { - { 'f', 1, "filter", " " }, + { 'f', 1, "filter", " " }, { 'S', 0, "source", "(ource of man page passed in)" }, /* autodetected */ { 'F', 0, "formatted:format", "(ormatted man page passed in)" }, /* autodetected */ @@ -5293,11 +4797,6 @@ assert(strchr(strgetopt,'v')!=NULL); assert(strchr(strgetopt,':')!=NULL); -#ifdef macintosh - extern void InitToolbox(); - InitToolbox(); -#endif - /* count, sort exception strings */ for (lcexceptionslen=0; (p=lcexceptions[lcexceptionslen])!=NULL; lcexceptionslen++) /*empty*/; qsort(lcexceptions, lcexceptionslen, sizeof(char*), lcexceptionscmp); @@ -5306,7 +4805,7 @@ /* (GNU probably has a reusable function to do this...) */ /* deep six getopt in favor of integrated long names + letters? */ argvch = malloc(argc * sizeof(char*)); - p = argvbuf = malloc(argc*3 * sizeof(char)); /* either -'\0' or no space used */ + p = malloc(argc*3 * sizeof(char)); /* either -'\0' or no space used */ for (i=0; i 8 to avoid a bug in the encoder for a window size + of 256 bytes. (A complete fix will be available in 1.1.5). + +Changes in 1.1.3 (9 July 1998) +- fix "an inflate input buffer bug that shows up on rare but persistent + occasions" (Mark) +- fix gzread and gztell for concatenated .gz files (Didier Le Botlan) +- fix gzseek(..., SEEK_SET) in write mode +- fix crc check after a gzeek (Frank Faubert) +- fix miniunzip when the last entry in a zip file is itself a zip file + (J Lillge) +- add contrib/asm586 and contrib/asm686 (Brian Raiter) + See http://www.muppetlabs.com/~breadbox/software/assembly.html +- add support for Delphi 3 in contrib/delphi (Bob Dellaca) +- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti) +- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren) +- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks) +- added a FAQ file + +- Support gzdopen on Mac with Metrowerks (Jason Linhart) +- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart) +- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young) +- avoid some warnings with Borland C (Tom Tanner) +- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant) +- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant) +- allow several arguments to configure (Tim Mooney, Frodo Looijaard) +- use libdir and includedir in Makefile.in (Tim Mooney) +- support shared libraries on OSF1 V4 (Tim Mooney) +- remove so_locations in "make clean" (Tim Mooney) +- fix maketree.c compilation error (Glenn, Mark) +- Python interface to zlib now in Python 1.5 (Jeremy Hylton) +- new Makefile.riscos (Rich Walker) +- initialize static descriptors in trees.c for embedded targets (Nick Smith) +- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith) +- add the OS/2 files in Makefile.in too (Andrew Zabolotny) +- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane) +- fix maketree.c to allow clean compilation of inffixed.h (Mark) +- fix parameter check in deflateCopy (Gunther Nikl) +- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler) +- Many portability patches by Christian Spieler: + . zutil.c, zutil.h: added "const" for zmem* + . Make_vms.com: fixed some typos + . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists + . msdos/Makefile.msc: remove "default rtl link library" info from obj files + . msdos/Makefile.*: use model-dependent name for the built zlib library + . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc: + new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT) +- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane) +- replace __far with _far for better portability (Christian Spieler, Tom Lane) +- fix test for errno.h in configure (Tim Newsham) + +Changes in 1.1.2 (19 March 98) +- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) + See http://www.winimage.com/zLibDll/unzip.html +- preinitialize the inflate tables for fixed codes, to make the code + completely thread safe (Mark) +- some simplifications and slight speed-up to the inflate code (Mark) +- fix gzeof on non-compressed files (Allan Schrum) +- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs) +- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn) +- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny) +- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori) +- do not wrap extern "C" around system includes (Tom Lane) +- mention zlib binding for TCL in README (Andreas Kupries) +- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert) +- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson) +- allow "configure --prefix $HOME" (Tim Mooney) +- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson) +- move Makefile.sas to amiga/Makefile.sas + +Changes in 1.1.1 (27 Feb 98) +- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson) +- remove block truncation heuristic which had very marginal effect for zlib + (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the + compression ratio on some files. This also allows inlining _tr_tally for + matches in deflate_slow. +- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier) + +Changes in 1.1.0 (24 Feb 98) +- do not return STREAM_END prematurely in inflate (John Bowler) +- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler) +- compile with -DFASTEST to get compression code optimized for speed only +- in minigzip, try mmap'ing the input file first (Miguel Albrecht) +- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain + on Sun but significant on HP) + +- add a pointer to experimental unzip library in README (Gilles Vollant) +- initialize variable gcc in configure (Chris Herborth) + +Changes in 1.0.9 (17 Feb 1998) +- added gzputs and gzgets functions +- do not clear eof flag in gzseek (Mark Diekhans) +- fix gzseek for files in transparent mode (Mark Diekhans) +- do not assume that vsprintf returns the number of bytes written (Jens Krinke) +- replace EXPORT with ZEXPORT to avoid conflict with other programs +- added compress2 in zconf.h, zlib.def, zlib.dnt +- new asm code from Gilles Vollant in contrib/asm386 +- simplify the inflate code (Mark): + . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new() + . ZALLOC the length list in inflate_trees_fixed() instead of using stack + . ZALLOC the value area for huft_build() instead of using stack + . Simplify Z_FINISH check in inflate() + +- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 +- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) +- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with + the declaration of FAR (Gilles VOllant) +- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) +- read_buf buf parameter of type Bytef* instead of charf* +- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) +- do not redeclare unlink in minigzip.c for WIN32 (John Bowler) +- fix check for presence of directories in "make install" (Ian Willis) + +Changes in 1.0.8 (27 Jan 1998) +- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant) +- fix gzgetc and gzputc for big endian systems (Markus Oberhumer) +- added compress2() to allow setting the compression level +- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong) +- use constant arrays for the static trees in trees.c instead of computing + them at run time (thanks to Ken Raeburn for this suggestion). To create + trees.h, compile with GEN_TREES_H and run "make test". +- check return code of example in "make test" and display result +- pass minigzip command line options to file_compress +- simplifying code of inflateSync to avoid gcc 2.8 bug + +- support CC="gcc -Wall" in configure -s (QingLong) +- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn) +- fix test for shared library support to avoid compiler warnings +- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant) +- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit) +- do not use fdopen for Metrowerks on Mac (Brad Pettit)) +- add checks for gzputc and gzputc in example.c +- avoid warnings in gzio.c and deflate.c (Andreas Kleinert) +- use const for the CRC table (Ken Raeburn) +- fixed "make uninstall" for shared libraries +- use Tracev instead of Trace in infblock.c +- in example.c use correct compressed length for test_sync +- suppress +vnocompatwarnings in configure for HPUX (not always supported) + +Changes in 1.0.7 (20 Jan 1998) +- fix gzseek which was broken in write mode +- return error for gzseek to negative absolute position +- fix configure for Linux (Chun-Chung Chen) +- increase stack space for MSC (Tim Wegner) +- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant) +- define EXPORTVA for gzprintf (Gilles Vollant) +- added man page zlib.3 (Rick Rodgers) +- for contrib/untgz, fix makedir() and improve Makefile + +- check gzseek in write mode in example.c +- allocate extra buffer for seeks only if gzseek is actually called +- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant) +- add inflateSyncPoint in zconf.h +- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def + +Changes in 1.0.6 (19 Jan 1998) +- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and + gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code) +- Fix a deflate bug occuring only with compression level 0 (thanks to + Andy Buckler for finding this one). +- In minigzip, pass transparently also the first byte for .Z files. +- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress() +- check Z_FINISH in inflate (thanks to Marc Schluper) +- Implement deflateCopy (thanks to Adam Costello) +- make static libraries by default in configure, add --shared option. +- move MSDOS or Windows specific files to directory msdos +- suppress the notion of partial flush to simplify the interface + (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4) +- suppress history buffer provided by application to simplify the interface + (this feature was not implemented anyway in 1.0.4) +- next_in and avail_in must be initialized before calling inflateInit or + inflateInit2 +- add EXPORT in all exported functions (for Windows DLL) +- added Makefile.nt (thanks to Stephen Williams) +- added the unsupported "contrib" directory: + contrib/asm386/ by Gilles Vollant + 386 asm code replacing longest_match(). + contrib/iostream/ by Kevin Ruland + A C++ I/O streams interface to the zlib gz* functions + contrib/iostream2/ by Tyge Løvset + Another C++ I/O streams interface + contrib/untgz/ by "Pedro A. Aranda Guti\irrez" + A very simple tar.gz file extractor using zlib + contrib/visual-basic.txt by Carlos Rios + How to use compress(), uncompress() and the gz* functions from VB. +- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression + level) in minigzip (thanks to Tom Lane) + +- use const for rommable constants in deflate +- added test for gzseek and gztell in example.c +- add undocumented function inflateSyncPoint() (hack for Paul Mackerras) +- add undocumented function zError to convert error code to string + (for Tim Smithers) +- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code. +- Use default memcpy for Symantec MSDOS compiler. +- Add EXPORT keyword for check_func (needed for Windows DLL) +- add current directory to LD_LIBRARY_PATH for "make test" +- create also a link for libz.so.1 +- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura) +- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX) +- added -soname for Linux in configure (Chun-Chung Chen, +- assign numbers to the exported functions in zlib.def (for Windows DLL) +- add advice in zlib.h for best usage of deflateSetDictionary +- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn) +- allow compilation with ANSI keywords only enabled for TurboC in large model +- avoid "versionString"[0] (Borland bug) +- add NEED_DUMMY_RETURN for Borland +- use variable z_verbose for tracing in debug mode (L. Peter Deutsch). +- allow compilation with CC +- defined STDC for OS/2 (David Charlap) +- limit external names to 8 chars for MVS (Thomas Lund) +- in minigzip.c, use static buffers only for 16-bit systems +- fix suffix check for "minigzip -d foo.gz" +- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee) +- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) +- added makelcc.bat for lcc-win32 (Tom St Denis) +- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) +- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. +- check for unistd.h in configure (for off_t) +- remove useless check parameter in inflate_blocks_free +- avoid useless assignment of s->check to itself in inflate_blocks_new +- do not flush twice in gzclose (thanks to Ken Raeburn) +- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h +- use NO_ERRNO_H instead of enumeration of operating systems with errno.h +- work around buggy fclose on pipes for HP/UX +- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson) +- fix configure if CC is already equal to gcc + +Changes in 1.0.5 (3 Jan 98) +- Fix inflate to terminate gracefully when fed corrupted or invalid data +- Use const for rommable constants in inflate +- Eliminate memory leaks on error conditions in inflate +- Removed some vestigial code in inflate +- Update web address in README + +Changes in 1.0.4 (24 Jul 96) +- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF + bit, so the decompressor could decompress all the correct data but went + on to attempt decompressing extra garbage data. This affected minigzip too. +- zlibVersion and gzerror return const char* (needed for DLL) +- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno) +- use z_error only for DEBUG (avoid problem with DLLs) + +Changes in 1.0.3 (2 Jul 96) +- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS + small and medium models; this makes the library incompatible with previous + versions for these models. (No effect in large model or on other systems.) +- return OK instead of BUF_ERROR if previous deflate call returned with + avail_out as zero but there is nothing to do +- added memcmp for non STDC compilers +- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly) +- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO) +- better check for 16-bit mode MSC (avoids problem with Symantec) + +Changes in 1.0.2 (23 May 96) +- added Windows DLL support +- added a function zlibVersion (for the DLL support) +- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model) +- Bytef is define's instead of typedef'd only for Borland C +- avoid reading uninitialized memory in example.c +- mention in README that the zlib format is now RFC1950 +- updated Makefile.dj2 +- added algorithm.doc + +Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion] +- fix array overlay in deflate.c which sometimes caused bad compressed data +- fix inflate bug with empty stored block +- fix MSDOS medium model which was broken in 0.99 +- fix deflateParams() which could generated bad compressed data. +- Bytef is define'd instead of typedef'ed (work around Borland bug) +- added an INDEX file +- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32), + Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas) +- speed up adler32 for modern machines without auto-increment +- added -ansi for IRIX in configure +- static_init_done in trees.c is an int +- define unlink as delete for VMS +- fix configure for QNX +- add configure branch for SCO and HPUX +- avoid many warnings (unused variables, dead assignments, etc...) +- no fdopen for BeOS +- fix the Watcom fix for 32 bit mode (define FAR as empty) +- removed redefinition of Byte for MKWERKS +- work around an MWKERKS bug (incorrect merge of all .h files) + +Changes in 0.99 (27 Jan 96) +- allow preset dictionary shared between compressor and decompressor +- allow compression level 0 (no compression) +- add deflateParams in zlib.h: allow dynamic change of compression level + and compression strategy. +- test large buffers and deflateParams in example.c +- add optional "configure" to build zlib as a shared library +- suppress Makefile.qnx, use configure instead +- fixed deflate for 64-bit systems (detected on Cray) +- fixed inflate_blocks for 64-bit systems (detected on Alpha) +- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2) +- always return Z_BUF_ERROR when deflate() has nothing to do +- deflateInit and inflateInit are now macros to allow version checking +- prefix all global functions and types with z_ with -DZ_PREFIX +- make falloc completely reentrant (inftrees.c) +- fixed very unlikely race condition in ct_static_init +- free in reverse order of allocation to help memory manager +- use zlib-1.0/* instead of zlib/* inside the tar.gz +- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith + -Wconversion -Wstrict-prototypes -Wmissing-prototypes" +- allow gzread on concatenated .gz files +- deflateEnd now returns Z_DATA_ERROR if it was premature +- deflate is finally (?) fully deterministic (no matches beyond end of input) +- Document Z_SYNC_FLUSH +- add uninstall in Makefile +- Check for __cpluplus in zlib.h +- Better test in ct_align for partial flush +- avoid harmless warnings for Borland C++ +- initialize hash_head in deflate.c +- avoid warning on fdopen (gzio.c) for HP cc -Aa +- include stdlib.h for STDC compilers +- include errno.h for Cray +- ignore error if ranlib doesn't exist +- call ranlib twice for NeXTSTEP +- use exec_prefix instead of prefix for libz.a +- renamed ct_* as _tr_* to avoid conflict with applications +- clear z->msg in inflateInit2 before any error return +- initialize opaque in example.c, gzio.c, deflate.c and inflate.c +- fixed typo in zconf.h (_GNUC__ => __GNUC__) +- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode) +- fix typo in Make_vms.com (f$trnlnm -> f$getsyi) +- in fcalloc, normalize pointer if size > 65520 bytes +- don't use special fcalloc for 32 bit Borland C++ +- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc... +- use Z_BINARY instead of BINARY +- document that gzclose after gzdopen will close the file +- allow "a" as mode in gzopen. +- fix error checking in gzread +- allow skipping .gz extra-field on pipes +- added reference to Perl interface in README +- put the crc table in FAR data (I dislike more and more the medium model :) +- added get_crc_table +- added a dimension to all arrays (Borland C can't count). +- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast +- guard against multiple inclusion of *.h (for precompiled header on Mac) +- Watcom C pretends to be Microsoft C small model even in 32 bit mode. +- don't use unsized arrays to avoid silly warnings by Visual C++: + warning C4746: 'inflate_mask' : unsized array treated as '__far' + (what's wrong with far data in far model?). +- define enum out of inflate_blocks_state to allow compilation with C++ + +Changes in 0.95 (16 Aug 95) +- fix MSDOS small and medium model (now easier to adapt to any compiler) +- inlined send_bits +- fix the final (:-) bug for deflate with flush (output was correct but + not completely flushed in rare occasions). +- default window size is same for compression and decompression + (it's now sufficient to set MAX_WBITS in zconf.h). +- voidp -> voidpf and voidnp -> voidp (for consistency with other + typedefs and because voidnp was not near in large model). + +Changes in 0.94 (13 Aug 95) +- support MSDOS medium model +- fix deflate with flush (could sometimes generate bad output) +- fix deflateReset (zlib header was incorrectly suppressed) +- added support for VMS +- allow a compression level in gzopen() +- gzflush now calls fflush +- For deflate with flush, flush even if no more input is provided. +- rename libgz.a as libz.a +- avoid complex expression in infcodes.c triggering Turbo C bug +- work around a problem with gcc on Alpha (in INSERT_STRING) +- don't use inline functions (problem with some gcc versions) +- allow renaming of Byte, uInt, etc... with #define. +- avoid warning about (unused) pointer before start of array in deflate.c +- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c +- avoid reserved word 'new' in trees.c + +Changes in 0.93 (25 June 95) +- temporarily disable inline functions +- make deflate deterministic +- give enough lookahead for PARTIAL_FLUSH +- Set binary mode for stdin/stdout in minigzip.c for OS/2 +- don't even use signed char in inflate (not portable enough) +- fix inflate memory leak for segmented architectures + +Changes in 0.92 (3 May 95) +- don't assume that char is signed (problem on SGI) +- Clear bit buffer when starting a stored block +- no memcpy on Pyramid +- suppressed inftest.c +- optimized fill_window, put longest_match inline for gcc +- optimized inflate on stored blocks. +- untabify all sources to simplify patches + +Changes in 0.91 (2 May 95) +- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h +- Document the memory requirements in zconf.h +- added "make install" +- fix sync search logic in inflateSync +- deflate(Z_FULL_FLUSH) now works even if output buffer too short +- after inflateSync, don't scare people with just "lo world" +- added support for DJGPP + +Changes in 0.9 (1 May 95) +- don't assume that zalloc clears the allocated memory (the TurboC bug + was Mark's bug after all :) +- let again gzread copy uncompressed data unchanged (was working in 0.71) +- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented +- added a test of inflateSync in example.c +- moved MAX_WBITS to zconf.h because users might want to change that. +- document explicitly that zalloc(64K) on MSDOS must return a normalized + pointer (zero offset) +- added Makefiles for Microsoft C, Turbo C, Borland C++ +- faster crc32() + +Changes in 0.8 (29 April 95) +- added fast inflate (inffast.c) +- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this + is incompatible with previous versions of zlib which returned Z_OK. +- work around a TurboC compiler bug (bad code for b << 0, see infutil.h) + (actually that was not a compiler bug, see 0.81 above) +- gzread no longer reads one extra byte in certain cases +- In gzio destroy(), don't reference a freed structure +- avoid many warnings for MSDOS +- avoid the ERROR symbol which is used by MS Windows + +Changes in 0.71 (14 April 95) +- Fixed more MSDOS compilation problems :( There is still a bug with + TurboC large model. + +Changes in 0.7 (14 April 95) +- Added full inflate support. +- Simplified the crc32() interface. The pre- and post-conditioning + (one's complement) is now done inside crc32(). WARNING: this is + incompatible with previous versions; see zlib.h for the new usage. + +Changes in 0.61 (12 April 95) +- workaround for a bug in TurboC. example and minigzip now work on MSDOS. + +Changes in 0.6 (11 April 95) +- added minigzip.c +- added gzdopen to reopen a file descriptor as gzFile +- added transparent reading of non-gziped files in gzread. +- fixed bug in gzread (don't read crc as data) +- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose). +- don't allocate big arrays in the stack (for MSDOS) +- fix some MSDOS compilation problems + +Changes in 0.5: +- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but + not yet Z_FULL_FLUSH. +- support decompression but only in a single step (forced Z_FINISH) +- added opaque object for zalloc and zfree. +- added deflateReset and inflateReset +- added a variable zlib_version for consistency checking. +- renamed the 'filter' parameter of deflateInit2 as 'strategy'. + Added Z_FILTERED and Z_HUFFMAN_ONLY constants. + +Changes in 0.4: +- avoid "zip" everywhere, use zlib instead of ziplib. +- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush + if compression method == 8. +- added adler32 and crc32 +- renamed deflateOptions as deflateInit2, call one or the other but not both +- added the method parameter for deflateInit2. +- added inflateInit2 +- simplied considerably deflateInit and inflateInit by not supporting + user-provided history buffer. This is supported only in deflateInit2 + and inflateInit2. + +Changes in 0.3: +- prefix all macro names with Z_ +- use Z_FINISH instead of deflateEnd to finish compression. +- added Z_HUFFMAN_ONLY +- added gzerror() Index: xc/extras/zlib/FAQ diff -u /dev/null xc/extras/zlib/FAQ:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/FAQ Sun Jun 1 17:00:12 2003 @@ -0,0 +1,100 @@ + + Frequently Asked Questions about zlib + + +If your question is not there, please check the zlib home page +http://www.zlib.org which may have more recent information. +The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html + + + 1. Is zlib Y2K-compliant? + + Yes. zlib doesn't handle dates. + + 2. Where can I get a Windows DLL version? + + The zlib sources can be compiled without change to produce a DLL. If you + want a precompiled DLL, see http://www.winimage.com/zLibDll/ . Questions + about the zlib DLL should be sent to Gilles Vollant (info@winimage.com). + + 3. Where can I get a Visual Basic interface to zlib? + + See + * http://www.winimage.com/zLibDll/cmp-z-it.zip + * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm + * contrib/visual-basic.txt in the zlib distribution + + 4. compress() returns Z_BUF_ERROR + + Make sure that before the call of compress, the length of the compressed + buffer is equal to the total size of the compressed buffer and not + zero. For Visual Basic, check that this parameter is passed by reference + ("as any"), not by value ("as long"). + + 5. deflate() or inflate() returns Z_BUF_ERROR + + Before making the call, make sure that avail_in and avail_out are not + zero. When setting the parameter flush equal to Z_FINISH, also make sure + that avail_out is big enough to allow processing all pending input. + + 6. Where's the zlib documentation (man pages, etc.)? + + It's in zlib.h for the moment, and Francis S. Lin has converted it to a + web page zlib.html. Volunteers to transform this to Unix-style man pages, + please contact Jean-loup Gailly (jloup@gzip.org). Examples of zlib usage + are in the files example.c and minigzip.c. + + 7. Why don't you use GNU autoconf or libtool or ...? + + Because we would like to keep zlib as a very small and simple + package. zlib is rather portable and doesn't need much configuration. + + 8. I found a bug in zlib. + + Most of the time, such problems are due to an incorrect usage of + zlib. Please try to reproduce the problem with a small program and send + the corresponding source to us at zlib@gzip.org . Do not send + multi-megabyte data files without prior agreement. + + 9. Why do I get "undefined reference to gzputc"? + + If "make test" produces something like + + example.o(.text+0x154): undefined reference to `gzputc' + + check that you don't have old files libz.* in /usr/lib, /usr/local/lib or + /usr/X11R6/lib. Remove any old versions, then do "make install". + +10. I need a Delphi interface to zlib. + + See the directories contrib/delphi and contrib/delphi2 in the zlib + distribution. + +11. Can zlib handle .zip archives? + + See the directory contrib/minizip in the zlib distribution. + +12. Can zlib handle .Z files? + + No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt + the code of uncompress on your own. + +13. How can I make a Unix shared library? + + make clean + ./configure -s + make + +14. Why does "make test" fail on Mac OS X? + + Mac OS X already includes zlib as a shared library, and so -lz links the + shared library instead of the one that the "make" compiled. For zlib + 1.1.3, the two are incompatible due to different compile-time + options. Simply change the -lz in the Makefile to libz.a, and it will use + the compiled library instead of the shared one and the "make test" will + succeed. + +15. I have a question about OttoPDF + + We are not the authors of OttoPDF. The real author is on the OttoPDF web + site Joel Hainley jhainley@myndkryme.com. Index: xc/extras/zlib/INDEX diff -u /dev/null xc/extras/zlib/INDEX:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/INDEX Sun Jun 1 17:00:12 2003 @@ -0,0 +1,86 @@ +ChangeLog history of changes +INDEX this file +FAQ Frequently Asked Questions about zlib +Make_vms.com script for Vax/VMS +Makefile makefile for Unix (generated by configure) +Makefile.in makefile for Unix (template for configure) +Makefile.riscos makefile for RISCOS +README guess what +algorithm.txt description of the (de)compression algorithm +configure configure script for Unix +descrip.mms makefile for Vax/VMS +zlib.3 mini man page for zlib (volunteers to write full + man pages from zlib.h welcome. write to jloup@gzip.org) + +amiga/Makefile.sas makefile for Amiga SAS/C +amiga/Makefile.pup makefile for Amiga powerUP SAS/C PPC + +msdos/Makefile.w32 makefile for Microsoft Visual C++ 32-bit +msdos/Makefile.b32 makefile for Borland C++ 32-bit +msdos/Makefile.bor makefile for Borland C/C++ 16-bit +msdos/Makefile.dj2 makefile for DJGPP 2.x +msdos/Makefile.emx makefile for EMX 0.9c (32-bit DOS/OS2) +msdos/Makefile.msc makefile for Microsoft C 16-bit +msdos/Makefile.tc makefile for Turbo C +msdos/Makefile.wat makefile for Watcom C +msdos/zlib.def definition file for Windows DLL +msdos/zlib.rc definition file for Windows DLL + +nt/Makefile.nt makefile for Windows NT +nt/zlib.dnt definition file for Windows NT DLL +nt/Makefile.emx makefile for EMX 0.9c/RSXNT 1.41 (Win32 Intel) +nt/Makefile.gcc makefile for Windows NT using GCC (mingw32) + + + zlib public header files (must be kept): +zconf.h +zlib.h + + private source files used to build the zlib library: +adler32.c +compress.c +crc32.c +deflate.c +deflate.h +gzio.c +infblock.c +infblock.h +infcodes.c +infcodes.h +inffast.c +inffast.h +inflate.c +inftrees.c +inftrees.h +infutil.c +infutil.h +maketree.c +trees.c +uncompr.c +zutil.c +zutil.h + + source files for sample programs: +example.c +minigzip.c + + unsupported contribution by third parties + +contrib/asm386/ by Gilles Vollant + 386 asm code replacing longest_match(). + +contrib/minizip/ by Gilles Vollant + Mini zip and unzip based on zlib + See http://www.winimage.com/zLibDll/unzip.html + +contrib/iostream/ by Kevin Ruland + A C++ I/O streams interface to the zlib gz* functions + +contrib/iostream2/ by Tyge Løvset + Another C++ I/O streams interface + +contrib/untgz/ by "Pedro A. Aranda Guti\irrez" + A very simple tar.gz extractor using zlib + +contrib/visual-basic.txt by Carlos Rios + How to use compress(), uncompress() and the gz* functions from VB. Index: xc/extras/zlib/Make_vms.com diff -u /dev/null xc/extras/zlib/Make_vms.com:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/Make_vms.com Sun Jun 1 17:00:13 2003 @@ -0,0 +1,115 @@ +$! make libz under VMS +$! written by Martin P.J. Zinser +$! +$! Look for the compiler used +$! +$ ccopt = "" +$ if f$getsyi("HW_MODEL").ge.1024 +$ then +$ ccopt = "/prefix=all"+ccopt +$ comp = "__decc__=1" +$ if f$trnlnm("SYS").eqs."" then define sys sys$library: +$ else +$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs."" +$ then +$ comp = "__vaxc__=1" +$ if f$trnlnm("SYS").eqs."" then define sys sys$library: +$ else +$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include: +$ ccopt = "/decc/prefix=all"+ccopt +$ comp = "__decc__=1" +$ endif +$ endif +$! +$! Build the thing plain or with mms +$! +$ write sys$output "Compiling Zlib sources ..." +$ if f$search("SYS$SYSTEM:MMS.EXE").eqs."" +$ then +$ dele example.obj;*,minigzip.obj;* +$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" - + adler32.c zlib.h zconf.h +$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" - + compress.c zlib.h zconf.h +$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" - + crc32.c zlib.h zconf.h +$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - + deflate.c deflate.h zutil.h zlib.h zconf.h +$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" - + gzio.c zutil.h zlib.h zconf.h +$ CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" - + infblock.c zutil.h zlib.h zconf.h infblock.h +$ CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" - + infcodes.c zutil.h zlib.h zconf.h inftrees.h +$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" - + inffast.c zutil.h zlib.h zconf.h inffast.h +$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" - + inflate.c zutil.h zlib.h zconf.h infblock.h +$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" - + inftrees.c zutil.h zlib.h zconf.h inftrees.h +$ CALL MAKE infutil.OBJ "CC ''CCOPT' infutil" - + infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h +$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" - + trees.c deflate.h zutil.h zlib.h zconf.h +$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" - + uncompr.c zlib.h zconf.h +$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" - + zutil.c zutil.h zlib.h zconf.h +$ write sys$output "Building Zlib ..." +$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ +$ write sys$output "Building example..." +$ CALL MAKE example.OBJ "CC ''CCOPT' example" - + example.c zlib.h zconf.h +$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb +$ write sys$output "Building minigzip..." +$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" - + minigzip.c zlib.h zconf.h +$ call make minigzip.exe - + "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" - + minigzip.obj libz.olb +$ else +$ mms/macro=('comp') +$ endif +$ write sys$output "Zlib build completed" +$ exit +$! +$! +$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES +$ V = 'F$Verify(0) +$! P1 = What we are trying to make +$! P2 = Command to make it +$! P3 - P8 What it depends on +$ +$ If F$Search(P1) .Eqs. "" Then Goto Makeit +$ Time = F$CvTime(F$File(P1,"RDT")) +$arg=3 +$Loop: +$ Argument = P'arg +$ If Argument .Eqs. "" Then Goto Exit +$ El=0 +$Loop2: +$ File = F$Element(El," ",Argument) +$ If File .Eqs. " " Then Goto Endl +$ AFile = "" +$Loop3: +$ OFile = AFile +$ AFile = F$Search(File) +$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl +$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit +$ Goto Loop3 +$NextEL: +$ El = El + 1 +$ Goto Loop2 +$EndL: +$ arg=arg+1 +$ If arg .Le. 8 Then Goto Loop +$ Goto Exit +$ +$Makeit: +$ VV=F$VERIFY(0) +$ write sys$output P2 +$ 'P2 +$ VV='F$Verify(VV) +$Exit: +$ If V Then Set Verify +$ENDSUBROUTINE Index: xc/extras/zlib/Makefile diff -u /dev/null xc/extras/zlib/Makefile:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/Makefile Sun Jun 1 17:00:13 2003 @@ -0,0 +1,175 @@ +# Makefile for zlib +# Copyright (C) 1995-2002 Jean-loup Gailly. +# For conditions of distribution and use, see copyright notice in zlib.h + +# To compile and test, type: +# ./configure; make test +# The call of configure is optional if you don't have special requirements +# If you wish to build zlib as a shared library, use: ./configure -s + +# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: +# make install +# To install in $HOME instead of /usr/local, use: +# make install prefix=$HOME + +CC=cc + +CFLAGS=-O +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 +#CFLAGS=-g -DDEBUG +#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ +# -Wstrict-prototypes -Wmissing-prototypes + +LDFLAGS=-L. -lz +LDSHARED=$(CC) +CPP=$(CC) -E + +VER=1.1.4 +LIBS=libz.a +SHAREDLIB=libz.so + +AR=ar rc +RANLIB=ranlib +TAR=tar +SHELL=/bin/sh + +prefix = /usr/local +exec_prefix = ${prefix} +libdir = ${exec_prefix}/lib +includedir = ${prefix}/include + +OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ + zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o + +OBJA = +# to use the asm code: make OBJA=match.o + +TEST_OBJS = example.o minigzip.o + +DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \ + algorithm.txt zlib.3 zlib.html \ + msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \ + nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \ + contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \ + contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \ + contrib/asm[56]86/*.S contrib/iostream/*.cpp \ + contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \ + contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \ + contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \ + contrib/delphi*/*.??? + +all: example minigzip + +test: all + @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ + echo hello world | ./minigzip | ./minigzip -d || \ + echo ' *** minigzip test FAILED ***' ; \ + if ./example; then \ + echo ' *** zlib test OK ***'; \ + else \ + echo ' *** zlib test FAILED ***'; \ + fi + +libz.a: $(OBJS) $(OBJA) + $(AR) $@ $(OBJS) $(OBJA) + -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 + +match.o: match.S + $(CPP) match.S > _match.s + $(CC) -c _match.s + mv _match.o match.o + rm -f _match.s + +$(SHAREDLIB).$(VER): $(OBJS) + $(LDSHARED) -o $@ $(OBJS) + rm -f $(SHAREDLIB) $(SHAREDLIB).1 + ln -s $@ $(SHAREDLIB) + ln -s $@ $(SHAREDLIB).1 + +example: example.o $(LIBS) + $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) + +minigzip: minigzip.o $(LIBS) + $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) + +install: $(LIBS) + -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi + -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi + cp zlib.h zconf.h $(includedir) + chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h + cp $(LIBS) $(libdir) + cd $(libdir); chmod 755 $(LIBS) + -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 + cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \ + rm -f $(SHAREDLIB) $(SHAREDLIB).1; \ + ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \ + ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \ + (ldconfig || true) >/dev/null 2>&1; \ + fi +# The ranlib in install is needed on NeXTSTEP which checks file times +# ldconfig is for Linux + +uninstall: + cd $(includedir); \ + v=$(VER); \ + if test -f zlib.h; then \ + v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \ + rm -f zlib.h zconf.h; \ + fi; \ + cd $(libdir); rm -f libz.a; \ + if test -f $(SHAREDLIB).$$v; then \ + rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \ + fi + +clean: + rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \ + _match.s maketree + +distclean: clean + +zip: + mv Makefile Makefile~; cp -p Makefile.in Makefile + rm -f test.c ztest*.c contrib/minizip/test.zip + v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ + zip -ul9 zlib$$v $(DISTFILES) + mv Makefile~ Makefile + +dist: + mv Makefile Makefile~; cp -p Makefile.in Makefile + rm -f test.c ztest*.c contrib/minizip/test.zip + d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ + rm -f $$d.tar.gz; \ + if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ + files=""; \ + for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \ + cd ..; \ + GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \ + if test ! -d $$d; then rm -f $$d; fi + mv Makefile~ Makefile + +tags: + etags *.[ch] + +depend: + makedepend -- $(CFLAGS) -- *.[ch] + +# DO NOT DELETE THIS LINE -- make depend depends on it. + +adler32.o: zlib.h zconf.h +compress.o: zlib.h zconf.h +crc32.o: zlib.h zconf.h +deflate.o: deflate.h zutil.h zlib.h zconf.h +example.o: zlib.h zconf.h +gzio.o: zutil.h zlib.h zconf.h +infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h +infcodes.o: zutil.h zlib.h zconf.h +infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h +inffast.o: zutil.h zlib.h zconf.h inftrees.h +inffast.o: infblock.h infcodes.h infutil.h inffast.h +inflate.o: zutil.h zlib.h zconf.h infblock.h +inftrees.o: zutil.h zlib.h zconf.h inftrees.h +infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h +minigzip.o: zlib.h zconf.h +trees.o: deflate.h zutil.h zlib.h zconf.h trees.h +uncompr.o: zlib.h zconf.h +zutil.o: zutil.h zlib.h zconf.h Index: xc/extras/zlib/Makefile.in diff -u /dev/null xc/extras/zlib/Makefile.in:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/Makefile.in Sun Jun 1 17:00:13 2003 @@ -0,0 +1,175 @@ +# Makefile for zlib +# Copyright (C) 1995-2002 Jean-loup Gailly. +# For conditions of distribution and use, see copyright notice in zlib.h + +# To compile and test, type: +# ./configure; make test +# The call of configure is optional if you don't have special requirements +# If you wish to build zlib as a shared library, use: ./configure -s + +# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: +# make install +# To install in $HOME instead of /usr/local, use: +# make install prefix=$HOME + +CC=cc + +CFLAGS=-O +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 +#CFLAGS=-g -DDEBUG +#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ +# -Wstrict-prototypes -Wmissing-prototypes + +LDFLAGS=-L. -lz +LDSHARED=$(CC) +CPP=$(CC) -E + +VER=1.1.4 +LIBS=libz.a +SHAREDLIB=libz.so + +AR=ar rc +RANLIB=ranlib +TAR=tar +SHELL=/bin/sh + +prefix = /usr/local +exec_prefix = ${prefix} +libdir = ${exec_prefix}/lib +includedir = ${prefix}/include + +OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ + zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o + +OBJA = +# to use the asm code: make OBJA=match.o + +TEST_OBJS = example.o minigzip.o + +DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \ + algorithm.txt zlib.3 zlib.html \ + msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \ + nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \ + contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \ + contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \ + contrib/asm[56]86/*.S contrib/iostream/*.cpp \ + contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \ + contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \ + contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \ + contrib/delphi*/*.??? + +all: example minigzip + +test: all + @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ + echo hello world | ./minigzip | ./minigzip -d || \ + echo ' *** minigzip test FAILED ***' ; \ + if ./example; then \ + echo ' *** zlib test OK ***'; \ + else \ + echo ' *** zlib test FAILED ***'; \ + fi + +libz.a: $(OBJS) $(OBJA) + $(AR) $@ $(OBJS) $(OBJA) + -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 + +match.o: match.S + $(CPP) match.S > _match.s + $(CC) -c _match.s + mv _match.o match.o + rm -f _match.s + +$(SHAREDLIB).$(VER): $(OBJS) + $(LDSHARED) -o $@ $(OBJS) + rm -f $(SHAREDLIB) $(SHAREDLIB).1 + ln -s $@ $(SHAREDLIB) + ln -s $@ $(SHAREDLIB).1 + +example: example.o $(LIBS) + $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) + +minigzip: minigzip.o $(LIBS) + $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) + +install: $(LIBS) + -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi + -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi + cp zlib.h zconf.h $(includedir) + chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h + cp $(LIBS) $(libdir) + cd $(libdir); chmod 755 $(LIBS) + -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 + cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \ + rm -f $(SHAREDLIB) $(SHAREDLIB).1; \ + ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \ + ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \ + (ldconfig || true) >/dev/null 2>&1; \ + fi +# The ranlib in install is needed on NeXTSTEP which checks file times +# ldconfig is for Linux + +uninstall: + cd $(includedir); \ + v=$(VER); \ + if test -f zlib.h; then \ + v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \ + rm -f zlib.h zconf.h; \ + fi; \ + cd $(libdir); rm -f libz.a; \ + if test -f $(SHAREDLIB).$$v; then \ + rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \ + fi + +clean: + rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \ + _match.s maketree + +distclean: clean + +zip: + mv Makefile Makefile~; cp -p Makefile.in Makefile + rm -f test.c ztest*.c contrib/minizip/test.zip + v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ + zip -ul9 zlib$$v $(DISTFILES) + mv Makefile~ Makefile + +dist: + mv Makefile Makefile~; cp -p Makefile.in Makefile + rm -f test.c ztest*.c contrib/minizip/test.zip + d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ + rm -f $$d.tar.gz; \ + if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ + files=""; \ + for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \ + cd ..; \ + GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \ + if test ! -d $$d; then rm -f $$d; fi + mv Makefile~ Makefile + +tags: + etags *.[ch] + +depend: + makedepend -- $(CFLAGS) -- *.[ch] + +# DO NOT DELETE THIS LINE -- make depend depends on it. + +adler32.o: zlib.h zconf.h +compress.o: zlib.h zconf.h +crc32.o: zlib.h zconf.h +deflate.o: deflate.h zutil.h zlib.h zconf.h +example.o: zlib.h zconf.h +gzio.o: zutil.h zlib.h zconf.h +infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h +infcodes.o: zutil.h zlib.h zconf.h +infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h +inffast.o: zutil.h zlib.h zconf.h inftrees.h +inffast.o: infblock.h infcodes.h infutil.h inffast.h +inflate.o: zutil.h zlib.h zconf.h infblock.h +inftrees.o: zutil.h zlib.h zconf.h inftrees.h +infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h +minigzip.o: zlib.h zconf.h +trees.o: deflate.h zutil.h zlib.h zconf.h trees.h +uncompr.o: zlib.h zconf.h +zutil.o: zutil.h zlib.h zconf.h Index: xc/extras/zlib/Makefile.riscos diff -u /dev/null xc/extras/zlib/Makefile.riscos:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/Makefile.riscos Sun Jun 1 17:00:13 2003 @@ -0,0 +1,151 @@ +# Project: zlib_1_03 +# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430 +# test works out-of-the-box, installs `somewhere' on demand + +# Toolflags: +CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah +C++flags = -c -depend !Depend -IC: -throwback +Linkflags = -aif -c++ -o $@ +ObjAsmflags = -throwback -NoCache -depend !Depend +CMHGflags = +LibFileflags = -c -l -o $@ +Squeezeflags = -o $@ + +# change the line below to where _you_ want the library installed. +libdest = lib:zlib + +# Final targets: +@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \ + @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \ + @.o.uncompr @.o.zutil + LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \ + @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \ + @.o.trees @.o.uncompr @.o.zutil +test: @.minigzip @.example @.lib + @copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV + @echo running tests: hang on. + @/@.minigzip -f -9 libc + @/@.minigzip -d libc-gz + @/@.minigzip -f -1 libc + @/@.minigzip -d libc-gz + @/@.minigzip -h -9 libc + @/@.minigzip -d libc-gz + @/@.minigzip -h -1 libc + @/@.minigzip -d libc-gz + @/@.minigzip -9 libc + @/@.minigzip -d libc-gz + @/@.minigzip -1 libc + @/@.minigzip -d libc-gz + @diff @.lib @.libc + @echo that should have reported '@.lib and @.libc identical' if you have diff. + @/@.example @.fred @.fred + @echo that will have given lots of hello!'s. + +@.minigzip: @.o.minigzip @.lib C:o.Stubs + Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs +@.example: @.o.example @.lib C:o.Stubs + Link $(Linkflags) @.o.example @.lib C:o.Stubs + +install: @.lib + cdir $(libdest) + cdir $(libdest).h + @copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV + @copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV + @copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV + @echo okay, installed zlib in $(libdest) + +clean:; remove @.minigzip + remove @.example + remove @.libc + -wipe @.o.* F~r~cV + remove @.fred + +# User-editable dependencies: +.c.o: + cc $(ccflags) -o $@ $< + +# Static dependencies: + +# Dynamic dependencies: +o.example: c.example +o.example: h.zlib +o.example: h.zconf +o.minigzip: c.minigzip +o.minigzip: h.zlib +o.minigzip: h.zconf +o.adler32: c.adler32 +o.adler32: h.zlib +o.adler32: h.zconf +o.compress: c.compress +o.compress: h.zlib +o.compress: h.zconf +o.crc32: c.crc32 +o.crc32: h.zlib +o.crc32: h.zconf +o.deflate: c.deflate +o.deflate: h.deflate +o.deflate: h.zutil +o.deflate: h.zlib +o.deflate: h.zconf +o.gzio: c.gzio +o.gzio: h.zutil +o.gzio: h.zlib +o.gzio: h.zconf +o.infblock: c.infblock +o.infblock: h.zutil +o.infblock: h.zlib +o.infblock: h.zconf +o.infblock: h.infblock +o.infblock: h.inftrees +o.infblock: h.infcodes +o.infblock: h.infutil +o.infcodes: c.infcodes +o.infcodes: h.zutil +o.infcodes: h.zlib +o.infcodes: h.zconf +o.infcodes: h.inftrees +o.infcodes: h.infblock +o.infcodes: h.infcodes +o.infcodes: h.infutil +o.infcodes: h.inffast +o.inffast: c.inffast +o.inffast: h.zutil +o.inffast: h.zlib +o.inffast: h.zconf +o.inffast: h.inftrees +o.inffast: h.infblock +o.inffast: h.infcodes +o.inffast: h.infutil +o.inffast: h.inffast +o.inflate: c.inflate +o.inflate: h.zutil +o.inflate: h.zlib +o.inflate: h.zconf +o.inflate: h.infblock +o.inftrees: c.inftrees +o.inftrees: h.zutil +o.inftrees: h.zlib +o.inftrees: h.zconf +o.inftrees: h.inftrees +o.inftrees: h.inffixed +o.infutil: c.infutil +o.infutil: h.zutil +o.infutil: h.zlib +o.infutil: h.zconf +o.infutil: h.infblock +o.infutil: h.inftrees +o.infutil: h.infcodes +o.infutil: h.infutil +o.trees: c.trees +o.trees: h.deflate +o.trees: h.zutil +o.trees: h.zlib +o.trees: h.zconf +o.trees: h.trees +o.uncompr: c.uncompr +o.uncompr: h.zlib +o.uncompr: h.zconf +o.zutil: c.zutil +o.zutil: h.zutil +o.zutil: h.zlib +o.zutil: h.zconf Index: xc/extras/zlib/README diff -u /dev/null xc/extras/zlib/README:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/README Sun Jun 1 17:00:12 2003 @@ -0,0 +1,147 @@ +zlib 1.1.4 is a general purpose data compression library. All the code +is thread safe. The data format used by the zlib library +is described by RFCs (Request for Comments) 1950 to 1952 in the files +http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate +format) and rfc1952.txt (gzip format). These documents are also available in +other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html + +All functions of the compression library are documented in the file zlib.h +(volunteer to write man pages welcome, contact jloup@gzip.org). A usage +example of the library is given in the file example.c which also tests that +the library is working correctly. Another example is given in the file +minigzip.c. The compression library itself is composed of all source files +except example.c and minigzip.c. + +To compile all files and run the test program, follow the instructions +given at the top of Makefile. In short "make test; make install" +should work for most machines. For Unix: "./configure; make test; make install" +For MSDOS, use one of the special makefiles such as Makefile.msc. +For VMS, use Make_vms.com or descrip.mms. + +Questions about zlib should be sent to , or to +Gilles Vollant for the Windows DLL version. +The zlib home page is http://www.zlib.org or http://www.gzip.org/zlib/ +Before reporting a problem, please check this site to verify that +you have the latest version of zlib; otherwise get the latest version and +check whether the problem still exists or not. + +PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html +before asking for help. + +Mark Nelson wrote an article about zlib for the Jan. 1997 +issue of Dr. Dobb's Journal; a copy of the article is available in +http://dogma.net/markn/articles/zlibtool/zlibtool.htm + +The changes made in version 1.1.4 are documented in the file ChangeLog. +The only changes made since 1.1.3 are bug corrections: + +- ZFREE was repeated on same allocation on some error conditions. + This creates a security problem described in + http://www.zlib.org/advisory-2002-03-11.txt +- Returned incorrect error (Z_MEM_ERROR) on some invalid data +- Avoid accesses before window for invalid distances with inflate window + less than 32K. +- force windowBits > 8 to avoid a bug in the encoder for a window size + of 256 bytes. (A complete fix will be available in 1.1.5). + +The beta version 1.1.5beta includes many more changes. A new official +version 1.1.5 will be released as soon as extensive testing has been +completed on it. + + +Unsupported third party contributions are provided in directory "contrib". + +A Java implementation of zlib is available in the Java Development Kit +http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html +See the zlib home page http://www.zlib.org for details. + +A Perl interface to zlib written by Paul Marquess +is in the CPAN (Comprehensive Perl Archive Network) sites +http://www.cpan.org/modules/by-module/Compress/ + +A Python interface to zlib written by A.M. Kuchling +is available in Python 1.5 and later versions, see +http://www.python.org/doc/lib/module-zlib.html + +A zlib binding for TCL written by Andreas Kupries +is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html + +An experimental package to read and write files in .zip format, +written on top of zlib by Gilles Vollant , is +available at http://www.winimage.com/zLibDll/unzip.html +and also in the contrib/minizip directory of zlib. + + +Notes for some targets: + +- To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc + and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL + The zlib DLL support was initially done by Alessandro Iacopetti and is + now maintained by Gilles Vollant . Check the zlib DLL + home page at http://www.winimage.com/zLibDll + + From Visual Basic, you can call the DLL functions which do not take + a structure as argument: compress, uncompress and all gz* functions. + See contrib/visual-basic.txt for more information, or get + http://www.tcfb.com/dowseware/cmp-z-it.zip + +- For 64-bit Irix, deflate.c must be compiled without any optimization. + With -O, one libpng test fails. The test works in 32 bit mode (with + the -n32 compiler flag). The compiler bug has been reported to SGI. + +- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 + it works when compiled with cc. + +- on Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 + is necessary to get gzprintf working correctly. This is done by configure. + +- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works + with other compilers. Use "make test" to check your compiler. + +- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers. + +- For Turbo C the small model is supported only with reduced performance to + avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 + +- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html + Per Harald Myrvang + + +Acknowledgments: + + The deflate format used by zlib was defined by Phil Katz. The deflate + and zlib specifications were written by L. Peter Deutsch. Thanks to all the + people who reported problems and suggested various improvements in zlib; + they are too numerous to cite here. + +Copyright notice: + + (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* +receiving lengthy legal documents to sign. The sources are provided +for free but without warranty of any kind. The library has been +entirely written by Jean-loup Gailly and Mark Adler; it does not +include third-party code. + +If you redistribute modified sources, we would appreciate that you include +in the file ChangeLog history information documenting your changes. Index: xc/extras/zlib/adler32.c diff -u /dev/null xc/extras/zlib/adler32.c:1.2 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/adler32.c Sun Jun 1 17:05:50 2003 @@ -0,0 +1,46 @@ +/* adler32.c -- compute the Adler-32 checksum of a data stream + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zlib.h" + +#define BASE 65521L /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* ========================================================================= */ +uLong ZEXPORT adler32(adler, buf, len) + uLong adler; + const Bytef *buf; + uInt len; +{ + unsigned long s1 = adler & 0xffff; + unsigned long s2 = (adler >> 16) & 0xffff; + int k; + + if (buf == Z_NULL) return 1L; + + while (len > 0) { + k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) { + DO16(buf); + buf += 16; + k -= 16; + } + if (k != 0) do { + s1 += *buf++; + s2 += s1; + } while (--k); + s1 %= BASE; + s2 %= BASE; + } + return (s2 << 16) | s1; +} Index: xc/extras/zlib/algorithm.txt diff -u /dev/null xc/extras/zlib/algorithm.txt:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/algorithm.txt Sun Jun 1 17:00:31 2003 @@ -0,0 +1,213 @@ +1. Compression algorithm (deflate) + +The deflation algorithm used by gzip (also zip and zlib) is a variation of +LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in +the input data. The second occurrence of a string is replaced by a +pointer to the previous string, in the form of a pair (distance, +length). Distances are limited to 32K bytes, and lengths are limited +to 258 bytes. When a string does not occur anywhere in the previous +32K bytes, it is emitted as a sequence of literal bytes. (In this +description, `string' must be taken as an arbitrary sequence of bytes, +and is not restricted to printable characters.) + +Literals or match lengths are compressed with one Huffman tree, and +match distances are compressed with another tree. The trees are stored +in a compact form at the start of each block. The blocks can have any +size (except that the compressed data for one block must fit in +available memory). A block is terminated when deflate() determines that +it would be useful to start another block with fresh trees. (This is +somewhat similar to the behavior of LZW-based _compress_.) + +Duplicated strings are found using a hash table. All input strings of +length 3 are inserted in the hash table. A hash index is computed for +the next 3 bytes. If the hash chain for this index is not empty, all +strings in the chain are compared with the current input string, and +the longest match is selected. + +The hash chains are searched starting with the most recent strings, to +favor small distances and thus take advantage of the Huffman encoding. +The hash chains are singly linked. There are no deletions from the +hash chains, the algorithm simply discards matches that are too old. + +To avoid a worst-case situation, very long hash chains are arbitrarily +truncated at a certain length, determined by a runtime option (level +parameter of deflateInit). So deflate() does not always find the longest +possible match but generally finds a match which is long enough. + +deflate() also defers the selection of matches with a lazy evaluation +mechanism. After a match of length N has been found, deflate() searches for +a longer match at the next input byte. If a longer match is found, the +previous match is truncated to a length of one (thus producing a single +literal byte) and the process of lazy evaluation begins again. Otherwise, +the original match is kept, and the next match search is attempted only N +steps later. + +The lazy match evaluation is also subject to a runtime parameter. If +the current match is long enough, deflate() reduces the search for a longer +match, thus speeding up the whole process. If compression ratio is more +important than speed, deflate() attempts a complete second search even if +the first match is already long enough. + +The lazy match evaluation is not performed for the fastest compression +modes (level parameter 1 to 3). For these fast modes, new strings +are inserted in the hash table only when no match was found, or +when the match is not too long. This degrades the compression ratio +but saves time since there are both fewer insertions and fewer searches. + + +2. Decompression algorithm (inflate) + +2.1 Introduction + +The real question is, given a Huffman tree, how to decode fast. The most +important realization is that shorter codes are much more common than +longer codes, so pay attention to decoding the short codes fast, and let +the long codes take longer to decode. + +inflate() sets up a first level table that covers some number of bits of +input less than the length of longest code. It gets that many bits from the +stream, and looks it up in the table. The table will tell if the next +code is that many bits or less and how many, and if it is, it will tell +the value, else it will point to the next level table for which inflate() +grabs more bits and tries to decode a longer code. + +How many bits to make the first lookup is a tradeoff between the time it +takes to decode and the time it takes to build the table. If building the +table took no time (and if you had infinite memory), then there would only +be a first level table to cover all the way to the longest code. However, +building the table ends up taking a lot longer for more bits since short +codes are replicated many times in such a table. What inflate() does is +simply to make the number of bits in the first table a variable, and set it +for the maximum speed. + +inflate() sends new trees relatively often, so it is possibly set for a +smaller first level table than an application that has only one tree for +all the data. For inflate, which has 286 possible codes for the +literal/length tree, the size of the first table is nine bits. Also the +distance trees have 30 possible values, and the size of the first table is +six bits. Note that for each of those cases, the table ended up one bit +longer than the ``average'' code length, i.e. the code length of an +approximately flat code which would be a little more than eight bits for +286 symbols and a little less than five bits for 30 symbols. It would be +interesting to see if optimizing the first level table for other +applications gave values within a bit or two of the flat code size. + + +2.2 More details on the inflate table lookup + +Ok, you want to know what this cleverly obfuscated inflate tree actually +looks like. You are correct that it's not a Huffman tree. It is simply a +lookup table for the first, let's say, nine bits of a Huffman symbol. The +symbol could be as short as one bit or as long as 15 bits. If a particular +symbol is shorter than nine bits, then that symbol's translation is duplicated +in all those entries that start with that symbol's bits. For example, if the +symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a +symbol is nine bits long, it appears in the table once. + +If the symbol is longer than nine bits, then that entry in the table points +to another similar table for the remaining bits. Again, there are duplicated +entries as needed. The idea is that most of the time the symbol will be short +and there will only be one table look up. (That's whole idea behind data +compression in the first place.) For the less frequent long symbols, there +will be two lookups. If you had a compression method with really long +symbols, you could have as many levels of lookups as is efficient. For +inflate, two is enough. + +So a table entry either points to another table (in which case nine bits in +the above example are gobbled), or it contains the translation for the symbol +and the number of bits to gobble. Then you start again with the next +ungobbled bit. + +You may wonder: why not just have one lookup table for how ever many bits the +longest symbol is? The reason is that if you do that, you end up spending +more time filling in duplicate symbol entries than you do actually decoding. +At least for deflate's output that generates new trees every several 10's of +kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code +would take too long if you're only decoding several thousand symbols. At the +other extreme, you could make a new table for every bit in the code. In fact, +that's essentially a Huffman tree. But then you spend two much time +traversing the tree while decoding, even for short symbols. + +So the number of bits for the first lookup table is a trade of the time to +fill out the table vs. the time spent looking at the second level and above of +the table. + +Here is an example, scaled down: + +The code being decoded, with 10 symbols, from 1 to 6 bits long: + +A: 0 +B: 10 +C: 1100 +D: 11010 +E: 11011 +F: 11100 +G: 11101 +H: 11110 +I: 111110 +J: 111111 + +Let's make the first table three bits long (eight entries): + +000: A,1 +001: A,1 +010: A,1 +011: A,1 +100: B,2 +101: B,2 +110: -> table X (gobble 3 bits) +111: -> table Y (gobble 3 bits) + +Each entry is what the bits decode to and how many bits that is, i.e. how +many bits to gobble. Or the entry points to another table, with the number of +bits to gobble implicit in the size of the table. + +Table X is two bits long since the longest code starting with 110 is five bits +long: + +00: C,1 +01: C,1 +10: D,2 +11: E,2 + +Table Y is three bits long since the longest code starting with 111 is six +bits long: + +000: F,2 +001: F,2 +010: G,2 +011: G,2 +100: H,2 +101: H,2 +110: I,3 +111: J,3 + +So what we have here are three tables with a total of 20 entries that had to +be constructed. That's compared to 64 entries for a single table. Or +compared to 16 entries for a Huffman tree (six two entry tables and one four +entry table). Assuming that the code ideally represents the probability of +the symbols, it takes on the average 1.25 lookups per symbol. That's compared +to one lookup for the single table, or 1.66 lookups per symbol for the +Huffman tree. + +There, I think that gives you a picture of what's going on. For inflate, the +meaning of a particular symbol is often more than just a letter. It can be a +byte (a "literal"), or it can be either a length or a distance which +indicates a base value and a number of bits to fetch after the code that is +added to the base value. Or it might be the special end-of-block code. The +data structures created in inftrees.c try to encode all that information +compactly in the tables. + + +Jean-loup Gailly Mark Adler +jloup@gzip.org madler@alumni.caltech.edu + + +References: + +[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data +Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3, +pp. 337-343. + +``DEFLATE Compressed Data Format Specification'' available in +ftp://ds.internic.net/rfc/rfc1951.txt Index: xc/extras/zlib/compress.c diff -u /dev/null xc/extras/zlib/compress.c:1.2 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/compress.c Sun Jun 1 17:05:50 2003 @@ -0,0 +1,66 @@ +/* compress.c -- compress a memory buffer + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zlib.h" + +/* =========================================================================== + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ +int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; + int level; +{ + z_stream stream; + int err; + + stream.next_in = (Bytef*)source; + stream.avail_in = (uInt)sourceLen; +#ifdef MAXSEG_64K + /* Check for source > 64K on 16-bit machine: */ + if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; +#endif + stream.next_out = dest; + stream.avail_out = (uInt)*destLen; + if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; + + stream.zalloc = (alloc_func)0; + stream.zfree = (free_func)0; + stream.opaque = (voidpf)0; + + err = deflateInit(&stream, level); + if (err != Z_OK) return err; + + err = deflate(&stream, Z_FINISH); + if (err != Z_STREAM_END) { + deflateEnd(&stream); + return err == Z_OK ? Z_BUF_ERROR : err; + } + *destLen = stream.total_out; + + err = deflateEnd(&stream); + return err; +} + +/* =========================================================================== + */ +int ZEXPORT compress (dest, destLen, source, sourceLen) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; +{ + return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); +} Index: xc/extras/zlib/configure diff -u /dev/null xc/extras/zlib/configure:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/configure Sun Jun 1 17:00:13 2003 @@ -0,0 +1,212 @@ +#!/bin/sh +# configure script for zlib. This script is needed only if +# you wish to build a shared library and your system supports them, +# of if you need special compiler, flags or install directory. +# Otherwise, you can just use directly "make test; make install" +# +# To create a shared library, use "configure --shared"; by default a static +# library is created. If the primitive shared library support provided here +# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz +# +# To impose specific compiler or flags or install directory, use for example: +# prefix=$HOME CC=cc CFLAGS="-O4" ./configure +# or for csh/tcsh users: +# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure) +# LDSHARED is the command to be used to create a shared library + +# Incorrect settings of CC or CFLAGS may prevent creating a shared library. +# If you have problems, try without defining CC and CFLAGS before reporting +# an error. + +LIBS=libz.a +SHAREDLIB=libz.so +VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` +AR=${AR-"ar rc"} +RANLIB=${RANLIB-"ranlib"} +prefix=${prefix-/usr/local} +exec_prefix=${exec_prefix-'${prefix}'} +libdir=${libdir-'${exec_prefix}/lib'} +includedir=${includedir-'${prefix}/include'} +shared_ext='.so' +shared=0 +gcc=0 +old_cc="$CC" +old_cflags="$CFLAGS" + +while test $# -ge 1 +do +case "$1" in + -h* | --h*) + echo 'usage:' + echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]' + echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]' + exit 0;; + -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; + -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; + -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; + -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;; + -p* | --p*) prefix="$2"; shift; shift;; + -e* | --e*) exec_prefix="$2"; shift; shift;; + -l* | --l*) libdir="$2"; shift; shift;; + -i* | --i*) includedir="$2"; shift; shift;; + -s* | --s*) shared=1; shift;; + esac +done + +test=ztest$$ +cat > $test.c </dev/null; then + CC="$cc" + SFLAGS=${CFLAGS-"-fPIC -O3"} + CFLAGS="$cflags" + case `(uname -s || echo unknown) 2>/dev/null` in + Linux | linux) LDSHARED=${LDSHARED-"gcc -shared -Wl,-soname,libz.so.1"};; + *) LDSHARED=${LDSHARED-"gcc -shared"};; + esac +else + # find system name and corresponding cc options + CC=${CC-cc} + case `(uname -sr || echo unknown) 2>/dev/null` in + HP-UX*) SFLAGS=${CFLAGS-"-O +z"} + CFLAGS=${CFLAGS-"-O"} +# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"} + LDSHARED=${LDSHARED-"ld -b"} + shared_ext='.sl' + SHAREDLIB='libz.sl';; + IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."} + CFLAGS=${CFLAGS-"-ansi -O2"} + LDSHARED=${LDSHARED-"cc -shared"};; + OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"} + CFLAGS=${CFLAGS-"-O -std1"} + LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};; + OSF1*) SFLAGS=${CFLAGS-"-O -std1"} + CFLAGS=${CFLAGS-"-O -std1"} + LDSHARED=${LDSHARED-"cc -shared"};; + QNX*) SFLAGS=${CFLAGS-"-4 -O"} + CFLAGS=${CFLAGS-"-4 -O"} + LDSHARED=${LDSHARED-"cc"} + RANLIB=${RANLIB-"true"} + AR="cc -A";; + SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "} + CFLAGS=${CFLAGS-"-O3"} + LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};; + SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."} + CFLAGS=${CFLAGS-"-fast -xcg89"} + LDSHARED=${LDSHARED-"cc -G"};; + SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"} + CFLAGS=${CFLAGS-"-O2"} + LDSHARED=${LDSHARED-"ld"};; + UNIX_System_V\ 4.2.0) + SFLAGS=${CFLAGS-"-KPIC -O"} + CFLAGS=${CFLAGS-"-O"} + LDSHARED=${LDSHARED-"cc -G"};; + UNIX_SV\ 4.2MP) + SFLAGS=${CFLAGS-"-Kconform_pic -O"} + CFLAGS=${CFLAGS-"-O"} + LDSHARED=${LDSHARED-"cc -G"};; + # send working options for other systems to support@gzip.org + *) SFLAGS=${CFLAGS-"-O"} + CFLAGS=${CFLAGS-"-O"} + LDSHARED=${LDSHARED-"cc -shared"};; + esac +fi + +if test $shared -eq 1; then + echo Checking for shared library support... + # we must test in two steps (cc then ld), required at least on SunOS 4.x + if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && + test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then + CFLAGS="$SFLAGS" + LIBS="$SHAREDLIB.$VER" + echo Building shared library $SHAREDLIB.$VER with $CC. + elif test -z "$old_cc" -a -z "$old_cflags"; then + echo No shared library suppport. + shared=0; + else + echo 'No shared library suppport; try without defining CC and CFLAGS' + shared=0; + fi +fi +if test $shared -eq 0; then + LDSHARED="$CC" + echo Building static library $LIBS version $VER with $CC. +fi + +cat > $test.c < +int main() { return 0; } +EOF +if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then + CFLAGS="$CFLAGS -DHAVE_UNISTD_H" + echo "Checking for unistd.h... Yes." +else + echo "Checking for unistd.h... No." +fi + +cat > $test.c < +int main() { return 0; } +EOF +if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then + echo "Checking for errno.h... Yes." +else + echo "Checking for errno.h... No." + CFLAGS="$CFLAGS -DNO_ERRNO_H" +fi + +cat > $test.c < +#include +#include +caddr_t hello() { + return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0); +} +EOF +if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then + CFLAGS="$CFLAGS -DUSE_MMAP" + echo Checking for mmap support... Yes. +else + echo Checking for mmap support... No. +fi + +CPP=${CPP-"$CC -E"} +case $CFLAGS in + *ASMV*) + if test "`nm $test.o | grep _hello`" = ""; then + CPP="$CPP -DNO_UNDERLINE" + echo Checking for underline in external names... No. + else + echo Checking for underline in external names... Yes. + fi;; +esac + +rm -f $test.[co] $test$shared_ext + +# udpate Makefile +sed < Makefile.in " +/^CC *=/s%=.*%=$CC% +/^CFLAGS *=/s%=.*%=$CFLAGS% +/^CPP *=/s%=.*%=$CPP% +/^LDSHARED *=/s%=.*%=$LDSHARED% +/^LIBS *=/s%=.*%=$LIBS% +/^SHAREDLIB *=/s%=.*%=$SHAREDLIB% +/^AR *=/s%=.*%=$AR% +/^RANLIB *=/s%=.*%=$RANLIB% +/^VER *=/s%=.*%=$VER% +/^prefix *=/s%=.*%=$prefix% +/^exec_prefix *=/s%=.*%=$exec_prefix% +/^libdir *=/s%=.*%=$libdir% +/^includedir *=/s%=.*%=$includedir% +" > Makefile Index: xc/extras/zlib/crc32.c diff -u /dev/null xc/extras/zlib/crc32.c:1.2 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/crc32.c Sun Jun 1 17:05:50 2003 @@ -0,0 +1,160 @@ +/* crc32.c -- compute the CRC-32 of a data stream + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zlib.h" + +#define local static + +#ifdef DYNAMIC_CRC_TABLE + +local int crc_table_empty = 1; +local uLongf crc_table[256]; +local void make_crc_table OF((void)); + +/* + Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + The table is simply the CRC of all possible eight bit values. This is all + the information needed to generate CRC's on data a byte at a time for all + combinations of CRC register values and incoming bytes. +*/ +local void make_crc_table() +{ + uLong c; + int n, k; + uLong poly; /* polynomial exclusive-or pattern */ + /* terms of polynomial defining this crc (except x^32): */ + static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + /* make exclusive-or pattern from polynomial (0xedb88320L) */ + poly = 0L; + for (n = 0; n < sizeof(p)/sizeof(Byte); n++) + poly |= 1L << (31 - p[n]); + + for (n = 0; n < 256; n++) + { + c = (uLong)n; + for (k = 0; k < 8; k++) + c = c & 1 ? poly ^ (c >> 1) : c >> 1; + crc_table[n] = c; + } + crc_table_empty = 0; +} +#else +/* ======================================================================== + * Table of CRC-32's of all single-byte values (made by make_crc_table) + */ +local const uLongf crc_table[256] = { + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +}; +#endif + +/* ========================================================================= + * This function can be used by asm versions of crc32() + */ +const uLongf * ZEXPORT get_crc_table() +{ +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) make_crc_table(); +#endif + return (const uLongf *)crc_table; +} + +/* ========================================================================= */ +#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8); +#define DO2(buf) DO1(buf); DO1(buf); +#define DO4(buf) DO2(buf); DO2(buf); +#define DO8(buf) DO4(buf); DO4(buf); + +/* ========================================================================= */ +uLong ZEXPORT crc32(crc, buf, len) + uLong crc; + const Bytef *buf; + uInt len; +{ + if (buf == Z_NULL) return 0L; +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif + crc = crc ^ 0xffffffffL; + while (len >= 8) + { + DO8(buf); + len -= 8; + } + if (len) do { + DO1(buf); + } while (--len); + return crc ^ 0xffffffffL; +} Index: xc/extras/zlib/deflate.c diff -u /dev/null xc/extras/zlib/deflate.c:1.2 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/deflate.c Sun Jun 1 17:05:50 2003 @@ -0,0 +1,1348 @@ +/* deflate.c -- compress data using the deflation algorithm + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * ALGORITHM + * + * The "deflation" process depends on being able to identify portions + * of the input text which are identical to earlier input (within a + * sliding window trailing behind the input currently being processed). + * + * The most straightforward technique turns out to be the fastest for + * most input files: try all possible matches and select the longest. + * The key feature of this algorithm is that insertions into the string + * dictionary are very simple and thus fast, and deletions are avoided + * completely. Insertions are performed at each input character, whereas + * string matches are performed only when the previous match ends. So it + * is preferable to spend more time in matches to allow very fast string + * insertions and avoid deletions. The matching algorithm for small + * strings is inspired from that of Rabin & Karp. A brute force approach + * is used to find longer strings when a small match has been found. + * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze + * (by Leonid Broukhis). + * A previous version of this file used a more sophisticated algorithm + * (by Fiala and Greene) which is guaranteed to run in linear amortized + * time, but has a larger average cost, uses more memory and is patented. + * However the F&G algorithm may be faster for some highly redundant + * files if the parameter max_chain_length (described below) is too large. + * + * ACKNOWLEDGEMENTS + * + * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and + * I found it in 'freeze' written by Leonid Broukhis. + * Thanks to many people for bug reports and testing. + * + * REFERENCES + * + * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". + * Available in ftp://ds.internic.net/rfc/rfc1951.txt + * + * A description of the Rabin and Karp algorithm is given in the book + * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. + * + * Fiala,E.R., and Greene,D.H. + * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 + * + */ + +#include "deflate.h" + +const char deflate_copyright[] = + " deflate 1.1.4 Copyright 1995-2002 Jean-loup Gailly "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* =========================================================================== + * Function prototypes. + */ +typedef enum { + need_more, /* block not completed, need more input or more output */ + block_done, /* block flush performed */ + finish_started, /* finish started, need only more output at next deflate */ + finish_done /* finish done, accept no more input or output */ +} block_state; + +typedef block_state (*compress_func) OF((deflate_state *s, int flush)); +/* Compression function. Returns the block state after the call. */ + +local void fill_window OF((deflate_state *s)); +local block_state deflate_stored OF((deflate_state *s, int flush)); +local block_state deflate_fast OF((deflate_state *s, int flush)); +local block_state deflate_slow OF((deflate_state *s, int flush)); +local void lm_init OF((deflate_state *s)); +local void putShortMSB OF((deflate_state *s, uInt b)); +local void flush_pending OF((z_streamp strm)); +local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); +#ifdef ASMV + void match_init OF((void)); /* asm code initialization */ + uInt longest_match OF((deflate_state *s, IPos cur_match)); +#else +local uInt longest_match OF((deflate_state *s, IPos cur_match)); +#endif + +#ifdef DEBUG +local void check_match OF((deflate_state *s, IPos start, IPos match, + int length)); +#endif + +/* =========================================================================== + * Local data + */ + +#define NIL 0 +/* Tail of hash chains */ + +#ifndef TOO_FAR +# define TOO_FAR 4096 +#endif +/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +typedef struct config_s { + ush good_length; /* reduce lazy search above this match length */ + ush max_lazy; /* do not perform lazy search above this match length */ + ush nice_length; /* quit search above this match length */ + ush max_chain; + compress_func func; +} config; + +local const config configuration_table[10] = { +/* good lazy nice chain */ +/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ +/* 1 */ {4, 4, 8, 4, deflate_fast}, /* maximum speed, no lazy matches */ +/* 2 */ {4, 5, 16, 8, deflate_fast}, +/* 3 */ {4, 6, 32, 32, deflate_fast}, + +/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ +/* 5 */ {8, 16, 32, 32, deflate_slow}, +/* 6 */ {8, 16, 128, 128, deflate_slow}, +/* 7 */ {8, 32, 128, 256, deflate_slow}, +/* 8 */ {32, 128, 258, 1024, deflate_slow}, +/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* maximum compression */ + +/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 + * For deflate_fast() (levels <= 3) good is ignored and lazy has a different + * meaning. + */ + +#define EQUAL 0 +/* result of memcmp for equal strings */ + +struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ + +/* =========================================================================== + * Update a hash value with the given input byte + * IN assertion: all calls to to UPDATE_HASH are made with consecutive + * input characters, so that a running hash key can be computed from the + * previous key instead of complete recalculation each time. + */ +#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) + + +/* =========================================================================== + * Insert string str in the dictionary and set match_head to the previous head + * of the hash chain (the most recent string with same hash key). Return + * the previous length of the hash chain. + * If this file is compiled with -DFASTEST, the compression level is forced + * to 1, and no hash chains are maintained. + * IN assertion: all calls to to INSERT_STRING are made with consecutive + * input characters and the first MIN_MATCH bytes of str are valid + * (except for the last MIN_MATCH-1 bytes of the input file). + */ +#ifdef FASTEST +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + match_head = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#else +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#endif + +/* =========================================================================== + * Initialize the hash table (avoiding 64K overflow for 16 bit systems). + * prev[] will be initialized on the fly. + */ +#define CLEAR_HASH(s) \ + s->head[s->hash_size-1] = NIL; \ + zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); + +/* ========================================================================= */ +int ZEXPORT deflateInit_(strm, level, version, stream_size) + z_streamp strm; + int level; + const char *version; + int stream_size; +{ + return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, + Z_DEFAULT_STRATEGY, version, stream_size); + /* To do: ignore strm->next_in if we use it as window */ +} + +/* ========================================================================= */ +int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, + version, stream_size) + z_streamp strm; + int level; + int method; + int windowBits; + int memLevel; + int strategy; + const char *version; + int stream_size; +{ + deflate_state *s; + int noheader = 0; + static const char* my_version = ZLIB_VERSION; + + ushf *overlay; + /* We overlay pending_buf and d_buf+l_buf. This works since the average + * output size for (length,distance) codes is <= 24 bits. + */ + + if (version == Z_NULL || version[0] != my_version[0] || + stream_size != sizeof(z_stream)) { + return Z_VERSION_ERROR; + } + if (strm == Z_NULL) return Z_STREAM_ERROR; + + strm->msg = Z_NULL; + if (strm->zalloc == Z_NULL) { + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; + } + if (strm->zfree == Z_NULL) strm->zfree = zcfree; + + if (level == Z_DEFAULT_COMPRESSION) level = 6; +#ifdef FASTEST + level = 1; +#endif + + if (windowBits < 0) { /* undocumented feature: suppress zlib header */ + noheader = 1; + windowBits = -windowBits; + } + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || + windowBits < 9 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_HUFFMAN_ONLY) { + return Z_STREAM_ERROR; + } + s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); + if (s == Z_NULL) return Z_MEM_ERROR; + strm->state = (struct internal_state FAR *)s; + s->strm = strm; + + s->noheader = noheader; + s->w_bits = windowBits; + s->w_size = 1 << s->w_bits; + s->w_mask = s->w_size - 1; + + s->hash_bits = memLevel + 7; + s->hash_size = 1 << s->hash_bits; + s->hash_mask = s->hash_size - 1; + s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + + s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); + s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); + s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); + + s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + s->pending_buf = (uchf *) overlay; + s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); + + if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || + s->pending_buf == Z_NULL) { + strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); + deflateEnd (strm); + return Z_MEM_ERROR; + } + s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + + s->level = level; + s->strategy = strategy; + s->method = (Byte)method; + + return deflateReset(strm); +} + +/* ========================================================================= */ +int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) + z_streamp strm; + const Bytef *dictionary; + uInt dictLength; +{ + deflate_state *s; + uInt length = dictLength; + uInt n; + IPos hash_head = 0; + + if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL || + strm->state->status != INIT_STATE) return Z_STREAM_ERROR; + + s = strm->state; + strm->adler = adler32(strm->adler, dictionary, dictLength); + + if (length < MIN_MATCH) return Z_OK; + if (length > MAX_DIST(s)) { + length = MAX_DIST(s); +#ifndef USE_DICT_HEAD + dictionary += dictLength - length; /* use the tail of the dictionary */ +#endif + } + zmemcpy(s->window, dictionary, length); + s->strstart = length; + s->block_start = (long)length; + + /* Insert all strings in the hash table (except for the last two bytes). + * s->lookahead stays null, so s->ins_h will be recomputed at the next + * call of fill_window. + */ + s->ins_h = s->window[0]; + UPDATE_HASH(s, s->ins_h, s->window[1]); + for (n = 0; n <= length - MIN_MATCH; n++) { + INSERT_STRING(s, n, hash_head); + } + if (hash_head) hash_head = 0; /* to make compiler happy */ + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateReset (strm) + z_streamp strm; +{ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL || + strm->zalloc == Z_NULL || strm->zfree == Z_NULL) return Z_STREAM_ERROR; + + strm->total_in = strm->total_out = 0; + strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ + strm->data_type = Z_UNKNOWN; + + s = (deflate_state *)strm->state; + s->pending = 0; + s->pending_out = s->pending_buf; + + if (s->noheader < 0) { + s->noheader = 0; /* was set to -1 by deflate(..., Z_FINISH); */ + } + s->status = s->noheader ? BUSY_STATE : INIT_STATE; + strm->adler = 1; + s->last_flush = Z_NO_FLUSH; + + _tr_init(s); + lm_init(s); + + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateParams(strm, level, strategy) + z_streamp strm; + int level; + int strategy; +{ + deflate_state *s; + compress_func func; + int err = Z_OK; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + + if (level == Z_DEFAULT_COMPRESSION) { + level = 6; + } + if (level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) { + return Z_STREAM_ERROR; + } + func = configuration_table[s->level].func; + + if (func != configuration_table[level].func && strm->total_in != 0) { + /* Flush the last buffer: */ + err = deflate(strm, Z_PARTIAL_FLUSH); + } + if (s->level != level) { + s->level = level; + s->max_lazy_match = configuration_table[level].max_lazy; + s->good_match = configuration_table[level].good_length; + s->nice_match = configuration_table[level].nice_length; + s->max_chain_length = configuration_table[level].max_chain; + } + s->strategy = strategy; + return err; +} + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +local void putShortMSB (s, b) + deflate_state *s; + uInt b; +{ + put_byte(s, (Byte)(b >> 8)); + put_byte(s, (Byte)(b & 0xff)); +} + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->next_out buffer and copying into it. + * (See also read_buf()). + */ +local void flush_pending(strm) + z_streamp strm; +{ + unsigned len = strm->state->pending; + + if (len > strm->avail_out) len = strm->avail_out; + if (len == 0) return; + + zmemcpy(strm->next_out, strm->state->pending_out, len); + strm->next_out += len; + strm->state->pending_out += len; + strm->total_out += len; + strm->avail_out -= len; + strm->state->pending -= len; + if (strm->state->pending == 0) { + strm->state->pending_out = strm->state->pending_buf; + } +} + +/* ========================================================================= */ +int ZEXPORT deflate (strm, flush) + z_streamp strm; + int flush; +{ + int old_flush; /* value of flush param for previous deflate call */ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL || + flush > Z_FINISH || flush < 0) { + return Z_STREAM_ERROR; + } + s = strm->state; + + if (strm->next_out == Z_NULL || + (strm->next_in == Z_NULL && strm->avail_in != 0) || + (s->status == FINISH_STATE && flush != Z_FINISH)) { + ERR_RETURN(strm, Z_STREAM_ERROR); + } + if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); + + s->strm = strm; /* just in case */ + old_flush = s->last_flush; + s->last_flush = flush; + + /* Write the zlib header */ + if (s->status == INIT_STATE) { + + uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt level_flags = (s->level-1) >> 1; + + if (level_flags > 3) level_flags = 3; + header |= (level_flags << 6); + if (s->strstart != 0) header |= PRESET_DICT; + header += 31 - (header % 31); + + s->status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s->strstart != 0) { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + strm->adler = 1L; + } + + /* Flush as much pending output as possible */ + if (s->pending != 0) { + flush_pending(strm); + if (strm->avail_out == 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s->last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUFF_ERROR. + */ + } else if (strm->avail_in == 0 && flush <= old_flush && + flush != Z_FINISH) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s->status == FINISH_STATE && strm->avail_in != 0) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm->avail_in != 0 || s->lookahead != 0 || + (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { + block_state bstate; + + bstate = (*(configuration_table[s->level].func))(s, flush); + + if (bstate == finish_started || bstate == finish_done) { + s->status = FINISH_STATE; + } + if (bstate == need_more || bstate == finish_started) { + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate == block_done) { + if (flush == Z_PARTIAL_FLUSH) { + _tr_align(s); + } else { /* FULL_FLUSH or SYNC_FLUSH */ + _tr_stored_block(s, (char*)0, 0L, 0); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush == Z_FULL_FLUSH) { + CLEAR_HASH(s); /* forget history */ + } + } + flush_pending(strm); + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + Assert(strm->avail_out > 0, "bug2"); + + if (flush != Z_FINISH) return Z_OK; + if (s->noheader) return Z_STREAM_END; + + /* Write the zlib trailer (adler32) */ + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + s->noheader = -1; /* write the trailer only once! */ + return s->pending != 0 ? Z_OK : Z_STREAM_END; +} + +/* ========================================================================= */ +int ZEXPORT deflateEnd (strm) + z_streamp strm; +{ + int status; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + + status = strm->state->status; + if (status != INIT_STATE && status != BUSY_STATE && + status != FINISH_STATE) { + return Z_STREAM_ERROR; + } + + /* Deallocate in reverse order of allocations: */ + TRY_FREE(strm, strm->state->pending_buf); + TRY_FREE(strm, strm->state->head); + TRY_FREE(strm, strm->state->prev); + TRY_FREE(strm, strm->state->window); + + ZFREE(strm, strm->state); + strm->state = Z_NULL; + + return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; +} + +/* ========================================================================= + * Copy the source state to the destination state. + * To simplify the source, this is not supported for 16-bit MSDOS (which + * doesn't have enough memory anyway to duplicate compression states). + */ +int ZEXPORT deflateCopy (dest, source) + z_streamp dest; + z_streamp source; +{ +#ifdef MAXSEG_64K + return Z_STREAM_ERROR; +#else + deflate_state *ds; + deflate_state *ss; + ushf *overlay; + + + if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { + return Z_STREAM_ERROR; + } + + ss = source->state; + + *dest = *source; + + ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); + if (ds == Z_NULL) return Z_MEM_ERROR; + dest->state = (struct internal_state FAR *) ds; + *ds = *ss; + ds->strm = dest; + + ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); + ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); + ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); + overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); + ds->pending_buf = (uchf *) overlay; + + if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || + ds->pending_buf == Z_NULL) { + deflateEnd (dest); + return Z_MEM_ERROR; + } + /* following zmemcpy do not work for 16-bit MSDOS */ + zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); + zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos)); + zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos)); + zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); + + ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); + ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); + ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; + + ds->l_desc.dyn_tree = ds->dyn_ltree; + ds->d_desc.dyn_tree = ds->dyn_dtree; + ds->bl_desc.dyn_tree = ds->bl_tree; + + return Z_OK; +#endif +} + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->next_in buffer and copying from it. + * (See also flush_pending()). + */ +local int read_buf(strm, buf, size) + z_streamp strm; + Bytef *buf; + unsigned size; +{ + unsigned len = strm->avail_in; + + if (len > size) len = size; + if (len == 0) return 0; + + strm->avail_in -= len; + + if (!strm->state->noheader) { + strm->adler = adler32(strm->adler, strm->next_in, len); + } + zmemcpy(buf, strm->next_in, len); + strm->next_in += len; + strm->total_in += len; + + return (int)len; +} + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +local void lm_init (s) + deflate_state *s; +{ + s->window_size = (ulg)2L*s->w_size; + + CLEAR_HASH(s); + + /* Set the default configuration parameters: + */ + s->max_lazy_match = configuration_table[s->level].max_lazy; + s->good_match = configuration_table[s->level].good_length; + s->nice_match = configuration_table[s->level].nice_length; + s->max_chain_length = configuration_table[s->level].max_chain; + + s->strstart = 0; + s->block_start = 0L; + s->lookahead = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + s->ins_h = 0; +#ifdef ASMV + match_init(); /* initialize the asm code */ +#endif +} + +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +#ifndef ASMV +/* For 80x86 and 680x0, an optimized version will be provided in match.asm or + * match.S. The code will be functionally equivalent. + */ +#ifndef FASTEST +local uInt longest_match(s, cur_match) + deflate_state *s; + IPos cur_match; /* current match */ +{ + unsigned chain_length = s->max_chain_length;/* max hash chain length */ + register Bytef *scan = s->window + s->strstart; /* current string */ + register Bytef *match; /* matched string */ + register int len; /* length of current match */ + int best_len = s->prev_length; /* best match length so far */ + int nice_match = s->nice_match; /* stop if match long enough */ + IPos limit = s->strstart > (IPos)MAX_DIST(s) ? + s->strstart - (IPos)MAX_DIST(s) : NIL; + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + Posf *prev = s->prev; + uInt wmask = s->w_mask; + +#ifdef UNALIGNED_OK + /* Compare two bytes at a time. Note: this is not always beneficial. + * Try with and without -DUNALIGNED_OK to check. + */ + register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; + register ush scan_start = *(ushf*)scan; + register ush scan_end = *(ushf*)(scan+best_len-1); +#else + register Bytef *strend = s->window + s->strstart + MAX_MATCH; + register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end = scan[best_len]; +#endif + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s->prev_length >= s->good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + + Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + Assert(cur_match < s->strstart, "no future"); + match = s->window + cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2: + */ +#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) + /* This code assumes sizeof(unsigned short) == 2. Do not use + * UNALIGNED_OK if your compiler uses a different size. + */ + if (*(ushf*)(match+best_len-1) != scan_end || + *(ushf*)match != scan_start) continue; + + /* It is not necessary to compare scan[2] and match[2] since they are + * always equal when the other bytes match, given that the hash keys + * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at + * strstart+3, +5, ... up to strstart+257. We check for insufficient + * lookahead only every 4th comparison; the 128th check will be made + * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * necessary to put more guard bytes at the end of the window, or + * to check more often for insufficient lookahead. + */ + Assert(scan[2] == match[2], "scan[2]?"); + scan++, match++; + do { + } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + scan < strend); + /* The funny "do {}" generates better code on most compilers */ + + /* Here, scan <= window+strstart+257 */ + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + if (*scan == *match) scan++; + + len = (MAX_MATCH - 1) - (int)(strend-scan); + scan = strend - (MAX_MATCH-1); + +#else /* UNALIGNED_OK */ + + if (match[best_len] != scan_end || + match[best_len-1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match++; + Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + +#endif /* UNALIGNED_OK */ + + if (len > best_len) { + s->match_start = cur_match; + best_len = len; + if (len >= nice_match) break; +#ifdef UNALIGNED_OK + scan_end = *(ushf*)(scan+best_len-1); +#else + scan_end1 = scan[best_len-1]; + scan_end = scan[best_len]; +#endif + } + } while ((cur_match = prev[cur_match & wmask]) > limit + && --chain_length != 0); + + if ((uInt)best_len <= s->lookahead) return (uInt)best_len; + return s->lookahead; +} + +#else /* FASTEST */ +/* --------------------------------------------------------------------------- + * Optimized version for level == 1 only + */ +local uInt longest_match(s, cur_match) + deflate_state *s; + IPos cur_match; /* current match */ +{ + register Bytef *scan = s->window + s->strstart; /* current string */ + register Bytef *match; /* matched string */ + register int len; /* length of current match */ + register Bytef *strend = s->window + s->strstart + MAX_MATCH; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + Assert(cur_match < s->strstart, "no future"); + + match = s->window + cur_match; + + /* Return failure if the match length is less than 2: + */ + if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match += 2; + Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + + if (len < MIN_MATCH) return MIN_MATCH - 1; + + s->match_start = cur_match; + return len <= s->lookahead ? len : s->lookahead; +} +#endif /* FASTEST */ +#endif /* ASMV */ + +#ifdef DEBUG +/* =========================================================================== + * Check that the match at match_start is indeed a match. + */ +local void check_match(s, start, match, length) + deflate_state *s; + IPos start, match; + int length; +{ + /* check that the match is indeed a match */ + if (zmemcmp(s->window + match, + s->window + start, length) != EQUAL) { + fprintf(stderr, " start %u, match %u, length %d\n", + start, match, length); + do { + fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); + } while (--length != 0); + z_error("invalid match"); + } + if (z_verbose > 1) { + fprintf(stderr,"\\[%d,%d]", start-match, length); + do { putc(s->window[start++], stderr); } while (--length != 0); + } +} +#else +# define check_match(s, start, match, length) +#endif + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +local void fill_window(s) + deflate_state *s; +{ + register unsigned n, m; + register Posf *p; + unsigned more; /* Amount of free space at the end of the window. */ + uInt wsize = s->w_size; + + do { + more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); + + /* Deal with !@#$% 64K limit: */ + if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + more = wsize; + + } else if (more == (unsigned)(-1)) { + /* Very unlikely, but possible on 16 bit machine if strstart == 0 + * and lookahead == 1 (input done one byte at time) + */ + more--; + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + } else if (s->strstart >= wsize+MAX_DIST(s)) { + + zmemcpy(s->window, s->window+wsize, (unsigned)wsize); + s->match_start -= wsize; + s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ + s->block_start -= (long) wsize; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + n = s->hash_size; + p = &s->head[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m-wsize : NIL); + } while (--n); + + n = wsize; +#ifndef FASTEST + p = &s->prev[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m-wsize : NIL); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); +#endif + more += wsize; + } + if (s->strm->avail_in == 0) return; + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + Assert(more >= 2, "more < 2"); + + n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); + s->lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s->lookahead >= MIN_MATCH) { + s->ins_h = s->window[s->strstart]; + UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); +} + +/* =========================================================================== + * Flush the current block, with given end-of-file flag. + * IN assertion: strstart is set to the end of the current match. + */ +#define FLUSH_BLOCK_ONLY(s, eof) { \ + _tr_flush_block(s, (s->block_start >= 0L ? \ + (charf *)&s->window[(unsigned)s->block_start] : \ + (charf *)Z_NULL), \ + (ulg)((long)s->strstart - s->block_start), \ + (eof)); \ + s->block_start = s->strstart; \ + flush_pending(s->strm); \ + Tracev((stderr,"[FLUSH]")); \ +} + +/* Same but force premature exit if necessary. */ +#define FLUSH_BLOCK(s, eof) { \ + FLUSH_BLOCK_ONLY(s, eof); \ + if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \ +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +local block_state deflate_stored(s, flush) + deflate_state *s; + int flush; +{ + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + ulg max_block_size = 0xffff; + ulg max_start; + + if (max_block_size > s->pending_buf_size - 5) { + max_block_size = s->pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s->lookahead <= 1) { + + Assert(s->strstart < s->w_size+MAX_DIST(s) || + s->block_start >= (long)s->w_size, "slide too late"); + + fill_window(s); + if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; + + if (s->lookahead == 0) break; /* flush the current block */ + } + Assert(s->block_start >= 0L, "block gone"); + + s->strstart += s->lookahead; + s->lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + max_start = s->block_start + max_block_size; + if (s->strstart == 0 || (ulg)s->strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s->lookahead = (uInt)(s->strstart - max_start); + s->strstart = (uInt)max_start; + FLUSH_BLOCK(s, 0); + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { + FLUSH_BLOCK(s, 0); + } + } + FLUSH_BLOCK(s, flush == Z_FINISH); + return flush == Z_FINISH ? finish_done : block_done; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +local block_state deflate_fast(s, flush) + deflate_state *s; + int flush; +{ + IPos hash_head = NIL; /* head of the hash chain */ + int bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + if (s->strategy != Z_HUFFMAN_ONLY) { + s->match_length = longest_match (s, hash_head); + } + /* longest_match() sets match_start */ + } + if (s->match_length >= MIN_MATCH) { + check_match(s, s->strstart, s->match_start, s->match_length); + + _tr_tally_dist(s, s->strstart - s->match_start, + s->match_length - MIN_MATCH, bflush); + + s->lookahead -= s->match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ +#ifndef FASTEST + if (s->match_length <= s->max_insert_length && + s->lookahead >= MIN_MATCH) { + s->match_length--; /* string at strstart already in hash table */ + do { + s->strstart++; + INSERT_STRING(s, s->strstart, hash_head); + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s->match_length != 0); + s->strstart++; + } else +#endif + { + s->strstart += s->match_length; + s->match_length = 0; + s->ins_h = s->window[s->strstart]; + UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + FLUSH_BLOCK(s, flush == Z_FINISH); + return flush == Z_FINISH ? finish_done : block_done; +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +local block_state deflate_slow(s, flush) + deflate_state *s; + int flush; +{ + IPos hash_head = NIL; /* head of hash chain */ + int bflush; /* set if current block must be flushed */ + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + */ + s->prev_length = s->match_length, s->prev_match = s->match_start; + s->match_length = MIN_MATCH-1; + + if (hash_head != NIL && s->prev_length < s->max_lazy_match && + s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + if (s->strategy != Z_HUFFMAN_ONLY) { + s->match_length = longest_match (s, hash_head); + } + /* longest_match() sets match_start */ + + if (s->match_length <= 5 && (s->strategy == Z_FILTERED || + (s->match_length == MIN_MATCH && + s->strstart - s->match_start > TOO_FAR))) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s->match_length = MIN_MATCH-1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { + uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + check_match(s, s->strstart-1, s->prev_match, s->prev_length); + + _tr_tally_dist(s, s->strstart -1 - s->prev_match, + s->prev_length - MIN_MATCH, bflush); + + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s->lookahead -= s->prev_length-1; + s->prev_length -= 2; + do { + if (++s->strstart <= max_insert) { + INSERT_STRING(s, s->strstart, hash_head); + } + } while (--s->prev_length != 0); + s->match_available = 0; + s->match_length = MIN_MATCH-1; + s->strstart++; + + if (bflush) FLUSH_BLOCK(s, 0); + + } else if (s->match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + if (bflush) { + FLUSH_BLOCK_ONLY(s, 0); + } + s->strstart++; + s->lookahead--; + if (s->strm->avail_out == 0) return need_more; + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s->match_available = 1; + s->strstart++; + s->lookahead--; + } + } + Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s->match_available) { + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + s->match_available = 0; + } + FLUSH_BLOCK(s, flush == Z_FINISH); + return flush == Z_FINISH ? finish_done : block_done; +} Index: xc/extras/zlib/deflate.h diff -u /dev/null xc/extras/zlib/deflate.h:1.2 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/deflate.h Sun Jun 1 17:05:50 2003 @@ -0,0 +1,316 @@ +/* deflate.h -- internal compression state + * Copyright (C) 1995-2002 Jean-loup Gailly + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _DEFLATE_H +#define _DEFLATE_H + +#include "zutil.h" + +/* =========================================================================== + * Internal compression state. + */ + +#define LENGTH_CODES 29 +/* number of length codes, not counting the special END_BLOCK code */ + +#define LITERALS 256 +/* number of literal bytes 0..255 */ + +#define L_CODES (LITERALS+1+LENGTH_CODES) +/* number of Literal or Length codes, including the END_BLOCK code */ + +#define D_CODES 30 +/* number of distance codes */ + +#define BL_CODES 19 +/* number of codes used to transfer the bit lengths */ + +#define HEAP_SIZE (2*L_CODES+1) +/* maximum heap size */ + +#define MAX_BITS 15 +/* All codes must not exceed MAX_BITS bits */ + +#define INIT_STATE 42 +#define BUSY_STATE 113 +#define FINISH_STATE 666 +/* Stream status */ + + +/* Data structure describing a single value and its code string. */ +typedef struct ct_data_s { + union { + ush freq; /* frequency count */ + ush code; /* bit string */ + } fc; + union { + ush dad; /* father node in Huffman tree */ + ush len; /* length of bit string */ + } dl; +} FAR ct_data; + +#define Freq fc.freq +#define Code fc.code +#define Dad dl.dad +#define Len dl.len + +typedef struct static_tree_desc_s static_tree_desc; + +typedef struct tree_desc_s { + ct_data *dyn_tree; /* the dynamic tree */ + int max_code; /* largest code with non zero frequency */ + static_tree_desc *stat_desc; /* the corresponding static tree */ +} FAR tree_desc; + +typedef ush Pos; +typedef Pos FAR Posf; +typedef unsigned IPos; + +/* A Pos is an index in the character window. We use short instead of int to + * save space in the various tables. IPos is used only for parameter passing. + */ + +typedef struct internal_state { + z_streamp strm; /* pointer back to this zlib stream */ + int status; /* as the name implies */ + Bytef *pending_buf; /* output still pending */ + ulg pending_buf_size; /* size of pending_buf */ + Bytef *pending_out; /* next pending byte to output to the stream */ + int pending; /* nb of bytes in the pending buffer */ + int noheader; /* suppress zlib header and adler32 */ + Byte data_type; /* UNKNOWN, BINARY or ASCII */ + Byte method; /* STORED (for zip only) or DEFLATED */ + int last_flush; /* value of flush param for previous deflate call */ + + /* used by deflate.c: */ + + uInt w_size; /* LZ77 window size (32K by default) */ + uInt w_bits; /* log2(w_size) (8..16) */ + uInt w_mask; /* w_size - 1 */ + + Bytef *window; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. Also, it limits + * the window size to 64K, which is quite useful on MSDOS. + * To do: use the user input buffer as sliding window. + */ + + ulg window_size; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + Posf *prev; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + Posf *head; /* Heads of the hash chains or NIL. */ + + uInt ins_h; /* hash index of string to be inserted */ + uInt hash_size; /* number of elements in hash table */ + uInt hash_bits; /* log2(hash_size) */ + uInt hash_mask; /* hash_size-1 */ + + uInt hash_shift; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + long block_start; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + uInt match_length; /* length of best match */ + IPos prev_match; /* previous match */ + int match_available; /* set if previous match exists */ + uInt strstart; /* start of string to insert */ + uInt match_start; /* start of matching string */ + uInt lookahead; /* number of valid bytes ahead in window */ + + uInt prev_length; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + uInt max_chain_length; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + uInt max_lazy_match; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ +# define max_insert_length max_lazy_match + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + int level; /* compression level (1..9) */ + int strategy; /* favor or force Huffman coding*/ + + uInt good_match; + /* Use a faster search when the previous match is longer than this */ + + int nice_match; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + /* Didn't use ct_data typedef below to supress compiler warning */ + struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + struct tree_desc_s l_desc; /* desc. for literal tree */ + struct tree_desc_s d_desc; /* desc. for distance tree */ + struct tree_desc_s bl_desc; /* desc. for bit length tree */ + + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + int heap_len; /* number of elements in the heap */ + int heap_max; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + uch depth[2*L_CODES+1]; + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + uchf *l_buf; /* buffer for literals or lengths */ + + uInt lit_bufsize; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + uInt last_lit; /* running index in l_buf */ + + ushf *d_buf; + /* Buffer for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + ulg opt_len; /* bit length of current block with optimal trees */ + ulg static_len; /* bit length of current block with static trees */ + uInt matches; /* number of string matches in current block */ + int last_eob_len; /* bit length of EOB code for last block */ + +#ifdef DEBUG + ulg compressed_len; /* total bit length of compressed file mod 2^32 */ + ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ +#endif + + ush bi_buf; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + int bi_valid; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + +} FAR deflate_state; + +/* Output a byte on the stream. + * IN assertion: there is enough room in pending_buf. + */ +#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} + + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) +/* In order to simplify the code, particularly on 16 bit machines, match + * distances are limited to MAX_DIST instead of WSIZE. + */ + + /* in trees.c */ +void _tr_init OF((deflate_state *s)); +int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); +void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); +void _tr_align OF((deflate_state *s)); +void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); + +#define d_code(dist) \ + ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) +/* Mapping from a distance to a distance code. dist is the distance - 1 and + * must not have side effects. _dist_code[256] and _dist_code[257] are never + * used. + */ + +#ifndef DEBUG +/* Inline versions of _tr_tally for speed: */ + +#if defined(GEN_TREES_H) || !defined(STDC) + extern uch _length_code[]; + extern uch _dist_code[]; +#else + extern const uch _length_code[]; + extern const uch _dist_code[]; +#endif + +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->last_lit] = 0; \ + s->l_buf[s->last_lit++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (length); \ + ush dist = (distance); \ + s->d_buf[s->last_lit] = dist; \ + s->l_buf[s->last_lit++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +#else +# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) +# define _tr_tally_dist(s, distance, length, flush) \ + flush = _tr_tally(s, distance, length) +#endif + +#endif Index: xc/extras/zlib/descrip.mms diff -u /dev/null xc/extras/zlib/descrip.mms:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/descrip.mms Sun Jun 1 17:00:20 2003 @@ -0,0 +1,48 @@ +# descrip.mms: MMS description file for building zlib on VMS +# written by Martin P.J. Zinser + +cc_defs = +c_deb = + +.ifdef __DECC__ +pref = /prefix=all +.endif + +OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj,\ + deflate.obj, trees.obj, zutil.obj, inflate.obj, infblock.obj,\ + inftrees.obj, infcodes.obj, infutil.obj, inffast.obj + +CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) + +all : example.exe minigzip.exe + @ write sys$output " Example applications available" +libz.olb : libz.olb($(OBJS)) + @ write sys$output " libz available" + +example.exe : example.obj libz.olb + link example,libz.olb/lib + +minigzip.exe : minigzip.obj libz.olb + link minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib + +clean : + delete *.obj;*,libz.olb;* + + +# Other dependencies. +adler32.obj : zutil.h zlib.h zconf.h +compress.obj : zlib.h zconf.h +crc32.obj : zutil.h zlib.h zconf.h +deflate.obj : deflate.h zutil.h zlib.h zconf.h +example.obj : zlib.h zconf.h +gzio.obj : zutil.h zlib.h zconf.h +infblock.obj : zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h +infcodes.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h +inffast.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h +inflate.obj : zutil.h zlib.h zconf.h infblock.h +inftrees.obj : zutil.h zlib.h zconf.h inftrees.h +infutil.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h +minigzip.obj : zlib.h zconf.h +trees.obj : deflate.h zutil.h zlib.h zconf.h +uncompr.obj : zlib.h zconf.h +zutil.obj : zutil.h zlib.h zconf.h Index: xc/extras/zlib/example.c diff -u /dev/null xc/extras/zlib/example.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/example.c Sun Jun 1 17:00:14 2003 @@ -0,0 +1,556 @@ +/* example.c -- usage example of the zlib compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#include +#include "zlib.h" + +#ifdef STDC +# include +# include +#else + extern void exit OF((int)); +#endif + +#if defined(VMS) || defined(RISCOS) +# define TESTFILE "foo-gz" +#else +# define TESTFILE "foo.gz" +#endif + +#define CHECK_ERR(err, msg) { \ + if (err != Z_OK) { \ + fprintf(stderr, "%s error: %d\n", msg, err); \ + exit(1); \ + } \ +} + +const char hello[] = "hello, hello!"; +/* "hello world" would be more standard, but the repeated "hello" + * stresses the compression code better, sorry... + */ + +const char dictionary[] = "hello"; +uLong dictId; /* Adler32 value of the dictionary */ + +void test_compress OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_gzio OF((const char *out, const char *in, + Byte *uncompr, int uncomprLen)); +void test_deflate OF((Byte *compr, uLong comprLen)); +void test_inflate OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_large_deflate OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_large_inflate OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_flush OF((Byte *compr, uLong *comprLen)); +void test_sync OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_dict_deflate OF((Byte *compr, uLong comprLen)); +void test_dict_inflate OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +int main OF((int argc, char *argv[])); + +/* =========================================================================== + * Test compress() and uncompress() + */ +void test_compress(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + uLong len = strlen(hello)+1; + + err = compress(compr, &comprLen, (const Bytef*)hello, len); + CHECK_ERR(err, "compress"); + + strcpy((char*)uncompr, "garbage"); + + err = uncompress(uncompr, &uncomprLen, compr, comprLen); + CHECK_ERR(err, "uncompress"); + + if (strcmp((char*)uncompr, hello)) { + fprintf(stderr, "bad uncompress\n"); + exit(1); + } else { + printf("uncompress(): %s\n", (char *)uncompr); + } +} + +/* =========================================================================== + * Test read/write of .gz files + */ +void test_gzio(out, in, uncompr, uncomprLen) + const char *out; /* compressed output file */ + const char *in; /* compressed input file */ + Byte *uncompr; + int uncomprLen; +{ + int err; + int len = strlen(hello)+1; + gzFile file; + z_off_t pos; + + file = gzopen(out, "wb"); + if (file == NULL) { + fprintf(stderr, "gzopen error\n"); + exit(1); + } + gzputc(file, 'h'); + if (gzputs(file, "ello") != 4) { + fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err)); + exit(1); + } + if (gzprintf(file, ", %s!", "hello") != 8) { + fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err)); + exit(1); + } + gzseek(file, 1L, SEEK_CUR); /* add one zero byte */ + gzclose(file); + + file = gzopen(in, "rb"); + if (file == NULL) { + fprintf(stderr, "gzopen error\n"); + } + strcpy((char*)uncompr, "garbage"); + + uncomprLen = gzread(file, uncompr, (unsigned)uncomprLen); + if (uncomprLen != len) { + fprintf(stderr, "gzread err: %s\n", gzerror(file, &err)); + exit(1); + } + if (strcmp((char*)uncompr, hello)) { + fprintf(stderr, "bad gzread: %s\n", (char*)uncompr); + exit(1); + } else { + printf("gzread(): %s\n", (char *)uncompr); + } + + pos = gzseek(file, -8L, SEEK_CUR); + if (pos != 6 || gztell(file) != pos) { + fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n", + (long)pos, (long)gztell(file)); + exit(1); + } + + if (gzgetc(file) != ' ') { + fprintf(stderr, "gzgetc error\n"); + exit(1); + } + + gzgets(file, (char*)uncompr, uncomprLen); + uncomprLen = strlen((char*)uncompr); + if (uncomprLen != 6) { /* "hello!" */ + fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err)); + exit(1); + } + if (strcmp((char*)uncompr, hello+7)) { + fprintf(stderr, "bad gzgets after gzseek\n"); + exit(1); + } else { + printf("gzgets() after gzseek: %s\n", (char *)uncompr); + } + + gzclose(file); +} + +/* =========================================================================== + * Test deflate() with small buffers + */ +void test_deflate(compr, comprLen) + Byte *compr; + uLong comprLen; +{ + z_stream c_stream; /* compression stream */ + int err; + int len = strlen(hello)+1; + + c_stream.zalloc = (alloc_func)0; + c_stream.zfree = (free_func)0; + c_stream.opaque = (voidpf)0; + + err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); + CHECK_ERR(err, "deflateInit"); + + c_stream.next_in = (Bytef*)hello; + c_stream.next_out = compr; + + while (c_stream.total_in != (uLong)len && c_stream.total_out < comprLen) { + c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */ + err = deflate(&c_stream, Z_NO_FLUSH); + CHECK_ERR(err, "deflate"); + } + /* Finish the stream, still forcing small buffers: */ + for (;;) { + c_stream.avail_out = 1; + err = deflate(&c_stream, Z_FINISH); + if (err == Z_STREAM_END) break; + CHECK_ERR(err, "deflate"); + } + + err = deflateEnd(&c_stream); + CHECK_ERR(err, "deflateEnd"); +} + +/* =========================================================================== + * Test inflate() with small buffers + */ +void test_inflate(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + z_stream d_stream; /* decompression stream */ + + strcpy((char*)uncompr, "garbage"); + + d_stream.zalloc = (alloc_func)0; + d_stream.zfree = (free_func)0; + d_stream.opaque = (voidpf)0; + + d_stream.next_in = compr; + d_stream.avail_in = 0; + d_stream.next_out = uncompr; + + err = inflateInit(&d_stream); + CHECK_ERR(err, "inflateInit"); + + while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) { + d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */ + err = inflate(&d_stream, Z_NO_FLUSH); + if (err == Z_STREAM_END) break; + CHECK_ERR(err, "inflate"); + } + + err = inflateEnd(&d_stream); + CHECK_ERR(err, "inflateEnd"); + + if (strcmp((char*)uncompr, hello)) { + fprintf(stderr, "bad inflate\n"); + exit(1); + } else { + printf("inflate(): %s\n", (char *)uncompr); + } +} + +/* =========================================================================== + * Test deflate() with large buffers and dynamic change of compression level + */ +void test_large_deflate(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + z_stream c_stream; /* compression stream */ + int err; + + c_stream.zalloc = (alloc_func)0; + c_stream.zfree = (free_func)0; + c_stream.opaque = (voidpf)0; + + err = deflateInit(&c_stream, Z_BEST_SPEED); + CHECK_ERR(err, "deflateInit"); + + c_stream.next_out = compr; + c_stream.avail_out = (uInt)comprLen; + + /* At this point, uncompr is still mostly zeroes, so it should compress + * very well: + */ + c_stream.next_in = uncompr; + c_stream.avail_in = (uInt)uncomprLen; + err = deflate(&c_stream, Z_NO_FLUSH); + CHECK_ERR(err, "deflate"); + if (c_stream.avail_in != 0) { + fprintf(stderr, "deflate not greedy\n"); + exit(1); + } + + /* Feed in already compressed data and switch to no compression: */ + deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY); + c_stream.next_in = compr; + c_stream.avail_in = (uInt)comprLen/2; + err = deflate(&c_stream, Z_NO_FLUSH); + CHECK_ERR(err, "deflate"); + + /* Switch back to compressing mode: */ + deflateParams(&c_stream, Z_BEST_COMPRESSION, Z_FILTERED); + c_stream.next_in = uncompr; + c_stream.avail_in = (uInt)uncomprLen; + err = deflate(&c_stream, Z_NO_FLUSH); + CHECK_ERR(err, "deflate"); + + err = deflate(&c_stream, Z_FINISH); + if (err != Z_STREAM_END) { + fprintf(stderr, "deflate should report Z_STREAM_END\n"); + exit(1); + } + err = deflateEnd(&c_stream); + CHECK_ERR(err, "deflateEnd"); +} + +/* =========================================================================== + * Test inflate() with large buffers + */ +void test_large_inflate(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + z_stream d_stream; /* decompression stream */ + + strcpy((char*)uncompr, "garbage"); + + d_stream.zalloc = (alloc_func)0; + d_stream.zfree = (free_func)0; + d_stream.opaque = (voidpf)0; + + d_stream.next_in = compr; + d_stream.avail_in = (uInt)comprLen; + + err = inflateInit(&d_stream); + CHECK_ERR(err, "inflateInit"); + + for (;;) { + d_stream.next_out = uncompr; /* discard the output */ + d_stream.avail_out = (uInt)uncomprLen; + err = inflate(&d_stream, Z_NO_FLUSH); + if (err == Z_STREAM_END) break; + CHECK_ERR(err, "large inflate"); + } + + err = inflateEnd(&d_stream); + CHECK_ERR(err, "inflateEnd"); + + if (d_stream.total_out != 2*uncomprLen + comprLen/2) { + fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out); + exit(1); + } else { + printf("large_inflate(): OK\n"); + } +} + +/* =========================================================================== + * Test deflate() with full flush + */ +void test_flush(compr, comprLen) + Byte *compr; + uLong *comprLen; +{ + z_stream c_stream; /* compression stream */ + int err; + int len = strlen(hello)+1; + + c_stream.zalloc = (alloc_func)0; + c_stream.zfree = (free_func)0; + c_stream.opaque = (voidpf)0; + + err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); + CHECK_ERR(err, "deflateInit"); + + c_stream.next_in = (Bytef*)hello; + c_stream.next_out = compr; + c_stream.avail_in = 3; + c_stream.avail_out = (uInt)*comprLen; + err = deflate(&c_stream, Z_FULL_FLUSH); + CHECK_ERR(err, "deflate"); + + compr[3]++; /* force an error in first compressed block */ + c_stream.avail_in = len - 3; + + err = deflate(&c_stream, Z_FINISH); + if (err != Z_STREAM_END) { + CHECK_ERR(err, "deflate"); + } + err = deflateEnd(&c_stream); + CHECK_ERR(err, "deflateEnd"); + + *comprLen = c_stream.total_out; +} + +/* =========================================================================== + * Test inflateSync() + */ +void test_sync(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + z_stream d_stream; /* decompression stream */ + + strcpy((char*)uncompr, "garbage"); + + d_stream.zalloc = (alloc_func)0; + d_stream.zfree = (free_func)0; + d_stream.opaque = (voidpf)0; + + d_stream.next_in = compr; + d_stream.avail_in = 2; /* just read the zlib header */ + + err = inflateInit(&d_stream); + CHECK_ERR(err, "inflateInit"); + + d_stream.next_out = uncompr; + d_stream.avail_out = (uInt)uncomprLen; + + inflate(&d_stream, Z_NO_FLUSH); + CHECK_ERR(err, "inflate"); + + d_stream.avail_in = (uInt)comprLen-2; /* read all compressed data */ + err = inflateSync(&d_stream); /* but skip the damaged part */ + CHECK_ERR(err, "inflateSync"); + + err = inflate(&d_stream, Z_FINISH); + if (err != Z_DATA_ERROR) { + fprintf(stderr, "inflate should report DATA_ERROR\n"); + /* Because of incorrect adler32 */ + exit(1); + } + err = inflateEnd(&d_stream); + CHECK_ERR(err, "inflateEnd"); + + printf("after inflateSync(): hel%s\n", (char *)uncompr); +} + +/* =========================================================================== + * Test deflate() with preset dictionary + */ +void test_dict_deflate(compr, comprLen) + Byte *compr; + uLong comprLen; +{ + z_stream c_stream; /* compression stream */ + int err; + + c_stream.zalloc = (alloc_func)0; + c_stream.zfree = (free_func)0; + c_stream.opaque = (voidpf)0; + + err = deflateInit(&c_stream, Z_BEST_COMPRESSION); + CHECK_ERR(err, "deflateInit"); + + err = deflateSetDictionary(&c_stream, + (const Bytef*)dictionary, sizeof(dictionary)); + CHECK_ERR(err, "deflateSetDictionary"); + + dictId = c_stream.adler; + c_stream.next_out = compr; + c_stream.avail_out = (uInt)comprLen; + + c_stream.next_in = (Bytef*)hello; + c_stream.avail_in = (uInt)strlen(hello)+1; + + err = deflate(&c_stream, Z_FINISH); + if (err != Z_STREAM_END) { + fprintf(stderr, "deflate should report Z_STREAM_END\n"); + exit(1); + } + err = deflateEnd(&c_stream); + CHECK_ERR(err, "deflateEnd"); +} + +/* =========================================================================== + * Test inflate() with a preset dictionary + */ +void test_dict_inflate(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + z_stream d_stream; /* decompression stream */ + + strcpy((char*)uncompr, "garbage"); + + d_stream.zalloc = (alloc_func)0; + d_stream.zfree = (free_func)0; + d_stream.opaque = (voidpf)0; + + d_stream.next_in = compr; + d_stream.avail_in = (uInt)comprLen; + + err = inflateInit(&d_stream); + CHECK_ERR(err, "inflateInit"); + + d_stream.next_out = uncompr; + d_stream.avail_out = (uInt)uncomprLen; + + for (;;) { + err = inflate(&d_stream, Z_NO_FLUSH); + if (err == Z_STREAM_END) break; + if (err == Z_NEED_DICT) { + if (d_stream.adler != dictId) { + fprintf(stderr, "unexpected dictionary"); + exit(1); + } + err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary, + sizeof(dictionary)); + } + CHECK_ERR(err, "inflate with dict"); + } + + err = inflateEnd(&d_stream); + CHECK_ERR(err, "inflateEnd"); + + if (strcmp((char*)uncompr, hello)) { + fprintf(stderr, "bad inflate with dict\n"); + exit(1); + } else { + printf("inflate with dictionary: %s\n", (char *)uncompr); + } +} + +/* =========================================================================== + * Usage: example [output.gz [input.gz]] + */ + +int main(argc, argv) + int argc; + char *argv[]; +{ + Byte *compr, *uncompr; + uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */ + uLong uncomprLen = comprLen; + static const char* myVersion = ZLIB_VERSION; + + if (zlibVersion()[0] != myVersion[0]) { + fprintf(stderr, "incompatible zlib version\n"); + exit(1); + + } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) { + fprintf(stderr, "warning: different zlib version\n"); + } + + compr = (Byte*)calloc((uInt)comprLen, 1); + uncompr = (Byte*)calloc((uInt)uncomprLen, 1); + /* compr and uncompr are cleared to avoid reading uninitialized + * data and to ensure that uncompr compresses well. + */ + if (compr == Z_NULL || uncompr == Z_NULL) { + printf("out of memory\n"); + exit(1); + } + test_compress(compr, comprLen, uncompr, uncomprLen); + + test_gzio((argc > 1 ? argv[1] : TESTFILE), + (argc > 2 ? argv[2] : TESTFILE), + uncompr, (int)uncomprLen); + + test_deflate(compr, comprLen); + test_inflate(compr, comprLen, uncompr, uncomprLen); + + test_large_deflate(compr, comprLen, uncompr, uncomprLen); + test_large_inflate(compr, comprLen, uncompr, uncomprLen); + + test_flush(compr, &comprLen); + test_sync(compr, comprLen, uncompr, uncomprLen); + comprLen = uncomprLen; + + test_dict_deflate(compr, comprLen); + test_dict_inflate(compr, comprLen, uncompr, uncomprLen); + + exit(0); + return 0; /* to avoid warning */ +} Index: xc/extras/zlib/gzio.c diff -u /dev/null xc/extras/zlib/gzio.c:1.4 --- /dev/null Sat Feb 28 21:40:43 2004 +++ xc/extras/zlib/gzio.c Sun Jun 1 18:05:22 2003 @@ -0,0 +1,872 @@ +/* gzio.c -- IO on .gz files + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + * + * Compile this file with -DNO_DEFLATE to avoid the compression code. + */ +/* $XFree86: xc/extras/zlib/gzio.c,v 1.4 2003/06/01 22:05:22 herrb Exp $ */ + +#include + +#include "zutil.h" + +struct internal_state {int dummy;}; /* for buggy compilers */ + +#ifndef Z_BUFSIZE +# ifdef MAXSEG_64K +# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */ +# else +# define Z_BUFSIZE 16384 +# endif +#endif +#ifndef Z_PRINTF_BUFSIZE +# define Z_PRINTF_BUFSIZE 4096 +#endif + +#define ALLOC(size) malloc(size) +#define TRYFREE(p) {if (p) free(p);} + +static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ + +/* gzip flag byte */ +#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ +#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ +#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ +#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ +#define COMMENT 0x10 /* bit 4 set: file comment present */ +#define RESERVED 0xE0 /* bits 5..7: reserved */ + +typedef struct gz_stream { + z_stream stream; + int z_err; /* error code for last stream operation */ + int z_eof; /* set if end of input file */ + FILE *file; /* .gz file */ + Byte *inbuf; /* input buffer */ + Byte *outbuf; /* output buffer */ + uLong crc; /* crc32 of uncompressed data */ + char *msg; /* error message */ + char *path; /* path name for debugging only */ + int transparent; /* 1 if input file is not a .gz file */ + char mode; /* 'w' or 'r' */ + long startpos; /* start of compressed data in file (header skipped) */ +} gz_stream; + + +local gzFile gz_open OF((const char *path, const char *mode, int fd)); +local int do_flush OF((gzFile file, int flush)); +local int get_byte OF((gz_stream *s)); +local void check_header OF((gz_stream *s)); +local int destroy OF((gz_stream *s)); +local void putLong OF((FILE *file, uLong x)); +local uLong getLong OF((gz_stream *s)); + +/* =========================================================================== + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb"). The file is given either by file descriptor + or path name (if fd == -1). + gz_open return NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). +*/ +local gzFile gz_open (path, mode, fd) + const char *path; + const char *mode; + int fd; +{ + int err; + int level = Z_DEFAULT_COMPRESSION; /* compression level */ + int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */ + char *p = (char*)mode; + gz_stream *s; + char fmode[80]; /* copy of mode, without the compression level */ + char *m = fmode; + + if (!path || !mode) return Z_NULL; + + s = (gz_stream *)ALLOC(sizeof(gz_stream)); + if (!s) return Z_NULL; + + s->stream.zalloc = (alloc_func)0; + s->stream.zfree = (free_func)0; + s->stream.opaque = (voidpf)0; + s->stream.next_in = s->inbuf = Z_NULL; + s->stream.next_out = s->outbuf = Z_NULL; + s->stream.avail_in = s->stream.avail_out = 0; + s->file = NULL; + s->z_err = Z_OK; + s->z_eof = 0; + s->crc = crc32(0L, Z_NULL, 0); + s->msg = NULL; + s->transparent = 0; + + s->path = (char*)ALLOC(strlen(path)+1); + if (s->path == NULL) { + return destroy(s), (gzFile)Z_NULL; + } + strcpy(s->path, path); /* do this early for debugging */ + + s->mode = '\0'; + do { + if (*p == 'r') s->mode = 'r'; + if (*p == 'w' || *p == 'a') s->mode = 'w'; + if (*p >= '0' && *p <= '9') { + level = *p - '0'; + } else if (*p == 'f') { + strategy = Z_FILTERED; + } else if (*p == 'h') { + strategy = Z_HUFFMAN_ONLY; + } else { + *m++ = *p; /* copy the mode */ + } + } while (*p++ && m != fmode + sizeof(fmode)); + if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL; + + if (s->mode == 'w') { +#ifdef NO_DEFLATE + err = Z_STREAM_ERROR; +#else + err = deflateInit2(&(s->stream), level, + Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy); + /* windowBits is passed < 0 to suppress zlib header */ + + s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); +#endif + if (err != Z_OK || s->outbuf == Z_NULL) { + return destroy(s), (gzFile)Z_NULL; + } + } else { + s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); + + err = inflateInit2(&(s->stream), -MAX_WBITS); + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are + * present after the compressed stream. + */ + if (err != Z_OK || s->inbuf == Z_NULL) { + return destroy(s), (gzFile)Z_NULL; + } + } + s->stream.avail_out = Z_BUFSIZE; + + errno = 0; + s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode); + + if (s->file == NULL) { + return destroy(s), (gzFile)Z_NULL; + } + if (s->mode == 'w') { + /* Write a very simple .gz header: + */ + fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1], + Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE); + s->startpos = 10L; + /* We use 10L instead of ftell(s->file) to because ftell causes an + * fflush on some systems. This version of the library doesn't use + * startpos anyway in write mode, so this initialization is not + * necessary. + */ + } else { + check_header(s); /* skip the .gz header */ + s->startpos = (ftell(s->file) - s->stream.avail_in); + } + + return (gzFile)s; +} + +/* =========================================================================== + Opens a gzip (.gz) file for reading or writing. +*/ +gzFile ZEXPORT gzopen (path, mode) + const char *path; + const char *mode; +{ + return gz_open (path, mode, -1); +} + +/* =========================================================================== + Associate a gzFile with the file descriptor fd. fd is not dup'ed here + to mimic the behavio(u)r of fdopen. +*/ +gzFile ZEXPORT gzdopen (fd, mode) + int fd; + const char *mode; +{ + char name[20]; + + if (fd < 0) return (gzFile)Z_NULL; + sprintf(name, "", fd); /* for debugging */ + + return gz_open (name, mode, fd); +} + +/* =========================================================================== + * Update the compression level and strategy + */ +int ZEXPORT gzsetparams (file, level, strategy) + gzFile file; + int level; + int strategy; +{ + gz_stream *s = (gz_stream*)file; + + if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; + + /* Make room to allow flushing */ + if (s->stream.avail_out == 0) { + + s->stream.next_out = s->outbuf; + if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) { + s->z_err = Z_ERRNO; + } + s->stream.avail_out = Z_BUFSIZE; + } + + return deflateParams (&(s->stream), level, strategy); +} + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ +local int get_byte(s) + gz_stream *s; +{ + if (s->z_eof) return EOF; + if (s->stream.avail_in == 0) { + errno = 0; + s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file); + if (s->stream.avail_in == 0) { + s->z_eof = 1; + if (ferror(s->file)) s->z_err = Z_ERRNO; + return EOF; + } + s->stream.next_in = s->inbuf; + } + s->stream.avail_in--; + return *(s->stream.next_in)++; +} + +/* =========================================================================== + Check the gzip header of a gz_stream opened for reading. Set the stream + mode to transparent if the gzip magic header is not present; set s->err + to Z_DATA_ERROR if the magic header is present but the rest of the header + is incorrect. + IN assertion: the stream s has already been created sucessfully; + s->stream.avail_in is zero for the first time, but may be non-zero + for concatenated .gz files. +*/ +local void check_header(s) + gz_stream *s; +{ + int method; /* method byte */ + int flags; /* flags byte */ + uInt len; + int c; + + /* Check the gzip magic header */ + for (len = 0; len < 2; len++) { + c = get_byte(s); + if (c != gz_magic[len]) { + if (len != 0) s->stream.avail_in++, s->stream.next_in--; + if (c != EOF) { + s->stream.avail_in++, s->stream.next_in--; + s->transparent = 1; + } + s->z_err = s->stream.avail_in != 0 ? Z_OK : Z_STREAM_END; + return; + } + } + method = get_byte(s); + flags = get_byte(s); + if (method != Z_DEFLATED || (flags & RESERVED) != 0) { + s->z_err = Z_DATA_ERROR; + return; + } + + /* Discard time, xflags and OS code: */ + for (len = 0; len < 6; len++) (void)get_byte(s); + + if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */ + len = (uInt)get_byte(s); + len += ((uInt)get_byte(s))<<8; + /* len is garbage if EOF but the loop below will quit anyway */ + while (len-- != 0 && get_byte(s) != EOF) ; + } + if ((flags & ORIG_NAME) != 0) { /* skip the original file name */ + while ((c = get_byte(s)) != 0 && c != EOF) ; + } + if ((flags & COMMENT) != 0) { /* skip the .gz file comment */ + while ((c = get_byte(s)) != 0 && c != EOF) ; + } + if ((flags & HEAD_CRC) != 0) { /* skip the header crc */ + for (len = 0; len < 2; len++) (void)get_byte(s); + } + s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK; +} + + /* =========================================================================== + * Cleanup then free the given gz_stream. Return a zlib error code. + Try freeing in the reverse order of allocations. + */ +local int destroy (s) + gz_stream *s; +{ + int err = Z_OK; + + if (!s) return Z_STREAM_ERROR; + + TRYFREE(s->msg); + + if (s->stream.state != NULL) { + if (s->mode == 'w') { +#ifdef NO_DEFLATE + err = Z_STREAM_ERROR; +#else + err = deflateEnd(&(s->stream)); +#endif + } else if (s->mode == 'r') { + err = inflateEnd(&(s->stream)); + } + } + if (s->file != NULL && fclose(s->file)) { +#ifdef ESPIPE + if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */ +#endif + err = Z_ERRNO; + } + if (s->z_err < 0) err = s->z_err; + + TRYFREE(s->inbuf); + TRYFREE(s->outbuf); + TRYFREE(s->path); + TRYFREE(s); + return err; +} + +/* =========================================================================== + Reads the given number of uncompressed bytes from the compressed file. + gzread returns the number of bytes actually read (0 for end of file). +*/ +int ZEXPORT gzread (file, buf, len) + gzFile file; + voidp buf; + unsigned len; +{ + gz_stream *s = (gz_stream*)file; + Bytef *start = (Bytef*)buf; /* starting point for crc computation */ + Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ + + if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR; + + if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1; + if (s->z_err == Z_STREAM_END) return 0; /* EOF */ + + next_out = (Byte*)buf; + s->stream.next_out = (Bytef*)buf; + s->stream.avail_out = len; + + while (s->stream.avail_out != 0) { + + if (s->transparent) { + /* Copy first the lookahead bytes: */ + uInt n = s->stream.avail_in; + if (n > s->stream.avail_out) n = s->stream.avail_out; + if (n > 0) { + zmemcpy(s->stream.next_out, s->stream.next_in, n); + next_out += n; + s->stream.next_out = next_out; + s->stream.next_in += n; + s->stream.avail_out -= n; + s->stream.avail_in -= n; + } + if (s->stream.avail_out > 0) { + s->stream.avail_out -= fread(next_out, 1, s->stream.avail_out, + s->file); + } + len -= s->stream.avail_out; + s->stream.total_in += (uLong)len; + s->stream.total_out += (uLong)len; + if (len == 0) s->z_eof = 1; + return (int)len; + } + if (s->stream.avail_in == 0 && !s->z_eof) { + + errno = 0; + s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file); + if (s->stream.avail_in == 0) { + s->z_eof = 1; + if (ferror(s->file)) { + s->z_err = Z_ERRNO; + break; + } + } + s->stream.next_in = s->inbuf; + } + s->z_err = inflate(&(s->stream), Z_NO_FLUSH); + + if (s->z_err == Z_STREAM_END) { + /* Check CRC and original size */ + s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); + start = s->stream.next_out; + + if (getLong(s) != s->crc) { + s->z_err = Z_DATA_ERROR; + } else { + (void)getLong(s); + /* The uncompressed length returned by above getlong() may + * be different from s->stream.total_out) in case of + * concatenated .gz files. Check for such files: + */ + check_header(s); + if (s->z_err == Z_OK) { + uLong total_in = s->stream.total_in; + uLong total_out = s->stream.total_out; + + inflateReset(&(s->stream)); + s->stream.total_in = total_in; + s->stream.total_out = total_out; + s->crc = crc32(0L, Z_NULL, 0); + } + } + } + if (s->z_err != Z_OK || s->z_eof) break; + } + s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); + + return (int)(len - s->stream.avail_out); +} + + +/* =========================================================================== + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ +int ZEXPORT gzgetc(file) + gzFile file; +{ + unsigned char c; + + return gzread(file, &c, 1) == 1 ? c : -1; +} + + +/* =========================================================================== + Reads bytes from the compressed file until len-1 characters are + read, or a newline character is read and transferred to buf, or an + end-of-file condition is encountered. The string is then terminated + with a null character. + gzgets returns buf, or Z_NULL in case of error. + + The current implementation is not optimized at all. +*/ +char * ZEXPORT gzgets(file, buf, len) + gzFile file; + char *buf; + int len; +{ + char *b = buf; + if (buf == Z_NULL || len <= 0) return Z_NULL; + + while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ; + *buf = '\0'; + return b == buf && len > 0 ? Z_NULL : b; +} + + +#ifndef NO_DEFLATE +/* =========================================================================== + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of bytes actually written (0 in case of error). +*/ +int ZEXPORT gzwrite (file, buf, len) + gzFile file; + const voidp buf; + unsigned len; +{ + gz_stream *s = (gz_stream*)file; + + if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; + + s->stream.next_in = (Bytef*)buf; + s->stream.avail_in = len; + + while (s->stream.avail_in != 0) { + + if (s->stream.avail_out == 0) { + + s->stream.next_out = s->outbuf; + if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) { + s->z_err = Z_ERRNO; + break; + } + s->stream.avail_out = Z_BUFSIZE; + } + s->z_err = deflate(&(s->stream), Z_NO_FLUSH); + if (s->z_err != Z_OK) break; + } + s->crc = crc32(s->crc, (const Bytef *)buf, len); + + return (int)(len - s->stream.avail_in); +} + +/* =========================================================================== + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ +#ifdef STDC +#include + +int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...) +{ + char buf[Z_PRINTF_BUFSIZE]; + va_list va; + int len; + + va_start(va, format); +#ifdef HAS_vsnprintf + len = vsnprintf(buf, sizeof(buf), format, va); +#else + len = vsprintf(buf, format, va); +#endif + va_end(va); + if ((len <= 0) || (len >= Z_PRINTF_BUFSIZE)) return 0; + + return gzwrite(file, buf, (unsigned)len); +} +#else /* not ANSI C */ + +int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, + a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) + gzFile file; + const char *format; + int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, + a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; +{ + char buf[Z_PRINTF_BUFSIZE]; + int len; + +#ifdef HAS_snprintf + len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8, + a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); +#else + len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8, + a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); +#endif + if ((len <= 0) || (len >= Z_PRINTF_BUFSIZE)) return 0; + + return gzwrite(file, buf, len); +} +#endif + +/* =========================================================================== + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ +int ZEXPORT gzputc(file, c) + gzFile file; + int c; +{ + unsigned char cc = (unsigned char) c; /* required for big endian systems */ + + return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1; +} + + +/* =========================================================================== + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ +int ZEXPORT gzputs(file, s) + gzFile file; + const char *s; +{ + return gzwrite(file, (char*)s, (unsigned)strlen(s)); +} + + +/* =========================================================================== + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. +*/ +local int do_flush (file, flush) + gzFile file; + int flush; +{ + uInt len; + int done = 0; + gz_stream *s = (gz_stream*)file; + + if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; + + s->stream.avail_in = 0; /* should be zero already anyway */ + + for (;;) { + len = Z_BUFSIZE - s->stream.avail_out; + + if (len != 0) { + if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) { + s->z_err = Z_ERRNO; + return Z_ERRNO; + } + s->stream.next_out = s->outbuf; + s->stream.avail_out = Z_BUFSIZE; + } + if (done) break; + s->z_err = deflate(&(s->stream), flush); + + /* Ignore the second of two consecutive flushes: */ + if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK; + + /* deflate has finished flushing only when it hasn't used up + * all the available space in the output buffer: + */ + done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END); + + if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break; + } + return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; +} + +int ZEXPORT gzflush (file, flush) + gzFile file; + int flush; +{ + gz_stream *s = (gz_stream*)file; + int err = do_flush (file, flush); + + if (err) return err; + fflush(s->file); + return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; +} +#endif /* NO_DEFLATE */ + +/* =========================================================================== + Sets the starting position for the next gzread or gzwrite on the given + compressed file. The offset represents a number of bytes in the + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error. + SEEK_END is not implemented, returns error. + In this version of the library, gzseek can be extremely slow. +*/ +z_off_t ZEXPORT gzseek (file, offset, whence) + gzFile file; + z_off_t offset; + int whence; +{ + gz_stream *s = (gz_stream*)file; + + if (s == NULL || whence == SEEK_END || + s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) { + return -1L; + } + + if (s->mode == 'w') { +#ifdef NO_DEFLATE + return -1L; +#else + if (whence == SEEK_SET) { + offset -= s->stream.total_in; + } + if (offset < 0) return -1L; + + /* At this point, offset is the number of zero bytes to write. */ + if (s->inbuf == Z_NULL) { + s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */ + zmemzero(s->inbuf, Z_BUFSIZE); + } + while (offset > 0) { + uInt size = Z_BUFSIZE; + if (offset < Z_BUFSIZE) size = (uInt)offset; + + size = gzwrite(file, s->inbuf, size); + if (size == 0) return -1L; + + offset -= size; + } + return (z_off_t)s->stream.total_in; +#endif + } + /* Rest of function is for reading only */ + + /* compute absolute position */ + if (whence == SEEK_CUR) { + offset += s->stream.total_out; + } + if (offset < 0) return -1L; + + if (s->transparent) { + /* map to fseek */ + s->stream.avail_in = 0; + s->stream.next_in = s->inbuf; + if (fseek(s->file, offset, SEEK_SET) < 0) return -1L; + + s->stream.total_in = s->stream.total_out = (uLong)offset; + return offset; + } + + /* For a negative seek, rewind and use positive seek */ + if ((uLong)offset >= s->stream.total_out) { + offset -= s->stream.total_out; + } else if (gzrewind(file) < 0) { + return -1L; + } + /* offset is now the number of bytes to skip. */ + + if (offset != 0 && s->outbuf == Z_NULL) { + s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); + } + while (offset > 0) { + int size = Z_BUFSIZE; + if (offset < Z_BUFSIZE) size = (int)offset; + + size = gzread(file, s->outbuf, (uInt)size); + if (size <= 0) return -1L; + offset -= size; + } + return (z_off_t)s->stream.total_out; +} + +/* =========================================================================== + Rewinds input file. +*/ +int ZEXPORT gzrewind (file) + gzFile file; +{ + gz_stream *s = (gz_stream*)file; + + if (s == NULL || s->mode != 'r') return -1; + + s->z_err = Z_OK; + s->z_eof = 0; + s->stream.avail_in = 0; + s->stream.next_in = s->inbuf; + s->crc = crc32(0L, Z_NULL, 0); + + if (s->startpos == 0) { /* not a compressed file */ + rewind(s->file); + return 0; + } + + (void) inflateReset(&s->stream); + return fseek(s->file, s->startpos, SEEK_SET); +} + +/* =========================================================================== + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. +*/ +z_off_t ZEXPORT gztell (file) + gzFile file; +{ + return gzseek(file, 0L, SEEK_CUR); +} + +/* =========================================================================== + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ +int ZEXPORT gzeof (file) + gzFile file; +{ + gz_stream *s = (gz_stream*)file; + + return (s == NULL || s->mode != 'r') ? 0 : s->z_eof; +} + +/* =========================================================================== + Outputs a long in LSB order to the given file +*/ +local void putLong (file, x) + FILE *file; + uLong x; +{ + int n; + for (n = 0; n < 4; n++) { + fputc((int)(x & 0xff), file); + x >>= 8; + } +} + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets z_err in case + of error. +*/ +local uLong getLong (s) + gz_stream *s; +{ + uLong x = (uLong)get_byte(s); + int c; + + x += ((uLong)get_byte(s))<<8; + x += ((uLong)get_byte(s))<<16; + c = get_byte(s); + if (c == EOF) s->z_err = Z_DATA_ERROR; + x += ((uLong)c)<<24; + return x; +} + +/* =========================================================================== + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. +*/ +int ZEXPORT gzclose (file) + gzFile file; +{ + int err; + gz_stream *s = (gz_stream*)file; + + if (s == NULL) return Z_STREAM_ERROR; + + if (s->mode == 'w') { +#ifdef NO_DEFLATE + return Z_STREAM_ERROR; +#else + err = do_flush (file, Z_FINISH); + if (err != Z_OK) return destroy((gz_stream*)file); + + putLong (s->file, s->crc); + putLong (s->file, s->stream.total_in); +#endif + } + return destroy((gz_stream*)file); +} + +/* =========================================================================== + Returns the error message for the last error which occured on the + given compressed file. errnum is set to zlib error number. If an + error occured in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ +const char* ZEXPORT gzerror (file, errnum) + gzFile file; + int *errnum; +{ + char *m; + gz_stream *s = (gz_stream*)file; + + if (s == NULL) { + *errnum = Z_STREAM_ERROR; + return (const char*)ERR_MSG(Z_STREAM_ERROR); + } + *errnum = s->z_err; + if (*errnum == Z_OK) return (const char*)""; + + m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg); + + if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err); + + TRYFREE(s->msg); + s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3); + strcpy(s->msg, s->path); + strcat(s->msg, ": "); + strcat(s->msg, m); + return (const char*)s->msg; +} Index: xc/extras/zlib/infblock.c diff -u /dev/null xc/extras/zlib/infblock.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/infblock.c Sun Jun 1 17:00:16 2003 @@ -0,0 +1,403 @@ +/* infblock.c -- interpret and process block types to last block + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infblock.h" +#include "inftrees.h" +#include "infcodes.h" +#include "infutil.h" + +struct inflate_codes_state {int dummy;}; /* for buggy compilers */ + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +/* Table for deflate from PKZIP's appnote.txt. */ +local const uInt border[] = { /* Order of the bit length code lengths */ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + +/* + Notes beyond the 1.93a appnote.txt: + + 1. Distance pointers never point before the beginning of the output + stream. + 2. Distance pointers can point back across blocks, up to 32k away. + 3. There is an implied maximum of 7 bits for the bit length table and + 15 bits for the actual data. + 4. If only one code exists, then it is encoded using one bit. (Zero + would be more efficient, but perhaps a little confusing.) If two + codes exist, they are coded using one bit each (0 and 1). + 5. There is no way of sending zero distance codes--a dummy must be + sent if there are none. (History: a pre 2.0 version of PKZIP would + store blocks with no distance codes, but this was discovered to be + too harsh a criterion.) Valid only for 1.93a. 2.04c does allow + zero distance codes, which is sent as one code of zero bits in + length. + 6. There are up to 286 literal/length codes. Code 256 represents the + end-of-block. Note however that the static length tree defines + 288 codes just to fill out the Huffman codes. Codes 286 and 287 + cannot be used though, since there is no length base or extra bits + defined for them. Similarily, there are up to 30 distance codes. + However, static trees define 32 codes (all 5 bits) to fill out the + Huffman codes, but the last two had better not show up in the data. + 7. Unzip can check dynamic Huffman blocks for complete code sets. + The exception is that a single code would not be complete (see #4). + 8. The five bits following the block type is really the number of + literal codes sent minus 257. + 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits + (1+6+6). Therefore, to output three times the length, you output + three codes (1+1+1), whereas to output four times the same length, + you only need two codes (1+3). Hmm. + 10. In the tree reconstruction algorithm, Code = Code + Increment + only if BitLength(i) is not zero. (Pretty obvious.) + 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) + 12. Note: length code 284 can represent 227-258, but length code 285 + really is 258. The last length deserves its own, short code + since it gets used a lot in very redundant files. The length + 258 is special since 258 - 3 (the min match length) is 255. + 13. The literal/length and distance code bit lengths are read as a + single stream of lengths. It is possible (and advantageous) for + a repeat code (16, 17, or 18) to go across the boundary between + the two sets of lengths. + */ + + +void inflate_blocks_reset(s, z, c) +inflate_blocks_statef *s; +z_streamp z; +uLongf *c; +{ + if (c != Z_NULL) + *c = s->check; + if (s->mode == BTREE || s->mode == DTREE) + ZFREE(z, s->sub.trees.blens); + if (s->mode == CODES) + inflate_codes_free(s->sub.decode.codes, z); + s->mode = TYPE; + s->bitk = 0; + s->bitb = 0; + s->read = s->write = s->window; + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0); + Tracev((stderr, "inflate: blocks reset\n")); +} + + +inflate_blocks_statef *inflate_blocks_new(z, c, w) +z_streamp z; +check_func c; +uInt w; +{ + inflate_blocks_statef *s; + + if ((s = (inflate_blocks_statef *)ZALLOC + (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL) + return s; + if ((s->hufts = + (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL) + { + ZFREE(z, s); + return Z_NULL; + } + if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL) + { + ZFREE(z, s->hufts); + ZFREE(z, s); + return Z_NULL; + } + s->end = s->window + w; + s->checkfn = c; + s->mode = TYPE; + Tracev((stderr, "inflate: blocks allocated\n")); + inflate_blocks_reset(s, z, Z_NULL); + return s; +} + + +int inflate_blocks(s, z, r) +inflate_blocks_statef *s; +z_streamp z; +int r; +{ + uInt t; /* temporary storage */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Bytef *p; /* input data pointer */ + uInt n; /* bytes available there */ + Bytef *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input based on current state */ + while (1) switch (s->mode) + { + case TYPE: + NEEDBITS(3) + t = (uInt)b & 7; + s->last = t & 1; + switch (t >> 1) + { + case 0: /* stored */ + Tracev((stderr, "inflate: stored block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + t = k & 7; /* go to byte boundary */ + DUMPBITS(t) + s->mode = LENS; /* get length of stored block */ + break; + case 1: /* fixed */ + Tracev((stderr, "inflate: fixed codes block%s\n", + s->last ? " (last)" : "")); + { + uInt bl, bd; + inflate_huft *tl, *td; + + inflate_trees_fixed(&bl, &bd, &tl, &td, z); + s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); + if (s->sub.decode.codes == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + } + DUMPBITS(3) + s->mode = CODES; + break; + case 2: /* dynamic */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + s->mode = TABLE; + break; + case 3: /* illegal */ + DUMPBITS(3) + s->mode = BAD; + z->msg = (char*)"invalid block type"; + r = Z_DATA_ERROR; + LEAVE + } + break; + case LENS: + NEEDBITS(32) + if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) + { + s->mode = BAD; + z->msg = (char*)"invalid stored block lengths"; + r = Z_DATA_ERROR; + LEAVE + } + s->sub.left = (uInt)b & 0xffff; + b = k = 0; /* dump bits */ + Tracev((stderr, "inflate: stored length %u\n", s->sub.left)); + s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE); + break; + case STORED: + if (n == 0) + LEAVE + NEEDOUT + t = s->sub.left; + if (t > n) t = n; + if (t > m) t = m; + zmemcpy(q, p, t); + p += t; n -= t; + q += t; m -= t; + if ((s->sub.left -= t) != 0) + break; + Tracev((stderr, "inflate: stored end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + s->mode = s->last ? DRY : TYPE; + break; + case TABLE: + NEEDBITS(14) + s->sub.trees.table = t = (uInt)b & 0x3fff; +#ifndef PKZIP_BUG_WORKAROUND + if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) + { + s->mode = BAD; + z->msg = (char*)"too many length or distance symbols"; + r = Z_DATA_ERROR; + LEAVE + } +#endif + t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); + if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + DUMPBITS(14) + s->sub.trees.index = 0; + Tracev((stderr, "inflate: table sizes ok\n")); + s->mode = BTREE; + case BTREE: + while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) + { + NEEDBITS(3) + s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7; + DUMPBITS(3) + } + while (s->sub.trees.index < 19) + s->sub.trees.blens[border[s->sub.trees.index++]] = 0; + s->sub.trees.bb = 7; + t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, + &s->sub.trees.tb, s->hufts, z); + if (t != Z_OK) + { + r = t; + if (r == Z_DATA_ERROR) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + } + LEAVE + } + s->sub.trees.index = 0; + Tracev((stderr, "inflate: bits tree ok\n")); + s->mode = DTREE; + case DTREE: + while (t = s->sub.trees.table, + s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) + { + inflate_huft *h; + uInt i, j, c; + + t = s->sub.trees.bb; + NEEDBITS(t) + h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); + t = h->bits; + c = h->base; + if (c < 16) + { + DUMPBITS(t) + s->sub.trees.blens[s->sub.trees.index++] = c; + } + else /* c == 16..18 */ + { + i = c == 18 ? 7 : c - 14; + j = c == 18 ? 11 : 3; + NEEDBITS(t + i) + DUMPBITS(t) + j += (uInt)b & inflate_mask[i]; + DUMPBITS(i) + i = s->sub.trees.index; + t = s->sub.trees.table; + if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || + (c == 16 && i < 1)) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + z->msg = (char*)"invalid bit length repeat"; + r = Z_DATA_ERROR; + LEAVE + } + c = c == 16 ? s->sub.trees.blens[i - 1] : 0; + do { + s->sub.trees.blens[i++] = c; + } while (--j); + s->sub.trees.index = i; + } + } + s->sub.trees.tb = Z_NULL; + { + uInt bl, bd; + inflate_huft *tl, *td; + inflate_codes_statef *c; + + bl = 9; /* must be <= 9 for lookahead assumptions */ + bd = 6; /* must be <= 9 for lookahead assumptions */ + t = s->sub.trees.table; + t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), + s->sub.trees.blens, &bl, &bd, &tl, &td, + s->hufts, z); + if (t != Z_OK) + { + if (t == (uInt)Z_DATA_ERROR) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + } + r = t; + LEAVE + } + Tracev((stderr, "inflate: trees ok\n")); + if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + s->sub.decode.codes = c; + } + ZFREE(z, s->sub.trees.blens); + s->mode = CODES; + case CODES: + UPDATE + if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) + return inflate_flush(s, z, r); + r = Z_OK; + inflate_codes_free(s->sub.decode.codes, z); + LOAD + Tracev((stderr, "inflate: codes end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + if (!s->last) + { + s->mode = TYPE; + break; + } + s->mode = DRY; + case DRY: + FLUSH + if (s->read != s->write) + LEAVE + s->mode = DONE; + case DONE: + r = Z_STREAM_END; + LEAVE + case BAD: + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +} + + +int inflate_blocks_free(s, z) +inflate_blocks_statef *s; +z_streamp z; +{ + inflate_blocks_reset(s, z, Z_NULL); + ZFREE(z, s->window); + ZFREE(z, s->hufts); + ZFREE(z, s); + Tracev((stderr, "inflate: blocks freed\n")); + return Z_OK; +} + + +void inflate_set_dictionary(s, d, n) +inflate_blocks_statef *s; +const Bytef *d; +uInt n; +{ + zmemcpy(s->window, d, n); + s->read = s->write = s->window + n; +} + + +/* Returns true if inflate is currently at the end of a block generated + * by Z_SYNC_FLUSH or Z_FULL_FLUSH. + * IN assertion: s != Z_NULL + */ +int inflate_blocks_sync_point(s) +inflate_blocks_statef *s; +{ + return s->mode == LENS; +} Index: xc/extras/zlib/infblock.h diff -u /dev/null xc/extras/zlib/infblock.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/infblock.h Sun Jun 1 17:00:16 2003 @@ -0,0 +1,39 @@ +/* infblock.h -- header to use infblock.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +struct inflate_blocks_state; +typedef struct inflate_blocks_state FAR inflate_blocks_statef; + +extern inflate_blocks_statef * inflate_blocks_new OF(( + z_streamp z, + check_func c, /* check function */ + uInt w)); /* window size */ + +extern int inflate_blocks OF(( + inflate_blocks_statef *, + z_streamp , + int)); /* initial return code */ + +extern void inflate_blocks_reset OF(( + inflate_blocks_statef *, + z_streamp , + uLongf *)); /* check value on output */ + +extern int inflate_blocks_free OF(( + inflate_blocks_statef *, + z_streamp)); + +extern void inflate_set_dictionary OF(( + inflate_blocks_statef *s, + const Bytef *d, /* dictionary */ + uInt n)); /* dictionary length */ + +extern int inflate_blocks_sync_point OF(( + inflate_blocks_statef *s)); Index: xc/extras/zlib/infcodes.c diff -u /dev/null xc/extras/zlib/infcodes.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/infcodes.c Sun Jun 1 17:00:16 2003 @@ -0,0 +1,251 @@ +/* infcodes.c -- process literals and length/distance pairs + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" +#include "infblock.h" +#include "infcodes.h" +#include "infutil.h" +#include "inffast.h" + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + START, /* x: set up for LEN */ + LEN, /* i: get length/literal/eob next */ + LENEXT, /* i: getting length extra (have base) */ + DIST, /* i: get distance next */ + DISTEXT, /* i: getting distance extra */ + COPY, /* o: copying bytes in window, waiting for space */ + LIT, /* o: got literal, waiting for output space */ + WASH, /* o: got eob, possibly still output waiting */ + END, /* x: got eob and all data flushed */ + BADCODE} /* x: got error */ +inflate_codes_mode; + +/* inflate codes private state */ +struct inflate_codes_state { + + /* mode */ + inflate_codes_mode mode; /* current inflate_codes mode */ + + /* mode dependent information */ + uInt len; + union { + struct { + inflate_huft *tree; /* pointer into tree */ + uInt need; /* bits needed */ + } code; /* if LEN or DIST, where in tree */ + uInt lit; /* if LIT, literal */ + struct { + uInt get; /* bits to get for extra */ + uInt dist; /* distance back to copy from */ + } copy; /* if EXT or COPY, where and how much */ + } sub; /* submode */ + + /* mode independent information */ + Byte lbits; /* ltree bits decoded per branch */ + Byte dbits; /* dtree bits decoder per branch */ + inflate_huft *ltree; /* literal/length/eob tree */ + inflate_huft *dtree; /* distance tree */ + +}; + + +inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z) +uInt bl, bd; +inflate_huft *tl; +inflate_huft *td; /* need separate declaration for Borland C++ */ +z_streamp z; +{ + inflate_codes_statef *c; + + if ((c = (inflate_codes_statef *) + ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL) + { + c->mode = START; + c->lbits = (Byte)bl; + c->dbits = (Byte)bd; + c->ltree = tl; + c->dtree = td; + Tracev((stderr, "inflate: codes new\n")); + } + return c; +} + + +int inflate_codes(s, z, r) +inflate_blocks_statef *s; +z_streamp z; +int r; +{ + uInt j; /* temporary storage */ + inflate_huft *t; /* temporary pointer */ + uInt e; /* extra bits or operation */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Bytef *p; /* input data pointer */ + uInt n; /* bytes available there */ + Bytef *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + Bytef *f; /* pointer to copy strings from */ + inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input and output based on current state */ + while (1) switch (c->mode) + { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + case START: /* x: set up for LEN */ +#ifndef SLOW + if (m >= 258 && n >= 10) + { + UPDATE + r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); + LOAD + if (r != Z_OK) + { + c->mode = r == Z_STREAM_END ? WASH : BADCODE; + break; + } + } +#endif /* !SLOW */ + c->sub.code.need = c->lbits; + c->sub.code.tree = c->ltree; + c->mode = LEN; + case LEN: /* i: get length/literal/eob next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e == 0) /* literal */ + { + c->sub.lit = t->base; + Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", t->base)); + c->mode = LIT; + break; + } + if (e & 16) /* length */ + { + c->sub.copy.get = e & 15; + c->len = t->base; + c->mode = LENEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + if (e & 32) /* end of block */ + { + Tracevv((stderr, "inflate: end of block\n")); + c->mode = WASH; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid literal/length code"; + r = Z_DATA_ERROR; + LEAVE + case LENEXT: /* i: getting length extra (have base) */ + j = c->sub.copy.get; + NEEDBITS(j) + c->len += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + c->sub.code.need = c->dbits; + c->sub.code.tree = c->dtree; + Tracevv((stderr, "inflate: length %u\n", c->len)); + c->mode = DIST; + case DIST: /* i: get distance next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e & 16) /* distance */ + { + c->sub.copy.get = e & 15; + c->sub.copy.dist = t->base; + c->mode = DISTEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid distance code"; + r = Z_DATA_ERROR; + LEAVE + case DISTEXT: /* i: getting distance extra */ + j = c->sub.copy.get; + NEEDBITS(j) + c->sub.copy.dist += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist)); + c->mode = COPY; + case COPY: /* o: copying bytes in window, waiting for space */ + f = q - c->sub.copy.dist; + while (f < s->window) /* modulo window size-"while" instead */ + f += s->end - s->window; /* of "if" handles invalid distances */ + while (c->len) + { + NEEDOUT + OUTBYTE(*f++) + if (f == s->end) + f = s->window; + c->len--; + } + c->mode = START; + break; + case LIT: /* o: got literal, waiting for output space */ + NEEDOUT + OUTBYTE(c->sub.lit) + c->mode = START; + break; + case WASH: /* o: got eob, possibly more output */ + if (k > 7) /* return unused byte, if any */ + { + Assert(k < 16, "inflate_codes grabbed too many bytes") + k -= 8; + n++; + p--; /* can always return one */ + } + FLUSH + if (s->read != s->write) + LEAVE + c->mode = END; + case END: + r = Z_STREAM_END; + LEAVE + case BADCODE: /* x: got error */ + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + + +void inflate_codes_free(c, z) +inflate_codes_statef *c; +z_streamp z; +{ + ZFREE(z, c); + Tracev((stderr, "inflate: codes free\n")); +} Index: xc/extras/zlib/infcodes.h diff -u /dev/null xc/extras/zlib/infcodes.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/infcodes.h Sun Jun 1 17:00:16 2003 @@ -0,0 +1,27 @@ +/* infcodes.h -- header to use infcodes.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +struct inflate_codes_state; +typedef struct inflate_codes_state FAR inflate_codes_statef; + +extern inflate_codes_statef *inflate_codes_new OF(( + uInt, uInt, + inflate_huft *, inflate_huft *, + z_streamp )); + +extern int inflate_codes OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +extern void inflate_codes_free OF(( + inflate_codes_statef *, + z_streamp )); + Index: xc/extras/zlib/inffast.c diff -u /dev/null xc/extras/zlib/inffast.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/inffast.c Sun Jun 1 17:00:16 2003 @@ -0,0 +1,183 @@ +/* inffast.c -- process literals and length/distance pairs fast + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" +#include "infblock.h" +#include "infcodes.h" +#include "infutil.h" +#include "inffast.h" + +struct inflate_codes_state {int dummy;}; /* for buggy compilers */ + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +/* macros for bit input with no checking and for returning unused bytes */ +#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;} + +/* Called with number of bytes left to write in window at least 258 + (the maximum string length) and number of input bytes available + at least ten. The ten bytes are six bytes for the longest length/ + distance pair plus four bytes for overloading the bit buffer. */ + +int inflate_fast(bl, bd, tl, td, s, z) +uInt bl, bd; +inflate_huft *tl; +inflate_huft *td; /* need separate declaration for Borland C++ */ +inflate_blocks_statef *s; +z_streamp z; +{ + inflate_huft *t; /* temporary pointer */ + uInt e; /* extra bits or operation */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Bytef *p; /* input data pointer */ + uInt n; /* bytes available there */ + Bytef *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + uInt ml; /* mask for literal/length tree */ + uInt md; /* mask for distance tree */ + uInt c; /* bytes to copy */ + uInt d; /* distance back to copy from */ + Bytef *r; /* copy source pointer */ + + /* load input, output, bit values */ + LOAD + + /* initialize masks */ + ml = inflate_mask[bl]; + md = inflate_mask[bd]; + + /* do until not enough input or output space for fast loop */ + do { /* assume called with m >= 258 && n >= 10 */ + /* get literal/length code */ + GRABBITS(20) /* max bits for literal/length code */ + if ((e = (t = tl + ((uInt)b & ml))->exop) == 0) + { + DUMPBITS(t->bits) + Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? + "inflate: * literal '%c'\n" : + "inflate: * literal 0x%02x\n", t->base)); + *q++ = (Byte)t->base; + m--; + continue; + } + do { + DUMPBITS(t->bits) + if (e & 16) + { + /* get extra bits for length */ + e &= 15; + c = t->base + ((uInt)b & inflate_mask[e]); + DUMPBITS(e) + Tracevv((stderr, "inflate: * length %u\n", c)); + + /* decode distance base of block to copy */ + GRABBITS(15); /* max bits for distance code */ + e = (t = td + ((uInt)b & md))->exop; + do { + DUMPBITS(t->bits) + if (e & 16) + { + /* get extra bits to add to distance base */ + e &= 15; + GRABBITS(e) /* get extra bits (up to 13) */ + d = t->base + ((uInt)b & inflate_mask[e]); + DUMPBITS(e) + Tracevv((stderr, "inflate: * distance %u\n", d)); + + /* do the copy */ + m -= c; + r = q - d; + if (r < s->window) /* wrap if needed */ + { + do { + r += s->end - s->window; /* force pointer in window */ + } while (r < s->window); /* covers invalid distances */ + e = s->end - r; + if (c > e) + { + c -= e; /* wrapped copy */ + do { + *q++ = *r++; + } while (--e); + r = s->window; + do { + *q++ = *r++; + } while (--c); + } + else /* normal copy */ + { + *q++ = *r++; c--; + *q++ = *r++; c--; + do { + *q++ = *r++; + } while (--c); + } + } + else /* normal copy */ + { + *q++ = *r++; c--; + *q++ = *r++; c--; + do { + *q++ = *r++; + } while (--c); + } + break; + } + else if ((e & 64) == 0) + { + t += t->base; + e = (t += ((uInt)b & inflate_mask[e]))->exop; + } + else + { + z->msg = (char*)"invalid distance code"; + UNGRAB + UPDATE + return Z_DATA_ERROR; + } + } while (1); + break; + } + if ((e & 64) == 0) + { + t += t->base; + if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0) + { + DUMPBITS(t->bits) + Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? + "inflate: * literal '%c'\n" : + "inflate: * literal 0x%02x\n", t->base)); + *q++ = (Byte)t->base; + m--; + break; + } + } + else if (e & 32) + { + Tracevv((stderr, "inflate: * end of block\n")); + UNGRAB + UPDATE + return Z_STREAM_END; + } + else + { + z->msg = (char*)"invalid literal/length code"; + UNGRAB + UPDATE + return Z_DATA_ERROR; + } + } while (1); + } while (m >= 258 && n >= 10); + + /* not enough input or output--restore pointers and return */ + UNGRAB + UPDATE + return Z_OK; +} Index: xc/extras/zlib/inffast.h diff -u /dev/null xc/extras/zlib/inffast.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/inffast.h Sun Jun 1 17:00:16 2003 @@ -0,0 +1,17 @@ +/* inffast.h -- header to use inffast.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +extern int inflate_fast OF(( + uInt, + uInt, + inflate_huft *, + inflate_huft *, + inflate_blocks_statef *, + z_streamp )); Index: xc/extras/zlib/inffixed.h diff -u /dev/null xc/extras/zlib/inffixed.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/inffixed.h Sun Jun 1 17:00:16 2003 @@ -0,0 +1,151 @@ +/* inffixed.h -- table for decoding fixed codes + * Generated automatically by the maketree.c program + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +local uInt fixed_bl = 9; +local uInt fixed_bd = 5; +local inflate_huft fixed_tl[] = { + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254}, + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} + }; +local inflate_huft fixed_td[] = { + {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, + {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, + {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, + {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577}, + {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145}, + {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, + {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, + {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} + }; Index: xc/extras/zlib/inflate.c diff -u /dev/null xc/extras/zlib/inflate.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/inflate.c Sun Jun 1 17:00:17 2003 @@ -0,0 +1,366 @@ +/* inflate.c -- zlib interface to inflate modules + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infblock.h" + +struct inflate_blocks_state {int dummy;}; /* for buggy compilers */ + +typedef enum { + METHOD, /* waiting for method byte */ + FLAG, /* waiting for flag byte */ + DICT4, /* four dictionary check bytes to go */ + DICT3, /* three dictionary check bytes to go */ + DICT2, /* two dictionary check bytes to go */ + DICT1, /* one dictionary check byte to go */ + DICT0, /* waiting for inflateSetDictionary */ + BLOCKS, /* decompressing blocks */ + CHECK4, /* four check bytes to go */ + CHECK3, /* three check bytes to go */ + CHECK2, /* two check bytes to go */ + CHECK1, /* one check byte to go */ + DONE, /* finished check, done */ + BAD} /* got an error--stay here */ +inflate_mode; + +/* inflate private state */ +struct internal_state { + + /* mode */ + inflate_mode mode; /* current inflate mode */ + + /* mode dependent information */ + union { + uInt method; /* if FLAGS, method byte */ + struct { + uLong was; /* computed check value */ + uLong need; /* stream check value */ + } check; /* if CHECK, check values to compare */ + uInt marker; /* if BAD, inflateSync's marker bytes count */ + } sub; /* submode */ + + /* mode independent information */ + int nowrap; /* flag for no wrapper */ + uInt wbits; /* log2(window size) (8..15, defaults to 15) */ + inflate_blocks_statef + *blocks; /* current inflate_blocks state */ + +}; + + +int ZEXPORT inflateReset(z) +z_streamp z; +{ + if (z == Z_NULL || z->state == Z_NULL) + return Z_STREAM_ERROR; + z->total_in = z->total_out = 0; + z->msg = Z_NULL; + z->state->mode = z->state->nowrap ? BLOCKS : METHOD; + inflate_blocks_reset(z->state->blocks, z, Z_NULL); + Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + + +int ZEXPORT inflateEnd(z) +z_streamp z; +{ + if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL) + return Z_STREAM_ERROR; + if (z->state->blocks != Z_NULL) + inflate_blocks_free(z->state->blocks, z); + ZFREE(z, z->state); + z->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} + + +int ZEXPORT inflateInit2_(z, w, version, stream_size) +z_streamp z; +int w; +const char *version; +int stream_size; +{ + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != sizeof(z_stream)) + return Z_VERSION_ERROR; + + /* initialize state */ + if (z == Z_NULL) + return Z_STREAM_ERROR; + z->msg = Z_NULL; + if (z->zalloc == Z_NULL) + { + z->zalloc = zcalloc; + z->opaque = (voidpf)0; + } + if (z->zfree == Z_NULL) z->zfree = zcfree; + if ((z->state = (struct internal_state FAR *) + ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL) + return Z_MEM_ERROR; + z->state->blocks = Z_NULL; + + /* handle undocumented nowrap option (no zlib header or check) */ + z->state->nowrap = 0; + if (w < 0) + { + w = - w; + z->state->nowrap = 1; + } + + /* set window size */ + if (w < 8 || w > 15) + { + inflateEnd(z); + return Z_STREAM_ERROR; + } + z->state->wbits = (uInt)w; + + /* create inflate_blocks state */ + if ((z->state->blocks = + inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w)) + == Z_NULL) + { + inflateEnd(z); + return Z_MEM_ERROR; + } + Tracev((stderr, "inflate: allocated\n")); + + /* reset state */ + inflateReset(z); + return Z_OK; +} + + +int ZEXPORT inflateInit_(z, version, stream_size) +z_streamp z; +const char *version; +int stream_size; +{ + return inflateInit2_(z, DEF_WBITS, version, stream_size); +} + + +#define NEEDBYTE {if(z->avail_in==0)return r;r=f;} +#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) + +int ZEXPORT inflate(z, f) +z_streamp z; +int f; +{ + int r; + uInt b; + + if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL) + return Z_STREAM_ERROR; + f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK; + r = Z_BUF_ERROR; + while (1) switch (z->state->mode) + { + case METHOD: + NEEDBYTE + if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED) + { + z->state->mode = BAD; + z->msg = (char*)"unknown compression method"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + if ((z->state->sub.method >> 4) + 8 > z->state->wbits) + { + z->state->mode = BAD; + z->msg = (char*)"invalid window size"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + z->state->mode = FLAG; + case FLAG: + NEEDBYTE + b = NEXTBYTE; + if (((z->state->sub.method << 8) + b) % 31) + { + z->state->mode = BAD; + z->msg = (char*)"incorrect header check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev((stderr, "inflate: zlib header ok\n")); + if (!(b & PRESET_DICT)) + { + z->state->mode = BLOCKS; + break; + } + z->state->mode = DICT4; + case DICT4: + NEEDBYTE + z->state->sub.check.need = (uLong)NEXTBYTE << 24; + z->state->mode = DICT3; + case DICT3: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 16; + z->state->mode = DICT2; + case DICT2: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 8; + z->state->mode = DICT1; + case DICT1: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE; + z->adler = z->state->sub.check.need; + z->state->mode = DICT0; + return Z_NEED_DICT; + case DICT0: + z->state->mode = BAD; + z->msg = (char*)"need dictionary"; + z->state->sub.marker = 0; /* can try inflateSync */ + return Z_STREAM_ERROR; + case BLOCKS: + r = inflate_blocks(z->state->blocks, z, r); + if (r == Z_DATA_ERROR) + { + z->state->mode = BAD; + z->state->sub.marker = 0; /* can try inflateSync */ + break; + } + if (r == Z_OK) + r = f; + if (r != Z_STREAM_END) + return r; + r = f; + inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); + if (z->state->nowrap) + { + z->state->mode = DONE; + break; + } + z->state->mode = CHECK4; + case CHECK4: + NEEDBYTE + z->state->sub.check.need = (uLong)NEXTBYTE << 24; + z->state->mode = CHECK3; + case CHECK3: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 16; + z->state->mode = CHECK2; + case CHECK2: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 8; + z->state->mode = CHECK1; + case CHECK1: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE; + + if (z->state->sub.check.was != z->state->sub.check.need) + { + z->state->mode = BAD; + z->msg = (char*)"incorrect data check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev((stderr, "inflate: zlib check ok\n")); + z->state->mode = DONE; + case DONE: + return Z_STREAM_END; + case BAD: + return Z_DATA_ERROR; + default: + return Z_STREAM_ERROR; + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + + +int ZEXPORT inflateSetDictionary(z, dictionary, dictLength) +z_streamp z; +const Bytef *dictionary; +uInt dictLength; +{ + uInt length = dictLength; + + if (z == Z_NULL || z->state == Z_NULL || z->state->mode != DICT0) + return Z_STREAM_ERROR; + + if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR; + z->adler = 1L; + + if (length >= ((uInt)1<state->wbits)) + { + length = (1<state->wbits)-1; + dictionary += dictLength - length; + } + inflate_set_dictionary(z->state->blocks, dictionary, length); + z->state->mode = BLOCKS; + return Z_OK; +} + + +int ZEXPORT inflateSync(z) +z_streamp z; +{ + uInt n; /* number of bytes to look at */ + Bytef *p; /* pointer to bytes */ + uInt m; /* number of marker bytes found in a row */ + uLong r, w; /* temporaries to save total_in and total_out */ + + /* set up */ + if (z == Z_NULL || z->state == Z_NULL) + return Z_STREAM_ERROR; + if (z->state->mode != BAD) + { + z->state->mode = BAD; + z->state->sub.marker = 0; + } + if ((n = z->avail_in) == 0) + return Z_BUF_ERROR; + p = z->next_in; + m = z->state->sub.marker; + + /* search */ + while (n && m < 4) + { + static const Byte mark[4] = {0, 0, 0xff, 0xff}; + if (*p == mark[m]) + m++; + else if (*p) + m = 0; + else + m = 4 - m; + p++, n--; + } + + /* restore */ + z->total_in += p - z->next_in; + z->next_in = p; + z->avail_in = n; + z->state->sub.marker = m; + + /* return no joy or set up to restart on a new block */ + if (m != 4) + return Z_DATA_ERROR; + r = z->total_in; w = z->total_out; + inflateReset(z); + z->total_in = r; z->total_out = w; + z->state->mode = BLOCKS; + return Z_OK; +} + + +/* Returns true if inflate is currently at the end of a block generated + * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP + * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH + * but removes the length bytes of the resulting empty stored block. When + * decompressing, PPP checks that at the end of input packet, inflate is + * waiting for these length bytes. + */ +int ZEXPORT inflateSyncPoint(z) +z_streamp z; +{ + if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL) + return Z_STREAM_ERROR; + return inflate_blocks_sync_point(z->state->blocks); +} Index: xc/extras/zlib/inftrees.c diff -u /dev/null xc/extras/zlib/inftrees.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/inftrees.c Sun Jun 1 17:00:17 2003 @@ -0,0 +1,454 @@ +/* inftrees.c -- generate Huffman trees for efficient decoding + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" + +#if !defined(BUILDFIXED) && !defined(STDC) +# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */ +#endif + +const char inflate_copyright[] = + " inflate 1.1.4 Copyright 1995-2002 Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ +struct internal_state {int dummy;}; /* for buggy compilers */ + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + + +local int huft_build OF(( + uIntf *, /* code lengths in bits */ + uInt, /* number of codes */ + uInt, /* number of "simple" codes */ + const uIntf *, /* list of base values for non-simple codes */ + const uIntf *, /* list of extra bits for non-simple codes */ + inflate_huft * FAR*,/* result: starting table */ + uIntf *, /* maximum lookup bits (returns actual) */ + inflate_huft *, /* space for trees */ + uInt *, /* hufts used in space */ + uIntf * )); /* space for values */ + +/* Tables for deflate from PKZIP's appnote.txt. */ +local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + /* see note #13 above about 258 */ +local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */ +local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; +local const uInt cpdext[30] = { /* Extra bits for distance codes */ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + +/* + Huffman code decoding is performed using a multi-level table lookup. + The fastest way to decode is to simply build a lookup table whose + size is determined by the longest code. However, the time it takes + to build this table can also be a factor if the data being decoded + is not very long. The most common codes are necessarily the + shortest codes, so those codes dominate the decoding time, and hence + the speed. The idea is you can have a shorter table that decodes the + shorter, more probable codes, and then point to subsidiary tables for + the longer codes. The time it costs to decode the longer codes is + then traded against the time it takes to make longer tables. + + This results of this trade are in the variables lbits and dbits + below. lbits is the number of bits the first level table for literal/ + length codes can decode in one step, and dbits is the same thing for + the distance codes. Subsequent tables are also less than or equal to + those sizes. These values may be adjusted either when all of the + codes are shorter than that, in which case the longest code length in + bits is used, or when the shortest code is *longer* than the requested + table size, in which case the length of the shortest code in bits is + used. + + There are two different values for the two tables, since they code a + different number of possibilities each. The literal/length table + codes 286 possible values, or in a flat code, a little over eight + bits. The distance table codes 30 possible values, or a little less + than five bits, flat. The optimum values for speed end up being + about one bit more than those, so lbits is 8+1 and dbits is 5+1. + The optimum values may differ though from machine to machine, and + possibly even between compilers. Your mileage may vary. + */ + + +/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */ +#define BMAX 15 /* maximum bit length of any code */ + +local int huft_build(b, n, s, d, e, t, m, hp, hn, v) +uIntf *b; /* code lengths in bits (all assumed <= BMAX) */ +uInt n; /* number of codes (assumed <= 288) */ +uInt s; /* number of simple-valued codes (0..s-1) */ +const uIntf *d; /* list of base values for non-simple codes */ +const uIntf *e; /* list of extra bits for non-simple codes */ +inflate_huft * FAR *t; /* result: starting table */ +uIntf *m; /* maximum lookup bits, returns actual */ +inflate_huft *hp; /* space for trees */ +uInt *hn; /* hufts used in space */ +uIntf *v; /* working area: values in order of bit length */ +/* Given a list of code lengths and a maximum table size, make a set of + tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + if the given code set is incomplete (the tables are still built in this + case), or Z_DATA_ERROR if the input is invalid. */ +{ + + uInt a; /* counter for codes of length k */ + uInt c[BMAX+1]; /* bit length count table */ + uInt f; /* i repeats in table every f entries */ + int g; /* maximum code length */ + int h; /* table level */ + register uInt i; /* counter, current code */ + register uInt j; /* counter */ + register int k; /* number of bits in current code */ + int l; /* bits per table (returned in m) */ + uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ + register uIntf *p; /* pointer into c[], b[], or v[] */ + inflate_huft *q; /* points to current table */ + struct inflate_huft_s r; /* table entry for structure assignment */ + inflate_huft *u[BMAX]; /* table stack */ + register int w; /* bits before this table == (l * h) */ + uInt x[BMAX+1]; /* bit offsets, then code stack */ + uIntf *xp; /* pointer into x */ + int y; /* number of dummy codes added */ + uInt z; /* number of entries in current table */ + + + /* Generate counts for each bit length */ + p = c; +#define C0 *p++ = 0; +#define C2 C0 C0 C0 C0 +#define C4 C2 C2 C2 C2 + C4 /* clear c[]--assume BMAX+1 is 16 */ + p = b; i = n; + do { + c[*p++]++; /* assume all entries <= BMAX */ + } while (--i); + if (c[0] == n) /* null input--all zero length codes */ + { + *t = (inflate_huft *)Z_NULL; + *m = 0; + return Z_OK; + } + + + /* Find minimum and maximum length, bound *m by those */ + l = *m; + for (j = 1; j <= BMAX; j++) + if (c[j]) + break; + k = j; /* minimum code length */ + if ((uInt)l < j) + l = j; + for (i = BMAX; i; i--) + if (c[i]) + break; + g = i; /* maximum code length */ + if ((uInt)l > i) + l = i; + *m = l; + + + /* Adjust last length count to fill out codes, if needed */ + for (y = 1 << j; j < i; j++, y <<= 1) + if ((y -= c[j]) < 0) + return Z_DATA_ERROR; + if ((y -= c[i]) < 0) + return Z_DATA_ERROR; + c[i] += y; + + + /* Generate starting offsets into the value table for each length */ + x[1] = j = 0; + p = c + 1; xp = x + 2; + while (--i) { /* note that i == g from above */ + *xp++ = (j += *p++); + } + + + /* Make a table of values in order of bit lengths */ + p = b; i = 0; + do { + if ((j = *p++) != 0) + v[x[j]++] = i; + } while (++i < n); + n = x[g]; /* set n to length of v */ + + + /* Generate the Huffman codes and for each, make the table entries */ + x[0] = i = 0; /* first Huffman code is zero */ + p = v; /* grab values in bit order */ + h = -1; /* no tables yet--level -1 */ + w = -l; /* bits decoded == (l * h) */ + u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */ + q = (inflate_huft *)Z_NULL; /* ditto */ + z = 0; /* ditto */ + + /* go through the bit lengths (k already is bits in shortest code) */ + for (; k <= g; k++) + { + a = c[k]; + while (a--) + { + /* here i is the Huffman code of length k bits for value *p */ + /* make tables up to required level */ + while (k > w + l) + { + h++; + w += l; /* previous table always l bits */ + + /* compute minimum size table less than or equal to l bits */ + z = g - w; + z = z > (uInt)l ? l : z; /* table size upper limit */ + if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ + { /* too few codes for k-w bit table */ + f -= a + 1; /* deduct codes from patterns left */ + xp = c + k; + if (j < z) + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } + } + z = 1 << j; /* table entries for j-bit table */ + + /* allocate new table */ + if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ + return Z_DATA_ERROR; /* overflow of MANY */ + u[h] = q = hp + *hn; + *hn += z; + + /* connect to last table, if there is one */ + if (h) + { + x[h] = i; /* save pattern for backing up */ + r.bits = (Byte)l; /* bits to dump before this table */ + r.exop = (Byte)j; /* bits in this table */ + j = i >> (w - l); + r.base = (uInt)(q - u[h-1] - j); /* offset to this table */ + u[h-1][j] = r; /* connect to last table */ + } + else + *t = q; /* first table is returned result */ + } + + /* set up table entry in r */ + r.bits = (Byte)(k - w); + if (p >= v + n) + r.exop = 128 + 64; /* out of values--invalid code */ + else if (*p < s) + { + r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */ + r.base = *p++; /* simple code is just the value */ + } + else + { + r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */ + r.base = d[*p++ - s]; + } + + /* fill code-like entries with r */ + f = 1 << (k - w); + for (j = i >> w; j < z; j += f) + q[j] = r; + + /* backwards increment the k-bit code i */ + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + i ^= j; + + /* backup over finished tables */ + mask = (1 << w) - 1; /* needed on HP, cc -O bug */ + while ((i & mask) != x[h]) + { + h--; /* don't need to update q */ + w -= l; + mask = (1 << w) - 1; + } + } + } + + + /* Return Z_BUF_ERROR if we were given an incomplete table */ + return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; +} + + +int inflate_trees_bits(c, bb, tb, hp, z) +uIntf *c; /* 19 code lengths */ +uIntf *bb; /* bits tree desired/actual depth */ +inflate_huft * FAR *tb; /* bits tree result */ +inflate_huft *hp; /* space for trees */ +z_streamp z; /* for messages */ +{ + int r; + uInt hn = 0; /* hufts used in space */ + uIntf *v; /* work area for huft_build */ + + if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, + tb, bb, hp, &hn, v); + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed dynamic bit lengths tree"; + else if (r == Z_BUF_ERROR || *bb == 0) + { + z->msg = (char*)"incomplete dynamic bit lengths tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +} + + +int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z) +uInt nl; /* number of literal/length codes */ +uInt nd; /* number of distance codes */ +uIntf *c; /* that many (total) code lengths */ +uIntf *bl; /* literal desired/actual bit depth */ +uIntf *bd; /* distance desired/actual bit depth */ +inflate_huft * FAR *tl; /* literal/length tree result */ +inflate_huft * FAR *td; /* distance tree result */ +inflate_huft *hp; /* space for trees */ +z_streamp z; /* for messages */ +{ + int r; + uInt hn = 0; /* hufts used in space */ + uIntf *v; /* work area for huft_build */ + + /* allocate work area */ + if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + + /* build literal/length tree */ + r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v); + if (r != Z_OK || *bl == 0) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed literal/length tree"; + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"incomplete literal/length tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; + } + + /* build distance tree */ + r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v); + if (r != Z_OK || (*bd == 0 && nl > 257)) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed distance tree"; + else if (r == Z_BUF_ERROR) { +#ifdef PKZIP_BUG_WORKAROUND + r = Z_OK; + } +#else + z->msg = (char*)"incomplete distance tree"; + r = Z_DATA_ERROR; + } + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"empty distance tree with lengths"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +#endif + } + + /* done */ + ZFREE(z, v); + return Z_OK; +} + + +/* build fixed tables only once--keep them here */ +#ifdef BUILDFIXED +local int fixed_built = 0; +#define FIXEDH 544 /* number of hufts used by fixed tables */ +local inflate_huft fixed_mem[FIXEDH]; +local uInt fixed_bl; +local uInt fixed_bd; +local inflate_huft *fixed_tl; +local inflate_huft *fixed_td; +#else +#include "inffixed.h" +#endif + + +int inflate_trees_fixed(bl, bd, tl, td, z) +uIntf *bl; /* literal desired/actual bit depth */ +uIntf *bd; /* distance desired/actual bit depth */ +inflate_huft * FAR *tl; /* literal/length tree result */ +inflate_huft * FAR *td; /* distance tree result */ +z_streamp z; /* for memory allocation */ +{ +#ifdef BUILDFIXED + /* build fixed tables if not already */ + if (!fixed_built) + { + int k; /* temporary variable */ + uInt f = 0; /* number of hufts used in fixed_mem */ + uIntf *c; /* length list for huft_build */ + uIntf *v; /* work area for huft_build */ + + /* allocate memory */ + if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + { + ZFREE(z, c); + return Z_MEM_ERROR; + } + + /* literal table */ + for (k = 0; k < 144; k++) + c[k] = 8; + for (; k < 256; k++) + c[k] = 9; + for (; k < 280; k++) + c[k] = 7; + for (; k < 288; k++) + c[k] = 8; + fixed_bl = 9; + huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, + fixed_mem, &f, v); + + /* distance table */ + for (k = 0; k < 30; k++) + c[k] = 5; + fixed_bd = 5; + huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, + fixed_mem, &f, v); + + /* done */ + ZFREE(z, v); + ZFREE(z, c); + fixed_built = 1; + } +#endif + *bl = fixed_bl; + *bd = fixed_bd; + *tl = fixed_tl; + *td = fixed_td; + return Z_OK; +} Index: xc/extras/zlib/inftrees.h diff -u /dev/null xc/extras/zlib/inftrees.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:44 2004 +++ xc/extras/zlib/inftrees.h Sun Jun 1 17:00:17 2003 @@ -0,0 +1,58 @@ +/* inftrees.h -- header to use inftrees.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Huffman code lookup table entry--this entry is four bytes for machines + that have 16-bit pointers (e.g. PC's in the small or medium model). */ + +typedef struct inflate_huft_s FAR inflate_huft; + +struct inflate_huft_s { + union { + struct { + Byte Exop; /* number of extra bits or operation */ + Byte Bits; /* number of bits in this code or subcode */ + } what; + uInt pad; /* pad structure to a power of 2 (4 bytes for */ + } word; /* 16-bit, 8 bytes for 32-bit int's) */ + uInt base; /* literal, length base, distance base, + or table offset */ +}; + +/* Maximum size of dynamic tree. The maximum found in a long but non- + exhaustive search was 1004 huft structures (850 for length/literals + and 154 for distances, the latter actually the result of an + exhaustive search). The actual maximum is not known, but the + value below is more than safe. */ +#define MANY 1440 + +extern int inflate_trees_bits OF(( + uIntf *, /* 19 code lengths */ + uIntf *, /* bits tree desired/actual depth */ + inflate_huft * FAR *, /* bits tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +extern int inflate_trees_dynamic OF(( + uInt, /* number of literal/length codes */ + uInt, /* number of distance codes */ + uIntf *, /* that many (total) code lengths */ + uIntf *, /* literal desired/actual bit depth */ + uIntf *, /* distance desired/actual bit depth */ + inflate_huft * FAR *, /* literal/length tree result */ + inflate_huft * FAR *, /* distance tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +extern int inflate_trees_fixed OF(( + uIntf *, /* literal desired/actual bit depth */ + uIntf *, /* distance desired/actual bit depth */ + inflate_huft * FAR *, /* literal/length tree result */ + inflate_huft * FAR *, /* distance tree result */ + z_streamp)); /* for memory allocation */ Index: xc/extras/zlib/infutil.c diff -u /dev/null xc/extras/zlib/infutil.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/infutil.c Sun Jun 1 17:00:17 2003 @@ -0,0 +1,87 @@ +/* inflate_util.c -- data and routines common to blocks and codes + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infblock.h" +#include "inftrees.h" +#include "infcodes.h" +#include "infutil.h" + +struct inflate_codes_state {int dummy;}; /* for buggy compilers */ + +/* And'ing with mask[n] masks the lower n bits */ +uInt inflate_mask[17] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + + +/* copy as much as possible from the sliding window to the output area */ +int inflate_flush(s, z, r) +inflate_blocks_statef *s; +z_streamp z; +int r; +{ + uInt n; + Bytef *p; + Bytef *q; + + /* local copies of source and destination pointers */ + p = z->next_out; + q = s->read; + + /* compute number of bytes to copy as far as end of window */ + n = (uInt)((q <= s->write ? s->write : s->end) - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy as far as end of window */ + zmemcpy(p, q, n); + p += n; + q += n; + + /* see if more to copy at beginning of window */ + if (q == s->end) + { + /* wrap pointers */ + q = s->window; + if (s->write == s->end) + s->write = s->window; + + /* compute bytes to copy */ + n = (uInt)(s->write - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy */ + zmemcpy(p, q, n); + p += n; + q += n; + } + + /* update pointers */ + z->next_out = p; + s->read = q; + + /* done */ + return r; +} Index: xc/extras/zlib/infutil.h diff -u /dev/null xc/extras/zlib/infutil.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/infutil.h Sun Jun 1 17:00:17 2003 @@ -0,0 +1,98 @@ +/* infutil.h -- types and macros common to blocks and codes + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFUTIL_H +#define _INFUTIL_H + +typedef enum { + TYPE, /* get type bits (3, including end bit) */ + LENS, /* get lengths for stored */ + STORED, /* processing stored block */ + TABLE, /* get table lengths */ + BTREE, /* get bit lengths tree for a dynamic block */ + DTREE, /* get length, distance trees for a dynamic block */ + CODES, /* processing fixed or dynamic block */ + DRY, /* output remaining window bytes */ + DONE, /* finished last block, done */ + BAD} /* got a data error--stuck here */ +inflate_block_mode; + +/* inflate blocks semi-private state */ +struct inflate_blocks_state { + + /* mode */ + inflate_block_mode mode; /* current inflate_block mode */ + + /* mode dependent information */ + union { + uInt left; /* if STORED, bytes left to copy */ + struct { + uInt table; /* table lengths (14 bits) */ + uInt index; /* index into blens (or border) */ + uIntf *blens; /* bit lengths of codes */ + uInt bb; /* bit length tree depth */ + inflate_huft *tb; /* bit length decoding tree */ + } trees; /* if DTREE, decoding info for trees */ + struct { + inflate_codes_statef + *codes; + } decode; /* if CODES, current state */ + } sub; /* submode */ + uInt last; /* true if this block is the last block */ + + /* mode independent information */ + uInt bitk; /* bits in bit buffer */ + uLong bitb; /* bit buffer */ + inflate_huft *hufts; /* single malloc for tree space */ + Bytef *window; /* sliding window */ + Bytef *end; /* one byte after sliding window */ + Bytef *read; /* window read pointer */ + Bytef *write; /* window write pointer */ + check_func checkfn; /* check function */ + uLong check; /* check on output */ + +}; + + +/* defines for inflate input/output */ +/* update pointers and return */ +#define UPDBITS {s->bitb=b;s->bitk=k;} +#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} +#define UPDOUT {s->write=q;} +#define UPDATE {UPDBITS UPDIN UPDOUT} +#define LEAVE {UPDATE return inflate_flush(s,z,r);} +/* get bytes and bits */ +#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} +#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} +#define NEXTBYTE (n--,*p++) +#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} +/* output bytes */ +#define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) +#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} +#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} +#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} +#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} +#define OUTBYTE(a) {*q++=(Byte)(a);m--;} +/* load local pointers */ +#define LOAD {LOADIN LOADOUT} + +/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ +extern uInt inflate_mask[17]; + +/* copy as much as possible from the sliding window to the output area */ +extern int inflate_flush OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +struct internal_state {int dummy;}; /* for buggy compilers */ + +#endif Index: xc/extras/zlib/maketree.c diff -u /dev/null xc/extras/zlib/maketree.c:1.1.1.1 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/maketree.c Sun Jun 1 17:00:17 2003 @@ -0,0 +1,85 @@ +/* maketree.c -- make inffixed.h table for decoding fixed codes + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* This program is included in the distribution for completeness. + You do not need to compile or run this program since inffixed.h + is already included in the distribution. To use this program + you need to compile zlib with BUILDFIXED defined and then compile + and link this program with the zlib library. Then the output of + this program can be piped to inffixed.h. */ + +#include +#include +#include "zutil.h" +#include "inftrees.h" + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +/* generate initialization table for an inflate_huft structure array */ +void maketree(uInt b, inflate_huft *t) +{ + int i, e; + + i = 0; + while (1) + { + e = t[i].exop; + if (e && (e & (16+64)) == 0) /* table pointer */ + { + fprintf(stderr, "maketree: cannot initialize sub-tables!\n"); + exit(1); + } + if (i % 4 == 0) + printf("\n "); + printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base); + if (++i == (1< +#include "zlib.h" + +#ifdef STDC +# include +# include +#else + extern void exit OF((int)); +#endif + +#ifdef USE_MMAP +# include +# include +# include +#endif + +#if defined(MSDOS) || defined(OS2) || defined(WIN32) +# include +# include +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) +#else +# define SET_BINARY_MODE(file) +#endif + +#ifdef VMS +# define unlink delete +# define GZ_SUFFIX "-gz" +#endif +#ifdef RISCOS +# define unlink remove +# define GZ_SUFFIX "-gz" +# define fileno(file) file->__file +#endif +#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fileno */ +#endif + +#ifndef WIN32 /* unlink already in stdio.h for WIN32 */ + extern int unlink OF((const char *)); +#endif + +#ifndef GZ_SUFFIX +# define GZ_SUFFIX ".gz" +#endif +#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1) + +#define BUFLEN 16384 +#define MAX_NAME_LEN 1024 + +#ifdef MAXSEG_64K +# define local static + /* Needed for systems with limitation on stack size. */ +#else +# define local +#endif + +char *prog; + +void error OF((const char *msg)); +void gz_compress OF((FILE *in, gzFile out)); +#ifdef USE_MMAP +int gz_compress_mmap OF((FILE *in, gzFile out)); +#endif +void gz_uncompress OF((gzFile in, FILE *out)); +void file_compress OF((char *file, char *mode)); +void file_uncompress OF((char *file)); +int main OF((int argc, char *argv[])); + +/* =========================================================================== + * Display error message and exit + */ +void error(msg) + const char *msg; +{ + fprintf(stderr, "%s: %s\n", prog, msg); + exit(1); +} + +/* =========================================================================== + * Compress input to output then close both files. + */ + +void gz_compress(in, out) + FILE *in; + gzFile out; +{ + local char buf[BUFLEN]; + int len; + int err; + +#ifdef USE_MMAP + /* Try first compressing with mmap. If mmap fails (minigzip used in a + * pipe), use the normal fread loop. + */ + if (gz_compress_mmap(in, out) == Z_OK) return; +#endif + for (;;) { + len = fread(buf, 1, sizeof(buf), in); + if (ferror(in)) { + perror("fread"); + exit(1); + } + if (len == 0) break; + + if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); + } + fclose(in); + if (gzclose(out) != Z_OK) error("failed gzclose"); +} + +#ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ + +/* Try compressing the input file at once using mmap. Return Z_OK if + * if success, Z_ERRNO otherwise. + */ +int gz_compress_mmap(in, out) + FILE *in; + gzFile out; +{ + int len; + int err; + int ifd = fileno(in); + caddr_t buf; /* mmap'ed buffer for the entire input file */ + off_t buf_len; /* length of the input file */ + struct stat sb; + + /* Determine the size of the file, needed for mmap: */ + if (fstat(ifd, &sb) < 0) return Z_ERRNO; + buf_len = sb.st_size; + if (buf_len <= 0) return Z_ERRNO; + + /* Now do the actual mmap: */ + buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0); + if (buf == (caddr_t)(-1)) return Z_ERRNO; + + /* Compress the whole file at once: */ + len = gzwrite(out, (char *)buf, (unsigned)buf_len); + + if (len != (int)buf_len) error(gzerror(out, &err)); + + munmap(buf, buf_len); + fclose(in); + if (gzclose(out) != Z_OK) error("failed gzclose"); + return Z_OK; +} +#endif /* USE_MMAP */ + +/* =========================================================================== + * Uncompress input to output then close both files. + */ +void gz_uncompress(in, out) + gzFile in; + FILE *out; +{ + local char buf[BUFLEN]; + int len; + int err; + + for (;;) { + len = gzread(in, buf, sizeof(buf)); + if (len < 0) error (gzerror(in, &err)); + if (len == 0) break; + + if ((int)fwrite(buf, 1, (unsigned)len, out) != len) { + error("failed fwrite"); + } + } + if (fclose(out)) error("failed fclose"); + + if (gzclose(in) != Z_OK) error("failed gzclose"); +} + + +/* =========================================================================== + * Compress the given file: create a corresponding .gz file and remove the + * original. + */ +void file_compress(file, mode) + char *file; + char *mode; +{ + local char outfile[MAX_NAME_LEN]; + FILE *in; + gzFile out; + + strcpy(outfile, file); + strcat(outfile, GZ_SUFFIX); + + in = fopen(file, "rb"); + if (in == NULL) { + perror(file); + exit(1); + } + out = gzopen(outfile, mode); + if (out == NULL) { + fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile); + exit(1); + } + gz_compress(in, out); + + unlink(file); +} + + +/* =========================================================================== + * Uncompress the given file and remove the original. + */ +void file_uncompress(file) + char *file; +{ + local char buf[MAX_NAME_LEN]; + char *infile, *outfile; + FILE *out; + gzFile in; + int len = strlen(file); + + strcpy(buf, file); + + if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { + infile = file; + outfile = buf; + outfile[len-3] = '\0'; + } else { + outfile = file; + infile = buf; + strcat(infile, GZ_SUFFIX); + } + in = gzopen(infile, "rb"); + if (in == NULL) { + fprintf(stderr, "%s: can't gzopen %s\n", prog, infile); + exit(1); + } + out = fopen(outfile, "wb"); + if (out == NULL) { + perror(file); + exit(1); + } + + gz_uncompress(in, out); + + unlink(infile); +} + + +/* =========================================================================== + * Usage: minigzip [-d] [-f] [-h] [-1 to -9] [files...] + * -d : decompress + * -f : compress with Z_FILTERED + * -h : compress with Z_HUFFMAN_ONLY + * -1 to -9 : compression level + */ + +int main(argc, argv) + int argc; + char *argv[]; +{ + int uncompr = 0; + gzFile file; + char outmode[20]; + + strcpy(outmode, "wb6 "); + + prog = argv[0]; + argc--, argv++; + + while (argc > 0) { + if (strcmp(*argv, "-d") == 0) + uncompr = 1; + else if (strcmp(*argv, "-f") == 0) + outmode[3] = 'f'; + else if (strcmp(*argv, "-h") == 0) + outmode[3] = 'h'; + else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' && + (*argv)[2] == 0) + outmode[2] = (*argv)[1]; + else + break; + argc--, argv++; + } + if (argc == 0) { + SET_BINARY_MODE(stdin); + SET_BINARY_MODE(stdout); + if (uncompr) { + file = gzdopen(fileno(stdin), "rb"); + if (file == NULL) error("can't gzdopen stdin"); + gz_uncompress(file, stdout); + } else { + file = gzdopen(fileno(stdout), outmode); + if (file == NULL) error("can't gzdopen stdout"); + gz_compress(stdin, file); + } + } else { + do { + if (uncompr) { + file_uncompress(*argv); + } else { + file_compress(*argv, outmode); + } + } while (argv++, --argc); + } + exit(0); + return 0; /* to avoid warning */ +} Index: xc/extras/zlib/trees.c diff -u /dev/null xc/extras/zlib/trees.c:1.2 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/trees.c Sun Jun 1 17:05:50 2003 @@ -0,0 +1,1212 @@ +/* trees.c -- output deflated data using Huffman coding + * Copyright (C) 1995-2002 Jean-loup Gailly + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * ALGORITHM + * + * The "deflation" process uses several Huffman trees. The more + * common source values are represented by shorter bit sequences. + * + * Each code tree is stored in a compressed form which is itself + * a Huffman encoding of the lengths of all the code strings (in + * ascending order by source values). The actual code strings are + * reconstructed from the lengths in the inflate process, as described + * in the deflate specification. + * + * REFERENCES + * + * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification". + * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc + * + * Storer, James A. + * Data Compression: Methods and Theory, pp. 49-50. + * Computer Science Press, 1988. ISBN 0-7167-8156-5. + * + * Sedgewick, R. + * Algorithms, p290. + * Addison-Wesley, 1983. ISBN 0-201-06672-6. + */ + +/* #define GEN_TREES_H */ + +#include "deflate.h" + +#ifdef DEBUG +# include +#endif + +/* =========================================================================== + * Constants + */ + +#define MAX_BL_BITS 7 +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +#define END_BLOCK 256 +/* end of block literal code */ + +#define REP_3_6 16 +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +#define REPZ_3_10 17 +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +#define REPZ_11_138 18 +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ + = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; + +local const int extra_dbits[D_CODES] /* extra bits for each distance code */ + = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ + = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; + +local const uch bl_order[BL_CODES] + = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +#define Buf_size (8 * 2*sizeof(char)) +/* Number of bits used within bi_buf. (bi_buf might be implemented on + * more than 16 bits on some systems.) + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ + +#if defined(GEN_TREES_H) || !defined(STDC) +/* non ANSI compilers may not accept trees.h */ + +local ct_data static_ltree[L_CODES+2]; +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +local ct_data static_dtree[D_CODES]; +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +uch _dist_code[DIST_CODE_LEN]; +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +uch _length_code[MAX_MATCH-MIN_MATCH+1]; +/* length code for each normalized match length (0 == MIN_MATCH) */ + +local int base_length[LENGTH_CODES]; +/* First normalized length for each code (0 = MIN_MATCH) */ + +local int base_dist[D_CODES]; +/* First normalized distance for each code (0 = distance of 1) */ + +#else +# include "trees.h" +#endif /* GEN_TREES_H */ + +struct static_tree_desc_s { + const ct_data *static_tree; /* static tree or NULL */ + const intf *extra_bits; /* extra bits for each code or NULL */ + int extra_base; /* base index for extra_bits */ + int elems; /* max number of elements in the tree */ + int max_length; /* max bit length for the codes */ +}; + +local static_tree_desc static_l_desc = +{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; + +local static_tree_desc static_d_desc = +{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; + +local static_tree_desc static_bl_desc = +{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; + +/* =========================================================================== + * Local (static) routines in this file. + */ + +local void tr_static_init OF((void)); +local void init_block OF((deflate_state *s)); +local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); +local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); +local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); +local void build_tree OF((deflate_state *s, tree_desc *desc)); +local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); +local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); +local int build_bl_tree OF((deflate_state *s)); +local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, + int blcodes)); +local void compress_block OF((deflate_state *s, ct_data *ltree, + ct_data *dtree)); +local void set_data_type OF((deflate_state *s)); +local unsigned bi_reverse OF((unsigned value, int length)); +local void bi_windup OF((deflate_state *s)); +local void bi_flush OF((deflate_state *s)); +local void copy_block OF((deflate_state *s, charf *buf, unsigned len, + int header)); + +#ifdef GEN_TREES_H +local void gen_trees_header OF((void)); +#endif + +#ifndef DEBUG +# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) + /* Send a code of the given tree. c and tree must not have side effects */ + +#else /* DEBUG */ +# define send_code(s, c, tree) \ + { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ + send_bits(s, tree[c].Code, tree[c].Len); } +#endif + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +#define put_short(s, w) { \ + put_byte(s, (uch)((w) & 0xff)); \ + put_byte(s, (uch)((ush)(w) >> 8)); \ +} + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +#ifdef DEBUG +local void send_bits OF((deflate_state *s, int value, int length)); + +local void send_bits(s, value, length) + deflate_state *s; + int value; /* value to send */ + int length; /* number of bits */ +{ + Tracevv((stderr," l %2d v %4x ", length, value)); + Assert(length > 0 && length <= 15, "invalid length"); + s->bits_sent += (ulg)length; + + /* If not enough room in bi_buf, use (valid) bits from bi_buf and + * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) + * unused bits in value. + */ + if (s->bi_valid > (int)Buf_size - length) { + s->bi_buf |= (value << s->bi_valid); + put_short(s, s->bi_buf); + s->bi_buf = (ush)value >> (Buf_size - s->bi_valid); + s->bi_valid += length - Buf_size; + } else { + s->bi_buf |= value << s->bi_valid; + s->bi_valid += length; + } +} +#else /* !DEBUG */ + +#define send_bits(s, value, length) \ +{ int len = length;\ + if (s->bi_valid > (int)Buf_size - len) {\ + int val = value;\ + s->bi_buf |= (val << s->bi_valid);\ + put_short(s, s->bi_buf);\ + s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ + s->bi_valid += len - Buf_size;\ + } else {\ + s->bi_buf |= (value) << s->bi_valid;\ + s->bi_valid += len;\ + }\ +} +#endif /* DEBUG */ + + +#define MAX(a,b) (a >= b ? a : b) +/* the arguments must not have side effects */ + +/* =========================================================================== + * Initialize the various 'constant' tables. + */ +local void tr_static_init() +{ +#if defined(GEN_TREES_H) || !defined(STDC) + static int static_init_done = 0; + int n; /* iterates over tree elements */ + int bits; /* bit counter */ + int length; /* length value */ + int code; /* code value */ + int dist; /* distance index */ + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + if (static_init_done) return; + + /* For some embedded targets, global variables are not initialized: */ + static_l_desc.static_tree = static_ltree; + static_l_desc.extra_bits = extra_lbits; + static_d_desc.static_tree = static_dtree; + static_d_desc.extra_bits = extra_dbits; + static_bl_desc.extra_bits = extra_blbits; + + /* Initialize the mapping length (0..255) -> length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES-1; code++) { + base_length[code] = length; + for (n = 0; n < (1< dist code (0..29) */ + dist = 0; + for (code = 0 ; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ + for ( ; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { + _dist_code[256 + dist++] = (uch)code; + } + } + Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; + n = 0; + while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++; + while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++; + while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++; + while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++; + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n].Len = 5; + static_dtree[n].Code = bi_reverse((unsigned)n, 5); + } + static_init_done = 1; + +# ifdef GEN_TREES_H + gen_trees_header(); +# endif +#endif /* defined(GEN_TREES_H) || !defined(STDC) */ +} + +/* =========================================================================== + * Genererate the file trees.h describing the static trees. + */ +#ifdef GEN_TREES_H +# ifndef DEBUG +# include +# endif + +# define SEPARATOR(i, last, width) \ + ((i) == (last)? "\n};\n\n" : \ + ((i) % (width) == (width)-1 ? ",\n" : ", ")) + +void gen_trees_header() +{ + FILE *header = fopen("trees.h", "w"); + int i; + + Assert (header != NULL, "Can't open trees.h"); + fprintf(header, + "/* header created automatically with -DGEN_TREES_H */\n\n"); + + fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n"); + for (i = 0; i < L_CODES+2; i++) { + fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code, + static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5)); + } + + fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n"); + for (i = 0; i < D_CODES; i++) { + fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code, + static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5)); + } + + fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n"); + for (i = 0; i < DIST_CODE_LEN; i++) { + fprintf(header, "%2u%s", _dist_code[i], + SEPARATOR(i, DIST_CODE_LEN-1, 20)); + } + + fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n"); + for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) { + fprintf(header, "%2u%s", _length_code[i], + SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20)); + } + + fprintf(header, "local const int base_length[LENGTH_CODES] = {\n"); + for (i = 0; i < LENGTH_CODES; i++) { + fprintf(header, "%1u%s", base_length[i], + SEPARATOR(i, LENGTH_CODES-1, 20)); + } + + fprintf(header, "local const int base_dist[D_CODES] = {\n"); + for (i = 0; i < D_CODES; i++) { + fprintf(header, "%5u%s", base_dist[i], + SEPARATOR(i, D_CODES-1, 10)); + } + + fclose(header); +} +#endif /* GEN_TREES_H */ + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +void _tr_init(s) + deflate_state *s; +{ + tr_static_init(); + + s->l_desc.dyn_tree = s->dyn_ltree; + s->l_desc.stat_desc = &static_l_desc; + + s->d_desc.dyn_tree = s->dyn_dtree; + s->d_desc.stat_desc = &static_d_desc; + + s->bl_desc.dyn_tree = s->bl_tree; + s->bl_desc.stat_desc = &static_bl_desc; + + s->bi_buf = 0; + s->bi_valid = 0; + s->last_eob_len = 8; /* enough lookahead for inflate */ +#ifdef DEBUG + s->compressed_len = 0L; + s->bits_sent = 0L; +#endif + + /* Initialize the first block of the first file: */ + init_block(s); +} + +/* =========================================================================== + * Initialize a new block. + */ +local void init_block(s) + deflate_state *s; +{ + int n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; + for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; + for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; + + s->dyn_ltree[END_BLOCK].Freq = 1; + s->opt_len = s->static_len = 0L; + s->last_lit = s->matches = 0; +} + +#define SMALLEST 1 +/* Index within the heap array of least frequent node in the Huffman tree */ + + +/* =========================================================================== + * Remove the smallest element from the heap and recreate the heap with + * one less element. Updates heap and heap_len. + */ +#define pqremove(s, tree, top) \ +{\ + top = s->heap[SMALLEST]; \ + s->heap[SMALLEST] = s->heap[s->heap_len--]; \ + pqdownheap(s, tree, SMALLEST); \ +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +#define smaller(tree, n, m, depth) \ + (tree[n].Freq < tree[m].Freq || \ + (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +local void pqdownheap(s, tree, k) + deflate_state *s; + ct_data *tree; /* the tree to restore */ + int k; /* node to move down */ +{ + int v = s->heap[k]; + int j = k << 1; /* left son of k */ + while (j <= s->heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s->heap_len && + smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s->heap[j], s->depth)) break; + + /* Exchange v with the smallest son */ + s->heap[k] = s->heap[j]; k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s->heap[k] = v; +} + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +local void gen_bitlen(s, desc) + deflate_state *s; + tree_desc *desc; /* the tree descriptor */ +{ + ct_data *tree = desc->dyn_tree; + int max_code = desc->max_code; + const ct_data *stree = desc->stat_desc->static_tree; + const intf *extra = desc->stat_desc->extra_bits; + int base = desc->stat_desc->extra_base; + int max_length = desc->stat_desc->max_length; + int h; /* heap index */ + int n, m; /* iterate over the tree elements */ + int bits; /* bit length */ + int xbits; /* extra bits */ + ush f; /* frequency */ + int overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0; + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ + + for (h = s->heap_max+1; h < HEAP_SIZE; h++) { + n = s->heap[h]; + bits = tree[tree[n].Dad].Len + 1; + if (bits > max_length) bits = max_length, overflow++; + tree[n].Len = (ush)bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) continue; /* not a leaf node */ + + s->bl_count[bits]++; + xbits = 0; + if (n >= base) xbits = extra[n-base]; + f = tree[n].Freq; + s->opt_len += (ulg)f * (bits + xbits); + if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits); + } + if (overflow == 0) return; + + Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length-1; + while (s->bl_count[bits] == 0) bits--; + s->bl_count[bits]--; /* move one leaf down the tree */ + s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ + s->bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits != 0; bits--) { + n = s->bl_count[bits]; + while (n != 0) { + m = s->heap[--h]; + if (m > max_code) continue; + if (tree[m].Len != (unsigned) bits) { + Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s->opt_len += ((long)bits - (long)tree[m].Len) + *(long)tree[m].Freq; + tree[m].Len = (ush)bits; + } + n--; + } + } +} + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +local void gen_codes (tree, max_code, bl_count) + ct_data *tree; /* the tree to decorate */ + int max_code; /* largest code with non zero frequency */ + ushf *bl_count; /* number of codes at each bit length */ +{ + ush next_code[MAX_BITS+1]; /* next code value for each bit length */ + ush code = 0; /* running code value */ + int bits; /* bit index */ + int n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits-1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + Assert (code + bl_count[MAX_BITS]-1 == (1<dyn_tree; + const ct_data *stree = desc->stat_desc->static_tree; + int elems = desc->stat_desc->elems; + int n, m; /* iterate over heap elements */ + int max_code = -1; /* largest code with non zero frequency */ + int node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s->heap_len = 0, s->heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n].Freq != 0) { + s->heap[++(s->heap_len)] = max_code = n; + s->depth[n] = 0; + } else { + tree[n].Len = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s->heap_len < 2) { + node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0); + tree[node].Freq = 1; + s->depth[node] = 0; + s->opt_len--; if (stree) s->static_len -= stree[node].Len; + /* node is 0 or 1 so it does not have extra bits */ + } + desc->max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + pqremove(s, tree, n); /* n = node of least frequency */ + m = s->heap[SMALLEST]; /* m = node of next least frequency */ + + s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */ + s->heap[--(s->heap_max)] = m; + + /* Create a new node father of n and m */ + tree[node].Freq = tree[n].Freq + tree[m].Freq; + s->depth[node] = (uch) (MAX(s->depth[n], s->depth[m]) + 1); + tree[n].Dad = tree[m].Dad = (ush)node; +#ifdef DUMP_BL_TREE + if (tree == s->bl_tree) { + fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", + node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); + } +#endif + /* and insert the new node in the heap */ + s->heap[SMALLEST] = node++; + pqdownheap(s, tree, SMALLEST); + + } while (s->heap_len >= 2); + + s->heap[--(s->heap_max)] = s->heap[SMALLEST]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, (tree_desc *)desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes ((ct_data *)tree, max_code, s->bl_count); +} + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +local void scan_tree (s, tree, max_code) + deflate_state *s; + ct_data *tree; /* the tree to be scanned */ + int max_code; /* and its largest code of non zero frequency */ +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + if (nextlen == 0) max_count = 138, min_count = 3; + tree[max_code+1].Len = (ush)0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + s->bl_tree[curlen].Freq += count; + } else if (curlen != 0) { + if (curlen != prevlen) s->bl_tree[curlen].Freq++; + s->bl_tree[REP_3_6].Freq++; + } else if (count <= 10) { + s->bl_tree[REPZ_3_10].Freq++; + } else { + s->bl_tree[REPZ_11_138].Freq++; + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +local void send_tree (s, tree, max_code) + deflate_state *s; + ct_data *tree; /* the tree to be scanned */ + int max_code; /* and its largest code of non zero frequency */ +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen == 0) max_count = 138, min_count = 3; + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + do { send_code(s, curlen, s->bl_tree); } while (--count != 0); + + } else if (curlen != 0) { + if (curlen != prevlen) { + send_code(s, curlen, s->bl_tree); count--; + } + Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); + + } else { + send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +local int build_bl_tree(s) + deflate_state *s; +{ + int max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); + scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, (tree_desc *)(&(s->bl_desc))); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { + if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; + } + /* Update opt_len to include the bit length tree and counts */ + s->opt_len += 3*(max_blindex+1) + 5+5+4; + Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + s->opt_len, s->static_len)); + + return max_blindex; +} + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +local void send_all_trees(s, lcodes, dcodes, blcodes) + deflate_state *s; + int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + int rank; /* index in bl_order */ + + Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + "too many codes"); + Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes-1, 5); + send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); + } + Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ + Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ + Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + +/* =========================================================================== + * Send a stored block + */ +void _tr_stored_block(s, buf, stored_len, eof) + deflate_state *s; + charf *buf; /* input block */ + ulg stored_len; /* length of input block */ + int eof; /* true if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */ +#ifdef DEBUG + s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; + s->compressed_len += (stored_len + 4) << 3; +#endif + copy_block(s, buf, (unsigned)stored_len, 1); /* with header */ +} + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + * The current inflate code requires 9 bits of lookahead. If the + * last two codes for the previous block (real code plus EOB) were coded + * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode + * the last real code. In this case we send two empty static blocks instead + * of one. (There are no problems if the previous block is stored or fixed.) + * To simplify the code, we assume the worst case of last real code encoded + * on one bit only. + */ +void _tr_align(s) + deflate_state *s; +{ + send_bits(s, STATIC_TREES<<1, 3); + send_code(s, END_BLOCK, static_ltree); +#ifdef DEBUG + s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ +#endif + bi_flush(s); + /* Of the 10 bits for the empty block, we have already sent + * (10 - bi_valid) bits. The lookahead for the last real code (before + * the EOB of the previous block) was thus at least one plus the length + * of the EOB plus what we have just sent of the empty static block. + */ + if (1 + s->last_eob_len + 10 - s->bi_valid < 9) { + send_bits(s, STATIC_TREES<<1, 3); + send_code(s, END_BLOCK, static_ltree); +#ifdef DEBUG + s->compressed_len += 10L; +#endif + bi_flush(s); + } + s->last_eob_len = 7; +} + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +void _tr_flush_block(s, buf, stored_len, eof) + deflate_state *s; + charf *buf; /* input block, or NULL if too old */ + ulg stored_len; /* length of input block */ + int eof; /* true if this is the last block for a file */ +{ + ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + int max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s->level > 0) { + + /* Check if the file is ascii or binary */ + if (s->data_type == Z_UNKNOWN) set_data_type(s); + + /* Construct the literal and distance trees */ + build_tree(s, (tree_desc *)(&(s->l_desc))); + Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + s->static_len)); + + build_tree(s, (tree_desc *)(&(s->d_desc))); + Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute first the block length in bytes*/ + opt_lenb = (s->opt_len+3+7)>>3; + static_lenb = (s->static_len+3+7)>>3; + + Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + s->last_lit)); + + if (static_lenb <= opt_lenb) opt_lenb = static_lenb; + + } else { + Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + +#ifdef FORCE_STORED + if (buf != (char*)0) { /* force stored block */ +#else + if (stored_len+4 <= opt_lenb && buf != (char*)0) { + /* 4: two words for the lengths */ +#endif + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, eof); + +#ifdef FORCE_STATIC + } else if (static_lenb >= 0) { /* force static trees */ +#else + } else if (static_lenb == opt_lenb) { +#endif + send_bits(s, (STATIC_TREES<<1)+eof, 3); + compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); +#ifdef DEBUG + s->compressed_len += 3 + s->static_len; +#endif + } else { + send_bits(s, (DYN_TREES<<1)+eof, 3); + send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, + max_blindex+1); + compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); +#ifdef DEBUG + s->compressed_len += 3 + s->opt_len; +#endif + } + Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (eof) { + bi_windup(s); +#ifdef DEBUG + s->compressed_len += 7; /* align on byte boundary */ +#endif + } + Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + s->compressed_len-7*eof)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +int _tr_tally (s, dist, lc) + deflate_state *s; + unsigned dist; /* distance of matched string */ + unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + s->d_buf[s->last_lit] = (ush)dist; + s->l_buf[s->last_lit++] = (uch)lc; + if (dist == 0) { + /* lc is the unmatched char */ + s->dyn_ltree[lc].Freq++; + } else { + s->matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + Assert((ush)dist < (ush)MAX_DIST(s) && + (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; + s->dyn_dtree[d_code(dist)].Freq++; + } + +#ifdef TRUNCATE_BLOCK + /* Try to guess if it is profitable to stop the current block here */ + if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { + /* Compute an upper bound for the compressed length */ + ulg out_length = (ulg)s->last_lit*8L; + ulg in_length = (ulg)((long)s->strstart - s->block_start); + int dcode; + for (dcode = 0; dcode < D_CODES; dcode++) { + out_length += (ulg)s->dyn_dtree[dcode].Freq * + (5L+extra_dbits[dcode]); + } + out_length >>= 3; + Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", + s->last_lit, in_length, out_length, + 100L - out_length*100L/in_length)); + if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; + } +#endif + return (s->last_lit == s->lit_bufsize-1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +local void compress_block(s, ltree, dtree) + deflate_state *s; + ct_data *ltree; /* literal tree */ + ct_data *dtree; /* distance tree */ +{ + unsigned dist; /* distance of matched string */ + int lc; /* match length or unmatched char (if dist == 0) */ + unsigned lx = 0; /* running index in l_buf */ + unsigned code; /* the code to send */ + int extra; /* number of extra bits to send */ + + if (s->last_lit != 0) do { + dist = s->d_buf[lx]; + lc = s->l_buf[lx++]; + if (dist == 0) { + send_code(s, lc, ltree); /* send a literal byte */ + Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code+LITERALS+1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra != 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra != 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + Assert(s->pending < s->lit_bufsize + 2*lx, "pendingBuf overflow"); + + } while (lx < s->last_lit); + + send_code(s, END_BLOCK, ltree); + s->last_eob_len = ltree[END_BLOCK].Len; +} + +/* =========================================================================== + * Set the data type to ASCII or BINARY, using a crude approximation: + * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. + * IN assertion: the fields freq of dyn_ltree are set and the total of all + * frequencies does not exceed 64K (to fit in an int on 16 bit machines). + */ +local void set_data_type(s) + deflate_state *s; +{ + int n = 0; + unsigned ascii_freq = 0; + unsigned bin_freq = 0; + while (n < 7) bin_freq += s->dyn_ltree[n++].Freq; + while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq; + while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq; + s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); +} + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +local unsigned bi_reverse(code, len) + unsigned code; /* the value to invert */ + int len; /* its bit length */ +{ + register unsigned res = 0; + do { + res |= code & 1; + code >>= 1, res <<= 1; + } while (--len > 0); + return res >> 1; +} + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +local void bi_flush(s) + deflate_state *s; +{ + if (s->bi_valid == 16) { + put_short(s, s->bi_buf); + s->bi_buf = 0; + s->bi_valid = 0; + } else if (s->bi_valid >= 8) { + put_byte(s, (Byte)s->bi_buf); + s->bi_buf >>= 8; + s->bi_valid -= 8; + } +} + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +local void bi_windup(s) + deflate_state *s; +{ + if (s->bi_valid > 8) { + put_short(s, s->bi_buf); + } else if (s->bi_valid > 0) { + put_byte(s, (Byte)s->bi_buf); + } + s->bi_buf = 0; + s->bi_valid = 0; +#ifdef DEBUG + s->bits_sent = (s->bits_sent+7) & ~7; +#endif +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +local void copy_block(s, buf, len, header) + deflate_state *s; + charf *buf; /* the input data */ + unsigned len; /* its length */ + int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + s->last_eob_len = 8; /* enough lookahead for inflate */ + + if (header) { + put_short(s, (ush)len); + put_short(s, (ush)~len); +#ifdef DEBUG + s->bits_sent += 2*16; +#endif + } +#ifdef DEBUG + s->bits_sent += (ulg)len<<3; +#endif + while (len--) { + put_byte(s, *buf++); + } +} Index: xc/extras/zlib/trees.h diff -u /dev/null xc/extras/zlib/trees.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/trees.h Sun Jun 1 17:00:18 2003 @@ -0,0 +1,128 @@ +/* header created automatically with -DGEN_TREES_H */ + +local const ct_data static_ltree[L_CODES+2] = { +{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, +{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, +{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, +{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, +{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, +{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, +{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, +{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, +{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, +{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, +{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, +{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, +{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, +{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, +{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, +{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, +{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, +{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, +{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, +{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, +{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, +{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, +{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, +{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, +{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, +{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, +{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, +{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, +{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, +{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, +{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, +{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, +{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, +{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, +{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, +{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, +{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, +{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, +{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, +{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, +{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, +{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, +{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, +{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, +{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, +{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, +{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, +{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, +{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, +{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, +{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, +{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, +{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, +{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, +{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, +{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, +{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, +{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} +}; + +local const ct_data static_dtree[D_CODES] = { +{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, +{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, +{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, +{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, +{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, +{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} +}; + +const uch _dist_code[DIST_CODE_LEN] = { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, +10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, +18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 +}; + +const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, +13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, +17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, +19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 +}; + +local const int base_length[LENGTH_CODES] = { +0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, +64, 80, 96, 112, 128, 160, 192, 224, 0 +}; + +local const int base_dist[D_CODES] = { + 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, + 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, + 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 +}; + Index: xc/extras/zlib/uncompr.c diff -u /dev/null xc/extras/zlib/uncompr.c:1.2 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/uncompr.c Sun Jun 1 17:05:50 2003 @@ -0,0 +1,56 @@ +/* uncompr.c -- decompress a memory buffer + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zlib.h" + +/* =========================================================================== + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ +int ZEXPORT uncompress (dest, destLen, source, sourceLen) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; +{ + z_stream stream; + int err; + + stream.next_in = (Bytef*)source; + stream.avail_in = (uInt)sourceLen; + /* Check for source > 64K on 16-bit machine: */ + if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; + + stream.next_out = dest; + stream.avail_out = (uInt)*destLen; + if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; + + stream.zalloc = (alloc_func)0; + stream.zfree = (free_func)0; + + err = inflateInit(&stream); + if (err != Z_OK) return err; + + err = inflate(&stream, Z_FINISH); + if (err != Z_STREAM_END) { + inflateEnd(&stream); + return err == Z_OK ? Z_BUF_ERROR : err; + } + *destLen = stream.total_out; + + err = inflateEnd(&stream); + return err; +} Index: xc/extras/zlib/zconf.h diff -u /dev/null xc/extras/zlib/zconf.h:1.2 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/zconf.h Sun Jun 1 17:05:50 2003 @@ -0,0 +1,283 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* $XFree86: xc/extras/zlib/zconf.h,v 1.2 2003/06/01 21:05:50 herrb Exp $ */ + +#ifndef _ZCONF_H +#define _ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateReset z_inflateReset +# define compress z_compress +# define compress2 z_compress2 +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table + +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) +# define WIN32 +#endif +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) || defined(__UNIXOS2__) +# ifndef __32BIT__ +# define __32BIT__ +# endif +#endif +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#if defined(MSDOS) && !defined(__32BIT__) +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) +# define STDC +#endif +#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) +# ifndef STDC +# define STDC +# endif +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Old Borland C incorrectly complains about missing returns: */ +#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) +# define NEED_DUMMY_RETURN +#endif + + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +#endif +#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) +# ifndef __32BIT__ +# define SMALL_MEDIUM +# define FAR _far +# endif +#endif + +/* Compile with -DZLIB_DLL for Windows DLL support */ +#if defined(ZLIB_DLL) +# if defined(_WINDOWS) || defined(WINDOWS) +# ifdef FAR +# undef FAR +# endif +# include +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR _cdecl _export +# endif +# endif +# if defined (__BORLANDC__) +# if (__BORLANDC__ >= 0x0500) && defined (WIN32) +# include +# define ZEXPORT __declspec(dllexport) WINAPI +# define ZEXPORTRVA __declspec(dllexport) WINAPIV +# else +# if defined (_Windows) && defined (__DLL__) +# define ZEXPORT _export +# define ZEXPORTVA _export +# endif +# endif +# endif +#endif + +#if defined (__BEOS__) +# if defined (ZLIB_DLL) +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +#endif + +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif +#ifndef ZEXTERN +# define ZEXTERN extern +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(MACOS) && !defined(TARGET_OS_MAC) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#ifndef X_NOT_POSIX +# include /* for off_t */ +#ifndef WIN32 +# include /* for SEEK_* and off_t */ +#else +# include /* this is where VC++ has SEEK_ */ +#endif +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(inflate_blocks,"INBL") +# pragma map(inflate_blocks_new,"INBLNE") +# pragma map(inflate_blocks_free,"INBLFR") +# pragma map(inflate_blocks_reset,"INBLRE") +# pragma map(inflate_codes_free,"INCOFR") +# pragma map(inflate_codes,"INCO") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_flush,"INFLU") +# pragma map(inflate_mask,"INMA") +# pragma map(inflate_set_dictionary,"INSEDI2") +# pragma map(inflate_copyright,"INCOPY") +# pragma map(inflate_trees_bits,"INTRBI") +# pragma map(inflate_trees_dynamic,"INTRDY") +# pragma map(inflate_trees_fixed,"INTRFI") +# pragma map(inflate_trees_free,"INTRFR") +#endif + +#endif /* _ZCONF_H */ Index: xc/extras/zlib/zlib.3 diff -u /dev/null xc/extras/zlib/zlib.3:1.1.1.1 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/zlib.3 Sun Jun 1 17:00:31 2003 @@ -0,0 +1,107 @@ +.TH ZLIB 3 "11 March 2002" +.SH NAME +zlib \- compression/decompression library +.SH SYNOPSIS +[see +.I zlib.h +for full description] +.SH DESCRIPTION +The +.I zlib +library is a general purpose data compression library. +The code is thread safe. +It provides in-memory compression and decompression functions, +including integrity checks of the uncompressed data. +This version of the library supports only one compression method (deflation) +but other algorithms will be added later and will have the same stream interface. +.LP +Compression can be done in a single step if the buffers are large enough +(for example if an input file is mmap'ed), +or can be done by repeated calls of the compression function. +In the latter case, +the application must provide more input and/or consume the output +(providing more output space) before each call. +.LP +The library also supports reading and writing files in +.I gzip +(.gz) format +with an interface similar to that of stdio. +.LP +The library does not install any signal handler. The decoder checks +the consistency of the compressed data, so the library should never +crash even in case of corrupted input. +.LP +All functions of the compression library are documented in the file +.IR zlib.h. +The distribution source includes examples of use of the library +the files +.I example.c +and +.IR minigzip.c . +.LP +A Java implementation of +.IR zlib +is available in the Java Development Kit 1.1 +.IP +http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html +.LP +A Perl interface to +.IR zlib , +written by Paul Marquess (pmarquess@bfsec.bt.co.uk) +is available at CPAN (Comprehensive Perl Archive Network) sites, +such as: +.IP +ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib* +.LP +A Python interface to +.IR zlib +written by A.M. Kuchling +is available from the Python Software Association sites, such as: +.IP +ftp://ftp.python.org/pub/python/contrib/Encoding/zlib*.tar.gz +.SH "SEE ALSO" +Questions about zlib should be sent to: +.IP +zlib@quest.jpl.nasa.gov +or, if this fails, to the author addresses given below. +The zlib home page is: +.IP +http://www.cdrom.com/pub/infozip/zlib/ +.LP +The data format used by the zlib library is described by RFC +(Request for Comments) 1950 to 1952 in the files: +.IP +ftp://ds.internic.net/rfc/rfc1950.txt (zlib format) +.br +rfc1951.txt (deflate format) +.br +rfc1952.txt (gzip format) +.LP +These documents are also available in other formats from: +.IP +ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html +.SH AUTHORS +Version 1.1.4 +Copyright (C) 1995-2002 Jean-loup Gailly (jloup@gzip.org) +and Mark Adler (madler@alumni.caltech.edu). +.LP +This software is provided "as-is," +without any express or implied warranty. +In no event will the authors be held liable for any damages +arising from the use of this software. +See the distribution directory with respect to requirements +governing redistribution. +The deflate format used by +.I zlib +was defined by Phil Katz. +The deflate and +.I zlib +specifications were written by L. Peter Deutsch. +Thanks to all the people who reported problems and suggested various +improvements in +.IR zlib ; +who are too numerous to cite here. +.LP +UNIX manual page by R. P. C. Rodgers, +U.S. National Library of Medicine (rodgers@nlm.nih.gov). +.\" end of man page Index: xc/extras/zlib/zlib.h diff -u /dev/null xc/extras/zlib/zlib.h:1.1.1.1 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/zlib.h Sun Jun 1 17:00:20 2003 @@ -0,0 +1,893 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.4, March 11th, 2002 + + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef _ZLIB_H +#define _ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.1.4" + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: ascii or binary */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +/* Allowed flush values; see deflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_ASCII 1 +#define Z_UNKNOWN 2 +/* Possible values of the data_type field */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + it sets strm->adler to the adler32 checksum of all output produced + so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. + + Upon return of this function, strm->adler is set to the Adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.) +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary). + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ + + +typedef voidp gzFile; + +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, + const voidp buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); + +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + + +#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) + struct internal_state {int dummy;}; /* hack for buggy compilers */ +#endif + +ZEXTERN const char * ZEXPORT zError OF((int err)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); +ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); + +#ifdef __cplusplus +} +#endif + +#endif /* _ZLIB_H */ Index: xc/extras/zlib/zlib.html diff -u /dev/null xc/extras/zlib/zlib.html:1.1.1.1 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/zlib.html Sun Jun 1 17:00:31 2003 @@ -0,0 +1,971 @@ + + + + zlib general purpose compression library version 1.1.4 + + + + + +

    zlib 1.1.4 Manual

    +
    +

    Contents

    +
      +
    1. Prologue +
    2. Introduction +
    3. Utility functions +
    4. Basic functions +
    5. Advanced functions +
    6. Constants +
    7. struct z_stream_s +
    8. Checksum functions +
    9. Misc +
    +
    +

    Prologue

    + 'zlib' general purpose compression library version 1.1.4, March 11th, 2002 +

    + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler +

    + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. +

    + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: +

      +
    1. The origin of this software must not be misrepresented ; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +
    2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +
    3. This notice may not be removed or altered from any source distribution. +
    + +
    +
    Jean-loup Gailly +
    jloup@gzip.org +
    Mark Adler +
    madler@alumni.caltech.edu +
    + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files + + ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), + + rfc1951.txt + (deflate format) and + + rfc1952.txt + (gzip format). +

    + This manual is converted from zlib.h by + piaip +

    + Visit + http://ftp.cdrom.com/pub/infozip/zlib/ + for the official zlib web page. +

    + +


    +

    Introduction

    + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. +

    + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. +

    + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. +

    + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +

    + +


    +

    Utility functions

    + The following utility functions are implemented on top of the +
    basic stream-oriented functions. + To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +

    Function list

    +
      +
    • int compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); +
    • int compress2 (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level); +
    • int uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); +
    • typedef voidp gzFile; +
    • gzFile gzopen (const char *path, const char *mode); +
    • gzFile gzdopen (int fd, const char *mode); +
    • int gzsetparams (gzFile file, int level, int strategy); +
    • int gzread (gzFile file, voidp buf, unsigned len); +
    • int gzwrite (gzFile file, const voidp buf, unsigned len); +
    • int VA gzprintf (gzFile file, const char *format, ...); +
    • int gzputs (gzFile file, const char *s); +
    • char * gzgets (gzFile file, char *buf, int len); +
    • int gzputc (gzFile file, int c); +
    • int gzgetc (gzFile file); +
    • int gzflush (gzFile file, int flush); +
    • z_off_t gzseek (gzFile file, z_off_t offset, int whence); +
    • z_off_t gztell (gzFile file); +
    • int gzrewind (gzFile file); +
    • int gzeof (gzFile file); +
    • int gzclose (gzFile file); +
    • const char * gzerror (gzFile file, int *errnum); +
    +

    Function description

    +
    +
    int compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); +
    + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer.

    + This function can be used to compress a whole file at once if the + input file is mmap'ed.

    + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer.

    + +

    int compress2 (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level); +
    + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. +

    + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +

    + +

    int uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); +
    + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer.

    + This function can be used to decompress a whole file at once if the + input file is mmap'ed. +

    + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +

    + +

    typedef voidp gzFile; +

    + +

    gzFile gzopen (const char *path, const char *mode); +
    + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) +

    + + gzopen can be used to read a file which is not in gzip format ; in this + case gzread will directly read from the file without decompression. +

    + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state ; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). +

    + +

    gzFile gzdopen (int fd, const char *mode); +
    + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. +

    + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). +

    + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +

    + +

    int gzsetparams (gzFile file, int level, int strategy); +
    + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. +

    + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +

    + +

    int gzread (gzFile file, voidp buf, unsigned len); +
    + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. +

    + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). +

    + +

    int gzwrite (gzFile file, const voidp buf, unsigned len); +
    + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +

    + +

    int VA gzprintf (gzFile file, const char *format, ...); +
    + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +

    + +

    int gzputs (gzFile file, const char *s); +
    + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. +

    + gzputs returns the number of characters written, or -1 in case of error. +

    + +

    char * gzgets (gzFile file, char *buf, int len); +
    + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. +

    + gzgets returns buf, or Z_NULL in case of error. +

    + +

    int gzputc (gzFile file, int c); +
    + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +

    + +

    int gzgetc (gzFile file); +
    + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +

    + +

    int gzflush (gzFile file, int flush); +
    + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. +

    + gzflush should be called only when strictly necessary because it can + degrade compression. +

    + +

    z_off_t gzseek (gzFile file, z_off_t offset, int whence); +
    + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. +

    + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported ; gzseek then compresses a sequence of zeroes up to the new + starting position. +

    + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +

    + +

    int gzrewind (gzFile file); +
    + Rewinds the given file. This function is supported only for reading. +

    + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +

    + +

    z_off_t gztell (gzFile file); +
    + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. +

    + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +

    + +

    int gzeof (gzFile file); +
    + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +

    + +

    int gzclose (gzFile file); +
    + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +

    + +

    const char * gzerror (gzFile file, int *errnum); +
    + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +

    +

    +
    +

    Basic functions

    +

    Function list

    +
    + +

    Function description

    +
    +
    const char * zlibVersion (void); +
    The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. +

    + +

    int deflateInit (z_streamp strm, int level); +
    + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. +

    + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). +

    + + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). +

    + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +

    + +

    int deflate (z_streamp strm, int flush); +
    + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush.

    + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + +

      +
    • Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + +
    • + Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. +

    + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly ; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. +

    + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. +

    + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. +

    + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). +

    + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space ; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. +

    + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. +

    + + deflate() sets strm-> adler to the adler32 checksum of all input read + so far (that is, total_in bytes). +

    + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. +

    + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +

    + +

    int deflateEnd (z_streamp strm); +
    + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. +

    + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +

    + +

    int inflateInit (z_streamp strm); +
    + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly ; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. +

    + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +

    + +

    int inflate (z_streamp strm, int flush); +
    + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. +

    + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + +

      +
    • Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + +
    • Provide more output starting at next_out and update next_out and + avail_out accordingly. inflate() provides as much output as possible, + until there is no more input data or no more space in the output buffer + (see below about the flush parameter). +

    + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. +

    + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. +

    + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed ; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. +

    + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT ; otherwise + it sets strm-> adler to the adler32 checksum of all output produced + so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. +

    + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +

    + +

    int inflateEnd (z_streamp strm); +
    + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. +

    + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +

    +
    +

    Advanced functions

    + The following functions are needed only in some special applications. +

    Function list

    +
    +

    Function description

    +
    +
    int deflateInit2 (z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy); + +
    This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller.

    + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library.

    + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead.

    + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio ; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel.

    + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching ; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately.

    + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate().

    + +

    int deflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt dictLength); +
    + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary).

    + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy ; the data can then be compressed better than + with the default empty dictionary.

    + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front.

    + + Upon return of this function, strm-> adler is set to the Adler32 value + of the dictionary ; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.)

    + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate().

    + +

    int deflateCopy (z_streamp dest, z_streamp source); +
    + Sets the destination stream as a complete copy of the source stream.

    + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory.

    + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination.

    + +

    int deflateReset (z_streamp strm); +
    This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2.

    + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL).

    + +

    int deflateParams (z_streamp strm, int level, int strategy); +
    + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate().

    + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm-> avail_out must be + non-zero.

    + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero.

    + +

    int inflateInit2 (z_streamp strm, int windowBits); + +
    This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller.

    + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window.

    + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.)

    + +

    int inflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt dictLength); +
    + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary).

    + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate().

    + +

    int inflateSync (z_streamp strm); + +
    Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided.

    + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data.

    + +

    int inflateReset (z_streamp strm); +
    + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. +

    + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +

    +

    + +
    +

    Checksum functions

    + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +

    Function list

    +
    +

    Function description

    +
    +
    uLong adler32 (uLong adler, const Bytef *buf, uInt len); +
    + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. +

    + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: +

    +
    +     uLong adler = adler32(0L, Z_NULL, 0);
    +
    +     while (read_buffer(buffer, length) != EOF) {
    +       adler = adler32(adler, buffer, length);
    +     }
    +     if (adler != original_adler) error();
    +   
    + +
    uLong crc32 (uLong crc, const Bytef *buf, uInt len); +
    + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: +
    +
    +     uLong crc = crc32(0L, Z_NULL, 0);
    +
    +     while (read_buffer(buffer, length) != EOF) {
    +       crc = crc32(crc, buffer, length);
    +     }
    +     if (crc != original_crc) error();
    +   
    +
    +
    +

    struct z_stream_s

    + +
    +
    +typedef struct z_stream_s {
    +    Bytef    *next_in;  /* next input byte */
    +    uInt     avail_in;  /* number of bytes available at next_in */
    +    uLong    total_in;  /* total nb of input bytes read so far */
    +
    +    Bytef    *next_out; /* next output byte should be put there */
    +    uInt     avail_out; /* remaining free space at next_out */
    +    uLong    total_out; /* total nb of bytes output so far */
    +
    +    char     *msg;      /* last error message, NULL if no error */
    +    struct internal_state FAR *state; /* not visible by applications */
    +
    +    alloc_func zalloc;  /* used to allocate the internal state */
    +    free_func  zfree;   /* used to free the internal state */
    +    voidpf     opaque;  /* private data object passed to zalloc and zfree */
    +
    +    int     data_type;  /* best guess about the data type: ascii or binary */
    +    uLong   adler;      /* adler32 value of the uncompressed data */
    +    uLong   reserved;   /* reserved for future use */
    +} z_stream ;
    +
    +typedef z_stream FAR * z_streamp;  ÿ 
    +
    +
    + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application.

    + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value.

    + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe.

    + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). +

    + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step).

    + +


    +

    Constants

    + +
    +#define Z_NO_FLUSH      0
    +#define Z_PARTIAL_FLUSH 1 
    +	/* will be removed, use Z_SYNC_FLUSH instead */
    +#define Z_SYNC_FLUSH    2
    +#define Z_FULL_FLUSH    3
    +#define Z_FINISH        4
    +/* Allowed flush values ; see deflate() below for details */
    +
    +#define Z_OK            0
    +#define Z_STREAM_END    1
    +#define Z_NEED_DICT     2
    +#define Z_ERRNO        (-1)
    +#define Z_STREAM_ERROR (-2)
    +#define Z_DATA_ERROR   (-3)
    +#define Z_MEM_ERROR    (-4)
    +#define Z_BUF_ERROR    (-5)
    +#define Z_VERSION_ERROR (-6)
    +/* Return codes for the compression/decompression functions. Negative
    + * values are errors, positive values are used for special but normal events.
    + */
    +
    +#define Z_NO_COMPRESSION         0
    +#define Z_BEST_SPEED             1
    +#define Z_BEST_COMPRESSION       9
    +#define Z_DEFAULT_COMPRESSION  (-1)
    +/* compression levels */
    +
    +#define Z_FILTERED            1
    +#define Z_HUFFMAN_ONLY        2
    +#define Z_DEFAULT_STRATEGY    0
    +/* compression strategy ; see deflateInit2() below for details */
    +
    +#define Z_BINARY   0
    +#define Z_ASCII    1
    +#define Z_UNKNOWN  2
    +/* Possible values of the data_type field */
    +
    +#define Z_DEFLATED   8
    +/* The deflate compression method (the only one supported in this version) */
    +
    +#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
    +
    +#define zlib_version zlibVersion()
    +/* for compatibility with versions less than 1.0.2 */
    +
    +
    + +
    +

    Misc

    +
    deflateInit and inflateInit are macros to allow checking the zlib version + and the compiler's view of z_stream. +

    + Other functions: +

    +
    const char * zError (int err); +
    int inflateSyncPoint (z_streamp z); +
    const uLongf * get_crc_table (void); +
    +
    + + Last update: Wed Oct 13 20:42:34 1999
    + piapi@csie.ntu.edu.tw +
    + + + Index: xc/extras/zlib/zutil.c diff -u /dev/null xc/extras/zlib/zutil.c:1.2 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/zutil.c Sun Jun 1 17:05:50 2003 @@ -0,0 +1,223 @@ +/* zutil.c -- target dependent utility functions for the compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" + +struct internal_state {int dummy;}; /* for buggy compilers */ + +#ifndef STDC +extern void exit OF((int)); +#endif + +const char *z_errmsg[10] = { +"need dictionary", /* Z_NEED_DICT 2 */ +"stream end", /* Z_STREAM_END 1 */ +"", /* Z_OK 0 */ +"file error", /* Z_ERRNO (-1) */ +"stream error", /* Z_STREAM_ERROR (-2) */ +"data error", /* Z_DATA_ERROR (-3) */ +"insufficient memory", /* Z_MEM_ERROR (-4) */ +"buffer error", /* Z_BUF_ERROR (-5) */ +"incompatible version",/* Z_VERSION_ERROR (-6) */ +""}; + + +const char * ZEXPORT zlibVersion() +{ + return ZLIB_VERSION; +} + +#ifdef DEBUG + +# ifndef verbose +# define verbose 0 +# endif +int z_verbose = verbose; + +void z_error (m) + char *m; +{ + fprintf(stderr, "%s\n", m); + exit(1); +} +#endif + +/* exported to allow conversion of error code to string for compress() and + * uncompress() + */ +const char * ZEXPORT zError(err) + int err; +{ + return ERR_MSG(err); +} + + +#ifndef HAVE_MEMCPY + +void zmemcpy(dest, source, len) + Bytef* dest; + const Bytef* source; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = *source++; /* ??? to be unrolled */ + } while (--len != 0); +} + +int zmemcmp(s1, s2, len) + const Bytef* s1; + const Bytef* s2; + uInt len; +{ + uInt j; + + for (j = 0; j < len; j++) { + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + } + return 0; +} + +void zmemzero(dest, len) + Bytef* dest; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = 0; /* ??? to be unrolled */ + } while (--len != 0); +} +#endif + +#ifdef __TURBOC__ +#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__) +/* Small and medium model in Turbo C are for now limited to near allocation + * with reduced MAX_WBITS and MAX_MEM_LEVEL + */ +# define MY_ZCALLOC + +/* Turbo C malloc() does not allow dynamic allocation of 64K bytes + * and farmalloc(64K) returns a pointer with an offset of 8, so we + * must fix the pointer. Warning: the pointer must be put back to its + * original form in order to free it, use zcfree(). + */ + +#define MAX_PTR 10 +/* 10*64K = 640K */ + +local int next_ptr = 0; + +typedef struct ptr_table_s { + voidpf org_ptr; + voidpf new_ptr; +} ptr_table; + +local ptr_table table[MAX_PTR]; +/* This table is used to remember the original form of pointers + * to large buffers (64K). Such pointers are normalized with a zero offset. + * Since MSDOS is not a preemptive multitasking OS, this table is not + * protected from concurrent access. This hack doesn't work anyway on + * a protected system like OS/2. Use Microsoft C instead. + */ + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + voidpf buf = opaque; /* just to make some compilers happy */ + ulg bsize = (ulg)items*size; + + /* If we allocate less than 65520 bytes, we assume that farmalloc + * will return a usable pointer which doesn't have to be normalized. + */ + if (bsize < 65520L) { + buf = farmalloc(bsize); + if (*(ush*)&buf != 0) return buf; + } else { + buf = farmalloc(bsize + 16L); + } + if (buf == NULL || next_ptr >= MAX_PTR) return NULL; + table[next_ptr].org_ptr = buf; + + /* Normalize the pointer to seg:0 */ + *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; + *(ush*)&buf = 0; + table[next_ptr++].new_ptr = buf; + return buf; +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + int n; + if (*(ush*)&ptr != 0) { /* object < 64K */ + farfree(ptr); + return; + } + /* Find the original pointer */ + for (n = 0; n < next_ptr; n++) { + if (ptr != table[n].new_ptr) continue; + + farfree(table[n].org_ptr); + while (++n < next_ptr) { + table[n-1] = table[n]; + } + next_ptr--; + return; + } + ptr = opaque; /* just to make some compilers happy */ + Assert(0, "zcfree: ptr not found"); +} +#endif +#endif /* __TURBOC__ */ + + +#if defined(M_I86) && !defined(__32BIT__) +/* Microsoft C in 16-bit mode */ + +# define MY_ZCALLOC + +#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) +# define _halloc halloc +# define _hfree hfree +#endif + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + return _halloc((long)items, size); +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + _hfree(ptr); +} + +#endif /* MSC */ + + +#ifndef MY_ZCALLOC /* Any system without a special alloc function */ + +#ifndef STDC +extern voidp calloc OF((uInt items, uInt size)); +extern void free OF((voidpf ptr)); +#endif + +voidpf zcalloc (opaque, items, size) + voidpf opaque; + unsigned items; + unsigned size; +{ + if (opaque) items += size - size; /* make compiler happy */ + return (voidpf)calloc(items, size); +} + +void zcfree (opaque, ptr) + voidpf opaque; + voidpf ptr; +{ + free(ptr); + if (opaque) return; /* make compiler happy */ +} + +#endif /* MY_ZCALLOC */ Index: xc/extras/zlib/zutil.h diff -u /dev/null xc/extras/zlib/zutil.h:1.3 --- /dev/null Sat Feb 28 21:40:45 2004 +++ xc/extras/zlib/zutil.h Wed Oct 22 16:46:21 2003 @@ -0,0 +1,219 @@ +/* zutil.h -- internal interface and configuration of the compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ +/* $XFree86: xc/extras/zlib/zutil.h,v 1.3 2003/10/22 20:46:21 tsi Exp $ */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _Z_UTIL_H +#define _Z_UTIL_H + +#include "zlib.h" + +#if defined(MSDOS)||defined(VMS)||defined(CRAY)||defined(WIN32)||defined(RISCOS)||defined(__UNIXOS2__)||defined(STDC) +# include +# include +#else + extern int errno; +#endif +#ifdef STDC +# include +# include +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + +extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ +/* (size given to avoid silly warnings with Visual C++) */ + +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] + +#define ERR_RETURN(strm,err) \ + return (strm->msg = (char*)ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + +#ifdef MSDOS +# define OS_CODE 0x00 +# if defined(__TURBOC__) || defined(__BORLANDC__) +# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) + /* Allow compilation with ANSI keywords only enabled */ + void _Cdecl farfree( void *block ); + void *_Cdecl farmalloc( unsigned long nbytes ); +# else +# include +# endif +# else /* MSC or DJGPP */ +# include +# endif +#endif + +#ifdef OS2 +# define OS_CODE 0x06 +#endif + +#ifdef WIN32 /* Window 95 & Windows NT */ +# define OS_CODE 0x0b +#endif + +#if defined(VAXC) || defined(VMS) +# define OS_CODE 0x02 +# define F_OPEN(name, mode) \ + fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") +#endif + +#ifdef AMIGA +# define OS_CODE 0x01 +#endif + +#if defined(ATARI) || defined(atarist) +# define OS_CODE 0x05 +#endif + +#if defined(MACOS) || defined(TARGET_OS_MAC) +# define OS_CODE 0x07 +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fdopen */ +# else +# ifndef fdopen +# define fdopen(fd,mode) NULL /* No fdopen() */ +# endif +# endif +#endif + +#ifdef __50SERIES /* Prime/PRIMOS */ +# define OS_CODE 0x0F +#endif + +#ifdef TOPS20 +# define OS_CODE 0x0a +#endif + +#if defined(_BEOS_) || defined(RISCOS) +# define fdopen(fd,mode) NULL /* No fdopen() */ +#endif + +#if (defined(_MSC_VER) && (_MSC_VER > 600)) +# define fdopen(fd,type) _fdopen(fd,type) +#endif + + + /* Common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#ifdef HAVE_STRERROR + extern char *strerror OF((int)); +# define zstrerror(errnum) strerror(errnum) +#else +# define zstrerror(errnum) "" +#endif + +#if defined(pyr) +# define NO_MEMCPY +#endif +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) + /* Use our own functions for small and medium model with MSC <= 5.0. + * You may have to use the same strategy for Borland C (untested). + * The __SC__ check is for Symantec. + */ +# define NO_MEMCPY +#endif +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) +# define HAVE_MEMCPY +#endif +#ifdef HAVE_MEMCPY +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ +# define zmemcpy _fmemcpy +# define zmemcmp _fmemcmp +# define zmemzero(dest, len) _fmemset(dest, 0, len) +# else +# define zmemcpy memcpy +# define zmemcmp memcmp +# define zmemzero(dest, len) memset(dest, 0, len) +# endif +#else + extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + extern void zmemzero OF((Bytef* dest, uInt len)); +#endif + +/* Diagnostic functions */ +#ifdef DEBUG +# include + extern int z_verbose; + extern void z_error OF((char *m)); +# define Assert(cond,msg) {if(!(cond)) z_error(msg);} +# define Trace(x) {if (z_verbose>=0) fprintf x ;} +# define Tracev(x) {if (z_verbose>0) fprintf x ;} +# define Tracevv(x) {if (z_verbose>1) fprintf x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + + +typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, + uInt len)); +voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); +void zcfree OF((voidpf opaque, voidpf ptr)); + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + +#endif /* _Z_UTIL_H */ Index: xc/fonts/Imakefile diff -u xc/fonts/Imakefile:3.8 xc/fonts/Imakefile:3.11 --- xc/fonts/Imakefile:3.8 Fri May 31 14:45:38 2002 +++ xc/fonts/Imakefile Thu Jan 8 14:02:28 2004 @@ -3,22 +3,19 @@ -XCOMM $XFree86: xc/fonts/Imakefile,v 3.8 2002/05/31 18:45:38 dawes Exp $ +XCOMM $XFree86: xc/fonts/Imakefile,v 3.11 2004/01/08 19:02:28 dawes Exp $ #define IHaveSubdirs #define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" -#if BuildSpeedoFonts || BuildType1Fonts || BuildCIDFonts || BuildTTFonts +#if BuildSpeedoFonts || BuildType1Fonts || BuildCIDFonts || BuildTrueTypeFonts SCALEDDIR = scaled -ENCODINGDIR = encodings #endif -FONTDIRS = bdf $(SCALEDDIR) +ENCODINGDIR = encodings -#if BuildPexExt -PEXDIR = PEX -#endif +FONTDIRS = bdf $(SCALEDDIR) -SUBDIRS = $(ENCODINGDIR) util bdf $(SCALEDDIR) $(PEXDIR) +SUBDIRS = $(ENCODINGDIR) util bdf $(SCALEDDIR) #if MakeLocalFontDir MakeDirectories(install,$(FONTDIR)/local) Index: xc/fonts/PEX/Imakefile diff -u xc/fonts/PEX/Imakefile:3.8 xc/fonts/PEX/Imakefile:removed --- xc/fonts/PEX/Imakefile:3.8 Wed Jan 17 12:33:08 2001 +++ xc/fonts/PEX/Imakefile Sat Feb 28 21:40:45 2004 @@ -1,88 +0,0 @@ -XCOMM -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:42:52 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/fonts/PEX/Imakefile,v 3.8 2001/01/17 17:33:08 dawes Exp $ -XCOMM -XCOMM -XCOMM Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. -XCOMM -XCOMM All Rights Reserved -XCOMM -XCOMM Permission to use, copy, modify, and distribute this software and its -XCOMM documentation for any purpose and without fee is hereby granted, -XCOMM provided that the above copyright notice appear in all copies and that -XCOMM both that copyright notice and this permission notice appear in -XCOMM supporting documentation, and that the name of Sun Microsystems, -XCOMM not be used in advertising or publicity -XCOMM pertaining to distribution of the software without specific, written -XCOMM prior permission. -XCOMM -XCOMM SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -XCOMM EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR -XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF -XCOMM USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -XCOMM OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -XCOMM PERFORMANCE OF THIS SOFTWARE. - -#define PassCDebugFlags - -#ifndef PexFontCDebugFlags -#define PexFontCDebugFlags OptimizedCDebugFlags -#endif - -#ifndef PexFontDefines -#define PexFontDefines -#endif - -.SUFFIXES: $(SUFFIXES) .src .phont - -CDEBUGFLAGS = PexFontCDebugFlags - DEFINES = PexFontDefines - - YFLAGS = -d - - LINTFLAGS = -u - LIBS = LexLib MathLibrary - - FONTS = Roman Roman_M - -XCOMM Original sources for the font files - FONTS_SRC = Roman.src Roman_M.src - -XCOMM Binary (run-time) versions -FONTS_BINARY = Roman.phont Roman_M.phont - - SRCS = to_wfont.c lex.c - OBJS = to_wfont.o lex.o - - TOWFONT = ./to_wfont - -all:: ProgramTargetName(to_wfont) $(FONTS_BINARY) - -install:: ProgramTargetName(to_wfont) - -LexFile(lex) - -YaccFile(to_wfont,$(YFLAGS)) - -SingleProgramTarget(to_wfont,$(OBJS),$(LIBS),NullParameter) - -XCOMM The following two dependencies work around a problem with gnumake - -Roman.phont: ProgramTargetName(to_wfont) - -Roman_M.phont: ProgramTargetName(to_wfont) - -.src.phont: ProgramTargetName(to_wfont) - RunProgram(TOWFONT,-o $@ $<) - -clean:: - RemoveFiles($(FONTS_BINARY)) - -DependTarget() - -InstallMultipleFlags($(FONTS_BINARY),$(FONTDIR)/PEX,$(INSTDATFLAGS)) Index: xc/fonts/PEX/Roman.src diff -u xc/fonts/PEX/Roman.src:1.1.1.2 xc/fonts/PEX/Roman.src:removed --- xc/fonts/PEX/Roman.src:1.1.1.2 Tue Jan 16 18:07:24 2001 +++ xc/fonts/PEX/Roman.src Sat Feb 28 21:40:45 2004 @@ -1,603 +0,0 @@ -## -# $Xorg: Roman.src,v 1.3 2000/08/17 19:42:52 cpqbld Exp $ -## -## Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium. -## -## All Rights Reserved -## -## Permission to use, copy, modify, and distribute this software and its -## documentation for any purpose and without fee is hereby granted, -## 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 names of Sun Microsystems -## and the X Consortium not be used in advertising or publicity -## pertaining to distribution of the software without specific, written -## prior permission. -## -## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -## EVENT SHALL SUN MICROSYSTEMS OR THE X CONSORTIUM 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. -# Roman Simplex font. - - FONTNAME Roman - TOP 119.0476 - BOTTOM -33.3333 - NUM_CH 128 - PROPERTIES 3 - - (CHARSET_REGISTRY ISO8859) - (CHARSET_ENCODING "1") - (SPACING P) - -INDEX 32 STROKE 0 CENTER 52.3810 RIGHT 104.7619 -INDEX 33 STROKE 2 CENTER 4.7619 RIGHT 9.5238 - OPEN 2 (4.7619 100.0000) (4.7619 33.3333) - OPEN 5 (4.7619 9.5238) (0.0000 4.7619) (4.7619 0.0000) - (9.5238 4.7619) (4.7619 9.5238) -INDEX 34 STROKE 2 CENTER 19.0476 RIGHT 38.0952 - OPEN 2 (0.0000 100.0000) (0.0000 66.6667) - OPEN 2 (38.0952 100.0000) (38.0952 66.6667) -INDEX 35 STROKE 4 CENTER 33.3333 RIGHT 71.4286 - OPEN 2 (38.0952 119.0476) (4.7619 -33.3333) - OPEN 2 (66.6667 119.0476) (33.3333 -33.3333) - OPEN 2 (4.7619 57.1429) (71.4286 57.1429) - OPEN 2 (0.0000 28.5714) (66.6667 28.5714) -INDEX 36 STROKE 3 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (23.8095 119.0476) (23.8095 -19.0476) - OPEN 2 (42.8571 119.0476) (42.8571 -19.0476) - OPEN 20 (66.6667 85.7143) (57.1429 95.2381) (42.8571 100.0000) - (23.8095 100.0000) (9.5238 95.2381) (0.0000 85.7143) (0.0000 76.1905) - (4.7619 66.6667) (9.5238 61.9048) (19.0476 57.1429) (47.6190 47.6190) - (57.1429 42.8571) (61.9048 38.0952) (66.6667 28.5714) (66.6667 14.2857) - (57.1429 4.7619) (42.8571 0.0000) (23.8095 0.0000) (9.5238 4.7619) - (0.0000 14.2857) -INDEX 37 STROKE 3 CENTER 42.8571 RIGHT 85.7143 - OPEN 2 (85.7143 100.0000) (0.0000 0.0000) - OPEN 16 (23.8095 100.0000) (33.3333 90.4762) (33.3333 80.9524) - (28.5714 71.4286) (19.0476 66.6667) (9.5238 66.6667) (0.0000 76.1905) - (0.0000 85.7143) (4.7619 95.2381) (14.2857 100.0000) (23.8095 100.0000) - (33.3333 95.2381) (47.6190 90.4762) (61.9048 90.4762) (76.1905 95.2381) - (85.7143 100.0000) - OPEN 11 (66.6667 33.3333) (57.1429 28.5714) (52.3810 19.0476) - (52.3810 9.5238) (61.9048 0.0000) (71.4286 0.0000) (80.9524 4.7619) - (85.7143 14.2857) (85.7143 23.8095) (76.1905 33.3333) (66.6667 33.3333) -INDEX 38 STROKE 1 CENTER 47.6190 RIGHT 95.2381 - OPEN 34 (95.2381 57.1429) (95.2381 61.9048) (90.4762 66.6667) - (85.7143 66.6667) (80.9524 61.9048) (76.1905 52.3810) (66.6667 28.5714) - (57.1429 14.2857) (47.6190 4.7619) (38.0952 0.0000) (19.0476 0.0000) - (9.5238 4.7619) (4.7619 9.5238) (0.0000 19.0476) (0.0000 28.5714) - (4.7619 38.0952) (9.5238 42.8571) (42.8571 61.9048) (47.6190 66.6667) - (52.3810 76.1905) (52.3810 85.7143) (47.6190 95.2381) (38.0952 100.0000) - (28.5714 95.2381) (23.8095 85.7143) (23.8095 76.1905) (28.5714 61.9048) - (38.0952 47.6190) (61.9048 14.2857) (71.4286 4.7619) (80.9524 0.0000) - (90.4762 0.0000) (95.2381 4.7619) (95.2381 9.5238) -INDEX 39 STROKE 1 CENTER 0.0000 RIGHT 0.0000 - OPEN 2 (0.0000 100.0000) (0.0000 66.6667) -INDEX 40 STROKE 1 CENTER 14.2857 RIGHT 33.3333 - OPEN 10 (33.3333 119.0476) (23.8095 109.5238) (14.2857 95.2381) - (4.7619 76.1905) (0.0000 52.3810) (0.0000 33.3333) (4.7619 9.5238) - (14.2857 -9.5238) (23.8095 -23.8095) (33.3333 -33.3333) -INDEX 41 STROKE 1 CENTER 19.0476 RIGHT 33.3333 - OPEN 10 (0.0000 119.0476) (9.5238 109.5238) (19.0476 95.2381) - (28.5714 76.1905) (33.3333 52.3810) (33.3333 33.3333) (28.5714 9.5238) - (19.0476 -9.5238) (9.5238 -23.8095) (0.0000 -33.3333) -INDEX 42 STROKE 3 CENTER 23.8095 RIGHT 47.6190 - OPEN 2 (23.8095 71.4286) (23.8095 14.2857) - OPEN 2 (0.0000 57.1429) (47.6190 28.5714) - OPEN 2 (47.6190 57.1429) (0.0000 28.5714) -INDEX 43 STROKE 2 CENTER 42.8571 RIGHT 85.7143 - OPEN 2 (42.8571 85.7143) (42.8571 0.0000) - OPEN 2 (0.0000 42.8571) (85.7143 42.8571) -INDEX 44 STROKE 1 CENTER 4.7619 RIGHT 9.5238 - OPEN 8 (9.5238 4.7619) (4.7619 0.0000) (0.0000 4.7619) - (4.7619 9.5238) (9.5238 4.7619) (9.5238 -4.7619) (4.7619 -14.2857) - (0.0000 -19.0476) -INDEX 45 STROKE 1 CENTER 42.8571 RIGHT 85.7143 - OPEN 2 (0.0000 42.8571) (85.7143 42.8571) -INDEX 46 STROKE 1 CENTER 4.7619 RIGHT 9.5238 - OPEN 5 (4.7619 9.5238) (0.0000 4.7619) (4.7619 0.0000) - (9.5238 4.7619) (4.7619 9.5238) -INDEX 47 STROKE 1 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 -14.2857) (66.6667 100.0000) -INDEX 48 STROKE 1 CENTER 33.3333 RIGHT 66.6667 - OPEN 17 (28.5714 100.0000) (14.2857 95.2381) (4.7619 80.9524) - (0.0000 57.1429) (0.0000 42.8571) (4.7619 19.0476) (14.2857 4.7619) - (28.5714 0.0000) (38.0952 0.0000) (52.3810 4.7619) (61.9048 19.0476) - (66.6667 42.8571) (66.6667 57.1429) (61.9048 80.9524) (52.3810 95.2381) - (38.0952 100.0000) (28.5714 100.0000) -INDEX 49 STROKE 1 CENTER 19.0476 RIGHT 23.8095 - OPEN 4 (0.0000 80.9524) (9.5238 85.7143) (23.8095 100.0000) - (23.8095 0.0000) -INDEX 50 STROKE 1 CENTER 33.3333 RIGHT 66.6667 - OPEN 14 (4.7619 76.1905) (4.7619 80.9524) (9.5238 90.4762) - (14.2857 95.2381) (23.8095 100.0000) (42.8571 100.0000) (52.3810 95.2381) - (57.1429 90.4762) (61.9048 80.9524) (61.9048 71.4286) (57.1429 61.9048) - (47.6190 47.6190) (0.0000 0.0000) (66.6667 0.0000) -INDEX 51 STROKE 1 CENTER 33.3333 RIGHT 66.6667 - OPEN 15 (9.5238 100.0000) (61.9048 100.0000) (33.3333 61.9048) - (47.6190 61.9048) (57.1429 57.1429) (61.9048 52.3810) (66.6667 38.0952) - (66.6667 28.5714) (61.9048 14.2857) (52.3810 4.7619) (38.0952 0.0000) - (23.8095 0.0000) (9.5238 4.7619) (4.7619 9.5238) (0.0000 19.0476) -INDEX 52 STROKE 2 CENTER 33.3333 RIGHT 71.4286 - OPEN 3 (47.6190 100.0000) (0.0000 33.3333) (71.4286 33.3333) - OPEN 2 (47.6190 100.0000) (47.6190 0.0000) -INDEX 53 STROKE 1 CENTER 33.3333 RIGHT 66.6667 - OPEN 17 (57.1429 100.0000) (9.5238 100.0000) (4.7619 57.1429) - (9.5238 61.9048) (23.8095 66.6667) (38.0952 66.6667) (52.3810 61.9048) - (61.9048 52.3810) (66.6667 38.0952) (66.6667 28.5714) (61.9048 14.2857) - (52.3810 4.7619) (38.0952 0.0000) (23.8095 0.0000) (9.5238 4.7619) - (4.7619 9.5238) (0.0000 19.0476) -INDEX 54 STROKE 1 CENTER 28.5714 RIGHT 61.9048 - OPEN 23 (57.1429 85.7143) (52.3810 95.2381) (38.0952 100.0000) - (28.5714 100.0000) (14.2857 95.2381) (4.7619 80.9524) (0.0000 57.1429) - (0.0000 33.3333) (4.7619 14.2857) (14.2857 4.7619) (28.5714 0.0000) - (33.3333 0.0000) (47.6190 4.7619) (57.1429 14.2857) (61.9048 28.5714) - (61.9048 33.3333) (57.1429 47.6190) (47.6190 57.1429) (33.3333 61.9048) - (28.5714 61.9048) (14.2857 57.1429) (4.7619 47.6190) (0.0000 33.3333) -INDEX 55 STROKE 2 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (66.6667 100.0000) (19.0476 0.0000) - OPEN 2 (0.0000 100.0000) (66.6667 100.0000) -INDEX 56 STROKE 1 CENTER 33.3333 RIGHT 66.6667 - OPEN 29 (23.8095 100.0000) (9.5238 95.2381) (4.7619 85.7143) - (4.7619 76.1905) (9.5238 66.6667) (19.0476 61.9048) (38.0952 57.1429) - (52.3810 52.3810) (61.9048 42.8571) (66.6667 33.3333) (66.6667 19.0476) - (61.9048 9.5238) (57.1429 4.7619) (42.8571 0.0000) (23.8095 0.0000) - (9.5238 4.7619) (4.7619 9.5238) (0.0000 19.0476) (0.0000 33.3333) - (4.7619 42.8571) (14.2857 52.3810) (28.5714 57.1429) (47.6190 61.9048) - (57.1429 66.6667) (61.9048 76.1905) (61.9048 85.7143) (57.1429 95.2381) - (42.8571 100.0000) (23.8095 100.0000) -INDEX 57 STROKE 1 CENTER 33.3333 RIGHT 61.9048 - OPEN 23 (61.9048 66.6667) (57.1429 52.3810) (47.6190 42.8571) - (33.3333 38.0952) (28.5714 38.0952) (14.2857 42.8571) (4.7619 52.3810) - (0.0000 66.6667) (0.0000 71.4286) (4.7619 85.7143) (14.2857 95.2381) - (28.5714 100.0000) (33.3333 100.0000) (47.6190 95.2381) (57.1429 85.7143) - (61.9048 66.6667) (61.9048 42.8571) (57.1429 19.0476) (47.6190 4.7619) - (33.3333 0.0000) (23.8095 0.0000) (9.5238 4.7619) (4.7619 14.2857) -INDEX 58 STROKE 2 CENTER 4.7619 RIGHT 9.5238 - OPEN 5 (4.7619 66.6667) (0.0000 61.9048) (4.7619 57.1429) - (9.5238 61.9048) (4.7619 66.6667) - OPEN 5 (4.7619 9.5238) (0.0000 4.7619) (4.7619 0.0000) - (9.5238 4.7619) (4.7619 9.5238) -INDEX 59 STROKE 2 CENTER 4.7619 RIGHT 9.5238 - OPEN 5 (4.7619 66.6667) (0.0000 61.9048) (4.7619 57.1429) - (9.5238 61.9048) (4.7619 66.6667) - OPEN 8 (9.5238 4.7619) (4.7619 0.0000) (0.0000 4.7619) - (4.7619 9.5238) (9.5238 4.7619) (9.5238 -4.7619) (4.7619 -14.2857) - (0.0000 -19.0476) -INDEX 60 STROKE 1 CENTER 38.0952 RIGHT 76.1905 - OPEN 3 (76.1905 85.7143) (0.0000 42.8571) (76.1905 0.0000) -INDEX 61 STROKE 2 CENTER 42.8571 RIGHT 85.7143 - OPEN 2 (0.0000 57.1429) (85.7143 57.1429) - OPEN 2 (0.0000 28.5714) (85.7143 28.5714) -INDEX 62 STROKE 1 CENTER 38.0952 RIGHT 76.1905 - OPEN 3 (0.0000 85.7143) (76.1905 42.8571) (0.0000 0.0000) -INDEX 63 STROKE 2 CENTER 28.5714 RIGHT 57.1429 - OPEN 14 (0.0000 76.1905) (0.0000 80.9524) (4.7619 90.4762) - (9.5238 95.2381) (19.0476 100.0000) (38.0952 100.0000) (47.6190 95.2381) - (52.3810 90.4762) (57.1429 80.9524) (57.1429 71.4286) (52.3810 61.9048) - (47.6190 57.1429) (28.5714 47.6190) (28.5714 33.3333) - OPEN 5 (28.5714 9.5238) (23.8095 4.7619) (28.5714 0.0000) - (33.3333 4.7619) (28.5714 9.5238) -INDEX 64 STROKE 2 CENTER 28.5714 RIGHT 61.9048 - OPEN 8 (42.8571 52.3810) (33.3333 57.1429) (23.8095 57.1429) - (19.0476 47.6190) (19.0476 42.8571) (23.8095 33.3333) (33.3333 33.3333) - (42.8571 38.0952) - OPEN 19 (42.8571 57.1429) (42.8571 38.0952) (47.6190 33.3333) - (57.1429 33.3333) (61.9048 42.8571) (61.9048 47.6190) (57.1429 61.9048) - (47.6190 71.4286) (33.3333 76.1905) (28.5714 76.1905) (14.2857 71.4286) - (4.7619 61.9048) (0.0000 47.6190) (0.0000 42.8571) (4.7619 28.5714) - (14.2857 19.0476) (28.5714 14.2857) (33.3333 14.2857) (47.6190 19.0476) -INDEX 65 STROKE 3 CENTER 38.0952 RIGHT 76.1905 - OPEN 2 (38.0952 100.0000) (0.0000 0.0000) - OPEN 2 (38.0952 100.0000) (76.1905 0.0000) - OPEN 2 (14.2857 33.3333) (61.9048 33.3333) -INDEX 66 STROKE 3 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 9 (0.0000 100.0000) (42.8571 100.0000) (57.1429 95.2381) - (61.9048 90.4762) (66.6667 80.9524) (66.6667 71.4286) (61.9048 61.9048) - (57.1429 57.1429) (42.8571 52.3810) - OPEN 10 (0.0000 52.3810) (42.8571 52.3810) (57.1429 47.6190) - (61.9048 42.8571) (66.6667 33.3333) (66.6667 19.0476) (61.9048 9.5238) - (57.1429 4.7619) (42.8571 0.0000) (0.0000 0.0000) -INDEX 67 STROKE 1 CENTER 33.3333 RIGHT 71.4286 - OPEN 18 (71.4286 76.1905) (66.6667 85.7143) (57.1429 95.2381) - (47.6190 100.0000) (28.5714 100.0000) (19.0476 95.2381) (9.5238 85.7143) - (4.7619 76.1905) (0.0000 61.9048) (0.0000 38.0952) (4.7619 23.8095) - (9.5238 14.2857) (19.0476 4.7619) (28.5714 0.0000) (47.6190 0.0000) - (57.1429 4.7619) (66.6667 14.2857) (71.4286 23.8095) -INDEX 68 STROKE 2 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 12 (0.0000 100.0000) (33.3333 100.0000) (47.6190 95.2381) - (57.1429 85.7143) (61.9048 76.1905) (66.6667 61.9048) (66.6667 38.0952) - (61.9048 23.8095) (57.1429 14.2857) (47.6190 4.7619) (33.3333 0.0000) - (0.0000 0.0000) -INDEX 69 STROKE 4 CENTER 28.5714 RIGHT 61.9048 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 2 (0.0000 100.0000) (61.9048 100.0000) - OPEN 2 (0.0000 52.3810) (38.0952 52.3810) - OPEN 2 (0.0000 0.0000) (61.9048 0.0000) -INDEX 70 STROKE 3 CENTER 28.5714 RIGHT 61.9048 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 2 (0.0000 100.0000) (61.9048 100.0000) - OPEN 2 (0.0000 52.3810) (38.0952 52.3810) -INDEX 71 STROKE 2 CENTER 33.3333 RIGHT 71.4286 - OPEN 19 (71.4286 76.1905) (66.6667 85.7143) (57.1429 95.2381) - (47.6190 100.0000) (28.5714 100.0000) (19.0476 95.2381) (9.5238 85.7143) - (4.7619 76.1905) (0.0000 61.9048) (0.0000 38.0952) (4.7619 23.8095) - (9.5238 14.2857) (19.0476 4.7619) (28.5714 0.0000) (47.6190 0.0000) - (57.1429 4.7619) (66.6667 14.2857) (71.4286 23.8095) (71.4286 38.0952) - OPEN 2 (47.6190 38.0952) (71.4286 38.0952) -INDEX 72 STROKE 3 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 2 (66.6667 100.0000) (66.6667 0.0000) - OPEN 2 (0.0000 52.3810) (66.6667 52.3810) -INDEX 73 STROKE 1 CENTER 0.0000 RIGHT 0.0000 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) -INDEX 74 STROKE 1 CENTER 28.5714 RIGHT 47.6190 - OPEN 10 (47.6190 100.0000) (47.6190 23.8095) (42.8571 9.5238) - (38.0952 4.7619) (28.5714 0.0000) (19.0476 0.0000) (9.5238 4.7619) - (4.7619 9.5238) (0.0000 23.8095) (0.0000 33.3333) -INDEX 75 STROKE 3 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 2 (66.6667 100.0000) (0.0000 33.3333) - OPEN 2 (23.8095 57.1429) (66.6667 0.0000) -INDEX 76 STROKE 2 CENTER 28.5714 RIGHT 57.1429 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 2 (0.0000 0.0000) (57.1429 0.0000) -INDEX 77 STROKE 4 CENTER 38.0952 RIGHT 76.1905 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 2 (0.0000 100.0000) (38.0952 0.0000) - OPEN 2 (76.1905 100.0000) (38.0952 0.0000) - OPEN 2 (76.1905 100.0000) (76.1905 0.0000) -INDEX 78 STROKE 3 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 2 (0.0000 100.0000) (66.6667 0.0000) - OPEN 2 (66.6667 100.0000) (66.6667 0.0000) -INDEX 79 STROKE 1 CENTER 38.0952 RIGHT 76.1905 - OPEN 21 (28.5714 100.0000) (19.0476 95.2381) (9.5238 85.7143) - (4.7619 76.1905) (0.0000 61.9048) (0.0000 38.0952) (4.7619 23.8095) - (9.5238 14.2857) (19.0476 4.7619) (28.5714 0.0000) (47.6190 0.0000) - (57.1429 4.7619) (66.6667 14.2857) (71.4286 23.8095) (76.1905 38.0952) - (76.1905 61.9048) (71.4286 76.1905) (66.6667 85.7143) (57.1429 95.2381) - (47.6190 100.0000) (28.5714 100.0000) -INDEX 80 STROKE 2 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 10 (0.0000 100.0000) (42.8571 100.0000) (57.1429 95.2381) - (61.9048 90.4762) (66.6667 80.9524) (66.6667 66.6667) (61.9048 57.1429) - (57.1429 52.3810) (42.8571 47.6190) (0.0000 47.6190) -INDEX 81 STROKE 2 CENTER 38.0952 RIGHT 76.1905 - OPEN 21 (28.5714 100.0000) (19.0476 95.2381) (9.5238 85.7143) - (4.7619 76.1905) (0.0000 61.9048) (0.0000 38.0952) (4.7619 23.8095) - (9.5238 14.2857) (19.0476 4.7619) (28.5714 0.0000) (47.6190 0.0000) - (57.1429 4.7619) (66.6667 14.2857) (71.4286 23.8095) (76.1905 38.0952) - (76.1905 61.9048) (71.4286 76.1905) (66.6667 85.7143) (57.1429 95.2381) - (47.6190 100.0000) (28.5714 100.0000) - OPEN 2 (42.8571 19.0476) (71.4286 -9.5238) -INDEX 82 STROKE 3 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 10 (0.0000 100.0000) (42.8571 100.0000) (57.1429 95.2381) - (61.9048 90.4762) (66.6667 80.9524) (66.6667 71.4286) (61.9048 61.9048) - (57.1429 57.1429) (42.8571 52.3810) (0.0000 52.3810) - OPEN 2 (33.3333 52.3810) (66.6667 0.0000) -INDEX 83 STROKE 1 CENTER 33.3333 RIGHT 66.6667 - OPEN 20 (66.6667 85.7143) (57.1429 95.2381) (42.8571 100.0000) - (23.8095 100.0000) (9.5238 95.2381) (0.0000 85.7143) (0.0000 76.1905) - (4.7619 66.6667) (9.5238 61.9048) (19.0476 57.1429) (47.6190 47.6190) - (57.1429 42.8571) (61.9048 38.0952) (66.6667 28.5714) (66.6667 14.2857) - (57.1429 4.7619) (42.8571 0.0000) (23.8095 0.0000) (9.5238 4.7619) - (0.0000 14.2857) -INDEX 84 STROKE 2 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (33.3333 100.0000) (33.3333 0.0000) - OPEN 2 (0.0000 100.0000) (66.6667 100.0000) -INDEX 85 STROKE 1 CENTER 33.3333 RIGHT 66.6667 - OPEN 10 (0.0000 100.0000) (0.0000 28.5714) (4.7619 14.2857) - (14.2857 4.7619) (28.5714 0.0000) (38.0952 0.0000) (52.3810 4.7619) - (61.9048 14.2857) (66.6667 28.5714) (66.6667 100.0000) -INDEX 86 STROKE 2 CENTER 38.0952 RIGHT 76.1905 - OPEN 2 (0.0000 100.0000) (38.0952 0.0000) - OPEN 2 (76.1905 100.0000) (38.0952 0.0000) -INDEX 87 STROKE 4 CENTER 47.6190 RIGHT 95.2381 - OPEN 2 (0.0000 100.0000) (23.8095 0.0000) - OPEN 2 (47.6190 100.0000) (23.8095 0.0000) - OPEN 2 (47.6190 100.0000) (71.4286 0.0000) - OPEN 2 (95.2381 100.0000) (71.4286 0.0000) -INDEX 88 STROKE 2 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 100.0000) (66.6667 0.0000) - OPEN 2 (66.6667 100.0000) (0.0000 0.0000) -INDEX 89 STROKE 2 CENTER 38.0952 RIGHT 76.1905 - OPEN 3 (0.0000 100.0000) (38.0952 52.3810) (38.0952 0.0000) - OPEN 2 (76.1905 100.0000) (38.0952 52.3810) -INDEX 90 STROKE 3 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (66.6667 100.0000) (0.0000 0.0000) - OPEN 2 (0.0000 100.0000) (66.6667 100.0000) - OPEN 2 (0.0000 0.0000) (66.6667 0.0000) -INDEX 91 STROKE 4 CENTER 14.2857 RIGHT 33.3333 - OPEN 2 (0.0000 119.0476) (0.0000 -33.3333) - OPEN 2 (4.7619 119.0476) (4.7619 -33.3333) - OPEN 2 (0.0000 119.0476) (33.3333 119.0476) - OPEN 2 (0.0000 -33.3333) (33.3333 -33.3333) -INDEX 92 STROKE 1 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (0.0000 100.0000) (66.6667 -14.2857) -INDEX 93 STROKE 4 CENTER 19.0476 RIGHT 33.3333 - OPEN 2 (28.5714 119.0476) (28.5714 -33.3333) - OPEN 2 (33.3333 119.0476) (33.3333 -33.3333) - OPEN 2 (0.0000 119.0476) (33.3333 119.0476) - OPEN 2 (0.0000 -33.3333) (33.3333 -33.3333) -INDEX 94 STROKE 2 CENTER 38.0952 RIGHT 76.1905 - OPEN 2 (38.0952 109.5238) (0.0000 42.8571) - OPEN 2 (38.0952 109.5238) (76.1905 42.8571) -INDEX 95 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 5 (0.0000 -33.3333) (104.7619 -33.3333) (104.7619 -28.5714) - (0.0000 -28.5714) (0.0000 -33.3333) -INDEX 96 STROKE 2 CENTER 14.2857 RIGHT 28.5714 - OPEN 2 (4.7619 100.0000) (28.5714 71.4286) - OPEN 3 (4.7619 100.0000) (0.0000 95.2381) (28.5714 71.4286) -INDEX 97 STROKE 2 CENTER 28.5714 RIGHT 57.1429 - OPEN 2 (57.1429 66.6667) (57.1429 0.0000) - OPEN 14 (57.1429 52.3810) (47.6190 61.9048) (38.0952 66.6667) - (23.8095 66.6667) (14.2857 61.9048) (4.7619 52.3810) (0.0000 38.0952) - (0.0000 28.5714) (4.7619 14.2857) (14.2857 4.7619) (23.8095 0.0000) - (38.0952 0.0000) (47.6190 4.7619) (57.1429 14.2857) -INDEX 98 STROKE 2 CENTER 28.5714 RIGHT 57.1429 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 14 (0.0000 52.3810) (9.5238 61.9048) (19.0476 66.6667) - (33.3333 66.6667) (42.8571 61.9048) (52.3810 52.3810) (57.1429 38.0952) - (57.1429 28.5714) (52.3810 14.2857) (42.8571 4.7619) (33.3333 0.0000) - (19.0476 0.0000) (9.5238 4.7619) (0.0000 14.2857) -INDEX 99 STROKE 1 CENTER 28.5714 RIGHT 57.1429 - OPEN 14 (57.1429 52.3810) (47.6190 61.9048) (38.0952 66.6667) - (23.8095 66.6667) (14.2857 61.9048) (4.7619 52.3810) (0.0000 38.0952) - (0.0000 28.5714) (4.7619 14.2857) (14.2857 4.7619) (23.8095 0.0000) - (38.0952 0.0000) (47.6190 4.7619) (57.1429 14.2857) -INDEX 100 STROKE 2 CENTER 28.5714 RIGHT 57.1429 - OPEN 2 (57.1429 100.0000) (57.1429 0.0000) - OPEN 14 (57.1429 52.3810) (47.6190 61.9048) (38.0952 66.6667) - (23.8095 66.6667) (14.2857 61.9048) (4.7619 52.3810) (0.0000 38.0952) - (0.0000 28.5714) (4.7619 14.2857) (14.2857 4.7619) (23.8095 0.0000) - (38.0952 0.0000) (47.6190 4.7619) (57.1429 14.2857) -INDEX 101 STROKE 1 CENTER 28.5714 RIGHT 57.1429 - OPEN 17 (0.0000 38.0952) (57.1429 38.0952) (57.1429 47.6190) - (52.3810 57.1429) (47.6190 61.9048) (38.0952 66.6667) (23.8095 66.6667) - (14.2857 61.9048) (4.7619 52.3810) (0.0000 38.0952) (0.0000 28.5714) - (4.7619 14.2857) (14.2857 4.7619) (23.8095 0.0000) (38.0952 0.0000) - (47.6190 4.7619) (57.1429 14.2857) -INDEX 102 STROKE 2 CENTER 14.2857 RIGHT 38.0952 - OPEN 5 (38.0952 100.0000) (28.5714 100.0000) (19.0476 95.2381) - (14.2857 80.9524) (14.2857 0.0000) - OPEN 2 (0.0000 66.6667) (33.3333 66.6667) -INDEX 103 STROKE 2 CENTER 28.5714 RIGHT 57.1429 - OPEN 7 (57.1429 66.6667) (57.1429 -9.5238) (52.3810 -23.8095) - (47.6190 -28.5714) (38.0952 -33.3333) (23.8095 -33.3333) (14.2857 -28.5714) - OPEN 14 (57.1429 52.3810) (47.6190 61.9048) (38.0952 66.6667) - (23.8095 66.6667) (14.2857 61.9048) (4.7619 52.3810) (0.0000 38.0952) - (0.0000 28.5714) (4.7619 14.2857) (14.2857 4.7619) (23.8095 0.0000) - (38.0952 0.0000) (47.6190 4.7619) (57.1429 14.2857) -INDEX 104 STROKE 2 CENTER 23.8095 RIGHT 52.3810 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 7 (0.0000 47.6190) (14.2857 61.9048) (23.8095 66.6667) - (38.0952 66.6667) (47.6190 61.9048) (52.3810 47.6190) (52.3810 0.0000) -INDEX 105 STROKE 2 CENTER 4.7619 RIGHT 9.5238 - OPEN 5 (0.0000 100.0000) (4.7619 95.2381) (9.5238 100.0000) - (4.7619 104.7619) (0.0000 100.0000) - OPEN 2 (4.7619 66.6667) (4.7619 0.0000) -INDEX 106 STROKE 2 CENTER 19.0476 RIGHT 28.5714 - OPEN 5 (19.0476 100.0000) (23.8095 95.2381) (28.5714 100.0000) - (23.8095 104.7619) (19.0476 100.0000) - OPEN 5 (23.8095 66.6667) (23.8095 -14.2857) (19.0476 -28.5714) - (9.5238 -33.3333) (0.0000 -33.3333) -INDEX 107 STROKE 3 CENTER 23.8095 RIGHT 52.3810 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) - OPEN 2 (47.6190 66.6667) (0.0000 19.0476) - OPEN 2 (19.0476 38.0952) (52.3810 0.0000) -INDEX 108 STROKE 1 CENTER 0.0000 RIGHT 0.0000 - OPEN 2 (0.0000 100.0000) (0.0000 0.0000) -INDEX 109 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (0.0000 66.6667) (0.0000 0.0000) - OPEN 7 (0.0000 47.6190) (14.2857 61.9048) (23.8095 66.6667) - (38.0952 66.6667) (47.6190 61.9048) (52.3810 47.6190) (52.3810 0.0000) - OPEN 7 (52.3810 47.6190) (66.6667 61.9048) (76.1905 66.6667) - (90.4762 66.6667) (100.0000 61.9048) (104.7619 47.6190) (104.7619 0.0000) -INDEX 110 STROKE 2 CENTER 23.8095 RIGHT 52.3810 - OPEN 2 (0.0000 66.6667) (0.0000 0.0000) - OPEN 7 (0.0000 47.6190) (14.2857 61.9048) (23.8095 66.6667) - (38.0952 66.6667) (47.6190 61.9048) (52.3810 47.6190) (52.3810 0.0000) -INDEX 111 STROKE 1 CENTER 28.5714 RIGHT 61.9048 - OPEN 17 (23.8095 66.6667) (14.2857 61.9048) (4.7619 52.3810) - (0.0000 38.0952) (0.0000 28.5714) (4.7619 14.2857) (14.2857 4.7619) - (23.8095 0.0000) (38.0952 0.0000) (47.6190 4.7619) (57.1429 14.2857) - (61.9048 28.5714) (61.9048 38.0952) (57.1429 52.3810) (47.6190 61.9048) - (38.0952 66.6667) (23.8095 66.6667) -INDEX 112 STROKE 2 CENTER 28.5714 RIGHT 57.1429 - OPEN 2 (0.0000 66.6667) (0.0000 -33.3333) - OPEN 14 (0.0000 52.3810) (9.5238 61.9048) (19.0476 66.6667) - (33.3333 66.6667) (42.8571 61.9048) (52.3810 52.3810) (57.1429 38.0952) - (57.1429 28.5714) (52.3810 14.2857) (42.8571 4.7619) (33.3333 0.0000) - (19.0476 0.0000) (9.5238 4.7619) (0.0000 14.2857) -INDEX 113 STROKE 2 CENTER 28.5714 RIGHT 57.1429 - OPEN 2 (57.1429 66.6667) (57.1429 -33.3333) - OPEN 14 (57.1429 52.3810) (47.6190 61.9048) (38.0952 66.6667) - (23.8095 66.6667) (14.2857 61.9048) (4.7619 52.3810) (0.0000 38.0952) - (0.0000 28.5714) (4.7619 14.2857) (14.2857 4.7619) (23.8095 0.0000) - (38.0952 0.0000) (47.6190 4.7619) (57.1429 14.2857) -INDEX 114 STROKE 2 CENTER 14.2857 RIGHT 38.0952 - OPEN 2 (0.0000 66.6667) (0.0000 0.0000) - OPEN 5 (0.0000 38.0952) (4.7619 52.3810) (14.2857 61.9048) - (23.8095 66.6667) (38.0952 66.6667) -INDEX 115 STROKE 1 CENTER 23.8095 RIGHT 52.3810 - OPEN 17 (52.3810 52.3810) (47.6190 61.9048) (33.3333 66.6667) - (19.0476 66.6667) (4.7619 61.9048) (0.0000 52.3810) (4.7619 42.8571) - (14.2857 38.0952) (38.0952 33.3333) (47.6190 28.5714) (52.3810 19.0476) - (52.3810 14.2857) (47.6190 4.7619) (33.3333 0.0000) (19.0476 0.0000) - (4.7619 4.7619) (0.0000 14.2857) -INDEX 116 STROKE 2 CENTER 14.2857 RIGHT 38.0952 - OPEN 5 (14.2857 100.0000) (14.2857 19.0476) (19.0476 4.7619) - (28.5714 0.0000) (38.0952 0.0000) - OPEN 2 (0.0000 66.6667) (33.3333 66.6667) -INDEX 117 STROKE 2 CENTER 23.8095 RIGHT 52.3810 - OPEN 7 (0.0000 66.6667) (0.0000 19.0476) (4.7619 4.7619) - (14.2857 0.0000) (28.5714 0.0000) (38.0952 4.7619) (52.3810 19.0476) - OPEN 2 (52.3810 66.6667) (52.3810 0.0000) -INDEX 118 STROKE 2 CENTER 28.5714 RIGHT 57.1429 - OPEN 2 (0.0000 66.6667) (28.5714 0.0000) - OPEN 2 (57.1429 66.6667) (28.5714 0.0000) -INDEX 119 STROKE 4 CENTER 38.0952 RIGHT 76.1905 - OPEN 2 (0.0000 66.6667) (19.0476 0.0000) - OPEN 2 (38.0952 66.6667) (19.0476 0.0000) - OPEN 2 (38.0952 66.6667) (57.1429 0.0000) - OPEN 2 (76.1905 66.6667) (57.1429 0.0000) -INDEX 120 STROKE 2 CENTER 23.8095 RIGHT 52.3810 - OPEN 2 (0.0000 66.6667) (52.3810 0.0000) - OPEN 2 (52.3810 66.6667) (0.0000 0.0000) -INDEX 121 STROKE 2 CENTER 33.3333 RIGHT 61.9048 - OPEN 2 (4.7619 66.6667) (33.3333 0.0000) - OPEN 6 (61.9048 66.6667) (33.3333 0.0000) (23.8095 -19.0476) - (14.2857 -28.5714) (4.7619 -33.3333) (0.0000 -33.3333) -INDEX 122 STROKE 3 CENTER 23.8095 RIGHT 52.3810 - OPEN 2 (52.3810 66.6667) (0.0000 0.0000) - OPEN 2 (0.0000 66.6667) (52.3810 66.6667) - OPEN 2 (0.0000 0.0000) (52.3810 0.0000) -INDEX 123 STROKE 3 CENTER 14.2857 RIGHT 23.8095 - OPEN 10 (23.8095 119.0476) (14.2857 114.2857) (9.5238 109.5238) - (4.7619 100.0000) (4.7619 90.4762) (9.5238 80.9524) (14.2857 76.1905) - (19.0476 66.6667) (19.0476 57.1429) (9.5238 47.6190) - OPEN 17 (14.2857 114.2857) (9.5238 104.7619) (9.5238 95.2381) - (14.2857 85.7143) (19.0476 80.9524) (23.8095 71.4286) (23.8095 61.9048) - (19.0476 52.3810) (0.0000 42.8571) (19.0476 33.3333) (23.8095 23.8095) - (23.8095 14.2857) (19.0476 4.7619) (14.2857 0.0000) (9.5238 -9.5238) - (9.5238 -19.0476) (14.2857 -28.5714) - OPEN 10 (9.5238 38.0952) (19.0476 28.5714) (19.0476 19.0476) - (14.2857 9.5238) (9.5238 4.7619) (4.7619 -4.7619) (4.7619 -14.2857) - (9.5238 -23.8095) (14.2857 -28.5714) (23.8095 -33.3333) -INDEX 124 STROKE 1 CENTER 0.0000 RIGHT 0.0000 - OPEN 2 (0.0000 119.0476) (0.0000 -33.3333) -INDEX 125 STROKE 3 CENTER 9.5238 RIGHT 23.8095 - OPEN 10 (0.0000 119.0476) (9.5238 114.2857) (14.2857 109.5238) - (19.0476 100.0000) (19.0476 90.4762) (14.2857 80.9524) (9.5238 76.1905) - (4.7619 66.6667) (4.7619 57.1429) (14.2857 47.6190) - OPEN 17 (9.5238 114.2857) (14.2857 104.7619) (14.2857 95.2381) - (9.5238 85.7143) (4.7619 80.9524) (0.0000 71.4286) (0.0000 61.9048) - (4.7619 52.3810) (23.8095 42.8571) (4.7619 33.3333) (0.0000 23.8095) - (0.0000 14.2857) (4.7619 4.7619) (9.5238 0.0000) (14.2857 -9.5238) - (14.2857 -19.0476) (9.5238 -28.5714) - OPEN 10 (14.2857 38.0952) (4.7619 28.5714) (4.7619 19.0476) - (9.5238 9.5238) (14.2857 4.7619) (19.0476 -4.7619) (19.0476 -14.2857) - (14.2857 -23.8095) (9.5238 -28.5714) (0.0000 -33.3333) -INDEX 126 STROKE 2 CENTER 42.8571 RIGHT 85.7143 - OPEN 11 (0.0000 28.5714) (0.0000 38.0952) (4.7619 52.3810) - (14.2857 57.1429) (23.8095 57.1429) (33.3333 52.3810) (52.3810 38.0952) - (61.9048 33.3333) (71.4286 33.3333) (80.9524 38.0952) (85.7143 47.6190) - OPEN 11 (0.0000 38.0952) (4.7619 47.6190) (14.2857 52.3810) - (23.8095 52.3810) (33.3333 47.6190) (52.3810 33.3333) (61.9048 28.5714) - (71.4286 28.5714) (80.9524 33.3333) (85.7143 47.6190) (85.7143 57.1429) -INDEX 127 STROKE 2 CENTER 33.3333 RIGHT 66.6667 - OPEN 2 (52.3810 100.0000) (14.2857 -33.3333) - OPEN 17 (28.5714 66.6667) (14.2857 61.9048) (4.7619 52.3810) - (0.0000 38.0952) (0.0000 23.8095) (4.7619 14.2857) (14.2857 4.7619) - (28.5714 0.0000) (38.0952 0.0000) (52.3810 4.7619) (61.9048 14.2857) - (66.6667 28.5714) (66.6667 42.8571) (61.9048 52.3810) (52.3810 61.9048) - (38.0952 66.6667) (28.5714 66.6667) - - - -#/* NCGA GRAFNET:SANS-SERIF NORMAL*/ - -BEARING 32 L_SPACE 0.0 WIDTH 20.0 R_SPACE 0.0 -BEARING 33 L_SPACE 8.62 WIDTH 13.64 R_SPACE 8.48 -BEARING 34 L_SPACE 4.02 WIDTH 32.86 R_SPACE 9.32 -BEARING 35 L_SPACE 3.2 WIDTH 68.94 R_SPACE 4.86 -BEARING 36 L_SPACE 4.82 WIDTH 67.44 R_SPACE 4.72 -BEARING 37 L_SPACE 6.36 WIDTH 112.38 R_SPACE 4.5 -BEARING 38 L_SPACE 5.98 WIDTH 82.02 R_SPACE 0.54 -BEARING 39 L_SPACE 4.44 WIDTH 13.36 R_SPACE 9.18 -BEARING 40 L_SPACE 7.58 WIDTH 24.72 R_SPACE 6.26 -BEARING 41 L_SPACE 5.28 WIDTH 24.34 R_SPACE 8.92 -BEARING 42 L_SPACE 6.96 WIDTH 42.06 R_SPACE 4.86 -BEARING 43 L_SPACE 5.98 WIDTH 96.36 R_SPACE 5.56 -BEARING 44 L_SPACE 8.76 WIDTH 14.2 R_SPACE 7.78 -BEARING 45 L_SPACE 7.38 WIDTH 38.84 R_SPACE 7.66 -BEARING 46 L_SPACE 8.34 WIDTH 13.78 R_SPACE 8.62 -BEARING 47 L_SPACE 7.24 WIDTH 38.44 R_SPACE 8.2 -BEARING 48 L_SPACE 4.98 WIDTH 66.58 R_SPACE 5.42 -BEARING 49 L_SPACE 11.82 WIDTH 34.26 R_SPACE 30.9 -BEARING 50 L_SPACE 5.42 WIDTH 66.0 R_SPACE 5.56 -BEARING 51 L_SPACE 5.0 WIDTH 66.62 R_SPACE 5.38 -BEARING 52 L_SPACE 3.88 WIDTH 68.24 R_SPACE 4.86 -BEARING 53 L_SPACE 4.86 WIDTH 65.96 R_SPACE 6.16 -BEARING 54 L_SPACE 5.58 WIDTH 65.08 R_SPACE 6.32 -BEARING 55 L_SPACE 5.56 WIDTH 66.42 R_SPACE 5.0 -BEARING 56 L_SPACE 5.6 WIDTH 65.98 R_SPACE 5.4 -BEARING 57 L_SPACE 6.6 WIDTH 64.82 R_SPACE 5.56 -BEARING 58 L_SPACE 9.32 WIDTH 14.06 R_SPACE 7.38 -BEARING 59 L_SPACE 8.2 WIDTH 13.96 R_SPACE 8.58 -BEARING 60 L_SPACE 3.06 WIDTH 102.5 R_SPACE 2.36 -BEARING 61 L_SPACE 5.7 WIDTH 96.36 R_SPACE 5.84 -BEARING 62 L_SPACE 2.78 WIDTH 102.5 R_SPACE 2.64 -BEARING 63 L_SPACE 8.42 WIDTH 60.22 R_SPACE 8.34 -BEARING 64 L_SPACE 6.36 WIDTH 126.24 R_SPACE 6.1 -BEARING 65 L_SPACE 2.5 WIDTH 88.16 R_SPACE 1.8 -BEARING 66 L_SPACE 11.42 WIDTH 75.5 R_SPACE 5.54 -BEARING 67 L_SPACE 6.66 WIDTH 87.06 R_SPACE 6.4 -BEARING 68 L_SPACE 11.96 WIDTH 81.48 R_SPACE 6.66 -BEARING 69 L_SPACE 11.42 WIDTH 72.28 R_SPACE 4.86 -BEARING 70 L_SPACE 11.42 WIDTH 67.96 R_SPACE 5.42 -BEARING 71 L_SPACE 7.06 WIDTH 89.56 R_SPACE 11.28 -BEARING 72 L_SPACE 11.42 WIDTH 77.7 R_SPACE 11.0 -BEARING 73 L_SPACE 10.86 WIDTH 13.36 R_SPACE 10.44 -BEARING 74 L_SPACE 2.5 WIDTH 56.96 R_SPACE 9.88 -BEARING 75 L_SPACE 11.28 WIDTH 79.8 R_SPACE 1.38 -BEARING 76 L_SPACE 11.68 WIDTH 62.8 R_SPACE 2.5 -BEARING 77 L_SPACE 10.86 WIDTH 94.56 R_SPACE 10.16 -BEARING 78 L_SPACE 11.14 WIDTH 77.98 R_SPACE 11.0 -BEARING 79 L_SPACE 6.24 WIDTH 95.28 R_SPACE 6.4 -BEARING 80 L_SPACE 12.1 WIDTH 73.44 R_SPACE 6.9 -BEARING 81 L_SPACE 5.3 WIDTH 96.0 R_SPACE 6.6 -BEARING 82 L_SPACE 11.68 WIDTH 80.64 R_SPACE 4.02 -BEARING 83 L_SPACE 8.0 WIDTH 78.28 R_SPACE 6.16 -BEARING 84 L_SPACE 2.36 WIDTH 79.52 R_SPACE 2.92 -BEARING 85 L_SPACE 11.54 WIDTH 77.28 R_SPACE 11.28 -BEARING 86 L_SPACE 2.36 WIDTH 87.04 R_SPACE 3.06 -BEARING 87 L_SPACE 2.22 WIDTH 125.76 R_SPACE 3.06 -BEARING 88 L_SPACE 2.5 WIDTH 86.76 R_SPACE 3.2 -BEARING 89 L_SPACE 1.52 WIDTH 88.98 R_SPACE 1.94 -BEARING 90 L_SPACE 2.5 WIDTH 77.7 R_SPACE 4.58 -BEARING 91 L_SPACE 7.78 WIDTH 25.76 R_SPACE 5.0 -BEARING 92 L_SPACE 5.84 WIDTH 73.24 R_SPACE 5.7 -BEARING 93 L_SPACE 4.44 WIDTH 25.48 R_SPACE 8.62 -BEARING 94 L_SPACE 5.98 WIDTH 55.28 R_SPACE 8.06 -BEARING 95 L_SPACE -1.1 WIDTH 70.04 R_SPACE 0.4 -BEARING 96 L_SPACE 28.26 WIDTH 25.9 R_SPACE 26.74 -BEARING 97 L_SPACE 6.68 WIDTH 67.54 R_SPACE 2.78 -BEARING 98 L_SPACE 8.76 WIDTH 63.66 R_SPACE 4.56 -BEARING 99 L_SPACE 5.52 WIDTH 61.46 R_SPACE 6.26 -BEARING 100 L_SPACE 4.64 WIDTH 63.88 R_SPACE 8.48 -BEARING 101 L_SPACE 5.72 WIDTH 65.62 R_SPACE 5.66 -BEARING 102 L_SPACE 0.68 WIDTH 34.12 R_SPACE -0.12 -BEARING 103 L_SPACE 5.36 WIDTH 63.16 R_SPACE 8.48 -BEARING 104 L_SPACE 9.6 WIDTH 58.34 R_SPACE 9.04 -BEARING 105 L_SPACE 10.02 WIDTH 11.42 R_SPACE 9.32 -BEARING 106 L_SPACE -1.66 WIDTH 23.1 R_SPACE 9.32 -BEARING 107 L_SPACE 9.6 WIDTH 59.18 R_SPACE 0.54 -BEARING 108 L_SPACE 10.02 WIDTH 11.42 R_SPACE 9.32 -BEARING 109 L_SPACE 9.6 WIDTH 96.36 R_SPACE 9.6 -BEARING 110 L_SPACE 9.18 WIDTH 58.48 R_SPACE 9.32 -BEARING 111 L_SPACE 4.98 WIDTH 67.14 R_SPACE 4.86 -BEARING 112 L_SPACE 9.46 WIDTH 63.34 R_SPACE 4.2 -BEARING 113 L_SPACE 4.84 WIDTH 63.38 R_SPACE 8.76 -BEARING 114 L_SPACE 9.46 WIDTH 34.8 R_SPACE 1.94 -BEARING 115 L_SPACE 4.7 WIDTH 59.4 R_SPACE 5.24 -BEARING 116 L_SPACE 0.54 WIDTH 33.42 R_SPACE 0.68 -BEARING 117 L_SPACE 9.46 WIDTH 58.2 R_SPACE 9.32 -BEARING 118 L_SPACE 1.8 WIDTH 65.86 R_SPACE 1.66 -BEARING 119 L_SPACE 2.5 WIDTH 95.82 R_SPACE 1.8 -BEARING 120 L_SPACE 1.66 WIDTH 65.32 R_SPACE 2.36 -BEARING 121 L_SPACE 1.8 WIDTH 65.18 R_SPACE 2.36 -BEARING 122 L_SPACE 4.44 WIDTH 59.88 R_SPACE 5.0 -BEARING 123 L_SPACE 7.38 WIDTH 36.06 R_SPACE 10.44 -BEARING 124 L_SPACE 11.54 WIDTH 6.96 R_SPACE 12.24 -BEARING 125 L_SPACE 9.18 WIDTH 36.2 R_SPACE 8.48 -BEARING 126 L_SPACE 2.92 WIDTH 102.36 R_SPACE 2.64 - Index: xc/fonts/PEX/Roman_M.src diff -u xc/fonts/PEX/Roman_M.src:1.1.1.2 xc/fonts/PEX/Roman_M.src:removed --- xc/fonts/PEX/Roman_M.src:1.1.1.2 Tue Jan 16 18:07:25 2001 +++ xc/fonts/PEX/Roman_M.src Sat Feb 28 21:40:45 2004 @@ -1,503 +0,0 @@ -## -# $Xorg: Roman_M.src,v 1.3 2000/08/17 19:42:52 cpqbld Exp $ -## -## Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium. -## -## All Rights Reserved -## -## Permission to use, copy, modify, and distribute this software and its -## documentation for any purpose and without fee is hereby granted, -## 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 names of Sun Microsystems -## and the X Consortium not be used in advertising or publicity -## pertaining to distribution of the software without specific, written -## prior permission. -## -## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -## EVENT SHALL SUN MICROSYSTEMS OR THE X CONSORTIUM 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. - -# Mono-spaced version of Roman Simplex font. - - FONTNAME Roman - TOP 119.0476 - BOTTOM -33.3333 - NUM_CH 128 - PROPERTIES 3 - - (CHARSET_REGISTRY ISO8859) - (CHARSET_ENCODING "1") - (SPACING M) - -INDEX 32 STROKE 0 CENTER 52.3810 RIGHT 104.7619 -INDEX 33 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3810 100.0000) (52.3810 33.3333) - OPEN 5 (52.3810 9.5238) (47.6191 4.7619) (52.3810 0.0000) - (57.1429 4.7619) (52.3810 9.5238) -INDEX 34 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (33.3334 100.0000) (33.3334 66.6667) - OPEN 2 (71.4286 100.0000) (71.4286 66.6667) -INDEX 35 STROKE 4 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (54.7619 119.0476) (21.4286 -33.3333) - OPEN 2 (83.3334 119.0476) (50.0000 -33.3333) - OPEN 2 (21.4286 57.1429) (88.0952 57.1429) - OPEN 2 (16.6667 28.5714) (83.3334 28.5714) -INDEX 36 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (42.8571 119.0476) (42.8571 -19.0476) - OPEN 2 (61.9047 119.0476) (61.9047 -19.0476) - OPEN 20 (85.7143 85.7143) (76.1905 95.2381) (61.9047 100.0000) - (42.8571 100.0000) (28.5714 95.2381) (19.0476 85.7143) (19.0476 76.1905) - (23.8095 66.6667) (28.5714 61.9048) (38.0952 57.1429) (66.6666 47.6190) - (76.1905 42.8571) (80.9524 38.0952) (85.7143 28.5714) (85.7143 14.2857) - (76.1905 4.7619) (61.9047 0.0000) (42.8571 0.0000) (28.5714 4.7619) - (19.0476 14.2857) -INDEX 37 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (95.2381 100.0000) (9.5238 0.0000) - OPEN 16 (33.3333 100.0000) (42.8571 90.4762) (42.8571 80.9524) - (38.0952 71.4286) (28.5714 66.6667) (19.0476 66.6667) (9.5238 76.1905) - (9.5238 85.7143) (14.2857 95.2381) (23.8095 100.0000) (33.3333 100.0000) - (42.8571 95.2381) (57.1428 90.4762) (71.4286 90.4762) (85.7143 95.2381) - (95.2381 100.0000) - OPEN 11 (76.1905 33.3333) (66.6667 28.5714) (61.9048 19.0476) - (61.9048 9.5238) (71.4286 0.0000) (80.9524 0.0000) (90.4762 4.7619) - (95.2381 14.2857) (95.2381 23.8095) (85.7143 33.3333) (76.1905 33.3333) -INDEX 38 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 34 (100.0000 57.1429) (100.0000 61.9048) (95.2381 66.6667) - (90.4762 66.6667) (85.7143 61.9048) (80.9524 52.3810) (71.4286 28.5714) - (61.9048 14.2857) (52.3809 4.7619) (42.8571 0.0000) (23.8095 0.0000) - (14.2857 4.7619) (9.5238 9.5238) (4.7619 19.0476) (4.7619 28.5714) - (9.5238 38.0952) (14.2857 42.8571) (47.6190 61.9048) (52.3809 66.6667) - (57.1429 76.1905) (57.1429 85.7143) (52.3809 95.2381) (42.8571 100.0000) - (33.3333 95.2381) (28.5714 85.7143) (28.5714 76.1905) (33.3333 61.9048) - (42.8571 47.6190) (66.6667 14.2857) (76.1905 4.7619) (85.7143 0.0000) - (95.2381 0.0000) (100.0000 4.7619) (100.0000 9.5238) -INDEX 39 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3810 100.0000) (52.3810 66.6667) -INDEX 40 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 10 (69.0476 119.0476) (59.5238 109.5238) (50.0000 95.2381) - (40.4762 76.1905) (35.7143 52.3810) (35.7143 33.3333) (40.4762 9.5238) - (50.0000 -9.5238) (59.5238 -23.8095) (69.0476 -33.3333) -INDEX 41 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 10 (35.7143 119.0476) (45.2381 109.5238) (54.7619 95.2381) - (64.2857 76.1905) (69.0476 52.3810) (69.0476 33.3333) (64.2857 9.5238) - (54.7619 -9.5238) (45.2381 -23.8095) (35.7143 -33.3333) -INDEX 42 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3810 71.4286) (52.3810 14.2857) - OPEN 2 (28.5715 57.1429) (76.1905 28.5714) - OPEN 2 (76.1905 57.1429) (28.5715 28.5714) -INDEX 43 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3809 85.7143) (52.3809 0.0000) - OPEN 2 (9.5238 42.8571) (95.2381 42.8571) -INDEX 44 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 8 (57.1429 4.7619) (52.3810 0.0000) (47.6191 4.7619) - (52.3810 9.5238) (57.1429 4.7619) (57.1429 -4.7619) (52.3810 -14.2857) - (47.6191 -19.0476) -INDEX 45 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (9.5238 42.8571) (95.2381 42.8571) -INDEX 46 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 5 (52.3810 9.5238) (47.6191 4.7619) (52.3810 0.0000) - (57.1429 4.7619) (52.3810 9.5238) -INDEX 47 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 -14.2857) (85.7143 100.0000) -INDEX 48 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 17 (47.6190 100.0000) (33.3333 95.2381) (23.8095 80.9524) - (19.0476 57.1429) (19.0476 42.8571) (23.8095 19.0476) (33.3333 4.7619) - (47.6190 0.0000) (57.1428 0.0000) (71.4286 4.7619) (80.9524 19.0476) - (85.7143 42.8571) (85.7143 57.1429) (80.9524 80.9524) (71.4286 95.2381) - (57.1428 100.0000) (47.6190 100.0000) -INDEX 49 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 4 (40.4762 80.9524) (50.0000 85.7143) (64.2857 100.0000) - (64.2857 0.0000) -INDEX 50 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 14 (23.8095 76.1905) (23.8095 80.9524) (28.5714 90.4762) - (33.3333 95.2381) (42.8571 100.0000) (61.9047 100.0000) (71.4286 95.2381) - (76.1905 90.4762) (80.9524 80.9524) (80.9524 71.4286) (76.1905 61.9048) - (66.6666 47.6190) (19.0476 0.0000) (85.7143 0.0000) -INDEX 51 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 15 (28.5714 100.0000) (80.9524 100.0000) (52.3809 61.9048) - (66.6666 61.9048) (76.1905 57.1429) (80.9524 52.3810) (85.7143 38.0952) - (85.7143 28.5714) (80.9524 14.2857) (71.4286 4.7619) (57.1428 0.0000) - (42.8571 0.0000) (28.5714 4.7619) (23.8095 9.5238) (19.0476 19.0476) -INDEX 52 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 3 (64.2857 100.0000) (16.6667 33.3333) (88.0952 33.3333) - OPEN 2 (64.2857 100.0000) (64.2857 0.0000) -INDEX 53 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 17 (76.1905 100.0000) (28.5714 100.0000) (23.8095 57.1429) - (28.5714 61.9048) (42.8571 66.6667) (57.1428 66.6667) (71.4286 61.9048) - (80.9524 52.3810) (85.7143 38.0952) (85.7143 28.5714) (80.9524 14.2857) - (71.4286 4.7619) (57.1428 0.0000) (42.8571 0.0000) (28.5714 4.7619) - (23.8095 9.5238) (19.0476 19.0476) -INDEX 54 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 23 (78.5714 85.7143) (73.8096 95.2381) (59.5238 100.0000) - (50.0000 100.0000) (35.7143 95.2381) (26.1905 80.9524) (21.4286 57.1429) - (21.4286 33.3333) (26.1905 14.2857) (35.7143 4.7619) (50.0000 0.0000) - (54.7619 0.0000) (69.0476 4.7619) (78.5714 14.2857) (83.3334 28.5714) - (83.3334 33.3333) (78.5714 47.6190) (69.0476 57.1429) (54.7619 61.9048) - (50.0000 61.9048) (35.7143 57.1429) (26.1905 47.6190) (21.4286 33.3333) -INDEX 55 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (85.7143 100.0000) (38.0952 0.0000) - OPEN 2 (19.0476 100.0000) (85.7143 100.0000) -INDEX 56 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 29 (42.8571 100.0000) (28.5714 95.2381) (23.8095 85.7143) - (23.8095 76.1905) (28.5714 66.6667) (38.0952 61.9048) (57.1428 57.1429) - (71.4286 52.3810) (80.9524 42.8571) (85.7143 33.3333) (85.7143 19.0476) - (80.9524 9.5238) (76.1905 4.7619) (61.9047 0.0000) (42.8571 0.0000) - (28.5714 4.7619) (23.8095 9.5238) (19.0476 19.0476) (19.0476 33.3333) - (23.8095 42.8571) (33.3333 52.3810) (47.6190 57.1429) (66.6666 61.9048) - (76.1905 66.6667) (80.9524 76.1905) (80.9524 85.7143) (76.1905 95.2381) - (61.9047 100.0000) (42.8571 100.0000) -INDEX 57 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 23 (83.3334 66.6667) (78.5714 52.3810) (69.0476 42.8571) - (54.7619 38.0952) (50.0000 38.0952) (35.7143 42.8571) (26.1905 52.3810) - (21.4286 66.6667) (21.4286 71.4286) (26.1905 85.7143) (35.7143 95.2381) - (50.0000 100.0000) (54.7619 100.0000) (69.0476 95.2381) (78.5714 85.7143) - (83.3334 66.6667) (83.3334 42.8571) (78.5714 19.0476) (69.0476 4.7619) - (54.7619 0.0000) (45.2381 0.0000) (30.9524 4.7619) (26.1905 14.2857) -INDEX 58 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 5 (52.3810 66.6667) (47.6191 61.9048) (52.3810 57.1429) - (57.1429 61.9048) (52.3810 66.6667) - OPEN 5 (52.3810 9.5238) (47.6191 4.7619) (52.3810 0.0000) - (57.1429 4.7619) (52.3810 9.5238) -INDEX 59 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 5 (52.3810 66.6667) (47.6191 61.9048) (52.3810 57.1429) - (57.1429 61.9048) (52.3810 66.6667) - OPEN 8 (57.1429 4.7619) (52.3810 0.0000) (47.6191 4.7619) - (52.3810 9.5238) (57.1429 4.7619) (57.1429 -4.7619) (52.3810 -14.2857) - (47.6191 -19.0476) -INDEX 60 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 3 (90.4762 85.7143) (14.2857 42.8571) (90.4762 0.0000) -INDEX 61 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (9.5238 57.1429) (95.2381 57.1429) - OPEN 2 (9.5238 28.5714) (95.2381 28.5714) -INDEX 62 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 3 (14.2857 85.7143) (90.4762 42.8571) (14.2857 0.0000) -INDEX 63 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 14 (23.8095 76.1905) (23.8095 80.9524) (28.5714 90.4762) - (33.3333 95.2381) (42.8571 100.0000) (61.9047 100.0000) (71.4285 95.2381) - (76.1905 90.4762) (80.9524 80.9524) (80.9524 71.4286) (76.1905 61.9048) - (71.4285 57.1429) (52.3809 47.6190) (52.3809 33.3333) - OPEN 5 (52.3809 9.5238) (47.6190 4.7619) (52.3809 0.0000) - (57.1428 4.7619) (52.3809 9.5238) -INDEX 64 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 8 (64.2857 52.3810) (54.7619 57.1429) (45.2381 57.1429) - (40.4762 47.6190) (40.4762 42.8571) (45.2381 33.3333) (54.7619 33.3333) - (64.2857 38.0952) - OPEN 19 (64.2857 57.1429) (64.2857 38.0952) (69.0476 33.3333) - (78.5714 33.3333) (83.3334 42.8571) (83.3334 47.6190) (78.5714 61.9048) - (69.0476 71.4286) (54.7619 76.1905) (50.0000 76.1905) (35.7143 71.4286) - (26.1905 61.9048) (21.4286 47.6190) (21.4286 42.8571) (26.1905 28.5714) - (35.7143 19.0476) (50.0000 14.2857) (54.7619 14.2857) (69.0476 19.0476) -INDEX 65 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3809 100.0000) (14.2857 0.0000) - OPEN 2 (52.3809 100.0000) (90.4762 0.0000) - OPEN 2 (28.5714 33.3333) (76.1905 33.3333) -INDEX 66 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 100.0000) (19.0476 0.0000) - OPEN 9 (19.0476 100.0000) (61.9047 100.0000) (76.1905 95.2381) - (80.9524 90.4762) (85.7143 80.9524) (85.7143 71.4286) (80.9524 61.9048) - (76.1905 57.1429) (61.9047 52.3810) - OPEN 10 (19.0476 52.3810) (61.9047 52.3810) (76.1905 47.6190) - (80.9524 42.8571) (85.7143 33.3333) (85.7143 19.0476) (80.9524 9.5238) - (76.1905 4.7619) (61.9047 0.0000) (19.0476 0.0000) -INDEX 67 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 18 (88.0952 76.1905) (83.3334 85.7143) (73.8096 95.2381) - (64.2857 100.0000) (45.2381 100.0000) (35.7143 95.2381) (26.1905 85.7143) - (21.4286 76.1905) (16.6667 61.9048) (16.6667 38.0952) (21.4286 23.8095) - (26.1905 14.2857) (35.7143 4.7619) (45.2381 0.0000) (64.2857 0.0000) - (73.8096 4.7619) (83.3334 14.2857) (88.0952 23.8095) -INDEX 68 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 100.0000) (19.0476 0.0000) - OPEN 12 (19.0476 100.0000) (52.3809 100.0000) (66.6666 95.2381) - (76.1905 85.7143) (80.9524 76.1905) (85.7143 61.9048) (85.7143 38.0952) - (80.9524 23.8095) (76.1905 14.2857) (66.6666 4.7619) (52.3809 0.0000) - (19.0476 0.0000) -INDEX 69 STROKE 4 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (21.4286 100.0000) (21.4286 0.0000) - OPEN 2 (21.4286 100.0000) (83.3334 100.0000) - OPEN 2 (21.4286 52.3810) (59.5238 52.3810) - OPEN 2 (21.4286 0.0000) (83.3334 0.0000) -INDEX 70 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (21.4286 100.0000) (21.4286 0.0000) - OPEN 2 (21.4286 100.0000) (83.3334 100.0000) - OPEN 2 (21.4286 52.3810) (59.5238 52.3810) -INDEX 71 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 19 (88.0952 76.1905) (83.3334 85.7143) (73.8096 95.2381) - (64.2857 100.0000) (45.2381 100.0000) (35.7143 95.2381) (26.1905 85.7143) - (21.4286 76.1905) (16.6667 61.9048) (16.6667 38.0952) (21.4286 23.8095) - (26.1905 14.2857) (35.7143 4.7619) (45.2381 0.0000) (64.2857 0.0000) - (73.8096 4.7619) (83.3334 14.2857) (88.0952 23.8095) (88.0952 38.0952) - OPEN 2 (64.2857 38.0952) (88.0952 38.0952) -INDEX 72 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 100.0000) (19.0476 0.0000) - OPEN 2 (85.7143 100.0000) (85.7143 0.0000) - OPEN 2 (19.0476 52.3810) (85.7143 52.3810) -INDEX 73 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3810 100.0000) (52.3810 0.0000) -INDEX 74 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 10 (76.1905 100.0000) (76.1905 23.8095) (71.4286 9.5238) - (66.6667 4.7619) (57.1429 0.0000) (47.6191 0.0000) (38.0953 4.7619) - (33.3334 9.5238) (28.5715 23.8095) (28.5715 33.3333) -INDEX 75 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 100.0000) (19.0476 0.0000) - OPEN 2 (85.7143 100.0000) (19.0476 33.3333) - OPEN 2 (42.8571 57.1429) (85.7143 0.0000) -INDEX 76 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (23.8095 100.0000) (23.8095 0.0000) - OPEN 2 (23.8095 0.0000) (80.9524 0.0000) -INDEX 77 STROKE 4 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (14.2857 100.0000) (14.2857 0.0000) - OPEN 2 (14.2857 100.0000) (52.3809 0.0000) - OPEN 2 (90.4762 100.0000) (52.3809 0.0000) - OPEN 2 (90.4762 100.0000) (90.4762 0.0000) -INDEX 78 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 100.0000) (19.0476 0.0000) - OPEN 2 (19.0476 100.0000) (85.7143 0.0000) - OPEN 2 (85.7143 100.0000) (85.7143 0.0000) -INDEX 79 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 21 (42.8571 100.0000) (33.3333 95.2381) (23.8095 85.7143) - (19.0476 76.1905) (14.2857 61.9048) (14.2857 38.0952) (19.0476 23.8095) - (23.8095 14.2857) (33.3333 4.7619) (42.8571 0.0000) (61.9047 0.0000) - (71.4286 4.7619) (80.9524 14.2857) (85.7143 23.8095) (90.4762 38.0952) - (90.4762 61.9048) (85.7143 76.1905) (80.9524 85.7143) (71.4286 95.2381) - (61.9047 100.0000) (42.8571 100.0000) -INDEX 80 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 100.0000) (19.0476 0.0000) - OPEN 10 (19.0476 100.0000) (61.9047 100.0000) (76.1905 95.2381) - (80.9524 90.4762) (85.7143 80.9524) (85.7143 66.6667) (80.9524 57.1429) - (76.1905 52.3810) (61.9047 47.6190) (19.0476 47.6190) -INDEX 81 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 21 (42.8571 100.0000) (33.3333 95.2381) (23.8095 85.7143) - (19.0476 76.1905) (14.2857 61.9048) (14.2857 38.0952) (19.0476 23.8095) - (23.8095 14.2857) (33.3333 4.7619) (42.8571 0.0000) (61.9047 0.0000) - (71.4286 4.7619) (80.9524 14.2857) (85.7143 23.8095) (90.4762 38.0952) - (90.4762 61.9048) (85.7143 76.1905) (80.9524 85.7143) (71.4286 95.2381) - (61.9047 100.0000) (42.8571 100.0000) - OPEN 2 (57.1428 19.0476) (85.7143 -9.5238) -INDEX 82 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 100.0000) (19.0476 0.0000) - OPEN 10 (19.0476 100.0000) (61.9047 100.0000) (76.1905 95.2381) - (80.9524 90.4762) (85.7143 80.9524) (85.7143 71.4286) (80.9524 61.9048) - (76.1905 57.1429) (61.9047 52.3810) (19.0476 52.3810) - OPEN 2 (52.3809 52.3810) (85.7143 0.0000) -INDEX 83 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 20 (85.7143 85.7143) (76.1905 95.2381) (61.9047 100.0000) - (42.8571 100.0000) (28.5714 95.2381) (19.0476 85.7143) (19.0476 76.1905) - (23.8095 66.6667) (28.5714 61.9048) (38.0952 57.1429) (66.6666 47.6190) - (76.1905 42.8571) (80.9524 38.0952) (85.7143 28.5714) (85.7143 14.2857) - (76.1905 4.7619) (61.9047 0.0000) (42.8571 0.0000) (28.5714 4.7619) - (19.0476 14.2857) -INDEX 84 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3809 100.0000) (52.3809 0.0000) - OPEN 2 (19.0476 100.0000) (85.7143 100.0000) -INDEX 85 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 10 (19.0476 100.0000) (19.0476 28.5714) (23.8095 14.2857) - (33.3333 4.7619) (47.6190 0.0000) (57.1428 0.0000) (71.4286 4.7619) - (80.9524 14.2857) (85.7143 28.5714) (85.7143 100.0000) -INDEX 86 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (14.2857 100.0000) (52.3809 0.0000) - OPEN 2 (90.4762 100.0000) (52.3809 0.0000) -INDEX 87 STROKE 4 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (4.7619 100.0000) (28.5714 0.0000) - OPEN 2 (52.3809 100.0000) (28.5714 0.0000) - OPEN 2 (52.3809 100.0000) (76.1905 0.0000) - OPEN 2 (100.0000 100.0000) (76.1905 0.0000) -INDEX 88 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 100.0000) (85.7143 0.0000) - OPEN 2 (85.7143 100.0000) (19.0476 0.0000) -INDEX 89 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 3 (14.2857 100.0000) (52.3809 52.3810) (52.3809 0.0000) - OPEN 2 (90.4762 100.0000) (52.3809 52.3810) -INDEX 90 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (85.7143 100.0000) (19.0476 0.0000) - OPEN 2 (19.0476 100.0000) (85.7143 100.0000) - OPEN 2 (19.0476 0.0000) (85.7143 0.0000) -INDEX 91 STROKE 4 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (35.7143 119.0476) (35.7143 -33.3333) - OPEN 2 (40.4762 119.0476) (40.4762 -33.3333) - OPEN 2 (35.7143 119.0476) (69.0476 119.0476) - OPEN 2 (35.7143 -33.3333) (69.0476 -33.3333) -INDEX 92 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (19.0476 100.0000) (85.7143 -14.2857) -INDEX 93 STROKE 4 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (64.2857 119.0476) (64.2857 -33.3333) - OPEN 2 (69.0476 119.0476) (69.0476 -33.3333) - OPEN 2 (35.7143 119.0476) (69.0476 119.0476) - OPEN 2 (35.7143 -33.3333) (69.0476 -33.3333) -INDEX 94 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3809 109.5238) (14.2857 42.8571) - OPEN 2 (52.3809 109.5238) (90.4762 42.8571) -INDEX 95 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 5 (0.0000 -33.3333) (104.7619 -33.3333) (104.7619 -28.5714) - (0.0000 -28.5714) (0.0000 -33.3333) -INDEX 96 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (42.8572 100.0000) (66.6667 71.4286) - OPEN 3 (42.8572 100.0000) (38.0953 95.2381) (66.6667 71.4286) -INDEX 97 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (80.9524 66.6667) (80.9524 0.0000) - OPEN 14 (80.9524 52.3810) (71.4285 61.9048) (61.9047 66.6667) - (47.6190 66.6667) (38.0952 61.9048) (28.5714 52.3810) (23.8095 38.0952) - (23.8095 28.5714) (28.5714 14.2857) (38.0952 4.7619) (47.6190 0.0000) - (61.9047 0.0000) (71.4285 4.7619) (80.9524 14.2857) -INDEX 98 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (23.8095 100.0000) (23.8095 0.0000) - OPEN 14 (23.8095 52.3810) (33.3333 61.9048) (42.8571 66.6667) - (57.1428 66.6667) (66.6666 61.9048) (76.1905 52.3810) (80.9524 38.0952) - (80.9524 28.5714) (76.1905 14.2857) (66.6666 4.7619) (57.1428 0.0000) - (42.8571 0.0000) (33.3333 4.7619) (23.8095 14.2857) -INDEX 99 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 14 (80.9524 52.3810) (71.4285 61.9048) (61.9047 66.6667) - (47.6190 66.6667) (38.0952 61.9048) (28.5714 52.3810) (23.8095 38.0952) - (23.8095 28.5714) (28.5714 14.2857) (38.0952 4.7619) (47.6190 0.0000) - (61.9047 0.0000) (71.4285 4.7619) (80.9524 14.2857) -INDEX 100 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (80.9524 100.0000) (80.9524 0.0000) - OPEN 14 (80.9524 52.3810) (71.4285 61.9048) (61.9047 66.6667) - (47.6190 66.6667) (38.0952 61.9048) (28.5714 52.3810) (23.8095 38.0952) - (23.8095 28.5714) (28.5714 14.2857) (38.0952 4.7619) (47.6190 0.0000) - (61.9047 0.0000) (71.4285 4.7619) (80.9524 14.2857) -INDEX 101 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 17 (23.8095 38.0952) (80.9524 38.0952) (80.9524 47.6190) - (76.1905 57.1429) (71.4285 61.9048) (61.9047 66.6667) (47.6190 66.6667) - (38.0952 61.9048) (28.5714 52.3810) (23.8095 38.0952) (23.8095 28.5714) - (28.5714 14.2857) (38.0952 4.7619) (47.6190 0.0000) (61.9047 0.0000) - (71.4285 4.7619) (80.9524 14.2857) -INDEX 102 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 5 (71.4286 100.0000) (61.9048 100.0000) (52.3810 95.2381) - (47.6191 80.9524) (47.6191 0.0000) - OPEN 2 (33.3334 66.6667) (66.6667 66.6667) -INDEX 103 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 7 (80.9524 66.6667) (80.9524 -9.5238) (76.1905 -23.8095) - (71.4285 -28.5714) (61.9047 -33.3333) (47.6190 -33.3333) (38.0952 -28.5714) - OPEN 14 (80.9524 52.3810) (71.4285 61.9048) (61.9047 66.6667) - (47.6190 66.6667) (38.0952 61.9048) (28.5714 52.3810) (23.8095 38.0952) - (23.8095 28.5714) (28.5714 14.2857) (38.0952 4.7619) (47.6190 0.0000) - (61.9047 0.0000) (71.4285 4.7619) (80.9524 14.2857) -INDEX 104 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (26.1905 100.0000) (26.1905 0.0000) - OPEN 7 (26.1905 47.6190) (40.4762 61.9048) (50.0000 66.6667) - (64.2857 66.6667) (73.8095 61.9048) (78.5715 47.6190) (78.5715 0.0000) -INDEX 105 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 5 (47.6191 100.0000) (52.3810 95.2381) (57.1429 100.0000) - (52.3810 104.7619) (47.6191 100.0000) - OPEN 2 (52.3810 66.6667) (52.3810 0.0000) -INDEX 106 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 5 (57.1429 100.0000) (61.9048 95.2381) (66.6667 100.0000) - (61.9048 104.7619) (57.1429 100.0000) - OPEN 5 (61.9048 66.6667) (61.9048 -14.2857) (57.1429 -28.5714) - (47.6191 -33.3333) (38.0953 -33.3333) -INDEX 107 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (26.1905 100.0000) (26.1905 0.0000) - OPEN 2 (73.8095 66.6667) (26.1905 19.0476) - OPEN 2 (45.2381 38.0952) (78.5715 0.0000) -INDEX 108 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3810 100.0000) (52.3810 0.0000) -INDEX 109 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (0.0000 66.6667) (0.0000 0.0000) - OPEN 7 (0.0000 47.6190) (14.2857 61.9048) (23.8095 66.6667) - (38.0952 66.6667) (47.6190 61.9048) (52.3810 47.6190) (52.3810 0.0000) - OPEN 7 (52.3810 47.6190) (66.6667 61.9048) (76.1905 66.6667) - (90.4762 66.6667) (100.0000 61.9048) (104.7619 47.6190) (104.7619 0.0000) -INDEX 110 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (26.1905 66.6667) (26.1905 0.0000) - OPEN 7 (26.1905 47.6190) (40.4762 61.9048) (50.0000 66.6667) - (64.2857 66.6667) (73.8095 61.9048) (78.5715 47.6190) (78.5715 0.0000) -INDEX 111 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 17 (45.2381 66.6667) (35.7143 61.9048) (26.1905 52.3810) - (21.4286 38.0952) (21.4286 28.5714) (26.1905 14.2857) (35.7143 4.7619) - (45.2381 0.0000) (59.5238 0.0000) (69.0476 4.7619) (78.5714 14.2857) - (83.3334 28.5714) (83.3334 38.0952) (78.5714 52.3810) (69.0476 61.9048) - (59.5238 66.6667) (45.2381 66.6667) -INDEX 112 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (23.8095 66.6667) (23.8095 -33.3333) - OPEN 14 (23.8095 52.3810) (33.3333 61.9048) (42.8571 66.6667) - (57.1428 66.6667) (66.6666 61.9048) (76.1905 52.3810) (80.9524 38.0952) - (80.9524 28.5714) (76.1905 14.2857) (66.6666 4.7619) (57.1428 0.0000) - (42.8571 0.0000) (33.3333 4.7619) (23.8095 14.2857) -INDEX 113 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (80.9524 66.6667) (80.9524 -33.3333) - OPEN 14 (80.9524 52.3810) (71.4285 61.9048) (61.9047 66.6667) - (47.6190 66.6667) (38.0952 61.9048) (28.5714 52.3810) (23.8095 38.0952) - (23.8095 28.5714) (28.5714 14.2857) (38.0952 4.7619) (47.6190 0.0000) - (61.9047 0.0000) (71.4285 4.7619) (80.9524 14.2857) -INDEX 114 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (33.3334 66.6667) (33.3334 0.0000) - OPEN 5 (33.3334 38.0952) (38.0953 52.3810) (47.6191 61.9048) - (57.1429 66.6667) (71.4286 66.6667) -INDEX 115 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 17 (78.5715 52.3810) (73.8095 61.9048) (59.5238 66.6667) - (45.2381 66.6667) (30.9524 61.9048) (26.1905 52.3810) (30.9524 42.8571) - (40.4762 38.0952) (64.2857 33.3333) (73.8095 28.5714) (78.5715 19.0476) - (78.5715 14.2857) (73.8095 4.7619) (59.5238 0.0000) (45.2381 0.0000) - (30.9524 4.7619) (26.1905 14.2857) -INDEX 116 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 5 (47.6191 100.0000) (47.6191 19.0476) (52.3810 4.7619) - (61.9048 0.0000) (71.4286 0.0000) - OPEN 2 (33.3334 66.6667) (66.6667 66.6667) -INDEX 117 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 7 (26.1905 66.6667) (26.1905 19.0476) (30.9524 4.7619) - (40.4762 0.0000) (54.7619 0.0000) (64.2857 4.7619) (78.5715 19.0476) - OPEN 2 (78.5715 66.6667) (78.5715 0.0000) -INDEX 118 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (23.8095 66.6667) (52.3809 0.0000) - OPEN 2 (80.9524 66.6667) (52.3809 0.0000) -INDEX 119 STROKE 4 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (14.2857 66.6667) (33.3333 0.0000) - OPEN 2 (52.3809 66.6667) (33.3333 0.0000) - OPEN 2 (52.3809 66.6667) (71.4286 0.0000) - OPEN 2 (90.4762 66.6667) (71.4286 0.0000) -INDEX 120 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (26.1905 66.6667) (78.5715 0.0000) - OPEN 2 (78.5715 66.6667) (26.1905 0.0000) -INDEX 121 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (26.1905 66.6667) (54.7619 0.0000) - OPEN 6 (83.3334 66.6667) (54.7619 0.0000) (45.2381 -19.0476) - (35.7143 -28.5714) (26.1905 -33.3333) (21.4286 -33.3333) -INDEX 122 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (78.5715 66.6667) (26.1905 0.0000) - OPEN 2 (26.1905 66.6667) (78.5715 66.6667) - OPEN 2 (26.1905 0.0000) (78.5715 0.0000) -INDEX 123 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 10 (64.2857 119.0476) (54.7619 114.2857) (50.0000 109.5238) - (45.2381 100.0000) (45.2381 90.4762) (50.0000 80.9524) (54.7619 76.1905) - (59.5238 66.6667) (59.5238 57.1429) (50.0000 47.6190) - OPEN 17 (54.7619 114.2857) (50.0000 104.7619) (50.0000 95.2381) - (54.7619 85.7143) (59.5238 80.9524) (64.2857 71.4286) (64.2857 61.9048) - (59.5238 52.3810) (40.4762 42.8571) (59.5238 33.3333) (64.2857 23.8095) - (64.2857 14.2857) (59.5238 4.7619) (54.7619 0.0000) (50.0000 -9.5238) - (50.0000 -19.0476) (54.7619 -28.5714) - OPEN 10 (50.0000 38.0952) (59.5238 28.5714) (59.5238 19.0476) - (54.7619 9.5238) (50.0000 4.7619) (45.2381 -4.7619) (45.2381 -14.2857) - (50.0000 -23.8095) (54.7619 -28.5714) (64.2857 -33.3333) -INDEX 124 STROKE 1 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (52.3810 119.0476) (52.3810 -33.3333) -INDEX 125 STROKE 3 CENTER 52.3810 RIGHT 104.7619 - OPEN 10 (40.4762 119.0476) (50.0000 114.2857) (54.7619 109.5238) - (59.5238 100.0000) (59.5238 90.4762) (54.7619 80.9524) (50.0000 76.1905) - (45.2381 66.6667) (45.2381 57.1429) (54.7619 47.6190) - OPEN 17 (50.0000 114.2857) (54.7619 104.7619) (54.7619 95.2381) - (50.0000 85.7143) (45.2381 80.9524) (40.4762 71.4286) (40.4762 61.9048) - (45.2381 52.3810) (64.2857 42.8571) (45.2381 33.3333) (40.4762 23.8095) - (40.4762 14.2857) (45.2381 4.7619) (50.0000 0.0000) (54.7619 -9.5238) - (54.7619 -19.0476) (50.0000 -28.5714) - OPEN 10 (54.7619 38.0952) (45.2381 28.5714) (45.2381 19.0476) - (50.0000 9.5238) (54.7619 4.7619) (59.5238 -4.7619) (59.5238 -14.2857) - (54.7619 -23.8095) (50.0000 -28.5714) (40.4762 -33.3333) -INDEX 126 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 11 (9.5238 28.5714) (9.5238 38.0952) (14.2857 52.3810) - (23.8095 57.1429) (33.3333 57.1429) (42.8571 52.3810) (61.9048 38.0952) - (71.4286 33.3333) (80.9524 33.3333) (90.4762 38.0952) (95.2381 47.6190) - OPEN 11 (9.5238 38.0952) (14.2857 47.6190) (23.8095 52.3810) - (33.3333 52.3810) (42.8571 47.6190) (61.9048 33.3333) (71.4286 28.5714) - (80.9524 28.5714) (90.4762 33.3333) (95.2381 47.6190) (95.2381 57.1429) -INDEX 127 STROKE 2 CENTER 52.3810 RIGHT 104.7619 - OPEN 2 (71.4286 100.0000) (33.3333 -33.3333) - OPEN 17 (47.6190 66.6667) (33.3333 61.9048) (23.8095 52.3810) - (19.0476 38.0952) (19.0476 23.8095) (23.8095 14.2857) (33.3333 4.7619) - (47.6190 0.0000) (57.1428 0.0000) (71.4286 4.7619) (80.9524 14.2857) - (85.7143 28.5714) (85.7143 42.8571) (80.9524 52.3810) (71.4286 61.9048) - (57.1428 66.6667) (47.6190 66.6667) Index: xc/fonts/PEX/lex.l diff -u xc/fonts/PEX/lex.l:3.14 xc/fonts/PEX/lex.l:removed --- xc/fonts/PEX/lex.l:3.14 Tue Jan 8 17:10:57 2002 +++ xc/fonts/PEX/lex.l Sat Feb 28 21:40:45 2004 @@ -1,166 +0,0 @@ -%{ -/* $Xorg: lex.l,v 1.4 2001/02/09 02:03:21 xorgcvs Exp $ */ - -/***************************************************************** - -Copyright 1989,1990, 1991, 1998 The Open Group - -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. - -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 -OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 names of Sun Microsystems, -and the X Consortium, not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS 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. - -******************************************************************/ -/* $XFree86: xc/fonts/PEX/lex.l,v 3.14 2002/01/08 22:10:57 dawes Exp $ */ - - -#include -#include -#include "to_wfont.h" -#include -#include - -%} -%% -\'[^']*\' | -\"[^"]*\" return string(yytext, yyleng); -#.* ; -[ ,;\t\n\r]* /* natural dilimters */ ; - -[a-zA-Z][a-zA-Z0-9_.]* { - int token; - if (token = res_words(yytext)) - return token; - return string(yytext, yyleng); - } - -[+-]?[0-9]+\.?[0-9]*[eE][+-]?[0-9]+ | -[+-]?[0-9]+\.[0-9]* | -\.[0-9]+ { - yylval.dval = atof((char *)yytext); - return REAL; - } -[+-]?[0-9]+#[0-9]+ { - return INTEGER; - } -[+-]?[0-9]+ { - yylval.ival = atoi((char *)yytext); - return INTEGER; - } -[()] ; -%% - -int -res_words(str) -char str[]; -{ - static struct res_strct { - char *word; - int token; - } res_table[] = { - {"BOTTOM", BOTTOM}, - {"CENTER", CENTER}, - {"PROPERTIES", PROPERTIES}, - {"CLOSE", CLOSE}, - {"FONTNAME", FONTNAME}, - {"INDEX", INDEX}, - {"MAGIC", MAGIC}, - {"OPEN", OPEN}, - {"RIGHT", RIGHT}, - {"STROKE", STROKE}, - {"TOP", TOP}, - {"VERTICES", VERTICES}, - {"BEARING", BEARING}, - {"L_SPACE", L_SPACE}, - {"WIDTH", WIDTH}, - {"R_SPACE", R_SPACE}, - {"NUM_CH", NUM_CH}, - {0, 0} - }; - - { - register struct res_strct *reserved; - - reserved = res_table; - - do - if (!strcmp(str, reserved->word)) - break; - while ((++reserved)->word != 0); - return reserved->token; - } -} - -int -string(str, n) -char *str; -int n; -{ - if (*str == '\"' || *str == '\'') - { - str++; - n -= 2; /* one for EOL, one for end quote */ - } - if ((yylval.cval = (char *)malloc(n + 1)) != NULL) - { - strncpy(yylval.cval, str, n); - yylval.cval[n] = '\0'; - return STRING; - } - else - return 0; -} - -#ifdef QNX4 - -int yywrap (void) { - if (!feof(yyin)) - return (0); -/* The following appears not to work with flex. As it is error - handling code, we just comment it out. */ -#if !defined(FLEX_SCANNER) - if (yybgin != (yysvec+1)) { /* make sure we are in state 0 */ - ErrIntro(yylineno); - fprintf(stderr,"end of input file/missing endps\n"); - } -#endif - return (1); -} - -#endif /* QNX4 */ Index: xc/fonts/PEX/to_wfont.y diff -u xc/fonts/PEX/to_wfont.y:3.15 xc/fonts/PEX/to_wfont.y:removed --- xc/fonts/PEX/to_wfont.y:3.15 Mon Nov 25 09:04:49 2002 +++ xc/fonts/PEX/to_wfont.y Sat Feb 28 21:40:45 2004 @@ -1,667 +0,0 @@ -%{ -/* $Xorg: to_wfont.y,v 1.4 2001/02/09 02:03:21 xorgcvs Exp $ */ - -/***************************************************************** - -Copyright 1989,1990, 1991, 1998 The Open Group - -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. - -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 -OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 names of Sun Microsystems, -and the X Consortium, not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS 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. - -******************************************************************/ -/* $XFree86: xc/fonts/PEX/to_wfont.y,v 3.15 2002/11/25 14:04:49 eich Exp $ */ - - -#define YYMAXDEPTH 10000 - -#include -#include -#include -#ifndef L_SET -#define L_SET SEEK_SET -#endif -#include "wfont.h" - -typedef struct { - - float std_left, /* NCGA standard left spacing */ - std_wide, /* character width */ - std_rght; /* Right spacing */ -} Standard; - - -char fname[80]; -Dispatch *Table; /* dispatch table */ -Standard *sp_table; /* NCGA font spacings */ -Path *strokes; /* strokes of each character */ -Property *property; /* property list */ - -struct { - int path, point, props; -} count, expect; - -Path_subpath *current_path; - -Font_header head; /* font header */ -int tableindex; /* which character */ -int yyerrno; /* error number */ - -%} - -%union { - int nil; /* void is reserved */ - int ival; - float dval; - char *cval; -} - -%start font - -%token REAL -%token INTEGER -%token STRING - -%token BOTTOM -%token CENTER -%token CLOSE -%token FONTNAME -%token PROPERTIES -%token NUM_CH -%token INDEX -%token L_SPACE -%token MAGIC -%token OPEN -%token RIGHT -%token R_SPACE -%token STROKE -%token TOP -%token VERTICES -%token BEARING -%token WIDTH - -%type fontname -%type top bottom center right -%type nstroke nvertice n_pts index num_ch -%type closeflag -%type counter -%type sp_left wide sp_right - -%% - -font : fontheader num_ch fontprops fontbody spacing { fini(); }| - fontheader fontbody { fini(); }; - -fontheader : fontname top bottom - { wf_header($1, $2, $3); }; - -fontname : FONTNAME STRING - { $$ = $2; }; - -top : TOP REAL { $$ = $2;}; - -bottom : BOTTOM REAL { $$ = $2;}; - -num_ch: NUM_CH INTEGER { set_num_ch($2);}; - -fontprops : /* empty */ | properties; - -properties : PROPERTIES INTEGER { init_properties ($2); } property_list - { check_num_props (); }; - -property_list : /* empty */ | single_property property_list; - -single_property : STRING STRING { add_property($1, $2); }; - -fontbody : /* empty */ - | glyph fontbody; - -glyph : glyph_header strokes - { check_nstroke(); }; - -glyph_header : index { tableindex = $1; } sym_headinfo; - -sym_headinfo : nstroke center right nvertice - { glyph_header($1, $2, $3, $4); }; - -index : INDEX INTEGER { check_num_ch(); $$ = $2; }; - -nstroke : STROKE INTEGER { $$ = $2; expect.path = $2; }; - -nvertice: {$$ = 0;} | VERTICES INTEGER { $$ = $2; } ; - -center : CENTER REAL{ $$ = $2; }; - -right : RIGHT REAL{ $$ = $2; }; - -strokes : /* empty */ | path strokes; - -path : closeflag n_pts { init_path($1, $2); } points - { check_npts(); }; - -points : /* empty */ | coord points; - -closeflag : CLOSE { $$ = $1 == CLOSE; } | OPEN { $$ = $1 == CLOSE; } ; - -n_pts : INTEGER { $$ = $1; }; - -coord : REAL REAL { add_point($1, $2); }; - -spacing : /* empty */ - | item spacing; - -item : counter {tableindex = $1;} sp_left wide sp_right - { std_space($3, $4, $5); }; - -counter : BEARING INTEGER {$$ = $2;}; - -sp_left: L_SPACE REAL {$$ = $2;}; - -wide : WIDTH REAL {$$ = $2;}; - -sp_right: R_SPACE REAL {$$ = $2;}; - -%% - -#define BYE(err) yyerrno = (err), yyerror() - -#define ERR_BASE 1000 -#define OPEN_ERROR 1001 -#define WRITE_ERROR 1002 -#define WRONG_NAME 1003 -#define NO_MEMORY 1004 -#define EXCEED_PATH 1005 -#define EXCEED_POINT 1006 -#define PATH_MISMATCH 1007 -#define POINT_MISMATCH 1008 -#define PROP_MISMATCH 1009 -#define EXCEED_PROPS 1010 - -char *prog; - -main(argc, argv) - int argc; - char *argv[]; - -{ - /* Usage : to_wfont [-o outfile] [infile] */ - char *s; - - fname[0] = 0; - tableindex = 0; - head.num_ch = -1; - - prog = *argv; - while (--argc > 0 && *++argv != NULL) { - s = *argv; - if (*s++ == '-') - switch (*s) { - case 'o': - if (*++argv != NULL) - { - --argc; - (void) strcpy(fname, *argv); - } - break; - default: /* ignore other options */ - ; - } - else { - FILE *fp; - - /* standard input redirection */ - fp = fopen(*argv, "r"); - if (fp != NULL) { - if (close(fileno(stdin)) < 0) - { - perror(prog); - return; - } - if (dup(fileno(fp)) < 0) - { - perror(prog); - return; - } - (void) fclose(fp); - } - } - } -#if defined(__QNX__) - yyparse(); - return; -#else - return (yyparse()); -#endif -} - -/* set number of characters */ -set_num_ch(num_ch) -int num_ch; -{ - yyerrno = 0; - head.num_ch = num_ch; - if (num_ch > 0) { - Table = (Dispatch *) malloc(num_ch * sizeof(Dispatch)); - sp_table = (Standard *) malloc(num_ch * sizeof(Standard)); - strokes = (Path *) malloc(num_ch * sizeof(Path)); - } - - for (tableindex = 0; tableindex < num_ch; tableindex++) { - Table[tableindex].center = 0.0; - Table[tableindex].right = 0.0; - Table[tableindex].offset = 0; - - sp_table[tableindex].std_left = 0.0; - sp_table[tableindex].std_wide = 0.0; - sp_table[tableindex].std_rght = 0.0; - - strokes[tableindex].n_subpaths = 0; - strokes[tableindex].n_vertices = 0; - strokes[tableindex].subpaths = NULL; - } -} - -/* initialize the property info in the header */ -init_properties(num_props) - int num_props; -{ - if (num_props > 0) { - head.properties = (Property *) - malloc (num_props * sizeof (Property)); - head.num_props = expect.props = num_props; - } - else { - head.properties = NULL; - head.num_props = expect.props = 0; - } - count.props = -1; - property = head.properties; /* initialize the list pointer */ -} - -check_num_props() -{ - count.props++; - if (count.props != expect.props) - BYE (PROP_MISMATCH); -} - -/* add individual property info into the buffer */ -add_property(name, value) - char *name, - *value; -{ - /* check if the property exceeds allocated space */ - - if (++count.props >= head.num_props) - BYE(EXCEED_PROPS); - - /* copy the strings into the buffer */ - - (void) strcpy (property->propname, name); - (void) strcpy (property->propvalue, value); - - /* increment the property pointer */ - - property++; -} - -check_num_ch() -{ - - if (head.num_ch == -1) - set_num_ch(128); - -} - -yyerror() -{ -#if !defined(CSRG_BASED) && !defined(linux) && !defined(Lynx) && !defined(__GNU__) && !defined(__QNX__) && !defined(SCO) - extern int yylineno; -#endif -# define ERR_SIZE (sizeof(err_string) / sizeof(char *)) - static char *err_string[] = { - "Cannot open file", - "Write fails", - "Illegal font name", - "Memory allocation failure", - "Specified number of strokes exceeded", - "Specified number of points exceeded", - "Number of strokes do not match", - "Number of points do not match", - "Number of properties do not match", - "Specified number of properties exceeded", - 0}; - char *str; - - yyerrno -= ERR_BASE; - if (yyerrno > 0 && yyerrno < ERR_SIZE) - str = err_string[yyerrno-1]; - else - str = "Syntax error"; -#if !defined(CSRG_BASED) && !defined(linux) && !defined(Lynx) && !defined(__GNU__) && !defined(__QNX__) && !defined(SCO) - fprintf(stderr, "line %d: %s.\n", yylineno, str); -#else - fprintf(stderr, "%s.\n", str); -#endif - freeall(); - (void) unlink(fname); - exit(1); -} - -/* create wfont header */ -wf_header(name, top, bottom) - char *name; - float top, - bottom; -{ - - if (name == NULL) - BYE(WRONG_NAME); - head.top = (float) top; - head.bottom = (float) bottom; - head.magic = WFONT_MAGIC_PEX; - (void) strcpy(head.name, name); - free(name); -} - -/* create header for each glyph */ -glyph_header(npath, center, right, npts) - int npath, - npts; - float center, - right; -{ - { - register Path *strk = strokes + tableindex; - - if (npath > 0) /* Don't allocate space unless the character - has strokes associated with it. */ - { - strk->subpaths = (Path_subpath *) - malloc(npath * sizeof (Path_subpath)); - - if (strk->subpaths == NULL) - BYE(NO_MEMORY); - - strk->type = PATH_2DF; - strk->n_subpaths = npath; - strk->n_vertices = npts; - } - else { /* Just initialize the entry */ - strk->subpaths = NULL; - strk->type = PATH_2DF; - strk->n_subpaths = 0; - strk->n_vertices = 0; - } - } - { - register Dispatch *tbl = Table + tableindex; - - tbl->offset = 0; - tbl->center = center; - tbl->right = right; - } - count.path = -1; /* initialize path counter, not to - * exceed n_subpath */ -} - -/* create standard spacing info for each glyph */ -std_space(l_bear, wide, r_bear) - - float l_bear, - wide, - r_bear; -{ - register Standard *tbl = sp_table +tableindex; - tbl->std_left = l_bear; - tbl->std_wide = wide; - tbl->std_rght = r_bear; -} - -/* initialize each sub_path */ -init_path(close, n) - int close, - n; -{ - register Path_subpath *path; - - if (++count.path >= strokes[tableindex].n_subpaths) - BYE(EXCEED_PATH); - path = current_path = strokes[tableindex].subpaths + count.path; - path->n_pts = n; - path->closed = close; - if (n > 0) - path->pts.pt2df = (Path_point2df *) - malloc(n * sizeof (Path_point2df)); - if (path->pts.pt2df == NULL) - BYE(NO_MEMORY); - expect.point = path->n_pts; - count.point = -1; /* initialize point counter, not to - * exceed n_pts */ -} - -/* accumulating points for each sub_path */ -add_point(x, y) - float x, - y; -{ - register Path_subpath *path; - register Path_point2df *pt_ptr; - - path = current_path; - if (++count.point >= path->n_pts) - BYE(EXCEED_POINT); - pt_ptr = path->pts.pt2df + count.point; - pt_ptr->x = x; - pt_ptr->y = y; -} - -/* Path_type + n_subpaths + n_vertices */ -#define STROKE_HEAD (sizeof (Path_type) + sizeof (int) + sizeof (int)) - -/* write out file, close everything, free everything */ -fini() -{ - static long zero = 0; - - /* pointers used to walk the arrays */ - register Path_subpath *spath; - register Dispatch *tbl_ptr; - register Path *strptr; - register Property *prop_ptr; - - FILE *fp; - long offset; - int npath; - register int i, - j, - k; - Standard *sp_ptr; - Path_point2df *pt; - - if (fname[0] == 0) { /* default output file name */ - (void) strcpy(fname, head.name); - (void) strcat(fname, ".phont"); - } - - if ((fp = fopen(fname, "w")) == NULL) - BYE(OPEN_ERROR); - -# define BY_BYE(err) fclose(fp), BYE(err) - - /* adjust the characters for spacing, note max char width */ - head.max_width = 0.0; - for (i = 0, tbl_ptr = Table, strptr = strokes, sp_ptr = sp_table; - i < head.num_ch; i++, tbl_ptr++, strptr++, sp_ptr++) { - tbl_ptr->center += sp_ptr->std_left; - tbl_ptr->right += sp_ptr->std_left + sp_ptr->std_rght; - if (tbl_ptr->right > head.max_width) - head.max_width = tbl_ptr->right; - npath = strptr->n_subpaths; - if (npath > 0 || tbl_ptr->center != 0.0 || - tbl_ptr->right != 0.0) { - for (j = 0, spath = strptr->subpaths; - j < npath; j++, spath++) { - for(k=0, pt = spath->pts.pt2df; - kn_pts; k++, pt++) { - pt->x += sp_ptr->std_left; - } - } - } - } - /* write the header info */ - if (fwrite(&head, sizeof (head), 1, fp) != 1) - BY_BYE(WRITE_ERROR); - - (void) fseek(fp, START_PROPS, L_SET); - - /* write the property info, if any */ - if (head.num_props > 0) { - for (i=0, prop_ptr = head.properties; i < head.num_props; - i++, prop_ptr++) { - - /* write the property name */ - if (fwrite(prop_ptr->propname, 80, 1, fp) != 1) - BY_BYE(WRITE_ERROR); - - /* write the property value */ - if (fwrite(prop_ptr->propvalue, 80, 1, fp) != 1) - BY_BYE(WRITE_ERROR); - } - } - - (void) fseek(fp, START_DISPATCH(head.num_props), L_SET); - offset = START_PATH(head.num_ch, head.num_props); - - - /* write the dispatch table */ - for (i = 0, tbl_ptr = Table, strptr = strokes; - i < head.num_ch; i++, tbl_ptr++, strptr++) { - if (fwrite(&tbl_ptr->center, sizeof (float), 1, fp) != 1 || - fwrite(&tbl_ptr->right, sizeof (float), 1, fp) != 1) - BY_BYE(WRITE_ERROR); - npath = strptr->n_subpaths; - if (npath > 0 || tbl_ptr->center != 0.0 || - tbl_ptr->right != 0.0) { - if (fwrite(&offset, sizeof (offset), 1, fp) != 1) - BY_BYE(WRITE_ERROR); - offset += STROKE_HEAD + npath * 2 * sizeof (int); - for (j = 0, spath = strptr->subpaths; - j < npath; j++, spath++) - offset += spath->n_pts * sizeof (Path_point2df); - } - else if (fwrite(&zero, sizeof (long), 1, fp) != 1) - BY_BYE(WRITE_ERROR); - } - - (void) fseek(fp, START_PATH(head.num_ch, head.num_props), L_SET); - - /* write the stroke table */ - for (i = 0, tbl_ptr = Table, strptr = strokes; - i < head.num_ch; i++, tbl_ptr++, strptr++) { - if (strptr->n_subpaths > 0 || - tbl_ptr->center != 0.0 || - tbl_ptr->right != 0.0) { - if (fwrite(strptr, STROKE_HEAD, 1, fp) != 1) - BY_BYE(WRITE_ERROR); - - for (j = 0, spath = strptr->subpaths; - j < strptr->n_subpaths; j++, spath++) { - - if (fwrite(&spath->n_pts, - sizeof (spath->n_pts), 1, fp) != 1 || - fwrite(&spath->closed, - sizeof (spath->closed), 1, fp) != 1 || - fwrite(spath->pts.pt2df, - sizeof (Path_point2df), - spath->n_pts, fp) != spath->n_pts) - BY_BYE(WRITE_ERROR); - } - } - } - - (void) fclose(fp); - freeall(); -# undef BY_BYE -} - -freeall() -{ - register Path *path; - register Path_subpath *spath; - register int i, - j, - n; - - path = strokes; - for (i = 0; i < head.num_ch; i++, path++) { - n = path->n_subpaths; - if (n <= 0) - continue; - spath = path->subpaths; - for (j = 0; j < n; j++, spath++) - if (spath->pts.pt2df != NULL) - free((char *) spath->pts.pt2df); - if (path->subpaths != NULL) - free((char *) path->subpaths); - } - if (Table) - free(Table); - if (sp_table) - free(sp_table); - if (strokes) - free(strokes); - if (head.properties != NULL) - free((char *) head.properties); -} - -check_nstroke() -{ - count.path++; - if (expect.path != count.path) - BYE(PATH_MISMATCH); -} - -check_npts() -{ - count.point++; - if (expect.point != count.point) - BYE(POINT_MISMATCH); -} Index: xc/fonts/PEX/wfont.h diff -u xc/fonts/PEX/wfont.h:1.2 xc/fonts/PEX/wfont.h:removed --- xc/fonts/PEX/wfont.h:1.2 Fri Dec 14 14:53:24 2001 +++ xc/fonts/PEX/wfont.h Sat Feb 28 21:40:45 2004 @@ -1,163 +0,0 @@ -/* $Xorg: wfont.h,v 1.4 2001/02/09 02:03:21 xorgcvs Exp $ */ - -/***************************************************************** - -Copyright 1989,1990, 1991, 1998 The Open Group - -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. - -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 -OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 names of Sun Microsystems, -and the X Consortium, not be used in advertising or publicity -pertaining to distribution of the software without specific, written -prior permission. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS 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. - -******************************************************************/ - - -#ifndef WFONT_INCLUDED -#define WFONT_INCLUDED - -#define WFONT_MAGIC 0x813 -#define WFONT_MAGIC_PLUS 0x715 -#define WFONT_MAGIC_PEX 0x70686e74 -#define START_PROPS 0x100 -#define START_DISPATCH(_num_props) (START_PROPS + 160 * _num_props) -#define START_PATH(_num_ch_, _num_props) (START_DISPATCH(_num_props) + sizeof(Dispatch) * _num_ch_) -#define NUM_DISPATCH 128 - -typedef struct { - unsigned short x; - unsigned short y; -} Path_point2dpx; - -typedef struct { - float x; - float y; -} Path_point2df; - -typedef struct { - int x; - int y; - int z; -} Path_point3di; - -typedef struct { - float x; - float y; - float z; -} Path_point3df; - -typedef struct { - float x; - float y; - float z; - float w; -} Path_point4df; - -typedef union { - Path_point2dpx *pt2dpx; - Path_point2df *pt2df; - Path_point3di *pt3di; - Path_point3df *pt3df; - Path_point4df *pt4df; -} Path_pt_ptr; - -typedef enum { - PATH_2DF, - PATH_2DPX, - PATH_3DF, - PATH_3DI, - PATH_4DF -} Path_type; - -typedef struct { - int n_pts; /* number of points in the subpath */ - Path_pt_ptr pts; /* pointer to them */ - int closed; /* true if the subpath is closed */ - int dcmp_flag; /* flag for pgon dcmp, pgon type - and dcmped triangle type */ -} Path_subpath; - -typedef struct { - Path_type type; /* type of vertices in this path */ - int n_subpaths; /* number of subpaths */ - int n_vertices; /* total number of vertices */ - Path_subpath *subpaths; /* array of subpaths */ -} Path; - -typedef Path *Path_handle; - -typedef struct { - char propname[80]; /* font property name */ - char propvalue[80]; /* font property value */ -}Property; - -typedef struct { - int magic; /* magic number */ - char name[80]; /* name of this font */ - float top, /* extreme values */ - bottom, - max_width; - int num_ch; /* no. of fonts in the set */ - int num_props; /* no. of font properties */ - Property *properties; /* array of properties */ -} Font_header; - -typedef struct { - float center, /* center of the character */ - right; /* right edge */ - long offset; /* offset in the file of the character - * description*/ -} Dispatch; - - -typedef struct { - float center, - right; - Path strokes; -} Ch_font; - -typedef struct { - char name[80]; - float top, - bottom, - max_width; - int num_ch; /* # characters in the font*/ - Ch_font **ch_data; -} Phg_font; - -#endif /*WFONT_INCLUDED*/ Index: xc/fonts/bdf/100dpi/luBIS19-L1.bdf diff -u xc/fonts/bdf/100dpi/luBIS19-L1.bdf:1.1 xc/fonts/bdf/100dpi/luBIS19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/luBIS19-L1.bdf:1.1 Wed Apr 4 18:55:24 2001 +++ xc/fonts/bdf/100dpi/luBIS19-L1.bdf Mon Apr 7 12:23:25 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "166" +AVERAGE_WIDTH 166 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/luBIS19.bdf diff -u xc/fonts/bdf/100dpi/luBIS19.bdf:1.3 xc/fonts/bdf/100dpi/luBIS19.bdf:1.4 --- xc/fonts/bdf/100dpi/luBIS19.bdf:1.3 Tue Apr 17 19:43:05 2001 +++ xc/fonts/bdf/100dpi/luBIS19.bdf Mon Apr 7 12:23:25 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "166" +AVERAGE_WIDTH 166 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/luBS19-L1.bdf diff -u xc/fonts/bdf/100dpi/luBS19-L1.bdf:1.1 xc/fonts/bdf/100dpi/luBS19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/luBS19-L1.bdf:1.1 Wed Apr 4 18:55:26 2001 +++ xc/fonts/bdf/100dpi/luBS19-L1.bdf Mon Apr 7 12:23:25 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "166" +AVERAGE_WIDTH 166 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/luBS19.bdf diff -u xc/fonts/bdf/100dpi/luBS19.bdf:1.3 xc/fonts/bdf/100dpi/luBS19.bdf:1.4 --- xc/fonts/bdf/100dpi/luBS19.bdf:1.3 Tue Apr 17 19:43:06 2001 +++ xc/fonts/bdf/100dpi/luBS19.bdf Mon Apr 7 12:23:25 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "166" +AVERAGE_WIDTH 166 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/luIS19-L1.bdf diff -u xc/fonts/bdf/100dpi/luIS19-L1.bdf:1.1 xc/fonts/bdf/100dpi/luIS19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/luIS19-L1.bdf:1.1 Wed Apr 4 18:55:27 2001 +++ xc/fonts/bdf/100dpi/luIS19-L1.bdf Mon Apr 7 12:23:25 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "147" +AVERAGE_WIDTH 147 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/luIS19.bdf diff -u xc/fonts/bdf/100dpi/luIS19.bdf:1.3 xc/fonts/bdf/100dpi/luIS19.bdf:1.4 --- xc/fonts/bdf/100dpi/luIS19.bdf:1.3 Tue Apr 17 19:43:08 2001 +++ xc/fonts/bdf/100dpi/luIS19.bdf Mon Apr 7 12:23:25 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "147" +AVERAGE_WIDTH 147 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/luRS19-L1.bdf diff -u xc/fonts/bdf/100dpi/luRS19-L1.bdf:1.1 xc/fonts/bdf/100dpi/luRS19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/luRS19-L1.bdf:1.1 Wed Apr 4 18:55:28 2001 +++ xc/fonts/bdf/100dpi/luRS19-L1.bdf Mon Apr 7 12:23:26 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "147" +AVERAGE_WIDTH 147 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/luRS19.bdf diff -u xc/fonts/bdf/100dpi/luRS19.bdf:1.3 xc/fonts/bdf/100dpi/luRS19.bdf:1.4 --- xc/fonts/bdf/100dpi/luRS19.bdf:1.3 Tue Apr 17 19:43:09 2001 +++ xc/fonts/bdf/100dpi/luRS19.bdf Mon Apr 7 12:23:26 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "147" +AVERAGE_WIDTH 147 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/lubB19-L1.bdf diff -u xc/fonts/bdf/100dpi/lubB19-L1.bdf:1.1 xc/fonts/bdf/100dpi/lubB19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/lubB19-L1.bdf:1.1 Wed Apr 4 18:55:29 2001 +++ xc/fonts/bdf/100dpi/lubB19-L1.bdf Mon Apr 7 12:23:26 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "155" +AVERAGE_WIDTH 155 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/lubB19.bdf diff -u xc/fonts/bdf/100dpi/lubB19.bdf:1.3 xc/fonts/bdf/100dpi/lubB19.bdf:1.4 --- xc/fonts/bdf/100dpi/lubB19.bdf:1.3 Tue Apr 17 19:43:10 2001 +++ xc/fonts/bdf/100dpi/lubB19.bdf Mon Apr 7 12:23:26 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "155" +AVERAGE_WIDTH 155 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/lubBI19-L1.bdf diff -u xc/fonts/bdf/100dpi/lubBI19-L1.bdf:1.1 xc/fonts/bdf/100dpi/lubBI19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/lubBI19-L1.bdf:1.1 Wed Apr 4 18:55:31 2001 +++ xc/fonts/bdf/100dpi/lubBI19-L1.bdf Mon Apr 7 12:23:26 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "156" +AVERAGE_WIDTH 156 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/lubBI19.bdf diff -u xc/fonts/bdf/100dpi/lubBI19.bdf:1.3 xc/fonts/bdf/100dpi/lubBI19.bdf:1.4 --- xc/fonts/bdf/100dpi/lubBI19.bdf:1.3 Tue Apr 17 19:43:11 2001 +++ xc/fonts/bdf/100dpi/lubBI19.bdf Mon Apr 7 12:23:26 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "156" +AVERAGE_WIDTH 156 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/lubI19-L1.bdf diff -u xc/fonts/bdf/100dpi/lubI19-L1.bdf:1.1 xc/fonts/bdf/100dpi/lubI19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/lubI19-L1.bdf:1.1 Wed Apr 4 18:55:32 2001 +++ xc/fonts/bdf/100dpi/lubI19-L1.bdf Mon Apr 7 12:23:26 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "148" +AVERAGE_WIDTH 148 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/lubI19.bdf diff -u xc/fonts/bdf/100dpi/lubI19.bdf:1.3 xc/fonts/bdf/100dpi/lubI19.bdf:1.4 --- xc/fonts/bdf/100dpi/lubI19.bdf:1.3 Tue Apr 17 19:43:12 2001 +++ xc/fonts/bdf/100dpi/lubI19.bdf Mon Apr 7 12:23:26 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "148" +AVERAGE_WIDTH 148 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/lubR19-L1.bdf diff -u xc/fonts/bdf/100dpi/lubR19-L1.bdf:1.1 xc/fonts/bdf/100dpi/lubR19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/lubR19-L1.bdf:1.1 Wed Apr 4 18:55:33 2001 +++ xc/fonts/bdf/100dpi/lubR19-L1.bdf Mon Apr 7 12:23:26 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "149" +AVERAGE_WIDTH 149 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/lubR19.bdf diff -u xc/fonts/bdf/100dpi/lubR19.bdf:1.3 xc/fonts/bdf/100dpi/lubR19.bdf:1.4 --- xc/fonts/bdf/100dpi/lubR19.bdf:1.3 Tue Apr 17 19:43:14 2001 +++ xc/fonts/bdf/100dpi/lubR19.bdf Mon Apr 7 12:23:26 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "149" +AVERAGE_WIDTH 149 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/100dpi/lutBS19-L1.bdf diff -u xc/fonts/bdf/100dpi/lutBS19-L1.bdf:1.1 xc/fonts/bdf/100dpi/lutBS19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/lutBS19-L1.bdf:1.1 Wed Apr 4 18:55:34 2001 +++ xc/fonts/bdf/100dpi/lutBS19-L1.bdf Mon Apr 7 12:23:26 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "M" -AVERAGE_WIDTH "159" +AVERAGE_WIDTH 159 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COPYRIGHT "Copyright Bigelow & Holmes 1986, 1985." Index: xc/fonts/bdf/100dpi/lutBS19.bdf diff -u xc/fonts/bdf/100dpi/lutBS19.bdf:1.2 xc/fonts/bdf/100dpi/lutBS19.bdf:1.3 --- xc/fonts/bdf/100dpi/lutBS19.bdf:1.2 Wed Apr 4 18:55:34 2001 +++ xc/fonts/bdf/100dpi/lutBS19.bdf Mon Apr 7 12:23:26 2003 @@ -17,7 +17,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "M" -AVERAGE_WIDTH "159" +AVERAGE_WIDTH 159 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COPYRIGHT "Copyright Bigelow & Holmes 1986, 1985." Index: xc/fonts/bdf/100dpi/lutRS19-L1.bdf diff -u xc/fonts/bdf/100dpi/lutRS19-L1.bdf:1.1 xc/fonts/bdf/100dpi/lutRS19-L1.bdf:1.2 --- xc/fonts/bdf/100dpi/lutRS19-L1.bdf:1.1 Wed Apr 4 18:55:36 2001 +++ xc/fonts/bdf/100dpi/lutRS19-L1.bdf Mon Apr 7 12:23:27 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "M" -AVERAGE_WIDTH "159" +AVERAGE_WIDTH 159 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COPYRIGHT "Copyright Bigelow & Holmes 1986, 1985." Index: xc/fonts/bdf/100dpi/lutRS19.bdf diff -u xc/fonts/bdf/100dpi/lutRS19.bdf:1.2 xc/fonts/bdf/100dpi/lutRS19.bdf:1.3 --- xc/fonts/bdf/100dpi/lutRS19.bdf:1.2 Wed Apr 4 18:55:36 2001 +++ xc/fonts/bdf/100dpi/lutRS19.bdf Mon Apr 7 12:23:27 2003 @@ -17,7 +17,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "M" -AVERAGE_WIDTH "159" +AVERAGE_WIDTH 159 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COPYRIGHT "Copyright Bigelow & Holmes 1986, 1985." Index: xc/fonts/bdf/75dpi/Imakefile.inc diff -u xc/fonts/bdf/75dpi/Imakefile.inc:1.6 xc/fonts/bdf/75dpi/Imakefile.inc:1.7 --- xc/fonts/bdf/75dpi/Imakefile.inc:1.6 Wed Jul 4 12:44:29 2001 +++ xc/fonts/bdf/75dpi/Imakefile.inc Wed Jun 18 12:17:34 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/fonts/bdf/75dpi/Imakefile.inc,v 1.6 2001/07/04 16:44:29 tsi Exp $ +XCOMM $XFree86: xc/fonts/bdf/75dpi/Imakefile.inc,v 1.7 2003/06/18 16:17:34 eich Exp $ #if BuildUCSFonts @@ -157,7 +157,7 @@ FontObj(luRS24-ISO8859-1) \ FontObj(lubB08-ISO8859-1) FontObj(lubB10-ISO8859-1) \ FontObj(lubB12-ISO8859-1) FontObj(lubB14-ISO8859-1) \ - FontObj(lubB18-ISO8859-1) FontObj(lubR19-ISO8859-1) \ + FontObj(lubB18-ISO8859-1) FontObj(lubB19-ISO8859-1) \ FontObj(lubB24-ISO8859-1) \ FontObj(lubBI08-ISO8859-1) FontObj(lubBI10-ISO8859-1) \ FontObj(lubBI12-ISO8859-1) FontObj(lubBI14-ISO8859-1) \ @@ -267,7 +267,7 @@ FontObj(luRS24-ISO8859-2) \ FontObj(lubB08-ISO8859-2) FontObj(lubB10-ISO8859-2) \ FontObj(lubB12-ISO8859-2) FontObj(lubB14-ISO8859-2) \ - FontObj(lubB18-ISO8859-2) FontObj(lubR19-ISO8859-2) \ + FontObj(lubB18-ISO8859-2) FontObj(lubB19-ISO8859-2) \ FontObj(lubB24-ISO8859-2) \ FontObj(lubBI08-ISO8859-2) FontObj(lubBI10-ISO8859-2) \ FontObj(lubBI12-ISO8859-2) FontObj(lubBI14-ISO8859-2) \ @@ -375,7 +375,7 @@ FontObj(luRS24-ISO8859-3) \ FontObj(lubB08-ISO8859-3) FontObj(lubB10-ISO8859-3) \ FontObj(lubB12-ISO8859-3) FontObj(lubB14-ISO8859-3) \ - FontObj(lubB18-ISO8859-3) FontObj(lubR19-ISO8859-3) \ + FontObj(lubB18-ISO8859-3) FontObj(lubB19-ISO8859-3) \ FontObj(lubB24-ISO8859-3) \ FontObj(lubBI08-ISO8859-3) FontObj(lubBI10-ISO8859-3) \ FontObj(lubBI12-ISO8859-3) FontObj(lubBI14-ISO8859-3) \ @@ -483,7 +483,7 @@ FontObj(luRS24-ISO8859-4) \ FontObj(lubB08-ISO8859-4) FontObj(lubB10-ISO8859-4) \ FontObj(lubB12-ISO8859-4) FontObj(lubB14-ISO8859-4) \ - FontObj(lubB18-ISO8859-4) FontObj(lubR19-ISO8859-4) \ + FontObj(lubB18-ISO8859-4) FontObj(lubB19-ISO8859-4) \ FontObj(lubB24-ISO8859-4) \ FontObj(lubBI08-ISO8859-4) FontObj(lubBI10-ISO8859-4) \ FontObj(lubBI12-ISO8859-4) FontObj(lubBI14-ISO8859-4) \ @@ -591,7 +591,7 @@ FontObj(luRS24-ISO8859-9) \ FontObj(lubB08-ISO8859-9) FontObj(lubB10-ISO8859-9) \ FontObj(lubB12-ISO8859-9) FontObj(lubB14-ISO8859-9) \ - FontObj(lubB18-ISO8859-9) FontObj(lubR19-ISO8859-9) \ + FontObj(lubB18-ISO8859-9) FontObj(lubB19-ISO8859-9) \ FontObj(lubB24-ISO8859-9) \ FontObj(lubBI08-ISO8859-9) FontObj(lubBI10-ISO8859-9) \ FontObj(lubBI12-ISO8859-9) FontObj(lubBI14-ISO8859-9) \ @@ -699,7 +699,7 @@ FontObj(luRS24-ISO8859-10) \ FontObj(lubB08-ISO8859-10) FontObj(lubB10-ISO8859-10) \ FontObj(lubB12-ISO8859-10) FontObj(lubB14-ISO8859-10) \ - FontObj(lubB18-ISO8859-10) FontObj(lubR19-ISO8859-10) \ + FontObj(lubB18-ISO8859-10) FontObj(lubB19-ISO8859-10) \ FontObj(lubB24-ISO8859-10) \ FontObj(lubBI08-ISO8859-10) FontObj(lubBI10-ISO8859-10) \ FontObj(lubBI12-ISO8859-10) FontObj(lubBI14-ISO8859-10) \ @@ -807,7 +807,7 @@ FontObj(luRS24-ISO8859-13) \ FontObj(lubB08-ISO8859-13) FontObj(lubB10-ISO8859-13) \ FontObj(lubB12-ISO8859-13) FontObj(lubB14-ISO8859-13) \ - FontObj(lubB18-ISO8859-13) FontObj(lubR19-ISO8859-13) \ + FontObj(lubB18-ISO8859-13) FontObj(lubB19-ISO8859-13) \ FontObj(lubB24-ISO8859-13) \ FontObj(lubBI08-ISO8859-13) FontObj(lubBI10-ISO8859-13) \ FontObj(lubBI12-ISO8859-13) FontObj(lubBI14-ISO8859-13) \ @@ -915,7 +915,7 @@ FontObj(luRS24-ISO8859-14) \ FontObj(lubB08-ISO8859-14) FontObj(lubB10-ISO8859-14) \ FontObj(lubB12-ISO8859-14) FontObj(lubB14-ISO8859-14) \ - FontObj(lubB18-ISO8859-14) FontObj(lubR19-ISO8859-14) \ + FontObj(lubB18-ISO8859-14) FontObj(lubB19-ISO8859-14) \ FontObj(lubB24-ISO8859-14) \ FontObj(lubBI08-ISO8859-14) FontObj(lubBI10-ISO8859-14) \ FontObj(lubBI12-ISO8859-14) FontObj(lubBI14-ISO8859-14) \ @@ -1023,7 +1023,7 @@ FontObj(luRS24-ISO8859-15) \ FontObj(lubB08-ISO8859-15) FontObj(lubB10-ISO8859-15) \ FontObj(lubB12-ISO8859-15) FontObj(lubB14-ISO8859-15) \ - FontObj(lubB18-ISO8859-15) FontObj(lubR19-ISO8859-15) \ + FontObj(lubB18-ISO8859-15) FontObj(lubB19-ISO8859-15) \ FontObj(lubB24-ISO8859-15) \ FontObj(lubBI08-ISO8859-15) FontObj(lubBI10-ISO8859-15) \ FontObj(lubBI12-ISO8859-15) FontObj(lubBI14-ISO8859-15) \ Index: xc/fonts/bdf/75dpi/luBIS19-L1.bdf diff -u xc/fonts/bdf/75dpi/luBIS19-L1.bdf:1.1 xc/fonts/bdf/75dpi/luBIS19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/luBIS19-L1.bdf:1.1 Wed Apr 4 18:56:19 2001 +++ xc/fonts/bdf/75dpi/luBIS19-L1.bdf Mon Apr 7 12:23:29 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" -AVERAGE_WIDTH "122" +AVERAGE_WIDTH 122 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/luBIS19.bdf diff -u xc/fonts/bdf/75dpi/luBIS19.bdf:1.3 xc/fonts/bdf/75dpi/luBIS19.bdf:1.4 --- xc/fonts/bdf/75dpi/luBIS19.bdf:1.3 Tue Apr 17 19:43:53 2001 +++ xc/fonts/bdf/75dpi/luBIS19.bdf Mon Apr 7 12:23:29 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" -AVERAGE_WIDTH "122" +AVERAGE_WIDTH 122 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/luBS19-L1.bdf diff -u xc/fonts/bdf/75dpi/luBS19-L1.bdf:1.1 xc/fonts/bdf/75dpi/luBS19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/luBS19-L1.bdf:1.1 Wed Apr 4 18:56:20 2001 +++ xc/fonts/bdf/75dpi/luBS19-L1.bdf Mon Apr 7 12:23:29 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" -AVERAGE_WIDTH "122" +AVERAGE_WIDTH 122 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/luBS19.bdf diff -u xc/fonts/bdf/75dpi/luBS19.bdf:1.3 xc/fonts/bdf/75dpi/luBS19.bdf:1.4 --- xc/fonts/bdf/75dpi/luBS19.bdf:1.3 Tue Apr 17 19:43:54 2001 +++ xc/fonts/bdf/75dpi/luBS19.bdf Mon Apr 7 12:23:29 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" -AVERAGE_WIDTH "122" +AVERAGE_WIDTH 122 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/luIS19-L1.bdf diff -u xc/fonts/bdf/75dpi/luIS19-L1.bdf:1.1 xc/fonts/bdf/75dpi/luIS19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/luIS19-L1.bdf:1.1 Wed Apr 4 18:56:22 2001 +++ xc/fonts/bdf/75dpi/luIS19-L1.bdf Mon Apr 7 12:23:29 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" -AVERAGE_WIDTH "108" +AVERAGE_WIDTH 108 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/luIS19.bdf diff -u xc/fonts/bdf/75dpi/luIS19.bdf:1.3 xc/fonts/bdf/75dpi/luIS19.bdf:1.4 --- xc/fonts/bdf/75dpi/luIS19.bdf:1.3 Tue Apr 17 19:43:55 2001 +++ xc/fonts/bdf/75dpi/luIS19.bdf Mon Apr 7 12:23:29 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" -AVERAGE_WIDTH "108" +AVERAGE_WIDTH 108 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/luRS19-L1.bdf diff -u xc/fonts/bdf/75dpi/luRS19-L1.bdf:1.1 xc/fonts/bdf/75dpi/luRS19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/luRS19-L1.bdf:1.1 Wed Apr 4 18:56:27 2001 +++ xc/fonts/bdf/75dpi/luRS19-L1.bdf Mon Apr 7 12:23:29 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" -AVERAGE_WIDTH "108" +AVERAGE_WIDTH 108 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/luRS19.bdf diff -u xc/fonts/bdf/75dpi/luRS19.bdf:1.3 xc/fonts/bdf/75dpi/luRS19.bdf:1.4 --- xc/fonts/bdf/75dpi/luRS19.bdf:1.3 Tue Apr 17 19:43:56 2001 +++ xc/fonts/bdf/75dpi/luRS19.bdf Mon Apr 7 12:23:29 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "P" -AVERAGE_WIDTH "108" +AVERAGE_WIDTH 108 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/lubB19-L1.bdf diff -u xc/fonts/bdf/75dpi/lubB19-L1.bdf:1.1 xc/fonts/bdf/75dpi/lubB19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/lubB19-L1.bdf:1.1 Wed Apr 4 18:56:28 2001 +++ xc/fonts/bdf/75dpi/lubB19-L1.bdf Mon Apr 7 12:23:29 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "114" +AVERAGE_WIDTH 114 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/lubB19.bdf diff -u xc/fonts/bdf/75dpi/lubB19.bdf:1.3 xc/fonts/bdf/75dpi/lubB19.bdf:1.4 --- xc/fonts/bdf/75dpi/lubB19.bdf:1.3 Tue Apr 17 19:43:57 2001 +++ xc/fonts/bdf/75dpi/lubB19.bdf Mon Apr 7 12:23:29 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "114" +AVERAGE_WIDTH 114 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/lubBI19-L1.bdf diff -u xc/fonts/bdf/75dpi/lubBI19-L1.bdf:1.1 xc/fonts/bdf/75dpi/lubBI19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/lubBI19-L1.bdf:1.1 Wed Apr 4 18:56:30 2001 +++ xc/fonts/bdf/75dpi/lubBI19-L1.bdf Mon Apr 7 12:23:29 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "114" +AVERAGE_WIDTH 114 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/lubBI19.bdf diff -u xc/fonts/bdf/75dpi/lubBI19.bdf:1.3 xc/fonts/bdf/75dpi/lubBI19.bdf:1.4 --- xc/fonts/bdf/75dpi/lubBI19.bdf:1.3 Tue Apr 17 19:43:59 2001 +++ xc/fonts/bdf/75dpi/lubBI19.bdf Mon Apr 7 12:23:29 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "114" +AVERAGE_WIDTH 114 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/lubI19-L1.bdf diff -u xc/fonts/bdf/75dpi/lubI19-L1.bdf:1.1 xc/fonts/bdf/75dpi/lubI19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/lubI19-L1.bdf:1.1 Wed Apr 4 18:56:32 2001 +++ xc/fonts/bdf/75dpi/lubI19-L1.bdf Mon Apr 7 12:23:29 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "109" +AVERAGE_WIDTH 109 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/lubI19.bdf diff -u xc/fonts/bdf/75dpi/lubI19.bdf:1.3 xc/fonts/bdf/75dpi/lubI19.bdf:1.4 --- xc/fonts/bdf/75dpi/lubI19.bdf:1.3 Tue Apr 17 19:44:00 2001 +++ xc/fonts/bdf/75dpi/lubI19.bdf Mon Apr 7 12:23:29 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "109" +AVERAGE_WIDTH 109 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/lubR19-L1.bdf diff -u xc/fonts/bdf/75dpi/lubR19-L1.bdf:1.1 xc/fonts/bdf/75dpi/lubR19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/lubR19-L1.bdf:1.1 Wed Apr 4 18:56:34 2001 +++ xc/fonts/bdf/75dpi/lubR19-L1.bdf Mon Apr 7 12:23:29 2003 @@ -25,7 +25,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "109" +AVERAGE_WIDTH 109 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/lubR19.bdf diff -u xc/fonts/bdf/75dpi/lubR19.bdf:1.3 xc/fonts/bdf/75dpi/lubR19.bdf:1.4 --- xc/fonts/bdf/75dpi/lubR19.bdf:1.3 Tue Apr 17 19:44:01 2001 +++ xc/fonts/bdf/75dpi/lubR19.bdf Mon Apr 7 12:23:29 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 100 RESOLUTION_Y 100 SPACING "P" -AVERAGE_WIDTH "109" +AVERAGE_WIDTH 109 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COMMENT END LogicalFontDescription Index: xc/fonts/bdf/75dpi/lutBS19-L1.bdf diff -u xc/fonts/bdf/75dpi/lutBS19-L1.bdf:1.1 xc/fonts/bdf/75dpi/lutBS19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/lutBS19-L1.bdf:1.1 Wed Apr 4 18:56:35 2001 +++ xc/fonts/bdf/75dpi/lutBS19-L1.bdf Mon Apr 7 12:23:29 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "M" -AVERAGE_WIDTH "110" +AVERAGE_WIDTH 110 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COPYRIGHT "Copyright Bigelow & Holmes 1986, 1985." Index: xc/fonts/bdf/75dpi/lutBS19.bdf diff -u xc/fonts/bdf/75dpi/lutBS19.bdf:1.2 xc/fonts/bdf/75dpi/lutBS19.bdf:1.3 --- xc/fonts/bdf/75dpi/lutBS19.bdf:1.2 Wed Apr 4 18:56:35 2001 +++ xc/fonts/bdf/75dpi/lutBS19.bdf Mon Apr 7 12:23:30 2003 @@ -17,7 +17,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "M" -AVERAGE_WIDTH "110" +AVERAGE_WIDTH 110 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COPYRIGHT "Copyright Bigelow & Holmes 1986, 1985." Index: xc/fonts/bdf/75dpi/lutRS19-L1.bdf diff -u xc/fonts/bdf/75dpi/lutRS19-L1.bdf:1.1 xc/fonts/bdf/75dpi/lutRS19-L1.bdf:1.2 --- xc/fonts/bdf/75dpi/lutRS19-L1.bdf:1.1 Wed Apr 4 18:56:37 2001 +++ xc/fonts/bdf/75dpi/lutRS19-L1.bdf Mon Apr 7 12:23:30 2003 @@ -21,7 +21,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "M" -AVERAGE_WIDTH "110" +AVERAGE_WIDTH 110 CHARSET_REGISTRY "ISO8859" CHARSET_ENCODING "1" COPYRIGHT "Copyright Bigelow & Holmes 1986, 1985." Index: xc/fonts/bdf/75dpi/lutRS19.bdf diff -u xc/fonts/bdf/75dpi/lutRS19.bdf:1.2 xc/fonts/bdf/75dpi/lutRS19.bdf:1.3 --- xc/fonts/bdf/75dpi/lutRS19.bdf:1.2 Wed Apr 4 18:56:37 2001 +++ xc/fonts/bdf/75dpi/lutRS19.bdf Mon Apr 7 12:23:30 2003 @@ -17,7 +17,7 @@ RESOLUTION_X 75 RESOLUTION_Y 75 SPACING "M" -AVERAGE_WIDTH "110" +AVERAGE_WIDTH 110 CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" COPYRIGHT "Copyright Bigelow & Holmes 1986, 1985." Index: xc/fonts/encodings/Imakefile diff -u xc/fonts/encodings/Imakefile:1.9 xc/fonts/encodings/Imakefile:1.11 --- xc/fonts/encodings/Imakefile:1.9 Wed Feb 5 07:47:41 2003 +++ xc/fonts/encodings/Imakefile Sat Nov 22 00:08:15 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/fonts/encodings/Imakefile,v 1.9 2003/02/05 12:47:41 dawes Exp $ +XCOMM $XFree86: xc/fonts/encodings/Imakefile,v 1.11 2003/11/22 05:08:15 dawes Exp $ #define IHaveSubdirs #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' @@ -7,10 +7,12 @@ OBJS = EncObjComp(adobe-dingbats) EncObjComp(adobe-standard) \ EncObjComp(adobe-symbol) \ + EncObj(ansi-1251) \ EncObj(armscii-8) \ EncObj(dec-special) \ EncObj(ibm-cp437) EncObj(ibm-cp850) \ EncObj(ibm-cp852) EncObj(ibm-cp866) \ + EncObj(iso8859-6.16) EncObj(iso8859-6.8x) \ EncObj(iso8859-11) EncObj(iso8859-13) \ EncObj(iso8859-16) \ EncObj(microsoft-cp1250) EncObj(microsoft-cp1251) \ Index: xc/fonts/encodings/ansi-1251.enc diff -u /dev/null xc/fonts/encodings/ansi-1251.enc:1.1 --- /dev/null Sat Feb 28 21:41:02 2004 +++ xc/fonts/encodings/ansi-1251.enc Sat Nov 22 00:08:15 2003 @@ -0,0 +1,229 @@ +STARTENCODING ansi-1251 +SIZE 0x100 +STARTMAPPING unicode + +0x21 0x0021 +0x22 0x0022 +0x23 0x0023 +0x24 0x0024 +0x25 0x0025 +0x26 0x0026 +0x27 0x0027 +0x28 0x0028 +0x29 0x0029 +0x2A 0x002A +0x2B 0x002B +0x2C 0x002C +0x2D 0x002D +0x2E 0x002E +0x2F 0x002F +0x30 0x0030 +0x31 0x0031 +0x32 0x0032 +0x33 0x0033 +0x34 0x0034 +0x35 0x0035 +0x36 0x0036 +0x37 0x0037 +0x38 0x0038 +0x39 0x0039 +0x3A 0x003A +0x3B 0x003B +0x3C 0x003C +0x3D 0x003D +0x3E 0x003E +0x3F 0x003F +0x40 0x0040 +0x41 0x0041 +0x42 0x0042 +0x43 0x0043 +0x44 0x0044 +0x45 0x0045 +0x46 0x0046 +0x47 0x0047 +0x48 0x0048 +0x49 0x0049 +0x4A 0x004A +0x4B 0x004B +0x4C 0x004C +0x4D 0x004D +0x4E 0x004E +0x4F 0x004F +0x50 0x0050 +0x51 0x0051 +0x52 0x0052 +0x53 0x0053 +0x54 0x0054 +0x55 0x0055 +0x56 0x0056 +0x57 0x0057 +0x58 0x0058 +0x59 0x0059 +0x5A 0x005A +0x5B 0x005B +0x5C 0x005C +0x5D 0x005D +0x5E 0x005E +0x5F 0x005F +0x60 0x0060 +0x61 0x0061 +0x62 0x0062 +0x63 0x0063 +0x64 0x0064 +0x65 0x0065 +0x66 0x0066 +0x67 0x0067 +0x68 0x0068 +0x69 0x0069 +0x6A 0x006A +0x6B 0x006B +0x6C 0x006C +0x6D 0x006D +0x6E 0x006E +0x6F 0x006F +0x70 0x0070 +0x71 0x0071 +0x72 0x0072 +0x73 0x0073 +0x74 0x0074 +0x75 0x0075 +0x76 0x0076 +0x77 0x0077 +0x78 0x0078 +0x79 0x0079 +0x7A 0x007A +0x7B 0x007B +0x7C 0x007C +0x7D 0x007D +0x7E 0x007E +0x7F 0x0020 +0x80 0x0402 +0x81 0x0403 +0x82 0x201A +0x83 0x0453 +0x84 0x201E +0x85 0x2026 +0x86 0x2020 +0x87 0x2021 +0x88 0xFFFE +0x89 0x2030 +0x8A 0x0409 +0x8B 0x2039 +0x8C 0x040A +0x8D 0x040C +0x8E 0x040B +0x8F 0x040F +0x90 0x0452 +0x91 0x2018 +0x92 0x2019 +0x93 0x201C +0x94 0x201D +0x95 0x2022 +0x96 0x2013 +0x97 0x2014 +0x98 0xFFFE +0x99 0x2122 +0x9A 0x0459 +0x9B 0x203A +0x9C 0x045A +0x9D 0x045C +0x9E 0x045B +0x9F 0x045F +0xA0 0x00A0 +0xA1 0x040E +0xA2 0x045E +0xA3 0x0408 +0xA4 0x00A4 +0xA5 0x0490 +0xA6 0x00A6 +0xA7 0x00A7 +0xA8 0x0401 +0xA9 0x00A9 +0xAA 0x0404 +0xAB 0x00AB +0xAC 0x00AC +0xAD 0x00AD +0xAE 0x00AE +0xAF 0x0407 +0xB0 0x00B0 +0xB1 0x00B1 +0xB2 0x0406 +0xB3 0x0456 +0xB4 0x0491 +0xB5 0x00B5 +0xB6 0x00B6 +0xB7 0x00B7 +0xB8 0x0451 +0xB9 0x2116 +0xBA 0x0454 +0xBB 0x00BB +0xBC 0x0458 +0xBD 0x0405 +0xBE 0x0455 +0xBF 0x0457 +0xC0 0x0410 +0xC1 0x0411 +0xC2 0x0412 +0xC3 0x0413 +0xC4 0x0414 +0xC5 0x0415 +0xC6 0x0416 +0xC7 0x0417 +0xC8 0x0418 +0xC9 0x0419 +0xCA 0x041A +0xCB 0x041B +0xCC 0x041C +0xCD 0x041D +0xCE 0x041E +0xCF 0x041F +0xD0 0x0420 +0xD1 0x0421 +0xD2 0x0422 +0xD3 0x0423 +0xD4 0x0424 +0xD5 0x0425 +0xD6 0x0426 +0xD7 0x0427 +0xD8 0x0428 +0xD9 0x0429 +0xDA 0x042A +0xDB 0x042B +0xDC 0x042C +0xDD 0x042D +0xDE 0x042E +0xDF 0x042F +0xE0 0x0430 +0xE1 0x0431 +0xE2 0x0432 +0xE3 0x0433 +0xE4 0x0434 +0xE5 0x0435 +0xE6 0x0436 +0xE7 0x0437 +0xE8 0x0438 +0xE9 0x0439 +0xEA 0x043A +0xEB 0x043B +0xEC 0x043C +0xED 0x043D +0xEE 0x043E +0xEF 0x043F +0xF0 0x0440 +0xF1 0x0441 +0xF2 0x0442 +0xF3 0x0443 +0xF4 0x0444 +0xF5 0x0445 +0xF6 0x0446 +0xF7 0x0447 +0xF8 0x0448 +0xF9 0x0449 +0xFA 0x044A +0xFB 0x044B +0xFC 0x044C +0xFD 0x044D +0xFE 0x044E +0xFF 0x044F +ENDMAPPING +ENDENCODING Index: xc/fonts/encodings/iso8859-6.16.enc diff -u /dev/null xc/fonts/encodings/iso8859-6.16.enc:1.2 --- /dev/null Sat Feb 28 21:41:02 2004 +++ xc/fonts/encodings/iso8859-6.16.enc Mon Dec 8 10:35:04 2003 @@ -0,0 +1,153 @@ +STARTENCODING iso8859-6.16 +# Encoding file for the LangBox.com's Arabic encoding iso8859-6.16 +# written by Simon Montagu and +# Roland Mainz +# See also: +# - http://www.langbox.com/arabic/fontara16.html +# - http://www.langbox.com/arabic/FontSet_ISO8859-6-16.html +# - http://bugs.xfree86.org/show_bug.cgi?id=420 +# - http://bugzilla.mozilla.org/show_bug.cgi?id=78201 +# $XFree86: xc/fonts/encodings/iso8859-6.16.enc,v 1.2 2003/12/08 15:35:04 dawes Exp $ +STARTMAPPING unicode +UNDEFINE 0x0000 0xFFFF +0x41 0xFE80 +0x42 0xFE81 +0x43 0xFE83 +0x44 0xFE85 +0x45 0xFE87 +0x46 0xFE89 +0x47 0xFE8D +0x48 0xFE8F +0x49 0xFE93 +0x4A 0xFE95 +0x4B 0xFE99 +0x4C 0xFE9D +0x4D 0xFEA1 +0x4E 0xFEA5 +0x4F 0xFEA9 +0x50 0xFEAB +0x51 0xFEAD +0x52 0xFEAF +0x53 0xFEB1 +0x54 0xFEB5 +0x55 0xFEB9 +0x56 0xFEBD +0x57 0xFEC1 +0x58 0xFEC5 +0x59 0xFEC9 +0x5A 0xFECD +0x61 0xFED1 +0x62 0xFED5 +0x63 0xFED9 +0x64 0xFEDD +0x65 0xFEE1 +0x66 0xFEE5 +0x67 0xFEE9 +0x68 0xFEED +0x69 0xFEEF +0x6A 0xFEF1 +0x6B 0xFE70 +0x6C 0xFE72 +0x6D 0xFE74 +0x6E 0xFE76 +0x6F 0xFE78 +0x70 0xFE7A +0x71 0xFE7C +0x72 0xFE7E +0x76 0xFEF5 +0x77 0xFEF7 +0x78 0xFEF9 +0x79 0xFEFB +0x90 0xFE71 +0x93 0xFE77 +0x94 0xFE79 +0x95 0xFE7B +0x96 0xFE7F +0x97 0xFE7D +0xA0 0xFE8C +0xA1 0xFE82 +0xA2 0xFE84 +0xA3 0xFE86 +0xA4 0xFE88 +0xA5 0xFE8E +0xA6 0xFEAA +0xA7 0xFEAC +0xA8 0xFEAE +0xA9 0xFEB0 +0xAA 0xFEEE +0xAB 0xFEF0 +0xAC 0xFE91 +0xAD 0xFE92 +0xAE 0xFE90 +0xB1 0xFE94 +0xB2 0xFE97 +0xB3 0xFE98 +0xB4 0xFE96 +0xB5 0xFE9B +0xB6 0xFE9C +0xB7 0xFE9A +0xB8 0xFE9F +0xB9 0xFEA0 +0xBA 0xFE9E +0xBB 0xFEA3 +0xBC 0xFEA4 +0xBD 0xFEA2 +0xBE 0xFEA7 +0xBF 0xFEA8 +0xC0 0xFEA6 +0xC1 0xFEB3 +0xC2 0xFEB4 +0xC3 0xFEB2 +0xC4 0xFEB7 +0xC5 0xFEB8 +0xC6 0xFEB6 +0xC7 0xFEBB +0xC8 0xFEBC +0xC9 0xFEBA +0xCA 0xFEBF +0xCB 0xFEC0 +0xCC 0xFEBE +0xCD 0xFEC3 +0xCE 0xFEC4 +0xCF 0xFEC2 +0xD0 0xFEC7 +0xD1 0xFEC8 +0xD2 0xFEC6 +0xD3 0xFECB +0xD4 0xFECC +0xD5 0xFECA +0xD6 0xFECF +0xD7 0xFED0 +0xD8 0xFECE +0xD9 0xFED3 +0xDA 0xFED4 +0xDB 0xFED2 +0xDC 0xFED7 +0xDD 0xFED8 +0xDE 0xFED6 +0xDF 0xFEDB +0xE0 0xFEDC +0xE1 0xFEDA +0xE2 0xFEDF +0xE3 0xFEE0 +0xE4 0xFEDE +0xE5 0xFEE3 +0xE6 0xFEE4 +0xE7 0xFEE2 +0xE8 0xFEE7 +0xE9 0xFEE8 +0xEA 0xFEE6 +0xEB 0xFEEB +0xEC 0xFEEC +0xED 0xFEEA +0xEE 0xFEF3 +0xEF 0xFEF4 +0xF0 0xFEF2 +0xF8 0xFE8B +0xF9 0xFE8A +0xFA 0xFEF6 +0xFB 0xFEFA +0xFC 0xFEF8 +0xFD 0xFEFC +ENDMAPPING +ENDENCODING Index: xc/fonts/encodings/iso8859-6.8x.enc diff -u /dev/null xc/fonts/encodings/iso8859-6.8x.enc:1.2 --- /dev/null Sat Feb 28 21:41:02 2004 +++ xc/fonts/encodings/iso8859-6.8x.enc Mon Dec 8 10:35:04 2003 @@ -0,0 +1,116 @@ +STARTENCODING iso8859-6.8x +# Encoding file for the LangBox.com's Arabic encoding iso8859-6.8x +# written by Simon Montagu and +# Roland Mainz +# See also: +# - http://www.langbox.com/arabic/fontara8X.html +# - http://www.langbox.com/arabic/FontSet_ISO8859-6-8X.html +# - http://bugs.xfree86.org/show_bug.cgi?id=420 +# - http://bugzilla.mozilla.org/show_bug.cgi?id=78201 +# $XFree86: xc/fonts/encodings/iso8859-6.8x.enc,v 1.2 2003/12/08 15:35:04 dawes Exp $ +STARTMAPPING unicode +UNDEFINE 0x0000 0xFFFF +0x8D 0xFEEF +0x8E 0xFE94 +0x8F 0xFEB2 +0x90 0xFEB6 +0x91 0xFEBA +0x92 0xFEBE +0x93 0xFEC4 +0x94 0xFEC8 +0x95 0xFECC +0x96 0xFECA +0x97 0xFED0 +0x98 0xFECE +0x99 0xFED4 +0x9A 0xFED8 +0x9B 0xFEDC +0x9C 0xFEEC +0x9D 0xFEEA +0x9E 0xFEF1 +0x9F 0xFE89 +0xA8 0xFE70 +0xA9 0xFE72 +0xAA 0xFE74 +0xAB 0xFE76 +0xAC 0xFE78 +0xAD 0xFE7A +0xAE 0xFE7C +0xAF 0xFE7E +0xB0 0x0660 +0xB1 0x0661 +0xB2 0x0662 +0xB3 0x0663 +0xB4 0x0664 +0xB5 0x0665 +0xB6 0x0666 +0xB7 0x0667 +0xB8 0x0668 +0xB9 0x0669 +0xBA 0x060C +0xBB 0x061B +0xBC 0xFE71 +0xBF 0x061F +0xC0 0xFE8B +0xC1 0xFE80 +0xC2 0xFE81 +0xC3 0xFE83 +0xC4 0xFE85 +0xC5 0xFE87 +0xC6 0xFE8A +0xC7 0xFE8D +0xC8 0xFE8F +0xC9 0xFE93 +0xCA 0xFE95 +0xCB 0xFE99 +0xCC 0xFE9D +0xCD 0xFEA1 +0xCE 0xFEA5 +0xCF 0xFEAA +0xD0 0xFEAB +0xD1 0xFEAE +0xD2 0xFEAF +0xD3 0xFEB1 +0xD4 0xFEB5 +0xD5 0xFEB9 +0xD6 0xFEBD +0xD7 0xFEC3 +0xD8 0xFEC7 +0xD9 0xFEC9 +0xDA 0xFECD +0xDB 0xFE77 +0xDC 0xFE79 +0xDF 0xFE7F +0xE0 0x0640 +0xE1 0xFED1 +0xE2 0xFED5 +0xE3 0xFED9 +0xE4 0xFEDD +0xE5 0xFEE1 +0xE6 0xFEE5 +0xE7 0xFEE9 +0xE8 0xFEED +0xE9 0xFEEF +0xEA 0xFEF2 +0xEB 0xFE91 +0xEC 0xFE97 +0xED 0xFE9B +0xEE 0xFE9F +0xEF 0xFEA3 +0xF0 0xFEA7 +0xF1 0xFEB3 +0xF2 0xFEB7 +0xF3 0xFEBB +0xF4 0xFEBF +0xF5 0xFECB +0xF6 0xFECF +0xF7 0xFED3 +0xF8 0xFED7 +0xF9 0xFEDB +0xFA 0xFEDF +0xFB 0xFEE3 +0xFC 0xFEE7 +0xFD 0xFEEB +0xFE 0xFEF3 +ENDMAPPING +ENDENCODING Index: xc/fonts/encodings/large/Imakefile diff -u xc/fonts/encodings/large/Imakefile:1.3 xc/fonts/encodings/large/Imakefile:1.6 --- xc/fonts/encodings/large/Imakefile:1.3 Thu Nov 1 22:06:39 2001 +++ xc/fonts/encodings/large/Imakefile Sun Dec 7 13:20:10 2003 @@ -1,22 +1,27 @@ -XCOMM $XFree86: xc/fonts/encodings/large/Imakefile,v 1.3 2001/11/02 03:06:39 dawes Exp $ +XCOMM $XFree86: xc/fonts/encodings/large/Imakefile,v 1.6 2003/12/07 18:20:10 dawes Exp $ -OBJS = EncObjComp(big5.eten-0) EncObjComp(gb2312.1980-0) \ - EncObjComp(gbk-0) \ - EncObjComp(jisx0201.1976-0) EncObjComp(jisx0208.1983-0) \ +OBJS = EncObjComp(big5.eten-0) EncObjComp(big5hkscs-0) \ + EncObjComp(gb2312.1980-0) EncObjComp(gbk-0) \ + EncObjComp(gb18030.2000-0) EncObjComp(gb18030.2000-1) \ + EncObjComp(jisx0201.1976-0) \ EncObjComp(jisx0208.1990-0) EncObjComp(jisx0212.1990-0) \ - EncObjComp(ksc5601.1987-0) EncObjComp(ksc5601.1992-3) + EncObjComp(ksc5601.1987-0) EncObjComp(ksc5601.1992-3) \ + EncObjComp(sun.unicode.india-0) SubdirLibraryRule($(OBJS)) CompEncodingTarget(big5.eten-0) +CompEncodingTarget(big5hkscs-0) CompEncodingTarget(gb2312.1980-0) +CompEncodingTarget(gb18030.2000-0) +CompEncodingTarget(gb18030.2000-1) CompEncodingTarget(gbk-0) CompEncodingTarget(jisx0201.1976-0) -CompEncodingTarget(jisx0208.1983-0) CompEncodingTarget(jisx0208.1990-0) CompEncodingTarget(jisx0212.1990-0) CompEncodingTarget(ksc5601.1987-0) CompEncodingTarget(ksc5601.1992-3) +CompEncodingTarget(sun.unicode.india-0) /* This is only here to keep InstallEncodings happy. */ MakeEncodings(/**/,$(ENCODINGSDIR)/large,.) Index: xc/fonts/encodings/large/big5hkscs-0.enc diff -u /dev/null xc/fonts/encodings/large/big5hkscs-0.enc:1.2 --- /dev/null Sat Feb 28 21:41:02 2004 +++ xc/fonts/encodings/large/big5hkscs-0.enc Fri Nov 28 20:44:23 2003 @@ -0,0 +1,16559 @@ +STARTENCODING big5hkscs-0 +# This file is generated from Anthony Fok's () +# http://www.thizlinux.com/~anthony/hkscs/Correct-Big5HKSCS-to-Unicode-by-b5.txt +# by Jungshik Shin +# $XFree86: xc/fonts/encodings/large/big5hkscs-0.enc,v 1.2 2003/11/29 01:44:23 dawes Exp $ +SIZE 0xFf 0xFF +FIRSTINDEX 0x80 0x40 +STARTMAPPING unicode +UNDEFINE 0x0000 0xFEFE +0x8140 0x817E 0xEEB8 +0x81A1 0x81FE 0xEEF7 +0x8240 0x827E 0xEF55 +0x82A1 0x82FE 0xEF94 +0x8340 0x837E 0xEFF2 +0x83A1 0x83FE 0xF031 +0x8440 0x847E 0xF08F +0x84A1 0x84FE 0xF0CE +0x8540 0x857E 0xF12C +0x85A1 0x85FE 0xF16B +0x8640 0x867E 0xF1C9 +0x86A1 0x86FE 0xF208 +0x8740 0x877E 0xF266 +0x87A1 0x87FE 0xF2A5 +0x8840 0x8855 0xF303 +0x8856 0x0100 +0x8857 0x00C1 +0x8858 0x01CD +0x8859 0x00C0 +0x885A 0x0112 +0x885B 0x00C9 +0x885C 0x011A +0x885D 0x00C8 +0x885E 0x014C +0x885F 0x00D3 +0x8860 0x01D1 +0x8861 0x00D2 +0x8862 0xF325 +0x8863 0x1EBE +0x8864 0xF327 +0x8865 0x1EC0 +0x8866 0x00CA +0x8867 0x0101 +0x8868 0x00E1 +0x8869 0x01CE +0x886A 0x00E0 +0x886B 0x0251 +0x886C 0x0113 +0x886D 0x00E9 +0x886E 0x011B +0x886F 0x00E8 +0x8870 0x012B +0x8871 0x00ED +0x8872 0x01D0 +0x8873 0x00EC +0x8874 0x014D +0x8875 0x00F3 +0x8876 0x01D2 +0x8877 0x00F2 +0x8878 0x016B +0x8879 0x00FA +0x887A 0x01D4 +0x887B 0x00F9 +0x887C 0x01D6 +0x887D 0x01D8 +0x887E 0x01DA +0x88A1 0x01DC +0x88A2 0x00FC +0x88A3 0xF344 +0x88A4 0x1EBF +0x88A5 0xF346 +0x88A6 0x1EC1 +0x88A7 0x00EA +0x88A8 0x0261 +0x88A9 0x88FE 0xF34A +0x8940 0x8942 0xF3A0 +0x8943 0x650A +0x8944 0x8945 0xF3A4 +0x8946 0x4E3D +0x8947 0x6EDD +0x8948 0x9D4E +0x8949 0x91DF +0x894A 0x894C 0xF3AA +0x894D 0x6491 +0x894E 0x4F1A +0x894F 0x4F28 +0x8950 0x4FA8 +0x8951 0x5156 +0x8952 0x5174 +0x8953 0x519C +0x8954 0x51E4 +0x8955 0x52A1 +0x8956 0x52A8 +0x8957 0x533B +0x8958 0x534E +0x8959 0x53D1 +0x895A 0x53D8 +0x895B 0x56E2 +0x895C 0x58F0 +0x895D 0x5904 +0x895E 0x5907 +0x895F 0x5932 +0x8960 0x5934 +0x8961 0x5B66 +0x8962 0x8963 0x5B9E +0x8964 0x5C9A +0x8965 0x5E86 +0x8966 0x603B +0x8967 0x6589 +0x8968 0x67FE +0x8969 0x6804 +0x896A 0x6865 +0x896B 0x6D4E +0x896C 0x70BC +0x896D 0x7535 +0x896E 0x7EA4 +0x896F 0x7EAC +0x8970 0x7EBA +0x8971 0x7EC7 +0x8972 0x7ECF +0x8973 0x7EDF +0x8974 0x7F06 +0x8975 0x7F37 +0x8976 0x827A +0x8977 0x82CF +0x8978 0x836F +0x8979 0x89C6 +0x897A 0x8BBE +0x897B 0x8BE2 +0x897C 0x897D 0x8F66 +0x897E 0x8F6E +0x89A1 0x7411 +0x89A2 0x7CFC +0x89A3 0x7DCD +0x89A4 0x6946 +0x89A5 0x7AC9 +0x89A6 0x5227 +0x89A7 0x89AA 0xF3E5 +0x89AB 0x918C +0x89AC 0x78B8 +0x89AD 0x915E +0x89AE 0x80BC +0x89AF 0xF3ED +0x89B0 0x8D0B +0x89B1 0x80F6 +0x89B2 0x89B4 0xF3F0 +0x89B5 0x809F +0x89B6 0x9EC7 +0x89B7 0x4CCD +0x89B8 0x9DC9 +0x89B9 0x9E0C +0x89BA 0x4C3E +0x89BB 0x89BC 0xF3F9 +0x89BD 0x9E0A +0x89BE 0xF3FC +0x89BF 0x35C1 +0x89C0 0xF3FE +0x89C1 0x6E9A +0x89C2 0x823E +0x89C3 0x7519 +0x89C4 0xF402 +0x89C5 0x4911 +0x89C6 0x9A6C +0x89C7 0x9A8F +0x89C8 0x9F99 +0x89C9 0x7987 +0x89CA 0x89CD 0xF408 +0x89CE 0x4E24 +0x89CF 0x4E81 +0x89D0 0x4E80 +0x89D1 0x4E87 +0x89D2 0x4EBF +0x89D3 0x4EEB +0x89D4 0x4F37 +0x89D5 0x344C +0x89D6 0x4FBD +0x89D7 0x3E48 +0x89D8 0x5003 +0x89D9 0x5088 +0x89DA 0x347D +0x89DB 0x3493 +0x89DC 0x34A5 +0x89DD 0x5186 +0x89DE 0x5905 +0x89DF 0x51DB +0x89E0 0x51FC +0x89E1 0x5205 +0x89E2 0x4E89 +0x89E3 0x5279 +0x89E4 0x5290 +0x89E5 0x5327 +0x89E6 0x35C7 +0x89E7 0x53A9 +0x89E8 0x3551 +0x89E9 0x53B0 +0x89EA 0x3553 +0x89EB 0x53C2 +0x89EC 0x5423 +0x89ED 0x356D +0x89EE 0x3572 +0x89EF 0x3681 +0x89F0 0x5493 +0x89F1 0x54A3 +0x89F2 0x54B4 +0x89F3 0x54B9 +0x89F4 0x54D0 +0x89F5 0x54EF +0x89F6 0x5518 +0x89F7 0x5523 +0x89F8 0x5528 +0x89F9 0x3598 +0x89FA 0x553F +0x89FB 0x35A5 +0x89FC 0x35BF +0x89FD 0x55D7 +0x89FE 0x35C5 +0x8A40 0xF43D +0x8A41 0x5525 +0x8A42 0x8A45 0xF43F +0x8A46 0x5590 +0x8A47 0xF444 +0x8A48 0x39EC +0x8A49 0xF446 +0x8A4A 0x8E46 +0x8A4B 0x8A4C 0xF448 +0x8A4D 0x4053 +0x8A4E 0xF44B +0x8A4F 0x777A +0x8A50 0xF44D +0x8A51 0x3A34 +0x8A52 0x47D5 +0x8A53 0x8A55 0xF450 +0x8A56 0x64DD +0x8A57 0x8A5A 0xF454 +0x8A5B 0x648D +0x8A5C 0x8E7E +0x8A5D 0x8A66 0xF45A +0x8A67 0x47F4 +0x8A68 0x8A69 0xF465 +0x8A6A 0x9AB2 +0x8A6B 0x3A67 +0x8A6C 0xF469 +0x8A6D 0x3FED +0x8A6E 0x3506 +0x8A6F 0x8A72 0xF46C +0x8A73 0x9D6E +0x8A74 0x9815 +0x8A75 0xF472 +0x8A76 0x43D9 +0x8A77 0xF474 +0x8A78 0x64B4 +0x8A79 0x54E3 +0x8A7A 0x8A7C 0xF477 +0x8A7D 0x39FB +0x8A7E 0xF47B +0x8AA1 0x8AA3 0xF47C +0x8AA4 0x64EA +0x8AA5 0x8AA6 0xF480 +0x8AA7 0x8E68 +0x8AA8 0x8AAB 0xF483 +0x8AAC 0x480B +0x8AAD 0xF488 +0x8AAE 0x3FFA +0x8AAF 0x5873 +0x8AB0 0x8AB6 0xF48B +0x8AB7 0x5579 +0x8AB8 0x40BB +0x8AB9 0x43BA +0x8ABA 0xF495 +0x8ABB 0x4AB4 +0x8ABC 0x8ABD 0xF497 +0x8ABE 0x81AA +0x8ABF 0x98F5 +0x8AC0 0xF49B +0x8AC1 0x6379 +0x8AC2 0x39FE +0x8AC3 0xF49E +0x8AC4 0x8DC0 +0x8AC5 0x56A1 +0x8AC6 0x647C +0x8AC7 0x3E43 +0x8AC8 0x8ACF 0xF4A3 +0x8AD0 0x3992 +0x8AD1 0x3A06 +0x8AD2 0xF4AD +0x8AD3 0x3578 +0x8AD4 0x8AD5 0xF4AF +0x8AD6 0x5652 +0x8AD7 0x8AD9 0xF4B2 +0x8ADA 0x34BC +0x8ADB 0x6C3D +0x8ADC 0x8AE6 0xF4B7 +0x8AE7 0x7F93 +0x8AE8 0x8AEA 0xF4C3 +0x8AEB 0x35FB +0x8AEC 0x8AEF 0xF4C7 +0x8AF0 0x3F93 +0x8AF1 0x8AFA 0xF4CC +0x8AFB 0x3FF9 +0x8AFC 0xF4D7 +0x8AFD 0x6432 +0x8AFE 0xF4D9 +0x8B40 0x8B46 0xF4DA +0x8B47 0x3A18 +0x8B48 0x8B4F 0xF4E2 +0x8B50 0x95AA +0x8B51 0x54CC +0x8B52 0x82C4 +0x8B53 0x55B9 +0x8B54 0x8B55 0xF4EE +0x8B56 0x9C26 +0x8B57 0x9AB6 +0x8B58 0x8B59 0xF4F2 +0x8B5A 0x7140 +0x8B5B 0x816D +0x8B5C 0x80EC +0x8B5D 0x5C1C +0x8B5E 0xF4F8 +0x8B5F 0x8134 +0x8B60 0x3797 +0x8B61 0x535F +0x8B62 0xF4FC +0x8B63 0x91B6 +0x8B64 0x8B67 0xF4FE +0x8B68 0x35DD +0x8B69 0xF503 +0x8B6A 0x3609 +0x8B6B 0xF505 +0x8B6C 0x56AF +0x8B6D 0x8B77 0xF507 +0x8B78 0x5A54 +0x8B79 0x8B7C 0xF513 +0x8B7D 0x579C +0x8B7E 0xF518 +0x8BA1 0x8BA5 0xF519 +0x8BA6 0x3703 +0x8BA7 0x8BAE 0xF51F +0x8BAF 0x5899 +0x8BB0 0x5268 +0x8BB1 0x361A +0x8BB2 0xF52A +0x8BB3 0x7BB2 +0x8BB4 0x5B68 +0x8BB5 0x4800 +0x8BB6 0x4B2C +0x8BB7 0x9F27 +0x8BB8 0x49E7 +0x8BB9 0x9C1F +0x8BBA 0x9B8D +0x8BBB 0x8BBC 0xF533 +0x8BBD 0x55FB +0x8BBE 0x35F2 +0x8BBF 0x5689 +0x8BC0 0x4E28 +0x8BC1 0x5902 +0x8BC2 0x8BC3 0xF53A +0x8BC4 0x9751 +0x8BC5 0xF53D +0x8BC6 0x4E5B +0x8BC7 0x4EBB +0x8BC8 0x353E +0x8BC9 0x5C23 +0x8BCA 0x5F51 +0x8BCB 0x5FC4 +0x8BCC 0x38FA +0x8BCD 0x624C +0x8BCE 0x6535 +0x8BCF 0x6B7A +0x8BD0 0x6C35 +0x8BD1 0x6C3A +0x8BD2 0x706C +0x8BD3 0x722B +0x8BD4 0x4E2C +0x8BD5 0x72AD +0x8BD6 0xF54E +0x8BD7 0x7F52 +0x8BD8 0x793B +0x8BD9 0x7CF9 +0x8BDA 0x7F53 +0x8BDB 0xF553 +0x8BDC 0x34C1 +0x8BDD 0x8BDE 0xF555 +0x8BDF 0x8002 +0x8BE0 0x8080 +0x8BE1 0x8BE2 0xF559 +0x8BE3 0x535D +0x8BE4 0x8864 +0x8BE5 0x89C1 +0x8BE6 0xF55E +0x8BE7 0x8BA0 +0x8BE8 0x8D1D +0x8BE9 0x9485 +0x8BEA 0x9578 +0x8BEB 0x957F +0x8BEC 0x95E8 +0x8BED 0xF565 +0x8BEE 0x97E6 +0x8BEF 0x9875 +0x8BF0 0x98CE +0x8BF1 0x98DE +0x8BF2 0x9963 +0x8BF3 0xF56B +0x8BF4 0x9C7C +0x8BF5 0x9E1F +0x8BF6 0x9EC4 +0x8BF7 0x6B6F +0x8BF8 0xF907 +0x8BF9 0x4E37 +0x8BFA 0xF572 +0x8BFB 0x961D +0x8BFC 0x6237 +0x8BFD 0x94A2 +0x8BFE 0xF576 +0x8C40 0x503B +0x8C41 0x6DFE +0x8C42 0x8C43 0xF579 +0x8C44 0x3DC9 +0x8C45 0x888F +0x8C46 0xF57D +0x8C47 0x7077 +0x8C48 0x5CF5 +0x8C49 0x4B20 +0x8C4A 0xF581 +0x8C4B 0x3559 +0x8C4C 0xF583 +0x8C4D 0x6122 +0x8C4E 0xF585 +0x8C4F 0x8FA7 +0x8C50 0x91F6 +0x8C51 0x7191 +0x8C52 0x6719 +0x8C53 0x73BA +0x8C54 0x8C55 0xF58B +0x8C56 0x3C8B +0x8C57 0xF58E +0x8C58 0x4B10 +0x8C59 0x78E4 +0x8C5A 0x7402 +0x8C5B 0x51AE +0x8C5C 0xF593 +0x8C5D 0x4009 +0x8C5E 0x6A63 +0x8C5F 0xF596 +0x8C60 0x4223 +0x8C61 0x860F +0x8C62 0xF599 +0x8C63 0x7A2A +0x8C64 0x8C65 0xF59B +0x8C66 0x9755 +0x8C67 0x704D +0x8C68 0x5324 +0x8C69 0xF5A0 +0x8C6A 0x93F4 +0x8C6B 0x76D9 +0x8C6C 0x8C6D 0xF5A3 +0x8C6E 0x77DD +0x8C6F 0x4EA3 +0x8C70 0x4FF0 +0x8C71 0x50BC +0x8C72 0x4E2F +0x8C73 0x4F17 +0x8C74 0xF5AB +0x8C75 0x5434 +0x8C76 0x7D8B +0x8C77 0x5892 +0x8C78 0x58D0 +0x8C79 0xF5B0 +0x8C7A 0x5E92 +0x8C7B 0x5E99 +0x8C7C 0x5FC2 +0x8C7D 0xF5B4 +0x8C7E 0x658B +0x8CA1 0xF5B6 +0x8CA2 0x6919 +0x8CA3 0x6A43 +0x8CA4 0xF5B9 +0x8CA5 0x6CFF +0x8CA6 0xF5BB +0x8CA7 0x7200 +0x8CA8 0xF5BD +0x8CA9 0x738C +0x8CAA 0x3EDB +0x8CAB 0xF5C0 +0x8CAC 0x5B15 +0x8CAD 0x74B9 +0x8CAE 0x8B83 +0x8CAF 0x8CB0 0xF5C4 +0x8CB1 0x7A93 +0x8CB2 0x7BEC +0x8CB3 0x7CC3 +0x8CB4 0x7E6C +0x8CB5 0x82F8 +0x8CB6 0x8597 +0x8CB7 0xF5CC +0x8CB8 0x8890 +0x8CB9 0xF5CE +0x8CBA 0x8EB9 +0x8CBB 0xF5D0 +0x8CBC 0x8FCF +0x8CBD 0x855F +0x8CBE 0x99E0 +0x8CBF 0x9221 +0x8CC0 0x8CC2 0xF5D5 +0x8CC3 0x4071 +0x8CC4 0x42A2 +0x8CC5 0x5A1A +0x8CC6 0x8CC8 0xF5DB +0x8CC9 0x9868 +0x8CCA 0x676B +0x8CCB 0x4276 +0x8CCC 0x573D +0x8CCD 0xF5E2 +0x8CCE 0x85D6 +0x8CCF 0xF5E4 +0x8CD0 0x82BF +0x8CD1 0xF5E6 +0x8CD2 0x4C81 +0x8CD3 0xF5E8 +0x8CD4 0x5D7B +0x8CD5 0x8CD8 0xF5EA +0x8CD9 0x5B96 +0x8CDA 0x8CDB 0xF5EF +0x8CDC 0x7E5B +0x8CDD 0x8CFE 0xF5F2 +0x8D40 0x8D5F 0xF614 +0x8D60 0x5D3E +0x8D61 0x5D48 +0x8D62 0x5D56 +0x8D63 0x3DFC +0x8D64 0x380F +0x8D65 0x5DA4 +0x8D66 0x5DB9 +0x8D67 0x3820 +0x8D68 0x3838 +0x8D69 0x5E42 +0x8D6A 0x5EBD +0x8D6B 0x5F25 +0x8D6C 0x5F83 +0x8D6D 0x3908 +0x8D6E 0x3914 +0x8D6F 0x393F +0x8D70 0x394D +0x8D71 0x60D7 +0x8D72 0x613D +0x8D73 0x5CE5 +0x8D74 0x3989 +0x8D75 0x61B7 +0x8D76 0x61B9 +0x8D77 0x61CF +0x8D78 0x39B8 +0x8D79 0x622C +0x8D7A 0x6290 +0x8D7B 0x62E5 +0x8D7C 0x6318 +0x8D7D 0x39F8 +0x8D7E 0x56B1 +0x8DA1 0x3A03 +0x8DA2 0x63E2 +0x8DA3 0x63FB +0x8DA4 0x6407 +0x8DA5 0x645A +0x8DA6 0x3A4B +0x8DA7 0x64C0 +0x8DA8 0x5D15 +0x8DA9 0x5621 +0x8DAA 0x9F9F +0x8DAB 0x3A97 +0x8DAC 0x6586 +0x8DAD 0x3ABD +0x8DAE 0x65FF +0x8DAF 0x6653 +0x8DB0 0x3AF2 +0x8DB1 0x6692 +0x8DB2 0x3B22 +0x8DB3 0x6716 +0x8DB4 0x3B42 +0x8DB5 0x67A4 +0x8DB6 0x6800 +0x8DB7 0x3B58 +0x8DB8 0x684A +0x8DB9 0x6884 +0x8DBA 0x3B72 +0x8DBB 0x3B71 +0x8DBC 0x3B7B +0x8DBD 0x6909 +0x8DBE 0x6943 +0x8DBF 0x725C +0x8DC0 0x6964 +0x8DC1 0x699F +0x8DC2 0x6985 +0x8DC3 0x3BBC +0x8DC4 0x69D6 +0x8DC5 0x3BDD +0x8DC6 0x6A65 +0x8DC7 0x6A74 +0x8DC8 0x6A71 +0x8DC9 0x6A82 +0x8DCA 0x3BEC +0x8DCB 0x6A99 +0x8DCC 0x3BF2 +0x8DCD 0x6AAB +0x8DCE 0x6AB5 +0x8DCF 0x6AD4 +0x8DD0 0x6AF6 +0x8DD1 0x6B81 +0x8DD2 0x6BC1 +0x8DD3 0x6BEA +0x8DD4 0x6C75 +0x8DD5 0x6CAA +0x8DD6 0x3CCB +0x8DD7 0x6D02 +0x8DD8 0x6D06 +0x8DD9 0x6D26 +0x8DDA 0x6D81 +0x8DDB 0x3CEF +0x8DDC 0x6DA4 +0x8DDD 0x6DB1 +0x8DDE 0x6E15 +0x8DDF 0x6E18 +0x8DE0 0x6E29 +0x8DE1 0x6E86 +0x8DE2 0xF694 +0x8DE3 0x6EBB +0x8DE4 0x6EE2 +0x8DE5 0x6EDA +0x8DE6 0x9F7F +0x8DE7 0x8DE8 0x6EE8 +0x8DE9 0x6F24 +0x8DEA 0x6F34 +0x8DEB 0x3D46 +0x8DEC 0xF69E +0x8DED 0x6F81 +0x8DEE 0x6FBE +0x8DEF 0x3D6A +0x8DF0 0x3D75 +0x8DF1 0x71B7 +0x8DF2 0x5C99 +0x8DF3 0x3D8A +0x8DF4 0x702C +0x8DF5 0x3D91 +0x8DF6 0x7050 +0x8DF7 0x7054 +0x8DF8 0x706F +0x8DF9 0x707F +0x8DFA 0x7089 +0x8DFB 0xF6AD +0x8DFC 0x43C1 +0x8DFD 0x35F1 +0x8DFE 0xF6B0 +0x8E40 0xE311 +0x8E41 0x57BE +0x8E42 0xE313 +0x8E43 0x713E +0x8E44 0xE315 +0x8E45 0x364E +0x8E46 0x69A2 +0x8E47 0xE318 +0x8E48 0x5B74 +0x8E49 0x7A49 +0x8E4A 0x8E4B 0xE31B +0x8E4C 0x7A65 +0x8E4D 0x7A7D +0x8E4E 0xE31F +0x8E4F 0x7ABB +0x8E50 0x7AB0 +0x8E51 0x8E52 0x7AC2 +0x8E53 0x71D1 +0x8E54 0xE325 +0x8E55 0x41CA +0x8E56 0x7ADA +0x8E57 0x7ADD +0x8E58 0x7AEA +0x8E59 0x41EF +0x8E5A 0x54B2 +0x8E5B 0xE32C +0x8E5C 0x7B0B +0x8E5D 0x7B55 +0x8E5E 0x7B29 +0x8E5F 0x8E60 0xE330 +0x8E61 0x7BA2 +0x8E62 0x7B6F +0x8E63 0x839C +0x8E64 0x8E65 0xE335 +0x8E66 0x7BD0 +0x8E67 0x8421 +0x8E68 0x7B92 +0x8E69 0x7BB8 +0x8E6A 0xE33B +0x8E6B 0x3DAD +0x8E6C 0xE33D +0x8E6D 0x8492 +0x8E6E 0x7BFA +0x8E6F 0x7C06 +0x8E70 0x7C35 +0x8E71 0xE342 +0x8E72 0x7C44 +0x8E73 0x7C83 +0x8E74 0xE345 +0x8E75 0x7CA6 +0x8E76 0x667D +0x8E77 0xE348 +0x8E78 0x7CC9 +0x8E79 0x7CC7 +0x8E7A 0x7CE6 +0x8E7B 0x7C74 +0x8E7C 0x7CF3 +0x8E7D 0x7CF5 +0x8E7E 0x7CCE +0x8EA1 0x7E67 +0x8EA2 0x451D +0x8EA3 0xE352 +0x8EA4 0x7D5D +0x8EA5 0xE354 +0x8EA6 0x748D +0x8EA7 0x7D89 +0x8EA8 0x7DAB +0x8EA9 0x7135 +0x8EAA 0x7DB3 +0x8EAB 0x7DD2 +0x8EAC 0x8EAD 0xE35B +0x8EAE 0x7DE4 +0x8EAF 0x3D13 +0x8EB0 0x7DF5 +0x8EB1 0xE360 +0x8EB2 0x7DE5 +0x8EB3 0xE362 +0x8EB4 0x7E1D +0x8EB5 0x8EB6 0xE364 +0x8EB7 0x7E6E +0x8EB8 0x7E92 +0x8EB9 0x432B +0x8EBA 0x946C +0x8EBB 0x7E27 +0x8EBC 0x8EBD 0x7F40 +0x8EBE 0x7F47 +0x8EBF 0x7936 +0x8EC0 0xE36F +0x8EC1 0x99E1 +0x8EC2 0x7F97 +0x8EC3 0xE372 +0x8EC4 0x7FA3 +0x8EC5 0x8EC6 0xE374 +0x8EC7 0x455C +0x8EC8 0xE377 +0x8EC9 0x4503 +0x8ECA 0xE379 +0x8ECB 0x7FFA +0x8ECC 0xE37B +0x8ECD 0x8005 +0x8ECE 0x8008 +0x8ECF 0x801D +0x8ED0 0x8028 +0x8ED1 0x802F +0x8ED2 0x8ED3 0xE381 +0x8ED4 0x8ED5 0x803B +0x8ED6 0x8061 +0x8ED7 0xE386 +0x8ED8 0x4989 +0x8ED9 0x8EDB 0xE388 +0x8EDC 0x6725 +0x8EDD 0x80A7 +0x8EDE 0xE38D +0x8EDF 0x8107 +0x8EE0 0x811A +0x8EE1 0x58B0 +0x8EE2 0xE391 +0x8EE3 0x6C7F +0x8EE4 0x8EE5 0xE393 +0x8EE6 0x64E7 +0x8EE7 0xE396 +0x8EE8 0x8218 +0x8EE9 0xE398 +0x8EEA 0x6A53 +0x8EEB 0x8EEC 0xE39A +0x8EED 0x447A +0x8EEE 0x8229 +0x8EEF 0x8EF1 0xE39E +0x8EF2 0x4FF9 +0x8EF3 0xE3A2 +0x8EF4 0x84E2 +0x8EF5 0x8362 +0x8EF6 0x8EFA 0xE3A5 +0x8EFB 0x82AA +0x8EFC 0x691B +0x8EFD 0xE3AC +0x8EFE 0x41DB +0x8F40 0x854B +0x8F41 0x82D0 +0x8F42 0x831A +0x8F43 0x8F44 0xE3B1 +0x8F45 0x36C1 +0x8F46 0x8F47 0xE3B4 +0x8F48 0x827B +0x8F49 0x82E2 +0x8F4A 0x8318 +0x8F4B 0x8F4F 0xE3B9 +0x8F50 0x3DBF +0x8F51 0x831D +0x8F52 0x55EC +0x8F53 0x8385 +0x8F54 0x450B +0x8F55 0xE3C3 +0x8F56 0x83AC +0x8F57 0x83C1 +0x8F58 0x83D3 +0x8F59 0x347E +0x8F5A 0xE3C8 +0x8F5B 0x6A57 +0x8F5C 0x855A +0x8F5D 0x3496 +0x8F5E 0x8F5F 0xE3CC +0x8F60 0x8458 +0x8F61 0xE3CF +0x8F62 0x8471 +0x8F63 0x3DD3 +0x8F64 0x44E4 +0x8F65 0x6AA7 +0x8F66 0x844A +0x8F67 0xE3D5 +0x8F68 0x7958 +0x8F69 0x84A8 +0x8F6A 0x8F6C 0xE3D8 +0x8F6D 0x84DE +0x8F6E 0x840F +0x8F6F 0x8391 +0x8F70 0x44A0 +0x8F71 0x8493 +0x8F72 0x84E4 +0x8F73 0xE3E1 +0x8F74 0x4240 +0x8F75 0xE3E3 +0x8F76 0x4543 +0x8F77 0x8534 +0x8F78 0x5AF2 +0x8F79 0xE3E7 +0x8F7A 0x4527 +0x8F7B 0x8573 +0x8F7C 0x4516 +0x8F7D 0x67BF +0x8F7E 0x8616 +0x8FA1 0x8FA2 0xE3ED +0x8FA3 0x85C1 +0x8FA4 0xE3F0 +0x8FA5 0x8602 +0x8FA6 0x8FA8 0xE3F2 +0x8FA9 0x456A +0x8FAA 0x8628 +0x8FAB 0x3648 +0x8FAC 0xE3F8 +0x8FAD 0x53F7 +0x8FAE 0xE3FA +0x8FAF 0x867E +0x8FB0 0x8771 +0x8FB1 0xE3FD +0x8FB2 0x87EE +0x8FB3 0xE3FF +0x8FB4 0x87B1 +0x8FB5 0x87DA +0x8FB6 0x880F +0x8FB7 0x5661 +0x8FB8 0x866C +0x8FB9 0x6856 +0x8FBA 0x460F +0x8FBB 0x8FBC 0x8845 +0x8FBD 0x8FBF 0xE409 +0x8FC0 0x885E +0x8FC1 0x889C +0x8FC2 0x465B +0x8FC3 0x8FC4 0x88B4 +0x8FC5 0x63C1 +0x8FC6 0x88C5 +0x8FC7 0x7777 +0x8FC8 0xE414 +0x8FC9 0x8987 +0x8FCA 0x898A +0x8FCB 0x89A6 +0x8FCC 0x89A9 +0x8FCD 0x89A7 +0x8FCE 0x89BC +0x8FCF 0xE41B +0x8FD0 0x89E7 +0x8FD1 0x8FD2 0xE41D +0x8FD3 0x8A9C +0x8FD4 0x7793 +0x8FD5 0x91FE +0x8FD6 0x8A90 +0x8FD7 0xE423 +0x8FD8 0x7AE9 +0x8FD9 0x8FDA 0xE425 +0x8FDB 0x4713 +0x8FDC 0xE428 +0x8FDD 0x717C +0x8FDE 0x8B0C +0x8FDF 0x8B1F +0x8FE0 0x8FE1 0xE42C +0x8FE2 0x8B3F +0x8FE3 0x8FE4 0x8B4C +0x8FE5 0x8AA9 +0x8FE6 0xE432 +0x8FE7 0x8B90 +0x8FE8 0x8B9B +0x8FE9 0x8AAF +0x8FEA 0xE436 +0x8FEB 0x4615 +0x8FEC 0x884F +0x8FED 0x8C9B +0x8FEE 0x8FF0 0xE43A +0x8FF1 0x3725 +0x8FF2 0xE43E +0x8FF3 0x8CD6 +0x8FF4 0x8FF5 0xE440 +0x8FF6 0x8D12 +0x8FF7 0x8D03 +0x8FF8 0xE444 +0x8FF9 0x8CDB +0x8FFA 0x705C +0x8FFB 0x8D11 +0x8FFC 0xE448 +0x8FFD 0x3ED0 +0x8FFE 0x8D77 +0x9040 0x8DA9 +0x9041 0x9043 0xE44C +0x9044 0x3B7C +0x9045 0x9046 0xE450 +0x9047 0x7AE7 +0x9048 0x8EAD +0x9049 0x8EB6 +0x904A 0x8EC3 +0x904B 0x92D4 +0x904C 0x8F19 +0x904D 0x8F2D +0x904E 0x904F 0xE459 +0x9050 0x8FA5 +0x9051 0x9303 +0x9052 0x9053 0xE45D +0x9054 0x8FB3 +0x9055 0x492A +0x9056 0x9058 0xE461 +0x9059 0x5EF8 +0x905A 0xE465 +0x905B 0x8FF9 +0x905C 0x905F 0xE467 +0x9060 0x3980 +0x9061 0xE46C +0x9062 0x9037 +0x9063 0x9064 0xE46E +0x9065 0x9061 +0x9066 0x9067 0xE471 +0x9068 0x90A8 +0x9069 0xE474 +0x906A 0x90C4 +0x906B 0xE476 +0x906C 0x90AE +0x906D 0x90FD +0x906E 0x9167 +0x906F 0x3AF0 +0x9070 0x91A9 +0x9071 0x91C4 +0x9072 0x7CAC +0x9073 0x9074 0xE47E +0x9075 0x920E +0x9076 0x6C9F +0x9077 0x9241 +0x9078 0x9262 +0x9079 0xE484 +0x907A 0x92B9 +0x907B 0x907E 0xE486 +0x90A1 0xE48A +0x90A2 0x932C +0x90A3 0x936B +0x90A4 0x90A5 0xE48D +0x90A6 0x708F +0x90A7 0x5AC3 +0x90A8 0x90A9 0xE491 +0x90AA 0x4965 +0x90AB 0x9244 +0x90AC 0x90AE 0xE495 +0x90AF 0x9373 +0x90B0 0x945B +0x90B1 0x8EBC +0x90B2 0x9585 +0x90B3 0x95A6 +0x90B4 0x9426 +0x90B5 0x95A0 +0x90B6 0x6FF6 +0x90B7 0x42B9 +0x90B8 0x90BB 0xE4A1 +0x90BC 0x49DF +0x90BD 0x6C1C +0x90BE 0x967B +0x90BF 0x9696 +0x90C0 0x416C +0x90C1 0x96A3 +0x90C2 0xE4AB +0x90C3 0x61DA +0x90C4 0x96B6 +0x90C5 0x78F5 +0x90C6 0xE4AF +0x90C7 0x96BD +0x90C8 0x53CC +0x90C9 0x49A1 +0x90CA 0x90D1 0xE4B3 +0x90D2 0x9731 +0x90D3 0x8642 +0x90D4 0x9736 +0x90D5 0x4A0F +0x90D6 0x453D +0x90D7 0x4585 +0x90D8 0xE4C1 +0x90D9 0x7075 +0x90DA 0x5B41 +0x90DB 0x971B +0x90DC 0x975C +0x90DD 0xE4C6 +0x90DE 0x9757 +0x90DF 0x5B4A +0x90E0 0xE4C9 +0x90E1 0x975F +0x90E2 0x9425 +0x90E3 0x50D0 +0x90E4 0x90E5 0xE4CD +0x90E6 0x9789 +0x90E7 0x979F +0x90E8 0x97B1 +0x90E9 0x97BE +0x90EA 0x97C0 +0x90EB 0x97D2 +0x90EC 0x97E0 +0x90ED 0xE4D6 +0x90EE 0x97EE +0x90EF 0x741C +0x90F0 0xE4D9 +0x90F1 0x97FF +0x90F2 0x97F5 +0x90F3 0x90F4 0xE4DC +0x90F5 0x4AD1 +0x90F6 0x9834 +0x90F7 0x9833 +0x90F8 0x984B +0x90F9 0x9866 +0x90FA 0x3B0E +0x90FB 0xE4E4 +0x90FC 0x3D51 +0x90FD 0x90FE 0xE4E6 +0x9140 0xE4E8 +0x9141 0x98CA +0x9142 0x98B7 +0x9143 0x98C8 +0x9144 0x98C7 +0x9145 0x4AFF +0x9146 0x9147 0xE4EE +0x9148 0x55B0 +0x9149 0x98E1 +0x914A 0x98E6 +0x914B 0x98EC +0x914C 0x9378 +0x914D 0x9939 +0x914E 0xE4F6 +0x914F 0x4B72 +0x9150 0x9151 0xE4F8 +0x9152 0x99F5 +0x9153 0x9A0C +0x9154 0x9A3B +0x9155 0x9A10 +0x9156 0x9A58 +0x9157 0xE4FF +0x9158 0x36C4 +0x9159 0x915A 0xE501 +0x915B 0x9AE0 +0x915C 0x9AE2 +0x915D 0xE505 +0x915E 0x9AF4 +0x915F 0x4C0E +0x9160 0x9B14 +0x9161 0x9B2D +0x9162 0xE50A +0x9163 0x5034 +0x9164 0x9B34 +0x9165 0xE50D +0x9166 0x38C3 +0x9167 0xE50F +0x9168 0x9B50 +0x9169 0x9B40 +0x916A 0xE512 +0x916B 0x5A45 +0x916C 0xE514 +0x916D 0x9B8E +0x916E 0xE516 +0x916F 0x9C02 +0x9170 0x9BFF +0x9171 0x9C0C +0x9172 0xE51A +0x9173 0x9DD4 +0x9174 0x9179 0xE51C +0x917A 0x9D7E +0x917B 0x9D83 +0x917C 0xE524 +0x917D 0x9E0E +0x917E 0x6888 +0x91A1 0x9DC4 +0x91A2 0x91A6 0xE528 +0x91A7 0x9D39 +0x91A8 0x91A9 0xE52E +0x91AA 0x9E90 +0x91AB 0x9E95 +0x91AC 0x9E9E +0x91AD 0x9EA2 +0x91AE 0x4D34 +0x91AF 0x9EAA +0x91B0 0x9EAF +0x91B1 0xE537 +0x91B2 0x9EC1 +0x91B3 0x3B60 +0x91B4 0x39E5 +0x91B5 0x3D1D +0x91B6 0x4F32 +0x91B7 0x37BE +0x91B8 0xE53E +0x91B9 0x9F02 +0x91BA 0x9F08 +0x91BB 0x4B96 +0x91BC 0x9424 +0x91BD 0xE543 +0x91BE 0x9F17 +0x91BF 0x9F16 +0x91C0 0x9F39 +0x91C1 0x569F +0x91C2 0x568A +0x91C3 0x9F45 +0x91C4 0x99B8 +0x91C5 0xE54B +0x91C6 0x97F2 +0x91C7 0x847F +0x91C8 0x9F62 +0x91C9 0x9F69 +0x91CA 0x7ADC +0x91CB 0x9F8E +0x91CC 0x7216 +0x91CD 0x4BBE +0x91CE 0x91CF 0xE554 +0x91D0 0x7177 +0x91D1 0x91D3 0xE557 +0x91D4 0x739E +0x91D5 0x91D6 0xE55B +0x91D7 0x799F +0x91D8 0x91D9 0xE55E +0x91DA 0x9369 +0x91DB 0x93F3 +0x91DC 0xE562 +0x91DD 0x92EC +0x91DE 0x9381 +0x91DF 0x93CB +0x91E0 0x91E1 0xE566 +0x91E2 0x7217 +0x91E3 0x3EEB +0x91E4 0x7772 +0x91E5 0x7A43 +0x91E6 0x70D0 +0x91E7 0x91E8 0xE56D +0x91E9 0x717E +0x91EA 0xE570 +0x91EB 0x70A3 +0x91EC 0x91ED 0xE572 +0x91EE 0x3EC7 +0x91EF 0x91F1 0xE575 +0x91F2 0x3722 +0x91F3 0x91F4 0xE579 +0x91F5 0x36E1 +0x91F6 0x91F8 0xE57C +0x91F9 0x3723 +0x91FA 0xE580 +0x91FB 0x575B +0x91FC 0x91FE 0xE582 +0x9240 0x9241 0xE585 +0x9242 0x8503 +0x9243 0xE588 +0x9244 0x8503 +0x9245 0x8455 +0x9246 0x924B 0xE58B +0x924C 0x44F4 +0x924D 0x924F 0xE592 +0x9250 0x67F9 +0x9251 0x3733 +0x9252 0x3C15 +0x9253 0x3DE7 +0x9254 0x586C +0x9255 0xE59A +0x9256 0x6810 +0x9257 0x4057 +0x9258 0x925C 0xE59D +0x925D 0x54CB +0x925E 0x569E +0x925F 0xE5A4 +0x9260 0x5692 +0x9261 0x9263 0xE5A6 +0x9264 0x93C6 +0x9265 0xE5AA +0x9266 0x939C +0x9267 0x4EF8 +0x9268 0x512B +0x9269 0x3819 +0x926A 0xE5AF +0x926B 0x4EBC +0x926C 0x926D 0xE5B1 +0x926E 0x4F4B +0x926F 0x4F8A +0x9270 0xE5B5 +0x9271 0x5A68 +0x9272 0x9273 0xE5B7 +0x9274 0x3999 +0x9275 0x9276 0xE5BA +0x9277 0x3435 +0x9278 0x4F29 +0x9279 0x927B 0xE5BE +0x927C 0x8ADA +0x927D 0xE5C2 +0x927E 0x4E98 +0x92A1 0x50CD +0x92A2 0x510D +0x92A3 0x4FA2 +0x92A4 0x4F03 +0x92A5 0x92A6 0xE5C8 +0x92A7 0x4F42 +0x92A8 0x502E +0x92A9 0x506C +0x92AA 0x5081 +0x92AB 0x4FCC +0x92AC 0x4FE5 +0x92AD 0x5058 +0x92AE 0x50FC +0x92AF 0x5159 +0x92B0 0x515B +0x92B1 0x92B2 0x515D +0x92B3 0x6E76 +0x92B4 0x92B6 0xE5D7 +0x92B7 0x6D72 +0x92B8 0x92B9 0xE5DB +0x92BA 0x51A8 +0x92BB 0x51C3 +0x92BC 0xE5DF +0x92BD 0x44DD +0x92BE 0x92C0 0xE5E1 +0x92C1 0x8D7A +0x92C2 0x92C3 0xE5E5 +0x92C4 0x5259 +0x92C5 0x52A4 +0x92C6 0xE5E9 +0x92C7 0x52E1 +0x92C8 0x936E +0x92C9 0x467A +0x92CA 0x718C +0x92CB 0x92CE 0xE5EE +0x92CF 0x69D1 +0x92D0 0xE5F3 +0x92D1 0x7479 +0x92D2 0x3EDE +0x92D3 0x7499 +0x92D4 0x7414 +0x92D5 0x7456 +0x92D6 0x7398 +0x92D7 0x4B8E +0x92D8 0x92D9 0xE5FB +0x92DA 0x53D0 +0x92DB 0x3584 +0x92DC 0x720F +0x92DD 0xE600 +0x92DE 0x55B4 +0x92DF 0xE602 +0x92E0 0x54CD +0x92E1 0xE604 +0x92E2 0x571D +0x92E3 0x925D +0x92E4 0x96F4 +0x92E5 0x9366 +0x92E6 0x57DD +0x92E7 0x578D +0x92E8 0x577F +0x92E9 0x363E +0x92EA 0x58CB +0x92EB 0x5A99 +0x92EC 0x92EF 0xE60F +0x92F0 0x5A2C +0x92F1 0x59B8 +0x92F2 0x928F +0x92F3 0x5A7E +0x92F4 0x5ACF +0x92F5 0x5A12 +0x92F6 0x92F9 0xE619 +0x92FA 0x36F5 +0x92FB 0x6D05 +0x92FC 0x7443 +0x92FD 0x5A21 +0x92FE 0xE621 +0x9340 0x5A81 +0x9341 0x9342 0xE623 +0x9343 0x93E0 +0x9344 0x748C +0x9345 0xE627 +0x9346 0x7105 +0x9347 0x4972 +0x9348 0x9408 +0x9349 0xE62B +0x934A 0x93BD +0x934B 0x37A0 +0x934C 0x5C1E +0x934D 0x5C9E +0x934E 0x5E5E +0x934F 0x5E48 +0x9350 0x9352 0xE632 +0x9353 0x5ECD +0x9354 0x5B4F +0x9355 0x9356 0xE637 +0x9357 0x3701 +0x9358 0xE63A +0x9359 0x36DD +0x935A 0xE63C +0x935B 0x36D3 +0x935C 0x812A +0x935D 0x9360 0xE63F +0x9361 0x5F0C +0x9362 0x5F0E +0x9363 0x9364 0xE645 +0x9365 0x5A6B +0x9366 0xE648 +0x9367 0x5B44 +0x9368 0x8614 +0x9369 0xE64B +0x936A 0x8860 +0x936B 0x607E +0x936C 0x936D 0xE64E +0x936E 0x5FDB +0x936F 0x3EB8 +0x9370 0x9373 0xE652 +0x9374 0x61C0 +0x9375 0x9377 0xE657 +0x9378 0x6199 +0x9379 0x6198 +0x937A 0x6075 +0x937B 0x937E 0xE65D +0x93A1 0x6471 +0x93A2 0x93A3 0xE662 +0x93A4 0x3A29 +0x93A5 0x93A8 0xE665 +0x93A9 0x6337 +0x93AA 0xE66A +0x93AB 0x64B6 +0x93AC 0x6331 +0x93AD 0x63D1 +0x93AE 0x93AF 0xE66E +0x93B0 0x62A4 +0x93B1 0xE671 +0x93B2 0x643B +0x93B3 0x656B +0x93B4 0x6972 +0x93B5 0x3BF4 +0x93B6 0x93B9 0xE676 +0x93BA 0x550D +0x93BB 0x93BD 0xE67B +0x93BE 0x66CE +0x93BF 0x93C0 0xE67F +0x93C1 0x3AE0 +0x93C2 0x4190 +0x93C3 0x93C8 0xE683 +0x93C9 0x78EE +0x93CA 0x93CC 0xE68A +0x93CD 0x3464 +0x93CE 0x93D0 0xE68E +0x93D1 0x668E +0x93D2 0xE692 +0x93D3 0x666B +0x93D4 0x4B93 +0x93D5 0x6630 +0x93D6 0x93D7 0xE696 +0x93D8 0x6663 +0x93D9 0x93DA 0xE699 +0x93DB 0x661E +0x93DC 0xE69C +0x93DD 0x38D1 +0x93DE 0x93DF 0xE69E +0x93E0 0x3B99 +0x93E1 0x93E2 0xE6A1 +0x93E3 0x74D0 +0x93E4 0x3B96 +0x93E5 0x678F +0x93E6 0xE6A6 +0x93E7 0x68B6 +0x93E8 0x681E +0x93E9 0x3BC4 +0x93EA 0x6ABE +0x93EB 0x3863 +0x93EC 0x93ED 0xE6AC +0x93EE 0x6A33 +0x93EF 0x6A52 +0x93F0 0x6AC9 +0x93F1 0x6B05 +0x93F2 0xE6B2 +0x93F3 0x6511 +0x93F4 0x6898 +0x93F5 0x6A4C +0x93F6 0x3BD7 +0x93F7 0x6A7A +0x93F8 0x6B57 +0x93F9 0x93FA 0xE6B9 +0x93FB 0x93A0 +0x93FC 0x92F2 +0x93FD 0x93FE 0xE6BD +0x9440 0x9289 +0x9441 0x9442 0xE6C0 +0x9443 0x9467 +0x9444 0x6DA5 +0x9445 0x6F0B +0x9446 0xE6C5 +0x9447 0x6D67 +0x9448 0xE6C7 +0x9449 0x3D8F +0x944A 0x6E04 +0x944B 0xE6CA +0x944C 0x5A3D +0x944D 0x6E0A +0x944E 0x5847 +0x944F 0x6D24 +0x9450 0x7842 +0x9451 0x713B +0x9452 0x9453 0xE6D1 +0x9454 0x70F1 +0x9455 0x7250 +0x9456 0x7287 +0x9457 0x7294 +0x9458 0x9459 0xE6D7 +0x945A 0x5179 +0x945B 0x945C 0xE6DA +0x945D 0x747A +0x945E 0x9462 0xE6DD +0x9463 0x3F06 +0x9464 0x3EB1 +0x9465 0x9467 0xE6E4 +0x9468 0x60A7 +0x9469 0x3EF3 +0x946A 0x74CC +0x946B 0x743C +0x946C 0x9387 +0x946D 0x7437 +0x946E 0x449F +0x946F 0xE6EE +0x9470 0x4551 +0x9471 0x7583 +0x9472 0x3F63 +0x9473 0x9474 0xE6F2 +0x9475 0x3F58 +0x9476 0x7555 +0x9477 0x7673 +0x9478 0xE6F7 +0x9479 0x3B19 +0x947A 0x7468 +0x947B 0x947D 0xE6FA +0x947E 0x3AFB +0x94A1 0x3DCD +0x94A2 0xE6FF +0x94A3 0x3EFF +0x94A4 0x94A5 0xE701 +0x94A6 0x91FA +0x94A7 0x5732 +0x94A8 0x9342 +0x94A9 0x94AA 0xE706 +0x94AB 0x50DF +0x94AC 0x94AD 0xE709 +0x94AE 0x7778 +0x94AF 0xE70C +0x94B0 0x94B1 0x770E +0x94B2 0x777B +0x94B3 0x94B4 0xE710 +0x94B5 0x3A5E +0x94B6 0xE713 +0x94B7 0x7438 +0x94B8 0x749B +0x94B9 0x3EBF +0x94BA 0x94BB 0xE717 +0x94BC 0x40C8 +0x94BD 0x94BE 0xE71A +0x94BF 0x9307 +0x94C0 0xE71D +0x94C1 0x781E +0x94C2 0x788D +0x94C3 0x7888 +0x94C4 0x78D2 +0x94C5 0x73D0 +0x94C6 0x7959 +0x94C7 0x94C8 0xE724 +0x94C9 0x410E +0x94CA 0x799B +0x94CB 0x8496 +0x94CC 0x79A5 +0x94CD 0x6A2D +0x94CE 0xE72B +0x94CF 0x7A3A +0x94D0 0x79F4 +0x94D1 0x416E +0x94D2 0xE72F +0x94D3 0x4132 +0x94D4 0x9235 +0x94D5 0x79F1 +0x94D6 0x94DA 0xE733 +0x94DB 0x3597 +0x94DC 0x556B +0x94DD 0x3570 +0x94DE 0x36AA +0x94DF 0x94E0 0xE73C +0x94E1 0x7AE2 +0x94E2 0x5A59 +0x94E3 0x94E5 0xE740 +0x94E6 0x5A0D +0x94E7 0xE744 +0x94E8 0x78F0 +0x94E9 0x5A2A +0x94EA 0xE747 +0x94EB 0x7AFE +0x94EC 0x41F9 +0x94ED 0x7C5D +0x94EE 0x7C6D +0x94EF 0x4211 +0x94F0 0x94F2 0xE74D +0x94F3 0x7CCD +0x94F4 0x94F5 0xE751 +0x94F6 0x7C8E +0x94F7 0x7C7C +0x94F8 0x7CAE +0x94F9 0x6AB2 +0x94FA 0x7DDC +0x94FB 0x7E07 +0x94FC 0x7DD3 +0x94FD 0x7F4E +0x94FE 0xE75B +0x9540 0x9541 0xE75C +0x9542 0x7D97 +0x9543 0xE75F +0x9544 0x426A +0x9545 0x9546 0xE761 +0x9547 0x67D6 +0x9548 0x9549 0xE764 +0x954A 0x57C4 +0x954B 0x954D 0xE767 +0x954E 0x7FDD +0x954F 0x7B27 +0x9550 0x9552 0xE76C +0x9553 0x7B0C +0x9554 0xE770 +0x9555 0x99E6 +0x9556 0x8645 +0x9557 0x9A63 +0x9558 0x6A1C +0x9559 0xE775 +0x955A 0x39E2 +0x955B 0x955C 0xE777 +0x955D 0x9A1F +0x955E 0xE77A +0x955F 0x8480 +0x9560 0x9561 0xE77C +0x9562 0x44EA +0x9563 0x8137 +0x9564 0x4402 +0x9565 0x80C6 +0x9566 0x8109 +0x9567 0x8142 +0x9568 0xE784 +0x9569 0x98C3 +0x956A 0xE786 +0x956B 0x8262 +0x956C 0x8265 +0x956D 0xE789 +0x956E 0x8453 +0x956F 0xE78B +0x9570 0x8610 +0x9571 0xE78D +0x9572 0x5A86 +0x9573 0x417F +0x9574 0xE790 +0x9575 0x5B2B +0x9576 0xE792 +0x9577 0x5AE4 +0x9578 0xE794 +0x9579 0x86A0 +0x957A 0x957B 0xE796 +0x957C 0x882D +0x957D 0xE799 +0x957E 0x5A02 +0x95A1 0x886E +0x95A2 0x4F45 +0x95A3 0x8887 +0x95A4 0x88BF +0x95A5 0x88E6 +0x95A6 0x8965 +0x95A7 0x894D +0x95A8 0xE7A2 +0x95A9 0x8954 +0x95AA 0x95AF 0xE7A4 +0x95B0 0x3EAD +0x95B1 0x84A3 +0x95B2 0x46F5 +0x95B3 0x46CF +0x95B4 0x37F2 +0x95B5 0x8A3D +0x95B6 0x8A1C +0x95B7 0xE7B1 +0x95B8 0x5F4D +0x95B9 0x922B +0x95BA 0xE7B4 +0x95BB 0x65D4 +0x95BC 0x7129 +0x95BD 0x70C4 +0x95BE 0xE7B8 +0x95BF 0x9D6D +0x95C0 0x8C9F +0x95C1 0x8CE9 +0x95C2 0xE7BC +0x95C3 0x599A +0x95C4 0x77C3 +0x95C5 0x59F0 +0x95C6 0x436E +0x95C7 0x36D4 +0x95C8 0x8E2A +0x95C9 0x8EA7 +0x95CA 0xE7C4 +0x95CB 0x8F30 +0x95CC 0x8F4A +0x95CD 0x42F4 +0x95CE 0x6C58 +0x95CF 0x6FBB +0x95D0 0xE7CA +0x95D1 0x489B +0x95D2 0x6F79 +0x95D3 0x6E8B +0x95D4 0xE7CE +0x95D5 0x9BE9 +0x95D6 0x36B5 +0x95D7 0xE7D1 +0x95D8 0x90BB +0x95D9 0x9097 +0x95DA 0x5571 +0x95DB 0x4906 +0x95DC 0x91BB +0x95DD 0x9404 +0x95DE 0xE7D8 +0x95DF 0x4062 +0x95E0 0xE7DA +0x95E1 0x9427 +0x95E2 0x95E3 0xE7DC +0x95E4 0x84E5 +0x95E5 0x8A2B +0x95E6 0x9599 +0x95E7 0x95A7 +0x95E8 0x9597 +0x95E9 0x9596 +0x95EA 0xE7E4 +0x95EB 0x7445 +0x95EC 0x3EC2 +0x95ED 0x95EF 0xE7E7 +0x95F0 0x3EE7 +0x95F1 0xE7EB +0x95F2 0x968F +0x95F3 0x95F5 0xE7ED +0x95F6 0x3ECC +0x95F7 0x95F9 0xE7F1 +0x95FA 0x7412 +0x95FB 0x746B +0x95FC 0x3EFC +0x95FD 0x9741 +0x95FE 0xE7F8 +0x9640 0x6847 +0x9641 0x4A1D +0x9642 0x9643 0xE7FB +0x9644 0x975D +0x9645 0x9368 +0x9646 0x9649 0xE7FF +0x964A 0x92BA +0x964B 0x5B11 +0x964C 0x8B69 +0x964D 0x493C +0x964E 0x73F9 +0x964F 0xE808 +0x9650 0x979B +0x9651 0x9771 +0x9652 0x9938 +0x9653 0xE80C +0x9654 0x5DC1 +0x9655 0x9656 0xE80E +0x9657 0x981F +0x9658 0xE811 +0x9659 0x92F6 +0x965A 0xE813 +0x965B 0x91E5 +0x965C 0x44C0 +0x965D 0x965F 0xE816 +0x9660 0x98DC +0x9661 0xE81A +0x9662 0x3F00 +0x9663 0x922A +0x9664 0x4925 +0x9665 0x8414 +0x9666 0x993B +0x9667 0x994D +0x9668 0xE821 +0x9669 0x3DFD +0x966A 0x999B +0x966B 0x4B6F +0x966C 0x99AA +0x966D 0x9A5C +0x966E 0x966F 0xE827 +0x9670 0x6A8F +0x9671 0x9A21 +0x9672 0x5AFE +0x9673 0x9A2F +0x9674 0xE82D +0x9675 0x4B90 +0x9676 0xE82F +0x9677 0x99BC +0x9678 0x4BBD +0x9679 0x4B97 +0x967A 0x937D +0x967B 0x5872 +0x967C 0xE835 +0x967D 0x5822 +0x967E 0xE837 +0x96A1 0xE838 +0x96A2 0x7844 +0x96A3 0x96A4 0xE83A +0x96A5 0x68C5 +0x96A6 0x3D7D +0x96A7 0x9458 +0x96A8 0x3927 +0x96A9 0x6150 +0x96AA 0x96AB 0xE841 +0x96AC 0x6107 +0x96AD 0x9C4F +0x96AE 0x9C53 +0x96AF 0x9C7B +0x96B0 0x9C35 +0x96B1 0x9C10 +0x96B2 0x9B7F +0x96B3 0x9BCF +0x96B4 0xE84B +0x96B5 0x9B9F +0x96B6 0x96B7 0xE84D +0x96B8 0x9D21 +0x96B9 0x4CAE +0x96BA 0xE851 +0x96BB 0x9E18 +0x96BC 0x4CB0 +0x96BD 0x9D0C +0x96BE 0x96C1 0xE855 +0x96C2 0x9DA5 +0x96C3 0x84BD +0x96C4 0x96C6 0xE85B +0x96C7 0x85FC +0x96C8 0x4533 +0x96C9 0x96CB 0xE860 +0x96CC 0x8420 +0x96CD 0x85EE +0x96CE 0x96D0 0xE865 +0x96D1 0x79E2 +0x96D2 0x96D3 0xE869 +0x96D4 0x492D +0x96D5 0xE86C +0x96D6 0x3D62 +0x96D7 0x93DB +0x96D8 0x92BE +0x96D9 0x9348 +0x96DA 0xE871 +0x96DB 0x78B9 +0x96DC 0x9277 +0x96DD 0x944D +0x96DE 0x4FE4 +0x96DF 0x3440 +0x96E0 0x9064 +0x96E1 0xE878 +0x96E2 0x783D +0x96E3 0x7854 +0x96E4 0x78B6 +0x96E5 0x784B +0x96E6 0x96E8 0xE87D +0x96E9 0x369A +0x96EA 0x4F72 +0x96EB 0x6FDA +0x96EC 0x6FD9 +0x96ED 0x701E +0x96EE 0x701E +0x96EF 0x5414 +0x96F0 0xE887 +0x96F1 0x57BB +0x96F2 0x58F3 +0x96F3 0x578A +0x96F4 0x9D16 +0x96F5 0x57D7 +0x96F6 0x7134 +0x96F7 0x34AF +0x96F8 0xE88F +0x96F9 0x71EB +0x96FA 0x96FB 0xE891 +0x96FC 0x5B28 +0x96FD 0x96FE 0xE894 +0x9740 0x610C +0x9741 0x5ACE +0x9742 0x5A0B +0x9743 0x42BC +0x9744 0xE89A +0x9745 0x372C +0x9746 0x4B7B +0x9747 0xE89D +0x9748 0x93BB +0x9749 0x93B8 +0x974A 0x974B 0xE8A0 +0x974C 0x8472 +0x974D 0x9751 0xE8A3 +0x9752 0x5994 +0x9753 0x9754 0xE8A9 +0x9755 0x7DA8 +0x9756 0x975A 0xE8AC +0x975B 0x92E5 +0x975C 0x73E2 +0x975D 0x3EE9 +0x975E 0x74B4 +0x975F 0x9760 0xE8B5 +0x9761 0x3EE1 +0x9762 0xE8B8 +0x9763 0x6AD8 +0x9764 0x73F3 +0x9765 0x73FB +0x9766 0x3ED6 +0x9767 0x976D 0xE8BD +0x976E 0x7448 +0x976F 0xE8C5 +0x9770 0x70A5 +0x9771 0xE8C7 +0x9772 0x9284 +0x9773 0x73E6 +0x9774 0x935F +0x9775 0xE8CB +0x9776 0x9331 +0x9777 0x9778 0xE8CD +0x9779 0x9386 +0x977A 0x977B 0xE8D0 +0x977C 0x4935 +0x977D 0xE8D3 +0x977E 0x716B +0x97A1 0x97A2 0xE8D5 +0x97A3 0x56A4 +0x97A4 0x97A6 0xE8D8 +0x97A7 0x5502 +0x97A8 0x79C4 +0x97A9 0xE8DD +0x97AA 0x7DFE +0x97AB 0x97AD 0xE8DF +0x97AE 0x452E +0x97AF 0x9401 +0x97B0 0x370A +0x97B1 0x97B2 0xE8E5 +0x97B3 0x59B0 +0x97B4 0x97B6 0xE8E8 +0x97B7 0x5AA1 +0x97B8 0x36E2 +0x97B9 0xE8ED +0x97BA 0x36B0 +0x97BB 0x925F +0x97BC 0x5A79 +0x97BD 0x97BE 0xE8F1 +0x97BF 0x9374 +0x97C0 0x3CCD +0x97C1 0xE8F5 +0x97C2 0x4A96 +0x97C3 0x398A +0x97C4 0x50F4 +0x97C5 0x3D69 +0x97C6 0x3D4C +0x97C7 0xE8FB +0x97C8 0x7175 +0x97C9 0x42FB +0x97CA 0xE8FE +0x97CB 0x6E0F +0x97CC 0xE900 +0x97CD 0x44EB +0x97CE 0x6D57 +0x97CF 0xE903 +0x97D0 0x7067 +0x97D1 0x6CAF +0x97D2 0x3CD6 +0x97D3 0x97D4 0xE907 +0x97D5 0x6E02 +0x97D6 0x6F0C +0x97D7 0x3D6F +0x97D8 0xE90C +0x97D9 0x7551 +0x97DA 0x36BC +0x97DB 0x34C8 +0x97DC 0x4680 +0x97DD 0x3EDA +0x97DE 0x4871 +0x97DF 0x59C4 +0x97E0 0x926E +0x97E1 0x493E +0x97E2 0x8F41 +0x97E3 0x97E4 0xE917 +0x97E5 0x5812 +0x97E6 0x57C8 +0x97E7 0x36D6 +0x97E8 0xE91C +0x97E9 0x70FE +0x97EA 0x97EE 0xE91E +0x97EF 0x68B9 +0x97F0 0x6967 +0x97F1 0x97F8 0xE925 +0x97F9 0x6A1A +0x97FA 0x97FB 0xE92E +0x97FC 0x843E +0x97FD 0x44DF +0x97FE 0x44CE +0x9840 0x9843 0xE933 +0x9844 0x6F17 +0x9845 0xE938 +0x9846 0x833D +0x9847 0xE93A +0x9848 0x83ED +0x9849 0x984B 0xE93C +0x984C 0x5989 +0x984D 0x5A82 +0x984E 0xE941 +0x984F 0x5A61 +0x9850 0x5A71 +0x9851 0x9852 0xE944 +0x9853 0x372D +0x9854 0x59EF +0x9855 0xE948 +0x9856 0x36C7 +0x9857 0x718E +0x9858 0x9390 +0x9859 0x669A +0x985A 0xE94D +0x985B 0x5A6E +0x985C 0x5A2B +0x985D 0xE950 +0x985E 0x6A2B +0x985F 0x9862 0xE952 +0x9863 0x711D +0x9864 0x9865 0xE957 +0x9866 0x4FB0 +0x9867 0xE95A +0x9868 0x5CC2 +0x9869 0x986B 0xE95C +0x986C 0x6A0C +0x986D 0x986E 0xE960 +0x986F 0x70A6 +0x9870 0x7133 +0x9871 0xE964 +0x9872 0x3DA5 +0x9873 0x6CDF +0x9874 0x9875 0xE967 +0x9876 0x7E65 +0x9877 0x59EB +0x9878 0x5D2F +0x9879 0x3DF3 +0x987A 0x5F5C +0x987B 0x987C 0xE96E +0x987D 0x7DA4 +0x987E 0x8426 +0x98A1 0x5485 +0x98A2 0x98A4 0xE973 +0x98A5 0x577E +0x98A6 0x98A7 0xE977 +0x98A8 0x3FE5 +0x98A9 0x98AA 0xE97A +0x98AB 0x7003 +0x98AC 0xE97D +0x98AD 0x5D70 +0x98AE 0x738F +0x98AF 0x7CD3 +0x98B0 0x98B1 0xE981 +0x98B2 0x4FC8 +0x98B3 0x7FE7 +0x98B4 0x72CD +0x98B5 0x7310 +0x98B6 0xE987 +0x98B7 0x98B8 0x7338 +0x98B9 0xE98A +0x98BA 0x7341 +0x98BB 0x7348 +0x98BC 0x3EA9 +0x98BD 0xE98E +0x98BE 0x906C +0x98BF 0x71F5 +0x98C0 0xE991 +0x98C1 0x73E1 +0x98C2 0x81F6 +0x98C3 0x3ECA +0x98C4 0x770C +0x98C5 0x3ED1 +0x98C6 0x6CA2 +0x98C7 0x56FD +0x98C8 0x7419 +0x98C9 0x98CA 0x741E +0x98CB 0x3EE2 +0x98CC 0x3EF0 +0x98CD 0x3EF4 +0x98CE 0x3EFA +0x98CF 0x74D3 +0x98D0 0x3F0E +0x98D1 0x3F53 +0x98D2 0x7542 +0x98D3 0x756D +0x98D4 0x7572 +0x98D5 0x758D +0x98D6 0x3F7C +0x98D7 0x75C8 +0x98D8 0x75DC +0x98D9 0x3FC0 +0x98DA 0x764D +0x98DB 0x3FD7 +0x98DC 0x7674 +0x98DD 0x3FDC +0x98DE 0x767A +0x98DF 0xE9B0 +0x98E0 0x7188 +0x98E1 0x5623 +0x98E2 0x8980 +0x98E3 0x5869 +0x98E4 0x401D +0x98E5 0x7743 +0x98E6 0x4039 +0x98E7 0x6761 +0x98E8 0x4045 +0x98E9 0x35DB +0x98EA 0x7798 +0x98EB 0x406A +0x98EC 0x406F +0x98ED 0x5C5E +0x98EE 0x77BE +0x98EF 0x77CB +0x98F0 0x58F2 +0x98F1 0x7818 +0x98F2 0x70B9 +0x98F3 0x781C +0x98F4 0x40A8 +0x98F5 0x7839 +0x98F6 0x7847 +0x98F7 0x7851 +0x98F8 0x7866 +0x98F9 0x8448 +0x98FA 0xE9CB +0x98FB 0x7933 +0x98FC 0x6803 +0x98FD 0x7932 +0x98FE 0x4103 +0x9940 0x4109 +0x9941 0x7991 +0x9942 0x7999 +0x9943 0x8FBB +0x9944 0x7A06 +0x9945 0x8FBC +0x9946 0x4167 +0x9947 0x7A91 +0x9948 0x41B2 +0x9949 0x7ABC +0x994A 0x8279 +0x994B 0x41C4 +0x994C 0x7ACF +0x994D 0x7ADB +0x994E 0x41CF +0x994F 0x4E21 +0x9950 0x7B62 +0x9951 0x7B6C +0x9952 0x7B7B +0x9953 0x7C12 +0x9954 0x7C1B +0x9955 0x4260 +0x9956 0x427A +0x9957 0x7C7B +0x9958 0x7C9C +0x9959 0x428C +0x995A 0x7CB8 +0x995B 0x4294 +0x995C 0x7CED +0x995D 0x8F93 +0x995E 0x70C0 +0x995F 0xE9EF +0x9960 0x7DCF +0x9961 0x7DD4 +0x9962 0x7DD0 +0x9963 0x7DFD +0x9964 0x7FAE +0x9965 0x7FB4 +0x9966 0x729F +0x9967 0x4397 +0x9968 0x8020 +0x9969 0x8025 +0x996A 0x7B39 +0x996B 0x802E +0x996C 0x8031 +0x996D 0x8054 +0x996E 0x3DCC +0x996F 0x57B4 +0x9970 0x70A0 +0x9971 0x80B7 +0x9972 0x80E9 +0x9973 0x43ED +0x9974 0x810C +0x9975 0x732A +0x9976 0x810E +0x9977 0x8112 +0x9978 0x7560 +0x9979 0x8114 +0x997A 0x4401 +0x997B 0x3B39 +0x997C 0x8156 +0x997D 0x997E 0x8159 +0x99A1 0x4413 +0x99A2 0x583A +0x99A3 0x817C +0x99A4 0x8184 +0x99A5 0x4425 +0x99A6 0x8193 +0x99A7 0x442D +0x99A8 0x81A5 +0x99A9 0x57EF +0x99AA 0x81C1 +0x99AB 0x81E4 +0x99AC 0x8254 +0x99AD 0x448F +0x99AE 0x82A6 +0x99AF 0x8276 +0x99B0 0x82CA +0x99B1 0x82D8 +0x99B2 0x82FF +0x99B3 0x44B0 +0x99B4 0x8357 +0x99B5 0x9669 +0x99B6 0x698A +0x99B7 0x8405 +0x99B8 0x70F5 +0x99B9 0x8464 +0x99BA 0x60E3 +0x99BB 0x8488 +0x99BC 0x4504 +0x99BD 0x84BE +0x99BE 0x84E1 +0x99BF 0x84F8 +0x99C0 0x8510 +0x99C1 0x8538 +0x99C2 0x8552 +0x99C3 0x453B +0x99C4 0x99C5 0x856F +0x99C6 0x85E0 +0x99C7 0x4577 +0x99C8 0x8672 +0x99C9 0x8692 +0x99CA 0x86B2 +0x99CB 0x86EF +0x99CC 0x9645 +0x99CD 0x878B +0x99CE 0x4606 +0x99CF 0x4617 +0x99D0 0x88AE +0x99D1 0x88FF +0x99D2 0x8924 +0x99D3 0x8947 +0x99D4 0x8991 +0x99D5 0xEA43 +0x99D6 0x8A29 +0x99D7 0x8A38 +0x99D8 0x8A94 +0x99D9 0x8AB4 +0x99DA 0x8C51 +0x99DB 0x8CD4 +0x99DC 0x8CF2 +0x99DD 0x8D1C +0x99DE 0x4798 +0x99DF 0x585F +0x99E0 0x8DC3 +0x99E1 0x47ED +0x99E2 0x4EEE +0x99E3 0x8E3A +0x99E4 0x55D8 +0x99E5 0x5754 +0x99E6 0x8E71 +0x99E7 0x55F5 +0x99E8 0x8EB0 +0x99E9 0x4837 +0x99EA 0x8ECE +0x99EB 0x8EE2 +0x99EC 0x8EE4 +0x99ED 0x8EED +0x99EE 0x8EF2 +0x99EF 0x8FB7 +0x99F0 0x8FC1 +0x99F1 0x8FCA +0x99F2 0x8FCC +0x99F3 0x9033 +0x99F4 0x99C4 +0x99F5 0x48AD +0x99F6 0x98E0 +0x99F7 0x9213 +0x99F8 0x491E +0x99F9 0x9228 +0x99FA 0x9258 +0x99FB 0x926B +0x99FC 0x92B1 +0x99FD 0x92AE +0x99FE 0x92BF +0x9A40 0x92E3 +0x9A41 0x92EB +0x9A42 0x9A43 0x92F3 +0x9A44 0x92FD +0x9A45 0x9343 +0x9A46 0x9384 +0x9A47 0x93AD +0x9A48 0x4945 +0x9A49 0x4951 +0x9A4A 0x9EBF +0x9A4B 0x9417 +0x9A4C 0x5301 +0x9A4D 0x941D +0x9A4E 0x942D +0x9A4F 0x943E +0x9A50 0x496A +0x9A51 0x9454 +0x9A52 0x9479 +0x9A53 0x952D +0x9A54 0x95A2 +0x9A55 0x49A7 +0x9A56 0x95F4 +0x9A57 0x9633 +0x9A58 0x49E5 +0x9A59 0x67A0 +0x9A5A 0x4A24 +0x9A5B 0x9740 +0x9A5C 0x4A35 +0x9A5D 0x97B2 +0x9A5E 0x97C2 +0x9A5F 0x5654 +0x9A60 0x4AE4 +0x9A61 0x60E8 +0x9A62 0x98B9 +0x9A63 0x4B19 +0x9A64 0x98F1 +0x9A65 0x5844 +0x9A66 0x990E +0x9A67 0x9919 +0x9A68 0x51B4 +0x9A69 0x991C +0x9A6A 0x9937 +0x9A6B 0x9942 +0x9A6C 0x995D +0x9A6D 0x9962 +0x9A6E 0x4B70 +0x9A6F 0x99C5 +0x9A70 0x4B9D +0x9A71 0x9A3C +0x9A72 0x9B0F +0x9A73 0x7A83 +0x9A74 0x9B69 +0x9A75 0x9B81 +0x9A76 0x9BDD +0x9A77 0x9BF1 +0x9A78 0x9BF4 +0x9A79 0x4C6D +0x9A7A 0x9C20 +0x9A7B 0x376F +0x9A7C 0xEAA9 +0x9A7D 0x9D49 +0x9A7E 0x9C3A +0x9AA1 0x9EFE +0x9AA2 0x5650 +0x9AA3 0x9D93 +0x9AA4 0x9DBD +0x9AA5 0x9DC0 +0x9AA6 0x9DFC +0x9AA7 0x94F6 +0x9AA8 0x8FB6 +0x9AA9 0x9E7B +0x9AAA 0x9EAC +0x9AAB 0x9EB1 +0x9AAC 0x9EBD +0x9AAD 0x9EC6 +0x9AAE 0x94DC +0x9AAF 0x9EE2 +0x9AB0 0x9EF1 +0x9AB1 0x9EF8 +0x9AB2 0x7AC8 +0x9AB3 0x9F44 +0x9AB4 0x9AB6 0xEABF +0x9AB7 0x691A +0x9AB8 0x94C3 +0x9AB9 0x59AC +0x9ABA 0xEAC5 +0x9ABB 0x5840 +0x9ABC 0x94C1 +0x9ABD 0x37B9 +0x9ABE 0x9AC1 0xEAC9 +0x9AC2 0x5757 +0x9AC3 0x7173 +0x9AC4 0x9AC6 0xEACF +0x9AC7 0x546A +0x9AC8 0x9AC9 0xEAD3 +0x9ACA 0x549E +0x9ACB 0x9ACF 0xEAD6 +0x9AD0 0x60E7 +0x9AD1 0xEADC +0x9AD2 0x567A +0x9AD3 0x9AD8 0xEADE +0x9AD9 0x6955 +0x9ADA 0x9C2F +0x9ADB 0x87A5 +0x9ADC 0x9AE1 0xEAE7 +0x9AE2 0x5C20 +0x9AE3 0xEAEE +0x9AE4 0x5E0B +0x9AE5 0x9AE7 0xEAF0 +0x9AE8 0x671E +0x9AE9 0x9AEB 0xEAF4 +0x9AEC 0x3647 +0x9AED 0x9AF0 0xEAF8 +0x9AF1 0x5364 +0x9AF2 0x84AD +0x9AF3 0x9AF5 0xEAFE +0x9AF6 0x8B81 +0x9AF7 0x9AFA 0xEB02 +0x9AFB 0x4E78 +0x9AFC 0x70BB +0x9AFD 0x9AFE 0xEB08 +0x9B40 0x9B45 0xEB0A +0x9B46 0x62C3 +0x9B47 0x9B48 0xEB11 +0x9B49 0x7198 +0x9B4A 0x6855 +0x9B4B 0xEB15 +0x9B4C 0x69E9 +0x9B4D 0x36C8 +0x9B4E 0x9B53 0xEB18 +0x9B54 0x82FD +0x9B55 0x9B57 0xEB1F +0x9B58 0x89A5 +0x9B59 0xEB23 +0x9B5A 0x8FA0 +0x9B5B 0xEB25 +0x9B5C 0x97B8 +0x9B5D 0xEB27 +0x9B5E 0x9847 +0x9B5F 0x9ABD +0x9B60 0x9B6F 0xEB2A +0x9B70 0x5FB1 +0x9B71 0x6648 +0x9B72 0x66BF +0x9B73 0x9B75 0xEB3D +0x9B76 0x7201 +0x9B77 0xEB41 +0x9B78 0x77D7 +0x9B79 0x9B7A 0xEB43 +0x9B7B 0x7E87 +0x9B7C 0xEB46 +0x9B7D 0x58B5 +0x9B7E 0x670E +0x9BA1 0x6918 +0x9BA2 0x9BA8 0xEB4A +0x9BA9 0x48D0 +0x9BAA 0x4AB8 +0x9BAB 0x9BB3 0xEB53 +0x9BB4 0x51D2 +0x9BB5 0xEB5D +0x9BB6 0x599F +0x9BB7 0xEB5F +0x9BB8 0x3BBE +0x9BB9 0x9BBB 0xEB61 +0x9BBC 0x5788 +0x9BBD 0xEB65 +0x9BBE 0x399B +0x9BBF 0x9BC1 0xEB67 +0x9BC2 0x3762 +0x9BC3 0xEB6B +0x9BC4 0x8B5E +0x9BC5 0xEB6D +0x9BC6 0x99D6 +0x9BC7 0x9BC9 0xEB6F +0x9BCA 0x7209 +0x9BCB 0x9BCC 0xEB73 +0x9BCD 0x5965 +0x9BCE 0x9BD0 0xEB76 +0x9BD1 0x8EDA +0x9BD2 0xEB7A +0x9BD3 0x528F +0x9BD4 0x573F +0x9BD5 0x7171 +0x9BD6 0x9BD9 0xEB7E +0x9BDA 0x55BC +0x9BDB 0x9BDD 0xEB83 +0x9BDE 0x91D4 +0x9BDF 0x3473 +0x9BE0 0x9BE2 0xEB88 +0x9BE3 0x4718 +0x9BE4 0x9BE8 0xEB8C +0x9BE9 0x5066 +0x9BEA 0x34FB +0x9BEB 0xEB93 +0x9BEC 0x60DE +0x9BED 0xEB95 +0x9BEE 0x477C +0x9BEF 0x9BF3 0xEB97 +0x9BF4 0x57A1 +0x9BF5 0x7151 +0x9BF6 0x6FB6 +0x9BF7 0x9BF8 0xEB9F +0x9BF9 0x9056 +0x9BFA 0x9BFB 0xEBA2 +0x9BFC 0x8B62 +0x9BFD 0x9BFE 0xEBA5 +0x9C40 0x5D5B +0x9C41 0xEBA8 +0x9C42 0x8F36 +0x9C43 0x9C44 0xEBAA +0x9C45 0x8AEA +0x9C46 0x9C49 0xEBAD +0x9C4A 0x4BC0 +0x9C4B 0x9C4D 0xEBB2 +0x9C4E 0x9465 +0x9C4F 0xEBB6 +0x9C50 0x6195 +0x9C51 0x5A27 +0x9C52 0xEBB9 +0x9C53 0x4FBB +0x9C54 0x56B9 +0x9C55 0x9C56 0xEBBC +0x9C57 0x4E6A +0x9C58 0xEBBF +0x9C59 0x9656 +0x9C5A 0x6D8F +0x9C5B 0xEBC2 +0x9C5C 0x3618 +0x9C5D 0x8977 +0x9C5E 0x9C61 0xEBC5 +0x9C62 0x71DF +0x9C63 0xEBCA +0x9C64 0x7B42 +0x9C65 0x9C67 0xEBCC +0x9C68 0x9104 +0x9C69 0xEBD0 +0x9C6A 0x7A45 +0x9C6B 0x9DF0 +0x9C6C 0xEBD3 +0x9C6D 0x9A26 +0x9C6E 0xEBD5 +0x9C6F 0x365F +0x9C70 0x9C71 0xEBD7 +0x9C72 0x7983 +0x9C73 0x9C74 0xEBDA +0x9C75 0x5D2C +0x9C76 0xEBDD +0x9C77 0x83CF +0x9C78 0xEBDF +0x9C79 0x46D0 +0x9C7A 0xEBE1 +0x9C7B 0x753B +0x9C7C 0x8865 +0x9C7D 0xEBE4 +0x9C7E 0x58B6 +0x9CA1 0x371C +0x9CA2 0x9CA4 0xEBE7 +0x9CA5 0x3C54 +0x9CA6 0x9CA7 0xEBEB +0x9CA8 0x9281 +0x9CA9 0x9CAA 0xEBEE +0x9CAB 0x9330 +0x9CAC 0x9CAD 0xEBF1 +0x9CAE 0x6C39 +0x9CAF 0x949F +0x9CB0 0x9CB1 0xEBF5 +0x9CB2 0x8827 +0x9CB3 0x88F5 +0x9CB4 0x9CB6 0xEBF9 +0x9CB7 0x6EB8 +0x9CB8 0x9CB9 0xEBFD +0x9CBA 0x39A4 +0x9CBB 0x36B9 +0x9CBC 0x5C10 +0x9CBD 0x79E3 +0x9CBE 0x453F +0x9CBF 0x66B6 +0x9CC0 0x9CC1 0xEC05 +0x9CC2 0x8943 +0x9CC3 0x9CC4 0xEC08 +0x9CC5 0x56D6 +0x9CC6 0x40DF +0x9CC7 0xEC0C +0x9CC8 0x39A1 +0x9CC9 0x9CCB 0xEC0E +0x9CCC 0x71AD +0x9CCD 0x8366 +0x9CCE 0x9CCF 0xEC13 +0x9CD0 0x5A67 +0x9CD1 0x4CB7 +0x9CD2 0x9CD8 0xEC17 +0x9CD9 0x7B43 +0x9CDA 0x797E +0x9CDB 0xEC20 +0x9CDC 0x6FB5 +0x9CDD 0xEC22 +0x9CDE 0x6A03 +0x9CDF 0xEC24 +0x9CE0 0x53A2 +0x9CE1 0xEC26 +0x9CE2 0x93BF +0x9CE3 0x6836 +0x9CE4 0x975D +0x9CE5 0x9CEA 0xEC2A +0x9CEB 0x5D85 +0x9CEC 0x9CED 0xEC31 +0x9CEE 0x5715 +0x9CEF 0x9823 +0x9CF0 0xEC35 +0x9CF1 0x5DAB +0x9CF2 0xEC37 +0x9CF3 0x65BE +0x9CF4 0x69D5 +0x9CF5 0x53D2 +0x9CF6 0x9CF7 0xEC3B +0x9CF8 0x3C11 +0x9CF9 0x6736 +0x9CFA 0x9CFE 0xEC3F +0x9D40 0x9D45 0xEC44 +0x9D46 0x35CA +0x9D47 0x9D48 0xEC4B +0x9D49 0x48FA +0x9D4A 0x63E6 +0x9D4B 0xEC4F +0x9D4C 0x7808 +0x9D4D 0x9255 +0x9D4E 0xEC52 +0x9D4F 0x43F2 +0x9D50 0xEC54 +0x9D51 0x43DF +0x9D52 0x9D54 0xEC56 +0x9D55 0x59F8 +0x9D56 0xEC5A +0x9D57 0x8F0B +0x9D58 0x9D59 0xEC5C +0x9D5A 0x7B51 +0x9D5B 0x9D5C 0xEC5F +0x9D5D 0x3DF7 +0x9D5E 0x9D5F 0xEC62 +0x9D60 0x8FD0 +0x9D61 0x728F +0x9D62 0x568B +0x9D63 0x9D6F 0xEC67 +0x9D70 0x7E9F +0x9D71 0x9D72 0xEC75 +0x9D73 0x4CA4 +0x9D74 0x9547 +0x9D75 0xEC79 +0x9D76 0x71A2 +0x9D77 0xEC7B +0x9D78 0x4D91 +0x9D79 0x9012 +0x9D7A 0xEC7E +0x9D7B 0x4D9C +0x9D7C 0xEC80 +0x9D7D 0x8FBE +0x9D7E 0x55C1 +0x9DA1 0x8FBA +0x9DA2 0xEC84 +0x9DA3 0x8FB9 +0x9DA4 0xEC86 +0x9DA5 0x4509 +0x9DA6 0x7E7F +0x9DA7 0x6F56 +0x9DA8 0x6AB1 +0x9DA9 0x4EEA +0x9DAA 0x34E4 +0x9DAB 0x9DAC 0xEC8D +0x9DAD 0x373A +0x9DAE 0x8E80 +0x9DAF 0x9DB4 0xEC91 +0x9DB5 0x3DEB +0x9DB6 0x9DB9 0xEC98 +0x9DBA 0x4E9A +0x9DBB 0x9DBC 0xEC9D +0x9DBD 0x56BF +0x9DBE 0xECA0 +0x9DBF 0x8E0E +0x9DC0 0x5B6D +0x9DC1 0x9DC2 0xECA3 +0x9DC3 0x63DE +0x9DC4 0x62D0 +0x9DC5 0x9DC6 0xECA7 +0x9DC7 0x6530 +0x9DC8 0x562D +0x9DC9 0xECAB +0x9DCA 0x541A +0x9DCB 0xECAD +0x9DCC 0x3DC6 +0x9DCD 0xECAF +0x9DCE 0x4C7D +0x9DCF 0x5622 +0x9DD0 0x561E +0x9DD1 0x7F49 +0x9DD2 0xECB4 +0x9DD3 0x5975 +0x9DD4 0xECB6 +0x9DD5 0x8770 +0x9DD6 0x4E1C +0x9DD7 0x9DD9 0xECB9 +0x9DDA 0x8117 +0x9DDB 0x9D5E +0x9DDC 0x8D18 +0x9DDD 0x763B +0x9DDE 0x9C45 +0x9DDF 0x764E +0x9DE0 0x77B9 +0x9DE1 0x9345 +0x9DE2 0x5432 +0x9DE3 0x8148 +0x9DE4 0x82F7 +0x9DE5 0x5625 +0x9DE6 0x8132 +0x9DE7 0x8418 +0x9DE8 0x80BD +0x9DE9 0x55EA +0x9DEA 0x7962 +0x9DEB 0x5643 +0x9DEC 0x5416 +0x9DED 0xECCF +0x9DEE 0x35CE +0x9DEF 0x5605 +0x9DF0 0x55F1 +0x9DF1 0x66F1 +0x9DF2 0xECD4 +0x9DF3 0x362D +0x9DF4 0x7534 +0x9DF5 0x55F0 +0x9DF6 0x55BA +0x9DF7 0x5497 +0x9DF8 0x5572 +0x9DF9 0x9DFA 0xECDB +0x9DFB 0x5ED0 +0x9DFC 0x9DFE 0xECDE +0x9E40 0xECE1 +0x9E41 0x9EAB +0x9E42 0x7D5A +0x9E43 0x55DE +0x9E44 0xECE5 +0x9E45 0x629D +0x9E46 0x976D +0x9E47 0x5494 +0x9E48 0x8CCD +0x9E49 0x71F6 +0x9E4A 0x9176 +0x9E4B 0x63FC +0x9E4C 0x63B9 +0x9E4D 0x63FE +0x9E4E 0x5569 +0x9E4F 0xECF0 +0x9E50 0x9C72 +0x9E51 0xECF2 +0x9E52 0x519A +0x9E53 0x34DF +0x9E54 0xECF5 +0x9E55 0x51A7 +0x9E56 0x544D +0x9E57 0x551E +0x9E58 0x5513 +0x9E59 0x7666 +0x9E5A 0x8E2D +0x9E5B 0xECFC +0x9E5C 0x75B1 +0x9E5D 0x80B6 +0x9E5E 0x8804 +0x9E5F 0x8786 +0x9E60 0x88C7 +0x9E61 0x81B6 +0x9E62 0x841C +0x9E63 0xED04 +0x9E64 0x44EC +0x9E65 0x7304 +0x9E66 0xED07 +0x9E67 0x5B90 +0x9E68 0x830B +0x9E69 0xED0A +0x9E6A 0x567B +0x9E6B 0x9E70 0xED0C +0x9E71 0x9170 +0x9E72 0xED13 +0x9E73 0x9208 +0x9E74 0x9E77 0xED15 +0x9E78 0x7266 +0x9E79 0xED1A +0x9E7A 0x474E +0x9E7B 0x9E7D 0xED1C +0x9E7E 0x40FA +0x9EA1 0x9C5D +0x9EA2 0x651F +0x9EA3 0xED22 +0x9EA4 0x48F3 +0x9EA5 0x9EA8 0xED24 +0x9EA9 0x6062 +0x9EAA 0x9EAE 0xED29 +0x9EAF 0x71A3 +0x9EB0 0x7E8E +0x9EB1 0x9D50 +0x9EB2 0x4E1A +0x9EB3 0x4E04 +0x9EB4 0x3577 +0x9EB5 0x5B0D +0x9EB6 0x6CB2 +0x9EB7 0x5367 +0x9EB8 0x36AC +0x9EB9 0x39DC +0x9EBA 0x537D +0x9EBB 0x36A5 +0x9EBC 0xED3B +0x9EBD 0x589A +0x9EBE 0xED3D +0x9EBF 0x822D +0x9EC0 0x544B +0x9EC1 0x57AA +0x9EC2 0x9EC4 0xED41 +0x9EC5 0x3A52 +0x9EC6 0xED45 +0x9EC7 0x7374 +0x9EC8 0xED47 +0x9EC9 0x4D09 +0x9ECA 0x9BED +0x9ECB 0x9ECC 0xED4A +0x9ECD 0x4C5B +0x9ECE 0x9ED0 0xED4D +0x9ED1 0x845C +0x9ED2 0x9ED5 0xED51 +0x9ED6 0x632E +0x9ED7 0x7D25 +0x9ED8 0x9ED9 0xED57 +0x9EDA 0x3A2A +0x9EDB 0x9008 +0x9EDC 0x52CC +0x9EDD 0x3E74 +0x9EDE 0x367A +0x9EDF 0x45E9 +0x9EE0 0xED5F +0x9EE1 0x7640 +0x9EE2 0x5AF0 +0x9EE3 0xED62 +0x9EE4 0x787A +0x9EE5 0x47B6 +0x9EE6 0x58A7 +0x9EE7 0x40BF +0x9EE8 0x567C +0x9EE9 0x9B8B +0x9EEA 0x5D74 +0x9EEB 0x7654 +0x9EEC 0xED6B +0x9EED 0x9E85 +0x9EEE 0x4CE1 +0x9EEF 0x75F9 +0x9EF0 0x37FB +0x9EF1 0x6119 +0x9EF2 0x9EF4 0xED71 +0x9EF5 0x565D +0x9EF6 0xED75 +0x9EF7 0x57A7 +0x9EF8 0x9EF9 0xED77 +0x9EFA 0x5234 +0x9EFB 0xED7A +0x9EFC 0x35AD +0x9EFD 0x6C4A +0x9EFE 0x9D7C +0x9F40 0x7C56 +0x9F41 0x9B39 +0x9F42 0x57DE +0x9F43 0xED81 +0x9F44 0x5C53 +0x9F45 0x64D3 +0x9F46 0x9F48 0xED84 +0x9F49 0x86AD +0x9F4A 0x9F4E 0xED88 +0x9F4F 0x51FE +0x9F50 0xED8E +0x9F51 0x5D8E +0x9F52 0x9703 +0x9F53 0xED91 +0x9F54 0x9E81 +0x9F55 0x904C +0x9F56 0x7B1F +0x9F57 0x9B02 +0x9F58 0x5CD1 +0x9F59 0x7BA3 +0x9F5A 0x6268 +0x9F5B 0x6335 +0x9F5C 0x9AFF +0x9F5D 0x7BCF +0x9F5E 0x9B2A +0x9F5F 0x7C7E +0x9F60 0x9B2E +0x9F61 0x7C42 +0x9F62 0x7C86 +0x9F63 0x9C15 +0x9F64 0x7BFC +0x9F65 0x9B09 +0x9F66 0x9F17 +0x9F67 0x9C1B +0x9F68 0xEDA6 +0x9F69 0x9F5A +0x9F6A 0x5573 +0x9F6B 0x5BC3 +0x9F6C 0x4FFD +0x9F6D 0x9E98 +0x9F6E 0x4FF2 +0x9F6F 0x5260 +0x9F70 0x3E06 +0x9F71 0x52D1 +0x9F72 0x5767 +0x9F73 0x5056 +0x9F74 0x59B7 +0x9F75 0x5E12 +0x9F76 0x97C8 +0x9F77 0x9DAB +0x9F78 0x8F5C +0x9F79 0x5469 +0x9F7A 0x97B4 +0x9F7B 0x9940 +0x9F7C 0x97BA +0x9F7D 0x532C +0x9F7E 0x6130 +0x9FA1 0x692C +0x9FA2 0x53DA +0x9FA3 0x9C0A +0x9FA4 0x9D02 +0x9FA5 0x4C3B +0x9FA6 0x9641 +0x9FA7 0x6980 +0x9FA8 0x50A6 +0x9FA9 0x7546 +0x9FAA 0xEDC6 +0x9FAB 0x99DA +0x9FAC 0x5273 +0x9FAD 0xEDC9 +0x9FAE 0x9159 +0x9FAF 0x9681 +0x9FB0 0x915C +0x9FB1 0xEDCD +0x9FB2 0x9151 +0x9FB3 0xEDCF +0x9FB4 0x637F +0x9FB5 0xEDD1 +0x9FB6 0x6ACA +0x9FB7 0x5611 +0x9FB8 0x918E +0x9FB9 0x757A +0x9FBA 0x6285 +0x9FBB 0xEDD7 +0x9FBC 0x734F +0x9FBD 0x7C70 +0x9FBE 0x9FC1 0xEDDA +0x9FC2 0x76D6 +0x9FC3 0x9B9D +0x9FC4 0x4E2A +0x9FC5 0xEDE1 +0x9FC6 0x83BE +0x9FC7 0x8842 +0x9FC8 0xEDE4 +0x9FC9 0x5C4A +0x9FCA 0x69C0 +0x9FCB 0x50ED +0x9FCC 0x577A +0x9FCD 0x521F +0x9FCE 0x5DF5 +0x9FCF 0x4ECE +0x9FD0 0x6C31 +0x9FD1 0xEDED +0x9FD2 0x4F39 +0x9FD3 0x549C +0x9FD4 0x54DA +0x9FD5 0x529A +0x9FD6 0x8D82 +0x9FD7 0x35FE +0x9FD8 0x5F0C +0x9FD9 0x35F3 +0x9FDA 0xEDF6 +0x9FDB 0x6B52 +0x9FDC 0x917C +0x9FDD 0x9FA5 +0x9FDE 0x9B97 +0x9FDF 0x982E +0x9FE0 0x98B4 +0x9FE1 0x9ABA +0x9FE2 0x9EA8 +0x9FE3 0x9E84 +0x9FE4 0x717A +0x9FE5 0x7B14 +0x9FE6 0xEE02 +0x9FE7 0x6BFA +0x9FE8 0x8818 +0x9FE9 0x7F78 +0x9FEA 0xEE06 +0x9FEB 0x5620 +0x9FEC 0xEE08 +0x9FED 0x8E77 +0x9FEE 0x9F53 +0x9FEF 0xEE0B +0x9FF0 0x8DD4 +0x9FF1 0x8E4F +0x9FF2 0x9E1C +0x9FF3 0x8E01 +0x9FF4 0x6282 +0x9FF5 0xEE11 +0x9FF6 0x8E28 +0x9FF7 0x8E75 +0x9FF8 0x7AD3 +0x9FF9 0xEE15 +0x9FFA 0x7A3E +0x9FFB 0x78D8 +0x9FFC 0x6CEA +0x9FFD 0x8A67 +0x9FFE 0x7607 +0xA040 0xEE1B +0xA041 0x9F26 +0xA042 0x6CCE +0xA043 0x87D6 +0xA044 0x75C3 +0xA045 0xEE20 +0xA046 0x7853 +0xA047 0xEE22 +0xA048 0x8D0C +0xA049 0x72E2 +0xA04A 0x7371 +0xA04B 0x8B2D +0xA04C 0x7302 +0xA04D 0x74F1 +0xA04E 0x8CEB +0xA04F 0xEE2A +0xA050 0x862F +0xA051 0x5FBA +0xA052 0x88A0 +0xA053 0x44B7 +0xA054 0xA057 0xEE2F +0xA058 0x8A7E +0xA059 0xA05A 0xEE34 +0xA05B 0x60FD +0xA05C 0x7667 +0xA05D 0x9AD7 +0xA05E 0x9D44 +0xA05F 0x936E +0xA060 0x9B8F +0xA061 0x87F5 +0xA062 0xEE3D +0xA063 0x880F +0xA064 0x8CF7 +0xA065 0x732C +0xA066 0x9721 +0xA067 0x9BB0 +0xA068 0x35D6 +0xA069 0x72B2 +0xA06A 0x4C07 +0xA06B 0x7C51 +0xA06C 0x994A +0xA06D 0xEE48 +0xA06E 0x6159 +0xA06F 0x4C04 +0xA070 0x9E96 +0xA071 0x617D +0xA072 0xEE4D +0xA073 0x575F +0xA074 0x616F +0xA075 0x62A6 +0xA076 0x6239 +0xA077 0x62CE +0xA078 0x3A5C +0xA079 0x61E2 +0xA07A 0x53AA +0xA07B 0xEE56 +0xA07C 0x6364 +0xA07D 0x6802 +0xA07E 0x35D2 +0xA0A1 0x5D57 +0xA0A2 0xEE5B +0xA0A3 0x8FDA +0xA0A4 0xA0A5 0xEE5D +0xA0A6 0x50D9 +0xA0A7 0xEE60 +0xA0A8 0x7906 +0xA0A9 0x5332 +0xA0AA 0x9638 +0xA0AB 0xEE64 +0xA0AC 0x4065 +0xA0AD 0xEE66 +0xA0AE 0x77FE +0xA0AF 0xEE68 +0xA0B0 0x7CC2 +0xA0B1 0xEE6A +0xA0B2 0x7CDA +0xA0B3 0x7A2D +0xA0B4 0x8066 +0xA0B5 0x8063 +0xA0B6 0x7D4D +0xA0B7 0x7505 +0xA0B8 0x74F2 +0xA0B9 0x8994 +0xA0BA 0x821A +0xA0BB 0x670C +0xA0BC 0x8062 +0xA0BD 0xEE76 +0xA0BE 0x805B +0xA0BF 0x74F0 +0xA0C0 0x8103 +0xA0C1 0x7724 +0xA0C2 0x8989 +0xA0C3 0xEE7C +0xA0C4 0x7553 +0xA0C5 0xEE7E +0xA0C6 0x87A9 +0xA0C7 0x87CE +0xA0C8 0x81C8 +0xA0C9 0x878C +0xA0CA 0x8A49 +0xA0CB 0x8CAD +0xA0CC 0x8B43 +0xA0CD 0x772B +0xA0CE 0x74F8 +0xA0CF 0x84DA +0xA0D0 0x3635 +0xA0D1 0x69B2 +0xA0D2 0x8DA6 +0xA0D3 0xEE8C +0xA0D4 0x89A9 +0xA0D5 0x7468 +0xA0D6 0x6DB9 +0xA0D7 0x87C1 +0xA0D8 0xEE91 +0xA0D9 0x74E7 +0xA0DA 0x3DDB +0xA0DB 0x7176 +0xA0DC 0x60A4 +0xA0DD 0x619C +0xA0DE 0x3CD1 +0xA0DF 0x7162 +0xA0E0 0x6077 +0xA0E1 0xEE9A +0xA0E2 0x7F71 +0xA0E3 0xEE9C +0xA0E4 0x7250 +0xA0E5 0x60E9 +0xA0E6 0x4B7E +0xA0E7 0x5220 +0xA0E8 0x3C18 +0xA0E9 0xA0F1 0xEEA2 +0xA0F2 0x5CC1 +0xA0F3 0xA0F8 0xEEAC +0xA0F9 0x4562 +0xA0FA 0x5B1F +0xA0FB 0xEEB4 +0xA0FC 0x9F50 +0xA0FD 0x9EA6 +0xA0FE 0xEEB7 +0xA140 0x3000 +0xA141 0xFF0C +0xA142 0xA143 0x3001 +0xA144 0xFF0E +0xA145 0x2027 +0xA146 0xFF1B +0xA147 0xFF1A +0xA148 0xFF1F +0xA149 0xFF01 +0xA14A 0xFE30 +0xA14B 0x2026 +0xA14C 0x2025 +0xA14D 0xA14F 0xFE50 +0xA150 0x00B7 +0xA151 0xA154 0xFE54 +0xA155 0xFF5C +0xA156 0x2013 +0xA157 0xFE31 +0xA158 0x2014 +0xA159 0xFE33 +0xA15A 0x2574 +0xA15B 0xFE34 +0xA15C 0xFE4F +0xA15D 0xA15E 0xFF08 +0xA15F 0xA160 0xFE35 +0xA161 0xFF5B +0xA162 0xFF5D +0xA163 0xA164 0xFE37 +0xA165 0xA166 0x3014 +0xA167 0xA168 0xFE39 +0xA169 0xA16A 0x3010 +0xA16B 0xA16C 0xFE3B +0xA16D 0xA16E 0x300A +0xA16F 0xA170 0xFE3D +0xA171 0xA172 0x3008 +0xA173 0xA174 0xFE3F +0xA175 0xA176 0x300C +0xA177 0xA178 0xFE41 +0xA179 0xA17A 0x300E +0xA17B 0xA17C 0xFE43 +0xA17D 0xA17E 0xFE59 +0xA1A1 0xA1A4 0xFE5B +0xA1A5 0xA1A6 0x2018 +0xA1A7 0xA1A8 0x201C +0xA1A9 0xA1AA 0x301D +0xA1AB 0x2035 +0xA1AC 0x2032 +0xA1AD 0xFF03 +0xA1AE 0xFF06 +0xA1AF 0xFF0A +0xA1B0 0x203B +0xA1B1 0x00A7 +0xA1B2 0x3003 +0xA1B3 0x25CB +0xA1B4 0x25CF +0xA1B5 0x25B3 +0xA1B6 0x25B2 +0xA1B7 0x25CE +0xA1B8 0x2606 +0xA1B9 0x2605 +0xA1BA 0x25C7 +0xA1BB 0x25C6 +0xA1BC 0x25A1 +0xA1BD 0x25A0 +0xA1BE 0x25BD +0xA1BF 0x25BC +0xA1C0 0x32A3 +0xA1C1 0x2105 +0xA1C2 0x00AF +0xA1C3 0xFFE3 +0xA1C4 0xFF3F +0xA1C5 0x02CD +0xA1C6 0xA1C7 0xFE49 +0xA1C8 0xA1C9 0xFE4D +0xA1CA 0xA1CB 0xFE4B +0xA1CC 0xA1CE 0xFE5F +0xA1CF 0xFF0B +0xA1D0 0xFF0D +0xA1D1 0x00D7 +0xA1D2 0x00F7 +0xA1D3 0x00B1 +0xA1D4 0x221A +0xA1D5 0xFF1C +0xA1D6 0xFF1E +0xA1D7 0xFF1D +0xA1D8 0xA1D9 0x2266 +0xA1DA 0x2260 +0xA1DB 0x221E +0xA1DC 0x2252 +0xA1DD 0x2261 +0xA1DE 0xA1E2 0xFE62 +0xA1E3 0xFF5E +0xA1E4 0xA1E5 0x2229 +0xA1E6 0x22A5 +0xA1E7 0x2220 +0xA1E8 0x221F +0xA1E9 0x22BF +0xA1EA 0x33D2 +0xA1EB 0x33D1 +0xA1EC 0x222B +0xA1ED 0x222E +0xA1EE 0x2235 +0xA1EF 0x2234 +0xA1F0 0x2640 +0xA1F1 0x2642 +0xA1F2 0x2295 +0xA1F3 0x2299 +0xA1F4 0x2191 +0xA1F5 0x2193 +0xA1F6 0x2190 +0xA1F7 0x2192 +0xA1F8 0xA1F9 0x2196 +0xA1FA 0x2199 +0xA1FB 0x2198 +0xA1FC 0x2225 +0xA1FD 0x2223 +0xA1FE 0xFF0F +0xA240 0xFF3C +0xA241 0x2215 +0xA242 0xFE68 +0xA243 0xFF04 +0xA244 0xFFE5 +0xA245 0x3012 +0xA246 0xA247 0xFFE0 +0xA248 0xFF05 +0xA249 0xFF20 +0xA24A 0x2103 +0xA24B 0x2109 +0xA24C 0xA24E 0xFE69 +0xA24F 0x33D5 +0xA250 0xA252 0x339C +0xA253 0x33CE +0xA254 0x33A1 +0xA255 0xA256 0x338E +0xA257 0x33C4 +0xA258 0x00B0 +0xA259 0x5159 +0xA25A 0x515B +0xA25B 0x515E +0xA25C 0x515D +0xA25D 0x5161 +0xA25E 0x5163 +0xA25F 0x55E7 +0xA260 0x74E9 +0xA261 0x7CCE +0xA262 0xA269 0x2581 +0xA26A 0x258F +0xA26B 0x258E +0xA26C 0x258D +0xA26D 0x258C +0xA26E 0x258B +0xA26F 0x258A +0xA270 0x2589 +0xA271 0x253C +0xA272 0x2534 +0xA273 0x252C +0xA274 0x2524 +0xA275 0x251C +0xA276 0x2594 +0xA277 0x2500 +0xA278 0x2502 +0xA279 0x2595 +0xA27A 0x250C +0xA27B 0x2510 +0xA27C 0x2514 +0xA27D 0x2518 +0xA27E 0x256D +0xA2A1 0x256E +0xA2A2 0x2570 +0xA2A3 0x256F +0xA2A4 0x2550 +0xA2A5 0x255E +0xA2A6 0x256A +0xA2A7 0x2561 +0xA2A8 0xA2A9 0x25E2 +0xA2AA 0x25E5 +0xA2AB 0x25E4 +0xA2AC 0xA2AE 0x2571 +0xA2AF 0xA2B8 0xFF10 +0xA2B9 0xA2C2 0x2160 +0xA2C3 0xA2CB 0x3021 +0xA2CC 0x5341 +0xA2CD 0xA2CE 0x5344 +0xA2CF 0xA2E8 0xFF21 +0xA2E9 0xA2FE 0xFF41 +0xA340 0xA343 0xFF57 +0xA344 0xA354 0x0391 +0xA355 0xA35B 0x03A3 +0xA35C 0xA36C 0x03B1 +0xA36D 0xA373 0x03C3 +0xA374 0xA37E 0x3105 +0xA3A1 0xA3BA 0x3110 +0xA3BB 0x02D9 +0xA3BC 0xA3BD 0x02C9 +0xA3BE 0x02C7 +0xA3BF 0x02CB +0xA440 0x4E00 +0xA441 0x4E59 +0xA442 0x4E01 +0xA443 0x4E03 +0xA444 0x4E43 +0xA445 0x4E5D +0xA446 0x4E86 +0xA447 0x4E8C +0xA448 0x4EBA +0xA449 0x513F +0xA44A 0x5165 +0xA44B 0x516B +0xA44C 0x51E0 +0xA44D 0xA44E 0x5200 +0xA44F 0x529B +0xA450 0x5315 +0xA451 0x5341 +0xA452 0x535C +0xA453 0x53C8 +0xA454 0x4E09 +0xA455 0x4E0B +0xA456 0x4E08 +0xA457 0x4E0A +0xA458 0x4E2B +0xA459 0x4E38 +0xA45A 0x51E1 +0xA45B 0x4E45 +0xA45C 0x4E48 +0xA45D 0x4E5F +0xA45E 0x4E5E +0xA45F 0x4E8E +0xA460 0x4EA1 +0xA461 0x5140 +0xA462 0x5203 +0xA463 0x52FA +0xA464 0x5343 +0xA465 0x53C9 +0xA466 0x53E3 +0xA467 0x571F +0xA468 0x58EB +0xA469 0x5915 +0xA46A 0x5927 +0xA46B 0x5973 +0xA46C 0xA46D 0x5B50 +0xA46E 0x5B53 +0xA46F 0x5BF8 +0xA470 0x5C0F +0xA471 0x5C22 +0xA472 0x5C38 +0xA473 0x5C71 +0xA474 0x5DDD +0xA475 0x5DE5 +0xA476 0xA478 0x5DF1 +0xA479 0x5DFE +0xA47A 0x5E72 +0xA47B 0x5EFE +0xA47C 0x5F0B +0xA47D 0x5F13 +0xA47E 0x624D +0xA4A1 0x4E11 +0xA4A2 0x4E10 +0xA4A3 0x4E0D +0xA4A4 0x4E2D +0xA4A5 0x4E30 +0xA4A6 0x4E39 +0xA4A7 0x4E4B +0xA4A8 0x5C39 +0xA4A9 0x4E88 +0xA4AA 0x4E91 +0xA4AB 0x4E95 +0xA4AC 0x4E92 +0xA4AD 0x4E94 +0xA4AE 0x4EA2 +0xA4AF 0x4EC1 +0xA4B0 0x4EC0 +0xA4B1 0x4EC3 +0xA4B2 0xA4B3 0x4EC6 +0xA4B4 0x4ECD +0xA4B5 0xA4B6 0x4ECA +0xA4B7 0x4EC4 +0xA4B8 0x5143 +0xA4B9 0x5141 +0xA4BA 0x5167 +0xA4BB 0xA4BC 0x516D +0xA4BD 0x516C +0xA4BE 0x5197 +0xA4BF 0x51F6 +0xA4C0 0xA4C2 0x5206 +0xA4C3 0x52FB +0xA4C4 0xA4C5 0x52FE +0xA4C6 0x5316 +0xA4C7 0x5339 +0xA4C8 0x5348 +0xA4C9 0x5347 +0xA4CA 0x5345 +0xA4CB 0x535E +0xA4CC 0x5384 +0xA4CD 0x53CB +0xA4CE 0x53CA +0xA4CF 0x53CD +0xA4D0 0x58EC +0xA4D1 0x5929 +0xA4D2 0x592B +0xA4D3 0x592A +0xA4D4 0x592D +0xA4D5 0x5B54 +0xA4D6 0x5C11 +0xA4D7 0x5C24 +0xA4D8 0x5C3A +0xA4D9 0x5C6F +0xA4DA 0x5DF4 +0xA4DB 0x5E7B +0xA4DC 0x5EFF +0xA4DD 0xA4DE 0x5F14 +0xA4DF 0x5FC3 +0xA4E0 0x6208 +0xA4E1 0x6236 +0xA4E2 0x624B +0xA4E3 0x624E +0xA4E4 0x652F +0xA4E5 0x6587 +0xA4E6 0x6597 +0xA4E7 0x65A4 +0xA4E8 0x65B9 +0xA4E9 0x65E5 +0xA4EA 0x66F0 +0xA4EB 0x6708 +0xA4EC 0x6728 +0xA4ED 0x6B20 +0xA4EE 0x6B62 +0xA4EF 0x6B79 +0xA4F0 0x6BCB +0xA4F1 0x6BD4 +0xA4F2 0x6BDB +0xA4F3 0x6C0F +0xA4F4 0x6C34 +0xA4F5 0x706B +0xA4F6 0x722A +0xA4F7 0x7236 +0xA4F8 0x723B +0xA4F9 0x7247 +0xA4FA 0x7259 +0xA4FB 0x725B +0xA4FC 0x72AC +0xA4FD 0x738B +0xA4FE 0x4E19 +0xA540 0x4E16 +0xA541 0x4E15 +0xA542 0x4E14 +0xA543 0x4E18 +0xA544 0x4E3B +0xA545 0x4E4D +0xA546 0x4E4F +0xA547 0x4E4E +0xA548 0x4EE5 +0xA549 0x4ED8 +0xA54A 0xA54D 0x4ED4 +0xA54E 0xA54F 0x4EE3 +0xA550 0x4ED9 +0xA551 0x4EDE +0xA552 0x5145 +0xA553 0x5144 +0xA554 0xA555 0x5189 +0xA556 0x51AC +0xA557 0xA558 0x51F9 +0xA559 0x51F8 +0xA55A 0x520A +0xA55B 0x52A0 +0xA55C 0x529F +0xA55D 0xA55E 0x5305 +0xA55F 0x5317 +0xA560 0x531D +0xA561 0x4EDF +0xA562 0x534A +0xA563 0x5349 +0xA564 0x5361 +0xA565 0x5360 +0xA566 0x536F +0xA567 0x536E +0xA568 0x53BB +0xA569 0x53EF +0xA56A 0x53E4 +0xA56B 0x53F3 +0xA56C 0x53EC +0xA56D 0x53EE +0xA56E 0x53E9 +0xA56F 0x53E8 +0xA570 0x53FC +0xA571 0x53F8 +0xA572 0x53F5 +0xA573 0x53EB +0xA574 0x53E6 +0xA575 0x53EA +0xA576 0x53F2 +0xA577 0x53F1 +0xA578 0x53F0 +0xA579 0x53E5 +0xA57A 0x53ED +0xA57B 0x53FB +0xA57C 0x56DB +0xA57D 0x56DA +0xA57E 0x5916 +0xA5A1 0x592E +0xA5A2 0x5931 +0xA5A3 0x5974 +0xA5A4 0x5976 +0xA5A5 0x5B55 +0xA5A6 0x5B83 +0xA5A7 0x5C3C +0xA5A8 0x5DE8 +0xA5A9 0x5DE7 +0xA5AA 0x5DE6 +0xA5AB 0xA5AC 0x5E02 +0xA5AD 0x5E73 +0xA5AE 0x5E7C +0xA5AF 0x5F01 +0xA5B0 0x5F18 +0xA5B1 0x5F17 +0xA5B2 0x5FC5 +0xA5B3 0x620A +0xA5B4 0xA5B5 0x6253 +0xA5B6 0x6252 +0xA5B7 0x6251 +0xA5B8 0x65A5 +0xA5B9 0x65E6 +0xA5BA 0x672E +0xA5BB 0x672C +0xA5BC 0xA5BD 0x672A +0xA5BE 0x672D +0xA5BF 0x6B63 +0xA5C0 0x6BCD +0xA5C1 0x6C11 +0xA5C2 0x6C10 +0xA5C3 0x6C38 +0xA5C4 0x6C41 +0xA5C5 0x6C40 +0xA5C6 0x6C3E +0xA5C7 0x72AF +0xA5C8 0x7384 +0xA5C9 0x7389 +0xA5CA 0x74DC +0xA5CB 0x74E6 +0xA5CC 0x7518 +0xA5CD 0x751F +0xA5CE 0xA5CF 0x7528 +0xA5D0 0xA5D3 0x7530 +0xA5D4 0x758B +0xA5D5 0x767D +0xA5D6 0x76AE +0xA5D7 0x76BF +0xA5D8 0x76EE +0xA5D9 0x77DB +0xA5DA 0x77E2 +0xA5DB 0x77F3 +0xA5DC 0x793A +0xA5DD 0x79BE +0xA5DE 0x7A74 +0xA5DF 0x7ACB +0xA5E0 0xA5E1 0x4E1E +0xA5E2 0xA5E3 0x4E52 +0xA5E4 0x4E69 +0xA5E5 0x4E99 +0xA5E6 0x4EA4 +0xA5E7 0x4EA6 +0xA5E8 0x4EA5 +0xA5E9 0x4EFF +0xA5EA 0x4F09 +0xA5EB 0x4F19 +0xA5EC 0x4F0A +0xA5ED 0x4F15 +0xA5EE 0x4F0D +0xA5EF 0xA5F0 0x4F10 +0xA5F1 0x4F0F +0xA5F2 0x4EF2 +0xA5F3 0x4EF6 +0xA5F4 0x4EFB +0xA5F5 0x4EF0 +0xA5F6 0x4EF3 +0xA5F7 0x4EFD +0xA5F8 0x4F01 +0xA5F9 0x4F0B +0xA5FA 0x5149 +0xA5FB 0x5147 +0xA5FC 0x5146 +0xA5FD 0x5148 +0xA5FE 0x5168 +0xA640 0x5171 +0xA641 0x518D +0xA642 0x51B0 +0xA643 0x5217 +0xA644 0xA645 0x5211 +0xA646 0x520E +0xA647 0x5216 +0xA648 0x52A3 +0xA649 0x5308 +0xA64A 0x5321 +0xA64B 0x5320 +0xA64C 0xA64D 0x5370 +0xA64E 0x5409 +0xA64F 0x540F +0xA650 0x540C +0xA651 0x540A +0xA652 0x5410 +0xA653 0x5401 +0xA654 0x540B +0xA655 0x5404 +0xA656 0x5411 +0xA657 0x540D +0xA658 0x5408 +0xA659 0x5403 +0xA65A 0x540E +0xA65B 0x5406 +0xA65C 0x5412 +0xA65D 0x56E0 +0xA65E 0x56DE +0xA65F 0x56DD +0xA660 0x5733 +0xA661 0x5730 +0xA662 0x5728 +0xA663 0x572D +0xA664 0x572C +0xA665 0x572F +0xA666 0x5729 +0xA667 0xA668 0x5919 +0xA669 0xA66A 0x5937 +0xA66B 0x5984 +0xA66C 0x5978 +0xA66D 0x5983 +0xA66E 0x597D +0xA66F 0x5979 +0xA670 0x5982 +0xA671 0x5981 +0xA672 0xA673 0x5B57 +0xA674 0xA675 0x5B87 +0xA676 0x5B85 +0xA677 0x5B89 +0xA678 0x5BFA +0xA679 0x5C16 +0xA67A 0x5C79 +0xA67B 0x5DDE +0xA67C 0x5E06 +0xA67D 0x5E76 +0xA67E 0x5E74 +0xA6A1 0x5F0F +0xA6A2 0x5F1B +0xA6A3 0x5FD9 +0xA6A4 0x5FD6 +0xA6A5 0x620E +0xA6A6 0xA6A7 0x620C +0xA6A8 0x6210 +0xA6A9 0x6263 +0xA6AA 0x625B +0xA6AB 0x6258 +0xA6AC 0x6536 +0xA6AD 0x65E9 +0xA6AE 0x65E8 +0xA6AF 0xA6B0 0x65EC +0xA6B1 0xA6B2 0x66F2 +0xA6B3 0x6709 +0xA6B4 0x673D +0xA6B5 0x6734 +0xA6B6 0x6731 +0xA6B7 0x6735 +0xA6B8 0x6B21 +0xA6B9 0x6B64 +0xA6BA 0x6B7B +0xA6BB 0x6C16 +0xA6BC 0x6C5D +0xA6BD 0x6C57 +0xA6BE 0x6C59 +0xA6BF 0xA6C0 0x6C5F +0xA6C1 0x6C50 +0xA6C2 0x6C55 +0xA6C3 0x6C61 +0xA6C4 0x6C5B +0xA6C5 0xA6C6 0x6C4D +0xA6C7 0x7070 +0xA6C8 0x725F +0xA6C9 0x725D +0xA6CA 0x767E +0xA6CB 0x7AF9 +0xA6CC 0x7C73 +0xA6CD 0x7CF8 +0xA6CE 0x7F36 +0xA6CF 0x7F8A +0xA6D0 0x7FBD +0xA6D1 0x8001 +0xA6D2 0x8003 +0xA6D3 0x800C +0xA6D4 0x8012 +0xA6D5 0x8033 +0xA6D6 0x807F +0xA6D7 0x8089 +0xA6D8 0xA6D9 0x808B +0xA6DA 0x81E3 +0xA6DB 0x81EA +0xA6DC 0x81F3 +0xA6DD 0x81FC +0xA6DE 0x820C +0xA6DF 0x821B +0xA6E0 0x821F +0xA6E1 0x826E +0xA6E2 0x8272 +0xA6E3 0x827E +0xA6E4 0x866B +0xA6E5 0x8840 +0xA6E6 0x884C +0xA6E7 0x8863 +0xA6E8 0x897F +0xA6E9 0x9621 +0xA6EA 0x4E32 +0xA6EB 0x4EA8 +0xA6EC 0x4F4D +0xA6ED 0x4F4F +0xA6EE 0x4F47 +0xA6EF 0x4F57 +0xA6F0 0x4F5E +0xA6F1 0x4F34 +0xA6F2 0x4F5B +0xA6F3 0x4F55 +0xA6F4 0x4F30 +0xA6F5 0xA6F6 0x4F50 +0xA6F7 0x4F3D +0xA6F8 0x4F3A +0xA6F9 0x4F38 +0xA6FA 0x4F43 +0xA6FB 0x4F54 +0xA6FC 0x4F3C +0xA6FD 0x4F46 +0xA6FE 0x4F63 +0xA740 0x4F5C +0xA741 0x4F60 +0xA742 0x4F2F +0xA743 0x4F4E +0xA744 0x4F36 +0xA745 0x4F59 +0xA746 0x4F5D +0xA747 0x4F48 +0xA748 0x4F5A +0xA749 0x514C +0xA74A 0x514B +0xA74B 0x514D +0xA74C 0x5175 +0xA74D 0xA74E 0x51B6 +0xA74F 0x5225 +0xA750 0x5224 +0xA751 0xA752 0x5229 +0xA753 0x5228 +0xA754 0x52AB +0xA755 0xA756 0x52A9 +0xA757 0x52AC +0xA758 0x5323 +0xA759 0x5373 +0xA75A 0x5375 +0xA75B 0x541D +0xA75C 0x542D +0xA75D 0x541E +0xA75E 0x543E +0xA75F 0x5426 +0xA760 0x544E +0xA761 0x5427 +0xA762 0x5446 +0xA763 0x5443 +0xA764 0x5433 +0xA765 0x5448 +0xA766 0x5442 +0xA767 0x541B +0xA768 0x5429 +0xA769 0x544A +0xA76A 0x5439 +0xA76B 0x543B +0xA76C 0x5438 +0xA76D 0x542E +0xA76E 0xA76F 0x5435 +0xA770 0x5420 +0xA771 0x543C +0xA772 0x5440 +0xA773 0x5431 +0xA774 0x542B +0xA775 0x541F +0xA776 0x542C +0xA777 0x56EA +0xA778 0x56F0 +0xA779 0x56E4 +0xA77A 0x56EB +0xA77B 0x574A +0xA77C 0x5751 +0xA77D 0x5740 +0xA77E 0x574D +0xA7A1 0x5747 +0xA7A2 0x574E +0xA7A3 0x573E +0xA7A4 0x5750 +0xA7A5 0x574F +0xA7A6 0x573B +0xA7A7 0x58EF +0xA7A8 0x593E +0xA7A9 0x599D +0xA7AA 0x5992 +0xA7AB 0x59A8 +0xA7AC 0x599E +0xA7AD 0x59A3 +0xA7AE 0x5999 +0xA7AF 0x5996 +0xA7B0 0x598D +0xA7B1 0x59A4 +0xA7B2 0x5993 +0xA7B3 0x598A +0xA7B4 0x59A5 +0xA7B5 0x5B5D +0xA7B6 0x5B5C +0xA7B7 0xA7B8 0x5B5A +0xA7B9 0x5B8C +0xA7BA 0x5B8B +0xA7BB 0x5B8F +0xA7BC 0x5C2C +0xA7BD 0xA7BE 0x5C40 +0xA7BF 0x5C3F +0xA7C0 0x5C3E +0xA7C1 0xA7C2 0x5C90 +0xA7C3 0x5C94 +0xA7C4 0x5C8C +0xA7C5 0x5DEB +0xA7C6 0x5E0C +0xA7C7 0x5E8F +0xA7C8 0x5E87 +0xA7C9 0x5E8A +0xA7CA 0x5EF7 +0xA7CB 0x5F04 +0xA7CC 0x5F1F +0xA7CD 0x5F64 +0xA7CE 0x5F62 +0xA7CF 0x5F77 +0xA7D0 0x5F79 +0xA7D1 0x5FD8 +0xA7D2 0x5FCC +0xA7D3 0x5FD7 +0xA7D4 0x5FCD +0xA7D5 0x5FF1 +0xA7D6 0x5FEB +0xA7D7 0x5FF8 +0xA7D8 0x5FEA +0xA7D9 0x6212 +0xA7DA 0x6211 +0xA7DB 0x6284 +0xA7DC 0x6297 +0xA7DD 0x6296 +0xA7DE 0x6280 +0xA7DF 0x6276 +0xA7E0 0x6289 +0xA7E1 0x626D +0xA7E2 0x628A +0xA7E3 0x627C +0xA7E4 0x627E +0xA7E5 0x6279 +0xA7E6 0x6273 +0xA7E7 0x6292 +0xA7E8 0x626F +0xA7E9 0x6298 +0xA7EA 0x626E +0xA7EB 0x6295 +0xA7EC 0x6293 +0xA7ED 0x6291 +0xA7EE 0x6286 +0xA7EF 0x6539 +0xA7F0 0x653B +0xA7F1 0x6538 +0xA7F2 0x65F1 +0xA7F3 0x66F4 +0xA7F4 0x675F +0xA7F5 0xA7F8 0x674E +0xA7F9 0x675C +0xA7FA 0x6756 +0xA7FB 0x675E +0xA7FC 0x6749 +0xA7FD 0x6746 +0xA7FE 0x6760 +0xA840 0x6753 +0xA841 0x6757 +0xA842 0x6B65 +0xA843 0x6BCF +0xA844 0x6C42 +0xA845 0x6C5E +0xA846 0x6C99 +0xA847 0x6C81 +0xA848 0xA849 0x6C88 +0xA84A 0x6C85 +0xA84B 0x6C9B +0xA84C 0x6C6A +0xA84D 0x6C7A +0xA84E 0x6C90 +0xA84F 0x6C70 +0xA850 0x6C8C +0xA851 0x6C68 +0xA852 0x6C96 +0xA853 0x6C92 +0xA854 0x6C7D +0xA855 0x6C83 +0xA856 0x6C72 +0xA857 0x6C7E +0xA858 0x6C74 +0xA859 0x6C86 +0xA85A 0x6C76 +0xA85B 0x6C8D +0xA85C 0x6C94 +0xA85D 0x6C98 +0xA85E 0x6C82 +0xA85F 0x7076 +0xA860 0xA861 0x707C +0xA862 0x7078 +0xA863 0x7262 +0xA864 0x7261 +0xA865 0x7260 +0xA866 0x72C4 +0xA867 0x72C2 +0xA868 0x7396 +0xA869 0x752C +0xA86A 0x752B +0xA86B 0xA86C 0x7537 +0xA86D 0x7682 +0xA86E 0x76EF +0xA86F 0x77E3 +0xA870 0x79C1 +0xA871 0x79C0 +0xA872 0x79BF +0xA873 0x7A76 +0xA874 0x7CFB +0xA875 0x7F55 +0xA876 0x8096 +0xA877 0x8093 +0xA878 0x809D +0xA879 0x8098 +0xA87A 0x809B +0xA87B 0x809A +0xA87C 0x80B2 +0xA87D 0x826F +0xA87E 0x8292 +0xA8A1 0x828B +0xA8A2 0x828D +0xA8A3 0x898B +0xA8A4 0x89D2 +0xA8A5 0x8A00 +0xA8A6 0x8C37 +0xA8A7 0x8C46 +0xA8A8 0x8C55 +0xA8A9 0x8C9D +0xA8AA 0x8D64 +0xA8AB 0x8D70 +0xA8AC 0x8DB3 +0xA8AD 0x8EAB +0xA8AE 0x8ECA +0xA8AF 0x8F9B +0xA8B0 0x8FB0 +0xA8B1 0x8FC2 +0xA8B2 0x8FC6 +0xA8B3 0x8FC5 +0xA8B4 0x8FC4 +0xA8B5 0x5DE1 +0xA8B6 0x9091 +0xA8B7 0x90A2 +0xA8B8 0x90AA +0xA8B9 0x90A6 +0xA8BA 0x90A3 +0xA8BB 0x9149 +0xA8BC 0x91C6 +0xA8BD 0x91CC +0xA8BE 0x9632 +0xA8BF 0x962E +0xA8C0 0x9631 +0xA8C1 0x962A +0xA8C2 0x962C +0xA8C3 0x4E26 +0xA8C4 0x4E56 +0xA8C5 0x4E73 +0xA8C6 0x4E8B +0xA8C7 0x4E9B +0xA8C8 0x4E9E +0xA8C9 0xA8CA 0x4EAB +0xA8CB 0x4F6F +0xA8CC 0x4F9D +0xA8CD 0x4F8D +0xA8CE 0x4F73 +0xA8CF 0x4F7F +0xA8D0 0x4F6C +0xA8D1 0x4F9B +0xA8D2 0x4F8B +0xA8D3 0x4F86 +0xA8D4 0x4F83 +0xA8D5 0x4F70 +0xA8D6 0x4F75 +0xA8D7 0x4F88 +0xA8D8 0x4F69 +0xA8D9 0x4F7B +0xA8DA 0x4F96 +0xA8DB 0x4F7E +0xA8DC 0x4F8F +0xA8DD 0x4F91 +0xA8DE 0x4F7A +0xA8DF 0x5154 +0xA8E0 0x5152 +0xA8E1 0x5155 +0xA8E2 0x5169 +0xA8E3 0x5177 +0xA8E4 0x5176 +0xA8E5 0x5178 +0xA8E6 0x51BD +0xA8E7 0x51FD +0xA8E8 0x523B +0xA8E9 0x5238 +0xA8EA 0x5237 +0xA8EB 0x523A +0xA8EC 0x5230 +0xA8ED 0x522E +0xA8EE 0x5236 +0xA8EF 0x5241 +0xA8F0 0x52BE +0xA8F1 0x52BB +0xA8F2 0x5352 +0xA8F3 0x5354 +0xA8F4 0x5353 +0xA8F5 0x5351 +0xA8F6 0x5366 +0xA8F7 0xA8F9 0x5377 +0xA8FA 0x53D6 +0xA8FB 0x53D4 +0xA8FC 0x53D7 +0xA8FD 0x5473 +0xA8FE 0x5475 +0xA940 0x5496 +0xA941 0x5478 +0xA942 0x5495 +0xA943 0x5480 +0xA944 0x547B +0xA945 0x5477 +0xA946 0x5484 +0xA947 0x5492 +0xA948 0x5486 +0xA949 0x547C +0xA94A 0x5490 +0xA94B 0x5471 +0xA94C 0x5476 +0xA94D 0x548C +0xA94E 0x549A +0xA94F 0x5462 +0xA950 0x5468 +0xA951 0x548B +0xA952 0x547D +0xA953 0x548E +0xA954 0x56FA +0xA955 0x5783 +0xA956 0x5777 +0xA957 0x576A +0xA958 0x5769 +0xA959 0x5761 +0xA95A 0x5766 +0xA95B 0x5764 +0xA95C 0x577C +0xA95D 0x591C +0xA95E 0x5949 +0xA95F 0xA960 0x5947 +0xA961 0x5944 +0xA962 0x5954 +0xA963 0x59BE +0xA964 0x59BB +0xA965 0x59D4 +0xA966 0x59B9 +0xA967 0x59AE +0xA968 0x59D1 +0xA969 0x59C6 +0xA96A 0x59D0 +0xA96B 0x59CD +0xA96C 0x59CB +0xA96D 0x59D3 +0xA96E 0x59CA +0xA96F 0x59AF +0xA970 0x59B3 +0xA971 0x59D2 +0xA972 0x59C5 +0xA973 0x5B5F +0xA974 0x5B64 +0xA975 0x5B63 +0xA976 0x5B97 +0xA977 0x5B9A +0xA978 0x5B98 +0xA979 0x5B9C +0xA97A 0x5B99 +0xA97B 0x5B9B +0xA97C 0x5C1A +0xA97D 0x5C48 +0xA97E 0x5C45 +0xA9A1 0x5C46 +0xA9A2 0x5CB7 +0xA9A3 0x5CA1 +0xA9A4 0x5CB8 +0xA9A5 0x5CA9 +0xA9A6 0x5CAB +0xA9A7 0x5CB1 +0xA9A8 0x5CB3 +0xA9A9 0x5E18 +0xA9AA 0x5E1A +0xA9AB 0x5E16 +0xA9AC 0x5E15 +0xA9AD 0x5E1B +0xA9AE 0x5E11 +0xA9AF 0x5E78 +0xA9B0 0x5E9A +0xA9B1 0x5E97 +0xA9B2 0x5E9C +0xA9B3 0xA9B4 0x5E95 +0xA9B5 0x5EF6 +0xA9B6 0xA9B7 0x5F26 +0xA9B8 0x5F29 +0xA9B9 0xA9BA 0x5F80 +0xA9BB 0x5F7F +0xA9BC 0x5F7C +0xA9BD 0x5FDD +0xA9BE 0x5FE0 +0xA9BF 0x5FFD +0xA9C0 0x5FF5 +0xA9C1 0x5FFF +0xA9C2 0x600F +0xA9C3 0x6014 +0xA9C4 0x602F +0xA9C5 0x6035 +0xA9C6 0x6016 +0xA9C7 0x602A +0xA9C8 0x6015 +0xA9C9 0x6021 +0xA9CA 0x6027 +0xA9CB 0x6029 +0xA9CC 0x602B +0xA9CD 0x601B +0xA9CE 0x6216 +0xA9CF 0x6215 +0xA9D0 0x623F +0xA9D1 0x623E +0xA9D2 0x6240 +0xA9D3 0x627F +0xA9D4 0x62C9 +0xA9D5 0x62CC +0xA9D6 0x62C4 +0xA9D7 0x62BF +0xA9D8 0x62C2 +0xA9D9 0x62B9 +0xA9DA 0x62D2 +0xA9DB 0x62DB +0xA9DC 0x62AB +0xA9DD 0xA9DE 0x62D3 +0xA9DF 0x62CB +0xA9E0 0x62C8 +0xA9E1 0x62A8 +0xA9E2 0x62BD +0xA9E3 0x62BC +0xA9E4 0x62D0 +0xA9E5 0x62D9 +0xA9E6 0x62C7 +0xA9E7 0x62CD +0xA9E8 0x62B5 +0xA9E9 0x62DA +0xA9EA 0x62B1 +0xA9EB 0x62D8 +0xA9EC 0xA9ED 0x62D6 +0xA9EE 0x62C6 +0xA9EF 0x62AC +0xA9F0 0x62CE +0xA9F1 0x653E +0xA9F2 0x65A7 +0xA9F3 0x65BC +0xA9F4 0x65FA +0xA9F5 0x6614 +0xA9F6 0x6613 +0xA9F7 0x660C +0xA9F8 0x6606 +0xA9F9 0x6602 +0xA9FA 0x660E +0xA9FB 0x6600 +0xA9FC 0x660F +0xA9FD 0x6615 +0xA9FE 0x660A +0xAA40 0x6607 +0xAA41 0x670D +0xAA42 0x670B +0xAA43 0x676D +0xAA44 0x678B +0xAA45 0x6795 +0xAA46 0x6771 +0xAA47 0x679C +0xAA48 0x6773 +0xAA49 0x6777 +0xAA4A 0x6787 +0xAA4B 0x679D +0xAA4C 0x6797 +0xAA4D 0xAA4E 0x676F +0xAA4F 0x677F +0xAA50 0x6789 +0xAA51 0x677E +0xAA52 0x6790 +0xAA53 0x6775 +0xAA54 0x679A +0xAA55 0x6793 +0xAA56 0x677C +0xAA57 0x676A +0xAA58 0x6772 +0xAA59 0x6B23 +0xAA5A 0xAA5B 0x6B66 +0xAA5C 0x6B7F +0xAA5D 0x6C13 +0xAA5E 0x6C1B +0xAA5F 0x6CE3 +0xAA60 0x6CE8 +0xAA61 0x6CF3 +0xAA62 0x6CB1 +0xAA63 0x6CCC +0xAA64 0x6CE5 +0xAA65 0x6CB3 +0xAA66 0xAA67 0x6CBD +0xAA68 0x6CBC +0xAA69 0x6CE2 +0xAA6A 0x6CAB +0xAA6B 0x6CD5 +0xAA6C 0x6CD3 +0xAA6D 0x6CB8 +0xAA6E 0x6CC4 +0xAA6F 0x6CB9 +0xAA70 0x6CC1 +0xAA71 0x6CAE +0xAA72 0x6CD7 +0xAA73 0x6CC5 +0xAA74 0x6CF1 +0xAA75 0x6CBF +0xAA76 0x6CBB +0xAA77 0x6CE1 +0xAA78 0x6CDB +0xAA79 0x6CCA +0xAA7A 0x6CAC +0xAA7B 0x6CEF +0xAA7C 0x6CDC +0xAA7D 0x6CD6 +0xAA7E 0x6CE0 +0xAAA1 0x7095 +0xAAA2 0x708E +0xAAA3 0x7092 +0xAAA4 0x708A +0xAAA5 0x7099 +0xAAA6 0xAAA7 0x722C +0xAAA8 0x7238 +0xAAA9 0x7248 +0xAAAA 0x7267 +0xAAAB 0x7269 +0xAAAC 0x72C0 +0xAAAD 0x72CE +0xAAAE 0x72D9 +0xAAAF 0x72D7 +0xAAB0 0x72D0 +0xAAB1 0x73A9 +0xAAB2 0x73A8 +0xAAB3 0x739F +0xAAB4 0x73AB +0xAAB5 0x73A5 +0xAAB6 0x753D +0xAAB7 0x759D +0xAAB8 0xAAB9 0x7599 +0xAABA 0x7684 +0xAABB 0x76C2 +0xAABC 0x76F2 +0xAABD 0x76F4 +0xAABE 0x77E5 +0xAABF 0x77FD +0xAAC0 0x793E +0xAAC1 0xAAC2 0x7940 +0xAAC3 0x79C9 +0xAAC4 0x79C8 +0xAAC5 0x7A7A +0xAAC6 0x7A79 +0xAAC7 0x7AFA +0xAAC8 0x7CFE +0xAAC9 0x7F54 +0xAACA 0x7F8C +0xAACB 0x7F8B +0xAACC 0x8005 +0xAACD 0x80BA +0xAACE 0x80A5 +0xAACF 0x80A2 +0xAAD0 0x80B1 +0xAAD1 0x80A1 +0xAAD2 0x80AB +0xAAD3 0x80A9 +0xAAD4 0x80B4 +0xAAD5 0x80AA +0xAAD6 0x80AF +0xAAD7 0x81E5 +0xAAD8 0x81FE +0xAAD9 0x820D +0xAADA 0x82B3 +0xAADB 0x829D +0xAADC 0x8299 +0xAADD 0x82AD +0xAADE 0x82BD +0xAADF 0x829F +0xAAE0 0x82B9 +0xAAE1 0x82B1 +0xAAE2 0x82AC +0xAAE3 0x82A5 +0xAAE4 0x82AF +0xAAE5 0x82B8 +0xAAE6 0x82A3 +0xAAE7 0x82B0 +0xAAE8 0x82BE +0xAAE9 0x82B7 +0xAAEA 0x864E +0xAAEB 0x8671 +0xAAEC 0x521D +0xAAED 0x8868 +0xAAEE 0x8ECB +0xAAEF 0x8FCE +0xAAF0 0x8FD4 +0xAAF1 0x8FD1 +0xAAF2 0x90B5 +0xAAF3 0x90B8 +0xAAF4 0x90B1 +0xAAF5 0x90B6 +0xAAF6 0x91C7 +0xAAF7 0x91D1 +0xAAF8 0x9577 +0xAAF9 0x9580 +0xAAFA 0x961C +0xAAFB 0x9640 +0xAAFC 0x963F +0xAAFD 0x963B +0xAAFE 0x9644 +0xAB40 0x9642 +0xAB41 0x96B9 +0xAB42 0x96E8 +0xAB43 0x9752 +0xAB44 0x975E +0xAB45 0x4E9F +0xAB46 0xAB47 0x4EAD +0xAB48 0x4FE1 +0xAB49 0x4FB5 +0xAB4A 0x4FAF +0xAB4B 0x4FBF +0xAB4C 0x4FE0 +0xAB4D 0x4FD1 +0xAB4E 0x4FCF +0xAB4F 0x4FDD +0xAB50 0x4FC3 +0xAB51 0x4FB6 +0xAB52 0x4FD8 +0xAB53 0x4FDF +0xAB54 0x4FCA +0xAB55 0x4FD7 +0xAB56 0x4FAE +0xAB57 0x4FD0 +0xAB58 0x4FC4 +0xAB59 0x4FC2 +0xAB5A 0x4FDA +0xAB5B 0x4FCE +0xAB5C 0x4FDE +0xAB5D 0x4FB7 +0xAB5E 0x5157 +0xAB5F 0x5192 +0xAB60 0x5191 +0xAB61 0x51A0 +0xAB62 0x524E +0xAB63 0x5243 +0xAB64 0x524A +0xAB65 0x524D +0xAB66 0x524C +0xAB67 0x524B +0xAB68 0x5247 +0xAB69 0x52C7 +0xAB6A 0x52C9 +0xAB6B 0x52C3 +0xAB6C 0x52C1 +0xAB6D 0x530D +0xAB6E 0x5357 +0xAB6F 0x537B +0xAB70 0x539A +0xAB71 0x53DB +0xAB72 0x54AC +0xAB73 0x54C0 +0xAB74 0x54A8 +0xAB75 0x54CE +0xAB76 0x54C9 +0xAB77 0x54B8 +0xAB78 0x54A6 +0xAB79 0x54B3 +0xAB7A 0x54C7 +0xAB7B 0x54C2 +0xAB7C 0x54BD +0xAB7D 0x54AA +0xAB7E 0x54C1 +0xABA1 0x54C4 +0xABA2 0x54C8 +0xABA3 0x54AF +0xABA4 0x54AB +0xABA5 0x54B1 +0xABA6 0x54BB +0xABA7 0x54A9 +0xABA8 0x54A7 +0xABA9 0x54BF +0xABAA 0x56FF +0xABAB 0x5782 +0xABAC 0x578B +0xABAD 0x57A0 +0xABAE 0x57A3 +0xABAF 0x57A2 +0xABB0 0x57CE +0xABB1 0x57AE +0xABB2 0x5793 +0xABB3 0x5955 +0xABB4 0x5951 +0xABB5 0x594F +0xABB6 0x594E +0xABB7 0x5950 +0xABB8 0x59DC +0xABB9 0x59D8 +0xABBA 0x59FF +0xABBB 0x59E3 +0xABBC 0x59E8 +0xABBD 0x5A03 +0xABBE 0x59E5 +0xABBF 0x59EA +0xABC0 0x59DA +0xABC1 0x59E6 +0xABC2 0x5A01 +0xABC3 0x59FB +0xABC4 0x5B69 +0xABC5 0x5BA3 +0xABC6 0x5BA6 +0xABC7 0x5BA4 +0xABC8 0x5BA2 +0xABC9 0x5BA5 +0xABCA 0x5C01 +0xABCB 0xABCC 0x5C4E +0xABCD 0x5C4D +0xABCE 0x5C4B +0xABCF 0x5CD9 +0xABD0 0x5CD2 +0xABD1 0x5DF7 +0xABD2 0x5E1D +0xABD3 0x5E25 +0xABD4 0x5E1F +0xABD5 0x5E7D +0xABD6 0x5EA0 +0xABD7 0x5EA6 +0xABD8 0x5EFA +0xABD9 0x5F08 +0xABDA 0x5F2D +0xABDB 0x5F65 +0xABDC 0x5F88 +0xABDD 0x5F85 +0xABDE 0xABDF 0x5F8A +0xABE0 0x5F87 +0xABE1 0x5F8C +0xABE2 0x5F89 +0xABE3 0x6012 +0xABE4 0x601D +0xABE5 0x6020 +0xABE6 0x6025 +0xABE7 0x600E +0xABE8 0x6028 +0xABE9 0x604D +0xABEA 0x6070 +0xABEB 0x6068 +0xABEC 0x6062 +0xABED 0x6046 +0xABEE 0x6043 +0xABEF 0x606C +0xABF0 0x606B +0xABF1 0x606A +0xABF2 0x6064 +0xABF3 0x6241 +0xABF4 0x62DC +0xABF5 0x6316 +0xABF6 0x6309 +0xABF7 0x62FC +0xABF8 0x62ED +0xABF9 0x6301 +0xABFA 0x62EE +0xABFB 0x62FD +0xABFC 0x6307 +0xABFD 0x62F1 +0xABFE 0x62F7 +0xAC40 0x62EF +0xAC41 0x62EC +0xAC42 0x62FE +0xAC43 0x62F4 +0xAC44 0x6311 +0xAC45 0x6302 +0xAC46 0x653F +0xAC47 0x6545 +0xAC48 0x65AB +0xAC49 0x65BD +0xAC4A 0x65E2 +0xAC4B 0x6625 +0xAC4C 0x662D +0xAC4D 0x6620 +0xAC4E 0x6627 +0xAC4F 0x662F +0xAC50 0x661F +0xAC51 0x6628 +0xAC52 0x6631 +0xAC53 0x6624 +0xAC54 0x66F7 +0xAC55 0x67FF +0xAC56 0x67D3 +0xAC57 0x67F1 +0xAC58 0x67D4 +0xAC59 0x67D0 +0xAC5A 0x67EC +0xAC5B 0x67B6 +0xAC5C 0x67AF +0xAC5D 0x67F5 +0xAC5E 0x67E9 +0xAC5F 0x67EF +0xAC60 0x67C4 +0xAC61 0x67D1 +0xAC62 0x67B4 +0xAC63 0x67DA +0xAC64 0x67E5 +0xAC65 0x67B8 +0xAC66 0x67CF +0xAC67 0x67DE +0xAC68 0x67F3 +0xAC69 0x67B0 +0xAC6A 0x67D9 +0xAC6B 0x67E2 +0xAC6C 0x67DD +0xAC6D 0x67D2 +0xAC6E 0x6B6A +0xAC6F 0x6B83 +0xAC70 0x6B86 +0xAC71 0x6BB5 +0xAC72 0x6BD2 +0xAC73 0x6BD7 +0xAC74 0x6C1F +0xAC75 0x6CC9 +0xAC76 0x6D0B +0xAC77 0x6D32 +0xAC78 0x6D2A +0xAC79 0x6D41 +0xAC7A 0x6D25 +0xAC7B 0x6D0C +0xAC7C 0x6D31 +0xAC7D 0x6D1E +0xAC7E 0x6D17 +0xACA1 0x6D3B +0xACA2 0xACA3 0x6D3D +0xACA4 0x6D36 +0xACA5 0x6D1B +0xACA6 0x6CF5 +0xACA7 0x6D39 +0xACA8 0x6D27 +0xACA9 0x6D38 +0xACAA 0x6D29 +0xACAB 0x6D2E +0xACAC 0x6D35 +0xACAD 0x6D0E +0xACAE 0x6D2B +0xACAF 0x70AB +0xACB0 0x70BA +0xACB1 0x70B3 +0xACB2 0x70AC +0xACB3 0x70AF +0xACB4 0x70AD +0xACB5 0x70B8 +0xACB6 0x70AE +0xACB7 0x70A4 +0xACB8 0x7230 +0xACB9 0x7272 +0xACBA 0x726F +0xACBB 0x7274 +0xACBC 0x72E9 +0xACBD 0xACBE 0x72E0 +0xACBF 0x73B7 +0xACC0 0x73CA +0xACC1 0x73BB +0xACC2 0x73B2 +0xACC3 0x73CD +0xACC4 0x73C0 +0xACC5 0x73B3 +0xACC6 0x751A +0xACC7 0x752D +0xACC8 0x754F +0xACC9 0x754C +0xACCA 0x754E +0xACCB 0x754B +0xACCC 0x75AB +0xACCD 0xACCE 0x75A4 +0xACCF 0xACD0 0x75A2 +0xACD1 0x7678 +0xACD2 0xACD4 0x7686 +0xACD5 0x76C8 +0xACD6 0x76C6 +0xACD7 0x76C3 +0xACD8 0x76C5 +0xACD9 0x7701 +0xACDA 0x76F9 +0xACDB 0x76F8 +0xACDC 0x7709 +0xACDD 0x770B +0xACDE 0x76FE +0xACDF 0x76FC +0xACE0 0x7707 +0xACE1 0x77DC +0xACE2 0x7802 +0xACE3 0x7814 +0xACE4 0xACE5 0x780C +0xACE6 0x7946 +0xACE7 0x7949 +0xACE8 0x7948 +0xACE9 0x7947 +0xACEA 0xACEB 0x79B9 +0xACEC 0xACED 0x79D1 +0xACEE 0x79CB +0xACEF 0x7A7F +0xACF0 0x7A81 +0xACF1 0x7AFF +0xACF2 0x7AFD +0xACF3 0x7C7D +0xACF4 0x7D02 +0xACF5 0x7D05 +0xACF6 0x7D00 +0xACF7 0x7D09 +0xACF8 0x7D07 +0xACF9 0x7D04 +0xACFA 0x7D06 +0xACFB 0x7F38 +0xACFC 0x7F8E +0xACFD 0x7FBF +0xACFE 0x8004 +0xAD40 0x8010 +0xAD41 0x800D +0xAD42 0x8011 +0xAD43 0x8036 +0xAD44 0x80D6 +0xAD45 0x80E5 +0xAD46 0x80DA +0xAD47 0xAD48 0x80C3 +0xAD49 0x80CC +0xAD4A 0x80E1 +0xAD4B 0x80DB +0xAD4C 0x80CE +0xAD4D 0x80DE +0xAD4E 0x80E4 +0xAD4F 0x80DD +0xAD50 0x81F4 +0xAD51 0x8222 +0xAD52 0x82E7 +0xAD53 0x8303 +0xAD54 0x8305 +0xAD55 0x82E3 +0xAD56 0x82DB +0xAD57 0x82E6 +0xAD58 0x8304 +0xAD59 0x82E5 +0xAD5A 0x8302 +0xAD5B 0x8309 +0xAD5C 0x82D2 +0xAD5D 0x82D7 +0xAD5E 0x82F1 +0xAD5F 0x8301 +0xAD60 0x82DC +0xAD61 0x82D4 +0xAD62 0x82D1 +0xAD63 0x82DE +0xAD64 0x82D3 +0xAD65 0x82DF +0xAD66 0x82EF +0xAD67 0x8306 +0xAD68 0x8650 +0xAD69 0x8679 +0xAD6A 0x867B +0xAD6B 0x867A +0xAD6C 0x884D +0xAD6D 0x886B +0xAD6E 0x8981 +0xAD6F 0x89D4 +0xAD70 0x8A08 +0xAD71 0xAD72 0x8A02 +0xAD73 0x8C9E +0xAD74 0x8CA0 +0xAD75 0x8D74 +0xAD76 0x8D73 +0xAD77 0x8DB4 +0xAD78 0x8ECD +0xAD79 0x8ECC +0xAD7A 0x8FF0 +0xAD7B 0x8FE6 +0xAD7C 0x8FE2 +0xAD7D 0x8FEA +0xAD7E 0x8FE5 +0xADA1 0x8FED +0xADA2 0x8FEB +0xADA3 0x8FE4 +0xADA4 0x8FE8 +0xADA5 0x90CA +0xADA6 0x90CE +0xADA7 0x90C1 +0xADA8 0x90C3 +0xADA9 0x914B +0xADAA 0x914A +0xADAB 0x91CD +0xADAC 0x9582 +0xADAD 0x9650 +0xADAE 0xADB0 0x964B +0xADB1 0x9762 +0xADB2 0x9769 +0xADB3 0x97CB +0xADB4 0x97ED +0xADB5 0x97F3 +0xADB6 0x9801 +0xADB7 0x98A8 +0xADB8 0x98DB +0xADB9 0x98DF +0xADBA 0x9996 +0xADBB 0x9999 +0xADBC 0x4E58 +0xADBD 0x4EB3 +0xADBE 0xADBF 0x500C +0xADC0 0x5023 +0xADC1 0x4FEF +0xADC2 0x5026 +0xADC3 0x5025 +0xADC4 0x4FF8 +0xADC5 0x5029 +0xADC6 0x5016 +0xADC7 0x5006 +0xADC8 0x503C +0xADC9 0x501F +0xADCA 0x501A +0xADCB 0x5012 +0xADCC 0x5011 +0xADCD 0x4FFA +0xADCE 0x5000 +0xADCF 0x5014 +0xADD0 0x5028 +0xADD1 0x4FF1 +0xADD2 0x5021 +0xADD3 0x500B +0xADD4 0x5019 +0xADD5 0x5018 +0xADD6 0x4FF3 +0xADD7 0x4FEE +0xADD8 0x502D +0xADD9 0x502A +0xADDA 0x4FFE +0xADDB 0x502B +0xADDC 0x5009 +0xADDD 0x517C +0xADDE 0xADDF 0x51A4 +0xADE0 0x51A2 +0xADE1 0x51CD +0xADE2 0x51CC +0xADE3 0x51C6 +0xADE4 0x51CB +0xADE5 0x5256 +0xADE6 0x525C +0xADE7 0x5254 +0xADE8 0x525B +0xADE9 0x525D +0xADEA 0x532A +0xADEB 0x537F +0xADEC 0x539F +0xADED 0x539D +0xADEE 0x53DF +0xADEF 0x54E8 +0xADF0 0x5510 +0xADF1 0x5501 +0xADF2 0x5537 +0xADF3 0x54FC +0xADF4 0x54E5 +0xADF5 0x54F2 +0xADF6 0x5506 +0xADF7 0x54FA +0xADF8 0x5514 +0xADF9 0x54E9 +0xADFA 0x54ED +0xADFB 0x54E1 +0xADFC 0x5509 +0xADFD 0x54EE +0xADFE 0x54EA +0xAE40 0x54E6 +0xAE41 0x5527 +0xAE42 0x5507 +0xAE43 0x54FD +0xAE44 0x550F +0xAE45 0xAE46 0x5703 +0xAE47 0x57C2 +0xAE48 0x57D4 +0xAE49 0x57CB +0xAE4A 0x57C3 +0xAE4B 0x5809 +0xAE4C 0x590F +0xAE4D 0xAE4E 0x5957 +0xAE4F 0x595A +0xAE50 0x5A11 +0xAE51 0x5A18 +0xAE52 0x5A1C +0xAE53 0x5A1F +0xAE54 0x5A1B +0xAE55 0x5A13 +0xAE56 0x59EC +0xAE57 0x5A20 +0xAE58 0x5A23 +0xAE59 0x5A29 +0xAE5A 0x5A25 +0xAE5B 0x5A0C +0xAE5C 0x5A09 +0xAE5D 0x5B6B +0xAE5E 0x5C58 +0xAE5F 0x5BB0 +0xAE60 0x5BB3 +0xAE61 0x5BB6 +0xAE62 0x5BB4 +0xAE63 0x5BAE +0xAE64 0x5BB5 +0xAE65 0x5BB9 +0xAE66 0x5BB8 +0xAE67 0x5C04 +0xAE68 0x5C51 +0xAE69 0x5C55 +0xAE6A 0x5C50 +0xAE6B 0x5CED +0xAE6C 0x5CFD +0xAE6D 0x5CFB +0xAE6E 0x5CEA +0xAE6F 0x5CE8 +0xAE70 0x5CF0 +0xAE71 0x5CF6 +0xAE72 0x5D01 +0xAE73 0x5CF4 +0xAE74 0x5DEE +0xAE75 0x5E2D +0xAE76 0x5E2B +0xAE77 0x5EAB +0xAE78 0x5EAD +0xAE79 0x5EA7 +0xAE7A 0x5F31 +0xAE7B 0x5F92 +0xAE7C 0x5F91 +0xAE7D 0x5F90 +0xAE7E 0x6059 +0xAEA1 0x6063 +0xAEA2 0x6065 +0xAEA3 0x6050 +0xAEA4 0x6055 +0xAEA5 0x606D +0xAEA6 0x6069 +0xAEA7 0x606F +0xAEA8 0x6084 +0xAEA9 0x609F +0xAEAA 0x609A +0xAEAB 0x608D +0xAEAC 0x6094 +0xAEAD 0x608C +0xAEAE 0x6085 +0xAEAF 0x6096 +0xAEB0 0x6247 +0xAEB1 0x62F3 +0xAEB2 0x6308 +0xAEB3 0x62FF +0xAEB4 0x634E +0xAEB5 0x633E +0xAEB6 0x632F +0xAEB7 0x6355 +0xAEB8 0x6342 +0xAEB9 0x6346 +0xAEBA 0x634F +0xAEBB 0x6349 +0xAEBC 0x633A +0xAEBD 0x6350 +0xAEBE 0x633D +0xAEBF 0xAEC0 0x632A +0xAEC1 0x6328 +0xAEC2 0x634D +0xAEC3 0x634C +0xAEC4 0xAEC5 0x6548 +0xAEC6 0x6599 +0xAEC7 0x65C1 +0xAEC8 0x65C5 +0xAEC9 0x6642 +0xAECA 0x6649 +0xAECB 0x664F +0xAECC 0x6643 +0xAECD 0x6652 +0xAECE 0x664C +0xAECF 0x6645 +0xAED0 0x6641 +0xAED1 0x66F8 +0xAED2 0xAED3 0x6714 +0xAED4 0x6717 +0xAED5 0x6821 +0xAED6 0x6838 +0xAED7 0x6848 +0xAED8 0x6846 +0xAED9 0x6853 +0xAEDA 0x6839 +0xAEDB 0x6842 +0xAEDC 0x6854 +0xAEDD 0x6829 +0xAEDE 0x68B3 +0xAEDF 0x6817 +0xAEE0 0x684C +0xAEE1 0x6851 +0xAEE2 0x683D +0xAEE3 0x67F4 +0xAEE4 0x6850 +0xAEE5 0x6840 +0xAEE6 0x683C +0xAEE7 0x6843 +0xAEE8 0x682A +0xAEE9 0x6845 +0xAEEA 0x6813 +0xAEEB 0x6818 +0xAEEC 0x6841 +0xAEED 0x6B8A +0xAEEE 0x6B89 +0xAEEF 0x6BB7 +0xAEF0 0x6C23 +0xAEF1 0xAEF2 0x6C27 +0xAEF3 0x6C26 +0xAEF4 0x6C24 +0xAEF5 0x6CF0 +0xAEF6 0x6D6A +0xAEF7 0x6D95 +0xAEF8 0x6D88 +0xAEF9 0x6D87 +0xAEFA 0x6D66 +0xAEFB 0x6D78 +0xAEFC 0x6D77 +0xAEFD 0x6D59 +0xAEFE 0x6D93 +0xAF40 0x6D6C +0xAF41 0x6D89 +0xAF42 0x6D6E +0xAF43 0x6D5A +0xAF44 0x6D74 +0xAF45 0x6D69 +0xAF46 0x6D8C +0xAF47 0x6D8A +0xAF48 0x6D79 +0xAF49 0x6D85 +0xAF4A 0x6D65 +0xAF4B 0x6D94 +0xAF4C 0x70CA +0xAF4D 0x70D8 +0xAF4E 0x70E4 +0xAF4F 0x70D9 +0xAF50 0x70C8 +0xAF51 0x70CF +0xAF52 0x7239 +0xAF53 0x7279 +0xAF54 0x72FC +0xAF55 0x72F9 +0xAF56 0x72FD +0xAF57 0x72F8 +0xAF58 0x72F7 +0xAF59 0x7386 +0xAF5A 0x73ED +0xAF5B 0x7409 +0xAF5C 0x73EE +0xAF5D 0x73E0 +0xAF5E 0x73EA +0xAF5F 0x73DE +0xAF60 0x7554 +0xAF61 0x755D +0xAF62 0x755C +0xAF63 0x755A +0xAF64 0x7559 +0xAF65 0x75BE +0xAF66 0x75C5 +0xAF67 0x75C7 +0xAF68 0xAF69 0x75B2 +0xAF6A 0x75BD +0xAF6B 0x75BC +0xAF6C 0x75B9 +0xAF6D 0x75C2 +0xAF6E 0x75B8 +0xAF6F 0x768B +0xAF70 0x76B0 +0xAF71 0x76CA +0xAF72 0xAF73 0x76CD +0xAF74 0x7729 +0xAF75 0xAF76 0x771F +0xAF77 0x7728 +0xAF78 0x77E9 +0xAF79 0x7830 +0xAF7A 0x7827 +0xAF7B 0x7838 +0xAF7C 0x781D +0xAF7D 0x7834 +0xAF7E 0x7837 +0xAFA1 0x7825 +0xAFA2 0x782D +0xAFA3 0x7820 +0xAFA4 0x781F +0xAFA5 0x7832 +0xAFA6 0x7955 +0xAFA7 0x7950 +0xAFA8 0x7960 +0xAFA9 0x795F +0xAFAA 0x7956 +0xAFAB 0x795E +0xAFAC 0x795D +0xAFAD 0x7957 +0xAFAE 0x795A +0xAFAF 0x79E4 +0xAFB0 0x79E3 +0xAFB1 0x79E7 +0xAFB2 0x79DF +0xAFB3 0x79E6 +0xAFB4 0x79E9 +0xAFB5 0x79D8 +0xAFB6 0x7A84 +0xAFB7 0x7A88 +0xAFB8 0x7AD9 +0xAFB9 0x7B06 +0xAFBA 0x7B11 +0xAFBB 0x7C89 +0xAFBC 0x7D21 +0xAFBD 0x7D17 +0xAFBE 0x7D0B +0xAFBF 0x7D0A +0xAFC0 0x7D20 +0xAFC1 0x7D22 +0xAFC2 0x7D14 +0xAFC3 0x7D10 +0xAFC4 0x7D15 +0xAFC5 0x7D1A +0xAFC6 0x7D1C +0xAFC7 0x7D0D +0xAFC8 0x7D19 +0xAFC9 0x7D1B +0xAFCA 0x7F3A +0xAFCB 0x7F5F +0xAFCC 0x7F94 +0xAFCD 0x7FC5 +0xAFCE 0x7FC1 +0xAFCF 0x8006 +0xAFD0 0x8018 +0xAFD1 0x8015 +0xAFD2 0x8019 +0xAFD3 0x8017 +0xAFD4 0x803D +0xAFD5 0x803F +0xAFD6 0x80F1 +0xAFD7 0x8102 +0xAFD8 0x80F0 +0xAFD9 0x8105 +0xAFDA 0x80ED +0xAFDB 0x80F4 +0xAFDC 0x8106 +0xAFDD 0x80F8 +0xAFDE 0x80F3 +0xAFDF 0x8108 +0xAFE0 0x80FD +0xAFE1 0x810A +0xAFE2 0x80FC +0xAFE3 0x80EF +0xAFE4 0x81ED +0xAFE5 0x81EC +0xAFE6 0x8200 +0xAFE7 0x8210 +0xAFE8 0xAFE9 0x822A +0xAFEA 0x8228 +0xAFEB 0x822C +0xAFEC 0x82BB +0xAFED 0x832B +0xAFEE 0x8352 +0xAFEF 0x8354 +0xAFF0 0x834A +0xAFF1 0x8338 +0xAFF2 0x8350 +0xAFF3 0x8349 +0xAFF4 0x8335 +0xAFF5 0x8334 +0xAFF6 0x834F +0xAFF7 0x8332 +0xAFF8 0x8339 +0xAFF9 0x8336 +0xAFFA 0x8317 +0xAFFB 0x8340 +0xAFFC 0x8331 +0xAFFD 0x8328 +0xAFFE 0x8343 +0xB040 0x8654 +0xB041 0x868A +0xB042 0x86AA +0xB043 0x8693 +0xB044 0x86A4 +0xB045 0x86A9 +0xB046 0x868C +0xB047 0x86A3 +0xB048 0x869C +0xB049 0x8870 +0xB04A 0x8877 +0xB04B 0xB04C 0x8881 +0xB04D 0x887D +0xB04E 0x8879 +0xB04F 0x8A18 +0xB050 0x8A10 +0xB051 0x8A0E +0xB052 0x8A0C +0xB053 0x8A15 +0xB054 0x8A0A +0xB055 0x8A17 +0xB056 0x8A13 +0xB057 0x8A16 +0xB058 0x8A0F +0xB059 0x8A11 +0xB05A 0x8C48 +0xB05B 0x8C7A +0xB05C 0x8C79 +0xB05D 0xB05E 0x8CA1 +0xB05F 0x8D77 +0xB060 0x8EAC +0xB061 0x8ED2 +0xB062 0x8ED4 +0xB063 0x8ECF +0xB064 0x8FB1 +0xB065 0x9001 +0xB066 0x9006 +0xB067 0x8FF7 +0xB068 0x9000 +0xB069 0x8FFA +0xB06A 0x8FF4 +0xB06B 0x9003 +0xB06C 0x8FFD +0xB06D 0x9005 +0xB06E 0x8FF8 +0xB06F 0x9095 +0xB070 0x90E1 +0xB071 0x90DD +0xB072 0x90E2 +0xB073 0x9152 +0xB074 0x914D +0xB075 0x914C +0xB076 0x91D8 +0xB077 0x91DD +0xB078 0x91D7 +0xB079 0x91DC +0xB07A 0x91D9 +0xB07B 0x9583 +0xB07C 0xB07D 0x9662 +0xB07E 0x9661 +0xB0A1 0x965B +0xB0A2 0x965D +0xB0A3 0x9664 +0xB0A4 0x9658 +0xB0A5 0x965E +0xB0A6 0x96BB +0xB0A7 0x98E2 +0xB0A8 0x99AC +0xB0A9 0x9AA8 +0xB0AA 0x9AD8 +0xB0AB 0x9B25 +0xB0AC 0x9B32 +0xB0AD 0x9B3C +0xB0AE 0x4E7E +0xB0AF 0x507A +0xB0B0 0x507D +0xB0B1 0x505C +0xB0B2 0x5047 +0xB0B3 0x5043 +0xB0B4 0x504C +0xB0B5 0x505A +0xB0B6 0x5049 +0xB0B7 0x5065 +0xB0B8 0x5076 +0xB0B9 0x504E +0xB0BA 0x5055 +0xB0BB 0x5075 +0xB0BC 0x5074 +0xB0BD 0x5077 +0xB0BE 0x504F +0xB0BF 0x500F +0xB0C0 0x506F +0xB0C1 0x506D +0xB0C2 0x515C +0xB0C3 0x5195 +0xB0C4 0x51F0 +0xB0C5 0x526A +0xB0C6 0x526F +0xB0C7 0x52D2 +0xB0C8 0x52D9 +0xB0C9 0x52D8 +0xB0CA 0x52D5 +0xB0CB 0x5310 +0xB0CC 0x530F +0xB0CD 0x5319 +0xB0CE 0xB0CF 0x533F +0xB0D0 0x533E +0xB0D1 0x53C3 +0xB0D2 0x66FC +0xB0D3 0x5546 +0xB0D4 0x556A +0xB0D5 0x5566 +0xB0D6 0x5544 +0xB0D7 0x555E +0xB0D8 0x5561 +0xB0D9 0x5543 +0xB0DA 0x554A +0xB0DB 0x5531 +0xB0DC 0x5556 +0xB0DD 0x554F +0xB0DE 0x5555 +0xB0DF 0x552F +0xB0E0 0x5564 +0xB0E1 0x5538 +0xB0E2 0x552E +0xB0E3 0x555C +0xB0E4 0x552C +0xB0E5 0x5563 +0xB0E6 0x5533 +0xB0E7 0x5541 +0xB0E8 0x5557 +0xB0E9 0x5708 +0xB0EA 0x570B +0xB0EB 0x5709 +0xB0EC 0x57DF +0xB0ED 0x5805 +0xB0EE 0x580A +0xB0EF 0x5806 +0xB0F0 0x57E0 +0xB0F1 0x57E4 +0xB0F2 0x57FA +0xB0F3 0x5802 +0xB0F4 0x5835 +0xB0F5 0x57F7 +0xB0F6 0x57F9 +0xB0F7 0x5920 +0xB0F8 0x5962 +0xB0F9 0x5A36 +0xB0FA 0x5A41 +0xB0FB 0x5A49 +0xB0FC 0x5A66 +0xB0FD 0x5A6A +0xB0FE 0x5A40 +0xB140 0x5A3C +0xB141 0x5A62 +0xB142 0x5A5A +0xB143 0x5A46 +0xB144 0x5A4A +0xB145 0x5B70 +0xB146 0x5BC7 +0xB147 0x5BC5 +0xB148 0x5BC4 +0xB149 0x5BC2 +0xB14A 0x5BBF +0xB14B 0x5BC6 +0xB14C 0x5C09 +0xB14D 0x5C08 +0xB14E 0x5C07 +0xB14F 0x5C60 +0xB150 0xB151 0x5C5C +0xB152 0x5D07 +0xB153 0x5D06 +0xB154 0x5D0E +0xB155 0x5D1B +0xB156 0x5D16 +0xB157 0x5D22 +0xB158 0x5D11 +0xB159 0x5D29 +0xB15A 0x5D14 +0xB15B 0x5D19 +0xB15C 0x5D24 +0xB15D 0x5D27 +0xB15E 0x5D17 +0xB15F 0x5DE2 +0xB160 0x5E38 +0xB161 0x5E36 +0xB162 0x5E33 +0xB163 0x5E37 +0xB164 0xB165 0x5EB7 +0xB166 0x5EB6 +0xB167 0x5EB5 +0xB168 0x5EBE +0xB169 0x5F35 +0xB16A 0x5F37 +0xB16B 0x5F57 +0xB16C 0x5F6C +0xB16D 0x5F69 +0xB16E 0x5F6B +0xB16F 0x5F97 +0xB170 0x5F99 +0xB171 0x5F9E +0xB172 0x5F98 +0xB173 0x5FA1 +0xB174 0x5FA0 +0xB175 0x5F9C +0xB176 0x607F +0xB177 0x60A3 +0xB178 0x6089 +0xB179 0x60A0 +0xB17A 0x60A8 +0xB17B 0x60CB +0xB17C 0x60B4 +0xB17D 0x60E6 +0xB17E 0x60BD +0xB1A1 0x60C5 +0xB1A2 0x60BB +0xB1A3 0x60B5 +0xB1A4 0x60DC +0xB1A5 0x60BC +0xB1A6 0x60D8 +0xB1A7 0x60D5 +0xB1A8 0x60C6 +0xB1A9 0x60DF +0xB1AA 0x60B8 +0xB1AB 0x60DA +0xB1AC 0x60C7 +0xB1AD 0xB1AE 0x621A +0xB1AF 0x6248 +0xB1B0 0x63A0 +0xB1B1 0x63A7 +0xB1B2 0x6372 +0xB1B3 0x6396 +0xB1B4 0x63A2 +0xB1B5 0x63A5 +0xB1B6 0x6377 +0xB1B7 0x6367 +0xB1B8 0x6398 +0xB1B9 0x63AA +0xB1BA 0x6371 +0xB1BB 0x63A9 +0xB1BC 0x6389 +0xB1BD 0x6383 +0xB1BE 0x639B +0xB1BF 0x636B +0xB1C0 0x63A8 +0xB1C1 0x6384 +0xB1C2 0x6388 +0xB1C3 0x6399 +0xB1C4 0x63A1 +0xB1C5 0x63AC +0xB1C6 0x6392 +0xB1C7 0x638F +0xB1C8 0x6380 +0xB1C9 0x637B +0xB1CA 0x6369 +0xB1CB 0x6368 +0xB1CC 0x637A +0xB1CD 0x655D +0xB1CE 0x6556 +0xB1CF 0x6551 +0xB1D0 0x6559 +0xB1D1 0x6557 +0xB1D2 0x555F +0xB1D3 0x654F +0xB1D4 0x6558 +0xB1D5 0x6555 +0xB1D6 0x6554 +0xB1D7 0x659C +0xB1D8 0x659B +0xB1D9 0x65AC +0xB1DA 0x65CF +0xB1DB 0xB1DC 0x65CB +0xB1DD 0x65CE +0xB1DE 0x665D +0xB1DF 0x665A +0xB1E0 0x6664 +0xB1E1 0x6668 +0xB1E2 0x6666 +0xB1E3 0x665E +0xB1E4 0x66F9 +0xB1E5 0x52D7 +0xB1E6 0x671B +0xB1E7 0x6881 +0xB1E8 0x68AF +0xB1E9 0x68A2 +0xB1EA 0x6893 +0xB1EB 0x68B5 +0xB1EC 0x687F +0xB1ED 0x6876 +0xB1EE 0x68B1 +0xB1EF 0x68A7 +0xB1F0 0x6897 +0xB1F1 0x68B0 +0xB1F2 0x6883 +0xB1F3 0x68C4 +0xB1F4 0x68AD +0xB1F5 0x6886 +0xB1F6 0x6885 +0xB1F7 0x6894 +0xB1F8 0x689D +0xB1F9 0x68A8 +0xB1FA 0x689F +0xB1FB 0x68A1 +0xB1FC 0x6882 +0xB1FD 0x6B32 +0xB1FE 0x6BBA +0xB240 0xB241 0x6BEB +0xB242 0x6C2B +0xB243 0x6D8E +0xB244 0x6DBC +0xB245 0x6DF3 +0xB246 0x6DD9 +0xB247 0x6DB2 +0xB248 0x6DE1 +0xB249 0x6DCC +0xB24A 0x6DE4 +0xB24B 0x6DFB +0xB24C 0x6DFA +0xB24D 0x6E05 +0xB24E 0x6DC7 +0xB24F 0x6DCB +0xB250 0x6DAF +0xB251 0x6DD1 +0xB252 0x6DAE +0xB253 0x6DDE +0xB254 0x6DF9 +0xB255 0x6DB8 +0xB256 0x6DF7 +0xB257 0x6DF5 +0xB258 0x6DC5 +0xB259 0x6DD2 +0xB25A 0x6E1A +0xB25B 0x6DB5 +0xB25C 0x6DDA +0xB25D 0x6DEB +0xB25E 0x6DD8 +0xB25F 0x6DEA +0xB260 0x6DF1 +0xB261 0x6DEE +0xB262 0x6DE8 +0xB263 0x6DC6 +0xB264 0x6DC4 +0xB265 0x6DAA +0xB266 0x6DEC +0xB267 0x6DBF +0xB268 0x6DE6 +0xB269 0x70F9 +0xB26A 0xB26B 0x7109 +0xB26C 0x70FD +0xB26D 0x70EF +0xB26E 0x723D +0xB26F 0x727D +0xB270 0x7281 +0xB271 0x731C +0xB272 0x731B +0xB273 0x7316 +0xB274 0x7313 +0xB275 0x7319 +0xB276 0x7387 +0xB277 0x7405 +0xB278 0x740A +0xB279 0x7403 +0xB27A 0x7406 +0xB27B 0x73FE +0xB27C 0x740D +0xB27D 0x74E0 +0xB27E 0x74F6 +0xB2A1 0x74F7 +0xB2A2 0x751C +0xB2A3 0x7522 +0xB2A4 0xB2A5 0x7565 +0xB2A6 0x7562 +0xB2A7 0x7570 +0xB2A8 0x758F +0xB2A9 0xB2AA 0x75D4 +0xB2AB 0x75B5 +0xB2AC 0x75CA +0xB2AD 0x75CD +0xB2AE 0x768E +0xB2AF 0x76D4 +0xB2B0 0x76D2 +0xB2B1 0x76DB +0xB2B2 0x7737 +0xB2B3 0x773E +0xB2B4 0x773C +0xB2B5 0x7736 +0xB2B6 0x7738 +0xB2B7 0x773A +0xB2B8 0x786B +0xB2B9 0x7843 +0xB2BA 0x784E +0xB2BB 0x7965 +0xB2BC 0x7968 +0xB2BD 0x796D +0xB2BE 0x79FB +0xB2BF 0x7A92 +0xB2C0 0x7A95 +0xB2C1 0x7B20 +0xB2C2 0x7B28 +0xB2C3 0x7B1B +0xB2C4 0x7B2C +0xB2C5 0x7B26 +0xB2C6 0x7B19 +0xB2C7 0x7B1E +0xB2C8 0x7B2E +0xB2C9 0x7C92 +0xB2CA 0x7C97 +0xB2CB 0x7C95 +0xB2CC 0x7D46 +0xB2CD 0x7D43 +0xB2CE 0x7D71 +0xB2CF 0x7D2E +0xB2D0 0x7D39 +0xB2D1 0x7D3C +0xB2D2 0x7D40 +0xB2D3 0x7D30 +0xB2D4 0x7D33 +0xB2D5 0x7D44 +0xB2D6 0x7D2F +0xB2D7 0x7D42 +0xB2D8 0x7D32 +0xB2D9 0x7D31 +0xB2DA 0x7F3D +0xB2DB 0x7F9E +0xB2DC 0x7F9A +0xB2DD 0x7FCC +0xB2DE 0x7FCE +0xB2DF 0x7FD2 +0xB2E0 0x801C +0xB2E1 0x804A +0xB2E2 0x8046 +0xB2E3 0x812F +0xB2E4 0x8116 +0xB2E5 0x8123 +0xB2E6 0x812B +0xB2E7 0x8129 +0xB2E8 0x8130 +0xB2E9 0x8124 +0xB2EA 0x8202 +0xB2EB 0x8235 +0xB2EC 0x8237 +0xB2ED 0x8236 +0xB2EE 0x8239 +0xB2EF 0x838E +0xB2F0 0x839E +0xB2F1 0x8398 +0xB2F2 0x8378 +0xB2F3 0x83A2 +0xB2F4 0x8396 +0xB2F5 0x83BD +0xB2F6 0x83AB +0xB2F7 0x8392 +0xB2F8 0x838A +0xB2F9 0x8393 +0xB2FA 0x8389 +0xB2FB 0x83A0 +0xB2FC 0x8377 +0xB2FD 0xB2FE 0x837B +0xB340 0x8386 +0xB341 0x83A7 +0xB342 0x8655 +0xB343 0x5F6A +0xB344 0x86C7 +0xB345 0x86C0 +0xB346 0x86B6 +0xB347 0x86C4 +0xB348 0x86B5 +0xB349 0x86C6 +0xB34A 0x86CB +0xB34B 0x86B1 +0xB34C 0x86AF +0xB34D 0x86C9 +0xB34E 0x8853 +0xB34F 0x889E +0xB350 0x8888 +0xB351 0x88AB +0xB352 0x8892 +0xB353 0x8896 +0xB354 0x888D +0xB355 0x888B +0xB356 0x8993 +0xB357 0x898F +0xB358 0x8A2A +0xB359 0x8A1D +0xB35A 0x8A23 +0xB35B 0x8A25 +0xB35C 0x8A31 +0xB35D 0x8A2D +0xB35E 0x8A1F +0xB35F 0x8A1B +0xB360 0x8A22 +0xB361 0x8C49 +0xB362 0x8C5A +0xB363 0x8CA9 +0xB364 0x8CAC +0xB365 0x8CAB +0xB366 0x8CA8 +0xB367 0x8CAA +0xB368 0x8CA7 +0xB369 0x8D67 +0xB36A 0x8D66 +0xB36B 0x8DBE +0xB36C 0x8DBA +0xB36D 0x8EDB +0xB36E 0x8EDF +0xB36F 0x9019 +0xB370 0x900D +0xB371 0x901A +0xB372 0x9017 +0xB373 0x9023 +0xB374 0x901F +0xB375 0x901D +0xB376 0x9010 +0xB377 0x9015 +0xB378 0x901E +0xB379 0x9020 +0xB37A 0x900F +0xB37B 0x9022 +0xB37C 0x9016 +0xB37D 0x901B +0xB37E 0x9014 +0xB3A1 0x90E8 +0xB3A2 0x90ED +0xB3A3 0x90FD +0xB3A4 0x9157 +0xB3A5 0x91CE +0xB3A6 0x91F5 +0xB3A7 0x91E6 +0xB3A8 0x91E3 +0xB3A9 0x91E7 +0xB3AA 0x91ED +0xB3AB 0x91E9 +0xB3AC 0x9589 +0xB3AD 0x966A +0xB3AE 0x9675 +0xB3AF 0x9673 +0xB3B0 0x9678 +0xB3B1 0x9670 +0xB3B2 0x9674 +0xB3B3 0xB3B4 0x9676 +0xB3B5 0x966C +0xB3B6 0x96C0 +0xB3B7 0x96EA +0xB3B8 0x96E9 +0xB3B9 0x7AE0 +0xB3BA 0x7ADF +0xB3BB 0xB3BC 0x9802 +0xB3BD 0x9B5A +0xB3BE 0x9CE5 +0xB3BF 0x9E75 +0xB3C0 0x9E7F +0xB3C1 0x9EA5 +0xB3C2 0x9EBB +0xB3C3 0x50A2 +0xB3C4 0x508D +0xB3C5 0x5085 +0xB3C6 0x5099 +0xB3C7 0x5091 +0xB3C8 0x5080 +0xB3C9 0x5096 +0xB3CA 0x5098 +0xB3CB 0x509A +0xB3CC 0x6700 +0xB3CD 0x51F1 +0xB3CE 0x5272 +0xB3CF 0xB3D0 0x5274 +0xB3D1 0x5269 +0xB3D2 0x52DE +0xB3D3 0x52DD +0xB3D4 0x52DB +0xB3D5 0x535A +0xB3D6 0x53A5 +0xB3D7 0x557B +0xB3D8 0x5580 +0xB3D9 0x55A7 +0xB3DA 0x557C +0xB3DB 0x558A +0xB3DC 0x559D +0xB3DD 0x5598 +0xB3DE 0x5582 +0xB3DF 0x559C +0xB3E0 0x55AA +0xB3E1 0x5594 +0xB3E2 0x5587 +0xB3E3 0x558B +0xB3E4 0x5583 +0xB3E5 0x55B3 +0xB3E6 0x55AE +0xB3E7 0x559F +0xB3E8 0x553E +0xB3E9 0x55B2 +0xB3EA 0x559A +0xB3EB 0x55BB +0xB3EC 0x55AC +0xB3ED 0x55B1 +0xB3EE 0x557E +0xB3EF 0x5589 +0xB3F0 0x55AB +0xB3F1 0x5599 +0xB3F2 0x570D +0xB3F3 0x582F +0xB3F4 0x582A +0xB3F5 0x5834 +0xB3F6 0x5824 +0xB3F7 0xB3F8 0x5830 +0xB3F9 0x5821 +0xB3FA 0x581D +0xB3FB 0x5820 +0xB3FC 0xB3FD 0x58F9 +0xB3FE 0x5960 +0xB440 0x5A77 +0xB441 0x5A9A +0xB442 0x5A7F +0xB443 0x5A92 +0xB444 0x5A9B +0xB445 0x5AA7 +0xB446 0x5B73 +0xB447 0x5B71 +0xB448 0x5BD2 +0xB449 0x5BCC +0xB44A 0x5BD3 +0xB44B 0x5BD0 +0xB44C 0xB44D 0x5C0A +0xB44E 0x5C31 +0xB44F 0x5D4C +0xB450 0x5D50 +0xB451 0x5D34 +0xB452 0x5D47 +0xB453 0x5DFD +0xB454 0x5E45 +0xB455 0x5E3D +0xB456 0x5E40 +0xB457 0x5E43 +0xB458 0x5E7E +0xB459 0x5ECA +0xB45A 0xB45B 0x5EC1 +0xB45C 0x5EC4 +0xB45D 0x5F3C +0xB45E 0x5F6D +0xB45F 0xB460 0x5FA9 +0xB461 0x5FA8 +0xB462 0x60D1 +0xB463 0x60E1 +0xB464 0x60B2 +0xB465 0x60B6 +0xB466 0x60E0 +0xB467 0x611C +0xB468 0x6123 +0xB469 0x60FA +0xB46A 0x6115 +0xB46B 0x60F0 +0xB46C 0x60FB +0xB46D 0x60F4 +0xB46E 0x6168 +0xB46F 0x60F1 +0xB470 0x610E +0xB471 0x60F6 +0xB472 0x6109 +0xB473 0x6100 +0xB474 0x6112 +0xB475 0x621F +0xB476 0x6249 +0xB477 0x63A3 +0xB478 0x638C +0xB479 0x63CF +0xB47A 0x63C0 +0xB47B 0x63E9 +0xB47C 0x63C9 +0xB47D 0x63C6 +0xB47E 0x63CD +0xB4A1 0x63D2 +0xB4A2 0x63E3 +0xB4A3 0x63D0 +0xB4A4 0x63E1 +0xB4A5 0x63D6 +0xB4A6 0xB4A7 0x63ED +0xB4A8 0x6376 +0xB4A9 0x63F4 +0xB4AA 0x63EA +0xB4AB 0x63DB +0xB4AC 0x6452 +0xB4AD 0x63DA +0xB4AE 0x63F9 +0xB4AF 0x655E +0xB4B0 0x6566 +0xB4B1 0xB4B2 0x6562 +0xB4B3 0x6591 +0xB4B4 0x6590 +0xB4B5 0x65AF +0xB4B6 0x666E +0xB4B7 0x6670 +0xB4B8 0x6674 +0xB4B9 0x6676 +0xB4BA 0x666F +0xB4BB 0x6691 +0xB4BC 0x667A +0xB4BD 0x667E +0xB4BE 0x6677 +0xB4BF 0xB4C0 0x66FE +0xB4C1 0x671F +0xB4C2 0x671D +0xB4C3 0x68FA +0xB4C4 0x68D5 +0xB4C5 0x68E0 +0xB4C6 0x68D8 +0xB4C7 0x68D7 +0xB4C8 0x6905 +0xB4C9 0x68DF +0xB4CA 0x68F5 +0xB4CB 0x68EE +0xB4CC 0x68E7 +0xB4CD 0x68F9 +0xB4CE 0x68D2 +0xB4CF 0x68F2 +0xB4D0 0x68E3 +0xB4D1 0x68CB +0xB4D2 0x68CD +0xB4D3 0x690D +0xB4D4 0x6912 +0xB4D5 0x690E +0xB4D6 0x68C9 +0xB4D7 0x68DA +0xB4D8 0x696E +0xB4D9 0x68FB +0xB4DA 0x6B3E +0xB4DB 0x6B3A +0xB4DC 0x6B3D +0xB4DD 0x6B98 +0xB4DE 0x6B96 +0xB4DF 0x6BBC +0xB4E0 0x6BEF +0xB4E1 0xB4E2 0x6C2E +0xB4E3 0x6C2C +0xB4E4 0x6E2F +0xB4E5 0x6E38 +0xB4E6 0x6E54 +0xB4E7 0x6E21 +0xB4E8 0x6E32 +0xB4E9 0x6E67 +0xB4EA 0x6E4A +0xB4EB 0x6E20 +0xB4EC 0x6E25 +0xB4ED 0x6E23 +0xB4EE 0x6E1B +0xB4EF 0x6E5B +0xB4F0 0x6E58 +0xB4F1 0x6E24 +0xB4F2 0x6E56 +0xB4F3 0x6E6E +0xB4F4 0x6E2D +0xB4F5 0x6E26 +0xB4F6 0x6E6F +0xB4F7 0x6E34 +0xB4F8 0x6E4D +0xB4F9 0x6E3A +0xB4FA 0x6E2C +0xB4FB 0x6E43 +0xB4FC 0x6E1D +0xB4FD 0x6E3E +0xB4FE 0x6ECB +0xB540 0x6E89 +0xB541 0x6E19 +0xB542 0x6E4E +0xB543 0x6E63 +0xB544 0x6E44 +0xB545 0x6E72 +0xB546 0x6E69 +0xB547 0x6E5F +0xB548 0xB549 0x7119 +0xB54A 0x7126 +0xB54B 0x7130 +0xB54C 0x7121 +0xB54D 0x7136 +0xB54E 0x716E +0xB54F 0x711C +0xB550 0x724C +0xB551 0x7284 +0xB552 0x7280 +0xB553 0x7336 +0xB554 0x7325 +0xB555 0x7334 +0xB556 0x7329 +0xB557 0x743A +0xB558 0x742A +0xB559 0x7433 +0xB55A 0x7422 +0xB55B 0x7425 +0xB55C 0xB55D 0x7435 +0xB55E 0x7434 +0xB55F 0x742F +0xB560 0x741B +0xB561 0x7426 +0xB562 0x7428 +0xB563 0xB564 0x7525 +0xB565 0x756B +0xB566 0x756A +0xB567 0x75E2 +0xB568 0x75DB +0xB569 0x75E3 +0xB56A 0x75D9 +0xB56B 0x75D8 +0xB56C 0x75DE +0xB56D 0x75E0 +0xB56E 0xB56F 0x767B +0xB570 0x7696 +0xB571 0x7693 +0xB572 0x76B4 +0xB573 0x76DC +0xB574 0x774F +0xB575 0x77ED +0xB576 0x785D +0xB577 0x786C +0xB578 0x786F +0xB579 0x7A0D +0xB57A 0x7A08 +0xB57B 0x7A0B +0xB57C 0x7A05 +0xB57D 0x7A00 +0xB57E 0x7A98 +0xB5A1 0x7A97 +0xB5A2 0x7A96 +0xB5A3 0x7AE5 +0xB5A4 0x7AE3 +0xB5A5 0x7B49 +0xB5A6 0x7B56 +0xB5A7 0x7B46 +0xB5A8 0x7B50 +0xB5A9 0x7B52 +0xB5AA 0x7B54 +0xB5AB 0x7B4D +0xB5AC 0x7B4B +0xB5AD 0x7B4F +0xB5AE 0x7B51 +0xB5AF 0x7C9F +0xB5B0 0x7CA5 +0xB5B1 0x7D5E +0xB5B2 0x7D50 +0xB5B3 0x7D68 +0xB5B4 0x7D55 +0xB5B5 0x7D2B +0xB5B6 0x7D6E +0xB5B7 0x7D72 +0xB5B8 0x7D61 +0xB5B9 0x7D66 +0xB5BA 0x7D62 +0xB5BB 0x7D70 +0xB5BC 0x7D73 +0xB5BD 0x5584 +0xB5BE 0xB5BF 0x7FD4 +0xB5C0 0x800B +0xB5C1 0x8052 +0xB5C2 0x8085 +0xB5C3 0x8155 +0xB5C4 0x8154 +0xB5C5 0x814B +0xB5C6 0x8151 +0xB5C7 0x814E +0xB5C8 0x8139 +0xB5C9 0x8146 +0xB5CA 0x813E +0xB5CB 0x814C +0xB5CC 0x8153 +0xB5CD 0x8174 +0xB5CE 0x8212 +0xB5CF 0x821C +0xB5D0 0x83E9 +0xB5D1 0x8403 +0xB5D2 0x83F8 +0xB5D3 0x840D +0xB5D4 0x83E0 +0xB5D5 0x83C5 +0xB5D6 0x840B +0xB5D7 0x83C1 +0xB5D8 0x83EF +0xB5D9 0x83F1 +0xB5DA 0x83F4 +0xB5DB 0x8457 +0xB5DC 0x840A +0xB5DD 0x83F0 +0xB5DE 0x840C +0xB5DF 0x83CC +0xB5E0 0x83FD +0xB5E1 0x83F2 +0xB5E2 0x83CA +0xB5E3 0x8438 +0xB5E4 0x840E +0xB5E5 0x8404 +0xB5E6 0x83DC +0xB5E7 0x8407 +0xB5E8 0x83D4 +0xB5E9 0x83DF +0xB5EA 0x865B +0xB5EB 0x86DF +0xB5EC 0x86D9 +0xB5ED 0x86ED +0xB5EE 0x86D4 +0xB5EF 0x86DB +0xB5F0 0x86E4 +0xB5F1 0x86D0 +0xB5F2 0x86DE +0xB5F3 0x8857 +0xB5F4 0xB5F5 0x88C1 +0xB5F6 0x88B1 +0xB5F7 0x8983 +0xB5F8 0x8996 +0xB5F9 0x8A3B +0xB5FA 0x8A60 +0xB5FB 0x8A55 +0xB5FC 0x8A5E +0xB5FD 0x8A3C +0xB5FE 0x8A41 +0xB640 0x8A54 +0xB641 0x8A5B +0xB642 0x8A50 +0xB643 0x8A46 +0xB644 0x8A34 +0xB645 0x8A3A +0xB646 0x8A36 +0xB647 0x8A56 +0xB648 0x8C61 +0xB649 0x8C82 +0xB64A 0x8CAF +0xB64B 0x8CBC +0xB64C 0x8CB3 +0xB64D 0x8CBD +0xB64E 0x8CC1 +0xB64F 0x8CBB +0xB650 0x8CC0 +0xB651 0x8CB4 +0xB652 0x8CB7 +0xB653 0x8CB6 +0xB654 0x8CBF +0xB655 0x8CB8 +0xB656 0x8D8A +0xB657 0x8D85 +0xB658 0x8D81 +0xB659 0x8DCE +0xB65A 0x8DDD +0xB65B 0x8DCB +0xB65C 0x8DDA +0xB65D 0x8DD1 +0xB65E 0x8DCC +0xB65F 0x8DDB +0xB660 0x8DC6 +0xB661 0x8EFB +0xB662 0x8EF8 +0xB663 0x8EFC +0xB664 0x8F9C +0xB665 0x902E +0xB666 0x9035 +0xB667 0x9031 +0xB668 0x9038 +0xB669 0x9032 +0xB66A 0x9036 +0xB66B 0x9102 +0xB66C 0x90F5 +0xB66D 0x9109 +0xB66E 0x90FE +0xB66F 0x9163 +0xB670 0x9165 +0xB671 0x91CF +0xB672 0xB673 0x9214 +0xB674 0x9223 +0xB675 0x9209 +0xB676 0x921E +0xB677 0x920D +0xB678 0x9210 +0xB679 0x9207 +0xB67A 0x9211 +0xB67B 0x9594 +0xB67C 0x958F +0xB67D 0x958B +0xB67E 0x9591 +0xB6A1 0x9593 +0xB6A2 0x9592 +0xB6A3 0x958E +0xB6A4 0x968A +0xB6A5 0x968E +0xB6A6 0x968B +0xB6A7 0x967D +0xB6A8 0xB6A9 0x9685 +0xB6AA 0x968D +0xB6AB 0x9672 +0xB6AC 0x9684 +0xB6AD 0x96C1 +0xB6AE 0x96C5 +0xB6AF 0x96C4 +0xB6B0 0xB6B1 0x96C6 +0xB6B2 0x96EF +0xB6B3 0x96F2 +0xB6B4 0x97CC +0xB6B5 0xB6B6 0x9805 +0xB6B7 0x9808 +0xB6B8 0x98E7 +0xB6B9 0x98EA +0xB6BA 0x98EF +0xB6BB 0x98E9 +0xB6BC 0x98F2 +0xB6BD 0x98ED +0xB6BE 0x99AE +0xB6BF 0x99AD +0xB6C0 0x9EC3 +0xB6C1 0x9ECD +0xB6C2 0x9ED1 +0xB6C3 0x4E82 +0xB6C4 0x50AD +0xB6C5 0x50B5 +0xB6C6 0xB6C7 0x50B2 +0xB6C8 0x50C5 +0xB6C9 0x50BE +0xB6CA 0x50AC +0xB6CB 0x50B7 +0xB6CC 0x50BB +0xB6CD 0x50AF +0xB6CE 0x50C7 +0xB6CF 0x527F +0xB6D0 0x5277 +0xB6D1 0x527D +0xB6D2 0x52DF +0xB6D3 0x52E6 +0xB6D4 0x52E4 +0xB6D5 0xB6D6 0x52E2 +0xB6D7 0x532F +0xB6D8 0x55DF +0xB6D9 0x55E8 +0xB6DA 0x55D3 +0xB6DB 0x55E6 +0xB6DC 0x55CE +0xB6DD 0x55DC +0xB6DE 0x55C7 +0xB6DF 0x55D1 +0xB6E0 0xB6E1 0x55E3 +0xB6E2 0x55EF +0xB6E3 0x55DA +0xB6E4 0x55E1 +0xB6E5 0xB6E6 0x55C5 +0xB6E7 0x55E5 +0xB6E8 0x55C9 +0xB6E9 0xB6EA 0x5712 +0xB6EB 0x585E +0xB6EC 0x5851 +0xB6ED 0x5858 +0xB6EE 0x5857 +0xB6EF 0x585A +0xB6F0 0x5854 +0xB6F1 0x586B +0xB6F2 0x584C +0xB6F3 0x586D +0xB6F4 0x584A +0xB6F5 0x5862 +0xB6F6 0x5852 +0xB6F7 0x584B +0xB6F8 0x5967 +0xB6F9 0x5AC1 +0xB6FA 0x5AC9 +0xB6FB 0x5ACC +0xB6FC 0x5ABE +0xB6FD 0x5ABD +0xB6FE 0x5ABC +0xB740 0x5AB3 +0xB741 0x5AC2 +0xB742 0x5AB2 +0xB743 0x5D69 +0xB744 0x5D6F +0xB745 0x5E4C +0xB746 0x5E79 +0xB747 0x5EC9 +0xB748 0x5EC8 +0xB749 0x5F12 +0xB74A 0x5F59 +0xB74B 0x5FAC +0xB74C 0x5FAE +0xB74D 0x611A +0xB74E 0x610F +0xB74F 0x6148 +0xB750 0x611F +0xB751 0x60F3 +0xB752 0x611B +0xB753 0x60F9 +0xB754 0x6101 +0xB755 0x6108 +0xB756 0x614E +0xB757 0x614C +0xB758 0x6144 +0xB759 0x614D +0xB75A 0x613E +0xB75B 0x6134 +0xB75C 0x6127 +0xB75D 0x610D +0xB75E 0x6106 +0xB75F 0x6137 +0xB760 0xB761 0x6221 +0xB762 0x6413 +0xB763 0x643E +0xB764 0x641E +0xB765 0x642A +0xB766 0x642D +0xB767 0x643D +0xB768 0x642C +0xB769 0x640F +0xB76A 0x641C +0xB76B 0x6414 +0xB76C 0x640D +0xB76D 0x6436 +0xB76E 0xB76F 0x6416 +0xB770 0x6406 +0xB771 0x656C +0xB772 0x659F +0xB773 0x65B0 +0xB774 0x6697 +0xB775 0x6689 +0xB776 0xB777 0x6687 +0xB778 0x6696 +0xB779 0x6684 +0xB77A 0x6698 +0xB77B 0x668D +0xB77C 0x6703 +0xB77D 0x6994 +0xB77E 0x696D +0xB7A1 0x695A +0xB7A2 0x6977 +0xB7A3 0x6960 +0xB7A4 0x6954 +0xB7A5 0x6975 +0xB7A6 0x6930 +0xB7A7 0x6982 +0xB7A8 0x694A +0xB7A9 0x6968 +0xB7AA 0x696B +0xB7AB 0x695E +0xB7AC 0x6953 +0xB7AD 0x6979 +0xB7AE 0x6986 +0xB7AF 0x695D +0xB7B0 0x6963 +0xB7B1 0x695B +0xB7B2 0x6B47 +0xB7B3 0x6B72 +0xB7B4 0x6BC0 +0xB7B5 0x6BBF +0xB7B6 0x6BD3 +0xB7B7 0x6BFD +0xB7B8 0x6EA2 +0xB7B9 0x6EAF +0xB7BA 0x6ED3 +0xB7BB 0x6EB6 +0xB7BC 0x6EC2 +0xB7BD 0x6E90 +0xB7BE 0x6E9D +0xB7BF 0x6EC7 +0xB7C0 0x6EC5 +0xB7C1 0x6EA5 +0xB7C2 0x6E98 +0xB7C3 0x6EBC +0xB7C4 0x6EBA +0xB7C5 0x6EAB +0xB7C6 0x6ED1 +0xB7C7 0x6E96 +0xB7C8 0x6E9C +0xB7C9 0x6EC4 +0xB7CA 0x6ED4 +0xB7CB 0x6EAA +0xB7CC 0x6EA7 +0xB7CD 0x6EB4 +0xB7CE 0x714E +0xB7CF 0x7159 +0xB7D0 0x7169 +0xB7D1 0x7164 +0xB7D2 0x7149 +0xB7D3 0x7167 +0xB7D4 0x715C +0xB7D5 0x716C +0xB7D6 0x7166 +0xB7D7 0x714C +0xB7D8 0x7165 +0xB7D9 0x715E +0xB7DA 0x7146 +0xB7DB 0x7168 +0xB7DC 0x7156 +0xB7DD 0x723A +0xB7DE 0x7252 +0xB7DF 0x7337 +0xB7E0 0x7345 +0xB7E1 0x733F +0xB7E2 0x733E +0xB7E3 0x746F +0xB7E4 0x745A +0xB7E5 0x7455 +0xB7E6 0x745F +0xB7E7 0x745E +0xB7E8 0x7441 +0xB7E9 0x743F +0xB7EA 0x7459 +0xB7EB 0xB7EC 0x745B +0xB7ED 0x7576 +0xB7EE 0x7578 +0xB7EF 0x7600 +0xB7F0 0x75F0 +0xB7F1 0x7601 +0xB7F2 0x75F2 +0xB7F3 0x75F1 +0xB7F4 0x75FA +0xB7F5 0x75FF +0xB7F6 0x75F4 +0xB7F7 0x75F3 +0xB7F8 0xB7F9 0x76DE +0xB7FA 0x775B +0xB7FB 0x776B +0xB7FC 0x7766 +0xB7FD 0x775E +0xB7FE 0x7763 +0xB840 0x7779 +0xB841 0x776A +0xB842 0x776C +0xB843 0x775C +0xB844 0x7765 +0xB845 0x7768 +0xB846 0x7762 +0xB847 0x77EE +0xB848 0x788E +0xB849 0x78B0 +0xB84A 0xB84B 0x7897 +0xB84C 0x788C +0xB84D 0x7889 +0xB84E 0x787C +0xB84F 0x7891 +0xB850 0x7893 +0xB851 0x787F +0xB852 0x797A +0xB853 0x797F +0xB854 0x7981 +0xB855 0x842C +0xB856 0x79BD +0xB857 0x7A1C +0xB858 0x7A1A +0xB859 0x7A20 +0xB85A 0x7A14 +0xB85B 0x7A1F +0xB85C 0x7A1E +0xB85D 0xB85E 0x7A9F +0xB85F 0x7B77 +0xB860 0x7BC0 +0xB861 0x7B60 +0xB862 0x7B6E +0xB863 0x7B67 +0xB864 0x7CB1 +0xB865 0x7CB3 +0xB866 0x7CB5 +0xB867 0x7D93 +0xB868 0x7D79 +0xB869 0x7D91 +0xB86A 0x7D81 +0xB86B 0x7D8F +0xB86C 0x7D5B +0xB86D 0x7F6E +0xB86E 0xB86F 0x7F69 +0xB870 0x7F72 +0xB871 0x7FA9 +0xB872 0x7FA8 +0xB873 0x7FA4 +0xB874 0x8056 +0xB875 0x8058 +0xB876 0x8086 +0xB877 0x8084 +0xB878 0x8171 +0xB879 0x8170 +0xB87A 0x8178 +0xB87B 0x8165 +0xB87C 0x816E +0xB87D 0x8173 +0xB87E 0x816B +0xB8A1 0xB8A2 0x8179 +0xB8A3 0x8166 +0xB8A4 0x8205 +0xB8A5 0x8247 +0xB8A6 0x8482 +0xB8A7 0x8477 +0xB8A8 0x843D +0xB8A9 0x8431 +0xB8AA 0x8475 +0xB8AB 0x8466 +0xB8AC 0x846B +0xB8AD 0x8449 +0xB8AE 0x846C +0xB8AF 0x845B +0xB8B0 0x843C +0xB8B1 0x8435 +0xB8B2 0x8461 +0xB8B3 0x8463 +0xB8B4 0x8469 +0xB8B5 0x846D +0xB8B6 0x8446 +0xB8B7 0x865E +0xB8B8 0x865C +0xB8B9 0x865F +0xB8BA 0x86F9 +0xB8BB 0x8713 +0xB8BC 0x8708 +0xB8BD 0x8707 +0xB8BE 0x8700 +0xB8BF 0x86FE +0xB8C0 0x86FB +0xB8C1 0xB8C2 0x8702 +0xB8C3 0x8706 +0xB8C4 0x870A +0xB8C5 0x8859 +0xB8C6 0x88DF +0xB8C7 0x88D4 +0xB8C8 0x88D9 +0xB8C9 0x88DC +0xB8CA 0x88D8 +0xB8CB 0x88DD +0xB8CC 0x88E1 +0xB8CD 0x88CA +0xB8CE 0x88D5 +0xB8CF 0x88D2 +0xB8D0 0x899C +0xB8D1 0x89E3 +0xB8D2 0x8A6B +0xB8D3 0xB8D4 0x8A72 +0xB8D5 0x8A66 +0xB8D6 0x8A69 +0xB8D7 0x8A70 +0xB8D8 0x8A87 +0xB8D9 0x8A7C +0xB8DA 0x8A63 +0xB8DB 0x8AA0 +0xB8DC 0x8A71 +0xB8DD 0x8A85 +0xB8DE 0x8A6D +0xB8DF 0x8A62 +0xB8E0 0x8A6E +0xB8E1 0x8A6C +0xB8E2 0x8A79 +0xB8E3 0x8A7B +0xB8E4 0x8A3E +0xB8E5 0x8A68 +0xB8E6 0x8C62 +0xB8E7 0x8C8A +0xB8E8 0x8C89 +0xB8E9 0x8CCA +0xB8EA 0xB8EB 0x8CC7 +0xB8EC 0x8CC4 +0xB8ED 0x8CB2 +0xB8EE 0x8CC3 +0xB8EF 0x8CC2 +0xB8F0 0x8CC5 +0xB8F1 0x8DE1 +0xB8F2 0x8DDF +0xB8F3 0x8DE8 +0xB8F4 0x8DEF +0xB8F5 0x8DF3 +0xB8F6 0x8DFA +0xB8F7 0x8DEA +0xB8F8 0x8DE4 +0xB8F9 0x8DE6 +0xB8FA 0x8EB2 +0xB8FB 0x8F03 +0xB8FC 0x8F09 +0xB8FD 0x8EFE +0xB8FE 0x8F0A +0xB940 0x8F9F +0xB941 0x8FB2 +0xB942 0x904B +0xB943 0x904A +0xB944 0x9053 +0xB945 0x9042 +0xB946 0x9054 +0xB947 0x903C +0xB948 0x9055 +0xB949 0x9050 +0xB94A 0x9047 +0xB94B 0x904F +0xB94C 0x904E +0xB94D 0x904D +0xB94E 0x9051 +0xB94F 0x903E +0xB950 0x9041 +0xB951 0x9112 +0xB952 0x9117 +0xB953 0x916C +0xB954 0x916A +0xB955 0x9169 +0xB956 0x91C9 +0xB957 0x9237 +0xB958 0x9257 +0xB959 0x9238 +0xB95A 0x923D +0xB95B 0x9240 +0xB95C 0x923E +0xB95D 0x925B +0xB95E 0x924B +0xB95F 0x9264 +0xB960 0x9251 +0xB961 0x9234 +0xB962 0x9249 +0xB963 0x924D +0xB964 0x9245 +0xB965 0x9239 +0xB966 0x923F +0xB967 0x925A +0xB968 0x9598 +0xB969 0x9698 +0xB96A 0xB96B 0x9694 +0xB96C 0x96CD +0xB96D 0x96CB +0xB96E 0xB96F 0x96C9 +0xB970 0x96F7 +0xB971 0x96FB +0xB972 0x96F9 +0xB973 0x96F6 +0xB974 0x9756 +0xB975 0x9774 +0xB976 0x9776 +0xB977 0xB978 0x9810 +0xB979 0x9813 +0xB97A 0x980A +0xB97B 0x9812 +0xB97C 0x980C +0xB97D 0x98FC +0xB97E 0x98F4 +0xB9A1 0xB9A2 0x98FD +0xB9A3 0x99B3 +0xB9A4 0x99B1 +0xB9A5 0x99B4 +0xB9A6 0x9AE1 +0xB9A7 0x9CE9 +0xB9A8 0x9E82 +0xB9A9 0x9F0E +0xB9AA 0x9F13 +0xB9AB 0x9F20 +0xB9AC 0x50E7 +0xB9AD 0x50EE +0xB9AE 0x50E5 +0xB9AF 0x50D6 +0xB9B0 0x50ED +0xB9B1 0x50DA +0xB9B2 0x50D5 +0xB9B3 0x50CF +0xB9B4 0x50D1 +0xB9B5 0x50F1 +0xB9B6 0x50CE +0xB9B7 0x50E9 +0xB9B8 0x5162 +0xB9B9 0x51F3 +0xB9BA 0x5283 +0xB9BB 0x5282 +0xB9BC 0x5331 +0xB9BD 0x53AD +0xB9BE 0x55FE +0xB9BF 0x5600 +0xB9C0 0x561B +0xB9C1 0x5617 +0xB9C2 0x55FD +0xB9C3 0x5614 +0xB9C4 0x5606 +0xB9C5 0x5609 +0xB9C6 0xB9C7 0x560D +0xB9C8 0x55F7 +0xB9C9 0x5616 +0xB9CA 0x561F +0xB9CB 0x5608 +0xB9CC 0x5610 +0xB9CD 0x55F6 +0xB9CE 0x5718 +0xB9CF 0x5716 +0xB9D0 0x5875 +0xB9D1 0x587E +0xB9D2 0x5883 +0xB9D3 0x5893 +0xB9D4 0x588A +0xB9D5 0x5879 +0xB9D6 0x5885 +0xB9D7 0x587D +0xB9D8 0x58FD +0xB9D9 0x5925 +0xB9DA 0x5922 +0xB9DB 0x5924 +0xB9DC 0x596A +0xB9DD 0x5969 +0xB9DE 0x5AE1 +0xB9DF 0x5AE6 +0xB9E0 0x5AE9 +0xB9E1 0x5AD7 +0xB9E2 0x5AD6 +0xB9E3 0x5AD8 +0xB9E4 0x5AE3 +0xB9E5 0x5B75 +0xB9E6 0x5BDE +0xB9E7 0x5BE7 +0xB9E8 0x5BE1 +0xB9E9 0xB9EA 0x5BE5 +0xB9EB 0x5BE8 +0xB9EC 0x5BE2 +0xB9ED 0x5BE4 +0xB9EE 0x5BDF +0xB9EF 0x5C0D +0xB9F0 0x5C62 +0xB9F1 0x5D84 +0xB9F2 0x5D87 +0xB9F3 0x5E5B +0xB9F4 0x5E63 +0xB9F5 0x5E55 +0xB9F6 0x5E57 +0xB9F7 0x5E54 +0xB9F8 0x5ED3 +0xB9F9 0x5ED6 +0xB9FA 0x5F0A +0xB9FB 0x5F46 +0xB9FC 0x5F70 +0xB9FD 0x5FB9 +0xB9FE 0x6147 +0xBA40 0x613F +0xBA41 0x614B +0xBA42 0x6177 +0xBA43 0xBA44 0x6162 +0xBA45 0x615F +0xBA46 0x615A +0xBA47 0x6158 +0xBA48 0x6175 +0xBA49 0x622A +0xBA4A 0x6487 +0xBA4B 0x6458 +0xBA4C 0x6454 +0xBA4D 0x64A4 +0xBA4E 0x6478 +0xBA4F 0x645F +0xBA50 0x647A +0xBA51 0x6451 +0xBA52 0x6467 +0xBA53 0x6434 +0xBA54 0x646D +0xBA55 0x647B +0xBA56 0x6572 +0xBA57 0x65A1 +0xBA58 0x65D7 +0xBA59 0x65D6 +0xBA5A 0x66A2 +0xBA5B 0x66A8 +0xBA5C 0x669D +0xBA5D 0x699C +0xBA5E 0x69A8 +0xBA5F 0x6995 +0xBA60 0x69C1 +0xBA61 0x69AE +0xBA62 0x69D3 +0xBA63 0x69CB +0xBA64 0x699B +0xBA65 0x69B7 +0xBA66 0x69BB +0xBA67 0x69AB +0xBA68 0x69B4 +0xBA69 0x69D0 +0xBA6A 0x69CD +0xBA6B 0x69AD +0xBA6C 0x69CC +0xBA6D 0x69A6 +0xBA6E 0x69C3 +0xBA6F 0x69A3 +0xBA70 0x6B49 +0xBA71 0x6B4C +0xBA72 0x6C33 +0xBA73 0x6F33 +0xBA74 0x6F14 +0xBA75 0x6EFE +0xBA76 0x6F13 +0xBA77 0x6EF4 +0xBA78 0x6F29 +0xBA79 0x6F3E +0xBA7A 0x6F20 +0xBA7B 0x6F2C +0xBA7C 0x6F0F +0xBA7D 0x6F02 +0xBA7E 0x6F22 +0xBAA1 0x6EFF +0xBAA2 0x6EEF +0xBAA3 0x6F06 +0xBAA4 0x6F31 +0xBAA5 0x6F38 +0xBAA6 0x6F32 +0xBAA7 0x6F23 +0xBAA8 0x6F15 +0xBAA9 0x6F2B +0xBAAA 0x6F2F +0xBAAB 0x6F88 +0xBAAC 0x6F2A +0xBAAD 0x6EEC +0xBAAE 0x6F01 +0xBAAF 0x6EF2 +0xBAB0 0x6ECC +0xBAB1 0x6EF7 +0xBAB2 0x7194 +0xBAB3 0x7199 +0xBAB4 0x717D +0xBAB5 0x718A +0xBAB6 0x7184 +0xBAB7 0x7192 +0xBAB8 0x723E +0xBAB9 0x7292 +0xBABA 0x7296 +0xBABB 0x7344 +0xBABC 0x7350 +0xBABD 0x7464 +0xBABE 0x7463 +0xBABF 0x746A +0xBAC0 0x7470 +0xBAC1 0x746D +0xBAC2 0x7504 +0xBAC3 0x7591 +0xBAC4 0x7627 +0xBAC5 0x760D +0xBAC6 0x760B +0xBAC7 0x7609 +0xBAC8 0x7613 +0xBAC9 0x76E1 +0xBACA 0x76E3 +0xBACB 0x7784 +0xBACC 0x777D +0xBACD 0x777F +0xBACE 0x7761 +0xBACF 0x78C1 +0xBAD0 0x789F +0xBAD1 0x78A7 +0xBAD2 0x78B3 +0xBAD3 0x78A9 +0xBAD4 0x78A3 +0xBAD5 0xBAD6 0x798E +0xBAD7 0x798D +0xBAD8 0x7A2E +0xBAD9 0x7A31 +0xBADA 0x7AAA +0xBADB 0x7AA9 +0xBADC 0x7AED +0xBADD 0x7AEF +0xBADE 0x7BA1 +0xBADF 0x7B95 +0xBAE0 0x7B8B +0xBAE1 0x7B75 +0xBAE2 0x7B97 +0xBAE3 0x7B9D +0xBAE4 0x7B94 +0xBAE5 0x7B8F +0xBAE6 0x7BB8 +0xBAE7 0x7B87 +0xBAE8 0x7B84 +0xBAE9 0x7CB9 +0xBAEA 0xBAEB 0x7CBD +0xBAEC 0x7DBB +0xBAED 0x7DB0 +0xBAEE 0x7D9C +0xBAEF 0xBAF0 0x7DBD +0xBAF1 0x7DA0 +0xBAF2 0x7DCA +0xBAF3 0x7DB4 +0xBAF4 0x7DB2 +0xBAF5 0x7DB1 +0xBAF6 0x7DBA +0xBAF7 0x7DA2 +0xBAF8 0x7DBF +0xBAF9 0x7DB5 +0xBAFA 0x7DB8 +0xBAFB 0x7DAD +0xBAFC 0x7DD2 +0xBAFD 0x7DC7 +0xBAFE 0x7DAC +0xBB40 0x7F70 +0xBB41 0xBB42 0x7FE0 +0xBB43 0x7FDF +0xBB44 0x805E +0xBB45 0x805A +0xBB46 0x8087 +0xBB47 0x8150 +0xBB48 0x8180 +0xBB49 0x818F +0xBB4A 0x8188 +0xBB4B 0x818A +0xBB4C 0x817F +0xBB4D 0x8182 +0xBB4E 0x81E7 +0xBB4F 0x81FA +0xBB50 0x8207 +0xBB51 0x8214 +0xBB52 0x821E +0xBB53 0x824B +0xBB54 0x84C9 +0xBB55 0x84BF +0xBB56 0x84C6 +0xBB57 0x84C4 +0xBB58 0x8499 +0xBB59 0x849E +0xBB5A 0x84B2 +0xBB5B 0x849C +0xBB5C 0x84CB +0xBB5D 0x84B8 +0xBB5E 0x84C0 +0xBB5F 0x84D3 +0xBB60 0x8490 +0xBB61 0x84BC +0xBB62 0x84D1 +0xBB63 0x84CA +0xBB64 0x873F +0xBB65 0x871C +0xBB66 0x873B +0xBB67 0x8722 +0xBB68 0x8725 +0xBB69 0x8734 +0xBB6A 0x8718 +0xBB6B 0x8755 +0xBB6C 0x8737 +0xBB6D 0x8729 +0xBB6E 0x88F3 +0xBB6F 0x8902 +0xBB70 0x88F4 +0xBB71 0x88F9 +0xBB72 0x88F8 +0xBB73 0x88FD +0xBB74 0x88E8 +0xBB75 0x891A +0xBB76 0x88EF +0xBB77 0x8AA6 +0xBB78 0x8A8C +0xBB79 0x8A9E +0xBB7A 0x8AA3 +0xBB7B 0x8A8D +0xBB7C 0x8AA1 +0xBB7D 0x8A93 +0xBB7E 0x8AA4 +0xBBA1 0x8AAA +0xBBA2 0x8AA5 +0xBBA3 0x8AA8 +0xBBA4 0x8A98 +0xBBA5 0x8A91 +0xBBA6 0x8A9A +0xBBA7 0x8AA7 +0xBBA8 0x8C6A +0xBBA9 0x8C8D +0xBBAA 0x8C8C +0xBBAB 0x8CD3 +0xBBAC 0xBBAD 0x8CD1 +0xBBAE 0x8D6B +0xBBAF 0x8D99 +0xBBB0 0x8D95 +0xBBB1 0x8DFC +0xBBB2 0x8F14 +0xBBB3 0x8F12 +0xBBB4 0x8F15 +0xBBB5 0x8F13 +0xBBB6 0x8FA3 +0xBBB7 0x9060 +0xBBB8 0x9058 +0xBBB9 0x905C +0xBBBA 0x9063 +0xBBBB 0x9059 +0xBBBC 0x905E +0xBBBD 0x9062 +0xBBBE 0x905D +0xBBBF 0x905B +0xBBC0 0x9119 +0xBBC1 0x9118 +0xBBC2 0x911E +0xBBC3 0x9175 +0xBBC4 0x9178 +0xBBC5 0x9177 +0xBBC6 0x9174 +0xBBC7 0x9278 +0xBBC8 0x9280 +0xBBC9 0x9285 +0xBBCA 0x9298 +0xBBCB 0x9296 +0xBBCC 0x927B +0xBBCD 0x9293 +0xBBCE 0x929C +0xBBCF 0x92A8 +0xBBD0 0x927C +0xBBD1 0x9291 +0xBBD2 0x95A1 +0xBBD3 0xBBD4 0x95A8 +0xBBD5 0x95A3 +0xBBD6 0x95A5 +0xBBD7 0x95A4 +0xBBD8 0x9699 +0xBBD9 0x969C +0xBBDA 0x969B +0xBBDB 0x96CC +0xBBDC 0x96D2 +0xBBDD 0x9700 +0xBBDE 0x977C +0xBBDF 0x9785 +0xBBE0 0x97F6 +0xBBE1 0xBBE2 0x9817 +0xBBE3 0x98AF +0xBBE4 0x98B1 +0xBBE5 0x9903 +0xBBE6 0x9905 +0xBBE7 0x990C +0xBBE8 0x9909 +0xBBE9 0x99C1 +0xBBEA 0xBBEB 0x9AAF +0xBBEC 0x9AE6 +0xBBED 0xBBEE 0x9B41 +0xBBEF 0x9CF4 +0xBBF0 0x9CF6 +0xBBF1 0x9CF3 +0xBBF2 0x9EBC +0xBBF3 0x9F3B +0xBBF4 0x9F4A +0xBBF5 0x5104 +0xBBF6 0x5100 +0xBBF7 0x50FB +0xBBF8 0x50F5 +0xBBF9 0x50F9 +0xBBFA 0x5102 +0xBBFB 0xBBFC 0x5108 +0xBBFD 0x5105 +0xBBFE 0x51DC +0xBC40 0xBC42 0x5287 +0xBC43 0x528D +0xBC44 0x528A +0xBC45 0x52F0 +0xBC46 0x53B2 +0xBC47 0x562E +0xBC48 0x563B +0xBC49 0x5639 +0xBC4A 0x5632 +0xBC4B 0x563F +0xBC4C 0x5634 +0xBC4D 0x5629 +0xBC4E 0x5653 +0xBC4F 0x564E +0xBC50 0x5657 +0xBC51 0x5674 +0xBC52 0x5636 +0xBC53 0xBC54 0x562F +0xBC55 0x5880 +0xBC56 0x589F +0xBC57 0x589E +0xBC58 0x58B3 +0xBC59 0x589C +0xBC5A 0x58AE +0xBC5B 0x58A9 +0xBC5C 0x58A6 +0xBC5D 0x596D +0xBC5E 0x5B09 +0xBC5F 0x5AFB +0xBC60 0x5B0B +0xBC61 0x5AF5 +0xBC62 0x5B0C +0xBC63 0x5B08 +0xBC64 0x5BEE +0xBC65 0x5BEC +0xBC66 0x5BE9 +0xBC67 0x5BEB +0xBC68 0xBC69 0x5C64 +0xBC6A 0x5D9D +0xBC6B 0x5D94 +0xBC6C 0x5E62 +0xBC6D 0x5E5F +0xBC6E 0x5E61 +0xBC6F 0x5EE2 +0xBC70 0x5EDA +0xBC71 0x5EDF +0xBC72 0x5EDD +0xBC73 0x5EE3 +0xBC74 0x5EE0 +0xBC75 0x5F48 +0xBC76 0x5F71 +0xBC77 0x5FB7 +0xBC78 0x5FB5 +0xBC79 0x6176 +0xBC7A 0x6167 +0xBC7B 0x616E +0xBC7C 0x615D +0xBC7D 0x6155 +0xBC7E 0x6182 +0xBCA1 0x617C +0xBCA2 0x6170 +0xBCA3 0x616B +0xBCA4 0x617E +0xBCA5 0x61A7 +0xBCA6 0x6190 +0xBCA7 0x61AB +0xBCA8 0x618E +0xBCA9 0x61AC +0xBCAA 0x619A +0xBCAB 0x61A4 +0xBCAC 0x6194 +0xBCAD 0x61AE +0xBCAE 0x622E +0xBCAF 0x6469 +0xBCB0 0x646F +0xBCB1 0x6479 +0xBCB2 0x649E +0xBCB3 0x64B2 +0xBCB4 0x6488 +0xBCB5 0x6490 +0xBCB6 0x64B0 +0xBCB7 0x64A5 +0xBCB8 0x6493 +0xBCB9 0x6495 +0xBCBA 0x64A9 +0xBCBB 0x6492 +0xBCBC 0x64AE +0xBCBD 0x64AD +0xBCBE 0x64AB +0xBCBF 0x649A +0xBCC0 0x64AC +0xBCC1 0x6499 +0xBCC2 0x64A2 +0xBCC3 0x64B3 +0xBCC4 0x6575 +0xBCC5 0xBCC6 0x6577 +0xBCC7 0x66AE +0xBCC8 0x66AB +0xBCC9 0x66B4 +0xBCCA 0x66B1 +0xBCCB 0x6A23 +0xBCCC 0x6A1F +0xBCCD 0x69E8 +0xBCCE 0x6A01 +0xBCCF 0x6A1E +0xBCD0 0x6A19 +0xBCD1 0x69FD +0xBCD2 0x6A21 +0xBCD3 0x6A13 +0xBCD4 0x6A0A +0xBCD5 0x69F3 +0xBCD6 0x6A02 +0xBCD7 0x6A05 +0xBCD8 0x69ED +0xBCD9 0x6A11 +0xBCDA 0x6B50 +0xBCDB 0x6B4E +0xBCDC 0x6BA4 +0xBCDD 0xBCDE 0x6BC5 +0xBCDF 0x6F3F +0xBCE0 0x6F7C +0xBCE1 0x6F84 +0xBCE2 0x6F51 +0xBCE3 0x6F66 +0xBCE4 0x6F54 +0xBCE5 0x6F86 +0xBCE6 0x6F6D +0xBCE7 0x6F5B +0xBCE8 0x6F78 +0xBCE9 0x6F6E +0xBCEA 0x6F8E +0xBCEB 0x6F7A +0xBCEC 0x6F70 +0xBCED 0x6F64 +0xBCEE 0x6F97 +0xBCEF 0x6F58 +0xBCF0 0x6ED5 +0xBCF1 0x6F6F +0xBCF2 0x6F60 +0xBCF3 0x6F5F +0xBCF4 0x719F +0xBCF5 0x71AC +0xBCF6 0x71B1 +0xBCF7 0x71A8 +0xBCF8 0x7256 +0xBCF9 0x729B +0xBCFA 0x734E +0xBCFB 0x7357 +0xBCFC 0x7469 +0xBCFD 0x748B +0xBCFE 0x7483 +0xBD40 0x747E +0xBD41 0x7480 +0xBD42 0x757F +0xBD43 0x7620 +0xBD44 0x7629 +0xBD45 0x761F +0xBD46 0x7624 +0xBD47 0x7626 +0xBD48 0xBD49 0x7621 +0xBD4A 0x769A +0xBD4B 0x76BA +0xBD4C 0x76E4 +0xBD4D 0x778E +0xBD4E 0x7787 +0xBD4F 0x778C +0xBD50 0x7791 +0xBD51 0x778B +0xBD52 0x78CB +0xBD53 0x78C5 +0xBD54 0x78BA +0xBD55 0x78CA +0xBD56 0x78BE +0xBD57 0x78D5 +0xBD58 0x78BC +0xBD59 0x78D0 +0xBD5A 0x7A3F +0xBD5B 0x7A3C +0xBD5C 0x7A40 +0xBD5D 0x7A3D +0xBD5E 0x7A37 +0xBD5F 0x7A3B +0xBD60 0x7AAF +0xBD61 0x7AAE +0xBD62 0x7BAD +0xBD63 0x7BB1 +0xBD64 0x7BC4 +0xBD65 0x7BB4 +0xBD66 0xBD67 0x7BC6 +0xBD68 0x7BC1 +0xBD69 0x7BA0 +0xBD6A 0x7BCC +0xBD6B 0x7CCA +0xBD6C 0x7DE0 +0xBD6D 0x7DF4 +0xBD6E 0x7DEF +0xBD6F 0x7DFB +0xBD70 0x7DD8 +0xBD71 0x7DEC +0xBD72 0x7DDD +0xBD73 0x7DE8 +0xBD74 0x7DE3 +0xBD75 0x7DDA +0xBD76 0x7DDE +0xBD77 0x7DE9 +0xBD78 0x7D9E +0xBD79 0x7DD9 +0xBD7A 0x7DF2 +0xBD7B 0x7DF9 +0xBD7C 0x7F75 +0xBD7D 0x7F77 +0xBD7E 0x7FAF +0xBDA1 0x7FE9 +0xBDA2 0x8026 +0xBDA3 0xBDA5 0x819B +0xBDA6 0x81A0 +0xBDA7 0x819A +0xBDA8 0x8198 +0xBDA9 0x8517 +0xBDAA 0x853D +0xBDAB 0x851A +0xBDAC 0x84EE +0xBDAD 0xBDAE 0x852C +0xBDAF 0x8513 +0xBDB0 0x8511 +0xBDB1 0x8523 +0xBDB2 0x8521 +0xBDB3 0x8514 +0xBDB4 0x84EC +0xBDB5 0x8525 +0xBDB6 0x84FF +0xBDB7 0x8506 +0xBDB8 0x8782 +0xBDB9 0x8774 +0xBDBA 0x8776 +0xBDBB 0x8760 +0xBDBC 0x8766 +0xBDBD 0x8778 +0xBDBE 0x8768 +0xBDBF 0x8759 +0xBDC0 0x8757 +0xBDC1 0x874C +0xBDC2 0x8753 +0xBDC3 0x885B +0xBDC4 0x885D +0xBDC5 0x8910 +0xBDC6 0x8907 +0xBDC7 0xBDC8 0x8912 +0xBDC9 0x8915 +0xBDCA 0x890A +0xBDCB 0x8ABC +0xBDCC 0x8AD2 +0xBDCD 0x8AC7 +0xBDCE 0x8AC4 +0xBDCF 0x8A95 +0xBDD0 0x8ACB +0xBDD1 0x8AF8 +0xBDD2 0x8AB2 +0xBDD3 0x8AC9 +0xBDD4 0x8AC2 +0xBDD5 0x8ABF +0xBDD6 0x8AB0 +0xBDD7 0x8AD6 +0xBDD8 0x8ACD +0xBDD9 0x8AB6 +0xBDDA 0x8AB9 +0xBDDB 0x8ADB +0xBDDC 0x8C4C +0xBDDD 0x8C4E +0xBDDE 0x8C6C +0xBDDF 0x8CE0 +0xBDE0 0x8CDE +0xBDE1 0x8CE6 +0xBDE2 0x8CE4 +0xBDE3 0xBDE4 0x8CEC +0xBDE5 0xBDE6 0x8CE2 +0xBDE7 0x8CDC +0xBDE8 0x8CEA +0xBDE9 0x8CE1 +0xBDEA 0x8D6D +0xBDEB 0x8D9F +0xBDEC 0x8DA3 +0xBDED 0x8E2B +0xBDEE 0x8E10 +0xBDEF 0x8E1D +0xBDF0 0x8E22 +0xBDF1 0x8E0F +0xBDF2 0x8E29 +0xBDF3 0x8E1F +0xBDF4 0x8E21 +0xBDF5 0x8E1E +0xBDF6 0x8EBA +0xBDF7 0x8F1D +0xBDF8 0x8F1B +0xBDF9 0x8F1F +0xBDFA 0x8F29 +0xBDFB 0x8F26 +0xBDFC 0x8F2A +0xBDFD 0x8F1C +0xBDFE 0x8F1E +0xBE40 0x8F25 +0xBE41 0x9069 +0xBE42 0x906E +0xBE43 0x9068 +0xBE44 0x906D +0xBE45 0x9077 +0xBE46 0x9130 +0xBE47 0x912D +0xBE48 0x9127 +0xBE49 0x9131 +0xBE4A 0x9187 +0xBE4B 0x9189 +0xBE4C 0x918B +0xBE4D 0x9183 +0xBE4E 0x92C5 +0xBE4F 0x92BB +0xBE50 0x92B7 +0xBE51 0x92EA +0xBE52 0x92AC +0xBE53 0x92E4 +0xBE54 0x92C1 +0xBE55 0x92B3 +0xBE56 0x92BC +0xBE57 0x92D2 +0xBE58 0x92C7 +0xBE59 0x92F0 +0xBE5A 0x92B2 +0xBE5B 0x95AD +0xBE5C 0x95B1 +0xBE5D 0x9704 +0xBE5E 0xBE5F 0x9706 +0xBE60 0x9709 +0xBE61 0x9760 +0xBE62 0x978D +0xBE63 0x978B +0xBE64 0x978F +0xBE65 0x9821 +0xBE66 0x982B +0xBE67 0x981C +0xBE68 0x98B3 +0xBE69 0x990A +0xBE6A 0x9913 +0xBE6B 0x9912 +0xBE6C 0x9918 +0xBE6D 0x99DD +0xBE6E 0x99D0 +0xBE6F 0x99DF +0xBE70 0x99DB +0xBE71 0x99D1 +0xBE72 0x99D5 +0xBE73 0x99D2 +0xBE74 0x99D9 +0xBE75 0x9AB7 +0xBE76 0xBE77 0x9AEE +0xBE78 0x9B27 +0xBE79 0x9B45 +0xBE7A 0x9B44 +0xBE7B 0x9B77 +0xBE7C 0x9B6F +0xBE7D 0x9D06 +0xBE7E 0x9D09 +0xBEA1 0x9D03 +0xBEA2 0x9EA9 +0xBEA3 0x9EBE +0xBEA4 0x9ECE +0xBEA5 0x58A8 +0xBEA6 0x9F52 +0xBEA7 0x5112 +0xBEA8 0x5118 +0xBEA9 0x5114 +0xBEAA 0x5110 +0xBEAB 0x5115 +0xBEAC 0x5180 +0xBEAD 0x51AA +0xBEAE 0x51DD +0xBEAF 0x5291 +0xBEB0 0x5293 +0xBEB1 0x52F3 +0xBEB2 0x5659 +0xBEB3 0x566B +0xBEB4 0x5679 +0xBEB5 0x5669 +0xBEB6 0x5664 +0xBEB7 0x5678 +0xBEB8 0x566A +0xBEB9 0x5668 +0xBEBA 0x5665 +0xBEBB 0x5671 +0xBEBC 0x566F +0xBEBD 0x566C +0xBEBE 0x5662 +0xBEBF 0x5676 +0xBEC0 0x58C1 +0xBEC1 0x58BE +0xBEC2 0x58C7 +0xBEC3 0x58C5 +0xBEC4 0x596E +0xBEC5 0x5B1D +0xBEC6 0x5B34 +0xBEC7 0x5B78 +0xBEC8 0x5BF0 +0xBEC9 0x5C0E +0xBECA 0x5F4A +0xBECB 0x61B2 +0xBECC 0x6191 +0xBECD 0x61A9 +0xBECE 0x618A +0xBECF 0x61CD +0xBED0 0x61B6 +0xBED1 0x61BE +0xBED2 0x61CA +0xBED3 0x61C8 +0xBED4 0x6230 +0xBED5 0x64C5 +0xBED6 0x64C1 +0xBED7 0x64CB +0xBED8 0xBED9 0x64BB +0xBEDA 0x64DA +0xBEDB 0x64C4 +0xBEDC 0x64C7 +0xBEDD 0x64C2 +0xBEDE 0x64CD +0xBEDF 0x64BF +0xBEE0 0x64D2 +0xBEE1 0x64D4 +0xBEE2 0x64BE +0xBEE3 0x6574 +0xBEE4 0x66C6 +0xBEE5 0x66C9 +0xBEE6 0x66B9 +0xBEE7 0x66C4 +0xBEE8 0x66C7 +0xBEE9 0x66B8 +0xBEEA 0x6A3D +0xBEEB 0x6A38 +0xBEEC 0x6A3A +0xBEED 0x6A59 +0xBEEE 0x6A6B +0xBEEF 0x6A58 +0xBEF0 0x6A39 +0xBEF1 0x6A44 +0xBEF2 0x6A62 +0xBEF3 0x6A61 +0xBEF4 0x6A4B +0xBEF5 0x6A47 +0xBEF6 0x6A35 +0xBEF7 0x6A5F +0xBEF8 0x6A48 +0xBEF9 0x6B59 +0xBEFA 0x6B77 +0xBEFB 0x6C05 +0xBEFC 0x6FC2 +0xBEFD 0x6FB1 +0xBEFE 0x6FA1 +0xBF40 0x6FC3 +0xBF41 0x6FA4 +0xBF42 0x6FC1 +0xBF43 0x6FA7 +0xBF44 0x6FB3 +0xBF45 0x6FC0 +0xBF46 0x6FB9 +0xBF47 0x6FB6 +0xBF48 0x6FA6 +0xBF49 0x6FA0 +0xBF4A 0x6FB4 +0xBF4B 0x71BE +0xBF4C 0x71C9 +0xBF4D 0x71D0 +0xBF4E 0x71D2 +0xBF4F 0x71C8 +0xBF50 0x71D5 +0xBF51 0x71B9 +0xBF52 0x71CE +0xBF53 0x71D9 +0xBF54 0x71DC +0xBF55 0xBF56 0x71C3 +0xBF57 0x7368 +0xBF58 0x749C +0xBF59 0x74A3 +0xBF5A 0x7498 +0xBF5B 0x749F +0xBF5C 0x749E +0xBF5D 0x74E2 +0xBF5E 0xBF5F 0x750C +0xBF60 0x7634 +0xBF61 0x7638 +0xBF62 0x763A +0xBF63 0x76E7 +0xBF64 0x76E5 +0xBF65 0x77A0 +0xBF66 0xBF67 0x779E +0xBF68 0x77A5 +0xBF69 0x78E8 +0xBF6A 0x78DA +0xBF6B 0x78EC +0xBF6C 0x78E7 +0xBF6D 0x79A6 +0xBF6E 0xBF6F 0x7A4D +0xBF70 0x7A46 +0xBF71 0x7A4C +0xBF72 0x7A4B +0xBF73 0x7ABA +0xBF74 0x7BD9 +0xBF75 0x7C11 +0xBF76 0x7BC9 +0xBF77 0x7BE4 +0xBF78 0x7BDB +0xBF79 0x7BE1 +0xBF7A 0x7BE9 +0xBF7B 0x7BE6 +0xBF7C 0xBF7D 0x7CD5 +0xBF7E 0x7E0A +0xBFA1 0x7E11 +0xBFA2 0x7E08 +0xBFA3 0x7E1B +0xBFA4 0x7E23 +0xBFA5 0x7E1E +0xBFA6 0x7E1D +0xBFA7 0x7E09 +0xBFA8 0x7E10 +0xBFA9 0x7F79 +0xBFAA 0x7FB2 +0xBFAB 0xBFAC 0x7FF0 +0xBFAD 0x7FEE +0xBFAE 0x8028 +0xBFAF 0x81B3 +0xBFB0 0x81A9 +0xBFB1 0x81A8 +0xBFB2 0x81FB +0xBFB3 0x8208 +0xBFB4 0xBFB5 0x8258 +0xBFB6 0x854A +0xBFB7 0x8559 +0xBFB8 0x8548 +0xBFB9 0xBFBA 0x8568 +0xBFBB 0x8543 +0xBFBC 0x8549 +0xBFBD 0x856D +0xBFBE 0x856A +0xBFBF 0x855E +0xBFC0 0x8783 +0xBFC1 0x879F +0xBFC2 0x879E +0xBFC3 0x87A2 +0xBFC4 0x878D +0xBFC5 0x8861 +0xBFC6 0x892A +0xBFC7 0x8932 +0xBFC8 0x8925 +0xBFC9 0x892B +0xBFCA 0x8921 +0xBFCB 0x89AA +0xBFCC 0x89A6 +0xBFCD 0x8AE6 +0xBFCE 0x8AFA +0xBFCF 0x8AEB +0xBFD0 0x8AF1 +0xBFD1 0x8B00 +0xBFD2 0x8ADC +0xBFD3 0x8AE7 +0xBFD4 0x8AEE +0xBFD5 0x8AFE +0xBFD6 0xBFD7 0x8B01 +0xBFD8 0x8AF7 +0xBFD9 0x8AED +0xBFDA 0x8AF3 +0xBFDB 0x8AF6 +0xBFDC 0x8AFC +0xBFDD 0x8C6B +0xBFDE 0x8C6D +0xBFDF 0x8C93 +0xBFE0 0x8CF4 +0xBFE1 0x8E44 +0xBFE2 0x8E31 +0xBFE3 0x8E34 +0xBFE4 0x8E42 +0xBFE5 0x8E39 +0xBFE6 0x8E35 +0xBFE7 0x8F3B +0xBFE8 0x8F2F +0xBFE9 0x8F38 +0xBFEA 0x8F33 +0xBFEB 0x8FA8 +0xBFEC 0x8FA6 +0xBFED 0x9075 +0xBFEE 0x9074 +0xBFEF 0x9078 +0xBFF0 0x9072 +0xBFF1 0x907C +0xBFF2 0x907A +0xBFF3 0x9134 +0xBFF4 0x9192 +0xBFF5 0x9320 +0xBFF6 0x9336 +0xBFF7 0x92F8 +0xBFF8 0x9333 +0xBFF9 0x932F +0xBFFA 0x9322 +0xBFFB 0x92FC +0xBFFC 0x932B +0xBFFD 0x9304 +0xBFFE 0x931A +0xC040 0x9310 +0xC041 0x9326 +0xC042 0x9321 +0xC043 0x9315 +0xC044 0x932E +0xC045 0x9319 +0xC046 0x95BB +0xC047 0xC048 0x96A7 +0xC049 0x96AA +0xC04A 0x96D5 +0xC04B 0x970E +0xC04C 0x9711 +0xC04D 0x9716 +0xC04E 0x970D +0xC04F 0x9713 +0xC050 0x970F +0xC051 0xC052 0x975B +0xC053 0x9766 +0xC054 0x9798 +0xC055 0x9830 +0xC056 0x9838 +0xC057 0x983B +0xC058 0x9837 +0xC059 0x982D +0xC05A 0x9839 +0xC05B 0x9824 +0xC05C 0x9910 +0xC05D 0x9928 +0xC05E 0x991E +0xC05F 0x991B +0xC060 0x9921 +0xC061 0x991A +0xC062 0x99ED +0xC063 0x99E2 +0xC064 0x99F1 +0xC065 0x9AB8 +0xC066 0x9ABC +0xC067 0x9AFB +0xC068 0x9AED +0xC069 0x9B28 +0xC06A 0x9B91 +0xC06B 0x9D15 +0xC06C 0x9D23 +0xC06D 0x9D26 +0xC06E 0x9D28 +0xC06F 0x9D12 +0xC070 0x9D1B +0xC071 0x9ED8 +0xC072 0x9ED4 +0xC073 0x9F8D +0xC074 0x9F9C +0xC075 0x512A +0xC076 0x511F +0xC077 0x5121 +0xC078 0x5132 +0xC079 0x52F5 +0xC07A 0x568E +0xC07B 0x5680 +0xC07C 0x5690 +0xC07D 0x5685 +0xC07E 0x5687 +0xC0A1 0x568F +0xC0A2 0x58D5 +0xC0A3 0x58D3 +0xC0A4 0x58D1 +0xC0A5 0x58CE +0xC0A6 0x5B30 +0xC0A7 0x5B2A +0xC0A8 0x5B24 +0xC0A9 0x5B7A +0xC0AA 0x5C37 +0xC0AB 0x5C68 +0xC0AC 0x5DBC +0xC0AD 0x5DBA +0xC0AE 0x5DBD +0xC0AF 0x5DB8 +0xC0B0 0x5E6B +0xC0B1 0x5F4C +0xC0B2 0x5FBD +0xC0B3 0x61C9 +0xC0B4 0x61C2 +0xC0B5 0x61C7 +0xC0B6 0x61E6 +0xC0B7 0x61CB +0xC0B8 0x6232 +0xC0B9 0x6234 +0xC0BA 0x64CE +0xC0BB 0x64CA +0xC0BC 0x64D8 +0xC0BD 0x64E0 +0xC0BE 0x64F0 +0xC0BF 0x64E6 +0xC0C0 0x64EC +0xC0C1 0x64F1 +0xC0C2 0x64E2 +0xC0C3 0x64ED +0xC0C4 0xC0C5 0x6582 +0xC0C6 0x66D9 +0xC0C7 0x66D6 +0xC0C8 0x6A80 +0xC0C9 0x6A94 +0xC0CA 0x6A84 +0xC0CB 0x6AA2 +0xC0CC 0x6A9C +0xC0CD 0x6ADB +0xC0CE 0x6AA3 +0xC0CF 0x6A7E +0xC0D0 0x6A97 +0xC0D1 0x6A90 +0xC0D2 0x6AA0 +0xC0D3 0x6B5C +0xC0D4 0x6BAE +0xC0D5 0x6BDA +0xC0D6 0x6C08 +0xC0D7 0x6FD8 +0xC0D8 0x6FF1 +0xC0D9 0xC0DA 0x6FDF +0xC0DB 0x6FDB +0xC0DC 0x6FE4 +0xC0DD 0x6FEB +0xC0DE 0x6FEF +0xC0DF 0x6F80 +0xC0E0 0x6FEC +0xC0E1 0x6FE1 +0xC0E2 0x6FE9 +0xC0E3 0x6FD5 +0xC0E4 0x6FEE +0xC0E5 0x6FF0 +0xC0E6 0x71E7 +0xC0E7 0x71DF +0xC0E8 0x71EE +0xC0E9 0x71E6 +0xC0EA 0x71E5 +0xC0EB 0x71ED +0xC0EC 0x71EC +0xC0ED 0x71F4 +0xC0EE 0x71E0 +0xC0EF 0x7235 +0xC0F0 0x7246 +0xC0F1 0x7370 +0xC0F2 0x7372 +0xC0F3 0x74A9 +0xC0F4 0x74B0 +0xC0F5 0x74A6 +0xC0F6 0x74A8 +0xC0F7 0x7646 +0xC0F8 0x7642 +0xC0F9 0x764C +0xC0FA 0x76EA +0xC0FB 0x77B3 +0xC0FC 0x77AA +0xC0FD 0x77B0 +0xC0FE 0x77AC +0xC140 0x77A7 +0xC141 0x77AD +0xC142 0x77EF +0xC143 0x78F7 +0xC144 0x78FA +0xC145 0x78F4 +0xC146 0x78EF +0xC147 0x7901 +0xC148 0x79A7 +0xC149 0x79AA +0xC14A 0x7A57 +0xC14B 0x7ABF +0xC14C 0x7C07 +0xC14D 0x7C0D +0xC14E 0x7BFE +0xC14F 0x7BF7 +0xC150 0x7C0C +0xC151 0x7BE0 +0xC152 0x7CE0 +0xC153 0x7CDC +0xC154 0x7CDE +0xC155 0x7CE2 +0xC156 0x7CDF +0xC157 0x7CD9 +0xC158 0x7CDD +0xC159 0x7E2E +0xC15A 0x7E3E +0xC15B 0x7E46 +0xC15C 0x7E37 +0xC15D 0x7E32 +0xC15E 0x7E43 +0xC15F 0x7E2B +0xC160 0x7E3D +0xC161 0x7E31 +0xC162 0x7E45 +0xC163 0x7E41 +0xC164 0x7E34 +0xC165 0x7E39 +0xC166 0x7E48 +0xC167 0x7E35 +0xC168 0x7E3F +0xC169 0x7E2F +0xC16A 0x7F44 +0xC16B 0x7FF3 +0xC16C 0x7FFC +0xC16D 0xC16E 0x8071 +0xC16F 0x8070 +0xC170 0x806F +0xC171 0x8073 +0xC172 0x81C6 +0xC173 0x81C3 +0xC174 0x81BA +0xC175 0x81C2 +0xC176 0x81C0 +0xC177 0x81BF +0xC178 0x81BD +0xC179 0x81C9 +0xC17A 0x81BE +0xC17B 0x81E8 +0xC17C 0x8209 +0xC17D 0x8271 +0xC17E 0x85AA +0xC1A1 0x8584 +0xC1A2 0x857E +0xC1A3 0x859C +0xC1A4 0x8591 +0xC1A5 0x8594 +0xC1A6 0x85AF +0xC1A7 0x859B +0xC1A8 0x8587 +0xC1A9 0x85A8 +0xC1AA 0x858A +0xC1AB 0x8667 +0xC1AC 0x87C0 +0xC1AD 0x87D1 +0xC1AE 0x87B3 +0xC1AF 0x87D2 +0xC1B0 0x87C6 +0xC1B1 0x87AB +0xC1B2 0x87BB +0xC1B3 0x87BA +0xC1B4 0x87C8 +0xC1B5 0x87CB +0xC1B6 0x893B +0xC1B7 0x8936 +0xC1B8 0x8944 +0xC1B9 0x8938 +0xC1BA 0x893D +0xC1BB 0x89AC +0xC1BC 0x8B0E +0xC1BD 0x8B17 +0xC1BE 0x8B19 +0xC1BF 0x8B1B +0xC1C0 0x8B0A +0xC1C1 0x8B20 +0xC1C2 0x8B1D +0xC1C3 0x8B04 +0xC1C4 0x8B10 +0xC1C5 0x8C41 +0xC1C6 0x8C3F +0xC1C7 0x8C73 +0xC1C8 0x8CFA +0xC1C9 0x8CFD +0xC1CA 0x8CFC +0xC1CB 0x8CF8 +0xC1CC 0x8CFB +0xC1CD 0x8DA8 +0xC1CE 0x8E49 +0xC1CF 0x8E4B +0xC1D0 0x8E48 +0xC1D1 0x8E4A +0xC1D2 0x8F44 +0xC1D3 0x8F3E +0xC1D4 0x8F42 +0xC1D5 0x8F45 +0xC1D6 0x8F3F +0xC1D7 0x907F +0xC1D8 0x907D +0xC1D9 0x9084 +0xC1DA 0xC1DB 0x9081 +0xC1DC 0x9080 +0xC1DD 0x9139 +0xC1DE 0x91A3 +0xC1DF 0x919E +0xC1E0 0x919C +0xC1E1 0x934D +0xC1E2 0x9382 +0xC1E3 0x9328 +0xC1E4 0x9375 +0xC1E5 0x934A +0xC1E6 0x9365 +0xC1E7 0x934B +0xC1E8 0x9318 +0xC1E9 0x937E +0xC1EA 0x936C +0xC1EB 0x935B +0xC1EC 0x9370 +0xC1ED 0x935A +0xC1EE 0x9354 +0xC1EF 0xC1F1 0x95CA +0xC1F2 0x95C8 +0xC1F3 0x95C6 +0xC1F4 0x96B1 +0xC1F5 0x96B8 +0xC1F6 0x96D6 +0xC1F7 0x971C +0xC1F8 0x971E +0xC1F9 0x97A0 +0xC1FA 0x97D3 +0xC1FB 0x9846 +0xC1FC 0x98B6 +0xC1FD 0x9935 +0xC1FE 0x9A01 +0xC240 0x99FF +0xC241 0x9BAE +0xC242 0x9BAB +0xC243 0x9BAA +0xC244 0x9BAD +0xC245 0x9D3B +0xC246 0x9D3F +0xC247 0x9E8B +0xC248 0x9ECF +0xC249 0x9EDE +0xC24A 0xC24B 0x9EDC +0xC24C 0x9EDB +0xC24D 0x9F3E +0xC24E 0x9F4B +0xC24F 0x53E2 +0xC250 0x5695 +0xC251 0x56AE +0xC252 0x58D9 +0xC253 0x58D8 +0xC254 0x5B38 +0xC255 0x5F5D +0xC256 0x61E3 +0xC257 0x6233 +0xC258 0x64F4 +0xC259 0x64F2 +0xC25A 0x64FE +0xC25B 0x6506 +0xC25C 0xC25D 0x64FA +0xC25E 0x64F7 +0xC25F 0x65B7 +0xC260 0x66DC +0xC261 0x6726 +0xC262 0x6AB3 +0xC263 0x6AAC +0xC264 0x6AC3 +0xC265 0x6ABB +0xC266 0x6AB8 +0xC267 0x6AC2 +0xC268 0xC269 0x6AAE +0xC26A 0x6B5F +0xC26B 0x6B78 +0xC26C 0x6BAF +0xC26D 0x7009 +0xC26E 0x700B +0xC26F 0x6FFE +0xC270 0x7006 +0xC271 0x6FFA +0xC272 0x7011 +0xC273 0x700F +0xC274 0xC275 0x71FB +0xC276 0x71FE +0xC277 0x71F8 +0xC278 0x7377 +0xC279 0x7375 +0xC27A 0x74A7 +0xC27B 0x74BF +0xC27C 0x7515 +0xC27D 0x7656 +0xC27E 0x7658 +0xC2A1 0x7652 +0xC2A2 0x77BD +0xC2A3 0x77BF +0xC2A4 0xC2A5 0x77BB +0xC2A6 0x790E +0xC2A7 0x79AE +0xC2A8 0xC2A9 0x7A61 +0xC2AA 0x7A60 +0xC2AB 0xC2AC 0x7AC4 +0xC2AD 0x7C2B +0xC2AE 0x7C27 +0xC2AF 0x7C2A +0xC2B0 0x7C1E +0xC2B1 0x7C23 +0xC2B2 0x7C21 +0xC2B3 0x7CE7 +0xC2B4 0xC2B5 0x7E54 +0xC2B6 0x7E5E +0xC2B7 0x7E5A +0xC2B8 0x7E61 +0xC2B9 0x7E52 +0xC2BA 0x7E59 +0xC2BB 0x7F48 +0xC2BC 0x7FF9 +0xC2BD 0x7FFB +0xC2BE 0x8077 +0xC2BF 0x8076 +0xC2C0 0x81CD +0xC2C1 0x81CF +0xC2C2 0x820A +0xC2C3 0x85CF +0xC2C4 0x85A9 +0xC2C5 0x85CD +0xC2C6 0x85D0 +0xC2C7 0x85C9 +0xC2C8 0x85B0 +0xC2C9 0x85BA +0xC2CA 0x85B9 +0xC2CB 0x85A6 +0xC2CC 0x87EF +0xC2CD 0x87EC +0xC2CE 0x87F2 +0xC2CF 0x87E0 +0xC2D0 0x8986 +0xC2D1 0x89B2 +0xC2D2 0x89F4 +0xC2D3 0x8B28 +0xC2D4 0x8B39 +0xC2D5 0x8B2C +0xC2D6 0x8B2B +0xC2D7 0x8C50 +0xC2D8 0x8D05 +0xC2D9 0x8E59 +0xC2DA 0x8E63 +0xC2DB 0x8E66 +0xC2DC 0x8E64 +0xC2DD 0x8E5F +0xC2DE 0x8E55 +0xC2DF 0x8EC0 +0xC2E0 0x8F49 +0xC2E1 0x8F4D +0xC2E2 0x9087 +0xC2E3 0x9083 +0xC2E4 0x9088 +0xC2E5 0xC2E6 0x91AB +0xC2E7 0x91D0 +0xC2E8 0x9394 +0xC2E9 0x938A +0xC2EA 0x9396 +0xC2EB 0x93A2 +0xC2EC 0x93B3 +0xC2ED 0x93AE +0xC2EE 0x93AC +0xC2EF 0x93B0 +0xC2F0 0x9398 +0xC2F1 0x939A +0xC2F2 0x9397 +0xC2F3 0x95D4 +0xC2F4 0x95D6 +0xC2F5 0x95D0 +0xC2F6 0x95D5 +0xC2F7 0x96E2 +0xC2F8 0x96DC +0xC2F9 0x96D9 +0xC2FA 0x96DB +0xC2FB 0x96DE +0xC2FC 0x9724 +0xC2FD 0x97A3 +0xC2FE 0x97A6 +0xC340 0x97AD +0xC341 0x97F9 +0xC342 0x984D +0xC343 0x984F +0xC344 0x984C +0xC345 0x984E +0xC346 0x9853 +0xC347 0x98BA +0xC348 0xC349 0x993E +0xC34A 0x993D +0xC34B 0x992E +0xC34C 0x99A5 +0xC34D 0x9A0E +0xC34E 0x9AC1 +0xC34F 0x9B03 +0xC350 0x9B06 +0xC351 0x9B4F +0xC352 0x9B4E +0xC353 0x9B4D +0xC354 0x9BCA +0xC355 0x9BC9 +0xC356 0x9BFD +0xC357 0x9BC8 +0xC358 0x9BC0 +0xC359 0x9D51 +0xC35A 0x9D5D +0xC35B 0x9D60 +0xC35C 0x9EE0 +0xC35D 0x9F15 +0xC35E 0x9F2C +0xC35F 0x5133 +0xC360 0x56A5 +0xC361 0xC362 0x58DE +0xC363 0x58E2 +0xC364 0x5BF5 +0xC365 0x9F90 +0xC366 0x5EEC +0xC367 0x61F2 +0xC368 0x61F7 +0xC369 0x61F6 +0xC36A 0x61F5 +0xC36B 0x6500 +0xC36C 0x650F +0xC36D 0x66E0 +0xC36E 0x66DD +0xC36F 0x6AE5 +0xC370 0x6ADD +0xC371 0x6ADA +0xC372 0x6AD3 +0xC373 0x701B +0xC374 0x701F +0xC375 0x7028 +0xC376 0x701A +0xC377 0x701D +0xC378 0x7015 +0xC379 0x7018 +0xC37A 0x7206 +0xC37B 0x720D +0xC37C 0x7258 +0xC37D 0x72A2 +0xC37E 0x7378 +0xC3A1 0x737A +0xC3A2 0x74BD +0xC3A3 0x74CA +0xC3A4 0x74E3 +0xC3A5 0x7587 +0xC3A6 0x7586 +0xC3A7 0x765F +0xC3A8 0x7661 +0xC3A9 0x77C7 +0xC3AA 0x7919 +0xC3AB 0x79B1 +0xC3AC 0x7A6B +0xC3AD 0x7A69 +0xC3AE 0xC3AF 0x7C3E +0xC3B0 0x7C38 +0xC3B1 0x7C3D +0xC3B2 0x7C37 +0xC3B3 0x7C40 +0xC3B4 0x7E6B +0xC3B5 0x7E6D +0xC3B6 0x7E79 +0xC3B7 0xC3B8 0x7E69 +0xC3B9 0x7F85 +0xC3BA 0x7E73 +0xC3BB 0x7FB6 +0xC3BC 0x7FB9 +0xC3BD 0x7FB8 +0xC3BE 0x81D8 +0xC3BF 0x85E9 +0xC3C0 0x85DD +0xC3C1 0x85EA +0xC3C2 0x85D5 +0xC3C3 0xC3C4 0x85E4 +0xC3C5 0x85F7 +0xC3C6 0x87FB +0xC3C7 0x8805 +0xC3C8 0x880D +0xC3C9 0x87F9 +0xC3CA 0x87FE +0xC3CB 0x8960 +0xC3CC 0x895F +0xC3CD 0x8956 +0xC3CE 0x895E +0xC3CF 0x8B41 +0xC3D0 0x8B5C +0xC3D1 0x8B58 +0xC3D2 0x8B49 +0xC3D3 0x8B5A +0xC3D4 0xC3D5 0x8B4E +0xC3D6 0x8B46 +0xC3D7 0x8B59 +0xC3D8 0x8D08 +0xC3D9 0x8D0A +0xC3DA 0x8E7C +0xC3DB 0x8E72 +0xC3DC 0x8E87 +0xC3DD 0x8E76 +0xC3DE 0x8E6C +0xC3DF 0x8E7A +0xC3E0 0x8E74 +0xC3E1 0x8F54 +0xC3E2 0x8F4E +0xC3E3 0x8FAD +0xC3E4 0xC3E5 0x908A +0xC3E6 0x91B1 +0xC3E7 0x91AE +0xC3E8 0x93E1 +0xC3E9 0x93D1 +0xC3EA 0x93DF +0xC3EB 0x93C3 +0xC3EC 0x93C8 +0xC3ED 0xC3EE 0x93DC +0xC3EF 0x93D6 +0xC3F0 0x93E2 +0xC3F1 0x93CD +0xC3F2 0x93D8 +0xC3F3 0x93E4 +0xC3F4 0x93D7 +0xC3F5 0x93E8 +0xC3F6 0x95DC +0xC3F7 0x96B4 +0xC3F8 0x96E3 +0xC3F9 0x972A +0xC3FA 0x9727 +0xC3FB 0x9761 +0xC3FC 0x97DC +0xC3FD 0x97FB +0xC3FE 0x985E +0xC440 0x9858 +0xC441 0x985B +0xC442 0x98BC +0xC443 0x9945 +0xC444 0x9949 +0xC445 0x9A16 +0xC446 0x9A19 +0xC447 0x9B0D +0xC448 0x9BE8 +0xC449 0x9BE7 +0xC44A 0x9BD6 +0xC44B 0x9BDB +0xC44C 0x9D89 +0xC44D 0x9D61 +0xC44E 0x9D72 +0xC44F 0x9D6A +0xC450 0x9D6C +0xC451 0x9E92 +0xC452 0x9E97 +0xC453 0x9E93 +0xC454 0x9EB4 +0xC455 0x52F8 +0xC456 0x56A8 +0xC457 0x56B7 +0xC458 0x56B6 +0xC459 0x56B4 +0xC45A 0x56BC +0xC45B 0x58E4 +0xC45C 0x5B40 +0xC45D 0x5B43 +0xC45E 0x5B7D +0xC45F 0x5BF6 +0xC460 0x5DC9 +0xC461 0x61F8 +0xC462 0x61FA +0xC463 0x6518 +0xC464 0x6514 +0xC465 0x6519 +0xC466 0x66E6 +0xC467 0x6727 +0xC468 0x6AEC +0xC469 0x703E +0xC46A 0x7030 +0xC46B 0x7032 +0xC46C 0x7210 +0xC46D 0x737B +0xC46E 0x74CF +0xC46F 0x7662 +0xC470 0x7665 +0xC471 0x7926 +0xC472 0x792A +0xC473 0x792C +0xC474 0x792B +0xC475 0x7AC7 +0xC476 0x7AF6 +0xC477 0x7C4C +0xC478 0x7C43 +0xC479 0x7C4D +0xC47A 0xC47B 0x7CEF +0xC47C 0x8FAE +0xC47D 0x7E7D +0xC47E 0x7E7C +0xC4A1 0x7E82 +0xC4A2 0x7F4C +0xC4A3 0x8000 +0xC4A4 0x81DA +0xC4A5 0x8266 +0xC4A6 0x85FB +0xC4A7 0x85F9 +0xC4A8 0x8611 +0xC4A9 0x85FA +0xC4AA 0x8606 +0xC4AB 0x860B +0xC4AC 0x8607 +0xC4AD 0x860A +0xC4AE 0xC4AF 0x8814 +0xC4B0 0x8964 +0xC4B1 0x89BA +0xC4B2 0x89F8 +0xC4B3 0x8B70 +0xC4B4 0x8B6C +0xC4B5 0x8B66 +0xC4B6 0x8B6F +0xC4B7 0x8B5F +0xC4B8 0x8B6B +0xC4B9 0x8D0F +0xC4BA 0x8D0D +0xC4BB 0x8E89 +0xC4BC 0x8E81 +0xC4BD 0x8E85 +0xC4BE 0x8E82 +0xC4BF 0x91B4 +0xC4C0 0x91CB +0xC4C1 0x9418 +0xC4C2 0x9403 +0xC4C3 0x93FD +0xC4C4 0x95E1 +0xC4C5 0x9730 +0xC4C6 0x98C4 +0xC4C7 0x9952 +0xC4C8 0x9951 +0xC4C9 0x99A8 +0xC4CA 0x9A2B +0xC4CB 0x9A30 +0xC4CC 0x9A37 +0xC4CD 0x9A35 +0xC4CE 0x9C13 +0xC4CF 0x9C0D +0xC4D0 0x9E79 +0xC4D1 0x9EB5 +0xC4D2 0x9EE8 +0xC4D3 0x9F2F +0xC4D4 0x9F5F +0xC4D5 0x9F63 +0xC4D6 0x9F61 +0xC4D7 0xC4D8 0x5137 +0xC4D9 0x56C1 +0xC4DA 0x56C0 +0xC4DB 0x56C2 +0xC4DC 0x5914 +0xC4DD 0x5C6C +0xC4DE 0x5DCD +0xC4DF 0x61FC +0xC4E0 0x61FE +0xC4E1 0x651D +0xC4E2 0x651C +0xC4E3 0x6595 +0xC4E4 0x66E9 +0xC4E5 0x6AFB +0xC4E6 0x6B04 +0xC4E7 0x6AFA +0xC4E8 0x6BB2 +0xC4E9 0x704C +0xC4EA 0x721B +0xC4EB 0x72A7 +0xC4EC 0x74D6 +0xC4ED 0x74D4 +0xC4EE 0x7669 +0xC4EF 0x77D3 +0xC4F0 0x7C50 +0xC4F1 0x7E8F +0xC4F2 0x7E8C +0xC4F3 0x7FBC +0xC4F4 0x8617 +0xC4F5 0x862D +0xC4F6 0x861A +0xC4F7 0x8823 +0xC4F8 0x8822 +0xC4F9 0x8821 +0xC4FA 0x881F +0xC4FB 0x896A +0xC4FC 0x896C +0xC4FD 0x89BD +0xC4FE 0x8B74 +0xC540 0x8B77 +0xC541 0x8B7D +0xC542 0x8D13 +0xC543 0x8E8A +0xC544 0x8E8D +0xC545 0x8E8B +0xC546 0x8F5F +0xC547 0x8FAF +0xC548 0x91BA +0xC549 0x942E +0xC54A 0x9433 +0xC54B 0x9435 +0xC54C 0x943A +0xC54D 0x9438 +0xC54E 0x9432 +0xC54F 0x942B +0xC550 0x95E2 +0xC551 0xC552 0x9738 +0xC553 0x9732 +0xC554 0x97FF +0xC555 0x9867 +0xC556 0x9865 +0xC557 0x9957 +0xC558 0x9A45 +0xC559 0x9A43 +0xC55A 0x9A40 +0xC55B 0x9A3E +0xC55C 0x9ACF +0xC55D 0x9B54 +0xC55E 0x9B51 +0xC55F 0x9C2D +0xC560 0x9C25 +0xC561 0x9DAF +0xC562 0x9DB4 +0xC563 0x9DC2 +0xC564 0x9DB8 +0xC565 0x9E9D +0xC566 0x9EEF +0xC567 0x9F19 +0xC568 0x9F5C +0xC569 0xC56A 0x9F66 +0xC56B 0x513C +0xC56C 0x513B +0xC56D 0x56C8 +0xC56E 0x56CA +0xC56F 0x56C9 +0xC570 0x5B7F +0xC571 0x5DD4 +0xC572 0x5DD2 +0xC573 0x5F4E +0xC574 0x61FF +0xC575 0x6524 +0xC576 0x6B0A +0xC577 0x6B61 +0xC578 0x7051 +0xC579 0x7058 +0xC57A 0x7380 +0xC57B 0x74E4 +0xC57C 0x758A +0xC57D 0x766E +0xC57E 0x766C +0xC5A1 0x79B3 +0xC5A2 0x7C60 +0xC5A3 0x7C5F +0xC5A4 0x807E +0xC5A5 0x807D +0xC5A6 0x81DF +0xC5A7 0x8972 +0xC5A8 0x896F +0xC5A9 0x89FC +0xC5AA 0x8B80 +0xC5AB 0xC5AC 0x8D16 +0xC5AD 0x8E91 +0xC5AE 0x8E93 +0xC5AF 0x8F61 +0xC5B0 0x9148 +0xC5B1 0x9444 +0xC5B2 0xC5B3 0x9451 +0xC5B4 0xC5B5 0x973D +0xC5B6 0x97C3 +0xC5B7 0x97C1 +0xC5B8 0x986B +0xC5B9 0x9955 +0xC5BA 0x9A55 +0xC5BB 0x9A4D +0xC5BC 0x9AD2 +0xC5BD 0x9B1A +0xC5BE 0x9C49 +0xC5BF 0x9C31 +0xC5C0 0x9C3E +0xC5C1 0x9C3B +0xC5C2 0x9DD3 +0xC5C3 0x9DD7 +0xC5C4 0x9F34 +0xC5C5 0x9F6C +0xC5C6 0x9F6A +0xC5C7 0x9F94 +0xC5C8 0x56CC +0xC5C9 0x5DD6 +0xC5CA 0x6200 +0xC5CB 0x6523 +0xC5CC 0x652B +0xC5CD 0x652A +0xC5CE 0x66EC +0xC5CF 0x6B10 +0xC5D0 0x74DA +0xC5D1 0x7ACA +0xC5D2 0x7C64 +0xC5D3 0x7C63 +0xC5D4 0x7C65 +0xC5D5 0x7E93 +0xC5D6 0x7E96 +0xC5D7 0x7E94 +0xC5D8 0x81E2 +0xC5D9 0x8638 +0xC5DA 0x863F +0xC5DB 0x8831 +0xC5DC 0x8B8A +0xC5DD 0x9090 +0xC5DE 0x908F +0xC5DF 0x9463 +0xC5E0 0x9460 +0xC5E1 0x9464 +0xC5E2 0x9768 +0xC5E3 0x986F +0xC5E4 0x995C +0xC5E5 0xC5E6 0x9A5A +0xC5E7 0x9A57 +0xC5E8 0xC5E9 0x9AD3 +0xC5EA 0x9AD1 +0xC5EB 0x9C54 +0xC5EC 0x9C57 +0xC5ED 0x9C56 +0xC5EE 0x9DE5 +0xC5EF 0x9E9F +0xC5F0 0x9EF4 +0xC5F1 0x56D1 +0xC5F2 0x58E9 +0xC5F3 0x652C +0xC5F4 0x705E +0xC5F5 0xC5F6 0x7671 +0xC5F7 0x77D7 +0xC5F8 0x7F50 +0xC5F9 0x7F88 +0xC5FA 0x8836 +0xC5FB 0x8839 +0xC5FC 0x8862 +0xC5FD 0x8B93 +0xC5FE 0x8B92 +0xC640 0x8B96 +0xC641 0x8277 +0xC642 0x8D1B +0xC643 0x91C0 +0xC644 0x946A +0xC645 0x9742 +0xC646 0x9748 +0xC647 0x9744 +0xC648 0x97C6 +0xC649 0x9870 +0xC64A 0x9A5F +0xC64B 0x9B22 +0xC64C 0x9B58 +0xC64D 0x9C5F +0xC64E 0xC64F 0x9DF9 +0xC650 0xC651 0x9E7C +0xC652 0x9F07 +0xC653 0x9F77 +0xC654 0x9F72 +0xC655 0x5EF3 +0xC656 0x6B16 +0xC657 0x7063 +0xC658 0x7C6C +0xC659 0x7C6E +0xC65A 0x883B +0xC65B 0x89C0 +0xC65C 0x8EA1 +0xC65D 0x91C1 +0xC65E 0x9472 +0xC65F 0x9470 +0xC660 0x9871 +0xC661 0x995E +0xC662 0x9AD6 +0xC663 0x9B23 +0xC664 0x9ECC +0xC665 0x7064 +0xC666 0x77DA +0xC667 0x8B9A +0xC668 0x9477 +0xC669 0x97C9 +0xC66A 0x9A62 +0xC66B 0x9A65 +0xC66C 0x7E9C +0xC66D 0x8B9C +0xC66E 0x8EAA +0xC66F 0x91C5 +0xC670 0xC671 0x947D +0xC672 0x947C +0xC673 0xC674 0x9C77 +0xC675 0x9EF7 +0xC676 0x8C54 +0xC677 0x947F +0xC678 0x9E1A +0xC679 0x7228 +0xC67A 0x9A6A +0xC67B 0x9B31 +0xC67C 0x9E1B +0xC67D 0x9E1E +0xC67E 0x7C72 +0xC6A1 0xC6AA 0x2460 +0xC6AB 0xC6B4 0x2474 +0xC6B5 0xC6BE 0x2170 +0xC6BF 0x4E36 +0xC6C0 0x4E3F +0xC6C1 0x4E85 +0xC6C2 0x4EA0 +0xC6C3 0x5182 +0xC6C4 0x5196 +0xC6C5 0x51AB +0xC6C6 0x52F9 +0xC6C7 0x5338 +0xC6C8 0x5369 +0xC6C9 0x53B6 +0xC6CA 0x590A +0xC6CB 0x5B80 +0xC6CC 0x5DDB +0xC6CD 0x2F33 +0xC6CE 0x5E7F +0xC6CF 0xF6DF +0xC6D0 0x5F50 +0xC6D1 0x5F61 +0xC6D2 0x6534 +0xC6D3 0xF6E3 +0xC6D4 0x7592 +0xC6D5 0xF6E5 +0xC6D6 0x8FB5 +0xC6D7 0xF6E7 +0xC6D8 0x00A8 +0xC6D9 0x02C6 +0xC6DA 0xC6DB 0x30FD +0xC6DC 0xC6DD 0x309D +0xC6DE 0xC6DF 0xF6EE +0xC6E0 0xC6E2 0x3005 +0xC6E3 0x30FC +0xC6E4 0xFF3B +0xC6E5 0xFF3D +0xC6E6 0x273D +0xC6E7 0xC6FE 0x3041 +0xC740 0xC77A 0x3059 +0xC77B 0xC77E 0x30A1 +0xC7A1 0xC7F2 0x30A5 +0xC7F3 0xC7F8 0x0410 +0xC7F9 0x0401 +0xC7FA 0xC7FE 0x0416 +0xC840 0xC85A 0x041B +0xC85B 0x0451 +0xC85C 0xC875 0x0436 +0xC876 0x21E7 +0xC877 0xC878 0x21B8 +0xC879 0xC87A 0xF7E5 +0xC87B 0x4E5A +0xC87C 0xF7E8 +0xC87D 0x5202 +0xC87E 0xF7EA +0xC8A1 0xF7EB +0xC8A2 0x5188 +0xC8A3 0xC8CC 0xF7ED +0xC8CD 0xFFE2 +0xC8CE 0xFFE4 +0xC8CF 0xFF07 +0xC8D0 0xFF02 +0xC8D1 0x3231 +0xC8D2 0x2116 +0xC8D3 0x2121 +0xC8D4 0xC8D5 0x309B +0xC8D6 0x2E80 +0xC8D7 0x2E84 +0xC8D8 0xC8DA 0x2E86 +0xC8DB 0x2E8A +0xC8DC 0xC8DD 0x2E8C +0xC8DE 0x2E95 +0xC8DF 0xC8E0 0x2E9C +0xC8E1 0x2EA5 +0xC8E2 0x2EA7 +0xC8E3 0x2EAA +0xC8E4 0x2EAC +0xC8E5 0x2EAE +0xC8E6 0x2EB6 +0xC8E7 0x2EBC +0xC8E8 0x2EBE +0xC8E9 0x2EC6 +0xC8EA 0x2ECA +0xC8EB 0xC8EC 0x2ECC +0xC8ED 0x2ECF +0xC8EE 0xC8EF 0x2ED6 +0xC8F0 0x2EDE +0xC8F1 0x2EE3 +0xC8F2 0xC8F4 0xF83C +0xC8F5 0x0283 +0xC8F6 0x0250 +0xC8F7 0x025B +0xC8F8 0x0254 +0xC8F9 0x0275 +0xC8FA 0x0153 +0xC8FB 0x00F8 +0xC8FC 0x014B +0xC8FD 0x028A +0xC8FE 0x026A +0xC940 0x4E42 +0xC941 0x4E5C +0xC942 0x51F5 +0xC943 0x531A +0xC944 0x5382 +0xC945 0x4E07 +0xC946 0x4E0C +0xC947 0x4E47 +0xC948 0x4E8D +0xC949 0x56D7 +0xC94A 0xFA0C +0xC94B 0x5C6E +0xC94C 0x5F73 +0xC94D 0x4E0F +0xC94E 0x5187 +0xC94F 0x4E0E +0xC950 0x4E2E +0xC951 0x4E93 +0xC952 0x4EC2 +0xC953 0x4EC9 +0xC954 0x4EC8 +0xC955 0x5198 +0xC956 0x52FC +0xC957 0x536C +0xC958 0x53B9 +0xC959 0x5720 +0xC95A 0x5903 +0xC95B 0x592C +0xC95C 0x5C10 +0xC95D 0x5DFF +0xC95E 0x65E1 +0xC95F 0x6BB3 +0xC960 0x6BCC +0xC961 0x6C14 +0xC962 0x723F +0xC963 0x4E31 +0xC964 0x4E3C +0xC965 0x4EE8 +0xC966 0x4EDC +0xC967 0x4EE9 +0xC968 0x4EE1 +0xC969 0x4EDD +0xC96A 0x4EDA +0xC96B 0x520C +0xC96C 0x531C +0xC96D 0x534C +0xC96E 0xC96F 0x5722 +0xC970 0x5917 +0xC971 0x592F +0xC972 0x5B81 +0xC973 0x5B84 +0xC974 0x5C12 +0xC975 0x5C3B +0xC976 0x5C74 +0xC977 0x5C73 +0xC978 0x5E04 +0xC979 0x5E80 +0xC97A 0x5E82 +0xC97B 0x5FC9 +0xC97C 0x6209 +0xC97D 0x6250 +0xC97E 0x6C15 +0xC9A1 0x6C36 +0xC9A2 0x6C43 +0xC9A3 0x6C3F +0xC9A4 0x6C3B +0xC9A5 0x72AE +0xC9A6 0x72B0 +0xC9A7 0x738A +0xC9A8 0x79B8 +0xC9A9 0x808A +0xC9AA 0x961E +0xC9AB 0x4F0E +0xC9AC 0x4F18 +0xC9AD 0x4F2C +0xC9AE 0x4EF5 +0xC9AF 0x4F14 +0xC9B0 0x4EF1 +0xC9B1 0x4F00 +0xC9B2 0x4EF7 +0xC9B3 0x4F08 +0xC9B4 0x4F1D +0xC9B5 0x4F02 +0xC9B6 0x4F05 +0xC9B7 0x4F22 +0xC9B8 0x4F13 +0xC9B9 0x4F04 +0xC9BA 0x4EF4 +0xC9BB 0x4F12 +0xC9BC 0x51B1 +0xC9BD 0x5213 +0xC9BE 0x5209 +0xC9BF 0x5210 +0xC9C0 0x52A6 +0xC9C1 0x5322 +0xC9C2 0x531F +0xC9C3 0x534D +0xC9C4 0x538A +0xC9C5 0x5407 +0xC9C6 0x56E1 +0xC9C7 0x56DF +0xC9C8 0x572E +0xC9C9 0x572A +0xC9CA 0x5734 +0xC9CB 0x593C +0xC9CC 0x5980 +0xC9CD 0x597C +0xC9CE 0x5985 +0xC9CF 0x597B +0xC9D0 0x597E +0xC9D1 0x5977 +0xC9D2 0x597F +0xC9D3 0x5B56 +0xC9D4 0x5C15 +0xC9D5 0x5C25 +0xC9D6 0x5C7C +0xC9D7 0xC9D8 0x5C7A +0xC9D9 0x5C7E +0xC9DA 0x5DDF +0xC9DB 0x5E75 +0xC9DC 0x5E84 +0xC9DD 0x5F02 +0xC9DE 0x5F1A +0xC9DF 0x5F74 +0xC9E0 0x5FD5 +0xC9E1 0x5FD4 +0xC9E2 0x5FCF +0xC9E3 0x625C +0xC9E4 0x625E +0xC9E5 0x6264 +0xC9E6 0x6261 +0xC9E7 0x6266 +0xC9E8 0x6262 +0xC9E9 0x6259 +0xC9EA 0x6260 +0xC9EB 0x625A +0xC9EC 0x6265 +0xC9ED 0x65EF +0xC9EE 0x65EE +0xC9EF 0x673E +0xC9F0 0x6739 +0xC9F1 0x6738 +0xC9F2 0x673B +0xC9F3 0x673A +0xC9F4 0x673F +0xC9F5 0x673C +0xC9F6 0x6733 +0xC9F7 0x6C18 +0xC9F8 0x6C46 +0xC9F9 0x6C52 +0xC9FA 0x6C5C +0xC9FB 0x6C4F +0xC9FC 0x6C4A +0xC9FD 0x6C54 +0xC9FE 0x6C4B +0xCA40 0x6C4C +0xCA41 0x7071 +0xCA42 0x725E +0xCA43 0xCA44 0x72B4 +0xCA45 0x738E +0xCA46 0x752A +0xCA47 0x767F +0xCA48 0x7A75 +0xCA49 0x7F51 +0xCA4A 0x8278 +0xCA4B 0x827C +0xCA4C 0x8280 +0xCA4D 0x827D +0xCA4E 0x827F +0xCA4F 0x864D +0xCA50 0x897E +0xCA51 0x9099 +0xCA52 0xCA53 0x9097 +0xCA54 0x909B +0xCA55 0x9094 +0xCA56 0x9622 +0xCA57 0x9624 +0xCA58 0x9620 +0xCA59 0x9623 +0xCA5A 0x4F56 +0xCA5B 0x4F3B +0xCA5C 0x4F62 +0xCA5D 0x4F49 +0xCA5E 0x4F53 +0xCA5F 0x4F64 +0xCA60 0x4F3E +0xCA61 0x4F67 +0xCA62 0x4F52 +0xCA63 0x4F5F +0xCA64 0x4F41 +0xCA65 0x4F58 +0xCA66 0x4F2D +0xCA67 0x4F33 +0xCA68 0x4F3F +0xCA69 0x4F61 +0xCA6A 0x518F +0xCA6B 0x51B9 +0xCA6C 0x521C +0xCA6D 0x521E +0xCA6E 0x5221 +0xCA6F 0xCA70 0x52AD +0xCA71 0x5309 +0xCA72 0x5363 +0xCA73 0x5372 +0xCA74 0xCA75 0x538E +0xCA76 0x5430 +0xCA77 0x5437 +0xCA78 0x542A +0xCA79 0x5454 +0xCA7A 0x5445 +0xCA7B 0x5419 +0xCA7C 0x541C +0xCA7D 0x5425 +0xCA7E 0x5418 +0xCAA1 0x543D +0xCAA2 0x544F +0xCAA3 0x5441 +0xCAA4 0x5428 +0xCAA5 0x5424 +0xCAA6 0x5447 +0xCAA7 0x56EE +0xCAA8 0x56E7 +0xCAA9 0x56E5 +0xCAAA 0x5741 +0xCAAB 0x5745 +0xCAAC 0x574C +0xCAAD 0x5749 +0xCAAE 0x574B +0xCAAF 0x5752 +0xCAB0 0x5906 +0xCAB1 0x5940 +0xCAB2 0x59A6 +0xCAB3 0x5998 +0xCAB4 0x59A0 +0xCAB5 0x5997 +0xCAB6 0x598E +0xCAB7 0x59A2 +0xCAB8 0x5990 +0xCAB9 0x598F +0xCABA 0x59A7 +0xCABB 0x59A1 +0xCABC 0x5B8E +0xCABD 0x5B92 +0xCABE 0x5C28 +0xCABF 0x5C2A +0xCAC0 0x5C8D +0xCAC1 0x5C8F +0xCAC2 0x5C88 +0xCAC3 0x5C8B +0xCAC4 0x5C89 +0xCAC5 0x5C92 +0xCAC6 0x5C8A +0xCAC7 0x5C86 +0xCAC8 0x5C93 +0xCAC9 0x5C95 +0xCACA 0x5DE0 +0xCACB 0x5E0A +0xCACC 0x5E0E +0xCACD 0x5E8B +0xCACE 0x5E89 +0xCACF 0x5E8C +0xCAD0 0x5E88 +0xCAD1 0x5E8D +0xCAD2 0x5F05 +0xCAD3 0x5F1D +0xCAD4 0x5F78 +0xCAD5 0x5F76 +0xCAD6 0x5FD2 +0xCAD7 0x5FD1 +0xCAD8 0x5FD0 +0xCAD9 0x5FED +0xCADA 0x5FE8 +0xCADB 0x5FEE +0xCADC 0x5FF3 +0xCADD 0x5FE1 +0xCADE 0x5FE4 +0xCADF 0x5FE3 +0xCAE0 0x5FFA +0xCAE1 0x5FEF +0xCAE2 0x5FF7 +0xCAE3 0x5FFB +0xCAE4 0x6000 +0xCAE5 0x5FF4 +0xCAE6 0x623A +0xCAE7 0x6283 +0xCAE8 0x628C +0xCAE9 0xCAEA 0x628E +0xCAEB 0x6294 +0xCAEC 0x6287 +0xCAED 0x6271 +0xCAEE 0x627B +0xCAEF 0x627A +0xCAF0 0x6270 +0xCAF1 0x6281 +0xCAF2 0x6288 +0xCAF3 0x6277 +0xCAF4 0x627D +0xCAF5 0x6272 +0xCAF6 0x6274 +0xCAF7 0x6537 +0xCAF8 0x65F0 +0xCAF9 0x65F4 +0xCAFA 0x65F3 +0xCAFB 0x65F2 +0xCAFC 0x65F5 +0xCAFD 0x6745 +0xCAFE 0x6747 +0xCB40 0x6759 +0xCB41 0x6755 +0xCB42 0x674C +0xCB43 0x6748 +0xCB44 0x675D +0xCB45 0x674D +0xCB46 0x675A +0xCB47 0x674B +0xCB48 0x6BD0 +0xCB49 0xCB4A 0x6C19 +0xCB4B 0x6C78 +0xCB4C 0x6C67 +0xCB4D 0x6C6B +0xCB4E 0x6C84 +0xCB4F 0x6C8B +0xCB50 0x6C8F +0xCB51 0x6C71 +0xCB52 0x6C6F +0xCB53 0x6C69 +0xCB54 0x6C9A +0xCB55 0x6C6D +0xCB56 0x6C87 +0xCB57 0x6C95 +0xCB58 0x6C9C +0xCB59 0x6C66 +0xCB5A 0x6C73 +0xCB5B 0x6C65 +0xCB5C 0x6C7B +0xCB5D 0x6C8E +0xCB5E 0x7074 +0xCB5F 0x707A +0xCB60 0x7263 +0xCB61 0x72BF +0xCB62 0x72BD +0xCB63 0x72C3 +0xCB64 0x72C6 +0xCB65 0x72C1 +0xCB66 0x72BA +0xCB67 0x72C5 +0xCB68 0x7395 +0xCB69 0x7397 +0xCB6A 0xCB6B 0x7393 +0xCB6C 0x7392 +0xCB6D 0x753A +0xCB6E 0x7539 +0xCB6F 0xCB70 0x7594 +0xCB71 0x7681 +0xCB72 0x793D +0xCB73 0x8034 +0xCB74 0x8095 +0xCB75 0x8099 +0xCB76 0x8090 +0xCB77 0x8092 +0xCB78 0x809C +0xCB79 0x8290 +0xCB7A 0x828F +0xCB7B 0x8285 +0xCB7C 0x828E +0xCB7D 0x8291 +0xCB7E 0x8293 +0xCBA1 0x828A +0xCBA2 0xCBA3 0x8283 +0xCBA4 0x8C78 +0xCBA5 0x8FC9 +0xCBA6 0x8FBF +0xCBA7 0x909F +0xCBA8 0x90A1 +0xCBA9 0x90A5 +0xCBAA 0x909E +0xCBAB 0x90A7 +0xCBAC 0x90A0 +0xCBAD 0x9630 +0xCBAE 0x9628 +0xCBAF 0x962F +0xCBB0 0x962D +0xCBB1 0x4E33 +0xCBB2 0x4F98 +0xCBB3 0x4F7C +0xCBB4 0x4F85 +0xCBB5 0x4F7D +0xCBB6 0x4F80 +0xCBB7 0x4F87 +0xCBB8 0x4F76 +0xCBB9 0x4F74 +0xCBBA 0x4F89 +0xCBBB 0x4F84 +0xCBBC 0x4F77 +0xCBBD 0x4F4C +0xCBBE 0x4F97 +0xCBBF 0x4F6A +0xCBC0 0x4F9A +0xCBC1 0x4F79 +0xCBC2 0x4F81 +0xCBC3 0x4F78 +0xCBC4 0x4F90 +0xCBC5 0x4F9C +0xCBC6 0x4F94 +0xCBC7 0x4F9E +0xCBC8 0x4F92 +0xCBC9 0x4F82 +0xCBCA 0x4F95 +0xCBCB 0x4F6B +0xCBCC 0x4F6E +0xCBCD 0x519E +0xCBCE 0x51BC +0xCBCF 0x51BE +0xCBD0 0x5235 +0xCBD1 0xCBD2 0x5232 +0xCBD3 0x5246 +0xCBD4 0x5231 +0xCBD5 0x52BC +0xCBD6 0xCBD7 0x530A +0xCBD8 0x533C +0xCBD9 0x5392 +0xCBDA 0x5394 +0xCBDB 0x5487 +0xCBDC 0x547F +0xCBDD 0x5481 +0xCBDE 0x5491 +0xCBDF 0x5482 +0xCBE0 0x5488 +0xCBE1 0x546B +0xCBE2 0x547A +0xCBE3 0x547E +0xCBE4 0x5465 +0xCBE5 0x546C +0xCBE6 0x5474 +0xCBE7 0x5466 +0xCBE8 0x548D +0xCBE9 0x546F +0xCBEA 0x5461 +0xCBEB 0x5460 +0xCBEC 0x5498 +0xCBED 0x5463 +0xCBEE 0x5467 +0xCBEF 0x5464 +0xCBF0 0x56F7 +0xCBF1 0x56F9 +0xCBF2 0x576F +0xCBF3 0x5772 +0xCBF4 0x576D +0xCBF5 0x576B +0xCBF6 0x5771 +0xCBF7 0x5770 +0xCBF8 0x5776 +0xCBF9 0x5780 +0xCBFA 0x5775 +0xCBFB 0x577B +0xCBFC 0xCBFD 0x5773 +0xCBFE 0x5762 +0xCC40 0x5768 +0xCC41 0x577D +0xCC42 0x590C +0xCC43 0x5945 +0xCC44 0x59B5 +0xCC45 0x59BA +0xCC46 0x59CF +0xCC47 0x59CE +0xCC48 0x59B2 +0xCC49 0x59CC +0xCC4A 0x59C1 +0xCC4B 0x59B6 +0xCC4C 0x59BC +0xCC4D 0x59C3 +0xCC4E 0x59D6 +0xCC4F 0x59B1 +0xCC50 0x59BD +0xCC51 0x59C0 +0xCC52 0x59C8 +0xCC53 0x59B4 +0xCC54 0x59C7 +0xCC55 0x5B62 +0xCC56 0x5B65 +0xCC57 0x5B93 +0xCC58 0x5B95 +0xCC59 0x5C44 +0xCC5A 0x5C47 +0xCC5B 0x5CAE +0xCC5C 0x5CA4 +0xCC5D 0x5CA0 +0xCC5E 0x5CB5 +0xCC5F 0x5CAF +0xCC60 0x5CA8 +0xCC61 0x5CAC +0xCC62 0x5C9F +0xCC63 0x5CA3 +0xCC64 0x5CAD +0xCC65 0x5CA2 +0xCC66 0x5CAA +0xCC67 0x5CA7 +0xCC68 0x5C9D +0xCC69 0x5CA5 +0xCC6A 0x5CB6 +0xCC6B 0x5CB0 +0xCC6C 0x5CA6 +0xCC6D 0x5E17 +0xCC6E 0x5E14 +0xCC6F 0x5E19 +0xCC70 0x5F28 +0xCC71 0xCC73 0x5F22 +0xCC74 0x5F54 +0xCC75 0x5F82 +0xCC76 0x5F7E +0xCC77 0x5F7D +0xCC78 0x5FDE +0xCC79 0x5FE5 +0xCC7A 0x602D +0xCC7B 0x6026 +0xCC7C 0x6019 +0xCC7D 0x6032 +0xCC7E 0x600B +0xCCA1 0x6034 +0xCCA2 0x600A +0xCCA3 0x6017 +0xCCA4 0x6033 +0xCCA5 0x601A +0xCCA6 0x601E +0xCCA7 0x602C +0xCCA8 0x6022 +0xCCA9 0x600D +0xCCAA 0x6010 +0xCCAB 0x602E +0xCCAC 0x6013 +0xCCAD 0x6011 +0xCCAE 0x600C +0xCCAF 0x6009 +0xCCB0 0x601C +0xCCB1 0x6214 +0xCCB2 0x623D +0xCCB3 0x62AD +0xCCB4 0x62B4 +0xCCB5 0x62D1 +0xCCB6 0x62BE +0xCCB7 0x62AA +0xCCB8 0x62B6 +0xCCB9 0x62CA +0xCCBA 0x62AE +0xCCBB 0x62B3 +0xCCBC 0x62AF +0xCCBD 0x62BB +0xCCBE 0x62A9 +0xCCBF 0x62B0 +0xCCC0 0x62B8 +0xCCC1 0x653D +0xCCC2 0x65A8 +0xCCC3 0x65BB +0xCCC4 0x6609 +0xCCC5 0x65FC +0xCCC6 0x6604 +0xCCC7 0x6612 +0xCCC8 0x6608 +0xCCC9 0x65FB +0xCCCA 0x6603 +0xCCCB 0x660B +0xCCCC 0x660D +0xCCCD 0x6605 +0xCCCE 0x65FD +0xCCCF 0x6611 +0xCCD0 0x6610 +0xCCD1 0x66F6 +0xCCD2 0x670A +0xCCD3 0x6785 +0xCCD4 0x676C +0xCCD5 0x678E +0xCCD6 0x6792 +0xCCD7 0x6776 +0xCCD8 0x677B +0xCCD9 0x6798 +0xCCDA 0x6786 +0xCCDB 0x6784 +0xCCDC 0x6774 +0xCCDD 0x678D +0xCCDE 0x678C +0xCCDF 0x677A +0xCCE0 0x679F +0xCCE1 0x6791 +0xCCE2 0x6799 +0xCCE3 0x6783 +0xCCE4 0x677D +0xCCE5 0x6781 +0xCCE6 0xCCE7 0x6778 +0xCCE8 0x6794 +0xCCE9 0x6B25 +0xCCEA 0x6B80 +0xCCEB 0x6B7E +0xCCEC 0x6BDE +0xCCED 0x6C1D +0xCCEE 0x6C93 +0xCCEF 0x6CEC +0xCCF0 0x6CEB +0xCCF1 0x6CEE +0xCCF2 0x6CD9 +0xCCF3 0x6CB6 +0xCCF4 0x6CD4 +0xCCF5 0x6CAD +0xCCF6 0x6CE7 +0xCCF7 0x6CB7 +0xCCF8 0x6CD0 +0xCCF9 0x6CC2 +0xCCFA 0x6CBA +0xCCFB 0x6CC3 +0xCCFC 0x6CC6 +0xCCFD 0x6CED +0xCCFE 0x6CF2 +0xCD40 0x6CD2 +0xCD41 0x6CDD +0xCD42 0x6CB4 +0xCD43 0x6C8A +0xCD44 0x6C9D +0xCD45 0x6C80 +0xCD46 0x6CDE +0xCD47 0x6CC0 +0xCD48 0x6D30 +0xCD49 0x6CCD +0xCD4A 0x6CC7 +0xCD4B 0x6CB0 +0xCD4C 0x6CF9 +0xCD4D 0x6CCF +0xCD4E 0x6CE9 +0xCD4F 0x6CD1 +0xCD50 0x7094 +0xCD51 0x7098 +0xCD52 0x7085 +0xCD53 0x7093 +0xCD54 0x7086 +0xCD55 0x7084 +0xCD56 0x7091 +0xCD57 0x7096 +0xCD58 0x7082 +0xCD59 0x709A +0xCD5A 0x7083 +0xCD5B 0x726A +0xCD5C 0x72D6 +0xCD5D 0x72CB +0xCD5E 0x72D8 +0xCD5F 0x72C9 +0xCD60 0x72DC +0xCD61 0x72D2 +0xCD62 0x72D4 +0xCD63 0x72DA +0xCD64 0x72CC +0xCD65 0x72D1 +0xCD66 0x73A4 +0xCD67 0x73A1 +0xCD68 0x73AD +0xCD69 0x73A6 +0xCD6A 0x73A2 +0xCD6B 0x73A0 +0xCD6C 0x73AC +0xCD6D 0x739D +0xCD6E 0x74DD +0xCD6F 0x74E8 +0xCD70 0xCD71 0x753F +0xCD72 0x753E +0xCD73 0x758C +0xCD74 0x7598 +0xCD75 0x76AF +0xCD76 0x76F3 +0xCD77 0x76F1 +0xCD78 0x76F0 +0xCD79 0x76F5 +0xCD7A 0x77F8 +0xCD7B 0x77FC +0xCD7C 0x77F9 +0xCD7D 0x77FB +0xCD7E 0x77FA +0xCDA1 0x77F7 +0xCDA2 0x7942 +0xCDA3 0x793F +0xCDA4 0x79C5 +0xCDA5 0x7A78 +0xCDA6 0x7A7B +0xCDA7 0x7AFB +0xCDA8 0x7C75 +0xCDA9 0x7CFD +0xCDAA 0x8035 +0xCDAB 0x808F +0xCDAC 0x80AE +0xCDAD 0x80A3 +0xCDAE 0x80B8 +0xCDAF 0x80B5 +0xCDB0 0x80AD +0xCDB1 0x8220 +0xCDB2 0x82A0 +0xCDB3 0x82C0 +0xCDB4 0x82AB +0xCDB5 0x829A +0xCDB6 0x8298 +0xCDB7 0x829B +0xCDB8 0x82B5 +0xCDB9 0x82A7 +0xCDBA 0x82AE +0xCDBB 0x82BC +0xCDBC 0x829E +0xCDBD 0x82BA +0xCDBE 0x82B4 +0xCDBF 0x82A8 +0xCDC0 0x82A1 +0xCDC1 0x82A9 +0xCDC2 0x82C2 +0xCDC3 0x82A4 +0xCDC4 0x82C3 +0xCDC5 0x82B6 +0xCDC6 0x82A2 +0xCDC7 0x8670 +0xCDC8 0x866F +0xCDC9 0xCDCA 0x866D +0xCDCB 0x8C56 +0xCDCC 0x8FD2 +0xCDCD 0x8FCB +0xCDCE 0x8FD3 +0xCDCF 0x8FCD +0xCDD0 0x8FD6 +0xCDD1 0x8FD5 +0xCDD2 0x8FD7 +0xCDD3 0x90B2 +0xCDD4 0x90B4 +0xCDD5 0x90AF +0xCDD6 0x90B3 +0xCDD7 0x90B0 +0xCDD8 0x9639 +0xCDD9 0x963D +0xCDDA 0x963C +0xCDDB 0x963A +0xCDDC 0x9643 +0xCDDD 0x4FCD +0xCDDE 0x4FC5 +0xCDDF 0x4FD3 +0xCDE0 0x4FB2 +0xCDE1 0x4FC9 +0xCDE2 0x4FCB +0xCDE3 0x4FC1 +0xCDE4 0x4FD4 +0xCDE5 0x4FDC +0xCDE6 0x4FD9 +0xCDE7 0x4FBB +0xCDE8 0x4FB3 +0xCDE9 0x4FDB +0xCDEA 0x4FC7 +0xCDEB 0x4FD6 +0xCDEC 0x4FBA +0xCDED 0x4FC0 +0xCDEE 0x4FB9 +0xCDEF 0x4FEC +0xCDF0 0x5244 +0xCDF1 0x5249 +0xCDF2 0x52C0 +0xCDF3 0x52C2 +0xCDF4 0x533D +0xCDF5 0x537C +0xCDF6 0x5397 +0xCDF7 0x5396 +0xCDF8 0x5399 +0xCDF9 0x5398 +0xCDFA 0x54BA +0xCDFB 0x54A1 +0xCDFC 0x54AD +0xCDFD 0x54A5 +0xCDFE 0x54CF +0xCE40 0x54C3 +0xCE41 0x830D +0xCE42 0x54B7 +0xCE43 0x54AE +0xCE44 0x54D6 +0xCE45 0x54B6 +0xCE46 0xCE47 0x54C5 +0xCE48 0x54A0 +0xCE49 0x5470 +0xCE4A 0x54BC +0xCE4B 0x54A2 +0xCE4C 0x54BE +0xCE4D 0x5472 +0xCE4E 0x54DE +0xCE4F 0x54B0 +0xCE50 0x57B5 +0xCE51 0xCE52 0x579E +0xCE53 0x57A4 +0xCE54 0x578C +0xCE55 0x5797 +0xCE56 0x579D +0xCE57 0x579B +0xCE58 0x5794 +0xCE59 0x5798 +0xCE5A 0x578F +0xCE5B 0x5799 +0xCE5C 0x57A5 +0xCE5D 0x579A +0xCE5E 0x5795 +0xCE5F 0x58F4 +0xCE60 0x590D +0xCE61 0x5953 +0xCE62 0x59E1 +0xCE63 0x59DE +0xCE64 0x59EE +0xCE65 0x5A00 +0xCE66 0x59F1 +0xCE67 0x59DD +0xCE68 0x59FA +0xCE69 0x59FD +0xCE6A 0x59FC +0xCE6B 0x59F6 +0xCE6C 0x59E4 +0xCE6D 0x59F2 +0xCE6E 0x59F7 +0xCE6F 0x59DB +0xCE70 0x59E9 +0xCE71 0x59F3 +0xCE72 0x59F5 +0xCE73 0x59E0 +0xCE74 0x59FE +0xCE75 0x59F4 +0xCE76 0x59ED +0xCE77 0x5BA8 +0xCE78 0x5C4C +0xCE79 0x5CD0 +0xCE7A 0x5CD8 +0xCE7B 0x5CCC +0xCE7C 0x5CD7 +0xCE7D 0x5CCB +0xCE7E 0x5CDB +0xCEA1 0x5CDE +0xCEA2 0x5CDA +0xCEA3 0x5CC9 +0xCEA4 0x5CC7 +0xCEA5 0x5CCA +0xCEA6 0x5CD6 +0xCEA7 0xCEA8 0x5CD3 +0xCEA9 0x5CCF +0xCEAA 0x5CC8 +0xCEAB 0x5CC6 +0xCEAC 0x5CCE +0xCEAD 0x5CDF +0xCEAE 0x5CF8 +0xCEAF 0x5DF9 +0xCEB0 0xCEB2 0x5E21 +0xCEB3 0x5E20 +0xCEB4 0x5E24 +0xCEB5 0x5EB0 +0xCEB6 0x5EA4 +0xCEB7 0x5EA2 +0xCEB8 0x5E9B +0xCEB9 0x5EA3 +0xCEBA 0x5EA5 +0xCEBB 0x5F07 +0xCEBC 0x5F2E +0xCEBD 0x5F56 +0xCEBE 0x5F86 +0xCEBF 0x6037 +0xCEC0 0x6039 +0xCEC1 0x6054 +0xCEC2 0x6072 +0xCEC3 0x605E +0xCEC4 0x6045 +0xCEC5 0x6053 +0xCEC6 0x6047 +0xCEC7 0x6049 +0xCEC8 0x605B +0xCEC9 0x604C +0xCECA 0x6040 +0xCECB 0x6042 +0xCECC 0x605F +0xCECD 0x6024 +0xCECE 0x6044 +0xCECF 0x6058 +0xCED0 0x6066 +0xCED1 0x606E +0xCED2 0xCED3 0x6242 +0xCED4 0x62CF +0xCED5 0x630D +0xCED6 0x630B +0xCED7 0x62F5 +0xCED8 0x630E +0xCED9 0x6303 +0xCEDA 0x62EB +0xCEDB 0x62F9 +0xCEDC 0x630F +0xCEDD 0x630C +0xCEDE 0x62F8 +0xCEDF 0x62F6 +0xCEE0 0x6300 +0xCEE1 0xCEE2 0x6313 +0xCEE3 0x62FA +0xCEE4 0x6315 +0xCEE5 0x62FB +0xCEE6 0x62F0 +0xCEE7 0x6541 +0xCEE8 0x6543 +0xCEE9 0x65AA +0xCEEA 0x65BF +0xCEEB 0x6636 +0xCEEC 0x6621 +0xCEED 0x6632 +0xCEEE 0x6635 +0xCEEF 0x661C +0xCEF0 0x6626 +0xCEF1 0x6622 +0xCEF2 0x6633 +0xCEF3 0x662B +0xCEF4 0x663A +0xCEF5 0x661D +0xCEF6 0x6634 +0xCEF7 0x6639 +0xCEF8 0x662E +0xCEF9 0xCEFA 0x670F +0xCEFB 0x67C1 +0xCEFC 0x67F2 +0xCEFD 0x67C8 +0xCEFE 0x67BA +0xCF40 0x67DC +0xCF41 0x67BB +0xCF42 0x67F8 +0xCF43 0x67D8 +0xCF44 0x67C0 +0xCF45 0x67B7 +0xCF46 0x67C5 +0xCF47 0x67EB +0xCF48 0x67E4 +0xCF49 0x67DF +0xCF4A 0x67B5 +0xCF4B 0x67CD +0xCF4C 0x67B3 +0xCF4D 0x67F7 +0xCF4E 0x67F6 +0xCF4F 0x67EE +0xCF50 0x67E3 +0xCF51 0x67C2 +0xCF52 0x67B9 +0xCF53 0x67CE +0xCF54 0x67E7 +0xCF55 0x67F0 +0xCF56 0x67B2 +0xCF57 0x67FC +0xCF58 0x67C6 +0xCF59 0x67ED +0xCF5A 0x67CC +0xCF5B 0x67AE +0xCF5C 0x67E6 +0xCF5D 0x67DB +0xCF5E 0x67FA +0xCF5F 0xCF60 0x67C9 +0xCF61 0x67C3 +0xCF62 0x67EA +0xCF63 0x67CB +0xCF64 0x6B28 +0xCF65 0x6B82 +0xCF66 0x6B84 +0xCF67 0x6BB6 +0xCF68 0x6BD6 +0xCF69 0x6BD8 +0xCF6A 0x6BE0 +0xCF6B 0xCF6C 0x6C20 +0xCF6D 0x6D28 +0xCF6E 0x6D34 +0xCF6F 0x6D2D +0xCF70 0x6D1F +0xCF71 0x6D3C +0xCF72 0x6D3F +0xCF73 0x6D12 +0xCF74 0x6D0A +0xCF75 0x6CDA +0xCF76 0x6D33 +0xCF77 0x6D04 +0xCF78 0x6D19 +0xCF79 0x6D3A +0xCF7A 0x6D1A +0xCF7B 0x6D11 +0xCF7C 0x6D00 +0xCF7D 0x6D1D +0xCF7E 0x6D42 +0xCFA1 0x6D01 +0xCFA2 0x6D18 +0xCFA3 0x6D37 +0xCFA4 0x6D03 +0xCFA5 0x6D0F +0xCFA6 0x6D40 +0xCFA7 0x6D07 +0xCFA8 0x6D20 +0xCFA9 0x6D2C +0xCFAA 0x6D08 +0xCFAB 0x6D22 +0xCFAC 0x6D09 +0xCFAD 0x6D10 +0xCFAE 0x70B7 +0xCFAF 0x709F +0xCFB0 0x70BE +0xCFB1 0x70B1 +0xCFB2 0x70B0 +0xCFB3 0x70A1 +0xCFB4 0xCFB5 0x70B4 +0xCFB6 0x70A9 +0xCFB7 0x7241 +0xCFB8 0xCFB9 0x7249 +0xCFBA 0x726C +0xCFBB 0x7270 +0xCFBC 0x7273 +0xCFBD 0x726E +0xCFBE 0x72CA +0xCFBF 0x72E4 +0xCFC0 0x72E8 +0xCFC1 0x72EB +0xCFC2 0x72DF +0xCFC3 0x72EA +0xCFC4 0x72E6 +0xCFC5 0x72E3 +0xCFC6 0x7385 +0xCFC7 0x73CC +0xCFC8 0x73C2 +0xCFC9 0x73C8 +0xCFCA 0x73C5 +0xCFCB 0x73B9 +0xCFCC 0x73B6 +0xCFCD 0x73B5 +0xCFCE 0x73B4 +0xCFCF 0x73EB +0xCFD0 0x73BF +0xCFD1 0x73C7 +0xCFD2 0x73BE +0xCFD3 0x73C3 +0xCFD4 0x73C6 +0xCFD5 0x73B8 +0xCFD6 0x73CB +0xCFD7 0x74EC +0xCFD8 0x74EE +0xCFD9 0x752E +0xCFDA 0xCFDB 0x7547 +0xCFDC 0x75A7 +0xCFDD 0x75AA +0xCFDE 0x7679 +0xCFDF 0x76C4 +0xCFE0 0x7708 +0xCFE1 0xCFE3 0x7703 +0xCFE4 0x770A +0xCFE5 0x76F7 +0xCFE6 0x76FB +0xCFE7 0x76FA +0xCFE8 0xCFE9 0x77E7 +0xCFEA 0x7806 +0xCFEB 0xCFEC 0x7811 +0xCFED 0x7805 +0xCFEE 0x7810 +0xCFEF 0x780F +0xCFF0 0x780E +0xCFF1 0x7809 +0xCFF2 0x7803 +0xCFF3 0x7813 +0xCFF4 0x794A +0xCFF5 0x794C +0xCFF6 0x794B +0xCFF7 0x7945 +0xCFF8 0x7944 +0xCFF9 0x79D5 +0xCFFA 0x79CD +0xCFFB 0x79CF +0xCFFC 0x79D6 +0xCFFD 0x79CE +0xCFFE 0x7A80 +0xD040 0x7A7E +0xD041 0x7AD1 +0xD042 0xD043 0x7B00 +0xD044 0x7C7A +0xD045 0xD046 0x7C78 +0xD047 0xD049 0x7C7F +0xD04A 0x7D03 +0xD04B 0x7D08 +0xD04C 0x7D01 +0xD04D 0x7F58 +0xD04E 0x7F91 +0xD04F 0x7F8D +0xD050 0x7FBE +0xD051 0x8007 +0xD052 0xD053 0x800E +0xD054 0x8014 +0xD055 0x8037 +0xD056 0x80D8 +0xD057 0x80C7 +0xD058 0x80E0 +0xD059 0x80D1 +0xD05A 0x80C8 +0xD05B 0x80C2 +0xD05C 0x80D0 +0xD05D 0x80C5 +0xD05E 0x80E3 +0xD05F 0x80D9 +0xD060 0x80DC +0xD061 0x80CA +0xD062 0x80D5 +0xD063 0x80C9 +0xD064 0x80CF +0xD065 0x80D7 +0xD066 0x80E6 +0xD067 0x80CD +0xD068 0x81FF +0xD069 0x8221 +0xD06A 0x8294 +0xD06B 0x82D9 +0xD06C 0x82FE +0xD06D 0x82F9 +0xD06E 0x8307 +0xD06F 0x82E8 +0xD070 0x8300 +0xD071 0x82D5 +0xD072 0x833A +0xD073 0x82EB +0xD074 0x82D6 +0xD075 0x82F4 +0xD076 0x82EC +0xD077 0x82E1 +0xD078 0x82F2 +0xD079 0x82F5 +0xD07A 0x830C +0xD07B 0x82FB +0xD07C 0x82F6 +0xD07D 0x82F0 +0xD07E 0x82EA +0xD0A1 0x82E4 +0xD0A2 0x82E0 +0xD0A3 0x82FA +0xD0A4 0x82F3 +0xD0A5 0x82ED +0xD0A6 0x8677 +0xD0A7 0x8674 +0xD0A8 0x867C +0xD0A9 0x8673 +0xD0AA 0x8841 +0xD0AB 0x884E +0xD0AC 0x8867 +0xD0AD 0x886A +0xD0AE 0x8869 +0xD0AF 0x89D3 +0xD0B0 0x8A04 +0xD0B1 0x8A07 +0xD0B2 0x8D72 +0xD0B3 0x8FE3 +0xD0B4 0x8FE1 +0xD0B5 0x8FEE +0xD0B6 0x8FE0 +0xD0B7 0x90F1 +0xD0B8 0x90BD +0xD0B9 0x90BF +0xD0BA 0x90D5 +0xD0BB 0x90C5 +0xD0BC 0x90BE +0xD0BD 0x90C7 +0xD0BE 0x90CB +0xD0BF 0x90C8 +0xD0C0 0x91D4 +0xD0C1 0x91D3 +0xD0C2 0x9654 +0xD0C3 0x964F +0xD0C4 0x9651 +0xD0C5 0x9653 +0xD0C6 0x964A +0xD0C7 0x964E +0xD0C8 0x501E +0xD0C9 0x5005 +0xD0CA 0x5007 +0xD0CB 0x5013 +0xD0CC 0x5022 +0xD0CD 0x5030 +0xD0CE 0x501B +0xD0CF 0x4FF5 +0xD0D0 0x4FF4 +0xD0D1 0x5033 +0xD0D2 0x5037 +0xD0D3 0x502C +0xD0D4 0xD0D5 0x4FF6 +0xD0D6 0x5017 +0xD0D7 0x501C +0xD0D8 0x5020 +0xD0D9 0x5027 +0xD0DA 0x5035 +0xD0DB 0x502F +0xD0DC 0x5031 +0xD0DD 0x500E +0xD0DE 0x515A +0xD0DF 0x5194 +0xD0E0 0x5193 +0xD0E1 0x51CA +0xD0E2 0xD0E3 0x51C4 +0xD0E4 0x51C8 +0xD0E5 0x51CE +0xD0E6 0x5261 +0xD0E7 0x525A +0xD0E8 0x5252 +0xD0E9 0xD0EA 0x525E +0xD0EB 0x5255 +0xD0EC 0x5262 +0xD0ED 0x52CD +0xD0EE 0x530E +0xD0EF 0x539E +0xD0F0 0x5526 +0xD0F1 0x54E2 +0xD0F2 0x5517 +0xD0F3 0x5512 +0xD0F4 0x54E7 +0xD0F5 0x54F3 +0xD0F6 0x54E4 +0xD0F7 0x551A +0xD0F8 0x54FF +0xD0F9 0x5504 +0xD0FA 0x5508 +0xD0FB 0x54EB +0xD0FC 0x5511 +0xD0FD 0x5505 +0xD0FE 0x54F1 +0xD140 0x550A +0xD141 0x54FB +0xD142 0xD143 0x54F7 +0xD144 0x54E0 +0xD145 0x550E +0xD146 0x5503 +0xD147 0x550B +0xD148 0xD149 0x5701 +0xD14A 0x57CC +0xD14B 0x5832 +0xD14C 0x57D5 +0xD14D 0x57D2 +0xD14E 0x57BA +0xD14F 0x57C6 +0xD150 0x57BD +0xD151 0x57BC +0xD152 0x57B8 +0xD153 0x57B6 +0xD154 0x57BF +0xD155 0x57C7 +0xD156 0x57D0 +0xD157 0x57B9 +0xD158 0x57C1 +0xD159 0x590E +0xD15A 0x594A +0xD15B 0x5A19 +0xD15C 0x5A16 +0xD15D 0xD15E 0x5A2D +0xD15F 0x5A15 +0xD160 0x5A0F +0xD161 0x5A17 +0xD162 0x5A0A +0xD163 0x5A1E +0xD164 0x5A33 +0xD165 0x5B6C +0xD166 0x5BA7 +0xD167 0x5BAD +0xD168 0x5BAC +0xD169 0x5C03 +0xD16A 0x5C56 +0xD16B 0x5C54 +0xD16C 0x5CEC +0xD16D 0x5CFF +0xD16E 0x5CEE +0xD16F 0x5CF1 +0xD170 0x5CF7 +0xD171 0x5D00 +0xD172 0x5CF9 +0xD173 0x5E29 +0xD174 0x5E28 +0xD175 0x5EA8 +0xD176 0x5EAE +0xD177 0x5EAA +0xD178 0x5EAC +0xD179 0x5F33 +0xD17A 0x5F30 +0xD17B 0x5F67 +0xD17C 0x605D +0xD17D 0x605A +0xD17E 0x6067 +0xD1A1 0x6041 +0xD1A2 0x60A2 +0xD1A3 0x6088 +0xD1A4 0x6080 +0xD1A5 0x6092 +0xD1A6 0x6081 +0xD1A7 0x609D +0xD1A8 0x6083 +0xD1A9 0x6095 +0xD1AA 0x609B +0xD1AB 0x6097 +0xD1AC 0x6087 +0xD1AD 0x609C +0xD1AE 0x608E +0xD1AF 0x6219 +0xD1B0 0x6246 +0xD1B1 0x62F2 +0xD1B2 0x6310 +0xD1B3 0x6356 +0xD1B4 0x632C +0xD1B5 0xD1B6 0x6344 +0xD1B7 0x6336 +0xD1B8 0x6343 +0xD1B9 0x63E4 +0xD1BA 0x6339 +0xD1BB 0x634B +0xD1BC 0x634A +0xD1BD 0x633C +0xD1BE 0x6329 +0xD1BF 0x6341 +0xD1C0 0x6334 +0xD1C1 0x6358 +0xD1C2 0x6354 +0xD1C3 0x6359 +0xD1C4 0x632D +0xD1C5 0x6347 +0xD1C6 0x6333 +0xD1C7 0x635A +0xD1C8 0x6351 +0xD1C9 0x6338 +0xD1CA 0x6357 +0xD1CB 0x6340 +0xD1CC 0x6348 +0xD1CD 0x654A +0xD1CE 0x6546 +0xD1CF 0x65C6 +0xD1D0 0xD1D1 0x65C3 +0xD1D2 0x65C2 +0xD1D3 0x664A +0xD1D4 0x665F +0xD1D5 0x6647 +0xD1D6 0x6651 +0xD1D7 0xD1D8 0x6712 +0xD1D9 0x681F +0xD1DA 0x681A +0xD1DB 0x6849 +0xD1DC 0xD1DD 0x6832 +0xD1DE 0x683B +0xD1DF 0x684B +0xD1E0 0x684F +0xD1E1 0x6816 +0xD1E2 0x6831 +0xD1E3 0x681C +0xD1E4 0x6835 +0xD1E5 0x682B +0xD1E6 0x682D +0xD1E7 0x682F +0xD1E8 0x684E +0xD1E9 0x6844 +0xD1EA 0x6834 +0xD1EB 0x681D +0xD1EC 0x6812 +0xD1ED 0x6814 +0xD1EE 0x6826 +0xD1EF 0x6828 +0xD1F0 0x682E +0xD1F1 0x684D +0xD1F2 0x683A +0xD1F3 0x6825 +0xD1F4 0x6820 +0xD1F5 0x6B2C +0xD1F6 0x6B2F +0xD1F7 0x6B2D +0xD1F8 0x6B31 +0xD1F9 0x6B34 +0xD1FA 0x6B6D +0xD1FB 0x8082 +0xD1FC 0x6B88 +0xD1FD 0x6BE6 +0xD1FE 0x6BE4 +0xD240 0x6BE8 +0xD241 0x6BE3 +0xD242 0x6BE2 +0xD243 0x6BE7 +0xD244 0x6C25 +0xD245 0x6D7A +0xD246 0xD247 0x6D63 +0xD248 0x6D76 +0xD249 0x6D0D +0xD24A 0x6D61 +0xD24B 0x6D92 +0xD24C 0x6D58 +0xD24D 0x6D62 +0xD24E 0x6D6D +0xD24F 0x6D6F +0xD250 0x6D91 +0xD251 0x6D8D +0xD252 0x6DEF +0xD253 0x6D7F +0xD254 0x6D86 +0xD255 0x6D5E +0xD256 0x6D67 +0xD257 0x6D60 +0xD258 0x6D97 +0xD259 0x6D70 +0xD25A 0x6D7C +0xD25B 0x6D5F +0xD25C 0x6D82 +0xD25D 0x6D98 +0xD25E 0x6D2F +0xD25F 0x6D68 +0xD260 0x6D8B +0xD261 0x6D7E +0xD262 0x6D80 +0xD263 0x6D84 +0xD264 0x6D16 +0xD265 0x6D83 +0xD266 0x6D7B +0xD267 0x6D7D +0xD268 0x6D75 +0xD269 0x6D90 +0xD26A 0x70DC +0xD26B 0x70D3 +0xD26C 0x70D1 +0xD26D 0x70DD +0xD26E 0x70CB +0xD26F 0x7F39 +0xD270 0x70E2 +0xD271 0x70D7 +0xD272 0x70D2 +0xD273 0x70DE +0xD274 0x70E0 +0xD275 0x70D4 +0xD276 0x70CD +0xD277 0xD279 0x70C5 +0xD27A 0x70DA +0xD27B 0x70CE +0xD27C 0x70E1 +0xD27D 0x7242 +0xD27E 0x7278 +0xD2A1 0x7277 +0xD2A2 0x7276 +0xD2A3 0x7300 +0xD2A4 0x72FA +0xD2A5 0x72F4 +0xD2A6 0x72FE +0xD2A7 0x72F6 +0xD2A8 0x72F3 +0xD2A9 0x72FB +0xD2AA 0x7301 +0xD2AB 0x73D3 +0xD2AC 0x73D9 +0xD2AD 0x73E5 +0xD2AE 0x73D6 +0xD2AF 0x73BC +0xD2B0 0x73E7 +0xD2B1 0x73E3 +0xD2B2 0x73E9 +0xD2B3 0x73DC +0xD2B4 0x73D2 +0xD2B5 0x73DB +0xD2B6 0x73D4 +0xD2B7 0x73DD +0xD2B8 0x73DA +0xD2B9 0xD2BA 0x73D7 +0xD2BB 0x73E8 +0xD2BC 0xD2BD 0x74DE +0xD2BE 0xD2BF 0x74F4 +0xD2C0 0x7521 +0xD2C1 0x755B +0xD2C2 0x755F +0xD2C3 0x75B0 +0xD2C4 0x75C1 +0xD2C5 0x75BB +0xD2C6 0x75C4 +0xD2C7 0x75C0 +0xD2C8 0x75BF +0xD2C9 0x75B6 +0xD2CA 0x75BA +0xD2CB 0x768A +0xD2CC 0x76C9 +0xD2CD 0x771D +0xD2CE 0x771B +0xD2CF 0x7710 +0xD2D0 0x7713 +0xD2D1 0x7712 +0xD2D2 0x7723 +0xD2D3 0x7711 +0xD2D4 0x7715 +0xD2D5 0xD2D6 0x7719 +0xD2D7 0x7722 +0xD2D8 0x7727 +0xD2D9 0x7823 +0xD2DA 0x782C +0xD2DB 0x7822 +0xD2DC 0x7835 +0xD2DD 0x782F +0xD2DE 0x7828 +0xD2DF 0x782E +0xD2E0 0x782B +0xD2E1 0x7821 +0xD2E2 0x7829 +0xD2E3 0x7833 +0xD2E4 0x782A +0xD2E5 0x7831 +0xD2E6 0x7954 +0xD2E7 0x795B +0xD2E8 0x794F +0xD2E9 0x795C +0xD2EA 0x7953 +0xD2EB 0x7952 +0xD2EC 0x7951 +0xD2ED 0xD2EE 0x79EB +0xD2EF 0x79E0 +0xD2F0 0x79EE +0xD2F1 0x79ED +0xD2F2 0x79EA +0xD2F3 0x79DC +0xD2F4 0x79DE +0xD2F5 0x79DD +0xD2F6 0x7A86 +0xD2F7 0x7A89 +0xD2F8 0x7A85 +0xD2F9 0xD2FA 0x7A8B +0xD2FB 0x7A8A +0xD2FC 0x7A87 +0xD2FD 0x7AD8 +0xD2FE 0x7B10 +0xD340 0x7B04 +0xD341 0x7B13 +0xD342 0x7B05 +0xD343 0x7B0F +0xD344 0x7B08 +0xD345 0x7B0A +0xD346 0x7B0E +0xD347 0x7B09 +0xD348 0x7B12 +0xD349 0x7C84 +0xD34A 0x7C91 +0xD34B 0x7C8A +0xD34C 0x7C8C +0xD34D 0x7C88 +0xD34E 0x7C8D +0xD34F 0x7C85 +0xD350 0x7D1E +0xD351 0x7D1D +0xD352 0x7D11 +0xD353 0x7D0E +0xD354 0x7D18 +0xD355 0x7D16 +0xD356 0x7D13 +0xD357 0x7D1F +0xD358 0x7D12 +0xD359 0x7D0F +0xD35A 0x7D0C +0xD35B 0x7F5C +0xD35C 0x7F61 +0xD35D 0x7F5E +0xD35E 0x7F60 +0xD35F 0x7F5D +0xD360 0x7F5B +0xD361 0x7F96 +0xD362 0x7F92 +0xD363 0x7FC3 +0xD364 0x7FC2 +0xD365 0x7FC0 +0xD366 0x8016 +0xD367 0x803E +0xD368 0x8039 +0xD369 0x80FA +0xD36A 0x80F2 +0xD36B 0x80F9 +0xD36C 0x80F5 +0xD36D 0x8101 +0xD36E 0x80FB +0xD36F 0x8100 +0xD370 0x8201 +0xD371 0x822F +0xD372 0x8225 +0xD373 0x8333 +0xD374 0x832D +0xD375 0x8344 +0xD376 0x8319 +0xD377 0x8351 +0xD378 0x8325 +0xD379 0x8356 +0xD37A 0x833F +0xD37B 0x8341 +0xD37C 0x8326 +0xD37D 0x831C +0xD37E 0x8322 +0xD3A1 0x8342 +0xD3A2 0x834E +0xD3A3 0x831B +0xD3A4 0x832A +0xD3A5 0x8308 +0xD3A6 0x833C +0xD3A7 0x834D +0xD3A8 0x8316 +0xD3A9 0x8324 +0xD3AA 0x8320 +0xD3AB 0x8337 +0xD3AC 0x832F +0xD3AD 0x8329 +0xD3AE 0x8347 +0xD3AF 0x8345 +0xD3B0 0x834C +0xD3B1 0x8353 +0xD3B2 0x831E +0xD3B3 0x832C +0xD3B4 0x834B +0xD3B5 0x8327 +0xD3B6 0x8348 +0xD3B7 0x8653 +0xD3B8 0x8652 +0xD3B9 0x86A2 +0xD3BA 0x86A8 +0xD3BB 0x8696 +0xD3BC 0x868D +0xD3BD 0x8691 +0xD3BE 0x869E +0xD3BF 0x8687 +0xD3C0 0x8697 +0xD3C1 0x8686 +0xD3C2 0x868B +0xD3C3 0x869A +0xD3C4 0x8685 +0xD3C5 0x86A5 +0xD3C6 0x8699 +0xD3C7 0x86A1 +0xD3C8 0x86A7 +0xD3C9 0x8695 +0xD3CA 0x8698 +0xD3CB 0x868E +0xD3CC 0x869D +0xD3CD 0x8690 +0xD3CE 0x8694 +0xD3CF 0xD3D0 0x8843 +0xD3D1 0x886D +0xD3D2 0xD3D3 0x8875 +0xD3D4 0x8872 +0xD3D5 0x8880 +0xD3D6 0x8871 +0xD3D7 0x887F +0xD3D8 0x886F +0xD3D9 0x8883 +0xD3DA 0x887E +0xD3DB 0x8874 +0xD3DC 0x887C +0xD3DD 0x8A12 +0xD3DE 0x8C47 +0xD3DF 0x8C57 +0xD3E0 0x8C7B +0xD3E1 0x8CA4 +0xD3E2 0x8CA3 +0xD3E3 0x8D76 +0xD3E4 0x8D78 +0xD3E5 0x8DB5 +0xD3E6 0x8DB7 +0xD3E7 0x8DB6 +0xD3E8 0x8ED1 +0xD3E9 0x8ED3 +0xD3EA 0x8FFE +0xD3EB 0x8FF5 +0xD3EC 0x9002 +0xD3ED 0x8FFF +0xD3EE 0x8FFB +0xD3EF 0x9004 +0xD3F0 0x8FFC +0xD3F1 0x8FF6 +0xD3F2 0x90D6 +0xD3F3 0x90E0 +0xD3F4 0xD3F5 0x90D9 +0xD3F6 0x90E3 +0xD3F7 0x90DF +0xD3F8 0x90E5 +0xD3F9 0x90D8 +0xD3FA 0x90DB +0xD3FB 0x90D7 +0xD3FC 0x90DC +0xD3FD 0x90E4 +0xD3FE 0x9150 +0xD440 0xD441 0x914E +0xD442 0x91D5 +0xD443 0x91E2 +0xD444 0x91DA +0xD445 0x965C +0xD446 0x965F +0xD447 0x96BC +0xD448 0x98E3 +0xD449 0x9ADF +0xD44A 0x9B2F +0xD44B 0x4E7F +0xD44C 0x5070 +0xD44D 0x506A +0xD44E 0x5061 +0xD44F 0x505E +0xD450 0x5060 +0xD451 0x5053 +0xD452 0x504B +0xD453 0x505D +0xD454 0x5072 +0xD455 0x5048 +0xD456 0x504D +0xD457 0x5041 +0xD458 0x505B +0xD459 0x504A +0xD45A 0x5062 +0xD45B 0x5015 +0xD45C 0x5045 +0xD45D 0x505F +0xD45E 0x5069 +0xD45F 0x506B +0xD460 0xD461 0x5063 +0xD462 0x5046 +0xD463 0x5040 +0xD464 0x506E +0xD465 0x5073 +0xD466 0x5057 +0xD467 0x5051 +0xD468 0x51D0 +0xD469 0x526B +0xD46A 0x526D +0xD46B 0x526C +0xD46C 0x526E +0xD46D 0x52D6 +0xD46E 0x52D3 +0xD46F 0x532D +0xD470 0x539C +0xD471 0xD472 0x5575 +0xD473 0x553C +0xD474 0x554D +0xD475 0x5550 +0xD476 0x5534 +0xD477 0x552A +0xD478 0x5551 +0xD479 0x5562 +0xD47A 0x5536 +0xD47B 0x5535 +0xD47C 0x5530 +0xD47D 0x5552 +0xD47E 0x5545 +0xD4A1 0x550C +0xD4A2 0x5532 +0xD4A3 0x5565 +0xD4A4 0x554E +0xD4A5 0x5539 +0xD4A6 0x5548 +0xD4A7 0x552D +0xD4A8 0x553B +0xD4A9 0x5540 +0xD4AA 0x554B +0xD4AB 0x570A +0xD4AC 0x5707 +0xD4AD 0x57FB +0xD4AE 0x5814 +0xD4AF 0x57E2 +0xD4B0 0x57F6 +0xD4B1 0x57DC +0xD4B2 0x57F4 +0xD4B3 0x5800 +0xD4B4 0x57ED +0xD4B5 0x57FD +0xD4B6 0x5808 +0xD4B7 0x57F8 +0xD4B8 0x580B +0xD4B9 0x57F3 +0xD4BA 0x57CF +0xD4BB 0x5807 +0xD4BC 0x57EE +0xD4BD 0x57E3 +0xD4BE 0x57F2 +0xD4BF 0x57E5 +0xD4C0 0x57EC +0xD4C1 0x57E1 +0xD4C2 0x580E +0xD4C3 0x57FC +0xD4C4 0x5810 +0xD4C5 0x57E7 +0xD4C6 0x5801 +0xD4C7 0x580C +0xD4C8 0x57F1 +0xD4C9 0x57E9 +0xD4CA 0x57F0 +0xD4CB 0x580D +0xD4CC 0x5804 +0xD4CD 0x595C +0xD4CE 0x5A60 +0xD4CF 0x5A58 +0xD4D0 0x5A55 +0xD4D1 0x5A67 +0xD4D2 0x5A5E +0xD4D3 0x5A38 +0xD4D4 0x5A35 +0xD4D5 0x5A6D +0xD4D6 0x5A50 +0xD4D7 0x5A5F +0xD4D8 0x5A65 +0xD4D9 0x5A6C +0xD4DA 0x5A53 +0xD4DB 0x5A64 +0xD4DC 0x5A57 +0xD4DD 0x5A43 +0xD4DE 0x5A5D +0xD4DF 0x5A52 +0xD4E0 0x5A44 +0xD4E1 0x5A5B +0xD4E2 0x5A48 +0xD4E3 0x5A8E +0xD4E4 0x5A3E +0xD4E5 0x5A4D +0xD4E6 0x5A39 +0xD4E7 0x5A4C +0xD4E8 0x5A70 +0xD4E9 0x5A69 +0xD4EA 0x5A47 +0xD4EB 0x5A51 +0xD4EC 0x5A56 +0xD4ED 0x5A42 +0xD4EE 0x5A5C +0xD4EF 0x5B72 +0xD4F0 0x5B6E +0xD4F1 0x5BC1 +0xD4F2 0x5BC0 +0xD4F3 0x5C59 +0xD4F4 0x5D1E +0xD4F5 0x5D0B +0xD4F6 0x5D1D +0xD4F7 0x5D1A +0xD4F8 0x5D20 +0xD4F9 0x5D0C +0xD4FA 0x5D28 +0xD4FB 0x5D0D +0xD4FC 0x5D26 +0xD4FD 0x5D25 +0xD4FE 0x5D0F +0xD540 0x5D30 +0xD541 0x5D12 +0xD542 0x5D23 +0xD543 0x5D1F +0xD544 0x5D2E +0xD545 0x5E3E +0xD546 0x5E34 +0xD547 0x5EB1 +0xD548 0x5EB4 +0xD549 0x5EB9 +0xD54A 0xD54B 0x5EB2 +0xD54C 0x5F36 +0xD54D 0x5F38 +0xD54E 0x5F9B +0xD54F 0x5F96 +0xD550 0x5F9F +0xD551 0x608A +0xD552 0x6090 +0xD553 0x6086 +0xD554 0x60BE +0xD555 0x60B0 +0xD556 0x60BA +0xD557 0xD558 0x60D3 +0xD559 0x60CF +0xD55A 0x60E4 +0xD55B 0x60D9 +0xD55C 0x60DD +0xD55D 0x60C8 +0xD55E 0x60B1 +0xD55F 0x60DB +0xD560 0x60B7 +0xD561 0x60CA +0xD562 0x60BF +0xD563 0x60C3 +0xD564 0x60CD +0xD565 0x60C0 +0xD566 0x6332 +0xD567 0x6365 +0xD568 0x638A +0xD569 0x6382 +0xD56A 0x637D +0xD56B 0x63BD +0xD56C 0x639E +0xD56D 0x63AD +0xD56E 0x639D +0xD56F 0x6397 +0xD570 0x63AB +0xD571 0x638E +0xD572 0x636F +0xD573 0x6387 +0xD574 0x6390 +0xD575 0x636E +0xD576 0x63AF +0xD577 0x6375 +0xD578 0x639C +0xD579 0x636D +0xD57A 0x63AE +0xD57B 0x637C +0xD57C 0x63A4 +0xD57D 0x633B +0xD57E 0x639F +0xD5A1 0x6378 +0xD5A2 0x6385 +0xD5A3 0x6381 +0xD5A4 0x6391 +0xD5A5 0x638D +0xD5A6 0x6370 +0xD5A7 0x6553 +0xD5A8 0x65CD +0xD5A9 0x6665 +0xD5AA 0x6661 +0xD5AB 0x665B +0xD5AC 0x6659 +0xD5AD 0x665C +0xD5AE 0x6662 +0xD5AF 0x6718 +0xD5B0 0x6879 +0xD5B1 0x6887 +0xD5B2 0x6890 +0xD5B3 0x689C +0xD5B4 0xD5B5 0x686D +0xD5B6 0x68AE +0xD5B7 0x68AB +0xD5B8 0x6956 +0xD5B9 0x686F +0xD5BA 0x68A3 +0xD5BB 0x68AC +0xD5BC 0x68A9 +0xD5BD 0x6875 +0xD5BE 0x6874 +0xD5BF 0x68B2 +0xD5C0 0x688F +0xD5C1 0x6877 +0xD5C2 0x6892 +0xD5C3 0x687C +0xD5C4 0x686B +0xD5C5 0x6872 +0xD5C6 0x68AA +0xD5C7 0x6880 +0xD5C8 0x6871 +0xD5C9 0x687E +0xD5CA 0x689B +0xD5CB 0x6896 +0xD5CC 0x688B +0xD5CD 0x68A0 +0xD5CE 0x6889 +0xD5CF 0x68A4 +0xD5D0 0x6878 +0xD5D1 0x687B +0xD5D2 0x6891 +0xD5D3 0x688C +0xD5D4 0x688A +0xD5D5 0x687D +0xD5D6 0x6B36 +0xD5D7 0x6B33 +0xD5D8 0xD5D9 0x6B37 +0xD5DA 0x6B91 +0xD5DB 0x6B8F +0xD5DC 0xD5DD 0x6B8D +0xD5DE 0x6B8C +0xD5DF 0x6C2A +0xD5E0 0x6DC0 +0xD5E1 0x6DAB +0xD5E2 0x6DB4 +0xD5E3 0x6DB3 +0xD5E4 0x6E74 +0xD5E5 0x6DAC +0xD5E6 0x6DE9 +0xD5E7 0x6DE2 +0xD5E8 0x6DB7 +0xD5E9 0x6DF6 +0xD5EA 0x6DD4 +0xD5EB 0x6E00 +0xD5EC 0x6DC8 +0xD5ED 0x6DE0 +0xD5EE 0x6DDF +0xD5EF 0x6DD6 +0xD5F0 0x6DBE +0xD5F1 0x6DE5 +0xD5F2 0xD5F3 0x6DDC +0xD5F4 0x6DDB +0xD5F5 0x6DF4 +0xD5F6 0x6DCA +0xD5F7 0x6DBD +0xD5F8 0x6DED +0xD5F9 0x6DF0 +0xD5FA 0x6DBA +0xD5FB 0x6DD5 +0xD5FC 0x6DC2 +0xD5FD 0x6DCF +0xD5FE 0x6DC9 +0xD640 0x6DD0 +0xD641 0x6DF2 +0xD642 0x6DD3 +0xD643 0x6DFD +0xD644 0x6DD7 +0xD645 0x6DCD +0xD646 0x6DE3 +0xD647 0x6DBB +0xD648 0x70FA +0xD649 0x710D +0xD64A 0x70F7 +0xD64B 0x7117 +0xD64C 0x70F4 +0xD64D 0x710C +0xD64E 0x70F0 +0xD64F 0x7104 +0xD650 0x70F3 +0xD651 0x7110 +0xD652 0x70FC +0xD653 0x70FF +0xD654 0x7106 +0xD655 0x7113 +0xD656 0x7100 +0xD657 0x70F8 +0xD658 0x70F6 +0xD659 0x710B +0xD65A 0x7102 +0xD65B 0x710E +0xD65C 0x727E +0xD65D 0xD65E 0x727B +0xD65F 0x727F +0xD660 0x731D +0xD661 0x7317 +0xD662 0x7307 +0xD663 0x7311 +0xD664 0x7318 +0xD665 0x730A +0xD666 0x7308 +0xD667 0x72FF +0xD668 0x730F +0xD669 0x731E +0xD66A 0x7388 +0xD66B 0x73F6 +0xD66C 0x73F8 +0xD66D 0x73F5 +0xD66E 0x7404 +0xD66F 0x7401 +0xD670 0x73FD +0xD671 0x7407 +0xD672 0x7400 +0xD673 0x73FA +0xD674 0x73FC +0xD675 0x73FF +0xD676 0x740C +0xD677 0x740B +0xD678 0x73F4 +0xD679 0x7408 +0xD67A 0x7564 +0xD67B 0x7563 +0xD67C 0x75CE +0xD67D 0x75D2 +0xD67E 0x75CF +0xD6A1 0xD6A2 0x75CB +0xD6A3 0x75D1 +0xD6A4 0x75D0 +0xD6A5 0x768F +0xD6A6 0x7689 +0xD6A7 0x76D3 +0xD6A8 0x7739 +0xD6A9 0x772F +0xD6AA 0x772D +0xD6AB 0xD6AC 0x7731 +0xD6AD 0x7734 +0xD6AE 0x7733 +0xD6AF 0x773D +0xD6B0 0x7725 +0xD6B1 0x773B +0xD6B2 0x7735 +0xD6B3 0x7848 +0xD6B4 0x7852 +0xD6B5 0x7849 +0xD6B6 0x784D +0xD6B7 0x784A +0xD6B8 0x784C +0xD6B9 0x7826 +0xD6BA 0x7845 +0xD6BB 0x7850 +0xD6BC 0x7964 +0xD6BD 0x7967 +0xD6BE 0xD6BF 0x7969 +0xD6C0 0x7963 +0xD6C1 0x796B +0xD6C2 0x7961 +0xD6C3 0x79BB +0xD6C4 0x79FA +0xD6C5 0x79F8 +0xD6C6 0xD6C7 0x79F6 +0xD6C8 0x7A8F +0xD6C9 0x7A94 +0xD6CA 0x7A90 +0xD6CB 0x7B35 +0xD6CC 0x7B47 +0xD6CD 0x7B34 +0xD6CE 0x7B25 +0xD6CF 0x7B30 +0xD6D0 0x7B22 +0xD6D1 0x7B24 +0xD6D2 0x7B33 +0xD6D3 0x7B18 +0xD6D4 0x7B2A +0xD6D5 0x7B1D +0xD6D6 0x7B31 +0xD6D7 0x7B2B +0xD6D8 0x7B2D +0xD6D9 0x7B2F +0xD6DA 0x7B32 +0xD6DB 0x7B38 +0xD6DC 0x7B1A +0xD6DD 0x7B23 +0xD6DE 0x7C94 +0xD6DF 0x7C98 +0xD6E0 0x7C96 +0xD6E1 0x7CA3 +0xD6E2 0x7D35 +0xD6E3 0x7D3D +0xD6E4 0x7D38 +0xD6E5 0x7D36 +0xD6E6 0x7D3A +0xD6E7 0x7D45 +0xD6E8 0x7D2C +0xD6E9 0x7D29 +0xD6EA 0x7D41 +0xD6EB 0x7D47 +0xD6EC 0xD6ED 0x7D3E +0xD6EE 0x7D4A +0xD6EF 0x7D3B +0xD6F0 0x7D28 +0xD6F1 0x7F63 +0xD6F2 0x7F95 +0xD6F3 0xD6F4 0x7F9C +0xD6F5 0x7F9B +0xD6F6 0xD6F7 0x7FCA +0xD6F8 0x7FCD +0xD6F9 0xD6FA 0x7FD0 +0xD6FB 0x7FC7 +0xD6FC 0x7FCF +0xD6FD 0x7FC9 +0xD6FE 0x801F +0xD740 0x801E +0xD741 0x801B +0xD742 0x8047 +0xD743 0x8043 +0xD744 0x8048 +0xD745 0x8118 +0xD746 0x8125 +0xD747 0x8119 +0xD748 0x811B +0xD749 0x812D +0xD74A 0x811F +0xD74B 0x812C +0xD74C 0x811E +0xD74D 0x8121 +0xD74E 0x8115 +0xD74F 0x8127 +0xD750 0x811D +0xD751 0x8122 +0xD752 0x8211 +0xD753 0x8238 +0xD754 0x8233 +0xD755 0x823A +0xD756 0x8234 +0xD757 0x8232 +0xD758 0x8274 +0xD759 0x8390 +0xD75A 0x83A3 +0xD75B 0x83A8 +0xD75C 0x838D +0xD75D 0x837A +0xD75E 0x8373 +0xD75F 0x83A4 +0xD760 0x8374 +0xD761 0x838F +0xD762 0x8381 +0xD763 0x8395 +0xD764 0x8399 +0xD765 0x8375 +0xD766 0x8394 +0xD767 0x83A9 +0xD768 0x837D +0xD769 0x8383 +0xD76A 0x838C +0xD76B 0x839D +0xD76C 0x839B +0xD76D 0x83AA +0xD76E 0x838B +0xD76F 0x837E +0xD770 0x83A5 +0xD771 0x83AF +0xD772 0x8388 +0xD773 0x8397 +0xD774 0x83B0 +0xD775 0x837F +0xD776 0x83A6 +0xD777 0x8387 +0xD778 0x83AE +0xD779 0x8376 +0xD77A 0x839A +0xD77B 0x8659 +0xD77C 0x8656 +0xD77D 0x86BF +0xD77E 0x86B7 +0xD7A1 0x86C2 +0xD7A2 0x86C1 +0xD7A3 0x86C5 +0xD7A4 0x86BA +0xD7A5 0x86B0 +0xD7A6 0x86C8 +0xD7A7 0x86B9 +0xD7A8 0x86B3 +0xD7A9 0x86B8 +0xD7AA 0x86CC +0xD7AB 0x86B4 +0xD7AC 0xD7AD 0x86BB +0xD7AE 0x86C3 +0xD7AF 0xD7B0 0x86BD +0xD7B1 0x8852 +0xD7B2 0x8889 +0xD7B3 0x8895 +0xD7B4 0x88A8 +0xD7B5 0x88A2 +0xD7B6 0x88AA +0xD7B7 0x889A +0xD7B8 0x8891 +0xD7B9 0x88A1 +0xD7BA 0x889F +0xD7BB 0x8898 +0xD7BC 0x88A7 +0xD7BD 0x8899 +0xD7BE 0x889B +0xD7BF 0x8897 +0xD7C0 0x88A4 +0xD7C1 0x88AC +0xD7C2 0x888C +0xD7C3 0x8893 +0xD7C4 0x888E +0xD7C5 0x8982 +0xD7C6 0x89D6 +0xD7C7 0x89D9 +0xD7C8 0x89D5 +0xD7C9 0x8A30 +0xD7CA 0x8A27 +0xD7CB 0x8A2C +0xD7CC 0x8A1E +0xD7CD 0x8C39 +0xD7CE 0x8C3B +0xD7CF 0xD7D0 0x8C5C +0xD7D1 0x8C7D +0xD7D2 0x8CA5 +0xD7D3 0x8D7D +0xD7D4 0x8D7B +0xD7D5 0x8D79 +0xD7D6 0x8DBC +0xD7D7 0x8DC2 +0xD7D8 0x8DB9 +0xD7D9 0x8DBF +0xD7DA 0x8DC1 +0xD7DB 0x8ED8 +0xD7DC 0x8EDE +0xD7DD 0x8EDD +0xD7DE 0x8EDC +0xD7DF 0x8ED7 +0xD7E0 0xD7E1 0x8EE0 +0xD7E2 0x9024 +0xD7E3 0x900B +0xD7E4 0x9011 +0xD7E5 0x901C +0xD7E6 0x900C +0xD7E7 0x9021 +0xD7E8 0x90EF +0xD7E9 0x90EA +0xD7EA 0x90F0 +0xD7EB 0x90F4 +0xD7EC 0xD7ED 0x90F2 +0xD7EE 0x90D4 +0xD7EF 0xD7F0 0x90EB +0xD7F1 0x90E9 +0xD7F2 0x9156 +0xD7F3 0x9158 +0xD7F4 0x915A +0xD7F5 0x9153 +0xD7F6 0x9155 +0xD7F7 0x91EC +0xD7F8 0x91F4 +0xD7F9 0x91F1 +0xD7FA 0x91F3 +0xD7FB 0x91F8 +0xD7FC 0x91E4 +0xD7FD 0x91F9 +0xD7FE 0x91EA +0xD840 0x91EB +0xD841 0x91F7 +0xD842 0x91E8 +0xD843 0x91EE +0xD844 0x957A +0xD845 0x9586 +0xD846 0x9588 +0xD847 0x967C +0xD848 0x966D +0xD849 0x966B +0xD84A 0x9671 +0xD84B 0x966F +0xD84C 0x96BF +0xD84D 0x976A +0xD84E 0x9804 +0xD84F 0x98E5 +0xD850 0x9997 +0xD851 0x509B +0xD852 0x5095 +0xD853 0x5094 +0xD854 0x509E +0xD855 0x508B +0xD856 0x50A3 +0xD857 0x5083 +0xD858 0x508C +0xD859 0x508E +0xD85A 0x509D +0xD85B 0x5068 +0xD85C 0x509C +0xD85D 0x5092 +0xD85E 0x5082 +0xD85F 0x5087 +0xD860 0x515F +0xD861 0x51D4 +0xD862 0x5312 +0xD863 0x5311 +0xD864 0x53A4 +0xD865 0x53A7 +0xD866 0x5591 +0xD867 0x55A8 +0xD868 0x55A5 +0xD869 0x55AD +0xD86A 0x5577 +0xD86B 0x5645 +0xD86C 0x55A2 +0xD86D 0x5593 +0xD86E 0x5588 +0xD86F 0x558F +0xD870 0x55B5 +0xD871 0x5581 +0xD872 0x55A3 +0xD873 0x5592 +0xD874 0x55A4 +0xD875 0x557D +0xD876 0x558C +0xD877 0x55A6 +0xD878 0x557F +0xD879 0x5595 +0xD87A 0x55A1 +0xD87B 0x558E +0xD87C 0x570C +0xD87D 0x5829 +0xD87E 0x5837 +0xD8A1 0x5819 +0xD8A2 0x581E +0xD8A3 0x5827 +0xD8A4 0x5823 +0xD8A5 0x5828 +0xD8A6 0x57F5 +0xD8A7 0x5848 +0xD8A8 0x5825 +0xD8A9 0x581C +0xD8AA 0x581B +0xD8AB 0x5833 +0xD8AC 0x583F +0xD8AD 0x5836 +0xD8AE 0x582E +0xD8AF 0x5839 +0xD8B0 0x5838 +0xD8B1 0x582D +0xD8B2 0x582C +0xD8B3 0x583B +0xD8B4 0x5961 +0xD8B5 0x5AAF +0xD8B6 0x5A94 +0xD8B7 0x5A9F +0xD8B8 0x5A7A +0xD8B9 0x5AA2 +0xD8BA 0x5A9E +0xD8BB 0x5A78 +0xD8BC 0x5AA6 +0xD8BD 0x5A7C +0xD8BE 0x5AA5 +0xD8BF 0x5AAC +0xD8C0 0x5A95 +0xD8C1 0x5AAE +0xD8C2 0x5A37 +0xD8C3 0x5A84 +0xD8C4 0x5A8A +0xD8C5 0x5A97 +0xD8C6 0x5A83 +0xD8C7 0x5A8B +0xD8C8 0x5AA9 +0xD8C9 0x5A7B +0xD8CA 0x5A7D +0xD8CB 0x5A8C +0xD8CC 0x5A9C +0xD8CD 0x5A8F +0xD8CE 0x5A93 +0xD8CF 0x5A9D +0xD8D0 0x5BEA +0xD8D1 0x5BCD +0xD8D2 0x5BCB +0xD8D3 0x5BD4 +0xD8D4 0x5BD1 +0xD8D5 0x5BCA +0xD8D6 0x5BCE +0xD8D7 0x5C0C +0xD8D8 0x5C30 +0xD8D9 0x5D37 +0xD8DA 0x5D43 +0xD8DB 0x5D6B +0xD8DC 0x5D41 +0xD8DD 0x5D4B +0xD8DE 0x5D3F +0xD8DF 0x5D35 +0xD8E0 0x5D51 +0xD8E1 0x5D4E +0xD8E2 0x5D55 +0xD8E3 0x5D33 +0xD8E4 0x5D3A +0xD8E5 0x5D52 +0xD8E6 0x5D3D +0xD8E7 0x5D31 +0xD8E8 0x5D59 +0xD8E9 0x5D42 +0xD8EA 0x5D39 +0xD8EB 0x5D49 +0xD8EC 0x5D38 +0xD8ED 0x5D3C +0xD8EE 0x5D32 +0xD8EF 0x5D36 +0xD8F0 0x5D40 +0xD8F1 0x5D45 +0xD8F2 0x5E44 +0xD8F3 0x5E41 +0xD8F4 0x5F58 +0xD8F5 0x5FA6 +0xD8F6 0x5FA5 +0xD8F7 0x5FAB +0xD8F8 0x60C9 +0xD8F9 0x60B9 +0xD8FA 0x60CC +0xD8FB 0x60E2 +0xD8FC 0x60CE +0xD8FD 0x60C4 +0xD8FE 0x6114 +0xD940 0x60F2 +0xD941 0x610A +0xD942 0x6116 +0xD943 0x6105 +0xD944 0x60F5 +0xD945 0x6113 +0xD946 0x60F8 +0xD947 0x60FC +0xD948 0x60FE +0xD949 0x60C1 +0xD94A 0x6103 +0xD94B 0x6118 +0xD94C 0x611D +0xD94D 0x6110 +0xD94E 0x60FF +0xD94F 0x6104 +0xD950 0x610B +0xD951 0x624A +0xD952 0x6394 +0xD953 0x63B1 +0xD954 0x63B0 +0xD955 0x63CE +0xD956 0x63E5 +0xD957 0x63E8 +0xD958 0x63EF +0xD959 0x63C3 +0xD95A 0x649D +0xD95B 0x63F3 +0xD95C 0x63CA +0xD95D 0x63E0 +0xD95E 0x63F6 +0xD95F 0x63D5 +0xD960 0x63F2 +0xD961 0x63F5 +0xD962 0x6461 +0xD963 0x63DF +0xD964 0x63BE +0xD965 0x63DD +0xD966 0x63DC +0xD967 0x63C4 +0xD968 0x63D8 +0xD969 0x63D3 +0xD96A 0x63C2 +0xD96B 0x63C7 +0xD96C 0x63CC +0xD96D 0x63CB +0xD96E 0x63C8 +0xD96F 0x63F0 +0xD970 0x63D7 +0xD971 0x63D9 +0xD972 0x6532 +0xD973 0x6567 +0xD974 0x656A +0xD975 0x6564 +0xD976 0x655C +0xD977 0x6568 +0xD978 0x6565 +0xD979 0x658C +0xD97A 0xD97B 0x659D +0xD97C 0x65AE +0xD97D 0x65D0 +0xD97E 0x65D2 +0xD9A1 0x667C +0xD9A2 0x666C +0xD9A3 0x667B +0xD9A4 0x6680 +0xD9A5 0x6671 +0xD9A6 0x6679 +0xD9A7 0x666A +0xD9A8 0x6672 +0xD9A9 0x6701 +0xD9AA 0x690C +0xD9AB 0x68D3 +0xD9AC 0x6904 +0xD9AD 0x68DC +0xD9AE 0x692A +0xD9AF 0x68EC +0xD9B0 0x68EA +0xD9B1 0x68F1 +0xD9B2 0x690F +0xD9B3 0x68D6 +0xD9B4 0x68F7 +0xD9B5 0x68EB +0xD9B6 0x68E4 +0xD9B7 0x68F6 +0xD9B8 0x6913 +0xD9B9 0x6910 +0xD9BA 0x68F3 +0xD9BB 0x68E1 +0xD9BC 0x6907 +0xD9BD 0x68CC +0xD9BE 0x6908 +0xD9BF 0x6970 +0xD9C0 0x68B4 +0xD9C1 0x6911 +0xD9C2 0x68EF +0xD9C3 0x68C6 +0xD9C4 0x6914 +0xD9C5 0x68F8 +0xD9C6 0x68D0 +0xD9C7 0x68FD +0xD9C8 0x68FC +0xD9C9 0x68E8 +0xD9CA 0x690B +0xD9CB 0x690A +0xD9CC 0x6917 +0xD9CD 0x68CE +0xD9CE 0x68C8 +0xD9CF 0xD9D0 0x68DD +0xD9D1 0x68E6 +0xD9D2 0x68F4 +0xD9D3 0x68D1 +0xD9D4 0x6906 +0xD9D5 0x68D4 +0xD9D6 0x68E9 +0xD9D7 0x6915 +0xD9D8 0x6925 +0xD9D9 0x68C7 +0xD9DA 0x6B39 +0xD9DB 0x6B3B +0xD9DC 0x6B3F +0xD9DD 0x6B3C +0xD9DE 0x6B94 +0xD9DF 0x6B97 +0xD9E0 0x6B99 +0xD9E1 0x6B95 +0xD9E2 0x6BBD +0xD9E3 0x6BF0 +0xD9E4 0xD9E5 0x6BF2 +0xD9E6 0x6C30 +0xD9E7 0x6DFC +0xD9E8 0xD9E9 0x6E46 +0xD9EA 0x6E1F +0xD9EB 0x6E49 +0xD9EC 0x6E88 +0xD9ED 0xD9EE 0x6E3C +0xD9EF 0x6E45 +0xD9F0 0x6E62 +0xD9F1 0x6E2B +0xD9F2 0x6E3F +0xD9F3 0x6E41 +0xD9F4 0x6E5D +0xD9F5 0x6E73 +0xD9F6 0x6E1C +0xD9F7 0x6E33 +0xD9F8 0x6E4B +0xD9F9 0x6E40 +0xD9FA 0x6E51 +0xD9FB 0x6E3B +0xD9FC 0x6E03 +0xD9FD 0x6E2E +0xD9FE 0x6E5E +0xDA40 0x6E68 +0xDA41 0x6E5C +0xDA42 0x6E61 +0xDA43 0x6E31 +0xDA44 0x6E28 +0xDA45 0x6E60 +0xDA46 0x6E71 +0xDA47 0x6E6B +0xDA48 0x6E39 +0xDA49 0x6E22 +0xDA4A 0x6E30 +0xDA4B 0x6E53 +0xDA4C 0x6E65 +0xDA4D 0x6E27 +0xDA4E 0x6E78 +0xDA4F 0x6E64 +0xDA50 0x6E77 +0xDA51 0x6E55 +0xDA52 0x6E79 +0xDA53 0x6E52 +0xDA54 0x6E66 +0xDA55 0xDA56 0x6E35 +0xDA57 0x6E5A +0xDA58 0x7120 +0xDA59 0x711E +0xDA5A 0x712F +0xDA5B 0x70FB +0xDA5C 0x712E +0xDA5D 0x7131 +0xDA5E 0x7123 +0xDA5F 0x7125 +0xDA60 0x7122 +0xDA61 0x7132 +0xDA62 0x711F +0xDA63 0x7128 +0xDA64 0x713A +0xDA65 0x711B +0xDA66 0x724B +0xDA67 0x725A +0xDA68 0xDA69 0x7288 +0xDA6A 0x7286 +0xDA6B 0x7285 +0xDA6C 0x728B +0xDA6D 0x7312 +0xDA6E 0x730B +0xDA6F 0x7330 +0xDA70 0x7322 +0xDA71 0x7331 +0xDA72 0x7333 +0xDA73 0x7327 +0xDA74 0x7332 +0xDA75 0x732D +0xDA76 0x7326 +0xDA77 0x7323 +0xDA78 0x7335 +0xDA79 0x730C +0xDA7A 0x742E +0xDA7B 0x742C +0xDA7C 0x7430 +0xDA7D 0x742B +0xDA7E 0x7416 +0xDAA1 0x741A +0xDAA2 0x7421 +0xDAA3 0x742D +0xDAA4 0x7431 +0xDAA5 0x7424 +0xDAA6 0x7423 +0xDAA7 0x741D +0xDAA8 0x7429 +0xDAA9 0x7420 +0xDAAA 0x7432 +0xDAAB 0x74FB +0xDAAC 0x752F +0xDAAD 0x756F +0xDAAE 0x756C +0xDAAF 0x75E7 +0xDAB0 0x75DA +0xDAB1 0x75E1 +0xDAB2 0x75E6 +0xDAB3 0x75DD +0xDAB4 0x75DF +0xDAB5 0x75E4 +0xDAB6 0x75D7 +0xDAB7 0x7695 +0xDAB8 0x7692 +0xDAB9 0x76DA +0xDABA 0xDABB 0x7746 +0xDABC 0x7744 +0xDABD 0x774D +0xDABE 0x7745 +0xDABF 0x774A +0xDAC0 0x774E +0xDAC1 0xDAC2 0x774B +0xDAC3 0x77DE +0xDAC4 0x77EC +0xDAC5 0x7860 +0xDAC6 0xDAC7 0x7864 +0xDAC8 0x785C +0xDAC9 0x786D +0xDACA 0x7871 +0xDACB 0x786A +0xDACC 0x786E +0xDACD 0x7870 +0xDACE 0x7869 +0xDACF 0x7868 +0xDAD0 0x785E +0xDAD1 0x7862 +0xDAD2 0x7974 +0xDAD3 0x7973 +0xDAD4 0x7972 +0xDAD5 0x7970 +0xDAD6 0x7A02 +0xDAD7 0x7A0A +0xDAD8 0x7A03 +0xDAD9 0x7A0C +0xDADA 0x7A04 +0xDADB 0x7A99 +0xDADC 0x7AE6 +0xDADD 0x7AE4 +0xDADE 0x7B4A +0xDADF 0x7B3B +0xDAE0 0x7B44 +0xDAE1 0x7B48 +0xDAE2 0x7B4C +0xDAE3 0x7B4E +0xDAE4 0x7B40 +0xDAE5 0x7B58 +0xDAE6 0x7B45 +0xDAE7 0x7CA2 +0xDAE8 0x7C9E +0xDAE9 0x7CA8 +0xDAEA 0x7CA1 +0xDAEB 0x7D58 +0xDAEC 0x7D6F +0xDAED 0x7D63 +0xDAEE 0x7D53 +0xDAEF 0x7D56 +0xDAF0 0x7D67 +0xDAF1 0x7D6A +0xDAF2 0x7D4F +0xDAF3 0x7D6D +0xDAF4 0x7D5C +0xDAF5 0x7D6B +0xDAF6 0x7D52 +0xDAF7 0x7D54 +0xDAF8 0x7D69 +0xDAF9 0x7D51 +0xDAFA 0x7D5F +0xDAFB 0x7D4E +0xDAFC 0xDAFD 0x7F3E +0xDAFE 0x7F65 +0xDB40 0x7F66 +0xDB41 0x7FA2 +0xDB42 0xDB43 0x7FA0 +0xDB44 0x7FD7 +0xDB45 0x8051 +0xDB46 0xDB47 0x804F +0xDB48 0x80FE +0xDB49 0x80D4 +0xDB4A 0x8143 +0xDB4B 0x814A +0xDB4C 0x8152 +0xDB4D 0x814F +0xDB4E 0x8147 +0xDB4F 0x813D +0xDB50 0x814D +0xDB51 0x813A +0xDB52 0x81E6 +0xDB53 0x81EE +0xDB54 0xDB56 0x81F7 +0xDB57 0x8204 +0xDB58 0xDB59 0x823C +0xDB5A 0x823F +0xDB5B 0x8275 +0xDB5C 0x833B +0xDB5D 0x83CF +0xDB5E 0x83F9 +0xDB5F 0x8423 +0xDB60 0x83C0 +0xDB61 0x83E8 +0xDB62 0x8412 +0xDB63 0x83E7 +0xDB64 0x83E4 +0xDB65 0x83FC +0xDB66 0x83F6 +0xDB67 0x8410 +0xDB68 0x83C6 +0xDB69 0x83C8 +0xDB6A 0x83EB +0xDB6B 0x83E3 +0xDB6C 0x83BF +0xDB6D 0x8401 +0xDB6E 0x83DD +0xDB6F 0x83E5 +0xDB70 0x83D8 +0xDB71 0x83FF +0xDB72 0x83E1 +0xDB73 0x83CB +0xDB74 0x83CE +0xDB75 0x83D6 +0xDB76 0x83F5 +0xDB77 0x83C9 +0xDB78 0x8409 +0xDB79 0x840F +0xDB7A 0x83DE +0xDB7B 0x8411 +0xDB7C 0x8406 +0xDB7D 0x83C2 +0xDB7E 0x83F3 +0xDBA1 0x83D5 +0xDBA2 0x83FA +0xDBA3 0x83C7 +0xDBA4 0x83D1 +0xDBA5 0x83EA +0xDBA6 0x8413 +0xDBA7 0x83C3 +0xDBA8 0x83EC +0xDBA9 0x83EE +0xDBAA 0x83C4 +0xDBAB 0x83FB +0xDBAC 0x83D7 +0xDBAD 0x83E2 +0xDBAE 0x841B +0xDBAF 0x83DB +0xDBB0 0x83FE +0xDBB1 0x86D8 +0xDBB2 0x86E2 +0xDBB3 0x86E6 +0xDBB4 0x86D3 +0xDBB5 0x86E3 +0xDBB6 0x86DA +0xDBB7 0x86EA +0xDBB8 0x86DD +0xDBB9 0x86EB +0xDBBA 0x86DC +0xDBBB 0x86EC +0xDBBC 0x86E9 +0xDBBD 0x86D7 +0xDBBE 0x86E8 +0xDBBF 0x86D1 +0xDBC0 0x8848 +0xDBC1 0x8856 +0xDBC2 0x8855 +0xDBC3 0x88BA +0xDBC4 0x88D7 +0xDBC5 0x88B9 +0xDBC6 0x88B8 +0xDBC7 0x88C0 +0xDBC8 0x88BE +0xDBC9 0x88B6 +0xDBCA 0x88BC +0xDBCB 0x88B7 +0xDBCC 0x88BD +0xDBCD 0x88B2 +0xDBCE 0x8901 +0xDBCF 0x88C9 +0xDBD0 0x8995 +0xDBD1 0x8998 +0xDBD2 0x8997 +0xDBD3 0x89DD +0xDBD4 0xDBD5 0x89DA +0xDBD6 0x8A4E +0xDBD7 0x8A4D +0xDBD8 0x8A39 +0xDBD9 0x8A59 +0xDBDA 0x8A40 +0xDBDB 0xDBDC 0x8A57 +0xDBDD 0xDBDE 0x8A44 +0xDBDF 0x8A52 +0xDBE0 0x8A48 +0xDBE1 0x8A51 +0xDBE2 0x8A4A +0xDBE3 0x8A4C +0xDBE4 0x8A4F +0xDBE5 0x8C5F +0xDBE6 0x8C81 +0xDBE7 0x8C80 +0xDBE8 0x8CBA +0xDBE9 0x8CBE +0xDBEA 0x8CB0 +0xDBEB 0x8CB9 +0xDBEC 0x8CB5 +0xDBED 0x8D84 +0xDBEE 0x8D80 +0xDBEF 0x8D89 +0xDBF0 0x8DD8 +0xDBF1 0x8DD3 +0xDBF2 0x8DCD +0xDBF3 0x8DC7 +0xDBF4 0x8DD6 +0xDBF5 0x8DDC +0xDBF6 0x8DCF +0xDBF7 0x8DD5 +0xDBF8 0x8DD9 +0xDBF9 0x8DC8 +0xDBFA 0x8DD7 +0xDBFB 0x8DC5 +0xDBFC 0x8EEF +0xDBFD 0x8EF7 +0xDBFE 0x8EFA +0xDC40 0x8EF9 +0xDC41 0x8EE6 +0xDC42 0x8EEE +0xDC43 0x8EE5 +0xDC44 0x8EF5 +0xDC45 0xDC46 0x8EE7 +0xDC47 0x8EF6 +0xDC48 0x8EEB +0xDC49 0x8EF1 +0xDC4A 0x8EEC +0xDC4B 0x8EF4 +0xDC4C 0x8EE9 +0xDC4D 0x902D +0xDC4E 0x9034 +0xDC4F 0x902F +0xDC50 0x9106 +0xDC51 0x912C +0xDC52 0x9104 +0xDC53 0x90FF +0xDC54 0x90FC +0xDC55 0x9108 +0xDC56 0x90F9 +0xDC57 0x90FB +0xDC58 0x9101 +0xDC59 0x9100 +0xDC5A 0x9107 +0xDC5B 0x9105 +0xDC5C 0x9103 +0xDC5D 0x9161 +0xDC5E 0x9164 +0xDC5F 0x915F +0xDC60 0x9162 +0xDC61 0x9160 +0xDC62 0x9201 +0xDC63 0x920A +0xDC64 0x9225 +0xDC65 0x9203 +0xDC66 0x921A +0xDC67 0x9226 +0xDC68 0x920F +0xDC69 0x920C +0xDC6A 0x9200 +0xDC6B 0x9212 +0xDC6C 0x91FF +0xDC6D 0x91FD +0xDC6E 0x9206 +0xDC6F 0x9204 +0xDC70 0x9227 +0xDC71 0x9202 +0xDC72 0x921C +0xDC73 0x9224 +0xDC74 0x9219 +0xDC75 0x9217 +0xDC76 0x9205 +0xDC77 0x9216 +0xDC78 0x957B +0xDC79 0x958D +0xDC7A 0x958C +0xDC7B 0x9590 +0xDC7C 0x9687 +0xDC7D 0x967E +0xDC7E 0x9688 +0xDCA1 0x9689 +0xDCA2 0x9683 +0xDCA3 0x9680 +0xDCA4 0x96C2 +0xDCA5 0x96C8 +0xDCA6 0x96C3 +0xDCA7 0x96F1 +0xDCA8 0x96F0 +0xDCA9 0x976C +0xDCAA 0x9770 +0xDCAB 0x976E +0xDCAC 0x9807 +0xDCAD 0x98A9 +0xDCAE 0x98EB +0xDCAF 0x9CE6 +0xDCB0 0x9EF9 +0xDCB1 0xDCB2 0x4E83 +0xDCB3 0x4EB6 +0xDCB4 0x50BD +0xDCB5 0x50BF +0xDCB6 0x50C6 +0xDCB7 0x50AE +0xDCB8 0x50C4 +0xDCB9 0x50CA +0xDCBA 0x50B4 +0xDCBB 0x50C8 +0xDCBC 0x50C2 +0xDCBD 0x50B0 +0xDCBE 0x50C1 +0xDCBF 0x50BA +0xDCC0 0x50B1 +0xDCC1 0x50CB +0xDCC2 0x50C9 +0xDCC3 0x50B6 +0xDCC4 0x50B8 +0xDCC5 0x51D7 +0xDCC6 0x527A +0xDCC7 0x5278 +0xDCC8 0xDCC9 0x527B +0xDCCA 0x55C3 +0xDCCB 0x55DB +0xDCCC 0x55CC +0xDCCD 0x55D0 +0xDCCE 0x55CB +0xDCCF 0x55CA +0xDCD0 0x55DD +0xDCD1 0x55C0 +0xDCD2 0x55D4 +0xDCD3 0x55C4 +0xDCD4 0x55E9 +0xDCD5 0x55BF +0xDCD6 0x55D2 +0xDCD7 0x558D +0xDCD8 0x55CF +0xDCD9 0x55D5 +0xDCDA 0x55E2 +0xDCDB 0x55D6 +0xDCDC 0x55C8 +0xDCDD 0x55F2 +0xDCDE 0x55CD +0xDCDF 0x55D9 +0xDCE0 0x55C2 +0xDCE1 0x5714 +0xDCE2 0x5853 +0xDCE3 0x5868 +0xDCE4 0x5864 +0xDCE5 0x584F +0xDCE6 0x584D +0xDCE7 0x5849 +0xDCE8 0x586F +0xDCE9 0x5855 +0xDCEA 0x584E +0xDCEB 0x585D +0xDCEC 0x5859 +0xDCED 0x5865 +0xDCEE 0x585B +0xDCEF 0x583D +0xDCF0 0x5863 +0xDCF1 0x5871 +0xDCF2 0x58FC +0xDCF3 0x5AC7 +0xDCF4 0x5AC4 +0xDCF5 0x5ACB +0xDCF6 0x5ABA +0xDCF7 0x5AB8 +0xDCF8 0x5AB1 +0xDCF9 0x5AB5 +0xDCFA 0x5AB0 +0xDCFB 0x5ABF +0xDCFC 0x5AC8 +0xDCFD 0x5ABB +0xDCFE 0x5AC6 +0xDD40 0x5AB7 +0xDD41 0x5AC0 +0xDD42 0x5ACA +0xDD43 0x5AB4 +0xDD44 0x5AB6 +0xDD45 0x5ACD +0xDD46 0x5AB9 +0xDD47 0x5A90 +0xDD48 0x5BD6 +0xDD49 0xDD4A 0x5BD8 +0xDD4B 0x5C1F +0xDD4C 0x5C33 +0xDD4D 0x5D71 +0xDD4E 0x5D63 +0xDD4F 0x5D4A +0xDD50 0x5D65 +0xDD51 0x5D72 +0xDD52 0x5D6C +0xDD53 0x5D5E +0xDD54 0x5D68 +0xDD55 0x5D67 +0xDD56 0x5D62 +0xDD57 0x5DF0 +0xDD58 0x5E4F +0xDD59 0x5E4E +0xDD5A 0x5E4A +0xDD5B 0x5E4D +0xDD5C 0x5E4B +0xDD5D 0x5EC5 +0xDD5E 0x5ECC +0xDD5F 0x5EC6 +0xDD60 0x5ECB +0xDD61 0x5EC7 +0xDD62 0x5F40 +0xDD63 0x5FAF +0xDD64 0x5FAD +0xDD65 0x60F7 +0xDD66 0xDD67 0x6149 +0xDD68 0x612B +0xDD69 0x6145 +0xDD6A 0x6136 +0xDD6B 0x6132 +0xDD6C 0x612E +0xDD6D 0x6146 +0xDD6E 0x612F +0xDD6F 0x614F +0xDD70 0x6129 +0xDD71 0x6140 +0xDD72 0x6220 +0xDD73 0x9168 +0xDD74 0x6223 +0xDD75 0x6225 +0xDD76 0x6224 +0xDD77 0x63C5 +0xDD78 0x63F1 +0xDD79 0x63EB +0xDD7A 0x6410 +0xDD7B 0x6412 +0xDD7C 0x6409 +0xDD7D 0x6420 +0xDD7E 0x6424 +0xDDA1 0x6433 +0xDDA2 0x6443 +0xDDA3 0x641F +0xDDA4 0x6415 +0xDDA5 0x6418 +0xDDA6 0x6439 +0xDDA7 0x6437 +0xDDA8 0xDDA9 0x6422 +0xDDAA 0x640C +0xDDAB 0x6426 +0xDDAC 0x6430 +0xDDAD 0x6428 +0xDDAE 0x6441 +0xDDAF 0x6435 +0xDDB0 0x642F +0xDDB1 0x640A +0xDDB2 0x641A +0xDDB3 0x6440 +0xDDB4 0x6425 +0xDDB5 0x6427 +0xDDB6 0x640B +0xDDB7 0x63E7 +0xDDB8 0x641B +0xDDB9 0x642E +0xDDBA 0x6421 +0xDDBB 0x640E +0xDDBC 0x656F +0xDDBD 0x6592 +0xDDBE 0x65D3 +0xDDBF 0x6686 +0xDDC0 0x668C +0xDDC1 0x6695 +0xDDC2 0x6690 +0xDDC3 0x668B +0xDDC4 0x668A +0xDDC5 0x6699 +0xDDC6 0x6694 +0xDDC7 0x6678 +0xDDC8 0x6720 +0xDDC9 0x6966 +0xDDCA 0x695F +0xDDCB 0x6938 +0xDDCC 0x694E +0xDDCD 0x6962 +0xDDCE 0x6971 +0xDDCF 0x693F +0xDDD0 0x6945 +0xDDD1 0x696A +0xDDD2 0x6939 +0xDDD3 0x6942 +0xDDD4 0x6957 +0xDDD5 0x6959 +0xDDD6 0x697A +0xDDD7 0xDDD8 0x6948 +0xDDD9 0x6935 +0xDDDA 0x696C +0xDDDB 0x6933 +0xDDDC 0x693D +0xDDDD 0x6965 +0xDDDE 0x68F0 +0xDDDF 0x6978 +0xDDE0 0x6934 +0xDDE1 0x6969 +0xDDE2 0x6940 +0xDDE3 0x696F +0xDDE4 0x6944 +0xDDE5 0x6976 +0xDDE6 0x6958 +0xDDE7 0x6941 +0xDDE8 0x6974 +0xDDE9 0x694C +0xDDEA 0x693B +0xDDEB 0x694B +0xDDEC 0x6937 +0xDDED 0x695C +0xDDEE 0x694F +0xDDEF 0x6951 +0xDDF0 0x6932 +0xDDF1 0x6952 +0xDDF2 0x692F +0xDDF3 0x697B +0xDDF4 0x693C +0xDDF5 0x6B46 +0xDDF6 0x6B45 +0xDDF7 0x6B43 +0xDDF8 0x6B42 +0xDDF9 0x6B48 +0xDDFA 0x6B41 +0xDDFB 0x6B9B +0xDDFC 0xFA0D +0xDDFD 0xDDFE 0x6BFB +0xDE40 0x6BF9 +0xDE41 0xDE42 0x6BF7 +0xDE43 0x6E9B +0xDE44 0x6ED6 +0xDE45 0x6EC8 +0xDE46 0x6E8F +0xDE47 0x6EC0 +0xDE48 0x6E9F +0xDE49 0xDE4A 0x6E93 +0xDE4B 0x6EA0 +0xDE4C 0x6EB1 +0xDE4D 0x6EB9 +0xDE4E 0x6EC6 +0xDE4F 0x6ED2 +0xDE50 0x6EBD +0xDE51 0x6EC1 +0xDE52 0x6E9E +0xDE53 0x6EC9 +0xDE54 0x6EB7 +0xDE55 0x6EB0 +0xDE56 0x6ECD +0xDE57 0x6EA6 +0xDE58 0x6ECF +0xDE59 0x6EB2 +0xDE5A 0x6EBE +0xDE5B 0x6EC3 +0xDE5C 0x6EDC +0xDE5D 0x6ED8 +0xDE5E 0x6E99 +0xDE5F 0x6E92 +0xDE60 0x6E8E +0xDE61 0x6E8D +0xDE62 0x6EA4 +0xDE63 0x6EA1 +0xDE64 0x6EBF +0xDE65 0x6EB3 +0xDE66 0x6ED0 +0xDE67 0x6ECA +0xDE68 0x6E97 +0xDE69 0x6EAE +0xDE6A 0x6EA3 +0xDE6B 0x7147 +0xDE6C 0x7154 +0xDE6D 0x7152 +0xDE6E 0x7163 +0xDE6F 0x7160 +0xDE70 0x7141 +0xDE71 0x715D +0xDE72 0x7162 +0xDE73 0x7172 +0xDE74 0x7178 +0xDE75 0x716A +0xDE76 0x7161 +0xDE77 0x7142 +0xDE78 0x7158 +0xDE79 0x7143 +0xDE7A 0x714B +0xDE7B 0x7170 +0xDE7C 0x715F +0xDE7D 0x7150 +0xDE7E 0x7153 +0xDEA1 0x7144 +0xDEA2 0x714D +0xDEA3 0x715A +0xDEA4 0x724F +0xDEA5 0x728D +0xDEA6 0x728C +0xDEA7 0x7291 +0xDEA8 0x7290 +0xDEA9 0x728E +0xDEAA 0x733C +0xDEAB 0x7342 +0xDEAC 0x733B +0xDEAD 0x733A +0xDEAE 0x7340 +0xDEAF 0x734A +0xDEB0 0x7349 +0xDEB1 0x7444 +0xDEB2 0xDEB3 0x744A +0xDEB4 0x7452 +0xDEB5 0x7451 +0xDEB6 0x7457 +0xDEB7 0x7440 +0xDEB8 0xDEB9 0x744F +0xDEBA 0x744E +0xDEBB 0x7442 +0xDEBC 0x7446 +0xDEBD 0x744D +0xDEBE 0x7454 +0xDEBF 0x74E1 +0xDEC0 0x74FF +0xDEC1 0x74FE +0xDEC2 0x74FD +0xDEC3 0x751D +0xDEC4 0x7579 +0xDEC5 0x7577 +0xDEC6 0x6983 +0xDEC7 0x75EF +0xDEC8 0x760F +0xDEC9 0x7603 +0xDECA 0x75F7 +0xDECB 0x75FE +0xDECC 0x75FC +0xDECD 0x75F9 +0xDECE 0x75F8 +0xDECF 0x7610 +0xDED0 0x75FB +0xDED1 0x75F6 +0xDED2 0x75ED +0xDED3 0x75F5 +0xDED4 0x75FD +0xDED5 0x7699 +0xDED6 0x76B5 +0xDED7 0x76DD +0xDED8 0x7755 +0xDED9 0xDEDA 0x775F +0xDEDB 0x7752 +0xDEDC 0x7756 +0xDEDD 0x775A +0xDEDE 0x7769 +0xDEDF 0x7767 +0xDEE0 0x7754 +0xDEE1 0x7759 +0xDEE2 0x776D +0xDEE3 0x77E0 +0xDEE4 0x7887 +0xDEE5 0x789A +0xDEE6 0x7894 +0xDEE7 0x788F +0xDEE8 0x7884 +0xDEE9 0x7895 +0xDEEA 0xDEEB 0x7885 +0xDEEC 0x78A1 +0xDEED 0x7883 +0xDEEE 0x7879 +0xDEEF 0x7899 +0xDEF0 0x7880 +0xDEF1 0x7896 +0xDEF2 0x787B +0xDEF3 0x797C +0xDEF4 0x7982 +0xDEF5 0x797D +0xDEF6 0x7979 +0xDEF7 0x7A11 +0xDEF8 0xDEF9 0x7A18 +0xDEFA 0x7A12 +0xDEFB 0x7A17 +0xDEFC 0x7A15 +0xDEFD 0x7A22 +0xDEFE 0x7A13 +0xDF40 0x7A1B +0xDF41 0x7A10 +0xDF42 0x7AA3 +0xDF43 0x7AA2 +0xDF44 0x7A9E +0xDF45 0x7AEB +0xDF46 0x7B66 +0xDF47 0x7B64 +0xDF48 0x7B6D +0xDF49 0x7B74 +0xDF4A 0x7B69 +0xDF4B 0x7B72 +0xDF4C 0x7B65 +0xDF4D 0x7B73 +0xDF4E 0x7B71 +0xDF4F 0x7B70 +0xDF50 0x7B61 +0xDF51 0x7B78 +0xDF52 0x7B76 +0xDF53 0x7B63 +0xDF54 0x7CB2 +0xDF55 0x7CB4 +0xDF56 0x7CAF +0xDF57 0x7D88 +0xDF58 0x7D86 +0xDF59 0x7D80 +0xDF5A 0x7D8D +0xDF5B 0x7D7F +0xDF5C 0x7D85 +0xDF5D 0x7D7A +0xDF5E 0x7D8E +0xDF5F 0x7D7B +0xDF60 0x7D83 +0xDF61 0x7D7C +0xDF62 0x7D8C +0xDF63 0x7D94 +0xDF64 0x7D84 +0xDF65 0x7D7D +0xDF66 0x7D92 +0xDF67 0x7F6D +0xDF68 0x7F6B +0xDF69 0xDF6A 0x7F67 +0xDF6B 0x7F6C +0xDF6C 0x7FA6 +0xDF6D 0x7FA5 +0xDF6E 0x7FA7 +0xDF6F 0xDF70 0x7FDB +0xDF71 0x8021 +0xDF72 0x8164 +0xDF73 0x8160 +0xDF74 0x8177 +0xDF75 0x815C +0xDF76 0x8169 +0xDF77 0x815B +0xDF78 0x8162 +0xDF79 0x8172 +0xDF7A 0x6721 +0xDF7B 0x815E +0xDF7C 0x8176 +0xDF7D 0x8167 +0xDF7E 0x816F +0xDFA1 0x8144 +0xDFA2 0x8161 +0xDFA3 0x821D +0xDFA4 0x8249 +0xDFA5 0x8244 +0xDFA6 0x8240 +0xDFA7 0x8242 +0xDFA8 0x8245 +0xDFA9 0x84F1 +0xDFAA 0x843F +0xDFAB 0x8456 +0xDFAC 0x8476 +0xDFAD 0x8479 +0xDFAE 0x848F +0xDFAF 0x848D +0xDFB0 0x8465 +0xDFB1 0x8451 +0xDFB2 0x8440 +0xDFB3 0x8486 +0xDFB4 0x8467 +0xDFB5 0x8430 +0xDFB6 0x844D +0xDFB7 0x847D +0xDFB8 0x845A +0xDFB9 0x8459 +0xDFBA 0x8474 +0xDFBB 0x8473 +0xDFBC 0x845D +0xDFBD 0x8507 +0xDFBE 0x845E +0xDFBF 0x8437 +0xDFC0 0x843A +0xDFC1 0x8434 +0xDFC2 0x847A +0xDFC3 0x8443 +0xDFC4 0x8478 +0xDFC5 0x8432 +0xDFC6 0x8445 +0xDFC7 0x8429 +0xDFC8 0x83D9 +0xDFC9 0x844B +0xDFCA 0x842F +0xDFCB 0x8442 +0xDFCC 0x842D +0xDFCD 0x845F +0xDFCE 0x8470 +0xDFCF 0x8439 +0xDFD0 0x844E +0xDFD1 0x844C +0xDFD2 0x8452 +0xDFD3 0x846F +0xDFD4 0x84C5 +0xDFD5 0x848E +0xDFD6 0x843B +0xDFD7 0x8447 +0xDFD8 0x8436 +0xDFD9 0x8433 +0xDFDA 0x8468 +0xDFDB 0x847E +0xDFDC 0x8444 +0xDFDD 0x842B +0xDFDE 0x8460 +0xDFDF 0x8454 +0xDFE0 0x846E +0xDFE1 0x8450 +0xDFE2 0x870B +0xDFE3 0x8704 +0xDFE4 0x86F7 +0xDFE5 0x870C +0xDFE6 0x86FA +0xDFE7 0x86D6 +0xDFE8 0x86F5 +0xDFE9 0x874D +0xDFEA 0x86F8 +0xDFEB 0x870E +0xDFEC 0x8709 +0xDFED 0x8701 +0xDFEE 0x86F6 +0xDFEF 0x870D +0xDFF0 0x8705 +0xDFF1 0x88D6 +0xDFF2 0x88CB +0xDFF3 0xDFF4 0x88CD +0xDFF5 0x88DE +0xDFF6 0x88DB +0xDFF7 0x88DA +0xDFF8 0x88CC +0xDFF9 0x88D0 +0xDFFA 0x8985 +0xDFFB 0x899B +0xDFFC 0x89DF +0xDFFD 0x89E5 +0xDFFE 0x89E4 +0xE040 0x89E1 +0xE041 0x89E0 +0xE042 0x89E2 +0xE043 0x89DC +0xE044 0x89E6 +0xE045 0x8A76 +0xE046 0x8A86 +0xE047 0x8A7F +0xE048 0x8A61 +0xE049 0x8A3F +0xE04A 0x8A77 +0xE04B 0x8A82 +0xE04C 0x8A84 +0xE04D 0x8A75 +0xE04E 0x8A83 +0xE04F 0x8A81 +0xE050 0x8A74 +0xE051 0x8A7A +0xE052 0x8C3C +0xE053 0x8C4B +0xE054 0x8C4A +0xE055 0x8C65 +0xE056 0x8C64 +0xE057 0x8C66 +0xE058 0x8C86 +0xE059 0xE05A 0x8C84 +0xE05B 0x8CCC +0xE05C 0xE05D 0x8D68 +0xE05E 0x8D91 +0xE05F 0x8D8C +0xE060 0xE061 0x8D8E +0xE062 0x8D8D +0xE063 0xE064 0x8D93 +0xE065 0x8D90 +0xE066 0x8D92 +0xE067 0x8DF0 +0xE068 0x8DE0 +0xE069 0x8DEC +0xE06A 0x8DF1 +0xE06B 0x8DEE +0xE06C 0x8DD0 +0xE06D 0x8DE9 +0xE06E 0x8DE3 +0xE06F 0x8DE2 +0xE070 0x8DE7 +0xE071 0x8DF2 +0xE072 0x8DEB +0xE073 0x8DF4 +0xE074 0x8F06 +0xE075 0x8EFF +0xE076 0x8F01 +0xE077 0x8F00 +0xE078 0x8F05 +0xE079 0xE07A 0x8F07 +0xE07B 0x8F02 +0xE07C 0x8F0B +0xE07D 0x9052 +0xE07E 0x903F +0xE0A1 0x9044 +0xE0A2 0x9049 +0xE0A3 0x903D +0xE0A4 0x9110 +0xE0A5 0x910D +0xE0A6 0x910F +0xE0A7 0x9111 +0xE0A8 0x9116 +0xE0A9 0x9114 +0xE0AA 0x910B +0xE0AB 0x910E +0xE0AC 0xE0AD 0x916E +0xE0AE 0x9248 +0xE0AF 0x9252 +0xE0B0 0x9230 +0xE0B1 0x923A +0xE0B2 0x9266 +0xE0B3 0x9233 +0xE0B4 0x9265 +0xE0B5 0x925E +0xE0B6 0x9283 +0xE0B7 0x922E +0xE0B8 0x924A +0xE0B9 0x9246 +0xE0BA 0x926D +0xE0BB 0x926C +0xE0BC 0x924F +0xE0BD 0x9260 +0xE0BE 0x9267 +0xE0BF 0x926F +0xE0C0 0x9236 +0xE0C1 0x9261 +0xE0C2 0x9270 +0xE0C3 0x9231 +0xE0C4 0x9254 +0xE0C5 0x9263 +0xE0C6 0x9250 +0xE0C7 0x9272 +0xE0C8 0x924E +0xE0C9 0x9253 +0xE0CA 0x924C +0xE0CB 0x9256 +0xE0CC 0x9232 +0xE0CD 0x959F +0xE0CE 0x959C +0xE0CF 0x959E +0xE0D0 0x959B +0xE0D1 0xE0D2 0x9692 +0xE0D3 0x9691 +0xE0D4 0x9697 +0xE0D5 0x96CE +0xE0D6 0x96FA +0xE0D7 0x96FD +0xE0D8 0x96F8 +0xE0D9 0x96F5 +0xE0DA 0x9773 +0xE0DB 0xE0DC 0x9777 +0xE0DD 0x9772 +0xE0DE 0x980F +0xE0DF 0xE0E0 0x980D +0xE0E1 0x98AC +0xE0E2 0x98F6 +0xE0E3 0x98F9 +0xE0E4 0x99AF +0xE0E5 0x99B2 +0xE0E6 0x99B0 +0xE0E7 0x99B5 +0xE0E8 0x9AAD +0xE0E9 0x9AAB +0xE0EA 0x9B5B +0xE0EB 0x9CEA +0xE0EC 0x9CED +0xE0ED 0x9CE7 +0xE0EE 0x9E80 +0xE0EF 0x9EFD +0xE0F0 0x50E6 +0xE0F1 0x50D4 +0xE0F2 0x50D7 +0xE0F3 0x50E8 +0xE0F4 0x50F3 +0xE0F5 0x50DB +0xE0F6 0x50EA +0xE0F7 0x50DD +0xE0F8 0x50E4 +0xE0F9 0x50D3 +0xE0FA 0x50EC +0xE0FB 0x50F0 +0xE0FC 0x50EF +0xE0FD 0x50E3 +0xE0FE 0x50E0 +0xE140 0x51D8 +0xE141 0xE142 0x5280 +0xE143 0x52E9 +0xE144 0x52EB +0xE145 0x5330 +0xE146 0x53AC +0xE147 0x5627 +0xE148 0x5615 +0xE149 0x560C +0xE14A 0x5612 +0xE14B 0x55FC +0xE14C 0x560F +0xE14D 0x561C +0xE14E 0x5601 +0xE14F 0x5613 +0xE150 0x5602 +0xE151 0x55FA +0xE152 0x561D +0xE153 0x5604 +0xE154 0x55FF +0xE155 0x55F9 +0xE156 0x5889 +0xE157 0x587C +0xE158 0x5890 +0xE159 0x5898 +0xE15A 0x5886 +0xE15B 0x5881 +0xE15C 0x587F +0xE15D 0x5874 +0xE15E 0x588B +0xE15F 0x587A +0xE160 0x5887 +0xE161 0x5891 +0xE162 0x588E +0xE163 0x5876 +0xE164 0x5882 +0xE165 0x5888 +0xE166 0x587B +0xE167 0x5894 +0xE168 0x588F +0xE169 0x58FE +0xE16A 0x596B +0xE16B 0x5ADC +0xE16C 0x5AEE +0xE16D 0x5AE5 +0xE16E 0x5AD5 +0xE16F 0x5AEA +0xE170 0x5ADA +0xE171 0x5AED +0xE172 0x5AEB +0xE173 0x5AF3 +0xE174 0x5AE2 +0xE175 0x5AE0 +0xE176 0x5ADB +0xE177 0x5AEC +0xE178 0x5ADE +0xE179 0x5ADD +0xE17A 0x5AD9 +0xE17B 0x5AE8 +0xE17C 0x5ADF +0xE17D 0x5B77 +0xE17E 0x5BE0 +0xE1A1 0x5BE3 +0xE1A2 0x5C63 +0xE1A3 0x5D82 +0xE1A4 0x5D80 +0xE1A5 0x5D7D +0xE1A6 0x5D86 +0xE1A7 0x5D7A +0xE1A8 0x5D81 +0xE1A9 0x5D77 +0xE1AA 0x5D8A +0xE1AB 0x5D89 +0xE1AC 0x5D88 +0xE1AD 0x5D7E +0xE1AE 0x5D7C +0xE1AF 0x5D8D +0xE1B0 0x5D79 +0xE1B1 0x5D7F +0xE1B2 0xE1B3 0x5E58 +0xE1B4 0x5E53 +0xE1B5 0x5ED8 +0xE1B6 0x5ED1 +0xE1B7 0x5ED7 +0xE1B8 0x5ECE +0xE1B9 0x5EDC +0xE1BA 0x5ED5 +0xE1BB 0x5ED9 +0xE1BC 0x5ED2 +0xE1BD 0x5ED4 +0xE1BE 0x5F44 +0xE1BF 0x5F43 +0xE1C0 0x5F6F +0xE1C1 0x5FB6 +0xE1C2 0x612C +0xE1C3 0x6128 +0xE1C4 0x6141 +0xE1C5 0x615E +0xE1C6 0x6171 +0xE1C7 0x6173 +0xE1C8 0xE1C9 0x6152 +0xE1CA 0x6172 +0xE1CB 0x616C +0xE1CC 0x6180 +0xE1CD 0x6174 +0xE1CE 0x6154 +0xE1CF 0x617A +0xE1D0 0x615B +0xE1D1 0x6165 +0xE1D2 0x613B +0xE1D3 0x616A +0xE1D4 0x6161 +0xE1D5 0x6156 +0xE1D6 0x6229 +0xE1D7 0x6227 +0xE1D8 0x622B +0xE1D9 0x642B +0xE1DA 0x644D +0xE1DB 0x645B +0xE1DC 0x645D +0xE1DD 0x6474 +0xE1DE 0x6476 +0xE1DF 0xE1E0 0x6472 +0xE1E1 0x647D +0xE1E2 0x6475 +0xE1E3 0x6466 +0xE1E4 0x64A6 +0xE1E5 0x644E +0xE1E6 0x6482 +0xE1E7 0x645E +0xE1E8 0x645C +0xE1E9 0x644B +0xE1EA 0x6453 +0xE1EB 0x6460 +0xE1EC 0x6450 +0xE1ED 0x647F +0xE1EE 0x643F +0xE1EF 0x646C +0xE1F0 0x646B +0xE1F1 0x6459 +0xE1F2 0x6465 +0xE1F3 0x6477 +0xE1F4 0x6573 +0xE1F5 0x65A0 +0xE1F6 0x66A1 +0xE1F7 0x66A0 +0xE1F8 0x669F +0xE1F9 0x6705 +0xE1FA 0x6704 +0xE1FB 0x6722 +0xE1FC 0x69B1 +0xE1FD 0x69B6 +0xE1FE 0x69C9 +0xE240 0x69A0 +0xE241 0x69CE +0xE242 0x6996 +0xE243 0x69B0 +0xE244 0x69AC +0xE245 0x69BC +0xE246 0x6991 +0xE247 0x6999 +0xE248 0x698E +0xE249 0x69A7 +0xE24A 0x698D +0xE24B 0x69A9 +0xE24C 0x69BE +0xE24D 0x69AF +0xE24E 0x69BF +0xE24F 0x69C4 +0xE250 0x69BD +0xE251 0x69A4 +0xE252 0x69D4 +0xE253 0x69B9 +0xE254 0x69CA +0xE255 0x699A +0xE256 0x69CF +0xE257 0x69B3 +0xE258 0x6993 +0xE259 0x69AA +0xE25A 0x69A1 +0xE25B 0x699E +0xE25C 0x69D9 +0xE25D 0x6997 +0xE25E 0x6990 +0xE25F 0x69C2 +0xE260 0x69B5 +0xE261 0x69A5 +0xE262 0x69C6 +0xE263 0x6B4A +0xE264 0x6B4D +0xE265 0x6B4B +0xE266 0xE268 0x6B9E +0xE269 0xE26A 0x6BC3 +0xE26B 0x6BFE +0xE26C 0x6ECE +0xE26D 0x6EF5 +0xE26E 0x6EF1 +0xE26F 0x6F03 +0xE270 0x6F25 +0xE271 0x6EF8 +0xE272 0x6F37 +0xE273 0x6EFB +0xE274 0x6F2E +0xE275 0x6F09 +0xE276 0x6F4E +0xE277 0xE278 0x6F19 +0xE279 0x6F27 +0xE27A 0x6F18 +0xE27B 0x6F3B +0xE27C 0x6F12 +0xE27D 0x6EED +0xE27E 0x6F0A +0xE2A1 0x6F36 +0xE2A2 0x6F73 +0xE2A3 0x6EF9 +0xE2A4 0x6EEE +0xE2A5 0x6F2D +0xE2A6 0x6F40 +0xE2A7 0x6F30 +0xE2A8 0x6F3C +0xE2A9 0x6F35 +0xE2AA 0x6EEB +0xE2AB 0x6F07 +0xE2AC 0x6F0E +0xE2AD 0x6F43 +0xE2AE 0x6F05 +0xE2AF 0x6EFD +0xE2B0 0x6EF6 +0xE2B1 0x6F39 +0xE2B2 0x6F1C +0xE2B3 0x6EFC +0xE2B4 0x6F3A +0xE2B5 0x6F1F +0xE2B6 0x6F0D +0xE2B7 0x6F1E +0xE2B8 0x6F08 +0xE2B9 0x6F21 +0xE2BA 0x7187 +0xE2BB 0x7190 +0xE2BC 0x7189 +0xE2BD 0x7180 +0xE2BE 0x7185 +0xE2BF 0x7182 +0xE2C0 0x718F +0xE2C1 0x717B +0xE2C2 0x7186 +0xE2C3 0x7181 +0xE2C4 0x7197 +0xE2C5 0x7244 +0xE2C6 0x7253 +0xE2C7 0x7297 +0xE2C8 0x7295 +0xE2C9 0x7293 +0xE2CA 0x7343 +0xE2CB 0x734D +0xE2CC 0x7351 +0xE2CD 0x734C +0xE2CE 0x7462 +0xE2CF 0x7473 +0xE2D0 0x7471 +0xE2D1 0x7475 +0xE2D2 0x7472 +0xE2D3 0x7467 +0xE2D4 0x746E +0xE2D5 0x7500 +0xE2D6 0xE2D7 0x7502 +0xE2D8 0x757D +0xE2D9 0x7590 +0xE2DA 0x7616 +0xE2DB 0x7608 +0xE2DC 0x760C +0xE2DD 0x7615 +0xE2DE 0x7611 +0xE2DF 0x760A +0xE2E0 0x7614 +0xE2E1 0x76B8 +0xE2E2 0x7781 +0xE2E3 0x777C +0xE2E4 0x7785 +0xE2E5 0x7782 +0xE2E6 0x776E +0xE2E7 0x7780 +0xE2E8 0x776F +0xE2E9 0x777E +0xE2EA 0x7783 +0xE2EB 0x78B2 +0xE2EC 0x78AA +0xE2ED 0x78B4 +0xE2EE 0x78AD +0xE2EF 0x78A8 +0xE2F0 0x787E +0xE2F1 0x78AB +0xE2F2 0x789E +0xE2F3 0x78A5 +0xE2F4 0x78A0 +0xE2F5 0x78AC +0xE2F6 0x78A2 +0xE2F7 0x78A4 +0xE2F8 0x7998 +0xE2F9 0xE2FA 0x798A +0xE2FB 0x7996 +0xE2FC 0x7995 +0xE2FD 0x7994 +0xE2FE 0x7993 +0xE340 0x7997 +0xE341 0x7988 +0xE342 0x7992 +0xE343 0x7990 +0xE344 0x7A2B +0xE345 0x7A4A +0xE346 0x7A30 +0xE347 0x7A2F +0xE348 0x7A28 +0xE349 0x7A26 +0xE34A 0x7AA8 +0xE34B 0xE34C 0x7AAB +0xE34D 0x7AEE +0xE34E 0x7B88 +0xE34F 0x7B9C +0xE350 0x7B8A +0xE351 0x7B91 +0xE352 0x7B90 +0xE353 0x7B96 +0xE354 0x7B8D +0xE355 0x7B8C +0xE356 0x7B9B +0xE357 0x7B8E +0xE358 0x7B85 +0xE359 0x7B98 +0xE35A 0x5284 +0xE35B 0x7B99 +0xE35C 0x7BA4 +0xE35D 0x7B82 +0xE35E 0x7CBB +0xE35F 0x7CBF +0xE360 0x7CBC +0xE361 0x7CBA +0xE362 0x7DA7 +0xE363 0x7DB7 +0xE364 0x7DC2 +0xE365 0x7DA3 +0xE366 0x7DAA +0xE367 0x7DC1 +0xE368 0x7DC0 +0xE369 0x7DC5 +0xE36A 0x7D9D +0xE36B 0x7DCE +0xE36C 0x7DC4 +0xE36D 0x7DC6 +0xE36E 0xE36F 0x7DCB +0xE370 0x7DAF +0xE371 0x7DB9 +0xE372 0x7D96 +0xE373 0x7DBC +0xE374 0x7D9F +0xE375 0x7DA6 +0xE376 0x7DAE +0xE377 0x7DA9 +0xE378 0x7DA1 +0xE379 0x7DC9 +0xE37A 0x7F73 +0xE37B 0xE37C 0x7FE2 +0xE37D 0x7FE5 +0xE37E 0x7FDE +0xE3A1 0x8024 +0xE3A2 0x805D +0xE3A3 0x805C +0xE3A4 0x8189 +0xE3A5 0x8186 +0xE3A6 0x8183 +0xE3A7 0x8187 +0xE3A8 0x818D +0xE3A9 0x818C +0xE3AA 0x818B +0xE3AB 0x8215 +0xE3AC 0x8497 +0xE3AD 0x84A4 +0xE3AE 0x84A1 +0xE3AF 0x849F +0xE3B0 0x84BA +0xE3B1 0x84CE +0xE3B2 0x84C2 +0xE3B3 0x84AC +0xE3B4 0x84AE +0xE3B5 0x84AB +0xE3B6 0x84B9 +0xE3B7 0x84B4 +0xE3B8 0x84C1 +0xE3B9 0x84CD +0xE3BA 0x84AA +0xE3BB 0x849A +0xE3BC 0x84B1 +0xE3BD 0x84D0 +0xE3BE 0x849D +0xE3BF 0x84A7 +0xE3C0 0x84BB +0xE3C1 0x84A2 +0xE3C2 0x8494 +0xE3C3 0x84C7 +0xE3C4 0x84CC +0xE3C5 0x849B +0xE3C6 0x84A9 +0xE3C7 0x84AF +0xE3C8 0x84A8 +0xE3C9 0x84D6 +0xE3CA 0x8498 +0xE3CB 0x84B6 +0xE3CC 0x84CF +0xE3CD 0x84A0 +0xE3CE 0x84D7 +0xE3CF 0x84D4 +0xE3D0 0x84D2 +0xE3D1 0x84DB +0xE3D2 0x84B0 +0xE3D3 0x8491 +0xE3D4 0x8661 +0xE3D5 0x8733 +0xE3D6 0x8723 +0xE3D7 0x8728 +0xE3D8 0x876B +0xE3D9 0x8740 +0xE3DA 0x872E +0xE3DB 0x871E +0xE3DC 0x8721 +0xE3DD 0x8719 +0xE3DE 0x871B +0xE3DF 0x8743 +0xE3E0 0x872C +0xE3E1 0x8741 +0xE3E2 0x873E +0xE3E3 0x8746 +0xE3E4 0x8720 +0xE3E5 0x8732 +0xE3E6 0x872A +0xE3E7 0x872D +0xE3E8 0x873C +0xE3E9 0x8712 +0xE3EA 0x873A +0xE3EB 0x8731 +0xE3EC 0x8735 +0xE3ED 0x8742 +0xE3EE 0xE3EF 0x8726 +0xE3F0 0x8738 +0xE3F1 0x8724 +0xE3F2 0x871A +0xE3F3 0x8730 +0xE3F4 0x8711 +0xE3F5 0x88F7 +0xE3F6 0x88E7 +0xE3F7 0xE3F8 0x88F1 +0xE3F9 0x88FA +0xE3FA 0x88FE +0xE3FB 0x88EE +0xE3FC 0x88FC +0xE3FD 0x88F6 +0xE3FE 0x88FB +0xE440 0x88F0 +0xE441 0x88EC +0xE442 0x88EB +0xE443 0x899D +0xE444 0x89A1 +0xE445 0x899F +0xE446 0x899E +0xE447 0x89E9 +0xE448 0x89EB +0xE449 0x89E8 +0xE44A 0x8AAB +0xE44B 0x8A99 +0xE44C 0x8A8B +0xE44D 0x8A92 +0xE44E 0x8A8F +0xE44F 0x8A96 +0xE450 0x8C3D +0xE451 0xE452 0x8C68 +0xE453 0x8CD5 +0xE454 0x8CCF +0xE455 0x8CD7 +0xE456 0x8D96 +0xE457 0x8E09 +0xE458 0x8E02 +0xE459 0x8DFF +0xE45A 0x8E0D +0xE45B 0x8DFD +0xE45C 0x8E0A +0xE45D 0x8E03 +0xE45E 0x8E07 +0xE45F 0x8E06 +0xE460 0x8E05 +0xE461 0x8DFE +0xE462 0x8E00 +0xE463 0x8E04 +0xE464 0xE465 0x8F10 +0xE466 0x8F0E +0xE467 0x8F0D +0xE468 0x9123 +0xE469 0x911C +0xE46A 0x9120 +0xE46B 0x9122 +0xE46C 0x911F +0xE46D 0x911D +0xE46E 0x911A +0xE46F 0x9124 +0xE470 0x9121 +0xE471 0x911B +0xE472 0x917A +0xE473 0x9172 +0xE474 0x9179 +0xE475 0x9173 +0xE476 0x92A5 +0xE477 0x92A4 +0xE478 0x9276 +0xE479 0x929B +0xE47A 0x927A +0xE47B 0x92A0 +0xE47C 0x9294 +0xE47D 0x92AA +0xE47E 0x928D +0xE4A1 0x92A6 +0xE4A2 0x929A +0xE4A3 0x92AB +0xE4A4 0x9279 +0xE4A5 0x9297 +0xE4A6 0x927F +0xE4A7 0x92A3 +0xE4A8 0x92EE +0xE4A9 0x928E +0xE4AA 0x9282 +0xE4AB 0x9295 +0xE4AC 0x92A2 +0xE4AD 0x927D +0xE4AE 0x9288 +0xE4AF 0x92A1 +0xE4B0 0x928A +0xE4B1 0x9286 +0xE4B2 0x928C +0xE4B3 0x9299 +0xE4B4 0x92A7 +0xE4B5 0x927E +0xE4B6 0x9287 +0xE4B7 0x92A9 +0xE4B8 0x929D +0xE4B9 0x928B +0xE4BA 0x922D +0xE4BB 0x969E +0xE4BC 0x96A1 +0xE4BD 0x96FF +0xE4BE 0x9758 +0xE4BF 0x977D +0xE4C0 0x977A +0xE4C1 0x977E +0xE4C2 0x9783 +0xE4C3 0x9780 +0xE4C4 0x9782 +0xE4C5 0x977B +0xE4C6 0x9784 +0xE4C7 0x9781 +0xE4C8 0x977F +0xE4C9 0x97CE +0xE4CA 0x97CD +0xE4CB 0x9816 +0xE4CC 0xE4CD 0x98AD +0xE4CE 0x9902 +0xE4CF 0x9900 +0xE4D0 0x9907 +0xE4D1 0x999D +0xE4D2 0x999C +0xE4D3 0x99C3 +0xE4D4 0x99B9 +0xE4D5 0x99BB +0xE4D6 0x99BA +0xE4D7 0x99C2 +0xE4D8 0x99BD +0xE4D9 0x99C7 +0xE4DA 0x9AB1 +0xE4DB 0x9AE3 +0xE4DC 0x9AE7 +0xE4DD 0xE4DE 0x9B3E +0xE4DF 0xE4E0 0x9B60 +0xE4E1 0x9B5F +0xE4E2 0xE4E3 0x9CF1 +0xE4E4 0x9CF5 +0xE4E5 0x9EA7 +0xE4E6 0x50FF +0xE4E7 0x5103 +0xE4E8 0x5130 +0xE4E9 0x50F8 +0xE4EA 0xE4EB 0x5106 +0xE4EC 0x50F6 +0xE4ED 0x50FE +0xE4EE 0xE4EF 0x510B +0xE4F0 0x50FD +0xE4F1 0x510A +0xE4F2 0xE4F3 0x528B +0xE4F4 0x52F1 +0xE4F5 0x52EF +0xE4F6 0x5648 +0xE4F7 0x5642 +0xE4F8 0x564C +0xE4F9 0x5635 +0xE4FA 0x5641 +0xE4FB 0x564A +0xE4FC 0x5649 +0xE4FD 0x5646 +0xE4FE 0x5658 +0xE540 0x565A +0xE541 0x5640 +0xE542 0x5633 +0xE543 0x563D +0xE544 0x562C +0xE545 0x563E +0xE546 0x5638 +0xE547 0x562A +0xE548 0x563A +0xE549 0x571A +0xE54A 0x58AB +0xE54B 0x589D +0xE54C 0x58B1 +0xE54D 0x58A0 +0xE54E 0x58A3 +0xE54F 0x58AF +0xE550 0x58AC +0xE551 0x58A5 +0xE552 0x58A1 +0xE553 0x58FF +0xE554 0x5AFF +0xE555 0x5AF4 +0xE556 0x5AFD +0xE557 0x5AF7 +0xE558 0x5AF6 +0xE559 0x5B03 +0xE55A 0x5AF8 +0xE55B 0x5B02 +0xE55C 0x5AF9 +0xE55D 0x5B01 +0xE55E 0x5B07 +0xE55F 0x5B05 +0xE560 0x5B0F +0xE561 0x5C67 +0xE562 0x5D99 +0xE563 0x5D97 +0xE564 0x5D9F +0xE565 0x5D92 +0xE566 0x5DA2 +0xE567 0x5D93 +0xE568 0x5D95 +0xE569 0x5DA0 +0xE56A 0x5D9C +0xE56B 0x5DA1 +0xE56C 0x5D9A +0xE56D 0x5D9E +0xE56E 0x5E69 +0xE56F 0x5E5D +0xE570 0x5E60 +0xE571 0x5E5C +0xE572 0x7DF3 +0xE573 0x5EDB +0xE574 0x5EDE +0xE575 0x5EE1 +0xE576 0x5F49 +0xE577 0x5FB2 +0xE578 0x618B +0xE579 0x6183 +0xE57A 0x6179 +0xE57B 0x61B1 +0xE57C 0x61B0 +0xE57D 0x61A2 +0xE57E 0x6189 +0xE5A1 0x619B +0xE5A2 0x6193 +0xE5A3 0x61AF +0xE5A4 0x61AD +0xE5A5 0x619F +0xE5A6 0x6192 +0xE5A7 0x61AA +0xE5A8 0x61A1 +0xE5A9 0x618D +0xE5AA 0x6166 +0xE5AB 0x61B3 +0xE5AC 0x622D +0xE5AD 0x646E +0xE5AE 0x6470 +0xE5AF 0x6496 +0xE5B0 0x64A0 +0xE5B1 0x6485 +0xE5B2 0x6497 +0xE5B3 0x649C +0xE5B4 0x648F +0xE5B5 0x648B +0xE5B6 0x648A +0xE5B7 0x648C +0xE5B8 0x64A3 +0xE5B9 0x649F +0xE5BA 0x6468 +0xE5BB 0x64B1 +0xE5BC 0x6498 +0xE5BD 0x6576 +0xE5BE 0x657A +0xE5BF 0x6579 +0xE5C0 0x657B +0xE5C1 0xE5C2 0x65B2 +0xE5C3 0x66B5 +0xE5C4 0x66B0 +0xE5C5 0x66A9 +0xE5C6 0x66B2 +0xE5C7 0x66B7 +0xE5C8 0x66AA +0xE5C9 0x66AF +0xE5CA 0x6A00 +0xE5CB 0x6A06 +0xE5CC 0x6A17 +0xE5CD 0x69E5 +0xE5CE 0x69F8 +0xE5CF 0x6A15 +0xE5D0 0x69F1 +0xE5D1 0x69E4 +0xE5D2 0x6A20 +0xE5D3 0x69FF +0xE5D4 0x69EC +0xE5D5 0x69E2 +0xE5D6 0x6A1B +0xE5D7 0x6A1D +0xE5D8 0x69FE +0xE5D9 0x6A27 +0xE5DA 0x69F2 +0xE5DB 0x69EE +0xE5DC 0x6A14 +0xE5DD 0x69F7 +0xE5DE 0x69E7 +0xE5DF 0x6A40 +0xE5E0 0x6A08 +0xE5E1 0x69E6 +0xE5E2 0x69FB +0xE5E3 0x6A0D +0xE5E4 0x69FC +0xE5E5 0x69EB +0xE5E6 0x6A09 +0xE5E7 0x6A04 +0xE5E8 0x6A18 +0xE5E9 0x6A25 +0xE5EA 0x6A0F +0xE5EB 0x69F6 +0xE5EC 0x6A26 +0xE5ED 0x6A07 +0xE5EE 0x69F4 +0xE5EF 0x6A16 +0xE5F0 0x6B51 +0xE5F1 0x6BA5 +0xE5F2 0x6BA3 +0xE5F3 0x6BA2 +0xE5F4 0x6BA6 +0xE5F5 0x6C01 +0xE5F6 0x6C00 +0xE5F7 0x6BFF +0xE5F8 0x6C02 +0xE5F9 0x6F41 +0xE5FA 0x6F26 +0xE5FB 0x6F7E +0xE5FC 0x6F87 +0xE5FD 0x6FC6 +0xE5FE 0x6F92 +0xE640 0x6F8D +0xE641 0x6F89 +0xE642 0x6F8C +0xE643 0x6F62 +0xE644 0x6F4F +0xE645 0x6F85 +0xE646 0x6F5A +0xE647 0x6F96 +0xE648 0x6F76 +0xE649 0x6F6C +0xE64A 0x6F82 +0xE64B 0x6F55 +0xE64C 0x6F72 +0xE64D 0x6F52 +0xE64E 0x6F50 +0xE64F 0x6F57 +0xE650 0x6F94 +0xE651 0x6F93 +0xE652 0x6F5D +0xE653 0x6F00 +0xE654 0x6F61 +0xE655 0x6F6B +0xE656 0x6F7D +0xE657 0x6F67 +0xE658 0x6F90 +0xE659 0x6F53 +0xE65A 0x6F8B +0xE65B 0x6F69 +0xE65C 0x6F7F +0xE65D 0x6F95 +0xE65E 0x6F63 +0xE65F 0x6F77 +0xE660 0x6F6A +0xE661 0x6F7B +0xE662 0x71B2 +0xE663 0x71AF +0xE664 0x719B +0xE665 0x71B0 +0xE666 0x71A0 +0xE667 0x719A +0xE668 0x71A9 +0xE669 0x71B5 +0xE66A 0x719D +0xE66B 0x71A5 +0xE66C 0x719E +0xE66D 0x71A4 +0xE66E 0x71A1 +0xE66F 0x71AA +0xE670 0x719C +0xE671 0x71A7 +0xE672 0x71B3 +0xE673 0x7298 +0xE674 0x729A +0xE675 0x7358 +0xE676 0x7352 +0xE677 0xE679 0x735E +0xE67A 0x735D +0xE67B 0x735B +0xE67C 0x7361 +0xE67D 0x735A +0xE67E 0x7359 +0xE6A1 0x7362 +0xE6A2 0x7487 +0xE6A3 0xE6A4 0x7489 +0xE6A5 0x7486 +0xE6A6 0x7481 +0xE6A7 0x747D +0xE6A8 0x7485 +0xE6A9 0x7488 +0xE6AA 0x747C +0xE6AB 0x7479 +0xE6AC 0x7508 +0xE6AD 0x7507 +0xE6AE 0x757E +0xE6AF 0x7625 +0xE6B0 0x761E +0xE6B1 0x7619 +0xE6B2 0x761D +0xE6B3 0x761C +0xE6B4 0x7623 +0xE6B5 0x761A +0xE6B6 0x7628 +0xE6B7 0x761B +0xE6B8 0xE6BA 0x769C +0xE6BB 0x769B +0xE6BC 0x778D +0xE6BD 0x778F +0xE6BE 0x7789 +0xE6BF 0x7788 +0xE6C0 0x78CD +0xE6C1 0x78BB +0xE6C2 0x78CF +0xE6C3 0x78CC +0xE6C4 0x78D1 +0xE6C5 0x78CE +0xE6C6 0x78D4 +0xE6C7 0x78C8 +0xE6C8 0xE6C9 0x78C3 +0xE6CA 0x78C9 +0xE6CB 0x799A +0xE6CC 0x79A1 +0xE6CD 0x79A0 +0xE6CE 0x799C +0xE6CF 0x79A2 +0xE6D0 0x799B +0xE6D1 0x6B76 +0xE6D2 0x7A39 +0xE6D3 0x7AB2 +0xE6D4 0x7AB4 +0xE6D5 0x7AB3 +0xE6D6 0x7BB7 +0xE6D7 0x7BCB +0xE6D8 0x7BBE +0xE6D9 0x7BAC +0xE6DA 0x7BCE +0xE6DB 0x7BAF +0xE6DC 0x7BB9 +0xE6DD 0x7BCA +0xE6DE 0x7BB5 +0xE6DF 0x7CC5 +0xE6E0 0x7CC8 +0xE6E1 0x7CCC +0xE6E2 0x7CCB +0xE6E3 0x7DF7 +0xE6E4 0x7DDB +0xE6E5 0x7DEA +0xE6E6 0x7DE7 +0xE6E7 0x7DD7 +0xE6E8 0x7DE1 +0xE6E9 0x7E03 +0xE6EA 0x7DFA +0xE6EB 0x7DE6 +0xE6EC 0x7DF6 +0xE6ED 0x7DF1 +0xE6EE 0x7DF0 +0xE6EF 0x7DEE +0xE6F0 0x7DDF +0xE6F1 0x7F76 +0xE6F2 0x7FAC +0xE6F3 0x7FB0 +0xE6F4 0x7FAD +0xE6F5 0x7FED +0xE6F6 0x7FEB +0xE6F7 0x7FEA +0xE6F8 0x7FEC +0xE6F9 0x7FE6 +0xE6FA 0x7FE8 +0xE6FB 0x8064 +0xE6FC 0x8067 +0xE6FD 0x81A3 +0xE6FE 0x819F +0xE740 0x819E +0xE741 0x8195 +0xE742 0x81A2 +0xE743 0x8199 +0xE744 0x8197 +0xE745 0x8216 +0xE746 0x824F +0xE747 0x8253 +0xE748 0x8252 +0xE749 0x8250 +0xE74A 0x824E +0xE74B 0x8251 +0xE74C 0x8524 +0xE74D 0x853B +0xE74E 0x850F +0xE74F 0x8500 +0xE750 0x8529 +0xE751 0x850E +0xE752 0x8509 +0xE753 0x850D +0xE754 0x851F +0xE755 0x850A +0xE756 0x8527 +0xE757 0x851C +0xE758 0x84FB +0xE759 0x852B +0xE75A 0x84FA +0xE75B 0x8508 +0xE75C 0x850C +0xE75D 0x84F4 +0xE75E 0x852A +0xE75F 0x84F2 +0xE760 0x8515 +0xE761 0x84F7 +0xE762 0x84EB +0xE763 0x84F3 +0xE764 0x84FC +0xE765 0x8512 +0xE766 0x84EA +0xE767 0x84E9 +0xE768 0x8516 +0xE769 0x84FE +0xE76A 0x8528 +0xE76B 0x851D +0xE76C 0x852E +0xE76D 0x8502 +0xE76E 0x84FD +0xE76F 0x851E +0xE770 0x84F6 +0xE771 0x8531 +0xE772 0x8526 +0xE773 0xE774 0x84E7 +0xE775 0x84F0 +0xE776 0x84EF +0xE777 0x84F9 +0xE778 0x8518 +0xE779 0x8520 +0xE77A 0x8530 +0xE77B 0x850B +0xE77C 0x8519 +0xE77D 0x852F +0xE77E 0x8662 +0xE7A1 0x8756 +0xE7A2 0xE7A3 0x8763 +0xE7A4 0x8777 +0xE7A5 0x87E1 +0xE7A6 0x8773 +0xE7A7 0x8758 +0xE7A8 0x8754 +0xE7A9 0x875B +0xE7AA 0x8752 +0xE7AB 0x8761 +0xE7AC 0x875A +0xE7AD 0x8751 +0xE7AE 0x875E +0xE7AF 0x876D +0xE7B0 0x876A +0xE7B1 0x8750 +0xE7B2 0x874E +0xE7B3 0x875F +0xE7B4 0x875D +0xE7B5 0x876F +0xE7B6 0x876C +0xE7B7 0x877A +0xE7B8 0x876E +0xE7B9 0x875C +0xE7BA 0x8765 +0xE7BB 0x874F +0xE7BC 0x877B +0xE7BD 0x8775 +0xE7BE 0x8762 +0xE7BF 0x8767 +0xE7C0 0x8769 +0xE7C1 0x885A +0xE7C2 0x8905 +0xE7C3 0x890C +0xE7C4 0x8914 +0xE7C5 0x890B +0xE7C6 0xE7C8 0x8917 +0xE7C9 0x8906 +0xE7CA 0x8916 +0xE7CB 0x8911 +0xE7CC 0x890E +0xE7CD 0x8909 +0xE7CE 0x89A2 +0xE7CF 0x89A4 +0xE7D0 0x89A3 +0xE7D1 0x89ED +0xE7D2 0x89F0 +0xE7D3 0x89EC +0xE7D4 0x8ACF +0xE7D5 0x8AC6 +0xE7D6 0x8AB8 +0xE7D7 0x8AD3 +0xE7D8 0x8AD1 +0xE7D9 0xE7DA 0x8AD4 +0xE7DB 0x8ABB +0xE7DC 0x8AD7 +0xE7DD 0x8ABE +0xE7DE 0x8AC0 +0xE7DF 0x8AC5 +0xE7E0 0x8AD8 +0xE7E1 0x8AC3 +0xE7E2 0x8ABA +0xE7E3 0x8ABD +0xE7E4 0x8AD9 +0xE7E5 0x8C3E +0xE7E6 0x8C4D +0xE7E7 0x8C8F +0xE7E8 0x8CE5 +0xE7E9 0x8CDF +0xE7EA 0x8CD9 +0xE7EB 0x8CE8 +0xE7EC 0x8CDA +0xE7ED 0x8CDD +0xE7EE 0x8CE7 +0xE7EF 0x8DA0 +0xE7F0 0x8D9C +0xE7F1 0x8DA1 +0xE7F2 0x8D9B +0xE7F3 0x8E20 +0xE7F4 0x8E23 +0xE7F5 0x8E25 +0xE7F6 0x8E24 +0xE7F7 0x8E2E +0xE7F8 0x8E15 +0xE7F9 0x8E1B +0xE7FA 0x8E16 +0xE7FB 0x8E11 +0xE7FC 0x8E19 +0xE7FD 0xE7FE 0x8E26 +0xE840 0x8E14 +0xE841 0x8E12 +0xE842 0x8E18 +0xE843 0x8E13 +0xE844 0x8E1C +0xE845 0x8E17 +0xE846 0x8E1A +0xE847 0x8F2C +0xE848 0x8F24 +0xE849 0x8F18 +0xE84A 0x8F1A +0xE84B 0x8F20 +0xE84C 0x8F23 +0xE84D 0xE84E 0x8F16 +0xE84F 0x9073 +0xE850 0x9070 +0xE851 0x906F +0xE852 0x9067 +0xE853 0x906B +0xE854 0x912F +0xE855 0x912B +0xE856 0xE857 0x9129 +0xE858 0x9132 +0xE859 0x9126 +0xE85A 0x912E +0xE85B 0xE85C 0x9185 +0xE85D 0x918A +0xE85E 0xE85F 0x9181 +0xE860 0x9184 +0xE861 0x9180 +0xE862 0x92D0 +0xE863 0xE864 0x92C3 +0xE865 0x92C0 +0xE866 0x92D9 +0xE867 0x92B6 +0xE868 0x92CF +0xE869 0x92F1 +0xE86A 0x92DF +0xE86B 0x92D8 +0xE86C 0x92E9 +0xE86D 0x92D7 +0xE86E 0x92DD +0xE86F 0x92CC +0xE870 0x92EF +0xE871 0x92C2 +0xE872 0x92E8 +0xE873 0x92CA +0xE874 0x92C8 +0xE875 0x92CE +0xE876 0x92E6 +0xE877 0x92CD +0xE878 0x92D5 +0xE879 0x92C9 +0xE87A 0x92E0 +0xE87B 0x92DE +0xE87C 0x92E7 +0xE87D 0x92D1 +0xE87E 0x92D3 +0xE8A1 0x92B5 +0xE8A2 0x92E1 +0xE8A3 0x92C6 +0xE8A4 0x92B4 +0xE8A5 0x957C +0xE8A6 0x95AC +0xE8A7 0x95AB +0xE8A8 0x95AE +0xE8A9 0x95B0 +0xE8AA 0x96A4 +0xE8AB 0x96A2 +0xE8AC 0x96D3 +0xE8AD 0x9705 +0xE8AE 0x9708 +0xE8AF 0x9702 +0xE8B0 0x975A +0xE8B1 0x978A +0xE8B2 0x978E +0xE8B3 0x9788 +0xE8B4 0x97D0 +0xE8B5 0x97CF +0xE8B6 0x981E +0xE8B7 0x981D +0xE8B8 0x9826 +0xE8B9 0x9829 +0xE8BA 0x9828 +0xE8BB 0x9820 +0xE8BC 0x981B +0xE8BD 0x9827 +0xE8BE 0x98B2 +0xE8BF 0x9908 +0xE8C0 0x98FA +0xE8C1 0x9911 +0xE8C2 0x9914 +0xE8C3 0xE8C4 0x9916 +0xE8C5 0x9915 +0xE8C6 0x99DC +0xE8C7 0x99CD +0xE8C8 0x99CF +0xE8C9 0xE8CA 0x99D3 +0xE8CB 0x99CE +0xE8CC 0x99C9 +0xE8CD 0x99D6 +0xE8CE 0x99D8 +0xE8CF 0x99CB +0xE8D0 0x99D7 +0xE8D1 0x99CC +0xE8D2 0x9AB3 +0xE8D3 0x9AEC +0xE8D4 0x9AEB +0xE8D5 0x9AF3 +0xE8D6 0x9AF2 +0xE8D7 0x9AF1 +0xE8D8 0x9B46 +0xE8D9 0x9B43 +0xE8DA 0x9B67 +0xE8DB 0x9B74 +0xE8DC 0x9B71 +0xE8DD 0x9B66 +0xE8DE 0x9B76 +0xE8DF 0x9B75 +0xE8E0 0x9B70 +0xE8E1 0x9B68 +0xE8E2 0x9B64 +0xE8E3 0x9B6C +0xE8E4 0x9CFC +0xE8E5 0x9CFA +0xE8E6 0x9CFD +0xE8E7 0x9CFF +0xE8E8 0x9CF7 +0xE8E9 0x9D07 +0xE8EA 0x9D00 +0xE8EB 0x9CF9 +0xE8EC 0x9CFB +0xE8ED 0x9D08 +0xE8EE 0x9D05 +0xE8EF 0x9D04 +0xE8F0 0x9E83 +0xE8F1 0x9ED3 +0xE8F2 0xE8F3 0x9F0F +0xE8F4 0x511C +0xE8F5 0x5113 +0xE8F6 0x5117 +0xE8F7 0x511A +0xE8F8 0x5111 +0xE8F9 0x51DE +0xE8FA 0x5334 +0xE8FB 0x53E1 +0xE8FC 0x5670 +0xE8FD 0x5660 +0xE8FE 0x566E +0xE940 0x5673 +0xE941 0x5666 +0xE942 0x5663 +0xE943 0x566D +0xE944 0x5672 +0xE945 0x565E +0xE946 0x5677 +0xE947 0x571C +0xE948 0x571B +0xE949 0x58C8 +0xE94A 0x58BD +0xE94B 0x58C9 +0xE94C 0x58BF +0xE94D 0x58BA +0xE94E 0x58C2 +0xE94F 0x58BC +0xE950 0x58C6 +0xE951 0x5B17 +0xE952 0x5B19 +0xE953 0x5B1B +0xE954 0x5B21 +0xE955 0x5B14 +0xE956 0x5B13 +0xE957 0x5B10 +0xE958 0x5B16 +0xE959 0x5B28 +0xE95A 0x5B1A +0xE95B 0x5B20 +0xE95C 0x5B1E +0xE95D 0x5BEF +0xE95E 0x5DAC +0xE95F 0x5DB1 +0xE960 0x5DA9 +0xE961 0x5DA7 +0xE962 0x5DB5 +0xE963 0x5DB0 +0xE964 0x5DAE +0xE965 0x5DAA +0xE966 0x5DA8 +0xE967 0x5DB2 +0xE968 0x5DAD +0xE969 0x5DAF +0xE96A 0x5DB4 +0xE96B 0xE96C 0x5E67 +0xE96D 0x5E66 +0xE96E 0x5E6F +0xE96F 0x5EE9 +0xE970 0x5EE7 +0xE971 0x5EE6 +0xE972 0x5EE8 +0xE973 0x5EE5 +0xE974 0x5F4B +0xE975 0x5FBC +0xE976 0x619D +0xE977 0x61A8 +0xE978 0x6196 +0xE979 0x61C5 +0xE97A 0x61B4 +0xE97B 0x61C6 +0xE97C 0x61C1 +0xE97D 0x61CC +0xE97E 0x61BA +0xE9A1 0x61BF +0xE9A2 0x61B8 +0xE9A3 0x618C +0xE9A4 0x64D7 +0xE9A5 0x64D6 +0xE9A6 0x64D0 +0xE9A7 0x64CF +0xE9A8 0x64C9 +0xE9A9 0x64BD +0xE9AA 0x6489 +0xE9AB 0x64C3 +0xE9AC 0x64DB +0xE9AD 0x64F3 +0xE9AE 0x64D9 +0xE9AF 0x6533 +0xE9B0 0x657F +0xE9B1 0x657C +0xE9B2 0x65A2 +0xE9B3 0x66C8 +0xE9B4 0x66BE +0xE9B5 0x66C0 +0xE9B6 0xE9B7 0x66CA +0xE9B8 0x66CF +0xE9B9 0x66BD +0xE9BA 0x66BB +0xE9BB 0x66BA +0xE9BC 0x66CC +0xE9BD 0x6723 +0xE9BE 0x6A34 +0xE9BF 0x6A66 +0xE9C0 0x6A49 +0xE9C1 0x6A67 +0xE9C2 0x6A32 +0xE9C3 0x6A68 +0xE9C4 0x6A3E +0xE9C5 0x6A5D +0xE9C6 0x6A6D +0xE9C7 0x6A76 +0xE9C8 0x6A5B +0xE9C9 0x6A51 +0xE9CA 0x6A28 +0xE9CB 0x6A5A +0xE9CC 0x6A3B +0xE9CD 0x6A3F +0xE9CE 0x6A41 +0xE9CF 0x6A6A +0xE9D0 0x6A64 +0xE9D1 0x6A50 +0xE9D2 0x6A4F +0xE9D3 0x6A54 +0xE9D4 0x6A6F +0xE9D5 0x6A69 +0xE9D6 0x6A60 +0xE9D7 0x6A3C +0xE9D8 0x6A5E +0xE9D9 0x6A56 +0xE9DA 0x6A55 +0xE9DB 0xE9DC 0x6A4D +0xE9DD 0x6A46 +0xE9DE 0x6B55 +0xE9DF 0x6B54 +0xE9E0 0x6B56 +0xE9E1 0x6BA7 +0xE9E2 0xE9E3 0x6BAA +0xE9E4 0x6BC8 +0xE9E5 0x6BC7 +0xE9E6 0x6C04 +0xE9E7 0x6C03 +0xE9E8 0x6C06 +0xE9E9 0x6FAD +0xE9EA 0x6FCB +0xE9EB 0x6FA3 +0xE9EC 0x6FC7 +0xE9ED 0x6FBC +0xE9EE 0x6FCE +0xE9EF 0x6FC8 +0xE9F0 0x6F5E +0xE9F1 0x6FC4 +0xE9F2 0x6FBD +0xE9F3 0x6F9E +0xE9F4 0x6FCA +0xE9F5 0x6FA8 +0xE9F6 0x7004 +0xE9F7 0x6FA5 +0xE9F8 0x6FAE +0xE9F9 0x6FBA +0xE9FA 0x6FAC +0xE9FB 0x6FAA +0xE9FC 0x6FCF +0xE9FD 0x6FBF +0xE9FE 0x6FB8 +0xEA40 0x6FA2 +0xEA41 0x6FC9 +0xEA42 0x6FAB +0xEA43 0x6FCD +0xEA44 0x6FAF +0xEA45 0x6FB2 +0xEA46 0x6FB0 +0xEA47 0x71C5 +0xEA48 0x71C2 +0xEA49 0x71BF +0xEA4A 0x71B8 +0xEA4B 0x71D6 +0xEA4C 0xEA4D 0x71C0 +0xEA4E 0x71CB +0xEA4F 0x71D4 +0xEA50 0x71CA +0xEA51 0x71C7 +0xEA52 0x71CF +0xEA53 0x71BD +0xEA54 0x71D8 +0xEA55 0x71BC +0xEA56 0x71C6 +0xEA57 0xEA58 0x71DA +0xEA59 0xEA5A 0x729D +0xEA5B 0x7369 +0xEA5C 0xEA5D 0x7366 +0xEA5E 0x736C +0xEA5F 0x7365 +0xEA60 0x736B +0xEA61 0x736A +0xEA62 0x747F +0xEA63 0x749A +0xEA64 0x74A0 +0xEA65 0x7494 +0xEA66 0x7492 +0xEA67 0x7495 +0xEA68 0x74A1 +0xEA69 0x750B +0xEA6A 0x7580 +0xEA6B 0x762F +0xEA6C 0x762D +0xEA6D 0x7631 +0xEA6E 0x763D +0xEA6F 0x7633 +0xEA70 0x763C +0xEA71 0x7635 +0xEA72 0x7632 +0xEA73 0x7630 +0xEA74 0x76BB +0xEA75 0x76E6 +0xEA76 0x779A +0xEA77 0x779D +0xEA78 0x77A1 +0xEA79 0x779C +0xEA7A 0x779B +0xEA7B 0xEA7C 0x77A2 +0xEA7D 0x7795 +0xEA7E 0x7799 +0xEAA1 0x7797 +0xEAA2 0x78DD +0xEAA3 0x78E9 +0xEAA4 0x78E5 +0xEAA5 0x78EA +0xEAA6 0x78DE +0xEAA7 0x78E3 +0xEAA8 0x78DB +0xEAA9 0xEAAA 0x78E1 +0xEAAB 0x78ED +0xEAAC 0xEAAD 0x78DF +0xEAAE 0x79A4 +0xEAAF 0x7A44 +0xEAB0 0x7A48 +0xEAB1 0x7A47 +0xEAB2 0x7AB6 +0xEAB3 0x7AB8 +0xEAB4 0x7AB5 +0xEAB5 0x7AB1 +0xEAB6 0x7AB7 +0xEAB7 0x7BDE +0xEAB8 0x7BE3 +0xEAB9 0x7BE7 +0xEABA 0x7BDD +0xEABB 0x7BD5 +0xEABC 0x7BE5 +0xEABD 0x7BDA +0xEABE 0x7BE8 +0xEABF 0x7BF9 +0xEAC0 0x7BD4 +0xEAC1 0x7BEA +0xEAC2 0x7BE2 +0xEAC3 0x7BDC +0xEAC4 0x7BEB +0xEAC5 0x7BD8 +0xEAC6 0x7BDF +0xEAC7 0x7CD2 +0xEAC8 0x7CD4 +0xEAC9 0x7CD7 +0xEACA 0xEACB 0x7CD0 +0xEACC 0x7E12 +0xEACD 0x7E21 +0xEACE 0x7E17 +0xEACF 0x7E0C +0xEAD0 0xEAD1 0x7E1F +0xEAD2 0x7E13 +0xEAD3 0x7E0E +0xEAD4 0x7E1C +0xEAD5 0x7E15 +0xEAD6 0x7E1A +0xEAD7 0x7E22 +0xEAD8 0x7E0B +0xEAD9 0x7E0F +0xEADA 0x7E16 +0xEADB 0x7E0D +0xEADC 0x7E14 +0xEADD 0x7E25 +0xEADE 0x7E24 +0xEADF 0x7F43 +0xEAE0 0xEAE1 0x7F7B +0xEAE2 0x7F7A +0xEAE3 0x7FB1 +0xEAE4 0x7FEF +0xEAE5 0x802A +0xEAE6 0x8029 +0xEAE7 0x806C +0xEAE8 0x81B1 +0xEAE9 0x81A6 +0xEAEA 0x81AE +0xEAEB 0x81B9 +0xEAEC 0x81B5 +0xEAED 0x81AB +0xEAEE 0x81B0 +0xEAEF 0x81AC +0xEAF0 0x81B4 +0xEAF1 0x81B2 +0xEAF2 0x81B7 +0xEAF3 0x81A7 +0xEAF4 0x81F2 +0xEAF5 0xEAF7 0x8255 +0xEAF8 0x8556 +0xEAF9 0x8545 +0xEAFA 0x856B +0xEAFB 0x854D +0xEAFC 0x8553 +0xEAFD 0x8561 +0xEAFE 0x8558 +0xEB40 0x8540 +0xEB41 0x8546 +0xEB42 0x8564 +0xEB43 0x8541 +0xEB44 0x8562 +0xEB45 0x8544 +0xEB46 0x8551 +0xEB47 0x8547 +0xEB48 0x8563 +0xEB49 0x853E +0xEB4A 0x855B +0xEB4B 0x8571 +0xEB4C 0x854E +0xEB4D 0x856E +0xEB4E 0x8575 +0xEB4F 0x8555 +0xEB50 0x8567 +0xEB51 0x8560 +0xEB52 0x858C +0xEB53 0x8566 +0xEB54 0x855D +0xEB55 0x8554 +0xEB56 0x8565 +0xEB57 0x856C +0xEB58 0x8663 +0xEB59 0x8665 +0xEB5A 0x8664 +0xEB5B 0x879B +0xEB5C 0x878F +0xEB5D 0x8797 +0xEB5E 0x8793 +0xEB5F 0x8792 +0xEB60 0x8788 +0xEB61 0x8781 +0xEB62 0x8796 +0xEB63 0x8798 +0xEB64 0x8779 +0xEB65 0x8787 +0xEB66 0x87A3 +0xEB67 0x8785 +0xEB68 0xEB69 0x8790 +0xEB6A 0x879D +0xEB6B 0x8784 +0xEB6C 0x8794 +0xEB6D 0x879C +0xEB6E 0x879A +0xEB6F 0x8789 +0xEB70 0x891E +0xEB71 0x8926 +0xEB72 0x8930 +0xEB73 0xEB74 0x892D +0xEB75 0x8927 +0xEB76 0x8931 +0xEB77 0x8922 +0xEB78 0x8929 +0xEB79 0x8923 +0xEB7A 0x892F +0xEB7B 0x892C +0xEB7C 0x891F +0xEB7D 0x89F1 +0xEB7E 0x8AE0 +0xEBA1 0x8AE2 +0xEBA2 0x8AF2 +0xEBA3 0xEBA4 0x8AF4 +0xEBA5 0x8ADD +0xEBA6 0x8B14 +0xEBA7 0x8AE4 +0xEBA8 0x8ADF +0xEBA9 0x8AF0 +0xEBAA 0x8AC8 +0xEBAB 0x8ADE +0xEBAC 0x8AE1 +0xEBAD 0x8AE8 +0xEBAE 0x8AFF +0xEBAF 0x8AEF +0xEBB0 0x8AFB +0xEBB1 0xEBB2 0x8C91 +0xEBB3 0x8C90 +0xEBB4 0x8CF5 +0xEBB5 0x8CEE +0xEBB6 0x8CF1 +0xEBB7 0x8CF0 +0xEBB8 0x8CF3 +0xEBB9 0x8D6C +0xEBBA 0x8D6E +0xEBBB 0x8DA5 +0xEBBC 0x8DA7 +0xEBBD 0x8E33 +0xEBBE 0x8E3E +0xEBBF 0x8E38 +0xEBC0 0x8E40 +0xEBC1 0x8E45 +0xEBC2 0x8E36 +0xEBC3 0xEBC4 0x8E3C +0xEBC5 0x8E41 +0xEBC6 0x8E30 +0xEBC7 0x8E3F +0xEBC8 0x8EBD +0xEBC9 0x8F36 +0xEBCA 0x8F2E +0xEBCB 0x8F35 +0xEBCC 0x8F32 +0xEBCD 0x8F39 +0xEBCE 0x8F37 +0xEBCF 0x8F34 +0xEBD0 0x9076 +0xEBD1 0x9079 +0xEBD2 0x907B +0xEBD3 0x9086 +0xEBD4 0x90FA +0xEBD5 0x9133 +0xEBD6 0xEBD7 0x9135 +0xEBD8 0x9193 +0xEBD9 0xEBDA 0x9190 +0xEBDB 0x918D +0xEBDC 0x918F +0xEBDD 0x9327 +0xEBDE 0x931E +0xEBDF 0x9308 +0xEBE0 0x931F +0xEBE1 0x9306 +0xEBE2 0x930F +0xEBE3 0x937A +0xEBE4 0x9338 +0xEBE5 0x933C +0xEBE6 0x931B +0xEBE7 0x9323 +0xEBE8 0x9312 +0xEBE9 0x9301 +0xEBEA 0x9346 +0xEBEB 0x932D +0xEBEC 0x930E +0xEBED 0x930D +0xEBEE 0x92CB +0xEBEF 0x931D +0xEBF0 0x92FA +0xEBF1 0x9325 +0xEBF2 0x9313 +0xEBF3 0x92F9 +0xEBF4 0x92F7 +0xEBF5 0x9334 +0xEBF6 0x9302 +0xEBF7 0x9324 +0xEBF8 0x92FF +0xEBF9 0x9329 +0xEBFA 0x9339 +0xEBFB 0x9335 +0xEBFC 0x932A +0xEBFD 0x9314 +0xEBFE 0x930C +0xEC40 0x930B +0xEC41 0x92FE +0xEC42 0x9309 +0xEC43 0x9300 +0xEC44 0x92FB +0xEC45 0x9316 +0xEC46 0x95BC +0xEC47 0x95CD +0xEC48 0x95BE +0xEC49 0xEC4A 0x95B9 +0xEC4B 0x95B6 +0xEC4C 0x95BF +0xEC4D 0x95B5 +0xEC4E 0x95BD +0xEC4F 0x96A9 +0xEC50 0x96D4 +0xEC51 0x970B +0xEC52 0x9712 +0xEC53 0x9710 +0xEC54 0x9799 +0xEC55 0x9797 +0xEC56 0x9794 +0xEC57 0x97F0 +0xEC58 0x97F8 +0xEC59 0x9835 +0xEC5A 0x982F +0xEC5B 0x9832 +0xEC5C 0x9924 +0xEC5D 0x991F +0xEC5E 0x9927 +0xEC5F 0x9929 +0xEC60 0x999E +0xEC61 0x99EE +0xEC62 0x99EC +0xEC63 0x99E5 +0xEC64 0x99E4 +0xEC65 0x99F0 +0xEC66 0x99E3 +0xEC67 0x99EA +0xEC68 0x99E9 +0xEC69 0x99E7 +0xEC6A 0x9AB9 +0xEC6B 0x9ABF +0xEC6C 0x9AB4 +0xEC6D 0x9ABB +0xEC6E 0x9AF6 +0xEC6F 0x9AFA +0xEC70 0x9AF9 +0xEC71 0x9AF7 +0xEC72 0x9B33 +0xEC73 0x9B80 +0xEC74 0x9B85 +0xEC75 0x9B87 +0xEC76 0x9B7C +0xEC77 0x9B7E +0xEC78 0x9B7B +0xEC79 0x9B82 +0xEC7A 0x9B93 +0xEC7B 0x9B92 +0xEC7C 0x9B90 +0xEC7D 0x9B7A +0xEC7E 0x9B95 +0xECA1 0x9B7D +0xECA2 0x9B88 +0xECA3 0x9D25 +0xECA4 0x9D17 +0xECA5 0x9D20 +0xECA6 0x9D1E +0xECA7 0x9D14 +0xECA8 0x9D29 +0xECA9 0x9D1D +0xECAA 0x9D18 +0xECAB 0x9D22 +0xECAC 0x9D10 +0xECAD 0x9D19 +0xECAE 0x9D1F +0xECAF 0x9E88 +0xECB0 0xECB1 0x9E86 +0xECB2 0x9EAE +0xECB3 0x9EAD +0xECB4 0xECB5 0x9ED5 +0xECB6 0x9EFA +0xECB7 0x9F12 +0xECB8 0x9F3D +0xECB9 0x5126 +0xECBA 0x5125 +0xECBB 0x5122 +0xECBC 0x5124 +0xECBD 0x5120 +0xECBE 0x5129 +0xECBF 0x52F4 +0xECC0 0x5693 +0xECC1 0xECC2 0x568C +0xECC3 0x5686 +0xECC4 0x5684 +0xECC5 0x5683 +0xECC6 0x567E +0xECC7 0x5682 +0xECC8 0x567F +0xECC9 0x5681 +0xECCA 0x58D6 +0xECCB 0x58D4 +0xECCC 0x58CF +0xECCD 0x58D2 +0xECCE 0x5B2D +0xECCF 0x5B25 +0xECD0 0x5B32 +0xECD1 0x5B23 +0xECD2 0x5B2C +0xECD3 0x5B27 +0xECD4 0x5B26 +0xECD5 0x5B2F +0xECD6 0x5B2E +0xECD7 0x5B7B +0xECD8 0xECD9 0x5BF1 +0xECDA 0x5DB7 +0xECDB 0x5E6C +0xECDC 0x5E6A +0xECDD 0x5FBE +0xECDE 0x5FBB +0xECDF 0x61C3 +0xECE0 0x61B5 +0xECE1 0x61BC +0xECE2 0x61E7 +0xECE3 0x61E0 +0xECE4 0x61E5 +0xECE5 0x61E4 +0xECE6 0x61E8 +0xECE7 0x61DE +0xECE8 0x64EF +0xECE9 0x64E9 +0xECEA 0x64E3 +0xECEB 0x64EB +0xECEC 0x64E4 +0xECED 0x64E8 +0xECEE 0x6581 +0xECEF 0x6580 +0xECF0 0x65B6 +0xECF1 0x65DA +0xECF2 0x66D2 +0xECF3 0x6A8D +0xECF4 0x6A96 +0xECF5 0x6A81 +0xECF6 0x6AA5 +0xECF7 0x6A89 +0xECF8 0x6A9F +0xECF9 0x6A9B +0xECFA 0x6AA1 +0xECFB 0x6A9E +0xECFC 0x6A87 +0xECFD 0x6A93 +0xECFE 0x6A8E +0xED40 0x6A95 +0xED41 0x6A83 +0xED42 0x6AA8 +0xED43 0x6AA4 +0xED44 0x6A91 +0xED45 0x6A7F +0xED46 0x6AA6 +0xED47 0x6A9A +0xED48 0x6A85 +0xED49 0x6A8C +0xED4A 0x6A92 +0xED4B 0x6B5B +0xED4C 0x6BAD +0xED4D 0x6C09 +0xED4E 0x6FCC +0xED4F 0x6FA9 +0xED50 0x6FF4 +0xED51 0x6FD4 +0xED52 0x6FE3 +0xED53 0x6FDC +0xED54 0x6FED +0xED55 0x6FE7 +0xED56 0x6FE6 +0xED57 0x6FDE +0xED58 0x6FF2 +0xED59 0x6FDD +0xED5A 0x6FE2 +0xED5B 0x6FE8 +0xED5C 0x71E1 +0xED5D 0x71F1 +0xED5E 0x71E8 +0xED5F 0x71F2 +0xED60 0x71E4 +0xED61 0x71F0 +0xED62 0x71E2 +0xED63 0x7373 +0xED64 0xED65 0x736E +0xED66 0x7497 +0xED67 0x74B2 +0xED68 0x74AB +0xED69 0x7490 +0xED6A 0x74AA +0xED6B 0x74AD +0xED6C 0x74B1 +0xED6D 0x74A5 +0xED6E 0x74AF +0xED6F 0xED71 0x7510 +0xED72 0x750F +0xED73 0x7584 +0xED74 0x7643 +0xED75 0xED76 0x7648 +0xED77 0x7647 +0xED78 0x76A4 +0xED79 0x76E9 +0xED7A 0x77B5 +0xED7B 0x77AB +0xED7C 0x77B2 +0xED7D 0x77B7 +0xED7E 0x77B6 +0xEDA1 0x77B4 +0xEDA2 0x77B1 +0xEDA3 0x77A8 +0xEDA4 0x77F0 +0xEDA5 0x78F3 +0xEDA6 0x78FD +0xEDA7 0x7902 +0xEDA8 0xEDA9 0x78FB +0xEDAA 0x78F2 +0xEDAB 0x7905 +0xEDAC 0x78F9 +0xEDAD 0x78FE +0xEDAE 0x7904 +0xEDAF 0x79AB +0xEDB0 0x79A8 +0xEDB1 0x7A5C +0xEDB2 0x7A5B +0xEDB3 0x7A56 +0xEDB4 0x7A58 +0xEDB5 0x7A54 +0xEDB6 0x7A5A +0xEDB7 0x7ABE +0xEDB8 0xEDB9 0x7AC0 +0xEDBA 0x7C05 +0xEDBB 0x7C0F +0xEDBC 0x7BF2 +0xEDBD 0x7C00 +0xEDBE 0x7BFF +0xEDBF 0x7BFB +0xEDC0 0x7C0E +0xEDC1 0x7BF4 +0xEDC2 0x7C0B +0xEDC3 0x7BF3 +0xEDC4 0x7C02 +0xEDC5 0x7C09 +0xEDC6 0x7C03 +0xEDC7 0x7C01 +0xEDC8 0x7BF8 +0xEDC9 0x7BFD +0xEDCA 0x7C06 +0xEDCB 0xEDCC 0x7BF0 +0xEDCD 0x7C10 +0xEDCE 0x7C0A +0xEDCF 0x7CE8 +0xEDD0 0x7E2D +0xEDD1 0x7E3C +0xEDD2 0x7E42 +0xEDD3 0x7E33 +0xEDD4 0x9848 +0xEDD5 0x7E38 +0xEDD6 0x7E2A +0xEDD7 0x7E49 +0xEDD8 0x7E40 +0xEDD9 0x7E47 +0xEDDA 0x7E29 +0xEDDB 0x7E4C +0xEDDC 0x7E30 +0xEDDD 0x7E3B +0xEDDE 0x7E36 +0xEDDF 0x7E44 +0xEDE0 0x7E3A +0xEDE1 0x7F45 +0xEDE2 0x7F7F +0xEDE3 0x7F7E +0xEDE4 0x7F7D +0xEDE5 0x7FF4 +0xEDE6 0x7FF2 +0xEDE7 0x802C +0xEDE8 0x81BB +0xEDE9 0x81C4 +0xEDEA 0x81CC +0xEDEB 0x81CA +0xEDEC 0x81C5 +0xEDED 0x81C7 +0xEDEE 0x81BC +0xEDEF 0x81E9 +0xEDF0 0x825B +0xEDF1 0x825A +0xEDF2 0x825C +0xEDF3 0x8583 +0xEDF4 0x8580 +0xEDF5 0x858F +0xEDF6 0x85A7 +0xEDF7 0x8595 +0xEDF8 0x85A0 +0xEDF9 0x858B +0xEDFA 0x85A3 +0xEDFB 0x857B +0xEDFC 0x85A4 +0xEDFD 0x859A +0xEDFE 0x859E +0xEE40 0x8577 +0xEE41 0x857C +0xEE42 0x8589 +0xEE43 0x85A1 +0xEE44 0x857A +0xEE45 0x8578 +0xEE46 0x8557 +0xEE47 0x858E +0xEE48 0x8596 +0xEE49 0x8586 +0xEE4A 0x858D +0xEE4B 0x8599 +0xEE4C 0x859D +0xEE4D 0x8581 +0xEE4E 0x85A2 +0xEE4F 0x8582 +0xEE50 0x8588 +0xEE51 0x8585 +0xEE52 0x8579 +0xEE53 0x8576 +0xEE54 0x8598 +0xEE55 0x8590 +0xEE56 0x859F +0xEE57 0x8668 +0xEE58 0x87BE +0xEE59 0x87AA +0xEE5A 0x87AD +0xEE5B 0x87C5 +0xEE5C 0x87B0 +0xEE5D 0x87AC +0xEE5E 0x87B9 +0xEE5F 0x87B5 +0xEE60 0x87BC +0xEE61 0x87AE +0xEE62 0x87C9 +0xEE63 0x87C3 +0xEE64 0x87C2 +0xEE65 0x87CC +0xEE66 0x87B7 +0xEE67 0x87AF +0xEE68 0x87C4 +0xEE69 0x87CA +0xEE6A 0x87B4 +0xEE6B 0x87B6 +0xEE6C 0x87BF +0xEE6D 0x87B8 +0xEE6E 0x87BD +0xEE6F 0x87DE +0xEE70 0x87B2 +0xEE71 0x8935 +0xEE72 0x8933 +0xEE73 0x893C +0xEE74 0x893E +0xEE75 0x8941 +0xEE76 0x8952 +0xEE77 0x8937 +0xEE78 0x8942 +0xEE79 0x89AD +0xEE7A 0x89AF +0xEE7B 0x89AE +0xEE7C 0xEE7D 0x89F2 +0xEE7E 0x8B1E +0xEEA1 0x8B18 +0xEEA2 0x8B16 +0xEEA3 0x8B11 +0xEEA4 0x8B05 +0xEEA5 0x8B0B +0xEEA6 0x8B22 +0xEEA7 0x8B0F +0xEEA8 0x8B12 +0xEEA9 0x8B15 +0xEEAA 0x8B07 +0xEEAB 0x8B0D +0xEEAC 0x8B08 +0xEEAD 0x8B06 +0xEEAE 0x8B1C +0xEEAF 0x8B13 +0xEEB0 0x8B1A +0xEEB1 0x8C4F +0xEEB2 0x8C70 +0xEEB3 0x8C72 +0xEEB4 0x8C71 +0xEEB5 0x8C6F +0xEEB6 0x8C95 +0xEEB7 0x8C94 +0xEEB8 0x8CF9 +0xEEB9 0x8D6F +0xEEBA 0x8E4E +0xEEBB 0x8E4D +0xEEBC 0x8E53 +0xEEBD 0x8E50 +0xEEBE 0x8E4C +0xEEBF 0x8E47 +0xEEC0 0x8F43 +0xEEC1 0x8F40 +0xEEC2 0x9085 +0xEEC3 0x907E +0xEEC4 0x9138 +0xEEC5 0x919A +0xEEC6 0x91A2 +0xEEC7 0x919B +0xEEC8 0x9199 +0xEEC9 0x919F +0xEECA 0x91A1 +0xEECB 0x919D +0xEECC 0x91A0 +0xEECD 0x93A1 +0xEECE 0x9383 +0xEECF 0x93AF +0xEED0 0x9364 +0xEED1 0x9356 +0xEED2 0x9347 +0xEED3 0x937C +0xEED4 0x9358 +0xEED5 0x935C +0xEED6 0x9376 +0xEED7 0x9349 +0xEED8 0xEED9 0x9350 +0xEEDA 0x9360 +0xEEDB 0x936D +0xEEDC 0x938F +0xEEDD 0x934C +0xEEDE 0x936A +0xEEDF 0x9379 +0xEEE0 0x9357 +0xEEE1 0x9355 +0xEEE2 0x9352 +0xEEE3 0x934F +0xEEE4 0x9371 +0xEEE5 0x9377 +0xEEE6 0x937B +0xEEE7 0x9361 +0xEEE8 0x935E +0xEEE9 0x9363 +0xEEEA 0x9367 +0xEEEB 0x9380 +0xEEEC 0x934E +0xEEED 0x9359 +0xEEEE 0x95C7 +0xEEEF 0x95C0 +0xEEF0 0x95C9 +0xEEF1 0x95C3 +0xEEF2 0x95C5 +0xEEF3 0x95B7 +0xEEF4 0x96AE +0xEEF5 0x96B0 +0xEEF6 0x96AC +0xEEF7 0x9720 +0xEEF8 0x971F +0xEEF9 0x9718 +0xEEFA 0x971D +0xEEFB 0x9719 +0xEEFC 0x979A +0xEEFD 0x97A1 +0xEEFE 0x979C +0xEF40 0x979E +0xEF41 0x979D +0xEF42 0x97D5 +0xEF43 0x97D4 +0xEF44 0x97F1 +0xEF45 0x9841 +0xEF46 0x9844 +0xEF47 0x984A +0xEF48 0x9849 +0xEF49 0x9845 +0xEF4A 0x9843 +0xEF4B 0x9925 +0xEF4C 0xEF4D 0x992B +0xEF4E 0x992A +0xEF4F 0x9933 +0xEF50 0x9932 +0xEF51 0x992F +0xEF52 0x992D +0xEF53 0x9931 +0xEF54 0x9930 +0xEF55 0x9998 +0xEF56 0x99A3 +0xEF57 0x99A1 +0xEF58 0x9A02 +0xEF59 0x99FA +0xEF5A 0x99F4 +0xEF5B 0x99F7 +0xEF5C 0x99F9 +0xEF5D 0x99F8 +0xEF5E 0x99F6 +0xEF5F 0x99FB +0xEF60 0xEF61 0x99FD +0xEF62 0x99FC +0xEF63 0x9A03 +0xEF64 0x9ABE +0xEF65 0x9AFE +0xEF66 0x9AFD +0xEF67 0x9B01 +0xEF68 0x9AFC +0xEF69 0x9B48 +0xEF6A 0x9B9A +0xEF6B 0x9BA8 +0xEF6C 0x9B9E +0xEF6D 0x9B9B +0xEF6E 0x9BA6 +0xEF6F 0x9BA1 +0xEF70 0x9BA5 +0xEF71 0x9BA4 +0xEF72 0x9B86 +0xEF73 0x9BA2 +0xEF74 0x9BA0 +0xEF75 0x9BAF +0xEF76 0x9D33 +0xEF77 0x9D41 +0xEF78 0x9D67 +0xEF79 0x9D36 +0xEF7A 0xEF7B 0x9D2E +0xEF7C 0x9D31 +0xEF7D 0x9D38 +0xEF7E 0x9D30 +0xEFA1 0x9D45 +0xEFA2 0xEFA3 0x9D42 +0xEFA4 0x9D3E +0xEFA5 0x9D37 +0xEFA6 0x9D40 +0xEFA7 0x9D3D +0xEFA8 0x7FF5 +0xEFA9 0x9D2D +0xEFAA 0x9E8A +0xEFAB 0x9E89 +0xEFAC 0x9E8D +0xEFAD 0x9EB0 +0xEFAE 0x9EC8 +0xEFAF 0x9EDA +0xEFB0 0x9EFB +0xEFB1 0x9EFF +0xEFB2 0x9F24 +0xEFB3 0x9F23 +0xEFB4 0x9F22 +0xEFB5 0x9F54 +0xEFB6 0x9FA0 +0xEFB7 0x5131 +0xEFB8 0xEFB9 0x512D +0xEFBA 0x5698 +0xEFBB 0x569C +0xEFBC 0x5697 +0xEFBD 0x569A +0xEFBE 0x569D +0xEFBF 0x5699 +0xEFC0 0x5970 +0xEFC1 0x5B3C +0xEFC2 0xEFC3 0x5C69 +0xEFC4 0x5DC0 +0xEFC5 0xEFC6 0x5E6D +0xEFC7 0x61D8 +0xEFC8 0x61DF +0xEFC9 0xEFCA 0x61ED +0xEFCB 0x61F1 +0xEFCC 0x61EA +0xEFCD 0x61F0 +0xEFCE 0x61EB +0xEFCF 0x61D6 +0xEFD0 0x61E9 +0xEFD1 0x64FF +0xEFD2 0x6504 +0xEFD3 0x64FD +0xEFD4 0x64F8 +0xEFD5 0x6501 +0xEFD6 0x6503 +0xEFD7 0x64FC +0xEFD8 0x6594 +0xEFD9 0x65DB +0xEFDA 0xEFDB 0x66DA +0xEFDC 0x66D8 +0xEFDD 0x6AC5 +0xEFDE 0x6AB9 +0xEFDF 0x6ABD +0xEFE0 0x6AE1 +0xEFE1 0x6AC6 +0xEFE2 0x6ABA +0xEFE3 0xEFE4 0x6AB6 +0xEFE5 0x6AC7 +0xEFE6 0x6AB4 +0xEFE7 0x6AAD +0xEFE8 0x6B5E +0xEFE9 0x6BC9 +0xEFEA 0x6C0B +0xEFEB 0x7007 +0xEFEC 0xEFED 0x700C +0xEFEE 0x7001 +0xEFEF 0x7005 +0xEFF0 0x7014 +0xEFF1 0x700E +0xEFF2 0xEFF3 0x6FFF +0xEFF4 0x6FFB +0xEFF5 0x7026 +0xEFF6 0x6FFC +0xEFF7 0x6FF7 +0xEFF8 0x700A +0xEFF9 0x7201 +0xEFFA 0x71FF +0xEFFB 0x71F9 +0xEFFC 0x7203 +0xEFFD 0x71FD +0xEFFE 0x7376 +0xF040 0x74B8 +0xF041 0x74C0 +0xF042 0x74B5 +0xF043 0x74C1 +0xF044 0x74BE +0xF045 0x74B6 +0xF046 0x74BB +0xF047 0x74C2 +0xF048 0x7514 +0xF049 0x7513 +0xF04A 0x765C +0xF04B 0x7664 +0xF04C 0x7659 +0xF04D 0x7650 +0xF04E 0x7653 +0xF04F 0x7657 +0xF050 0x765A +0xF051 0x76A6 +0xF052 0x76BD +0xF053 0x76EC +0xF054 0x77C2 +0xF055 0x77BA +0xF056 0x78FF +0xF057 0x790C +0xF058 0xF059 0x7913 +0xF05A 0x7909 +0xF05B 0x7910 +0xF05C 0x7912 +0xF05D 0x7911 +0xF05E 0x79AD +0xF05F 0x79AC +0xF060 0x7A5F +0xF061 0x7C1C +0xF062 0x7C29 +0xF063 0x7C19 +0xF064 0x7C20 +0xF065 0x7C1F +0xF066 0x7C2D +0xF067 0x7C1D +0xF068 0x7C26 +0xF069 0x7C28 +0xF06A 0x7C22 +0xF06B 0x7C25 +0xF06C 0x7C30 +0xF06D 0x7E5C +0xF06E 0x7E50 +0xF06F 0x7E56 +0xF070 0x7E63 +0xF071 0x7E58 +0xF072 0x7E62 +0xF073 0x7E5F +0xF074 0x7E51 +0xF075 0x7E60 +0xF076 0x7E57 +0xF077 0x7E53 +0xF078 0x7FB5 +0xF079 0x7FB3 +0xF07A 0xF07B 0x7FF7 +0xF07C 0x8075 +0xF07D 0xF07E 0x81D1 +0xF0A1 0x81D0 +0xF0A2 0x825F +0xF0A3 0x825E +0xF0A4 0x85B4 +0xF0A5 0x85C6 +0xF0A6 0x85C0 +0xF0A7 0x85C3 +0xF0A8 0x85C2 +0xF0A9 0x85B3 +0xF0AA 0x85B5 +0xF0AB 0x85BD +0xF0AC 0x85C7 +0xF0AD 0x85C4 +0xF0AE 0x85BF +0xF0AF 0x85CB +0xF0B0 0x85CE +0xF0B1 0x85C8 +0xF0B2 0x85C5 +0xF0B3 0x85B1 +0xF0B4 0x85B6 +0xF0B5 0x85D2 +0xF0B6 0x8624 +0xF0B7 0x85B8 +0xF0B8 0x85B7 +0xF0B9 0x85BE +0xF0BA 0x8669 +0xF0BB 0x87E7 +0xF0BC 0x87E6 +0xF0BD 0x87E2 +0xF0BE 0x87DB +0xF0BF 0x87EB +0xF0C0 0x87EA +0xF0C1 0x87E5 +0xF0C2 0x87DF +0xF0C3 0x87F3 +0xF0C4 0x87E4 +0xF0C5 0x87D4 +0xF0C6 0x87DC +0xF0C7 0x87D3 +0xF0C8 0x87ED +0xF0C9 0x87D8 +0xF0CA 0x87E3 +0xF0CB 0x87A4 +0xF0CC 0x87D7 +0xF0CD 0x87D9 +0xF0CE 0x8801 +0xF0CF 0x87F4 +0xF0D0 0x87E8 +0xF0D1 0x87DD +0xF0D2 0x8953 +0xF0D3 0x894B +0xF0D4 0x894F +0xF0D5 0x894C +0xF0D6 0x8946 +0xF0D7 0xF0D8 0x8950 +0xF0D9 0x8949 +0xF0DA 0x8B2A +0xF0DB 0x8B27 +0xF0DC 0x8B23 +0xF0DD 0x8B33 +0xF0DE 0x8B30 +0xF0DF 0x8B35 +0xF0E0 0x8B47 +0xF0E1 0x8B2F +0xF0E2 0x8B3C +0xF0E3 0x8B3E +0xF0E4 0x8B31 +0xF0E5 0x8B25 +0xF0E6 0x8B37 +0xF0E7 0x8B26 +0xF0E8 0x8B36 +0xF0E9 0x8B2E +0xF0EA 0x8B24 +0xF0EB 0x8B3B +0xF0EC 0x8B3D +0xF0ED 0x8B3A +0xF0EE 0x8C42 +0xF0EF 0x8C75 +0xF0F0 0x8C99 +0xF0F1 0x8C98 +0xF0F2 0x8C97 +0xF0F3 0x8CFE +0xF0F4 0x8D04 +0xF0F5 0x8D02 +0xF0F6 0x8D00 +0xF0F7 0x8E5C +0xF0F8 0x8E62 +0xF0F9 0x8E60 +0xF0FA 0x8E57 +0xF0FB 0x8E56 +0xF0FC 0x8E5E +0xF0FD 0x8E65 +0xF0FE 0x8E67 +0xF140 0x8E5B +0xF141 0x8E5A +0xF142 0x8E61 +0xF143 0x8E5D +0xF144 0x8E69 +0xF145 0x8E54 +0xF146 0xF148 0x8F46 +0xF149 0x8F4B +0xF14A 0x9128 +0xF14B 0xF14C 0x913A +0xF14D 0x913E +0xF14E 0x91A8 +0xF14F 0x91A5 +0xF150 0x91A7 +0xF151 0x91AF +0xF152 0x91AA +0xF153 0x93B5 +0xF154 0x938C +0xF155 0x9392 +0xF156 0x93B7 +0xF157 0x939B +0xF158 0x939D +0xF159 0x9389 +0xF15A 0x93A7 +0xF15B 0x938E +0xF15C 0x93AA +0xF15D 0x939E +0xF15E 0x93A6 +0xF15F 0x9395 +0xF160 0x9388 +0xF161 0x9399 +0xF162 0x939F +0xF163 0x938D +0xF164 0x93B1 +0xF165 0x9391 +0xF166 0x93B2 +0xF167 0x93A4 +0xF168 0x93A8 +0xF169 0x93B4 +0xF16A 0x93A3 +0xF16B 0x93A5 +0xF16C 0xF16D 0x95D2 +0xF16E 0x95D1 +0xF16F 0x96B3 +0xF170 0x96D7 +0xF171 0x96DA +0xF172 0x5DC2 +0xF173 0x96DF +0xF174 0x96D8 +0xF175 0x96DD +0xF176 0x9723 +0xF177 0x9722 +0xF178 0x9725 +0xF179 0x97AC +0xF17A 0x97AE +0xF17B 0x97A8 +0xF17C 0x97AB +0xF17D 0x97A4 +0xF17E 0x97AA +0xF1A1 0x97A2 +0xF1A2 0x97A5 +0xF1A3 0x97D7 +0xF1A4 0x97D9 +0xF1A5 0x97D6 +0xF1A6 0x97D8 +0xF1A7 0x97FA +0xF1A8 0xF1AA 0x9850 +0xF1AB 0x98B8 +0xF1AC 0x9941 +0xF1AD 0x993C +0xF1AE 0x993A +0xF1AF 0x9A0F +0xF1B0 0x9A0B +0xF1B1 0x9A09 +0xF1B2 0x9A0D +0xF1B3 0x9A04 +0xF1B4 0x9A11 +0xF1B5 0x9A0A +0xF1B6 0x9A05 +0xF1B7 0x9A07 +0xF1B8 0x9A06 +0xF1B9 0x9AC0 +0xF1BA 0x9ADC +0xF1BB 0x9B08 +0xF1BC 0xF1BD 0x9B04 +0xF1BE 0x9B29 +0xF1BF 0x9B35 +0xF1C0 0x9B4A +0xF1C1 0x9B4C +0xF1C2 0x9B4B +0xF1C3 0x9BC7 +0xF1C4 0x9BC6 +0xF1C5 0x9BC3 +0xF1C6 0x9BBF +0xF1C7 0x9BC1 +0xF1C8 0x9BB5 +0xF1C9 0x9BB8 +0xF1CA 0x9BD3 +0xF1CB 0x9BB6 +0xF1CC 0x9BC4 +0xF1CD 0x9BB9 +0xF1CE 0x9BBD +0xF1CF 0x9D5C +0xF1D0 0x9D53 +0xF1D1 0x9D4F +0xF1D2 0x9D4A +0xF1D3 0x9D5B +0xF1D4 0x9D4B +0xF1D5 0x9D59 +0xF1D6 0x9D56 +0xF1D7 0x9D4C +0xF1D8 0x9D57 +0xF1D9 0x9D52 +0xF1DA 0x9D54 +0xF1DB 0x9D5F +0xF1DC 0x9D58 +0xF1DD 0x9D5A +0xF1DE 0x9E8E +0xF1DF 0x9E8C +0xF1E0 0x9EDF +0xF1E1 0x9F01 +0xF1E2 0x9F00 +0xF1E3 0x9F16 +0xF1E4 0x9F25 +0xF1E5 0x9F2B +0xF1E6 0x9F2A +0xF1E7 0x9F29 +0xF1E8 0x9F28 +0xF1E9 0x9F4C +0xF1EA 0x9F55 +0xF1EB 0xF1EC 0x5134 +0xF1ED 0x5296 +0xF1EE 0x52F7 +0xF1EF 0x53B4 +0xF1F0 0x56AB +0xF1F1 0x56AD +0xF1F2 0xF1F3 0x56A6 +0xF1F4 0x56AA +0xF1F5 0x56AC +0xF1F6 0x58DA +0xF1F7 0x58DD +0xF1F8 0x58DB +0xF1F9 0x5912 +0xF1FA 0xF1FC 0x5B3D +0xF1FD 0x5DC3 +0xF1FE 0x5E70 +0xF240 0x5FBF +0xF241 0x61FB +0xF242 0x6507 +0xF243 0x6510 +0xF244 0x650D +0xF245 0x6509 +0xF246 0x650C +0xF247 0x650E +0xF248 0x6584 +0xF249 0x65DE +0xF24A 0x65DD +0xF24B 0x66DE +0xF24C 0x6AE7 +0xF24D 0x6AE0 +0xF24E 0x6ACC +0xF24F 0x6AD1 +0xF250 0x6AD9 +0xF251 0x6ACB +0xF252 0x6ADF +0xF253 0x6ADC +0xF254 0x6AD0 +0xF255 0x6AEB +0xF256 0x6ACF +0xF257 0x6ACD +0xF258 0x6ADE +0xF259 0x6B60 +0xF25A 0x6BB0 +0xF25B 0x6C0C +0xF25C 0x7019 +0xF25D 0x7027 +0xF25E 0x7020 +0xF25F 0x7016 +0xF260 0x702B +0xF261 0xF263 0x7021 +0xF264 0x7029 +0xF265 0x7017 +0xF266 0x7024 +0xF267 0x701C +0xF268 0x702A +0xF269 0x720C +0xF26A 0x720A +0xF26B 0x7207 +0xF26C 0x7202 +0xF26D 0x7205 +0xF26E 0xF26F 0x72A5 +0xF270 0x72A4 +0xF271 0x72A3 +0xF272 0x72A1 +0xF273 0x74CB +0xF274 0x74C5 +0xF275 0x74B7 +0xF276 0x74C3 +0xF277 0x7516 +0xF278 0x7660 +0xF279 0xF27A 0x77C9 +0xF27B 0x77C4 +0xF27C 0x77F1 +0xF27D 0x791D +0xF27E 0x791B +0xF2A1 0x7921 +0xF2A2 0x791C +0xF2A3 0x7917 +0xF2A4 0x791E +0xF2A5 0x79B0 +0xF2A6 0xF2A7 0x7A67 +0xF2A8 0x7C33 +0xF2A9 0x7C3C +0xF2AA 0x7C39 +0xF2AB 0x7C2C +0xF2AC 0x7C3B +0xF2AD 0x7CEC +0xF2AE 0x7CEA +0xF2AF 0x7E76 +0xF2B0 0x7E75 +0xF2B1 0x7E78 +0xF2B2 0x7E70 +0xF2B3 0x7E77 +0xF2B4 0x7E6F +0xF2B5 0x7E7A +0xF2B6 0x7E72 +0xF2B7 0x7E74 +0xF2B8 0x7E68 +0xF2B9 0x7F4B +0xF2BA 0x7F4A +0xF2BB 0x7F83 +0xF2BC 0x7F86 +0xF2BD 0x7FB7 +0xF2BE 0xF2BF 0x7FFD +0xF2C0 0x8078 +0xF2C1 0x81D7 +0xF2C2 0x81D5 +0xF2C3 0x8264 +0xF2C4 0x8261 +0xF2C5 0x8263 +0xF2C6 0x85EB +0xF2C7 0x85F1 +0xF2C8 0x85ED +0xF2C9 0x85D9 +0xF2CA 0x85E1 +0xF2CB 0x85E8 +0xF2CC 0x85DA +0xF2CD 0x85D7 +0xF2CE 0x85EC +0xF2CF 0x85F2 +0xF2D0 0x85F8 +0xF2D1 0x85D8 +0xF2D2 0x85DF +0xF2D3 0x85E3 +0xF2D4 0x85DC +0xF2D5 0x85D1 +0xF2D6 0x85F0 +0xF2D7 0x85E6 +0xF2D8 0x85EF +0xF2D9 0x85DE +0xF2DA 0x85E2 +0xF2DB 0x8800 +0xF2DC 0x87FA +0xF2DD 0x8803 +0xF2DE 0xF2DF 0x87F6 +0xF2E0 0x8809 +0xF2E1 0x880C +0xF2E2 0x880B +0xF2E3 0x8806 +0xF2E4 0x87FC +0xF2E5 0x8808 +0xF2E6 0x87FF +0xF2E7 0x880A +0xF2E8 0x8802 +0xF2E9 0x8962 +0xF2EA 0xF2EB 0x895A +0xF2EC 0x8957 +0xF2ED 0x8961 +0xF2EE 0x895C +0xF2EF 0x8958 +0xF2F0 0x895D +0xF2F1 0x8959 +0xF2F2 0x8988 +0xF2F3 0x89B7 +0xF2F4 0x89B6 +0xF2F5 0x89F6 +0xF2F6 0x8B50 +0xF2F7 0x8B48 +0xF2F8 0x8B4A +0xF2F9 0x8B40 +0xF2FA 0x8B53 +0xF2FB 0x8B56 +0xF2FC 0x8B54 +0xF2FD 0x8B4B +0xF2FE 0x8B55 +0xF340 0x8B51 +0xF341 0x8B42 +0xF342 0x8B52 +0xF343 0x8B57 +0xF344 0x8C43 +0xF345 0x8C77 +0xF346 0x8C76 +0xF347 0x8C9A +0xF348 0xF349 0x8D06 +0xF34A 0x8D09 +0xF34B 0x8DAC +0xF34C 0x8DAA +0xF34D 0x8DAD +0xF34E 0x8DAB +0xF34F 0x8E6D +0xF350 0x8E78 +0xF351 0x8E73 +0xF352 0x8E6A +0xF353 0x8E6F +0xF354 0x8E7B +0xF355 0x8EC2 +0xF356 0x8F52 +0xF357 0x8F51 +0xF358 0xF359 0x8F4F +0xF35A 0x8F53 +0xF35B 0x8FB4 +0xF35C 0x9140 +0xF35D 0x913F +0xF35E 0x91B0 +0xF35F 0x91AD +0xF360 0x93DE +0xF361 0x93C7 +0xF362 0x93CF +0xF363 0x93C2 +0xF364 0x93DA +0xF365 0x93D0 +0xF366 0x93F9 +0xF367 0x93EC +0xF368 0x93CC +0xF369 0x93D9 +0xF36A 0x93A9 +0xF36B 0x93E6 +0xF36C 0x93CA +0xF36D 0x93D4 +0xF36E 0x93EE +0xF36F 0x93E3 +0xF370 0x93D5 +0xF371 0x93C4 +0xF372 0x93CE +0xF373 0x93C0 +0xF374 0x93D2 +0xF375 0x93E7 +0xF376 0x957D +0xF377 0xF378 0x95DA +0xF379 0x96E1 +0xF37A 0x9729 +0xF37B 0xF37C 0x972B +0xF37D 0x9728 +0xF37E 0x9726 +0xF3A1 0x97B3 +0xF3A2 0x97B7 +0xF3A3 0x97B6 +0xF3A4 0xF3A6 0x97DD +0xF3A7 0x985C +0xF3A8 0x9859 +0xF3A9 0x985D +0xF3AA 0x9857 +0xF3AB 0x98BF +0xF3AC 0x98BD +0xF3AD 0x98BB +0xF3AE 0x98BE +0xF3AF 0x9948 +0xF3B0 0x9947 +0xF3B1 0x9943 +0xF3B2 0xF3B3 0x99A6 +0xF3B4 0x9A1A +0xF3B5 0x9A15 +0xF3B6 0x9A25 +0xF3B7 0x9A1D +0xF3B8 0x9A24 +0xF3B9 0x9A1B +0xF3BA 0x9A22 +0xF3BB 0x9A20 +0xF3BC 0x9A27 +0xF3BD 0x9A23 +0xF3BE 0x9A1E +0xF3BF 0x9A1C +0xF3C0 0x9A14 +0xF3C1 0x9AC2 +0xF3C2 0x9B0B +0xF3C3 0x9B0A +0xF3C4 0x9B0E +0xF3C5 0x9B0C +0xF3C6 0x9B37 +0xF3C7 0xF3C8 0x9BEA +0xF3C9 0x9BE0 +0xF3CA 0x9BDE +0xF3CB 0x9BE4 +0xF3CC 0x9BE6 +0xF3CD 0x9BE2 +0xF3CE 0x9BF0 +0xF3CF 0x9BD4 +0xF3D0 0x9BD7 +0xF3D1 0x9BEC +0xF3D2 0x9BDC +0xF3D3 0x9BD9 +0xF3D4 0x9BE5 +0xF3D5 0x9BD5 +0xF3D6 0x9BE1 +0xF3D7 0x9BDA +0xF3D8 0x9D77 +0xF3D9 0x9D81 +0xF3DA 0x9D8A +0xF3DB 0x9D84 +0xF3DC 0x9D88 +0xF3DD 0x9D71 +0xF3DE 0x9D80 +0xF3DF 0x9D78 +0xF3E0 0x9D86 +0xF3E1 0xF3E2 0x9D8B +0xF3E3 0x9D7D +0xF3E4 0x9D6B +0xF3E5 0xF3E6 0x9D74 +0xF3E7 0x9D70 +0xF3E8 0x9D69 +0xF3E9 0x9D85 +0xF3EA 0x9D73 +0xF3EB 0x9D7B +0xF3EC 0x9D82 +0xF3ED 0x9D6F +0xF3EE 0x9D79 +0xF3EF 0x9D7F +0xF3F0 0x9D87 +0xF3F1 0x9D68 +0xF3F2 0x9E94 +0xF3F3 0x9E91 +0xF3F4 0x9EC0 +0xF3F5 0x9EFC +0xF3F6 0x9F2D +0xF3F7 0xF3F8 0x9F40 +0xF3F9 0x9F4D +0xF3FA 0xF3FC 0x9F56 +0xF3FD 0x5337 +0xF3FE 0x56B2 +0xF440 0x56B5 +0xF441 0x56B3 +0xF442 0x58E3 +0xF443 0x5B45 +0xF444 0xF445 0x5DC6 +0xF446 0xF447 0x5EEE +0xF448 0xF449 0x5FC0 +0xF44A 0x61F9 +0xF44B 0x6517 +0xF44C 0x6516 +0xF44D 0x6515 +0xF44E 0x6513 +0xF44F 0x65DF +0xF450 0x66E8 +0xF451 0xF452 0x66E3 +0xF453 0x6AF3 +0xF454 0x6AF0 +0xF455 0x6AEA +0xF456 0x6AE8 +0xF457 0x6AF9 +0xF458 0x6AF1 +0xF459 0xF45A 0x6AEE +0xF45B 0x703C +0xF45C 0x7035 +0xF45D 0x702F +0xF45E 0x7037 +0xF45F 0x7034 +0xF460 0x7031 +0xF461 0x7042 +0xF462 0x7038 +0xF463 0x703F +0xF464 0x703A +0xF465 0x7039 +0xF466 0x7040 +0xF467 0x703B +0xF468 0x7033 +0xF469 0x7041 +0xF46A 0xF46B 0x7213 +0xF46C 0x72A8 +0xF46D 0x737D +0xF46E 0x737C +0xF46F 0x74BA +0xF470 0x76AB +0xF471 0x76AA +0xF472 0x76BE +0xF473 0x76ED +0xF474 0x77CC +0xF475 0xF476 0x77CE +0xF477 0x77CD +0xF478 0x77F2 +0xF479 0x7925 +0xF47A 0x7923 +0xF47B 0xF47C 0x7927 +0xF47D 0x7924 +0xF47E 0x7929 +0xF4A1 0x79B2 +0xF4A2 0x7A6E +0xF4A3 0xF4A4 0x7A6C +0xF4A5 0x7AF7 +0xF4A6 0x7C49 +0xF4A7 0x7C48 +0xF4A8 0x7C4A +0xF4A9 0x7C47 +0xF4AA 0x7C45 +0xF4AB 0x7CEE +0xF4AC 0x7E7B +0xF4AD 0x7E7E +0xF4AE 0x7E81 +0xF4AF 0x7E80 +0xF4B0 0x7FBA +0xF4B1 0x7FFF +0xF4B2 0x8079 +0xF4B3 0x81DB +0xF4B4 0x81D9 +0xF4B5 0x820B +0xF4B6 0xF4B7 0x8268 +0xF4B8 0x8622 +0xF4B9 0x85FF +0xF4BA 0x8601 +0xF4BB 0x85FE +0xF4BC 0x861B +0xF4BD 0x8600 +0xF4BE 0x85F6 +0xF4BF 0x8604 +0xF4C0 0x8609 +0xF4C1 0x8605 +0xF4C2 0x860C +0xF4C3 0x85FD +0xF4C4 0x8819 +0xF4C5 0xF4C6 0x8810 +0xF4C7 0x8817 +0xF4C8 0x8813 +0xF4C9 0x8816 +0xF4CA 0x8963 +0xF4CB 0x8966 +0xF4CC 0x89B9 +0xF4CD 0x89F7 +0xF4CE 0x8B60 +0xF4CF 0x8B6A +0xF4D0 0x8B5D +0xF4D1 0x8B68 +0xF4D2 0x8B63 +0xF4D3 0x8B65 +0xF4D4 0x8B67 +0xF4D5 0x8B6D +0xF4D6 0x8DAE +0xF4D7 0x8E86 +0xF4D8 0x8E88 +0xF4D9 0x8E84 +0xF4DA 0x8F59 +0xF4DB 0xF4DC 0x8F56 +0xF4DD 0x8F55 +0xF4DE 0x8F58 +0xF4DF 0x8F5A +0xF4E0 0x908D +0xF4E1 0x9143 +0xF4E2 0x9141 +0xF4E3 0x91B7 +0xF4E4 0x91B5 +0xF4E5 0xF4E6 0x91B2 +0xF4E7 0x940B +0xF4E8 0x9413 +0xF4E9 0x93FB +0xF4EA 0x9420 +0xF4EB 0x940F +0xF4EC 0x9414 +0xF4ED 0x93FE +0xF4EE 0x9415 +0xF4EF 0x9410 +0xF4F0 0x9428 +0xF4F1 0x9419 +0xF4F2 0x940D +0xF4F3 0x93F5 +0xF4F4 0x9400 +0xF4F5 0x93F7 +0xF4F6 0x9407 +0xF4F7 0x940E +0xF4F8 0x9416 +0xF4F9 0x9412 +0xF4FA 0x93FA +0xF4FB 0x9409 +0xF4FC 0x93F8 +0xF4FD 0x940A +0xF4FE 0x93FF +0xF540 0x93FC +0xF541 0x940C +0xF542 0x93F6 +0xF543 0x9411 +0xF544 0x9406 +0xF545 0x95DE +0xF546 0x95E0 +0xF547 0x95DF +0xF548 0xF549 0x972E +0xF54A 0x97B9 +0xF54B 0x97BB +0xF54C 0xF54D 0x97FD +0xF54E 0x9860 +0xF54F 0xF550 0x9862 +0xF551 0x985F +0xF552 0xF553 0x98C1 +0xF554 0x9950 +0xF555 0x994E +0xF556 0x9959 +0xF557 0x994C +0xF558 0x994B +0xF559 0x9953 +0xF55A 0x9A32 +0xF55B 0x9A34 +0xF55C 0x9A31 +0xF55D 0x9A2C +0xF55E 0x9A2A +0xF55F 0x9A36 +0xF560 0x9A29 +0xF561 0x9A2E +0xF562 0x9A38 +0xF563 0x9A2D +0xF564 0x9AC7 +0xF565 0x9ACA +0xF566 0x9AC6 +0xF567 0x9B10 +0xF568 0x9B12 +0xF569 0x9B11 +0xF56A 0x9C0B +0xF56B 0x9C08 +0xF56C 0x9BF7 +0xF56D 0x9C05 +0xF56E 0x9C12 +0xF56F 0x9BF8 +0xF570 0x9C40 +0xF571 0x9C07 +0xF572 0x9C0E +0xF573 0x9C06 +0xF574 0x9C17 +0xF575 0x9C14 +0xF576 0x9C09 +0xF577 0x9D9F +0xF578 0x9D99 +0xF579 0x9DA4 +0xF57A 0x9D9D +0xF57B 0x9D92 +0xF57C 0x9D98 +0xF57D 0x9D90 +0xF57E 0x9D9B +0xF5A1 0x9DA0 +0xF5A2 0x9D94 +0xF5A3 0x9D9C +0xF5A4 0x9DAA +0xF5A5 0x9D97 +0xF5A6 0x9DA1 +0xF5A7 0x9D9A +0xF5A8 0x9DA2 +0xF5A9 0x9DA8 +0xF5AA 0x9D9E +0xF5AB 0x9DA3 +0xF5AC 0x9DBF +0xF5AD 0x9DA9 +0xF5AE 0x9D96 +0xF5AF 0xF5B0 0x9DA6 +0xF5B1 0x9E99 +0xF5B2 0x9E9B +0xF5B3 0x9E9A +0xF5B4 0x9EE5 +0xF5B5 0x9EE4 +0xF5B6 0x9EE7 +0xF5B7 0x9EE6 +0xF5B8 0x9F30 +0xF5B9 0x9F2E +0xF5BA 0x9F5B +0xF5BB 0x9F60 +0xF5BC 0x9F5E +0xF5BD 0x9F5D +0xF5BE 0x9F59 +0xF5BF 0x9F91 +0xF5C0 0x513A +0xF5C1 0x5139 +0xF5C2 0x5298 +0xF5C3 0x5297 +0xF5C4 0x56C3 +0xF5C5 0xF5C6 0x56BD +0xF5C7 0x5B48 +0xF5C8 0x5B47 +0xF5C9 0x5DCB +0xF5CA 0x5DCF +0xF5CB 0x5EF1 +0xF5CC 0x61FD +0xF5CD 0x651B +0xF5CE 0x6B02 +0xF5CF 0x6AFC +0xF5D0 0x6B03 +0xF5D1 0x6AF8 +0xF5D2 0x6B00 +0xF5D3 0xF5D4 0x7043 +0xF5D5 0x704A +0xF5D6 0xF5D7 0x7048 +0xF5D8 0xF5D9 0x7045 +0xF5DA 0x721D +0xF5DB 0x721A +0xF5DC 0x7219 +0xF5DD 0x737E +0xF5DE 0x7517 +0xF5DF 0x766A +0xF5E0 0x77D0 +0xF5E1 0x792D +0xF5E2 0x7931 +0xF5E3 0x792F +0xF5E4 0x7C54 +0xF5E5 0x7C53 +0xF5E6 0x7CF2 +0xF5E7 0x7E8A +0xF5E8 0xF5E9 0x7E87 +0xF5EA 0x7E8B +0xF5EB 0x7E86 +0xF5EC 0x7E8D +0xF5ED 0x7F4D +0xF5EE 0x7FBB +0xF5EF 0x8030 +0xF5F0 0x81DD +0xF5F1 0x8618 +0xF5F2 0x862A +0xF5F3 0x8626 +0xF5F4 0x861F +0xF5F5 0x8623 +0xF5F6 0x861C +0xF5F7 0x8619 +0xF5F8 0x8627 +0xF5F9 0x862E +0xF5FA 0x8621 +0xF5FB 0x8620 +0xF5FC 0x8629 +0xF5FD 0x861E +0xF5FE 0x8625 +0xF640 0x8829 +0xF641 0x881D +0xF642 0x881B +0xF643 0x8820 +0xF644 0x8824 +0xF645 0x881C +0xF646 0x882B +0xF647 0x884A +0xF648 0x896D +0xF649 0x8969 +0xF64A 0x896E +0xF64B 0x896B +0xF64C 0x89FA +0xF64D 0x8B79 +0xF64E 0x8B78 +0xF64F 0x8B45 +0xF650 0xF651 0x8B7A +0xF652 0x8D10 +0xF653 0x8D14 +0xF654 0x8DAF +0xF655 0x8E8E +0xF656 0x8E8C +0xF657 0x8F5E +0xF658 0x8F5B +0xF659 0x8F5D +0xF65A 0x9146 +0xF65B 0xF65C 0x9144 +0xF65D 0x91B9 +0xF65E 0x943F +0xF65F 0x943B +0xF660 0x9436 +0xF661 0x9429 +0xF662 0x943D +0xF663 0x943C +0xF664 0x9430 +0xF665 0x9439 +0xF666 0x942A +0xF667 0x9437 +0xF668 0x942C +0xF669 0x9440 +0xF66A 0x9431 +0xF66B 0x95E5 +0xF66C 0x95E4 +0xF66D 0x95E3 +0xF66E 0x9735 +0xF66F 0x973A +0xF670 0x97BF +0xF671 0x97E1 +0xF672 0x9864 +0xF673 0x98C9 +0xF674 0x98C6 +0xF675 0x98C0 +0xF676 0x9958 +0xF677 0x9956 +0xF678 0x9A39 +0xF679 0x9A3D +0xF67A 0x9A46 +0xF67B 0x9A44 +0xF67C 0x9A42 +0xF67D 0x9A41 +0xF67E 0x9A3A +0xF6A1 0x9A3F +0xF6A2 0x9ACD +0xF6A3 0x9B15 +0xF6A4 0xF6A5 0x9B17 +0xF6A6 0x9B16 +0xF6A7 0x9B3A +0xF6A8 0x9B52 +0xF6A9 0x9C2B +0xF6AA 0x9C1D +0xF6AB 0x9C1C +0xF6AC 0x9C2C +0xF6AD 0x9C23 +0xF6AE 0xF6AF 0x9C28 +0xF6B0 0x9C24 +0xF6B1 0x9C21 +0xF6B2 0x9DB7 +0xF6B3 0x9DB6 +0xF6B4 0x9DBC +0xF6B5 0x9DC1 +0xF6B6 0x9DC7 +0xF6B7 0x9DCA +0xF6B8 0x9DCF +0xF6B9 0x9DBE +0xF6BA 0x9DC5 +0xF6BB 0x9DC3 +0xF6BC 0x9DBB +0xF6BD 0x9DB5 +0xF6BE 0x9DCE +0xF6BF 0xF6C0 0x9DB9 +0xF6C1 0x9DAC +0xF6C2 0x9DC8 +0xF6C3 0x9DB1 +0xF6C4 0x9DAD +0xF6C5 0x9DCC +0xF6C6 0x9DB3 +0xF6C7 0x9DCD +0xF6C8 0x9DB2 +0xF6C9 0x9E7A +0xF6CA 0x9E9C +0xF6CB 0x9EEB +0xF6CC 0x9EEE +0xF6CD 0x9EED +0xF6CE 0x9F1B +0xF6CF 0x9F18 +0xF6D0 0x9F1A +0xF6D1 0x9F31 +0xF6D2 0x9F4E +0xF6D3 0x9F65 +0xF6D4 0x9F64 +0xF6D5 0x9F92 +0xF6D6 0x4EB9 +0xF6D7 0x56C6 +0xF6D8 0x56C5 +0xF6D9 0x56CB +0xF6DA 0x5971 +0xF6DB 0xF6DC 0x5B4B +0xF6DD 0x5DD5 +0xF6DE 0x5DD1 +0xF6DF 0x5EF2 +0xF6E0 0x6521 +0xF6E1 0x6520 +0xF6E2 0x6526 +0xF6E3 0x6522 +0xF6E4 0x6B0B +0xF6E5 0xF6E6 0x6B08 +0xF6E7 0x6C0D +0xF6E8 0xF6EA 0x7055 +0xF6EB 0x7052 +0xF6EC 0xF6ED 0x721E +0xF6EE 0x72A9 +0xF6EF 0x737F +0xF6F0 0x74D8 +0xF6F1 0x74D5 +0xF6F2 0x74D9 +0xF6F3 0x74D7 +0xF6F4 0x766D +0xF6F5 0x76AD +0xF6F6 0x7935 +0xF6F7 0x79B4 +0xF6F8 0xF6F9 0x7A70 +0xF6FA 0x7C57 +0xF6FB 0x7C5C +0xF6FC 0x7C59 +0xF6FD 0x7C5B +0xF6FE 0x7C5A +0xF740 0x7CF4 +0xF741 0x7CF1 +0xF742 0x7E91 +0xF743 0x7F4F +0xF744 0x7F87 +0xF745 0x81DE +0xF746 0x826B +0xF747 0xF748 0x8634 +0xF749 0x8633 +0xF74A 0x862C +0xF74B 0x8632 +0xF74C 0x8636 +0xF74D 0x882C +0xF74E 0x8828 +0xF74F 0x8826 +0xF750 0x882A +0xF751 0x8825 +0xF752 0x8971 +0xF753 0x89BF +0xF754 0x89BE +0xF755 0x89FB +0xF756 0x8B7E +0xF757 0x8B84 +0xF758 0x8B82 +0xF759 0x8B86 +0xF75A 0x8B85 +0xF75B 0x8B7F +0xF75C 0x8D15 +0xF75D 0x8E95 +0xF75E 0x8E94 +0xF75F 0x8E9A +0xF760 0x8E92 +0xF761 0x8E90 +0xF762 0xF763 0x8E96 +0xF764 0x8F60 +0xF765 0x8F62 +0xF766 0x9147 +0xF767 0x944C +0xF768 0x9450 +0xF769 0xF76A 0x944A +0xF76B 0x944F +0xF76C 0x9447 +0xF76D 0x9445 +0xF76E 0xF76F 0x9448 +0xF770 0x9446 +0xF771 0x973F +0xF772 0x97E3 +0xF773 0x986A +0xF774 0x9869 +0xF775 0x98CB +0xF776 0x9954 +0xF777 0x995B +0xF778 0x9A4E +0xF779 0xF77A 0x9A53 +0xF77B 0x9A4C +0xF77C 0x9A4F +0xF77D 0x9A48 +0xF77E 0x9A4A +0xF7A1 0x9A49 +0xF7A2 0x9A52 +0xF7A3 0x9A50 +0xF7A4 0x9AD0 +0xF7A5 0x9B19 +0xF7A6 0x9B2B +0xF7A7 0x9B3B +0xF7A8 0x9B56 +0xF7A9 0x9B55 +0xF7AA 0x9C46 +0xF7AB 0x9C48 +0xF7AC 0x9C3F +0xF7AD 0x9C44 +0xF7AE 0x9C39 +0xF7AF 0x9C33 +0xF7B0 0x9C41 +0xF7B1 0x9C3C +0xF7B2 0x9C37 +0xF7B3 0x9C34 +0xF7B4 0x9C32 +0xF7B5 0x9C3D +0xF7B6 0x9C36 +0xF7B7 0x9DDB +0xF7B8 0x9DD2 +0xF7B9 0x9DDE +0xF7BA 0x9DDA +0xF7BB 0x9DCB +0xF7BC 0x9DD0 +0xF7BD 0x9DDC +0xF7BE 0x9DD1 +0xF7BF 0x9DDF +0xF7C0 0x9DE9 +0xF7C1 0x9DD9 +0xF7C2 0x9DD8 +0xF7C3 0x9DD6 +0xF7C4 0x9DF5 +0xF7C5 0x9DD5 +0xF7C6 0x9DDD +0xF7C7 0x9EB6 +0xF7C8 0x9EF0 +0xF7C9 0x9F35 +0xF7CA 0x9F33 +0xF7CB 0x9F32 +0xF7CC 0x9F42 +0xF7CD 0x9F6B +0xF7CE 0x9F95 +0xF7CF 0x9FA2 +0xF7D0 0x513D +0xF7D1 0x5299 +0xF7D2 0x58E8 +0xF7D3 0x58E7 +0xF7D4 0x5972 +0xF7D5 0x5B4D +0xF7D6 0x5DD8 +0xF7D7 0x882F +0xF7D8 0x5F4F +0xF7D9 0x6201 +0xF7DA 0xF7DB 0x6203 +0xF7DC 0x6529 +0xF7DD 0x6525 +0xF7DE 0x6596 +0xF7DF 0x66EB +0xF7E0 0xF7E1 0x6B11 +0xF7E2 0x6B0F +0xF7E3 0x6BCA +0xF7E4 0x705B +0xF7E5 0x705A +0xF7E6 0x7222 +0xF7E7 0x7382 +0xF7E8 0x7381 +0xF7E9 0x7383 +0xF7EA 0x7670 +0xF7EB 0x77D4 +0xF7EC 0x7C67 +0xF7ED 0x7C66 +0xF7EE 0x7E95 +0xF7EF 0x826C +0xF7F0 0x863A +0xF7F1 0x8640 +0xF7F2 0x8639 +0xF7F3 0x863C +0xF7F4 0x8631 +0xF7F5 0x863B +0xF7F6 0x863E +0xF7F7 0x8830 +0xF7F8 0x8832 +0xF7F9 0x882E +0xF7FA 0x8833 +0xF7FB 0x8976 +0xF7FC 0x8974 +0xF7FD 0x8973 +0xF7FE 0x89FE +0xF840 0x8B8C +0xF841 0x8B8E +0xF842 0x8B8B +0xF843 0x8B88 +0xF844 0x8C45 +0xF845 0x8D19 +0xF846 0x8E98 +0xF847 0x8F64 +0xF848 0x8F63 +0xF849 0x91BC +0xF84A 0x9462 +0xF84B 0x9455 +0xF84C 0x945D +0xF84D 0x9457 +0xF84E 0x945E +0xF84F 0xF850 0x97C4 +0xF851 0x9800 +0xF852 0x9A56 +0xF853 0x9A59 +0xF854 0xF856 0x9B1E +0xF857 0x9C52 +0xF858 0x9C58 +0xF859 0x9C50 +0xF85A 0x9C4A +0xF85B 0x9C4D +0xF85C 0x9C4B +0xF85D 0x9C55 +0xF85E 0x9C59 +0xF85F 0x9C4C +0xF860 0x9C4E +0xF861 0x9DFB +0xF862 0x9DF7 +0xF863 0x9DEF +0xF864 0x9DE3 +0xF865 0x9DEB +0xF866 0x9DF8 +0xF867 0x9DE4 +0xF868 0x9DF6 +0xF869 0x9DE1 +0xF86A 0x9DEE +0xF86B 0x9DE6 +0xF86C 0x9DF2 +0xF86D 0x9DF0 +0xF86E 0x9DE2 +0xF86F 0x9DEC +0xF870 0x9DF4 +0xF871 0x9DF3 +0xF872 0x9DE8 +0xF873 0x9DED +0xF874 0x9EC2 +0xF875 0x9ED0 +0xF876 0xF877 0x9EF2 +0xF878 0x9F06 +0xF879 0x9F1C +0xF87A 0x9F38 +0xF87B 0x9F37 +0xF87C 0x9F36 +0xF87D 0x9F43 +0xF87E 0x9F4F +0xF8A1 0x9F71 +0xF8A2 0x9F70 +0xF8A3 0xF8A4 0x9F6E +0xF8A5 0x56D3 +0xF8A6 0x56CD +0xF8A7 0x5B4E +0xF8A8 0x5C6D +0xF8A9 0x652D +0xF8AA 0xF8AB 0x66ED +0xF8AC 0x6B13 +0xF8AD 0x705F +0xF8AE 0x7061 +0xF8AF 0x705D +0xF8B0 0x7060 +0xF8B1 0x7223 +0xF8B2 0x74DB +0xF8B3 0x74E5 +0xF8B4 0x77D5 +0xF8B5 0x7938 +0xF8B6 0x79B7 +0xF8B7 0x79B6 +0xF8B8 0x7C6A +0xF8B9 0x7E97 +0xF8BA 0x7F89 +0xF8BB 0x826D +0xF8BC 0x8643 +0xF8BD 0x8838 +0xF8BE 0x8837 +0xF8BF 0x8835 +0xF8C0 0x884B +0xF8C1 0xF8C2 0x8B94 +0xF8C3 0xF8C5 0x8E9E +0xF8C6 0x8E9D +0xF8C7 0x91BE +0xF8C8 0x91BD +0xF8C9 0x91C2 +0xF8CA 0x946B +0xF8CB 0xF8CC 0x9468 +0xF8CD 0x96E5 +0xF8CE 0x9746 +0xF8CF 0x9743 +0xF8D0 0x9747 +0xF8D1 0x97C7 +0xF8D2 0x97E5 +0xF8D3 0x9A5E +0xF8D4 0x9AD5 +0xF8D5 0x9B59 +0xF8D6 0x9C63 +0xF8D7 0x9C67 +0xF8D8 0x9C66 +0xF8D9 0x9C62 +0xF8DA 0x9C5E +0xF8DB 0x9C60 +0xF8DC 0x9E02 +0xF8DD 0x9DFE +0xF8DE 0x9E07 +0xF8DF 0x9E03 +0xF8E0 0x9E06 +0xF8E1 0x9E05 +0xF8E2 0xF8E3 0x9E00 +0xF8E4 0x9E09 +0xF8E5 0x9DFF +0xF8E6 0x9DFD +0xF8E7 0x9E04 +0xF8E8 0x9EA0 +0xF8E9 0x9F1E +0xF8EA 0x9F46 +0xF8EB 0xF8ED 0x9F74 +0xF8EE 0x56D4 +0xF8EF 0x652E +0xF8F0 0x65B8 +0xF8F1 0xF8F2 0x6B18 +0xF8F3 0x6B17 +0xF8F4 0x6B1A +0xF8F5 0x7062 +0xF8F6 0x7226 +0xF8F7 0x72AA +0xF8F8 0xF8F9 0x77D8 +0xF8FA 0x7939 +0xF8FB 0x7C69 +0xF8FC 0x7C6B +0xF8FD 0x7CF6 +0xF8FE 0x7E9A +0xF940 0x7E98 +0xF941 0x7E9B +0xF942 0x7E99 +0xF943 0xF944 0x81E0 +0xF945 0xF947 0x8646 +0xF948 0xF949 0x8979 +0xF94A 0x897C +0xF94B 0x897B +0xF94C 0x89FF +0xF94D 0xF94E 0x8B98 +0xF94F 0x8EA5 +0xF950 0x8EA4 +0xF951 0x8EA3 +0xF952 0x946E +0xF953 0x946D +0xF954 0x946F +0xF955 0x9471 +0xF956 0x9473 +0xF957 0x9749 +0xF958 0x9872 +0xF959 0x995F +0xF95A 0x9C68 +0xF95B 0x9C6E +0xF95C 0x9C6D +0xF95D 0x9E0B +0xF95E 0x9E0D +0xF95F 0x9E10 +0xF960 0x9E0F +0xF961 0x9E12 +0xF962 0x9E11 +0xF963 0x9EA1 +0xF964 0x9EF5 +0xF965 0x9F09 +0xF966 0x9F47 +0xF967 0x9F78 +0xF968 0x9F7B +0xF969 0x9F7A +0xF96A 0x9F79 +0xF96B 0x571E +0xF96C 0x7066 +0xF96D 0x7C6F +0xF96E 0x883C +0xF96F 0x8DB2 +0xF970 0x8EA6 +0xF971 0x91C3 +0xF972 0x9474 +0xF973 0x9478 +0xF974 0x9476 +0xF975 0x9475 +0xF976 0x9A60 +0xF977 0x9C74 +0xF978 0x9C73 +0xF979 0x9C71 +0xF97A 0x9C75 +0xF97B 0x9E14 +0xF97C 0x9E13 +0xF97D 0x9EF6 +0xF97E 0x9F0A +0xF9A1 0x9FA4 +0xF9A2 0x7068 +0xF9A3 0x7065 +0xF9A4 0x7CF7 +0xF9A5 0x866A +0xF9A6 0x883E +0xF9A7 0x883D +0xF9A8 0x883F +0xF9A9 0x8B9E +0xF9AA 0x8C9C +0xF9AB 0x8EA9 +0xF9AC 0x8EC9 +0xF9AD 0x974B +0xF9AE 0xF9AF 0x9873 +0xF9B0 0x98CC +0xF9B1 0x9961 +0xF9B2 0x99AB +0xF9B3 0x9A64 +0xF9B4 0xF9B5 0x9A66 +0xF9B6 0x9B24 +0xF9B7 0x9E15 +0xF9B8 0x9E17 +0xF9B9 0x9F48 +0xF9BA 0x6207 +0xF9BB 0x6B1E +0xF9BC 0x7227 +0xF9BD 0x864C +0xF9BE 0x8EA8 +0xF9BF 0x9482 +0xF9C0 0xF9C1 0x9480 +0xF9C2 0x9A69 +0xF9C3 0x9A68 +0xF9C4 0x9B2E +0xF9C5 0x9E19 +0xF9C6 0x7229 +0xF9C7 0x864B +0xF9C8 0x8B9F +0xF9C9 0x9483 +0xF9CA 0x9C79 +0xF9CB 0x9EB7 +0xF9CC 0x7675 +0xF9CD 0x9A6B +0xF9CE 0x9C7A +0xF9CF 0x9E1D +0xF9D0 0xF9D1 0x7069 +0xF9D2 0x9EA4 +0xF9D3 0x9F7E +0xF9D4 0x9F49 +0xF9D5 0x9F98 +0xF9D6 0x7881 +0xF9D7 0x92B9 +0xF9D8 0x88CF +0xF9D9 0x58BB +0xF9DA 0x6052 +0xF9DB 0x7CA7 +0xF9DC 0x5AFA +0xF9DD 0x2554 +0xF9DE 0x2566 +0xF9DF 0x2557 +0xF9E0 0x2560 +0xF9E1 0x256C +0xF9E2 0x2563 +0xF9E3 0x255A +0xF9E4 0x2569 +0xF9E5 0x255D +0xF9E6 0x2552 +0xF9E7 0x2564 +0xF9E8 0x2555 +0xF9E9 0x255E +0xF9EA 0x256A +0xF9EB 0x2561 +0xF9EC 0x2558 +0xF9ED 0x2567 +0xF9EE 0x255B +0xF9EF 0x2553 +0xF9F0 0x2565 +0xF9F1 0x2556 +0xF9F2 0x255F +0xF9F3 0x256B +0xF9F4 0x2562 +0xF9F5 0x2559 +0xF9F6 0x2568 +0xF9F7 0x255C +0xF9F8 0x2551 +0xF9F9 0x2550 +0xF9FA 0xF9FB 0x256D +0xF9FC 0x2570 +0xF9FD 0x256F +0xF9FE 0xFFED +0xFA40 0xE000 +0xFA41 0x92DB +0xFA42 0xFA43 0xE002 +0xFA44 0x854C +0xFA45 0x42B5 +0xFA46 0x73EF +0xFA47 0x51B5 +0xFA48 0x3649 +0xFA49 0xFA4A 0xE009 +0xFA4B 0x9344 +0xFA4C 0xE00C +0xFA4D 0x82EE +0xFA4E 0xE00E +0xFA4F 0x783C +0xFA50 0x6744 +0xFA51 0x62DF +0xFA52 0xFA56 0xE012 +0xFA57 0x4FAB +0xFA58 0xE018 +0xFA59 0x5008 +0xFA5A 0xFA5E 0xE01A +0xFA5F 0x5029 +0xFA60 0xE020 +0xFA61 0x5FA4 +0xFA62 0xFA63 0xE022 +0xFA64 0x6EDB +0xFA65 0xE025 +0xFA66 0x507D +0xFA67 0x5101 +0xFA68 0x347A +0xFA69 0x510E +0xFA6A 0x986C +0xFA6B 0x3743 +0xFA6C 0x8416 +0xFA6D 0xFA6E 0xE02D +0xFA6F 0x5160 +0xFA70 0xE030 +0xFA71 0x516A +0xFA72 0xFA78 0xE032 +0xFA79 0x5B82 +0xFA7A 0x877D +0xFA7B 0xFA7C 0xE03B +0xFA7D 0x51B2 +0xFA7E 0x51B8 +0xFAA1 0x9D34 +0xFAA2 0x51C9 +0xFAA3 0x51CF +0xFAA4 0x51D1 +0xFAA5 0x3CDC +0xFAA6 0x51D3 +0xFAA7 0xE045 +0xFAA8 0x51B3 +0xFAA9 0x51E2 +0xFAAA 0x5342 +0xFAAB 0x51ED +0xFAAC 0x83CD +0xFAAD 0x693E +0xFAAE 0xE04C +0xFAAF 0x5F7B +0xFAB0 0x520B +0xFAB1 0x5226 +0xFAB2 0x523C +0xFAB3 0x52B5 +0xFAB4 0x5257 +0xFAB5 0x5294 +0xFAB6 0x52B9 +0xFAB7 0x52C5 +0xFAB8 0x7C15 +0xFAB9 0x8542 +0xFABA 0x52E0 +0xFABB 0x860D +0xFABC 0xE05A +0xFABD 0x5305 +0xFABE 0xE05C +0xFABF 0x5549 +0xFAC0 0x6ED9 +0xFAC1 0xFAC3 0xE05F +0xFAC4 0x5333 +0xFAC5 0x5344 +0xFAC6 0xE064 +0xFAC7 0x6CCB +0xFAC8 0xE066 +0xFAC9 0x681B +0xFACA 0x73D5 +0xFACB 0x604A +0xFACC 0x3EAA +0xFACD 0x38CC +0xFACE 0xE06C +0xFACF 0x71DD +0xFAD0 0x44A2 +0xFAD1 0x536D +0xFAD2 0x5374 +0xFAD3 0xE071 +0xFAD4 0xFAD5 0x537E +0xFAD6 0xFAD7 0xE074 +0xFAD8 0x77E6 +0xFAD9 0x5393 +0xFADA 0xE078 +0xFADB 0x53A0 +0xFADC 0x53AB +0xFADD 0x53AE +0xFADE 0x73A7 +0xFADF 0xE07D +0xFAE0 0x3F59 +0xFAE1 0x739C +0xFAE2 0x53C1 +0xFAE3 0x53C5 +0xFAE4 0x6C49 +0xFAE5 0x4E49 +0xFAE6 0x57FE +0xFAE7 0x53D9 +0xFAE8 0x3AAB +0xFAE9 0xE087 +0xFAEA 0x53E0 +0xFAEB 0xFAEC 0xE089 +0xFAED 0x53F6 +0xFAEE 0xE08C +0xFAEF 0x5413 +0xFAF0 0x7079 +0xFAF1 0x552B +0xFAF2 0x6657 +0xFAF3 0x6D5B +0xFAF4 0x546D +0xFAF5 0xFAF6 0xE093 +0xFAF7 0x555D +0xFAF8 0x548F +0xFAF9 0x54A4 +0xFAFA 0x47A6 +0xFAFB 0xFAFC 0xE099 +0xFAFD 0x3DB4 +0xFAFE 0xE09C +0xFB40 0xFB41 0xE09D +0xFB42 0x5547 +0xFB43 0x4CED +0xFB44 0x542F +0xFB45 0x7417 +0xFB46 0x5586 +0xFB47 0x55A9 +0xFB48 0x5605 +0xFB49 0xFB4A 0xE0A6 +0xFB4B 0x4552 +0xFB4C 0xE0A9 +0xFB4D 0x66B3 +0xFB4E 0xE0AB +0xFB4F 0x5637 +0xFB50 0x66CD +0xFB51 0xE0AE +0xFB52 0x66A4 +0xFB53 0x66AD +0xFB54 0x564D +0xFB55 0x564F +0xFB56 0x78F1 +0xFB57 0x56F1 +0xFB58 0x9787 +0xFB59 0x53FE +0xFB5A 0x5700 +0xFB5B 0x56EF +0xFB5C 0x56ED +0xFB5D 0xE0BA +0xFB5E 0x3623 +0xFB5F 0xE0BC +0xFB60 0x5746 +0xFB61 0xE0BE +0xFB62 0x6C6E +0xFB63 0x708B +0xFB64 0x5742 +0xFB65 0x36B1 +0xFB66 0xE0C3 +0xFB67 0x57E6 +0xFB68 0xE0C5 +0xFB69 0x5803 +0xFB6A 0xFB6B 0xE0C7 +0xFB6C 0x5826 +0xFB6D 0xE0CA +0xFB6E 0x585C +0xFB6F 0x58AA +0xFB70 0x3561 +0xFB71 0x58E0 +0xFB72 0x58DC +0xFB73 0xE0D0 +0xFB74 0x58FB +0xFB75 0x5BFF +0xFB76 0x5743 +0xFB77 0xFB78 0xE0D4 +0xFB79 0x93D3 +0xFB7A 0x35A1 +0xFB7B 0x591F +0xFB7C 0x68A6 +0xFB7D 0x36C3 +0xFB7E 0x6E59 +0xFBA1 0xE0DC +0xFBA2 0x5A24 +0xFBA3 0x5553 +0xFBA4 0xE0DF +0xFBA5 0x8505 +0xFBA6 0x59C9 +0xFBA7 0xFBAA 0xE0E2 +0xFBAB 0x59D9 +0xFBAC 0xFBAE 0xE0E7 +0xFBAF 0x6D71 +0xFBB0 0xFBB1 0xE0EB +0xFBB2 0x59F9 +0xFBB3 0xE0EE +0xFBB4 0x5AAB +0xFBB5 0x5A63 +0xFBB6 0x36E6 +0xFBB7 0xE0F2 +0xFBB8 0x5A77 +0xFBB9 0x3708 +0xFBBA 0x5A96 +0xFBBB 0x7465 +0xFBBC 0x5AD3 +0xFBBD 0xFBBE 0xE0F8 +0xFBBF 0x3D85 +0xFBC0 0xE0FB +0xFBC1 0x3732 +0xFBC2 0xE0FD +0xFBC3 0x5E83 +0xFBC4 0x52D0 +0xFBC5 0x5B76 +0xFBC6 0x6588 +0xFBC7 0x5B7C +0xFBC8 0xE103 +0xFBC9 0x4004 +0xFBCA 0x485D +0xFBCB 0xE106 +0xFBCC 0x5BD5 +0xFBCD 0x6160 +0xFBCE 0xFBD0 0xE109 +0xFBD1 0x5BF3 +0xFBD2 0x5B9D +0xFBD3 0x4D10 +0xFBD4 0x5C05 +0xFBD5 0xE110 +0xFBD6 0x5C13 +0xFBD7 0x73CE +0xFBD8 0x5C14 +0xFBD9 0xFBDA 0xE114 +0xFBDB 0x5C49 +0xFBDC 0x48DD +0xFBDD 0x5C85 +0xFBDE 0x5CE9 +0xFBDF 0x5CEF +0xFBE0 0x5D8B +0xFBE1 0xFBE2 0xE11C +0xFBE3 0x5D10 +0xFBE4 0x5D18 +0xFBE5 0x5D46 +0xFBE6 0xE121 +0xFBE7 0x5CBA +0xFBE8 0x5DD7 +0xFBE9 0x82FC +0xFBEA 0x382D +0xFBEB 0xFBED 0xE126 +0xFBEE 0x8287 +0xFBEF 0x3836 +0xFBF0 0x3BC2 +0xFBF1 0x5E2E +0xFBF2 0x6A8A +0xFBF3 0x5E75 +0xFBF4 0x5E7A +0xFBF5 0xFBF6 0xE130 +0xFBF7 0x53A6 +0xFBF8 0x4EB7 +0xFBF9 0x5ED0 +0xFBFA 0x53A8 +0xFBFB 0xE136 +0xFBFC 0x5E09 +0xFBFD 0x5EF4 +0xFBFE 0xE139 +0xFC40 0x5EF9 +0xFC41 0x5EFB +0xFC42 0x38A0 +0xFC43 0x5EFC +0xFC44 0x683E +0xFC45 0x941B +0xFC46 0x5F0D +0xFC47 0xFC48 0xE141 +0xFC49 0x3ADE +0xFC4A 0x48AE +0xFC4B 0xE145 +0xFC4C 0x5F3A +0xFC4D 0xFC4E 0xE147 +0xFC4F 0x5F58 +0xFC50 0xE14A +0xFC51 0x5F63 +0xFC52 0x97BD +0xFC53 0xE14D +0xFC54 0x5F72 +0xFC55 0x9340 +0xFC56 0xE150 +0xFC57 0x5FA7 +0xFC58 0x5DB6 +0xFC59 0x3D5F +0xFC5A 0xFC5D 0xE154 +0xFC5E 0x91D6 +0xFC5F 0xFC60 0xE159 +0xFC61 0x6031 +0xFC62 0x6685 +0xFC63 0xE15D +0xFC64 0x3963 +0xFC65 0x3DC7 +0xFC66 0x3639 +0xFC67 0x5790 +0xFC68 0xE162 +0xFC69 0x7971 +0xFC6A 0x3E40 +0xFC6B 0x609E +0xFC6C 0x60A4 +0xFC6D 0x60B3 +0xFC6E 0xFC70 0xE168 +0xFC71 0x74A4 +0xFC72 0x50E1 +0xFC73 0x5AA0 +0xFC74 0x6164 +0xFC75 0x8424 +0xFC76 0x6142 +0xFC77 0xFC78 0xE171 +0xFC79 0x6181 +0xFC7A 0x51F4 +0xFC7B 0xE175 +0xFC7C 0x6187 +0xFC7D 0x5BAA +0xFC7E 0xE178 +0xFCA1 0xE179 +0xFCA2 0x61D3 +0xFCA3 0xFCA4 0xE17B +0xFCA5 0x61D0 +0xFCA6 0x3932 +0xFCA7 0xFCA8 0xE17F +0xFCA9 0x6023 +0xFCAA 0x615C +0xFCAB 0x651E +0xFCAC 0x638B +0xFCAD 0xE185 +0xFCAE 0x62C5 +0xFCAF 0xE187 +0xFCB0 0x62D5 +0xFCB1 0xE189 +0xFCB2 0x636C +0xFCB3 0xE18B +0xFCB4 0x3A17 +0xFCB5 0x6438 +0xFCB6 0x63F8 +0xFCB7 0xFCB8 0xE18F +0xFCB9 0x6490 +0xFCBA 0x6F8A +0xFCBB 0xE193 +0xFCBC 0x9814 +0xFCBD 0xFCBE 0xE195 +0xFCBF 0x64E1 +0xFCC0 0x64E5 +0xFCC1 0x947B +0xFCC2 0x3A66 +0xFCC3 0x643A +0xFCC4 0x3A57 +0xFCC5 0x654D +0xFCC6 0x6F16 +0xFCC7 0xFCC8 0xE19F +0xFCC9 0x6585 +0xFCCA 0x656D +0xFCCB 0x655F +0xFCCC 0xE1A4 +0xFCCD 0x65B5 +0xFCCE 0xE1A6 +0xFCCF 0x4B37 +0xFCD0 0x65D1 +0xFCD1 0x40D8 +0xFCD2 0xE1AA +0xFCD3 0x65E0 +0xFCD4 0x65E3 +0xFCD5 0x5FDF +0xFCD6 0xE1AE +0xFCD7 0x6618 +0xFCD8 0xFCD9 0xE1B0 +0xFCDA 0x6644 +0xFCDB 0xFCDC 0xE1B3 +0xFCDD 0x664B +0xFCDE 0xE1B6 +0xFCDF 0x6667 +0xFCE0 0xE1B8 +0xFCE1 0xFCE2 0x6673 +0xFCE3 0xFCE7 0xE1BB +0xFCE8 0x77C5 +0xFCE9 0xE1C1 +0xFCEA 0x99A4 +0xFCEB 0x6702 +0xFCEC 0xFCED 0xE1C4 +0xFCEE 0x3B2B +0xFCEF 0x69FA +0xFCF0 0xE1C8 +0xFCF1 0x675E +0xFCF2 0x6767 +0xFCF3 0x6762 +0xFCF4 0xFCF5 0xE1CC +0xFCF6 0x67D7 +0xFCF7 0x44E9 +0xFCF8 0x6822 +0xFCF9 0x6E50 +0xFCFA 0x923C +0xFCFB 0x6801 +0xFCFC 0xFCFD 0xE1D4 +0xFCFE 0x685D +0xFD40 0xE1D7 +0xFD41 0x69E1 +0xFD42 0x6A0B +0xFD43 0xE1DA +0xFD44 0x6973 +0xFD45 0x68C3 +0xFD46 0xE1DD +0xFD47 0x6901 +0xFD48 0x6900 +0xFD49 0x3D32 +0xFD4A 0x3A01 +0xFD4B 0xE1E2 +0xFD4C 0x3B80 +0xFD4D 0x67AC +0xFD4E 0x6961 +0xFD4F 0xE1E6 +0xFD50 0x42FC +0xFD51 0x6936 +0xFD52 0x6998 +0xFD53 0x3BA1 +0xFD54 0xE1EB +0xFD55 0x8363 +0xFD56 0x5090 +0xFD57 0x69F9 +0xFD58 0xFD59 0xE1EF +0xFD5A 0x6A45 +0xFD5B 0xE1F2 +0xFD5C 0x6A9D +0xFD5D 0x3BF3 +0xFD5E 0x67B1 +0xFD5F 0x6AC8 +0xFD60 0xE1F7 +0xFD61 0x3C0D +0xFD62 0x6B1D +0xFD63 0xE1FA +0xFD64 0x60DE +0xFD65 0x6B35 +0xFD66 0x6B74 +0xFD67 0xE1FE +0xFD68 0x6EB5 +0xFD69 0xFD6B 0xE200 +0xFD6C 0x3740 +0xFD6D 0x5421 +0xFD6E 0xE205 +0xFD6F 0x6BE1 +0xFD70 0xE207 +0xFD71 0x6BDC +0xFD72 0x6C37 +0xFD73 0xFD75 0xE20A +0xFD76 0x6C5A +0xFD77 0x8226 +0xFD78 0x6C79 +0xFD79 0xE210 +0xFD7A 0x44C5 +0xFD7B 0xFD7E 0xE212 +0xFDA1 0xE216 +0xFDA2 0x36E5 +0xFDA3 0x3CEB +0xFDA4 0xE219 +0xFDA5 0x9B83 +0xFDA6 0xFDA7 0xE21B +0xFDA8 0x7F8F +0xFDA9 0x6837 +0xFDAA 0xFDAC 0xE21F +0xFDAD 0x6D96 +0xFDAE 0x6D5C +0xFDAF 0x6E7C +0xFDB0 0x6F04 +0xFDB1 0xFDB3 0xE226 +0xFDB4 0x8533 +0xFDB5 0xE22A +0xFDB6 0x51C7 +0xFDB7 0x6C9C +0xFDB8 0x6E1D +0xFDB9 0x842E +0xFDBA 0xE22F +0xFDBB 0x6E2F +0xFDBC 0xE231 +0xFDBD 0x7453 +0xFDBE 0xE233 +0xFDBF 0x79CC +0xFDC0 0x6E4F +0xFDC1 0x5A91 +0xFDC2 0xE237 +0xFDC3 0x6FF8 +0xFDC4 0x370D +0xFDC5 0x6F9D +0xFDC6 0xE23B +0xFDC7 0x6EFA +0xFDC8 0xFDC9 0xE23D +0xFDCA 0x4555 +0xFDCB 0x93F0 +0xFDCC 0x6F44 +0xFDCD 0x6F5C +0xFDCE 0x3D4E +0xFDCF 0x6F74 +0xFDD0 0xE245 +0xFDD1 0x3D3B +0xFDD2 0x6F9F +0xFDD3 0xE248 +0xFDD4 0x6FD3 +0xFDD5 0xFDDA 0xE24A +0xFDDB 0x51DF +0xFDDC 0xFDDF 0xE251 +0xFDE0 0x704B +0xFDE1 0x707E +0xFDE2 0x70A7 +0xFDE3 0x7081 +0xFDE4 0x70CC +0xFDE5 0xFDE6 0x70D5 +0xFDE7 0x70DF +0xFDE8 0x4104 +0xFDE9 0x3DE8 +0xFDEA 0x71B4 +0xFDEB 0x7196 +0xFDEC 0xE261 +0xFDED 0x712B +0xFDEE 0x7145 +0xFDEF 0x5A88 +0xFDF0 0x714A +0xFDF1 0x716E +0xFDF2 0x5C9C +0xFDF3 0xE268 +0xFDF4 0x714F +0xFDF5 0x9362 +0xFDF6 0xE26B +0xFDF7 0x712C +0xFDF8 0xFDFA 0xE26D +0xFDFB 0x71BA +0xFDFC 0xE271 +0xFDFD 0x70BD +0xFDFE 0x720E +0xFE40 0x9442 +0xFE41 0x7215 +0xFE42 0x5911 +0xFE43 0x9443 +0xFE44 0x7224 +0xFE45 0x9341 +0xFE46 0xE27A +0xFE47 0x722E +0xFE48 0x7240 +0xFE49 0xE27D +0xFE4A 0x68BD +0xFE4B 0x7255 +0xFE4C 0x7257 +0xFE4D 0x3E55 +0xFE4E 0xE282 +0xFE4F 0x680D +0xFE50 0x6F3D +0xFE51 0x7282 +0xFE52 0xFE53 0x732A +0xFE54 0xFE55 0xE288 +0xFE56 0x48ED +0xFE57 0xE28B +0xFE58 0x7328 +0xFE59 0x732E +0xFE5A 0x73CF +0xFE5B 0x73AA +0xFE5C 0xFE5D 0xE290 +0xFE5E 0x73C9 +0xFE5F 0x7449 +0xFE60 0xFE62 0xE294 +0xFE63 0x6623 +0xFE64 0x36C5 +0xFE65 0xFE67 0xE299 +0xFE68 0x73F7 +0xFE69 0x7415 +0xFE6A 0x6903 +0xFE6B 0xE29F +0xFE6C 0x7439 +0xFE6D 0xE2A1 +0xFE6E 0x3ED7 +0xFE6F 0x745C +0xFE70 0xE2A4 +0xFE71 0x7460 +0xFE72 0xE2A6 +0xFE73 0x7447 +0xFE74 0x73E4 +0xFE75 0x7476 +0xFE76 0x83B9 +0xFE77 0x746C +0xFE78 0x3730 +0xFE79 0x7474 +0xFE7A 0x93F1 +0xFE7B 0x6A2C +0xFE7C 0x7482 +0xFE7D 0x4953 +0xFE7E 0xE2B2 +0xFEA1 0xFEA3 0xE2B3 +0xFEA4 0x5B46 +0xFEA5 0xFEA6 0xE2B7 +0xFEA7 0x74C8 +0xFEA8 0xE2BA +0xFEA9 0x750E +0xFEAA 0x74E9 +0xFEAB 0x751E +0xFEAC 0xFEAD 0xE2BE +0xFEAE 0x5BD7 +0xFEAF 0xE2C1 +0xFEB0 0x9385 +0xFEB1 0x754D +0xFEB2 0x754A +0xFEB3 0x7567 +0xFEB4 0x756E +0xFEB5 0xE2C7 +0xFEB6 0x3F04 +0xFEB7 0xE2C9 +0xFEB8 0x758E +0xFEB9 0x745D +0xFEBA 0x759E +0xFEBB 0x75B4 +0xFEBC 0x7602 +0xFEBD 0x762C +0xFEBE 0x7651 +0xFEBF 0x764F +0xFEC0 0x766F +0xFEC1 0x7676 +0xFEC2 0xE2D4 +0xFEC3 0x7690 +0xFEC4 0x81EF +0xFEC5 0x37F8 +0xFEC6 0xFEC7 0xE2D8 +0xFEC8 0x76A1 +0xFEC9 0x76A5 +0xFECA 0x76B7 +0xFECB 0x76CC +0xFECC 0xE2DE +0xFECD 0x8462 +0xFECE 0xFED0 0xE2E0 +0xFED1 0x771E +0xFED2 0x7726 +0xFED3 0x7740 +0xFED4 0x64AF +0xFED5 0xE2E7 +0xFED6 0x7758 +0xFED7 0xE2E9 +0xFED8 0x77AF +0xFED9 0xFEDB 0xE2EB +0xFEDC 0x77F4 +0xFEDD 0x7809 +0xFEDE 0xFEDF 0xE2F0 +0xFEE0 0x68CA +0xFEE1 0x78AF +0xFEE2 0x78C7 +0xFEE3 0x78D3 +0xFEE4 0x96A5 +0xFEE5 0x792E +0xFEE6 0xE2F8 +0xFEE7 0x78D7 +0xFEE8 0x7934 +0xFEE9 0x78B1 +0xFEEA 0xE2FC +0xFEEB 0x8FB8 +0xFEEC 0x8884 +0xFEED 0xFEEF 0xE2FF +0xFEF0 0x7986 +0xFEF1 0x8900 +0xFEF2 0x6902 +0xFEF3 0x7980 +0xFEF4 0xE306 +0xFEF5 0x799D +0xFEF6 0xE308 +0xFEF7 0x793C +0xFEF8 0x79A9 +0xFEF9 0x6E2A +0xFEFA 0xE30C +0xFEFB 0x3EA8 +0xFEFC 0x79C6 +0xFEFD 0xE30F +0xFEFE 0x79D4 +ENDMAPPING +# there's no EID for Big5HKSCS in Truetype. Just use the one for Big5. +STARTMAPPING cmap 3 4 +# just the identity mapping +ENDMAPPING +ENDENCODING Index: xc/fonts/encodings/large/gb18030.2000-0.enc diff -u /dev/null xc/fonts/encodings/large/gb18030.2000-0.enc:1.1 --- /dev/null Sat Feb 28 21:41:02 2004 +++ xc/fonts/encodings/large/gb18030.2000-0.enc Sun Oct 19 14:34:43 2003 @@ -0,0 +1,12254 @@ +# Contributed by James Su +# $XFree86: xc/fonts/encodings/large/gb18030.2000-0.enc,v 1.1 2003/10/19 18:34:43 dawes Exp $ +STARTENCODING gb18030.2000-0 +SIZE 0xFF 0xFF +FIRSTINDEX 0x81 0x40 +STARTMAPPING unicode +UNDEFINE 0 0xFEFE +0x8140 0x4E02 +0x8141 0x8143 0x4E04 +0x8144 0x4E0F +0x8145 0x4E12 +0x8146 0x4E17 +0x8147 0x8149 0x4E1F +0x814A 0x4E23 +0x814B 0x4E26 +0x814C 0x4E29 +0x814D 0x814E 0x4E2E +0x814F 0x4E31 +0x8150 0x4E33 +0x8151 0x4E35 +0x8152 0x4E37 +0x8153 0x4E3C +0x8154 0x8156 0x4E40 +0x8157 0x4E44 +0x8158 0x4E46 +0x8159 0x4E4A +0x815A 0x4E51 +0x815B 0x4E55 +0x815C 0x4E57 +0x815D 0x815E 0x4E5A +0x815F 0x8162 0x4E62 +0x8163 0x8164 0x4E67 +0x8165 0x816A 0x4E6A +0x816B 0x4E72 +0x816C 0x8175 0x4E74 +0x8176 0x817C 0x4E7F +0x817D 0x4E87 +0x817E 0x4E8A +0x8180 0x4E90 +0x8181 0x8182 0x4E96 +0x8183 0x4E99 +0x8184 0x8186 0x4E9C +0x8187 0x4EA3 +0x8188 0x4EAA +0x8189 0x818B 0x4EAF +0x818C 0x4EB4 +0x818D 0x8190 0x4EB6 +0x8191 0x8193 0x4EBC +0x8194 0x4EC8 +0x8195 0x4ECC +0x8196 0x8197 0x4ECF +0x8198 0x4ED2 +0x8199 0x819B 0x4EDA +0x819C 0x4EE0 +0x819D 0x4EE2 +0x819E 0x819F 0x4EE6 +0x81A0 0x4EE9 +0x81A1 0x81A3 0x4EED +0x81A4 0x4EF1 +0x81A5 0x4EF4 +0x81A6 0x81A8 0x4EF8 +0x81A9 0x4EFC +0x81AA 0x4EFE +0x81AB 0x4F00 +0x81AC 0x81B2 0x4F02 +0x81B3 0x81B4 0x4F0B +0x81B5 0x81B9 0x4F12 +0x81BA 0x81BB 0x4F1C +0x81BC 0x4F21 +0x81BD 0x4F23 +0x81BE 0x81BF 0x4F28 +0x81C0 0x81C2 0x4F2C +0x81C3 0x4F31 +0x81C4 0x4F33 +0x81C5 0x4F35 +0x81C6 0x4F37 +0x81C7 0x4F39 +0x81C8 0x4F3B +0x81C9 0x81CD 0x4F3E +0x81CE 0x81CF 0x4F44 +0x81D0 0x81D5 0x4F47 +0x81D6 0x4F52 +0x81D7 0x4F54 +0x81D8 0x4F56 +0x81D9 0x81DA 0x4F61 +0x81DB 0x4F66 +0x81DC 0x4F68 +0x81DD 0x81DE 0x4F6A +0x81DF 0x81E0 0x4F6D +0x81E1 0x81E2 0x4F71 +0x81E3 0x4F75 +0x81E4 0x81E7 0x4F77 +0x81E8 0x4F7D +0x81E9 0x81EB 0x4F80 +0x81EC 0x81EE 0x4F85 +0x81EF 0x4F8A +0x81F0 0x4F8C +0x81F1 0x4F8E +0x81F2 0x4F90 +0x81F3 0x81F4 0x4F92 +0x81F5 0x81F6 0x4F95 +0x81F7 0x81F9 0x4F98 +0x81FA 0x4F9C +0x81FB 0x81FC 0x4F9E +0x81FD 0x81FE 0x4FA1 +0x8240 0x4FA4 +0x8241 0x4FAB +0x8242 0x4FAD +0x8243 0x8247 0x4FB0 +0x8248 0x8250 0x4FB6 +0x8251 0x8253 0x4FC0 +0x8254 0x8257 0x4FC6 +0x8258 0x825A 0x4FCB +0x825B 0x825F 0x4FD2 +0x8260 0x4FD9 +0x8261 0x4FDB +0x8262 0x4FE0 +0x8263 0x4FE2 +0x8264 0x8265 0x4FE4 +0x8266 0x4FE7 +0x8267 0x8268 0x4FEB +0x8269 0x4FF0 +0x826A 0x4FF2 +0x826B 0x826E 0x4FF4 +0x826F 0x4FF9 +0x8270 0x8272 0x4FFB +0x8273 0x827E 0x4FFF +0x8280 0x500B +0x8281 0x500E +0x8282 0x8283 0x5010 +0x8284 0x5013 +0x8285 0x8287 0x5015 +0x8288 0x501B +0x8289 0x828A 0x501D +0x828B 0x5020 +0x828C 0x828E 0x5022 +0x828F 0x5027 +0x8290 0x502B +0x8291 0x829B 0x502F +0x829C 0x503B +0x829D 0x503D +0x829E 0x82A1 0x503F +0x82A2 0x82A4 0x5044 +0x82A5 0x82A7 0x5049 +0x82A8 0x504D +0x82A9 0x82AD 0x5050 +0x82AE 0x82B1 0x5056 +0x82B2 0x505B +0x82B3 0x82BA 0x505D +0x82BB 0x82C0 0x5066 +0x82C1 0x82C9 0x506D +0x82CA 0x82CC 0x5078 +0x82CD 0x82CE 0x507C +0x82CF 0x82D2 0x5081 +0x82D3 0x82D4 0x5086 +0x82D5 0x82D8 0x5089 +0x82D9 0x82ED 0x508E +0x82EE 0x50A4 +0x82EF 0x50A6 +0x82F0 0x82F1 0x50AA +0x82F2 0x82F6 0x50AD +0x82F7 0x82FD 0x50B3 +0x82FE 0x50BC +0x8340 0x8351 0x50BD +0x8352 0x8357 0x50D0 +0x8358 0x835A 0x50D7 +0x835B 0x8365 0x50DB +0x8366 0x8369 0x50E8 +0x836A 0x836D 0x50EF +0x836E 0x50F4 +0x836F 0x8373 0x50F6 +0x8374 0x837D 0x50FC +0x837E 0x5108 +0x8380 0x8381 0x5109 +0x8382 0x8387 0x510C +0x8388 0x8395 0x5113 +0x8396 0x83B2 0x5122 +0x83B3 0x5142 +0x83B4 0x5147 +0x83B5 0x514A +0x83B6 0x514C +0x83B7 0x83B9 0x514E +0x83BA 0x83BB 0x5152 +0x83BC 0x83BE 0x5157 +0x83BF 0x515B +0x83C0 0x83C4 0x515D +0x83C5 0x83C6 0x5163 +0x83C7 0x83C8 0x5166 +0x83C9 0x83CA 0x5169 +0x83CB 0x516F +0x83CC 0x5172 +0x83CD 0x517A +0x83CE 0x83CF 0x517E +0x83D0 0x83D1 0x5183 +0x83D2 0x83D3 0x5186 +0x83D4 0x83D5 0x518A +0x83D6 0x83D9 0x518E +0x83DA 0x83DB 0x5193 +0x83DC 0x5198 +0x83DD 0x519A +0x83DE 0x83E0 0x519D +0x83E1 0x51A1 +0x83E2 0x51A3 +0x83E3 0x83E7 0x51A6 +0x83E8 0x83E9 0x51AD +0x83EA 0x51B4 +0x83EB 0x83ED 0x51B8 +0x83EE 0x83EF 0x51BE +0x83F0 0x83F2 0x51C1 +0x83F3 0x51C5 +0x83F4 0x51C8 +0x83F5 0x51CA +0x83F6 0x83F7 0x51CD +0x83F8 0x51D0 +0x83F9 0x83FE 0x51D2 +0x8440 0x8442 0x51D8 +0x8443 0x51DC +0x8444 0x8445 0x51DE +0x8446 0x8447 0x51E2 +0x8448 0x844D 0x51E5 +0x844E 0x51EC +0x844F 0x51EE +0x8450 0x8451 0x51F1 +0x8452 0x51F4 +0x8453 0x51F7 +0x8454 0x51FE +0x8455 0x8456 0x5204 +0x8457 0x5209 +0x8458 0x8459 0x520B +0x845A 0x845B 0x520F +0x845C 0x845E 0x5213 +0x845F 0x521C +0x8460 0x8461 0x521E +0x8462 0x8464 0x5221 +0x8465 0x8467 0x5225 +0x8468 0x522A +0x8469 0x522C +0x846A 0x522F +0x846B 0x846C 0x5231 +0x846D 0x846E 0x5234 +0x846F 0x523C +0x8470 0x523E +0x8471 0x8476 0x5244 +0x8477 0x524B +0x8478 0x8479 0x524E +0x847A 0x847B 0x5252 +0x847C 0x5255 +0x847D 0x847E 0x5257 +0x8480 0x8482 0x5259 +0x8483 0x525D +0x8484 0x8485 0x525F +0x8486 0x8488 0x5262 +0x8489 0x5266 +0x848A 0x5268 +0x848B 0x848E 0x526B +0x848F 0x8490 0x5270 +0x8491 0x849A 0x5273 +0x849B 0x527E +0x849C 0x5280 +0x849D 0x84A1 0x5283 +0x84A2 0x84A8 0x5289 +0x84A9 0x84AA 0x5291 +0x84AB 0x84B1 0x5294 +0x84B2 0x529C +0x84B3 0x84B6 0x52A4 +0x84B7 0x84B9 0x52AE +0x84BA 0x84C3 0x52B4 +0x84C4 0x84C6 0x52C0 +0x84C7 0x84C9 0x52C4 +0x84CA 0x52C8 +0x84CB 0x52CA +0x84CC 0x84CF 0x52CC +0x84D0 0x52D1 +0x84D1 0x84D3 0x52D3 +0x84D4 0x52D7 +0x84D5 0x84DA 0x52D9 +0x84DB 0x84DE 0x52E0 +0x84DF 0x84E9 0x52E5 +0x84EA 0x84F1 0x52F1 +0x84F2 0x84F4 0x52FB +0x84F5 0x84F8 0x5301 +0x84F9 0x5307 +0x84FA 0x84FD 0x5309 +0x84FE 0x530E +0x8540 0x8543 0x5311 +0x8544 0x5318 +0x8545 0x8546 0x531B +0x8547 0x8548 0x531E +0x8549 0x5322 +0x854A 0x854B 0x5324 +0x854C 0x854E 0x5327 +0x854F 0x8551 0x532B +0x8552 0x855B 0x532F +0x855C 0x855D 0x533C +0x855E 0x5340 +0x855F 0x5342 +0x8560 0x5344 +0x8561 0x5346 +0x8562 0x8564 0x534B +0x8565 0x5350 +0x8566 0x5354 +0x8567 0x8568 0x5358 +0x8569 0x535B +0x856A 0x535D +0x856B 0x5365 +0x856C 0x5368 +0x856D 0x536A +0x856E 0x856F 0x536C +0x8570 0x5372 +0x8571 0x5376 +0x8572 0x5379 +0x8573 0x8576 0x537B +0x8577 0x8578 0x5380 +0x8579 0x5383 +0x857A 0x857B 0x5387 +0x857C 0x538A +0x857D 0x857E 0x538E +0x8580 0x8584 0x5390 +0x8585 0x8586 0x5396 +0x8587 0x5399 +0x8588 0x8589 0x539B +0x858A 0x539E +0x858B 0x858C 0x53A0 +0x858D 0x53A4 +0x858E 0x53A7 +0x858F 0x8592 0x53AA +0x8593 0x8599 0x53AF +0x859A 0x859D 0x53B7 +0x859E 0x85A0 0x53BC +0x85A1 0x53C0 +0x85A2 0x85A6 0x53C3 +0x85A7 0x85A9 0x53CE +0x85AA 0x85AB 0x53D2 +0x85AC 0x53D5 +0x85AD 0x53DA +0x85AE 0x85B0 0x53DC +0x85B1 0x85B2 0x53E1 +0x85B3 0x53E7 +0x85B4 0x53F4 +0x85B5 0x53FA +0x85B6 0x85B8 0x53FE +0x85B9 0x5402 +0x85BA 0x5405 +0x85BB 0x5407 +0x85BC 0x540B +0x85BD 0x5414 +0x85BE 0x85C0 0x5418 +0x85C1 0x541C +0x85C2 0x5422 +0x85C3 0x85C4 0x5424 +0x85C5 0x542A +0x85C6 0x5430 +0x85C7 0x5433 +0x85C8 0x85C9 0x5436 +0x85CA 0x543A +0x85CB 0x543D +0x85CC 0x543F +0x85CD 0x85CE 0x5441 +0x85CF 0x85D0 0x5444 +0x85D1 0x5447 +0x85D2 0x5449 +0x85D3 0x85D6 0x544C +0x85D7 0x5451 +0x85D8 0x545A +0x85D9 0x85DD 0x545D +0x85DE 0x5463 +0x85DF 0x5465 +0x85E0 0x5467 +0x85E1 0x85E8 0x5469 +0x85E9 0x5474 +0x85EA 0x85EB 0x5479 +0x85EC 0x85ED 0x547E +0x85EE 0x5481 +0x85EF 0x5483 +0x85F0 0x5485 +0x85F1 0x85F4 0x5487 +0x85F5 0x548D +0x85F6 0x5491 +0x85F7 0x5493 +0x85F8 0x85F9 0x5497 +0x85FA 0x549C +0x85FB 0x85FE 0x549E +0x8640 0x54A2 +0x8641 0x54A5 +0x8642 0x54AE +0x8643 0x54B0 +0x8644 0x54B2 +0x8645 0x8647 0x54B5 +0x8648 0x8649 0x54B9 +0x864A 0x54BC +0x864B 0x54BE +0x864C 0x54C3 +0x864D 0x54C5 +0x864E 0x864F 0x54CA +0x8650 0x54D6 +0x8651 0x54D8 +0x8652 0x54DB +0x8653 0x8657 0x54E0 +0x8658 0x8659 0x54EB +0x865A 0x865C 0x54EF +0x865D 0x8662 0x54F4 +0x8663 0x54FB +0x8664 0x54FE +0x8665 0x5500 +0x8666 0x8669 0x5502 +0x866A 0x5508 +0x866B 0x866F 0x550A +0x8670 0x8671 0x5512 +0x8672 0x8677 0x5515 +0x8678 0x867B 0x551C +0x867C 0x5521 +0x867D 0x867E 0x5525 +0x8680 0x8681 0x5528 +0x8682 0x552B +0x8683 0x552D +0x8684 0x5532 +0x8685 0x8687 0x5534 +0x8688 0x868B 0x5538 +0x868C 0x553D +0x868D 0x5540 +0x868E 0x5542 +0x868F 0x5545 +0x8690 0x8691 0x5547 +0x8692 0x8696 0x554B +0x8697 0x869A 0x5551 +0x869B 0x869F 0x5557 +0x86A0 0x86A3 0x555D +0x86A4 0x86A5 0x5562 +0x86A6 0x86A7 0x5568 +0x86A8 0x556B +0x86A9 0x86AE 0x556F +0x86AF 0x86B0 0x5579 +0x86B1 0x557D +0x86B2 0x557F +0x86B3 0x86B4 0x5585 +0x86B5 0x86B7 0x558C +0x86B8 0x5590 +0x86B9 0x86BA 0x5592 +0x86BB 0x86BD 0x5595 +0x86BE 0x86BF 0x559A +0x86C0 0x559E +0x86C1 0x86C7 0x55A0 +0x86C8 0x86D0 0x55A8 +0x86D1 0x55B2 +0x86D2 0x55B4 +0x86D3 0x55B6 +0x86D4 0x55B8 +0x86D5 0x55BA +0x86D6 0x55BC +0x86D7 0x86DB 0x55BF +0x86DC 0x86DE 0x55C6 +0x86DF 0x86E0 0x55CA +0x86E1 0x86E3 0x55CE +0x86E4 0x55D5 +0x86E5 0x86E9 0x55D7 +0x86EA 0x55DE +0x86EB 0x55E0 +0x86EC 0x55E2 +0x86ED 0x55E7 +0x86EE 0x55E9 +0x86EF 0x86F0 0x55ED +0x86F1 0x86F2 0x55F0 +0x86F3 0x55F4 +0x86F4 0x55F6 +0x86F5 0x86F9 0x55F8 +0x86FA 0x55FF +0x86FB 0x86FE 0x5602 +0x8740 0x8741 0x5606 +0x8742 0x8743 0x560A +0x8744 0x560D +0x8745 0x874C 0x5610 +0x874D 0x874E 0x5619 +0x874F 0x8750 0x561C +0x8751 0x8753 0x5620 +0x8754 0x8755 0x5625 +0x8756 0x8759 0x5628 +0x875A 0x875C 0x562E +0x875D 0x5633 +0x875E 0x5635 +0x875F 0x8760 0x5637 +0x8761 0x563A +0x8762 0x8764 0x563C +0x8765 0x8770 0x5640 +0x8771 0x8775 0x564F +0x8776 0x8777 0x5655 +0x8778 0x8779 0x565A +0x877A 0x877E 0x565D +0x8780 0x5663 +0x8781 0x8783 0x5665 +0x8784 0x8787 0x566D +0x8788 0x878B 0x5672 +0x878C 0x878F 0x5677 +0x8790 0x8797 0x567D +0x8798 0x879E 0x5687 +0x879F 0x87A1 0x5690 +0x87A2 0x87B0 0x5694 +0x87B1 0x87BB 0x56A4 +0x87BC 0x87C2 0x56B0 +0x87C3 0x87C6 0x56B8 +0x87C7 0x87D3 0x56BD +0x87D4 0x87DC 0x56CB +0x87DD 0x87DE 0x56D5 +0x87DF 0x87E0 0x56D8 +0x87E1 0x56DC +0x87E2 0x56E3 +0x87E3 0x87E8 0x56E5 +0x87E9 0x56EC +0x87EA 0x87EB 0x56EE +0x87EC 0x87ED 0x56F2 +0x87EE 0x87F0 0x56F6 +0x87F1 0x87F2 0x56FB +0x87F3 0x87F5 0x5700 +0x87F6 0x5705 +0x87F7 0x5707 +0x87F8 0x87FE 0x570B +0x8840 0x8849 0x5712 +0x884A 0x884B 0x571D +0x884C 0x884E 0x5720 +0x884F 0x8852 0x5724 +0x8853 0x572B +0x8854 0x8855 0x5731 +0x8856 0x885A 0x5734 +0x885B 0x885C 0x573C +0x885D 0x573F +0x885E 0x5741 +0x885F 0x8862 0x5743 +0x8863 0x8864 0x5748 +0x8865 0x574B +0x8866 0x886A 0x5752 +0x886B 0x886C 0x5758 +0x886D 0x886E 0x5762 +0x886F 0x5765 +0x8870 0x5767 +0x8871 0x576C +0x8872 0x576E +0x8873 0x8875 0x5770 +0x8876 0x8877 0x5774 +0x8878 0x887A 0x5778 +0x887B 0x887E 0x577D +0x8880 0x5781 +0x8881 0x8884 0x5787 +0x8885 0x8889 0x578D +0x888A 0x8890 0x5794 +0x8891 0x8894 0x579C +0x8895 0x57A5 +0x8896 0x57A8 +0x8897 0x57AA +0x8898 0x57AC +0x8899 0x889B 0x57AF +0x889C 0x57B3 +0x889D 0x889F 0x57B5 +0x88A0 0x88A8 0x57B9 +0x88A9 0x88AF 0x57C4 +0x88B0 0x88B1 0x57CC +0x88B2 0x88B3 0x57D0 +0x88B4 0x57D3 +0x88B5 0x88B6 0x57D6 +0x88B7 0x88B8 0x57DB +0x88B9 0x57DE +0x88BA 0x88BC 0x57E1 +0x88BD 0x88C4 0x57E5 +0x88C5 0x57EE +0x88C6 0x88C9 0x57F0 +0x88CA 0x88CC 0x57F5 +0x88CD 0x88CE 0x57FB +0x88CF 0x88D0 0x57FE +0x88D1 0x5801 +0x88D2 0x88D4 0x5803 +0x88D5 0x88D7 0x5808 +0x88D8 0x580C +0x88D9 0x88DB 0x580E +0x88DC 0x88DE 0x5812 +0x88DF 0x88E1 0x5816 +0x88E2 0x88E5 0x581A +0x88E6 0x581F +0x88E7 0x88E8 0x5822 +0x88E9 0x88ED 0x5825 +0x88EE 0x88F2 0x582B +0x88F3 0x88F6 0x5831 +0x88F7 0x88FE 0x5836 +0x8940 0x8945 0x583E +0x8946 0x894C 0x5845 +0x894D 0x894F 0x584E +0x8950 0x8951 0x5852 +0x8952 0x8954 0x5855 +0x8955 0x8959 0x5859 +0x895A 0x895F 0x585F +0x8960 0x8964 0x5866 +0x8965 0x8975 0x586D +0x8976 0x587F +0x8977 0x5882 +0x8978 0x5884 +0x8979 0x897B 0x5886 +0x897C 0x897E 0x588A +0x8980 0x8984 0x588D +0x8985 0x8989 0x5894 +0x898A 0x898C 0x589B +0x898D 0x8994 0x58A0 +0x8995 0x89A6 0x58AA +0x89A7 0x89AA 0x58BD +0x89AB 0x89AD 0x58C2 +0x89AE 0x89B8 0x58C6 +0x89B9 0x89BB 0x58D2 +0x89BC 0x89C9 0x58D6 +0x89CA 0x89CF 0x58E5 +0x89D0 0x58ED +0x89D1 0x58EF +0x89D2 0x89D3 0x58F1 +0x89D4 0x89D5 0x58F4 +0x89D6 0x89D7 0x58F7 +0x89D8 0x89DF 0x58FA +0x89E0 0x5903 +0x89E1 0x89E2 0x5905 +0x89E3 0x89E7 0x5908 +0x89E8 0x590E +0x89E9 0x89EC 0x5910 +0x89ED 0x89EE 0x5917 +0x89EF 0x591B +0x89F0 0x89F1 0x591D +0x89F2 0x89F5 0x5920 +0x89F6 0x5926 +0x89F7 0x5928 +0x89F8 0x592C +0x89F9 0x5930 +0x89FA 0x89FB 0x5932 +0x89FC 0x89FD 0x5935 +0x89FE 0x593B +0x8A40 0x8A43 0x593D +0x8A44 0x5943 +0x8A45 0x8A46 0x5945 +0x8A47 0x594A +0x8A48 0x8A49 0x594C +0x8A4A 0x5950 +0x8A4B 0x8A4C 0x5952 +0x8A4D 0x5959 +0x8A4E 0x8A52 0x595B +0x8A53 0x5961 +0x8A54 0x8A55 0x5963 +0x8A56 0x8A62 0x5966 +0x8A63 0x5975 +0x8A64 0x5977 +0x8A65 0x8A67 0x597A +0x8A68 0x8A6A 0x597E +0x8A6B 0x5985 +0x8A6C 0x5989 +0x8A6D 0x8A6E 0x598B +0x8A6F 0x8A72 0x598E +0x8A73 0x8A74 0x5994 +0x8A75 0x5998 +0x8A76 0x8A79 0x599A +0x8A7A 0x8A7D 0x599F +0x8A7E 0x59A6 +0x8A80 0x59A7 +0x8A81 0x8A82 0x59AC +0x8A83 0x8A84 0x59B0 +0x8A85 0x8A8A 0x59B3 +0x8A8B 0x59BA +0x8A8C 0x8A8D 0x59BC +0x8A8E 0x8A94 0x59BF +0x8A95 0x8A97 0x59C7 +0x8A98 0x8A9B 0x59CC +0x8A9C 0x8A9D 0x59D5 +0x8A9E 0x59D9 +0x8A9F 0x59DB +0x8AA0 0x8AA4 0x59DE +0x8AA5 0x59E4 +0x8AA6 0x8AA7 0x59E6 +0x8AA8 0x8AAA 0x59E9 +0x8AAB 0x8AB6 0x59ED +0x8AB7 0x59FA +0x8AB8 0x8ABA 0x59FC +0x8ABB 0x5A00 +0x8ABC 0x5A02 +0x8ABD 0x8ABE 0x5A0A +0x8ABF 0x8AC2 0x5A0D +0x8AC3 0x5A12 +0x8AC4 0x8AC7 0x5A14 +0x8AC8 0x8ACA 0x5A19 +0x8ACB 0x8ACC 0x5A1D +0x8ACD 0x8ACE 0x5A21 +0x8ACF 0x5A24 +0x8AD0 0x8AD2 0x5A26 +0x8AD3 0x8AD9 0x5A2A +0x8ADA 0x5A33 +0x8ADB 0x5A35 +0x8ADC 0x8AE0 0x5A37 +0x8AE1 0x8AE3 0x5A3D +0x8AE4 0x8AE8 0x5A41 +0x8AE9 0x8AEA 0x5A47 +0x8AEB 0x8AF4 0x5A4B +0x8AF5 0x8AF8 0x5A56 +0x8AF9 0x8AFE 0x5A5B +0x8B40 0x5A61 +0x8B41 0x8B44 0x5A63 +0x8B45 0x8B46 0x5A68 +0x8B47 0x8B4F 0x5A6B +0x8B50 0x8B51 0x5A78 +0x8B52 0x8B55 0x5A7B +0x8B56 0x8B67 0x5A80 +0x8B68 0x8B6E 0x5A93 +0x8B6F 0x8B7C 0x5A9C +0x8B7D 0x8B7E 0x5AAB +0x8B80 0x8B84 0x5AAD +0x8B85 0x5AB4 +0x8B86 0x8B87 0x5AB6 +0x8B88 0x8B8C 0x5AB9 +0x8B8D 0x8B8E 0x5ABF +0x8B8F 0x8B94 0x5AC3 +0x8B95 0x8B96 0x5ACA +0x8B97 0x8B9B 0x5ACD +0x8B9C 0x5AD3 +0x8B9D 0x5AD5 +0x8B9E 0x5AD7 +0x8B9F 0x8BA1 0x5AD9 +0x8BA2 0x8BA4 0x5ADD +0x8BA5 0x5AE2 +0x8BA6 0x8BA7 0x5AE4 +0x8BA8 0x8BA9 0x5AE7 +0x8BAA 0x5AEA +0x8BAB 0x8BAF 0x5AEC +0x8BB0 0x8BC6 0x5AF2 +0x8BC7 0x8BD2 0x5B0A +0x8BD3 0x8BEC 0x5B18 +0x8BED 0x5B33 +0x8BEE 0x8BEF 0x5B35 +0x8BF0 0x8BF7 0x5B38 +0x8BF8 0x8BFE 0x5B41 +0x8C40 0x8C47 0x5B48 +0x8C48 0x5B52 +0x8C49 0x5B56 +0x8C4A 0x5B5E +0x8C4B 0x8C4C 0x5B60 +0x8C4D 0x8C4E 0x5B67 +0x8C4F 0x5B6B +0x8C50 0x8C52 0x5B6D +0x8C53 0x5B72 +0x8C54 0x5B74 +0x8C55 0x8C58 0x5B76 +0x8C59 0x8C5A 0x5B7B +0x8C5B 0x8C5C 0x5B7E +0x8C5D 0x5B82 +0x8C5E 0x5B86 +0x8C5F 0x5B8A +0x8C60 0x8C61 0x5B8D +0x8C62 0x8C64 0x5B90 +0x8C65 0x5B94 +0x8C66 0x5B96 +0x8C67 0x5B9F +0x8C68 0x8C6A 0x5BA7 +0x8C6B 0x8C6E 0x5BAC +0x8C6F 0x8C70 0x5BB1 +0x8C71 0x5BB7 +0x8C72 0x8C74 0x5BBA +0x8C75 0x8C76 0x5BC0 +0x8C77 0x5BC3 +0x8C78 0x8C7B 0x5BC8 +0x8C7C 0x8C7E 0x5BCD +0x8C80 0x5BD1 +0x8C81 0x8C89 0x5BD4 +0x8C8A 0x5BE0 +0x8C8B 0x8C8C 0x5BE2 +0x8C8D 0x8C8E 0x5BE6 +0x8C8F 0x8C93 0x5BE9 +0x8C94 0x5BEF +0x8C95 0x8C9B 0x5BF1 +0x8C9C 0x8C9D 0x5BFD +0x8C9E 0x5C00 +0x8C9F 0x8CA0 0x5C02 +0x8CA1 0x5C05 +0x8CA2 0x8CA3 0x5C07 +0x8CA4 0x8CA7 0x5C0B +0x8CA8 0x5C10 +0x8CA9 0x8CAA 0x5C12 +0x8CAB 0x5C17 +0x8CAC 0x5C19 +0x8CAD 0x5C1B +0x8CAE 0x8CB1 0x5C1E +0x8CB2 0x5C23 +0x8CB3 0x5C26 +0x8CB4 0x8CB7 0x5C28 +0x8CB8 0x8CBB 0x5C2D +0x8CBC 0x8CBD 0x5C32 +0x8CBE 0x8CC0 0x5C35 +0x8CC1 0x8CC2 0x5C43 +0x8CC3 0x8CC4 0x5C46 +0x8CC5 0x8CC6 0x5C4C +0x8CC7 0x8CC9 0x5C52 +0x8CCA 0x8CCC 0x5C56 +0x8CCD 0x8CD0 0x5C5A +0x8CD1 0x5C5F +0x8CD2 0x5C62 +0x8CD3 0x5C64 +0x8CD4 0x8CDA 0x5C67 +0x8CDB 0x5C70 +0x8CDC 0x8CE2 0x5C72 +0x8CE3 0x8CE6 0x5C7B +0x8CE7 0x5C80 +0x8CE8 0x8CEC 0x5C83 +0x8CED 0x8CEF 0x5C89 +0x8CF0 0x8CF1 0x5C8E +0x8CF2 0x8CF3 0x5C92 +0x8CF4 0x5C95 +0x8CF5 0x8CF9 0x5C9D +0x8CFA 0x8CFE 0x5CA4 +0x8D40 0x5CAA +0x8D41 0x8D43 0x5CAE +0x8D44 0x5CB2 +0x8D45 0x5CB4 +0x8D46 0x5CB6 +0x8D47 0x8D4A 0x5CB9 +0x8D4B 0x5CBE +0x8D4C 0x5CC0 +0x8D4D 0x8D4E 0x5CC2 +0x8D4F 0x8D54 0x5CC5 +0x8D55 0x8D5A 0x5CCC +0x8D5B 0x8D60 0x5CD3 +0x8D61 0x8D67 0x5CDA +0x8D68 0x8D69 0x5CE2 +0x8D6A 0x5CE7 +0x8D6B 0x5CE9 +0x8D6C 0x8D6D 0x5CEB +0x8D6E 0x8D6F 0x5CEE +0x8D70 0x8D79 0x5CF1 +0x8D7A 0x8D7E 0x5CFC +0x8D80 0x5D01 +0x8D81 0x8D82 0x5D04 +0x8D83 0x8D88 0x5D08 +0x8D89 0x8D8D 0x5D0F +0x8D8E 0x5D15 +0x8D8F 0x8D92 0x5D17 +0x8D93 0x8D94 0x5D1C +0x8D95 0x8D99 0x5D1F +0x8D9A 0x5D25 +0x8D9B 0x5D28 +0x8D9C 0x8D9E 0x5D2A +0x8D9F 0x8DA3 0x5D2F +0x8DA4 0x8DAB 0x5D35 +0x8DAC 0x8DB3 0x5D3F +0x8DB4 0x8DB5 0x5D48 +0x8DB6 0x8DC0 0x5D4D +0x8DC1 0x8DC2 0x5D59 +0x8DC3 0x5D5C +0x8DC4 0x8DCE 0x5D5E +0x8DCF 0x5D6A +0x8DD0 0x8DD1 0x5D6D +0x8DD2 0x8DD5 0x5D70 +0x8DD6 0x8DE2 0x5D75 +0x8DE3 0x8DF8 0x5D83 +0x8DF9 0x8DFB 0x5D9A +0x8DFC 0x8DFE 0x5D9E +0x8E40 0x8E55 0x5DA1 +0x8E56 0x8E62 0x5DB8 +0x8E63 0x8E69 0x5DC6 +0x8E6A 0x8E76 0x5DCE +0x8E77 0x5DDC +0x8E78 0x8E79 0x5DDF +0x8E7A 0x8E7B 0x5DE3 +0x8E7C 0x5DEA +0x8E7D 0x8E7E 0x5DEC +0x8E80 0x5DF0 +0x8E81 0x8E82 0x5DF5 +0x8E83 0x8E87 0x5DF8 +0x8E88 0x8E89 0x5DFF +0x8E8A 0x5E04 +0x8E8B 0x5E07 +0x8E8C 0x8E8E 0x5E09 +0x8E8F 0x8E90 0x5E0D +0x8E91 0x8E92 0x5E12 +0x8E93 0x5E17 +0x8E94 0x8E9B 0x5E1E +0x8E9C 0x8EA0 0x5E28 +0x8EA1 0x8EA2 0x5E2F +0x8EA3 0x8EA7 0x5E32 +0x8EA8 0x8EA9 0x5E39 +0x8EAA 0x8EAD 0x5E3E +0x8EAE 0x5E43 +0x8EAF 0x8EB4 0x5E46 +0x8EB5 0x8EBB 0x5E4D +0x8EBC 0x8EC0 0x5E56 +0x8EC1 0x8EC2 0x5E5C +0x8EC3 0x8EC4 0x5E5F +0x8EC5 0x8ED3 0x5E63 +0x8ED4 0x5E75 +0x8ED5 0x5E77 +0x8ED6 0x5E79 +0x8ED7 0x5E7E +0x8ED8 0x8EDA 0x5E81 +0x8EDB 0x5E85 +0x8EDC 0x8EDD 0x5E88 +0x8EDE 0x8EE0 0x5E8C +0x8EE1 0x5E92 +0x8EE2 0x5E98 +0x8EE3 0x5E9B +0x8EE4 0x5E9D +0x8EE5 0x8EE8 0x5EA1 +0x8EE9 0x8EED 0x5EA8 +0x8EEE 0x8EF2 0x5EAE +0x8EF3 0x5EB4 +0x8EF4 0x8EF7 0x5EBA +0x8EF8 0x8EFE 0x5EBF +0x8F40 0x8F42 0x5EC6 +0x8F43 0x8F48 0x5ECB +0x8F49 0x8F4A 0x5ED4 +0x8F4B 0x8F4E 0x5ED7 +0x8F4F 0x8F5A 0x5EDC +0x8F5B 0x5EE9 +0x8F5C 0x8F64 0x5EEB +0x8F65 0x5EF5 +0x8F66 0x8F67 0x5EF8 +0x8F68 0x8F6A 0x5EFB +0x8F6B 0x8F6D 0x5F05 +0x8F6E 0x5F09 +0x8F6F 0x8F71 0x5F0C +0x8F72 0x5F10 +0x8F73 0x5F12 +0x8F74 0x5F14 +0x8F75 0x5F16 +0x8F76 0x8F77 0x5F19 +0x8F78 0x8F7A 0x5F1C +0x8F7B 0x8F7E 0x5F21 +0x8F80 0x5F28 +0x8F81 0x8F82 0x5F2B +0x8F83 0x5F2E +0x8F84 0x5F30 +0x8F85 0x8F8B 0x5F32 +0x8F8C 0x5F3B +0x8F8D 0x8F8F 0x5F3D +0x8F90 0x8F9E 0x5F41 +0x8F9F 0x5F51 +0x8FA0 0x5F54 +0x8FA1 0x8FA4 0x5F59 +0x8FA5 0x8FA7 0x5F5E +0x8FA8 0x5F63 +0x8FA9 0x5F65 +0x8FAA 0x8FAB 0x5F67 +0x8FAC 0x5F6B +0x8FAD 0x8FAE 0x5F6E +0x8FAF 0x5F72 +0x8FB0 0x8FB2 0x5F74 +0x8FB3 0x5F78 +0x8FB4 0x5F7A +0x8FB5 0x8FB7 0x5F7D +0x8FB8 0x5F83 +0x8FB9 0x5F86 +0x8FBA 0x8FBC 0x5F8D +0x8FBD 0x5F91 +0x8FBE 0x8FBF 0x5F93 +0x8FC0 0x5F96 +0x8FC1 0x8FC2 0x5F9A +0x8FC3 0x8FC6 0x5F9D +0x8FC7 0x8FCC 0x5FA2 +0x8FCD 0x5FA9 +0x8FCE 0x8FCF 0x5FAB +0x8FD0 0x8FD5 0x5FAF +0x8FD6 0x5FB6 +0x8FD7 0x8FDA 0x5FB8 +0x8FDB 0x8FDF 0x5FBE +0x8FE0 0x8FE1 0x5FC7 +0x8FE2 0x8FE3 0x5FCA +0x8FE4 0x5FCE +0x8FE5 0x8FE7 0x5FD3 +0x8FE8 0x8FEA 0x5FDA +0x8FEB 0x8FEC 0x5FDE +0x8FED 0x8FEE 0x5FE2 +0x8FEF 0x8FF0 0x5FE5 +0x8FF1 0x8FF2 0x5FE8 +0x8FF3 0x5FEC +0x8FF4 0x8FF5 0x5FEF +0x8FF6 0x8FF8 0x5FF2 +0x8FF9 0x8FFA 0x5FF6 +0x8FFB 0x8FFC 0x5FF9 +0x8FFD 0x5FFC +0x8FFE 0x6007 +0x9040 0x9041 0x6008 +0x9042 0x9043 0x600B +0x9044 0x9045 0x6010 +0x9046 0x6013 +0x9047 0x9048 0x6017 +0x9049 0x601A +0x904A 0x904B 0x601E +0x904C 0x904E 0x6022 +0x904F 0x9051 0x602C +0x9052 0x9056 0x6030 +0x9057 0x905B 0x6036 +0x905C 0x905D 0x603D +0x905E 0x6040 +0x905F 0x9065 0x6044 +0x9066 0x604C +0x9067 0x9068 0x604E +0x9069 0x6051 +0x906A 0x906B 0x6053 +0x906C 0x906E 0x6056 +0x906F 0x9070 0x605B +0x9071 0x9074 0x605E +0x9075 0x9076 0x6065 +0x9077 0x606E +0x9078 0x9079 0x6071 +0x907A 0x907B 0x6074 +0x907C 0x6077 +0x907D 0x607E +0x907E 0x6080 +0x9080 0x9081 0x6081 +0x9082 0x9085 0x6085 +0x9086 0x9087 0x608A +0x9088 0x908B 0x608E +0x908C 0x6093 +0x908D 0x6095 +0x908E 0x9090 0x6097 +0x9091 0x609C +0x9092 0x609E +0x9093 0x9094 0x60A1 +0x9095 0x9096 0x60A4 +0x9097 0x60A7 +0x9098 0x9099 0x60A9 +0x909A 0x60AE +0x909B 0x60B0 +0x909C 0x60B3 +0x909D 0x909F 0x60B5 +0x90A0 0x90A1 0x60B9 +0x90A2 0x90A9 0x60BD +0x90AA 0x90AC 0x60C7 +0x90AD 0x90B1 0x60CC +0x90B2 0x90B4 0x60D2 +0x90B5 0x90B6 0x60D6 +0x90B7 0x60D9 +0x90B8 0x60DB +0x90B9 0x60DE +0x90BA 0x90BE 0x60E1 +0x90BF 0x60EA +0x90C0 0x90C1 0x60F1 +0x90C2 0x60F5 +0x90C3 0x90C4 0x60F7 +0x90C5 0x90C9 0x60FB +0x90CA 0x90CD 0x6102 +0x90CE 0x6107 +0x90CF 0x90D1 0x610A +0x90D2 0x90D6 0x6110 +0x90D7 0x90DA 0x6116 +0x90DB 0x90DE 0x611B +0x90DF 0x90E0 0x6121 +0x90E1 0x6125 +0x90E2 0x90E4 0x6128 +0x90E5 0x90F7 0x612C +0x90F8 0x90FE 0x6140 +0x9140 0x6147 +0x9141 0x6149 +0x9142 0x614B +0x9143 0x614D +0x9144 0x9145 0x614F +0x9146 0x9148 0x6152 +0x9149 0x914F 0x6156 +0x9150 0x9153 0x615E +0x9154 0x9157 0x6163 +0x9158 0x915E 0x6169 +0x915F 0x9162 0x6171 +0x9163 0x6176 +0x9164 0x9176 0x6178 +0x9177 0x9178 0x618C +0x9179 0x917D 0x618F +0x917E 0x6195 +0x9180 0x9186 0x6196 +0x9187 0x918F 0x619E +0x9190 0x9191 0x61AA +0x9192 0x919B 0x61AD +0x919C 0x91A1 0x61B8 +0x91A2 0x91A4 0x61BF +0x91A5 0x91A9 0x61C3 +0x91AA 0x61C9 +0x91AB 0x91AF 0x61CC +0x91B0 0x61D3 +0x91B1 0x91C1 0x61D5 +0x91C2 0x91CF 0x61E7 +0x91D0 0x91D8 0x61F6 +0x91D9 0x91DE 0x6200 +0x91DF 0x6207 +0x91E0 0x6209 +0x91E1 0x91E2 0x6213 +0x91E3 0x6219 +0x91E4 0x91E6 0x621C +0x91E7 0x6220 +0x91E8 0x6223 +0x91E9 0x91EC 0x6226 +0x91ED 0x622B +0x91EE 0x622D +0x91EF 0x91F2 0x622F +0x91F3 0x91F4 0x6235 +0x91F5 0x91F9 0x6238 +0x91FA 0x6242 +0x91FB 0x91FD 0x6244 +0x91FE 0x624A +0x9240 0x9241 0x624F +0x9242 0x9244 0x6255 +0x9245 0x9246 0x6259 +0x9247 0x924D 0x625C +0x924E 0x924F 0x6264 +0x9250 0x6268 +0x9251 0x9252 0x6271 +0x9253 0x9254 0x6274 +0x9255 0x9256 0x6277 +0x9257 0x9258 0x627A +0x9259 0x627D +0x925A 0x925C 0x6281 +0x925D 0x9260 0x6285 +0x9261 0x9266 0x628B +0x9267 0x6294 +0x9268 0x6299 +0x9269 0x926B 0x629C +0x926C 0x62A3 +0x926D 0x926E 0x62A6 +0x926F 0x9270 0x62A9 +0x9271 0x9274 0x62AD +0x9275 0x9277 0x62B2 +0x9278 0x927A 0x62B6 +0x927B 0x62BA +0x927C 0x62BE +0x927D 0x927E 0x62C0 +0x9280 0x62C3 +0x9281 0x62CB +0x9282 0x62CF +0x9283 0x62D1 +0x9284 0x62D5 +0x9285 0x9286 0x62DD +0x9287 0x9288 0x62E0 +0x9289 0x62E4 +0x928A 0x928B 0x62EA +0x928C 0x62F0 +0x928D 0x62F2 +0x928E 0x62F5 +0x928F 0x9292 0x62F8 +0x9293 0x6300 +0x9294 0x9297 0x6303 +0x9298 0x929B 0x630A +0x929C 0x929D 0x630F +0x929E 0x92A1 0x6312 +0x92A2 0x92A4 0x6317 +0x92A5 0x631C +0x92A6 0x92A7 0x6326 +0x92A8 0x6329 +0x92A9 0x92AB 0x632C +0x92AC 0x92AD 0x6330 +0x92AE 0x92B3 0x6333 +0x92B4 0x92B5 0x633B +0x92B6 0x92B9 0x633E +0x92BA 0x6344 +0x92BB 0x92BC 0x6347 +0x92BD 0x634A +0x92BE 0x92C1 0x6351 +0x92C2 0x92C9 0x6356 +0x92CA 0x6360 +0x92CB 0x92CD 0x6364 +0x92CE 0x6368 +0x92CF 0x92D1 0x636A +0x92D2 0x92D3 0x636F +0x92D4 0x92D7 0x6372 +0x92D8 0x92D9 0x6378 +0x92DA 0x92DD 0x637C +0x92DE 0x6381 +0x92DF 0x92E2 0x6383 +0x92E3 0x638B +0x92E4 0x638D +0x92E5 0x6391 +0x92E6 0x92E8 0x6393 +0x92E9 0x6397 +0x92EA 0x92F0 0x6399 +0x92F1 0x63A1 +0x92F2 0x63A4 +0x92F3 0x63A6 +0x92F4 0x63AB +0x92F5 0x63AF +0x92F6 0x92F7 0x63B1 +0x92F8 0x92F9 0x63B5 +0x92FA 0x63B9 +0x92FB 0x63BB +0x92FC 0x63BD +0x92FD 0x92FE 0x63BF +0x9340 0x9342 0x63C1 +0x9343 0x63C5 +0x9344 0x9345 0x63C7 +0x9346 0x9348 0x63CA +0x9349 0x63D1 +0x934A 0x934C 0x63D3 +0x934D 0x9353 0x63D7 +0x9354 0x63DF +0x9355 0x63E2 +0x9356 0x935A 0x63E4 +0x935B 0x935C 0x63EB +0x935D 0x9360 0x63EE +0x9361 0x63F3 +0x9362 0x63F5 +0x9363 0x63F7 +0x9364 0x9367 0x63F9 +0x9368 0x63FE +0x9369 0x936A 0x6403 +0x936B 0x936F 0x6406 +0x9370 0x9371 0x640D +0x9372 0x9373 0x6411 +0x9374 0x9379 0x6415 +0x937A 0x641D +0x937B 0x641F +0x937C 0x937E 0x6422 +0x9380 0x6425 +0x9381 0x9383 0x6427 +0x9384 0x642B +0x9385 0x938A 0x642E +0x938B 0x938F 0x6435 +0x9390 0x9391 0x643B +0x9392 0x643E +0x9393 0x6440 +0x9394 0x9395 0x6442 +0x9396 0x6449 +0x9397 0x939D 0x644B +0x939E 0x6453 +0x939F 0x93A1 0x6455 +0x93A2 0x93A6 0x6459 +0x93A7 0x93AE 0x645F +0x93AF 0x6468 +0x93B0 0x93B2 0x646A +0x93B3 0x93BC 0x646E +0x93BD 0x93C3 0x647B +0x93C4 0x6483 +0x93C5 0x6486 +0x93C6 0x93CE 0x6488 +0x93CF 0x93D0 0x6493 +0x93D1 0x93D2 0x6497 +0x93D3 0x93D6 0x649A +0x93D7 0x93DB 0x649F +0x93DC 0x93DF 0x64A5 +0x93E0 0x93E1 0x64AA +0x93E2 0x64AF +0x93E3 0x93E6 0x64B1 +0x93E7 0x64B6 +0x93E8 0x64B9 +0x93E9 0x64BB +0x93EA 0x93EC 0x64BD +0x93ED 0x64C1 +0x93EE 0x93EF 0x64C3 +0x93F0 0x93F6 0x64C6 +0x93F7 0x64CF +0x93F8 0x64D1 +0x93F9 0x93FC 0x64D3 +0x93FD 0x93FE 0x64D9 +0x9440 0x9442 0x64DB +0x9443 0x9445 0x64DF +0x9446 0x64E3 +0x9447 0x64E5 +0x9448 0x9460 0x64E7 +0x9461 0x9468 0x6501 +0x9469 0x9470 0x650A +0x9471 0x9475 0x6513 +0x9476 0x947E 0x6519 +0x9480 0x9482 0x6522 +0x9483 0x9487 0x6526 +0x9488 0x9489 0x652C +0x948A 0x948D 0x6530 +0x948E 0x6537 +0x948F 0x653A +0x9490 0x9491 0x653C +0x9492 0x9496 0x6540 +0x9497 0x9498 0x6546 +0x9499 0x949A 0x654A +0x949B 0x949C 0x654D +0x949D 0x6550 +0x949E 0x94A0 0x6552 +0x94A1 0x94A2 0x6557 +0x94A3 0x655A +0x94A4 0x655C +0x94A5 0x94A7 0x655F +0x94A8 0x94A9 0x6564 +0x94AA 0x94AD 0x6567 +0x94AE 0x94B0 0x656D +0x94B1 0x6571 +0x94B2 0x6573 +0x94B3 0x94B4 0x6575 +0x94B5 0x94C3 0x6578 +0x94C4 0x94C6 0x6588 +0x94C7 0x94C9 0x658D +0x94CA 0x6592 +0x94CB 0x94CD 0x6594 +0x94CE 0x6598 +0x94CF 0x659A +0x94D0 0x94D1 0x659D +0x94D2 0x65A0 +0x94D3 0x94D4 0x65A2 +0x94D5 0x65A6 +0x94D6 0x65A8 +0x94D7 0x65AA +0x94D8 0x65AC +0x94D9 0x65AE +0x94DA 0x94E1 0x65B1 +0x94E2 0x94E3 0x65BA +0x94E4 0x94E6 0x65BE +0x94E7 0x65C2 +0x94E8 0x94EB 0x65C7 +0x94EC 0x65CD +0x94ED 0x94EE 0x65D0 +0x94EF 0x94F1 0x65D3 +0x94F2 0x94F9 0x65D8 +0x94FA 0x65E1 +0x94FB 0x94FC 0x65E3 +0x94FD 0x94FE 0x65EA +0x9540 0x9543 0x65F2 +0x9544 0x9545 0x65F8 +0x9546 0x954A 0x65FB +0x954B 0x6601 +0x954C 0x954D 0x6604 +0x954E 0x9550 0x6607 +0x9551 0x660B +0x9552 0x660D +0x9553 0x9555 0x6610 +0x9556 0x9558 0x6616 +0x9559 0x955B 0x661A +0x955C 0x661E +0x955D 0x9560 0x6621 +0x9561 0x6626 +0x9562 0x9565 0x6629 +0x9566 0x662E +0x9567 0x6630 +0x9568 0x9569 0x6632 +0x956A 0x956E 0x6637 +0x956F 0x663D +0x9570 0x9571 0x663F +0x9572 0x6642 +0x9573 0x9579 0x6644 +0x957A 0x957B 0x664D +0x957C 0x957D 0x6650 +0x957E 0x6658 +0x9580 0x6659 +0x9581 0x9584 0x665B +0x9585 0x6660 +0x9586 0x9587 0x6662 +0x9588 0x6665 +0x9589 0x6667 +0x958A 0x958E 0x6669 +0x958F 0x9591 0x6671 +0x9592 0x6675 +0x9593 0x9594 0x6678 +0x9595 0x9597 0x667B +0x9598 0x959A 0x667F +0x959B 0x6683 +0x959C 0x959D 0x6685 +0x959E 0x95A1 0x6688 +0x95A2 0x95A5 0x668D +0x95A6 0x95A9 0x6692 +0x95AA 0x95AE 0x6698 +0x95AF 0x95B7 0x669E +0x95B8 0x95BC 0x66A9 +0x95BD 0x95C1 0x66AF +0x95C2 0x95C5 0x66B5 +0x95C6 0x95C9 0x66BA +0x95CA 0x95E3 0x66BF +0x95E4 0x66DA +0x95E5 0x95EC 0x66DE +0x95ED 0x95EE 0x66E7 +0x95EF 0x95F4 0x66EA +0x95F5 0x66F1 +0x95F6 0x95F7 0x66F5 +0x95F8 0x66F8 +0x95F9 0x95FA 0x66FA +0x95FB 0x66FD +0x95FC 0x95FE 0x6701 +0x9640 0x9643 0x6704 +0x9644 0x670C +0x9645 0x9646 0x670E +0x9647 0x9649 0x6711 +0x964A 0x6716 +0x964B 0x964D 0x6718 +0x964E 0x671C +0x964F 0x671E +0x9650 0x9655 0x6720 +0x9656 0x6727 +0x9657 0x6729 +0x9658 0x672E +0x9659 0x6730 +0x965A 0x965B 0x6732 +0x965C 0x965F 0x6736 +0x9660 0x9661 0x673B +0x9662 0x9663 0x673E +0x9664 0x6741 +0x9665 0x9666 0x6744 +0x9667 0x6747 +0x9668 0x9669 0x674A +0x966A 0x674D +0x966B 0x6752 +0x966C 0x966D 0x6754 +0x966E 0x9672 0x6757 +0x9673 0x675D +0x9674 0x9676 0x6762 +0x9677 0x9678 0x6766 +0x9679 0x967A 0x676B +0x967B 0x676E +0x967C 0x6771 +0x967D 0x6774 +0x967E 0x6776 +0x9680 0x9683 0x6778 +0x9684 0x677D +0x9685 0x6780 +0x9686 0x9687 0x6782 +0x9688 0x9689 0x6785 +0x968A 0x6788 +0x968B 0x678A +0x968C 0x968F 0x678C +0x9690 0x9693 0x6791 +0x9694 0x6796 +0x9695 0x6799 +0x9696 0x679B +0x9697 0x9699 0x679F +0x969A 0x67A4 +0x969B 0x67A6 +0x969C 0x67A9 +0x969D 0x67AC +0x969E 0x67AE +0x969F 0x96A0 0x67B1 +0x96A1 0x67B4 +0x96A2 0x96A9 0x67B9 +0x96AA 0x67C2 +0x96AB 0x96B4 0x67C5 +0x96B5 0x96B7 0x67D5 +0x96B8 0x67DB +0x96B9 0x67DF +0x96BA 0x67E1 +0x96BB 0x96BC 0x67E3 +0x96BD 0x96BF 0x67E6 +0x96C0 0x96C1 0x67EA +0x96C2 0x96C3 0x67ED +0x96C4 0x67F2 +0x96C5 0x96CC 0x67F5 +0x96CD 0x67FE +0x96CE 0x96D1 0x6801 +0x96D2 0x6806 +0x96D3 0x680D +0x96D4 0x6810 +0x96D5 0x6812 +0x96D6 0x96D7 0x6814 +0x96D8 0x96DC 0x6818 +0x96DD 0x96DF 0x681E +0x96E0 0x96E6 0x6822 +0x96E7 0x96ED 0x682B +0x96EE 0x96F0 0x6834 +0x96F1 0x96F2 0x683A +0x96F3 0x683F +0x96F4 0x6847 +0x96F5 0x684B +0x96F6 0x684D +0x96F7 0x684F +0x96F8 0x6852 +0x96F9 0x96FE 0x6856 +0x9740 0x9743 0x685C +0x9744 0x686A +0x9745 0x974C 0x686C +0x974D 0x6875 +0x974E 0x9756 0x6878 +0x9757 0x6882 +0x9758 0x6884 +0x9759 0x9760 0x6887 +0x9761 0x9763 0x6890 +0x9764 0x9766 0x6894 +0x9767 0x9770 0x6898 +0x9771 0x9773 0x68A3 +0x9774 0x9777 0x68A9 +0x9778 0x68AE +0x9779 0x977A 0x68B1 +0x977B 0x68B4 +0x977C 0x977E 0x68B6 +0x9780 0x9786 0x68B9 +0x9787 0x68C1 +0x9788 0x978D 0x68C3 +0x978E 0x68CA +0x978F 0x68CC +0x9790 0x9793 0x68CE +0x9794 0x9795 0x68D3 +0x9796 0x9797 0x68D6 +0x9798 0x68D9 +0x9799 0x979D 0x68DB +0x979E 0x979F 0x68E1 +0x97A0 0x97A9 0x68E4 +0x97AA 0x68EF +0x97AB 0x97AD 0x68F2 +0x97AE 0x97B0 0x68F6 +0x97B1 0x68FB +0x97B2 0x97B5 0x68FD +0x97B6 0x97B8 0x6902 +0x97B9 0x97BD 0x6906 +0x97BE 0x690C +0x97BF 0x690F +0x97C0 0x6911 +0x97C1 0x97CC 0x6913 +0x97CD 0x97CF 0x6921 +0x97D0 0x97D7 0x6925 +0x97D8 0x97D9 0x692E +0x97DA 0x97DC 0x6931 +0x97DD 0x97E0 0x6935 +0x97E1 0x97E3 0x693A +0x97E4 0x693E +0x97E5 0x97E6 0x6940 +0x97E7 0x97F7 0x6943 +0x97F8 0x97F9 0x6955 +0x97FA 0x97FB 0x6958 +0x97FC 0x97FD 0x695B +0x97FE 0x695F +0x9840 0x9841 0x6961 +0x9842 0x9843 0x6964 +0x9844 0x9847 0x6967 +0x9848 0x9849 0x696C +0x984A 0x984B 0x696F +0x984C 0x9850 0x6972 +0x9851 0x9852 0x697A +0x9853 0x9855 0x697D +0x9856 0x6981 +0x9857 0x6983 +0x9858 0x6985 +0x9859 0x985B 0x698A +0x985C 0x9861 0x698E +0x9862 0x9863 0x6996 +0x9864 0x9865 0x6999 +0x9866 0x986F 0x699D +0x9870 0x9871 0x69A9 +0x9872 0x69AC +0x9873 0x9875 0x69AE +0x9876 0x9877 0x69B2 +0x9878 0x9879 0x69B5 +0x987A 0x987C 0x69B8 +0x987D 0x987E 0x69BC +0x9880 0x9882 0x69BE +0x9883 0x988A 0x69C2 +0x988B 0x69CB +0x988C 0x69CD +0x988D 0x69CF +0x988E 0x9890 0x69D1 +0x9891 0x9896 0x69D5 +0x9897 0x9899 0x69DC +0x989A 0x98A5 0x69E1 +0x98A6 0x98A9 0x69EE +0x98AA 0x98B3 0x69F3 +0x98B4 0x69FE +0x98B5 0x98BE 0x6A00 +0x98BF 0x98CA 0x6A0B +0x98CB 0x98D0 0x6A19 +0x98D1 0x6A20 +0x98D2 0x98D7 0x6A22 +0x98D8 0x6A29 +0x98D9 0x98DC 0x6A2B +0x98DD 0x6A30 +0x98DE 0x98E0 0x6A32 +0x98E1 0x98E7 0x6A36 +0x98E8 0x98EC 0x6A3F +0x98ED 0x98EE 0x6A45 +0x98EF 0x98F6 0x6A48 +0x98F7 0x98FD 0x6A51 +0x98FE 0x6A5A +0x9940 0x9944 0x6A5C +0x9945 0x9947 0x6A62 +0x9948 0x9952 0x6A66 +0x9953 0x9959 0x6A72 +0x995A 0x995B 0x6A7A +0x995C 0x995E 0x6A7D +0x995F 0x9961 0x6A81 +0x9962 0x996A 0x6A85 +0x996B 0x6A8F +0x996C 0x9970 0x6A92 +0x9971 0x9978 0x6A98 +0x9979 0x997E 0x6AA1 +0x9980 0x9981 0x6AA7 +0x9982 0x6AAA +0x9983 0x99F5 0x6AAD +0x99F6 0x99F7 0x6B25 +0x99F8 0x99FE 0x6B28 +0x9A40 0x9A42 0x6B2F +0x9A43 0x9A46 0x6B33 +0x9A47 0x6B38 +0x9A48 0x9A4A 0x6B3B +0x9A4B 0x9A4E 0x6B3F +0x9A4F 0x9A50 0x6B44 +0x9A51 0x6B48 +0x9A52 0x9A53 0x6B4A +0x9A54 0x9A5F 0x6B4D +0x9A60 0x9A67 0x6B5A +0x9A68 0x9A69 0x6B68 +0x9A6A 0x9A77 0x6B6B +0x9A78 0x6B7A +0x9A79 0x9A7C 0x6B7D +0x9A7D 0x6B85 +0x9A7E 0x6B88 +0x9A80 0x6B8C +0x9A81 0x9A84 0x6B8E +0x9A85 0x9A86 0x6B94 +0x9A87 0x9A89 0x6B97 +0x9A8A 0x9A8E 0x6B9C +0x9A8F 0x9A96 0x6BA2 +0x9A97 0x9A9E 0x6BAB +0x9A9F 0x6BB6 +0x9AA0 0x9AA6 0x6BB8 +0x9AA7 0x6BC0 +0x9AA8 0x9AA9 0x6BC3 +0x9AAA 0x9AAE 0x6BC6 +0x9AAF 0x6BCC +0x9AB0 0x6BCE +0x9AB1 0x9AB2 0x6BD0 +0x9AB3 0x6BD8 +0x9AB4 0x6BDA +0x9AB5 0x9AB9 0x6BDC +0x9ABA 0x9AC1 0x6BE2 +0x9AC2 0x9AC4 0x6BEC +0x9AC5 0x9AC7 0x6BF0 +0x9AC8 0x6BF4 +0x9AC9 0x9ACB 0x6BF6 +0x9ACC 0x9ACE 0x6BFA +0x9ACF 0x9AD5 0x6BFE +0x9AD6 0x9ADA 0x6C08 +0x9ADB 0x6C0E +0x9ADC 0x6C12 +0x9ADD 0x6C17 +0x9ADE 0x9AE0 0x6C1C +0x9AE1 0x6C20 +0x9AE2 0x6C23 +0x9AE3 0x6C25 +0x9AE4 0x9AE6 0x6C2B +0x9AE7 0x6C31 +0x9AE8 0x6C33 +0x9AE9 0x9AEA 0x6C36 +0x9AEB 0x9AEE 0x6C39 +0x9AEF 0x9AF0 0x6C3E +0x9AF1 0x9AF3 0x6C43 +0x9AF4 0x6C48 +0x9AF5 0x9AF9 0x6C4B +0x9AFA 0x9AFC 0x6C51 +0x9AFD 0x6C56 +0x9AFE 0x6C58 +0x9B40 0x9B41 0x6C59 +0x9B42 0x9B43 0x6C62 +0x9B44 0x9B46 0x6C65 +0x9B47 0x9B4B 0x6C6B +0x9B4C 0x6C71 +0x9B4D 0x6C73 +0x9B4E 0x6C75 +0x9B4F 0x9B50 0x6C77 +0x9B51 0x9B53 0x6C7A +0x9B54 0x9B55 0x6C7F +0x9B56 0x6C84 +0x9B57 0x6C87 +0x9B58 0x9B59 0x6C8A +0x9B5A 0x9B5B 0x6C8D +0x9B5C 0x9B5D 0x6C91 +0x9B5E 0x9B61 0x6C95 +0x9B62 0x6C9A +0x9B63 0x9B65 0x6C9C +0x9B66 0x6CA0 +0x9B67 0x6CA2 +0x9B68 0x6CA8 +0x9B69 0x6CAC +0x9B6A 0x9B6B 0x6CAF +0x9B6C 0x9B6F 0x6CB4 +0x9B70 0x6CBA +0x9B71 0x9B74 0x6CC0 +0x9B75 0x9B77 0x6CC6 +0x9B78 0x6CCB +0x9B79 0x9B7B 0x6CCD +0x9B7C 0x9B7D 0x6CD1 +0x9B7E 0x6CD8 +0x9B80 0x9B81 0x6CD9 +0x9B82 0x9B83 0x6CDC +0x9B84 0x6CDF +0x9B85 0x6CE4 +0x9B86 0x9B87 0x6CE6 +0x9B88 0x6CE9 +0x9B89 0x9B8A 0x6CEC +0x9B8B 0x6CF2 +0x9B8C 0x6CF4 +0x9B8D 0x6CF9 +0x9B8E 0x9B8F 0x6CFF +0x9B90 0x9B91 0x6D02 +0x9B92 0x9B93 0x6D05 +0x9B94 0x9B96 0x6D08 +0x9B97 0x6D0D +0x9B98 0x9B9A 0x6D0F +0x9B9B 0x9B9E 0x6D13 +0x9B9F 0x6D18 +0x9BA0 0x9BA1 0x6D1C +0x9BA2 0x9BA7 0x6D1F +0x9BA8 0x6D26 +0x9BA9 0x9BAA 0x6D28 +0x9BAB 0x9BAC 0x6D2C +0x9BAD 0x9BAE 0x6D2F +0x9BAF 0x6D34 +0x9BB0 0x9BB2 0x6D36 +0x9BB3 0x6D3A +0x9BB4 0x9BB5 0x6D3F +0x9BB6 0x6D42 +0x9BB7 0x6D44 +0x9BB8 0x6D49 +0x9BB9 0x6D4C +0x9BBA 0x6D50 +0x9BBB 0x9BBE 0x6D55 +0x9BBF 0x6D5B +0x9BC0 0x6D5D +0x9BC1 0x6D5F +0x9BC2 0x9BC3 0x6D61 +0x9BC4 0x9BC5 0x6D64 +0x9BC6 0x9BC7 0x6D67 +0x9BC8 0x9BCA 0x6D6B +0x9BCB 0x9BCE 0x6D70 +0x9BCF 0x9BD0 0x6D75 +0x9BD1 0x9BD3 0x6D79 +0x9BD4 0x9BD8 0x6D7D +0x9BD9 0x9BDA 0x6D83 +0x9BDB 0x9BDC 0x6D86 +0x9BDD 0x9BDE 0x6D8A +0x9BDF 0x6D8D +0x9BE0 0x9BE1 0x6D8F +0x9BE2 0x6D92 +0x9BE3 0x9BE7 0x6D96 +0x9BE8 0x6D9C +0x9BE9 0x6DA2 +0x9BEA 0x6DA5 +0x9BEB 0x9BEC 0x6DAC +0x9BED 0x9BEE 0x6DB0 +0x9BEF 0x9BF0 0x6DB3 +0x9BF1 0x9BF2 0x6DB6 +0x9BF3 0x9BF8 0x6DB9 +0x9BF9 0x9BFB 0x6DC1 +0x9BFC 0x9BFE 0x6DC8 +0x9C40 0x9C43 0x6DCD +0x9C44 0x9C47 0x6DD2 +0x9C48 0x6DD7 +0x9C49 0x9C4B 0x6DDA +0x9C4C 0x6DDF +0x9C4D 0x9C4E 0x6DE2 +0x9C4F 0x6DE5 +0x9C50 0x9C53 0x6DE7 +0x9C54 0x6DED +0x9C55 0x9C56 0x6DEF +0x9C57 0x6DF2 +0x9C58 0x9C5A 0x6DF4 +0x9C5B 0x6DF8 +0x9C5C 0x6DFA +0x9C5D 0x9C64 0x6DFD +0x9C65 0x9C68 0x6E06 +0x9C69 0x6E0B +0x9C6A 0x6E0F +0x9C6B 0x9C6C 0x6E12 +0x9C6D 0x6E15 +0x9C6E 0x9C6F 0x6E18 +0x9C70 0x9C71 0x6E1B +0x9C72 0x9C73 0x6E1E +0x9C74 0x6E22 +0x9C75 0x9C77 0x6E26 +0x9C78 0x6E2A +0x9C79 0x6E2C +0x9C7A 0x6E2E +0x9C7B 0x9C7C 0x6E30 +0x9C7D 0x6E33 +0x9C7E 0x6E35 +0x9C80 0x9C81 0x6E36 +0x9C82 0x6E39 +0x9C83 0x9C8A 0x6E3B +0x9C8B 0x9C92 0x6E45 +0x9C93 0x9C96 0x6E4F +0x9C97 0x6E55 +0x9C98 0x6E57 +0x9C99 0x9C9A 0x6E59 +0x9C9B 0x9C9D 0x6E5C +0x9C9E 0x9CA8 0x6E60 +0x9CA9 0x9CAA 0x6E6C +0x9CAB 0x9CB9 0x6E6F +0x9CBA 0x9CBC 0x6E80 +0x9CBD 0x6E84 +0x9CBE 0x9CBF 0x6E87 +0x9CC0 0x9CC4 0x6E8A +0x9CC5 0x9CCB 0x6E91 +0x9CCC 0x9CCE 0x6E99 +0x9CCF 0x9CD0 0x6E9D +0x9CD1 0x9CD2 0x6EA0 +0x9CD3 0x9CD4 0x6EA3 +0x9CD5 0x6EA6 +0x9CD6 0x9CD7 0x6EA8 +0x9CD8 0x9CDB 0x6EAB +0x9CDC 0x6EB0 +0x9CDD 0x6EB3 +0x9CDE 0x6EB5 +0x9CDF 0x9CE0 0x6EB8 +0x9CE1 0x6EBC +0x9CE2 0x9CE4 0x6EBE +0x9CE5 0x9CE8 0x6EC3 +0x9CE9 0x9CEB 0x6EC8 +0x9CEC 0x9CEE 0x6ECC +0x9CEF 0x6ED0 +0x9CF0 0x6ED2 +0x9CF1 0x6ED6 +0x9CF2 0x9CF3 0x6ED8 +0x9CF4 0x9CF6 0x6EDB +0x9CF7 0x6EE3 +0x9CF8 0x6EE7 +0x9CF9 0x9CFE 0x6EEA +0x9D40 0x9D43 0x6EF0 +0x9D44 0x9D47 0x6EF5 +0x9D48 0x9D4F 0x6EFA +0x9D50 0x9D52 0x6F03 +0x9D53 0x9D54 0x6F07 +0x9D55 0x9D59 0x6F0A +0x9D5A 0x9D5C 0x6F10 +0x9D5D 0x9D66 0x6F16 +0x9D67 0x9D69 0x6F21 +0x9D6A 0x9D6D 0x6F25 +0x9D6E 0x6F2C +0x9D6F 0x6F2E +0x9D70 0x6F30 +0x9D71 0x6F32 +0x9D72 0x9D73 0x6F34 +0x9D74 0x9D7A 0x6F37 +0x9D7B 0x9D7E 0x6F3F +0x9D80 0x9D82 0x6F43 +0x9D83 0x9D85 0x6F48 +0x9D86 0x6F4C +0x9D87 0x9D90 0x6F4E +0x9D91 0x9D93 0x6F59 +0x9D94 0x6F5D +0x9D95 0x9D97 0x6F5F +0x9D98 0x9D9A 0x6F63 +0x9D9B 0x9DA0 0x6F67 +0x9DA1 0x9DA3 0x6F6F +0x9DA4 0x6F73 +0x9DA5 0x9DA7 0x6F75 +0x9DA8 0x6F79 +0x9DA9 0x6F7B +0x9DAA 0x9DB0 0x6F7D +0x9DB1 0x9DB3 0x6F85 +0x9DB4 0x9DB5 0x6F8A +0x9DB6 0x9DC2 0x6F8F +0x9DC3 0x9DC6 0x6F9D +0x9DC7 0x9DCB 0x6FA2 +0x9DCC 0x9DD6 0x6FA8 +0x9DD7 0x9DD8 0x6FB4 +0x9DD9 0x9DDA 0x6FB7 +0x9DDB 0x9DE0 0x6FBA +0x9DE1 0x6FC1 +0x9DE2 0x9DE7 0x6FC3 +0x9DE8 0x9DEE 0x6FCA +0x9DEF 0x9DF9 0x6FD3 +0x9DFA 0x6FDF +0x9DFB 0x9DFE 0x6FE2 +0x9E40 0x9E47 0x6FE6 +0x9E48 0x9E68 0x6FF0 +0x9E69 0x9E70 0x7012 +0x9E71 0x9E77 0x701C +0x9E78 0x9E7E 0x7024 +0x9E80 0x9E89 0x702B +0x9E8A 0x9E8C 0x7036 +0x9E8D 0x9E9E 0x703A +0x9E9F 0x9EA0 0x704D +0x9EA1 0x9EAE 0x7050 +0x9EAF 0x9EBA 0x705F +0x9EBB 0x706E +0x9EBC 0x9EBF 0x7071 +0x9EC0 0x7077 +0x9EC1 0x9EC3 0x7079 +0x9EC4 0x707D +0x9EC5 0x9EC8 0x7081 +0x9EC9 0x9ECB 0x7086 +0x9ECC 0x9ECE 0x708B +0x9ECF 0x9ED1 0x708F +0x9ED2 0x7093 +0x9ED3 0x9ED4 0x7097 +0x9ED5 0x9ED6 0x709A +0x9ED7 0x9EE3 0x709E +0x9EE4 0x70B0 +0x9EE5 0x70B2 +0x9EE6 0x9EE8 0x70B4 +0x9EE9 0x70BA +0x9EEA 0x9EEB 0x70BE +0x9EEC 0x9EEF 0x70C4 +0x9EF0 0x70C9 +0x9EF1 0x9EFD 0x70CB +0x9EFE 0x70DA +0x9F40 0x9F42 0x70DC +0x9F43 0x9F46 0x70E0 +0x9F47 0x70E5 +0x9F48 0x70EA +0x9F49 0x70EE +0x9F4A 0x9F50 0x70F0 +0x9F51 0x70F8 +0x9F52 0x9F54 0x70FA +0x9F55 0x9F5F 0x70FE +0x9F60 0x9F64 0x710B +0x9F65 0x9F66 0x7111 +0x9F67 0x7114 +0x9F68 0x7117 +0x9F69 0x9F73 0x711B +0x9F74 0x9F7B 0x7127 +0x9F7C 0x9F7E 0x7132 +0x9F80 0x7135 +0x9F81 0x9F8E 0x7137 +0x9F8F 0x9F92 0x7146 +0x9F93 0x714B +0x9F94 0x714D +0x9F95 0x9FA1 0x714F +0x9FA2 0x715D +0x9FA3 0x9FA7 0x715F +0x9FA8 0x7165 +0x9FA9 0x9FAD 0x7169 +0x9FAE 0x9FB0 0x716F +0x9FB1 0x9FB4 0x7174 +0x9FB5 0x7179 +0x9FB6 0x9FB7 0x717B +0x9FB8 0x9FBD 0x717E +0x9FBE 0x9FC2 0x7185 +0x9FC3 0x9FC6 0x718B +0x9FC7 0x9FCA 0x7190 +0x9FCB 0x9FCD 0x7195 +0x9FCE 0x9FD2 0x719A +0x9FD3 0x9FD9 0x71A1 +0x9FDA 0x9FDC 0x71A9 +0x9FDD 0x9FE2 0x71AD +0x9FE3 0x71B4 +0x9FE4 0x9FE6 0x71B6 +0x9FE7 0x9FEF 0x71BA +0x9FF0 0x9FF9 0x71C4 +0x9FFA 0x9FFE 0x71CF +0xA040 0xA049 0x71D6 +0xA04A 0xA04D 0x71E1 +0xA04E 0x71E6 +0xA04F 0xA054 0x71E8 +0xA055 0xA05E 0x71EF +0xA05F 0xA06A 0x71FA +0xA06B 0xA07E 0x7207 +0xA080 0xA081 0x721B +0xA082 0xA08B 0x721E +0xA08C 0x7229 +0xA08D 0x722B +0xA08E 0xA090 0x722D +0xA091 0xA093 0x7232 +0xA094 0x723A +0xA095 0x723C +0xA096 0x723E +0xA097 0xA09D 0x7240 +0xA09E 0xA0A0 0x7249 +0xA0A1 0xA0A4 0x724E +0xA0A5 0xA0A7 0x7253 +0xA0A8 0xA0A9 0x7257 +0xA0AA 0x725A +0xA0AB 0x725C +0xA0AC 0x725E +0xA0AD 0x7260 +0xA0AE 0xA0B0 0x7263 +0xA0B1 0x7268 +0xA0B2 0xA0B5 0x726A +0xA0B6 0xA0B7 0x7270 +0xA0B8 0xA0B9 0x7273 +0xA0BA 0xA0BC 0x7276 +0xA0BD 0xA0BF 0x727B +0xA0C0 0xA0C1 0x7282 +0xA0C2 0xA0C6 0x7285 +0xA0C7 0x728C +0xA0C8 0x728E +0xA0C9 0xA0CA 0x7290 +0xA0CB 0xA0D6 0x7293 +0xA0D7 0xA0E2 0x72A0 +0xA0E3 0x72AE +0xA0E4 0xA0E6 0x72B1 +0xA0E7 0x72B5 +0xA0E8 0xA0EE 0x72BA +0xA0EF 0xA0F1 0x72C5 +0xA0F2 0xA0F5 0x72C9 +0xA0F6 0x72CF +0xA0F7 0x72D1 +0xA0F8 0xA0FB 0x72D3 +0xA0FC 0x72D8 +0xA0FD 0xA0FE 0x72DA +0xA140 0x3000 +0xA141 0x3000 +0xA142 0x3000 +0xA143 0x3000 +0xA144 0x3000 +0xA145 0x3000 +0xA146 0x3000 +0xA147 0x3000 +0xA148 0x3000 +0xA149 0x3000 +0xA14A 0x3000 +0xA14B 0x3000 +0xA14C 0x3000 +0xA14D 0x3000 +0xA14E 0x3000 +0xA14F 0x3000 +0xA150 0x3000 +0xA151 0x3000 +0xA152 0x3000 +0xA153 0x3000 +0xA154 0x3000 +0xA155 0x3000 +0xA156 0x3000 +0xA157 0x3000 +0xA158 0x3000 +0xA159 0x3000 +0xA15A 0x3000 +0xA15B 0x3000 +0xA15C 0x3000 +0xA15D 0x3000 +0xA15E 0x3000 +0xA15F 0x3000 +0xA160 0x3000 +0xA161 0x3000 +0xA162 0x3000 +0xA163 0x3000 +0xA164 0x3000 +0xA165 0x3000 +0xA166 0x3000 +0xA167 0x3000 +0xA168 0x3000 +0xA169 0x3000 +0xA16A 0x3000 +0xA16B 0x3000 +0xA16C 0x3000 +0xA16D 0x3000 +0xA16E 0x3000 +0xA16F 0x3000 +0xA170 0x3000 +0xA171 0x3000 +0xA172 0x3000 +0xA173 0x3000 +0xA174 0x3000 +0xA175 0x3000 +0xA176 0x3000 +0xA177 0x3000 +0xA178 0x3000 +0xA179 0x3000 +0xA17A 0x3000 +0xA17B 0x3000 +0xA17C 0x3000 +0xA17D 0x3000 +0xA17E 0x3000 +0xA180 0x3000 +0xA181 0x3000 +0xA182 0x3000 +0xA183 0x3000 +0xA184 0x3000 +0xA185 0x3000 +0xA186 0x3000 +0xA187 0x3000 +0xA188 0x3000 +0xA189 0x3000 +0xA18A 0x3000 +0xA18B 0x3000 +0xA18C 0x3000 +0xA18D 0x3000 +0xA18E 0x3000 +0xA18F 0x3000 +0xA190 0x3000 +0xA191 0x3000 +0xA192 0x3000 +0xA193 0x3000 +0xA194 0x3000 +0xA195 0x3000 +0xA196 0x3000 +0xA197 0x3000 +0xA198 0x3000 +0xA199 0x3000 +0xA19A 0x3000 +0xA19B 0x3000 +0xA19C 0x3000 +0xA19D 0x3000 +0xA19E 0x3000 +0xA19F 0x3000 +0xA1A0 0x3000 +0xA1A1 0xA1A3 0x3000 +0xA1A4 0x00B7 +0xA1A5 0x02C9 +0xA1A6 0x02C7 +0xA1A7 0x00A8 +0xA1A8 0x3003 +0xA1A9 0x3005 +0xA1AA 0x2015 +0xA1AB 0xFF5E +0xA1AC 0x2016 +0xA1AD 0x2026 +0xA1AE 0xA1AF 0x2018 +0xA1B0 0xA1B1 0x201C +0xA1B2 0xA1B3 0x3014 +0xA1B4 0xA1BB 0x3008 +0xA1BC 0xA1BD 0x3016 +0xA1BE 0xA1BF 0x3010 +0xA1C0 0x00B1 +0xA1C1 0x00D7 +0xA1C2 0x00F7 +0xA1C3 0x2236 +0xA1C4 0xA1C5 0x2227 +0xA1C6 0x2211 +0xA1C7 0x220F +0xA1C8 0x222A +0xA1C9 0x2229 +0xA1CA 0x2208 +0xA1CB 0x2237 +0xA1CC 0x221A +0xA1CD 0x22A5 +0xA1CE 0x2225 +0xA1CF 0x2220 +0xA1D0 0x2312 +0xA1D1 0x2299 +0xA1D2 0x222B +0xA1D3 0x222E +0xA1D4 0x2261 +0xA1D5 0x224C +0xA1D6 0x2248 +0xA1D7 0x223D +0xA1D8 0x221D +0xA1D9 0x2260 +0xA1DA 0xA1DB 0x226E +0xA1DC 0xA1DD 0x2264 +0xA1DE 0x221E +0xA1DF 0x2235 +0xA1E0 0x2234 +0xA1E1 0x2642 +0xA1E2 0x2640 +0xA1E3 0x00B0 +0xA1E4 0xA1E5 0x2032 +0xA1E6 0x2103 +0xA1E7 0xFF04 +0xA1E8 0x00A4 +0xA1E9 0xA1EA 0xFFE0 +0xA1EB 0x2030 +0xA1EC 0x00A7 +0xA1ED 0x2116 +0xA1EE 0x2606 +0xA1EF 0x2605 +0xA1F0 0x25CB +0xA1F1 0x25CF +0xA1F2 0x25CE +0xA1F3 0x25C7 +0xA1F4 0x25C6 +0xA1F5 0x25A1 +0xA1F6 0x25A0 +0xA1F7 0x25B3 +0xA1F8 0x25B2 +0xA1F9 0x203B +0xA1FA 0x2192 +0xA1FB 0xA1FC 0x2190 +0xA1FD 0x2193 +0xA1FE 0x3013 +0xA240 0x3000 +0xA241 0x3000 +0xA242 0x3000 +0xA243 0x3000 +0xA244 0x3000 +0xA245 0x3000 +0xA246 0x3000 +0xA247 0x3000 +0xA248 0x3000 +0xA249 0x3000 +0xA24A 0x3000 +0xA24B 0x3000 +0xA24C 0x3000 +0xA24D 0x3000 +0xA24E 0x3000 +0xA24F 0x3000 +0xA250 0x3000 +0xA251 0x3000 +0xA252 0x3000 +0xA253 0x3000 +0xA254 0x3000 +0xA255 0x3000 +0xA256 0x3000 +0xA257 0x3000 +0xA258 0x3000 +0xA259 0x3000 +0xA25A 0x3000 +0xA25B 0x3000 +0xA25C 0x3000 +0xA25D 0x3000 +0xA25E 0x3000 +0xA25F 0x3000 +0xA260 0x3000 +0xA261 0x3000 +0xA262 0x3000 +0xA263 0x3000 +0xA264 0x3000 +0xA265 0x3000 +0xA266 0x3000 +0xA267 0x3000 +0xA268 0x3000 +0xA269 0x3000 +0xA26A 0x3000 +0xA26B 0x3000 +0xA26C 0x3000 +0xA26D 0x3000 +0xA26E 0x3000 +0xA26F 0x3000 +0xA270 0x3000 +0xA271 0x3000 +0xA272 0x3000 +0xA273 0x3000 +0xA274 0x3000 +0xA275 0x3000 +0xA276 0x3000 +0xA277 0x3000 +0xA278 0x3000 +0xA279 0x3000 +0xA27A 0x3000 +0xA27B 0x3000 +0xA27C 0x3000 +0xA27D 0x3000 +0xA27E 0x3000 +0xA280 0x3000 +0xA281 0x3000 +0xA282 0x3000 +0xA283 0x3000 +0xA284 0x3000 +0xA285 0x3000 +0xA286 0x3000 +0xA287 0x3000 +0xA288 0x3000 +0xA289 0x3000 +0xA28A 0x3000 +0xA28B 0x3000 +0xA28C 0x3000 +0xA28D 0x3000 +0xA28E 0x3000 +0xA28F 0x3000 +0xA290 0x3000 +0xA291 0x3000 +0xA292 0x3000 +0xA293 0x3000 +0xA294 0x3000 +0xA295 0x3000 +0xA296 0x3000 +0xA297 0x3000 +0xA298 0x3000 +0xA299 0x3000 +0xA29A 0x3000 +0xA29B 0x3000 +0xA29C 0x3000 +0xA29D 0x3000 +0xA29E 0x3000 +0xA29F 0x3000 +0xA2A0 0x3000 +0xA2A1 0xA2AA 0x2170 +0xA2AB 0xA2B0 0xE766 +0xA2B1 0xA2C4 0x2488 +0xA2C5 0xA2D8 0x2474 +0xA2D9 0xA2E2 0x2460 +0xA2E3 0x20AC +0xA2E4 0xE76D +0xA2E5 0xA2EE 0x3220 +0xA2EF 0xA2F0 0xE76E +0xA2F1 0xA2FC 0x2160 +0xA2FD 0xA2FE 0xE770 +0xA340 0x3000 +0xA341 0x3000 +0xA342 0x3000 +0xA343 0x3000 +0xA344 0x3000 +0xA345 0x3000 +0xA346 0x3000 +0xA347 0x3000 +0xA348 0x3000 +0xA349 0x3000 +0xA34A 0x3000 +0xA34B 0x3000 +0xA34C 0x3000 +0xA34D 0x3000 +0xA34E 0x3000 +0xA34F 0x3000 +0xA350 0x3000 +0xA351 0x3000 +0xA352 0x3000 +0xA353 0x3000 +0xA354 0x3000 +0xA355 0x3000 +0xA356 0x3000 +0xA357 0x3000 +0xA358 0x3000 +0xA359 0x3000 +0xA35A 0x3000 +0xA35B 0x3000 +0xA35C 0x3000 +0xA35D 0x3000 +0xA35E 0x3000 +0xA35F 0x3000 +0xA360 0x3000 +0xA361 0x3000 +0xA362 0x3000 +0xA363 0x3000 +0xA364 0x3000 +0xA365 0x3000 +0xA366 0x3000 +0xA367 0x3000 +0xA368 0x3000 +0xA369 0x3000 +0xA36A 0x3000 +0xA36B 0x3000 +0xA36C 0x3000 +0xA36D 0x3000 +0xA36E 0x3000 +0xA36F 0x3000 +0xA370 0x3000 +0xA371 0x3000 +0xA372 0x3000 +0xA373 0x3000 +0xA374 0x3000 +0xA375 0x3000 +0xA376 0x3000 +0xA377 0x3000 +0xA378 0x3000 +0xA379 0x3000 +0xA37A 0x3000 +0xA37B 0x3000 +0xA37C 0x3000 +0xA37D 0x3000 +0xA37E 0x3000 +0xA380 0x3000 +0xA381 0x3000 +0xA382 0x3000 +0xA383 0x3000 +0xA384 0x3000 +0xA385 0x3000 +0xA386 0x3000 +0xA387 0x3000 +0xA388 0x3000 +0xA389 0x3000 +0xA38A 0x3000 +0xA38B 0x3000 +0xA38C 0x3000 +0xA38D 0x3000 +0xA38E 0x3000 +0xA38F 0x3000 +0xA390 0x3000 +0xA391 0x3000 +0xA392 0x3000 +0xA393 0x3000 +0xA394 0x3000 +0xA395 0x3000 +0xA396 0x3000 +0xA397 0x3000 +0xA398 0x3000 +0xA399 0x3000 +0xA39A 0x3000 +0xA39B 0x3000 +0xA39C 0x3000 +0xA39D 0x3000 +0xA39E 0x3000 +0xA39F 0x3000 +0xA3A0 0x3000 +0xA3A1 0xA3A3 0xFF01 +0xA3A4 0xFFE5 +0xA3A5 0xA3FD 0xFF05 +0xA3FE 0xFFE3 +0xA440 0x3000 +0xA441 0x3000 +0xA442 0x3000 +0xA443 0x3000 +0xA444 0x3000 +0xA445 0x3000 +0xA446 0x3000 +0xA447 0x3000 +0xA448 0x3000 +0xA449 0x3000 +0xA44A 0x3000 +0xA44B 0x3000 +0xA44C 0x3000 +0xA44D 0x3000 +0xA44E 0x3000 +0xA44F 0x3000 +0xA450 0x3000 +0xA451 0x3000 +0xA452 0x3000 +0xA453 0x3000 +0xA454 0x3000 +0xA455 0x3000 +0xA456 0x3000 +0xA457 0x3000 +0xA458 0x3000 +0xA459 0x3000 +0xA45A 0x3000 +0xA45B 0x3000 +0xA45C 0x3000 +0xA45D 0x3000 +0xA45E 0x3000 +0xA45F 0x3000 +0xA460 0x3000 +0xA461 0x3000 +0xA462 0x3000 +0xA463 0x3000 +0xA464 0x3000 +0xA465 0x3000 +0xA466 0x3000 +0xA467 0x3000 +0xA468 0x3000 +0xA469 0x3000 +0xA46A 0x3000 +0xA46B 0x3000 +0xA46C 0x3000 +0xA46D 0x3000 +0xA46E 0x3000 +0xA46F 0x3000 +0xA470 0x3000 +0xA471 0x3000 +0xA472 0x3000 +0xA473 0x3000 +0xA474 0x3000 +0xA475 0x3000 +0xA476 0x3000 +0xA477 0x3000 +0xA478 0x3000 +0xA479 0x3000 +0xA47A 0x3000 +0xA47B 0x3000 +0xA47C 0x3000 +0xA47D 0x3000 +0xA47E 0x3000 +0xA480 0x3000 +0xA481 0x3000 +0xA482 0x3000 +0xA483 0x3000 +0xA484 0x3000 +0xA485 0x3000 +0xA486 0x3000 +0xA487 0x3000 +0xA488 0x3000 +0xA489 0x3000 +0xA48A 0x3000 +0xA48B 0x3000 +0xA48C 0x3000 +0xA48D 0x3000 +0xA48E 0x3000 +0xA48F 0x3000 +0xA490 0x3000 +0xA491 0x3000 +0xA492 0x3000 +0xA493 0x3000 +0xA494 0x3000 +0xA495 0x3000 +0xA496 0x3000 +0xA497 0x3000 +0xA498 0x3000 +0xA499 0x3000 +0xA49A 0x3000 +0xA49B 0x3000 +0xA49C 0x3000 +0xA49D 0x3000 +0xA49E 0x3000 +0xA49F 0x3000 +0xA4A0 0x3000 +0xA4A1 0xA4F3 0x3041 +0xA4F4 0xA4FE 0xE772 +0xA540 0x3000 +0xA541 0x3000 +0xA542 0x3000 +0xA543 0x3000 +0xA544 0x3000 +0xA545 0x3000 +0xA546 0x3000 +0xA547 0x3000 +0xA548 0x3000 +0xA549 0x3000 +0xA54A 0x3000 +0xA54B 0x3000 +0xA54C 0x3000 +0xA54D 0x3000 +0xA54E 0x3000 +0xA54F 0x3000 +0xA550 0x3000 +0xA551 0x3000 +0xA552 0x3000 +0xA553 0x3000 +0xA554 0x3000 +0xA555 0x3000 +0xA556 0x3000 +0xA557 0x3000 +0xA558 0x3000 +0xA559 0x3000 +0xA55A 0x3000 +0xA55B 0x3000 +0xA55C 0x3000 +0xA55D 0x3000 +0xA55E 0x3000 +0xA55F 0x3000 +0xA560 0x3000 +0xA561 0x3000 +0xA562 0x3000 +0xA563 0x3000 +0xA564 0x3000 +0xA565 0x3000 +0xA566 0x3000 +0xA567 0x3000 +0xA568 0x3000 +0xA569 0x3000 +0xA56A 0x3000 +0xA56B 0x3000 +0xA56C 0x3000 +0xA56D 0x3000 +0xA56E 0x3000 +0xA56F 0x3000 +0xA570 0x3000 +0xA571 0x3000 +0xA572 0x3000 +0xA573 0x3000 +0xA574 0x3000 +0xA575 0x3000 +0xA576 0x3000 +0xA577 0x3000 +0xA578 0x3000 +0xA579 0x3000 +0xA57A 0x3000 +0xA57B 0x3000 +0xA57C 0x3000 +0xA57D 0x3000 +0xA57E 0x3000 +0xA580 0x3000 +0xA581 0x3000 +0xA582 0x3000 +0xA583 0x3000 +0xA584 0x3000 +0xA585 0x3000 +0xA586 0x3000 +0xA587 0x3000 +0xA588 0x3000 +0xA589 0x3000 +0xA58A 0x3000 +0xA58B 0x3000 +0xA58C 0x3000 +0xA58D 0x3000 +0xA58E 0x3000 +0xA58F 0x3000 +0xA590 0x3000 +0xA591 0x3000 +0xA592 0x3000 +0xA593 0x3000 +0xA594 0x3000 +0xA595 0x3000 +0xA596 0x3000 +0xA597 0x3000 +0xA598 0x3000 +0xA599 0x3000 +0xA59A 0x3000 +0xA59B 0x3000 +0xA59C 0x3000 +0xA59D 0x3000 +0xA59E 0x3000 +0xA59F 0x3000 +0xA5A0 0x3000 +0xA5A1 0xA5F6 0x30A1 +0xA5F7 0xA5FE 0xE77D +0xA640 0x3000 +0xA641 0x3000 +0xA642 0x3000 +0xA643 0x3000 +0xA644 0x3000 +0xA645 0x3000 +0xA646 0x3000 +0xA647 0x3000 +0xA648 0x3000 +0xA649 0x3000 +0xA64A 0x3000 +0xA64B 0x3000 +0xA64C 0x3000 +0xA64D 0x3000 +0xA64E 0x3000 +0xA64F 0x3000 +0xA650 0x3000 +0xA651 0x3000 +0xA652 0x3000 +0xA653 0x3000 +0xA654 0x3000 +0xA655 0x3000 +0xA656 0x3000 +0xA657 0x3000 +0xA658 0x3000 +0xA659 0x3000 +0xA65A 0x3000 +0xA65B 0x3000 +0xA65C 0x3000 +0xA65D 0x3000 +0xA65E 0x3000 +0xA65F 0x3000 +0xA660 0x3000 +0xA661 0x3000 +0xA662 0x3000 +0xA663 0x3000 +0xA664 0x3000 +0xA665 0x3000 +0xA666 0x3000 +0xA667 0x3000 +0xA668 0x3000 +0xA669 0x3000 +0xA66A 0x3000 +0xA66B 0x3000 +0xA66C 0x3000 +0xA66D 0x3000 +0xA66E 0x3000 +0xA66F 0x3000 +0xA670 0x3000 +0xA671 0x3000 +0xA672 0x3000 +0xA673 0x3000 +0xA674 0x3000 +0xA675 0x3000 +0xA676 0x3000 +0xA677 0x3000 +0xA678 0x3000 +0xA679 0x3000 +0xA67A 0x3000 +0xA67B 0x3000 +0xA67C 0x3000 +0xA67D 0x3000 +0xA67E 0x3000 +0xA680 0x3000 +0xA681 0x3000 +0xA682 0x3000 +0xA683 0x3000 +0xA684 0x3000 +0xA685 0x3000 +0xA686 0x3000 +0xA687 0x3000 +0xA688 0x3000 +0xA689 0x3000 +0xA68A 0x3000 +0xA68B 0x3000 +0xA68C 0x3000 +0xA68D 0x3000 +0xA68E 0x3000 +0xA68F 0x3000 +0xA690 0x3000 +0xA691 0x3000 +0xA692 0x3000 +0xA693 0x3000 +0xA694 0x3000 +0xA695 0x3000 +0xA696 0x3000 +0xA697 0x3000 +0xA698 0x3000 +0xA699 0x3000 +0xA69A 0x3000 +0xA69B 0x3000 +0xA69C 0x3000 +0xA69D 0x3000 +0xA69E 0x3000 +0xA69F 0x3000 +0xA6A0 0x3000 +0xA6A1 0xA6B1 0x0391 +0xA6B2 0xA6B8 0x03A3 +0xA6B9 0xA6C0 0xE785 +0xA6C1 0xA6D1 0x03B1 +0xA6D2 0xA6D8 0x03C3 +0xA6D9 0xA6DF 0xE78D +0xA6E0 0xA6E1 0xFE35 +0xA6E2 0xA6E3 0xFE39 +0xA6E4 0xA6E5 0xFE3F +0xA6E6 0xA6E7 0xFE3D +0xA6E8 0xA6EB 0xFE41 +0xA6EC 0xA6ED 0xE794 +0xA6EE 0xA6EF 0xFE3B +0xA6F0 0xA6F1 0xFE37 +0xA6F2 0xFE31 +0xA6F3 0xE796 +0xA6F4 0xA6F5 0xFE33 +0xA6F6 0xA6FE 0xE797 +0xA740 0x3000 +0xA741 0x3000 +0xA742 0x3000 +0xA743 0x3000 +0xA744 0x3000 +0xA745 0x3000 +0xA746 0x3000 +0xA747 0x3000 +0xA748 0x3000 +0xA749 0x3000 +0xA74A 0x3000 +0xA74B 0x3000 +0xA74C 0x3000 +0xA74D 0x3000 +0xA74E 0x3000 +0xA74F 0x3000 +0xA750 0x3000 +0xA751 0x3000 +0xA752 0x3000 +0xA753 0x3000 +0xA754 0x3000 +0xA755 0x3000 +0xA756 0x3000 +0xA757 0x3000 +0xA758 0x3000 +0xA759 0x3000 +0xA75A 0x3000 +0xA75B 0x3000 +0xA75C 0x3000 +0xA75D 0x3000 +0xA75E 0x3000 +0xA75F 0x3000 +0xA760 0x3000 +0xA761 0x3000 +0xA762 0x3000 +0xA763 0x3000 +0xA764 0x3000 +0xA765 0x3000 +0xA766 0x3000 +0xA767 0x3000 +0xA768 0x3000 +0xA769 0x3000 +0xA76A 0x3000 +0xA76B 0x3000 +0xA76C 0x3000 +0xA76D 0x3000 +0xA76E 0x3000 +0xA76F 0x3000 +0xA770 0x3000 +0xA771 0x3000 +0xA772 0x3000 +0xA773 0x3000 +0xA774 0x3000 +0xA775 0x3000 +0xA776 0x3000 +0xA777 0x3000 +0xA778 0x3000 +0xA779 0x3000 +0xA77A 0x3000 +0xA77B 0x3000 +0xA77C 0x3000 +0xA77D 0x3000 +0xA77E 0x3000 +0xA780 0x3000 +0xA781 0x3000 +0xA782 0x3000 +0xA783 0x3000 +0xA784 0x3000 +0xA785 0x3000 +0xA786 0x3000 +0xA787 0x3000 +0xA788 0x3000 +0xA789 0x3000 +0xA78A 0x3000 +0xA78B 0x3000 +0xA78C 0x3000 +0xA78D 0x3000 +0xA78E 0x3000 +0xA78F 0x3000 +0xA790 0x3000 +0xA791 0x3000 +0xA792 0x3000 +0xA793 0x3000 +0xA794 0x3000 +0xA795 0x3000 +0xA796 0x3000 +0xA797 0x3000 +0xA798 0x3000 +0xA799 0x3000 +0xA79A 0x3000 +0xA79B 0x3000 +0xA79C 0x3000 +0xA79D 0x3000 +0xA79E 0x3000 +0xA79F 0x3000 +0xA7A0 0x3000 +0xA7A1 0xA7A6 0x0410 +0xA7A7 0x0401 +0xA7A8 0xA7C1 0x0416 +0xA7C2 0xA7D0 0xE7A0 +0xA7D1 0xA7D6 0x0430 +0xA7D7 0x0451 +0xA7D8 0xA7F1 0x0436 +0xA7F2 0xA7FE 0xE7AF +0xA840 0xA841 0x02CA +0xA842 0x02D9 +0xA843 0xA844 0x2013 +0xA845 0x2025 +0xA846 0x2035 +0xA847 0x2105 +0xA848 0x2109 +0xA849 0xA84C 0x2196 +0xA84D 0x2215 +0xA84E 0x221F +0xA84F 0x2223 +0xA850 0x2252 +0xA851 0xA852 0x2266 +0xA853 0x22BF +0xA854 0xA877 0x2550 +0xA878 0xA87E 0x2581 +0xA880 0xA887 0x2588 +0xA888 0xA88A 0x2593 +0xA88B 0xA88C 0x25BC +0xA88D 0xA890 0x25E2 +0xA891 0x2609 +0xA892 0x2295 +0xA893 0x3012 +0xA894 0xA895 0x301D +0xA896 0xA8A0 0xE7BC +0xA8A1 0x0101 +0xA8A2 0x00E1 +0xA8A3 0x01CE +0xA8A4 0x00E0 +0xA8A5 0x0113 +0xA8A6 0x00E9 +0xA8A7 0x011B +0xA8A8 0x00E8 +0xA8A9 0x012B +0xA8AA 0x00ED +0xA8AB 0x01D0 +0xA8AC 0x00EC +0xA8AD 0x014D +0xA8AE 0x00F3 +0xA8AF 0x01D2 +0xA8B0 0x00F2 +0xA8B1 0x016B +0xA8B2 0x00FA +0xA8B3 0x01D4 +0xA8B4 0x00F9 +0xA8B5 0x01D6 +0xA8B6 0x01D8 +0xA8B7 0x01DA +0xA8B8 0x01DC +0xA8B9 0x00FC +0xA8BA 0x00EA +0xA8BB 0x0251 +0xA8BC 0xE7C7 +0xA8BD 0x0144 +0xA8BE 0x0148 +0xA8BF 0x01F9 +0xA8C0 0x0261 +0xA8C1 0xA8C4 0xE7C9 +0xA8C5 0xA8E9 0x3105 +0xA8EA 0xA8FE 0xE7CD +0xA940 0xA948 0x3021 +0xA949 0x32A3 +0xA94A 0xA94B 0x338E +0xA94C 0xA94E 0x339C +0xA94F 0x33A1 +0xA950 0x33C4 +0xA951 0x33CE +0xA952 0xA953 0x33D1 +0xA954 0x33D5 +0xA955 0xFE30 +0xA956 0xFFE2 +0xA957 0xFFE4 +0xA958 0xE7E2 +0xA959 0x2121 +0xA95A 0x3231 +0xA95B 0xE7E3 +0xA95C 0x2010 +0xA95D 0xA95F 0xE7E4 +0xA960 0x30FC +0xA961 0xA962 0x309B +0xA963 0xA964 0x30FD +0xA965 0x3006 +0xA966 0xA967 0x309D +0xA968 0xA971 0xFE49 +0xA972 0xA975 0xFE54 +0xA976 0xA97E 0xFE59 +0xA980 0xA984 0xFE62 +0xA985 0xA988 0xFE68 +0xA989 0x303E +0xA98A 0xA995 0x2FF0 +0xA996 0x3007 +0xA997 0xA9A3 0xE7F4 +0xA9A4 0xA9EF 0x2500 +0xA9F0 0xA9FE 0xE801 +0xAA40 0xAA41 0x72DC +0xAA42 0x72DF +0xAA43 0xAA48 0x72E2 +0xAA49 0xAA4A 0x72EA +0xAA4B 0xAA4C 0x72F5 +0xAA4D 0x72F9 +0xAA4E 0xAA51 0x72FD +0xAA52 0x7302 +0xAA53 0xAA58 0x7304 +0xAA59 0xAA5B 0x730B +0xAA5C 0xAA5F 0x730F +0xAA60 0x7314 +0xAA61 0xAA63 0x7318 +0xAA64 0xAA65 0x731F +0xAA66 0xAA67 0x7323 +0xAA68 0xAA6A 0x7326 +0xAA6B 0x732D +0xAA6C 0xAA6D 0x732F +0xAA6E 0xAA6F 0x7332 +0xAA70 0xAA71 0x7335 +0xAA72 0xAA75 0x733A +0xAA76 0xAA7E 0x7340 +0xAA80 0xAA83 0x7349 +0xAA84 0xAA85 0x734E +0xAA86 0x7351 +0xAA87 0xAA8A 0x7353 +0xAA8B 0xAA92 0x7358 +0xAA93 0xAA9D 0x7361 +0xAA9E 0x736E +0xAA9F 0xAAA0 0x7370 +0xAAA1 0x3000 +0xAAA2 0x3000 +0xAAA3 0x3000 +0xAAA4 0x3000 +0xAAA5 0x3000 +0xAAA6 0x3000 +0xAAA7 0x3000 +0xAAA8 0x3000 +0xAAA9 0x3000 +0xAAAA 0x3000 +0xAAAB 0x3000 +0xAAAC 0x3000 +0xAAAD 0x3000 +0xAAAE 0x3000 +0xAAAF 0x3000 +0xAAB0 0x3000 +0xAAB1 0x3000 +0xAAB2 0x3000 +0xAAB3 0x3000 +0xAAB4 0x3000 +0xAAB5 0x3000 +0xAAB6 0x3000 +0xAAB7 0x3000 +0xAAB8 0x3000 +0xAAB9 0x3000 +0xAABA 0x3000 +0xAABB 0x3000 +0xAABC 0x3000 +0xAABD 0x3000 +0xAABE 0x3000 +0xAABF 0x3000 +0xAAC0 0x3000 +0xAAC1 0x3000 +0xAAC2 0x3000 +0xAAC3 0x3000 +0xAAC4 0x3000 +0xAAC5 0x3000 +0xAAC6 0x3000 +0xAAC7 0x3000 +0xAAC8 0x3000 +0xAAC9 0x3000 +0xAACA 0x3000 +0xAACB 0x3000 +0xAACC 0x3000 +0xAACD 0x3000 +0xAACE 0x3000 +0xAACF 0x3000 +0xAAD0 0x3000 +0xAAD1 0x3000 +0xAAD2 0x3000 +0xAAD3 0x3000 +0xAAD4 0x3000 +0xAAD5 0x3000 +0xAAD6 0x3000 +0xAAD7 0x3000 +0xAAD8 0x3000 +0xAAD9 0x3000 +0xAADA 0x3000 +0xAADB 0x3000 +0xAADC 0x3000 +0xAADD 0x3000 +0xAADE 0x3000 +0xAADF 0x3000 +0xAAE0 0x3000 +0xAAE1 0x3000 +0xAAE2 0x3000 +0xAAE3 0x3000 +0xAAE4 0x3000 +0xAAE5 0x3000 +0xAAE6 0x3000 +0xAAE7 0x3000 +0xAAE8 0x3000 +0xAAE9 0x3000 +0xAAEA 0x3000 +0xAAEB 0x3000 +0xAAEC 0x3000 +0xAAED 0x3000 +0xAAEE 0x3000 +0xAAEF 0x3000 +0xAAF0 0x3000 +0xAAF1 0x3000 +0xAAF2 0x3000 +0xAAF3 0x3000 +0xAAF4 0x3000 +0xAAF5 0x3000 +0xAAF6 0x3000 +0xAAF7 0x3000 +0xAAF8 0x3000 +0xAAF9 0x3000 +0xAAFA 0x3000 +0xAAFB 0x3000 +0xAAFC 0x3000 +0xAAFD 0x3000 +0xAAFE 0x3000 +0xAB40 0xAB4B 0x7372 +0xAB4C 0xAB50 0x737F +0xAB51 0xAB52 0x7385 +0xAB53 0x7388 +0xAB54 0x738A +0xAB55 0xAB56 0x738C +0xAB57 0xAB58 0x738F +0xAB59 0xAB5C 0x7392 +0xAB5D 0xAB60 0x7397 +0xAB61 0xAB63 0x739C +0xAB64 0xAB65 0x73A0 +0xAB66 0xAB6B 0x73A3 +0xAB6C 0x73AA +0xAB6D 0xAB6E 0x73AC +0xAB6F 0x73B1 +0xAB70 0xAB72 0x73B4 +0xAB73 0xAB74 0x73B8 +0xAB75 0xAB78 0x73BC +0xAB79 0x73C1 +0xAB7A 0xAB7E 0x73C3 +0xAB80 0xAB81 0x73CB +0xAB82 0x73CE +0xAB83 0xAB89 0x73D2 +0xAB8A 0xAB8D 0x73DA +0xAB8E 0x73DF +0xAB8F 0xAB92 0x73E1 +0xAB93 0x73E6 +0xAB94 0x73E8 +0xAB95 0xAB97 0x73EA +0xAB98 0xAB9B 0x73EE +0xAB9C 0xABA0 0x73F3 +0xABA1 0x3000 +0xABA2 0x3000 +0xABA3 0x3000 +0xABA4 0x3000 +0xABA5 0x3000 +0xABA6 0x3000 +0xABA7 0x3000 +0xABA8 0x3000 +0xABA9 0x3000 +0xABAA 0x3000 +0xABAB 0x3000 +0xABAC 0x3000 +0xABAD 0x3000 +0xABAE 0x3000 +0xABAF 0x3000 +0xABB0 0x3000 +0xABB1 0x3000 +0xABB2 0x3000 +0xABB3 0x3000 +0xABB4 0x3000 +0xABB5 0x3000 +0xABB6 0x3000 +0xABB7 0x3000 +0xABB8 0x3000 +0xABB9 0x3000 +0xABBA 0x3000 +0xABBB 0x3000 +0xABBC 0x3000 +0xABBD 0x3000 +0xABBE 0x3000 +0xABBF 0x3000 +0xABC0 0x3000 +0xABC1 0x3000 +0xABC2 0x3000 +0xABC3 0x3000 +0xABC4 0x3000 +0xABC5 0x3000 +0xABC6 0x3000 +0xABC7 0x3000 +0xABC8 0x3000 +0xABC9 0x3000 +0xABCA 0x3000 +0xABCB 0x3000 +0xABCC 0x3000 +0xABCD 0x3000 +0xABCE 0x3000 +0xABCF 0x3000 +0xABD0 0x3000 +0xABD1 0x3000 +0xABD2 0x3000 +0xABD3 0x3000 +0xABD4 0x3000 +0xABD5 0x3000 +0xABD6 0x3000 +0xABD7 0x3000 +0xABD8 0x3000 +0xABD9 0x3000 +0xABDA 0x3000 +0xABDB 0x3000 +0xABDC 0x3000 +0xABDD 0x3000 +0xABDE 0x3000 +0xABDF 0x3000 +0xABE0 0x3000 +0xABE1 0x3000 +0xABE2 0x3000 +0xABE3 0x3000 +0xABE4 0x3000 +0xABE5 0x3000 +0xABE6 0x3000 +0xABE7 0x3000 +0xABE8 0x3000 +0xABE9 0x3000 +0xABEA 0x3000 +0xABEB 0x3000 +0xABEC 0x3000 +0xABED 0x3000 +0xABEE 0x3000 +0xABEF 0x3000 +0xABF0 0x3000 +0xABF1 0x3000 +0xABF2 0x3000 +0xABF3 0x3000 +0xABF4 0x3000 +0xABF5 0x3000 +0xABF6 0x3000 +0xABF7 0x3000 +0xABF8 0x3000 +0xABF9 0x3000 +0xABFA 0x3000 +0xABFB 0x3000 +0xABFC 0x3000 +0xABFD 0x3000 +0xABFE 0x3000 +0xAC40 0xAC4A 0x73F8 +0xAC4B 0x7404 +0xAC4C 0xAC4D 0x7407 +0xAC4E 0xAC51 0x740B +0xAC52 0xAC5A 0x7411 +0xAC5B 0xAC60 0x741C +0xAC61 0xAC62 0x7423 +0xAC63 0x7427 +0xAC64 0x7429 +0xAC65 0x742B +0xAC66 0x742D +0xAC67 0x742F +0xAC68 0xAC69 0x7431 +0xAC6A 0xAC6E 0x7437 +0xAC6F 0xAC72 0x743D +0xAC73 0xAC7E 0x7442 +0xAC80 0xAC86 0x744E +0xAC87 0x7456 +0xAC88 0x7458 +0xAC89 0x745D +0xAC8A 0xAC96 0x7460 +0xAC97 0xAC98 0x746E +0xAC99 0xAC9D 0x7471 +0xAC9E 0xACA0 0x7478 +0xACA1 0x3000 +0xACA2 0x3000 +0xACA3 0x3000 +0xACA4 0x3000 +0xACA5 0x3000 +0xACA6 0x3000 +0xACA7 0x3000 +0xACA8 0x3000 +0xACA9 0x3000 +0xACAA 0x3000 +0xACAB 0x3000 +0xACAC 0x3000 +0xACAD 0x3000 +0xACAE 0x3000 +0xACAF 0x3000 +0xACB0 0x3000 +0xACB1 0x3000 +0xACB2 0x3000 +0xACB3 0x3000 +0xACB4 0x3000 +0xACB5 0x3000 +0xACB6 0x3000 +0xACB7 0x3000 +0xACB8 0x3000 +0xACB9 0x3000 +0xACBA 0x3000 +0xACBB 0x3000 +0xACBC 0x3000 +0xACBD 0x3000 +0xACBE 0x3000 +0xACBF 0x3000 +0xACC0 0x3000 +0xACC1 0x3000 +0xACC2 0x3000 +0xACC3 0x3000 +0xACC4 0x3000 +0xACC5 0x3000 +0xACC6 0x3000 +0xACC7 0x3000 +0xACC8 0x3000 +0xACC9 0x3000 +0xACCA 0x3000 +0xACCB 0x3000 +0xACCC 0x3000 +0xACCD 0x3000 +0xACCE 0x3000 +0xACCF 0x3000 +0xACD0 0x3000 +0xACD1 0x3000 +0xACD2 0x3000 +0xACD3 0x3000 +0xACD4 0x3000 +0xACD5 0x3000 +0xACD6 0x3000 +0xACD7 0x3000 +0xACD8 0x3000 +0xACD9 0x3000 +0xACDA 0x3000 +0xACDB 0x3000 +0xACDC 0x3000 +0xACDD 0x3000 +0xACDE 0x3000 +0xACDF 0x3000 +0xACE0 0x3000 +0xACE1 0x3000 +0xACE2 0x3000 +0xACE3 0x3000 +0xACE4 0x3000 +0xACE5 0x3000 +0xACE6 0x3000 +0xACE7 0x3000 +0xACE8 0x3000 +0xACE9 0x3000 +0xACEA 0x3000 +0xACEB 0x3000 +0xACEC 0x3000 +0xACED 0x3000 +0xACEE 0x3000 +0xACEF 0x3000 +0xACF0 0x3000 +0xACF1 0x3000 +0xACF2 0x3000 +0xACF3 0x3000 +0xACF4 0x3000 +0xACF5 0x3000 +0xACF6 0x3000 +0xACF7 0x3000 +0xACF8 0x3000 +0xACF9 0x3000 +0xACFA 0x3000 +0xACFB 0x3000 +0xACFC 0x3000 +0xACFD 0x3000 +0xACFE 0x3000 +0xAD40 0xAD42 0x747B +0xAD43 0x747F +0xAD44 0x7482 +0xAD45 0xAD47 0x7484 +0xAD48 0xAD4A 0x7488 +0xAD4B 0xAD4C 0x748C +0xAD4D 0x748F +0xAD4E 0xAD58 0x7491 +0xAD59 0x749D +0xAD5A 0xAD61 0x749F +0xAD62 0xAD71 0x74AA +0xAD72 0xAD7E 0x74BB +0xAD80 0xAD89 0x74C8 +0xAD8A 0xAD92 0x74D3 +0xAD93 0x74DD +0xAD94 0x74DF +0xAD95 0x74E1 +0xAD96 0x74E5 +0xAD97 0xAD9D 0x74E7 +0xAD9E 0xADA0 0x74F0 +0xADA1 0x3000 +0xADA2 0x3000 +0xADA3 0x3000 +0xADA4 0x3000 +0xADA5 0x3000 +0xADA6 0x3000 +0xADA7 0x3000 +0xADA8 0x3000 +0xADA9 0x3000 +0xADAA 0x3000 +0xADAB 0x3000 +0xADAC 0x3000 +0xADAD 0x3000 +0xADAE 0x3000 +0xADAF 0x3000 +0xADB0 0x3000 +0xADB1 0x3000 +0xADB2 0x3000 +0xADB3 0x3000 +0xADB4 0x3000 +0xADB5 0x3000 +0xADB6 0x3000 +0xADB7 0x3000 +0xADB8 0x3000 +0xADB9 0x3000 +0xADBA 0x3000 +0xADBB 0x3000 +0xADBC 0x3000 +0xADBD 0x3000 +0xADBE 0x3000 +0xADBF 0x3000 +0xADC0 0x3000 +0xADC1 0x3000 +0xADC2 0x3000 +0xADC3 0x3000 +0xADC4 0x3000 +0xADC5 0x3000 +0xADC6 0x3000 +0xADC7 0x3000 +0xADC8 0x3000 +0xADC9 0x3000 +0xADCA 0x3000 +0xADCB 0x3000 +0xADCC 0x3000 +0xADCD 0x3000 +0xADCE 0x3000 +0xADCF 0x3000 +0xADD0 0x3000 +0xADD1 0x3000 +0xADD2 0x3000 +0xADD3 0x3000 +0xADD4 0x3000 +0xADD5 0x3000 +0xADD6 0x3000 +0xADD7 0x3000 +0xADD8 0x3000 +0xADD9 0x3000 +0xADDA 0x3000 +0xADDB 0x3000 +0xADDC 0x3000 +0xADDD 0x3000 +0xADDE 0x3000 +0xADDF 0x3000 +0xADE0 0x3000 +0xADE1 0x3000 +0xADE2 0x3000 +0xADE3 0x3000 +0xADE4 0x3000 +0xADE5 0x3000 +0xADE6 0x3000 +0xADE7 0x3000 +0xADE8 0x3000 +0xADE9 0x3000 +0xADEA 0x3000 +0xADEB 0x3000 +0xADEC 0x3000 +0xADED 0x3000 +0xADEE 0x3000 +0xADEF 0x3000 +0xADF0 0x3000 +0xADF1 0x3000 +0xADF2 0x3000 +0xADF3 0x3000 +0xADF4 0x3000 +0xADF5 0x3000 +0xADF6 0x3000 +0xADF7 0x3000 +0xADF8 0x3000 +0xADF9 0x3000 +0xADFA 0x3000 +0xADFB 0x3000 +0xADFC 0x3000 +0xADFD 0x3000 +0xADFE 0x3000 +0xAE40 0x74F3 +0xAE41 0x74F5 +0xAE42 0xAE48 0x74F8 +0xAE49 0xAE4C 0x7500 +0xAE4D 0xAE54 0x7505 +0xAE55 0x750E +0xAE56 0x7510 +0xAE57 0x7512 +0xAE58 0xAE5B 0x7514 +0xAE5C 0x751B +0xAE5D 0xAE5E 0x751D +0xAE5F 0xAE63 0x7520 +0xAE64 0xAE65 0x7526 +0xAE66 0x752A +0xAE67 0x752E +0xAE68 0x7534 +0xAE69 0x7536 +0xAE6A 0x7539 +0xAE6B 0xAE6C 0x753C +0xAE6D 0x753F +0xAE6E 0xAE71 0x7541 +0xAE72 0xAE73 0x7546 +0xAE74 0xAE75 0x7549 +0xAE76 0x754D +0xAE77 0xAE7A 0x7550 +0xAE7B 0xAE7E 0x7555 +0xAE80 0xAE87 0x755D +0xAE88 0xAE8A 0x7567 +0xAE8B 0xAE91 0x756B +0xAE92 0x7573 +0xAE93 0xAE95 0x7575 +0xAE96 0xAE9A 0x757A +0xAE9B 0xAE9D 0x7580 +0xAE9E 0xAE9F 0x7584 +0xAEA0 0x7587 +0xAEA1 0x3000 +0xAEA2 0x3000 +0xAEA3 0x3000 +0xAEA4 0x3000 +0xAEA5 0x3000 +0xAEA6 0x3000 +0xAEA7 0x3000 +0xAEA8 0x3000 +0xAEA9 0x3000 +0xAEAA 0x3000 +0xAEAB 0x3000 +0xAEAC 0x3000 +0xAEAD 0x3000 +0xAEAE 0x3000 +0xAEAF 0x3000 +0xAEB0 0x3000 +0xAEB1 0x3000 +0xAEB2 0x3000 +0xAEB3 0x3000 +0xAEB4 0x3000 +0xAEB5 0x3000 +0xAEB6 0x3000 +0xAEB7 0x3000 +0xAEB8 0x3000 +0xAEB9 0x3000 +0xAEBA 0x3000 +0xAEBB 0x3000 +0xAEBC 0x3000 +0xAEBD 0x3000 +0xAEBE 0x3000 +0xAEBF 0x3000 +0xAEC0 0x3000 +0xAEC1 0x3000 +0xAEC2 0x3000 +0xAEC3 0x3000 +0xAEC4 0x3000 +0xAEC5 0x3000 +0xAEC6 0x3000 +0xAEC7 0x3000 +0xAEC8 0x3000 +0xAEC9 0x3000 +0xAECA 0x3000 +0xAECB 0x3000 +0xAECC 0x3000 +0xAECD 0x3000 +0xAECE 0x3000 +0xAECF 0x3000 +0xAED0 0x3000 +0xAED1 0x3000 +0xAED2 0x3000 +0xAED3 0x3000 +0xAED4 0x3000 +0xAED5 0x3000 +0xAED6 0x3000 +0xAED7 0x3000 +0xAED8 0x3000 +0xAED9 0x3000 +0xAEDA 0x3000 +0xAEDB 0x3000 +0xAEDC 0x3000 +0xAEDD 0x3000 +0xAEDE 0x3000 +0xAEDF 0x3000 +0xAEE0 0x3000 +0xAEE1 0x3000 +0xAEE2 0x3000 +0xAEE3 0x3000 +0xAEE4 0x3000 +0xAEE5 0x3000 +0xAEE6 0x3000 +0xAEE7 0x3000 +0xAEE8 0x3000 +0xAEE9 0x3000 +0xAEEA 0x3000 +0xAEEB 0x3000 +0xAEEC 0x3000 +0xAEED 0x3000 +0xAEEE 0x3000 +0xAEEF 0x3000 +0xAEF0 0x3000 +0xAEF1 0x3000 +0xAEF2 0x3000 +0xAEF3 0x3000 +0xAEF4 0x3000 +0xAEF5 0x3000 +0xAEF6 0x3000 +0xAEF7 0x3000 +0xAEF8 0x3000 +0xAEF9 0x3000 +0xAEFA 0x3000 +0xAEFB 0x3000 +0xAEFC 0x3000 +0xAEFD 0x3000 +0xAEFE 0x3000 +0xAF40 0xAF42 0x7588 +0xAF43 0xAF45 0x758C +0xAF46 0x7590 +0xAF47 0x7593 +0xAF48 0x7595 +0xAF49 0x7598 +0xAF4A 0xAF4B 0x759B +0xAF4C 0x759E +0xAF4D 0x75A2 +0xAF4E 0xAF52 0x75A6 +0xAF53 0x75AD +0xAF54 0xAF55 0x75B6 +0xAF56 0xAF57 0x75BA +0xAF58 0xAF5A 0x75BF +0xAF5B 0x75C6 +0xAF5C 0xAF5D 0x75CB +0xAF5E 0xAF61 0x75CE +0xAF62 0x75D3 +0xAF63 0x75D7 +0xAF64 0xAF65 0x75D9 +0xAF66 0xAF67 0x75DC +0xAF68 0xAF6A 0x75DF +0xAF6B 0x75E5 +0xAF6C 0x75E9 +0xAF6D 0xAF70 0x75EC +0xAF71 0xAF72 0x75F2 +0xAF73 0xAF76 0x75F5 +0xAF77 0xAF78 0x75FA +0xAF79 0xAF7A 0x75FD +0xAF7B 0x7602 +0xAF7C 0x7604 +0xAF7D 0xAF7E 0x7606 +0xAF80 0xAF81 0x7608 +0xAF82 0x760B +0xAF83 0xAF85 0x760D +0xAF86 0xAF89 0x7611 +0xAF8A 0x7616 +0xAF8B 0x761A +0xAF8C 0xAF8E 0x761C +0xAF8F 0x7621 +0xAF90 0x7623 +0xAF91 0xAF92 0x7627 +0xAF93 0x762C +0xAF94 0xAF95 0x762E +0xAF96 0xAF97 0x7631 +0xAF98 0xAF99 0x7636 +0xAF9A 0xAF9C 0x7639 +0xAF9D 0x763D +0xAF9E 0xAF9F 0x7641 +0xAFA0 0x7644 +0xAFA1 0x3000 +0xAFA2 0x3000 +0xAFA3 0x3000 +0xAFA4 0x3000 +0xAFA5 0x3000 +0xAFA6 0x3000 +0xAFA7 0x3000 +0xAFA8 0x3000 +0xAFA9 0x3000 +0xAFAA 0x3000 +0xAFAB 0x3000 +0xAFAC 0x3000 +0xAFAD 0x3000 +0xAFAE 0x3000 +0xAFAF 0x3000 +0xAFB0 0x3000 +0xAFB1 0x3000 +0xAFB2 0x3000 +0xAFB3 0x3000 +0xAFB4 0x3000 +0xAFB5 0x3000 +0xAFB6 0x3000 +0xAFB7 0x3000 +0xAFB8 0x3000 +0xAFB9 0x3000 +0xAFBA 0x3000 +0xAFBB 0x3000 +0xAFBC 0x3000 +0xAFBD 0x3000 +0xAFBE 0x3000 +0xAFBF 0x3000 +0xAFC0 0x3000 +0xAFC1 0x3000 +0xAFC2 0x3000 +0xAFC3 0x3000 +0xAFC4 0x3000 +0xAFC5 0x3000 +0xAFC6 0x3000 +0xAFC7 0x3000 +0xAFC8 0x3000 +0xAFC9 0x3000 +0xAFCA 0x3000 +0xAFCB 0x3000 +0xAFCC 0x3000 +0xAFCD 0x3000 +0xAFCE 0x3000 +0xAFCF 0x3000 +0xAFD0 0x3000 +0xAFD1 0x3000 +0xAFD2 0x3000 +0xAFD3 0x3000 +0xAFD4 0x3000 +0xAFD5 0x3000 +0xAFD6 0x3000 +0xAFD7 0x3000 +0xAFD8 0x3000 +0xAFD9 0x3000 +0xAFDA 0x3000 +0xAFDB 0x3000 +0xAFDC 0x3000 +0xAFDD 0x3000 +0xAFDE 0x3000 +0xAFDF 0x3000 +0xAFE0 0x3000 +0xAFE1 0x3000 +0xAFE2 0x3000 +0xAFE3 0x3000 +0xAFE4 0x3000 +0xAFE5 0x3000 +0xAFE6 0x3000 +0xAFE7 0x3000 +0xAFE8 0x3000 +0xAFE9 0x3000 +0xAFEA 0x3000 +0xAFEB 0x3000 +0xAFEC 0x3000 +0xAFED 0x3000 +0xAFEE 0x3000 +0xAFEF 0x3000 +0xAFF0 0x3000 +0xAFF1 0x3000 +0xAFF2 0x3000 +0xAFF3 0x3000 +0xAFF4 0x3000 +0xAFF5 0x3000 +0xAFF6 0x3000 +0xAFF7 0x3000 +0xAFF8 0x3000 +0xAFF9 0x3000 +0xAFFA 0x3000 +0xAFFB 0x3000 +0xAFFC 0x3000 +0xAFFD 0x3000 +0xAFFE 0x3000 +0xB040 0xB046 0x7645 +0xB047 0xB04C 0x764E +0xB04D 0x7655 +0xB04E 0xB052 0x7657 +0xB053 0x765D +0xB054 0xB057 0x765F +0xB058 0xB05E 0x7664 +0xB05F 0xB061 0x766C +0xB062 0xB069 0x7670 +0xB06A 0xB06B 0x7679 +0xB06C 0x767C +0xB06D 0xB06F 0x767F +0xB070 0x7683 +0xB071 0x7685 +0xB072 0xB073 0x7689 +0xB074 0xB075 0x768C +0xB076 0xB077 0x768F +0xB078 0x7692 +0xB079 0xB07A 0x7694 +0xB07B 0xB07C 0x7697 +0xB07D 0xB07E 0x769A +0xB080 0xB087 0x769C +0xB088 0xB090 0x76A5 +0xB091 0xB092 0x76AF +0xB093 0x76B3 +0xB094 0xB09D 0x76B5 +0xB09E 0xB09F 0x76C0 +0xB0A0 0x76C3 +0xB0A1 0x554A +0xB0A2 0x963F +0xB0A3 0x57C3 +0xB0A4 0x6328 +0xB0A5 0x54CE +0xB0A6 0x5509 +0xB0A7 0x54C0 +0xB0A8 0x7691 +0xB0A9 0x764C +0xB0AA 0x853C +0xB0AB 0x77EE +0xB0AC 0x827E +0xB0AD 0x788D +0xB0AE 0x7231 +0xB0AF 0x9698 +0xB0B0 0x978D +0xB0B1 0x6C28 +0xB0B2 0x5B89 +0xB0B3 0x4FFA +0xB0B4 0x6309 +0xB0B5 0x6697 +0xB0B6 0x5CB8 +0xB0B7 0x80FA +0xB0B8 0x6848 +0xB0B9 0x80AE +0xB0BA 0x6602 +0xB0BB 0x76CE +0xB0BC 0x51F9 +0xB0BD 0x6556 +0xB0BE 0x71AC +0xB0BF 0x7FF1 +0xB0C0 0x8884 +0xB0C1 0x50B2 +0xB0C2 0x5965 +0xB0C3 0x61CA +0xB0C4 0x6FB3 +0xB0C5 0x82AD +0xB0C6 0x634C +0xB0C7 0x6252 +0xB0C8 0x53ED +0xB0C9 0x5427 +0xB0CA 0x7B06 +0xB0CB 0x516B +0xB0CC 0x75A4 +0xB0CD 0x5DF4 +0xB0CE 0x62D4 +0xB0CF 0x8DCB +0xB0D0 0x9776 +0xB0D1 0x628A +0xB0D2 0x8019 +0xB0D3 0x575D +0xB0D4 0x9738 +0xB0D5 0x7F62 +0xB0D6 0x7238 +0xB0D7 0x767D +0xB0D8 0x67CF +0xB0D9 0x767E +0xB0DA 0x6446 +0xB0DB 0x4F70 +0xB0DC 0x8D25 +0xB0DD 0x62DC +0xB0DE 0x7A17 +0xB0DF 0x6591 +0xB0E0 0x73ED +0xB0E1 0x642C +0xB0E2 0x6273 +0xB0E3 0x822C +0xB0E4 0x9881 +0xB0E5 0x677F +0xB0E6 0x7248 +0xB0E7 0x626E +0xB0E8 0x62CC +0xB0E9 0x4F34 +0xB0EA 0x74E3 +0xB0EB 0x534A +0xB0EC 0x529E +0xB0ED 0x7ECA +0xB0EE 0x90A6 +0xB0EF 0x5E2E +0xB0F0 0x6886 +0xB0F1 0x699C +0xB0F2 0x8180 +0xB0F3 0x7ED1 +0xB0F4 0x68D2 +0xB0F5 0x78C5 +0xB0F6 0x868C +0xB0F7 0x9551 +0xB0F8 0x508D +0xB0F9 0x8C24 +0xB0FA 0x82DE +0xB0FB 0x80DE +0xB0FC 0x5305 +0xB0FD 0x8912 +0xB0FE 0x5265 +0xB140 0x76C4 +0xB141 0x76C7 +0xB142 0x76C9 +0xB143 0xB144 0x76CB +0xB145 0x76D3 +0xB146 0x76D5 +0xB147 0xB148 0x76D9 +0xB149 0xB14B 0x76DC +0xB14C 0xB150 0x76E0 +0xB151 0xB158 0x76E6 +0xB159 0x76F0 +0xB15A 0x76F3 +0xB15B 0xB15D 0x76F5 +0xB15E 0xB15F 0x76FA +0xB160 0x76FD +0xB161 0xB162 0x76FF +0xB163 0xB164 0x7702 +0xB165 0xB166 0x7705 +0xB167 0x770A +0xB168 0x770C +0xB169 0xB173 0x770E +0xB174 0xB177 0x771B +0xB178 0x7721 +0xB179 0xB17B 0x7723 +0xB17C 0x7727 +0xB17D 0xB17E 0x772A +0xB180 0x772C +0xB181 0x772E +0xB182 0xB186 0x7730 +0xB187 0x7739 +0xB188 0x773B +0xB189 0xB18B 0x773D +0xB18C 0x7742 +0xB18D 0xB18F 0x7744 +0xB190 0xB197 0x7748 +0xB198 0xB19F 0x7752 +0xB1A0 0x775C +0xB1A1 0x8584 +0xB1A2 0x96F9 +0xB1A3 0x4FDD +0xB1A4 0x5821 +0xB1A5 0x9971 +0xB1A6 0x5B9D +0xB1A7 0x62B1 +0xB1A8 0x62A5 +0xB1A9 0x66B4 +0xB1AA 0x8C79 +0xB1AB 0x9C8D +0xB1AC 0x7206 +0xB1AD 0x676F +0xB1AE 0x7891 +0xB1AF 0x60B2 +0xB1B0 0x5351 +0xB1B1 0x5317 +0xB1B2 0x8F88 +0xB1B3 0x80CC +0xB1B4 0x8D1D +0xB1B5 0x94A1 +0xB1B6 0x500D +0xB1B7 0x72C8 +0xB1B8 0x5907 +0xB1B9 0x60EB +0xB1BA 0x7119 +0xB1BB 0x88AB +0xB1BC 0x5954 +0xB1BD 0x82EF +0xB1BE 0x672C +0xB1BF 0x7B28 +0xB1C0 0x5D29 +0xB1C1 0x7EF7 +0xB1C2 0x752D +0xB1C3 0x6CF5 +0xB1C4 0x8E66 +0xB1C5 0x8FF8 +0xB1C6 0x903C +0xB1C7 0x9F3B +0xB1C8 0x6BD4 +0xB1C9 0x9119 +0xB1CA 0x7B14 +0xB1CB 0x5F7C +0xB1CC 0x78A7 +0xB1CD 0x84D6 +0xB1CE 0x853D +0xB1CF 0x6BD5 +0xB1D0 0x6BD9 +0xB1D1 0x6BD6 +0xB1D2 0x5E01 +0xB1D3 0x5E87 +0xB1D4 0x75F9 +0xB1D5 0x95ED +0xB1D6 0x655D +0xB1D7 0x5F0A +0xB1D8 0x5FC5 +0xB1D9 0x8F9F +0xB1DA 0x58C1 +0xB1DB 0x81C2 +0xB1DC 0x907F +0xB1DD 0x965B +0xB1DE 0x97AD +0xB1DF 0x8FB9 +0xB1E0 0x7F16 +0xB1E1 0x8D2C +0xB1E2 0x6241 +0xB1E3 0x4FBF +0xB1E4 0x53D8 +0xB1E5 0x535E +0xB1E6 0xB1E7 0x8FA8 +0xB1E8 0x8FAB +0xB1E9 0x904D +0xB1EA 0x6807 +0xB1EB 0x5F6A +0xB1EC 0x8198 +0xB1ED 0x8868 +0xB1EE 0x9CD6 +0xB1EF 0x618B +0xB1F0 0x522B +0xB1F1 0x762A +0xB1F2 0x5F6C +0xB1F3 0x658C +0xB1F4 0x6FD2 +0xB1F5 0x6EE8 +0xB1F6 0x5BBE +0xB1F7 0x6448 +0xB1F8 0x5175 +0xB1F9 0x51B0 +0xB1FA 0x67C4 +0xB1FB 0x4E19 +0xB1FC 0x79C9 +0xB1FD 0x997C +0xB1FE 0x70B3 +0xB240 0xB243 0x775D +0xB244 0x7764 +0xB245 0x7767 +0xB246 0xB247 0x7769 +0xB248 0xB253 0x776D +0xB254 0xB256 0x777A +0xB257 0xB259 0x7781 +0xB25A 0xB25F 0x7786 +0xB260 0xB261 0x778F +0xB262 0xB26D 0x7793 +0xB26E 0x77A1 +0xB26F 0xB270 0x77A3 +0xB271 0x77A6 +0xB272 0x77A8 +0xB273 0x77AB +0xB274 0xB276 0x77AD +0xB277 0xB278 0x77B1 +0xB279 0x77B4 +0xB27A 0xB27E 0x77B6 +0xB280 0x77BC +0xB281 0x77BE +0xB282 0xB28E 0x77C0 +0xB28F 0xB297 0x77CE +0xB298 0xB29A 0x77D8 +0xB29B 0xB29F 0x77DD +0xB2A0 0x77E4 +0xB2A1 0x75C5 +0xB2A2 0x5E76 +0xB2A3 0x73BB +0xB2A4 0x83E0 +0xB2A5 0x64AD +0xB2A6 0x62E8 +0xB2A7 0x94B5 +0xB2A8 0x6CE2 +0xB2A9 0x535A +0xB2AA 0x52C3 +0xB2AB 0x640F +0xB2AC 0x94C2 +0xB2AD 0x7B94 +0xB2AE 0x4F2F +0xB2AF 0x5E1B +0xB2B0 0x8236 +0xB2B1 0x8116 +0xB2B2 0x818A +0xB2B3 0x6E24 +0xB2B4 0x6CCA +0xB2B5 0x9A73 +0xB2B6 0x6355 +0xB2B7 0x535C +0xB2B8 0x54FA +0xB2B9 0x8865 +0xB2BA 0x57E0 +0xB2BB 0x4E0D +0xB2BC 0x5E03 +0xB2BD 0x6B65 +0xB2BE 0x7C3F +0xB2BF 0x90E8 +0xB2C0 0x6016 +0xB2C1 0x64E6 +0xB2C2 0x731C +0xB2C3 0x88C1 +0xB2C4 0x6750 +0xB2C5 0x624D +0xB2C6 0x8D22 +0xB2C7 0x776C +0xB2C8 0x8E29 +0xB2C9 0x91C7 +0xB2CA 0x5F69 +0xB2CB 0x83DC +0xB2CC 0x8521 +0xB2CD 0x9910 +0xB2CE 0x53C2 +0xB2CF 0x8695 +0xB2D0 0x6B8B +0xB2D1 0x60ED +0xB2D2 0x60E8 +0xB2D3 0x707F +0xB2D4 0x82CD +0xB2D5 0x8231 +0xB2D6 0x4ED3 +0xB2D7 0x6CA7 +0xB2D8 0x85CF +0xB2D9 0x64CD +0xB2DA 0x7CD9 +0xB2DB 0x69FD +0xB2DC 0x66F9 +0xB2DD 0x8349 +0xB2DE 0x5395 +0xB2DF 0x7B56 +0xB2E0 0x4FA7 +0xB2E1 0x518C +0xB2E2 0x6D4B +0xB2E3 0x5C42 +0xB2E4 0x8E6D +0xB2E5 0x63D2 +0xB2E6 0x53C9 +0xB2E7 0x832C +0xB2E8 0x8336 +0xB2E9 0x67E5 +0xB2EA 0x78B4 +0xB2EB 0x643D +0xB2EC 0x5BDF +0xB2ED 0x5C94 +0xB2EE 0x5DEE +0xB2EF 0x8BE7 +0xB2F0 0x62C6 +0xB2F1 0x67F4 +0xB2F2 0x8C7A +0xB2F3 0x6400 +0xB2F4 0x63BA +0xB2F5 0x8749 +0xB2F6 0x998B +0xB2F7 0x8C17 +0xB2F8 0x7F20 +0xB2F9 0x94F2 +0xB2FA 0x4EA7 +0xB2FB 0x9610 +0xB2FC 0x98A4 +0xB2FD 0x660C +0xB2FE 0x7316 +0xB340 0x77E6 +0xB341 0x77E8 +0xB342 0x77EA +0xB343 0xB346 0x77EF +0xB347 0xB348 0x77F4 +0xB349 0x77F7 +0xB34A 0xB34D 0x77F9 +0xB34E 0xB353 0x7803 +0xB354 0xB355 0x780A +0xB356 0xB358 0x780E +0xB359 0x7813 +0xB35A 0x7815 +0xB35B 0x7819 +0xB35C 0x781B +0xB35D 0x781E +0xB35E 0xB360 0x7820 +0xB361 0x7824 +0xB362 0x7828 +0xB363 0xB364 0x782A +0xB365 0xB366 0x782E +0xB367 0xB369 0x7831 +0xB36A 0xB36B 0x7835 +0xB36C 0x783D +0xB36D 0x783F +0xB36E 0xB371 0x7841 +0xB372 0x7846 +0xB373 0xB376 0x7848 +0xB377 0x784D +0xB378 0x784F +0xB379 0x7851 +0xB37A 0xB37B 0x7853 +0xB37C 0xB37E 0x7858 +0xB380 0xB381 0x785B +0xB382 0xB38D 0x785E +0xB38E 0xB395 0x786F +0xB396 0xB399 0x7878 +0xB39A 0xB3A0 0x787D +0xB3A1 0x573A +0xB3A2 0x5C1D +0xB3A3 0x5E38 +0xB3A4 0x957F +0xB3A5 0x507F +0xB3A6 0x80A0 +0xB3A7 0x5382 +0xB3A8 0x655E +0xB3A9 0x7545 +0xB3AA 0x5531 +0xB3AB 0x5021 +0xB3AC 0x8D85 +0xB3AD 0x6284 +0xB3AE 0x949E +0xB3AF 0x671D +0xB3B0 0x5632 +0xB3B1 0x6F6E +0xB3B2 0x5DE2 +0xB3B3 0x5435 +0xB3B4 0x7092 +0xB3B5 0x8F66 +0xB3B6 0x626F +0xB3B7 0x64A4 +0xB3B8 0x63A3 +0xB3B9 0x5F7B +0xB3BA 0x6F88 +0xB3BB 0x90F4 +0xB3BC 0x81E3 +0xB3BD 0x8FB0 +0xB3BE 0x5C18 +0xB3BF 0x6668 +0xB3C0 0x5FF1 +0xB3C1 0x6C89 +0xB3C2 0x9648 +0xB3C3 0x8D81 +0xB3C4 0x886C +0xB3C5 0x6491 +0xB3C6 0x79F0 +0xB3C7 0x57CE +0xB3C8 0x6A59 +0xB3C9 0x6210 +0xB3CA 0x5448 +0xB3CB 0x4E58 +0xB3CC 0x7A0B +0xB3CD 0x60E9 +0xB3CE 0x6F84 +0xB3CF 0x8BDA +0xB3D0 0x627F +0xB3D1 0x901E +0xB3D2 0x9A8B +0xB3D3 0x79E4 +0xB3D4 0x5403 +0xB3D5 0x75F4 +0xB3D6 0x6301 +0xB3D7 0x5319 +0xB3D8 0x6C60 +0xB3D9 0x8FDF +0xB3DA 0x5F1B +0xB3DB 0x9A70 +0xB3DC 0x803B +0xB3DD 0x9F7F +0xB3DE 0x4F88 +0xB3DF 0x5C3A +0xB3E0 0x8D64 +0xB3E1 0x7FC5 +0xB3E2 0x65A5 +0xB3E3 0x70BD +0xB3E4 0x5145 +0xB3E5 0x51B2 +0xB3E6 0x866B +0xB3E7 0x5D07 +0xB3E8 0x5BA0 +0xB3E9 0x62BD +0xB3EA 0x916C +0xB3EB 0x7574 +0xB3EC 0x8E0C +0xB3ED 0x7A20 +0xB3EE 0x6101 +0xB3EF 0x7B79 +0xB3F0 0x4EC7 +0xB3F1 0x7EF8 +0xB3F2 0x7785 +0xB3F3 0x4E11 +0xB3F4 0x81ED +0xB3F5 0x521D +0xB3F6 0x51FA +0xB3F7 0x6A71 +0xB3F8 0x53A8 +0xB3F9 0x8E87 +0xB3FA 0x9504 +0xB3FB 0x96CF +0xB3FC 0x6EC1 +0xB3FD 0x9664 +0xB3FE 0x695A +0xB440 0xB442 0x7884 +0xB443 0x7888 +0xB444 0xB445 0x788A +0xB446 0xB447 0x788F +0xB448 0x7892 +0xB449 0xB44B 0x7894 +0xB44C 0x7899 +0xB44D 0xB44E 0x789D +0xB44F 0x78A0 +0xB450 0x78A2 +0xB451 0x78A4 +0xB452 0x78A6 +0xB453 0xB45A 0x78A8 +0xB45B 0xB45E 0x78B5 +0xB45F 0xB462 0x78BA +0xB463 0xB464 0x78BF +0xB465 0xB467 0x78C2 +0xB468 0xB46A 0x78C6 +0xB46B 0xB46E 0x78CC +0xB46F 0xB471 0x78D1 +0xB472 0xB474 0x78D6 +0xB475 0xB47E 0x78DA +0xB480 0xB483 0x78E4 +0xB484 0xB486 0x78E9 +0xB487 0xB48B 0x78ED +0xB48C 0x78F3 +0xB48D 0xB48E 0x78F5 +0xB48F 0xB490 0x78F8 +0xB491 0xB496 0x78FB +0xB497 0xB499 0x7902 +0xB49A 0xB4A0 0x7906 +0xB4A1 0x7840 +0xB4A2 0x50A8 +0xB4A3 0x77D7 +0xB4A4 0x6410 +0xB4A5 0x89E6 +0xB4A6 0x5904 +0xB4A7 0x63E3 +0xB4A8 0x5DDD +0xB4A9 0x7A7F +0xB4AA 0x693D +0xB4AB 0x4F20 +0xB4AC 0x8239 +0xB4AD 0x5598 +0xB4AE 0x4E32 +0xB4AF 0x75AE +0xB4B0 0x7A97 +0xB4B1 0x5E62 +0xB4B2 0x5E8A +0xB4B3 0x95EF +0xB4B4 0x521B +0xB4B5 0x5439 +0xB4B6 0x708A +0xB4B7 0x6376 +0xB4B8 0x9524 +0xB4B9 0x5782 +0xB4BA 0x6625 +0xB4BB 0x693F +0xB4BC 0x9187 +0xB4BD 0x5507 +0xB4BE 0x6DF3 +0xB4BF 0x7EAF +0xB4C0 0x8822 +0xB4C1 0x6233 +0xB4C2 0x7EF0 +0xB4C3 0x75B5 +0xB4C4 0x8328 +0xB4C5 0x78C1 +0xB4C6 0x96CC +0xB4C7 0x8F9E +0xB4C8 0x6148 +0xB4C9 0x74F7 +0xB4CA 0x8BCD +0xB4CB 0x6B64 +0xB4CC 0x523A +0xB4CD 0x8D50 +0xB4CE 0x6B21 +0xB4CF 0x806A +0xB4D0 0x8471 +0xB4D1 0x56F1 +0xB4D2 0x5306 +0xB4D3 0x4ECE +0xB4D4 0x4E1B +0xB4D5 0x51D1 +0xB4D6 0x7C97 +0xB4D7 0x918B +0xB4D8 0x7C07 +0xB4D9 0x4FC3 +0xB4DA 0x8E7F +0xB4DB 0x7BE1 +0xB4DC 0x7A9C +0xB4DD 0x6467 +0xB4DE 0x5D14 +0xB4DF 0x50AC +0xB4E0 0x8106 +0xB4E1 0x7601 +0xB4E2 0x7CB9 +0xB4E3 0x6DEC +0xB4E4 0x7FE0 +0xB4E5 0x6751 +0xB4E6 0x5B58 +0xB4E7 0x5BF8 +0xB4E8 0x78CB +0xB4E9 0x64AE +0xB4EA 0x6413 +0xB4EB 0x63AA +0xB4EC 0x632B +0xB4ED 0x9519 +0xB4EE 0x642D +0xB4EF 0x8FBE +0xB4F0 0x7B54 +0xB4F1 0x7629 +0xB4F2 0x6253 +0xB4F3 0x5927 +0xB4F4 0x5446 +0xB4F5 0x6B79 +0xB4F6 0x50A3 +0xB4F7 0x6234 +0xB4F8 0x5E26 +0xB4F9 0x6B86 +0xB4FA 0x4EE3 +0xB4FB 0x8D37 +0xB4FC 0x888B +0xB4FD 0x5F85 +0xB4FE 0x902E +0xB540 0xB545 0x790D +0xB546 0xB54F 0x7914 +0xB550 0xB554 0x791F +0xB555 0xB563 0x7925 +0xB564 0xB568 0x7935 +0xB569 0x793D +0xB56A 0x793F +0xB56B 0xB56E 0x7942 +0xB56F 0x7947 +0xB570 0xB578 0x794A +0xB579 0xB57A 0x7954 +0xB57B 0xB57C 0x7958 +0xB57D 0x7961 +0xB57E 0x7963 +0xB580 0x7964 +0xB581 0x7966 +0xB582 0xB585 0x7969 +0xB586 0x796E +0xB587 0xB58D 0x7970 +0xB58E 0x7979 +0xB58F 0xB593 0x797B +0xB594 0xB595 0x7982 +0xB596 0xB599 0x7986 +0xB59A 0xB59D 0x798B +0xB59E 0xB5A0 0x7990 +0xB5A1 0x6020 +0xB5A2 0x803D +0xB5A3 0x62C5 +0xB5A4 0x4E39 +0xB5A5 0x5355 +0xB5A6 0x90F8 +0xB5A7 0x63B8 +0xB5A8 0x80C6 +0xB5A9 0x65E6 +0xB5AA 0x6C2E +0xB5AB 0x4F46 +0xB5AC 0x60EE +0xB5AD 0x6DE1 +0xB5AE 0x8BDE +0xB5AF 0x5F39 +0xB5B0 0x86CB +0xB5B1 0x5F53 +0xB5B2 0x6321 +0xB5B3 0x515A +0xB5B4 0x8361 +0xB5B5 0x6863 +0xB5B6 0x5200 +0xB5B7 0x6363 +0xB5B8 0x8E48 +0xB5B9 0x5012 +0xB5BA 0x5C9B +0xB5BB 0x7977 +0xB5BC 0x5BFC +0xB5BD 0x5230 +0xB5BE 0x7A3B +0xB5BF 0x60BC +0xB5C0 0x9053 +0xB5C1 0x76D7 +0xB5C2 0x5FB7 +0xB5C3 0x5F97 +0xB5C4 0x7684 +0xB5C5 0x8E6C +0xB5C6 0x706F +0xB5C7 0x767B +0xB5C8 0x7B49 +0xB5C9 0x77AA +0xB5CA 0x51F3 +0xB5CB 0x9093 +0xB5CC 0x5824 +0xB5CD 0x4F4E +0xB5CE 0x6EF4 +0xB5CF 0x8FEA +0xB5D0 0x654C +0xB5D1 0x7B1B +0xB5D2 0x72C4 +0xB5D3 0x6DA4 +0xB5D4 0x7FDF +0xB5D5 0x5AE1 +0xB5D6 0x62B5 +0xB5D7 0x5E95 +0xB5D8 0x5730 +0xB5D9 0x8482 +0xB5DA 0x7B2C +0xB5DB 0x5E1D +0xB5DC 0x5F1F +0xB5DD 0x9012 +0xB5DE 0x7F14 +0xB5DF 0x98A0 +0xB5E0 0x6382 +0xB5E1 0x6EC7 +0xB5E2 0x7898 +0xB5E3 0x70B9 +0xB5E4 0x5178 +0xB5E5 0x975B +0xB5E6 0x57AB +0xB5E7 0x7535 +0xB5E8 0x4F43 +0xB5E9 0x7538 +0xB5EA 0x5E97 +0xB5EB 0x60E6 +0xB5EC 0x5960 +0xB5ED 0x6DC0 +0xB5EE 0x6BBF +0xB5EF 0x7889 +0xB5F0 0x53FC +0xB5F1 0x96D5 +0xB5F2 0x51CB +0xB5F3 0x5201 +0xB5F4 0x6389 +0xB5F5 0x540A +0xB5F6 0x9493 +0xB5F7 0x8C03 +0xB5F8 0x8DCC +0xB5F9 0x7239 +0xB5FA 0x789F +0xB5FB 0x8776 +0xB5FC 0x8FED +0xB5FD 0x8C0D +0xB5FE 0x53E0 +0xB640 0xB646 0x7993 +0xB647 0xB652 0x799B +0xB653 0xB65D 0x79A8 +0xB65E 0xB662 0x79B4 +0xB663 0x79BC +0xB664 0x79BF +0xB665 0x79C2 +0xB666 0xB667 0x79C4 +0xB668 0xB669 0x79C7 +0xB66A 0x79CA +0xB66B 0x79CC +0xB66C 0xB66E 0x79CE +0xB66F 0xB670 0x79D3 +0xB671 0xB672 0x79D6 +0xB673 0xB678 0x79D9 +0xB679 0xB67B 0x79E0 +0xB67C 0x79E5 +0xB67D 0x79E8 +0xB67E 0x79EA +0xB680 0x79EC +0xB681 0x79EE +0xB682 0xB688 0x79F1 +0xB689 0xB68A 0x79F9 +0xB68B 0x79FC +0xB68C 0xB68D 0x79FE +0xB68E 0x7A01 +0xB68F 0xB690 0x7A04 +0xB691 0xB694 0x7A07 +0xB695 0x7A0C +0xB696 0xB69A 0x7A0F +0xB69B 0xB69C 0x7A15 +0xB69D 0xB69E 0x7A18 +0xB69F 0xB6A0 0x7A1B +0xB6A1 0x4E01 +0xB6A2 0x76EF +0xB6A3 0x53EE +0xB6A4 0x9489 +0xB6A5 0x9876 +0xB6A6 0x9F0E +0xB6A7 0x952D +0xB6A8 0x5B9A +0xB6A9 0x8BA2 +0xB6AA 0x4E22 +0xB6AB 0x4E1C +0xB6AC 0x51AC +0xB6AD 0x8463 +0xB6AE 0x61C2 +0xB6AF 0x52A8 +0xB6B0 0x680B +0xB6B1 0x4F97 +0xB6B2 0x606B +0xB6B3 0x51BB +0xB6B4 0x6D1E +0xB6B5 0x515C +0xB6B6 0x6296 +0xB6B7 0x6597 +0xB6B8 0x9661 +0xB6B9 0x8C46 +0xB6BA 0x9017 +0xB6BB 0x75D8 +0xB6BC 0x90FD +0xB6BD 0x7763 +0xB6BE 0x6BD2 +0xB6BF 0x728A +0xB6C0 0x72EC +0xB6C1 0x8BFB +0xB6C2 0x5835 +0xB6C3 0x7779 +0xB6C4 0x8D4C +0xB6C5 0x675C +0xB6C6 0x9540 +0xB6C7 0x809A +0xB6C8 0x5EA6 +0xB6C9 0x6E21 +0xB6CA 0x5992 +0xB6CB 0x7AEF +0xB6CC 0x77ED +0xB6CD 0x953B +0xB6CE 0x6BB5 +0xB6CF 0x65AD +0xB6D0 0x7F0E +0xB6D1 0x5806 +0xB6D2 0x5151 +0xB6D3 0x961F +0xB6D4 0x5BF9 +0xB6D5 0x58A9 +0xB6D6 0x5428 +0xB6D7 0x8E72 +0xB6D8 0x6566 +0xB6D9 0x987F +0xB6DA 0x56E4 +0xB6DB 0x949D +0xB6DC 0x76FE +0xB6DD 0x9041 +0xB6DE 0x6387 +0xB6DF 0x54C6 +0xB6E0 0x591A +0xB6E1 0x593A +0xB6E2 0x579B +0xB6E3 0x8EB2 +0xB6E4 0x6735 +0xB6E5 0x8DFA +0xB6E6 0x8235 +0xB6E7 0x5241 +0xB6E8 0x60F0 +0xB6E9 0x5815 +0xB6EA 0x86FE +0xB6EB 0x5CE8 +0xB6EC 0x9E45 +0xB6ED 0x4FC4 +0xB6EE 0x989D +0xB6EF 0x8BB9 +0xB6F0 0x5A25 +0xB6F1 0x6076 +0xB6F2 0x5384 +0xB6F3 0x627C +0xB6F4 0x904F +0xB6F5 0x9102 +0xB6F6 0x997F +0xB6F7 0x6069 +0xB6F8 0x800C +0xB6F9 0x513F +0xB6FA 0x8033 +0xB6FB 0x5C14 +0xB6FC 0x9975 +0xB6FD 0x6D31 +0xB6FE 0x4E8C +0xB740 0x7A1D +0xB741 0x7A1F +0xB742 0xB743 0x7A21 +0xB744 0xB752 0x7A24 +0xB753 0xB755 0x7A34 +0xB756 0x7A38 +0xB757 0x7A3A +0xB758 0x7A3E +0xB759 0xB75E 0x7A40 +0xB75F 0xB768 0x7A47 +0xB769 0xB76D 0x7A52 +0xB76E 0xB77E 0x7A58 +0xB780 0xB786 0x7A69 +0xB787 0xB789 0x7A71 +0xB78A 0x7A75 +0xB78B 0xB78E 0x7A7B +0xB78F 0x7A82 +0xB790 0x7A85 +0xB791 0x7A87 +0xB792 0xB795 0x7A89 +0xB796 0xB798 0x7A8E +0xB799 0xB79A 0x7A93 +0xB79B 0xB79D 0x7A99 +0xB79E 0x7A9E +0xB79F 0xB7A0 0x7AA1 +0xB7A1 0x8D30 +0xB7A2 0x53D1 +0xB7A3 0x7F5A +0xB7A4 0x7B4F +0xB7A5 0x4F10 +0xB7A6 0x4E4F +0xB7A7 0x9600 +0xB7A8 0x6CD5 +0xB7A9 0x73D0 +0xB7AA 0x85E9 +0xB7AB 0x5E06 +0xB7AC 0x756A +0xB7AD 0x7FFB +0xB7AE 0x6A0A +0xB7AF 0x77FE +0xB7B0 0x9492 +0xB7B1 0x7E41 +0xB7B2 0x51E1 +0xB7B3 0x70E6 +0xB7B4 0x53CD +0xB7B5 0x8FD4 +0xB7B6 0x8303 +0xB7B7 0x8D29 +0xB7B8 0x72AF +0xB7B9 0x996D +0xB7BA 0x6CDB +0xB7BB 0x574A +0xB7BC 0x82B3 +0xB7BD 0x65B9 +0xB7BE 0x80AA +0xB7BF 0x623F +0xB7C0 0x9632 +0xB7C1 0x59A8 +0xB7C2 0x4EFF +0xB7C3 0x8BBF +0xB7C4 0x7EBA +0xB7C5 0x653E +0xB7C6 0x83F2 +0xB7C7 0x975E +0xB7C8 0x5561 +0xB7C9 0x98DE +0xB7CA 0x80A5 +0xB7CB 0x532A +0xB7CC 0x8BFD +0xB7CD 0x5420 +0xB7CE 0x80BA +0xB7CF 0x5E9F +0xB7D0 0x6CB8 +0xB7D1 0x8D39 +0xB7D2 0x82AC +0xB7D3 0x915A +0xB7D4 0x5429 +0xB7D5 0x6C1B +0xB7D6 0x5206 +0xB7D7 0x7EB7 +0xB7D8 0x575F +0xB7D9 0x711A +0xB7DA 0x6C7E +0xB7DB 0x7C89 +0xB7DC 0x594B +0xB7DD 0x4EFD +0xB7DE 0x5FFF +0xB7DF 0x6124 +0xB7E0 0x7CAA +0xB7E1 0x4E30 +0xB7E2 0x5C01 +0xB7E3 0x67AB +0xB7E4 0x8702 +0xB7E5 0x5CF0 +0xB7E6 0x950B +0xB7E7 0x98CE +0xB7E8 0x75AF +0xB7E9 0x70FD +0xB7EA 0x9022 +0xB7EB 0x51AF +0xB7EC 0x7F1D +0xB7ED 0x8BBD +0xB7EE 0x5949 +0xB7EF 0x51E4 +0xB7F0 0x4F5B +0xB7F1 0x5426 +0xB7F2 0x592B +0xB7F3 0x6577 +0xB7F4 0x80A4 +0xB7F5 0x5B75 +0xB7F6 0x6276 +0xB7F7 0x62C2 +0xB7F8 0x8F90 +0xB7F9 0x5E45 +0xB7FA 0x6C1F +0xB7FB 0x7B26 +0xB7FC 0x4F0F +0xB7FD 0x4FD8 +0xB7FE 0x670D +0xB840 0xB841 0x7AA3 +0xB842 0x7AA7 +0xB843 0xB845 0x7AA9 +0xB846 0xB84A 0x7AAE +0xB84B 0xB855 0x7AB4 +0xB856 0xB860 0x7AC0 +0xB861 0xB86A 0x7ACC +0xB86B 0xB86C 0x7AD7 +0xB86D 0xB870 0x7ADA +0xB871 0xB872 0x7AE1 +0xB873 0x7AE4 +0xB874 0xB879 0x7AE7 +0xB87A 0x7AEE +0xB87B 0xB87E 0x7AF0 +0xB880 0xB884 0x7AF4 +0xB885 0xB886 0x7AFB +0xB887 0x7AFE +0xB888 0xB88A 0x7B00 +0xB88B 0x7B05 +0xB88C 0x7B07 +0xB88D 0x7B09 +0xB88E 0xB890 0x7B0C +0xB891 0x7B10 +0xB892 0xB893 0x7B12 +0xB894 0xB896 0x7B16 +0xB897 0x7B1A +0xB898 0xB899 0x7B1C +0xB89A 0x7B1F +0xB89B 0xB89D 0x7B21 +0xB89E 0x7B27 +0xB89F 0x7B29 +0xB8A0 0x7B2D +0xB8A1 0x6D6E +0xB8A2 0x6DAA +0xB8A3 0x798F +0xB8A4 0x88B1 +0xB8A5 0x5F17 +0xB8A6 0x752B +0xB8A7 0x629A +0xB8A8 0x8F85 +0xB8A9 0x4FEF +0xB8AA 0x91DC +0xB8AB 0x65A7 +0xB8AC 0x812F +0xB8AD 0x8151 +0xB8AE 0x5E9C +0xB8AF 0x8150 +0xB8B0 0x8D74 +0xB8B1 0x526F +0xB8B2 0x8986 +0xB8B3 0x8D4B +0xB8B4 0x590D +0xB8B5 0x5085 +0xB8B6 0x4ED8 +0xB8B7 0x961C +0xB8B8 0x7236 +0xB8B9 0x8179 +0xB8BA 0x8D1F +0xB8BB 0x5BCC +0xB8BC 0x8BA3 +0xB8BD 0x9644 +0xB8BE 0x5987 +0xB8BF 0x7F1A +0xB8C0 0x5490 +0xB8C1 0x5676 +0xB8C2 0x560E +0xB8C3 0x8BE5 +0xB8C4 0x6539 +0xB8C5 0x6982 +0xB8C6 0x9499 +0xB8C7 0x76D6 +0xB8C8 0x6E89 +0xB8C9 0x5E72 +0xB8CA 0x7518 +0xB8CB 0x6746 +0xB8CC 0x67D1 +0xB8CD 0x7AFF +0xB8CE 0x809D +0xB8CF 0x8D76 +0xB8D0 0x611F +0xB8D1 0x79C6 +0xB8D2 0x6562 +0xB8D3 0x8D63 +0xB8D4 0x5188 +0xB8D5 0x521A +0xB8D6 0x94A2 +0xB8D7 0x7F38 +0xB8D8 0x809B +0xB8D9 0x7EB2 +0xB8DA 0x5C97 +0xB8DB 0x6E2F +0xB8DC 0x6760 +0xB8DD 0x7BD9 +0xB8DE 0x768B +0xB8DF 0x9AD8 +0xB8E0 0x818F +0xB8E1 0x7F94 +0xB8E2 0x7CD5 +0xB8E3 0x641E +0xB8E4 0x9550 +0xB8E5 0x7A3F +0xB8E6 0x544A +0xB8E7 0x54E5 +0xB8E8 0x6B4C +0xB8E9 0x6401 +0xB8EA 0x6208 +0xB8EB 0x9E3D +0xB8EC 0x80F3 +0xB8ED 0x7599 +0xB8EE 0x5272 +0xB8EF 0x9769 +0xB8F0 0x845B +0xB8F1 0x683C +0xB8F2 0x86E4 +0xB8F3 0x9601 +0xB8F4 0x9694 +0xB8F5 0x94EC +0xB8F6 0x4E2A +0xB8F7 0x5404 +0xB8F8 0x7ED9 +0xB8F9 0x6839 +0xB8FA 0x8DDF +0xB8FB 0x8015 +0xB8FC 0x66F4 +0xB8FD 0x5E9A +0xB8FE 0x7FB9 +0xB940 0xB941 0x7B2F +0xB942 0x7B32 +0xB943 0xB946 0x7B34 +0xB947 0x7B39 +0xB948 0x7B3B +0xB949 0x7B3D +0xB94A 0xB94F 0x7B3F +0xB950 0x7B46 +0xB951 0x7B48 +0xB952 0x7B4A +0xB953 0xB954 0x7B4D +0xB955 0x7B53 +0xB956 0x7B55 +0xB957 0x7B57 +0xB958 0x7B59 +0xB959 0x7B5C +0xB95A 0xB95B 0x7B5E +0xB95C 0x7B61 +0xB95D 0xB967 0x7B63 +0xB968 0xB969 0x7B6F +0xB96A 0xB96B 0x7B73 +0xB96C 0x7B76 +0xB96D 0x7B78 +0xB96E 0x7B7A +0xB96F 0xB970 0x7B7C +0xB971 0x7B7F +0xB972 0xB975 0x7B81 +0xB976 0xB97C 0x7B86 +0xB97D 0xB97E 0x7B8E +0xB980 0xB982 0x7B91 +0xB983 0x7B96 +0xB984 0xB987 0x7B98 +0xB988 0xB98A 0x7B9E +0xB98B 0xB98D 0x7BA3 +0xB98E 0xB990 0x7BAE +0xB991 0xB992 0x7BB2 +0xB993 0xB995 0x7BB5 +0xB996 0xB99D 0x7BB9 +0xB99E 0xB9A0 0x7BC2 +0xB9A1 0x57C2 +0xB9A2 0x803F +0xB9A3 0x6897 +0xB9A4 0x5DE5 +0xB9A5 0x653B +0xB9A6 0x529F +0xB9A7 0x606D +0xB9A8 0x9F9A +0xB9A9 0x4F9B +0xB9AA 0x8EAC +0xB9AB 0x516C +0xB9AC 0x5BAB +0xB9AD 0x5F13 +0xB9AE 0x5DE9 +0xB9AF 0x6C5E +0xB9B0 0x62F1 +0xB9B1 0x8D21 +0xB9B2 0x5171 +0xB9B3 0x94A9 +0xB9B4 0x52FE +0xB9B5 0x6C9F +0xB9B6 0x82DF +0xB9B7 0x72D7 +0xB9B8 0x57A2 +0xB9B9 0x6784 +0xB9BA 0x8D2D +0xB9BB 0x591F +0xB9BC 0x8F9C +0xB9BD 0x83C7 +0xB9BE 0x5495 +0xB9BF 0x7B8D +0xB9C0 0x4F30 +0xB9C1 0x6CBD +0xB9C2 0x5B64 +0xB9C3 0x59D1 +0xB9C4 0x9F13 +0xB9C5 0x53E4 +0xB9C6 0x86CA +0xB9C7 0x9AA8 +0xB9C8 0x8C37 +0xB9C9 0x80A1 +0xB9CA 0x6545 +0xB9CB 0x987E +0xB9CC 0x56FA +0xB9CD 0x96C7 +0xB9CE 0x522E +0xB9CF 0x74DC +0xB9D0 0x5250 +0xB9D1 0x5BE1 +0xB9D2 0x6302 +0xB9D3 0x8902 +0xB9D4 0x4E56 +0xB9D5 0x62D0 +0xB9D6 0x602A +0xB9D7 0x68FA +0xB9D8 0x5173 +0xB9D9 0x5B98 +0xB9DA 0x51A0 +0xB9DB 0x89C2 +0xB9DC 0x7BA1 +0xB9DD 0x9986 +0xB9DE 0x7F50 +0xB9DF 0x60EF +0xB9E0 0x704C +0xB9E1 0x8D2F +0xB9E2 0x5149 +0xB9E3 0x5E7F +0xB9E4 0x901B +0xB9E5 0x7470 +0xB9E6 0x89C4 +0xB9E7 0x572D +0xB9E8 0x7845 +0xB9E9 0x5F52 +0xB9EA 0x9F9F +0xB9EB 0x95FA +0xB9EC 0x8F68 +0xB9ED 0x9B3C +0xB9EE 0x8BE1 +0xB9EF 0x7678 +0xB9F0 0x6842 +0xB9F1 0x67DC +0xB9F2 0x8DEA +0xB9F3 0x8D35 +0xB9F4 0x523D +0xB9F5 0x8F8A +0xB9F6 0x6EDA +0xB9F7 0x68CD +0xB9F8 0x9505 +0xB9F9 0x90ED +0xB9FA 0x56FD +0xB9FB 0x679C +0xB9FC 0x88F9 +0xB9FD 0x8FC7 +0xB9FE 0x54C8 +0xBA40 0x7BC5 +0xBA41 0xBA44 0x7BC8 +0xBA45 0xBA48 0x7BCD +0xBA49 0x7BD2 +0xBA4A 0xBA4E 0x7BD4 +0xBA4F 0xBA50 0x7BDB +0xBA51 0xBA53 0x7BDE +0xBA54 0xBA56 0x7BE2 +0xBA57 0xBA59 0x7BE7 +0xBA5A 0xBA5C 0x7BEB +0xBA5D 0xBA5E 0x7BEF +0xBA5F 0xBA63 0x7BF2 +0xBA64 0xBA67 0x7BF8 +0xBA68 0x7BFD +0xBA69 0xBA70 0x7BFF +0xBA71 0xBA73 0x7C08 +0xBA74 0xBA75 0x7C0D +0xBA76 0xBA7B 0x7C10 +0xBA7C 0xBA7E 0x7C17 +0xBA80 0xBA84 0x7C1A +0xBA85 0xBA8A 0x7C20 +0xBA8B 0xBA8C 0x7C28 +0xBA8D 0xBA99 0x7C2B +0xBA9A 0xBA9F 0x7C39 +0xBAA0 0x7C42 +0xBAA1 0x9AB8 +0xBAA2 0x5B69 +0xBAA3 0x6D77 +0xBAA4 0x6C26 +0xBAA5 0x4EA5 +0xBAA6 0x5BB3 +0xBAA7 0x9A87 +0xBAA8 0x9163 +0xBAA9 0x61A8 +0xBAAA 0x90AF +0xBAAB 0x97E9 +0xBAAC 0x542B +0xBAAD 0x6DB5 +0xBAAE 0x5BD2 +0xBAAF 0x51FD +0xBAB0 0x558A +0xBAB1 0x7F55 +0xBAB2 0x7FF0 +0xBAB3 0x64BC +0xBAB4 0x634D +0xBAB5 0x65F1 +0xBAB6 0x61BE +0xBAB7 0x608D +0xBAB8 0x710A +0xBAB9 0x6C57 +0xBABA 0x6C49 +0xBABB 0x592F +0xBABC 0x676D +0xBABD 0x822A +0xBABE 0x58D5 +0xBABF 0x568E +0xBAC0 0x8C6A +0xBAC1 0x6BEB +0xBAC2 0x90DD +0xBAC3 0x597D +0xBAC4 0x8017 +0xBAC5 0x53F7 +0xBAC6 0x6D69 +0xBAC7 0x5475 +0xBAC8 0x559D +0xBAC9 0x8377 +0xBACA 0x83CF +0xBACB 0x6838 +0xBACC 0x79BE +0xBACD 0x548C +0xBACE 0x4F55 +0xBACF 0x5408 +0xBAD0 0x76D2 +0xBAD1 0x8C89 +0xBAD2 0x9602 +0xBAD3 0x6CB3 +0xBAD4 0x6DB8 +0xBAD5 0x8D6B +0xBAD6 0x8910 +0xBAD7 0x9E64 +0xBAD8 0x8D3A +0xBAD9 0x563F +0xBADA 0x9ED1 +0xBADB 0x75D5 +0xBADC 0x5F88 +0xBADD 0x72E0 +0xBADE 0x6068 +0xBADF 0x54FC +0xBAE0 0x4EA8 +0xBAE1 0x6A2A +0xBAE2 0x8861 +0xBAE3 0x6052 +0xBAE4 0x8F70 +0xBAE5 0x54C4 +0xBAE6 0x70D8 +0xBAE7 0x8679 +0xBAE8 0x9E3F +0xBAE9 0x6D2A +0xBAEA 0x5B8F +0xBAEB 0x5F18 +0xBAEC 0x7EA2 +0xBAED 0x5589 +0xBAEE 0x4FAF +0xBAEF 0x7334 +0xBAF0 0x543C +0xBAF1 0x539A +0xBAF2 0x5019 +0xBAF3 0x540E +0xBAF4 0x547C +0xBAF5 0x4E4E +0xBAF6 0x5FFD +0xBAF7 0x745A +0xBAF8 0x58F6 +0xBAF9 0x846B +0xBAFA 0x80E1 +0xBAFB 0x8774 +0xBAFC 0x72D0 +0xBAFD 0x7CCA +0xBAFE 0x6E56 +0xBB40 0xBB49 0x7C43 +0xBB4A 0xBB6E 0x7C4E +0xBB6F 0xBB74 0x7C75 +0xBB75 0xBB7E 0x7C7E +0xBB80 0x7C88 +0xBB81 0xBB87 0x7C8A +0xBB88 0xBB89 0x7C93 +0xBB8A 0x7C96 +0xBB8B 0xBB8D 0x7C99 +0xBB8E 0xBB8F 0x7CA0 +0xBB90 0x7CA3 +0xBB91 0xBB94 0x7CA6 +0xBB95 0xBB97 0x7CAB +0xBB98 0xBB99 0x7CAF +0xBB9A 0xBB9E 0x7CB4 +0xBB9F 0xBBA0 0x7CBA +0xBBA1 0x5F27 +0xBBA2 0x864E +0xBBA3 0x552C +0xBBA4 0x62A4 +0xBBA5 0x4E92 +0xBBA6 0x6CAA +0xBBA7 0x6237 +0xBBA8 0x82B1 +0xBBA9 0x54D7 +0xBBAA 0x534E +0xBBAB 0x733E +0xBBAC 0x6ED1 +0xBBAD 0x753B +0xBBAE 0x5212 +0xBBAF 0x5316 +0xBBB0 0x8BDD +0xBBB1 0x69D0 +0xBBB2 0x5F8A +0xBBB3 0x6000 +0xBBB4 0x6DEE +0xBBB5 0x574F +0xBBB6 0x6B22 +0xBBB7 0x73AF +0xBBB8 0x6853 +0xBBB9 0x8FD8 +0xBBBA 0x7F13 +0xBBBB 0x6362 +0xBBBC 0x60A3 +0xBBBD 0x5524 +0xBBBE 0x75EA +0xBBBF 0x8C62 +0xBBC0 0x7115 +0xBBC1 0x6DA3 +0xBBC2 0x5BA6 +0xBBC3 0x5E7B +0xBBC4 0x8352 +0xBBC5 0x614C +0xBBC6 0x9EC4 +0xBBC7 0x78FA +0xBBC8 0x8757 +0xBBC9 0x7C27 +0xBBCA 0x7687 +0xBBCB 0x51F0 +0xBBCC 0x60F6 +0xBBCD 0x714C +0xBBCE 0x6643 +0xBBCF 0x5E4C +0xBBD0 0x604D +0xBBD1 0x8C0E +0xBBD2 0x7070 +0xBBD3 0x6325 +0xBBD4 0x8F89 +0xBBD5 0x5FBD +0xBBD6 0x6062 +0xBBD7 0x86D4 +0xBBD8 0x56DE +0xBBD9 0x6BC1 +0xBBDA 0x6094 +0xBBDB 0x6167 +0xBBDC 0x5349 +0xBBDD 0x60E0 +0xBBDE 0x6666 +0xBBDF 0x8D3F +0xBBE0 0x79FD +0xBBE1 0x4F1A +0xBBE2 0x70E9 +0xBBE3 0x6C47 +0xBBE4 0x8BB3 +0xBBE5 0x8BF2 +0xBBE6 0x7ED8 +0xBBE7 0x8364 +0xBBE8 0x660F +0xBBE9 0x5A5A +0xBBEA 0x9B42 +0xBBEB 0x6D51 +0xBBEC 0x6DF7 +0xBBED 0x8C41 +0xBBEE 0x6D3B +0xBBEF 0x4F19 +0xBBF0 0x706B +0xBBF1 0x83B7 +0xBBF2 0x6216 +0xBBF3 0x60D1 +0xBBF4 0x970D +0xBBF5 0x8D27 +0xBBF6 0x7978 +0xBBF7 0x51FB +0xBBF8 0x573E +0xBBF9 0x57FA +0xBBFA 0x673A +0xBBFB 0x7578 +0xBBFC 0x7A3D +0xBBFD 0x79EF +0xBBFE 0x7B95 +0xBC40 0xBC41 0x7CBF +0xBC42 0xBC44 0x7CC2 +0xBC45 0x7CC6 +0xBC46 0x7CC9 +0xBC47 0x7CCB +0xBC48 0xBC4E 0x7CCE +0xBC4F 0x7CD8 +0xBC50 0xBC51 0x7CDA +0xBC52 0xBC53 0x7CDD +0xBC54 0xBC5A 0x7CE1 +0xBC5B 0xBC60 0x7CE9 +0xBC61 0xBC68 0x7CF0 +0xBC69 0xBC6A 0x7CF9 +0xBC6B 0xBC78 0x7CFC +0xBC79 0xBC7E 0x7D0B +0xBC80 0xBC8E 0x7D11 +0xBC8F 0x7D21 +0xBC90 0xBC93 0x7D23 +0xBC94 0xBC96 0x7D28 +0xBC97 0xBC99 0x7D2C +0xBC9A 0xBCA0 0x7D30 +0xBCA1 0x808C +0xBCA2 0x9965 +0xBCA3 0x8FF9 +0xBCA4 0x6FC0 +0xBCA5 0x8BA5 +0xBCA6 0x9E21 +0xBCA7 0x59EC +0xBCA8 0x7EE9 +0xBCA9 0x7F09 +0xBCAA 0x5409 +0xBCAB 0x6781 +0xBCAC 0x68D8 +0xBCAD 0x8F91 +0xBCAE 0x7C4D +0xBCAF 0x96C6 +0xBCB0 0x53CA +0xBCB1 0x6025 +0xBCB2 0x75BE +0xBCB3 0x6C72 +0xBCB4 0x5373 +0xBCB5 0x5AC9 +0xBCB6 0x7EA7 +0xBCB7 0x6324 +0xBCB8 0x51E0 +0xBCB9 0x810A +0xBCBA 0x5DF1 +0xBCBB 0x84DF +0xBCBC 0x6280 +0xBCBD 0x5180 +0xBCBE 0x5B63 +0xBCBF 0x4F0E +0xBCC0 0x796D +0xBCC1 0x5242 +0xBCC2 0x60B8 +0xBCC3 0x6D4E +0xBCC4 0x5BC4 +0xBCC5 0x5BC2 +0xBCC6 0x8BA1 +0xBCC7 0x8BB0 +0xBCC8 0x65E2 +0xBCC9 0x5FCC +0xBCCA 0x9645 +0xBCCB 0x5993 +0xBCCC 0x7EE7 +0xBCCD 0x7EAA +0xBCCE 0x5609 +0xBCCF 0x67B7 +0xBCD0 0x5939 +0xBCD1 0x4F73 +0xBCD2 0x5BB6 +0xBCD3 0x52A0 +0xBCD4 0x835A +0xBCD5 0x988A +0xBCD6 0x8D3E +0xBCD7 0x7532 +0xBCD8 0x94BE +0xBCD9 0x5047 +0xBCDA 0x7A3C +0xBCDB 0x4EF7 +0xBCDC 0x67B6 +0xBCDD 0x9A7E +0xBCDE 0x5AC1 +0xBCDF 0x6B7C +0xBCE0 0x76D1 +0xBCE1 0x575A +0xBCE2 0x5C16 +0xBCE3 0x7B3A +0xBCE4 0x95F4 +0xBCE5 0x714E +0xBCE6 0x517C +0xBCE7 0x80A9 +0xBCE8 0x8270 +0xBCE9 0x5978 +0xBCEA 0x7F04 +0xBCEB 0x8327 +0xBCEC 0x68C0 +0xBCED 0x67EC +0xBCEE 0x78B1 +0xBCEF 0x7877 +0xBCF0 0x62E3 +0xBCF1 0x6361 +0xBCF2 0x7B80 +0xBCF3 0x4FED +0xBCF4 0x526A +0xBCF5 0x51CF +0xBCF6 0x8350 +0xBCF7 0x69DB +0xBCF8 0x9274 +0xBCF9 0x8DF5 +0xBCFA 0x8D31 +0xBCFB 0x89C1 +0xBCFC 0x952E +0xBCFD 0x7BAD +0xBCFE 0x4EF6 +0xBD40 0xBD76 0x7D37 +0xBD77 0xBD7E 0x7D6F +0xBD80 0xBDA0 0x7D78 +0xBDA1 0x5065 +0xBDA2 0x8230 +0xBDA3 0x5251 +0xBDA4 0x996F +0xBDA5 0x6E10 +0xBDA6 0x6E85 +0xBDA7 0x6DA7 +0xBDA8 0x5EFA +0xBDA9 0x50F5 +0xBDAA 0x59DC +0xBDAB 0x5C06 +0xBDAC 0x6D46 +0xBDAD 0x6C5F +0xBDAE 0x7586 +0xBDAF 0x848B +0xBDB0 0x6868 +0xBDB1 0x5956 +0xBDB2 0x8BB2 +0xBDB3 0x5320 +0xBDB4 0x9171 +0xBDB5 0x964D +0xBDB6 0x8549 +0xBDB7 0x6912 +0xBDB8 0x7901 +0xBDB9 0x7126 +0xBDBA 0x80F6 +0xBDBB 0x4EA4 +0xBDBC 0x90CA +0xBDBD 0x6D47 +0xBDBE 0x9A84 +0xBDBF 0x5A07 +0xBDC0 0x56BC +0xBDC1 0x6405 +0xBDC2 0x94F0 +0xBDC3 0x77EB +0xBDC4 0x4FA5 +0xBDC5 0x811A +0xBDC6 0x72E1 +0xBDC7 0x89D2 +0xBDC8 0x997A +0xBDC9 0x7F34 +0xBDCA 0x7EDE +0xBDCB 0x527F +0xBDCC 0x6559 +0xBDCD 0x9175 +0xBDCE 0x8F7F +0xBDCF 0x8F83 +0xBDD0 0x53EB +0xBDD1 0x7A96 +0xBDD2 0x63ED +0xBDD3 0x63A5 +0xBDD4 0x7686 +0xBDD5 0x79F8 +0xBDD6 0x8857 +0xBDD7 0x9636 +0xBDD8 0x622A +0xBDD9 0x52AB +0xBDDA 0x8282 +0xBDDB 0x6854 +0xBDDC 0x6770 +0xBDDD 0x6377 +0xBDDE 0x776B +0xBDDF 0x7AED +0xBDE0 0x6D01 +0xBDE1 0x7ED3 +0xBDE2 0x89E3 +0xBDE3 0x59D0 +0xBDE4 0x6212 +0xBDE5 0x85C9 +0xBDE6 0x82A5 +0xBDE7 0x754C +0xBDE8 0x501F +0xBDE9 0x4ECB +0xBDEA 0x75A5 +0xBDEB 0x8BEB +0xBDEC 0x5C4A +0xBDED 0x5DFE +0xBDEE 0x7B4B +0xBDEF 0x65A4 +0xBDF0 0x91D1 +0xBDF1 0x4ECA +0xBDF2 0x6D25 +0xBDF3 0x895F +0xBDF4 0x7D27 +0xBDF5 0x9526 +0xBDF6 0x4EC5 +0xBDF7 0x8C28 +0xBDF8 0x8FDB +0xBDF9 0x9773 +0xBDFA 0x664B +0xBDFB 0x7981 +0xBDFC 0x8FD1 +0xBDFD 0x70EC +0xBDFE 0x6D78 +0xBE40 0xBE4C 0x7D99 +0xBE4D 0xBE53 0x7DA7 +0xBE54 0xBE7E 0x7DAF +0xBE80 0xBEA0 0x7DDA +0xBEA1 0x5C3D +0xBEA2 0x52B2 +0xBEA3 0x8346 +0xBEA4 0x5162 +0xBEA5 0x830E +0xBEA6 0x775B +0xBEA7 0x6676 +0xBEA8 0x9CB8 +0xBEA9 0x4EAC +0xBEAA 0x60CA +0xBEAB 0x7CBE +0xBEAC 0x7CB3 +0xBEAD 0x7ECF +0xBEAE 0x4E95 +0xBEAF 0x8B66 +0xBEB0 0x666F +0xBEB1 0x9888 +0xBEB2 0x9759 +0xBEB3 0x5883 +0xBEB4 0x656C +0xBEB5 0x955C +0xBEB6 0x5F84 +0xBEB7 0x75C9 +0xBEB8 0x9756 +0xBEB9 0x7ADF +0xBEBA 0x7ADE +0xBEBB 0x51C0 +0xBEBC 0x70AF +0xBEBD 0x7A98 +0xBEBE 0x63EA +0xBEBF 0x7A76 +0xBEC0 0x7EA0 +0xBEC1 0x7396 +0xBEC2 0x97ED +0xBEC3 0x4E45 +0xBEC4 0x7078 +0xBEC5 0x4E5D +0xBEC6 0x9152 +0xBEC7 0x53A9 +0xBEC8 0x6551 +0xBEC9 0x65E7 +0xBECA 0x81FC +0xBECB 0x8205 +0xBECC 0x548E +0xBECD 0x5C31 +0xBECE 0x759A +0xBECF 0x97A0 +0xBED0 0x62D8 +0xBED1 0x72D9 +0xBED2 0x75BD +0xBED3 0x5C45 +0xBED4 0x9A79 +0xBED5 0x83CA +0xBED6 0x5C40 +0xBED7 0x5480 +0xBED8 0x77E9 +0xBED9 0x4E3E +0xBEDA 0x6CAE +0xBEDB 0x805A +0xBEDC 0x62D2 +0xBEDD 0x636E +0xBEDE 0x5DE8 +0xBEDF 0x5177 +0xBEE0 0x8DDD +0xBEE1 0x8E1E +0xBEE2 0x952F +0xBEE3 0x4FF1 +0xBEE4 0x53E5 +0xBEE5 0x60E7 +0xBEE6 0x70AC +0xBEE7 0x5267 +0xBEE8 0x6350 +0xBEE9 0x9E43 +0xBEEA 0x5A1F +0xBEEB 0x5026 +0xBEEC 0x7737 +0xBEED 0x5377 +0xBEEE 0x7EE2 +0xBEEF 0x6485 +0xBEF0 0x652B +0xBEF1 0x6289 +0xBEF2 0x6398 +0xBEF3 0x5014 +0xBEF4 0x7235 +0xBEF5 0x89C9 +0xBEF6 0x51B3 +0xBEF7 0x8BC0 +0xBEF8 0x7EDD +0xBEF9 0x5747 +0xBEFA 0x83CC +0xBEFB 0x94A7 +0xBEFC 0x519B +0xBEFD 0x541B +0xBEFE 0x5CFB +0xBF40 0xBF7E 0x7DFB +0xBF80 0x7E3A +0xBF81 0xBF85 0x7E3C +0xBF86 0xBF8A 0x7E42 +0xBF8B 0xBFA0 0x7E48 +0xBFA1 0x4FCA +0xBFA2 0x7AE3 +0xBFA3 0x6D5A +0xBFA4 0x90E1 +0xBFA5 0x9A8F +0xBFA6 0x5580 +0xBFA7 0x5496 +0xBFA8 0x5361 +0xBFA9 0x54AF +0xBFAA 0x5F00 +0xBFAB 0x63E9 +0xBFAC 0x6977 +0xBFAD 0x51EF +0xBFAE 0x6168 +0xBFAF 0x520A +0xBFB0 0x582A +0xBFB1 0x52D8 +0xBFB2 0x574E +0xBFB3 0x780D +0xBFB4 0x770B +0xBFB5 0x5EB7 +0xBFB6 0x6177 +0xBFB7 0x7CE0 +0xBFB8 0x625B +0xBFB9 0x6297 +0xBFBA 0x4EA2 +0xBFBB 0x7095 +0xBFBC 0x8003 +0xBFBD 0x62F7 +0xBFBE 0x70E4 +0xBFBF 0x9760 +0xBFC0 0x5777 +0xBFC1 0x82DB +0xBFC2 0x67EF +0xBFC3 0x68F5 +0xBFC4 0x78D5 +0xBFC5 0x9897 +0xBFC6 0x79D1 +0xBFC7 0x58F3 +0xBFC8 0x54B3 +0xBFC9 0x53EF +0xBFCA 0x6E34 +0xBFCB 0x514B +0xBFCC 0x523B +0xBFCD 0x5BA2 +0xBFCE 0x8BFE +0xBFCF 0x80AF +0xBFD0 0x5543 +0xBFD1 0x57A6 +0xBFD2 0x6073 +0xBFD3 0x5751 +0xBFD4 0x542D +0xBFD5 0x7A7A +0xBFD6 0x6050 +0xBFD7 0x5B54 +0xBFD8 0x63A7 +0xBFD9 0x62A0 +0xBFDA 0x53E3 +0xBFDB 0x6263 +0xBFDC 0x5BC7 +0xBFDD 0x67AF +0xBFDE 0x54ED +0xBFDF 0x7A9F +0xBFE0 0x82E6 +0xBFE1 0x9177 +0xBFE2 0x5E93 +0xBFE3 0x88E4 +0xBFE4 0x5938 +0xBFE5 0x57AE +0xBFE6 0x630E +0xBFE7 0x8DE8 +0xBFE8 0x80EF +0xBFE9 0x5757 +0xBFEA 0x7B77 +0xBFEB 0x4FA9 +0xBFEC 0x5FEB +0xBFED 0x5BBD +0xBFEE 0x6B3E +0xBFEF 0x5321 +0xBFF0 0x7B50 +0xBFF1 0x72C2 +0xBFF2 0x6846 +0xBFF3 0x77FF +0xBFF4 0x7736 +0xBFF5 0x65F7 +0xBFF6 0x51B5 +0xBFF7 0x4E8F +0xBFF8 0x76D4 +0xBFF9 0x5CBF +0xBFFA 0x7AA5 +0xBFFB 0x8475 +0xBFFC 0x594E +0xBFFD 0x9B41 +0xBFFE 0x5080 +0xC040 0xC063 0x7E5E +0xC064 0xC07B 0x7E83 +0xC07C 0xC07E 0x7E9C +0xC080 0x7EAE +0xC081 0x7EB4 +0xC082 0xC083 0x7EBB +0xC084 0x7ED6 +0xC085 0x7EE4 +0xC086 0x7EEC +0xC087 0x7EF9 +0xC088 0x7F0A +0xC089 0x7F10 +0xC08A 0x7F1E +0xC08B 0x7F37 +0xC08C 0x7F39 +0xC08D 0xC093 0x7F3B +0xC094 0x7F43 +0xC095 0xC09E 0x7F46 +0xC09F 0xC0A0 0x7F52 +0xC0A1 0x9988 +0xC0A2 0x6127 +0xC0A3 0x6E83 +0xC0A4 0x5764 +0xC0A5 0x6606 +0xC0A6 0x6346 +0xC0A7 0x56F0 +0xC0A8 0x62EC +0xC0A9 0x6269 +0xC0AA 0x5ED3 +0xC0AB 0x9614 +0xC0AC 0x5783 +0xC0AD 0x62C9 +0xC0AE 0x5587 +0xC0AF 0x8721 +0xC0B0 0x814A +0xC0B1 0x8FA3 +0xC0B2 0x5566 +0xC0B3 0x83B1 +0xC0B4 0x6765 +0xC0B5 0x8D56 +0xC0B6 0x84DD +0xC0B7 0x5A6A +0xC0B8 0x680F +0xC0B9 0x62E6 +0xC0BA 0x7BEE +0xC0BB 0x9611 +0xC0BC 0x5170 +0xC0BD 0x6F9C +0xC0BE 0x8C30 +0xC0BF 0x63FD +0xC0C0 0x89C8 +0xC0C1 0x61D2 +0xC0C2 0x7F06 +0xC0C3 0x70C2 +0xC0C4 0x6EE5 +0xC0C5 0x7405 +0xC0C6 0x6994 +0xC0C7 0x72FC +0xC0C8 0x5ECA +0xC0C9 0x90CE +0xC0CA 0x6717 +0xC0CB 0x6D6A +0xC0CC 0x635E +0xC0CD 0x52B3 +0xC0CE 0x7262 +0xC0CF 0x8001 +0xC0D0 0x4F6C +0xC0D1 0x59E5 +0xC0D2 0x916A +0xC0D3 0x70D9 +0xC0D4 0x6D9D +0xC0D5 0x52D2 +0xC0D6 0x4E50 +0xC0D7 0x96F7 +0xC0D8 0x956D +0xC0D9 0x857E +0xC0DA 0x78CA +0xC0DB 0x7D2F +0xC0DC 0x5121 +0xC0DD 0x5792 +0xC0DE 0x64C2 +0xC0DF 0x808B +0xC0E0 0x7C7B +0xC0E1 0x6CEA +0xC0E2 0x68F1 +0xC0E3 0x695E +0xC0E4 0x51B7 +0xC0E5 0x5398 +0xC0E6 0x68A8 +0xC0E7 0x7281 +0xC0E8 0x9ECE +0xC0E9 0x7BF1 +0xC0EA 0x72F8 +0xC0EB 0x79BB +0xC0EC 0x6F13 +0xC0ED 0x7406 +0xC0EE 0x674E +0xC0EF 0x91CC +0xC0F0 0x9CA4 +0xC0F1 0x793C +0xC0F2 0x8389 +0xC0F3 0x8354 +0xC0F4 0x540F +0xC0F5 0x6817 +0xC0F6 0x4E3D +0xC0F7 0x5389 +0xC0F8 0x52B1 +0xC0F9 0x783E +0xC0FA 0x5386 +0xC0FB 0x5229 +0xC0FC 0x5088 +0xC0FD 0x4F8B +0xC0FE 0x4FD0 +0xC140 0x7F56 +0xC141 0x7F59 +0xC142 0xC145 0x7F5B +0xC146 0x7F60 +0xC147 0xC14B 0x7F63 +0xC14C 0xC14E 0x7F6B +0xC14F 0xC150 0x7F6F +0xC151 0x7F73 +0xC152 0xC155 0x7F75 +0xC156 0xC159 0x7F7A +0xC15A 0xC15B 0x7F7F +0xC15C 0xC163 0x7F82 +0xC164 0x7F8B +0xC165 0x7F8D +0xC166 0xC16A 0x7F8F +0xC16B 0xC16F 0x7F95 +0xC170 0xC171 0x7F9B +0xC172 0x7FA0 +0xC173 0xC174 0x7FA2 +0xC175 0xC176 0x7FA5 +0xC177 0xC17D 0x7FA8 +0xC17E 0x7FB1 +0xC180 0xC184 0x7FB3 +0xC185 0xC186 0x7FBA +0xC187 0x7FBE +0xC188 0x7FC0 +0xC189 0xC18B 0x7FC2 +0xC18C 0xC18F 0x7FC6 +0xC190 0x7FCB +0xC191 0x7FCD +0xC192 0xC196 0x7FCF +0xC197 0xC198 0x7FD6 +0xC199 0xC19E 0x7FD9 +0xC19F 0xC1A0 0x7FE2 +0xC1A1 0x75E2 +0xC1A2 0x7ACB +0xC1A3 0x7C92 +0xC1A4 0x6CA5 +0xC1A5 0x96B6 +0xC1A6 0x529B +0xC1A7 0x7483 +0xC1A8 0x54E9 +0xC1A9 0x4FE9 +0xC1AA 0x8054 +0xC1AB 0x83B2 +0xC1AC 0x8FDE +0xC1AD 0x9570 +0xC1AE 0x5EC9 +0xC1AF 0x601C +0xC1B0 0x6D9F +0xC1B1 0x5E18 +0xC1B2 0x655B +0xC1B3 0x8138 +0xC1B4 0x94FE +0xC1B5 0x604B +0xC1B6 0x70BC +0xC1B7 0x7EC3 +0xC1B8 0x7CAE +0xC1B9 0x51C9 +0xC1BA 0x6881 +0xC1BB 0x7CB1 +0xC1BC 0x826F +0xC1BD 0x4E24 +0xC1BE 0x8F86 +0xC1BF 0x91CF +0xC1C0 0x667E +0xC1C1 0x4EAE +0xC1C2 0x8C05 +0xC1C3 0x64A9 +0xC1C4 0x804A +0xC1C5 0x50DA +0xC1C6 0x7597 +0xC1C7 0x71CE +0xC1C8 0x5BE5 +0xC1C9 0x8FBD +0xC1CA 0x6F66 +0xC1CB 0x4E86 +0xC1CC 0x6482 +0xC1CD 0x9563 +0xC1CE 0x5ED6 +0xC1CF 0x6599 +0xC1D0 0x5217 +0xC1D1 0x88C2 +0xC1D2 0x70C8 +0xC1D3 0x52A3 +0xC1D4 0x730E +0xC1D5 0x7433 +0xC1D6 0x6797 +0xC1D7 0x78F7 +0xC1D8 0x9716 +0xC1D9 0x4E34 +0xC1DA 0x90BB +0xC1DB 0x9CDE +0xC1DC 0x6DCB +0xC1DD 0x51DB +0xC1DE 0x8D41 +0xC1DF 0x541D +0xC1E0 0x62CE +0xC1E1 0x73B2 +0xC1E2 0x83F1 +0xC1E3 0x96F6 +0xC1E4 0x9F84 +0xC1E5 0x94C3 +0xC1E6 0x4F36 +0xC1E7 0x7F9A +0xC1E8 0x51CC +0xC1E9 0x7075 +0xC1EA 0x9675 +0xC1EB 0x5CAD +0xC1EC 0x9886 +0xC1ED 0x53E6 +0xC1EE 0x4EE4 +0xC1EF 0x6E9C +0xC1F0 0x7409 +0xC1F1 0x69B4 +0xC1F2 0x786B +0xC1F3 0x998F +0xC1F4 0x7559 +0xC1F5 0x5218 +0xC1F6 0x7624 +0xC1F7 0x6D41 +0xC1F8 0x67F3 +0xC1F9 0x516D +0xC1FA 0x9F99 +0xC1FB 0x804B +0xC1FC 0x5499 +0xC1FD 0x7B3C +0xC1FE 0x7ABF +0xC240 0x7FE4 +0xC241 0xC242 0x7FE7 +0xC243 0xC246 0x7FEA +0xC247 0x7FEF +0xC248 0x7FF2 +0xC249 0xC24F 0x7FF4 +0xC250 0xC252 0x7FFD +0xC253 0x8002 +0xC254 0xC257 0x8007 +0xC258 0xC259 0x800E +0xC25A 0x8011 +0xC25B 0x8013 +0xC25C 0xC25D 0x801A +0xC25E 0xC260 0x801D +0xC261 0x8021 +0xC262 0xC263 0x8023 +0xC264 0xC269 0x802B +0xC26A 0x8032 +0xC26B 0x8034 +0xC26C 0xC26D 0x8039 +0xC26E 0x803C +0xC26F 0x803E +0xC270 0xC271 0x8040 +0xC272 0xC273 0x8044 +0xC274 0xC276 0x8047 +0xC277 0xC27A 0x804E +0xC27B 0x8053 +0xC27C 0xC27E 0x8055 +0xC280 0x8059 +0xC281 0xC28E 0x805B +0xC28F 0xC294 0x806B +0xC295 0xC2A0 0x8072 +0xC2A1 0x9686 +0xC2A2 0x5784 +0xC2A3 0x62E2 +0xC2A4 0x9647 +0xC2A5 0x697C +0xC2A6 0x5A04 +0xC2A7 0x6402 +0xC2A8 0x7BD3 +0xC2A9 0x6F0F +0xC2AA 0x964B +0xC2AB 0x82A6 +0xC2AC 0x5362 +0xC2AD 0x9885 +0xC2AE 0x5E90 +0xC2AF 0x7089 +0xC2B0 0x63B3 +0xC2B1 0x5364 +0xC2B2 0x864F +0xC2B3 0x9C81 +0xC2B4 0x9E93 +0xC2B5 0x788C +0xC2B6 0x9732 +0xC2B7 0x8DEF +0xC2B8 0x8D42 +0xC2B9 0x9E7F +0xC2BA 0x6F5E +0xC2BB 0x7984 +0xC2BC 0x5F55 +0xC2BD 0x9646 +0xC2BE 0x622E +0xC2BF 0x9A74 +0xC2C0 0x5415 +0xC2C1 0x94DD +0xC2C2 0x4FA3 +0xC2C3 0x65C5 +0xC2C4 0x5C65 +0xC2C5 0x5C61 +0xC2C6 0x7F15 +0xC2C7 0x8651 +0xC2C8 0x6C2F +0xC2C9 0x5F8B +0xC2CA 0x7387 +0xC2CB 0x6EE4 +0xC2CC 0x7EFF +0xC2CD 0x5CE6 +0xC2CE 0x631B +0xC2CF 0x5B6A +0xC2D0 0x6EE6 +0xC2D1 0x5375 +0xC2D2 0x4E71 +0xC2D3 0x63A0 +0xC2D4 0x7565 +0xC2D5 0x62A1 +0xC2D6 0x8F6E +0xC2D7 0x4F26 +0xC2D8 0x4ED1 +0xC2D9 0x6CA6 +0xC2DA 0x7EB6 +0xC2DB 0x8BBA +0xC2DC 0x841D +0xC2DD 0x87BA +0xC2DE 0x7F57 +0xC2DF 0x903B +0xC2E0 0x9523 +0xC2E1 0x7BA9 +0xC2E2 0x9AA1 +0xC2E3 0x88F8 +0xC2E4 0x843D +0xC2E5 0x6D1B +0xC2E6 0x9A86 +0xC2E7 0x7EDC +0xC2E8 0x5988 +0xC2E9 0x9EBB +0xC2EA 0x739B +0xC2EB 0x7801 +0xC2EC 0x8682 +0xC2ED 0x9A6C +0xC2EE 0x9A82 +0xC2EF 0x561B +0xC2F0 0x5417 +0xC2F1 0x57CB +0xC2F2 0x4E70 +0xC2F3 0x9EA6 +0xC2F4 0x5356 +0xC2F5 0x8FC8 +0xC2F6 0x8109 +0xC2F7 0x7792 +0xC2F8 0x9992 +0xC2F9 0x86EE +0xC2FA 0x6EE1 +0xC2FB 0x8513 +0xC2FC 0x66FC +0xC2FD 0x6162 +0xC2FE 0x6F2B +0xC340 0x807E +0xC341 0xC342 0x8081 +0xC343 0x8085 +0xC344 0x8088 +0xC345 0x808A +0xC346 0xC34B 0x808D +0xC34C 0xC34D 0x8094 +0xC34E 0x8097 +0xC34F 0x8099 +0xC350 0x809E +0xC351 0x80A3 +0xC352 0xC354 0x80A6 +0xC355 0x80AC +0xC356 0x80B0 +0xC357 0x80B3 +0xC358 0xC359 0x80B5 +0xC35A 0xC35B 0x80B8 +0xC35C 0x80BB +0xC35D 0x80C5 +0xC35E 0xC362 0x80C7 +0xC363 0xC369 0x80CF +0xC36A 0x80D8 +0xC36B 0xC36C 0x80DF +0xC36D 0xC36E 0x80E2 +0xC36F 0x80E6 +0xC370 0x80EE +0xC371 0x80F5 +0xC372 0x80F7 +0xC373 0x80F9 +0xC374 0x80FB +0xC375 0xC378 0x80FE +0xC379 0xC37B 0x8103 +0xC37C 0xC37D 0x8107 +0xC37E 0x810B +0xC380 0x810C +0xC381 0x8115 +0xC382 0x8117 +0xC383 0x8119 +0xC384 0xC386 0x811B +0xC387 0xC393 0x811F +0xC394 0xC395 0x812D +0xC396 0x8130 +0xC397 0xC399 0x8133 +0xC39A 0x8137 +0xC39B 0xC39F 0x8139 +0xC3A0 0x813F +0xC3A1 0x8C29 +0xC3A2 0x8292 +0xC3A3 0x832B +0xC3A4 0x76F2 +0xC3A5 0x6C13 +0xC3A6 0x5FD9 +0xC3A7 0x83BD +0xC3A8 0x732B +0xC3A9 0x8305 +0xC3AA 0x951A +0xC3AB 0x6BDB +0xC3AC 0x77DB +0xC3AD 0x94C6 +0xC3AE 0x536F +0xC3AF 0x8302 +0xC3B0 0x5192 +0xC3B1 0x5E3D +0xC3B2 0x8C8C +0xC3B3 0x8D38 +0xC3B4 0x4E48 +0xC3B5 0x73AB +0xC3B6 0x679A +0xC3B7 0x6885 +0xC3B8 0x9176 +0xC3B9 0x9709 +0xC3BA 0x7164 +0xC3BB 0x6CA1 +0xC3BC 0x7709 +0xC3BD 0x5A92 +0xC3BE 0x9541 +0xC3BF 0x6BCF +0xC3C0 0x7F8E +0xC3C1 0x6627 +0xC3C2 0x5BD0 +0xC3C3 0x59B9 +0xC3C4 0x5A9A +0xC3C5 0x95E8 +0xC3C6 0x95F7 +0xC3C7 0x4EEC +0xC3C8 0x840C +0xC3C9 0x8499 +0xC3CA 0x6AAC +0xC3CB 0x76DF +0xC3CC 0x9530 +0xC3CD 0x731B +0xC3CE 0x68A6 +0xC3CF 0x5B5F +0xC3D0 0x772F +0xC3D1 0x919A +0xC3D2 0x9761 +0xC3D3 0x7CDC +0xC3D4 0x8FF7 +0xC3D5 0x8C1C +0xC3D6 0x5F25 +0xC3D7 0x7C73 +0xC3D8 0x79D8 +0xC3D9 0x89C5 +0xC3DA 0x6CCC +0xC3DB 0x871C +0xC3DC 0x5BC6 +0xC3DD 0x5E42 +0xC3DE 0x68C9 +0xC3DF 0x7720 +0xC3E0 0x7EF5 +0xC3E1 0x5195 +0xC3E2 0x514D +0xC3E3 0x52C9 +0xC3E4 0x5A29 +0xC3E5 0x7F05 +0xC3E6 0x9762 +0xC3E7 0x82D7 +0xC3E8 0x63CF +0xC3E9 0x7784 +0xC3EA 0x85D0 +0xC3EB 0x79D2 +0xC3EC 0x6E3A +0xC3ED 0x5E99 +0xC3EE 0x5999 +0xC3EF 0x8511 +0xC3F0 0x706D +0xC3F1 0x6C11 +0xC3F2 0x62BF +0xC3F3 0x76BF +0xC3F4 0x654F +0xC3F5 0x60AF +0xC3F6 0x95FD +0xC3F7 0x660E +0xC3F8 0x879F +0xC3F9 0x9E23 +0xC3FA 0x94ED +0xC3FB 0x540D +0xC3FC 0x547D +0xC3FD 0x8C2C +0xC3FE 0x6478 +0xC440 0xC445 0x8140 +0xC446 0x8147 +0xC447 0x8149 +0xC448 0xC44A 0x814D +0xC44B 0x8152 +0xC44C 0xC44E 0x8156 +0xC44F 0xC453 0x815B +0xC454 0xC457 0x8161 +0xC458 0x8166 +0xC459 0x8168 +0xC45A 0xC45C 0x816A +0xC45D 0x816F +0xC45E 0xC45F 0x8172 +0xC460 0xC463 0x8175 +0xC464 0x8181 +0xC465 0xC469 0x8183 +0xC46A 0x8189 +0xC46B 0xC46E 0x818B +0xC46F 0x8190 +0xC470 0xC475 0x8192 +0xC476 0xC477 0x8199 +0xC478 0xC47C 0x819E +0xC47D 0xC47E 0x81A4 +0xC480 0x81A7 +0xC481 0x81A9 +0xC482 0xC489 0x81AB +0xC48A 0xC48F 0x81B4 +0xC490 0xC493 0x81BC +0xC494 0xC495 0x81C4 +0xC496 0xC498 0x81C7 +0xC499 0x81CB +0xC49A 0xC4A0 0x81CD +0xC4A1 0x6479 +0xC4A2 0x8611 +0xC4A3 0x6A21 +0xC4A4 0x819C +0xC4A5 0x78E8 +0xC4A6 0x6469 +0xC4A7 0x9B54 +0xC4A8 0x62B9 +0xC4A9 0x672B +0xC4AA 0x83AB +0xC4AB 0x58A8 +0xC4AC 0x9ED8 +0xC4AD 0x6CAB +0xC4AE 0x6F20 +0xC4AF 0x5BDE +0xC4B0 0x964C +0xC4B1 0x8C0B +0xC4B2 0x725F +0xC4B3 0x67D0 +0xC4B4 0x62C7 +0xC4B5 0x7261 +0xC4B6 0x4EA9 +0xC4B7 0x59C6 +0xC4B8 0x6BCD +0xC4B9 0x5893 +0xC4BA 0x66AE +0xC4BB 0x5E55 +0xC4BC 0x52DF +0xC4BD 0x6155 +0xC4BE 0x6728 +0xC4BF 0x76EE +0xC4C0 0x7766 +0xC4C1 0x7267 +0xC4C2 0x7A46 +0xC4C3 0x62FF +0xC4C4 0x54EA +0xC4C5 0x5450 +0xC4C6 0x94A0 +0xC4C7 0x90A3 +0xC4C8 0x5A1C +0xC4C9 0x7EB3 +0xC4CA 0x6C16 +0xC4CB 0x4E43 +0xC4CC 0x5976 +0xC4CD 0x8010 +0xC4CE 0x5948 +0xC4CF 0x5357 +0xC4D0 0x7537 +0xC4D1 0x96BE +0xC4D2 0x56CA +0xC4D3 0x6320 +0xC4D4 0x8111 +0xC4D5 0x607C +0xC4D6 0x95F9 +0xC4D7 0x6DD6 +0xC4D8 0x5462 +0xC4D9 0x9981 +0xC4DA 0x5185 +0xC4DB 0x5AE9 +0xC4DC 0x80FD +0xC4DD 0x59AE +0xC4DE 0x9713 +0xC4DF 0x502A +0xC4E0 0x6CE5 +0xC4E1 0x5C3C +0xC4E2 0x62DF +0xC4E3 0x4F60 +0xC4E4 0x533F +0xC4E5 0x817B +0xC4E6 0x9006 +0xC4E7 0x6EBA +0xC4E8 0x852B +0xC4E9 0x62C8 +0xC4EA 0x5E74 +0xC4EB 0x78BE +0xC4EC 0x64B5 +0xC4ED 0x637B +0xC4EE 0x5FF5 +0xC4EF 0x5A18 +0xC4F0 0x917F +0xC4F1 0x9E1F +0xC4F2 0x5C3F +0xC4F3 0x634F +0xC4F4 0x8042 +0xC4F5 0x5B7D +0xC4F6 0x556E +0xC4F7 0x954A +0xC4F8 0x954D +0xC4F9 0x6D85 +0xC4FA 0x60A8 +0xC4FB 0x67E0 +0xC4FC 0x72DE +0xC4FD 0x51DD +0xC4FE 0x5B81 +0xC540 0xC54E 0x81D4 +0xC54F 0xC551 0x81E4 +0xC552 0xC553 0x81E8 +0xC554 0x81EB +0xC555 0xC559 0x81EE +0xC55A 0xC55F 0x81F5 +0xC560 0x81FD +0xC561 0x81FF +0xC562 0x8203 +0xC563 0xC567 0x8207 +0xC568 0xC569 0x820E +0xC56A 0x8211 +0xC56B 0x8213 +0xC56C 0xC571 0x8215 +0xC572 0x821D +0xC573 0x8220 +0xC574 0xC577 0x8224 +0xC578 0x8229 +0xC579 0x822E +0xC57A 0x8232 +0xC57B 0x823A +0xC57C 0xC57D 0x823C +0xC57E 0x823F +0xC580 0xC583 0x8240 +0xC584 0xC585 0x8245 +0xC586 0x8248 +0xC587 0x824A +0xC588 0xC58A 0x824C +0xC58B 0xC592 0x8250 +0xC593 0x8259 +0xC594 0xC597 0x825B +0xC598 0xC59F 0x8260 +0xC5A0 0x8269 +0xC5A1 0x62E7 +0xC5A2 0x6CDE +0xC5A3 0x725B +0xC5A4 0x626D +0xC5A5 0x94AE +0xC5A6 0x7EBD +0xC5A7 0x8113 +0xC5A8 0x6D53 +0xC5A9 0x519C +0xC5AA 0x5F04 +0xC5AB 0x5974 +0xC5AC 0x52AA +0xC5AD 0x6012 +0xC5AE 0x5973 +0xC5AF 0x6696 +0xC5B0 0x8650 +0xC5B1 0x759F +0xC5B2 0x632A +0xC5B3 0x61E6 +0xC5B4 0x7CEF +0xC5B5 0x8BFA +0xC5B6 0x54E6 +0xC5B7 0x6B27 +0xC5B8 0x9E25 +0xC5B9 0x6BB4 +0xC5BA 0x85D5 +0xC5BB 0x5455 +0xC5BC 0x5076 +0xC5BD 0x6CA4 +0xC5BE 0x556A +0xC5BF 0x8DB4 +0xC5C0 0x722C +0xC5C1 0x5E15 +0xC5C2 0x6015 +0xC5C3 0x7436 +0xC5C4 0x62CD +0xC5C5 0x6392 +0xC5C6 0x724C +0xC5C7 0x5F98 +0xC5C8 0x6E43 +0xC5C9 0x6D3E +0xC5CA 0x6500 +0xC5CB 0x6F58 +0xC5CC 0x76D8 +0xC5CD 0x78D0 +0xC5CE 0x76FC +0xC5CF 0x7554 +0xC5D0 0x5224 +0xC5D1 0x53DB +0xC5D2 0x4E53 +0xC5D3 0x5E9E +0xC5D4 0x65C1 +0xC5D5 0x802A +0xC5D6 0x80D6 +0xC5D7 0x629B +0xC5D8 0x5486 +0xC5D9 0x5228 +0xC5DA 0x70AE +0xC5DB 0x888D +0xC5DC 0x8DD1 +0xC5DD 0x6CE1 +0xC5DE 0x5478 +0xC5DF 0x80DA +0xC5E0 0x57F9 +0xC5E1 0x88F4 +0xC5E2 0x8D54 +0xC5E3 0x966A +0xC5E4 0x914D +0xC5E5 0x4F69 +0xC5E6 0x6C9B +0xC5E7 0x55B7 +0xC5E8 0x76C6 +0xC5E9 0x7830 +0xC5EA 0x62A8 +0xC5EB 0x70F9 +0xC5EC 0x6F8E +0xC5ED 0x5F6D +0xC5EE 0x84EC +0xC5EF 0x68DA +0xC5F0 0x787C +0xC5F1 0x7BF7 +0xC5F2 0x81A8 +0xC5F3 0x670B +0xC5F4 0x9E4F +0xC5F5 0x6367 +0xC5F6 0x78B0 +0xC5F7 0x576F +0xC5F8 0x7812 +0xC5F9 0x9739 +0xC5FA 0x6279 +0xC5FB 0x62AB +0xC5FC 0x5288 +0xC5FD 0x7435 +0xC5FE 0x6BD7 +0xC640 0xC643 0x826A +0xC644 0x8271 +0xC645 0xC648 0x8275 +0xC649 0xC64A 0x827B +0xC64B 0xC64C 0x8280 +0xC64D 0x8283 +0xC64E 0xC650 0x8285 +0xC651 0x8289 +0xC652 0x828C +0xC653 0x8290 +0xC654 0xC657 0x8293 +0xC658 0xC659 0x829A +0xC65A 0x829E +0xC65B 0x82A0 +0xC65C 0xC65D 0x82A2 +0xC65E 0x82A7 +0xC65F 0x82B2 +0xC660 0xC661 0x82B5 +0xC662 0xC664 0x82BA +0xC665 0xC666 0x82BF +0xC667 0xC668 0x82C2 +0xC669 0xC66A 0x82C5 +0xC66B 0x82C9 +0xC66C 0x82D0 +0xC66D 0x82D6 +0xC66E 0xC66F 0x82D9 +0xC670 0x82DD +0xC671 0x82E2 +0xC672 0xC675 0x82E7 +0xC676 0xC678 0x82EC +0xC679 0x82F0 +0xC67A 0xC67B 0x82F2 +0xC67C 0xC67D 0x82F5 +0xC67E 0x82F8 +0xC680 0x82FA +0xC681 0xC685 0x82FC +0xC686 0xC687 0x830A +0xC688 0x830D +0xC689 0x8310 +0xC68A 0xC68B 0x8312 +0xC68C 0x8316 +0xC68D 0xC68E 0x8318 +0xC68F 0xC698 0x831D +0xC699 0xC69A 0x8329 +0xC69B 0x832E +0xC69C 0x8330 +0xC69D 0x8332 +0xC69E 0x8337 +0xC69F 0x833B +0xC6A0 0x833D +0xC6A1 0x5564 +0xC6A2 0x813E +0xC6A3 0x75B2 +0xC6A4 0x76AE +0xC6A5 0x5339 +0xC6A6 0x75DE +0xC6A7 0x50FB +0xC6A8 0x5C41 +0xC6A9 0x8B6C +0xC6AA 0x7BC7 +0xC6AB 0x504F +0xC6AC 0x7247 +0xC6AD 0x9A97 +0xC6AE 0x98D8 +0xC6AF 0x6F02 +0xC6B0 0x74E2 +0xC6B1 0x7968 +0xC6B2 0x6487 +0xC6B3 0x77A5 +0xC6B4 0x62FC +0xC6B5 0x9891 +0xC6B6 0x8D2B +0xC6B7 0x54C1 +0xC6B8 0x8058 +0xC6B9 0x4E52 +0xC6BA 0x576A +0xC6BB 0x82F9 +0xC6BC 0x840D +0xC6BD 0x5E73 +0xC6BE 0x51ED +0xC6BF 0x74F6 +0xC6C0 0x8BC4 +0xC6C1 0x5C4F +0xC6C2 0x5761 +0xC6C3 0x6CFC +0xC6C4 0x9887 +0xC6C5 0x5A46 +0xC6C6 0x7834 +0xC6C7 0x9B44 +0xC6C8 0x8FEB +0xC6C9 0x7C95 +0xC6CA 0x5256 +0xC6CB 0x6251 +0xC6CC 0x94FA +0xC6CD 0x4EC6 +0xC6CE 0x8386 +0xC6CF 0x8461 +0xC6D0 0x83E9 +0xC6D1 0x84B2 +0xC6D2 0x57D4 +0xC6D3 0x6734 +0xC6D4 0x5703 +0xC6D5 0x666E +0xC6D6 0x6D66 +0xC6D7 0x8C31 +0xC6D8 0x66DD +0xC6D9 0x7011 +0xC6DA 0x671F +0xC6DB 0x6B3A +0xC6DC 0x6816 +0xC6DD 0x621A +0xC6DE 0x59BB +0xC6DF 0x4E03 +0xC6E0 0x51C4 +0xC6E1 0x6F06 +0xC6E2 0x67D2 +0xC6E3 0x6C8F +0xC6E4 0x5176 +0xC6E5 0x68CB +0xC6E6 0x5947 +0xC6E7 0x6B67 +0xC6E8 0x7566 +0xC6E9 0x5D0E +0xC6EA 0x8110 +0xC6EB 0x9F50 +0xC6EC 0x65D7 +0xC6ED 0x7948 +0xC6EE 0x7941 +0xC6EF 0x9A91 +0xC6F0 0x8D77 +0xC6F1 0x5C82 +0xC6F2 0x4E5E +0xC6F3 0x4F01 +0xC6F4 0x542F +0xC6F5 0x5951 +0xC6F6 0x780C +0xC6F7 0x5668 +0xC6F8 0x6C14 +0xC6F9 0x8FC4 +0xC6FA 0x5F03 +0xC6FB 0x6C7D +0xC6FC 0x6CE3 +0xC6FD 0x8BAB +0xC6FE 0x6390 +0xC740 0xC741 0x833E +0xC742 0xC743 0x8341 +0xC744 0xC745 0x8344 +0xC746 0x8348 +0xC747 0xC74B 0x834A +0xC74C 0x8353 +0xC74D 0xC751 0x8355 +0xC752 0x835D +0xC753 0x8362 +0xC754 0xC75A 0x8370 +0xC75B 0xC75C 0x8379 +0xC75D 0xC763 0x837E +0xC764 0xC765 0x8387 +0xC766 0xC769 0x838A +0xC76A 0xC76C 0x838F +0xC76D 0xC770 0x8394 +0xC771 0xC772 0x8399 +0xC773 0x839D +0xC774 0x839F +0xC775 0xC77B 0x83A1 +0xC77C 0xC77E 0x83AC +0xC780 0x83AF +0xC781 0x83B5 +0xC782 0x83BB +0xC783 0xC784 0x83BE +0xC785 0xC787 0x83C2 +0xC788 0x83C6 +0xC789 0xC78A 0x83C8 +0xC78B 0x83CB +0xC78C 0xC78D 0x83CD +0xC78E 0xC791 0x83D0 +0xC792 0x83D5 +0xC793 0x83D7 +0xC794 0xC796 0x83D9 +0xC797 0x83DE +0xC798 0xC79A 0x83E2 +0xC79B 0xC79D 0x83E6 +0xC79E 0xC7A0 0x83EB +0xC7A1 0x6070 +0xC7A2 0x6D3D +0xC7A3 0x7275 +0xC7A4 0x6266 +0xC7A5 0x948E +0xC7A6 0x94C5 +0xC7A7 0x5343 +0xC7A8 0x8FC1 +0xC7A9 0x7B7E +0xC7AA 0x4EDF +0xC7AB 0x8C26 +0xC7AC 0x4E7E +0xC7AD 0x9ED4 +0xC7AE 0x94B1 +0xC7AF 0x94B3 +0xC7B0 0x524D +0xC7B1 0x6F5C +0xC7B2 0x9063 +0xC7B3 0x6D45 +0xC7B4 0x8C34 +0xC7B5 0x5811 +0xC7B6 0x5D4C +0xC7B7 0x6B20 +0xC7B8 0x6B49 +0xC7B9 0x67AA +0xC7BA 0x545B +0xC7BB 0x8154 +0xC7BC 0x7F8C +0xC7BD 0x5899 +0xC7BE 0x8537 +0xC7BF 0x5F3A +0xC7C0 0x62A2 +0xC7C1 0x6A47 +0xC7C2 0x9539 +0xC7C3 0x6572 +0xC7C4 0x6084 +0xC7C5 0x6865 +0xC7C6 0x77A7 +0xC7C7 0x4E54 +0xC7C8 0x4FA8 +0xC7C9 0x5DE7 +0xC7CA 0x9798 +0xC7CB 0x64AC +0xC7CC 0x7FD8 +0xC7CD 0x5CED +0xC7CE 0x4FCF +0xC7CF 0x7A8D +0xC7D0 0x5207 +0xC7D1 0x8304 +0xC7D2 0x4E14 +0xC7D3 0x602F +0xC7D4 0x7A83 +0xC7D5 0x94A6 +0xC7D6 0x4FB5 +0xC7D7 0x4EB2 +0xC7D8 0x79E6 +0xC7D9 0x7434 +0xC7DA 0x52E4 +0xC7DB 0x82B9 +0xC7DC 0x64D2 +0xC7DD 0x79BD +0xC7DE 0x5BDD +0xC7DF 0x6C81 +0xC7E0 0x9752 +0xC7E1 0x8F7B +0xC7E2 0x6C22 +0xC7E3 0x503E +0xC7E4 0x537F +0xC7E5 0x6E05 +0xC7E6 0x64CE +0xC7E7 0x6674 +0xC7E8 0x6C30 +0xC7E9 0x60C5 +0xC7EA 0x9877 +0xC7EB 0x8BF7 +0xC7EC 0x5E86 +0xC7ED 0x743C +0xC7EE 0x7A77 +0xC7EF 0x79CB +0xC7F0 0x4E18 +0xC7F1 0x90B1 +0xC7F2 0x7403 +0xC7F3 0x6C42 +0xC7F4 0x56DA +0xC7F5 0x914B +0xC7F6 0x6CC5 +0xC7F7 0x8D8B +0xC7F8 0x533A +0xC7F9 0x86C6 +0xC7FA 0x66F2 +0xC7FB 0x8EAF +0xC7FC 0x5C48 +0xC7FD 0x9A71 +0xC7FE 0x6E20 +0xC840 0xC841 0x83EE +0xC842 0xC846 0x83F3 +0xC847 0xC849 0x83FA +0xC84A 0xC84C 0x83FE +0xC84D 0x8402 +0xC84E 0x8405 +0xC84F 0xC852 0x8407 +0xC853 0x8410 +0xC854 0xC859 0x8412 +0xC85A 0xC85C 0x8419 +0xC85D 0xC862 0x841E +0xC863 0xC86A 0x8429 +0xC86B 0xC870 0x8432 +0xC871 0xC873 0x8439 +0xC874 0xC87B 0x843E +0xC87C 0xC87E 0x8447 +0xC880 0xC886 0x844A +0xC887 0xC88B 0x8452 +0xC88C 0x8458 +0xC88D 0xC890 0x845D +0xC891 0x8462 +0xC892 0xC896 0x8464 +0xC897 0x846A +0xC898 0xC89A 0x846E +0xC89B 0x8472 +0xC89C 0x8474 +0xC89D 0x8477 +0xC89E 0x8479 +0xC89F 0xC8A0 0x847B +0xC8A1 0x53D6 +0xC8A2 0x5A36 +0xC8A3 0x9F8B +0xC8A4 0x8DA3 +0xC8A5 0x53BB +0xC8A6 0x5708 +0xC8A7 0x98A7 +0xC8A8 0x6743 +0xC8A9 0x919B +0xC8AA 0x6CC9 +0xC8AB 0x5168 +0xC8AC 0x75CA +0xC8AD 0x62F3 +0xC8AE 0x72AC +0xC8AF 0x5238 +0xC8B0 0x529D +0xC8B1 0x7F3A +0xC8B2 0x7094 +0xC8B3 0x7638 +0xC8B4 0x5374 +0xC8B5 0x9E4A +0xC8B6 0x69B7 +0xC8B7 0x786E +0xC8B8 0x96C0 +0xC8B9 0x88D9 +0xC8BA 0x7FA4 +0xC8BB 0x7136 +0xC8BC 0x71C3 +0xC8BD 0x5189 +0xC8BE 0x67D3 +0xC8BF 0x74E4 +0xC8C0 0x58E4 +0xC8C1 0x6518 +0xC8C2 0x56B7 +0xC8C3 0x8BA9 +0xC8C4 0x9976 +0xC8C5 0x6270 +0xC8C6 0x7ED5 +0xC8C7 0x60F9 +0xC8C8 0x70ED +0xC8C9 0x58EC +0xC8CA 0x4EC1 +0xC8CB 0x4EBA +0xC8CC 0x5FCD +0xC8CD 0x97E7 +0xC8CE 0x4EFB +0xC8CF 0x8BA4 +0xC8D0 0x5203 +0xC8D1 0x598A +0xC8D2 0x7EAB +0xC8D3 0x6254 +0xC8D4 0x4ECD +0xC8D5 0x65E5 +0xC8D6 0x620E +0xC8D7 0x8338 +0xC8D8 0x84C9 +0xC8D9 0x8363 +0xC8DA 0x878D +0xC8DB 0x7194 +0xC8DC 0x6EB6 +0xC8DD 0x5BB9 +0xC8DE 0x7ED2 +0xC8DF 0x5197 +0xC8E0 0x63C9 +0xC8E1 0x67D4 +0xC8E2 0x8089 +0xC8E3 0x8339 +0xC8E4 0x8815 +0xC8E5 0x5112 +0xC8E6 0x5B7A +0xC8E7 0x5982 +0xC8E8 0x8FB1 +0xC8E9 0x4E73 +0xC8EA 0x6C5D +0xC8EB 0x5165 +0xC8EC 0x8925 +0xC8ED 0x8F6F +0xC8EE 0x962E +0xC8EF 0x854A +0xC8F0 0x745E +0xC8F1 0x9510 +0xC8F2 0x95F0 +0xC8F3 0x6DA6 +0xC8F4 0x82E5 +0xC8F5 0x5F31 +0xC8F6 0x6492 +0xC8F7 0x6D12 +0xC8F8 0x8428 +0xC8F9 0x816E +0xC8FA 0x9CC3 +0xC8FB 0x585E +0xC8FC 0x8D5B +0xC8FD 0x4E09 +0xC8FE 0x53C1 +0xC940 0xC944 0x847D +0xC945 0xC948 0x8483 +0xC949 0x848A +0xC94A 0x848D +0xC94B 0xC952 0x848F +0xC953 0x8498 +0xC954 0xC955 0x849A +0xC956 0xC959 0x849D +0xC95A 0xC966 0x84A2 +0xC967 0xC968 0x84B0 +0xC969 0x84B3 +0xC96A 0xC96C 0x84B5 +0xC96D 0xC96E 0x84BB +0xC96F 0x84BE +0xC970 0x84C0 +0xC971 0xC972 0x84C2 +0xC973 0xC976 0x84C5 +0xC977 0xC978 0x84CB +0xC979 0xC97A 0x84CE +0xC97B 0x84D2 +0xC97C 0xC97D 0x84D4 +0xC97E 0x84D7 +0xC980 0xC984 0x84D8 +0xC985 0x84DE +0xC986 0xC987 0x84E1 +0xC988 0x84E4 +0xC989 0xC98D 0x84E7 +0xC98E 0xC990 0x84ED +0xC991 0xC99B 0x84F1 +0xC99C 0xC99D 0x84FD +0xC99E 0xC9A0 0x8500 +0xC9A1 0x4F1E +0xC9A2 0x6563 +0xC9A3 0x6851 +0xC9A4 0x55D3 +0xC9A5 0x4E27 +0xC9A6 0x6414 +0xC9A7 0x9A9A +0xC9A8 0x626B +0xC9A9 0x5AC2 +0xC9AA 0x745F +0xC9AB 0x8272 +0xC9AC 0x6DA9 +0xC9AD 0x68EE +0xC9AE 0x50E7 +0xC9AF 0x838E +0xC9B0 0x7802 +0xC9B1 0x6740 +0xC9B2 0x5239 +0xC9B3 0x6C99 +0xC9B4 0x7EB1 +0xC9B5 0x50BB +0xC9B6 0x5565 +0xC9B7 0x715E +0xC9B8 0x7B5B +0xC9B9 0x6652 +0xC9BA 0x73CA +0xC9BB 0x82EB +0xC9BC 0x6749 +0xC9BD 0x5C71 +0xC9BE 0x5220 +0xC9BF 0x717D +0xC9C0 0x886B +0xC9C1 0x95EA +0xC9C2 0x9655 +0xC9C3 0x64C5 +0xC9C4 0x8D61 +0xC9C5 0x81B3 +0xC9C6 0x5584 +0xC9C7 0x6C55 +0xC9C8 0x6247 +0xC9C9 0x7F2E +0xC9CA 0x5892 +0xC9CB 0x4F24 +0xC9CC 0x5546 +0xC9CD 0x8D4F +0xC9CE 0x664C +0xC9CF 0x4E0A +0xC9D0 0x5C1A +0xC9D1 0x88F3 +0xC9D2 0x68A2 +0xC9D3 0x634E +0xC9D4 0x7A0D +0xC9D5 0x70E7 +0xC9D6 0x828D +0xC9D7 0x52FA +0xC9D8 0x97F6 +0xC9D9 0x5C11 +0xC9DA 0x54E8 +0xC9DB 0x90B5 +0xC9DC 0x7ECD +0xC9DD 0x5962 +0xC9DE 0x8D4A +0xC9DF 0x86C7 +0xC9E0 0xC9E1 0x820C +0xC9E2 0x8D66 +0xC9E3 0x6444 +0xC9E4 0x5C04 +0xC9E5 0x6151 +0xC9E6 0x6D89 +0xC9E7 0x793E +0xC9E8 0x8BBE +0xC9E9 0x7837 +0xC9EA 0x7533 +0xC9EB 0x547B +0xC9EC 0x4F38 +0xC9ED 0x8EAB +0xC9EE 0x6DF1 +0xC9EF 0x5A20 +0xC9F0 0x7EC5 +0xC9F1 0x795E +0xC9F2 0x6C88 +0xC9F3 0x5BA1 +0xC9F4 0x5A76 +0xC9F5 0x751A +0xC9F6 0x80BE +0xC9F7 0x614E +0xC9F8 0x6E17 +0xC9F9 0x58F0 +0xC9FA 0x751F +0xC9FB 0x7525 +0xC9FC 0x7272 +0xC9FD 0x5347 +0xC9FE 0x7EF3 +0xCA40 0xCA48 0x8503 +0xCA49 0xCA4C 0x850D +0xCA4D 0x8512 +0xCA4E 0xCA50 0x8514 +0xCA51 0xCA52 0x8518 +0xCA53 0xCA56 0x851B +0xCA57 0x8520 +0xCA58 0xCA60 0x8522 +0xCA61 0xCA6A 0x852D +0xCA6B 0xCA6F 0x853E +0xCA70 0xCA73 0x8544 +0xCA74 0xCA7E 0x854B +0xCA80 0xCA81 0x8557 +0xCA82 0xCA85 0x855A +0xCA86 0xCA8A 0x855F +0xCA8B 0xCA8D 0x8565 +0xCA8E 0xCA96 0x8569 +0xCA97 0x8573 +0xCA98 0xCA9B 0x8575 +0xCA9C 0xCA9D 0x857C +0xCA9E 0xCAA0 0x857F +0xCAA1 0x7701 +0xCAA2 0x76DB +0xCAA3 0x5269 +0xCAA4 0x80DC +0xCAA5 0x5723 +0xCAA6 0x5E08 +0xCAA7 0x5931 +0xCAA8 0x72EE +0xCAA9 0x65BD +0xCAAA 0x6E7F +0xCAAB 0x8BD7 +0xCAAC 0x5C38 +0xCAAD 0x8671 +0xCAAE 0x5341 +0xCAAF 0x77F3 +0xCAB0 0x62FE +0xCAB1 0x65F6 +0xCAB2 0x4EC0 +0xCAB3 0x98DF +0xCAB4 0x8680 +0xCAB5 0x5B9E +0xCAB6 0x8BC6 +0xCAB7 0x53F2 +0xCAB8 0x77E2 +0xCAB9 0x4F7F +0xCABA 0x5C4E +0xCABB 0x9A76 +0xCABC 0x59CB +0xCABD 0x5F0F +0xCABE 0x793A +0xCABF 0x58EB +0xCAC0 0x4E16 +0xCAC1 0x67FF +0xCAC2 0x4E8B +0xCAC3 0x62ED +0xCAC4 0x8A93 +0xCAC5 0x901D +0xCAC6 0x52BF +0xCAC7 0x662F +0xCAC8 0x55DC +0xCAC9 0x566C +0xCACA 0x9002 +0xCACB 0x4ED5 +0xCACC 0x4F8D +0xCACD 0x91CA +0xCACE 0x9970 +0xCACF 0x6C0F +0xCAD0 0x5E02 +0xCAD1 0x6043 +0xCAD2 0x5BA4 +0xCAD3 0x89C6 +0xCAD4 0x8BD5 +0xCAD5 0x6536 +0xCAD6 0x624B +0xCAD7 0x9996 +0xCAD8 0x5B88 +0xCAD9 0x5BFF +0xCADA 0x6388 +0xCADB 0x552E +0xCADC 0x53D7 +0xCADD 0x7626 +0xCADE 0x517D +0xCADF 0x852C +0xCAE0 0x67A2 +0xCAE1 0x68B3 +0xCAE2 0x6B8A +0xCAE3 0x6292 +0xCAE4 0x8F93 +0xCAE5 0x53D4 +0xCAE6 0x8212 +0xCAE7 0x6DD1 +0xCAE8 0x758F +0xCAE9 0x4E66 +0xCAEA 0x8D4E +0xCAEB 0x5B70 +0xCAEC 0x719F +0xCAED 0x85AF +0xCAEE 0x6691 +0xCAEF 0x66D9 +0xCAF0 0x7F72 +0xCAF1 0x8700 +0xCAF2 0x9ECD +0xCAF3 0x9F20 +0xCAF4 0x5C5E +0xCAF5 0x672F +0xCAF6 0x8FF0 +0xCAF7 0x6811 +0xCAF8 0x675F +0xCAF9 0x620D +0xCAFA 0x7AD6 +0xCAFB 0x5885 +0xCAFC 0x5EB6 +0xCAFD 0x6570 +0xCAFE 0x6F31 +0xCB40 0xCB41 0x8582 +0xCB42 0x8586 +0xCB43 0xCB49 0x8588 +0xCB4A 0xCB54 0x8590 +0xCB55 0xCB5B 0x859D +0xCB5C 0xCB5E 0x85A5 +0xCB5F 0x85A9 +0xCB60 0xCB62 0x85AB +0xCB63 0xCB68 0x85B1 +0xCB69 0x85B8 +0xCB6A 0xCB70 0x85BA +0xCB71 0xCB77 0x85C2 +0xCB78 0xCB7C 0x85CA +0xCB7D 0xCB7E 0x85D1 +0xCB80 0x85D4 +0xCB81 0xCB86 0x85D6 +0xCB87 0xCB8D 0x85DD +0xCB8E 0xCB91 0x85E5 +0xCB92 0xCBA0 0x85EA +0xCBA1 0x6055 +0xCBA2 0x5237 +0xCBA3 0x800D +0xCBA4 0x6454 +0xCBA5 0x8870 +0xCBA6 0x7529 +0xCBA7 0x5E05 +0xCBA8 0x6813 +0xCBA9 0x62F4 +0xCBAA 0x971C +0xCBAB 0x53CC +0xCBAC 0x723D +0xCBAD 0x8C01 +0xCBAE 0x6C34 +0xCBAF 0x7761 +0xCBB0 0x7A0E +0xCBB1 0x542E +0xCBB2 0x77AC +0xCBB3 0x987A +0xCBB4 0x821C +0xCBB5 0x8BF4 +0xCBB6 0x7855 +0xCBB7 0x6714 +0xCBB8 0x70C1 +0xCBB9 0x65AF +0xCBBA 0x6495 +0xCBBB 0x5636 +0xCBBC 0x601D +0xCBBD 0x79C1 +0xCBBE 0x53F8 +0xCBBF 0x4E1D +0xCBC0 0x6B7B +0xCBC1 0x8086 +0xCBC2 0x5BFA +0xCBC3 0x55E3 +0xCBC4 0x56DB +0xCBC5 0x4F3A +0xCBC6 0x4F3C +0xCBC7 0x9972 +0xCBC8 0x5DF3 +0xCBC9 0x677E +0xCBCA 0x8038 +0xCBCB 0x6002 +0xCBCC 0x9882 +0xCBCD 0x9001 +0xCBCE 0x5B8B +0xCBCF 0x8BBC +0xCBD0 0x8BF5 +0xCBD1 0x641C +0xCBD2 0x8258 +0xCBD3 0x64DE +0xCBD4 0x55FD +0xCBD5 0x82CF +0xCBD6 0x9165 +0xCBD7 0x4FD7 +0xCBD8 0x7D20 +0xCBD9 0x901F +0xCBDA 0x7C9F +0xCBDB 0x50F3 +0xCBDC 0x5851 +0xCBDD 0x6EAF +0xCBDE 0x5BBF +0xCBDF 0x8BC9 +0xCBE0 0x8083 +0xCBE1 0x9178 +0xCBE2 0x849C +0xCBE3 0x7B97 +0xCBE4 0x867D +0xCBE5 0x968B +0xCBE6 0x968F +0xCBE7 0x7EE5 +0xCBE8 0x9AD3 +0xCBE9 0x788E +0xCBEA 0x5C81 +0xCBEB 0x7A57 +0xCBEC 0x9042 +0xCBED 0x96A7 +0xCBEE 0x795F +0xCBEF 0x5B59 +0xCBF0 0x635F +0xCBF1 0x7B0B +0xCBF2 0x84D1 +0xCBF3 0x68AD +0xCBF4 0x5506 +0xCBF5 0x7F29 +0xCBF6 0x7410 +0xCBF7 0x7D22 +0xCBF8 0x9501 +0xCBF9 0x6240 +0xCBFA 0x584C +0xCBFB 0x4ED6 +0xCBFC 0x5B83 +0xCBFD 0x5979 +0xCBFE 0x5854 +0xCC40 0xCC41 0x85F9 +0xCC42 0xCC44 0x85FC +0xCC45 0xCC49 0x8600 +0xCC4A 0xCC54 0x8606 +0xCC55 0xCC58 0x8612 +0xCC59 0xCC68 0x8617 +0xCC69 0x8628 +0xCC6A 0xCC77 0x862A +0xCC78 0xCC7A 0x8639 +0xCC7B 0xCC7E 0x863D +0xCC80 0xCC8B 0x8641 +0xCC8C 0xCC8D 0x8652 +0xCC8E 0xCC92 0x8655 +0xCC93 0xCC95 0x865B +0xCC96 0xCC98 0x865F +0xCC99 0xCCA0 0x8663 +0xCCA1 0x736D +0xCCA2 0x631E +0xCCA3 0x8E4B +0xCCA4 0x8E0F +0xCCA5 0x80CE +0xCCA6 0x82D4 +0xCCA7 0x62AC +0xCCA8 0x53F0 +0xCCA9 0x6CF0 +0xCCAA 0x915E +0xCCAB 0x592A +0xCCAC 0x6001 +0xCCAD 0x6C70 +0xCCAE 0x574D +0xCCAF 0x644A +0xCCB0 0x8D2A +0xCCB1 0x762B +0xCCB2 0x6EE9 +0xCCB3 0x575B +0xCCB4 0x6A80 +0xCCB5 0x75F0 +0xCCB6 0x6F6D +0xCCB7 0x8C2D +0xCCB8 0x8C08 +0xCCB9 0x5766 +0xCCBA 0x6BEF +0xCCBB 0x8892 +0xCCBC 0x78B3 +0xCCBD 0x63A2 +0xCCBE 0x53F9 +0xCCBF 0x70AD +0xCCC0 0x6C64 +0xCCC1 0x5858 +0xCCC2 0x642A +0xCCC3 0x5802 +0xCCC4 0x68E0 +0xCCC5 0x819B +0xCCC6 0x5510 +0xCCC7 0x7CD6 +0xCCC8 0x5018 +0xCCC9 0x8EBA +0xCCCA 0x6DCC +0xCCCB 0x8D9F +0xCCCC 0x70EB +0xCCCD 0x638F +0xCCCE 0x6D9B +0xCCCF 0x6ED4 +0xCCD0 0x7EE6 +0xCCD1 0x8404 +0xCCD2 0x6843 +0xCCD3 0x9003 +0xCCD4 0x6DD8 +0xCCD5 0x9676 +0xCCD6 0x8BA8 +0xCCD7 0x5957 +0xCCD8 0x7279 +0xCCD9 0x85E4 +0xCCDA 0x817E +0xCCDB 0x75BC +0xCCDC 0x8A8A +0xCCDD 0x68AF +0xCCDE 0x5254 +0xCCDF 0x8E22 +0xCCE0 0x9511 +0xCCE1 0x63D0 +0xCCE2 0x9898 +0xCCE3 0x8E44 +0xCCE4 0x557C +0xCCE5 0x4F53 +0xCCE6 0x66FF +0xCCE7 0x568F +0xCCE8 0x60D5 +0xCCE9 0x6D95 +0xCCEA 0x5243 +0xCCEB 0x5C49 +0xCCEC 0x5929 +0xCCED 0x6DFB +0xCCEE 0x586B +0xCCEF 0x7530 +0xCCF0 0x751C +0xCCF1 0x606C +0xCCF2 0x8214 +0xCCF3 0x8146 +0xCCF4 0x6311 +0xCCF5 0x6761 +0xCCF6 0x8FE2 +0xCCF7 0x773A +0xCCF8 0x8DF3 +0xCCF9 0x8D34 +0xCCFA 0x94C1 +0xCCFB 0x5E16 +0xCCFC 0x5385 +0xCCFD 0x542C +0xCCFE 0x70C3 +0xCD40 0x866D +0xCD41 0xCD42 0x866F +0xCD43 0xCD49 0x8672 +0xCD4A 0xCD50 0x8683 +0xCD51 0xCD55 0x868E +0xCD56 0x8694 +0xCD57 0xCD5C 0x8696 +0xCD5D 0xCD61 0x869E +0xCD62 0xCD63 0x86A5 +0xCD64 0x86AB +0xCD65 0xCD66 0x86AD +0xCD67 0xCD68 0x86B2 +0xCD69 0xCD6B 0x86B7 +0xCD6C 0xCD70 0x86BB +0xCD71 0xCD73 0x86C1 +0xCD74 0x86C5 +0xCD75 0x86C8 +0xCD76 0xCD77 0x86CC +0xCD78 0xCD79 0x86D2 +0xCD7A 0xCD7C 0x86D5 +0xCD7D 0x86DA +0xCD7E 0x86DC +0xCD80 0x86DD +0xCD81 0xCD84 0x86E0 +0xCD85 0xCD88 0x86E5 +0xCD89 0xCD8B 0x86EA +0xCD8C 0x86EF +0xCD8D 0xCD8F 0x86F5 +0xCD90 0xCD93 0x86FA +0xCD94 0x86FF +0xCD95 0x8701 +0xCD96 0xCD98 0x8704 +0xCD99 0xCD9A 0x870B +0xCD9B 0xCD9E 0x870E +0xCD9F 0x8714 +0xCDA0 0x8716 +0xCDA1 0x6C40 +0xCDA2 0x5EF7 +0xCDA3 0x505C +0xCDA4 0x4EAD +0xCDA5 0x5EAD +0xCDA6 0x633A +0xCDA7 0x8247 +0xCDA8 0x901A +0xCDA9 0x6850 +0xCDAA 0x916E +0xCDAB 0x77B3 +0xCDAC 0x540C +0xCDAD 0x94DC +0xCDAE 0x5F64 +0xCDAF 0x7AE5 +0xCDB0 0x6876 +0xCDB1 0x6345 +0xCDB2 0x7B52 +0xCDB3 0x7EDF +0xCDB4 0x75DB +0xCDB5 0x5077 +0xCDB6 0x6295 +0xCDB7 0x5934 +0xCDB8 0x900F +0xCDB9 0x51F8 +0xCDBA 0x79C3 +0xCDBB 0x7A81 +0xCDBC 0x56FE +0xCDBD 0x5F92 +0xCDBE 0x9014 +0xCDBF 0x6D82 +0xCDC0 0x5C60 +0xCDC1 0x571F +0xCDC2 0x5410 +0xCDC3 0x5154 +0xCDC4 0x6E4D +0xCDC5 0x56E2 +0xCDC6 0x63A8 +0xCDC7 0x9893 +0xCDC8 0x817F +0xCDC9 0x8715 +0xCDCA 0x892A +0xCDCB 0x9000 +0xCDCC 0x541E +0xCDCD 0x5C6F +0xCDCE 0x81C0 +0xCDCF 0x62D6 +0xCDD0 0x6258 +0xCDD1 0x8131 +0xCDD2 0x9E35 +0xCDD3 0x9640 +0xCDD4 0x9A6E +0xCDD5 0x9A7C +0xCDD6 0x692D +0xCDD7 0x59A5 +0xCDD8 0x62D3 +0xCDD9 0x553E +0xCDDA 0x6316 +0xCDDB 0x54C7 +0xCDDC 0x86D9 +0xCDDD 0x6D3C +0xCDDE 0x5A03 +0xCDDF 0x74E6 +0xCDE0 0x889C +0xCDE1 0x6B6A +0xCDE2 0x5916 +0xCDE3 0x8C4C +0xCDE4 0x5F2F +0xCDE5 0x6E7E +0xCDE6 0x73A9 +0xCDE7 0x987D +0xCDE8 0x4E38 +0xCDE9 0x70F7 +0xCDEA 0x5B8C +0xCDEB 0x7897 +0xCDEC 0x633D +0xCDED 0x665A +0xCDEE 0x7696 +0xCDEF 0x60CB +0xCDF0 0x5B9B +0xCDF1 0x5A49 +0xCDF2 0x4E07 +0xCDF3 0x8155 +0xCDF4 0x6C6A +0xCDF5 0x738B +0xCDF6 0x4EA1 +0xCDF7 0x6789 +0xCDF8 0x7F51 +0xCDF9 0x5F80 +0xCDFA 0x65FA +0xCDFB 0x671B +0xCDFC 0x5FD8 +0xCDFD 0x5984 +0xCDFE 0x5A01 +0xCE40 0x8719 +0xCE41 0x871B +0xCE42 0x871D +0xCE43 0xCE44 0x871F +0xCE45 0x8724 +0xCE46 0xCE48 0x8726 +0xCE49 0xCE4C 0x872A +0xCE4D 0xCE4E 0x872F +0xCE4F 0xCE50 0x8732 +0xCE51 0xCE52 0x8735 +0xCE53 0xCE55 0x8738 +0xCE56 0xCE57 0x873C +0xCE58 0xCE5E 0x8740 +0xCE5F 0xCE60 0x874A +0xCE61 0x874D +0xCE62 0xCE65 0x874F +0xCE66 0xCE68 0x8754 +0xCE69 0x8758 +0xCE6A 0xCE6F 0x875A +0xCE70 0xCE71 0x8761 +0xCE72 0xCE79 0x8766 +0xCE7A 0x876F +0xCE7B 0xCE7D 0x8771 +0xCE7E 0x8775 +0xCE80 0xCE83 0x8777 +0xCE84 0xCE86 0x877F +0xCE87 0x8784 +0xCE88 0xCE89 0x8786 +0xCE8A 0xCE8B 0x8789 +0xCE8C 0x878C +0xCE8D 0xCE91 0x878E +0xCE92 0xCE94 0x8794 +0xCE95 0xCE9B 0x8798 +0xCE9C 0xCEA0 0x87A0 +0xCEA1 0x5DCD +0xCEA2 0x5FAE +0xCEA3 0x5371 +0xCEA4 0x97E6 +0xCEA5 0x8FDD +0xCEA6 0x6845 +0xCEA7 0x56F4 +0xCEA8 0x552F +0xCEA9 0x60DF +0xCEAA 0x4E3A +0xCEAB 0x6F4D +0xCEAC 0x7EF4 +0xCEAD 0x82C7 +0xCEAE 0x840E +0xCEAF 0x59D4 +0xCEB0 0x4F1F +0xCEB1 0x4F2A +0xCEB2 0x5C3E +0xCEB3 0x7EAC +0xCEB4 0x672A +0xCEB5 0x851A +0xCEB6 0x5473 +0xCEB7 0x754F +0xCEB8 0x80C3 +0xCEB9 0x5582 +0xCEBA 0x9B4F +0xCEBB 0x4F4D +0xCEBC 0x6E2D +0xCEBD 0x8C13 +0xCEBE 0x5C09 +0xCEBF 0x6170 +0xCEC0 0x536B +0xCEC1 0x761F +0xCEC2 0x6E29 +0xCEC3 0x868A +0xCEC4 0x6587 +0xCEC5 0x95FB +0xCEC6 0x7EB9 +0xCEC7 0x543B +0xCEC8 0x7A33 +0xCEC9 0x7D0A +0xCECA 0x95EE +0xCECB 0x55E1 +0xCECC 0x7FC1 +0xCECD 0x74EE +0xCECE 0x631D +0xCECF 0x8717 +0xCED0 0x6DA1 +0xCED1 0x7A9D +0xCED2 0x6211 +0xCED3 0x65A1 +0xCED4 0x5367 +0xCED5 0x63E1 +0xCED6 0x6C83 +0xCED7 0x5DEB +0xCED8 0x545C +0xCED9 0x94A8 +0xCEDA 0x4E4C +0xCEDB 0x6C61 +0xCEDC 0x8BEC +0xCEDD 0x5C4B +0xCEDE 0x65E0 +0xCEDF 0x829C +0xCEE0 0x68A7 +0xCEE1 0x543E +0xCEE2 0x5434 +0xCEE3 0x6BCB +0xCEE4 0x6B66 +0xCEE5 0x4E94 +0xCEE6 0x6342 +0xCEE7 0x5348 +0xCEE8 0x821E +0xCEE9 0x4F0D +0xCEEA 0x4FAE +0xCEEB 0x575E +0xCEEC 0x620A +0xCEED 0x96FE +0xCEEE 0x6664 +0xCEEF 0x7269 +0xCEF0 0x52FF +0xCEF1 0x52A1 +0xCEF2 0x609F +0xCEF3 0x8BEF +0xCEF4 0x6614 +0xCEF5 0x7199 +0xCEF6 0x6790 +0xCEF7 0x897F +0xCEF8 0x7852 +0xCEF9 0x77FD +0xCEFA 0x6670 +0xCEFB 0x563B +0xCEFC 0x5438 +0xCEFD 0x9521 +0xCEFE 0x727A +0xCF40 0xCF42 0x87A5 +0xCF43 0xCF44 0x87A9 +0xCF45 0x87AE +0xCF46 0xCF48 0x87B0 +0xCF49 0x87B4 +0xCF4A 0xCF4D 0x87B6 +0xCF4E 0xCF4F 0x87BB +0xCF50 0xCF51 0x87BE +0xCF52 0xCF56 0x87C1 +0xCF57 0xCF59 0x87C7 +0xCF5A 0xCF5E 0x87CC +0xCF5F 0xCF65 0x87D4 +0xCF66 0xCF69 0x87DC +0xCF6A 0xCF6D 0x87E1 +0xCF6E 0xCF71 0x87E6 +0xCF72 0xCF74 0x87EB +0xCF75 0xCF7E 0x87EF +0xCF80 0xCF83 0x87FA +0xCF84 0xCF87 0x87FF +0xCF88 0xCF8D 0x8804 +0xCF8E 0xCF95 0x880B +0xCF96 0x8814 +0xCF97 0xCF9A 0x8817 +0xCF9B 0xCF9F 0x881C +0xCFA0 0x8823 +0xCFA1 0x7A00 +0xCFA2 0x606F +0xCFA3 0x5E0C +0xCFA4 0x6089 +0xCFA5 0x819D +0xCFA6 0x5915 +0xCFA7 0x60DC +0xCFA8 0x7184 +0xCFA9 0x70EF +0xCFAA 0x6EAA +0xCFAB 0x6C50 +0xCFAC 0x7280 +0xCFAD 0x6A84 +0xCFAE 0x88AD +0xCFAF 0x5E2D +0xCFB0 0x4E60 +0xCFB1 0x5AB3 +0xCFB2 0x559C +0xCFB3 0x94E3 +0xCFB4 0x6D17 +0xCFB5 0x7CFB +0xCFB6 0x9699 +0xCFB7 0x620F +0xCFB8 0x7EC6 +0xCFB9 0x778E +0xCFBA 0x867E +0xCFBB 0x5323 +0xCFBC 0x971E +0xCFBD 0x8F96 +0xCFBE 0x6687 +0xCFBF 0x5CE1 +0xCFC0 0x4FA0 +0xCFC1 0x72ED +0xCFC2 0x4E0B +0xCFC3 0x53A6 +0xCFC4 0x590F +0xCFC5 0x5413 +0xCFC6 0x6380 +0xCFC7 0x9528 +0xCFC8 0x5148 +0xCFC9 0x4ED9 +0xCFCA 0x9C9C +0xCFCB 0x7EA4 +0xCFCC 0x54B8 +0xCFCD 0x8D24 +0xCFCE 0x8854 +0xCFCF 0x8237 +0xCFD0 0x95F2 +0xCFD1 0x6D8E +0xCFD2 0x5F26 +0xCFD3 0x5ACC +0xCFD4 0x663E +0xCFD5 0x9669 +0xCFD6 0x73B0 +0xCFD7 0x732E +0xCFD8 0x53BF +0xCFD9 0x817A +0xCFDA 0x9985 +0xCFDB 0x7FA1 +0xCFDC 0x5BAA +0xCFDD 0x9677 +0xCFDE 0x9650 +0xCFDF 0x7EBF +0xCFE0 0x76F8 +0xCFE1 0x53A2 +0xCFE2 0x9576 +0xCFE3 0x9999 +0xCFE4 0x7BB1 +0xCFE5 0x8944 +0xCFE6 0x6E58 +0xCFE7 0x4E61 +0xCFE8 0x7FD4 +0xCFE9 0x7965 +0xCFEA 0x8BE6 +0xCFEB 0x60F3 +0xCFEC 0x54CD +0xCFED 0x4EAB +0xCFEE 0x9879 +0xCFEF 0x5DF7 +0xCFF0 0x6A61 +0xCFF1 0x50CF +0xCFF2 0x5411 +0xCFF3 0x8C61 +0xCFF4 0x8427 +0xCFF5 0x785D +0xCFF6 0x9704 +0xCFF7 0x524A +0xCFF8 0x54EE +0xCFF9 0x56A3 +0xCFFA 0x9500 +0xCFFB 0x6D88 +0xCFFC 0x5BB5 +0xCFFD 0x6DC6 +0xCFFE 0x6653 +0xD040 0xD04D 0x8824 +0xD04E 0xD053 0x8833 +0xD054 0xD055 0x883A +0xD056 0xD058 0x883D +0xD059 0xD05B 0x8841 +0xD05C 0xD061 0x8846 +0xD062 0xD067 0x884E +0xD068 0xD069 0x8855 +0xD06A 0x8858 +0xD06B 0xD071 0x885A +0xD072 0xD073 0x8866 +0xD074 0x886A +0xD075 0x886D +0xD076 0x886F +0xD077 0x8871 +0xD078 0xD07B 0x8873 +0xD07C 0xD07E 0x8878 +0xD080 0xD081 0x887B +0xD082 0x8880 +0xD083 0x8883 +0xD084 0xD085 0x8886 +0xD086 0xD087 0x8889 +0xD088 0x888C +0xD089 0xD08C 0x888E +0xD08D 0xD08F 0x8893 +0xD090 0xD094 0x8897 +0xD095 0xD099 0x889D +0xD09A 0x88A3 +0xD09B 0xD0A0 0x88A5 +0xD0A1 0x5C0F +0xD0A2 0x5B5D +0xD0A3 0x6821 +0xD0A4 0x8096 +0xD0A5 0x5578 +0xD0A6 0x7B11 +0xD0A7 0x6548 +0xD0A8 0x6954 +0xD0A9 0x4E9B +0xD0AA 0x6B47 +0xD0AB 0x874E +0xD0AC 0x978B +0xD0AD 0x534F +0xD0AE 0x631F +0xD0AF 0x643A +0xD0B0 0x90AA +0xD0B1 0x659C +0xD0B2 0x80C1 +0xD0B3 0x8C10 +0xD0B4 0x5199 +0xD0B5 0x68B0 +0xD0B6 0x5378 +0xD0B7 0x87F9 +0xD0B8 0x61C8 +0xD0B9 0x6CC4 +0xD0BA 0x6CFB +0xD0BB 0x8C22 +0xD0BC 0x5C51 +0xD0BD 0x85AA +0xD0BE 0x82AF +0xD0BF 0x950C +0xD0C0 0x6B23 +0xD0C1 0x8F9B +0xD0C2 0x65B0 +0xD0C3 0x5FFB +0xD0C4 0x5FC3 +0xD0C5 0x4FE1 +0xD0C6 0x8845 +0xD0C7 0x661F +0xD0C8 0x8165 +0xD0C9 0x7329 +0xD0CA 0x60FA +0xD0CB 0x5174 +0xD0CC 0x5211 +0xD0CD 0x578B +0xD0CE 0x5F62 +0xD0CF 0x90A2 +0xD0D0 0x884C +0xD0D1 0x9192 +0xD0D2 0x5E78 +0xD0D3 0x674F +0xD0D4 0x6027 +0xD0D5 0x59D3 +0xD0D6 0x5144 +0xD0D7 0x51F6 +0xD0D8 0x80F8 +0xD0D9 0x5308 +0xD0DA 0x6C79 +0xD0DB 0x96C4 +0xD0DC 0x718A +0xD0DD 0x4F11 +0xD0DE 0x4FEE +0xD0DF 0x7F9E +0xD0E0 0x673D +0xD0E1 0x55C5 +0xD0E2 0x9508 +0xD0E3 0x79C0 +0xD0E4 0x8896 +0xD0E5 0x7EE3 +0xD0E6 0x589F +0xD0E7 0x620C +0xD0E8 0x9700 +0xD0E9 0x865A +0xD0EA 0x5618 +0xD0EB 0x987B +0xD0EC 0x5F90 +0xD0ED 0x8BB8 +0xD0EE 0x84C4 +0xD0EF 0x9157 +0xD0F0 0x53D9 +0xD0F1 0x65ED +0xD0F2 0x5E8F +0xD0F3 0x755C +0xD0F4 0x6064 +0xD0F5 0x7D6E +0xD0F6 0x5A7F +0xD0F7 0x7EEA +0xD0F8 0x7EED +0xD0F9 0x8F69 +0xD0FA 0x55A7 +0xD0FB 0x5BA3 +0xD0FC 0x60AC +0xD0FD 0x65CB +0xD0FE 0x7384 +0xD140 0x88AC +0xD141 0xD143 0x88AE +0xD144 0xD148 0x88B2 +0xD149 0xD14C 0x88B8 +0xD14D 0xD150 0x88BD +0xD151 0xD152 0x88C3 +0xD153 0xD154 0x88C7 +0xD155 0xD158 0x88CA +0xD159 0xD15B 0x88CF +0xD15C 0x88D3 +0xD15D 0xD15E 0x88D6 +0xD15F 0xD163 0x88DA +0xD164 0xD165 0x88E0 +0xD166 0xD167 0x88E6 +0xD168 0xD16E 0x88E9 +0xD16F 0x88F2 +0xD170 0xD172 0x88F5 +0xD173 0xD174 0x88FA +0xD175 0x88FD +0xD176 0xD178 0x88FF +0xD179 0xD17E 0x8903 +0xD180 0x8909 +0xD181 0xD185 0x890B +0xD186 0x8911 +0xD187 0xD18B 0x8914 +0xD18C 0xD190 0x891C +0xD191 0xD193 0x8922 +0xD194 0xD197 0x8926 +0xD198 0xD19B 0x892C +0xD19C 0xD19E 0x8931 +0xD19F 0x8935 +0xD1A0 0x8937 +0xD1A1 0x9009 +0xD1A2 0x7663 +0xD1A3 0x7729 +0xD1A4 0x7EDA +0xD1A5 0x9774 +0xD1A6 0x859B +0xD1A7 0x5B66 +0xD1A8 0x7A74 +0xD1A9 0x96EA +0xD1AA 0x8840 +0xD1AB 0x52CB +0xD1AC 0x718F +0xD1AD 0x5FAA +0xD1AE 0x65EC +0xD1AF 0x8BE2 +0xD1B0 0x5BFB +0xD1B1 0x9A6F +0xD1B2 0x5DE1 +0xD1B3 0x6B89 +0xD1B4 0x6C5B +0xD1B5 0x8BAD +0xD1B6 0x8BAF +0xD1B7 0x900A +0xD1B8 0x8FC5 +0xD1B9 0x538B +0xD1BA 0x62BC +0xD1BB 0x9E26 +0xD1BC 0x9E2D +0xD1BD 0x5440 +0xD1BE 0x4E2B +0xD1BF 0x82BD +0xD1C0 0x7259 +0xD1C1 0x869C +0xD1C2 0x5D16 +0xD1C3 0x8859 +0xD1C4 0x6DAF +0xD1C5 0x96C5 +0xD1C6 0x54D1 +0xD1C7 0x4E9A +0xD1C8 0x8BB6 +0xD1C9 0x7109 +0xD1CA 0x54BD +0xD1CB 0x9609 +0xD1CC 0x70DF +0xD1CD 0x6DF9 +0xD1CE 0x76D0 +0xD1CF 0x4E25 +0xD1D0 0x7814 +0xD1D1 0x8712 +0xD1D2 0x5CA9 +0xD1D3 0x5EF6 +0xD1D4 0x8A00 +0xD1D5 0x989C +0xD1D6 0x960E +0xD1D7 0x708E +0xD1D8 0x6CBF +0xD1D9 0x5944 +0xD1DA 0x63A9 +0xD1DB 0x773C +0xD1DC 0x884D +0xD1DD 0x6F14 +0xD1DE 0x8273 +0xD1DF 0x5830 +0xD1E0 0x71D5 +0xD1E1 0x538C +0xD1E2 0x781A +0xD1E3 0x96C1 +0xD1E4 0x5501 +0xD1E5 0x5F66 +0xD1E6 0x7130 +0xD1E7 0x5BB4 +0xD1E8 0x8C1A +0xD1E9 0x9A8C +0xD1EA 0x6B83 +0xD1EB 0x592E +0xD1EC 0x9E2F +0xD1ED 0x79E7 +0xD1EE 0x6768 +0xD1EF 0x626C +0xD1F0 0x4F6F +0xD1F1 0x75A1 +0xD1F2 0x7F8A +0xD1F3 0x6D0B +0xD1F4 0x9633 +0xD1F5 0x6C27 +0xD1F6 0x4EF0 +0xD1F7 0x75D2 +0xD1F8 0x517B +0xD1F9 0x6837 +0xD1FA 0x6F3E +0xD1FB 0x9080 +0xD1FC 0x8170 +0xD1FD 0x5996 +0xD1FE 0x7476 +0xD240 0xD248 0x8938 +0xD249 0xD24A 0x8942 +0xD24B 0xD263 0x8945 +0xD264 0xD269 0x8960 +0xD26A 0xD27D 0x8967 +0xD27E 0x897C +0xD280 0xD281 0x897D +0xD282 0x8980 +0xD283 0x8982 +0xD284 0xD285 0x8984 +0xD286 0xD2A0 0x8987 +0xD2A1 0x6447 +0xD2A2 0x5C27 +0xD2A3 0x9065 +0xD2A4 0x7A91 +0xD2A5 0x8C23 +0xD2A6 0x59DA +0xD2A7 0x54AC +0xD2A8 0x8200 +0xD2A9 0x836F +0xD2AA 0x8981 +0xD2AB 0x8000 +0xD2AC 0x6930 +0xD2AD 0x564E +0xD2AE 0x8036 +0xD2AF 0x7237 +0xD2B0 0x91CE +0xD2B1 0x51B6 +0xD2B2 0x4E5F +0xD2B3 0x9875 +0xD2B4 0x6396 +0xD2B5 0x4E1A +0xD2B6 0x53F6 +0xD2B7 0x66F3 +0xD2B8 0x814B +0xD2B9 0x591C +0xD2BA 0x6DB2 +0xD2BB 0x4E00 +0xD2BC 0x58F9 +0xD2BD 0x533B +0xD2BE 0x63D6 +0xD2BF 0x94F1 +0xD2C0 0x4F9D +0xD2C1 0x4F0A +0xD2C2 0x8863 +0xD2C3 0x9890 +0xD2C4 0x5937 +0xD2C5 0x9057 +0xD2C6 0x79FB +0xD2C7 0x4EEA +0xD2C8 0x80F0 +0xD2C9 0x7591 +0xD2CA 0x6C82 +0xD2CB 0x5B9C +0xD2CC 0x59E8 +0xD2CD 0x5F5D +0xD2CE 0x6905 +0xD2CF 0x8681 +0xD2D0 0x501A +0xD2D1 0x5DF2 +0xD2D2 0x4E59 +0xD2D3 0x77E3 +0xD2D4 0x4EE5 +0xD2D5 0x827A +0xD2D6 0x6291 +0xD2D7 0x6613 +0xD2D8 0x9091 +0xD2D9 0x5C79 +0xD2DA 0x4EBF +0xD2DB 0x5F79 +0xD2DC 0x81C6 +0xD2DD 0x9038 +0xD2DE 0x8084 +0xD2DF 0x75AB +0xD2E0 0x4EA6 +0xD2E1 0x88D4 +0xD2E2 0x610F +0xD2E3 0x6BC5 +0xD2E4 0x5FC6 +0xD2E5 0x4E49 +0xD2E6 0x76CA +0xD2E7 0x6EA2 +0xD2E8 0x8BE3 +0xD2E9 0x8BAE +0xD2EA 0x8C0A +0xD2EB 0x8BD1 +0xD2EC 0x5F02 +0xD2ED 0x7FFC +0xD2EE 0x7FCC +0xD2EF 0x7ECE +0xD2F0 0x8335 +0xD2F1 0x836B +0xD2F2 0x56E0 +0xD2F3 0x6BB7 +0xD2F4 0x97F3 +0xD2F5 0x9634 +0xD2F6 0x59FB +0xD2F7 0x541F +0xD2F8 0x94F6 +0xD2F9 0x6DEB +0xD2FA 0x5BC5 +0xD2FB 0x996E +0xD2FC 0x5C39 +0xD2FD 0x5F15 +0xD2FE 0x9690 +0xD340 0xD35E 0x89A2 +0xD35F 0x89C3 +0xD360 0x89CD +0xD361 0xD363 0x89D3 +0xD364 0xD366 0x89D7 +0xD367 0x89DB +0xD368 0x89DD +0xD369 0xD36C 0x89DF +0xD36D 0x89E4 +0xD36E 0xD371 0x89E7 +0xD372 0xD374 0x89EC +0xD375 0xD377 0x89F0 +0xD378 0xD37E 0x89F4 +0xD380 0xD384 0x89FB +0xD385 0xD38A 0x8A01 +0xD38B 0xD3A0 0x8A08 +0xD3A1 0x5370 +0xD3A2 0x82F1 +0xD3A3 0x6A31 +0xD3A4 0x5A74 +0xD3A5 0x9E70 +0xD3A6 0x5E94 +0xD3A7 0x7F28 +0xD3A8 0x83B9 +0xD3A9 0xD3AA 0x8424 +0xD3AB 0x8367 +0xD3AC 0x8747 +0xD3AD 0x8FCE +0xD3AE 0x8D62 +0xD3AF 0x76C8 +0xD3B0 0x5F71 +0xD3B1 0x9896 +0xD3B2 0x786C +0xD3B3 0x6620 +0xD3B4 0x54DF +0xD3B5 0x62E5 +0xD3B6 0x4F63 +0xD3B7 0x81C3 +0xD3B8 0x75C8 +0xD3B9 0x5EB8 +0xD3BA 0x96CD +0xD3BB 0x8E0A +0xD3BC 0x86F9 +0xD3BD 0x548F +0xD3BE 0x6CF3 +0xD3BF 0x6D8C +0xD3C0 0x6C38 +0xD3C1 0x607F +0xD3C2 0x52C7 +0xD3C3 0x7528 +0xD3C4 0x5E7D +0xD3C5 0x4F18 +0xD3C6 0x60A0 +0xD3C7 0x5FE7 +0xD3C8 0x5C24 +0xD3C9 0x7531 +0xD3CA 0x90AE +0xD3CB 0x94C0 +0xD3CC 0x72B9 +0xD3CD 0x6CB9 +0xD3CE 0x6E38 +0xD3CF 0x9149 +0xD3D0 0x6709 +0xD3D1 0x53CB +0xD3D2 0x53F3 +0xD3D3 0x4F51 +0xD3D4 0x91C9 +0xD3D5 0x8BF1 +0xD3D6 0x53C8 +0xD3D7 0x5E7C +0xD3D8 0x8FC2 +0xD3D9 0x6DE4 +0xD3DA 0x4E8E +0xD3DB 0x76C2 +0xD3DC 0x6986 +0xD3DD 0x865E +0xD3DE 0x611A +0xD3DF 0x8206 +0xD3E0 0x4F59 +0xD3E1 0x4FDE +0xD3E2 0x903E +0xD3E3 0x9C7C +0xD3E4 0x6109 +0xD3E5 0x6E1D +0xD3E6 0x6E14 +0xD3E7 0x9685 +0xD3E8 0x4E88 +0xD3E9 0x5A31 +0xD3EA 0x96E8 +0xD3EB 0x4E0E +0xD3EC 0x5C7F +0xD3ED 0x79B9 +0xD3EE 0x5B87 +0xD3EF 0x8BED +0xD3F0 0x7FBD +0xD3F1 0x7389 +0xD3F2 0x57DF +0xD3F3 0x828B +0xD3F4 0x90C1 +0xD3F5 0x5401 +0xD3F6 0x9047 +0xD3F7 0x55BB +0xD3F8 0x5CEA +0xD3F9 0x5FA1 +0xD3FA 0x6108 +0xD3FB 0x6B32 +0xD3FC 0x72F1 +0xD3FD 0x80B2 +0xD3FE 0x8A89 +0xD440 0xD45F 0x8A1E +0xD460 0xD468 0x8A3F +0xD469 0xD47E 0x8A49 +0xD480 0xD499 0x8A5F +0xD49A 0xD4A0 0x8A7A +0xD4A1 0x6D74 +0xD4A2 0x5BD3 +0xD4A3 0x88D5 +0xD4A4 0x9884 +0xD4A5 0x8C6B +0xD4A6 0x9A6D +0xD4A7 0x9E33 +0xD4A8 0x6E0A +0xD4A9 0x51A4 +0xD4AA 0x5143 +0xD4AB 0x57A3 +0xD4AC 0x8881 +0xD4AD 0x539F +0xD4AE 0x63F4 +0xD4AF 0x8F95 +0xD4B0 0x56ED +0xD4B1 0x5458 +0xD4B2 0x5706 +0xD4B3 0x733F +0xD4B4 0x6E90 +0xD4B5 0x7F18 +0xD4B6 0x8FDC +0xD4B7 0x82D1 +0xD4B8 0x613F +0xD4B9 0x6028 +0xD4BA 0x9662 +0xD4BB 0x66F0 +0xD4BC 0x7EA6 +0xD4BD 0x8D8A +0xD4BE 0x8DC3 +0xD4BF 0x94A5 +0xD4C0 0x5CB3 +0xD4C1 0x7CA4 +0xD4C2 0x6708 +0xD4C3 0x60A6 +0xD4C4 0x9605 +0xD4C5 0x8018 +0xD4C6 0x4E91 +0xD4C7 0x90E7 +0xD4C8 0x5300 +0xD4C9 0x9668 +0xD4CA 0x5141 +0xD4CB 0x8FD0 +0xD4CC 0x8574 +0xD4CD 0x915D +0xD4CE 0x6655 +0xD4CF 0x97F5 +0xD4D0 0x5B55 +0xD4D1 0x531D +0xD4D2 0x7838 +0xD4D3 0x6742 +0xD4D4 0x683D +0xD4D5 0x54C9 +0xD4D6 0x707E +0xD4D7 0x5BB0 +0xD4D8 0x8F7D +0xD4D9 0x518D +0xD4DA 0x5728 +0xD4DB 0x54B1 +0xD4DC 0x6512 +0xD4DD 0x6682 +0xD4DE 0x8D5E +0xD4DF 0x8D43 +0xD4E0 0x810F +0xD4E1 0x846C +0xD4E2 0x906D +0xD4E3 0x7CDF +0xD4E4 0x51FF +0xD4E5 0x85FB +0xD4E6 0x67A3 +0xD4E7 0x65E9 +0xD4E8 0x6FA1 +0xD4E9 0x86A4 +0xD4EA 0x8E81 +0xD4EB 0x566A +0xD4EC 0x9020 +0xD4ED 0x7682 +0xD4EE 0x7076 +0xD4EF 0x71E5 +0xD4F0 0x8D23 +0xD4F1 0x62E9 +0xD4F2 0x5219 +0xD4F3 0x6CFD +0xD4F4 0x8D3C +0xD4F5 0x600E +0xD4F6 0x589E +0xD4F7 0x618E +0xD4F8 0x66FE +0xD4F9 0x8D60 +0xD4FA 0x624E +0xD4FB 0x55B3 +0xD4FC 0x6E23 +0xD4FD 0x672D +0xD4FE 0x8F67 +0xD540 0xD547 0x8A81 +0xD548 0xD54F 0x8A8B +0xD550 0xD57E 0x8A94 +0xD580 0xD5A0 0x8AC3 +0xD5A1 0x94E1 +0xD5A2 0x95F8 +0xD5A3 0x7728 +0xD5A4 0x6805 +0xD5A5 0x69A8 +0xD5A6 0x548B +0xD5A7 0x4E4D +0xD5A8 0x70B8 +0xD5A9 0x8BC8 +0xD5AA 0x6458 +0xD5AB 0x658B +0xD5AC 0x5B85 +0xD5AD 0x7A84 +0xD5AE 0x503A +0xD5AF 0x5BE8 +0xD5B0 0x77BB +0xD5B1 0x6BE1 +0xD5B2 0x8A79 +0xD5B3 0x7C98 +0xD5B4 0x6CBE +0xD5B5 0x76CF +0xD5B6 0x65A9 +0xD5B7 0x8F97 +0xD5B8 0x5D2D +0xD5B9 0x5C55 +0xD5BA 0x8638 +0xD5BB 0x6808 +0xD5BC 0x5360 +0xD5BD 0x6218 +0xD5BE 0x7AD9 +0xD5BF 0x6E5B +0xD5C0 0x7EFD +0xD5C1 0x6A1F +0xD5C2 0x7AE0 +0xD5C3 0x5F70 +0xD5C4 0x6F33 +0xD5C5 0x5F20 +0xD5C6 0x638C +0xD5C7 0x6DA8 +0xD5C8 0x6756 +0xD5C9 0x4E08 +0xD5CA 0x5E10 +0xD5CB 0x8D26 +0xD5CC 0x4ED7 +0xD5CD 0x80C0 +0xD5CE 0x7634 +0xD5CF 0x969C +0xD5D0 0x62DB +0xD5D1 0x662D +0xD5D2 0x627E +0xD5D3 0x6CBC +0xD5D4 0x8D75 +0xD5D5 0x7167 +0xD5D6 0x7F69 +0xD5D7 0x5146 +0xD5D8 0x8087 +0xD5D9 0x53EC +0xD5DA 0x906E +0xD5DB 0x6298 +0xD5DC 0x54F2 +0xD5DD 0x86F0 +0xD5DE 0x8F99 +0xD5DF 0x8005 +0xD5E0 0x9517 +0xD5E1 0x8517 +0xD5E2 0x8FD9 +0xD5E3 0x6D59 +0xD5E4 0x73CD +0xD5E5 0x659F +0xD5E6 0x771F +0xD5E7 0x7504 +0xD5E8 0x7827 +0xD5E9 0x81FB +0xD5EA 0x8D1E +0xD5EB 0x9488 +0xD5EC 0x4FA6 +0xD5ED 0x6795 +0xD5EE 0x75B9 +0xD5EF 0x8BCA +0xD5F0 0x9707 +0xD5F1 0x632F +0xD5F2 0x9547 +0xD5F3 0x9635 +0xD5F4 0x84B8 +0xD5F5 0x6323 +0xD5F6 0x7741 +0xD5F7 0x5F81 +0xD5F8 0x72F0 +0xD5F9 0x4E89 +0xD5FA 0x6014 +0xD5FB 0x6574 +0xD5FC 0x62EF +0xD5FD 0x6B63 +0xD5FE 0x653F +0xD640 0xD662 0x8AE4 +0xD663 0xD67E 0x8B08 +0xD680 0xD681 0x8B24 +0xD682 0xD6A0 0x8B27 +0xD6A1 0x5E27 +0xD6A2 0x75C7 +0xD6A3 0x90D1 +0xD6A4 0x8BC1 +0xD6A5 0x829D +0xD6A6 0x679D +0xD6A7 0x652F +0xD6A8 0x5431 +0xD6A9 0x8718 +0xD6AA 0x77E5 +0xD6AB 0x80A2 +0xD6AC 0x8102 +0xD6AD 0x6C41 +0xD6AE 0x4E4B +0xD6AF 0x7EC7 +0xD6B0 0x804C +0xD6B1 0x76F4 +0xD6B2 0x690D +0xD6B3 0x6B96 +0xD6B4 0x6267 +0xD6B5 0x503C +0xD6B6 0x4F84 +0xD6B7 0x5740 +0xD6B8 0x6307 +0xD6B9 0x6B62 +0xD6BA 0x8DBE +0xD6BB 0x53EA +0xD6BC 0x65E8 +0xD6BD 0x7EB8 +0xD6BE 0x5FD7 +0xD6BF 0x631A +0xD6C0 0x63B7 +0xD6C1 0xD6C2 0x81F3 +0xD6C3 0x7F6E +0xD6C4 0x5E1C +0xD6C5 0x5CD9 +0xD6C6 0x5236 +0xD6C7 0x667A +0xD6C8 0x79E9 +0xD6C9 0x7A1A +0xD6CA 0x8D28 +0xD6CB 0x7099 +0xD6CC 0x75D4 +0xD6CD 0x6EDE +0xD6CE 0x6CBB +0xD6CF 0x7A92 +0xD6D0 0x4E2D +0xD6D1 0x76C5 +0xD6D2 0x5FE0 +0xD6D3 0x949F +0xD6D4 0x8877 +0xD6D5 0x7EC8 +0xD6D6 0x79CD +0xD6D7 0x80BF +0xD6D8 0x91CD +0xD6D9 0x4EF2 +0xD6DA 0x4F17 +0xD6DB 0x821F +0xD6DC 0x5468 +0xD6DD 0x5DDE +0xD6DE 0x6D32 +0xD6DF 0x8BCC +0xD6E0 0x7CA5 +0xD6E1 0x8F74 +0xD6E2 0x8098 +0xD6E3 0x5E1A +0xD6E4 0x5492 +0xD6E5 0x76B1 +0xD6E6 0x5B99 +0xD6E7 0x663C +0xD6E8 0x9AA4 +0xD6E9 0x73E0 +0xD6EA 0x682A +0xD6EB 0x86DB +0xD6EC 0x6731 +0xD6ED 0x732A +0xD6EE 0x8BF8 +0xD6EF 0x8BDB +0xD6F0 0x9010 +0xD6F1 0x7AF9 +0xD6F2 0x70DB +0xD6F3 0x716E +0xD6F4 0x62C4 +0xD6F5 0x77A9 +0xD6F6 0x5631 +0xD6F7 0x4E3B +0xD6F8 0x8457 +0xD6F9 0x67F1 +0xD6FA 0x52A9 +0xD6FB 0x86C0 +0xD6FC 0x8D2E +0xD6FD 0x94F8 +0xD6FE 0x7B51 +0xD740 0xD75F 0x8B46 +0xD760 0xD764 0x8B67 +0xD765 0xD77E 0x8B6D +0xD780 0xD798 0x8B87 +0xD799 0x8BAC +0xD79A 0x8BB1 +0xD79B 0x8BBB +0xD79C 0x8BC7 +0xD79D 0x8BD0 +0xD79E 0x8BEA +0xD79F 0x8C09 +0xD7A0 0x8C1E +0xD7A1 0x4F4F +0xD7A2 0x6CE8 +0xD7A3 0x795D +0xD7A4 0x9A7B +0xD7A5 0x6293 +0xD7A6 0x722A +0xD7A7 0x62FD +0xD7A8 0x4E13 +0xD7A9 0x7816 +0xD7AA 0x8F6C +0xD7AB 0x64B0 +0xD7AC 0x8D5A +0xD7AD 0x7BC6 +0xD7AE 0x6869 +0xD7AF 0x5E84 +0xD7B0 0x88C5 +0xD7B1 0x5986 +0xD7B2 0x649E +0xD7B3 0x58EE +0xD7B4 0x72B6 +0xD7B5 0x690E +0xD7B6 0x9525 +0xD7B7 0x8FFD +0xD7B8 0x8D58 +0xD7B9 0x5760 +0xD7BA 0x7F00 +0xD7BB 0x8C06 +0xD7BC 0x51C6 +0xD7BD 0x6349 +0xD7BE 0x62D9 +0xD7BF 0x5353 +0xD7C0 0x684C +0xD7C1 0x7422 +0xD7C2 0x8301 +0xD7C3 0x914C +0xD7C4 0x5544 +0xD7C5 0x7740 +0xD7C6 0x707C +0xD7C7 0x6D4A +0xD7C8 0x5179 +0xD7C9 0x54A8 +0xD7CA 0x8D44 +0xD7CB 0x59FF +0xD7CC 0x6ECB +0xD7CD 0x6DC4 +0xD7CE 0x5B5C +0xD7CF 0x7D2B +0xD7D0 0x4ED4 +0xD7D1 0x7C7D +0xD7D2 0x6ED3 +0xD7D3 0x5B50 +0xD7D4 0x81EA +0xD7D5 0x6E0D +0xD7D6 0x5B57 +0xD7D7 0x9B03 +0xD7D8 0x68D5 +0xD7D9 0x8E2A +0xD7DA 0x5B97 +0xD7DB 0x7EFC +0xD7DC 0x603B +0xD7DD 0x7EB5 +0xD7DE 0x90B9 +0xD7DF 0x8D70 +0xD7E0 0x594F +0xD7E1 0x63CD +0xD7E2 0x79DF +0xD7E3 0x8DB3 +0xD7E4 0x5352 +0xD7E5 0x65CF +0xD7E6 0x7956 +0xD7E7 0x8BC5 +0xD7E8 0x963B +0xD7E9 0x7EC4 +0xD7EA 0x94BB +0xD7EB 0x7E82 +0xD7EC 0x5634 +0xD7ED 0x9189 +0xD7EE 0x6700 +0xD7EF 0x7F6A +0xD7F0 0x5C0A +0xD7F1 0x9075 +0xD7F2 0x6628 +0xD7F3 0x5DE6 +0xD7F4 0x4F50 +0xD7F5 0x67DE +0xD7F6 0x505A +0xD7F7 0x4F5C +0xD7F8 0x5750 +0xD7F9 0x5EA7 +0xD7FA 0xD7FE 0xE810 +0xD840 0xD848 0x8C38 +0xD849 0xD84C 0x8C42 +0xD84D 0x8C48 +0xD84E 0xD84F 0x8C4A +0xD850 0xD857 0x8C4D +0xD858 0xD85B 0x8C56 +0xD85C 0xD861 0x8C5B +0xD862 0xD868 0x8C63 +0xD869 0xD86F 0x8C6C +0xD870 0xD873 0x8C74 +0xD874 0xD87A 0x8C7B +0xD87B 0xD87C 0x8C83 +0xD87D 0xD87E 0x8C86 +0xD880 0x8C88 +0xD881 0x8C8B +0xD882 0xD888 0x8C8D +0xD889 0xD88B 0x8C95 +0xD88C 0xD8A0 0x8C99 +0xD8A1 0x4E8D +0xD8A2 0x4E0C +0xD8A3 0x5140 +0xD8A4 0x4E10 +0xD8A5 0x5EFF +0xD8A6 0x5345 +0xD8A7 0x4E15 +0xD8A8 0x4E98 +0xD8A9 0x4E1E +0xD8AA 0x9B32 +0xD8AB 0x5B6C +0xD8AC 0x5669 +0xD8AD 0x4E28 +0xD8AE 0x79BA +0xD8AF 0x4E3F +0xD8B0 0x5315 +0xD8B1 0x4E47 +0xD8B2 0x592D +0xD8B3 0x723B +0xD8B4 0x536E +0xD8B5 0x6C10 +0xD8B6 0x56DF +0xD8B7 0x80E4 +0xD8B8 0x9997 +0xD8B9 0x6BD3 +0xD8BA 0x777E +0xD8BB 0x9F17 +0xD8BC 0x4E36 +0xD8BD 0x4E9F +0xD8BE 0x9F10 +0xD8BF 0x4E5C +0xD8C0 0x4E69 +0xD8C1 0x4E93 +0xD8C2 0x8288 +0xD8C3 0x5B5B +0xD8C4 0x556C +0xD8C5 0x560F +0xD8C6 0x4EC4 +0xD8C7 0x538D +0xD8C8 0x539D +0xD8C9 0x53A3 +0xD8CA 0x53A5 +0xD8CB 0x53AE +0xD8CC 0x9765 +0xD8CD 0x8D5D +0xD8CE 0x531A +0xD8CF 0x53F5 +0xD8D0 0x5326 +0xD8D1 0x532E +0xD8D2 0x533E +0xD8D3 0x8D5C +0xD8D4 0x5366 +0xD8D5 0x5363 +0xD8D6 0x5202 +0xD8D7 0x5208 +0xD8D8 0x520E +0xD8D9 0x522D +0xD8DA 0x5233 +0xD8DB 0xD8DC 0x523F +0xD8DD 0x524C +0xD8DE 0x525E +0xD8DF 0x5261 +0xD8E0 0x525C +0xD8E1 0x84AF +0xD8E2 0x527D +0xD8E3 0x5282 +0xD8E4 0x5281 +0xD8E5 0x5290 +0xD8E6 0x5293 +0xD8E7 0x5182 +0xD8E8 0x7F54 +0xD8E9 0x4EBB +0xD8EA 0x4EC3 +0xD8EB 0x4EC9 +0xD8EC 0x4EC2 +0xD8ED 0x4EE8 +0xD8EE 0x4EE1 +0xD8EF 0x4EEB +0xD8F0 0x4EDE +0xD8F1 0x4F1B +0xD8F2 0x4EF3 +0xD8F3 0x4F22 +0xD8F4 0x4F64 +0xD8F5 0x4EF5 +0xD8F6 0x4F25 +0xD8F7 0x4F27 +0xD8F8 0x4F09 +0xD8F9 0x4F2B +0xD8FA 0x4F5E +0xD8FB 0x4F67 +0xD8FC 0x6538 +0xD8FD 0x4F5A +0xD8FE 0x4F5D +0xD940 0xD97E 0x8CAE +0xD980 0xD9A0 0x8CED +0xD9A1 0x4F5F +0xD9A2 0x4F57 +0xD9A3 0x4F32 +0xD9A4 0x4F3D +0xD9A5 0x4F76 +0xD9A6 0x4F74 +0xD9A7 0x4F91 +0xD9A8 0x4F89 +0xD9A9 0x4F83 +0xD9AA 0x4F8F +0xD9AB 0x4F7E +0xD9AC 0x4F7B +0xD9AD 0x4FAA +0xD9AE 0x4F7C +0xD9AF 0x4FAC +0xD9B0 0x4F94 +0xD9B1 0x4FE6 +0xD9B2 0x4FE8 +0xD9B3 0x4FEA +0xD9B4 0x4FC5 +0xD9B5 0x4FDA +0xD9B6 0x4FE3 +0xD9B7 0x4FDC +0xD9B8 0x4FD1 +0xD9B9 0x4FDF +0xD9BA 0x4FF8 +0xD9BB 0x5029 +0xD9BC 0x504C +0xD9BD 0x4FF3 +0xD9BE 0x502C +0xD9BF 0x500F +0xD9C0 0x502E +0xD9C1 0x502D +0xD9C2 0x4FFE +0xD9C3 0x501C +0xD9C4 0x500C +0xD9C5 0x5025 +0xD9C6 0x5028 +0xD9C7 0x507E +0xD9C8 0x5043 +0xD9C9 0x5055 +0xD9CA 0x5048 +0xD9CB 0x504E +0xD9CC 0x506C +0xD9CD 0x507B +0xD9CE 0x50A5 +0xD9CF 0x50A7 +0xD9D0 0x50A9 +0xD9D1 0x50BA +0xD9D2 0x50D6 +0xD9D3 0x5106 +0xD9D4 0x50ED +0xD9D5 0x50EC +0xD9D6 0x50E6 +0xD9D7 0x50EE +0xD9D8 0x5107 +0xD9D9 0x510B +0xD9DA 0x4EDD +0xD9DB 0x6C3D +0xD9DC 0x4F58 +0xD9DD 0x4F65 +0xD9DE 0x4FCE +0xD9DF 0x9FA0 +0xD9E0 0x6C46 +0xD9E1 0x7C74 +0xD9E2 0x516E +0xD9E3 0x5DFD +0xD9E4 0x9EC9 +0xD9E5 0x9998 +0xD9E6 0x5181 +0xD9E7 0x5914 +0xD9E8 0x52F9 +0xD9E9 0x530D +0xD9EA 0x8A07 +0xD9EB 0x5310 +0xD9EC 0x51EB +0xD9ED 0x5919 +0xD9EE 0x5155 +0xD9EF 0x4EA0 +0xD9F0 0x5156 +0xD9F1 0x4EB3 +0xD9F2 0x886E +0xD9F3 0x88A4 +0xD9F4 0x4EB5 +0xD9F5 0x8114 +0xD9F6 0x88D2 +0xD9F7 0x7980 +0xD9F8 0x5B34 +0xD9F9 0x8803 +0xD9FA 0x7FB8 +0xD9FB 0x51AB +0xD9FC 0x51B1 +0xD9FD 0x51BD +0xD9FE 0x51BC +0xDA40 0xDA4E 0x8D0E +0xDA4F 0x8D20 +0xDA50 0xDA51 0x8D51 +0xDA52 0x8D57 +0xDA53 0x8D5F +0xDA54 0x8D65 +0xDA55 0xDA57 0x8D68 +0xDA58 0x8D6C +0xDA59 0xDA5A 0x8D6E +0xDA5B 0xDA5C 0x8D71 +0xDA5D 0xDA65 0x8D78 +0xDA66 0xDA67 0x8D82 +0xDA68 0xDA6B 0x8D86 +0xDA6C 0xDA70 0x8D8C +0xDA71 0xDA72 0x8D92 +0xDA73 0xDA7C 0x8D95 +0xDA7D 0xDA7E 0x8DA0 +0xDA80 0x8DA2 +0xDA81 0xDA8D 0x8DA4 +0xDA8E 0x8DB2 +0xDA8F 0xDA90 0x8DB6 +0xDA91 0x8DB9 +0xDA92 0x8DBB +0xDA93 0x8DBD +0xDA94 0xDA96 0x8DC0 +0xDA97 0x8DC5 +0xDA98 0xDA9B 0x8DC7 +0xDA9C 0x8DCD +0xDA9D 0x8DD0 +0xDA9E 0xDAA0 0x8DD2 +0xDAA1 0x51C7 +0xDAA2 0x5196 +0xDAA3 0x51A2 +0xDAA4 0x51A5 +0xDAA5 0x8BA0 +0xDAA6 0xDAA7 0x8BA6 +0xDAA8 0x8BAA +0xDAA9 0xDAAA 0x8BB4 +0xDAAB 0x8BB7 +0xDAAC 0xDAAD 0x8BC2 +0xDAAE 0x8BCB +0xDAAF 0x8BCF +0xDAB0 0x8BCE +0xDAB1 0xDAB3 0x8BD2 +0xDAB4 0x8BD6 +0xDAB5 0xDAB6 0x8BD8 +0xDAB7 0x8BDC +0xDAB8 0xDAB9 0x8BDF +0xDABA 0x8BE4 +0xDABB 0xDABC 0x8BE8 +0xDABD 0x8BEE +0xDABE 0x8BF0 +0xDABF 0x8BF3 +0xDAC0 0x8BF6 +0xDAC1 0x8BF9 +0xDAC2 0x8BFC +0xDAC3 0xDAC4 0x8BFF +0xDAC5 0x8C02 +0xDAC6 0x8C04 +0xDAC7 0x8C07 +0xDAC8 0x8C0C +0xDAC9 0x8C0F +0xDACA 0xDACB 0x8C11 +0xDACC 0xDACE 0x8C14 +0xDACF 0x8C19 +0xDAD0 0x8C1B +0xDAD1 0x8C18 +0xDAD2 0x8C1D +0xDAD3 0xDAD5 0x8C1F +0xDAD6 0x8C25 +0xDAD7 0x8C27 +0xDAD8 0xDAD9 0x8C2A +0xDADA 0xDADB 0x8C2E +0xDADC 0xDADD 0x8C32 +0xDADE 0xDADF 0x8C35 +0xDAE0 0x5369 +0xDAE1 0x537A +0xDAE2 0x961D +0xDAE3 0x9622 +0xDAE4 0x9621 +0xDAE5 0x9631 +0xDAE6 0x962A +0xDAE7 0x963D +0xDAE8 0x963C +0xDAE9 0x9642 +0xDAEA 0x9649 +0xDAEB 0x9654 +0xDAEC 0x965F +0xDAED 0x9667 +0xDAEE 0x966C +0xDAEF 0x9672 +0xDAF0 0x9674 +0xDAF1 0x9688 +0xDAF2 0x968D +0xDAF3 0x9697 +0xDAF4 0x96B0 +0xDAF5 0x9097 +0xDAF6 0x909B +0xDAF7 0x909D +0xDAF8 0x9099 +0xDAF9 0x90AC +0xDAFA 0x90A1 +0xDAFB 0x90B4 +0xDAFC 0x90B3 +0xDAFD 0x90B6 +0xDAFE 0x90BA +0xDB40 0x8DD5 +0xDB41 0xDB42 0x8DD8 +0xDB43 0x8DDC +0xDB44 0xDB46 0x8DE0 +0xDB47 0xDB49 0x8DE5 +0xDB4A 0x8DE9 +0xDB4B 0xDB4C 0x8DED +0xDB4D 0xDB4F 0x8DF0 +0xDB50 0x8DF4 +0xDB51 0x8DF6 +0xDB52 0x8DFC +0xDB53 0xDB59 0x8DFE +0xDB5A 0xDB5C 0x8E06 +0xDB5D 0x8E0B +0xDB5E 0xDB5F 0x8E0D +0xDB60 0xDB63 0x8E10 +0xDB64 0xDB6B 0x8E15 +0xDB6C 0xDB6D 0x8E20 +0xDB6E 0xDB72 0x8E24 +0xDB73 0x8E2B +0xDB74 0x8E2D +0xDB75 0x8E30 +0xDB76 0xDB78 0x8E32 +0xDB79 0xDB7B 0x8E36 +0xDB7C 0xDB7D 0x8E3B +0xDB7E 0x8E3E +0xDB80 0x8E3F +0xDB81 0x8E43 +0xDB82 0xDB83 0x8E45 +0xDB84 0xDB88 0x8E4C +0xDB89 0xDB8E 0x8E53 +0xDB8F 0xDB9A 0x8E5A +0xDB9B 0xDB9C 0x8E67 +0xDB9D 0xDB9E 0x8E6A +0xDB9F 0x8E6E +0xDBA0 0x8E71 +0xDBA1 0x90B8 +0xDBA2 0x90B0 +0xDBA3 0x90CF +0xDBA4 0x90C5 +0xDBA5 0x90BE +0xDBA6 0x90D0 +0xDBA7 0x90C4 +0xDBA8 0x90C7 +0xDBA9 0x90D3 +0xDBAA 0x90E6 +0xDBAB 0x90E2 +0xDBAC 0x90DC +0xDBAD 0x90D7 +0xDBAE 0x90DB +0xDBAF 0x90EB +0xDBB0 0x90EF +0xDBB1 0x90FE +0xDBB2 0x9104 +0xDBB3 0x9122 +0xDBB4 0x911E +0xDBB5 0x9123 +0xDBB6 0x9131 +0xDBB7 0x912F +0xDBB8 0x9139 +0xDBB9 0x9143 +0xDBBA 0x9146 +0xDBBB 0x520D +0xDBBC 0x5942 +0xDBBD 0x52A2 +0xDBBE 0xDBBF 0x52AC +0xDBC0 0x52BE +0xDBC1 0x54FF +0xDBC2 0x52D0 +0xDBC3 0x52D6 +0xDBC4 0x52F0 +0xDBC5 0x53DF +0xDBC6 0x71EE +0xDBC7 0x77CD +0xDBC8 0x5EF4 +0xDBC9 0x51F5 +0xDBCA 0x51FC +0xDBCB 0x9B2F +0xDBCC 0x53B6 +0xDBCD 0x5F01 +0xDBCE 0x755A +0xDBCF 0x5DEF +0xDBD0 0x574C +0xDBD1 0x57A9 +0xDBD2 0x57A1 +0xDBD3 0x587E +0xDBD4 0x58BC +0xDBD5 0x58C5 +0xDBD6 0x58D1 +0xDBD7 0x5729 +0xDBD8 0x572C +0xDBD9 0x572A +0xDBDA 0x5733 +0xDBDB 0x5739 +0xDBDC 0xDBDD 0x572E +0xDBDE 0x575C +0xDBDF 0x573B +0xDBE0 0x5742 +0xDBE1 0x5769 +0xDBE2 0x5785 +0xDBE3 0x576B +0xDBE4 0x5786 +0xDBE5 0x577C +0xDBE6 0x577B +0xDBE7 0x5768 +0xDBE8 0x576D +0xDBE9 0x5776 +0xDBEA 0x5773 +0xDBEB 0x57AD +0xDBEC 0x57A4 +0xDBED 0x578C +0xDBEE 0x57B2 +0xDBEF 0x57CF +0xDBF0 0x57A7 +0xDBF1 0x57B4 +0xDBF2 0x5793 +0xDBF3 0x57A0 +0xDBF4 0x57D5 +0xDBF5 0x57D8 +0xDBF6 0x57DA +0xDBF7 0x57D9 +0xDBF8 0x57D2 +0xDBF9 0x57B8 +0xDBFA 0x57F4 +0xDBFB 0x57EF +0xDBFC 0x57F8 +0xDBFD 0x57E4 +0xDBFE 0x57DD +0xDC40 0x8E73 +0xDC41 0x8E75 +0xDC42 0xDC46 0x8E77 +0xDC47 0xDC48 0x8E7D +0xDC49 0x8E80 +0xDC4A 0xDC4C 0x8E82 +0xDC4D 0x8E86 +0xDC4E 0xDC54 0x8E88 +0xDC55 0xDC57 0x8E91 +0xDC58 0xDC5E 0x8E95 +0xDC5F 0x8E9D +0xDC60 0xDC6B 0x8E9F +0xDC6C 0xDC6D 0x8EAD +0xDC6E 0xDC6F 0x8EB0 +0xDC70 0xDC76 0x8EB3 +0xDC77 0xDC7E 0x8EBB +0xDC80 0xDC8A 0x8EC3 +0xDC8B 0xDCA0 0x8ECF +0xDCA1 0x580B +0xDCA2 0x580D +0xDCA3 0x57FD +0xDCA4 0x57ED +0xDCA5 0x5800 +0xDCA6 0x581E +0xDCA7 0x5819 +0xDCA8 0x5844 +0xDCA9 0x5820 +0xDCAA 0x5865 +0xDCAB 0x586C +0xDCAC 0x5881 +0xDCAD 0x5889 +0xDCAE 0x589A +0xDCAF 0x5880 +0xDCB0 0x99A8 +0xDCB1 0x9F19 +0xDCB2 0x61FF +0xDCB3 0x8279 +0xDCB4 0x827D +0xDCB5 0x827F +0xDCB6 0x828F +0xDCB7 0x828A +0xDCB8 0x82A8 +0xDCB9 0x8284 +0xDCBA 0x828E +0xDCBB 0x8291 +0xDCBC 0x8297 +0xDCBD 0x8299 +0xDCBE 0x82AB +0xDCBF 0x82B8 +0xDCC0 0x82BE +0xDCC1 0x82B0 +0xDCC2 0x82C8 +0xDCC3 0x82CA +0xDCC4 0x82E3 +0xDCC5 0x8298 +0xDCC6 0x82B7 +0xDCC7 0x82AE +0xDCC8 0xDCC9 0x82CB +0xDCCA 0x82C1 +0xDCCB 0x82A9 +0xDCCC 0x82B4 +0xDCCD 0x82A1 +0xDCCE 0x82AA +0xDCCF 0x829F +0xDCD0 0x82C4 +0xDCD1 0x82CE +0xDCD2 0x82A4 +0xDCD3 0x82E1 +0xDCD4 0x8309 +0xDCD5 0x82F7 +0xDCD6 0x82E4 +0xDCD7 0x830F +0xDCD8 0x8307 +0xDCD9 0x82DC +0xDCDA 0x82F4 +0xDCDB 0x82D2 +0xDCDC 0x82D8 +0xDCDD 0x830C +0xDCDE 0x82FB +0xDCDF 0x82D3 +0xDCE0 0x8311 +0xDCE1 0x831A +0xDCE2 0x8306 +0xDCE3 0xDCE4 0x8314 +0xDCE5 0x82E0 +0xDCE6 0x82D5 +0xDCE7 0x831C +0xDCE8 0x8351 +0xDCE9 0xDCEA 0x835B +0xDCEB 0x8308 +0xDCEC 0x8392 +0xDCED 0x833C +0xDCEE 0x8334 +0xDCEF 0x8331 +0xDCF0 0x839B +0xDCF1 0x835E +0xDCF2 0x832F +0xDCF3 0x834F +0xDCF4 0x8347 +0xDCF5 0x8343 +0xDCF6 0x835F +0xDCF7 0x8340 +0xDCF8 0x8317 +0xDCF9 0x8360 +0xDCFA 0x832D +0xDCFB 0x833A +0xDCFC 0x8333 +0xDCFD 0x8366 +0xDCFE 0x8365 +0xDD40 0xDD7E 0x8EE5 +0xDD80 0xDDA0 0x8F24 +0xDDA1 0x8368 +0xDDA2 0x831B +0xDDA3 0x8369 +0xDDA4 0x836C +0xDDA5 0x836A +0xDDA6 0xDDA7 0x836D +0xDDA8 0x83B0 +0xDDA9 0x8378 +0xDDAA 0xDDAB 0x83B3 +0xDDAC 0x83A0 +0xDDAD 0x83AA +0xDDAE 0x8393 +0xDDAF 0x839C +0xDDB0 0x8385 +0xDDB1 0x837C +0xDDB2 0x83B6 +0xDDB3 0x83A9 +0xDDB4 0x837D +0xDDB5 0x83B8 +0xDDB6 0x837B +0xDDB7 0x8398 +0xDDB8 0x839E +0xDDB9 0x83A8 +0xDDBA 0x83BA +0xDDBB 0x83BC +0xDDBC 0x83C1 +0xDDBD 0x8401 +0xDDBE 0x83E5 +0xDDBF 0x83D8 +0xDDC0 0x5807 +0xDDC1 0x8418 +0xDDC2 0x840B +0xDDC3 0x83DD +0xDDC4 0x83FD +0xDDC5 0x83D6 +0xDDC6 0x841C +0xDDC7 0x8438 +0xDDC8 0x8411 +0xDDC9 0x8406 +0xDDCA 0x83D4 +0xDDCB 0x83DF +0xDDCC 0x840F +0xDDCD 0x8403 +0xDDCE 0xDDCF 0x83F8 +0xDDD0 0x83EA +0xDDD1 0x83C5 +0xDDD2 0x83C0 +0xDDD3 0x8426 +0xDDD4 0x83F0 +0xDDD5 0x83E1 +0xDDD6 0x845C +0xDDD7 0x8451 +0xDDD8 0x845A +0xDDD9 0x8459 +0xDDDA 0x8473 +0xDDDB 0xDDDC 0x8487 +0xDDDD 0x847A +0xDDDE 0x8489 +0xDDDF 0x8478 +0xDDE0 0x843C +0xDDE1 0x8446 +0xDDE2 0x8469 +0xDDE3 0x8476 +0xDDE4 0x848C +0xDDE5 0x848E +0xDDE6 0x8431 +0xDDE7 0x846D +0xDDE8 0x84C1 +0xDDE9 0x84CD +0xDDEA 0x84D0 +0xDDEB 0x84E6 +0xDDEC 0x84BD +0xDDED 0x84D3 +0xDDEE 0x84CA +0xDDEF 0x84BF +0xDDF0 0x84BA +0xDDF1 0x84E0 +0xDDF2 0x84A1 +0xDDF3 0x84B9 +0xDDF4 0x84B4 +0xDDF5 0x8497 +0xDDF6 0x84E5 +0xDDF7 0x84E3 +0xDDF8 0x850C +0xDDF9 0x750D +0xDDFA 0x8538 +0xDDFB 0x84F0 +0xDDFC 0x8539 +0xDDFD 0x851F +0xDDFE 0x853A +0xDE40 0xDE60 0x8F45 +0xDE61 0x8F6A +0xDE62 0x8F80 +0xDE63 0x8F8C +0xDE64 0x8F92 +0xDE65 0x8F9D +0xDE66 0xDE68 0x8FA0 +0xDE69 0xDE6C 0x8FA4 +0xDE6D 0x8FAA +0xDE6E 0xDE71 0x8FAC +0xDE72 0xDE75 0x8FB2 +0xDE76 0xDE77 0x8FB7 +0xDE78 0xDE7A 0x8FBA +0xDE7B 0xDE7C 0x8FBF +0xDE7D 0x8FC3 +0xDE7E 0x8FC6 +0xDE80 0xDE84 0x8FC9 +0xDE85 0x8FCF +0xDE86 0x8FD2 +0xDE87 0xDE88 0x8FD6 +0xDE89 0x8FDA +0xDE8A 0xDE8B 0x8FE0 +0xDE8C 0x8FE3 +0xDE8D 0x8FE7 +0xDE8E 0x8FEC +0xDE8F 0x8FEF +0xDE90 0xDE91 0x8FF1 +0xDE92 0xDE94 0x8FF4 +0xDE95 0xDE97 0x8FFA +0xDE98 0xDE99 0x8FFE +0xDE9A 0xDE9B 0x9007 +0xDE9C 0x900C +0xDE9D 0x900E +0xDE9E 0x9013 +0xDE9F 0x9015 +0xDEA0 0x9018 +0xDEA1 0x8556 +0xDEA2 0x853B +0xDEA3 0x84FF +0xDEA4 0x84FC +0xDEA5 0x8559 +0xDEA6 0x8548 +0xDEA7 0x8568 +0xDEA8 0x8564 +0xDEA9 0x855E +0xDEAA 0x857A +0xDEAB 0x77A2 +0xDEAC 0x8543 +0xDEAD 0x8572 +0xDEAE 0x857B +0xDEAF 0x85A4 +0xDEB0 0x85A8 +0xDEB1 0x8587 +0xDEB2 0x858F +0xDEB3 0x8579 +0xDEB4 0x85AE +0xDEB5 0x859C +0xDEB6 0x8585 +0xDEB7 0x85B9 +0xDEB8 0x85B7 +0xDEB9 0x85B0 +0xDEBA 0x85D3 +0xDEBB 0x85C1 +0xDEBC 0x85DC +0xDEBD 0x85FF +0xDEBE 0x8627 +0xDEBF 0x8605 +0xDEC0 0x8629 +0xDEC1 0x8616 +0xDEC2 0x863C +0xDEC3 0x5EFE +0xDEC4 0x5F08 +0xDEC5 0x593C +0xDEC6 0x5941 +0xDEC7 0x8037 +0xDEC8 0x5955 +0xDEC9 0x595A +0xDECA 0x5958 +0xDECB 0x530F +0xDECC 0x5C22 +0xDECD 0x5C25 +0xDECE 0x5C2C +0xDECF 0x5C34 +0xDED0 0x624C +0xDED1 0x626A +0xDED2 0x629F +0xDED3 0x62BB +0xDED4 0x62CA +0xDED5 0x62DA +0xDED6 0x62D7 +0xDED7 0x62EE +0xDED8 0x6322 +0xDED9 0x62F6 +0xDEDA 0x6339 +0xDEDB 0x634B +0xDEDC 0x6343 +0xDEDD 0x63AD +0xDEDE 0x63F6 +0xDEDF 0x6371 +0xDEE0 0x637A +0xDEE1 0x638E +0xDEE2 0x63B4 +0xDEE3 0x636D +0xDEE4 0x63AC +0xDEE5 0x638A +0xDEE6 0x6369 +0xDEE7 0x63AE +0xDEE8 0x63BC +0xDEE9 0x63F2 +0xDEEA 0x63F8 +0xDEEB 0x63E0 +0xDEEC 0x63FF +0xDEED 0x63C4 +0xDEEE 0x63DE +0xDEEF 0x63CE +0xDEF0 0x6452 +0xDEF1 0x63C6 +0xDEF2 0x63BE +0xDEF3 0x6445 +0xDEF4 0x6441 +0xDEF5 0x640B +0xDEF6 0x641B +0xDEF7 0x6420 +0xDEF8 0x640C +0xDEF9 0x6426 +0xDEFA 0x6421 +0xDEFB 0x645E +0xDEFC 0x6484 +0xDEFD 0x646D +0xDEFE 0x6496 +0xDF40 0x9019 +0xDF41 0x901C +0xDF42 0xDF44 0x9023 +0xDF45 0xDF4A 0x9027 +0xDF4B 0xDF4F 0x9030 +0xDF50 0x9037 +0xDF51 0xDF52 0x9039 +0xDF53 0x903D +0xDF54 0xDF55 0x903F +0xDF56 0x9043 +0xDF57 0xDF58 0x9045 +0xDF59 0xDF5D 0x9048 +0xDF5E 0x904E +0xDF5F 0xDF61 0x9054 +0xDF62 0xDF63 0x9059 +0xDF64 0xDF69 0x905C +0xDF6A 0x9064 +0xDF6B 0xDF6C 0x9066 +0xDF6D 0xDF70 0x9069 +0xDF71 0xDF75 0x906F +0xDF76 0xDF7C 0x9076 +0xDF7D 0x907E +0xDF7E 0x9081 +0xDF80 0xDF83 0x9084 +0xDF84 0xDF85 0x9089 +0xDF86 0xDF8A 0x908C +0xDF8B 0x9092 +0xDF8C 0x9094 +0xDF8D 0x9096 +0xDF8E 0x9098 +0xDF8F 0x909A +0xDF90 0x909C +0xDF91 0xDF93 0x909E +0xDF94 0xDF95 0x90A4 +0xDF96 0xDF98 0x90A7 +0xDF99 0x90AB +0xDF9A 0x90AD +0xDF9B 0x90B2 +0xDF9C 0x90B7 +0xDF9D 0xDF9E 0x90BC +0xDF9F 0xDFA0 0x90BF +0xDFA1 0x647A +0xDFA2 0xDFA3 0x64B7 +0xDFA4 0x6499 +0xDFA5 0x64BA +0xDFA6 0x64C0 +0xDFA7 0x64D0 +0xDFA8 0x64D7 +0xDFA9 0x64E4 +0xDFAA 0x64E2 +0xDFAB 0x6509 +0xDFAC 0x6525 +0xDFAD 0x652E +0xDFAE 0x5F0B +0xDFAF 0x5FD2 +0xDFB0 0x7519 +0xDFB1 0x5F11 +0xDFB2 0x535F +0xDFB3 0x53F1 +0xDFB4 0x53FD +0xDFB5 0x53E9 +0xDFB6 0x53E8 +0xDFB7 0x53FB +0xDFB8 0x5412 +0xDFB9 0x5416 +0xDFBA 0x5406 +0xDFBB 0x544B +0xDFBC 0xDFBE 0x5452 +0xDFBF 0x5456 +0xDFC0 0x5443 +0xDFC1 0x5421 +0xDFC2 0x5457 +0xDFC3 0x5459 +0xDFC4 0x5423 +0xDFC5 0x5432 +0xDFC6 0x5482 +0xDFC7 0x5494 +0xDFC8 0x5477 +0xDFC9 0x5471 +0xDFCA 0x5464 +0xDFCB 0xDFCC 0x549A +0xDFCD 0x5484 +0xDFCE 0x5476 +0xDFCF 0x5466 +0xDFD0 0x549D +0xDFD1 0x54D0 +0xDFD2 0x54AD +0xDFD3 0x54C2 +0xDFD4 0x54B4 +0xDFD5 0x54D2 +0xDFD6 0x54A7 +0xDFD7 0x54A6 +0xDFD8 0xDFD9 0x54D3 +0xDFDA 0x5472 +0xDFDB 0x54A3 +0xDFDC 0x54D5 +0xDFDD 0x54BB +0xDFDE 0x54BF +0xDFDF 0x54CC +0xDFE0 0xDFE1 0x54D9 +0xDFE2 0x54DC +0xDFE3 0xDFE4 0x54A9 +0xDFE5 0x54A4 +0xDFE6 0x54DD +0xDFE7 0x54CF +0xDFE8 0x54DE +0xDFE9 0x551B +0xDFEA 0x54E7 +0xDFEB 0x5520 +0xDFEC 0x54FD +0xDFED 0x5514 +0xDFEE 0x54F3 +0xDFEF 0xDFF0 0x5522 +0xDFF1 0x550F +0xDFF2 0x5511 +0xDFF3 0x5527 +0xDFF4 0x552A +0xDFF5 0x5567 +0xDFF6 0x558F +0xDFF7 0x55B5 +0xDFF8 0x5549 +0xDFF9 0x556D +0xDFFA 0x5541 +0xDFFB 0x5555 +0xDFFC 0x553F +0xDFFD 0x5550 +0xDFFE 0x553C +0xE040 0xE041 0x90C2 +0xE042 0x90C6 +0xE043 0xE044 0x90C8 +0xE045 0xE047 0x90CB +0xE048 0x90D2 +0xE049 0xE04B 0x90D4 +0xE04C 0xE04E 0x90D8 +0xE04F 0xE051 0x90DE +0xE052 0xE054 0x90E3 +0xE055 0xE056 0x90E9 +0xE057 0x90EC +0xE058 0x90EE +0xE059 0xE05C 0x90F0 +0xE05D 0xE05F 0x90F5 +0xE060 0xE063 0x90F9 +0xE064 0xE066 0x90FF +0xE067 0x9103 +0xE068 0xE07B 0x9105 +0xE07C 0xE07E 0x911A +0xE080 0x911D +0xE081 0xE083 0x911F +0xE084 0xE08E 0x9124 +0xE08F 0x9130 +0xE090 0xE096 0x9132 +0xE097 0xE09F 0x913A +0xE0A0 0x9144 +0xE0A1 0x5537 +0xE0A2 0x5556 +0xE0A3 0xE0A5 0x5575 +0xE0A6 0x5533 +0xE0A7 0x5530 +0xE0A8 0x555C +0xE0A9 0x558B +0xE0AA 0x55D2 +0xE0AB 0x5583 +0xE0AC 0x55B1 +0xE0AD 0x55B9 +0xE0AE 0x5588 +0xE0AF 0x5581 +0xE0B0 0x559F +0xE0B1 0x557E +0xE0B2 0x55D6 +0xE0B3 0x5591 +0xE0B4 0x557B +0xE0B5 0x55DF +0xE0B6 0xE0B7 0x55BD +0xE0B8 0x5594 +0xE0B9 0x5599 +0xE0BA 0x55EA +0xE0BB 0x55F7 +0xE0BC 0x55C9 +0xE0BD 0x561F +0xE0BE 0x55D1 +0xE0BF 0xE0C0 0x55EB +0xE0C1 0x55D4 +0xE0C2 0x55E6 +0xE0C3 0x55DD +0xE0C4 0x55C4 +0xE0C5 0x55EF +0xE0C6 0x55E5 +0xE0C7 0xE0C8 0x55F2 +0xE0C9 0xE0CA 0x55CC +0xE0CB 0x55E8 +0xE0CC 0x55F5 +0xE0CD 0x55E4 +0xE0CE 0x8F94 +0xE0CF 0x561E +0xE0D0 0x5608 +0xE0D1 0x560C +0xE0D2 0x5601 +0xE0D3 0x5624 +0xE0D4 0x5623 +0xE0D5 0x55FE +0xE0D6 0x5600 +0xE0D7 0x5627 +0xE0D8 0x562D +0xE0D9 0x5658 +0xE0DA 0x5639 +0xE0DB 0x5657 +0xE0DC 0x562C +0xE0DD 0x564D +0xE0DE 0x5662 +0xE0DF 0x5659 +0xE0E0 0x565C +0xE0E1 0x564C +0xE0E2 0x5654 +0xE0E3 0x5686 +0xE0E4 0x5664 +0xE0E5 0x5671 +0xE0E6 0x566B +0xE0E7 0xE0E8 0x567B +0xE0E9 0x5685 +0xE0EA 0x5693 +0xE0EB 0x56AF +0xE0EC 0x56D4 +0xE0ED 0x56D7 +0xE0EE 0x56DD +0xE0EF 0x56E1 +0xE0F0 0x56F5 +0xE0F1 0x56EB +0xE0F2 0x56F9 +0xE0F3 0x56FF +0xE0F4 0x5704 +0xE0F5 0x570A +0xE0F6 0x5709 +0xE0F7 0x571C +0xE0F8 0x5E0F +0xE0F9 0x5E19 +0xE0FA 0x5E14 +0xE0FB 0x5E11 +0xE0FC 0x5E31 +0xE0FD 0xE0FE 0x5E3B +0xE140 0x9145 +0xE141 0xE142 0x9147 +0xE143 0x9151 +0xE144 0xE147 0x9153 +0xE148 0xE149 0x9158 +0xE14A 0xE14B 0x915B +0xE14C 0xE14D 0x915F +0xE14E 0xE150 0x9166 +0xE151 0x916B +0xE152 0x916D +0xE153 0x9173 +0xE154 0xE156 0x917A +0xE157 0xE15B 0x9180 +0xE15C 0x9186 +0xE15D 0x9188 +0xE15E 0x918A +0xE15F 0xE160 0x918E +0xE161 0xE167 0x9193 +0xE168 0xE16D 0x919C +0xE16E 0xE173 0x91A4 +0xE174 0xE175 0x91AB +0xE176 0xE179 0x91B0 +0xE17A 0xE17D 0x91B6 +0xE17E 0x91BB +0xE180 0xE18A 0x91BC +0xE18B 0x91C8 +0xE18C 0x91CB +0xE18D 0x91D0 +0xE18E 0xE197 0x91D2 +0xE198 0xE1A0 0x91DD +0xE1A1 0x5E37 +0xE1A2 0x5E44 +0xE1A3 0x5E54 +0xE1A4 0x5E5B +0xE1A5 0x5E5E +0xE1A6 0x5E61 +0xE1A7 0x5C8C +0xE1A8 0x5C7A +0xE1A9 0x5C8D +0xE1AA 0x5C90 +0xE1AB 0x5C96 +0xE1AC 0x5C88 +0xE1AD 0xE1AE 0x5C98 +0xE1AF 0x5C91 +0xE1B0 0x5C9A +0xE1B1 0x5C9C +0xE1B2 0x5CB5 +0xE1B3 0x5CA2 +0xE1B4 0x5CBD +0xE1B5 0x5CAC +0xE1B6 0x5CAB +0xE1B7 0x5CB1 +0xE1B8 0x5CA3 +0xE1B9 0x5CC1 +0xE1BA 0x5CB7 +0xE1BB 0x5CC4 +0xE1BC 0x5CD2 +0xE1BD 0x5CE4 +0xE1BE 0x5CCB +0xE1BF 0x5CE5 +0xE1C0 0xE1C1 0x5D02 +0xE1C2 0x5D27 +0xE1C3 0x5D26 +0xE1C4 0x5D2E +0xE1C5 0x5D24 +0xE1C6 0x5D1E +0xE1C7 0x5D06 +0xE1C8 0x5D1B +0xE1C9 0x5D58 +0xE1CA 0x5D3E +0xE1CB 0x5D34 +0xE1CC 0x5D3D +0xE1CD 0x5D6C +0xE1CE 0x5D5B +0xE1CF 0x5D6F +0xE1D0 0x5D5D +0xE1D1 0x5D6B +0xE1D2 0x5D4B +0xE1D3 0x5D4A +0xE1D4 0x5D69 +0xE1D5 0x5D74 +0xE1D6 0x5D82 +0xE1D7 0x5D99 +0xE1D8 0x5D9D +0xE1D9 0x8C73 +0xE1DA 0x5DB7 +0xE1DB 0x5DC5 +0xE1DC 0x5F73 +0xE1DD 0x5F77 +0xE1DE 0x5F82 +0xE1DF 0x5F87 +0xE1E0 0x5F89 +0xE1E1 0x5F8C +0xE1E2 0x5F95 +0xE1E3 0x5F99 +0xE1E4 0x5F9C +0xE1E5 0x5FA8 +0xE1E6 0x5FAD +0xE1E7 0x5FB5 +0xE1E8 0x5FBC +0xE1E9 0x8862 +0xE1EA 0x5F61 +0xE1EB 0x72AD +0xE1EC 0x72B0 +0xE1ED 0x72B4 +0xE1EE 0xE1EF 0x72B7 +0xE1F0 0x72C3 +0xE1F1 0x72C1 +0xE1F2 0x72CE +0xE1F3 0x72CD +0xE1F4 0x72D2 +0xE1F5 0x72E8 +0xE1F6 0x72EF +0xE1F7 0x72E9 +0xE1F8 0x72F2 +0xE1F9 0x72F4 +0xE1FA 0x72F7 +0xE1FB 0x7301 +0xE1FC 0x72F3 +0xE1FD 0x7303 +0xE1FE 0x72FA +0xE240 0xE27E 0x91E6 +0xE280 0xE2A0 0x9225 +0xE2A1 0x72FB +0xE2A2 0x7317 +0xE2A3 0x7313 +0xE2A4 0x7321 +0xE2A5 0x730A +0xE2A6 0x731E +0xE2A7 0x731D +0xE2A8 0x7315 +0xE2A9 0x7322 +0xE2AA 0x7339 +0xE2AB 0x7325 +0xE2AC 0x732C +0xE2AD 0x7338 +0xE2AE 0x7331 +0xE2AF 0x7350 +0xE2B0 0x734D +0xE2B1 0x7357 +0xE2B2 0x7360 +0xE2B3 0x736C +0xE2B4 0x736F +0xE2B5 0x737E +0xE2B6 0x821B +0xE2B7 0x5925 +0xE2B8 0x98E7 +0xE2B9 0x5924 +0xE2BA 0x5902 +0xE2BB 0x9963 +0xE2BC 0xE2C1 0x9967 +0xE2C2 0x9974 +0xE2C3 0x9977 +0xE2C4 0x997D +0xE2C5 0x9980 +0xE2C6 0x9984 +0xE2C7 0x9987 +0xE2C8 0x998A +0xE2C9 0x998D +0xE2CA 0xE2CB 0x9990 +0xE2CC 0xE2CE 0x9993 +0xE2CF 0x5E80 +0xE2D0 0x5E91 +0xE2D1 0x5E8B +0xE2D2 0x5E96 +0xE2D3 0x5EA5 +0xE2D4 0x5EA0 +0xE2D5 0x5EB9 +0xE2D6 0x5EB5 +0xE2D7 0x5EBE +0xE2D8 0x5EB3 +0xE2D9 0x8D53 +0xE2DA 0x5ED2 +0xE2DB 0x5ED1 +0xE2DC 0x5EDB +0xE2DD 0x5EE8 +0xE2DE 0x5EEA +0xE2DF 0x81BA +0xE2E0 0x5FC4 +0xE2E1 0x5FC9 +0xE2E2 0x5FD6 +0xE2E3 0x5FCF +0xE2E4 0x6003 +0xE2E5 0x5FEE +0xE2E6 0x6004 +0xE2E7 0x5FE1 +0xE2E8 0x5FE4 +0xE2E9 0x5FFE +0xE2EA 0xE2EB 0x6005 +0xE2EC 0x5FEA +0xE2ED 0x5FED +0xE2EE 0x5FF8 +0xE2EF 0x6019 +0xE2F0 0x6035 +0xE2F1 0x6026 +0xE2F2 0x601B +0xE2F3 0x600F +0xE2F4 0x600D +0xE2F5 0x6029 +0xE2F6 0x602B +0xE2F7 0x600A +0xE2F8 0x603F +0xE2F9 0x6021 +0xE2FA 0xE2FB 0x6078 +0xE2FC 0x607B +0xE2FD 0x607A +0xE2FE 0x6042 +0xE340 0xE36D 0x9246 +0xE36E 0xE37E 0x9275 +0xE380 0xE387 0x9286 +0xE388 0xE3A0 0x928F +0xE3A1 0x606A +0xE3A2 0x607D +0xE3A3 0x6096 +0xE3A4 0x609A +0xE3A5 0x60AD +0xE3A6 0x609D +0xE3A7 0x6083 +0xE3A8 0x6092 +0xE3A9 0x608C +0xE3AA 0x609B +0xE3AB 0x60EC +0xE3AC 0x60BB +0xE3AD 0x60B1 +0xE3AE 0x60DD +0xE3AF 0x60D8 +0xE3B0 0x60C6 +0xE3B1 0x60DA +0xE3B2 0x60B4 +0xE3B3 0x6120 +0xE3B4 0x6126 +0xE3B5 0x6115 +0xE3B6 0x6123 +0xE3B7 0x60F4 +0xE3B8 0x6100 +0xE3B9 0x610E +0xE3BA 0x612B +0xE3BB 0x614A +0xE3BC 0x6175 +0xE3BD 0x61AC +0xE3BE 0x6194 +0xE3BF 0x61A7 +0xE3C0 0x61B7 +0xE3C1 0x61D4 +0xE3C2 0x61F5 +0xE3C3 0x5FDD +0xE3C4 0x96B3 +0xE3C5 0x95E9 +0xE3C6 0x95EB +0xE3C7 0x95F1 +0xE3C8 0x95F3 +0xE3C9 0xE3CA 0x95F5 +0xE3CB 0x95FC +0xE3CC 0x95FE +0xE3CD 0xE3CE 0x9603 +0xE3CF 0x9606 +0xE3D0 0x9608 +0xE3D1 0xE3D4 0x960A +0xE3D5 0x960F +0xE3D6 0x9612 +0xE3D7 0xE3D9 0x9615 +0xE3DA 0xE3DB 0x9619 +0xE3DC 0x4E2C +0xE3DD 0x723F +0xE3DE 0x6215 +0xE3DF 0x6C35 +0xE3E0 0x6C54 +0xE3E1 0x6C5C +0xE3E2 0x6C4A +0xE3E3 0x6CA3 +0xE3E4 0x6C85 +0xE3E5 0x6C90 +0xE3E6 0x6C94 +0xE3E7 0x6C8C +0xE3E8 0xE3E9 0x6C68 +0xE3EA 0x6C74 +0xE3EB 0x6C76 +0xE3EC 0x6C86 +0xE3ED 0x6CA9 +0xE3EE 0x6CD0 +0xE3EF 0x6CD4 +0xE3F0 0x6CAD +0xE3F1 0xE3F2 0x6CF7 +0xE3F3 0x6CF1 +0xE3F4 0x6CD7 +0xE3F5 0x6CB2 +0xE3F6 0x6CE0 +0xE3F7 0x6CD6 +0xE3F8 0x6CFA +0xE3F9 0x6CEB +0xE3FA 0x6CEE +0xE3FB 0x6CB1 +0xE3FC 0x6CD3 +0xE3FD 0x6CEF +0xE3FE 0x6CFE +0xE440 0xE445 0x92A8 +0xE446 0xE45E 0x92AF +0xE45F 0xE47E 0x92C9 +0xE480 0xE4A0 0x92E9 +0xE4A1 0x6D39 +0xE4A2 0x6D27 +0xE4A3 0x6D0C +0xE4A4 0x6D43 +0xE4A5 0x6D48 +0xE4A6 0x6D07 +0xE4A7 0x6D04 +0xE4A8 0x6D19 +0xE4A9 0x6D0E +0xE4AA 0x6D2B +0xE4AB 0x6D4D +0xE4AC 0x6D2E +0xE4AD 0x6D35 +0xE4AE 0x6D1A +0xE4AF 0x6D4F +0xE4B0 0x6D52 +0xE4B1 0x6D54 +0xE4B2 0x6D33 +0xE4B3 0x6D91 +0xE4B4 0x6D6F +0xE4B5 0x6D9E +0xE4B6 0x6DA0 +0xE4B7 0x6D5E +0xE4B8 0xE4B9 0x6D93 +0xE4BA 0x6D5C +0xE4BB 0x6D60 +0xE4BC 0x6D7C +0xE4BD 0x6D63 +0xE4BE 0x6E1A +0xE4BF 0x6DC7 +0xE4C0 0x6DC5 +0xE4C1 0x6DDE +0xE4C2 0x6E0E +0xE4C3 0x6DBF +0xE4C4 0x6DE0 +0xE4C5 0x6E11 +0xE4C6 0x6DE6 +0xE4C7 0x6DDD +0xE4C8 0x6DD9 +0xE4C9 0x6E16 +0xE4CA 0x6DAB +0xE4CB 0x6E0C +0xE4CC 0x6DAE +0xE4CD 0x6E2B +0xE4CE 0x6E6E +0xE4CF 0x6E4E +0xE4D0 0x6E6B +0xE4D1 0x6EB2 +0xE4D2 0x6E5F +0xE4D3 0x6E86 +0xE4D4 0xE4D5 0x6E53 +0xE4D6 0x6E32 +0xE4D7 0x6E25 +0xE4D8 0x6E44 +0xE4D9 0x6EDF +0xE4DA 0x6EB1 +0xE4DB 0x6E98 +0xE4DC 0x6EE0 +0xE4DD 0x6F2D +0xE4DE 0x6EE2 +0xE4DF 0x6EA5 +0xE4E0 0x6EA7 +0xE4E1 0x6EBD +0xE4E2 0x6EBB +0xE4E3 0x6EB7 +0xE4E4 0x6ED7 +0xE4E5 0x6EB4 +0xE4E6 0x6ECF +0xE4E7 0x6E8F +0xE4E8 0x6EC2 +0xE4E9 0x6E9F +0xE4EA 0x6F62 +0xE4EB 0xE4EC 0x6F46 +0xE4ED 0x6F24 +0xE4EE 0x6F15 +0xE4EF 0x6EF9 +0xE4F0 0x6F2F +0xE4F1 0x6F36 +0xE4F2 0x6F4B +0xE4F3 0x6F74 +0xE4F4 0x6F2A +0xE4F5 0x6F09 +0xE4F6 0x6F29 +0xE4F7 0x6F89 +0xE4F8 0x6F8D +0xE4F9 0x6F8C +0xE4FA 0x6F78 +0xE4FB 0x6F72 +0xE4FC 0x6F7C +0xE4FD 0x6F7A +0xE4FE 0x6FD1 +0xE540 0xE573 0x930A +0xE574 0xE57E 0x933F +0xE580 0xE59F 0x934A +0xE5A0 0x936B +0xE5A1 0x6FC9 +0xE5A2 0x6FA7 +0xE5A3 0x6FB9 +0xE5A4 0x6FB6 +0xE5A5 0x6FC2 +0xE5A6 0x6FE1 +0xE5A7 0x6FEE +0xE5A8 0x6FDE +0xE5A9 0x6FE0 +0xE5AA 0x6FEF +0xE5AB 0x701A +0xE5AC 0x7023 +0xE5AD 0x701B +0xE5AE 0x7039 +0xE5AF 0x7035 +0xE5B0 0x704F +0xE5B1 0x705E +0xE5B2 0x5B80 +0xE5B3 0x5B84 +0xE5B4 0x5B95 +0xE5B5 0x5B93 +0xE5B6 0x5BA5 +0xE5B7 0x5BB8 +0xE5B8 0x752F +0xE5B9 0x9A9E +0xE5BA 0x6434 +0xE5BB 0x5BE4 +0xE5BC 0x5BEE +0xE5BD 0x8930 +0xE5BE 0x5BF0 +0xE5BF 0x8E47 +0xE5C0 0x8B07 +0xE5C1 0x8FB6 +0xE5C2 0x8FD3 +0xE5C3 0x8FD5 +0xE5C4 0x8FE5 +0xE5C5 0x8FEE +0xE5C6 0x8FE4 +0xE5C7 0x8FE9 +0xE5C8 0x8FE6 +0xE5C9 0x8FF3 +0xE5CA 0x8FE8 +0xE5CB 0x9005 +0xE5CC 0x9004 +0xE5CD 0x900B +0xE5CE 0x9026 +0xE5CF 0x9011 +0xE5D0 0x900D +0xE5D1 0x9016 +0xE5D2 0x9021 +0xE5D3 0xE5D4 0x9035 +0xE5D5 0x902D +0xE5D6 0x902F +0xE5D7 0x9044 +0xE5D8 0xE5D9 0x9051 +0xE5DA 0x9050 +0xE5DB 0x9068 +0xE5DC 0x9058 +0xE5DD 0x9062 +0xE5DE 0x905B +0xE5DF 0x66B9 +0xE5E0 0x9074 +0xE5E1 0x907D +0xE5E2 0x9082 +0xE5E3 0x9088 +0xE5E4 0x9083 +0xE5E5 0x908B +0xE5E6 0x5F50 +0xE5E7 0x5F57 +0xE5E8 0x5F56 +0xE5E9 0x5F58 +0xE5EA 0x5C3B +0xE5EB 0x54AB +0xE5EC 0x5C50 +0xE5ED 0x5C59 +0xE5EE 0x5B71 +0xE5EF 0x5C63 +0xE5F0 0x5C66 +0xE5F1 0x7FBC +0xE5F2 0x5F2A +0xE5F3 0x5F29 +0xE5F4 0x5F2D +0xE5F5 0x8274 +0xE5F6 0x5F3C +0xE5F7 0x9B3B +0xE5F8 0x5C6E +0xE5F9 0x5981 +0xE5FA 0x5983 +0xE5FB 0x598D +0xE5FC 0xE5FD 0x59A9 +0xE5FE 0x59A3 +0xE640 0xE662 0x936C +0xE663 0xE67E 0x9390 +0xE680 0xE69D 0x93AC +0xE69E 0xE6A0 0x93CB +0xE6A1 0x5997 +0xE6A2 0x59CA +0xE6A3 0x59AB +0xE6A4 0x599E +0xE6A5 0x59A4 +0xE6A6 0x59D2 +0xE6A7 0x59B2 +0xE6A8 0x59AF +0xE6A9 0x59D7 +0xE6AA 0x59BE +0xE6AB 0xE6AC 0x5A05 +0xE6AD 0x59DD +0xE6AE 0x5A08 +0xE6AF 0x59E3 +0xE6B0 0x59D8 +0xE6B1 0x59F9 +0xE6B2 0x5A0C +0xE6B3 0x5A09 +0xE6B4 0x5A32 +0xE6B5 0x5A34 +0xE6B6 0x5A11 +0xE6B7 0x5A23 +0xE6B8 0x5A13 +0xE6B9 0x5A40 +0xE6BA 0x5A67 +0xE6BB 0x5A4A +0xE6BC 0x5A55 +0xE6BD 0x5A3C +0xE6BE 0x5A62 +0xE6BF 0x5A75 +0xE6C0 0x80EC +0xE6C1 0x5AAA +0xE6C2 0x5A9B +0xE6C3 0x5A77 +0xE6C4 0x5A7A +0xE6C5 0x5ABE +0xE6C6 0x5AEB +0xE6C7 0x5AB2 +0xE6C8 0x5AD2 +0xE6C9 0x5AD4 +0xE6CA 0x5AB8 +0xE6CB 0x5AE0 +0xE6CC 0x5AE3 +0xE6CD 0x5AF1 +0xE6CE 0x5AD6 +0xE6CF 0x5AE6 +0xE6D0 0x5AD8 +0xE6D1 0x5ADC +0xE6D2 0x5B09 +0xE6D3 0x5B17 +0xE6D4 0x5B16 +0xE6D5 0x5B32 +0xE6D6 0x5B37 +0xE6D7 0x5B40 +0xE6D8 0x5C15 +0xE6D9 0x5C1C +0xE6DA 0x5B5A +0xE6DB 0x5B65 +0xE6DC 0x5B73 +0xE6DD 0x5B51 +0xE6DE 0x5B53 +0xE6DF 0x5B62 +0xE6E0 0x9A75 +0xE6E1 0xE6E2 0x9A77 +0xE6E3 0x9A7A +0xE6E4 0x9A7F +0xE6E5 0x9A7D +0xE6E6 0xE6E7 0x9A80 +0xE6E8 0x9A85 +0xE6E9 0x9A88 +0xE6EA 0x9A8A +0xE6EB 0x9A90 +0xE6EC 0xE6ED 0x9A92 +0xE6EE 0x9A96 +0xE6EF 0x9A98 +0xE6F0 0xE6F2 0x9A9B +0xE6F3 0xE6F4 0x9A9F +0xE6F5 0xE6F6 0x9AA2 +0xE6F7 0x9AA5 +0xE6F8 0x9AA7 +0xE6F9 0x7E9F +0xE6FA 0x7EA1 +0xE6FB 0x7EA3 +0xE6FC 0x7EA5 +0xE6FD 0xE6FE 0x7EA8 +0xE740 0xE747 0x93CE +0xE748 0xE77E 0x93D7 +0xE780 0xE7A0 0x940E +0xE7A1 0x7EAD +0xE7A2 0x7EB0 +0xE7A3 0x7EBE +0xE7A4 0xE7A6 0x7EC0 +0xE7A7 0x7EC9 +0xE7A8 0xE7A9 0x7ECB +0xE7AA 0x7ED0 +0xE7AB 0x7ED4 +0xE7AC 0x7ED7 +0xE7AD 0x7EDB +0xE7AE 0xE7AF 0x7EE0 +0xE7B0 0x7EE8 +0xE7B1 0x7EEB +0xE7B2 0xE7B3 0x7EEE +0xE7B4 0xE7B5 0x7EF1 +0xE7B6 0x7F0D +0xE7B7 0x7EF6 +0xE7B8 0xE7B9 0x7EFA +0xE7BA 0x7EFE +0xE7BB 0xE7BD 0x7F01 +0xE7BE 0xE7BF 0x7F07 +0xE7C0 0xE7C1 0x7F0B +0xE7C2 0x7F0F +0xE7C3 0xE7C4 0x7F11 +0xE7C5 0x7F17 +0xE7C6 0x7F19 +0xE7C7 0x7F1C +0xE7C8 0x7F1B +0xE7C9 0x7F1F +0xE7CA 0xE7D0 0x7F21 +0xE7D1 0xE7D4 0x7F2A +0xE7D5 0xE7D9 0x7F2F +0xE7DA 0x7F35 +0xE7DB 0x5E7A +0xE7DC 0x757F +0xE7DD 0x5DDB +0xE7DE 0x753E +0xE7DF 0x9095 +0xE7E0 0x738E +0xE7E1 0x7391 +0xE7E2 0x73AE +0xE7E3 0x73A2 +0xE7E4 0x739F +0xE7E5 0x73CF +0xE7E6 0x73C2 +0xE7E7 0x73D1 +0xE7E8 0x73B7 +0xE7E9 0x73B3 +0xE7EA 0x73C0 +0xE7EB 0x73C9 +0xE7EC 0x73C8 +0xE7ED 0x73E5 +0xE7EE 0x73D9 +0xE7EF 0x987C +0xE7F0 0x740A +0xE7F1 0x73E9 +0xE7F2 0x73E7 +0xE7F3 0x73DE +0xE7F4 0x73BA +0xE7F5 0x73F2 +0xE7F6 0x740F +0xE7F7 0x742A +0xE7F8 0x745B +0xE7F9 0x7426 +0xE7FA 0x7425 +0xE7FB 0x7428 +0xE7FC 0x7430 +0xE7FD 0x742E +0xE7FE 0x742C +0xE840 0xE84E 0x942F +0xE84F 0xE87A 0x943F +0xE87B 0xE87E 0x946C +0xE880 0xE894 0x9470 +0xE895 0x9491 +0xE896 0x9496 +0xE897 0x9498 +0xE898 0x94C7 +0xE899 0x94CF +0xE89A 0xE89B 0x94D3 +0xE89C 0x94DA +0xE89D 0x94E6 +0xE89E 0x94FB +0xE89F 0x951C +0xE8A0 0x9520 +0xE8A1 0x741B +0xE8A2 0x741A +0xE8A3 0x7441 +0xE8A4 0x745C +0xE8A5 0x7457 +0xE8A6 0x7455 +0xE8A7 0x7459 +0xE8A8 0x7477 +0xE8A9 0x746D +0xE8AA 0x747E +0xE8AB 0x749C +0xE8AC 0x748E +0xE8AD 0xE8AE 0x7480 +0xE8AF 0x7487 +0xE8B0 0x748B +0xE8B1 0x749E +0xE8B2 0xE8B3 0x74A8 +0xE8B4 0x7490 +0xE8B5 0x74A7 +0xE8B6 0x74D2 +0xE8B7 0x74BA +0xE8B8 0xE8BA 0x97EA +0xE8BB 0x674C +0xE8BC 0x6753 +0xE8BD 0x675E +0xE8BE 0x6748 +0xE8BF 0x6769 +0xE8C0 0x67A5 +0xE8C1 0x6787 +0xE8C2 0x676A +0xE8C3 0x6773 +0xE8C4 0x6798 +0xE8C5 0x67A7 +0xE8C6 0x6775 +0xE8C7 0x67A8 +0xE8C8 0x679E +0xE8C9 0x67AD +0xE8CA 0x678B +0xE8CB 0x6777 +0xE8CC 0x677C +0xE8CD 0x67F0 +0xE8CE 0x6809 +0xE8CF 0x67D8 +0xE8D0 0x680A +0xE8D1 0x67E9 +0xE8D2 0x67B0 +0xE8D3 0x680C +0xE8D4 0x67D9 +0xE8D5 0x67B5 +0xE8D6 0x67DA +0xE8D7 0x67B3 +0xE8D8 0x67DD +0xE8D9 0x6800 +0xE8DA 0x67C3 +0xE8DB 0x67B8 +0xE8DC 0x67E2 +0xE8DD 0x680E +0xE8DE 0x67C1 +0xE8DF 0x67FD +0xE8E0 0xE8E1 0x6832 +0xE8E2 0xE8E3 0x6860 +0xE8E4 0x684E +0xE8E5 0x6862 +0xE8E6 0x6844 +0xE8E7 0x6864 +0xE8E8 0x6883 +0xE8E9 0x681D +0xE8EA 0x6855 +0xE8EB 0x6866 +0xE8EC 0x6841 +0xE8ED 0x6867 +0xE8EE 0x6840 +0xE8EF 0x683E +0xE8F0 0x684A +0xE8F1 0x6849 +0xE8F2 0x6829 +0xE8F3 0x68B5 +0xE8F4 0x688F +0xE8F5 0x6874 +0xE8F6 0x6877 +0xE8F7 0x6893 +0xE8F8 0x686B +0xE8F9 0x68C2 +0xE8FA 0x696E +0xE8FB 0x68FC +0xE8FC 0xE8FD 0x691F +0xE8FE 0x68F9 +0xE940 0x9527 +0xE941 0x9533 +0xE942 0x953D +0xE943 0x9543 +0xE944 0x9548 +0xE945 0x954B +0xE946 0x9555 +0xE947 0x955A +0xE948 0x9560 +0xE949 0x956E +0xE94A 0xE94B 0x9574 +0xE94C 0xE953 0x9577 +0xE954 0xE97E 0x9580 +0xE980 0xE9A0 0x95AB +0xE9A1 0x6924 +0xE9A2 0x68F0 +0xE9A3 0x690B +0xE9A4 0x6901 +0xE9A5 0x6957 +0xE9A6 0x68E3 +0xE9A7 0x6910 +0xE9A8 0x6971 +0xE9A9 0x6939 +0xE9AA 0x6960 +0xE9AB 0x6942 +0xE9AC 0x695D +0xE9AD 0x6984 +0xE9AE 0x696B +0xE9AF 0x6980 +0xE9B0 0x6998 +0xE9B1 0x6978 +0xE9B2 0x6934 +0xE9B3 0x69CC +0xE9B4 0xE9B5 0x6987 +0xE9B6 0x69CE +0xE9B7 0x6989 +0xE9B8 0x6966 +0xE9B9 0x6963 +0xE9BA 0x6979 +0xE9BB 0x699B +0xE9BC 0x69A7 +0xE9BD 0x69BB +0xE9BE 0x69AB +0xE9BF 0x69AD +0xE9C0 0x69D4 +0xE9C1 0x69B1 +0xE9C2 0x69C1 +0xE9C3 0x69CA +0xE9C4 0x69DF +0xE9C5 0x6995 +0xE9C6 0x69E0 +0xE9C7 0x698D +0xE9C8 0x69FF +0xE9C9 0x6A2F +0xE9CA 0x69ED +0xE9CB 0xE9CC 0x6A17 +0xE9CD 0x6A65 +0xE9CE 0x69F2 +0xE9CF 0x6A44 +0xE9D0 0x6A3E +0xE9D1 0x6AA0 +0xE9D2 0x6A50 +0xE9D3 0x6A5B +0xE9D4 0x6A35 +0xE9D5 0x6A8E +0xE9D6 0x6A79 +0xE9D7 0x6A3D +0xE9D8 0x6A28 +0xE9D9 0x6A58 +0xE9DA 0x6A7C +0xE9DB 0x6A91 +0xE9DC 0x6A90 +0xE9DD 0x6AA9 +0xE9DE 0x6A97 +0xE9DF 0x6AAB +0xE9E0 0x7337 +0xE9E1 0x7352 +0xE9E2 0xE9E3 0x6B81 +0xE9E4 0x6B87 +0xE9E5 0x6B84 +0xE9E6 0xE9E7 0x6B92 +0xE9E8 0x6B8D +0xE9E9 0xE9EA 0x6B9A +0xE9EB 0x6BA1 +0xE9EC 0x6BAA +0xE9ED 0x8F6B +0xE9EE 0x8F6D +0xE9EF 0xE9F1 0x8F71 +0xE9F2 0xE9F3 0x8F75 +0xE9F4 0x8F78 +0xE9F5 0x8F77 +0xE9F6 0xE9F7 0x8F79 +0xE9F8 0x8F7C +0xE9F9 0x8F7E +0xE9FA 0xE9FB 0x8F81 +0xE9FC 0x8F84 +0xE9FD 0x8F87 +0xE9FE 0x8F8B +0xEA40 0xEA5B 0x95CC +0xEA5C 0x95EC +0xEA5D 0x95FF +0xEA5E 0x9607 +0xEA5F 0x9613 +0xEA60 0x9618 +0xEA61 0x961B +0xEA62 0x961E +0xEA63 0x9620 +0xEA64 0xEA6A 0x9623 +0xEA6B 0xEA6D 0x962B +0xEA6E 0xEA6F 0x962F +0xEA70 0xEA73 0x9637 +0xEA74 0x963E +0xEA75 0x9641 +0xEA76 0x9643 +0xEA77 0x964A +0xEA78 0xEA79 0x964E +0xEA7A 0xEA7C 0x9651 +0xEA7D 0xEA7E 0x9656 +0xEA80 0xEA82 0x9658 +0xEA83 0xEA85 0x965C +0xEA86 0x9660 +0xEA87 0x9663 +0xEA88 0xEA89 0x9665 +0xEA8A 0x966B +0xEA8B 0xEA8F 0x966D +0xEA90 0x9673 +0xEA91 0xEA9D 0x9678 +0xEA9E 0x9687 +0xEA9F 0xEAA0 0x9689 +0xEAA1 0xEAA3 0x8F8D +0xEAA4 0x8F98 +0xEAA5 0x8F9A +0xEAA6 0x8ECE +0xEAA7 0x620B +0xEAA8 0x6217 +0xEAA9 0x621B +0xEAAA 0x621F +0xEAAB 0x6222 +0xEAAC 0x6221 +0xEAAD 0x6225 +0xEAAE 0x6224 +0xEAAF 0x622C +0xEAB0 0x81E7 +0xEAB1 0x74EF +0xEAB2 0x74F4 +0xEAB3 0x74FF +0xEAB4 0x750F +0xEAB5 0x7511 +0xEAB6 0x7513 +0xEAB7 0x6534 +0xEAB8 0xEABA 0x65EE +0xEABB 0x660A +0xEABC 0x6619 +0xEABD 0x6772 +0xEABE 0x6603 +0xEABF 0x6615 +0xEAC0 0x6600 +0xEAC1 0x7085 +0xEAC2 0x66F7 +0xEAC3 0x661D +0xEAC4 0x6634 +0xEAC5 0x6631 +0xEAC6 0x6636 +0xEAC7 0x6635 +0xEAC8 0x8006 +0xEAC9 0x665F +0xEACA 0x6654 +0xEACB 0x6641 +0xEACC 0x664F +0xEACD 0x6656 +0xEACE 0x6661 +0xEACF 0x6657 +0xEAD0 0x6677 +0xEAD1 0x6684 +0xEAD2 0x668C +0xEAD3 0x66A7 +0xEAD4 0x669D +0xEAD5 0x66BE +0xEAD6 0xEAD7 0x66DB +0xEAD8 0x66E6 +0xEAD9 0x66E9 +0xEADA 0xEADB 0x8D32 +0xEADC 0x8D36 +0xEADD 0x8D3B +0xEADE 0x8D3D +0xEADF 0x8D40 +0xEAE0 0xEAE1 0x8D45 +0xEAE2 0xEAE3 0x8D48 +0xEAE4 0x8D47 +0xEAE5 0x8D4D +0xEAE6 0x8D55 +0xEAE7 0x8D59 +0xEAE8 0x89C7 +0xEAE9 0xEAEB 0x89CA +0xEAEC 0xEAEF 0x89CE +0xEAF0 0x726E +0xEAF1 0x729F +0xEAF2 0x725D +0xEAF3 0x7266 +0xEAF4 0x726F +0xEAF5 0xEAF6 0x727E +0xEAF7 0x7284 +0xEAF8 0x728B +0xEAF9 0x728D +0xEAFA 0x728F +0xEAFB 0x7292 +0xEAFC 0x6308 +0xEAFD 0x6332 +0xEAFE 0x63B0 +0xEB40 0x968C +0xEB41 0x968E +0xEB42 0xEB44 0x9691 +0xEB45 0xEB46 0x9695 +0xEB47 0xEB48 0x969A +0xEB49 0xEB52 0x969D +0xEB53 0xEB5A 0x96A8 +0xEB5B 0xEB5C 0x96B1 +0xEB5D 0xEB5E 0x96B4 +0xEB5F 0xEB60 0x96B7 +0xEB61 0xEB62 0x96BA +0xEB63 0x96BF +0xEB64 0xEB65 0x96C2 +0xEB66 0x96C8 +0xEB67 0xEB68 0x96CA +0xEB69 0xEB6A 0x96D0 +0xEB6B 0xEB6C 0x96D3 +0xEB6D 0xEB76 0x96D6 +0xEB77 0xEB7D 0x96E1 +0xEB7E 0x96EB +0xEB80 0xEB82 0x96EC +0xEB83 0xEB85 0x96F0 +0xEB86 0xEB87 0x96F4 +0xEB88 0x96F8 +0xEB89 0xEB8C 0x96FA +0xEB8D 0x96FF +0xEB8E 0xEB8F 0x9702 +0xEB90 0x9705 +0xEB91 0xEB93 0x970A +0xEB94 0xEB96 0x9710 +0xEB97 0xEB98 0x9714 +0xEB99 0xEB9D 0x9717 +0xEB9E 0x971D +0xEB9F 0xEBA0 0x971F +0xEBA1 0x643F +0xEBA2 0x64D8 +0xEBA3 0x8004 +0xEBA4 0x6BEA +0xEBA5 0x6BF3 +0xEBA6 0x6BFD +0xEBA7 0x6BF5 +0xEBA8 0x6BF9 +0xEBA9 0x6C05 +0xEBAA 0x6C07 +0xEBAB 0x6C06 +0xEBAC 0x6C0D +0xEBAD 0x6C15 +0xEBAE 0xEBB0 0x6C18 +0xEBB1 0x6C21 +0xEBB2 0x6C29 +0xEBB3 0x6C24 +0xEBB4 0x6C2A +0xEBB5 0x6C32 +0xEBB6 0x6535 +0xEBB7 0x6555 +0xEBB8 0x656B +0xEBB9 0x724D +0xEBBA 0x7252 +0xEBBB 0x7256 +0xEBBC 0x7230 +0xEBBD 0x8662 +0xEBBE 0x5216 +0xEBBF 0x809F +0xEBC0 0x809C +0xEBC1 0x8093 +0xEBC2 0x80BC +0xEBC3 0x670A +0xEBC4 0x80BD +0xEBC5 0x80B1 +0xEBC6 0x80AB +0xEBC7 0x80AD +0xEBC8 0x80B4 +0xEBC9 0x80B7 +0xEBCA 0xEBCD 0x80E7 +0xEBCE 0x80DB +0xEBCF 0x80C2 +0xEBD0 0x80C4 +0xEBD1 0x80D9 +0xEBD2 0x80CD +0xEBD3 0x80D7 +0xEBD4 0x6710 +0xEBD5 0x80DD +0xEBD6 0x80EB +0xEBD7 0x80F1 +0xEBD8 0x80F4 +0xEBD9 0x80ED +0xEBDA 0xEBDB 0x810D +0xEBDC 0x80F2 +0xEBDD 0x80FC +0xEBDE 0x6715 +0xEBDF 0x8112 +0xEBE0 0x8C5A +0xEBE1 0x8136 +0xEBE2 0x811E +0xEBE3 0x812C +0xEBE4 0x8118 +0xEBE5 0x8132 +0xEBE6 0x8148 +0xEBE7 0x814C +0xEBE8 0x8153 +0xEBE9 0x8174 +0xEBEA 0xEBEB 0x8159 +0xEBEC 0x8171 +0xEBED 0x8160 +0xEBEE 0x8169 +0xEBEF 0xEBF0 0x817C +0xEBF1 0x816D +0xEBF2 0x8167 +0xEBF3 0x584D +0xEBF4 0x5AB5 +0xEBF5 0x8188 +0xEBF6 0x8182 +0xEBF7 0x8191 +0xEBF8 0x6ED5 +0xEBF9 0x81A3 +0xEBFA 0x81AA +0xEBFB 0x81CC +0xEBFC 0x6726 +0xEBFD 0x81CA +0xEBFE 0x81BB +0xEC40 0xEC48 0x9721 +0xEC49 0xEC4A 0x972B +0xEC4B 0xEC4C 0x972E +0xEC4D 0x9731 +0xEC4E 0xEC52 0x9733 +0xEC53 0xEC56 0x973A +0xEC57 0xEC69 0x973F +0xEC6A 0xEC6B 0x9754 +0xEC6C 0xEC6D 0x9757 +0xEC6E 0x975A +0xEC6F 0xEC70 0x975C +0xEC71 0x975F +0xEC72 0xEC73 0x9763 +0xEC74 0xEC76 0x9766 +0xEC77 0xEC7E 0x976A +0xEC80 0x9772 +0xEC81 0x9775 +0xEC82 0xEC86 0x9777 +0xEC87 0xEC8E 0x977D +0xEC8F 0xEC93 0x9786 +0xEC94 0x978C +0xEC95 0xEC97 0x978E +0xEC98 0x9793 +0xEC99 0xEC9B 0x9795 +0xEC9C 0xECA0 0x9799 +0xECA1 0x81C1 +0xECA2 0x81A6 +0xECA3 0x6B24 +0xECA4 0x6B37 +0xECA5 0x6B39 +0xECA6 0x6B43 +0xECA7 0x6B46 +0xECA8 0x6B59 +0xECA9 0xECAB 0x98D1 +0xECAC 0x98D5 +0xECAD 0xECAE 0x98D9 +0xECAF 0x6BB3 +0xECB0 0x5F40 +0xECB1 0x6BC2 +0xECB2 0x89F3 +0xECB3 0x6590 +0xECB4 0x9F51 +0xECB5 0x6593 +0xECB6 0x65BC +0xECB7 0x65C6 +0xECB8 0x65C4 +0xECB9 0x65C3 +0xECBA 0x65CC +0xECBB 0x65CE +0xECBC 0x65D2 +0xECBD 0x65D6 +0xECBE 0x7080 +0xECBF 0x709C +0xECC0 0x7096 +0xECC1 0x709D +0xECC2 0x70BB +0xECC3 0x70C0 +0xECC4 0x70B7 +0xECC5 0x70AB +0xECC6 0x70B1 +0xECC7 0x70E8 +0xECC8 0x70CA +0xECC9 0x7110 +0xECCA 0x7113 +0xECCB 0x7116 +0xECCC 0x712F +0xECCD 0x7131 +0xECCE 0x7173 +0xECCF 0x715C +0xECD0 0x7168 +0xECD1 0x7145 +0xECD2 0x7172 +0xECD3 0x714A +0xECD4 0x7178 +0xECD5 0x717A +0xECD6 0x7198 +0xECD7 0x71B3 +0xECD8 0x71B5 +0xECD9 0x71A8 +0xECDA 0x71A0 +0xECDB 0x71E0 +0xECDC 0x71D4 +0xECDD 0x71E7 +0xECDE 0x71F9 +0xECDF 0x721D +0xECE0 0x7228 +0xECE1 0x706C +0xECE2 0x7118 +0xECE3 0x7166 +0xECE4 0x71B9 +0xECE5 0x623E +0xECE6 0x623D +0xECE7 0x6243 +0xECE8 0xECE9 0x6248 +0xECEA 0x793B +0xECEB 0x7940 +0xECEC 0x7946 +0xECED 0x7949 +0xECEE 0xECEF 0x795B +0xECF0 0x7953 +0xECF1 0x795A +0xECF2 0x7962 +0xECF3 0x7957 +0xECF4 0x7960 +0xECF5 0x796F +0xECF6 0x7967 +0xECF7 0x797A +0xECF8 0x7985 +0xECF9 0x798A +0xECFA 0x799A +0xECFB 0x79A7 +0xECFC 0x79B3 +0xECFD 0x5FD1 +0xECFE 0x5FD0 +0xED40 0xED41 0x979E +0xED42 0xED43 0x97A1 +0xED44 0xED4A 0x97A4 +0xED4B 0x97AC +0xED4C 0x97AE +0xED4D 0xED4E 0x97B0 +0xED4F 0x97B3 +0xED50 0xED7E 0x97B5 +0xED80 0xED81 0x97E4 +0xED82 0x97E8 +0xED83 0xED87 0x97EE +0xED88 0x97F4 +0xED89 0xEDA0 0x97F7 +0xEDA1 0x603C +0xEDA2 0x605D +0xEDA3 0x605A +0xEDA4 0x6067 +0xEDA5 0x6041 +0xEDA6 0x6059 +0xEDA7 0x6063 +0xEDA8 0x60AB +0xEDA9 0x6106 +0xEDAA 0x610D +0xEDAB 0x615D +0xEDAC 0x61A9 +0xEDAD 0x619D +0xEDAE 0x61CB +0xEDAF 0x61D1 +0xEDB0 0x6206 +0xEDB1 0x8080 +0xEDB2 0x807F +0xEDB3 0x6C93 +0xEDB4 0x6CF6 +0xEDB5 0x6DFC +0xEDB6 0x77F6 +0xEDB7 0x77F8 +0xEDB8 0x7800 +0xEDB9 0x7809 +0xEDBA 0xEDBB 0x7817 +0xEDBC 0x7811 +0xEDBD 0x65AB +0xEDBE 0x782D +0xEDBF 0xEDC0 0x781C +0xEDC1 0xEDC3 0x7839 +0xEDC4 0x781F +0xEDC5 0x783C +0xEDC6 0x7825 +0xEDC7 0x782C +0xEDC8 0x7823 +0xEDC9 0x7829 +0xEDCA 0x784E +0xEDCB 0x786D +0xEDCC 0xEDCD 0x7856 +0xEDCE 0x7826 +0xEDCF 0x7850 +0xEDD0 0x7847 +0xEDD1 0x784C +0xEDD2 0x786A +0xEDD3 0x789B +0xEDD4 0x7893 +0xEDD5 0x789A +0xEDD6 0x7887 +0xEDD7 0x789C +0xEDD8 0x78A1 +0xEDD9 0x78A3 +0xEDDA 0x78B2 +0xEDDB 0x78B9 +0xEDDC 0x78A5 +0xEDDD 0x78D4 +0xEDDE 0x78D9 +0xEDDF 0x78C9 +0xEDE0 0x78EC +0xEDE1 0x78F2 +0xEDE2 0x7905 +0xEDE3 0x78F4 +0xEDE4 0x7913 +0xEDE5 0x7924 +0xEDE6 0x791E +0xEDE7 0x7934 +0xEDE8 0x9F9B +0xEDE9 0x9EF9 +0xEDEA 0xEDEB 0x9EFB +0xEDEC 0x76F1 +0xEDED 0x7704 +0xEDEE 0x770D +0xEDEF 0x76F9 +0xEDF0 0xEDF1 0x7707 +0xEDF2 0x771A +0xEDF3 0x7722 +0xEDF4 0x7719 +0xEDF5 0x772D +0xEDF6 0x7726 +0xEDF7 0x7735 +0xEDF8 0x7738 +0xEDF9 0xEDFA 0x7750 +0xEDFB 0x7747 +0xEDFC 0x7743 +0xEDFD 0x775A +0xEDFE 0x7768 +0xEE40 0xEE7E 0x980F +0xEE80 0xEEA0 0x984E +0xEEA1 0x7762 +0xEEA2 0x7765 +0xEEA3 0x777F +0xEEA4 0x778D +0xEEA5 0x777D +0xEEA6 0x7780 +0xEEA7 0x778C +0xEEA8 0x7791 +0xEEA9 0xEEAA 0x779F +0xEEAB 0x77B0 +0xEEAC 0x77B5 +0xEEAD 0x77BD +0xEEAE 0x753A +0xEEAF 0x7540 +0xEEB0 0x754E +0xEEB1 0x754B +0xEEB2 0x7548 +0xEEB3 0x755B +0xEEB4 0x7572 +0xEEB5 0x7579 +0xEEB6 0x7583 +0xEEB7 0x7F58 +0xEEB8 0x7F61 +0xEEB9 0x7F5F +0xEEBA 0x8A48 +0xEEBB 0x7F68 +0xEEBC 0x7F74 +0xEEBD 0x7F71 +0xEEBE 0x7F79 +0xEEBF 0x7F81 +0xEEC0 0x7F7E +0xEEC1 0x76CD +0xEEC2 0x76E5 +0xEEC3 0x8832 +0xEEC4 0xEEC6 0x9485 +0xEEC7 0x948B +0xEEC8 0x948A +0xEEC9 0xEECA 0x948C +0xEECB 0xEECC 0x948F +0xEECD 0x9494 +0xEECE 0x9497 +0xEECF 0x9495 +0xEED0 0xEED2 0x949A +0xEED3 0xEED4 0x94A3 +0xEED5 0x94AB +0xEED6 0x94AA +0xEED7 0x94AD +0xEED8 0x94AC +0xEED9 0xEEDA 0x94AF +0xEEDB 0x94B2 +0xEEDC 0x94B4 +0xEEDD 0xEEE1 0x94B6 +0xEEE2 0xEEE3 0x94BC +0xEEE4 0x94BF +0xEEE5 0x94C4 +0xEEE6 0xEEEC 0x94C8 +0xEEED 0xEEEF 0x94D0 +0xEEF0 0xEEF2 0x94D5 +0xEEF3 0x94D9 +0xEEF4 0x94D8 +0xEEF5 0x94DB +0xEEF6 0xEEF8 0x94DE +0xEEF9 0x94E2 +0xEEFA 0xEEFB 0x94E4 +0xEEFC 0xEEFD 0x94E7 +0xEEFE 0x94EA +0xEF40 0xEF45 0x986F +0xEF46 0x988B +0xEF47 0x988E +0xEF48 0x9892 +0xEF49 0x9895 +0xEF4A 0x9899 +0xEF4B 0x98A3 +0xEF4C 0xEF71 0x98A8 +0xEF72 0xEF73 0x98CF +0xEF74 0x98D4 +0xEF75 0xEF76 0x98D6 +0xEF77 0xEF79 0x98DB +0xEF7A 0xEF7E 0x98E0 +0xEF80 0xEF81 0x98E5 +0xEF82 0xEFA0 0x98E9 +0xEFA1 0x94E9 +0xEFA2 0x94EB +0xEFA3 0xEFA4 0x94EE +0xEFA5 0xEFA7 0x94F3 +0xEFA8 0x94F7 +0xEFA9 0x94F9 +0xEFAA 0xEFAB 0x94FC +0xEFAC 0x94FF +0xEFAD 0x9503 +0xEFAE 0x9502 +0xEFAF 0xEFB0 0x9506 +0xEFB1 0xEFB2 0x9509 +0xEFB3 0xEFB5 0x950D +0xEFB6 0xEFBA 0x9512 +0xEFBB 0x9518 +0xEFBC 0x951B +0xEFBD 0xEFBF 0x951D +0xEFC0 0x9522 +0xEFC1 0xEFC2 0x952A +0xEFC3 0x9529 +0xEFC4 0x952C +0xEFC5 0xEFC6 0x9531 +0xEFC7 0x9534 +0xEFC8 0xEFCA 0x9536 +0xEFCB 0x953C +0xEFCC 0xEFCD 0x953E +0xEFCE 0x9542 +0xEFCF 0x9535 +0xEFD0 0xEFD2 0x9544 +0xEFD3 0x9549 +0xEFD4 0x954C +0xEFD5 0xEFD6 0x954E +0xEFD7 0xEFD9 0x9552 +0xEFDA 0xEFDD 0x9556 +0xEFDE 0x955B +0xEFDF 0xEFE0 0x955E +0xEFE1 0x955D +0xEFE2 0xEFE3 0x9561 +0xEFE4 0xEFEC 0x9564 +0xEFED 0x956F +0xEFEE 0xEFF0 0x9571 +0xEFF1 0x953A +0xEFF2 0x77E7 +0xEFF3 0x77EC +0xEFF4 0x96C9 +0xEFF5 0x79D5 +0xEFF6 0x79ED +0xEFF7 0x79E3 +0xEFF8 0x79EB +0xEFF9 0x7A06 +0xEFFA 0x5D47 +0xEFFB 0x7A03 +0xEFFC 0x7A02 +0xEFFD 0x7A1E +0xEFFE 0x7A14 +0xF040 0xF044 0x9908 +0xF045 0xF046 0x990E +0xF047 0xF063 0x9911 +0xF064 0xF07E 0x992F +0xF080 0xF089 0x994A +0xF08A 0xF096 0x9956 +0xF097 0x9964 +0xF098 0x9966 +0xF099 0x9973 +0xF09A 0xF09B 0x9978 +0xF09C 0x997B +0xF09D 0x997E +0xF09E 0xF09F 0x9982 +0xF0A0 0x9989 +0xF0A1 0x7A39 +0xF0A2 0x7A37 +0xF0A3 0x7A51 +0xF0A4 0x9ECF +0xF0A5 0x99A5 +0xF0A6 0x7A70 +0xF0A7 0x7688 +0xF0A8 0x768E +0xF0A9 0x7693 +0xF0AA 0x7699 +0xF0AB 0x76A4 +0xF0AC 0x74DE +0xF0AD 0x74E0 +0xF0AE 0x752C +0xF0AF 0x9E20 +0xF0B0 0x9E22 +0xF0B1 0xF0B5 0x9E28 +0xF0B6 0x9E32 +0xF0B7 0x9E31 +0xF0B8 0x9E36 +0xF0B9 0x9E38 +0xF0BA 0x9E37 +0xF0BB 0xF0BC 0x9E39 +0xF0BD 0x9E3E +0xF0BE 0xF0BF 0x9E41 +0xF0C0 0x9E44 +0xF0C1 0xF0C4 0x9E46 +0xF0C5 0xF0C6 0x9E4B +0xF0C7 0x9E4E +0xF0C8 0x9E51 +0xF0C9 0x9E55 +0xF0CA 0x9E57 +0xF0CB 0xF0CD 0x9E5A +0xF0CE 0x9E5E +0xF0CF 0x9E63 +0xF0D0 0xF0D6 0x9E66 +0xF0D7 0x9E71 +0xF0D8 0x9E6D +0xF0D9 0x9E73 +0xF0DA 0x7592 +0xF0DB 0x7594 +0xF0DC 0x7596 +0xF0DD 0x75A0 +0xF0DE 0x759D +0xF0DF 0x75AC +0xF0E0 0x75A3 +0xF0E1 0xF0E2 0x75B3 +0xF0E3 0x75B8 +0xF0E4 0x75C4 +0xF0E5 0x75B1 +0xF0E6 0x75B0 +0xF0E7 0x75C3 +0xF0E8 0x75C2 +0xF0E9 0x75D6 +0xF0EA 0x75CD +0xF0EB 0x75E3 +0xF0EC 0x75E8 +0xF0ED 0x75E6 +0xF0EE 0x75E4 +0xF0EF 0x75EB +0xF0F0 0x75E7 +0xF0F1 0x7603 +0xF0F2 0x75F1 +0xF0F3 0x75FC +0xF0F4 0x75FF +0xF0F5 0x7610 +0xF0F6 0x7600 +0xF0F7 0x7605 +0xF0F8 0x760C +0xF0F9 0x7617 +0xF0FA 0x760A +0xF0FB 0x7625 +0xF0FC 0x7618 +0xF0FD 0x7615 +0xF0FE 0x7619 +0xF140 0x998C +0xF141 0x998E +0xF142 0xF14C 0x999A +0xF14D 0xF14E 0x99A6 +0xF14F 0xF17E 0x99A9 +0xF180 0xF1A0 0x99D9 +0xF1A1 0x761B +0xF1A2 0x763C +0xF1A3 0x7622 +0xF1A4 0x7620 +0xF1A5 0x7640 +0xF1A6 0x762D +0xF1A7 0x7630 +0xF1A8 0x763F +0xF1A9 0x7635 +0xF1AA 0x7643 +0xF1AB 0x763E +0xF1AC 0x7633 +0xF1AD 0x764D +0xF1AE 0x765E +0xF1AF 0x7654 +0xF1B0 0x765C +0xF1B1 0x7656 +0xF1B2 0x766B +0xF1B3 0x766F +0xF1B4 0x7FCA +0xF1B5 0x7AE6 +0xF1B6 0xF1B7 0x7A78 +0xF1B8 0x7A80 +0xF1B9 0x7A86 +0xF1BA 0x7A88 +0xF1BB 0x7A95 +0xF1BC 0x7AA6 +0xF1BD 0x7AA0 +0xF1BE 0x7AAC +0xF1BF 0x7AA8 +0xF1C0 0x7AAD +0xF1C1 0x7AB3 +0xF1C2 0x8864 +0xF1C3 0x8869 +0xF1C4 0x8872 +0xF1C5 0x887D +0xF1C6 0x887F +0xF1C7 0x8882 +0xF1C8 0x88A2 +0xF1C9 0x88C6 +0xF1CA 0x88B7 +0xF1CB 0x88BC +0xF1CC 0x88C9 +0xF1CD 0x88E2 +0xF1CE 0x88CE +0xF1CF 0x88E3 +0xF1D0 0x88E5 +0xF1D1 0x88F1 +0xF1D2 0x891A +0xF1D3 0x88FC +0xF1D4 0x88E8 +0xF1D5 0x88FE +0xF1D6 0x88F0 +0xF1D7 0x8921 +0xF1D8 0x8919 +0xF1D9 0x8913 +0xF1DA 0x891B +0xF1DB 0x890A +0xF1DC 0x8934 +0xF1DD 0x892B +0xF1DE 0x8936 +0xF1DF 0x8941 +0xF1E0 0x8966 +0xF1E1 0x897B +0xF1E2 0x758B +0xF1E3 0x80E5 +0xF1E4 0x76B2 +0xF1E5 0x76B4 +0xF1E6 0x77DC +0xF1E7 0x8012 +0xF1E8 0x8014 +0xF1E9 0x8016 +0xF1EA 0x801C +0xF1EB 0x8020 +0xF1EC 0x8022 +0xF1ED 0xF1EF 0x8025 +0xF1F0 0x8029 +0xF1F1 0x8028 +0xF1F2 0x8031 +0xF1F3 0x800B +0xF1F4 0x8035 +0xF1F5 0x8043 +0xF1F6 0x8046 +0xF1F7 0x804D +0xF1F8 0x8052 +0xF1F9 0x8069 +0xF1FA 0x8071 +0xF1FB 0x8983 +0xF1FC 0x9878 +0xF1FD 0x9880 +0xF1FE 0x9883 +0xF240 0xF27E 0x99FA +0xF280 0xF2A0 0x9A39 +0xF2A1 0x9889 +0xF2A2 0xF2A3 0x988C +0xF2A4 0x988F +0xF2A5 0x9894 +0xF2A6 0xF2A7 0x989A +0xF2A8 0xF2A9 0x989E +0xF2AA 0xF2AB 0x98A1 +0xF2AC 0xF2AD 0x98A5 +0xF2AE 0x864D +0xF2AF 0x8654 +0xF2B0 0x866C +0xF2B1 0x866E +0xF2B2 0x867F +0xF2B3 0x867A +0xF2B4 0x867C +0xF2B5 0x867B +0xF2B6 0x86A8 +0xF2B7 0x868D +0xF2B8 0x868B +0xF2B9 0x86AC +0xF2BA 0x869D +0xF2BB 0x86A7 +0xF2BC 0x86A3 +0xF2BD 0x86AA +0xF2BE 0x8693 +0xF2BF 0x86A9 +0xF2C0 0x86B6 +0xF2C1 0x86C4 +0xF2C2 0x86B5 +0xF2C3 0x86CE +0xF2C4 0x86B0 +0xF2C5 0x86BA +0xF2C6 0x86B1 +0xF2C7 0x86AF +0xF2C8 0x86C9 +0xF2C9 0x86CF +0xF2CA 0x86B4 +0xF2CB 0x86E9 +0xF2CC 0xF2CD 0x86F1 +0xF2CE 0x86ED +0xF2CF 0x86F3 +0xF2D0 0x86D0 +0xF2D1 0x8713 +0xF2D2 0x86DE +0xF2D3 0x86F4 +0xF2D4 0x86DF +0xF2D5 0x86D8 +0xF2D6 0x86D1 +0xF2D7 0x8703 +0xF2D8 0x8707 +0xF2D9 0x86F8 +0xF2DA 0x8708 +0xF2DB 0x870A +0xF2DC 0x870D +0xF2DD 0x8709 +0xF2DE 0x8723 +0xF2DF 0x873B +0xF2E0 0x871E +0xF2E1 0x8725 +0xF2E2 0x872E +0xF2E3 0x871A +0xF2E4 0x873E +0xF2E5 0x8748 +0xF2E6 0x8734 +0xF2E7 0x8731 +0xF2E8 0x8729 +0xF2E9 0x8737 +0xF2EA 0x873F +0xF2EB 0x8782 +0xF2EC 0x8722 +0xF2ED 0xF2EE 0x877D +0xF2EF 0x877B +0xF2F0 0x8760 +0xF2F1 0x8770 +0xF2F2 0x874C +0xF2F3 0x876E +0xF2F4 0x878B +0xF2F5 0x8753 +0xF2F6 0x8763 +0xF2F7 0x877C +0xF2F8 0x8764 +0xF2F9 0x8759 +0xF2FA 0x8765 +0xF2FB 0x8793 +0xF2FC 0x87AF +0xF2FD 0x87A8 +0xF2FE 0x87D2 +0xF340 0xF351 0x9A5A +0xF352 0x9A72 +0xF353 0x9A83 +0xF354 0x9A89 +0xF355 0xF356 0x9A8D +0xF357 0xF358 0x9A94 +0xF359 0x9A99 +0xF35A 0x9AA6 +0xF35B 0xF361 0x9AA9 +0xF362 0xF365 0x9AB2 +0xF366 0x9AB9 +0xF367 0x9ABB +0xF368 0xF36A 0x9ABD +0xF36B 0xF36C 0x9AC3 +0xF36D 0xF371 0x9AC6 +0xF372 0xF375 0x9ACD +0xF376 0x9AD2 +0xF377 0xF37A 0x9AD4 +0xF37B 0xF37E 0x9AD9 +0xF380 0xF381 0x9ADD +0xF382 0x9AE0 +0xF383 0xF386 0x9AE2 +0xF387 0xF38A 0x9AE7 +0xF38B 0x9AEC +0xF38C 0x9AEE +0xF38D 0xF395 0x9AF0 +0xF396 0x9AFA +0xF397 0xF39D 0x9AFC +0xF39E 0xF3A0 0x9B04 +0xF3A1 0x87C6 +0xF3A2 0x8788 +0xF3A3 0x8785 +0xF3A4 0x87AD +0xF3A5 0x8797 +0xF3A6 0x8783 +0xF3A7 0x87AB +0xF3A8 0x87E5 +0xF3A9 0x87AC +0xF3AA 0x87B5 +0xF3AB 0x87B3 +0xF3AC 0x87CB +0xF3AD 0x87D3 +0xF3AE 0x87BD +0xF3AF 0x87D1 +0xF3B0 0x87C0 +0xF3B1 0x87CA +0xF3B2 0x87DB +0xF3B3 0x87EA +0xF3B4 0x87E0 +0xF3B5 0x87EE +0xF3B6 0x8816 +0xF3B7 0x8813 +0xF3B8 0x87FE +0xF3B9 0x880A +0xF3BA 0x881B +0xF3BB 0x8821 +0xF3BC 0x8839 +0xF3BD 0x883C +0xF3BE 0x7F36 +0xF3BF 0x7F42 +0xF3C0 0xF3C1 0x7F44 +0xF3C2 0x8210 +0xF3C3 0x7AFA +0xF3C4 0x7AFD +0xF3C5 0x7B08 +0xF3C6 0xF3C7 0x7B03 +0xF3C8 0x7B15 +0xF3C9 0x7B0A +0xF3CA 0x7B2B +0xF3CB 0x7B0F +0xF3CC 0x7B47 +0xF3CD 0x7B38 +0xF3CE 0x7B2A +0xF3CF 0x7B19 +0xF3D0 0x7B2E +0xF3D1 0x7B31 +0xF3D2 0x7B20 +0xF3D3 0x7B25 +0xF3D4 0x7B24 +0xF3D5 0x7B33 +0xF3D6 0x7B3E +0xF3D7 0x7B1E +0xF3D8 0x7B58 +0xF3D9 0x7B5A +0xF3DA 0x7B45 +0xF3DB 0x7B75 +0xF3DC 0x7B4C +0xF3DD 0x7B5D +0xF3DE 0x7B60 +0xF3DF 0x7B6E +0xF3E0 0x7B7B +0xF3E1 0x7B62 +0xF3E2 0x7B72 +0xF3E3 0x7B71 +0xF3E4 0x7B90 +0xF3E5 0xF3E6 0x7BA6 +0xF3E7 0x7BB8 +0xF3E8 0x7BAC +0xF3E9 0x7B9D +0xF3EA 0x7BA8 +0xF3EB 0x7B85 +0xF3EC 0x7BAA +0xF3ED 0x7B9C +0xF3EE 0x7BA2 +0xF3EF 0x7BAB +0xF3F0 0x7BB4 +0xF3F1 0x7BD1 +0xF3F2 0x7BC1 +0xF3F3 0x7BCC +0xF3F4 0x7BDD +0xF3F5 0x7BDA +0xF3F6 0xF3F7 0x7BE5 +0xF3F8 0x7BEA +0xF3F9 0x7C0C +0xF3FA 0x7BFE +0xF3FB 0x7BFC +0xF3FC 0x7C0F +0xF3FD 0x7C16 +0xF3FE 0x7C0B +0xF440 0x9B07 +0xF441 0xF446 0x9B09 +0xF447 0xF449 0x9B10 +0xF44A 0xF454 0x9B14 +0xF455 0xF457 0x9B20 +0xF458 0xF462 0x9B24 +0xF463 0xF464 0x9B30 +0xF465 0xF46C 0x9B33 +0xF46D 0xF470 0x9B3D +0xF471 0x9B46 +0xF472 0xF474 0x9B4A +0xF475 0x9B4E +0xF476 0x9B50 +0xF477 0xF478 0x9B52 +0xF479 0xF47E 0x9B55 +0xF480 0xF4A0 0x9B5B +0xF4A1 0x7C1F +0xF4A2 0x7C2A +0xF4A3 0x7C26 +0xF4A4 0x7C38 +0xF4A5 0x7C41 +0xF4A6 0x7C40 +0xF4A7 0x81FE +0xF4A8 0xF4A9 0x8201 +0xF4AA 0x8204 +0xF4AB 0x81EC +0xF4AC 0x8844 +0xF4AD 0xF4AF 0x8221 +0xF4B0 0x822D +0xF4B1 0x822F +0xF4B2 0x8228 +0xF4B3 0x822B +0xF4B4 0x8238 +0xF4B5 0x823B +0xF4B6 0xF4B7 0x8233 +0xF4B8 0x823E +0xF4B9 0x8244 +0xF4BA 0x8249 +0xF4BB 0x824B +0xF4BC 0x824F +0xF4BD 0x825A +0xF4BE 0x825F +0xF4BF 0x8268 +0xF4C0 0x887E +0xF4C1 0x8885 +0xF4C2 0x8888 +0xF4C3 0x88D8 +0xF4C4 0x88DF +0xF4C5 0x895E +0xF4C6 0x7F9D +0xF4C7 0x7F9F +0xF4C8 0x7FA7 +0xF4C9 0xF4CA 0x7FAF +0xF4CB 0x7FB2 +0xF4CC 0x7C7C +0xF4CD 0x6549 +0xF4CE 0x7C91 +0xF4CF 0x7C9D +0xF4D0 0x7C9C +0xF4D1 0x7C9E +0xF4D2 0x7CA2 +0xF4D3 0x7CB2 +0xF4D4 0xF4D5 0x7CBC +0xF4D6 0x7CC1 +0xF4D7 0x7CC7 +0xF4D8 0xF4D9 0x7CCC +0xF4DA 0x7CC8 +0xF4DB 0x7CC5 +0xF4DC 0x7CD7 +0xF4DD 0x7CE8 +0xF4DE 0x826E +0xF4DF 0x66A8 +0xF4E0 0x7FBF +0xF4E1 0x7FCE +0xF4E2 0x7FD5 +0xF4E3 0x7FE5 +0xF4E4 0x7FE1 +0xF4E5 0x7FE6 +0xF4E6 0x7FE9 +0xF4E7 0x7FEE +0xF4E8 0x7FF3 +0xF4E9 0x7CF8 +0xF4EA 0x7D77 +0xF4EB 0x7DA6 +0xF4EC 0x7DAE +0xF4ED 0x7E47 +0xF4EE 0x7E9B +0xF4EF 0x9EB8 +0xF4F0 0x9EB4 +0xF4F1 0x8D73 +0xF4F2 0x8D84 +0xF4F3 0x8D94 +0xF4F4 0x8D91 +0xF4F5 0x8DB1 +0xF4F6 0x8D67 +0xF4F7 0x8D6D +0xF4F8 0x8C47 +0xF4F9 0x8C49 +0xF4FA 0x914A +0xF4FB 0x9150 +0xF4FC 0xF4FD 0x914E +0xF4FE 0x9164 +0xF540 0xF57E 0x9B7C +0xF580 0xF5A0 0x9BBB +0xF5A1 0x9162 +0xF5A2 0x9161 +0xF5A3 0x9170 +0xF5A4 0x9169 +0xF5A5 0x916F +0xF5A6 0xF5A7 0x917D +0xF5A8 0x9172 +0xF5A9 0x9174 +0xF5AA 0x9179 +0xF5AB 0x918C +0xF5AC 0x9185 +0xF5AD 0x9190 +0xF5AE 0x918D +0xF5AF 0x9191 +0xF5B0 0xF5B1 0x91A2 +0xF5B2 0x91AA +0xF5B3 0xF5B5 0x91AD +0xF5B6 0x91B5 +0xF5B7 0x91B4 +0xF5B8 0x91BA +0xF5B9 0x8C55 +0xF5BA 0x9E7E +0xF5BB 0x8DB8 +0xF5BC 0x8DEB +0xF5BD 0x8E05 +0xF5BE 0x8E59 +0xF5BF 0x8E69 +0xF5C0 0x8DB5 +0xF5C1 0x8DBF +0xF5C2 0x8DBC +0xF5C3 0x8DBA +0xF5C4 0x8DC4 +0xF5C5 0xF5C6 0x8DD6 +0xF5C7 0x8DDA +0xF5C8 0x8DDE +0xF5C9 0xF5CA 0x8DCE +0xF5CB 0x8DDB +0xF5CC 0x8DC6 +0xF5CD 0x8DEC +0xF5CE 0xF5CF 0x8DF7 +0xF5D0 0x8DE3 +0xF5D1 0x8DF9 +0xF5D2 0x8DFB +0xF5D3 0x8DE4 +0xF5D4 0x8E09 +0xF5D5 0x8DFD +0xF5D6 0x8E14 +0xF5D7 0x8E1D +0xF5D8 0x8E1F +0xF5D9 0x8E2C +0xF5DA 0x8E2E +0xF5DB 0x8E23 +0xF5DC 0x8E2F +0xF5DD 0x8E3A +0xF5DE 0x8E40 +0xF5DF 0x8E39 +0xF5E0 0x8E35 +0xF5E1 0x8E3D +0xF5E2 0x8E31 +0xF5E3 0x8E49 +0xF5E4 0xF5E5 0x8E41 +0xF5E6 0xF5E7 0x8E51 +0xF5E8 0x8E4A +0xF5E9 0x8E70 +0xF5EA 0x8E76 +0xF5EB 0x8E7C +0xF5EC 0x8E6F +0xF5ED 0x8E74 +0xF5EE 0x8E85 +0xF5EF 0x8E8F +0xF5F0 0x8E94 +0xF5F1 0x8E90 +0xF5F2 0x8E9C +0xF5F3 0x8E9E +0xF5F4 0x8C78 +0xF5F5 0x8C82 +0xF5F6 0x8C8A +0xF5F7 0x8C85 +0xF5F8 0x8C98 +0xF5F9 0x8C94 +0xF5FA 0x659B +0xF5FB 0x89D6 +0xF5FC 0x89DE +0xF5FD 0x89DA +0xF5FE 0x89DC +0xF640 0xF67E 0x9BDC +0xF680 0xF6A0 0x9C1B +0xF6A1 0x89E5 +0xF6A2 0x89EB +0xF6A3 0x89EF +0xF6A4 0x8A3E +0xF6A5 0x8B26 +0xF6A6 0x9753 +0xF6A7 0x96E9 +0xF6A8 0x96F3 +0xF6A9 0x96EF +0xF6AA 0x9706 +0xF6AB 0x9701 +0xF6AC 0x9708 +0xF6AD 0x970F +0xF6AE 0x970E +0xF6AF 0x972A +0xF6B0 0x972D +0xF6B1 0x9730 +0xF6B2 0x973E +0xF6B3 0x9F80 +0xF6B4 0x9F83 +0xF6B5 0xF6BA 0x9F85 +0xF6BB 0x9F8C +0xF6BC 0x9EFE +0xF6BD 0x9F0B +0xF6BE 0x9F0D +0xF6BF 0x96B9 +0xF6C0 0xF6C1 0x96BC +0xF6C2 0x96CE +0xF6C3 0x96D2 +0xF6C4 0x77BF +0xF6C5 0x96E0 +0xF6C6 0x928E +0xF6C7 0x92AE +0xF6C8 0x92C8 +0xF6C9 0x933E +0xF6CA 0x936A +0xF6CB 0x93CA +0xF6CC 0x938F +0xF6CD 0x943E +0xF6CE 0x946B +0xF6CF 0x9C7F +0xF6D0 0x9C82 +0xF6D1 0xF6D4 0x9C85 +0xF6D5 0x7A23 +0xF6D6 0x9C8B +0xF6D7 0x9C8E +0xF6D8 0xF6DA 0x9C90 +0xF6DB 0xF6DC 0x9C94 +0xF6DD 0xF6DE 0x9C9A +0xF6DF 0xF6E4 0x9C9E +0xF6E5 0xF6E9 0x9CA5 +0xF6EA 0x9CAB +0xF6EB 0xF6EC 0x9CAD +0xF6ED 0xF6F4 0x9CB0 +0xF6F5 0xF6F8 0x9CBA +0xF6F9 0xF6FC 0x9CC4 +0xF6FD 0xF6FE 0x9CCA +0xF740 0xF77E 0x9C3C +0xF780 0x9C7B +0xF781 0xF782 0x9C7D +0xF783 0x9C80 +0xF784 0xF785 0x9C83 +0xF786 0xF787 0x9C89 +0xF788 0x9C8C +0xF789 0x9C8F +0xF78A 0x9C93 +0xF78B 0xF78E 0x9C96 +0xF78F 0x9C9D +0xF790 0x9CAA +0xF791 0x9CAC +0xF792 0x9CAF +0xF793 0x9CB9 +0xF794 0xF798 0x9CBE +0xF799 0xF79A 0x9CC8 +0xF79B 0xF79C 0x9CD1 +0xF79D 0xF79E 0x9CDA +0xF79F 0xF7A0 0x9CE0 +0xF7A1 0xF7A5 0x9CCC +0xF7A6 0xF7A8 0x9CD3 +0xF7A9 0xF7AB 0x9CD7 +0xF7AC 0xF7AD 0x9CDC +0xF7AE 0x9CDF +0xF7AF 0x9CE2 +0xF7B0 0x977C +0xF7B1 0x9785 +0xF7B2 0xF7B3 0x9791 +0xF7B4 0x9794 +0xF7B5 0x97AF +0xF7B6 0x97AB +0xF7B7 0x97A3 +0xF7B8 0x97B2 +0xF7B9 0x97B4 +0xF7BA 0x9AB1 +0xF7BB 0x9AB0 +0xF7BC 0x9AB7 +0xF7BD 0x9E58 +0xF7BE 0x9AB6 +0xF7BF 0x9ABA +0xF7C0 0x9ABC +0xF7C1 0x9AC1 +0xF7C2 0x9AC0 +0xF7C3 0x9AC5 +0xF7C4 0x9AC2 +0xF7C5 0xF7C6 0x9ACB +0xF7C7 0x9AD1 +0xF7C8 0x9B45 +0xF7C9 0x9B43 +0xF7CA 0x9B47 +0xF7CB 0x9B49 +0xF7CC 0x9B48 +0xF7CD 0x9B4D +0xF7CE 0x9B51 +0xF7CF 0x98E8 +0xF7D0 0x990D +0xF7D1 0x992E +0xF7D2 0x9955 +0xF7D3 0x9954 +0xF7D4 0x9ADF +0xF7D5 0x9AE1 +0xF7D6 0x9AE6 +0xF7D7 0x9AEF +0xF7D8 0x9AEB +0xF7D9 0x9AFB +0xF7DA 0x9AED +0xF7DB 0x9AF9 +0xF7DC 0x9B08 +0xF7DD 0x9B0F +0xF7DE 0x9B13 +0xF7DF 0x9B1F +0xF7E0 0x9B23 +0xF7E1 0xF7E2 0x9EBD +0xF7E3 0x7E3B +0xF7E4 0x9E82 +0xF7E5 0xF7E6 0x9E87 +0xF7E7 0x9E8B +0xF7E8 0x9E92 +0xF7E9 0x93D6 +0xF7EA 0x9E9D +0xF7EB 0x9E9F +0xF7EC 0xF7EE 0x9EDB +0xF7EF 0x9EE0 +0xF7F0 0x9EDF +0xF7F1 0x9EE2 +0xF7F2 0x9EE9 +0xF7F3 0x9EE7 +0xF7F4 0x9EE5 +0xF7F5 0x9EEA +0xF7F6 0x9EEF +0xF7F7 0x9F22 +0xF7F8 0x9F2C +0xF7F9 0x9F2F +0xF7FA 0x9F39 +0xF7FB 0x9F37 +0xF7FC 0xF7FD 0x9F3D +0xF7FE 0x9F44 +0xF840 0xF87E 0x9CE3 +0xF880 0xF8A0 0x9D22 +0xF8A1 0x3000 +0xF8A2 0x3000 +0xF8A3 0x3000 +0xF8A4 0x3000 +0xF8A5 0x3000 +0xF8A6 0x3000 +0xF8A7 0x3000 +0xF8A8 0x3000 +0xF8A9 0x3000 +0xF8AA 0x3000 +0xF8AB 0x3000 +0xF8AC 0x3000 +0xF8AD 0x3000 +0xF8AE 0x3000 +0xF8AF 0x3000 +0xF8B0 0x3000 +0xF8B1 0x3000 +0xF8B2 0x3000 +0xF8B3 0x3000 +0xF8B4 0x3000 +0xF8B5 0x3000 +0xF8B6 0x3000 +0xF8B7 0x3000 +0xF8B8 0x3000 +0xF8B9 0x3000 +0xF8BA 0x3000 +0xF8BB 0x3000 +0xF8BC 0x3000 +0xF8BD 0x3000 +0xF8BE 0x3000 +0xF8BF 0x3000 +0xF8C0 0x3000 +0xF8C1 0x3000 +0xF8C2 0x3000 +0xF8C3 0x3000 +0xF8C4 0x3000 +0xF8C5 0x3000 +0xF8C6 0x3000 +0xF8C7 0x3000 +0xF8C8 0x3000 +0xF8C9 0x3000 +0xF8CA 0x3000 +0xF8CB 0x3000 +0xF8CC 0x3000 +0xF8CD 0x3000 +0xF8CE 0x3000 +0xF8CF 0x3000 +0xF8D0 0x3000 +0xF8D1 0x3000 +0xF8D2 0x3000 +0xF8D3 0x3000 +0xF8D4 0x3000 +0xF8D5 0x3000 +0xF8D6 0x3000 +0xF8D7 0x3000 +0xF8D8 0x3000 +0xF8D9 0x3000 +0xF8DA 0x3000 +0xF8DB 0x3000 +0xF8DC 0x3000 +0xF8DD 0x3000 +0xF8DE 0x3000 +0xF8DF 0x3000 +0xF8E0 0x3000 +0xF8E1 0x3000 +0xF8E2 0x3000 +0xF8E3 0x3000 +0xF8E4 0x3000 +0xF8E5 0x3000 +0xF8E6 0x3000 +0xF8E7 0x3000 +0xF8E8 0x3000 +0xF8E9 0x3000 +0xF8EA 0x3000 +0xF8EB 0x3000 +0xF8EC 0x3000 +0xF8ED 0x3000 +0xF8EE 0x3000 +0xF8EF 0x3000 +0xF8F0 0x3000 +0xF8F1 0x3000 +0xF8F2 0x3000 +0xF8F3 0x3000 +0xF8F4 0x3000 +0xF8F5 0x3000 +0xF8F6 0x3000 +0xF8F7 0x3000 +0xF8F8 0x3000 +0xF8F9 0x3000 +0xF8FA 0x3000 +0xF8FB 0x3000 +0xF8FC 0x3000 +0xF8FD 0x3000 +0xF8FE 0x3000 +0xF940 0xF97E 0x9D43 +0xF980 0xF9A0 0x9D82 +0xF9A1 0x3000 +0xF9A2 0x3000 +0xF9A3 0x3000 +0xF9A4 0x3000 +0xF9A5 0x3000 +0xF9A6 0x3000 +0xF9A7 0x3000 +0xF9A8 0x3000 +0xF9A9 0x3000 +0xF9AA 0x3000 +0xF9AB 0x3000 +0xF9AC 0x3000 +0xF9AD 0x3000 +0xF9AE 0x3000 +0xF9AF 0x3000 +0xF9B0 0x3000 +0xF9B1 0x3000 +0xF9B2 0x3000 +0xF9B3 0x3000 +0xF9B4 0x3000 +0xF9B5 0x3000 +0xF9B6 0x3000 +0xF9B7 0x3000 +0xF9B8 0x3000 +0xF9B9 0x3000 +0xF9BA 0x3000 +0xF9BB 0x3000 +0xF9BC 0x3000 +0xF9BD 0x3000 +0xF9BE 0x3000 +0xF9BF 0x3000 +0xF9C0 0x3000 +0xF9C1 0x3000 +0xF9C2 0x3000 +0xF9C3 0x3000 +0xF9C4 0x3000 +0xF9C5 0x3000 +0xF9C6 0x3000 +0xF9C7 0x3000 +0xF9C8 0x3000 +0xF9C9 0x3000 +0xF9CA 0x3000 +0xF9CB 0x3000 +0xF9CC 0x3000 +0xF9CD 0x3000 +0xF9CE 0x3000 +0xF9CF 0x3000 +0xF9D0 0x3000 +0xF9D1 0x3000 +0xF9D2 0x3000 +0xF9D3 0x3000 +0xF9D4 0x3000 +0xF9D5 0x3000 +0xF9D6 0x3000 +0xF9D7 0x3000 +0xF9D8 0x3000 +0xF9D9 0x3000 +0xF9DA 0x3000 +0xF9DB 0x3000 +0xF9DC 0x3000 +0xF9DD 0x3000 +0xF9DE 0x3000 +0xF9DF 0x3000 +0xF9E0 0x3000 +0xF9E1 0x3000 +0xF9E2 0x3000 +0xF9E3 0x3000 +0xF9E4 0x3000 +0xF9E5 0x3000 +0xF9E6 0x3000 +0xF9E7 0x3000 +0xF9E8 0x3000 +0xF9E9 0x3000 +0xF9EA 0x3000 +0xF9EB 0x3000 +0xF9EC 0x3000 +0xF9ED 0x3000 +0xF9EE 0x3000 +0xF9EF 0x3000 +0xF9F0 0x3000 +0xF9F1 0x3000 +0xF9F2 0x3000 +0xF9F3 0x3000 +0xF9F4 0x3000 +0xF9F5 0x3000 +0xF9F6 0x3000 +0xF9F7 0x3000 +0xF9F8 0x3000 +0xF9F9 0x3000 +0xF9FA 0x3000 +0xF9FB 0x3000 +0xF9FC 0x3000 +0xF9FD 0x3000 +0xF9FE 0x3000 +0xFA40 0xFA7E 0x9DA3 +0xFA80 0xFAA0 0x9DE2 +0xFAA1 0x3000 +0xFAA2 0x3000 +0xFAA3 0x3000 +0xFAA4 0x3000 +0xFAA5 0x3000 +0xFAA6 0x3000 +0xFAA7 0x3000 +0xFAA8 0x3000 +0xFAA9 0x3000 +0xFAAA 0x3000 +0xFAAB 0x3000 +0xFAAC 0x3000 +0xFAAD 0x3000 +0xFAAE 0x3000 +0xFAAF 0x3000 +0xFAB0 0x3000 +0xFAB1 0x3000 +0xFAB2 0x3000 +0xFAB3 0x3000 +0xFAB4 0x3000 +0xFAB5 0x3000 +0xFAB6 0x3000 +0xFAB7 0x3000 +0xFAB8 0x3000 +0xFAB9 0x3000 +0xFABA 0x3000 +0xFABB 0x3000 +0xFABC 0x3000 +0xFABD 0x3000 +0xFABE 0x3000 +0xFABF 0x3000 +0xFAC0 0x3000 +0xFAC1 0x3000 +0xFAC2 0x3000 +0xFAC3 0x3000 +0xFAC4 0x3000 +0xFAC5 0x3000 +0xFAC6 0x3000 +0xFAC7 0x3000 +0xFAC8 0x3000 +0xFAC9 0x3000 +0xFACA 0x3000 +0xFACB 0x3000 +0xFACC 0x3000 +0xFACD 0x3000 +0xFACE 0x3000 +0xFACF 0x3000 +0xFAD0 0x3000 +0xFAD1 0x3000 +0xFAD2 0x3000 +0xFAD3 0x3000 +0xFAD4 0x3000 +0xFAD5 0x3000 +0xFAD6 0x3000 +0xFAD7 0x3000 +0xFAD8 0x3000 +0xFAD9 0x3000 +0xFADA 0x3000 +0xFADB 0x3000 +0xFADC 0x3000 +0xFADD 0x3000 +0xFADE 0x3000 +0xFADF 0x3000 +0xFAE0 0x3000 +0xFAE1 0x3000 +0xFAE2 0x3000 +0xFAE3 0x3000 +0xFAE4 0x3000 +0xFAE5 0x3000 +0xFAE6 0x3000 +0xFAE7 0x3000 +0xFAE8 0x3000 +0xFAE9 0x3000 +0xFAEA 0x3000 +0xFAEB 0x3000 +0xFAEC 0x3000 +0xFAED 0x3000 +0xFAEE 0x3000 +0xFAEF 0x3000 +0xFAF0 0x3000 +0xFAF1 0x3000 +0xFAF2 0x3000 +0xFAF3 0x3000 +0xFAF4 0x3000 +0xFAF5 0x3000 +0xFAF6 0x3000 +0xFAF7 0x3000 +0xFAF8 0x3000 +0xFAF9 0x3000 +0xFAFA 0x3000 +0xFAFB 0x3000 +0xFAFC 0x3000 +0xFAFD 0x3000 +0xFAFE 0x3000 +0xFB40 0xFB5B 0x9E03 +0xFB5C 0x9E24 +0xFB5D 0x9E27 +0xFB5E 0x9E2E +0xFB5F 0x9E30 +0xFB60 0x9E34 +0xFB61 0xFB62 0x9E3B +0xFB63 0x9E40 +0xFB64 0x9E4D +0xFB65 0x9E50 +0xFB66 0xFB68 0x9E52 +0xFB69 0x9E56 +0xFB6A 0x9E59 +0xFB6B 0x9E5D +0xFB6C 0xFB6F 0x9E5F +0xFB70 0x9E65 +0xFB71 0xFB72 0x9E6E +0xFB73 0x9E72 +0xFB74 0xFB7D 0x9E74 +0xFB7E 0x9E80 +0xFB80 0x9E81 +0xFB81 0xFB84 0x9E83 +0xFB85 0xFB86 0x9E89 +0xFB87 0xFB8C 0x9E8C +0xFB8D 0xFB95 0x9E94 +0xFB96 0x9E9E +0xFB97 0xFB9C 0x9EA0 +0xFB9D 0xFBA0 0x9EA7 +0xFBA1 0x3000 +0xFBA2 0x3000 +0xFBA3 0x3000 +0xFBA4 0x3000 +0xFBA5 0x3000 +0xFBA6 0x3000 +0xFBA7 0x3000 +0xFBA8 0x3000 +0xFBA9 0x3000 +0xFBAA 0x3000 +0xFBAB 0x3000 +0xFBAC 0x3000 +0xFBAD 0x3000 +0xFBAE 0x3000 +0xFBAF 0x3000 +0xFBB0 0x3000 +0xFBB1 0x3000 +0xFBB2 0x3000 +0xFBB3 0x3000 +0xFBB4 0x3000 +0xFBB5 0x3000 +0xFBB6 0x3000 +0xFBB7 0x3000 +0xFBB8 0x3000 +0xFBB9 0x3000 +0xFBBA 0x3000 +0xFBBB 0x3000 +0xFBBC 0x3000 +0xFBBD 0x3000 +0xFBBE 0x3000 +0xFBBF 0x3000 +0xFBC0 0x3000 +0xFBC1 0x3000 +0xFBC2 0x3000 +0xFBC3 0x3000 +0xFBC4 0x3000 +0xFBC5 0x3000 +0xFBC6 0x3000 +0xFBC7 0x3000 +0xFBC8 0x3000 +0xFBC9 0x3000 +0xFBCA 0x3000 +0xFBCB 0x3000 +0xFBCC 0x3000 +0xFBCD 0x3000 +0xFBCE 0x3000 +0xFBCF 0x3000 +0xFBD0 0x3000 +0xFBD1 0x3000 +0xFBD2 0x3000 +0xFBD3 0x3000 +0xFBD4 0x3000 +0xFBD5 0x3000 +0xFBD6 0x3000 +0xFBD7 0x3000 +0xFBD8 0x3000 +0xFBD9 0x3000 +0xFBDA 0x3000 +0xFBDB 0x3000 +0xFBDC 0x3000 +0xFBDD 0x3000 +0xFBDE 0x3000 +0xFBDF 0x3000 +0xFBE0 0x3000 +0xFBE1 0x3000 +0xFBE2 0x3000 +0xFBE3 0x3000 +0xFBE4 0x3000 +0xFBE5 0x3000 +0xFBE6 0x3000 +0xFBE7 0x3000 +0xFBE8 0x3000 +0xFBE9 0x3000 +0xFBEA 0x3000 +0xFBEB 0x3000 +0xFBEC 0x3000 +0xFBED 0x3000 +0xFBEE 0x3000 +0xFBEF 0x3000 +0xFBF0 0x3000 +0xFBF1 0x3000 +0xFBF2 0x3000 +0xFBF3 0x3000 +0xFBF4 0x3000 +0xFBF5 0x3000 +0xFBF6 0x3000 +0xFBF7 0x3000 +0xFBF8 0x3000 +0xFBF9 0x3000 +0xFBFA 0x3000 +0xFBFB 0x3000 +0xFBFC 0x3000 +0xFBFD 0x3000 +0xFBFE 0x3000 +0xFC40 0xFC48 0x9EAB +0xFC49 0xFC4B 0x9EB5 +0xFC4C 0xFC4D 0x9EB9 +0xFC4E 0x9EBC +0xFC4F 0xFC53 0x9EBF +0xFC54 0xFC57 0x9EC5 +0xFC58 0xFC5A 0x9ECA +0xFC5B 0x9ED0 +0xFC5C 0xFC5D 0x9ED2 +0xFC5E 0xFC60 0x9ED5 +0xFC61 0xFC62 0x9ED9 +0xFC63 0x9EDE +0xFC64 0x9EE1 +0xFC65 0xFC66 0x9EE3 +0xFC67 0x9EE6 +0xFC68 0x9EE8 +0xFC69 0xFC6C 0x9EEB +0xFC6D 0xFC75 0x9EF0 +0xFC76 0x9EFA +0xFC77 0x9EFD +0xFC78 0xFC7E 0x9EFF +0xFC80 0xFC84 0x9F06 +0xFC85 0x9F0C +0xFC86 0x9F0F +0xFC87 0xFC88 0x9F11 +0xFC89 0xFC8B 0x9F14 +0xFC8C 0x9F18 +0xFC8D 0xFC92 0x9F1A +0xFC93 0x9F21 +0xFC94 0xFC9C 0x9F23 +0xFC9D 0xFC9E 0x9F2D +0xFC9F 0xFCA0 0x9F30 +0xFCA1 0x3000 +0xFCA2 0x3000 +0xFCA3 0x3000 +0xFCA4 0x3000 +0xFCA5 0x3000 +0xFCA6 0x3000 +0xFCA7 0x3000 +0xFCA8 0x3000 +0xFCA9 0x3000 +0xFCAA 0x3000 +0xFCAB 0x3000 +0xFCAC 0x3000 +0xFCAD 0x3000 +0xFCAE 0x3000 +0xFCAF 0x3000 +0xFCB0 0x3000 +0xFCB1 0x3000 +0xFCB2 0x3000 +0xFCB3 0x3000 +0xFCB4 0x3000 +0xFCB5 0x3000 +0xFCB6 0x3000 +0xFCB7 0x3000 +0xFCB8 0x3000 +0xFCB9 0x3000 +0xFCBA 0x3000 +0xFCBB 0x3000 +0xFCBC 0x3000 +0xFCBD 0x3000 +0xFCBE 0x3000 +0xFCBF 0x3000 +0xFCC0 0x3000 +0xFCC1 0x3000 +0xFCC2 0x3000 +0xFCC3 0x3000 +0xFCC4 0x3000 +0xFCC5 0x3000 +0xFCC6 0x3000 +0xFCC7 0x3000 +0xFCC8 0x3000 +0xFCC9 0x3000 +0xFCCA 0x3000 +0xFCCB 0x3000 +0xFCCC 0x3000 +0xFCCD 0x3000 +0xFCCE 0x3000 +0xFCCF 0x3000 +0xFCD0 0x3000 +0xFCD1 0x3000 +0xFCD2 0x3000 +0xFCD3 0x3000 +0xFCD4 0x3000 +0xFCD5 0x3000 +0xFCD6 0x3000 +0xFCD7 0x3000 +0xFCD8 0x3000 +0xFCD9 0x3000 +0xFCDA 0x3000 +0xFCDB 0x3000 +0xFCDC 0x3000 +0xFCDD 0x3000 +0xFCDE 0x3000 +0xFCDF 0x3000 +0xFCE0 0x3000 +0xFCE1 0x3000 +0xFCE2 0x3000 +0xFCE3 0x3000 +0xFCE4 0x3000 +0xFCE5 0x3000 +0xFCE6 0x3000 +0xFCE7 0x3000 +0xFCE8 0x3000 +0xFCE9 0x3000 +0xFCEA 0x3000 +0xFCEB 0x3000 +0xFCEC 0x3000 +0xFCED 0x3000 +0xFCEE 0x3000 +0xFCEF 0x3000 +0xFCF0 0x3000 +0xFCF1 0x3000 +0xFCF2 0x3000 +0xFCF3 0x3000 +0xFCF4 0x3000 +0xFCF5 0x3000 +0xFCF6 0x3000 +0xFCF7 0x3000 +0xFCF8 0x3000 +0xFCF9 0x3000 +0xFCFA 0x3000 +0xFCFB 0x3000 +0xFCFC 0x3000 +0xFCFD 0x3000 +0xFCFE 0x3000 +0xFD40 0xFD44 0x9F32 +0xFD45 0x9F38 +0xFD46 0x9F3A +0xFD47 0x9F3C +0xFD48 0xFD4C 0x9F3F +0xFD4D 0xFD57 0x9F45 +0xFD58 0xFD7E 0x9F52 +0xFD80 0xFD85 0x9F79 +0xFD86 0xFD87 0x9F81 +0xFD88 0xFD93 0x9F8D +0xFD94 0xFD96 0x9F9C +0xFD97 0xFD9B 0x9FA1 +0xFD9C 0xF92C +0xFD9D 0xF979 +0xFD9E 0xF995 +0xFD9F 0xF9E7 +0xFDA0 0xF9F1 +0xFDA1 0x3000 +0xFDA2 0x3000 +0xFDA3 0x3000 +0xFDA4 0x3000 +0xFDA5 0x3000 +0xFDA6 0x3000 +0xFDA7 0x3000 +0xFDA8 0x3000 +0xFDA9 0x3000 +0xFDAA 0x3000 +0xFDAB 0x3000 +0xFDAC 0x3000 +0xFDAD 0x3000 +0xFDAE 0x3000 +0xFDAF 0x3000 +0xFDB0 0x3000 +0xFDB1 0x3000 +0xFDB2 0x3000 +0xFDB3 0x3000 +0xFDB4 0x3000 +0xFDB5 0x3000 +0xFDB6 0x3000 +0xFDB7 0x3000 +0xFDB8 0x3000 +0xFDB9 0x3000 +0xFDBA 0x3000 +0xFDBB 0x3000 +0xFDBC 0x3000 +0xFDBD 0x3000 +0xFDBE 0x3000 +0xFDBF 0x3000 +0xFDC0 0x3000 +0xFDC1 0x3000 +0xFDC2 0x3000 +0xFDC3 0x3000 +0xFDC4 0x3000 +0xFDC5 0x3000 +0xFDC6 0x3000 +0xFDC7 0x3000 +0xFDC8 0x3000 +0xFDC9 0x3000 +0xFDCA 0x3000 +0xFDCB 0x3000 +0xFDCC 0x3000 +0xFDCD 0x3000 +0xFDCE 0x3000 +0xFDCF 0x3000 +0xFDD0 0x3000 +0xFDD1 0x3000 +0xFDD2 0x3000 +0xFDD3 0x3000 +0xFDD4 0x3000 +0xFDD5 0x3000 +0xFDD6 0x3000 +0xFDD7 0x3000 +0xFDD8 0x3000 +0xFDD9 0x3000 +0xFDDA 0x3000 +0xFDDB 0x3000 +0xFDDC 0x3000 +0xFDDD 0x3000 +0xFDDE 0x3000 +0xFDDF 0x3000 +0xFDE0 0x3000 +0xFDE1 0x3000 +0xFDE2 0x3000 +0xFDE3 0x3000 +0xFDE4 0x3000 +0xFDE5 0x3000 +0xFDE6 0x3000 +0xFDE7 0x3000 +0xFDE8 0x3000 +0xFDE9 0x3000 +0xFDEA 0x3000 +0xFDEB 0x3000 +0xFDEC 0x3000 +0xFDED 0x3000 +0xFDEE 0x3000 +0xFDEF 0x3000 +0xFDF0 0x3000 +0xFDF1 0x3000 +0xFDF2 0x3000 +0xFDF3 0x3000 +0xFDF4 0x3000 +0xFDF5 0x3000 +0xFDF6 0x3000 +0xFDF7 0x3000 +0xFDF8 0x3000 +0xFDF9 0x3000 +0xFDFA 0x3000 +0xFDFB 0x3000 +0xFDFC 0x3000 +0xFDFD 0x3000 +0xFDFE 0x3000 +0xFE40 0xFE43 0xFA0C +0xFE44 0xFA11 +0xFE45 0xFE46 0xFA13 +0xFE47 0xFA18 +0xFE48 0xFE4A 0xFA1F +0xFE4B 0xFE4C 0xFA23 +0xFE4D 0xFE4F 0xFA27 +0xFE50 0x2E81 +0xFE51 0xFE53 0xE816 +0xFE54 0x2E84 +0xFE55 0x3473 +0xFE56 0x3447 +0xFE57 0x2E88 +0xFE58 0x2E8B +0xFE59 0xE81E +0xFE5A 0x359E +0xFE5B 0x361A +0xFE5C 0x360E +0xFE5D 0x2E8C +0xFE5E 0x2E97 +0xFE5F 0x396E +0xFE60 0x3918 +0xFE61 0xE826 +0xFE62 0x39CF +0xFE63 0x39DF +0xFE64 0x3A73 +0xFE65 0x39D0 +0xFE66 0xFE67 0xE82B +0xFE68 0x3B4E +0xFE69 0x3C6E +0xFE6A 0x3CE0 +0xFE6B 0x2EA7 +0xFE6C 0xFE6D 0xE831 +0xFE6E 0x2EAA +0xFE6F 0x4056 +0xFE70 0x415F +0xFE71 0x2EAE +0xFE72 0x4337 +0xFE73 0x2EB3 +0xFE74 0xFE75 0x2EB6 +0xFE76 0xE83B +0xFE77 0x43B1 +0xFE78 0x43AC +0xFE79 0x2EBB +0xFE7A 0x43DD +0xFE7B 0x44D6 +0xFE7C 0x4661 +0xFE7D 0x464C +0xFE7E 0xE843 +0xFE80 0x4723 +0xFE81 0x4729 +0xFE82 0x477C +0xFE83 0x478D +0xFE84 0x2ECA +0xFE85 0x4947 +0xFE86 0x497A +0xFE87 0x497D +0xFE88 0xFE89 0x4982 +0xFE8A 0xFE8B 0x4985 +0xFE8C 0x499F +0xFE8D 0x499B +0xFE8E 0x49B7 +0xFE8F 0x49B6 +0xFE90 0xFE91 0xE854 +0xFE92 0x4CA3 +0xFE93 0xFE95 0x4C9F +0xFE96 0x4C77 +0xFE97 0x4CA2 +0xFE98 0xFE9E 0x4D13 +0xFE9F 0x4DAE +0xFEA0 0xE864 +ENDMAPPING +STARTMAPPING cmap 3 4 +# the identity mapping +ENDMAPPING +ENDENCODING Index: xc/fonts/encodings/large/gb18030.2000-1.enc diff -u /dev/null xc/fonts/encodings/large/gb18030.2000-1.enc:1.1 --- /dev/null Sat Feb 28 21:41:02 2004 +++ xc/fonts/encodings/large/gb18030.2000-1.enc Sun Oct 19 14:34:43 2003 @@ -0,0 +1,222 @@ +# Contributed by James Su +# $XFree86: xc/fonts/encodings/large/gb18030.2000-1.enc,v 1.1 2003/10/19 18:34:43 dawes Exp $ +STARTENCODING gb18030.2000-1 +SIZE 0x9A 0x100 +STARTMAPPING unicode +UNDEFINE 0x00 0x99FF +0x0000 0x0023 0x0080 +0x0024 0x0025 0x00A5 +0x0026 0x002C 0x00A9 +0x002D 0x0031 0x00B2 +0x0032 0x0050 0x00B8 +0x0051 0x0058 0x00D8 +0x0059 0x005E 0x00E2 +0x005F 0x00EB +0x0060 0x0063 0x00EE +0x0064 0x0066 0x00F4 +0x0067 0x00F8 +0x0068 0x00FB +0x0069 0x006C 0x00FD +0x006D 0x007D 0x0102 +0x007E 0x0084 0x0114 +0x0085 0x0093 0x011C +0x0094 0x00AB 0x012C +0x00AC 0x00AE 0x0145 +0x00AF 0x00B2 0x0149 +0x00B3 0x00CF 0x014E +0x00D0 0x0131 0x016C +0x0132 0x01CF +0x0133 0x01D1 +0x0134 0x01D3 +0x0135 0x01D5 +0x0136 0x01D7 +0x0137 0x01D9 +0x0138 0x01DB +0x0139 0x0154 0x01DD +0x0155 0x01AB 0x01FA +0x01AC 0x01BA 0x0252 +0x01BB 0x021F 0x0262 +0x0220 0x02C8 +0x0221 0x022D 0x02CC +0x022E 0x02E4 0x02DA +0x02E5 0x03A2 +0x02E6 0x02EC 0x03AA +0x02ED 0x03C2 +0x02EE 0x0324 0x03CA +0x0325 0x0332 0x0402 +0x0333 0x0450 +0x0334 0x1EF1 0x0452 +0x1EF2 0x1EF3 0x2011 +0x1EF4 0x2017 +0x1EF5 0x1EF6 0x201A +0x1EF7 0x1EFD 0x201E +0x1EFE 0x1F06 0x2027 +0x1F07 0x2031 +0x1F08 0x2034 +0x1F09 0x1F0D 0x2036 +0x1F0E 0x1F7D 0x203C +0x1F7E 0x1FD3 0x20AD +0x1FD4 0x2104 +0x1FD5 0x1FD7 0x2106 +0x1FD8 0x1FE3 0x210A +0x1FE4 0x1FED 0x2117 +0x1FEE 0x202B 0x2122 +0x202C 0x202F 0x216C +0x2030 0x2045 0x217A +0x2046 0x2047 0x2194 +0x2048 0x20B5 0x219A +0x20B6 0x20BB 0x2209 +0x20BC 0x2210 +0x20BD 0x20BF 0x2212 +0x20C0 0x20C3 0x2216 +0x20C4 0x20C5 0x221B +0x20C6 0x20C7 0x2221 +0x20C8 0x2224 +0x20C9 0x2226 +0x20CA 0x20CB 0x222C +0x20CC 0x20D0 0x222F +0x20D1 0x20D5 0x2238 +0x20D6 0x20DF 0x223E +0x20E0 0x20E2 0x2249 +0x20E3 0x20E7 0x224D +0x20E8 0x20F4 0x2253 +0x20F5 0x20F6 0x2262 +0x20F7 0x20FC 0x2268 +0x20FD 0x2121 0x2270 +0x2122 0x2124 0x2296 +0x2125 0x212F 0x229A +0x2130 0x2148 0x22A6 +0x2149 0x219A 0x22C0 +0x219B 0x22E7 0x2313 +0x22E8 0x22F1 0x246A +0x22F2 0x2355 0x249C +0x2356 0x2359 0x254C +0x235A 0x2366 0x2574 +0x2367 0x2369 0x2590 +0x236A 0x2373 0x2596 +0x2374 0x2383 0x25A2 +0x2384 0x238B 0x25B4 +0x238C 0x2393 0x25BE +0x2394 0x2396 0x25C8 +0x2397 0x2398 0x25CC +0x2399 0x23AA 0x25D0 +0x23AB 0x23C9 0x25E6 +0x23CA 0x23CB 0x2607 +0x23CC 0x2401 0x260A +0x2402 0x2641 +0x2403 0x2C40 0x2643 +0x2C41 0x2C42 0x2E82 +0x2C43 0x2C45 0x2E85 +0x2C46 0x2C47 0x2E89 +0x2C48 0x2C51 0x2E8D +0x2C52 0x2C60 0x2E98 +0x2C61 0x2C62 0x2EA8 +0x2C63 0x2C65 0x2EAB +0x2C66 0x2C69 0x2EAF +0x2C6A 0x2C6B 0x2EB4 +0x2C6C 0x2C6E 0x2EB8 +0x2C6F 0x2C7C 0x2EBC +0x2C7D 0x2DA1 0x2ECB +0x2DA2 0x2DA5 0x2FFC +0x2DA6 0x3004 +0x2DA7 0x2DAB 0x3018 +0x2DAC 0x2DAD 0x301F +0x2DAE 0x2DC1 0x302A +0x2DC2 0x2DC3 0x303F +0x2DC4 0x2DCA 0x3094 +0x2DCB 0x2DCC 0x309F +0x2DCD 0x2DD1 0x30F7 +0x2DD2 0x2DD7 0x30FF +0x2DD8 0x2ECD 0x312A +0x2ECE 0x2ED4 0x322A +0x2ED5 0x2F45 0x3232 +0x2F46 0x302F 0x32A4 +0x3030 0x303B 0x3390 +0x303C 0x303D 0x339F +0x303E 0x305F 0x33A2 +0x3060 0x3068 0x33C5 +0x3069 0x306A 0x33CF +0x306B 0x306C 0x33D3 +0x306D 0x30DD 0x33D6 +0x30DE 0x3108 0x3448 +0x3109 0x3232 0x3474 +0x3233 0x32A1 0x359F +0x32A2 0x32AC 0x360F +0x32AD 0x35A9 0x361B +0x35AA 0x35FE 0x3919 +0x35FF 0x365E 0x396F +0x365F 0x366C 0x39D1 +0x366D 0x36FF 0x39E0 +0x3700 0x37D9 0x3A74 +0x37DA 0x38F8 0x3B4F +0x38F9 0x3969 0x3C6F +0x396A 0x3CDE 0x3CE1 +0x3CDF 0x3DE6 0x4057 +0x3DE7 0x3FBD 0x4160 +0x3FBE 0x4031 0x4338 +0x4032 0x4035 0x43AD +0x4036 0x4060 0x43B2 +0x4061 0x4158 0x43DE +0x4159 0x42CD 0x44D7 +0x42CE 0x42E1 0x464D +0x42E2 0x43A2 0x4662 +0x43A3 0x43A7 0x4724 +0x43A8 0x43F9 0x472A +0x43FA 0x4409 0x477D +0x440A 0x45C2 0x478E +0x45C3 0x45F4 0x4948 +0x45F5 0x45F6 0x497B +0x45F7 0x45FA 0x497E +0x45FB 0x4984 +0x45FC 0x460F 0x4987 +0x4610 0x4612 0x499C +0x4613 0x4628 0x49A0 +0x4629 0x48E7 0x49B8 +0x48E8 0x490E 0x4C78 +0x490F 0x497D 0x4CA4 +0x497E 0x4A11 0x4D1A +0x4A12 0x4A62 0x4DAF +0x4A63 0x82BC 0x9FA6 +0x82BD 0xE76C +0x82BE 0xE7C8 +0x82BF 0x82CB 0xE7E7 +0x82CC 0xE815 +0x82CD 0x82D1 0xE819 +0x82D2 0x82D8 0xE81F +0x82D9 0x82DC 0xE827 +0x82DD 0x82E0 0xE82D +0x82E1 0x82E8 0xE833 +0x82E9 0x82EF 0xE83C +0x82F0 0x82FF 0xE844 +0x8300 0x830D 0xE856 +0x830E 0x93D4 0xE865 +0x93D5 0x9420 0xF92D +0x9421 0x943B 0xF97A +0x943C 0x948C 0xF996 +0x948D 0x9495 0xF9E8 +0x9496 0x94AF 0xF9F2 +0x94B0 0xFA10 +0x94B1 0xFA12 +0x94B2 0x94B4 0xFA15 +0x94B5 0x94BA 0xFA19 +0x94BB 0xFA22 +0x94BC 0x94BD 0xFA25 +0x94BE 0x98C3 0xFA2A +0x98C4 0xFE32 +0x98C5 0x98C8 0xFE45 +0x98C9 0xFE53 +0x98CA 0xFE58 +0x98CB 0xFE67 +0x98CC 0x9960 0xFE6C +0x9961 0x99E1 0xFF5F +0x99E2 0x99FA 0xFFE6 +0x99FB 0xFFFD +0x99FC 0xFFFD +0x99FD 0xFFFD +0x99FE 0xFFFD +0x99FF 0xFFFD +ENDMAPPING +STARTMAPPING cmap 3 4 +# the identity mapping +ENDMAPPING +ENDENCODING Index: xc/fonts/encodings/large/gb2312.1980-0.enc diff -u xc/fonts/encodings/large/gb2312.1980-0.enc:1.4 xc/fonts/encodings/large/gb2312.1980-0.enc:1.5 --- xc/fonts/encodings/large/gb2312.1980-0.enc:1.4 Mon Dec 16 22:41:37 2002 +++ xc/fonts/encodings/large/gb2312.1980-0.enc Sun Oct 19 14:34:43 2003 @@ -1,4 +1,5 @@ STARTENCODING gb2312.1980-0 +# $XFree86: xc/fonts/encodings/large/gb2312.1980-0.enc,v 1.5 2003/10/19 18:34:43 dawes Exp $ SIZE 0x78 0x80 FIRSTINDEX 0x20 0x20 STARTMAPPING unicode Index: xc/fonts/encodings/large/jisx0201.1976-0.enc diff -u xc/fonts/encodings/large/jisx0201.1976-0.enc:1.1 xc/fonts/encodings/large/jisx0201.1976-0.enc:1.2 --- xc/fonts/encodings/large/jisx0201.1976-0.enc:1.1 Sat May 29 22:27:55 1999 +++ xc/fonts/encodings/large/jisx0201.1976-0.enc Sun Oct 19 14:34:44 2003 @@ -1,5 +1,71 @@ STARTENCODING jisx0201.1976-0 +# $XFree86: xc/fonts/encodings/large/jisx0201.1976-0.enc,v 1.2 2003/10/19 18:34:44 dawes Exp $ SIZE 0xE0 +STARTMAPPING cmap 3 1 +0x00A1 0xFF61 +0x00A2 0xFF62 +0x00A3 0xFF63 +0x00A4 0xFF64 +0x00A5 0xFF65 +0x00A6 0xFF66 +0x00A7 0xFF67 +0x00A8 0xFF68 +0x00A9 0xFF69 +0x00AA 0xFF6A +0x00AB 0xFF6B +0x00AC 0xFF6C +0x00AD 0xFF6D +0x00AE 0xFF6E +0x00AF 0xFF6F +0x00B0 0xFF70 +0x00B1 0xFF71 +0x00B2 0xFF72 +0x00B3 0xFF73 +0x00B4 0xFF74 +0x00B5 0xFF75 +0x00B6 0xFF76 +0x00B7 0xFF77 +0x00B8 0xFF78 +0x00B9 0xFF79 +0x00BA 0xFF7A +0x00BB 0xFF7B +0x00BC 0xFF7C +0x00BD 0xFF7D +0x00BE 0xFF7E +0x00BF 0xFF7F +0x00C0 0xFF80 +0x00C1 0xFF81 +0x00C2 0xFF82 +0x00C3 0xFF83 +0x00C4 0xFF84 +0x00C5 0xFF85 +0x00C6 0xFF86 +0x00C7 0xFF87 +0x00C8 0xFF88 +0x00C9 0xFF89 +0x00CA 0xFF8A +0x00CB 0xFF8B +0x00CC 0xFF8C +0x00CD 0xFF8D +0x00CE 0xFF8E +0x00CF 0xFF8F +0x00D0 0xFF90 +0x00D1 0xFF91 +0x00D2 0xFF92 +0x00D3 0xFF93 +0x00D4 0xFF94 +0x00D5 0xFF95 +0x00D6 0xFF96 +0x00D7 0xFF97 +0x00D8 0xFF98 +0x00D9 0xFF99 +0x00DA 0xFF9A +0x00DB 0xFF9B +0x00DC 0xFF9C +0x00DD 0xFF9D +0x00DE 0xFF9E +0x00DF 0xFF9F +ENDMAPPING STARTMAPPING unicode 0x5C 0x00A5 # YEN SIGN 0x7E 0x203E # OVERLINE Index: xc/fonts/encodings/large/jisx0208.1983-0.enc diff -u xc/fonts/encodings/large/jisx0208.1983-0.enc:1.2 xc/fonts/encodings/large/jisx0208.1983-0.enc:removed --- xc/fonts/encodings/large/jisx0208.1983-0.enc:1.2 Wed Nov 21 16:20:54 2001 +++ xc/fonts/encodings/large/jisx0208.1983-0.enc Sat Feb 28 21:41:03 2004 @@ -1,6600 +0,0 @@ -STARTENCODING jisx0208.1983-0 -SIZE 0x75 0x80 -FIRSTINDEX 0x20 0x20 -STARTMAPPING unicode -UNDEFINE 0x00 0x747F -0x2121 0x2123 0x3000 -0x2124 0xFF0C -0x2125 0xFF0E -0x2126 0x30FB -0x2127 0x2128 0xFF1A -0x2129 0xFF1F -0x212A 0xFF01 -0x212B 0x212C 0x309B -0x212D 0x00B4 -0x212E 0xFF40 -0x212F 0x00A8 -0x2130 0xFF3E -0x2131 0xFFE3 -0x2132 0xFF3F -0x2133 0x2134 0x30FD -0x2135 0x2136 0x309D -0x2137 0x3003 -0x2138 0x4EDD -0x2139 0x213B 0x3005 -0x213C 0x30FC -0x213D 0x2014 -0x213E 0x2010 -0x213F 0xFF0F -0x2140 0xFF3C -0x2141 0x301C -0x2142 0x2016 -0x2143 0xFF5C -0x2144 0x2026 -0x2145 0x2025 -0x2146 0x2147 0x2018 -0x2148 0x2149 0x201C -0x214A 0x214B 0xFF08 -0x214C 0x214D 0x3014 -0x214E 0xFF3B -0x214F 0xFF3D -0x2150 0xFF5B -0x2151 0xFF5D -0x2152 0x215B 0x3008 -0x215C 0xFF0B -0x215D 0x2212 -0x215E 0x00B1 -0x215F 0x00D7 -0x2160 0x00F7 -0x2161 0xFF1D -0x2162 0x2260 -0x2163 0xFF1C -0x2164 0xFF1E -0x2165 0x2166 0x2266 -0x2167 0x221E -0x2168 0x2234 -0x2169 0x2642 -0x216A 0x2640 -0x216B 0x00B0 -0x216C 0x216D 0x2032 -0x216E 0x2103 -0x216F 0xFFE5 -0x2170 0xFF04 -0x2171 0x2172 0x00A2 -0x2173 0xFF05 -0x2174 0xFF03 -0x2175 0xFF06 -0x2176 0xFF0A -0x2177 0xFF20 -0x2178 0x00A7 -0x2179 0x2606 -0x217A 0x2605 -0x217B 0x25CB -0x217C 0x25CF -0x217D 0x25CE -0x217E 0x25C7 -0x2221 0x25C6 -0x2222 0x25A1 -0x2223 0x25A0 -0x2224 0x25B3 -0x2225 0x25B2 -0x2226 0x25BD -0x2227 0x25BC -0x2228 0x203B -0x2229 0x3012 -0x222A 0x2192 -0x222B 0x222C 0x2190 -0x222D 0x2193 -0x222E 0x3013 -0x223A 0x2208 -0x223B 0x220B -0x223C 0x223D 0x2286 -0x223E 0x223F 0x2282 -0x2240 0x222A -0x2241 0x2229 -0x224A 0x224B 0x2227 -0x224C 0x00AC -0x224D 0x21D2 -0x224E 0x21D4 -0x224F 0x2200 -0x2250 0x2203 -0x225C 0x2220 -0x225D 0x22A5 -0x225E 0x2312 -0x225F 0x2202 -0x2260 0x2207 -0x2261 0x2261 -0x2262 0x2252 -0x2263 0x2264 0x226A -0x2265 0x221A -0x2266 0x223D -0x2267 0x221D -0x2268 0x2235 -0x2269 0x226A 0x222B -0x2272 0x212B -0x2273 0x2030 -0x2274 0x266F -0x2275 0x266D -0x2276 0x266A -0x2277 0x2278 0x2020 -0x2279 0x00B6 -0x227E 0x25EF -0x2330 0x2339 0xFF10 -0x2341 0x235A 0xFF21 -0x2361 0x237A 0xFF41 -0x2421 0x2473 0x3041 -0x2521 0x2576 0x30A1 -0x2621 0x2631 0x0391 -0x2632 0x2638 0x03A3 -0x2641 0x2651 0x03B1 -0x2652 0x2658 0x03C3 -0x2721 0x2726 0x0410 -0x2727 0x0401 -0x2728 0x2741 0x0416 -0x2751 0x2756 0x0430 -0x2757 0x0451 -0x2758 0x2771 0x0436 -0x2821 0x2500 -0x2822 0x2502 -0x2823 0x250C -0x2824 0x2510 -0x2825 0x2518 -0x2826 0x2514 -0x2827 0x251C -0x2828 0x252C -0x2829 0x2524 -0x282A 0x2534 -0x282B 0x253C -0x282C 0x2501 -0x282D 0x2503 -0x282E 0x250F -0x282F 0x2513 -0x2830 0x251B -0x2831 0x2517 -0x2832 0x2523 -0x2833 0x2533 -0x2834 0x252B -0x2835 0x253B -0x2836 0x254B -0x2837 0x2520 -0x2838 0x252F -0x2839 0x2528 -0x283A 0x2537 -0x283B 0x253F -0x283C 0x251D -0x283D 0x2530 -0x283E 0x2525 -0x283F 0x2538 -0x2840 0x2542 -0x3021 0x4E9C -0x3022 0x5516 -0x3023 0x5A03 -0x3024 0x963F -0x3025 0x54C0 -0x3026 0x611B -0x3027 0x6328 -0x3028 0x59F6 -0x3029 0x9022 -0x302A 0x8475 -0x302B 0x831C -0x302C 0x7A50 -0x302D 0x60AA -0x302E 0x63E1 -0x302F 0x6E25 -0x3030 0x65ED -0x3031 0x8466 -0x3032 0x82A6 -0x3033 0x9BF5 -0x3034 0x6893 -0x3035 0x5727 -0x3036 0x65A1 -0x3037 0x6271 -0x3038 0x5B9B -0x3039 0x59D0 -0x303A 0x867B -0x303B 0x98F4 -0x303C 0x7D62 -0x303D 0x7DBE -0x303E 0x9B8E -0x303F 0x6216 -0x3040 0x7C9F -0x3041 0x88B7 -0x3042 0x5B89 -0x3043 0x5EB5 -0x3044 0x6309 -0x3045 0x6697 -0x3046 0x6848 -0x3047 0x95C7 -0x3048 0x978D -0x3049 0x674F -0x304A 0x4EE5 -0x304B 0x4F0A -0x304C 0x4F4D -0x304D 0x4F9D -0x304E 0x5049 -0x304F 0x56F2 -0x3050 0x5937 -0x3051 0x59D4 -0x3052 0x5A01 -0x3053 0x5C09 -0x3054 0x60DF -0x3055 0x610F -0x3056 0x6170 -0x3057 0x6613 -0x3058 0x6905 -0x3059 0x70BA -0x305A 0x754F -0x305B 0x7570 -0x305C 0x79FB -0x305D 0x7DAD -0x305E 0x7DEF -0x305F 0x80C3 -0x3060 0x840E -0x3061 0x8863 -0x3062 0x8B02 -0x3063 0x9055 -0x3064 0x907A -0x3065 0x533B -0x3066 0x4E95 -0x3067 0x4EA5 -0x3068 0x57DF -0x3069 0x80B2 -0x306A 0x90C1 -0x306B 0x78EF -0x306C 0x4E00 -0x306D 0x58F1 -0x306E 0x6EA2 -0x306F 0x9038 -0x3070 0x7A32 -0x3071 0x8328 -0x3072 0x828B -0x3073 0x9C2F -0x3074 0x5141 -0x3075 0x5370 -0x3076 0x54BD -0x3077 0x54E1 -0x3078 0x56E0 -0x3079 0x59FB -0x307A 0x5F15 -0x307B 0x98F2 -0x307C 0x6DEB -0x307D 0x80E4 -0x307E 0x852D -0x3121 0x9662 -0x3122 0x9670 -0x3123 0x96A0 -0x3124 0x97FB -0x3125 0x540B -0x3126 0x53F3 -0x3127 0x5B87 -0x3128 0x70CF -0x3129 0x7FBD -0x312A 0x8FC2 -0x312B 0x96E8 -0x312C 0x536F -0x312D 0x9D5C -0x312E 0x7ABA -0x312F 0x4E11 -0x3130 0x7893 -0x3131 0x81FC -0x3132 0x6E26 -0x3133 0x5618 -0x3134 0x5504 -0x3135 0x6B1D -0x3136 0x851A -0x3137 0x9C3B -0x3138 0x59E5 -0x3139 0x53A9 -0x313A 0x6D66 -0x313B 0x74DC -0x313C 0x958F -0x313D 0x5642 -0x313E 0x4E91 -0x313F 0x904B -0x3140 0x96F2 -0x3141 0x834F -0x3142 0x990C -0x3143 0x53E1 -0x3144 0x55B6 -0x3145 0x5B30 -0x3146 0x5F71 -0x3147 0x6620 -0x3148 0x66F3 -0x3149 0x6804 -0x314A 0x6C38 -0x314B 0x6CF3 -0x314C 0x6D29 -0x314D 0x745B -0x314E 0x76C8 -0x314F 0x7A4E -0x3150 0x9834 -0x3151 0x82F1 -0x3152 0x885B -0x3153 0x8A60 -0x3154 0x92ED -0x3155 0x6DB2 -0x3156 0x75AB -0x3157 0x76CA -0x3158 0x99C5 -0x3159 0x60A6 -0x315A 0x8B01 -0x315B 0x8D8A -0x315C 0x95B2 -0x315D 0x698E -0x315E 0x53AD -0x315F 0x5186 -0x3160 0x5712 -0x3161 0x5830 -0x3162 0x5944 -0x3163 0x5BB4 -0x3164 0x5EF6 -0x3165 0x6028 -0x3166 0x63A9 -0x3167 0x63F4 -0x3168 0x6CBF -0x3169 0x6F14 -0x316A 0x708E -0x316B 0x7114 -0x316C 0x7159 -0x316D 0x71D5 -0x316E 0x733F -0x316F 0x7E01 -0x3170 0x8276 -0x3171 0x82D1 -0x3172 0x8597 -0x3173 0x9060 -0x3174 0x925B -0x3175 0x9D1B -0x3176 0x5869 -0x3177 0x65BC -0x3178 0x6C5A -0x3179 0x7525 -0x317A 0x51F9 -0x317B 0x592E -0x317C 0x5965 -0x317D 0x5F80 -0x317E 0x5FDC -0x3221 0x62BC -0x3222 0x65FA -0x3223 0x6A2A -0x3224 0x6B27 -0x3225 0x6BB4 -0x3226 0x738B -0x3227 0x7FC1 -0x3228 0x8956 -0x3229 0x9D2C -0x322A 0x9D0E -0x322B 0x9EC4 -0x322C 0x5CA1 -0x322D 0x6C96 -0x322E 0x837B -0x322F 0x5104 -0x3230 0x5C4B -0x3231 0x61B6 -0x3232 0x81C6 -0x3233 0x6876 -0x3234 0x7261 -0x3235 0x4E59 -0x3236 0x4FFA -0x3237 0x5378 -0x3238 0x6069 -0x3239 0x6E29 -0x323A 0x7A4F -0x323B 0x97F3 -0x323C 0x4E0B -0x323D 0x5316 -0x323E 0x4EEE -0x323F 0x4F55 -0x3240 0x4F3D -0x3241 0x4FA1 -0x3242 0x4F73 -0x3243 0x52A0 -0x3244 0x53EF -0x3245 0x5609 -0x3246 0x590F -0x3247 0x5AC1 -0x3248 0x5BB6 -0x3249 0x5BE1 -0x324A 0x79D1 -0x324B 0x6687 -0x324C 0x679C -0x324D 0x67B6 -0x324E 0x6B4C -0x324F 0x6CB3 -0x3250 0x706B -0x3251 0x73C2 -0x3252 0x798D -0x3253 0x79BE -0x3254 0x7A3C -0x3255 0x7B87 -0x3256 0x82B1 -0x3257 0x82DB -0x3258 0x8304 -0x3259 0x8377 -0x325A 0x83EF -0x325B 0x83D3 -0x325C 0x8766 -0x325D 0x8AB2 -0x325E 0x5629 -0x325F 0x8CA8 -0x3260 0x8FE6 -0x3261 0x904E -0x3262 0x971E -0x3263 0x868A -0x3264 0x4FC4 -0x3265 0x5CE8 -0x3266 0x6211 -0x3267 0x7259 -0x3268 0x753B -0x3269 0x81E5 -0x326A 0x82BD -0x326B 0x86FE -0x326C 0x8CC0 -0x326D 0x96C5 -0x326E 0x9913 -0x326F 0x99D5 -0x3270 0x4ECB -0x3271 0x4F1A -0x3272 0x89E3 -0x3273 0x56DE -0x3274 0x584A -0x3275 0x58CA -0x3276 0x5EFB -0x3277 0x5FEB -0x3278 0x602A -0x3279 0x6094 -0x327A 0x6062 -0x327B 0x61D0 -0x327C 0x6212 -0x327D 0x62D0 -0x327E 0x6539 -0x3321 0x9B41 -0x3322 0x6666 -0x3323 0x68B0 -0x3324 0x6D77 -0x3325 0x7070 -0x3326 0x754C -0x3327 0x7686 -0x3328 0x7D75 -0x3329 0x82A5 -0x332A 0x87F9 -0x332B 0x958B -0x332C 0x968E -0x332D 0x8C9D -0x332E 0x51F1 -0x332F 0x52BE -0x3330 0x5916 -0x3331 0x54B3 -0x3332 0x5BB3 -0x3333 0x5D16 -0x3334 0x6168 -0x3335 0x6982 -0x3336 0x6DAF -0x3337 0x788D -0x3338 0x84CB -0x3339 0x8857 -0x333A 0x8A72 -0x333B 0x93A7 -0x333C 0x9AB8 -0x333D 0x6D6C -0x333E 0x99A8 -0x333F 0x86D9 -0x3340 0x57A3 -0x3341 0x67FF -0x3342 0x86CE -0x3343 0x920E -0x3344 0x5283 -0x3345 0x5687 -0x3346 0x5404 -0x3347 0x5ED3 -0x3348 0x62E1 -0x3349 0x64B9 -0x334A 0x683C -0x334B 0x6838 -0x334C 0x6BBB -0x334D 0x7372 -0x334E 0x78BA -0x334F 0x7A6B -0x3350 0x899A -0x3351 0x89D2 -0x3352 0x8D6B -0x3353 0x8F03 -0x3354 0x90ED -0x3355 0x95A3 -0x3356 0x9694 -0x3357 0x9769 -0x3358 0x5B66 -0x3359 0x5CB3 -0x335A 0x697D -0x335B 0x335C 0x984D -0x335D 0x639B -0x335E 0x7B20 -0x335F 0x6A2B -0x3360 0x6A7F -0x3361 0x68B6 -0x3362 0x9C0D -0x3363 0x6F5F -0x3364 0x5272 -0x3365 0x559D -0x3366 0x6070 -0x3367 0x62EC -0x3368 0x6D3B -0x3369 0x6E07 -0x336A 0x6ED1 -0x336B 0x845B -0x336C 0x8910 -0x336D 0x8F44 -0x336E 0x4E14 -0x336F 0x9C39 -0x3370 0x53F6 -0x3371 0x691B -0x3372 0x6A3A -0x3373 0x9784 -0x3374 0x682A -0x3375 0x515C -0x3376 0x7AC3 -0x3377 0x84B2 -0x3378 0x91DC -0x3379 0x938C -0x337A 0x565B -0x337B 0x9D28 -0x337C 0x6822 -0x337D 0x8305 -0x337E 0x8431 -0x3421 0x7CA5 -0x3422 0x5208 -0x3423 0x82C5 -0x3424 0x74E6 -0x3425 0x4E7E -0x3426 0x4F83 -0x3427 0x51A0 -0x3428 0x5BD2 -0x3429 0x520A -0x342A 0x52D8 -0x342B 0x52E7 -0x342C 0x5DFB -0x342D 0x559A -0x342E 0x582A -0x342F 0x59E6 -0x3430 0x5B8C -0x3431 0x5B98 -0x3432 0x5BDB -0x3433 0x5E72 -0x3434 0x5E79 -0x3435 0x60A3 -0x3436 0x611F -0x3437 0x6163 -0x3438 0x61BE -0x3439 0x63DB -0x343A 0x6562 -0x343B 0x67D1 -0x343C 0x6853 -0x343D 0x68FA -0x343E 0x6B3E -0x343F 0x6B53 -0x3440 0x6C57 -0x3441 0x6F22 -0x3442 0x6F97 -0x3443 0x6F45 -0x3444 0x74B0 -0x3445 0x7518 -0x3446 0x76E3 -0x3447 0x770B -0x3448 0x7AFF -0x3449 0x7BA1 -0x344A 0x7C21 -0x344B 0x7DE9 -0x344C 0x7F36 -0x344D 0x7FF0 -0x344E 0x809D -0x344F 0x8266 -0x3450 0x839E -0x3451 0x89B3 -0x3452 0x8ACC -0x3453 0x8CAB -0x3454 0x9084 -0x3455 0x9451 -0x3456 0x9593 -0x3457 0x9591 -0x3458 0x95A2 -0x3459 0x9665 -0x345A 0x97D3 -0x345B 0x9928 -0x345C 0x8218 -0x345D 0x4E38 -0x345E 0x542B -0x345F 0x5CB8 -0x3460 0x5DCC -0x3461 0x73A9 -0x3462 0x764C -0x3463 0x773C -0x3464 0x5CA9 -0x3465 0x7FEB -0x3466 0x8D0B -0x3467 0x96C1 -0x3468 0x9811 -0x3469 0x9854 -0x346A 0x9858 -0x346B 0x4F01 -0x346C 0x4F0E -0x346D 0x5371 -0x346E 0x559C -0x346F 0x5668 -0x3470 0x57FA -0x3471 0x5947 -0x3472 0x5B09 -0x3473 0x5BC4 -0x3474 0x5C90 -0x3475 0x5E0C -0x3476 0x5E7E -0x3477 0x5FCC -0x3478 0x63EE -0x3479 0x673A -0x347A 0x65D7 -0x347B 0x65E2 -0x347C 0x671F -0x347D 0x68CB -0x347E 0x68C4 -0x3521 0x6A5F -0x3522 0x5E30 -0x3523 0x6BC5 -0x3524 0x6C17 -0x3525 0x6C7D -0x3526 0x757F -0x3527 0x7948 -0x3528 0x5B63 -0x3529 0x7A00 -0x352A 0x7D00 -0x352B 0x5FBD -0x352C 0x898F -0x352D 0x8A18 -0x352E 0x8CB4 -0x352F 0x8D77 -0x3530 0x8ECC -0x3531 0x8F1D -0x3532 0x98E2 -0x3533 0x9A0E -0x3534 0x9B3C -0x3535 0x4E80 -0x3536 0x507D -0x3537 0x5100 -0x3538 0x5993 -0x3539 0x5B9C -0x353A 0x622F -0x353B 0x6280 -0x353C 0x64EC -0x353D 0x6B3A -0x353E 0x72A0 -0x353F 0x7591 -0x3540 0x7947 -0x3541 0x7FA9 -0x3542 0x87FB -0x3543 0x8ABC -0x3544 0x8B70 -0x3545 0x63AC -0x3546 0x83CA -0x3547 0x97A0 -0x3548 0x5409 -0x3549 0x5403 -0x354A 0x55AB -0x354B 0x6854 -0x354C 0x6A58 -0x354D 0x8A70 -0x354E 0x7827 -0x354F 0x6775 -0x3550 0x9ECD -0x3551 0x5374 -0x3552 0x5BA2 -0x3553 0x811A -0x3554 0x8650 -0x3555 0x9006 -0x3556 0x4E18 -0x3557 0x4E45 -0x3558 0x4EC7 -0x3559 0x4F11 -0x355A 0x53CA -0x355B 0x5438 -0x355C 0x5BAE -0x355D 0x5F13 -0x355E 0x6025 -0x355F 0x6551 -0x3560 0x673D -0x3561 0x6C42 -0x3562 0x6C72 -0x3563 0x6CE3 -0x3564 0x7078 -0x3565 0x7403 -0x3566 0x7A76 -0x3567 0x7AAE -0x3568 0x7B08 -0x3569 0x7D1A -0x356A 0x7CFE -0x356B 0x7D66 -0x356C 0x65E7 -0x356D 0x725B -0x356E 0x53BB -0x356F 0x5C45 -0x3570 0x5DE8 -0x3571 0x62D2 -0x3572 0x62E0 -0x3573 0x6319 -0x3574 0x6E20 -0x3575 0x865A -0x3576 0x8A31 -0x3577 0x8DDD -0x3578 0x92F8 -0x3579 0x6F01 -0x357A 0x79A6 -0x357B 0x9B5A -0x357C 0x4EA8 -0x357D 0x357E 0x4EAB -0x3621 0x4F9B -0x3622 0x4FA0 -0x3623 0x50D1 -0x3624 0x5147 -0x3625 0x7AF6 -0x3626 0x5171 -0x3627 0x51F6 -0x3628 0x5354 -0x3629 0x5321 -0x362A 0x537F -0x362B 0x53EB -0x362C 0x55AC -0x362D 0x5883 -0x362E 0x5CE1 -0x362F 0x5F37 -0x3630 0x5F4A -0x3631 0x602F -0x3632 0x6050 -0x3633 0x606D -0x3634 0x631F -0x3635 0x6559 -0x3636 0x6A4B -0x3637 0x6CC1 -0x3638 0x72C2 -0x3639 0x72ED -0x363A 0x77EF -0x363B 0x80F8 -0x363C 0x8105 -0x363D 0x8208 -0x363E 0x854E -0x363F 0x90F7 -0x3640 0x93E1 -0x3641 0x97FF -0x3642 0x9957 -0x3643 0x9A5A -0x3644 0x4EF0 -0x3645 0x51DD -0x3646 0x5C2D -0x3647 0x6681 -0x3648 0x696D -0x3649 0x5C40 -0x364A 0x66F2 -0x364B 0x6975 -0x364C 0x7389 -0x364D 0x6850 -0x364E 0x7C81 -0x364F 0x50C5 -0x3650 0x52E4 -0x3651 0x5747 -0x3652 0x5DFE -0x3653 0x9326 -0x3654 0x65A4 -0x3655 0x6B23 -0x3656 0x6B3D -0x3657 0x7434 -0x3658 0x7981 -0x3659 0x79BD -0x365A 0x7B4B -0x365B 0x7DCA -0x365C 0x82B9 -0x365D 0x83CC -0x365E 0x887F -0x365F 0x895F -0x3660 0x8B39 -0x3661 0x8FD1 -0x3662 0x91D1 -0x3663 0x541F -0x3664 0x9280 -0x3665 0x4E5D -0x3666 0x5036 -0x3667 0x53E5 -0x3668 0x533A -0x3669 0x72D7 -0x366A 0x7396 -0x366B 0x77E9 -0x366C 0x82E6 -0x366D 0x8EAF -0x366E 0x99C6 -0x366F 0x99C8 -0x3670 0x99D2 -0x3671 0x5177 -0x3672 0x611A -0x3673 0x865E -0x3674 0x55B0 -0x3675 0x7A7A -0x3676 0x5076 -0x3677 0x5BD3 -0x3678 0x9047 -0x3679 0x9685 -0x367A 0x4E32 -0x367B 0x6ADB -0x367C 0x91E7 -0x367D 0x5C51 -0x367E 0x5C48 -0x3721 0x6398 -0x3722 0x7A9F -0x3723 0x6C93 -0x3724 0x9774 -0x3725 0x8F61 -0x3726 0x7AAA -0x3727 0x718A -0x3728 0x9688 -0x3729 0x7C82 -0x372A 0x6817 -0x372B 0x7E70 -0x372C 0x6851 -0x372D 0x936C -0x372E 0x52F2 -0x372F 0x541B -0x3730 0x85AB -0x3731 0x8A13 -0x3732 0x7FA4 -0x3733 0x8ECD -0x3734 0x90E1 -0x3735 0x5366 -0x3736 0x8888 -0x3737 0x7941 -0x3738 0x4FC2 -0x3739 0x50BE -0x373A 0x5211 -0x373B 0x5144 -0x373C 0x5553 -0x373D 0x572D -0x373E 0x73EA -0x373F 0x578B -0x3740 0x5951 -0x3741 0x5F62 -0x3742 0x5F84 -0x3743 0x6075 -0x3744 0x6176 -0x3745 0x6167 -0x3746 0x61A9 -0x3747 0x63B2 -0x3748 0x643A -0x3749 0x656C -0x374A 0x666F -0x374B 0x6842 -0x374C 0x6E13 -0x374D 0x7566 -0x374E 0x7A3D -0x374F 0x7CFB -0x3750 0x7D4C -0x3751 0x7D99 -0x3752 0x7E4B -0x3753 0x7F6B -0x3754 0x830E -0x3755 0x834A -0x3756 0x86CD -0x3757 0x8A08 -0x3758 0x8A63 -0x3759 0x8B66 -0x375A 0x8EFD -0x375B 0x981A -0x375C 0x9D8F -0x375D 0x82B8 -0x375E 0x8FCE -0x375F 0x9BE8 -0x3760 0x5287 -0x3761 0x621F -0x3762 0x6483 -0x3763 0x6FC0 -0x3764 0x9699 -0x3765 0x6841 -0x3766 0x5091 -0x3767 0x6B20 -0x3768 0x6C7A -0x3769 0x6F54 -0x376A 0x7A74 -0x376B 0x7D50 -0x376C 0x8840 -0x376D 0x8A23 -0x376E 0x6708 -0x376F 0x4EF6 -0x3770 0x5039 -0x3771 0x5026 -0x3772 0x5065 -0x3773 0x517C -0x3774 0x5238 -0x3775 0x5263 -0x3776 0x55A7 -0x3777 0x570F -0x3778 0x5805 -0x3779 0x5ACC -0x377A 0x5EFA -0x377B 0x61B2 -0x377C 0x61F8 -0x377D 0x62F3 -0x377E 0x6372 -0x3821 0x691C -0x3822 0x6A29 -0x3823 0x727D -0x3824 0x72AC -0x3825 0x732E -0x3826 0x7814 -0x3827 0x786F -0x3828 0x7D79 -0x3829 0x770C -0x382A 0x80A9 -0x382B 0x898B -0x382C 0x8B19 -0x382D 0x8CE2 -0x382E 0x8ED2 -0x382F 0x9063 -0x3830 0x9375 -0x3831 0x967A -0x3832 0x9855 -0x3833 0x9A13 -0x3834 0x9E78 -0x3835 0x5143 -0x3836 0x539F -0x3837 0x53B3 -0x3838 0x5E7B -0x3839 0x5F26 -0x383A 0x6E1B -0x383B 0x6E90 -0x383C 0x7384 -0x383D 0x73FE -0x383E 0x7D43 -0x383F 0x8237 -0x3840 0x8A00 -0x3841 0x8AFA -0x3842 0x9650 -0x3843 0x4E4E -0x3844 0x500B -0x3845 0x53E4 -0x3846 0x547C -0x3847 0x56FA -0x3848 0x59D1 -0x3849 0x5B64 -0x384A 0x5DF1 -0x384B 0x5EAB -0x384C 0x5F27 -0x384D 0x6238 -0x384E 0x6545 -0x384F 0x67AF -0x3850 0x6E56 -0x3851 0x72D0 -0x3852 0x7CCA -0x3853 0x88B4 -0x3854 0x80A1 -0x3855 0x80E1 -0x3856 0x83F0 -0x3857 0x864E -0x3858 0x8A87 -0x3859 0x8DE8 -0x385A 0x9237 -0x385B 0x96C7 -0x385C 0x9867 -0x385D 0x9F13 -0x385E 0x4E94 -0x385F 0x4E92 -0x3860 0x4F0D -0x3861 0x5348 -0x3862 0x5449 -0x3863 0x543E -0x3864 0x5A2F -0x3865 0x5F8C -0x3866 0x5FA1 -0x3867 0x609F -0x3868 0x68A7 -0x3869 0x6A8E -0x386A 0x745A -0x386B 0x7881 -0x386C 0x8A9E -0x386D 0x8AA4 -0x386E 0x8B77 -0x386F 0x9190 -0x3870 0x4E5E -0x3871 0x9BC9 -0x3872 0x4EA4 -0x3873 0x4F7C -0x3874 0x4FAF -0x3875 0x5019 -0x3876 0x5016 -0x3877 0x5149 -0x3878 0x516C -0x3879 0x529F -0x387A 0x52B9 -0x387B 0x52FE -0x387C 0x539A -0x387D 0x53E3 -0x387E 0x5411 -0x3921 0x540E -0x3922 0x5589 -0x3923 0x5751 -0x3924 0x57A2 -0x3925 0x597D -0x3926 0x5B54 -0x3927 0x5B5D -0x3928 0x5B8F -0x3929 0x5DE5 -0x392A 0x5DE7 -0x392B 0x5DF7 -0x392C 0x5E78 -0x392D 0x5E83 -0x392E 0x5E9A -0x392F 0x5EB7 -0x3930 0x5F18 -0x3931 0x6052 -0x3932 0x614C -0x3933 0x6297 -0x3934 0x62D8 -0x3935 0x63A7 -0x3936 0x653B -0x3937 0x6602 -0x3938 0x6643 -0x3939 0x66F4 -0x393A 0x676D -0x393B 0x6821 -0x393C 0x6897 -0x393D 0x69CB -0x393E 0x6C5F -0x393F 0x6D2A -0x3940 0x6D69 -0x3941 0x6E2F -0x3942 0x6E9D -0x3943 0x7532 -0x3944 0x7687 -0x3945 0x786C -0x3946 0x7A3F -0x3947 0x7CE0 -0x3948 0x7D05 -0x3949 0x7D18 -0x394A 0x7D5E -0x394B 0x7DB1 -0x394C 0x8015 -0x394D 0x8003 -0x394E 0x80AF -0x394F 0x80B1 -0x3950 0x8154 -0x3951 0x818F -0x3952 0x822A -0x3953 0x8352 -0x3954 0x884C -0x3955 0x8861 -0x3956 0x8B1B -0x3957 0x8CA2 -0x3958 0x8CFC -0x3959 0x90CA -0x395A 0x9175 -0x395B 0x9271 -0x395C 0x783F -0x395D 0x92FC -0x395E 0x95A4 -0x395F 0x964D -0x3960 0x9805 -0x3961 0x9999 -0x3962 0x9AD8 -0x3963 0x9D3B -0x3964 0x525B -0x3965 0x52AB -0x3966 0x53F7 -0x3967 0x5408 -0x3968 0x58D5 -0x3969 0x62F7 -0x396A 0x6FE0 -0x396B 0x8C6A -0x396C 0x8F5F -0x396D 0x9EB9 -0x396E 0x514B -0x396F 0x523B -0x3970 0x544A -0x3971 0x56FD -0x3972 0x7A40 -0x3973 0x9177 -0x3974 0x9D60 -0x3975 0x9ED2 -0x3976 0x7344 -0x3977 0x6F09 -0x3978 0x8170 -0x3979 0x7511 -0x397A 0x5FFD -0x397B 0x60DA -0x397C 0x9AA8 -0x397D 0x72DB -0x397E 0x8FBC -0x3A21 0x6B64 -0x3A22 0x9803 -0x3A23 0x4ECA -0x3A24 0x56F0 -0x3A25 0x5764 -0x3A26 0x58BE -0x3A27 0x5A5A -0x3A28 0x6068 -0x3A29 0x61C7 -0x3A2A 0x660F -0x3A2B 0x6606 -0x3A2C 0x6839 -0x3A2D 0x68B1 -0x3A2E 0x6DF7 -0x3A2F 0x75D5 -0x3A30 0x7D3A -0x3A31 0x826E -0x3A32 0x9B42 -0x3A33 0x4E9B -0x3A34 0x4F50 -0x3A35 0x53C9 -0x3A36 0x5506 -0x3A37 0x5D6F -0x3A38 0x5DE6 -0x3A39 0x5DEE -0x3A3A 0x67FB -0x3A3B 0x6C99 -0x3A3C 0x7473 -0x3A3D 0x7802 -0x3A3E 0x8A50 -0x3A3F 0x9396 -0x3A40 0x88DF -0x3A41 0x5750 -0x3A42 0x5EA7 -0x3A43 0x632B -0x3A44 0x50B5 -0x3A45 0x50AC -0x3A46 0x518D -0x3A47 0x6700 -0x3A48 0x54C9 -0x3A49 0x585E -0x3A4A 0x59BB -0x3A4B 0x5BB0 -0x3A4C 0x5F69 -0x3A4D 0x624D -0x3A4E 0x63A1 -0x3A4F 0x683D -0x3A50 0x6B73 -0x3A51 0x6E08 -0x3A52 0x707D -0x3A53 0x91C7 -0x3A54 0x7280 -0x3A55 0x7815 -0x3A56 0x7826 -0x3A57 0x796D -0x3A58 0x658E -0x3A59 0x7D30 -0x3A5A 0x83DC -0x3A5B 0x88C1 -0x3A5C 0x8F09 -0x3A5D 0x969B -0x3A5E 0x5264 -0x3A5F 0x5728 -0x3A60 0x6750 -0x3A61 0x7F6A -0x3A62 0x8CA1 -0x3A63 0x51B4 -0x3A64 0x5742 -0x3A65 0x962A -0x3A66 0x583A -0x3A67 0x698A -0x3A68 0x80B4 -0x3A69 0x54B2 -0x3A6A 0x5D0E -0x3A6B 0x57FC -0x3A6C 0x7895 -0x3A6D 0x9DFA -0x3A6E 0x4F5C -0x3A6F 0x524A -0x3A70 0x548B -0x3A71 0x643E -0x3A72 0x6628 -0x3A73 0x6714 -0x3A74 0x67F5 -0x3A75 0x7A84 -0x3A76 0x7B56 -0x3A77 0x7D22 -0x3A78 0x932F -0x3A79 0x685C -0x3A7A 0x9BAD -0x3A7B 0x7B39 -0x3A7C 0x5319 -0x3A7D 0x518A -0x3A7E 0x5237 -0x3B21 0x5BDF -0x3B22 0x62F6 -0x3B23 0x64AE -0x3B24 0x64E6 -0x3B25 0x672D -0x3B26 0x6BBA -0x3B27 0x85A9 -0x3B28 0x96D1 -0x3B29 0x7690 -0x3B2A 0x9BD6 -0x3B2B 0x634C -0x3B2C 0x9306 -0x3B2D 0x9BAB -0x3B2E 0x76BF -0x3B2F 0x6652 -0x3B30 0x4E09 -0x3B31 0x5098 -0x3B32 0x53C2 -0x3B33 0x5C71 -0x3B34 0x60E8 -0x3B35 0x6492 -0x3B36 0x6563 -0x3B37 0x685F -0x3B38 0x71E6 -0x3B39 0x73CA -0x3B3A 0x7523 -0x3B3B 0x7B97 -0x3B3C 0x7E82 -0x3B3D 0x8695 -0x3B3E 0x8B83 -0x3B3F 0x8CDB -0x3B40 0x9178 -0x3B41 0x9910 -0x3B42 0x65AC -0x3B43 0x66AB -0x3B44 0x6B8B -0x3B45 0x4ED5 -0x3B46 0x4ED4 -0x3B47 0x4F3A -0x3B48 0x4F7F -0x3B49 0x523A -0x3B4A 0x53F8 -0x3B4B 0x53F2 -0x3B4C 0x55E3 -0x3B4D 0x56DB -0x3B4E 0x58EB -0x3B4F 0x59CB -0x3B50 0x59C9 -0x3B51 0x59FF -0x3B52 0x5B50 -0x3B53 0x5C4D -0x3B54 0x5E02 -0x3B55 0x5E2B -0x3B56 0x5FD7 -0x3B57 0x601D -0x3B58 0x6307 -0x3B59 0x652F -0x3B5A 0x5B5C -0x3B5B 0x65AF -0x3B5C 0x65BD -0x3B5D 0x65E8 -0x3B5E 0x679D -0x3B5F 0x6B62 -0x3B60 0x6B7B -0x3B61 0x6C0F -0x3B62 0x7345 -0x3B63 0x7949 -0x3B64 0x79C1 -0x3B65 0x7CF8 -0x3B66 0x7D19 -0x3B67 0x7D2B -0x3B68 0x80A2 -0x3B69 0x8102 -0x3B6A 0x81F3 -0x3B6B 0x8996 -0x3B6C 0x8A5E -0x3B6D 0x8A69 -0x3B6E 0x8A66 -0x3B6F 0x8A8C -0x3B70 0x8AEE -0x3B71 0x8CC7 -0x3B72 0x8CDC -0x3B73 0x96CC -0x3B74 0x98FC -0x3B75 0x6B6F -0x3B76 0x4E8B -0x3B77 0x4F3C -0x3B78 0x4F8D -0x3B79 0x5150 -0x3B7A 0x5B57 -0x3B7B 0x5BFA -0x3B7C 0x6148 -0x3B7D 0x6301 -0x3B7E 0x6642 -0x3C21 0x6B21 -0x3C22 0x6ECB -0x3C23 0x6CBB -0x3C24 0x723E -0x3C25 0x74BD -0x3C26 0x75D4 -0x3C27 0x78C1 -0x3C28 0x793A -0x3C29 0x800C -0x3C2A 0x8033 -0x3C2B 0x81EA -0x3C2C 0x8494 -0x3C2D 0x8F9E -0x3C2E 0x6C50 -0x3C2F 0x9E7F -0x3C30 0x5F0F -0x3C31 0x8B58 -0x3C32 0x9D2B -0x3C33 0x7AFA -0x3C34 0x8EF8 -0x3C35 0x5B8D -0x3C36 0x96EB -0x3C37 0x4E03 -0x3C38 0x53F1 -0x3C39 0x57F7 -0x3C3A 0x5931 -0x3C3B 0x5AC9 -0x3C3C 0x5BA4 -0x3C3D 0x6089 -0x3C3E 0x6E7F -0x3C3F 0x6F06 -0x3C40 0x75BE -0x3C41 0x8CEA -0x3C42 0x5B9F -0x3C43 0x8500 -0x3C44 0x7BE0 -0x3C45 0x5072 -0x3C46 0x67F4 -0x3C47 0x829D -0x3C48 0x5C61 -0x3C49 0x854A -0x3C4A 0x7E1E -0x3C4B 0x820E -0x3C4C 0x5199 -0x3C4D 0x5C04 -0x3C4E 0x6368 -0x3C4F 0x8D66 -0x3C50 0x659C -0x3C51 0x716E -0x3C52 0x793E -0x3C53 0x7D17 -0x3C54 0x8005 -0x3C55 0x8B1D -0x3C56 0x8ECA -0x3C57 0x906E -0x3C58 0x86C7 -0x3C59 0x90AA -0x3C5A 0x501F -0x3C5B 0x52FA -0x3C5C 0x5C3A -0x3C5D 0x6753 -0x3C5E 0x707C -0x3C5F 0x7235 -0x3C60 0x914C -0x3C61 0x91C8 -0x3C62 0x932B -0x3C63 0x82E5 -0x3C64 0x5BC2 -0x3C65 0x5F31 -0x3C66 0x60F9 -0x3C67 0x4E3B -0x3C68 0x53D6 -0x3C69 0x5B88 -0x3C6A 0x624B -0x3C6B 0x6731 -0x3C6C 0x6B8A -0x3C6D 0x72E9 -0x3C6E 0x73E0 -0x3C6F 0x7A2E -0x3C70 0x816B -0x3C71 0x8DA3 -0x3C72 0x9152 -0x3C73 0x9996 -0x3C74 0x5112 -0x3C75 0x53D7 -0x3C76 0x546A -0x3C77 0x5BFF -0x3C78 0x6388 -0x3C79 0x6A39 -0x3C7A 0x7DAC -0x3C7B 0x9700 -0x3C7C 0x56DA -0x3C7D 0x53CE -0x3C7E 0x5468 -0x3D21 0x5B97 -0x3D22 0x5C31 -0x3D23 0x5DDE -0x3D24 0x4FEE -0x3D25 0x6101 -0x3D26 0x62FE -0x3D27 0x6D32 -0x3D28 0x79C0 -0x3D29 0x79CB -0x3D2A 0x7D42 -0x3D2B 0x7E4D -0x3D2C 0x7FD2 -0x3D2D 0x81ED -0x3D2E 0x821F -0x3D2F 0x8490 -0x3D30 0x8846 -0x3D31 0x8972 -0x3D32 0x8B90 -0x3D33 0x8E74 -0x3D34 0x8F2F -0x3D35 0x9031 -0x3D36 0x914B -0x3D37 0x916C -0x3D38 0x96C6 -0x3D39 0x919C -0x3D3A 0x4EC0 -0x3D3B 0x4F4F -0x3D3C 0x5145 -0x3D3D 0x5341 -0x3D3E 0x5F93 -0x3D3F 0x620E -0x3D40 0x67D4 -0x3D41 0x6C41 -0x3D42 0x6E0B -0x3D43 0x7363 -0x3D44 0x7E26 -0x3D45 0x91CD -0x3D46 0x9283 -0x3D47 0x53D4 -0x3D48 0x5919 -0x3D49 0x5BBF -0x3D4A 0x6DD1 -0x3D4B 0x795D -0x3D4C 0x7E2E -0x3D4D 0x7C9B -0x3D4E 0x587E -0x3D4F 0x719F -0x3D50 0x51FA -0x3D51 0x8853 -0x3D52 0x8FF0 -0x3D53 0x4FCA -0x3D54 0x5CFB -0x3D55 0x6625 -0x3D56 0x77AC -0x3D57 0x7AE3 -0x3D58 0x821C -0x3D59 0x99FF -0x3D5A 0x51C6 -0x3D5B 0x5FAA -0x3D5C 0x65EC -0x3D5D 0x696F -0x3D5E 0x6B89 -0x3D5F 0x6DF3 -0x3D60 0x6E96 -0x3D61 0x6F64 -0x3D62 0x76FE -0x3D63 0x7D14 -0x3D64 0x5DE1 -0x3D65 0x9075 -0x3D66 0x9187 -0x3D67 0x9806 -0x3D68 0x51E6 -0x3D69 0x521D -0x3D6A 0x6240 -0x3D6B 0x6691 -0x3D6C 0x66D9 -0x3D6D 0x6E1A -0x3D6E 0x5EB6 -0x3D6F 0x7DD2 -0x3D70 0x7F72 -0x3D71 0x66F8 -0x3D72 0x85AF -0x3D73 0x85F7 -0x3D74 0x8AF8 -0x3D75 0x52A9 -0x3D76 0x53D9 -0x3D77 0x5973 -0x3D78 0x5E8F -0x3D79 0x5F90 -0x3D7A 0x6055 -0x3D7B 0x92E4 -0x3D7C 0x9664 -0x3D7D 0x50B7 -0x3D7E 0x511F -0x3E21 0x52DD -0x3E22 0x5320 -0x3E23 0x5347 -0x3E24 0x53EC -0x3E25 0x54E8 -0x3E26 0x5546 -0x3E27 0x5531 -0x3E28 0x5617 -0x3E29 0x5968 -0x3E2A 0x59BE -0x3E2B 0x5A3C -0x3E2C 0x5BB5 -0x3E2D 0x5C06 -0x3E2E 0x5C0F -0x3E2F 0x5C11 -0x3E30 0x5C1A -0x3E31 0x5E84 -0x3E32 0x5E8A -0x3E33 0x5EE0 -0x3E34 0x5F70 -0x3E35 0x627F -0x3E36 0x6284 -0x3E37 0x62DB -0x3E38 0x638C -0x3E39 0x6377 -0x3E3A 0x6607 -0x3E3B 0x660C -0x3E3C 0x662D -0x3E3D 0x6676 -0x3E3E 0x677E -0x3E3F 0x68A2 -0x3E40 0x6A1F -0x3E41 0x6A35 -0x3E42 0x6CBC -0x3E43 0x6D88 -0x3E44 0x6E09 -0x3E45 0x6E58 -0x3E46 0x713C -0x3E47 0x7126 -0x3E48 0x7167 -0x3E49 0x75C7 -0x3E4A 0x7701 -0x3E4B 0x785D -0x3E4C 0x7901 -0x3E4D 0x7965 -0x3E4E 0x79F0 -0x3E4F 0x7AE0 -0x3E50 0x7B11 -0x3E51 0x7CA7 -0x3E52 0x7D39 -0x3E53 0x8096 -0x3E54 0x83D6 -0x3E55 0x848B -0x3E56 0x8549 -0x3E57 0x885D -0x3E58 0x88F3 -0x3E59 0x8A1F -0x3E5A 0x8A3C -0x3E5B 0x8A54 -0x3E5C 0x8A73 -0x3E5D 0x8C61 -0x3E5E 0x8CDE -0x3E5F 0x91A4 -0x3E60 0x9266 -0x3E61 0x937E -0x3E62 0x9418 -0x3E63 0x969C -0x3E64 0x9798 -0x3E65 0x4E0A -0x3E66 0x4E08 -0x3E67 0x4E1E -0x3E68 0x4E57 -0x3E69 0x5197 -0x3E6A 0x5270 -0x3E6B 0x57CE -0x3E6C 0x5834 -0x3E6D 0x58CC -0x3E6E 0x5B22 -0x3E6F 0x5E38 -0x3E70 0x60C5 -0x3E71 0x64FE -0x3E72 0x6761 -0x3E73 0x6756 -0x3E74 0x6D44 -0x3E75 0x72B6 -0x3E76 0x7573 -0x3E77 0x7A63 -0x3E78 0x84B8 -0x3E79 0x8B72 -0x3E7A 0x91B8 -0x3E7B 0x9320 -0x3E7C 0x5631 -0x3E7D 0x57F4 -0x3E7E 0x98FE -0x3F21 0x62ED -0x3F22 0x690D -0x3F23 0x6B96 -0x3F24 0x71ED -0x3F25 0x7E54 -0x3F26 0x8077 -0x3F27 0x8272 -0x3F28 0x89E6 -0x3F29 0x98DF -0x3F2A 0x8755 -0x3F2B 0x8FB1 -0x3F2C 0x5C3B -0x3F2D 0x4F38 -0x3F2E 0x4FE1 -0x3F2F 0x4FB5 -0x3F30 0x5507 -0x3F31 0x5A20 -0x3F32 0x5BDD -0x3F33 0x5BE9 -0x3F34 0x5FC3 -0x3F35 0x614E -0x3F36 0x632F -0x3F37 0x65B0 -0x3F38 0x664B -0x3F39 0x68EE -0x3F3A 0x699B -0x3F3B 0x6D78 -0x3F3C 0x6DF1 -0x3F3D 0x7533 -0x3F3E 0x75B9 -0x3F3F 0x771F -0x3F40 0x795E -0x3F41 0x79E6 -0x3F42 0x7D33 -0x3F43 0x81E3 -0x3F44 0x82AF -0x3F45 0x85AA -0x3F46 0x89AA -0x3F47 0x8A3A -0x3F48 0x8EAB -0x3F49 0x8F9B -0x3F4A 0x9032 -0x3F4B 0x91DD -0x3F4C 0x9707 -0x3F4D 0x4EBA -0x3F4E 0x4EC1 -0x3F4F 0x5203 -0x3F50 0x5875 -0x3F51 0x58EC -0x3F52 0x5C0B -0x3F53 0x751A -0x3F54 0x5C3D -0x3F55 0x814E -0x3F56 0x8A0A -0x3F57 0x8FC5 -0x3F58 0x9663 -0x3F59 0x976D -0x3F5A 0x7B25 -0x3F5B 0x8ACF -0x3F5C 0x9808 -0x3F5D 0x9162 -0x3F5E 0x56F3 -0x3F5F 0x53A8 -0x3F60 0x9017 -0x3F61 0x5439 -0x3F62 0x5782 -0x3F63 0x5E25 -0x3F64 0x63A8 -0x3F65 0x6C34 -0x3F66 0x708A -0x3F67 0x7761 -0x3F68 0x7C8B -0x3F69 0x7FE0 -0x3F6A 0x8870 -0x3F6B 0x9042 -0x3F6C 0x9154 -0x3F6D 0x9310 -0x3F6E 0x9318 -0x3F6F 0x968F -0x3F70 0x745E -0x3F71 0x9AC4 -0x3F72 0x5D07 -0x3F73 0x5D69 -0x3F74 0x6570 -0x3F75 0x67A2 -0x3F76 0x8DA8 -0x3F77 0x96DB -0x3F78 0x636E -0x3F79 0x6749 -0x3F7A 0x6919 -0x3F7B 0x83C5 -0x3F7C 0x9817 -0x3F7D 0x96C0 -0x3F7E 0x88FE -0x4021 0x6F84 -0x4022 0x647A -0x4023 0x5BF8 -0x4024 0x4E16 -0x4025 0x702C -0x4026 0x755D -0x4027 0x662F -0x4028 0x51C4 -0x4029 0x5236 -0x402A 0x52E2 -0x402B 0x59D3 -0x402C 0x5F81 -0x402D 0x6027 -0x402E 0x6210 -0x402F 0x653F -0x4030 0x6574 -0x4031 0x661F -0x4032 0x6674 -0x4033 0x68F2 -0x4034 0x6816 -0x4035 0x6B63 -0x4036 0x6E05 -0x4037 0x7272 -0x4038 0x751F -0x4039 0x76DB -0x403A 0x7CBE -0x403B 0x8056 -0x403C 0x58F0 -0x403D 0x88FD -0x403E 0x897F -0x403F 0x8AA0 -0x4040 0x8A93 -0x4041 0x8ACB -0x4042 0x901D -0x4043 0x9192 -0x4044 0x9752 -0x4045 0x9759 -0x4046 0x6589 -0x4047 0x7A0E -0x4048 0x8106 -0x4049 0x96BB -0x404A 0x5E2D -0x404B 0x60DC -0x404C 0x621A -0x404D 0x65A5 -0x404E 0x6614 -0x404F 0x6790 -0x4050 0x77F3 -0x4051 0x7A4D -0x4052 0x7C4D -0x4053 0x7E3E -0x4054 0x810A -0x4055 0x8CAC -0x4056 0x8D64 -0x4057 0x8DE1 -0x4058 0x8E5F -0x4059 0x78A9 -0x405A 0x5207 -0x405B 0x62D9 -0x405C 0x63A5 -0x405D 0x6442 -0x405E 0x6298 -0x405F 0x8A2D -0x4060 0x7A83 -0x4061 0x7BC0 -0x4062 0x8AAC -0x4063 0x96EA -0x4064 0x7D76 -0x4065 0x820C -0x4066 0x8749 -0x4067 0x4ED9 -0x4068 0x5148 -0x4069 0x5343 -0x406A 0x5360 -0x406B 0x5BA3 -0x406C 0x5C02 -0x406D 0x5C16 -0x406E 0x5DDD -0x406F 0x6226 -0x4070 0x6247 -0x4071 0x64B0 -0x4072 0x6813 -0x4073 0x6834 -0x4074 0x6CC9 -0x4075 0x6D45 -0x4076 0x6D17 -0x4077 0x67D3 -0x4078 0x6F5C -0x4079 0x714E -0x407A 0x717D -0x407B 0x65CB -0x407C 0x7A7F -0x407D 0x7BAD -0x407E 0x7DDA -0x4121 0x7E4A -0x4122 0x7FA8 -0x4123 0x817A -0x4124 0x821B -0x4125 0x8239 -0x4126 0x85A6 -0x4127 0x8A6E -0x4128 0x8CCE -0x4129 0x8DF5 -0x412A 0x9078 -0x412B 0x9077 -0x412C 0x92AD -0x412D 0x9291 -0x412E 0x9583 -0x412F 0x9BAE -0x4130 0x524D -0x4131 0x5584 -0x4132 0x6F38 -0x4133 0x7136 -0x4134 0x5168 -0x4135 0x7985 -0x4136 0x7E55 -0x4137 0x81B3 -0x4138 0x7CCE -0x4139 0x564C -0x413A 0x5851 -0x413B 0x5CA8 -0x413C 0x63AA -0x413D 0x66FE -0x413E 0x66FD -0x413F 0x695A -0x4140 0x72D9 -0x4141 0x758F -0x4142 0x758E -0x4143 0x790E -0x4144 0x7956 -0x4145 0x79DF -0x4146 0x7C97 -0x4147 0x7D20 -0x4148 0x7D44 -0x4149 0x8607 -0x414A 0x8A34 -0x414B 0x963B -0x414C 0x9061 -0x414D 0x9F20 -0x414E 0x50E7 -0x414F 0x5275 -0x4150 0x53CC -0x4151 0x53E2 -0x4152 0x5009 -0x4153 0x55AA -0x4154 0x58EE -0x4155 0x594F -0x4156 0x723D -0x4157 0x5B8B -0x4158 0x5C64 -0x4159 0x531D -0x415A 0x60E3 -0x415B 0x60F3 -0x415C 0x635C -0x415D 0x6383 -0x415E 0x633F -0x415F 0x63BB -0x4160 0x64CD -0x4161 0x65E9 -0x4162 0x66F9 -0x4163 0x5DE3 -0x4164 0x69CD -0x4165 0x69FD -0x4166 0x6F15 -0x4167 0x71E5 -0x4168 0x4E89 -0x4169 0x75E9 -0x416A 0x76F8 -0x416B 0x7A93 -0x416C 0x7CDF -0x416D 0x7DCF -0x416E 0x7D9C -0x416F 0x8061 -0x4170 0x8349 -0x4171 0x8358 -0x4172 0x846C -0x4173 0x84BC -0x4174 0x85FB -0x4175 0x88C5 -0x4176 0x8D70 -0x4177 0x9001 -0x4178 0x906D -0x4179 0x9397 -0x417A 0x971C -0x417B 0x9A12 -0x417C 0x50CF -0x417D 0x5897 -0x417E 0x618E -0x4221 0x81D3 -0x4222 0x8535 -0x4223 0x8D08 -0x4224 0x9020 -0x4225 0x4FC3 -0x4226 0x5074 -0x4227 0x5247 -0x4228 0x5373 -0x4229 0x606F -0x422A 0x6349 -0x422B 0x675F -0x422C 0x6E2C -0x422D 0x8DB3 -0x422E 0x901F -0x422F 0x4FD7 -0x4230 0x5C5E -0x4231 0x8CCA -0x4232 0x65CF -0x4233 0x7D9A -0x4234 0x5352 -0x4235 0x8896 -0x4236 0x5176 -0x4237 0x63C3 -0x4238 0x5B58 -0x4239 0x5B6B -0x423A 0x5C0A -0x423B 0x640D -0x423C 0x6751 -0x423D 0x905C -0x423E 0x4ED6 -0x423F 0x591A -0x4240 0x592A -0x4241 0x6C70 -0x4242 0x8A51 -0x4243 0x553E -0x4244 0x5815 -0x4245 0x59A5 -0x4246 0x60F0 -0x4247 0x6253 -0x4248 0x67C1 -0x4249 0x8235 -0x424A 0x6955 -0x424B 0x9640 -0x424C 0x99C4 -0x424D 0x9A28 -0x424E 0x4F53 -0x424F 0x5806 -0x4250 0x5BFE -0x4251 0x8010 -0x4252 0x5CB1 -0x4253 0x5E2F -0x4254 0x5F85 -0x4255 0x6020 -0x4256 0x614B -0x4257 0x6234 -0x4258 0x66FF -0x4259 0x6CF0 -0x425A 0x6EDE -0x425B 0x80CE -0x425C 0x817F -0x425D 0x82D4 -0x425E 0x888B -0x425F 0x8CB8 -0x4260 0x9000 -0x4261 0x902E -0x4262 0x968A -0x4263 0x9EDB -0x4264 0x9BDB -0x4265 0x4EE3 -0x4266 0x53F0 -0x4267 0x5927 -0x4268 0x7B2C -0x4269 0x918D -0x426A 0x984C -0x426B 0x9DF9 -0x426C 0x6EDD -0x426D 0x7027 -0x426E 0x5353 -0x426F 0x5544 -0x4270 0x5B85 -0x4271 0x6258 -0x4272 0x629E -0x4273 0x62D3 -0x4274 0x6CA2 -0x4275 0x6FEF -0x4276 0x7422 -0x4277 0x8A17 -0x4278 0x9438 -0x4279 0x6FC1 -0x427A 0x8AFE -0x427B 0x8338 -0x427C 0x51E7 -0x427D 0x86F8 -0x427E 0x53EA -0x4321 0x53E9 -0x4322 0x4F46 -0x4323 0x9054 -0x4324 0x8FB0 -0x4325 0x596A -0x4326 0x8131 -0x4327 0x5DFD -0x4328 0x7AEA -0x4329 0x8FBF -0x432A 0x68DA -0x432B 0x8C37 -0x432C 0x72F8 -0x432D 0x9C48 -0x432E 0x6A3D -0x432F 0x8AB0 -0x4330 0x4E39 -0x4331 0x5358 -0x4332 0x5606 -0x4333 0x5766 -0x4334 0x62C5 -0x4335 0x63A2 -0x4336 0x65E6 -0x4337 0x6B4E -0x4338 0x6DE1 -0x4339 0x6E5B -0x433A 0x70AD -0x433B 0x77ED -0x433C 0x7AEF -0x433D 0x7BAA -0x433E 0x7DBB -0x433F 0x803D -0x4340 0x80C6 -0x4341 0x86CB -0x4342 0x8A95 -0x4343 0x935B -0x4344 0x56E3 -0x4345 0x58C7 -0x4346 0x5F3E -0x4347 0x65AD -0x4348 0x6696 -0x4349 0x6A80 -0x434A 0x6BB5 -0x434B 0x7537 -0x434C 0x8AC7 -0x434D 0x5024 -0x434E 0x77E5 -0x434F 0x5730 -0x4350 0x5F1B -0x4351 0x6065 -0x4352 0x667A -0x4353 0x6C60 -0x4354 0x75F4 -0x4355 0x7A1A -0x4356 0x7F6E -0x4357 0x81F4 -0x4358 0x8718 -0x4359 0x9045 -0x435A 0x99B3 -0x435B 0x7BC9 -0x435C 0x755C -0x435D 0x7AF9 -0x435E 0x7B51 -0x435F 0x84C4 -0x4360 0x9010 -0x4361 0x79E9 -0x4362 0x7A92 -0x4363 0x8336 -0x4364 0x5AE1 -0x4365 0x7740 -0x4366 0x4E2D -0x4367 0x4EF2 -0x4368 0x5B99 -0x4369 0x5FE0 -0x436A 0x62BD -0x436B 0x663C -0x436C 0x67F1 -0x436D 0x6CE8 -0x436E 0x866B -0x436F 0x8877 -0x4370 0x8A3B -0x4371 0x914E -0x4372 0x92F3 -0x4373 0x99D0 -0x4374 0x6A17 -0x4375 0x7026 -0x4376 0x732A -0x4377 0x82E7 -0x4378 0x8457 -0x4379 0x8CAF -0x437A 0x4E01 -0x437B 0x5146 -0x437C 0x51CB -0x437D 0x558B -0x437E 0x5BF5 -0x4421 0x5E16 -0x4422 0x5E33 -0x4423 0x5E81 -0x4424 0x5F14 -0x4425 0x5F35 -0x4426 0x5F6B -0x4427 0x5FB4 -0x4428 0x61F2 -0x4429 0x6311 -0x442A 0x66A2 -0x442B 0x671D -0x442C 0x6F6E -0x442D 0x7252 -0x442E 0x753A -0x442F 0x773A -0x4430 0x8074 -0x4431 0x8139 -0x4432 0x8178 -0x4433 0x8776 -0x4434 0x8ABF -0x4435 0x8ADC -0x4436 0x8D85 -0x4437 0x8DF3 -0x4438 0x929A -0x4439 0x9577 -0x443A 0x9802 -0x443B 0x9CE5 -0x443C 0x52C5 -0x443D 0x6357 -0x443E 0x76F4 -0x443F 0x6715 -0x4440 0x6C88 -0x4441 0x73CD -0x4442 0x8CC3 -0x4443 0x93AE -0x4444 0x9673 -0x4445 0x6D25 -0x4446 0x589C -0x4447 0x690E -0x4448 0x69CC -0x4449 0x8FFD -0x444A 0x939A -0x444B 0x75DB -0x444C 0x901A -0x444D 0x585A -0x444E 0x6802 -0x444F 0x63B4 -0x4450 0x69FB -0x4451 0x4F43 -0x4452 0x6F2C -0x4453 0x67D8 -0x4454 0x8FBB -0x4455 0x8526 -0x4456 0x7DB4 -0x4457 0x9354 -0x4458 0x693F -0x4459 0x6F70 -0x445A 0x576A -0x445B 0x58F7 -0x445C 0x5B2C -0x445D 0x7D2C -0x445E 0x722A -0x445F 0x540A -0x4460 0x91E3 -0x4461 0x9DB4 -0x4462 0x4EAD -0x4463 0x4F4E -0x4464 0x505C -0x4465 0x5075 -0x4466 0x5243 -0x4467 0x8C9E -0x4468 0x5448 -0x4469 0x5824 -0x446A 0x5B9A -0x446B 0x5E1D -0x446C 0x5E95 -0x446D 0x5EAD -0x446E 0x5EF7 -0x446F 0x5F1F -0x4470 0x608C -0x4471 0x62B5 -0x4472 0x633A -0x4473 0x63D0 -0x4474 0x68AF -0x4475 0x6C40 -0x4476 0x7887 -0x4477 0x798E -0x4478 0x7A0B -0x4479 0x7DE0 -0x447A 0x8247 -0x447B 0x8A02 -0x447C 0x8AE6 -0x447D 0x8E44 -0x447E 0x9013 -0x4521 0x90B8 -0x4522 0x912D -0x4523 0x91D8 -0x4524 0x9F0E -0x4525 0x6CE5 -0x4526 0x6458 -0x4527 0x64E2 -0x4528 0x6575 -0x4529 0x6EF4 -0x452A 0x7684 -0x452B 0x7B1B -0x452C 0x9069 -0x452D 0x93D1 -0x452E 0x6EBA -0x452F 0x54F2 -0x4530 0x5FB9 -0x4531 0x64A4 -0x4532 0x8F4D -0x4533 0x8FED -0x4534 0x9244 -0x4535 0x5178 -0x4536 0x586B -0x4537 0x5929 -0x4538 0x5C55 -0x4539 0x5E97 -0x453A 0x6DFB -0x453B 0x7E8F -0x453C 0x751C -0x453D 0x8CBC -0x453E 0x8EE2 -0x453F 0x985B -0x4540 0x70B9 -0x4541 0x4F1D -0x4542 0x6BBF -0x4543 0x6FB1 -0x4544 0x7530 -0x4545 0x96FB -0x4546 0x514E -0x4547 0x5410 -0x4548 0x5835 -0x4549 0x5857 -0x454A 0x59AC -0x454B 0x5C60 -0x454C 0x5F92 -0x454D 0x6597 -0x454E 0x675C -0x454F 0x6E21 -0x4550 0x767B -0x4551 0x83DF -0x4552 0x8CED -0x4553 0x9014 -0x4554 0x90FD -0x4555 0x934D -0x4556 0x7825 -0x4557 0x783A -0x4558 0x52AA -0x4559 0x5EA6 -0x455A 0x571F -0x455B 0x5974 -0x455C 0x6012 -0x455D 0x5012 -0x455E 0x515A -0x455F 0x51AC -0x4560 0x51CD -0x4561 0x5200 -0x4562 0x5510 -0x4563 0x5854 -0x4564 0x5858 -0x4565 0x5957 -0x4566 0x5B95 -0x4567 0x5CF6 -0x4568 0x5D8B -0x4569 0x60BC -0x456A 0x6295 -0x456B 0x642D -0x456C 0x6771 -0x456D 0x6843 -0x456E 0x68BC -0x456F 0x68DF -0x4570 0x76D7 -0x4571 0x6DD8 -0x4572 0x6E6F -0x4573 0x6D9B -0x4574 0x706F -0x4575 0x71C8 -0x4576 0x5F53 -0x4577 0x75D8 -0x4578 0x7977 -0x4579 0x7B49 -0x457A 0x7B54 -0x457B 0x7B52 -0x457C 0x7CD6 -0x457D 0x7D71 -0x457E 0x5230 -0x4621 0x8463 -0x4622 0x8569 -0x4623 0x85E4 -0x4624 0x8A0E -0x4625 0x8B04 -0x4626 0x8C46 -0x4627 0x8E0F -0x4628 0x9003 -0x4629 0x900F -0x462A 0x9419 -0x462B 0x9676 -0x462C 0x982D -0x462D 0x9A30 -0x462E 0x95D8 -0x462F 0x50CD -0x4630 0x52D5 -0x4631 0x540C -0x4632 0x5802 -0x4633 0x5C0E -0x4634 0x61A7 -0x4635 0x649E -0x4636 0x6D1E -0x4637 0x77B3 -0x4638 0x7AE5 -0x4639 0x80F4 -0x463A 0x8404 -0x463B 0x9053 -0x463C 0x9285 -0x463D 0x5CE0 -0x463E 0x9D07 -0x463F 0x533F -0x4640 0x5F97 -0x4641 0x5FB3 -0x4642 0x6D9C -0x4643 0x7279 -0x4644 0x7763 -0x4645 0x79BF -0x4646 0x7BE4 -0x4647 0x6BD2 -0x4648 0x72EC -0x4649 0x8AAD -0x464A 0x6803 -0x464B 0x6A61 -0x464C 0x51F8 -0x464D 0x7A81 -0x464E 0x6934 -0x464F 0x5C4A -0x4650 0x9CF6 -0x4651 0x82EB -0x4652 0x5BC5 -0x4653 0x9149 -0x4654 0x701E -0x4655 0x5678 -0x4656 0x5C6F -0x4657 0x60C7 -0x4658 0x6566 -0x4659 0x6C8C -0x465A 0x8C5A -0x465B 0x9041 -0x465C 0x9813 -0x465D 0x5451 -0x465E 0x66C7 -0x465F 0x920D -0x4660 0x5948 -0x4661 0x90A3 -0x4662 0x5185 -0x4663 0x4E4D -0x4664 0x51EA -0x4665 0x8599 -0x4666 0x8B0E -0x4667 0x7058 -0x4668 0x637A -0x4669 0x934B -0x466A 0x6962 -0x466B 0x99B4 -0x466C 0x7E04 -0x466D 0x7577 -0x466E 0x5357 -0x466F 0x6960 -0x4670 0x8EDF -0x4671 0x96E3 -0x4672 0x6C5D -0x4673 0x4E8C -0x4674 0x5C3C -0x4675 0x5F10 -0x4676 0x8FE9 -0x4677 0x5302 -0x4678 0x8CD1 -0x4679 0x8089 -0x467A 0x8679 -0x467B 0x5EFF -0x467C 0x65E5 -0x467D 0x4E73 -0x467E 0x5165 -0x4721 0x5982 -0x4722 0x5C3F -0x4723 0x97EE -0x4724 0x4EFB -0x4725 0x598A -0x4726 0x5FCD -0x4727 0x8A8D -0x4728 0x6FE1 -0x4729 0x79B0 -0x472A 0x7962 -0x472B 0x5BE7 -0x472C 0x8471 -0x472D 0x732B -0x472E 0x71B1 -0x472F 0x5E74 -0x4730 0x5FF5 -0x4731 0x637B -0x4732 0x649A -0x4733 0x71C3 -0x4734 0x7C98 -0x4735 0x4E43 -0x4736 0x5EFC -0x4737 0x4E4B -0x4738 0x57DC -0x4739 0x56A2 -0x473A 0x60A9 -0x473B 0x6FC3 -0x473C 0x7D0D -0x473D 0x80FD -0x473E 0x8133 -0x473F 0x81BF -0x4740 0x8FB2 -0x4741 0x8997 -0x4742 0x86A4 -0x4743 0x5DF4 -0x4744 0x628A -0x4745 0x64AD -0x4746 0x8987 -0x4747 0x6777 -0x4748 0x6CE2 -0x4749 0x6D3E -0x474A 0x7436 -0x474B 0x7834 -0x474C 0x5A46 -0x474D 0x7F75 -0x474E 0x82AD -0x474F 0x99AC -0x4750 0x4FF3 -0x4751 0x5EC3 -0x4752 0x62DD -0x4753 0x6392 -0x4754 0x6557 -0x4755 0x676F -0x4756 0x76C3 -0x4757 0x724C -0x4758 0x80CC -0x4759 0x80BA -0x475A 0x8F29 -0x475B 0x914D -0x475C 0x500D -0x475D 0x57F9 -0x475E 0x5A92 -0x475F 0x6885 -0x4760 0x6973 -0x4761 0x7164 -0x4762 0x72FD -0x4763 0x8CB7 -0x4764 0x58F2 -0x4765 0x8CE0 -0x4766 0x966A -0x4767 0x9019 -0x4768 0x877F -0x4769 0x79E4 -0x476A 0x77E7 -0x476B 0x8429 -0x476C 0x4F2F -0x476D 0x5265 -0x476E 0x535A -0x476F 0x62CD -0x4770 0x67CF -0x4771 0x6CCA -0x4772 0x767D -0x4773 0x7B94 -0x4774 0x7C95 -0x4775 0x8236 -0x4776 0x8584 -0x4777 0x8FEB -0x4778 0x66DD -0x4779 0x6F20 -0x477A 0x7206 -0x477B 0x7E1B -0x477C 0x83AB -0x477D 0x99C1 -0x477E 0x9EA6 -0x4821 0x51FD -0x4822 0x7BB1 -0x4823 0x7872 -0x4824 0x7BB8 -0x4825 0x8087 -0x4826 0x7B48 -0x4827 0x6AE8 -0x4828 0x5E61 -0x4829 0x808C -0x482A 0x7551 -0x482B 0x7560 -0x482C 0x516B -0x482D 0x9262 -0x482E 0x6E8C -0x482F 0x767A -0x4830 0x9197 -0x4831 0x9AEA -0x4832 0x4F10 -0x4833 0x7F70 -0x4834 0x629C -0x4835 0x7B4F -0x4836 0x95A5 -0x4837 0x9CE9 -0x4838 0x567A -0x4839 0x5859 -0x483A 0x86E4 -0x483B 0x96BC -0x483C 0x4F34 -0x483D 0x5224 -0x483E 0x534A -0x483F 0x53CD -0x4840 0x53DB -0x4841 0x5E06 -0x4842 0x642C -0x4843 0x6591 -0x4844 0x677F -0x4845 0x6C3E -0x4846 0x6C4E -0x4847 0x7248 -0x4848 0x72AF -0x4849 0x73ED -0x484A 0x7554 -0x484B 0x7E41 -0x484C 0x822C -0x484D 0x85E9 -0x484E 0x8CA9 -0x484F 0x7BC4 -0x4850 0x91C6 -0x4851 0x7169 -0x4852 0x9812 -0x4853 0x98EF -0x4854 0x633D -0x4855 0x6669 -0x4856 0x756A -0x4857 0x76E4 -0x4858 0x78D0 -0x4859 0x8543 -0x485A 0x86EE -0x485B 0x532A -0x485C 0x5351 -0x485D 0x5426 -0x485E 0x5983 -0x485F 0x5E87 -0x4860 0x5F7C -0x4861 0x60B2 -0x4862 0x6249 -0x4863 0x6279 -0x4864 0x62AB -0x4865 0x6590 -0x4866 0x6BD4 -0x4867 0x6CCC -0x4868 0x75B2 -0x4869 0x76AE -0x486A 0x7891 -0x486B 0x79D8 -0x486C 0x7DCB -0x486D 0x7F77 -0x486E 0x80A5 -0x486F 0x88AB -0x4870 0x8AB9 -0x4871 0x8CBB -0x4872 0x907F -0x4873 0x975E -0x4874 0x98DB -0x4875 0x6A0B -0x4876 0x7C38 -0x4877 0x5099 -0x4878 0x5C3E -0x4879 0x5FAE -0x487A 0x6787 -0x487B 0x6BD8 -0x487C 0x7435 -0x487D 0x7709 -0x487E 0x7F8E -0x4921 0x9F3B -0x4922 0x67CA -0x4923 0x7A17 -0x4924 0x5339 -0x4925 0x758B -0x4926 0x9AED -0x4927 0x5F66 -0x4928 0x819D -0x4929 0x83F1 -0x492A 0x8098 -0x492B 0x5F3C -0x492C 0x5FC5 -0x492D 0x7562 -0x492E 0x7B46 -0x492F 0x903C -0x4930 0x6867 -0x4931 0x59EB -0x4932 0x5A9B -0x4933 0x7D10 -0x4934 0x767E -0x4935 0x8B2C -0x4936 0x4FF5 -0x4937 0x5F6A -0x4938 0x6A19 -0x4939 0x6C37 -0x493A 0x6F02 -0x493B 0x74E2 -0x493C 0x7968 -0x493D 0x8868 -0x493E 0x8A55 -0x493F 0x8C79 -0x4940 0x5EDF -0x4941 0x63CF -0x4942 0x75C5 -0x4943 0x79D2 -0x4944 0x82D7 -0x4945 0x9328 -0x4946 0x92F2 -0x4947 0x849C -0x4948 0x86ED -0x4949 0x9C2D -0x494A 0x54C1 -0x494B 0x5F6C -0x494C 0x658C -0x494D 0x6D5C -0x494E 0x7015 -0x494F 0x8CA7 -0x4950 0x8CD3 -0x4951 0x983B -0x4952 0x654F -0x4953 0x74F6 -0x4954 0x4E0D -0x4955 0x4ED8 -0x4956 0x57E0 -0x4957 0x592B -0x4958 0x5A66 -0x4959 0x5BCC -0x495A 0x51A8 -0x495B 0x5E03 -0x495C 0x5E9C -0x495D 0x6016 -0x495E 0x6276 -0x495F 0x6577 -0x4960 0x65A7 -0x4961 0x666E -0x4962 0x6D6E -0x4963 0x7236 -0x4964 0x7B26 -0x4965 0x8150 -0x4966 0x819A -0x4967 0x8299 -0x4968 0x8B5C -0x4969 0x8CA0 -0x496A 0x8CE6 -0x496B 0x8D74 -0x496C 0x961C -0x496D 0x9644 -0x496E 0x4FAE -0x496F 0x64AB -0x4970 0x6B66 -0x4971 0x821E -0x4972 0x8461 -0x4973 0x856A -0x4974 0x90E8 -0x4975 0x5C01 -0x4976 0x6953 -0x4977 0x98A8 -0x4978 0x847A -0x4979 0x8557 -0x497A 0x4F0F -0x497B 0x526F -0x497C 0x5FA9 -0x497D 0x5E45 -0x497E 0x670D -0x4A21 0x798F -0x4A22 0x8179 -0x4A23 0x8907 -0x4A24 0x8986 -0x4A25 0x6DF5 -0x4A26 0x5F17 -0x4A27 0x6255 -0x4A28 0x6CB8 -0x4A29 0x4ECF -0x4A2A 0x7269 -0x4A2B 0x9B92 -0x4A2C 0x5206 -0x4A2D 0x543B -0x4A2E 0x5674 -0x4A2F 0x58B3 -0x4A30 0x61A4 -0x4A31 0x626E -0x4A32 0x711A -0x4A33 0x596E -0x4A34 0x7C89 -0x4A35 0x7CDE -0x4A36 0x7D1B -0x4A37 0x96F0 -0x4A38 0x6587 -0x4A39 0x805E -0x4A3A 0x4E19 -0x4A3B 0x4F75 -0x4A3C 0x5175 -0x4A3D 0x5840 -0x4A3E 0x5E63 -0x4A3F 0x5E73 -0x4A40 0x5F0A -0x4A41 0x67C4 -0x4A42 0x4E26 -0x4A43 0x853D -0x4A44 0x9589 -0x4A45 0x965B -0x4A46 0x7C73 -0x4A47 0x9801 -0x4A48 0x50FB -0x4A49 0x58C1 -0x4A4A 0x7656 -0x4A4B 0x78A7 -0x4A4C 0x5225 -0x4A4D 0x77A5 -0x4A4E 0x8511 -0x4A4F 0x7B86 -0x4A50 0x504F -0x4A51 0x5909 -0x4A52 0x7247 -0x4A53 0x7BC7 -0x4A54 0x7DE8 -0x4A55 0x8FBA -0x4A56 0x8FD4 -0x4A57 0x904D -0x4A58 0x4FBF -0x4A59 0x52C9 -0x4A5A 0x5A29 -0x4A5B 0x5F01 -0x4A5C 0x97AD -0x4A5D 0x4FDD -0x4A5E 0x8217 -0x4A5F 0x92EA -0x4A60 0x5703 -0x4A61 0x6355 -0x4A62 0x6B69 -0x4A63 0x752B -0x4A64 0x88DC -0x4A65 0x8F14 -0x4A66 0x7A42 -0x4A67 0x52DF -0x4A68 0x5893 -0x4A69 0x6155 -0x4A6A 0x620A -0x4A6B 0x66AE -0x4A6C 0x6BCD -0x4A6D 0x7C3F -0x4A6E 0x83E9 -0x4A6F 0x5023 -0x4A70 0x4FF8 -0x4A71 0x5305 -0x4A72 0x5446 -0x4A73 0x5831 -0x4A74 0x5949 -0x4A75 0x5B9D -0x4A76 0x5CF0 -0x4A77 0x5CEF -0x4A78 0x5D29 -0x4A79 0x5E96 -0x4A7A 0x62B1 -0x4A7B 0x6367 -0x4A7C 0x653E -0x4A7D 0x65B9 -0x4A7E 0x670B -0x4B21 0x6CD5 -0x4B22 0x6CE1 -0x4B23 0x70F9 -0x4B24 0x7832 -0x4B25 0x7E2B -0x4B26 0x80DE -0x4B27 0x82B3 -0x4B28 0x840C -0x4B29 0x84EC -0x4B2A 0x8702 -0x4B2B 0x8912 -0x4B2C 0x8A2A -0x4B2D 0x8C4A -0x4B2E 0x90A6 -0x4B2F 0x92D2 -0x4B30 0x98FD -0x4B31 0x9CF3 -0x4B32 0x9D6C -0x4B33 0x4E4F -0x4B34 0x4EA1 -0x4B35 0x508D -0x4B36 0x5256 -0x4B37 0x574A -0x4B38 0x59A8 -0x4B39 0x5E3D -0x4B3A 0x4B3B 0x5FD8 -0x4B3C 0x623F -0x4B3D 0x66B4 -0x4B3E 0x671B -0x4B3F 0x67D0 -0x4B40 0x68D2 -0x4B41 0x5192 -0x4B42 0x7D21 -0x4B43 0x80AA -0x4B44 0x81A8 -0x4B45 0x8B00 -0x4B46 0x8C8C -0x4B47 0x8CBF -0x4B48 0x927E -0x4B49 0x9632 -0x4B4A 0x5420 -0x4B4B 0x982C -0x4B4C 0x5317 -0x4B4D 0x50D5 -0x4B4E 0x535C -0x4B4F 0x58A8 -0x4B50 0x64B2 -0x4B51 0x6734 -0x4B52 0x7267 -0x4B53 0x7766 -0x4B54 0x7A46 -0x4B55 0x91E6 -0x4B56 0x52C3 -0x4B57 0x6CA1 -0x4B58 0x6B86 -0x4B59 0x5800 -0x4B5A 0x5E4C -0x4B5B 0x5954 -0x4B5C 0x672C -0x4B5D 0x7FFB -0x4B5E 0x51E1 -0x4B5F 0x76C6 -0x4B60 0x6469 -0x4B61 0x78E8 -0x4B62 0x9B54 -0x4B63 0x9EBB -0x4B64 0x57CB -0x4B65 0x59B9 -0x4B66 0x6627 -0x4B67 0x679A -0x4B68 0x6BCE -0x4B69 0x54E9 -0x4B6A 0x69D9 -0x4B6B 0x5E55 -0x4B6C 0x819C -0x4B6D 0x6795 -0x4B6E 0x9BAA -0x4B6F 0x67FE -0x4B70 0x9C52 -0x4B71 0x685D -0x4B72 0x4EA6 -0x4B73 0x4FE3 -0x4B74 0x53C8 -0x4B75 0x62B9 -0x4B76 0x672B -0x4B77 0x6CAB -0x4B78 0x8FC4 -0x4B79 0x4FAD -0x4B7A 0x7E6D -0x4B7B 0x9EBF -0x4B7C 0x4E07 -0x4B7D 0x6162 -0x4B7E 0x6E80 -0x4C21 0x6F2B -0x4C22 0x8513 -0x4C23 0x5473 -0x4C24 0x672A -0x4C25 0x9B45 -0x4C26 0x5DF3 -0x4C27 0x7B95 -0x4C28 0x5CAC -0x4C29 0x5BC6 -0x4C2A 0x871C -0x4C2B 0x6E4A -0x4C2C 0x84D1 -0x4C2D 0x7A14 -0x4C2E 0x8108 -0x4C2F 0x5999 -0x4C30 0x7C8D -0x4C31 0x6C11 -0x4C32 0x7720 -0x4C33 0x52D9 -0x4C34 0x5922 -0x4C35 0x7121 -0x4C36 0x725F -0x4C37 0x77DB -0x4C38 0x9727 -0x4C39 0x9D61 -0x4C3A 0x690B -0x4C3B 0x5A7F -0x4C3C 0x5A18 -0x4C3D 0x51A5 -0x4C3E 0x540D -0x4C3F 0x547D -0x4C40 0x660E -0x4C41 0x76DF -0x4C42 0x8FF7 -0x4C43 0x9298 -0x4C44 0x9CF4 -0x4C45 0x59EA -0x4C46 0x725D -0x4C47 0x6EC5 -0x4C48 0x514D -0x4C49 0x68C9 -0x4C4A 0x7DBF -0x4C4B 0x7DEC -0x4C4C 0x9762 -0x4C4D 0x9EBA -0x4C4E 0x6478 -0x4C4F 0x6A21 -0x4C50 0x8302 -0x4C51 0x5984 -0x4C52 0x5B5F -0x4C53 0x6BDB -0x4C54 0x731B -0x4C55 0x76F2 -0x4C56 0x7DB2 -0x4C57 0x8017 -0x4C58 0x8499 -0x4C59 0x5132 -0x4C5A 0x6728 -0x4C5B 0x9ED9 -0x4C5C 0x76EE -0x4C5D 0x6762 -0x4C5E 0x52FF -0x4C5F 0x9905 -0x4C60 0x5C24 -0x4C61 0x623B -0x4C62 0x7C7E -0x4C63 0x8CB0 -0x4C64 0x554F -0x4C65 0x60B6 -0x4C66 0x7D0B -0x4C67 0x9580 -0x4C68 0x5301 -0x4C69 0x4E5F -0x4C6A 0x51B6 -0x4C6B 0x591C -0x4C6C 0x723A -0x4C6D 0x8036 -0x4C6E 0x91CE -0x4C6F 0x5F25 -0x4C70 0x77E2 -0x4C71 0x5384 -0x4C72 0x5F79 -0x4C73 0x7D04 -0x4C74 0x85AC -0x4C75 0x8A33 -0x4C76 0x8E8D -0x4C77 0x9756 -0x4C78 0x67F3 -0x4C79 0x85AE -0x4C7A 0x9453 -0x4C7B 0x6109 -0x4C7C 0x6108 -0x4C7D 0x6CB9 -0x4C7E 0x7652 -0x4D21 0x8AED -0x4D22 0x8F38 -0x4D23 0x552F -0x4D24 0x4F51 -0x4D25 0x512A -0x4D26 0x52C7 -0x4D27 0x53CB -0x4D28 0x5BA5 -0x4D29 0x5E7D -0x4D2A 0x60A0 -0x4D2B 0x6182 -0x4D2C 0x63D6 -0x4D2D 0x6709 -0x4D2E 0x67DA -0x4D2F 0x6E67 -0x4D30 0x6D8C -0x4D31 0x4D32 0x7336 -0x4D33 0x7531 -0x4D34 0x7950 -0x4D35 0x88D5 -0x4D36 0x8A98 -0x4D37 0x904A -0x4D38 0x9091 -0x4D39 0x90F5 -0x4D3A 0x96C4 -0x4D3B 0x878D -0x4D3C 0x5915 -0x4D3D 0x4E88 -0x4D3E 0x4F59 -0x4D3F 0x4E0E -0x4D40 0x8A89 -0x4D41 0x8F3F -0x4D42 0x9810 -0x4D43 0x50AD -0x4D44 0x5E7C -0x4D45 0x5996 -0x4D46 0x5BB9 -0x4D47 0x5EB8 -0x4D48 0x63DA -0x4D49 0x63FA -0x4D4A 0x64C1 -0x4D4B 0x66DC -0x4D4C 0x694A -0x4D4D 0x69D8 -0x4D4E 0x6D0B -0x4D4F 0x6EB6 -0x4D50 0x7194 -0x4D51 0x7528 -0x4D52 0x7AAF -0x4D53 0x7F8A -0x4D54 0x8000 -0x4D55 0x8449 -0x4D56 0x84C9 -0x4D57 0x8981 -0x4D58 0x8B21 -0x4D59 0x8E0A -0x4D5A 0x9065 -0x4D5B 0x967D -0x4D5C 0x990A -0x4D5D 0x617E -0x4D5E 0x6291 -0x4D5F 0x6B32 -0x4D60 0x6C83 -0x4D61 0x6D74 -0x4D62 0x7FCC -0x4D63 0x7FFC -0x4D64 0x6DC0 -0x4D65 0x7F85 -0x4D66 0x87BA -0x4D67 0x88F8 -0x4D68 0x6765 -0x4D69 0x83B1 -0x4D6A 0x983C -0x4D6B 0x96F7 -0x4D6C 0x6D1B -0x4D6D 0x7D61 -0x4D6E 0x843D -0x4D6F 0x916A -0x4D70 0x4E71 -0x4D71 0x5375 -0x4D72 0x5D50 -0x4D73 0x6B04 -0x4D74 0x6FEB -0x4D75 0x85CD -0x4D76 0x862D -0x4D77 0x89A7 -0x4D78 0x5229 -0x4D79 0x540F -0x4D7A 0x5C65 -0x4D7B 0x674E -0x4D7C 0x68A8 -0x4D7D 0x7406 -0x4D7E 0x7483 -0x4E21 0x75E2 -0x4E22 0x88CF -0x4E23 0x88E1 -0x4E24 0x91CC -0x4E25 0x96E2 -0x4E26 0x9678 -0x4E27 0x5F8B -0x4E28 0x7387 -0x4E29 0x7ACB -0x4E2A 0x844E -0x4E2B 0x63A0 -0x4E2C 0x7565 -0x4E2D 0x5289 -0x4E2E 0x6D41 -0x4E2F 0x6E9C -0x4E30 0x7409 -0x4E31 0x7559 -0x4E32 0x786B -0x4E33 0x7C92 -0x4E34 0x9686 -0x4E35 0x7ADC -0x4E36 0x9F8D -0x4E37 0x4FB6 -0x4E38 0x616E -0x4E39 0x65C5 -0x4E3A 0x865C -0x4E3B 0x4E86 -0x4E3C 0x4EAE -0x4E3D 0x50DA -0x4E3E 0x4E21 -0x4E3F 0x51CC -0x4E40 0x5BEE -0x4E41 0x6599 -0x4E42 0x6881 -0x4E43 0x6DBC -0x4E44 0x731F -0x4E45 0x7642 -0x4E46 0x77AD -0x4E47 0x7A1C -0x4E48 0x7CE7 -0x4E49 0x826F -0x4E4A 0x8AD2 -0x4E4B 0x907C -0x4E4C 0x91CF -0x4E4D 0x9675 -0x4E4E 0x9818 -0x4E4F 0x529B -0x4E50 0x7DD1 -0x4E51 0x502B -0x4E52 0x5398 -0x4E53 0x6797 -0x4E54 0x6DCB -0x4E55 0x71D0 -0x4E56 0x7433 -0x4E57 0x81E8 -0x4E58 0x8F2A -0x4E59 0x96A3 -0x4E5A 0x9C57 -0x4E5B 0x9E9F -0x4E5C 0x7460 -0x4E5D 0x5841 -0x4E5E 0x6D99 -0x4E5F 0x7D2F -0x4E60 0x985E -0x4E61 0x4EE4 -0x4E62 0x4F36 -0x4E63 0x4F8B -0x4E64 0x51B7 -0x4E65 0x52B1 -0x4E66 0x5DBA -0x4E67 0x601C -0x4E68 0x73B2 -0x4E69 0x793C -0x4E6A 0x82D3 -0x4E6B 0x9234 -0x4E6C 0x96B7 -0x4E6D 0x96F6 -0x4E6E 0x970A -0x4E6F 0x9E97 -0x4E70 0x9F62 -0x4E71 0x66A6 -0x4E72 0x6B74 -0x4E73 0x5217 -0x4E74 0x52A3 -0x4E75 0x70C8 -0x4E76 0x88C2 -0x4E77 0x5EC9 -0x4E78 0x604B -0x4E79 0x6190 -0x4E7A 0x6F23 -0x4E7B 0x7149 -0x4E7C 0x7C3E -0x4E7D 0x7DF4 -0x4E7E 0x806F -0x4F21 0x84EE -0x4F22 0x9023 -0x4F23 0x932C -0x4F24 0x5442 -0x4F25 0x9B6F -0x4F26 0x6AD3 -0x4F27 0x7089 -0x4F28 0x8CC2 -0x4F29 0x8DEF -0x4F2A 0x9732 -0x4F2B 0x52B4 -0x4F2C 0x5A41 -0x4F2D 0x5ECA -0x4F2E 0x5F04 -0x4F2F 0x6717 -0x4F30 0x697C -0x4F31 0x6994 -0x4F32 0x6D6A -0x4F33 0x6F0F -0x4F34 0x7262 -0x4F35 0x72FC -0x4F36 0x7BED -0x4F37 0x8001 -0x4F38 0x807E -0x4F39 0x874B -0x4F3A 0x90CE -0x4F3B 0x516D -0x4F3C 0x9E93 -0x4F3D 0x7984 -0x4F3E 0x808B -0x4F3F 0x9332 -0x4F40 0x8AD6 -0x4F41 0x502D -0x4F42 0x548C -0x4F43 0x8A71 -0x4F44 0x6B6A -0x4F45 0x8CC4 -0x4F46 0x8107 -0x4F47 0x60D1 -0x4F48 0x67A0 -0x4F49 0x9DF2 -0x4F4A 0x4E99 -0x4F4B 0x4E98 -0x4F4C 0x9C10 -0x4F4D 0x8A6B -0x4F4E 0x85C1 -0x4F4F 0x8568 -0x4F50 0x6900 -0x4F51 0x6E7E -0x4F52 0x7897 -0x4F53 0x8155 -0x5021 0x5F0C -0x5022 0x4E10 -0x5023 0x4E15 -0x5024 0x4E2A -0x5025 0x4E31 -0x5026 0x4E36 -0x5027 0x4E3C -0x5028 0x4E3F -0x5029 0x4E42 -0x502A 0x4E56 -0x502B 0x4E58 -0x502C 0x4E82 -0x502D 0x4E85 -0x502E 0x8C6B -0x502F 0x4E8A -0x5030 0x8212 -0x5031 0x5F0D -0x5032 0x4E8E -0x5033 0x5035 0x4E9E -0x5036 0x4EA2 -0x5037 0x4EB0 -0x5038 0x4EB3 -0x5039 0x4EB6 -0x503A 0x4ECE -0x503B 0x4ECD -0x503C 0x4EC4 -0x503D 0x4EC6 -0x503E 0x4EC2 -0x503F 0x4ED7 -0x5040 0x4EDE -0x5041 0x4EED -0x5042 0x4EDF -0x5043 0x4EF7 -0x5044 0x4F09 -0x5045 0x4F5A -0x5046 0x4F30 -0x5047 0x4F5B -0x5048 0x4F5D -0x5049 0x4F57 -0x504A 0x4F47 -0x504B 0x4F76 -0x504C 0x4F88 -0x504D 0x4F8F -0x504E 0x4F98 -0x504F 0x4F7B -0x5050 0x4F69 -0x5051 0x4F70 -0x5052 0x4F91 -0x5053 0x4F6F -0x5054 0x4F86 -0x5055 0x4F96 -0x5056 0x5118 -0x5057 0x4FD4 -0x5058 0x4FDF -0x5059 0x4FCE -0x505A 0x4FD8 -0x505B 0x4FDB -0x505C 0x4FD1 -0x505D 0x4FDA -0x505E 0x4FD0 -0x505F 0x5060 0x4FE4 -0x5061 0x501A -0x5062 0x5028 -0x5063 0x5014 -0x5064 0x502A -0x5065 0x5025 -0x5066 0x5005 -0x5067 0x4F1C -0x5068 0x4FF6 -0x5069 0x5021 -0x506A 0x5029 -0x506B 0x502C -0x506C 0x4FFE -0x506D 0x4FEF -0x506E 0x5011 -0x506F 0x5006 -0x5070 0x5043 -0x5071 0x5047 -0x5072 0x6703 -0x5073 0x5055 -0x5074 0x5050 -0x5075 0x5048 -0x5076 0x505A -0x5077 0x5056 -0x5078 0x506C -0x5079 0x5078 -0x507A 0x5080 -0x507B 0x509A -0x507C 0x5085 -0x507D 0x50B4 -0x507E 0x50B2 -0x5121 0x5122 0x50C9 -0x5123 0x50B3 -0x5124 0x50C2 -0x5125 0x50D6 -0x5126 0x50DE -0x5127 0x50E5 -0x5128 0x50ED -0x5129 0x50E3 -0x512A 0x50EE -0x512B 0x50F9 -0x512C 0x50F5 -0x512D 0x5109 -0x512E 0x512F 0x5101 -0x5130 0x5116 -0x5131 0x5115 -0x5132 0x5114 -0x5133 0x511A -0x5134 0x5121 -0x5135 0x513A -0x5136 0x5137 -0x5137 0x513C -0x5138 0x513B -0x5139 0x513A 0x513F -0x513B 0x5152 -0x513C 0x514C -0x513D 0x5154 -0x513E 0x5162 -0x513F 0x7AF8 -0x5140 0x5141 0x5169 -0x5142 0x516E -0x5143 0x5180 -0x5144 0x5182 -0x5145 0x56D8 -0x5146 0x518C -0x5147 0x5189 -0x5148 0x518F -0x5149 0x5191 -0x514A 0x5193 -0x514B 0x514C 0x5195 -0x514D 0x51A4 -0x514E 0x51A6 -0x514F 0x51A2 -0x5150 0x5152 0x51A9 -0x5153 0x51B3 -0x5154 0x5155 0x51B1 -0x5156 0x51B0 -0x5157 0x51B5 -0x5158 0x51BD -0x5159 0x51C5 -0x515A 0x51C9 -0x515B 0x51DB -0x515C 0x51E0 -0x515D 0x8655 -0x515E 0x51E9 -0x515F 0x51ED -0x5160 0x51F0 -0x5161 0x51F5 -0x5162 0x51FE -0x5163 0x5204 -0x5164 0x520B -0x5165 0x5214 -0x5166 0x520E -0x5167 0x5227 -0x5168 0x522A -0x5169 0x522E -0x516A 0x5233 -0x516B 0x5239 -0x516C 0x524F -0x516D 0x5244 -0x516E 0x516F 0x524B -0x5170 0x525E -0x5171 0x5254 -0x5172 0x526A -0x5173 0x5274 -0x5174 0x5269 -0x5175 0x5273 -0x5176 0x527F -0x5177 0x527D -0x5178 0x528D -0x5179 0x5294 -0x517A 0x5292 -0x517B 0x5271 -0x517C 0x5288 -0x517D 0x5291 -0x517E 0x8FA8 -0x5221 0x8FA7 -0x5222 0x5223 0x52AC -0x5224 0x52BC -0x5225 0x52B5 -0x5226 0x52C1 -0x5227 0x52CD -0x5228 0x52D7 -0x5229 0x52DE -0x522A 0x52E3 -0x522B 0x52E6 -0x522C 0x98ED -0x522D 0x52E0 -0x522E 0x52F3 -0x522F 0x52F5 -0x5230 0x5231 0x52F8 -0x5232 0x5306 -0x5233 0x5308 -0x5234 0x7538 -0x5235 0x530D -0x5236 0x5310 -0x5237 0x530F -0x5238 0x5315 -0x5239 0x531A -0x523A 0x5323 -0x523B 0x532F -0x523C 0x5331 -0x523D 0x5333 -0x523E 0x5338 -0x523F 0x5340 -0x5240 0x5346 -0x5241 0x5345 -0x5242 0x4E17 -0x5243 0x5349 -0x5244 0x534D -0x5245 0x51D6 -0x5246 0x535E -0x5247 0x5369 -0x5248 0x536E -0x5249 0x5918 -0x524A 0x537B -0x524B 0x5377 -0x524C 0x5382 -0x524D 0x5396 -0x524E 0x53A0 -0x524F 0x53A6 -0x5250 0x53A5 -0x5251 0x53AE -0x5252 0x53B0 -0x5253 0x53B6 -0x5254 0x53C3 -0x5255 0x7C12 -0x5256 0x96D9 -0x5257 0x53DF -0x5258 0x66FC -0x5259 0x71EE -0x525A 0x53EE -0x525B 0x53E8 -0x525C 0x53ED -0x525D 0x53FA -0x525E 0x5401 -0x525F 0x543D -0x5260 0x5440 -0x5261 0x5262 0x542C -0x5263 0x543C -0x5264 0x542E -0x5265 0x5436 -0x5266 0x5429 -0x5267 0x541D -0x5268 0x544E -0x5269 0x548F -0x526A 0x5475 -0x526B 0x548E -0x526C 0x545F -0x526D 0x5471 -0x526E 0x5477 -0x526F 0x5470 -0x5270 0x5492 -0x5271 0x547B -0x5272 0x5480 -0x5273 0x5476 -0x5274 0x5484 -0x5275 0x5490 -0x5276 0x5486 -0x5277 0x54C7 -0x5278 0x54A2 -0x5279 0x54B8 -0x527A 0x54A5 -0x527B 0x54AC -0x527C 0x54C4 -0x527D 0x54C8 -0x527E 0x54A8 -0x5321 0x54AB -0x5322 0x54C2 -0x5323 0x54A4 -0x5324 0x54BE -0x5325 0x54BC -0x5326 0x54D8 -0x5327 0x5328 0x54E5 -0x5329 0x550F -0x532A 0x5514 -0x532B 0x54FD -0x532C 0x54EE -0x532D 0x54ED -0x532E 0x54FA -0x532F 0x54E2 -0x5330 0x5539 -0x5331 0x5540 -0x5332 0x5563 -0x5333 0x554C -0x5334 0x552E -0x5335 0x555C -0x5336 0x5545 -0x5337 0x5338 0x5556 -0x5339 0x5538 -0x533A 0x5533 -0x533B 0x555D -0x533C 0x5599 -0x533D 0x5580 -0x533E 0x54AF -0x533F 0x558A -0x5340 0x559F -0x5341 0x557B -0x5342 0x557E -0x5343 0x5598 -0x5344 0x559E -0x5345 0x55AE -0x5346 0x557C -0x5347 0x5583 -0x5348 0x55A9 -0x5349 0x5587 -0x534A 0x55A8 -0x534B 0x55DA -0x534C 0x55C5 -0x534D 0x55DF -0x534E 0x55C4 -0x534F 0x55DC -0x5350 0x55E4 -0x5351 0x55D4 -0x5352 0x5614 -0x5353 0x55F7 -0x5354 0x5616 -0x5355 0x55FE -0x5356 0x55FD -0x5357 0x561B -0x5358 0x55F9 -0x5359 0x564E -0x535A 0x5650 -0x535B 0x71DF -0x535C 0x5634 -0x535D 0x5636 -0x535E 0x5632 -0x535F 0x5638 -0x5360 0x566B -0x5361 0x5664 -0x5362 0x562F -0x5363 0x566C -0x5364 0x566A -0x5365 0x5686 -0x5366 0x5680 -0x5367 0x568A -0x5368 0x56A0 -0x5369 0x5694 -0x536A 0x568F -0x536B 0x56A5 -0x536C 0x56AE -0x536D 0x56B6 -0x536E 0x56B4 -0x536F 0x56C2 -0x5370 0x56BC -0x5371 0x56C1 -0x5372 0x56C3 -0x5373 0x56C0 -0x5374 0x56C8 -0x5375 0x56CE -0x5376 0x56D1 -0x5377 0x56D3 -0x5378 0x56D7 -0x5379 0x56EE -0x537A 0x56F9 -0x537B 0x5700 -0x537C 0x56FF -0x537D 0x5704 -0x537E 0x5709 -0x5421 0x5708 -0x5422 0x570B -0x5423 0x570D -0x5424 0x5713 -0x5425 0x5718 -0x5426 0x5716 -0x5427 0x55C7 -0x5428 0x571C -0x5429 0x5726 -0x542A 0x542B 0x5737 -0x542C 0x574E -0x542D 0x573B -0x542E 0x5740 -0x542F 0x574F -0x5430 0x5769 -0x5431 0x57C0 -0x5432 0x5788 -0x5433 0x5761 -0x5434 0x577F -0x5435 0x5789 -0x5436 0x5793 -0x5437 0x57A0 -0x5438 0x57B3 -0x5439 0x57A4 -0x543A 0x57AA -0x543B 0x57B0 -0x543C 0x57C3 -0x543D 0x57C6 -0x543E 0x57D4 -0x543F 0x5440 0x57D2 -0x5441 0x580A -0x5442 0x57D6 -0x5443 0x57E3 -0x5444 0x580B -0x5445 0x5819 -0x5446 0x581D -0x5447 0x5872 -0x5448 0x5821 -0x5449 0x5862 -0x544A 0x584B -0x544B 0x5870 -0x544C 0x6BC0 -0x544D 0x5852 -0x544E 0x583D -0x544F 0x5879 -0x5450 0x5885 -0x5451 0x58B9 -0x5452 0x589F -0x5453 0x58AB -0x5454 0x58BA -0x5455 0x58DE -0x5456 0x58BB -0x5457 0x58B8 -0x5458 0x58AE -0x5459 0x58C5 -0x545A 0x58D3 -0x545B 0x58D1 -0x545C 0x58D7 -0x545D 0x58D9 -0x545E 0x58D8 -0x545F 0x58E5 -0x5460 0x58DC -0x5461 0x58E4 -0x5462 0x58DF -0x5463 0x58EF -0x5464 0x58FA -0x5465 0x58F9 -0x5466 0x5468 0x58FB -0x5469 0x5902 -0x546A 0x590A -0x546B 0x5910 -0x546C 0x591B -0x546D 0x68A6 -0x546E 0x5925 -0x546F 0x5470 0x592C -0x5471 0x5932 -0x5472 0x5938 -0x5473 0x593E -0x5474 0x7AD2 -0x5475 0x5955 -0x5476 0x5950 -0x5477 0x594E -0x5478 0x595A -0x5479 0x5958 -0x547A 0x5962 -0x547B 0x5960 -0x547C 0x5967 -0x547D 0x596C -0x547E 0x5969 -0x5521 0x5978 -0x5522 0x5981 -0x5523 0x599D -0x5524 0x4F5E -0x5525 0x4FAB -0x5526 0x59A3 -0x5527 0x59B2 -0x5528 0x59C6 -0x5529 0x59E8 -0x552A 0x59DC -0x552B 0x598D -0x552C 0x552D 0x59D9 -0x552E 0x5A25 -0x552F 0x5A1F -0x5530 0x5A11 -0x5531 0x5A1C -0x5532 0x5A09 -0x5533 0x5A1A -0x5534 0x5A40 -0x5535 0x5A6C -0x5536 0x5A49 -0x5537 0x5538 0x5A35 -0x5539 0x5A62 -0x553A 0x5A6A -0x553B 0x5A9A -0x553C 0x5ABC -0x553D 0x5ABE -0x553E 0x5ACB -0x553F 0x5AC2 -0x5540 0x5ABD -0x5541 0x5AE3 -0x5542 0x5AD7 -0x5543 0x5AE6 -0x5544 0x5AE9 -0x5545 0x5AD6 -0x5546 0x5547 0x5AFA -0x5548 0x5B0C -0x5549 0x5B0B -0x554A 0x5B16 -0x554B 0x5B32 -0x554C 0x5AD0 -0x554D 0x5B2A -0x554E 0x5B36 -0x554F 0x5B3E -0x5550 0x5B43 -0x5551 0x5B45 -0x5552 0x5B40 -0x5553 0x5B51 -0x5554 0x5B55 -0x5555 0x5556 0x5B5A -0x5557 0x5B65 -0x5558 0x5B69 -0x5559 0x5B70 -0x555A 0x5B73 -0x555B 0x5B75 -0x555C 0x5B78 -0x555D 0x6588 -0x555E 0x5B7A -0x555F 0x5B80 -0x5560 0x5B83 -0x5561 0x5BA6 -0x5562 0x5BB8 -0x5563 0x5BC3 -0x5564 0x5BC7 -0x5565 0x5BC9 -0x5566 0x5BD4 -0x5567 0x5BD0 -0x5568 0x5BE4 -0x5569 0x5BE6 -0x556A 0x5BE2 -0x556B 0x5BDE -0x556C 0x5BE5 -0x556D 0x5BEB -0x556E 0x5BF0 -0x556F 0x5BF6 -0x5570 0x5BF3 -0x5571 0x5C05 -0x5572 0x5573 0x5C07 -0x5574 0x5C0D -0x5575 0x5C13 -0x5576 0x5C20 -0x5577 0x5C22 -0x5578 0x5C28 -0x5579 0x557A 0x5C38 -0x557B 0x5C41 -0x557C 0x5C46 -0x557D 0x5C4E -0x557E 0x5C53 -0x5621 0x5C50 -0x5622 0x5C4F -0x5623 0x5B71 -0x5624 0x5C6C -0x5625 0x5C6E -0x5626 0x4E62 -0x5627 0x5C76 -0x5628 0x5C79 -0x5629 0x5C8C -0x562A 0x5C91 -0x562B 0x5C94 -0x562C 0x599B -0x562D 0x5CAB -0x562E 0x5CBB -0x562F 0x5CB6 -0x5630 0x5CBC -0x5631 0x5CB7 -0x5632 0x5CC5 -0x5633 0x5CBE -0x5634 0x5CC7 -0x5635 0x5CD9 -0x5636 0x5CE9 -0x5637 0x5CFD -0x5638 0x5CFA -0x5639 0x5CED -0x563A 0x5D8C -0x563B 0x5CEA -0x563C 0x5D0B -0x563D 0x5D15 -0x563E 0x5D17 -0x563F 0x5D5C -0x5640 0x5D1F -0x5641 0x5D1B -0x5642 0x5D11 -0x5643 0x5D14 -0x5644 0x5D22 -0x5645 0x5D1A -0x5646 0x5D19 -0x5647 0x5D18 -0x5648 0x5D4C -0x5649 0x5D52 -0x564A 0x5D4E -0x564B 0x5D4B -0x564C 0x5D6C -0x564D 0x5D73 -0x564E 0x5D76 -0x564F 0x5D87 -0x5650 0x5D84 -0x5651 0x5D82 -0x5652 0x5DA2 -0x5653 0x5D9D -0x5654 0x5DAC -0x5655 0x5DAE -0x5656 0x5DBD -0x5657 0x5D90 -0x5658 0x5DB7 -0x5659 0x5DBC -0x565A 0x5DC9 -0x565B 0x5DCD -0x565C 0x5DD3 -0x565D 0x5DD2 -0x565E 0x5DD6 -0x565F 0x5DDB -0x5660 0x5DEB -0x5661 0x5DF2 -0x5662 0x5DF5 -0x5663 0x5E0B -0x5664 0x5E1A -0x5665 0x5E19 -0x5666 0x5E11 -0x5667 0x5E1B -0x5668 0x5669 0x5E36 -0x566A 0x5E44 -0x566B 0x5E43 -0x566C 0x5E40 -0x566D 0x5E4E -0x566E 0x5E57 -0x566F 0x5E54 -0x5670 0x5E5F -0x5671 0x5E62 -0x5672 0x5E64 -0x5673 0x5E47 -0x5674 0x5675 0x5E75 -0x5676 0x5E7A -0x5677 0x9EBC -0x5678 0x5E7F -0x5679 0x5EA0 -0x567A 0x567B 0x5EC1 -0x567C 0x5EC8 -0x567D 0x5ED0 -0x567E 0x5ECF -0x5721 0x5ED6 -0x5722 0x5EE3 -0x5723 0x5EDD -0x5724 0x5725 0x5EDA -0x5726 0x5EE2 -0x5727 0x5EE1 -0x5728 0x5729 0x5EE8 -0x572A 0x5EEC -0x572B 0x5EF1 -0x572C 0x5EF3 -0x572D 0x5EF0 -0x572E 0x5EF4 -0x572F 0x5EF8 -0x5730 0x5EFE -0x5731 0x5F03 -0x5732 0x5F09 -0x5733 0x5F5D -0x5734 0x5F5C -0x5735 0x5F0B -0x5736 0x5F11 -0x5737 0x5F16 -0x5738 0x5F29 -0x5739 0x5F2D -0x573A 0x5F38 -0x573B 0x5F41 -0x573C 0x5F48 -0x573D 0x5F4C -0x573E 0x5F4E -0x573F 0x5F2F -0x5740 0x5F51 -0x5741 0x5742 0x5F56 -0x5743 0x5F59 -0x5744 0x5F61 -0x5745 0x5F6D -0x5746 0x5F73 -0x5747 0x5F77 -0x5748 0x5F83 -0x5749 0x5F82 -0x574A 0x5F7F -0x574B 0x5F8A -0x574C 0x5F88 -0x574D 0x5F91 -0x574E 0x5F87 -0x574F 0x5F9E -0x5750 0x5F99 -0x5751 0x5F98 -0x5752 0x5FA0 -0x5753 0x5FA8 -0x5754 0x5FAD -0x5755 0x5FBC -0x5756 0x5FD6 -0x5757 0x5FFB -0x5758 0x5FE4 -0x5759 0x5FF8 -0x575A 0x5FF1 -0x575B 0x5FDD -0x575C 0x60B3 -0x575D 0x5FFF -0x575E 0x6021 -0x575F 0x6060 -0x5760 0x6019 -0x5761 0x6010 -0x5762 0x6029 -0x5763 0x600E -0x5764 0x6031 -0x5765 0x601B -0x5766 0x6015 -0x5767 0x602B -0x5768 0x6026 -0x5769 0x600F -0x576A 0x603A -0x576B 0x605A -0x576C 0x6041 -0x576D 0x606A -0x576E 0x6077 -0x576F 0x605F -0x5770 0x604A -0x5771 0x6046 -0x5772 0x604D -0x5773 0x6063 -0x5774 0x6043 -0x5775 0x6064 -0x5776 0x6042 -0x5777 0x606C -0x5778 0x606B -0x5779 0x6059 -0x577A 0x6081 -0x577B 0x608D -0x577C 0x60E7 -0x577D 0x6083 -0x577E 0x609A -0x5821 0x6084 -0x5822 0x609B -0x5823 0x5824 0x6096 -0x5825 0x6092 -0x5826 0x60A7 -0x5827 0x608B -0x5828 0x60E1 -0x5829 0x60B8 -0x582A 0x60E0 -0x582B 0x60D3 -0x582C 0x60B4 -0x582D 0x5FF0 -0x582E 0x60BD -0x582F 0x60C6 -0x5830 0x60B5 -0x5831 0x60D8 -0x5832 0x614D -0x5833 0x6115 -0x5834 0x6106 -0x5835 0x5836 0x60F6 -0x5837 0x6100 -0x5838 0x60F4 -0x5839 0x60FA -0x583A 0x6103 -0x583B 0x6121 -0x583C 0x60FB -0x583D 0x60F1 -0x583E 0x583F 0x610D -0x5840 0x6147 -0x5841 0x613E -0x5842 0x6128 -0x5843 0x6127 -0x5844 0x614A -0x5845 0x613F -0x5846 0x613C -0x5847 0x612C -0x5848 0x6134 -0x5849 0x613D -0x584A 0x6142 -0x584B 0x6144 -0x584C 0x6173 -0x584D 0x6177 -0x584E 0x5850 0x6158 -0x5851 0x616B -0x5852 0x6174 -0x5853 0x616F -0x5854 0x6165 -0x5855 0x6171 -0x5856 0x615F -0x5857 0x615D -0x5858 0x6153 -0x5859 0x6175 -0x585A 0x6199 -0x585B 0x6196 -0x585C 0x6187 -0x585D 0x61AC -0x585E 0x6194 -0x585F 0x619A -0x5860 0x618A -0x5861 0x6191 -0x5862 0x61AB -0x5863 0x61AE -0x5864 0x61CC -0x5865 0x61CA -0x5866 0x61C9 -0x5867 0x61F7 -0x5868 0x61C8 -0x5869 0x61C3 -0x586A 0x61C6 -0x586B 0x61BA -0x586C 0x61CB -0x586D 0x7F79 -0x586E 0x61CD -0x586F 0x61E6 -0x5870 0x61E3 -0x5871 0x61F6 -0x5872 0x61FA -0x5873 0x61F4 -0x5874 0x61FF -0x5875 0x61FD -0x5876 0x61FC -0x5877 0x61FE -0x5878 0x6200 -0x5879 0x587A 0x6208 -0x587B 0x620D -0x587C 0x620C -0x587D 0x6214 -0x587E 0x621B -0x5921 0x621E -0x5922 0x6221 -0x5923 0x622A -0x5924 0x622E -0x5925 0x6230 -0x5926 0x5927 0x6232 -0x5928 0x6241 -0x5929 0x624E -0x592A 0x625E -0x592B 0x6263 -0x592C 0x625B -0x592D 0x6260 -0x592E 0x6268 -0x592F 0x627C -0x5930 0x6282 -0x5931 0x6289 -0x5932 0x627E -0x5933 0x5934 0x6292 -0x5935 0x6296 -0x5936 0x62D4 -0x5937 0x6283 -0x5938 0x6294 -0x5939 0x62D7 -0x593A 0x62D1 -0x593B 0x62BB -0x593C 0x62CF -0x593D 0x62FF -0x593E 0x62C6 -0x593F 0x64D4 -0x5940 0x62C8 -0x5941 0x62DC -0x5942 0x62CC -0x5943 0x62CA -0x5944 0x62C2 -0x5945 0x62C7 -0x5946 0x629B -0x5947 0x62C9 -0x5948 0x630C -0x5949 0x62EE -0x594A 0x62F1 -0x594B 0x6327 -0x594C 0x6302 -0x594D 0x6308 -0x594E 0x62EF -0x594F 0x62F5 -0x5950 0x6350 -0x5951 0x633E -0x5952 0x634D -0x5953 0x641C -0x5954 0x634F -0x5955 0x6396 -0x5956 0x638E -0x5957 0x6380 -0x5958 0x63AB -0x5959 0x6376 -0x595A 0x63A3 -0x595B 0x638F -0x595C 0x6389 -0x595D 0x639F -0x595E 0x63B5 -0x595F 0x636B -0x5960 0x6369 -0x5961 0x63BE -0x5962 0x63E9 -0x5963 0x63C0 -0x5964 0x63C6 -0x5965 0x63E3 -0x5966 0x63C9 -0x5967 0x63D2 -0x5968 0x63F6 -0x5969 0x63C4 -0x596A 0x6416 -0x596B 0x6434 -0x596C 0x6406 -0x596D 0x6413 -0x596E 0x6426 -0x596F 0x6436 -0x5970 0x651D -0x5971 0x6417 -0x5972 0x6428 -0x5973 0x640F -0x5974 0x6467 -0x5975 0x646F -0x5976 0x6476 -0x5977 0x644E -0x5978 0x652A -0x5979 0x6495 -0x597A 0x6493 -0x597B 0x64A5 -0x597C 0x64A9 -0x597D 0x6488 -0x597E 0x64BC -0x5A21 0x64DA -0x5A22 0x64D2 -0x5A23 0x64C5 -0x5A24 0x64C7 -0x5A25 0x64BB -0x5A26 0x64D8 -0x5A27 0x64C2 -0x5A28 0x64F1 -0x5A29 0x64E7 -0x5A2A 0x8209 -0x5A2B 0x5A2C 0x64E0 -0x5A2D 0x62AC -0x5A2E 0x64E3 -0x5A2F 0x64EF -0x5A30 0x652C -0x5A31 0x64F6 -0x5A32 0x64F4 -0x5A33 0x64F2 -0x5A34 0x64FA -0x5A35 0x6500 -0x5A36 0x64FD -0x5A37 0x6518 -0x5A38 0x651C -0x5A39 0x6505 -0x5A3A 0x6524 -0x5A3B 0x6523 -0x5A3C 0x652B -0x5A3D 0x5A3E 0x6534 -0x5A3F 0x6537 -0x5A40 0x6536 -0x5A41 0x6538 -0x5A42 0x754B -0x5A43 0x6548 -0x5A44 0x6556 -0x5A45 0x6555 -0x5A46 0x654D -0x5A47 0x6558 -0x5A48 0x655E -0x5A49 0x655D -0x5A4A 0x6572 -0x5A4B 0x6578 -0x5A4C 0x5A4D 0x6582 -0x5A4E 0x8B8A -0x5A4F 0x659B -0x5A50 0x659F -0x5A51 0x65AB -0x5A52 0x65B7 -0x5A53 0x65C3 -0x5A54 0x65C6 -0x5A55 0x65C1 -0x5A56 0x65C4 -0x5A57 0x65CC -0x5A58 0x65D2 -0x5A59 0x65DB -0x5A5A 0x65D9 -0x5A5B 0x5A5C 0x65E0 -0x5A5D 0x65F1 -0x5A5E 0x6772 -0x5A5F 0x660A -0x5A60 0x6603 -0x5A61 0x65FB -0x5A62 0x6773 -0x5A63 0x5A64 0x6635 -0x5A65 0x6634 -0x5A66 0x661C -0x5A67 0x664F -0x5A68 0x6644 -0x5A69 0x6649 -0x5A6A 0x6641 -0x5A6B 0x665E -0x5A6C 0x665D -0x5A6D 0x6664 -0x5A6E 0x5A6F 0x6667 -0x5A70 0x665F -0x5A71 0x6662 -0x5A72 0x6670 -0x5A73 0x6683 -0x5A74 0x6688 -0x5A75 0x668E -0x5A76 0x6689 -0x5A77 0x6684 -0x5A78 0x6698 -0x5A79 0x669D -0x5A7A 0x66C1 -0x5A7B 0x66B9 -0x5A7C 0x66C9 -0x5A7D 0x66BE -0x5A7E 0x66BC -0x5B21 0x66C4 -0x5B22 0x66B8 -0x5B23 0x66D6 -0x5B24 0x66DA -0x5B25 0x66E0 -0x5B26 0x663F -0x5B27 0x66E6 -0x5B28 0x66E9 -0x5B29 0x66F0 -0x5B2A 0x66F5 -0x5B2B 0x66F7 -0x5B2C 0x670F -0x5B2D 0x6716 -0x5B2E 0x671E -0x5B2F 0x5B30 0x6726 -0x5B31 0x9738 -0x5B32 0x672E -0x5B33 0x673F -0x5B34 0x6736 -0x5B35 0x6741 -0x5B36 0x6738 -0x5B37 0x6737 -0x5B38 0x6746 -0x5B39 0x675E -0x5B3A 0x6760 -0x5B3B 0x6759 -0x5B3C 0x5B3D 0x6763 -0x5B3E 0x6789 -0x5B3F 0x6770 -0x5B40 0x67A9 -0x5B41 0x677C -0x5B42 0x676A -0x5B43 0x678C -0x5B44 0x678B -0x5B45 0x67A6 -0x5B46 0x67A1 -0x5B47 0x6785 -0x5B48 0x67B7 -0x5B49 0x67EF -0x5B4A 0x67B4 -0x5B4B 0x67EC -0x5B4C 0x67B3 -0x5B4D 0x67E9 -0x5B4E 0x67B8 -0x5B4F 0x67E4 -0x5B50 0x67DE -0x5B51 0x67DD -0x5B52 0x67E2 -0x5B53 0x67EE -0x5B54 0x67B9 -0x5B55 0x67CE -0x5B56 0x67C6 -0x5B57 0x67E7 -0x5B58 0x6A9C -0x5B59 0x681E -0x5B5A 0x6846 -0x5B5B 0x6829 -0x5B5C 0x6840 -0x5B5D 0x684D -0x5B5E 0x6832 -0x5B5F 0x684E -0x5B60 0x68B3 -0x5B61 0x682B -0x5B62 0x6859 -0x5B63 0x6863 -0x5B64 0x6877 -0x5B65 0x687F -0x5B66 0x689F -0x5B67 0x688F -0x5B68 0x68AD -0x5B69 0x6894 -0x5B6A 0x689D -0x5B6B 0x689B -0x5B6C 0x6883 -0x5B6D 0x6AAE -0x5B6E 0x68B9 -0x5B6F 0x6874 -0x5B70 0x68B5 -0x5B71 0x68A0 -0x5B72 0x68BA -0x5B73 0x690F -0x5B74 0x688D -0x5B75 0x687E -0x5B76 0x6901 -0x5B77 0x68CA -0x5B78 0x6908 -0x5B79 0x68D8 -0x5B7A 0x6922 -0x5B7B 0x6926 -0x5B7C 0x68E1 -0x5B7D 0x690C -0x5B7E 0x68CD -0x5C21 0x68D4 -0x5C22 0x68E7 -0x5C23 0x68D5 -0x5C24 0x6936 -0x5C25 0x6912 -0x5C26 0x6904 -0x5C27 0x68D7 -0x5C28 0x68E3 -0x5C29 0x6925 -0x5C2A 0x68F9 -0x5C2B 0x68E0 -0x5C2C 0x68EF -0x5C2D 0x6928 -0x5C2E 0x692A -0x5C2F 0x691A -0x5C30 0x6923 -0x5C31 0x6921 -0x5C32 0x68C6 -0x5C33 0x6979 -0x5C34 0x6977 -0x5C35 0x695C -0x5C36 0x6978 -0x5C37 0x696B -0x5C38 0x6954 -0x5C39 0x697E -0x5C3A 0x696E -0x5C3B 0x6939 -0x5C3C 0x6974 -0x5C3D 0x693D -0x5C3E 0x6959 -0x5C3F 0x6930 -0x5C40 0x6961 -0x5C41 0x695E -0x5C42 0x695D -0x5C43 0x6981 -0x5C44 0x696A -0x5C45 0x69B2 -0x5C46 0x69AE -0x5C47 0x69D0 -0x5C48 0x69BF -0x5C49 0x69C1 -0x5C4A 0x69D3 -0x5C4B 0x69BE -0x5C4C 0x69CE -0x5C4D 0x5BE8 -0x5C4E 0x69CA -0x5C4F 0x69DD -0x5C50 0x69BB -0x5C51 0x69C3 -0x5C52 0x69A7 -0x5C53 0x6A2E -0x5C54 0x6991 -0x5C55 0x69A0 -0x5C56 0x699C -0x5C57 0x6995 -0x5C58 0x69B4 -0x5C59 0x69DE -0x5C5A 0x69E8 -0x5C5B 0x6A02 -0x5C5C 0x6A1B -0x5C5D 0x69FF -0x5C5E 0x6B0A -0x5C5F 0x69F9 -0x5C60 0x69F2 -0x5C61 0x69E7 -0x5C62 0x6A05 -0x5C63 0x69B1 -0x5C64 0x6A1E -0x5C65 0x69ED -0x5C66 0x6A14 -0x5C67 0x69EB -0x5C68 0x6A0A -0x5C69 0x6A12 -0x5C6A 0x6AC1 -0x5C6B 0x6A23 -0x5C6C 0x6A13 -0x5C6D 0x6A44 -0x5C6E 0x6A0C -0x5C6F 0x6A72 -0x5C70 0x6A36 -0x5C71 0x6A78 -0x5C72 0x6A47 -0x5C73 0x6A62 -0x5C74 0x6A59 -0x5C75 0x6A66 -0x5C76 0x6A48 -0x5C77 0x6A38 -0x5C78 0x6A22 -0x5C79 0x6A90 -0x5C7A 0x6A8D -0x5C7B 0x6AA0 -0x5C7C 0x6A84 -0x5C7D 0x5C7E 0x6AA2 -0x5D21 0x6A97 -0x5D22 0x8617 -0x5D23 0x6ABB -0x5D24 0x6AC3 -0x5D25 0x6AC2 -0x5D26 0x6AB8 -0x5D27 0x6AB3 -0x5D28 0x6AAC -0x5D29 0x6ADE -0x5D2A 0x6AD1 -0x5D2B 0x6ADF -0x5D2C 0x6AAA -0x5D2D 0x6ADA -0x5D2E 0x6AEA -0x5D2F 0x6AFB -0x5D30 0x6B05 -0x5D31 0x8616 -0x5D32 0x6AFA -0x5D33 0x6B12 -0x5D34 0x6B16 -0x5D35 0x9B31 -0x5D36 0x6B1F -0x5D37 0x6B38 -0x5D38 0x6B37 -0x5D39 0x76DC -0x5D3A 0x6B39 -0x5D3B 0x98EE -0x5D3C 0x6B47 -0x5D3D 0x6B43 -0x5D3E 0x6B49 -0x5D3F 0x6B50 -0x5D40 0x6B59 -0x5D41 0x6B54 -0x5D42 0x6B5B -0x5D43 0x6B5F -0x5D44 0x6B61 -0x5D45 0x5D46 0x6B78 -0x5D47 0x5D48 0x6B7F -0x5D49 0x6B84 -0x5D4A 0x6B83 -0x5D4B 0x6B8D -0x5D4C 0x6B98 -0x5D4D 0x6B95 -0x5D4E 0x6B9E -0x5D4F 0x6BA4 -0x5D50 0x5D51 0x6BAA -0x5D52 0x6BAF -0x5D53 0x6BB2 -0x5D54 0x6BB1 -0x5D55 0x6BB3 -0x5D56 0x6BB7 -0x5D57 0x6BBC -0x5D58 0x6BC6 -0x5D59 0x6BCB -0x5D5A 0x6BD3 -0x5D5B 0x6BDF -0x5D5C 0x6BEC -0x5D5D 0x6BEB -0x5D5E 0x6BF3 -0x5D5F 0x6BEF -0x5D60 0x9EBE -0x5D61 0x6C08 -0x5D62 0x5D63 0x6C13 -0x5D64 0x6C1B -0x5D65 0x6C24 -0x5D66 0x6C23 -0x5D67 0x6C5E -0x5D68 0x6C55 -0x5D69 0x6C62 -0x5D6A 0x6C6A -0x5D6B 0x6C82 -0x5D6C 0x6C8D -0x5D6D 0x6C9A -0x5D6E 0x6C81 -0x5D6F 0x6C9B -0x5D70 0x6C7E -0x5D71 0x6C68 -0x5D72 0x6C73 -0x5D73 0x6C92 -0x5D74 0x6C90 -0x5D75 0x6CC4 -0x5D76 0x6CF1 -0x5D77 0x6CD3 -0x5D78 0x6CBD -0x5D79 0x6CD7 -0x5D7A 0x6CC5 -0x5D7B 0x6CDD -0x5D7C 0x6CAE -0x5D7D 0x6CB1 -0x5D7E 0x6CBE -0x5E21 0x6CBA -0x5E22 0x6CDB -0x5E23 0x6CEF -0x5E24 0x6CD9 -0x5E25 0x6CEA -0x5E26 0x6D1F -0x5E27 0x884D -0x5E28 0x6D36 -0x5E29 0x6D2B -0x5E2A 0x6D3D -0x5E2B 0x6D38 -0x5E2C 0x6D19 -0x5E2D 0x6D35 -0x5E2E 0x6D33 -0x5E2F 0x6D12 -0x5E30 0x6D0C -0x5E31 0x6D63 -0x5E32 0x6D93 -0x5E33 0x6D64 -0x5E34 0x6D5A -0x5E35 0x6D79 -0x5E36 0x6D59 -0x5E37 0x6D8E -0x5E38 0x6D95 -0x5E39 0x6FE4 -0x5E3A 0x6D85 -0x5E3B 0x6DF9 -0x5E3C 0x6E15 -0x5E3D 0x6E0A -0x5E3E 0x6DB5 -0x5E3F 0x6DC7 -0x5E40 0x6DE6 -0x5E41 0x6DB8 -0x5E42 0x6DC6 -0x5E43 0x6DEC -0x5E44 0x6DDE -0x5E45 0x6DCC -0x5E46 0x6DE8 -0x5E47 0x6DD2 -0x5E48 0x6DC5 -0x5E49 0x6DFA -0x5E4A 0x6DD9 -0x5E4B 0x6DE4 -0x5E4C 0x6DD5 -0x5E4D 0x6DEA -0x5E4E 0x6DEE -0x5E4F 0x6E2D -0x5E50 0x6E6E -0x5E51 0x6E2E -0x5E52 0x6E19 -0x5E53 0x6E72 -0x5E54 0x6E5F -0x5E55 0x6E3E -0x5E56 0x6E23 -0x5E57 0x6E6B -0x5E58 0x6E2B -0x5E59 0x6E76 -0x5E5A 0x6E4D -0x5E5B 0x6E1F -0x5E5C 0x6E43 -0x5E5D 0x6E3A -0x5E5E 0x6E4E -0x5E5F 0x6E24 -0x5E60 0x6EFF -0x5E61 0x6E1D -0x5E62 0x6E38 -0x5E63 0x6E82 -0x5E64 0x6EAA -0x5E65 0x6E98 -0x5E66 0x6EC9 -0x5E67 0x6EB7 -0x5E68 0x6ED3 -0x5E69 0x6EBD -0x5E6A 0x6EAF -0x5E6B 0x6EC4 -0x5E6C 0x6EB2 -0x5E6D 0x5E6E 0x6ED4 -0x5E6F 0x6E8F -0x5E70 0x6EA5 -0x5E71 0x6EC2 -0x5E72 0x6E9F -0x5E73 0x6F41 -0x5E74 0x6F11 -0x5E75 0x704C -0x5E76 0x6EEC -0x5E77 0x6EF8 -0x5E78 0x6EFE -0x5E79 0x6F3F -0x5E7A 0x6EF2 -0x5E7B 0x6F31 -0x5E7C 0x6EEF -0x5E7D 0x6F32 -0x5E7E 0x6ECC -0x5F21 0x6F3E -0x5F22 0x6F13 -0x5F23 0x6EF7 -0x5F24 0x6F86 -0x5F25 0x6F7A -0x5F26 0x6F78 -0x5F27 0x6F81 -0x5F28 0x6F80 -0x5F29 0x6F6F -0x5F2A 0x6F5B -0x5F2B 0x6FF3 -0x5F2C 0x6F6D -0x5F2D 0x6F82 -0x5F2E 0x6F7C -0x5F2F 0x6F58 -0x5F30 0x6F8E -0x5F31 0x6F91 -0x5F32 0x6FC2 -0x5F33 0x6F66 -0x5F34 0x6FB3 -0x5F35 0x6FA3 -0x5F36 0x6FA1 -0x5F37 0x6FA4 -0x5F38 0x6FB9 -0x5F39 0x6FC6 -0x5F3A 0x6FAA -0x5F3B 0x6FDF -0x5F3C 0x6FD5 -0x5F3D 0x6FEC -0x5F3E 0x6FD4 -0x5F3F 0x6FD8 -0x5F40 0x6FF1 -0x5F41 0x6FEE -0x5F42 0x6FDB -0x5F43 0x7009 -0x5F44 0x700B -0x5F45 0x6FFA -0x5F46 0x7011 -0x5F47 0x7001 -0x5F48 0x700F -0x5F49 0x6FFE -0x5F4A 0x701B -0x5F4B 0x701A -0x5F4C 0x6F74 -0x5F4D 0x701D -0x5F4E 0x7018 -0x5F4F 0x701F -0x5F50 0x7030 -0x5F51 0x703E -0x5F52 0x7032 -0x5F53 0x7051 -0x5F54 0x7063 -0x5F55 0x7099 -0x5F56 0x7092 -0x5F57 0x70AF -0x5F58 0x70F1 -0x5F59 0x70AC -0x5F5A 0x70B8 -0x5F5B 0x70B3 -0x5F5C 0x70AE -0x5F5D 0x70DF -0x5F5E 0x70CB -0x5F5F 0x70DD -0x5F60 0x70D9 -0x5F61 0x7109 -0x5F62 0x70FD -0x5F63 0x711C -0x5F64 0x7119 -0x5F65 0x7165 -0x5F66 0x7155 -0x5F67 0x7188 -0x5F68 0x7166 -0x5F69 0x7162 -0x5F6A 0x714C -0x5F6B 0x7156 -0x5F6C 0x716C -0x5F6D 0x718F -0x5F6E 0x71FB -0x5F6F 0x7184 -0x5F70 0x7195 -0x5F71 0x71A8 -0x5F72 0x71AC -0x5F73 0x71D7 -0x5F74 0x71B9 -0x5F75 0x71BE -0x5F76 0x71D2 -0x5F77 0x71C9 -0x5F78 0x71D4 -0x5F79 0x71CE -0x5F7A 0x71E0 -0x5F7B 0x71EC -0x5F7C 0x71E7 -0x5F7D 0x71F5 -0x5F7E 0x71FC -0x6021 0x71F9 -0x6022 0x71FF -0x6023 0x720D -0x6024 0x7210 -0x6025 0x721B -0x6026 0x7228 -0x6027 0x722D -0x6028 0x722C -0x6029 0x7230 -0x602A 0x7232 -0x602B 0x602C 0x723B -0x602D 0x602E 0x723F -0x602F 0x7246 -0x6030 0x724B -0x6031 0x7258 -0x6032 0x7274 -0x6033 0x727E -0x6034 0x7282 -0x6035 0x7281 -0x6036 0x7287 -0x6037 0x7292 -0x6038 0x7296 -0x6039 0x72A2 -0x603A 0x72A7 -0x603B 0x72B9 -0x603C 0x72B2 -0x603D 0x72C3 -0x603E 0x72C6 -0x603F 0x72C4 -0x6040 0x72CE -0x6041 0x72D2 -0x6042 0x72E2 -0x6043 0x6044 0x72E0 -0x6045 0x72F9 -0x6046 0x72F7 -0x6047 0x500F -0x6048 0x7317 -0x6049 0x730A -0x604A 0x731C -0x604B 0x7316 -0x604C 0x731D -0x604D 0x7334 -0x604E 0x732F -0x604F 0x7329 -0x6050 0x7325 -0x6051 0x733E -0x6052 0x6053 0x734E -0x6054 0x9ED8 -0x6055 0x7357 -0x6056 0x736A -0x6057 0x7368 -0x6058 0x7370 -0x6059 0x7378 -0x605A 0x7375 -0x605B 0x737B -0x605C 0x737A -0x605D 0x73C8 -0x605E 0x73B3 -0x605F 0x73CE -0x6060 0x73BB -0x6061 0x73C0 -0x6062 0x73E5 -0x6063 0x73EE -0x6064 0x73DE -0x6065 0x74A2 -0x6066 0x7405 -0x6067 0x746F -0x6068 0x7425 -0x6069 0x73F8 -0x606A 0x7432 -0x606B 0x743A -0x606C 0x7455 -0x606D 0x743F -0x606E 0x745F -0x606F 0x7459 -0x6070 0x7441 -0x6071 0x745C -0x6072 0x7469 -0x6073 0x7470 -0x6074 0x7463 -0x6075 0x746A -0x6076 0x7476 -0x6077 0x747E -0x6078 0x748B -0x6079 0x749E -0x607A 0x74A7 -0x607B 0x74CA -0x607C 0x74CF -0x607D 0x74D4 -0x607E 0x73F1 -0x6121 0x74E0 -0x6122 0x74E3 -0x6123 0x74E7 -0x6124 0x74E9 -0x6125 0x74EE -0x6126 0x74F2 -0x6127 0x6128 0x74F0 -0x6129 0x74F8 -0x612A 0x74F7 -0x612B 0x7504 -0x612C 0x7503 -0x612D 0x7505 -0x612E 0x750C -0x612F 0x750E -0x6130 0x750D -0x6131 0x7515 -0x6132 0x7513 -0x6133 0x751E -0x6134 0x7526 -0x6135 0x752C -0x6136 0x753C -0x6137 0x7544 -0x6138 0x754D -0x6139 0x754A -0x613A 0x7549 -0x613B 0x755B -0x613C 0x7546 -0x613D 0x755A -0x613E 0x7569 -0x613F 0x7564 -0x6140 0x7567 -0x6141 0x756B -0x6142 0x756D -0x6143 0x7578 -0x6144 0x7576 -0x6145 0x6146 0x7586 -0x6147 0x7574 -0x6148 0x758A -0x6149 0x7589 -0x614A 0x7582 -0x614B 0x7594 -0x614C 0x759A -0x614D 0x759D -0x614E 0x75A5 -0x614F 0x75A3 -0x6150 0x75C2 -0x6151 0x75B3 -0x6152 0x75C3 -0x6153 0x75B5 -0x6154 0x75BD -0x6155 0x75B8 -0x6156 0x75BC -0x6157 0x75B1 -0x6158 0x75CD -0x6159 0x75CA -0x615A 0x75D2 -0x615B 0x75D9 -0x615C 0x75E3 -0x615D 0x75DE -0x615E 0x615F 0x75FE -0x6160 0x75FC -0x6161 0x7601 -0x6162 0x75F0 -0x6163 0x75FA -0x6164 0x6165 0x75F2 -0x6166 0x760B -0x6167 0x760D -0x6168 0x7609 -0x6169 0x761F -0x616A 0x7627 -0x616B 0x616D 0x7620 -0x616E 0x7624 -0x616F 0x7634 -0x6170 0x7630 -0x6171 0x763B -0x6172 0x6173 0x7647 -0x6174 0x7646 -0x6175 0x765C -0x6176 0x7658 -0x6177 0x6178 0x7661 -0x6179 0x617B 0x7668 -0x617C 0x7667 -0x617D 0x766C -0x617E 0x7670 -0x6221 0x7672 -0x6222 0x7676 -0x6223 0x7678 -0x6224 0x767C -0x6225 0x7680 -0x6226 0x7683 -0x6227 0x7688 -0x6228 0x768B -0x6229 0x768E -0x622A 0x7696 -0x622B 0x7693 -0x622C 0x622D 0x7699 -0x622E 0x76B0 -0x622F 0x76B4 -0x6230 0x6232 0x76B8 -0x6233 0x76C2 -0x6234 0x76CD -0x6235 0x76D6 -0x6236 0x76D2 -0x6237 0x76DE -0x6238 0x76E1 -0x6239 0x76E5 -0x623A 0x76E7 -0x623B 0x76EA -0x623C 0x862F -0x623D 0x76FB -0x623E 0x7708 -0x623F 0x7707 -0x6240 0x7704 -0x6241 0x7729 -0x6242 0x7724 -0x6243 0x771E -0x6244 0x6245 0x7725 -0x6246 0x771B -0x6247 0x6248 0x7737 -0x6249 0x7747 -0x624A 0x775A -0x624B 0x7768 -0x624C 0x776B -0x624D 0x775B -0x624E 0x7765 -0x624F 0x777F -0x6250 0x777E -0x6251 0x7779 -0x6252 0x778E -0x6253 0x778B -0x6254 0x7791 -0x6255 0x77A0 -0x6256 0x779E -0x6257 0x77B0 -0x6258 0x77B6 -0x6259 0x77B9 -0x625A 0x77BF -0x625B 0x625C 0x77BC -0x625D 0x77BB -0x625E 0x77C7 -0x625F 0x77CD -0x6260 0x77D7 -0x6261 0x77DA -0x6262 0x77DC -0x6263 0x77E3 -0x6264 0x77EE -0x6265 0x77FC -0x6266 0x780C -0x6267 0x7812 -0x6268 0x7926 -0x6269 0x7820 -0x626A 0x792A -0x626B 0x7845 -0x626C 0x788E -0x626D 0x7874 -0x626E 0x7886 -0x626F 0x787C -0x6270 0x789A -0x6271 0x788C -0x6272 0x78A3 -0x6273 0x78B5 -0x6274 0x78AA -0x6275 0x78AF -0x6276 0x78D1 -0x6277 0x78C6 -0x6278 0x78CB -0x6279 0x78D4 -0x627A 0x78BE -0x627B 0x78BC -0x627C 0x78C5 -0x627D 0x78CA -0x627E 0x78EC -0x6321 0x78E7 -0x6322 0x78DA -0x6323 0x78FD -0x6324 0x78F4 -0x6325 0x7907 -0x6326 0x7912 -0x6327 0x7911 -0x6328 0x7919 -0x6329 0x792C -0x632A 0x792B -0x632B 0x7940 -0x632C 0x7960 -0x632D 0x7957 -0x632E 0x795F -0x632F 0x795A -0x6330 0x7955 -0x6331 0x7953 -0x6332 0x797A -0x6333 0x797F -0x6334 0x798A -0x6335 0x799D -0x6336 0x79A7 -0x6337 0x9F4B -0x6338 0x79AA -0x6339 0x79AE -0x633A 0x79B3 -0x633B 0x633C 0x79B9 -0x633D 0x79C9 -0x633E 0x79D5 -0x633F 0x79E7 -0x6340 0x79EC -0x6341 0x79E1 -0x6342 0x79E3 -0x6343 0x7A08 -0x6344 0x7A0D -0x6345 0x6346 0x7A18 -0x6347 0x7A20 -0x6348 0x7A1F -0x6349 0x7980 -0x634A 0x7A31 -0x634B 0x7A3B -0x634C 0x7A3E -0x634D 0x7A37 -0x634E 0x7A43 -0x634F 0x7A57 -0x6350 0x7A49 -0x6351 0x6352 0x7A61 -0x6353 0x7A69 -0x6354 0x9F9D -0x6355 0x7A70 -0x6356 0x7A79 -0x6357 0x7A7D -0x6358 0x7A88 -0x6359 0x7A97 -0x635A 0x7A95 -0x635B 0x7A98 -0x635C 0x7A96 -0x635D 0x7AA9 -0x635E 0x7AC8 -0x635F 0x7AB0 -0x6360 0x7AB6 -0x6361 0x7AC5 -0x6362 0x7AC4 -0x6363 0x7ABF -0x6364 0x9083 -0x6365 0x7AC7 -0x6366 0x7ACA -0x6367 0x7ACD -0x6368 0x7ACF -0x6369 0x7AD5 -0x636A 0x7AD3 -0x636B 0x636C 0x7AD9 -0x636D 0x7ADD -0x636E 0x636F 0x7AE1 -0x6370 0x7AE6 -0x6371 0x7AED -0x6372 0x7AF0 -0x6373 0x7B02 -0x6374 0x7B0F -0x6375 0x7B0A -0x6376 0x7B06 -0x6377 0x7B33 -0x6378 0x6379 0x7B18 -0x637A 0x7B1E -0x637B 0x7B35 -0x637C 0x7B28 -0x637D 0x7B36 -0x637E 0x7B50 -0x6421 0x7B7A -0x6422 0x7B04 -0x6423 0x7B4D -0x6424 0x7B0B -0x6425 0x7B4C -0x6426 0x7B45 -0x6427 0x7B75 -0x6428 0x7B65 -0x6429 0x7B74 -0x642A 0x7B67 -0x642B 0x642C 0x7B70 -0x642D 0x7B6C -0x642E 0x7B6E -0x642F 0x7B9D -0x6430 0x7B98 -0x6431 0x7B9F -0x6432 0x7B8D -0x6433 0x7B9C -0x6434 0x7B9A -0x6435 0x7B8B -0x6436 0x7B92 -0x6437 0x7B8F -0x6438 0x7B5D -0x6439 0x7B99 -0x643A 0x7BCB -0x643B 0x7BC1 -0x643C 0x7BCC -0x643D 0x7BCF -0x643E 0x7BB4 -0x643F 0x7BC6 -0x6440 0x7BDD -0x6441 0x7BE9 -0x6442 0x7C11 -0x6443 0x7C14 -0x6444 0x7BE6 -0x6445 0x7BE5 -0x6446 0x7C60 -0x6447 0x7C00 -0x6448 0x7C07 -0x6449 0x7C13 -0x644A 0x7BF3 -0x644B 0x7BF7 -0x644C 0x7C17 -0x644D 0x7C0D -0x644E 0x7BF6 -0x644F 0x7C23 -0x6450 0x7C27 -0x6451 0x7C2A -0x6452 0x7C1F -0x6453 0x7C37 -0x6454 0x7C2B -0x6455 0x7C3D -0x6456 0x7C4C -0x6457 0x7C43 -0x6458 0x7C54 -0x6459 0x7C4F -0x645A 0x7C40 -0x645B 0x7C50 -0x645C 0x7C58 -0x645D 0x7C5F -0x645E 0x7C64 -0x645F 0x7C56 -0x6460 0x7C65 -0x6461 0x7C6C -0x6462 0x7C75 -0x6463 0x7C83 -0x6464 0x7C90 -0x6465 0x7CA4 -0x6466 0x7CAD -0x6467 0x7CA2 -0x6468 0x7CAB -0x6469 0x7CA1 -0x646A 0x7CA8 -0x646B 0x7CB3 -0x646C 0x7CB2 -0x646D 0x7CB1 -0x646E 0x7CAE -0x646F 0x7CB9 -0x6470 0x7CBD -0x6471 0x7CC0 -0x6472 0x7CC5 -0x6473 0x7CC2 -0x6474 0x7CD8 -0x6475 0x7CD2 -0x6476 0x7CDC -0x6477 0x7CE2 -0x6478 0x9B3B -0x6479 0x7CEF -0x647A 0x7CF2 -0x647B 0x7CF4 -0x647C 0x7CF6 -0x647D 0x7CFA -0x647E 0x7D06 -0x6521 0x7D02 -0x6522 0x7D1C -0x6523 0x7D15 -0x6524 0x7D0A -0x6525 0x7D45 -0x6526 0x7D4B -0x6527 0x7D2E -0x6528 0x7D32 -0x6529 0x7D3F -0x652A 0x7D35 -0x652B 0x7D46 -0x652C 0x7D73 -0x652D 0x7D56 -0x652E 0x7D4E -0x652F 0x7D72 -0x6530 0x7D68 -0x6531 0x7D6E -0x6532 0x7D4F -0x6533 0x7D63 -0x6534 0x7D93 -0x6535 0x7D89 -0x6536 0x7D5B -0x6537 0x7D8F -0x6538 0x7D7D -0x6539 0x7D9B -0x653A 0x7DBA -0x653B 0x7DAE -0x653C 0x7DA3 -0x653D 0x7DB5 -0x653E 0x7DC7 -0x653F 0x7DBD -0x6540 0x7DAB -0x6541 0x7E3D -0x6542 0x7DA2 -0x6543 0x7DAF -0x6544 0x7DDC -0x6545 0x7DB8 -0x6546 0x7D9F -0x6547 0x7DB0 -0x6548 0x7DD8 -0x6549 0x7DDD -0x654A 0x7DE4 -0x654B 0x7DDE -0x654C 0x7DFB -0x654D 0x7DF2 -0x654E 0x7DE1 -0x654F 0x7E05 -0x6550 0x7E0A -0x6551 0x7E23 -0x6552 0x7E21 -0x6553 0x7E12 -0x6554 0x7E31 -0x6555 0x7E1F -0x6556 0x7E09 -0x6557 0x7E0B -0x6558 0x7E22 -0x6559 0x7E46 -0x655A 0x7E66 -0x655B 0x7E3B -0x655C 0x7E35 -0x655D 0x7E39 -0x655E 0x7E43 -0x655F 0x7E37 -0x6560 0x7E32 -0x6561 0x7E3A -0x6562 0x7E67 -0x6563 0x7E5D -0x6564 0x7E56 -0x6565 0x7E5E -0x6566 0x6567 0x7E59 -0x6568 0x7E79 -0x6569 0x7E6A -0x656A 0x7E69 -0x656B 0x7E7C -0x656C 0x7E7B -0x656D 0x7E83 -0x656E 0x7DD5 -0x656F 0x7E7D -0x6570 0x8FAE -0x6571 0x7E7F -0x6572 0x6573 0x7E88 -0x6574 0x7E8C -0x6575 0x7E92 -0x6576 0x7E90 -0x6577 0x6578 0x7E93 -0x6579 0x7E96 -0x657A 0x7E8E -0x657B 0x657C 0x7E9B -0x657D 0x7F38 -0x657E 0x7F3A -0x6621 0x7F45 -0x6622 0x6624 0x7F4C -0x6625 0x6626 0x7F50 -0x6627 0x7F55 -0x6628 0x7F54 -0x6629 0x7F58 -0x662A 0x662B 0x7F5F -0x662C 0x662D 0x7F68 -0x662E 0x7F67 -0x662F 0x7F78 -0x6630 0x7F82 -0x6631 0x7F86 -0x6632 0x7F83 -0x6633 0x7F88 -0x6634 0x7F87 -0x6635 0x7F8C -0x6636 0x7F94 -0x6637 0x7F9E -0x6638 0x7F9D -0x6639 0x7F9A -0x663A 0x7FA3 -0x663B 0x7FAF -0x663C 0x7FB2 -0x663D 0x7FB9 -0x663E 0x7FAE -0x663F 0x7FB6 -0x6640 0x7FB8 -0x6641 0x8B71 -0x6642 0x6643 0x7FC5 -0x6644 0x7FCA -0x6645 0x7FD5 -0x6646 0x7FD4 -0x6647 0x7FE1 -0x6648 0x7FE6 -0x6649 0x7FE9 -0x664A 0x7FF3 -0x664B 0x7FF9 -0x664C 0x98DC -0x664D 0x8006 -0x664E 0x8004 -0x664F 0x800B -0x6650 0x8012 -0x6651 0x6652 0x8018 -0x6653 0x801C -0x6654 0x8021 -0x6655 0x8028 -0x6656 0x803F -0x6657 0x803B -0x6658 0x804A -0x6659 0x8046 -0x665A 0x8052 -0x665B 0x8058 -0x665C 0x805A -0x665D 0x805F -0x665E 0x8062 -0x665F 0x8068 -0x6660 0x8073 -0x6661 0x8072 -0x6662 0x8070 -0x6663 0x8076 -0x6664 0x8079 -0x6665 0x807D -0x6666 0x807F -0x6667 0x8084 -0x6668 0x8086 -0x6669 0x8085 -0x666A 0x809B -0x666B 0x8093 -0x666C 0x809A -0x666D 0x80AD -0x666E 0x5190 -0x666F 0x80AC -0x6670 0x80DB -0x6671 0x80E5 -0x6672 0x80D9 -0x6673 0x80DD -0x6674 0x80C4 -0x6675 0x80DA -0x6676 0x80D6 -0x6677 0x8109 -0x6678 0x80EF -0x6679 0x80F1 -0x667A 0x811B -0x667B 0x8129 -0x667C 0x8123 -0x667D 0x812F -0x667E 0x814B -0x6721 0x968B -0x6722 0x8146 -0x6723 0x813E -0x6724 0x8153 -0x6725 0x8151 -0x6726 0x80FC -0x6727 0x8171 -0x6728 0x816E -0x6729 0x672A 0x8165 -0x672B 0x8174 -0x672C 0x8183 -0x672D 0x8188 -0x672E 0x818A -0x672F 0x8180 -0x6730 0x8182 -0x6731 0x81A0 -0x6732 0x8195 -0x6733 0x81A4 -0x6734 0x81A3 -0x6735 0x815F -0x6736 0x8193 -0x6737 0x81A9 -0x6738 0x81B0 -0x6739 0x81B5 -0x673A 0x81BE -0x673B 0x81B8 -0x673C 0x81BD -0x673D 0x81C0 -0x673E 0x81C2 -0x673F 0x81BA -0x6740 0x81C9 -0x6741 0x81CD -0x6742 0x81D1 -0x6743 0x81D9 -0x6744 0x81D8 -0x6745 0x81C8 -0x6746 0x81DA -0x6747 0x6748 0x81DF -0x6749 0x81E7 -0x674A 0x674B 0x81FA -0x674C 0x81FE -0x674D 0x674E 0x8201 -0x674F 0x8205 -0x6750 0x8207 -0x6751 0x820A -0x6752 0x820D -0x6753 0x8210 -0x6754 0x8216 -0x6755 0x8229 -0x6756 0x822B -0x6757 0x8238 -0x6758 0x8233 -0x6759 0x8240 -0x675A 0x8259 -0x675B 0x8258 -0x675C 0x825D -0x675D 0x825A -0x675E 0x825F -0x675F 0x8264 -0x6760 0x8262 -0x6761 0x8268 -0x6762 0x6763 0x826A -0x6764 0x822E -0x6765 0x8271 -0x6766 0x6767 0x8277 -0x6768 0x827E -0x6769 0x828D -0x676A 0x8292 -0x676B 0x82AB -0x676C 0x829F -0x676D 0x82BB -0x676E 0x82AC -0x676F 0x82E1 -0x6770 0x82E3 -0x6771 0x82DF -0x6772 0x82D2 -0x6773 0x82F4 -0x6774 0x82F3 -0x6775 0x82FA -0x6776 0x8393 -0x6777 0x8303 -0x6778 0x82FB -0x6779 0x82F9 -0x677A 0x82DE -0x677B 0x8306 -0x677C 0x82DC -0x677D 0x8309 -0x677E 0x82D9 -0x6821 0x8335 -0x6822 0x8334 -0x6823 0x8316 -0x6824 0x8332 -0x6825 0x8331 -0x6826 0x8340 -0x6827 0x8339 -0x6828 0x8350 -0x6829 0x8345 -0x682A 0x832F -0x682B 0x832B -0x682C 0x682D 0x8317 -0x682E 0x8385 -0x682F 0x839A -0x6830 0x83AA -0x6831 0x839F -0x6832 0x83A2 -0x6833 0x8396 -0x6834 0x8323 -0x6835 0x838E -0x6836 0x8387 -0x6837 0x838A -0x6838 0x837C -0x6839 0x83B5 -0x683A 0x8373 -0x683B 0x8375 -0x683C 0x83A0 -0x683D 0x8389 -0x683E 0x83A8 -0x683F 0x83F4 -0x6840 0x8413 -0x6841 0x83EB -0x6842 0x83CE -0x6843 0x83FD -0x6844 0x8403 -0x6845 0x83D8 -0x6846 0x840B -0x6847 0x83C1 -0x6848 0x83F7 -0x6849 0x8407 -0x684A 0x83E0 -0x684B 0x83F2 -0x684C 0x840D -0x684D 0x8422 -0x684E 0x8420 -0x684F 0x83BD -0x6850 0x8438 -0x6851 0x8506 -0x6852 0x83FB -0x6853 0x846D -0x6854 0x842A -0x6855 0x843C -0x6856 0x855A -0x6857 0x8484 -0x6858 0x8477 -0x6859 0x846B -0x685A 0x84AD -0x685B 0x846E -0x685C 0x8482 -0x685D 0x8469 -0x685E 0x8446 -0x685F 0x842C -0x6860 0x846F -0x6861 0x8479 -0x6862 0x8435 -0x6863 0x84CA -0x6864 0x8462 -0x6865 0x84B9 -0x6866 0x84BF -0x6867 0x849F -0x6868 0x84D9 -0x6869 0x84CD -0x686A 0x84BB -0x686B 0x84DA -0x686C 0x84D0 -0x686D 0x84C1 -0x686E 0x84C6 -0x686F 0x84D6 -0x6870 0x84A1 -0x6871 0x8521 -0x6872 0x84FF -0x6873 0x84F4 -0x6874 0x6875 0x8517 -0x6876 0x852C -0x6877 0x851F -0x6878 0x8515 -0x6879 0x8514 -0x687A 0x84FC -0x687B 0x8540 -0x687C 0x8563 -0x687D 0x8558 -0x687E 0x8548 -0x6921 0x8541 -0x6922 0x8602 -0x6923 0x854B -0x6924 0x8555 -0x6925 0x8580 -0x6926 0x85A4 -0x6927 0x8588 -0x6928 0x8591 -0x6929 0x858A -0x692A 0x85A8 -0x692B 0x856D -0x692C 0x8594 -0x692D 0x859B -0x692E 0x85EA -0x692F 0x8587 -0x6930 0x859C -0x6931 0x8577 -0x6932 0x857E -0x6933 0x8590 -0x6934 0x85C9 -0x6935 0x85BA -0x6936 0x85CF -0x6937 0x85B9 -0x6938 0x85D0 -0x6939 0x85D5 -0x693A 0x85DD -0x693B 0x85E5 -0x693C 0x85DC -0x693D 0x85F9 -0x693E 0x860A -0x693F 0x8613 -0x6940 0x860B -0x6941 0x85FE -0x6942 0x85FA -0x6943 0x8606 -0x6944 0x8622 -0x6945 0x861A -0x6946 0x8630 -0x6947 0x863F -0x6948 0x864D -0x6949 0x4E55 -0x694A 0x8654 -0x694B 0x865F -0x694C 0x8667 -0x694D 0x8671 -0x694E 0x8693 -0x694F 0x86A3 -0x6950 0x6951 0x86A9 -0x6952 0x6953 0x868B -0x6954 0x86B6 -0x6955 0x86AF -0x6956 0x86C4 -0x6957 0x86C6 -0x6958 0x86B0 -0x6959 0x86C9 -0x695A 0x8823 -0x695B 0x86AB -0x695C 0x86D4 -0x695D 0x86DE -0x695E 0x86E9 -0x695F 0x86EC -0x6960 0x86DF -0x6961 0x86DB -0x6962 0x86EF -0x6963 0x8712 -0x6964 0x8706 -0x6965 0x8708 -0x6966 0x8700 -0x6967 0x8703 -0x6968 0x86FB -0x6969 0x8711 -0x696A 0x8709 -0x696B 0x870D -0x696C 0x86F9 -0x696D 0x870A -0x696E 0x8734 -0x696F 0x873F -0x6970 0x8737 -0x6971 0x873B -0x6972 0x8725 -0x6973 0x8729 -0x6974 0x871A -0x6975 0x8760 -0x6976 0x875F -0x6977 0x8778 -0x6978 0x874C -0x6979 0x874E -0x697A 0x8774 -0x697B 0x8757 -0x697C 0x8768 -0x697D 0x876E -0x697E 0x8759 -0x6A21 0x8753 -0x6A22 0x8763 -0x6A23 0x876A -0x6A24 0x8805 -0x6A25 0x87A2 -0x6A26 0x879F -0x6A27 0x8782 -0x6A28 0x87AF -0x6A29 0x87CB -0x6A2A 0x87BD -0x6A2B 0x87C0 -0x6A2C 0x87D0 -0x6A2D 0x96D6 -0x6A2E 0x87AB -0x6A2F 0x87C4 -0x6A30 0x87B3 -0x6A31 0x87C7 -0x6A32 0x87C6 -0x6A33 0x87BB -0x6A34 0x87EF -0x6A35 0x87F2 -0x6A36 0x87E0 -0x6A37 0x880F -0x6A38 0x880D -0x6A39 0x87FE -0x6A3A 0x6A3B 0x87F6 -0x6A3C 0x880E -0x6A3D 0x87D2 -0x6A3E 0x8811 -0x6A3F 0x8816 -0x6A40 0x8815 -0x6A41 0x8822 -0x6A42 0x8821 -0x6A43 0x8831 -0x6A44 0x8836 -0x6A45 0x8839 -0x6A46 0x8827 -0x6A47 0x883B -0x6A48 0x8844 -0x6A49 0x8842 -0x6A4A 0x8852 -0x6A4B 0x8859 -0x6A4C 0x885E -0x6A4D 0x8862 -0x6A4E 0x886B -0x6A4F 0x8881 -0x6A50 0x887E -0x6A51 0x889E -0x6A52 0x8875 -0x6A53 0x887D -0x6A54 0x88B5 -0x6A55 0x8872 -0x6A56 0x8882 -0x6A57 0x8897 -0x6A58 0x8892 -0x6A59 0x88AE -0x6A5A 0x8899 -0x6A5B 0x88A2 -0x6A5C 0x888D -0x6A5D 0x88A4 -0x6A5E 0x88B0 -0x6A5F 0x88BF -0x6A60 0x88B1 -0x6A61 0x6A62 0x88C3 -0x6A63 0x88D4 -0x6A64 0x6A65 0x88D8 -0x6A66 0x88DD -0x6A67 0x88F9 -0x6A68 0x8902 -0x6A69 0x88FC -0x6A6A 0x88F4 -0x6A6B 0x88E8 -0x6A6C 0x88F2 -0x6A6D 0x8904 -0x6A6E 0x890C -0x6A6F 0x890A -0x6A70 0x8913 -0x6A71 0x8943 -0x6A72 0x891E -0x6A73 0x8925 -0x6A74 0x6A75 0x892A -0x6A76 0x8941 -0x6A77 0x8944 -0x6A78 0x893B -0x6A79 0x8936 -0x6A7A 0x8938 -0x6A7B 0x894C -0x6A7C 0x891D -0x6A7D 0x8960 -0x6A7E 0x895E -0x6B21 0x8966 -0x6B22 0x8964 -0x6B23 0x896D -0x6B24 0x896A -0x6B25 0x896F -0x6B26 0x8974 -0x6B27 0x8977 -0x6B28 0x897E -0x6B29 0x8983 -0x6B2A 0x8988 -0x6B2B 0x898A -0x6B2C 0x8993 -0x6B2D 0x8998 -0x6B2E 0x89A1 -0x6B2F 0x89A9 -0x6B30 0x89A6 -0x6B31 0x89AC -0x6B32 0x89AF -0x6B33 0x89B2 -0x6B34 0x89BA -0x6B35 0x89BD -0x6B36 0x6B37 0x89BF -0x6B38 0x89DA -0x6B39 0x6B3A 0x89DC -0x6B3B 0x89E7 -0x6B3C 0x89F4 -0x6B3D 0x89F8 -0x6B3E 0x8A03 -0x6B3F 0x8A16 -0x6B40 0x8A10 -0x6B41 0x8A0C -0x6B42 0x8A1B -0x6B43 0x8A1D -0x6B44 0x8A25 -0x6B45 0x8A36 -0x6B46 0x8A41 -0x6B47 0x8A5B -0x6B48 0x8A52 -0x6B49 0x8A46 -0x6B4A 0x8A48 -0x6B4B 0x8A7C -0x6B4C 0x8A6D -0x6B4D 0x8A6C -0x6B4E 0x8A62 -0x6B4F 0x8A85 -0x6B50 0x8A82 -0x6B51 0x8A84 -0x6B52 0x8AA8 -0x6B53 0x8AA1 -0x6B54 0x8A91 -0x6B55 0x6B56 0x8AA5 -0x6B57 0x8A9A -0x6B58 0x8AA3 -0x6B59 0x8AC4 -0x6B5A 0x8ACD -0x6B5B 0x8AC2 -0x6B5C 0x8ADA -0x6B5D 0x8AEB -0x6B5E 0x8AF3 -0x6B5F 0x8AE7 -0x6B60 0x8AE4 -0x6B61 0x8AF1 -0x6B62 0x8B14 -0x6B63 0x8AE0 -0x6B64 0x8AE2 -0x6B65 0x8AF7 -0x6B66 0x8ADE -0x6B67 0x8ADB -0x6B68 0x8B0C -0x6B69 0x8B07 -0x6B6A 0x8B1A -0x6B6B 0x8AE1 -0x6B6C 0x8B16 -0x6B6D 0x8B10 -0x6B6E 0x8B17 -0x6B6F 0x8B20 -0x6B70 0x8B33 -0x6B71 0x97AB -0x6B72 0x8B26 -0x6B73 0x8B2B -0x6B74 0x8B3E -0x6B75 0x8B28 -0x6B76 0x8B41 -0x6B77 0x8B4C -0x6B78 0x8B4F -0x6B79 0x8B4E -0x6B7A 0x8B49 -0x6B7B 0x8B56 -0x6B7C 0x8B5B -0x6B7D 0x8B5A -0x6B7E 0x8B6B -0x6C21 0x8B5F -0x6C22 0x8B6C -0x6C23 0x8B6F -0x6C24 0x8B74 -0x6C25 0x8B7D -0x6C26 0x8B80 -0x6C27 0x8B8C -0x6C28 0x8B8E -0x6C29 0x6C2A 0x8B92 -0x6C2B 0x8B96 -0x6C2C 0x6C2D 0x8B99 -0x6C2E 0x8C3A -0x6C2F 0x8C41 -0x6C30 0x8C3F -0x6C31 0x8C48 -0x6C32 0x8C4C -0x6C33 0x8C4E -0x6C34 0x8C50 -0x6C35 0x8C55 -0x6C36 0x8C62 -0x6C37 0x8C6C -0x6C38 0x8C78 -0x6C39 0x8C7A -0x6C3A 0x8C82 -0x6C3B 0x8C89 -0x6C3C 0x8C85 -0x6C3D 0x8C8A -0x6C3E 0x6C3F 0x8C8D -0x6C40 0x8C94 -0x6C41 0x8C7C -0x6C42 0x8C98 -0x6C43 0x621D -0x6C44 0x8CAD -0x6C45 0x8CAA -0x6C46 0x8CBD -0x6C47 0x6C48 0x8CB2 -0x6C49 0x8CAE -0x6C4A 0x8CB6 -0x6C4B 0x8CC8 -0x6C4C 0x8CC1 -0x6C4D 0x8CE4 -0x6C4E 0x8CE3 -0x6C4F 0x8CDA -0x6C50 0x8CFD -0x6C51 0x6C52 0x8CFA -0x6C53 0x6C54 0x8D04 -0x6C55 0x8D0A -0x6C56 0x8D07 -0x6C57 0x8D0F -0x6C58 0x8D0D -0x6C59 0x8D10 -0x6C5A 0x9F4E -0x6C5B 0x8D13 -0x6C5C 0x8CCD -0x6C5D 0x8D14 -0x6C5E 0x8D16 -0x6C5F 0x8D67 -0x6C60 0x8D6D -0x6C61 0x8D71 -0x6C62 0x8D73 -0x6C63 0x8D81 -0x6C64 0x8D99 -0x6C65 0x8DC2 -0x6C66 0x8DBE -0x6C67 0x8DBA -0x6C68 0x8DCF -0x6C69 0x8DDA -0x6C6A 0x8DD6 -0x6C6B 0x8DCC -0x6C6C 0x8DDB -0x6C6D 0x8DCB -0x6C6E 0x6C6F 0x8DEA -0x6C70 0x8DDF -0x6C71 0x8DE3 -0x6C72 0x8DFC -0x6C73 0x6C74 0x8E08 -0x6C75 0x8DFF -0x6C76 0x6C77 0x8E1D -0x6C78 0x8E10 -0x6C79 0x8E1F -0x6C7A 0x8E42 -0x6C7B 0x8E35 -0x6C7C 0x8E30 -0x6C7D 0x8E34 -0x6C7E 0x8E4A -0x6D21 0x8E47 -0x6D22 0x8E49 -0x6D23 0x8E4C -0x6D24 0x8E50 -0x6D25 0x8E48 -0x6D26 0x8E59 -0x6D27 0x8E64 -0x6D28 0x8E60 -0x6D29 0x8E2A -0x6D2A 0x8E63 -0x6D2B 0x8E55 -0x6D2C 0x8E76 -0x6D2D 0x8E72 -0x6D2E 0x8E7C -0x6D2F 0x8E81 -0x6D30 0x8E87 -0x6D31 0x8E85 -0x6D32 0x8E84 -0x6D33 0x8E8B -0x6D34 0x8E8A -0x6D35 0x8E93 -0x6D36 0x8E91 -0x6D37 0x8E94 -0x6D38 0x8E99 -0x6D39 0x8EAA -0x6D3A 0x8EA1 -0x6D3B 0x8EAC -0x6D3C 0x8EB0 -0x6D3D 0x8EC6 -0x6D3E 0x8EB1 -0x6D3F 0x8EBE -0x6D40 0x8EC5 -0x6D41 0x8EC8 -0x6D42 0x8ECB -0x6D43 0x8EDB -0x6D44 0x8EE3 -0x6D45 0x8EFC -0x6D46 0x8EFB -0x6D47 0x8EEB -0x6D48 0x8EFE -0x6D49 0x8F0A -0x6D4A 0x8F05 -0x6D4B 0x8F15 -0x6D4C 0x8F12 -0x6D4D 0x8F19 -0x6D4E 0x8F13 -0x6D4F 0x8F1C -0x6D50 0x8F1F -0x6D51 0x8F1B -0x6D52 0x8F0C -0x6D53 0x8F26 -0x6D54 0x8F33 -0x6D55 0x8F3B -0x6D56 0x8F39 -0x6D57 0x8F45 -0x6D58 0x8F42 -0x6D59 0x8F3E -0x6D5A 0x8F4C -0x6D5B 0x8F49 -0x6D5C 0x8F46 -0x6D5D 0x8F4E -0x6D5E 0x8F57 -0x6D5F 0x8F5C -0x6D60 0x6D62 0x8F62 -0x6D63 0x8F9C -0x6D64 0x8F9F -0x6D65 0x8FA3 -0x6D66 0x8FAD -0x6D67 0x8FAF -0x6D68 0x8FB7 -0x6D69 0x8FDA -0x6D6A 0x8FE5 -0x6D6B 0x8FE2 -0x6D6C 0x8FEA -0x6D6D 0x8FEF -0x6D6E 0x9087 -0x6D6F 0x8FF4 -0x6D70 0x9005 -0x6D71 0x6D72 0x8FF9 -0x6D73 0x9011 -0x6D74 0x9015 -0x6D75 0x9021 -0x6D76 0x900D -0x6D77 0x901E -0x6D78 0x9016 -0x6D79 0x900B -0x6D7A 0x9027 -0x6D7B 0x9036 -0x6D7C 0x9035 -0x6D7D 0x9039 -0x6D7E 0x8FF8 -0x6E21 0x6E24 0x904F -0x6E25 0x900E -0x6E26 0x9049 -0x6E27 0x903E -0x6E28 0x9056 -0x6E29 0x9058 -0x6E2A 0x905E -0x6E2B 0x9068 -0x6E2C 0x906F -0x6E2D 0x9076 -0x6E2E 0x96A8 -0x6E2F 0x9072 -0x6E30 0x9082 -0x6E31 0x907D -0x6E32 0x9081 -0x6E33 0x9080 -0x6E34 0x908A -0x6E35 0x9089 -0x6E36 0x908F -0x6E37 0x90A8 -0x6E38 0x90AF -0x6E39 0x90B1 -0x6E3A 0x90B5 -0x6E3B 0x90E2 -0x6E3C 0x90E4 -0x6E3D 0x6248 -0x6E3E 0x90DB -0x6E3F 0x9102 -0x6E40 0x9112 -0x6E41 0x9119 -0x6E42 0x9132 -0x6E43 0x9130 -0x6E44 0x914A -0x6E45 0x9156 -0x6E46 0x9158 -0x6E47 0x9163 -0x6E48 0x9165 -0x6E49 0x9169 -0x6E4A 0x9173 -0x6E4B 0x9172 -0x6E4C 0x918B -0x6E4D 0x9189 -0x6E4E 0x9182 -0x6E4F 0x91A2 -0x6E50 0x91AB -0x6E51 0x91AF -0x6E52 0x91AA -0x6E53 0x91B5 -0x6E54 0x91B4 -0x6E55 0x91BA -0x6E56 0x6E57 0x91C0 -0x6E58 0x91C9 -0x6E59 0x91CB -0x6E5A 0x91D0 -0x6E5B 0x91D6 -0x6E5C 0x91DF -0x6E5D 0x91E1 -0x6E5E 0x91DB -0x6E5F 0x91FC -0x6E60 0x6E61 0x91F5 -0x6E62 0x921E -0x6E63 0x91FF -0x6E64 0x9214 -0x6E65 0x922C -0x6E66 0x9215 -0x6E67 0x9211 -0x6E68 0x925E -0x6E69 0x9257 -0x6E6A 0x9245 -0x6E6B 0x9249 -0x6E6C 0x9264 -0x6E6D 0x9248 -0x6E6E 0x9295 -0x6E6F 0x923F -0x6E70 0x924B -0x6E71 0x9250 -0x6E72 0x929C -0x6E73 0x9296 -0x6E74 0x9293 -0x6E75 0x929B -0x6E76 0x925A -0x6E77 0x92CF -0x6E78 0x92B9 -0x6E79 0x92B7 -0x6E7A 0x92E9 -0x6E7B 0x930F -0x6E7C 0x92FA -0x6E7D 0x9344 -0x6E7E 0x932E -0x6F21 0x9319 -0x6F22 0x9322 -0x6F23 0x931A -0x6F24 0x9323 -0x6F25 0x933A -0x6F26 0x9335 -0x6F27 0x933B -0x6F28 0x935C -0x6F29 0x9360 -0x6F2A 0x937C -0x6F2B 0x936E -0x6F2C 0x9356 -0x6F2D 0x93B0 -0x6F2E 0x6F2F 0x93AC -0x6F30 0x9394 -0x6F31 0x93B9 -0x6F32 0x6F33 0x93D6 -0x6F34 0x93E8 -0x6F35 0x93E5 -0x6F36 0x93D8 -0x6F37 0x93C3 -0x6F38 0x93DD -0x6F39 0x93D0 -0x6F3A 0x93C8 -0x6F3B 0x93E4 -0x6F3C 0x941A -0x6F3D 0x9414 -0x6F3E 0x9413 -0x6F3F 0x9403 -0x6F40 0x9407 -0x6F41 0x9410 -0x6F42 0x9436 -0x6F43 0x942B -0x6F44 0x9435 -0x6F45 0x9421 -0x6F46 0x943A -0x6F47 0x9441 -0x6F48 0x9452 -0x6F49 0x9444 -0x6F4A 0x945B -0x6F4B 0x9460 -0x6F4C 0x9462 -0x6F4D 0x945E -0x6F4E 0x946A -0x6F4F 0x9229 -0x6F50 0x9470 -0x6F51 0x9475 -0x6F52 0x9477 -0x6F53 0x947D -0x6F54 0x945A -0x6F55 0x947C -0x6F56 0x947E -0x6F57 0x9481 -0x6F58 0x947F -0x6F59 0x9582 -0x6F5A 0x9587 -0x6F5B 0x958A -0x6F5C 0x9594 -0x6F5D 0x9596 -0x6F5E 0x6F5F 0x9598 -0x6F60 0x95A0 -0x6F61 0x95A8 -0x6F62 0x95A7 -0x6F63 0x95AD -0x6F64 0x95BC -0x6F65 0x95BB -0x6F66 0x95B9 -0x6F67 0x95BE -0x6F68 0x95CA -0x6F69 0x6FF6 -0x6F6A 0x95C3 -0x6F6B 0x95CD -0x6F6C 0x95CC -0x6F6D 0x95D5 -0x6F6E 0x95D4 -0x6F6F 0x95D6 -0x6F70 0x95DC -0x6F71 0x95E1 -0x6F72 0x95E5 -0x6F73 0x95E2 -0x6F74 0x9621 -0x6F75 0x9628 -0x6F76 0x6F77 0x962E -0x6F78 0x9642 -0x6F79 0x964C -0x6F7A 0x964F -0x6F7B 0x964B -0x6F7C 0x9677 -0x6F7D 0x965C -0x6F7E 0x965E -0x7021 0x965D -0x7022 0x965F -0x7023 0x9666 -0x7024 0x9672 -0x7025 0x966C -0x7026 0x968D -0x7027 0x9698 -0x7028 0x9695 -0x7029 0x9697 -0x702A 0x96AA -0x702B 0x96A7 -0x702C 0x702D 0x96B1 -0x702E 0x96B0 -0x702F 0x96B4 -0x7030 0x96B6 -0x7031 0x7032 0x96B8 -0x7033 0x96CE -0x7034 0x96CB -0x7035 0x96C9 -0x7036 0x96CD -0x7037 0x894D -0x7038 0x96DC -0x7039 0x970D -0x703A 0x96D5 -0x703B 0x96F9 -0x703C 0x9704 -0x703D 0x9706 -0x703E 0x9708 -0x703F 0x9713 -0x7040 0x970E -0x7041 0x9711 -0x7042 0x970F -0x7043 0x9716 -0x7044 0x9719 -0x7045 0x9724 -0x7046 0x972A -0x7047 0x9730 -0x7048 0x9739 -0x7049 0x704A 0x973D -0x704B 0x9744 -0x704C 0x9746 -0x704D 0x9748 -0x704E 0x9742 -0x704F 0x9749 -0x7050 0x975C -0x7051 0x9760 -0x7052 0x9764 -0x7053 0x9766 -0x7054 0x9768 -0x7055 0x52D2 -0x7056 0x976B -0x7057 0x9771 -0x7058 0x9779 -0x7059 0x9785 -0x705A 0x977C -0x705B 0x9781 -0x705C 0x977A -0x705D 0x9786 -0x705E 0x978B -0x705F 0x7060 0x978F -0x7061 0x979C -0x7062 0x97A8 -0x7063 0x97A6 -0x7064 0x97A3 -0x7065 0x7066 0x97B3 -0x7067 0x97C3 -0x7068 0x97C6 -0x7069 0x97C8 -0x706A 0x97CB -0x706B 0x97DC -0x706C 0x97ED -0x706D 0x9F4F -0x706E 0x97F2 -0x706F 0x7ADF -0x7070 0x97F6 -0x7071 0x97F5 -0x7072 0x980F -0x7073 0x980C -0x7074 0x9838 -0x7075 0x9824 -0x7076 0x9821 -0x7077 0x9837 -0x7078 0x983D -0x7079 0x9846 -0x707A 0x984F -0x707B 0x984B -0x707C 0x986B -0x707D 0x707E 0x986F -0x7121 0x9871 -0x7122 0x9874 -0x7123 0x9873 -0x7124 0x98AA -0x7125 0x98AF -0x7126 0x98B1 -0x7127 0x98B6 -0x7128 0x98C4 -0x7129 0x98C3 -0x712A 0x98C6 -0x712B 0x98E9 -0x712C 0x98EB -0x712D 0x9903 -0x712E 0x9909 -0x712F 0x9912 -0x7130 0x9914 -0x7131 0x9918 -0x7132 0x9921 -0x7133 0x7134 0x991D -0x7135 0x9924 -0x7136 0x9920 -0x7137 0x992C -0x7138 0x992E -0x7139 0x713A 0x993D -0x713B 0x9942 -0x713C 0x9949 -0x713D 0x9945 -0x713E 0x9950 -0x713F 0x994B -0x7140 0x7141 0x9951 -0x7142 0x994C -0x7143 0x9955 -0x7144 0x7145 0x9997 -0x7146 0x99A5 -0x7147 0x7148 0x99AD -0x7149 0x99BC -0x714A 0x99DF -0x714B 0x99DB -0x714C 0x99DD -0x714D 0x99D8 -0x714E 0x99D1 -0x714F 0x7150 0x99ED -0x7151 0x7152 0x99F1 -0x7153 0x99FB -0x7154 0x99F8 -0x7155 0x9A01 -0x7156 0x9A0F -0x7157 0x9A05 -0x7158 0x99E2 -0x7159 0x9A19 -0x715A 0x9A2B -0x715B 0x9A37 -0x715C 0x9A45 -0x715D 0x9A42 -0x715E 0x9A40 -0x715F 0x9A43 -0x7160 0x9A3E -0x7161 0x9A55 -0x7162 0x9A4D -0x7163 0x9A5B -0x7164 0x9A57 -0x7165 0x9A5F -0x7166 0x9A62 -0x7167 0x9A65 -0x7168 0x9A64 -0x7169 0x9A69 -0x716A 0x9A6B -0x716B 0x9A6A -0x716C 0x9AAD -0x716D 0x9AB0 -0x716E 0x9ABC -0x716F 0x9AC0 -0x7170 0x9ACF -0x7171 0x9AD1 -0x7172 0x7173 0x9AD3 -0x7174 0x7175 0x9ADE -0x7176 0x7177 0x9AE2 -0x7178 0x9AE6 -0x7179 0x9AEF -0x717A 0x9AEB -0x717B 0x9AEE -0x717C 0x9AF4 -0x717D 0x9AF1 -0x717E 0x9AF7 -0x7221 0x9AFB -0x7222 0x9B06 -0x7223 0x9B18 -0x7224 0x9B1A -0x7225 0x9B1F -0x7226 0x7227 0x9B22 -0x7228 0x9B25 -0x7229 0x722C 0x9B27 -0x722D 0x722E 0x9B2E -0x722F 0x9B32 -0x7230 0x9B44 -0x7231 0x9B43 -0x7232 0x9B4F -0x7233 0x7234 0x9B4D -0x7235 0x9B51 -0x7236 0x9B58 -0x7237 0x9B74 -0x7238 0x9B93 -0x7239 0x9B83 -0x723A 0x9B91 -0x723B 0x723C 0x9B96 -0x723D 0x723E 0x9B9F -0x723F 0x9BA8 -0x7240 0x9BB4 -0x7241 0x9BC0 -0x7242 0x9BCA -0x7243 0x9BB9 -0x7244 0x9BC6 -0x7245 0x9BCF -0x7246 0x7247 0x9BD1 -0x7248 0x9BE3 -0x7249 0x9BE2 -0x724A 0x9BE4 -0x724B 0x9BD4 -0x724C 0x9BE1 -0x724D 0x9C3A -0x724E 0x9BF2 -0x724F 0x9BF1 -0x7250 0x9BF0 -0x7251 0x9C15 -0x7252 0x9C14 -0x7253 0x9C09 -0x7254 0x9C13 -0x7255 0x9C0C -0x7256 0x9C06 -0x7257 0x9C08 -0x7258 0x9C12 -0x7259 0x9C0A -0x725A 0x9C04 -0x725B 0x9C2E -0x725C 0x9C1B -0x725D 0x9C25 -0x725E 0x9C24 -0x725F 0x9C21 -0x7260 0x9C30 -0x7261 0x9C47 -0x7262 0x9C32 -0x7263 0x9C46 -0x7264 0x9C3E -0x7265 0x9C5A -0x7266 0x9C60 -0x7267 0x9C67 -0x7268 0x9C76 -0x7269 0x9C78 -0x726A 0x9CE7 -0x726B 0x9CEC -0x726C 0x9CF0 -0x726D 0x9D09 -0x726E 0x9D08 -0x726F 0x9CEB -0x7270 0x9D03 -0x7271 0x9D06 -0x7272 0x9D2A -0x7273 0x9D26 -0x7274 0x9DAF -0x7275 0x9D23 -0x7276 0x9D1F -0x7277 0x9D44 -0x7278 0x9D15 -0x7279 0x9D12 -0x727A 0x9D41 -0x727B 0x9D3F -0x727C 0x9D3E -0x727D 0x9D46 -0x727E 0x9D48 -0x7321 0x7322 0x9D5D -0x7323 0x9D64 -0x7324 0x9D51 -0x7325 0x9D50 -0x7326 0x9D59 -0x7327 0x9D72 -0x7328 0x9D89 -0x7329 0x9D87 -0x732A 0x9DAB -0x732B 0x9D6F -0x732C 0x9D7A -0x732D 0x9D9A -0x732E 0x9DA4 -0x732F 0x9DA9 -0x7330 0x9DB2 -0x7331 0x9DC4 -0x7332 0x9DC1 -0x7333 0x9DBB -0x7334 0x9DB8 -0x7335 0x9DBA -0x7336 0x9DC6 -0x7337 0x9DCF -0x7338 0x9DC2 -0x7339 0x9DD9 -0x733A 0x9DD3 -0x733B 0x9DF8 -0x733C 0x9DE6 -0x733D 0x9DED -0x733E 0x9DEF -0x733F 0x9DFD -0x7340 0x7341 0x9E1A -0x7342 0x9E1E -0x7343 0x9E75 -0x7344 0x9E79 -0x7345 0x9E7D -0x7346 0x9E81 -0x7347 0x9E88 -0x7348 0x7349 0x9E8B -0x734A 0x9E92 -0x734B 0x9E95 -0x734C 0x9E91 -0x734D 0x9E9D -0x734E 0x9EA5 -0x734F 0x9EA9 -0x7350 0x9EB8 -0x7351 0x9EAA -0x7352 0x9EAD -0x7353 0x9761 -0x7354 0x9ECC -0x7355 0x7357 0x9ECE -0x7358 0x9ED4 -0x7359 0x9EDC -0x735A 0x9EDE -0x735B 0x9EDD -0x735C 0x9EE0 -0x735D 0x9EE5 -0x735E 0x9EE8 -0x735F 0x9EEF -0x7360 0x9EF4 -0x7361 0x7362 0x9EF6 -0x7363 0x9EF9 -0x7364 0x7366 0x9EFB -0x7367 0x7368 0x9F07 -0x7369 0x76B7 -0x736A 0x9F15 -0x736B 0x9F21 -0x736C 0x9F2C -0x736D 0x9F3E -0x736E 0x9F4A -0x736F 0x9F52 -0x7370 0x9F54 -0x7371 0x9F63 -0x7372 0x7374 0x9F5F -0x7375 0x7376 0x9F66 -0x7377 0x9F6C -0x7378 0x9F6A -0x7379 0x9F77 -0x737A 0x9F72 -0x737B 0x9F76 -0x737C 0x9F95 -0x737D 0x9F9C -0x737E 0x9FA0 -0x7421 0x582F -0x7422 0x69C7 -0x7423 0x9059 -0x7424 0x7464 -ENDMAPPING -STARTMAPPING cmap 1 1 -UNDEFINE 0x0000 0x747F -0x2121 0x215F 0x8140 -0x2160 0x217E 0x8180 -0x2221 0x222E 0x819F -0x223A 0x2241 0x81B8 -0x224A 0x2250 0x81C8 -0x225C 0x226A 0x81DA -0x2272 0x2279 0x81F0 -0x227E 0x227E 0x81FC -0x2330 0x2339 0x824F -0x2341 0x235A 0x8260 -0x2361 0x237A 0x8281 -0x2421 0x2473 0x829F -0x2521 0x255F 0x8340 -0x2560 0x2576 0x8380 -0x2621 0x2638 0x839F -0x2641 0x2658 0x83BF -0x2721 0x2741 0x8440 -0x2751 0x275F 0x8470 -0x2760 0x2771 0x8480 -0x2821 0x2840 0x849F -0x3021 0x307E 0x889F -0x3121 0x315F 0x8940 -0x3160 0x317E 0x8980 -0x3221 0x327E 0x899F -0x3321 0x335F 0x8A40 -0x3360 0x337E 0x8A80 -0x3421 0x347E 0x8A9F -0x3521 0x355F 0x8B40 -0x3560 0x357E 0x8B80 -0x3621 0x367E 0x8B9F -0x3721 0x375F 0x8C40 -0x3760 0x377E 0x8C80 -0x3821 0x387E 0x8C9F -0x3921 0x395F 0x8D40 -0x3960 0x397E 0x8D80 -0x3A21 0x3A7E 0x8D9F -0x3B21 0x3B5F 0x8E40 -0x3B60 0x3B7E 0x8E80 -0x3C21 0x3C7E 0x8E9F -0x3D21 0x3D5F 0x8F40 -0x3D60 0x3D7E 0x8F80 -0x3E21 0x3E7E 0x8F9F -0x3F21 0x3F5F 0x9040 -0x3F60 0x3F7E 0x9080 -0x4021 0x407E 0x909F -0x4121 0x415F 0x9140 -0x4160 0x417E 0x9180 -0x4221 0x427E 0x919F -0x4321 0x435F 0x9240 -0x4360 0x437E 0x9280 -0x4421 0x447E 0x929F -0x4521 0x455F 0x9340 -0x4560 0x457E 0x9380 -0x4621 0x467E 0x939F -0x4721 0x475F 0x9440 -0x4760 0x477E 0x9480 -0x4821 0x487E 0x949F -0x4921 0x495F 0x9540 -0x4960 0x497E 0x9580 -0x4A21 0x4A7E 0x959F -0x4B21 0x4B5F 0x9640 -0x4B60 0x4B7E 0x9680 -0x4C21 0x4C7E 0x969F -0x4D21 0x4D5F 0x9740 -0x4D60 0x4D7E 0x9780 -0x4E21 0x4E7E 0x979F -0x4F21 0x4F53 0x9840 -0x5021 0x507E 0x989F -0x5121 0x515F 0x9940 -0x5160 0x517E 0x9980 -0x5221 0x527E 0x999F -0x5321 0x535F 0x9A40 -0x5360 0x537E 0x9A80 -0x5421 0x547E 0x9A9F -0x5521 0x555F 0x9B40 -0x5560 0x557E 0x9B80 -0x5621 0x567E 0x9B9F -0x5721 0x575F 0x9C40 -0x5760 0x577E 0x9C80 -0x5821 0x587E 0x9C9F -0x5921 0x595F 0x9D40 -0x5960 0x597E 0x9D80 -0x5A21 0x5A7E 0x9D9F -0x5B21 0x5B5F 0x9E40 -0x5B60 0x5B7E 0x9E80 -0x5C21 0x5C7E 0x9E9F -0x5D21 0x5D5F 0x9F40 -0x5D60 0x5D7E 0x9F80 -0x5E21 0x5E7E 0x9F9F -0x5F21 0x5F5F 0xE040 -0x5F60 0x5F7E 0xE080 -0x6021 0x607E 0xE09F -0x6121 0x615F 0xE140 -0x6160 0x617E 0xE180 -0x6221 0x627E 0xE19F -0x6321 0x635F 0xE240 -0x6360 0x637E 0xE280 -0x6421 0x647E 0xE29F -0x6521 0x655F 0xE340 -0x6560 0x657E 0xE380 -0x6621 0x667E 0xE39F -0x6721 0x675F 0xE440 -0x6760 0x677E 0xE480 -0x6821 0x687E 0xE49F -0x6921 0x695F 0xE540 -0x6960 0x697E 0xE580 -0x6A21 0x6A7E 0xE59F -0x6B21 0x6B5F 0xE640 -0x6B60 0x6B7E 0xE680 -0x6C21 0x6C7E 0xE69F -0x6D21 0x6D5F 0xE740 -0x6D60 0x6D7E 0xE780 -0x6E21 0x6E7E 0xE79F -0x6F21 0x6F5F 0xE840 -0x6F60 0x6F7E 0xE880 -0x7021 0x707E 0xE89F -0x7121 0x715F 0xE940 -0x7160 0x717E 0xE980 -0x7221 0x727E 0xE99F -0x7321 0x735F 0xEA40 -0x7360 0x737E 0xEA80 -0x7421 0x7424 0xEA9F -ENDMAPPING -STARTMAPPING cmap 3 2 -UNDEFINE 0x0000 0x747F -0x2121 0x215F 0x8140 -0x2160 0x217E 0x8180 -0x2221 0x222E 0x819F -0x223A 0x2241 0x81B8 -0x224A 0x2250 0x81C8 -0x225C 0x226A 0x81DA -0x2272 0x2279 0x81F0 -0x227E 0x227E 0x81FC -0x2330 0x2339 0x824F -0x2341 0x235A 0x8260 -0x2361 0x237A 0x8281 -0x2421 0x2473 0x829F -0x2521 0x255F 0x8340 -0x2560 0x2576 0x8380 -0x2621 0x2638 0x839F -0x2641 0x2658 0x83BF -0x2721 0x2741 0x8440 -0x2751 0x275F 0x8470 -0x2760 0x2771 0x8480 -0x2821 0x2840 0x849F -0x3021 0x307E 0x889F -0x3121 0x315F 0x8940 -0x3160 0x317E 0x8980 -0x3221 0x327E 0x899F -0x3321 0x335F 0x8A40 -0x3360 0x337E 0x8A80 -0x3421 0x347E 0x8A9F -0x3521 0x355F 0x8B40 -0x3560 0x357E 0x8B80 -0x3621 0x367E 0x8B9F -0x3721 0x375F 0x8C40 -0x3760 0x377E 0x8C80 -0x3821 0x387E 0x8C9F -0x3921 0x395F 0x8D40 -0x3960 0x397E 0x8D80 -0x3A21 0x3A7E 0x8D9F -0x3B21 0x3B5F 0x8E40 -0x3B60 0x3B7E 0x8E80 -0x3C21 0x3C7E 0x8E9F -0x3D21 0x3D5F 0x8F40 -0x3D60 0x3D7E 0x8F80 -0x3E21 0x3E7E 0x8F9F -0x3F21 0x3F5F 0x9040 -0x3F60 0x3F7E 0x9080 -0x4021 0x407E 0x909F -0x4121 0x415F 0x9140 -0x4160 0x417E 0x9180 -0x4221 0x427E 0x919F -0x4321 0x435F 0x9240 -0x4360 0x437E 0x9280 -0x4421 0x447E 0x929F -0x4521 0x455F 0x9340 -0x4560 0x457E 0x9380 -0x4621 0x467E 0x939F -0x4721 0x475F 0x9440 -0x4760 0x477E 0x9480 -0x4821 0x487E 0x949F -0x4921 0x495F 0x9540 -0x4960 0x497E 0x9580 -0x4A21 0x4A7E 0x959F -0x4B21 0x4B5F 0x9640 -0x4B60 0x4B7E 0x9680 -0x4C21 0x4C7E 0x969F -0x4D21 0x4D5F 0x9740 -0x4D60 0x4D7E 0x9780 -0x4E21 0x4E7E 0x979F -0x4F21 0x4F53 0x9840 -0x5021 0x507E 0x989F -0x5121 0x515F 0x9940 -0x5160 0x517E 0x9980 -0x5221 0x527E 0x999F -0x5321 0x535F 0x9A40 -0x5360 0x537E 0x9A80 -0x5421 0x547E 0x9A9F -0x5521 0x555F 0x9B40 -0x5560 0x557E 0x9B80 -0x5621 0x567E 0x9B9F -0x5721 0x575F 0x9C40 -0x5760 0x577E 0x9C80 -0x5821 0x587E 0x9C9F -0x5921 0x595F 0x9D40 -0x5960 0x597E 0x9D80 -0x5A21 0x5A7E 0x9D9F -0x5B21 0x5B5F 0x9E40 -0x5B60 0x5B7E 0x9E80 -0x5C21 0x5C7E 0x9E9F -0x5D21 0x5D5F 0x9F40 -0x5D60 0x5D7E 0x9F80 -0x5E21 0x5E7E 0x9F9F -0x5F21 0x5F5F 0xE040 -0x5F60 0x5F7E 0xE080 -0x6021 0x607E 0xE09F -0x6121 0x615F 0xE140 -0x6160 0x617E 0xE180 -0x6221 0x627E 0xE19F -0x6321 0x635F 0xE240 -0x6360 0x637E 0xE280 -0x6421 0x647E 0xE29F -0x6521 0x655F 0xE340 -0x6560 0x657E 0xE380 -0x6621 0x667E 0xE39F -0x6721 0x675F 0xE440 -0x6760 0x677E 0xE480 -0x6821 0x687E 0xE49F -0x6921 0x695F 0xE540 -0x6960 0x697E 0xE580 -0x6A21 0x6A7E 0xE59F -0x6B21 0x6B5F 0xE640 -0x6B60 0x6B7E 0xE680 -0x6C21 0x6C7E 0xE69F -0x6D21 0x6D5F 0xE740 -0x6D60 0x6D7E 0xE780 -0x6E21 0x6E7E 0xE79F -0x6F21 0x6F5F 0xE840 -0x6F60 0x6F7E 0xE880 -0x7021 0x707E 0xE89F -0x7121 0x715F 0xE940 -0x7160 0x717E 0xE980 -0x7221 0x727E 0xE99F -0x7321 0x735F 0xEA40 -0x7360 0x737E 0xEA80 -0x7421 0x7424 0xEA9F -ENDMAPPING -ENDENCODING Index: xc/fonts/encodings/large/jisx0208.1990-0.enc diff -u xc/fonts/encodings/large/jisx0208.1990-0.enc:1.2 xc/fonts/encodings/large/jisx0208.1990-0.enc:1.5 --- xc/fonts/encodings/large/jisx0208.1990-0.enc:1.2 Wed Nov 21 16:20:54 2001 +++ xc/fonts/encodings/large/jisx0208.1990-0.enc Wed Dec 31 00:12:56 2003 @@ -1,8 +1,8077 @@ STARTENCODING jisx0208.1990-0 +ALIAS jisx0208.1983-0 # This file is partly derived from data provided by the Unicode Consortium # Original data Copyright (c) 1991-1994 Unicode, Inc. -SIZE 0x75 0x80 -FIRSTINDEX 0x20 0x20 +# $XFree86: xc/fonts/encodings/large/jisx0208.1990-0.enc,v 1.5 2003/12/31 05:12:56 dawes Exp $ +SIZE 0x75 0x7f +FIRSTINDEX 0x21 0x21 +STARTMAPPING cmap 3 1 +UNDEFINE 0x00 0x747f +0x2120 0x3000 +0x2121 0x3000 +0x2122 0x3001 +0x2123 0x3002 +0x2124 0xff0c +0x2125 0xff0e +0x2126 0x30fb +0x2127 0xff1a +0x2128 0xff1b +0x2129 0xff1f +0x212a 0xff01 +0x212b 0x309b +0x212c 0x309c +0x212d 0x00b4 +0x212e 0xff40 +0x212f 0x00a8 +0x2130 0xff3e +0x2131 0xffe3 +0x2132 0xff3f +0x2133 0x30fd +0x2134 0x30fe +0x2135 0x309d +0x2136 0x309e +0x2137 0x3003 +0x2138 0x4edd +0x2139 0x3005 +0x213a 0x3006 +0x213b 0x3007 +0x213c 0x30fc +0x213d 0x2015 +0x213e 0x2010 +0x213f 0xff0f +0x2140 0xff3c +0x2141 0xff5e +0x2142 0x2225 +0x2143 0xff5c +0x2144 0x2026 +0x2145 0x2025 +0x2146 0x2018 +0x2147 0x2019 +0x2148 0x201c +0x2149 0x201d +0x214a 0xff08 +0x214b 0xff09 +0x214c 0x3014 +0x214d 0x3015 +0x214e 0xff3b +0x214f 0xff3d +0x2150 0xff5b +0x2151 0xff5d +0x2152 0x3008 +0x2153 0x3009 +0x2154 0x300a +0x2155 0x300b +0x2156 0x300c +0x2157 0x300d +0x2158 0x300e +0x2159 0x300f +0x215a 0x3010 +0x215b 0x3011 +0x215c 0xff0b +0x215d 0xff0d +0x215e 0x00b1 +0x215f 0x00d7 +0x2160 0x00f7 +0x2161 0xff1d +0x2162 0x2260 +0x2163 0xff1c +0x2164 0xff1e +0x2165 0x2266 +0x2166 0x2267 +0x2167 0x221e +0x2168 0x2234 +0x2169 0x2642 +0x216a 0x2640 +0x216b 0x00b0 +0x216c 0x2032 +0x216d 0x2033 +0x216e 0x2103 +0x216f 0xffe5 +0x2170 0xff04 +0x2171 0xffe0 +0x2172 0xffe1 +0x2173 0xff05 +0x2174 0xff03 +0x2175 0xff06 +0x2176 0xff0a +0x2177 0xff20 +0x2178 0x00a7 +0x2179 0x2606 +0x217a 0x2605 +0x217b 0x25cb +0x217c 0x25cf +0x217d 0x25ce +0x217e 0x25c7 +0x217f 0x3000 +0x2220 0x3000 +0x2221 0x25c6 +0x2222 0x25a1 +0x2223 0x25a0 +0x2224 0x25b3 +0x2225 0x25b2 +0x2226 0x25bd +0x2227 0x25bc +0x2228 0x203b +0x2229 0x3012 +0x222a 0x2192 +0x222b 0x2190 +0x222c 0x2191 +0x222d 0x2193 +0x222e 0x3013 +0x222f 0x3000 +0x2230 0x3000 +0x2231 0x3000 +0x2232 0x3000 +0x2233 0x3000 +0x2234 0x3000 +0x2235 0x3000 +0x2236 0x3000 +0x2237 0x3000 +0x2238 0x3000 +0x2239 0x3000 +0x223a 0x2208 +0x223b 0x220b +0x223c 0x2286 +0x223d 0x2287 +0x223e 0x2282 +0x223f 0x2283 +0x2240 0x222a +0x2241 0x2229 +0x2242 0x3000 +0x2243 0x3000 +0x2244 0x3000 +0x2245 0x3000 +0x2246 0x3000 +0x2247 0x3000 +0x2248 0x3000 +0x2249 0x3000 +0x224a 0x2227 +0x224b 0x2228 +0x224c 0xffe2 +0x224d 0x21d2 +0x224e 0x21d4 +0x224f 0x2200 +0x2250 0x2203 +0x2251 0x3000 +0x2252 0x3000 +0x2253 0x3000 +0x2254 0x3000 +0x2255 0x3000 +0x2256 0x3000 +0x2257 0x3000 +0x2258 0x3000 +0x2259 0x3000 +0x225a 0x3000 +0x225b 0x3000 +0x225c 0x2220 +0x225d 0x22a5 +0x225e 0x2312 +0x225f 0x2202 +0x2260 0x2207 +0x2261 0x2261 +0x2262 0x2252 +0x2263 0x226a +0x2264 0x226b +0x2265 0x221a +0x2266 0x223d +0x2267 0x221d +0x2268 0x2235 +0x2269 0x222b +0x226a 0x222c +0x226b 0x3000 +0x226c 0x3000 +0x226d 0x3000 +0x226e 0x3000 +0x226f 0x3000 +0x2270 0x3000 +0x2271 0x3000 +0x2272 0x212b +0x2273 0x2030 +0x2274 0x266f +0x2275 0x266d +0x2276 0x266a +0x2277 0x2020 +0x2278 0x2021 +0x2279 0x00b6 +0x227a 0x3000 +0x227b 0x3000 +0x227c 0x3000 +0x227d 0x3000 +0x227e 0x25ef +0x227f 0x3000 +0x2320 0x3000 +0x2321 0x3000 +0x2322 0x3000 +0x2323 0x3000 +0x2324 0x3000 +0x2325 0x3000 +0x2326 0x3000 +0x2327 0x3000 +0x2328 0x3000 +0x2329 0x3000 +0x232a 0x3000 +0x232b 0x3000 +0x232c 0x3000 +0x232d 0x3000 +0x232e 0x3000 +0x232f 0x3000 +0x2330 0xff10 +0x2331 0xff11 +0x2332 0xff12 +0x2333 0xff13 +0x2334 0xff14 +0x2335 0xff15 +0x2336 0xff16 +0x2337 0xff17 +0x2338 0xff18 +0x2339 0xff19 +0x233a 0x3000 +0x233b 0x3000 +0x233c 0x3000 +0x233d 0x3000 +0x233e 0x3000 +0x233f 0x3000 +0x2340 0x3000 +0x2341 0xff21 +0x2342 0xff22 +0x2343 0xff23 +0x2344 0xff24 +0x2345 0xff25 +0x2346 0xff26 +0x2347 0xff27 +0x2348 0xff28 +0x2349 0xff29 +0x234a 0xff2a +0x234b 0xff2b +0x234c 0xff2c +0x234d 0xff2d +0x234e 0xff2e +0x234f 0xff2f +0x2350 0xff30 +0x2351 0xff31 +0x2352 0xff32 +0x2353 0xff33 +0x2354 0xff34 +0x2355 0xff35 +0x2356 0xff36 +0x2357 0xff37 +0x2358 0xff38 +0x2359 0xff39 +0x235a 0xff3a +0x235b 0x3000 +0x235c 0x3000 +0x235d 0x3000 +0x235e 0x3000 +0x235f 0x3000 +0x2360 0x3000 +0x2361 0xff41 +0x2362 0xff42 +0x2363 0xff43 +0x2364 0xff44 +0x2365 0xff45 +0x2366 0xff46 +0x2367 0xff47 +0x2368 0xff48 +0x2369 0xff49 +0x236a 0xff4a +0x236b 0xff4b +0x236c 0xff4c +0x236d 0xff4d +0x236e 0xff4e +0x236f 0xff4f +0x2370 0xff50 +0x2371 0xff51 +0x2372 0xff52 +0x2373 0xff53 +0x2374 0xff54 +0x2375 0xff55 +0x2376 0xff56 +0x2377 0xff57 +0x2378 0xff58 +0x2379 0xff59 +0x237a 0xff5a +0x237b 0x3000 +0x237c 0x3000 +0x237d 0x3000 +0x237e 0x3000 +0x237f 0x3000 +0x2420 0x3000 +0x2421 0x3041 +0x2422 0x3042 +0x2423 0x3043 +0x2424 0x3044 +0x2425 0x3045 +0x2426 0x3046 +0x2427 0x3047 +0x2428 0x3048 +0x2429 0x3049 +0x242a 0x304a +0x242b 0x304b +0x242c 0x304c +0x242d 0x304d +0x242e 0x304e +0x242f 0x304f +0x2430 0x3050 +0x2431 0x3051 +0x2432 0x3052 +0x2433 0x3053 +0x2434 0x3054 +0x2435 0x3055 +0x2436 0x3056 +0x2437 0x3057 +0x2438 0x3058 +0x2439 0x3059 +0x243a 0x305a +0x243b 0x305b +0x243c 0x305c +0x243d 0x305d +0x243e 0x305e +0x243f 0x305f +0x2440 0x3060 +0x2441 0x3061 +0x2442 0x3062 +0x2443 0x3063 +0x2444 0x3064 +0x2445 0x3065 +0x2446 0x3066 +0x2447 0x3067 +0x2448 0x3068 +0x2449 0x3069 +0x244a 0x306a +0x244b 0x306b +0x244c 0x306c +0x244d 0x306d +0x244e 0x306e +0x244f 0x306f +0x2450 0x3070 +0x2451 0x3071 +0x2452 0x3072 +0x2453 0x3073 +0x2454 0x3074 +0x2455 0x3075 +0x2456 0x3076 +0x2457 0x3077 +0x2458 0x3078 +0x2459 0x3079 +0x245a 0x307a +0x245b 0x307b +0x245c 0x307c +0x245d 0x307d +0x245e 0x307e +0x245f 0x307f +0x2460 0x3080 +0x2461 0x3081 +0x2462 0x3082 +0x2463 0x3083 +0x2464 0x3084 +0x2465 0x3085 +0x2466 0x3086 +0x2467 0x3087 +0x2468 0x3088 +0x2469 0x3089 +0x246a 0x308a +0x246b 0x308b +0x246c 0x308c +0x246d 0x308d +0x246e 0x308e +0x246f 0x308f +0x2470 0x3090 +0x2471 0x3091 +0x2472 0x3092 +0x2473 0x3093 +0x2474 0x3094 +0x2475 0x3000 +0x2476 0x3000 +0x2477 0x3000 +0x2478 0x3000 +0x2479 0x3000 +0x247a 0x3000 +0x247b 0x3000 +0x247c 0x3000 +0x247d 0x3000 +0x247e 0x3000 +0x247f 0x3000 +0x2520 0x3000 +0x2521 0x30a1 +0x2522 0x30a2 +0x2523 0x30a3 +0x2524 0x30a4 +0x2525 0x30a5 +0x2526 0x30a6 +0x2527 0x30a7 +0x2528 0x30a8 +0x2529 0x30a9 +0x252a 0x30aa +0x252b 0x30ab +0x252c 0x30ac +0x252d 0x30ad +0x252e 0x30ae +0x252f 0x30af +0x2530 0x30b0 +0x2531 0x30b1 +0x2532 0x30b2 +0x2533 0x30b3 +0x2534 0x30b4 +0x2535 0x30b5 +0x2536 0x30b6 +0x2537 0x30b7 +0x2538 0x30b8 +0x2539 0x30b9 +0x253a 0x30ba +0x253b 0x30bb +0x253c 0x30bc +0x253d 0x30bd +0x253e 0x30be +0x253f 0x30bf +0x2540 0x30c0 +0x2541 0x30c1 +0x2542 0x30c2 +0x2543 0x30c3 +0x2544 0x30c4 +0x2545 0x30c5 +0x2546 0x30c6 +0x2547 0x30c7 +0x2548 0x30c8 +0x2549 0x30c9 +0x254a 0x30ca +0x254b 0x30cb +0x254c 0x30cc +0x254d 0x30cd +0x254e 0x30ce +0x254f 0x30cf +0x2550 0x30d0 +0x2551 0x30d1 +0x2552 0x30d2 +0x2553 0x30d3 +0x2554 0x30d4 +0x2555 0x30d5 +0x2556 0x30d6 +0x2557 0x30d7 +0x2558 0x30d8 +0x2559 0x30d9 +0x255a 0x30da +0x255b 0x30db +0x255c 0x30dc +0x255d 0x30dd +0x255e 0x30de +0x255f 0x30df +0x2560 0x30e0 +0x2561 0x30e1 +0x2562 0x30e2 +0x2563 0x30e3 +0x2564 0x30e4 +0x2565 0x30e5 +0x2566 0x30e6 +0x2567 0x30e7 +0x2568 0x30e8 +0x2569 0x30e9 +0x256a 0x30ea +0x256b 0x30eb +0x256c 0x30ec +0x256d 0x30ed +0x256e 0x30ee +0x256f 0x30ef +0x2570 0x30f0 +0x2571 0x30f1 +0x2572 0x30f2 +0x2573 0x30f3 +0x2574 0x30f4 +0x2575 0x30f5 +0x2576 0x30f6 +0x2577 0x3000 +0x2578 0x3000 +0x2579 0x3000 +0x257a 0x3000 +0x257b 0x3000 +0x257c 0x3000 +0x257d 0x3000 +0x257e 0x3000 +0x257f 0x3000 +0x2620 0x3000 +0x2621 0x0391 +0x2622 0x0392 +0x2623 0x0393 +0x2624 0x0394 +0x2625 0x0395 +0x2626 0x0396 +0x2627 0x0397 +0x2628 0x0398 +0x2629 0x0399 +0x262a 0x039a +0x262b 0x039b +0x262c 0x039c +0x262d 0x039d +0x262e 0x039e +0x262f 0x039f +0x2630 0x03a0 +0x2631 0x03a1 +0x2632 0x03a3 +0x2633 0x03a4 +0x2634 0x03a5 +0x2635 0x03a6 +0x2636 0x03a7 +0x2637 0x03a8 +0x2638 0x03a9 +0x2639 0x3000 +0x263a 0x3000 +0x263b 0x3000 +0x263c 0x3000 +0x263d 0x3000 +0x263e 0x3000 +0x263f 0x3000 +0x2640 0x3000 +0x2641 0x03b1 +0x2642 0x03b2 +0x2643 0x03b3 +0x2644 0x03b4 +0x2645 0x03b5 +0x2646 0x03b6 +0x2647 0x03b7 +0x2648 0x03b8 +0x2649 0x03b9 +0x264a 0x03ba +0x264b 0x03bb +0x264c 0x03bc +0x264d 0x03bd +0x264e 0x03be +0x264f 0x03bf +0x2650 0x03c0 +0x2651 0x03c1 +0x2652 0x03c3 +0x2653 0x03c4 +0x2654 0x03c5 +0x2655 0x03c6 +0x2656 0x03c7 +0x2657 0x03c8 +0x2658 0x03c9 +0x2659 0x3000 +0x265a 0x3000 +0x265b 0x3000 +0x265c 0x3000 +0x265d 0x3000 +0x265e 0x3000 +0x265f 0x3000 +0x2660 0x3000 +0x2661 0x3000 +0x2662 0x3000 +0x2663 0x3000 +0x2664 0x3000 +0x2665 0x3000 +0x2666 0x3000 +0x2667 0x3000 +0x2668 0x3000 +0x2669 0x3000 +0x266a 0x3000 +0x266b 0x3000 +0x266c 0x3000 +0x266d 0x3000 +0x266e 0x3000 +0x266f 0x3000 +0x2670 0x3000 +0x2671 0x3000 +0x2672 0x3000 +0x2673 0x3000 +0x2674 0x3000 +0x2675 0x3000 +0x2676 0x3000 +0x2677 0x3000 +0x2678 0x3000 +0x2679 0x3000 +0x267a 0x3000 +0x267b 0x3000 +0x267c 0x3000 +0x267d 0x3000 +0x267e 0x3000 +0x267f 0x3000 +0x2720 0x3000 +0x2721 0x0410 +0x2722 0x0411 +0x2723 0x0412 +0x2724 0x0413 +0x2725 0x0414 +0x2726 0x0415 +0x2727 0x0401 +0x2728 0x0416 +0x2729 0x0417 +0x272a 0x0418 +0x272b 0x0419 +0x272c 0x041a +0x272d 0x041b +0x272e 0x041c +0x272f 0x041d +0x2730 0x041e +0x2731 0x041f +0x2732 0x0420 +0x2733 0x0421 +0x2734 0x0422 +0x2735 0x0423 +0x2736 0x0424 +0x2737 0x0425 +0x2738 0x0426 +0x2739 0x0427 +0x273a 0x0428 +0x273b 0x0429 +0x273c 0x042a +0x273d 0x042b +0x273e 0x042c +0x273f 0x042d +0x2740 0x042e +0x2741 0x042f +0x2742 0x3000 +0x2743 0x3000 +0x2744 0x3000 +0x2745 0x3000 +0x2746 0x3000 +0x2747 0x3000 +0x2748 0x3000 +0x2749 0x3000 +0x274a 0x3000 +0x274b 0x3000 +0x274c 0x3000 +0x274d 0x3000 +0x274e 0x3000 +0x274f 0x3000 +0x2750 0x3000 +0x2751 0x0430 +0x2752 0x0431 +0x2753 0x0432 +0x2754 0x0433 +0x2755 0x0434 +0x2756 0x0435 +0x2757 0x0451 +0x2758 0x0436 +0x2759 0x0437 +0x275a 0x0438 +0x275b 0x0439 +0x275c 0x043a +0x275d 0x043b +0x275e 0x043c +0x275f 0x043d +0x2760 0x043e +0x2761 0x043f +0x2762 0x0440 +0x2763 0x0441 +0x2764 0x0442 +0x2765 0x0443 +0x2766 0x0444 +0x2767 0x0445 +0x2768 0x0446 +0x2769 0x0447 +0x276a 0x0448 +0x276b 0x0449 +0x276c 0x044a +0x276d 0x044b +0x276e 0x044c +0x276f 0x044d +0x2770 0x044e +0x2771 0x044f +0x2772 0x3000 +0x2773 0x3000 +0x2774 0x3000 +0x2775 0x3000 +0x2776 0x3000 +0x2777 0x3000 +0x2778 0x3000 +0x2779 0x3000 +0x277a 0x3000 +0x277b 0x3000 +0x277c 0x3000 +0x277d 0x3000 +0x277e 0x3000 +0x277f 0x3000 +0x2820 0x3000 +0x2821 0x2500 +0x2822 0x2502 +0x2823 0x250c +0x2824 0x2510 +0x2825 0x2518 +0x2826 0x2514 +0x2827 0x251c +0x2828 0x252c +0x2829 0x2524 +0x282a 0x2534 +0x282b 0x253c +0x282c 0x2501 +0x282d 0x2503 +0x282e 0x250f +0x282f 0x2513 +0x2830 0x251b +0x2831 0x2517 +0x2832 0x2523 +0x2833 0x2533 +0x2834 0x252b +0x2835 0x253b +0x2836 0x254b +0x2837 0x2520 +0x2838 0x252f +0x2839 0x2528 +0x283a 0x2537 +0x283b 0x253f +0x283c 0x251d +0x283d 0x2530 +0x283e 0x2525 +0x283f 0x2538 +0x2840 0x2542 +0x2841 0x3000 +0x2842 0x3000 +0x2843 0x3000 +0x2844 0x3000 +0x2845 0x3000 +0x2846 0x3000 +0x2847 0x3000 +0x2848 0x3000 +0x2849 0x3000 +0x284a 0x3000 +0x284b 0x3000 +0x284c 0x3000 +0x284d 0x3000 +0x284e 0x3000 +0x284f 0x3000 +0x2850 0x3000 +0x2851 0x3000 +0x2852 0x3000 +0x2853 0x3000 +0x2854 0x3000 +0x2855 0x3000 +0x2856 0x3000 +0x2857 0x3000 +0x2858 0x3000 +0x2859 0x3000 +0x285a 0x3000 +0x285b 0x3000 +0x285c 0x3000 +0x285d 0x3000 +0x285e 0x3000 +0x285f 0x3000 +0x2860 0x3000 +0x2861 0x3000 +0x2862 0x3000 +0x2863 0x3000 +0x2864 0x3000 +0x2865 0x3000 +0x2866 0x3000 +0x2867 0x3000 +0x2868 0x3000 +0x2869 0x3000 +0x286a 0x3000 +0x286b 0x3000 +0x286c 0x3000 +0x286d 0x3000 +0x286e 0x3000 +0x286f 0x3000 +0x2870 0x3000 +0x2871 0x3000 +0x2872 0x3000 +0x2873 0x3000 +0x2874 0x3000 +0x2875 0x3000 +0x2876 0x3000 +0x2877 0x3000 +0x2878 0x3000 +0x2879 0x3000 +0x287a 0x3000 +0x287b 0x3000 +0x287c 0x3000 +0x287d 0x3000 +0x287e 0x3000 +0x287f 0x3000 +0x2920 0x3000 +0x2921 0x3000 +0x2922 0x3000 +0x2923 0x3000 +0x2924 0x3000 +0x2925 0x3000 +0x2926 0x3000 +0x2927 0x3000 +0x2928 0x3000 +0x2929 0x3000 +0x292a 0x3000 +0x292b 0x3000 +0x292c 0x3000 +0x292d 0x3000 +0x292e 0x3000 +0x292f 0x3000 +0x2930 0x3000 +0x2931 0x3000 +0x2932 0x3000 +0x2933 0x3000 +0x2934 0x3000 +0x2935 0x3000 +0x2936 0x3000 +0x2937 0x3000 +0x2938 0x3000 +0x2939 0x3000 +0x293a 0x3000 +0x293b 0x3000 +0x293c 0x3000 +0x293d 0x3000 +0x293e 0x3000 +0x293f 0x3000 +0x2940 0x3000 +0x2941 0x3000 +0x2942 0x3000 +0x2943 0x3000 +0x2944 0x3000 +0x2945 0x3000 +0x2946 0x3000 +0x2947 0x3000 +0x2948 0x3000 +0x2949 0x3000 +0x294a 0x3000 +0x294b 0x3000 +0x294c 0x3000 +0x294d 0x3000 +0x294e 0x3000 +0x294f 0x3000 +0x2950 0x3000 +0x2951 0x3000 +0x2952 0x3000 +0x2953 0x3000 +0x2954 0x3000 +0x2955 0x3000 +0x2956 0x3000 +0x2957 0x3000 +0x2958 0x3000 +0x2959 0x3000 +0x295a 0x3000 +0x295b 0x3000 +0x295c 0x3000 +0x295d 0x3000 +0x295e 0x3000 +0x295f 0x3000 +0x2960 0x3000 +0x2961 0x3000 +0x2962 0x3000 +0x2963 0x3000 +0x2964 0x3000 +0x2965 0x3000 +0x2966 0x3000 +0x2967 0x3000 +0x2968 0x3000 +0x2969 0x3000 +0x296a 0x3000 +0x296b 0x3000 +0x296c 0x3000 +0x296d 0x3000 +0x296e 0x3000 +0x296f 0x3000 +0x2970 0x3000 +0x2971 0x3000 +0x2972 0x3000 +0x2973 0x3000 +0x2974 0x3000 +0x2975 0x3000 +0x2976 0x3000 +0x2977 0x3000 +0x2978 0x3000 +0x2979 0x3000 +0x297a 0x3000 +0x297b 0x3000 +0x297c 0x3000 +0x297d 0x3000 +0x297e 0x3000 +0x297f 0x3000 +0x2a20 0x3000 +0x2a21 0x3000 +0x2a22 0x3000 +0x2a23 0x3000 +0x2a24 0x3000 +0x2a25 0x3000 +0x2a26 0x3000 +0x2a27 0x3000 +0x2a28 0x3000 +0x2a29 0x3000 +0x2a2a 0x3000 +0x2a2b 0x3000 +0x2a2c 0x3000 +0x2a2d 0x3000 +0x2a2e 0x3000 +0x2a2f 0x3000 +0x2a30 0x3000 +0x2a31 0x3000 +0x2a32 0x3000 +0x2a33 0x3000 +0x2a34 0x3000 +0x2a35 0x3000 +0x2a36 0x3000 +0x2a37 0x3000 +0x2a38 0x3000 +0x2a39 0x3000 +0x2a3a 0x3000 +0x2a3b 0x3000 +0x2a3c 0x3000 +0x2a3d 0x3000 +0x2a3e 0x3000 +0x2a3f 0x3000 +0x2a40 0x3000 +0x2a41 0x3000 +0x2a42 0x3000 +0x2a43 0x3000 +0x2a44 0x3000 +0x2a45 0x3000 +0x2a46 0x3000 +0x2a47 0x3000 +0x2a48 0x3000 +0x2a49 0x3000 +0x2a4a 0x3000 +0x2a4b 0x3000 +0x2a4c 0x3000 +0x2a4d 0x3000 +0x2a4e 0x3000 +0x2a4f 0x3000 +0x2a50 0x3000 +0x2a51 0x3000 +0x2a52 0x3000 +0x2a53 0x3000 +0x2a54 0x3000 +0x2a55 0x3000 +0x2a56 0x3000 +0x2a57 0x3000 +0x2a58 0x3000 +0x2a59 0x3000 +0x2a5a 0x3000 +0x2a5b 0x3000 +0x2a5c 0x3000 +0x2a5d 0x3000 +0x2a5e 0x3000 +0x2a5f 0x3000 +0x2a60 0x3000 +0x2a61 0x3000 +0x2a62 0x3000 +0x2a63 0x3000 +0x2a64 0x3000 +0x2a65 0x3000 +0x2a66 0x3000 +0x2a67 0x3000 +0x2a68 0x3000 +0x2a69 0x3000 +0x2a6a 0x3000 +0x2a6b 0x3000 +0x2a6c 0x3000 +0x2a6d 0x3000 +0x2a6e 0x3000 +0x2a6f 0x3000 +0x2a70 0x3000 +0x2a71 0x3000 +0x2a72 0x3000 +0x2a73 0x3000 +0x2a74 0x3000 +0x2a75 0x3000 +0x2a76 0x3000 +0x2a77 0x3000 +0x2a78 0x3000 +0x2a79 0x3000 +0x2a7a 0x3000 +0x2a7b 0x3000 +0x2a7c 0x3000 +0x2a7d 0x3000 +0x2a7e 0x3000 +0x2a7f 0x3000 +0x2b20 0x3000 +0x2b21 0x3000 +0x2b22 0x3000 +0x2b23 0x3000 +0x2b24 0x3000 +0x2b25 0x3000 +0x2b26 0x3000 +0x2b27 0x3000 +0x2b28 0x3000 +0x2b29 0x3000 +0x2b2a 0x3000 +0x2b2b 0x3000 +0x2b2c 0x3000 +0x2b2d 0x3000 +0x2b2e 0x3000 +0x2b2f 0x3000 +0x2b30 0x3000 +0x2b31 0x3000 +0x2b32 0x3000 +0x2b33 0x3000 +0x2b34 0x3000 +0x2b35 0x3000 +0x2b36 0x3000 +0x2b37 0x3000 +0x2b38 0x3000 +0x2b39 0x3000 +0x2b3a 0x3000 +0x2b3b 0x3000 +0x2b3c 0x3000 +0x2b3d 0x3000 +0x2b3e 0x3000 +0x2b3f 0x3000 +0x2b40 0x3000 +0x2b41 0x3000 +0x2b42 0x3000 +0x2b43 0x3000 +0x2b44 0x3000 +0x2b45 0x3000 +0x2b46 0x3000 +0x2b47 0x3000 +0x2b48 0x3000 +0x2b49 0x3000 +0x2b4a 0x3000 +0x2b4b 0x3000 +0x2b4c 0x3000 +0x2b4d 0x3000 +0x2b4e 0x3000 +0x2b4f 0x3000 +0x2b50 0x3000 +0x2b51 0x3000 +0x2b52 0x3000 +0x2b53 0x3000 +0x2b54 0x3000 +0x2b55 0x3000 +0x2b56 0x3000 +0x2b57 0x3000 +0x2b58 0x3000 +0x2b59 0x3000 +0x2b5a 0x3000 +0x2b5b 0x3000 +0x2b5c 0x3000 +0x2b5d 0x3000 +0x2b5e 0x3000 +0x2b5f 0x3000 +0x2b60 0x3000 +0x2b61 0x3000 +0x2b62 0x3000 +0x2b63 0x3000 +0x2b64 0x3000 +0x2b65 0x3000 +0x2b66 0x3000 +0x2b67 0x3000 +0x2b68 0x3000 +0x2b69 0x3000 +0x2b6a 0x3000 +0x2b6b 0x3000 +0x2b6c 0x3000 +0x2b6d 0x3000 +0x2b6e 0x3000 +0x2b6f 0x3000 +0x2b70 0x3000 +0x2b71 0x3000 +0x2b72 0x3000 +0x2b73 0x3000 +0x2b74 0x3000 +0x2b75 0x3000 +0x2b76 0x3000 +0x2b77 0x3000 +0x2b78 0x3000 +0x2b79 0x3000 +0x2b7a 0x3000 +0x2b7b 0x3000 +0x2b7c 0x3000 +0x2b7d 0x3000 +0x2b7e 0x3000 +0x2b7f 0x3000 +0x2c20 0x3000 +0x2c21 0x3000 +0x2c22 0x3000 +0x2c23 0x3000 +0x2c24 0x3000 +0x2c25 0x3000 +0x2c26 0x3000 +0x2c27 0x3000 +0x2c28 0x3000 +0x2c29 0x3000 +0x2c2a 0x3000 +0x2c2b 0x3000 +0x2c2c 0x3000 +0x2c2d 0x3000 +0x2c2e 0x3000 +0x2c2f 0x3000 +0x2c30 0x3000 +0x2c31 0x3000 +0x2c32 0x3000 +0x2c33 0x3000 +0x2c34 0x3000 +0x2c35 0x3000 +0x2c36 0x3000 +0x2c37 0x3000 +0x2c38 0x3000 +0x2c39 0x3000 +0x2c3a 0x3000 +0x2c3b 0x3000 +0x2c3c 0x3000 +0x2c3d 0x3000 +0x2c3e 0x3000 +0x2c3f 0x3000 +0x2c40 0x3000 +0x2c41 0x3000 +0x2c42 0x3000 +0x2c43 0x3000 +0x2c44 0x3000 +0x2c45 0x3000 +0x2c46 0x3000 +0x2c47 0x3000 +0x2c48 0x3000 +0x2c49 0x3000 +0x2c4a 0x3000 +0x2c4b 0x3000 +0x2c4c 0x3000 +0x2c4d 0x3000 +0x2c4e 0x3000 +0x2c4f 0x3000 +0x2c50 0x3000 +0x2c51 0x3000 +0x2c52 0x3000 +0x2c53 0x3000 +0x2c54 0x3000 +0x2c55 0x3000 +0x2c56 0x3000 +0x2c57 0x3000 +0x2c58 0x3000 +0x2c59 0x3000 +0x2c5a 0x3000 +0x2c5b 0x3000 +0x2c5c 0x3000 +0x2c5d 0x3000 +0x2c5e 0x3000 +0x2c5f 0x3000 +0x2c60 0x3000 +0x2c61 0x3000 +0x2c62 0x3000 +0x2c63 0x3000 +0x2c64 0x3000 +0x2c65 0x3000 +0x2c66 0x3000 +0x2c67 0x3000 +0x2c68 0x3000 +0x2c69 0x3000 +0x2c6a 0x3000 +0x2c6b 0x3000 +0x2c6c 0x3000 +0x2c6d 0x3000 +0x2c6e 0x3000 +0x2c6f 0x3000 +0x2c70 0x3000 +0x2c71 0x3000 +0x2c72 0x3000 +0x2c73 0x3000 +0x2c74 0x3000 +0x2c75 0x3000 +0x2c76 0x3000 +0x2c77 0x3000 +0x2c78 0x3000 +0x2c79 0x3000 +0x2c7a 0x3000 +0x2c7b 0x3000 +0x2c7c 0x3000 +0x2c7d 0x3000 +0x2c7e 0x3000 +0x2c7f 0x3000 +0x2d20 0x3000 +0x2d21 0x2460 +0x2d22 0x2461 +0x2d23 0x2462 +0x2d24 0x2463 +0x2d25 0x2464 +0x2d26 0x2465 +0x2d27 0x2466 +0x2d28 0x2467 +0x2d29 0x2468 +0x2d2a 0x2469 +0x2d2b 0x246a +0x2d2c 0x246b +0x2d2d 0x246c +0x2d2e 0x246d +0x2d2f 0x246e +0x2d30 0x246f +0x2d31 0x2470 +0x2d32 0x2471 +0x2d33 0x2472 +0x2d34 0x2473 +0x2d35 0x2160 +0x2d36 0x2161 +0x2d37 0x2162 +0x2d38 0x2163 +0x2d39 0x2164 +0x2d3a 0x2165 +0x2d3b 0x2166 +0x2d3c 0x2167 +0x2d3d 0x2168 +0x2d3e 0x2169 +0x2d3f 0x3000 +0x2d40 0x3349 +0x2d41 0x3314 +0x2d42 0x3322 +0x2d43 0x334d +0x2d44 0x3318 +0x2d45 0x3327 +0x2d46 0x3303 +0x2d47 0x3336 +0x2d48 0x3351 +0x2d49 0x3357 +0x2d4a 0x330d +0x2d4b 0x3326 +0x2d4c 0x3323 +0x2d4d 0x332b +0x2d4e 0x334a +0x2d4f 0x333b +0x2d50 0x339c +0x2d51 0x339d +0x2d52 0x339e +0x2d53 0x338e +0x2d54 0x338f +0x2d55 0x33c4 +0x2d56 0x33a1 +0x2d57 0x3000 +0x2d58 0x3000 +0x2d59 0x3000 +0x2d5a 0x3000 +0x2d5b 0x3000 +0x2d5c 0x3000 +0x2d5d 0x3000 +0x2d5e 0x3000 +0x2d5f 0x337b +0x2d60 0x301d +0x2d61 0x301f +0x2d62 0x2116 +0x2d63 0x33cd +0x2d64 0x2121 +0x2d65 0x32a4 +0x2d66 0x32a5 +0x2d67 0x32a6 +0x2d68 0x32a7 +0x2d69 0x32a8 +0x2d6a 0x3231 +0x2d6b 0x3232 +0x2d6c 0x3239 +0x2d6d 0x337e +0x2d6e 0x337d +0x2d6f 0x337c +0x2d70 0x2252 +0x2d71 0x2261 +0x2d72 0x222b +0x2d73 0x222e +0x2d74 0x2211 +0x2d75 0x221a +0x2d76 0x22a5 +0x2d77 0x2220 +0x2d78 0x221f +0x2d79 0x22bf +0x2d7a 0x2235 +0x2d7b 0x2229 +0x2d7c 0x222a +0x2d7d 0x3000 +0x2d7e 0x3000 +0x2d7f 0x3000 +0x2e20 0x3000 +0x2e21 0x3000 +0x2e22 0x3000 +0x2e23 0x3000 +0x2e24 0x3000 +0x2e25 0x3000 +0x2e26 0x3000 +0x2e27 0x3000 +0x2e28 0x3000 +0x2e29 0x3000 +0x2e2a 0x3000 +0x2e2b 0x3000 +0x2e2c 0x3000 +0x2e2d 0x3000 +0x2e2e 0x3000 +0x2e2f 0x3000 +0x2e30 0x3000 +0x2e31 0x3000 +0x2e32 0x3000 +0x2e33 0x3000 +0x2e34 0x3000 +0x2e35 0x3000 +0x2e36 0x3000 +0x2e37 0x3000 +0x2e38 0x3000 +0x2e39 0x3000 +0x2e3a 0x3000 +0x2e3b 0x3000 +0x2e3c 0x3000 +0x2e3d 0x3000 +0x2e3e 0x3000 +0x2e3f 0x3000 +0x2e40 0x3000 +0x2e41 0x3000 +0x2e42 0x3000 +0x2e43 0x3000 +0x2e44 0x3000 +0x2e45 0x3000 +0x2e46 0x3000 +0x2e47 0x3000 +0x2e48 0x3000 +0x2e49 0x3000 +0x2e4a 0x3000 +0x2e4b 0x3000 +0x2e4c 0x3000 +0x2e4d 0x3000 +0x2e4e 0x3000 +0x2e4f 0x3000 +0x2e50 0x3000 +0x2e51 0x3000 +0x2e52 0x3000 +0x2e53 0x3000 +0x2e54 0x3000 +0x2e55 0x3000 +0x2e56 0x3000 +0x2e57 0x3000 +0x2e58 0x3000 +0x2e59 0x3000 +0x2e5a 0x3000 +0x2e5b 0x3000 +0x2e5c 0x3000 +0x2e5d 0x3000 +0x2e5e 0x3000 +0x2e5f 0x3000 +0x2e60 0x3000 +0x2e61 0x3000 +0x2e62 0x3000 +0x2e63 0x3000 +0x2e64 0x3000 +0x2e65 0x3000 +0x2e66 0x3000 +0x2e67 0x3000 +0x2e68 0x3000 +0x2e69 0x3000 +0x2e6a 0x3000 +0x2e6b 0x3000 +0x2e6c 0x3000 +0x2e6d 0x3000 +0x2e6e 0x3000 +0x2e6f 0x3000 +0x2e70 0x3000 +0x2e71 0x3000 +0x2e72 0x3000 +0x2e73 0x3000 +0x2e74 0x3000 +0x2e75 0x3000 +0x2e76 0x3000 +0x2e77 0x3000 +0x2e78 0x3000 +0x2e79 0x3000 +0x2e7a 0x3000 +0x2e7b 0x3000 +0x2e7c 0x3000 +0x2e7d 0x3000 +0x2e7e 0x3000 +0x2e7f 0x3000 +0x2f20 0x3000 +0x2f21 0x3000 +0x2f22 0x3000 +0x2f23 0x3000 +0x2f24 0x3000 +0x2f25 0x3000 +0x2f26 0x3000 +0x2f27 0x3000 +0x2f28 0x3000 +0x2f29 0x3000 +0x2f2a 0x3000 +0x2f2b 0x3000 +0x2f2c 0x3000 +0x2f2d 0x3000 +0x2f2e 0x3000 +0x2f2f 0x3000 +0x2f30 0x3000 +0x2f31 0x3000 +0x2f32 0x3000 +0x2f33 0x3000 +0x2f34 0x3000 +0x2f35 0x3000 +0x2f36 0x3000 +0x2f37 0x3000 +0x2f38 0x3000 +0x2f39 0x3000 +0x2f3a 0x3000 +0x2f3b 0x3000 +0x2f3c 0x3000 +0x2f3d 0x3000 +0x2f3e 0x3000 +0x2f3f 0x3000 +0x2f40 0x3000 +0x2f41 0x3000 +0x2f42 0x3000 +0x2f43 0x3000 +0x2f44 0x3000 +0x2f45 0x3000 +0x2f46 0x3000 +0x2f47 0x3000 +0x2f48 0x3000 +0x2f49 0x3000 +0x2f4a 0x3000 +0x2f4b 0x3000 +0x2f4c 0x3000 +0x2f4d 0x3000 +0x2f4e 0x3000 +0x2f4f 0x3000 +0x2f50 0x3000 +0x2f51 0x3000 +0x2f52 0x3000 +0x2f53 0x3000 +0x2f54 0x3000 +0x2f55 0x3000 +0x2f56 0x3000 +0x2f57 0x3000 +0x2f58 0x3000 +0x2f59 0x3000 +0x2f5a 0x3000 +0x2f5b 0x3000 +0x2f5c 0x3000 +0x2f5d 0x3000 +0x2f5e 0x3000 +0x2f5f 0x3000 +0x2f60 0x3000 +0x2f61 0x3000 +0x2f62 0x3000 +0x2f63 0x3000 +0x2f64 0x3000 +0x2f65 0x3000 +0x2f66 0x3000 +0x2f67 0x3000 +0x2f68 0x3000 +0x2f69 0x3000 +0x2f6a 0x3000 +0x2f6b 0x3000 +0x2f6c 0x3000 +0x2f6d 0x3000 +0x2f6e 0x3000 +0x2f6f 0x3000 +0x2f70 0x3000 +0x2f71 0x3000 +0x2f72 0x3000 +0x2f73 0x3000 +0x2f74 0x3000 +0x2f75 0x3000 +0x2f76 0x3000 +0x2f77 0x3000 +0x2f78 0x3000 +0x2f79 0x3000 +0x2f7a 0x3000 +0x2f7b 0x3000 +0x2f7c 0x3000 +0x2f7d 0x3000 +0x2f7e 0x3000 +0x2f7f 0x3000 +0x3020 0x3000 +0x3021 0x4e9c +0x3022 0x5516 +0x3023 0x5a03 +0x3024 0x963f +0x3025 0x54c0 +0x3026 0x611b +0x3027 0x6328 +0x3028 0x59f6 +0x3029 0x9022 +0x302a 0x8475 +0x302b 0x831c +0x302c 0x7a50 +0x302d 0x60aa +0x302e 0x63e1 +0x302f 0x6e25 +0x3030 0x65ed +0x3031 0x8466 +0x3032 0x82a6 +0x3033 0x9bf5 +0x3034 0x6893 +0x3035 0x5727 +0x3036 0x65a1 +0x3037 0x6271 +0x3038 0x5b9b +0x3039 0x59d0 +0x303a 0x867b +0x303b 0x98f4 +0x303c 0x7d62 +0x303d 0x7dbe +0x303e 0x9b8e +0x303f 0x6216 +0x3040 0x7c9f +0x3041 0x88b7 +0x3042 0x5b89 +0x3043 0x5eb5 +0x3044 0x6309 +0x3045 0x6697 +0x3046 0x6848 +0x3047 0x95c7 +0x3048 0x978d +0x3049 0x674f +0x304a 0x4ee5 +0x304b 0x4f0a +0x304c 0x4f4d +0x304d 0x4f9d +0x304e 0x5049 +0x304f 0x56f2 +0x3050 0x5937 +0x3051 0x59d4 +0x3052 0x5a01 +0x3053 0x5c09 +0x3054 0x60df +0x3055 0x610f +0x3056 0x6170 +0x3057 0x6613 +0x3058 0x6905 +0x3059 0x70ba +0x305a 0x754f +0x305b 0x7570 +0x305c 0x79fb +0x305d 0x7dad +0x305e 0x7def +0x305f 0x80c3 +0x3060 0x840e +0x3061 0x8863 +0x3062 0x8b02 +0x3063 0x9055 +0x3064 0x907a +0x3065 0x533b +0x3066 0x4e95 +0x3067 0x4ea5 +0x3068 0x57df +0x3069 0x80b2 +0x306a 0x90c1 +0x306b 0x78ef +0x306c 0x4e00 +0x306d 0x58f1 +0x306e 0x6ea2 +0x306f 0x9038 +0x3070 0x7a32 +0x3071 0x8328 +0x3072 0x828b +0x3073 0x9c2f +0x3074 0x5141 +0x3075 0x5370 +0x3076 0x54bd +0x3077 0x54e1 +0x3078 0x56e0 +0x3079 0x59fb +0x307a 0x5f15 +0x307b 0x98f2 +0x307c 0x6deb +0x307d 0x80e4 +0x307e 0x852d +0x307f 0x3000 +0x3120 0x3000 +0x3121 0x9662 +0x3122 0x9670 +0x3123 0x96a0 +0x3124 0x97fb +0x3125 0x540b +0x3126 0x53f3 +0x3127 0x5b87 +0x3128 0x70cf +0x3129 0x7fbd +0x312a 0x8fc2 +0x312b 0x96e8 +0x312c 0x536f +0x312d 0x9d5c +0x312e 0x7aba +0x312f 0x4e11 +0x3130 0x7893 +0x3131 0x81fc +0x3132 0x6e26 +0x3133 0x5618 +0x3134 0x5504 +0x3135 0x6b1d +0x3136 0x851a +0x3137 0x9c3b +0x3138 0x59e5 +0x3139 0x53a9 +0x313a 0x6d66 +0x313b 0x74dc +0x313c 0x958f +0x313d 0x5642 +0x313e 0x4e91 +0x313f 0x904b +0x3140 0x96f2 +0x3141 0x834f +0x3142 0x990c +0x3143 0x53e1 +0x3144 0x55b6 +0x3145 0x5b30 +0x3146 0x5f71 +0x3147 0x6620 +0x3148 0x66f3 +0x3149 0x6804 +0x314a 0x6c38 +0x314b 0x6cf3 +0x314c 0x6d29 +0x314d 0x745b +0x314e 0x76c8 +0x314f 0x7a4e +0x3150 0x9834 +0x3151 0x82f1 +0x3152 0x885b +0x3153 0x8a60 +0x3154 0x92ed +0x3155 0x6db2 +0x3156 0x75ab +0x3157 0x76ca +0x3158 0x99c5 +0x3159 0x60a6 +0x315a 0x8b01 +0x315b 0x8d8a +0x315c 0x95b2 +0x315d 0x698e +0x315e 0x53ad +0x315f 0x5186 +0x3160 0x5712 +0x3161 0x5830 +0x3162 0x5944 +0x3163 0x5bb4 +0x3164 0x5ef6 +0x3165 0x6028 +0x3166 0x63a9 +0x3167 0x63f4 +0x3168 0x6cbf +0x3169 0x6f14 +0x316a 0x708e +0x316b 0x7114 +0x316c 0x7159 +0x316d 0x71d5 +0x316e 0x733f +0x316f 0x7e01 +0x3170 0x8276 +0x3171 0x82d1 +0x3172 0x8597 +0x3173 0x9060 +0x3174 0x925b +0x3175 0x9d1b +0x3176 0x5869 +0x3177 0x65bc +0x3178 0x6c5a +0x3179 0x7525 +0x317a 0x51f9 +0x317b 0x592e +0x317c 0x5965 +0x317d 0x5f80 +0x317e 0x5fdc +0x317f 0x3000 +0x3220 0x3000 +0x3221 0x62bc +0x3222 0x65fa +0x3223 0x6a2a +0x3224 0x6b27 +0x3225 0x6bb4 +0x3226 0x738b +0x3227 0x7fc1 +0x3228 0x8956 +0x3229 0x9d2c +0x322a 0x9d0e +0x322b 0x9ec4 +0x322c 0x5ca1 +0x322d 0x6c96 +0x322e 0x837b +0x322f 0x5104 +0x3230 0x5c4b +0x3231 0x61b6 +0x3232 0x81c6 +0x3233 0x6876 +0x3234 0x7261 +0x3235 0x4e59 +0x3236 0x4ffa +0x3237 0x5378 +0x3238 0x6069 +0x3239 0x6e29 +0x323a 0x7a4f +0x323b 0x97f3 +0x323c 0x4e0b +0x323d 0x5316 +0x323e 0x4eee +0x323f 0x4f55 +0x3240 0x4f3d +0x3241 0x4fa1 +0x3242 0x4f73 +0x3243 0x52a0 +0x3244 0x53ef +0x3245 0x5609 +0x3246 0x590f +0x3247 0x5ac1 +0x3248 0x5bb6 +0x3249 0x5be1 +0x324a 0x79d1 +0x324b 0x6687 +0x324c 0x679c +0x324d 0x67b6 +0x324e 0x6b4c +0x324f 0x6cb3 +0x3250 0x706b +0x3251 0x73c2 +0x3252 0x798d +0x3253 0x79be +0x3254 0x7a3c +0x3255 0x7b87 +0x3256 0x82b1 +0x3257 0x82db +0x3258 0x8304 +0x3259 0x8377 +0x325a 0x83ef +0x325b 0x83d3 +0x325c 0x8766 +0x325d 0x8ab2 +0x325e 0x5629 +0x325f 0x8ca8 +0x3260 0x8fe6 +0x3261 0x904e +0x3262 0x971e +0x3263 0x868a +0x3264 0x4fc4 +0x3265 0x5ce8 +0x3266 0x6211 +0x3267 0x7259 +0x3268 0x753b +0x3269 0x81e5 +0x326a 0x82bd +0x326b 0x86fe +0x326c 0x8cc0 +0x326d 0x96c5 +0x326e 0x9913 +0x326f 0x99d5 +0x3270 0x4ecb +0x3271 0x4f1a +0x3272 0x89e3 +0x3273 0x56de +0x3274 0x584a +0x3275 0x58ca +0x3276 0x5efb +0x3277 0x5feb +0x3278 0x602a +0x3279 0x6094 +0x327a 0x6062 +0x327b 0x61d0 +0x327c 0x6212 +0x327d 0x62d0 +0x327e 0x6539 +0x327f 0x3000 +0x3320 0x3000 +0x3321 0x9b41 +0x3322 0x6666 +0x3323 0x68b0 +0x3324 0x6d77 +0x3325 0x7070 +0x3326 0x754c +0x3327 0x7686 +0x3328 0x7d75 +0x3329 0x82a5 +0x332a 0x87f9 +0x332b 0x958b +0x332c 0x968e +0x332d 0x8c9d +0x332e 0x51f1 +0x332f 0x52be +0x3330 0x5916 +0x3331 0x54b3 +0x3332 0x5bb3 +0x3333 0x5d16 +0x3334 0x6168 +0x3335 0x6982 +0x3336 0x6daf +0x3337 0x788d +0x3338 0x84cb +0x3339 0x8857 +0x333a 0x8a72 +0x333b 0x93a7 +0x333c 0x9ab8 +0x333d 0x6d6c +0x333e 0x99a8 +0x333f 0x86d9 +0x3340 0x57a3 +0x3341 0x67ff +0x3342 0x86ce +0x3343 0x920e +0x3344 0x5283 +0x3345 0x5687 +0x3346 0x5404 +0x3347 0x5ed3 +0x3348 0x62e1 +0x3349 0x64b9 +0x334a 0x683c +0x334b 0x6838 +0x334c 0x6bbb +0x334d 0x7372 +0x334e 0x78ba +0x334f 0x7a6b +0x3350 0x899a +0x3351 0x89d2 +0x3352 0x8d6b +0x3353 0x8f03 +0x3354 0x90ed +0x3355 0x95a3 +0x3356 0x9694 +0x3357 0x9769 +0x3358 0x5b66 +0x3359 0x5cb3 +0x335a 0x697d +0x335b 0x984d +0x335c 0x984e +0x335d 0x639b +0x335e 0x7b20 +0x335f 0x6a2b +0x3360 0x6a7f +0x3361 0x68b6 +0x3362 0x9c0d +0x3363 0x6f5f +0x3364 0x5272 +0x3365 0x559d +0x3366 0x6070 +0x3367 0x62ec +0x3368 0x6d3b +0x3369 0x6e07 +0x336a 0x6ed1 +0x336b 0x845b +0x336c 0x8910 +0x336d 0x8f44 +0x336e 0x4e14 +0x336f 0x9c39 +0x3370 0x53f6 +0x3371 0x691b +0x3372 0x6a3a +0x3373 0x9784 +0x3374 0x682a +0x3375 0x515c +0x3376 0x7ac3 +0x3377 0x84b2 +0x3378 0x91dc +0x3379 0x938c +0x337a 0x565b +0x337b 0x9d28 +0x337c 0x6822 +0x337d 0x8305 +0x337e 0x8431 +0x337f 0x3000 +0x3420 0x3000 +0x3421 0x7ca5 +0x3422 0x5208 +0x3423 0x82c5 +0x3424 0x74e6 +0x3425 0x4e7e +0x3426 0x4f83 +0x3427 0x51a0 +0x3428 0x5bd2 +0x3429 0x520a +0x342a 0x52d8 +0x342b 0x52e7 +0x342c 0x5dfb +0x342d 0x559a +0x342e 0x582a +0x342f 0x59e6 +0x3430 0x5b8c +0x3431 0x5b98 +0x3432 0x5bdb +0x3433 0x5e72 +0x3434 0x5e79 +0x3435 0x60a3 +0x3436 0x611f +0x3437 0x6163 +0x3438 0x61be +0x3439 0x63db +0x343a 0x6562 +0x343b 0x67d1 +0x343c 0x6853 +0x343d 0x68fa +0x343e 0x6b3e +0x343f 0x6b53 +0x3440 0x6c57 +0x3441 0x6f22 +0x3442 0x6f97 +0x3443 0x6f45 +0x3444 0x74b0 +0x3445 0x7518 +0x3446 0x76e3 +0x3447 0x770b +0x3448 0x7aff +0x3449 0x7ba1 +0x344a 0x7c21 +0x344b 0x7de9 +0x344c 0x7f36 +0x344d 0x7ff0 +0x344e 0x809d +0x344f 0x8266 +0x3450 0x839e +0x3451 0x89b3 +0x3452 0x8acc +0x3453 0x8cab +0x3454 0x9084 +0x3455 0x9451 +0x3456 0x9593 +0x3457 0x9591 +0x3458 0x95a2 +0x3459 0x9665 +0x345a 0x97d3 +0x345b 0x9928 +0x345c 0x8218 +0x345d 0x4e38 +0x345e 0x542b +0x345f 0x5cb8 +0x3460 0x5dcc +0x3461 0x73a9 +0x3462 0x764c +0x3463 0x773c +0x3464 0x5ca9 +0x3465 0x7feb +0x3466 0x8d0b +0x3467 0x96c1 +0x3468 0x9811 +0x3469 0x9854 +0x346a 0x9858 +0x346b 0x4f01 +0x346c 0x4f0e +0x346d 0x5371 +0x346e 0x559c +0x346f 0x5668 +0x3470 0x57fa +0x3471 0x5947 +0x3472 0x5b09 +0x3473 0x5bc4 +0x3474 0x5c90 +0x3475 0x5e0c +0x3476 0x5e7e +0x3477 0x5fcc +0x3478 0x63ee +0x3479 0x673a +0x347a 0x65d7 +0x347b 0x65e2 +0x347c 0x671f +0x347d 0x68cb +0x347e 0x68c4 +0x347f 0x3000 +0x3520 0x3000 +0x3521 0x6a5f +0x3522 0x5e30 +0x3523 0x6bc5 +0x3524 0x6c17 +0x3525 0x6c7d +0x3526 0x757f +0x3527 0x7948 +0x3528 0x5b63 +0x3529 0x7a00 +0x352a 0x7d00 +0x352b 0x5fbd +0x352c 0x898f +0x352d 0x8a18 +0x352e 0x8cb4 +0x352f 0x8d77 +0x3530 0x8ecc +0x3531 0x8f1d +0x3532 0x98e2 +0x3533 0x9a0e +0x3534 0x9b3c +0x3535 0x4e80 +0x3536 0x507d +0x3537 0x5100 +0x3538 0x5993 +0x3539 0x5b9c +0x353a 0x622f +0x353b 0x6280 +0x353c 0x64ec +0x353d 0x6b3a +0x353e 0x72a0 +0x353f 0x7591 +0x3540 0x7947 +0x3541 0x7fa9 +0x3542 0x87fb +0x3543 0x8abc +0x3544 0x8b70 +0x3545 0x63ac +0x3546 0x83ca +0x3547 0x97a0 +0x3548 0x5409 +0x3549 0x5403 +0x354a 0x55ab +0x354b 0x6854 +0x354c 0x6a58 +0x354d 0x8a70 +0x354e 0x7827 +0x354f 0x6775 +0x3550 0x9ecd +0x3551 0x5374 +0x3552 0x5ba2 +0x3553 0x811a +0x3554 0x8650 +0x3555 0x9006 +0x3556 0x4e18 +0x3557 0x4e45 +0x3558 0x4ec7 +0x3559 0x4f11 +0x355a 0x53ca +0x355b 0x5438 +0x355c 0x5bae +0x355d 0x5f13 +0x355e 0x6025 +0x355f 0x6551 +0x3560 0x673d +0x3561 0x6c42 +0x3562 0x6c72 +0x3563 0x6ce3 +0x3564 0x7078 +0x3565 0x7403 +0x3566 0x7a76 +0x3567 0x7aae +0x3568 0x7b08 +0x3569 0x7d1a +0x356a 0x7cfe +0x356b 0x7d66 +0x356c 0x65e7 +0x356d 0x725b +0x356e 0x53bb +0x356f 0x5c45 +0x3570 0x5de8 +0x3571 0x62d2 +0x3572 0x62e0 +0x3573 0x6319 +0x3574 0x6e20 +0x3575 0x865a +0x3576 0x8a31 +0x3577 0x8ddd +0x3578 0x92f8 +0x3579 0x6f01 +0x357a 0x79a6 +0x357b 0x9b5a +0x357c 0x4ea8 +0x357d 0x4eab +0x357e 0x4eac +0x357f 0x3000 +0x3620 0x3000 +0x3621 0x4f9b +0x3622 0x4fa0 +0x3623 0x50d1 +0x3624 0x5147 +0x3625 0x7af6 +0x3626 0x5171 +0x3627 0x51f6 +0x3628 0x5354 +0x3629 0x5321 +0x362a 0x537f +0x362b 0x53eb +0x362c 0x55ac +0x362d 0x5883 +0x362e 0x5ce1 +0x362f 0x5f37 +0x3630 0x5f4a +0x3631 0x602f +0x3632 0x6050 +0x3633 0x606d +0x3634 0x631f +0x3635 0x6559 +0x3636 0x6a4b +0x3637 0x6cc1 +0x3638 0x72c2 +0x3639 0x72ed +0x363a 0x77ef +0x363b 0x80f8 +0x363c 0x8105 +0x363d 0x8208 +0x363e 0x854e +0x363f 0x90f7 +0x3640 0x93e1 +0x3641 0x97ff +0x3642 0x9957 +0x3643 0x9a5a +0x3644 0x4ef0 +0x3645 0x51dd +0x3646 0x5c2d +0x3647 0x6681 +0x3648 0x696d +0x3649 0x5c40 +0x364a 0x66f2 +0x364b 0x6975 +0x364c 0x7389 +0x364d 0x6850 +0x364e 0x7c81 +0x364f 0x50c5 +0x3650 0x52e4 +0x3651 0x5747 +0x3652 0x5dfe +0x3653 0x9326 +0x3654 0x65a4 +0x3655 0x6b23 +0x3656 0x6b3d +0x3657 0x7434 +0x3658 0x7981 +0x3659 0x79bd +0x365a 0x7b4b +0x365b 0x7dca +0x365c 0x82b9 +0x365d 0x83cc +0x365e 0x887f +0x365f 0x895f +0x3660 0x8b39 +0x3661 0x8fd1 +0x3662 0x91d1 +0x3663 0x541f +0x3664 0x9280 +0x3665 0x4e5d +0x3666 0x5036 +0x3667 0x53e5 +0x3668 0x533a +0x3669 0x72d7 +0x366a 0x7396 +0x366b 0x77e9 +0x366c 0x82e6 +0x366d 0x8eaf +0x366e 0x99c6 +0x366f 0x99c8 +0x3670 0x99d2 +0x3671 0x5177 +0x3672 0x611a +0x3673 0x865e +0x3674 0x55b0 +0x3675 0x7a7a +0x3676 0x5076 +0x3677 0x5bd3 +0x3678 0x9047 +0x3679 0x9685 +0x367a 0x4e32 +0x367b 0x6adb +0x367c 0x91e7 +0x367d 0x5c51 +0x367e 0x5c48 +0x367f 0x3000 +0x3720 0x3000 +0x3721 0x6398 +0x3722 0x7a9f +0x3723 0x6c93 +0x3724 0x9774 +0x3725 0x8f61 +0x3726 0x7aaa +0x3727 0x718a +0x3728 0x9688 +0x3729 0x7c82 +0x372a 0x6817 +0x372b 0x7e70 +0x372c 0x6851 +0x372d 0x936c +0x372e 0x52f2 +0x372f 0x541b +0x3730 0x85ab +0x3731 0x8a13 +0x3732 0x7fa4 +0x3733 0x8ecd +0x3734 0x90e1 +0x3735 0x5366 +0x3736 0x8888 +0x3737 0x7941 +0x3738 0x4fc2 +0x3739 0x50be +0x373a 0x5211 +0x373b 0x5144 +0x373c 0x5553 +0x373d 0x572d +0x373e 0x73ea +0x373f 0x578b +0x3740 0x5951 +0x3741 0x5f62 +0x3742 0x5f84 +0x3743 0x6075 +0x3744 0x6176 +0x3745 0x6167 +0x3746 0x61a9 +0x3747 0x63b2 +0x3748 0x643a +0x3749 0x656c +0x374a 0x666f +0x374b 0x6842 +0x374c 0x6e13 +0x374d 0x7566 +0x374e 0x7a3d +0x374f 0x7cfb +0x3750 0x7d4c +0x3751 0x7d99 +0x3752 0x7e4b +0x3753 0x7f6b +0x3754 0x830e +0x3755 0x834a +0x3756 0x86cd +0x3757 0x8a08 +0x3758 0x8a63 +0x3759 0x8b66 +0x375a 0x8efd +0x375b 0x981a +0x375c 0x9d8f +0x375d 0x82b8 +0x375e 0x8fce +0x375f 0x9be8 +0x3760 0x5287 +0x3761 0x621f +0x3762 0x6483 +0x3763 0x6fc0 +0x3764 0x9699 +0x3765 0x6841 +0x3766 0x5091 +0x3767 0x6b20 +0x3768 0x6c7a +0x3769 0x6f54 +0x376a 0x7a74 +0x376b 0x7d50 +0x376c 0x8840 +0x376d 0x8a23 +0x376e 0x6708 +0x376f 0x4ef6 +0x3770 0x5039 +0x3771 0x5026 +0x3772 0x5065 +0x3773 0x517c +0x3774 0x5238 +0x3775 0x5263 +0x3776 0x55a7 +0x3777 0x570f +0x3778 0x5805 +0x3779 0x5acc +0x377a 0x5efa +0x377b 0x61b2 +0x377c 0x61f8 +0x377d 0x62f3 +0x377e 0x6372 +0x377f 0x3000 +0x3820 0x3000 +0x3821 0x691c +0x3822 0x6a29 +0x3823 0x727d +0x3824 0x72ac +0x3825 0x732e +0x3826 0x7814 +0x3827 0x786f +0x3828 0x7d79 +0x3829 0x770c +0x382a 0x80a9 +0x382b 0x898b +0x382c 0x8b19 +0x382d 0x8ce2 +0x382e 0x8ed2 +0x382f 0x9063 +0x3830 0x9375 +0x3831 0x967a +0x3832 0x9855 +0x3833 0x9a13 +0x3834 0x9e78 +0x3835 0x5143 +0x3836 0x539f +0x3837 0x53b3 +0x3838 0x5e7b +0x3839 0x5f26 +0x383a 0x6e1b +0x383b 0x6e90 +0x383c 0x7384 +0x383d 0x73fe +0x383e 0x7d43 +0x383f 0x8237 +0x3840 0x8a00 +0x3841 0x8afa +0x3842 0x9650 +0x3843 0x4e4e +0x3844 0x500b +0x3845 0x53e4 +0x3846 0x547c +0x3847 0x56fa +0x3848 0x59d1 +0x3849 0x5b64 +0x384a 0x5df1 +0x384b 0x5eab +0x384c 0x5f27 +0x384d 0x6238 +0x384e 0x6545 +0x384f 0x67af +0x3850 0x6e56 +0x3851 0x72d0 +0x3852 0x7cca +0x3853 0x88b4 +0x3854 0x80a1 +0x3855 0x80e1 +0x3856 0x83f0 +0x3857 0x864e +0x3858 0x8a87 +0x3859 0x8de8 +0x385a 0x9237 +0x385b 0x96c7 +0x385c 0x9867 +0x385d 0x9f13 +0x385e 0x4e94 +0x385f 0x4e92 +0x3860 0x4f0d +0x3861 0x5348 +0x3862 0x5449 +0x3863 0x543e +0x3864 0x5a2f +0x3865 0x5f8c +0x3866 0x5fa1 +0x3867 0x609f +0x3868 0x68a7 +0x3869 0x6a8e +0x386a 0x745a +0x386b 0x7881 +0x386c 0x8a9e +0x386d 0x8aa4 +0x386e 0x8b77 +0x386f 0x9190 +0x3870 0x4e5e +0x3871 0x9bc9 +0x3872 0x4ea4 +0x3873 0x4f7c +0x3874 0x4faf +0x3875 0x5019 +0x3876 0x5016 +0x3877 0x5149 +0x3878 0x516c +0x3879 0x529f +0x387a 0x52b9 +0x387b 0x52fe +0x387c 0x539a +0x387d 0x53e3 +0x387e 0x5411 +0x387f 0x3000 +0x3920 0x3000 +0x3921 0x540e +0x3922 0x5589 +0x3923 0x5751 +0x3924 0x57a2 +0x3925 0x597d +0x3926 0x5b54 +0x3927 0x5b5d +0x3928 0x5b8f +0x3929 0x5de5 +0x392a 0x5de7 +0x392b 0x5df7 +0x392c 0x5e78 +0x392d 0x5e83 +0x392e 0x5e9a +0x392f 0x5eb7 +0x3930 0x5f18 +0x3931 0x6052 +0x3932 0x614c +0x3933 0x6297 +0x3934 0x62d8 +0x3935 0x63a7 +0x3936 0x653b +0x3937 0x6602 +0x3938 0x6643 +0x3939 0x66f4 +0x393a 0x676d +0x393b 0x6821 +0x393c 0x6897 +0x393d 0x69cb +0x393e 0x6c5f +0x393f 0x6d2a +0x3940 0x6d69 +0x3941 0x6e2f +0x3942 0x6e9d +0x3943 0x7532 +0x3944 0x7687 +0x3945 0x786c +0x3946 0x7a3f +0x3947 0x7ce0 +0x3948 0x7d05 +0x3949 0x7d18 +0x394a 0x7d5e +0x394b 0x7db1 +0x394c 0x8015 +0x394d 0x8003 +0x394e 0x80af +0x394f 0x80b1 +0x3950 0x8154 +0x3951 0x818f +0x3952 0x822a +0x3953 0x8352 +0x3954 0x884c +0x3955 0x8861 +0x3956 0x8b1b +0x3957 0x8ca2 +0x3958 0x8cfc +0x3959 0x90ca +0x395a 0x9175 +0x395b 0x9271 +0x395c 0x783f +0x395d 0x92fc +0x395e 0x95a4 +0x395f 0x964d +0x3960 0x9805 +0x3961 0x9999 +0x3962 0x9ad8 +0x3963 0x9d3b +0x3964 0x525b +0x3965 0x52ab +0x3966 0x53f7 +0x3967 0x5408 +0x3968 0x58d5 +0x3969 0x62f7 +0x396a 0x6fe0 +0x396b 0x8c6a +0x396c 0x8f5f +0x396d 0x9eb9 +0x396e 0x514b +0x396f 0x523b +0x3970 0x544a +0x3971 0x56fd +0x3972 0x7a40 +0x3973 0x9177 +0x3974 0x9d60 +0x3975 0x9ed2 +0x3976 0x7344 +0x3977 0x6f09 +0x3978 0x8170 +0x3979 0x7511 +0x397a 0x5ffd +0x397b 0x60da +0x397c 0x9aa8 +0x397d 0x72db +0x397e 0x8fbc +0x397f 0x3000 +0x3a20 0x3000 +0x3a21 0x6b64 +0x3a22 0x9803 +0x3a23 0x4eca +0x3a24 0x56f0 +0x3a25 0x5764 +0x3a26 0x58be +0x3a27 0x5a5a +0x3a28 0x6068 +0x3a29 0x61c7 +0x3a2a 0x660f +0x3a2b 0x6606 +0x3a2c 0x6839 +0x3a2d 0x68b1 +0x3a2e 0x6df7 +0x3a2f 0x75d5 +0x3a30 0x7d3a +0x3a31 0x826e +0x3a32 0x9b42 +0x3a33 0x4e9b +0x3a34 0x4f50 +0x3a35 0x53c9 +0x3a36 0x5506 +0x3a37 0x5d6f +0x3a38 0x5de6 +0x3a39 0x5dee +0x3a3a 0x67fb +0x3a3b 0x6c99 +0x3a3c 0x7473 +0x3a3d 0x7802 +0x3a3e 0x8a50 +0x3a3f 0x9396 +0x3a40 0x88df +0x3a41 0x5750 +0x3a42 0x5ea7 +0x3a43 0x632b +0x3a44 0x50b5 +0x3a45 0x50ac +0x3a46 0x518d +0x3a47 0x6700 +0x3a48 0x54c9 +0x3a49 0x585e +0x3a4a 0x59bb +0x3a4b 0x5bb0 +0x3a4c 0x5f69 +0x3a4d 0x624d +0x3a4e 0x63a1 +0x3a4f 0x683d +0x3a50 0x6b73 +0x3a51 0x6e08 +0x3a52 0x707d +0x3a53 0x91c7 +0x3a54 0x7280 +0x3a55 0x7815 +0x3a56 0x7826 +0x3a57 0x796d +0x3a58 0x658e +0x3a59 0x7d30 +0x3a5a 0x83dc +0x3a5b 0x88c1 +0x3a5c 0x8f09 +0x3a5d 0x969b +0x3a5e 0x5264 +0x3a5f 0x5728 +0x3a60 0x6750 +0x3a61 0x7f6a +0x3a62 0x8ca1 +0x3a63 0x51b4 +0x3a64 0x5742 +0x3a65 0x962a +0x3a66 0x583a +0x3a67 0x698a +0x3a68 0x80b4 +0x3a69 0x54b2 +0x3a6a 0x5d0e +0x3a6b 0x57fc +0x3a6c 0x7895 +0x3a6d 0x9dfa +0x3a6e 0x4f5c +0x3a6f 0x524a +0x3a70 0x548b +0x3a71 0x643e +0x3a72 0x6628 +0x3a73 0x6714 +0x3a74 0x67f5 +0x3a75 0x7a84 +0x3a76 0x7b56 +0x3a77 0x7d22 +0x3a78 0x932f +0x3a79 0x685c +0x3a7a 0x9bad +0x3a7b 0x7b39 +0x3a7c 0x5319 +0x3a7d 0x518a +0x3a7e 0x5237 +0x3a7f 0x3000 +0x3b20 0x3000 +0x3b21 0x5bdf +0x3b22 0x62f6 +0x3b23 0x64ae +0x3b24 0x64e6 +0x3b25 0x672d +0x3b26 0x6bba +0x3b27 0x85a9 +0x3b28 0x96d1 +0x3b29 0x7690 +0x3b2a 0x9bd6 +0x3b2b 0x634c +0x3b2c 0x9306 +0x3b2d 0x9bab +0x3b2e 0x76bf +0x3b2f 0x6652 +0x3b30 0x4e09 +0x3b31 0x5098 +0x3b32 0x53c2 +0x3b33 0x5c71 +0x3b34 0x60e8 +0x3b35 0x6492 +0x3b36 0x6563 +0x3b37 0x685f +0x3b38 0x71e6 +0x3b39 0x73ca +0x3b3a 0x7523 +0x3b3b 0x7b97 +0x3b3c 0x7e82 +0x3b3d 0x8695 +0x3b3e 0x8b83 +0x3b3f 0x8cdb +0x3b40 0x9178 +0x3b41 0x9910 +0x3b42 0x65ac +0x3b43 0x66ab +0x3b44 0x6b8b +0x3b45 0x4ed5 +0x3b46 0x4ed4 +0x3b47 0x4f3a +0x3b48 0x4f7f +0x3b49 0x523a +0x3b4a 0x53f8 +0x3b4b 0x53f2 +0x3b4c 0x55e3 +0x3b4d 0x56db +0x3b4e 0x58eb +0x3b4f 0x59cb +0x3b50 0x59c9 +0x3b51 0x59ff +0x3b52 0x5b50 +0x3b53 0x5c4d +0x3b54 0x5e02 +0x3b55 0x5e2b +0x3b56 0x5fd7 +0x3b57 0x601d +0x3b58 0x6307 +0x3b59 0x652f +0x3b5a 0x5b5c +0x3b5b 0x65af +0x3b5c 0x65bd +0x3b5d 0x65e8 +0x3b5e 0x679d +0x3b5f 0x6b62 +0x3b60 0x6b7b +0x3b61 0x6c0f +0x3b62 0x7345 +0x3b63 0x7949 +0x3b64 0x79c1 +0x3b65 0x7cf8 +0x3b66 0x7d19 +0x3b67 0x7d2b +0x3b68 0x80a2 +0x3b69 0x8102 +0x3b6a 0x81f3 +0x3b6b 0x8996 +0x3b6c 0x8a5e +0x3b6d 0x8a69 +0x3b6e 0x8a66 +0x3b6f 0x8a8c +0x3b70 0x8aee +0x3b71 0x8cc7 +0x3b72 0x8cdc +0x3b73 0x96cc +0x3b74 0x98fc +0x3b75 0x6b6f +0x3b76 0x4e8b +0x3b77 0x4f3c +0x3b78 0x4f8d +0x3b79 0x5150 +0x3b7a 0x5b57 +0x3b7b 0x5bfa +0x3b7c 0x6148 +0x3b7d 0x6301 +0x3b7e 0x6642 +0x3b7f 0x3000 +0x3c20 0x3000 +0x3c21 0x6b21 +0x3c22 0x6ecb +0x3c23 0x6cbb +0x3c24 0x723e +0x3c25 0x74bd +0x3c26 0x75d4 +0x3c27 0x78c1 +0x3c28 0x793a +0x3c29 0x800c +0x3c2a 0x8033 +0x3c2b 0x81ea +0x3c2c 0x8494 +0x3c2d 0x8f9e +0x3c2e 0x6c50 +0x3c2f 0x9e7f +0x3c30 0x5f0f +0x3c31 0x8b58 +0x3c32 0x9d2b +0x3c33 0x7afa +0x3c34 0x8ef8 +0x3c35 0x5b8d +0x3c36 0x96eb +0x3c37 0x4e03 +0x3c38 0x53f1 +0x3c39 0x57f7 +0x3c3a 0x5931 +0x3c3b 0x5ac9 +0x3c3c 0x5ba4 +0x3c3d 0x6089 +0x3c3e 0x6e7f +0x3c3f 0x6f06 +0x3c40 0x75be +0x3c41 0x8cea +0x3c42 0x5b9f +0x3c43 0x8500 +0x3c44 0x7be0 +0x3c45 0x5072 +0x3c46 0x67f4 +0x3c47 0x829d +0x3c48 0x5c61 +0x3c49 0x854a +0x3c4a 0x7e1e +0x3c4b 0x820e +0x3c4c 0x5199 +0x3c4d 0x5c04 +0x3c4e 0x6368 +0x3c4f 0x8d66 +0x3c50 0x659c +0x3c51 0x716e +0x3c52 0x793e +0x3c53 0x7d17 +0x3c54 0x8005 +0x3c55 0x8b1d +0x3c56 0x8eca +0x3c57 0x906e +0x3c58 0x86c7 +0x3c59 0x90aa +0x3c5a 0x501f +0x3c5b 0x52fa +0x3c5c 0x5c3a +0x3c5d 0x6753 +0x3c5e 0x707c +0x3c5f 0x7235 +0x3c60 0x914c +0x3c61 0x91c8 +0x3c62 0x932b +0x3c63 0x82e5 +0x3c64 0x5bc2 +0x3c65 0x5f31 +0x3c66 0x60f9 +0x3c67 0x4e3b +0x3c68 0x53d6 +0x3c69 0x5b88 +0x3c6a 0x624b +0x3c6b 0x6731 +0x3c6c 0x6b8a +0x3c6d 0x72e9 +0x3c6e 0x73e0 +0x3c6f 0x7a2e +0x3c70 0x816b +0x3c71 0x8da3 +0x3c72 0x9152 +0x3c73 0x9996 +0x3c74 0x5112 +0x3c75 0x53d7 +0x3c76 0x546a +0x3c77 0x5bff +0x3c78 0x6388 +0x3c79 0x6a39 +0x3c7a 0x7dac +0x3c7b 0x9700 +0x3c7c 0x56da +0x3c7d 0x53ce +0x3c7e 0x5468 +0x3c7f 0x3000 +0x3d20 0x3000 +0x3d21 0x5b97 +0x3d22 0x5c31 +0x3d23 0x5dde +0x3d24 0x4fee +0x3d25 0x6101 +0x3d26 0x62fe +0x3d27 0x6d32 +0x3d28 0x79c0 +0x3d29 0x79cb +0x3d2a 0x7d42 +0x3d2b 0x7e4d +0x3d2c 0x7fd2 +0x3d2d 0x81ed +0x3d2e 0x821f +0x3d2f 0x8490 +0x3d30 0x8846 +0x3d31 0x8972 +0x3d32 0x8b90 +0x3d33 0x8e74 +0x3d34 0x8f2f +0x3d35 0x9031 +0x3d36 0x914b +0x3d37 0x916c +0x3d38 0x96c6 +0x3d39 0x919c +0x3d3a 0x4ec0 +0x3d3b 0x4f4f +0x3d3c 0x5145 +0x3d3d 0x5341 +0x3d3e 0x5f93 +0x3d3f 0x620e +0x3d40 0x67d4 +0x3d41 0x6c41 +0x3d42 0x6e0b +0x3d43 0x7363 +0x3d44 0x7e26 +0x3d45 0x91cd +0x3d46 0x9283 +0x3d47 0x53d4 +0x3d48 0x5919 +0x3d49 0x5bbf +0x3d4a 0x6dd1 +0x3d4b 0x795d +0x3d4c 0x7e2e +0x3d4d 0x7c9b +0x3d4e 0x587e +0x3d4f 0x719f +0x3d50 0x51fa +0x3d51 0x8853 +0x3d52 0x8ff0 +0x3d53 0x4fca +0x3d54 0x5cfb +0x3d55 0x6625 +0x3d56 0x77ac +0x3d57 0x7ae3 +0x3d58 0x821c +0x3d59 0x99ff +0x3d5a 0x51c6 +0x3d5b 0x5faa +0x3d5c 0x65ec +0x3d5d 0x696f +0x3d5e 0x6b89 +0x3d5f 0x6df3 +0x3d60 0x6e96 +0x3d61 0x6f64 +0x3d62 0x76fe +0x3d63 0x7d14 +0x3d64 0x5de1 +0x3d65 0x9075 +0x3d66 0x9187 +0x3d67 0x9806 +0x3d68 0x51e6 +0x3d69 0x521d +0x3d6a 0x6240 +0x3d6b 0x6691 +0x3d6c 0x66d9 +0x3d6d 0x6e1a +0x3d6e 0x5eb6 +0x3d6f 0x7dd2 +0x3d70 0x7f72 +0x3d71 0x66f8 +0x3d72 0x85af +0x3d73 0x85f7 +0x3d74 0x8af8 +0x3d75 0x52a9 +0x3d76 0x53d9 +0x3d77 0x5973 +0x3d78 0x5e8f +0x3d79 0x5f90 +0x3d7a 0x6055 +0x3d7b 0x92e4 +0x3d7c 0x9664 +0x3d7d 0x50b7 +0x3d7e 0x511f +0x3d7f 0x3000 +0x3e20 0x3000 +0x3e21 0x52dd +0x3e22 0x5320 +0x3e23 0x5347 +0x3e24 0x53ec +0x3e25 0x54e8 +0x3e26 0x5546 +0x3e27 0x5531 +0x3e28 0x5617 +0x3e29 0x5968 +0x3e2a 0x59be +0x3e2b 0x5a3c +0x3e2c 0x5bb5 +0x3e2d 0x5c06 +0x3e2e 0x5c0f +0x3e2f 0x5c11 +0x3e30 0x5c1a +0x3e31 0x5e84 +0x3e32 0x5e8a +0x3e33 0x5ee0 +0x3e34 0x5f70 +0x3e35 0x627f +0x3e36 0x6284 +0x3e37 0x62db +0x3e38 0x638c +0x3e39 0x6377 +0x3e3a 0x6607 +0x3e3b 0x660c +0x3e3c 0x662d +0x3e3d 0x6676 +0x3e3e 0x677e +0x3e3f 0x68a2 +0x3e40 0x6a1f +0x3e41 0x6a35 +0x3e42 0x6cbc +0x3e43 0x6d88 +0x3e44 0x6e09 +0x3e45 0x6e58 +0x3e46 0x713c +0x3e47 0x7126 +0x3e48 0x7167 +0x3e49 0x75c7 +0x3e4a 0x7701 +0x3e4b 0x785d +0x3e4c 0x7901 +0x3e4d 0x7965 +0x3e4e 0x79f0 +0x3e4f 0x7ae0 +0x3e50 0x7b11 +0x3e51 0x7ca7 +0x3e52 0x7d39 +0x3e53 0x8096 +0x3e54 0x83d6 +0x3e55 0x848b +0x3e56 0x8549 +0x3e57 0x885d +0x3e58 0x88f3 +0x3e59 0x8a1f +0x3e5a 0x8a3c +0x3e5b 0x8a54 +0x3e5c 0x8a73 +0x3e5d 0x8c61 +0x3e5e 0x8cde +0x3e5f 0x91a4 +0x3e60 0x9266 +0x3e61 0x937e +0x3e62 0x9418 +0x3e63 0x969c +0x3e64 0x9798 +0x3e65 0x4e0a +0x3e66 0x4e08 +0x3e67 0x4e1e +0x3e68 0x4e57 +0x3e69 0x5197 +0x3e6a 0x5270 +0x3e6b 0x57ce +0x3e6c 0x5834 +0x3e6d 0x58cc +0x3e6e 0x5b22 +0x3e6f 0x5e38 +0x3e70 0x60c5 +0x3e71 0x64fe +0x3e72 0x6761 +0x3e73 0x6756 +0x3e74 0x6d44 +0x3e75 0x72b6 +0x3e76 0x7573 +0x3e77 0x7a63 +0x3e78 0x84b8 +0x3e79 0x8b72 +0x3e7a 0x91b8 +0x3e7b 0x9320 +0x3e7c 0x5631 +0x3e7d 0x57f4 +0x3e7e 0x98fe +0x3e7f 0x3000 +0x3f20 0x3000 +0x3f21 0x62ed +0x3f22 0x690d +0x3f23 0x6b96 +0x3f24 0x71ed +0x3f25 0x7e54 +0x3f26 0x8077 +0x3f27 0x8272 +0x3f28 0x89e6 +0x3f29 0x98df +0x3f2a 0x8755 +0x3f2b 0x8fb1 +0x3f2c 0x5c3b +0x3f2d 0x4f38 +0x3f2e 0x4fe1 +0x3f2f 0x4fb5 +0x3f30 0x5507 +0x3f31 0x5a20 +0x3f32 0x5bdd +0x3f33 0x5be9 +0x3f34 0x5fc3 +0x3f35 0x614e +0x3f36 0x632f +0x3f37 0x65b0 +0x3f38 0x664b +0x3f39 0x68ee +0x3f3a 0x699b +0x3f3b 0x6d78 +0x3f3c 0x6df1 +0x3f3d 0x7533 +0x3f3e 0x75b9 +0x3f3f 0x771f +0x3f40 0x795e +0x3f41 0x79e6 +0x3f42 0x7d33 +0x3f43 0x81e3 +0x3f44 0x82af +0x3f45 0x85aa +0x3f46 0x89aa +0x3f47 0x8a3a +0x3f48 0x8eab +0x3f49 0x8f9b +0x3f4a 0x9032 +0x3f4b 0x91dd +0x3f4c 0x9707 +0x3f4d 0x4eba +0x3f4e 0x4ec1 +0x3f4f 0x5203 +0x3f50 0x5875 +0x3f51 0x58ec +0x3f52 0x5c0b +0x3f53 0x751a +0x3f54 0x5c3d +0x3f55 0x814e +0x3f56 0x8a0a +0x3f57 0x8fc5 +0x3f58 0x9663 +0x3f59 0x976d +0x3f5a 0x7b25 +0x3f5b 0x8acf +0x3f5c 0x9808 +0x3f5d 0x9162 +0x3f5e 0x56f3 +0x3f5f 0x53a8 +0x3f60 0x9017 +0x3f61 0x5439 +0x3f62 0x5782 +0x3f63 0x5e25 +0x3f64 0x63a8 +0x3f65 0x6c34 +0x3f66 0x708a +0x3f67 0x7761 +0x3f68 0x7c8b +0x3f69 0x7fe0 +0x3f6a 0x8870 +0x3f6b 0x9042 +0x3f6c 0x9154 +0x3f6d 0x9310 +0x3f6e 0x9318 +0x3f6f 0x968f +0x3f70 0x745e +0x3f71 0x9ac4 +0x3f72 0x5d07 +0x3f73 0x5d69 +0x3f74 0x6570 +0x3f75 0x67a2 +0x3f76 0x8da8 +0x3f77 0x96db +0x3f78 0x636e +0x3f79 0x6749 +0x3f7a 0x6919 +0x3f7b 0x83c5 +0x3f7c 0x9817 +0x3f7d 0x96c0 +0x3f7e 0x88fe +0x3f7f 0x3000 +0x4020 0x3000 +0x4021 0x6f84 +0x4022 0x647a +0x4023 0x5bf8 +0x4024 0x4e16 +0x4025 0x702c +0x4026 0x755d +0x4027 0x662f +0x4028 0x51c4 +0x4029 0x5236 +0x402a 0x52e2 +0x402b 0x59d3 +0x402c 0x5f81 +0x402d 0x6027 +0x402e 0x6210 +0x402f 0x653f +0x4030 0x6574 +0x4031 0x661f +0x4032 0x6674 +0x4033 0x68f2 +0x4034 0x6816 +0x4035 0x6b63 +0x4036 0x6e05 +0x4037 0x7272 +0x4038 0x751f +0x4039 0x76db +0x403a 0x7cbe +0x403b 0x8056 +0x403c 0x58f0 +0x403d 0x88fd +0x403e 0x897f +0x403f 0x8aa0 +0x4040 0x8a93 +0x4041 0x8acb +0x4042 0x901d +0x4043 0x9192 +0x4044 0x9752 +0x4045 0x9759 +0x4046 0x6589 +0x4047 0x7a0e +0x4048 0x8106 +0x4049 0x96bb +0x404a 0x5e2d +0x404b 0x60dc +0x404c 0x621a +0x404d 0x65a5 +0x404e 0x6614 +0x404f 0x6790 +0x4050 0x77f3 +0x4051 0x7a4d +0x4052 0x7c4d +0x4053 0x7e3e +0x4054 0x810a +0x4055 0x8cac +0x4056 0x8d64 +0x4057 0x8de1 +0x4058 0x8e5f +0x4059 0x78a9 +0x405a 0x5207 +0x405b 0x62d9 +0x405c 0x63a5 +0x405d 0x6442 +0x405e 0x6298 +0x405f 0x8a2d +0x4060 0x7a83 +0x4061 0x7bc0 +0x4062 0x8aac +0x4063 0x96ea +0x4064 0x7d76 +0x4065 0x820c +0x4066 0x8749 +0x4067 0x4ed9 +0x4068 0x5148 +0x4069 0x5343 +0x406a 0x5360 +0x406b 0x5ba3 +0x406c 0x5c02 +0x406d 0x5c16 +0x406e 0x5ddd +0x406f 0x6226 +0x4070 0x6247 +0x4071 0x64b0 +0x4072 0x6813 +0x4073 0x6834 +0x4074 0x6cc9 +0x4075 0x6d45 +0x4076 0x6d17 +0x4077 0x67d3 +0x4078 0x6f5c +0x4079 0x714e +0x407a 0x717d +0x407b 0x65cb +0x407c 0x7a7f +0x407d 0x7bad +0x407e 0x7dda +0x407f 0x3000 +0x4120 0x3000 +0x4121 0x7e4a +0x4122 0x7fa8 +0x4123 0x817a +0x4124 0x821b +0x4125 0x8239 +0x4126 0x85a6 +0x4127 0x8a6e +0x4128 0x8cce +0x4129 0x8df5 +0x412a 0x9078 +0x412b 0x9077 +0x412c 0x92ad +0x412d 0x9291 +0x412e 0x9583 +0x412f 0x9bae +0x4130 0x524d +0x4131 0x5584 +0x4132 0x6f38 +0x4133 0x7136 +0x4134 0x5168 +0x4135 0x7985 +0x4136 0x7e55 +0x4137 0x81b3 +0x4138 0x7cce +0x4139 0x564c +0x413a 0x5851 +0x413b 0x5ca8 +0x413c 0x63aa +0x413d 0x66fe +0x413e 0x66fd +0x413f 0x695a +0x4140 0x72d9 +0x4141 0x758f +0x4142 0x758e +0x4143 0x790e +0x4144 0x7956 +0x4145 0x79df +0x4146 0x7c97 +0x4147 0x7d20 +0x4148 0x7d44 +0x4149 0x8607 +0x414a 0x8a34 +0x414b 0x963b +0x414c 0x9061 +0x414d 0x9f20 +0x414e 0x50e7 +0x414f 0x5275 +0x4150 0x53cc +0x4151 0x53e2 +0x4152 0x5009 +0x4153 0x55aa +0x4154 0x58ee +0x4155 0x594f +0x4156 0x723d +0x4157 0x5b8b +0x4158 0x5c64 +0x4159 0x531d +0x415a 0x60e3 +0x415b 0x60f3 +0x415c 0x635c +0x415d 0x6383 +0x415e 0x633f +0x415f 0x63bb +0x4160 0x64cd +0x4161 0x65e9 +0x4162 0x66f9 +0x4163 0x5de3 +0x4164 0x69cd +0x4165 0x69fd +0x4166 0x6f15 +0x4167 0x71e5 +0x4168 0x4e89 +0x4169 0x75e9 +0x416a 0x76f8 +0x416b 0x7a93 +0x416c 0x7cdf +0x416d 0x7dcf +0x416e 0x7d9c +0x416f 0x8061 +0x4170 0x8349 +0x4171 0x8358 +0x4172 0x846c +0x4173 0x84bc +0x4174 0x85fb +0x4175 0x88c5 +0x4176 0x8d70 +0x4177 0x9001 +0x4178 0x906d +0x4179 0x9397 +0x417a 0x971c +0x417b 0x9a12 +0x417c 0x50cf +0x417d 0x5897 +0x417e 0x618e +0x417f 0x3000 +0x4220 0x3000 +0x4221 0x81d3 +0x4222 0x8535 +0x4223 0x8d08 +0x4224 0x9020 +0x4225 0x4fc3 +0x4226 0x5074 +0x4227 0x5247 +0x4228 0x5373 +0x4229 0x606f +0x422a 0x6349 +0x422b 0x675f +0x422c 0x6e2c +0x422d 0x8db3 +0x422e 0x901f +0x422f 0x4fd7 +0x4230 0x5c5e +0x4231 0x8cca +0x4232 0x65cf +0x4233 0x7d9a +0x4234 0x5352 +0x4235 0x8896 +0x4236 0x5176 +0x4237 0x63c3 +0x4238 0x5b58 +0x4239 0x5b6b +0x423a 0x5c0a +0x423b 0x640d +0x423c 0x6751 +0x423d 0x905c +0x423e 0x4ed6 +0x423f 0x591a +0x4240 0x592a +0x4241 0x6c70 +0x4242 0x8a51 +0x4243 0x553e +0x4244 0x5815 +0x4245 0x59a5 +0x4246 0x60f0 +0x4247 0x6253 +0x4248 0x67c1 +0x4249 0x8235 +0x424a 0x6955 +0x424b 0x9640 +0x424c 0x99c4 +0x424d 0x9a28 +0x424e 0x4f53 +0x424f 0x5806 +0x4250 0x5bfe +0x4251 0x8010 +0x4252 0x5cb1 +0x4253 0x5e2f +0x4254 0x5f85 +0x4255 0x6020 +0x4256 0x614b +0x4257 0x6234 +0x4258 0x66ff +0x4259 0x6cf0 +0x425a 0x6ede +0x425b 0x80ce +0x425c 0x817f +0x425d 0x82d4 +0x425e 0x888b +0x425f 0x8cb8 +0x4260 0x9000 +0x4261 0x902e +0x4262 0x968a +0x4263 0x9edb +0x4264 0x9bdb +0x4265 0x4ee3 +0x4266 0x53f0 +0x4267 0x5927 +0x4268 0x7b2c +0x4269 0x918d +0x426a 0x984c +0x426b 0x9df9 +0x426c 0x6edd +0x426d 0x7027 +0x426e 0x5353 +0x426f 0x5544 +0x4270 0x5b85 +0x4271 0x6258 +0x4272 0x629e +0x4273 0x62d3 +0x4274 0x6ca2 +0x4275 0x6fef +0x4276 0x7422 +0x4277 0x8a17 +0x4278 0x9438 +0x4279 0x6fc1 +0x427a 0x8afe +0x427b 0x8338 +0x427c 0x51e7 +0x427d 0x86f8 +0x427e 0x53ea +0x427f 0x3000 +0x4320 0x3000 +0x4321 0x53e9 +0x4322 0x4f46 +0x4323 0x9054 +0x4324 0x8fb0 +0x4325 0x596a +0x4326 0x8131 +0x4327 0x5dfd +0x4328 0x7aea +0x4329 0x8fbf +0x432a 0x68da +0x432b 0x8c37 +0x432c 0x72f8 +0x432d 0x9c48 +0x432e 0x6a3d +0x432f 0x8ab0 +0x4330 0x4e39 +0x4331 0x5358 +0x4332 0x5606 +0x4333 0x5766 +0x4334 0x62c5 +0x4335 0x63a2 +0x4336 0x65e6 +0x4337 0x6b4e +0x4338 0x6de1 +0x4339 0x6e5b +0x433a 0x70ad +0x433b 0x77ed +0x433c 0x7aef +0x433d 0x7baa +0x433e 0x7dbb +0x433f 0x803d +0x4340 0x80c6 +0x4341 0x86cb +0x4342 0x8a95 +0x4343 0x935b +0x4344 0x56e3 +0x4345 0x58c7 +0x4346 0x5f3e +0x4347 0x65ad +0x4348 0x6696 +0x4349 0x6a80 +0x434a 0x6bb5 +0x434b 0x7537 +0x434c 0x8ac7 +0x434d 0x5024 +0x434e 0x77e5 +0x434f 0x5730 +0x4350 0x5f1b +0x4351 0x6065 +0x4352 0x667a +0x4353 0x6c60 +0x4354 0x75f4 +0x4355 0x7a1a +0x4356 0x7f6e +0x4357 0x81f4 +0x4358 0x8718 +0x4359 0x9045 +0x435a 0x99b3 +0x435b 0x7bc9 +0x435c 0x755c +0x435d 0x7af9 +0x435e 0x7b51 +0x435f 0x84c4 +0x4360 0x9010 +0x4361 0x79e9 +0x4362 0x7a92 +0x4363 0x8336 +0x4364 0x5ae1 +0x4365 0x7740 +0x4366 0x4e2d +0x4367 0x4ef2 +0x4368 0x5b99 +0x4369 0x5fe0 +0x436a 0x62bd +0x436b 0x663c +0x436c 0x67f1 +0x436d 0x6ce8 +0x436e 0x866b +0x436f 0x8877 +0x4370 0x8a3b +0x4371 0x914e +0x4372 0x92f3 +0x4373 0x99d0 +0x4374 0x6a17 +0x4375 0x7026 +0x4376 0x732a +0x4377 0x82e7 +0x4378 0x8457 +0x4379 0x8caf +0x437a 0x4e01 +0x437b 0x5146 +0x437c 0x51cb +0x437d 0x558b +0x437e 0x5bf5 +0x437f 0x3000 +0x4420 0x3000 +0x4421 0x5e16 +0x4422 0x5e33 +0x4423 0x5e81 +0x4424 0x5f14 +0x4425 0x5f35 +0x4426 0x5f6b +0x4427 0x5fb4 +0x4428 0x61f2 +0x4429 0x6311 +0x442a 0x66a2 +0x442b 0x671d +0x442c 0x6f6e +0x442d 0x7252 +0x442e 0x753a +0x442f 0x773a +0x4430 0x8074 +0x4431 0x8139 +0x4432 0x8178 +0x4433 0x8776 +0x4434 0x8abf +0x4435 0x8adc +0x4436 0x8d85 +0x4437 0x8df3 +0x4438 0x929a +0x4439 0x9577 +0x443a 0x9802 +0x443b 0x9ce5 +0x443c 0x52c5 +0x443d 0x6357 +0x443e 0x76f4 +0x443f 0x6715 +0x4440 0x6c88 +0x4441 0x73cd +0x4442 0x8cc3 +0x4443 0x93ae +0x4444 0x9673 +0x4445 0x6d25 +0x4446 0x589c +0x4447 0x690e +0x4448 0x69cc +0x4449 0x8ffd +0x444a 0x939a +0x444b 0x75db +0x444c 0x901a +0x444d 0x585a +0x444e 0x6802 +0x444f 0x63b4 +0x4450 0x69fb +0x4451 0x4f43 +0x4452 0x6f2c +0x4453 0x67d8 +0x4454 0x8fbb +0x4455 0x8526 +0x4456 0x7db4 +0x4457 0x9354 +0x4458 0x693f +0x4459 0x6f70 +0x445a 0x576a +0x445b 0x58f7 +0x445c 0x5b2c +0x445d 0x7d2c +0x445e 0x722a +0x445f 0x540a +0x4460 0x91e3 +0x4461 0x9db4 +0x4462 0x4ead +0x4463 0x4f4e +0x4464 0x505c +0x4465 0x5075 +0x4466 0x5243 +0x4467 0x8c9e +0x4468 0x5448 +0x4469 0x5824 +0x446a 0x5b9a +0x446b 0x5e1d +0x446c 0x5e95 +0x446d 0x5ead +0x446e 0x5ef7 +0x446f 0x5f1f +0x4470 0x608c +0x4471 0x62b5 +0x4472 0x633a +0x4473 0x63d0 +0x4474 0x68af +0x4475 0x6c40 +0x4476 0x7887 +0x4477 0x798e +0x4478 0x7a0b +0x4479 0x7de0 +0x447a 0x8247 +0x447b 0x8a02 +0x447c 0x8ae6 +0x447d 0x8e44 +0x447e 0x9013 +0x447f 0x3000 +0x4520 0x3000 +0x4521 0x90b8 +0x4522 0x912d +0x4523 0x91d8 +0x4524 0x9f0e +0x4525 0x6ce5 +0x4526 0x6458 +0x4527 0x64e2 +0x4528 0x6575 +0x4529 0x6ef4 +0x452a 0x7684 +0x452b 0x7b1b +0x452c 0x9069 +0x452d 0x93d1 +0x452e 0x6eba +0x452f 0x54f2 +0x4530 0x5fb9 +0x4531 0x64a4 +0x4532 0x8f4d +0x4533 0x8fed +0x4534 0x9244 +0x4535 0x5178 +0x4536 0x586b +0x4537 0x5929 +0x4538 0x5c55 +0x4539 0x5e97 +0x453a 0x6dfb +0x453b 0x7e8f +0x453c 0x751c +0x453d 0x8cbc +0x453e 0x8ee2 +0x453f 0x985b +0x4540 0x70b9 +0x4541 0x4f1d +0x4542 0x6bbf +0x4543 0x6fb1 +0x4544 0x7530 +0x4545 0x96fb +0x4546 0x514e +0x4547 0x5410 +0x4548 0x5835 +0x4549 0x5857 +0x454a 0x59ac +0x454b 0x5c60 +0x454c 0x5f92 +0x454d 0x6597 +0x454e 0x675c +0x454f 0x6e21 +0x4550 0x767b +0x4551 0x83df +0x4552 0x8ced +0x4553 0x9014 +0x4554 0x90fd +0x4555 0x934d +0x4556 0x7825 +0x4557 0x783a +0x4558 0x52aa +0x4559 0x5ea6 +0x455a 0x571f +0x455b 0x5974 +0x455c 0x6012 +0x455d 0x5012 +0x455e 0x515a +0x455f 0x51ac +0x4560 0x51cd +0x4561 0x5200 +0x4562 0x5510 +0x4563 0x5854 +0x4564 0x5858 +0x4565 0x5957 +0x4566 0x5b95 +0x4567 0x5cf6 +0x4568 0x5d8b +0x4569 0x60bc +0x456a 0x6295 +0x456b 0x642d +0x456c 0x6771 +0x456d 0x6843 +0x456e 0x68bc +0x456f 0x68df +0x4570 0x76d7 +0x4571 0x6dd8 +0x4572 0x6e6f +0x4573 0x6d9b +0x4574 0x706f +0x4575 0x71c8 +0x4576 0x5f53 +0x4577 0x75d8 +0x4578 0x7977 +0x4579 0x7b49 +0x457a 0x7b54 +0x457b 0x7b52 +0x457c 0x7cd6 +0x457d 0x7d71 +0x457e 0x5230 +0x457f 0x3000 +0x4620 0x3000 +0x4621 0x8463 +0x4622 0x8569 +0x4623 0x85e4 +0x4624 0x8a0e +0x4625 0x8b04 +0x4626 0x8c46 +0x4627 0x8e0f +0x4628 0x9003 +0x4629 0x900f +0x462a 0x9419 +0x462b 0x9676 +0x462c 0x982d +0x462d 0x9a30 +0x462e 0x95d8 +0x462f 0x50cd +0x4630 0x52d5 +0x4631 0x540c +0x4632 0x5802 +0x4633 0x5c0e +0x4634 0x61a7 +0x4635 0x649e +0x4636 0x6d1e +0x4637 0x77b3 +0x4638 0x7ae5 +0x4639 0x80f4 +0x463a 0x8404 +0x463b 0x9053 +0x463c 0x9285 +0x463d 0x5ce0 +0x463e 0x9d07 +0x463f 0x533f +0x4640 0x5f97 +0x4641 0x5fb3 +0x4642 0x6d9c +0x4643 0x7279 +0x4644 0x7763 +0x4645 0x79bf +0x4646 0x7be4 +0x4647 0x6bd2 +0x4648 0x72ec +0x4649 0x8aad +0x464a 0x6803 +0x464b 0x6a61 +0x464c 0x51f8 +0x464d 0x7a81 +0x464e 0x6934 +0x464f 0x5c4a +0x4650 0x9cf6 +0x4651 0x82eb +0x4652 0x5bc5 +0x4653 0x9149 +0x4654 0x701e +0x4655 0x5678 +0x4656 0x5c6f +0x4657 0x60c7 +0x4658 0x6566 +0x4659 0x6c8c +0x465a 0x8c5a +0x465b 0x9041 +0x465c 0x9813 +0x465d 0x5451 +0x465e 0x66c7 +0x465f 0x920d +0x4660 0x5948 +0x4661 0x90a3 +0x4662 0x5185 +0x4663 0x4e4d +0x4664 0x51ea +0x4665 0x8599 +0x4666 0x8b0e +0x4667 0x7058 +0x4668 0x637a +0x4669 0x934b +0x466a 0x6962 +0x466b 0x99b4 +0x466c 0x7e04 +0x466d 0x7577 +0x466e 0x5357 +0x466f 0x6960 +0x4670 0x8edf +0x4671 0x96e3 +0x4672 0x6c5d +0x4673 0x4e8c +0x4674 0x5c3c +0x4675 0x5f10 +0x4676 0x8fe9 +0x4677 0x5302 +0x4678 0x8cd1 +0x4679 0x8089 +0x467a 0x8679 +0x467b 0x5eff +0x467c 0x65e5 +0x467d 0x4e73 +0x467e 0x5165 +0x467f 0x3000 +0x4720 0x3000 +0x4721 0x5982 +0x4722 0x5c3f +0x4723 0x97ee +0x4724 0x4efb +0x4725 0x598a +0x4726 0x5fcd +0x4727 0x8a8d +0x4728 0x6fe1 +0x4729 0x79b0 +0x472a 0x7962 +0x472b 0x5be7 +0x472c 0x8471 +0x472d 0x732b +0x472e 0x71b1 +0x472f 0x5e74 +0x4730 0x5ff5 +0x4731 0x637b +0x4732 0x649a +0x4733 0x71c3 +0x4734 0x7c98 +0x4735 0x4e43 +0x4736 0x5efc +0x4737 0x4e4b +0x4738 0x57dc +0x4739 0x56a2 +0x473a 0x60a9 +0x473b 0x6fc3 +0x473c 0x7d0d +0x473d 0x80fd +0x473e 0x8133 +0x473f 0x81bf +0x4740 0x8fb2 +0x4741 0x8997 +0x4742 0x86a4 +0x4743 0x5df4 +0x4744 0x628a +0x4745 0x64ad +0x4746 0x8987 +0x4747 0x6777 +0x4748 0x6ce2 +0x4749 0x6d3e +0x474a 0x7436 +0x474b 0x7834 +0x474c 0x5a46 +0x474d 0x7f75 +0x474e 0x82ad +0x474f 0x99ac +0x4750 0x4ff3 +0x4751 0x5ec3 +0x4752 0x62dd +0x4753 0x6392 +0x4754 0x6557 +0x4755 0x676f +0x4756 0x76c3 +0x4757 0x724c +0x4758 0x80cc +0x4759 0x80ba +0x475a 0x8f29 +0x475b 0x914d +0x475c 0x500d +0x475d 0x57f9 +0x475e 0x5a92 +0x475f 0x6885 +0x4760 0x6973 +0x4761 0x7164 +0x4762 0x72fd +0x4763 0x8cb7 +0x4764 0x58f2 +0x4765 0x8ce0 +0x4766 0x966a +0x4767 0x9019 +0x4768 0x877f +0x4769 0x79e4 +0x476a 0x77e7 +0x476b 0x8429 +0x476c 0x4f2f +0x476d 0x5265 +0x476e 0x535a +0x476f 0x62cd +0x4770 0x67cf +0x4771 0x6cca +0x4772 0x767d +0x4773 0x7b94 +0x4774 0x7c95 +0x4775 0x8236 +0x4776 0x8584 +0x4777 0x8feb +0x4778 0x66dd +0x4779 0x6f20 +0x477a 0x7206 +0x477b 0x7e1b +0x477c 0x83ab +0x477d 0x99c1 +0x477e 0x9ea6 +0x477f 0x3000 +0x4820 0x3000 +0x4821 0x51fd +0x4822 0x7bb1 +0x4823 0x7872 +0x4824 0x7bb8 +0x4825 0x8087 +0x4826 0x7b48 +0x4827 0x6ae8 +0x4828 0x5e61 +0x4829 0x808c +0x482a 0x7551 +0x482b 0x7560 +0x482c 0x516b +0x482d 0x9262 +0x482e 0x6e8c +0x482f 0x767a +0x4830 0x9197 +0x4831 0x9aea +0x4832 0x4f10 +0x4833 0x7f70 +0x4834 0x629c +0x4835 0x7b4f +0x4836 0x95a5 +0x4837 0x9ce9 +0x4838 0x567a +0x4839 0x5859 +0x483a 0x86e4 +0x483b 0x96bc +0x483c 0x4f34 +0x483d 0x5224 +0x483e 0x534a +0x483f 0x53cd +0x4840 0x53db +0x4841 0x5e06 +0x4842 0x642c +0x4843 0x6591 +0x4844 0x677f +0x4845 0x6c3e +0x4846 0x6c4e +0x4847 0x7248 +0x4848 0x72af +0x4849 0x73ed +0x484a 0x7554 +0x484b 0x7e41 +0x484c 0x822c +0x484d 0x85e9 +0x484e 0x8ca9 +0x484f 0x7bc4 +0x4850 0x91c6 +0x4851 0x7169 +0x4852 0x9812 +0x4853 0x98ef +0x4854 0x633d +0x4855 0x6669 +0x4856 0x756a +0x4857 0x76e4 +0x4858 0x78d0 +0x4859 0x8543 +0x485a 0x86ee +0x485b 0x532a +0x485c 0x5351 +0x485d 0x5426 +0x485e 0x5983 +0x485f 0x5e87 +0x4860 0x5f7c +0x4861 0x60b2 +0x4862 0x6249 +0x4863 0x6279 +0x4864 0x62ab +0x4865 0x6590 +0x4866 0x6bd4 +0x4867 0x6ccc +0x4868 0x75b2 +0x4869 0x76ae +0x486a 0x7891 +0x486b 0x79d8 +0x486c 0x7dcb +0x486d 0x7f77 +0x486e 0x80a5 +0x486f 0x88ab +0x4870 0x8ab9 +0x4871 0x8cbb +0x4872 0x907f +0x4873 0x975e +0x4874 0x98db +0x4875 0x6a0b +0x4876 0x7c38 +0x4877 0x5099 +0x4878 0x5c3e +0x4879 0x5fae +0x487a 0x6787 +0x487b 0x6bd8 +0x487c 0x7435 +0x487d 0x7709 +0x487e 0x7f8e +0x487f 0x3000 +0x4920 0x3000 +0x4921 0x9f3b +0x4922 0x67ca +0x4923 0x7a17 +0x4924 0x5339 +0x4925 0x758b +0x4926 0x9aed +0x4927 0x5f66 +0x4928 0x819d +0x4929 0x83f1 +0x492a 0x8098 +0x492b 0x5f3c +0x492c 0x5fc5 +0x492d 0x7562 +0x492e 0x7b46 +0x492f 0x903c +0x4930 0x6867 +0x4931 0x59eb +0x4932 0x5a9b +0x4933 0x7d10 +0x4934 0x767e +0x4935 0x8b2c +0x4936 0x4ff5 +0x4937 0x5f6a +0x4938 0x6a19 +0x4939 0x6c37 +0x493a 0x6f02 +0x493b 0x74e2 +0x493c 0x7968 +0x493d 0x8868 +0x493e 0x8a55 +0x493f 0x8c79 +0x4940 0x5edf +0x4941 0x63cf +0x4942 0x75c5 +0x4943 0x79d2 +0x4944 0x82d7 +0x4945 0x9328 +0x4946 0x92f2 +0x4947 0x849c +0x4948 0x86ed +0x4949 0x9c2d +0x494a 0x54c1 +0x494b 0x5f6c +0x494c 0x658c +0x494d 0x6d5c +0x494e 0x7015 +0x494f 0x8ca7 +0x4950 0x8cd3 +0x4951 0x983b +0x4952 0x654f +0x4953 0x74f6 +0x4954 0x4e0d +0x4955 0x4ed8 +0x4956 0x57e0 +0x4957 0x592b +0x4958 0x5a66 +0x4959 0x5bcc +0x495a 0x51a8 +0x495b 0x5e03 +0x495c 0x5e9c +0x495d 0x6016 +0x495e 0x6276 +0x495f 0x6577 +0x4960 0x65a7 +0x4961 0x666e +0x4962 0x6d6e +0x4963 0x7236 +0x4964 0x7b26 +0x4965 0x8150 +0x4966 0x819a +0x4967 0x8299 +0x4968 0x8b5c +0x4969 0x8ca0 +0x496a 0x8ce6 +0x496b 0x8d74 +0x496c 0x961c +0x496d 0x9644 +0x496e 0x4fae +0x496f 0x64ab +0x4970 0x6b66 +0x4971 0x821e +0x4972 0x8461 +0x4973 0x856a +0x4974 0x90e8 +0x4975 0x5c01 +0x4976 0x6953 +0x4977 0x98a8 +0x4978 0x847a +0x4979 0x8557 +0x497a 0x4f0f +0x497b 0x526f +0x497c 0x5fa9 +0x497d 0x5e45 +0x497e 0x670d +0x497f 0x3000 +0x4a20 0x3000 +0x4a21 0x798f +0x4a22 0x8179 +0x4a23 0x8907 +0x4a24 0x8986 +0x4a25 0x6df5 +0x4a26 0x5f17 +0x4a27 0x6255 +0x4a28 0x6cb8 +0x4a29 0x4ecf +0x4a2a 0x7269 +0x4a2b 0x9b92 +0x4a2c 0x5206 +0x4a2d 0x543b +0x4a2e 0x5674 +0x4a2f 0x58b3 +0x4a30 0x61a4 +0x4a31 0x626e +0x4a32 0x711a +0x4a33 0x596e +0x4a34 0x7c89 +0x4a35 0x7cde +0x4a36 0x7d1b +0x4a37 0x96f0 +0x4a38 0x6587 +0x4a39 0x805e +0x4a3a 0x4e19 +0x4a3b 0x4f75 +0x4a3c 0x5175 +0x4a3d 0x5840 +0x4a3e 0x5e63 +0x4a3f 0x5e73 +0x4a40 0x5f0a +0x4a41 0x67c4 +0x4a42 0x4e26 +0x4a43 0x853d +0x4a44 0x9589 +0x4a45 0x965b +0x4a46 0x7c73 +0x4a47 0x9801 +0x4a48 0x50fb +0x4a49 0x58c1 +0x4a4a 0x7656 +0x4a4b 0x78a7 +0x4a4c 0x5225 +0x4a4d 0x77a5 +0x4a4e 0x8511 +0x4a4f 0x7b86 +0x4a50 0x504f +0x4a51 0x5909 +0x4a52 0x7247 +0x4a53 0x7bc7 +0x4a54 0x7de8 +0x4a55 0x8fba +0x4a56 0x8fd4 +0x4a57 0x904d +0x4a58 0x4fbf +0x4a59 0x52c9 +0x4a5a 0x5a29 +0x4a5b 0x5f01 +0x4a5c 0x97ad +0x4a5d 0x4fdd +0x4a5e 0x8217 +0x4a5f 0x92ea +0x4a60 0x5703 +0x4a61 0x6355 +0x4a62 0x6b69 +0x4a63 0x752b +0x4a64 0x88dc +0x4a65 0x8f14 +0x4a66 0x7a42 +0x4a67 0x52df +0x4a68 0x5893 +0x4a69 0x6155 +0x4a6a 0x620a +0x4a6b 0x66ae +0x4a6c 0x6bcd +0x4a6d 0x7c3f +0x4a6e 0x83e9 +0x4a6f 0x5023 +0x4a70 0x4ff8 +0x4a71 0x5305 +0x4a72 0x5446 +0x4a73 0x5831 +0x4a74 0x5949 +0x4a75 0x5b9d +0x4a76 0x5cf0 +0x4a77 0x5cef +0x4a78 0x5d29 +0x4a79 0x5e96 +0x4a7a 0x62b1 +0x4a7b 0x6367 +0x4a7c 0x653e +0x4a7d 0x65b9 +0x4a7e 0x670b +0x4a7f 0x3000 +0x4b20 0x3000 +0x4b21 0x6cd5 +0x4b22 0x6ce1 +0x4b23 0x70f9 +0x4b24 0x7832 +0x4b25 0x7e2b +0x4b26 0x80de +0x4b27 0x82b3 +0x4b28 0x840c +0x4b29 0x84ec +0x4b2a 0x8702 +0x4b2b 0x8912 +0x4b2c 0x8a2a +0x4b2d 0x8c4a +0x4b2e 0x90a6 +0x4b2f 0x92d2 +0x4b30 0x98fd +0x4b31 0x9cf3 +0x4b32 0x9d6c +0x4b33 0x4e4f +0x4b34 0x4ea1 +0x4b35 0x508d +0x4b36 0x5256 +0x4b37 0x574a +0x4b38 0x59a8 +0x4b39 0x5e3d +0x4b3a 0x5fd8 +0x4b3b 0x5fd9 +0x4b3c 0x623f +0x4b3d 0x66b4 +0x4b3e 0x671b +0x4b3f 0x67d0 +0x4b40 0x68d2 +0x4b41 0x5192 +0x4b42 0x7d21 +0x4b43 0x80aa +0x4b44 0x81a8 +0x4b45 0x8b00 +0x4b46 0x8c8c +0x4b47 0x8cbf +0x4b48 0x927e +0x4b49 0x9632 +0x4b4a 0x5420 +0x4b4b 0x982c +0x4b4c 0x5317 +0x4b4d 0x50d5 +0x4b4e 0x535c +0x4b4f 0x58a8 +0x4b50 0x64b2 +0x4b51 0x6734 +0x4b52 0x7267 +0x4b53 0x7766 +0x4b54 0x7a46 +0x4b55 0x91e6 +0x4b56 0x52c3 +0x4b57 0x6ca1 +0x4b58 0x6b86 +0x4b59 0x5800 +0x4b5a 0x5e4c +0x4b5b 0x5954 +0x4b5c 0x672c +0x4b5d 0x7ffb +0x4b5e 0x51e1 +0x4b5f 0x76c6 +0x4b60 0x6469 +0x4b61 0x78e8 +0x4b62 0x9b54 +0x4b63 0x9ebb +0x4b64 0x57cb +0x4b65 0x59b9 +0x4b66 0x6627 +0x4b67 0x679a +0x4b68 0x6bce +0x4b69 0x54e9 +0x4b6a 0x69d9 +0x4b6b 0x5e55 +0x4b6c 0x819c +0x4b6d 0x6795 +0x4b6e 0x9baa +0x4b6f 0x67fe +0x4b70 0x9c52 +0x4b71 0x685d +0x4b72 0x4ea6 +0x4b73 0x4fe3 +0x4b74 0x53c8 +0x4b75 0x62b9 +0x4b76 0x672b +0x4b77 0x6cab +0x4b78 0x8fc4 +0x4b79 0x4fad +0x4b7a 0x7e6d +0x4b7b 0x9ebf +0x4b7c 0x4e07 +0x4b7d 0x6162 +0x4b7e 0x6e80 +0x4b7f 0x3000 +0x4c20 0x3000 +0x4c21 0x6f2b +0x4c22 0x8513 +0x4c23 0x5473 +0x4c24 0x672a +0x4c25 0x9b45 +0x4c26 0x5df3 +0x4c27 0x7b95 +0x4c28 0x5cac +0x4c29 0x5bc6 +0x4c2a 0x871c +0x4c2b 0x6e4a +0x4c2c 0x84d1 +0x4c2d 0x7a14 +0x4c2e 0x8108 +0x4c2f 0x5999 +0x4c30 0x7c8d +0x4c31 0x6c11 +0x4c32 0x7720 +0x4c33 0x52d9 +0x4c34 0x5922 +0x4c35 0x7121 +0x4c36 0x725f +0x4c37 0x77db +0x4c38 0x9727 +0x4c39 0x9d61 +0x4c3a 0x690b +0x4c3b 0x5a7f +0x4c3c 0x5a18 +0x4c3d 0x51a5 +0x4c3e 0x540d +0x4c3f 0x547d +0x4c40 0x660e +0x4c41 0x76df +0x4c42 0x8ff7 +0x4c43 0x9298 +0x4c44 0x9cf4 +0x4c45 0x59ea +0x4c46 0x725d +0x4c47 0x6ec5 +0x4c48 0x514d +0x4c49 0x68c9 +0x4c4a 0x7dbf +0x4c4b 0x7dec +0x4c4c 0x9762 +0x4c4d 0x9eba +0x4c4e 0x6478 +0x4c4f 0x6a21 +0x4c50 0x8302 +0x4c51 0x5984 +0x4c52 0x5b5f +0x4c53 0x6bdb +0x4c54 0x731b +0x4c55 0x76f2 +0x4c56 0x7db2 +0x4c57 0x8017 +0x4c58 0x8499 +0x4c59 0x5132 +0x4c5a 0x6728 +0x4c5b 0x9ed9 +0x4c5c 0x76ee +0x4c5d 0x6762 +0x4c5e 0x52ff +0x4c5f 0x9905 +0x4c60 0x5c24 +0x4c61 0x623b +0x4c62 0x7c7e +0x4c63 0x8cb0 +0x4c64 0x554f +0x4c65 0x60b6 +0x4c66 0x7d0b +0x4c67 0x9580 +0x4c68 0x5301 +0x4c69 0x4e5f +0x4c6a 0x51b6 +0x4c6b 0x591c +0x4c6c 0x723a +0x4c6d 0x8036 +0x4c6e 0x91ce +0x4c6f 0x5f25 +0x4c70 0x77e2 +0x4c71 0x5384 +0x4c72 0x5f79 +0x4c73 0x7d04 +0x4c74 0x85ac +0x4c75 0x8a33 +0x4c76 0x8e8d +0x4c77 0x9756 +0x4c78 0x67f3 +0x4c79 0x85ae +0x4c7a 0x9453 +0x4c7b 0x6109 +0x4c7c 0x6108 +0x4c7d 0x6cb9 +0x4c7e 0x7652 +0x4c7f 0x3000 +0x4d20 0x3000 +0x4d21 0x8aed +0x4d22 0x8f38 +0x4d23 0x552f +0x4d24 0x4f51 +0x4d25 0x512a +0x4d26 0x52c7 +0x4d27 0x53cb +0x4d28 0x5ba5 +0x4d29 0x5e7d +0x4d2a 0x60a0 +0x4d2b 0x6182 +0x4d2c 0x63d6 +0x4d2d 0x6709 +0x4d2e 0x67da +0x4d2f 0x6e67 +0x4d30 0x6d8c +0x4d31 0x7336 +0x4d32 0x7337 +0x4d33 0x7531 +0x4d34 0x7950 +0x4d35 0x88d5 +0x4d36 0x8a98 +0x4d37 0x904a +0x4d38 0x9091 +0x4d39 0x90f5 +0x4d3a 0x96c4 +0x4d3b 0x878d +0x4d3c 0x5915 +0x4d3d 0x4e88 +0x4d3e 0x4f59 +0x4d3f 0x4e0e +0x4d40 0x8a89 +0x4d41 0x8f3f +0x4d42 0x9810 +0x4d43 0x50ad +0x4d44 0x5e7c +0x4d45 0x5996 +0x4d46 0x5bb9 +0x4d47 0x5eb8 +0x4d48 0x63da +0x4d49 0x63fa +0x4d4a 0x64c1 +0x4d4b 0x66dc +0x4d4c 0x694a +0x4d4d 0x69d8 +0x4d4e 0x6d0b +0x4d4f 0x6eb6 +0x4d50 0x7194 +0x4d51 0x7528 +0x4d52 0x7aaf +0x4d53 0x7f8a +0x4d54 0x8000 +0x4d55 0x8449 +0x4d56 0x84c9 +0x4d57 0x8981 +0x4d58 0x8b21 +0x4d59 0x8e0a +0x4d5a 0x9065 +0x4d5b 0x967d +0x4d5c 0x990a +0x4d5d 0x617e +0x4d5e 0x6291 +0x4d5f 0x6b32 +0x4d60 0x6c83 +0x4d61 0x6d74 +0x4d62 0x7fcc +0x4d63 0x7ffc +0x4d64 0x6dc0 +0x4d65 0x7f85 +0x4d66 0x87ba +0x4d67 0x88f8 +0x4d68 0x6765 +0x4d69 0x83b1 +0x4d6a 0x983c +0x4d6b 0x96f7 +0x4d6c 0x6d1b +0x4d6d 0x7d61 +0x4d6e 0x843d +0x4d6f 0x916a +0x4d70 0x4e71 +0x4d71 0x5375 +0x4d72 0x5d50 +0x4d73 0x6b04 +0x4d74 0x6feb +0x4d75 0x85cd +0x4d76 0x862d +0x4d77 0x89a7 +0x4d78 0x5229 +0x4d79 0x540f +0x4d7a 0x5c65 +0x4d7b 0x674e +0x4d7c 0x68a8 +0x4d7d 0x7406 +0x4d7e 0x7483 +0x4d7f 0x3000 +0x4e20 0x3000 +0x4e21 0x75e2 +0x4e22 0x88cf +0x4e23 0x88e1 +0x4e24 0x91cc +0x4e25 0x96e2 +0x4e26 0x9678 +0x4e27 0x5f8b +0x4e28 0x7387 +0x4e29 0x7acb +0x4e2a 0x844e +0x4e2b 0x63a0 +0x4e2c 0x7565 +0x4e2d 0x5289 +0x4e2e 0x6d41 +0x4e2f 0x6e9c +0x4e30 0x7409 +0x4e31 0x7559 +0x4e32 0x786b +0x4e33 0x7c92 +0x4e34 0x9686 +0x4e35 0x7adc +0x4e36 0x9f8d +0x4e37 0x4fb6 +0x4e38 0x616e +0x4e39 0x65c5 +0x4e3a 0x865c +0x4e3b 0x4e86 +0x4e3c 0x4eae +0x4e3d 0x50da +0x4e3e 0x4e21 +0x4e3f 0x51cc +0x4e40 0x5bee +0x4e41 0x6599 +0x4e42 0x6881 +0x4e43 0x6dbc +0x4e44 0x731f +0x4e45 0x7642 +0x4e46 0x77ad +0x4e47 0x7a1c +0x4e48 0x7ce7 +0x4e49 0x826f +0x4e4a 0x8ad2 +0x4e4b 0x907c +0x4e4c 0x91cf +0x4e4d 0x9675 +0x4e4e 0x9818 +0x4e4f 0x529b +0x4e50 0x7dd1 +0x4e51 0x502b +0x4e52 0x5398 +0x4e53 0x6797 +0x4e54 0x6dcb +0x4e55 0x71d0 +0x4e56 0x7433 +0x4e57 0x81e8 +0x4e58 0x8f2a +0x4e59 0x96a3 +0x4e5a 0x9c57 +0x4e5b 0x9e9f +0x4e5c 0x7460 +0x4e5d 0x5841 +0x4e5e 0x6d99 +0x4e5f 0x7d2f +0x4e60 0x985e +0x4e61 0x4ee4 +0x4e62 0x4f36 +0x4e63 0x4f8b +0x4e64 0x51b7 +0x4e65 0x52b1 +0x4e66 0x5dba +0x4e67 0x601c +0x4e68 0x73b2 +0x4e69 0x793c +0x4e6a 0x82d3 +0x4e6b 0x9234 +0x4e6c 0x96b7 +0x4e6d 0x96f6 +0x4e6e 0x970a +0x4e6f 0x9e97 +0x4e70 0x9f62 +0x4e71 0x66a6 +0x4e72 0x6b74 +0x4e73 0x5217 +0x4e74 0x52a3 +0x4e75 0x70c8 +0x4e76 0x88c2 +0x4e77 0x5ec9 +0x4e78 0x604b +0x4e79 0x6190 +0x4e7a 0x6f23 +0x4e7b 0x7149 +0x4e7c 0x7c3e +0x4e7d 0x7df4 +0x4e7e 0x806f +0x4e7f 0x3000 +0x4f20 0x3000 +0x4f21 0x84ee +0x4f22 0x9023 +0x4f23 0x932c +0x4f24 0x5442 +0x4f25 0x9b6f +0x4f26 0x6ad3 +0x4f27 0x7089 +0x4f28 0x8cc2 +0x4f29 0x8def +0x4f2a 0x9732 +0x4f2b 0x52b4 +0x4f2c 0x5a41 +0x4f2d 0x5eca +0x4f2e 0x5f04 +0x4f2f 0x6717 +0x4f30 0x697c +0x4f31 0x6994 +0x4f32 0x6d6a +0x4f33 0x6f0f +0x4f34 0x7262 +0x4f35 0x72fc +0x4f36 0x7bed +0x4f37 0x8001 +0x4f38 0x807e +0x4f39 0x874b +0x4f3a 0x90ce +0x4f3b 0x516d +0x4f3c 0x9e93 +0x4f3d 0x7984 +0x4f3e 0x808b +0x4f3f 0x9332 +0x4f40 0x8ad6 +0x4f41 0x502d +0x4f42 0x548c +0x4f43 0x8a71 +0x4f44 0x6b6a +0x4f45 0x8cc4 +0x4f46 0x8107 +0x4f47 0x60d1 +0x4f48 0x67a0 +0x4f49 0x9df2 +0x4f4a 0x4e99 +0x4f4b 0x4e98 +0x4f4c 0x9c10 +0x4f4d 0x8a6b +0x4f4e 0x85c1 +0x4f4f 0x8568 +0x4f50 0x6900 +0x4f51 0x6e7e +0x4f52 0x7897 +0x4f53 0x8155 +0x4f54 0x3000 +0x4f55 0x3000 +0x4f56 0x3000 +0x4f57 0x3000 +0x4f58 0x3000 +0x4f59 0x3000 +0x4f5a 0x3000 +0x4f5b 0x3000 +0x4f5c 0x3000 +0x4f5d 0x3000 +0x4f5e 0x3000 +0x4f5f 0x3000 +0x4f60 0x3000 +0x4f61 0x3000 +0x4f62 0x3000 +0x4f63 0x3000 +0x4f64 0x3000 +0x4f65 0x3000 +0x4f66 0x3000 +0x4f67 0x3000 +0x4f68 0x3000 +0x4f69 0x3000 +0x4f6a 0x3000 +0x4f6b 0x3000 +0x4f6c 0x3000 +0x4f6d 0x3000 +0x4f6e 0x3000 +0x4f6f 0x3000 +0x4f70 0x3000 +0x4f71 0x3000 +0x4f72 0x3000 +0x4f73 0x3000 +0x4f74 0x3000 +0x4f75 0x3000 +0x4f76 0x3000 +0x4f77 0x3000 +0x4f78 0x3000 +0x4f79 0x3000 +0x4f7a 0x3000 +0x4f7b 0x3000 +0x4f7c 0x3000 +0x4f7d 0x3000 +0x4f7e 0x3000 +0x4f7f 0x3000 +0x5020 0x3000 +0x5021 0x5f0c +0x5022 0x4e10 +0x5023 0x4e15 +0x5024 0x4e2a +0x5025 0x4e31 +0x5026 0x4e36 +0x5027 0x4e3c +0x5028 0x4e3f +0x5029 0x4e42 +0x502a 0x4e56 +0x502b 0x4e58 +0x502c 0x4e82 +0x502d 0x4e85 +0x502e 0x8c6b +0x502f 0x4e8a +0x5030 0x8212 +0x5031 0x5f0d +0x5032 0x4e8e +0x5033 0x4e9e +0x5034 0x4e9f +0x5035 0x4ea0 +0x5036 0x4ea2 +0x5037 0x4eb0 +0x5038 0x4eb3 +0x5039 0x4eb6 +0x503a 0x4ece +0x503b 0x4ecd +0x503c 0x4ec4 +0x503d 0x4ec6 +0x503e 0x4ec2 +0x503f 0x4ed7 +0x5040 0x4ede +0x5041 0x4eed +0x5042 0x4edf +0x5043 0x4ef7 +0x5044 0x4f09 +0x5045 0x4f5a +0x5046 0x4f30 +0x5047 0x4f5b +0x5048 0x4f5d +0x5049 0x4f57 +0x504a 0x4f47 +0x504b 0x4f76 +0x504c 0x4f88 +0x504d 0x4f8f +0x504e 0x4f98 +0x504f 0x4f7b +0x5050 0x4f69 +0x5051 0x4f70 +0x5052 0x4f91 +0x5053 0x4f6f +0x5054 0x4f86 +0x5055 0x4f96 +0x5056 0x5118 +0x5057 0x4fd4 +0x5058 0x4fdf +0x5059 0x4fce +0x505a 0x4fd8 +0x505b 0x4fdb +0x505c 0x4fd1 +0x505d 0x4fda +0x505e 0x4fd0 +0x505f 0x4fe4 +0x5060 0x4fe5 +0x5061 0x501a +0x5062 0x5028 +0x5063 0x5014 +0x5064 0x502a +0x5065 0x5025 +0x5066 0x5005 +0x5067 0x4f1c +0x5068 0x4ff6 +0x5069 0x5021 +0x506a 0x5029 +0x506b 0x502c +0x506c 0x4ffe +0x506d 0x4fef +0x506e 0x5011 +0x506f 0x5006 +0x5070 0x5043 +0x5071 0x5047 +0x5072 0x6703 +0x5073 0x5055 +0x5074 0x5050 +0x5075 0x5048 +0x5076 0x505a +0x5077 0x5056 +0x5078 0x506c +0x5079 0x5078 +0x507a 0x5080 +0x507b 0x509a +0x507c 0x5085 +0x507d 0x50b4 +0x507e 0x50b2 +0x507f 0x3000 +0x5120 0x3000 +0x5121 0x50c9 +0x5122 0x50ca +0x5123 0x50b3 +0x5124 0x50c2 +0x5125 0x50d6 +0x5126 0x50de +0x5127 0x50e5 +0x5128 0x50ed +0x5129 0x50e3 +0x512a 0x50ee +0x512b 0x50f9 +0x512c 0x50f5 +0x512d 0x5109 +0x512e 0x5101 +0x512f 0x5102 +0x5130 0x5116 +0x5131 0x5115 +0x5132 0x5114 +0x5133 0x511a +0x5134 0x5121 +0x5135 0x513a +0x5136 0x5137 +0x5137 0x513c +0x5138 0x513b +0x5139 0x513f +0x513a 0x5140 +0x513b 0x5152 +0x513c 0x514c +0x513d 0x5154 +0x513e 0x5162 +0x513f 0x7af8 +0x5140 0x5169 +0x5141 0x516a +0x5142 0x516e +0x5143 0x5180 +0x5144 0x5182 +0x5145 0x56d8 +0x5146 0x518c +0x5147 0x5189 +0x5148 0x518f +0x5149 0x5191 +0x514a 0x5193 +0x514b 0x5195 +0x514c 0x5196 +0x514d 0x51a4 +0x514e 0x51a6 +0x514f 0x51a2 +0x5150 0x51a9 +0x5151 0x51aa +0x5152 0x51ab +0x5153 0x51b3 +0x5154 0x51b1 +0x5155 0x51b2 +0x5156 0x51b0 +0x5157 0x51b5 +0x5158 0x51bd +0x5159 0x51c5 +0x515a 0x51c9 +0x515b 0x51db +0x515c 0x51e0 +0x515d 0x8655 +0x515e 0x51e9 +0x515f 0x51ed +0x5160 0x51f0 +0x5161 0x51f5 +0x5162 0x51fe +0x5163 0x5204 +0x5164 0x520b +0x5165 0x5214 +0x5166 0x520e +0x5167 0x5227 +0x5168 0x522a +0x5169 0x522e +0x516a 0x5233 +0x516b 0x5239 +0x516c 0x524f +0x516d 0x5244 +0x516e 0x524b +0x516f 0x524c +0x5170 0x525e +0x5171 0x5254 +0x5172 0x526a +0x5173 0x5274 +0x5174 0x5269 +0x5175 0x5273 +0x5176 0x527f +0x5177 0x527d +0x5178 0x528d +0x5179 0x5294 +0x517a 0x5292 +0x517b 0x5271 +0x517c 0x5288 +0x517d 0x5291 +0x517e 0x8fa8 +0x517f 0x3000 +0x5220 0x3000 +0x5221 0x8fa7 +0x5222 0x52ac +0x5223 0x52ad +0x5224 0x52bc +0x5225 0x52b5 +0x5226 0x52c1 +0x5227 0x52cd +0x5228 0x52d7 +0x5229 0x52de +0x522a 0x52e3 +0x522b 0x52e6 +0x522c 0x98ed +0x522d 0x52e0 +0x522e 0x52f3 +0x522f 0x52f5 +0x5230 0x52f8 +0x5231 0x52f9 +0x5232 0x5306 +0x5233 0x5308 +0x5234 0x7538 +0x5235 0x530d +0x5236 0x5310 +0x5237 0x530f +0x5238 0x5315 +0x5239 0x531a +0x523a 0x5323 +0x523b 0x532f +0x523c 0x5331 +0x523d 0x5333 +0x523e 0x5338 +0x523f 0x5340 +0x5240 0x5346 +0x5241 0x5345 +0x5242 0x4e17 +0x5243 0x5349 +0x5244 0x534d +0x5245 0x51d6 +0x5246 0x535e +0x5247 0x5369 +0x5248 0x536e +0x5249 0x5918 +0x524a 0x537b +0x524b 0x5377 +0x524c 0x5382 +0x524d 0x5396 +0x524e 0x53a0 +0x524f 0x53a6 +0x5250 0x53a5 +0x5251 0x53ae +0x5252 0x53b0 +0x5253 0x53b6 +0x5254 0x53c3 +0x5255 0x7c12 +0x5256 0x96d9 +0x5257 0x53df +0x5258 0x66fc +0x5259 0x71ee +0x525a 0x53ee +0x525b 0x53e8 +0x525c 0x53ed +0x525d 0x53fa +0x525e 0x5401 +0x525f 0x543d +0x5260 0x5440 +0x5261 0x542c +0x5262 0x542d +0x5263 0x543c +0x5264 0x542e +0x5265 0x5436 +0x5266 0x5429 +0x5267 0x541d +0x5268 0x544e +0x5269 0x548f +0x526a 0x5475 +0x526b 0x548e +0x526c 0x545f +0x526d 0x5471 +0x526e 0x5477 +0x526f 0x5470 +0x5270 0x5492 +0x5271 0x547b +0x5272 0x5480 +0x5273 0x5476 +0x5274 0x5484 +0x5275 0x5490 +0x5276 0x5486 +0x5277 0x54c7 +0x5278 0x54a2 +0x5279 0x54b8 +0x527a 0x54a5 +0x527b 0x54ac +0x527c 0x54c4 +0x527d 0x54c8 +0x527e 0x54a8 +0x527f 0x3000 +0x5320 0x3000 +0x5321 0x54ab +0x5322 0x54c2 +0x5323 0x54a4 +0x5324 0x54be +0x5325 0x54bc +0x5326 0x54d8 +0x5327 0x54e5 +0x5328 0x54e6 +0x5329 0x550f +0x532a 0x5514 +0x532b 0x54fd +0x532c 0x54ee +0x532d 0x54ed +0x532e 0x54fa +0x532f 0x54e2 +0x5330 0x5539 +0x5331 0x5540 +0x5332 0x5563 +0x5333 0x554c +0x5334 0x552e +0x5335 0x555c +0x5336 0x5545 +0x5337 0x5556 +0x5338 0x5557 +0x5339 0x5538 +0x533a 0x5533 +0x533b 0x555d +0x533c 0x5599 +0x533d 0x5580 +0x533e 0x54af +0x533f 0x558a +0x5340 0x559f +0x5341 0x557b +0x5342 0x557e +0x5343 0x5598 +0x5344 0x559e +0x5345 0x55ae +0x5346 0x557c +0x5347 0x5583 +0x5348 0x55a9 +0x5349 0x5587 +0x534a 0x55a8 +0x534b 0x55da +0x534c 0x55c5 +0x534d 0x55df +0x534e 0x55c4 +0x534f 0x55dc +0x5350 0x55e4 +0x5351 0x55d4 +0x5352 0x5614 +0x5353 0x55f7 +0x5354 0x5616 +0x5355 0x55fe +0x5356 0x55fd +0x5357 0x561b +0x5358 0x55f9 +0x5359 0x564e +0x535a 0x5650 +0x535b 0x71df +0x535c 0x5634 +0x535d 0x5636 +0x535e 0x5632 +0x535f 0x5638 +0x5360 0x566b +0x5361 0x5664 +0x5362 0x562f +0x5363 0x566c +0x5364 0x566a +0x5365 0x5686 +0x5366 0x5680 +0x5367 0x568a +0x5368 0x56a0 +0x5369 0x5694 +0x536a 0x568f +0x536b 0x56a5 +0x536c 0x56ae +0x536d 0x56b6 +0x536e 0x56b4 +0x536f 0x56c2 +0x5370 0x56bc +0x5371 0x56c1 +0x5372 0x56c3 +0x5373 0x56c0 +0x5374 0x56c8 +0x5375 0x56ce +0x5376 0x56d1 +0x5377 0x56d3 +0x5378 0x56d7 +0x5379 0x56ee +0x537a 0x56f9 +0x537b 0x5700 +0x537c 0x56ff +0x537d 0x5704 +0x537e 0x5709 +0x537f 0x3000 +0x5420 0x3000 +0x5421 0x5708 +0x5422 0x570b +0x5423 0x570d +0x5424 0x5713 +0x5425 0x5718 +0x5426 0x5716 +0x5427 0x55c7 +0x5428 0x571c +0x5429 0x5726 +0x542a 0x5737 +0x542b 0x5738 +0x542c 0x574e +0x542d 0x573b +0x542e 0x5740 +0x542f 0x574f +0x5430 0x5769 +0x5431 0x57c0 +0x5432 0x5788 +0x5433 0x5761 +0x5434 0x577f +0x5435 0x5789 +0x5436 0x5793 +0x5437 0x57a0 +0x5438 0x57b3 +0x5439 0x57a4 +0x543a 0x57aa +0x543b 0x57b0 +0x543c 0x57c3 +0x543d 0x57c6 +0x543e 0x57d4 +0x543f 0x57d2 +0x5440 0x57d3 +0x5441 0x580a +0x5442 0x57d6 +0x5443 0x57e3 +0x5444 0x580b +0x5445 0x5819 +0x5446 0x581d +0x5447 0x5872 +0x5448 0x5821 +0x5449 0x5862 +0x544a 0x584b +0x544b 0x5870 +0x544c 0x6bc0 +0x544d 0x5852 +0x544e 0x583d +0x544f 0x5879 +0x5450 0x5885 +0x5451 0x58b9 +0x5452 0x589f +0x5453 0x58ab +0x5454 0x58ba +0x5455 0x58de +0x5456 0x58bb +0x5457 0x58b8 +0x5458 0x58ae +0x5459 0x58c5 +0x545a 0x58d3 +0x545b 0x58d1 +0x545c 0x58d7 +0x545d 0x58d9 +0x545e 0x58d8 +0x545f 0x58e5 +0x5460 0x58dc +0x5461 0x58e4 +0x5462 0x58df +0x5463 0x58ef +0x5464 0x58fa +0x5465 0x58f9 +0x5466 0x58fb +0x5467 0x58fc +0x5468 0x58fd +0x5469 0x5902 +0x546a 0x590a +0x546b 0x5910 +0x546c 0x591b +0x546d 0x68a6 +0x546e 0x5925 +0x546f 0x592c +0x5470 0x592d +0x5471 0x5932 +0x5472 0x5938 +0x5473 0x593e +0x5474 0x7ad2 +0x5475 0x5955 +0x5476 0x5950 +0x5477 0x594e +0x5478 0x595a +0x5479 0x5958 +0x547a 0x5962 +0x547b 0x5960 +0x547c 0x5967 +0x547d 0x596c +0x547e 0x5969 +0x547f 0x3000 +0x5520 0x3000 +0x5521 0x5978 +0x5522 0x5981 +0x5523 0x599d +0x5524 0x4f5e +0x5525 0x4fab +0x5526 0x59a3 +0x5527 0x59b2 +0x5528 0x59c6 +0x5529 0x59e8 +0x552a 0x59dc +0x552b 0x598d +0x552c 0x59d9 +0x552d 0x59da +0x552e 0x5a25 +0x552f 0x5a1f +0x5530 0x5a11 +0x5531 0x5a1c +0x5532 0x5a09 +0x5533 0x5a1a +0x5534 0x5a40 +0x5535 0x5a6c +0x5536 0x5a49 +0x5537 0x5a35 +0x5538 0x5a36 +0x5539 0x5a62 +0x553a 0x5a6a +0x553b 0x5a9a +0x553c 0x5abc +0x553d 0x5abe +0x553e 0x5acb +0x553f 0x5ac2 +0x5540 0x5abd +0x5541 0x5ae3 +0x5542 0x5ad7 +0x5543 0x5ae6 +0x5544 0x5ae9 +0x5545 0x5ad6 +0x5546 0x5afa +0x5547 0x5afb +0x5548 0x5b0c +0x5549 0x5b0b +0x554a 0x5b16 +0x554b 0x5b32 +0x554c 0x5ad0 +0x554d 0x5b2a +0x554e 0x5b36 +0x554f 0x5b3e +0x5550 0x5b43 +0x5551 0x5b45 +0x5552 0x5b40 +0x5553 0x5b51 +0x5554 0x5b55 +0x5555 0x5b5a +0x5556 0x5b5b +0x5557 0x5b65 +0x5558 0x5b69 +0x5559 0x5b70 +0x555a 0x5b73 +0x555b 0x5b75 +0x555c 0x5b78 +0x555d 0x6588 +0x555e 0x5b7a +0x555f 0x5b80 +0x5560 0x5b83 +0x5561 0x5ba6 +0x5562 0x5bb8 +0x5563 0x5bc3 +0x5564 0x5bc7 +0x5565 0x5bc9 +0x5566 0x5bd4 +0x5567 0x5bd0 +0x5568 0x5be4 +0x5569 0x5be6 +0x556a 0x5be2 +0x556b 0x5bde +0x556c 0x5be5 +0x556d 0x5beb +0x556e 0x5bf0 +0x556f 0x5bf6 +0x5570 0x5bf3 +0x5571 0x5c05 +0x5572 0x5c07 +0x5573 0x5c08 +0x5574 0x5c0d +0x5575 0x5c13 +0x5576 0x5c20 +0x5577 0x5c22 +0x5578 0x5c28 +0x5579 0x5c38 +0x557a 0x5c39 +0x557b 0x5c41 +0x557c 0x5c46 +0x557d 0x5c4e +0x557e 0x5c53 +0x557f 0x3000 +0x5620 0x3000 +0x5621 0x5c50 +0x5622 0x5c4f +0x5623 0x5b71 +0x5624 0x5c6c +0x5625 0x5c6e +0x5626 0x4e62 +0x5627 0x5c76 +0x5628 0x5c79 +0x5629 0x5c8c +0x562a 0x5c91 +0x562b 0x5c94 +0x562c 0x599b +0x562d 0x5cab +0x562e 0x5cbb +0x562f 0x5cb6 +0x5630 0x5cbc +0x5631 0x5cb7 +0x5632 0x5cc5 +0x5633 0x5cbe +0x5634 0x5cc7 +0x5635 0x5cd9 +0x5636 0x5ce9 +0x5637 0x5cfd +0x5638 0x5cfa +0x5639 0x5ced +0x563a 0x5d8c +0x563b 0x5cea +0x563c 0x5d0b +0x563d 0x5d15 +0x563e 0x5d17 +0x563f 0x5d5c +0x5640 0x5d1f +0x5641 0x5d1b +0x5642 0x5d11 +0x5643 0x5d14 +0x5644 0x5d22 +0x5645 0x5d1a +0x5646 0x5d19 +0x5647 0x5d18 +0x5648 0x5d4c +0x5649 0x5d52 +0x564a 0x5d4e +0x564b 0x5d4b +0x564c 0x5d6c +0x564d 0x5d73 +0x564e 0x5d76 +0x564f 0x5d87 +0x5650 0x5d84 +0x5651 0x5d82 +0x5652 0x5da2 +0x5653 0x5d9d +0x5654 0x5dac +0x5655 0x5dae +0x5656 0x5dbd +0x5657 0x5d90 +0x5658 0x5db7 +0x5659 0x5dbc +0x565a 0x5dc9 +0x565b 0x5dcd +0x565c 0x5dd3 +0x565d 0x5dd2 +0x565e 0x5dd6 +0x565f 0x5ddb +0x5660 0x5deb +0x5661 0x5df2 +0x5662 0x5df5 +0x5663 0x5e0b +0x5664 0x5e1a +0x5665 0x5e19 +0x5666 0x5e11 +0x5667 0x5e1b +0x5668 0x5e36 +0x5669 0x5e37 +0x566a 0x5e44 +0x566b 0x5e43 +0x566c 0x5e40 +0x566d 0x5e4e +0x566e 0x5e57 +0x566f 0x5e54 +0x5670 0x5e5f +0x5671 0x5e62 +0x5672 0x5e64 +0x5673 0x5e47 +0x5674 0x5e75 +0x5675 0x5e76 +0x5676 0x5e7a +0x5677 0x9ebc +0x5678 0x5e7f +0x5679 0x5ea0 +0x567a 0x5ec1 +0x567b 0x5ec2 +0x567c 0x5ec8 +0x567d 0x5ed0 +0x567e 0x5ecf +0x567f 0x3000 +0x5720 0x3000 +0x5721 0x5ed6 +0x5722 0x5ee3 +0x5723 0x5edd +0x5724 0x5eda +0x5725 0x5edb +0x5726 0x5ee2 +0x5727 0x5ee1 +0x5728 0x5ee8 +0x5729 0x5ee9 +0x572a 0x5eec +0x572b 0x5ef1 +0x572c 0x5ef3 +0x572d 0x5ef0 +0x572e 0x5ef4 +0x572f 0x5ef8 +0x5730 0x5efe +0x5731 0x5f03 +0x5732 0x5f09 +0x5733 0x5f5d +0x5734 0x5f5c +0x5735 0x5f0b +0x5736 0x5f11 +0x5737 0x5f16 +0x5738 0x5f29 +0x5739 0x5f2d +0x573a 0x5f38 +0x573b 0x5f41 +0x573c 0x5f48 +0x573d 0x5f4c +0x573e 0x5f4e +0x573f 0x5f2f +0x5740 0x5f51 +0x5741 0x5f56 +0x5742 0x5f57 +0x5743 0x5f59 +0x5744 0x5f61 +0x5745 0x5f6d +0x5746 0x5f73 +0x5747 0x5f77 +0x5748 0x5f83 +0x5749 0x5f82 +0x574a 0x5f7f +0x574b 0x5f8a +0x574c 0x5f88 +0x574d 0x5f91 +0x574e 0x5f87 +0x574f 0x5f9e +0x5750 0x5f99 +0x5751 0x5f98 +0x5752 0x5fa0 +0x5753 0x5fa8 +0x5754 0x5fad +0x5755 0x5fbc +0x5756 0x5fd6 +0x5757 0x5ffb +0x5758 0x5fe4 +0x5759 0x5ff8 +0x575a 0x5ff1 +0x575b 0x5fdd +0x575c 0x60b3 +0x575d 0x5fff +0x575e 0x6021 +0x575f 0x6060 +0x5760 0x6019 +0x5761 0x6010 +0x5762 0x6029 +0x5763 0x600e +0x5764 0x6031 +0x5765 0x601b +0x5766 0x6015 +0x5767 0x602b +0x5768 0x6026 +0x5769 0x600f +0x576a 0x603a +0x576b 0x605a +0x576c 0x6041 +0x576d 0x606a +0x576e 0x6077 +0x576f 0x605f +0x5770 0x604a +0x5771 0x6046 +0x5772 0x604d +0x5773 0x6063 +0x5774 0x6043 +0x5775 0x6064 +0x5776 0x6042 +0x5777 0x606c +0x5778 0x606b +0x5779 0x6059 +0x577a 0x6081 +0x577b 0x608d +0x577c 0x60e7 +0x577d 0x6083 +0x577e 0x609a +0x577f 0x3000 +0x5820 0x3000 +0x5821 0x6084 +0x5822 0x609b +0x5823 0x6096 +0x5824 0x6097 +0x5825 0x6092 +0x5826 0x60a7 +0x5827 0x608b +0x5828 0x60e1 +0x5829 0x60b8 +0x582a 0x60e0 +0x582b 0x60d3 +0x582c 0x60b4 +0x582d 0x5ff0 +0x582e 0x60bd +0x582f 0x60c6 +0x5830 0x60b5 +0x5831 0x60d8 +0x5832 0x614d +0x5833 0x6115 +0x5834 0x6106 +0x5835 0x60f6 +0x5836 0x60f7 +0x5837 0x6100 +0x5838 0x60f4 +0x5839 0x60fa +0x583a 0x6103 +0x583b 0x6121 +0x583c 0x60fb +0x583d 0x60f1 +0x583e 0x610d +0x583f 0x610e +0x5840 0x6147 +0x5841 0x613e +0x5842 0x6128 +0x5843 0x6127 +0x5844 0x614a +0x5845 0x613f +0x5846 0x613c +0x5847 0x612c +0x5848 0x6134 +0x5849 0x613d +0x584a 0x6142 +0x584b 0x6144 +0x584c 0x6173 +0x584d 0x6177 +0x584e 0x6158 +0x584f 0x6159 +0x5850 0x615a +0x5851 0x616b +0x5852 0x6174 +0x5853 0x616f +0x5854 0x6165 +0x5855 0x6171 +0x5856 0x615f +0x5857 0x615d +0x5858 0x6153 +0x5859 0x6175 +0x585a 0x6199 +0x585b 0x6196 +0x585c 0x6187 +0x585d 0x61ac +0x585e 0x6194 +0x585f 0x619a +0x5860 0x618a +0x5861 0x6191 +0x5862 0x61ab +0x5863 0x61ae +0x5864 0x61cc +0x5865 0x61ca +0x5866 0x61c9 +0x5867 0x61f7 +0x5868 0x61c8 +0x5869 0x61c3 +0x586a 0x61c6 +0x586b 0x61ba +0x586c 0x61cb +0x586d 0x7f79 +0x586e 0x61cd +0x586f 0x61e6 +0x5870 0x61e3 +0x5871 0x61f6 +0x5872 0x61fa +0x5873 0x61f4 +0x5874 0x61ff +0x5875 0x61fd +0x5876 0x61fc +0x5877 0x61fe +0x5878 0x6200 +0x5879 0x6208 +0x587a 0x6209 +0x587b 0x620d +0x587c 0x620c +0x587d 0x6214 +0x587e 0x621b +0x587f 0x3000 +0x5920 0x3000 +0x5921 0x621e +0x5922 0x6221 +0x5923 0x622a +0x5924 0x622e +0x5925 0x6230 +0x5926 0x6232 +0x5927 0x6233 +0x5928 0x6241 +0x5929 0x624e +0x592a 0x625e +0x592b 0x6263 +0x592c 0x625b +0x592d 0x6260 +0x592e 0x6268 +0x592f 0x627c +0x5930 0x6282 +0x5931 0x6289 +0x5932 0x627e +0x5933 0x6292 +0x5934 0x6293 +0x5935 0x6296 +0x5936 0x62d4 +0x5937 0x6283 +0x5938 0x6294 +0x5939 0x62d7 +0x593a 0x62d1 +0x593b 0x62bb +0x593c 0x62cf +0x593d 0x62ff +0x593e 0x62c6 +0x593f 0x64d4 +0x5940 0x62c8 +0x5941 0x62dc +0x5942 0x62cc +0x5943 0x62ca +0x5944 0x62c2 +0x5945 0x62c7 +0x5946 0x629b +0x5947 0x62c9 +0x5948 0x630c +0x5949 0x62ee +0x594a 0x62f1 +0x594b 0x6327 +0x594c 0x6302 +0x594d 0x6308 +0x594e 0x62ef +0x594f 0x62f5 +0x5950 0x6350 +0x5951 0x633e +0x5952 0x634d +0x5953 0x641c +0x5954 0x634f +0x5955 0x6396 +0x5956 0x638e +0x5957 0x6380 +0x5958 0x63ab +0x5959 0x6376 +0x595a 0x63a3 +0x595b 0x638f +0x595c 0x6389 +0x595d 0x639f +0x595e 0x63b5 +0x595f 0x636b +0x5960 0x6369 +0x5961 0x63be +0x5962 0x63e9 +0x5963 0x63c0 +0x5964 0x63c6 +0x5965 0x63e3 +0x5966 0x63c9 +0x5967 0x63d2 +0x5968 0x63f6 +0x5969 0x63c4 +0x596a 0x6416 +0x596b 0x6434 +0x596c 0x6406 +0x596d 0x6413 +0x596e 0x6426 +0x596f 0x6436 +0x5970 0x651d +0x5971 0x6417 +0x5972 0x6428 +0x5973 0x640f +0x5974 0x6467 +0x5975 0x646f +0x5976 0x6476 +0x5977 0x644e +0x5978 0x652a +0x5979 0x6495 +0x597a 0x6493 +0x597b 0x64a5 +0x597c 0x64a9 +0x597d 0x6488 +0x597e 0x64bc +0x597f 0x3000 +0x5a20 0x3000 +0x5a21 0x64da +0x5a22 0x64d2 +0x5a23 0x64c5 +0x5a24 0x64c7 +0x5a25 0x64bb +0x5a26 0x64d8 +0x5a27 0x64c2 +0x5a28 0x64f1 +0x5a29 0x64e7 +0x5a2a 0x8209 +0x5a2b 0x64e0 +0x5a2c 0x64e1 +0x5a2d 0x62ac +0x5a2e 0x64e3 +0x5a2f 0x64ef +0x5a30 0x652c +0x5a31 0x64f6 +0x5a32 0x64f4 +0x5a33 0x64f2 +0x5a34 0x64fa +0x5a35 0x6500 +0x5a36 0x64fd +0x5a37 0x6518 +0x5a38 0x651c +0x5a39 0x6505 +0x5a3a 0x6524 +0x5a3b 0x6523 +0x5a3c 0x652b +0x5a3d 0x6534 +0x5a3e 0x6535 +0x5a3f 0x6537 +0x5a40 0x6536 +0x5a41 0x6538 +0x5a42 0x754b +0x5a43 0x6548 +0x5a44 0x6556 +0x5a45 0x6555 +0x5a46 0x654d +0x5a47 0x6558 +0x5a48 0x655e +0x5a49 0x655d +0x5a4a 0x6572 +0x5a4b 0x6578 +0x5a4c 0x6582 +0x5a4d 0x6583 +0x5a4e 0x8b8a +0x5a4f 0x659b +0x5a50 0x659f +0x5a51 0x65ab +0x5a52 0x65b7 +0x5a53 0x65c3 +0x5a54 0x65c6 +0x5a55 0x65c1 +0x5a56 0x65c4 +0x5a57 0x65cc +0x5a58 0x65d2 +0x5a59 0x65db +0x5a5a 0x65d9 +0x5a5b 0x65e0 +0x5a5c 0x65e1 +0x5a5d 0x65f1 +0x5a5e 0x6772 +0x5a5f 0x660a +0x5a60 0x6603 +0x5a61 0x65fb +0x5a62 0x6773 +0x5a63 0x6635 +0x5a64 0x6636 +0x5a65 0x6634 +0x5a66 0x661c +0x5a67 0x664f +0x5a68 0x6644 +0x5a69 0x6649 +0x5a6a 0x6641 +0x5a6b 0x665e +0x5a6c 0x665d +0x5a6d 0x6664 +0x5a6e 0x6667 +0x5a6f 0x6668 +0x5a70 0x665f +0x5a71 0x6662 +0x5a72 0x6670 +0x5a73 0x6683 +0x5a74 0x6688 +0x5a75 0x668e +0x5a76 0x6689 +0x5a77 0x6684 +0x5a78 0x6698 +0x5a79 0x669d +0x5a7a 0x66c1 +0x5a7b 0x66b9 +0x5a7c 0x66c9 +0x5a7d 0x66be +0x5a7e 0x66bc +0x5a7f 0x3000 +0x5b20 0x3000 +0x5b21 0x66c4 +0x5b22 0x66b8 +0x5b23 0x66d6 +0x5b24 0x66da +0x5b25 0x66e0 +0x5b26 0x663f +0x5b27 0x66e6 +0x5b28 0x66e9 +0x5b29 0x66f0 +0x5b2a 0x66f5 +0x5b2b 0x66f7 +0x5b2c 0x670f +0x5b2d 0x6716 +0x5b2e 0x671e +0x5b2f 0x6726 +0x5b30 0x6727 +0x5b31 0x9738 +0x5b32 0x672e +0x5b33 0x673f +0x5b34 0x6736 +0x5b35 0x6741 +0x5b36 0x6738 +0x5b37 0x6737 +0x5b38 0x6746 +0x5b39 0x675e +0x5b3a 0x6760 +0x5b3b 0x6759 +0x5b3c 0x6763 +0x5b3d 0x6764 +0x5b3e 0x6789 +0x5b3f 0x6770 +0x5b40 0x67a9 +0x5b41 0x677c +0x5b42 0x676a +0x5b43 0x678c +0x5b44 0x678b +0x5b45 0x67a6 +0x5b46 0x67a1 +0x5b47 0x6785 +0x5b48 0x67b7 +0x5b49 0x67ef +0x5b4a 0x67b4 +0x5b4b 0x67ec +0x5b4c 0x67b3 +0x5b4d 0x67e9 +0x5b4e 0x67b8 +0x5b4f 0x67e4 +0x5b50 0x67de +0x5b51 0x67dd +0x5b52 0x67e2 +0x5b53 0x67ee +0x5b54 0x67b9 +0x5b55 0x67ce +0x5b56 0x67c6 +0x5b57 0x67e7 +0x5b58 0x6a9c +0x5b59 0x681e +0x5b5a 0x6846 +0x5b5b 0x6829 +0x5b5c 0x6840 +0x5b5d 0x684d +0x5b5e 0x6832 +0x5b5f 0x684e +0x5b60 0x68b3 +0x5b61 0x682b +0x5b62 0x6859 +0x5b63 0x6863 +0x5b64 0x6877 +0x5b65 0x687f +0x5b66 0x689f +0x5b67 0x688f +0x5b68 0x68ad +0x5b69 0x6894 +0x5b6a 0x689d +0x5b6b 0x689b +0x5b6c 0x6883 +0x5b6d 0x6aae +0x5b6e 0x68b9 +0x5b6f 0x6874 +0x5b70 0x68b5 +0x5b71 0x68a0 +0x5b72 0x68ba +0x5b73 0x690f +0x5b74 0x688d +0x5b75 0x687e +0x5b76 0x6901 +0x5b77 0x68ca +0x5b78 0x6908 +0x5b79 0x68d8 +0x5b7a 0x6922 +0x5b7b 0x6926 +0x5b7c 0x68e1 +0x5b7d 0x690c +0x5b7e 0x68cd +0x5b7f 0x3000 +0x5c20 0x3000 +0x5c21 0x68d4 +0x5c22 0x68e7 +0x5c23 0x68d5 +0x5c24 0x6936 +0x5c25 0x6912 +0x5c26 0x6904 +0x5c27 0x68d7 +0x5c28 0x68e3 +0x5c29 0x6925 +0x5c2a 0x68f9 +0x5c2b 0x68e0 +0x5c2c 0x68ef +0x5c2d 0x6928 +0x5c2e 0x692a +0x5c2f 0x691a +0x5c30 0x6923 +0x5c31 0x6921 +0x5c32 0x68c6 +0x5c33 0x6979 +0x5c34 0x6977 +0x5c35 0x695c +0x5c36 0x6978 +0x5c37 0x696b +0x5c38 0x6954 +0x5c39 0x697e +0x5c3a 0x696e +0x5c3b 0x6939 +0x5c3c 0x6974 +0x5c3d 0x693d +0x5c3e 0x6959 +0x5c3f 0x6930 +0x5c40 0x6961 +0x5c41 0x695e +0x5c42 0x695d +0x5c43 0x6981 +0x5c44 0x696a +0x5c45 0x69b2 +0x5c46 0x69ae +0x5c47 0x69d0 +0x5c48 0x69bf +0x5c49 0x69c1 +0x5c4a 0x69d3 +0x5c4b 0x69be +0x5c4c 0x69ce +0x5c4d 0x5be8 +0x5c4e 0x69ca +0x5c4f 0x69dd +0x5c50 0x69bb +0x5c51 0x69c3 +0x5c52 0x69a7 +0x5c53 0x6a2e +0x5c54 0x6991 +0x5c55 0x69a0 +0x5c56 0x699c +0x5c57 0x6995 +0x5c58 0x69b4 +0x5c59 0x69de +0x5c5a 0x69e8 +0x5c5b 0x6a02 +0x5c5c 0x6a1b +0x5c5d 0x69ff +0x5c5e 0x6b0a +0x5c5f 0x69f9 +0x5c60 0x69f2 +0x5c61 0x69e7 +0x5c62 0x6a05 +0x5c63 0x69b1 +0x5c64 0x6a1e +0x5c65 0x69ed +0x5c66 0x6a14 +0x5c67 0x69eb +0x5c68 0x6a0a +0x5c69 0x6a12 +0x5c6a 0x6ac1 +0x5c6b 0x6a23 +0x5c6c 0x6a13 +0x5c6d 0x6a44 +0x5c6e 0x6a0c +0x5c6f 0x6a72 +0x5c70 0x6a36 +0x5c71 0x6a78 +0x5c72 0x6a47 +0x5c73 0x6a62 +0x5c74 0x6a59 +0x5c75 0x6a66 +0x5c76 0x6a48 +0x5c77 0x6a38 +0x5c78 0x6a22 +0x5c79 0x6a90 +0x5c7a 0x6a8d +0x5c7b 0x6aa0 +0x5c7c 0x6a84 +0x5c7d 0x6aa2 +0x5c7e 0x6aa3 +0x5c7f 0x3000 +0x5d20 0x3000 +0x5d21 0x6a97 +0x5d22 0x8617 +0x5d23 0x6abb +0x5d24 0x6ac3 +0x5d25 0x6ac2 +0x5d26 0x6ab8 +0x5d27 0x6ab3 +0x5d28 0x6aac +0x5d29 0x6ade +0x5d2a 0x6ad1 +0x5d2b 0x6adf +0x5d2c 0x6aaa +0x5d2d 0x6ada +0x5d2e 0x6aea +0x5d2f 0x6afb +0x5d30 0x6b05 +0x5d31 0x8616 +0x5d32 0x6afa +0x5d33 0x6b12 +0x5d34 0x6b16 +0x5d35 0x9b31 +0x5d36 0x6b1f +0x5d37 0x6b38 +0x5d38 0x6b37 +0x5d39 0x76dc +0x5d3a 0x6b39 +0x5d3b 0x98ee +0x5d3c 0x6b47 +0x5d3d 0x6b43 +0x5d3e 0x6b49 +0x5d3f 0x6b50 +0x5d40 0x6b59 +0x5d41 0x6b54 +0x5d42 0x6b5b +0x5d43 0x6b5f +0x5d44 0x6b61 +0x5d45 0x6b78 +0x5d46 0x6b79 +0x5d47 0x6b7f +0x5d48 0x6b80 +0x5d49 0x6b84 +0x5d4a 0x6b83 +0x5d4b 0x6b8d +0x5d4c 0x6b98 +0x5d4d 0x6b95 +0x5d4e 0x6b9e +0x5d4f 0x6ba4 +0x5d50 0x6baa +0x5d51 0x6bab +0x5d52 0x6baf +0x5d53 0x6bb2 +0x5d54 0x6bb1 +0x5d55 0x6bb3 +0x5d56 0x6bb7 +0x5d57 0x6bbc +0x5d58 0x6bc6 +0x5d59 0x6bcb +0x5d5a 0x6bd3 +0x5d5b 0x6bdf +0x5d5c 0x6bec +0x5d5d 0x6beb +0x5d5e 0x6bf3 +0x5d5f 0x6bef +0x5d60 0x9ebe +0x5d61 0x6c08 +0x5d62 0x6c13 +0x5d63 0x6c14 +0x5d64 0x6c1b +0x5d65 0x6c24 +0x5d66 0x6c23 +0x5d67 0x6c5e +0x5d68 0x6c55 +0x5d69 0x6c62 +0x5d6a 0x6c6a +0x5d6b 0x6c82 +0x5d6c 0x6c8d +0x5d6d 0x6c9a +0x5d6e 0x6c81 +0x5d6f 0x6c9b +0x5d70 0x6c7e +0x5d71 0x6c68 +0x5d72 0x6c73 +0x5d73 0x6c92 +0x5d74 0x6c90 +0x5d75 0x6cc4 +0x5d76 0x6cf1 +0x5d77 0x6cd3 +0x5d78 0x6cbd +0x5d79 0x6cd7 +0x5d7a 0x6cc5 +0x5d7b 0x6cdd +0x5d7c 0x6cae +0x5d7d 0x6cb1 +0x5d7e 0x6cbe +0x5d7f 0x3000 +0x5e20 0x3000 +0x5e21 0x6cba +0x5e22 0x6cdb +0x5e23 0x6cef +0x5e24 0x6cd9 +0x5e25 0x6cea +0x5e26 0x6d1f +0x5e27 0x884d +0x5e28 0x6d36 +0x5e29 0x6d2b +0x5e2a 0x6d3d +0x5e2b 0x6d38 +0x5e2c 0x6d19 +0x5e2d 0x6d35 +0x5e2e 0x6d33 +0x5e2f 0x6d12 +0x5e30 0x6d0c +0x5e31 0x6d63 +0x5e32 0x6d93 +0x5e33 0x6d64 +0x5e34 0x6d5a +0x5e35 0x6d79 +0x5e36 0x6d59 +0x5e37 0x6d8e +0x5e38 0x6d95 +0x5e39 0x6fe4 +0x5e3a 0x6d85 +0x5e3b 0x6df9 +0x5e3c 0x6e15 +0x5e3d 0x6e0a +0x5e3e 0x6db5 +0x5e3f 0x6dc7 +0x5e40 0x6de6 +0x5e41 0x6db8 +0x5e42 0x6dc6 +0x5e43 0x6dec +0x5e44 0x6dde +0x5e45 0x6dcc +0x5e46 0x6de8 +0x5e47 0x6dd2 +0x5e48 0x6dc5 +0x5e49 0x6dfa +0x5e4a 0x6dd9 +0x5e4b 0x6de4 +0x5e4c 0x6dd5 +0x5e4d 0x6dea +0x5e4e 0x6dee +0x5e4f 0x6e2d +0x5e50 0x6e6e +0x5e51 0x6e2e +0x5e52 0x6e19 +0x5e53 0x6e72 +0x5e54 0x6e5f +0x5e55 0x6e3e +0x5e56 0x6e23 +0x5e57 0x6e6b +0x5e58 0x6e2b +0x5e59 0x6e76 +0x5e5a 0x6e4d +0x5e5b 0x6e1f +0x5e5c 0x6e43 +0x5e5d 0x6e3a +0x5e5e 0x6e4e +0x5e5f 0x6e24 +0x5e60 0x6eff +0x5e61 0x6e1d +0x5e62 0x6e38 +0x5e63 0x6e82 +0x5e64 0x6eaa +0x5e65 0x6e98 +0x5e66 0x6ec9 +0x5e67 0x6eb7 +0x5e68 0x6ed3 +0x5e69 0x6ebd +0x5e6a 0x6eaf +0x5e6b 0x6ec4 +0x5e6c 0x6eb2 +0x5e6d 0x6ed4 +0x5e6e 0x6ed5 +0x5e6f 0x6e8f +0x5e70 0x6ea5 +0x5e71 0x6ec2 +0x5e72 0x6e9f +0x5e73 0x6f41 +0x5e74 0x6f11 +0x5e75 0x704c +0x5e76 0x6eec +0x5e77 0x6ef8 +0x5e78 0x6efe +0x5e79 0x6f3f +0x5e7a 0x6ef2 +0x5e7b 0x6f31 +0x5e7c 0x6eef +0x5e7d 0x6f32 +0x5e7e 0x6ecc +0x5e7f 0x3000 +0x5f20 0x3000 +0x5f21 0x6f3e +0x5f22 0x6f13 +0x5f23 0x6ef7 +0x5f24 0x6f86 +0x5f25 0x6f7a +0x5f26 0x6f78 +0x5f27 0x6f81 +0x5f28 0x6f80 +0x5f29 0x6f6f +0x5f2a 0x6f5b +0x5f2b 0x6ff3 +0x5f2c 0x6f6d +0x5f2d 0x6f82 +0x5f2e 0x6f7c +0x5f2f 0x6f58 +0x5f30 0x6f8e +0x5f31 0x6f91 +0x5f32 0x6fc2 +0x5f33 0x6f66 +0x5f34 0x6fb3 +0x5f35 0x6fa3 +0x5f36 0x6fa1 +0x5f37 0x6fa4 +0x5f38 0x6fb9 +0x5f39 0x6fc6 +0x5f3a 0x6faa +0x5f3b 0x6fdf +0x5f3c 0x6fd5 +0x5f3d 0x6fec +0x5f3e 0x6fd4 +0x5f3f 0x6fd8 +0x5f40 0x6ff1 +0x5f41 0x6fee +0x5f42 0x6fdb +0x5f43 0x7009 +0x5f44 0x700b +0x5f45 0x6ffa +0x5f46 0x7011 +0x5f47 0x7001 +0x5f48 0x700f +0x5f49 0x6ffe +0x5f4a 0x701b +0x5f4b 0x701a +0x5f4c 0x6f74 +0x5f4d 0x701d +0x5f4e 0x7018 +0x5f4f 0x701f +0x5f50 0x7030 +0x5f51 0x703e +0x5f52 0x7032 +0x5f53 0x7051 +0x5f54 0x7063 +0x5f55 0x7099 +0x5f56 0x7092 +0x5f57 0x70af +0x5f58 0x70f1 +0x5f59 0x70ac +0x5f5a 0x70b8 +0x5f5b 0x70b3 +0x5f5c 0x70ae +0x5f5d 0x70df +0x5f5e 0x70cb +0x5f5f 0x70dd +0x5f60 0x70d9 +0x5f61 0x7109 +0x5f62 0x70fd +0x5f63 0x711c +0x5f64 0x7119 +0x5f65 0x7165 +0x5f66 0x7155 +0x5f67 0x7188 +0x5f68 0x7166 +0x5f69 0x7162 +0x5f6a 0x714c +0x5f6b 0x7156 +0x5f6c 0x716c +0x5f6d 0x718f +0x5f6e 0x71fb +0x5f6f 0x7184 +0x5f70 0x7195 +0x5f71 0x71a8 +0x5f72 0x71ac +0x5f73 0x71d7 +0x5f74 0x71b9 +0x5f75 0x71be +0x5f76 0x71d2 +0x5f77 0x71c9 +0x5f78 0x71d4 +0x5f79 0x71ce +0x5f7a 0x71e0 +0x5f7b 0x71ec +0x5f7c 0x71e7 +0x5f7d 0x71f5 +0x5f7e 0x71fc +0x5f7f 0x3000 +0x6020 0x3000 +0x6021 0x71f9 +0x6022 0x71ff +0x6023 0x720d +0x6024 0x7210 +0x6025 0x721b +0x6026 0x7228 +0x6027 0x722d +0x6028 0x722c +0x6029 0x7230 +0x602a 0x7232 +0x602b 0x723b +0x602c 0x723c +0x602d 0x723f +0x602e 0x7240 +0x602f 0x7246 +0x6030 0x724b +0x6031 0x7258 +0x6032 0x7274 +0x6033 0x727e +0x6034 0x7282 +0x6035 0x7281 +0x6036 0x7287 +0x6037 0x7292 +0x6038 0x7296 +0x6039 0x72a2 +0x603a 0x72a7 +0x603b 0x72b9 +0x603c 0x72b2 +0x603d 0x72c3 +0x603e 0x72c6 +0x603f 0x72c4 +0x6040 0x72ce +0x6041 0x72d2 +0x6042 0x72e2 +0x6043 0x72e0 +0x6044 0x72e1 +0x6045 0x72f9 +0x6046 0x72f7 +0x6047 0x500f +0x6048 0x7317 +0x6049 0x730a +0x604a 0x731c +0x604b 0x7316 +0x604c 0x731d +0x604d 0x7334 +0x604e 0x732f +0x604f 0x7329 +0x6050 0x7325 +0x6051 0x733e +0x6052 0x734e +0x6053 0x734f +0x6054 0x9ed8 +0x6055 0x7357 +0x6056 0x736a +0x6057 0x7368 +0x6058 0x7370 +0x6059 0x7378 +0x605a 0x7375 +0x605b 0x737b +0x605c 0x737a +0x605d 0x73c8 +0x605e 0x73b3 +0x605f 0x73ce +0x6060 0x73bb +0x6061 0x73c0 +0x6062 0x73e5 +0x6063 0x73ee +0x6064 0x73de +0x6065 0x74a2 +0x6066 0x7405 +0x6067 0x746f +0x6068 0x7425 +0x6069 0x73f8 +0x606a 0x7432 +0x606b 0x743a +0x606c 0x7455 +0x606d 0x743f +0x606e 0x745f +0x606f 0x7459 +0x6070 0x7441 +0x6071 0x745c +0x6072 0x7469 +0x6073 0x7470 +0x6074 0x7463 +0x6075 0x746a +0x6076 0x7476 +0x6077 0x747e +0x6078 0x748b +0x6079 0x749e +0x607a 0x74a7 +0x607b 0x74ca +0x607c 0x74cf +0x607d 0x74d4 +0x607e 0x73f1 +0x607f 0x3000 +0x6120 0x3000 +0x6121 0x74e0 +0x6122 0x74e3 +0x6123 0x74e7 +0x6124 0x74e9 +0x6125 0x74ee +0x6126 0x74f2 +0x6127 0x74f0 +0x6128 0x74f1 +0x6129 0x74f8 +0x612a 0x74f7 +0x612b 0x7504 +0x612c 0x7503 +0x612d 0x7505 +0x612e 0x750c +0x612f 0x750e +0x6130 0x750d +0x6131 0x7515 +0x6132 0x7513 +0x6133 0x751e +0x6134 0x7526 +0x6135 0x752c +0x6136 0x753c +0x6137 0x7544 +0x6138 0x754d +0x6139 0x754a +0x613a 0x7549 +0x613b 0x755b +0x613c 0x7546 +0x613d 0x755a +0x613e 0x7569 +0x613f 0x7564 +0x6140 0x7567 +0x6141 0x756b +0x6142 0x756d +0x6143 0x7578 +0x6144 0x7576 +0x6145 0x7586 +0x6146 0x7587 +0x6147 0x7574 +0x6148 0x758a +0x6149 0x7589 +0x614a 0x7582 +0x614b 0x7594 +0x614c 0x759a +0x614d 0x759d +0x614e 0x75a5 +0x614f 0x75a3 +0x6150 0x75c2 +0x6151 0x75b3 +0x6152 0x75c3 +0x6153 0x75b5 +0x6154 0x75bd +0x6155 0x75b8 +0x6156 0x75bc +0x6157 0x75b1 +0x6158 0x75cd +0x6159 0x75ca +0x615a 0x75d2 +0x615b 0x75d9 +0x615c 0x75e3 +0x615d 0x75de +0x615e 0x75fe +0x615f 0x75ff +0x6160 0x75fc +0x6161 0x7601 +0x6162 0x75f0 +0x6163 0x75fa +0x6164 0x75f2 +0x6165 0x75f3 +0x6166 0x760b +0x6167 0x760d +0x6168 0x7609 +0x6169 0x761f +0x616a 0x7627 +0x616b 0x7620 +0x616c 0x7621 +0x616d 0x7622 +0x616e 0x7624 +0x616f 0x7634 +0x6170 0x7630 +0x6171 0x763b +0x6172 0x7647 +0x6173 0x7648 +0x6174 0x7646 +0x6175 0x765c +0x6176 0x7658 +0x6177 0x7661 +0x6178 0x7662 +0x6179 0x7668 +0x617a 0x7669 +0x617b 0x766a +0x617c 0x7667 +0x617d 0x766c +0x617e 0x7670 +0x617f 0x3000 +0x6220 0x3000 +0x6221 0x7672 +0x6222 0x7676 +0x6223 0x7678 +0x6224 0x767c +0x6225 0x7680 +0x6226 0x7683 +0x6227 0x7688 +0x6228 0x768b +0x6229 0x768e +0x622a 0x7696 +0x622b 0x7693 +0x622c 0x7699 +0x622d 0x769a +0x622e 0x76b0 +0x622f 0x76b4 +0x6230 0x76b8 +0x6231 0x76b9 +0x6232 0x76ba +0x6233 0x76c2 +0x6234 0x76cd +0x6235 0x76d6 +0x6236 0x76d2 +0x6237 0x76de +0x6238 0x76e1 +0x6239 0x76e5 +0x623a 0x76e7 +0x623b 0x76ea +0x623c 0x862f +0x623d 0x76fb +0x623e 0x7708 +0x623f 0x7707 +0x6240 0x7704 +0x6241 0x7729 +0x6242 0x7724 +0x6243 0x771e +0x6244 0x7725 +0x6245 0x7726 +0x6246 0x771b +0x6247 0x7737 +0x6248 0x7738 +0x6249 0x7747 +0x624a 0x775a +0x624b 0x7768 +0x624c 0x776b +0x624d 0x775b +0x624e 0x7765 +0x624f 0x777f +0x6250 0x777e +0x6251 0x7779 +0x6252 0x778e +0x6253 0x778b +0x6254 0x7791 +0x6255 0x77a0 +0x6256 0x779e +0x6257 0x77b0 +0x6258 0x77b6 +0x6259 0x77b9 +0x625a 0x77bf +0x625b 0x77bc +0x625c 0x77bd +0x625d 0x77bb +0x625e 0x77c7 +0x625f 0x77cd +0x6260 0x77d7 +0x6261 0x77da +0x6262 0x77dc +0x6263 0x77e3 +0x6264 0x77ee +0x6265 0x77fc +0x6266 0x780c +0x6267 0x7812 +0x6268 0x7926 +0x6269 0x7820 +0x626a 0x792a +0x626b 0x7845 +0x626c 0x788e +0x626d 0x7874 +0x626e 0x7886 +0x626f 0x787c +0x6270 0x789a +0x6271 0x788c +0x6272 0x78a3 +0x6273 0x78b5 +0x6274 0x78aa +0x6275 0x78af +0x6276 0x78d1 +0x6277 0x78c6 +0x6278 0x78cb +0x6279 0x78d4 +0x627a 0x78be +0x627b 0x78bc +0x627c 0x78c5 +0x627d 0x78ca +0x627e 0x78ec +0x627f 0x3000 +0x6320 0x3000 +0x6321 0x78e7 +0x6322 0x78da +0x6323 0x78fd +0x6324 0x78f4 +0x6325 0x7907 +0x6326 0x7912 +0x6327 0x7911 +0x6328 0x7919 +0x6329 0x792c +0x632a 0x792b +0x632b 0x7940 +0x632c 0x7960 +0x632d 0x7957 +0x632e 0x795f +0x632f 0x795a +0x6330 0x7955 +0x6331 0x7953 +0x6332 0x797a +0x6333 0x797f +0x6334 0x798a +0x6335 0x799d +0x6336 0x79a7 +0x6337 0x9f4b +0x6338 0x79aa +0x6339 0x79ae +0x633a 0x79b3 +0x633b 0x79b9 +0x633c 0x79ba +0x633d 0x79c9 +0x633e 0x79d5 +0x633f 0x79e7 +0x6340 0x79ec +0x6341 0x79e1 +0x6342 0x79e3 +0x6343 0x7a08 +0x6344 0x7a0d +0x6345 0x7a18 +0x6346 0x7a19 +0x6347 0x7a20 +0x6348 0x7a1f +0x6349 0x7980 +0x634a 0x7a31 +0x634b 0x7a3b +0x634c 0x7a3e +0x634d 0x7a37 +0x634e 0x7a43 +0x634f 0x7a57 +0x6350 0x7a49 +0x6351 0x7a61 +0x6352 0x7a62 +0x6353 0x7a69 +0x6354 0x9f9d +0x6355 0x7a70 +0x6356 0x7a79 +0x6357 0x7a7d +0x6358 0x7a88 +0x6359 0x7a97 +0x635a 0x7a95 +0x635b 0x7a98 +0x635c 0x7a96 +0x635d 0x7aa9 +0x635e 0x7ac8 +0x635f 0x7ab0 +0x6360 0x7ab6 +0x6361 0x7ac5 +0x6362 0x7ac4 +0x6363 0x7abf +0x6364 0x9083 +0x6365 0x7ac7 +0x6366 0x7aca +0x6367 0x7acd +0x6368 0x7acf +0x6369 0x7ad5 +0x636a 0x7ad3 +0x636b 0x7ad9 +0x636c 0x7ada +0x636d 0x7add +0x636e 0x7ae1 +0x636f 0x7ae2 +0x6370 0x7ae6 +0x6371 0x7aed +0x6372 0x7af0 +0x6373 0x7b02 +0x6374 0x7b0f +0x6375 0x7b0a +0x6376 0x7b06 +0x6377 0x7b33 +0x6378 0x7b18 +0x6379 0x7b19 +0x637a 0x7b1e +0x637b 0x7b35 +0x637c 0x7b28 +0x637d 0x7b36 +0x637e 0x7b50 +0x637f 0x3000 +0x6420 0x3000 +0x6421 0x7b7a +0x6422 0x7b04 +0x6423 0x7b4d +0x6424 0x7b0b +0x6425 0x7b4c +0x6426 0x7b45 +0x6427 0x7b75 +0x6428 0x7b65 +0x6429 0x7b74 +0x642a 0x7b67 +0x642b 0x7b70 +0x642c 0x7b71 +0x642d 0x7b6c +0x642e 0x7b6e +0x642f 0x7b9d +0x6430 0x7b98 +0x6431 0x7b9f +0x6432 0x7b8d +0x6433 0x7b9c +0x6434 0x7b9a +0x6435 0x7b8b +0x6436 0x7b92 +0x6437 0x7b8f +0x6438 0x7b5d +0x6439 0x7b99 +0x643a 0x7bcb +0x643b 0x7bc1 +0x643c 0x7bcc +0x643d 0x7bcf +0x643e 0x7bb4 +0x643f 0x7bc6 +0x6440 0x7bdd +0x6441 0x7be9 +0x6442 0x7c11 +0x6443 0x7c14 +0x6444 0x7be6 +0x6445 0x7be5 +0x6446 0x7c60 +0x6447 0x7c00 +0x6448 0x7c07 +0x6449 0x7c13 +0x644a 0x7bf3 +0x644b 0x7bf7 +0x644c 0x7c17 +0x644d 0x7c0d +0x644e 0x7bf6 +0x644f 0x7c23 +0x6450 0x7c27 +0x6451 0x7c2a +0x6452 0x7c1f +0x6453 0x7c37 +0x6454 0x7c2b +0x6455 0x7c3d +0x6456 0x7c4c +0x6457 0x7c43 +0x6458 0x7c54 +0x6459 0x7c4f +0x645a 0x7c40 +0x645b 0x7c50 +0x645c 0x7c58 +0x645d 0x7c5f +0x645e 0x7c64 +0x645f 0x7c56 +0x6460 0x7c65 +0x6461 0x7c6c +0x6462 0x7c75 +0x6463 0x7c83 +0x6464 0x7c90 +0x6465 0x7ca4 +0x6466 0x7cad +0x6467 0x7ca2 +0x6468 0x7cab +0x6469 0x7ca1 +0x646a 0x7ca8 +0x646b 0x7cb3 +0x646c 0x7cb2 +0x646d 0x7cb1 +0x646e 0x7cae +0x646f 0x7cb9 +0x6470 0x7cbd +0x6471 0x7cc0 +0x6472 0x7cc5 +0x6473 0x7cc2 +0x6474 0x7cd8 +0x6475 0x7cd2 +0x6476 0x7cdc +0x6477 0x7ce2 +0x6478 0x9b3b +0x6479 0x7cef +0x647a 0x7cf2 +0x647b 0x7cf4 +0x647c 0x7cf6 +0x647d 0x7cfa +0x647e 0x7d06 +0x647f 0x3000 +0x6520 0x3000 +0x6521 0x7d02 +0x6522 0x7d1c +0x6523 0x7d15 +0x6524 0x7d0a +0x6525 0x7d45 +0x6526 0x7d4b +0x6527 0x7d2e +0x6528 0x7d32 +0x6529 0x7d3f +0x652a 0x7d35 +0x652b 0x7d46 +0x652c 0x7d73 +0x652d 0x7d56 +0x652e 0x7d4e +0x652f 0x7d72 +0x6530 0x7d68 +0x6531 0x7d6e +0x6532 0x7d4f +0x6533 0x7d63 +0x6534 0x7d93 +0x6535 0x7d89 +0x6536 0x7d5b +0x6537 0x7d8f +0x6538 0x7d7d +0x6539 0x7d9b +0x653a 0x7dba +0x653b 0x7dae +0x653c 0x7da3 +0x653d 0x7db5 +0x653e 0x7dc7 +0x653f 0x7dbd +0x6540 0x7dab +0x6541 0x7e3d +0x6542 0x7da2 +0x6543 0x7daf +0x6544 0x7ddc +0x6545 0x7db8 +0x6546 0x7d9f +0x6547 0x7db0 +0x6548 0x7dd8 +0x6549 0x7ddd +0x654a 0x7de4 +0x654b 0x7dde +0x654c 0x7dfb +0x654d 0x7df2 +0x654e 0x7de1 +0x654f 0x7e05 +0x6550 0x7e0a +0x6551 0x7e23 +0x6552 0x7e21 +0x6553 0x7e12 +0x6554 0x7e31 +0x6555 0x7e1f +0x6556 0x7e09 +0x6557 0x7e0b +0x6558 0x7e22 +0x6559 0x7e46 +0x655a 0x7e66 +0x655b 0x7e3b +0x655c 0x7e35 +0x655d 0x7e39 +0x655e 0x7e43 +0x655f 0x7e37 +0x6560 0x7e32 +0x6561 0x7e3a +0x6562 0x7e67 +0x6563 0x7e5d +0x6564 0x7e56 +0x6565 0x7e5e +0x6566 0x7e59 +0x6567 0x7e5a +0x6568 0x7e79 +0x6569 0x7e6a +0x656a 0x7e69 +0x656b 0x7e7c +0x656c 0x7e7b +0x656d 0x7e83 +0x656e 0x7dd5 +0x656f 0x7e7d +0x6570 0x8fae +0x6571 0x7e7f +0x6572 0x7e88 +0x6573 0x7e89 +0x6574 0x7e8c +0x6575 0x7e92 +0x6576 0x7e90 +0x6577 0x7e93 +0x6578 0x7e94 +0x6579 0x7e96 +0x657a 0x7e8e +0x657b 0x7e9b +0x657c 0x7e9c +0x657d 0x7f38 +0x657e 0x7f3a +0x657f 0x3000 +0x6620 0x3000 +0x6621 0x7f45 +0x6622 0x7f4c +0x6623 0x7f4d +0x6624 0x7f4e +0x6625 0x7f50 +0x6626 0x7f51 +0x6627 0x7f55 +0x6628 0x7f54 +0x6629 0x7f58 +0x662a 0x7f5f +0x662b 0x7f60 +0x662c 0x7f68 +0x662d 0x7f69 +0x662e 0x7f67 +0x662f 0x7f78 +0x6630 0x7f82 +0x6631 0x7f86 +0x6632 0x7f83 +0x6633 0x7f88 +0x6634 0x7f87 +0x6635 0x7f8c +0x6636 0x7f94 +0x6637 0x7f9e +0x6638 0x7f9d +0x6639 0x7f9a +0x663a 0x7fa3 +0x663b 0x7faf +0x663c 0x7fb2 +0x663d 0x7fb9 +0x663e 0x7fae +0x663f 0x7fb6 +0x6640 0x7fb8 +0x6641 0x8b71 +0x6642 0x7fc5 +0x6643 0x7fc6 +0x6644 0x7fca +0x6645 0x7fd5 +0x6646 0x7fd4 +0x6647 0x7fe1 +0x6648 0x7fe6 +0x6649 0x7fe9 +0x664a 0x7ff3 +0x664b 0x7ff9 +0x664c 0x98dc +0x664d 0x8006 +0x664e 0x8004 +0x664f 0x800b +0x6650 0x8012 +0x6651 0x8018 +0x6652 0x8019 +0x6653 0x801c +0x6654 0x8021 +0x6655 0x8028 +0x6656 0x803f +0x6657 0x803b +0x6658 0x804a +0x6659 0x8046 +0x665a 0x8052 +0x665b 0x8058 +0x665c 0x805a +0x665d 0x805f +0x665e 0x8062 +0x665f 0x8068 +0x6660 0x8073 +0x6661 0x8072 +0x6662 0x8070 +0x6663 0x8076 +0x6664 0x8079 +0x6665 0x807d +0x6666 0x807f +0x6667 0x8084 +0x6668 0x8086 +0x6669 0x8085 +0x666a 0x809b +0x666b 0x8093 +0x666c 0x809a +0x666d 0x80ad +0x666e 0x5190 +0x666f 0x80ac +0x6670 0x80db +0x6671 0x80e5 +0x6672 0x80d9 +0x6673 0x80dd +0x6674 0x80c4 +0x6675 0x80da +0x6676 0x80d6 +0x6677 0x8109 +0x6678 0x80ef +0x6679 0x80f1 +0x667a 0x811b +0x667b 0x8129 +0x667c 0x8123 +0x667d 0x812f +0x667e 0x814b +0x667f 0x3000 +0x6720 0x3000 +0x6721 0x968b +0x6722 0x8146 +0x6723 0x813e +0x6724 0x8153 +0x6725 0x8151 +0x6726 0x80fc +0x6727 0x8171 +0x6728 0x816e +0x6729 0x8165 +0x672a 0x8166 +0x672b 0x8174 +0x672c 0x8183 +0x672d 0x8188 +0x672e 0x818a +0x672f 0x8180 +0x6730 0x8182 +0x6731 0x81a0 +0x6732 0x8195 +0x6733 0x81a4 +0x6734 0x81a3 +0x6735 0x815f +0x6736 0x8193 +0x6737 0x81a9 +0x6738 0x81b0 +0x6739 0x81b5 +0x673a 0x81be +0x673b 0x81b8 +0x673c 0x81bd +0x673d 0x81c0 +0x673e 0x81c2 +0x673f 0x81ba +0x6740 0x81c9 +0x6741 0x81cd +0x6742 0x81d1 +0x6743 0x81d9 +0x6744 0x81d8 +0x6745 0x81c8 +0x6746 0x81da +0x6747 0x81df +0x6748 0x81e0 +0x6749 0x81e7 +0x674a 0x81fa +0x674b 0x81fb +0x674c 0x81fe +0x674d 0x8201 +0x674e 0x8202 +0x674f 0x8205 +0x6750 0x8207 +0x6751 0x820a +0x6752 0x820d +0x6753 0x8210 +0x6754 0x8216 +0x6755 0x8229 +0x6756 0x822b +0x6757 0x8238 +0x6758 0x8233 +0x6759 0x8240 +0x675a 0x8259 +0x675b 0x8258 +0x675c 0x825d +0x675d 0x825a +0x675e 0x825f +0x675f 0x8264 +0x6760 0x8262 +0x6761 0x8268 +0x6762 0x826a +0x6763 0x826b +0x6764 0x822e +0x6765 0x8271 +0x6766 0x8277 +0x6767 0x8278 +0x6768 0x827e +0x6769 0x828d +0x676a 0x8292 +0x676b 0x82ab +0x676c 0x829f +0x676d 0x82bb +0x676e 0x82ac +0x676f 0x82e1 +0x6770 0x82e3 +0x6771 0x82df +0x6772 0x82d2 +0x6773 0x82f4 +0x6774 0x82f3 +0x6775 0x82fa +0x6776 0x8393 +0x6777 0x8303 +0x6778 0x82fb +0x6779 0x82f9 +0x677a 0x82de +0x677b 0x8306 +0x677c 0x82dc +0x677d 0x8309 +0x677e 0x82d9 +0x677f 0x3000 +0x6820 0x3000 +0x6821 0x8335 +0x6822 0x8334 +0x6823 0x8316 +0x6824 0x8332 +0x6825 0x8331 +0x6826 0x8340 +0x6827 0x8339 +0x6828 0x8350 +0x6829 0x8345 +0x682a 0x832f +0x682b 0x832b +0x682c 0x8317 +0x682d 0x8318 +0x682e 0x8385 +0x682f 0x839a +0x6830 0x83aa +0x6831 0x839f +0x6832 0x83a2 +0x6833 0x8396 +0x6834 0x8323 +0x6835 0x838e +0x6836 0x8387 +0x6837 0x838a +0x6838 0x837c +0x6839 0x83b5 +0x683a 0x8373 +0x683b 0x8375 +0x683c 0x83a0 +0x683d 0x8389 +0x683e 0x83a8 +0x683f 0x83f4 +0x6840 0x8413 +0x6841 0x83eb +0x6842 0x83ce +0x6843 0x83fd +0x6844 0x8403 +0x6845 0x83d8 +0x6846 0x840b +0x6847 0x83c1 +0x6848 0x83f7 +0x6849 0x8407 +0x684a 0x83e0 +0x684b 0x83f2 +0x684c 0x840d +0x684d 0x8422 +0x684e 0x8420 +0x684f 0x83bd +0x6850 0x8438 +0x6851 0x8506 +0x6852 0x83fb +0x6853 0x846d +0x6854 0x842a +0x6855 0x843c +0x6856 0x855a +0x6857 0x8484 +0x6858 0x8477 +0x6859 0x846b +0x685a 0x84ad +0x685b 0x846e +0x685c 0x8482 +0x685d 0x8469 +0x685e 0x8446 +0x685f 0x842c +0x6860 0x846f +0x6861 0x8479 +0x6862 0x8435 +0x6863 0x84ca +0x6864 0x8462 +0x6865 0x84b9 +0x6866 0x84bf +0x6867 0x849f +0x6868 0x84d9 +0x6869 0x84cd +0x686a 0x84bb +0x686b 0x84da +0x686c 0x84d0 +0x686d 0x84c1 +0x686e 0x84c6 +0x686f 0x84d6 +0x6870 0x84a1 +0x6871 0x8521 +0x6872 0x84ff +0x6873 0x84f4 +0x6874 0x8517 +0x6875 0x8518 +0x6876 0x852c +0x6877 0x851f +0x6878 0x8515 +0x6879 0x8514 +0x687a 0x84fc +0x687b 0x8540 +0x687c 0x8563 +0x687d 0x8558 +0x687e 0x8548 +0x687f 0x3000 +0x6920 0x3000 +0x6921 0x8541 +0x6922 0x8602 +0x6923 0x854b +0x6924 0x8555 +0x6925 0x8580 +0x6926 0x85a4 +0x6927 0x8588 +0x6928 0x8591 +0x6929 0x858a +0x692a 0x85a8 +0x692b 0x856d +0x692c 0x8594 +0x692d 0x859b +0x692e 0x85ea +0x692f 0x8587 +0x6930 0x859c +0x6931 0x8577 +0x6932 0x857e +0x6933 0x8590 +0x6934 0x85c9 +0x6935 0x85ba +0x6936 0x85cf +0x6937 0x85b9 +0x6938 0x85d0 +0x6939 0x85d5 +0x693a 0x85dd +0x693b 0x85e5 +0x693c 0x85dc +0x693d 0x85f9 +0x693e 0x860a +0x693f 0x8613 +0x6940 0x860b +0x6941 0x85fe +0x6942 0x85fa +0x6943 0x8606 +0x6944 0x8622 +0x6945 0x861a +0x6946 0x8630 +0x6947 0x863f +0x6948 0x864d +0x6949 0x4e55 +0x694a 0x8654 +0x694b 0x865f +0x694c 0x8667 +0x694d 0x8671 +0x694e 0x8693 +0x694f 0x86a3 +0x6950 0x86a9 +0x6951 0x86aa +0x6952 0x868b +0x6953 0x868c +0x6954 0x86b6 +0x6955 0x86af +0x6956 0x86c4 +0x6957 0x86c6 +0x6958 0x86b0 +0x6959 0x86c9 +0x695a 0x8823 +0x695b 0x86ab +0x695c 0x86d4 +0x695d 0x86de +0x695e 0x86e9 +0x695f 0x86ec +0x6960 0x86df +0x6961 0x86db +0x6962 0x86ef +0x6963 0x8712 +0x6964 0x8706 +0x6965 0x8708 +0x6966 0x8700 +0x6967 0x8703 +0x6968 0x86fb +0x6969 0x8711 +0x696a 0x8709 +0x696b 0x870d +0x696c 0x86f9 +0x696d 0x870a +0x696e 0x8734 +0x696f 0x873f +0x6970 0x8737 +0x6971 0x873b +0x6972 0x8725 +0x6973 0x8729 +0x6974 0x871a +0x6975 0x8760 +0x6976 0x875f +0x6977 0x8778 +0x6978 0x874c +0x6979 0x874e +0x697a 0x8774 +0x697b 0x8757 +0x697c 0x8768 +0x697d 0x876e +0x697e 0x8759 +0x697f 0x3000 +0x6a20 0x3000 +0x6a21 0x8753 +0x6a22 0x8763 +0x6a23 0x876a +0x6a24 0x8805 +0x6a25 0x87a2 +0x6a26 0x879f +0x6a27 0x8782 +0x6a28 0x87af +0x6a29 0x87cb +0x6a2a 0x87bd +0x6a2b 0x87c0 +0x6a2c 0x87d0 +0x6a2d 0x96d6 +0x6a2e 0x87ab +0x6a2f 0x87c4 +0x6a30 0x87b3 +0x6a31 0x87c7 +0x6a32 0x87c6 +0x6a33 0x87bb +0x6a34 0x87ef +0x6a35 0x87f2 +0x6a36 0x87e0 +0x6a37 0x880f +0x6a38 0x880d +0x6a39 0x87fe +0x6a3a 0x87f6 +0x6a3b 0x87f7 +0x6a3c 0x880e +0x6a3d 0x87d2 +0x6a3e 0x8811 +0x6a3f 0x8816 +0x6a40 0x8815 +0x6a41 0x8822 +0x6a42 0x8821 +0x6a43 0x8831 +0x6a44 0x8836 +0x6a45 0x8839 +0x6a46 0x8827 +0x6a47 0x883b +0x6a48 0x8844 +0x6a49 0x8842 +0x6a4a 0x8852 +0x6a4b 0x8859 +0x6a4c 0x885e +0x6a4d 0x8862 +0x6a4e 0x886b +0x6a4f 0x8881 +0x6a50 0x887e +0x6a51 0x889e +0x6a52 0x8875 +0x6a53 0x887d +0x6a54 0x88b5 +0x6a55 0x8872 +0x6a56 0x8882 +0x6a57 0x8897 +0x6a58 0x8892 +0x6a59 0x88ae +0x6a5a 0x8899 +0x6a5b 0x88a2 +0x6a5c 0x888d +0x6a5d 0x88a4 +0x6a5e 0x88b0 +0x6a5f 0x88bf +0x6a60 0x88b1 +0x6a61 0x88c3 +0x6a62 0x88c4 +0x6a63 0x88d4 +0x6a64 0x88d8 +0x6a65 0x88d9 +0x6a66 0x88dd +0x6a67 0x88f9 +0x6a68 0x8902 +0x6a69 0x88fc +0x6a6a 0x88f4 +0x6a6b 0x88e8 +0x6a6c 0x88f2 +0x6a6d 0x8904 +0x6a6e 0x890c +0x6a6f 0x890a +0x6a70 0x8913 +0x6a71 0x8943 +0x6a72 0x891e +0x6a73 0x8925 +0x6a74 0x892a +0x6a75 0x892b +0x6a76 0x8941 +0x6a77 0x8944 +0x6a78 0x893b +0x6a79 0x8936 +0x6a7a 0x8938 +0x6a7b 0x894c +0x6a7c 0x891d +0x6a7d 0x8960 +0x6a7e 0x895e +0x6a7f 0x3000 +0x6b20 0x3000 +0x6b21 0x8966 +0x6b22 0x8964 +0x6b23 0x896d +0x6b24 0x896a +0x6b25 0x896f +0x6b26 0x8974 +0x6b27 0x8977 +0x6b28 0x897e +0x6b29 0x8983 +0x6b2a 0x8988 +0x6b2b 0x898a +0x6b2c 0x8993 +0x6b2d 0x8998 +0x6b2e 0x89a1 +0x6b2f 0x89a9 +0x6b30 0x89a6 +0x6b31 0x89ac +0x6b32 0x89af +0x6b33 0x89b2 +0x6b34 0x89ba +0x6b35 0x89bd +0x6b36 0x89bf +0x6b37 0x89c0 +0x6b38 0x89da +0x6b39 0x89dc +0x6b3a 0x89dd +0x6b3b 0x89e7 +0x6b3c 0x89f4 +0x6b3d 0x89f8 +0x6b3e 0x8a03 +0x6b3f 0x8a16 +0x6b40 0x8a10 +0x6b41 0x8a0c +0x6b42 0x8a1b +0x6b43 0x8a1d +0x6b44 0x8a25 +0x6b45 0x8a36 +0x6b46 0x8a41 +0x6b47 0x8a5b +0x6b48 0x8a52 +0x6b49 0x8a46 +0x6b4a 0x8a48 +0x6b4b 0x8a7c +0x6b4c 0x8a6d +0x6b4d 0x8a6c +0x6b4e 0x8a62 +0x6b4f 0x8a85 +0x6b50 0x8a82 +0x6b51 0x8a84 +0x6b52 0x8aa8 +0x6b53 0x8aa1 +0x6b54 0x8a91 +0x6b55 0x8aa5 +0x6b56 0x8aa6 +0x6b57 0x8a9a +0x6b58 0x8aa3 +0x6b59 0x8ac4 +0x6b5a 0x8acd +0x6b5b 0x8ac2 +0x6b5c 0x8ada +0x6b5d 0x8aeb +0x6b5e 0x8af3 +0x6b5f 0x8ae7 +0x6b60 0x8ae4 +0x6b61 0x8af1 +0x6b62 0x8b14 +0x6b63 0x8ae0 +0x6b64 0x8ae2 +0x6b65 0x8af7 +0x6b66 0x8ade +0x6b67 0x8adb +0x6b68 0x8b0c +0x6b69 0x8b07 +0x6b6a 0x8b1a +0x6b6b 0x8ae1 +0x6b6c 0x8b16 +0x6b6d 0x8b10 +0x6b6e 0x8b17 +0x6b6f 0x8b20 +0x6b70 0x8b33 +0x6b71 0x97ab +0x6b72 0x8b26 +0x6b73 0x8b2b +0x6b74 0x8b3e +0x6b75 0x8b28 +0x6b76 0x8b41 +0x6b77 0x8b4c +0x6b78 0x8b4f +0x6b79 0x8b4e +0x6b7a 0x8b49 +0x6b7b 0x8b56 +0x6b7c 0x8b5b +0x6b7d 0x8b5a +0x6b7e 0x8b6b +0x6b7f 0x3000 +0x6c20 0x3000 +0x6c21 0x8b5f +0x6c22 0x8b6c +0x6c23 0x8b6f +0x6c24 0x8b74 +0x6c25 0x8b7d +0x6c26 0x8b80 +0x6c27 0x8b8c +0x6c28 0x8b8e +0x6c29 0x8b92 +0x6c2a 0x8b93 +0x6c2b 0x8b96 +0x6c2c 0x8b99 +0x6c2d 0x8b9a +0x6c2e 0x8c3a +0x6c2f 0x8c41 +0x6c30 0x8c3f +0x6c31 0x8c48 +0x6c32 0x8c4c +0x6c33 0x8c4e +0x6c34 0x8c50 +0x6c35 0x8c55 +0x6c36 0x8c62 +0x6c37 0x8c6c +0x6c38 0x8c78 +0x6c39 0x8c7a +0x6c3a 0x8c82 +0x6c3b 0x8c89 +0x6c3c 0x8c85 +0x6c3d 0x8c8a +0x6c3e 0x8c8d +0x6c3f 0x8c8e +0x6c40 0x8c94 +0x6c41 0x8c7c +0x6c42 0x8c98 +0x6c43 0x621d +0x6c44 0x8cad +0x6c45 0x8caa +0x6c46 0x8cbd +0x6c47 0x8cb2 +0x6c48 0x8cb3 +0x6c49 0x8cae +0x6c4a 0x8cb6 +0x6c4b 0x8cc8 +0x6c4c 0x8cc1 +0x6c4d 0x8ce4 +0x6c4e 0x8ce3 +0x6c4f 0x8cda +0x6c50 0x8cfd +0x6c51 0x8cfa +0x6c52 0x8cfb +0x6c53 0x8d04 +0x6c54 0x8d05 +0x6c55 0x8d0a +0x6c56 0x8d07 +0x6c57 0x8d0f +0x6c58 0x8d0d +0x6c59 0x8d10 +0x6c5a 0x9f4e +0x6c5b 0x8d13 +0x6c5c 0x8ccd +0x6c5d 0x8d14 +0x6c5e 0x8d16 +0x6c5f 0x8d67 +0x6c60 0x8d6d +0x6c61 0x8d71 +0x6c62 0x8d73 +0x6c63 0x8d81 +0x6c64 0x8d99 +0x6c65 0x8dc2 +0x6c66 0x8dbe +0x6c67 0x8dba +0x6c68 0x8dcf +0x6c69 0x8dda +0x6c6a 0x8dd6 +0x6c6b 0x8dcc +0x6c6c 0x8ddb +0x6c6d 0x8dcb +0x6c6e 0x8dea +0x6c6f 0x8deb +0x6c70 0x8ddf +0x6c71 0x8de3 +0x6c72 0x8dfc +0x6c73 0x8e08 +0x6c74 0x8e09 +0x6c75 0x8dff +0x6c76 0x8e1d +0x6c77 0x8e1e +0x6c78 0x8e10 +0x6c79 0x8e1f +0x6c7a 0x8e42 +0x6c7b 0x8e35 +0x6c7c 0x8e30 +0x6c7d 0x8e34 +0x6c7e 0x8e4a +0x6c7f 0x3000 +0x6d20 0x3000 +0x6d21 0x8e47 +0x6d22 0x8e49 +0x6d23 0x8e4c +0x6d24 0x8e50 +0x6d25 0x8e48 +0x6d26 0x8e59 +0x6d27 0x8e64 +0x6d28 0x8e60 +0x6d29 0x8e2a +0x6d2a 0x8e63 +0x6d2b 0x8e55 +0x6d2c 0x8e76 +0x6d2d 0x8e72 +0x6d2e 0x8e7c +0x6d2f 0x8e81 +0x6d30 0x8e87 +0x6d31 0x8e85 +0x6d32 0x8e84 +0x6d33 0x8e8b +0x6d34 0x8e8a +0x6d35 0x8e93 +0x6d36 0x8e91 +0x6d37 0x8e94 +0x6d38 0x8e99 +0x6d39 0x8eaa +0x6d3a 0x8ea1 +0x6d3b 0x8eac +0x6d3c 0x8eb0 +0x6d3d 0x8ec6 +0x6d3e 0x8eb1 +0x6d3f 0x8ebe +0x6d40 0x8ec5 +0x6d41 0x8ec8 +0x6d42 0x8ecb +0x6d43 0x8edb +0x6d44 0x8ee3 +0x6d45 0x8efc +0x6d46 0x8efb +0x6d47 0x8eeb +0x6d48 0x8efe +0x6d49 0x8f0a +0x6d4a 0x8f05 +0x6d4b 0x8f15 +0x6d4c 0x8f12 +0x6d4d 0x8f19 +0x6d4e 0x8f13 +0x6d4f 0x8f1c +0x6d50 0x8f1f +0x6d51 0x8f1b +0x6d52 0x8f0c +0x6d53 0x8f26 +0x6d54 0x8f33 +0x6d55 0x8f3b +0x6d56 0x8f39 +0x6d57 0x8f45 +0x6d58 0x8f42 +0x6d59 0x8f3e +0x6d5a 0x8f4c +0x6d5b 0x8f49 +0x6d5c 0x8f46 +0x6d5d 0x8f4e +0x6d5e 0x8f57 +0x6d5f 0x8f5c +0x6d60 0x8f62 +0x6d61 0x8f63 +0x6d62 0x8f64 +0x6d63 0x8f9c +0x6d64 0x8f9f +0x6d65 0x8fa3 +0x6d66 0x8fad +0x6d67 0x8faf +0x6d68 0x8fb7 +0x6d69 0x8fda +0x6d6a 0x8fe5 +0x6d6b 0x8fe2 +0x6d6c 0x8fea +0x6d6d 0x8fef +0x6d6e 0x9087 +0x6d6f 0x8ff4 +0x6d70 0x9005 +0x6d71 0x8ff9 +0x6d72 0x8ffa +0x6d73 0x9011 +0x6d74 0x9015 +0x6d75 0x9021 +0x6d76 0x900d +0x6d77 0x901e +0x6d78 0x9016 +0x6d79 0x900b +0x6d7a 0x9027 +0x6d7b 0x9036 +0x6d7c 0x9035 +0x6d7d 0x9039 +0x6d7e 0x8ff8 +0x6d7f 0x3000 +0x6e20 0x3000 +0x6e21 0x904f +0x6e22 0x9050 +0x6e23 0x9051 +0x6e24 0x9052 +0x6e25 0x900e +0x6e26 0x9049 +0x6e27 0x903e +0x6e28 0x9056 +0x6e29 0x9058 +0x6e2a 0x905e +0x6e2b 0x9068 +0x6e2c 0x906f +0x6e2d 0x9076 +0x6e2e 0x96a8 +0x6e2f 0x9072 +0x6e30 0x9082 +0x6e31 0x907d +0x6e32 0x9081 +0x6e33 0x9080 +0x6e34 0x908a +0x6e35 0x9089 +0x6e36 0x908f +0x6e37 0x90a8 +0x6e38 0x90af +0x6e39 0x90b1 +0x6e3a 0x90b5 +0x6e3b 0x90e2 +0x6e3c 0x90e4 +0x6e3d 0x6248 +0x6e3e 0x90db +0x6e3f 0x9102 +0x6e40 0x9112 +0x6e41 0x9119 +0x6e42 0x9132 +0x6e43 0x9130 +0x6e44 0x914a +0x6e45 0x9156 +0x6e46 0x9158 +0x6e47 0x9163 +0x6e48 0x9165 +0x6e49 0x9169 +0x6e4a 0x9173 +0x6e4b 0x9172 +0x6e4c 0x918b +0x6e4d 0x9189 +0x6e4e 0x9182 +0x6e4f 0x91a2 +0x6e50 0x91ab +0x6e51 0x91af +0x6e52 0x91aa +0x6e53 0x91b5 +0x6e54 0x91b4 +0x6e55 0x91ba +0x6e56 0x91c0 +0x6e57 0x91c1 +0x6e58 0x91c9 +0x6e59 0x91cb +0x6e5a 0x91d0 +0x6e5b 0x91d6 +0x6e5c 0x91df +0x6e5d 0x91e1 +0x6e5e 0x91db +0x6e5f 0x91fc +0x6e60 0x91f5 +0x6e61 0x91f6 +0x6e62 0x921e +0x6e63 0x91ff +0x6e64 0x9214 +0x6e65 0x922c +0x6e66 0x9215 +0x6e67 0x9211 +0x6e68 0x925e +0x6e69 0x9257 +0x6e6a 0x9245 +0x6e6b 0x9249 +0x6e6c 0x9264 +0x6e6d 0x9248 +0x6e6e 0x9295 +0x6e6f 0x923f +0x6e70 0x924b +0x6e71 0x9250 +0x6e72 0x929c +0x6e73 0x9296 +0x6e74 0x9293 +0x6e75 0x929b +0x6e76 0x925a +0x6e77 0x92cf +0x6e78 0x92b9 +0x6e79 0x92b7 +0x6e7a 0x92e9 +0x6e7b 0x930f +0x6e7c 0x92fa +0x6e7d 0x9344 +0x6e7e 0x932e +0x6e7f 0x3000 +0x6f20 0x3000 +0x6f21 0x9319 +0x6f22 0x9322 +0x6f23 0x931a +0x6f24 0x9323 +0x6f25 0x933a +0x6f26 0x9335 +0x6f27 0x933b +0x6f28 0x935c +0x6f29 0x9360 +0x6f2a 0x937c +0x6f2b 0x936e +0x6f2c 0x9356 +0x6f2d 0x93b0 +0x6f2e 0x93ac +0x6f2f 0x93ad +0x6f30 0x9394 +0x6f31 0x93b9 +0x6f32 0x93d6 +0x6f33 0x93d7 +0x6f34 0x93e8 +0x6f35 0x93e5 +0x6f36 0x93d8 +0x6f37 0x93c3 +0x6f38 0x93dd +0x6f39 0x93d0 +0x6f3a 0x93c8 +0x6f3b 0x93e4 +0x6f3c 0x941a +0x6f3d 0x9414 +0x6f3e 0x9413 +0x6f3f 0x9403 +0x6f40 0x9407 +0x6f41 0x9410 +0x6f42 0x9436 +0x6f43 0x942b +0x6f44 0x9435 +0x6f45 0x9421 +0x6f46 0x943a +0x6f47 0x9441 +0x6f48 0x9452 +0x6f49 0x9444 +0x6f4a 0x945b +0x6f4b 0x9460 +0x6f4c 0x9462 +0x6f4d 0x945e +0x6f4e 0x946a +0x6f4f 0x9229 +0x6f50 0x9470 +0x6f51 0x9475 +0x6f52 0x9477 +0x6f53 0x947d +0x6f54 0x945a +0x6f55 0x947c +0x6f56 0x947e +0x6f57 0x9481 +0x6f58 0x947f +0x6f59 0x9582 +0x6f5a 0x9587 +0x6f5b 0x958a +0x6f5c 0x9594 +0x6f5d 0x9596 +0x6f5e 0x9598 +0x6f5f 0x9599 +0x6f60 0x95a0 +0x6f61 0x95a8 +0x6f62 0x95a7 +0x6f63 0x95ad +0x6f64 0x95bc +0x6f65 0x95bb +0x6f66 0x95b9 +0x6f67 0x95be +0x6f68 0x95ca +0x6f69 0x6ff6 +0x6f6a 0x95c3 +0x6f6b 0x95cd +0x6f6c 0x95cc +0x6f6d 0x95d5 +0x6f6e 0x95d4 +0x6f6f 0x95d6 +0x6f70 0x95dc +0x6f71 0x95e1 +0x6f72 0x95e5 +0x6f73 0x95e2 +0x6f74 0x9621 +0x6f75 0x9628 +0x6f76 0x962e +0x6f77 0x962f +0x6f78 0x9642 +0x6f79 0x964c +0x6f7a 0x964f +0x6f7b 0x964b +0x6f7c 0x9677 +0x6f7d 0x965c +0x6f7e 0x965e +0x6f7f 0x3000 +0x7020 0x3000 +0x7021 0x965d +0x7022 0x965f +0x7023 0x9666 +0x7024 0x9672 +0x7025 0x966c +0x7026 0x968d +0x7027 0x9698 +0x7028 0x9695 +0x7029 0x9697 +0x702a 0x96aa +0x702b 0x96a7 +0x702c 0x96b1 +0x702d 0x96b2 +0x702e 0x96b0 +0x702f 0x96b4 +0x7030 0x96b6 +0x7031 0x96b8 +0x7032 0x96b9 +0x7033 0x96ce +0x7034 0x96cb +0x7035 0x96c9 +0x7036 0x96cd +0x7037 0x894d +0x7038 0x96dc +0x7039 0x970d +0x703a 0x96d5 +0x703b 0x96f9 +0x703c 0x9704 +0x703d 0x9706 +0x703e 0x9708 +0x703f 0x9713 +0x7040 0x970e +0x7041 0x9711 +0x7042 0x970f +0x7043 0x9716 +0x7044 0x9719 +0x7045 0x9724 +0x7046 0x972a +0x7047 0x9730 +0x7048 0x9739 +0x7049 0x973d +0x704a 0x973e +0x704b 0x9744 +0x704c 0x9746 +0x704d 0x9748 +0x704e 0x9742 +0x704f 0x9749 +0x7050 0x975c +0x7051 0x9760 +0x7052 0x9764 +0x7053 0x9766 +0x7054 0x9768 +0x7055 0x52d2 +0x7056 0x976b +0x7057 0x9771 +0x7058 0x9779 +0x7059 0x9785 +0x705a 0x977c +0x705b 0x9781 +0x705c 0x977a +0x705d 0x9786 +0x705e 0x978b +0x705f 0x978f +0x7060 0x9790 +0x7061 0x979c +0x7062 0x97a8 +0x7063 0x97a6 +0x7064 0x97a3 +0x7065 0x97b3 +0x7066 0x97b4 +0x7067 0x97c3 +0x7068 0x97c6 +0x7069 0x97c8 +0x706a 0x97cb +0x706b 0x97dc +0x706c 0x97ed +0x706d 0x9f4f +0x706e 0x97f2 +0x706f 0x7adf +0x7070 0x97f6 +0x7071 0x97f5 +0x7072 0x980f +0x7073 0x980c +0x7074 0x9838 +0x7075 0x9824 +0x7076 0x9821 +0x7077 0x9837 +0x7078 0x983d +0x7079 0x9846 +0x707a 0x984f +0x707b 0x984b +0x707c 0x986b +0x707d 0x986f +0x707e 0x9870 +0x707f 0x3000 +0x7120 0x3000 +0x7121 0x9871 +0x7122 0x9874 +0x7123 0x9873 +0x7124 0x98aa +0x7125 0x98af +0x7126 0x98b1 +0x7127 0x98b6 +0x7128 0x98c4 +0x7129 0x98c3 +0x712a 0x98c6 +0x712b 0x98e9 +0x712c 0x98eb +0x712d 0x9903 +0x712e 0x9909 +0x712f 0x9912 +0x7130 0x9914 +0x7131 0x9918 +0x7132 0x9921 +0x7133 0x991d +0x7134 0x991e +0x7135 0x9924 +0x7136 0x9920 +0x7137 0x992c +0x7138 0x992e +0x7139 0x993d +0x713a 0x993e +0x713b 0x9942 +0x713c 0x9949 +0x713d 0x9945 +0x713e 0x9950 +0x713f 0x994b +0x7140 0x9951 +0x7141 0x9952 +0x7142 0x994c +0x7143 0x9955 +0x7144 0x9997 +0x7145 0x9998 +0x7146 0x99a5 +0x7147 0x99ad +0x7148 0x99ae +0x7149 0x99bc +0x714a 0x99df +0x714b 0x99db +0x714c 0x99dd +0x714d 0x99d8 +0x714e 0x99d1 +0x714f 0x99ed +0x7150 0x99ee +0x7151 0x99f1 +0x7152 0x99f2 +0x7153 0x99fb +0x7154 0x99f8 +0x7155 0x9a01 +0x7156 0x9a0f +0x7157 0x9a05 +0x7158 0x99e2 +0x7159 0x9a19 +0x715a 0x9a2b +0x715b 0x9a37 +0x715c 0x9a45 +0x715d 0x9a42 +0x715e 0x9a40 +0x715f 0x9a43 +0x7160 0x9a3e +0x7161 0x9a55 +0x7162 0x9a4d +0x7163 0x9a5b +0x7164 0x9a57 +0x7165 0x9a5f +0x7166 0x9a62 +0x7167 0x9a65 +0x7168 0x9a64 +0x7169 0x9a69 +0x716a 0x9a6b +0x716b 0x9a6a +0x716c 0x9aad +0x716d 0x9ab0 +0x716e 0x9abc +0x716f 0x9ac0 +0x7170 0x9acf +0x7171 0x9ad1 +0x7172 0x9ad3 +0x7173 0x9ad4 +0x7174 0x9ade +0x7175 0x9adf +0x7176 0x9ae2 +0x7177 0x9ae3 +0x7178 0x9ae6 +0x7179 0x9aef +0x717a 0x9aeb +0x717b 0x9aee +0x717c 0x9af4 +0x717d 0x9af1 +0x717e 0x9af7 +0x717f 0x3000 +0x7220 0x3000 +0x7221 0x9afb +0x7222 0x9b06 +0x7223 0x9b18 +0x7224 0x9b1a +0x7225 0x9b1f +0x7226 0x9b22 +0x7227 0x9b23 +0x7228 0x9b25 +0x7229 0x9b27 +0x722a 0x9b28 +0x722b 0x9b29 +0x722c 0x9b2a +0x722d 0x9b2e +0x722e 0x9b2f +0x722f 0x9b32 +0x7230 0x9b44 +0x7231 0x9b43 +0x7232 0x9b4f +0x7233 0x9b4d +0x7234 0x9b4e +0x7235 0x9b51 +0x7236 0x9b58 +0x7237 0x9b74 +0x7238 0x9b93 +0x7239 0x9b83 +0x723a 0x9b91 +0x723b 0x9b96 +0x723c 0x9b97 +0x723d 0x9b9f +0x723e 0x9ba0 +0x723f 0x9ba8 +0x7240 0x9bb4 +0x7241 0x9bc0 +0x7242 0x9bca +0x7243 0x9bb9 +0x7244 0x9bc6 +0x7245 0x9bcf +0x7246 0x9bd1 +0x7247 0x9bd2 +0x7248 0x9be3 +0x7249 0x9be2 +0x724a 0x9be4 +0x724b 0x9bd4 +0x724c 0x9be1 +0x724d 0x9c3a +0x724e 0x9bf2 +0x724f 0x9bf1 +0x7250 0x9bf0 +0x7251 0x9c15 +0x7252 0x9c14 +0x7253 0x9c09 +0x7254 0x9c13 +0x7255 0x9c0c +0x7256 0x9c06 +0x7257 0x9c08 +0x7258 0x9c12 +0x7259 0x9c0a +0x725a 0x9c04 +0x725b 0x9c2e +0x725c 0x9c1b +0x725d 0x9c25 +0x725e 0x9c24 +0x725f 0x9c21 +0x7260 0x9c30 +0x7261 0x9c47 +0x7262 0x9c32 +0x7263 0x9c46 +0x7264 0x9c3e +0x7265 0x9c5a +0x7266 0x9c60 +0x7267 0x9c67 +0x7268 0x9c76 +0x7269 0x9c78 +0x726a 0x9ce7 +0x726b 0x9cec +0x726c 0x9cf0 +0x726d 0x9d09 +0x726e 0x9d08 +0x726f 0x9ceb +0x7270 0x9d03 +0x7271 0x9d06 +0x7272 0x9d2a +0x7273 0x9d26 +0x7274 0x9daf +0x7275 0x9d23 +0x7276 0x9d1f +0x7277 0x9d44 +0x7278 0x9d15 +0x7279 0x9d12 +0x727a 0x9d41 +0x727b 0x9d3f +0x727c 0x9d3e +0x727d 0x9d46 +0x727e 0x9d48 +0x727f 0x3000 +0x7320 0x3000 +0x7321 0x9d5d +0x7322 0x9d5e +0x7323 0x9d64 +0x7324 0x9d51 +0x7325 0x9d50 +0x7326 0x9d59 +0x7327 0x9d72 +0x7328 0x9d89 +0x7329 0x9d87 +0x732a 0x9dab +0x732b 0x9d6f +0x732c 0x9d7a +0x732d 0x9d9a +0x732e 0x9da4 +0x732f 0x9da9 +0x7330 0x9db2 +0x7331 0x9dc4 +0x7332 0x9dc1 +0x7333 0x9dbb +0x7334 0x9db8 +0x7335 0x9dba +0x7336 0x9dc6 +0x7337 0x9dcf +0x7338 0x9dc2 +0x7339 0x9dd9 +0x733a 0x9dd3 +0x733b 0x9df8 +0x733c 0x9de6 +0x733d 0x9ded +0x733e 0x9def +0x733f 0x9dfd +0x7340 0x9e1a +0x7341 0x9e1b +0x7342 0x9e1e +0x7343 0x9e75 +0x7344 0x9e79 +0x7345 0x9e7d +0x7346 0x9e81 +0x7347 0x9e88 +0x7348 0x9e8b +0x7349 0x9e8c +0x734a 0x9e92 +0x734b 0x9e95 +0x734c 0x9e91 +0x734d 0x9e9d +0x734e 0x9ea5 +0x734f 0x9ea9 +0x7350 0x9eb8 +0x7351 0x9eaa +0x7352 0x9ead +0x7353 0x9761 +0x7354 0x9ecc +0x7355 0x9ece +0x7356 0x9ecf +0x7357 0x9ed0 +0x7358 0x9ed4 +0x7359 0x9edc +0x735a 0x9ede +0x735b 0x9edd +0x735c 0x9ee0 +0x735d 0x9ee5 +0x735e 0x9ee8 +0x735f 0x9eef +0x7360 0x9ef4 +0x7361 0x9ef6 +0x7362 0x9ef7 +0x7363 0x9ef9 +0x7364 0x9efb +0x7365 0x9efc +0x7366 0x9efd +0x7367 0x9f07 +0x7368 0x9f08 +0x7369 0x76b7 +0x736a 0x9f15 +0x736b 0x9f21 +0x736c 0x9f2c +0x736d 0x9f3e +0x736e 0x9f4a +0x736f 0x9f52 +0x7370 0x9f54 +0x7371 0x9f63 +0x7372 0x9f5f +0x7373 0x9f60 +0x7374 0x9f61 +0x7375 0x9f66 +0x7376 0x9f67 +0x7377 0x9f6c +0x7378 0x9f6a +0x7379 0x9f77 +0x737a 0x9f72 +0x737b 0x9f76 +0x737c 0x9f95 +0x737d 0x9f9c +0x737e 0x9fa0 +0x737f 0x3000 +0x7420 0x3000 +0x7421 0x582f +0x7422 0x69c7 +0x7423 0x9059 +0x7424 0x7464 +0x7425 0x51dc +0x7426 0x7199 +0x7427 0x3000 +0x7428 0x3000 +0x7429 0x3000 +0x742a 0x3000 +0x742b 0x3000 +0x742c 0x3000 +0x742d 0x3000 +0x742e 0x3000 +0x742f 0x3000 +0x7430 0x3000 +0x7431 0x3000 +0x7432 0x3000 +0x7433 0x3000 +0x7434 0x3000 +0x7435 0x3000 +0x7436 0x3000 +0x7437 0x3000 +0x7438 0x3000 +0x7439 0x3000 +0x743a 0x3000 +0x743b 0x3000 +0x743c 0x3000 +0x743d 0x3000 +0x743e 0x3000 +0x743f 0x3000 +0x7440 0x3000 +0x7441 0x3000 +0x7442 0x3000 +0x7443 0x3000 +0x7444 0x3000 +0x7445 0x3000 +0x7446 0x3000 +0x7447 0x3000 +0x7448 0x3000 +0x7449 0x3000 +0x744a 0x3000 +0x744b 0x3000 +0x744c 0x3000 +0x744d 0x3000 +0x744e 0x3000 +0x744f 0x3000 +0x7450 0x3000 +0x7451 0x3000 +0x7452 0x3000 +0x7453 0x3000 +0x7454 0x3000 +0x7455 0x3000 +0x7456 0x3000 +0x7457 0x3000 +0x7458 0x3000 +0x7459 0x3000 +0x745a 0x3000 +0x745b 0x3000 +0x745c 0x3000 +0x745d 0x3000 +0x745e 0x3000 +0x745f 0x3000 +0x7460 0x3000 +0x7461 0x3000 +0x7462 0x3000 +0x7463 0x3000 +0x7464 0x3000 +0x7465 0x3000 +0x7466 0x3000 +0x7467 0x3000 +0x7468 0x3000 +0x7469 0x3000 +0x746a 0x3000 +0x746b 0x3000 +0x746c 0x3000 +0x746d 0x3000 +0x746e 0x3000 +0x746f 0x3000 +0x7470 0x3000 +0x7471 0x3000 +0x7472 0x3000 +0x7473 0x3000 +0x7474 0x3000 +0x7475 0x3000 +0x7476 0x3000 +0x7477 0x3000 +0x7478 0x3000 +0x7479 0x3000 +0x747a 0x3000 +0x747b 0x3000 +0x747c 0x3000 +0x747d 0x3000 +0x747e 0x3000 +0x747f 0x3000 +ENDMAPPING STARTMAPPING unicode # override default identity mapping UNDEFINE 0x0000 0x747F Index: xc/fonts/encodings/large/jisx0212.1990-0.enc diff -u xc/fonts/encodings/large/jisx0212.1990-0.enc:1.2 xc/fonts/encodings/large/jisx0212.1990-0.enc:1.3 --- xc/fonts/encodings/large/jisx0212.1990-0.enc:1.2 Mon Dec 16 22:41:38 2002 +++ xc/fonts/encodings/large/jisx0212.1990-0.enc Sun Oct 19 14:34:45 2003 @@ -1,4 +1,5 @@ STARTENCODING jisx0212.1990-0 +# $XFree86: xc/fonts/encodings/large/jisx0212.1990-0.enc,v 1.3 2003/10/19 18:34:45 dawes Exp $ SIZE 0x6E 0x80 FIRSTINDEX 0x20 0x20 STARTMAPPING unicode Index: xc/fonts/encodings/large/sun.unicode.india-0.enc diff -u /dev/null xc/fonts/encodings/large/sun.unicode.india-0.enc:1.2 --- /dev/null Sat Feb 28 21:41:03 2004 +++ xc/fonts/encodings/large/sun.unicode.india-0.enc Mon Dec 8 18:59:13 2003 @@ -0,0 +1,118 @@ +# $XFree86: xc/fonts/encodings/large/sun.unicode.india-0.enc,v 1.2 2003/12/08 23:59:13 dawes Exp $ +STARTENCODING sun.unicode.india-0 +SIZE 0xF8 0x100 +FIRSTINDEX 0x00 0x20 +STARTMAPPING unicode +UNDEFINE 0x0000 0xF800 +0x0020 0x007E 0x0020 +0x0900 0x0903 0x0900 +0x0905 0x0939 0x0905 +0x093C 0x094D 0x093C +0x0950 0x0954 0x0950 +0x0958 0x0970 0x0958 +0x0981 0x0983 0x0981 +0x0985 0x098C 0x0985 +0x098F 0x0990 0x098F +0x0993 0x09A8 0x0993 +0x09AA 0x09B0 0x09AA +0x09B2 0x09B2 +0x09B6 0x09B9 0x09B6 +0x09BC 0x09BC +0x09BE 0x09C4 0x09BE +0x09C7 0x09C8 0x09C7 +0x09CB 0x09CD 0x09CB +0x09D7 0x09D7 +0x09DC 0x09DD 0x09DC +0x09DF 0x09E3 0x09DF +0x09E6 0x09FA 0x09E6 +0x0A02 0x0A02 +0x0A05 0x0A0A 0x0A05 +0x0A0F 0x0A10 0x0A0F +0x0A13 0x0A28 0x0A13 +0x0A2A 0x0A30 0x0A2A +0x0A32 0x0A33 0x0A32 +0x0A35 0x0A36 0x0A35 +0x0A38 0x0A39 0x0A38 +0x0A3C 0x0A3C +0x0A3E 0x0A42 0x0A3E +0x0A47 0x0A48 0x0A47 +0x0A4B 0x0A4D 0x0A4B +0x0A59 0x0A5C 0x0A59 +0x0A5E 0x0A5E +0x0A66 0x0A74 0x0A66 +0x0A81 0x0A83 0x0A81 +0x0A85 0x0A8B 0x0A85 +0x0A8D 0x0A8D +0x0A8F 0x0A91 0x0A8F +0x0A93 0x0AA8 0x0A93 +0x0AAA 0x0AB0 0x0AAA +0x0AB2 0x0AB3 0x0AB2 +0x0AB5 0x0AB9 0x0AB5 +0x0ABC 0x0AC5 0x0ABC +0x0AC7 0x0AC9 0x0AC7 +0x0ACB 0x0ACD 0x0ACB +0x0AD0 0x0AD0 +0x0AE0 0x0AE0 +0x0AE6 0x0AEF 0x0AE6 +0x0B82 0x0B83 0x0B82 +0x0B85 0x0B8A 0x0B85 +0x0B8E 0x0B90 0x0B8E +0x0B92 0x0B95 0x0B92 +0x0B99 0x0B9A 0x0B99 +0x0B9C 0x0B9C +0x0B9E 0x0B9F 0x0B9E +0x0BA3 0x0BA4 0x0BA3 +0x0BA8 0x0BAA 0x0BA8 +0x0BAE 0x0BB5 0x0BAE +0x0BB7 0x0BB9 0x0BB7 +0x0BBE 0x0BC2 0x0BBE +0x0BC6 0x0BC8 0x0BC6 +0x0BCA 0x0BCD 0x0BCA +0x0BD7 0x0BD7 +0x0BE7 0x0BF2 0x0BE7 +0x0C00 0x0C03 0x0C00 +0x0C05 0x0C0C 0x0C05 +0x0C0E 0x0C10 0x0C0E +0x0C12 0x0C28 0x0C12 +0x0C2A 0x0C33 0x0C2A +0x0C35 0x0C39 0x0C35 +0x0C3E 0x0C44 0x0C3E +0x0C46 0x0C48 0x0C46 +0x0C4A 0x0C4D 0x0C4A +0x0C55 0x0C56 0x0C55 +0x0C60 0x0C61 0x0C60 +0x0C66 0x0C6F 0x0C66 +0x0C82 0x0C83 0x0C82 +0x0C85 0x0C8C 0x0C85 +0x0C8E 0x0C90 0x0C8E +0x0C92 0x0CA8 0x0C92 +0x0CAA 0x0CB3 0x0CAA +0x0CB5 0x0CB9 0x0CB5 +0x0CBE 0x0CC4 0x0CBE +0x0CC6 0x0CC8 0x0CC6 +0x0CCA 0x0CCD 0x0CCA +0x0CD5 0x0CD6 0x0CD5 +0x0CDE 0x0CDE +0x0CE0 0x0CE1 0x0CE0 +0x0CE6 0x0CEF 0x0CE6 +0x0D02 0x0D03 0x0D02 +0x0D05 0x0D0C 0x0D05 +0x0D0E 0x0D10 0x0D0E +0x0D12 0x0D28 0x0D12 +0x0D2A 0x0D39 0x0D2A +0x0D3E 0x0D43 0x0D3E +0x0D46 0x0D48 0x0D46 +0x0D4A 0x0D4D 0x0D4A +0x0D57 0x0D57 +0x0D60 0x0D61 0x0D60 +0x0D66 0x0D6F 0x0D66 +0xF31F 0xF33D 0xF31F +0xF360 0xF478 0xF360 +0xF480 0xF4C8 0xF480 +0xF4EB 0xF577 0xF4EB +0xF59C 0xF61E 0xF59C +0xF64C 0xF6AF 0xF64C +0xF6B1 0xF6C1 0xF6B1 +0xF6E2 0xF766 0xF6E2 +ENDMAPPING +ENDENCODING Index: xc/fonts/scaled/CID/Imakefile diff -u xc/fonts/scaled/CID/Imakefile:1.4 xc/fonts/scaled/CID/Imakefile:1.5 --- xc/fonts/scaled/CID/Imakefile:1.4 Sat Aug 28 07:45:39 1999 +++ xc/fonts/scaled/CID/Imakefile Wed Dec 31 14:30:36 2003 @@ -1,13 +1,13 @@ -XCOMM $XFree86: xc/fonts/scaled/CID/Imakefile,v 1.4 1999/08/28 11:45:39 dawes Exp $ +XCOMM $XFree86: xc/fonts/scaled/CID/Imakefile,v 1.5 2003/12/31 19:30:36 dawes Exp $ FONTINSTDIR = $(FONTDIR)/CID +MakeFontsScale(NullParameter) MakeFontsDir(fonts.scale) /* * Replace the next line with 'InstallFonts($(FONTINSTDIR))' when fonts are * added. */ -InstallTarget(install,fonts.dir,$(INSTDATFLAGS),$(FONTINSTDIR)) +InstallFontsDir($(FONTINSTDIR)) -InstallFontScale($(FONTINSTDIR)) Index: xc/fonts/scaled/CID/fonts.scale diff -u xc/fonts/scaled/CID/fonts.scale:1.1 xc/fonts/scaled/CID/fonts.scale:removed --- xc/fonts/scaled/CID/fonts.scale:1.1 Mon May 3 01:58:53 1999 +++ xc/fonts/scaled/CID/fonts.scale Sat Feb 28 21:41:03 2004 @@ -1 +0,0 @@ -0 Index: xc/fonts/scaled/Ethiopic/Imakefile diff -u xc/fonts/scaled/Ethiopic/Imakefile:1.1 xc/fonts/scaled/Ethiopic/Imakefile:1.2 --- xc/fonts/scaled/Ethiopic/Imakefile:1.1 Mon Feb 3 21:18:19 2003 +++ xc/fonts/scaled/Ethiopic/Imakefile Wed Dec 31 14:30:36 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/fonts/scaled/Ethiopic/Imakefile,v 1.1 2003/02/04 02:18:19 dawes Exp $ +XCOMM $XFree86: xc/fonts/scaled/Ethiopic/Imakefile,v 1.2 2003/12/31 19:30:36 dawes Exp $ TTFFONTS = GohaTibebZemen.ttf OTFFONTS = GohaTibebZemen.otf @@ -18,3 +18,6 @@ DependSubdirs($(SUBDIRS)) #endif +InstallFontsDir($(TTFINSTDIR)) +InstallFontsDir($(OTFINSTDIR)) + Index: xc/fonts/scaled/Meltho/Imakefile diff -u xc/fonts/scaled/Meltho/Imakefile:1.2 xc/fonts/scaled/Meltho/Imakefile:1.3 --- xc/fonts/scaled/Meltho/Imakefile:1.2 Fri Jan 10 08:29:34 2003 +++ xc/fonts/scaled/Meltho/Imakefile Wed Dec 31 14:30:36 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/fonts/scaled/Meltho/Imakefile,v 1.2 2003/01/10 13:29:34 eich Exp $ +XCOMM $XFree86: xc/fonts/scaled/Meltho/Imakefile,v 1.3 2003/12/31 19:30:36 dawes Exp $ FONTS = SyrCOMAdiabene.otf SyrCOMAntioch.otf SyrCOMBatnan.otf \ SyrCOMBatnanBold.otf SyrCOMCtesiphon.otf SyrCOMEdessa.otf \ @@ -12,6 +12,7 @@ FONTINSTDIR = $(FONTDIR)/OTF +MakeFontsScale($(OBJS)) MakeFontsDir(fonts.scale) #if UseFreetype2 @@ -19,7 +20,6 @@ #endif InstallFonts($(FONTINSTDIR)) -InstallFontScale($(FONTINSTDIR)) InstallEncodingsDir($(ENCODINGSSRC),$(FONTINSTDIR)) #if UseFreetype2 InstallFcCache($(FONTINSTDIR)) Index: xc/fonts/scaled/Meltho/fonts.scale diff -u xc/fonts/scaled/Meltho/fonts.scale:1.1 xc/fonts/scaled/Meltho/fonts.scale:removed --- xc/fonts/scaled/Meltho/fonts.scale:1.1 Fri Aug 23 01:44:24 2002 +++ xc/fonts/scaled/Meltho/fonts.scale Sat Feb 28 21:41:03 2004 @@ -1,23 +0,0 @@ -22 -SyrCOMAdiabene.otf -Beth Mardutho-East Syriac Adiabene-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMAntioch.otf -Beth Mardutho-Estrangelo Antioch-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMBatnan.otf -Beth Mardutho-Serto Batnan-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMBatnanBold.otf -Beth Mardutho-Serto Batnan-bold-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMCtesiphon.otf -Beth Mardutho-East Syriac Ctesiphon-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMEdessa.otf -Beth Mardutho-Estrangelo Edessa-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMJerusalem.otf -Beth Mardutho-Serto Jerusalem-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMJerusalemBold.otf -Beth Mardutho-Serto Jerusalem-bold-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMJerusalemItalic.otf -Beth Mardutho-Serto Jerusalem-medium-i-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMJerusalemOutline.otf -Beth Mardutho-Serto Jerusalem Outline-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMKharput.otf -Beth Mardutho-Serto Kharput-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMMalankara.otf -Beth Mardutho-Serto Malankara-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMMardin.otf -Beth Mardutho-Serto Mardin-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMMardinBold.otf -Beth Mardutho-Serto Mardin-bold-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMMidyat.otf -Beth Mardutho-Estrangelo Midyat-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMNisibin.otf -Beth Mardutho-Estrangelo Nisibin-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMNisibinOutline.otf -Beth Mardutho-Estrangelo Nisibin Outline-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMQenNeshrin.otf -Beth Mardutho-Estrangelo Quenneshrin-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMTalada.otf -Beth Mardutho-Estrangelo Talada-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMTurAbdin.otf -Beth Mardutho-Estrangelo TurAbdin-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMUrhoy.otf -Beth Mardutho-Serto Urhoy-medium-r-normal--0-0-0-0-p-0-iso10646-1 -SyrCOMUrhoyBold.otf -Beth Mardutho-Serto Urhoy-bold-r-normal--0-0-0-0-p-0-iso10646-1 Index: xc/fonts/scaled/Speedo/Imakefile diff -u xc/fonts/scaled/Speedo/Imakefile:1.6 xc/fonts/scaled/Speedo/Imakefile:1.8 --- xc/fonts/scaled/Speedo/Imakefile:1.6 Wed Jan 17 12:33:10 2001 +++ xc/fonts/scaled/Speedo/Imakefile Mon Feb 16 13:14:35 2004 @@ -2,16 +2,17 @@ -XCOMM $XFree86: xc/fonts/scaled/Speedo/Imakefile,v 1.6 2001/01/17 17:33:10 dawes Exp $ +XCOMM $XFree86: xc/fonts/scaled/Speedo/Imakefile,v 1.8 2004/02/16 18:14:35 dawes Exp $ OBJS = font0648.spd font0649.spd font0709.spd font0710.spd \ font0419.spd font0582.spd font0583.spd font0611.spd FONTINSTDIR = $(FONTDIR)/Speedo +STATIC_FONTS_SCALE = y + MakeFontsDir(fonts.scale) InstallFonts($(FONTINSTDIR)) -InstallFontScale($(FONTINSTDIR)) InstallEncodingsDir($(ENCODINGSSRC),$(FONTINSTDIR)) Index: xc/fonts/scaled/TTF/Imakefile diff -u xc/fonts/scaled/TTF/Imakefile:1.4 xc/fonts/scaled/TTF/Imakefile:1.5 --- xc/fonts/scaled/TTF/Imakefile:1.4 Wed May 22 00:30:13 2002 +++ xc/fonts/scaled/TTF/Imakefile Wed Dec 31 14:30:39 2003 @@ -1,13 +1,19 @@ -XCOMM $XFree86: xc/fonts/scaled/TTF/Imakefile,v 1.4 2002/05/22 04:30:13 keithp Exp $ +XCOMM $XFree86: xc/fonts/scaled/TTF/Imakefile,v 1.5 2003/12/31 19:30:39 dawes Exp $ -FONTS = luximb.ttf luximbi.ttf luximr.ttf luximri.ttf \ - luxirb.ttf luxirbi.ttf luxirr.ttf luxirri.ttf \ - luxisb.ttf luxisbi.ttf luxisr.ttf luxisri.ttf +LUXIFONTS = luximb.ttf luximbi.ttf luximr.ttf luximri.ttf \ + luxirb.ttf luxirbi.ttf luxirr.ttf luxirri.ttf \ + luxisb.ttf luxisbi.ttf luxisr.ttf luxisri.ttf +VERASRCDIR = $(TOP)/extras/fonts/Bitstream-Vera +VERAFONTS = Vera.ttf VeraBI.ttf VeraBd.ttf VeraMoBI.ttf VeraMoBd.ttf \ + VeraMoIt.ttf VeraMono.ttf VeraSe.ttf VeraSeBd.ttf + +FONTS = $(LUXIFONTS) $(VERAFONTS) OBJS = $(FONTS) FONTINSTDIR = $(FONTDIR)/TTF +MakeFontsScale($(OBJS)) MakeFontsDir(fonts.scale) #if UseFreetype2 @@ -15,7 +21,6 @@ #endif InstallFonts($(FONTINSTDIR)) -InstallFontScale($(FONTINSTDIR)) InstallEncodingsDir($(ENCODINGSSRC),$(FONTINSTDIR)) #if UseFreetype2 InstallFcCache($(FONTINSTDIR)) @@ -25,3 +30,15 @@ MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) #endif + +LinkSourceFile(Vera.ttf,$(VERASRCDIR)) +LinkSourceFile(VeraBI.ttf,$(VERASRCDIR)) +LinkSourceFile(VeraBd.ttf,$(VERASRCDIR)) +LinkSourceFile(VeraIt.ttf,$(VERASRCDIR)) +LinkSourceFile(VeraMoBI.ttf,$(VERASRCDIR)) +LinkSourceFile(VeraMoBd.ttf,$(VERASRCDIR)) +LinkSourceFile(VeraMoIt.ttf,$(VERASRCDIR)) +LinkSourceFile(VeraMono.ttf,$(VERASRCDIR)) +LinkSourceFile(VeraSe.ttf,$(VERASRCDIR)) +LinkSourceFile(VeraSeBd.ttf,$(VERASRCDIR)) + Index: xc/fonts/scaled/TTF/fonts.scale diff -u xc/fonts/scaled/TTF/fonts.scale:1.2 xc/fonts/scaled/TTF/fonts.scale:removed --- xc/fonts/scaled/TTF/fonts.scale:1.2 Mon Dec 17 14:25:28 2001 +++ xc/fonts/scaled/TTF/fonts.scale Sat Feb 28 21:41:04 2004 @@ -1,121 +0,0 @@ -120 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-1 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-2 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-3 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-4 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-9 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-10 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-13 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-15 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso10646-1 -luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-adobe-standard -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-1 -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-2 -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-3 -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-4 -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-9 -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-10 -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-13 -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-15 -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso10646-1 -luximri.ttf -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-adobe-standard -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-1 -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-2 -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-3 -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-4 -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-9 -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-10 -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-13 -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-15 -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso10646-1 -luximb.ttf -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-adobe-standard -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-1 -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-2 -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-3 -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-4 -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-9 -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-10 -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-13 -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-15 -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso10646-1 -luximbi.ttf -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-adobe-standard -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-1 -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-2 -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-3 -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-4 -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-9 -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-10 -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-13 -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-15 -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso10646-1 -luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-adobe-standard -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-1 -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-2 -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-3 -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-4 -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-9 -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-10 -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-13 -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-15 -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso10646-1 -luxirb.ttf -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-adobe-standard -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-1 -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-2 -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-3 -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-4 -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-9 -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-10 -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-13 -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-15 -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso10646-1 -luxirbi.ttf -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-adobe-standard -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-1 -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-2 -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-3 -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-4 -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-9 -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-10 -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-13 -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-15 -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso10646-1 -luxirri.ttf -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-adobe-standard -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-1 -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-2 -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-3 -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-4 -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-9 -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-10 -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-13 -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-15 -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso10646-1 -luxisr.ttf -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-adobe-standard -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-1 -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-2 -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-3 -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-4 -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-9 -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-10 -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-13 -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-15 -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso10646-1 -luxisb.ttf -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-adobe-standard -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-1 -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-2 -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-3 -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-4 -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-9 -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-10 -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-13 -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-15 -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso10646-1 -luxisbi.ttf -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-adobe-standard -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-1 -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-2 -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-3 -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-4 -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-9 -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-10 -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-13 -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-15 -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso10646-1 -luxisri.ttf -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-adobe-standard Index: xc/fonts/scaled/Type1/Imakefile diff -u xc/fonts/scaled/Type1/Imakefile:1.16 xc/fonts/scaled/Type1/Imakefile:1.17 --- xc/fonts/scaled/Type1/Imakefile:1.16 Wed May 22 00:30:14 2002 +++ xc/fonts/scaled/Type1/Imakefile Wed Dec 31 14:30:39 2003 @@ -3,7 +3,7 @@ -XCOMM $XFree86: xc/fonts/scaled/Type1/Imakefile,v 1.16 2002/05/22 04:30:14 keithp Exp $ +XCOMM $XFree86: xc/fonts/scaled/Type1/Imakefile,v 1.17 2003/12/31 19:30:39 dawes Exp $ #define PassCDebugFlags /* as nothing */ @@ -30,13 +30,13 @@ FONTINSTDIR = $(FONTDIR)/Type1 +MakeFontsScale($(OBJS)) MakeFontsDir(fonts.scale) #if UseFreetype2 MakeFcCache($(FONTS)) #endif InstallFonts($(FONTINSTDIR)) -InstallFontScale($(FONTINSTDIR)) InstallEncodingsDir($(ENCODINGSSRC),$(FONTINSTDIR)) #if UseFreetype2 InstallFcCache($(FONTINSTDIR)) Index: xc/fonts/scaled/Type1/fonts.scale diff -u xc/fonts/scaled/Type1/fonts.scale:1.6 xc/fonts/scaled/Type1/fonts.scale:removed --- xc/fonts/scaled/Type1/fonts.scale:1.6 Mon Dec 17 14:25:28 2001 +++ xc/fonts/scaled/Type1/fonts.scale Sat Feb 28 21:41:04 2004 @@ -1,90 +0,0 @@ -89 -UTRG____.pfa -adobe-utopia-medium-r-normal--0-0-0-0-p-0-iso8859-1 -UTI_____.pfa -adobe-utopia-medium-i-normal--0-0-0-0-p-0-iso8859-1 -UTB_____.pfa -adobe-utopia-bold-r-normal--0-0-0-0-p-0-iso8859-1 -UTBI____.pfa -adobe-utopia-bold-i-normal--0-0-0-0-p-0-iso8859-1 -cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1 -cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-2 -cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-3 -cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-9 -couri.pfa -adobe-courier-medium-i-normal--0-0-0-0-m-0-iso8859-1 -couri.pfa -adobe-courier-medium-i-normal--0-0-0-0-m-0-iso8859-2 -couri.pfa -adobe-courier-medium-i-normal--0-0-0-0-m-0-iso8859-3 -couri.pfa -adobe-courier-medium-i-normal--0-0-0-0-m-0-iso8859-9 -courb.pfa -adobe-courier-bold-r-normal--0-0-0-0-m-0-iso8859-1 -courb.pfa -adobe-courier-bold-r-normal--0-0-0-0-m-0-iso8859-2 -courb.pfa -adobe-courier-bold-r-normal--0-0-0-0-m-0-iso8859-3 -courb.pfa -adobe-courier-bold-r-normal--0-0-0-0-m-0-iso8859-9 -courbi.pfa -adobe-courier-bold-i-normal--0-0-0-0-m-0-iso8859-1 -courbi.pfa -adobe-courier-bold-i-normal--0-0-0-0-m-0-iso8859-2 -courbi.pfa -adobe-courier-bold-i-normal--0-0-0-0-m-0-iso8859-3 -courbi.pfa -adobe-courier-bold-i-normal--0-0-0-0-m-0-iso8859-9 -c0648bt_.pfb -bitstream-charter-medium-r-normal--0-0-0-0-p-0-iso8859-1 -c0649bt_.pfb -bitstream-charter-medium-i-normal--0-0-0-0-p-0-iso8859-1 -c0632bt_.pfb -bitstream-charter-bold-r-normal--0-0-0-0-p-0-iso8859-1 -c0633bt_.pfb -bitstream-charter-bold-i-normal--0-0-0-0-p-0-iso8859-1 -c0419bt_.pfb -bitstream-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1 -c0582bt_.pfb -bitstream-courier-medium-i-normal--0-0-0-0-m-0-iso8859-1 -c0583bt_.pfb -bitstream-courier-bold-r-normal--0-0-0-0-m-0-iso8859-1 -c0611bt_.pfb -bitstream-courier-bold-i-normal--0-0-0-0-m-0-iso8859-1 -cursor.pfa -xfree86-cursor-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific -l047013t.pfa -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-1 -l047013t.pfa -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-2 -l047013t.pfa -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-9 -l047013t.pfa -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-15 -l047013t.pfa -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-adobe-standard -l047016t.pfa -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-1 -l047016t.pfa -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-2 -l047016t.pfa -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-9 -l047016t.pfa -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-iso8859-15 -l047016t.pfa -b&h-Luxi Mono-bold-r-normal--0-0-0-0-m-0-adobe-standard -l047033t.pfa -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-1 -l047033t.pfa -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-2 -l047033t.pfa -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-9 -l047033t.pfa -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-iso8859-15 -l047033t.pfa -b&h-Luxi Mono-medium-i-normal--0-0-0-0-m-0-adobe-standard -l047036t.pfa -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-1 -l047036t.pfa -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-2 -l047036t.pfa -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-9 -l047036t.pfa -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-iso8859-15 -l047036t.pfa -b&h-Luxi Mono-bold-i-normal--0-0-0-0-m-0-adobe-standard -l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-1 -l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-2 -l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-9 -l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-15 -l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-adobe-standard -l048016t.pfa -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-1 -l048016t.pfa -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-2 -l048016t.pfa -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-9 -l048016t.pfa -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-iso8859-15 -l048016t.pfa -b&h-Luxi Sans-bold-r-normal--0-0-0-0-p-0-adobe-standard -l048033t.pfa -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-1 -l048033t.pfa -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-2 -l048033t.pfa -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-9 -l048033t.pfa -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-iso8859-15 -l048033t.pfa -b&h-Luxi Sans-medium-i-normal--0-0-0-0-p-0-adobe-standard -l048036t.pfa -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-1 -l048036t.pfa -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-2 -l048036t.pfa -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-9 -l048036t.pfa -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-iso8859-15 -l048036t.pfa -b&h-Luxi Sans-bold-i-normal--0-0-0-0-p-0-adobe-standard -l049013t.pfa -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-1 -l049013t.pfa -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-2 -l049013t.pfa -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-9 -l049013t.pfa -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso8859-15 -l049013t.pfa -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-adobe-standard -l049016t.pfa -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-1 -l049016t.pfa -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-2 -l049016t.pfa -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-9 -l049016t.pfa -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-iso8859-15 -l049016t.pfa -b&h-Luxi Serif-bold-r-normal--0-0-0-0-p-0-adobe-standard -l049033t.pfa -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-1 -l049033t.pfa -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-2 -l049033t.pfa -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-9 -l049033t.pfa -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-iso8859-15 -l049033t.pfa -b&h-Luxi Serif-medium-i-normal--0-0-0-0-p-0-adobe-standard -l049036t.pfa -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-1 -l049036t.pfa -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-2 -l049036t.pfa -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-9 -l049036t.pfa -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-iso8859-15 -l049036t.pfa -b&h-Luxi Serif-bold-i-normal--0-0-0-0-p-0-adobe-standard Index: xc/fonts/util/Imakefile diff -u xc/fonts/util/Imakefile:1.6 xc/fonts/util/Imakefile:1.8 --- xc/fonts/util/Imakefile:1.6 Thu Nov 14 21:33:09 2002 +++ xc/fonts/util/Imakefile Wed Oct 22 16:50:46 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/fonts/util/Imakefile,v 1.6 2002/11/15 02:33:09 dawes Exp $ +XCOMM $XFree86: xc/fonts/util/Imakefile,v 1.8 2003/10/22 20:50:46 tsi Exp $ MAPFILES = \ map-ISO8859-1 map-ISO8859-2 map-ISO8859-3 map-ISO8859-4 map-ISO8859-5 \ @@ -7,8 +7,18 @@ map-ISO8859-16 map-JISX0201.1976-0 map-KOI8-R InstallMultipleFlags($(MAPFILES),$(FONTDIR)/util,$(INSTDATFLAGS)) -InstallNamedProg(ucs2any.pl,ucs2any,$(BINDIR)) -InstallManPage(ucs2any,$(MANDIR)) + +#if !HasBasename +DEFINES= -DNEED_BASENAME +#endif + +#ifdef SGIArchitecture +LOCAL_LIBRARIES = -lgen +#endif + +SimpleProgramTarget(ucs2any) +LinkBuildBinary(ProgramTargetName(ucs2any)) + InstallNamedProg(bdftruncate.pl,bdftruncate,$(BINDIR)) InstallManPage(bdftruncate,$(MANDIR)) Index: xc/fonts/util/ucs2any.c diff -u /dev/null xc/fonts/util/ucs2any.c:1.1 --- /dev/null Sat Feb 28 21:41:05 2004 +++ xc/fonts/util/ucs2any.c Sun Sep 21 06:54:14 2003 @@ -0,0 +1,958 @@ +/*- + * Copyright (c) 2003 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Ben Collver . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* $XFree86: xc/fonts/util/ucs2any.c,v 1.1 2003/09/21 10:54:14 herrb Exp $ */ +/* + * This utility allows you to generate from an ISO10646-1 encoded + * BDF font other BDF fonts in any possible encoding. This way, you can + * derive from a single ISO10646-1 master font a whole set of 8-bit + * fonts in all ISO 8859 and various other encodings. (Hopefully + * a future XFree86 release will have a similar facility built into + * the server, which can reencode ISO10646-1 on the fly, because + * storing the same fonts in many different encodings is clearly + * a waste of storage capacity). +*/ + +#include +#include +#include +#ifndef NEED_BASENAME +#include +#endif +#include +#include +#include +#include +#include +#include + +/* global variable for argv[0] */ +const char *my_name = NULL; + +#ifdef NEED_BASENAME +static char * +basename(char *pathname) +{ + char *ptr; + + ptr = strrchr(pathname, '/'); + return ((ptr == NULL) ? pathname : &ptr[1]); +} +#endif + +/* "CLASS" "z" string and memory manipulation */ + +static void * +zmalloc(size_t size) +{ + void *r; + r = malloc(size); + if (r == NULL) { + perror(my_name); + exit(errno); + } + memset(r, 0, size); + return r; +} + +static void * +zrealloc(void *ptr, size_t size) +{ + void *temp; + temp = realloc(ptr, size); + if (temp == NULL) { + perror(my_name); + exit(errno); + } + return temp; +} + +static char * +zstrdup(const char *str) +{ + char *retval; + + if (str == NULL) { + fprintf(stderr, "%s: zstrdup(NULL)\n", my_name); + exit(1); + } + retval = strdup(str); + if (retval == NULL) { + perror(my_name); + exit(errno); + } + return retval; +} + +static void +zstrcpy(char **dest, const char *source) +{ + if (*dest != NULL) + free(*dest); + *dest = zstrdup(source); +} + +static void +zquotedcpy(char **dest, const char *source) +{ + const char *start, *end; + + if (*dest != NULL) + free(*dest); + *dest = NULL; + start = source; + if (*start == '"') { + start = source+1; + end = strrchr(start, '"'); + if (!end) return; + *dest = zmalloc(end-start+1); + strncpy(*dest, start, end-start); + (*dest)[end-start] = '\0'; + } else { + *dest = zstrdup(source); + } +} + +static void +zstrcat(char **dest, const char *source) +{ + int dest_size = 1; + int source_size; + + if (*dest != NULL) + dest_size = strlen(*dest) + 1; + source_size = strlen(source); + *dest = zrealloc(*dest, dest_size + source_size); + strcpy(*dest + dest_size - 1, source); +} + +static void +zstrtoupper(char *s) +{ + char *t; + + for (t = s; *t != '\000'; t++) + *t = toupper(*t); +} + +#define zs_true(x) (x != NULL && strcmp(x, "0") != 0) +#define zi_true(x) (x == 1) + +/* "CLASS" "dynamic array" */ + +typedef struct { + char *name; + int size; + int count; + void **values; + void *nv; +} da_t; + +static da_t * +da_new(char *name) +{ + da_t *da; + + da = zmalloc(sizeof(da_t)); + da->size = 0; + da->count = 0; + da->values = NULL; + da->nv = NULL; + da->name = NULL; + zstrcpy(&(da->name), name); + return da; +} + +static void * +da_fetch(da_t *da, int key) +{ + void *r = NULL; + + if (key >= 0 && key < da->size && da->values[key] != NULL) + r = da->values[key]; + else + if (key == -1 && da->nv != NULL) + r = da->nv; + + return r; +} + +static int +da_fetch_int(da_t *da, int key) +{ + int *t; + int r = -1; + t = da_fetch(da, key); + if (t != NULL) + r = *t; + return r; +} + +#define da_fetch_str(a,k) \ + (char *)da_fetch(a,k) + +static void +da_add(da_t *da, int key, void *value) +{ + int i = da->size; + if (key >= 0) { + if (key >= da->size) { + da->size = key + 1; + da->values = zrealloc(da->values, + da->size * sizeof(void *)); + for (; i < da->size; i++) + da->values[i] = NULL; + } + if (da->values[key] != NULL) { + free(da->values[key]); + } else { + if (value == NULL) { + if (da->count > 0) + da->count--; + } else { + da->count++; + } + } + da->values[key] = value; + } else if (key == -1) { + if (da->nv != NULL) + free(da->nv); + da->nv = value; + } +} + +static void +da_add_str(da_t *da, int key, char *value) +{ + da_add(da, key, value?zstrdup(value):NULL); +} + +static void +da_add_int(da_t *da, int key, int value) +{ + int *v; + + v = zmalloc(sizeof(int)); + *v = value; + da_add(da, key, v); +} + +#define da_count(da) (da->count) +#define da_size(da) (da->size) + +static void +da_clear(da_t *da) +{ + int i; + + for (i = da->size; i; i--) + free(da->values[i]); + if (da->values != NULL) + free(da->values); + da->size = 0; + da->count = 0; + da->values = NULL; +} + +/* "CLASS" file input */ + +#define TYPICAL_LINE_SIZE (80) + +/* read a line and strip trailing whitespace */ +static int +read_line(FILE *fp, char **buffer) +{ + int buffer_size = TYPICAL_LINE_SIZE; + int eof = 0; + int position = 0; + int c; + + *buffer = zmalloc(TYPICAL_LINE_SIZE); + (*buffer)[0] = '\0'; + + if ((c = getc(fp)) == EOF) + eof = 1; + + while (c != '\n' && !eof) { + if (position + 1 >= buffer_size) { + buffer_size = buffer_size * 2 + 1; + *buffer = zrealloc(*buffer, buffer_size); + } + (*buffer)[position++] = c; + (*buffer)[position] = '\0'; + c = getc(fp); + if (c == EOF) + eof = 1; + } + + if (eof) { + free(*buffer); + *buffer = NULL; + return 0; + } + + while (position > 1) { + position--; + if (!isspace((*buffer)[position])) + break; + (*buffer)[position] = '\0'; + } + + return 1; +} + +/* BEGIN */ + +/* +DEC VT100 graphics characters in the range 1-31 (as expected by +some old xterm versions and a few other applications) +*/ +#define decmap_size 31 +int decmap[decmap_size] = { + 0x25C6, /* BLACK DIAMOND */ + 0x2592, /* MEDIUM SHADE */ + 0x2409, /* SYMBOL FOR HORIZONTAL TABULATION */ + 0x240C, /* SYMBOL FOR FORM FEED */ + 0x240D, /* SYMBOL FOR CARRIAGE RETURN */ + 0x240A, /* SYMBOL FOR LINE FEED */ + 0x00B0, /* DEGREE SIGN */ + 0x00B1, /* PLUS-MINUS SIGN */ + 0x2424, /* SYMBOL FOR NEWLINE */ + 0x240B, /* SYMBOL FOR VERTICAL TABULATION */ + 0x2518, /* BOX DRAWINGS LIGHT UP AND LEFT */ + 0x2510, /* BOX DRAWINGS LIGHT DOWN AND LEFT */ + 0x250C, /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ + 0x2514, /* BOX DRAWINGS LIGHT UP AND RIGHT */ + 0x253C, /* BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ + 0x23BA, /* HORIZONTAL SCAN LINE-1 (Unicode 3.2 draft) */ + 0x23BB, /* HORIZONTAL SCAN LINE-3 (Unicode 3.2 draft) */ + 0x2500, /* BOX DRAWINGS LIGHT HORIZONTAL */ + 0x23BC, /* HORIZONTAL SCAN LINE-7 (Unicode 3.2 draft) */ + 0x23BD, /* HORIZONTAL SCAN LINE-9 (Unicode 3.2 draft) */ + 0x251C, /* BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ + 0x2524, /* BOX DRAWINGS LIGHT VERTICAL AND LEFT */ + 0x2534, /* BOX DRAWINGS LIGHT UP AND HORIZONTAL */ + 0x252C, /* BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ + 0x2502, /* BOX DRAWINGS LIGHT VERTICAL */ + 0x2264, /* LESS-THAN OR EQUAL TO */ + 0x2265, /* GREATER-THAN OR EQUAL TO */ + 0x03C0, /* GREEK SMALL LETTER PI */ + 0x2260, /* NOT EQUAL TO */ + 0x00A3, /* POUND SIGN */ + 0x00B7 /* MIDDLE DOT */ +}; + +static int +is_control(int ucs) +{ + return ((ucs >= 0x00 && ucs <= 0x1f) || + (ucs >= 0x7f && ucs <= 0x9f)); +} + +static int +is_blockgraphics(int ucs) +{ + return ucs >= 0x2500 && ucs <= 0x25FF; +} + +/* calculate the bounding box that covers both provided bounding boxes */ +typedef struct { + int cwidth; + int cheight; + int cxoff; + int cyoff; +} bbx_t; + +static bbx_t * +combine_bbx(int awidth, int aheight, int axoff, int ayoff, + int cwidth, int cheight, int cxoff, int cyoff, bbx_t *r) +{ + r->cwidth = cwidth; + r->cheight = cheight; + r->cxoff = cxoff; + r->cyoff = cyoff; + + if (axoff < r->cxoff) { + r->cwidth += r->cxoff - axoff; + r->cxoff = axoff; + } + if (ayoff < r->cyoff) { + r->cheight += r->cyoff - ayoff; + r->cyoff = ayoff; + } + if (awidth + axoff > r->cwidth + r->cxoff) { + r->cwidth = awidth + axoff - r->cxoff; + } + if (aheight + ayoff > r->cheight + r->cyoff) { + r->cheight = aheight + ayoff - r->cyoff; + } + + return r; +} + +static void +usage(void) { + printf("%s", "\n" +"Usage: ucs2any [+d|-d] { }\n" +"\n" +"where\n" +"\n" +" +d put DEC VT100 graphics characters in the C0 range\n" +" (default for upright charcell fonts)\n" +"\n" +" -d do not put DEC VT100 graphics characters in the\n" +" C0 range (default for all other font types)\n" +"\n" +" is the name of an ISO10646-1 encoded BDF file\n" +"\n" +" is the name of a character set table like those on\n" +" \n" +"\n" +" are the CHARSET_REGISTRY and CHARSET_ENCODING\n" +" field values for the font name (XLFD) of the\n" +" target font, separated by a hyphen\n" +"\n" +"Example:\n" +"\n" +" ucs2any 6x13.bdf 8859-1.TXT iso8859-1 8859-2.TXT iso8859-2\n" +"\n" +"will generate the files 6x13-iso8859-1.bdf and 6x13-iso8859-2.bdf\n" +"\n"); +} + +static int +chars_compare(const void *aa, const void *bb) +{ + int a = *(int *)aa; + int b = *(int *)bb; + + return a - b; +} + +/* + * Return != 0 if "string" starts with "pattern" followed by whitespace. + * If it does, return a pointer to the first non space char. + */ +static const char * +startswith(const char *string, const char *pattern) +{ + int l = strlen(pattern); + + if (strlen(string) <= l) return NULL; + if (strncmp(string, pattern, l) != 0) return NULL; + string += l; + if (!isspace(*string)) return NULL; + while (isspace(*string)) + string++; + return string; +} + +int +main(int argc, char *argv[]) +{ + int ai = 1; + int dec_chars = -1; + char *fsource = NULL; + FILE *fsource_fp; + int properties; + int default_char; + char *l = NULL; + char *t = NULL; + const char *nextc = NULL; + char *startfont = NULL; + char *slant = NULL; + char *spacing = NULL; + char *sc = NULL; + int code = -1; + da_t *startchar; + da_t *my_char; + char *fmap = NULL; + char *registry = NULL; + char *encoding = NULL; + char *fontname = NULL; + FILE *fmap_fp; + da_t *map; + da_t *headers; + int nextheader = -1; + int default_char_index = -1; + int startproperties_index = -1; + int fontname_index = -1; + int charset_registry_index = -1; + int slant_index = -1; + int spacing_index = -1; + int charset_encoding_index = -1; + int fontboundingbox_index = -1; + int target; + int ucs; + int i; + int j; + int *chars = NULL; + bbx_t bbx; + char *fout = NULL; + FILE *fout_fp; + int k; + char *registry_encoding = NULL; + + my_name = argv[0]; + + startchar = da_new("startchar"); + my_char = da_new("my_char"); + map = da_new("map"); + headers = da_new("headers"); + + if (argc < 2) { + usage(); + exit(0); + } + + /* check options */ + if (strcmp(argv[ai], "+d") == 0) { + ai++; + dec_chars = 1; + } else if (strcmp(argv[ai], "-d") == 0) { + ai++; + dec_chars = 0; + } + if (ai >= argc) { + usage(); + exit(0); + } + + /* open and read source file */ + fsource = argv[ai]; + fsource_fp = fopen(fsource, "r"); + if (fsource_fp == NULL) { + fprintf(stderr, "%s: Can't read file '%s': %s!\n", my_name, + fsource, strerror(errno)); + exit(1); + } + + /* read header */ + properties = 0; + default_char = 0; + while (read_line(fsource_fp, &l)) { + if (startswith(l, "CHARS")) + break; + if (startswith(l, "STARTFONT")) { + zstrcpy(&startfont, l); + } else if (startswith(l, "_XMBDFED_INFO") || + startswith(l, "XFREE86_GLYPH_RANGES")) + { + properties--; + } else if ((nextc = startswith(l, "DEFAULT_CHAR")) != NULL) + { + default_char = atoi(nextc); + default_char_index = ++nextheader; + da_add_str(headers, default_char_index, NULL); + } else { + if ((nextc = startswith(l, "STARTPROPERTIES")) != NULL) + { + properties = atoi(nextc); + startproperties_index = ++nextheader; + da_add_str(headers, startproperties_index, NULL); + } else if ((nextc = startswith(l, "FONT")) != NULL) + { + char * term; + /* slightly simplistic check ... */ + zquotedcpy(&fontname, nextc); + if ((term = strstr(fontname, "-ISO10646-1")) == NULL) { + fprintf(stderr, + "%s: FONT name in '%s' is '%s' and not '*-ISO10646-1'!\n", + my_name, fsource, fontname); + exit(1); + } + *term = '\0'; + fontname_index = ++nextheader; + da_add_str(headers, fontname_index, NULL); + } else if ((nextc = startswith(l, "CHARSET_REGISTRY")) != NULL) + { + if (strcmp(nextc, "\"ISO10646\"") != 0) { + fprintf(stderr, + "%s: CHARSET_REGISTRY in '%s' is '%s' and not 'ISO10646'!\n", + my_name, fsource, nextc); + exit(1); + } + charset_registry_index = ++nextheader; + da_add_str(headers, charset_registry_index, NULL); + } else if ((nextc = startswith(l, "CHARSET_ENCODING")) != NULL) + { + if (strcmp(nextc, "\"1\"") != 0) { + fprintf(stderr, + "%s: CHARSET_ENCODING in '%s' is '%s' and not '1'!\n", + my_name, fsource, nextc); + exit(1); + } + charset_encoding_index = ++nextheader; + da_add_str(headers, charset_encoding_index, NULL); + } else if (startswith(l, "FONTBOUNDINGBOX")) { + fontboundingbox_index = ++nextheader; + da_add_str(headers, fontboundingbox_index, NULL); + } else if ((nextc = startswith(l, "SLANT")) != NULL) + { + zquotedcpy(&slant, nextc); + slant_index = ++nextheader; + da_add_str(headers, slant_index, NULL); + } else if ((nextc = startswith(l, "SPACING")) != NULL) + { + zquotedcpy(&spacing, nextc); + zstrtoupper(spacing); + spacing_index = ++nextheader; + da_add_str(headers, spacing_index, NULL); + } else if ((nextc = startswith(l, "COMMENT")) != NULL) { + if (strncmp(nextc, "$Id: ", 5)==0) { + char *header = NULL; + char *id = NULL, *end = NULL; + id = zstrdup(nextc + 5); + end = strrchr(id, '$'); + if (end) *end = '\0'; + zstrcpy(&header, "COMMENT Derived from "); + zstrcat(&header, id); + zstrcat(&header, "\n"); + free(id); + da_add_str(headers, ++nextheader, header); + free(header); + } else { + da_add_str(headers, ++nextheader, l); + } + } else { + da_add_str(headers, ++nextheader, l); + } + } + free(l); + } + + if (startfont == NULL) { + fprintf(stderr, "%s: No STARTFONT line found in '%s'!\n", + my_name, fsource); + exit(1); + } + + /* read characters */ + while (read_line(fsource_fp, &l)) { + if (startswith(l, "STARTCHAR")) { + zstrcpy(&sc, l); + zstrcat(&sc, "\n"); + code = -1; + } else if ((nextc = startswith(l, "ENCODING")) != NULL) { + code = atoi(nextc); + da_add_str(startchar, code, sc); + da_add_str(my_char, code, ""); + } else if (strcmp(l, "ENDFONT")==0) { + code = -1; + zstrcpy(&sc, "STARTCHAR ???\n"); + } else { + zstrcpy(&t, da_fetch_str(my_char, code)); + zstrcat(&t, l); + zstrcat(&t, "\n"); + da_add_str(my_char, code, t); + if (strcmp(l, "ENDCHAR")==0) { + code = -1; + zstrcpy(&sc, "STARTCHAR ???\n"); + } + } + free(l); + } + + fclose(fsource_fp); + + ai++; + while (ai < argc) { + zstrcpy(&fmap, argv[ai]); + i = ai + 1; + if (i < argc) { + char *temp = NULL; + char * hyphen = strchr(argv[i], '-'); + if (!hyphen || strchr(hyphen+1, '-') != NULL) { + fprintf(stderr, + "%s: Argument registry-encoding '%s' not in expected format!\n", + my_name, i < argc ? fmap : ""); + exit(1); + } + temp = zstrdup(argv[i]); + hyphen = strchr(temp, '-'); + if (hyphen) *hyphen = 0; + zstrcpy(®istry, temp); + zstrcpy(&encoding, hyphen+1); + free(temp); + } else { + fprintf(stderr, "map file argument \"%s\" needs a " + "coresponding registry-encoding argument\n", fmap); + exit(0); + } + + ai++; + ai++; + + /* open and read source file */ + fmap_fp = fopen(fmap, "r"); + if (fmap_fp == NULL) { + fprintf(stderr, + "%s: Can't read mapping file '%s': %s!\n", + my_name, fmap, strerror(errno)); + exit(1); + } + + da_clear(map); + + for (;read_line(fmap_fp, &l); free(l)) { + char *p, *endp; + + for (p = l; isspace(p[0]); p++) + ; + if (p[0] == '\0' || p[0] == '#') + continue; + if (p[0] == '0' && (p[1] == 'x' || p[1] == 'X')) { + target = strtol(p+2, &endp, 16); + if (*endp == '\0') goto bad; + p = endp; + } else + goto bad; + for (; isspace(p[0]); p++) + ; + if (p[0] == '0' && (p[1] == 'x' || p[1] == 'X')) { + ucs = strtol(p+2, &endp, 16); + if (*endp == '\0') goto bad; + p = endp; + } else + goto bad; + + if (!is_control(ucs)) { + if (zs_true(da_fetch_str(startchar, ucs))) + { + da_add_int(map, target, ucs); + } else { + if (!((is_blockgraphics(ucs) && + strcmp(slant, "R") != 0) || + (ucs >= 0x200e && + ucs <= 0x200f))) { + fprintf(stderr, + "No glyph for character U+%04X (0x%02x) available.\n", + ucs, target); + } + } + } + continue; + bad: + fprintf(stderr, "Unrecognized line in '%s':\n%s\n", fmap, l); + } + fclose(fmap_fp); + + /* add default character */ + if (!zi_true(da_fetch_int(map, 0))) { + if (zs_true(da_fetch_str(startchar, default_char))) { + da_add_int(map, 0, default_char); + da_add_str(startchar, default_char, + "STARTCHAR defaultchar\n"); + } else { + fprintf(stderr, "%s", + "No default character defined.\n"); + } + } + + if (dec_chars == 1 || + (dec_chars == -1 && strcmp(slant, "R") == 0 && + strcmp(spacing, "C") == 0)) + { + /* add DEC VT100 graphics characters in the range 1-31 + (as expected by some old xterm versions) */ + for (i = 0; i < decmap_size; i++) { + if (zs_true(da_fetch_str(startchar, decmap[i]))) + { + da_add_int(map, i + 1, decmap[i]); + } + } + } + + /* list of characters that will be written out */ + j = da_count(map); + if (j < 0) { + fprintf(stderr, + "No characters found for %s-%s.\n", + registry, encoding); + continue; + } + if (chars != NULL) + free(chars); + chars = zmalloc(j * sizeof(int)); + memset(chars, 0, j * sizeof(int)); + for (k = 0, i = 0; k < da_count(map) && i < da_size(map); i++) { + if (da_fetch(map, i) != NULL) + chars[k++] = i; + } + qsort(chars, j, sizeof(int), chars_compare); + + /* find overall font bounding box */ + bbx.cwidth = -1; + for (i = 0; i < j; i++) { + ucs = da_fetch_int(map, chars[i]); + zstrcpy(&t, da_fetch_str(my_char, ucs)); + if ((nextc = startswith(t, "BBX")) != NULL + || (nextc = strstr(t, "\nBBX")) != NULL) + { + char *endp; + long w, h, x, y; + + if (*nextc == '\n') { + nextc += 4; + while (isspace(*nextc)) + nextc++; + } + for (;isspace(*nextc);) + nextc++; + w = strtol(nextc, &endp, 10); + nextc = endp; + if (*nextc == '\0') goto bbxbad; + for (;isspace(*nextc);) + nextc++; + h = strtol(nextc, &endp, 10); + nextc = endp; + if (*nextc == '\0') goto bbxbad; + for (;isspace(*nextc);) + nextc++; + x = strtol(nextc, &endp, 10); + nextc = endp; + if (*nextc == '\0') goto bbxbad; + for (;isspace(*nextc);) + nextc++; + y = strtol(nextc, &endp, 10); + if (bbx.cwidth == -1) { + bbx.cwidth = w; + bbx.cheight = h; + bbx.cxoff = x; + bbx.cyoff = y; + } else { + combine_bbx(bbx.cwidth, bbx.cheight, + bbx.cxoff, bbx.cyoff, + w, h, x, y, &bbx); + } + continue; + bbxbad: + fprintf(stderr, "Unparsable BBX found for U+%04x!\n", ucs); + } else { + fprintf(stderr, + "Warning: No BBX found for U+%04X!\n", + ucs); + } + } + + if (!registry) registry = zstrdup(""); + if (!encoding) encoding = zstrdup(""); + + /* generate output file name */ + zstrcpy(®istry_encoding, "-"); + zstrcat(®istry_encoding, registry); + zstrcat(®istry_encoding, "-"); + zstrcat(®istry_encoding, encoding); + + { + char * p = strstr(fsource, ".bdf"); + if (p) { + zstrcpy(&fout, fsource); + p = strstr(fout, ".bdf"); + *p = 0; + zstrcat(&fout, registry_encoding); + zstrcat(&fout, ".bdf"); + } else { + zstrcpy(&fout, fsource); + zstrcat(&fout, registry_encoding); + } + } + + /* remove path prefix */ + zstrcpy(&t, basename(fout)); + zstrcpy(&fout, t); + + /* write new BDF file */ + fprintf(stderr, "Writing %d characters into file '%s'.\n", + j, fout); + fout_fp = fopen(fout, "w"); + if (fout_fp == NULL) { + fprintf(stderr, "%s: Can't write file '%s': %s!\n", + my_name, fout, strerror(errno)); + exit(1); + } + + fprintf(fout_fp, "%s\n", startfont); + fprintf(fout_fp, "%s", + "COMMENT AUTOMATICALLY GENERATED FILE. DO NOT EDIT!\n"); + fprintf(fout_fp, + "COMMENT Generated with 'ucs2any %s %s %s-%s'\n", + fsource, fmap, registry, encoding); + fprintf(fout_fp, "%s", + "COMMENT from an ISO10646-1 encoded source BDF font.\n"); + fprintf(fout_fp, "%s", + "COMMENT ucs2any by Ben Collver , 2003.\n"); + fprintf(fout_fp, "%s", + "COMMENT based on ucs2any.pl by Markus Kuhn , 2000.\n"); + + for (i = 0; i <= nextheader; i++) { + if (i == default_char_index) + fprintf(fout_fp, "DEFAULT_CHAR %d\n", default_char); + else if (i == startproperties_index) + fprintf(fout_fp, "STARTPROPERTIES %d\n", properties); + else if (i == fontname_index) { + fprintf(fout_fp, "FONT %s%s\n", fontname, registry_encoding); + } + else if (i == charset_registry_index) + fprintf(fout_fp, "CHARSET_REGISTRY \"%s\"\n", registry); + else if (i == slant_index) + fprintf(fout_fp, "SLANT \"%s\"\n", slant); + else if (i == charset_encoding_index) + fprintf(fout_fp, "CHARSET_ENCODING \"%s\"\n", encoding); + else if (i == fontboundingbox_index) + fprintf(fout_fp, "FONTBOUNDINGBOX %d %d %d %d\n", bbx.cwidth, bbx.cheight, bbx.cxoff, bbx.cyoff); + else if (i == spacing_index) + fprintf(fout_fp, "SPACING \"%s\"\n", spacing); + else + fprintf(fout_fp, "%s\n", da_fetch_str(headers, i)); + } + + fprintf(fout_fp, "CHARS %d\n", j); + + /* Write characters */ + for (i = 0; i < j; i++) { + ucs = da_fetch_int(map, chars[i]); + fprintf(fout_fp, "%s", da_fetch_str(startchar, + ucs)); + fprintf(fout_fp, "ENCODING %d\n", chars[i]); + fprintf(fout_fp, "%s", da_fetch_str(my_char, + ucs)); + } + fprintf(fout_fp, "%s", "ENDFONT\n"); + fclose(fout_fp); + } + + exit(0); +} Index: xc/include/X.h diff -u xc/include/X.h:1.5 xc/include/X.h:1.7 --- xc/include/X.h:1.5 Fri Dec 14 14:53:25 2001 +++ xc/include/X.h Fri Jul 18 11:53:24 2003 @@ -53,7 +53,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/X.h,v 1.5 2001/12/14 19:53:25 dawes Exp $ */ +/* $XFree86: xc/include/X.h,v 1.7 2003/07/18 15:53:24 tsi Exp $ */ #define X_PROTOCOL 11 /* current protocol version */ #define X_PROTOCOL_REVISION 0 /* current minor version */ @@ -299,9 +299,10 @@ /* protocol families */ -#define FamilyInternet 0 +#define FamilyInternet 0 /* IPv4 */ #define FamilyDECnet 1 #define FamilyChaos 2 +#define FamilyInternet6 6 /* IPv6 */ /* Property notification */ Index: xc/include/Xarch.h diff -u xc/include/Xarch.h:1.10 xc/include/Xarch.h:1.11 --- xc/include/Xarch.h:1.10 Thu Jun 15 16:49:58 2000 +++ xc/include/Xarch.h Tue May 27 18:26:24 2003 @@ -25,7 +25,7 @@ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/include/Xarch.h,v 1.10 2000/06/15 20:49:58 dawes Exp $ */ +/* $XFree86: xc/include/Xarch.h,v 1.11 2003/05/27 22:26:24 tsi Exp $ */ /* @@ -41,10 +41,10 @@ #else #ifdef SVR4 -#if defined(NCR) || defined(Mips) +#if defined(NCR) || defined(Mips) || defined(__sgi) #include #else -#if !defined(sun) && !defined(__sgi) +#if !defined(sun) #include #endif #endif Index: xc/include/Xfuncs.h diff -u xc/include/Xfuncs.h:3.10 xc/include/Xfuncs.h:3.11 --- xc/include/Xfuncs.h:3.10 Fri May 31 14:45:38 2002 +++ xc/include/Xfuncs.h Thu Dec 18 21:05:37 2003 @@ -25,7 +25,7 @@ in this Software without prior written authorization from The Open Group. * */ -/* $XFree86: xc/include/Xfuncs.h,v 3.10 2002/05/31 18:45:38 dawes Exp $ */ +/* $XFree86: xc/include/Xfuncs.h,v 3.11 2003/12/19 02:05:37 dawes Exp $ */ #ifndef _XFUNCS_H_ #define _XFUNCS_H_ @@ -40,13 +40,16 @@ void bzero(); int bcmp(); #else -#if defined(SYSV) +#if defined(SYSV) && !defined(SCO325) #include void bcopy(); #define bzero(b,len) memset(b, 0, len) #define bcmp(b1,b2,len) memcmp(b1, b2, len) #else #include +#ifdef SCO325 +#include +#endif #define _XFUNCS_H_INCLUDED_STRING_H #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len)) #define bzero(b,len) memset(b, 0, (size_t)(len)) Index: xc/include/Xmd.h diff -u xc/include/Xmd.h:3.16 xc/include/Xmd.h:3.19 --- xc/include/Xmd.h:3.16 Fri May 31 14:45:39 2002 +++ xc/include/Xmd.h Thu Oct 23 11:19:01 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/Xmd.h,v 3.16 2002/05/31 18:45:39 dawes Exp $ */ +/* $XFree86: xc/include/Xmd.h,v 3.19 2003/10/23 15:19:01 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -28,13 +28,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -58,19 +58,16 @@ #ifdef CRAY #define WORD64 /* 64-bit architecture */ #endif -#if defined(__alpha) || defined(__alpha__) || \ +#if defined (_LP64) || \ + defined(__alpha) || defined(__alpha__) || \ defined(__ia64__) || defined(ia64) || \ defined(__sparc64__) || \ defined(__s390x__) || \ (defined(__hppa__) && defined(__LP64__)) || \ - defined(__x86_64__) || defined(x86_64) + defined(__AMD64__) || defined(AMD64) || \ + (defined(sgi) && (_MIPS_SZLONG == 64)) #define LONG64 /* 32/64-bit architecture */ #endif -#ifdef __sgi -#if (_MIPS_SZLONG == 64) -#define LONG64 -#endif -#endif /* * Stuff to handle large architecture machines; the constants were generated @@ -85,7 +82,7 @@ * Definition of macro used to set constants for size of network structures; * machines with preprocessors that can't handle all of the sz_ symbols * can define this macro to be sizeof(x) if and only if their compiler doesn't - * pad out structures (esp. the xTextElt structure which contains only two + * pad out structures (esp. the xTextElt structure which contains only two * one-byte fields). Network structures should always define sz_symbols. * * The sz_ prefix is used instead of something more descriptive so that the @@ -196,9 +193,9 @@ #define NEXTPTR(p,t) (((char *) p) + SIZEOF(t)) #else /* else not MUSTCOPY, this is used for 32-bit machines */ /* - * this version should leave result of type (t *), but that should only be + * this version should leave result of type (t *), but that should only be * used when not in MUSTCOPY - */ + */ #define NEXTPTR(p,t) (((t *)(p)) + 1) #endif /* MUSTCOPY - used machines whose C structs don't line up with proto */ Index: xc/include/Xos.h diff -u xc/include/Xos.h:3.38 xc/include/Xos.h:3.42 --- xc/include/Xos.h:3.38 Fri May 31 14:45:39 2002 +++ xc/include/Xos.h Tue Dec 30 20:18:41 2003 @@ -27,7 +27,7 @@ * The X Window System is a Trademark of The Open Group. * */ -/* $XFree86: xc/include/Xos.h,v 3.38 2002/05/31 18:45:39 dawes Exp $ */ +/* $XFree86: xc/include/Xos.h,v 3.42 2003/12/31 01:18:41 tsi Exp $ */ /* This is a collection of things to try and minimize system dependencies * in a "signficant" number of source files. @@ -60,6 +60,12 @@ #endif #endif /* USG */ +#ifndef sgi +#if defined(SCO325) || defined(__USLC__) +#include +#endif +#endif + #ifdef _SEQUENT_ /* * in_systm.h compatibility between SysV and BSD types u_char u_short u_long @@ -85,6 +91,9 @@ #ifndef X_NOT_STDC_ENV #include +#ifdef SCO325 +#include +#else #ifdef __STDC__ #ifndef index #define index(s,c) (strchr((s),(c))) @@ -100,6 +109,7 @@ #define rindex strrchr #endif #endif +#endif #else @@ -261,7 +271,7 @@ #define NGROUPS 16 #endif -#if defined(ISC) || \ +#if defined(ISC) || defined(__UNIXOS2__) || \ (defined(linux) && !defined(__GLIBC__)) || \ (defined(__QNX__) && !defined(UNIXCONN)) /* Index: xc/include/Xos_r.h diff -u xc/include/Xos_r.h:1.18 xc/include/Xos_r.h:1.19 --- xc/include/Xos_r.h:1.18 Wed Aug 28 19:08:22 2002 +++ xc/include/Xos_r.h Thu Oct 23 11:19:01 2003 @@ -1,5 +1,5 @@ /* $Xorg: Xos_r.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */ -/* +/* Copyright 1996, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its @@ -22,9 +22,9 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/Xos_r.h,v 1.18 2002/08/28 23:08:22 torrey Exp $ */ +/* $XFree86: xc/include/Xos_r.h,v 1.19 2003/10/23 15:19:01 tsi Exp $ */ -/* +/* * Various and sundry Thread-Safe functions used by X11, Motif, and CDE. * * Use this file in MT-safe code where you would have included @@ -54,7 +54,7 @@ * NOTE: On systems lacking appropriate _r functions Getgrgid() and * Getgrnam() do NOT copy the list of group members! * - * This header is nominally intended to simplify porting X11, Motif, and + * This header is nominally intended to simplify porting X11, Motif, and * CDE; it may be useful to other people too. The structure below is * complicated, mostly because P1003.1c (the IEEE POSIX Threads spec) * went through lots of drafts, and some vendors shipped systems based @@ -189,7 +189,7 @@ #endif /* !defined WIN32 */ -/* +/* * Solaris 2.5 has SVR4 thread-safe API, but defines the POSIX * thread-safe feature test macro. Fix the feature test macro. */ @@ -198,7 +198,7 @@ #endif /* - * LynxOS 3.1 defines _POSIX_THREAD_SAFE_FUNCTIONS but + * LynxOS 3.1 defines _POSIX_THREAD_SAFE_FUNCTIONS but * getpwuid_r has different semantics than defined by POSIX */ #if defined(Lynx) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) @@ -255,7 +255,7 @@ * NetBSD and FreeBSD, at least, are missing several of the unixware passwd * fields. */ - + #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \ defined(__APPLE__) static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) @@ -382,7 +382,7 @@ /***** wrappers *****/ -/* +/* * Effective prototypes for wrappers: * * NOTE: On systems lacking the appropriate _r functions Gethostbyname(), @@ -397,7 +397,7 @@ * typedef ... _Xgetservbynameparams; * * struct hostent* _XGethostbyname(const char* name,_Xgethostbynameparams); - * struct hostent* _XGethostbyaddr(const char* addr, int len, int type, + * struct hostent* _XGethostbyaddr(const char* addr, int len, int type, * _Xgethostbynameparams); * struct servent* _XGetservbyname(const char* name, const char* proto, * _Xgetservbynameparams); @@ -554,7 +554,7 @@ * #define X_INCLUDE_DIRENT_H * #define XOS_USE_..._LOCKING * #include - * + * * typedef ... _Xreaddirparams; * * struct dirent *_XReaddir(DIR *dir_pointer, _Xreaddirparams); @@ -678,7 +678,7 @@ * #define X_INCLUDE_UNISTD_H * #define XOS_USE_..._LOCKING * #include - * + * * typedef ... _Xgetloginparams; * typedef ... _Xttynameparams; * @@ -840,7 +840,7 @@ /* Use regular, unsafe API. */ typedef int _Xstrtokparams; /* dummy */ # define _XStrtok(s1,s2,p) \ - ( (void)(p), strtok((s1),(s2)) ) + ( p = 0, (void)p, strtok((s1),(s2)) ) #elif !defined(XOS_USE_MTSAFE_STRINGAPI) || defined(XNO_MTSAFE_STRINGAPI) /* Systems with thread support but no _r API. */ Index: xc/include/Xosdefs.h diff -u xc/include/Xosdefs.h:3.20 xc/include/Xosdefs.h:3.21 --- xc/include/Xosdefs.h:3.20 Fri May 31 14:45:39 2002 +++ xc/include/Xosdefs.h Thu Dec 18 11:38:34 2003 @@ -25,7 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/Xosdefs.h,v 3.20 2002/05/31 18:45:39 dawes Exp $ */ +/* $XFree86: xc/include/Xosdefs.h,v 3.21 2003/12/18 16:38:34 dawes Exp $ */ #ifndef _XOSDEFS_H_ #define _XOSDEFS_H_ @@ -79,6 +79,15 @@ #endif #endif +#ifdef _SCO_DS +#ifndef SCO +#define SCO +#endif +#ifndef SCO325 +#define SCO325 +#endif +#endif + #ifdef i386 #ifdef SYSV #if !defined(ISC) && !defined(SCO) && !defined(_SEQUENT_) Index: xc/include/Xthreads.h diff -u xc/include/Xthreads.h:3.10 xc/include/Xthreads.h:3.11 --- xc/include/Xthreads.h:3.10 Fri Dec 14 14:53:26 2001 +++ xc/include/Xthreads.h Sat Mar 8 14:14:53 2003 @@ -25,7 +25,7 @@ in this Software without prior written authorization from The Open Group. * * */ -/* $XFree86: xc/include/Xthreads.h,v 3.10 2001/12/14 19:53:26 dawes Exp $ */ +/* $XFree86: xc/include/Xthreads.h,v 3.11 2003/03/08 19:14:53 herrb Exp $ */ #ifndef _XTHREADS_H_ #define _XTHREADS_H_ @@ -196,6 +196,37 @@ #define xcondition_signal(c) tis_cond_signal(c) #define xcondition_broadcast(c) tis_cond_broadcast(c) #else +#ifdef USE_NBSD_THREADLIB +/* + * NetBSD threadlib support is intended for thread safe libraries. + * This should not be used for general client programming. + */ +#include +typedef thr_t xthread_t; +typedef thread_key_t xthread_key_t; +typedef cond_t xcondition_rec; +typedef mutex_t xmutex_rec; +#define xthread_self thr_self +#define xthread_fork(func,closure) { thr_t _tmpxthr; \ + /* XXX Create it detached? --thorpej */ \ + thr_create(&_tmpxthr,NULL,func,closure); } +#define xthread_yield() thr_yield() +#define xthread_exit(v) thr_exit(v) +#define xthread_key_create(kp,d) thr_keycreate(kp,d) +#define xthread_key_delete(k) thr_keydelete(k) +#define xthread_set_specific(k,v) thr_setspecific(k,v) +#define xthread_get_specific(k,vp) *(vp) = thr_getspecific(k) +#define XMUTEX_INITIALIZER MUTEX_INITIALIZER +#define xmutex_init(m) mutex_init(m, 0) +#define xmutex_clear(m) mutex_destroy(m) +#define xmutex_lock(m) mutex_lock(m) +#define xmutex_unlock(m) mutex_unlock(m) +#define xcondition_init(c) cond_init(c, 0, 0) +#define xcondition_clear(c) cond_destroy(c) +#define xcondition_wait(c,m) cond_wait(c,m) +#define xcondition_signal(c) cond_signal(c) +#define xcondition_broadcast(c) cond_broadcast(c) +#else #include typedef pthread_t xthread_t; typedef pthread_key_t xthread_key_t; @@ -248,6 +279,7 @@ #define xcondition_set_name(cv,str) ((char**)(cv)->field1)[5] = (str) #endif /* DEBUG */ #endif /* _CMA_VENDOR_ == _CMA__IBM */ +#endif /* USE_NBSD_THREADLIB */ #endif /* USE_TIS_SUPPORT */ #endif /* WIN32 */ #endif /* SVR4 */ Index: xc/include/DPS/dpsconfig.h diff -u xc/include/DPS/dpsconfig.h:1.6 xc/include/DPS/dpsconfig.h:1.7 --- xc/include/DPS/dpsconfig.h:1.6 Thu Apr 4 09:05:35 2002 +++ xc/include/DPS/dpsconfig.h Thu Jun 12 10:12:27 2003 @@ -35,7 +35,7 @@ * * Author: Adobe Systems Incorporated */ -/* $XFree86: xc/include/DPS/dpsconfig.h,v 1.6 2002/04/04 14:05:35 eich Exp $ */ +/* $XFree86: xc/include/DPS/dpsconfig.h,v 1.7 2003/06/12 14:12:27 eich Exp $ */ #ifndef DPSCONFIG_H #define DPSCONFIG_H @@ -89,7 +89,7 @@ #if defined(__alpha) || defined(__alpha__) || \ defined(__ia64__) || defined(ia64) || \ defined(__s390x__) || \ - defined(__x86_64__) || defined(x86_64) + defined(__AMD64__) || defined(AMD64) #define IEEEFLOAT 1 #endif Index: xc/include/GL/glu.h diff -u xc/include/GL/glu.h:1.2 xc/include/GL/glu.h:1.3 --- xc/include/GL/glu.h:1.2 Mon Apr 2 22:18:39 2001 +++ xc/include/GL/glu.h Sat Jan 31 21:12:08 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/GL/glu.h,v 1.2 2001/04/03 02:18:39 dawes Exp $ */ +/* $XFree86: xc/include/GL/glu.h,v 1.3 2004/02/01 02:12:08 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are @@ -256,7 +256,11 @@ #define GLU_TESS_MAX_COORD 1.0e150 /* Internal convenience typedefs */ +#ifdef __cplusplus +typedef GLvoid (*_GLUfuncptr)(); +#else typedef GLvoid (*_GLUfuncptr)(GLvoid); +#endif extern void gluBeginCurve (GLUnurbs* nurb); extern void gluBeginPolygon (GLUtesselator* tess); Index: xc/include/GL/glx.h diff -u xc/include/GL/glx.h:1.10 xc/include/GL/glx.h:1.11 --- xc/include/GL/glx.h:1.10 Wed Oct 30 03:52:36 2002 +++ xc/include/GL/glx.h Sun Sep 28 16:14:57 2003 @@ -1,7 +1,7 @@ #ifndef __GLX_glx_h__ #define __GLX_glx_h__ -/* $XFree86: xc/include/GL/glx.h,v 1.10 2002/10/30 08:52:36 alanh Exp $ */ +/* $XFree86: xc/include/GL/glx.h,v 1.11 2003/09/28 20:14:57 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -156,7 +156,7 @@ /* - * ???. GLX_MESA_agp_offset + * ???. GLX_MESA_agp_offset (deprecated) */ #ifndef GLX_MESA_agp_offset #define GLX_MESA_agp_offset 1 @@ -167,6 +167,34 @@ #endif /* GLX_MESA_agp_offset */ +/* + * ???. GLX_MESA_allocate_memory + */ +#ifndef GLX_MESA_allocate_memory +#define GLX_MESA_allocate_memory 1 + +extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer); +extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer); +typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer); + +#endif /* GLX_MESA_allocate_memory */ + +/* + * ???. GLX_ARB_render_texture + */ +#ifndef GLX_ARB_render_texture +#define GLX_ARB_render_texture 1 + +Bool glXBindTexImageARB( Display *dpy, GLXPbuffer pbuffer, int buffer ); +Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer ); +Bool glXDrawableAttribARB( Display *dpy, GLXDrawable draw, const int *attribList ); + +#endif + + /*** Should these go here, or in another header? */ /* Index: xc/include/GL/glxproto.h diff -u xc/include/GL/glxproto.h:1.5 xc/include/GL/glxproto.h:1.7 --- xc/include/GL/glxproto.h:1.5 Tue Jul 31 20:44:34 2001 +++ xc/include/GL/glxproto.h Wed Jan 28 13:11:37 2004 @@ -1,7 +1,7 @@ #ifndef _GLX_glxproto_h_ #define _GLX_glxproto_h_ -/* $XFree86: xc/include/GL/glxproto.h,v 1.5 2001/08/01 00:44:34 tsi Exp $ */ +/* $XFree86: xc/include/GL/glxproto.h,v 1.7 2004/01/28 18:11:37 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -941,6 +941,72 @@ } xGLXQueryContextInfoEXTReply; #define sz_xGLXQueryContextInfoEXTReply 32 +/* +** glXMakeCurrentReadSGI request +*/ +typedef struct GLXMakeCurrentReadSGI { + CARD8 reqType; + CARD8 glxCode; + CARD16 length B16; + CARD32 vendorCode B32; /* vendor-specific opcode */ + GLXContextTag oldContextTag B32; + GLXDrawable drawable B32; + GLXDrawable readable B32; + GLXContextID context B32; +} xGLXMakeCurrentReadSGIReq; +#define sz_xGLXMakeCurrentReadSGIReq 24 + +/* +** glXGetFBConfigsSGIX request +*/ +typedef struct GLXGetFBConfigsSGIX { + CARD8 reqType; + CARD8 glxCode; + CARD16 length B16; + CARD32 vendorCode B32; /* vendor-specific opcode */ + CARD32 pad1 B32; /* unused; corresponds to contextTag in header */ + CARD32 screen B32; +} xGLXGetFBConfigsSGIXReq; +#define sz_xGLXGetFBConfigsSGIXReq 16 + +/* +** glXCreateContextWithConfigSGIX request +*/ + +typedef struct GLXCreateContextWithConfigSGIX { + CARD8 reqType; + CARD8 glxCode; + CARD16 length B16; + CARD32 vendorCode B32; /* vendor-specific opcode */ + CARD32 pad1 B32; /* unused; corresponds to contextTag in header */ + GLXContextID context B32; + GLXFBConfigID fbconfig B32; + CARD32 screen B32; + CARD32 renderType; + GLXContextID shareList B32; + BOOL isDirect; + CARD8 reserved1; + CARD16 reserved2 B16; +} xGLXCreateContextWithConfigSGIXReq; +#define sz_xGLXCreateContextWithConfigSGIXReq 36 + +/* +** glXCreatePixmapWithConfigSGIX request +*/ + +typedef struct GLXCreateGLXPixmapWithConfigSGIX { + CARD8 reqType; + CARD8 glxCode; + CARD16 length B16; + CARD32 vendorCode B32; /* vendor-specific opcode */ + CARD32 pad1 B32; /* unused; corresponds to contextTag in header */ + CARD32 screen B32; + GLXFBConfigID fbconfig B32; + CARD32 pixmap B32; + GLXPixmap glxpixmap B32; +} xGLXCreateGLXPixmapWithConfigSGIXReq; +#define sz_xGLXCreateGLXPixmapWithConfigSGIXReq 28 + /************************************************************************/ /* @@ -1271,6 +1337,171 @@ __GLX_TEXSUBIMAGE_3D_HDR; } __GLXdispatchTexSubImage3DHeader; +/** + * Data that is specific to a \c glCompressedTexImage1D or + * \c glCompressedTexImage2D call. The data is sent in the following + * order: + * - Render or RenderLarge header + * - CompressedTexImage header + * + * When a \c glCompressedTexImage1D call is made, the \c height field is + * not examined by the server and is considered padding. + */ + +#define __GLX_COMPRESSED_TEXIMAGE_HDR \ + CARD32 target B32; \ + CARD32 level B32; \ + CARD32 internalFormat B32; \ + CARD32 width B32; \ + CARD32 height B32; \ + CARD32 border B32; \ + CARD32 imageSize B32 + +#define __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE 28 + +#define __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE \ + (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE) + +#define __GLX_COMPRESSED_TEXIMAGE_DISPATCH_HDR_SIZE \ + (__GLX_COMPRESSED_TEXIMAGE_HDR_SIZE) + +typedef struct { + __GLX_RENDER_HDR; + __GLX_COMPRESSED_TEXIMAGE_HDR; +} __GLXcompressedTexImageHeader; + +typedef struct { + __GLX_RENDER_LARGE_HDR; + __GLX_COMPRESSED_TEXIMAGE_HDR; +} __GLXcompressedTexImageLargeHeader; + +typedef struct { + __GLX_COMPRESSED_TEXIMAGE_HDR; +} __GLXdispatchCompressedTexImageHeader; + +/** + * Data that is specifi to a \c glCompressedTexSubImage1D or + * \c glCompressedTexSubImage2D call. The data is sent in the following + * order: + * - Render or RenderLarge header + * - CompressedTexSubImage header + * + * When a \c glCompressedTexSubImage1D call is made, the \c yoffset and + * \c height fields are not examined by the server and are considered padding. + */ + +#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR \ + CARD32 target B32; \ + CARD32 level B32; \ + CARD32 xoffset B32; \ + CARD32 yoffset B32; \ + CARD32 width B32; \ + CARD32 height B32; \ + CARD32 format B32; \ + CARD32 imageSize B32 + +#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE 32 + +#define __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE \ + (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE) + +#define __GLX_COMPRESSED_TEXSUBIMAGE_DISPATCH_HDR_SIZE \ + (__GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE) + +typedef struct { + __GLX_RENDER_HDR; + __GLX_COMPRESSED_TEXSUBIMAGE_HDR; +} __GLXcompressedTexSubImageHeader; + +typedef struct { + __GLX_RENDER_LARGE_HDR; + __GLX_COMPRESSED_TEXSUBIMAGE_HDR; +} __GLXcompressedTexSubImageLargeHeader; + +typedef struct { + __GLX_COMPRESSED_TEXSUBIMAGE_HDR; +} __GLXdispatchCompressedTexSubImageHeader; + +/** + * Data that is specific to a \c glCompressedTexImage3D call. The data is + * sent in the following order: + * - Render or RenderLarge header + * - CompressedTexImage3D header + */ + +#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR \ + CARD32 target B32; \ + CARD32 level B32; \ + CARD32 internalFormat B32; \ + CARD32 width B32; \ + CARD32 height B32; \ + CARD32 depth B32; \ + CARD32 border B32; \ + CARD32 imageSize B32 + +#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE 32 + +#define __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE \ + (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE) + +#define __GLX_COMPRESSED_TEXIMAGE_3D_DISPATCH_HDR_SIZE \ + (__GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE) + +typedef struct { + __GLX_RENDER_HDR; + __GLX_COMPRESSED_TEXIMAGE_3D_HDR; +} __GLXcompressedTexImage3DHeader; + +typedef struct { + __GLX_RENDER_LARGE_HDR; + __GLX_COMPRESSED_TEXIMAGE_3D_HDR; +} __GLXcompressedTexImage3DLargeHeader; + +typedef struct { + __GLX_COMPRESSED_TEXIMAGE_3D_HDR; +} __GLXdispatchCompressedTexImage3DHeader; + +/** + * Data that is specifi to a \c glCompressedTexSubImage3D call. The data is + * sent in the following order: + * - Render or RenderLarge header + * - CompressedTexSubImage3D header + */ + +#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR \ + CARD32 target B32; \ + CARD32 level B32; \ + CARD32 xoffset B32; \ + CARD32 yoffset B32; \ + CARD32 zoffset B32; \ + CARD32 width B32; \ + CARD32 height B32; \ + CARD32 depth B32; \ + CARD32 format B32; \ + CARD32 imageSize B32 + +#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE 32 + +#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE \ + (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE) + +#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_DISPATCH_HDR_SIZE \ + (__GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE) + +typedef struct { + __GLX_RENDER_HDR; + __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR; +} __GLXcompressedTexSubImage3DHeader; + +typedef struct { + __GLX_RENDER_LARGE_HDR; + __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR; +} __GLXcompressedTexSubImage3DLargeHeader; + +typedef struct { + __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR; +} __GLXdispatchCompressedTexSubImage3DHeader; + /* ** Data that is specific to a glDrawPixels call. The data is sent in the ** following order: @@ -1506,6 +1737,18 @@ #define X_GLXQueryExtensionsString 18 #define X_GLXQueryServerString 19 #define X_GLXClientInfo 20 +#define X_GLXGetFBConfigs 21 +#define X_GLXCreatePixmap 22 +#define X_GLXDestroyPixmap 23 +#define X_GLXCreateNewContext 24 +#define X_GLXQueryContext 25 +#define X_GLXMakeContextCurrent 26 +#define X_GLXCreatePbuffer 27 +#define X_GLXDestroyPbuffer 28 +#define X_GLXGetDrawableAttributes 29 +#define X_GLXChangeDrawableAttributes 30 +#define X_GLXCreateWindow 31 +#define X_GLXDestroyWindow 32 /* Opcodes for single commands (part of GLX command space) */ @@ -1569,6 +1812,7 @@ #define X_GLsop_GetMinmax 157 #define X_GLsop_GetMinmaxParameterfv 158 #define X_GLsop_GetMinmaxParameteriv 159 +#define X_GLsop_GetCompressedTexImage 160 /* Opcodes for rendering commands */ @@ -1798,37 +2042,242 @@ #define X_GLrop_TexImage3D 4114 #define X_GLrop_TexSubImage3D 4115 #define X_GLrop_CopyTexSubImage3D 4123 -#define X_GLrop_ActiveTextureARB 197 -#define X_GLrop_MultiTexCoord1dvARB 198 -#define X_GLrop_MultiTexCoord1fvARB 199 -#define X_GLrop_MultiTexCoord1ivARB 200 -#define X_GLrop_MultiTexCoord1svARB 201 -#define X_GLrop_MultiTexCoord2dvARB 202 -#define X_GLrop_MultiTexCoord2fvARB 203 -#define X_GLrop_MultiTexCoord2ivARB 204 -#define X_GLrop_MultiTexCoord2svARB 205 -#define X_GLrop_MultiTexCoord3dvARB 206 -#define X_GLrop_MultiTexCoord3fvARB 207 -#define X_GLrop_MultiTexCoord3ivARB 208 -#define X_GLrop_MultiTexCoord3svARB 209 -#define X_GLrop_MultiTexCoord4dvARB 210 -#define X_GLrop_MultiTexCoord4fvARB 211 -#define X_GLrop_MultiTexCoord4ivARB 212 -#define X_GLrop_MultiTexCoord4svARB 213 #define X_GLrop_DrawArraysEXT 4116 +/* Added for core GL version 1.3 */ + +#define X_GLrop_ActiveTextureARB 197 +#define X_GLrop_MultiTexCoord1dvARB 198 +#define X_GLrop_MultiTexCoord1fvARB 199 +#define X_GLrop_MultiTexCoord1ivARB 200 +#define X_GLrop_MultiTexCoord1svARB 201 +#define X_GLrop_MultiTexCoord2dvARB 202 +#define X_GLrop_MultiTexCoord2fvARB 203 +#define X_GLrop_MultiTexCoord2ivARB 204 +#define X_GLrop_MultiTexCoord2svARB 205 +#define X_GLrop_MultiTexCoord3dvARB 206 +#define X_GLrop_MultiTexCoord3fvARB 207 +#define X_GLrop_MultiTexCoord3ivARB 208 +#define X_GLrop_MultiTexCoord3svARB 209 +#define X_GLrop_MultiTexCoord4dvARB 210 +#define X_GLrop_MultiTexCoord4fvARB 211 +#define X_GLrop_MultiTexCoord4ivARB 212 +#define X_GLrop_MultiTexCoord4svARB 213 +#define X_GLrop_CompressedTexImage1D 214 +#define X_GLrop_CompressedTexImage2D 215 +#define X_GLrop_CompressedTexImage3D 216 +#define X_GLrop_CompressedTexSubImage1D 217 +#define X_GLrop_CompressedTexSubImage2D 218 +#define X_GLrop_CompressedTexSubImage3D 219 +#define X_GLrop_SampleCoverageARB 229 + +/* Added for core GL version 1.4 */ + +#define X_GLrop_WindowPos3fARB 230 +#define X_GLrop_FogCoordfv 4124 +#define X_GLrop_FogCoorddv 4125 +#define X_GLrop_PointParameterfARB 2065 +#define X_GLrop_PointParameterfvARB 2066 +#define X_GLrop_SecondaryColor3bv 4126 +#define X_GLrop_SecondaryColor3sv 4127 +#define X_GLrop_SecondaryColor3iv 4128 +#define X_GLrop_SecondaryColor3fv 4129 +#define X_GLrop_SecondaryColor3dv 4130 +#define X_GLrop_SecondaryColor3ubv 4131 +#define X_GLrop_SecondaryColor3usv 4132 +#define X_GLrop_SecondaryColor3uiv 4133 +#define X_GLrop_BlendFuncSeparate 4134 +#define X_GLrop_PointParameteri 4221 +#define X_GLrop_PointParameteriv 4222 + +/* Added for core GL version 1.5 */ +/* XXX opcodes not defined in the spec */ /* Opcodes for Vendor Private commands */ -#define X_GLvop_AreTexturesResidentEXT 11 -#define X_GLvop_DeleteTexturesEXT 12 -#define X_GLvop_GenTexturesEXT 13 -#define X_GLvop_IsTextureEXT 14 +#define X_GLvop_AreTexturesResidentEXT 11 +#define X_GLvop_DeleteTexturesEXT 12 +#define X_GLvop_GenTexturesEXT 13 +#define X_GLvop_IsTextureEXT 14 +#define X_GLvop_GetCombinerInputParameterfvNV 1270 +#define X_GLvop_GetCombinerInputParameterivNV 1271 +#define X_GLvop_GetCombinerOutputParameterfvNV 1272 +#define X_GLvop_GetCombinerOutputParameterivNV 1273 +#define X_GLvop_GetFinalCombinerOutputParameterfvNV 1274 +#define X_GLvop_GetFinalCombinerOutputParameterivNV 1275 +#define X_GLvop_DeleteFenceNV 1276 +#define X_GLvop_GenFencesNV 1277 +#define X_GLvop_IsFenceNV 1278 +#define X_GLvop_TestFenceNV 1279 +#define X_GLvop_GetFenceivNV 1280 +#define X_GLvop_AreProgramsResidentNV 1293 +#define X_GLvop_DeleteProgramARB 1294 +#define X_GLvop_GenProgramsARB 1295 +#define X_GLvop_GetProgramEnvParameterfvARB 1296 +#define X_GLvop_GetProgramEnvParameterdvARB 1297 +#define X_GLvop_GetProgramEnvParameterivNV 1298 +#define X_GLvop_GetProgramStringNV 1299 +#define X_GLvop_GetTrackMatrixivNV 1300 +#define X_GLvop_GetVetrexAttribdvARB 1301 +#define X_GLvop_GetVetrexAttribfvARB 1302 +#define X_GLvop_GetVetrexAttribivARB 1303 +#define X_GLvop_IsProgramARB 1304 +#define X_GLvop_GetProgramLocalParameterfvARB 1305 +#define X_GLvop_GetProgramLocalParameterdvARB 1306 +#define X_GLvop_GetProgramivARB 1307 +#define X_GLvop_GetProgramStringARB 1308 +#define X_GLvop_GetProgramNamedParameter4fvNV 1310 +#define X_GLvop_GetProgramNamedParameter4dvNV 1311 +#define X_GLvop_SampleMaskSGIS 2048 +#define X_GLvop_SamplePatternSGIS 2049 /* Opcodes for GLX vendor private commands */ -#define X_GLXvop_QueryContextInfoEXT 1024 +#define X_GLXvop_QueryContextInfoEXT 1024 +#define X_GLXvop_SwapIntervalSGI 65536 +#define X_GLXvop_MakeCurrentReadSGI 65537 +#define X_GLXvop_CreateGLXVideoSourceSGIX 65538 +#define X_GLXvop_DestroyGLXVideoSourceSGIX 65539 +#define X_GLXvop_GetFBConfigsSGIX 65540 +#define X_GLXvop_CreateContextWithConfigSGIX 65541 +#define X_GLXvop_CreateGLXPixmapWithConfigSGIX 65542 +#define X_GLXvop_CreateGLXPbufferSGIX 65543 +#define X_GLXvop_DestroyGLXPbufferSGIX 65544 +#define X_GLXvop_ChangeDrawableAttributesSGIX 65545 +#define X_GLXvop_GetDrawableAttributesSGIX 65546 +#define X_GLXvop_JoinSwapGroupSGIX 65547 +#define X_GLXvop_BindSwapBarrierSGIX 65548 +#define X_GLXvop_QueryMaxSwapBarriersSGIX 65549 +#define X_GLXvop_QueryHyperpipeNetworkSGIX 65550 +#define X_GLXvop_QueryHyperpipeConfigSGIX 65551 +#define X_GLXvop_HyperpipeConfigSGIX 65552 +#define X_GLXvop_DestroyHyperpipeConfigSGIX 65553 + + +/* ARB extension opcodes */ + +/* 1. GL_ARB_multitexture - see GL 1.2 opcodes */ +/* 5. GL_ARB_multisample - see GL 1.3 opcodes */ +/* 12. GL_ARB_texture_compression - see GL 1.3 opcodes */ +/* 14. GL_ARB_point_parameters - see GL 1.4 opcodees */ + +/* 15. GL_ARB_vertex_blend */ +#define X_GLrop_WeightbvARB 220 +#define X_GLrop_WeightubvARB 221 +#define X_GLrop_WeightsvARB 222 +#define X_GLrop_WeightusvARB 223 +#define X_GLrop_WeightivARB 224 +#define X_GLrop_WeightuivARB 225 +#define X_GLrop_VertexBlendARB 226 +#define X_GLrop_WeightfvARB 227 +#define X_GLrop_WeightdvARB 228 + +/* 16. GL_ARB_matrix_palette */ +/* XXX opcodes not defined in the spec */ + +/* 25. GL_ARB_window_pos - see GL 1.4 opcodes */ + +/* 26. GL_ARB_vertex_program */ +#define X_GLrop_BindProgramARB 4180 +#define X_GLrop_ProgramEnvParameter4fvARB 4184 +#define X_GLrop_ProgramEnvParameter4dvARB 4185 +#define X_GLrop_VertexAttrib1svARB 4189 +#define X_GLrop_VertexAttrib2svARB 4190 +#define X_GLrop_VertexAttrib3svARB 4191 +#define X_GLrop_VertexAttrib4svARB 4192 +#define X_GLrop_VertexAttrib1fvARB 4193 +#define X_GLrop_VertexAttrib2fvARB 4194 +#define X_GLrop_VertexAttrib3fvARB 4195 +#define X_GLrop_VertexAttrib4fvARB 4196 +#define X_GLrop_VertexAttrib1dvARB 4197 +#define X_GLrop_VertexAttrib2dvARB 4198 +#define X_GLrop_VertexAttrib3dvARB 4199 +#define X_GLrop_ProgramLocalParameter4fvARB 4215 +#define X_GLrop_ProgramLocalParameter4dvARB 4216 +#define X_GLrop_ProgramStringARB 4217 +#define X_GLrop_VertexAttrib4dvARB 4200 +#define X_GLrop_VertexAttrib4NubvARB 4201 +#define X_GLrop_VertexAttrib4bvARB 4230 +#define X_GLrop_VertexAttrib4ivARB 4231 +#define X_GLrop_VertexAttrib4ubvARB 4232 +#define X_GLrop_VertexAttrib4usvARB 4233 +#define X_GLrop_VertexAttrib4uivARB 4234 +#define X_GLrop_VertexAttrib4NbvARB 4235 +#define X_GLrop_VertexAttrib4NsvARB 4236 +#define X_GLrop_VertexAttrib4NivARB 4237 +#define X_GLrop_VertexAttrib4NusvARB 4238 +#define X_GLrop_VertexAttrib4NuivARB 4239 + +/* 27. GL_ARB_fragment_program - see GL_ARB_vertex_program opcodes */ + +/* 29. GL_ARB_occlusion_query */ +/* XXX opcodes not defined in the spec */ + + +/* New extension opcodes */ + +/* 145. GL_EXT_secondary_color - see GL 1.4 opcodes */ + +/* 188. GL_EXT_vertex_weighting */ +#define X_GLrop_VertexWeightfvEXT 4135 + +/* 191. GL_NV_register_combiners */ +#define X_GLrop_CombinerParameterfNV 4136 +#define X_GLrop_CombinerParameterfvNV 4137 +#define X_GLrop_CombinerParameteriNV 4138 +#define X_GLrop_CombinerParameterivNV 4139 +#define X_GLrop_CombinerInputNV 4140 +#define X_GLrop_CombinerOutputNV 4141 +#define X_GLrop_FinalCombinerInputNV 4142 + +/* 222. GL_NV_fence */ +#define X_GLrop_SetFenceNV 4143 +#define X_GLrop_FinishFenceNV 4144 + +/* 227. GL_NV_register_combiners2 */ +/* XXX opcodes not defined in the spec */ + +/* 233. GL_NV_vertex_program - see also GL_ARB_vertex_program opcodes */ +#define X_GLrop_ExecuteProgramNV 4181 +#define X_GLrop_RequestResidentProgramsNV 4182 +#define X_GLrop_LoadProgamNV 4183 +#define X_GLrop_ProgramParameters4fvNV 4186 +#define X_GLrop_ProgramParameters4dvNV 4187 +#define X_GLrop_TrackMatrixNV 4188 +#define X_GLrop_VertexAttribs1svNV 4202 +#define X_GLrop_VertexAttribs2svNV 4203 +#define X_GLrop_VertexAttribs3svNV 4204 +#define X_GLrop_VertexAttribs4svNV 4205 +#define X_GLrop_VertexAttribs1fvNV 4206 +#define X_GLrop_VertexAttribs2fvNV 4207 +#define X_GLrop_VertexAttribs3fvNV 4208 +#define X_GLrop_VertexAttribs4fvNV 4209 +#define X_GLrop_VertexAttribs1dvNV 4210 +#define X_GLrop_VertexAttribs2dvNV 4211 +#define X_GLrop_VertexAttribs3dvNV 4212 +#define X_GLrop_VertexAttribs4dvNV 4213 +#define X_GLrop_VertexAttribs4ubvNV 4214 + +/* 261. GL_NV_occlusion_query */ +/* XXX opcodes not defined in the spec */ + +/* 262. GL_NV_point_sprite - see GL 1.4 opcodes */ + +/* 268. GL_EXT_stencil_two_side */ +#define X_GLrop_ActiveStencilFaceEXT 4220 + +/* 282. GL_NV_fragment_program - see also GL_NV_vertex_program and GL_ARB_vertex_program opcodes */ +#define X_GLrop_ProgramNamedParameter4fvNV 4218 +#define X_GLrop_ProgramNamedParameter4dvNV 4219 + +/* 285. GL_NV_primitive_restart */ +/* XXX opcodes not defined in the spec */ + +/* 297. GL_EXT_depth_bounds_test */ +#define X_GLrop_DepthBoundsEXT 4229 +/* 299. GL_EXT_blend_equation_separate */ +#define X_GLrop_BlendEquationSeparateEXT 4228 #endif /* _GLX_glxproto_h_ */ Index: xc/include/extensions/Imakefile diff -u xc/include/extensions/Imakefile:3.53 xc/include/extensions/Imakefile:3.56 --- xc/include/extensions/Imakefile:3.53 Mon Dec 16 11:18:49 2002 +++ xc/include/extensions/Imakefile Mon Apr 21 14:56:47 2003 @@ -3,7 +3,7 @@ -XCOMM $XFree86: xc/include/extensions/Imakefile,v 3.53 2002/12/16 16:18:49 dawes Exp $ +XCOMM $XFree86: xc/include/extensions/Imakefile,v 3.56 2003/04/21 18:56:47 sven Exp $ #if BuildScreenSaverExt || BuildScreenSaverLibrary SCREENSAVERHEADERS = saver.h saverproto.h scrnsaver.h @@ -67,7 +67,6 @@ extutil.h \ XI.h XInput.h XIproto.h \ XTest.h xtestext1.h xteststr.h \ - XIE.h XIEproto.h XIEprotost.h \ XKB.h XKBgeom.h XKBproto.h XKBstr.h XKBsrv.h \ Xdbe.h Xdbeproto.h \ Xag.h Xagstr.h Xagsrv.h \ @@ -100,7 +99,9 @@ InstallDriverSDKNonExecFile(xf86dgastr.h,$(DRIVERSDKINCLUDEDIR)/extensions) InstallDriverSDKNonExecFile(xf86rush.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(xf86rushstr.h,$(DRIVERSDKINCLUDEDIR)) +InstallDriverSDKNonExecFile(renderproto.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(Xv.h,$(DRIVERSDKINCLUDEDIR)/extensions) +InstallDriverSDKNonExecFile(XvMC.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(Xvlib.h,$(DRIVERSDKINCLUDEDIR)/extensions) InstallDriverSDKNonExecFile(Xv.h,$(DRIVERSDKINCLUDEDIR)/X11/extensions) InstallDriverSDKNonExecFile(Xvlib.h,$(DRIVERSDKINCLUDEDIR)/X11/extensions) Index: xc/include/extensions/MITMisc.h diff -u xc/include/extensions/MITMisc.h:1.2 xc/include/extensions/MITMisc.h:1.3 --- xc/include/extensions/MITMisc.h:1.2 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/MITMisc.h Mon Nov 17 17:20:02 2003 @@ -45,24 +45,18 @@ _XFUNCPROTOBEGIN Bool XMITMiscQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* event_basep */, int* /* error_basep */ -#endif ); Status XMITMiscSetBugMode( -#if NeedFunctionPrototypes Display* /* dpy */, Bool /* onOff */ -#endif ); Bool XMITMiscGetBugMode( -#if NeedFunctionPrototypes Display* /* dpy */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/XEVI.h diff -u xc/include/extensions/XEVI.h:3.4 xc/include/extensions/XEVI.h:3.5 --- xc/include/extensions/XEVI.h:3.4 Wed Jan 17 12:53:16 2001 +++ xc/include/extensions/XEVI.h Mon Nov 17 17:20:02 2003 @@ -21,6 +21,8 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/include/extensions/XEVI.h,v 3.5 2003/11/17 22:20:02 dawes Exp $ */ + #ifndef _XEVI_H_ #define _XEVI_H_ #include @@ -43,25 +45,19 @@ } ExtendedVisualInfo; _XFUNCPROTOBEGIN Bool XeviQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */ -#endif ); Status XeviQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* majorVersion */, int* /* minorVersion */ -#endif ); Status XeviGetVisualInfo( -#if NeedFunctionPrototypes Display* /* dpy */, VisualID* /* visual_query */, int /* nVisual_query */, ExtendedVisualInfo** /* extendedVisualInfo_return */, int* /* nInfo_return */ -#endif ); _XFUNCPROTOEND #endif Index: xc/include/extensions/XIE.h diff -u xc/include/extensions/XIE.h:1.2 xc/include/extensions/XIE.h:removed --- xc/include/extensions/XIE.h:1.2 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/XIE.h Sat Feb 28 21:41:08 2004 @@ -1,429 +0,0 @@ -/* $Xorg: XIE.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */ -/****************************************************************************** - - -Copyright 1993, 1994, 1998 The Open Group - -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. - -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 -OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. - -******************************************************************************/ - -#ifndef _XIE_H_ -#define _XIE_H_ - - -/* Extension Name and version number */ - -#define xieExtName "XIE" - -#define xieMajorVersion 5 -#define xieMinorVersion 0 -#define xieEarliestMinorVersion 0 -#define xieLatestMinorVersion 0 - - -/* ServiceClass */ - -#ifdef XIE_DIS -#define XIE_FULL 0 -#else -#define XIE_FULL 1 -#endif - -#define xieValFull 1 -#define xieValDIS 2 - - -/* Limits */ - -#define xieValMaxBands 3 - - -/* Alignment */ - -#define xieValAlignable 1 -#define xieValArbitrary 2 - - -/* ArithmeticOp */ - -#define xieValAdd 1 -#define xieValSub 2 -#define xieValSubRev 3 -#define xieValMul 4 -#define xieValDiv 5 -#define xieValDivRev 6 -#define xieValMin 7 -#define xieValMax 8 -#define xieValGamma 9 - - -/* ColorAllocTechnique */ - -#define xieValColorAllocDefault 0 -#define xieValColorAllocAll 2 -#define xieValColorAllocMatch 4 -#define xieValColorAllocRequantize 6 - - -/* Colorspace conversions */ - -#define xieValRGBToCIELab 2 -#define xieValRGBToCIEXYZ 4 -#define xieValRGBToYCbCr 6 -#define xieValRGBToYCC 8 - -#define xieValCIELabToRGB 2 -#define xieValCIEXYZToRGB 4 -#define xieValYCbCrToRGB 6 -#define xieValYCCToRGB 8 - - -/* CompareOp */ - -#define xieValLT 1 -#define xieValLE 2 -#define xieValEQ 3 -#define xieValNE 4 -#define xieValGT 5 -#define xieValGE 6 - - -/* ConstrainTechnique */ - -#define xieValConstrainClipScale 2 -#define xieValConstrainHardClip 4 - - -/* ConvolveTechnique */ - -#define xieValConvolveDefault 0 -#define xieValConvolveConstant 2 -#define xieValConvolveReplicate 4 - - -/* DataClass */ - -#define xieValSingleBand 1 -#define xieValTripleBand 2 - -/* DataType */ - -#define xieValConstrained 1 -#define xieValUnconstrained 2 - - -/* DecodeTechnique */ - -#define xieValDecodeUncompressedSingle 2 /* bitonal & grayscale */ -#define xieValDecodeUncompressedTriple 3 /* color */ -#define xieValDecodeG31D 4 /* FAX */ -#define xieValDecodeG32D 6 /* FAX */ -#define xieValDecodeG42D 8 /* FAX */ -#define xieValDecodeJPEGBaseline 10 /* grayscale & color */ -#define xieValDecodeJPEGLossless 12 /* grayscale & color */ -#define xieValDecodeTIFF2 14 /* TIFF modified G31D */ -#define xieValDecodeTIFFPackBits 16 /* TIFF APPLE FORMAT */ - - -/* DitherTechnique */ - -#define xieValDitherDefault 0 -#define xieValDitherErrorDiffusion 2 -#define xieValDitherOrdered 4 - - -/* EncodeTechnique */ - -#define xieValEncodeServerChoice 1 /* (to photomaps) */ -#define xieValEncodeUncompressedSingle 2 /* bitonal & grayscale */ -#define xieValEncodeUncompressedTriple 3 /* color */ -#define xieValEncodeG31D 4 /* FAX */ -#define xieValEncodeG32D 6 /* FAX */ -#define xieValEncodeG42D 8 /* FAX */ -#define xieValEncodeJPEGBaseline 10 /* grayscale & color */ -#define xieValEncodeJPEGLossless 12 /* grayscale & color */ -#define xieValEncodeTIFF2 14 /* TIFF modified G31D */ -#define xieValEncodeTIFFPackBits 16 /* TIFF APPLE FORMAT */ - -/* ServerChoice preference hints */ - -#define xieValPreferDefault 0 -#define xieValPreferSpace 1 -#define xieValPreferTime 2 - -/* JPEG-Lossless predictor */ - -#define xieValPredictorNone 0 -#define xieValPredictorA 1 -#define xieValPredictorB 2 -#define xieValPredictorC 3 -#define xieValPredictorABC 4 -#define xieValPredictorABC2 5 -#define xieValPredictorBAC2 6 -#define xieValPredictorAB2 7 - - -/* ExportNotify */ - -#define xieValDisable 1 -#define xieValFirstData 2 -#define xieValNewData 3 - - -/* ExportState */ - -#define xieValExportDone 1 -#define xieValExportMore 2 -#define xieValExportEmpty 3 -#define xieValExportError 4 - - -/* GamutTechnique */ - -#define xieValGamutDefault 0 -#define xieValGamutNone 1 -#define xieValGamutClipRGB 2 - - -/* GeometryTechnique */ - -#define xieValGeomDefault 0 -#define xieValGeomAntialias 2 -#define xieValGeomAntialiasByArea 4 -#define xieValGeomAntialiasByLPF 6 -#define xieValGeomBilinearInterp 8 -#define xieValGeomGaussian 10 -#define xieValGeomNearestNeighbor 12 - - -/* NearestNeighbor modify */ - -#define xieValFavorDown 1 -#define xieValFavorUp 2 -#define xieValRoundNW 3 -#define xieValRoundNE 4 -#define xieValRoundSE 5 -#define xieValRoundSW 6 - - -/* HistogramShape */ - -#define xieValHistogramFlat 2 -#define xieValHistogramGaussian 4 -#define xieValHistogramHyperbolic 6 - - -/* Interleave */ - -#define xieValBandByPixel 1 -#define xieValBandByPlane 2 - - -/* MathOp */ - -#define xieValExp 1 -#define xieValLn 2 -#define xieValLog2 3 -#define xieValLog10 4 -#define xieValSquare 5 -#define xieValSqrt 6 - - -/* Orientation */ - -#define xieValLSFirst 1 -#define xieValMSFirst 2 - - -/* PhotofloOutcome */ - -#define xieValFloSuccess 1 -#define xieValFloAbort 2 -#define xieValFloError 3 - - -/* PhotofloState */ - -#define xieValInactive 1 -#define xieValActive 2 -#define xieValNonexistent 3 - - -/* TechniqueGroup */ - -#define xieValDefault 0 -#define xieValAll 1 -#define xieValColorAlloc 2 -#define xieValConstrain 4 -#define xieValConvertFromRGB 6 -#define xieValConvertToRGB 8 -#define xieValConvolve 10 -#define xieValDecode 12 -#define xieValDither 14 -#define xieValEncode 16 -#define xieValGamut 18 -#define xieValGeometry 20 -#define xieValHistogram 22 -#define xieValWhiteAdjust 24 - -#define xieValMaxTechGroup 24 - - -/* WhiteAdjustTechnique */ - -#define xieValWhiteAdjustDefault 0 -#define xieValWhiteAdjustNone 1 -#define xieValWhiteAdjustCIELabShift 2 - - -/* Photoflo elements */ - -#define xieElemImportClientLUT 1 -#define xieElemImportClientPhoto 2 -#define xieElemImportClientROI 3 -#define xieElemImportDrawable 4 -#define xieElemImportDrawablePlane 5 -#define xieElemImportLUT 6 -#define xieElemImportPhotomap 7 -#define xieElemImportROI 8 -#define xieElemArithmetic 9 -#define xieElemBandCombine 10 -#define xieElemBandExtract 11 -#define xieElemBandSelect 12 -#define xieElemBlend 13 -#define xieElemCompare 14 -#define xieElemConstrain 15 -#define xieElemConvertFromIndex 16 -#define xieElemConvertFromRGB 17 -#define xieElemConvertToIndex 18 -#define xieElemConvertToRGB 19 -#define xieElemConvolve 20 -#define xieElemDither 21 -#define xieElemGeometry 22 -#define xieElemLogical 23 -#define xieElemMatchHistogram 24 -#define xieElemMath 25 -#define xieElemPasteUp 26 -#define xieElemPoint 27 -#define xieElemUnconstrain 28 -#define xieElemExportClientHistogram 29 -#define xieElemExportClientLUT 30 -#define xieElemExportClientPhoto 31 -#define xieElemExportClientROI 32 -#define xieElemExportDrawable 33 -#define xieElemExportDrawablePlane 34 -#define xieElemExportLUT 35 -#define xieElemExportPhotomap 36 -#define xieElemExportROI 37 - -#define xieMaxElem 37 - - -/* Event Codes */ - -#define xieEvnNoColorAlloc 0 -#define xieEvnNoDecodeNotify 1 -#define xieEvnNoExportAvailable 2 -#define xieEvnNoImportObscured 3 -#define xieEvnNoPhotofloDone 4 - -#define xieNumEvents 5 - - -/* Error Codes */ - -#define xieErrNoColorList 0 -#define xieErrNoLUT 1 -#define xieErrNoPhotoflo 2 -#define xieErrNoPhotomap 3 -#define xieErrNoPhotospace 4 -#define xieErrNoROI 5 -#define xieErrNoFlo 6 - -#define xieNumErrors 7 - - -/* Flo Error Codes */ - -#define xieErrNoFloAccess 1 -#define xieErrNoFloAlloc 2 -#define xieErrNoFloColormap 3 -#define xieErrNoFloColorList 4 -#define xieErrNoFloDomain 5 -#define xieErrNoFloDrawable 6 -#define xieErrNoFloElement 7 -#define xieErrNoFloGC 8 -#define xieErrNoFloID 9 -#define xieErrNoFloLength 10 -#define xieErrNoFloLUT 11 -#define xieErrNoFloMatch 12 -#define xieErrNoFloOperator 13 -#define xieErrNoFloPhotomap 14 -#define xieErrNoFloROI 15 -#define xieErrNoFloSource 16 -#define xieErrNoFloTechnique 17 -#define xieErrNoFloValue 18 -#define xieErrNoFloImplementation 19 - -#define xieNumFloErrors 19 - -#endif /* _XIE_H_ */ Index: xc/include/extensions/XIEproto.h diff -u xc/include/extensions/XIEproto.h:1.2 xc/include/extensions/XIEproto.h:removed --- xc/include/extensions/XIEproto.h:1.2 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/XIEproto.h Sat Feb 28 21:41:08 2004 @@ -1,689 +0,0 @@ -/* $Xorg: XIEproto.h,v 1.6 2001/02/09 02:03:23 xorgcvs Exp $ */ -/****************************************************************************** -Copyright 1993, 1994, 1998 The Open Group - -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. - -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 OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. -******************************************************************************/ - -#ifndef _XIEPROTO_H_ -#define _XIEPROTO_H_ - -#include - -#define Drawable CARD32 -#define Colormap CARD32 -#define GContext CARD32 - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; -} xieReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD16 majorVersion B16; - CARD16 minorVersion B16; -} xieQueryImageExtensionReq; - -typedef struct { - CARD8 type; - CARD8 data; - CARD16 sequenceNum B16; - CARD32 length B32; - CARD16 majorVersion B16; - CARD16 minorVersion B16; - xieTypServiceClass serviceClass; - xieTypAlignment alignment; - CARD16 unconstrainedMantissa B16; - INT32 unconstrainedMaxExp B32; - INT32 unconstrainedMinExp B32; - CARD8 pad2[8]; - /* LISTofCARD32 (constrained-levels) */ -} xieQueryImageExtensionReply; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypTechniqueGroup techniqueGroup; - CARD8 pad[3]; -} xieQueryTechniquesReq; - -typedef struct { - CARD8 type; - CARD8 data; - CARD16 sequenceNum B16; - CARD32 length B32; - CARD16 numTechniques B16; - CARD8 pad[22]; - /* LISTofTechniqueRec (numTechniques) */ -} xieQueryTechniquesReply; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypColorList colorList B32; -} xieCreateColorListReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypColorList colorList B32; -} xieDestroyColorListReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypColorList colorList B32; -} xiePurgeColorListReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypColorList colorList B32; -} xieQueryColorListReq; - -typedef struct { - CARD8 type; - CARD8 data; - CARD16 sequenceNum B16; - CARD32 length B32; - Colormap colormap B32; - CARD8 pad[20]; - /* LISTofCARD32 (length) */ -} xieQueryColorListReply; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypLUT lut B32; -} xieCreateLUTReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypLUT lut B32; -} xieDestroyLUTReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotomap photomap B32; -} xieCreatePhotomapReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotomap photomap B32; -} xieDestroyPhotomapReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotomap photomap B32; -} xieQueryPhotomapReq; - -typedef struct { - CARD8 type; - BOOL populated; - CARD16 sequenceNum B16; - CARD32 length B32; - xieTypDataClass dataClass; - xieTypDataType dataType; - xieTypDecodeTechnique decodeTechnique B16; - CARD32 width0 B32; - CARD32 width1 B32; - CARD32 width2 B32; - CARD32 height0 B32; - CARD32 height1 B32; - CARD32 height2 B32; - CARD32 levels0 B32; - CARD32 levels1 B32; - CARD32 levels2 B32; -} xieQueryPhotomapReply; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypROI roi B32; -} xieCreateROIReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypROI roi B32; -} xieDestroyROIReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotospace nameSpace B32; -} xieCreatePhotospaceReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotospace nameSpace B32; -} xieDestroyPhotospaceReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotospace nameSpace B32; - CARD32 floID B32; - CARD16 numElements B16; - BOOL notify; - CARD8 pad; - /* LISTofPhotoElement (numElements) */ -} xieExecuteImmediateReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotoflo floID B32; - CARD16 numElements B16; - CARD16 pad B16; - /* LISTofPhotoElement (numElements) */ -} xieCreatePhotofloReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotoflo floID B32; -} xieDestroyPhotofloReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotoflo floID B32; - BOOL notify; - CARD8 pad[3]; -} xieExecutePhotofloReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotoflo floID B32; - xieTypPhototag start B16; - CARD16 numElements B16; - /* LISTofPhotoElement (numElements) */ -} xieModifyPhotofloReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - xieTypPhotoflo floID B32; - CARD16 numElements B16; - CARD16 pad B16; - /* LISTofPhotoElement (numElements) */ -} xieRedefinePhotofloReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD32 nameSpace B32; - CARD32 floID B32; - xieTypPhototag element B16; - BOOL final; - CARD8 bandNumber; - CARD32 byteCount B32; - /* LISTofCARD8 (byteCount) */ - /* pad (byteCount) */ -} xiePutClientDataReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD32 nameSpace B32; - CARD32 floID B32; - CARD32 maxBytes B32; - xieTypPhototag element B16; - BOOL terminate; - CARD8 bandNumber; -} xieGetClientDataReq; - -typedef struct { - CARD8 type; - CARD8 newState; - CARD16 sequenceNum B16; - CARD32 length B32; - CARD32 byteCount B32; - CARD8 pad[20]; - /* LISTofCARD8 (byteCount) */ - /* pad (byteCount) */ -} xieGetClientDataReply; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD32 nameSpace B32; - CARD32 floID B32; -} xieQueryPhotofloReq; - -typedef struct { - CARD8 type; - CARD8 state; - CARD16 sequenceNum B16; - CARD32 length B32; - CARD16 expectedCount B16; - CARD16 availableCount B16; - CARD8 pad[20]; - /* LISTofPhototag (expectedCount) */ - /* pad (expectedCount * 2) */ - /* LISTofPhototag (availableCount) */ - /* pad (availableCount * 2) */ -} xieQueryPhotofloReply; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD32 nameSpace B32; - CARD32 floID B32; -} xieAwaitReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD32 nameSpace B32; - CARD32 floID B32; -} xieAbortReq; - - -/* - * Request codes - */ - -#define X_ieQueryImageExtension 1 -#define X_ieQueryTechniques 2 -#define X_ieCreateColorList 3 -#define X_ieDestroyColorList 4 -#define X_iePurgeColorList 5 -#define X_ieQueryColorList 6 -#define X_ieCreateLUT 7 -#define X_ieDestroyLUT 8 -#define X_ieCreatePhotomap 9 -#define X_ieDestroyPhotomap 10 -#define X_ieQueryPhotomap 11 -#define X_ieCreateROI 12 -#define X_ieDestroyROI 13 -#define X_ieCreatePhotospace 14 -#define X_ieDestroyPhotospace 15 -#define X_ieExecuteImmediate 16 -#define X_ieCreatePhotoflo 17 -#define X_ieDestroyPhotoflo 18 -#define X_ieExecutePhotoflo 19 -#define X_ieModifyPhotoflo 20 -#define X_ieRedefinePhotoflo 21 -#define X_iePutClientData 22 -#define X_ieGetClientData 23 -#define X_ieQueryPhotoflo 24 -#define X_ieAwait 25 -#define X_ieAbort 26 - -#define xieNumProtoReq 26 - - -/* - * Events - */ -typedef struct { - CARD8 event; - xieTypPhotofloOutcome outcome; - CARD16 sequenceNum B16; - CARD32 time B32; - CARD32 instanceNameSpace B32; - CARD32 instanceFloID B32; - CARD8 pad[16]; -} xiePhotofloDoneEvn; - -typedef struct { - CARD8 event; - CARD8 pad1; - CARD16 sequenceNum B16; - CARD32 time B32; - CARD32 instanceNameSpace B32; - CARD32 instanceFloID B32; - xieTypPhototag src B16; - CARD16 type B16; - CARD32 pad2 B32; - CARD32 pad3 B16; - CARD32 pad4 B32; -} xieFloEvn; - -typedef struct { - CARD8 event; - CARD8 pad1; - CARD16 sequenceNum B16; - CARD32 time B32; - CARD32 instanceNameSpace B32; - CARD32 instanceFloID B32; - xieTypPhototag src B16; - CARD16 type B16; - xieTypColorList colorList B32; - xieTypColorAllocTechnique colorAllocTechnique B16; - CARD16 pad2 B16; - CARD32 data B32; -} xieColorAllocEvn; - -typedef struct { - CARD8 event; - CARD8 bandNumber; - CARD16 sequenceNum B16; - CARD32 time B32; - CARD32 instanceNameSpace B32; - CARD32 instanceFloID B32; - xieTypPhototag src B16; - CARD16 type B16; - xieTypDecodeTechnique decodeTechnique B16; - BOOL aborted; - CARD8 pad; - CARD32 width B32; - CARD32 height B32; -} xieDecodeNotifyEvn; - -typedef struct { - CARD8 event; - CARD8 bandNumber; - CARD16 sequenceNum B16; - CARD32 time B32; - CARD32 instanceNameSpace B32; - CARD32 instanceFloID B32; - xieTypPhototag src B16; - CARD16 type B16; - CARD32 data0 B32; - CARD32 data1 B32; - CARD32 data2 B32; -} xieExportAvailableEvn; - -typedef struct { - CARD8 event; - CARD8 pad; - CARD16 sequenceNum B16; - CARD32 time B32; - CARD32 instanceNameSpace B32; - CARD32 instanceFloID B32; - xieTypPhototag src B16; - CARD16 type B16; - Window window B32; - INT16 x B16; - INT16 y B16; - CARD16 width B16; - CARD16 height B16; -} xieImportObscuredEvn; - - -/* - * Errors - */ -typedef struct { - CARD8 error; - CARD8 code; - CARD16 sequenceNum B16; - CARD32 resourceID B32; - CARD16 minorOpcode B16; - CARD8 majorOpcode; - CARD8 pad[21]; -} xieResourceErr; - -typedef struct { - CARD8 error; - CARD8 code; - CARD16 sequenceNum B16; - CARD32 floID B32; - CARD16 minorOpcode B16; - CARD8 majorOpcode; - CARD8 floErrorCode; - CARD32 nameSpace B32; - xieTypPhototag phototag B16; - CARD16 type B16; - CARD32 resourceID B32; - CARD8 pad[8]; -} xieFloResourceErr; - -typedef struct { - CARD8 error; - CARD8 code; - CARD16 sequenceNum B16; - CARD32 floID B32; - CARD16 minorOpcode B16; - CARD8 majorOpcode; - CARD8 floErrorCode; - CARD32 nameSpace B32; - xieTypPhototag phototag B16; - CARD16 type B16; - CARD8 pad[12]; -} xieFloErr, xieFloAccessErr, xieFloAllocErr, xieFloElementErr, - xieFloLengthErr, xieFloMatchErr, xieFloSourceErr, xieFloImplementationErr; - -typedef struct { - CARD8 error; - CARD8 code; - CARD16 sequenceNum B16; - CARD32 floID B32; - CARD16 minorOpcode B16; - CARD8 majorOpcode; - CARD8 floErrorCode; - CARD32 nameSpace B32; - xieTypPhototag phototag B16; - CARD16 type B16; - xieTypPhototag domainSrc B16; - CARD8 pad[10]; -} xieFloDomainErr; - -typedef struct { - CARD8 error; - CARD8 code; - CARD16 sequenceNum B16; - CARD32 floID B32; - CARD16 minorOpcode B16; - CARD8 majorOpcode; - CARD8 floErrorCode; - CARD32 nameSpace B32; - CARD8 pad[16]; -} xieFloIDErr; - -typedef struct { - CARD8 error; - CARD8 code; - CARD16 sequenceNum B16; - CARD32 floID B32; - CARD16 minorOpcode B16; - CARD8 majorOpcode; - CARD8 floErrorCode; - CARD32 nameSpace B32; - xieTypPhototag phototag B16; - CARD16 type B16; -#if defined(__cplusplus) || defined(c_plusplus) - CARD8 c_operator; -#else - CARD8 operator; -#endif - CARD8 pad[11]; -} xieFloOperatorErr; - -typedef struct { - CARD8 error; - CARD8 code; - CARD16 sequenceNum B16; - CARD32 floID B32; - CARD16 minorOpcode B16; - CARD8 majorOpcode; - CARD8 floErrorCode; - CARD32 nameSpace B32; - xieTypPhototag phototag B16; - CARD16 type B16; - CARD16 techniqueNumber B16; - CARD16 lenTechParams B16; - CARD8 techniqueGroup; - CARD8 pad[7]; -} xieFloTechniqueErr; - -typedef struct { - CARD8 error; - CARD8 code; - CARD16 sequenceNum B16; - CARD32 floID B32; - CARD16 minorOpcode B16; - CARD8 majorOpcode; - CARD8 floErrorCode; - CARD32 nameSpace B32; - xieTypPhototag phototag B16; - CARD16 type B16; - CARD32 badValue B32; - CARD8 pad[8]; -} xieFloValueErr; - - - -/* - * SIZEOF values - */ -#define sz_xieReq 4 -#define sz_xieQueryImageExtensionReq 8 -#define sz_xieQueryImageExtensionReply 32 -#define sz_xieQueryTechniquesReq 8 -#define sz_xieQueryTechniquesReply 32 -#define sz_xieCreateColorListReq 8 -#define sz_xieDestroyColorListReq 8 -#define sz_xiePurgeColorListReq 8 -#define sz_xieQueryColorListReq 8 -#define sz_xieQueryColorListReply 32 -#define sz_xieCreateLUTReq 8 -#define sz_xieDestroyLUTReq 8 -#define sz_xieCreatePhotomapReq 8 -#define sz_xieDestroyPhotomapReq 8 -#define sz_xieQueryPhotomapReq 8 -#define sz_xieQueryPhotomapReply 48 -#define sz_xieCreateROIReq 8 -#define sz_xieDestroyROIReq 8 -#define sz_xieCreatePhotospaceReq 8 -#define sz_xieDestroyPhotospaceReq 8 -#define sz_xieExecuteImmediateReq 16 -#define sz_xieCreatePhotofloReq 12 -#define sz_xieDestroyPhotofloReq 8 -#define sz_xieExecutePhotofloReq 12 -#define sz_xieModifyPhotofloReq 12 -#define sz_xieRedefinePhotofloReq 12 -#define sz_xiePutClientDataReq 20 -#define sz_xieGetClientDataReq 20 -#define sz_xieGetClientDataReply 32 -#define sz_xieQueryPhotofloReq 12 -#define sz_xieQueryPhotofloReply 32 -#define sz_xieAwaitReq 12 -#define sz_xieAbortReq 12 - -#define sz_xiePhotofloDoneEvn 32 -#define sz_xieColorAllocEvn 32 -#define sz_xieDecodeNotifyEvn 32 -#define sz_xieExportAvailableEvn 32 -#define sz_xieImportObscuredEvn 32 -#define sz_xieFloEvn 32 - -#define sz_xieResourceErr 32 -#define sz_xieFloAccessErr 32 -#define sz_xieFloAllocErr 32 -#define sz_xieFloElementErr 32 -#define sz_xieFloIDErr 32 -#define sz_xieFloLengthErr 32 -#define sz_xieFloMatchErr 32 -#define sz_xieFloSourceErr 32 -#define sz_xieFloDomainErr 32 -#define sz_xieFloOperatorErr 32 -#define sz_xieFloTechniqueErr 32 -#define sz_xieFloValueErr 32 -#define sz_xieFloImplementationErr 32 -#define sz_xieFloErr 32 - -#undef Drawable -#undef Colormap -#undef GContext - -#endif /* _XIEPROTO_H_ */ Index: xc/include/extensions/XIEprotost.h diff -u xc/include/extensions/XIEprotost.h:1.2 xc/include/extensions/XIEprotost.h:removed --- xc/include/extensions/XIEprotost.h:1.2 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/XIEprotost.h Sat Feb 28 21:41:08 2004 @@ -1,1145 +0,0 @@ -/* $Xorg: XIEprotost.h,v 1.7 2001/02/09 02:03:23 xorgcvs Exp $ */ -/****************************************************************************** - - -Copyright 1993, 1994, 1998 The Open Group - -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. - -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 -OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - - NOTICE - -This software is being provided by AGE Logic, Inc. under the -following license. By obtaining, using and/or copying this software, -you agree that you have read, understood, and will comply with these -terms and conditions: - - Permission to use, copy, modify, distribute and sell this - software and its documentation for any purpose and without - fee or royalty and to grant others any or all rights granted - herein is hereby granted, provided that you agree to comply - with the following copyright notice and statements, including - the disclaimer, and that the same appears on all copies and - derivative works of the software and documentation you make. - - "Copyright 1993, 1994 by AGE Logic, Inc." - - THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO - REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of - example, but not limitation, AGE LOGIC MAKE NO - REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT - INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC - SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO - EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT, - INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS - OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR - ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR - BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES - HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - - The name of AGE Logic, Inc. may not be used in - advertising or publicity pertaining to this software without - specific, written prior permission from AGE Logic. - - Title to this software shall at all times remain with AGE - Logic, Inc. - - -******************************************************************************/ - -#ifndef _XIEPROTOST_H_ -#define _XIEPROTOST_H_ - -#include /* defines things like CARD32 */ - -#define Drawable CARD32 -#define Colormap CARD32 -#define GContext CARD32 - -typedef CARD32 xieTypFloat; - -#ifndef WORD64 - -typedef xieTypFloat xieTypConstant[3]; - -typedef xieTypFloat xieTypMatrix[9]; - -#else /* WORD64 */ - -typedef CARD8 xieTypConstant[12]; - -typedef CARD8 xieTypMatrix[36]; - -#endif /* WORD64 */ - - -typedef CARD8 xieTypAlignment; - -typedef CARD8 xieTypArithmeticOp; - -typedef CARD16 xieTypColorAllocTechnique; - -typedef CARD32 xieTypColorList; - -typedef CARD8 xieTypCompareOp; - -typedef CARD16 xieTypConstrainTechnique; - -typedef CARD16 xieTypConvertFromRGBTechnique; - -typedef CARD16 xieTypConvertToRGBTechnique; - -typedef CARD16 xieTypConvolveTechnique; - -typedef CARD8 xieTypDataClass; - -typedef CARD8 xieTypDataType; - -typedef CARD16 xieTypDecodeTechnique; - -typedef CARD16 xieTypDitherTechnique; - -typedef CARD16 xieTypEncodeTechnique; - -typedef CARD32 xieTypPhotospace; - -typedef CARD32 xieTypPhotoflo; - -typedef struct { - union { - struct { - xieTypPhotospace nameSpace B32; - CARD32 floID B32; - } immed; - struct { - CARD32 nameSpace B32; - xieTypPhotoflo floID B32; - } stored; - } u; -} xieTypExecutable; - -typedef CARD8 xieTypExportNotify; - -typedef CARD8 xieTypExportState; - -typedef CARD16 xieTypGamutTechnique; - -typedef CARD16 xieTypGeometryTechnique; - -typedef struct { - CARD32 value B32; - CARD32 count B32; -} xieTypHistogramData; - -typedef CARD16 xieTypHistogramShape; - -typedef CARD8 xieTypInterleave; - -typedef CARD32 xieTypLevels[3]; - -typedef CARD32 xieTypLUT; - -typedef CARD8 xieTypMathOp; - -typedef CARD8 xieTypOrientation; - -typedef CARD8 xieTypPhotofloOutcome; - -typedef CARD8 xieTypPhotofloState; - -typedef CARD32 xieTypPhotomap; - -typedef CARD16 xieTypPhototag; - -typedef struct { - INT32 offsetX B32; - INT32 offsetY B32; - xieTypPhototag domain B16; -} xieTypProcessDomain; - -typedef struct { - INT32 x B32; - INT32 y B32; - CARD32 width B32; - CARD32 height B32; -} xieTypRectangle; - -typedef CARD32 xieTypROI; - -typedef CARD8 xieTypServiceClass; - -typedef CARD8 xieTypTechniqueGroup; - -typedef struct { - BOOL needsParam; - xieTypTechniqueGroup group; - CARD16 number B16; - CARD8 speed; - CARD8 nameLength; - CARD16 pad B16; - /* LISTofCARD8 (nameLength) */ - /* pad (nameLength) */ -} xieTypTechniqueRec; - -typedef struct { - xieTypPhototag src B16; - CARD16 pad B16; - INT32 dstX B32; - INT32 dstY B32; -} xieTypTile; - -typedef CARD8 xieTypTripleofCARD8[3]; - -typedef CARD16 xieTypTripleofCARD16[3]; - -typedef CARD32 xieTypTripleofCARD32[3]; - -typedef CARD16 xieTypWhiteAdjustTechnique; - - -/* - * Generic Element - */ - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; -} xieFlo; - -/* - * Import Elements - */ -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; -#if defined(__cplusplus) || defined(c_plusplus) - xieTypDataClass c_class; -#else - xieTypDataClass class; -#endif - xieTypOrientation bandOrder; - CARD16 pad B16; - CARD32 length0 B32; - CARD32 length1 B32; - CARD32 length2 B32; - CARD32 levels0 B32; - CARD32 levels1 B32; - CARD32 levels2 B32; -} xieFloImportClientLUT; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - BOOL notify; -#if defined(__cplusplus) || defined(c_plusplus) - xieTypDataClass c_class; -#else - xieTypDataClass class; -#endif - CARD16 pad B16; - CARD32 width0 B32; - CARD32 width1 B32; - CARD32 width2 B32; - CARD32 height0 B32; - CARD32 height1 B32; - CARD32 height2 B32; - CARD32 levels0 B32; - CARD32 levels1 B32; - CARD32 levels2 B32; - xieTypDecodeTechnique decodeTechnique B16; - CARD16 lenParams B16; - /* Technique dependent decode params */ -} xieFloImportClientPhoto; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - CARD32 rectangles B32; -} xieFloImportClientROI; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - Drawable drawable B32; - INT16 srcX B16; - INT16 srcY B16; - CARD16 width B16; - CARD16 height B16; - CARD32 fill B32; - BOOL notify; - CARD8 pad[3]; -} xieFloImportDrawable; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - Drawable drawable B32; - INT16 srcX B16; - INT16 srcY B16; - CARD16 width B16; - CARD16 height B16; - CARD32 fill B32; - CARD32 bitPlane B32; - BOOL notify; - CARD8 pad[3]; -} xieFloImportDrawablePlane; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypLUT lut B32; -} xieFloImportLUT; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhotomap photomap B32; - BOOL notify; - CARD8 pad[3]; -} xieFloImportPhotomap; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypROI roi B32; -} xieFloImportROI; - - -/* - * Process Elements - */ -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src1 B16; - xieTypPhototag src2 B16; - INT32 domainOffsetX B32; - INT32 domainOffsetY B32; - xieTypPhototag domainPhototag B16; -#if defined(__cplusplus) || defined(c_plusplus) - xieTypArithmeticOp c_operator; -#else - xieTypArithmeticOp operator; -#endif - CARD8 bandMask; - xieTypFloat constant0 B32; - xieTypFloat constant1 B32; - xieTypFloat constant2 B32; -} xieFloArithmetic; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src1 B16; - xieTypPhototag src2 B16; - xieTypPhototag src3 B16; - CARD16 pad B16; -} xieFloBandCombine; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad B16; - CARD32 levels B32; - xieTypFloat bias B32; - xieTypFloat constant0 B32; - xieTypFloat constant1 B32; - xieTypFloat constant2 B32; -} xieFloBandExtract; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD8 bandNumber; - CARD8 pad; -} xieFloBandSelect; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src1 B16; - xieTypPhototag src2 B16; - xieTypPhototag alpha B16; - CARD16 pad1 B16; - INT32 domainOffsetX B32; - INT32 domainOffsetY B32; - xieTypPhototag domainPhototag B16; - CARD8 bandMask; - CARD8 pad2; - xieTypFloat constant0 B32; - xieTypFloat constant1 B32; - xieTypFloat constant2 B32; - xieTypFloat alphaConst B32; -} xieFloBlend; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src1 B16; - xieTypPhototag src2 B16; - INT32 domainOffsetX B32; - INT32 domainOffsetY B32; - xieTypPhototag domainPhototag B16; -#if defined(__cplusplus) || defined(c_plusplus) - xieTypCompareOp c_operator; -#else - xieTypCompareOp operator; -#endif - BOOL combine; - xieTypFloat constant0 B32; - xieTypFloat constant1 B32; - xieTypFloat constant2 B32; - CARD8 bandMask; - CARD8 pad[3]; -} xieFloCompare; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad B16; - CARD32 levels0 B32; - CARD32 levels1 B32; - CARD32 levels2 B32; - xieTypConstrainTechnique constrain B16; - CARD16 lenParams B16; - /* Technique dependent constrain params */ -} xieFloConstrain; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; -#if defined(__cplusplus) || defined(c_plusplus) - xieTypDataClass c_class; -#else - xieTypDataClass class; -#endif - CARD8 precision; - Colormap colormap B32; -} xieFloConvertFromIndex; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad B16; - xieTypConvertFromRGBTechnique convert B16; - CARD16 lenParams B16; - /* Technique dependent conversion params */ -} xieFloConvertFromRGB; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - BOOL notify; - CARD8 pad; - Colormap colormap B32; - xieTypColorList colorList B32; - xieTypColorAllocTechnique colorAlloc B16; - CARD16 lenParams B16; - /* Technique dependent color alloc params */ -} xieFloConvertToIndex; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad B16; - xieTypConvertToRGBTechnique convert B16; - CARD16 lenParams B16; - /* Technique dependent conversion params */ -} xieFloConvertToRGB; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad B16; - INT32 domainOffsetX B32; - INT32 domainOffsetY B32; - xieTypPhototag domainPhototag B16; - CARD8 bandMask; - CARD8 kernelSize; - xieTypConvolveTechnique convolve B16; - CARD16 lenParams B16; - /* LISTofFloat (kernelSize^2) */ - /* Technique dependent convolve params */ -} xieFloConvolve; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD8 bandMask; - CARD8 pad; - CARD32 levels0 B32; - CARD32 levels1 B32; - CARD32 levels2 B32; - xieTypDitherTechnique dither B16; - CARD16 lenParams B16; - /* Technique dependent dither params */ -} xieFloDither; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD8 bandMask; - CARD8 pad; - CARD32 width B32; - CARD32 height B32; - xieTypFloat a B32; - xieTypFloat b B32; - xieTypFloat c B32; - xieTypFloat d B32; - xieTypFloat tx B32; - xieTypFloat ty B32; - xieTypFloat constant0 B32; - xieTypFloat constant1 B32; - xieTypFloat constant2 B32; - xieTypGeometryTechnique sample B16; - CARD16 lenParams B16; - /* Technique dependent sample params */ -} xieFloGeometry; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src1 B16; - xieTypPhototag src2 B16; - INT32 domainOffsetX B32; - INT32 domainOffsetY B32; - xieTypPhototag domainPhototag B16; -#if defined(__cplusplus) || defined(c_plusplus) - CARD8 c_operator; -#else - CARD8 operator; -#endif - CARD8 bandMask; - xieTypFloat constant0 B32; - xieTypFloat constant1 B32; - xieTypFloat constant2 B32; -} xieFloLogical; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad1 B16; - INT32 domainOffsetX B32; - INT32 domainOffsetY B32; - xieTypPhototag domainPhototag B16; - CARD16 pad2 B16; - xieTypHistogramShape shape B16; - CARD16 lenParams B16; - /* Technique dependent shape params */ -} xieFloMatchHistogram; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad B16; - INT32 domainOffsetX B32; - INT32 domainOffsetY B32; - xieTypPhototag domainPhototag B16; -#if defined(__cplusplus) || defined(c_plusplus) - xieTypMathOp c_operator; -#else - xieTypMathOp operator; -#endif - CARD8 bandMask; -} xieFloMath; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - CARD16 numTiles B16; - CARD16 pad B16; - CARD32 width B32; - CARD32 height B32; - xieTypFloat constant0 B32; - xieTypFloat constant1 B32; - xieTypFloat constant2 B32; - /* LISTofTile (numTiles) */ -} xieFloPasteUp; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - xieTypPhototag lut B16; - INT32 domainOffsetX B32; - INT32 domainOffsetY B32; - xieTypPhototag domainPhototag B16; - CARD8 bandMask; - CARD8 pad; -} xieFloPoint; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad B16; -} xieFloUnconstrain; - - -/* - * Export Elements - */ -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - xieTypExportNotify notify; - CARD8 pad1; - INT32 domainOffsetX B32; - INT32 domainOffsetY B32; - xieTypPhototag domainPhototag B16; - CARD16 pad2 B16; -} xieFloExportClientHistogram; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - xieTypExportNotify notify; - xieTypOrientation bandOrder; - CARD32 start0 B32; - CARD32 start1 B32; - CARD32 start2 B32; - CARD32 length0 B32; - CARD32 length1 B32; - CARD32 length2 B32; -} xieFloExportClientLUT; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - xieTypExportNotify notify; - CARD8 pad; - xieTypEncodeTechnique encodeTechnique B16; - CARD16 lenParams B16; - /* Technique dependent encode params */ -} xieFloExportClientPhoto; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - xieTypExportNotify notify; - CARD8 pad; -} xieFloExportClientROI; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - INT16 dstX B16; - INT16 dstY B16; - CARD16 pad B16; - Drawable drawable B32; - GContext gc B32; -} xieFloExportDrawable; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - INT16 dstX B16; - INT16 dstY B16; - CARD16 pad B16; - Drawable drawable B32; - GContext gc B32; -} xieFloExportDrawablePlane; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD8 merge; - CARD8 pad; - xieTypLUT lut B32; - CARD32 start0 B32; - CARD32 start1 B32; - CARD32 start2 B32; -} xieFloExportLUT; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad B16; - xieTypPhotomap photomap B32; - xieTypEncodeTechnique encodeTechnique B16; - CARD16 lenParams B16; - /* Technique dependent encode params */ -} xieFloExportPhotomap; - -typedef struct { - CARD16 elemType B16; - CARD16 elemLength B16; - xieTypPhototag src B16; - CARD16 pad B16; - xieTypROI roi B32; -} xieFloExportROI; - - -/* - * Technique Parameters - */ - -typedef struct { - xieTypFloat inputLow0 B32; - xieTypFloat inputLow1 B32; - xieTypFloat inputLow2 B32; - xieTypFloat inputHigh0 B32; - xieTypFloat inputHigh1 B32; - xieTypFloat inputHigh2 B32; - CARD32 outputLow0 B32; - CARD32 outputLow1 B32; - CARD32 outputLow2 B32; - CARD32 outputHigh0 B32; - CARD32 outputHigh1 B32; - CARD32 outputHigh2 B32; -} xieTecClipScale; - -typedef struct { - CARD32 fill B32; -} xieTecColorAllocAll; - -typedef struct { - xieTypFloat matchLimit B32; - xieTypFloat grayLimit B32; -} xieTecColorAllocMatch; - -typedef struct { - CARD32 maxCells B32; -} xieTecColorAllocRequantize; - -typedef struct { - xieTypFloat matrix00 B32; - xieTypFloat matrix01 B32; - xieTypFloat matrix02 B32; - xieTypFloat matrix10 B32; - xieTypFloat matrix11 B32; - xieTypFloat matrix12 B32; - xieTypFloat matrix20 B32; - xieTypFloat matrix21 B32; - xieTypFloat matrix22 B32; - xieTypWhiteAdjustTechnique whiteAdjusted B16; - CARD16 lenParams B16; - /* Technique dependent white params */ -} xieTecRGBToCIELab, xieTecRGBToCIEXYZ; - -typedef struct { - CARD32 levels0 B32; - CARD32 levels1 B32; - CARD32 levels2 B32; - xieTypFloat lumaRed B32; - xieTypFloat lumaGreen B32; - xieTypFloat lumaBlue B32; - xieTypFloat bias0 B32; - xieTypFloat bias1 B32; - xieTypFloat bias2 B32; -} xieTecRGBToYCbCr; - -typedef struct { - CARD32 levels0 B32; - CARD32 levels1 B32; - CARD32 levels2 B32; - xieTypFloat lumaRed B32; - xieTypFloat lumaGreen B32; - xieTypFloat lumaBlue B32; - xieTypFloat scale B32; -} xieTecRGBToYCC; - -typedef struct { - xieTypFloat matrix00 B32; - xieTypFloat matrix01 B32; - xieTypFloat matrix02 B32; - xieTypFloat matrix10 B32; - xieTypFloat matrix11 B32; - xieTypFloat matrix12 B32; - xieTypFloat matrix20 B32; - xieTypFloat matrix21 B32; - xieTypFloat matrix22 B32; - xieTypWhiteAdjustTechnique whiteAdjusted B16; - CARD16 lenWhiteParams B16; - xieTypGamutTechnique gamutCompress B16; - CARD16 lenGamutParams B16; - /* Technique dependent white params */ - /* Technique dependent gamut params */ -} xieTecCIELabToRGB, xieTecCIEXYZToRGB; - -typedef struct { - CARD32 levels0 B32; - CARD32 levels1 B32; - CARD32 levels2 B32; - xieTypFloat lumaRed B32; - xieTypFloat lumaGreen B32; - xieTypFloat lumaBlue B32; - xieTypFloat bias0 B32; - xieTypFloat bias1 B32; - xieTypFloat bias2 B32; - xieTypGamutTechnique gamutCompress B16; - CARD16 lenGamutParams B16; - /* Technique dependent gamut params */ -} xieTecYCbCrToRGB; - -typedef struct { - CARD32 levels0 B32; - CARD32 levels1 B32; - CARD32 levels2 B32; - xieTypFloat lumaRed B32; - xieTypFloat lumaGreen B32; - xieTypFloat lumaBlue B32; - xieTypFloat scale B32; - xieTypGamutTechnique gamutCompress B16; - CARD16 lenGamutParams B16; - /* Technique dependent gamut params */ -} xieTecYCCToRGB; - -typedef struct { - xieTypFloat constant0 B32; - xieTypFloat constant1 B32; - xieTypFloat constant2 B32; -} xieTecConvolveConstant; - -typedef struct { - xieTypOrientation fillOrder; - xieTypOrientation pixelOrder; - CARD8 pixelStride; - CARD8 leftPad; - CARD8 scanlinePad; - CARD8 pad[3]; -} xieTecDecodeUncompressedSingle; - -typedef struct { - CARD8 leftPad[3]; - xieTypOrientation fillOrder; - CARD8 pixelStride[3]; - xieTypOrientation pixelOrder; - CARD8 scanlinePad[3]; - xieTypOrientation bandOrder; - xieTypInterleave interleave; - CARD8 pad[3]; -} xieTecDecodeUncompressedTriple; - -typedef struct { - xieTypOrientation encodedOrder; - BOOL normal; - BOOL radiometric; - CARD8 pad; -} xieTecDecodeG31D, xieTecDecodeG32D, xieTecDecodeG42D, - xieTecDecodeTIFF2; - -typedef struct { - xieTypOrientation encodedOrder; - BOOL normal; - CARD16 pad B16; -} xieTecDecodeTIFFPackBits; - -typedef struct { - xieTypInterleave interleave; - xieTypOrientation bandOrder; - BOOL upSample; - CARD8 pad; -} xieTecDecodeJPEGBaseline; - -typedef struct { - xieTypInterleave interleave; - xieTypOrientation bandOrder; - CARD16 pad B16; -} xieTecDecodeJPEGLossless; - -typedef struct { - CARD8 thresholdOrder; - CARD8 pad[3]; -} xieTecDitherOrdered; - -typedef struct { - CARD8 preference; - CARD8 pad[3]; -} xieTecEncodeServerChoice; - -typedef struct { - xieTypOrientation fillOrder; - xieTypOrientation pixelOrder; - CARD8 pixelStride; - CARD8 scanlinePad; -} xieTecEncodeUncompressedSingle; - -typedef struct { - CARD8 pixelStride[3]; - xieTypOrientation pixelOrder; - CARD8 scanlinePad[3]; - xieTypOrientation fillOrder; - xieTypOrientation bandOrder; - xieTypInterleave interleave; - CARD16 pad B16; -} xieTecEncodeUncompressedTriple; - -typedef struct { - xieTypOrientation encodedOrder; - BOOL alignEol; - BOOL radiometric; - CARD8 pad; -} xieTecEncodeG31D; - -typedef struct { - xieTypOrientation encodedOrder; - BOOL alignEol; - BOOL radiometric; - BOOL uncompressed; - CARD32 kFactor B32; -} xieTecEncodeG32D; - -typedef struct { - xieTypOrientation encodedOrder; - BOOL radiometric; - BOOL uncompressed; - CARD8 pad; -} xieTecEncodeG42D; - -typedef struct { - xieTypInterleave interleave; - xieTypOrientation bandOrder; - CARD8 horizontalSamples[3]; - CARD8 verticalSamples[3]; - CARD16 lenQtable B16; /* multiple of 4 */ - CARD16 lenACtable B16; /* multiple of 4 */ - CARD16 lenDCtable B16; /* multiple of 4 */ - CARD16 pad B16; - /* LISTofCARD8 (Qtable) */ - /* LISTofCARD8 (ACtable) */ - /* LISTofCARD8 (DCtable) */ -} xieTecEncodeJPEGBaseline; - -typedef struct { - xieTypInterleave interleave; - xieTypOrientation bandOrder; - CARD16 lenTable B16; /* multiple of 4 */ - CARD8 predictor[3]; - CARD8 pad; - /* LISTofCARD8 (table) */ -} xieTecEncodeJPEGLossless; - -typedef struct { - xieTypOrientation encodedOrder; - BOOL radiometric; - CARD16 pad B16; -} xieTecEncodeTIFF2; - -typedef struct { - xieTypOrientation encodedOrder; - CARD8 pad[3]; -} xieTecEncodeTIFFPackBits; - -typedef struct { - INT16 simple B16; - CARD16 pad B16; -} xieTecGeomAntialiasByArea; - -typedef struct { - INT16 kernelSize B16; - CARD16 pad B16; -} xieTecGeomAntialiasByLowpass; - -typedef struct { - CARD8 radius; - BOOL simple; - CARD16 pad B16; - xieTypFloat sigma B32; - xieTypFloat normalize B32; -} xieTecGeomGaussian; - -typedef struct { - CARD8 modify; - CARD8 pad[3]; -} xieTecGeomNearestNeighbor; - -typedef struct { - xieTypFloat mean B32; - xieTypFloat sigma B32; -} xieTecHistogramGaussian; - -typedef struct { - BOOL shapeFactor; - CARD8 pad[3]; - xieTypFloat constant B32; -} xieTecHistogramHyperbolic; - -typedef struct { - xieTypFloat whitePoint0 B32; - xieTypFloat whitePoint1 B32; - xieTypFloat whitePoint2 B32; -} xieTecWhiteAdjustCIELabShift; - - -/* - * SIZEOF values - */ -#define sz_xieTypAlignment 1 -#define sz_xieTypArithmeticOp 1 -#define sz_xieTypColorAllocTechnique 2 -#define sz_xieTypColorList 4 -#define sz_xieTypCompareOp 1 -#define sz_xieTypConstant 12 -#define sz_xieTypConstrainTechnique 2 -#define sz_xieTypConvertFromRGBTechnique 2 -#define sz_xieTypConvertToRGBTechnique 2 -#define sz_xieTypConvolveTechnique 2 -#define sz_xieTypDataClass 1 -#define sz_xieTypDataType 1 -#define sz_xieTypDecodeTechnique 2 -#define sz_xieTypDitherTechnique 2 -#define sz_xieTypEncodeTechnique 2 -#define sz_xieTypPhotospace 4 -#define sz_xieTypPhotoflo 4 -#define sz_xieTypExecutable 8 -#define sz_xieTypExportNotify 1 -#define sz_xieTypExportState 1 -#define sz_xieTypFloat 4 -#define sz_xieTypGamutTechnique 2 -#define sz_xieTypGeometryTechnique 2 -#define sz_xieTypHistogramData 8 -#define sz_xieTypHistogramShape 2 -#define sz_xieTypInterleave 1 -#define sz_xieTypLevels 12 -#define sz_xieTypLUT 4 -#define sz_xieTypMathOp 1 -#define sz_xieTypMatrix 36 -#define sz_xieTypOrientation 1 -#define sz_xieTypPhotofloOutcome 1 -#define sz_xieTypPhotofloState 1 -#define sz_xieTypPhotomap 4 -#define sz_xieTypPhototag 2 -#define sz_xieTypProcessDomain 12 -#define sz_xieTypRectangle 16 -#define sz_xieTypROI 4 -#define sz_xieTypServiceClass 1 -#define sz_xieTypTechniqueGroup 1 -#define sz_xieTypTechniqueRec 8 -#define sz_xieTypTile 12 -#define sz_xieTypTripleofCARD8 3 -#define sz_xieTypTripleofCARD16 6 -#define sz_xieTypTripleofCARD32 12 -#define sz_xieTypWhiteAdjustTechnique 2 -#define sz_xieFloImportClientLUT 32 -#define sz_xieFloImportClientPhoto 48 -#define sz_xieFloImportClientROI 8 -#define sz_xieFloImportDrawable 24 -#define sz_xieFloImportDrawablePlane 28 -#define sz_xieFloImportLUT 8 -#define sz_xieFloImportPhotomap 12 -#define sz_xieFloImportROI 8 -#define sz_xieFloArithmetic 32 -#define sz_xieFloBandCombine 12 -#define sz_xieFloBandExtract 28 -#define sz_xieFloBandSelect 8 -#define sz_xieFloBlend 40 -#define sz_xieFloCompare 36 -#define sz_xieFloConstrain 24 -#define sz_xieFloConvertFromIndex 12 -#define sz_xieFloConvertFromRGB 12 -#define sz_xieFloConvertToIndex 20 -#define sz_xieFloConvertToRGB 12 -#define sz_xieFloConvolve 24 -#define sz_xieFloDither 24 -#define sz_xieFloGeometry 56 -#define sz_xieFloLogical 32 -#define sz_xieFloMatchHistogram 24 -#define sz_xieFloMath 20 -#define sz_xieFloPasteUp 28 -#define sz_xieFloPoint 20 -#define sz_xieFloUnconstrain 8 -#define sz_xieFloExportClientHistogram 20 -#define sz_xieFloExportClientLUT 32 -#define sz_xieFloExportClientPhoto 12 -#define sz_xieFloExportClientROI 8 -#define sz_xieFloExportDrawable 20 -#define sz_xieFloExportDrawablePlane 20 -#define sz_xieFloExportLUT 24 -#define sz_xieFloExportPhotomap 16 -#define sz_xieFloExportROI 12 -#define sz_xieTecColorAllocAll 4 -#define sz_xieTecColorAllocMatch 8 -#define sz_xieTecColorAllocRequantize 4 -#define sz_xieTecClipScale 48 -#define sz_xieTecHardClip 0 -#define sz_xieTecRGBToCIELab 40 -#define sz_xieTecRGBToCIEXYZ 40 -#define sz_xieTecRGBToYCbCr 36 -#define sz_xieTecRGBToYCC 28 -#define sz_xieTecYCbCrToRGB 40 -#define sz_xieTecYCCToRGB 32 -#define sz_xieTecCIELabToRGB 44 -#define sz_xieTecCIEXYZToRGB 44 -#define sz_xieTecConvolveConstant 12 -#define sz_xieTecConvolveReplicate 0 -#define sz_xieTecDecodeUncompressedSingle 8 -#define sz_xieTecDecodeUncompressedTriple 16 -#define sz_xieTecDecodeG31D 4 -#define sz_xieTecDecodeG32D 4 -#define sz_xieTecDecodeG42D 4 -#define sz_xieTecDecodeTIFF2 4 -#define sz_xieTecDecodeTIFFPackBits 4 -#define sz_xieTecDecodeJPEGBaseline 4 -#define sz_xieTecDecodeJPEGLossless 4 -#define sz_xieTecDitherOrdered 4 -#define sz_xieTecDitherErrorDiffusion 4 -#define sz_xieTecEncodeServerChoice 4 -#define sz_xieTecEncodeUncompressedSingle 4 -#define sz_xieTecEncodeUncompressedTriple 12 -#define sz_xieTecEncodeG31D 4 -#define sz_xieTecEncodeG32D 8 -#define sz_xieTecEncodeG42D 4 -#define sz_xieTecEncodeJPEGBaseline 16 -#define sz_xieTecEncodeJPEGLossless 8 -#define sz_xieTecEncodeTIFF2 4 -#define sz_xieTecEncodeTIFFPackBits 4 -#define sz_xieTecGamutNone 0 -#define sz_xieTecGamutClipRGB 0 -#define sz_xieTecGeomAntialias 0 -#define sz_xieTecGeomAntialiasByArea 4 -#define sz_xieTecGeomAntialiasByLowpass 4 -#define sz_xieTecGeomBilinearInterpolation 0 -#define sz_xieTecGeomGaussian 12 -#define sz_xieTecGeomNearestNeighbor 4 -#define sz_xieTecHistogramFlat 0 -#define sz_xieTecHistogramGaussian 8 -#define sz_xieTecHistogramHyperbolic 8 -#define sz_xieTecWhiteAdjustNone 0 -#define sz_xieTecWhiteAdjustCIELabShift 12 - -#undef Drawable -#undef Colormap -#undef GContext - -#endif /* _XIEPROTOST_H_ */ Index: xc/include/extensions/XInput.h diff -u xc/include/extensions/XInput.h:1.3 xc/include/extensions/XInput.h:1.4 --- xc/include/extensions/XInput.h:1.3 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/XInput.h Mon Nov 17 17:20:02 2003 @@ -45,7 +45,7 @@ SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XInput.h,v 1.3 2001/12/14 19:53:28 dawes Exp $ */ +/* $XFree86: xc/include/extensions/XInput.h,v 1.4 2003/11/17 22:20:02 dawes Exp $ */ /* Definitions used by the library and client */ @@ -833,23 +833,18 @@ _XFUNCPROTOBEGIN extern int XChangeKeyboardDevice( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */ -#endif ); extern int XChangePointerDevice( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, int /* xaxis */, int /* yaxis */ -#endif ); extern int XGrabDevice( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, Window /* grab_window */, @@ -859,19 +854,15 @@ int /* this_device_mode */, int /* other_devices_mode */, Time /* time */ -#endif ); extern int XUngrabDevice( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, Time /* time */ -#endif ); extern int XGrabDeviceKey( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, unsigned int /* key */, @@ -883,22 +874,18 @@ XEventClass* /* event_list */, int /* this_device_mode */, int /* other_devices_mode */ -#endif ); extern int XUngrabDeviceKey( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, unsigned int /* key */, unsigned int /* modifiers */, XDevice* /* modifier_dev */, Window /* grab_window */ -#endif ); extern int XGrabDeviceButton( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, unsigned int /* button */, @@ -910,84 +897,66 @@ XEventClass* /* event_list */, int /* this_device_mode */, int /* other_devices_mode */ -#endif ); extern int XUngrabDeviceButton( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, unsigned int /* button */, unsigned int /* modifiers */, XDevice* /* modifier_dev */, Window /* grab_window */ -#endif ); extern int XAllowDeviceEvents( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, int /* event_mode */, Time /* time */ -#endif ); extern int XGetDeviceFocus( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, Window* /* focus */, int* /* revert_to */, Time* /* time */ -#endif ); extern int XSetDeviceFocus( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, Window /* focus */, int /* revert_to */, Time /* time */ -#endif ); extern XFeedbackState *XGetFeedbackControl( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, int* /* num_feedbacks */ -#endif ); extern void XFreeFeedbackList( -#if NeedFunctionPrototypes XFeedbackState* /* list */ -#endif ); extern int XChangeFeedbackControl( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, unsigned long /* mask */, XFeedbackControl* /* f */ -#endif ); extern int XDeviceBell( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, XID /* feedbackclass */, XID /* feedbackid */, int /* percent */ -#endif ); extern KeySym *XGetDeviceKeyMapping( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, #if NeedWidePrototypes @@ -997,175 +966,133 @@ #endif int /* keycount */, int* /* syms_per_code */ -#endif ); extern int XChangeDeviceKeyMapping( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, int /* first */, int /* syms_per_code */, KeySym* /* keysyms */, int /* count */ -#endif ); extern XModifierKeymap *XGetDeviceModifierMapping( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */ -#endif ); extern int XSetDeviceModifierMapping( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, XModifierKeymap* /* modmap */ -#endif ); extern int XSetDeviceButtonMapping( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, unsigned char* /* map[] */, int /* nmap */ -#endif ); extern int XGetDeviceButtonMapping( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, unsigned char* /* map[] */, unsigned int /* nmap */ -#endif ); extern XDeviceState *XQueryDeviceState( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */ -#endif ); extern void XFreeDeviceState( -#if NeedFunctionPrototypes XDeviceState* /* list */ -#endif ); extern XExtensionVersion *XGetExtensionVersion( -#if NeedFunctionPrototypes Display* /* display */, _Xconst char* /* name */ -#endif ); extern XDeviceInfo *XListInputDevices( -#if NeedFunctionPrototypes Display* /* display */, int* /* ndevices */ -#endif ); extern void XFreeDeviceList( -#if NeedFunctionPrototypes XDeviceInfo* /* list */ -#endif ); extern XDevice *XOpenDevice( -#if NeedFunctionPrototypes Display* /* display */, XID /* id */ -#endif ); extern int XCloseDevice( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */ -#endif ); extern int XSetDeviceMode( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, int /* mode */ -#endif ); extern int XSetDeviceValuators( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, int* /* valuators */, int /* first_valuator */, int /* num_valuators */ -#endif ); extern XDeviceControl *XGetDeviceControl( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, int /* control */ -#endif ); extern int XChangeDeviceControl( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, int /* control */, XDeviceControl* /* d */ -#endif ); extern int XSelectExtensionEvent( -#if NeedFunctionPrototypes Display* /* display */, Window /* w */, XEventClass* /* event_list */, int /* count */ -#endif ); extern int XGetSelectedExtensionEvents( -#if NeedFunctionPrototypes Display* /* display */, Window /* w */, int* /* this_client_count */, XEventClass** /* this_client_list */, int* /* all_clients_count */, XEventClass** /* all_clients_list */ -#endif ); extern int XChangeDeviceDontPropagateList( -#if NeedFunctionPrototypes Display* /* display */, Window /* window */, int /* count */, XEventClass* /* events */, int /* mode */ -#endif ); extern XEventClass *XGetDeviceDontPropagateList( -#if NeedFunctionPrototypes Display* /* display */, Window /* window */, int* /* count */ -#endif ); extern Status XSendExtensionEvent( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, Window /* dest */, @@ -1173,11 +1100,9 @@ int /* count */, XEventClass* /* list */, XEvent* /* event */ -#endif ); extern XDeviceTimeCoord *XGetDeviceMotionEvents( -#if NeedFunctionPrototypes Display* /* display */, XDevice* /* device */, Time /* start */, @@ -1185,19 +1110,14 @@ int* /* nEvents */, int* /* mode */, int* /* axis_count */ -#endif ); extern void XFreeDeviceMotionEvents( -#if NeedFunctionPrototypes XDeviceTimeCoord* /* events */ -#endif ); extern void XFreeDeviceControl( -#if NeedFunctionPrototypes XDeviceControl* /* control */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/XKB.h diff -u xc/include/extensions/XKB.h:1.5 xc/include/extensions/XKB.h:1.6 --- xc/include/extensions/XKB.h:1.5 Tue Nov 19 23:49:01 2002 +++ xc/include/extensions/XKB.h Mon Dec 22 12:48:02 2003 @@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XKB.h,v 1.5 2002/11/20 04:49:01 dawes Exp $ */ +/* $XFree86: xc/include/extensions/XKB.h,v 1.6 2003/12/22 17:48:02 tsi Exp $ */ #ifndef _XKB_H_ #define _XKB_H_ @@ -549,7 +549,8 @@ #define XkbMaxLegalKeyCode 255 #define XkbMaxKeyCount (XkbMaxLegalKeyCode-XkbMinLegalKeyCode+1) #define XkbPerKeyBitArraySize ((XkbMaxLegalKeyCode+1)/8) -#define XkbIsLegalKeycode(k) (((k)>=XkbMinLegalKeyCode)&&((k)<=XkbMaxLegalKeyCode)) +/* Seems kinda silly to check that an unsigned char is <= 255... */ +#define XkbIsLegalKeycode(k) ((k)>=XkbMinLegalKeyCode) /* * Assorted constants and limits. Index: xc/include/extensions/XKBgeom.h diff -u xc/include/extensions/XKBgeom.h:3.9 xc/include/extensions/XKBgeom.h:3.10 --- xc/include/extensions/XKBgeom.h:3.9 Wed Sep 18 13:11:40 2002 +++ xc/include/extensions/XKBgeom.h Mon Nov 17 17:20:02 2003 @@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XKBgeom.h,v 3.9 2002/09/18 17:11:40 tsi Exp $ */ +/* $XFree86: xc/include/extensions/XKBgeom.h,v 3.10 2003/11/17 22:20:02 dawes Exp $ */ #ifndef _XKBGEOM_H_ #define _XKBGEOM_H_ @@ -319,437 +319,339 @@ extern XkbPropertyPtr XkbAddGeomProperty( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, char * /* name */, char * /* value */ -#endif ); extern XkbKeyAliasPtr XkbAddGeomKeyAlias( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, char * /* alias */, char * /* real */ -#endif ); extern XkbColorPtr XkbAddGeomColor( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, char * /* spec */, unsigned int /* pixel */ -#endif ); extern XkbOutlinePtr XkbAddGeomOutline( -#if NeedFunctionPrototypes XkbShapePtr /* shape */, int /* sz_points */ -#endif ); extern XkbShapePtr XkbAddGeomShape( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, Atom /* name */, int /* sz_outlines */ -#endif ); extern XkbKeyPtr XkbAddGeomKey( -#if NeedFunctionPrototypes XkbRowPtr /* row */ -#endif ); extern XkbRowPtr XkbAddGeomRow( -#if NeedFunctionPrototypes XkbSectionPtr /* section */, int /* sz_keys */ -#endif ); extern XkbSectionPtr XkbAddGeomSection( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, Atom /* name */, int /* sz_rows */, int /* sz_doodads */, int /* sz_overlays */ -#endif ); extern XkbOverlayPtr XkbAddGeomOverlay( -#if NeedFunctionPrototypes XkbSectionPtr /* section */, Atom /* name */, int /* sz_rows */ -#endif ); extern XkbOverlayRowPtr XkbAddGeomOverlayRow( -#if NeedFunctionPrototypes XkbOverlayPtr /* overlay */, int /* row_under */, int /* sz_keys */ -#endif ); extern XkbOverlayKeyPtr XkbAddGeomOverlayKey( -#if NeedFunctionPrototypes XkbOverlayPtr /* overlay */, XkbOverlayRowPtr /* row */, char * /* over */, char * /* under */ -#endif ); extern XkbDoodadPtr XkbAddGeomDoodad( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, XkbSectionPtr /* section */, Atom /* name */ -#endif ); extern void XkbFreeGeomKeyAliases( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomColors( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomDoodads( -#if NeedFunctionPrototypes XkbDoodadPtr /* doodads */, int /* nDoodads */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomProperties( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomOverlayKeys( -#if NeedFunctionPrototypes XkbOverlayRowPtr /* row */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomOverlayRows( -#if NeedFunctionPrototypes XkbOverlayPtr /* overlay */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomOverlays( -#if NeedFunctionPrototypes XkbSectionPtr /* section */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomKeys( -#if NeedFunctionPrototypes XkbRowPtr /* row */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomRows( -#if NeedFunctionPrototypes XkbSectionPtr /* section */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomSections( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomPoints( -#if NeedFunctionPrototypes XkbOutlinePtr /* outline */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomOutlines( -#if NeedFunctionPrototypes XkbShapePtr /* shape */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeomShapes( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ -#endif ); extern void XkbFreeGeometry( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, unsigned int /* which */, Bool /* freeMap */ -#endif ); extern Status XkbAllocGeomProps( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* nProps */ -#endif ); extern Status XkbAllocGeomKeyAliases( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* nAliases */ -#endif ); extern Status XkbAllocGeomColors( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* nColors */ -#endif ); extern Status XkbAllocGeomShapes( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* nShapes */ -#endif ); extern Status XkbAllocGeomSections( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* nSections */ -#endif ); extern Status XkbAllocGeomOverlays( -#if NeedFunctionPrototypes XkbSectionPtr /* section */, int /* num_needed */ -#endif ); extern Status XkbAllocGeomOverlayRows( -#if NeedFunctionPrototypes XkbOverlayPtr /* overlay */, int /* num_needed */ -#endif ); extern Status XkbAllocGeomOverlayKeys( -#if NeedFunctionPrototypes XkbOverlayRowPtr /* row */, int /* num_needed */ -#endif ); extern Status XkbAllocGeomDoodads( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, int /* nDoodads */ -#endif ); extern Status XkbAllocGeomSectionDoodads( -#if NeedFunctionPrototypes XkbSectionPtr /* section */, int /* nDoodads */ -#endif ); extern Status XkbAllocGeomOutlines( -#if NeedFunctionPrototypes XkbShapePtr /* shape */, int /* nOL */ -#endif ); extern Status XkbAllocGeomRows( -#if NeedFunctionPrototypes XkbSectionPtr /* section */, int /* nRows */ -#endif ); extern Status XkbAllocGeomPoints( -#if NeedFunctionPrototypes XkbOutlinePtr /* ol */, int /* nPts */ -#endif ); extern Status XkbAllocGeomKeys( -#if NeedFunctionPrototypes XkbRowPtr /* row */, int /* nKeys */ -#endif ); extern Status XkbAllocGeometry( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, XkbGeometrySizesPtr /* sizes */ -#endif ); extern Status XkbSetGeometry( -#if NeedFunctionPrototypes Display * /* dpy */, unsigned /* deviceSpec */, XkbGeometryPtr /* geom */ -#endif ); extern Bool XkbComputeShapeTop( -#if NeedFunctionPrototypes XkbShapePtr /* shape */, XkbBoundsPtr /* bounds */ -#endif ); extern Bool XkbComputeShapeBounds( -#if NeedFunctionPrototypes XkbShapePtr /* shape */ -#endif ); extern Bool XkbComputeRowBounds( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, XkbSectionPtr /* section */, XkbRowPtr /* row */ -#endif ); extern Bool XkbComputeSectionBounds( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, XkbSectionPtr /* section */ -#endif ); extern char * XkbFindOverlayForKey( -#if NeedFunctionPrototypes XkbGeometryPtr /* geom */, XkbSectionPtr /* wanted */, char * /* under */ -#endif ); extern Status XkbGetGeometry( -#if NeedFunctionPrototypes Display * /* dpy */, XkbDescPtr /* xkb */ -#endif ); extern Status XkbGetNamedGeometry( -#if NeedFunctionPrototypes Display * /* dpy */, XkbDescPtr /* xkb */, Atom /* name */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/XKBsrv.h diff -u xc/include/extensions/XKBsrv.h:3.22 xc/include/extensions/XKBsrv.h:3.23 --- xc/include/extensions/XKBsrv.h:3.22 Tue Nov 19 23:49:01 2002 +++ xc/include/extensions/XKBsrv.h Mon Nov 17 17:20:02 2003 @@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XKBsrv.h,v 3.22 2002/11/20 04:49:01 dawes Exp $ */ +/* $XFree86: xc/include/extensions/XKBsrv.h,v 3.23 2003/11/17 22:20:02 dawes Exp $ */ #ifndef _XKBSRV_H_ #define _XKBSRV_H_ @@ -314,475 +314,360 @@ _XFUNCPROTOBEGIN extern void XkbUseMsg( -#if NeedFunctionPrototypes void -#endif ); extern int XkbProcessArguments( -#if NeedFunctionPrototypes int /* argc */, char ** /* argv */, int /* i */ -#endif ); extern void XkbFreeCompatMap( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeMap */ -#endif ); extern void XkbFreeNames( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeMap */ -#endif ); extern DeviceIntPtr _XkbLookupAnyDevice( -#if NeedFunctionPrototypes int /* id */, int * /* why_rtrn */ -#endif ); extern DeviceIntPtr _XkbLookupKeyboard( -#if NeedFunctionPrototypes int /* id */, int * /* why_rtrn */ -#endif ); extern DeviceIntPtr _XkbLookupBellDevice( -#if NeedFunctionPrototypes int /* id */, int * /* why_rtrn */ -#endif ); extern DeviceIntPtr _XkbLookupLedDevice( -#if NeedFunctionPrototypes int /* id */, int * /* why_rtrn */ -#endif ); extern DeviceIntPtr _XkbLookupButtonDevice( -#if NeedFunctionPrototypes int /* id */, int * /* why_rtrn */ -#endif ); extern XkbDescPtr XkbAllocKeyboard( -#if NeedFunctionPrototypes void -#endif ); extern Status XkbAllocClientMap( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which */, unsigned int /* nTypes */ -#endif ); extern Status XkbAllocServerMap( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which */, unsigned int /* nNewActions */ -#endif ); extern void XkbFreeClientMap( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* what */, Bool /* freeMap */ -#endif ); extern void XkbFreeServerMap( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* what */, Bool /* freeMap */ -#endif ); extern Status XkbAllocIndicatorMaps( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */ -#endif ); extern Status XkbAllocCompatMap( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which */, unsigned int /* nInterpret */ -#endif ); extern Status XkbAllocNames( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which */, int /* nTotalRG */, int /* nTotalAliases */ -#endif ); extern Status XkbAllocControls( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which*/ -#endif ); extern Status XkbCopyKeyType( -#if NeedFunctionPrototypes XkbKeyTypePtr /* from */, XkbKeyTypePtr /* into */ -#endif ); extern Status XkbCopyKeyTypes( -#if NeedFunctionPrototypes XkbKeyTypePtr /* from */, XkbKeyTypePtr /* into */, int /* num_types */ -#endif ); extern Status XkbResizeKeyType( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, int /* type_ndx */, int /* map_count */, Bool /* want_preserve */, int /* new_num_lvls */ -#endif ); extern void XkbFreeKeyboard( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeDesc */ -#endif ); extern void XkbSetActionKeyMods( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, XkbAction * /* act */, unsigned int /* mods */ -#endif ); extern Bool XkbCheckActionVMods( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, XkbAction * /* act */, unsigned int /* changed */ -#endif ); extern Bool XkbApplyVModChanges( -#if NeedFunctionPrototypes XkbSrvInfoPtr /* xkbi */, unsigned int /* changed */, XkbChangesPtr /* pChanges */, unsigned int * /* needChecksRtrn */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbApplyVModChangesToAllDevices( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbDescPtr /* xkb */, unsigned int /* changed */, XkbEventCausePtr /* cause */ -#endif ); extern unsigned int XkbMaskForVMask( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* vmask */ -#endif ); extern Bool XkbVirtualModsToReal( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* virtua_mask */, unsigned int * /* mask_rtrn */ -#endif ); extern unsigned int XkbAdjustGroup( -#if NeedFunctionPrototypes int /* group */, XkbControlsPtr /* ctrls */ -#endif ); extern KeySym *XkbResizeKeySyms( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, int /* key */, int /* needed */ -#endif ); extern XkbAction *XkbResizeKeyActions( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, int /* key */, int /* needed */ -#endif ); extern void XkbUpdateKeyTypesFromCore( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */, KeyCode /* first */, CARD8 /* num */, XkbChangesPtr /* pChanges */ -#endif ); extern void XkbUpdateDescActions( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, KeyCode /* first */, CARD8 /* num */, XkbChangesPtr /* changes */ -#endif ); extern void XkbUpdateActions( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */, KeyCode /* first */, CARD8 /* num */, XkbChangesPtr /* pChanges */, unsigned int * /* needChecksRtrn */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbUpdateCoreDescription( -#if NeedFunctionPrototypes DeviceIntPtr /* keybd */, Bool /* resize */ -#endif ); extern void XkbApplyMappingChange( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */, CARD8 /* request */, KeyCode /* firstKey */, CARD8 /* num */, ClientPtr /* client */ -#endif ); extern void XkbSetIndicators( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */, CARD32 /* affect */, CARD32 /* values */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbUpdateIndicators( -#if NeedFunctionPrototypes DeviceIntPtr /* keybd */, CARD32 /* changed */, Bool /* check_edevs */, XkbChangesPtr /* pChanges */, XkbEventCausePtr /* cause */ -#endif ); extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, KbdFeedbackPtr /* kf */, LedFeedbackPtr /* lf */, unsigned int /* needed_parts */ -#endif ); extern XkbSrvLedInfoPtr XkbFindSrvLedInfo( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, unsigned int /* class */, unsigned int /* id */, unsigned int /* needed_parts */ -#endif ); extern void XkbApplyLedNameChanges( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* changed_names */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbApplyLedMapChanges( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* changed_maps */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbApplyLedStateChanges( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* changed_leds */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbUpdateLedAutoState( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* maps_to_check */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbFlushLedEvents( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, DeviceIntPtr /* kbd */, XkbSrvLedInfoPtr /* sli */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbUpdateAllDeviceIndicators( -#if NeedFunctionPrototypes XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ -#endif ); extern unsigned int XkbIndicatorsToUpdate( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, unsigned long /* state_changes */, Bool /* enabled_ctrl_changes */ -#endif ); extern void XkbComputeDerivedState( -#if NeedFunctionPrototypes XkbSrvInfoPtr /* xkbi */ -#endif ); extern void XkbCheckSecondaryEffects( -#if NeedFunctionPrototypes XkbSrvInfoPtr /* xkbi */, unsigned int /* which */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbCheckIndicatorMaps( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* which */ -#endif ); extern unsigned int XkbStateChangedFlags( -#if NeedFunctionPrototypes XkbStatePtr /* old */, XkbStatePtr /* new */ -#endif ); extern void XkbSendStateNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, xkbStateNotify * /* pSN */ -#endif ); extern void XkbSendMapNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, xkbMapNotify * /* ev */ -#endif ); extern int XkbComputeControlsNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, XkbControlsPtr /* old */, XkbControlsPtr /* new */, xkbControlsNotify * /* pCN */, Bool /* forceCtrlProc */ -#endif ); extern void XkbSendControlsNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, xkbControlsNotify * /* ev */ -#endif ); extern void XkbSendCompatMapNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, xkbCompatMapNotify * /* ev */ -#endif ); extern void XkbSendIndicatorNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, int /* xkbType */, xkbIndicatorNotify * /* ev */ -#endif ); extern void XkbHandleBell( -#if NeedFunctionPrototypes BOOL /* force */, BOOL /* eventOnly */, DeviceIntPtr /* kbd */, @@ -792,513 +677,382 @@ Atom /* name */, WindowPtr /* pWin */, ClientPtr /* pClient */ -#endif ); extern void XkbSendAccessXNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, xkbAccessXNotify * /* pEv */ -#endif ); extern void XkbSendNamesNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, xkbNamesNotify * /* ev */ -#endif ); extern void XkbSendCompatNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, xkbCompatMapNotify * /* ev */ -#endif ); extern void XkbSendActionMessage( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, xkbActionMessage * /* ev */ -#endif ); extern void XkbSendExtensionDeviceNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, ClientPtr /* client */, xkbExtensionDeviceNotify * /* ev */ -#endif ); extern void XkbSendNotification( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, XkbChangesPtr /* pChanges */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbProcessKeyboardEvent( -#if NeedFunctionPrototypes struct _xEvent * /* xE */, DeviceIntPtr /* keybd */, int /* count */ -#endif ); extern void XkbProcessOtherEvent( -#if NeedFunctionPrototypes struct _xEvent * /* xE */, DeviceIntPtr /* keybd */, int /* count */ -#endif ); extern void XkbHandleActions( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, DeviceIntPtr /* kbd */, struct _xEvent * /* xE */, int /* count */ -#endif ); extern Bool XkbEnableDisableControls( -#if NeedFunctionPrototypes XkbSrvInfoPtr /* xkbi */, unsigned long /* change */, unsigned long /* newValues */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ -#endif ); extern void AccessXInit( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */ -#endif ); extern Bool AccessXFilterPressEvent( -#if NeedFunctionPrototypes register struct _xEvent * /* xE */, register DeviceIntPtr /* keybd */, int /* count */ -#endif ); extern Bool AccessXFilterReleaseEvent( -#if NeedFunctionPrototypes register struct _xEvent * /* xE */, register DeviceIntPtr /* keybd */, int /* count */ -#endif ); extern void AccessXCancelRepeatKey( -#if NeedFunctionPrototypes XkbSrvInfoPtr /* xkbi */, KeyCode /* key */ -#endif ); extern void AccessXComputeCurveFactor( -#if NeedFunctionPrototypes XkbSrvInfoPtr /* xkbi */, XkbControlsPtr /* ctrls */ -#endif ); extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo( -#if NeedFunctionPrototypes XkbDeviceInfoPtr /* devi */, unsigned int /* ledClass */, unsigned int /* ledId */ -#endif ); extern XkbDeviceInfoPtr XkbAllocDeviceInfo( -#if NeedFunctionPrototypes unsigned int /* deviceSpec */, unsigned int /* nButtons */, unsigned int /* szLeds */ -#endif ); extern void XkbFreeDeviceInfo( -#if NeedFunctionPrototypes XkbDeviceInfoPtr /* devi */, unsigned int /* which */, Bool /* freeDevI */ -#endif ); extern Status XkbResizeDeviceButtonActions( -#if NeedFunctionPrototypes XkbDeviceInfoPtr /* devi */, unsigned int /* newTotal */ -#endif ); extern XkbInterestPtr XkbFindClientResource( -#if NeedFunctionPrototypes DevicePtr /* inDev */, ClientPtr /* client */ -#endif ); extern XkbInterestPtr XkbAddClientResource( -#if NeedFunctionPrototypes DevicePtr /* inDev */, ClientPtr /* client */, XID /* id */ -#endif ); extern int XkbRemoveClient( -#if NeedFunctionPrototypes DevicePtr /* inDev */, ClientPtr /* client */ -#endif ); extern int XkbRemoveResourceClient( -#if NeedFunctionPrototypes DevicePtr /* inDev */, XID /* id */ -#endif ); extern int XkbDDXInitDevice( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */ -#endif ); extern int XkbDDXAccessXBeep( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, unsigned int /* what */, unsigned int /* which */ -#endif ); extern void XkbDDXKeyClick( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, int /* keycode */, int /* synthetic */ -#endif ); extern int XkbDDXUsesSoftRepeat( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */ -#endif ); extern void XkbDDXKeybdCtrlProc( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, KeybdCtrl * /* ctrl */ -#endif ); extern void XkbDDXChangeControls( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbControlsPtr /* old */, XkbControlsPtr /* new */ -#endif ); extern void XkbDDXUpdateIndicators( -#if NeedFunctionPrototypes DeviceIntPtr /* keybd */, CARD32 /* newState */ -#endif ); extern void XkbDDXUpdateDeviceIndicators( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, CARD32 /* newState */ -#endif ); extern void XkbDDXFakePointerButton( -#if NeedFunctionPrototypes int /* event */, int /* button */ -#endif ); extern void XkbDDXFakePointerMotion( -#if NeedFunctionPrototypes unsigned int /* flags */, int /* x */, int /* y */ -#endif ); extern void XkbDDXFakeDeviceButton( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, Bool /* press */, int /* button */ -#endif ); extern int XkbDDXTerminateServer( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, KeyCode /* key */, XkbAction * /* act */ -#endif ); extern int XkbDDXSwitchScreen( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, KeyCode /* key */, XkbAction * /* act */ -#endif ); extern int XkbDDXPrivate( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, KeyCode /* key */, XkbAction * /* act */ -#endif ); extern void XkbDisableComputedAutoRepeats( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */, unsigned int /* key */ -#endif ); extern void XkbSetRepeatKeys( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */, int /* key */, int /* onoff */ -#endif ); extern int XkbLatchModifiers( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */, CARD8 /* mask */, CARD8 /* latches */ -#endif ); extern int XkbLatchGroup( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */, int /* group */ -#endif ); extern void XkbClearAllLatchesAndLocks( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbSrvInfoPtr /* xkbi */, Bool /* genEv */, XkbEventCausePtr /* cause */ -#endif ); extern void XkbSetRulesDflts( -#if NeedFunctionPrototypes char * /* rulesFile */, char * /* model */, char * /* layout */, char * /* variant */, char * /* options */ -#endif ); extern void XkbInitDevice( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */ -#endif ); extern Bool XkbInitKeyboardDeviceStruct( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */, XkbComponentNamesPtr /* pNames */, KeySymsPtr /* pSyms */, CARD8 /* pMods */[], BellProcPtr /* bellProc */, KbdCtrlProcPtr /* ctrlProc */ -#endif ); extern int SProcXkbDispatch( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); extern XkbGeometryPtr XkbLookupNamedGeometry( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, Atom /* name */, Bool * /* shouldFree */ -#endif ); extern char * _XkbDupString( -#if NeedFunctionPrototypes char * /* str */ -#endif ); extern void XkbConvertCase( -#if NeedFunctionPrototypes KeySym /* sym */, KeySym * /* lower */, KeySym * /* upper */ -#endif ); extern Status XkbChangeKeycodeRange( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, int /* minKC */, int /* maxKC */, XkbChangesPtr /* changes */ -#endif ); extern int XkbFinishDeviceInit( -#if NeedFunctionPrototypes DeviceIntPtr /* pXDev */ -#endif ); extern void XkbFreeSrvLedInfo( -#if NeedFunctionPrototypes XkbSrvLedInfoPtr /* sli */ -#endif ); extern void XkbFreeInfo( -#if NeedFunctionPrototypes XkbSrvInfoPtr /* xkbi */ -#endif ); extern Status XkbChangeTypesOfKey( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, int /* key */, int /* nGroups */, unsigned int /* groups */, int * /* newTypesIn */, XkbMapChangesPtr /* changes */ -#endif ); extern XkbKeyTypePtr XkbAddKeyType( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, Atom /* name */, int /* map_count */, Bool /* want_preserve */, int /* num_lvls */ -#endif ); extern Status XkbInitCanonicalKeyTypes( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which */, int /* keypadVMod */ -#endif ); extern int XkbKeyTypesForCoreSymbols( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, int /* map_width */, KeySym * /* core_syms */, unsigned int /* protected */, int * /* types_inout */, KeySym * /* xkb_syms_rtrn */ -#endif ); extern Bool XkbApplyCompatMapToKey( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, KeyCode /* key */, XkbChangesPtr /* changes */ -#endif ); extern Bool XkbUpdateMapFromCore( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, KeyCode /* first_key */, int /* num_keys */, int /* map_width */, KeySym * /* core_keysyms */, XkbChangesPtr /* changes */ -#endif ); extern void XkbFreeControls( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeMap */ -#endif ); extern void XkbFreeIndicatorMaps( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */ -#endif ); extern Bool XkbApplyVirtualModChanges( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, unsigned int /* changed */, XkbChangesPtr /* changes */ -#endif ); extern Bool XkbUpdateActionVirtualMods( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, XkbAction * /* act */, unsigned int /* changed */ -#endif ); extern void XkbUpdateKeyTypeVirtualMods( -#if NeedFunctionPrototypes XkbDescPtr /* xkb */, XkbKeyTypePtr /* type */, unsigned int /* changed */, XkbChangesPtr /* changes */ -#endif ); extern void XkbSendNewKeyboardNotify( -#if NeedFunctionPrototypes DeviceIntPtr /* kbd */, xkbNewKeyboardNotify * /* pNKN */ -#endif ); #ifdef XKBSRV_NEED_FILE_FUNCS @@ -1329,28 +1083,21 @@ char * XkbGetRulesDflts( -#if NeedFunctionPrototypes XkbRF_VarDefsPtr /* defs */ -#endif ); extern void XkbSetRulesUsed( -#if NeedFunctionPrototypes XkbRF_VarDefsPtr /* defs */ -#endif ); extern Status XkbDDXList( -#if NeedFunctionPrototypes DeviceIntPtr /* dev */, XkbSrvListInfoPtr /* listing */, ClientPtr /* client */ -#endif ); extern unsigned int XkbDDXLoadKeymapByNames( -#if NeedFunctionPrototypes DeviceIntPtr /* keybd */, XkbComponentNamesPtr /* names */, unsigned int /* want */, @@ -1358,47 +1105,36 @@ XkbFileInfoPtr /* finfoRtrn */, char * /* keymapNameRtrn */, int /* keymapNameRtrnLen */ -#endif ); extern Bool XkbDDXNamesFromRules( -#if NeedFunctionPrototypes DeviceIntPtr /* keybd */, char * /* rules */, XkbRF_VarDefsPtr /* defs */, XkbComponentNamesPtr /* names */ -#endif ); extern FILE *XkbDDXOpenConfigFile( -#if NeedFunctionPrototypes char * /* mapName */, char * /* fileNameRtrn */, int /* fileNameRtrnLen */ -#endif ); extern Bool XkbDDXApplyConfig( -#if NeedFunctionPrototypes XPointer /* cfg_in */, XkbSrvInfoPtr /* xkbi */ -#endif ); extern XPointer XkbDDXPreloadConfig( -#if NeedFunctionPrototypes char ** /* rulesFileRtrn */, XkbRF_VarDefsPtr /* defs */, XkbComponentNamesPtr /* names */, DeviceIntPtr /* dev */ -#endif ); extern int _XkbStrCaseCmp( -#if NeedFunctionPrototypes char * /* str1 */, char * /* str2 */ -#endif ); #endif /* XKBSRV_NEED_FILE_FUNCS */ Index: xc/include/extensions/XLbx.h diff -u xc/include/extensions/XLbx.h:1.3 xc/include/extensions/XLbx.h:1.4 --- xc/include/extensions/XLbx.h:1.3 Tue Oct 15 21:59:55 2002 +++ xc/include/extensions/XLbx.h Mon Nov 17 17:20:02 2003 @@ -20,7 +20,7 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/include/extensions/XLbx.h,v 1.3 2002/10/16 01:59:55 dawes Exp $ */ +/* $XFree86: xc/include/extensions/XLbx.h,v 1.4 2003/11/17 22:20:02 dawes Exp $ */ #ifndef _XLBX_H_ #define _XLBX_H_ @@ -134,20 +134,16 @@ _XFUNCPROTOBEGIN Bool XLbxQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* requestp */, int* /* event_basep */, int* /* error_basep */ -#endif ); Bool XLbxQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* majorVersion */, int* /* minorVersion */ -#endif ); int XLbxGetEventBase(Display *dpy); Index: xc/include/extensions/XRes.h diff -u xc/include/extensions/XRes.h:1.3 xc/include/extensions/XRes.h:1.4 --- xc/include/extensions/XRes.h:1.3 Sun Mar 10 17:05:51 2002 +++ xc/include/extensions/XRes.h Thu Dec 18 00:48:06 2003 @@ -1,7 +1,7 @@ /* Copyright (c) 2002 XFree86 Inc */ -/* $XFree86: xc/include/extensions/XRes.h,v 1.3 2002/03/10 22:05:51 mvojkovi Exp $ */ +/* $XFree86: xc/include/extensions/XRes.h,v 1.4 2003/12/18 05:48:06 dawes Exp $ */ #ifndef _XRES_H #define _XRES_H @@ -29,8 +29,8 @@ Status XResQueryVersion ( Display *dpy, - int *major, - int *minor + int *major_versionp, + int *minor_versionp ); Status XResQueryClients ( Index: xc/include/extensions/XShm.h diff -u xc/include/extensions/XShm.h:1.10 xc/include/extensions/XShm.h:1.12 --- xc/include/extensions/XShm.h:1.10 Thu Nov 7 19:46:27 2002 +++ xc/include/extensions/XShm.h Mon Nov 17 17:20:03 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/XShm.h,v 1.10 2002/11/08 00:46:27 alanh Exp $ */ +/* $XFree86: xc/include/extensions/XShm.h,v 1.12 2003/11/17 22:20:03 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -72,54 +72,35 @@ _XFUNCPROTOBEGIN Bool XShmQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */ -#endif -); - -int XShmGetEventBase( -#if NeedFunctionPrototypes - Display* /* dpy */ -#endif ); int XShmGetEventBase( -#if NeedFunctionPrototypes Display* /* dpy */ -#endif ); Bool XShmQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* majorVersion */, int* /* minorVersion */, Bool* /* sharedPixmaps */ -#endif ); int XShmPixmapFormat( -#if NeedFunctionPrototypes Display* /* dpy */ -#endif ); Status XShmAttach( -#if NeedFunctionPrototypes Display* /* dpy */, XShmSegmentInfo* /* shminfo */ -#endif ); Status XShmDetach( -#if NeedFunctionPrototypes Display* /* dpy */, XShmSegmentInfo* /* shminfo */ -#endif ); Status XShmPutImage( -#if NeedFunctionPrototypes Display* /* dpy */, Drawable /* d */, GC /* gc */, @@ -131,22 +112,18 @@ unsigned int /* src_width */, unsigned int /* src_height */, Bool /* send_event */ -#endif ); Status XShmGetImage( -#if NeedFunctionPrototypes Display* /* dpy */, Drawable /* d */, XImage* /* image */, int /* x */, int /* y */, unsigned long /* plane_mask */ -#endif ); XImage *XShmCreateImage( -#if NeedFunctionPrototypes Display* /* dpy */, Visual* /* visual */, unsigned int /* depth */, @@ -155,11 +132,9 @@ XShmSegmentInfo* /* shminfo */, unsigned int /* width */, unsigned int /* height */ -#endif ); Pixmap XShmCreatePixmap( -#if NeedFunctionPrototypes Display* /* dpy */, Drawable /* d */, char* /* data */, @@ -167,7 +142,6 @@ unsigned int /* width */, unsigned int /* height */, unsigned int /* depth */ -#endif ); _XFUNCPROTOEND @@ -179,9 +153,7 @@ #include "gc.h" extern void ShmRegisterFbFuncs( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */ -#endif ); #endif Index: xc/include/extensions/XTest.h diff -u xc/include/extensions/XTest.h:3.3 xc/include/extensions/XTest.h:3.4 --- xc/include/extensions/XTest.h:3.3 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/XTest.h Mon Nov 17 17:20:03 2003 @@ -24,7 +24,7 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/extensions/XTest.h,v 3.3 2001/12/14 19:53:28 dawes Exp $ */ +/* $XFree86: xc/include/extensions/XTest.h,v 3.4 2003/11/17 22:20:03 dawes Exp $ */ #ifndef _XTEST_H_ #define _XTEST_H_ @@ -52,69 +52,54 @@ _XFUNCPROTOBEGIN Bool XTestQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* event_basep */, int* /* error_basep */, int* /* majorp */, int* /* minorp */ -#endif ); Bool XTestCompareCursorWithWindow( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* window */, Cursor /* cursor */ -#endif ); Bool XTestCompareCurrentCursorWithWindow( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* window */ -#endif ); extern int XTestFakeKeyEvent( -#if NeedFunctionPrototypes Display* /* dpy */, unsigned int /* keycode */, Bool /* is_press */, unsigned long /* delay */ -#endif ); extern int XTestFakeButtonEvent( -#if NeedFunctionPrototypes Display* /* dpy */, unsigned int /* button */, Bool /* is_press */, unsigned long /* delay */ -#endif ); extern int XTestFakeMotionEvent( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, int /* x */, int /* y */, unsigned long /* delay */ -#endif ); extern int XTestFakeRelativeMotionEvent( -#if NeedFunctionPrototypes Display* /* dpy */, int /* x */, int /* y */, unsigned long /* delay */ -#endif ); extern int XTestFakeDeviceKeyEvent( -#if NeedFunctionPrototypes Display* /* dpy */, XDevice* /* dev */, unsigned int /* keycode */, @@ -122,11 +107,9 @@ int* /* axes */, int /* n_axes */, unsigned long /* delay */ -#endif ); extern int XTestFakeDeviceButtonEvent( -#if NeedFunctionPrototypes Display* /* dpy */, XDevice* /* dev */, unsigned int /* button */, @@ -134,22 +117,18 @@ int* /* axes */, int /* n_axes */, unsigned long /* delay */ -#endif ); extern int XTestFakeProximityEvent( -#if NeedFunctionPrototypes Display* /* dpy */, XDevice* /* dev */, Bool /* in_prox */, int* /* axes */, int /* n_axes */, unsigned long /* delay */ -#endif ); extern int XTestFakeDeviceMotionEvent( -#if NeedFunctionPrototypes Display* /* dpy */, XDevice* /* dev */, Bool /* is_relative */, @@ -157,34 +136,25 @@ int* /* axes */, int /* n_axes */, unsigned long /* delay */ -#endif ); extern int XTestGrabControl( -#if NeedFunctionPrototypes Display* /* dpy */, Bool /* impervious */ -#endif ); void XTestSetGContextOfGC( -#if NeedFunctionPrototypes GC /* gc */, GContext /* gid */ -#endif ); void XTestSetVisualIDOfVisual( -#if NeedFunctionPrototypes Visual* /* visual */, VisualID /* visualid */ -#endif ); Status XTestDiscard( -#if NeedFunctionPrototypes Display* /* dpy */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/Xag.h diff -u xc/include/extensions/Xag.h:1.5 xc/include/extensions/Xag.h:1.6 --- xc/include/extensions/Xag.h:1.5 Mon Dec 17 15:52:24 2001 +++ xc/include/extensions/Xag.h Mon Nov 17 17:20:03 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/Xag.h,v 1.5 2001/12/17 20:52:24 dawes Exp $ */ +/* $XFree86: xc/include/extensions/Xag.h,v 1.6 2003/11/17 22:20:03 dawes Exp $ */ /* Copyright 1996, 1998 The Open Group @@ -59,67 +59,51 @@ typedef XID XAppGroup; Bool XagQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* major_version */, int* /* minor_version */ -#endif ); Status XagCreateEmbeddedApplicationGroup( -#if NeedFunctionPrototypes Display* /* dpy */, VisualID /* root_visual */, Colormap /* default_colormap */, unsigned long /* black_pixel */, unsigned long /* white_pixel */, XAppGroup* /* app_group_return */ -#endif ); Status XagCreateNonembeddedApplicationGroup( -#if NeedFunctionPrototypes Display* /* dpy */, XAppGroup* /* app_group_return */ -#endif ); Status XagDestroyApplicationGroup( -#if NeedFunctionPrototypes Display* /* dpy */, XAppGroup /* app_group */ -#endif ); Status XagGetApplicationGroupAttributes( -#if NeedVarargsPrototypes Display* /* dpy */, XAppGroup /* app_group */, ... -#endif ); Status XagQueryApplicationGroup( -#if NeedFunctionPrototypes Display* /* dpy */, XID /* resource_base */, XAppGroup* /* app_group_ret */ -#endif ); Status XagCreateAssociation( -#if NeedFunctionPrototypes Display* /* dpy */, Window* /* window_ret */, void* /* system_window */ -#endif ); Status XagDestroyAssociation( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* window */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/Xagsrv.h diff -u xc/include/extensions/Xagsrv.h:1.4 xc/include/extensions/Xagsrv.h:1.6 --- xc/include/extensions/Xagsrv.h:1.4 Thu Dec 20 14:25:43 2001 +++ xc/include/extensions/Xagsrv.h Mon Nov 17 17:20:03 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/Xagsrv.h,v 1.4 2001/12/20 19:25:43 tsi Exp $ */ +/* $XFree86: xc/include/extensions/Xagsrv.h,v 1.6 2003/11/17 22:20:03 dawes Exp $ */ /* Copyright 1996, 1998 The Open Group @@ -33,63 +33,41 @@ _XFUNCPROTOBEGIN -extern void XagExtensionInit( -#if NeedFunctionPrototypes - void -#endif -); - extern void XagConnectionInfo( -#if NeedFunctionPrototypes ClientPtr /* client */, xConnSetupPrefix** /* conn_prefix */, char** /* conn_info */, int* /* num_screens */ -#endif ); extern VisualID XagRootVisual( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); extern Colormap XagDefaultColormap( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); extern ClientPtr XagLeader( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); extern void XagCallClientStateChange( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); extern Bool XagIsControlledRoot ( -#if NeedFunctionPrototypes ClientPtr /* client */, WindowPtr /* pParent */ -#endif ); extern XID XagId ( -#if NeedFunctionPrototypes ClientPtr /* client */ -#endif ); extern void XagGetDeltaInfo ( -#if NeedFunctionPrototypes ClientPtr /* client */, CARD32* /* buf */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/Xcup.h diff -u xc/include/extensions/Xcup.h:3.5 xc/include/extensions/Xcup.h:3.6 --- xc/include/extensions/Xcup.h:3.5 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/Xcup.h Mon Nov 17 17:20:03 2003 @@ -24,6 +24,7 @@ in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/include/extensions/Xcup.h,v 3.6 2003/11/17 22:20:03 dawes Exp $ */ #ifndef _XCUP_H_ #define _XCUP_H_ @@ -41,29 +42,23 @@ _XFUNCPROTOBEGIN Bool XcupQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* major_version */, int* /* minor_version */ -#endif ); Status XcupGetReservedColormapEntries( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, XColor** /* colors_out */, int* /* ncolors */ -#endif ); Status XcupStoreColors( -#if NeedFunctionPrototypes Display* /* dpy */, Colormap /* colormap */, XColor* /* colors */, int /* ncolors */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/Xdbe.h diff -u xc/include/extensions/Xdbe.h:3.2 xc/include/extensions/Xdbe.h:3.3 --- xc/include/extensions/Xdbe.h:3.2 Tue Jul 31 20:44:35 2001 +++ xc/include/extensions/Xdbe.h Mon Nov 17 17:20:03 2003 @@ -30,7 +30,7 @@ * Header file for Xlib-related DBE * *****************************************************************************/ -/* $XFree86: xc/include/extensions/Xdbe.h,v 3.2 2001/08/01 00:44:35 tsi Exp $ */ +/* $XFree86: xc/include/extensions/Xdbe.h,v 3.3 2003/11/17 22:20:03 dawes Exp $ */ #ifndef XDBE_H #define XDBE_H @@ -85,67 +85,49 @@ _XFUNCPROTOBEGIN extern Status XdbeQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* major_version_return */, int* /* minor_version_return */ -#endif ); extern XdbeBackBuffer XdbeAllocateBackBufferName( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* window */, XdbeSwapAction /* swap_action */ -#endif ); extern Status XdbeDeallocateBackBufferName( -#if NeedFunctionPrototypes Display* /* dpy */, XdbeBackBuffer /* buffer */ -#endif ); extern Status XdbeSwapBuffers( -#if NeedFunctionPrototypes Display* /* dpy */, XdbeSwapInfo* /* swap_info */, int /* num_windows */ -#endif ); extern Status XdbeBeginIdiom( -#if NeedFunctionPrototypes Display* /* dpy */ -#endif ); extern Status XdbeEndIdiom( -#if NeedFunctionPrototypes Display* /* dpy */ -#endif ); extern XdbeScreenVisualInfo *XdbeGetVisualInfo( -#if NeedFunctionPrototypes Display* /* dpy */, Drawable* /* screen_specifiers */, int* /* num_screens */ -#endif ); extern void XdbeFreeVisualInfo( -#if NeedFunctionPrototypes XdbeScreenVisualInfo* /* visual_info */ -#endif ); extern XdbeBackBufferAttributes *XdbeGetBackBufferAttributes( -#if NeedFunctionPrototypes Display* /* dpy */, XdbeBackBuffer /* buffer */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/Xext.h diff -u xc/include/extensions/Xext.h:1.4 xc/include/extensions/Xext.h:1.5 --- xc/include/extensions/Xext.h:1.4 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/Xext.h Mon Nov 17 17:20:03 2003 @@ -23,7 +23,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/extensions/Xext.h,v 1.4 2001/12/14 19:53:28 dawes Exp $ */ +/* $XFree86: xc/include/extensions/Xext.h,v 1.5 2003/11/17 22:20:03 dawes Exp $ */ #ifndef _XEXT_H_ #define _XEXT_H_ @@ -33,28 +33,20 @@ _XFUNCPROTOBEGIN extern int (*XSetExtensionErrorHandler( -#if NeedFunctionPrototypes int (*handler)( -#if NeedNestedPrototypes Display *, char *, char * -#endif ) -#endif ))( -#if NeedNestedPrototypes Display *, char *, char * -#endif ); extern int XMissingExtension( -#if NeedFunctionPrototypes Display* /* dpy */, _Xconst char* /* ext_name */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/Xinerama.h diff -u xc/include/extensions/Xinerama.h:3.3 xc/include/extensions/Xinerama.h:3.4 --- xc/include/extensions/Xinerama.h:3.3 Mon Sep 16 14:05:19 2002 +++ xc/include/extensions/Xinerama.h Thu Dec 18 00:48:06 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/Xinerama.h,v 3.3 2002/09/16 18:05:19 eich Exp $ */ +/* $XFree86: xc/include/extensions/Xinerama.h,v 3.4 2003/12/18 05:48:06 dawes Exp $ */ #ifndef _Xinerama_h #define _Xinerama_h @@ -21,8 +21,8 @@ Status XineramaQueryVersion( Display *dpy, - int *major, - int *minor + int *major_versionp, + int *minor_versionp ); Bool XineramaIsActive(Display *dpy); Index: xc/include/extensions/XvMClib.h diff -u xc/include/extensions/XvMClib.h:1.6 xc/include/extensions/XvMClib.h:1.7 --- xc/include/extensions/XvMClib.h:1.6 Wed Nov 14 16:54:37 2001 +++ xc/include/extensions/XvMClib.h Thu Dec 18 00:48:06 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/XvMClib.h,v 1.6 2001/11/14 21:54:37 mvojkovi Exp $ */ +/* $XFree86: xc/include/extensions/XvMClib.h,v 1.7 2003/12/18 05:48:06 dawes Exp $ */ #ifndef _XVMCLIB_H_ #define _XVMCLIB_H_ @@ -10,7 +10,8 @@ _XFUNCPROTOBEGIN Bool XvMCQueryExtension (Display *display, int *eventBase, int *errBase); -Status XvMCQueryVersion (Display *display, int *major, int *minor); +Status XvMCQueryVersion (Display *display, int *major_versionp, + int *minor_versionp); XvMCSurfaceInfo * XvMCListSurfaceTypes(Display *dpy, XvPortID port, int *num); Index: xc/include/extensions/Xvlib.h diff -u xc/include/extensions/Xvlib.h:1.3 xc/include/extensions/Xvlib.h:1.4 --- xc/include/extensions/Xvlib.h:1.3 Sat Dec 11 14:28:48 1999 +++ xc/include/extensions/Xvlib.h Mon Nov 17 17:20:03 2003 @@ -21,7 +21,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/extensions/Xvlib.h,v 1.3 1999/12/11 19:28:48 mvojkovi Exp $ */ +/* $XFree86: xc/include/extensions/Xvlib.h,v 1.4 2003/11/17 22:20:03 dawes Exp $ */ #ifndef XVLIB_H #define XVLIB_H @@ -164,36 +164,29 @@ _XFUNCPROTOBEGIN extern int XvQueryExtension( -#if NeedFunctionPrototypes Display* /* display */, unsigned int* /* p_version */, unsigned int* /* p_revision */, unsigned int* /* p_requestBase */, unsigned int* /* p_eventBase */, unsigned int* /* p_errorBase */ -#endif ); extern int XvQueryAdaptors( -#if NeedFunctionPrototypes Display* /* display */, Window /* window */, unsigned int* /* p_nAdaptors */, XvAdaptorInfo** /* p_pAdaptors */ -#endif ); extern int XvQueryEncodings( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, unsigned int* /* p_nEncoding */, XvEncodingInfo** /* p_pEncoding */ -#endif ); extern int XvPutVideo( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Drawable /* d */, @@ -206,11 +199,9 @@ int /* dy */, unsigned int /* dw */, unsigned int /* dh */ -#endif ); extern int XvPutStill( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Drawable /* d */, @@ -223,11 +214,9 @@ int /* dy */, unsigned int /* dw */, unsigned int /* dh */ -#endif ); extern int XvGetVideo( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Drawable /* d */, @@ -240,11 +229,9 @@ int /* dy */, unsigned int /* dw */, unsigned int /* dh */ -#endif ); extern int XvGetStill( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Drawable /* d */, @@ -257,69 +244,53 @@ int /* dy */, unsigned int /* dw */, unsigned int /* dh */ -#endif ); extern int XvStopVideo( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Drawable /* drawable */ -#endif ); extern int XvGrabPort( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Time /* time */ -#endif ); extern int XvUngrabPort( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Time /* time */ -#endif ); extern int XvSelectVideoNotify( -#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, Bool /* onoff */ -#endif ); extern int XvSelectPortNotify( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Bool /* onoff */ -#endif ); extern int XvSetPortAttribute( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Atom /* attribute */, int /* value */ -#endif ); extern int XvGetPortAttribute( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Atom /* attribute */, int* /* p_value */ -#endif ); extern int XvQueryBestSize( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, Bool /* motion */, @@ -329,52 +300,40 @@ unsigned int /* drw_h */, unsigned int* /* p_actual_width */, unsigned int* /* p_actual_width */ -#endif ); extern XvAttribute* XvQueryPortAttributes( -#if NeedFunctionPrototypes Display* /* display */, XvPortID /* port */, int* /* number */ -#endif ); extern void XvFreeAdaptorInfo( -#if NeedFunctionPrototypes XvAdaptorInfo* /* adaptors */ -#endif ); extern void XvFreeEncodingInfo( -#if NeedFunctionPrototypes XvEncodingInfo* /* encodings */ -#endif ); extern XvImageFormatValues * XvListImageFormats ( -#if NeedFunctionPrototypes Display *display, XvPortID port_id, int *count_return -#endif ); extern XvImage * XvCreateImage ( -#if NeedFunctionPrototypes Display *display, XvPortID port, int id, char *data, int width, int height -#endif ); extern int XvPutImage ( -#if NeedFunctionPrototypes Display *display, XvPortID id, Drawable d, @@ -388,11 +347,9 @@ int dest_y, unsigned int dest_w, unsigned int dest_h -#endif ); extern int XvShmPutImage ( -#if NeedFunctionPrototypes Display *display, XvPortID id, Drawable d, @@ -407,13 +364,11 @@ unsigned int dest_w, unsigned int dest_h, Bool send_event -#endif ); #ifdef _XSHM_H_ extern XvImage * XvShmCreateImage ( -#if NeedFunctionPrototypes Display *display, XvPortID port, int id, @@ -421,7 +376,6 @@ int width, int height, XShmSegmentInfo *shminfo -#endif ); #endif Index: xc/include/extensions/bigreqstr.h diff -u xc/include/extensions/bigreqstr.h:1.2 xc/include/extensions/bigreqstr.h:1.3 --- xc/include/extensions/bigreqstr.h:1.2 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/bigreqstr.h Tue Jul 15 21:38:24 2003 @@ -24,6 +24,10 @@ in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/include/extensions/bigreqstr.h,v 1.3 2003/07/16 01:38:24 dawes Exp $ */ + +#ifndef _BIGREQSTR_H_ +#define _BIGREQSTR_H_ #define X_BigReqEnable 0 @@ -61,3 +65,5 @@ CARD16 zero B16; CARD32 length B32; } xBigReq; + +#endif /* _BIGREQSTR_H_ */ Index: xc/include/extensions/dpmsstr.h diff -u xc/include/extensions/dpmsstr.h:3.3 xc/include/extensions/dpmsstr.h:3.4 --- xc/include/extensions/dpmsstr.h:3.3 Wed Jan 17 12:53:20 2001 +++ xc/include/extensions/dpmsstr.h Tue Jul 15 21:38:24 2003 @@ -26,6 +26,7 @@ Equipment Corporation. ******************************************************************/ +/* $XFree86: xc/include/extensions/dpmsstr.h,v 3.4 2003/07/16 01:38:24 dawes Exp $ */ /* * HISTORY @@ -34,6 +35,8 @@ * @(#)RCSfile: dpmsstr.h,v Revision: 1.1.4.2 (DEC) Date: 1995/11/21 19:34:19 */ +#ifndef _DPMSSTR_H_ +#define _DPMSSTR_H_ #define X_DPMSGetVersion 0 #define X_DPMSCapable 1 @@ -180,7 +183,4 @@ } xDPMSInfoReply; #define sz_xDPMSInfoReply 32 - - - - +#endif /* _DPMSSTR_H_ */ Index: xc/include/extensions/extutil.h diff -u xc/include/extensions/extutil.h:1.9 xc/include/extensions/extutil.h:1.10 --- xc/include/extensions/extutil.h:1.9 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/extutil.h Mon Nov 17 17:20:03 2003 @@ -31,7 +31,7 @@ * protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND * ARE SUBJECT TO CHANGE! */ -/* $XFree86: xc/include/extensions/extutil.h,v 1.9 2001/12/14 19:53:28 dawes Exp $ */ +/* $XFree86: xc/include/extensions/extutil.h,v 1.10 2003/11/17 22:20:03 dawes Exp $ */ #ifndef _EXTUTIL_H_ #define _EXTUTIL_H_ @@ -58,117 +58,85 @@ typedef struct _XExtensionHooks { int (*create_gc)( -#if NeedNestedPrototypes Display* /* display */, GC /* gc */, XExtCodes* /* codes */ -#endif ); int (*copy_gc)( -#if NeedNestedPrototypes Display* /* display */, GC /* gc */, XExtCodes* /* codes */ -#endif ); int (*flush_gc)( -#if NeedNestedPrototypes Display* /* display */, GC /* gc */, XExtCodes* /* codes */ -#endif ); int (*free_gc)( -#if NeedNestedPrototypes Display* /* display */, GC /* gc */, XExtCodes* /* codes */ -#endif ); int (*create_font)( -#if NeedNestedPrototypes Display* /* display */, XFontStruct* /* fs */, XExtCodes* /* codes */ -#endif ); int (*free_font)( -#if NeedNestedPrototypes Display* /* display */, XFontStruct* /* fs */, XExtCodes* /* codes */ -#endif ); int (*close_display)( -#if NeedNestedPrototypes Display* /* display */, XExtCodes* /* codes */ -#endif ); Bool (*wire_to_event)( -#if NeedNestedPrototypes Display* /* display */, XEvent* /* re */, xEvent* /* event */ -#endif ); Status (*event_to_wire)( -#if NeedNestedPrototypes Display* /* display */, XEvent* /* re */, xEvent* /* event */ -#endif ); int (*error)( -#if NeedNestedPrototypes Display* /* display */, xError* /* err */, XExtCodes* /* codes */, int* /* ret_code */ -#endif ); char *(*error_string)( -#if NeedNestedPrototypes Display* /* display */, int /* code */, XExtCodes* /* codes */, char* /* buffer */, int /* nbytes */ -#endif ); } XExtensionHooks; extern XExtensionInfo *XextCreateExtension( -#if NeedFunctionPrototypes void -#endif ); extern void XextDestroyExtension( -#if NeedFunctionPrototypes XExtensionInfo* /* info */ -#endif ); extern XExtDisplayInfo *XextAddDisplay( -#if NeedFunctionPrototypes XExtensionInfo* /* extinfo */, Display* /* dpy */, char* /* ext_name */, XExtensionHooks* /* hooks */, int /* nevents */, XPointer /* data */ -#endif ); extern int XextRemoveDisplay( -#if NeedFunctionPrototypes XExtensionInfo* /* extinfo */, Display* /* dpy */ -#endif ); extern XExtDisplayInfo *XextFindDisplay( -#if NeedFunctionPrototypes XExtensionInfo* /* extinfo */, Display* /* dpy */ -#endif ); #define XextHasExtension(i) ((i) && ((i)->codes)) Index: xc/include/extensions/fontcache.h diff -u xc/include/extensions/fontcache.h:1.3 xc/include/extensions/fontcache.h:1.4 --- xc/include/extensions/fontcache.h:1.3 Tue Jul 31 20:44:35 2001 +++ xc/include/extensions/fontcache.h Mon Nov 17 17:20:03 2003 @@ -27,7 +27,7 @@ * * Id: fontcache.h,v 1.6 1999/01/31 12:41:32 akiyama Exp $ */ -/* $XFree86: xc/include/extensions/fontcache.h,v 1.3 2001/08/01 00:44:35 tsi Exp $ */ +/* $XFree86: xc/include/extensions/fontcache.h,v 1.4 2003/11/17 22:20:03 dawes Exp $ */ /* THIS IS NOT AN X CONSORTIUM STANDARD */ @@ -73,40 +73,30 @@ _XFUNCPROTOBEGIN Bool FontCacheQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* majorVersion */, int* /* minorVersion */ -#endif ); Bool FontCacheQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* event_base */, int* /* error_base */ -#endif ); Status FontCacheGetCacheSettings( -#if NeedFunctionPrototypes Display* /* dpy */, FontCacheSettings* /* cache info */ -#endif ); Status FontCacheChangeCacheSettings( -#if NeedFunctionPrototypes Display* /* dpy */, FontCacheSettings* /* cache info */ -#endif ); Status FontCacheGetCacheStatistics( -#if NeedFunctionPrototypes Display* /* dpy */, FontCacheStatistics* /* cache statistics info */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/lbximage.h diff -u xc/include/extensions/lbximage.h:1.4 xc/include/extensions/lbximage.h:1.5 --- xc/include/extensions/lbximage.h:1.4 Thu Dec 20 14:28:54 2001 +++ xc/include/extensions/lbximage.h Mon Nov 17 17:20:03 2003 @@ -25,7 +25,7 @@ in this Software without prior written authorization from The Open Group. ******************************************************************************/ -/* $XFree86: xc/include/extensions/lbximage.h,v 1.4 2001/12/20 19:28:54 tsi Exp $ */ +/* $XFree86: xc/include/extensions/lbximage.h,v 1.5 2003/11/17 22:20:03 dawes Exp $ */ #ifndef _LBX_IMAGE_H_ #define _LBX_IMAGE_H_ @@ -41,13 +41,10 @@ int methodOpCode; /* to be filled on reply from server */ int (*compInit)( -#if NeedFunctionPrototypes void -#endif ); int (*compFunc)( -#if NeedFunctionPrototypes unsigned char * /* inbuf */, unsigned char * /* outbuf */, int /* outbufSize */, @@ -56,18 +53,15 @@ int /* padded_bytes_per_scanline */, int /* reverse_bits */, int * /* bytesCompressed */ -#endif ); int (*decompFunc)( -#if NeedFunctionPrototypes unsigned char * /* inbuf */, unsigned char * /* outbuf */, int /* image_bytes */, int /* pixels_per_line */, int /* padded_bytes_per_scanline */, int /* reverse_bits */ -#endif ); } LbxBitmapCompMethod; @@ -85,13 +79,10 @@ int methodOpCode; /* to be filled on reply from server */ int (*compInit)( -#if NeedFunctionPrototypes void -#endif ); int (*compFunc)( -#if NeedFunctionPrototypes char * /* inbuf */, char * /* outbuf */, int /* outbufSize */, @@ -100,23 +91,19 @@ int /* num_scan_lines */, int /* scan_line_size */, int * /* bytesCompressed */ -#endif ); int (*decompFunc)( -#if NeedFunctionPrototypes char * /* inbuf */, char * /* outbuf */, int /* num_scan_lines */, int /* scan_line_size */ -#endif ); } LbxPixmapCompMethod; extern int LbxImageEncodePackBits ( -#if NeedFunctionPrototypes char * /* inbuf */, char * /* outbuf */, int /* outbufSize */, @@ -125,11 +112,9 @@ int /* num_scan_lines */, int /* scan_line_size */, int * /* bytesCompressed */ -#endif ); extern int LbxImageEncodeFaxG42D ( -#if NeedFunctionPrototypes unsigned char * /* inbuf */, unsigned char * /* outbuf */, int /* outbufSize */, @@ -138,27 +123,22 @@ int /* padded_bytes_per_scanline */, int /* reverse_bits */, int * /* bytesCompressed */ -#endif ); extern int LbxImageDecodePackBits ( -#if NeedFunctionPrototypes char * /* inbuf */, char * /* outbuf */, int /* num_scan_lines */, int /* scan_line_size */ -#endif ); extern int LbxImageDecodeFaxG42D ( -#if NeedFunctionPrototypes unsigned char * /* inbuf */, unsigned char * /* outbuf */, int /* image_bytes */, int /* pixels_per_line */, int /* padded_bytes_per_scanline */, int /* reverse_bits */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/mitmiscstr.h diff -u xc/include/extensions/mitmiscstr.h:1.2 xc/include/extensions/mitmiscstr.h:1.3 --- xc/include/extensions/mitmiscstr.h:1.2 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/mitmiscstr.h Tue Jul 15 21:38:24 2003 @@ -1,3 +1,4 @@ +/* $XFree86: xc/include/extensions/mitmiscstr.h,v 1.3 2003/07/16 01:38:24 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -28,6 +29,9 @@ /* $Xorg: mitmiscstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ +#ifndef _MITMISCSTR_H_ +#define _MITMISCSTR_H_ + #include "MITMisc.h" #define MITMISCNAME "MIT-SUNDRY-NONSTANDARD" @@ -63,3 +67,4 @@ } xMITGetBugModeReply; #define sz_xMITGetBugModeReply 32 +#endif /* _MITMISCSTR_H_ */ Index: xc/include/extensions/multibuf.h diff -u xc/include/extensions/multibuf.h:3.4 xc/include/extensions/multibuf.h:3.5 --- xc/include/extensions/multibuf.h:3.4 Fri Dec 14 14:53:28 2001 +++ xc/include/extensions/multibuf.h Mon Nov 17 17:20:03 2003 @@ -24,7 +24,7 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/extensions/multibuf.h,v 3.4 2001/12/14 19:53:28 dawes Exp $ */ +/* $XFree86: xc/include/extensions/multibuf.h,v 3.5 2003/11/17 22:20:03 dawes Exp $ */ #ifndef _MULTIBUF_H_ #define _MULTIBUF_H_ @@ -173,96 +173,75 @@ _XFUNCPROTOBEGIN extern Bool XmbufQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* event_base_return */, int* /* error_base_return */ -#endif ); extern Status XmbufGetVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* major_version_return */, int* /* minor_version_return */ -#endif ); extern int XmbufCreateBuffers( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* w */, int /* count */, int /* update_action */, int /* update_hint */, Multibuffer* /* buffers */ -#endif ); extern void XmbufDestroyBuffers( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* window */ -#endif ); extern void XmbufDisplayBuffers( -#if NeedFunctionPrototypes Display* /* dpy */, int /* count */, Multibuffer* /* buffers */, int /* min_delay */, int /* max_delay */ -#endif ); extern Status XmbufGetWindowAttributes( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* w */, XmbufWindowAttributes* /* attr */ -#endif ); extern void XmbufChangeWindowAttributes( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* w */, unsigned long /* valuemask */, XmbufSetWindowAttributes* /* attr */ -#endif ); extern Status XmbufGetBufferAttributes( -#if NeedFunctionPrototypes Display* /* dpy */, Multibuffer /* b */, XmbufBufferAttributes* /* attr */ -#endif ); extern void XmbufChangeBufferAttributes( -#if NeedFunctionPrototypes Display* /* dpy */, Multibuffer /* b */, unsigned long /* valuemask */, XmbufSetBufferAttributes* /* attr */ -#endif ); extern Status XmbufGetScreenInfo( -#if NeedFunctionPrototypes Display* /* dpy */, Drawable /* d */, int* /* nmono_return */, XmbufBufferInfo** /* mono_info_return */, int* /* nstereo_return */, XmbufBufferInfo** /* stereo_info_return */ -#endif ); extern Window XmbufCreateStereoWindow( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* parent */, int /* x */, @@ -277,11 +256,9 @@ XSetWindowAttributes* /* attr */, Multibuffer* /* leftp */, Multibuffer* /* rightp */ -#endif ); extern void XmbufClearBufferArea( -#if NeedFunctionPrototypes Display* /* dpy */, Multibuffer /* buffer */, int /* x */, @@ -289,7 +266,6 @@ unsigned int /* width */, unsigned int /* height */, Bool /* exposures */ -#endif ); _XFUNCPROTOEND @@ -303,21 +279,16 @@ struct _mbufScreen; /* declared in multibufst.h */ extern void RegisterMultibufferInit( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, Bool (* /* bufMultibufferInit */)( -#if NeedNestedPrototypes ScreenPtr /* pScreen */, struct _mbufScreen * /* pMBScreen */ -#endif ) -#endif ); struct xMbufBufferInfo; /* declared in multibufst.h */ extern void RegisterDoubleBufferHardware( -#if NeedFunctionPrototypes ScreenPtr /* pScreen */, int /* nInfo */, struct xMbufBufferInfo * /* pInfo */, @@ -325,28 +296,21 @@ DevUnion /* selectPlane */, void (* /* CopyBufferBitsFunc */ )(), void (* /* DrawSelectPlaneFunc */ )() -#endif ); extern int CreateImageBuffers ( -#if NeedFunctionPrototypes WindowPtr /* pWin */, int /* nbuf */, XID * /* ids */, int /* action */, int /* hint */ -#endif ); extern void DestroyImageBuffers ( -#if NeedFunctionPrototypes WindowPtr /* pWin */ -#endif ); extern int DisplayImageBuffers ( -#if NeedFunctionPrototypes XID * /* ids */, int /* nbuf */ -#endif ); #endif /* _MULTIBUF_SERVER_ */ Index: xc/include/extensions/multibufst.h diff -u xc/include/extensions/multibufst.h:3.8 xc/include/extensions/multibufst.h:3.9 --- xc/include/extensions/multibufst.h:3.8 Wed Dec 19 16:37:29 2001 +++ xc/include/extensions/multibufst.h Mon Nov 17 17:20:03 2003 @@ -24,7 +24,7 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/extensions/multibufst.h,v 3.8 2001/12/19 21:37:29 dawes Exp $ */ +/* $XFree86: xc/include/extensions/multibufst.h,v 3.9 2003/11/17 22:20:03 dawes Exp $ */ #ifndef _MULTIBUFST_H_ #define _MULTIBUFST_H_ @@ -435,21 +435,15 @@ extern RESTYPE MultibufferDrawableResType; extern void MultibufferUpdate( /* pMbuffer, time */ -#if NeedFunctionPrototypes MultibufferPtr /* pMultibuffer */, CARD32 /* time */ -#endif ); extern void MultibufferExpose( /* pMbuffer, pRegion */ -#if NeedFunctionPrototypes MultibufferPtr /* pMultibuffer */, RegionPtr /* pRegion */ -#endif ); extern void MultibufferClobber( /* pMbuffer */ -#if NeedFunctionPrototypes MultibufferPtr /* pMultibuffer */ -#endif ); typedef struct _mbufWindow *mbufWindowPtr; @@ -515,61 +509,43 @@ xMbufBufferInfo *pInfo; /* buffer info (for Normal buffers) */ int (* CreateImageBuffers)( -#if NeedNestedPrototypes WindowPtr /* pWin */, int /* nbuf */, XID * /* ids */, int /* action */, int /* hint */ -#endif ); void (* DestroyImageBuffers)( -#if NeedNestedPrototypes WindowPtr /* pWin */ -#endif ); void (* DisplayImageBuffers)( -#if NeedNestedPrototypes ScreenPtr /* pScreen */, mbufBufferPtr * /* ppMBBuffer */, mbufWindowPtr * /* ppMBWindow */, int /* nbuf */ -#endif ); void (* ClearImageBufferArea)( -#if NeedNestedPrototypes mbufBufferPtr /* pMBBuffer */, short /* x */, short /* y */, unsigned short /* width */, unsigned short /* height */, Bool /* exposures */ -#endif ); Bool (* ChangeMBufferAttributes)( /* pMBWindow, vmask */ -#if NeedNestedPrototypes /* FIXME */ -#endif ); Bool (* ChangeBufferAttributes)( /* pMBBuffer, vmask */ -#if NeedNestedPrototypes /* FIXME */ -#endif ); void (* DeleteBufferDrawable)( -#if NeedNestedPrototypes DrawablePtr /* pDrawable */ -#endif ); void (* WrapScreenFuncs)( -#if NeedNestedPrototypes ScreenPtr /* pScreen */ -#endif ); void (* ResetProc)( -#if NeedNestedPrototypes ScreenPtr /* pScreen */ -#endif ); DevUnion devPrivate; } mbufScreenRec, *mbufScreenPtr; Index: xc/include/extensions/panoramiXext.h diff -u xc/include/extensions/panoramiXext.h:3.6 xc/include/extensions/panoramiXext.h:3.7 --- xc/include/extensions/panoramiXext.h:3.6 Wed Jan 17 12:53:22 2001 +++ xc/include/extensions/panoramiXext.h Mon Nov 17 17:20:03 2003 @@ -26,7 +26,7 @@ /* * PanoramiX definitions */ -/* $XFree86: xc/include/extensions/panoramiXext.h,v 3.6 2001/01/17 17:53:22 dawes Exp $ */ +/* $XFree86: xc/include/extensions/panoramiXext.h,v 3.7 2003/11/17 22:20:03 dawes Exp $ */ /* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ @@ -44,7 +44,5 @@ } XPanoramiXInfo; extern XPanoramiXInfo *XPanoramiXAllocInfo ( -#if NeedFunctionPrototypes void -#endif ); Index: xc/include/extensions/record.h diff -u xc/include/extensions/record.h:1.1.1.3 xc/include/extensions/record.h:1.2 --- xc/include/extensions/record.h:1.1.1.3 Tue Jan 16 17:05:28 2001 +++ xc/include/extensions/record.h Mon Nov 17 17:20:03 2003 @@ -21,6 +21,8 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **************************************************************************/ +/* $XFree86: xc/include/extensions/record.h,v 1.2 2003/11/17 22:20:03 dawes Exp $ */ + #ifndef _RECORD_H_ #define _RECORD_H_ @@ -116,38 +118,29 @@ */ XID XRecordIdBaseMask( -#if NeedFunctionPrototypes Display *dpy -#endif ); extern Status XRecordQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* cmajor_return */, int* /* cminor_return */ -#endif ); extern XRecordContext XRecordCreateContext( -#if NeedFunctionPrototypes Display* /* dpy */, int /* datum_flags */, XRecordClientSpec* /* clients */, int /* nclients */, XRecordRange** /* ranges */, int /* nranges */ -#endif ); extern XRecordRange *XRecordAllocRange( -#if NeedFunctionPrototypes void -#endif ); extern Status XRecordRegisterClients( -#if NeedFunctionPrototypes Display* /* dpy */, XRecordContext /* context */, int /* datum_flags */, @@ -155,81 +148,60 @@ int /* nclients */, XRecordRange** /* ranges */, int /* nranges */ -#endif ); extern Status XRecordUnregisterClients( -#if NeedFunctionPrototypes Display* /* dpy */, XRecordContext /* context */, XRecordClientSpec* /* clients */, int /* nclients */ -#endif ); extern Status XRecordGetContext( -#if NeedFunctionPrototypes Display* /* dpy */, XRecordContext /* context */, XRecordState** /* state_return */ -#endif ); extern void XRecordFreeState( -#if NeedFunctionPrototypes XRecordState* /* state */ -#endif ); typedef void (*XRecordInterceptProc) ( -#if NeedFunctionPrototypes XPointer /* closure */, XRecordInterceptData* /* recorded_data */ -#endif ); extern Status XRecordEnableContext( -#if NeedFunctionPrototypes Display* /* dpy */, XRecordContext /* context */, XRecordInterceptProc /* callback */, XPointer /* closure */ -#endif ); extern Status XRecordEnableContextAsync( -#if NeedFunctionPrototypes Display* /* dpy */, XRecordContext /* context */, XRecordInterceptProc /* callback */, XPointer /* closure */ -#endif ); extern void XRecordProcessReplies( -#if NeedFunctionPrototypes Display* /* dpy */ -#endif ); extern void XRecordFreeData( -#if NeedFunctionPrototypes XRecordInterceptData* /* data */ -#endif ); extern Status XRecordDisableContext( -#if NeedFunctionPrototypes Display* /* dpy */, XRecordContext /* context */ -#endif ); extern Status XRecordFreeContext( -#if NeedFunctionPrototypes Display* /* dpy */, XRecordContext /* context */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/scrnsaver.h diff -u xc/include/extensions/scrnsaver.h:3.0 xc/include/extensions/scrnsaver.h:3.1 --- xc/include/extensions/scrnsaver.h:3.0 Tue Jun 28 08:18:38 1994 +++ xc/include/extensions/scrnsaver.h Mon Nov 17 17:20:03 2003 @@ -26,6 +26,7 @@ * * Author: Keith Packard, MIT X Consortium */ +/* $XFree86: xc/include/extensions/scrnsaver.h,v 3.1 2003/11/17 22:20:03 dawes Exp $ */ #ifndef _SCRNSAVER_H_ #define _SCRNSAVER_H_ @@ -58,45 +59,34 @@ _XFUNCPROTOBEGIN extern Bool XScreenSaverQueryExtension ( -#if NeedFunctionPrototypes Display* /* display */, int* /* event_base */, int* /* error_base */ -#endif ); extern Status XScreenSaverQueryVersion ( -#if NeedFunctionPrototypes Display* /* display */, int* /* major_version */, int* /* minor_version */ -#endif ); extern XScreenSaverInfo *XScreenSaverAllocInfo ( -#if NeedFunctionPrototypes void -#endif ); extern Status XScreenSaverQueryInfo ( -#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, XScreenSaverInfo* /* info */ -#endif ); extern void XScreenSaverSelectInput ( -#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, unsigned long /* eventMask */ -#endif ); extern void XScreenSaverSetAttributes ( -#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, int /* x */, @@ -109,39 +99,30 @@ Visual * /* visual */, unsigned long /* valuemask */, XSetWindowAttributes * /* attributes */ -#endif ); extern void XScreenSaverUnsetAttributes ( -#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */ -#endif ); extern Status XScreenSaverRegister ( -#if NeedFunctionPrototypes Display* /* display */, int /* screen */, XID /* xid */, Atom /* type */ -#endif ); extern Status XScreenSaverUnregister ( -#if NeedFunctionPrototypes Display* /* display */, int /* screen */ -#endif ); extern Status XScreenSaverGetRegistered ( -#if NeedFunctionPrototypes Display* /* display */, int /* screen */, XID* /* xid */, Atom* /* type */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/shape.h diff -u xc/include/extensions/shape.h:1.3 xc/include/extensions/shape.h:1.4 --- xc/include/extensions/shape.h:1.3 Fri Dec 14 14:53:29 2001 +++ xc/include/extensions/shape.h Mon Nov 17 17:20:03 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/shape.h,v 1.3 2001/12/14 19:53:29 dawes Exp $ */ +/* $XFree86: xc/include/extensions/shape.h,v 1.4 2003/11/17 22:20:03 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -76,23 +76,18 @@ _XFUNCPROTOBEGIN extern Bool XShapeQueryExtension ( -#if NeedFunctionPrototypes Display* /* display */, int* /* event_base */, int* /* error_base */ -#endif ); extern Status XShapeQueryVersion ( -#if NeedFunctionPrototypes Display* /* display */, int* /* major_version */, int* /* minor_version */ -#endif ); extern void XShapeCombineRegion ( -#if NeedFunctionPrototypes Display* /* display */, Window /* dest */, int /* dest_kind */, @@ -100,11 +95,9 @@ int /* y_off */, Region /* region */, int /* op */ -#endif ); extern void XShapeCombineRectangles ( -#if NeedFunctionPrototypes Display* /* display */, Window /* dest */, int /* dest_kind */, @@ -114,11 +107,9 @@ int /* n_rects */, int /* op */, int /* ordering */ -#endif ); extern void XShapeCombineMask ( -#if NeedFunctionPrototypes Display* /* display */, Window /* dest */, int /* dest_kind */, @@ -126,11 +117,9 @@ int /* y_off */, Pixmap /* src */, int /* op */ -#endif ); extern void XShapeCombineShape ( -#if NeedFunctionPrototypes Display* /* display */, Window /* dest */, int /* dest_kind */, @@ -139,21 +128,17 @@ Window /* src */, int /* src_kind */, int /* op */ -#endif ); extern void XShapeOffsetShape ( -#if NeedFunctionPrototypes Display* /* display */, Window /* dest */, int /* dest_kind */, int /* x_off */, int /* y_off */ -#endif ); extern Status XShapeQueryExtents ( -#if NeedFunctionPrototypes Display* /* display */, Window /* window */, Bool* /* bounding_shaped */, @@ -166,32 +151,25 @@ int* /* y_clip */, unsigned int* /* w_clip */, unsigned int* /* h_clip */ -#endif ); extern void XShapeSelectInput ( -#if NeedFunctionPrototypes Display* /* display */, Window /* window */, unsigned long /* mask */ -#endif ); extern unsigned long XShapeInputSelected ( -#if NeedFunctionPrototypes Display* /* display */, Window /* window */ -#endif ); extern XRectangle *XShapeGetRectangles ( -#if NeedFunctionPrototypes Display* /* display */, Window /* window */, int /* kind */, int* /* count */, int* /* ordering */ -#endif ); _XFUNCPROTOEND Index: xc/include/extensions/shmstr.h diff -u xc/include/extensions/shmstr.h:3.3 xc/include/extensions/shmstr.h:3.4 --- xc/include/extensions/shmstr.h:3.3 Fri Dec 14 14:53:29 2001 +++ xc/include/extensions/shmstr.h Mon Nov 17 17:20:03 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/shmstr.h,v 3.3 2001/12/14 19:53:29 dawes Exp $ */ +/* $XFree86: xc/include/extensions/shmstr.h,v 3.4 2003/11/17 22:20:03 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -46,7 +46,6 @@ #define SHM_MINOR_VERSION 1 #ifdef _XSHM_SERVER_ -#if NeedFunctionPrototypes #define XSHM_PUT_IMAGE_ARGS \ DrawablePtr /* dst */, \ GCPtr /* pGC */, \ @@ -61,20 +60,13 @@ int /* dx */, \ int /* dy */, \ char * /* data */ -#else -#define XSHM_PUT_IMAGE_ARGS /* nothing */ -#endif -#if NeedFunctionPrototypes #define XSHM_CREATE_PIXMAP_ARGS \ ScreenPtr /* pScreen */, \ int /* width */, \ int /* height */, \ int /* depth */, \ char * /* addr */ -#else -#define XSHM_CREATE_PIXMAP_ARGS /* nothing */ -#endif typedef struct _ShmFuncs { PixmapPtr (* CreatePixmap)(XSHM_CREATE_PIXMAP_ARGS); Index: xc/include/extensions/sync.h diff -u xc/include/extensions/sync.h:1.4 xc/include/extensions/sync.h:1.5 --- xc/include/extensions/sync.h:1.4 Thu Dec 20 14:40:59 2001 +++ xc/include/extensions/sync.h Mon Nov 17 17:20:03 2003 @@ -48,7 +48,7 @@ PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/extensions/sync.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */ +/* $XFree86: xc/include/extensions/sync.h,v 1.5 2003/11/17 22:20:03 dawes Exp $ */ #ifndef _SYNC_H_ #define _SYNC_H_ @@ -139,113 +139,81 @@ /* have to put these prototypes before the corresponding macro definitions */ extern void XSyncIntToValue( -#if NeedFunctionPrototypes XSyncValue* /*pv*/, int /*i*/ -#endif ); extern void XSyncIntsToValue( -#if NeedFunctionPrototypes XSyncValue* /*pv*/, unsigned int /*l*/, int /*h*/ -#endif ); extern Bool XSyncValueGreaterThan( -#if NeedFunctionPrototypes XSyncValue /*a*/, XSyncValue /*b*/ -#endif ); extern Bool XSyncValueLessThan( -#if NeedFunctionPrototypes XSyncValue /*a*/, XSyncValue /*b*/ -#endif ); extern Bool XSyncValueGreaterOrEqual( -#if NeedFunctionPrototypes XSyncValue /*a*/, XSyncValue /*b*/ -#endif ); extern Bool XSyncValueLessOrEqual( -#if NeedFunctionPrototypes XSyncValue /*a*/, XSyncValue /*b*/ -#endif ); extern Bool XSyncValueEqual( -#if NeedFunctionPrototypes XSyncValue /*a*/, XSyncValue /*b*/ -#endif ); extern Bool XSyncValueIsNegative( -#if NeedFunctionPrototypes XSyncValue /*v*/ -#endif ); extern Bool XSyncValueIsZero( -#if NeedFunctionPrototypes XSyncValue /*a*/ -#endif ); extern Bool XSyncValueIsPositive( -#if NeedFunctionPrototypes XSyncValue /*v*/ -#endif ); extern unsigned int XSyncValueLow32( -#if NeedFunctionPrototypes XSyncValue /*v*/ -#endif ); extern int XSyncValueHigh32( -#if NeedFunctionPrototypes XSyncValue /*v*/ -#endif ); extern void XSyncValueAdd( -#if NeedFunctionPrototypes XSyncValue* /*presult*/, XSyncValue /*a*/, XSyncValue /*b*/, int* /*poverflow*/ -#endif ); extern void XSyncValueSubtract( -#if NeedFunctionPrototypes XSyncValue* /*presult*/, XSyncValue /*a*/, XSyncValue /*b*/, int* /*poverflow*/ -#endif ); extern void XSyncMaxValue( -#if NeedFunctionPrototypes XSyncValue* /*pv*/ -#endif ); extern void XSyncMinValue( -#if NeedFunctionPrototypes XSyncValue* /*pv*/ -#endif ); _XFUNCPROTOEND @@ -404,126 +372,94 @@ _XFUNCPROTOBEGIN extern Status XSyncQueryExtension( -#if NeedFunctionPrototypes Display* /*dpy*/, int* /*event_base_return*/, int* /*error_base_return*/ -#endif ); extern Status XSyncInitialize( -#if NeedFunctionPrototypes Display* /*dpy*/, int* /*major_version_return*/, int* /*minor_version_return*/ -#endif ); extern XSyncSystemCounter *XSyncListSystemCounters( -#if NeedFunctionPrototypes Display* /*dpy*/, int* /*n_counters_return*/ -#endif ); extern void XSyncFreeSystemCounterList( -#if NeedFunctionPrototypes XSyncSystemCounter* /*list*/ -#endif ); extern XSyncCounter XSyncCreateCounter( -#if NeedFunctionPrototypes Display* /*dpy*/, XSyncValue /*initial_value*/ -#endif ); extern Status XSyncSetCounter( -#if NeedFunctionPrototypes Display* /*dpy*/, XSyncCounter /*counter*/, XSyncValue /*value*/ -#endif ); extern Status XSyncChangeCounter( -#if NeedFunctionPrototypes Display* /*dpy*/, XSyncCounter /*counter*/, XSyncValue /*value*/ -#endif ); extern Status XSyncDestroyCounter( -#if NeedFunctionPrototypes Display* /*dpy*/, XSyncCounter /*counter*/ -#endif ); extern Status XSyncQueryCounter( -#if NeedFunctionPrototypes Display* /*dpy*/, XSyncCounter /*counter*/, XSyncValue* /*value_return*/ -#endif ); extern Status XSyncAwait( -#if NeedFunctionPrototypes Display* /*dpy*/, XSyncWaitCondition* /*wait_list*/, int /*n_conditions*/ -#endif ); extern XSyncAlarm XSyncCreateAlarm( -#if NeedFunctionPrototypes Display* /*dpy*/, unsigned long /*values_mask*/, XSyncAlarmAttributes* /*values*/ -#endif ); extern Status XSyncDestroyAlarm( -#if NeedFunctionPrototypes Display* /*dpy*/, XSyncAlarm /*alarm*/ -#endif ); extern Status XSyncQueryAlarm( -#if NeedFunctionPrototypes Display* /*dpy*/, XSyncAlarm /*alarm*/, XSyncAlarmAttributes* /*values_return*/ -#endif ); extern Status XSyncChangeAlarm( -#if NeedFunctionPrototypes Display* /*dpy*/, XSyncAlarm /*alarm*/, unsigned long /*values_mask*/, XSyncAlarmAttributes* /*values*/ -#endif ); extern Status XSyncSetPriority( -#if NeedFunctionPrototypes Display* /*dpy*/, XID /*client_resource_id*/, int /*priority*/ -#endif ); extern Status XSyncGetPriority( -#if NeedFunctionPrototypes Display* /*dpy*/, XID /*client_resource_id*/, int* /*return_priority*/ -#endif ); #endif /* _SYNC_SERVER */ Index: xc/include/extensions/syncstr.h diff -u xc/include/extensions/syncstr.h:1.2 xc/include/extensions/syncstr.h:1.4 --- xc/include/extensions/syncstr.h:1.2 Fri Dec 14 14:53:29 2001 +++ xc/include/extensions/syncstr.h Mon Nov 17 17:20:03 2003 @@ -48,6 +48,10 @@ PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/include/extensions/syncstr.h,v 1.4 2003/11/17 22:20:03 dawes Exp $ */ + +#ifndef _SYNCSTR_H_ +#define _SYNCSTR_H_ #include "sync.h" @@ -392,17 +396,13 @@ CARD64 bracket_less; SyncCounterType counterType; /* how can this counter change */ void (*QueryValue)( -#if NeedNestedPrototypes pointer /*pCounter*/, CARD64 * /*freshvalue*/ -#endif ); void (*BracketValues)( -#if NeedNestedPrototypes pointer /*pCounter*/, CARD64 * /*lessthan*/, CARD64 * /*greaterthan*/ -#endif ); } SysCounterInfo; @@ -415,20 +415,14 @@ unsigned int test_type; /* transition or Comparision type */ CARD64 test_value; /* trigger event threshold value */ Bool (*CheckTrigger)( -#if NeedNestedPrototypes struct _SyncTrigger * /*pTrigger*/, CARD64 /*newval*/ -#endif ); void (*TriggerFired)( -#if NeedNestedPrototypes struct _SyncTrigger * /*pTrigger*/ -#endif ); void (*CounterDestroyed)( -#if NeedNestedPrototypes struct _SyncTrigger * /*pTrigger*/ -#endif ); } SyncTrigger; @@ -472,28 +466,29 @@ extern pointer SyncCreateSystemCounter( -#if NeedFunctionPrototypes char * /* name */, CARD64 /* inital_value */, CARD64 /* resolution */, SyncCounterType /* change characterization */, - void (* /*QueryValue*/ ) (), /* XXX prototype */ - void (* /*BracketValues*/) () -#endif + void (* /*QueryValue*/ ) ( + pointer /* pCounter */, + CARD64 * /* pValue_return */), /* XXX prototype */ + void (* /*BracketValues*/) ( + pointer /* pCounter */, + CARD64 * /* pbracket_less */, + CARD64 * /* pbracket_greater */) ); extern void SyncChangeCounter( -#if NeedFunctionPrototypes SyncCounter * /* pCounter*/, CARD64 /* new_value */ -#endif ); extern void SyncDestroySystemCounter( -#if NeedFunctionPrototypes pointer pCounter -#endif ); -extern void InitServertime(); +extern void InitServertime(void); #endif /* _SYNC_SERVER */ + +#endif /* _SYNCSTR_H_ */ Index: xc/include/extensions/xcmiscstr.h diff -u xc/include/extensions/xcmiscstr.h:1.2 xc/include/extensions/xcmiscstr.h:1.3 --- xc/include/extensions/xcmiscstr.h:1.2 Fri Dec 14 14:53:29 2001 +++ xc/include/extensions/xcmiscstr.h Tue Jul 15 21:38:24 2003 @@ -24,6 +24,10 @@ in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/include/extensions/xcmiscstr.h,v 1.3 2003/07/16 01:38:24 dawes Exp $ */ + +#ifndef _XCMISCSTR_H_ +#define _XCMISCSTR_H_ #define X_XCMiscGetVersion 0 #define X_XCMiscGetXIDRange 1 @@ -105,3 +109,4 @@ } xXCMiscGetXIDListReply; #define sz_xXCMiscGetXIDListReply 32 +#endif /* _XCMISCSTR_H_ */ Index: xc/include/extensions/xf86dga1.h diff -u xc/include/extensions/xf86dga1.h:1.2 xc/include/extensions/xf86dga1.h:1.3 --- xc/include/extensions/xf86dga1.h:1.2 Sat Apr 17 03:05:41 1999 +++ xc/include/extensions/xf86dga1.h Mon Nov 17 17:20:03 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/xf86dga1.h,v 1.2 1999/04/17 07:05:41 dawes Exp $ */ +/* $XFree86: xc/include/extensions/xf86dga1.h,v 1.3 2003/11/17 22:20:03 dawes Exp $ */ /* Copyright (c) 1995 Jon Tombs @@ -43,121 +43,93 @@ _XFUNCPROTOBEGIN Bool XF86DGAQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* majorVersion */, int* /* minorVersion */ -#endif ); Bool XF86DGAQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* event_base */, int* /* error_base */ -#endif ); Status XF86DGAGetVideoLL( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, int * /* base addr */, int * /* width */, int * /* bank_size */, int * /* ram_size */ -#endif ); Status XF86DGAGetVideo( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, char ** /* base addr */, int * /* width */, int * /* bank_size */, int * /* ram_size */ -#endif ); Status XF86DGADirectVideo( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, int /* enable */ -#endif ); Status XF86DGADirectVideoLL( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, int /* enable */ -#endif ); Status XF86DGAGetViewPortSize( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, int * /* width */, int * /* height */ -#endif ); Status XF86DGASetViewPort( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, int x /* X */, int y /* Y */ -#endif ); Status XF86DGAGetVidPage( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, int * /* vid page */ -#endif ); Status XF86DGASetVidPage( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, int /* vid page */ -#endif ); Status XF86DGAInstallColormap( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, Colormap /*Colormap */ -#endif ); int XF86DGAForkApp( -#if NeedFunctionPrototypes int screen -#endif ); Status XF86DGAQueryDirectVideo( -#if NeedFunctionPrototypes Display * /* dpy */, int /* screen */, int * /* flags */ -#endif ); Bool XF86DGAViewPortChanged( -#if NeedFunctionPrototypes Display * /* dpy */, int /* screen */, int /* n */ -#endif ); Index: xc/include/extensions/xf86misc.h diff -u xc/include/extensions/xf86misc.h:3.16 xc/include/extensions/xf86misc.h:3.17 --- xc/include/extensions/xf86misc.h:3.16 Tue Nov 19 23:04:56 2002 +++ xc/include/extensions/xf86misc.h Thu Apr 3 11:15:46 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/xf86misc.h,v 3.16 2002/11/20 04:04:56 dawes Exp $ */ +/* $XFree86: xc/include/extensions/xf86misc.h,v 3.17 2003/04/03 16:15:46 dawes Exp $ */ /* * Copyright (c) 1995, 1996 The XFree86 Project, Inc @@ -23,6 +23,7 @@ #define X_XF86MiscSetGrabKeysState 7 #define X_XF86MiscSetClientVersion 8 #define X_XF86MiscGetFilePaths 9 +#define X_XF86MiscPassMessage 10 #define XF86MiscNumberEvents 0 @@ -156,6 +157,14 @@ XF86MiscFilePaths* /* file paths/locations */ ); +Status XF86MiscPassMessage( + Display* /* dpy */, + int /* screen */, + const char* /* message name/type */, + const char* /* message contents/value */, + char ** /* returned message */ +); + _XFUNCPROTOEND #endif Index: xc/include/extensions/xf86mscstr.h diff -u xc/include/extensions/xf86mscstr.h:3.12 xc/include/extensions/xf86mscstr.h:3.13 --- xc/include/extensions/xf86mscstr.h:3.12 Tue Nov 19 23:04:56 2002 +++ xc/include/extensions/xf86mscstr.h Thu Apr 3 11:15:46 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/xf86mscstr.h,v 3.12 2002/11/20 04:04:56 dawes Exp $ */ +/* $XFree86: xc/include/extensions/xf86mscstr.h,v 3.13 2003/04/03 16:15:46 dawes Exp $ */ /* * Copyright (c) 1995, 1996 The XFree86 Project, Inc @@ -14,7 +14,7 @@ #define XF86MISCNAME "XFree86-Misc" #define XF86MISC_MAJOR_VERSION 0 /* current version numbers */ -#define XF86MISC_MINOR_VERSION 7 +#define XF86MISC_MINOR_VERSION 8 typedef struct _XF86MiscQueryVersion { CARD8 reqType; /* always XF86MiscReqCode */ @@ -209,4 +209,30 @@ } xXF86MiscGetFilePathsReply; #define sz_xXF86MiscGetFilePathsReply 32 +typedef struct _XF86MiscPassMessage { + CARD8 reqType; /* always XF86MiscReqCode */ + CARD8 xf86miscReqType; /* always X_XF86MiscPassMessage */ + CARD16 length B16; + CARD16 typelen B16; + CARD16 vallen B16; + CARD16 screen B16; + CARD16 pad B16; +} xXF86MiscPassMessageReq; +#define sz_xXF86MiscPassMessageReq 12 + +typedef struct { + BYTE type; /* X_Reply */ + BYTE pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 mesglen B16; + CARD16 pad2 B16; + CARD32 status B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xXF86MiscPassMessageReply; +#define sz_xXF86MiscPassMessageReply 32 + #endif /* _XF86MISCSTR_H_ */ Index: xc/include/extensions/xf86rush.h diff -u xc/include/extensions/xf86rush.h:1.4 xc/include/extensions/xf86rush.h:1.5 --- xc/include/extensions/xf86rush.h:1.4 Mon Feb 28 22:09:00 2000 +++ xc/include/extensions/xf86rush.h Mon Nov 17 17:20:04 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/xf86rush.h,v 1.4 2000/02/29 03:09:00 dawes Exp $ */ +/* $XFree86: xc/include/extensions/xf86rush.h,v 1.5 2003/11/17 22:20:04 dawes Exp $ */ /* Copyright (c) 1998 Daryll Strauss @@ -34,62 +34,47 @@ _XFUNCPROTOBEGIN Bool XF86RushQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* majorVersion */, int* /* minorVersion */ -#endif ); Bool XF86RushQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* event_base */, int* /* error_base */ -#endif ); Bool XF86RushLockPixmap( -#if NeedFunctionPrototypes Display * /* dpy */, int /* screen */, Pixmap /* Pixmap */, void ** /* Return address */ -#endif ); Bool XF86RushUnlockPixmap( -#if NeedFunctionPrototypes Display * /* dpy */, int /* screen */, Pixmap /* Pixmap */ -#endif ); Bool XF86RushUnlockAllPixmaps( -#if NeedFunctionPrototypes Display * /* dpy */ -#endif ); Bool XF86RushSetCopyMode( -#if NeedFunctionPrototypes Display * /* dpy */, int /* screen */, int /* copy mode */ -#endif ); Bool XF86RushSetPixelStride( -#if NeedFunctionPrototypes Display * /* dpy */, int /* screen */, int /* pixel stride */ -#endif ); Bool XF86RushOverlayPixmap( -#if NeedFunctionPrototypes Display * /* dpy */, XvPortID /* port */, Drawable /* d */, @@ -104,28 +89,21 @@ unsigned int /* dest_w */, unsigned int /* dest_h */, unsigned int /* id */ -#endif ); int XF86RushStatusRegOffset( -#if NeedFunctionPrototypes Display * /* dpy */, int /* screen */ -#endif ); Bool XF86RushAT3DEnableRegs( -#if NeedFunctionPrototypes Display * /* dpy */, int /* screen */ -#endif ); Bool XF86RushAT3DDisableRegs( -#if NeedFunctionPrototypes Display * /* dpy */, int /* screen */ -#endif ); _XFUNCPROTOEND Index: xc/include/fonts/FS.h diff -u xc/include/fonts/FS.h:1.8 xc/include/fonts/FS.h:1.10 --- xc/include/fonts/FS.h:1.8 Fri Dec 14 14:53:31 2001 +++ xc/include/fonts/FS.h Fri Jul 18 11:53:24 2003 @@ -50,7 +50,7 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/fonts/FS.h,v 1.8 2001/12/14 19:53:31 dawes Exp $ */ +/* $XFree86: xc/include/fonts/FS.h,v 1.10 2003/07/18 15:53:24 tsi Exp $ */ #ifndef _FS_H_ #define _FS_H_ @@ -66,6 +66,7 @@ #define FamilyInternet 0 #define FamilyDECnet 1 #define FamilyChaos 2 +#define FamilyInternet6 6 typedef unsigned int FSDrawDirection; Index: xc/lib/Imakefile diff -u xc/lib/Imakefile:3.73 xc/lib/Imakefile:3.75 --- xc/lib/Imakefile:3.73 Tue Jan 28 17:07:30 2003 +++ xc/lib/Imakefile Tue Aug 12 19:47:06 2003 @@ -3,7 +3,7 @@ -XCOMM $XFree86: xc/lib/Imakefile,v 3.73 2003/01/28 22:07:30 alanh Exp $ +XCOMM $XFree86: xc/lib/Imakefile,v 3.75 2003/08/12 23:47:06 torrey Exp $ #define IHaveSubdirs #define PassCDebugFlags @@ -32,14 +32,6 @@ THRSTUBLIBDIR = XThrStub #endif -#if BuildXIElib -XIELIBDIR = XIE -#endif - -#if BuildPexLib -PEX5LIBDIR = PEX5 -#endif - #if BuildXInputLib XINPUTLIBDIR = Xi #endif @@ -137,6 +129,10 @@ XTRAPLIBDIR = XTrap #endif +#if BuildAppleWMLibrary +APPLELIBDIR = apple +#endif + XF86EXTLIBS = $(XF86MISCLIBDIR) $(XF86VMLIBDIR) \ $(XF86DGALIBDIR) $(XF86RUSHLIBDIR) @@ -204,15 +200,15 @@ $(OLDXLIBDIR) $(ICELIBDIR) $(SMLIBDIR) $(XEXTLIBDIR) $(XTLIBDIR) \ $(SSLIBDIR) $(XF86MISCLIBDIR) $(XF86VMLIBDIR) $(XF86DGALIBDIR) \ $(XF86RUSHLIBDIR) $(XMULIBDIR) $(XMUULIBDIR) $(XPMLIBDIR) \ - $(XAW6LIBDIR) $(XAWLIBDIR) $(XIELIBDIR) $(XINPUTLIBDIR) \ - $(XTSTLIBDIR) $(FSLIBDIR) $(PEX5LIBDIR) $(XKBLIBDIR) \ + $(XAW6LIBDIR) $(XAWLIBDIR) $(XINPUTLIBDIR) \ + $(XTSTLIBDIR) $(FSLIBDIR) $(XKBLIBDIR) \ $(XKBUILIBDIR) $(LBXUTILDIR) $(XALIBDIR) $(XPRINTLIBDIR) \ $(XVLIBDIR) $(GLXLIBDIR) $(GLULIBDIR) $(GLWLIBDIR) \ $(DPSLIBDIR) $(DPSTKLIBDIR) $(PSRESLIBDIR) $(XINERAMADIR) \ $(ZLIBDIR) $(REGEXDIR) $(RENDERLIBDIR) $(FREETYPE2BUILDDIR) \ $(LIBXML2BUILDDIR) $(EXPATBUILDDIR) $(FONTCONFIGBUILDDIR) \ $(XFT1LIBDIR) $(XFTLIBDIR) $(XVMCLIBDIR) $(RANDRLIBDIR) \ - $(XTRAPLIBDIR) $(XRESLIBDIR) $(XCURSORLIBDIR) + $(XTRAPLIBDIR) $(XRESLIBDIR) $(XCURSORLIBDIR) $(APPLELIBDIR) SUBDIRS = $(BERKDIR) xtrans $(LINTSUBDIRS) $(FONTSUBDIR) $(FONTENCSUBDIR) \ $(FONTCACHELIBDIR) Index: xc/lib/FS/FS-def.cpp diff -u /dev/null xc/lib/FS/FS-def.cpp:1.1 --- /dev/null Sat Feb 28 21:41:09 2004 +++ xc/lib/FS/FS-def.cpp Wed Oct 15 17:18:50 2003 @@ -0,0 +1,38 @@ +LIBRARY FS +VERSION LIBRARY_VERSION +EXPORTS + FSErrorList DATA + FSErrorListSize DATA + FSCloseFont + FSCloseServer + FSFlush + FSFree + FSFreeCatalogues + FSFreeExtensionList + FSFreeFontNames + FSGetCatalogues + FSGetErrorDatabaseText + FSGetErrorText + FSListCatalogues + FSListExtensions + FSListFonts + FSListFontsWithXInfo + FSMalloc + FSMaxRequestSize + FSNextEvent + FSOpenBitmapFont + FSOpenServer + FSQueryExtension + FSQueryXBitmaps16 + FSQueryXBitmaps8 + FSQueryXExtents16 + FSQueryXExtents8 + FSQueryXInfo + FSServerName + FSSetAfterFunction + FSSetCatalogues + FSSetErrorHandler + FSSetIOErrorHandler + FSSync + FSSynchronize +/* $XFree86: xc/lib/FS/FS-def.cpp,v 1.1 2003/10/15 21:18:50 herrb Exp $ */ Index: xc/lib/FS/FSFontInfo.c diff -u xc/lib/FS/FSFontInfo.c:1.2 xc/lib/FS/FSFontInfo.c:1.6 --- xc/lib/FS/FSFontInfo.c:1.2 Fri Dec 14 14:53:32 2001 +++ xc/lib/FS/FSFontInfo.c Mon Dec 22 12:48:02 2003 @@ -23,6 +23,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ +/* $XFree86: xc/lib/FS/FSFontInfo.c,v 1.6 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -65,7 +66,7 @@ long nbytes; int i, j; - int size = 0; + size_t size = 0; FSXFontInfoHeader **fhdr = (FSXFontInfoHeader **) 0; FSPropInfo **pi = (FSPropInfo **) 0; FSPropOffset **po = (FSPropOffset **) 0; @@ -123,8 +124,14 @@ if (reply.nameLength == 0) /* got last reply in version 1 */ break; if ((i + reply.nReplies) >= size) { + + if (reply.nReplies > SIZE_MAX - i - 1) + goto badmem; size = i + reply.nReplies + 1; + if (size > SIZE_MAX / sizeof(char *)) + goto badmem; + if (fhdr) { FSXFontInfoHeader **tmp_fhdr = (FSXFontInfoHeader **) FSrealloc((char *) fhdr, @@ -237,6 +244,11 @@ pi[i]->num_offsets = local_pi.num_offsets; pi[i]->data_len = local_pi.data_len; +#if SIZE_MAX <= UINT_MAX + if (pi[i]->num_offsets > SIZE_MAX / sizeof(FSPropOffset)) + goto badmem; +#endif + po[i] = (FSPropOffset *) FSmalloc(pi[i]->num_offsets * sizeof(FSPropOffset)); if (!po[i]) { @@ -282,6 +294,10 @@ nbytes = pi[i]->data_len + reply.nameLength; _FSEatData(svr, (unsigned long) (((nbytes+3)&~3) - nbytes)); } + /* avoid integer overflow */ + if (i > INT_MAX - 1) { + goto badmem; + } } *info = fhdr; *count = i; Index: xc/lib/FS/FSFtNames.c diff -u xc/lib/FS/FSFtNames.c:1.2 xc/lib/FS/FSFtNames.c:1.7 --- xc/lib/FS/FSFtNames.c:1.2 Fri Dec 14 14:53:32 2001 +++ xc/lib/FS/FSFtNames.c Mon Dec 22 12:48:02 2003 @@ -1,5 +1,4 @@ /* $Xorg: FSFtNames.c,v 1.4 2001/02/09 02:03:25 xorgcvs Exp $ */ - /* * Copyright 1990 Network Computing Devices; * Portions Copyright 1987 by Digital Equipment Corporation @@ -24,6 +23,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ +/* $XFree86: xc/lib/FS/FSFtNames.c,v 1.7 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -78,7 +78,12 @@ (SIZEOF(fsListFontsReply) - SIZEOF(fsGenericReply)) >> 2, fsFalse)) return (char **) 0; - if (rep.nFonts) { + if (rep.nFonts +#if (SIZE_MAX >> 2) <= UINT_MAX + && rep.nFonts <= SIZE_MAX / sizeof(char *) + && rep.length <= (SIZE_MAX >> 2) +#endif + ) { flist = (char **) FSmalloc((unsigned) rep.nFonts * sizeof(char *)); rlen = (rep.length << 2) - SIZEOF(fsListFontsReply); c = (char *) FSmalloc((unsigned) (rlen + 1)); Index: xc/lib/FS/FSGetCats.c diff -u xc/lib/FS/FSGetCats.c:1.2 xc/lib/FS/FSGetCats.c:1.7 --- xc/lib/FS/FSGetCats.c:1.2 Fri Dec 14 14:53:32 2001 +++ xc/lib/FS/FSGetCats.c Mon Dec 22 12:48:02 2003 @@ -1,5 +1,4 @@ /* $Xorg: FSGetCats.c,v 1.4 2001/02/09 02:03:25 xorgcvs Exp $ */ - /* * Copyright 1990 Network Computing Devices; * Portions Copyright 1987 by Digital Equipment Corporation @@ -24,6 +23,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ +/* $XFree86: xc/lib/FS/FSGetCats.c,v 1.7 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -72,9 +72,14 @@ SyncHandle(); return (char **) NULL; } - if (rep.num_catalogues) { + if (rep.num_catalogues +#if (SIZE_MAX >> 2) <= UINT_MAX + && rep.num_catalogues <= SIZE_MAX/sizeof(char *) + && rep.length <= (SIZE_MAX >> 2) +#endif + ) { list = (char **) - FSmalloc((unsigned) (rep.num_catalogues * sizeof(char *))); + FSmalloc((unsigned) (rep.num_catalogues * sizeof(char *))); rlen = (rep.length << 2) - SIZEOF(fsGetCataloguesReply); c = (char *) FSmalloc((unsigned) rlen + 1); if ((!list) || (!c)) { Index: xc/lib/FS/FSListCats.c diff -u xc/lib/FS/FSListCats.c:1.2 xc/lib/FS/FSListCats.c:1.7 --- xc/lib/FS/FSListCats.c:1.2 Fri Dec 14 14:53:32 2001 +++ xc/lib/FS/FSListCats.c Mon Dec 22 12:48:02 2003 @@ -1,5 +1,4 @@ /* $Xorg: FSListCats.c,v 1.4 2001/02/09 02:03:25 xorgcvs Exp $ */ - /* * Copyright 1990 Network Computing Devices; * Portions Copyright 1987 by Digital Equipment Corporation @@ -24,6 +23,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ +/* $XFree86: xc/lib/FS/FSListCats.c,v 1.7 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -78,7 +78,12 @@ (SIZEOF(fsListCataloguesReply) - SIZEOF(fsGenericReply)) >> 2, fsFalse)) return (char **) 0; - if (rep.num_catalogues) { + if (rep.num_catalogues +#if (SIZE_MAX >> 2) <= UINT_MAX + && rep.num_catalogues <= SIZE_MAX/sizeof(char *) + && rep.length <= (SIZE_MAX>>2) +#endif + ) { clist = (char **) FSmalloc((unsigned) rep.num_catalogues * sizeof(char *)); rlen = (rep.length << 2) - SIZEOF(fsListCataloguesReply); Index: xc/lib/FS/FSListExt.c diff -u xc/lib/FS/FSListExt.c:1.2 xc/lib/FS/FSListExt.c:1.7 --- xc/lib/FS/FSListExt.c:1.2 Fri Dec 14 14:53:32 2001 +++ xc/lib/FS/FSListExt.c Mon Dec 22 12:48:02 2003 @@ -24,6 +24,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ +/* $XFree86: xc/lib/FS/FSListExt.c,v 1.7 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -72,7 +73,12 @@ SyncHandle(); return (char **) NULL; } - if (rep.nExtensions) { + if (rep.nExtensions +#if (SIZE_MAX >> 2) <= UINT_MAX + && rep.nExtensions <= SIZE_MAX / sizeof(char *) + && rep.length <= (SIZE_MAX>>2) +#endif + ) { list = (char **) FSmalloc((unsigned)(rep.nExtensions * sizeof(char *))); rlen = (rep.length << 2) - SIZEOF(fsListExtensionsReply); c = (char *) FSmalloc((unsigned) rlen + 1); Index: xc/lib/FS/FSOpenFont.c diff -u xc/lib/FS/FSOpenFont.c:1.6 xc/lib/FS/FSOpenFont.c:1.7 --- xc/lib/FS/FSOpenFont.c:1.6 Fri Dec 14 14:53:33 2001 +++ xc/lib/FS/FSOpenFont.c Mon Dec 22 12:48:02 2003 @@ -24,7 +24,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ -/* $XFree86: xc/lib/FS/FSOpenFont.c,v 1.6 2001/12/14 19:53:33 dawes Exp $ */ +/* $XFree86: xc/lib/FS/FSOpenFont.c,v 1.7 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -62,7 +62,7 @@ char *name; Font *otherid; { - unsigned char nbytes; + unsigned int nbytes; fsOpenBitmapFontReq *req; fsOpenBitmapFontReply reply; Font fid; Index: xc/lib/FS/FSOpenServ.c diff -u xc/lib/FS/FSOpenServ.c:1.6 xc/lib/FS/FSOpenServ.c:1.9 --- xc/lib/FS/FSOpenServ.c:1.6 Fri Dec 14 14:53:33 2001 +++ xc/lib/FS/FSOpenServ.c Mon Dec 22 12:48:02 2003 @@ -24,7 +24,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ -/* $XFree86: xc/lib/FS/FSOpenServ.c,v 1.6 2001/12/14 19:53:33 dawes Exp $ */ +/* $XFree86: xc/lib/FS/FSOpenServ.c,v 1.9 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -118,7 +118,7 @@ AlternateServer *alts; int altlen; char *vendor_string; - long setuplength; + unsigned long setuplength; if (server == NULL || *server == '\0') { if ((server = getenv("FONTSERVER")) == NULL) { @@ -153,7 +153,8 @@ _FSRead(svr, (char *) &prefix, (long) SIZEOF(fsConnSetup)); setuplength = prefix.alternate_len << 2; - if ((alt_data = (char *) + if (setuplength > (SIZE_MAX>>2) + || (alt_data = (char *) (setup = FSmalloc((unsigned) setuplength))) == NULL) { errno = ENOMEM; FSfree((char *) svr); @@ -162,10 +163,20 @@ _FSRead(svr, (char *) alt_data, setuplength); ad = alt_data; +#if SIZE_MAX <= UINT_MAX + if (prefix.num_alternates > SIZE_MAX / sizeof(AlternateServer)) { + errno = ENOMEM; + FSfree((char *) alt_data); + FSfree((char *) svr); + return (FSServer *) 0; + } +#endif + alts = (AlternateServer *) FSmalloc(sizeof(AlternateServer) * prefix.num_alternates); if (!alts) { errno = ENOMEM; + FSfree((char *) alt_data); FSfree((char *) svr); return (FSServer *) 0; } @@ -193,9 +204,11 @@ svr->num_alternates = prefix.num_alternates; setuplength = prefix.auth_len << 2; - if ((auth_data = (char *) + if (setuplength > (SIZE_MAX>>2) + || (auth_data = (char *) (setup = FSmalloc((unsigned) setuplength))) == NULL) { errno = ENOMEM; + FSfree((char *) alts); FSfree((char *) svr); return (FSServer *) NULL; } @@ -204,6 +217,7 @@ if (prefix.status != AuthSuccess) { fprintf(stderr, "%s: connection to \"%s\" refused by server\r\n%s: ", "FSlib", server, "FSlib"); + FSfree((char *) alts); FSfree((char *) svr); FSfree(setup); return (FSServer *) NULL; @@ -214,6 +228,8 @@ if ((vendor_string = (char *) FSmalloc((unsigned) conn.vendor_len + 1)) == NULL) { errno = ENOMEM; + FSfree((char *) auth_data); + FSfree((char *) alts); FSfree((char *) svr); return (FSServer *) NULL; } @@ -270,4 +286,3 @@ return (svr); } - Index: xc/lib/FS/FSQGlyphs.c diff -u xc/lib/FS/FSQGlyphs.c:1.2 xc/lib/FS/FSQGlyphs.c:1.6 --- xc/lib/FS/FSQGlyphs.c:1.2 Fri Dec 14 14:53:33 2001 +++ xc/lib/FS/FSQGlyphs.c Mon Dec 22 12:48:02 2003 @@ -1,5 +1,4 @@ /* $Xorg: FSQGlyphs.c,v 1.4 2001/02/09 02:03:25 xorgcvs Exp $ */ - /* * Copyright 1990 Network Computing Devices; * Portions Copyright 1987 by Digital Equipment Corporation @@ -24,6 +23,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ +/* $XFree86: xc/lib/FS/FSQGlyphs.c,v 1.6 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -85,10 +85,22 @@ (SIZEOF(fsQueryXBitmaps8Reply) - SIZEOF(fsGenericReply)) >> 2, fsFalse)) return FSBadAlloc; +#if SIZE_MAX <= UINT_MAX + if (reply.num_chars > SIZE_MAX / sizeof(FSOffset)) + return FSBadAlloc; +#endif + offs = (FSOffset *) FSmalloc(sizeof(FSOffset) * reply.num_chars); *offsets = offs; if (!offs) return FSBadAlloc; +#if (SIZE_MAX >> 2) <= UINT_MAX + /* XXX This thest is incomplete */ + if (reply.length > (SIZE_MAX >> 2)) { + FSfree((char *) offs); + return FSBadAlloc; + } +#endif left = (reply.length << 2) - SIZEOF(fsQueryXBitmaps8Reply) - (SIZEOF(fsOffset32) * reply.num_chars); gd = (unsigned char *) FSmalloc(left); @@ -141,6 +153,8 @@ int i; fsChar2b_version1 *swapped_str; + if (str_len > SIZE_MAX/SIZEOF(fsChar2b_version1)) + return FSBadAlloc; swapped_str = (fsChar2b_version1 *) FSmalloc(SIZEOF(fsChar2b_version1) * str_len); if (!swapped_str) @@ -160,10 +174,21 @@ fsFalse)) return FSBadAlloc; +#if SIZE_MAX <= UINT_MAX + if(reply.num_chars > SIZE_MAX/sizeof(FSOffset)) + return FSBadAlloc; +#endif offs = (FSOffset *) FSmalloc(sizeof(FSOffset) * reply.num_chars); *offsets = offs; if (!offs) return FSBadAlloc; +#if (SIZE_MAX >> 2) <= UINT_MAX + /* XXX - this test is incomplete */ + if (reply.length > (SIZE_MAX>>2)) { + FSfree((char *) offs); + return FSBadAlloc; + } +#endif left = (reply.length << 2) - SIZEOF(fsQueryXBitmaps16Reply) - (SIZEOF(fsOffset32) * reply.num_chars); gd = (unsigned char *) FSmalloc(left); Index: xc/lib/FS/FSQXExt.c diff -u xc/lib/FS/FSQXExt.c:1.5 xc/lib/FS/FSQXExt.c:1.8 --- xc/lib/FS/FSQXExt.c:1.5 Fri Dec 14 14:53:33 2001 +++ xc/lib/FS/FSQXExt.c Mon Dec 22 12:48:02 2003 @@ -24,7 +24,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ -/* $XFree86: xc/lib/FS/FSQXExt.c,v 1.5 2001/12/14 19:53:33 dawes Exp $ */ +/* $XFree86: xc/lib/FS/FSQXExt.c,v 1.8 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -92,6 +92,11 @@ (SIZEOF(fsQueryXExtents8Reply) - SIZEOF(fsGenericReply)) >> 2, fsFalse)) return FSBadAlloc; + +#if SIZE_MAX <= UINT_MAX + if (reply.num_extents > SIZE_MAX / sizeof(FSXCharInfo)) + return FSBadAlloc; +#endif ext = (FSXCharInfo *) FSmalloc(sizeof(FSXCharInfo) * reply.num_extents); *extents = ext; @@ -149,6 +154,11 @@ fsFalse)) return FSBadAlloc; +#if SIZE_MAX <= UINT_MAX + if (reply.num_extents > SIZE_MAX/sizeof(FSXCharInfo)) + return FSBadAlloc; +#endif + ext = (FSXCharInfo *) FSmalloc(sizeof(FSXCharInfo) * reply.num_extents); *extents = ext; if (!ext) Index: xc/lib/FS/FSQXInfo.c diff -u xc/lib/FS/FSQXInfo.c:1.2 xc/lib/FS/FSQXInfo.c:1.6 --- xc/lib/FS/FSQXInfo.c:1.2 Fri Dec 14 14:53:33 2001 +++ xc/lib/FS/FSQXInfo.c Mon Dec 22 12:48:02 2003 @@ -1,5 +1,4 @@ /* $Xorg: FSQXInfo.c,v 1.4 2001/02/09 02:03:25 xorgcvs Exp $ */ - /* * Copyright 1990 Network Computing Devices; * Portions Copyright 1987 by Digital Equipment Corporation @@ -24,6 +23,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ +/* $XFree86: xc/lib/FS/FSQXInfo.c,v 1.6 2003/12/22 17:48:02 tsi Exp $ */ /* @@ -91,6 +91,11 @@ props->num_offsets = local_pi.num_offsets; props->data_len = local_pi.data_len; +#if SIZE_MAX <= UINT_MAX + if (props->num_offsets > SIZE_MAX / sizeof(FSPropOffset)) + return FSBadAlloc; +#endif + /* prepare for prop data */ offset_data = (FSPropOffset *) FSmalloc(props->num_offsets * sizeof(FSPropOffset)); Index: xc/lib/FS/FSlibInt.c diff -u xc/lib/FS/FSlibInt.c:3.10 xc/lib/FS/FSlibInt.c:3.11 --- xc/lib/FS/FSlibInt.c:3.10 Fri Dec 14 14:53:33 2001 +++ xc/lib/FS/FSlibInt.c Fri May 23 10:38:26 2003 @@ -50,7 +50,7 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/FS/FSlibInt.c,v 3.10 2001/12/14 19:53:33 dawes Exp $ */ +/* $XFree86: xc/lib/FS/FSlibInt.c,v 3.11 2003/05/23 14:38:26 tsi Exp $ */ /* * FSlibInt.c - Internal support routines for the C subroutine @@ -497,12 +497,15 @@ if (bytes_read > 0) { size -= bytes_read; - if ((iov[0].iov_len -= bytes_read) < 0) { - iov[1].iov_len += iov[0].iov_len; - iov[1].iov_base = (char *)iov[1].iov_base - iov[0].iov_len; + if (iov[0].iov_len < bytes_read) { + iov[1].iov_len += iov[0].iov_len - bytes_read; + iov[1].iov_base = + (char *)iov[1].iov_base +bytes_read - iov[0].iov_len; iov[0].iov_len = 0; - } else + } else { + iov[0].iov_len -= bytes_read; iov[0].iov_base = (char *)iov[0].iov_base + bytes_read; + } } else if (ETEST()) { _FSWaitForReadable(svr); Index: xc/lib/FS/FSlibint.h diff -u xc/lib/FS/FSlibint.h:3.7 xc/lib/FS/FSlibint.h:3.9 --- xc/lib/FS/FSlibint.h:3.7 Fri Dec 14 14:53:33 2001 +++ xc/lib/FS/FSlibint.h Mon Sep 1 16:50:09 2003 @@ -50,7 +50,7 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/FS/FSlibint.h,v 3.7 2001/12/14 19:53:33 dawes Exp $ */ +/* $XFree86: xc/lib/FS/FSlibint.h,v 3.9 2003/09/01 20:50:09 herrb Exp $ */ /* * FSlib internal decls Index: xc/lib/FS/FSlibos.h diff -u xc/lib/FS/FSlibos.h:3.9 xc/lib/FS/FSlibos.h:3.11 --- xc/lib/FS/FSlibos.h:3.9 Fri May 31 14:45:39 2002 +++ xc/lib/FS/FSlibos.h Thu Dec 18 21:05:37 2003 @@ -50,7 +50,7 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/FS/FSlibos.h,v 3.9 2002/05/31 18:45:39 dawes Exp $ */ +/* $XFree86: xc/lib/FS/FSlibos.h,v 3.11 2003/12/19 02:05:37 dawes Exp $ */ /* * FSlib networking & os include file @@ -61,6 +61,10 @@ #ifndef WIN32 +#if defined(SCO) || defined(__USLC__) +#include /* For SIZE_MAX */ +#endif + /* * makedepend screws up on #undef OPEN_MAX, so we define a new symbol */ @@ -76,6 +80,13 @@ #undef _POSIX_SOURCE #endif #endif +#ifndef SIZE_MAX +# ifdef ULONG_MAX +# define SIZE_MAX ULONG_MAX +# else +# define SIZE_MAX UINT_MAX +# endif +#endif #ifndef OPEN_MAX #ifdef SVR4 #define OPEN_MAX 256 Index: xc/lib/GL/Imakefile diff -u xc/lib/GL/Imakefile:1.41 xc/lib/GL/Imakefile:1.44 --- xc/lib/GL/Imakefile:1.41 Fri Nov 22 17:55:57 2002 +++ xc/lib/GL/Imakefile Sun Sep 28 16:14:58 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/Imakefile,v 1.41 2002/11/22 22:55:57 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/Imakefile,v 1.44 2003/09/28 20:14:58 alanh Exp $ XCOMM XCOMM Imake tokens which are significant to building libGL: @@ -98,6 +98,10 @@ DRIVERDIRS = mesa/src/drv #endif +#if defined(DarwinArchitecture) && BuildAppleDRI + DRIDIRS = apple +#endif + /* * The build order depends on whether the drivers are loaded into libGL or * built-in to libGL. In the former case, libGL needs to be built before Index: xc/lib/GL/GL/GL-def.cpp diff -u xc/lib/GL/GL/GL-def.cpp:1.1 xc/lib/GL/GL/GL-def.cpp:1.3 --- xc/lib/GL/GL/GL-def.cpp:1.1 Thu Mar 22 16:47:56 2001 +++ xc/lib/GL/GL/GL-def.cpp Tue Nov 11 19:10:24 2003 @@ -310,15 +310,24 @@ ; glBlendEquationEXT @ 307 ; glBlendColorEXT @ 308 glPolygonOffset @ 309 +#ifndef __UNIXOS2__ ; glVertexPointerEXT @ 310 ; glNormalPointerEXT @ 311 +#else + glVertexPointerEXT @ 310 + glNormalPointerEXT @ 311 +#endif ; glColorPointerEXT @ 312 ; glIndexPointerEXT @ 313 ; glTexCoordPointerEXT @ 314 ; glEdgeFlagPointerEXT @ 315 ; glGetPointervEXT @ 316 ; glArrayElementEXT @ 317 +#ifndef __UNIXOS2__ ; glDrawArraysEXT @ 318 +#else + glDrawArraysEXT @ 318 +#endif ; OSMesaCreateContext @ 319 ; OSMesaDestroyContext @ 320 ; OSMesaMakeCurrent @ 321 @@ -377,7 +386,11 @@ glCopyTexSubImage2D @ 376 ; glWindowPos2iMESA @ 377 ; glWindowPos2sMESA @ 378 +#ifndef __UNIXOS2__ ; glWindowPos2fMESA @ 379 +#else + glWindowPos2fMESA @ 379 +#endif ; glWindowPos2dMESA @ 380 ; glWindowPos2ivMESA @ 381 ; glWindowPos2svMESA @ 382 @@ -399,7 +412,11 @@ ; glWindowPos4svMESA @ 398 ; glWindowPos4fvMESA @ 399 ; glWindowPos4dvMESA @ 400 +#ifndef __UNIXOS2__ ; glXCreateGLXPixmapMESA @ 401 +#else + glXCreateGLXPixmapMESA @ 401 +#endif ; glXReleaseBuffersMESA @ 402 ; OSMesaGetCurrentContext @ 403 ; OSMesaPixelStore @ 404 @@ -420,12 +437,59 @@ glXGetCurrentDisplay @ 454 glXImportContextEXT @ 455 glXQueryContextInfoEXT @ 456 +#ifndef __UNIXOS2__ glXGetCurrentDrawableEXT @ 457 +#endif glCopyTexSubImage3D @ 458 glDrawRangeElements @ 459 glTexSubImage3D @ 460 glBlendColorEXT @ 461 glBlendEquationEXT @ 462 glTexImage3D @ 463 +#ifdef __UNIXOS2__ + _glapi_Context @ 500 + _glapi_Dispatch @ 501 + glMultiTexCoord1svARB @ 502 + glMultiTexCoord1ivARB @ 503 + glMultiTexCoord1fvARB @ 504 + glMultiTexCoord1dvARB @ 505 + glMultiTexCoord2svARB @ 506 + glMultiTexCoord2ivARB @ 507 + glMultiTexCoord2fvARB @ 508 + glMultiTexCoord2dvARB @ 509 + glMultiTexCoord3svARB @ 510 + glMultiTexCoord3ivARB @ 511 + glMultiTexCoord3fvARB @ 512 + glMultiTexCoord3dvARB @ 513 + glMultiTexCoord4svARB @ 514 + glMultiTexCoord4ivARB @ 515 + glMultiTexCoord4fvARB @ 516 + glMultiTexCoord4dvARB @ 517 + glMultiTexCoord1fARB @ 518 + glMultiTexCoord2fARB @ 519 + glMultiTexCoord3fARB @ 520 + glMultiTexCoord4fARB @ 521 + _glapi_set_dispatch @ 522 + _glapi_noop_enable_warnings @ 523 + _glapi_add_entrypoint @ 524 + _glapi_get_dispatch_table_size @ 525 + _glapi_check_multithread @ 526 + _glapi_set_context @ 527 + _glapi_get_context @ 528 + glColorTable @ 529 + glColorSubTable @ 530 + glConvolutionFilter1D @ 531 + glConvolutionFilter2D @ 532 + glXGetProcAddressARB @ 533 + glLockArraysEXT @ 534 + glUnlockArraysEXT @ 535 + glActiveTextureARB @ 536 + glColorTableEXT @ 537 + glPointParameterfEXT @ 538 + glPointParameterfvEXT @ 539 + glXMakeContextCurrent @ 540 + _glapi_get_proc_address + _glapi_set_warning_func +#endif -/* $XFree86: xc/lib/GL/GL/GL-def.cpp,v 1.1 2001/03/22 21:47:56 dawes Exp $ */ +/* $XFree86: xc/lib/GL/GL/GL-def.cpp,v 1.3 2003/11/12 00:10:24 dawes Exp $ */ Index: xc/lib/GL/GL/Imakefile diff -u xc/lib/GL/GL/Imakefile:1.16 xc/lib/GL/GL/Imakefile:1.24 --- xc/lib/GL/GL/Imakefile:1.16 Wed Dec 4 16:38:34 2002 +++ xc/lib/GL/GL/Imakefile Fri Feb 6 23:30:15 2004 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/GL/Imakefile,v 1.16 2002/12/04 21:38:34 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/GL/Imakefile,v 1.24 2004/02/07 04:30:15 dawes Exp $ #include @@ -46,7 +46,7 @@ NormalLintTarget($(PROFSRC)) #endif -#if BuildXF86DRI && defined(i386Architecture) +#if BuildXF86DRI && defined(i386Architecture) && MesaUseX86Asm GLAPI_OBJ = $(GLXLIBSRC)/glx/glapi_x86.o #endif @@ -71,11 +71,6 @@ MESADOBJS = $(COREMESADOBJS) $(MESA_ASM_DOBJS) MESAPOBJS = $(COREMESAPOBJS) $(MESA_ASM_POBJS) - DRIMESAOBJS = $(GLXLIBSRC)/mesa/dri/?*.o -DRIMESAUOBJS = $(GLXLIBSRC)/mesa/dri/unshared/?*.o -DRIMESADOBJS = $(GLXLIBSRC)/mesa/dri/debugger/?*.o -DRIMESAPOBJS = $(GLXLIBSRC)/mesa/dri/profiled/?*.o - #if GlxUseBuiltInDRIDriver #include "../mesa/src/drv/common/Imakefile.inc" #endif @@ -90,20 +85,20 @@ #define MesaDrvGammaBuildDir $(GLXLIBSRC)/mesa/src/drv/gamma/ #include "../mesa/src/drv/gamma/Imakefile.inc" - DRVOBJS = $(GAMMAOBJS) $(MESAOBJS) $(DRIMESAOBJS) $(DRMOBJS) - DRVUOBJS = $(GAMMAUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) $(DRMUOBJS) - DRVDOBJS = $(GAMMADOBJS) $(MESADOBJS) $(DRIMESADOBJS) $(DRMDOBJS) - DRVPOBJS = $(GAMMAPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) $(DRMPOBJS) + DRVOBJS = $(GAMMAOBJS) $(MESAOBJS) $(DRMOBJS) + DRVUOBJS = $(GAMMAUOBJS) $(MESAUOBJS) $(DRMUOBJS) + DRVDOBJS = $(GAMMADOBJS) $(MESADOBJS) $(DRMDOBJS) + DRVPOBJS = $(GAMMAPOBJS) $(MESAPOBJS) $(DRMPOBJS) #elif GlxBuiltInTdfx #define MesaDrvTdfxBuildDir $(GLXLIBSRC)/mesa/src/drv/tdfx/ #include "../mesa/src/drv/tdfx/Imakefile.inc" - DRVOBJS = $(TDFXOBJS) $(MESAOBJS) $(DRIMESAOBJS) $(DRMOBJS) - DRVUOBJS = $(TDFXUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) $(DRMUOBJS) - DRVDOBJS = $(TDFXDOBJS) $(MESADOBJS) $(DRIMESADOBJS) $(DRMDOBJS) - DRVPOBJS = $(TDFXPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) $(DRMPOBJS) + DRVOBJS = $(TDFXOBJS) $(MESAOBJS) $(DRMOBJS) + DRVUOBJS = $(TDFXUOBJS) $(MESAUOBJS) $(DRMUOBJS) + DRVDOBJS = $(TDFXDOBJS) $(MESADOBJS) $(DRMDOBJS) + DRVPOBJS = $(TDFXPOBJS) $(MESAPOBJS) $(DRMPOBJS) OTHERREQUIREDLIBS = -lglide3 -ldl @@ -112,89 +107,69 @@ #define MesaDrvI810BuildDir $(GLXLIBSRC)/mesa/src/drv/i810/ #include "../mesa/src/drv/i810/Imakefile.inc" - DRVOBJS = $(I810OBJS) $(COMMONOBJS) $(MESAOBJS) $(DRIMESAOBJS) \ - $(DRMOBJS) - DRVUOBJS = $(I810UOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) \ - $(DRMUOBJS) - DRVDOBJS = $(I810DOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRIMESADOBJS) \ - $(DRMDOBJS) - DRVPOBJS = $(I810POBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) \ - $(DRMPOBJS) + DRVOBJS = $(I810OBJS) $(COMMONOBJS) $(MESAOBJS) $(DRMOBJS) + DRVUOBJS = $(I810UOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRMUOBJS) + DRVDOBJS = $(I810DOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRMDOBJS) + DRVPOBJS = $(I810POBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRMPOBJS) #elif GlxBuiltInI830 #define MesaDrvI830BuildDir $(GLXLIBSRC)/mesa/src/drv/i830/ #include "../mesa/src/drv/i830/Imakefile.inc" - DRVOBJS = $(I830OBJS) $(COMMONOBJS) $(MESAOBJS) $(DRIMESAOBJS) \ - $(DRMOBJS) - DRVUOBJS = $(I830UOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) \ - $(DRMUOBJS) - DRVDOBJS = $(I830DOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRIMESADOBJS) \ - $(DRMDOBJS) - DRVPOBJS = $(I830POBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) \ - $(DRMPOBJS) + DRVOBJS = $(I830OBJS) $(COMMONOBJS) $(MESAOBJS) $(DRMOBJS) + DRVUOBJS = $(I830UOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRMUOBJS) + DRVDOBJS = $(I830DOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRMDOBJS) + DRVPOBJS = $(I830POBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRMPOBJS) #elif GlxBuiltInMga #define MesaDrvMgaBuildDir $(GLXLIBSRC)/mesa/src/drv/mga/ #include "../mesa/src/drv/mga/Imakefile.inc" - DRVOBJS = $(MGAOBJS) $(COMMONOBJS) $(MESAOBJS) $(DRIMESAOBJS) \ - $(DRMOBJS) - DRVUOBJS = $(MGAUOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) \ - $(DRMUOBJS) - DRVDOBJS = $(MGADOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRIMESADOBJS) \ - $(DRMDOBJS) - DRVPOBJS = $(MGAPOBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) \ - $(DRMPOBJS) + DRVOBJS = $(MGAOBJS) $(COMMONOBJS) $(MESAOBJS) $(DRMOBJS) + DRVUOBJS = $(MGAUOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRMUOBJS) + DRVDOBJS = $(MGADOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRMDOBJS) + DRVPOBJS = $(MGAPOBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRMPOBJS) #elif GlxBuiltInR128 #define MesaDrvR128BuildDir $(GLXLIBSRC)/mesa/src/drv/r128/ #include "../mesa/src/drv/r128/Imakefile.inc" - DRVOBJS = $(R128OBJS) $(COMMONOBJS) $(MESAOBJS) $(DRIMESAOBJS) \ - $(DRMOBJS) - DRVUOBJS = $(R128UOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) \ - $(DRMUOBJS) - DRVDOBJS = $(R128DOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRIMESADOBJS) \ - $(DRMDOBJS) - DRVPOBJS = $(R128POBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) \ - $(DRMPOBJS) + DRVOBJS = $(R128OBJS) $(COMMONOBJS) $(MESAOBJS) $(DRMOBJS) + DRVUOBJS = $(R128UOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRMUOBJS) + DRVDOBJS = $(R128DOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRMDOBJS) + DRVPOBJS = $(R128POBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRMPOBJS) #elif GlxBuiltInRadeon #define MesaDrvRadeonBuildDir $(GLXLIBSRC)/mesa/src/drv/radeon/ #include "../mesa/src/drv/radeon/Imakefile.inc" - DRVOBJS = $(RADEONOBJS) $(COMMONOBJS) $(MESAOBJS) $(DRIMESAOBJS) \ - $(DRMOBJS) - DRVUOBJS = $(RADEONUOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) \ - $(DRMUOBJS) - DRVDOBJS = $(RADEONDOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRIMESADOBJS) \ - $(DRMDOBJS) - DRVPOBJS = $(RADEONPOBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) \ - $(DRMPOBJS) + DRVOBJS = $(RADEONOBJS) $(COMMONOBJS) $(MESAOBJS) $(DRMOBJS) + DRVUOBJS = $(RADEONUOBJS) $(COMMONUOBJS) $(MESAUOBJS) $(DRMUOBJS) + DRVDOBJS = $(RADEONDOBJS) $(COMMONDOBJS) $(MESADOBJS) $(DRMDOBJS) + DRVPOBJS = $(RADEONPOBJS) $(COMMONPOBJS) $(MESAPOBJS) $(DRMPOBJS) #elif GlxBuiltInFfb #define MesaDrvFfbBuildDir $(GLXLIBSRC)/mesa/src/drv/ffb/ #include "../mesa/src/drv/ffb/Imakefile.inc" - DRVOBJS = $(FFBOBJS) $(MESAOBJS) $(DRIMESAOBJS) $(DRMOBJS) - DRVUOBJS = $(FFBUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) $(DRMUOBJS) - DRVDOBJS = $(FFBDOBJS) $(MESADOBJS) $(DRIMESADOBJS) $(DRMDOBJS) - DRVPOBJS = $(FFBPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) $(DRMPOBJS) + DRVOBJS = $(FFBOBJS) $(MESAOBJS) $(DRMOBJS) + DRVUOBJS = $(FFBUOBJS) $(MESAUOBJS) $(DRMUOBJS) + DRVDOBJS = $(FFBDOBJS) $(MESADOBJS) $(DRMDOBJS) + DRVPOBJS = $(FFBPOBJS) $(MESAPOBJS) $(DRMPOBJS) #elif GlxBuiltInSIS #define MesaDrvSisBuildDir $(GLXLIBSRC)/mesa/src/drv/sis/ #include "../mesa/src/drv/sis/Imakefile.inc" - DRVOBJS = $(SISOBJS) $(MESAOBJS) $(DRIMESAOBJS) $(DRMOBJS) - DRVUOBJS = $(SISUOBJS) $(MESAUOBJS) $(DRIMESAUOBJS) $(DRMUOBJS) - DRVDOBJS = $(SISDOBJS) $(MESADOBJS) $(DRIMESADOBJS) $(DRMDOBJS) - DRVPOBJS = $(SISPOBJS) $(MESAPOBJS) $(DRIMESAPOBJS) $(DRMPOBJS) + DRVOBJS = $(SISOBJS) $(MESAOBJS) $(DRMOBJS) + DRVUOBJS = $(SISUOBJS) $(MESAUOBJS) $(DRMUOBJS) + DRVDOBJS = $(SISDOBJS) $(MESADOBJS) $(DRMDOBJS) + DRVPOBJS = $(SISPOBJS) $(MESAPOBJS) $(DRMPOBJS) #elif GlxBuiltInXMesa @@ -213,14 +188,33 @@ #endif /* BuildXF86DRI */ +#if defined(DarwinArchitecture) && BuildAppleDRI + APPLEOBJS = appledri.o dri_dispatch.o dri_driver.o dri_glx.o x-list.o x-hash.o + DRIOBJS = $(APPLEOBJS:%.o=$(GLXLIBSRC)/apple/%.o) + DRIUOBJS = $(APPLEOBJS:%.o=$(GLXLIBSRC)/apple/unshared/%.o) + DRIDOBJS = $(APPLEOBJS:%.o=$(GLXLIBSRC)/apple/debugger/%.o) + DRIPOBJS = $(APPLEOBJS:%.o=$(GLXLIBSRC)/apple/profiled/%.o) + +NATIVE_GL = /System/Library/Frameworks/OpenGL.framework + +OTHERREQUIREDLIBS = \ + XpluginLibrary $(NATIVE_GL)/Libraries/libGL.dylib -sub_library libGL \ + -framework ApplicationServices -framework CoreFoundation \ + -framework OpenGL +#endif + +#if BuildXF86DRI && BuildXF86VidModeExt +VMODEREQUIREDLIBS = $(LDPRELIBS) $(XXF86VMLIB) +#endif + /* * Note: DRIDIRS is empty for !BuildXF86DRI, and DRVSUBDIRS is empty * for no built-in drivers. */ -REQUIREDLIBS = $(BASEREQUIREDLIBS) $(OTHERREQUIREDLIBS) +REQUIREDLIBS = $(OTHERREQUIREDLIBS) $(VMODEREQUIREDLIBS) $(BASEREQUIREDLIBS) - OBJS = $(GLXOBJS) $(DRIOBJS) $(DRVOBJS) + OBJS = $(GLXOBJS) $(DRIOBJS) $(DRVOBJS) #if HasSharedLibraries && !SharedLibGlxWithoutPIC UOBJS = $(GLXUOBJS) $(DRIUOBJS) $(DRVUOBJS) #else Index: xc/lib/GL/apple/Imakefile diff -u /dev/null xc/lib/GL/apple/Imakefile:1.3 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/Imakefile Fri Jan 16 19:38:12 2004 @@ -0,0 +1,53 @@ +XCOMM $XFree86: xc/lib/GL/apple/Imakefile,v 1.3 2004/01/17 00:38:12 torrey Exp $ + +#include + +#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) +#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) +#define DoExtraLib SharedLibGlx +#define DoDebugLib DebugLibGlx +#define DoProfileLib ProfileLibGlx + + XPRDIR = $(SERVERSRC)/hw/darwin/quartz/xpr + +LinkSourceFile(x-list.c,$(XPRDIR)) +LinkSourceFile(x-list.h,$(XPRDIR)) +LinkSourceFile(x-hash.c,$(XPRDIR)) +LinkSourceFile(x-hash.h,$(XPRDIR)) + +#if Malloc0ReturnsNull +ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL +#endif + +#if !GlxUseSGISI + DRI_SRCS = dri_glx.c dri_driver.c dri_dispatch.c x-hash.c x-list.c + DRI_OBJS = dri_glx.o dri_driver.o dri_dispatch.o x-hash.o x-list.o + DRI_INCS = -I. -I$(GLXLIBSRC)/glx -I$(INCLUDESRC) -I$(INCLUDESRC)/GL \ + -I$(XINCLUDESRC) -I$(SERVERSRC)/GL/dri -I$(XPINCDIR) \ + -I$(MESASRCDIR)/include -I$(MESASRCDIR)/src \ + -I$(GLXLIBSRC)/include +#endif + + AS = /System/Library/Frameworks/ApplicationServices.framework + + DEFINES = $(ALLOC_DEFINES) GlxDefines $(GLX_DEFS) -DXP_NO_X_HEADERS=1 + INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) $(DRI_INCS) \ + -F$(AS)/Frameworks + SRCS = appledri.c $(DRI_SRCS) + OBJS = appledri.o $(DRI_OBJS) + +/* We won't require this to run when building normally, just for updating. + Also, don't give it any dependences so make doesn't attempt to rebuild + it if the dates get screwed up. (It actually depends on build-dispatch + and dri_dispatch.defs) */ +dri_dispatch.h : + ./build-dispatch $@ + +#include + +LibraryObjectRule() + +SubdirLibraryRule($(OBJS)) +NormalLintTarget($(SRCS)) + +DependTarget() Index: xc/lib/GL/apple/appledri.c diff -u /dev/null xc/lib/GL/apple/appledri.c:1.1 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/appledri.c Sun Jun 29 21:45:10 2003 @@ -0,0 +1,302 @@ +/* $XFree86: xc/lib/GL/apple/appledri.c,v 1.1 2003/06/30 01:45:10 torrey Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Jens Owen + * Rickard E. (Rik) Faith + * + */ + +/* THIS IS NOT AN X CONSORTIUM STANDARD */ + +#define NEED_EVENTS +#define NEED_REPLIES +#include +#include "appledristr.h" +#include +#include "extutil.h" +#include + +static XExtensionInfo _appledri_info_data; +static XExtensionInfo *appledri_info = &_appledri_info_data; +static char *appledri_extension_name = APPLEDRINAME; + +#define AppleDRICheckExtension(dpy,i,val) \ + XextCheckExtension(dpy, i, appledri_extension_name, val) + +/***************************************************************************** + * * + * private utility routines * + * * + *****************************************************************************/ + +static int close_display(Display *dpy, XExtCodes *extCodes); +static Bool wire_to_event(); + +static /* const */ XExtensionHooks appledri_extension_hooks = { + NULL, /* create_gc */ + NULL, /* copy_gc */ + NULL, /* flush_gc */ + NULL, /* free_gc */ + NULL, /* create_font */ + NULL, /* free_font */ + close_display, /* close_display */ + wire_to_event, /* wire_to_event */ + NULL, /* event_to_wire */ + NULL, /* error */ + NULL, /* error_string */ +}; + +static XEXT_GENERATE_FIND_DISPLAY(find_display, appledri_info, + appledri_extension_name, + &appledri_extension_hooks, + AppleDRINumberEvents, NULL) + +static XEXT_GENERATE_CLOSE_DISPLAY(close_display, appledri_info) + +static void (*surface_notify_handler)(); + +void * +XAppleDRISetSurfaceNotifyHandler(void (*fun)()) +{ + void *old = surface_notify_handler; + surface_notify_handler = fun; + return old; +} + +static Bool wire_to_event(dpy, re, event) + Display *dpy; + XEvent *re; + xEvent *event; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRINotifyEvent *sevent; + + AppleDRICheckExtension(dpy, info, False); + + switch ((event->u.u.type & 0x7f) - info->codes->first_event) { + case AppleDRISurfaceNotify: + sevent = (xAppleDRINotifyEvent *) event; + if (surface_notify_handler != NULL) { + (*surface_notify_handler)(dpy, (unsigned int) sevent->arg, + (int) sevent->kind); + } + return False; + } + return False; +} + +/***************************************************************************** + * * + * public Apple-DRI Extension routines * + * * + *****************************************************************************/ + +#if 0 +#include +#define TRACE(msg) fprintf(stderr, "AppleDRI%s\n", msg); +#else +#define TRACE(msg) +#endif + + +Bool XAppleDRIQueryExtension(dpy, event_basep, error_basep) + Display *dpy; + int *event_basep, *error_basep; +{ + XExtDisplayInfo *info = find_display(dpy); + + TRACE("QueryExtension..."); + if (XextHasExtension(info)) { + *event_basep = info->codes->first_event; + *error_basep = info->codes->first_error; + TRACE("QueryExtension... return True"); + return True; + } else { + TRACE("QueryExtension... return False"); + return False; + } +} + +Bool XAppleDRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion) + Display* dpy; + int* majorVersion; + int* minorVersion; + int* patchVersion; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIQueryVersionReply rep; + xAppleDRIQueryVersionReq *req; + + TRACE("QueryVersion..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIQueryVersion, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIQueryVersion; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryVersion... return False"); + return False; + } + *majorVersion = rep.majorVersion; + *minorVersion = rep.minorVersion; + *patchVersion = rep.patchVersion; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryVersion... return True"); + return True; +} + +Bool XAppleDRIQueryDirectRenderingCapable(dpy, screen, isCapable) + Display* dpy; + int screen; + Bool* isCapable; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIQueryDirectRenderingCapableReply rep; + xAppleDRIQueryDirectRenderingCapableReq *req; + + TRACE("QueryDirectRenderingCapable..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIQueryDirectRenderingCapable, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIQueryDirectRenderingCapable; + req->screen = screen; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryDirectRenderingCapable... return False"); + return False; + } + *isCapable = rep.isCapable; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryDirectRenderingCapable... return True"); + return True; +} + +Bool XAppleDRIAuthConnection(dpy, screen, magic) + Display* dpy; + int screen; + unsigned int magic; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIAuthConnectionReq *req; + xAppleDRIAuthConnectionReply rep; + + TRACE("AuthConnection..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIAuthConnection, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIAuthConnection; + req->screen = screen; + req->magic = magic; + rep.authenticated = 0; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse) || !rep.authenticated) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("AuthConnection... return False"); + return False; + } + UnlockDisplay(dpy); + SyncHandle(); + TRACE("AuthConnection... return True"); + return True; +} + +Bool XAppleDRICreateSurface(dpy, screen, drawable, client_id, key, uid) + Display* dpy; + int screen; + Drawable drawable; + unsigned int client_id; + unsigned int *key; + unsigned int *uid; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRICreateSurfaceReply rep; + xAppleDRICreateSurfaceReq *req; + + TRACE("CreateSurface..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRICreateSurface, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRICreateSurface; + req->screen = screen; + req->drawable = drawable; + req->client_id = client_id; + rep.key_0 = rep.key_1 = rep.uid = 0; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse) || !rep.key_0) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateSurface... return False"); + return False; + } + key[0] = rep.key_0; + key[1] = rep.key_1; + *uid = rep.uid; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateSurface... return True"); + return True; +} + +Bool XAppleDRIDestroySurface(dpy, screen, drawable) + Display* dpy; + int screen; + Drawable drawable; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIDestroySurfaceReq *req; + + TRACE("DestroySurface..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIDestroySurface, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIDestroySurface; + req->screen = screen; + req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("DestroySurface... return True"); + return True; +} Index: xc/lib/GL/apple/appledri.h diff -u /dev/null xc/lib/GL/apple/appledri.h:1.2 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/appledri.h Thu Oct 30 21:22:12 2003 @@ -0,0 +1,106 @@ +/* $XFree86: xc/lib/GL/apple/appledri.h,v 1.2 2003/10/31 02:22:12 torrey Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Jens Owen + * Rickard E. (Rik) Faith + * + */ + +#ifndef _APPLEDRI_H_ +#define _APPLEDRI_H_ + +#include + +#define X_AppleDRIQueryVersion 0 +#define X_AppleDRIQueryDirectRenderingCapable 1 +#define X_AppleDRICreateSurface 2 +#define X_AppleDRIDestroySurface 3 +#define X_AppleDRIAuthConnection 4 +/* Requests up to and including 18 were used in a previous version */ + +/* Events */ +#define AppleDRIObsoleteEvent1 0 +#define AppleDRIObsoleteEvent2 1 +#define AppleDRIObsoleteEvent3 2 +#define AppleDRISurfaceNotify 3 +#define AppleDRINumberEvents 4 + +/* Errors */ +#define AppleDRIClientNotLocal 0 +#define AppleDRIOperationNotSupported 1 +#define AppleDRINumberErrors (AppleDRIOperationNotSupported + 1) + +/* Kinds of SurfaceNotify events: */ +#define AppleDRISurfaceNotifyChanged 0 +#define AppleDRISurfaceNotifyDestroyed 1 + +#ifndef _APPLEDRI_SERVER_ + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came frome a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* window of event */ + Time time; /* server timestamp when event happened */ + int kind; /* subtype of event */ + int arg; +} XAppleDRINotifyEvent; + +_XFUNCPROTOBEGIN + +Bool XAppleDRIQueryExtension (Display *dpy, int *event_base, int *error_base); + +Bool XAppleDRIQueryVersion (Display *dpy, int *majorVersion, + int *minorVersion, int *patchVersion); + +Bool XAppleDRIQueryDirectRenderingCapable (Display *dpy, int screen, + Bool *isCapable); + +void *XAppleDRISetSurfaceNotifyHandler (void (*fun) (Display *dpy, + unsigned uid, int kind)); + +Bool XAppleDRIAuthConnection (Display *dpy, int screen, unsigned int magic); + +Bool XAppleDRICreateSurface (Display *dpy, int screen, Drawable drawable, + unsigned int client_id, unsigned int key[2], + unsigned int* uid); + +Bool XAppleDRIDestroySurface (Display *dpy, int screen, Drawable drawable); + +Bool XAppleDRISynchronizeSurfaces (Display *dpy); + +_XFUNCPROTOEND + +#endif /* _APPLEDRI_SERVER_ */ +#endif /* _APPLEDRI_H_ */ Index: xc/lib/GL/apple/appledristr.h diff -u /dev/null xc/lib/GL/apple/appledristr.h:1.2 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/appledristr.h Mon Nov 17 17:20:05 2003 @@ -0,0 +1,174 @@ +/* $XFree86: xc/lib/GL/apple/appledristr.h,v 1.2 2003/11/17 22:20:05 dawes Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Jens Owen + * Rickard E. (Rik) Fiath + * + */ + +#ifndef _APPLEDRISTR_H_ +#define _APPLEDRISTR_H_ + +#include "appledri.h" + +#define APPLEDRINAME "Apple-DRI" + +#define APPLE_DRI_MAJOR_VERSION 1 /* current version numbers */ +#define APPLE_DRI_MINOR_VERSION 0 +#define APPLE_DRI_PATCH_VERSION 0 + +typedef struct _AppleDRIQueryVersion { + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIQueryVersion */ + CARD16 length B16; +} xAppleDRIQueryVersionReq; +#define sz_xAppleDRIQueryVersionReq 4 + +typedef struct { + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 majorVersion B16; /* major version of DRI protocol */ + CARD16 minorVersion B16; /* minor version of DRI protocol */ + CARD32 patchVersion B32; /* patch version of DRI protocol */ + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xAppleDRIQueryVersionReply; +#define sz_xAppleDRIQueryVersionReply 32 + +typedef struct _AppleDRIQueryDirectRenderingCapable { + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */ + CARD16 length B16; + CARD32 screen B32; +} xAppleDRIQueryDirectRenderingCapableReq; +#define sz_xAppleDRIQueryDirectRenderingCapableReq 8 + +typedef struct { + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + BOOL isCapable; + BOOL pad2; + BOOL pad3; + BOOL pad4; + CARD32 pad5 B32; + CARD32 pad6 B32; + CARD32 pad7 B32; + CARD32 pad8 B32; + CARD32 pad9 B32; +} xAppleDRIQueryDirectRenderingCapableReply; +#define sz_xAppleDRIQueryDirectRenderingCapableReply 32 + +typedef struct _AppleDRIAuthConnection { + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRICloseConnection */ + CARD16 length B16; + CARD32 screen B32; + CARD32 magic B32; +} xAppleDRIAuthConnectionReq; +#define sz_xAppleDRIAuthConnectionReq 12 + +typedef struct { + BYTE type; + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 authenticated B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xAppleDRIAuthConnectionReply; +#define zx_xAppleDRIAuthConnectionReply 32 + +typedef struct _AppleDRICreateSurface { + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRICreateSurface */ + CARD16 length B16; + CARD32 screen B32; + CARD32 drawable B32; + CARD32 client_id B32; +} xAppleDRICreateSurfaceReq; +#define sz_xAppleDRICreateSurfaceReq 16 + +typedef struct { + BYTE type; /* X_Reply */ + BOOL pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 key_0 B32; + CARD32 key_1 B32; + CARD32 uid B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xAppleDRICreateSurfaceReply; +#define sz_xAppleDRICreateSurfaceReply 32 + +typedef struct _AppleDRIDestroySurface { + CARD8 reqType; /* always DRIReqCode */ + CARD8 driReqType; /* always X_DRIDestroySurface */ + CARD16 length B16; + CARD32 screen B32; + CARD32 drawable B32; +} xAppleDRIDestroySurfaceReq; +#define sz_xAppleDRIDestroySurfaceReq 12 + +typedef struct _AppleDRINotify { + BYTE type; /* always eventBase + event type */ + BYTE kind; + CARD16 sequenceNumber B16; + Time time B32; /* time of change */ + CARD16 pad1 B16; + CARD32 arg B32; + CARD32 pad3 B32; +} xAppleDRINotifyEvent; +#define sz_xAppleDRINotifyEvent 20 + +#ifdef _APPLEDRI_SERVER_ + +void AppleDRISendEvent ( + int /* type */, + unsigned int /* mask */, + int /* which */, + int /* arg */ +); + +#endif /* _APPLEDRI_SERVER_ */ +#endif /* _APPLEDRISTR_H_ */ Index: xc/lib/GL/apple/build-dispatch diff -u /dev/null xc/lib/GL/apple/build-dispatch:1.2 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/build-dispatch Sun Oct 12 20:30:53 2003 @@ -0,0 +1,101 @@ +#!/bin/sh +exec rep "$0" "$@" +!# + +;; build-dispatch + +;; $Id: build-dispatch,v 1.11 2003/02/17 20:05:41 jharper Exp $ +;; $XFree86: xc/lib/GL/apple/build-dispatch,v 1.2 2003/10/13 00:30:53 torrey Exp $ + +;; Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + +;; 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 THE ABOVE LISTED COPYRIGHT +;; HOLDER(S) 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. + +;; Except as contained in this notice, the name(s) of the above +;; copyright holders shall not be used in advertising or otherwise to +;; promote the sale, use or other dealings in this Software without +;; prior written authorization. + +;; This lisp script is used to build the C dispatch table from the +;; .defs file. It currently uses my (jsh's) rep interpreter. The +;; created file is checked into cvs, so it only needs to be run when +;; the .defs file is touched + +(structure () + + (open rep + rep.regexp) + + (defmacro @ args `(format standard-output ,@args)) + + (define stubs '()) + + (define (strip-args s) + (mapcar (lambda (x) + (and (string-match "[ \t\n*]+([a-zA-Z0-9_]+)$" x) + (expand-last-match "\\1"))) + (string-split "," s))) + + (@ "/* dri_dispatch.h -- built automatically, DO NOT EDIT\n $%s$\n $%s$ */\n\n" "Id" "XFree86: ") + + (condition-case nil + (while t + (let* ((form (read standard-input)) + (args (unless (string= (nth 3 form) "void") + (strip-args (nth 3 form)))) + (internal (>= (nth 2 form) 0)) + (alias (nth 4 form)) + (prefix (if (eq (nth 0 form) 'void) + "_VOID \(" + (format nil " \(%s, " (nth 0 form))))) + (when (or internal (not alias)) + (@ "DEFUN_%s%s%s,\n (%s),\n (%s)\)\n\n" + (if internal "LOCAL" "EXTERN") + prefix + (nth 1 form) + (if (string= (nth 3 form) "void") + (if internal "void *rend" "") + (if internal (format nil "void *rend, %s" (nth 3 form)) (nth 3 form))) + (mapconcat identity args ", "))) + (when alias + (@ "DEFUN_ALIAS%s%s, %s,\n (%s),\n (%s)\)\n\n" + prefix (nth 1 form) alias (nth 3 form) + (mapconcat identity args ", "))) + (when internal + (setq stubs (cons form stubs))))) + + (end-of-stream)) + + (setq stubs (nreverse stubs)) + + (@ "#define INDIRECT_DISPATCH_INIT(d,p) \\\n") + (@ "do { \\\n") + + (setq stubs (sort stubs (lambda (a b) + (< (nth 2 a) (nth 2 b))))) + + (let loop ((rest stubs)) + (when rest + (let ((form (car rest))) + (@ " (d)[%s] = (void *) &p ## %s; \\\n" (nth 2 form) (nth 1 form))) + (loop (cdr rest)))) + + (@ "} while (0)\n")) Index: xc/lib/GL/apple/dri_dispatch.c diff -u /dev/null xc/lib/GL/apple/dri_dispatch.c:1.3 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/dri_dispatch.c Thu Oct 30 21:22:12 2003 @@ -0,0 +1,143 @@ +/* dri_dispatch.c + $Id: dri_dispatch.c,v 1.13 2003/07/23 17:58:02 jharper Exp $ + + Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + + 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 THE ABOVE LISTED COPYRIGHT + HOLDER(S) 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. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise to + promote the sale, use or other dealings in this Software without + prior written authorization. */ +/* $XFree86: xc/lib/GL/apple/dri_dispatch.c,v 1.3 2003/10/31 02:22:12 torrey Exp $ */ + +#include +#include + +#include "glapi.h" +#include "glapitable.h" +#include "glxclient.h" + +#include +#include + +#ifdef __GNUC__ +# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) +#else +# define GCC_VERSION 0 +#endif + +#if GCC_VERSION < 3000 +# define __builtin_expect(a, b) a +#endif + +static int indirect_noop (void) +{ + return 0; +} + +/* Macro used for gl functions that exist in OpenGL.framework. We'll + use the existing stub for the initial dispatch, but need this + function to handle indirect contexts. */ +#define DEFUN_LOCAL_1(ret, return, gn, proto, args) \ +static ret indirect__ ## gn proto \ +{ \ + struct _glapi_table *disp; \ + \ + disp = _glapi_Dispatch; \ + if (__builtin_expect (disp == NULL, 0)) \ + disp = _glapi_get_dispatch (); \ + \ + return (*disp->gn) args; \ +} + +/* Macro used for gl functions that don't exist in OpenGL.framework. + We drop them on the floor in direct rendering mode, but pass them + over the wire normally for indirect contexts. */ +#define DEFUN_EXTERN_1(ret, return, gn, proto, args) \ +ret gl ## gn proto \ +{ \ + __GLXcontext *gc; \ + struct _glapi_table *disp; \ + \ + gc = __glXGetCurrentContext (); \ + if (!gc->isDirect) { \ + disp = _glapi_Dispatch; \ + if (__builtin_expect (disp == NULL, 0)) \ + disp = _glapi_get_dispatch (); \ + \ + return (*disp->gn) args; \ + } else { \ + int a; return a = 0; \ + } \ +} + +/* Macro for functions that already exist, but with a different name. */ +#define DEFUN_ALIAS_1(ret, return, gn, on, proto, args) \ +ret gl ## gn proto \ +{ \ + return gl ## on args; \ +} + +#define DEFUN_LOCAL(r, gn, p, a) \ + DEFUN_LOCAL_1 (r, return, gn, p, a) +#define DEFUN_LOCAL_VOID(gn, p, a) \ + DEFUN_LOCAL_1 (void, , gn, p, a) + +#define DEFUN_EXTERN(r, gn, p, a) \ + DEFUN_EXTERN_1 (r, return, gn, p, a) +#define DEFUN_EXTERN_VOID(gn, p, a) \ + DEFUN_EXTERN_1 (void, , gn, p, a) + +#define DEFUN_ALIAS(r, gn, on, p, a) \ + DEFUN_ALIAS_1 (r, return, gn, on, p, a) +#define DEFUN_ALIAS_VOID(gn, on, p, a) \ + DEFUN_ALIAS_1 (void, , gn, on, p, a) + +#include "dri_dispatch.h" + +__private_extern__ const CGLContextObj +XAppleDRIGetIndirectContext (void) +{ + static CGLContextObj ctx; + void **t; + int i; + + if (ctx != NULL) + return ctx; + + /* initialize gl */ + CGLSetOption (kCGLGOResetLibrary, 0); + + /* Create an empty "context" for dispatching purposes. Add some slop + in case the dispatch table grows in future updates. */ + ctx = Xcalloc (1, sizeof (struct _CGLContextObject) + 1024); + + /* fill it with no-op vectors */ + t = (void **) &ctx->disp; + for (i = 0; i < (int) (sizeof (ctx->disp) / sizeof (t[0])); i++) + t[i] = &indirect_noop; + + /* then install the functions we actually support */ + INDIRECT_DISPATCH_INIT (((void **) (&ctx->disp)), indirect__); + + return ctx; +} Index: xc/lib/GL/apple/dri_dispatch.defs diff -u /dev/null xc/lib/GL/apple/dri_dispatch.defs:1.5 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/dri_dispatch.defs Fri Jan 16 17:39:56 2004 @@ -0,0 +1,759 @@ +;; -*- lisp -*- + +;; dri_dispatch.defs + +;; $Id: dri_dispatch.defs,v 1.9 2003/02/17 20:05:41 jharper Exp $ +;; $XFree86: xc/lib/GL/apple/dri_dispatch.defs,v 1.5 2004/01/16 22:39:56 torrey Exp $ + +;; Copyright (c) 2002 Apple Computer, Inc. All rights reserved. +;; Copyright (c) 2003 Torrey T. Lyons. All rights reserved. + +;; 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 THE ABOVE LISTED COPYRIGHT +;; HOLDER(S) 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. + +;; Except as contained in this notice, the name(s) of the above +;; copyright holders shall not be used in advertising or otherwise to +;; promote the sale, use or other dealings in this Software without +;; prior written authorization. + +;; This file maps the Mesa GL api that X uses to the Apple CGL entry +;; points. It's used to automatically generate the CGL dispatch table +;; that's installed when an indirect context is current + +;; The format is (RETURN-TYPE MESA-NAME CGL-INDEX "ARGS" [ALIAS]) + +;; For the script to work, ARGS must be either the string "void" or a +;; comma separated list of parameters. Each parameter name _must_ be +;; the last non-whitespace token in the field (i.e. inline function +;; declarations won't work) + +;; CGL-INDEX is an index into the function vector table defined in +;; . The names of the entries in this table +;; aren't guaranteed to remain the same, but the table is guaranteed to +;; be binary-compatible in future revisions, so we use indices. + +;; If CGL-INDEX is -1, it denotes that OpenGL.framework doesn't +;; implement that function. We'll generate our own stub and make +;; it work in indirect mode (unless it has an alias). + +;; ALIAS is the name of the function that should be used to define an +;; external entry point for the function (because it doesn't exist in +;; OpenGL.framework) + +;; The ordering matches the Mesa api table, but that's not important + +(void NewList 177 "GLuint list, GLenum mode") +(void EndList 75 "void") +(void CallList 8 "GLuint list") +(void CallLists 9 "GLsizei n, GLenum type, const GLvoid * lists") +(void DeleteLists 58 "GLuint list, GLsizei range") +(GLuint GenLists 97 "GLsizei range") +(void ListBase 156 "GLuint base") +(void Begin 4 "GLenum mode") +(void Bitmap 6 "GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap") +(void Color3b 17 "GLbyte red, GLbyte green, GLbyte blue") +(void Color3bv 18 "const GLbyte * v") +(void Color3d 19 "GLdouble red, GLdouble green, GLdouble blue") +(void Color3dv 20 "const GLdouble * v") +(void Color3f 21 "GLfloat red, GLfloat green, GLfloat blue") +(void Color3fv 22 "const GLfloat * v") +(void Color3i 23 "GLint red, GLint green, GLint blue") +(void Color3iv 24 "const GLint * v") +(void Color3s 25 "GLshort red, GLshort green, GLshort blue") +(void Color3sv 26 "const GLshort * v") +(void Color3ub 27 "GLubyte red, GLubyte green, GLubyte blue") +(void Color3ubv 28 "const GLubyte * v") +(void Color3ui 29 "GLuint red, GLuint green, GLuint blue") +(void Color3uiv 30 "const GLuint * v") +(void Color3us 31 "GLushort red, GLushort green, GLushort blue") +(void Color3usv 32 "const GLushort * v") +(void Color4b 33 "GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha") +(void Color4bv 34 "const GLbyte * v") +(void Color4d 35 "GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha") +(void Color4dv 36 "const GLdouble * v") +(void Color4f 37 "GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha") +(void Color4fv 38 "const GLfloat * v") +(void Color4i 39 "GLint red, GLint green, GLint blue, GLint alpha") +(void Color4iv 40 "const GLint * v") +(void Color4s 41 "GLshort red, GLshort green, GLshort blue, GLshort alpha") +(void Color4sv 42 "const GLshort * v") +(void Color4ub 43 "GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha") +(void Color4ubv 44 "const GLubyte * v") +(void Color4ui 45 "GLuint red, GLuint green, GLuint blue, GLuint alpha") +(void Color4uiv 46 "const GLuint * v") +(void Color4us 47 "GLushort red, GLushort green, GLushort blue, GLushort alpha") +(void Color4usv 48 "const GLushort * v") +(void EdgeFlag 69 "GLboolean flag") +(void EdgeFlagv 71 "const GLboolean * flag") +(void End 74 "void") +(void Indexd 131 "GLdouble c") +(void Indexdv 132 "const GLdouble * c") +(void Indexf 133 "GLfloat c") +(void Indexfv 134 "const GLfloat * c") +(void Indexi 135 "GLint c") +(void Indexiv 136 "const GLint * c") +(void Indexs 137 "GLshort c") +(void Indexsv 138 "const GLshort * c") +(void Normal3b 178 "GLbyte nx, GLbyte ny, GLbyte nz") +(void Normal3bv 179 "const GLbyte * v") +(void Normal3d 180 "GLdouble nx, GLdouble ny, GLdouble nz") +(void Normal3dv 181 "const GLdouble * v") +(void Normal3f 182 "GLfloat nx, GLfloat ny, GLfloat nz") +(void Normal3fv 183 "const GLfloat * v") +(void Normal3i 184 "GLint nx, GLint ny, GLint nz") +(void Normal3iv 185 "const GLint * v") +(void Normal3s 186 "GLshort nx, GLshort ny, GLshort nz") +(void Normal3sv 187 "const GLshort * v") +(void RasterPos2d 212 "GLdouble x, GLdouble y") +(void RasterPos2dv 213 "const GLdouble * v") +(void RasterPos2f 214 "GLfloat x, GLfloat y") +(void RasterPos2fv 215 "const GLfloat * v") +(void RasterPos2i 216 "GLint x, GLint y") +(void RasterPos2iv 217 "const GLint * v") +(void RasterPos2s 218 "GLshort x, GLshort y") +(void RasterPos2sv 219 "const GLshort * v") +(void RasterPos3d 220 "GLdouble x, GLdouble y, GLdouble z") +(void RasterPos3dv 221 "const GLdouble * v") +(void RasterPos3f 222 "GLfloat x, GLfloat y, GLfloat z") +(void RasterPos3fv 223 "const GLfloat * v") +(void RasterPos3i 224 "GLint x, GLint y, GLint z") +(void RasterPos3iv 225 "const GLint * v") +(void RasterPos3s 226 "GLshort x, GLshort y, GLshort z") +(void RasterPos3sv 227 "const GLshort * v") +(void RasterPos4d 228 "GLdouble x, GLdouble y, GLdouble z, GLdouble w") +(void RasterPos4dv 229 "const GLdouble * v") +(void RasterPos4f 230 "GLfloat x, GLfloat y, GLfloat z, GLfloat w") +(void RasterPos4fv 231 "const GLfloat * v") +(void RasterPos4i 232 "GLint x, GLint y, GLint z, GLint w") +(void RasterPos4iv 233 "const GLint * v") +(void RasterPos4s 234 "GLshort x, GLshort y, GLshort z, GLshort w") +(void RasterPos4sv 235 "const GLshort * v") +(void Rectd 238 "GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2") +(void Rectdv 239 "const GLdouble * v1, const GLdouble * v2") +(void Rectf 240 "GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2") +(void Rectfv 241 "const GLfloat * v1, const GLfloat * v2") +(void Recti 242 "GLint x1, GLint y1, GLint x2, GLint y2") +(void Rectiv 243 "const GLint * v1, const GLint * v2") +(void Rects 244 "GLshort x1, GLshort y1, GLshort x2, GLshort y2") +(void Rectsv 245 "const GLshort * v1, const GLshort * v2") +(void TexCoord1d 257 "GLdouble s") +(void TexCoord1dv 258 "const GLdouble * v") +(void TexCoord1f 259 "GLfloat s") +(void TexCoord1fv 260 "const GLfloat * v") +(void TexCoord1i 261 "GLint s") +(void TexCoord1iv 262 "const GLint * v") +(void TexCoord1s 263 "GLshort s") +(void TexCoord1sv 264 "const GLshort * v") +(void TexCoord2d 265 "GLdouble s, GLdouble t") +(void TexCoord2dv 266 "const GLdouble * v") +(void TexCoord2f 267 "GLfloat s, GLfloat t") +(void TexCoord2fv 268 "const GLfloat * v") +(void TexCoord2i 269 "GLint s, GLint t") +(void TexCoord2iv 270 "const GLint * v") +(void TexCoord2s 271 "GLshort s, GLshort t") +(void TexCoord2sv 272 "const GLshort * v") +(void TexCoord3d 273 "GLdouble s, GLdouble t, GLdouble r") +(void TexCoord3dv 274 "const GLdouble * v") +(void TexCoord3f 275 "GLfloat s, GLfloat t, GLfloat r") +(void TexCoord3fv 276 "const GLfloat * v") +(void TexCoord3i 277 "GLint s, GLint t, GLint r") +(void TexCoord3iv 278 "const GLint * v") +(void TexCoord3s 279 "GLshort s, GLshort t, GLshort r") +(void TexCoord3sv 280 "const GLshort * v") +(void TexCoord4d 281 "GLdouble s, GLdouble t, GLdouble r, GLdouble q") +(void TexCoord4dv 282 "const GLdouble * v") +(void TexCoord4f 283 "GLfloat s, GLfloat t, GLfloat r, GLfloat q") +(void TexCoord4fv 284 "const GLfloat * v") +(void TexCoord4i 285 "GLint s, GLint t, GLint r, GLint q") +(void TexCoord4iv 286 "const GLint * v") +(void TexCoord4s 287 "GLshort s, GLshort t, GLshort r, GLshort q") +(void TexCoord4sv 288 "const GLshort * v") +(void Vertex2d 310 "GLdouble x, GLdouble y") +(void Vertex2dv 311 "const GLdouble * v") +(void Vertex2f 312 "GLfloat x, GLfloat y") +(void Vertex2fv 313 "const GLfloat * v") +(void Vertex2i 314 "GLint x, GLint y") +(void Vertex2iv 315 "const GLint * v") +(void Vertex2s 316 "GLshort x, GLshort y") +(void Vertex2sv 317 "const GLshort * v") +(void Vertex3d 318 "GLdouble x, GLdouble y, GLdouble z") +(void Vertex3dv 319 "const GLdouble * v") +(void Vertex3f 320 "GLfloat x, GLfloat y, GLfloat z") +(void Vertex3fv 321 "const GLfloat * v") +(void Vertex3i 322 "GLint x, GLint y, GLint z") +(void Vertex3iv 323 "const GLint * v") +(void Vertex3s 324 "GLshort x, GLshort y, GLshort z") +(void Vertex3sv 325 "const GLshort * v") +(void Vertex4d 326 "GLdouble x, GLdouble y, GLdouble z, GLdouble w") +(void Vertex4dv 327 "const GLdouble * v") +(void Vertex4f 328 "GLfloat x, GLfloat y, GLfloat z, GLfloat w") +(void Vertex4fv 329 "const GLfloat * v") +(void Vertex4i 330 "GLint x, GLint y, GLint z, GLint w") +(void Vertex4iv 331 "const GLint * v") +(void Vertex4s 332 "GLshort x, GLshort y, GLshort z, GLshort w") +(void Vertex4sv 333 "const GLshort * v") +(void ClipPlane 16 "GLenum plane, const GLdouble * equation") +(void ColorMaterial 50 "GLenum face, GLenum mode") +(void CullFace 57 "GLenum mode") +(void Fogf 91 "GLenum pname, GLfloat param") +(void Fogfv 92 "GLenum pname, const GLfloat * params") +(void Fogi 93 "GLenum pname, GLint param") +(void Fogiv 94 "GLenum pname, const GLint * params") +(void FrontFace 95 "GLenum mode") +(void Hint 128 "GLenum target, GLenum mode") +(void Lightf 150 "GLenum light, GLenum pname, GLfloat param") +(void Lightfv 151 "GLenum light, GLenum pname, const GLfloat * params") +(void Lighti 152 "GLenum light, GLenum pname, GLint param") +(void Lightiv 153 "GLenum light, GLenum pname, const GLint * params") +(void LightModelf 146 "GLenum pname, GLfloat param") +(void LightModelfv 147 "GLenum pname, const GLfloat * params") +(void LightModeli 148 "GLenum pname, GLint param") +(void LightModeliv 149 "GLenum pname, const GLint * params") +(void LineStipple 154 "GLint factor, GLushort pattern") +(void LineWidth 155 "GLfloat width") +(void Materialf 170 "GLenum face, GLenum pname, GLfloat param") +(void Materialfv 171 "GLenum face, GLenum pname, const GLfloat * params") +(void Materiali 172 "GLenum face, GLenum pname, GLint param") +(void Materialiv 173 "GLenum face, GLenum pname, const GLint * params") +(void PointSize 199 "GLfloat size") +(void PolygonMode 200 "GLenum face, GLenum mode") +(void PolygonStipple 202 "const GLubyte * mask") +(void Scissor 251 "GLint x, GLint y, GLsizei width, GLsizei height") +(void ShadeModel 253 "GLenum mode") +(void TexParameterf 302 "GLenum target, GLenum pname, GLfloat param") +(void TexParameterfv 303 "GLenum target, GLenum pname, const GLfloat * params") +(void TexParameteri 304 "GLenum target, GLenum pname, GLint param") +(void TexParameteriv 305 "GLenum target, GLenum pname, const GLint * params") +(void TexImage1D 300 "GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels") +(void TexImage2D 301 "GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels") +(void TexEnvf 290 "GLenum target, GLenum pname, GLfloat param") +(void TexEnvfv 291 "GLenum target, GLenum pname, const GLfloat * params") +(void TexEnvi 292 "GLenum target, GLenum pname, GLint param") +(void TexEnviv 293 "GLenum target, GLenum pname, const GLint * params") +(void TexGend 294 "GLenum coord, GLenum pname, GLdouble param") +(void TexGendv 295 "GLenum coord, GLenum pname, const GLdouble * params") +(void TexGenf 296 "GLenum coord, GLenum pname, GLfloat param") +(void TexGenfv 297 "GLenum coord, GLenum pname, const GLfloat * params") +(void TexGeni 298 "GLenum coord, GLenum pname, GLint param") +(void TexGeniv 299 "GLenum coord, GLenum pname, const GLint * params") +(void FeedbackBuffer 88 "GLsizei size, GLenum type, GLfloat * buffer") +(void SelectBuffer 252 "GLsizei size, GLuint * buffer") +(GLint RenderMode 246 "GLenum mode") +(void InitNames 141 "void") +(void LoadName 160 "GLuint name") +(void PassThrough 190 "GLfloat token") +(void PopName 206 "void") +(void PushName 211 "GLuint name") +(void DrawBuffer 66 "GLenum mode") +(void Clear 10 "GLbitfield mask") +(void ClearAccum 11 "GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha") +(void ClearIndex 14 "GLfloat c") +(void ClearColor 12 "GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha") +(void ClearStencil 15 "GLint s") +(void ClearDepth 13 "GLclampd depth") +(void StencilMask 255 "GLuint mask") +(void ColorMask 49 "GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha") +(void DepthMask 61 "GLboolean flag") +(void IndexMask 129 "GLuint mask") +(void Accum 0 "GLenum op, GLfloat value") +(void Disable 63 "GLenum cap") +(void Enable 72 "GLenum cap") +(void Finish 89 "void") +(void Flush 90 "void") +(void PopAttrib 203 "void") +(void PushAttrib 208 "GLbitfield mask") +(void Map1d 162 "GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points") +(void Map1f 163 "GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points") +(void Map2d 164 "GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points") +(void Map2f 165 "GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points") +(void MapGrid1d 166 "GLint un, GLdouble u1, GLdouble u2") +(void MapGrid1f 167 "GLint un, GLfloat u1, GLfloat u2") +(void MapGrid2d 168 "GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2") +(void MapGrid2f 169 "GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2") +(void EvalCoord1d 76 "GLdouble u") +(void EvalCoord1dv 77 "const GLdouble * u") +(void EvalCoord1f 78 "GLfloat u") +(void EvalCoord1fv 79 "const GLfloat * u") +(void EvalCoord2d 80 "GLdouble u, GLdouble v") +(void EvalCoord2dv 81 "const GLdouble * u") +(void EvalCoord2f 82 "GLfloat u, GLfloat v") +(void EvalCoord2fv 83 "const GLfloat * u") +(void EvalMesh1 84 "GLenum mode, GLint i1, GLint i2") +(void EvalPoint1 86 "GLint i") +(void EvalMesh2 85 "GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2") +(void EvalPoint2 87 "GLint i, GLint j") +(void AlphaFunc 1 "GLenum func, GLclampf ref") +(void BlendFunc 7 "GLenum sfactor, GLenum dfactor") +(void LogicOp 161 "GLenum opcode") +(void StencilFunc 254 "GLenum func, GLint ref, GLuint mask") +(void StencilOp 256 "GLenum fail, GLenum zfail, GLenum zpass") +(void DepthFunc 60 "GLenum func") +(void PixelZoom 198 "GLfloat xfactor, GLfloat yfactor") +(void PixelTransferf 196 "GLenum pname, GLfloat param") +(void PixelTransferi 197 "GLenum pname, GLint param") +(void PixelStoref 194 "GLenum pname, GLfloat param") +(void PixelStorei 195 "GLenum pname, GLint param") +(void PixelMapfv 191 "GLenum map, GLint mapsize, const GLfloat * values") +(void PixelMapuiv 192 "GLenum map, GLint mapsize, const GLuint * values") +(void PixelMapusv 193 "GLenum map, GLint mapsize, const GLushort * values") +(void ReadBuffer 236 "GLenum mode") +(void CopyPixels 52 "GLint x, GLint y, GLsizei width, GLsizei height, GLenum type") +(void ReadPixels 237 "GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels") +(void DrawPixels 68 "GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels") +(void GetBooleanv 99 "GLenum pname, GLboolean * params") +(void GetClipPlane 100 "GLenum plane, GLdouble * equation") +(void GetDoublev 101 "GLenum pname, GLdouble * params") +(GLenum GetError 102 "void") +(void GetFloatv 103 "GLenum pname, GLfloat * params") +(void GetIntegerv 104 "GLenum pname, GLint * params") +(void GetLightfv 105 "GLenum light, GLenum pname, GLfloat * params") +(void GetLightiv 106 "GLenum light, GLenum pname, GLint * params") +(void GetMapdv 107 "GLenum target, GLenum query, GLdouble * v") +(void GetMapfv 108 "GLenum target, GLenum query, GLfloat * v") +(void GetMapiv 109 "GLenum target, GLenum query, GLint * v") +(void GetMaterialfv 110 "GLenum face, GLenum pname, GLfloat * params") +(void GetMaterialiv 111 "GLenum face, GLenum pname, GLint * params") +(void GetPixelMapfv 112 "GLenum map, GLfloat * values") +(void GetPixelMapuiv 113 "GLenum map, GLuint * values") +(void GetPixelMapusv 114 "GLenum map, GLushort * values") +(void GetPolygonStipple 116 "GLubyte * mask") +(|const GLubyte *| GetString 117 "GLenum name") +(void GetTexEnvfv 118 "GLenum target, GLenum pname, GLfloat * params") +(void GetTexEnviv 119 "GLenum target, GLenum pname, GLint * params") +(void GetTexGendv 120 "GLenum coord, GLenum pname, GLdouble * params") +(void GetTexGenfv 121 "GLenum coord, GLenum pname, GLfloat * params") +(void GetTexGeniv 122 "GLenum coord, GLenum pname, GLint * params") +(void GetTexImage 123 "GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels") +(void GetTexParameterfv 126 "GLenum target, GLenum pname, GLfloat * params") +(void GetTexParameteriv 127 "GLenum target, GLenum pname, GLint * params") +(void GetTexLevelParameterfv 124 "GLenum target, GLint level, GLenum pname, GLfloat * params") +(void GetTexLevelParameteriv 125 "GLenum target, GLint level, GLenum pname, GLint * params") +(GLboolean IsEnabled 143 "GLenum cap") +(GLboolean IsList 144 "GLuint list") +(void DepthRange 62 "GLclampd zNear, GLclampd zFar") +(void Frustum 96 "GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar") +(void LoadIdentity 157 "void") +(void LoadMatrixf 159 "const GLfloat * m") +(void LoadMatrixd 158 "const GLdouble * m") +(void MatrixMode 174 "GLenum mode") +(void MultMatrixf 176 "const GLfloat * m") +(void MultMatrixd 175 "const GLdouble * m") +(void Ortho 189 "GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar") +(void PopMatrix 205 "void") +(void PushMatrix 210 "void") +(void Rotated 247 "GLdouble angle, GLdouble x, GLdouble y, GLdouble z") +(void Rotatef 248 "GLfloat angle, GLfloat x, GLfloat y, GLfloat z") +(void Scaled 249 "GLdouble x, GLdouble y, GLdouble z") +(void Scalef 250 "GLfloat x, GLfloat y, GLfloat z") +(void Translated 308 "GLdouble x, GLdouble y, GLdouble z") +(void Translatef 309 "GLfloat x, GLfloat y, GLfloat z") +(void Viewport 335 "GLint x, GLint y, GLsizei width, GLsizei height") +(void ArrayElement 3 "GLint i") +(void BindTexture 5 "GLenum target, GLenum texture") +(void ColorPointer 51 "GLint size, GLenum type, GLsizei stride, const GLvoid * pointer") +(void DisableClientState 64 "GLenum array") +(void DrawArrays 65 "GLenum mode, GLint first, GLsizei count") +(void DrawElements 67 "GLenum mode, GLsizei count, GLenum type, const GLvoid * indices") +(void EdgeFlagPointer 70 "GLsizei stride, const GLvoid * pointer") +(void EnableClientState 73 "GLenum array") +(void IndexPointer 130 "GLenum type, GLsizei stride, const GLvoid * pointer") +(void Indexub 139 "GLubyte c") +(void Indexubv 140 "const GLubyte * c") +(void InterleavedArrays 142 "GLenum format, GLsizei stride, const GLvoid * pointer") +(void NormalPointer 188 "GLenum type, GLsizei stride, const GLvoid * pointer") +(void PolygonOffset 201 "GLfloat factor, GLfloat units") +(void TexCoordPointer 289 "GLint size, GLenum type, GLsizei stride, const GLvoid * pointer") +(void VertexPointer 334 "GLint size, GLenum type, GLsizei stride, const GLvoid * pointer") +(GLboolean AreTexturesResident 2 "GLsizei n, const GLenum * textures, GLboolean * residences") +(void CopyTexImage1D 53 "GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border") +(void CopyTexImage2D 54 "GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border") +(void CopyTexSubImage1D 55 "GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width") +(void CopyTexSubImage2D 56 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height") +(void DeleteTextures 59 "GLsizei n, const GLenum * textures") +(void GenTextures 98 "GLsizei n, GLenum * textures") +(void GetPointerv 115 "GLenum pname, GLvoid * * params") +(GLboolean IsTexture 145 "GLenum texture") +(void PrioritizeTextures 207 "GLsizei n, const GLenum * textures, const GLclampf * priorities") +(void TexSubImage1D 306 "GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels") +(void TexSubImage2D 307 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels") +(void PopClientAttrib 204 "void") +(void PushClientAttrib 209 "GLbitfield mask") +(void BlendColor 337 "GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha") +(void BlendEquation 338 "GLenum mode") +(void DrawRangeElements 405 "GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices") +(void ColorTable 406 "GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table") +(void ColorTableParameterfv 407 "GLenum target, GLenum pname, const GLfloat * params") +(void ColorTableParameteriv 408 "GLenum target, GLenum pname, const GLint * params") +(void CopyColorTable 409 "GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width") +(void GetColorTable 410 "GLenum target, GLenum format, GLenum type, GLvoid * table") +(void GetColorTableParameterfv 411 "GLenum target, GLenum pname, GLfloat * params") +(void GetColorTableParameteriv 412 "GLenum target, GLenum pname, GLint * params") +(void ColorSubTable 413 "GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data") +(void CopyColorSubTable 414 "GLenum target, GLsizei start, GLint x, GLint y, GLsizei width") +(void ConvolutionFilter1D 415 "GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image") +(void ConvolutionFilter2D 416 "GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image") +(void ConvolutionParameterf 417 "GLenum target, GLenum pname, GLfloat params") +(void ConvolutionParameterfv 418 "GLenum target, GLenum pname, const GLfloat * params") +(void ConvolutionParameteri 419 "GLenum target, GLenum pname, GLint params") +(void ConvolutionParameteriv 420 "GLenum target, GLenum pname, const GLint * params") +(void CopyConvolutionFilter1D 421 "GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width") +(void CopyConvolutionFilter2D 422 "GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height") +(void GetConvolutionFilter 423 "GLenum target, GLenum format, GLenum type, GLvoid * image") +(void GetConvolutionParameterfv 424 "GLenum target, GLenum pname, GLfloat * params") +(void GetConvolutionParameteriv 425 "GLenum target, GLenum pname, GLint * params") +(void GetSeparableFilter 426 "GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span") +(void SeparableFilter2D 427 "GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column") +(void GetHistogram 428 "GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values") +(void GetHistogramParameterfv 429 "GLenum target, GLenum pname, GLfloat * params") +(void GetHistogramParameteriv 430 "GLenum target, GLenum pname, GLint * params") +(void GetMinmax 431 "GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values") +(void GetMinmaxParameterfv 432 "GLenum target, GLenum pname, GLfloat * params") +(void GetMinmaxParameteriv 433 "GLenum target, GLenum pname, GLint * params") +(void Histogram 434 "GLenum target, GLsizei width, GLenum internalformat, GLboolean sink") +(void Minmax 435 "GLenum target, GLenum internalformat, GLboolean sink") +(void ResetHistogram 436 "GLenum target") +(void ResetMinmax 437 "GLenum target") +(void TexImage3D 438 "GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels") +(void TexSubImage3D 439 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels") +(void CopyTexSubImage3D 440 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height") +(void ActiveTextureARB 342 "GLenum texture") +(void ClientActiveTextureARB 341 "GLenum texture") +(void MultiTexCoord1dARB 343 "GLenum target, GLdouble s") +(void MultiTexCoord1dvARB 344 "GLenum target, const GLdouble * v") +(void MultiTexCoord1fARB 345 "GLenum target, GLfloat s") +(void MultiTexCoord1fvARB 346 "GLenum target, const GLfloat * v") +(void MultiTexCoord1iARB 347 "GLenum target, GLint s") +(void MultiTexCoord1ivARB 348 "GLenum target, const GLint * v") +(void MultiTexCoord1sARB 349 "GLenum target, GLshort s") +(void MultiTexCoord1svARB 350 "GLenum target, const GLshort * v") +(void MultiTexCoord2dARB 351 "GLenum target, GLdouble s, GLdouble t") +(void MultiTexCoord2dvARB 352 "GLenum target, const GLdouble * v") +(void MultiTexCoord2fARB 353 "GLenum target, GLfloat s, GLfloat t") +(void MultiTexCoord2fvARB 354 "GLenum target, const GLfloat * v") +(void MultiTexCoord2iARB 355 "GLenum target, GLint s, GLint t") +(void MultiTexCoord2ivARB 356 "GLenum target, const GLint * v") +(void MultiTexCoord2sARB 357 "GLenum target, GLshort s, GLshort t") +(void MultiTexCoord2svARB 358 "GLenum target, const GLshort * v") +(void MultiTexCoord3dARB 359 "GLenum target, GLdouble s, GLdouble t, GLdouble r") +(void MultiTexCoord3dvARB 360 "GLenum target, const GLdouble * v") +(void MultiTexCoord3fARB 361 "GLenum target, GLfloat s, GLfloat t, GLfloat r") +(void MultiTexCoord3fvARB 362 "GLenum target, const GLfloat * v") +(void MultiTexCoord3iARB 363 "GLenum target, GLint s, GLint t, GLint r") +(void MultiTexCoord3ivARB 364 "GLenum target, const GLint * v") +(void MultiTexCoord3sARB 365 "GLenum target, GLshort s, GLshort t, GLshort r") +(void MultiTexCoord3svARB 366 "GLenum target, const GLshort * v") +(void MultiTexCoord4dARB 367 "GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q") +(void MultiTexCoord4dvARB 368 "GLenum target, const GLdouble * v") +(void MultiTexCoord4fARB 369 "GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q") +(void MultiTexCoord4fvARB 370 "GLenum target, const GLfloat * v") +(void MultiTexCoord4iARB 371 "GLenum target, GLint s, GLint t, GLint r, GLint q") +(void MultiTexCoord4ivARB 372 "GLenum target, const GLint * v") +(void MultiTexCoord4sARB 373 "GLenum target, GLshort s, GLshort t, GLshort r, GLshort q") +(void MultiTexCoord4svARB 374 "GLenum target, const GLshort * v") +(void LoadTransposeMatrixfARB 376 "const GLfloat * m") +(void LoadTransposeMatrixdARB 375 "const GLdouble * m") +(void MultTransposeMatrixfARB 378 "const GLfloat * m") +(void MultTransposeMatrixdARB 377 "const GLdouble * m") +(void SampleCoverageARB 459 "GLclampf value, GLboolean invert") +(void PolygonOffsetEXT -1 "GLfloat factor, GLfloat bias" PolygonOffset) +(void GetTexFilterFuncSGIS -1 "GLenum target, GLenum filter, GLfloat * weights") +(void TexFilterFuncSGIS -1 "GLenum target, GLenum filter, GLsizei n, const GLfloat * weights") +(void GetHistogramEXT -1 "GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values" GetHistogram) +(void GetHistogramParameterfvEXT -1 "GLenum target, GLenum pname, GLfloat * params" GetHistogramParameterfv) +(void GetHistogramParameterivEXT -1 "GLenum target, GLenum pname, GLint * params" GetHistogramParameteriv) +(void GetMinmaxEXT -1 "GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values" GetMinmax) +(void GetMinmaxParameterfvEXT -1 "GLenum target, GLenum pname, GLfloat * params" GetMinmaxParameterfv) +(void GetMinmaxParameterivEXT -1 "GLenum target, GLenum pname, GLint * params" GetMinmaxParameteriv) +(void GetConvolutionFilterEXT -1 "GLenum target, GLenum format, GLenum type, GLvoid * image" GetConvolutionFilter) +(void GetConvolutionParameterfvEXT -1 "GLenum target, GLenum pname, GLfloat * params" GetConvolutionParameterfv) +(void GetConvolutionParameterivEXT -1 "GLenum target, GLenum pname, GLint * params" GetConvolutionParameteriv) +(void GetSeparableFilterEXT -1 "GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span" GetSeparableFilter) +(void GetColorTableSGI -1 "GLenum target, GLenum format, GLenum type, GLvoid * table" GetColorTable) +(void GetColorTableParameterfvSGI -1 "GLenum target, GLenum pname, GLfloat * params" GetColorTableParameterfv) +(void GetColorTableParameterivSGI -1 "GLenum target, GLenum pname, GLint * params" GetColorTableParameteriv) +(void PixelTexGenSGIX -1 "GLenum mode") +(void PixelTexGenParameteriSGIS -1 "GLenum pname, GLint param") +(void PixelTexGenParameterivSGIS -1 "GLenum pname, const GLint * params") +(void PixelTexGenParameterfSGIS -1 "GLenum pname, GLfloat param") +(void PixelTexGenParameterfvSGIS -1 "GLenum pname, const GLfloat * params") +(void GetPixelTexGenParameterivSGIS -1 "GLenum pname, GLint * params") +(void GetPixelTexGenParameterfvSGIS -1 "GLenum pname, GLfloat * params") +(void TexImage4DSGIS -1 "GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid * pixels") +(void TexSubImage4DSGIS -1 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid * pixels") +(GLboolean AreTexturesResidentEXT -1 "GLsizei n, const GLenum * textures, GLboolean * residences" AreTexturesResident) +(void GenTexturesEXT -1 "GLsizei n, GLenum * textures" GenTextures) +(GLboolean IsTextureEXT -1 "GLenum texture") +(void DetailTexFuncSGIS -1 "GLenum target, GLsizei n, const GLfloat * points") +(void GetDetailTexFuncSGIS -1 "GLenum target, GLfloat * points") +(void SharpenTexFuncSGIS -1 "GLenum target, GLsizei n, const GLfloat * points") +(void GetSharpenTexFuncSGIS -1 "GLenum target, GLfloat * points") +(void SampleMaskSGIS -1 "GLclampf value, GLboolean invert") +(void SamplePatternSGIS -1 "GLenum pattern") +(void ColorPointerEXT -1 "GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer") +(void EdgeFlagPointerEXT -1 "GLsizei stride, GLsizei count, const GLboolean * pointer") +(void IndexPointerEXT -1 "GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer") +(void NormalPointerEXT -1 "GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer") +(void TexCoordPointerEXT -1 "GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer") +(void VertexPointerEXT -1 "GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer") +(void SpriteParameterfSGIX -1 "GLenum pname, GLfloat param") +(void SpriteParameterfvSGIX -1 "GLenum pname, const GLfloat * params") +(void SpriteParameteriSGIX -1 "GLenum pname, GLint param") +(void SpriteParameterivSGIX -1 "GLenum pname, const GLint * params") +(void PointParameterfEXT 540 "GLenum pname, GLfloat param" PointParameterf) +(void PointParameterfvEXT 541 "GLenum pname, const GLfloat * params" PointParameterfv) +(GLint GetInstrumentsSGIX -1 "void") +(void InstrumentsBufferSGIX -1 "GLsizei size, GLint * buffer") +(GLint PollInstrumentsSGIX -1 "GLint * marker_p") +(void ReadInstrumentsSGIX -1 "GLint marker") +(void StartInstrumentsSGIX -1 "void") +(void StopInstrumentsSGIX -1 "GLint marker") +(void FrameZoomSGIX -1 "GLint factor") +(void TagSampleBufferSGIX -1 "void") +(void ReferencePlaneSGIX -1 "const GLdouble * equation") +(void FlushRasterSGIX -1 "void") +(void GetListParameterfvSGIX -1 "GLuint list, GLenum pname, GLfloat * params") +(void GetListParameterivSGIX -1 "GLuint list, GLenum pname, GLint * params") +(void ListParameterfSGIX -1 "GLuint list, GLenum pname, GLfloat param") +(void ListParameterfvSGIX -1 "GLuint list, GLenum pname, const GLfloat * params") +(void ListParameteriSGIX -1 "GLuint list, GLenum pname, GLint param") +(void ListParameterivSGIX -1 "GLuint list, GLenum pname, const GLint * params") +(void FragmentColorMaterialSGIX -1 "GLenum face, GLenum mode") +(void FragmentLightfSGIX -1 "GLenum light, GLenum pname, GLfloat param") +(void FragmentLightfvSGIX -1 "GLenum light, GLenum pname, const GLfloat * params") +(void FragmentLightiSGIX -1 "GLenum light, GLenum pname, GLint param") +(void FragmentLightivSGIX -1 "GLenum light, GLenum pname, const GLint * params") +(void FragmentLightModelfSGIX -1 "GLenum pname, GLfloat param") +(void FragmentLightModelfvSGIX -1 "GLenum pname, const GLfloat * params") +(void FragmentLightModeliSGIX -1 "GLenum pname, GLint param") +(void FragmentLightModelivSGIX -1 "GLenum pname, const GLint * params") +(void FragmentMaterialfSGIX -1 "GLenum face, GLenum pname, GLfloat param") +(void FragmentMaterialfvSGIX -1 "GLenum face, GLenum pname, const GLfloat * params") +(void FragmentMaterialiSGIX -1 "GLenum face, GLenum pname, GLint param") +(void FragmentMaterialivSGIX -1 "GLenum face, GLenum pname, const GLint * params") +(void GetFragmentLightfvSGIX -1 "GLenum light, GLenum pname, GLfloat * params") +(void GetFragmentLightivSGIX -1 "GLenum light, GLenum pname, GLint * params") +(void GetFragmentMaterialfvSGIX -1 "GLenum face, GLenum pname, GLfloat * params") +(void GetFragmentMaterialivSGIX -1 "GLenum face, GLenum pname, GLint * params") +(void LightEnviSGIX -1 "GLenum pname, GLint param") +(void VertexWeightfEXT -1 "GLfloat weight") +(void VertexWeightfvEXT -1 "const GLfloat * weight") +(void VertexWeightPointerEXT -1 "GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer") +(void FlushVertexArrayRangeNV -1 "void") +(void VertexArrayRangeNV 403 "GLsizei length, const GLvoid * pointer" VertexArrayRangeAPPLE) +(void CombinerParameterfvNV 441 "GLenum pname, const GLfloat * params") +(void CombinerParameterfNV 442 "GLenum pname, GLfloat param") +(void CombinerParameterivNV 443 "GLenum pname, const GLint * params") +(void CombinerParameteriNV 444 "GLenum pname, GLint param") +(void CombinerInputNV 445 "GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage") +(void CombinerOutputNV 446 "GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum") +(void FinalCombinerInputNV 447 "GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage") +(void GetCombinerInputParameterfvNV 448 "GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params") +(void GetCombinerInputParameterivNV 449 "GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params") +(void GetCombinerOutputParameterfvNV 450 "GLenum stage, GLenum portion, GLenum pname, GLfloat * params") +(void GetCombinerOutputParameterivNV 451 "GLenum stage, GLenum portion, GLenum pname, GLint * params") +(void GetFinalCombinerInputParameterfvNV 452 "GLenum variable, GLenum pname, GLfloat * params") +(void GetFinalCombinerInputParameterivNV 453 "GLenum variable, GLenum pname, GLint * params") +(void ResizeBuffersMESA -1 "void") +(void WindowPos2dMESA -1 "GLdouble x, GLdouble y") +(void WindowPos2dvMESA -1 "const GLdouble * v") +(void WindowPos2fMESA -1 "GLfloat x, GLfloat y") +(void WindowPos2fvMESA -1 "const GLfloat * v") +(void WindowPos2iMESA -1 "GLint x, GLint y") +(void WindowPos2ivMESA -1 "const GLint * v") +(void WindowPos2sMESA -1 "GLshort x, GLshort y") +(void WindowPos2svMESA -1 "const GLshort * v") +(void WindowPos3dMESA -1 "GLdouble x, GLdouble y, GLdouble z") +(void WindowPos3dvMESA -1 "const GLdouble * v") +(void WindowPos3fMESA -1 "GLfloat x, GLfloat y, GLfloat z") +(void WindowPos3fvMESA -1 "const GLfloat * v") +(void WindowPos3iMESA -1 "GLint x, GLint y, GLint z") +(void WindowPos3ivMESA -1 "const GLint * v") +(void WindowPos3sMESA -1 "GLshort x, GLshort y, GLshort z") +(void WindowPos3svMESA -1 "const GLshort * v") +(void WindowPos4dMESA -1 "GLdouble x, GLdouble y, GLdouble z, GLdouble w") +(void WindowPos4dvMESA -1 "const GLdouble * v") +(void WindowPos4fMESA -1 "GLfloat x, GLfloat y, GLfloat z, GLfloat w") +(void WindowPos4fvMESA -1 "const GLfloat * v") +(void WindowPos4iMESA -1 "GLint x, GLint y, GLint z, GLint w") +(void WindowPos4ivMESA -1 "const GLint * v") +(void WindowPos4sMESA -1 "GLshort x, GLshort y, GLshort z, GLshort w") +(void WindowPos4svMESA -1 "const GLshort * v") +(void BlendFuncSeparateEXT 336 "GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha") +(void IndexMaterialEXT -1 "GLenum face, GLenum mode") +(void IndexFuncEXT -1 "GLenum func, GLclampf ref") +(void LockArraysEXT 339 "GLint first, GLsizei count") +(void UnlockArraysEXT 340 "void") +(void CullParameterdvEXT -1 "GLenum pname, GLdouble * params") +(void CullParameterfvEXT -1 "GLenum pname, GLfloat * params") +(void HintPGI -1 "GLenum target, GLint mode") +(void FogCoordfEXT 544 "GLfloat coord") +(void FogCoordfvEXT 545 "const GLfloat * coord") +(void FogCoorddEXT 546 "GLdouble coord") +(void FogCoorddvEXT 547 "const GLdouble * coord") +(void FogCoordPointerEXT 548 "GLenum type, GLsizei stride, const GLvoid * pointer") +;; OpenGL.framework defines these, but doesn't have dispatch slots for them +;; (void GetColorTableEXT -1 "GLenum target, GLenum format, GLenum type, GLvoid * data" GetColorTable) +;; (void GetColorTableParameterivEXT -1 "GLenum target, GLenum pname, GLint * params" GetColorTableParameteriv) +;; (void GetColorTableParameterfvEXT -1 "GLenum target, GLenum pname, GLfloat * params" GetColorTableParameterfv) +(void TbufferMask3DFX -1 "GLuint mask") +(void CompressedTexImage3DARB 379 "GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data") +(void CompressedTexImage2DARB 380 "GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data") +(void CompressedTexImage1DARB 381 "GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data") +(void CompressedTexSubImage3DARB 382 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data") +(void CompressedTexSubImage2DARB 383 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data") +(void CompressedTexSubImage1DARB 384 "GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data") +(void GetCompressedTexImageARB 385 "GLenum target, GLint level, void * img") +(void SecondaryColor3bEXT 386 "GLbyte red, GLbyte green, GLbyte blue") +(void SecondaryColor3bvEXT 387 "const GLbyte * v") +(void SecondaryColor3dEXT 388 "GLdouble red, GLdouble green, GLdouble blue") +(void SecondaryColor3dvEXT 389 "const GLdouble * v") +(void SecondaryColor3fEXT 390 "GLfloat red, GLfloat green, GLfloat blue") +(void SecondaryColor3fvEXT 391 "const GLfloat * v") +(void SecondaryColor3iEXT 392 "GLint red, GLint green, GLint blue") +(void SecondaryColor3ivEXT 393 "const GLint * v") +(void SecondaryColor3sEXT 394 "GLshort red, GLshort green, GLshort blue") +(void SecondaryColor3svEXT 395 "const GLshort * v") +(void SecondaryColor3ubEXT 396 "GLubyte red, GLubyte green, GLubyte blue") +(void SecondaryColor3ubvEXT 397 "const GLubyte * v") +(void SecondaryColor3uiEXT 398 "GLuint red, GLuint green, GLuint blue") +(void SecondaryColor3uivEXT 399 "const GLuint * v") +(void SecondaryColor3usEXT 400 "GLushort red, GLushort green, GLushort blue") +(void SecondaryColor3usvEXT 401 "const GLushort * v") +(void SecondaryColorPointerEXT 402 "GLint size, GLenum type, GLsizei stride, const GLvoid * pointer") +(GLboolean AreProgramsResidentNV -1 "GLsizei n, const GLuint * ids, GLboolean * residences") +(void BindProgramNV -1 "GLenum target, GLuint id") +(void DeleteProgramsNV -1 "GLsizei n, const GLuint * ids") +(void ExecuteProgramNV -1 "GLenum target, GLuint id, const GLfloat * params") +(void GenProgramsNV -1 "GLsizei n, GLuint * ids") +(void GetProgramParameterdvNV -1 "GLenum target, GLuint index, GLenum pname, GLdouble * params") +(void GetProgramParameterfvNV -1 "GLenum target, GLuint index, GLenum pname, GLfloat * params") +(void GetProgramivNV -1 "GLuint id, GLenum pname, GLint * params") +(void GetProgramStringNV -1 "GLuint id, GLenum pname, GLubyte * program") +(void GetTrackMatrixivNV -1 "GLenum target, GLuint address, GLenum pname, GLint * params") +(void GetVertexAttribdvNV -1 "GLuint index, GLenum pname, GLdouble * params") +(void GetVertexAttribfvNV -1 "GLuint index, GLenum pname, GLfloat * params") +(void GetVertexAttribivNV -1 "GLuint index, GLenum pname, GLint * params") +(void GetVertexAttribPointervNV -1 "GLuint index, GLenum pname, GLvoid ** pointer") +(GLboolean IsProgramNV -1 "GLuint id") +(void LoadProgramNV -1 "GLenum target, GLuint id, GLsizei len, const GLubyte * program") +(void ProgramParameter4dNV -1 "GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w") +(void ProgramParameter4dvNV -1 "GLenum target, GLuint index, const GLdouble * params") +(void ProgramParameter4fNV -1 "GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w") +(void ProgramParameter4fvNV -1 "GLenum target, GLuint index, const GLfloat * params") +(void ProgramParameters4dvNV -1 "GLenum target, GLuint index, GLuint num, const GLdouble * params") +(void ProgramParameters4fvNV -1 "GLenum target, GLuint index, GLuint num, const GLfloat * params") +(void RequestResidentProgramsNV -1 "GLsizei n, const GLuint * ids") +(void TrackMatrixNV -1 "GLenum target, GLuint address, GLenum matrix, GLenum transform") +(void VertexAttribPointerNV -1 "GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer") +(void VertexAttrib1dNV -1 "GLuint index, GLdouble x") +(void VertexAttrib1dvNV -1 "GLuint index, const GLdouble * v") +(void VertexAttrib1fNV -1 "GLuint index, GLfloat x") +(void VertexAttrib1fvNV -1 "GLuint index, const GLfloat * v") +(void VertexAttrib1sNV -1 "GLuint index, GLshort x") +(void VertexAttrib1svNV -1 "GLuint index, const GLshort * v") +(void VertexAttrib2dNV -1 "GLuint index, GLdouble x, GLdouble y") +(void VertexAttrib2dvNV -1 "GLuint index, const GLdouble * v") +(void VertexAttrib2fNV -1 "GLuint index, GLfloat x, GLfloat y") +(void VertexAttrib2fvNV -1 "GLuint index, const GLfloat * v") +(void VertexAttrib2sNV -1 "GLuint index, GLshort x, GLshort y") +(void VertexAttrib2svNV -1 "GLuint index, const GLshort * v") +(void VertexAttrib3dNV -1 "GLuint index, GLdouble x, GLdouble y, GLdouble z") +(void VertexAttrib3dvNV -1 "GLuint index, const GLdouble * v") +(void VertexAttrib3fNV -1 "GLuint index, GLfloat x, GLfloat y, GLfloat z") +(void VertexAttrib3fvNV -1 "GLuint index, const GLfloat * v") +(void VertexAttrib3sNV -1 "GLuint index, GLshort x, GLshort y, GLshort z") +(void VertexAttrib3svNV -1 "GLuint index, const GLshort * v") +(void VertexAttrib4dNV -1 "GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w") +(void VertexAttrib4dvNV -1 "GLuint index, const GLdouble * v") +(void VertexAttrib4fNV -1 "GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w") +(void VertexAttrib4fvNV -1 "GLuint index, const GLfloat * v") +(void VertexAttrib4sNV -1 "GLuint index, GLshort x, GLshort y, GLshort z, GLshort w") +(void VertexAttrib4svNV -1 "GLuint index, const GLshort * v") +(void VertexAttrib4ubNV -1 "GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w") +(void VertexAttrib4ubvNV -1 "GLuint index, const GLubyte * v") +(void VertexAttribs1dvNV -1 "GLuint index, GLsizei n, const GLdouble * v") +(void VertexAttribs1fvNV -1 "GLuint index, GLsizei n, const GLfloat * v") +(void VertexAttribs1svNV -1 "GLuint index, GLsizei n, const GLshort * v") +(void VertexAttribs2dvNV -1 "GLuint index, GLsizei n, const GLdouble * v") +(void VertexAttribs2fvNV -1 "GLuint index, GLsizei n, const GLfloat * v") +(void VertexAttribs2svNV -1 "GLuint index, GLsizei n, const GLshort * v") +(void VertexAttribs3dvNV -1 "GLuint index, GLsizei n, const GLdouble * v") +(void VertexAttribs3fvNV -1 "GLuint index, GLsizei n, const GLfloat * v") +(void VertexAttribs3svNV -1 "GLuint index, GLsizei n, const GLshort * v") +(void VertexAttribs4dvNV -1 "GLuint index, GLsizei n, const GLdouble * v") +(void VertexAttribs4fvNV -1 "GLuint index, GLsizei n, const GLfloat * v") +(void VertexAttribs4svNV -1 "GLuint index, GLsizei n, const GLshort * v") +(void VertexAttribs4ubvNV -1 "GLuint index, GLsizei n, const GLubyte * v") +(void PointParameteriNV 542 "GLenum pname, GLint params") +(void PointParameterivNV 543 "GLenum pname, const GLint * params") +(void MultiDrawArraysEXT 567 "GLenum mode, GLint * first, GLsizei * count, GLsizei primcount") +(void MultiDrawElementsEXT 568 "GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount") +(void ActiveStencilFaceEXT 585 "GLenum face") +(void DeleteFencesNV -1 "GLsizei n, const GLuint * fences") +(void GenFencesNV -1 "GLsizei n, GLuint * fences") +(GLboolean IsFenceNV -1 "GLuint fence") +(GLboolean TestFenceNV -1 "GLuint fence") +(void GetFenceivNV -1 "GLuint fence, GLenum pname, GLint * params") +(void FinishFenceNV -1 "GLuint fence") +(void SetFenceNV -1 "GLuint fence, GLenum condition") + +;; Entry points that exist in standard XFree86 libGL, but aren't in the +;; Mesa dispatch table, and aren't in OpenGL.framework + +(void ArrayElementEXT -1 "GLint i" ArrayElement) +(void BindTextureEXT -1 "GLenum target, GLuint texture" BindTexture) +(void BlendFuncSeparateINGR -1 "GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha" BlendFuncSeparateEXT) +(void ColorTableParameterfvSGI -1 "GLenum target, GLenum pname, const GLfloat * params" ColorTableParameterfv) +(void ColorTableParameterivSGI -1 "GLenum target, GLenum pname, const GLint * params" ColorTableParameteriv) +(void ColorTableSGI -1 "GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table" ColorTable) +(void ConvolutionFilter1DEXT -1 "GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image" ConvolutionFilter1D) +(void ConvolutionFilter2DEXT -1 "GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image" ConvolutionFilter2D) +(void ConvolutionParameterfEXT -1 "GLenum target, GLenum pname, GLfloat params" ConvolutionParameterf) +(void ConvolutionParameterfvEXT -1 "GLenum target, GLenum pname, const GLfloat * params" ConvolutionParameterfv) +(void ConvolutionParameteriEXT -1 "GLenum target, GLenum pname, GLint params" ConvolutionParameteri) +(void ConvolutionParameterivEXT -1 "GLenum target, GLenum pname, const GLint * params" ConvolutionParameteriv) +(void CopyColorSubTableEXT -1 "GLenum target, GLsizei start, GLint x, GLint y, GLsizei width" CopyColorSubTable) +(void CopyColorTableSGI -1 "GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width" CopyColorTable) +(void CopyConvolutionFilter1DEXT -1 "GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width" CopyConvolutionFilter1D) +(void CopyConvolutionFilter2DEXT -1 "GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height" CopyConvolutionFilter2D) +(void CopyTexImage1DEXT -1 "GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border" CopyTexImage1D) +(void CopyTexImage2DEXT -1 "GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border" CopyTexImage2D) +(void CopyTexSubImage1DEXT -1 "GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width" CopyTexSubImage1D) +(void CopyTexSubImage2DEXT -1 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height" CopyTexSubImage2D) +(void CopyTexSubImage3DEXT -1 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height" CopyTexSubImage3D) +(void DeleteTexturesEXT -1 "GLsizei n, const GLuint *textures" DeleteTextures) +(void DrawArraysEXT -1 "GLenum mode, GLint first, GLsizei count" DrawArrays) +(void GetPointervEXT -1 "GLenum pname, GLvoid * * params" GetPointerv) +(void HistogramEXT -1 "GLenum target, GLsizei width, GLenum internalformat, GLboolean sink" Histogram) +(void MinmaxEXT -1 "GLenum target, GLenum internalformat, GLboolean sink" Minmax) +(void PointParameterfSGIS -1 "GLenum pname, GLfloat param" PointParameterf) +(void PointParameterfvSGIS -1 "GLenum pname, const GLfloat * params" PointParameterfv) +(void PointParameteri -1 "GLenum pname, GLint params" PointParameteriNV) +(void PointParameteriv -1 "GLenum pname, const GLint * params" PointParameterivNV) +(void PrioritizeTexturesEXT -1 "GLsizei n, const GLenum * textures, const GLclampf * priorities" PrioritizeTextures) +(void ResetHistogramEXT -1 "GLenum target" ResetHistogram) +(void ResetMinmaxEXT -1 "GLenum target" ResetMinmax) +(void SampleMaskEXT -1 "GLclampf value, GLboolean invert" SampleMaskSGIS) +(void SamplePatternEXT -1 "GLenum pattern" SamplePatternSGIS) +(void SeparableFilter2DEXT -1 "GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column" SeparableFilter2D) +(void TexImage3DEXT -1 "GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels" TexImage3D) +(void TexSubImage1DEXT -1 "GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels" TexSubImage1D) +(void TexSubImage2DEXT -1 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels" TexSubImage2D) +(void TexSubImage3DEXT -1 "GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels" TexSubImage3D) Index: xc/lib/GL/apple/dri_dispatch.h diff -u /dev/null xc/lib/GL/apple/dri_dispatch.h:1.5 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/dri_dispatch.h Fri Jan 16 19:38:12 2004 @@ -0,0 +1,3245 @@ +/* dri_dispatch.h -- built automatically, DO NOT EDIT + $Id$ + $XFree86: xc/lib/GL/apple/dri_dispatch.h,v 1.5 2004/01/17 00:38:12 torrey Exp $ */ + +DEFUN_LOCAL_VOID (NewList, + (void *rend, GLuint list, GLenum mode), + (list, mode)) + +DEFUN_LOCAL_VOID (EndList, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (CallList, + (void *rend, GLuint list), + (list)) + +DEFUN_LOCAL_VOID (CallLists, + (void *rend, GLsizei n, GLenum type, const GLvoid * lists), + (n, type, lists)) + +DEFUN_LOCAL_VOID (DeleteLists, + (void *rend, GLuint list, GLsizei range), + (list, range)) + +DEFUN_LOCAL (GLuint, GenLists, + (void *rend, GLsizei range), + (range)) + +DEFUN_LOCAL_VOID (ListBase, + (void *rend, GLuint base), + (base)) + +DEFUN_LOCAL_VOID (Begin, + (void *rend, GLenum mode), + (mode)) + +DEFUN_LOCAL_VOID (Bitmap, + (void *rend, GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap), + (width, height, xorig, yorig, xmove, ymove, bitmap)) + +DEFUN_LOCAL_VOID (Color3b, + (void *rend, GLbyte red, GLbyte green, GLbyte blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (Color3bv, + (void *rend, const GLbyte * v), + (v)) + +DEFUN_LOCAL_VOID (Color3d, + (void *rend, GLdouble red, GLdouble green, GLdouble blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (Color3dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (Color3f, + (void *rend, GLfloat red, GLfloat green, GLfloat blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (Color3fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (Color3i, + (void *rend, GLint red, GLint green, GLint blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (Color3iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (Color3s, + (void *rend, GLshort red, GLshort green, GLshort blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (Color3sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (Color3ub, + (void *rend, GLubyte red, GLubyte green, GLubyte blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (Color3ubv, + (void *rend, const GLubyte * v), + (v)) + +DEFUN_LOCAL_VOID (Color3ui, + (void *rend, GLuint red, GLuint green, GLuint blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (Color3uiv, + (void *rend, const GLuint * v), + (v)) + +DEFUN_LOCAL_VOID (Color3us, + (void *rend, GLushort red, GLushort green, GLushort blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (Color3usv, + (void *rend, const GLushort * v), + (v)) + +DEFUN_LOCAL_VOID (Color4b, + (void *rend, GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (Color4bv, + (void *rend, const GLbyte * v), + (v)) + +DEFUN_LOCAL_VOID (Color4d, + (void *rend, GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (Color4dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (Color4f, + (void *rend, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (Color4fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (Color4i, + (void *rend, GLint red, GLint green, GLint blue, GLint alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (Color4iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (Color4s, + (void *rend, GLshort red, GLshort green, GLshort blue, GLshort alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (Color4sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (Color4ub, + (void *rend, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (Color4ubv, + (void *rend, const GLubyte * v), + (v)) + +DEFUN_LOCAL_VOID (Color4ui, + (void *rend, GLuint red, GLuint green, GLuint blue, GLuint alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (Color4uiv, + (void *rend, const GLuint * v), + (v)) + +DEFUN_LOCAL_VOID (Color4us, + (void *rend, GLushort red, GLushort green, GLushort blue, GLushort alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (Color4usv, + (void *rend, const GLushort * v), + (v)) + +DEFUN_LOCAL_VOID (EdgeFlag, + (void *rend, GLboolean flag), + (flag)) + +DEFUN_LOCAL_VOID (EdgeFlagv, + (void *rend, const GLboolean * flag), + (flag)) + +DEFUN_LOCAL_VOID (End, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (Indexd, + (void *rend, GLdouble c), + (c)) + +DEFUN_LOCAL_VOID (Indexdv, + (void *rend, const GLdouble * c), + (c)) + +DEFUN_LOCAL_VOID (Indexf, + (void *rend, GLfloat c), + (c)) + +DEFUN_LOCAL_VOID (Indexfv, + (void *rend, const GLfloat * c), + (c)) + +DEFUN_LOCAL_VOID (Indexi, + (void *rend, GLint c), + (c)) + +DEFUN_LOCAL_VOID (Indexiv, + (void *rend, const GLint * c), + (c)) + +DEFUN_LOCAL_VOID (Indexs, + (void *rend, GLshort c), + (c)) + +DEFUN_LOCAL_VOID (Indexsv, + (void *rend, const GLshort * c), + (c)) + +DEFUN_LOCAL_VOID (Normal3b, + (void *rend, GLbyte nx, GLbyte ny, GLbyte nz), + (nx, ny, nz)) + +DEFUN_LOCAL_VOID (Normal3bv, + (void *rend, const GLbyte * v), + (v)) + +DEFUN_LOCAL_VOID (Normal3d, + (void *rend, GLdouble nx, GLdouble ny, GLdouble nz), + (nx, ny, nz)) + +DEFUN_LOCAL_VOID (Normal3dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (Normal3f, + (void *rend, GLfloat nx, GLfloat ny, GLfloat nz), + (nx, ny, nz)) + +DEFUN_LOCAL_VOID (Normal3fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (Normal3i, + (void *rend, GLint nx, GLint ny, GLint nz), + (nx, ny, nz)) + +DEFUN_LOCAL_VOID (Normal3iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (Normal3s, + (void *rend, GLshort nx, GLshort ny, GLshort nz), + (nx, ny, nz)) + +DEFUN_LOCAL_VOID (Normal3sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos2d, + (void *rend, GLdouble x, GLdouble y), + (x, y)) + +DEFUN_LOCAL_VOID (RasterPos2dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos2f, + (void *rend, GLfloat x, GLfloat y), + (x, y)) + +DEFUN_LOCAL_VOID (RasterPos2fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos2i, + (void *rend, GLint x, GLint y), + (x, y)) + +DEFUN_LOCAL_VOID (RasterPos2iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos2s, + (void *rend, GLshort x, GLshort y), + (x, y)) + +DEFUN_LOCAL_VOID (RasterPos2sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos3d, + (void *rend, GLdouble x, GLdouble y, GLdouble z), + (x, y, z)) + +DEFUN_LOCAL_VOID (RasterPos3dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos3f, + (void *rend, GLfloat x, GLfloat y, GLfloat z), + (x, y, z)) + +DEFUN_LOCAL_VOID (RasterPos3fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos3i, + (void *rend, GLint x, GLint y, GLint z), + (x, y, z)) + +DEFUN_LOCAL_VOID (RasterPos3iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos3s, + (void *rend, GLshort x, GLshort y, GLshort z), + (x, y, z)) + +DEFUN_LOCAL_VOID (RasterPos3sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos4d, + (void *rend, GLdouble x, GLdouble y, GLdouble z, GLdouble w), + (x, y, z, w)) + +DEFUN_LOCAL_VOID (RasterPos4dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos4f, + (void *rend, GLfloat x, GLfloat y, GLfloat z, GLfloat w), + (x, y, z, w)) + +DEFUN_LOCAL_VOID (RasterPos4fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos4i, + (void *rend, GLint x, GLint y, GLint z, GLint w), + (x, y, z, w)) + +DEFUN_LOCAL_VOID (RasterPos4iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (RasterPos4s, + (void *rend, GLshort x, GLshort y, GLshort z, GLshort w), + (x, y, z, w)) + +DEFUN_LOCAL_VOID (RasterPos4sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (Rectd, + (void *rend, GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2), + (x1, y1, x2, y2)) + +DEFUN_LOCAL_VOID (Rectdv, + (void *rend, const GLdouble * v1, const GLdouble * v2), + (v1, v2)) + +DEFUN_LOCAL_VOID (Rectf, + (void *rend, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2), + (x1, y1, x2, y2)) + +DEFUN_LOCAL_VOID (Rectfv, + (void *rend, const GLfloat * v1, const GLfloat * v2), + (v1, v2)) + +DEFUN_LOCAL_VOID (Recti, + (void *rend, GLint x1, GLint y1, GLint x2, GLint y2), + (x1, y1, x2, y2)) + +DEFUN_LOCAL_VOID (Rectiv, + (void *rend, const GLint * v1, const GLint * v2), + (v1, v2)) + +DEFUN_LOCAL_VOID (Rects, + (void *rend, GLshort x1, GLshort y1, GLshort x2, GLshort y2), + (x1, y1, x2, y2)) + +DEFUN_LOCAL_VOID (Rectsv, + (void *rend, const GLshort * v1, const GLshort * v2), + (v1, v2)) + +DEFUN_LOCAL_VOID (TexCoord1d, + (void *rend, GLdouble s), + (s)) + +DEFUN_LOCAL_VOID (TexCoord1dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord1f, + (void *rend, GLfloat s), + (s)) + +DEFUN_LOCAL_VOID (TexCoord1fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord1i, + (void *rend, GLint s), + (s)) + +DEFUN_LOCAL_VOID (TexCoord1iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord1s, + (void *rend, GLshort s), + (s)) + +DEFUN_LOCAL_VOID (TexCoord1sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord2d, + (void *rend, GLdouble s, GLdouble t), + (s, t)) + +DEFUN_LOCAL_VOID (TexCoord2dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord2f, + (void *rend, GLfloat s, GLfloat t), + (s, t)) + +DEFUN_LOCAL_VOID (TexCoord2fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord2i, + (void *rend, GLint s, GLint t), + (s, t)) + +DEFUN_LOCAL_VOID (TexCoord2iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord2s, + (void *rend, GLshort s, GLshort t), + (s, t)) + +DEFUN_LOCAL_VOID (TexCoord2sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord3d, + (void *rend, GLdouble s, GLdouble t, GLdouble r), + (s, t, r)) + +DEFUN_LOCAL_VOID (TexCoord3dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord3f, + (void *rend, GLfloat s, GLfloat t, GLfloat r), + (s, t, r)) + +DEFUN_LOCAL_VOID (TexCoord3fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord3i, + (void *rend, GLint s, GLint t, GLint r), + (s, t, r)) + +DEFUN_LOCAL_VOID (TexCoord3iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord3s, + (void *rend, GLshort s, GLshort t, GLshort r), + (s, t, r)) + +DEFUN_LOCAL_VOID (TexCoord3sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord4d, + (void *rend, GLdouble s, GLdouble t, GLdouble r, GLdouble q), + (s, t, r, q)) + +DEFUN_LOCAL_VOID (TexCoord4dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord4f, + (void *rend, GLfloat s, GLfloat t, GLfloat r, GLfloat q), + (s, t, r, q)) + +DEFUN_LOCAL_VOID (TexCoord4fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord4i, + (void *rend, GLint s, GLint t, GLint r, GLint q), + (s, t, r, q)) + +DEFUN_LOCAL_VOID (TexCoord4iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (TexCoord4s, + (void *rend, GLshort s, GLshort t, GLshort r, GLshort q), + (s, t, r, q)) + +DEFUN_LOCAL_VOID (TexCoord4sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex2d, + (void *rend, GLdouble x, GLdouble y), + (x, y)) + +DEFUN_LOCAL_VOID (Vertex2dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex2f, + (void *rend, GLfloat x, GLfloat y), + (x, y)) + +DEFUN_LOCAL_VOID (Vertex2fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex2i, + (void *rend, GLint x, GLint y), + (x, y)) + +DEFUN_LOCAL_VOID (Vertex2iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex2s, + (void *rend, GLshort x, GLshort y), + (x, y)) + +DEFUN_LOCAL_VOID (Vertex2sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex3d, + (void *rend, GLdouble x, GLdouble y, GLdouble z), + (x, y, z)) + +DEFUN_LOCAL_VOID (Vertex3dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex3f, + (void *rend, GLfloat x, GLfloat y, GLfloat z), + (x, y, z)) + +DEFUN_LOCAL_VOID (Vertex3fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex3i, + (void *rend, GLint x, GLint y, GLint z), + (x, y, z)) + +DEFUN_LOCAL_VOID (Vertex3iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex3s, + (void *rend, GLshort x, GLshort y, GLshort z), + (x, y, z)) + +DEFUN_LOCAL_VOID (Vertex3sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex4d, + (void *rend, GLdouble x, GLdouble y, GLdouble z, GLdouble w), + (x, y, z, w)) + +DEFUN_LOCAL_VOID (Vertex4dv, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex4f, + (void *rend, GLfloat x, GLfloat y, GLfloat z, GLfloat w), + (x, y, z, w)) + +DEFUN_LOCAL_VOID (Vertex4fv, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex4i, + (void *rend, GLint x, GLint y, GLint z, GLint w), + (x, y, z, w)) + +DEFUN_LOCAL_VOID (Vertex4iv, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (Vertex4s, + (void *rend, GLshort x, GLshort y, GLshort z, GLshort w), + (x, y, z, w)) + +DEFUN_LOCAL_VOID (Vertex4sv, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (ClipPlane, + (void *rend, GLenum plane, const GLdouble * equation), + (plane, equation)) + +DEFUN_LOCAL_VOID (ColorMaterial, + (void *rend, GLenum face, GLenum mode), + (face, mode)) + +DEFUN_LOCAL_VOID (CullFace, + (void *rend, GLenum mode), + (mode)) + +DEFUN_LOCAL_VOID (Fogf, + (void *rend, GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_LOCAL_VOID (Fogfv, + (void *rend, GLenum pname, const GLfloat * params), + (pname, params)) + +DEFUN_LOCAL_VOID (Fogi, + (void *rend, GLenum pname, GLint param), + (pname, param)) + +DEFUN_LOCAL_VOID (Fogiv, + (void *rend, GLenum pname, const GLint * params), + (pname, params)) + +DEFUN_LOCAL_VOID (FrontFace, + (void *rend, GLenum mode), + (mode)) + +DEFUN_LOCAL_VOID (Hint, + (void *rend, GLenum target, GLenum mode), + (target, mode)) + +DEFUN_LOCAL_VOID (Lightf, + (void *rend, GLenum light, GLenum pname, GLfloat param), + (light, pname, param)) + +DEFUN_LOCAL_VOID (Lightfv, + (void *rend, GLenum light, GLenum pname, const GLfloat * params), + (light, pname, params)) + +DEFUN_LOCAL_VOID (Lighti, + (void *rend, GLenum light, GLenum pname, GLint param), + (light, pname, param)) + +DEFUN_LOCAL_VOID (Lightiv, + (void *rend, GLenum light, GLenum pname, const GLint * params), + (light, pname, params)) + +DEFUN_LOCAL_VOID (LightModelf, + (void *rend, GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_LOCAL_VOID (LightModelfv, + (void *rend, GLenum pname, const GLfloat * params), + (pname, params)) + +DEFUN_LOCAL_VOID (LightModeli, + (void *rend, GLenum pname, GLint param), + (pname, param)) + +DEFUN_LOCAL_VOID (LightModeliv, + (void *rend, GLenum pname, const GLint * params), + (pname, params)) + +DEFUN_LOCAL_VOID (LineStipple, + (void *rend, GLint factor, GLushort pattern), + (factor, pattern)) + +DEFUN_LOCAL_VOID (LineWidth, + (void *rend, GLfloat width), + (width)) + +DEFUN_LOCAL_VOID (Materialf, + (void *rend, GLenum face, GLenum pname, GLfloat param), + (face, pname, param)) + +DEFUN_LOCAL_VOID (Materialfv, + (void *rend, GLenum face, GLenum pname, const GLfloat * params), + (face, pname, params)) + +DEFUN_LOCAL_VOID (Materiali, + (void *rend, GLenum face, GLenum pname, GLint param), + (face, pname, param)) + +DEFUN_LOCAL_VOID (Materialiv, + (void *rend, GLenum face, GLenum pname, const GLint * params), + (face, pname, params)) + +DEFUN_LOCAL_VOID (PointSize, + (void *rend, GLfloat size), + (size)) + +DEFUN_LOCAL_VOID (PolygonMode, + (void *rend, GLenum face, GLenum mode), + (face, mode)) + +DEFUN_LOCAL_VOID (PolygonStipple, + (void *rend, const GLubyte * mask), + (mask)) + +DEFUN_LOCAL_VOID (Scissor, + (void *rend, GLint x, GLint y, GLsizei width, GLsizei height), + (x, y, width, height)) + +DEFUN_LOCAL_VOID (ShadeModel, + (void *rend, GLenum mode), + (mode)) + +DEFUN_LOCAL_VOID (TexParameterf, + (void *rend, GLenum target, GLenum pname, GLfloat param), + (target, pname, param)) + +DEFUN_LOCAL_VOID (TexParameterfv, + (void *rend, GLenum target, GLenum pname, const GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (TexParameteri, + (void *rend, GLenum target, GLenum pname, GLint param), + (target, pname, param)) + +DEFUN_LOCAL_VOID (TexParameteriv, + (void *rend, GLenum target, GLenum pname, const GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (TexImage1D, + (void *rend, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, internalformat, width, border, format, type, pixels)) + +DEFUN_LOCAL_VOID (TexImage2D, + (void *rend, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, internalformat, width, height, border, format, type, pixels)) + +DEFUN_LOCAL_VOID (TexEnvf, + (void *rend, GLenum target, GLenum pname, GLfloat param), + (target, pname, param)) + +DEFUN_LOCAL_VOID (TexEnvfv, + (void *rend, GLenum target, GLenum pname, const GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (TexEnvi, + (void *rend, GLenum target, GLenum pname, GLint param), + (target, pname, param)) + +DEFUN_LOCAL_VOID (TexEnviv, + (void *rend, GLenum target, GLenum pname, const GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (TexGend, + (void *rend, GLenum coord, GLenum pname, GLdouble param), + (coord, pname, param)) + +DEFUN_LOCAL_VOID (TexGendv, + (void *rend, GLenum coord, GLenum pname, const GLdouble * params), + (coord, pname, params)) + +DEFUN_LOCAL_VOID (TexGenf, + (void *rend, GLenum coord, GLenum pname, GLfloat param), + (coord, pname, param)) + +DEFUN_LOCAL_VOID (TexGenfv, + (void *rend, GLenum coord, GLenum pname, const GLfloat * params), + (coord, pname, params)) + +DEFUN_LOCAL_VOID (TexGeni, + (void *rend, GLenum coord, GLenum pname, GLint param), + (coord, pname, param)) + +DEFUN_LOCAL_VOID (TexGeniv, + (void *rend, GLenum coord, GLenum pname, const GLint * params), + (coord, pname, params)) + +DEFUN_LOCAL_VOID (FeedbackBuffer, + (void *rend, GLsizei size, GLenum type, GLfloat * buffer), + (size, type, buffer)) + +DEFUN_LOCAL_VOID (SelectBuffer, + (void *rend, GLsizei size, GLuint * buffer), + (size, buffer)) + +DEFUN_LOCAL (GLint, RenderMode, + (void *rend, GLenum mode), + (mode)) + +DEFUN_LOCAL_VOID (InitNames, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (LoadName, + (void *rend, GLuint name), + (name)) + +DEFUN_LOCAL_VOID (PassThrough, + (void *rend, GLfloat token), + (token)) + +DEFUN_LOCAL_VOID (PopName, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (PushName, + (void *rend, GLuint name), + (name)) + +DEFUN_LOCAL_VOID (DrawBuffer, + (void *rend, GLenum mode), + (mode)) + +DEFUN_LOCAL_VOID (Clear, + (void *rend, GLbitfield mask), + (mask)) + +DEFUN_LOCAL_VOID (ClearAccum, + (void *rend, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (ClearIndex, + (void *rend, GLfloat c), + (c)) + +DEFUN_LOCAL_VOID (ClearColor, + (void *rend, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (ClearStencil, + (void *rend, GLint s), + (s)) + +DEFUN_LOCAL_VOID (ClearDepth, + (void *rend, GLclampd depth), + (depth)) + +DEFUN_LOCAL_VOID (StencilMask, + (void *rend, GLuint mask), + (mask)) + +DEFUN_LOCAL_VOID (ColorMask, + (void *rend, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (DepthMask, + (void *rend, GLboolean flag), + (flag)) + +DEFUN_LOCAL_VOID (IndexMask, + (void *rend, GLuint mask), + (mask)) + +DEFUN_LOCAL_VOID (Accum, + (void *rend, GLenum op, GLfloat value), + (op, value)) + +DEFUN_LOCAL_VOID (Disable, + (void *rend, GLenum cap), + (cap)) + +DEFUN_LOCAL_VOID (Enable, + (void *rend, GLenum cap), + (cap)) + +DEFUN_LOCAL_VOID (Finish, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (Flush, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (PopAttrib, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (PushAttrib, + (void *rend, GLbitfield mask), + (mask)) + +DEFUN_LOCAL_VOID (Map1d, + (void *rend, GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points), + (target, u1, u2, stride, order, points)) + +DEFUN_LOCAL_VOID (Map1f, + (void *rend, GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points), + (target, u1, u2, stride, order, points)) + +DEFUN_LOCAL_VOID (Map2d, + (void *rend, GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points), + (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points)) + +DEFUN_LOCAL_VOID (Map2f, + (void *rend, GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points), + (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points)) + +DEFUN_LOCAL_VOID (MapGrid1d, + (void *rend, GLint un, GLdouble u1, GLdouble u2), + (un, u1, u2)) + +DEFUN_LOCAL_VOID (MapGrid1f, + (void *rend, GLint un, GLfloat u1, GLfloat u2), + (un, u1, u2)) + +DEFUN_LOCAL_VOID (MapGrid2d, + (void *rend, GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2), + (un, u1, u2, vn, v1, v2)) + +DEFUN_LOCAL_VOID (MapGrid2f, + (void *rend, GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2), + (un, u1, u2, vn, v1, v2)) + +DEFUN_LOCAL_VOID (EvalCoord1d, + (void *rend, GLdouble u), + (u)) + +DEFUN_LOCAL_VOID (EvalCoord1dv, + (void *rend, const GLdouble * u), + (u)) + +DEFUN_LOCAL_VOID (EvalCoord1f, + (void *rend, GLfloat u), + (u)) + +DEFUN_LOCAL_VOID (EvalCoord1fv, + (void *rend, const GLfloat * u), + (u)) + +DEFUN_LOCAL_VOID (EvalCoord2d, + (void *rend, GLdouble u, GLdouble v), + (u, v)) + +DEFUN_LOCAL_VOID (EvalCoord2dv, + (void *rend, const GLdouble * u), + (u)) + +DEFUN_LOCAL_VOID (EvalCoord2f, + (void *rend, GLfloat u, GLfloat v), + (u, v)) + +DEFUN_LOCAL_VOID (EvalCoord2fv, + (void *rend, const GLfloat * u), + (u)) + +DEFUN_LOCAL_VOID (EvalMesh1, + (void *rend, GLenum mode, GLint i1, GLint i2), + (mode, i1, i2)) + +DEFUN_LOCAL_VOID (EvalPoint1, + (void *rend, GLint i), + (i)) + +DEFUN_LOCAL_VOID (EvalMesh2, + (void *rend, GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2), + (mode, i1, i2, j1, j2)) + +DEFUN_LOCAL_VOID (EvalPoint2, + (void *rend, GLint i, GLint j), + (i, j)) + +DEFUN_LOCAL_VOID (AlphaFunc, + (void *rend, GLenum func, GLclampf ref), + (func, ref)) + +DEFUN_LOCAL_VOID (BlendFunc, + (void *rend, GLenum sfactor, GLenum dfactor), + (sfactor, dfactor)) + +DEFUN_LOCAL_VOID (LogicOp, + (void *rend, GLenum opcode), + (opcode)) + +DEFUN_LOCAL_VOID (StencilFunc, + (void *rend, GLenum func, GLint ref, GLuint mask), + (func, ref, mask)) + +DEFUN_LOCAL_VOID (StencilOp, + (void *rend, GLenum fail, GLenum zfail, GLenum zpass), + (fail, zfail, zpass)) + +DEFUN_LOCAL_VOID (DepthFunc, + (void *rend, GLenum func), + (func)) + +DEFUN_LOCAL_VOID (PixelZoom, + (void *rend, GLfloat xfactor, GLfloat yfactor), + (xfactor, yfactor)) + +DEFUN_LOCAL_VOID (PixelTransferf, + (void *rend, GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_LOCAL_VOID (PixelTransferi, + (void *rend, GLenum pname, GLint param), + (pname, param)) + +DEFUN_LOCAL_VOID (PixelStoref, + (void *rend, GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_LOCAL_VOID (PixelStorei, + (void *rend, GLenum pname, GLint param), + (pname, param)) + +DEFUN_LOCAL_VOID (PixelMapfv, + (void *rend, GLenum map, GLint mapsize, const GLfloat * values), + (map, mapsize, values)) + +DEFUN_LOCAL_VOID (PixelMapuiv, + (void *rend, GLenum map, GLint mapsize, const GLuint * values), + (map, mapsize, values)) + +DEFUN_LOCAL_VOID (PixelMapusv, + (void *rend, GLenum map, GLint mapsize, const GLushort * values), + (map, mapsize, values)) + +DEFUN_LOCAL_VOID (ReadBuffer, + (void *rend, GLenum mode), + (mode)) + +DEFUN_LOCAL_VOID (CopyPixels, + (void *rend, GLint x, GLint y, GLsizei width, GLsizei height, GLenum type), + (x, y, width, height, type)) + +DEFUN_LOCAL_VOID (ReadPixels, + (void *rend, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels), + (x, y, width, height, format, type, pixels)) + +DEFUN_LOCAL_VOID (DrawPixels, + (void *rend, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels), + (width, height, format, type, pixels)) + +DEFUN_LOCAL_VOID (GetBooleanv, + (void *rend, GLenum pname, GLboolean * params), + (pname, params)) + +DEFUN_LOCAL_VOID (GetClipPlane, + (void *rend, GLenum plane, GLdouble * equation), + (plane, equation)) + +DEFUN_LOCAL_VOID (GetDoublev, + (void *rend, GLenum pname, GLdouble * params), + (pname, params)) + +DEFUN_LOCAL (GLenum, GetError, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (GetFloatv, + (void *rend, GLenum pname, GLfloat * params), + (pname, params)) + +DEFUN_LOCAL_VOID (GetIntegerv, + (void *rend, GLenum pname, GLint * params), + (pname, params)) + +DEFUN_LOCAL_VOID (GetLightfv, + (void *rend, GLenum light, GLenum pname, GLfloat * params), + (light, pname, params)) + +DEFUN_LOCAL_VOID (GetLightiv, + (void *rend, GLenum light, GLenum pname, GLint * params), + (light, pname, params)) + +DEFUN_LOCAL_VOID (GetMapdv, + (void *rend, GLenum target, GLenum query, GLdouble * v), + (target, query, v)) + +DEFUN_LOCAL_VOID (GetMapfv, + (void *rend, GLenum target, GLenum query, GLfloat * v), + (target, query, v)) + +DEFUN_LOCAL_VOID (GetMapiv, + (void *rend, GLenum target, GLenum query, GLint * v), + (target, query, v)) + +DEFUN_LOCAL_VOID (GetMaterialfv, + (void *rend, GLenum face, GLenum pname, GLfloat * params), + (face, pname, params)) + +DEFUN_LOCAL_VOID (GetMaterialiv, + (void *rend, GLenum face, GLenum pname, GLint * params), + (face, pname, params)) + +DEFUN_LOCAL_VOID (GetPixelMapfv, + (void *rend, GLenum map, GLfloat * values), + (map, values)) + +DEFUN_LOCAL_VOID (GetPixelMapuiv, + (void *rend, GLenum map, GLuint * values), + (map, values)) + +DEFUN_LOCAL_VOID (GetPixelMapusv, + (void *rend, GLenum map, GLushort * values), + (map, values)) + +DEFUN_LOCAL_VOID (GetPolygonStipple, + (void *rend, GLubyte * mask), + (mask)) + +DEFUN_LOCAL (const GLubyte *, GetString, + (void *rend, GLenum name), + (name)) + +DEFUN_LOCAL_VOID (GetTexEnvfv, + (void *rend, GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetTexEnviv, + (void *rend, GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetTexGendv, + (void *rend, GLenum coord, GLenum pname, GLdouble * params), + (coord, pname, params)) + +DEFUN_LOCAL_VOID (GetTexGenfv, + (void *rend, GLenum coord, GLenum pname, GLfloat * params), + (coord, pname, params)) + +DEFUN_LOCAL_VOID (GetTexGeniv, + (void *rend, GLenum coord, GLenum pname, GLint * params), + (coord, pname, params)) + +DEFUN_LOCAL_VOID (GetTexImage, + (void *rend, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels), + (target, level, format, type, pixels)) + +DEFUN_LOCAL_VOID (GetTexParameterfv, + (void *rend, GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetTexParameteriv, + (void *rend, GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetTexLevelParameterfv, + (void *rend, GLenum target, GLint level, GLenum pname, GLfloat * params), + (target, level, pname, params)) + +DEFUN_LOCAL_VOID (GetTexLevelParameteriv, + (void *rend, GLenum target, GLint level, GLenum pname, GLint * params), + (target, level, pname, params)) + +DEFUN_LOCAL (GLboolean, IsEnabled, + (void *rend, GLenum cap), + (cap)) + +DEFUN_LOCAL (GLboolean, IsList, + (void *rend, GLuint list), + (list)) + +DEFUN_LOCAL_VOID (DepthRange, + (void *rend, GLclampd zNear, GLclampd zFar), + (zNear, zFar)) + +DEFUN_LOCAL_VOID (Frustum, + (void *rend, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar), + (left, right, bottom, top, zNear, zFar)) + +DEFUN_LOCAL_VOID (LoadIdentity, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (LoadMatrixf, + (void *rend, const GLfloat * m), + (m)) + +DEFUN_LOCAL_VOID (LoadMatrixd, + (void *rend, const GLdouble * m), + (m)) + +DEFUN_LOCAL_VOID (MatrixMode, + (void *rend, GLenum mode), + (mode)) + +DEFUN_LOCAL_VOID (MultMatrixf, + (void *rend, const GLfloat * m), + (m)) + +DEFUN_LOCAL_VOID (MultMatrixd, + (void *rend, const GLdouble * m), + (m)) + +DEFUN_LOCAL_VOID (Ortho, + (void *rend, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar), + (left, right, bottom, top, zNear, zFar)) + +DEFUN_LOCAL_VOID (PopMatrix, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (PushMatrix, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (Rotated, + (void *rend, GLdouble angle, GLdouble x, GLdouble y, GLdouble z), + (angle, x, y, z)) + +DEFUN_LOCAL_VOID (Rotatef, + (void *rend, GLfloat angle, GLfloat x, GLfloat y, GLfloat z), + (angle, x, y, z)) + +DEFUN_LOCAL_VOID (Scaled, + (void *rend, GLdouble x, GLdouble y, GLdouble z), + (x, y, z)) + +DEFUN_LOCAL_VOID (Scalef, + (void *rend, GLfloat x, GLfloat y, GLfloat z), + (x, y, z)) + +DEFUN_LOCAL_VOID (Translated, + (void *rend, GLdouble x, GLdouble y, GLdouble z), + (x, y, z)) + +DEFUN_LOCAL_VOID (Translatef, + (void *rend, GLfloat x, GLfloat y, GLfloat z), + (x, y, z)) + +DEFUN_LOCAL_VOID (Viewport, + (void *rend, GLint x, GLint y, GLsizei width, GLsizei height), + (x, y, width, height)) + +DEFUN_LOCAL_VOID (ArrayElement, + (void *rend, GLint i), + (i)) + +DEFUN_LOCAL_VOID (BindTexture, + (void *rend, GLenum target, GLenum texture), + (target, texture)) + +DEFUN_LOCAL_VOID (ColorPointer, + (void *rend, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), + (size, type, stride, pointer)) + +DEFUN_LOCAL_VOID (DisableClientState, + (void *rend, GLenum array), + (array)) + +DEFUN_LOCAL_VOID (DrawArrays, + (void *rend, GLenum mode, GLint first, GLsizei count), + (mode, first, count)) + +DEFUN_LOCAL_VOID (DrawElements, + (void *rend, GLenum mode, GLsizei count, GLenum type, const GLvoid * indices), + (mode, count, type, indices)) + +DEFUN_LOCAL_VOID (EdgeFlagPointer, + (void *rend, GLsizei stride, const GLvoid * pointer), + (stride, pointer)) + +DEFUN_LOCAL_VOID (EnableClientState, + (void *rend, GLenum array), + (array)) + +DEFUN_LOCAL_VOID (IndexPointer, + (void *rend, GLenum type, GLsizei stride, const GLvoid * pointer), + (type, stride, pointer)) + +DEFUN_LOCAL_VOID (Indexub, + (void *rend, GLubyte c), + (c)) + +DEFUN_LOCAL_VOID (Indexubv, + (void *rend, const GLubyte * c), + (c)) + +DEFUN_LOCAL_VOID (InterleavedArrays, + (void *rend, GLenum format, GLsizei stride, const GLvoid * pointer), + (format, stride, pointer)) + +DEFUN_LOCAL_VOID (NormalPointer, + (void *rend, GLenum type, GLsizei stride, const GLvoid * pointer), + (type, stride, pointer)) + +DEFUN_LOCAL_VOID (PolygonOffset, + (void *rend, GLfloat factor, GLfloat units), + (factor, units)) + +DEFUN_LOCAL_VOID (TexCoordPointer, + (void *rend, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), + (size, type, stride, pointer)) + +DEFUN_LOCAL_VOID (VertexPointer, + (void *rend, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), + (size, type, stride, pointer)) + +DEFUN_LOCAL (GLboolean, AreTexturesResident, + (void *rend, GLsizei n, const GLenum * textures, GLboolean * residences), + (n, textures, residences)) + +DEFUN_LOCAL_VOID (CopyTexImage1D, + (void *rend, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border), + (target, level, internalformat, x, y, width, border)) + +DEFUN_LOCAL_VOID (CopyTexImage2D, + (void *rend, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border), + (target, level, internalformat, x, y, width, height, border)) + +DEFUN_LOCAL_VOID (CopyTexSubImage1D, + (void *rend, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width), + (target, level, xoffset, x, y, width)) + +DEFUN_LOCAL_VOID (CopyTexSubImage2D, + (void *rend, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height), + (target, level, xoffset, yoffset, x, y, width, height)) + +DEFUN_LOCAL_VOID (DeleteTextures, + (void *rend, GLsizei n, const GLenum * textures), + (n, textures)) + +DEFUN_LOCAL_VOID (GenTextures, + (void *rend, GLsizei n, GLenum * textures), + (n, textures)) + +DEFUN_LOCAL_VOID (GetPointerv, + (void *rend, GLenum pname, GLvoid * * params), + (pname, params)) + +DEFUN_LOCAL (GLboolean, IsTexture, + (void *rend, GLenum texture), + (texture)) + +DEFUN_LOCAL_VOID (PrioritizeTextures, + (void *rend, GLsizei n, const GLenum * textures, const GLclampf * priorities), + (n, textures, priorities)) + +DEFUN_LOCAL_VOID (TexSubImage1D, + (void *rend, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, xoffset, width, format, type, pixels)) + +DEFUN_LOCAL_VOID (TexSubImage2D, + (void *rend, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, xoffset, yoffset, width, height, format, type, pixels)) + +DEFUN_LOCAL_VOID (PopClientAttrib, + (void *rend), + ()) + +DEFUN_LOCAL_VOID (PushClientAttrib, + (void *rend, GLbitfield mask), + (mask)) + +DEFUN_LOCAL_VOID (BlendColor, + (void *rend, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), + (red, green, blue, alpha)) + +DEFUN_LOCAL_VOID (BlendEquation, + (void *rend, GLenum mode), + (mode)) + +DEFUN_LOCAL_VOID (DrawRangeElements, + (void *rend, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices), + (mode, start, end, count, type, indices)) + +DEFUN_LOCAL_VOID (ColorTable, + (void *rend, GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table), + (target, internalformat, width, format, type, table)) + +DEFUN_LOCAL_VOID (ColorTableParameterfv, + (void *rend, GLenum target, GLenum pname, const GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (ColorTableParameteriv, + (void *rend, GLenum target, GLenum pname, const GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (CopyColorTable, + (void *rend, GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width), + (target, internalformat, x, y, width)) + +DEFUN_LOCAL_VOID (GetColorTable, + (void *rend, GLenum target, GLenum format, GLenum type, GLvoid * table), + (target, format, type, table)) + +DEFUN_LOCAL_VOID (GetColorTableParameterfv, + (void *rend, GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetColorTableParameteriv, + (void *rend, GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (ColorSubTable, + (void *rend, GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data), + (target, start, count, format, type, data)) + +DEFUN_LOCAL_VOID (CopyColorSubTable, + (void *rend, GLenum target, GLsizei start, GLint x, GLint y, GLsizei width), + (target, start, x, y, width)) + +DEFUN_LOCAL_VOID (ConvolutionFilter1D, + (void *rend, GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image), + (target, internalformat, width, format, type, image)) + +DEFUN_LOCAL_VOID (ConvolutionFilter2D, + (void *rend, GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image), + (target, internalformat, width, height, format, type, image)) + +DEFUN_LOCAL_VOID (ConvolutionParameterf, + (void *rend, GLenum target, GLenum pname, GLfloat params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (ConvolutionParameterfv, + (void *rend, GLenum target, GLenum pname, const GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (ConvolutionParameteri, + (void *rend, GLenum target, GLenum pname, GLint params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (ConvolutionParameteriv, + (void *rend, GLenum target, GLenum pname, const GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (CopyConvolutionFilter1D, + (void *rend, GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width), + (target, internalformat, x, y, width)) + +DEFUN_LOCAL_VOID (CopyConvolutionFilter2D, + (void *rend, GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height), + (target, internalformat, x, y, width, height)) + +DEFUN_LOCAL_VOID (GetConvolutionFilter, + (void *rend, GLenum target, GLenum format, GLenum type, GLvoid * image), + (target, format, type, image)) + +DEFUN_LOCAL_VOID (GetConvolutionParameterfv, + (void *rend, GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetConvolutionParameteriv, + (void *rend, GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetSeparableFilter, + (void *rend, GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span), + (target, format, type, row, column, span)) + +DEFUN_LOCAL_VOID (SeparableFilter2D, + (void *rend, GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column), + (target, internalformat, width, height, format, type, row, column)) + +DEFUN_LOCAL_VOID (GetHistogram, + (void *rend, GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values), + (target, reset, format, type, values)) + +DEFUN_LOCAL_VOID (GetHistogramParameterfv, + (void *rend, GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetHistogramParameteriv, + (void *rend, GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetMinmax, + (void *rend, GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values), + (target, reset, format, type, values)) + +DEFUN_LOCAL_VOID (GetMinmaxParameterfv, + (void *rend, GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (GetMinmaxParameteriv, + (void *rend, GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_LOCAL_VOID (Histogram, + (void *rend, GLenum target, GLsizei width, GLenum internalformat, GLboolean sink), + (target, width, internalformat, sink)) + +DEFUN_LOCAL_VOID (Minmax, + (void *rend, GLenum target, GLenum internalformat, GLboolean sink), + (target, internalformat, sink)) + +DEFUN_LOCAL_VOID (ResetHistogram, + (void *rend, GLenum target), + (target)) + +DEFUN_LOCAL_VOID (ResetMinmax, + (void *rend, GLenum target), + (target)) + +DEFUN_LOCAL_VOID (TexImage3D, + (void *rend, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, internalformat, width, height, depth, border, format, type, pixels)) + +DEFUN_LOCAL_VOID (TexSubImage3D, + (void *rend, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels)) + +DEFUN_LOCAL_VOID (CopyTexSubImage3D, + (void *rend, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height), + (target, level, xoffset, yoffset, zoffset, x, y, width, height)) + +DEFUN_LOCAL_VOID (ActiveTextureARB, + (void *rend, GLenum texture), + (texture)) + +DEFUN_LOCAL_VOID (ClientActiveTextureARB, + (void *rend, GLenum texture), + (texture)) + +DEFUN_LOCAL_VOID (MultiTexCoord1dARB, + (void *rend, GLenum target, GLdouble s), + (target, s)) + +DEFUN_LOCAL_VOID (MultiTexCoord1dvARB, + (void *rend, GLenum target, const GLdouble * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord1fARB, + (void *rend, GLenum target, GLfloat s), + (target, s)) + +DEFUN_LOCAL_VOID (MultiTexCoord1fvARB, + (void *rend, GLenum target, const GLfloat * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord1iARB, + (void *rend, GLenum target, GLint s), + (target, s)) + +DEFUN_LOCAL_VOID (MultiTexCoord1ivARB, + (void *rend, GLenum target, const GLint * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord1sARB, + (void *rend, GLenum target, GLshort s), + (target, s)) + +DEFUN_LOCAL_VOID (MultiTexCoord1svARB, + (void *rend, GLenum target, const GLshort * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord2dARB, + (void *rend, GLenum target, GLdouble s, GLdouble t), + (target, s, t)) + +DEFUN_LOCAL_VOID (MultiTexCoord2dvARB, + (void *rend, GLenum target, const GLdouble * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord2fARB, + (void *rend, GLenum target, GLfloat s, GLfloat t), + (target, s, t)) + +DEFUN_LOCAL_VOID (MultiTexCoord2fvARB, + (void *rend, GLenum target, const GLfloat * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord2iARB, + (void *rend, GLenum target, GLint s, GLint t), + (target, s, t)) + +DEFUN_LOCAL_VOID (MultiTexCoord2ivARB, + (void *rend, GLenum target, const GLint * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord2sARB, + (void *rend, GLenum target, GLshort s, GLshort t), + (target, s, t)) + +DEFUN_LOCAL_VOID (MultiTexCoord2svARB, + (void *rend, GLenum target, const GLshort * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord3dARB, + (void *rend, GLenum target, GLdouble s, GLdouble t, GLdouble r), + (target, s, t, r)) + +DEFUN_LOCAL_VOID (MultiTexCoord3dvARB, + (void *rend, GLenum target, const GLdouble * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord3fARB, + (void *rend, GLenum target, GLfloat s, GLfloat t, GLfloat r), + (target, s, t, r)) + +DEFUN_LOCAL_VOID (MultiTexCoord3fvARB, + (void *rend, GLenum target, const GLfloat * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord3iARB, + (void *rend, GLenum target, GLint s, GLint t, GLint r), + (target, s, t, r)) + +DEFUN_LOCAL_VOID (MultiTexCoord3ivARB, + (void *rend, GLenum target, const GLint * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord3sARB, + (void *rend, GLenum target, GLshort s, GLshort t, GLshort r), + (target, s, t, r)) + +DEFUN_LOCAL_VOID (MultiTexCoord3svARB, + (void *rend, GLenum target, const GLshort * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord4dARB, + (void *rend, GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q), + (target, s, t, r, q)) + +DEFUN_LOCAL_VOID (MultiTexCoord4dvARB, + (void *rend, GLenum target, const GLdouble * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord4fARB, + (void *rend, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q), + (target, s, t, r, q)) + +DEFUN_LOCAL_VOID (MultiTexCoord4fvARB, + (void *rend, GLenum target, const GLfloat * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord4iARB, + (void *rend, GLenum target, GLint s, GLint t, GLint r, GLint q), + (target, s, t, r, q)) + +DEFUN_LOCAL_VOID (MultiTexCoord4ivARB, + (void *rend, GLenum target, const GLint * v), + (target, v)) + +DEFUN_LOCAL_VOID (MultiTexCoord4sARB, + (void *rend, GLenum target, GLshort s, GLshort t, GLshort r, GLshort q), + (target, s, t, r, q)) + +DEFUN_LOCAL_VOID (MultiTexCoord4svARB, + (void *rend, GLenum target, const GLshort * v), + (target, v)) + +DEFUN_LOCAL_VOID (LoadTransposeMatrixfARB, + (void *rend, const GLfloat * m), + (m)) + +DEFUN_LOCAL_VOID (LoadTransposeMatrixdARB, + (void *rend, const GLdouble * m), + (m)) + +DEFUN_LOCAL_VOID (MultTransposeMatrixfARB, + (void *rend, const GLfloat * m), + (m)) + +DEFUN_LOCAL_VOID (MultTransposeMatrixdARB, + (void *rend, const GLdouble * m), + (m)) + +DEFUN_LOCAL_VOID (SampleCoverageARB, + (void *rend, GLclampf value, GLboolean invert), + (value, invert)) + +DEFUN_ALIAS_VOID (PolygonOffsetEXT, PolygonOffset, + (GLfloat factor, GLfloat bias), + (factor, bias)) + +DEFUN_EXTERN_VOID (GetTexFilterFuncSGIS, + (GLenum target, GLenum filter, GLfloat * weights), + (target, filter, weights)) + +DEFUN_EXTERN_VOID (TexFilterFuncSGIS, + (GLenum target, GLenum filter, GLsizei n, const GLfloat * weights), + (target, filter, n, weights)) + +DEFUN_ALIAS_VOID (GetHistogramEXT, GetHistogram, + (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values), + (target, reset, format, type, values)) + +DEFUN_ALIAS_VOID (GetHistogramParameterfvEXT, GetHistogramParameterfv, + (GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (GetHistogramParameterivEXT, GetHistogramParameteriv, + (GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (GetMinmaxEXT, GetMinmax, + (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values), + (target, reset, format, type, values)) + +DEFUN_ALIAS_VOID (GetMinmaxParameterfvEXT, GetMinmaxParameterfv, + (GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (GetMinmaxParameterivEXT, GetMinmaxParameteriv, + (GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (GetConvolutionFilterEXT, GetConvolutionFilter, + (GLenum target, GLenum format, GLenum type, GLvoid * image), + (target, format, type, image)) + +DEFUN_ALIAS_VOID (GetConvolutionParameterfvEXT, GetConvolutionParameterfv, + (GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (GetConvolutionParameterivEXT, GetConvolutionParameteriv, + (GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (GetSeparableFilterEXT, GetSeparableFilter, + (GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span), + (target, format, type, row, column, span)) + +DEFUN_ALIAS_VOID (GetColorTableSGI, GetColorTable, + (GLenum target, GLenum format, GLenum type, GLvoid * table), + (target, format, type, table)) + +DEFUN_ALIAS_VOID (GetColorTableParameterfvSGI, GetColorTableParameterfv, + (GLenum target, GLenum pname, GLfloat * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (GetColorTableParameterivSGI, GetColorTableParameteriv, + (GLenum target, GLenum pname, GLint * params), + (target, pname, params)) + +DEFUN_EXTERN_VOID (PixelTexGenSGIX, + (GLenum mode), + (mode)) + +DEFUN_EXTERN_VOID (PixelTexGenParameteriSGIS, + (GLenum pname, GLint param), + (pname, param)) + +DEFUN_EXTERN_VOID (PixelTexGenParameterivSGIS, + (GLenum pname, const GLint * params), + (pname, params)) + +DEFUN_EXTERN_VOID (PixelTexGenParameterfSGIS, + (GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_EXTERN_VOID (PixelTexGenParameterfvSGIS, + (GLenum pname, const GLfloat * params), + (pname, params)) + +DEFUN_EXTERN_VOID (GetPixelTexGenParameterivSGIS, + (GLenum pname, GLint * params), + (pname, params)) + +DEFUN_EXTERN_VOID (GetPixelTexGenParameterfvSGIS, + (GLenum pname, GLfloat * params), + (pname, params)) + +DEFUN_EXTERN_VOID (TexImage4DSGIS, + (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, internalformat, width, height, depth, size4d, border, format, type, pixels)) + +DEFUN_EXTERN_VOID (TexSubImage4DSGIS, + (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, xoffset, yoffset, zoffset, woffset, width, height, depth, size4d, format, type, pixels)) + +DEFUN_ALIAS (GLboolean, AreTexturesResidentEXT, AreTexturesResident, + (GLsizei n, const GLenum * textures, GLboolean * residences), + (n, textures, residences)) + +DEFUN_ALIAS_VOID (GenTexturesEXT, GenTextures, + (GLsizei n, GLenum * textures), + (n, textures)) + +DEFUN_EXTERN (GLboolean, IsTextureEXT, + (GLenum texture), + (texture)) + +DEFUN_EXTERN_VOID (DetailTexFuncSGIS, + (GLenum target, GLsizei n, const GLfloat * points), + (target, n, points)) + +DEFUN_EXTERN_VOID (GetDetailTexFuncSGIS, + (GLenum target, GLfloat * points), + (target, points)) + +DEFUN_EXTERN_VOID (SharpenTexFuncSGIS, + (GLenum target, GLsizei n, const GLfloat * points), + (target, n, points)) + +DEFUN_EXTERN_VOID (GetSharpenTexFuncSGIS, + (GLenum target, GLfloat * points), + (target, points)) + +DEFUN_EXTERN_VOID (SampleMaskSGIS, + (GLclampf value, GLboolean invert), + (value, invert)) + +DEFUN_EXTERN_VOID (SamplePatternSGIS, + (GLenum pattern), + (pattern)) + +DEFUN_EXTERN_VOID (ColorPointerEXT, + (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer), + (size, type, stride, count, pointer)) + +DEFUN_EXTERN_VOID (EdgeFlagPointerEXT, + (GLsizei stride, GLsizei count, const GLboolean * pointer), + (stride, count, pointer)) + +DEFUN_EXTERN_VOID (IndexPointerEXT, + (GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer), + (type, stride, count, pointer)) + +DEFUN_EXTERN_VOID (NormalPointerEXT, + (GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer), + (type, stride, count, pointer)) + +DEFUN_EXTERN_VOID (TexCoordPointerEXT, + (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer), + (size, type, stride, count, pointer)) + +DEFUN_EXTERN_VOID (VertexPointerEXT, + (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer), + (size, type, stride, count, pointer)) + +DEFUN_EXTERN_VOID (SpriteParameterfSGIX, + (GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_EXTERN_VOID (SpriteParameterfvSGIX, + (GLenum pname, const GLfloat * params), + (pname, params)) + +DEFUN_EXTERN_VOID (SpriteParameteriSGIX, + (GLenum pname, GLint param), + (pname, param)) + +DEFUN_EXTERN_VOID (SpriteParameterivSGIX, + (GLenum pname, const GLint * params), + (pname, params)) + +DEFUN_LOCAL_VOID (PointParameterfEXT, + (void *rend, GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_ALIAS_VOID (PointParameterfEXT, PointParameterf, + (GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_LOCAL_VOID (PointParameterfvEXT, + (void *rend, GLenum pname, const GLfloat * params), + (pname, params)) + +DEFUN_ALIAS_VOID (PointParameterfvEXT, PointParameterfv, + (GLenum pname, const GLfloat * params), + (pname, params)) + +DEFUN_EXTERN (GLint, GetInstrumentsSGIX, + (), + ()) + +DEFUN_EXTERN_VOID (InstrumentsBufferSGIX, + (GLsizei size, GLint * buffer), + (size, buffer)) + +DEFUN_EXTERN (GLint, PollInstrumentsSGIX, + (GLint * marker_p), + (marker_p)) + +DEFUN_EXTERN_VOID (ReadInstrumentsSGIX, + (GLint marker), + (marker)) + +DEFUN_EXTERN_VOID (StartInstrumentsSGIX, + (), + ()) + +DEFUN_EXTERN_VOID (StopInstrumentsSGIX, + (GLint marker), + (marker)) + +DEFUN_EXTERN_VOID (FrameZoomSGIX, + (GLint factor), + (factor)) + +DEFUN_EXTERN_VOID (TagSampleBufferSGIX, + (), + ()) + +DEFUN_EXTERN_VOID (ReferencePlaneSGIX, + (const GLdouble * equation), + (equation)) + +DEFUN_EXTERN_VOID (FlushRasterSGIX, + (), + ()) + +DEFUN_EXTERN_VOID (GetListParameterfvSGIX, + (GLuint list, GLenum pname, GLfloat * params), + (list, pname, params)) + +DEFUN_EXTERN_VOID (GetListParameterivSGIX, + (GLuint list, GLenum pname, GLint * params), + (list, pname, params)) + +DEFUN_EXTERN_VOID (ListParameterfSGIX, + (GLuint list, GLenum pname, GLfloat param), + (list, pname, param)) + +DEFUN_EXTERN_VOID (ListParameterfvSGIX, + (GLuint list, GLenum pname, const GLfloat * params), + (list, pname, params)) + +DEFUN_EXTERN_VOID (ListParameteriSGIX, + (GLuint list, GLenum pname, GLint param), + (list, pname, param)) + +DEFUN_EXTERN_VOID (ListParameterivSGIX, + (GLuint list, GLenum pname, const GLint * params), + (list, pname, params)) + +DEFUN_EXTERN_VOID (FragmentColorMaterialSGIX, + (GLenum face, GLenum mode), + (face, mode)) + +DEFUN_EXTERN_VOID (FragmentLightfSGIX, + (GLenum light, GLenum pname, GLfloat param), + (light, pname, param)) + +DEFUN_EXTERN_VOID (FragmentLightfvSGIX, + (GLenum light, GLenum pname, const GLfloat * params), + (light, pname, params)) + +DEFUN_EXTERN_VOID (FragmentLightiSGIX, + (GLenum light, GLenum pname, GLint param), + (light, pname, param)) + +DEFUN_EXTERN_VOID (FragmentLightivSGIX, + (GLenum light, GLenum pname, const GLint * params), + (light, pname, params)) + +DEFUN_EXTERN_VOID (FragmentLightModelfSGIX, + (GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_EXTERN_VOID (FragmentLightModelfvSGIX, + (GLenum pname, const GLfloat * params), + (pname, params)) + +DEFUN_EXTERN_VOID (FragmentLightModeliSGIX, + (GLenum pname, GLint param), + (pname, param)) + +DEFUN_EXTERN_VOID (FragmentLightModelivSGIX, + (GLenum pname, const GLint * params), + (pname, params)) + +DEFUN_EXTERN_VOID (FragmentMaterialfSGIX, + (GLenum face, GLenum pname, GLfloat param), + (face, pname, param)) + +DEFUN_EXTERN_VOID (FragmentMaterialfvSGIX, + (GLenum face, GLenum pname, const GLfloat * params), + (face, pname, params)) + +DEFUN_EXTERN_VOID (FragmentMaterialiSGIX, + (GLenum face, GLenum pname, GLint param), + (face, pname, param)) + +DEFUN_EXTERN_VOID (FragmentMaterialivSGIX, + (GLenum face, GLenum pname, const GLint * params), + (face, pname, params)) + +DEFUN_EXTERN_VOID (GetFragmentLightfvSGIX, + (GLenum light, GLenum pname, GLfloat * params), + (light, pname, params)) + +DEFUN_EXTERN_VOID (GetFragmentLightivSGIX, + (GLenum light, GLenum pname, GLint * params), + (light, pname, params)) + +DEFUN_EXTERN_VOID (GetFragmentMaterialfvSGIX, + (GLenum face, GLenum pname, GLfloat * params), + (face, pname, params)) + +DEFUN_EXTERN_VOID (GetFragmentMaterialivSGIX, + (GLenum face, GLenum pname, GLint * params), + (face, pname, params)) + +DEFUN_EXTERN_VOID (LightEnviSGIX, + (GLenum pname, GLint param), + (pname, param)) + +DEFUN_EXTERN_VOID (VertexWeightfEXT, + (GLfloat weight), + (weight)) + +DEFUN_EXTERN_VOID (VertexWeightfvEXT, + (const GLfloat * weight), + (weight)) + +DEFUN_EXTERN_VOID (VertexWeightPointerEXT, + (GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer), + (size, type, stride, pointer)) + +DEFUN_EXTERN_VOID (FlushVertexArrayRangeNV, + (), + ()) + +DEFUN_LOCAL_VOID (VertexArrayRangeNV, + (void *rend, GLsizei length, const GLvoid * pointer), + (length, pointer)) + +DEFUN_ALIAS_VOID (VertexArrayRangeNV, VertexArrayRangeAPPLE, + (GLsizei length, const GLvoid * pointer), + (length, pointer)) + +DEFUN_LOCAL_VOID (CombinerParameterfvNV, + (void *rend, GLenum pname, const GLfloat * params), + (pname, params)) + +DEFUN_LOCAL_VOID (CombinerParameterfNV, + (void *rend, GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_LOCAL_VOID (CombinerParameterivNV, + (void *rend, GLenum pname, const GLint * params), + (pname, params)) + +DEFUN_LOCAL_VOID (CombinerParameteriNV, + (void *rend, GLenum pname, GLint param), + (pname, param)) + +DEFUN_LOCAL_VOID (CombinerInputNV, + (void *rend, GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage), + (stage, portion, variable, input, mapping, componentUsage)) + +DEFUN_LOCAL_VOID (CombinerOutputNV, + (void *rend, GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum), + (stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum)) + +DEFUN_LOCAL_VOID (FinalCombinerInputNV, + (void *rend, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage), + (variable, input, mapping, componentUsage)) + +DEFUN_LOCAL_VOID (GetCombinerInputParameterfvNV, + (void *rend, GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params), + (stage, portion, variable, pname, params)) + +DEFUN_LOCAL_VOID (GetCombinerInputParameterivNV, + (void *rend, GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params), + (stage, portion, variable, pname, params)) + +DEFUN_LOCAL_VOID (GetCombinerOutputParameterfvNV, + (void *rend, GLenum stage, GLenum portion, GLenum pname, GLfloat * params), + (stage, portion, pname, params)) + +DEFUN_LOCAL_VOID (GetCombinerOutputParameterivNV, + (void *rend, GLenum stage, GLenum portion, GLenum pname, GLint * params), + (stage, portion, pname, params)) + +DEFUN_LOCAL_VOID (GetFinalCombinerInputParameterfvNV, + (void *rend, GLenum variable, GLenum pname, GLfloat * params), + (variable, pname, params)) + +DEFUN_LOCAL_VOID (GetFinalCombinerInputParameterivNV, + (void *rend, GLenum variable, GLenum pname, GLint * params), + (variable, pname, params)) + +DEFUN_EXTERN_VOID (ResizeBuffersMESA, + (), + ()) + +DEFUN_EXTERN_VOID (WindowPos2dMESA, + (GLdouble x, GLdouble y), + (x, y)) + +DEFUN_EXTERN_VOID (WindowPos2dvMESA, + (const GLdouble * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos2fMESA, + (GLfloat x, GLfloat y), + (x, y)) + +DEFUN_EXTERN_VOID (WindowPos2fvMESA, + (const GLfloat * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos2iMESA, + (GLint x, GLint y), + (x, y)) + +DEFUN_EXTERN_VOID (WindowPos2ivMESA, + (const GLint * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos2sMESA, + (GLshort x, GLshort y), + (x, y)) + +DEFUN_EXTERN_VOID (WindowPos2svMESA, + (const GLshort * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos3dMESA, + (GLdouble x, GLdouble y, GLdouble z), + (x, y, z)) + +DEFUN_EXTERN_VOID (WindowPos3dvMESA, + (const GLdouble * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos3fMESA, + (GLfloat x, GLfloat y, GLfloat z), + (x, y, z)) + +DEFUN_EXTERN_VOID (WindowPos3fvMESA, + (const GLfloat * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos3iMESA, + (GLint x, GLint y, GLint z), + (x, y, z)) + +DEFUN_EXTERN_VOID (WindowPos3ivMESA, + (const GLint * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos3sMESA, + (GLshort x, GLshort y, GLshort z), + (x, y, z)) + +DEFUN_EXTERN_VOID (WindowPos3svMESA, + (const GLshort * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos4dMESA, + (GLdouble x, GLdouble y, GLdouble z, GLdouble w), + (x, y, z, w)) + +DEFUN_EXTERN_VOID (WindowPos4dvMESA, + (const GLdouble * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos4fMESA, + (GLfloat x, GLfloat y, GLfloat z, GLfloat w), + (x, y, z, w)) + +DEFUN_EXTERN_VOID (WindowPos4fvMESA, + (const GLfloat * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos4iMESA, + (GLint x, GLint y, GLint z, GLint w), + (x, y, z, w)) + +DEFUN_EXTERN_VOID (WindowPos4ivMESA, + (const GLint * v), + (v)) + +DEFUN_EXTERN_VOID (WindowPos4sMESA, + (GLshort x, GLshort y, GLshort z, GLshort w), + (x, y, z, w)) + +DEFUN_EXTERN_VOID (WindowPos4svMESA, + (const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (BlendFuncSeparateEXT, + (void *rend, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha), + (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)) + +DEFUN_EXTERN_VOID (IndexMaterialEXT, + (GLenum face, GLenum mode), + (face, mode)) + +DEFUN_EXTERN_VOID (IndexFuncEXT, + (GLenum func, GLclampf ref), + (func, ref)) + +DEFUN_LOCAL_VOID (LockArraysEXT, + (void *rend, GLint first, GLsizei count), + (first, count)) + +DEFUN_LOCAL_VOID (UnlockArraysEXT, + (void *rend), + ()) + +DEFUN_EXTERN_VOID (CullParameterdvEXT, + (GLenum pname, GLdouble * params), + (pname, params)) + +DEFUN_EXTERN_VOID (CullParameterfvEXT, + (GLenum pname, GLfloat * params), + (pname, params)) + +DEFUN_EXTERN_VOID (HintPGI, + (GLenum target, GLint mode), + (target, mode)) + +DEFUN_LOCAL_VOID (FogCoordfEXT, + (void *rend, GLfloat coord), + (coord)) + +DEFUN_LOCAL_VOID (FogCoordfvEXT, + (void *rend, const GLfloat * coord), + (coord)) + +DEFUN_LOCAL_VOID (FogCoorddEXT, + (void *rend, GLdouble coord), + (coord)) + +DEFUN_LOCAL_VOID (FogCoorddvEXT, + (void *rend, const GLdouble * coord), + (coord)) + +DEFUN_LOCAL_VOID (FogCoordPointerEXT, + (void *rend, GLenum type, GLsizei stride, const GLvoid * pointer), + (type, stride, pointer)) + +DEFUN_EXTERN_VOID (TbufferMask3DFX, + (GLuint mask), + (mask)) + +DEFUN_LOCAL_VOID (CompressedTexImage3DARB, + (void *rend, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data), + (target, level, internalformat, width, height, depth, border, imageSize, data)) + +DEFUN_LOCAL_VOID (CompressedTexImage2DARB, + (void *rend, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data), + (target, level, internalformat, width, height, border, imageSize, data)) + +DEFUN_LOCAL_VOID (CompressedTexImage1DARB, + (void *rend, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data), + (target, level, internalformat, width, border, imageSize, data)) + +DEFUN_LOCAL_VOID (CompressedTexSubImage3DARB, + (void *rend, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data), + (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data)) + +DEFUN_LOCAL_VOID (CompressedTexSubImage2DARB, + (void *rend, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data), + (target, level, xoffset, yoffset, width, height, format, imageSize, data)) + +DEFUN_LOCAL_VOID (CompressedTexSubImage1DARB, + (void *rend, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data), + (target, level, xoffset, width, format, imageSize, data)) + +DEFUN_LOCAL_VOID (GetCompressedTexImageARB, + (void *rend, GLenum target, GLint level, void * img), + (target, level, img)) + +DEFUN_LOCAL_VOID (SecondaryColor3bEXT, + (void *rend, GLbyte red, GLbyte green, GLbyte blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (SecondaryColor3bvEXT, + (void *rend, const GLbyte * v), + (v)) + +DEFUN_LOCAL_VOID (SecondaryColor3dEXT, + (void *rend, GLdouble red, GLdouble green, GLdouble blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (SecondaryColor3dvEXT, + (void *rend, const GLdouble * v), + (v)) + +DEFUN_LOCAL_VOID (SecondaryColor3fEXT, + (void *rend, GLfloat red, GLfloat green, GLfloat blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (SecondaryColor3fvEXT, + (void *rend, const GLfloat * v), + (v)) + +DEFUN_LOCAL_VOID (SecondaryColor3iEXT, + (void *rend, GLint red, GLint green, GLint blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (SecondaryColor3ivEXT, + (void *rend, const GLint * v), + (v)) + +DEFUN_LOCAL_VOID (SecondaryColor3sEXT, + (void *rend, GLshort red, GLshort green, GLshort blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (SecondaryColor3svEXT, + (void *rend, const GLshort * v), + (v)) + +DEFUN_LOCAL_VOID (SecondaryColor3ubEXT, + (void *rend, GLubyte red, GLubyte green, GLubyte blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (SecondaryColor3ubvEXT, + (void *rend, const GLubyte * v), + (v)) + +DEFUN_LOCAL_VOID (SecondaryColor3uiEXT, + (void *rend, GLuint red, GLuint green, GLuint blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (SecondaryColor3uivEXT, + (void *rend, const GLuint * v), + (v)) + +DEFUN_LOCAL_VOID (SecondaryColor3usEXT, + (void *rend, GLushort red, GLushort green, GLushort blue), + (red, green, blue)) + +DEFUN_LOCAL_VOID (SecondaryColor3usvEXT, + (void *rend, const GLushort * v), + (v)) + +DEFUN_LOCAL_VOID (SecondaryColorPointerEXT, + (void *rend, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), + (size, type, stride, pointer)) + +DEFUN_EXTERN (GLboolean, AreProgramsResidentNV, + (GLsizei n, const GLuint * ids, GLboolean * residences), + (n, ids, residences)) + +DEFUN_EXTERN_VOID (BindProgramNV, + (GLenum target, GLuint id), + (target, id)) + +DEFUN_EXTERN_VOID (DeleteProgramsNV, + (GLsizei n, const GLuint * ids), + (n, ids)) + +DEFUN_EXTERN_VOID (ExecuteProgramNV, + (GLenum target, GLuint id, const GLfloat * params), + (target, id, params)) + +DEFUN_EXTERN_VOID (GenProgramsNV, + (GLsizei n, GLuint * ids), + (n, ids)) + +DEFUN_EXTERN_VOID (GetProgramParameterdvNV, + (GLenum target, GLuint index, GLenum pname, GLdouble * params), + (target, index, pname, params)) + +DEFUN_EXTERN_VOID (GetProgramParameterfvNV, + (GLenum target, GLuint index, GLenum pname, GLfloat * params), + (target, index, pname, params)) + +DEFUN_EXTERN_VOID (GetProgramivNV, + (GLuint id, GLenum pname, GLint * params), + (id, pname, params)) + +DEFUN_EXTERN_VOID (GetProgramStringNV, + (GLuint id, GLenum pname, GLubyte * program), + (id, pname, program)) + +DEFUN_EXTERN_VOID (GetTrackMatrixivNV, + (GLenum target, GLuint address, GLenum pname, GLint * params), + (target, address, pname, params)) + +DEFUN_EXTERN_VOID (GetVertexAttribdvNV, + (GLuint index, GLenum pname, GLdouble * params), + (index, pname, params)) + +DEFUN_EXTERN_VOID (GetVertexAttribfvNV, + (GLuint index, GLenum pname, GLfloat * params), + (index, pname, params)) + +DEFUN_EXTERN_VOID (GetVertexAttribivNV, + (GLuint index, GLenum pname, GLint * params), + (index, pname, params)) + +DEFUN_EXTERN_VOID (GetVertexAttribPointervNV, + (GLuint index, GLenum pname, GLvoid ** pointer), + (index, pname, pointer)) + +DEFUN_EXTERN (GLboolean, IsProgramNV, + (GLuint id), + (id)) + +DEFUN_EXTERN_VOID (LoadProgramNV, + (GLenum target, GLuint id, GLsizei len, const GLubyte * program), + (target, id, len, program)) + +DEFUN_EXTERN_VOID (ProgramParameter4dNV, + (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w), + (target, index, x, y, z, w)) + +DEFUN_EXTERN_VOID (ProgramParameter4dvNV, + (GLenum target, GLuint index, const GLdouble * params), + (target, index, params)) + +DEFUN_EXTERN_VOID (ProgramParameter4fNV, + (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w), + (target, index, x, y, z, w)) + +DEFUN_EXTERN_VOID (ProgramParameter4fvNV, + (GLenum target, GLuint index, const GLfloat * params), + (target, index, params)) + +DEFUN_EXTERN_VOID (ProgramParameters4dvNV, + (GLenum target, GLuint index, GLuint num, const GLdouble * params), + (target, index, num, params)) + +DEFUN_EXTERN_VOID (ProgramParameters4fvNV, + (GLenum target, GLuint index, GLuint num, const GLfloat * params), + (target, index, num, params)) + +DEFUN_EXTERN_VOID (RequestResidentProgramsNV, + (GLsizei n, const GLuint * ids), + (n, ids)) + +DEFUN_EXTERN_VOID (TrackMatrixNV, + (GLenum target, GLuint address, GLenum matrix, GLenum transform), + (target, address, matrix, transform)) + +DEFUN_EXTERN_VOID (VertexAttribPointerNV, + (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), + (index, size, type, stride, pointer)) + +DEFUN_EXTERN_VOID (VertexAttrib1dNV, + (GLuint index, GLdouble x), + (index, x)) + +DEFUN_EXTERN_VOID (VertexAttrib1dvNV, + (GLuint index, const GLdouble * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib1fNV, + (GLuint index, GLfloat x), + (index, x)) + +DEFUN_EXTERN_VOID (VertexAttrib1fvNV, + (GLuint index, const GLfloat * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib1sNV, + (GLuint index, GLshort x), + (index, x)) + +DEFUN_EXTERN_VOID (VertexAttrib1svNV, + (GLuint index, const GLshort * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib2dNV, + (GLuint index, GLdouble x, GLdouble y), + (index, x, y)) + +DEFUN_EXTERN_VOID (VertexAttrib2dvNV, + (GLuint index, const GLdouble * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib2fNV, + (GLuint index, GLfloat x, GLfloat y), + (index, x, y)) + +DEFUN_EXTERN_VOID (VertexAttrib2fvNV, + (GLuint index, const GLfloat * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib2sNV, + (GLuint index, GLshort x, GLshort y), + (index, x, y)) + +DEFUN_EXTERN_VOID (VertexAttrib2svNV, + (GLuint index, const GLshort * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib3dNV, + (GLuint index, GLdouble x, GLdouble y, GLdouble z), + (index, x, y, z)) + +DEFUN_EXTERN_VOID (VertexAttrib3dvNV, + (GLuint index, const GLdouble * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib3fNV, + (GLuint index, GLfloat x, GLfloat y, GLfloat z), + (index, x, y, z)) + +DEFUN_EXTERN_VOID (VertexAttrib3fvNV, + (GLuint index, const GLfloat * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib3sNV, + (GLuint index, GLshort x, GLshort y, GLshort z), + (index, x, y, z)) + +DEFUN_EXTERN_VOID (VertexAttrib3svNV, + (GLuint index, const GLshort * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib4dNV, + (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w), + (index, x, y, z, w)) + +DEFUN_EXTERN_VOID (VertexAttrib4dvNV, + (GLuint index, const GLdouble * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib4fNV, + (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w), + (index, x, y, z, w)) + +DEFUN_EXTERN_VOID (VertexAttrib4fvNV, + (GLuint index, const GLfloat * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib4sNV, + (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w), + (index, x, y, z, w)) + +DEFUN_EXTERN_VOID (VertexAttrib4svNV, + (GLuint index, const GLshort * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttrib4ubNV, + (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w), + (index, x, y, z, w)) + +DEFUN_EXTERN_VOID (VertexAttrib4ubvNV, + (GLuint index, const GLubyte * v), + (index, v)) + +DEFUN_EXTERN_VOID (VertexAttribs1dvNV, + (GLuint index, GLsizei n, const GLdouble * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs1fvNV, + (GLuint index, GLsizei n, const GLfloat * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs1svNV, + (GLuint index, GLsizei n, const GLshort * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs2dvNV, + (GLuint index, GLsizei n, const GLdouble * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs2fvNV, + (GLuint index, GLsizei n, const GLfloat * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs2svNV, + (GLuint index, GLsizei n, const GLshort * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs3dvNV, + (GLuint index, GLsizei n, const GLdouble * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs3fvNV, + (GLuint index, GLsizei n, const GLfloat * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs3svNV, + (GLuint index, GLsizei n, const GLshort * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs4dvNV, + (GLuint index, GLsizei n, const GLdouble * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs4fvNV, + (GLuint index, GLsizei n, const GLfloat * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs4svNV, + (GLuint index, GLsizei n, const GLshort * v), + (index, n, v)) + +DEFUN_EXTERN_VOID (VertexAttribs4ubvNV, + (GLuint index, GLsizei n, const GLubyte * v), + (index, n, v)) + +DEFUN_LOCAL_VOID (PointParameteriNV, + (void *rend, GLenum pname, GLint params), + (pname, params)) + +DEFUN_LOCAL_VOID (PointParameterivNV, + (void *rend, GLenum pname, const GLint * params), + (pname, params)) + +DEFUN_LOCAL_VOID (MultiDrawArraysEXT, + (void *rend, GLenum mode, GLint * first, GLsizei * count, GLsizei primcount), + (mode, first, count, primcount)) + +DEFUN_LOCAL_VOID (MultiDrawElementsEXT, + (void *rend, GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount), + (mode, count, type, indices, primcount)) + +DEFUN_LOCAL_VOID (ActiveStencilFaceEXT, + (void *rend, GLenum face), + (face)) + +DEFUN_EXTERN_VOID (DeleteFencesNV, + (GLsizei n, const GLuint * fences), + (n, fences)) + +DEFUN_EXTERN_VOID (GenFencesNV, + (GLsizei n, GLuint * fences), + (n, fences)) + +DEFUN_EXTERN (GLboolean, IsFenceNV, + (GLuint fence), + (fence)) + +DEFUN_EXTERN (GLboolean, TestFenceNV, + (GLuint fence), + (fence)) + +DEFUN_EXTERN_VOID (GetFenceivNV, + (GLuint fence, GLenum pname, GLint * params), + (fence, pname, params)) + +DEFUN_EXTERN_VOID (FinishFenceNV, + (GLuint fence), + (fence)) + +DEFUN_EXTERN_VOID (SetFenceNV, + (GLuint fence, GLenum condition), + (fence, condition)) + +DEFUN_ALIAS_VOID (ArrayElementEXT, ArrayElement, + (GLint i), + (i)) + +DEFUN_ALIAS_VOID (BindTextureEXT, BindTexture, + (GLenum target, GLuint texture), + (target, texture)) + +DEFUN_ALIAS_VOID (BlendFuncSeparateINGR, BlendFuncSeparateEXT, + (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha), + (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)) + +DEFUN_ALIAS_VOID (ColorTableParameterfvSGI, ColorTableParameterfv, + (GLenum target, GLenum pname, const GLfloat * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (ColorTableParameterivSGI, ColorTableParameteriv, + (GLenum target, GLenum pname, const GLint * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (ColorTableSGI, ColorTable, + (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table), + (target, internalformat, width, format, type, table)) + +DEFUN_ALIAS_VOID (ConvolutionFilter1DEXT, ConvolutionFilter1D, + (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image), + (target, internalformat, width, format, type, image)) + +DEFUN_ALIAS_VOID (ConvolutionFilter2DEXT, ConvolutionFilter2D, + (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image), + (target, internalformat, width, height, format, type, image)) + +DEFUN_ALIAS_VOID (ConvolutionParameterfEXT, ConvolutionParameterf, + (GLenum target, GLenum pname, GLfloat params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (ConvolutionParameterfvEXT, ConvolutionParameterfv, + (GLenum target, GLenum pname, const GLfloat * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (ConvolutionParameteriEXT, ConvolutionParameteri, + (GLenum target, GLenum pname, GLint params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (ConvolutionParameterivEXT, ConvolutionParameteriv, + (GLenum target, GLenum pname, const GLint * params), + (target, pname, params)) + +DEFUN_ALIAS_VOID (CopyColorSubTableEXT, CopyColorSubTable, + (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width), + (target, start, x, y, width)) + +DEFUN_ALIAS_VOID (CopyColorTableSGI, CopyColorTable, + (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width), + (target, internalformat, x, y, width)) + +DEFUN_ALIAS_VOID (CopyConvolutionFilter1DEXT, CopyConvolutionFilter1D, + (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width), + (target, internalformat, x, y, width)) + +DEFUN_ALIAS_VOID (CopyConvolutionFilter2DEXT, CopyConvolutionFilter2D, + (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height), + (target, internalformat, x, y, width, height)) + +DEFUN_ALIAS_VOID (CopyTexImage1DEXT, CopyTexImage1D, + (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border), + (target, level, internalformat, x, y, width, border)) + +DEFUN_ALIAS_VOID (CopyTexImage2DEXT, CopyTexImage2D, + (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border), + (target, level, internalformat, x, y, width, height, border)) + +DEFUN_ALIAS_VOID (CopyTexSubImage1DEXT, CopyTexSubImage1D, + (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width), + (target, level, xoffset, x, y, width)) + +DEFUN_ALIAS_VOID (CopyTexSubImage2DEXT, CopyTexSubImage2D, + (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height), + (target, level, xoffset, yoffset, x, y, width, height)) + +DEFUN_ALIAS_VOID (CopyTexSubImage3DEXT, CopyTexSubImage3D, + (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height), + (target, level, xoffset, yoffset, zoffset, x, y, width, height)) + +DEFUN_ALIAS_VOID (DeleteTexturesEXT, DeleteTextures, + (GLsizei n, const GLuint *textures), + (n, textures)) + +DEFUN_ALIAS_VOID (DrawArraysEXT, DrawArrays, + (GLenum mode, GLint first, GLsizei count), + (mode, first, count)) + +DEFUN_ALIAS_VOID (GetPointervEXT, GetPointerv, + (GLenum pname, GLvoid * * params), + (pname, params)) + +DEFUN_ALIAS_VOID (HistogramEXT, Histogram, + (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink), + (target, width, internalformat, sink)) + +DEFUN_ALIAS_VOID (MinmaxEXT, Minmax, + (GLenum target, GLenum internalformat, GLboolean sink), + (target, internalformat, sink)) + +DEFUN_ALIAS_VOID (PointParameterfSGIS, PointParameterf, + (GLenum pname, GLfloat param), + (pname, param)) + +DEFUN_ALIAS_VOID (PointParameterfvSGIS, PointParameterfv, + (GLenum pname, const GLfloat * params), + (pname, params)) + +DEFUN_ALIAS_VOID (PointParameteri, PointParameteriNV, + (GLenum pname, GLint params), + (pname, params)) + +DEFUN_ALIAS_VOID (PointParameteriv, PointParameterivNV, + (GLenum pname, const GLint * params), + (pname, params)) + +DEFUN_ALIAS_VOID (PrioritizeTexturesEXT, PrioritizeTextures, + (GLsizei n, const GLenum * textures, const GLclampf * priorities), + (n, textures, priorities)) + +DEFUN_ALIAS_VOID (ResetHistogramEXT, ResetHistogram, + (GLenum target), + (target)) + +DEFUN_ALIAS_VOID (ResetMinmaxEXT, ResetMinmax, + (GLenum target), + (target)) + +DEFUN_ALIAS_VOID (SampleMaskEXT, SampleMaskSGIS, + (GLclampf value, GLboolean invert), + (value, invert)) + +DEFUN_ALIAS_VOID (SamplePatternEXT, SamplePatternSGIS, + (GLenum pattern), + (pattern)) + +DEFUN_ALIAS_VOID (SeparableFilter2DEXT, SeparableFilter2D, + (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column), + (target, internalformat, width, height, format, type, row, column)) + +DEFUN_ALIAS_VOID (TexImage3DEXT, TexImage3D, + (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, internalformat, width, height, depth, border, format, type, pixels)) + +DEFUN_ALIAS_VOID (TexSubImage1DEXT, TexSubImage1D, + (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, xoffset, width, format, type, pixels)) + +DEFUN_ALIAS_VOID (TexSubImage2DEXT, TexSubImage2D, + (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, xoffset, yoffset, width, height, format, type, pixels)) + +DEFUN_ALIAS_VOID (TexSubImage3DEXT, TexSubImage3D, + (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels), + (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels)) + +#define INDIRECT_DISPATCH_INIT(d,p) \ +do { \ + (d)[0] = (void *) &p ## Accum; \ + (d)[1] = (void *) &p ## AlphaFunc; \ + (d)[2] = (void *) &p ## AreTexturesResident; \ + (d)[3] = (void *) &p ## ArrayElement; \ + (d)[4] = (void *) &p ## Begin; \ + (d)[5] = (void *) &p ## BindTexture; \ + (d)[6] = (void *) &p ## Bitmap; \ + (d)[7] = (void *) &p ## BlendFunc; \ + (d)[8] = (void *) &p ## CallList; \ + (d)[9] = (void *) &p ## CallLists; \ + (d)[10] = (void *) &p ## Clear; \ + (d)[11] = (void *) &p ## ClearAccum; \ + (d)[12] = (void *) &p ## ClearColor; \ + (d)[13] = (void *) &p ## ClearDepth; \ + (d)[14] = (void *) &p ## ClearIndex; \ + (d)[15] = (void *) &p ## ClearStencil; \ + (d)[16] = (void *) &p ## ClipPlane; \ + (d)[17] = (void *) &p ## Color3b; \ + (d)[18] = (void *) &p ## Color3bv; \ + (d)[19] = (void *) &p ## Color3d; \ + (d)[20] = (void *) &p ## Color3dv; \ + (d)[21] = (void *) &p ## Color3f; \ + (d)[22] = (void *) &p ## Color3fv; \ + (d)[23] = (void *) &p ## Color3i; \ + (d)[24] = (void *) &p ## Color3iv; \ + (d)[25] = (void *) &p ## Color3s; \ + (d)[26] = (void *) &p ## Color3sv; \ + (d)[27] = (void *) &p ## Color3ub; \ + (d)[28] = (void *) &p ## Color3ubv; \ + (d)[29] = (void *) &p ## Color3ui; \ + (d)[30] = (void *) &p ## Color3uiv; \ + (d)[31] = (void *) &p ## Color3us; \ + (d)[32] = (void *) &p ## Color3usv; \ + (d)[33] = (void *) &p ## Color4b; \ + (d)[34] = (void *) &p ## Color4bv; \ + (d)[35] = (void *) &p ## Color4d; \ + (d)[36] = (void *) &p ## Color4dv; \ + (d)[37] = (void *) &p ## Color4f; \ + (d)[38] = (void *) &p ## Color4fv; \ + (d)[39] = (void *) &p ## Color4i; \ + (d)[40] = (void *) &p ## Color4iv; \ + (d)[41] = (void *) &p ## Color4s; \ + (d)[42] = (void *) &p ## Color4sv; \ + (d)[43] = (void *) &p ## Color4ub; \ + (d)[44] = (void *) &p ## Color4ubv; \ + (d)[45] = (void *) &p ## Color4ui; \ + (d)[46] = (void *) &p ## Color4uiv; \ + (d)[47] = (void *) &p ## Color4us; \ + (d)[48] = (void *) &p ## Color4usv; \ + (d)[49] = (void *) &p ## ColorMask; \ + (d)[50] = (void *) &p ## ColorMaterial; \ + (d)[51] = (void *) &p ## ColorPointer; \ + (d)[52] = (void *) &p ## CopyPixels; \ + (d)[53] = (void *) &p ## CopyTexImage1D; \ + (d)[54] = (void *) &p ## CopyTexImage2D; \ + (d)[55] = (void *) &p ## CopyTexSubImage1D; \ + (d)[56] = (void *) &p ## CopyTexSubImage2D; \ + (d)[57] = (void *) &p ## CullFace; \ + (d)[58] = (void *) &p ## DeleteLists; \ + (d)[59] = (void *) &p ## DeleteTextures; \ + (d)[60] = (void *) &p ## DepthFunc; \ + (d)[61] = (void *) &p ## DepthMask; \ + (d)[62] = (void *) &p ## DepthRange; \ + (d)[63] = (void *) &p ## Disable; \ + (d)[64] = (void *) &p ## DisableClientState; \ + (d)[65] = (void *) &p ## DrawArrays; \ + (d)[66] = (void *) &p ## DrawBuffer; \ + (d)[67] = (void *) &p ## DrawElements; \ + (d)[68] = (void *) &p ## DrawPixels; \ + (d)[69] = (void *) &p ## EdgeFlag; \ + (d)[70] = (void *) &p ## EdgeFlagPointer; \ + (d)[71] = (void *) &p ## EdgeFlagv; \ + (d)[72] = (void *) &p ## Enable; \ + (d)[73] = (void *) &p ## EnableClientState; \ + (d)[74] = (void *) &p ## End; \ + (d)[75] = (void *) &p ## EndList; \ + (d)[76] = (void *) &p ## EvalCoord1d; \ + (d)[77] = (void *) &p ## EvalCoord1dv; \ + (d)[78] = (void *) &p ## EvalCoord1f; \ + (d)[79] = (void *) &p ## EvalCoord1fv; \ + (d)[80] = (void *) &p ## EvalCoord2d; \ + (d)[81] = (void *) &p ## EvalCoord2dv; \ + (d)[82] = (void *) &p ## EvalCoord2f; \ + (d)[83] = (void *) &p ## EvalCoord2fv; \ + (d)[84] = (void *) &p ## EvalMesh1; \ + (d)[85] = (void *) &p ## EvalMesh2; \ + (d)[86] = (void *) &p ## EvalPoint1; \ + (d)[87] = (void *) &p ## EvalPoint2; \ + (d)[88] = (void *) &p ## FeedbackBuffer; \ + (d)[89] = (void *) &p ## Finish; \ + (d)[90] = (void *) &p ## Flush; \ + (d)[91] = (void *) &p ## Fogf; \ + (d)[92] = (void *) &p ## Fogfv; \ + (d)[93] = (void *) &p ## Fogi; \ + (d)[94] = (void *) &p ## Fogiv; \ + (d)[95] = (void *) &p ## FrontFace; \ + (d)[96] = (void *) &p ## Frustum; \ + (d)[97] = (void *) &p ## GenLists; \ + (d)[98] = (void *) &p ## GenTextures; \ + (d)[99] = (void *) &p ## GetBooleanv; \ + (d)[100] = (void *) &p ## GetClipPlane; \ + (d)[101] = (void *) &p ## GetDoublev; \ + (d)[102] = (void *) &p ## GetError; \ + (d)[103] = (void *) &p ## GetFloatv; \ + (d)[104] = (void *) &p ## GetIntegerv; \ + (d)[105] = (void *) &p ## GetLightfv; \ + (d)[106] = (void *) &p ## GetLightiv; \ + (d)[107] = (void *) &p ## GetMapdv; \ + (d)[108] = (void *) &p ## GetMapfv; \ + (d)[109] = (void *) &p ## GetMapiv; \ + (d)[110] = (void *) &p ## GetMaterialfv; \ + (d)[111] = (void *) &p ## GetMaterialiv; \ + (d)[112] = (void *) &p ## GetPixelMapfv; \ + (d)[113] = (void *) &p ## GetPixelMapuiv; \ + (d)[114] = (void *) &p ## GetPixelMapusv; \ + (d)[115] = (void *) &p ## GetPointerv; \ + (d)[116] = (void *) &p ## GetPolygonStipple; \ + (d)[117] = (void *) &p ## GetString; \ + (d)[118] = (void *) &p ## GetTexEnvfv; \ + (d)[119] = (void *) &p ## GetTexEnviv; \ + (d)[120] = (void *) &p ## GetTexGendv; \ + (d)[121] = (void *) &p ## GetTexGenfv; \ + (d)[122] = (void *) &p ## GetTexGeniv; \ + (d)[123] = (void *) &p ## GetTexImage; \ + (d)[124] = (void *) &p ## GetTexLevelParameterfv; \ + (d)[125] = (void *) &p ## GetTexLevelParameteriv; \ + (d)[126] = (void *) &p ## GetTexParameterfv; \ + (d)[127] = (void *) &p ## GetTexParameteriv; \ + (d)[128] = (void *) &p ## Hint; \ + (d)[129] = (void *) &p ## IndexMask; \ + (d)[130] = (void *) &p ## IndexPointer; \ + (d)[131] = (void *) &p ## Indexd; \ + (d)[132] = (void *) &p ## Indexdv; \ + (d)[133] = (void *) &p ## Indexf; \ + (d)[134] = (void *) &p ## Indexfv; \ + (d)[135] = (void *) &p ## Indexi; \ + (d)[136] = (void *) &p ## Indexiv; \ + (d)[137] = (void *) &p ## Indexs; \ + (d)[138] = (void *) &p ## Indexsv; \ + (d)[139] = (void *) &p ## Indexub; \ + (d)[140] = (void *) &p ## Indexubv; \ + (d)[141] = (void *) &p ## InitNames; \ + (d)[142] = (void *) &p ## InterleavedArrays; \ + (d)[143] = (void *) &p ## IsEnabled; \ + (d)[144] = (void *) &p ## IsList; \ + (d)[145] = (void *) &p ## IsTexture; \ + (d)[146] = (void *) &p ## LightModelf; \ + (d)[147] = (void *) &p ## LightModelfv; \ + (d)[148] = (void *) &p ## LightModeli; \ + (d)[149] = (void *) &p ## LightModeliv; \ + (d)[150] = (void *) &p ## Lightf; \ + (d)[151] = (void *) &p ## Lightfv; \ + (d)[152] = (void *) &p ## Lighti; \ + (d)[153] = (void *) &p ## Lightiv; \ + (d)[154] = (void *) &p ## LineStipple; \ + (d)[155] = (void *) &p ## LineWidth; \ + (d)[156] = (void *) &p ## ListBase; \ + (d)[157] = (void *) &p ## LoadIdentity; \ + (d)[158] = (void *) &p ## LoadMatrixd; \ + (d)[159] = (void *) &p ## LoadMatrixf; \ + (d)[160] = (void *) &p ## LoadName; \ + (d)[161] = (void *) &p ## LogicOp; \ + (d)[162] = (void *) &p ## Map1d; \ + (d)[163] = (void *) &p ## Map1f; \ + (d)[164] = (void *) &p ## Map2d; \ + (d)[165] = (void *) &p ## Map2f; \ + (d)[166] = (void *) &p ## MapGrid1d; \ + (d)[167] = (void *) &p ## MapGrid1f; \ + (d)[168] = (void *) &p ## MapGrid2d; \ + (d)[169] = (void *) &p ## MapGrid2f; \ + (d)[170] = (void *) &p ## Materialf; \ + (d)[171] = (void *) &p ## Materialfv; \ + (d)[172] = (void *) &p ## Materiali; \ + (d)[173] = (void *) &p ## Materialiv; \ + (d)[174] = (void *) &p ## MatrixMode; \ + (d)[175] = (void *) &p ## MultMatrixd; \ + (d)[176] = (void *) &p ## MultMatrixf; \ + (d)[177] = (void *) &p ## NewList; \ + (d)[178] = (void *) &p ## Normal3b; \ + (d)[179] = (void *) &p ## Normal3bv; \ + (d)[180] = (void *) &p ## Normal3d; \ + (d)[181] = (void *) &p ## Normal3dv; \ + (d)[182] = (void *) &p ## Normal3f; \ + (d)[183] = (void *) &p ## Normal3fv; \ + (d)[184] = (void *) &p ## Normal3i; \ + (d)[185] = (void *) &p ## Normal3iv; \ + (d)[186] = (void *) &p ## Normal3s; \ + (d)[187] = (void *) &p ## Normal3sv; \ + (d)[188] = (void *) &p ## NormalPointer; \ + (d)[189] = (void *) &p ## Ortho; \ + (d)[190] = (void *) &p ## PassThrough; \ + (d)[191] = (void *) &p ## PixelMapfv; \ + (d)[192] = (void *) &p ## PixelMapuiv; \ + (d)[193] = (void *) &p ## PixelMapusv; \ + (d)[194] = (void *) &p ## PixelStoref; \ + (d)[195] = (void *) &p ## PixelStorei; \ + (d)[196] = (void *) &p ## PixelTransferf; \ + (d)[197] = (void *) &p ## PixelTransferi; \ + (d)[198] = (void *) &p ## PixelZoom; \ + (d)[199] = (void *) &p ## PointSize; \ + (d)[200] = (void *) &p ## PolygonMode; \ + (d)[201] = (void *) &p ## PolygonOffset; \ + (d)[202] = (void *) &p ## PolygonStipple; \ + (d)[203] = (void *) &p ## PopAttrib; \ + (d)[204] = (void *) &p ## PopClientAttrib; \ + (d)[205] = (void *) &p ## PopMatrix; \ + (d)[206] = (void *) &p ## PopName; \ + (d)[207] = (void *) &p ## PrioritizeTextures; \ + (d)[208] = (void *) &p ## PushAttrib; \ + (d)[209] = (void *) &p ## PushClientAttrib; \ + (d)[210] = (void *) &p ## PushMatrix; \ + (d)[211] = (void *) &p ## PushName; \ + (d)[212] = (void *) &p ## RasterPos2d; \ + (d)[213] = (void *) &p ## RasterPos2dv; \ + (d)[214] = (void *) &p ## RasterPos2f; \ + (d)[215] = (void *) &p ## RasterPos2fv; \ + (d)[216] = (void *) &p ## RasterPos2i; \ + (d)[217] = (void *) &p ## RasterPos2iv; \ + (d)[218] = (void *) &p ## RasterPos2s; \ + (d)[219] = (void *) &p ## RasterPos2sv; \ + (d)[220] = (void *) &p ## RasterPos3d; \ + (d)[221] = (void *) &p ## RasterPos3dv; \ + (d)[222] = (void *) &p ## RasterPos3f; \ + (d)[223] = (void *) &p ## RasterPos3fv; \ + (d)[224] = (void *) &p ## RasterPos3i; \ + (d)[225] = (void *) &p ## RasterPos3iv; \ + (d)[226] = (void *) &p ## RasterPos3s; \ + (d)[227] = (void *) &p ## RasterPos3sv; \ + (d)[228] = (void *) &p ## RasterPos4d; \ + (d)[229] = (void *) &p ## RasterPos4dv; \ + (d)[230] = (void *) &p ## RasterPos4f; \ + (d)[231] = (void *) &p ## RasterPos4fv; \ + (d)[232] = (void *) &p ## RasterPos4i; \ + (d)[233] = (void *) &p ## RasterPos4iv; \ + (d)[234] = (void *) &p ## RasterPos4s; \ + (d)[235] = (void *) &p ## RasterPos4sv; \ + (d)[236] = (void *) &p ## ReadBuffer; \ + (d)[237] = (void *) &p ## ReadPixels; \ + (d)[238] = (void *) &p ## Rectd; \ + (d)[239] = (void *) &p ## Rectdv; \ + (d)[240] = (void *) &p ## Rectf; \ + (d)[241] = (void *) &p ## Rectfv; \ + (d)[242] = (void *) &p ## Recti; \ + (d)[243] = (void *) &p ## Rectiv; \ + (d)[244] = (void *) &p ## Rects; \ + (d)[245] = (void *) &p ## Rectsv; \ + (d)[246] = (void *) &p ## RenderMode; \ + (d)[247] = (void *) &p ## Rotated; \ + (d)[248] = (void *) &p ## Rotatef; \ + (d)[249] = (void *) &p ## Scaled; \ + (d)[250] = (void *) &p ## Scalef; \ + (d)[251] = (void *) &p ## Scissor; \ + (d)[252] = (void *) &p ## SelectBuffer; \ + (d)[253] = (void *) &p ## ShadeModel; \ + (d)[254] = (void *) &p ## StencilFunc; \ + (d)[255] = (void *) &p ## StencilMask; \ + (d)[256] = (void *) &p ## StencilOp; \ + (d)[257] = (void *) &p ## TexCoord1d; \ + (d)[258] = (void *) &p ## TexCoord1dv; \ + (d)[259] = (void *) &p ## TexCoord1f; \ + (d)[260] = (void *) &p ## TexCoord1fv; \ + (d)[261] = (void *) &p ## TexCoord1i; \ + (d)[262] = (void *) &p ## TexCoord1iv; \ + (d)[263] = (void *) &p ## TexCoord1s; \ + (d)[264] = (void *) &p ## TexCoord1sv; \ + (d)[265] = (void *) &p ## TexCoord2d; \ + (d)[266] = (void *) &p ## TexCoord2dv; \ + (d)[267] = (void *) &p ## TexCoord2f; \ + (d)[268] = (void *) &p ## TexCoord2fv; \ + (d)[269] = (void *) &p ## TexCoord2i; \ + (d)[270] = (void *) &p ## TexCoord2iv; \ + (d)[271] = (void *) &p ## TexCoord2s; \ + (d)[272] = (void *) &p ## TexCoord2sv; \ + (d)[273] = (void *) &p ## TexCoord3d; \ + (d)[274] = (void *) &p ## TexCoord3dv; \ + (d)[275] = (void *) &p ## TexCoord3f; \ + (d)[276] = (void *) &p ## TexCoord3fv; \ + (d)[277] = (void *) &p ## TexCoord3i; \ + (d)[278] = (void *) &p ## TexCoord3iv; \ + (d)[279] = (void *) &p ## TexCoord3s; \ + (d)[280] = (void *) &p ## TexCoord3sv; \ + (d)[281] = (void *) &p ## TexCoord4d; \ + (d)[282] = (void *) &p ## TexCoord4dv; \ + (d)[283] = (void *) &p ## TexCoord4f; \ + (d)[284] = (void *) &p ## TexCoord4fv; \ + (d)[285] = (void *) &p ## TexCoord4i; \ + (d)[286] = (void *) &p ## TexCoord4iv; \ + (d)[287] = (void *) &p ## TexCoord4s; \ + (d)[288] = (void *) &p ## TexCoord4sv; \ + (d)[289] = (void *) &p ## TexCoordPointer; \ + (d)[290] = (void *) &p ## TexEnvf; \ + (d)[291] = (void *) &p ## TexEnvfv; \ + (d)[292] = (void *) &p ## TexEnvi; \ + (d)[293] = (void *) &p ## TexEnviv; \ + (d)[294] = (void *) &p ## TexGend; \ + (d)[295] = (void *) &p ## TexGendv; \ + (d)[296] = (void *) &p ## TexGenf; \ + (d)[297] = (void *) &p ## TexGenfv; \ + (d)[298] = (void *) &p ## TexGeni; \ + (d)[299] = (void *) &p ## TexGeniv; \ + (d)[300] = (void *) &p ## TexImage1D; \ + (d)[301] = (void *) &p ## TexImage2D; \ + (d)[302] = (void *) &p ## TexParameterf; \ + (d)[303] = (void *) &p ## TexParameterfv; \ + (d)[304] = (void *) &p ## TexParameteri; \ + (d)[305] = (void *) &p ## TexParameteriv; \ + (d)[306] = (void *) &p ## TexSubImage1D; \ + (d)[307] = (void *) &p ## TexSubImage2D; \ + (d)[308] = (void *) &p ## Translated; \ + (d)[309] = (void *) &p ## Translatef; \ + (d)[310] = (void *) &p ## Vertex2d; \ + (d)[311] = (void *) &p ## Vertex2dv; \ + (d)[312] = (void *) &p ## Vertex2f; \ + (d)[313] = (void *) &p ## Vertex2fv; \ + (d)[314] = (void *) &p ## Vertex2i; \ + (d)[315] = (void *) &p ## Vertex2iv; \ + (d)[316] = (void *) &p ## Vertex2s; \ + (d)[317] = (void *) &p ## Vertex2sv; \ + (d)[318] = (void *) &p ## Vertex3d; \ + (d)[319] = (void *) &p ## Vertex3dv; \ + (d)[320] = (void *) &p ## Vertex3f; \ + (d)[321] = (void *) &p ## Vertex3fv; \ + (d)[322] = (void *) &p ## Vertex3i; \ + (d)[323] = (void *) &p ## Vertex3iv; \ + (d)[324] = (void *) &p ## Vertex3s; \ + (d)[325] = (void *) &p ## Vertex3sv; \ + (d)[326] = (void *) &p ## Vertex4d; \ + (d)[327] = (void *) &p ## Vertex4dv; \ + (d)[328] = (void *) &p ## Vertex4f; \ + (d)[329] = (void *) &p ## Vertex4fv; \ + (d)[330] = (void *) &p ## Vertex4i; \ + (d)[331] = (void *) &p ## Vertex4iv; \ + (d)[332] = (void *) &p ## Vertex4s; \ + (d)[333] = (void *) &p ## Vertex4sv; \ + (d)[334] = (void *) &p ## VertexPointer; \ + (d)[335] = (void *) &p ## Viewport; \ + (d)[336] = (void *) &p ## BlendFuncSeparateEXT; \ + (d)[337] = (void *) &p ## BlendColor; \ + (d)[338] = (void *) &p ## BlendEquation; \ + (d)[339] = (void *) &p ## LockArraysEXT; \ + (d)[340] = (void *) &p ## UnlockArraysEXT; \ + (d)[341] = (void *) &p ## ClientActiveTextureARB; \ + (d)[342] = (void *) &p ## ActiveTextureARB; \ + (d)[343] = (void *) &p ## MultiTexCoord1dARB; \ + (d)[344] = (void *) &p ## MultiTexCoord1dvARB; \ + (d)[345] = (void *) &p ## MultiTexCoord1fARB; \ + (d)[346] = (void *) &p ## MultiTexCoord1fvARB; \ + (d)[347] = (void *) &p ## MultiTexCoord1iARB; \ + (d)[348] = (void *) &p ## MultiTexCoord1ivARB; \ + (d)[349] = (void *) &p ## MultiTexCoord1sARB; \ + (d)[350] = (void *) &p ## MultiTexCoord1svARB; \ + (d)[351] = (void *) &p ## MultiTexCoord2dARB; \ + (d)[352] = (void *) &p ## MultiTexCoord2dvARB; \ + (d)[353] = (void *) &p ## MultiTexCoord2fARB; \ + (d)[354] = (void *) &p ## MultiTexCoord2fvARB; \ + (d)[355] = (void *) &p ## MultiTexCoord2iARB; \ + (d)[356] = (void *) &p ## MultiTexCoord2ivARB; \ + (d)[357] = (void *) &p ## MultiTexCoord2sARB; \ + (d)[358] = (void *) &p ## MultiTexCoord2svARB; \ + (d)[359] = (void *) &p ## MultiTexCoord3dARB; \ + (d)[360] = (void *) &p ## MultiTexCoord3dvARB; \ + (d)[361] = (void *) &p ## MultiTexCoord3fARB; \ + (d)[362] = (void *) &p ## MultiTexCoord3fvARB; \ + (d)[363] = (void *) &p ## MultiTexCoord3iARB; \ + (d)[364] = (void *) &p ## MultiTexCoord3ivARB; \ + (d)[365] = (void *) &p ## MultiTexCoord3sARB; \ + (d)[366] = (void *) &p ## MultiTexCoord3svARB; \ + (d)[367] = (void *) &p ## MultiTexCoord4dARB; \ + (d)[368] = (void *) &p ## MultiTexCoord4dvARB; \ + (d)[369] = (void *) &p ## MultiTexCoord4fARB; \ + (d)[370] = (void *) &p ## MultiTexCoord4fvARB; \ + (d)[371] = (void *) &p ## MultiTexCoord4iARB; \ + (d)[372] = (void *) &p ## MultiTexCoord4ivARB; \ + (d)[373] = (void *) &p ## MultiTexCoord4sARB; \ + (d)[374] = (void *) &p ## MultiTexCoord4svARB; \ + (d)[375] = (void *) &p ## LoadTransposeMatrixdARB; \ + (d)[376] = (void *) &p ## LoadTransposeMatrixfARB; \ + (d)[377] = (void *) &p ## MultTransposeMatrixdARB; \ + (d)[378] = (void *) &p ## MultTransposeMatrixfARB; \ + (d)[379] = (void *) &p ## CompressedTexImage3DARB; \ + (d)[380] = (void *) &p ## CompressedTexImage2DARB; \ + (d)[381] = (void *) &p ## CompressedTexImage1DARB; \ + (d)[382] = (void *) &p ## CompressedTexSubImage3DARB; \ + (d)[383] = (void *) &p ## CompressedTexSubImage2DARB; \ + (d)[384] = (void *) &p ## CompressedTexSubImage1DARB; \ + (d)[385] = (void *) &p ## GetCompressedTexImageARB; \ + (d)[386] = (void *) &p ## SecondaryColor3bEXT; \ + (d)[387] = (void *) &p ## SecondaryColor3bvEXT; \ + (d)[388] = (void *) &p ## SecondaryColor3dEXT; \ + (d)[389] = (void *) &p ## SecondaryColor3dvEXT; \ + (d)[390] = (void *) &p ## SecondaryColor3fEXT; \ + (d)[391] = (void *) &p ## SecondaryColor3fvEXT; \ + (d)[392] = (void *) &p ## SecondaryColor3iEXT; \ + (d)[393] = (void *) &p ## SecondaryColor3ivEXT; \ + (d)[394] = (void *) &p ## SecondaryColor3sEXT; \ + (d)[395] = (void *) &p ## SecondaryColor3svEXT; \ + (d)[396] = (void *) &p ## SecondaryColor3ubEXT; \ + (d)[397] = (void *) &p ## SecondaryColor3ubvEXT; \ + (d)[398] = (void *) &p ## SecondaryColor3uiEXT; \ + (d)[399] = (void *) &p ## SecondaryColor3uivEXT; \ + (d)[400] = (void *) &p ## SecondaryColor3usEXT; \ + (d)[401] = (void *) &p ## SecondaryColor3usvEXT; \ + (d)[402] = (void *) &p ## SecondaryColorPointerEXT; \ + (d)[403] = (void *) &p ## VertexArrayRangeNV; \ + (d)[405] = (void *) &p ## DrawRangeElements; \ + (d)[406] = (void *) &p ## ColorTable; \ + (d)[407] = (void *) &p ## ColorTableParameterfv; \ + (d)[408] = (void *) &p ## ColorTableParameteriv; \ + (d)[409] = (void *) &p ## CopyColorTable; \ + (d)[410] = (void *) &p ## GetColorTable; \ + (d)[411] = (void *) &p ## GetColorTableParameterfv; \ + (d)[412] = (void *) &p ## GetColorTableParameteriv; \ + (d)[413] = (void *) &p ## ColorSubTable; \ + (d)[414] = (void *) &p ## CopyColorSubTable; \ + (d)[415] = (void *) &p ## ConvolutionFilter1D; \ + (d)[416] = (void *) &p ## ConvolutionFilter2D; \ + (d)[417] = (void *) &p ## ConvolutionParameterf; \ + (d)[418] = (void *) &p ## ConvolutionParameterfv; \ + (d)[419] = (void *) &p ## ConvolutionParameteri; \ + (d)[420] = (void *) &p ## ConvolutionParameteriv; \ + (d)[421] = (void *) &p ## CopyConvolutionFilter1D; \ + (d)[422] = (void *) &p ## CopyConvolutionFilter2D; \ + (d)[423] = (void *) &p ## GetConvolutionFilter; \ + (d)[424] = (void *) &p ## GetConvolutionParameterfv; \ + (d)[425] = (void *) &p ## GetConvolutionParameteriv; \ + (d)[426] = (void *) &p ## GetSeparableFilter; \ + (d)[427] = (void *) &p ## SeparableFilter2D; \ + (d)[428] = (void *) &p ## GetHistogram; \ + (d)[429] = (void *) &p ## GetHistogramParameterfv; \ + (d)[430] = (void *) &p ## GetHistogramParameteriv; \ + (d)[431] = (void *) &p ## GetMinmax; \ + (d)[432] = (void *) &p ## GetMinmaxParameterfv; \ + (d)[433] = (void *) &p ## GetMinmaxParameteriv; \ + (d)[434] = (void *) &p ## Histogram; \ + (d)[435] = (void *) &p ## Minmax; \ + (d)[436] = (void *) &p ## ResetHistogram; \ + (d)[437] = (void *) &p ## ResetMinmax; \ + (d)[438] = (void *) &p ## TexImage3D; \ + (d)[439] = (void *) &p ## TexSubImage3D; \ + (d)[440] = (void *) &p ## CopyTexSubImage3D; \ + (d)[441] = (void *) &p ## CombinerParameterfvNV; \ + (d)[442] = (void *) &p ## CombinerParameterfNV; \ + (d)[443] = (void *) &p ## CombinerParameterivNV; \ + (d)[444] = (void *) &p ## CombinerParameteriNV; \ + (d)[445] = (void *) &p ## CombinerInputNV; \ + (d)[446] = (void *) &p ## CombinerOutputNV; \ + (d)[447] = (void *) &p ## FinalCombinerInputNV; \ + (d)[448] = (void *) &p ## GetCombinerInputParameterfvNV; \ + (d)[449] = (void *) &p ## GetCombinerInputParameterivNV; \ + (d)[450] = (void *) &p ## GetCombinerOutputParameterfvNV; \ + (d)[451] = (void *) &p ## GetCombinerOutputParameterivNV; \ + (d)[452] = (void *) &p ## GetFinalCombinerInputParameterfvNV; \ + (d)[453] = (void *) &p ## GetFinalCombinerInputParameterivNV; \ + (d)[459] = (void *) &p ## SampleCoverageARB; \ + (d)[540] = (void *) &p ## PointParameterfEXT; \ + (d)[541] = (void *) &p ## PointParameterfvEXT; \ + (d)[542] = (void *) &p ## PointParameteriNV; \ + (d)[543] = (void *) &p ## PointParameterivNV; \ + (d)[544] = (void *) &p ## FogCoordfEXT; \ + (d)[545] = (void *) &p ## FogCoordfvEXT; \ + (d)[546] = (void *) &p ## FogCoorddEXT; \ + (d)[547] = (void *) &p ## FogCoorddvEXT; \ + (d)[548] = (void *) &p ## FogCoordPointerEXT; \ + (d)[567] = (void *) &p ## MultiDrawArraysEXT; \ + (d)[568] = (void *) &p ## MultiDrawElementsEXT; \ + (d)[585] = (void *) &p ## ActiveStencilFaceEXT; \ +} while (0) Index: xc/lib/GL/apple/dri_driver.c diff -u /dev/null xc/lib/GL/apple/dri_driver.c:1.3 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/dri_driver.c Tue Nov 4 20:08:00 2003 @@ -0,0 +1,1067 @@ +/* $XFree86: xc/lib/GL/apple/dri_driver.c,v 1.3 2003/11/05 01:08:00 torrey Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Brian E. Paul + */ + +/* + * This file gets compiled into each of the DRI 3D drivers. The + * functions defined here are called from the GL library via + * function pointers in the __DRIdisplayRec, __DRIscreenRec, + * __DRIcontextRec, __DRIdrawableRec structures defined in glxclient.h + * + * Those function pointers are initialized by code in this file. + * The process starts when libGL calls the __driCreateScreen() function + * at the end of this file. + * + * The above-mentioned DRI structures have no dependencies on Mesa. + * Each structure instead has a generic (void *) private pointer that + * points to a private structure. For Mesa drivers, these private + * structures are the __DRIdrawablePrivateRec, __DRIcontextPrivateRec, + * __DRIscreenPrivateRec, and __DRIvisualPrivateRec structures defined + * in dri_mesaint.h. We allocate and attach those structs here in + * this file. + */ + + +#ifdef GLX_DIRECT_RENDERING + +#include +#include +#include +#include "extutil.h" +#include "glxclient.h" +#include "appledri.h" +#include "dri_driver.h" +#include "x-list.h" +#include "x-hash.h" + +/* Context binding */ +static Bool driMesaBindContext(Display *dpy, int scrn, + GLXDrawable draw, GLXContext gc); +static Bool driMesaUnbindContext(Display *dpy, int scrn, + GLXDrawable draw, GLXContext gc, + int will_rebind); + +/* Drawable methods */ +static void *driMesaCreateDrawable(Display *dpy, int scrn, GLXDrawable draw, + VisualID vid, __DRIdrawable *pdraw); +static __DRIdrawable *driMesaGetDrawable(Display *dpy, GLXDrawable draw, + void *screenPrivate); +static void driMesaSwapBuffers(Display *dpy, void *drawPrivate); +static void driMesaDestroyDrawable(Display *dpy, void *drawPrivate); + +/* Context methods */ +static void *driMesaCreateContext(Display *dpy, XVisualInfo *vis, void *shared, + __DRIcontext *pctx); +static void driMesaDestroyContext(Display *dpy, int scrn, void *screenPrivate); + +/* Screen methods */ +static void *driMesaCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, + int numConfigs, __GLXvisualConfig *config); +static void driMesaDestroyScreen(Display *dpy, int scrn, void *screenPrivate); + +static void driMesaCreateSurface(Display *dpy, int scrn, + __DRIdrawablePrivate *pdp); + +static void unwrap_context(__DRIcontextPrivate *pcp); +static void wrap_context(__DRIcontextPrivate *pcp); + +extern const CGLContextObj XAppleDRIGetIndirectContext(void); + +/*****************************************************************/ + +/* Maintain a list of drawables */ + +static inline Bool +__driMesaAddDrawable(x_hash_table *drawHash, __DRIdrawable *pdraw) +{ + __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private; + + assert(drawHash != NULL); + + x_hash_table_insert(drawHash, (void *) pdp->draw, pdraw); + + return GL_TRUE; +} + +static inline __DRIdrawable * +__driMesaFindDrawable(x_hash_table *drawHash, GLXDrawable draw) +{ + if (drawHash == NULL) + return NULL; + + return x_hash_table_lookup(drawHash, (void *) draw, NULL); +} + +struct find_by_uid_closure { + unsigned int uid; + __DRIdrawable *ret; +}; + +static void +find_by_uid_cb(void *k, void *v, void *data) +{ + __DRIdrawable *pdraw = v; + __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private; + struct find_by_uid_closure *c = data; + + if (pdp->uid == c->uid) + c->ret = pdraw; +} + +static __DRIdrawable * +__driMesaFindDrawableByUID(x_hash_table *drawHash, unsigned int uid) +{ + struct find_by_uid_closure c; + + c.uid = uid; + c.ret = NULL; + x_hash_table_foreach(drawHash, find_by_uid_cb, &c); + + return c.ret; +} + +static inline void +__driMesaRemoveDrawable(x_hash_table *drawHash, __DRIdrawable *pdraw) +{ + __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private; + + if (drawHash == NULL) + return; + + x_hash_table_remove(drawHash, (void *) pdp->draw); +} + +static Bool __driMesaWindowExistsFlag; + +static int __driMesaWindowExistsErrorHandler(Display *dpy, XErrorEvent *xerr) +{ + if (xerr->error_code == BadWindow) { + __driMesaWindowExistsFlag = GL_FALSE; + } + return 0; +} + +static Bool __driMesaWindowExists(Display *dpy, GLXDrawable draw) +{ + XWindowAttributes xwa; + int (*oldXErrorHandler)(Display *, XErrorEvent *); + + __driMesaWindowExistsFlag = GL_TRUE; + oldXErrorHandler = XSetErrorHandler(__driMesaWindowExistsErrorHandler); + XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */ + XSetErrorHandler(oldXErrorHandler); + return __driMesaWindowExistsFlag; +} + +static void __driMesaCollectCallback(void *k, void *v, void *data) +{ + GLXDrawable draw = (GLXDrawable) k; + __DRIdrawable *pdraw = v; + x_list **todelete = data; + + __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private; + Display *dpy; + + dpy = pdp->driScreenPriv->display; + XSync(dpy, GL_FALSE); + if (!pdp->destroyed && !__driMesaWindowExists(dpy, draw)) { + /* Destroy the local drawable data in the hash table, if the + drawable no longer exists in the Xserver */ + pdp->destroyed = TRUE; + *todelete = x_list_prepend(*todelete, pdraw); + } +} + +/* pdp->mutex is held. */ +static void __driMesaGarbageCollectDrawables(void *drawHash) +{ + __DRIdrawable *pdraw; + __DRIdrawablePrivate *pdp; + Display *dpy; + x_list *todelete = NULL, *node; + + x_hash_table_foreach(drawHash, __driMesaCollectCallback, &todelete); + + for (node = todelete; node != NULL; node = node->next) + { + pdraw = node->data; + pdp = (__DRIdrawablePrivate *)pdraw->private; + dpy = pdp->driScreenPriv->display; + + /* Destroy the local drawable data in the hash table, if the + drawable no longer exists in the Xserver */ + + __driMesaRemoveDrawable(drawHash, pdraw); + (*pdraw->destroyDrawable)(dpy, pdraw->private); + Xfree(pdraw); + } + + x_list_free(todelete); +} + +/*****************************************************************/ + +/* returns with psp->mutex locked if successful. */ +static Bool +driMesaFindDrawableByUID(Display *dpy,unsigned int uid, + __DRIscreenPrivate **psp_ret, + __DRIdrawablePrivate **pdp_ret) +{ + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + __DRIdrawable *pdraw; + int scrn; + + for (scrn = 0; scrn < ScreenCount(dpy); scrn++) + { + if (!(pDRIScreen = __glXFindDRIScreen(dpy, scrn))) { + /* ERROR!!! */ + return FALSE; + } else if (!(psp = (__DRIscreenPrivate *)pDRIScreen->private)) { + /* ERROR!!! */ + return FALSE; + } + + xmutex_lock(psp->mutex); + + pdraw = __driMesaFindDrawableByUID(psp->drawHash, uid); + if (pdraw != NULL) { + *psp_ret = psp; + *pdp_ret = pdraw->private; + return TRUE; + }; + + xmutex_unlock(psp->mutex); + } + + return FALSE; +} + +static void +unbind_context(__DRIcontextPrivate *pcp) +{ + /* Unbind the context from its old drawable. */ + + if (pcp->driDrawablePriv != NULL) + { + if (pcp->next != NULL) + pcp->next->prev = pcp->prev; + if (pcp->prev != NULL) + pcp->prev->next = pcp->next; + + if (pcp->driDrawablePriv->driContextPriv == pcp) + pcp->driDrawablePriv->driContextPriv = pcp->next; + + pcp->driDrawablePriv = NULL; + pcp->prev = pcp->next = NULL; + } + + if (pcp->surface_id != 0) + { + pcp->surface_id = 0; + pcp->pending_clear = TRUE; + } +} + +static void +unbind_drawable(__DRIdrawablePrivate *pdp) +{ + __DRIcontextPrivate *pcp, *next; + + for (pcp = pdp->driContextPriv; pcp != NULL; pcp = next) + { + next = pcp->next; + unbind_context(pcp); + } +} + +static void +update_context(__DRIcontextPrivate *pcp) +{ + if (pcp->pending_clear) + { + CGLClearDrawable(pcp->ctx); + pcp->pending_clear = FALSE; + } + + if (pcp->pending_update && pcp->surface_id != 0) + { + xp_update_gl_context(pcp->ctx); + pcp->pending_update = FALSE; + } +} + +static Bool driMesaUnbindContext(Display *dpy, int scrn, + GLXDrawable draw, GLXContext gc, + int will_rebind) +{ + __DRIscreen *pDRIScreen; +// __DRIdrawable *pdraw; + __DRIcontextPrivate *pcp; + __DRIscreenPrivate *psp; + __DRIdrawablePrivate *pdp; + + /* + ** Assume error checking is done properly in glXMakeCurrent before + ** calling driMesaUnbindContext. + */ + + if (gc == NULL || draw == None) { + /* ERROR!!! */ + return GL_FALSE; + } + + if (!(pDRIScreen = __glXFindDRIScreen(dpy, scrn))) { + /* ERROR!!! */ + return GL_FALSE; + } else if (!(psp = (__DRIscreenPrivate *)pDRIScreen->private)) { + /* ERROR!!! */ + return GL_FALSE; + } + + xmutex_lock(psp->mutex); + + pcp = (__DRIcontextPrivate *)gc->driContext.private; + + pdp = pcp->driDrawablePriv; + if (pdp == NULL) { + /* ERROR!!! */ + xmutex_unlock(psp->mutex); + return GL_FALSE; + } + + /* Put this thread back into normal (indirect) dispatch mode. */ + CGLSetCurrentContext(XAppleDRIGetIndirectContext()); + pcp->thread_id = 0; + + /* Lazily unbind the drawable from the context */ + unbind_context(pcp); + + if (pdp->refcount == 0) { + /* ERROR!!! */ + xmutex_unlock(psp->mutex); + return GL_FALSE; + } else if (--pdp->refcount == 0) { +#if 0 + /* + ** NOT_DONE: When a drawable is unbound from one direct + ** rendering context and then bound to another, we do not want + ** to destroy the drawable data structure each time only to + ** recreate it immediatly afterwards when binding to the next + ** context. This also causes conflicts with caching of the + ** drawable stamp. + ** + ** In addition, we don't destroy the drawable here since Mesa + ** keeps private data internally (e.g., software accumulation + ** buffers) that should not be destroyed unless the client + ** explicitly requests that the window be destroyed. + ** + ** When GLX 1.3 is integrated, the create and destroy drawable + ** functions will have user level counterparts and the memory + ** will be able to be recovered. + ** + ** Below is an example of what needs to go into the destroy + ** drawable routine to support GLX 1.3. + */ + __driMesaRemoveDrawable(psp->drawHash, pdraw); + (*pdraw->destroyDrawable)(dpy, pdraw->private); + Xfree(pdraw); +#endif + } + + xmutex_unlock(psp->mutex); + return GL_TRUE; +} + +static Bool driMesaBindContext(Display *dpy, int scrn, + GLXDrawable draw, GLXContext gc) +{ + __DRIscreen *pDRIScreen; + __DRIdrawable *pdraw; + __DRIdrawablePrivate *pdp; + __DRIscreenPrivate *psp; + __DRIcontextPrivate *pcp; + + /* + ** Assume error checking is done properly in glXMakeCurrent before + ** calling driMesaBindContext. + */ + + if (gc == NULL || draw == None) { + /* ERROR!!! */ + return GL_FALSE; + } + + if (!(pDRIScreen = __glXFindDRIScreen(dpy, scrn))) { + /* ERROR!!! */ + return GL_FALSE; + } else if (!(psp = (__DRIscreenPrivate *)pDRIScreen->private)) { + /* ERROR!!! */ + return GL_FALSE; + } + + xmutex_lock(psp->mutex); + + pdraw = __driMesaFindDrawable(psp->drawHash, draw); + if (!pdraw) { + /* Allocate a new drawable */ + pdraw = (__DRIdrawable *)Xmalloc(sizeof(__DRIdrawable)); + if (!pdraw) { + /* ERROR!!! */ + xmutex_unlock(psp->mutex); + return GL_FALSE; + } + + /* Create a new drawable */ + pdraw->private = driMesaCreateDrawable(dpy, scrn, draw, gc->vid, + pdraw); + if (!pdraw->private) { + /* ERROR!!! */ + Xfree(pdraw); + xmutex_unlock(psp->mutex); + return GL_FALSE; + } + + /* Add pdraw to drawable list */ + if (!__driMesaAddDrawable(psp->drawHash, pdraw)) { + /* ERROR!!! */ + (*pdraw->destroyDrawable)(dpy, pdraw->private); + Xfree(pdraw); + xmutex_unlock(psp->mutex); + return GL_FALSE; + } + } + + pdp = (__DRIdrawablePrivate *)pdraw->private; + pcp = (__DRIcontextPrivate *)gc->driContext.private; + + if (pdp->surface_id == 0) + { + /* Surface got destroyed. Try to create a new one. */ + + driMesaCreateSurface(dpy, scrn, pdp); + } + + unbind_context(pcp); + + /* Bind the drawable to the context */ + pcp->driDrawablePriv = pdp; + pcp->prev = NULL; + pcp->next = pdp->driContextPriv; + pdp->driContextPriv = pcp; + pdp->refcount++; + + /* And the physical surface to the physical context */ + if (pcp->surface_id != pdp->surface_id) + { + pcp->surface_id = 0; + + /* Attaching the drawable sets the default viewport. But we don't + want to catch that call to glViewport in our wrappers. */ + unwrap_context(pcp); + + if (pdp->surface_id == 0) + CGLClearDrawable(pcp->ctx); + else if (xp_attach_gl_context(pcp->ctx, pdp->surface_id) == Success) + pcp->surface_id = pdp->surface_id; + else + fprintf(stderr, "failed to bind to surface\n"); + + wrap_context(pcp); + + pcp->pending_clear = FALSE; + pcp->pending_update = FALSE; + } + else if (pcp->pending_clear) + { + CGLClearDrawable(pcp->ctx); + pcp->pending_clear = FALSE; + } + + /* Activate the CGL context and remember which thread it's current for. */ + CGLSetCurrentContext(pcp->ctx); + pcp->thread_id = xthread_self(); + + xmutex_unlock(psp->mutex); + return GL_TRUE; +} + +/*****************************************************************/ + +static xp_client_id +get_client_id(void) +{ + static xp_client_id id; + + if (id == 0) + { + if (xp_init(XP_IN_BACKGROUND) != Success + || xp_get_client_id(&id) != Success) + { + return 0; + } + } + + return id; +} + +static void driMesaCreateSurface(Display *dpy, int scrn, + __DRIdrawablePrivate *pdp) +{ + xp_client_id client_id; + unsigned int key[2]; + + pdp->surface_id = 0; + pdp->uid = 0; + + client_id = get_client_id(); + if (client_id == 0) + return; + + if (XAppleDRICreateSurface(dpy, scrn, pdp->draw, + client_id, key, &pdp->uid)) + { + xp_import_surface(key, &pdp->surface_id); + } +} + +static void *driMesaCreateDrawable(Display *dpy, int scrn, GLXDrawable draw, + VisualID vid, __DRIdrawable *pdraw) +{ + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + __DRIdrawablePrivate *pdp; + + pdp = (__DRIdrawablePrivate *)Xmalloc(sizeof(__DRIdrawablePrivate)); + if (!pdp) { + return NULL; + } + + pdp->draw = draw; + pdp->refcount = 0; + pdp->surface_id = 0; + pdp->uid = 0; + pdp->destroyed = FALSE; + + if (!(pDRIScreen = __glXFindDRIScreen(dpy, scrn))) { + Xfree(pdp); + return NULL; + } else if (!(psp = (__DRIscreenPrivate *)pDRIScreen->private)) { + Xfree(pdp); + return NULL; + } + pdp->driScreenPriv = psp; + pdp->driContextPriv = NULL; + + driMesaCreateSurface(dpy, scrn, pdp); + if (pdp->surface_id == 0) { + Xfree(pdp); + return NULL; + } + + pdraw->destroyDrawable = driMesaDestroyDrawable; + pdraw->swapBuffers = driMesaSwapBuffers; + + return (void *)pdp; +} + +static __DRIdrawable *driMesaGetDrawable(Display *dpy, GLXDrawable draw, + void *screenPrivate) +{ + __DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate; + __DRIdrawable *dri_draw; + + xmutex_lock(psp->mutex); + + /* + ** Make sure this routine returns NULL if the drawable is not bound + ** to a direct rendering context! + */ + dri_draw = __driMesaFindDrawable(psp->drawHash, draw); + + xmutex_unlock(psp->mutex); + return dri_draw; +} + +static void driMesaSwapBuffers(Display *dpy, void *drawPrivate) +{ + __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *) drawPrivate; + __DRIcontextPrivate *pcp; + xthread_t self = xthread_self(); + static Bool warned; + + xmutex_lock(pdp->driScreenPriv->mutex); + + /* FIXME: this is sub-optimal, since we may not always find a context + bound to the given drawable on this thread. */ + + for (pcp = pdp->driContextPriv; pcp != NULL; pcp = pcp->next) + { + if (pcp->thread_id == self || pcp->thread_id == 0) + break; + } + + if (pcp != NULL) + { + CGLFlushDrawable(pcp->ctx); + } + else + { + if (!warned) { + fprintf(stderr, "glXSwapBuffers: no context for this drawable\n"); + warned = TRUE; + } + } + + xmutex_unlock(pdp->driScreenPriv->mutex); +} + +/* pdp->mutex is held. */ +static void driMesaDestroyDrawable(Display *dpy, void *drawPrivate) +{ + __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)drawPrivate; + + if (pdp) { + unbind_drawable(pdp); + if (pdp->surface_id != 0) { + xp_destroy_surface(pdp->surface_id); + pdp->surface_id = 0; + } + if (!pdp->destroyed) { + /* don't try to destroy an already destroyed surface. */ + XAppleDRIDestroySurface(dpy, pdp->driScreenPriv->myNum, pdp->draw); + } + Xfree(pdp); + } +} + +/*****************************************************************/ + +static CGLPixelFormatObj +driCreatePixelFormat(Display *dpy, __DRIscreenPrivate *psp, + XVisualInfo *visinfo, __GLXvisualConfig *config) +{ + int i; + CGLPixelFormatAttribute attr[64]; // currently uses max of 30 + CGLPixelFormatObj result; + long n_formats; + + i = 0; + + if (!config->rgba) + return NULL; + + if (config->stereo) + attr[i++] = kCGLPFAStereo; + + if (config->doubleBuffer) + attr[i++] = kCGLPFADoubleBuffer; + + attr[i++] = kCGLPFAColorSize; + attr[i++] = config->redSize + config->greenSize + config->blueSize; + attr[i++] = kCGLPFAAlphaSize; + attr[i++] = 1; /* FIXME: ignoring config->alphaSize which is always 0 */ + + if (config->accumRedSize + config->accumGreenSize + + config->accumBlueSize + config->accumAlphaSize > 0) + { + attr[i++] = kCGLPFAAccumSize; + attr[i++] = (config->accumRedSize + config->accumGreenSize + + config->accumBlueSize + config->accumAlphaSize); + } + + if (config->depthSize > 0) { + attr[i++] = kCGLPFADepthSize; + attr[i++] = config->depthSize; + } + + if (config->stencilSize > 0) { + attr[i++] = kCGLPFAStencilSize; + attr[i++] = config->stencilSize; + } + + if (config->auxBuffers > 0) { + attr[i++] = kCGLPFAAuxBuffers; + attr[i++] = config->auxBuffers; + } + + /* FIXME: things we don't handle: color/alpha masks, level, + visualrating, transparentFoo */ + + attr[i++] = 0; + + result = NULL; + CGLChoosePixelFormat(attr, &result, &n_formats); + + return result; +} + +static void *driMesaCreateContext(Display *dpy, XVisualInfo *vis, void *shared, + __DRIcontext *pctx) +{ + __DRIscreen *pDRIScreen; + __DRIcontextPrivate *pcp; + __DRIcontextPrivate *pshare = (__DRIcontextPrivate *)shared; + __DRIscreenPrivate *psp; + int i; + + if (!(pDRIScreen = __glXFindDRIScreen(dpy, vis->screen))) { + /* ERROR!!! */ + return NULL; + } else if (!(psp = (__DRIscreenPrivate *)pDRIScreen->private)) { + /* ERROR!!! */ + return NULL; + } + + /* Create the hash table */ + if (!psp->drawHash) { + xmutex_lock(psp->mutex); + if (!psp->drawHash) + psp->drawHash = x_hash_table_new(NULL, NULL, NULL, NULL); + xmutex_unlock(psp->mutex); + } + + pcp = (__DRIcontextPrivate *)Xmalloc(sizeof(__DRIcontextPrivate)); + if (!pcp) { + return NULL; + } + + pcp->display = dpy; + pcp->driScreenPriv = psp; + pcp->driDrawablePriv = NULL; + + pcp->ctx = NULL; + pcp->surface_id = 0; + + pcp->pending_clear = FALSE; + pcp->pending_update = FALSE; + + pcp->ctx = NULL; + for (i = 0; pcp->ctx == NULL && i < psp->numVisuals; i++) { + if (psp->visuals[i].vid == vis->visualid) { + CGLCreateContext(psp->visuals[i].pixel_format, + pshare ? pshare->ctx : NULL, &pcp->ctx); + } + } + + if (!pcp->ctx) { + Xfree(pcp); + return NULL; + } + + pctx->destroyContext = driMesaDestroyContext; + pctx->bindContext = driMesaBindContext; + pctx->unbindContext = driMesaUnbindContext; + + wrap_context(pcp); + + xmutex_lock(psp->mutex); + __driMesaGarbageCollectDrawables(pcp->driScreenPriv->drawHash); + xmutex_unlock(psp->mutex); + + return pcp; +} + +static void driMesaDestroyContext(Display *dpy, int scrn, void *contextPrivate) +{ + __DRIcontextPrivate *pcp = (__DRIcontextPrivate *) contextPrivate; + + if (pcp) { + xmutex_lock(pcp->driScreenPriv->mutex); + unbind_context(pcp); + __driMesaGarbageCollectDrawables(pcp->driScreenPriv->drawHash); + xmutex_unlock(pcp->driScreenPriv->mutex); + CGLDestroyContext(pcp->ctx); + Xfree(pcp); + } +} + +/*****************************************************************/ + +static void *driMesaCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, + int numConfigs, __GLXvisualConfig *config) +{ + int directCapable, i, n; + __DRIscreenPrivate *psp; + XVisualInfo visTmpl, *visinfo; + + if (!XAppleDRIQueryDirectRenderingCapable(dpy, scrn, &directCapable)) { + return NULL; + } + + if (!directCapable) { + return NULL; + } + + psp = (__DRIscreenPrivate *)Xmalloc(sizeof(__DRIscreenPrivate)); + if (!psp) { + return NULL; + } + + psp->mutex = xmutex_malloc(); + if (psp->mutex != NULL) { + xmutex_init (psp->mutex); + xmutex_set_name (psp->mutex, "AppleDRI"); + } + psp->display = dpy; + psp->myNum = scrn; + +#if 0 + if (!XAppleDRIAuthConnection(dpy, scrn, magic)) { + Xfree(psp); + (void)XAppleDRICloseConnection(dpy, scrn); + return NULL; + } +#endif + + /* + * Allocate space for an array of visual records and initialize them. + */ + psp->visuals = (__DRIvisualPrivate *)Xmalloc(numConfigs * + sizeof(__DRIvisualPrivate)); + if (!psp->visuals) { + Xfree(psp); + return NULL; + } + + visTmpl.screen = scrn; + visinfo = XGetVisualInfo(dpy, VisualScreenMask, &visTmpl, &n); + if (n != numConfigs) { + Xfree(psp); + return NULL; + } + + psp->numVisuals = 0; + for (i = 0; i < numConfigs; i++, config++) { + psp->visuals[psp->numVisuals].vid = visinfo[i].visualid; + psp->visuals[psp->numVisuals].pixel_format = + driCreatePixelFormat(dpy, psp, &visinfo[i], config); + if (psp->visuals[psp->numVisuals].pixel_format != NULL) { + psp->numVisuals++; + } + } + + XFree(visinfo); + + if (psp->numVisuals == 0) { + /* Couldn't create any pixel formats. */ + Xfree(psp->visuals); + Xfree(psp); + return NULL; + } + + /* Initialize the drawHash when the first context is created */ + psp->drawHash = NULL; + + psc->destroyScreen = driMesaDestroyScreen; + psc->createContext = driMesaCreateContext; + psc->createDrawable = driMesaCreateDrawable; + psc->getDrawable = driMesaGetDrawable; + + return (void *)psp; +} + +static void driMesaDestroyScreen(Display *dpy, int scrn, void *screenPrivate) +{ + __DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate; + + if (psp) { + //FIXME resetDriver ? + Xfree(psp->visuals); + Xfree(psp); + } +} + +/* Note: definitely can't make any X protocol requests here. */ +static void driAppleSurfaceNotify(Display *dpy, unsigned int uid, int kind) +{ + __DRIscreenPrivate *psp; + __DRIdrawablePrivate *pdp; + __DRIcontextPrivate *pcp; + + /* locks psp->mutex if successful. */ + if (driMesaFindDrawableByUID(dpy, uid, &psp, &pdp)) + { + xthread_t self = xthread_self(); + + switch (kind) + { + Bool all_safe; + + case AppleDRISurfaceNotifyDestroyed: + xp_destroy_surface(pdp->surface_id); + pdp->surface_id = 0; + + for (pcp = pdp->driContextPriv; pcp != NULL; pcp = pcp->next) + { + pcp->surface_id = 0; + + if (pcp->thread_id == self || pcp->thread_id == 0) { + CGLClearDrawable(pcp->ctx); + pcp->pending_clear = FALSE; + } else + pcp->pending_clear = TRUE; + } + break; + + case AppleDRISurfaceNotifyChanged: + all_safe = TRUE; + for (pcp = pdp->driContextPriv; pcp != NULL; pcp = pcp->next) + { + if (pcp->thread_id != 0 && pcp->thread_id != self) { + all_safe = FALSE; + break; + } + } + for (pcp = pdp->driContextPriv; pcp != NULL; pcp = pcp->next) + { + if (all_safe) { + xp_update_gl_context(pcp->ctx); + pcp->pending_update = FALSE; + } else + pcp->pending_update = TRUE; + } + break; + } + + xmutex_unlock(psp->mutex); + } +} + +/* + * This is the entrypoint into the DRI 3D driver. + * The driCreateScreen name is the symbol that libGL.so fetches via + * dlsym() in order to bootstrap the driver. + */ +void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, + int numConfigs, __GLXvisualConfig *config) +{ + static int here_before; + + if (!here_before) + { + XAppleDRISetSurfaceNotifyHandler(driAppleSurfaceNotify); + here_before = True; + } + + return driMesaCreateScreen(dpy, scrn, psc, numConfigs, config); +} + +void __driRegisterExtensions(void) +{ +} + +__private_extern__ void XAppleDRIUseIndirectDispatch(void) +{ + CGLSetCurrentContext(XAppleDRIGetIndirectContext()); +} + +/*****************************************************************/ + +/* + * Currently (Mac OS X 10.3) the only way we have of regaining control + * from threads calling GL and nothing else is by patching the dispatch + * table of the CGLContext, so that glViewport, glFlush and glFinish + * call us back. + * + * Since glNewList and glEndList overwrite the entire dispatch table we + * also need to patch those so we can restore the others. + * + * WARNING: This is not expected to work on future OS releases. + */ + +#define WRAP_CGL(context, vec, fun) \ + do { \ + (context)->disp.vec = (context)->ctx->disp.vec; \ + (context)->ctx->disp.vec = (fun); \ + } while (0) + +#define UNWRAP_CGL(context, vec) \ + do { \ + (context)->ctx->disp.vec = (context)->disp.vec; \ + } while (0) + +#define WRAP_BOILERPLATE \ + GLXContext gc; \ + __DRIcontextPrivate *pcp; \ + gc = __glXGetCurrentContext(); \ + if (gc == NULL || !gc->isDirect) return; \ + pcp = (__DRIcontextPrivate *) gc->driContext.private; \ + if (pcp == NULL) return; + +static void viewport_callback(GLIContext ctx, GLint x, GLint y, + GLsizei width, GLsizei height) +{ + WRAP_BOILERPLATE + + xmutex_lock(pcp->driScreenPriv->mutex); + update_context(pcp); + xmutex_unlock(pcp->driScreenPriv->mutex); + + (*pcp->disp.viewport)(ctx, x, y, width, height); +} + +static void new_list_callback(GLIContext ctx, GLuint list, GLenum mode) +{ + WRAP_BOILERPLATE + + unwrap_context(pcp); + (*pcp->ctx->disp.new_list)(ctx, list, mode); + wrap_context(pcp); +} + +static void end_list_callback(GLIContext ctx) +{ + WRAP_BOILERPLATE + + unwrap_context(pcp); + (*pcp->ctx->disp.end_list)(ctx); + wrap_context(pcp); +} + +static void unwrap_context(__DRIcontextPrivate *pcp) +{ + UNWRAP_CGL(pcp, viewport); + UNWRAP_CGL(pcp, new_list); + UNWRAP_CGL(pcp, end_list); +} + +static void wrap_context(__DRIcontextPrivate *pcp) +{ + WRAP_CGL(pcp, new_list, new_list_callback); + WRAP_CGL(pcp, end_list, end_list_callback); + WRAP_CGL(pcp, viewport, viewport_callback); +} + +#endif /* GLX_DIRECT_RENDERING */ Index: xc/lib/GL/apple/dri_driver.h diff -u /dev/null xc/lib/GL/apple/dri_driver.h:1.2 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/dri_driver.h Thu Oct 30 21:22:12 2003 @@ -0,0 +1,188 @@ +/* $XFree86: xc/lib/GL/apple/dri_driver.h,v 1.2 2003/10/31 02:22:12 torrey Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Brian Paul + */ + +#ifndef _DRI_DRIVER_H_ +#define _DRI_DRIVER_H_ + +#include "Xplugin.h" +#include "Xthreads.h" +#include +#include +#include + +#ifdef GLX_DIRECT_RENDERING + +typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate; +typedef struct __DRIscreenPrivateRec __DRIscreenPrivate; +typedef struct __DRIvisualPrivateRec __DRIvisualPrivate; +typedef struct __DRIcontextPrivateRec __DRIcontextPrivate; +typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate; + +#endif /* GLX_DIRECT_RENDERING */ + +#define DRI_MESA_VALIDATE_DRAWABLE_INFO(dpy,scrn,pDrawPriv) \ + do { \ + if (*(pDrawPriv->pStamp) != pDrawPriv->lastStamp) { \ + driMesaUpdateDrawableInfo(dpy,scrn,pDrawPriv); \ + } \ + } while (0) + +struct __DRIdrawablePrivateRec { + /* + ** X's drawable ID associated with this private drawable. + */ + GLXDrawable draw; + + /* + ** Reference count for number of context's currently bound to this + ** drawable. Once the refcount reaches 0, the drawable can be + ** destroyed. This behavior will change with GLX 1.3. + */ + int refcount; + + xp_surface_id surface_id; + unsigned int uid; + + /* + ** Pointer to contexts to which this drawable is currently bound. + */ + __DRIcontextPrivate *driContextPriv; + + /* + ** Pointer to screen on which this drawable was created. + */ + __DRIscreenPrivate *driScreenPriv; + + /* + ** Set when the drawable on the server is known to have gone away + */ + unsigned int destroyed :1; +}; + +struct __DRIcontextPrivateRec { + /* + ** Other contexts bound to the same drawable. + */ + __DRIcontextPrivate *next, *prev; + + /* + ** Kernel context handle used to access the device lock. + */ + XID contextID; + + CGLContextObj ctx; + + /* + ** Set when attached + */ + xp_surface_id surface_id; + xthread_t thread_id; + + /* + ** This context's display pointer. + */ + Display *display; + + /* + ** Pointer to drawable currently bound to this context. + */ + __DRIdrawablePrivate *driDrawablePriv; + + /* + ** Pointer to screen on which this context was created. + */ + __DRIscreenPrivate *driScreenPriv; + + /* + ** wrapped CGL vectors + */ + struct { + void (*viewport)(GLIContext ctx, GLint x, GLint y, + GLsizei width, GLsizei height); + void (*new_list)(GLIContext ctx, GLuint list, GLenum mode); + void (*end_list)(GLIContext ctx); + } disp; + + unsigned int pending_update :1; + unsigned int pending_clear :1; +}; + +struct __DRIvisualPrivateRec { + /* + ** X's visual ID associated with this private visual. + */ + VisualID vid; + + /* + ** CGL object representing the visual + */ + CGLPixelFormatObj pixel_format; +}; + +struct __DRIscreenPrivateRec { + /* + ** Display for this screen + */ + Display *display; + + /* + ** Mutex for this screen + */ + xmutex_t mutex; + + /* + ** Current screen's number + */ + int myNum; + + /* + ** Core rendering library's visuals associated with the current + ** screen. + */ + __DRIvisualPrivate *visuals; + int numVisuals; + + /* + ** Hash table to hold the drawable information for this screen. + */ + void *drawHash; +}; + + +extern void driMesaUpdateDrawableInfo(Display *dpy, int scrn, + __DRIdrawablePrivate *pdp); + + +#endif /* _DRI_DRIVER_H_ */ Index: xc/lib/GL/apple/dri_glx.c diff -u /dev/null xc/lib/GL/apple/dri_glx.c:1.1 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/dri_glx.c Sun Jun 29 21:45:10 2003 @@ -0,0 +1,138 @@ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/apple/dri_glx.c,v 1.1 2003/06/30 01:45:10 torrey Exp $ */ + +/* + * Authors: + * Kevin E. Martin + * Brian Paul + * + */ + +#ifdef GLX_DIRECT_RENDERING + +#include +#include +#include +#include "extutil.h" +#include "glxclient.h" +#include "appledri.h" +#include +#include "dri_glx.h" +#include +#include + + +static void driDestroyDisplay(Display *dpy, void *private) +{ + __DRIdisplayPrivate *pdpyp = (__DRIdisplayPrivate *)private; + + if (pdpyp) { + Xfree(pdpyp->createScreen); + Xfree(pdpyp); + } +} + + +void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp) +{ + const int numScreens = ScreenCount(dpy); + __DRIdisplayPrivate *pdpyp; + int eventBase, errorBase; + int major, minor, patch; + + /* Initialize these fields to NULL in case we fail. + * If we don't do this we may later get segfaults trying to free random + * addresses when the display is closed. + */ + pdisp->private = NULL; + pdisp->destroyDisplay = NULL; + pdisp->createScreen = NULL; + + if (!XAppleDRIQueryExtension(dpy, &eventBase, &errorBase)) { + return NULL; + } + + if (!XAppleDRIQueryVersion(dpy, &major, &minor, &patch)) { + return NULL; + } + + pdpyp = (__DRIdisplayPrivate *)Xmalloc(sizeof(__DRIdisplayPrivate)); + if (!pdpyp) { + return NULL; + } + + pdpyp->driMajor = major; + pdpyp->driMinor = minor; + pdpyp->driPatch = patch; + + pdisp->destroyDisplay = driDestroyDisplay; + + /* allocate array of pointers to createScreen funcs */ + pdisp->createScreen = (CreateScreenFunc *) Xmalloc(numScreens * sizeof(void *)); + if (!pdisp->createScreen) + return NULL; + + /* we'll statically bind to the __driCreateScreen function */ + { + int i; + for (i = 0; i < numScreens; i++) { + pdisp->createScreen[i] = __driCreateScreen; + } + } + + return (void *)pdpyp; +} + + +/* +** Here we'll query the DRI driver for each screen and let each +** driver register its GL extension functions. We only have to +** do this once. But it MUST be done before we create any contexts +** (i.e. before any dispatch tables are created) and before +** glXGetProcAddressARB() returns. +** +** Currently called by glXGetProcAddress(), __glXInitialize(), and +** __glXNewIndirectAPI(). +*/ +void +__glXRegisterExtensions(void) +{ + static GLboolean alreadyCalled = GL_FALSE; + + if (alreadyCalled) { + return; + } + + __driRegisterExtensions (); + + alreadyCalled = GL_TRUE; +} + + +#endif /* GLX_DIRECT_RENDERING */ Index: xc/lib/GL/apple/dri_glx.h diff -u /dev/null xc/lib/GL/apple/dri_glx.h:1.3 --- /dev/null Sat Feb 28 21:41:10 2004 +++ xc/lib/GL/apple/dri_glx.h Fri Oct 24 11:25:06 2003 @@ -0,0 +1,67 @@ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright (c) 2002 Apple Computer, Inc. +All Rights Reserved. + +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/apple/dri_glx.h,v 1.3 2003/10/24 15:25:06 tsi Exp $ */ + +/* + * Authors: + * Kevin E. Martin + * Brian Paul + * + */ + +#ifndef _DRI_GLX_H_ +#define _DRI_GLX_H_ + +#ifdef GLX_DIRECT_RENDERING + +struct __DRIdisplayPrivateRec { + /* + ** XFree86-DRI version information + */ + int driMajor; + int driMinor; + int driPatch; + + /* + ** Array of library handles [indexed by screen number] + */ + CreateScreenFunc **createScreen; +}; + +typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate; +typedef struct __DRIscreenPrivateRec __DRIscreenPrivate; +typedef struct __DRIvisualPrivateRec __DRIvisualPrivate; +typedef struct __DRIcontextPrivateRec __DRIcontextPrivate; +typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate; + +extern void *__driCreateScreen (Display *dpy, int scrn, __DRIscreen *psc, + int numConfigs, __GLXvisualConfig *config); +extern void __driRegisterExtensions (void); + +#endif /* GLX_DIRECT_RENDERING */ +#endif /* _DRI_GLX_H_ */ Index: xc/lib/GL/dri/Imakefile diff -u xc/lib/GL/dri/Imakefile:1.10 xc/lib/GL/dri/Imakefile:1.11 --- xc/lib/GL/dri/Imakefile:1.10 Fri Feb 22 16:32:51 2002 +++ xc/lib/GL/dri/Imakefile Sun Sep 28 16:14:59 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/dri/Imakefile,v 1.10 2002/02/22 21:32:51 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/dri/Imakefile,v 1.11 2003/09/28 20:14:59 alanh Exp $ #include @@ -21,17 +21,13 @@ -I$(MESASRCDIR)/include -I$(MESASRCDIR)/src #endif -#if GlxBuiltInTdfx - TDFX_DEFS = -DUSE_TDFX -#endif - #if GlxUseBuiltInDRIDriver GLX_DEFS = -DBUILT_IN_DRI_DRIVER #endif PATHDEFINES = -DDEFAULT_DRIVER_DIR=\"$(MODULEDIR)/dri\" - DEFINES = $(ALLOC_DEFINES) GlxDefines $(TDFX_DEFS) $(GLX_DEFS) $(PATHDEFINES) + DEFINES = $(ALLOC_DEFINES) GlxDefines $(GLX_DEFS) $(PATHDEFINES) INCLUDES = -I$(XLIBSRC) -I$(EXTINCSRC) -I$(XF86OSSRC) $(DRI_INCS) SRCS = XF86dri.c dri_util.c $(DRI_SRCS) OBJS = XF86dri.o dri_util.o $(DRI_OBJS) Index: xc/lib/GL/dri/dri_glx.c diff -u xc/lib/GL/dri/dri_glx.c:1.12 xc/lib/GL/dri/dri_glx.c:1.15 --- xc/lib/GL/dri/dri_glx.c:1.12 Thu Feb 6 07:42:10 2003 +++ xc/lib/GL/dri/dri_glx.c Sun Sep 28 16:14:59 2003 @@ -24,7 +24,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/dri/dri_glx.c,v 1.12 2003/02/06 12:42:10 alanh Exp $ */ +/* $XFree86: xc/lib/GL/dri/dri_glx.c,v 1.15 2003/09/28 20:14:59 alanh Exp $ */ /* * Authors: @@ -48,12 +48,12 @@ #include #include - -typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config); - -typedef void *(*RegisterExtensionsFunc)(void); - +#ifndef RTLD_NOW +#define RTLD_NOW 0 +#endif +#ifndef RTLD_GLOBAL +#define RTLD_GLOBAL 0 +#endif #ifdef BUILT_IN_DRI_DRIVER @@ -69,17 +69,6 @@ #define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri" #endif -/* - * We keep a linked list of these structures, one per DRI device driver. - */ -typedef struct __DRIdriverRec { - const char *name; - void *handle; - CreateScreenFunc createScreenFunc; - RegisterExtensionsFunc registerExtensionsFunc; - struct __DRIdriverRec *next; -} __DRIdriver; - static __DRIdriver *Drivers = NULL; @@ -247,8 +236,6 @@ dlclose(handle); continue; } - driver->registerExtensionsFunc = (RegisterExtensionsFunc) - dlsym(handle, "__driRegisterExtensions"); driver->handle = handle; /* put at head of linked list */ driver->next = Drivers; @@ -279,11 +266,11 @@ *driverName = NULL; if (!XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &directCapable)) { - ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed"); + ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed\n"); return False; } if (!directCapable) { - ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false"); + ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false\n"); return False; } @@ -305,18 +292,16 @@ * Given a display pointer and screen number, return a __DRIdriver handle. * Return NULL if anything goes wrong. */ -static __DRIdriver *GetDriver(Display *dpy, int scrNum) +__DRIdriver *driGetDriver(Display *dpy, int scrNum) { char *driverName; - __DRIdriver *ret; - if (GetDriverName(dpy, scrNum, &driverName)) { + __DRIdriver *ret; ret = OpenDriver(driverName); if (driverName) Xfree(driverName); return ret; } - return NULL; } @@ -410,9 +395,8 @@ * driver's "__driCreateScreen" function pointer. That's the bootstrap * entrypoint for all DRI drivers. */ - __glXRegisterExtensions(); for (scrn = 0; scrn < numScreens; scrn++) { - __DRIdriver *driver = GetDriver(dpy, scrn); + __DRIdriver *driver = driGetDriver(dpy, scrn); if (driver) { pdisp->createScreen[scrn] = driver->createScreenFunc; pdpyp->libraryHandles[scrn] = driver->handle; @@ -427,62 +411,4 @@ return (void *)pdpyp; } - - -/* -** Here we'll query the DRI driver for each screen and let each -** driver register its GL extension functions. We only have to -** do this once. But it MUST be done before we create any contexts -** (i.e. before any dispatch tables are created) and before -** glXGetProcAddressARB() returns. -** -** Currently called by glXGetProcAddress(), __glXInitialize(), and -** __glXNewIndirectAPI(). -*/ -void -__glXRegisterExtensions(void) -{ -#ifndef BUILT_IN_DRI_DRIVER - static GLboolean alreadyCalled = GL_FALSE; - int displayNum, maxDisplays; - - if (alreadyCalled) - return; - alreadyCalled = GL_TRUE; - - if (getenv("LIBGL_MULTIHEAD")) { - /* we'd like to always take this path but doing so causes a second - * or more of delay while the XOpenDisplay() function times out. - */ - maxDisplays = 10; /* infinity, really */ - } - else { - /* just open the :0 display */ - maxDisplays = 1; - } - - for (displayNum = 0; displayNum < maxDisplays; displayNum++) { - char displayName[200]; - Display *dpy; - snprintf(displayName, 199, ":%d.0", displayNum); - dpy = XOpenDisplay(displayName); - if (dpy) { - const int numScreens = ScreenCount(dpy); - int screenNum; - for (screenNum = 0; screenNum < numScreens; screenNum++) { - __DRIdriver *driver = GetDriver(dpy, screenNum); - if (driver && driver->registerExtensionsFunc) { - (*driver->registerExtensionsFunc)(); - } - } - XCloseDisplay(dpy); - } - else { - break; - } - } -#endif -} - - #endif /* GLX_DIRECT_RENDERING */ Index: xc/lib/GL/dri/dri_util.c diff -u xc/lib/GL/dri/dri_util.c:1.6 xc/lib/GL/dri/dri_util.c:1.11 --- xc/lib/GL/dri/dri_util.c:1.6 Sat Feb 15 17:12:29 2003 +++ xc/lib/GL/dri/dri_util.c Thu Nov 13 12:22:49 2003 @@ -1,65 +1,25 @@ -/* $XFree86: xc/lib/GL/dri/dri_util.c,v 1.6 2003/02/15 22:12:29 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Brian E. Paul - */ - -/* - * This file gets compiled into each of the DRI 3D drivers. This is - * basically just a collection of utility functions that are useful - * for most drivers. A DRI driver doesn't have to use any of this, - * but it's useful boilerplate. - * +/* $XFree86: xc/lib/GL/dri/dri_util.c,v 1.11 2003/11/13 17:22:49 dawes Exp $ */ +/** + * \file dri_util.c + * DRI utility functions. * - * Many of the functions defined here are called from the GL library - * via function pointers in the __DRIdisplayRec, __DRIscreenRec, - * __DRIcontextRec, __DRIdrawableRec structures defined in glxclient.h + * This module acts as glue between GLX and the actual hardware driver. A DRI + * driver doesn't really \e have to use any of this - it's optional. But, some + * useful stuff is done here that otherwise would have to be duplicated in most + * drivers. + * + * Basically, these utility functions take care of some of the dirty details of + * screen initialization, context creation, context binding, DRM setup, etc. * - * Those function pointers are initialized by code in this file. - * The process starts when libGL calls the __driCreateScreen() function - * at the end of this file. - * - * The above-mentioned DRI structures have no dependencies on Mesa. - * Each structure instead has a generic (void *) private pointer that - * points to a private structure. For the current drivers, these private - * structures are the __DRIdrawablePrivateRec, __DRIcontextPrivateRec, - * __DRIscreenPrivateRec, and __DRIvisualPrivateRec structures defined - * in dri_util.h. We allocate and attach those structs here in - * this file. + * These functions are compiled into each DRI driver so libGL.so knows nothing + * about them. */ #ifdef GLX_DIRECT_RENDERING #include +#include #include #include #include @@ -72,6 +32,10 @@ /* forward declarations */ +static int driQueryFrameTracking( Display * dpy, void * priv, + int64_t * sbc, int64_t * missedFrames, float * lastMissedUsage, + float * usage ); + static void *driCreateDrawable(Display *dpy, int scrn, GLXDrawable draw, GLboolean isPixmap, VisualID vid, __DRIdrawable *pdraw); @@ -79,28 +43,14 @@ static void driDestroyDrawable(Display *dpy, void *drawablePrivate); - - -static Bool driFeatureOn(const char *name) -{ - char *env = getenv(name); - - if (!env) return GL_FALSE; - if (!strcasecmp(env, "enable")) return GL_TRUE; - if (!strcasecmp(env, "1")) return GL_TRUE; - if (!strcasecmp(env, "on")) return GL_TRUE; - if (!strcasecmp(env, "true")) return GL_TRUE; - if (!strcasecmp(env, "t")) return GL_TRUE; - if (!strcasecmp(env, "yes")) return GL_TRUE; - if (!strcasecmp(env, "y")) return GL_TRUE; - - return GL_FALSE; -} - - -/* -** Print message to stderr if LIBGL_DEBUG env var is set. -*/ +/** + * Print message to \c stderr if the \c LIBGL_DEBUG environment variable + * is set. + * + * Is called from the drivers. + * + * \param f printf() like format string. + */ void __driUtilMessage(const char *f, ...) { @@ -117,43 +67,41 @@ /*****************************************************************/ +/** \name Visual utility functions */ +/*****************************************************************/ +/*@{*/ -/* - * Return pointer to the __GLXvisualConfig specified by dpy, scrn and vid. - * Return NULL if not found. + +/** + * Initialize a __GLcontextModes structure with the GLX parameters + * specified by the given visual ID. Too bad that the __GLXvisualConfig + * and __GLcontextModes structures are so similar, but separate. */ -static __GLXvisualConfig * -__driFindGlxConfig(Display *dpy, int scrn, VisualID vid) +static GLboolean +findConfigMode(Display *dpy, int scrn, VisualID vid, __GLcontextModes *modes) { - __GLXdisplayPrivate *priv; - __GLXscreenConfigs *glxScrnConfigs; - __GLXvisualConfig *glxConfigs; - int numConfigs, i; - - priv = __glXInitialize(dpy); - assert(priv); - - glxScrnConfigs = priv->screenConfigs; - assert(glxScrnConfigs); - - numConfigs = glxScrnConfigs[scrn].numConfigs; - glxConfigs = glxScrnConfigs[scrn].configs; - - for (i = 0; i < numConfigs; i++) { - if (glxConfigs[i].vid == vid) { - return glxConfigs +i; + const __GLXvisualConfig *config; + const __DRIscreen *pDRIScreen; + const __DRIscreenPrivate *screenPriv; + int i; + + pDRIScreen = __glXFindDRIScreen(dpy, scrn); + if (!pDRIScreen) + return GL_FALSE; + screenPriv = (const __DRIscreenPrivate *) pDRIScreen->private; + + /* Search list of configs for matching vid */ + config = NULL; + for (i = 0; i < screenPriv->numConfigs; i++) { + if (screenPriv->configs[i].vid == vid) { + config = screenPriv->configs + i; + break; } } - return NULL; -} - + if (!config) + return GL_FALSE; -/* This function comes from programs/Xserver/GL/glx/glxcmds.c - */ -static void -__glXFormatGLModes(__GLcontextModes *modes, const __GLXvisualConfig *config) -{ - /*__glXMemset(modes, 0, sizeof(__GLcontextModes));*/ + /* return mode parameters */ memset(modes, 0, sizeof(__GLcontextModes)); modes->rgbMode = (config->rgba != 0); @@ -187,14 +135,18 @@ modes->stencilBits = config->stencilSize; modes->numAuxBuffers = 0; /* XXX: should be picked up from the visual */ - modes->level = config->level; + + return GL_TRUE; } +/*@}*/ -/*****************************************************************/ -/* Maintain a list of drawables */ +/*****************************************************************/ +/** \name Drawable list management */ +/*****************************************************************/ +/*@{*/ static Bool __driAddDrawable(void *drawHash, __DRIdrawable *pdraw) { @@ -244,6 +196,7 @@ XWindowAttributes xwa; int (*oldXErrorHandler)(Display *, XErrorEvent *); + XSync(dpy, GL_FALSE); __driWindowExistsFlag = GL_TRUE; oldXErrorHandler = XSetErrorHandler(__driWindowExistsErrorHandler); XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */ @@ -261,7 +214,7 @@ do { __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private; dpy = pdp->driScreenPriv->display; - XSync(dpy, GL_FALSE); + /* XXX someday, use libGL's __glXWindowExists() function */ if (!__driWindowExists(dpy, draw)) { /* Destroy the local drawable data in the hash table, if the drawable no longer exists in the Xserver */ @@ -273,24 +226,52 @@ } } +/*@}*/ + + +/*****************************************************************/ +/** \name Context (un)binding functions */ /*****************************************************************/ +/*@{*/ -static Bool driUnbindContext(Display *dpy, int scrn, - GLXDrawable draw, GLXContext gc, - int will_rebind) + +/** + * Unbind context. + * + * \param dpy the display handle. + * \param scrn the screen number. + * \param draw drawable. + * \param read Current reading drawable. + * \param gc context. + * + * \return GL_TRUE on success, or GL_FALSE on failure. + * + * \internal + * This function calls __DriverAPIRec::UnbindContext, and then decrements + * __DRIdrawablePrivateRec::refcount which must be non-zero for a successful + * return. + * + * While casting the opaque private pointers associated with the parameters + * into their respective real types it also assures they are not null. + */ +static Bool driUnbindContext2(Display *dpy, int scrn, + GLXDrawable draw, GLXDrawable read, + GLXContext gc) { __DRIscreen *pDRIScreen; __DRIdrawable *pdraw; + __DRIdrawable *pread; __DRIcontextPrivate *pcp; __DRIscreenPrivate *psp; __DRIdrawablePrivate *pdp; + __DRIdrawablePrivate *prp; /* ** Assume error checking is done properly in glXMakeCurrent before - ** calling driUnbindContext. + ** calling driUnbindContext2. */ - if (gc == NULL || draw == None) { + if (gc == NULL || draw == None || read == None) { /* ERROR!!! */ return GL_FALSE; } @@ -312,24 +293,36 @@ } pdp = (__DRIdrawablePrivate *)pdraw->private; - /* Don't leave fullscreen mode if the - drawable will be rebound in the next - step -- this avoids a protocol - request. */ - if (!will_rebind && psp->fullscreen) { - psp->DriverAPI.CloseFullScreen(pcp); - XF86DRICloseFullScreen(dpy, scrn, draw); - psp->fullscreen = NULL; + pread = __driFindDrawable(psp->drawHash, read); + if (!pread) { + /* ERROR!!! */ + return GL_FALSE; } + prp = (__DRIdrawablePrivate *)pread->private; + /* Let driver unbind drawable from context */ (*psp->DriverAPI.UnbindContext)(pcp); + if (pdp->refcount == 0) { /* ERROR!!! */ return GL_FALSE; - } else if (--pdp->refcount == 0) { + } + + pdp->refcount--; + + if (prp != pdp) { + if (prp->refcount == 0) { + /* ERROR!!! */ + return GL_FALSE; + } + + prp->refcount--; + } + #if 0 + if (pdp->refcount == 0) { /* ** NOT_DONE: When a drawable is unbound from one direct ** rendering context and then bound to another, we do not want @@ -353,8 +346,8 @@ __driRemoveDrawable(psp->drawHash, pdraw); (*pdraw->destroyDrawable)(dpy, pdraw->private); Xfree(pdraw); -#endif } +#endif /* XXX this is disabled so that if we call SwapBuffers on an unbound * window we can determine the last context bound to the window and @@ -370,7 +363,7 @@ } -/* +/** * This function takes both a read buffer and a draw buffer. * This is needed for glXMakeCurrentReadSGI() or GLX 1.3's * glxMakeContextCurrent() function. @@ -386,8 +379,6 @@ __DRIdrawablePrivate *prp; __DRIscreenPrivate *psp; __DRIcontextPrivate *pcp; - static Bool envchecked = False; - static Bool checkfullscreen = False; /* ** Assume error checking is done properly in glXMakeCurrent before @@ -476,90 +467,23 @@ pcp->driDrawablePriv = pdp; pdp->driContextPriv = pcp; pdp->refcount++; + if ( pdp != prp ) { + prp->refcount++; + } /* ** Now that we have a context associated with this drawable, we can ** initialize the drawable information if has not been done before. - ** Also, since we need it when LIBGL_DRI_FULLSCREEN, pick up any changes - ** that are outstanding. */ if (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp) { DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); - __driUtilUpdateDrawableInfo(dpy, scrn, pdp); + __driUtilUpdateDrawableInfo(pdp); DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); } /* Call device-specific MakeCurrent */ (*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp); - /* Check for the potential to enter an automatic full-screen mode. - This may need to be moved up. */ - if (!envchecked) { - checkfullscreen = driFeatureOn("LIBGL_DRI_AUTOFULLSCREEN"); - envchecked = GL_TRUE; - } - if (checkfullscreen && pdp->numClipRects == 1) { - /* If there is valid information in the SAREA, we can use it to - avoid a protocol request. The only time when the SAREA - information won't be valid will be initially, so in the worst - case, we'll make one protocol request that we could have - avoided. */ - int try = 1; - int clw = pdp->pClipRects[0].x2 - pdp->pClipRects[0].x1; - int clh = pdp->pClipRects[0].y2 - pdp->pClipRects[0].y1; - -#if 0 - /* Useful client-side debugging message */ - fprintf(stderr, - "********************************************\n" - "********************************************\n" - "********************************************\n" - "%d @ %d,%d,%d,%d\n" - "frame %d,%d,%d,%d\n" - "win %d,%d,%d,%d\n" - "fs = %p pdp = %p sarea = %d\n" - "********************************************\n" - "********************************************\n" - "********************************************\n", - pdp->numClipRects, - pdp->pClipRects[0].x1, - pdp->pClipRects[0].y1, - pdp->pClipRects[0].x2, - pdp->pClipRects[0].y2, - psp->pSAREA->frame.x, - psp->pSAREA->frame.y, - psp->pSAREA->frame.width, - psp->pSAREA->frame.height, - pdp->x, pdp->y, pdp->w, pdp->h, - psp->fullscreen, pdp, psp->pSAREA->frame.fullscreen); -#endif - - - if (pdp->x != pdp->pClipRects[0].x1 - || pdp->y != pdp->pClipRects[0].y1 - || pdp->w != clw - || pdp->h != clh) try = 0; - - if (try && psp->pSAREA->frame.width && psp->pSAREA->frame.height) { - if (pdp->x != psp->pSAREA->frame.x - || pdp->y != psp->pSAREA->frame.y - || pdp->w != psp->pSAREA->frame.width - || pdp->h != psp->pSAREA->frame.height) try = 0; - } - - if (try) { - if (psp->fullscreen && !psp->pSAREA->frame.fullscreen) { - /* Server has closed fullscreen mode */ - __driUtilMessage("server closed fullscreen mode\n"); - psp->fullscreen = NULL; - } - if (XF86DRIOpenFullScreen(dpy, scrn, draw)) { - psp->fullscreen = pdp; - psp->DriverAPI.OpenFullScreen(pcp); - } - } - } - return GL_TRUE; } @@ -574,9 +498,31 @@ } +/* + * Simply call bind with the same GLXDrawable for the read and draw buffers. + */ +static Bool driUnbindContext(Display *dpy, int scrn, + GLXDrawable draw, GLXContext gc, + int will_rebind) +{ + (void) will_rebind; + return driUnbindContext2( dpy, scrn, draw, draw, gc ); +} + +/*@}*/ + + +/*****************************************************************/ +/** \name Drawable handling functions */ /*****************************************************************/ +/*@{*/ -/* + +/** + * Update private drawable information. + * + * \param pdp pointer to the private drawable information to update. + * * This function basically updates the __DRIdrawablePrivate struct's * cliprect information by calling XF86DRIGetDrawableInfo(). This is * usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which @@ -585,8 +531,7 @@ * info. */ void -__driUtilUpdateDrawableInfo(Display *dpy, int scrn, - __DRIdrawablePrivate *pdp) +__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp) { __DRIscreenPrivate *psp; __DRIcontextPrivate *pcp = pdp->driContextPriv; @@ -613,7 +558,7 @@ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); if (!__driFindDrawable(psp->drawHash, pdp->draw) || - !XF86DRIGetDrawableInfo(dpy, scrn, pdp->draw, + !XF86DRIGetDrawableInfo(pdp->display, pdp->screen, pdp->draw, &pdp->index, &pdp->lastStamp, &pdp->x, &pdp->y, &pdp->w, &pdp->h, &pdp->numClipRects, &pdp->pClipRects, @@ -625,7 +570,7 @@ /* Error -- eg the window may have been destroyed. Keep going * with no cliprects. */ - pdp->pStamp = &pdp->lastStamp; /* prevent endless loop */ + pdp->pStamp = &pdp->lastStamp; /* prevent endless loop */ pdp->numClipRects = 0; pdp->pClipRects = NULL; pdp->numBackClipRects = 0; @@ -638,9 +583,106 @@ } +/*@}*/ + /*****************************************************************/ +/** \name GLX callbacks */ +/*****************************************************************/ +/*@{*/ -/* +/** + * Swap buffers. + * + * \param dpy the display handle. + * \param drawablePrivate opaque pointer to the per-drawable private info. + * + * \internal + * This function calls __DRIdrawablePrivate::swapBuffers. + * + * Is called directly from glXSwapBuffers(). + */ +static void driSwapBuffers( Display *dpy, void *drawablePrivate ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; + dPriv->swapBuffers(dPriv); + (void) dpy; +} + +/** + * Called directly from a number of higher-level GLX functions. + */ +static int driGetMSC( void *screenPrivate, int64_t *msc ) +{ + __DRIscreenPrivate *sPriv = (__DRIscreenPrivate *) screenPrivate; + + return sPriv->DriverAPI.GetMSC( sPriv, msc ); +} + +/** + * Called directly from a number of higher-level GLX functions. + */ +static int driGetSBC( Display *dpy, void *drawablePrivate, int64_t *sbc ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; + __DRIswapInfo sInfo; + int status; + + + status = dPriv->driScreenPriv->DriverAPI.GetSwapInfo( dPriv, & sInfo ); + *sbc = sInfo.swap_count; + + return status; +} + +static int driWaitForSBC( Display * dpy, void *drawablePriv, + int64_t target_sbc, + int64_t * msc, int64_t * sbc ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv; + + return dPriv->driScreenPriv->DriverAPI.WaitForSBC( dPriv, target_sbc, + msc, sbc ); +} + +static int driWaitForMSC( Display * dpy, void *drawablePriv, + int64_t target_msc, + int64_t divisor, int64_t remainder, + int64_t * msc, int64_t * sbc ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv; + __DRIswapInfo sInfo; + int status; + + + status = dPriv->driScreenPriv->DriverAPI.WaitForMSC( dPriv, target_msc, + divisor, remainder, + msc ); + + /* GetSwapInfo() may not be provided by the driver if GLX_SGI_video_sync + * is supported but GLX_OML_sync_control is not. Therefore, don't return + * an error value if GetSwapInfo() is not implemented. + */ + if ( status == 0 + && dPriv->driScreenPriv->DriverAPI.GetSwapInfo ) { + status = dPriv->driScreenPriv->DriverAPI.GetSwapInfo( dPriv, & sInfo ); + *sbc = sInfo.swap_count; + } + + return status; +} + +static int64_t driSwapBuffersMSC( Display * dpy, void *drawablePriv, + int64_t target_msc, + int64_t divisor, int64_t remainder ) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePriv; + + return dPriv->driScreenPriv->DriverAPI.SwapBuffersMSC( dPriv, target_msc, + divisor, + remainder ); +} + +/** * This is called via __DRIscreenRec's createDrawable pointer. * libGL doesn't use it at this time. See comments in glxclient.h. */ @@ -648,7 +690,7 @@ GLXDrawable draw, VisualID vid, __DRIdrawable *pdraw) { - return driCreateDrawable(dpy, scrn, draw, GL_FALSE, vid, pdraw); + return driCreateDrawable(dpy, scrn, draw, GL_FALSE, vid, pdraw); } @@ -660,7 +702,6 @@ __DRIscreen *pDRIScreen; __DRIscreenPrivate *psp; __DRIdrawablePrivate *pdp; - __GLXvisualConfig *config; __GLcontextModes modes; pdp = (__DRIdrawablePrivate *)Xmalloc(sizeof(__DRIdrawablePrivate)); @@ -674,6 +715,7 @@ } pdp->draw = draw; + pdp->pdraw = pdraw; pdp->refcount = 0; pdp->pStamp = NULL; pdp->lastStamp = 0; @@ -686,6 +728,8 @@ pdp->numBackClipRects = 0; pdp->pClipRects = NULL; pdp->pBackClipRects = NULL; + pdp->display = dpy; + pdp->screen = scrn; if (!(pDRIScreen = __glXFindDRIScreen(dpy, scrn))) { (void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw); @@ -699,21 +743,31 @@ pdp->driScreenPriv = psp; pdp->driContextPriv = &psp->dummyContextPriv; - config = __driFindGlxConfig(dpy, scrn, vid); - if (!config) + if (!findConfigMode(dpy, scrn, vid, &modes)) return NULL; - /* convert GLXvisualConfig struct to GLcontextModes struct */ - __glXFormatGLModes(&modes, config); - - if (!(*psp->DriverAPI.CreateBuffer)(dpy, psp, pdp, &modes, isPixmap)) { + if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &modes, isPixmap)) { (void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw); Xfree(pdp); return NULL; } pdraw->destroyDrawable = driDestroyDrawable; - pdraw->swapBuffers = psp->DriverAPI.SwapBuffers; + pdraw->swapBuffers = driSwapBuffers; /* called by glXSwapBuffers() */ + + if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { + pdraw->getSBC = driGetSBC; + pdraw->waitForSBC = driWaitForSBC; + pdraw->waitForMSC = driWaitForMSC; + pdraw->swapBuffersMSC = driSwapBuffersMSC; + pdraw->frameTracking = NULL; + pdraw->queryFrameTracking = driQueryFrameTracking; + + pdraw->swap_interval = (getenv( "LIBGL_THROTTLE_REFRESH" ) == NULL) + ? 0 : 1; + } + + pdp->swapBuffers = psp->DriverAPI.SwapBuffers; return (void *) pdp; } @@ -752,23 +806,31 @@ } } +/*@}*/ + + +/*****************************************************************/ +/** \name Context handling functions */ /*****************************************************************/ +/*@{*/ + +/** + * Destroy the per-context private information. + * + * \param dpy the display handle. + * \param scrn the screen number. + * \param contextPrivate opaque pointer to the per-drawable private info. + * + * \internal + * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls + * drmDestroyContext(), and finally frees \p contextPrivate. + */ static void driDestroyContext(Display *dpy, int scrn, void *contextPrivate) { __DRIcontextPrivate *pcp = (__DRIcontextPrivate *) contextPrivate; - __DRIscreenPrivate *psp; - __DRIdrawablePrivate *pdp; if (pcp) { - if ((pdp = pcp->driDrawablePriv)) { - /* Shut down fullscreen mode */ - if ((psp = pdp->driScreenPriv) && psp->fullscreen) { - psp->DriverAPI.CloseFullScreen(pcp); - XF86DRICloseFullScreen(dpy, scrn, pdp->draw); - psp->fullscreen = NULL; - } - } (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp); __driGarbageCollectDrawables(pcp->driScreenPriv->drawHash); (void)XF86DRIDestroyContext(dpy, scrn, pcp->contextID); @@ -776,15 +838,29 @@ } } +/** + * Create the per-drawable private driver information. + * + * \param dpy the display handle. + * \param vis the visual information. + * \param sharedPrivate the shared context dependent methods or NULL if non-existent. + * \param pctx will receive the context dependent methods. + * + * \returns a opaque pointer to the per-context private information on success, or NULL + * on failure. + * + * \internal + * This function allocates and fills a __DRIcontextPrivateRec structure. It + * gets the visual, converts it into a __GLcontextModesRec and passes it + * to __DriverAPIRec::CreateContext to create the context. + */ static void *driCreateContext(Display *dpy, XVisualInfo *vis, - void *sharedPrivate, - __DRIcontext *pctx) + void *sharedPrivate, __DRIcontext *pctx) { __DRIscreen *pDRIScreen; __DRIcontextPrivate *pcp; __DRIcontextPrivate *pshare = (__DRIcontextPrivate *) sharedPrivate; __DRIscreenPrivate *psp; - __GLXvisualConfig *config; __GLcontextModes modes; void *shareCtx; @@ -851,13 +927,11 @@ /* Setup a __GLcontextModes struct corresponding to vis->visualid * and create the rendering context. */ - config = __driFindGlxConfig(dpy, vis->screen, vis->visualid); - if (!config) + if (!findConfigMode(dpy, vis->screen, vis->visualid, &modes)) return NULL; - __glXFormatGLModes(&modes, config); shareCtx = pshare ? pshare->driverPrivate : NULL; - if (!(*psp->DriverAPI.CreateContext)(dpy, &modes, pcp, shareCtx)) { + if (!(*psp->DriverAPI.CreateContext)(&modes, pcp, shareCtx)) { (void)XF86DRIDestroyContext(dpy, vis->screen, pcp->contextID); Xfree(pcp); return NULL; @@ -866,14 +940,36 @@ pctx->destroyContext = driDestroyContext; pctx->bindContext = driBindContext; pctx->unbindContext = driUnbindContext; + if ( driCompareGLXAPIVersion( 20030606 ) >= 0 ) { + pctx->bindContext2 = driBindContext2; + pctx->unbindContext2 = driUnbindContext2; + } __driGarbageCollectDrawables(pcp->driScreenPriv->drawHash); return pcp; } +/*@}*/ + + +/*****************************************************************/ +/** \name Screen handling functions */ /*****************************************************************/ +/*@{*/ + +/** + * Destroy the per-screen private information. + * + * \param dpy the display handle. + * \param scrn the screen number. + * \param screenPrivate opaque pointer to the per-screen private information. + * + * \internal + * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls + * drmClose(), and finally frees \p screenPrivate. + */ static void driDestroyScreen(Display *dpy, int scrn, void *screenPrivate) { __DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate; @@ -915,7 +1011,7 @@ __DRIscreenPrivate * __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config, + int numConfigs, __GLXvisualConfig *configs, const struct __DriverAPIRec *driverAPI) { int directCapable; @@ -936,9 +1032,12 @@ if (!psp) { return NULL; } - psp->fullscreen = NULL; psp->display = dpy; psp->myNum = scrn; + psp->psc = psc; + + psp->numConfigs = numConfigs; + psp->configs = configs; if (!XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) { Xfree(psp); @@ -1011,6 +1110,20 @@ return NULL; } + /* + * Get the DRI X extension version. + */ + if (!XF86DRIQueryVersion(dpy, + &psp->driMajor, + &psp->driMinor, + &psp->driPatch)) { + fprintf(stderr, "libGL error: XF86DRIQueryVersion failed\n"); + (void)drmClose(psp->fd); + Xfree(psp); + (void)XF86DRICloseConnection(dpy, scrn); + return NULL; + } + /* install driver's callback functions */ memcpy(&psp->DriverAPI, driverAPI, sizeof(struct __DriverAPIRec)); @@ -1091,9 +1204,152 @@ psc->createContext = driCreateContext; psc->createDrawable = driCreateDrawable_dummy; psc->getDrawable = driGetDrawable; + if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) + psc->getMSC = driGetMSC; return psp; } +/** + * Compare the current GLX API version with a driver supplied required version. + * + * The minimum required version is compared with the API version exported by + * the \c __glXGetInternalVersion function (in libGL.so). + * + * \param required_version Minimum required internal GLX API version. + * \return A tri-value return, as from strcmp is returned. A value less + * than, equal to, or greater than zero will be returned if the + * internal GLX API version is less than, equal to, or greater + * than \c required_version. + * + * \sa __glXGetInternalVersion(). + */ +int driCompareGLXAPIVersion( GLuint required_version ) +{ + static GLuint api_ver = 0; + + + if ( api_ver == 0 ) { + PFNGLXGETINTERNALVERSIONPROC get_ver; + + get_ver = (PFNGLXGETINTERNALVERSIONPROC) + glXGetProcAddress( (const GLubyte *) "__glXGetInternalVersion" ); + api_ver = ( get_ver != NULL ) ? get_ver() : 1; + } + + + if ( api_ver > required_version ) { + return 1; + } + else if ( api_ver == required_version ) { + return 0; + } + + return -1; +} + + +static int +driQueryFrameTracking( Display * dpy, void * priv, + int64_t * sbc, int64_t * missedFrames, + float * lastMissedUsage, float * usage ) +{ + static PFNGLXGETUSTPROC get_ust; + __DRIswapInfo sInfo; + int status; + int64_t ust; + __DRIdrawablePrivate * dpriv = (__DRIdrawablePrivate *) priv; + + if ( get_ust == NULL ) { + get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); + } + + status = dpriv->driScreenPriv->DriverAPI.GetSwapInfo( dpriv, & sInfo ); + if ( status == 0 ) { + *sbc = sInfo.swap_count; + *missedFrames = sInfo.swap_missed_count; + *lastMissedUsage = sInfo.swap_missed_usage; + + (*get_ust)( & ust ); + *usage = driCalculateSwapUsage( dpriv, sInfo.swap_ust, ust ); + } + + return status; +} + + +/** + * Calculate amount of swap interval used between GLX buffer swaps. + * + * The usage value, on the range [0,max], is the fraction of total swap + * interval time used between GLX buffer swaps is calculated. + * + * \f$p = t_d / (i * t_r)\f$ + * + * Where \f$t_d\$f is the time since the last GLX buffer swap, \f$i\f$ is the + * swap interval (as set by \c glXSwapIntervalSGI), and \f$t_r\f$ time + * required for a single vertical refresh period (as returned by \c + * glXGetMscRateOML). + * + * See the documentation for the GLX_MESA_swap_frame_usage extension for more + * details. + * + * \param dPriv Pointer to the private drawable structure. + * \return If less than a single swap interval time period was required + * between GLX buffer swaps, a number greater than 0 and less than + * 1.0 is returned. If exactly one swap interval time period is + * required, 1.0 is returned, and if more than one is required then + * a number greater than 1.0 will be returned. + * + * \sa glXSwapIntervalSGI(), glXGetMscRateOML(). + */ +float +driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust, + int64_t current_ust ) +{ + static PFNGLXGETMSCRATEOMLPROC get_msc_rate = NULL; + int32_t n; + int32_t d; + int interval; + float usage = 1.0; + + + /* FIXME: Instead of caching the function, would it be possible to + * FIXME: cache the sync rate? + */ + if ( get_msc_rate == NULL ) { + get_msc_rate = (PFNGLXGETMSCRATEOMLPROC) + glXGetProcAddress( (const GLubyte *) "glXGetMscRateOML" ); + } + + if ( (get_msc_rate != NULL) + && get_msc_rate( dPriv->display, dPriv->draw, &n, &d ) ) { + interval = (dPriv->pdraw->swap_interval != 0) + ? dPriv->pdraw->swap_interval : 1; + + + /* We want to calculate + * (current_UST - last_swap_UST) / (interval * us_per_refresh). We get + * current_UST by calling __glXGetUST. last_swap_UST is stored in + * dPriv->swap_ust. interval has already been calculated. + * + * The only tricky part is us_per_refresh. us_per_refresh is + * 1000000 / MSC_rate. We know the MSC_rate is n / d. We can flip it + * around and say us_per_refresh = 1000000 * d / n. Since this goes in + * the denominator of the final calculation, we calculate + * (interval * 1000000 * d) and move n into the numerator. + */ + + usage = (current_ust - last_swap_ust); + usage *= n; + usage /= (interval * d); + usage /= 1000000.0; + } + + return usage; +} + +/*@}*/ + #endif Index: xc/lib/GL/dri/dri_util.h diff -u xc/lib/GL/dri/dri_util.h:1.1 xc/lib/GL/dri/dri_util.h:1.4 --- xc/lib/GL/dri/dri_util.h:1.1 Fri Feb 22 16:32:52 2002 +++ xc/lib/GL/dri/dri_util.h Fri Nov 14 17:44:26 2003 @@ -1,37 +1,51 @@ -/* $XFree86: xc/lib/GL/dri/dri_util.h,v 1.1 2002/02/22 21:32:52 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ +/* $XFree86: xc/lib/GL/dri/dri_util.h,v 1.4 2003/11/14 22:44:26 tsi Exp $ */ +/** + * \file dri_util.h + * DRI utility functions definitions. + * + * This module acts as glue between GLX and the actual hardware driver. A DRI + * driver doesn't really \e have to use any of this - it's optional. But, some + * useful stuff is done here that otherwise would have to be duplicated in most + * drivers. + * + * Basically, these utility functions take care of some of the dirty details of + * screen initialization, context creation, context binding, DRM setup, etc. + * + * These functions are compiled into each DRI driver so libGL.so knows nothing + * about them. + * + * \sa dri_util.c. + * + * \author Kevin E. Martin + * \author Brian Paul + */ /* - * Authors: - * Kevin E. Martin - * Brian Paul + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * 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, sub license, 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 (including the + * next paragraph) 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. */ + #ifndef _DRI_UTIL_H_ #define _DRI_UTIL_H_ @@ -39,35 +53,44 @@ #define CAPI /* XXX this should be globally defined somewhere */ -#include -#include "glxclient.h" -#include "xf86dri.h" -#include "sarea.h" -#include "GL/internal/glcore.h" +#include +#include "glxclient.h" /* for GLXDrawable */ +#include "xf86dri.h" /* for XF86DRIClipRectPtr */ +#include "sarea.h" /* for XF86DRISAREAPtr */ +#include "GL/internal/glcore.h" /* for __GLcontextModes */ typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate; typedef struct __DRIscreenPrivateRec __DRIscreenPrivate; typedef struct __DRIcontextPrivateRec __DRIcontextPrivate; typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate; +typedef struct __DRIswapInfoRec __DRIswapInfo; -#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(dpy, scrn, pDrawPriv) \ +/** + * Used by DRI_VALIDATE_DRAWABLE_INFO + */ +#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(pDrawPriv) \ do { \ if (*(pDrawPriv->pStamp) != pDrawPriv->lastStamp) { \ - __driUtilUpdateDrawableInfo(dpy, scrn, pDrawPriv); \ + __driUtilUpdateDrawableInfo(pDrawPriv); \ } \ } while (0) -#define DRI_VALIDATE_DRAWABLE_INFO(dpy, psp, pdp) \ +/** + * Utility macro to validate the drawable information. + * + * See __DRIdrawablePrivate::pStamp and __DRIdrawablePrivate::lastStamp. + */ +#define DRI_VALIDATE_DRAWABLE_INFO(psp, pdp) \ do { \ while (*(pdp->pStamp) != pdp->lastStamp) { \ DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, \ pdp->driContextPriv->hHWContext); \ \ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ - DRI_VALIDATE_DRAWABLE_INFO_ONCE(dpy, psp->myNum, pdp); \ + DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ \ DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, \ @@ -76,191 +99,366 @@ } while (0) +/** + * Driver callback functions. + * + * Each DRI driver must have one of these structures with all the pointers set + * to appropriate functions within the driver. + * + * When glXCreateContext() is called, for example, it'll call a helper function + * dri_util.c which in turn will jump through the \a CreateContext pointer in + * this structure. + */ struct __DriverAPIRec { + /** + * Driver initialization callback + */ GLboolean (*InitDriver)(__DRIscreenPrivate *driScrnPriv); + + /** + * Screen destruction callback + */ void (*DestroyScreen)(__DRIscreenPrivate *driScrnPriv); - GLboolean (*CreateContext)(Display *dpy, - const __GLcontextModes *glVis, + + /** + * Context creation callback + */ + GLboolean (*CreateContext)(const __GLcontextModes *glVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate); + + /** + * Context destruction callback + */ void (*DestroyContext)(__DRIcontextPrivate *driContextPriv); - GLboolean (*CreateBuffer)(Display *dpy, - __DRIscreenPrivate *driScrnPriv, + + /** + * Buffer (drawable) creation callback + */ + GLboolean (*CreateBuffer)(__DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *glVis, GLboolean pixmapBuffer); + + /** + * Buffer (drawable) destruction callback + */ void (*DestroyBuffer)(__DRIdrawablePrivate *driDrawPriv); - void (*SwapBuffers)(Display *dpy, void *drawablePrivate); + + /** + * Buffer swapping callback + */ + void (*SwapBuffers)(__DRIdrawablePrivate *driDrawPriv); + + /** + * Context activation callback + */ GLboolean (*MakeCurrent)(__DRIcontextPrivate *driContextPriv, __DRIdrawablePrivate *driDrawPriv, __DRIdrawablePrivate *driReadPriv); + + /** + * Context unbinding callback + */ GLboolean (*UnbindContext)(__DRIcontextPrivate *driContextPriv); + + /** + * Full screen mode opening callback. + * + * \deprecated Full screen functionality is no longer used by DRI. + * Drivers should simply install a function returning + * \c GL_TRUE for backwards compatability. + */ GLboolean (*OpenFullScreen)(__DRIcontextPrivate *driContextPriv); + + /** + * Full screen mode closing callback. + * + * \deprecated Full screen functionality is no longer used by DRI. + * Drivers should simply install a function returning + * \c GL_TRUE for backwards compatability. + */ GLboolean (*CloseFullScreen)(__DRIcontextPrivate *driContextPriv); + + /* Retrieves statistics about buffer swap operations. Required if + * GLX_OML_sync_control or GLX_MESA_swap_frame_usage is supported. + */ + int (*GetSwapInfo)( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); + + + /* Required if GLX_SGI_video_sync or GLX_OML_sync_control is + * supported. + */ + int (*GetMSC)( __DRIscreenPrivate * priv, int64_t * count ); + + /** + * These are required if GLX_OML_sync_control is supported. + */ + /*@{*/ + int (*WaitForMSC)( __DRIdrawablePrivate *priv, int64_t target_msc, + int64_t divisor, int64_t remainder, + int64_t * msc ); + int (*WaitForSBC)( __DRIdrawablePrivate *priv, int64_t target_sbc, + int64_t * msc, int64_t * sbc ); + + int64_t (*SwapBuffersMSC)( __DRIdrawablePrivate *priv, int64_t target_msc, + int64_t divisor, int64_t remainder ); + /*@}*/ +}; + + +struct __DRIswapInfoRec { + /** + * Number of swapBuffers operations that have been *completed*. + */ + u_int64_t swap_count; + + /* + * Unadjusted system time of the last buffer swap. This is the time + * when the swap completed, not the time when swapBuffers was called. + */ + int64_t swap_ust; + + /* + * Number of swap operations that occurred after the swap deadline. That + * is if a swap happens more than swap_interval frames after the previous + * swap, it has missed its deadline. If swap_interval is 0, then the + * swap deadline is 1 frame after the previous swap. + */ + u_int64_t swap_missed_count; + + /* + * Amount of time used by the last swap that missed its deadline. This + * is calculated as (__glXGetUST() - swap_ust) / (swap_interval * + * time_for_single_vrefresh)). If the actual value of swap_interval is + * 0, then 1 is used instead. If swap_missed_count is non-zero, this + * should be greater-than 1.0. + */ + float swap_missed_usage; }; +/** + * Per-drawable private DRI driver information. + */ struct __DRIdrawablePrivateRec { - /* - ** Kernel drawable handle (not currently used). - */ + /** + * Kernel drawable handle + */ drmDrawable hHWDrawable; - /* - ** Driver's private drawable information. This structure is opaque. - */ + /** + * Driver's private drawable information. + * + * This structure is opaque. + */ void *driverPrivate; - /* - ** X's drawable ID associated with this private drawable. - */ + /** + * X's drawable ID associated with this private drawable. + */ GLXDrawable draw; + __DRIdrawable *pdraw; - /* - ** Reference count for number of context's currently bound to this - ** drawable. Once the refcount reaches 0, the drawable can be - ** destroyed. This behavior will change with GLX 1.3. - */ + /** + * Reference count for number of context's currently bound to this + * drawable. + * + * Once it reaches zero, the drawable can be destroyed. + * + * \note This behavior will change with GLX 1.3. + */ int refcount; - /* - ** Index of this drawable's information in the SAREA. - */ + /** + * Index of this drawable information in the SAREA. + */ unsigned int index; - /* - ** Pointer to the "drawable has changed ID" stamp in the SAREA. - */ + /** + * Pointer to the "drawable has changed ID" stamp in the SAREA. + */ unsigned int *pStamp; - /* - ** Last value of the stamp. If this differs from the value stored - ** at *pStamp, then the drawable information has been modified by - ** the X server, and the drawable information (below) should be - ** retrieved from the X server. - */ + /** + * Last value of the stamp. + * + * If this differs from the value stored at __DRIdrawablePrivate::pStamp, + * then the drawable information has been modified by the X server, and the + * drawable information (below) should be retrieved from the X server. + */ unsigned int lastStamp; - /* - ** Drawable information used in software fallbacks. - */ + /** + * \name Drawable + * + * Drawable information used in software fallbacks. + */ + /*@{*/ int x; int y; int w; int h; int numClipRects; XF86DRIClipRectPtr pClipRects; + /*@}*/ - /* - ** Information about the back and depthbuffer where different - ** from above. - */ + /** + * \name Back and depthbuffer + * + * Information about the back and depthbuffer where different from above. + */ + /*@{*/ int backX; int backY; int backClipRectType; int numBackClipRects; XF86DRIClipRectPtr pBackClipRects; + /*@}*/ - /* - ** Pointer to context to which this drawable is currently bound. - */ + /** + * Pointer to context to which this drawable is currently bound. + */ __DRIcontextPrivate *driContextPriv; - /* - ** Pointer to screen on which this drawable was created. - */ + /** + * Pointer to screen on which this drawable was created. + */ __DRIscreenPrivate *driScreenPriv; + + /** + * \name Display and screen information. + * + * Basically just need these for when the locking code needs to call + * __driUtilUpdateDrawableInfo() which calls XF86DRIGetDrawableInfo(). + */ + /*@{*/ + Display *display; + int screen; + /*@}*/ + + /** + * Called via glXSwapBuffers(). + */ + void (*swapBuffers)( __DRIdrawablePrivate *dPriv ); }; +/** + * Per-context private driver information. + */ struct __DRIcontextPrivateRec { - /* - ** Kernel context handle used to access the device lock. - */ + /** + * Kernel context handle used to access the device lock. + */ XID contextID; - /* - ** Kernel context handle used to access the device lock. - */ + /** + * Kernel context handle used to access the device lock. + */ drmContext hHWContext; - /* - ** Device driver's private context data. This structure is opaque. - */ + /** + * Device driver's private context data. This structure is opaque. + */ void *driverPrivate; - /* - ** This context's display pointer. - */ + /** + * This context's display pointer. + */ Display *display; - /* - ** Pointer to drawable currently bound to this context. - */ + /** + * Pointer to drawable currently bound to this context. + */ __DRIdrawablePrivate *driDrawablePriv; - /* - ** Pointer to screen on which this context was created. - */ + /** + * Pointer to screen on which this context was created. + */ __DRIscreenPrivate *driScreenPriv; }; +/** + * Per-screen private driver information. + */ struct __DRIscreenPrivateRec { - /* - ** Display for this screen - */ + /** + * Display for this screen + */ Display *display; - /* - ** Current screen's number - */ + /** + * Current screen's number + */ int myNum; - /* - ** Callback functions into the hardware-specific DRI driver code. - */ + /** + * Callback functions into the hardware-specific DRI driver code. + */ struct __DriverAPIRec DriverAPI; - /* - ** DDX / 2D driver version information. - */ + /** + * \name DDX version + * DDX / 2D driver version information. + */ + /*@{*/ int ddxMajor; int ddxMinor; int ddxPatch; + /*@}*/ - /* - ** DRM version information. - */ + /** + * \name DRI version + * DRI X extension version information. + */ + /*@{*/ + int driMajor; + int driMinor; + int driPatch; + /*@}*/ + + /** + * \name DRM version + * DRM (kernel module) version information. + */ + /*@{*/ int drmMajor; int drmMinor; int drmPatch; + /*@}*/ - /* - ** ID used when the client sets the drawable lock. The X server - ** uses this value to detect if the client has died while holding - ** the drawable lock. - */ + /** + * ID used when the client sets the drawable lock. + * + * The X server uses this value to detect if the client has died while + * holding the drawable lock. + */ int drawLockID; - /* - ** File descriptor returned when the kernel device driver is opened. - ** It is used to: - ** - authenticate client to kernel - ** - map the frame buffer, SAREA, etc. - ** - close the kernel device driver - */ + /** + * File descriptor returned when the kernel device driver is opened. + * + * Used to: + * - authenticate client to kernel + * - map the frame buffer, SAREA, etc. + * - close the kernel device driver + */ int fd; - /* - ** SAREA pointer used to access: - ** - the device lock - ** - the device-independent per-drawable and per-context(?) information - */ + /** + * SAREA pointer + * + * Used to access: + * - the device lock + * - the device-independent per-drawable and per-context(?) information + */ XF86DRISAREAPtr pSAREA; - /* - ** Direct frame buffer access information used for software - ** fallbacks. - */ + /** + * \name Direct frame buffer access information + * Used for software fallbacks. + */ + /*@{*/ unsigned char *pFB; int fbSize; int fbOrigin; @@ -268,38 +466,57 @@ int fbWidth; int fbHeight; int fbBPP; + /*@}*/ - /* - ** Device-dependent private information (stored in the SAREA). This - ** data is accessed by the client driver only. - */ + /** + * \name Device-dependent private information (stored in the SAREA). + * + * This data is accessed by the client driver only. + */ + /*@{*/ void *pDevPriv; int devPrivSize; + /*@}*/ - /* - ** Dummy context to which drawables are bound when not bound to any - ** other context. A dummy hHWContext is created for this context, - ** and is used by the GL core when a HW lock is required but the - ** drawable is not currently bound (e.g., potentially during a - ** SwapBuffers request). The dummy context is created when the - ** first "real" context is created on this screen. - */ + /** + * Dummy context to which drawables are bound when not bound to any + * other context. + * + * A dummy hHWContext is created for this context, and is used by the GL + * core when a hardware lock is required but the drawable is not currently + * bound (e.g., potentially during a SwapBuffers request). The dummy + * context is created when the first "real" context is created on this + * screen. + */ __DRIcontextPrivate dummyContextPriv; - /* - ** Hash table to hold the drawable information for this screen. - */ + /** + * Hash table to hold the drawable information for this screen. + */ void *drawHash; - /* - ** Device-dependent private information (not stored in the SAREA). - ** This pointer is never touched by the DRI layer. - */ + /** + * Device-dependent private information (not stored in the SAREA). + * + * This pointer is never touched by the DRI layer. + */ void *private; - /* If we're in full screen mode (via DRIOpenFullScreen), this points - to the drawable that was bound. Otherwise, this is NULL. */ - __DRIdrawablePrivate *fullscreen; + /** + * \name Visuals + * + * Visuals (configs) in this screen. + */ + /*@{*/ + int numConfigs; /**< Number of visuals. */ + __GLXvisualConfig *configs; /**< Visuals list pointer. */ + /*@}*/ + + /** + * Pointer back to the \c __DRIscreen that contains this structure. + */ + + __DRIscreen *psc; }; @@ -309,24 +526,31 @@ extern void -__driUtilUpdateDrawableInfo(Display *dpy, int scrn, - __DRIdrawablePrivate *pdp); +__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp); + extern __DRIscreenPrivate * __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, int numConfigs, __GLXvisualConfig *config, const struct __DriverAPIRec *driverAPI); -/* This must be implemented in each driver */ +/** This must be implemented in each driver */ extern void * __driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, int numConfigs, __GLXvisualConfig *config); -/* This is optionally implemented in each driver */ +/** This is optionally implemented in each driver */ extern void __driRegisterExtensions( void ); +/* Test the version of the internal GLX API. Returns a value like strcmp. */ +extern int +driCompareGLXAPIVersion( GLuint required_version ); + +extern float +driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, + int64_t last_swap_ust, int64_t current_ust ); #endif /* GLX_DIRECT_RENDERING */ Index: xc/lib/GL/dri/xf86dri.h diff -u xc/lib/GL/dri/xf86dri.h:1.8 xc/lib/GL/dri/xf86dri.h:1.9 --- xc/lib/GL/dri/xf86dri.h:1.8 Wed Oct 30 07:51:25 2002 +++ xc/lib/GL/dri/xf86dri.h Mon Nov 17 17:20:05 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.8 2002/10/30 12:51:25 alanh Exp $ */ +/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.9 2003/11/17 22:20:05 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -76,102 +76,79 @@ _XFUNCPROTOBEGIN Bool XF86DRIQueryExtension( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* event_base */, int* /* error_base */ -#endif ); Bool XF86DRIQueryVersion( -#if NeedFunctionPrototypes Display* /* dpy */, int* /* majorVersion */, int* /* minorVersion */, int* /* patchVersion */ -#endif ); Bool XF86DRIQueryDirectRenderingCapable( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, Bool* /* isCapable */ -#endif ); Bool XF86DRIOpenConnection( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, drmHandlePtr /* hSAREA */, char** /* busIDString */ -#endif ); Bool XF86DRIAuthConnection( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, drmMagic /* magic */ -#endif ); Bool XF86DRICloseConnection( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */ -#endif ); Bool XF86DRIGetClientDriverName( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, int* /* ddxDriverMajorVersion */, int* /* ddxDriverMinorVersion */, int* /* ddxDriverPatchVersion */, char** /* clientDriverName */ -#endif ); Bool XF86DRICreateContext( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, Visual* /* visual */, XID* /* ptr to returned context id */, drmContextPtr /* hHWContext */ -#endif ); Bool XF86DRIDestroyContext( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, XID /* context id */ -#endif ); Bool XF86DRICreateDrawable( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, Drawable /* drawable */, drmDrawablePtr /* hHWDrawable */ -#endif ); Bool XF86DRIDestroyDrawable( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, Drawable /* drawable */ -#endif ); Bool XF86DRIGetDrawableInfo( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, Drawable /* drawable */, @@ -187,11 +164,9 @@ int* /* backY */, int* /* numBackClipRects */, XF86DRIClipRectPtr* /* pBackClipRects */ -#endif ); Bool XF86DRIGetDeviceInfo( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, drmHandlePtr /* hFrameBuffer */, @@ -200,23 +175,18 @@ int* /* fbStride */, int* /* devPrivateSize */, void** /* pDevPrivate */ -#endif ); Bool XF86DRIOpenFullScreen( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, Drawable /* drawable */ -#endif ); Bool XF86DRICloseFullScreen( -#if NeedFunctionPrototypes Display* /* dpy */, int /* screen */, Drawable /* drawable */ -#endif ); _XFUNCPROTOEND Index: xc/lib/GL/dri/drm/Imakefile diff -u xc/lib/GL/dri/drm/Imakefile:1.20 xc/lib/GL/dri/drm/Imakefile:1.23 --- xc/lib/GL/dri/drm/Imakefile:1.20 Wed Oct 30 07:51:25 2002 +++ xc/lib/GL/dri/drm/Imakefile Tue Dec 2 08:02:37 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/dri/drm/Imakefile,v 1.20 2002/10/30 12:51:25 alanh Exp $ +XCOMM $XFree86: xc/lib/GL/dri/drm/Imakefile,v 1.23 2003/12/02 13:02:37 alanh Exp $ #if GlxUseBuiltInDRIDriver #define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) @@ -30,10 +30,13 @@ #if defined(LinuxArchitecture) OS_SUBDIR = linux OS_SUBDIR2 = linux +OS_SUBDIR3 = shared #endif -#if defined(FreeBSDArchitecture) || defined(BSDOSArchitecture) +#if defined(FreeBSDArchitecture) || defined(BSDOSArchitecture) || \ + defined(NetBSDArchitecture) || defined(OpenBSDArchitecture) OS_SUBDIR = bsd OS_SUBDIR2 = linux +OS_SUBDIR3 = shared #endif LinkSourceFile(xf86drm.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm) @@ -42,7 +45,7 @@ LinkSourceFile(xf86drmRandom.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm) LinkSourceFile(xf86drmSL.c,$(XF86OSSRC)/$(OS_SUBDIR2)/drm) -LinkSourceFile(drm.h,$(XF86OSSRC)/$(OS_SUBDIR2)/drm/kernel) +LinkSourceFile(drm.h,$(XF86OSSRC)/$(OS_SUBDIR3)/drm/kernel) #include Index: xc/lib/GL/glx/Imakefile diff -u xc/lib/GL/glx/Imakefile:1.18 xc/lib/GL/glx/Imakefile:1.23 --- xc/lib/GL/glx/Imakefile:1.18 Mon Nov 25 09:04:49 2002 +++ xc/lib/GL/glx/Imakefile Sun Nov 16 22:10:42 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/glx/Imakefile,v 1.18 2002/11/25 14:04:49 eich Exp $ +XCOMM $XFree86: xc/lib/GL/glx/Imakefile,v 1.23 2003/11/17 03:10:42 dawes Exp $ XCOMM The contents of this file are subject to the GLX Public License Version 1.0 XCOMM (the "License"). You may not use this file except in compliance with the XCOMM License. You may obtain a copy of the License at Silicon Graphics, Inc., @@ -35,10 +35,10 @@ LinkSourceFile(glapi.c, $(MESASRCDIR)/src) LinkSourceFile(glthread.c, $(MESASRCDIR)/src) -#ifdef i386Architecture +#if defined(i386Architecture) LinkSourceFile(glapi_x86.S, $(MESASRCDIR)/src/X86) #endif -#ifdef SparcArchitecture +#if defined(SparcArchitecture) && !defined(OpenBSDArchitecture) LinkSourceFile(glapi_sparc.S, $(MESASRCDIR)/src/SPARC) #endif @@ -58,6 +58,8 @@ glthread.c \ glxcmds.c \ glxext.c \ + glxextensions.c \ + glcontextmodes.c \ indirect_init.c \ pixel.c \ pixelstore.c \ @@ -80,6 +82,8 @@ glthread.o \ glxcmds.o \ glxext.o \ + glxextensions.o \ + glcontextmodes.o \ indirect_init.o \ pixel.o \ pixelstore.o \ @@ -90,7 +94,7 @@ vertarr.o \ xfont.o - GLX_DEFS = GlxDefines + GLX_DEFS = GlxDefines VidModeExtensionDefines #ifdef i386Architecture ASM_DIR = X86 @@ -117,9 +121,13 @@ #endif #endif +#if defined(DarwinArchitecture) || defined(OS2Architecture) + ALIAS_DEFINES = -DGLX_ALIAS_UNSUPPORTED +#endif + SRCS = $(GLX_SRCS) $(ASM_SRCS) OBJS = $(GLX_OBJS) $(ASM_OBJS) - DEFINES = $(GLX_DEFS) $(ASM_DEFS) $(XMESA_DEFINES) + DEFINES = $(GLX_DEFS) $(ASM_DEFS) $(XMESA_DEFINES) $(ALIAS_DEFINES) INCLUDES = -I$(INCLUDESRC) \ -I$(XINCLUDESRC) \ @@ -137,7 +145,7 @@ LibraryObjectRule() -#if BuildXF86DRI && defined(i386Architecture) +#if BuildXF86DRI && defined(i386Architecture) && MesaUseX86Asm ObjectFromAsmSource(glapi_x86, NullParameter) #endif #if BuildXF86DRI && defined(SparcArchitecture) Index: xc/lib/GL/glx/clientattrib.c diff -u xc/lib/GL/glx/clientattrib.c:1.5 xc/lib/GL/glx/clientattrib.c:1.6 --- xc/lib/GL/glx/clientattrib.c:1.5 Wed Mar 21 11:04:39 2001 +++ xc/lib/GL/glx/clientattrib.c Wed Jan 28 13:11:38 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/clientattrib.c,v 1.5 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/clientattrib.c,v 1.6 2004/01/28 18:11:38 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -43,25 +43,32 @@ void glEnableClientState(GLenum array) { __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); switch (array) { case GL_COLOR_ARRAY: - gc->state.vertArray.color.enable = GL_TRUE; + state->vertArray.color.enable = GL_TRUE; break; case GL_EDGE_FLAG_ARRAY: - gc->state.vertArray.edgeFlag.enable = GL_TRUE; + state->vertArray.edgeFlag.enable = GL_TRUE; break; case GL_INDEX_ARRAY: - gc->state.vertArray.index.enable = GL_TRUE; + state->vertArray.index.enable = GL_TRUE; break; case GL_NORMAL_ARRAY: - gc->state.vertArray.normal.enable = GL_TRUE; + state->vertArray.normal.enable = GL_TRUE; break; case GL_TEXTURE_COORD_ARRAY: - gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable = GL_TRUE; + state->vertArray.texCoord[state->vertArray.activeTexture].enable = GL_TRUE; break; case GL_VERTEX_ARRAY: - gc->state.vertArray.vertex.enable = GL_TRUE; + state->vertArray.vertex.enable = GL_TRUE; + break; + case GL_SECONDARY_COLOR_ARRAY: + state->vertArray.secondaryColor.enable = GL_TRUE; + break; + case GL_FOG_COORDINATE_ARRAY: + state->vertArray.fogCoord.enable = GL_TRUE; break; default: __glXSetError(gc, GL_INVALID_ENUM); @@ -71,25 +78,32 @@ void glDisableClientState(GLenum array) { __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); switch (array) { case GL_COLOR_ARRAY: - gc->state.vertArray.color.enable = GL_FALSE; + state->vertArray.color.enable = GL_FALSE; break; case GL_EDGE_FLAG_ARRAY: - gc->state.vertArray.edgeFlag.enable = GL_FALSE; + state->vertArray.edgeFlag.enable = GL_FALSE; break; case GL_INDEX_ARRAY: - gc->state.vertArray.index.enable = GL_FALSE; + state->vertArray.index.enable = GL_FALSE; break; case GL_NORMAL_ARRAY: - gc->state.vertArray.normal.enable = GL_FALSE; + state->vertArray.normal.enable = GL_FALSE; break; case GL_TEXTURE_COORD_ARRAY: - gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable = GL_FALSE; + state->vertArray.texCoord[state->vertArray.activeTexture].enable = GL_FALSE; break; case GL_VERTEX_ARRAY: - gc->state.vertArray.vertex.enable = GL_FALSE; + state->vertArray.vertex.enable = GL_FALSE; + break; + case GL_SECONDARY_COLOR_ARRAY: + state->vertArray.secondaryColor.enable = GL_FALSE; + break; + case GL_FOG_COORDINATE_ARRAY: + state->vertArray.fogCoord.enable = GL_FALSE; break; default: __glXSetError(gc, GL_INVALID_ENUM); @@ -101,6 +115,7 @@ void glPushClientAttrib(GLuint mask) { __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); __GLXattribute **spp = gc->attributes.stackPointer, *sp; if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) { @@ -111,11 +126,11 @@ sp->mask = mask; gc->attributes.stackPointer = spp + 1; if (mask & GL_CLIENT_PIXEL_STORE_BIT) { - sp->storePack = gc->state.storePack; - sp->storeUnpack = gc->state.storeUnpack; + sp->storePack = state->storePack; + sp->storeUnpack = state->storeUnpack; } if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) { - sp->vertArray = gc->state.vertArray; + sp->vertArray = state->vertArray; } } else { __glXSetError(gc, GL_STACK_OVERFLOW); @@ -126,6 +141,7 @@ void glPopClientAttrib(void) { __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); __GLXattribute **spp = gc->attributes.stackPointer, *sp; GLuint mask; @@ -137,11 +153,11 @@ gc->attributes.stackPointer = spp; if (mask & GL_CLIENT_PIXEL_STORE_BIT) { - gc->state.storePack = sp->storePack; - gc->state.storeUnpack = sp->storeUnpack; + state->storePack = sp->storePack; + state->storeUnpack = sp->storeUnpack; } if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) { - gc->state.vertArray = sp->vertArray; + state->vertArray = sp->vertArray; } sp->mask = 0; Index: xc/lib/GL/glx/compsize.c diff -u xc/lib/GL/glx/compsize.c:1.4 xc/lib/GL/glx/compsize.c:1.7 --- xc/lib/GL/glx/compsize.c:1.4 Fri Feb 22 16:32:52 2002 +++ xc/lib/GL/glx/compsize.c Wed Jan 28 16:18:48 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/compsize.c,v 1.4 2002/02/22 21:32:52 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/compsize.c,v 1.7 2004/01/28 21:18:48 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -35,9 +35,143 @@ */ #include - +#include "glxclient.h" #include "size.h" +/* +** Return the number of elements per group of a specified format +*/ +GLint __glElementsPerGroup(GLenum format, GLenum type) +{ + /* + ** To make row length computation valid for image extraction, + ** packed pixel types assume elements per group equals one. + */ + switch(type) { + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_8_8_APPLE: + case GL_UNSIGNED_SHORT_8_8_REV_APPLE: + case GL_UNSIGNED_SHORT_15_1_MESA: + case GL_UNSIGNED_SHORT_1_15_REV_MESA: + case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_2_10_10_10_REV: + case GL_UNSIGNED_INT_24_8_NV: + case GL_UNSIGNED_INT_24_8_MESA: + case GL_UNSIGNED_INT_8_24_REV_MESA: + return 1; + default: + break; + } + + switch(format) { + case GL_RGB: + case GL_BGR: + return 3; + case GL_422_EXT: + case GL_422_REV_EXT: + case GL_422_AVERAGE_EXT: + case GL_422_REV_AVERAGE_EXT: + case GL_YCBCR_422_APPLE: + case GL_LUMINANCE_ALPHA: + return 2; + case GL_RGBA: + case GL_BGRA: + case GL_ABGR_EXT: + return 4; + case GL_COLOR_INDEX: + case GL_STENCIL_INDEX: + case GL_DEPTH_COMPONENT: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_INTENSITY: + return 1; + default: + return 0; + } +} + +/* +** Return the number of bytes per element, based on the element type (other +** than GL_BITMAP). +*/ +GLint __glBytesPerElement(GLenum type) +{ + switch(type) { + case GL_UNSIGNED_SHORT: + case GL_SHORT: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_8_8_APPLE: + case GL_UNSIGNED_SHORT_8_8_REV_APPLE: + case GL_UNSIGNED_SHORT_15_1_MESA: + case GL_UNSIGNED_SHORT_1_15_REV_MESA: + return 2; + case GL_UNSIGNED_BYTE: + case GL_BYTE: + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + return 1; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_2_10_10_10_REV: + case GL_UNSIGNED_INT_24_8_NV: + case GL_UNSIGNED_INT_24_8_MESA: + case GL_UNSIGNED_INT_8_24_REV_MESA: + return 4; + default: + return 0; + } +} + +/* +** Compute memory required for internal packed array of data of given type +** and format. +*/ +GLint __glImageSize(GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type) +{ + int bytes_per_row; + int components; + + if (width < 0 || height < 0 || depth < 0) { + return 0; + } + /* + ** Zero is returned if either format or type are invalid. + */ + components = __glElementsPerGroup(format,type); + if (type == GL_BITMAP) { + if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) { + bytes_per_row = (width + 7) >> 3; + } else { + return 0; + } + } else { + bytes_per_row = __glBytesPerElement(type) * width; + } + return bytes_per_row * height * depth * components; +} + GLint __glFogiv_size(GLenum pname) { switch (pname) { @@ -47,6 +181,8 @@ case GL_FOG_MODE: return 1; case GL_FOG_INDEX: return 1; case GL_FOG_START: return 1; + case GL_FOG_DISTANCE_MODE_NV: return 1; + case GL_FOG_OFFSET_VALUE_SGIX: return 1; default: return 0; } @@ -81,82 +217,7 @@ GLint __glDrawPixels_size(GLenum format, GLenum type, GLsizei w, GLsizei h) { - GLint elements, esize; - - switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - elements = 1; - break; - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - elements = 1; - break; - case GL_LUMINANCE_ALPHA: - elements = 2; - break; - case GL_RGB: - case GL_BGR: - elements = 3; - break; - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - elements = 4; - break; - default: - return 0; - } - switch (type) { - case GL_BITMAP: - if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) { - return (h * ((w+7)/8)); - } else { - return 0; - } - case GL_BYTE: - case GL_UNSIGNED_BYTE: - esize = 1; - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - esize = 1; - elements = 1; - break; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - esize = 2; - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - esize = 2; - elements = 1; - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - esize = 4; - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - esize = 4; - elements = 1; - break; - default: - return 0; - } - return (elements * esize * w * h); + return __glImageSize( w, h, 1, format, type ); } GLint __glBitmap_size(GLsizei w, GLsizei h) @@ -195,16 +256,64 @@ case GL_TEXTURE_WRAP_R: case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: - return 1; - case GL_TEXTURE_BORDER_COLOR: - return 4; case GL_TEXTURE_PRIORITY: - return 1; + case GL_TEXTURE_RESIDENT: + + /* GL_SGIS_texture_lod / GL_EXT_texture_lod / GL 1.2 */ case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: case GL_TEXTURE_BASE_LEVEL: case GL_TEXTURE_MAX_LEVEL: - return 1; + + /* GL_SGIX_texture_lod_bias */ + case GL_TEXTURE_LOD_BIAS_S_SGIX: + case GL_TEXTURE_LOD_BIAS_T_SGIX: + case GL_TEXTURE_LOD_BIAS_R_SGIX: + + /* GL_ARB_shadow / GL 1.4 */ + case GL_TEXTURE_COMPARE_MODE: + case GL_TEXTURE_COMPARE_FUNC: + + /* GL_SGIS_generate_mipmap / GL 1.4 */ + case GL_GENERATE_MIPMAP: + + /* GL_ARB_depth_texture / GL 1.4 */ + case GL_DEPTH_TEXTURE_MODE: + + /* GL_EXT_texture_lod_bias / GL 1.4 */ + case GL_TEXTURE_LOD_BIAS: + + /* GL_SGIX_shadow_ambient / GL_ARB_shadow_ambient */ + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + + /* GL_SGIX_shadow */ + case GL_TEXTURE_COMPARE_SGIX: + case GL_TEXTURE_COMPARE_OPERATOR_SGIX: + + /* GL_SGIX_texture_coordinate_clamp */ + case GL_TEXTURE_MAX_CLAMP_S_SGIX: + case GL_TEXTURE_MAX_CLAMP_T_SGIX: + case GL_TEXTURE_MAX_CLAMP_R_SGIX: + + /* GL_EXT_texture_filter_anisotropic */ + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + + /* GL_SGIX_clipmap */ + case GL_TEXTURE_CLIPMAP_CENTER_SGIX: + case GL_TEXTURE_CLIPMAP_OFFSET_SGIX: + return 2; + + /* GL_SGIX_clipmap */ + case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX: + return 3; + + case GL_TEXTURE_BORDER_COLOR: + + /* GL_SGIX_texture_scale_bias */ + case GL_POST_TEXTURE_FILTER_BIAS_SGIX: + case GL_POST_TEXTURE_FILTER_SCALE_SGIX: + return 4; + default: return 0; } @@ -219,29 +328,41 @@ { switch (e) { case GL_TEXTURE_ENV_MODE: - return 1; - case GL_TEXTURE_ENV_COLOR: - return 4; - /* GL_EXT_texture_env_combine */ - case GL_COMBINE_RGB_EXT: - case GL_COMBINE_ALPHA_EXT: - case GL_SOURCE0_RGB_EXT: - case GL_SOURCE1_RGB_EXT: - case GL_SOURCE2_RGB_EXT: - case GL_SOURCE0_ALPHA_EXT: - case GL_SOURCE1_ALPHA_EXT: - case GL_SOURCE2_ALPHA_EXT: - case GL_OPERAND0_RGB_EXT: - case GL_OPERAND1_RGB_EXT: - case GL_OPERAND0_ALPHA_EXT: - case GL_OPERAND1_ALPHA_EXT: - case GL_OPERAND2_RGB_EXT: - case GL_OPERAND2_ALPHA_EXT: - case GL_RGB_SCALE_EXT: + + /* GL_ARB_texture_env_combine / GL_EXT_texture_env_combine / GL 1.3 */ + case GL_COMBINE_RGB: + case GL_COMBINE_ALPHA: + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_RGB: + case GL_OPERAND2_ALPHA: + case GL_RGB_SCALE: case GL_ALPHA_SCALE: - /* GL_EXT_texture_lod */ - case GL_TEXTURE_LOD_BIAS_EXT: + + /* GL_EXT_texture_lod_bias / GL 1.4 */ + case GL_TEXTURE_LOD_BIAS: + + /* GL_ARB_point_sprite / GL_NV_point_sprite */ + case GL_COORD_REPLACE_NV: + + /* GL_NV_texture_env_combine4 */ + case GL_SOURCE3_RGB_NV: + case GL_SOURCE3_ALPHA_NV: + case GL_OPERAND3_RGB_NV: + case GL_OPERAND3_ALPHA_NV: return 1; + + case GL_TEXTURE_ENV_COLOR: + return 4; + default: return 0; } @@ -254,243 +375,18 @@ GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w) { - GLint elements, esize; - - if (w < 0) return 0; - switch (format) { - case GL_COLOR_INDEX: - elements = 1; - break; - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - elements = 1; - break; - case GL_LUMINANCE_ALPHA: - elements = 2; - break; - case GL_RGB: - case GL_BGR: - elements = 3; - break; - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - elements = 4; - break; - default: - return 0; - } - switch (type) { - case GL_BITMAP: - if (format == GL_COLOR_INDEX) { - return (w+7)/8; - } else { - return 0; - } - case GL_BYTE: - case GL_UNSIGNED_BYTE: - esize = 1; - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - esize = 1; - elements = 1; - break; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - esize = 2; - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - esize = 2; - elements = 1; - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - esize = 4; - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - esize = 4; - elements = 1; - break; - default: - return 0; - } - return (elements * esize * w); + return __glImageSize( w, 1, 1, format, type ); } GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h) { - GLint elements, esize; - - if (w < 0) return 0; - if (h < 0) return 0; - switch (format) { - case GL_COLOR_INDEX: - elements = 1; - break; - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - elements = 1; - break; - case GL_LUMINANCE_ALPHA: - elements = 2; - break; - case GL_RGB: - case GL_BGR: - elements = 3; - break; - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - elements = 4; - break; - default: - return 0; - } - switch (type) { - case GL_BITMAP: - if (format == GL_COLOR_INDEX) { - return (h * ((w+7)/8)); - } else { - return 0; - } - case GL_BYTE: - case GL_UNSIGNED_BYTE: - esize = 1; - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - esize = 1; - elements = 1; - break; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - esize = 2; - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - esize = 2; - elements = 1; - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - esize = 4; - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - esize = 4; - elements = 1; - break; - default: - return 0; - } - return (elements * esize * w * h); + return __glImageSize( w, h, 1, format, type ); } GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h, GLsizei d) { - GLint elements, esize; - - if (w < 0) return 0; - if (h < 0) return 0; - if (d < 0) return 0; - switch (format) { - case GL_COLOR_INDEX: - elements = 1; - break; - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - elements = 1; - break; - case GL_LUMINANCE_ALPHA: - elements = 2; - break; - case GL_RGB: - case GL_BGR: - elements = 3; - break; - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - elements = 4; - break; - default: - return 0; - } - switch (type) { - case GL_BITMAP: - if (format == GL_COLOR_INDEX) { - return (d * (h * ((w+7)/8))); - } else { - return 0; - } - case GL_BYTE: - case GL_UNSIGNED_BYTE: - esize = 1; - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - esize = 1; - elements = 1; - break; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - esize = 2; - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - esize = 2; - elements = 1; - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - esize = 4; - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - esize = 4; - elements = 1; - break; - default: - return 0; - } - return (elements * esize * w * h * d); + return __glImageSize( w, h, d, format, type ); } GLint __glLightfv_size(GLenum pname) @@ -596,3 +492,27 @@ { return __glConvolutionParameterfv_size(pname); } + +GLint __glPointParameterfvARB_size(GLenum e) +{ + switch (e) { + case GL_POINT_SIZE_MIN: + case GL_POINT_SIZE_MAX: + case GL_POINT_FADE_THRESHOLD_SIZE: + + /* GL_NV_point_sprite */ + case GL_POINT_SPRITE_R_MODE_NV: + return 1; + + case GL_POINT_DISTANCE_ATTENUATION: + return 3; + + default: + return -1; + } +} + +GLint __glPointParameteriv_size(GLenum e) +{ + return __glPointParameterfvARB_size(e); +} Index: xc/lib/GL/glx/dispatch.c diff -u xc/lib/GL/glx/dispatch.c:1.4 xc/lib/GL/glx/dispatch.c:1.5 --- xc/lib/GL/glx/dispatch.c:1.4 Fri Feb 22 16:32:53 2002 +++ xc/lib/GL/glx/dispatch.c Sun Jun 29 21:45:10 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/dispatch.c,v 1.4 2002/02/22 21:32:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/dispatch.c,v 1.5 2003/06/30 01:45:10 torrey Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -32,6 +32,8 @@ * */ +#ifndef GLX_USE_APPLEGL + #include #include "glapi.h" #include "glapitable.h" @@ -67,3 +69,5 @@ #include "glapitemp.h" #endif /* USE_X86_ASM */ + +#endif /* !GLX_USE_APPLEGL */ Index: xc/lib/GL/glx/g_render.c diff -u xc/lib/GL/glx/g_render.c:1.4 xc/lib/GL/glx/g_render.c:1.9 --- xc/lib/GL/glx/g_render.c:1.4 Fri Feb 22 16:32:53 2002 +++ xc/lib/GL/glx/g_render.c Sun Feb 1 19:01:18 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/g_render.c,v 1.4 2002/02/22 21:32:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/g_render.c,v 1.9 2004/02/02 00:01:18 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -29,6 +29,191 @@ */ #include "packrender.h" +#include "size.h" + +#define GLdouble_SIZE 8 +#define GLclampd_SIZE 8 +#define GLfloat_SIZE 4 +#define GLclampf_SIZE 4 +#define GLint_SIZE 4 +#define GLuint_SIZE 4 +#define GLenum_SIZE 4 +#define GLbitfield_SIZE 4 +#define GLshort_SIZE 2 +#define GLushort_SIZE 2 +#define GLbyte_SIZE 1 +#define GLubyte_SIZE 1 +#define GLboolean_SIZE 1 + +#define __GLX_PUT_GLdouble(offset,value) __GLX_PUT_DOUBLE(offset,value) +#define __GLX_PUT_GLclampd(offset,value) __GLX_PUT_DOUBLE(offset,value) +#define __GLX_PUT_GLfloat(offset,value) __GLX_PUT_FLOAT(offset,value) +#define __GLX_PUT_GLclampf(offset,value) __GLX_PUT_FLOAT(offset,value) +#define __GLX_PUT_GLint(offset,value) __GLX_PUT_LONG(offset,value) +#define __GLX_PUT_GLuint(offset,value) __GLX_PUT_LONG(offset,value) +#define __GLX_PUT_GLenum(offset,value) __GLX_PUT_LONG(offset,value) +#define __GLX_PUT_GLbitfield(offset,value) __GLX_PUT_LONG(offset,value) +#define __GLX_PUT_GLshort(offset,value) __GLX_PUT_SHORT(offset,value) +#define __GLX_PUT_GLushort(offset,value) __GLX_PUT_SHORT(offset,value) +#define __GLX_PUT_GLbyte(offset,value) __GLX_PUT_CHAR(offset,value) +#define __GLX_PUT_GLubyte(offset,value) __GLX_PUT_CHAR(offset,value) +#define __GLX_PUT_GLboolean(offset,value) __GLX_PUT_CHAR(offset,value) + +#define __GLX_PUT_GLdouble_ARRAY(offset,ptr,count) __GLX_PUT_DOUBLE_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLclampd_ARRAY(offset,ptr,count) __GLX_PUT_DOUBLE_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLfloat_ARRAY(offset,ptr,count) __GLX_PUT_FLOAT_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLclampf_ARRAY(offset,ptr,count) __GLX_PUT_FLOAT_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLint_ARRAY(offset,ptr,count) __GLX_PUT_LONG_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLuint_ARRAY(offset,ptr,count) __GLX_PUT_LONG_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLenum_ARRAY(offset,ptr,count) __GLX_PUT_LONG_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLshort_ARRAY(offset,ptr,count) __GLX_PUT_SHORT_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLushort_ARRAY(offset,ptr,count) __GLX_PUT_SHORT_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLbyte_ARRAY(offset,ptr,count) __GLX_PUT_CHAR_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLubyte_ARRAY(offset,ptr,count) __GLX_PUT_CHAR_ARRAY(offset,ptr,count) +#define __GLX_PUT_GLboolean_ARRAY(offset,ptr,count) __GLX_PUT_CHAR_ARRAY(offset,ptr,count) + +#define RENDER_SIZE(t,c) (__GLX_PAD(4 + (t ## _SIZE * c))) + +/* GLX protocol templates are named in the following manner. All templates + * begin with the string 'glxproto_'. Following is an optional list of + * scalar parameters. The scalars are listed as type and number. The most + * common being \c enum1 (one scalar enum) and \c enum2 (two scalar enums). + * + * The final part of the name describes the number of named-type parameters + * and how they are passed. + * - One or more digits followed by the letter s means + * that the specified number of parameters are passed as scalars. The macro + * \c glxproto_3s generates a function that takes 3 scalars, such as + * \c glVertex3f. + * - A capital C follwed by a lower-case v means that a constant + * sized vector is passed. Macros of this type take an extra parameter, + * which is the size of the vector. The invocation + * 'glxproto_Cv(Vertex3fv, X_GLrop_Vertexfv, GLfloat, 3)' would generate the + * correct protocol for the \c glVertex3fv function. + * - A capital V followed by a lower-case v means that a variable sized + * vector is passed. The function generated by these macros will call + * a co-function to determine the size of the vector. The name of the + * co-function is generated by prepending \c __gl and appending \c _size + * to the base name of the function. The invocation + * 'glxproto_enum1_Vv(Fogiv, X_GLrop_Fogiv, GLint)' would generate the + * correct protocol for the \c glFogiv function. + * - One or more digits without a following letter means that a function + * taking the specified number of scalar parameters and a function with a + * vector parameter of the specified size should be generated. The letter + * v is automatically appended to the name of the vector-based function in + * this case. The invocation + * 'glxproto_3(Vertex3f, X_GLrop_Vertex3fv, GLfloat)' would generate the + * correct protocol for both \c glVertex3f and \c glVertex3fv. + * + * glxproto_void is a special case for functions that take no parameters + * (i.e., glEnd). + * + * An addition form is 'glxvendr_'. This is identical to the other forms + * with the exception of taking an additional parameter (to the macro) which + * is a vendor string to append to the function name. The invocation + * 'glxproto_3(Foo3f, X_GLrop_Foo3fv, GLfloat)' would generate the functions + * 'glFoo3fv' and 'glFoo3f', and the invocation + * 'glxvendr_3(Foo3f, X_GLrop_Foo3fv, GLfloat, EXT)' would generate the + * functions 'glFoo3fvEXT' and 'glFoo3fEXT'. + */ + +#define glxproto_Cv(name, rop, type, count) \ + void __indirect_gl ## name (const type * v) \ + { \ + __GLX_DECLARE_VARIABLES(); \ + __GLX_LOAD_VARIABLES(); \ + cmdlen = RENDER_SIZE(type, count); \ + __GLX_BEGIN(rop, cmdlen); \ + if (count <= 4) { \ + __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v[0]); \ + if (count > 1) { __GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v[1]); } \ + if (count > 2) { __GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v[2]); } \ + if (count > 3) { __GLX_PUT_ ## type (4 + (3 * type ## _SIZE), v[3]); } \ + } else { \ + __GLX_PUT_ ## type ## _ARRAY(4, v, count); \ + } \ + __GLX_END(cmdlen); \ + } + +#define glxproto_1s(name, rop, type) \ + void __indirect_gl ## name (type v1) \ + { \ + __GLX_DECLARE_VARIABLES(); \ + __GLX_LOAD_VARIABLES(); \ + cmdlen = RENDER_SIZE(type, 1); \ + __GLX_BEGIN(rop, cmdlen); \ + __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \ + __GLX_END(cmdlen); \ + } + +#define glxproto_3s(name, rop, type) \ + void __indirect_gl ## name (type v1, type v2, type v3) \ + { \ + __GLX_DECLARE_VARIABLES(); \ + __GLX_LOAD_VARIABLES(); \ + cmdlen = RENDER_SIZE(type, 3); \ + __GLX_BEGIN(rop, cmdlen); \ + __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \ + __GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \ + __GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v3); \ + __GLX_END(cmdlen); \ + } + +#define glxproto_4s(name, rop, type) \ + void __indirect_gl ## name (type v1, type v2, type v3, type v4) \ + { \ + __GLX_DECLARE_VARIABLES(); \ + __GLX_LOAD_VARIABLES(); \ + cmdlen = RENDER_SIZE(type, 4); \ + __GLX_BEGIN(rop, cmdlen); \ + __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \ + __GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \ + __GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v3); \ + __GLX_PUT_ ## type (4 + (3 * type ## _SIZE), v4); \ + __GLX_END(cmdlen); \ + } + +#define glxproto_enum1_1s(name, rop, type) \ + void __indirect_gl ## name (GLenum e, type v1) \ + { \ + __GLX_DECLARE_VARIABLES(); \ + __GLX_LOAD_VARIABLES(); \ + cmdlen = 4 + RENDER_SIZE(type, 1); \ + __GLX_BEGIN(rop, cmdlen); \ + if (type ## _SIZE == 8) { \ + __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \ + __GLX_PUT_LONG (4 + (1 * type ## _SIZE), e); \ + } else { \ + __GLX_PUT_LONG(4, e); \ + __GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v1); \ + } \ + __GLX_END(cmdlen); \ + } + +#define glxproto_enum1_Vv(name, rop, type) \ + void __indirect_gl ## name (GLenum pname, const type * v) \ + { \ + __GLX_DECLARE_VARIABLES(); \ + __GLX_LOAD_VARIABLES(); \ + compsize = __gl ## name ## _size(pname); \ + cmdlen = 4 + RENDER_SIZE(type, compsize); \ + __GLX_BEGIN(rop, cmdlen); \ + __GLX_PUT_LONG(4, pname); \ + __GLX_PUT_ ## type ## _ARRAY(8, v, compsize); \ + __GLX_END(cmdlen); \ + } + +#define glxproto_1(name, rop, type) \ + glxproto_1s(name, rop, type) \ + glxproto_Cv(name ## v, rop, type, 1) + +#define glxproto_3(name, rop, type) \ + glxproto_3s(name, rop, type) \ + glxproto_Cv(name ## v, rop, type, 3) + +#define glxproto_enum1_V(name, rop, type) \ + glxproto_enum1_1s(name, rop, type) \ + glxproto_enum1_Vv(name ## v, rop ## v, type) void glCallList(GLuint list) { @@ -425,6 +610,18 @@ __GLX_END(12); } +glxproto_1(FogCoordf, X_GLrop_FogCoordfv, GLfloat) +glxproto_1(FogCoordd, X_GLrop_FogCoorddv, GLdouble) + +glxproto_3(SecondaryColor3b, X_GLrop_SecondaryColor3bv, GLbyte) +glxproto_3(SecondaryColor3s, X_GLrop_SecondaryColor3sv, GLshort) +glxproto_3(SecondaryColor3i, X_GLrop_SecondaryColor3iv, GLint) +glxproto_3(SecondaryColor3ub, X_GLrop_SecondaryColor3ubv, GLubyte) +glxproto_3(SecondaryColor3us, X_GLrop_SecondaryColor3usv, GLushort) +glxproto_3(SecondaryColor3ui, X_GLrop_SecondaryColor3uiv, GLuint) +glxproto_3(SecondaryColor3f, X_GLrop_SecondaryColor3fv, GLfloat) +glxproto_3(SecondaryColor3d, X_GLrop_SecondaryColor3dv, GLdouble) + void glEdgeFlag(GLboolean flag) { __GLX_DECLARE_VARIABLES(); @@ -1638,8 +1835,8 @@ void glFogfv(GLenum pname, const GLfloat *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glFogfv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glFogfv_size(pname); cmdlen = 8+compsize*4; __GLX_BEGIN(X_GLrop_Fogfv,cmdlen); __GLX_PUT_LONG(4,pname); @@ -1660,8 +1857,8 @@ void glFogiv(GLenum pname, const GLint *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glFogiv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glFogiv_size(pname); cmdlen = 8+compsize*4; __GLX_BEGIN(X_GLrop_Fogiv,cmdlen); __GLX_PUT_LONG(4,pname); @@ -1702,8 +1899,8 @@ void glLightfv(GLenum light, GLenum pname, const GLfloat *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glLightfv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glLightfv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_Lightfv,cmdlen); __GLX_PUT_LONG(4,light); @@ -1726,8 +1923,8 @@ void glLightiv(GLenum light, GLenum pname, const GLint *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glLightiv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glLightiv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_Lightiv,cmdlen); __GLX_PUT_LONG(4,light); @@ -1749,8 +1946,8 @@ void glLightModelfv(GLenum pname, const GLfloat *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glLightModelfv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glLightModelfv_size(pname); cmdlen = 8+compsize*4; __GLX_BEGIN(X_GLrop_LightModelfv,cmdlen); __GLX_PUT_LONG(4,pname); @@ -1771,8 +1968,8 @@ void glLightModeliv(GLenum pname, const GLint *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glLightModeliv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glLightModeliv_size(pname); cmdlen = 8+compsize*4; __GLX_BEGIN(X_GLrop_LightModeliv,cmdlen); __GLX_PUT_LONG(4,pname); @@ -1813,8 +2010,8 @@ void glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glMaterialfv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glMaterialfv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_Materialfv,cmdlen); __GLX_PUT_LONG(4,face); @@ -1837,8 +2034,8 @@ void glMaterialiv(GLenum face, GLenum pname, const GLint *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glMaterialiv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glMaterialiv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_Materialiv,cmdlen); __GLX_PUT_LONG(4,face); @@ -1901,8 +2098,8 @@ void glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glTexParameterfv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glTexParameterfv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_TexParameterfv,cmdlen); __GLX_PUT_LONG(4,target); @@ -1925,8 +2122,8 @@ void glTexParameteriv(GLenum target, GLenum pname, const GLint *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glTexParameteriv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glTexParameteriv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_TexParameteriv,cmdlen); __GLX_PUT_LONG(4,target); @@ -1949,8 +2146,8 @@ void glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glTexEnvfv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glTexEnvfv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_TexEnvfv,cmdlen); __GLX_PUT_LONG(4,target); @@ -1973,8 +2170,8 @@ void glTexEnviv(GLenum target, GLenum pname, const GLint *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glTexEnviv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glTexEnviv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_TexEnviv,cmdlen); __GLX_PUT_LONG(4,target); @@ -1997,8 +2194,8 @@ void glTexGendv(GLenum coord, GLenum pname, const GLdouble *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glTexGendv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glTexGendv_size(pname); cmdlen = 12+compsize*8; __GLX_BEGIN(X_GLrop_TexGendv,cmdlen); __GLX_PUT_LONG(4,coord); @@ -2021,8 +2218,8 @@ void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glTexGenfv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glTexGenfv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_TexGenfv,cmdlen); __GLX_PUT_LONG(4,coord); @@ -2045,8 +2242,8 @@ void glTexGeniv(GLenum coord, GLenum pname, const GLint *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glTexGeniv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glTexGeniv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_TexGeniv,cmdlen); __GLX_PUT_LONG(4,coord); @@ -2422,6 +2619,8 @@ __GLX_END(12); } +glxproto_4s(BlendFuncSeparate, X_GLrop_BlendFuncSeparate, GLenum) + void glLogicOp(GLenum opcode) { __GLX_DECLARE_VARIABLES(); @@ -2837,8 +3036,8 @@ void glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glColorTableParameterfv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glColorTableParameterfv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_ColorTableParameterfv,cmdlen); __GLX_PUT_LONG(4,target); @@ -2850,8 +3049,8 @@ void glColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glColorTableParameteriv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glColorTableParameteriv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_ColorTableParameteriv,cmdlen); __GLX_PUT_LONG(4,target); @@ -2900,8 +3099,8 @@ void glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glConvolutionParameterfv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glConvolutionParameterfv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_ConvolutionParameterfv,cmdlen); __GLX_PUT_LONG(4,target); @@ -2924,8 +3123,8 @@ void glConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) { __GLX_DECLARE_VARIABLES(); - compsize = __glConvolutionParameteriv_size(pname); __GLX_LOAD_VARIABLES(); + compsize = __glConvolutionParameteriv_size(pname); cmdlen = 12+compsize*4; __GLX_BEGIN(X_GLrop_ConvolutionParameteriv,cmdlen); __GLX_PUT_LONG(4,target); @@ -3401,12 +3600,12 @@ __GLX_DECLARE_VARIABLES(); GLfloat t[16]; int i, j; + __GLX_LOAD_VARIABLES(); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { t[i*4+j] = m[j*4+i]; } } - __GLX_LOAD_VARIABLES(); __GLX_BEGIN(X_GLrop_LoadMatrixf,68); __GLX_PUT_FLOAT_ARRAY(4,t,16); __GLX_END(68); @@ -3417,12 +3616,12 @@ __GLX_DECLARE_VARIABLES(); GLfloat t[16]; int i, j; + __GLX_LOAD_VARIABLES(); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { t[i*4+j] = m[j*4+i]; } } - __GLX_LOAD_VARIABLES(); __GLX_BEGIN(X_GLrop_MultMatrixf,68); __GLX_PUT_FLOAT_ARRAY(4,t,16); __GLX_END(68); @@ -3433,12 +3632,12 @@ __GLX_DECLARE_VARIABLES(); GLdouble t[16]; int i, j; + __GLX_LOAD_VARIABLES(); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { t[i*4+j] = m[j*4+i]; } } - __GLX_LOAD_VARIABLES(); __GLX_BEGIN(X_GLrop_LoadMatrixd,132); __GLX_PUT_DOUBLE_ARRAY(4,t,16); __GLX_END(132); @@ -3449,14 +3648,147 @@ __GLX_DECLARE_VARIABLES(); GLdouble t[16]; int i, j; + __GLX_LOAD_VARIABLES(); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { t[i*4+j] = m[j*4+i]; } } - __GLX_LOAD_VARIABLES(); __GLX_BEGIN(X_GLrop_MultMatrixd,132); __GLX_PUT_DOUBLE_ARRAY(4,t,16); __GLX_END(132); } + +/* + * New extension functions + */ + +void glPointParameterfARB(GLenum pname, GLfloat param) +{ + __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); + __GLX_BEGIN(X_GLrop_PointParameterfARB,12); + __GLX_PUT_LONG(4,pname); + __GLX_PUT_FLOAT(8,param); + __GLX_END(12); +} + +void glPointParameterfvARB(GLenum pname, const GLfloat *params) +{ + __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); + if (pname == GL_POINT_DISTANCE_ATTENUATION_ARB) { + /* params is float[3] */ + __GLX_BEGIN(X_GLrop_PointParameterfvARB,20); + __GLX_PUT_LONG(4,pname); + __GLX_PUT_FLOAT(8,params[0]); + __GLX_PUT_FLOAT(12,params[1]); + __GLX_PUT_FLOAT(16,params[2]); + __GLX_END(20); + } + else { + /* params is float[1] */ + __GLX_BEGIN(X_GLrop_PointParameterfvARB,12); + __GLX_PUT_LONG(4,pname); + __GLX_PUT_FLOAT(8,params[0]); + __GLX_END(12); + } +} + +glxproto_enum1_V(PointParameteri, X_GLrop_PointParameteri, GLint) + +void glWindowPos2dARB(GLdouble x, GLdouble y) +{ + glWindowPos3fARB(x, y, 0.0); +} + +void glWindowPos2iARB(GLint x, GLint y) +{ + glWindowPos3fARB(x, y, 0.0); +} + +void glWindowPos2fARB(GLfloat x, GLfloat y) +{ + glWindowPos3fARB(x, y, 0.0); +} + +void glWindowPos2sARB(GLshort x, GLshort y) +{ + glWindowPos3fARB(x, y, 0.0); +} + +void glWindowPos2dvARB(const GLdouble * p) +{ + glWindowPos3fARB(p[0], p[1], 0.0); +} + +void glWindowPos2fvARB(const GLfloat * p) +{ + glWindowPos3fARB(p[0], p[1], 0.0); +} + +void glWindowPos2ivARB(const GLint * p) +{ + glWindowPos3fARB(p[0], p[1], 0.0); +} + +void glWindowPos2svARB(const GLshort * p) +{ + glWindowPos3fARB(p[0], p[1], 0.0); +} + +void glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z) +{ + glWindowPos3fARB(x, y, z); +} + +void glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z) +{ + __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); + __GLX_BEGIN(X_GLrop_WindowPos3fARB,16); + __GLX_PUT_FLOAT(4,x); + __GLX_PUT_FLOAT(8,y); + __GLX_PUT_FLOAT(12,z); + __GLX_END(16); +} + +void glWindowPos3iARB(GLint x, GLint y, GLint z) +{ + glWindowPos3fARB(x, y, z); +} + +void glWindowPos3sARB(GLshort x, GLshort y, GLshort z) +{ + glWindowPos3fARB(x, y, z); +} + +void glWindowPos3dvARB(const GLdouble * p) +{ + glWindowPos3fARB(p[0], p[1], p[2]); +} + +void glWindowPos3fvARB(const GLfloat * p) +{ + glWindowPos3fARB(p[0], p[1], p[2]); +} + +void glWindowPos3ivARB(const GLint * p) +{ + glWindowPos3fARB(p[0], p[1], p[2]); +} + +void glWindowPos3svARB(const GLshort * p) +{ + glWindowPos3fARB(p[0], p[1], p[2]); +} + +void glActiveStencilFaceEXT(GLenum face) +{ + __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); + __GLX_BEGIN(X_GLrop_ActiveStencilFaceEXT,8); + __GLX_PUT_LONG(4,face); + __GLX_END(8); +} Index: xc/lib/GL/glx/glcontextmodes.c diff -u /dev/null xc/lib/GL/glx/glcontextmodes.c:1.3 --- /dev/null Sat Feb 28 21:41:11 2004 +++ xc/lib/GL/glx/glcontextmodes.c Fri Oct 24 11:25:06 2003 @@ -0,0 +1,288 @@ +/* + * (C) Copyright IBM Corporation 2003 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + */ + +/** + * \file glcontextmodes.c + * \author Ian Romanick + */ + +#include "glapi.h" +#include "glxclient.h" +#include "glcontextmodes.h" + +#define NUM_VISUAL_TYPES 6 + +/** + * Convert an X visual type to a GLX visual type. + * + * \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.) + * to be converted. + * \return If \c visualType is a valid X visual type, a GLX visual type will + * be returned. Otherwise \c GLX_NONE will be returned. + */ + +GLint +_gl_convert_from_x_visual_type( int visualType ) +{ + static const int glx_visual_types[ NUM_VISUAL_TYPES ] = { + GLX_STATIC_GRAY, GLX_GRAY_SCALE, + GLX_STATIC_COLOR, GLX_PSEUDO_COLOR, + GLX_TRUE_COLOR, GLX_DIRECT_COLOR + }; + + return ( (unsigned) visualType < NUM_VISUAL_TYPES ) + ? glx_visual_types[ visualType ] : GLX_NONE; +} + + +/** + * Convert a GLX visual type to an X visual type. + * + * \param visualType GLX visual type (i.e., \c GLX_TRUE_COLOR, + * \c GLX_STATIC_GRAY, etc.) to be converted. + * \return If \c visualType is a valid GLX visual type, an X visual type will + * be returned. Otherwise -1 will be returned. + */ + +GLint +_gl_convert_to_x_visual_type( int visualType ) +{ + static const int x_visual_types[ NUM_VISUAL_TYPES ] = { + StaticGray, GrayScale, + StaticColor, PseudoColor, + TrueColor, DirectColor + }; + + return ( (unsigned) (visualType - GLX_STATIC_GRAY) <= NUM_VISUAL_TYPES ) + ? x_visual_types[ visualType - GLX_STATIC_GRAY ] : -1; +} + + +/** + * Copy a GLX visual config structure to a GL context mode structure. All + * of the fields in \c config are copied to \c mode. Additional fields in + * \c mode that can be derrived from the fields of \c config (i.e., + * \c haveDepthBuffer) are also filled in. The remaining fields in \c mode + * that cannot be derrived are set to default values. + * + * \param mode Destination GL context mode. + * \param config Source GLX visual config. + */ + +void +_gl_copy_visual_to_context_mode( __GLcontextModes * mode, + const __GLXvisualConfig * config ) +{ + (void) memset( mode, 0, sizeof( __GLcontextModes ) ); + + mode->visualID = config->vid; + mode->visualType = _gl_convert_from_x_visual_type( config->class ); + mode->xRenderable = GL_TRUE; + mode->fbconfigID = GLX_DONT_CARE; + mode->drawableType = GLX_WINDOW_BIT; + + mode->rgbMode = (config->rgba != 0); + mode->renderType = (mode->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; + + mode->colorIndexMode = !(mode->rgbMode); + mode->doubleBufferMode = (config->doubleBuffer != 0); + mode->stereoMode = (config->stereo != 0); + + mode->haveAccumBuffer = ((config->accumRedSize + + config->accumGreenSize + + config->accumBlueSize + + config->accumAlphaSize) > 0); + mode->haveDepthBuffer = (config->depthSize > 0); + mode->haveStencilBuffer = (config->stencilSize > 0); + + mode->redBits = config->redSize; + mode->greenBits = config->greenSize; + mode->blueBits = config->blueSize; + mode->alphaBits = config->alphaSize; + mode->redMask = config->redMask; + mode->greenMask = config->greenMask; + mode->blueMask = config->blueMask; + mode->alphaMask = config->alphaMask; + mode->rgbBits = config->bufferSize; + mode->indexBits = config->bufferSize; + + mode->accumRedBits = config->accumRedSize; + mode->accumGreenBits = config->accumGreenSize; + mode->accumBlueBits = config->accumBlueSize; + mode->accumAlphaBits = config->accumAlphaSize; + mode->depthBits = config->depthSize; + mode->stencilBits = config->stencilSize; + + mode->numAuxBuffers = config->auxBuffers; + mode->level = config->level; + + mode->visualRating = config->visualRating; + mode->transparentPixel = config->transparentPixel; + mode->transparentRed = config->transparentRed; + mode->transparentGreen = config->transparentGreen; + mode->transparentBlue = config->transparentBlue; + mode->transparentAlpha = config->transparentAlpha; + mode->transparentIndex = config->transparentIndex; +} + + +/** + * Get data from a GL context mode. + * + * \param mode GL context mode whose data is to be returned. + * \param attribute Attribute of \c mode that is to be returned. + * \param value_return Location to store the data member of \c mode. + * \return If \c attribute is a valid attribute of \c mode, \c Success is + * returned. Otherwise \c GLX_BAD_ATTRIBUTE is returned. + */ + +int +_gl_get_context_mode_data(const __GLcontextModes *mode, int attribute, + int *value_return) +{ + switch (attribute) { + case GLX_USE_GL: + *value_return = GL_TRUE; + return Success; + case GLX_BUFFER_SIZE: + *value_return = mode->rgbBits; + return Success; + case GLX_RGBA: + *value_return = mode->rgbMode; + return Success; + case GLX_RED_SIZE: + *value_return = mode->redBits; + return Success; + case GLX_GREEN_SIZE: + *value_return = mode->greenBits; + return Success; + case GLX_BLUE_SIZE: + *value_return = mode->blueBits; + return Success; + case GLX_ALPHA_SIZE: + *value_return = mode->alphaBits; + return Success; + case GLX_DOUBLEBUFFER: + *value_return = mode->doubleBufferMode; + return Success; + case GLX_STEREO: + *value_return = mode->stereoMode; + return Success; + case GLX_AUX_BUFFERS: + *value_return = mode->numAuxBuffers; + return Success; + case GLX_DEPTH_SIZE: + *value_return = mode->depthBits; + return Success; + case GLX_STENCIL_SIZE: + *value_return = mode->stencilBits; + return Success; + case GLX_ACCUM_RED_SIZE: + *value_return = mode->accumRedBits; + return Success; + case GLX_ACCUM_GREEN_SIZE: + *value_return = mode->accumGreenBits; + return Success; + case GLX_ACCUM_BLUE_SIZE: + *value_return = mode->accumBlueBits; + return Success; + case GLX_ACCUM_ALPHA_SIZE: + *value_return = mode->accumAlphaBits; + return Success; + case GLX_LEVEL: + *value_return = mode->level; + return Success; + case GLX_TRANSPARENT_TYPE_EXT: + *value_return = mode->transparentPixel; + return Success; + case GLX_TRANSPARENT_RED_VALUE: + *value_return = mode->transparentRed; + return Success; + case GLX_TRANSPARENT_GREEN_VALUE: + *value_return = mode->transparentGreen; + return Success; + case GLX_TRANSPARENT_BLUE_VALUE: + *value_return = mode->transparentBlue; + return Success; + case GLX_TRANSPARENT_ALPHA_VALUE: + *value_return = mode->transparentAlpha; + return Success; + case GLX_TRANSPARENT_INDEX_VALUE: + *value_return = mode->transparentIndex; + return Success; + case GLX_X_VISUAL_TYPE: + *value_return = mode->visualType; + return Success; + case GLX_CONFIG_CAVEAT: + *value_return = mode->visualRating; + return Success; + case GLX_VISUAL_ID: + *value_return = mode->visualID; + return Success; + case GLX_DRAWABLE_TYPE: + *value_return = mode->drawableType; + return Success; + case GLX_RENDER_TYPE: + *value_return = mode->renderType; + return Success; + case GLX_X_RENDERABLE: + *value_return = mode->xRenderable; + return Success; + case GLX_FBCONFIG_ID: + *value_return = mode->fbconfigID; + return Success; + case GLX_MAX_PBUFFER_WIDTH: + *value_return = mode->maxPbufferWidth; + return Success; + case GLX_MAX_PBUFFER_HEIGHT: + *value_return = mode->maxPbufferHeight; + return Success; + case GLX_MAX_PBUFFER_PIXELS: + *value_return = mode->maxPbufferPixels; + return Success; + case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: + *value_return = mode->optimalPbufferWidth; + return Success; + case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: + *value_return = mode->optimalPbufferHeight; + return Success; + case GLX_SWAP_METHOD_OML: + *value_return = mode->swapMethod; + return Success; + case GLX_SAMPLE_BUFFERS_SGIS: + *value_return = mode->sampleBuffers; + return Success; + case GLX_SAMPLES_SGIS: + *value_return = mode->samples; + return Success; + + /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX. + * It is ONLY for communication between the GLX client and the GLX + * server. + */ + case GLX_VISUAL_SELECT_GROUP_SGIX: + default: + return GLX_BAD_ATTRIBUTE; + } +} Index: xc/lib/GL/glx/glcontextmodes.h diff -u /dev/null xc/lib/GL/glx/glcontextmodes.h:1.3 --- /dev/null Sat Feb 28 21:41:11 2004 +++ xc/lib/GL/glx/glcontextmodes.h Fri Oct 24 11:25:06 2003 @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corporation 2003 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + */ + +/** + * \file glcontextmodes.h + * \author Ian Romanick + */ + +#ifndef GLCONTEXTMODES_H +#define GLCONTEXTMODES_H + +#include "glapi.h" +#include "glxclient.h" + +extern GLint _gl_convert_from_x_visual_type( int visualType ); +extern GLint _gl_convert_to_x_visual_type( int visualType ); +extern void _gl_copy_visual_to_context_mode( __GLcontextModes * mode, + const __GLXvisualConfig * config ); +extern int _gl_get_context_mode_data( const __GLcontextModes *mode, + int attribute, int *value_return ); + +#endif /* GLCONTEXTMODES_H */ Index: xc/lib/GL/glx/glxclient.h diff -u xc/lib/GL/glx/glxclient.h:1.15 xc/lib/GL/glx/glxclient.h:1.22 --- xc/lib/GL/glx/glxclient.h:1.15 Wed Oct 30 07:51:26 2002 +++ xc/lib/GL/glx/glxclient.h Wed Feb 11 15:01:21 2004 @@ -31,7 +31,7 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ -/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.15 2002/10/30 12:51:26 alanh Exp $ */ +/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.22 2004/02/11 20:01:21 dawes Exp $ */ /* * Direct rendering support added by Precision Insight, Inc. @@ -51,8 +51,10 @@ #include #include #include +#include #include "GL/glxint.h" #include "GL/glxproto.h" +#include "GL/internal/glcore.h" #include "glapitable.h" #ifdef NEED_GL_FUNCS_WRAPPED #include "indirect.h" @@ -87,6 +89,7 @@ typedef struct __DRIscreenRec __DRIscreen; typedef struct __DRIcontextRec __DRIcontext; typedef struct __DRIdrawableRec __DRIdrawable; +typedef struct __DRIdriverRec __DRIdriver; extern __DRIscreen *__glXFindDRIScreen(Display *dpy, int scrn); @@ -147,17 +150,40 @@ void *drawablePrivate); /* - ** XXX in the future, implement this: - void *(*createPBuffer)(Display *dpy, int scrn, GLXPbuffer pbuffer, - GLXFBConfig config, __DRIdrawable *pdraw); - **/ - - /* ** Opaque pointer to private per screen direct rendering data. NULL ** if direct rendering is not supported on this screen. Never ** dereferenced in libGL. */ void *private; + + /* + ** Get the number of vertical refreshes since some point in time before + ** this function was first called (i.e., system start up). + ** + ** Added with internal API version "20030317". + */ + int (*getMSC)( void *screenPrivate, int64_t *msc ); + + /* + ** Opaque pointer that points back to the containing __GLXscreenConfigs. + ** This data structure is shared with DRI drivers but __GLXscreenConfigs + ** is not. However, they are needed by some GLX functions called by DRI + ** drivers. + ** + ** Added with internal API version "20030813". + */ + void *screenConfigs; + + /* + ** Added with internal API version "20030815". + */ + void *(*allocateMemory)(Display *dpy, int scrn, GLsizei size, + GLfloat readfreq, GLfloat writefreq, + GLfloat priority); + + void (*freeMemory)(Display *dpy, int scrn, GLvoid *pointer); + + GLuint (*memoryOffset)(Display *dpy, int scrn, const GLvoid *pointer); }; /* @@ -172,8 +198,6 @@ /* ** Method to bind a DRI drawable to a DRI graphics context. - ** XXX in the future, also pass a 'read' GLXDrawable for - ** glXMakeCurrentReadSGI() and GLX 1.3's glXMakeContextCurrent(). */ Bool (*bindContext)(Display *dpy, int scrn, GLXDrawable draw, GLXContext gc); @@ -190,6 +214,22 @@ ** screen used to create this context. Never dereferenced in libGL. */ void *private; + + /* + ** Added with internal API version "20030606". + ** + ** Method to bind a DRI drawable to a DRI graphics context. + */ + Bool (*bindContext2)(Display *dpy, int scrn, GLXDrawable draw, + GLXDrawable read, GLXContext gc); + + /* + ** Added with internal API version "20030606". + ** + ** Method to unbind a DRI drawable to a DRI graphics context. + */ + Bool (*unbindContext2)(Display *dpy, int scrn, GLXDrawable draw, + GLXDrawable read, GLXContext gc); }; /* @@ -214,6 +254,83 @@ ** screen used to create this drawable. Never dereferenced in libGL. */ void *private; + + /* + ** Get the number of completed swap buffers for this drawable. + ** + ** Added with internal API version "20030317". + */ + int (*getSBC)(Display *dpy, void *drawablePrivate, int64_t *sbc ); + + /* + ** Wait for the SBC to be greater than or equal target_sbc. + */ + int (*waitForSBC)( Display * dpy, void *drawablePriv, + int64_t target_sbc, + int64_t * msc, int64_t * sbc ); + + /* + ** Wait for the MSC to equal target_msc, or, if that has already passed, + ** the next time (MSC % divisor) is equal to remainder. If divisor is + ** zero, the function will return as soon as MSC is greater than or equal + ** to target_msc. + ** + ** Added with internal API version "20030317". + */ + int (*waitForMSC)( Display * dpy, void *drawablePriv, + int64_t target_msc, int64_t divisor, int64_t remainder, + int64_t * msc, int64_t * sbc ); + + /* + ** Like swapBuffers, but does NOT have an implicit glFlush. Once + ** rendering is complete, waits until MSC is equal to target_msc, or + ** if that has already passed, waits until (MSC % divisor) is equal + ** to remainder. If divisor is zero, the swap will happen as soon as + ** MSC is greater than or equal to target_msc. + ** + ** Added with internal API version "20030317". + */ + int64_t (*swapBuffersMSC)(Display *dpy, void *drawablePrivate, + int64_t target_msc, + int64_t divisor, int64_t remainder); + + /* + ** Enable or disable frame usage tracking. + ** + ** Added with internal API version "20030317". + */ + int (*frameTracking)(Display *dpy, void *drawablePrivate, Bool enable); + + /* + ** Retrieve frame usage information. + ** + ** Added with internal API version "20030317". + */ + int (*queryFrameTracking)(Display *dpy, void *drawablePrivate, + int64_t * sbc, int64_t * missedFrames, + float * lastMissedUsage, float * usage ); + + /* + ** Used by drivers that implement the GLX_SGI_swap_control or + ** GLX_MESA_swap_control extension. + ** + ** Added with internal API version "20030317". + */ + unsigned swap_interval; +}; + + +typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc, + int numConfigs, __GLXvisualConfig *config); + +/* +** We keep a linked list of these structures, one per DRI device driver. +*/ +struct __DRIdriverRec { + const char *name; + void *handle; + CreateScreenFunc createScreenFunc; + struct __DRIdriverRec *next; }; /* @@ -222,6 +339,8 @@ */ extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp); +extern __DRIdriver *driGetDriver(Display *dpy, int scrNum); + extern void DRI_glXUseXFont( Font font, int first, int count, int listbase ); #endif @@ -242,9 +361,55 @@ GLuint alignment; } __GLXpixelStoreMode; +/* The next 3 structures are deprecated. Client state is no longer tracked + * using them. They only remain to maintain the layout / structure offset of + * __GLXcontextRec. In XFree86 5.0 they will be removed altogether. + */ + +typedef struct __GLXvertexArrayPointerStateRecDEPRECATED { + GLboolean enable; + void (*proc)(const void *); + const GLubyte *ptr; + GLsizei skip; + GLint size; + GLenum type; + GLsizei stride; +} __GLXvertexArrayPointerStateDEPRECATED; + +typedef struct __GLXvertArrayStateRecDEPRECATED { + __GLXvertexArrayPointerStateDEPRECATED vertex; + __GLXvertexArrayPointerStateDEPRECATED normal; + __GLXvertexArrayPointerStateDEPRECATED color; + __GLXvertexArrayPointerStateDEPRECATED index; + __GLXvertexArrayPointerStateDEPRECATED texCoord[__GLX_MAX_TEXTURE_UNITS]; + __GLXvertexArrayPointerStateDEPRECATED edgeFlag; + GLint maxElementsVertices; + GLint maxElementsIndices; + GLint activeTexture; +} __GLXvertArrayStateDEPRECATED; + +typedef struct __GLXattributeRecDEPRECATED { + GLuint mask; + + /* + ** Pixel storage state. Most of the pixel store mode state is kept + ** here and used by the client code to manage the packing and + ** unpacking of data sent to/received from the server. + */ + __GLXpixelStoreMode storePack, storeUnpack; + + /* + ** Vertex Array storage state. The vertex array component + ** state is stored here and is used to manage the packing of + ** DrawArrays data sent to the server. + */ + __GLXvertArrayStateDEPRECATED vertArray; +} __GLXattributeDEPRECATED; + typedef struct __GLXvertexArrayPointerStateRec { GLboolean enable; void (*proc)(const void *); + void (*mtex_proc)(GLenum, const void *); const GLubyte *ptr; GLsizei skip; GLint size; @@ -256,6 +421,8 @@ __GLXvertexArrayPointerState vertex; __GLXvertexArrayPointerState normal; __GLXvertexArrayPointerState color; + __GLXvertexArrayPointerState secondaryColor; + __GLXvertexArrayPointerState fogCoord; __GLXvertexArrayPointerState index; __GLXvertexArrayPointerState texCoord[__GLX_MAX_TEXTURE_UNITS]; __GLXvertexArrayPointerState edgeFlag; @@ -378,7 +545,7 @@ /* ** Client side attribs. */ - __GLXattribute state; + __GLXattributeDEPRECATED stateDEPRECATED; __GLXattributeMachine attributes; /* @@ -401,7 +568,7 @@ /* ** The current drawable for this context. Will be None if this - ** context is not current to any drawable. + ** context is not current to any drawable. currentReadable is below. */ GLXDrawable currentDrawable; @@ -436,6 +603,28 @@ */ __DRIcontext driContext; #endif + + /* + ** Added with internal API version "20030317". + */ + GLXFBConfigID fbconfigID; + + /* + ** Added with internal API version "20030606". + ** + ** The current read-drawable for this context. Will be None if this + ** context is not current to any drawable. + */ + GLXDrawable currentReadable; + + /** + * Pointer to client-state data that is private to libGL. This is only + * used for indirect rendering contexts. + * + * No internal API version change was made for this change. Client-side + * drivers should NEVER use this data or even care that it exists. + */ + void * client_state_private; }; #define __glXSetError(gc,code) \ @@ -478,8 +667,8 @@ ** a pointer to the config data for that screen (if the screen supports GL). */ typedef struct __GLXscreenConfigsRec { - __GLXvisualConfig *configs; - int numConfigs; + __GLXvisualConfig * old_configs; + int numOldConfigs; const char *serverGLXexts; char *effectiveGLXexts; @@ -489,6 +678,22 @@ */ __DRIscreen driScreen; #endif + + /* Avoid breaking binary compatibility and put these here */ + __GLcontextModes *configs; + int numConfigs; + /** + * Per-screen dynamic GLX extension tracking. The \c direct_support + * field only contains enough bits for 64 extensions. Should libGL + * ever need to track more than 64 GLX extensions, we can safely grow + * this field. The \c __GLXscreenConfigs structure is not used outside + * libGL. + */ + /*@{*/ + unsigned char direct_support[8]; + GLboolean ext_list_first_time; + /*@}*/ + } __GLXscreenConfigs; /* @@ -544,14 +749,6 @@ /* Initialize the GLX extension for dpy */ extern __GLXdisplayPrivate *__glXInitialize(Display*); -/* Query drivers for dynamically registered extensions */ -extern void __glXRegisterExtensions(void); - -/* Functions for extending the GLX API: */ -extern void *__glXRegisterGLXFunction(const char *funcName, void *funcAddr); -extern void __glXRegisterGLXExtensionString(const char *extName); - - /************************************************************************/ extern int __glXDebug; @@ -594,6 +791,14 @@ /* Return the size, in bytes, of some pixel data */ extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum); +/* Return the number of elements per group of a specified format*/ +extern GLint __glElementsPerGroup(GLenum format, GLenum type); + +/* Return the number of bytes per element, based on the element type (other +** than GL_BITMAP). +*/ +extern GLint __glBytesPerElement(GLenum type); + /* Return the k value for a given map target */ extern GLint __glEvalComputeK(GLenum); @@ -634,48 +839,6 @@ */ extern void __glXClientInfo ( Display *dpy, int opcode ); -/* -** Size routines. These determine how much data needs to be transfered -** based on the clients arguments. If an enumerant or other value -** is illegal these procedures return 0. -*/ -extern GLint __glCallLists_size(GLint, GLenum); -extern GLint __glColorTableParameterfv_size(GLenum); -extern GLint __glColorTableParameteriv_size(GLenum); -extern GLint __glConvolutionParameterfv_size(GLenum); -extern GLint __glConvolutionParameteriv_size(GLenum); -extern GLint __glDrawPixels_size(GLenum, GLenum, GLint, GLint); -extern GLint __glReadPixels_size(GLenum, GLenum, GLint, GLint); -extern GLint __glLightModelfv_size(GLenum); -extern GLint __glLightModeliv_size(GLenum); -extern GLint __glLightfv_size(GLenum); -extern GLint __glLightiv_size(GLenum); -extern GLint __glMaterialfv_size(GLenum); -extern GLint __glMaterialiv_size(GLenum); -extern GLint __glFogfv_size(GLenum); -extern GLint __glFogiv_size(GLenum); -extern GLint __glTexImage1D_size(GLenum, GLenum, GLint); -extern GLint __glTexImage2D_size(GLenum, GLenum, GLint, GLint); -extern GLint __glTexImage3D_size(GLenum, GLenum, GLint, GLint, GLint); -extern GLint __glTexEnvfv_size(GLenum); -extern GLint __glTexEnviv_size(GLenum); -extern GLint __glTexGenfv_size(GLenum); -extern GLint __glTexGendv_size(GLenum); -extern GLint __glTexGeniv_size(GLenum); -extern GLint __glTexParameterfv_size(GLenum); -extern GLint __glTexParameteriv_size(GLenum); -extern GLint __glGetMaterialfv_size(GLenum); -extern GLint __glGetMaterialiv_size(GLenum); -extern GLint __glGetLightfv_size(GLenum); -extern GLint __glGetLightiv_size(GLenum); -extern GLint __glGetTexParameterfv_size(GLenum); -extern GLint __glGetTexParameteriv_size(GLenum); -extern GLint __glGetTexEnvfv_size(GLenum); -extern GLint __glGetTexEnviv_size(GLenum); -extern GLint __glGetTexGenfv_size(GLenum); -extern GLint __glGetTexGendv_size(GLenum); -extern GLint __glGetTexGeniv_size(GLenum); - /************************************************************************/ /* @@ -700,6 +863,28 @@ #endif +extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config, + int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags ); + +extern char *__glXInternalQueryServerString( Display *dpy, int opcode, + int screen, int name ); + extern char *__glXstrdup(const char *str); + +extern const char __glXGLClientVersion[]; +extern const char __glXGLClientExtensions[]; +extern char *__glXCombineExtensionStrings( const char *cext_string, + const char *sext_string ); + +/* Determine the internal API version */ +typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void ); +extern int __glXGetInternalVersion(void); + +extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw); + +/* Get the unadjusted system time */ +typedef int (* PFNGLXGETUSTPROC) ( int64_t * ust ); +extern int __glXGetUST( int64_t * ust ); + #endif /* !__GLX_client_h__ */ Index: xc/lib/GL/glx/glxcmds.c diff -u xc/lib/GL/glx/glxcmds.c:1.19 xc/lib/GL/glx/glxcmds.c:1.31 --- xc/lib/GL/glx/glxcmds.c:1.19 Mon Jan 20 16:37:18 2003 +++ xc/lib/GL/glx/glxcmds.c Mon Feb 9 18:46:31 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/glxcmds.c,v 1.19 2003/01/20 21:37:18 tsi Exp $ */ +/* $XFree86: xc/lib/GL/glx/glxcmds.c,v 1.31 2004/02/09 23:46:31 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -38,60 +38,313 @@ #include "glxclient.h" #include #include +#include #include #include "glapi.h" #ifdef GLX_DIRECT_RENDERING #include "indirect_init.h" +#include #endif +#include "glxextensions.h" +#include "glcontextmodes.h" +#include -static const char __glXGLClientExtensions[] = +const char __glXGLClientExtensions[] = + "GL_ARB_depth_texture " "GL_ARB_imaging " + "GL_ARB_multisample " "GL_ARB_multitexture " + "GL_ARB_point_parameters " + "GL_ARB_point_sprite " + "GL_ARB_shadow " + "GL_ARB_shadow_ambient " "GL_ARB_texture_border_clamp " "GL_ARB_texture_cube_map " "GL_ARB_texture_env_add " "GL_ARB_texture_env_combine " + "GL_ARB_texture_env_crossbar " "GL_ARB_texture_env_dot3 " + "GL_ARB_texture_mirrored_repeat " + "GL_ARB_texture_non_power_of_two " "GL_ARB_transpose_matrix " + "GL_ARB_window_pos " "GL_EXT_abgr " - "GL_EXT_blend_color " - "GL_EXT_blend_minmax " - "GL_EXT_blend_subtract " - "GL_EXT_texture_env_add " - "GL_EXT_texture_env_combine " - "GL_EXT_texture_env_dot3 " - "GL_EXT_texture_lod_bias " + "GL_EXT_bgra " + "GL_EXT_blend_color " + "GL_EXT_blend_func_separate " + "GL_EXT_blend_logic_op " + "GL_EXT_blend_minmax " + "GL_EXT_blend_subtract " + "GL_EXT_clip_volume_hint " + "GL_EXT_copy_texture " + "GL_EXT_draw_range_elements " + "GL_EXT_fog_coord " + "GL_EXT_multi_draw_arrays " + "GL_EXT_packed_pixels " + "GL_EXT_polygon_offset " + "GL_EXT_rescale_normal " + "GL_EXT_secondary_color " + "GL_EXT_separate_specular_color " + "GL_EXT_shadow_funcs " + "GL_EXT_stencil_two_side " + "GL_EXT_stencil_wrap " + "GL_EXT_subtexture " + "GL_EXT_texture " + "GL_EXT_texture3D " + "GL_EXT_texture_edge_clamp " + "GL_EXT_texture_env_add " + "GL_EXT_texture_env_combine " + "GL_EXT_texture_env_dot3 " + "GL_EXT_texture_filter_anisotropic " + "GL_EXT_texture_lod " + "GL_EXT_texture_lod_bias " + "GL_EXT_texture_object " + "GL_EXT_texture_rectangle " + "GL_EXT_vertex_array " + "GL_APPLE_packed_pixels " + "GL_APPLE_ycbcr_422 " + "GL_ATI_texture_env_combine3 " + "GL_ATI_texture_float " + "GL_ATI_texture_mirror_once " + "GL_ATIX_texture_env_combine3 " + "GL_HP_convolution_border_modes " +#if 0 + /* This is currently removed because there seem to be some problems with + * it and the software-only indirect rendering path. At this point, I'm + * not sure which side (client or server) has the problem. - idr + */ + "GL_HP_occlusion_test " +#endif + "GL_IBM_cull_vertex " + "GL_IBM_pixel_filter_hint " + "GL_IBM_rasterpos_clip " + "GL_IBM_texture_clamp_nodraw " + "GL_IBM_texture_mirrored_repeat " + "GL_INGR_interlace_read " + "GL_MESA_pack_invert " + "GL_MESA_ycbcr_texture " + "GL_NV_blend_square " + "GL_NV_copy_depth_to_color " + "GL_NV_depth_clamp " + "GL_NV_fog_distance " + "GL_NV_light_max_exponent " + "GL_NV_multisample_filter_hint " + "GL_NV_point_sprite " + "GL_NV_texgen_reflection " + "GL_NV_texture_rectangle " + "GL_SGIS_generate_mipmap " + "GL_SGIS_multisample " + "GL_SGIS_texture_border_clamp " + "GL_SGIS_texture_edge_clamp " + "GL_SGIS_texture_lod " + "GL_SGIX_blend_alpha_minmax " + "GL_SGIX_clipmap " + "GL_SGIX_depth_texture " + "GL_SGIX_fog_offset " + "GL_SGIX_shadow " + "GL_SGIX_shadow_ambient " + "GL_SGIX_texture_coordinate_clamp " + "GL_SGIX_texture_lod_bias " + "GL_SGIX_texture_range " + "GL_SGIX_texture_scale_bias " + "GL_SGIX_vertex_preclip " + "GL_SGIX_vertex_preclip_hint " + "GL_SGIX_ycrcb " + "GL_SUN_convolution_border_modes " + "GL_SUN_slice_accum " ; static const char __glXGLXClientVendorName[] = "SGI"; static const char __glXGLXClientVersion[] = "1.2"; -static const char __glXGLXDefaultClientExtensions[] = - "GLX_EXT_visual_info " - "GLX_EXT_visual_rating " - "GLX_EXT_import_context " - ; -static const char *__glXGLXClientExtensions = __glXGLXDefaultClientExtensions; +/** + * Textual version of the client-side GL core version. This version is + * primarilly determined by what functionality has implemented protocol. + */ +const char __glXGLClientVersion[] = "1.2"; +#ifdef GLX_DIRECT_RENDERING +static void * DriverCreateContextWrapper( __GLXscreenConfigs *psc, + Display *dpy, XVisualInfo *vis, void *shared, __DRIcontext *ctx, + __GLcontextModes *fbconfig ); -/* -** Create a new context. -*/ -static -GLXContext CreateContext(Display *dpy, XVisualInfo *vis, - GLXContext shareList, - Bool allowDirect, GLXContextID contextID) +static Bool dummyBindContext2( Display *dpy, int scrn, + GLXDrawable draw, GLXDrawable read, GLXContext gc ); + +static Bool dummyUnbindContext2( Display *dpy, int scrn, + GLXDrawable draw, GLXDrawable read, GLXContext gc ); + +/****************************************************************************/ + +static Bool dummyBindContext2( Display *dpy, int scrn, + GLXDrawable draw, GLXDrawable read, + GLXContext gc ) { - xGLXCreateContextReq *req; - GLXContext gc; - int bufSize = XMaxRequestSize(dpy) * 4; - CARD8 opcode; + assert( draw == read ); + return (*gc->driContext.bindContext)( dpy, scrn, draw, gc ); +} + +static Bool dummyUnbindContext2( Display *dpy, int scrn, + GLXDrawable draw, GLXDrawable read, + GLXContext gc ) +{ + assert( draw == read ); + return (*gc->driContext.unbindContext)( dpy, scrn, draw, gc, GL_FALSE ); +} + + +/****************************************************************************/ +/** + * Wrap the call to the driver's \c createContext function. + * + * The \c createContext function is wrapped because not all drivers support + * the "new" \c unbindContext2 and \c bindContext2 interfaces. libGL should + * not have to check to see which functions the driver supports. Instead, + * if either function is not supported it is wrapped. The wrappers test to + * make sure that both drawables are the same and pass control to the old + * interface. + */ + +static void * DriverCreateContextWrapper( __GLXscreenConfigs *psc, + Display *dpy, XVisualInfo *vis, + void *shared, + __DRIcontext *ctx, + __GLcontextModes *fbconfig ) +{ + void * ctx_priv; + + (void) fbconfig; + ctx_priv = (*psc->driScreen.createContext)(dpy, vis, shared, ctx); + if ( ctx_priv != NULL ) { + if ( ctx->unbindContext2 == NULL ) { + ctx->unbindContext2 = dummyUnbindContext2; + } + + if ( ctx->bindContext2 == NULL ) { + ctx->bindContext2 = dummyBindContext2; + } + } + + return ctx_priv; +} +#endif + + +/****************************************************************************/ +/** + * Get the __DRIdrawable for the drawable associated with a GLXContext + * + * \param dpy The display associated with \c drawable. + * \param drawable GLXDrawable whose __DRIdrawable part is to be retrieved. + * \returns A pointer to the context's __DRIdrawable on success, or NULL if + * the drawable is not associated with a direct-rendering context. + */ + #ifdef GLX_DIRECT_RENDERING - __GLXdisplayPrivate *priv; +static __DRIdrawable * +GetDRIDrawable( Display *dpy, GLXDrawable drawable, int * const scrn_num ) +{ + __GLXdisplayPrivate * const priv = __glXInitialize(dpy); + + if ( (priv != NULL) && (priv->driDisplay.private != NULL) ) { + const unsigned screen_count = ScreenCount(dpy); + unsigned i; + + for ( i = 0 ; i < screen_count ; i++ ) { + __DRIscreen * const psc = &priv->screenConfigs[i].driScreen; + __DRIdrawable * const pdraw = (psc->private != NULL) + ? (*psc->getDrawable)(dpy, drawable, psc->private) : NULL; + + if ( pdraw != NULL ) { + if ( scrn_num != NULL ) { + *scrn_num = i; + } + return pdraw; + } + } + } + + return NULL; +} #endif - if (!dpy || !vis) - return NULL; + +/** + * Get the GLX per-screen data structure associated with a GLX context. + * + * \param dpy Display for which the GLX per-screen information is to be + * retrieved. + * \param scrn Screen on \c dpy for which the GLX per-screen information is + * to be retrieved. + * \returns A pointer to the GLX per-screen data if \c dpy and \c scrn + * specify a valid GLX screen, or NULL otherwise. + * + * \todo Should this function validate that \c scrn is within the screen + * number range for \c dpy? + */ + +static __GLXscreenConfigs * +GetGLXScreenConfigs(Display *dpy, int scrn) +{ + __GLXdisplayPrivate * const priv = __glXInitialize(dpy); + + return (priv->screenConfigs != NULL) ? &priv->screenConfigs[scrn] : NULL; +} + + +static int +GetGLXPrivScreenConfig( Display *dpy, int scrn, __GLXdisplayPrivate ** ppriv, + __GLXscreenConfigs ** ppsc ) +{ + /* Initialize the extension, if needed . This has the added value + * of initializing/allocating the display private + */ + + if ( dpy == NULL ) { + return GLX_NO_EXTENSION; + } + + *ppriv = __glXInitialize(dpy); + if ( *ppriv == NULL ) { + return GLX_NO_EXTENSION; + } + + /* Check screen number to see if its valid */ + if ((scrn < 0) || (scrn >= ScreenCount(dpy))) { + return GLX_BAD_SCREEN; + } + + /* Check to see if the GL is supported on this screen */ + *ppsc = &((*ppriv)->screenConfigs[scrn]); + if ( ((*ppsc)->configs == NULL) || ((*ppsc)->numConfigs <= 0) ) { + /* No support for GL on this screen regardless of visual */ + return GLX_BAD_VISUAL; + } + + return Success; +} + + +/** + * \todo It should be possible to move the allocate of \c client_state_private + * later in the function for direct-rendering contexts. Direct-rendering + * contexts don't need to track client state, so they don't need that memory + * at all. + * + * \todo Eliminate \c __glXInitVertexArrayState. Replace it with a new + * function called \c __glXAllocateClientState that allocates the memory and + * does all the initialization (including the pixel pack / unpack). + */ +static +GLXContext AllocateGLXContext( Display *dpy ) +{ + GLXContext gc; + int bufSize; + CARD8 opcode; + __GLXattribute *state; + + if (!dpy) + return NULL; opcode = __glXSetupForCommand(dpy); if (!opcode) { @@ -106,9 +359,26 @@ } memset(gc, 0, sizeof(struct __GLXcontextRec)); - /* Allocate transport buffer */ + state = Xmalloc(sizeof(struct __GLXattributeRec)); + if (state == NULL) { + /* Out of memory */ + Xfree(gc); + return NULL; + } + gc->client_state_private = state; + memset(gc->client_state_private, 0, sizeof(struct __GLXattributeRec)); + + /* + ** Create a temporary buffer to hold GLX rendering commands. The size + ** of the buffer is selected so that the maximum number of GLX rendering + ** commands can fit in a single X packet and still have room in the X + ** packet for the GLXRenderReq header. + */ + + bufSize = (XMaxRequestSize(dpy) * 4) - sz_xGLXRenderReq; gc->buf = (GLubyte *) Xmalloc(bufSize); if (!gc->buf) { + Xfree(gc->client_state_private); Xfree(gc); return NULL; } @@ -117,8 +387,8 @@ /* Fill in the new context */ gc->renderMode = GL_RENDER; - gc->state.storePack.alignment = 4; - gc->state.storeUnpack.alignment = 4; + state->storePack.alignment = 4; + state->storeUnpack.alignment = 4; __glXInitVertexArrayState(gc); @@ -158,42 +428,111 @@ bufSize = __GLX_MAX_RENDER_CMD_SIZE; } gc->maxSmallRenderCommandSize = bufSize; + return gc; +} + + +/** + * Create a new context. Exactly one of \c vis and \c fbconfig should be + * non-NULL. + * + * \param use_glx_1_3 For FBConfigs, should GLX 1.3 protocol or + * SGIX_fbconfig protocol be used? + * \param renderType For FBConfigs, what is the rendering type? + */ + +static +GLXContext CreateContext(Display *dpy, XVisualInfo *vis, + __GLcontextModes * fbconfig, GLXContext shareList, + Bool allowDirect, GLXContextID contextID, + Bool use_glx_1_3, int renderType) +{ + GLXContext gc; + + if ( dpy == NULL ) + return NULL; + gc = AllocateGLXContext(dpy); + if (!gc) + return NULL; if (None == contextID) { + if ( (vis == NULL) && (fbconfig == NULL) ) + return NULL; + #ifdef GLX_DIRECT_RENDERING - /* - ** Create the direct rendering context, if requested and - ** available. - */ - priv = __glXInitialize(dpy); - if (allowDirect && priv->driDisplay.private) { - __GLXscreenConfigs *psc = &priv->screenConfigs[vis->screen]; + if (allowDirect) { + int screen = (fbconfig == NULL) ? vis->screen : fbconfig->screen; + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + if (psc && psc->driScreen.private) { - void *shared = (shareList ? - shareList->driContext.private : NULL); + void * const shared = (shareList != NULL) + ? shareList->driContext.private : NULL; gc->driContext.private = - (*psc->driScreen.createContext)(dpy, vis, shared, - &gc->driContext); + DriverCreateContextWrapper( psc, dpy, vis, shared, + &gc->driContext, fbconfig ); if (gc->driContext.private) { gc->isDirect = GL_TRUE; - gc->screen = vis->screen; - gc->vid = vis->visualid; + gc->screen = screen; + if ( fbconfig == NULL ) { + gc->vid = vis->visualid; + gc->fbconfigID = None; + } + else { + gc->vid = fbconfig->visualID; + gc->fbconfigID = fbconfig->fbconfigID; + } } } } #endif - /* Send the glXCreateContext request */ LockDisplay(dpy); - GetReq(GLXCreateContext,req); - req->reqType = gc->majorOpcode; - req->glxCode = X_GLXCreateContext; - req->context = gc->xid = XAllocID(dpy); - req->visual = vis->visualid; - req->screen = vis->screen; - req->shareList = shareList ? shareList->xid : None; - req->isDirect = gc->isDirect; + if ( fbconfig == NULL ) { + xGLXCreateContextReq *req; + + /* Send the glXCreateContext request */ + GetReq(GLXCreateContext,req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXCreateContext; + req->context = gc->xid = XAllocID(dpy); + req->visual = vis->visualid; + req->screen = vis->screen; + req->shareList = shareList ? shareList->xid : None; + req->isDirect = gc->isDirect; + } + else if ( use_glx_1_3 ) { + xGLXCreateNewContextReq *req; + + /* Send the glXCreateNewContext request */ + GetReq(GLXCreateNewContext,req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXCreateNewContext; + req->context = gc->xid = XAllocID(dpy); + req->fbconfig = fbconfig->fbconfigID; + req->screen = fbconfig->screen; + req->renderType = renderType; + req->shareList = shareList ? shareList->xid : None; + req->isDirect = gc->isDirect; + } + else { + xGLXVendorPrivateReq *vpreq; + xGLXCreateContextWithConfigSGIXReq *req; + + /* Send the glXCreateNewContext request */ + GetReqExtra(GLXVendorPrivate, + sz_xGLXCreateContextWithConfigSGIXReq-sz_xGLXVendorPrivateReq,vpreq); + req = (xGLXCreateContextWithConfigSGIXReq *)vpreq; + req->reqType = gc->majorOpcode; + req->vendorCode = X_GLXvop_CreateContextWithConfigSGIX; + req->context = gc->xid = XAllocID(dpy); + req->fbconfig = fbconfig->fbconfigID; + req->screen = fbconfig->screen; + req->renderType = renderType; + req->shareList = shareList ? shareList->xid : None; + req->isDirect = gc->isDirect; + } + UnlockDisplay(dpy); SyncHandle(); gc->imported = GL_FALSE; @@ -206,10 +545,12 @@ return gc; } + GLXContext GLX_PREFIX(glXCreateContext)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool allowDirect) { - return CreateContext(dpy, vis, shareList, allowDirect, None); + return CreateContext(dpy, vis, NULL, shareList, allowDirect, None, + False, 0); } void __glXFreeContext(__GLXcontext *gc) @@ -220,6 +561,7 @@ if (gc->extensions) XFree((char *) gc->extensions); __glFreeAttributeState(gc); XFree((char *) gc->buf); + XFree((char *) gc->client_state_private); XFree((char *) gc); } @@ -557,28 +899,15 @@ void GLX_PREFIX(glXSwapBuffers)(Display *dpy, GLXDrawable drawable) { xGLXSwapBuffersReq *req; - GLXContext gc = __glXGetCurrentContext(); + GLXContext gc; GLXContextTag tag; CARD8 opcode; #ifdef GLX_DIRECT_RENDERING - __GLXdisplayPrivate *priv; - __DRIdrawable *pdraw; + __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, NULL ); - priv = __glXInitialize(dpy); - if (priv->driDisplay.private) { - __GLXscreenConfigs *psc = &priv->screenConfigs[gc->screen]; - if (psc && psc->driScreen.private) { - /* - ** getDrawable returning NULL implies that the drawable is - ** not bound to a direct rendering context. - */ - pdraw = (*psc->driScreen.getDrawable)(dpy, drawable, - psc->driScreen.private); - if (pdraw) { - (*pdraw->swapBuffers)(dpy, pdraw->private); - return; - } - } + if ( pdraw != NULL ) { + (*pdraw->swapBuffers)(dpy, pdraw->private); + return; } #endif @@ -591,7 +920,9 @@ ** The calling thread may or may not have a current context. If it ** does, send the context tag so the server can do a flush. */ - if ((dpy == gc->currentDpy) && (drawable == gc->currentDrawable)) { + gc = __glXGetCurrentContext(); + if ((gc != NULL) && (dpy == gc->currentDpy) && + ((drawable == gc->currentDrawable) || (drawable == gc->currentReadable)) ) { tag = gc->currentContextTag; } else { tag = 0; @@ -609,6 +940,7 @@ XFlush(dpy); } + /* ** Return configuration information for the given display, screen and ** visual combination. @@ -616,219 +948,289 @@ int GLX_PREFIX(glXGetConfig)(Display *dpy, XVisualInfo *vis, int attribute, int *value_return) { - __GLXvisualConfig *pConfig; - __GLXscreenConfigs *psc; __GLXdisplayPrivate *priv; - GLint i; - - /* Initialize the extension, if needed */ - priv = __glXInitialize(dpy); - if (!priv) { - /* No extension */ - return GLX_NO_EXTENSION; - } - - /* Check screen number to see if its valid */ - if ((vis->screen < 0) || (vis->screen >= ScreenCount(dpy))) { - return GLX_BAD_SCREEN; - } - - /* Check to see if the GL is supported on this screen */ - psc = &priv->screenConfigs[vis->screen]; - pConfig = psc->configs; - if (!pConfig) { - /* No support for GL on this screen regardless of visual */ - if (attribute == GLX_USE_GL) { - *value_return = GL_FALSE; - return Success; - } - return GLX_BAD_VISUAL; - } + __GLXscreenConfigs *psc; + int status; - /* Lookup attribute after first finding a match on the visual */ - for (i = psc->numConfigs; --i >= 0; pConfig++) { - if (pConfig->vid == vis->visualid) { - switch (attribute) { - case GLX_USE_GL: - *value_return = GL_TRUE; - return Success; - case GLX_BUFFER_SIZE: - *value_return = pConfig->bufferSize; - return Success; - case GLX_RGBA: - *value_return = pConfig->rgba; - return Success; - case GLX_RED_SIZE: - *value_return = pConfig->redSize; - return Success; - case GLX_GREEN_SIZE: - *value_return = pConfig->greenSize; - return Success; - case GLX_BLUE_SIZE: - *value_return = pConfig->blueSize; - return Success; - case GLX_ALPHA_SIZE: - *value_return = pConfig->alphaSize; - return Success; - case GLX_DOUBLEBUFFER: - *value_return = pConfig->doubleBuffer; - return Success; - case GLX_STEREO: - *value_return = pConfig->stereo; - return Success; - case GLX_AUX_BUFFERS: - *value_return = pConfig->auxBuffers; - return Success; - case GLX_DEPTH_SIZE: - *value_return = pConfig->depthSize; - return Success; - case GLX_STENCIL_SIZE: - *value_return = pConfig->stencilSize; - return Success; - case GLX_ACCUM_RED_SIZE: - *value_return = pConfig->accumRedSize; - return Success; - case GLX_ACCUM_GREEN_SIZE: - *value_return = pConfig->accumGreenSize; - return Success; - case GLX_ACCUM_BLUE_SIZE: - *value_return = pConfig->accumBlueSize; - return Success; - case GLX_ACCUM_ALPHA_SIZE: - *value_return = pConfig->accumAlphaSize; - return Success; - case GLX_LEVEL: - *value_return = pConfig->level; - return Success; - case GLX_TRANSPARENT_TYPE_EXT: - *value_return = pConfig->transparentPixel; - return Success; - case GLX_TRANSPARENT_RED_VALUE_EXT: - *value_return = pConfig->transparentRed; - return Success; - case GLX_TRANSPARENT_GREEN_VALUE_EXT: - *value_return = pConfig->transparentGreen; - return Success; - case GLX_TRANSPARENT_BLUE_VALUE_EXT: - *value_return = pConfig->transparentBlue; - return Success; - case GLX_TRANSPARENT_ALPHA_VALUE_EXT: - *value_return = pConfig->transparentAlpha; - return Success; - case GLX_TRANSPARENT_INDEX_VALUE_EXT: - *value_return = pConfig->transparentIndex; - return Success; - case GLX_X_VISUAL_TYPE_EXT: - switch(pConfig->class) { - case TrueColor: - *value_return = GLX_TRUE_COLOR_EXT; break; - case DirectColor: - *value_return = GLX_DIRECT_COLOR_EXT; break; - case PseudoColor: - *value_return = GLX_PSEUDO_COLOR_EXT; break; - case StaticColor: - *value_return = GLX_STATIC_COLOR_EXT; break; - case GrayScale: - *value_return = GLX_GRAY_SCALE_EXT; break; - case StaticGray: - *value_return = GLX_STATIC_GRAY_EXT; break; - } - return Success; - case GLX_VISUAL_CAVEAT_EXT: - *value_return = pConfig->visualRating; - return Success; - default: - return GLX_BAD_ATTRIBUTE; + status = GetGLXPrivScreenConfig( dpy, vis->screen, & priv, & psc ); + if ( status == Success ) { + unsigned i; + + /* Lookup attribute after first finding a match on the visual */ + for ( i = 0 ; i < psc->numConfigs ; i++ ) { + if (psc->configs[i].visualID == vis->visualid) { + return _gl_get_context_mode_data( & psc->configs[i], + attribute, + value_return ); } } + + status = GLX_BAD_VISUAL; } /* ** If we can't find the config for this visual, this visual is not ** supported by the OpenGL implementation on the server. */ - if (attribute == GLX_USE_GL) { + if ( (status == GLX_BAD_VISUAL) && (attribute == GLX_USE_GL) ) { *value_return = GL_FALSE; - return Success; + status = Success; } - return GLX_BAD_VISUAL; + + return status; } /************************************************************************/ -/* -** Penalize for more auxiliary buffers than requested -*/ -static int AuxScore(int minAux, int aux) -{ - return minAux - aux; -} +#define MATCH_DONT_CARE( param ) \ + do { \ + if ( (a-> param != GLX_DONT_CARE) \ + && (a-> param != b-> param) ) { \ + return False; \ + } \ + } while ( 0 ) + +#define MATCH_MINIMUM( param ) \ + do { \ + if ( (a-> param != GLX_DONT_CARE) \ + && (a-> param > b-> param) ) { \ + return False; \ + } \ + } while ( 0 ) + +#define MATCH_EXACT( param ) \ + do { \ + if ( a-> param != b-> param) { \ + return False; \ + } \ + } while ( 0 ) + +/** + * Determine if two GLXFBConfigs are compatible. + * + * \param a Application specified config to test. + * \param b Server specified config to test against \c a. + */ +static Bool +fbconfigs_compatible( const __GLcontextModes * const a, + const __GLcontextModes * const b ) +{ + MATCH_DONT_CARE( doubleBufferMode ); + MATCH_DONT_CARE( visualType ); + MATCH_DONT_CARE( visualRating ); + MATCH_DONT_CARE( xRenderable ); + MATCH_DONT_CARE( fbconfigID ); + MATCH_DONT_CARE( swapMethod ); + + MATCH_MINIMUM( rgbBits ); + MATCH_MINIMUM( numAuxBuffers ); + MATCH_MINIMUM( redBits ); + MATCH_MINIMUM( greenBits ); + MATCH_MINIMUM( blueBits ); + MATCH_MINIMUM( alphaBits ); + MATCH_MINIMUM( depthBits ); + MATCH_MINIMUM( stencilBits ); + MATCH_MINIMUM( accumRedBits ); + MATCH_MINIMUM( accumGreenBits ); + MATCH_MINIMUM( accumBlueBits ); + MATCH_MINIMUM( accumAlphaBits ); + MATCH_MINIMUM( sampleBuffers ); + MATCH_MINIMUM( maxPbufferWidth ); + MATCH_MINIMUM( maxPbufferHeight ); + MATCH_MINIMUM( maxPbufferPixels ); + MATCH_MINIMUM( samples ); + + MATCH_DONT_CARE( stereoMode ); + MATCH_EXACT( level ); + + if ( ((a->drawableType & b->drawableType) == 0) + || ((a->renderType & b->renderType) == 0) ) { + return False; + } + + + /* There is a bug in a few of the XFree86 DDX drivers. They contain + * visuals with a "transparent type" of 0 when they really mean GLX_NONE. + * Technically speaking, it is a bug in the DDX driver, but there is + * enough of an installed base to work around the problem here. In any + * case, 0 is not a valid value of the transparent type, so we'll treat 0 + * from the app as GLX_DONT_CARE. We'll consider GLX_NONE from the app and + * 0 from the server to be a match to maintain backward compatibility with + * the (broken) drivers. + */ + + if ( a->transparentPixel != GLX_DONT_CARE + && a->transparentPixel != 0 ) { + if ( a->transparentPixel == GLX_NONE ) { + if ( b->transparentPixel != GLX_NONE && b->transparentPixel != 0 ) + return False; + } else { + MATCH_EXACT( transparentPixel ); + } + + switch ( a->transparentPixel ) { + case GLX_TRANSPARENT_RGB: + MATCH_DONT_CARE( transparentRed ); + MATCH_DONT_CARE( transparentGreen ); + MATCH_DONT_CARE( transparentBlue ); + MATCH_DONT_CARE( transparentAlpha ); + break; -/* -** If color is desired, give increasing score for amount available. -** Scale this score by a multiplier to make color differences more -** important than other differences. Otherwise give decreasing score for -** amount available. -*/ -static int ColorScore(int minColor, int color) -{ - if (minColor) - return 4 * (color - minColor); - else - return -color; -} + case GLX_TRANSPARENT_INDEX: + MATCH_DONT_CARE( transparentIndex ); + break; -/* -** If accum buffer is desired, give increasing score for amount -** available. Otherwise give decreasing score for amount available. -*/ -static int AccumScore(int minAccum, int accum) -{ - if (minAccum) - return accum - minAccum; - else - return -accum; -} + default: + break; + } + } -/* -** Penalize for indexes larger than requested -*/ -static int IndexScore(int minIndex, int ix) -{ - return minIndex - ix; + return True; } -/* -** If depth buffer is desired, give increasing score for amount -** available. Scale this score by a multiplier to make depth differences -** more important than other non-color differences. Otherwise give -** decreasing score for amount available. -*/ -static int DepthScore(int minDepth, int depth) -{ - if (minDepth) - return 2 * (depth - minDepth); - else - return -depth; -} -/* -** Penalize for stencil buffer larger than requested -*/ -static int StencilScore(int minStencil, int stencil) -{ - return minStencil - stencil; +#define PREFER_LARGER(comp) \ + do { \ + if ( ((*a)-> comp) != ((*b)-> comp) ) { \ + return ((*b)-> comp) - ((*a)-> comp) ; \ + } \ + } while( 0 ) + +#define PREFER_SMALLER(comp) \ + do { \ + if ( ((*a)-> comp) != ((*b)-> comp) ) { \ + return ((*a)-> comp) - ((*b)-> comp) ; \ + } \ + } while( 0 ) + +/** + * Compare two GLXFBConfigs. This function is intended to be used as the + * compare function passed in to qsort. + * + * \returns If \c a is a "better" config, according to the specification of + * SGIX_fbconfig, a number less than zero is returned. If \c b is + * better, then a number greater than zero is return. If both are + * equal, zero is returned. + * \sa qsort, glXChooseVisual, glXChooseFBConfig, glXChooseFBConfigSGIX + */ +static int +fbconfig_compare( const __GLcontextModes * const * const a, + const __GLcontextModes * const * const b ) +{ + /* The order of these comparisons must NOT change. It is defined by + * SGIX_fbconfig, SGIX_pbuffer, and ARB_multisample. + */ + + PREFER_SMALLER( visualSelectGroup ); + + /* The sort order for the visualRating is GLX_NONE, GLX_SLOW, and + * GLX_NON_CONFORMANT_CONFIG. It just so happens that this is the + * numerical sort order of the enums (0x8000, 0x8001, and 0x800D). + */ + PREFER_SMALLER( visualRating ); + + PREFER_SMALLER( rgbBits ); + + if ( ((*a)->doubleBufferMode != (*b)->doubleBufferMode) ) { + /* Prefer single-buffer. + */ + return ( !(*a)->doubleBufferMode ) ? -1 : 1; + } + + PREFER_SMALLER( numAuxBuffers ); + + PREFER_LARGER( redBits ); + PREFER_LARGER( greenBits ); + PREFER_LARGER( blueBits ); + PREFER_LARGER( alphaBits ); + PREFER_LARGER( stencilBits ); + PREFER_LARGER( accumRedBits ); + PREFER_LARGER( accumGreenBits ); + PREFER_LARGER( accumBlueBits ); + PREFER_LARGER( accumAlphaBits ); + + PREFER_SMALLER( sampleBuffers ); + PREFER_SMALLER( samples ); + + PREFER_LARGER( maxPbufferWidth ); + PREFER_LARGER( maxPbufferHeight ); + PREFER_LARGER( maxPbufferPixels ); + + PREFER_LARGER( drawableType ); + PREFER_LARGER( renderType ); + + return 0; } -/* "Logical" xor - like && or ||; would be ^^ */ -#define __GLX_XOR(a,b) (((a) && !(b)) || (!(a) && (b))) -/* Fetch a configuration value */ -#define __GLX_GCONF(attrib) \ - if (GLX_PREFIX(glXGetConfig)(dpy, thisVis, attrib, &val)) { \ - XFree((char *)visualList); \ - return NULL; \ +/** + * Selects and sorts a subset of the supplied configs based on the attributes. + * This function forms to basis of \c glXChooseVisual, \c glXChooseFBConfig, + * and \c glXChooseFBConfigSGIX. + * + * \param configs Array of pointers to possible configs. The elements of + * this array that do not meet the criteria will be set to + * NULL. The remaining elements will be sorted according to + * the various visual / FBConfig selection rules. + * \param num_configs Number of elements in the \c configs array. + * \param attribList Attributes used select from \c configs. This array is + * terminated by a \c None tag. The array can either take + * the form expected by \c glXChooseVisual (where boolean + * tags do not have a value) or by \c glXChooseFBConfig + * (where every tag has a value). + * \param fbconfig_style_tags Selects whether \c attribList is in + * \c glXChooseVisual style or + * \c glXChooseFBConfig style. + * \returns The number of valid elements left in \c configs. + * + * \sa glXChooseVisual, glXChooseFBConfig, glXChooseFBConfigSGIX + */ +static int +choose_visual( __GLcontextModes ** configs, int num_configs, + const int *attribList, GLboolean fbconfig_style_tags ) +{ + __GLcontextModes test_config; + int base; + int i; + + /* This is a fairly direct implementation of the selection method + * described by GLX_SGIX_fbconfig. Start by culling out all the + * configs that are not compatible with the selected parameter + * list. + */ + + __glXInitializeVisualConfigFromTags( & test_config, 512, + (const INT32 *) attribList, + GL_TRUE, fbconfig_style_tags ); + + base = 0; + for ( i = 0 ; i < num_configs ; i++ ) { + if ( fbconfigs_compatible( & test_config, configs[i] ) ) { + configs[ base ] = configs[ i ]; + base++; + } + } + + if ( base == 0 ) { + return 0; } + + if ( base < num_configs ) { + (void) memset( & configs[ base ], 0, + sizeof( void * ) * (num_configs - base) ); + } + + /* After the incompatible configs are removed, the resulting + * list is sorted according to the rules set out in the various + * specifications. + */ + + qsort( configs, base, sizeof( __GLcontextModes * ), + (int (*)(const void*, const void*)) fbconfig_compare ); + return base; +} + + /* @@ -839,312 +1241,40 @@ { XVisualInfo visualTemplate; XVisualInfo *visualList; - XVisualInfo *thisVis; - int count, i, maxscore = 0, maxi, score, val, thisVisRating, maxRating = 0; - - /* - ** Declare and initialize template variables - */ - int bufferSize = 0; - int level = 0; - int rgba = 0; - int doublebuffer = 0; - int stereo = 0; - int auxBuffers = 0; - int redSize = 0; - int greenSize = 0; - int blueSize = 0; - int alphaSize = 0; - int depthSize = 0; - int stencilSize = 0; - int accumRedSize = 0; - int accumGreenSize = 0; - int accumBlueSize = 0; - int accumAlphaSize = 0; - /* for visual_info extension */ - int visualType = 0; - int visualTypeValue = 0; - int transparentPixel = 0; - int transparentPixelValue = GLX_NONE_EXT; - int transparentIndex = 0; - int transparentIndexValue = 0; - int transparentRed = 0; - int transparentRedValue = 0; - int transparentGreen = 0; - int transparentGreenValue = 0; - int transparentBlue = 0; - int transparentBlueValue = 0; - int transparentAlpha = 0; - int transparentAlphaValue = 0; - /* for visual_rating extension */ - int visualRating = 0; - int visualRatingValue = GLX_NONE_EXT; + __GLXdisplayPrivate *priv; + __GLXscreenConfigs *psc; + __GLcontextModes test_config; + const __GLcontextModes *best_config = NULL; + int i; /* ** Get a list of all visuals, return if list is empty */ - visualTemplate.screen = screen; - visualList = XGetVisualInfo(dpy,VisualScreenMask,&visualTemplate,&count); - if (visualList == NULL) + if ( GetGLXPrivScreenConfig( dpy, screen, & priv, & psc ) != Success ) { return None; + } + /* ** Build a template from the defaults and the attribute list ** Free visual list and return if an unexpected token is encountered */ - while (*attribList != None) { - switch (*attribList++) { - case GLX_USE_GL: - break; - case GLX_BUFFER_SIZE: - bufferSize = *attribList++; - break; - case GLX_LEVEL: - level = *attribList++; - break; - case GLX_RGBA: - rgba = 1; - break; - case GLX_DOUBLEBUFFER: - doublebuffer = 1; - break; - case GLX_STEREO: - stereo = 1; - break; - case GLX_AUX_BUFFERS: - auxBuffers = *attribList++; - break; - case GLX_RED_SIZE: - redSize = *attribList++; - break; - case GLX_GREEN_SIZE: - greenSize = *attribList++; - break; - case GLX_BLUE_SIZE: - blueSize = *attribList++; - break; - case GLX_ALPHA_SIZE: - alphaSize = *attribList++; - break; - case GLX_DEPTH_SIZE: - depthSize = *attribList++; - break; - case GLX_STENCIL_SIZE: - stencilSize = *attribList++; - break; - case GLX_ACCUM_RED_SIZE: - accumRedSize = *attribList++; - break; - case GLX_ACCUM_GREEN_SIZE: - accumGreenSize = *attribList++; - break; - case GLX_ACCUM_BLUE_SIZE: - accumBlueSize = *attribList++; - break; - case GLX_ACCUM_ALPHA_SIZE: - accumAlphaSize = *attribList++; - break; - case GLX_X_VISUAL_TYPE_EXT: - visualType = 1; - visualTypeValue = *attribList++; - break; - case GLX_TRANSPARENT_TYPE_EXT: - transparentPixel = 1; - transparentPixelValue = *attribList++; - break; - case GLX_TRANSPARENT_INDEX_VALUE_EXT: - transparentIndex= 1; - transparentIndexValue = *attribList++; - break; - case GLX_TRANSPARENT_RED_VALUE_EXT: - transparentRed = 1; - transparentRedValue = *attribList++; - break; - case GLX_TRANSPARENT_GREEN_VALUE_EXT: - transparentGreen = 1; - transparentGreenValue = *attribList++; - break; - case GLX_TRANSPARENT_BLUE_VALUE_EXT: - transparentBlue = 1; - transparentBlueValue = *attribList++; - break; - case GLX_TRANSPARENT_ALPHA_VALUE_EXT: - transparentAlpha = 1; - transparentAlphaValue = *attribList++; - break; - case GLX_VISUAL_CAVEAT_EXT: - visualRating = 1; - visualRatingValue = *attribList++; - break; - default: - XFree((char *)visualList); - return None; - } - } + __glXInitializeVisualConfigFromTags( & test_config, 512, + (const INT32 *) attribList, + GL_TRUE, GL_FALSE ); /* ** Eliminate visuals that don't meet minimum requirements ** Compute a score for those that do ** Remember which visual, if any, got the highest score */ - maxi = -1; - for (i = 0; i < count; i++) { - score = 0; - thisVis = &visualList[i]; /* NOTE: used by __GLX_GCONF */ - - if (thisVis->class == TrueColor || thisVis->class == PseudoColor) { - /* Bump score by one for TrueColor and PseudoColor visuals. */ - score++; - } - - __GLX_GCONF(GLX_USE_GL); - if (! val) - continue; - __GLX_GCONF(GLX_LEVEL); - if (level != val) - continue; - __GLX_GCONF(GLX_RGBA); - if (__GLX_XOR(rgba, val)) - continue; - __GLX_GCONF(GLX_DOUBLEBUFFER); - if (__GLX_XOR(doublebuffer, val)) - continue; - __GLX_GCONF(GLX_STEREO); - if (__GLX_XOR(stereo, val)) - continue; - __GLX_GCONF(GLX_AUX_BUFFERS); - if (auxBuffers > val) - continue; - else - score += AuxScore(auxBuffers, val); - if (transparentPixel) { - __GLX_GCONF(GLX_TRANSPARENT_TYPE_EXT); - if (transparentPixelValue != val) - continue; - if (transparentPixelValue == GLX_TRANSPARENT_TYPE_EXT) { - if (rgba) { - __GLX_GCONF(GLX_TRANSPARENT_RGB_EXT); - if (transparentRed) { - __GLX_GCONF(GLX_TRANSPARENT_RED_VALUE_EXT); - if (transparentRedValue != val) - continue; - } - if (transparentGreen) { - __GLX_GCONF(GLX_TRANSPARENT_GREEN_VALUE_EXT); - if (transparentGreenValue != val) - continue; - } - if (transparentBlue) { - __GLX_GCONF(GLX_TRANSPARENT_BLUE_VALUE_EXT); - if (transparentBlueValue != val) - continue; - } - /* Transparent Alpha ignored for now */ - } else { - __GLX_GCONF(GLX_TRANSPARENT_INDEX_EXT); - if (transparentIndex) { - __GLX_GCONF(GLX_TRANSPARENT_INDEX_VALUE_EXT); - if (transparentIndexValue != val) - continue; - } - } - } - } - if (visualType) { - __GLX_GCONF(GLX_X_VISUAL_TYPE_EXT); - if (visualTypeValue != val) - continue; - } else if (rgba) { - /* If the extension isn't specified then insure that rgba - ** and ci return the usual visual types. - */ - if (!(thisVis->class == TrueColor || thisVis->class == DirectColor)) - continue; - } else { - if (!(thisVis->class == PseudoColor - || thisVis->class == StaticColor)) - continue; - } - - __GLX_GCONF(GLX_VISUAL_CAVEAT_EXT); - /** - ** Unrated visuals are given rating GLX_NONE. - */ - thisVisRating = val ? val : GLX_NONE_EXT; - if (visualRating && (visualRatingValue != val)) - continue; - if (rgba) { - __GLX_GCONF(GLX_RED_SIZE); - if (redSize > val) - continue; - else - score += ColorScore(redSize,val); - __GLX_GCONF(GLX_GREEN_SIZE); - if (greenSize > val) - continue; - else - score += ColorScore(greenSize, val); - __GLX_GCONF(GLX_BLUE_SIZE); - if (blueSize > val) - continue; - else - score += ColorScore(blueSize, val); - __GLX_GCONF(GLX_ALPHA_SIZE); - if (alphaSize > val) - continue; - else - score += ColorScore(alphaSize, val); - __GLX_GCONF(GLX_ACCUM_RED_SIZE); - if (accumRedSize > val) - continue; - else - score += AccumScore(accumRedSize, val); - __GLX_GCONF(GLX_ACCUM_GREEN_SIZE); - if (accumGreenSize > val) - continue; - else - score += AccumScore(accumGreenSize, val); - __GLX_GCONF(GLX_ACCUM_BLUE_SIZE); - if (accumBlueSize > val) - continue; - else - score += AccumScore(accumBlueSize, val); - __GLX_GCONF(GLX_ACCUM_ALPHA_SIZE); - if (accumAlphaSize > val) - continue; - else - score += AccumScore(accumAlphaSize, val); - } else { - __GLX_GCONF(GLX_BUFFER_SIZE); - if (bufferSize > val) - continue; - else - score += IndexScore(bufferSize, val); - } - __GLX_GCONF(GLX_DEPTH_SIZE); - if (depthSize > val) - continue; - else - score += DepthScore(depthSize, val); - __GLX_GCONF(GLX_STENCIL_SIZE); - if (stencilSize > val) - continue; - else - score += StencilScore(stencilSize, val); - - /* - ** The visual_rating extension indicates that a NONE visual - ** is always returned in preference to a SLOW one. - ** Note that enum values are in increasing order (NONE < SLOW). - */ - if (maxi < 0 || maxRating > thisVisRating) { - maxi = i; - maxscore = score; - maxRating = thisVisRating; - } else { - if (score > maxscore) { - maxi = i; - maxscore = score; + for (i = 0; i < psc->numConfigs; i++) { + if ( fbconfigs_compatible( & test_config, &psc->configs[i] ) ) { + const __GLcontextModes * const temp = &psc->configs[i]; + + if ( (best_config == None) + || (fbconfig_compare( &temp, &best_config ) > 0) ) { + best_config = &psc->configs[i]; } } } @@ -1154,23 +1284,23 @@ ** Otherwise, create an XVisualInfo list with just the selected X visual ** and return this after freeing the original list */ - if (maxi < 0) { - XFree((char *)visualList); - return None; - } else { - visualTemplate.visualid = visualList[maxi].visualid; - XFree((char *)visualList); - visualList = XGetVisualInfo(dpy,VisualScreenMask|VisualIDMask,&visualTemplate,&count); - return visualList; + visualList = NULL; + if (best_config != NULL) { + visualTemplate.screen = screen; + visualTemplate.visualid = best_config->visualID; + visualList = XGetVisualInfo( dpy, VisualScreenMask|VisualIDMask, + &visualTemplate, &i ); } + + return visualList; } /* ** Query the Server GLX string and cache it in the display private. ** This routine will allocate the necessay space for the string. */ -static char *QueryServerString( Display *dpy, int opcode, - int screen, int name ) +char *__glXInternalQueryServerString( Display *dpy, int opcode, + int screen, int name ) { xGLXQueryServerStringReq *req; xGLXQueryServerStringReply reply; @@ -1204,7 +1334,7 @@ #define SEPARATOR " " -static char *combine_strings( const char *cext_string, const char *sext_string ) +char *__glXCombineExtensionStrings( const char *cext_string, const char *sext_string ) { int clen, slen; char *combo_string, *token, *s1; @@ -1259,40 +1389,29 @@ const char *GLX_PREFIX(glXQueryExtensionsString)( Display *dpy, int screen ) { - __GLXvisualConfig *pConfig; __GLXscreenConfigs *psc; __GLXdisplayPrivate *priv; - /* Initialize the extension, if needed . This has the added value - of initializing/allocating the display private */ - priv = __glXInitialize(dpy); - if (!priv) { - return NULL; - } - - /* Check screen number to see if its valid */ - if ((screen < 0) || (screen >= ScreenCount(dpy))) { + if ( GetGLXPrivScreenConfig( dpy, screen, & priv, & psc ) != Success ) { return NULL; } - /* Check to see if the GL is supported on this screen */ - psc = &priv->screenConfigs[screen]; - pConfig = psc->configs; - if (!pConfig) { - /* No support for GL on this screen regardless of visual */ - return NULL; - } - if (!psc->effectiveGLXexts) { if (!psc->serverGLXexts) { - psc->serverGLXexts = QueryServerString(dpy, priv->majorOpcode, + psc->serverGLXexts = __glXInternalQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS); } - psc->effectiveGLXexts = combine_strings(__glXGLXClientExtensions, - psc->serverGLXexts); - } - return psc->effectiveGLXexts; + __glXCalculateUsableExtensions(psc, +#ifdef GLX_DIRECT_RENDERING + (priv->driDisplay.private != NULL), +#else + GL_FALSE, +#endif + priv->minorVersion); + } + + return psc->effectiveGLXexts; } const char *GLX_PREFIX(glXGetClientString)( Display *dpy, int name ) @@ -1303,7 +1422,7 @@ case GLX_VERSION: return (__glXGLXClientVersion); case GLX_EXTENSIONS: - return (__glXGLXClientExtensions); + return (__glXGetClientExtensions()); default: return NULL; } @@ -1311,50 +1430,33 @@ const char *GLX_PREFIX(glXQueryServerString)( Display *dpy, int screen, int name ) { - __GLXvisualConfig *pConfig; __GLXscreenConfigs *psc; __GLXdisplayPrivate *priv; - /* Initialize the extension, if needed . This has the added value - of initializing/allocating the display private */ - priv = __glXInitialize(dpy); - if (!priv) { - /* No extension */ - return NULL; - } - /* Check screen number to see if its valid */ - if ((screen < 0) || (screen >= ScreenCount(dpy))) { + if ( GetGLXPrivScreenConfig( dpy, screen, & priv, & psc ) != Success ) { return NULL; } - /* Check to see if the GL is supported on this screen */ - psc = &priv->screenConfigs[screen]; - pConfig = psc->configs; - if (!pConfig) { - /* No support for GL on this screen regardless of visual */ - return NULL; - } - switch(name) { case GLX_VENDOR: if (!priv->serverGLXvendor) { priv->serverGLXvendor = - QueryServerString(dpy, priv->majorOpcode, + __glXInternalQueryServerString(dpy, priv->majorOpcode, screen, GLX_VENDOR); } return(priv->serverGLXvendor); case GLX_VERSION: if (!priv->serverGLXversion) { priv->serverGLXversion = - QueryServerString(dpy, priv->majorOpcode, + __glXInternalQueryServerString(dpy, priv->majorOpcode, screen, GLX_VERSION); } return(priv->serverGLXversion); case GLX_EXTENSIONS: if (!psc->serverGLXexts) { psc->serverGLXexts = - QueryServerString(dpy, priv->majorOpcode, + __glXInternalQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS); } return(psc->serverGLXexts); @@ -1385,11 +1487,10 @@ SyncHandle(); } -/************************************************************************/ + /* -** EXT_import_context entry points +** EXT_import_context */ -/************************************************************************/ Display *glXGetCurrentDisplay(void) { @@ -1398,14 +1499,8 @@ return gc->currentDpy; } - -Display *glXGetCurrentDisplayEXT(void) -{ - GLXContext gc = __glXGetCurrentContext(); - if (NULL == gc) return NULL; - return gc->currentDpy; -} - +GLX_ALIAS(Display *, glXGetCurrentDisplayEXT, (void), (), + glXGetCurrentDisplay) static int __glXQueryContextInfo(Display *dpy, GLXContext ctx) { @@ -1464,6 +1559,9 @@ case GLX_SCREEN_EXT: ctx->screen = *pProp++; break; + case GLX_FBCONFIG_ID_SGIX: + ctx->fbconfigID = *pProp++; + break; default: pProp++; continue; @@ -1498,6 +1596,9 @@ case GLX_SCREEN_EXT: *value = (int)(ctx->screen); break; + case GLX_FBCONFIG_ID_SGIX: + *value = (int)(ctx->fbconfigID); + break; default: return GLX_BAD_ATTRIBUTE; } @@ -1520,7 +1621,7 @@ return NULL; } - ctx = CreateContext(dpy, NULL, NULL, GL_FALSE, contextID); + ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID, False, 0); if (NULL != ctx) { if (Success != __glXQueryContextInfo(dpy, ctx)) { return NULL; @@ -1542,22 +1643,31 @@ GLXFBConfig *GLX_PREFIX(glXChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems) { - (void) dpy; - (void) screen; - (void) attribList; - (void) nitems; - return 0; + __GLcontextModes ** config_list; + int list_size; + + + config_list = (__GLcontextModes **) + GLX_PREFIX(glXGetFBConfigs)( dpy, screen, & list_size ); + + if ( (config_list != NULL) && (list_size > 0) ) { + list_size = choose_visual( config_list, list_size, attribList, + GL_TRUE ); + if ( list_size == 0 ) { + XFree( config_list ); + config_list = NULL; + } + } + + *nitems = list_size; + return (GLXFBConfig *) config_list; } -GLXContext GLX_PREFIX(glXCreateNewContext)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct) +GLXContext GLX_PREFIX(glXCreateNewContext)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool allowDirect) { - (void) dpy; - (void) config; - (void) renderType; - (void) shareList; - (void) direct; - return 0; + return CreateContext( dpy, NULL, (__GLcontextModes *) config, shareList, + allowDirect, None, True, renderType ); } @@ -1611,29 +1721,57 @@ } -GLXDrawable glXGetCurrentReadDrawable(void) +GLXDrawable GLX_PREFIX(glXGetCurrentReadDrawable)(void) { GLXContext gc = __glXGetCurrentContext(); - return gc->currentDrawable; + return gc->currentReadable; } GLXFBConfig *GLX_PREFIX(glXGetFBConfigs)(Display *dpy, int screen, int *nelements) { - (void) dpy; - (void) screen; - (void) nelements; - return 0; + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + __GLcontextModes ** config = NULL; + int i; + + if ( (priv->screenConfigs != NULL) + && (screen >= 0) && (screen <= ScreenCount(dpy)) + && (priv->screenConfigs[screen].numConfigs > 0) + && (priv->screenConfigs[screen].configs->fbconfigID != ((XID)-1)) ) { + config = (__GLcontextModes **) Xmalloc( sizeof(__GLcontextModes *) + * priv->screenConfigs[screen].numConfigs ); + if ( config != NULL ) { + *nelements = priv->screenConfigs[screen].numConfigs; + for ( i = 0 ; i < *nelements ; i++ ) { + config[i] = & priv->screenConfigs[screen].configs[i]; + } + } + } + return (GLXFBConfig *) config; } int GLX_PREFIX(glXGetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value) { - (void) dpy; - (void) config; - (void) attribute; - (void) value; - return 0; + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + __GLcontextModes * fbconfig = (__GLcontextModes *) config; + const int screen_count = ScreenCount(dpy); + int i; + + + if ( priv->screenConfigs != NULL ) { + for ( i = 0 ; i < screen_count ; i++ ) { + const int numConfigs = priv->screenConfigs[i].numConfigs; + if ( ( numConfigs > 0) + && (priv->screenConfigs[i].configs->fbconfigID != ((XID)-1)) + && (fbconfig >= & priv->screenConfigs[i].configs[0]) + && (fbconfig < & priv->screenConfigs[i].configs[numConfigs]) ) { + return _gl_get_context_mode_data(fbconfig, attribute, value); + } + } + } + + return GLXBadFBConfig; } @@ -1647,19 +1785,15 @@ XVisualInfo *GLX_PREFIX(glXGetVisualFromFBConfig)(Display *dpy, GLXFBConfig config) { - (void) dpy; - (void) config; - return 0; -} - + XVisualInfo visualTemplate; + __GLcontextModes * fbconfig = (__GLcontextModes *) config; + int count; -Bool GLX_PREFIX(glXMakeContextCurrent)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) -{ - (void) dpy; - (void) draw; - (void) read; - (void) ctx; - return 0; + /* + ** Get a list of all visuals, return if list is empty + */ + visualTemplate.visualid = fbconfig->visualID; + return XGetVisualInfo(dpy,VisualIDMask,&visualTemplate,&count); } @@ -1691,48 +1825,301 @@ /* -** GLX_SGIS_make_current_read +** GLX_SGI_make_current_read */ -Bool GLX_PREFIX(glXMakeCurrentReadSGI)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) -{ - (void) dpy; - (void) draw; - (void) read; - (void) ctx; - return False; -} -GLXDrawable glXGetCurrentReadDrawableSGI(void) +GLX_ALIAS(GLXDrawable, glXGetCurrentReadDrawableSGI, (void), (), + glXGetCurrentReadDrawable) + + +/* +** GLX_SGI_swap_control +*/ +int GLX_PREFIX(glXSwapIntervalSGI)(int interval) { + xGLXVendorPrivateReq *req; + GLXContext gc = __glXGetCurrentContext(); + Display * dpy; + CARD32 * interval_ptr; + CARD8 opcode; + + if ( gc == NULL ) { + return GLX_BAD_CONTEXT; + } + + if ( interval <= 0 ) { + return GLX_BAD_VALUE; + } + +#ifdef GLX_DIRECT_RENDERING + if ( gc->isDirect ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + __DRIdrawable * const pdraw = GetDRIDrawable( gc->currentDpy, + gc->currentDrawable, + NULL ); + if ( __glXExtensionBitIsEnabled( psc, SGI_swap_control_bit ) + && (pdraw != NULL) ) { + pdraw->swap_interval = interval; + return 0; + } + else { + return GLX_BAD_CONTEXT; + } + } +#endif + dpy = gc->currentDpy; + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return 0; + } + + /* Send the glXSwapIntervalSGI request */ + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate,sizeof(CARD32),req); + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivate; + req->vendorCode = X_GLXvop_SwapIntervalSGI; + req->contextTag = gc->currentContextTag; + + interval_ptr = (CARD32 *) req + 1; + *interval_ptr = interval; + + UnlockDisplay(dpy); + SyncHandle(); + XFlush(dpy); + return 0; } /* -** GLX_SGI_swap_control +** GLX_MESA_swap_control */ -int GLX_PREFIX(glXSwapIntervalSGI)(int interval) +GLint GLX_PREFIX(glXSwapIntervalMESA)(unsigned interval) { +#ifdef GLX_DIRECT_RENDERING + GLXContext gc = __glXGetCurrentContext(); + + if ( interval < 0 ) { + return GLX_BAD_VALUE; + } + + if ( (gc != NULL) && gc->isDirect ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + + if ( (psc != NULL) && (psc->driScreen.private != NULL) + && __glXExtensionBitIsEnabled( psc, MESA_swap_control_bit ) ) { + __DRIdrawable * const pdraw = + (*psc->driScreen.getDrawable)(gc->currentDpy, + gc->currentDrawable, + psc->driScreen.private); + if ( pdraw != NULL ) { + pdraw->swap_interval = interval; + return 0; + } + } + } +#else (void) interval; +#endif + + return GLX_BAD_CONTEXT; +} + +GLint GLX_PREFIX(glXGetSwapIntervalMESA)( void ) +{ +#ifdef GLX_DIRECT_RENDERING + GLXContext gc = __glXGetCurrentContext(); + + if ( (gc != NULL) && gc->isDirect ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + + if ( (psc != NULL) && (psc->driScreen.private != NULL) + && __glXExtensionBitIsEnabled( psc, MESA_swap_control_bit ) ) { + __DRIdrawable * const pdraw = + (*psc->driScreen.getDrawable)(gc->currentDpy, + gc->currentDrawable, + psc->driScreen.private); + if ( pdraw != NULL ) { + return pdraw->swap_interval; + } + } + } +#endif + return 0; } /* +** GLX_MESA_swap_frame_usage +*/ + +GLint GLX_PREFIX(glXBeginFrameTrackingMESA)(Display *dpy, GLXDrawable drawable) +{ + int status = GLX_BAD_CONTEXT; +#ifdef GLX_DIRECT_RENDERING + int screen; + __DRIdrawable * const pdraw = GetDRIDrawable(dpy, drawable, & screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + + if ( (pdraw != NULL) && (pdraw->frameTracking != NULL) + && __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) { + status = pdraw->frameTracking( dpy, pdraw->private, GL_TRUE ); + } +#else + (void) dpy; + (void) drawable; +#endif + return status; +} + + +GLint GLX_PREFIX(glXEndFrameTrackingMESA)(Display *dpy, GLXDrawable drawable) +{ + int status = GLX_BAD_CONTEXT; +#ifdef GLX_DIRECT_RENDERING + int screen; + __DRIdrawable * const pdraw = GetDRIDrawable(dpy, drawable, & screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + + if ( (pdraw != NULL) && (pdraw->frameTracking != NULL) + && __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) { + status = pdraw->frameTracking( dpy, pdraw->private, GL_FALSE ); + } +#else + (void) dpy; + (void) drawable; +#endif + return status; +} + + +GLint GLX_PREFIX(glXGetFrameUsageMESA)(Display *dpy, GLXDrawable drawable, + GLfloat *usage) +{ + int status = GLX_BAD_CONTEXT; +#ifdef GLX_DIRECT_RENDERING + int screen; + __DRIdrawable * const pdraw = GetDRIDrawable(dpy, drawable, & screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + + if ( (pdraw != NULL ) && (pdraw->queryFrameTracking != NULL) + && __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) { + int64_t sbc, missedFrames; + float lastMissedUsage; + + status = pdraw->queryFrameTracking( dpy, pdraw->private, &sbc, + &missedFrames, &lastMissedUsage, + usage ); + } +#else + (void) dpy; + (void) drawable; + (void) usage; +#endif + return status; +} + + +GLint GLX_PREFIX(glXQueryFrameTrackingMESA)(Display *dpy, GLXDrawable drawable, + int64_t *sbc, int64_t *missedFrames, + GLfloat *lastMissedUsage) +{ + int status = GLX_BAD_CONTEXT; +#ifdef GLX_DIRECT_RENDERING + int screen; + __DRIdrawable * const pdraw = GetDRIDrawable(dpy, drawable, & screen); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); + + if ( (pdraw != NULL ) && (pdraw->queryFrameTracking != NULL) + && __glXExtensionBitIsEnabled( psc, MESA_swap_frame_usage_bit ) ) { + float usage; + + status = pdraw->queryFrameTracking( dpy, pdraw->private, sbc, + missedFrames, lastMissedUsage, + & usage ); + } +#else + (void) dpy; + (void) drawable; + (void) sbc; + (void) missedFrames; + (void) lastMissedUsage; +#endif + return status; +} + + +/* ** GLX_SGI_video_sync */ int GLX_PREFIX(glXGetVideoSyncSGI)(unsigned int *count) { - (void) count; - return 0; + /* FIXME: Looking at the GLX_SGI_video_sync spec in the extension registry, + * FIXME: there should be a GLX encoding for this call. I can find no + * FIXME: documentation for the GLX encoding. + */ +#ifdef GLX_DIRECT_RENDERING + GLXContext gc = __glXGetCurrentContext(); + + + if ( (gc != NULL) && gc->isDirect ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + if ( __glXExtensionBitIsEnabled( psc, SGI_video_sync_bit ) + && psc->driScreen.private && psc->driScreen.getMSC) { + int ret; + int64_t temp; + + ret = psc->driScreen.getMSC( psc->driScreen.private, & temp ); + *count = (unsigned) temp; + return (ret == 0) ? 0 : GLX_BAD_CONTEXT; + } + } +#else + (void) count; +#endif + return GLX_BAD_CONTEXT; } int GLX_PREFIX(glXWaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count) { - (void) divisor; - (void) remainder; +#ifdef GLX_DIRECT_RENDERING + GLXContext gc = __glXGetCurrentContext(); + + if ( divisor <= 0 || remainder < 0 ) + return GLX_BAD_VALUE; + + if ( (gc != NULL) && gc->isDirect ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, + gc->screen ); + if ( __glXExtensionBitIsEnabled( psc, SGI_video_sync_bit ) + && psc->driScreen.private ) { + __DRIdrawable * const pdraw = + (*psc->driScreen.getDrawable)(gc->currentDpy, + gc->currentDrawable, + psc->driScreen.private); + if ( (pdraw != NULL) && (pdraw->waitForMSC != NULL) ) { + int ret; + int64_t msc; + int64_t sbc; + + ret = (*pdraw->waitForMSC)( gc->currentDpy, pdraw->private, + 0, divisor, remainder, + & msc, & sbc ); + *count = (unsigned) msc; + return (ret == 0) ? 0 : GLX_BAD_CONTEXT; + } + } + } +#else (void) count; - return 0; +#endif + return GLX_BAD_CONTEXT; } @@ -1763,55 +2150,104 @@ /* ** GLX_SGIX_fbconfig +** Many of these functions are aliased to GLX 1.3 entry points in the +** GLX_functions table. */ -int GLX_PREFIX(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value) -{ - (void) dpy; - (void) config; - (void) attribute; - (void) value; - return 0; -} -GLXFBConfigSGIX * GLX_PREFIX(glXChooseFBConfigSGIX)(Display *dpy, int screen, int *attrib_list, int *nelements) -{ - (void) dpy; - (void) screen; - (void) attrib_list; - (void) nelements; - return 0; -} +GLX_ALIAS(int, glXGetFBConfigAttribSGIX, + (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value), + (dpy, config, attribute, value), + glXGetFBConfigAttrib) + +GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX, + (Display *dpy, int screen, int *attrib_list, int *nelements), + (dpy, screen, attrib_list, nelements), + glXChooseFBConfig) + +GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX, + (Display * dpy, GLXFBConfigSGIX config), + (dpy, config), + glXGetVisualFromFBConfig) GLXPixmap GLX_PREFIX(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap) { - (void) dpy; - (void) config; - (void) pixmap; - return 0; -} + xGLXVendorPrivateReq *vpreq; + xGLXCreateGLXPixmapWithConfigSGIXReq *req; + GLXPixmap xid = None; + CARD8 opcode; + const __GLcontextModes * const fbconfig = (__GLcontextModes *) config; + __GLXscreenConfigs * psc; -GLXContext GLX_PREFIX(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct) -{ - (void) dpy; - (void) config; - (void) render_type; - (void) share_list; - (void) direct; - return 0; + + if ( (dpy == NULL) || (config == NULL) ) { + return None; + } + + psc = GetGLXScreenConfigs( dpy, fbconfig->screen ); + if ( (psc != NULL) + && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit ) ) { + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return None; + } + + /* Send the glXCreateGLXPixmapWithConfigSGIX request */ + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, + sz_xGLXCreateGLXPixmapWithConfigSGIXReq-sz_xGLXVendorPrivateReq,vpreq); + req = (xGLXCreateGLXPixmapWithConfigSGIXReq *)vpreq; + req->reqType = opcode; + req->vendorCode = X_GLXvop_CreateGLXPixmapWithConfigSGIX; + req->screen = fbconfig->screen; + req->fbconfig = fbconfig->fbconfigID; + req->pixmap = pixmap; + req->glxpixmap = xid = XAllocID(dpy); + UnlockDisplay(dpy); + SyncHandle(); + } + + return xid; } -XVisualInfo * GLX_PREFIX(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config) +GLXContext GLX_PREFIX(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, int renderType, GLXContext shareList, Bool allowDirect) { - (void) dpy; - (void) config; - return NULL; + GLXContext gc = NULL; + const __GLcontextModes * const fbconfig = (__GLcontextModes *) config; + __GLXscreenConfigs * psc; + + + if ( (dpy == NULL) || (config == NULL) ) { + return None; + } + + psc = GetGLXScreenConfigs( dpy, fbconfig->screen ); + if ( (psc != NULL) + && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit ) ) { + gc = CreateContext( dpy, NULL, (__GLcontextModes *) config, shareList, + allowDirect, None, False, renderType ); + } + + return gc; } + GLXFBConfigSGIX GLX_PREFIX(glXGetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis) { - (void) dpy; - (void) vis; - return 0; + __GLXdisplayPrivate *priv; + __GLXscreenConfigs *psc; + int i; + + if ( (GetGLXPrivScreenConfig( dpy, vis->screen, & priv, & psc ) != Success) + && __glXExtensionBitIsEnabled( psc, SGIX_fbconfig_bit ) + && (psc->configs[0].fbconfigID != ((XID)-1)) ) { + for ( i = 0 ; i < psc->numConfigs ; i++ ) { + if ( psc->configs[i].visualID == vis->visualid ) { + return (GLXFBConfigSGIX) & (psc->configs[i]); + } + } + } + + return NULL; } @@ -1984,6 +2420,314 @@ } +/* +** GLX_OML_sync_control +*/ +Bool GLX_PREFIX(glXGetSyncValuesOML)(Display *dpy, GLXDrawable drawable, + int64_t *ust, int64_t *msc, int64_t *sbc) +{ +#ifdef GLX_DIRECT_RENDERING + __GLXdisplayPrivate * const priv = __glXInitialize(dpy); + + if ( priv != NULL ) { + int i; + __DRIdrawable * const pdraw = GetDRIDrawable( dpy, drawable, & i ); + __GLXscreenConfigs * const psc = &priv->screenConfigs[i]; + + assert( (pdraw == NULL) || (i != -1) ); + return ( (pdraw && pdraw->getSBC && psc->driScreen.getMSC) + && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) + && ((*psc->driScreen.getMSC)( psc->driScreen.private, msc ) == 0) + && ((*pdraw->getSBC)( dpy, psc->driScreen.private, sbc ) == 0) + && (__glXGetUST( ust ) == 0) ); + } +#else + (void) dpy; + (void) drawable; + (void) ust; + (void) msc; + (void) sbc; +#endif + return False; +} + + +/** + * Determine the refresh rate of the specified drawable and display. + * + * \param dpy Display whose refresh rate is to be determined. + * \param drawable Drawable whose refresh rate is to be determined. + * \param numerator Numerator of the refresh rate. + * \param demoninator Denominator of the refresh rate. + * \return If the refresh rate for the specified display and drawable could + * be calculated, True is returned. Otherwise False is returned. + * + * \note This function is implemented entirely client-side. A lot of other + * functionality is required to export GLX_OML_sync_control, so on + * XFree86 this function can be called for direct-rendering contexts + * when GLX_OML_sync_control appears in the client extension string. + */ + +Bool GLX_PREFIX(glXGetMscRateOML)(Display * dpy, GLXDrawable drawable, + int32_t * numerator, int32_t * denominator) +{ +#if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE ) + __GLXdisplayPrivate * const priv = __glXInitialize(dpy); + + + if ( priv != NULL ) { + XF86VidModeModeLine mode_line; + int dot_clock; + int screen_num; + int i; + + + GetDRIDrawable( dpy, drawable, & screen_num ); + if ( (screen_num != -1) + && XF86VidModeQueryVersion( dpy, & i, & i ) + && XF86VidModeGetModeLine( dpy, screen_num, & dot_clock, + & mode_line ) ) { + unsigned n = dot_clock * 1000; + unsigned d = mode_line.vtotal * mode_line.htotal; + +# define V_INTERLACE 0x010 +# define V_DBLSCAN 0x020 + + if ( (mode_line.flags & V_INTERLACE) ) { + n *= 2; + } + else if ( (mode_line.flags & V_DBLSCAN) ) { + d *= 2; + } + + /* The OML_sync_control spec requires that if the refresh rate is a + * whole number, that the returned numerator be equal to the refresh + * rate and the denominator be 1. + */ + + if ( (n % d) == 0 ) { + n /= d; + d = 1; + } + else { + static const unsigned f[] = { 13, 11, 7, 5, 3, 2, 0 }; + + + /* This is a poor man's way to reduce a fraction. It's far from + * perfect, but it will work well enough for this situation. + */ + + for ( i = 0 ; f[i] != 0 ; i++ ) { + while ( ((n % f[i]) == 0) && ((d % f[i]) == 0) ) { + d /= f[i]; + n /= f[i]; + } + } + } + + *numerator = n; + *denominator = d; + + (void) drawable; + return True; + } + } +#else + (void) dpy; + (void) drawable; + (void) numerator; + (void) denominator; +#endif + return False; +} + + +int64_t GLX_PREFIX(glXSwapBuffersMscOML)(Display *dpy, GLXDrawable drawable, + int64_t target_msc, + int64_t divisor, int64_t remainder) +{ +#ifdef GLX_DIRECT_RENDERING + int screen; + __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen ); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); + + /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE + * error", but it also says "It [glXSwapBuffersMscOML] will return a value + * of -1 if the function failed because of errors detected in the input + * parameters" + */ + if ( divisor < 0 || remainder < 0 || target_msc < 0 ) + return -1; + if ( divisor > 0 && remainder >= divisor ) + return -1; + + if ( (pdraw != NULL) && (pdraw->swapBuffersMSC != NULL) + && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) { + return (*pdraw->swapBuffersMSC)(dpy, pdraw->private, target_msc, + divisor, remainder); + } +#else + (void) dpy; + (void) drawable; + (void) target_msc; + (void) divisor; + (void) remainder; +#endif + return 0; +} + + +Bool GLX_PREFIX(glXWaitForMscOML)(Display * dpy, GLXDrawable drawable, + int64_t target_msc, + int64_t divisor, int64_t remainder, + int64_t *ust, int64_t *msc, int64_t *sbc) +{ +#ifdef GLX_DIRECT_RENDERING + int screen; + __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen ); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); + int ret; + + /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE + * error", but the return type in the spec is Bool. + */ + if ( divisor < 0 || remainder < 0 || target_msc < 0 ) + return False; + if ( divisor > 0 && remainder >= divisor ) + return False; + + if ( (pdraw != NULL) && (pdraw->waitForMSC != NULL) + && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) { + ret = (*pdraw->waitForMSC)( dpy, pdraw->private, target_msc, + divisor, remainder, msc, sbc ); + + /* __glXGetUST returns zero on success and non-zero on failure. + * This function returns True on success and False on failure. + */ + return ( (ret == 0) && (__glXGetUST( ust ) == 0) ); + } +#else + (void) dpy; + (void) drawable; + (void) target_msc; + (void) divisor; + (void) remainder; + (void) ust; + (void) msc; + (void) sbc; +#endif + return False; +} + + +Bool GLX_PREFIX(glXWaitForSbcOML)(Display * dpy, GLXDrawable drawable, + int64_t target_sbc, + int64_t *ust, int64_t *msc, int64_t *sbc ) +{ +#ifdef GLX_DIRECT_RENDERING + int screen; + __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen ); + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); + int ret; + + /* The OML_sync_control spec says this should "generate a GLX_BAD_VALUE + * error", but the return type in the spec is Bool. + */ + if ( target_sbc < 0 ) + return False; + + if ( (pdraw != NULL) && (pdraw->waitForSBC != NULL) + && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit )) { + ret = (*pdraw->waitForSBC)( dpy, pdraw->private, target_sbc, msc, sbc ); + + /* __glXGetUST returns zero on success and non-zero on failure. + * This function returns True on success and False on failure. + */ + return( (ret == 0) && (__glXGetUST( ust ) == 0) ); + } +#else + (void) dpy; + (void) drawable; + (void) target_sbc; + (void) ust; + (void) msc; + (void) sbc; +#endif + return False; +} + + +/* +** GLX_MESA_allocate_memory +*/ + +void *GLX_PREFIX(glXAllocateMemoryMESA)(Display *dpy, int scrn, + size_t size, + float readFreq, + float writeFreq, + float priority) +{ +#ifdef GLX_DIRECT_RENDERING + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn ); + + if ( __glXExtensionBitIsEnabled( psc, MESA_allocate_memory_bit ) ) { + if (psc && psc->driScreen.private && psc->driScreen.allocateMemory) { + return (*psc->driScreen.allocateMemory)( dpy, scrn, size, + readFreq, writeFreq, + priority ); + } + } +#else + (void) dpy; + (void) scrn; + (void) size; + (void) readFreq; + (void) writeFreq; + (void) priority; +#endif /* GLX_DIRECT_RENDERING */ + + return NULL; +} + + +void GLX_PREFIX(glXFreeMemoryMESA)(Display *dpy, int scrn, void *pointer) +{ +#ifdef GLX_DIRECT_RENDERING + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn ); + + if ( __glXExtensionBitIsEnabled( psc, MESA_allocate_memory_bit ) ) { + if (psc && psc->driScreen.private && psc->driScreen.freeMemory) { + (*psc->driScreen.freeMemory)( dpy, scrn, pointer ); + } + } +#else + (void) dpy; + (void) scrn; + (void) pointer; +#endif /* GLX_DIRECT_RENDERING */ +} + + +GLuint GLX_PREFIX(glXGetMemoryOffsetMESA)( Display *dpy, int scrn, + const void *pointer ) +{ +#ifdef GLX_DIRECT_RENDERING + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn ); + + if ( __glXExtensionBitIsEnabled( psc, MESA_allocate_memory_bit ) ) { + if (psc && psc->driScreen.private && psc->driScreen.memoryOffset) { + return (*psc->driScreen.memoryOffset)( dpy, scrn, pointer ); + } + } +#else + (void) dpy; + (void) scrn; + (void) pointer; +#endif /* GLX_DIRECT_RENDERING */ + + return ~0L; +} + /* ** Mesa extension stubs. These will help reduce portability problems. @@ -2050,237 +2794,193 @@ struct name_address_pair { const char *Name; GLvoid *Address; - struct name_address_pair *Next; }; -static struct name_address_pair GLX_functions[] = { +#define GLX_FUNCTION(f) { # f, (GLvoid *) f } +#define GLX_FUNCTION2(n,f) { # n, (GLvoid *) f } + +static const struct name_address_pair GLX_functions[] = { /*** GLX_VERSION_1_0 ***/ - { "glXChooseVisual", (GLvoid *) glXChooseVisual, NULL }, - { "glXCopyContext", (GLvoid *) glXCopyContext, NULL }, - { "glXCreateContext", (GLvoid *) glXCreateContext, NULL }, - { "glXCreateGLXPixmap", (GLvoid *) glXCreateGLXPixmap, NULL }, - { "glXDestroyContext", (GLvoid *) glXDestroyContext, NULL }, - { "glXDestroyGLXPixmap", (GLvoid *) glXDestroyGLXPixmap, NULL }, - { "glXGetConfig", (GLvoid *) glXGetConfig, NULL }, - { "glXGetCurrentContext", (GLvoid *) glXGetCurrentContext, NULL }, - { "glXGetCurrentDrawable", (GLvoid *) glXGetCurrentDrawable, NULL }, - { "glXIsDirect", (GLvoid *) glXIsDirect, NULL }, - { "glXMakeCurrent", (GLvoid *) glXMakeCurrent, NULL }, - { "glXQueryExtension", (GLvoid *) glXQueryExtension, NULL }, - { "glXQueryVersion", (GLvoid *) glXQueryVersion, NULL }, - { "glXSwapBuffers", (GLvoid *) glXSwapBuffers, NULL }, - { "glXUseXFont", (GLvoid *) glXUseXFont, NULL }, - { "glXWaitGL", (GLvoid *) glXWaitGL, NULL }, - { "glXWaitX", (GLvoid *) glXWaitX, NULL }, + GLX_FUNCTION( glXChooseVisual ), + GLX_FUNCTION( glXCopyContext ), + GLX_FUNCTION( glXCreateContext ), + GLX_FUNCTION( glXCreateGLXPixmap ), + GLX_FUNCTION( glXDestroyContext ), + GLX_FUNCTION( glXDestroyGLXPixmap ), + GLX_FUNCTION( glXGetConfig ), + GLX_FUNCTION( glXGetCurrentContext ), + GLX_FUNCTION( glXGetCurrentDrawable ), + GLX_FUNCTION( glXIsDirect ), + GLX_FUNCTION( glXMakeCurrent ), + GLX_FUNCTION( glXQueryExtension ), + GLX_FUNCTION( glXQueryVersion ), + GLX_FUNCTION( glXSwapBuffers ), + GLX_FUNCTION( glXUseXFont ), + GLX_FUNCTION( glXWaitGL ), + GLX_FUNCTION( glXWaitX ), /*** GLX_VERSION_1_1 ***/ - { "glXGetClientString", (GLvoid *) glXGetClientString, NULL }, - { "glXQueryExtensionsString", (GLvoid *) glXQueryExtensionsString, NULL }, - { "glXQueryServerString", (GLvoid *) glXQueryServerString, NULL }, + GLX_FUNCTION( glXGetClientString ), + GLX_FUNCTION( glXQueryExtensionsString ), + GLX_FUNCTION( glXQueryServerString ), /*** GLX_VERSION_1_2 ***/ - { "glXGetCurrentDisplay", (GLvoid *) glXGetCurrentDisplay, NULL }, + GLX_FUNCTION( glXGetCurrentDisplay ), /*** GLX_VERSION_1_3 ***/ - { "glXChooseFBConfig", (GLvoid *) glXChooseFBConfig, NULL }, - { "glXCreateNewContext", (GLvoid *) glXCreateNewContext, NULL }, - { "glXCreatePbuffer", (GLvoid *) glXCreatePbuffer, NULL }, - { "glXCreatePixmap", (GLvoid *) glXCreatePixmap, NULL }, - { "glXCreateWindow", (GLvoid *) glXCreateWindow, NULL }, - { "glXDestroyPbuffer", (GLvoid *) glXDestroyPbuffer, NULL }, - { "glXDestroyPixmap", (GLvoid *) glXDestroyPixmap, NULL }, - { "glXDestroyWindow", (GLvoid *) glXDestroyWindow, NULL }, - { "glXGetCurrentReadDrawable", (GLvoid *) glXGetCurrentReadDrawable, NULL }, - { "glXGetFBConfigAttrib", (GLvoid *) glXGetFBConfigAttrib, NULL }, - { "glXGetFBConfigs", (GLvoid *) glXGetFBConfigs, NULL }, - { "glXGetSelectedEvent", (GLvoid *) glXGetSelectedEvent, NULL }, - { "glXGetVisualFromFBConfig", (GLvoid *) glXGetVisualFromFBConfig, NULL }, - { "glXMakeContextCurrent", (GLvoid *) glXMakeContextCurrent, NULL }, - { "glXQueryContext", (GLvoid *) glXQueryContext, NULL }, - { "glXQueryDrawable", (GLvoid *) glXQueryDrawable, NULL }, - { "glXSelectEvent", (GLvoid *) glXSelectEvent, NULL }, + GLX_FUNCTION( glXChooseFBConfig ), + GLX_FUNCTION( glXCreateNewContext ), + GLX_FUNCTION( glXCreatePbuffer ), + GLX_FUNCTION( glXCreatePixmap ), + GLX_FUNCTION( glXCreateWindow ), + GLX_FUNCTION( glXDestroyPbuffer ), + GLX_FUNCTION( glXDestroyPixmap ), + GLX_FUNCTION( glXDestroyWindow ), + GLX_FUNCTION( glXGetCurrentReadDrawable ), + GLX_FUNCTION( glXGetFBConfigAttrib ), + GLX_FUNCTION( glXGetFBConfigs ), + GLX_FUNCTION( glXGetSelectedEvent ), + GLX_FUNCTION( glXGetVisualFromFBConfig ), + GLX_FUNCTION( glXMakeContextCurrent ), + GLX_FUNCTION( glXQueryContext ), + GLX_FUNCTION( glXQueryDrawable ), + GLX_FUNCTION( glXSelectEvent ), /*** GLX_SGI_swap_control ***/ - { "glXSwapIntervalSGI", (GLvoid *) glXSwapIntervalSGI, NULL }, + GLX_FUNCTION( glXSwapIntervalSGI ), /*** GLX_SGI_video_sync ***/ - { "glXGetVideoSyncSGI", (GLvoid *) glXGetVideoSyncSGI, NULL }, - { "glXWaitVideoSyncSGI", (GLvoid *) glXWaitVideoSyncSGI, NULL }, + GLX_FUNCTION( glXGetVideoSyncSGI ), + GLX_FUNCTION( glXWaitVideoSyncSGI ), /*** GLX_SGI_make_current_read ***/ - { "glXMakeCurrentReadSGI", (GLvoid *) glXMakeCurrentReadSGI, NULL }, - { "glXGetCurrentReadDrawableSGI", (GLvoid *) glXGetCurrentReadDrawableSGI, NULL }, + GLX_FUNCTION2( glXMakeCurrentReadSGI, glXMakeContextCurrent ), + GLX_FUNCTION2( glXGetCurrentReadDrawableSGI, glXGetCurrentReadDrawable ), /*** GLX_SGIX_video_source ***/ #if defined(_VL_H) - { "glXCreateGLXVideoSourceSGIX", (GLvoid *) glXCreateGLXVideoSourceSGIX, NULL }, - { "glXDestroyGLXVideoSourceSGIX", (GLvoid *) glXDestroyGLXVideoSourceSGIX, NULL }, + GLX_FUNCTION( glXCreateGLXVideoSourceSGIX ), + GLX_FUNCTION( glXDestroyGLXVideoSourceSGIX ), #endif /*** GLX_EXT_import_context ***/ - { "glXFreeContextEXT", (GLvoid *) glXFreeContextEXT, NULL }, - { "glXGetContextIDEXT", (GLvoid *) glXGetContextIDEXT, NULL }, - { "glXGetCurrentDisplayEXT", (GLvoid *) glXGetCurrentDisplayEXT, NULL }, - { "glXImportContextEXT", (GLvoid *) glXImportContextEXT, NULL }, - { "glXQueryContextInfoEXT", (GLvoid *) glXQueryContextInfoEXT, NULL }, + GLX_FUNCTION( glXFreeContextEXT ), + GLX_FUNCTION( glXGetContextIDEXT ), + GLX_FUNCTION2( glXGetCurrentDisplayEXT, glXGetCurrentDisplay ), + GLX_FUNCTION( glXImportContextEXT ), + GLX_FUNCTION( glXQueryContextInfoEXT ), /*** GLX_SGIX_fbconfig ***/ - { "glXGetFBConfigAttribSGIX", (GLvoid *) glXGetFBConfigAttribSGIX, NULL }, - { "glXChooseFBConfigSGIX", (GLvoid *) glXChooseFBConfigSGIX, NULL }, - { "glXCreateGLXPixmapWithConfigSGIX", (GLvoid *) glXCreateGLXPixmapWithConfigSGIX, NULL }, - { "glXCreateContextWithConfigSGIX", (GLvoid *) glXCreateContextWithConfigSGIX, NULL }, - { "glXGetVisualFromFBConfigSGIX", (GLvoid *) glXGetVisualFromFBConfigSGIX, NULL }, - { "glXGetFBConfigFromVisualSGIX", (GLvoid *) glXGetFBConfigFromVisualSGIX, NULL }, + GLX_FUNCTION2( glXGetFBConfigAttribSGIX, glXGetFBConfigAttrib ), + GLX_FUNCTION2( glXChooseFBConfigSGIX, glXChooseFBConfig ), + GLX_FUNCTION( glXCreateGLXPixmapWithConfigSGIX ), + GLX_FUNCTION( glXCreateContextWithConfigSGIX ), + GLX_FUNCTION2( glXGetVisualFromFBConfigSGIX, glXGetVisualFromFBConfig ), + GLX_FUNCTION( glXGetFBConfigFromVisualSGIX ), /*** GLX_SGIX_pbuffer ***/ - { "glXCreateGLXPbufferSGIX", (GLvoid *) glXCreateGLXPbufferSGIX, NULL }, - { "glXDestroyGLXPbufferSGIX", (GLvoid *) glXDestroyGLXPbufferSGIX, NULL }, - { "glXQueryGLXPbufferSGIX", (GLvoid *) glXQueryGLXPbufferSGIX, NULL }, - { "glXSelectEventSGIX", (GLvoid *) glXSelectEventSGIX, NULL }, - { "glXGetSelectedEventSGIX", (GLvoid *) glXGetSelectedEventSGIX, NULL }, + GLX_FUNCTION( glXCreateGLXPbufferSGIX ), + GLX_FUNCTION( glXDestroyGLXPbufferSGIX ), + GLX_FUNCTION( glXQueryGLXPbufferSGIX ), + GLX_FUNCTION( glXSelectEventSGIX ), + GLX_FUNCTION( glXGetSelectedEventSGIX ), /*** GLX_SGI_cushion ***/ - { "glXCushionSGI", (GLvoid *) glXCushionSGI, NULL }, + GLX_FUNCTION( glXCushionSGI ), /*** GLX_SGIX_video_resize ***/ - { "glXBindChannelToWindowSGIX", (GLvoid *) glXBindChannelToWindowSGIX, NULL }, - { "glXChannelRectSGIX", (GLvoid *) glXChannelRectSGIX, NULL }, - { "glXQueryChannelRectSGIX", (GLvoid *) glXQueryChannelRectSGIX, NULL }, - { "glXQueryChannelDeltasSGIX", (GLvoid *) glXQueryChannelDeltasSGIX, NULL }, - { "glXChannelRectSyncSGIX", (GLvoid *) glXChannelRectSyncSGIX, NULL }, + GLX_FUNCTION( glXBindChannelToWindowSGIX ), + GLX_FUNCTION( glXChannelRectSGIX ), + GLX_FUNCTION( glXQueryChannelRectSGIX ), + GLX_FUNCTION( glXQueryChannelDeltasSGIX ), + GLX_FUNCTION( glXChannelRectSyncSGIX ), /*** GLX_SGIX_dmbuffer **/ #if defined(_DM_BUFFER_H_) - { "glXAssociateDMPbufferSGIX", (GLvoid *) glXAssociateDMPbufferSGIX, NULL }, + GLX_FUNCTION( glXAssociateDMPbufferSGIX ), #endif /*** GLX_SGIX_swap_group ***/ - { "glXJoinSwapGroupSGIX", (GLvoid *) glXJoinSwapGroupSGIX, NULL }, + GLX_FUNCTION( glXJoinSwapGroupSGIX ), /*** GLX_SGIX_swap_barrier ***/ - { "glXBindSwapBarrierSGIX", (GLvoid *) glXBindSwapBarrierSGIX, NULL }, - { "glXQueryMaxSwapBarriersSGIX", (GLvoid *) glXQueryMaxSwapBarriersSGIX, NULL }, + GLX_FUNCTION( glXBindSwapBarrierSGIX ), + GLX_FUNCTION( glXQueryMaxSwapBarriersSGIX ), /*** GLX_SUN_get_transparent_index ***/ - { "glXGetTransparentIndexSUN", (GLvoid *) glXGetTransparentIndexSUN, NULL }, + GLX_FUNCTION( glXGetTransparentIndexSUN ), + + /*** GLX_MESA_allocate_memory ***/ + GLX_FUNCTION( glXAllocateMemoryMESA ), + GLX_FUNCTION( glXFreeMemoryMESA ), + GLX_FUNCTION( glXGetMemoryOffsetMESA ), /*** GLX_MESA_copy_sub_buffer ***/ - { "glXCopySubBufferMESA", (GLvoid *) glXCopySubBufferMESA, NULL }, + GLX_FUNCTION( glXCopySubBufferMESA ), /*** GLX_MESA_pixmap_colormap ***/ - { "glXCreateGLXPixmapMESA", (GLvoid *) glXCreateGLXPixmapMESA, NULL }, + GLX_FUNCTION( glXCreateGLXPixmapMESA ), /*** GLX_MESA_release_buffers ***/ - { "glXReleaseBuffersMESA", (GLvoid *) glXReleaseBuffersMESA, NULL }, + GLX_FUNCTION( glXReleaseBuffersMESA ), /*** GLX_MESA_set_3dfx_mode ***/ - { "glXSet3DfxModeMESA", (GLvoid *) glXSet3DfxModeMESA, NULL }, + GLX_FUNCTION( glXSet3DfxModeMESA ), + + /*** GLX_MESA_swap_control ***/ + GLX_FUNCTION( glXSwapIntervalMESA ), + GLX_FUNCTION( glXGetSwapIntervalMESA ), + + /*** GLX_MESA_swap_frame_usage ***/ + GLX_FUNCTION( glXBeginFrameTrackingMESA ), + GLX_FUNCTION( glXEndFrameTrackingMESA ), + GLX_FUNCTION( glXGetFrameUsageMESA ), + GLX_FUNCTION( glXQueryFrameTrackingMESA ), /*** GLX_ARB_get_proc_address ***/ - { "glXGetProcAddressARB", (GLvoid *) glXGetProcAddressARB, NULL }, + GLX_FUNCTION( glXGetProcAddressARB ), /*** GLX 1.4 ***/ - { "glXGetProcAddress", (GLvoid *) glXGetProcAddress, NULL }, - - /*** GLX_???_allocate_memory ***/ - { "glXAllocateMemoryNV", (GLvoid *) glXAllocateMemoryNV, NULL }, - { "glXFreeMemoryNV", (GLvoid *) glXFreeMemoryNV, NULL }, - - /*** GLX_MESA_agp_pointer ***/ - { "glXGetAGPOffsetMESA", (GLvoid *) glXGetAGPOffsetMESA, NULL }, - - { NULL, NULL, NULL } /* end of list */ -}; + GLX_FUNCTION2( glXGetProcAddress, glXGetProcAddressARB ), + /*** GLX_OML_sync_control ***/ + GLX_FUNCTION( glXWaitForSbcOML ), + GLX_FUNCTION( glXWaitForMscOML ), + GLX_FUNCTION( glXSwapBuffersMscOML ), + GLX_FUNCTION( glXGetMscRateOML ), + GLX_FUNCTION( glXGetSyncValuesOML ), -static struct name_address_pair *Dynamic_GLX_functions = NULL; - - -/* - * Drivers can call this function to append the name of a new GLX - * extension string to __glXGLXClientExtensions. Then, when the user - * calls glXGetClientString() they'll see it listed. - * This is a companion to __glXRegisterGLXFunction(). - */ -void -__glXRegisterGLXExtensionString(const char *extName) -{ - char *newList; - if (!extName) - return; - newList = Xmalloc(strlen(__glXGLXClientExtensions) + - strlen(extName) + 2); /* 2 for ' ' and '\0' */ - if (!newList) - return; - strcpy(newList, __glXGLXClientExtensions); - strcat(newList, " "); - strcat(newList, extName); - if (__glXGLXClientExtensions != __glXGLXDefaultClientExtensions) - Xfree((void *) __glXGLXClientExtensions); - __glXGLXClientExtensions = newList; -} - +#ifdef GLX_DIRECT_RENDERING + /*** + *** Internal functions useful to DRI drivers + *** With this, the DRI drivers shouldn't need dlopen()/dlsym() to + *** access internal libGL functions which may or may not exist. + ***/ + GLX_FUNCTION( __glXInitialize ), + GLX_FUNCTION( __glXFindDRIScreen ), + GLX_FUNCTION( __glXGetInternalVersion ), + GLX_FUNCTION( __glXWindowExists ), +#endif -/* - * DRI drivers should call this function if they want to extend - * the GLX API. After registering a new GLX function, the user - * can query and use it by calling glXGetProcAddress(). - * Input: funcName - name of new GLX function - * funcAddr - pointer to the function. - * Return: address of previously registered function with this - * name, or NULL. - */ -void * -__glXRegisterGLXFunction(const char *funcName, void *funcAddr) -{ - struct name_address_pair *ext; + GLX_FUNCTION( __glXScrEnableExtension ), - /* look if the function is already registered */ - for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) { - if (strcmp(ext->Name, funcName) == 0) { - /* It's up the caller to use this return value if he wants - * to chain-call or wrap the previously registered function. - */ - void *prevAddr = ext->Address; - ext->Address = funcAddr; - return prevAddr; - } - } + GLX_FUNCTION( __glXGetUST ), - /* add new function */ - ext = Xmalloc(sizeof(struct name_address_pair)); - if (!ext) - return NULL; - ext->Name = __glXstrdup(funcName); - if (!ext->Name) { - Xfree(ext); - return NULL; - } - ext->Address = funcAddr; - ext->Next = Dynamic_GLX_functions; - Dynamic_GLX_functions = ext; - return NULL; -} + { NULL, NULL } /* end of list */ +}; static const GLvoid * get_glx_proc_address(const char *funcName) { - const struct name_address_pair *ext; GLuint i; - /* try dynamic functions */ - for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) { - if (strcmp(ext->Name, funcName) == 0) { - return ext->Address; - } - } - /* try static functions */ for (i = 0; GLX_functions[i].Name; i++) { if (strcmp(GLX_functions[i].Name, funcName) == 0) - return GLX_functions[i].Address; + return GLX_functions[i].Address; } + return NULL; } @@ -2291,106 +2991,111 @@ typedef void (*gl_function)( void ); gl_function f; -#if defined(GLX_DIRECT_RENDERING) - __glXRegisterExtensions(); -#endif + + /* Search the table of GLX and internal functions first. If that + * fails and the supplied name could be a valid core GL name, try + * searching the core GL function table. This check is done to prevent + * DRI based drivers from searching the core GL function table for + * internal API functions. + */ f = (gl_function) get_glx_proc_address((const char *) procName); - if (f) { - return f; + if ( (f == NULL) && (procName[0] == 'g') && (procName[1] == 'l') + && (procName[2] != 'X') ) { + f = (gl_function) _glapi_get_proc_address((const char *) procName); } - f = (gl_function) _glapi_get_proc_address((const char *) procName); return f; } /* GLX 1.4 */ void (*glXGetProcAddress(const GLubyte *procName))( void ) +#if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED) + __attribute__ ((alias ("glXGetProcAddressARB"))); +#else { return glXGetProcAddressARB(procName); } -#endif +#endif /* __GNUC__ */ +#endif /* GLX_BUILT_IN_XMESA */ /* - * AGP memory allocation + * Return our version number (YYYYMMDD format). This might be used by + * the DRI drivers to determine how new libGL is at runtime. */ -void *GLX_PREFIX(glXAllocateMemoryNV)(GLsizei size, - GLfloat readFrequency, - GLfloat writeFrequency, - GLfloat priority) -{ - /* This is special - search the list of dynamically-added functions - * and call the allocator if present. - * More typically, the user will have gotten a pointer to - * glXAllocateMemoryNV() via glXGetProcAddress() so we won't be - * doing this. - */ - typedef void * (*allocFunc)(GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); - const struct name_address_pair *ext; - static allocFunc f = (allocFunc) NULL; - - if (!f) { - for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) { - if (strcmp(ext->Name, "glXAllocateMemoryNV") == 0) { - f = (allocFunc) ext->Address; - break; - } - } - } - if (f) - return (*f)(size, readFrequency, writeFrequency, priority); - return NULL; +int __glXGetInternalVersion(void) +{ + /* History: + * 20021121 - Initial version + * 20021128 - Added __glXWindowExists() function + * 20021207 - Added support for dynamic GLX extensions, + * GLX_SGI_swap_control, GLX_SGI_video_sync, + * GLX_OML_sync_control, and GLX_MESA_swap_control. + * Never officially released. Do NOT test against + * this version. Use 20030317 instead. + * 20030317 - Added support GLX_SGIX_fbconfig, + * GLX_MESA_swap_frame_usage, GLX_OML_swap_method, + * GLX_{ARB,SGIS}_multisample, and + * GLX_SGIX_visual_select_group. + * 20030606 - Added support for GLX_SGI_make_current_read. + * 20030813 - Made support for dynamic extensions multi-head aware. + * 20030818 - Added support for GLX_MESA_allocate_memory in place of the + * deprecated GLX_NV_vertex_array_range & GLX_MESA_agp_offset + * interfaces. + */ + return 20030818; } -void GLX_PREFIX(glXFreeMemoryNV)(GLvoid *pointer) + +static Bool windowExistsFlag; + +static int windowExistsErrorHandler(Display *dpy, XErrorEvent *xerr) { - /* This is special - search the list of dynamically-added functions - * and call the free func if present. - * More typically, the user will have gotten a pointer to - * glXFreeMemoryNV() via glXGetProcAddress() so we won't be - * doing this. - */ - typedef void * (*freeFunc)(GLvoid *pointer); - const struct name_address_pair *ext; - static freeFunc f = (freeFunc) NULL; - - if (!f) { - for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) { - if (strcmp(ext->Name, "glXFreeMemoryNV") == 0) { - f = (freeFunc) ext->Address; - break; - } - } - } - if (f) - (*f)(pointer); + if (xerr->error_code == BadWindow) { + windowExistsFlag = GL_FALSE; + } + return 0; +} + +/* + * Utility function useful to DRI drivers. + */ +Bool __glXWindowExists(Display *dpy, GLXDrawable draw) +{ + XWindowAttributes xwa; + int (*oldXErrorHandler)(Display *, XErrorEvent *); + + XSync(dpy, GL_FALSE); + windowExistsFlag = GL_TRUE; + oldXErrorHandler = XSetErrorHandler(windowExistsErrorHandler); + XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */ + XSetErrorHandler(oldXErrorHandler); + return windowExistsFlag; } -GLuint GLX_PREFIX(glXGetAGPOffsetMESA)( const GLvoid *pointer ) +/** + * Get the unadjusted system time (UST). Currently, the UST is measured in + * microseconds since Epoc. The actual resolution of the UST may vary from + * system to system, and the units may vary from release to release. + * + * \param ust Location to store the 64-bit UST + * \returns Zero on success or a negative errno value on failure. + */ +int __glXGetUST( int64_t * ust ) { - /* This is special - search the list of dynamically-added functions - * and call the free func if present. - * More typically, the user will have gotten a pointer to - * glXGetAGPOffsetMESA() via glXGetProcAddress() so we won't be - * doing this. - */ - typedef GLuint (*getAGPOffsetFunc)(const GLvoid *pointer); - const struct name_address_pair *ext; - static getAGPOffsetFunc f = (getAGPOffsetFunc) NULL; - - if (!f) { - for (ext = Dynamic_GLX_functions; ext; ext = ext->Next) { - if (strcmp(ext->Name, "glXGetAGPOffsetMESA") == 0) { - f = (getAGPOffsetFunc) ext->Address; - break; - } - } - } - if (f) - return (*f)(pointer); - else - return ~0; + struct timeval tv; + + if ( ust == NULL ) { + return -EFAULT; + } + + if ( gettimeofday( & tv, NULL ) == 0 ) { + ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec; + return 0; + } else { + return -errno; + } } Index: xc/lib/GL/glx/glxext.c diff -u xc/lib/GL/glx/glxext.c:1.16 xc/lib/GL/glx/glxext.c:1.23 --- xc/lib/GL/glx/glxext.c:1.16 Mon Jan 20 16:37:19 2003 +++ xc/lib/GL/glx/glxext.c Fri Jan 30 15:33:06 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.16 2003/01/20 21:37:19 tsi Exp $ */ +/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.23 2004/01/30 20:33:06 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are @@ -53,11 +53,49 @@ #ifdef XTHREADS #include "Xthreads.h" #endif +#include "glxextensions.h" +#include "glcontextmodes.h" + +#include #ifdef DEBUG void __glXDumpDrawBuffer(__GLXcontext *ctx); #endif +#ifdef USE_SPARC_ASM +/* + * This is where our dispatch table's bounds are. + * And the static mesa_init is taken directly from + * Mesa's 'sparc.c' initializer. + * + * We need something like this here, because this version + * of openGL/glx never initializes a Mesa context, and so + * the address of the dispatch table pointer never gets stuffed + * into the dispatch jump table otherwise. + * + * It matters only on SPARC, and only if you are using assembler + * code instead of C-code indirect dispatch. + * + * -- FEM, 04.xii.03 + */ +extern unsigned int _mesa_sparc_glapi_begin; +extern unsigned int _mesa_sparc_glapi_end; +extern void __glapi_sparc_icache_flush(unsigned int *); +static void _glx_mesa_init_sparc_glapi_relocs(void); +static int _mesa_sparc_needs_init = 1; +#define INIT_MESA_SPARC { \ + if(_mesa_sparc_needs_init) { \ + _glx_mesa_init_sparc_glapi_relocs(); \ + _mesa_sparc_needs_init = 0; \ + } \ +} +#else +#define INIT_MESA_SPARC +#endif + +static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, + GLXDrawable read, GLXContext gc); + /* ** We setup some dummy structures here so that the API can be used ** even if no context is current. @@ -145,6 +183,8 @@ */ int __glXCloseDisplay(Display *dpy, XExtCodes *codes); +static GLboolean FillInVisuals( __GLXscreenConfigs * psc ); + /************************************************************************/ /* Extension required boiler plate */ @@ -222,6 +262,13 @@ Xfree((char*) psc->configs); if(psc->effectiveGLXexts) Xfree(psc->effectiveGLXexts); + + if ( psc->old_configs != NULL ) { + Xfree( psc->old_configs ); + psc->old_configs = NULL; + psc->numOldConfigs = 0; + } + psc->configs = 0; /* NOTE: just for paranoia */ } @@ -305,6 +352,316 @@ return GL_TRUE; } + +static GLboolean +FillInVisuals( __GLXscreenConfigs * psc ) +{ + int glx_visual_count; + int i; + + + glx_visual_count = 0; + for ( i = 0 ; i < psc->numConfigs ; i++ ) { + if ( (psc->configs[i].visualID != GLX_DONT_CARE) + && (psc->configs[i].sampleBuffers == 0) + && (psc->configs[i].samples == 0) + && (psc->configs[i].drawableType == GLX_WINDOW_BIT) + && ((psc->configs[i].xRenderable == GL_TRUE) + || (psc->configs[i].xRenderable == GLX_DONT_CARE)) ) { + glx_visual_count++; + } + } + + psc->old_configs = (__GLXvisualConfig *) + Xmalloc( sizeof( __GLXvisualConfig ) * glx_visual_count ); + if ( psc->old_configs == NULL ) { + return GL_FALSE; + } + + glx_visual_count = 0; + for ( i = 0 ; i < psc->numConfigs ; i++ ) { + if ( (psc->configs[i].visualID != GLX_DONT_CARE) + && (psc->configs[i].sampleBuffers == 0) + && (psc->configs[i].samples == 0) + && (psc->configs[i].drawableType == GLX_WINDOW_BIT) + && ((psc->configs[i].xRenderable == GL_TRUE) + || (psc->configs[i].xRenderable == GLX_DONT_CARE)) ) { + +#define COPY_VALUE(src_tag,dst_tag) \ + psc->old_configs[glx_visual_count]. dst_tag = psc->configs[i]. src_tag + + COPY_VALUE( visualID, vid ); + COPY_VALUE( rgbMode, rgba ); + COPY_VALUE( stereoMode, stereo ); + COPY_VALUE( doubleBufferMode, doubleBuffer ); + + psc->old_configs[glx_visual_count].class = + _gl_convert_to_x_visual_type( psc->configs[i].visualType ); + + COPY_VALUE( level, level ); + COPY_VALUE( numAuxBuffers, auxBuffers ); + + COPY_VALUE( redBits, redSize ); + COPY_VALUE( greenBits, greenSize ); + COPY_VALUE( blueBits, blueSize ); + COPY_VALUE( alphaBits, alphaSize ); + COPY_VALUE( rgbBits, bufferSize ); + COPY_VALUE( accumRedBits, accumRedSize ); + COPY_VALUE( accumGreenBits, accumGreenSize ); + COPY_VALUE( accumBlueBits, accumBlueSize ); + COPY_VALUE( accumAlphaBits, accumAlphaSize ); + COPY_VALUE( depthBits, depthSize ); + COPY_VALUE( stencilBits, stencilSize ); + + COPY_VALUE( visualRating, visualRating ); + COPY_VALUE( transparentPixel, transparentPixel ); + COPY_VALUE( transparentRed, transparentRed ); + COPY_VALUE( transparentGreen, transparentGreen ); + COPY_VALUE( transparentBlue, transparentBlue ); + COPY_VALUE( transparentAlpha, transparentAlpha ); + COPY_VALUE( transparentIndex, transparentIndex ); + +#undef COPY_VALUE + + glx_visual_count++; + } + } + + psc->numOldConfigs = glx_visual_count; + return GL_TRUE; +} + + +void +__glXInitializeVisualConfigFromTags( __GLcontextModes *config, int count, + const INT32 *bp, Bool tagged_only, + Bool fbconfig_style_tags ) +{ + int i; + + if (!tagged_only) { + /* Copy in the first set of properties */ + config->visualID = *bp++; + + config->visualType = _gl_convert_from_x_visual_type( *bp++ ); + + config->rgbMode = *bp++; + + config->redBits = *bp++; + config->greenBits = *bp++; + config->blueBits = *bp++; + config->alphaBits = *bp++; + config->accumRedBits = *bp++; + config->accumGreenBits = *bp++; + config->accumBlueBits = *bp++; + config->accumAlphaBits = *bp++; + + config->doubleBufferMode = *bp++; + config->stereoMode = *bp++; + + config->rgbBits = *bp++; + config->depthBits = *bp++; + config->stencilBits = *bp++; + config->numAuxBuffers = *bp++; + config->level = *bp++; + + count -= __GLX_MIN_CONFIG_PROPS; + } + else { + config->visualID = (XID) GLX_DONT_CARE; + config->visualType = GLX_DONT_CARE; + config->rgbMode = ( fbconfig_style_tags ) + ? GL_TRUE /* glXChooseFBConfig() */ + : GL_FALSE; /* glXChooseVisual() */ + + config->redBits = 0; + config->greenBits = 0; + config->blueBits = 0; + config->alphaBits = 0; + config->accumRedBits = 0; + config->accumGreenBits = 0; + config->accumBlueBits = 0; + config->accumAlphaBits = 0; + + config->doubleBufferMode = ( fbconfig_style_tags ) + ? GLX_DONT_CARE /* glXChooseFBConfig() */ + : GL_FALSE; /* glXChooseVisual() */ + config->stereoMode = GL_FALSE; + + config->rgbBits = 0; + config->depthBits = 0; + config->stencilBits = 0; + config->numAuxBuffers = 0; + config->level = 0; + } + + /* + ** Additional properties may be in a list at the end + ** of the reply. They are in pairs of property type + ** and property value. + */ + config->visualRating = GLX_DONT_CARE; + config->visualSelectGroup = 0; + config->transparentPixel = GLX_NONE; + config->transparentRed = GLX_DONT_CARE; + config->transparentGreen = GLX_DONT_CARE; + config->transparentBlue = GLX_DONT_CARE; + config->transparentAlpha = GLX_DONT_CARE; + config->transparentIndex = GLX_DONT_CARE; + + config->floatMode = GL_FALSE; + config->drawableType = GLX_WINDOW_BIT; + config->renderType = (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; + config->xRenderable = GLX_DONT_CARE; + config->fbconfigID = (GLXFBConfigID)(GLX_DONT_CARE); + + config->maxPbufferWidth = 0; + config->maxPbufferHeight = 0; + config->maxPbufferPixels = 0; + config->optimalPbufferWidth = 0; + config->optimalPbufferHeight = 0; + + config->sampleBuffers = 0; + config->samples = 0; + config->swapMethod = GLX_SWAP_UNDEFINED_OML; + +#define FETCH_OR_SET(tag) \ + config-> tag = ( fbconfig_style_tags ) ? *bp++ : 1 + + for (i = 0; i < count; i += 2 ) { + switch(*bp++) { + case GLX_RGBA: + FETCH_OR_SET( rgbMode ); + config->renderType = (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; + break; + case GLX_BUFFER_SIZE: + config->rgbBits = *bp++; + break; + case GLX_LEVEL: + config->level = *bp++; + break; + case GLX_DOUBLEBUFFER: + FETCH_OR_SET( doubleBufferMode ); + break; + case GLX_STEREO: + FETCH_OR_SET( stereoMode ); + break; + case GLX_AUX_BUFFERS: + config->numAuxBuffers = *bp++; + break; + case GLX_RED_SIZE: + config->redBits = *bp++; + break; + case GLX_GREEN_SIZE: + config->greenBits = *bp++; + break; + case GLX_BLUE_SIZE: + config->blueBits = *bp++; + break; + case GLX_ALPHA_SIZE: + config->alphaBits = *bp++; + break; + case GLX_DEPTH_SIZE: + config->depthBits = *bp++; + break; + case GLX_STENCIL_SIZE: + config->stencilBits = *bp++; + break; + case GLX_ACCUM_RED_SIZE: + config->accumRedBits = *bp++; + break; + case GLX_ACCUM_GREEN_SIZE: + config->accumGreenBits = *bp++; + break; + case GLX_ACCUM_BLUE_SIZE: + config->accumBlueBits = *bp++; + break; + case GLX_ACCUM_ALPHA_SIZE: + config->accumAlphaBits = *bp++; + break; + case GLX_VISUAL_CAVEAT_EXT: + config->visualRating = *bp++; + break; + case GLX_X_VISUAL_TYPE: + config->visualType = *bp++; + break; + case GLX_TRANSPARENT_TYPE: + config->transparentPixel = *bp++; + break; + case GLX_TRANSPARENT_INDEX_VALUE: + config->transparentIndex = *bp++; + break; + case GLX_TRANSPARENT_RED_VALUE: + config->transparentRed = *bp++; + break; + case GLX_TRANSPARENT_GREEN_VALUE: + config->transparentGreen = *bp++; + break; + case GLX_TRANSPARENT_BLUE_VALUE: + config->transparentBlue = *bp++; + break; + case GLX_TRANSPARENT_ALPHA_VALUE: + config->transparentAlpha = *bp++; + break; + case GLX_VISUAL_ID: + config->visualID = *bp++; + break; + case GLX_DRAWABLE_TYPE: + config->drawableType = *bp++; + break; + case GLX_RENDER_TYPE: + config->renderType = *bp++; + break; + case GLX_X_RENDERABLE: + config->xRenderable = *bp++; + break; + case GLX_FBCONFIG_ID: + config->fbconfigID = *bp++; + break; + case GLX_MAX_PBUFFER_WIDTH: + config->maxPbufferWidth = *bp++; + break; + case GLX_MAX_PBUFFER_HEIGHT: + config->maxPbufferHeight = *bp++; + break; + case GLX_MAX_PBUFFER_PIXELS: + config->maxPbufferPixels = *bp++; + break; + case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: + config->optimalPbufferWidth = *bp++; + break; + case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: + config->optimalPbufferHeight = *bp++; + break; + case GLX_VISUAL_SELECT_GROUP_SGIX: + config->visualSelectGroup = *bp++; + break; + case GLX_SWAP_METHOD_OML: + config->swapMethod = *bp++; + break; + case GLX_SAMPLE_BUFFERS_SGIS: + config->sampleBuffers = *bp++; + break; + case GLX_SAMPLES_SGIS: + config->samples = *bp++; + break; + case None: + i = count; + break; + default: + break; + } + } + + config->haveAccumBuffer = ((config->accumRedBits + + config->accumGreenBits + + config->accumBlueBits + + config->accumAlphaBits) > 0); + config->haveDepthBuffer = (config->depthBits > 0); + config->haveStencilBuffer = (config->stencilBits > 0); +} + + /* ** Allocate the memory for the per screen configs for each screen. ** If that works then fetch the per screen configs data. @@ -312,11 +669,16 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv) { xGLXGetVisualConfigsReq *req; + xGLXGetFBConfigsReq *fb_req; + xGLXVendorPrivateReq *vpreq; + xGLXGetFBConfigsSGIXReq *sgi_req; xGLXGetVisualConfigsReply reply; __GLXscreenConfigs *psc; - __GLXvisualConfig *config; - GLint i, j, k, nprops, screens; + __GLcontextModes *config; + GLint i, j, nprops, screens; INT32 buf[__GLX_TOTAL_CONFIG], *props; + unsigned supported_request = 0; + unsigned prop_size; /* ** First allocate memory for the array of per screen configs. @@ -329,31 +691,79 @@ memset(psc, 0, screens * sizeof(__GLXscreenConfigs)); priv->screenConfigs = psc; + priv->serverGLXversion = __glXInternalQueryServerString(dpy, + priv->majorOpcode, 0, GLX_VERSION); + if ( priv->serverGLXversion == NULL ) { + FreeScreenConfigs(priv); + return GL_FALSE; + } + + if ( atof( priv->serverGLXversion ) >= 1.3 ) { + supported_request = 1; + } + /* ** Now fetch each screens configs structures. If a screen supports ** GL (by returning a numVisuals > 0) then allocate memory for our ** config structure and then fill it in. */ for (i = 0; i < screens; i++, psc++) { - /* Send the glXGetVisualConfigs request */ + if ( supported_request != 1 ) { + psc->serverGLXexts = __glXInternalQueryServerString(dpy, + priv->majorOpcode, i, GLX_EXTENSIONS); + if ( strstr( psc->serverGLXexts, "GLX_SGIX_fbconfig" ) != NULL ) { + supported_request = 2; + } + else { + supported_request = 3; + } + } + + LockDisplay(dpy); - GetReq(GLXGetVisualConfigs,req); - req->reqType = priv->majorOpcode; - req->glxCode = X_GLXGetVisualConfigs; - req->screen = i; + switch( supported_request ) { + case 1: + GetReq(GLXGetFBConfigs,fb_req); + fb_req->reqType = priv->majorOpcode; + fb_req->glxCode = X_GLXGetFBConfigs; + fb_req->screen = i; + break; + + case 2: + GetReqExtra(GLXVendorPrivate, + sz_xGLXGetFBConfigsSGIXReq-sz_xGLXVendorPrivateReq,vpreq); + sgi_req = (xGLXGetFBConfigsSGIXReq *) vpreq; + sgi_req->reqType = priv->majorOpcode; + sgi_req->glxCode = X_GLXVendorPrivateWithReply; + sgi_req->vendorCode = X_GLXvop_GetFBConfigsSGIX; + sgi_req->screen = i; + break; + + case 3: + GetReq(GLXGetVisualConfigs,req); + req->reqType = priv->majorOpcode; + req->glxCode = X_GLXGetVisualConfigs; + req->screen = i; + break; + } + if (!_XReply(dpy, (xReply*) &reply, 0, False)) { /* Something is busted. Punt. */ UnlockDisplay(dpy); - SyncHandle(); FreeScreenConfigs(priv); return GL_FALSE; } + + UnlockDisplay(dpy); if (!reply.numVisuals) { /* This screen does not support GL rendering */ UnlockDisplay(dpy); continue; } + /* FIXME: Is the __GLX_MIN_CONFIG_PROPS test correct for + * FIXME: FBconfigs? + */ /* Check number of properties */ nprops = reply.numProps; if ((nprops < __GLX_MIN_CONFIG_PROPS) || @@ -366,8 +776,8 @@ } /* Allocate memory for our config structure */ - psc->configs = (__GLXvisualConfig*) - Xmalloc(reply.numVisuals * sizeof(__GLXvisualConfig)); + psc->configs = (__GLcontextModes*) + Xmalloc(reply.numVisuals * sizeof(__GLcontextModes)); psc->numConfigs = reply.numVisuals; if (!psc->configs) { UnlockDisplay(dpy); @@ -375,76 +785,29 @@ FreeScreenConfigs(priv); return GL_FALSE; } + /* Allocate memory for the properties, if needed */ - if (nprops <= __GLX_MIN_CONFIG_PROPS) { - props = buf; - } else { - props = (INT32 *) Xmalloc(nprops * __GLX_SIZE_INT32); - } + if ( supported_request != 3 ) { + nprops *= 2; + } + + prop_size = nprops * __GLX_SIZE_INT32; + + if (prop_size <= sizeof(buf)) { + props = buf; + } else { + props = (INT32 *) Xmalloc(prop_size); + } /* Read each config structure and convert it into our format */ config = psc->configs; for (j = 0; j < reply.numVisuals; j++, config++) { - INT32 *bp = props; + _XRead(dpy, (char *)props, prop_size); - _XRead(dpy, (char *)bp, nprops * __GLX_SIZE_INT32); - - /* Copy in the first set of properties */ - config->vid = *bp++; - config->class = *bp++; - config->rgba = *bp++; - - config->redSize = *bp++; - config->greenSize = *bp++; - config->blueSize = *bp++; - config->alphaSize = *bp++; - config->accumRedSize = *bp++; - config->accumGreenSize = *bp++; - config->accumBlueSize = *bp++; - config->accumAlphaSize = *bp++; - - config->doubleBuffer = *bp++; - config->stereo = *bp++; - - config->bufferSize = *bp++; - config->depthSize = *bp++; - config->stencilSize = *bp++; - config->auxBuffers = *bp++; - config->level = *bp++; - - /* - ** Additional properties may be in a list at the end - ** of the reply. They are in pairs of property type - ** and property value. - */ - config->visualRating = GLX_NONE_EXT; - config->transparentPixel = GL_FALSE; - - for (k = __GLX_MIN_CONFIG_PROPS; k < nprops; k+=2) { - switch(*bp++) { - case GLX_VISUAL_CAVEAT_EXT: - config->visualRating = *bp++; - break; - case GLX_TRANSPARENT_TYPE_EXT: - config->transparentPixel = *bp++; - break; - case GLX_TRANSPARENT_INDEX_VALUE_EXT: - config->transparentIndex = *bp++; - break; - case GLX_TRANSPARENT_RED_VALUE_EXT: - config->transparentRed = *bp++; - break; - case GLX_TRANSPARENT_GREEN_VALUE_EXT: - config->transparentGreen = *bp++; - break; - case GLX_TRANSPARENT_BLUE_VALUE_EXT: - config->transparentBlue = *bp++; - break; - case GLX_TRANSPARENT_ALPHA_VALUE_EXT: - config->transparentAlpha = *bp++; - break; - } - } + __glXInitializeVisualConfigFromTags( config, nprops, props, + (supported_request != 3), + GL_TRUE ); + config->screen = i; } if (props != buf) { Xfree((char *)props); @@ -452,14 +815,24 @@ UnlockDisplay(dpy); #ifdef GLX_DIRECT_RENDERING + /* Initialize per screen dynamic client GLX extensions */ + psc->ext_list_first_time = GL_TRUE; /* Initialize the direct rendering per screen data and functions */ if (priv->driDisplay.private && priv->driDisplay.createScreen && priv->driDisplay.createScreen[i]) { + /* screen initialization (bootstrap the driver) */ + if ( (psc->old_configs == NULL) + && !FillInVisuals(psc) ) { + FreeScreenConfigs(priv); + return GL_FALSE; + } + + psc->driScreen.screenConfigs = (void *)psc; psc->driScreen.private = (*(priv->driDisplay.createScreen[i]))(dpy, i, &psc->driScreen, - psc->numConfigs, - psc->configs); + psc->numOldConfigs, + psc->old_configs); } #endif } @@ -489,6 +862,7 @@ } #endif + INIT_MESA_SPARC /* The one and only long long lock */ __glXLock(); @@ -603,6 +977,7 @@ if (gc->currentDpy == dpy) { /* Use opcode from gc because its right */ + INIT_MESA_SPARC return gc->majorOpcode; } else { /* @@ -654,11 +1029,21 @@ return ctx->pc; } -/* -** Send a large command, one that is too large for some reason to -** send using the GLXRender protocol request. One reason to send -** a large command is to avoid copying the data. -*/ +/** + * Send a command that is too large for the GLXRender protocol request. + * + * Send a large command, one that is too large for some reason to + * send using the GLXRender protocol request. One reason to send + * a large command is to avoid copying the data. + * + * \param ctx GLX context + * \param header Header data. + * \param headerLen Size, in bytes, of the header data. It is assumed that + * the header data will always be small enough to fit in + * a single X protocol packet. + * \param data Command data. + * \param dataLen Size, in bytes, of the command data. + */ void __glXSendLargeCommand(__GLXcontext *ctx, const GLvoid *header, GLint headerLen, const GLvoid *data, GLint dataLen) @@ -668,13 +1053,19 @@ GLint maxSize, amount; GLint totalRequests, requestNumber; - maxSize = ctx->bufSize - sizeof(xGLXRenderLargeReq); + /* + ** Calculate the maximum amount of data can be stuffed into a single + ** packet. sz_xGLXRenderReq is added because bufSize is the maximum + ** packet size minus sz_xGLXRenderReq. + */ + maxSize = (ctx->bufSize + sz_xGLXRenderReq) - sz_xGLXRenderLargeReq; totalRequests = 1 + (dataLen / maxSize); if (dataLen % maxSize) totalRequests++; /* ** Send all of the command, except the large array, as one request. */ + assert( headerLen <= maxSize ); LockDisplay(dpy); GetReq(GLXRenderLarge,req); req->reqType = ctx->majorOpcode; @@ -760,17 +1151,82 @@ /************************************************************************/ +static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode, + GLXContextID gc, GLXContextTag old_gc, GLXDrawable draw, GLXDrawable read, + xGLXMakeCurrentReply * reply ); + +static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode, + GLXContextID gc_id, GLXContextTag gc_tag, + GLXDrawable draw, GLXDrawable read, + xGLXMakeCurrentReply * reply ) +{ + opcode = __glXSetupForCommand(dpy); + if (!opcode) { + return GL_FALSE; + } + + LockDisplay(dpy); + if ( draw == read ) { + xGLXMakeCurrentReq *req; + + GetReq(GLXMakeCurrent,req); + req->reqType = opcode; + req->glxCode = X_GLXMakeCurrent; + req->drawable = draw; + req->context = gc_id; + req->oldContextTag = gc_tag; + } + else { + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + + /* If the server can support the GLX 1.3 version, we should + * perfer that. Not only that, some servers support GLX 1.3 but + * not the SGI extension. + */ + + if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) { + xGLXMakeContextCurrentReq *req; + + GetReq(GLXMakeContextCurrent,req); + req->reqType = opcode; + req->glxCode = X_GLXMakeContextCurrent; + req->drawable = draw; + req->readdrawable = read; + req->context = gc_id; + req->oldContextTag = gc_tag; + } + else { + xGLXVendorPrivateWithReplyReq *vpreq; + xGLXMakeCurrentReadSGIReq *req; + + GetReqExtra(GLXVendorPrivateWithReply, + sz_xGLXMakeCurrentReadSGIReq-sz_xGLXVendorPrivateWithReplyReq,vpreq); + req = (xGLXMakeCurrentReadSGIReq *)vpreq; + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivateWithReply; + req->vendorCode = X_GLXvop_MakeCurrentReadSGI; + req->drawable = draw; + req->readable = read; + req->context = gc_id; + req->oldContextTag = gc_tag; + } + } + + return _XReply(dpy, (xReply*) reply, 0, False); +} + + /* ** Make a particular context current. ** NOTE: this is in this file so that it can access dummyContext. */ -Bool GLX_PREFIX(glXMakeCurrent)(Display *dpy, GLXDrawable draw, GLXContext gc) +static Bool MakeContextCurrent(Display *dpy, + GLXDrawable draw, GLXDrawable read, + GLXContext gc) { - xGLXMakeCurrentReq *req; xGLXMakeCurrentReply reply; GLXContext oldGC; CARD8 opcode, oldOpcode; - Display *dpyTmp; Bool sentRequestToOldDpy = False; Bool bindReturnValue = True; @@ -778,6 +1234,7 @@ if (!opcode) { return GL_FALSE; } + /* ** Make sure that the new context has a nonzero ID. In the request, ** a zero context ID is used only to mean that we bind to no current @@ -788,6 +1245,11 @@ } oldGC = __glXGetCurrentContext(); + oldOpcode = (gc == oldGC) ? opcode : __glXSetupForCommand(dpy); + if (!oldOpcode) { + return GL_FALSE; + } + if ((dpy != oldGC->currentDpy || (gc && gc->isDirect)) && !oldGC->isDirect && oldGC != &dummyContext) { /* @@ -798,35 +1260,15 @@ ** unbind the previous context. */ sentRequestToOldDpy = True; - dpyTmp = dpy; - - if (dpy != oldGC->currentDpy) { - /* - ** The GetReq macro uses "dpy", so we have to save and - ** restore later. - */ - dpy = oldGC->currentDpy; - oldOpcode = __glXSetupForCommand(dpy); - if (!oldOpcode) { - return GL_FALSE; - } - } else { - oldOpcode = opcode; - } - LockDisplay(dpy); - GetReq(GLXMakeCurrent,req); - req->reqType = oldOpcode; - req->glxCode = X_GLXMakeCurrent; - req->drawable = None; - req->context = None; - req->oldContextTag = oldGC->currentContextTag; - if (!_XReply(dpy, (xReply*) &reply, 0, False)) { + if ( ! SendMakeCurrentRequest( oldGC->currentDpy, oldOpcode, None, + oldGC->currentContextTag, None, None, + &reply ) ) { /* The make current failed. Just return GL_FALSE. */ UnlockDisplay(dpy); SyncHandle(); return GL_FALSE; } - dpy = dpyTmp; + oldGC->currentContextTag = 0; } @@ -834,13 +1276,11 @@ /* Unbind the old direct rendering context */ if (oldGC->isDirect) { if (oldGC->driContext.private) { - int will_rebind = (gc && gc->isDirect - && draw == oldGC->currentDrawable); - if (!(*oldGC->driContext.unbindContext)(oldGC->currentDpy, - oldGC->screen, - oldGC->currentDrawable, - oldGC, - will_rebind)) { + if (!(*oldGC->driContext.unbindContext2)(oldGC->currentDpy, + oldGC->screen, + oldGC->currentDrawable, + oldGC->currentReadable, + oldGC)) { /* The make current failed. Just return GL_FALSE. */ return GL_FALSE; } @@ -852,21 +1292,18 @@ if (gc && gc->isDirect) { if (gc->driContext.private) { bindReturnValue = - (*gc->driContext.bindContext)(dpy, gc->screen, draw, gc); + (*gc->driContext.bindContext2)(dpy, gc->screen, draw, read, gc); } } else { #endif _glapi_check_multithread(); /* Send a glXMakeCurrent request to bind the new context. */ LockDisplay(dpy); - GetReq(GLXMakeCurrent,req); - req->reqType = opcode; - req->glxCode = X_GLXMakeCurrent; - req->drawable = draw; - req->context = gc ? gc->xid : None; - req->oldContextTag = oldGC->currentContextTag; - bindReturnValue = _XReply(dpy, (xReply*) &reply, 0, False); - UnlockDisplay(dpy); + + bindReturnValue = SendMakeCurrentRequest( dpy, opcode, + gc ? gc->xid : None, + oldGC->currentContextTag, + draw, read, &reply ); #ifdef GLX_DIRECT_RENDERING } #endif @@ -882,10 +1319,11 @@ /* If the old context was direct rendering, then re-bind to it. */ if (oldGC->isDirect) { if (oldGC->driContext.private) { - if (!(*oldGC->driContext.bindContext)(oldGC->currentDpy, - oldGC->screen, - oldGC->currentDrawable, - oldGC)) { + if (!(*oldGC->driContext.bindContext2)(oldGC->currentDpy, + oldGC->screen, + oldGC->currentDrawable, + oldGC->currentReadable, + oldGC)) { /* ** The request failed; this cannot happen with the ** current API. If in the future the API is @@ -906,20 +1344,10 @@ ** drawable. */ if (sentRequestToOldDpy) { - if (dpy != oldGC->currentDpy) { - dpy = oldGC->currentDpy; - oldOpcode = __glXSetupForCommand(dpy); - } else { - oldOpcode = opcode; - } - LockDisplay(dpy); - GetReq(GLXMakeCurrent,req); - req->reqType = oldOpcode; - req->glxCode = X_GLXMakeCurrent; - req->drawable = oldGC->currentDrawable; - req->context = oldGC->xid; - req->oldContextTag = 0; - if (!_XReply(dpy, (xReply*) &reply, 0, False)) { + if ( !SendMakeCurrentRequest( oldGC->currentDpy, oldOpcode, + oldGC->xid, 0, + oldGC->currentDrawable, + oldGC->currentReadable, &reply ) ) { UnlockDisplay(dpy); SyncHandle(); /* @@ -949,11 +1377,13 @@ ** NULL and not the dummy. */ gc->currentDrawable = draw; + gc->currentReadable = read; } else { if (oldGC != &dummyContext) { /* Old current context is no longer current to anybody */ oldGC->currentDpy = 0; oldGC->currentDrawable = None; + oldGC->currentReadable = None; oldGC->currentContextTag = 0; if (oldGC->xid == None) { @@ -982,6 +1412,12 @@ if (!IndirectAPI) IndirectAPI = __glXNewIndirectAPI(); _glapi_set_dispatch(IndirectAPI); +# ifdef GLX_USE_APPLEGL + do { + extern void XAppleDRIUseIndirectDispatch(void); + XAppleDRIUseIndirectDispatch(); + } while (0); +# endif } #else /* if not direct rendering, always need indirect dispatch */ @@ -991,6 +1427,7 @@ #endif gc->currentDpy = dpy; gc->currentDrawable = draw; + gc->currentReadable = read; #ifdef GLX_DIRECT_RENDERING if (gc->isDirect) reply.contextTag = -1; #endif @@ -1006,6 +1443,21 @@ return GL_TRUE; } + +Bool GLX_PREFIX(glXMakeCurrent)(Display *dpy, GLXDrawable draw, GLXContext gc) +{ + return MakeContextCurrent( dpy, draw, draw, gc ); +} + +GLX_ALIAS(Bool, glXMakeCurrentReadSGI, + (Display *dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx), + (dpy, d, r, ctx), MakeContextCurrent) + +GLX_ALIAS(Bool, glXMakeContextCurrent, + (Display *dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx), + (dpy, d, r, ctx), MakeContextCurrent) + + #ifdef DEBUG void __glXDumpDrawBuffer(__GLXcontext *ctx) { @@ -1029,3 +1481,61 @@ } } #endif + +#ifdef USE_SPARC_ASM +/* + * Used only when we are sparc, using sparc assembler. + * + */ + +static void +_glx_mesa_init_sparc_glapi_relocs(void) +{ + unsigned int *insn_ptr, *end_ptr; + unsigned long disp_addr; + + insn_ptr = &_mesa_sparc_glapi_begin; + end_ptr = &_mesa_sparc_glapi_end; + disp_addr = (unsigned long) &_glapi_Dispatch; + + /* + * Verbatim from Mesa sparc.c. It's needed because there doesn't + * seem to be a better way to do this: + * + * UNCONDITIONAL_JUMP ( (*_glapi_Dispatch) + entry_offset ) + * + * This code is patching in the ADDRESS of the pointer to the + * dispatch table. Hence, it must be called exactly once, because + * that address is not going to change. + * + * What it points to can change, but Mesa (and hence, we) assume + * that there is only one pointer. + * + */ + while (insn_ptr < end_ptr) { +#if ( defined(__sparc_v9__) && ( !defined(__linux__) || defined(__linux_64__) ) ) +/* + This code patches for 64-bit addresses. This had better + not happen for Sparc/Linux, no matter what architecture we + are building for. So, don't do this. + + The 'defined(__linux_64__)' is used here as a placeholder for + when we do do 64-bit usermode on sparc linux. + */ + insn_ptr[0] |= (disp_addr >> (32 + 10)); + insn_ptr[1] |= ((disp_addr & 0xffffffff) >> 10); + __glapi_sparc_icache_flush(&insn_ptr[0]); + insn_ptr[2] |= ((disp_addr >> 32) & ((1 << 10) - 1)); + insn_ptr[3] |= (disp_addr & ((1 << 10) - 1)); + __glapi_sparc_icache_flush(&insn_ptr[2]); + insn_ptr += 11; +#else + insn_ptr[0] |= (disp_addr >> 10); + insn_ptr[1] |= (disp_addr & ((1 << 10) - 1)); + __glapi_sparc_icache_flush(&insn_ptr[0]); + insn_ptr += 5; +#endif + } +} +#endif /* sparc ASM in use */ + Index: xc/lib/GL/glx/glxextensions.c diff -u /dev/null xc/lib/GL/glx/glxextensions.c:1.2 --- /dev/null Sat Feb 28 21:41:11 2004 +++ xc/lib/GL/glx/glxextensions.c Wed Jan 28 16:18:48 2004 @@ -0,0 +1,421 @@ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS 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. + * + * Authors: + * Ian Romanick + */ +/* $XFree86: xc/lib/GL/glx/glxextensions.c,v 1.2 2004/01/28 21:18:48 alanh Exp $ */ + +#include "packsingle.h" +#include "glxclient.h" +#include +#include +#include +#include "glapi.h" +#include "glxextensions.h" +#include "simple_list.h" + +#define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8))) +#define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8))) +#define IS_SET(m,b) ((m[ (b) / 8 ] & (1U << ((b) % 8))) != 0) +#define CONCAT(a,b) a ## b +#define GLX(n) "GLX_" # n, 4 + sizeof( # n ) - 1, CONCAT(n,_bit) +#define VER(a,b) a, b +#define Y 1 +#define N 0 +#define EXT_ENABLED(bit,supported) ((bit < 255) && IS_SET( supported, bit )) + +static const struct { + const char * const name; + unsigned name_len; + + unsigned char bit; + + /* This is the lowest version of GLX that "requires" this extension. + * For example, GLX 1.3 requires SGIX_fbconfig, SGIX_pbuffer, and + * SGI_make_current_read. If the extension is not required by any known + * version of GLX, use 0, 0. + */ + unsigned char version_major; + unsigned char version_minor; + unsigned char client_support; + unsigned char direct_support; + unsigned char client_only; /** Is the extension client-side only? */ + unsigned char direct_only; /** Is the extension for direct + * contexts only? + */ +} known_glx_extensions[] = { + { GLX(ARB_get_proc_address), VER(1,4), Y, N, Y, N }, + { GLX(ARB_multisample), VER(1,4), Y, N, N, N }, + { GLX(ARB_render_texture), VER(0,0), N, N, N, N }, + { GLX(ATI_pixel_format_float), VER(0,0), N, N, N, N }, + { GLX(EXT_import_context), VER(0,0), Y, Y, N, N }, + { GLX(EXT_visual_info), VER(0,0), Y, Y, N, N }, + { GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N }, + { GLX(MESA_agp_offset), VER(0,0), N, N, N, Y }, /* Deprecated */ + { GLX(MESA_allocate_memory), VER(0,0), Y, N, N, Y }, + { GLX(MESA_copy_sub_buffer), VER(0,0), N, N, N, N }, /* Deprecated? */ + { GLX(MESA_pixmap_colormap), VER(0,0), N, N, N, N }, /* Deprecated */ + { GLX(MESA_release_buffers), VER(0,0), N, N, N, N }, /* Deprecated */ + { GLX(MESA_set_3dfx_mode), VER(0,0), N, N, N, N }, /* Deprecated */ + { GLX(MESA_swap_control), VER(0,0), Y, N, N, Y }, + { GLX(MESA_swap_frame_usage), VER(0,0), Y, N, N, Y }, + { GLX(NV_float_buffer), VER(0,0), N, N, N, N }, + { GLX(NV_render_depth_texture), VER(0,0), N, N, N, N }, + { GLX(NV_render_texture_rectangle), VER(0,0), N, N, N, N }, + { GLX(NV_vertex_array_range), VER(0,0), N, N, N, Y }, /* Deprecated */ + { GLX(OML_swap_method), VER(0,0), Y, N, N, N }, + { GLX(OML_sync_control), VER(0,0), Y, N, N, Y }, + { GLX(SGI_cushion), VER(0,0), N, N, N, N }, + { GLX(SGI_make_current_read), VER(1,3), Y, N, N, N }, + { GLX(SGI_swap_control), VER(0,0), Y, N, N, N }, + { GLX(SGI_video_sync), VER(0,0), Y, N, N, Y }, + { GLX(SGIS_blended_overlay), VER(0,0), N, N, N, N }, + { GLX(SGIS_color_range), VER(0,0), N, N, N, N }, + { GLX(SGIS_multisample), VER(0,0), Y, N, N, N }, + { GLX(SGIX_dm_buffer), VER(0,0), N, N, N, N }, + { GLX(SGIX_fbconfig), VER(1,3), Y, N, N, N }, + { GLX(SGIX_pbuffer), VER(1,3), N, N, N, N }, + { GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N }, + { GLX(SGIX_swap_group), VER(0,0), N, N, N, N }, + { GLX(SGIX_video_resize), VER(0,0), N, N, N, N }, + { GLX(SGIX_video_source), VER(0,0), N, N, N, N }, + { GLX(SGIX_visual_select_group), VER(0,0), Y, N, N, N }, + { GLX(SUN_get_transparent_index), VER(0,0), N, N, N, N }, + { NULL } +}; + +/* global bit-fields of available extensions and their characteristics */ +static unsigned char client_support[8]; +static unsigned char client_only[8]; +static unsigned char direct_only[8]; + +/** + * Bits representing the set of extensions that are enabled by default in all + * direct rendering drivers. + */ +static unsigned char direct_support[8]; + +/* client extensions string */ +static const char * __glXGLXClientExtensions = NULL; + +static void __glXExtensionsCtr( void ); +static void __glXExtensionsCtrScreen( __GLXscreenConfigs *psc ); +static void __glXProcessServerString( const char * server_string, + unsigned char * server_support ); + +/** + * Set the state of a GLX extension. + * + * \param name Name of the extension. + * \param name_len Length, in characters, of the extension name. + * \param state New state (either enabled or disabled) of the extension. + * \param supported Table in which the state of the extension is to be set. + */ +static void +set_glx_extension( const char * name, unsigned name_len, GLboolean state, + unsigned char * supported ) +{ + unsigned i; + + + for ( i = 0 ; known_glx_extensions[i].name != NULL ; i++ ) { + if ( (name_len == known_glx_extensions[i].name_len) + && (strncmp( known_glx_extensions[i].name, name, name_len ) == 0) ) { + if ( state ) { + SET_BIT( supported, known_glx_extensions[i].bit ); + } + else { + CLR_BIT( supported, known_glx_extensions[i].bit ); + } + + return; + } + } +} + + +#define NUL '\0' +#define SEPARATOR ' ' + +/** + * Convert the server's extension string to a bit-field. + * + * \param server_string GLX extension string from the server. + * \param server_support Bit-field of supported extensions. + */ +static void +__glXProcessServerString( const char * server_string, + unsigned char * server_support ) +{ + unsigned base; + unsigned len; + + (void) memset( server_support, 0, sizeof( server_support ) ); + + for ( base = 0 ; server_string[ base ] != NUL ; /* empty */ ) { + /* Determine the length of the next extension name. + */ + for ( len = 0 + ; (server_string[ base + len ] != SEPARATOR) + && (server_string[ base + len ] != NUL) + ; len++ ) { + /* empty */ + } + + /* Set the bit for the extension in the server_support table. + */ + set_glx_extension( & server_string[ base ], len, GL_TRUE, + server_support ); + + /* Advance to the next extension string. This means that we skip + * over the previous string and any trialing white-space. + */ + for ( base += len ; + (server_string[ base ] == SEPARATOR) + && (server_string[ base ] != NUL) + ; base++ ) { + /* empty */ + } + } +} + + +/** + * Enable a named GLX extension on a given screen. + * + * \param psc Pointer to GLX per-screen record. + * \param name Name of the extension to enable. + */ +void +__glXScrEnableExtension( __GLXscreenConfigs *psc, const char * name ) +{ + __glXExtensionsCtr(); + __glXExtensionsCtrScreen(psc); + set_glx_extension( name, strlen( name ), GL_TRUE, psc->direct_support ); +} + + +/** + * Initialize global extension support tables. + */ + +static void +__glXExtensionsCtr( void ) +{ + unsigned i; + static GLboolean ext_list_first_time = GL_TRUE; + + + if ( ext_list_first_time ) { + ext_list_first_time = GL_FALSE; + + (void) memset( client_support, 0, sizeof( client_support ) ); + (void) memset( direct_support, 0, sizeof( direct_support ) ); + (void) memset( client_only, 0, sizeof( client_only ) ); + (void) memset( direct_only, 0, sizeof( direct_only ) ); + + for ( i = 0 ; known_glx_extensions[i].name != NULL ; i++ ) { + const unsigned bit = known_glx_extensions[i].bit; + + if ( known_glx_extensions[i].client_support ) { + SET_BIT( client_support, bit ); + } + + if ( known_glx_extensions[i].direct_support ) { + SET_BIT( direct_support, bit ); + } + + if ( known_glx_extensions[i].client_only ) { + SET_BIT( client_only, bit ); + } + + if ( known_glx_extensions[i].direct_only ) { + SET_BIT( direct_only, bit ); + } + } + } +} + + +/** + * Make sure that per-screen direct-support table is initialized. + * + * \param psc Pointer to GLX per-screen record. + */ + +static void +__glXExtensionsCtrScreen( __GLXscreenConfigs *psc ) +{ + if (psc->ext_list_first_time) { + psc->ext_list_first_time = GL_FALSE; + (void) memcpy( psc->direct_support, direct_support, + sizeof( direct_support ) ); + } +} + + +/** + * Check if a certain extension is enabled on a given screen. + * + * \param psc Pointer to GLX per-screen record. + * \param bit Bit index in the direct-support table. + * \returns If the extension bit is enabled for the screen, \c GL_TRUE is + * returned. If the extension bit is not enabled or if \c psc is + * \c NULL, then \c GL_FALSE is returned. + */ +GLboolean +__glXExtensionBitIsEnabled( __GLXscreenConfigs *psc, unsigned bit ) +{ + GLboolean enabled = GL_FALSE; + + if ( psc != NULL ) { + __glXExtensionsCtr(); + __glXExtensionsCtrScreen( psc ); + enabled = EXT_ENABLED( bit, psc->direct_support ); + } + + return enabled; +} + + +/** + * Convert a bit-field to a string of supported extensions. + */ +static char * +__glXGetStringFromTable( const unsigned char * supported ) +{ + unsigned i; + unsigned ext_str_len; + char * ext_str; + char * point; + + + ext_str_len = 0; + for ( i = 0 ; known_glx_extensions[i].name != NULL ; i++ ) { + if ( EXT_ENABLED( known_glx_extensions[i].bit, supported ) ) { + ext_str_len += known_glx_extensions[i].name_len + 1; + } + } + + ext_str = Xmalloc( ext_str_len + 1 ); + if ( ext_str != NULL ) { + point = ext_str; + + for ( i = 0 ; known_glx_extensions[i].name != NULL ; i++ ) { + if ( EXT_ENABLED( known_glx_extensions[i].bit, supported ) ) { + (void) memcpy( point, known_glx_extensions[i].name, + known_glx_extensions[i].name_len ); + point += known_glx_extensions[i].name_len; + + *point = ' '; + point++; + } + } + + *point = '\0'; + } + + return ext_str; +} + + +/** + * Get the string of client library supported extensions. + */ +const char * +__glXGetClientExtensions( void ) +{ + if ( __glXGLXClientExtensions == NULL ) { + __glXExtensionsCtr(); + __glXGLXClientExtensions = __glXGetStringFromTable( client_support ); + } + + return __glXGLXClientExtensions; +} + + +/** + * Calculate the list of application usable extensions. The resulting + * string is stored in \c psc->effectiveGLXexts. + * + * \param psc Pointer to GLX per-screen record. + * \param display_is_direct_capable True if the display is capable of + * direct rendering. + * \param minor_version GLX minor version from the server. + * + * \todo Once libGL has full GLX 1.3 support, remove the SGI_make_current_read + * hack. + */ + +void +__glXCalculateUsableExtensions( __GLXscreenConfigs *psc, + GLboolean display_is_direct_capable, + int minor_version ) +{ + unsigned char server_support[8]; + unsigned char usable[8]; + unsigned i; + + __glXExtensionsCtr(); + __glXExtensionsCtrScreen( psc ); + __glXProcessServerString( psc->serverGLXexts, server_support ); + + + /* This is a hack. Some servers support GLX 1.3 but don't export + * SGI_make_current_read. This libGL supports SGI_make_current_read but + * doesn't have full GLX 1.3 support. Until GLX 1.3 is fully supported + * this hack is done to export the functionality to applications. + */ + + if ( minor_version >= 3 ) { + SET_BIT( server_support, SGI_make_current_read_bit ); + } + + + /* An extension is supported if the client-side (i.e., libGL) supports + * it and the "server" supports it. In this case that means that either + * the true server supports it or it is only for direct-rendering and + * the direct rendering driver supports it. + * + * If the display is not capable of direct rendering, then the extension + * is enabled if and only if the client-side library and the server + * support it. + */ + + if ( display_is_direct_capable ) { + for ( i = 0 ; i < 8 ; i++ ) { + usable[i] = (client_support[i] & client_only[i]) + | (client_support[i] & psc->direct_support[i] & server_support[i]) + | (client_support[i] & psc->direct_support[i] & direct_only[i]); + } + } + else { + for ( i = 0 ; i < 8 ; i++ ) { + usable[i] = (client_support[i] & client_only[i]) + | (client_support[i] & server_support[i]); + } + } + + psc->effectiveGLXexts = __glXGetStringFromTable( usable ); +} Index: xc/lib/GL/glx/glxextensions.h diff -u /dev/null xc/lib/GL/glx/glxextensions.h:1.3 --- /dev/null Sat Feb 28 21:41:11 2004 +++ xc/lib/GL/glx/glxextensions.h Thu Oct 23 11:30:09 2003 @@ -0,0 +1,106 @@ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS 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. + * + * Authors: + * Ian Romanick + */ +/* $XFree86: xc/lib/GL/glx/glxextensions.h,v 1.3 2003/10/23 15:30:09 tsi Exp $ */ + +#ifndef GLX_GLXEXTENSIONS_H +#define GLX_GLXEXTENSIONS_H + +enum { + ARB_get_proc_address_bit = 0, + ARB_multisample_bit, + ARB_render_texture_bit, + ATI_pixel_format_float_bit, + EXT_visual_info_bit, + EXT_visual_rating_bit, + EXT_import_context_bit, + MESA_agp_offset_bit, + MESA_allocate_memory_bit, /* Replaces MESA_agp_offset & NV_vertex_array_range */ + MESA_copy_sub_buffer_bit, + MESA_depth_float_bit, + MESA_pixmap_colormap_bit, + MESA_release_buffers_bit, + MESA_set_3dfx_mode_bit, + MESA_swap_control_bit, + MESA_swap_frame_usage_bit, + NV_float_buffer_bit, + NV_render_depth_texture_bit, + NV_render_texture_rectangle_bit, + NV_vertex_array_range_bit, + OML_swap_method_bit, + OML_sync_control_bit, + SGI_cushion_bit, + SGI_make_current_read_bit, + SGI_swap_control_bit, + SGI_video_sync_bit, + SGIS_blended_overlay_bit, + SGIS_color_range_bit, + SGIS_multisample_bit, + SGIX_dm_buffer_bit, + SGIX_fbconfig_bit, + SGIX_pbuffer_bit, + SGIX_swap_barrier_bit, + SGIX_swap_group_bit, + SGIX_video_resize_bit, + SGIX_video_source_bit, + SGIX_visual_select_group_bit, + SUN_get_transparent_index_bit +}; + +extern GLboolean __glXExtensionBitIsEnabled( __GLXscreenConfigs *psc, unsigned bit ); +extern const char * __glXGetClientExtensions( void ); +extern void __glXCalculateUsableExtensions( __GLXscreenConfigs *psc, + GLboolean display_is_direct_capable, int server_minor_version ); +extern void __glXScrEnableExtension( __GLXscreenConfigs *psc, const char * name ); + +/* The void pointers here are because __GLXscreenConfigs is opaque for + * DRI drivers. + */ +typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name ); + +/* Source-level backwards compatibility with old drivers. They won't + * find the respective functions, though. + */ +typedef void (* PFNGLXENABLEEXTENSIONPROC) ( const char * name, + GLboolean force_client ); +typedef void (* PFNGLXDISABLEEXTENSIONPROC) ( const char * name ); + + +#ifdef GLX_NO_STATIC_EXTENSION_FUNCTIONS +# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) +#else +# if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED) +# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \ + return_type GLX_PREFIX( real_func ) proto_args \ + __attribute__ ((alias( # aliased_func ) )); +# else +# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \ + return_type GLX_PREFIX( real_func ) proto_args \ + { return aliased_func args ; } +# endif /* __GNUC__ */ +#endif /* GLX_NO_STATIC_EXTENSION_FUNCTIONS */ + +#endif /* GLX_GLXEXTENSIONS_H */ Index: xc/lib/GL/glx/indirect.h diff -u xc/lib/GL/glx/indirect.h:1.4 xc/lib/GL/glx/indirect.h:1.6 --- xc/lib/GL/glx/indirect.h:1.4 Fri Feb 22 16:32:54 2002 +++ xc/lib/GL/glx/indirect.h Wed Jan 28 13:11:41 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/indirect.h,v 1.4 2002/02/22 21:32:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/indirect.h,v 1.6 2004/01/28 18:11:41 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -381,7 +381,7 @@ void __indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint *params); void __indirect_glTexImage1D(GLenum target, GLint level, GLint components, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *image); void __indirect_glTexImage2D(GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *image); -void __indirect_glTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *image); +void __indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *image); void __indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param); void __indirect_glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params); void __indirect_glTexParameteri(GLenum target, GLenum pname, GLint param); @@ -460,4 +460,65 @@ void __indirect_glLoadTransposeMatrixdARB(const GLdouble *m); void __indirect_glMultTransposeMatrixdARB(const GLdouble *m); +void __indirect_glSampleCoverageARB( GLfloat value, GLboolean invert ); + +void __indirect_glPointParameterfARB(GLenum pname, GLfloat param); +void __indirect_glPointParameterfvARB(GLenum pname, const GLfloat *params); +void __indirect_glPointParameteri(GLenum, GLint); +void __indirect_glPointParameteriv(GLenum, const GLint *); + +void __indirect_glActiveStencilFaceEXT(GLenum mode); + +void __indirect_glWindowPos2dARB(GLdouble x, GLdouble y); +void __indirect_glWindowPos2iARB(GLint x, GLint y); +void __indirect_glWindowPos2fARB(GLfloat x, GLfloat y); +void __indirect_glWindowPos2sARB(GLshort x, GLshort y); +void __indirect_glWindowPos2dvARB(const GLdouble * p); +void __indirect_glWindowPos2fvARB(const GLfloat * p); +void __indirect_glWindowPos2ivARB(const GLint * p); +void __indirect_glWindowPos2svARB(const GLshort * p); +void __indirect_glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z); +void __indirect_glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z); +void __indirect_glWindowPos3iARB(GLint x, GLint y, GLint z); +void __indirect_glWindowPos3sARB(GLshort x, GLshort y, GLshort z); +void __indirect_glWindowPos3dvARB(const GLdouble * p); +void __indirect_glWindowPos3fvARB(const GLfloat * p); +void __indirect_glWindowPos3ivARB(const GLint * p); +void __indirect_glWindowPos3svARB(const GLshort * p); + +void __indirect_glMultiDrawArrays(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +void __indirect_glMultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, const GLvoid ** indices, GLsizei primcount); +void __indirect_glBlendFuncSeparate(GLenum, GLenum, GLenum, GLenum); + +void __indirect_glSampleMaskSGIS( GLfloat value, GLboolean invert ); +void __indirect_glSamplePatternSGIS( GLenum pass ); + +/* 145. GL_EXT_secondary_color / GL 1.4 */ + +void __indirect_glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); +void __indirect_glSecondaryColor3b(GLbyte red, GLbyte green, GLbyte blue); +void __indirect_glSecondaryColor3bv(const GLbyte *v); +void __indirect_glSecondaryColor3d(GLdouble red, GLdouble green, GLdouble blue); +void __indirect_glSecondaryColor3dv(const GLdouble *v); +void __indirect_glSecondaryColor3f(GLfloat red, GLfloat green, GLfloat blue); +void __indirect_glSecondaryColor3fv(const GLfloat *v); +void __indirect_glSecondaryColor3i(GLint red, GLint green, GLint blue); +void __indirect_glSecondaryColor3iv(const GLint *v); +void __indirect_glSecondaryColor3s(GLshort red, GLshort green, GLshort blue); +void __indirect_glSecondaryColor3sv(const GLshort *v); +void __indirect_glSecondaryColor3ub(GLubyte red, GLubyte green, GLubyte blue); +void __indirect_glSecondaryColor3ubv(const GLubyte *v); +void __indirect_glSecondaryColor3ui(GLuint red, GLuint green, GLuint blue); +void __indirect_glSecondaryColor3uiv(const GLuint *v); +void __indirect_glSecondaryColor3us(GLushort red, GLushort green, GLushort blue); +void __indirect_glSecondaryColor3usv(const GLushort *v); + +/* 149. GL_EXT_fog_coord / GL 1.4 */ + +void __indirect_glFogCoordPointer (GLenum, GLsizei, const GLvoid *); +void __indirect_glFogCoordd(GLdouble f); +void __indirect_glFogCoorddv(const GLdouble *v); +void __indirect_glFogCoordf(GLfloat f); +void __indirect_glFogCoordfv(const GLfloat *v); + #endif /* _INDIRECT_H_ */ Index: xc/lib/GL/glx/indirect_init.c diff -u xc/lib/GL/glx/indirect_init.c:1.7 xc/lib/GL/glx/indirect_init.c:1.10 --- xc/lib/GL/glx/indirect_init.c:1.7 Fri Feb 22 16:32:54 2002 +++ xc/lib/GL/glx/indirect_init.c Sat Jan 31 04:29:32 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/indirect_init.c,v 1.7 2002/02/22 21:32:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/indirect_init.c,v 1.10 2004/01/31 09:29:32 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -45,19 +45,59 @@ return 0; } +/** + * \name Vertex array pointer bridge functions + * + * When EXT_vertex_array was moved into the core GL spec, the \c count + * parameter was lost. This libGL really only wants to implement the GL 1.1 + * version, but we need to support applications that were written to the old + * interface. These bridge functions are part of the glue that makes this + * happen. + */ +/*@{*/ +static void ColorPointerEXT(GLint size, GLenum type, GLsizei stride, + GLsizei count, const GLvoid * pointer ) +{ + (void) count; __indirect_glColorPointer( size, type, stride, pointer ); +} + +static void EdgeFlagPointerEXT(GLsizei stride, + GLsizei count, const GLboolean * pointer ) +{ + (void) count; __indirect_glEdgeFlagPointer( stride, pointer ); +} + +static void IndexPointerEXT(GLenum type, GLsizei stride, + GLsizei count, const GLvoid * pointer ) +{ + (void) count; __indirect_glIndexPointer( type, stride, pointer ); +} + +static void NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, + const GLvoid * pointer ) +{ + (void) count; __indirect_glNormalPointer( type, stride, pointer ); +} + +static void TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, + GLsizei count, const GLvoid * pointer ) +{ + (void) count; __indirect_glTexCoordPointer( size, type, stride, pointer ); +} + +static void VertexPointerEXT(GLint size, GLenum type, GLsizei stride, + GLsizei count, const GLvoid * pointer ) +{ + (void) count; __indirect_glVertexPointer( size, type, stride, pointer ); +} +/*@}*/ + __GLapi *__glXNewIndirectAPI(void) { __GLapi *glAPI; GLuint entries; - /* Have to register dynamic extensions before allocating any - * dispatch tables. - */ -#if defined(GLX_DIRECT_RENDERING) - __glXRegisterExtensions(); -#endif - entries = _glapi_get_dispatch_table_size(); glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *)); @@ -451,6 +491,10 @@ glAPI->ResetMinmax = __indirect_glResetMinmax; glAPI->SeparableFilter2D = __indirect_glSeparableFilter2D; + /* 1.4 */ + glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArrays; + glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElements; + /* ARB 1. GL_ARB_multitexture */ glAPI->ActiveTextureARB = __indirect_glActiveTextureARB; glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB; @@ -493,5 +537,79 @@ glAPI->MultTransposeMatrixdARB = __indirect_glMultTransposeMatrixdARB; glAPI->MultTransposeMatrixfARB = __indirect_glMultTransposeMatrixfARB; + /* ARB 5. GL_ARB_multisample */ + glAPI->SampleCoverageARB = __indirect_glSampleCoverageARB; + + /* ARB 14. GL_ARB_point_parameters */ + glAPI->PointParameterfEXT = __indirect_glPointParameterfARB; + glAPI->PointParameterfvEXT = __indirect_glPointParameterfvARB; + + /* ARB 15. GL_ARB_window_pos */ + glAPI->WindowPos2dMESA = __indirect_glWindowPos2dARB; + glAPI->WindowPos2iMESA = __indirect_glWindowPos2iARB; + glAPI->WindowPos2fMESA = __indirect_glWindowPos2fARB; + glAPI->WindowPos2iMESA = __indirect_glWindowPos2iARB; + glAPI->WindowPos2sMESA = __indirect_glWindowPos2sARB; + glAPI->WindowPos2dvMESA = __indirect_glWindowPos2dvARB; + glAPI->WindowPos2fvMESA = __indirect_glWindowPos2fvARB; + glAPI->WindowPos2ivMESA = __indirect_glWindowPos2ivARB; + glAPI->WindowPos2svMESA = __indirect_glWindowPos2svARB; + glAPI->WindowPos3dMESA = __indirect_glWindowPos3dARB; + glAPI->WindowPos3fMESA = __indirect_glWindowPos3fARB; + glAPI->WindowPos3iMESA = __indirect_glWindowPos3iARB; + glAPI->WindowPos3sMESA = __indirect_glWindowPos3sARB; + glAPI->WindowPos3dvMESA = __indirect_glWindowPos3dvARB; + glAPI->WindowPos3fvMESA = __indirect_glWindowPos3fvARB; + glAPI->WindowPos3ivMESA = __indirect_glWindowPos3ivARB; + glAPI->WindowPos3svMESA = __indirect_glWindowPos3svARB; + + /* 25. GL_SGIS_multisample */ + glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS; + glAPI->SamplePatternSGIS = __indirect_glSamplePatternSGIS; + + /* 30. GL_EXT_vertex_array */ + glAPI->ColorPointerEXT = ColorPointerEXT; + glAPI->EdgeFlagPointerEXT = EdgeFlagPointerEXT; + glAPI->IndexPointerEXT = IndexPointerEXT; + glAPI->NormalPointerEXT = NormalPointerEXT; + glAPI->TexCoordPointerEXT = TexCoordPointerEXT; + glAPI->VertexPointerEXT = VertexPointerEXT; + + /* 145. GL_EXT_secondary_color / GL 1.4 */ + glAPI->SecondaryColor3bEXT = __indirect_glSecondaryColor3b; + glAPI->SecondaryColor3bvEXT = __indirect_glSecondaryColor3bv; + glAPI->SecondaryColor3sEXT = __indirect_glSecondaryColor3s; + glAPI->SecondaryColor3svEXT = __indirect_glSecondaryColor3sv; + glAPI->SecondaryColor3iEXT = __indirect_glSecondaryColor3i; + glAPI->SecondaryColor3ivEXT = __indirect_glSecondaryColor3iv; + glAPI->SecondaryColor3ubEXT = __indirect_glSecondaryColor3ub; + glAPI->SecondaryColor3ubvEXT = __indirect_glSecondaryColor3ubv; + glAPI->SecondaryColor3usEXT = __indirect_glSecondaryColor3us; + glAPI->SecondaryColor3usvEXT = __indirect_glSecondaryColor3usv; + glAPI->SecondaryColor3uiEXT = __indirect_glSecondaryColor3ui; + glAPI->SecondaryColor3uivEXT = __indirect_glSecondaryColor3uiv; + glAPI->SecondaryColor3fEXT = __indirect_glSecondaryColor3f; + glAPI->SecondaryColor3fvEXT = __indirect_glSecondaryColor3fv; + glAPI->SecondaryColor3dEXT = __indirect_glSecondaryColor3d; + glAPI->SecondaryColor3dvEXT = __indirect_glSecondaryColor3dv; + glAPI->SecondaryColorPointerEXT = __indirect_glSecondaryColorPointer; + + /* 149. GL_EXT_fog_coord / GL 1.4 */ + glAPI->FogCoordfEXT = __indirect_glFogCoordf; + glAPI->FogCoordfvEXT = __indirect_glFogCoordfv; + glAPI->FogCoorddEXT = __indirect_glFogCoordd; + glAPI->FogCoorddvEXT = __indirect_glFogCoorddv; + glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointer; + + /* 173. GL_EXT_blend_func_separate / GL 1.4 */ + glAPI->BlendFuncSeparateEXT = __indirect_glBlendFuncSeparate; + + /* 262. GL_NV_point_sprite / GL 1.4 */ + glAPI->PointParameteriNV = __indirect_glPointParameteri; + glAPI->PointParameterivNV = __indirect_glPointParameteriv; + + /* 268. GL_EXT_stencil_two_side */ + glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT; + return glAPI; } Index: xc/lib/GL/glx/indirect_wrap.h diff -u xc/lib/GL/glx/indirect_wrap.h:1.3 xc/lib/GL/glx/indirect_wrap.h:1.5 --- xc/lib/GL/glx/indirect_wrap.h:1.3 Tue Feb 15 14:19:19 2000 +++ xc/lib/GL/glx/indirect_wrap.h Wed Jan 28 13:11:42 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/indirect_wrap.h,v 1.3 2000/02/15 19:19:19 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/indirect_wrap.h,v 1.5 2004/01/28 18:11:42 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -380,6 +380,11 @@ #define glTexImage3D __indirect_glTexImage3D #define glTexSubImage3D __indirect_glTexSubImage3D +/* 1.4 */ +#define glMultiDrawArrays __indirect_glMultiDrawArrays +#define glMultiDrawElements __indirect_glMultiDrawElements +#define glBlendFuncSeparate __indirect_glBlendFuncSeparate + /* GL_ARB_imaging */ #define glBlendColor __indirect_glBlendColor #define glBlendEquation __indirect_glBlendEquation @@ -416,7 +421,7 @@ #define glResetMinmax __indirect_glResetMinmax #define glSeparableFilter2D __indirect_glSeparableFilter2D -/* GL_ARB_multitexture */ +/* ARB 1. GL_ARB_multitexture */ #define glActiveTextureARB __indirect_glActiveTextureARB #define glClientActiveTextureARB __indirect_glClientActiveTextureARB #define glMultiTexCoord1dARB __indirect_glMultiTexCoord1dARB @@ -452,6 +457,47 @@ #define glMultiTexCoord4sARB __indirect_glMultiTexCoord4sARB #define glMultiTexCoord4svARB __indirect_glMultiTexCoord4svARB +/* ARB 3. ARB_transpose_matrix */ + +#define glLoadTransposeMatrixdARB __indirect_glLoadTransposeMatrixdARB +#define glLoadTransposeMatrixfARB __indirect_glLoadTransposeMatrixfARB +#define glMultTransposeMatrixdARB __indirect_glMultTransposeMatrixdARB +#define glMultTransposeMatrixfARB __indirect_glMultTransposeMatrixfARB + +/* ARB 5. ARB_multisample */ + +#define glSampleCoverageARB __indirect_glSampleCoverageARB + +/* ARB 12. ARB_texture_compression */ + +/* FIXME: Not yet supported. */ + +/* ARB 14. ARB_point_parameters / GL 1.4 / NV_point_sprite */ + +#define glPointParameterfARB __indirect_glPointParameterfARB +#define glPointParameterfvARB __indirect_glPointParameterfvARB +#define glPointParameteri __indirect_glPointParameteri +#define glPointParameteriv __indirect_glPointParameteriv + +/* ARB 25. ARB_window_pos */ + +#define glWindowPos2dARB __indirect_glWindowPos2dARB +#define glWindowPos2fARB __indirect_glWindowPos2fARB +#define glWindowPos2iARB __indirect_glWindowPos2iARB +#define glWindowPos2sARB __indirect_glWindowPos2sARB +#define glWindowPos2dvARB __indirect_glWindowPos2dvARB +#define glWindowPos2fvARB __indirect_glWindowPos2fvARB +#define glWindowPos2ivARB __indirect_glWindowPos2ivARB +#define glWindowPos2svARB __indirect_glWindowPos2svARB +#define glWindowPos3dARB __indirect_glWindowPos3dARB +#define glWindowPos3fARB __indirect_glWindowPos3fARB +#define glWindowPos3iARB __indirect_glWindowPos3iARB +#define glWindowPos3sARB __indirect_glWindowPos3sARB +#define glWindowPos3dvARB __indirect_glWindowPos3dvARB +#define glWindowPos3fvARB __indirect_glWindowPos3fvARB +#define glWindowPos3ivARB __indirect_glWindowPos3ivARB +#define glWindowPos3svARB __indirect_glWindowPos3svARB + /* * Extensions */ @@ -628,9 +674,57 @@ #define glResizeBuffersMESA __indirect_glResizeBuffersMESA -#define glLoadTransposeMatrixdARB __indirect_glLoadTransposeMatrixdARB -#define glLoadTransposeMatrixfARB __indirect_glLoadTransposeMatrixfARB -#define glMultTransposeMatrixdARB __indirect_glMultTransposeMatrixdARB -#define glMultTransposeMatrixfARB __indirect_glMultTransposeMatrixfARB +#define glActiveStencilFaceEXT __indirect_glActiveStencilFaceEXT + +#define glPointParameterfARB __indirect_glPointParameterfARB +#define glPointParameterfvARB __indirect_glPointParameterfvARB + +#define glActiveStencilFaceEXT __indirect_glActiveStencilFaceEXT + +#define glWindowPos2dARB __indirect_glWindowPos2dARB +#define glWindowPos2iARB __indirect_glWindowPos2iARB +#define glWindowPos2fARB __indirect_glWindowPos2fARB +#define glWindowPos2iARB __indirect_glWindowPos2iARB +#define glWindowPos2sARB __indirect_glWindowPos2sARB +#define glWindowPos2dvARB __indirect_glWindowPos2dvARB +#define glWindowPos2fvARB __indirect_glWindowPos2fvARB +#define glWindowPos2ivARB __indirect_glWindowPos2ivARB +#define glWindowPos2svARB __indirect_glWindowPos2svARB +#define glWindowPos3dARB __indirect_glWindowPos3dARB +#define glWindowPos3fARB __indirect_glWindowPos3fARB +#define glWindowPos3iARB __indirect_glWindowPos3iARB +#define glWindowPos3sARB __indirect_glWindowPos3sARB +#define glWindowPos3dvARB __indirect_glWindowPos3dvARB +#define glWindowPos3fvARB __indirect_glWindowPos3fvARB +#define glWindowPos3ivARB __indirect_glWindowPos3ivARB +#define glWindowPos3svARB __indirect_glWindowPos3svARB + +/* 145. GL_EXT_secondary_color / GL 1.4 */ + +#define glSecondaryColor3b __indirect_glSecondaryColor3b +#define glSecondaryColor3bv __indirect_glSecondaryColor3bv +#define glSecondaryColor3d __indirect_glSecondaryColor3d +#define glSecondaryColor3dv __indirect_glSecondaryColor3dv +#define glSecondaryColor3f __indirect_glSecondaryColor3f +#define glSecondaryColor3fv __indirect_glSecondaryColor3fv +#define glSecondaryColor3i __indirect_glSecondaryColor3i +#define glSecondaryColor3iv __indirect_glSecondaryColor3iv +#define glSecondaryColor3s __indirect_glSecondaryColor3s +#define glSecondaryColor3sv __indirect_glSecondaryColor3sv +#define glSecondaryColor3ub __indirect_glSecondaryColor3ub +#define glSecondaryColor3ubv __indirect_glSecondaryColor3ubv +#define glSecondaryColor3ui __indirect_glSecondaryColor3ui +#define glSecondaryColor3uiv __indirect_glSecondaryColor3uiv +#define glSecondaryColor3us __indirect_glSecondaryColor3us +#define glSecondaryColor3usv __indirect_glSecondaryColor3usv +#define glSecondaryColorPointer __indirect_glSecondaryColorPointer + +/* 149. GL_EXT_fog_coord / GL 1.4 */ + +#define glFogCoordf __indirect_glFogCoordf +#define glFogCoordd __indirect_glFogCoordd +#define glFogCoordfv __indirect_glFogCoordfv +#define glFogCoorddv __indirect_glFogCoorddv +#define glFogCoordPointer __indirect_glFogCoordPointer #endif /* _INDIRECT_WRAP_H_ */ Index: xc/lib/GL/glx/packrender.h diff -u xc/lib/GL/glx/packrender.h:1.7 xc/lib/GL/glx/packrender.h:1.8 --- xc/lib/GL/glx/packrender.h:1.7 Wed Oct 30 07:51:26 2002 +++ xc/lib/GL/glx/packrender.h Thu Oct 23 11:30:09 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/packrender.h,v 1.7 2002/10/30 12:51:26 alanh Exp $ */ +/* $XFree86: xc/lib/GL/glx/packrender.h,v 1.8 2003/10/23 15:30:09 tsi Exp $ */ #ifndef __GLX_packrender_h__ #define __GLX_packrender_h__ @@ -68,9 +68,10 @@ #define __GLX_LOAD_VARIABLES() \ gc = __glXGetCurrentContext(); \ pc = gc->pc; \ - (void) cmdlen; \ - (void) compsize; \ - (void) pixelHeaderPC + /* Muffle compilers */ \ + cmdlen = 0; (void)cmdlen; \ + compsize = 0; (void)compsize; \ + pixelHeaderPC = 0; (void)pixelHeaderPC /* ** Variable sized command support macro. This macro is used by calls Index: xc/lib/GL/glx/packsingle.h diff -u xc/lib/GL/glx/packsingle.h:1.5 xc/lib/GL/glx/packsingle.h:1.6 --- xc/lib/GL/glx/packsingle.h:1.5 Wed Mar 21 11:04:39 2001 +++ xc/lib/GL/glx/packsingle.h Thu Oct 23 11:30:09 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/packsingle.h,v 1.5 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/packsingle.h,v 1.6 2003/10/23 15:30:09 tsi Exp $ */ #ifndef __GLX_packsingle_h__ #define __GLX_packsingle_h__ @@ -63,9 +63,10 @@ #define __GLX_SINGLE_LOAD_VARIABLES() \ pc = gc->pc; \ - (void) pixelHeaderPC; \ - (void) compsize; \ - (void) cmdlen + /* Muffle compilers */ \ + pixelHeaderPC = 0; (void)pixelHeaderPC; \ + compsize = 0; (void)compsize; \ + cmdlen = 0; (void)cmdlen /* Start a single command */ #define __GLX_SINGLE_BEGIN(opcode,bytes) \ @@ -190,7 +191,7 @@ #define __GLX_SINGLE_GET_SHORT_ARRAY(a,alen) \ { \ GLint slop = (alen*__GLX_SIZE_INT16) & 3; \ - _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT16); \ + _XRead(dpy,(char *)a,alen*__GLX_SIZE_INT16);\ if (slop) _XEatData(dpy,4-slop); \ } Index: xc/lib/GL/glx/packvendpriv.h diff -u xc/lib/GL/glx/packvendpriv.h:1.5 xc/lib/GL/glx/packvendpriv.h:1.6 --- xc/lib/GL/glx/packvendpriv.h:1.5 Sun Apr 1 09:59:59 2001 +++ xc/lib/GL/glx/packvendpriv.h Thu Oct 23 11:30:09 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/packvendpriv.h,v 1.5 2001/04/01 13:59:59 tsi Exp $ */ +/* $XFree86: xc/lib/GL/glx/packvendpriv.h,v 1.6 2003/10/23 15:30:09 tsi Exp $ */ #ifndef __GLX_packvendpriv_h__ #define __GLX_packvendpriv_h__ @@ -63,9 +63,10 @@ #define __GLX_VENDPRIV_LOAD_VARIABLES() \ pc = gc->pc; \ - (void) pixelHeaderPC; \ - (void) compsize; \ - (void) cmdlen + /* Muffle compilers */ \ + pixelHeaderPC = 0; (void)pixelHeaderPC; \ + compsize = 0; (void)compsize; \ + cmdlen = 0; (void)cmdlen /* Start a vendor private command */ #define __GLX_VENDPRIV_BEGIN(glxcode, opcode,bytes) \ Index: xc/lib/GL/glx/pixel.c diff -u xc/lib/GL/glx/pixel.c:1.7 xc/lib/GL/glx/pixel.c:1.9 --- xc/lib/GL/glx/pixel.c:1.7 Wed Oct 30 07:51:26 2002 +++ xc/lib/GL/glx/pixel.c Wed Jan 28 13:11:42 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/pixel.c,v 1.7 2002/10/30 12:51:26 alanh Exp $ */ +/* $XFree86: xc/lib/GL/glx/pixel.c,v 1.9 2004/01/28 18:11:42 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -79,120 +79,6 @@ 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, }; -/* -** Return the number of elements per group of a specified format -*/ -static GLint ElementsPerGroup(GLenum format, GLenum type) -{ - /* - ** To make row length computation valid for image extraction, - ** packed pixel types assume elements per group equals one. - */ - switch(type) { - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - return 1; - default: - break; - } - - switch(format) { - case GL_RGB: - case GL_BGR: - return 3; - case GL_LUMINANCE_ALPHA: - return 2; - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - return 4; - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - return 1; - default: - return 0; - } -} - -/* -** Return the number of bytes per element, based on the element type (other -** than GL_BITMAP). -*/ -static GLint BytesPerElement(GLenum type) -{ - switch(type) { - case GL_UNSIGNED_SHORT: - case GL_SHORT: - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - return 2; - case GL_UNSIGNED_BYTE: - case GL_BYTE: - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - return 1; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - return 4; - default: - return 0; - } -} - -/* -** Compute memory required for internal packed array of data of given type -** and format. -*/ -GLint __glImageSize(GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type) -{ - int bytes_per_row; - int components; - - if (width < 0 || height < 0 || depth < 0) { - return 0; - } - /* - ** Zero is returned if either format or type are invalid. - */ - components = ElementsPerGroup(format,type); - if (type == GL_BITMAP) { - if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) { - bytes_per_row = (width + 7) >> 3; - } else { - return 0; - } - } else { - bytes_per_row = BytesPerElement(type) * width; - } - return bytes_per_row * height * depth * components; -} /* ** Copy bitmap data from clients packed memory applying unpacking modes as the @@ -203,11 +89,12 @@ GLenum format, const GLvoid *userdata, GLubyte *destImage) { - GLint rowLength = gc->state.storeUnpack.rowLength; - GLint alignment = gc->state.storeUnpack.alignment; - GLint skipPixels = gc->state.storeUnpack.skipPixels; - GLint skipRows = gc->state.storeUnpack.skipRows; - GLint lsbFirst = gc->state.storeUnpack.lsbFirst; + const __GLXattribute * state = gc->client_state_private; + GLint rowLength = state->storeUnpack.rowLength; + GLint alignment = state->storeUnpack.alignment; + GLint skipPixels = state->storeUnpack.skipPixels; + GLint skipRows = state->storeUnpack.skipRows; + GLint lsbFirst = state->storeUnpack.lsbFirst; GLint elementsLeft, bitOffset, currentByte, nextByte, highBitMask; GLint lowBitMask, i; GLint components, groupsPerRow, rowSize, padding, elementsPerRow; @@ -218,7 +105,7 @@ } else { groupsPerRow = width; } - components = ElementsPerGroup(format,GL_BITMAP); + components = __glElementsPerGroup(format,GL_BITMAP); rowSize = (groupsPerRow * components + 7) >> 3; padding = (rowSize % alignment); if (padding) { @@ -279,13 +166,14 @@ GLint depth, GLenum format, GLenum type, const GLvoid *userdata, GLubyte *newimage, GLubyte *modes) { - GLint rowLength = gc->state.storeUnpack.rowLength; - GLint imageHeight = gc->state.storeUnpack.imageHeight; - GLint alignment = gc->state.storeUnpack.alignment; - GLint skipPixels = gc->state.storeUnpack.skipPixels; - GLint skipRows = gc->state.storeUnpack.skipRows; - GLint skipImages = gc->state.storeUnpack.skipImages; - GLint swapBytes = gc->state.storeUnpack.swapEndian; + const __GLXattribute * state = gc->client_state_private; + GLint rowLength = state->storeUnpack.rowLength; + GLint imageHeight = state->storeUnpack.imageHeight; + GLint alignment = state->storeUnpack.alignment; + GLint skipPixels = state->storeUnpack.skipPixels; + GLint skipRows = state->storeUnpack.skipRows; + GLint skipImages = state->storeUnpack.skipImages; + GLint swapBytes = state->storeUnpack.swapEndian; GLint components, elementSize, rowSize, padding, groupsPerRow, groupSize; GLint elementsPerRow, imageSize, rowsPerImage, h, i, j, k; const GLubyte *start, *iter, *itera, *iterb, *iterc; @@ -294,7 +182,7 @@ if (type == GL_BITMAP) { FillBitmap(gc, width, height, format, userdata, newimage); } else { - components = ElementsPerGroup(format,type); + components = __glElementsPerGroup(format,type); if (rowLength > 0) { groupsPerRow = rowLength; } else { @@ -306,7 +194,7 @@ rowsPerImage = height; } - elementSize = BytesPerElement(type); + elementSize = __glBytesPerElement(type); groupSize = elementSize * components; if (elementSize == 1) swapBytes = 0; @@ -397,11 +285,12 @@ GLenum format, const GLubyte *sourceImage, GLvoid *userdata) { - GLint rowLength = gc->state.storePack.rowLength; - GLint alignment = gc->state.storePack.alignment; - GLint skipPixels = gc->state.storePack.skipPixels; - GLint skipRows = gc->state.storePack.skipRows; - GLint lsbFirst = gc->state.storePack.lsbFirst; + const __GLXattribute * state = gc->client_state_private; + GLint rowLength = state->storePack.rowLength; + GLint alignment = state->storePack.alignment; + GLint skipPixels = state->storePack.skipPixels; + GLint skipRows = state->storePack.skipRows; + GLint lsbFirst = state->storePack.lsbFirst; GLint components, groupsPerRow, rowSize, padding, elementsPerRow; GLint sourceRowSize, sourcePadding, sourceSkip; GLubyte *start, *iter; @@ -409,7 +298,7 @@ GLint writeMask, i; GLubyte writeByte; - components = ElementsPerGroup(format,GL_BITMAP); + components = __glElementsPerGroup(format,GL_BITMAP); if (rowLength > 0) { groupsPerRow = rowLength; } else { @@ -508,12 +397,13 @@ GLint depth, GLenum format, GLenum type, const GLubyte *sourceImage, GLvoid *userdata) { - GLint rowLength = gc->state.storePack.rowLength; - GLint imageHeight = gc->state.storePack.imageHeight; - GLint alignment = gc->state.storePack.alignment; - GLint skipPixels = gc->state.storePack.skipPixels; - GLint skipRows = gc->state.storePack.skipRows; - GLint skipImages = gc->state.storePack.skipImages; + const __GLXattribute * state = gc->client_state_private; + GLint rowLength = state->storePack.rowLength; + GLint imageHeight = state->storePack.imageHeight; + GLint alignment = state->storePack.alignment; + GLint skipPixels = state->storePack.skipPixels; + GLint skipRows = state->storePack.skipRows; + GLint skipImages = state->storePack.skipImages; GLint components, elementSize, rowSize, padding, groupsPerRow, groupSize; GLint elementsPerRow, sourceRowSize, sourcePadding, h, i; GLint imageSize, rowsPerImage; @@ -522,7 +412,7 @@ if (type == GL_BITMAP) { EmptyBitmap(gc, width, height, format, sourceImage, userdata); } else { - components = ElementsPerGroup(format,type); + components = __glElementsPerGroup(format,type); if (rowLength > 0) { groupsPerRow = rowLength; } else { @@ -533,7 +423,7 @@ } else { rowsPerImage = height; } - elementSize = BytesPerElement(type); + elementSize = __glBytesPerElement(type); groupSize = elementSize * components; rowSize = groupsPerRow * groupSize; padding = (rowSize % alignment); Index: xc/lib/GL/glx/pixelstore.c diff -u xc/lib/GL/glx/pixelstore.c:1.3 xc/lib/GL/glx/pixelstore.c:1.5 --- xc/lib/GL/glx/pixelstore.c:1.3 Wed Mar 21 11:04:39 2001 +++ xc/lib/GL/glx/pixelstore.c Wed Jan 28 16:18:48 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/pixelstore.c,v 1.3 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/pixelstore.c,v 1.5 2004/01/28 21:18:48 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -34,7 +34,9 @@ ** */ -#include "packsingle.h" +#include "glxclient.h" +#include "indirect.h" +#include "indirect_wrap.h" /* ** Specify parameters that control the storage format of pixel arrays. @@ -42,6 +44,7 @@ void glPixelStoref(GLenum pname, GLfloat param) { __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = gc->client_state_private; Display *dpy = gc->currentDpy; GLuint a; @@ -54,7 +57,7 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.rowLength = a; + state->storePack.rowLength = a; break; case GL_PACK_IMAGE_HEIGHT: a = (GLuint) (param + 0.5); @@ -62,7 +65,7 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.imageHeight = a; + state->storePack.imageHeight = a; break; case GL_PACK_SKIP_ROWS: a = (GLuint) (param + 0.5); @@ -70,7 +73,7 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.skipRows = a; + state->storePack.skipRows = a; break; case GL_PACK_SKIP_PIXELS: a = (GLuint) (param + 0.5); @@ -78,7 +81,7 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.skipPixels = a; + state->storePack.skipPixels = a; break; case GL_PACK_SKIP_IMAGES: a = (GLuint) (param + 0.5); @@ -86,13 +89,13 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.skipImages = a; + state->storePack.skipImages = a; break; case GL_PACK_ALIGNMENT: a = (GLint) (param + 0.5); switch (a) { case 1: case 2: case 4: case 8: - gc->state.storePack.alignment = a; + state->storePack.alignment = a; break; default: __glXSetError(gc, GL_INVALID_VALUE); @@ -100,10 +103,10 @@ } break; case GL_PACK_SWAP_BYTES: - gc->state.storePack.swapEndian = (param != 0); + state->storePack.swapEndian = (param != 0); break; case GL_PACK_LSB_FIRST: - gc->state.storePack.lsbFirst = (param != 0); + state->storePack.lsbFirst = (param != 0); break; case GL_UNPACK_ROW_LENGTH: @@ -112,7 +115,7 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.rowLength = a; + state->storeUnpack.rowLength = a; break; case GL_UNPACK_IMAGE_HEIGHT: a = (GLuint) (param + 0.5); @@ -120,7 +123,7 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.imageHeight = a; + state->storeUnpack.imageHeight = a; break; case GL_UNPACK_SKIP_ROWS: a = (GLuint) (param + 0.5); @@ -128,7 +131,7 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.skipRows = a; + state->storeUnpack.skipRows = a; break; case GL_UNPACK_SKIP_PIXELS: a = (GLuint) (param + 0.5); @@ -136,7 +139,7 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.skipPixels = a; + state->storeUnpack.skipPixels = a; break; case GL_UNPACK_SKIP_IMAGES: a = (GLuint) (param + 0.5); @@ -144,13 +147,13 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.skipImages = a; + state->storeUnpack.skipImages = a; break; case GL_UNPACK_ALIGNMENT: a = (GLint) (param + 0.5); switch (a) { case 1: case 2: case 4: case 8: - gc->state.storeUnpack.alignment = a; + state->storeUnpack.alignment = a; break; default: __glXSetError(gc, GL_INVALID_VALUE); @@ -158,10 +161,10 @@ } break; case GL_UNPACK_SWAP_BYTES: - gc->state.storeUnpack.swapEndian = (param != 0); + state->storeUnpack.swapEndian = (param != 0); break; case GL_UNPACK_LSB_FIRST: - gc->state.storeUnpack.lsbFirst = (param != 0); + state->storeUnpack.lsbFirst = (param != 0); break; default: /* @@ -177,6 +180,7 @@ void glPixelStorei(GLenum pname, GLint param) { __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = gc->client_state_private; Display *dpy = gc->currentDpy; if (!dpy) return; @@ -187,40 +191,40 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.rowLength = param; + state->storePack.rowLength = param; break; case GL_PACK_IMAGE_HEIGHT: if (param < 0) { __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.imageHeight = param; + state->storePack.imageHeight = param; break; case GL_PACK_SKIP_ROWS: if (param < 0) { __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.skipRows = param; + state->storePack.skipRows = param; break; case GL_PACK_SKIP_PIXELS: if (param < 0) { __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.skipPixels = param; + state->storePack.skipPixels = param; break; case GL_PACK_SKIP_IMAGES: if (param < 0) { __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storePack.skipImages = param; + state->storePack.skipImages = param; break; case GL_PACK_ALIGNMENT: switch (param) { case 1: case 2: case 4: case 8: - gc->state.storePack.alignment = param; + state->storePack.alignment = param; break; default: __glXSetError(gc, GL_INVALID_VALUE); @@ -228,10 +232,10 @@ } break; case GL_PACK_SWAP_BYTES: - gc->state.storePack.swapEndian = (param != 0); + state->storePack.swapEndian = (param != 0); break; case GL_PACK_LSB_FIRST: - gc->state.storePack.lsbFirst = (param != 0); + state->storePack.lsbFirst = (param != 0); break; case GL_UNPACK_ROW_LENGTH: @@ -239,40 +243,40 @@ __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.rowLength = param; + state->storeUnpack.rowLength = param; break; case GL_UNPACK_IMAGE_HEIGHT: if (param < 0) { __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.imageHeight = param; + state->storeUnpack.imageHeight = param; break; case GL_UNPACK_SKIP_ROWS: if (param < 0) { __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.skipRows = param; + state->storeUnpack.skipRows = param; break; case GL_UNPACK_SKIP_PIXELS: if (param < 0) { __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.skipPixels = param; + state->storeUnpack.skipPixels = param; break; case GL_UNPACK_SKIP_IMAGES: if (param < 0) { __glXSetError(gc, GL_INVALID_VALUE); return; } - gc->state.storeUnpack.skipImages = param; + state->storeUnpack.skipImages = param; break; case GL_UNPACK_ALIGNMENT: switch (param) { case 1: case 2: case 4: case 8: - gc->state.storeUnpack.alignment = param; + state->storeUnpack.alignment = param; break; default: __glXSetError(gc, GL_INVALID_VALUE); @@ -280,10 +284,10 @@ } break; case GL_UNPACK_SWAP_BYTES: - gc->state.storeUnpack.swapEndian = (param != 0); + state->storeUnpack.swapEndian = (param != 0); break; case GL_UNPACK_LSB_FIRST: - gc->state.storeUnpack.lsbFirst = (param != 0); + state->storeUnpack.lsbFirst = (param != 0); break; default: /* Index: xc/lib/GL/glx/render2.c diff -u xc/lib/GL/glx/render2.c:1.3 xc/lib/GL/glx/render2.c:1.7 --- xc/lib/GL/glx/render2.c:1.3 Wed Mar 21 11:04:39 2001 +++ xc/lib/GL/glx/render2.c Sat Jan 31 17:44:58 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/render2.c,v 1.3 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/render2.c,v 1.7 2004/01/31 22:44:58 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -35,6 +35,7 @@ */ #include "packrender.h" +#include "size.h" /* ** This file contains routines that might need to be transported as @@ -45,10 +46,10 @@ void glCallLists(GLsizei n, GLenum type, const GLvoid *lists) { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); compsize = __glCallLists_size(n,type); cmdlen = __GLX_PAD(12 + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { @@ -425,28 +426,21 @@ __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; - switch (cap) { -#if 0 - case GL_VERTEX_ARRAY_EXT: - gc->state.vertArray.vertex.enable = GL_TRUE; - return; - case GL_NORMAL_ARRAY_EXT: - gc->state.vertArray.normal.enable = GL_TRUE; - return; - case GL_COLOR_ARRAY_EXT: - gc->state.vertArray.color.enable = GL_TRUE; - return; - case GL_INDEX_ARRAY_EXT: - gc->state.vertArray.index.enable = GL_TRUE; - return; - case GL_TEXTURE_COORD_ARRAY_EXT: - gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable = GL_TRUE; - return; - case GL_EDGE_FLAG_ARRAY_EXT: - gc->state.vertArray.edgeFlag.enable = GL_TRUE; - return; -#endif + switch(cap) { + case GL_COLOR_ARRAY: + case GL_EDGE_FLAG_ARRAY: + case GL_INDEX_ARRAY: + case GL_NORMAL_ARRAY: + case GL_TEXTURE_COORD_ARRAY: + case GL_VERTEX_ARRAY: + case GL_SECONDARY_COLOR_ARRAY: + case GL_FOG_COORDINATE_ARRAY: + glEnableClientState(cap); + return; + default: + break; } + __GLX_BEGIN(X_GLrop_Enable,8); __GLX_PUT_LONG(4,cap); __GLX_END(8); @@ -459,29 +453,60 @@ __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; - switch (cap) { -#if 0 - case GL_VERTEX_ARRAY_EXT: - gc->state.vertArray.vertex.enable = GL_FALSE; - return; - case GL_NORMAL_ARRAY_EXT: - gc->state.vertArray.normal.enable = GL_FALSE; - return; - case GL_COLOR_ARRAY_EXT: - gc->state.vertArray.color.enable = GL_FALSE; - return; - case GL_INDEX_ARRAY_EXT: - gc->state.vertArray.index.enable = GL_FALSE; - return; - case GL_TEXTURE_COORD_ARRAY_EXT: - gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable = GL_FALSE; - return; - case GL_EDGE_FLAG_ARRAY_EXT: - gc->state.vertArray.edgeFlag.enable = GL_FALSE; - return; -#endif + switch(cap) { + case GL_COLOR_ARRAY: + case GL_EDGE_FLAG_ARRAY: + case GL_INDEX_ARRAY: + case GL_NORMAL_ARRAY: + case GL_TEXTURE_COORD_ARRAY: + case GL_VERTEX_ARRAY: + case GL_SECONDARY_COLOR_ARRAY: + case GL_FOG_COORDINATE_ARRAY: + glDisableClientState(cap); + return; + default: + break; } + __GLX_BEGIN(X_GLrop_Disable,8); __GLX_PUT_LONG(4,cap); __GLX_END(8); } + +void glSampleCoverageARB( GLfloat value, GLboolean invert ) +{ + __GLX_DECLARE_VARIABLES(); + + __GLX_LOAD_VARIABLES(); + if (!gc->currentDpy) return; + + __GLX_BEGIN(X_GLrop_SampleCoverageARB,12); + __GLX_PUT_FLOAT(4,value); + __GLX_PUT_CHAR(8,invert); + __GLX_END(12); +} + +void glSampleMaskSGIS( GLfloat value, GLboolean invert ) +{ + __GLX_DECLARE_VARIABLES(); + + __GLX_LOAD_VARIABLES(); + if (!gc->currentDpy) return; + + __GLX_BEGIN(X_GLvop_SampleMaskSGIS,12); + __GLX_PUT_FLOAT(4,value); + __GLX_PUT_CHAR(8,invert); + __GLX_END(12); +} + +void glSamplePatternSGIS( GLenum pass ) +{ + __GLX_DECLARE_VARIABLES(); + + __GLX_LOAD_VARIABLES(); + if (!gc->currentDpy) return; + + __GLX_BEGIN(X_GLvop_SamplePatternSGIS,8); + __GLX_PUT_LONG(4,pass); + __GLX_END(8); +} Index: xc/lib/GL/glx/renderpix.c diff -u xc/lib/GL/glx/renderpix.c:1.4 xc/lib/GL/glx/renderpix.c:1.6 --- xc/lib/GL/glx/renderpix.c:1.4 Fri Feb 22 16:32:54 2002 +++ xc/lib/GL/glx/renderpix.c Fri Nov 14 11:20:59 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/renderpix.c,v 1.4 2002/02/22 21:32:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/renderpix.c,v 1.6 2003/11/14 16:20:59 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -113,9 +113,9 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); compsize = __glImageSize(32, 32, 1, GL_COLOR_INDEX, GL_BITMAP); cmdlen = __GLX_PAD(__GLX_POLYGONSTIPPLE_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; __GLX_BEGIN(X_GLrop_PolygonStipple,cmdlen); @@ -132,9 +132,9 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); compsize = __glImageSize(width, height, 1, GL_COLOR_INDEX, GL_BITMAP); cmdlen = __GLX_PAD(__GLX_BITMAP_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { @@ -184,13 +184,13 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); if (target == GL_PROXY_TEXTURE_1D) { compsize = 0; } else { compsize = __glImageSize(width, 1, 1, format, type); } cmdlen = __GLX_PAD(__GLX_TEXIMAGE_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { @@ -260,6 +260,7 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); if (target == GL_PROXY_TEXTURE_2D || target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) { compsize = 0; @@ -267,7 +268,6 @@ compsize = __glImageSize(width, height, 1, format, type); } cmdlen = __GLX_PAD(__GLX_TEXIMAGE_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { @@ -337,9 +337,9 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); compsize = __glImageSize(width, height, 1, format, type); cmdlen = __GLX_PAD(__GLX_DRAWPIXELS_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { @@ -386,6 +386,7 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); if (image == NULL) { compsize = 0; } else { @@ -393,7 +394,6 @@ } cmdlen = __GLX_PAD(__GLX_TEXSUBIMAGE_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { @@ -472,6 +472,7 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); switch (target) { case GL_PROXY_TEXTURE_1D: case GL_PROXY_TEXTURE_2D: @@ -487,7 +488,6 @@ break; } cmdlen = __GLX_PAD(__GLX_COLOR_TABLE_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) { return; } @@ -536,9 +536,9 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); compsize = __glImageSize(count, 1, 1, format, type); cmdlen = __GLX_PAD(__GLX_COLOR_SUBTABLE_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) { return; } @@ -590,9 +590,9 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); compsize = __glImageSize(width, height, 1, format, type); cmdlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { @@ -662,6 +662,7 @@ __GLX_DECLARE_VARIABLES(); GLuint compsize2, hdrlen, totalhdrlen, image1len, image2len; + __GLX_LOAD_VARIABLES(); compsize = __glImageSize(width, 1, 1, format, type); compsize2 = __glImageSize(height, 1, 1, format, type); totalhdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE); @@ -669,7 +670,6 @@ image1len = __GLX_PAD(compsize); image2len = __GLX_PAD(compsize2); cmdlen = totalhdrlen + image1len + image2len; - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { @@ -743,19 +743,19 @@ } } -void glTexImage3D(GLenum target, GLint level, GLenum internalformat, +void glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *image) { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); if ((target == GL_PROXY_TEXTURE_3D) || (image == NULL)) { compsize = 0; } else { compsize = __glImageSize(width, height, depth, format, type); } cmdlen = __GLX_PAD(__GLX_TEXIMAGE_3D_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { @@ -828,13 +828,13 @@ { __GLX_DECLARE_VARIABLES(); + __GLX_LOAD_VARIABLES(); if (image == NULL) { compsize = 0; } else { compsize = __glImageSize(width, height, depth, format, type); } cmdlen = __GLX_PAD(__GLX_TEXSUBIMAGE_3D_CMD_HDR_SIZE + compsize); - __GLX_LOAD_VARIABLES(); if (!gc->currentDpy) return; if (cmdlen <= gc->maxSmallRenderCommandSize) { Index: xc/lib/GL/glx/single2.c diff -u xc/lib/GL/glx/single2.c:1.4 xc/lib/GL/glx/single2.c:1.11 --- xc/lib/GL/glx/single2.c:1.4 Fri Feb 22 16:32:54 2002 +++ xc/lib/GL/glx/single2.c Wed Feb 11 15:01:21 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/single2.c,v 1.4 2002/02/22 21:32:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/single2.c,v 1.11 2004/02/11 20:01:21 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -126,10 +126,30 @@ __GLX_SINGLE_END(); } +#define CASE_ARRAY_ENABLE(enum_name,array,dest,gl_type) \ + case GL_ ## enum_name ## _ARRAY: \ + *dest = (gl_type) state->vertArray. array .enable ; break +#define CASE_ARRAY_SIZE(enum_name,array,dest,gl_type) \ + case GL_ ## enum_name ## _ARRAY_SIZE: \ + *dest = (gl_type) state->vertArray. array .size ; break +#define CASE_ARRAY_TYPE(enum_name,array,dest,gl_type) \ + case GL_ ## enum_name ## _ARRAY_TYPE: \ + *dest = (gl_type) state->vertArray. array .type ; break +#define CASE_ARRAY_STRIDE(enum_name,array,dest,gl_type) \ + case GL_ ## enum_name ## _ARRAY_STRIDE: \ + *dest = (gl_type) state->vertArray. array .stride ; break + +#define CASE_ARRAY_ALL(enum_name,array,dest,gl_type) \ + CASE_ARRAY_ENABLE(enum_name,array,dest,gl_type); \ + CASE_ARRAY_STRIDE(enum_name,array,dest,gl_type); \ + CASE_ARRAY_TYPE(enum_name,array,dest,gl_type); \ + CASE_ARRAY_SIZE(enum_name,array,dest,gl_type) + void glGetBooleanv(GLenum val, GLboolean *b) { const GLenum origVal = val; __GLX_SINGLE_DECLARE_VARIABLES(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); xGLXSingleReply reply; if (val == GL_TRANSPOSE_MODELVIEW_MATRIX_ARB) { @@ -165,124 +185,131 @@ */ switch (val) { case GL_PACK_ROW_LENGTH: - *b = (GLboolean)gc->state.storePack.rowLength; + *b = (GLboolean)state->storePack.rowLength; break; case GL_PACK_IMAGE_HEIGHT: - *b = (GLboolean)gc->state.storePack.imageHeight; + *b = (GLboolean)state->storePack.imageHeight; break; case GL_PACK_SKIP_ROWS: - *b = (GLboolean)gc->state.storePack.skipRows; + *b = (GLboolean)state->storePack.skipRows; break; case GL_PACK_SKIP_PIXELS: - *b = (GLboolean)gc->state.storePack.skipPixels; + *b = (GLboolean)state->storePack.skipPixels; break; case GL_PACK_SKIP_IMAGES: - *b = (GLboolean)gc->state.storePack.skipImages; + *b = (GLboolean)state->storePack.skipImages; break; case GL_PACK_ALIGNMENT: - *b = (GLboolean)gc->state.storePack.alignment; + *b = (GLboolean)state->storePack.alignment; break; case GL_PACK_SWAP_BYTES: - *b = (GLboolean)gc->state.storePack.swapEndian; + *b = (GLboolean)state->storePack.swapEndian; break; case GL_PACK_LSB_FIRST: - *b = (GLboolean)gc->state.storePack.lsbFirst; + *b = (GLboolean)state->storePack.lsbFirst; break; case GL_UNPACK_ROW_LENGTH: - *b = (GLboolean)gc->state.storeUnpack.rowLength; + *b = (GLboolean)state->storeUnpack.rowLength; break; case GL_UNPACK_IMAGE_HEIGHT: - *b = (GLboolean)gc->state.storeUnpack.imageHeight; + *b = (GLboolean)state->storeUnpack.imageHeight; break; case GL_UNPACK_SKIP_ROWS: - *b = (GLboolean)gc->state.storeUnpack.skipRows; + *b = (GLboolean)state->storeUnpack.skipRows; break; case GL_UNPACK_SKIP_PIXELS: - *b = (GLboolean)gc->state.storeUnpack.skipPixels; + *b = (GLboolean)state->storeUnpack.skipPixels; break; case GL_UNPACK_SKIP_IMAGES: - *b = (GLboolean)gc->state.storeUnpack.skipImages; + *b = (GLboolean)state->storeUnpack.skipImages; break; case GL_UNPACK_ALIGNMENT: - *b = (GLboolean)gc->state.storeUnpack.alignment; + *b = (GLboolean)state->storeUnpack.alignment; break; case GL_UNPACK_SWAP_BYTES: - *b = (GLboolean)gc->state.storeUnpack.swapEndian; + *b = (GLboolean)state->storeUnpack.swapEndian; break; case GL_UNPACK_LSB_FIRST: - *b = (GLboolean)gc->state.storeUnpack.lsbFirst; + *b = (GLboolean)state->storeUnpack.lsbFirst; break; case GL_VERTEX_ARRAY: - *b = (GLboolean)gc->state.vertArray.vertex.enable; + *b = (GLboolean)state->vertArray.vertex.enable; break; case GL_VERTEX_ARRAY_SIZE: - *b = (GLboolean)gc->state.vertArray.vertex.size; + *b = (GLboolean)state->vertArray.vertex.size; break; case GL_VERTEX_ARRAY_TYPE: - *b = (GLboolean)gc->state.vertArray.vertex.type; + *b = (GLboolean)state->vertArray.vertex.type; break; case GL_VERTEX_ARRAY_STRIDE: - *b = (GLboolean)gc->state.vertArray.vertex.stride; + *b = (GLboolean)state->vertArray.vertex.stride; break; case GL_NORMAL_ARRAY: - *b = (GLboolean)gc->state.vertArray.normal.enable; + *b = (GLboolean)state->vertArray.normal.enable; break; case GL_NORMAL_ARRAY_TYPE: - *b = (GLboolean)gc->state.vertArray.normal.type; + *b = (GLboolean)state->vertArray.normal.type; break; case GL_NORMAL_ARRAY_STRIDE: - *b = (GLboolean)gc->state.vertArray.normal.stride; + *b = (GLboolean)state->vertArray.normal.stride; break; case GL_COLOR_ARRAY: - *b = (GLboolean)gc->state.vertArray.color.enable; + *b = (GLboolean)state->vertArray.color.enable; break; case GL_COLOR_ARRAY_SIZE: - *b = (GLboolean)gc->state.vertArray.color.size; + *b = (GLboolean)state->vertArray.color.size; break; case GL_COLOR_ARRAY_TYPE: - *b = (GLboolean)gc->state.vertArray.color.type; + *b = (GLboolean)state->vertArray.color.type; break; case GL_COLOR_ARRAY_STRIDE: - *b = (GLboolean)gc->state.vertArray.color.stride; + *b = (GLboolean)state->vertArray.color.stride; break; case GL_INDEX_ARRAY: - *b = (GLboolean)gc->state.vertArray.index.enable; + *b = (GLboolean)state->vertArray.index.enable; break; case GL_INDEX_ARRAY_TYPE: - *b = (GLboolean)gc->state.vertArray.index.type; + *b = (GLboolean)state->vertArray.index.type; break; case GL_INDEX_ARRAY_STRIDE: - *b = (GLboolean)gc->state.vertArray.index.stride; + *b = (GLboolean)state->vertArray.index.stride; break; case GL_TEXTURE_COORD_ARRAY: - *b = (GLboolean)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable; + *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].enable; break; case GL_TEXTURE_COORD_ARRAY_SIZE: - *b = (GLboolean)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].size; + *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].size; break; case GL_TEXTURE_COORD_ARRAY_TYPE: - *b = (GLboolean)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].type; + *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].type; break; case GL_TEXTURE_COORD_ARRAY_STRIDE: - *b = (GLboolean)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].stride; + *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].stride; break; case GL_EDGE_FLAG_ARRAY: - *b = (GLboolean)gc->state.vertArray.edgeFlag.enable; + *b = (GLboolean)state->vertArray.edgeFlag.enable; break; case GL_EDGE_FLAG_ARRAY_STRIDE: - *b = (GLboolean)gc->state.vertArray.edgeFlag.stride; + *b = (GLboolean)state->vertArray.edgeFlag.stride; break; + + CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, b, GLboolean); + + CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, b, GLboolean); + CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, b, GLboolean); + CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, b, GLboolean); + case GL_MAX_ELEMENTS_VERTICES: - *b = (GLboolean)gc->state.vertArray.maxElementsVertices; + *b = (GLboolean)state->vertArray.maxElementsVertices; break; case GL_MAX_ELEMENTS_INDICES: - *b = (GLboolean)gc->state.vertArray.maxElementsIndices; + *b = (GLboolean)state->vertArray.maxElementsIndices; break; case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: *b = (GLboolean)__GL_CLIENT_ATTRIB_STACK_DEPTH; break; case GL_CLIENT_ACTIVE_TEXTURE_ARB: - *b = (GLboolean)(gc->state.vertArray.activeTexture + GL_TEXTURE0_ARB); + *b = (GLboolean)(state->vertArray.activeTexture + GL_TEXTURE0_ARB); break; default: /* @@ -306,6 +333,7 @@ { const GLenum origVal = val; __GLX_SINGLE_DECLARE_VARIABLES(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); xGLXSingleReply reply; if (val == GL_TRANSPOSE_MODELVIEW_MATRIX_ARB) { @@ -341,124 +369,131 @@ */ switch (val) { case GL_PACK_ROW_LENGTH: - *d = (GLdouble)gc->state.storePack.rowLength; + *d = (GLdouble)state->storePack.rowLength; break; case GL_PACK_IMAGE_HEIGHT: - *d = (GLdouble)gc->state.storePack.imageHeight; + *d = (GLdouble)state->storePack.imageHeight; break; case GL_PACK_SKIP_ROWS: - *d = (GLdouble)gc->state.storePack.skipRows; + *d = (GLdouble)state->storePack.skipRows; break; case GL_PACK_SKIP_PIXELS: - *d = (GLdouble)gc->state.storePack.skipPixels; + *d = (GLdouble)state->storePack.skipPixels; break; case GL_PACK_SKIP_IMAGES: - *d = (GLdouble)gc->state.storePack.skipImages; + *d = (GLdouble)state->storePack.skipImages; break; case GL_PACK_ALIGNMENT: - *d = (GLdouble)gc->state.storePack.alignment; + *d = (GLdouble)state->storePack.alignment; break; case GL_PACK_SWAP_BYTES: - *d = (GLdouble)gc->state.storePack.swapEndian; + *d = (GLdouble)state->storePack.swapEndian; break; case GL_PACK_LSB_FIRST: - *d = (GLdouble)gc->state.storePack.lsbFirst; + *d = (GLdouble)state->storePack.lsbFirst; break; case GL_UNPACK_ROW_LENGTH: - *d = (GLdouble)gc->state.storeUnpack.rowLength; + *d = (GLdouble)state->storeUnpack.rowLength; break; case GL_UNPACK_IMAGE_HEIGHT: - *d = (GLdouble)gc->state.storeUnpack.imageHeight; + *d = (GLdouble)state->storeUnpack.imageHeight; break; case GL_UNPACK_SKIP_ROWS: - *d = (GLdouble)gc->state.storeUnpack.skipRows; + *d = (GLdouble)state->storeUnpack.skipRows; break; case GL_UNPACK_SKIP_PIXELS: - *d = (GLdouble)gc->state.storeUnpack.skipPixels; + *d = (GLdouble)state->storeUnpack.skipPixels; break; case GL_UNPACK_SKIP_IMAGES: - *d = (GLdouble)gc->state.storeUnpack.skipImages; + *d = (GLdouble)state->storeUnpack.skipImages; break; case GL_UNPACK_ALIGNMENT: - *d = (GLdouble)gc->state.storeUnpack.alignment; + *d = (GLdouble)state->storeUnpack.alignment; break; case GL_UNPACK_SWAP_BYTES: - *d = (GLdouble)gc->state.storeUnpack.swapEndian; + *d = (GLdouble)state->storeUnpack.swapEndian; break; case GL_UNPACK_LSB_FIRST: - *d = (GLdouble)gc->state.storeUnpack.lsbFirst; + *d = (GLdouble)state->storeUnpack.lsbFirst; break; case GL_VERTEX_ARRAY: - *d = (GLdouble)gc->state.vertArray.vertex.enable; + *d = (GLdouble)state->vertArray.vertex.enable; break; case GL_VERTEX_ARRAY_SIZE: - *d = (GLdouble)gc->state.vertArray.vertex.size; + *d = (GLdouble)state->vertArray.vertex.size; break; case GL_VERTEX_ARRAY_TYPE: - *d = (GLdouble)gc->state.vertArray.vertex.type; + *d = (GLdouble)state->vertArray.vertex.type; break; case GL_VERTEX_ARRAY_STRIDE: - *d = (GLdouble)gc->state.vertArray.vertex.stride; + *d = (GLdouble)state->vertArray.vertex.stride; break; case GL_NORMAL_ARRAY: - *d = (GLdouble)gc->state.vertArray.normal.enable; + *d = (GLdouble)state->vertArray.normal.enable; break; case GL_NORMAL_ARRAY_TYPE: - *d = (GLdouble)gc->state.vertArray.normal.type; + *d = (GLdouble)state->vertArray.normal.type; break; case GL_NORMAL_ARRAY_STRIDE: - *d = (GLdouble)gc->state.vertArray.normal.stride; + *d = (GLdouble)state->vertArray.normal.stride; break; case GL_COLOR_ARRAY: - *d = (GLdouble)gc->state.vertArray.color.enable; + *d = (GLdouble)state->vertArray.color.enable; break; case GL_COLOR_ARRAY_SIZE: - *d = (GLdouble)gc->state.vertArray.color.size; + *d = (GLdouble)state->vertArray.color.size; break; case GL_COLOR_ARRAY_TYPE: - *d = (GLdouble)gc->state.vertArray.color.type; + *d = (GLdouble)state->vertArray.color.type; break; case GL_COLOR_ARRAY_STRIDE: - *d = (GLdouble)gc->state.vertArray.color.stride; + *d = (GLdouble)state->vertArray.color.stride; break; case GL_INDEX_ARRAY: - *d = (GLdouble)gc->state.vertArray.index.enable; + *d = (GLdouble)state->vertArray.index.enable; break; case GL_INDEX_ARRAY_TYPE: - *d = (GLdouble)gc->state.vertArray.index.type; + *d = (GLdouble)state->vertArray.index.type; break; case GL_INDEX_ARRAY_STRIDE: - *d = (GLdouble)gc->state.vertArray.index.stride; + *d = (GLdouble)state->vertArray.index.stride; break; case GL_TEXTURE_COORD_ARRAY: - *d = (GLdouble)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable; + *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].enable; break; case GL_TEXTURE_COORD_ARRAY_SIZE: - *d = (GLdouble)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].size; + *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].size; break; case GL_TEXTURE_COORD_ARRAY_TYPE: - *d = (GLdouble)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].type; + *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].type; break; case GL_TEXTURE_COORD_ARRAY_STRIDE: - *d = (GLdouble)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].stride; + *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].stride; break; case GL_EDGE_FLAG_ARRAY: - *d = (GLdouble)gc->state.vertArray.edgeFlag.enable; + *d = (GLdouble)state->vertArray.edgeFlag.enable; break; case GL_EDGE_FLAG_ARRAY_STRIDE: - *d = (GLdouble)gc->state.vertArray.edgeFlag.stride; + *d = (GLdouble)state->vertArray.edgeFlag.stride; break; + + CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, d, GLdouble); + + CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, d, GLdouble); + CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, d, GLdouble); + CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, d, GLdouble); + case GL_MAX_ELEMENTS_VERTICES: - *d = (GLdouble)gc->state.vertArray.maxElementsVertices; + *d = (GLdouble)state->vertArray.maxElementsVertices; break; case GL_MAX_ELEMENTS_INDICES: - *d = (GLdouble)gc->state.vertArray.maxElementsIndices; + *d = (GLdouble)state->vertArray.maxElementsIndices; break; case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: *d = (GLdouble)__GL_CLIENT_ATTRIB_STACK_DEPTH; break; case GL_CLIENT_ACTIVE_TEXTURE_ARB: - *d = (GLdouble)(gc->state.vertArray.activeTexture + GL_TEXTURE0_ARB); + *d = (GLdouble)(state->vertArray.activeTexture + GL_TEXTURE0_ARB); break; default: /* @@ -482,6 +517,7 @@ { const GLenum origVal = val; __GLX_SINGLE_DECLARE_VARIABLES(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); xGLXSingleReply reply; if (val == GL_TRANSPOSE_MODELVIEW_MATRIX_ARB) { @@ -517,124 +553,131 @@ */ switch (val) { case GL_PACK_ROW_LENGTH: - *f = (GLfloat)gc->state.storePack.rowLength; + *f = (GLfloat)state->storePack.rowLength; break; case GL_PACK_IMAGE_HEIGHT: - *f = (GLfloat)gc->state.storePack.imageHeight; + *f = (GLfloat)state->storePack.imageHeight; break; case GL_PACK_SKIP_ROWS: - *f = (GLfloat)gc->state.storePack.skipRows; + *f = (GLfloat)state->storePack.skipRows; break; case GL_PACK_SKIP_PIXELS: - *f = (GLfloat)gc->state.storePack.skipPixels; + *f = (GLfloat)state->storePack.skipPixels; break; case GL_PACK_SKIP_IMAGES: - *f = (GLfloat)gc->state.storePack.skipImages; + *f = (GLfloat)state->storePack.skipImages; break; case GL_PACK_ALIGNMENT: - *f = (GLfloat)gc->state.storePack.alignment; + *f = (GLfloat)state->storePack.alignment; break; case GL_PACK_SWAP_BYTES: - *f = (GLfloat)gc->state.storePack.swapEndian; + *f = (GLfloat)state->storePack.swapEndian; break; case GL_PACK_LSB_FIRST: - *f = (GLfloat)gc->state.storePack.lsbFirst; + *f = (GLfloat)state->storePack.lsbFirst; break; case GL_UNPACK_ROW_LENGTH: - *f = (GLfloat)gc->state.storeUnpack.rowLength; + *f = (GLfloat)state->storeUnpack.rowLength; break; case GL_UNPACK_IMAGE_HEIGHT: - *f = (GLfloat)gc->state.storeUnpack.imageHeight; + *f = (GLfloat)state->storeUnpack.imageHeight; break; case GL_UNPACK_SKIP_ROWS: - *f = (GLfloat)gc->state.storeUnpack.skipRows; + *f = (GLfloat)state->storeUnpack.skipRows; break; case GL_UNPACK_SKIP_PIXELS: - *f = (GLfloat)gc->state.storeUnpack.skipPixels; + *f = (GLfloat)state->storeUnpack.skipPixels; break; case GL_UNPACK_SKIP_IMAGES: - *f = (GLfloat)gc->state.storeUnpack.skipImages; + *f = (GLfloat)state->storeUnpack.skipImages; break; case GL_UNPACK_ALIGNMENT: - *f = (GLfloat)gc->state.storeUnpack.alignment; + *f = (GLfloat)state->storeUnpack.alignment; break; case GL_UNPACK_SWAP_BYTES: - *f = (GLfloat)gc->state.storeUnpack.swapEndian; + *f = (GLfloat)state->storeUnpack.swapEndian; break; case GL_UNPACK_LSB_FIRST: - *f = (GLfloat)gc->state.storeUnpack.lsbFirst; + *f = (GLfloat)state->storeUnpack.lsbFirst; break; case GL_VERTEX_ARRAY: - *f = (GLfloat)gc->state.vertArray.vertex.enable; + *f = (GLfloat)state->vertArray.vertex.enable; break; case GL_VERTEX_ARRAY_SIZE: - *f = (GLfloat)gc->state.vertArray.vertex.size; + *f = (GLfloat)state->vertArray.vertex.size; break; case GL_VERTEX_ARRAY_TYPE: - *f = (GLfloat)gc->state.vertArray.vertex.type; + *f = (GLfloat)state->vertArray.vertex.type; break; case GL_VERTEX_ARRAY_STRIDE: - *f = (GLfloat)gc->state.vertArray.vertex.stride; + *f = (GLfloat)state->vertArray.vertex.stride; break; case GL_NORMAL_ARRAY: - *f = (GLfloat)gc->state.vertArray.normal.enable; + *f = (GLfloat)state->vertArray.normal.enable; break; case GL_NORMAL_ARRAY_TYPE: - *f = (GLfloat)gc->state.vertArray.normal.type; + *f = (GLfloat)state->vertArray.normal.type; break; case GL_NORMAL_ARRAY_STRIDE: - *f = (GLfloat)gc->state.vertArray.normal.stride; + *f = (GLfloat)state->vertArray.normal.stride; break; case GL_COLOR_ARRAY: - *f = (GLfloat)gc->state.vertArray.color.enable; + *f = (GLfloat)state->vertArray.color.enable; break; case GL_COLOR_ARRAY_SIZE: - *f = (GLfloat)gc->state.vertArray.color.size; + *f = (GLfloat)state->vertArray.color.size; break; case GL_COLOR_ARRAY_TYPE: - *f = (GLfloat)gc->state.vertArray.color.type; + *f = (GLfloat)state->vertArray.color.type; break; case GL_COLOR_ARRAY_STRIDE: - *f = (GLfloat)gc->state.vertArray.color.stride; + *f = (GLfloat)state->vertArray.color.stride; break; case GL_INDEX_ARRAY: - *f = (GLfloat)gc->state.vertArray.index.enable; + *f = (GLfloat)state->vertArray.index.enable; break; case GL_INDEX_ARRAY_TYPE: - *f = (GLfloat)gc->state.vertArray.index.type; + *f = (GLfloat)state->vertArray.index.type; break; case GL_INDEX_ARRAY_STRIDE: - *f = (GLfloat)gc->state.vertArray.index.stride; + *f = (GLfloat)state->vertArray.index.stride; break; case GL_TEXTURE_COORD_ARRAY: - *f = (GLfloat)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable; + *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].enable; break; case GL_TEXTURE_COORD_ARRAY_SIZE: - *f = (GLfloat)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].size; + *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].size; break; case GL_TEXTURE_COORD_ARRAY_TYPE: - *f = (GLfloat)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].type; + *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].type; break; case GL_TEXTURE_COORD_ARRAY_STRIDE: - *f = (GLfloat)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].stride; + *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].stride; break; case GL_EDGE_FLAG_ARRAY: - *f = (GLfloat)gc->state.vertArray.edgeFlag.enable; + *f = (GLfloat)state->vertArray.edgeFlag.enable; break; case GL_EDGE_FLAG_ARRAY_STRIDE: - *f = (GLfloat)gc->state.vertArray.edgeFlag.stride; + *f = (GLfloat)state->vertArray.edgeFlag.stride; break; + + CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, f, GLfloat); + + CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, f, GLfloat); + CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, f, GLfloat); + CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, f, GLfloat); + case GL_MAX_ELEMENTS_VERTICES: - *f = (GLfloat)gc->state.vertArray.maxElementsVertices; + *f = (GLfloat)state->vertArray.maxElementsVertices; break; case GL_MAX_ELEMENTS_INDICES: - *f = (GLfloat)gc->state.vertArray.maxElementsIndices; + *f = (GLfloat)state->vertArray.maxElementsIndices; break; case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: *f = (GLfloat)__GL_CLIENT_ATTRIB_STACK_DEPTH; break; case GL_CLIENT_ACTIVE_TEXTURE_ARB: - *f = (GLfloat)(gc->state.vertArray.activeTexture + GL_TEXTURE0_ARB); + *f = (GLfloat)(state->vertArray.activeTexture + GL_TEXTURE0_ARB); break; default: /* @@ -658,6 +701,7 @@ { const GLenum origVal = val; __GLX_SINGLE_DECLARE_VARIABLES(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); xGLXSingleReply reply; if (val == GL_TRANSPOSE_MODELVIEW_MATRIX_ARB) { @@ -693,124 +737,131 @@ */ switch (val) { case GL_PACK_ROW_LENGTH: - *i = (GLint)gc->state.storePack.rowLength; + *i = (GLint)state->storePack.rowLength; break; case GL_PACK_IMAGE_HEIGHT: - *i = (GLint)gc->state.storePack.imageHeight; + *i = (GLint)state->storePack.imageHeight; break; case GL_PACK_SKIP_ROWS: - *i = (GLint)gc->state.storePack.skipRows; + *i = (GLint)state->storePack.skipRows; break; case GL_PACK_SKIP_PIXELS: - *i = (GLint)gc->state.storePack.skipPixels; + *i = (GLint)state->storePack.skipPixels; break; case GL_PACK_SKIP_IMAGES: - *i = (GLint)gc->state.storePack.skipImages; + *i = (GLint)state->storePack.skipImages; break; case GL_PACK_ALIGNMENT: - *i = (GLint)gc->state.storePack.alignment; + *i = (GLint)state->storePack.alignment; break; case GL_PACK_SWAP_BYTES: - *i = (GLint)gc->state.storePack.swapEndian; + *i = (GLint)state->storePack.swapEndian; break; case GL_PACK_LSB_FIRST: - *i = (GLint)gc->state.storePack.lsbFirst; + *i = (GLint)state->storePack.lsbFirst; break; case GL_UNPACK_ROW_LENGTH: - *i = (GLint)gc->state.storeUnpack.rowLength; + *i = (GLint)state->storeUnpack.rowLength; break; case GL_UNPACK_IMAGE_HEIGHT: - *i = (GLint)gc->state.storeUnpack.imageHeight; + *i = (GLint)state->storeUnpack.imageHeight; break; case GL_UNPACK_SKIP_ROWS: - *i = (GLint)gc->state.storeUnpack.skipRows; + *i = (GLint)state->storeUnpack.skipRows; break; case GL_UNPACK_SKIP_PIXELS: - *i = (GLint)gc->state.storeUnpack.skipPixels; + *i = (GLint)state->storeUnpack.skipPixels; break; case GL_UNPACK_SKIP_IMAGES: - *i = (GLint)gc->state.storeUnpack.skipImages; + *i = (GLint)state->storeUnpack.skipImages; break; case GL_UNPACK_ALIGNMENT: - *i = (GLint)gc->state.storeUnpack.alignment; + *i = (GLint)state->storeUnpack.alignment; break; case GL_UNPACK_SWAP_BYTES: - *i = (GLint)gc->state.storeUnpack.swapEndian; + *i = (GLint)state->storeUnpack.swapEndian; break; case GL_UNPACK_LSB_FIRST: - *i = (GLint)gc->state.storeUnpack.lsbFirst; + *i = (GLint)state->storeUnpack.lsbFirst; break; case GL_VERTEX_ARRAY: - *i = (GLint)gc->state.vertArray.vertex.enable; + *i = (GLint)state->vertArray.vertex.enable; break; case GL_VERTEX_ARRAY_SIZE: - *i = (GLint)gc->state.vertArray.vertex.size; + *i = (GLint)state->vertArray.vertex.size; break; case GL_VERTEX_ARRAY_TYPE: - *i = (GLint)gc->state.vertArray.vertex.type; + *i = (GLint)state->vertArray.vertex.type; break; case GL_VERTEX_ARRAY_STRIDE: - *i = (GLint)gc->state.vertArray.vertex.stride; + *i = (GLint)state->vertArray.vertex.stride; break; case GL_NORMAL_ARRAY: - *i = (GLint)gc->state.vertArray.normal.enable; + *i = (GLint)state->vertArray.normal.enable; break; case GL_NORMAL_ARRAY_TYPE: - *i = (GLint)gc->state.vertArray.normal.type; + *i = (GLint)state->vertArray.normal.type; break; case GL_NORMAL_ARRAY_STRIDE: - *i = (GLint)gc->state.vertArray.normal.stride; + *i = (GLint)state->vertArray.normal.stride; break; case GL_COLOR_ARRAY: - *i = (GLint)gc->state.vertArray.color.enable; + *i = (GLint)state->vertArray.color.enable; break; case GL_COLOR_ARRAY_SIZE: - *i = (GLint)gc->state.vertArray.color.size; + *i = (GLint)state->vertArray.color.size; break; case GL_COLOR_ARRAY_TYPE: - *i = (GLint)gc->state.vertArray.color.type; + *i = (GLint)state->vertArray.color.type; break; case GL_COLOR_ARRAY_STRIDE: - *i = (GLint)gc->state.vertArray.color.stride; + *i = (GLint)state->vertArray.color.stride; break; case GL_INDEX_ARRAY: - *i = (GLint)gc->state.vertArray.index.enable; + *i = (GLint)state->vertArray.index.enable; break; case GL_INDEX_ARRAY_TYPE: - *i = (GLint)gc->state.vertArray.index.type; + *i = (GLint)state->vertArray.index.type; break; case GL_INDEX_ARRAY_STRIDE: - *i = (GLint)gc->state.vertArray.index.stride; + *i = (GLint)state->vertArray.index.stride; break; case GL_TEXTURE_COORD_ARRAY: - *i = (GLint)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable; + *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].enable; break; case GL_TEXTURE_COORD_ARRAY_SIZE: - *i = (GLint)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].size; + *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].size; break; case GL_TEXTURE_COORD_ARRAY_TYPE: - *i = (GLint)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].type; + *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].type; break; case GL_TEXTURE_COORD_ARRAY_STRIDE: - *i = (GLint)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].stride; + *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].stride; break; case GL_EDGE_FLAG_ARRAY: - *i = (GLint)gc->state.vertArray.edgeFlag.enable; + *i = (GLint)state->vertArray.edgeFlag.enable; break; case GL_EDGE_FLAG_ARRAY_STRIDE: - *i = (GLint)gc->state.vertArray.edgeFlag.stride; + *i = (GLint)state->vertArray.edgeFlag.stride; break; + + CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, i, GLint); + + CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, i, GLint); + CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, i, GLint); + CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, i, GLint); + case GL_MAX_ELEMENTS_VERTICES: - *i = (GLint)gc->state.vertArray.maxElementsVertices; + *i = (GLint)state->vertArray.maxElementsVertices; break; case GL_MAX_ELEMENTS_INDICES: - *i = (GLint)gc->state.vertArray.maxElementsIndices; + *i = (GLint)state->vertArray.maxElementsIndices; break; case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: *i = (GLint)__GL_CLIENT_ATTRIB_STACK_DEPTH; break; case GL_CLIENT_ACTIVE_TEXTURE_ARB: - *i = (GLint)(gc->state.vertArray.activeTexture + GL_TEXTURE0_ARB); + *i = (GLint)(state->vertArray.activeTexture + GL_TEXTURE0_ARB); break; default: /* @@ -979,11 +1030,39 @@ case GL_RENDERER: gc->renderer = s; break; - case GL_VERSION: - gc->version = s; - break; + case GL_VERSION: { + double server_version = strtod((char *)s, NULL); + double client_version = strtod(__glXGLClientVersion, NULL); + + if ( server_version <= client_version ) { + gc->version = s; + } + else { + gc->version = Xmalloc( strlen(__glXGLClientVersion) + + strlen((char *)s) + 4 ); + if ( gc->version == NULL ) { + /* If we couldn't allocate memory for the new string, + * make a best-effort and just copy the client-side version + * to the string and use that. It probably doesn't + * matter what is done here. If there not memory available + * for a short string, the system is probably going to die + * soon anyway. + */ + strcpy((char *)s, __glXGLClientVersion); + } + else { + sprintf( (char *)gc->version, "%s (%s)", + __glXGLClientVersion, s ); + Xfree( s ); + s = gc->version; + } + } + break; + } case GL_EXTENSIONS: - gc->extensions = s; + gc->extensions = (GLubyte *)__glXCombineExtensionStrings( (const char *)s, __glXGLClientExtensions ); + XFree( s ); + s = gc->extensions; break; } } @@ -994,6 +1073,7 @@ GLboolean glIsEnabled(GLenum cap) { __GLX_SINGLE_DECLARE_VARIABLES(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); xGLXSingleReply reply; GLboolean retval = 0; @@ -1001,17 +1081,21 @@ switch(cap) { case GL_VERTEX_ARRAY: - return gc->state.vertArray.vertex.enable; + return state->vertArray.vertex.enable; case GL_NORMAL_ARRAY: - return gc->state.vertArray.normal.enable; + return state->vertArray.normal.enable; case GL_COLOR_ARRAY: - return gc->state.vertArray.color.enable; + return state->vertArray.color.enable; case GL_INDEX_ARRAY: - return gc->state.vertArray.index.enable; + return state->vertArray.index.enable; case GL_TEXTURE_COORD_ARRAY: - return gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable; + return state->vertArray.texCoord[state->vertArray.activeTexture].enable; case GL_EDGE_FLAG_ARRAY: - return gc->state.vertArray.edgeFlag.enable; + return state->vertArray.edgeFlag.enable; + case GL_SECONDARY_COLOR_ARRAY: + return state->vertArray.secondaryColor.enable; + case GL_FOG_COORDINATE_ARRAY: + return state->vertArray.fogCoord.enable; } __GLX_SINGLE_LOAD_VARIABLES(); @@ -1026,28 +1110,35 @@ void glGetPointerv(GLenum pname, void **params) { __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); Display *dpy = gc->currentDpy; if (!dpy) return; switch(pname) { case GL_VERTEX_ARRAY_POINTER: - *params = (void *)gc->state.vertArray.vertex.ptr; + *params = (void *)state->vertArray.vertex.ptr; return; case GL_NORMAL_ARRAY_POINTER: - *params = (void *)gc->state.vertArray.normal.ptr; + *params = (void *)state->vertArray.normal.ptr; return; case GL_COLOR_ARRAY_POINTER: - *params = (void *)gc->state.vertArray.color.ptr; + *params = (void *)state->vertArray.color.ptr; return; case GL_INDEX_ARRAY_POINTER: - *params = (void *)gc->state.vertArray.index.ptr; + *params = (void *)state->vertArray.index.ptr; return; case GL_TEXTURE_COORD_ARRAY_POINTER: - *params = (void *)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].ptr; + *params = (void *)state->vertArray.texCoord[state->vertArray.activeTexture].ptr; return; case GL_EDGE_FLAG_ARRAY_POINTER: - *params = (void *)gc->state.vertArray.edgeFlag.ptr; + *params = (void *)state->vertArray.edgeFlag.ptr; + return; + case GL_SECONDARY_COLOR_ARRAY_POINTER: + *params = (void *)state->vertArray.secondaryColor.ptr; + return; + case GL_FOG_COORDINATE_ARRAY_POINTER: + *params = (void *)state->vertArray.fogCoord.ptr; return; case GL_FEEDBACK_BUFFER_POINTER: *params = (void *)gc->feedbackBuf; Index: xc/lib/GL/glx/singlepix.c diff -u xc/lib/GL/glx/singlepix.c:1.3 xc/lib/GL/glx/singlepix.c:1.4 --- xc/lib/GL/glx/singlepix.c:1.3 Wed Mar 21 11:04:39 2001 +++ xc/lib/GL/glx/singlepix.c Wed Jan 28 13:11:43 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/singlepix.c,v 1.3 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/singlepix.c,v 1.4 2004/01/28 18:11:43 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -40,11 +40,13 @@ GLenum format, GLenum type, GLvoid *pixels) { __GLX_SINGLE_DECLARE_VARIABLES(); + const __GLXattribute * state; xGLXReadPixelsReply reply; GLubyte *buf; if (!dpy) return; __GLX_SINGLE_LOAD_VARIABLES(); + state = gc->client_state_private; /* Send request */ __GLX_SINGLE_BEGIN(X_GLsop_ReadPixels,__GLX_PAD(26)); @@ -54,7 +56,7 @@ __GLX_SINGLE_PUT_LONG(12,height); __GLX_SINGLE_PUT_LONG(16,format); __GLX_SINGLE_PUT_LONG(20,type); - __GLX_SINGLE_PUT_CHAR(24,gc->state.storePack.swapEndian); + __GLX_SINGLE_PUT_CHAR(24,state->storePack.swapEndian); __GLX_SINGLE_PUT_CHAR(25,GL_FALSE); __GLX_SINGLE_READ_XREPLY(); compsize = reply.length << 2; @@ -87,11 +89,13 @@ GLvoid *texels) { __GLX_SINGLE_DECLARE_VARIABLES(); + const __GLXattribute * state; xGLXGetTexImageReply reply; GLubyte *buf; if (!dpy) return; __GLX_SINGLE_LOAD_VARIABLES(); + state = gc->client_state_private; /* Send request */ __GLX_SINGLE_BEGIN(X_GLsop_GetTexImage,__GLX_PAD(17)); @@ -99,7 +103,7 @@ __GLX_SINGLE_PUT_LONG(4,level); __GLX_SINGLE_PUT_LONG(8,format); __GLX_SINGLE_PUT_LONG(12,type); - __GLX_SINGLE_PUT_CHAR(16,gc->state.storePack.swapEndian); + __GLX_SINGLE_PUT_CHAR(16,state->storePack.swapEndian); __GLX_SINGLE_READ_XREPLY(); compsize = reply.length << 2; @@ -155,18 +159,20 @@ void glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid *table) { __GLX_SINGLE_DECLARE_VARIABLES(); + const __GLXattribute * state; xGLXGetColorTableReply reply; GLubyte *buf; if (!dpy) return; __GLX_SINGLE_LOAD_VARIABLES(); + state = gc->client_state_private; /* Send request */ __GLX_SINGLE_BEGIN(X_GLsop_GetColorTable,__GLX_PAD(13)); __GLX_SINGLE_PUT_LONG(0,(long)target); __GLX_SINGLE_PUT_LONG(4,(long)format); __GLX_SINGLE_PUT_LONG(8,(long)type); - __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian); + __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian); __GLX_SINGLE_READ_XREPLY(); compsize = (long)reply.length << 2; @@ -201,18 +207,20 @@ GLvoid *image) { __GLX_SINGLE_DECLARE_VARIABLES(); + const __GLXattribute * state; xGLXGetConvolutionFilterReply reply; GLubyte *buf; if (!dpy) return; __GLX_SINGLE_LOAD_VARIABLES(); + state = gc->client_state_private; /* Send request */ __GLX_SINGLE_BEGIN(X_GLsop_GetConvolutionFilter, __GLX_PAD(13)); __GLX_SINGLE_PUT_LONG(0,target); __GLX_SINGLE_PUT_LONG(4,format); __GLX_SINGLE_PUT_LONG(8,type); - __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian); + __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian); __GLX_SINGLE_READ_XREPLY(); compsize = reply.length << 2; @@ -248,18 +256,20 @@ GLvoid *row, GLvoid *column, GLvoid *span) { __GLX_SINGLE_DECLARE_VARIABLES(); + const __GLXattribute * state; xGLXGetSeparableFilterReply reply; GLubyte *rowBuf, *colBuf; if (!dpy) return; __GLX_SINGLE_LOAD_VARIABLES(); + state = gc->client_state_private; /* Send request */ __GLX_SINGLE_BEGIN(X_GLsop_GetSeparableFilter, __GLX_PAD(13)); __GLX_SINGLE_PUT_LONG(0,target); __GLX_SINGLE_PUT_LONG(4,format); __GLX_SINGLE_PUT_LONG(8,type); - __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian); + __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian); __GLX_SINGLE_READ_XREPLY(); compsize = reply.length << 2; @@ -313,18 +323,20 @@ GLenum type, GLvoid *values) { __GLX_SINGLE_DECLARE_VARIABLES(); + const __GLXattribute * state; xGLXGetHistogramReply reply; GLubyte *buf; if (!dpy) return; __GLX_SINGLE_LOAD_VARIABLES(); + state = gc->client_state_private; /* Send request */ __GLX_SINGLE_BEGIN(X_GLsop_GetHistogram,__GLX_PAD(14)); __GLX_SINGLE_PUT_LONG(0,(long)target); __GLX_SINGLE_PUT_LONG(4,(long)format); __GLX_SINGLE_PUT_LONG(8,(long)type); - __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian); + __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian); __GLX_SINGLE_PUT_CHAR(13,reset); __GLX_SINGLE_READ_XREPLY(); compsize = (long)reply.length << 2; @@ -360,18 +372,20 @@ GLvoid *values) { __GLX_SINGLE_DECLARE_VARIABLES(); + const __GLXattribute * state; xGLXGetMinmaxReply reply; GLubyte *buf; if (!dpy) return; __GLX_SINGLE_LOAD_VARIABLES(); + state = gc->client_state_private; /* Send request */ __GLX_SINGLE_BEGIN(X_GLsop_GetMinmax,__GLX_PAD(14)); __GLX_SINGLE_PUT_LONG(0,(long)target); __GLX_SINGLE_PUT_LONG(4,(long)format); __GLX_SINGLE_PUT_LONG(8,(long)type); - __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian); + __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian); __GLX_SINGLE_PUT_CHAR(13,reset); __GLX_SINGLE_READ_XREPLY(); compsize = (long)reply.length << 2; Index: xc/lib/GL/glx/size.h diff -u xc/lib/GL/glx/size.h:1.3 xc/lib/GL/glx/size.h:1.5 --- xc/lib/GL/glx/size.h:1.3 Wed Mar 21 11:04:39 2001 +++ xc/lib/GL/glx/size.h Wed Jan 28 13:11:43 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/size.h,v 1.3 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/size.h,v 1.5 2004/01/28 18:11:43 alanh Exp $ */ #ifndef _size_h_ #define _size_h_ @@ -66,5 +66,7 @@ extern GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h, GLsizei d); extern GLint __glTexParameterfv_size(GLenum e); extern GLint __glTexParameteriv_size(GLenum e); +extern GLint __glPointParameterfvARB_size(GLenum e); +extern GLint __glPointParameteriv_size(GLenum e); #endif /* _size_h_ */ Index: xc/lib/GL/glx/vertarr.c diff -u xc/lib/GL/glx/vertarr.c:1.4 xc/lib/GL/glx/vertarr.c:1.5 --- xc/lib/GL/glx/vertarr.c:1.4 Sun Mar 25 00:32:00 2001 +++ xc/lib/GL/glx/vertarr.c Wed Jan 28 13:11:43 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/vertarr.c,v 1.4 2001/03/25 05:32:00 tsi Exp $ */ +/* $XFree86: xc/lib/GL/glx/vertarr.c,v 1.5 2004/01/28 18:11:43 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -64,6 +64,14 @@ colorPointer->proc = (void (*)(const void *))glColor4##let##v; \ break +#define __GL_SEC_COLOR_FUNC(NAME, let) \ + case GL_##NAME: \ + seccolorPointer->proc = (void (*)(const void *))glSecondaryColor3##let##v; \ + +#define __GL_FOG_FUNC(NAME, let) \ + case GL_##NAME: \ + fogPointer->proc = (void (*)(const void *))glFogCoord##let##v; \ + #define __GL_INDEX_FUNC(NAME, let) \ case GL_##NAME: \ indexPointer->proc = (void (*)(const void *))glIndex##let##v; \ @@ -71,15 +79,19 @@ #define __GL_TEXTURE_FUNC(NAME, let) \ case GL_##NAME: \ - if (size == 1) \ + if (size == 1) { \ texCoordPointer->proc = (void (*)(const void *))glTexCoord1##let##v; \ - else if (size == 2) \ + texCoordPointer->mtex_proc = (void (*)(GLenum, const void *))glMultiTexCoord1##let##vARB; \ + } else if (size == 2) { \ texCoordPointer->proc = (void (*)(const void *))glTexCoord2##let##v; \ - else if (size == 3) \ + texCoordPointer->mtex_proc = (void (*)(GLenum, const void *))glMultiTexCoord2##let##vARB; \ + } else if (size == 3) { \ texCoordPointer->proc = (void (*)(const void *))glTexCoord3##let##v; \ - else if (size == 4) \ + texCoordPointer->mtex_proc = (void (*)(GLenum, const void *))glMultiTexCoord2##let##vARB; \ + } else if (size == 4) { \ texCoordPointer->proc = (void (*)(const void *))glTexCoord4##let##v; \ - break + texCoordPointer->mtex_proc = (void (*)(GLenum, const void *))glMultiTexCoord4##let##vARB; \ + } break static GLuint __glXTypeSize(GLenum enm) { @@ -99,7 +111,8 @@ void __glXInitVertexArrayState(__GLXcontext *gc) { - __GLXvertArrayState *va = &gc->state.vertArray; + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertArrayState *va = &state->vertArray; GLint i; va->vertex.enable = GL_FALSE; @@ -126,6 +139,22 @@ va->color.type = GL_FLOAT; va->color.stride = 0; + va->secondaryColor.enable = GL_FALSE; + va->secondaryColor.proc = NULL; + va->secondaryColor.skip = 0; + va->secondaryColor.ptr = 0; + va->secondaryColor.size = 3; + va->secondaryColor.type = GL_FLOAT; + va->secondaryColor.stride = 0; + + va->fogCoord.enable = GL_FALSE; + va->fogCoord.proc = NULL; + va->fogCoord.skip = 0; + va->fogCoord.ptr = 0; + va->fogCoord.size = 1; + va->fogCoord.type = GL_FLOAT; + va->fogCoord.stride = 0; + va->index.enable = GL_FALSE; va->index.proc = NULL; va->index.skip = 0; @@ -164,7 +193,8 @@ const GLvoid *pointer) { __GLXcontext *gc = __glXGetCurrentContext(); - __GLXvertexArrayPointerState *vertexPointer = &gc->state.vertArray.vertex; + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertexArrayPointerState *vertexPointer = &state->vertArray.vertex; /* Check arguments */ if (size < 2 || size > 4 || stride < 0) { @@ -199,7 +229,8 @@ void glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer) { __GLXcontext *gc = __glXGetCurrentContext(); - __GLXvertexArrayPointerState *normalPointer = &gc->state.vertArray.normal; + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertexArrayPointerState *normalPointer = &state->vertArray.normal; /* Check arguments */ if (stride < 0) { @@ -235,7 +266,8 @@ const GLvoid *pointer) { __GLXcontext *gc = __glXGetCurrentContext(); - __GLXvertexArrayPointerState *colorPointer = &gc->state.vertArray.color; + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertexArrayPointerState *colorPointer = &state->vertArray.color; /* Check arguments */ if (stride < 0) { @@ -274,7 +306,8 @@ void glIndexPointer(GLenum type, GLsizei stride, const GLvoid *pointer) { __GLXcontext *gc = __glXGetCurrentContext(); - __GLXvertexArrayPointerState *indexPointer = &gc->state.vertArray.index; + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertexArrayPointerState *indexPointer = &state->vertArray.index; /* Check arguments */ if (stride < 0) { @@ -310,8 +343,9 @@ const GLvoid *pointer) { __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); __GLXvertexArrayPointerState *texCoordPointer = - &gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture]; + &state->vertArray.texCoord[state->vertArray.activeTexture]; /* Check arguments */ if (size < 1 || size > 4 || stride < 0) { @@ -346,7 +380,8 @@ void glEdgeFlagPointer(GLsizei stride, const GLvoid *pointer) { __GLXcontext *gc = __glXGetCurrentContext(); - __GLXvertexArrayPointerState *edgeFlagPointer = &gc->state.vertArray.edgeFlag; + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertexArrayPointerState *edgeFlagPointer = &state->vertArray.edgeFlag; /* Check arguments */ if (stride < 0) { @@ -369,6 +404,81 @@ } +void glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, + const GLvoid * pointer ) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertexArrayPointerState *seccolorPointer = &state->vertArray.secondaryColor; + + /* Check arguments */ + if ( (stride < 0) || (size != 3) ) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + /* Choose appropriate api proc */ + switch(type) { + __GL_SEC_COLOR_FUNC(BYTE, b); + __GL_SEC_COLOR_FUNC(UNSIGNED_BYTE, ub); + __GL_SEC_COLOR_FUNC(SHORT, s); + __GL_SEC_COLOR_FUNC(UNSIGNED_SHORT, us); + __GL_SEC_COLOR_FUNC(INT, i); + __GL_SEC_COLOR_FUNC(UNSIGNED_INT, ui); + __GL_SEC_COLOR_FUNC(FLOAT, f); + __GL_SEC_COLOR_FUNC(DOUBLE, d); + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + seccolorPointer->size = size; + seccolorPointer->type = type; + seccolorPointer->stride = stride; + seccolorPointer->ptr = pointer; + + /* Set internal state */ + if (stride == 0) { + seccolorPointer->skip = size * __glXTypeSize(type); + } else { + seccolorPointer->skip = stride; + } +} + +void glFogCoordPointer(GLenum type, GLsizei stride, const GLvoid * pointer) +{ + __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertexArrayPointerState *fogPointer = &state->vertArray.fogCoord; + + /* Check arguments */ + if (stride < 0) { + __glXSetError(gc, GL_INVALID_VALUE); + return; + } + + /* Choose appropriate api proc */ + switch(type) { + __GL_FOG_FUNC(FLOAT, f); + __GL_FOG_FUNC(DOUBLE, d); + default: + __glXSetError(gc, GL_INVALID_ENUM); + return; + } + + fogPointer->size = 1; + fogPointer->type = type; + fogPointer->stride = stride; + fogPointer->ptr = pointer; + + /* Set internal state */ + if (stride == 0) { + fogPointer->skip = __glXTypeSize(type); + } else { + fogPointer->skip = stride; + } +} + void glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer) { __GLXcontext *gc = __glXGetCurrentContext(); @@ -506,6 +616,8 @@ trueStride = (stride == 0) ? size : stride; + glDisableClientState(GL_SECONDARY_COLOR_ARRAY); + glDisableClientState(GL_FOG_COORDINATE_ARRAY); glDisableClientState(GL_EDGE_FLAG_ARRAY); glDisableClientState(GL_INDEX_ARRAY); if (tEnable) { @@ -535,7 +647,8 @@ void glArrayElement(GLint i) { __GLXcontext *gc = __glXGetCurrentContext(); - __GLXvertArrayState *va = &gc->state.vertArray; + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertArrayState *va = &state->vertArray; GLint j; if (va->edgeFlag.enable == GL_TRUE) { @@ -552,6 +665,10 @@ (*va->color.proc)(va->color.ptr+i*va->color.skip); } + if (va->secondaryColor.enable == GL_TRUE) { + (*va->secondaryColor.proc)(va->secondaryColor.ptr+i*va->secondaryColor.skip); + } + if (va->index.enable == GL_TRUE) { (*va->index.proc)(va->index.ptr+i*va->index.skip); } @@ -560,6 +677,10 @@ (*va->normal.proc)(va->normal.ptr+i*va->normal.skip); } + if (va->fogCoord.enable == GL_TRUE) { + (*va->fogCoord.proc)(va->fogCoord.ptr+i*va->fogCoord.skip); + } + if (va->vertex.enable == GL_TRUE) { (*va->vertex.proc)(va->vertex.ptr+i*va->vertex.skip); } @@ -568,8 +689,10 @@ void glDrawArrays(GLenum mode, GLint first, GLsizei count) { __GLXcontext *gc = __glXGetCurrentContext(); - __GLXvertArrayState *va = &gc->state.vertArray; - const GLubyte *vaPtr = NULL, *naPtr = NULL, *caPtr = NULL, + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertArrayState *va = &state->vertArray; + const GLubyte *vaPtr = NULL, *naPtr = NULL, *caPtr = NULL, + *scaPtr = NULL, *faPtr = NULL, *iaPtr = NULL, *tcaPtr[__GLX_MAX_TEXTURE_UNITS]; const GLboolean *efaPtr = NULL; GLint i, j; @@ -603,6 +726,10 @@ naPtr = va->normal.ptr + first * va->normal.skip; if (va->color.enable == GL_TRUE) caPtr = va->color.ptr + first * va->color.skip; + if (va->secondaryColor.enable == GL_TRUE) + scaPtr = va->secondaryColor.ptr + first * va->secondaryColor.skip; + if (va->fogCoord.enable == GL_TRUE) + faPtr = va->fogCoord.ptr + first * va->fogCoord.skip; if (va->index.enable == GL_TRUE) iaPtr = va->index.ptr + first * va->index.skip; for (j=0; j<__GLX_MAX_TEXTURE_UNITS; ++j) { @@ -620,16 +747,35 @@ (*va->edgeFlag.proc)(efaPtr); efaPtr += va->edgeFlag.skip; } - for (j=0; j<__GLX_MAX_TEXTURE_UNITS; ++j) { + + + if (va->texCoord[0].enable == GL_TRUE) { + (*va->texCoord[0].proc)(tcaPtr[0]); + tcaPtr[0] += va->texCoord[0].skip; + } + + /* Multitexturing is handled specially because the protocol + * requires an extra parameter. + */ + for (j=1; j<__GLX_MAX_TEXTURE_UNITS; ++j) { if (va->texCoord[j].enable == GL_TRUE) { - (*va->texCoord[j].proc)(tcaPtr[j]); + (*va->texCoord[j].mtex_proc)(GL_TEXTURE0 + j, tcaPtr[j]); tcaPtr[j] += va->texCoord[j].skip; } } + if (va->color.enable == GL_TRUE) { (*va->color.proc)(caPtr); caPtr += va->color.skip; } + if (va->secondaryColor.enable == GL_TRUE) { + (*va->secondaryColor.proc)(scaPtr); + scaPtr += va->secondaryColor.skip; + } + if (va->fogCoord.enable == GL_TRUE) { + (*va->fogCoord.proc)(faPtr); + faPtr += va->fogCoord.skip; + } if (va->index.enable == GL_TRUE) { (*va->index.proc)(iaPtr); iaPtr += va->index.skip; @@ -650,7 +796,8 @@ const GLvoid *indices) { __GLXcontext *gc = __glXGetCurrentContext(); - __GLXvertArrayState *va = &gc->state.vertArray; + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); + __GLXvertArrayState *va = &state->vertArray; const GLubyte *iPtr1 = NULL; const GLushort *iPtr2 = NULL; const GLuint *iPtr3 = NULL; @@ -745,14 +892,40 @@ glDrawElements(mode,count,type,indices); } +void glMultiDrawArrays(GLenum mode, GLint *first, GLsizei *count, + GLsizei primcount) +{ + GLsizei i; + + for(i=0; i 0 ) { + glDrawArrays( mode, first[i], count[i] ); + } + } +} + +void glMultiDrawElements(GLenum mode, const GLsizei *count, + GLenum type, const GLvoid ** indices, + GLsizei primcount) +{ + GLsizei i; + + for(i=0; i 0 ) { + glDrawElements( mode, count[i], type, indices[i] ); + } + } +} + void glClientActiveTextureARB(GLenum texture) { __GLXcontext *gc = __glXGetCurrentContext(); + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); GLint unit = (GLint) texture - GL_TEXTURE0_ARB; if (unit < 0 || __GLX_MAX_TEXTURE_UNITS <= unit) { __glXSetError(gc, GL_INVALID_ENUM); return; } - gc->state.vertArray.activeTexture = unit; + state->vertArray.activeTexture = unit; } Index: xc/lib/GL/include/GL/internal/glcore.h diff -u xc/lib/GL/include/GL/internal/glcore.h:1.9 xc/lib/GL/include/GL/internal/glcore.h:1.12 --- xc/lib/GL/include/GL/internal/glcore.h:1.9 Wed Aug 28 02:41:25 2002 +++ xc/lib/GL/include/GL/internal/glcore.h Sun Oct 12 16:18:13 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.9 2002/08/28 06:41:25 torrey Exp $ */ +/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.12 2003/10/12 20:18:13 torrey Exp $ */ #ifndef __gl_core_h_ #define __gl_core_h_ @@ -48,7 +48,7 @@ #define GL_CORE_SGI 1 #define GL_CORE_MESA 2 -#define GL_CORE_AQUA 3 +#define GL_CORE_APPLE 4 typedef struct __GLcontextRec __GLcontext; typedef struct __GLinterfaceRec __GLinterface; @@ -72,9 +72,10 @@ */ typedef struct __GLcontextModesRec { GLboolean rgbMode; + GLboolean floatMode; GLboolean colorIndexMode; - GLboolean doubleBufferMode; - GLboolean stereoMode; + GLuint doubleBufferMode; + GLuint stereoMode; GLboolean haveAccumBuffer; GLboolean haveDepthBuffer; @@ -94,6 +95,46 @@ GLint level; GLint pixmapMode; + + /* GLX */ + GLint visualID; + GLint visualType; /**< One of the GLX X visual types. (i.e., + * \c GLX_TRUE_COLOR, etc.) + */ + + /* EXT_visual_rating / GLX 1.2 */ + GLint visualRating; + + /* EXT_visual_info / GLX 1.2 */ + GLint transparentPixel; + /* colors are floats scaled to ints */ + GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha; + GLint transparentIndex; + + /* ARB_multisample / SGIS_multisample */ + GLint sampleBuffers; + GLint samples; + + /* SGIX_fbconfig / GLX 1.3 */ + GLint drawableType; + GLint renderType; + GLint xRenderable; + GLint fbconfigID; + + /* SGIX_pbuffer / GLX 1.3 */ + GLint maxPbufferWidth; + GLint maxPbufferHeight; + GLint maxPbufferPixels; + GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */ + GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */ + + /* SGIX_visual_select_group */ + GLint visualSelectGroup; + + /* OML_swap_method */ + GLint swapMethod; + + GLint screen; } __GLcontextModes; /************************************************************************/ @@ -369,6 +410,7 @@ /* Drawing surface management */ __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc); + __GLdrawablePrivate *(*getReadablePrivate)(__GLcontext *gc); /* Operating system dependent data goes here */ void *other; @@ -384,8 +426,8 @@ /* Context management (return GL_FALSE on failure) */ GLboolean (*destroyContext)(__GLcontext *gc); GLboolean (*loseCurrent)(__GLcontext *gc); - /* oldglPriv isn't used anymore, kept for backwards compatibility */ - GLboolean (*makeCurrent)(__GLcontext *gc, __GLdrawablePrivate *oldglPriv); + /* oldglPriv isn't used anymore */ + GLboolean (*makeCurrent)(__GLcontext *gc); GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare); GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask); GLboolean (*forceCurrent)(__GLcontext *gc); Index: xc/lib/GL/mesa/src/Imakefile.inc diff -u xc/lib/GL/mesa/src/Imakefile.inc:1.8 xc/lib/GL/mesa/src/Imakefile.inc:1.9 --- xc/lib/GL/mesa/src/Imakefile.inc:1.8 Thu Nov 14 16:01:16 2002 +++ xc/lib/GL/mesa/src/Imakefile.inc Sun Sep 28 16:15:06 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.8 2002/11/14 21:01:16 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.9 2003/09/28 20:15:06 alanh Exp $ #ifndef MesaBuildDir #define MesaBuildDir $(GLXLIBSRC)/mesa/src/ @@ -31,7 +31,6 @@ $(MESABUILDDIR)buffers.c \ $(MESABUILDDIR)clip.c \ $(MESABUILDDIR)colortab.c \ - $(MESABUILDDIR)config.c \ $(MESABUILDDIR)context.c \ $(MESABUILDDIR)convolve.c \ $(MESABUILDDIR)debug.c \ @@ -56,7 +55,6 @@ $(MESABUILDDIR)light.c \ $(MESABUILDDIR)lines.c \ $(MESABUILDDIR)matrix.c \ - $(MESABUILDDIR)mem.c \ $(MESABUILDDIR)mmath.c \ $(MESABUILDDIR)pixel.c \ $(MESABUILDDIR)points.c \ @@ -64,6 +62,7 @@ $(MESABUILDDIR)rastpos.c \ $(MESABUILDDIR)state.c \ $(MESABUILDDIR)stencil.c \ + $(MESABUILDDIR)texcompress.c \ $(MESABUILDDIR)texformat.c \ $(MESABUILDDIR)teximage.c \ $(MESABUILDDIR)texobj.c \ @@ -71,7 +70,14 @@ $(MESABUILDDIR)texstore.c \ $(MESABUILDDIR)texutil.c \ $(MESABUILDDIR)varray.c \ - $(MESABUILDDIR)vtxfmt.c + $(MESABUILDDIR)vtxfmt.c \ + $(MESABUILDDIR)vpexec.c \ + $(MESABUILDDIR)vpexec.h \ + $(MESABUILDDIR)vpparse.c \ + $(MESABUILDDIR)vpparse.h \ + $(MESABUILDDIR)vpstate.c \ + $(MESABUILDDIR)vpstate.h + COREMESASRCS = $(COREMESABASESRCS) \ $(MESABUILDDIR)array_cache/ac_context.c \ @@ -105,11 +111,9 @@ $(MESABUILDDIR)swrast/s_lines.c \ $(MESABUILDDIR)swrast/s_logic.c \ $(MESABUILDDIR)swrast/s_masking.c \ - $(MESABUILDDIR)swrast/s_pb.c \ $(MESABUILDDIR)swrast/s_pixeltex.c \ $(MESABUILDDIR)swrast/s_points.c \ $(MESABUILDDIR)swrast/s_readpix.c \ - $(MESABUILDDIR)swrast/s_scissor.c \ $(MESABUILDDIR)swrast/s_span.c \ $(MESABUILDDIR)swrast/s_stencil.c \ $(MESABUILDDIR)swrast/s_texture.c \ @@ -136,6 +140,7 @@ $(MESABUILDDIR)tnl/t_vb_light.c \ $(MESABUILDDIR)tnl/t_vb_normals.c \ $(MESABUILDDIR)tnl/t_vb_points.c \ + $(MESABUILDDIR)tnl/t_vb_program.c \ $(MESABUILDDIR)tnl/t_vb_render.c \ $(MESABUILDDIR)tnl/t_vb_texgen.c \ $(MESABUILDDIR)tnl/t_vb_texmat.c \ @@ -153,7 +158,6 @@ LinkSourceFile(buffers.c, $(MESASRCDIR)/src) LinkSourceFile(clip.c, $(MESASRCDIR)/src) LinkSourceFile(colortab.c, $(MESASRCDIR)/src) -LinkSourceFile(config.c, $(MESASRCDIR)/src) LinkSourceFile(context.c, $(MESASRCDIR)/src) LinkSourceFile(convolve.c, $(MESASRCDIR)/src) LinkSourceFile(debug.c, $(MESASRCDIR)/src) @@ -182,7 +186,6 @@ LinkSourceFile(light.c, $(MESASRCDIR)/src) LinkSourceFile(lines.c, $(MESASRCDIR)/src) LinkSourceFile(matrix.c, $(MESASRCDIR)/src) -LinkSourceFile(mem.c, $(MESASRCDIR)/src) LinkSourceFile(mmath.c, $(MESASRCDIR)/src) LinkSourceFile(pixel.c, $(MESASRCDIR)/src) LinkSourceFile(points.c, $(MESASRCDIR)/src) @@ -190,6 +193,7 @@ LinkSourceFile(rastpos.c, $(MESASRCDIR)/src) LinkSourceFile(state.c, $(MESASRCDIR)/src) LinkSourceFile(stencil.c, $(MESASRCDIR)/src) +LinkSourceFile(texcompress.c, $(MESASRCDIR)/src) LinkSourceFile(texformat.c, $(MESASRCDIR)/src) LinkSourceFile(teximage.c, $(MESASRCDIR)/src) LinkSourceFile(texobj.c, $(MESASRCDIR)/src) @@ -198,6 +202,13 @@ LinkSourceFile(texutil.c, $(MESASRCDIR)/src) LinkSourceFile(varray.c, $(MESASRCDIR)/src) LinkSourceFile(vtxfmt.c, $(MESASRCDIR)/src) +LinkSourceFile(vpexec.c, $(MESASRCDIR)/src) +LinkSourceFile(vpexec.h, $(MESASRCDIR)/src) +LinkSourceFile(vpparse.c, $(MESASRCDIR)/src) +LinkSourceFile(vpparse.h, $(MESASRCDIR)/src) +LinkSourceFile(vpstate.c, $(MESASRCDIR)/src) +LinkSourceFile(vpstate.h, $(MESASRCDIR)/src) + #endif #ifdef NeedAllMesaSrc @@ -219,7 +230,6 @@ $(MESABUILDDIR)buffers.o \ $(MESABUILDDIR)clip.o \ $(MESABUILDDIR)colortab.o \ - $(MESABUILDDIR)config.o \ $(MESABUILDDIR)context.o \ $(MESABUILDDIR)convolve.o \ $(MESABUILDDIR)debug.o \ @@ -244,7 +254,6 @@ $(MESABUILDDIR)light.o \ $(MESABUILDDIR)lines.o \ $(MESABUILDDIR)matrix.o \ - $(MESABUILDDIR)mem.o \ $(MESABUILDDIR)mmath.o \ $(MESABUILDDIR)pixel.o \ $(MESABUILDDIR)points.o \ @@ -252,6 +261,7 @@ $(MESABUILDDIR)rastpos.o \ $(MESABUILDDIR)state.o \ $(MESABUILDDIR)stencil.o \ + $(MESABUILDDIR)texcompress.o \ $(MESABUILDDIR)texformat.o \ $(MESABUILDDIR)teximage.o \ $(MESABUILDDIR)texobj.o \ @@ -259,7 +269,11 @@ $(MESABUILDDIR)texstore.o \ $(MESABUILDDIR)texutil.o \ $(MESABUILDDIR)varray.o \ - $(MESABUILDDIR)vtxfmt.o + $(MESABUILDDIR)vtxfmt.o \ + $(MESABUILDDIR)vpexec.o \ + $(MESABUILDDIR)vpparse.o \ + $(MESABUILDDIR)vpstate.o + COREMESAOBJS = $(COREMESABASEOBJS) \ $(MESA_AC_OBJS) \ @@ -287,7 +301,6 @@ $(MESABUILDDIR)unshared/buffers.o \ $(MESABUILDDIR)unshared/clip.o \ $(MESABUILDDIR)unshared/colortab.o \ - $(MESABUILDDIR)unshared/config.o \ $(MESABUILDDIR)unshared/context.o \ $(MESABUILDDIR)unshared/convolve.o \ $(MESABUILDDIR)unshared/debug.o \ @@ -312,7 +325,6 @@ $(MESABUILDDIR)unshared/light.o \ $(MESABUILDDIR)unshared/lines.o \ $(MESABUILDDIR)unshared/matrix.o \ - $(MESABUILDDIR)unshared/mem.o \ $(MESABUILDDIR)unshared/mmath.o \ $(MESABUILDDIR)unshared/pixel.o \ $(MESABUILDDIR)unshared/points.o \ @@ -320,6 +332,7 @@ $(MESABUILDDIR)unshared/rastpos.o \ $(MESABUILDDIR)unshared/state.o \ $(MESABUILDDIR)unshared/stencil.o \ + $(MESABUILDDIR)unshared/texcompress.o \ $(MESABUILDDIR)unshared/texformat.o \ $(MESABUILDDIR)unshared/teximage.o \ $(MESABUILDDIR)unshared/texobj.o \ @@ -328,6 +341,9 @@ $(MESABUILDDIR)unshared/texutil.o \ $(MESABUILDDIR)unshared/varray.o \ $(MESABUILDDIR)unshared/vtxfmt.o \ + $(MESABUILDDIR)unshared/vpexec.o \ + $(MESABUILDDIR)unshared/vpparse.o \ + $(MESABUILDDIR)unshared/vpstate.o #else COREMESABASEUOBJS = $(COREMESABASEOBJS) #endif @@ -357,7 +373,6 @@ $(MESABUILDDIR)debugger/buffers.o \ $(MESABUILDDIR)debugger/clip.o \ $(MESABUILDDIR)debugger/colortab.o \ - $(MESABUILDDIR)debugger/config.o \ $(MESABUILDDIR)debugger/context.o \ $(MESABUILDDIR)debugger/convolve.o \ $(MESABUILDDIR)debugger/debug.o \ @@ -382,7 +397,6 @@ $(MESABUILDDIR)debugger/light.o \ $(MESABUILDDIR)debugger/lines.o \ $(MESABUILDDIR)debugger/matrix.o \ - $(MESABUILDDIR)debugger/mem.o \ $(MESABUILDDIR)debugger/mmath.o \ $(MESABUILDDIR)debugger/pixel.o \ $(MESABUILDDIR)debugger/points.o \ @@ -390,6 +404,7 @@ $(MESABUILDDIR)debugger/rastpos.o \ $(MESABUILDDIR)debugger/state.o \ $(MESABUILDDIR)debugger/stencil.o \ + $(MESABUILDDIR)debugger/texcompress.o \ $(MESABUILDDIR)debugger/texformat.o \ $(MESABUILDDIR)debugger/teximage.o \ $(MESABUILDDIR)debugger/texobj.o \ @@ -398,6 +413,9 @@ $(MESABUILDDIR)debugger/texutil.o \ $(MESABUILDDIR)debugger/varray.o \ $(MESABUILDDIR)debugger/vtxfmt.o \ + $(MESABUILDDIR)debugger/vpexec.o \ + $(MESABUILDDIR)debugger/vpparse.o \ + $(MESABUILDDIR)debugger/vpstate.o COREMESADOBJS = $(COREMESABASEDOBJS) \ $(MESA_AC_DOBJS) \ @@ -424,7 +442,6 @@ $(MESABUILDDIR)profiled/buffers.o \ $(MESABUILDDIR)profiled/clip.o \ $(MESABUILDDIR)profiled/colortab.o \ - $(MESABUILDDIR)profiled/config.o \ $(MESABUILDDIR)profiled/context.o \ $(MESABUILDDIR)profiled/convolve.o \ $(MESABUILDDIR)profiled/debug.o \ @@ -449,7 +466,6 @@ $(MESABUILDDIR)profiled/light.o \ $(MESABUILDDIR)profiled/lines.o \ $(MESABUILDDIR)profiled/matrix.o \ - $(MESABUILDDIR)profiled/mem.o \ $(MESABUILDDIR)profiled/mmath.o \ $(MESABUILDDIR)profiled/pixel.o \ $(MESABUILDDIR)profiled/points.o \ @@ -457,6 +473,7 @@ $(MESABUILDDIR)profiled/rastpos.o \ $(MESABUILDDIR)profiled/state.o \ $(MESABUILDDIR)profiled/stencil.o \ + $(MESABUILDDIR)profiled/texcompress.o \ $(MESABUILDDIR)profiled/texformat.o \ $(MESABUILDDIR)profiled/teximage.o \ $(MESABUILDDIR)profiled/texobj.o \ @@ -465,6 +482,9 @@ $(MESABUILDDIR)profiled/texutil.o \ $(MESABUILDDIR)profiled/varray.o \ $(MESABUILDDIR)profiled/vtxfmt.o \ + $(MESABUILDDIR)profiled/vpexec.o \ + $(MESABUILDDIR)profiled/vpparse.o \ + $(MESABUILDDIR)profiled/vpstate.o COREMESAPOBJS = $(COREMESABASEPOBJS) \ $(MESA_AC_POBJS) \ Index: xc/lib/GL/mesa/src/OSmesa/Imakefile diff -u xc/lib/GL/mesa/src/OSmesa/Imakefile:1.17 xc/lib/GL/mesa/src/OSmesa/Imakefile:1.20 --- xc/lib/GL/mesa/src/OSmesa/Imakefile:1.17 Wed Nov 27 13:28:02 2002 +++ xc/lib/GL/mesa/src/OSmesa/Imakefile Thu Dec 11 22:20:33 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/OSmesa/Imakefile,v 1.17 2002/11/27 18:28:02 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/OSmesa/Imakefile,v 1.20 2003/12/12 03:20:33 dawes Exp $ #include @@ -15,7 +15,7 @@ #include "../tnl/Imakefile.inc" #include "../tnl_dd/Imakefile.inc" #include "../Imakefile.inc" -#if defined(i386Architecture) && !SystemV4 && MesaUseX86Asm +#if defined(i386Architecture) && MesaUseX86Asm #include "../X86/Imakefile.inc" #endif #ifdef SparcArchitecture @@ -54,7 +54,9 @@ THREADOBJS = $(THREADS_LIBS) #endif -#if !GlxUseBuiltInDRIDriver +#ifdef SharedOSMesaReqs + REQUIREDLIBS = SharedOSMesaReqs +#elif !GlxUseBuiltInDRIDriver REQUIREDLIBS = $(LDPRELIB) $(GLXLIB) #endif @@ -66,7 +68,11 @@ NormalLintTarget($(SRCS)) LIBNAME = OSMesa +#if !defined(OS2Architecture) SOREV = 4.0 +#else +SOREV = +#endif #if DoNormalLib Index: xc/lib/GL/mesa/src/OSmesa/OSMesa-def.cpp diff -u xc/lib/GL/mesa/src/OSmesa/OSMesa-def.cpp:1.1 xc/lib/GL/mesa/src/OSmesa/OSMesa-def.cpp:1.2 --- xc/lib/GL/mesa/src/OSmesa/OSMesa-def.cpp:1.1 Sun Apr 7 11:19:45 2002 +++ xc/lib/GL/mesa/src/OSmesa/OSMesa-def.cpp Mon Mar 24 23:18:08 2003 @@ -9,6 +9,7 @@ OSMesaGetIntegerv OSMesaMakeCurrent OSMesaPixelStore +#ifndef __UNIXOS2__ _glapi_Context _glapi_noop_enable_warnings _glapi_add_entrypoint @@ -21,5 +22,8 @@ glNormalPointer glVertexPointer glDrawElements +#else + OSMesaCreateContextExt +#endif /* __UNIXOS2__ */ -/* $XFree86: xc/lib/GL/mesa/src/OSmesa/OSMesa-def.cpp,v 1.1 2002/04/07 15:19:45 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/OSmesa/OSMesa-def.cpp,v 1.2 2003/03/25 04:18:08 dawes Exp $ */ Index: xc/lib/GL/mesa/src/X86/Imakefile diff -u xc/lib/GL/mesa/src/X86/Imakefile:1.24 xc/lib/GL/mesa/src/X86/Imakefile:1.27 --- xc/lib/GL/mesa/src/X86/Imakefile:1.24 Mon Nov 25 07:58:55 2002 +++ xc/lib/GL/mesa/src/X86/Imakefile Sun Sep 28 16:15:06 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile,v 1.24 2002/11/25 12:58:55 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile,v 1.27 2003/09/28 20:15:06 alanh Exp $ /* * Need both shared and unshared Mesa objects in the following cases: @@ -10,7 +10,7 @@ * driver modules. */ -#if GlxDriverUsesMesa || GlxBuiltInXMesa || BuildOSMesaLib +#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa || BuildOSMesaLib)) #define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) #define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) #define DoExtraLib SharedLibGlx @@ -53,7 +53,6 @@ ObjectFromAsmSource(common_x86_asm, NullParameter) ObjectFromAsmSource(x86_cliptest, NullParameter) -ObjectFromAsmSource(x86_vertex, NullParameter) ObjectFromAsmSource(x86_xform2, NullParameter) ObjectFromAsmSource(x86_xform3, NullParameter) ObjectFromAsmSource(x86_xform4, NullParameter) @@ -64,7 +63,6 @@ #if MesaUse3DNow ObjectFromAsmSource(3dnow_normal, NullParameter) -ObjectFromAsmSource(3dnow_vertex, NullParameter) ObjectFromAsmSource(3dnow_xform1, NullParameter) ObjectFromAsmSource(3dnow_xform2, NullParameter) ObjectFromAsmSource(3dnow_xform3, NullParameter) @@ -73,7 +71,6 @@ #if MesaUseSSE ObjectFromAsmSource(sse_normal, NullParameter) -ObjectFromAsmSource(sse_vertex, NullParameter) ObjectFromAsmSource(sse_xform1, NullParameter) ObjectFromAsmSource(sse_xform2, NullParameter) ObjectFromAsmSource(sse_xform3, NullParameter) Index: xc/lib/GL/mesa/src/X86/Imakefile.inc diff -u xc/lib/GL/mesa/src/X86/Imakefile.inc:1.6 xc/lib/GL/mesa/src/X86/Imakefile.inc:1.7 --- xc/lib/GL/mesa/src/X86/Imakefile.inc:1.6 Mon Nov 25 07:58:55 2002 +++ xc/lib/GL/mesa/src/X86/Imakefile.inc Sun Sep 28 16:15:06 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile.inc,v 1.6 2002/11/25 12:58:55 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile.inc,v 1.7 2003/09/28 20:15:06 alanh Exp $ #ifndef MesaX86BuildDir #define MesaX86BuildDir $(GLXLIBSRC)/mesa/src/X86/ @@ -11,7 +11,6 @@ $(MESAX86BUILDDIR)glapi_x86.S \ $(MESAX86BUILDDIR)x86.c \ $(MESAX86BUILDDIR)x86_cliptest.S \ - $(MESAX86BUILDDIR)x86_vertex.S \ $(MESAX86BUILDDIR)x86_xform2.S \ $(MESAX86BUILDDIR)x86_xform3.S \ $(MESAX86BUILDDIR)x86_xform4.S @@ -22,7 +21,6 @@ LinkSourceFile(glapi_x86.S, $(MESASRCDIR)/src/X86) LinkSourceFile(x86.c, $(MESASRCDIR)/src/X86) LinkSourceFile(x86_cliptest.S, $(MESASRCDIR)/src/X86) -LinkSourceFile(x86_vertex.S, $(MESASRCDIR)/src/X86) LinkSourceFile(x86_xform2.S, $(MESASRCDIR)/src/X86) LinkSourceFile(x86_xform3.S, $(MESASRCDIR)/src/X86) LinkSourceFile(x86_xform4.S, $(MESASRCDIR)/src/X86) @@ -32,7 +30,6 @@ $(MESAX86BUILDDIR)common_x86_asm.o \ $(MESAX86BUILDDIR)x86.o \ $(MESAX86BUILDDIR)x86_cliptest.o \ - $(MESAX86BUILDDIR)x86_vertex.o \ $(MESAX86BUILDDIR)x86_xform2.o \ $(MESAX86BUILDDIR)x86_xform3.o \ $(MESAX86BUILDDIR)x86_xform4.o @@ -42,7 +39,6 @@ $(MESAX86BUILDDIR)common_x86_asm.o \ $(MESAX86BUILDDIR)unshared/x86.o \ $(MESAX86BUILDDIR)x86_cliptest.o \ - $(MESAX86BUILDDIR)x86_vertex.o \ $(MESAX86BUILDDIR)x86_xform2.o \ $(MESAX86BUILDDIR)x86_xform3.o \ $(MESAX86BUILDDIR)x86_xform4.o @@ -54,7 +50,6 @@ $(MESAX86BUILDDIR)common_x86_asm.o \ $(MESAX86BUILDDIR)debugger/x86.o \ $(MESAX86BUILDDIR)x86_cliptest.o \ - $(MESAX86BUILDDIR)x86_vertex.o \ $(MESAX86BUILDDIR)x86_xform2.o \ $(MESAX86BUILDDIR)x86_xform3.o \ $(MESAX86BUILDDIR)x86_xform4.o @@ -63,7 +58,6 @@ $(MESAX86BUILDDIR)common_x86_asm.o \ $(MESAX86BUILDDIR)profiled/x86.o \ $(MESAX86BUILDDIR)x86_cliptest.o \ - $(MESAX86BUILDDIR)x86_vertex.o \ $(MESAX86BUILDDIR)x86_xform2.o \ $(MESAX86BUILDDIR)x86_xform3.o \ $(MESAX86BUILDDIR)x86_xform4.o @@ -90,7 +84,6 @@ #if MesaUse3DNow MESA_3DNOW_SRCS = $(MESAX86BUILDDIR)3dnow.c \ $(MESAX86BUILDDIR)3dnow_normal.S \ - $(MESAX86BUILDDIR)3dnow_vertex.S \ $(MESAX86BUILDDIR)3dnow_xform1.S \ $(MESAX86BUILDDIR)3dnow_xform2.S \ $(MESAX86BUILDDIR)3dnow_xform3.S \ @@ -99,7 +92,6 @@ #ifdef NeedToLinkMesaSrc LinkSourceFile(3dnow.c, $(MESASRCDIR)/src/X86) LinkSourceFile(3dnow_normal.S, $(MESASRCDIR)/src/X86) -LinkSourceFile(3dnow_vertex.S, $(MESASRCDIR)/src/X86) LinkSourceFile(3dnow_xform1.S, $(MESASRCDIR)/src/X86) LinkSourceFile(3dnow_xform2.S, $(MESASRCDIR)/src/X86) LinkSourceFile(3dnow_xform3.S, $(MESASRCDIR)/src/X86) @@ -107,7 +99,6 @@ #endif MESA_3DNOW_OBJS = $(MESAX86BUILDDIR)3dnow.o \ $(MESAX86BUILDDIR)3dnow_normal.o \ - $(MESAX86BUILDDIR)3dnow_vertex.o \ $(MESAX86BUILDDIR)3dnow_xform1.o \ $(MESAX86BUILDDIR)3dnow_xform2.o \ $(MESAX86BUILDDIR)3dnow_xform3.o \ @@ -116,7 +107,6 @@ #if defined(DoSharedLib) && DoSharedLib MESA_3DNOW_UOBJS = $(MESAX86BUILDDIR)unshared/3dnow.o \ $(MESAX86BUILDDIR)3dnow_normal.o \ - $(MESAX86BUILDDIR)3dnow_vertex.o \ $(MESAX86BUILDDIR)3dnow_xform1.o \ $(MESAX86BUILDDIR)3dnow_xform2.o \ $(MESAX86BUILDDIR)3dnow_xform3.o \ @@ -127,7 +117,6 @@ MESA_3DNOW_DOBJS = $(MESAX86BUILDDIR)debugger/3dnow.o \ $(MESAX86BUILDDIR)3dnow_normal.o \ - $(MESAX86BUILDDIR)3dnow_vertex.o \ $(MESAX86BUILDDIR)3dnow_xform1.o \ $(MESAX86BUILDDIR)3dnow_xform2.o \ $(MESAX86BUILDDIR)3dnow_xform3.o \ @@ -135,7 +124,6 @@ MESA_3DNOW_POBJS = $(MESAX86BUILDDIR)profiled/3dnow.o \ $(MESAX86BUILDDIR)3dnow_normal.o \ - $(MESAX86BUILDDIR)3dnow_vertex.o \ $(MESAX86BUILDDIR)3dnow_xform1.o \ $(MESAX86BUILDDIR)3dnow_xform2.o \ $(MESAX86BUILDDIR)3dnow_xform3.o \ @@ -147,7 +135,6 @@ #if MesaUseSSE MESA_SSE_SRCS = $(MESAX86BUILDDIR)sse.c \ $(MESAX86BUILDDIR)sse_normal.S \ - $(MESAX86BUILDDIR)sse_vertex.S \ $(MESAX86BUILDDIR)sse_xform1.S \ $(MESAX86BUILDDIR)sse_xform2.S \ $(MESAX86BUILDDIR)sse_xform3.S \ @@ -156,7 +143,6 @@ #ifdef NeedToLinkMesaSrc LinkSourceFile(sse.c, $(MESASRCDIR)/src/X86) LinkSourceFile(sse_normal.S, $(MESASRCDIR)/src/X86) -LinkSourceFile(sse_vertex.S, $(MESASRCDIR)/src/X86) LinkSourceFile(sse_xform1.S, $(MESASRCDIR)/src/X86) LinkSourceFile(sse_xform2.S, $(MESASRCDIR)/src/X86) LinkSourceFile(sse_xform3.S, $(MESASRCDIR)/src/X86) @@ -165,7 +151,6 @@ MESA_SSE_OBJS = $(MESAX86BUILDDIR)sse.o \ $(MESAX86BUILDDIR)sse_normal.o \ - $(MESAX86BUILDDIR)sse_vertex.o \ $(MESAX86BUILDDIR)sse_xform1.o \ $(MESAX86BUILDDIR)sse_xform2.o \ $(MESAX86BUILDDIR)sse_xform3.o \ @@ -174,7 +159,6 @@ #if defined(DoSharedLib) && DoSharedLib MESA_SSE_UOBJS = $(MESAX86BUILDDIR)unshared/sse.o \ $(MESAX86BUILDDIR)sse_normal.o \ - $(MESAX86BUILDDIR)sse_vertex.o \ $(MESAX86BUILDDIR)sse_xform1.o \ $(MESAX86BUILDDIR)sse_xform2.o \ $(MESAX86BUILDDIR)sse_xform3.o \ @@ -185,7 +169,6 @@ MESA_SSE_DOBJS = $(MESAX86BUILDDIR)debugger/sse.o \ $(MESAX86BUILDDIR)sse_normal.o \ - $(MESAX86BUILDDIR)sse_vertex.o \ $(MESAX86BUILDDIR)sse_xform1.o \ $(MESAX86BUILDDIR)sse_xform2.o \ $(MESAX86BUILDDIR)sse_xform3.o \ @@ -193,7 +176,6 @@ MESA_SSE_POBJS = $(MESAX86BUILDDIR)profiled/sse.o \ $(MESAX86BUILDDIR)sse_normal.o \ - $(MESAX86BUILDDIR)sse_vertex.o \ $(MESAX86BUILDDIR)sse_xform1.o \ $(MESAX86BUILDDIR)sse_xform2.o \ $(MESAX86BUILDDIR)sse_xform3.o \ Index: xc/lib/GL/mesa/src/drv/common/Imakefile diff -u xc/lib/GL/mesa/src/drv/common/Imakefile:1.6 xc/lib/GL/mesa/src/drv/common/Imakefile:1.7 --- xc/lib/GL/mesa/src/drv/common/Imakefile:1.6 Mon Apr 2 22:29:34 2001 +++ xc/lib/GL/mesa/src/drv/common/Imakefile Sun Sep 28 16:15:06 2003 @@ -1,4 +1,6 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/common/Imakefile,v 1.6 2001/04/03 02:29:34 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/common/Imakefile,v 1.7 2003/09/28 20:15:06 alanh Exp $ + +#include #if GlxUseBuiltInDRIDriver #define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) @@ -17,7 +19,14 @@ #define MesaDrvCommonBuildDir /**/ #include "Imakefile.inc" - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) +#if defined(i386Architecture) && MesaUseX86Asm +#include "../../X86/Imakefile.inc" +#endif +#ifdef SparcArchitecture +#include "../../SPARC/Imakefile.inc" +#endif + + DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(MESA_ASM_DEFINES) INCLUDES = $(X_INCLUDES) $(MESA_INCLUDES) $(DRI_INCLUDES) SRCS = $(COMMONSRCS) Index: xc/lib/GL/mesa/src/drv/common/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/common/Imakefile.inc:1.2 xc/lib/GL/mesa/src/drv/common/Imakefile.inc:1.4 --- xc/lib/GL/mesa/src/drv/common/Imakefile.inc:1.2 Wed May 2 11:06:03 2001 +++ xc/lib/GL/mesa/src/drv/common/Imakefile.inc Sun Sep 28 16:15:07 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/common/Imakefile.inc,v 1.2 2001/05/02 15:06:03 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/common/Imakefile.inc,v 1.4 2003/09/28 20:15:07 alanh Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,29 +16,56 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines - DRI_INCLUDES = + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) + DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ + -I$(GLXLIBSRC)/glx \ + -I$(INCLUDESRC) \ + -I$(INCLUDESRC)/GL \ + -I$(SERVERSRC)/GL/dri \ + -I$(XF86OSSRC) \ + -I$(XF86COMSRC) \ + -I$(GLXLIBSRC)/dri/drm \ + -I$(GLXLIBSRC)/include #endif -MESA_INCLUDES = -I$(MESADRVSRCDIR)/common +MESA_INCLUDES = -I$(MESASRCDIR)/src \ + -I$(MESADRVSRCDIR)/common X_INCLUDES = -I$(XINCLUDESRC) -I$(EXTINCSRC) COMMONSRCS = $(MESADRVCOMMONBUILDDIR)hwlog.c \ - $(MESADRVCOMMONBUILDDIR)mm.c + $(MESADRVCOMMONBUILDDIR)mm.c \ + $(MESADRVCOMMONBUILDDIR)utils.c \ + $(MESADRVCOMMONBUILDDIR)vblank.c \ + $(MESADRVCOMMONBUILDDIR)texmem.c COMMONOBJS = $(MESADRVCOMMONBUILDDIR)hwlog.o \ - $(MESADRVCOMMONBUILDDIR)mm.o + $(MESADRVCOMMONBUILDDIR)mm.o \ + $(MESADRVCOMMONBUILDDIR)utils.o \ + $(MESADRVCOMMONBUILDDIR)vblank.o \ + $(MESADRVCOMMONBUILDDIR)texmem.o COMMONUOBJS = $(MESADRVCOMMONBUILDDIR)unshared/hwlog.o \ - $(MESADRVCOMMONBUILDDIR)unshared/mm.o + $(MESADRVCOMMONBUILDDIR)unshared/mm.o \ + $(MESADRVCOMMONBUILDDIR)unshared/utils.o \ + $(MESADRVCOMMONBUILDDIR)unshared/vblank.o \ + $(MESADRVCOMMONBUILDDIR)unshared/texmem.o COMMONDOBJS = $(MESADRVCOMMONBUILDDIR)debugger/hwlog.o \ - $(MESADRVCOMMONBUILDDIR)debugger/mm.o + $(MESADRVCOMMONBUILDDIR)debugger/mm.o \ + $(MESADRVCOMMONBUILDDIR)debugger/utils.o \ + $(MESADRVCOMMONBUILDDIR)debugger/vblank.o \ + $(MESADRVCOMMONBUILDDIR)debugger/texmem.o COMMONPOBJS = $(MESADRVCOMMONBUILDDIR)profiled/hwlog.o \ - $(MESADRVCOMMONBUILDDIR)profiled/mm.o + $(MESADRVCOMMONBUILDDIR)profiled/mm.o \ + $(MESADRVCOMMONBUILDDIR)profiled/utils.o \ + $(MESADRVCOMMONBUILDDIR)profiled/vblank.o \ + $(MESADRVCOMMONBUILDDIR)profiled/texmem.o #ifdef NeedToLinkMesaSrc LinkSourceFile(hwlog.c, $(MESADRVSRCDIR)/common) LinkSourceFile(mm.c, $(MESADRVSRCDIR)/common) +LinkSourceFile(texmem.c, $(MESADRVSRCDIR)/common) +LinkSourceFile(utils.c, $(MESADRVSRCDIR)/common) +LinkSourceFile(vblank.c, $(MESADRVSRCDIR)/common) #endif Index: xc/lib/GL/mesa/src/drv/common/hwlog.c diff -u xc/lib/GL/mesa/src/drv/common/hwlog.c:1.3 xc/lib/GL/mesa/src/drv/common/hwlog.c:1.4 --- xc/lib/GL/mesa/src/drv/common/hwlog.c:1.3 Fri Aug 17 22:51:03 2001 +++ xc/lib/GL/mesa/src/drv/common/hwlog.c Sun Sep 28 16:15:07 2003 @@ -24,7 +24,7 @@ * * Wittawat Yamwong */ -/* $XFree86: xc/lib/GL/mesa/src/drv/common/hwlog.c,v 1.3 2001/08/18 02:51:03 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/common/hwlog.c,v 1.4 2003/09/28 20:15:07 alanh Exp $ */ #include "hwlog.h" hwlog_t hwlog = { 0,0,0, "[???] "}; @@ -36,7 +36,8 @@ #include -int usec( void ) +#ifdef HW_LOG_ENABLED +static int usec( void ) { struct timeval tv; struct timezone tz; @@ -46,8 +47,6 @@ return (tv.tv_sec & 2047) * 1000000 + tv.tv_usec; } - -#ifdef HW_LOG_ENABLED int hwOpenLog(const char *filename, char *prefix) { hwCloseLog(); @@ -120,13 +119,6 @@ va_end(ap); } -#else /* ifdef HW_LOG_ENABLED */ - -int hwlogdummy() -{ - return 0; -} - #endif void hwError(const char *format, ...) Index: xc/lib/GL/mesa/src/drv/common/mm.c diff -u xc/lib/GL/mesa/src/drv/common/mm.c:1.4 xc/lib/GL/mesa/src/drv/common/mm.c:1.5 --- xc/lib/GL/mesa/src/drv/common/mm.c:1.4 Wed Oct 30 07:51:27 2002 +++ xc/lib/GL/mesa/src/drv/common/mm.c Sun Sep 28 16:15:07 2003 @@ -1,6 +1,6 @@ /* * GLX Hardware Device Driver common code - * Copyright (C) 1999 Keith Whitwell + * Copyright (C) 1999 Wittawat Yamwong * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -15,13 +15,13 @@ * 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 - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS 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. * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/common/mm.c,v 1.4 2002/10/30 12:51:27 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/common/mm.c,v 1.5 2003/09/28 20:15:07 alanh Exp $ */ #include #include @@ -29,15 +29,12 @@ #include "mm.h" #include "hwlog.h" -/* KW: I don't know who the author of this code is, but it wasn't me - * despite what the copyright says... - */ void mmDumpMemInfo( memHeap_t *heap ) { TMemBlock *p; - fprintf(stderr, "Memory heap %p:\n", heap); + fprintf(stderr, "Memory heap %p:\n", (void *)heap); if (heap == 0) { fprintf(stderr, " heap == 0\n"); } else { Index: xc/lib/GL/mesa/src/drv/common/texmem.c diff -u /dev/null xc/lib/GL/mesa/src/drv/common/texmem.c:1.3 --- /dev/null Sat Feb 28 21:41:12 2004 +++ xc/lib/GL/mesa/src/drv/common/texmem.c Tue Dec 2 08:02:37 2003 @@ -0,0 +1,1232 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (C) Copyright IBM Corporation 2002, 2003 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + * + * Authors: + * Ian Romanick + * Keith Whitwell + * Kevin E. Martin + * Gareth Hughes + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/common/texmem.c,v 1.3 2003/12/02 13:02:37 alanh Exp $ */ + +/** \file texmem.c + * Implements all of the device-independent texture memory management. + * + * Currently, only a simple LRU texture memory management policy is + * implemented. In the (hopefully very near) future, better policies will be + * implemented. The idea is that the DRI should be able to run in one of two + * modes. In the default mode the DRI will dynamically attempt to discover + * the best texture management policy for the running application. In the + * other mode, the user (via some sort of as yet TBD mechanism) will select + * a texture management policy that is known to work well with the + * application. + */ + +#include "texmem.h" +#include "simple_list.h" +#include "imports.h" +#include "macros.h" + +#include + + + +static unsigned dummy_swap_counter; + + +/** + * Calculate \f$\log_2\f$ of a value. This is a particularly poor + * implementation of this function. However, since system performance is in + * no way dependent on this function, the slowness of the implementation is + * irrelevent. + * + * \param n Value whose \f$\log_2\f$ is to be calculated + */ + +static unsigned +driLog2( unsigned n ) +{ + unsigned log2; + + + for ( log2 = 1 ; n > 1 ; log2++ ) { + n >>= 1; + } + + return log2; +} + + + + +/** + * Determine if a texture is resident in textureable memory. Depending on + * the driver, this may or may not be on-card memory. It could be AGP memory + * or anyother type of memory from which the hardware can directly read + * texels. + * + * This function is intended to be used as the \c IsTextureResident function + * in the device's \c dd_function_table. + * + * \param ctx GL context pointer (currently unused) + * \param texObj Texture object to be tested + */ + +GLboolean +driIsTextureResident( GLcontext * ctx, + struct gl_texture_object * texObj ) +{ + driTextureObject * t; + + + t = (driTextureObject *) texObj->DriverData; + return( (t != NULL) && (t->memBlock != NULL) ); +} + + + + +/** + * (Re)initialize the global circular LRU list. The last element + * in the array (\a heap->nrRegions) is the sentinal. Keeping it + * at the end of the array allows the other elements of the array + * to be addressed rationally when looking up objects at a particular + * location in texture memory. + * + * \param heap Texture heap to be reset + */ + +static void resetGlobalLRU( driTexHeap * heap ) +{ + drmTextureRegionPtr list = heap->global_regions; + unsigned sz = 1U << heap->logGranularity; + unsigned i; + + for (i = 0 ; (i+1) * sz <= heap->size ; i++) { + list[i].prev = i-1; + list[i].next = i+1; + list[i].age = 0; + } + + i--; + list[0].prev = heap->nrRegions; + list[i].prev = i-1; + list[i].next = heap->nrRegions; + list[heap->nrRegions].prev = i; + list[heap->nrRegions].next = 0; + heap->global_age[0] = 0; +} + +/** + * Print out debugging information about the local texture LRU. + * + * \param heap Texture heap to be printed + * \param callername Name of calling function + */ +static void printLocalLRU( driTexHeap * heap, const char *callername ) +{ + driTextureObject *t; + unsigned sz = 1U << heap->logGranularity; + + fprintf( stderr, "%s in %s:\nLocal LRU, heap %d:\n", + __FUNCTION__, callername, heap->heapId ); + + foreach ( t, &heap->texture_objects ) { + if (!t->memBlock) + continue; + if (!t->tObj) { + fprintf( stderr, "Placeholder (%p) %d at 0x%x sz 0x%x\n", + (void *)t, + t->memBlock->ofs / sz, + t->memBlock->ofs, + t->memBlock->size ); + } else { + fprintf( stderr, "Texture (%p) at 0x%x sz 0x%x\n", + (void *)t, + t->memBlock->ofs, + t->memBlock->size ); + } + } + foreach ( t, heap->swapped_objects ) { + if (!t->tObj) { + fprintf( stderr, "Swapped Placeholder (%p)\n", (void *)t ); + } else { + fprintf( stderr, "Swapped Texture (%p)\n", (void *)t ); + } + } + + fprintf( stderr, "\n" ); +} + +/** + * Print out debugging information about the global texture LRU. + * + * \param heap Texture heap to be printed + * \param callername Name of calling function + */ +static void printGlobalLRU( driTexHeap * heap, const char *callername ) +{ + drmTextureRegionPtr list = heap->global_regions; + int i, j; + + fprintf( stderr, "%s in %s:\nGlobal LRU, heap %d list %p:\n", + __FUNCTION__, callername, heap->heapId, (void *)list ); + + for ( i = 0, j = heap->nrRegions ; i < heap->nrRegions ; i++ ) { + fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n", + j, list[j].age, list[j].next, list[j].prev, list[j].in_use ); + j = list[j].next; + if ( j == heap->nrRegions ) break; + } + + if ( j != heap->nrRegions ) { + fprintf( stderr, "Loop detected in global LRU\n" ); + for ( i = 0 ; i < heap->nrRegions ; i++ ) { + fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n", + i, list[i].age, list[i].next, list[i].prev, list[i].in_use ); + } + } + + fprintf( stderr, "\n" ); +} + + +/** + * Called by the client whenever it touches a local texture. + * + * \param t Texture object that the client has accessed + */ + +void driUpdateTextureLRU( driTextureObject * t ) +{ + driTexHeap * heap; + drmTextureRegionPtr list; + unsigned shift; + unsigned start; + unsigned end; + unsigned i; + + + heap = t->heap; + if ( heap != NULL ) { + shift = heap->logGranularity; + start = t->memBlock->ofs >> shift; + end = (t->memBlock->ofs + t->memBlock->size - 1) >> shift; + + + heap->local_age = ++heap->global_age[0]; + list = heap->global_regions; + + + /* Update the context's local LRU + */ + + move_to_head( & heap->texture_objects, t ); + + + for (i = start ; i <= end ; i++) { + list[i].in_use = 1; + list[i].age = heap->local_age; + + /* remove_from_list(i) + */ + list[(unsigned)list[i].next].prev = list[i].prev; + list[(unsigned)list[i].prev].next = list[i].next; + + /* insert_at_head(list, i) + */ + list[i].prev = heap->nrRegions; + list[i].next = list[heap->nrRegions].next; + list[(unsigned)list[heap->nrRegions].next].prev = i; + list[heap->nrRegions].next = i; + } + + if ( 0 ) { + printGlobalLRU( heap, __FUNCTION__ ); + printLocalLRU( heap, __FUNCTION__ ); + } + } +} + + + + +/** + * Keep track of swapped out texture objects. + * + * \param t Texture object to be "swapped" out of its texture heap + */ + +void driSwapOutTextureObject( driTextureObject * t ) +{ + unsigned face; + + + if ( t->memBlock != NULL ) { + assert( t->heap != NULL ); + mmFreeMem( t->memBlock ); + t->memBlock = NULL; + + if (t->timestamp > t->heap->timestamp) + t->heap->timestamp = t->timestamp; + + t->heap->texture_swaps[0]++; + move_to_tail( t->heap->swapped_objects, t ); + t->heap = NULL; + } + else { + assert( t->heap == NULL ); + } + + + for ( face = 0 ; face < 6 ; face++ ) { + t->dirty_images[face] = ~0; + } +} + + + + +/** + * Destroy hardware state associated with texture \a t. Calls the + * \a destroy_texture_object method associated with the heap from which + * \a t was allocated. + * + * \param t Texture object to be destroyed + */ + +void driDestroyTextureObject( driTextureObject * t ) +{ + driTexHeap * heap; + + + if ( 0 ) { + fprintf( stderr, "[%s:%d] freeing %p (tObj = %p, DriverData = %p)\n", + __FILE__, __LINE__, + (void *)t, + (void *)((t != NULL) ? t->tObj : NULL), + (void *)((t != NULL && t->tObj != NULL) ? t->tObj->DriverData : NULL )); + } + + if ( t != NULL ) { + if ( t->memBlock ) { + heap = t->heap; + assert( heap != NULL ); + + heap->texture_swaps[0]++; + + mmFreeMem( t->memBlock ); + t->memBlock = NULL; + + if (t->timestamp > t->heap->timestamp) + t->heap->timestamp = t->timestamp; + + heap->destroy_texture_object( heap->driverContext, t ); + t->heap = NULL; + } + + if ( t->tObj != NULL ) { + assert( t->tObj->DriverData == t ); + t->tObj->DriverData = NULL; + } + + remove_from_list( t ); + FREE( t ); + } + + if ( 0 ) { + fprintf( stderr, "[%s:%d] done freeing %p\n", __FILE__, __LINE__, (void *)t ); + } +} + + + + +/** + * Update the local heap's representation of texture memory based on + * data in the SAREA. This is done each time it is detected that some other + * direct rendering client has held the lock. This pertains to both our local + * textures and the textures belonging to other clients. Keep track of other + * client's textures by pushing a placeholder texture onto the LRU list -- + * these are denoted by \a tObj being \a NULL. + * + * \param heap Heap whose state is to be updated + * \param offset Byte offset in the heap that has been stolen + * \param size Size, in bytes, of the stolen block + * \param in_use Non-zero if the block is in-use by another context + */ + +static void driTexturesGone( driTexHeap * heap, int offset, int size, + int in_use ) +{ + driTextureObject * t; + driTextureObject * tmp; + + + foreach_s ( t, tmp, & heap->texture_objects ) { + if ( (t->memBlock->ofs < (offset + size)) + && ((t->memBlock->ofs + t->memBlock->size) > offset) ) { + /* It overlaps - kick it out. If the texture object is just a + * place holder, then destroy it all together. Otherwise, mark + * it as being swapped out. + */ + + if ( t->tObj != NULL ) { + driSwapOutTextureObject( t ); + } + else { + if ( in_use && + offset == t->memBlock->ofs && size == t->memBlock->size ) { + /* Matching placeholder already exists */ + return; + } else { + driDestroyTextureObject( t ); + } + } + } + } + + + if ( in_use ) { + t = (driTextureObject *) CALLOC( heap->texture_object_size ); + if ( t == NULL ) return; + + t->memBlock = mmAllocMem( heap->memory_heap, size, 0, offset ); + if ( t->memBlock == NULL ) { + fprintf( stderr, "Couldn't alloc placeholder: heap %u sz %x ofs %x\n", heap->heapId, + (int)size, (int)offset ); + mmDumpMemInfo( heap->memory_heap ); + return; + } + t->heap = heap; + insert_at_head( & heap->texture_objects, t ); + } +} + + + + +/** + * Called by the client on lock contention to determine whether textures have + * been stolen. If another client has modified a region in which we have + * textures, then we need to figure out which of our textures have been + * removed and update our global LRU. + * + * \param heap Texture heap to be updated + */ + +void driAgeTextures( driTexHeap * heap ) +{ + drmTextureRegionPtr list = heap->global_regions; + unsigned sz = 1U << (heap->logGranularity); + unsigned i, nr = 0; + + + /* Have to go right round from the back to ensure stuff ends up + * LRU in the local list... Fix with a cursor pointer. + */ + + for (i = list[heap->nrRegions].prev ; + i != heap->nrRegions && nr < heap->nrRegions ; + i = list[i].prev, nr++) { + /* If switching texturing schemes, then the SAREA might not have been + * properly cleared, so we need to reset the global texture LRU. + */ + + if ( (i * sz) > heap->size ) { + nr = heap->nrRegions; + break; + } + + if (list[i].age > heap->local_age) + driTexturesGone( heap, i * sz, sz, list[i].in_use); + } + + /* Loop or uninitialized heap detected. Reset. + */ + + if (nr == heap->nrRegions) { + driTexturesGone( heap, 0, heap->size, 0); + resetGlobalLRU( heap ); + } + + if ( 0 ) { + printGlobalLRU( heap, __FUNCTION__ ); + printLocalLRU( heap, __FUNCTION__ ); + } + + heap->local_age = heap->global_age[0]; +} + + + + +/** + * Allocate memory from a texture heap to hold a texture object. This + * routine will attempt to allocate memory for the texture from the heaps + * specified by \c heap_array in order. That is, first it will try to + * allocate from \c heap_array[0], then \c heap_array[1], and so on. + * + * \param heap_array Array of pointers to texture heaps to use + * \param nr_heaps Number of heap pointer in \a heap_array + * \param t Texture object for which space is needed + * \return The ID of the heap from which memory was allocated, or -1 if + * memory could not be allocated. + * + * \bug The replacement policy implemented by this function is horrible. + */ + + +int +driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, + driTextureObject * t ) +{ + driTexHeap * heap; + driTextureObject * temp; + driTextureObject * cursor; + unsigned id; + + + /* In case it already has texture space, initialize heap. This also + * prevents GCC from issuing a warning that heap might be used + * uninitialized. + */ + + heap = t->heap; + + + /* Run through each of the existing heaps and try to allocate a buffer + * to hold the texture. + */ + + for ( id = 0 ; (t->memBlock == NULL) && (id < nr_heaps) ; id++ ) { + heap = heap_array[ id ]; + if ( heap != NULL ) { + t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, + heap->alignmentShift, 0 ); + } + } + + + /* Kick textures out until the requested texture fits. + */ + + if ( t->memBlock == NULL ) { + for ( id = 0 ; (t->memBlock == NULL) && (id < nr_heaps) ; id++ ) { + heap = heap_array[ id ]; + if ( t->totalSize <= heap->size ) { + + for ( cursor = heap->texture_objects.prev, temp = cursor->prev; + cursor != &heap->texture_objects ; + cursor = temp, temp = cursor->prev ) { + + /* The the LRU element. If the texture is bound to one of + * the texture units, then we cannot kick it out. + */ + if ( cursor->bound /* || cursor->reserved */ ) { + continue; + } + + /* If this is a placeholder, there's no need to keep it */ + if (cursor->tObj) + driSwapOutTextureObject( cursor ); + else + driDestroyTextureObject( cursor ); + + t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, + heap->alignmentShift, 0 ); + + if (t->memBlock) + break; + } + } /* if ( t->totalSize <= heap->size ) ... */ + } + } + + + if ( t->memBlock != NULL ) { + /* id and heap->heapId may or may not be the same value here. + */ + + assert( heap != NULL ); + assert( (t->heap == NULL) || (t->heap == heap) ); + + t->heap = heap; + return heap->heapId; + } + else { + assert( t->heap == NULL ); + + fprintf( stderr, "[%s:%d] unable to allocate texture\n", + __FUNCTION__, __LINE__ ); + return -1; + } +} + + + + + + +/** + * Set the location where the texture-swap counter is stored. + */ + +void +driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter ) +{ + heap->texture_swaps = (counter == NULL) ? & dummy_swap_counter : counter; +} + + + + +/** + * Create a new heap for texture data. + * + * \param heap_id Device-dependent heap identifier. This value + * will returned by driAllocateTexture when memory + * is allocated from this heap. + * \param context Device-dependent driver context. This is + * supplied as the first parameter to the + * \c destroy_tex_obj function. + * \param size Size, in bytes, of the texture region + * \param alignmentShift Alignment requirement for textures. If textures + * must be allocated on a 4096 byte boundry, this + * would be 12. + * \param nr_regions Number of regions into which this texture space + * should be partitioned + * \param global_regions Array of \c drmTextureRegion structures in the SAREA + * \param global_age Pointer to the global texture age in the SAREA + * \param swapped_objects Pointer to the list of texture objects that are + * not in texture memory (i.e., have been swapped + * out). + * \param texture_object_size Size, in bytes, of a device-dependent texture + * object + * \param destroy_tex_obj Function used to destroy a device-dependent + * texture object + * + * \sa driDestroyTextureHeap + */ + +driTexHeap * +driCreateTextureHeap( unsigned heap_id, void * context, unsigned size, + unsigned alignmentShift, unsigned nr_regions, + drmTextureRegionPtr global_regions, unsigned * global_age, + driTextureObject * swapped_objects, + unsigned texture_object_size, + destroy_texture_object_t * destroy_tex_obj + ) +{ + driTexHeap * heap; + unsigned l; + + + if ( 0 ) + fprintf( stderr, "%s( %u, %p, %u, %u, %u )\n", + __FUNCTION__, + heap_id, (void *)context, size, alignmentShift, nr_regions ); + + heap = (driTexHeap *) CALLOC( sizeof( driTexHeap ) ); + if ( heap != NULL ) { + l = driLog2( (size - 1) / nr_regions ); + if ( l < alignmentShift ) + { + l = alignmentShift; + } + + heap->logGranularity = l; + heap->size = size & ~((1L << l) - 1); + + heap->memory_heap = mmInit( 0, heap->size ); + if ( heap->memory_heap != NULL ) { + heap->heapId = heap_id; + heap->driverContext = context; + + heap->alignmentShift = alignmentShift; + heap->nrRegions = nr_regions; + heap->global_regions = global_regions; + heap->global_age = global_age; + heap->swapped_objects = swapped_objects; + heap->texture_object_size = texture_object_size; + heap->destroy_texture_object = destroy_tex_obj; + + /* Force global heap init */ + if (heap->global_age == 0) + heap->local_age = ~0; + else + heap->local_age = 0; + + make_empty_list( & heap->texture_objects ); + driSetTextureSwapCounterLocation( heap, NULL ); + } + else { + FREE( heap ); + heap = NULL; + } + } + + + if ( 0 ) + fprintf( stderr, "%s returning %p\n", __FUNCTION__, (void *)heap ); + + return heap; +} + + + + +/** Destroys a texture heap + * + * \param heap Texture heap to be destroyed + */ + +void +driDestroyTextureHeap( driTexHeap * heap ) +{ + driTextureObject * t; + driTextureObject * temp; + + + if ( heap != NULL ) { + foreach_s( t, temp, & heap->texture_objects ) { + driDestroyTextureObject( t ); + } + foreach_s( t, temp, heap->swapped_objects ) { + driDestroyTextureObject( t ); + } + + mmDestroy( heap->memory_heap ); + FREE( heap ); + } +} + + + + +/****************************************************************************/ +/** + * Determine how many texels (including all mipmap levels) would be required + * for a texture map of size \f$2^^\c base_size_log2\f$ would require. + * + * \param base_size_log2 \f$log_2\f$ of the size of a side of the texture + * \param dimensions Number of dimensions of the texture. Either 2 or 3. + * \param faces Number of faces of the texture. Either 1 or 6 (for cube maps). + * \return Number of texels + */ + +static unsigned +texels_this_map_size( int base_size_log2, unsigned dimensions, unsigned faces ) +{ + unsigned texels; + + + assert( (faces == 1) || (faces == 6) ); + assert( (dimensions == 2) || (dimensions == 3) ); + + texels = 0; + if ( base_size_log2 >= 0 ) { + texels = (1U << (dimensions * base_size_log2)); + + /* See http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg03636.html + * for the complete explaination of why this formulation is used. + * Basically, the smaller mipmap levels sum to 0.333 the size of the + * level 0 map. The total size is therefore the size of the map + * multipled by 1.333. The +2 is there to round up. + */ + + texels = (texels * 4 * faces + 2) / 3; + } + + return texels; +} + + + + +struct maps_per_heap { + unsigned c[32]; +}; + +static void +fill_in_maximums( driTexHeap * const * heaps, unsigned nr_heaps, + unsigned max_bytes_per_texel, unsigned max_size, + unsigned mipmaps_at_once, unsigned dimensions, + unsigned faces, struct maps_per_heap * max_textures ) +{ + unsigned heap; + unsigned log2_size; + unsigned mask; + + + /* Determine how many textures of each size can be stored in each + * texture heap. + */ + + for ( heap = 0 ; heap < nr_heaps ; heap++ ) { + if ( heaps[ heap ] == NULL ) { + (void) memset( max_textures[ heap ].c, 0, + sizeof( max_textures[ heap ].c ) ); + continue; + } + + mask = (1U << heaps[ heap ]->logGranularity) - 1; + + if ( 0 ) { + fprintf( stderr, "[%s:%d] heap[%u] = %u bytes, mask = 0x%08x\n", + __FILE__, __LINE__, + heap, heaps[ heap ]->size, mask ); + } + + for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) { + unsigned total; + + + /* Determine the total number of bytes required by a texture of + * size log2_size. + */ + + total = texels_this_map_size( log2_size, dimensions, faces ) + - texels_this_map_size( log2_size - mipmaps_at_once, + dimensions, faces ); + total *= max_bytes_per_texel; + total = (total + mask) & ~mask; + + /* The number of textures of a given size that will fit in a heap + * is equal to the size of the heap divided by the size of the + * texture. + */ + + max_textures[ heap ].c[ log2_size ] = heaps[ heap ]->size / total; + + if ( 0 ) { + fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] " + "= 0x%08x / 0x%08x " + "= %u (%u)\n", + __FILE__, __LINE__, + heap, log2_size, + heaps[ heap ]->size, total, + heaps[ heap ]->size / total, + max_textures[ heap ].c[ log2_size ] ); + } + } + } +} + + +static unsigned +get_max_size( unsigned nr_heaps, + unsigned texture_units, + unsigned max_size, + int all_textures_one_heap, + struct maps_per_heap * max_textures ) +{ + unsigned heap; + unsigned log2_size; + + + /* Determine the largest texture size such that a texture of that size + * can be bound to each texture unit at the same time. Some hardware + * may require that all textures be in the same texture heap for + * multitexturing. + */ + + for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) { + unsigned total = 0; + + for ( heap = 0 ; heap < nr_heaps ; heap++ ) + { + total += max_textures[ heap ].c[ log2_size ]; + + if ( 0 ) { + fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] = %u, " + "total = %u\n", __FILE__, __LINE__, heap, log2_size, + max_textures[ heap ].c[ log2_size ], total ); + } + + if ( (max_textures[ heap ].c[ log2_size ] >= texture_units) + || (!all_textures_one_heap && (total >= texture_units)) ) { + /* The number of mipmap levels is the log-base-2 of the + * maximum texture size plus 1. If the maximum texture size + * is 1x1, the log-base-2 is 0 and 1 mipmap level (the base + * level) is available. + */ + + return log2_size + 1; + } + } + } + + /* This should NEVER happen. It should always be possible to have at + * *least* a 1x1 texture in memory! + */ + assert( log2_size != 0 ); + return 0; +} + +#define SET_MAX(f,v) \ + do { if ( max_sizes[v] != 0 ) { limits-> f = max_sizes[v]; } } while( 0 ) + +#define SET_MAX_RECT(f,v) \ + do { if ( max_sizes[v] != 0 ) { limits-> f = 1 << max_sizes[v]; } } while( 0 ) + + +/** + * Given the amount of texture memory, the number of texture units, and the + * maximum size of a texel, calculate the maximum texture size the driver can + * advertise. + * + * \param heaps Texture heaps for this card + * \param nr_heap Number of texture heaps + * \param limits OpenGL contants. MaxTextureUnits must be set. + * \param max_bytes_per_texel Maximum size of a single texel, in bytes + * \param max_2D_size \f$\log_2\f$ of the maximum 2D texture size (i.e., + * 1024x1024 textures, this would be 10) + * \param max_3D_size \f$\log_2\f$ of the maximum 3D texture size (i.e., + * 1024x1024x1024 textures, this would be 10) + * \param max_cube_size \f$\log_2\f$ of the maximum cube texture size (i.e., + * 1024x1024 textures, this would be 10) + * \param max_rect_size \f$\log_2\f$ of the maximum texture rectangle size + * (i.e., 1024x1024 textures, this would be 10). This is a power-of-2 + * even though texture rectangles need not be a power-of-2. + * \param mipmaps_at_once Total number of mipmaps that can be used + * at one time. For most hardware this will be \f$\c max_size + 1\f$. + * For hardware that does not support mipmapping, this will be 1. + * \param all_textures_one_heap True if the hardware requires that all + * textures be in a single texture heap for multitexturing. + */ + +void +driCalculateMaxTextureLevels( driTexHeap * const * heaps, + unsigned nr_heaps, + struct gl_constants * limits, + unsigned max_bytes_per_texel, + unsigned max_2D_size, + unsigned max_3D_size, + unsigned max_cube_size, + unsigned max_rect_size, + unsigned mipmaps_at_once, + int all_textures_one_heap ) +{ + struct maps_per_heap max_textures[8]; + unsigned i; + const unsigned dimensions[4] = { 2, 3, 2, 2 }; + const unsigned faces[4] = { 1, 1, 6, 1 }; + unsigned max_sizes[4]; + unsigned mipmaps[4]; + + + max_sizes[0] = max_2D_size; + max_sizes[1] = max_3D_size; + max_sizes[2] = max_cube_size; + max_sizes[3] = max_rect_size; + + mipmaps[0] = mipmaps_at_once; + mipmaps[1] = mipmaps_at_once; + mipmaps[2] = 1; + mipmaps[3] = mipmaps_at_once; + + + /* Calculate the maximum number of texture levels in two passes. The + * first pass determines how many textures of each power-of-two size + * (including all mipmap levels for that size) can fit in each texture + * heap. The second pass finds the largest texture size that allows + * a texture of that size to be bound to every texture unit. + */ + + for ( i = 0 ; i < 4 ; i++ ) { + if ( max_sizes[ i ] != 0 ) { + fill_in_maximums( heaps, nr_heaps, max_bytes_per_texel, + max_sizes[ i ], mipmaps[ i ], + dimensions[ i ], faces[ i ], + max_textures ); + + max_sizes[ i ] = get_max_size( nr_heaps, + limits->MaxTextureUnits, + max_sizes[ i ], + all_textures_one_heap, + max_textures ); + } + } + + SET_MAX( MaxTextureLevels, 0 ); + SET_MAX( Max3DTextureLevels, 1 ); + SET_MAX( MaxCubeTextureLevels, 2 ); + SET_MAX_RECT( MaxTextureRectSize, 3 ); +} + + + + +/** + * Perform initial binding of default textures objects on a per unit, per + * texture target basis. + * + * \param ctx Current OpenGL context + * \param swapped List of swapped-out textures + * \param targets Bit-mask of value texture targets + */ + +void driInitTextureObjects( GLcontext *ctx, driTextureObject * swapped, + GLuint targets ) +{ + struct gl_texture_object *texObj; + GLuint tmp = ctx->Texture.CurrentUnit; + unsigned i; + + + for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) { + ctx->Texture.CurrentUnit = i; + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_1D) != 0 ) { + texObj = ctx->Texture.Unit[i].Current1D; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_1D, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_2D) != 0 ) { + texObj = ctx->Texture.Unit[i].Current2D; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_2D, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_3D) != 0 ) { + texObj = ctx->Texture.Unit[i].Current3D; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_3D, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_CUBE) != 0 ) { + texObj = ctx->Texture.Unit[i].CurrentCubeMap; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_CUBE_MAP_ARB, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + + if ( (targets & DRI_TEXMGR_DO_TEXTURE_RECT) != 0 ) { + texObj = ctx->Texture.Unit[i].CurrentRect; + ctx->Driver.BindTexture( ctx, GL_TEXTURE_RECTANGLE_NV, texObj ); + move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); + } + } + + ctx->Texture.CurrentUnit = tmp; +} + + + + +/** + * Verify that the specified texture is in the specificed heap. + * + * \param tex Texture to be tested. + * \param heap Texture memory heap to be tested. + * \return True if the texture is in the heap, false otherwise. + */ + +static GLboolean +check_in_heap( const driTextureObject * tex, const driTexHeap * heap ) +{ +#if 1 + return tex->heap == heap; +#else + driTextureObject * curr; + + foreach( curr, & heap->texture_objects ) { + if ( curr == tex ) { + break; + } + } + + return curr == tex; +#endif +} + + + +/****************************************************************************/ +/** + * Validate the consistency of a set of texture heaps. + * Original version by Keith Whitwell in r200/r200_sanity.c. + */ + +GLboolean +driValidateTextureHeaps( driTexHeap * const * texture_heaps, + unsigned nr_heaps, const driTextureObject * swapped ) +{ + driTextureObject *t; + unsigned i; + + for ( i = 0 ; i < nr_heaps ; i++ ) { + int last_end = 0; + unsigned textures_in_heap = 0; + unsigned blocks_in_mempool = 0; + const driTexHeap * heap = texture_heaps[i]; + const memHeap_t * p = heap->memory_heap; + + /* Check each texture object has a MemBlock, and is linked into + * the correct heap. + * + * Check the texobj base address corresponds to the MemBlock + * range. Check the texobj size (recalculate?) fits within + * the MemBlock. + * + * Count the number of texobj's using this heap. + */ + + foreach ( t, &heap->texture_objects ) { + if ( !check_in_heap( t, heap ) ) { + fprintf( stderr, "%s memory block for texture object @ %p not " + "found in heap #%d\n", + __FUNCTION__, (void *)t, i ); + return GL_FALSE; + } + + + if ( t->totalSize > t->memBlock->size ) { + fprintf( stderr, "%s: Memory block for texture object @ %p is " + "only %u bytes, but %u are required\n", + __FUNCTION__, (void *)t, t->totalSize, t->memBlock->size ); + return GL_FALSE; + } + + textures_in_heap++; + } + + /* Validate the contents of the heap: + * - Ordering + * - Overlaps + * - Bounds + */ + + while ( p != NULL ) { + if (p->reserved) { + fprintf( stderr, "%s: Block (%08x,%x), is reserved?!\n", + __FUNCTION__, p->ofs, p->size ); + return GL_FALSE; + } + + if (p->ofs != last_end) { + fprintf( stderr, "%s: blocks_in_mempool = %d, last_end = %d, p->ofs = %d\n", + __FUNCTION__, blocks_in_mempool, last_end, p->ofs ); + return GL_FALSE; + } + + if (!p->reserved && !p->free) { + blocks_in_mempool++; + } + + last_end = p->ofs + p->size; + p = p->next; + } + + if (textures_in_heap != blocks_in_mempool) { + fprintf( stderr, "%s: Different number of textures objects (%u) and " + "inuse memory blocks (%u)\n", + __FUNCTION__, textures_in_heap, blocks_in_mempool ); + return GL_FALSE; + } + +#if 0 + fprintf( stderr, "%s: textures_in_heap = %u\n", + __FUNCTION__, textures_in_heap ); +#endif + } + + + /* Check swapped texobj's have zero memblocks + */ + i = 0; + foreach ( t, swapped ) { + if ( t->memBlock != NULL ) { + fprintf( stderr, "%s: Swapped texobj %p has non-NULL memblock %p\n", + __FUNCTION__, (void *)t, (void *)t->memBlock ); + return GL_FALSE; + } + i++; + } + +#if 0 + fprintf( stderr, "%s: swapped texture count = %u\n", i ); +#endif + + return GL_TRUE; +} + +/****************************************************************************/ +/** + * Compute which mipmap levels that really need to be sent to the hardware. + * This depends on the base image size, GL_TEXTURE_MIN_LOD, + * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. + */ + +void +driCalculateTextureFirstLastLevel( driTextureObject * t ) +{ + struct gl_texture_object * const tObj = t->tObj; + const struct gl_texture_image * const baseImage = + tObj->Image[tObj->BaseLevel]; + + /* These must be signed values. MinLod and MaxLod can be negative numbers, + * and having firstLevel and lastLevel as signed prevents the need for + * extra sign checks. + */ + int firstLevel; + int lastLevel; + + /* Yes, this looks overly complicated, but it's all needed. + */ + + switch (tObj->Target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + case GL_TEXTURE_CUBE_MAP: + if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. + */ + + firstLevel = lastLevel = tObj->BaseLevel; + } + else { + firstLevel = tObj->BaseLevel + (GLint)(tObj->MinLod + 0.5); + firstLevel = MAX2(firstLevel, tObj->BaseLevel); + lastLevel = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5); + lastLevel = MAX2(lastLevel, t->tObj->BaseLevel); + lastLevel = MIN2(lastLevel, t->tObj->BaseLevel + baseImage->MaxLog2); + lastLevel = MIN2(lastLevel, t->tObj->MaxLevel); + lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ + } + break; + case GL_TEXTURE_RECTANGLE_NV: + case GL_TEXTURE_4D_SGIS: + firstLevel = lastLevel = 0; + break; + default: + return; + } + + /* save these values */ + t->firstLevel = firstLevel; + t->lastLevel = lastLevel; +} Index: xc/lib/GL/mesa/src/drv/common/texmem.h diff -u /dev/null xc/lib/GL/mesa/src/drv/common/texmem.h:1.2 --- /dev/null Sat Feb 28 21:41:12 2004 +++ xc/lib/GL/mesa/src/drv/common/texmem.h Tue Dec 2 08:02:37 2003 @@ -0,0 +1,295 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + * + * Authors: + * Ian Romanick + * Keith Whitwell + * Kevin E. Martin + * Gareth Hughes + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/common/texmem.h,v 1.2 2003/12/02 13:02:37 alanh Exp $ */ + +/** \file texmem.h + * Public interface to the DRI texture memory management routines. + * + * \sa texmem.c + */ + +#ifndef DRI_TEXMEM_H +#define DRI_TEXMEM_H + +#include "mtypes.h" +#include "mm.h" +#include "xf86drm.h" + +struct dri_tex_heap; +typedef struct dri_tex_heap driTexHeap; + +struct dri_texture_object; +typedef struct dri_texture_object driTextureObject; + + +/** + * Base texture object type. Each driver will extend this type with its own + * private data members. + */ + +struct dri_texture_object { + struct dri_texture_object * next; + struct dri_texture_object * prev; + + driTexHeap * heap; /**< Texture heap currently stored in */ + struct gl_texture_object * tObj;/**< Pointer to Mesa texture object + * If NULL, this texture object is a + * "placeholder" object representing + * texture memory in use by another context. + * A placeholder should have a heap and a memBlock. + */ + PMemBlock memBlock; /**< Memory block containing texture */ + unsigned bound; /**< Texture unit currently bound to */ + + unsigned totalSize; /**< Total size of the texture, + * including all mipmap levels + */ + + unsigned dirty_images[6]; /**< Flags for whether or not images + * need to be uploaded to local or + * AGP texture space. One flag set + * for each cube face for cubic + * textures. Bit zero corresponds to + * the base-level, which may or may + * not be the level zero mipmap. + */ + + unsigned timestamp; /**< Timestamp used to + * synchronize with 3d engine + * in hardware where textures + * are uploaded directly to + * the framebuffer. + */ + + unsigned firstLevel; /**< Image in \c tObj->Image that + * corresponds to the base-level of + * this texture object. + */ + + unsigned lastLevel; /**< Last image in \c tObj->Image used + * by the current LOD settings of this + * texture object. This value must be + * greater than or equal to + * \c firstLevel. + */ +}; + + +typedef void (destroy_texture_object_t)( void * driverContext, + driTextureObject * t ); + +/** + * Client-private representation of texture memory state. + * + * Clients will place one or more of these structs in their driver + * context struct to manage one or more global texture heaps. + */ + +struct dri_tex_heap { + + /** Client-supplied heap identifier + */ + unsigned heapId; + + /** Pointer to the client's private context + */ + void *driverContext; + + /** Total size of the heap, in bytes + */ + unsigned size; + + /** \brief \f$log_2\f$ of size of single heap region + * + * Each context takes memory from the global texture heap in + * \f$2^{logGranularity}\f$ byte blocks. The value of + * \a logGranularity is based on the amount of memory represented + * by the heap and the maximum number of regions in the SAREA. Given + * \a b bytes of texture memory an \a n regions in the SAREA, + * \a logGranularity will be \f$\lfloor\log_2( b / n )\rfloor\f$. + */ + unsigned logGranularity; + + /** \brief Required alignment of allocations in this heap + * + * The alignment shift is supplied to \a mmAllocMem when memory is + * allocated from this heap. The value of \a alignmentShift will + * typically reflect some require of the hardware. This value has + * \b no \b relation to \a logGranularity. \a alignmentShift is a + * per-context value. + * + * \sa mmAllocMem + */ + unsigned alignmentShift; + + /** Number of elements in global list (the SAREA). + */ + unsigned nrRegions; + + /** Pointer to SAREA \a driTexRegion array + */ + drmTextureRegionPtr global_regions; + + /** Pointer to the texture state age (generation number) in the SAREA + */ + unsigned * global_age; + + /** Local age (generation number) of texture state + */ + unsigned local_age; + + /** Memory heap used to manage texture memory represented by + * this texture heap. + */ + memHeap_t * memory_heap; + + /** List of objects that we currently believe to be in texture + * memory. + */ + driTextureObject texture_objects; + + /** Pointer to the list of texture objects that are not in + * texture memory. + */ + driTextureObject * swapped_objects; + + /** Size of the driver-speicific texture object. + */ + unsigned texture_object_size; + + + /** + * \brief Function to destroy driver-specific texture object data. + * + * This function is supplied by the driver so that the texture manager + * can release all resources associated with a texture object. This + * function should only release driver-specific data. That is, + * \a driDestroyTextureObject will release the texture memory + * associated with the texture object, it will release the memory + * for the texture object itself, and it will unlink the texture + * object from the texture object lists. + * + * \param driverContext Pointer to the driver supplied context + * \param t Texture object that is to be destroyed + * \sa driDestroyTextureObject + */ + + destroy_texture_object_t * destroy_texture_object; + + + /** + */ + unsigned * texture_swaps; + + /** + * Timestamp used to synchronize with 3d engine in hardware + * where textures are uploaded directly to the + * framebuffer. + */ + unsigned timestamp; +}; + + + + +/** + * Called by the client on lock contention to determine whether textures have + * been stolen. If another client has modified a region in which we have + * textures, then we need to figure out which of our textures have been + * removed and update our global LRU. + * + * \param heap Texture heap to be updated + * \hideinitializer + */ + +#define DRI_AGE_TEXTURES( heap ) \ + do { \ + if ( ((heap) != NULL) \ + && ((heap)->local_age != (heap)->global_age[0]) ) \ + driAgeTextures( heap ); \ + } while( 0 ) + + + + +/* This should be called whenever there has been contention on the hardware + * lock. driAgeTextures should not be called directly. Instead, clients + * should use DRI_AGE_TEXTURES, above. + */ + +void driAgeTextures( driTexHeap * heap ); + +void driUpdateTextureLRU( driTextureObject * t ); +void driSwapOutTextureObject( driTextureObject * t ); +void driDestroyTextureObject( driTextureObject * t ); +int driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, + driTextureObject * t ); + +GLboolean driIsTextureResident( GLcontext * ctx, + struct gl_texture_object * texObj ); + +driTexHeap * driCreateTextureHeap( unsigned heap_id, void * context, + unsigned size, unsigned alignmentShift, unsigned nr_regions, + drmTextureRegionPtr global_regions, unsigned * global_age, + driTextureObject * swapped_objects, unsigned texture_object_size, + destroy_texture_object_t * destroy_tex_obj ); +void driDestroyTextureHeap( driTexHeap * heap ); + +void +driCalculateMaxTextureLevels( driTexHeap * const * heaps, + unsigned nr_heaps, + struct gl_constants * limits, + unsigned max_bytes_per_texel, + unsigned max_2D_size, + unsigned max_3D_size, + unsigned max_cube_size, + unsigned max_rect_size, + unsigned mipmaps_at_once, + int all_textures_one_heap ); + +void +driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter ); + +#define DRI_TEXMGR_DO_TEXTURE_1D 0x0001 +#define DRI_TEXMGR_DO_TEXTURE_2D 0x0002 +#define DRI_TEXMGR_DO_TEXTURE_3D 0x0004 +#define DRI_TEXMGR_DO_TEXTURE_CUBE 0x0008 +#define DRI_TEXMGR_DO_TEXTURE_RECT 0x0010 + +void driInitTextureObjects( GLcontext *ctx, driTextureObject * swapped, + GLuint targets ); + +GLboolean driValidateTextureHeaps( driTexHeap * const * texture_heaps, + unsigned nr_heaps, const driTextureObject * swapped ); + +extern void driCalculateTextureFirstLastLevel( driTextureObject * t ); + +#endif /* DRI_TEXMEM_H */ Index: xc/lib/GL/mesa/src/drv/common/utils.c diff -u /dev/null xc/lib/GL/mesa/src/drv/common/utils.c:1.2 --- /dev/null Sat Feb 28 21:41:12 2004 +++ xc/lib/GL/mesa/src/drv/common/utils.c Tue Dec 2 08:02:37 2003 @@ -0,0 +1,183 @@ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + * + * Authors: + * Ian Romanick + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/common/utils.c,v 1.2 2003/12/02 13:02:37 alanh Exp $ */ + +#include +#include +#include "mtypes.h" +#include "extensions.h" +#include "utils.h" + +#if defined(USE_X86_ASM) +#include "X86/common_x86_asm.h" +#endif + +unsigned +driParseDebugString( const char * debug, + const struct dri_debug_control * control ) +{ + unsigned flag; + + + flag = 0; + if ( debug != NULL ) { + while( control->string != NULL ) { + if ( !strcmp( debug, "all" ) || + strstr( debug, control->string ) != NULL ) { + flag |= control->flag; + } + + control++; + } + } + + return flag; +} + + + + +unsigned +driGetRendererString( char * buffer, const char * hardware_name, + const char * driver_date, GLuint agp_mode ) +{ +#ifdef USE_X86_ASM + char * x86_str = ""; + char * mmx_str = ""; + char * tdnow_str = ""; + char * sse_str = ""; +#endif + unsigned offset; + + + offset = sprintf( buffer, "Mesa DRI %s %s", hardware_name, driver_date ); + + /* Append any AGP-specific information. + */ + switch ( agp_mode ) { + case 1: + case 2: + case 4: + case 8: + offset += sprintf( & buffer[ offset ], " AGP %ux", agp_mode ); + break; + + default: + break; + } + + /* Append any CPU-specific information. + */ +#ifdef USE_X86_ASM + if ( _mesa_x86_cpu_features ) { + x86_str = " x86"; + } +# ifdef USE_MMX_ASM + if ( cpu_has_mmx ) { + mmx_str = (cpu_has_mmxext) ? "/MMX+" : "/MMX"; + } +# endif +# ifdef USE_3DNOW_ASM + if ( cpu_has_3dnow ) { + tdnow_str = (cpu_has_3dnowext) ? "/3DNow!+" : "/3DNow!"; + } +# endif +# ifdef USE_SSE_ASM + if ( cpu_has_xmm ) { + sse_str = (cpu_has_xmm2) ? "/SSE2" : "/SSE"; + } +# endif + + offset += sprintf( & buffer[ offset ], "%s%s%s%s", + x86_str, mmx_str, tdnow_str, sse_str ); + +#elif defined(USE_SPARC_ASM) + + offset += sprintf( & buffer[ offset ], " Sparc" ); + +#endif + + return offset; +} + + + + +void driInitExtensions( GLcontext * ctx, + const char * const extensions_to_enable[], + GLboolean enable_imaging ) +{ + unsigned i; + + if ( enable_imaging ) { + _mesa_enable_imaging_extensions( ctx ); + } + + for ( i = 0 ; extensions_to_enable[i] != NULL ; i++ ) { + _mesa_enable_extension( ctx, extensions_to_enable[i] ); + } +} + + + + +GLboolean +driCheckDriDdxDrmVersions(__DRIscreenPrivate *sPriv, + const char * driver_name, + int dri_major, int dri_minor, + int ddx_major, int ddx_minor, + int drm_major, int drm_minor) +{ + static const char format[] = "%s DRI driver expected %s version %d.%d.x " + "but got version %d.%d.%d"; + int major, minor, patch; + + /* Check the DRI version */ + if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) { + if (major != dri_major || minor < dri_minor) { + __driUtilMessage(format, "DRI", driver_name, dri_major, dri_minor, + major, minor, patch); + return GL_FALSE; + } + } + + /* Check that the DDX driver version is compatible */ + if (sPriv->ddxMajor != ddx_major || sPriv->ddxMinor < ddx_minor) { + __driUtilMessage(format, "DDX", driver_name, ddx_major, ddx_minor, + sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch); + return GL_FALSE; + } + + /* Check that the DRM driver version is compatible */ + if (sPriv->drmMajor != drm_major || sPriv->drmMinor < drm_minor) { + __driUtilMessage(format, "DRM", driver_name, drm_major, drm_minor, + sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch); + return GL_FALSE; + } + + return GL_TRUE; +} Index: xc/lib/GL/mesa/src/drv/common/utils.h diff -u /dev/null xc/lib/GL/mesa/src/drv/common/utils.h:1.1 --- /dev/null Sat Feb 28 21:41:12 2004 +++ xc/lib/GL/mesa/src/drv/common/utils.h Sun Sep 28 16:15:07 2003 @@ -0,0 +1,54 @@ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + * + * Authors: + * Ian Romanick + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/common/utils.h,v 1.1 2003/09/28 20:15:07 alanh Exp $ */ + +#ifndef DRI_DEBUG_H +#define DRI_DEBUG_H + +#include "context.h" +#include "dri_util.h" + +struct dri_debug_control +{ + const char * string; + unsigned flag; +}; + +extern unsigned driParseDebugString( const char * debug, + const struct dri_debug_control * control ); + +extern unsigned driGetRendererString( char * buffer, + const char * hardware_name, const char * driver_date, GLuint agp_mode ); + +extern void driInitExtensions( GLcontext * ctx, + const char * const card_extensions[], GLboolean enable_imaging ); + +extern GLboolean driCheckDriDdxDrmVersions( __DRIscreenPrivate *sPriv, + const char * driver_name, int dri_major, int dri_minor, + int ddx_major, int ddx_minor, int drm_major, int drm_minor ); + +#endif /* DRI_DEBUG_H */ Index: xc/lib/GL/mesa/src/drv/common/vblank.c diff -u /dev/null xc/lib/GL/mesa/src/drv/common/vblank.c:1.1 --- /dev/null Sat Feb 28 21:41:12 2004 +++ xc/lib/GL/mesa/src/drv/common/vblank.c Sun Sep 28 16:15:07 2003 @@ -0,0 +1,313 @@ +/* -*- mode: c; c-basic-offset: 3 -*- */ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + * + * Authors: + * Ian Romanick + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/common/vblank.c,v 1.1 2003/09/28 20:15:07 alanh Exp $ */ + +#include "glheader.h" +#include "xf86drm.h" +#include "mtypes.h" +#include "macros.h" +#include "dd.h" +#include "vblank.h" + + +/****************************************************************************/ +/** + * Get the current MSC refresh counter. + * + * Stores the 64-bit count of vertical refreshes since some (arbitrary) + * point in time in \c count. Unless the value wraps around, which it + * may, it will never decrease. + * + * \warning This function is called from \c glXGetVideoSyncSGI, which expects + * a \c count of type \c unsigned (32-bit), and \c glXGetSyncValuesOML, which + * expects a \c count of type \c int64_t (signed 64-bit). The kernel ioctl + * currently always returns a \c sequence of type \c unsigned. + * + * \param priv Pointer to the DRI screen private struct. + * \param count Storage to hold MSC counter. + * \return Zero is returned on success. A negative errno value + * is returned on failure. + */ +int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count ) +{ + drmVBlank vbl; + int ret; + + /* Don't wait for anything. Just get the current refresh count. */ + + vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.sequence = 0; + + ret = drmWaitVBlank( priv->fd, &vbl ); + *count = (int64_t)vbl.reply.sequence; + + return ret; +} + + +/****************************************************************************/ +/** + * Wait for a specified refresh count. This implements most of the + * functionality of \c glXWaitForMscOML from the GLX_OML_sync_control spec. + * Waits for the \c target_msc refresh. If that has already passed, it + * waits until \f$(MSC \bmod divisor)\f$ is equal to \c remainder. If + * \c target_msc is 0, use the behavior of glXWaitVideoSyncSGI(), which + * omits the initial check against a target MSC value. + * + * This function is actually something of a hack. The problem is that, at + * the time of this writing, none of the existing DRM modules support an + * ioctl that returns a 64-bit count (at least not on 32-bit platforms). + * However, this function exists to support a GLX function that requires + * the use of 64-bit counts. As such, there is a little bit of ugly + * hackery at the end of this function to make the 32-bit count act like + * a 64-bit count. There are still some cases where this will break, but + * I believe it catches the most common cases. + * + * The real solution is to provide an ioctl that uses a 64-bit count. + * + * \param dpy Pointer to the \c Display. + * \param priv Pointer to the DRI drawable private. + * \param target_msc Desired refresh count to wait for. A value of 0 + * means to use the glXWaitVideoSyncSGI() behavior. + * \param divisor MSC divisor if \c target_msc is already reached. + * \param remainder Desired MSC remainder if \c target_msc is already + * reached. + * \param msc Buffer to hold MSC when done waiting. + * + * \return Zero on success or \c GLX_BAD_CONTEXT on failure. + */ + +int driWaitForMSC32( __DRIdrawablePrivate *priv, + int64_t target_msc, int64_t divisor, int64_t remainder, + int64_t * msc ) +{ + drmVBlank vbl; + + + if ( divisor != 0 ) { + unsigned int target = (unsigned int)target_msc; + unsigned int next = target; + unsigned int r; + int dont_wait = (target_msc == 0); + + do { + /* dont_wait means we're using the glXWaitVideoSyncSGI() behavior. + * The first time around, just get the current count and proceed + * to the test for (MSC % divisor) == remainder. + */ + vbl.request.type = dont_wait ? DRM_VBLANK_RELATIVE : + DRM_VBLANK_ABSOLUTE; + vbl.request.sequence = next; + + if ( drmWaitVBlank( priv->driScreenPriv->fd, &vbl ) != 0 ) { + /* FIXME: This doesn't seem like the right thing to return here. + */ + return GLX_BAD_CONTEXT; + } + + dont_wait = 0; + if (target_msc != 0 && vbl.reply.sequence == target) + break; + + /* Assuming the wait-done test fails, the next refresh to wait for + * will be one that satisfies (MSC % divisor) == remainder. The + * value (MSC - (MSC % divisor) + remainder) is the refresh value + * closest to the current value that would satisfy the equation. + * If this refresh has already happened, we add divisor to obtain + * the next refresh after the current one that will satisfy it. + */ + r = (vbl.reply.sequence % (unsigned int)divisor); + next = (vbl.reply.sequence - r + (unsigned int)remainder); + if (next <= vbl.reply.sequence) next += (unsigned int)divisor; + + } while ( r != (unsigned int)remainder ); + } + else { + /* If the \c divisor is zero, just wait until the MSC is greater + * than or equal to \c target_msc. + */ + + vbl.request.type = DRM_VBLANK_ABSOLUTE; + vbl.request.sequence = target_msc; + + if ( drmWaitVBlank( priv->driScreenPriv->fd, &vbl ) != 0 ) { + /* FIXME: This doesn't seem like the right thing to return here. + */ + return GLX_BAD_CONTEXT; + } + } + + *msc = (target_msc & 0xffffffff00000000LL); + *msc |= vbl.reply.sequence; + if ( *msc < target_msc ) { + *msc += 0x0000000100000000LL; + } + + return 0; +} + + +/****************************************************************************/ +/** + * Gets a set of default vertical-blank-wait flags based on the internal GLX + * API version and several environment variables. + */ + +GLuint driGetDefaultVBlankFlags( void ) +{ + GLuint flags = 0; + + + flags |= (driCompareGLXAPIVersion( 20030317 ) >= 0) + ? VBLANK_FLAG_INTERVAL : 0; + flags |= (getenv("LIBGL_SYNC_REFRESH") != NULL) + ? VBLANK_FLAG_SYNC : 0; + flags |= (getenv("LIBGL_THROTTLE_REFRESH") != NULL) + ? VBLANK_FLAG_THROTTLE : 0; + + return flags; +} + + +/****************************************************************************/ +/** + * Wrapper to call \c drmWaitVBlank. The main purpose of this function is to + * wrap the error message logging. The error message should only be logged + * the first time the \c drmWaitVBlank fails. If \c drmWaitVBlank is + * successful, \c vbl_seq will be set the sequence value in the reply. + * + * \param vbl Pointer to drmVBlank packet desribing how to wait. + * \param vbl_seq Location to store the current refresh counter. + * \param fd File descriptor use to call into the DRM. + * \return Zero on success or -1 on failure. + */ + +static int do_wait( drmVBlank * vbl, GLuint * vbl_seq, int fd ) +{ + int ret; + + + ret = drmWaitVBlank( fd, vbl ); + if ( ret != 0 ) { + static GLboolean first_time = GL_TRUE; + + if ( first_time ) { + fprintf(stderr, + "%s: drmWaitVBlank returned %d, IRQs don't seem to be" + " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH" + " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret); + first_time = GL_FALSE; + } + + return -1; + } + + *vbl_seq = vbl->reply.sequence; + return 0; +} + + +/****************************************************************************/ +/** + * Waits for the vertical blank for use with glXSwapBuffers. + * + * \param vbl_seq Vertical blank sequence number (MSC) after the last buffer + * swap. Updated after this wait. + * \param flags \c VBLANK_FLAG bits that control how long to wait. + * \param missed_deadline Set to \c GL_TRUE if the MSC after waiting is later + * than the "target" based on \c flags. The idea is that if + * \c missed_deadline is set, then the application is not + * achieving its desired framerate. + * \return Zero on success, -1 on error. + */ + +int +driWaitForVBlank( const __DRIdrawablePrivate *priv, GLuint * vbl_seq, + GLuint flags, GLboolean * missed_deadline ) +{ + drmVBlank vbl; + unsigned original_seq; + unsigned deadline; + unsigned interval; + + + *missed_deadline = GL_FALSE; + if ( (flags & VBLANK_FLAG_NO_IRQ) != 0 ) { + return 0; + } + + + /* VBLANK_FLAG_SYNC means to wait for at least one vertical blank. If + * that flag is not set, do a fake wait for zero vertical blanking + * periods so that we can get the current MSC. + * + * VBLANK_FLAG_INTERVAL and VBLANK_FLAG_THROTTLE mean to wait for at + * least one vertical blank since the last wait. Since do_wait modifies + * vbl_seq, we have to save the original value of vbl_seq for the + * VBLANK_FLAG_INTERVAL / VBLANK_FLAG_THROTTLE calculation later. + */ + + original_seq = *vbl_seq; + + vbl.request.sequence = ((flags & VBLANK_FLAG_SYNC) != 0) ? 1 : 0; + vbl.request.type = DRM_VBLANK_RELATIVE; + + if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) { + return -1; + } + + + vbl.request.type = DRM_VBLANK_ABSOLUTE; + + if ( (flags & VBLANK_FLAG_INTERVAL) != 0 ) { + interval = priv->pdraw->swap_interval; + } + else if ( (flags & VBLANK_FLAG_THROTTLE) != 0 ) { + interval = 1; + } + else { + interval = 0; + } + + + /* Wait until the next vertical blank. If the interval is zero, then + * the deadline is one vertical blank after the previous wait. + */ + + vbl.request.sequence = original_seq + interval; + if ( *vbl_seq < vbl.request.sequence ) { + if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) { + return -1; + } + } + + deadline = original_seq + ((interval == 0) ? 1 : interval); + *missed_deadline = ( *vbl_seq > deadline ); + + return 0; +} Index: xc/lib/GL/mesa/src/drv/common/vblank.h diff -u /dev/null xc/lib/GL/mesa/src/drv/common/vblank.h:1.2 --- /dev/null Sat Feb 28 21:41:12 2004 +++ xc/lib/GL/mesa/src/drv/common/vblank.h Wed Nov 12 23:01:04 2003 @@ -0,0 +1,66 @@ +/* -*- mode: c; c-basic-offset: 3 -*- */ +/* + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. + * + * Authors: + * Ian Romanick + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/common/vblank.h,v 1.2 2003/11/13 04:01:04 tsi Exp $ */ + +#ifndef DRI_VBLANK_H +#define DRI_VBLANK_H + +#include "context.h" +#include "dri_util.h" + +#define VBLANK_FLAG_INTERVAL (1U << 0) /* Respect the swap_interval setting + */ +#define VBLANK_FLAG_THROTTLE (1U << 1) /* Wait 1 refresh since last call. + */ +#define VBLANK_FLAG_SYNC (1U << 2) /* Sync to the next refresh. + */ +#define VBLANK_FLAG_NO_IRQ (1U << 7) /* DRM has no IRQ to wait on. + */ + +extern int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count ); +extern int driWaitForMSC32( __DRIdrawablePrivate *priv, + int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc ); +extern GLuint driGetDefaultVBlankFlags( void ); +extern int driWaitForVBlank( const __DRIdrawablePrivate *priv, + GLuint * vbl_seq, GLuint flags, GLboolean * missed_deadline ); + +#undef usleep +#include /* for usleep() */ + +#ifdef linux +#include /* for sched_yield() */ +#endif + +#define DO_USLEEP(nr) \ + do { \ + if (0) fprintf(stderr, "%s: usleep for %u\n", __FUNCTION__, nr ); \ + if (1) usleep( nr ); \ + sched_yield(); \ + } while( 0 ) + +#endif /* DRI_VBLANK_H */ Index: xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc:1.4 xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc:1.5 --- xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc:1.4 Tue Feb 26 18:37:33 2002 +++ xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc Tue May 27 12:34:32 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc,v 1.4 2002/02/26 23:37:33 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc,v 1.5 2003/05/27 16:34:32 tsi Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=ByteOrder + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ Index: xc/lib/GL/mesa/src/drv/ffb/ffb_context.h diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_context.h:1.2 xc/lib/GL/mesa/src/drv/ffb/ffb_context.h:1.3 --- xc/lib/GL/mesa/src/drv/ffb/ffb_context.h:1.2 Fri Feb 22 16:32:58 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_context.h Sun Sep 28 16:15:07 2003 @@ -1,9 +1,8 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_context.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_context.h,v 1.3 2003/09/28 20:15:07 alanh Exp $ */ #ifndef _FFB_CONTEXT_H #define _FFB_CONTEXT_H -#include #include "dri_util.h" #include "mtypes.h" @@ -269,7 +268,6 @@ drmContext hHWContext; drmLock *driHwLock; int driFd; - Display *display; unsigned int clear_pixel; unsigned int clear_depth; Index: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c:1.4 xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c:1.5 --- xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c:1.4 Wed Sep 11 15:49:07 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c Sun Sep 28 16:15:07 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c,v 1.4 2002/09/11 19:49:07 tsi Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c,v 1.5 2003/09/28 20:15:07 alanh Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -26,10 +26,6 @@ */ #include "mtypes.h" - -#include -#include - #include "mm.h" #include "ffb_dd.h" #include "ffb_span.h" @@ -41,7 +37,7 @@ #include "ffb_lock.h" #include "extensions.h" -#define FFB_DATE "20010624" +#define FFB_DATE "20021125" /* Mesa's Driver Functions */ Index: xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c:1.2 xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c:1.3 --- xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c:1.2 Fri Feb 22 16:32:58 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c Sun Sep 28 16:15:07 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c,v 1.2 2002/02/22 21:32:58 dawes Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c,v 1.3 2003/09/28 20:15:07 alanh Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -26,11 +26,8 @@ */ #include "mtypes.h" - -#include -#include - #include "mm.h" +#include "mmath.h" #include "ffb_dd.h" #include "ffb_span.h" #include "ffb_depth.h" Index: xc/lib/GL/mesa/src/drv/ffb/ffb_points.c diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_points.c:1.2 xc/lib/GL/mesa/src/drv/ffb/ffb_points.c:1.3 --- xc/lib/GL/mesa/src/drv/ffb/ffb_points.c:1.2 Fri Feb 22 16:32:59 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_points.c Sun Sep 28 16:15:08 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_points.c,v 1.2 2002/02/22 21:32:59 dawes Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_points.c,v 1.3 2003/09/28 20:15:08 alanh Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -26,21 +26,14 @@ */ #include "mtypes.h" - -#include -#include - -#include "mm.h" +#include "mmath.h" #include "ffb_dd.h" -#include "ffb_span.h" -#include "ffb_depth.h" #include "ffb_context.h" #include "ffb_vb.h" -#include "ffb_lines.h" #include "ffb_points.h" #include "ffb_tris.h" #include "ffb_lock.h" -#include "extensions.h" + #undef FFB_POINT_TRACE Index: xc/lib/GL/mesa/src/drv/ffb/ffb_state.c diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_state.c:1.5 xc/lib/GL/mesa/src/drv/ffb/ffb_state.c:1.6 --- xc/lib/GL/mesa/src/drv/ffb/ffb_state.c:1.5 Wed Oct 30 07:51:27 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_state.c Sun Sep 28 16:15:08 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_state.c,v 1.5 2002/10/30 12:51:27 alanh Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_state.c,v 1.6 2003/09/28 20:15:08 alanh Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -26,10 +26,7 @@ */ #include "mtypes.h" - -#include -#include - +#include "colormac.h" #include "mm.h" #include "ffb_dd.h" #include "ffb_span.h" @@ -37,8 +34,6 @@ #include "ffb_context.h" #include "ffb_vb.h" #include "ffb_tris.h" -#include "ffb_lines.h" -#include "ffb_points.h" #include "ffb_state.h" #include "ffb_lock.h" #include "extensions.h" @@ -56,6 +51,7 @@ static unsigned int ffbComputeAlphaFunc(GLcontext *ctx) { unsigned int xclip; + GLubyte alphaRef; #ifdef STATE_TRACE fprintf(stderr, "ffbDDAlphaFunc: func(%s) ref(%02x)\n", @@ -77,12 +73,13 @@ return FFB_XCLIP_TEST_ALWAYS | 0x00; } - xclip |= (ctx->Color.AlphaRef & 0xff); + CLAMPED_FLOAT_TO_UBYTE(alphaRef, ctx->Color.AlphaRef); + xclip |= (alphaRef & 0xff); return xclip; } -static void ffbDDAlphaFunc(GLcontext *ctx, GLenum func, GLchan ref) +static void ffbDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref) { ffbContextPtr fmesa = FFB_CONTEXT(ctx); @@ -448,7 +445,7 @@ ffbCalcViewportRegs(ctx); - fmesa->setupnewinputs |= VERT_CLIP; + fmesa->setupnewinputs |= VERT_BIT_CLIP; } static void ffbDDViewport(GLcontext *ctx, GLint x, GLint y, @@ -468,32 +465,32 @@ ffbCalcViewport(ctx); } -static void ffbDDSetDrawBuffer(GLcontext *ctx, GLenum buffer) +static void ffbDDDrawBuffer(GLcontext *ctx, GLenum buffer) { ffbContextPtr fmesa = FFB_CONTEXT(ctx); unsigned int fbc = fmesa->fbc; #ifdef STATE_TRACE - fprintf(stderr, "ffbDDSetDrawBuffer: mode(%s)\n", + fprintf(stderr, "ffbDDDrawBuffer: mode(%s)\n", _mesa_lookup_enum_by_nr(buffer)); #endif fbc &= ~(FFB_FBC_WB_AB | FFB_FBC_RB_MASK); switch (buffer) { - case GL_FRONT_LEFT: + case FRONT_LEFT_BIT: if (fmesa->back_buffer == 0) fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B; else fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A; break; - case GL_BACK_LEFT: + case BACK_LEFT_BIT: if (fmesa->back_buffer == 0) fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A; else fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B; break; - case GL_FRONT_AND_BACK: + case BACK_LEFT_BIT | FRONT_LEFT_BIT: fbc |= FFB_FBC_WB_AB; break; @@ -507,8 +504,18 @@ } } -static void ffbDDSetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum buffer) + +static void ffbDDReadBuffer(GLcontext *ctx, GLenum buffer) +{ + /* no-op, unless you implement h/w glRead/CopyPixels */ +} + + +/* + * Specifies buffer for sw fallbacks (spans) + */ +static void ffbDDSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, + GLuint bufferBit) { ffbContextPtr fmesa = FFB_CONTEXT(ctx); unsigned int fbc = fmesa->fbc; @@ -518,15 +525,15 @@ _mesa_lookup_enum_by_nr(buffer)); #endif fbc &= ~(FFB_FBC_RB_MASK); - switch (buffer) { - case GL_FRONT_LEFT: + switch (bufferBit) { + case FRONT_LEFT_BIT: if (fmesa->back_buffer == 0) fbc |= FFB_FBC_RB_B; else fbc |= FFB_FBC_RB_A; break; - case GL_BACK_LEFT: + case BACK_LEFT_BIT: if (fmesa->back_buffer == 0) fbc |= FFB_FBC_RB_A; else @@ -543,13 +550,17 @@ } } -static void ffbDDClearColor(GLcontext *ctx, const GLchan color[4]) +static void ffbDDClearColor(GLcontext *ctx, const GLfloat color[4]) { ffbContextPtr fmesa = FFB_CONTEXT(ctx); + GLubyte c[4]; + CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); - fmesa->clear_pixel = ((color[0] << 0) | - (color[1] << 8) | - (color[2] << 16)); + fmesa->clear_pixel = ((c[0] << 0) | + (c[1] << 8) | + (c[2] << 16)); } static void ffbDDClearDepth(GLcontext *ctx, GLclampd depth) @@ -842,14 +853,14 @@ tmp = fmesa->fbc & ~FFB_FBC_YE_MASK; if (state) { ffbDDStencilFunc(ctx, - ctx->Stencil.Function, - ctx->Stencil.Ref, - ctx->Stencil.ValueMask); - ffbDDStencilMask(ctx, ctx->Stencil.WriteMask); + ctx->Stencil.Function[0], + ctx->Stencil.Ref[0], + ctx->Stencil.ValueMask[0]); + ffbDDStencilMask(ctx, ctx->Stencil.WriteMask[0]); ffbDDStencilOp(ctx, - ctx->Stencil.FailFunc, - ctx->Stencil.ZFailFunc, - ctx->Stencil.ZPassFunc); + ctx->Stencil.FailFunc[0], + ctx->Stencil.ZFailFunc[0], + ctx->Stencil.ZPassFunc[0]); tmp |= FFB_FBC_YE_MASK; } else { fmesa->stencil = 0xf0000000; @@ -1017,7 +1028,7 @@ if (newstate & _NEW_TEXTURE) FALLBACK( ctx, FFB_BADATTR_TEXTURE, - (ctx->Texture._ReallyEnabled != 0)); + (ctx->Texture._EnabledUnits != 0)); #ifdef STATE_TRACE fprintf(stderr, "ffbDDUpdateState: newstate(%08x)\n", newstate); @@ -1078,7 +1089,8 @@ ctx->Driver.StencilOp = NULL; } - ctx->Driver.SetDrawBuffer = ffbDDSetDrawBuffer; + ctx->Driver.DrawBuffer = ffbDDDrawBuffer; + ctx->Driver.ReadBuffer = ffbDDReadBuffer; ctx->Driver.ClearColor = ffbDDClearColor; ctx->Driver.ClearDepth = ffbDDClearDepth; ctx->Driver.ClearStencil = ffbDDClearStencil; @@ -1107,7 +1119,7 @@ { struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SetReadBuffer = ffbDDSetReadBuffer; + swdd->SetBuffer = ffbDDSetBuffer; } Index: xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c:1.3 xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c:1.4 --- xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c:1.3 Wed Oct 30 07:51:28 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c Sun Sep 28 16:15:08 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c,v 1.3 2002/10/30 12:51:28 alanh Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c,v 1.4 2003/09/28 20:15:08 alanh Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -25,13 +25,10 @@ * David S. Miller */ -#include -#include - #include "glheader.h" #include "mtypes.h" #include "macros.h" - +#include "mmath.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "swrast/s_context.h" Index: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c:1.4 xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c:1.5 --- xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c:1.4 Fri Feb 22 16:32:59 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c Sun Sep 28 16:15:08 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c,v 1.4 2002/02/22 21:32:59 dawes Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c,v 1.5 2003/09/28 20:15:08 alanh Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -28,7 +28,8 @@ #include "ffb_xmesa.h" #include "ffb_context.h" #include "ffb_vb.h" -#include "mem.h" +#include "mmath.h" +#include "imports.h" #include "tnl/t_context.h" #include "swrast_setup/swrast_setup.h" #include "math/m_translate.h" @@ -175,12 +176,12 @@ if (!newinputs) return; - if (newinputs & VERT_CLIP) { + if (newinputs & VERT_BIT_CLIP) { setup_tab[fmesa->setupindex].emit(ctx, start, count); } else { GLuint ind = 0; - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) ind |= (FFB_VB_RGBA_BIT | FFB_VB_TWOSIDE_BIT); ind &= fmesa->setupindex; Index: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.h diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_vb.h:1.2 xc/lib/GL/mesa/src/drv/ffb/ffb_vb.h:1.3 --- xc/lib/GL/mesa/src/drv/ffb/ffb_vb.h:1.2 Fri Feb 22 16:32:59 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_vb.h Sun Sep 28 16:15:08 2003 @@ -1,11 +1,10 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vb.h,v 1.3 2003/09/28 20:15:08 alanh Exp $ */ #ifndef _FFB_VB_H #define _FFB_VB_H #include "mtypes.h" #include "macros.h" -#include "mmath.h" #include "tnl/t_context.h" #include "swrast/swrast.h" Index: xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h:1.1 xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h:1.2 --- xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h:1.1 Fri Feb 22 16:32:59 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h Sun Sep 28 16:15:08 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h,v 1.2 2003/09/28 20:15:08 alanh Exp $ */ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end) { @@ -13,8 +13,8 @@ #endif #endif #if (IND & FFB_VB_XYZ_BIT) - GLfloat (*proj)[4] = VB->ProjectedClipPtr->data; - GLuint proj_stride = VB->ProjectedClipPtr->stride; + GLfloat (*proj)[4] = VB->NdcPtr->data; + GLuint proj_stride = VB->NdcPtr->stride; const GLubyte *mask = VB->ClipMask; #endif ffb_vertex *v = &fmesa->verts[start]; Index: xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c:1.1 xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c:1.2 --- xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c:1.1 Fri Feb 22 16:32:59 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c Sun Sep 28 16:15:08 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c,v 1.1 2002/02/22 21:32:59 dawes Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c,v 1.2 2003/09/28 20:15:08 alanh Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2001 David S. Miller @@ -30,7 +30,7 @@ #include "context.h" #include "light.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "simple_list.h" Index: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c:1.4 xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c:1.5 --- xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c:1.4 Fri Feb 22 16:32:59 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c Sun Sep 28 16:15:08 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c,v 1.4 2002/02/22 21:32:59 dawes Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c,v 1.5 2003/09/28 20:15:08 alanh Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000, 2001 David S. Miller @@ -27,15 +27,11 @@ #ifdef GLX_DIRECT_RENDERING -#include -#include - #include "ffb_xmesa.h" #include "context.h" #include "matrix.h" #include "simple_list.h" -#include "mmath.h" -#include "mem.h" +#include "imports.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -43,9 +39,6 @@ #include "tnl/t_pipeline.h" #include "array_cache/acache.h" - -#include "xf86dri.h" - #include "ffb_context.h" #include "ffb_dd.h" #include "ffb_span.h" @@ -176,7 +169,7 @@ /* Create and initialize the Mesa and driver specific context data */ static GLboolean -ffbCreateContext(Display *dpy, const __GLcontextModes *mesaVis, +ffbCreateContext(const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate) { @@ -208,7 +201,6 @@ ffbScreen = (ffbScreenPrivate *) sPriv->private; /* Dri stuff. */ - fmesa->display = dpy; fmesa->hHWContext = driContextPriv->hHWContext; fmesa->driFd = sPriv->fd; fmesa->driHwLock = &sPriv->pSAREA->lock; @@ -315,8 +307,7 @@ /* Create and initialize the Mesa and driver specific pixmap buffer data */ static GLboolean -ffbCreateBuffer(Display *dpy, - __DRIscreenPrivate *driScrnPriv, +ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) @@ -346,9 +337,8 @@ #define USE_FAST_SWAP static void -ffbSwapBuffers(Display *dpy, void *drawablePrivate) +ffbSwapBuffers( __DRIdrawablePrivate *dPriv ) { - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; ffbContextPtr fmesa = (ffbContextPtr) dPriv->driContextPriv->driverPrivate; unsigned int fbc, wid, wid_reg_val, dac_db_bit; unsigned int shadow_dac_addr, active_dac_addr; @@ -360,7 +350,7 @@ return; /* Flush pending rendering commands */ - _mesa_swapbuffers(fmesa->glCtx); + _mesa_notifySwapBuffers(fmesa->glCtx); ffb = fmesa->regs; dac = fmesa->ffbScreen->dac; @@ -557,7 +547,7 @@ __DRIscreenPrivate *sPriv = fmesa->driScreen; int stamp = dPriv->lastStamp; - DRI_VALIDATE_DRAWABLE_INFO(fmesa->display, sPriv, dPriv); + DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); if (dPriv->lastStamp != stamp) { GLcontext *ctx = fmesa->glCtx; @@ -569,13 +559,6 @@ } } -/* This function is called by libGL.so as soon as libGL.so is loaded. - * This is where we'd register new extension functions with the dispatcher. - */ -void __driRegisterExtensions(void) -{ -} - static struct __DriverAPIRec ffbAPI = { ffbInitDriver, Index: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.h diff -u xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.h:1.2 xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.h:1.3 --- xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.h:1.2 Fri Feb 22 16:32:59 2002 +++ xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.h Sun Sep 28 16:15:09 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.h,v 1.3 2003/09/28 20:15:09 alanh Exp $ */ #ifndef _FFB_XMESA_H_ #define _FFB_XMESA_H_ @@ -25,8 +25,6 @@ int rp_active; } ffbScreenPrivate; -extern void __driRegisterExtensions(void); - #endif /* GLX_DIRECT_RENDERING */ #endif /* !(_FFB_XMESA_H) */ Index: xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc:1.3 xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc:1.4 --- xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc:1.3 Fri Feb 22 16:33:00 2002 +++ xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc Tue May 27 12:34:33 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc,v 1.3 2002/02/22 21:33:00 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc,v 1.4 2003/05/27 16:34:33 tsi Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=ByteOrder + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ Index: xc/lib/GL/mesa/src/drv/gamma/gamma_context.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_context.c:1.2 xc/lib/GL/mesa/src/drv/gamma/gamma_context.c:1.3 --- xc/lib/GL/mesa/src/drv/gamma/gamma_context.c:1.2 Wed Oct 30 07:51:28 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_context.c Sun Sep 28 16:15:09 2003 @@ -35,14 +35,13 @@ #include "context.h" #include "simple_list.h" -#include "mem.h" +#include "imports.h" #include "matrix.h" #include "extensions.h" #if defined(USE_X86_ASM) #include "X86/common_x86_asm.h" #endif #include "simple_list.h" -#include "mem.h" #include "mm.h" @@ -66,7 +65,7 @@ 0, }; -GLboolean gammaCreateContext( Display *dpy, const __GLcontextModes *glVisual, +GLboolean gammaCreateContext( const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate) { @@ -86,14 +85,12 @@ else shareCtx = NULL; - gmesa->glCtx = _mesa_create_context(glVisual, shareCtx, gmesa, GL_TRUE); + gmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) gmesa, GL_TRUE); if (!gmesa->glCtx) { FREE(gmesa); return GL_FALSE; } - gmesa->display = dpy; - gmesa->driContext = driContextPriv; gmesa->driScreen = sPriv; gmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */ Index: xc/lib/GL/mesa/src/drv/gamma/gamma_context.h diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_context.h:1.6 xc/lib/GL/mesa/src/drv/gamma/gamma_context.h:1.7 --- xc/lib/GL/mesa/src/drv/gamma/gamma_context.h:1.6 Mon Dec 16 11:18:50 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_context.h Sun Sep 28 16:15:09 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_context.h,v 1.6 2002/12/16 16:18:50 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_context.h,v 1.7 2003/09/28 20:15:09 alanh Exp $ */ /* * Copyright 2001 by Alan Hourihane. * @@ -28,7 +28,7 @@ #define _GAMMA_CONTEXT_H_ #include "dri_util.h" - +#include "colormac.h" #include "gamma_regs.h" #include "gamma_macros.h" #include "gamma_screen.h" @@ -59,8 +59,7 @@ extern void gammaDDUpdateHWState(GLcontext *ctx); extern gammaScreenPtr gammaCreateScreen(__DRIscreenPrivate *sPriv); extern void gammaDestroyScreen(__DRIscreenPrivate *sPriv); -extern GLboolean gammaCreateContext( Display *dpy, - const __GLcontextModes *glVisual, +extern GLboolean gammaCreateContext( const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate); @@ -186,7 +185,6 @@ GLuint in_use ); void gammaEmitHwState( gammaContextPtr gmesa ); -void gammaGetLock( gammaContextPtr gmesa, GLuint flags ); void gammaDDInitExtensions( GLcontext *ctx ); void gammaDDInitDriverFuncs( GLcontext *ctx ); void gammaDDInitSpanFuncs( GLcontext *ctx ); @@ -247,8 +245,6 @@ /* Mirrors of some DRI state */ - Display *display; /* X server display */ - drmContext hHWContext; drmLock *driHwLock; int driFd; Index: xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c:1.3 xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c:1.4 --- xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c:1.3 Wed Oct 30 07:51:29 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_dd.c Sun Sep 28 16:15:09 2003 @@ -33,7 +33,7 @@ #include "context.h" #include "swrast/swrast.h" -#define GAMMA_DATE "20010624" +#define GAMMA_DATE "20021125" /* Return the width and height of the current color buffer. Index: xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c:1.4 xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c:1.5 --- xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c:1.4 Tue Nov 5 12:46:07 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c Sun Sep 28 16:15:09 2003 @@ -1,6 +1,7 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c,v 1.5 2003/09/28 20:15:09 alanh Exp $ */ #include "gamma_context.h" +#include "gamma_lock.h" #ifdef DEBUG_LOCKING char *prevLockFile = NULL; @@ -31,7 +32,7 @@ * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO( gmesa->display, sPriv, dPriv ); + DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); if ( gmesa->lastStamp != dPriv->lastStamp ) { gmesa->lastStamp = dPriv->lastStamp; Index: xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h:1.5 xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h:1.6 --- xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h:1.5 Fri Feb 22 16:33:02 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h Sun Sep 28 16:15:09 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h,v 1.5 2002/02/22 21:33:02 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h,v 1.6 2003/09/28 20:15:09 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -246,15 +246,15 @@ } while (0) #ifdef DO_VALIDATE -#define VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp) \ +#define VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp) \ do { \ - __DRIscreenPrivate *psp = gcp->driScreen; \ - __DRIdrawablePrivate *pdp = gcp->driDrawable; \ + /*__DRIscreenPrivate *psp = gcp->driScreen;*/ \ + __DRIdrawablePrivate *pdp = gcp->driDrawable; \ \ if (*(pdp->pStamp) != pdp->lastStamp) { \ int old_index = pdp->index; \ while (*(pdp->pStamp) != pdp->lastStamp) { \ - DRI_VALIDATE_DRAWABLE_INFO_ONCE(gcp->display, psp->myNum, pdp);\ + DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \ } \ if (pdp->index != old_index) { \ gcp->Window &= ~W_GIDMask; \ @@ -262,8 +262,8 @@ CHECK_WC_DMA_BUFFER(gcp, 1); \ WRITE(gcp->WCbuf, GLINTWindow, gcp->Window|(gcp->FrameCount<<9));\ } \ - \ - gammaUpdateViewportOffset( gcp->glCtx); \ + \ + gammaUpdateViewportOffset( gcp->glCtx); \ \ if (pdp->numClipRects == 1 && \ pdp->pClipRects->x1 == pdp->x && \ Index: xc/lib/GL/mesa/src/drv/gamma/gamma_render.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_render.c:1.2 xc/lib/GL/mesa/src/drv/gamma/gamma_render.c:1.3 --- xc/lib/GL/mesa/src/drv/gamma/gamma_render.c:1.2 Wed Oct 30 07:51:29 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_render.c Sun Sep 28 16:15:10 2003 @@ -28,9 +28,8 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" -#include "mmath.h" #include "tnl/t_context.h" @@ -67,8 +66,8 @@ coord = VB->ClipPtr->data; coord_stride = VB->ClipPtr->stride; } else { - coord = VB->ProjectedClipPtr->data; - coord_stride = VB->ProjectedClipPtr->stride; + coord = VB->NdcPtr->data; + coord_stride = VB->NdcPtr->stride; } if (VB->importable_data) { @@ -179,7 +178,7 @@ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK ); tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags ); - GAMMA_CONTEXT(ctx)->SetupNewInputs = VERT_CLIP; + GAMMA_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_CLIP; } static const GLuint hw_prim[GL_POLYGON+1] = { @@ -274,20 +273,20 @@ static void gamma_check_render( GLcontext *ctx, struct gl_pipeline_stage *stage ) { - GLuint inputs = VERT_CLIP|VERT_RGBA; + GLuint inputs = VERT_BIT_CLIP | VERT_BIT_COLOR0; if (ctx->RenderMode == GL_RENDER) { if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - inputs |= VERT_SPEC_RGB; + inputs |= VERT_BIT_COLOR1; if (ctx->Texture.Unit[0]._ReallyEnabled) - inputs |= VERT_TEX(0); + inputs |= VERT_BIT_TEX0; if (ctx->Texture.Unit[1]._ReallyEnabled) - inputs |= VERT_TEX(1); + inputs |= VERT_BIT_TEX1; if (ctx->Fog.Enabled) - inputs |= VERT_FOG_COORD; + inputs |= VERT_BIT_FOG; } stage->inputs = inputs; Index: xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c:1.2 xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c:1.3 --- xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c:1.2 Wed Oct 30 07:51:29 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_screen.c Sun Sep 28 16:15:10 2003 @@ -27,7 +27,7 @@ #include "gamma_vb.h" #include "glint_dri.h" -#include "mem.h" +#include "imports.h" gammaScreenPtr gammaCreateScreen( __DRIscreenPrivate *sPriv ) { @@ -36,15 +36,12 @@ int i; #if 0 - /* Check the DRI version */ - { - int major, minor, patch; - if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 3 || minor != 1 || patch < 0 ) { - __driUtilMessage( "r128 DRI driver expected DRI version 3.1.x but got version %d.%d.%d", major, minor, patch ); - return GL_FALSE; - } - } + /* Check the DRI externsion version */ + if ( sPriv->driMajor != 3 || sPriv->driMinor != 1 ) { + __driUtilMessage( "Gamma DRI driver expected DRI version 4.0.x " + "but got version %d.%d.%d", + sPriv->driMajor, sPriv->driMinor, sPriv->driPatch ); + return NULL; } /* Check that the DDX driver version is compatible */ Index: xc/lib/GL/mesa/src/drv/gamma/gamma_span.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_span.c:1.4 xc/lib/GL/mesa/src/drv/gamma/gamma_span.c:1.5 --- xc/lib/GL/mesa/src/drv/gamma/gamma_span.c:1.4 Tue Nov 5 12:46:07 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_span.c Sun Sep 28 16:15:10 2003 @@ -1,7 +1,8 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_span.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_span.c,v 1.5 2003/09/28 20:15:10 alanh Exp $ */ #include "gamma_context.h" #include "gamma_lock.h" +#include "colormac.h" #include "swrast/swrast.h" @@ -260,17 +261,17 @@ } #endif -static void gammaSetReadBuffer( GLcontext *ctx, - GLframebuffer *colorBuffer, - GLenum mode ) +static void gammaSetBuffer( GLcontext *ctx, + GLframebuffer *colorBuffer, + GLuint bufferBit ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - switch ( mode ) { - case GL_FRONT_LEFT: + switch ( bufferBit ) { + case FRONT_LEFT_BIT: gmesa->readOffset = 0; break; - case GL_BACK_LEFT: + case BACK_LEFT_BIT: gmesa->readOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp; break; } @@ -282,7 +283,7 @@ gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SetReadBuffer = gammaSetReadBuffer; + swdd->SetBuffer = gammaSetBuffer; switch ( gmesa->gammaScreen->cpp ) { case 2: Index: xc/lib/GL/mesa/src/drv/gamma/gamma_state.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_state.c:1.5 xc/lib/GL/mesa/src/drv/gamma/gamma_state.c:1.7 --- xc/lib/GL/mesa/src/drv/gamma/gamma_state.c:1.5 Tue Nov 5 12:46:07 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_state.c Mon Dec 22 12:48:03 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_state.c,v 1.5 2002/11/05 17:46:07 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_state.c,v 1.7 2003/12/22 17:48:03 tsi Exp $ */ /* * Copyright 2001 by Alan Hourihane. * @@ -25,7 +25,6 @@ * 3DLabs Gamma driver */ -#include #include "gamma_context.h" #include "gamma_macros.h" #include "macros.h" @@ -48,11 +47,12 @@ CARD32 a = gmesa->AlphaTestMode; CARD32 b = gmesa->AlphaBlendMode; CARD32 f = gmesa->AB_FBReadMode_Save = 0; + GLubyte refByte = (GLint) (ctx->Color.AlphaRef * 255.0); a &= ~(AT_CompareMask | AT_RefValueMask); b &= ~(AB_SrcBlendMask | AB_DstBlendMask); - a |= ctx->Color.AlphaRef << 4; + a |= refByte << 4; switch ( ctx->Color.AlphaFunc ) { case GL_NEVER: @@ -167,9 +167,10 @@ gmesa->AB_FBReadMode_Save = f; } -static void gammaDDAlphaFunc( GLcontext *ctx, GLenum func, GLchan ref ) +static void gammaDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); + (void) ref; FLUSH_BATCH( gmesa ); @@ -588,6 +589,7 @@ } } +#if 0 static void gammaDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); @@ -595,6 +597,7 @@ FLUSH_BATCH( gmesa ); gmesa->new_state |= GAMMA_NEW_FOG; } +#endif /* ============================================================= * Lines @@ -1016,12 +1019,17 @@ * Miscellaneous */ -static void gammaDDClearColor( GLcontext *ctx, const GLchan color[4]) +static void gammaDDClearColor( GLcontext *ctx, const GLfloat color[4]) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); + GLubyte c[4]; + UNCLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); + UNCLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); + UNCLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); + UNCLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); gmesa->ClearColor = gammaPackColor( gmesa->gammaScreen->cpp, - color[0], color[1], color[2], color[3] ); + c[0], c[1], c[2], c[3] ); if (gmesa->gammaScreen->cpp == 2) gmesa->ClearColor |= gmesa->ClearColor<<16; } @@ -1042,7 +1050,7 @@ gmesa->dirty |= GAMMA_UPLOAD_LOGICOP; } -static void gammaDDSetDrawBuffer( GLcontext *ctx, GLenum mode ) +static void gammaDDDrawBuffer( GLcontext *ctx, GLenum mode ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); @@ -1058,6 +1066,11 @@ } } +static void gammaDDReadBuffer( GLcontext *ctx, GLenum mode ) +{ + /* XXX anything? */ +} + /* ============================================================= * Window position and viewport transformation */ @@ -1132,84 +1145,72 @@ static void gammaLoadHWMatrix(GLcontext *ctx) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); + const GLfloat *m; gmesa->TransformMode &= ~XM_XformTexture; switch (ctx->Transform.MatrixMode) { case GL_MODELVIEW: gmesa->TransformMode |= XM_UseModelViewMatrix; + m = ctx->ModelviewMatrixStack.Top->m; CHECK_DMA_BUFFER(gmesa, 16); - WRITEF(gmesa->buf, ModelViewMatrix0, ctx->ModelView.m[0]); - WRITEF(gmesa->buf, ModelViewMatrix1, ctx->ModelView.m[1]); - WRITEF(gmesa->buf, ModelViewMatrix2, ctx->ModelView.m[2]); - WRITEF(gmesa->buf, ModelViewMatrix3, ctx->ModelView.m[3]); - WRITEF(gmesa->buf, ModelViewMatrix4, ctx->ModelView.m[4]); - WRITEF(gmesa->buf, ModelViewMatrix5, ctx->ModelView.m[5]); - WRITEF(gmesa->buf, ModelViewMatrix6, ctx->ModelView.m[6]); - WRITEF(gmesa->buf, ModelViewMatrix7, ctx->ModelView.m[7]); - WRITEF(gmesa->buf, ModelViewMatrix8, ctx->ModelView.m[8]); - WRITEF(gmesa->buf, ModelViewMatrix9, ctx->ModelView.m[9]); - WRITEF(gmesa->buf, ModelViewMatrix10, ctx->ModelView.m[10]); - WRITEF(gmesa->buf, ModelViewMatrix11, ctx->ModelView.m[11]); - WRITEF(gmesa->buf, ModelViewMatrix12, ctx->ModelView.m[12]); - WRITEF(gmesa->buf, ModelViewMatrix13, ctx->ModelView.m[13]); - WRITEF(gmesa->buf, ModelViewMatrix14, ctx->ModelView.m[14]); - WRITEF(gmesa->buf, ModelViewMatrix15, ctx->ModelView.m[15]); + WRITEF(gmesa->buf, ModelViewMatrix0, m[0]); + WRITEF(gmesa->buf, ModelViewMatrix1, m[1]); + WRITEF(gmesa->buf, ModelViewMatrix2, m[2]); + WRITEF(gmesa->buf, ModelViewMatrix3, m[3]); + WRITEF(gmesa->buf, ModelViewMatrix4, m[4]); + WRITEF(gmesa->buf, ModelViewMatrix5, m[5]); + WRITEF(gmesa->buf, ModelViewMatrix6, m[6]); + WRITEF(gmesa->buf, ModelViewMatrix7, m[7]); + WRITEF(gmesa->buf, ModelViewMatrix8, m[8]); + WRITEF(gmesa->buf, ModelViewMatrix9, m[9]); + WRITEF(gmesa->buf, ModelViewMatrix10, m[10]); + WRITEF(gmesa->buf, ModelViewMatrix11, m[11]); + WRITEF(gmesa->buf, ModelViewMatrix12, m[12]); + WRITEF(gmesa->buf, ModelViewMatrix13, m[13]); + WRITEF(gmesa->buf, ModelViewMatrix14, m[14]); + WRITEF(gmesa->buf, ModelViewMatrix15, m[15]); break; case GL_PROJECTION: + m = ctx->ProjectionMatrixStack.Top->m; CHECK_DMA_BUFFER(gmesa, 16); - WRITEF(gmesa->buf, ModelViewProjectionMatrix0, - ctx->ProjectionMatrix.m[0]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix1, - ctx->ProjectionMatrix.m[1]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix2, - ctx->ProjectionMatrix.m[2]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix3, - ctx->ProjectionMatrix.m[3]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix4, - ctx->ProjectionMatrix.m[4]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix5, - ctx->ProjectionMatrix.m[5]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix6, - ctx->ProjectionMatrix.m[6]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix7, - ctx->ProjectionMatrix.m[7]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix8, - ctx->ProjectionMatrix.m[8]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix9, - ctx->ProjectionMatrix.m[9]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix10, - ctx->ProjectionMatrix.m[10]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix11, - ctx->ProjectionMatrix.m[11]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix12, - ctx->ProjectionMatrix.m[12]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix13, - ctx->ProjectionMatrix.m[13]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix14, - ctx->ProjectionMatrix.m[14]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix15, - ctx->ProjectionMatrix.m[15]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix0, m[0]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix1, m[1]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix2, m[2]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix3, m[3]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix4, m[4]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix5, m[5]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix6, m[6]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix7, m[7]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix8, m[8]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix9, m[9]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix10, m[10]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix11, m[11]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix12, m[12]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix13, m[13]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix14, m[14]); + WRITEF(gmesa->buf, ModelViewProjectionMatrix15, m[15]); break; case GL_TEXTURE: + m = ctx->TextureMatrixStack[0].Top->m; CHECK_DMA_BUFFER(gmesa, 16); gmesa->TransformMode |= XM_XformTexture; - WRITEF(gmesa->buf, TextureMatrix0, ctx->TextureMatrix[0].m[0]); - WRITEF(gmesa->buf, TextureMatrix1, ctx->TextureMatrix[0].m[1]); - WRITEF(gmesa->buf, TextureMatrix2, ctx->TextureMatrix[0].m[2]); - WRITEF(gmesa->buf, TextureMatrix3, ctx->TextureMatrix[0].m[3]); - WRITEF(gmesa->buf, TextureMatrix4, ctx->TextureMatrix[0].m[4]); - WRITEF(gmesa->buf, TextureMatrix5, ctx->TextureMatrix[0].m[5]); - WRITEF(gmesa->buf, TextureMatrix6, ctx->TextureMatrix[0].m[6]); - WRITEF(gmesa->buf, TextureMatrix7, ctx->TextureMatrix[0].m[7]); - WRITEF(gmesa->buf, TextureMatrix8, ctx->TextureMatrix[0].m[8]); - WRITEF(gmesa->buf, TextureMatrix9, ctx->TextureMatrix[0].m[9]); - WRITEF(gmesa->buf, TextureMatrix10, ctx->TextureMatrix[0].m[10]); - WRITEF(gmesa->buf, TextureMatrix11, ctx->TextureMatrix[0].m[11]); - WRITEF(gmesa->buf, TextureMatrix12, ctx->TextureMatrix[0].m[12]); - WRITEF(gmesa->buf, TextureMatrix13, ctx->TextureMatrix[0].m[13]); - WRITEF(gmesa->buf, TextureMatrix14, ctx->TextureMatrix[0].m[14]); - WRITEF(gmesa->buf, TextureMatrix15, ctx->TextureMatrix[0].m[15]); + WRITEF(gmesa->buf, TextureMatrix0, m[0]); + WRITEF(gmesa->buf, TextureMatrix1, m[1]); + WRITEF(gmesa->buf, TextureMatrix2, m[2]); + WRITEF(gmesa->buf, TextureMatrix3, m[3]); + WRITEF(gmesa->buf, TextureMatrix4, m[4]); + WRITEF(gmesa->buf, TextureMatrix5, m[5]); + WRITEF(gmesa->buf, TextureMatrix6, m[6]); + WRITEF(gmesa->buf, TextureMatrix7, m[7]); + WRITEF(gmesa->buf, TextureMatrix8, m[8]); + WRITEF(gmesa->buf, TextureMatrix9, m[9]); + WRITEF(gmesa->buf, TextureMatrix10, m[10]); + WRITEF(gmesa->buf, TextureMatrix11, m[11]); + WRITEF(gmesa->buf, TextureMatrix12, m[12]); + WRITEF(gmesa->buf, TextureMatrix13, m[13]); + WRITEF(gmesa->buf, TextureMatrix14, m[14]); + WRITEF(gmesa->buf, TextureMatrix15, m[15]); break; default: @@ -1666,7 +1667,7 @@ } -void gammaDDUpdateState( GLcontext *ctx, GLuint new_state ) +static void gammaDDUpdateState( GLcontext *ctx, GLuint new_state ) { _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); @@ -1692,7 +1693,8 @@ ctx->Driver.Clear = gammaDDClear; ctx->Driver.ClearIndex = NULL; ctx->Driver.ClearColor = gammaDDClearColor; - ctx->Driver.SetDrawBuffer = gammaDDSetDrawBuffer; + ctx->Driver.DrawBuffer = gammaDDDrawBuffer; + ctx->Driver.ReadBuffer = gammaDDReadBuffer; ctx->Driver.IndexMask = NULL; ctx->Driver.ColorMask = gammaDDColorMask; Index: xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c:1.4 xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c:1.5 --- xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c:1.4 Tue Nov 5 12:46:07 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c Sun Sep 28 16:15:10 2003 @@ -1,11 +1,11 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_tex.c,v 1.5 2003/09/28 20:15:10 alanh Exp $ */ #include #include #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "simple_list.h" #include "enums.h" #include "texstore.h" @@ -14,17 +14,18 @@ #include "mm.h" #include "gamma_context.h" -#include "mmath.h" +#include "colormac.h" /* * Compute the 'S2.4' lod bias factor from the floating point OpenGL bias. */ +#if 0 static GLuint gammaComputeLodBias(GLfloat bias) { return bias; } - +#endif static void gammaSetTexWrapping(gammaTextureObjectPtr t, GLenum wraps, GLenum wrapt) @@ -141,7 +142,7 @@ break; case GL_TEXTURE_BORDER_COLOR: - gammaSetTexBorderColor( gmesa, t, tObj->BorderColor ); + gammaSetTexBorderColor( gmesa, t, tObj->_BorderChan ); break; case GL_TEXTURE_BASE_LEVEL: @@ -206,6 +207,7 @@ { struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData; + (void) t; /* XXX Looks like there's something missing here */ } #endif @@ -216,6 +218,7 @@ } } +#if 0 static void gammaTexImage1D( GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, @@ -233,7 +236,9 @@ width, border, format, type, pixels, pack, texObj, texImage ); } +#endif +#if 0 static void gammaTexSubImage1D( GLcontext *ctx, GLenum target, GLint level, @@ -253,6 +258,7 @@ format, type, pixels, pack, texObj, texImage); } +#endif static void gammaTexImage2D( GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, @@ -341,7 +347,7 @@ gammaSetTexWrapping( t, tObj->WrapS, tObj->WrapT ); gammaSetTexFilter( gmesa, t, tObj->MinFilter, tObj->MagFilter, bias ); - gammaSetTexBorderColor( gmesa, t, tObj->BorderColor ); + gammaSetTexBorderColor( gmesa, t, tObj->_BorderChan ); } } Index: xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c:1.5 xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c:1.6 --- xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c:1.5 Tue Nov 5 12:46:07 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c Sun Sep 28 16:15:10 2003 @@ -1,9 +1,10 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c,v 1.5 2002/11/05 17:46:07 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texmem.c,v 1.6 2003/09/28 20:15:10 alanh Exp $ */ #include #include #include "glheader.h" +#include "colormac.h" #include "macros.h" #include "mtypes.h" #include "simple_list.h" Index: xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c:1.5 xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c:1.6 --- xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c:1.5 Tue Nov 5 12:46:07 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c Sun Sep 28 16:15:10 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c,v 1.5 2002/11/05 17:46:07 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_texstate.c,v 1.6 2003/09/28 20:15:10 alanh Exp $ */ #include #include @@ -151,7 +151,7 @@ /* fprintf(stderr, "%s\n", __FUNCTION__); */ - if (texUnit->_ReallyEnabled == TEXTURE0_2D) + if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) { struct gl_texture_object *tObj = texUnit->_Current; gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData; Index: xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c:1.2 xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c:1.3 --- xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c:1.2 Wed Oct 30 07:51:30 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_tris.c Sun Sep 28 16:15:10 2003 @@ -25,9 +25,6 @@ * 3DLabs Gamma driver. */ -#include -#include - #include "gamma_context.h" #include "gamma_vb.h" #include "gamma_tris.h" @@ -154,6 +151,7 @@ } +#if 0 static void gamma_fallback_point( gammaContextPtr gmesa, const gammaVertex *v0 ) @@ -163,6 +161,7 @@ gamma_translate_vertex( ctx, v0, &v[0] ); _swrast_Point( ctx, &v[0] ); } +#endif /*********************************************************************** @@ -180,7 +179,7 @@ #define LINE_FALLBACK (0) #define TRI_FALLBACK (0) -void gammaChooseRasterState(GLcontext *ctx) +static void gammaChooseRasterState(GLcontext *ctx) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); GLuint flags = ctx->_TriangleCaps; @@ -193,7 +192,7 @@ else gmesa->Begin &= ~B_AntiAliasEnable; - if ( ctx->Texture._ReallyEnabled ) { + if ( ctx->Texture.Unit[0]._ReallyEnabled ) { ind |= GAMMA_RAST_TEX_BIT; gmesa->Begin |= B_TextureEnable; } else Index: xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c:1.3 xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c:1.5 --- xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c:1.3 Wed Oct 30 07:51:30 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c Sun Sep 28 16:15:10 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c,v 1.3 2002/10/30 12:51:30 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_vb.c,v 1.5 2003/09/28 20:15:10 alanh Exp $ */ /* * Copyright 2001 by Alan Hourihane. * @@ -28,10 +28,9 @@ #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "colormac.h" -#include "mmath.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" @@ -279,21 +278,21 @@ if (!newinputs) return; - if (newinputs & VERT_CLIP) { + if (newinputs & VERT_BIT_CLIP) { setup_tab[gmesa->SetupIndex].emit( ctx, start, count, v, stride ); } else { GLuint ind = 0; - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) ind |= GAMMA_RGBA_BIT; - if (newinputs & VERT_SPEC_RGB) + if (newinputs & VERT_BIT_COLOR1) ind |= GAMMA_SPEC_BIT; - if (newinputs & VERT_TEX0) + if (newinputs & VERT_BIT_TEX0) ind |= GAMMA_TEX0_BIT; - if (newinputs & VERT_FOG_COORD) + if (newinputs & VERT_BIT_FOG) ind |= GAMMA_FOG_BIT; if (gmesa->SetupIndex & GAMMA_PTEX_BIT) @@ -319,7 +318,7 @@ if (ctx->Fog.Enabled) ind |= GAMMA_FOG_BIT; - if (ctx->Texture._ReallyEnabled) { + if (ctx->Texture.Unit[0]._ReallyEnabled) { _tnl_need_projected_coords( ctx, GL_FALSE ); ind |= GAMMA_TEX0_BIT; } else Index: xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c diff -u xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c:1.14 xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c:1.15 --- xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c:1.14 Wed Oct 30 07:51:30 2002 +++ xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c Sun Sep 28 16:15:10 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c,v 1.14 2002/10/30 12:51:30 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c,v 1.15 2003/09/28 20:15:10 alanh Exp $ */ /* * Copyright 2001 by Alan Hourihane. * @@ -28,7 +28,6 @@ #include "gamma_context.h" #include "gamma_vb.h" #include "context.h" -#include "mmath.h" #include "matrix.h" #include "glint_dri.h" @@ -74,8 +73,7 @@ static GLboolean -gammaCreateBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, +gammaCreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) @@ -103,11 +101,8 @@ } static void -gammaSwapBuffers(Display *dpy, void *drawablePrivate) +gammaSwapBuffers( __DRIdrawablePrivate *dPriv ) { - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - (void) dpy; - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { gammaContextPtr gmesa; __DRIscreenPrivate *driScrnPriv; @@ -117,6 +112,8 @@ ctx = gmesa->glCtx; driScrnPriv = gmesa->driScreen; + _mesa_notifySwapBuffers(ctx); + VALIDATE_DRAWABLE_INFO(gmesa); /* Flush any partially filled buffers */ @@ -287,10 +284,3 @@ psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &gammaAPI); return (void *) psp; } - -void __driRegisterExtensions(void) -{ - /* No extensions */ -} - - Index: xc/lib/GL/mesa/src/drv/i810/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/i810/Imakefile.inc:1.3 xc/lib/GL/mesa/src/drv/i810/Imakefile.inc:1.4 --- xc/lib/GL/mesa/src/drv/i810/Imakefile.inc:1.3 Fri Feb 22 16:33:03 2002 +++ xc/lib/GL/mesa/src/drv/i810/Imakefile.inc Tue May 27 12:34:33 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile.inc,v 1.3 2002/02/22 21:33:03 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile.inc,v 1.4 2003/05/27 16:34:33 tsi Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=ByteOrder + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ Index: xc/lib/GL/mesa/src/drv/i810/i810context.c diff -u xc/lib/GL/mesa/src/drv/i810/i810context.c:1.3 xc/lib/GL/mesa/src/drv/i810/i810context.c:1.5 --- xc/lib/GL/mesa/src/drv/i810/i810context.c:1.3 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810context.c Mon Dec 8 17:45:30 2003 @@ -24,7 +24,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.c,v 1.3 2002/10/30 12:51:33 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.c,v 1.5 2003/12/08 22:45:30 alanh Exp $ */ /* * Authors: @@ -38,7 +38,7 @@ #include "matrix.h" #include "simple_list.h" #include "extensions.h" -#include "mem.h" +#include "imports.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -57,9 +57,10 @@ #include "i810vb.h" #include "i810ioctl.h" -#include -#include - +#include "utils.h" +#ifndef I810_DEBUG +int I810_DEBUG = (0); +#endif static const GLubyte *i810GetString( GLcontext *ctx, GLenum name ) { @@ -67,7 +68,7 @@ case GL_VENDOR: return (GLubyte *)"Keith Whitwell"; case GL_RENDERER: - return (GLubyte *)"Mesa DRI I810 20020221"; + return (GLubyte *)"Mesa DRI I810 20021125"; default: return 0; } @@ -88,15 +89,23 @@ UNLOCK_HARDWARE(imesa); } -static void i810InitExtensions( GLcontext *ctx ) +/* Extension strings exported by the i810 driver. + */ +static const char * const card_extensions[] = { - _mesa_enable_imaging_extensions( ctx); - _mesa_enable_extension( ctx, "GL_ARB_multitexture" ); - _mesa_enable_extension( ctx, "GL_ARB_texture_env_add" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_env_add" ); - _mesa_enable_extension( ctx, "GL_EXT_stencil_wrap" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_lod_bias" ); -} + "GL_ARB_multitexture", + "GL_ARB_texture_env_add", + "GL_ARB_texture_mirrored_repeat", + "GL_EXT_stencil_wrap", + "GL_EXT_texture_edge_clamp", + "GL_EXT_texture_env_add", + "GL_EXT_texture_lod_bias", + "GL_IBM_texture_mirrored_repeat", + "GL_MESA_ycbcr_texture", + "GL_SGIS_generate_mipmap", + "GL_SGIS_texture_edge_clamp", + NULL +}; extern const struct gl_pipeline_stage _i810_render_stage; @@ -115,9 +124,25 @@ 0, }; +static const struct dri_debug_control debug_control[] = +{ + { "fall", DEBUG_FALLBACKS }, + { "tex", DEBUG_TEXTURE }, + { "ioctl", DEBUG_IOCTL }, + { "prim", DEBUG_PRIMS }, + { "vert", DEBUG_VERTS }, + { "state", DEBUG_STATE }, + { "verb", DEBUG_VERBOSE }, + { "dri", DEBUG_DRI }, + { "dma", DEBUG_DMA }, + { "san", DEBUG_SANITY }, + { "sync", DEBUG_SYNC }, + { "sleep", DEBUG_SLEEP }, + { NULL, 0 } +}; GLboolean -i810CreateContext( Display *dpy, const __GLcontextModes *mesaVis, +i810CreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate ) { @@ -139,28 +164,59 @@ shareCtx = ((i810ContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, imesa, GL_TRUE); + imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void*) imesa, GL_TRUE); if (!imesa->glCtx) { FREE(imesa); return GL_FALSE; } driContextPriv->driverPrivate = imesa; + imesa->i810Screen = i810Screen; + imesa->driScreen = sPriv; + imesa->sarea = saPriv; + imesa->glBuffer = NULL; + + (void) memset( imesa->texture_heaps, 0, sizeof( imesa->texture_heaps ) ); + make_empty_list( & imesa->swapped ); + + imesa->nr_heaps = 1; + imesa->texture_heaps[0] = driCreateTextureHeap( 0, imesa, + i810Screen->textureSize, + 12, + I810_NR_TEX_REGIONS, + imesa->sarea->texList, + & imesa->sarea->texAge, + & imesa->swapped, + sizeof( struct i810_texture_object_t ), + (destroy_texture_object_t *) i810DestroyTexObj ); + + /* Set the maximum texture size small enough that we can guarentee * that both texture units can bind a maximal texture and have them * in memory at once. */ + + + ctx = imesa->glCtx; - if (i810Screen->textureSize < 2*1024*1024) { - ctx->Const.MaxTextureLevels = 9; - } else if (i810Screen->textureSize < 8*1024*1024) { - ctx->Const.MaxTextureLevels = 10; - } else { - ctx->Const.MaxTextureLevels = 11; - } ctx->Const.MaxTextureUnits = 2; + + /* FIXME: driCalcualteMaxTextureLevels assumes that mipmaps are tightly + * FIXME: packed, but they're not in Intel graphics hardware. + */ + driCalculateMaxTextureLevels( imesa->texture_heaps, + imesa->nr_heaps, + & ctx->Const, + 4, + 11, /* max 2D texture size is 2048x2048 */ + 0, /* 3D textures unsupported */ + 0, /* cube textures unsupported. */ + 0, /* texture rectangles unsupported. */ + 12, + GL_FALSE ); + ctx->Const.MinLineWidth = 1.0; ctx->Const.MinLineWidthAA = 1.0; ctx->Const.MaxLineWidth = 3.0; @@ -201,31 +257,21 @@ /* Dri stuff */ - imesa->display = dpy; imesa->hHWContext = driContextPriv->hHWContext; imesa->driFd = sPriv->fd; imesa->driHwLock = &sPriv->pSAREA->lock; - imesa->i810Screen = i810Screen; - imesa->driScreen = sPriv; - imesa->sarea = saPriv; - imesa->glBuffer = NULL; - - imesa->texHeap = mmInit( 0, i810Screen->textureSize ); imesa->stipple_in_hw = 1; imesa->RenderIndex = ~0; imesa->dirty = I810_UPLOAD_CTX|I810_UPLOAD_BUFFERS; imesa->upload_cliprects = GL_TRUE; - make_empty_list(&imesa->TexObjList); - make_empty_list(&imesa->SwappedOut); - imesa->CurrentTexObj[0] = 0; imesa->CurrentTexObj[1] = 0; _math_matrix_ctr( &imesa->ViewportMatrix ); - i810InitExtensions( ctx ); + driInitExtensions( ctx, card_extensions, GL_TRUE ); i810InitStateFuncs( ctx ); i810InitTextureFuncs( ctx ); i810InitTriFuncs( ctx ); @@ -234,6 +280,13 @@ i810InitVB( ctx ); i810InitState( ctx ); +#if DO_DEBUG + I810_DEBUG = driParseDebugString( getenv( "I810_DEBUG" ), + debug_control ); + I810_DEBUG |= driParseDebugString( getenv( "INTEL_DEBUG" ), + debug_control ); +#endif + return GL_TRUE; } @@ -244,7 +297,10 @@ assert(imesa); /* should never be null */ if (imesa) { + GLboolean release_texture_heaps; + + release_texture_heaps = (imesa->glCtx->Shared->RefCount == 1); _swsetup_DestroyContext( imesa->glCtx ); _tnl_DestroyContext( imesa->glCtx ); _ac_DestroyContext( imesa->glCtx ); @@ -255,6 +311,19 @@ /* free the Mesa context */ imesa->glCtx->DriverCtx = NULL; _mesa_destroy_context(imesa->glCtx); + if ( release_texture_heaps ) { + /* This share group is about to go away, free our private + * texture object data. + */ + int i; + + for ( i = 0 ; i < imesa->nr_heaps ; i++ ) { + driDestroyTextureHeap( imesa->texture_heaps[ i ] ); + imesa->texture_heaps[ i ] = NULL; + } + + assert( is_empty_list( & imesa->swapped ) ); + } Xfree(imesa); } @@ -279,7 +348,7 @@ { __DRIdrawablePrivate *dPriv = imesa->driDrawable; - if (dPriv->numBackClipRects == 0) + if (imesa->sarea->pf_enabled == 0 && dPriv->numBackClipRects == 0) { imesa->numClipRects = dPriv->numClipRects; imesa->pClipRects = dPriv->pClipRects; @@ -299,16 +368,18 @@ static void i810XMesaWindowMoved( i810ContextPtr imesa ) { - switch (imesa->glCtx->Color.DriverDrawBuffer) { - case GL_BACK_LEFT: + switch (imesa->glCtx->Color._DrawDestMask) { + case FRONT_LEFT_BIT: + i810XMesaSetFrontClipRects( imesa ); + break; + case BACK_LEFT_BIT: i810XMesaSetBackClipRects( imesa ); break; case GL_FRONT_LEFT: default: + /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */ i810XMesaSetFrontClipRects( imesa ); - break; } - } @@ -356,6 +427,38 @@ return GL_TRUE; } +static void +i810UpdatePageFlipping( i810ContextPtr imesa ) +{ + GLcontext *ctx = imesa->glCtx; + int front = 0; + + switch (ctx->Color._DrawDestMask) { + case FRONT_LEFT_BIT: + front = 1; + break; + case BACK_LEFT_BIT: + front = 0; + break; + default: + return; + } + + if ( imesa->sarea->pf_current_page == 1 ) + front ^= 1; + + if (front) { + imesa->BufferSetup[I810_DESTREG_DI1] = imesa->i810Screen->fbOffset | imesa->i810Screen->backPitchBits; + imesa->drawMap = (char *)imesa->driScreen->pFB; + imesa->readMap = (char *)imesa->driScreen->pFB; + } else { + imesa->BufferSetup[I810_DESTREG_DI1] = imesa->i810Screen->backOffset | imesa->i810Screen->backPitchBits; + imesa->drawMap = imesa->i810Screen->back.map; + imesa->readMap = imesa->i810Screen->back.map; + } + + imesa->dirty |= I810_UPLOAD_BUFFERS; +} void i810GetLock( i810ContextPtr imesa, GLuint flags ) { @@ -363,6 +466,7 @@ __DRIscreenPrivate *sPriv = imesa->driScreen; I810SAREAPtr sarea = imesa->sarea; int me = imesa->hHWContext; + unsigned i; drmGetLock(imesa->driFd, imesa->hHWContext, flags); @@ -371,7 +475,7 @@ * NOTE: This releases and regains the hw lock, so all state * checking must be done *after* this call: */ - DRI_VALIDATE_DRAWABLE_INFO(imesa->display, sPriv, dPriv); + DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); /* If we lost context, need to dump all registers to hardware. @@ -390,31 +494,13 @@ /* Shared texture managment - if another client has played with * texture space, figure out which if any of our textures have been * ejected, and update our global LRU. - */ - if (sarea->texAge != imesa->texAge) { - int sz = 1 << (imesa->i810Screen->logTextureGranularity); - int idx, nr = 0; - - /* Have to go right round from the back to ensure stuff ends up - * LRU in our local list... - */ - for (idx = sarea->texList[I810_NR_TEX_REGIONS].prev ; - idx != I810_NR_TEX_REGIONS && nr < I810_NR_TEX_REGIONS ; - idx = sarea->texList[idx].prev, nr++) - { - if (sarea->texList[idx].age > imesa->texAge) - i810TexturesGone(imesa, idx * sz, sz, sarea->texList[idx].in_use); - } - - if (nr == I810_NR_TEX_REGIONS) { - i810TexturesGone(imesa, 0, imesa->i810Screen->textureSize, 0); - i810ResetGlobalLRU( imesa ); - } - - imesa->texAge = sarea->texAge; + */ + for ( i = 0 ; i < imesa->nr_heaps ; i++ ) { + DRI_AGE_TEXTURES( imesa->texture_heaps[ i ] ); } if (imesa->lastStamp != dPriv->lastStamp) { + i810UpdatePageFlipping( imesa ); i810XMesaWindowMoved( imesa ); imesa->lastStamp = dPriv->lastStamp; } @@ -422,22 +508,18 @@ void -i810SwapBuffers(Display *dpy, void *drawablePrivate) +i810SwapBuffers( __DRIdrawablePrivate *dPriv ) { - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - (void) dpy; - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { i810ContextPtr imesa; GLcontext *ctx; imesa = (i810ContextPtr) dPriv->driContextPriv->driverPrivate; ctx = imesa->glCtx; if (ctx->Visual.doubleBufferMode) { - _mesa_swapbuffers( ctx ); /* flush pending rendering comands */ - if ( imesa->doPageFlip ) { + _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ + if ( imesa->sarea->pf_active ) { i810PageFlip( dPriv ); - } - else { + } else { i810CopyBuffer( dPriv ); } } @@ -447,3 +529,4 @@ _mesa_problem(NULL, "i810SwapBuffers: drawable has no context!\n"); } } + Index: xc/lib/GL/mesa/src/drv/i810/i810context.h diff -u xc/lib/GL/mesa/src/drv/i810/i810context.h:1.9 xc/lib/GL/mesa/src/drv/i810/i810context.h:1.10 --- xc/lib/GL/mesa/src/drv/i810/i810context.h:1.9 Mon Dec 16 11:18:51 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810context.h Sun Sep 28 16:15:11 2003 @@ -21,7 +21,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.h,v 1.9 2002/12/16 16:18:51 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.h,v 1.10 2003/09/28 20:15:11 alanh Exp $ */ #ifndef I810CONTEXT_INC #define I810CONTEXT_INC @@ -30,8 +30,6 @@ typedef struct i810_context_t *i810ContextPtr; typedef struct i810_texture_object_t *i810TextureObjectPtr; -#include - #include "mtypes.h" #include "mm.h" @@ -83,12 +81,14 @@ GLint refcount; GLcontext *glCtx; - /* Textures + /* Texture object bookkeeping */ - i810TextureObjectPtr CurrentTexObj[2]; - struct i810_texture_object_t TexObjList; - struct i810_texture_object_t SwappedOut; - memHeap_t *texHeap; + unsigned nr_heaps; + driTexHeap * texture_heaps[1]; + driTextureObject swapped; + + struct i810_texture_object_t *CurrentTexObj[2]; + /* Bit flag to keep track of fallbacks. */ @@ -109,7 +109,7 @@ GLenum render_primitive; GLenum reduced_primitive; GLuint hw_primitive; - char *verts; + GLubyte *verts; drmBufPtr vertex_buffer; char *vertex_addr; @@ -167,7 +167,8 @@ int texAge; int ctxAge; int dirtyAge; - + + GLboolean scissor; XF86DRIClipRectRec draw_rect; XF86DRIClipRectRec scissor_rect; @@ -175,7 +176,6 @@ drmContext hHWContext; drmLock *driHwLock; int driFd; - Display *display; __DRIdrawablePrivate *driDrawable; __DRIscreenPrivate *driScreen; @@ -230,5 +230,27 @@ #define SUBPIXEL_X -.5 #define SUBPIXEL_Y -.5 +/* ================================================================ + * Debugging: + */ +#define DO_DEBUG 1 +#if DO_DEBUG +extern int I810_DEBUG; +#else +#define I810_DEBUG 0 +#endif + +#define DEBUG_TEXTURE 0x1 +#define DEBUG_STATE 0x2 +#define DEBUG_IOCTL 0x4 +#define DEBUG_PRIMS 0x8 +#define DEBUG_VERTS 0x10 +#define DEBUG_FALLBACKS 0x20 +#define DEBUG_VERBOSE 0x40 +#define DEBUG_DRI 0x80 +#define DEBUG_DMA 0x100 +#define DEBUG_SANITY 0x200 +#define DEBUG_SYNC 0x400 +#define DEBUG_SLEEP 0x800 #endif Index: xc/lib/GL/mesa/src/drv/i810/i810ioctl.c diff -u xc/lib/GL/mesa/src/drv/i810/i810ioctl.c:1.7 xc/lib/GL/mesa/src/drv/i810/i810ioctl.c:1.8 --- xc/lib/GL/mesa/src/drv/i810/i810ioctl.c:1.7 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810ioctl.c Sun Sep 28 16:15:11 2003 @@ -1,7 +1,6 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810ioctl.c,v 1.7 2002/10/30 12:51:33 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810ioctl.c,v 1.8 2003/09/28 20:15:11 alanh Exp $ */ -#include -#include +#include /* for usleep() */ #include "glheader.h" #include "mtypes.h" @@ -192,9 +191,43 @@ */ void i810PageFlip( const __DRIdrawablePrivate *dPriv ) { - (void) dPriv; -/* _mesa_problem(NULL, "i810PageFlip should not be called!\n"); */ - return; + i810ContextPtr imesa; + int tmp, ret; + + assert(dPriv); + assert(dPriv->driContextPriv); + assert(dPriv->driContextPriv->driverPrivate); + + imesa = (i810ContextPtr) dPriv->driContextPriv->driverPrivate; + + I810_FIREVERTICES( imesa ); + LOCK_HARDWARE( imesa ); + + if (dPriv->pClipRects) { + *(XF86DRIClipRectRec *)imesa->sarea->boxes = dPriv->pClipRects[0]; + imesa->sarea->nbox = 1; + } + ret = drmCommandNone(imesa->driFd, DRM_I810_FLIP); + if (ret) { + fprintf(stderr, "%s: %d\n", __FUNCTION__, ret); + UNLOCK_HARDWARE( imesa ); + exit(1); + } + + tmp = GET_ENQUEUE_AGE(imesa); + UNLOCK_HARDWARE( imesa ); + + /* multiarb will suck the life out of the server without this throttle: + */ + if (GET_DISPATCH_AGE(imesa) < imesa->lastSwap) { + i810WaitAge(imesa, imesa->lastSwap); + } + + /* i810SetDrawBuffer( imesa->glCtx, imesa->glCtx->Color.DriverDrawBuffer );*/ + i810DrawBuffer( imesa->glCtx, imesa->glCtx->Color.DrawBuffer ); + imesa->upload_cliprects = GL_TRUE; + imesa->lastSwap = tmp; + return; } @@ -321,8 +354,8 @@ static void age_imesa( i810ContextPtr imesa, int age ) { - if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->age = age; - if (imesa->CurrentTexObj[1]) imesa->CurrentTexObj[1]->age = age; + if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->base.timestamp = age; + if (imesa->CurrentTexObj[1]) imesa->CurrentTexObj[1]->base.timestamp = age; } @@ -335,6 +368,9 @@ drmI810Vertex vertex; int i; + if (I810_DEBUG & DEBUG_STATE) + i810PrintDirty( __FUNCTION__, imesa->dirty ); + if (imesa->dirty) emit_state( imesa ); Index: xc/lib/GL/mesa/src/drv/i810/i810render.c diff -u xc/lib/GL/mesa/src/drv/i810/i810render.c:1.2 xc/lib/GL/mesa/src/drv/i810/i810render.c:1.3 --- xc/lib/GL/mesa/src/drv/i810/i810render.c:1.2 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810render.c Sun Sep 28 16:15:12 2003 @@ -34,9 +34,8 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" -#include "mmath.h" #include "tnl/t_context.h" @@ -106,7 +105,7 @@ tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags ); - I810_CONTEXT(ctx)->SetupNewInputs = VERT_CLIP; + I810_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_CLIP; } @@ -151,7 +150,7 @@ return GL_TRUE; } - imesa->SetupNewInputs = VERT_CLIP; + imesa->SetupNewInputs = VERT_BIT_CLIP; tnl->Driver.Render.Start( ctx ); @@ -172,20 +171,20 @@ static void i810_check_render( GLcontext *ctx, struct gl_pipeline_stage *stage ) { - GLuint inputs = VERT_CLIP|VERT_RGBA; + GLuint inputs = VERT_BIT_CLIP | VERT_BIT_COLOR0; if (ctx->RenderMode == GL_RENDER) { if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - inputs |= VERT_SPEC_RGB; + inputs |= VERT_BIT_COLOR1; if (ctx->Texture.Unit[0]._ReallyEnabled) - inputs |= VERT_TEX(0); + inputs |= VERT_BIT_TEX0; if (ctx->Texture.Unit[1]._ReallyEnabled) - inputs |= VERT_TEX(1); + inputs |= VERT_BIT_TEX1; if (ctx->Fog.Enabled) - inputs |= VERT_FOG_COORD; + inputs |= VERT_BIT_FOG; } stage->inputs = inputs; Index: xc/lib/GL/mesa/src/drv/i810/i810screen.c diff -u xc/lib/GL/mesa/src/drv/i810/i810screen.c:1.2 xc/lib/GL/mesa/src/drv/i810/i810screen.c:1.3 --- xc/lib/GL/mesa/src/drv/i810/i810screen.c:1.2 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810screen.c Sun Sep 28 16:15:12 2003 @@ -24,7 +24,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810screen.c,v 1.2 2002/10/30 12:51:33 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810screen.c,v 1.3 2003/09/28 20:15:12 alanh Exp $ */ /* * Authors: @@ -33,9 +33,6 @@ */ -#include -#include - #include "glheader.h" #include "context.h" #include "matrix.h" @@ -90,15 +87,12 @@ i810ScreenPrivate *i810Screen; I810DRIPtr gDRIPriv = (I810DRIPtr)sPriv->pDevPriv; - /* Check the DRI version */ - { - int major, minor, patch; - if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) { - if (major != 4 || minor < 0) { - __driUtilMessage("i810 DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch); - return GL_FALSE; - } - } + /* Check the DRI externsion version */ + if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) { + __driUtilMessage( "i810 DRI driver expected DRI version 4.0.x " + "but got version %d.%d.%d", + sPriv->driMajor, sPriv->driMinor, sPriv->driPatch ); + return GL_FALSE; } /* Check that the DDX driver version is compatible */ @@ -217,8 +211,7 @@ static GLboolean -i810CreateBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, +i810CreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) @@ -245,66 +238,29 @@ } -#if 0 -/* Initialize the fullscreen mode. - */ -GLboolean -XMesaOpenFullScreen( __DRIcontextPrivate *driContextPriv ) -{ - i810ContextPtr imesa = (i810ContextPtr)driContextPriv->driverPrivate; - imesa->doPageFlip = 1; - imesa->currentPage = 0; - return GL_TRUE; -} - -/* Shut down the fullscreen mode. - */ -GLboolean -XMesaCloseFullScreen( __DRIcontextPrivate *driContextPriv ) -{ - i810ContextPtr imesa = (i810ContextPtr)driContextPriv->driverPrivate; - - if (imesa->currentPage == 1) { - /* Move the frontbuffer image to page zero? */ -/* i810SwapBuffers( imesa ); */ - i810PageFlip( imesa ); - imesa->currentPage = 0; - } - - imesa->doPageFlip = GL_FALSE; - imesa->Setup[I810_DESTREG_DI0] = imesa->driScreen->front_offset; - return GL_TRUE; -} - -#else - static GLboolean -i810OpenFullScreen(__DRIcontextPrivate *driContextPriv) +i810OpenCloseFullScreen(__DRIcontextPrivate *driContextPriv) { return GL_TRUE; } -static GLboolean -i810CloseFullScreen(__DRIcontextPrivate *driContextPriv) -{ - return GL_TRUE; -} - -#endif - - -static struct __DriverAPIRec i810API = { - i810InitDriver, - i810DestroyScreen, - i810CreateContext, - i810DestroyContext, - i810CreateBuffer, - i810DestroyBuffer, - i810SwapBuffers, - i810MakeCurrent, - i810UnbindContext, - i810OpenFullScreen, - i810CloseFullScreen +static const struct __DriverAPIRec i810API = { + .InitDriver = i810InitDriver, + .DestroyScreen = i810DestroyScreen, + .CreateContext = i810CreateContext, + .DestroyContext = i810DestroyContext, + .CreateBuffer = i810CreateBuffer, + .DestroyBuffer = i810DestroyBuffer, + .SwapBuffers = i810SwapBuffers, + .MakeCurrent = i810MakeCurrent, + .UnbindContext = i810UnbindContext, + .OpenFullScreen = i810OpenCloseFullScreen, + .CloseFullScreen = i810OpenCloseFullScreen, + .GetSwapInfo = NULL, + .GetMSC = NULL, + .WaitForMSC = NULL, + .WaitForSBC = NULL, + .SwapBuffersMSC = NULL }; Index: xc/lib/GL/mesa/src/drv/i810/i810screen.h diff -u xc/lib/GL/mesa/src/drv/i810/i810screen.h:1.2 xc/lib/GL/mesa/src/drv/i810/i810screen.h:1.3 --- xc/lib/GL/mesa/src/drv/i810/i810screen.h:1.2 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810screen.h Sun Sep 28 16:15:12 2003 @@ -78,7 +78,7 @@ extern GLboolean -i810CreateContext( Display *dpy, const __GLcontextModes *mesaVis, +i810CreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate ); @@ -94,6 +94,6 @@ __DRIdrawablePrivate *driReadPriv); extern void -i810SwapBuffers(Display *dpy, void *drawablePrivate); +i810SwapBuffers(__DRIdrawablePrivate *driDrawPriv); #endif Index: xc/lib/GL/mesa/src/drv/i810/i810span.c diff -u xc/lib/GL/mesa/src/drv/i810/i810span.c:1.5 xc/lib/GL/mesa/src/drv/i810/i810span.c:1.6 --- xc/lib/GL/mesa/src/drv/i810/i810span.c:1.5 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810span.c Sun Sep 28 16:15:12 2003 @@ -1,6 +1,7 @@ #include "glheader.h" #include "macros.h" #include "mtypes.h" +#include "colormac.h" #include "i810screen.h" #include "i810_dri.h" @@ -116,20 +117,35 @@ #include "depthtmp.h" -static void i810SetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum mode ) +/* + * This function is called to specify which buffer to read and write + * for software rasterization (swrast) fallbacks. This doesn't necessarily + * correspond to glDrawBuffer() or glReadBuffer() calls. + */ +static void i810SetBuffer(GLcontext *ctx, GLframebuffer *buffer, + GLuint bufferBit ) { i810ContextPtr imesa = I810_CONTEXT(ctx); + (void) buffer; - if (mode == GL_FRONT_LEFT) { - imesa->readMap = (char *)imesa->driScreen->pFB; - } - else if (mode == GL_BACK_LEFT) { - imesa->readMap = imesa->i810Screen->back.map; - } - else { - ASSERT(0); + switch(bufferBit) { + case FRONT_LEFT_BIT: + if ( imesa->sarea->pf_current_page == 1) + imesa->readMap = imesa->i810Screen->back.map; + else + imesa->readMap = (char*)imesa->driScreen->pFB; + break; + case BACK_LEFT_BIT: + if ( imesa->sarea->pf_current_page == 1) + imesa->readMap = (char*)imesa->driScreen->pFB; + else + imesa->readMap = imesa->i810Screen->back.map; + break; + default: + ASSERT(0); + break; } + imesa->drawMap = imesa->readMap; } @@ -137,7 +153,7 @@ { struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SetReadBuffer = i810SetReadBuffer; + swdd->SetBuffer = i810SetBuffer; swdd->WriteRGBASpan = i810WriteRGBASpan_565; swdd->WriteRGBSpan = i810WriteRGBSpan_565; Index: xc/lib/GL/mesa/src/drv/i810/i810state.c diff -u xc/lib/GL/mesa/src/drv/i810/i810state.c:1.9 xc/lib/GL/mesa/src/drv/i810/i810state.c:1.10 --- xc/lib/GL/mesa/src/drv/i810/i810state.c:1.9 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810state.c Sun Sep 28 16:15:12 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810state.c,v 1.9 2002/10/30 12:51:33 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810state.c,v 1.10 2003/09/28 20:15:12 alanh Exp $ */ #include @@ -7,8 +7,9 @@ #include "macros.h" #include "enums.h" #include "dd.h" +#include "colormac.h" -#include "mm.h" +#include "texmem.h" #include "i810screen.h" #include "i810_dri.h" @@ -31,6 +32,10 @@ GLubyte r, GLubyte g, GLubyte b, GLubyte a) { + + if (I810_DEBUG&DEBUG_DRI) + fprintf(stderr, "%s\n", __FUNCTION__); + switch (format) { case DV_PF_555: return PACK_COLOR_1555( a, r, g, b ); @@ -43,10 +48,13 @@ } -static void i810AlphaFunc(GLcontext *ctx, GLenum func, GLchan ref) +static void i810AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref) { i810ContextPtr imesa = I810_CONTEXT(ctx); GLuint a = (ZA_UPDATE_ALPHAFUNC|ZA_UPDATE_ALPHAREF); + GLubyte refByte; + + CLAMPED_FLOAT_TO_UBYTE(refByte, ref); switch (ctx->Color.AlphaFunc) { case GL_NEVER: a |= ZA_ALPHA_NEVER; break; @@ -60,7 +68,7 @@ default: return; } - a |= ((ref & 0xfc) << ZA_ALPHAREF_SHIFT); + a |= ((refByte & 0xfc) << ZA_ALPHAREF_SHIFT); I810_STATECHANGE(imesa, I810_UPLOAD_CTX); imesa->Setup[I810_CTXREG_ZA] &= ~(ZA_ALPHA_MASK|ZA_ALPHAREF_MASK); @@ -276,45 +284,70 @@ } -static void i810SetDrawBuffer(GLcontext *ctx, GLenum mode ) +void i810DrawBuffer(GLcontext *ctx, GLenum mode ) { i810ContextPtr imesa = I810_CONTEXT(ctx); + int front = 0; + + /* + * _DrawDestMask is easier to cope with than . + */ + switch ( ctx->Color._DrawDestMask ) { + case FRONT_LEFT_BIT: + front=1; + break; + case BACK_LEFT_BIT: + front = 0; + break; + default: + /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ + FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE ); + return; + } + + if ( imesa->sarea->pf_current_page == 1 ) + front ^= 1; + + FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_FALSE ); + I810_FIREVERTICES(imesa); + I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS); - if (mode == GL_FRONT_LEFT) + if (front) { - I810_FIREVERTICES(imesa); - I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS); - imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->fbOffset | - imesa->i810Screen->backPitchBits); - imesa->drawMap = (char *)imesa->driScreen->pFB; - imesa->readMap = (char *)imesa->driScreen->pFB; - i810XMesaSetFrontClipRects( imesa ); - FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_FALSE ); + imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->fbOffset | + imesa->i810Screen->backPitchBits); + i810XMesaSetFrontClipRects( imesa ); } - else if (mode == GL_BACK_LEFT) + else { - I810_FIREVERTICES(imesa); - I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS); - imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->backOffset | - imesa->i810Screen->backPitchBits); - imesa->drawMap = imesa->i810Screen->back.map; - imesa->readMap = imesa->i810Screen->back.map; - i810XMesaSetBackClipRects( imesa ); - FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_FALSE ); - } - else { - FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE ); + imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->backOffset | + imesa->i810Screen->backPitchBits); + i810XMesaSetBackClipRects( imesa ); } + + /* We want to update the s/w rast state too so that r200SetBuffer() + * gets called. + */ + _swrast_DrawBuffer(ctx, mode); } +static void i810ReadBuffer(GLcontext *ctx, GLenum mode ) +{ + /* XXX anything? */ +} + -static void i810ClearColor(GLcontext *ctx, const GLchan color[4] ) +static void i810ClearColor(GLcontext *ctx, const GLfloat color[4] ) { i810ContextPtr imesa = I810_CONTEXT(ctx); + GLubyte c[4]; + CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); imesa->ClearColor = i810PackColor( imesa->i810Screen->fbFormat, - color[0], color[1], - color[2], color[3] ); + c[0], c[1], c[2], c[3] ); } @@ -897,12 +930,14 @@ memset(imesa->BufferSetup, 0, sizeof(imesa->BufferSetup)); imesa->BufferSetup[I810_DESTREG_DI0] = CMD_OP_DESTBUFFER_INFO; - if (imesa->glCtx->Color.DriverDrawBuffer == GL_BACK_LEFT) { + if (imesa->glCtx->Visual.doubleBufferMode && imesa->sarea->pf_current_page == 0) { + /* use back buffer by default */ imesa->drawMap = i810Screen->back.map; imesa->readMap = i810Screen->back.map; imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->backOffset | i810Screen->backPitchBits); } else { + /* use front buffer by default */ imesa->drawMap = (char *)imesa->driScreen->pFB; imesa->readMap = (char *)imesa->driScreen->pFB; imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->fbOffset | @@ -954,7 +989,8 @@ ctx->Driver.PolygonStipple = i810PolygonStipple; ctx->Driver.RenderMode = i810RenderMode; ctx->Driver.Scissor = i810Scissor; - ctx->Driver.SetDrawBuffer = i810SetDrawBuffer; + ctx->Driver.DrawBuffer = i810DrawBuffer; + ctx->Driver.ReadBuffer = i810ReadBuffer; ctx->Driver.ShadeModel = i810ShadeModel; ctx->Driver.DepthRange = i810DepthRange; ctx->Driver.Viewport = i810Viewport; Index: xc/lib/GL/mesa/src/drv/i810/i810state.h diff -u xc/lib/GL/mesa/src/drv/i810/i810state.h:1.3 xc/lib/GL/mesa/src/drv/i810/i810state.h:1.4 --- xc/lib/GL/mesa/src/drv/i810/i810state.h:1.3 Fri Feb 22 16:33:04 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810state.h Sun Sep 28 16:15:12 2003 @@ -6,6 +6,7 @@ extern void i810InitState( GLcontext *ctx ); extern void i810InitStateFuncs( GLcontext *ctx ); extern void i810PrintDirty( const char *msg, GLuint state ); +extern void i810DrawBuffer(GLcontext *ctx, GLenum mode ); extern void i810Fallback( i810ContextPtr imesa, GLuint bit, GLboolean mode ); #define FALLBACK( imesa, bit, mode ) i810Fallback( imesa, bit, mode ) Index: xc/lib/GL/mesa/src/drv/i810/i810tex.c diff -u xc/lib/GL/mesa/src/drv/i810/i810tex.c:1.9 xc/lib/GL/mesa/src/drv/i810/i810tex.c:1.10 --- xc/lib/GL/mesa/src/drv/i810/i810tex.c:1.9 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810tex.c Sun Sep 28 16:15:12 2003 @@ -21,19 +21,18 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tex.c,v 1.9 2002/10/30 12:51:33 alanh Exp $ */ - -#include -#include +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tex.c,v 1.10 2003/09/28 20:15:12 alanh Exp $ */ #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "simple_list.h" #include "enums.h" #include "texstore.h" #include "texformat.h" +#include "texmem.h" #include "swrast/swrast.h" +#include "colormac.h" #include "mm.h" @@ -60,18 +59,40 @@ } -static void i810SetTexWrapping(i810TextureObjectPtr t, - GLenum wraps, GLenum wrapt) +static void i810SetTexWrapping(i810TextureObjectPtr tex, + GLenum swrap, GLenum twrap) { - t->Setup[I810_TEXREG_MCS] &= ~(MCS_U_STATE_MASK| MCS_V_STATE_MASK); - t->Setup[I810_TEXREG_MCS] |= (MCS_U_WRAP|MCS_V_WRAP); - - if (wraps != GL_REPEAT) - t->Setup[I810_TEXREG_MCS] ^= (MCS_U_WRAP^MCS_U_CLAMP); + tex->Setup[I810_TEXREG_MCS] &= ~(MCS_U_STATE_MASK| MCS_V_STATE_MASK); - if (wrapt != GL_REPEAT) - t->Setup[I810_TEXREG_MCS] ^= (MCS_V_WRAP^MCS_V_CLAMP); + switch( swrap ) { + case GL_REPEAT: + tex->Setup[I810_TEXREG_MCS] |= MCS_U_WRAP; + break; + case GL_CLAMP: + case GL_CLAMP_TO_EDGE: + tex->Setup[I810_TEXREG_MCS] |= MCS_U_CLAMP; + break; + case GL_MIRRORED_REPEAT: + tex->Setup[I810_TEXREG_MCS] |= MCS_U_MIRROR; + break; + default: + _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__); + } + switch( twrap ) { + case GL_REPEAT: + tex->Setup[I810_TEXREG_MCS] |= MCS_V_WRAP; + break; + case GL_CLAMP: + case GL_CLAMP_TO_EDGE: + tex->Setup[I810_TEXREG_MCS] |= MCS_V_CLAMP; + break; + case GL_MIRRORED_REPEAT: + tex->Setup[I810_TEXREG_MCS] |= MCS_V_MIRROR; + break; + default: + _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__); + } } @@ -144,6 +165,52 @@ /* Need a fallback. */ } +static i810TextureObjectPtr i810AllocTexObj( GLcontext *ctx, struct gl_texture_object *texObj ) +{ + i810TextureObjectPtr t; + i810ContextPtr imesa = I810_CONTEXT(ctx); + + t = CALLOC_STRUCT( i810_texture_object_t ); + texObj->DriverData = t; + if ( t != NULL ) { + GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias; + /* Initialize non-image-dependent parts of the state: + */ + t->base.tObj = texObj; + t->Setup[I810_TEXREG_MI0] = GFX_OP_MAP_INFO; + t->Setup[I810_TEXREG_MI1] = MI1_MAP_0; + t->Setup[I810_TEXREG_MI2] = MI2_DIMENSIONS_ARE_LOG2; + t->Setup[I810_TEXREG_MLC] = (GFX_OP_MAP_LOD_CTL | + MLC_MAP_0 | + /*MLC_DITHER_WEIGHT_FULL |*/ + MLC_DITHER_WEIGHT_12 | + MLC_UPDATE_LOD_BIAS | + 0x0); + t->Setup[I810_TEXREG_MCS] = (GFX_OP_MAP_COORD_SETS | + MCS_COORD_0 | + MCS_UPDATE_NORMALIZED | + MCS_NORMALIZED_COORDS | + MCS_UPDATE_V_STATE | + MCS_V_WRAP | + MCS_UPDATE_U_STATE | + MCS_U_WRAP); + t->Setup[I810_TEXREG_MF] = (GFX_OP_MAP_FILTER | + MF_MAP_0 | + MF_UPDATE_ANISOTROPIC | + MF_UPDATE_MIP_FILTER | + MF_UPDATE_MAG_FILTER | + MF_UPDATE_MIN_FILTER); + + make_empty_list( & t->base ); + + i810SetTexWrapping( t, texObj->WrapS, texObj->WrapT ); + /*i830SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );*/ + i810SetTexFilter( imesa, t, texObj->MinFilter, texObj->MagFilter, bias ); + i810SetTexBorderColor( t, texObj->_BorderChan ); + } + + return t; +} static void i810TexParameter( GLcontext *ctx, GLenum target, @@ -179,7 +246,7 @@ break; case GL_TEXTURE_BORDER_COLOR: - i810SetTexBorderColor( t, tObj->BorderColor ); + i810SetTexBorderColor( t, tObj->_BorderChan ); break; case GL_TEXTURE_BASE_LEVEL: @@ -191,7 +258,8 @@ * we just have to rely on loading the right subset of mipmap levels * to simulate a clamped LOD. */ - i810SwapOutTexObj( imesa, t ); + I810_FIREVERTICES( I810_CONTEXT(ctx) ); + driSwapOutTextureObject( (driTextureObject *) t ); break; default: @@ -256,6 +324,8 @@ } } + + #if 0 static void i810TexImage1D( GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, @@ -295,13 +365,22 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - i810TextureObjectPtr t = (i810TextureObjectPtr) texObj->DriverData; + driTextureObject *t = (driTextureObject *) texObj->DriverData; if (t) { - i810SwapOutTexObj( I810_CONTEXT(ctx), t ); + I810_FIREVERTICES( I810_CONTEXT(ctx) ); + driSwapOutTextureObject( t ); + } + else { + t = (driTextureObject *) i810AllocTexObj( ctx, texObj ); + if (!t) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); + return; + } } _mesa_store_teximage2d( ctx, target, level, internalFormat, width, height, border, format, type, pixels, packing, texObj, texImage ); + } static void i810TexSubImage2D( GLcontext *ctx, @@ -315,9 +394,11 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - i810TextureObjectPtr t = (i810TextureObjectPtr) texObj->DriverData; + driTextureObject *t = (driTextureObject *)texObj->DriverData; + if (t) { - i810SwapOutTexObj( I810_CONTEXT(ctx), t ); + I810_FIREVERTICES( I810_CONTEXT(ctx) ); + driSwapOutTextureObject( t ); } _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels, packing, texObj, @@ -329,78 +410,116 @@ static void i810BindTexture( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj ) { - if (target == GL_TEXTURE_2D) { - i810ContextPtr imesa = I810_CONTEXT( ctx ); - i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData; - - if (!t) { - GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias; - t = CALLOC_STRUCT(i810_texture_object_t); - - /* Initialize non-image-dependent parts of the state: - */ - t->globj = tObj; - t->Setup[I810_TEXREG_MI0] = GFX_OP_MAP_INFO; - t->Setup[I810_TEXREG_MI1] = MI1_MAP_0; - t->Setup[I810_TEXREG_MI2] = MI2_DIMENSIONS_ARE_LOG2; - t->Setup[I810_TEXREG_MLC] = (GFX_OP_MAP_LOD_CTL | - MLC_MAP_0 | - /*MLC_DITHER_WEIGHT_FULL |*/ - MLC_DITHER_WEIGHT_12 | - MLC_UPDATE_LOD_BIAS | - 0x0); - t->Setup[I810_TEXREG_MCS] = (GFX_OP_MAP_COORD_SETS | - MCS_COORD_0 | - MCS_UPDATE_NORMALIZED | - MCS_NORMALIZED_COORDS | - MCS_UPDATE_V_STATE | - MCS_V_WRAP | - MCS_UPDATE_U_STATE | - MCS_U_WRAP); - t->Setup[I810_TEXREG_MF] = (GFX_OP_MAP_FILTER | - MF_MAP_0 | - MF_UPDATE_ANISOTROPIC | - MF_UPDATE_MIP_FILTER | - MF_UPDATE_MAG_FILTER | - MF_UPDATE_MIN_FILTER); - - t->dirty_images = ~0; - - tObj->DriverData = t; - make_empty_list( t ); - - i810SetTexWrapping( t, tObj->WrapS, tObj->WrapT ); - i810SetTexFilter( imesa, t, tObj->MinFilter, tObj->MagFilter, bias ); - i810SetTexBorderColor( t, tObj->BorderColor ); - } - } + if (!tObj->DriverData) { + i810AllocTexObj( ctx, tObj ); + } } static void i810DeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) { - i810TextureObjectPtr t = (i810TextureObjectPtr)tObj->DriverData; - + driTextureObject * t = (driTextureObject *) tObj->DriverData; if (t) { i810ContextPtr imesa = I810_CONTEXT( ctx ); if (imesa) I810_FIREVERTICES( imesa ); - i810DestroyTexObj( imesa, t ); - tObj->DriverData = 0; + driDestroyTextureObject( t ); } } -static GLboolean i810IsTextureResident( GLcontext *ctx, - struct gl_texture_object *tObj ) -{ - i810TextureObjectPtr t = (i810TextureObjectPtr)tObj->DriverData; - return t && t->MemBlock; +static const struct gl_texture_format * +i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, + GLenum format, GLenum type ) +{ + switch ( internalFormat ) { + case 4: + case GL_RGBA: + case GL_COMPRESSED_RGBA: + if ( format == GL_BGRA ) { + if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) { + return &_mesa_texformat_argb1555; + } + } + return &_mesa_texformat_argb4444; + + case 3: + case GL_RGB: + case GL_COMPRESSED_RGB: + case GL_R3_G3_B2: + case GL_RGB4: + case GL_RGB5: + case GL_RGB8: + case GL_RGB10: + case GL_RGB12: + case GL_RGB16: + return &_mesa_texformat_rgb565; + + case GL_RGBA2: + case GL_RGBA4: + case GL_RGBA8: + case GL_RGB10_A2: + case GL_RGBA12: + case GL_RGBA16: + return &_mesa_texformat_argb4444; + + case GL_RGB5_A1: + return &_mesa_texformat_argb1555; + + case GL_ALPHA: + case GL_ALPHA4: + case GL_ALPHA8: + case GL_ALPHA12: + case GL_ALPHA16: + case GL_COMPRESSED_ALPHA: + return &_mesa_texformat_al88; + + case 1: + case GL_LUMINANCE: + case GL_LUMINANCE4: + case GL_LUMINANCE8: + case GL_LUMINANCE12: + case GL_LUMINANCE16: + case GL_COMPRESSED_LUMINANCE: + return &_mesa_texformat_rgb565; + + case 2: + case GL_LUMINANCE_ALPHA: + case GL_LUMINANCE4_ALPHA4: + case GL_LUMINANCE6_ALPHA2: + case GL_LUMINANCE8_ALPHA8: + case GL_LUMINANCE12_ALPHA4: + case GL_LUMINANCE12_ALPHA12: + case GL_LUMINANCE16_ALPHA16: + case GL_COMPRESSED_LUMINANCE_ALPHA: + case GL_INTENSITY: + case GL_INTENSITY4: + case GL_INTENSITY8: + case GL_INTENSITY12: + case GL_INTENSITY16: + case GL_COMPRESSED_INTENSITY: + return &_mesa_texformat_argb4444; + + case GL_YCBCR_MESA: + if (type == GL_UNSIGNED_SHORT_8_8_MESA || + type == GL_UNSIGNED_BYTE) + return &_mesa_texformat_ycbcr; + else + return &_mesa_texformat_ycbcr_rev; + + default: + fprintf(stderr, "unexpected texture format in %s\n", __FUNCTION__); + return NULL; + } + + return NULL; /* never get here */ } void i810InitTextureFuncs( GLcontext *ctx ) { + i810ContextPtr imesa = I810_CONTEXT(ctx); + ctx->Driver.TexEnv = i810TexEnv; - ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; + ctx->Driver.ChooseTextureFormat = i810ChooseTextureFormat; ctx->Driver.TexImage1D = _mesa_store_teximage1d; ctx->Driver.TexImage2D = i810TexImage2D; ctx->Driver.TexImage3D = _mesa_store_teximage3d; @@ -416,15 +535,9 @@ ctx->Driver.DeleteTexture = i810DeleteTexture; ctx->Driver.TexParameter = i810TexParameter; ctx->Driver.UpdateTexturePalette = 0; - ctx->Driver.IsTextureResident = i810IsTextureResident; + ctx->Driver.IsTextureResident = driIsTextureResident; ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - { - GLuint tmp = ctx->Texture.CurrentUnit; - ctx->Texture.CurrentUnit = 0; - i810BindTexture( ctx, GL_TEXTURE_2D, ctx->Texture.Unit[0].Current2D); - ctx->Texture.CurrentUnit = 1; - i810BindTexture( ctx, GL_TEXTURE_2D, ctx->Texture.Unit[1].Current2D); - ctx->Texture.CurrentUnit = tmp; - } + driInitTextureObjects( ctx, &imesa->swapped, DRI_TEXMGR_DO_TEXTURE_2D); + } Index: xc/lib/GL/mesa/src/drv/i810/i810tex.h diff -u xc/lib/GL/mesa/src/drv/i810/i810tex.h:1.3 xc/lib/GL/mesa/src/drv/i810/i810tex.h:1.4 --- xc/lib/GL/mesa/src/drv/i810/i810tex.h:1.3 Fri Feb 22 16:33:04 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810tex.h Sun Sep 28 16:15:12 2003 @@ -27,16 +27,13 @@ #define I810TEX_INC #include "mtypes.h" -#include "mmath.h" #include "mm.h" #include "i810context.h" #include "i810_3d_reg.h" +#include "texmem.h" - -#define I810_TEX_MAXLEVELS 10 - - +#define I810_TEX_MAXLEVELS 11 /* For shared texture space managment, these texture objects may also * be used as proxies for regions of texture memory containing other @@ -51,21 +48,14 @@ * 't->globj == 0' */ struct i810_texture_object_t { - struct i810_texture_object_t *next, *prev; - - GLuint age; - struct gl_texture_object *globj; + driTextureObject base; int Pitch; int Height; int texelBytes; - int totalSize; - - PMemBlock MemBlock; char *BufAddr; GLuint max_level; - GLuint dirty_images; struct { const struct gl_texture_image *image; @@ -77,25 +67,12 @@ GLuint Setup[I810_TEX_SETUP_SIZE]; GLuint dirty; - GLint firstLevel, lastLevel; /* upload tObj->Image[first .. lastLevel] */ }; void i810UpdateTextureState( GLcontext *ctx ); void i810InitTextureFuncs( GLcontext *ctx ); void i810DestroyTexObj( i810ContextPtr imesa, i810TextureObjectPtr t ); -void i810SwapOutTexObj( i810ContextPtr imesa, i810TextureObjectPtr t ); -void i810UploadTexImages( i810ContextPtr imesa, i810TextureObjectPtr t ); - -void i810ResetGlobalLRU( i810ContextPtr imesa ); -void i810TexturesGone( i810ContextPtr imesa, - GLuint start, GLuint end, - GLuint in_use ); - -void i810PrintLocalLRU( i810ContextPtr imesa ); -void i810PrintGlobalLRU( i810ContextPtr imesa ); -void i810UpdateTexLRU( i810ContextPtr imesa, i810TextureObjectPtr t ); - - +int i810UploadTexImagesLocked( i810ContextPtr imesa, i810TextureObjectPtr t ); #endif Index: xc/lib/GL/mesa/src/drv/i810/i810texmem.c diff -u xc/lib/GL/mesa/src/drv/i810/i810texmem.c:1.2 xc/lib/GL/mesa/src/drv/i810/i810texmem.c:1.4 --- xc/lib/GL/mesa/src/drv/i810/i810texmem.c:1.2 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810texmem.c Tue Nov 4 10:32:40 2003 @@ -1,6 +1,7 @@ /* * GLX Hardware Device Driver for Intel i810 * Copyright (C) 1999 Keith Whitwell + * Texmem interface changes (C) 2003 Dave Airlie * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -21,17 +22,16 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ - -#include -#include +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810texmem.c,v 1.4 2003/11/04 15:32:40 tsi Exp $ */ #include "glheader.h" #include "macros.h" #include "mtypes.h" #include "simple_list.h" #include "enums.h" - +#include "colormac.h" #include "mm.h" +#include "texformat.h" #include "i810screen.h" #include "i810_dri.h" @@ -44,371 +44,141 @@ void i810DestroyTexObj(i810ContextPtr imesa, i810TextureObjectPtr t) { - if (!t) return; - - /* This is sad - need to sync *in case* we upload a texture - * to this newly free memory... + /* See if it was the driver's current object. */ - if (t->MemBlock) { - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (imesa && t->age > imesa->dirtyAge) - imesa->dirtyAge = t->age; - } - - if (t->globj) - t->globj->DriverData = 0; - - if (imesa) { - if (imesa->CurrentTexObj[0] == t) { - imesa->CurrentTexObj[0] = 0; - imesa->dirty &= ~I810_UPLOAD_TEX0; - } - - if (imesa->CurrentTexObj[1] == t) { - imesa->CurrentTexObj[1] = 0; - imesa->dirty &= ~I810_UPLOAD_TEX1; - } + if ( imesa != NULL ) { + if (imesa->CurrentTexObj[0] == t) { + imesa->CurrentTexObj[0] = 0; + imesa->dirty &= ~I810_UPLOAD_TEX0; + } + + if (imesa->CurrentTexObj[1] == t) { + imesa->CurrentTexObj[1] = 0; + imesa->dirty &= ~I810_UPLOAD_TEX1; + } } - - remove_from_list(t); - free(t); } -void i810SwapOutTexObj(i810ContextPtr imesa, i810TextureObjectPtr t) -{ -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - - if (t->MemBlock) { - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (t->age > imesa->dirtyAge) - imesa->dirtyAge = t->age; - } - - t->dirty_images = ~0; - move_to_tail(&(imesa->SwappedOut), t); -} - +#if defined(i386) || defined(__i386__) +/* From linux kernel i386 header files, copes with odd sizes better + * than COPY_DWORDS would: + */ +static __inline__ void * __memcpy(void * to, const void * from, size_t n) +{ +int d0, d1, d2; +__asm__ __volatile__( + "rep ; movsl\n\t" + "testb $2,%b4\n\t" + "je 1f\n\t" + "movsw\n" + "1:\ttestb $1,%b4\n\t" + "je 2f\n\t" + "movsb\n" + "2:" + : "=&c" (d0), "=&D" (d1), "=&S" (d2) + :"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from) + : "memory"); +return (to); +} +#else +/* Allow compilation on other architectures */ +#define __memcpy memcpy +#endif /* Upload an image from mesa's internal copy. */ -static void i810UploadTexLevel( i810TextureObjectPtr t, int level ) +static void i810UploadTexLevel( i810ContextPtr imesa, + i810TextureObjectPtr t, int hwlevel ) { - const struct gl_texture_image *image = t->image[level].image; - int i,j; - - switch (t->image[level].internalFormat) { - case GL_RGB: - { - GLushort *dst = (GLushort *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; - - for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = PACK_COLOR_565( src[0], src[1], src[2] ); - src += 3; - } - } - } - break; + const struct gl_texture_image *image = t->image[hwlevel].image; + int j; - case GL_RGBA: - { - GLushort *dst = (GLushort *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; - - for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = PACK_COLOR_4444( src[3], src[0], src[1], src[2] ); - src += 4; - } - } - } - break; + if (!image || !image->Data) + return; - case GL_LUMINANCE: - { - GLushort *dst = (GLushort *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; - - for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = PACK_COLOR_565( src[0], src[0], src[0] ); - src ++; - } - } - } - break; - - case GL_INTENSITY: - { - GLushort *dst = (GLushort *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; - int i; - - for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = PACK_COLOR_4444( src[0], src[0], src[0], src[0] ); - src ++; - } - } - } - break; - - case GL_LUMINANCE_ALPHA: - { - GLushort *dst = (GLushort *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; - - for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = PACK_COLOR_4444( src[1], src[0], src[0], src[0] ); - src += 2; - } - } + if (image->Width * image->TexFormat->TexelBytes == t->Pitch) { + GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset); + GLubyte *src = (GLubyte *)image->Data; + + memcpy( dst, src, t->Pitch * image->Height ); } - break; + else switch (image->TexFormat->TexelBytes) { + case 1: + { + GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset); + GLubyte *src = (GLubyte *)image->Data; - case GL_ALPHA: - { - GLushort *dst = (GLushort *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; - - for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = PACK_COLOR_4444( src[0], 255, 255, 255 ); - src += 1; + for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) { + __memcpy(dst, src, image->Width ); + src += image->Width; } } - } - break; + break; - /* TODO: Translate color indices *now*: - */ - case GL_COLOR_INDEX: + case 2: { - GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; + GLushort *dst = (GLushort *)(t->BufAddr + t->image[hwlevel].offset); + GLushort *src = (GLushort *)image->Data; - for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = src[0]; - src += 1; - } + for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { + __memcpy(dst, src, image->Width * 2 ); + src += image->Width; } } - break; + break; default: - fprintf(stderr, "Not supported texture format %s\n", - _mesa_lookup_enum_by_nr(image->Format)); - } -} - - - -void i810PrintLocalLRU( i810ContextPtr imesa ) -{ - i810TextureObjectPtr t; - int sz = 1 << (imesa->i810Screen->logTextureGranularity); - - foreach( t, &imesa->TexObjList ) { - if (!t->globj) - fprintf(stderr, "Placeholder %d at %x sz %x\n", - t->MemBlock->ofs / sz, - t->MemBlock->ofs, - t->MemBlock->size); - else - fprintf(stderr, "Texture at %x sz %x\n", - t->MemBlock->ofs, - t->MemBlock->size); - - } -} - -void i810PrintGlobalLRU( i810ContextPtr imesa ) -{ - int i, j; - I810TexRegionRec *list = imesa->sarea->texList; - - for (i = 0, j = I810_NR_TEX_REGIONS ; i < I810_NR_TEX_REGIONS ; i++) { - fprintf(stderr, "list[%d] age %d next %d prev %d\n", - j, list[j].age, list[j].next, list[j].prev); - j = list[j].next; - if (j == I810_NR_TEX_REGIONS) break; - } - - if (j != I810_NR_TEX_REGIONS) - fprintf(stderr, "Loop detected in global LRU\n"); -} - - -void i810ResetGlobalLRU( i810ContextPtr imesa ) -{ - I810TexRegionRec *list = imesa->sarea->texList; - int sz = 1 << imesa->i810Screen->logTextureGranularity; - int i; - - /* (Re)initialize the global circular LRU list. The last element - * in the array (I810_NR_TEX_REGIONS) is the sentinal. Keeping it - * at the end of the array allows it to be addressed rationally - * when looking up objects at a particular location in texture - * memory. - */ - for (i = 0 ; (i+1) * sz <= imesa->i810Screen->textureSize ; i++) { - list[i].prev = i-1; - list[i].next = i+1; - list[i].age = 0; - } - - i--; - list[0].prev = I810_NR_TEX_REGIONS; - list[i].prev = i-1; - list[i].next = I810_NR_TEX_REGIONS; - list[I810_NR_TEX_REGIONS].prev = i; - list[I810_NR_TEX_REGIONS].next = 0; - imesa->sarea->texAge = 0; -} - - -void i810UpdateTexLRU( i810ContextPtr imesa, i810TextureObjectPtr t ) -{ - int i; - int logsz = imesa->i810Screen->logTextureGranularity; - int start = t->MemBlock->ofs >> logsz; - int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz; - I810TexRegionRec *list = imesa->sarea->texList; - - imesa->texAge = ++imesa->sarea->texAge; - - /* Update our local LRU - */ - move_to_head( &(imesa->TexObjList), t ); - - /* Update the global LRU - */ - for (i = start ; i <= end ; i++) { - - list[i].in_use = 1; - list[i].age = imesa->texAge; - - /* remove_from_list(i) - */ - list[(unsigned)list[i].next].prev = list[i].prev; - list[(unsigned)list[i].prev].next = list[i].next; - - /* insert_at_head(list, i) - */ - list[i].prev = I810_NR_TEX_REGIONS; - list[i].next = list[I810_NR_TEX_REGIONS].next; - list[(unsigned)list[I810_NR_TEX_REGIONS].next].prev = i; - list[I810_NR_TEX_REGIONS].next = i; + fprintf(stderr, "%s: Not supported texel size %d\n", + __FUNCTION__, image->TexFormat->TexelBytes); } } - -/* Called for every shared texture region which has increased in age - * since we last held the lock. - * - * Figures out which of our textures have been ejected by other clients, - * and pushes a placeholder texture onto the LRU list to represent - * the other client's textures. - */ -void i810TexturesGone( i810ContextPtr imesa, - GLuint offset, - GLuint size, - GLuint in_use ) -{ - i810TextureObjectPtr t, tmp; - - foreach_s ( t, tmp, &imesa->TexObjList ) { - - if (t->MemBlock->ofs >= offset + size || - t->MemBlock->ofs + t->MemBlock->size <= offset) - continue; - - /* It overlaps - kick it off. Need to hold onto the currently bound - * objects, however. - */ - i810SwapOutTexObj( imesa, t ); - } - - if (in_use) { - t = (i810TextureObjectPtr) calloc(1,sizeof(*t)); - if (!t) return; - - t->MemBlock = mmAllocMem( imesa->texHeap, size, 0, offset); - insert_at_head( &imesa->TexObjList, t ); - } -} - - - - - /* This is called with the lock held. May have to eject our own and/or * other client's texture objects to make room for the upload. */ -void i810UploadTexImages( i810ContextPtr imesa, i810TextureObjectPtr t ) +int i810UploadTexImagesLocked( i810ContextPtr imesa, i810TextureObjectPtr t ) { int i; int ofs; int numLevels; - LOCK_HARDWARE( imesa ); - /* Do we need to eject LRU texture objects? */ - if (!t->MemBlock) { - while (1) - { - t->MemBlock = mmAllocMem( imesa->texHeap, t->totalSize, 12, 0 ); - if (t->MemBlock) - break; - - if (imesa->TexObjList.prev == imesa->CurrentTexObj[0] || - imesa->TexObjList.prev == imesa->CurrentTexObj[1]) { - fprintf(stderr, "Hit bound texture in upload\n"); - i810PrintLocalLRU( imesa ); - return; - } - - if (imesa->TexObjList.prev == &(imesa->TexObjList)) { - fprintf(stderr, "Failed to upload texture, sz %d\n", t->totalSize); - mmDumpMemInfo( imesa->texHeap ); - return; - } - - i810SwapOutTexObj( imesa, imesa->TexObjList.prev ); + if (!t->base.memBlock) { + int heap; + + heap = driAllocateTexture( imesa->texture_heaps, imesa->nr_heaps, + (driTextureObject *) t); + + if ( heap == -1 ) { + return -1; } - - ofs = t->MemBlock->ofs; + + ofs = t->base.memBlock->ofs; t->BufAddr = imesa->i810Screen->tex.map + ofs; t->Setup[I810_TEXREG_MI3] = imesa->i810Screen->textureOffset + ofs; - + if (t == imesa->CurrentTexObj[0]) - I810_STATECHANGE(imesa, I810_UPLOAD_TEX0); - + I810_STATECHANGE(imesa, I810_UPLOAD_TEX0); + if (t == imesa->CurrentTexObj[1]) I810_STATECHANGE(imesa, I810_UPLOAD_TEX1); + + /* i810UpdateTexLRU( imesa, t );*/ + } + driUpdateTextureLRU( (driTextureObject *) t ); + + if (imesa->texture_heaps[0]->timestamp >= GET_DISPATCH_AGE(imesa)) + i810WaitAgeLocked( imesa, imesa->texture_heaps[0]->timestamp ); - i810UpdateTexLRU( imesa, t ); - } - - if (imesa->dirtyAge >= GET_DISPATCH_AGE(imesa)) - i810WaitAgeLocked( imesa, imesa->dirtyAge ); - - numLevels = t->lastLevel - t->firstLevel + 1; + numLevels = t->base.lastLevel - t->base.firstLevel + 1; for (i = 0 ; i < numLevels ; i++) - if (t->dirty_images & (1<base.dirty_images[0] & (1<dirty_images = 0; + t->base.dirty_images[0] = 0; - UNLOCK_HARDWARE( imesa ); -} + return 0; +} Index: xc/lib/GL/mesa/src/drv/i810/i810texstate.c diff -u xc/lib/GL/mesa/src/drv/i810/i810texstate.c:1.2 xc/lib/GL/mesa/src/drv/i810/i810texstate.c:1.4 --- xc/lib/GL/mesa/src/drv/i810/i810texstate.c:1.2 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810texstate.c Tue Dec 2 08:02:37 2003 @@ -22,9 +22,6 @@ * */ -#include -#include - #include "glheader.h" #include "macros.h" #include "mtypes.h" @@ -50,7 +47,7 @@ GLuint height, width, pitch, i, textureFormat, log_pitch; i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData; const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel]; - GLint firstLevel, lastLevel, numLevels; + GLint numLevels; GLint log2Width, log2Height; /* fprintf(stderr, "%s\n", __FUNCTION__); */ @@ -72,43 +69,29 @@ textureFormat = MI1_FMT_8CI | MI1_PF_8CI_ARGB4444; t->texelBytes = 1; break; + case GL_YCBCR_MESA: + t->texelBytes = 2; + textureFormat = MI1_FMT_422 | MI1_PF_422_YCRCB_SWAP_Y + | MI1_COLOR_CONV_ENABLE; + break; + default: fprintf(stderr, "i810SetTexImages: bad image->Format\n" ); return; } - /* Compute which mipmap levels we really want to send to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. - * Yes, this looks overly complicated, but it's all needed. - */ - if (tObj->MinFilter == GL_LINEAR || tObj->MinFilter == GL_NEAREST) { - firstLevel = lastLevel = tObj->BaseLevel; - } - else { - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ - } - - /* save these values */ - t->firstLevel = firstLevel; - t->lastLevel = lastLevel; + driCalculateTextureFirstLastLevel( (driTextureObject *) t ); - numLevels = lastLevel - firstLevel + 1; + numLevels = t->base.lastLevel - t->base.firstLevel + 1; - log2Width = tObj->Image[firstLevel]->WidthLog2; - log2Height = tObj->Image[firstLevel]->HeightLog2; + log2Width = tObj->Image[t->base.firstLevel]->WidthLog2; + log2Height = tObj->Image[t->base.firstLevel]->HeightLog2; /* Figure out the amount of memory required to hold all the mipmap * levels. Choose the smallest pitch to accomodate the largest * mipmap: */ - width = tObj->Image[firstLevel]->Width * t->texelBytes; + width = tObj->Image[t->base.firstLevel]->Width * t->texelBytes; for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 ) log_pitch++; @@ -116,14 +99,14 @@ * lines required: */ for ( height = i = 0 ; i < numLevels ; i++ ) { - t->image[i].image = tObj->Image[firstLevel + i]; + t->image[i].image = tObj->Image[t->base.firstLevel + i]; t->image[i].offset = height * pitch; t->image[i].internalFormat = baseImage->Format; height += t->image[i].image->Height; } t->Pitch = pitch; - t->totalSize = height*pitch; + t->base.totalSize = height*pitch; t->max_level = i-1; t->dirty = I810_UPLOAD_TEX0 | I810_UPLOAD_TEX1; t->Setup[I810_TEXREG_MI1] = (MI1_MAP_0 | textureFormat | log_pitch); @@ -135,7 +118,9 @@ MLL_UPDATE_MIN_MIP | ((numLevels - 1) << MLL_MIN_MIP_SHIFT)); - i810UploadTexImages( imesa, t ); + LOCK_HARDWARE( imesa ); + i810UploadTexImagesLocked( imesa, t ); + UNLOCK_HARDWARE( imesa ); } /* ================================================================ @@ -691,17 +676,17 @@ i810ContextPtr imesa = I810_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - if (texUnit->_ReallyEnabled == TEXTURE0_2D) + if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) { struct gl_texture_object *tObj = texUnit->_Current; i810TextureObjectPtr t = (i810TextureObjectPtr)tObj->DriverData; /* Upload teximages (not pipelined) */ - if (t->dirty_images) { + if (t->base.dirty_images[0]) { I810_FIREVERTICES(imesa); i810SetTexImages( imesa, tObj ); - if (!t->MemBlock) { + if (!t->base.memBlock) { FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE ); return; } @@ -718,7 +703,10 @@ if (imesa->CurrentTexObj[unit] != t) { I810_STATECHANGE(imesa, (I810_UPLOAD_TEX0<CurrentTexObj[unit] = t; - i810UpdateTexLRU( imesa, t ); /* done too often */ + t->base.bound |= (1U << unit); + + driUpdateTextureLRU( (driTextureObject *) t ); /* XXX: should be locked */ + } /* Update texture environment if texture object image format or Index: xc/lib/GL/mesa/src/drv/i810/i810tris.c diff -u xc/lib/GL/mesa/src/drv/i810/i810tris.c:1.7 xc/lib/GL/mesa/src/drv/i810/i810tris.c:1.8 --- xc/lib/GL/mesa/src/drv/i810/i810tris.c:1.7 Wed Oct 30 07:51:33 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810tris.c Sun Sep 28 16:15:12 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tris.c,v 1.7 2002/10/30 12:51:33 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tris.c,v 1.8 2003/09/28 20:15:12 alanh Exp $ */ /************************************************************************** Copyright 2001 VA Linux Systems Inc., Fremont, California. @@ -31,12 +31,10 @@ * Keith Whitwell */ -#include -#include - #include "glheader.h" #include "mtypes.h" #include "macros.h" +#include "enums.h" #include "colormac.h" #include "swrast/swrast.h" @@ -553,6 +551,9 @@ GLuint flags = ctx->_TriangleCaps; GLuint index = 0; + if (I810_DEBUG & DEBUG_STATE) + fprintf(stderr,"\n%s\n",__FUNCTION__); + if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) { if (flags & ANY_RASTER_FLAGS) { if (flags & DD_TRI_LIGHT_TWOSIDE) index |= I810_TWOSIDE_BIT; @@ -704,6 +705,39 @@ st1 &= ~ST1_ENABLE; aa &= ~AA_ENABLE; + if (I810_DEBUG & DEBUG_PRIMS) { + /* Prints reduced prim, and hw prim */ + char *prim_name = "Unknown"; + + switch(hwprim) { + case PR_LINES: + prim_name = "Lines"; + break; + case PR_LINESTRIP: + prim_name = "LineStrip"; + break; + case PR_TRIANGLES: + prim_name = "Triangles"; + break; + case PR_TRISTRIP_0: + prim_name = "TriStrip_0"; + break; + case PR_TRIFAN: + prim_name = "TriFan"; + break; + case PR_POLYGON: + prim_name = "Polygons"; + break; + default: + break; + } + + fprintf(stderr, "%s : rprim(%s), hwprim(%s)\n", + __FUNCTION__, + _mesa_lookup_enum_by_nr(rprim), + prim_name); + } + switch (rprim) { case GL_TRIANGLES: if (ctx->Polygon.StippleFlag) @@ -752,7 +786,27 @@ /**********************************************************************/ /* Transition to/from hardware rasterization. */ /**********************************************************************/ +static char *fallbackStrings[] = { + "Texture", + "Draw buffer", + "Read buffer", + "Color mask", + "Render mode", + "Stencil", + "Stipple", + "User disable" +}; + +static char *getFallbackString(GLuint bit) +{ + int i = 0; + while (bit > 1) { + i++; + bit >>= 1; + } + return fallbackStrings[i]; +} void i810Fallback( i810ContextPtr imesa, GLuint bit, GLboolean mode ) { @@ -766,8 +820,9 @@ if (mode) { imesa->Fallback |= bit; if (oldfallback == 0) { - if (0) fprintf(stderr, "ENTER FALLBACK\n"); I810_FIREVERTICES(imesa); + if (I810_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "ENTER FALLBACK %s\n", getFallbackString( bit )); _swsetup_Wakeup( ctx ); imesa->RenderIndex = ~0; } @@ -775,8 +830,9 @@ else { imesa->Fallback &= ~bit; if (oldfallback == bit) { - if (0) fprintf(stderr, "LEAVE FALLBACK\n"); _swrast_flush( ctx ); + if (I810_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "LEAVE FALLBACK %s\n", getFallbackString( bit )); tnl->Driver.Render.Start = i810RenderStart; tnl->Driver.Render.PrimitiveNotify = i810RenderPrimitive; tnl->Driver.Render.Finish = i810RenderFinish; Index: xc/lib/GL/mesa/src/drv/i810/i810vb.c diff -u xc/lib/GL/mesa/src/drv/i810/i810vb.c:1.12 xc/lib/GL/mesa/src/drv/i810/i810vb.c:1.14 --- xc/lib/GL/mesa/src/drv/i810/i810vb.c:1.12 Wed Oct 30 07:51:34 2002 +++ xc/lib/GL/mesa/src/drv/i810/i810vb.c Sun Sep 28 16:15:12 2003 @@ -22,14 +22,14 @@ * * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810vb.c,v 1.12 2002/10/30 12:51:34 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810vb.c,v 1.14 2003/09/28 20:15:12 alanh Exp $ */ + #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "colormac.h" -#include "mmath.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" @@ -360,6 +360,9 @@ tnl->Driver.Render.Interp = setup_tab[imesa->SetupIndex].interp; tnl->Driver.Render.CopyPV = setup_tab[imesa->SetupIndex].copy_pv; } + if (imesa->Fallback) { + tnl->Driver.Render.Start(ctx); + } } } @@ -380,24 +383,24 @@ if (!newinputs) return; - if (newinputs & VERT_CLIP) { + if (newinputs & VERT_BIT_CLIP) { setup_tab[imesa->SetupIndex].emit( ctx, start, count, v, stride ); } else { GLuint ind = 0; - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) ind |= I810_RGBA_BIT; - if (newinputs & VERT_SPEC_RGB) + if (newinputs & VERT_BIT_COLOR1) ind |= I810_SPEC_BIT; - if (newinputs & VERT_TEX0) + if (newinputs & VERT_BIT_TEX0) ind |= I810_TEX0_BIT; - if (newinputs & VERT_TEX1) + if (newinputs & VERT_BIT_TEX1) ind |= I810_TEX1_BIT; - if (newinputs & VERT_FOG_COORD) + if (newinputs & VERT_BIT_FOG) ind |= I810_FOG_BIT; if (imesa->SetupIndex & I810_PTEX_BIT) @@ -423,13 +426,18 @@ if (ctx->Fog.Enabled) ind |= I810_FOG_BIT; - if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY) + if (ctx->Texture._EnabledUnits & 0x2) + /* unit 1 enabled */ ind |= I810_TEX1_BIT|I810_TEX0_BIT; - else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) + else if (ctx->Texture._EnabledUnits & 0x1) + /* unit 0 enabled */ ind |= I810_TEX0_BIT; imesa->SetupIndex = ind; + if (I810_DEBUG & (DEBUG_VERTS|DEBUG_STATE)) + i810PrintSetupFlags( __FUNCTION__, ind ); + if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { tnl->Driver.Render.Interp = i810_interp_extras; tnl->Driver.Render.CopyPV = i810_copy_pv_extras; @@ -465,7 +473,7 @@ i810ContextPtr imesa = I810_CONTEXT(ctx); GLuint size = TNL_CONTEXT(ctx)->vb.Size; - imesa->verts = (char *)ALIGN_MALLOC(size * 4 * 16, 32); + imesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32); { static int firsttime = 1; Index: xc/lib/GL/mesa/src/drv/i830/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/i830/Imakefile.inc:1.2 xc/lib/GL/mesa/src/drv/i830/Imakefile.inc:1.3 --- xc/lib/GL/mesa/src/drv/i830/Imakefile.inc:1.2 Mon Sep 9 15:18:47 2002 +++ xc/lib/GL/mesa/src/drv/i830/Imakefile.inc Tue May 27 12:34:33 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i830/Imakefile.inc,v 1.2 2002/09/09 19:18:47 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i830/Imakefile.inc,v 1.3 2003/05/27 16:34:33 tsi Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ Index: xc/lib/GL/mesa/src/drv/i830/i830_3d_reg.h diff -u xc/lib/GL/mesa/src/drv/i830/i830_3d_reg.h:1.4 xc/lib/GL/mesa/src/drv/i830/i830_3d_reg.h:1.5 --- xc/lib/GL/mesa/src/drv/i830/i830_3d_reg.h:1.4 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_3d_reg.h Sun Sep 28 16:15:13 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_3d_reg.h,v 1.4 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_3d_reg.h,v 1.5 2003/09/28 20:15:13 alanh Exp $ */ #define I830_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value) #define CMD_3D (0x3<<29) @@ -254,9 +254,10 @@ #define TEXOP_OUTPUT_ACCUM (1<<15) #define ENABLE_TEX_CNTRL_STAGE ((1<<12)|(1<<11)) #define DISABLE_TEX_CNTRL_STAGE (1<<12) -#define TEXOP_SCALE_1X 0 -#define TEXOP_SCALE_2X (1<<9) -#define TEXOP_SCALE_4X (2<<9) +#define TEXOP_SCALE_SHIFT 9 +#define TEXOP_SCALE_1X (0 << TEXOP_SCALE_SHIFT) +#define TEXOP_SCALE_2X (1 << TEXOP_SCALE_SHIFT) +#define TEXOP_SCALE_4X (2 << TEXOP_SCALE_SHIFT) #define TEXOP_MODIFY_PARMS (1<<8) #define TEXOP_LAST_STAGE (1<<7) #define TEXBLENDOP_KILLPIXEL 0x02 @@ -324,8 +325,13 @@ #define TEXCOORD_ADDR_U_MASK 0x7 /* STATE3D_MAP_CUBE, p168 TODO */ - - +#define STATE3D_MAP_CUBE (CMD_3D|(0x1c<<24)|(0x0a<<19)) +#define CUBE_NEGX_ENABLE (1<<5) +#define CUBE_POSX_ENABLE (1<<4) +#define CUBE_NEGY_ENABLE (1<<3) +#define CUBE_POSY_ENABLE (1<<2) +#define CUBE_NEGZ_ENABLE (1<<1) +#define CUBE_POSZ_ENABLE (1<<0) /* STATE3D_MODES_1, p190 */ @@ -421,10 +427,11 @@ #define LOGICOP_OR_RVRSE 0xd #define LOGICOP_OR 0xe #define LOGICOP_SET 0xf -#define MODE4_ENABLE_STENCIL_MASK ((1<<17)|(1<<16)|(0xffff)) +#define MODE4_ENABLE_STENCIL_TEST_MASK ((1<<17)|(0xff00)) #define ENABLE_STENCIL_TEST_MASK (1<<17) -#define ENABLE_STENCIL_WRITE_MASK (1<<16) #define STENCIL_TEST_MASK(x) ((x)<<8) +#define MODE4_ENABLE_STENCIL_WRITE_MASK ((1<<16)|(0x00ff)) +#define ENABLE_STENCIL_WRITE_MASK (1<<16) #define STENCIL_WRITE_MASK(x) (x) /* STATE3D_MODES_5, p196 */ @@ -503,15 +510,6 @@ #define VRTX_HAS_XY (3<<1) #define VRTX_HAS_XYW (4<<1) -/* grantham - POINT_WIDTH for later implementation of GL_EXT_point_parameters; - need to uncomment point_width in vb.h and add point copy to SETUPFUNC */ -#define VRTX_FORMAT_NTEX(n) (STATE3D_VERTEX_FORMAT_CMD | \ - VRTX_TEX_COORD_COUNT(n) | \ - VRTX_HAS_SPEC | \ - /* VRTX_HAS_POINT_WIDTH | */ \ - VRTX_HAS_DIFFUSE | \ - VRTX_HAS_XYZW) - /* STATE3D_VERTEX_FORMAT_2, p206 */ #define STATE3D_VERTEX_FORMAT_2_CMD (CMD_3D|(0x0a<<24)) #define VRTX_TEX_SET_7_FMT(x) ((x)<<14) Index: xc/lib/GL/mesa/src/drv/i830/i830_context.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_context.c:1.9 xc/lib/GL/mesa/src/drv/i830/i830_context.c:1.11 --- xc/lib/GL/mesa/src/drv/i830/i830_context.c:1.9 Wed Feb 5 23:18:00 2003 +++ xc/lib/GL/mesa/src/drv/i830/i830_context.c Mon Dec 8 17:45:30 2003 @@ -24,7 +24,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_context.c,v 1.9 2003/02/06 04:18:00 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_context.c,v 1.11 2003/12/08 22:45:30 alanh Exp $ */ /* * Authors: @@ -41,7 +41,7 @@ #include "matrix.h" #include "simple_list.h" #include "extensions.h" -#include "mem.h" +#include "imports.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -60,10 +60,8 @@ #include "i830_vb.h" #include "i830_ioctl.h" -#include -#include - +#include "utils.h" #ifndef I830_DEBUG int I830_DEBUG = (0); #endif @@ -76,57 +74,44 @@ static const GLubyte *i830DDGetString( GLcontext *ctx, GLenum name ) { - switch (I830_CONTEXT(ctx)->i830Screen->deviceID) { - case PCI_CHIP_845_G: - switch (name) { - case GL_VENDOR: + const char * chipset; + static char buffer[128]; + + switch (name) { + case GL_VENDOR: + switch (I830_CONTEXT(ctx)->i830Screen->deviceID) { + case PCI_CHIP_845_G: return (GLubyte *)"2d3D, Inc"; - case GL_RENDERER: - return (GLubyte *)"Mesa DRI Intel(R) 845G " DRIVER_DATE; - default: - return 0; - } - break; - case PCI_CHIP_I830_M: - switch (name) { - case GL_VENDOR: + + case PCI_CHIP_I830_M: return (GLubyte *)"VA Linux, Inc"; - case GL_RENDERER: - return (GLubyte *)"Mesa DRI Intel(R) 830M " DRIVER_DATE; + + case PCI_CHIP_I855_GM: + case PCI_CHIP_I865_G: default: - return 0; - } - break; - case PCI_CHIP_I855_GM: - switch (name) { - case GL_VENDOR: return (GLubyte *)"Tungsten Graphics, Inc"; - case GL_RENDERER: - return (GLubyte *)"Mesa DRI Intel(R) 852GM/855GM " DRIVER_DATE; - default: - return 0; } break; - case PCI_CHIP_I865_G: - switch (name) { - case GL_VENDOR: - return (GLubyte *)"Tungsten Graphics, Inc"; - case GL_RENDERER: - return (GLubyte *)"Mesa DRI Intel(R) 865G " DRIVER_DATE; + + case GL_RENDERER: + switch (I830_CONTEXT(ctx)->i830Screen->deviceID) { + case PCI_CHIP_845_G: + chipset = "Intel(R) 845G"; break; + case PCI_CHIP_I830_M: + chipset = "Intel(R) 830M"; break; + case PCI_CHIP_I855_GM: + chipset = "Intel(R) 852GM/855GM"; break; + case PCI_CHIP_I865_G: + chipset = "Intel(R) 865G"; break; default: - return 0; + chipset = "Unknown Intel Chipset"; break; } - break; + + (void) driGetRendererString( buffer, chipset, DRIVER_DATE, 0 ); + return (GLubyte *) buffer; + default: - switch (name) { - case GL_VENDOR: - return (GLubyte *)"Tungsten Graphics, Inc"; - case GL_RENDERER: - return (GLubyte *)"Mesa DRI Unknown Intel Chipset " DRIVER_DATE; - default: - return 0; - } - break; + return NULL; } } @@ -145,28 +130,42 @@ UNLOCK_HARDWARE(imesa); } -/* Enable all the extensions we need */ -static void i830InitExtensions( GLcontext *ctx ) + +/* Extension strings exported by the i830 driver. + */ +static const char * const card_extensions[] = { - _mesa_enable_imaging_extensions( ctx ); - _mesa_enable_extension( ctx, "GL_ARB_multitexture" ); - _mesa_enable_extension( ctx, "GL_ARB_texture_env_add" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_env_add" ); - _mesa_enable_extension( ctx, "GL_ARB_texture_env_combine" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_env_combine" ); - _mesa_enable_extension( ctx, "GL_EXT_blend_color" ); - _mesa_enable_extension( ctx, "GL_EXT_blend_minmax" ); - _mesa_enable_extension( ctx, "GL_EXT_blend_subtract" ); - _mesa_enable_extension( ctx, "GL_EXT_blend_func_separate" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_lod_bias" ); - _mesa_enable_extension( ctx, "GL_EXT_secondary_color" ); - _mesa_enable_extension( ctx, "GL_EXT_fog_coord" ); + "GL_ARB_multisample", + "GL_ARB_multitexture", + "GL_ARB_texture_border_clamp", + "GL_ARB_texture_compression", + "GL_ARB_texture_env_add", + "GL_ARB_texture_env_combine", + "GL_ARB_texture_env_dot3", + "GL_ARB_texture_mirrored_repeat", + "GL_EXT_blend_color", + "GL_EXT_blend_func_separate", + "GL_EXT_blend_minmax", + "GL_EXT_blend_subtract", + "GL_EXT_fog_coord", + "GL_EXT_secondary_color", + "GL_EXT_stencil_wrap", + "GL_EXT_texture_edge_clamp", + "GL_EXT_texture_env_add", + "GL_EXT_texture_env_combine", + "GL_EXT_texture_env_dot3", + "GL_EXT_texture_filter_anisotropic", + "GL_EXT_texture_lod_bias", + "GL_IBM_texture_mirrored_repeat", + "GL_INGR_blend_func_separate", + "GL_MESA_ycbcr_texture", + "GL_NV_texture_rectangle", + "GL_SGIS_generate_mipmap", + "GL_SGIS_texture_border_clamp", + "GL_SGIS_texture_edge_clamp", + NULL +}; - /* Leave this for later */ -#if 0 - _mesa_enable_extension( ctx, "GL_EXT_stencil_wrap" ); -#endif -} extern const struct gl_pipeline_stage _i830_render_stage; @@ -186,57 +185,34 @@ }; -#if DO_DEBUG -static void add_debug_flags( const char *debug ) +static const struct dri_debug_control debug_control[] = { - if (strstr(debug, "fall")) - I830_DEBUG |= DEBUG_FALLBACKS; - - if (strstr(debug, "tex")) - I830_DEBUG |= DEBUG_TEXTURE; - - if (strstr(debug, "ioctl")) - I830_DEBUG |= DEBUG_IOCTL; - - if (strstr(debug, "prim")) - I830_DEBUG |= DEBUG_PRIMS; - - if (strstr(debug, "vert")) - I830_DEBUG |= DEBUG_VERTS; - - if (strstr(debug, "state")) - I830_DEBUG |= DEBUG_STATE; - - if (strstr(debug, "verb")) - I830_DEBUG |= DEBUG_VERBOSE; - - if (strstr(debug, "dri")) - I830_DEBUG |= DEBUG_DRI; - - if (strstr(debug, "dma")) - I830_DEBUG |= DEBUG_DMA; - - if (strstr(debug, "san")) - I830_DEBUG |= DEBUG_SANITY; - - if (strstr(debug, "sync")) - I830_DEBUG |= DEBUG_SYNC; + { "fall", DEBUG_FALLBACKS }, + { "tex", DEBUG_TEXTURE }, + { "ioctl", DEBUG_IOCTL }, + { "prim", DEBUG_PRIMS }, + { "vert", DEBUG_VERTS }, + { "state", DEBUG_STATE }, + { "verb", DEBUG_VERBOSE }, + { "dri", DEBUG_DRI }, + { "dma", DEBUG_DMA }, + { "san", DEBUG_SANITY }, + { "sync", DEBUG_SYNC }, + { "sleep", DEBUG_SLEEP }, + { NULL, 0 } +}; - if (strstr(debug, "sleep")) - I830_DEBUG |= DEBUG_SLEEP; -} -#endif -GLboolean i830CreateContext( Display *dpy, const __GLcontextModes *mesaVis, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate) +GLboolean i830CreateContext( const __GLcontextModes *mesaVis, + __DRIcontextPrivate *driContextPriv, + void *sharedContextPrivate) { GLcontext *ctx , *shareCtx; i830ContextPtr imesa; __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - i830ScreenPrivate *i830Screen = (i830ScreenPrivate *)sPriv->private; + i830ScreenPrivate *screen = (i830ScreenPrivate *)sPriv->private; I830SAREAPtr saPriv=(I830SAREAPtr) - (((GLubyte *)sPriv->pSAREA)+i830Screen->sarea_priv_offset); + (((GLubyte *)sPriv->pSAREA)+screen->sarea_priv_offset); /* Allocate i830 context */ imesa = (i830ContextPtr) CALLOC_STRUCT(i830_context_t); @@ -247,28 +223,59 @@ shareCtx = ((i830ContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - - imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, imesa, GL_TRUE); + imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void*) imesa, GL_TRUE); if (!imesa->glCtx) { FREE(imesa); return GL_FALSE; } driContextPriv->driverPrivate = imesa; - /* Set the maximum texture size small enough that we can guarentee + + imesa->i830Screen = screen; + imesa->driScreen = sPriv; + imesa->sarea = saPriv; + imesa->glBuffer = NULL; + + + (void) memset( imesa->texture_heaps, 0, sizeof( imesa->texture_heaps ) ); + make_empty_list( & imesa->swapped ); + + imesa->nr_heaps = 1; + imesa->texture_heaps[0] = driCreateTextureHeap( 0, imesa, + screen->textureSize, + 12, + I830_NR_TEX_REGIONS, + imesa->sarea->texList, + & imesa->sarea->texAge, + & imesa->swapped, + sizeof( struct i830_texture_object_t ), + (destroy_texture_object_t *) i830DestroyTexObj ); + + + /* Set the maximum texture size small enough that we can guarantee * that both texture units can bind a maximal texture and have them * in memory at once. */ + ctx = imesa->glCtx; - if (i830Screen->textureSize < 2*1024*1024) { - ctx->Const.MaxTextureLevels = 9; - } else if (i830Screen->textureSize < 8*1024*1024) { - ctx->Const.MaxTextureLevels = 10; - } else { - ctx->Const.MaxTextureLevels = 11; - } ctx->Const.MaxTextureUnits = 2; + /* FIXME: driCalcualteMaxTextureLevels assumes that mipmaps are tightly + * FIXME: packed, but they're not in Intel graphics hardware. + */ + driCalculateMaxTextureLevels( imesa->texture_heaps, + imesa->nr_heaps, + & ctx->Const, + 4, + 11, /* max 2D texture size is 2048x2048 */ + 0, /* 3D textures unsupported */ + 0, /* cube textures unsupported. */ + 0, /* texture rectangles unsupported. */ + 12, + GL_FALSE ); + + ctx->Const.MaxTextureMaxAnisotropy = 2.0; + ctx->Const.MinLineWidth = 1.0; ctx->Const.MinLineWidthAA = 1.0; ctx->Const.MaxLineWidth = 3.0; @@ -304,7 +311,6 @@ _swrast_allow_vertex_fog( ctx, GL_TRUE ); /* Dri stuff */ - imesa->display = dpy; imesa->hHWContext = driContextPriv->hHWContext; imesa->driFd = sPriv->fd; imesa->driHwLock = &sPriv->pSAREA->lock; @@ -331,23 +337,14 @@ /* Completely disable stenciling for now, there are some serious issues * with stencil. */ -#if 1 +#if 0 imesa->hw_stencil = 0; #endif - imesa->i830Screen = i830Screen; - imesa->driScreen = sPriv; - imesa->sarea = saPriv; - imesa->glBuffer = NULL; - - imesa->texHeap = mmInit( 0, i830Screen->textureSize ); imesa->RenderIndex = ~0; imesa->dirty = ~0; imesa->upload_cliprects = GL_TRUE; - make_empty_list(&imesa->TexObjList); - make_empty_list(&imesa->SwappedOut); - imesa->CurrentTexObj[0] = 0; imesa->CurrentTexObj[1] = 0; @@ -356,7 +353,7 @@ _math_matrix_ctr (&imesa->ViewportMatrix); - i830InitExtensions (ctx); + driInitExtensions( ctx, card_extensions, GL_TRUE ); i830DDInitStateFuncs( ctx ); i830DDInitTextureFuncs( ctx ); i830InitTriFuncs (ctx); @@ -366,10 +363,10 @@ i830DDInitState (ctx); #if DO_DEBUG - if (getenv("INTEL_DEBUG")) - add_debug_flags( getenv("INTEL_DEBUG") ); - if (getenv("I830_DEBUG")) - add_debug_flags( getenv("I830_DEBUG") ); + I830_DEBUG = driParseDebugString( getenv( "I830_DEBUG" ), + debug_control ); + I830_DEBUG |= driParseDebugString( getenv( "INTEL_DEBUG" ), + debug_control ); #endif if (getenv("I830_NO_RAST") || @@ -388,6 +385,10 @@ assert(imesa); /* should never be null */ if (imesa) { + GLboolean release_texture_heaps; + + + release_texture_heaps = (imesa->glCtx->Shared->RefCount == 1); _swsetup_DestroyContext (imesa->glCtx); _tnl_DestroyContext (imesa->glCtx); _ac_DestroyContext (imesa->glCtx); @@ -399,6 +400,20 @@ imesa->glCtx->DriverCtx = NULL; _mesa_destroy_context(imesa->glCtx); + if ( release_texture_heaps ) { + /* This share group is about to go away, free our private + * texture object data. + */ + int i; + + for ( i = 0 ; i < imesa->nr_heaps ; i++ ) { + driDestroyTextureHeap( imesa->texture_heaps[ i ] ); + imesa->texture_heaps[ i ] = NULL; + } + + assert( is_empty_list( & imesa->swapped ) ); + } + Xfree (imesa); } } @@ -438,15 +453,16 @@ static void i830XMesaWindowMoved( i830ContextPtr imesa ) { - switch (imesa->glCtx->Color.DriverDrawBuffer) { - case GL_FRONT_LEFT: + switch (imesa->glCtx->Color._DrawDestMask) { + case FRONT_LEFT_BIT: i830XMesaSetFrontClipRects( imesa ); break; - case GL_BACK_LEFT: + case BACK_LEFT_BIT: i830XMesaSetBackClipRects( imesa ); break; default: - break; + /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */ + i830XMesaSetFrontClipRects( imesa ); } } @@ -495,47 +511,13 @@ return GL_TRUE; } -/* Turn on/off page flipping according to the flags in the sarea: - */ -static void -i830UpdatePageFlipping( i830ContextPtr imesa ) -{ - GLcontext *ctx = imesa->glCtx; - int front = 0; - - switch (ctx->Color.DriverDrawBuffer) { - case GL_FRONT_LEFT: - front = 1; - break; - case GL_BACK_LEFT: - front = 0; - break; - default: - return; - } - - if ( imesa->sarea->pf_current_page == 1 ) - front ^= 1; - - if (front) { - imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->fbOffset; - imesa->drawMap = (char *)imesa->driScreen->pFB; - imesa->readMap = (char *)imesa->driScreen->pFB; - } else { - imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->backOffset; - imesa->drawMap = imesa->i830Screen->back.map; - imesa->readMap = imesa->i830Screen->back.map; - } - - imesa->dirty |= I830_UPLOAD_BUFFERS; -} - void i830GetLock( i830ContextPtr imesa, GLuint flags ) { __DRIdrawablePrivate *dPriv = imesa->driDrawable; __DRIscreenPrivate *sPriv = imesa->driScreen; I830SAREAPtr sarea = imesa->sarea; int me = imesa->hHWContext; + unsigned i; drmGetLock(imesa->driFd, imesa->hHWContext, flags); @@ -544,7 +526,7 @@ * NOTE: This releases and regains the hw lock, so all state * checking must be done *after* this call: */ - DRI_VALIDATE_DRAWABLE_INFO(imesa->display, sPriv, dPriv); + DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv); /* If we lost context, need to dump all registers to hardware. * Note that we don't care about 2d contexts, even if they perform @@ -571,30 +553,12 @@ * texture space, figure out which if any of our textures have been * ejected, and update our global LRU. */ - if (sarea->texAge != imesa->texAge) { - int sz = 1 << (imesa->i830Screen->logTextureGranularity); - int idx, nr = 0; - - /* Have to go right round from the back to ensure stuff ends up - * LRU in our local list... - */ - for (idx = sarea->texList[I830_NR_TEX_REGIONS].prev ; - idx != I830_NR_TEX_REGIONS && nr < I830_NR_TEX_REGIONS ; - idx = sarea->texList[idx].prev, nr++) { - if (sarea->texList[idx].age > imesa->texAge) - i830TexturesGone(imesa, idx * sz, sz, sarea->texList[idx].in_use); - } - if (nr == I830_NR_TEX_REGIONS) { - i830TexturesGone(imesa, 0, imesa->i830Screen->textureSize, 0); - i830ResetGlobalLRU( imesa ); - } - - imesa->texAge = sarea->texAge; + for ( i = 0 ; i < imesa->nr_heaps ; i++ ) { + DRI_AGE_TEXTURES( imesa->texture_heaps[ i ] ); } if (imesa->lastStamp != dPriv->lastStamp) { - i830UpdatePageFlipping( imesa ); i830XMesaWindowMoved( imesa ); imesa->lastStamp = dPriv->lastStamp; } @@ -602,20 +566,16 @@ sarea->last_quiescent = -1; /* just kill it for now */ } -void i830SwapBuffers(Display *dpy, void *drawablePrivate) +void i830SwapBuffers( __DRIdrawablePrivate *dPriv ) { - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { i830ContextPtr imesa; GLcontext *ctx; imesa = (i830ContextPtr) dPriv->driContextPriv->driverPrivate; ctx = imesa->glCtx; if (ctx->Visual.doubleBufferMode) { - /* flush pending rendering comands */ - _mesa_swapbuffers( ctx ); - if ( imesa->sarea->pf_active && - (dPriv->w * dPriv->h * imesa->i830Screen->cpp) > (300*300*4) ) { + _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ + if ( 0 /*imesa->doPageFlip*/ ) { /* doPageFlip is never set !!! */ i830PageFlip( dPriv ); } else { i830CopyBuffer( dPriv ); @@ -623,6 +583,6 @@ } } else { /* XXX this shouldn't be an error but we can't handle it for now */ - _mesa_problem(NULL, "i830SwapBuffers: drawable has no context!\n"); + _mesa_problem(NULL, "%s: drawable has no context!\n", __FUNCTION__); } } Index: xc/lib/GL/mesa/src/drv/i830/i830_context.h diff -u xc/lib/GL/mesa/src/drv/i830/i830_context.h:1.7 xc/lib/GL/mesa/src/drv/i830/i830_context.h:1.8 --- xc/lib/GL/mesa/src/drv/i830/i830_context.h:1.7 Wed Feb 5 23:18:01 2003 +++ xc/lib/GL/mesa/src/drv/i830/i830_context.h Sun Sep 28 16:15:13 2003 @@ -25,7 +25,7 @@ /* Adapted for use in the I830M driver: * Jeff Hartmann */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_context.h,v 1.7 2003/02/06 04:18:01 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_context.h,v 1.8 2003/09/28 20:15:13 alanh Exp $ */ #ifndef I830CONTEXT_INC #define I830CONTEXT_INC @@ -86,6 +86,7 @@ GLuint Init_TexBlendColorPipeNum[I830_TEXBLEND_COUNT]; GLuint TexBlendColorPipeNum[I830_TEXBLEND_COUNT]; GLuint Init_BufferSetup[I830_DEST_SETUP_SIZE]; + GLuint LodBias[2]; GLenum palette_format; GLuint palette[256]; @@ -100,10 +101,10 @@ GLboolean mask_blue; GLboolean mask_alpha; - GLboolean clear_red; - GLboolean clear_green; - GLboolean clear_blue; - GLboolean clear_alpha; + GLubyte clear_red; + GLubyte clear_green; + GLubyte clear_blue; + GLubyte clear_alpha; GLfloat depth_scale; int depth_clear_mask; @@ -116,16 +117,18 @@ GLuint LastTexEnabled; GLuint TexEnabledMask; - /* Textures + /* Texture object bookkeeping */ - i830TextureObjectPtr CurrentTexObj[2]; - struct i830_texture_object_t TexObjList; - struct i830_texture_object_t SwappedOut; - memHeap_t *texHeap; + unsigned nr_heaps; + driTexHeap * texture_heaps[1]; + driTextureObject swapped; - /* Bit flag to keep track of fallbacks. + struct i830_texture_object_t *CurrentTexObj[2]; + + /* Rasterization and vertex state: */ GLuint Fallback; + GLuint NewGLState; /* Temporaries for translating away float colors: */ @@ -134,7 +137,6 @@ /* State for i830vb.c and i830tris.c. */ - GLuint new_state; /* _NEW_* flags */ GLuint SetupNewInputs; GLuint SetupIndex; GLuint RenderIndex; @@ -212,7 +214,6 @@ drmContext hHWContext; drmLock *driHwLock; int driFd; - Display *display; __DRIdrawablePrivate *driDrawable; __DRIscreenPrivate *driScreen; Index: xc/lib/GL/mesa/src/drv/i830/i830_debug.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_debug.c:1.3 xc/lib/GL/mesa/src/drv/i830/i830_debug.c:1.4 --- xc/lib/GL/mesa/src/drv/i830/i830_debug.c:1.3 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_debug.c Sun Sep 28 16:15:13 2003 @@ -25,14 +25,12 @@ **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_debug.c,v 1.3 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_debug.c,v 1.4 2003/09/28 20:15:13 alanh Exp $ */ /* * Author: * Jeff Hartmann */ -#include -#include #include "glheader.h" #include "context.h" @@ -154,15 +152,15 @@ if(t) { fprintf(stderr, "%s : unit %d\n", __FUNCTION__, unit); - fprintf(stderr, "MI0 : 0x%08x\n", t->Setup[I830_TEXREG_MI0]); - fprintf(stderr, "MI1 : 0x%08x\n", t->Setup[I830_TEXREG_MI1]); - fprintf(stderr, "MI2 : 0x%08x\n", t->Setup[I830_TEXREG_MI2]); - fprintf(stderr, "MI3 : 0x%08x\n", t->Setup[I830_TEXREG_MI3]); - fprintf(stderr, "MI4 : 0x%08x\n", t->Setup[I830_TEXREG_MI4]); - fprintf(stderr, "MI5 : 0x%08x\n", t->Setup[I830_TEXREG_MI5]); - fprintf(stderr, "MF : 0x%08x\n", t->Setup[I830_TEXREG_MF]); - fprintf(stderr, "MLC : 0x%08x\n", t->Setup[I830_TEXREG_MLC]); - fprintf(stderr, "MLL : 0x%08x\n", t->Setup[I830_TEXREG_MLL]); + fprintf(stderr, "TM0LI : 0x%08x\n", t->Setup[I830_TEXREG_TM0LI]); + fprintf(stderr, "TM0S0 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S0]); + fprintf(stderr, "TM0S1 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S1]); + fprintf(stderr, "TM0S2 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S2]); + fprintf(stderr, "TM0S3 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S3]); + fprintf(stderr, "TM0S4 : 0x%08x\n", t->Setup[I830_TEXREG_TM0S4]); + fprintf(stderr, "NOP0 : 0x%08x\n", t->Setup[I830_TEXREG_NOP0]); + fprintf(stderr, "NOP1 : 0x%08x\n", t->Setup[I830_TEXREG_NOP1]); + fprintf(stderr, "NOP2 : 0x%08x\n", t->Setup[I830_TEXREG_NOP2]); fprintf(stderr, "MCS : 0x%08x\n", t->Setup[I830_TEXREG_MCS]); } } @@ -229,7 +227,6 @@ "internal state\n"); fprintf(stderr, "Buffer size : %d\n", size); fprintf(stderr, "Vertex size : %d\n", vfmt_size); - sleep(10); } switch(sarea->vertex_prim) { @@ -293,7 +290,6 @@ fprintf(stderr, "temp_size : %d\n", temp_size); fprintf(stderr, "remaining vertices : %d", remaining / vfmt_size); - sleep(10); } } if (1) { @@ -308,11 +304,11 @@ int i; if ((imesa->dirty & I830_UPLOAD_TEX0_IMAGE) && imesa->CurrentTexObj[0]) { - i830UploadTexImages(imesa, imesa->CurrentTexObj[0]); + i830UploadTexImagesLocked(imesa, imesa->CurrentTexObj[0]); } if ((imesa->dirty & I830_UPLOAD_TEX1_IMAGE) && imesa->CurrentTexObj[1]) { - i830UploadTexImages(imesa, imesa->CurrentTexObj[1]); + i830UploadTexImagesLocked(imesa, imesa->CurrentTexObj[1]); } if (imesa->dirty & I830_UPLOAD_CTX) { Index: xc/lib/GL/mesa/src/drv/i830/i830_debug.h diff -u xc/lib/GL/mesa/src/drv/i830/i830_debug.h:1.3 xc/lib/GL/mesa/src/drv/i830/i830_debug.h:1.4 --- xc/lib/GL/mesa/src/drv/i830/i830_debug.h:1.3 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_debug.h Sun Sep 28 16:15:14 2003 @@ -25,7 +25,7 @@ **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_debug.h,v 1.3 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_debug.h,v 1.4 2003/09/28 20:15:14 alanh Exp $ */ /* * Author: @@ -38,10 +38,10 @@ void i830DumpContextState( i830ContextPtr imesa ); +void i830DumpStippleState( i830ContextPtr imesa ); void i830DumpBufferState( i830ContextPtr imesa ); void i830DumpTextureState( i830ContextPtr imesa, int unit ); void i830DumpTextureBlendState( i830ContextPtr imesa, int unit ); -void i830DumpStippleState( i830ContextPtr imesa ); void i830VertexSanity( i830ContextPtr imesa, drmI830Vertex vertex ); void i830EmitHwStateLockedDebug( i830ContextPtr imesa ); Index: xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c:1.5 xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c:1.6 --- xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c:1.5 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c Sun Sep 28 16:15:14 2003 @@ -26,7 +26,7 @@ **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c,v 1.5 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_ioctl.c,v 1.6 2003/09/28 20:15:14 alanh Exp $ */ /* * Author: @@ -149,7 +149,7 @@ GLuint old_dirty; int x0, y0, x1, y1; - if (I830_DEBUG & DEBUG_IOCTL) + if (I830_DEBUG & DEBUG_IOCTL) fprintf(stderr, "Clearing with triangles\n"); old_dirty = imesa->dirty & ~I830_UPLOAD_CLIPRECTS; @@ -243,8 +243,8 @@ imesa->clear_blue, imesa->clear_alpha); i830ClearDrawQuad(imesa, (float)x0, (float)x1, (float)y0, (float)y1, - imesa->clear_red, imesa->clear_green, - imesa->clear_blue, imesa->clear_alpha); + imesa->clear_red, imesa->clear_green, + imesa->clear_blue, imesa->clear_alpha); i830FlushPrimsLocked( imesa ); } @@ -312,7 +312,7 @@ } if(mask & DD_STENCIL_BIT) { - GLuint s_mask = ctx->Stencil.WriteMask; + GLuint s_mask = ctx->Stencil.WriteMask[0]; sarea->dirty |= (I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS | I830_UPLOAD_TEXBLEND0); @@ -352,31 +352,36 @@ ENABLE_DEPTH_WRITE | ENABLE_COLOR_WRITE); - sarea->ContextState[I830_CTXREG_ENABLES_2] |= (ENABLE_STENCIL_WRITE | - DISABLE_DEPTH_WRITE | - (1 << WRITEMASK_RED_SHIFT) | - (1 << WRITEMASK_GREEN_SHIFT) | - (1 << WRITEMASK_BLUE_SHIFT) | - (1 << WRITEMASK_ALPHA_SHIFT) | - ENABLE_COLOR_WRITE); - - sarea->ContextState[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_MASK; - sarea->ContextState[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK | - ENABLE_STENCIL_WRITE_MASK | - STENCIL_TEST_MASK(s_mask) | - STENCIL_WRITE_MASK(s_mask)); - - sarea->ContextState[I830_CTXREG_STENCILTST] &= ~(STENCIL_OPS_MASK | - STENCIL_REF_VALUE_MASK | - ENABLE_STENCIL_TEST_FUNC_MASK); - sarea->ContextState[I830_CTXREG_STENCILTST] |= (ENABLE_STENCIL_PARMS | - ENABLE_STENCIL_REF_VALUE | - ENABLE_STENCIL_TEST_FUNC | - STENCIL_FAIL_OP(STENCILOP_REPLACE) | - STENCIL_PASS_DEPTH_FAIL_OP(STENCILOP_REPLACE) | - STENCIL_PASS_DEPTH_PASS_OP(STENCILOP_REPLACE) | - STENCIL_REF_VALUE((ctx->Stencil.Clear & 0xff)) | - STENCIL_TEST_FUNC(COMPAREFUNC_ALWAYS)); + sarea->ContextState[I830_CTXREG_ENABLES_2] |= + (ENABLE_STENCIL_WRITE | + DISABLE_DEPTH_WRITE | + (1 << WRITEMASK_RED_SHIFT) | + (1 << WRITEMASK_GREEN_SHIFT) | + (1 << WRITEMASK_BLUE_SHIFT) | + (1 << WRITEMASK_ALPHA_SHIFT) | + ENABLE_COLOR_WRITE); + + sarea->ContextState[I830_CTXREG_STATE4] &= + ~MODE4_ENABLE_STENCIL_WRITE_MASK; + + sarea->ContextState[I830_CTXREG_STATE4] |= + (ENABLE_STENCIL_WRITE_MASK | + STENCIL_WRITE_MASK(s_mask)); + + sarea->ContextState[I830_CTXREG_STENCILTST] &= + ~(STENCIL_OPS_MASK | + STENCIL_REF_VALUE_MASK | + ENABLE_STENCIL_TEST_FUNC_MASK); + + sarea->ContextState[I830_CTXREG_STENCILTST] |= + (ENABLE_STENCIL_PARMS | + ENABLE_STENCIL_REF_VALUE | + ENABLE_STENCIL_TEST_FUNC | + STENCIL_FAIL_OP(STENCILOP_REPLACE) | + STENCIL_PASS_DEPTH_FAIL_OP(STENCILOP_REPLACE) | + STENCIL_PASS_DEPTH_PASS_OP(STENCILOP_REPLACE) | + STENCIL_REF_VALUE((ctx->Stencil.Clear & 0xff)) | + STENCIL_TEST_FUNC(COMPAREFUNC_ALWAYS)); if(0) fprintf(stderr, "Enables_1 (0x%x) Enables_2 (0x%x) StenTst (0x%x)\n" @@ -454,12 +459,12 @@ } if((mask & DD_STENCIL_BIT) && imesa->hw_stencil) { - if (ctx->Stencil.WriteMask != 0xff) { + if (ctx->Stencil.WriteMask[0] != 0xff) { tri_mask |= DD_STENCIL_BIT; } else { clear.flags |= I830_DEPTH; clear.clear_depthmask |= imesa->stencil_clear_mask; - clear.clear_depth |= imesa->stencil_clear_mask; + clear.clear_depth |= (ctx->Stencil.Clear & 0xff) << 24; } mask &= ~DD_STENCIL_BIT; } @@ -467,8 +472,6 @@ /* First check for clears that need to happen with triangles */ if(tri_mask) { i830ClearWithTris(ctx, tri_mask, all, cx, cy, cw, ch); - } else { - mask |= tri_mask; } if (clear.flags) { @@ -577,6 +580,7 @@ */ void i830PageFlip( const __DRIdrawablePrivate *dPriv ) { +#if 0 i830ContextPtr imesa; int tmp, ret; @@ -619,6 +623,7 @@ i830SetDrawBuffer( imesa->glCtx, imesa->glCtx->Color.DriverDrawBuffer ); imesa->upload_cliprects = GL_TRUE; imesa->lastSwap = tmp; +#endif } /* This waits for *everybody* to finish rendering -- overkill. @@ -691,8 +696,8 @@ static void age_imesa( i830ContextPtr imesa, int age ) { - if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->age = age; - if (imesa->CurrentTexObj[1]) imesa->CurrentTexObj[1]->age = age; + if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->base.timestamp = age; + if (imesa->CurrentTexObj[1]) imesa->CurrentTexObj[1]->base.timestamp = age; } void i830FlushPrimsLocked( i830ContextPtr imesa ) Index: xc/lib/GL/mesa/src/drv/i830/i830_render.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_render.c:1.2 xc/lib/GL/mesa/src/drv/i830/i830_render.c:1.3 --- xc/lib/GL/mesa/src/drv/i830/i830_render.c:1.2 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_render.c Sun Sep 28 16:15:14 2003 @@ -26,7 +26,7 @@ * Adapted for use on the I830: * Jeff Hartmann */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_render.c,v 1.2 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_render.c,v 1.3 2003/09/28 20:15:14 alanh Exp $ */ /* * Render unclipped vertex buffers by emitting vertices directly to @@ -36,10 +36,9 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" #include "enums.h" -#include "mmath.h" #include "tnl/t_context.h" @@ -123,7 +122,7 @@ tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags ); - I830_CONTEXT(ctx)->SetupNewInputs = VERT_CLIP; + I830_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_CLIP; } @@ -206,7 +205,7 @@ return GL_TRUE; } - imesa->SetupNewInputs = VERT_CLIP; + imesa->SetupNewInputs = VERT_BIT_CLIP; tnl->Driver.Render.Start( ctx ); @@ -227,19 +226,19 @@ static void i830_check_render( GLcontext *ctx, struct gl_pipeline_stage *stage ) { - GLuint inputs = VERT_CLIP|VERT_RGBA; + GLuint inputs = VERT_BIT_CLIP | VERT_BIT_COLOR0; if (ctx->RenderMode == GL_RENDER) { if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - inputs |= VERT_SPEC_RGB; + inputs |= VERT_BIT_COLOR1; if (ctx->Texture.Unit[0]._ReallyEnabled) - inputs |= VERT_TEX(0); + inputs |= VERT_BIT_TEX0; if (ctx->Texture.Unit[1]._ReallyEnabled) - inputs |= VERT_TEX(1); + inputs |= VERT_BIT_TEX1; if (ctx->Fog.Enabled) - inputs |= VERT_FOG_COORD; + inputs |= VERT_BIT_FOG; } stage->inputs = inputs; Index: xc/lib/GL/mesa/src/drv/i830/i830_screen.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_screen.c:1.3 xc/lib/GL/mesa/src/drv/i830/i830_screen.c:1.4 --- xc/lib/GL/mesa/src/drv/i830/i830_screen.c:1.3 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_screen.c Sun Sep 28 16:15:14 2003 @@ -24,7 +24,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_screen.c,v 1.3 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_screen.c,v 1.4 2003/09/28 20:15:14 alanh Exp $ */ /* * Authors: @@ -34,13 +34,6 @@ */ -#include -#include - - -#include -#include - #include "glheader.h" #include "context.h" #include "matrix.h" @@ -132,17 +125,14 @@ i830ScreenPrivate *i830Screen; I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv; - /* Check the DRI version */ - { - int major, minor, patch; - if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) { - if (major != 4 || minor < 0) { - __driUtilMessage("i830 DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch); - return GL_FALSE; - } - } + /* Check the DRI externsion version */ + if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) { + __driUtilMessage( "i830 DRI driver expected DRI version 4.0.x " + "but got version %d.%d.%d", + sPriv->driMajor, sPriv->driMinor, sPriv->driPatch ); + return GL_FALSE; } - + /* Check that the DDX driver version is compatible */ if (sPriv->ddxMajor != 1 || sPriv->ddxMinor < 0) { __driUtilMessage("i830 DRI driver expected DDX driver version 1.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch); @@ -270,6 +260,21 @@ } } +#if 0 + if (sPriv->drmMinor >= 3) { + int ret; + drmI830SetParam sp; + + sp.param = I830_SETPARAM_PERF_BOXES; + sp.value = (getenv("I830_DO_BOXES") != 0); + + ret = drmCommandWrite( sPriv->fd, DRM_I830_SETPARAM, + &sp, sizeof(sp)); + if (ret) + fprintf(stderr, "Couldn't set perfboxes: %d\n", ret); + } +#endif + return GL_TRUE; } @@ -287,8 +292,7 @@ sPriv->private = NULL; } -static GLboolean i830CreateBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, +static GLboolean i830CreateBuffer(__DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) @@ -318,30 +322,31 @@ _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate)); } -static GLboolean i830OpenFullScreen (__DRIcontextPrivate *driContextPriv) +static GLboolean i830OpenCloseFullScreen (__DRIcontextPrivate *driContextPriv) { return GL_TRUE; } -static GLboolean i830CloseFullScreen (__DRIcontextPrivate *driContextPriv) -{ - return GL_TRUE; -} - -static struct __DriverAPIRec i830API = { - i830InitDriver, - i830DestroyScreen, - i830CreateContext, - i830DestroyContext, - i830CreateBuffer, - i830DestroyBuffer, - i830SwapBuffers, - i830MakeCurrent, - i830UnbindContext, - i830OpenFullScreen, - i830CloseFullScreen +static const struct __DriverAPIRec i830API = { + .InitDriver = i830InitDriver, + .DestroyScreen = i830DestroyScreen, + .CreateContext = i830CreateContext, + .DestroyContext = i830DestroyContext, + .CreateBuffer = i830CreateBuffer, + .DestroyBuffer = i830DestroyBuffer, + .SwapBuffers = i830SwapBuffers, + .MakeCurrent = i830MakeCurrent, + .UnbindContext = i830UnbindContext, + .OpenFullScreen = i830OpenCloseFullScreen, + .CloseFullScreen = i830OpenCloseFullScreen, + .GetSwapInfo = NULL, + .GetMSC = NULL, + .WaitForMSC = NULL, + .WaitForSBC = NULL, + .SwapBuffersMSC = NULL }; + /* * This is the bootstrap function for the driver. * The __driCreateScreen name is the symbol that libGL.so fetches. @@ -354,40 +359,3 @@ psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i830API); return (void *) psp; } - - -/* This function is called by libGL.so as soon as libGL.so is loaded. - * This is where we'd register new extension functions with the dispatcher. - * - * Note: Most of these are probably already registered - just doing - * this for the benefit of old libGL.so's out there. - */ -#include "glapioffsets.h" - -void __driRegisterExtensions( void ) -{ - int i; - static struct { const char *name; int offset; } funcs[] = { - { "glSecondaryColor3bEXT", _gloffset_SecondaryColor3bEXT }, - { "glSecondaryColor3dEXT", _gloffset_SecondaryColor3dEXT }, - { "glSecondaryColor3fEXT", _gloffset_SecondaryColor3fEXT }, - { "glSecondaryColor3iEXT", _gloffset_SecondaryColor3iEXT }, - { "glSecondaryColor3sEXT", _gloffset_SecondaryColor3sEXT }, - { "glSecondaryColor3ubEXT", _gloffset_SecondaryColor3ubEXT }, - { "glSecondaryColor3uiEXT", _gloffset_SecondaryColor3uiEXT }, - { "glSecondaryColor3usEXT", _gloffset_SecondaryColor3usEXT }, - { "glSecondaryColor3bvEXT", _gloffset_SecondaryColor3bvEXT }, - { "glSecondaryColor3dvEXT", _gloffset_SecondaryColor3dvEXT }, - { "glSecondaryColor3fvEXT", _gloffset_SecondaryColor3fvEXT }, - { "glSecondaryColor3ivEXT", _gloffset_SecondaryColor3ivEXT }, - { "glSecondaryColor3svEXT", _gloffset_SecondaryColor3svEXT }, - { "glSecondaryColor3ubvEXT", _gloffset_SecondaryColor3ubvEXT }, - { "glSecondaryColor3uivEXT", _gloffset_SecondaryColor3uivEXT }, - { "glSecondaryColor3usvEXT", _gloffset_SecondaryColor3usvEXT }, - { "glSecondaryColorPointerEXT", _gloffset_SecondaryColorPointerEXT } - }; - - for (i = 0 ; i < sizeof(funcs) / sizeof(*funcs) ; i++ ) - _glapi_add_entrypoint( funcs[i].name, funcs[i].offset ); -} - Index: xc/lib/GL/mesa/src/drv/i830/i830_screen.h diff -u xc/lib/GL/mesa/src/drv/i830/i830_screen.h:1.2 xc/lib/GL/mesa/src/drv/i830/i830_screen.h:1.3 --- xc/lib/GL/mesa/src/drv/i830/i830_screen.h:1.2 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_screen.h Sun Sep 28 16:15:14 2003 @@ -86,7 +86,7 @@ extern GLboolean -i830CreateContext( Display *dpy, const __GLcontextModes *mesaVis, +i830CreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate ); @@ -102,6 +102,6 @@ __DRIdrawablePrivate *driReadPriv); extern void -i830SwapBuffers(Display *dpy, void *drawablePrivate); +i830SwapBuffers(__DRIdrawablePrivate *driDrawPriv); #endif Index: xc/lib/GL/mesa/src/drv/i830/i830_span.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_span.c:1.4 xc/lib/GL/mesa/src/drv/i830/i830_span.c:1.5 --- xc/lib/GL/mesa/src/drv/i830/i830_span.c:1.4 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_span.c Sun Sep 28 16:15:14 2003 @@ -25,7 +25,7 @@ **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_span.c,v 1.4 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_span.c,v 1.5 2003/09/28 20:15:14 alanh Exp $ */ /* * Author: @@ -38,6 +38,7 @@ #include "glheader.h" #include "macros.h" #include "mtypes.h" +#include "colormac.h" #include "i830_screen.h" #include "i830_dri.h" @@ -204,11 +205,6 @@ #define WRITE_PIXEL(_x, _y, p) \ *(GLuint *)(buf + _x*4 + _y*pitch) = p -/* Note to Self: - * Don't read alpha from framebuffer, because its not correct. From a - * reading of the spec, this should not be the case, need to ask an - * engineer at Intel. - */ #define READ_RGBA(rgba, _x, _y) \ do { \ @@ -216,7 +212,7 @@ rgba[0] = (p >> 16) & 0xff; \ rgba[1] = (p >> 8) & 0xff; \ rgba[2] = (p >> 0) & 0xff; \ - rgba[3] = 255; \ + rgba[3] = (p >> 24) & 0xff; \ } while (0) #define TAG(x) i830##x##_8888 @@ -262,26 +258,23 @@ #define TAG(x) i830##x##_24_8 #include "stenciltmp.h" -static void i830SetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum mode) +/* + * This function is called to specify which buffer to read and write + * for software rasterization (swrast) fallbacks. This doesn't necessarily + * correspond to glDrawBuffer() or glReadBuffer() calls. + */ +static void i830SetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, + GLuint bufferBit) { i830ContextPtr imesa = I830_CONTEXT(ctx); - switch( mode ) { - case GL_FRONT_LEFT: - if ( imesa->sarea->pf_current_page == 1 ) - imesa->readMap = imesa->i830Screen->back.map; - else - imesa->readMap = (char*)imesa->driScreen->pFB; - break; - case GL_BACK_LEFT: - if ( imesa->sarea->pf_current_page == 1 ) - imesa->readMap = (char*)imesa->driScreen->pFB; - else - imesa->readMap = imesa->i830Screen->back.map; - break; - default: + if (bufferBit == FRONT_LEFT_BIT) { + imesa->drawMap = (char *)imesa->driScreen->pFB; + imesa->readMap = (char *)imesa->driScreen->pFB; + } else if (bufferBit == BACK_LEFT_BIT) { + imesa->drawMap = imesa->i830Screen->back.map; + imesa->readMap = imesa->i830Screen->back.map; + } else { ASSERT(0); - break; } } @@ -311,7 +304,7 @@ struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SetReadBuffer = i830SetReadBuffer; + swdd->SetBuffer = i830SetBuffer; switch (i830Screen->fbFormat) { case DV_PF_555: Index: xc/lib/GL/mesa/src/drv/i830/i830_state.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_state.c:1.6 xc/lib/GL/mesa/src/drv/i830/i830_state.c:1.8 --- xc/lib/GL/mesa/src/drv/i830/i830_state.c:1.6 Tue Jan 28 17:47:06 2003 +++ xc/lib/GL/mesa/src/drv/i830/i830_state.c Tue Dec 2 08:02:37 2003 @@ -25,7 +25,7 @@ **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_state.c,v 1.6 2003/01/28 22:47:06 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_state.c,v 1.8 2003/12/02 13:02:37 alanh Exp $ */ /* * Author: @@ -34,7 +34,6 @@ * Heavily based on the I810 driver, which was written by: * Keith Whitwell */ -#include #include "glheader.h" #include "context.h" @@ -42,7 +41,7 @@ #include "enums.h" #include "dd.h" -#include "mm.h" +#include "texmem.h" #include "i830_screen.h" #include "i830_dri.h" @@ -124,11 +123,9 @@ } I830_STATECHANGE(imesa, I830_UPLOAD_CTX); - imesa->Setup[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_MASK; + imesa->Setup[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_TEST_MASK; imesa->Setup[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK | - ENABLE_STENCIL_WRITE_MASK | - STENCIL_TEST_MASK(mask) | - STENCIL_WRITE_MASK(mask)); + STENCIL_TEST_MASK(mask)); imesa->Setup[I830_CTXREG_STENCILTST] &= ~(STENCIL_REF_VALUE_MASK | ENABLE_STENCIL_TEST_FUNC_MASK); imesa->Setup[I830_CTXREG_STENCILTST] |= (ENABLE_STENCIL_REF_VALUE | @@ -147,10 +144,8 @@ mask = mask & 0xff; I830_STATECHANGE(imesa, I830_UPLOAD_CTX); - imesa->Setup[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_MASK; - imesa->Setup[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_TEST_MASK | - ENABLE_STENCIL_WRITE_MASK | - STENCIL_TEST_MASK(mask) | + imesa->Setup[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK; + imesa->Setup[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK | STENCIL_WRITE_MASK(mask)); } @@ -179,9 +174,15 @@ fop = STENCILOP_REPLACE; break; case GL_INCR: - fop = STENCILOP_INCR; + fop = STENCILOP_INCRSAT; break; case GL_DECR: + fop = STENCILOP_DECRSAT; + break; + case GL_INCR_WRAP: + fop = STENCILOP_INCR; + break; + case GL_DECR_WRAP: fop = STENCILOP_DECR; break; case GL_INVERT: @@ -201,9 +202,15 @@ dfop = STENCILOP_REPLACE; break; case GL_INCR: - dfop = STENCILOP_INCR; + dfop = STENCILOP_INCRSAT; break; case GL_DECR: + dfop = STENCILOP_DECRSAT; + break; + case GL_INCR_WRAP: + dfop = STENCILOP_INCR; + break; + case GL_DECR_WRAP: dfop = STENCILOP_DECR; break; case GL_INVERT: @@ -223,9 +230,15 @@ dpop = STENCILOP_REPLACE; break; case GL_INCR: - dpop = STENCILOP_INCR; + dpop = STENCILOP_INCRSAT; break; case GL_DECR: + dpop = STENCILOP_DECRSAT; + break; + case GL_INCR_WRAP: + dpop = STENCILOP_INCR; + break; + case GL_DECR_WRAP: dpop = STENCILOP_DECR; break; case GL_INVERT: @@ -244,10 +257,11 @@ STENCIL_PASS_DEPTH_PASS_OP(dpop)); } -static void i830AlphaFunc(GLcontext *ctx, GLenum func, GLchan ref) +static void i830AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref) { i830ContextPtr imesa = I830_CONTEXT(ctx); int test = 0; + GLuint refByte = (GLint) (ref * 255.0); switch(func) { case GL_NEVER: @@ -274,7 +288,8 @@ case GL_ALWAYS: test = COMPAREFUNC_ALWAYS; break; - default: return; + default: + return; } I830_STATECHANGE(imesa, I830_UPLOAD_CTX); @@ -282,7 +297,7 @@ imesa->Setup[I830_CTXREG_STATE2] |= (ENABLE_ALPHA_TEST_FUNC | ENABLE_ALPHA_REF_VALUE | ALPHA_TEST_FUNC(test) | - ALPHA_REF_VALUE(ref)); + ALPHA_REF_VALUE(refByte)); } /* This function makes sure that the proper enables are @@ -836,6 +851,7 @@ if (I830_DEBUG&DEBUG_DRI) fprintf(stderr, "%s\n", __FUNCTION__); + /* FIXME: This should be a look-up table, like the r200 driver. */ switch(opcode) { case GL_CLEAR: tmp = LOGICOP_CLEAR; @@ -905,21 +921,28 @@ FALLBACK( imesa, I830_FALLBACK_RENDERMODE, (mode != GL_RENDER) ); } -#if 0 -void i830DrawBuffer(GLcontext *ctx, GLenum mode ) +static void i830DrawBuffer(GLcontext *ctx, GLenum mode ) { i830ContextPtr imesa = I830_CONTEXT(ctx); - int front; /* * _DrawDestMask is easier to cope with than . */ switch ( ctx->Color._DrawDestMask ) { case FRONT_LEFT_BIT: - front = 1; + I830_FIREVERTICES(imesa); + I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS); + imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->fbOffset; + i830XMesaSetFrontClipRects( imesa ); + FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; case BACK_LEFT_BIT: - front = 0; + I830_FIREVERTICES(imesa); + I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS); + imesa->BufferSetup[I830_DESTREG_CBUFADDR] = + imesa->i830Screen->backOffset; + i830XMesaSetBackClipRects( imesa ); + FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; default: /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ @@ -927,88 +950,31 @@ return; } - if ( imesa->sarea->pf_current_page == 1 ) - front ^= 1; - - FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE ); - I830_FIREVERTICES(imesa); - I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS); - i830XMesaSetFrontClipRects( imesa ); - - if (front) { - imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->fbOffset; - imesa->drawMap = (char *)imesa->driScreen->pFB; - imesa->readMap = (char *)imesa->driScreen->pFB; - } else { - imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->backOffset; - imesa->drawMap = imesa->i830Screen->back.map; - imesa->readMap = imesa->i830Screen->back.map; - } - /* We want to update the s/w rast state too so that i830SetBuffer() * gets called. */ _swrast_DrawBuffer(ctx, mode); } - static void i830ReadBuffer(GLcontext *ctx, GLenum mode ) { - /* nothing, until h/w glRead/CopyPixels */ + /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */ } -#endif - -void i830SetDrawBuffer(GLcontext *ctx, GLenum mode ) +static void i830ClearColor(GLcontext *ctx, const GLfloat color[4]) { i830ContextPtr imesa = I830_CONTEXT(ctx); - int front = 0; - - switch (mode) { - case GL_FRONT_LEFT: - front = 1; - break; - case GL_BACK_LEFT: - front = 0; - break; - default: - FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_TRUE ); - return; - } - if ( imesa->sarea->pf_current_page == 1 ) - front ^= 1; - - FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE ); - I830_FIREVERTICES(imesa); - I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS); - i830XMesaSetFrontClipRects( imesa ); - - if (front) { - imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->fbOffset; - imesa->drawMap = (char *)imesa->driScreen->pFB; - imesa->readMap = (char *)imesa->driScreen->pFB; - } else { - imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->backOffset; - imesa->drawMap = imesa->i830Screen->back.map; - imesa->readMap = imesa->i830Screen->back.map; - } -} - -static void i830ClearColor(GLcontext *ctx, const GLchan color[4]) -{ - i830ContextPtr imesa = I830_CONTEXT(ctx); - - imesa->clear_red = color[RCOMP]; - imesa->clear_green = color[GCOMP]; - imesa->clear_blue = color[BCOMP]; - imesa->clear_alpha = color[ACOMP]; + CLAMPED_FLOAT_TO_UBYTE(imesa->clear_red, color[0]); + CLAMPED_FLOAT_TO_UBYTE(imesa->clear_green, color[1]); + CLAMPED_FLOAT_TO_UBYTE(imesa->clear_blue, color[2]); + CLAMPED_FLOAT_TO_UBYTE(imesa->clear_alpha, color[3]); imesa->ClearColor = i830PackColor(imesa->i830Screen->fbFormat, - color[RCOMP], - color[GCOMP], - color[BCOMP], - color[ACOMP] ); + imesa->clear_red, + imesa->clear_green, + imesa->clear_blue, + imesa->clear_alpha); } static void i830CullFaceFrontFace(GLcontext *ctx, GLenum unused) @@ -1282,11 +1248,14 @@ if (imesa->hw_stencil) { I830_STATECHANGE(imesa, I830_UPLOAD_CTX); imesa->Setup[I830_CTXREG_ENABLES_1] &= ~ENABLE_STENCIL_TEST; + imesa->Setup[I830_CTXREG_ENABLES_2] &= ~ENABLE_STENCIL_WRITE; if (state) { imesa->Setup[I830_CTXREG_ENABLES_1] |= ENABLE_STENCIL_TEST; + imesa->Setup[I830_CTXREG_ENABLES_2] |= ENABLE_STENCIL_WRITE; } else { imesa->Setup[I830_CTXREG_ENABLES_1] |= DISABLE_STENCIL_TEST; + imesa->Setup[I830_CTXREG_ENABLES_2] |= DISABLE_STENCIL_WRITE; } } else { FALLBACK( imesa, I830_FALLBACK_STENCIL, state ); @@ -1418,9 +1387,9 @@ i830PrintDirty( __FUNCTION__, imesa->dirty ); if ((imesa->dirty & I830_UPLOAD_TEX0_IMAGE) && imesa->CurrentTexObj[0]) - i830UploadTexImages(imesa, imesa->CurrentTexObj[0]); + i830UploadTexImagesLocked(imesa, imesa->CurrentTexObj[0]); if ((imesa->dirty & I830_UPLOAD_TEX1_IMAGE) && imesa->CurrentTexObj[1]) - i830UploadTexImages(imesa, imesa->CurrentTexObj[1]); + i830UploadTexImagesLocked(imesa, imesa->CurrentTexObj[1]); if (imesa->dirty & I830_UPLOAD_CTX) { memcpy( imesa->sarea->ContextState, imesa->Setup, sizeof(imesa->Setup) ); @@ -1432,9 +1401,14 @@ memcpy(imesa->sarea->TexState[i], imesa->CurrentTexObj[i]->Setup, sizeof(imesa->sarea->TexState[i])); + + imesa->sarea->TexState[i][I830_TEXREG_TM0S3] &= ~TM0S3_LOD_BIAS_MASK; + imesa->sarea->TexState[i][I830_TEXREG_TM0S3] |= imesa->LodBias[i]; + /* Update the LRU usage */ - if (imesa->CurrentTexObj[i]->MemBlock) - i830UpdateTexLRU(imesa, imesa->CurrentTexObj[i]); + if (imesa->CurrentTexObj[i]->base.memBlock) + driUpdateTextureLRU( (driTextureObject *) + imesa->CurrentTexObj[i] ); } } /* Need to figure out if texturing state, or enable changed. */ @@ -1713,6 +1687,7 @@ imesa->BufferSetup[I830_DESTREG_CBUFADDR] = i830Screen->backOffset; imesa->BufferSetup[I830_DESTREG_DBUFADDR] = 0; } else { + /* use front buffer by default */ imesa->drawMap = (char *)imesa->driScreen->pFB; imesa->readMap = (char *)imesa->driScreen->pFB; imesa->BufferSetup[I830_DESTREG_CBUFADDR] = i830Screen->fbOffset; @@ -1766,7 +1741,7 @@ _swsetup_InvalidateState( ctx, new_state ); _ac_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); - I830_CONTEXT(ctx)->new_state |= new_state; + I830_CONTEXT(ctx)->NewGLState |= new_state; } void i830DDInitStateFuncs(GLcontext *ctx) @@ -1796,7 +1771,8 @@ ctx->Driver.PolygonStipple = i830PolygonStippleFallback; ctx->Driver.RenderMode = i830RenderMode; ctx->Driver.Scissor = i830Scissor; - ctx->Driver.SetDrawBuffer = i830SetDrawBuffer; + ctx->Driver.DrawBuffer = i830DrawBuffer; + ctx->Driver.ReadBuffer = i830ReadBuffer; ctx->Driver.ShadeModel = i830ShadeModel; ctx->Driver.DepthRange = i830DepthRange; ctx->Driver.Viewport = i830Viewport; Index: xc/lib/GL/mesa/src/drv/i830/i830_state.h diff -u xc/lib/GL/mesa/src/drv/i830/i830_state.h:1.3 xc/lib/GL/mesa/src/drv/i830/i830_state.h:1.4 --- xc/lib/GL/mesa/src/drv/i830/i830_state.h:1.3 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_state.h Sun Sep 28 16:15:14 2003 @@ -25,7 +25,7 @@ **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_state.h,v 1.3 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_state.h,v 1.4 2003/09/28 20:15:14 alanh Exp $ */ /* * Author: @@ -38,7 +38,7 @@ #define _I830_STATE_H #include "i830_context.h" -/*Maths macros from mmath.h*/ +#include "colormac.h" #define FloatToInt(F) ((int)(F)) /* Index: xc/lib/GL/mesa/src/drv/i830/i830_tex.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_tex.c:1.4 xc/lib/GL/mesa/src/drv/i830/i830_tex.c:1.6 --- xc/lib/GL/mesa/src/drv/i830/i830_tex.c:1.4 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_tex.c Sun Sep 28 16:15:14 2003 @@ -25,7 +25,7 @@ **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_tex.c,v 1.4 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_tex.c,v 1.6 2003/09/28 20:15:14 alanh Exp $ */ /* * Author: @@ -35,17 +35,14 @@ * Keith Whitwell */ -#include -#include - -#include #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "simple_list.h" #include "enums.h" #include "texstore.h" #include "texformat.h" +#include "texmem.h" #include "swrast/swrast.h" #include "mm.h" @@ -60,26 +57,34 @@ /* * Compute the 'S2.4' lod bias factor from the floating point OpenGL bias. */ -static void i830ComputeLodBias(i830ContextPtr imesa, - i830TextureObjectPtr t, - GLfloat bias) +static void i830ComputeLodBias( i830ContextPtr imesa, unsigned unit, + GLfloat bias ) { int b; b = (int) (bias * 16.0); if(b > 63) b = 63; else if (b < -64) b = -64; - t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_LOD_BIAS_MASK; - t->Setup[I830_TEXREG_TM0S3] |= ((b << TM0S3_LOD_BIAS_SHIFT) & - TM0S3_LOD_BIAS_MASK); + imesa->LodBias[ unit ] = ((b << TM0S3_LOD_BIAS_SHIFT) & + TM0S3_LOD_BIAS_MASK); } + +/** + * Set the texture wrap modes. + * + * The i830M (and related graphics cores) do not support GL_CLAMP. The Intel + * drivers for "other operating systems" implement GL_CLAMP as + * GL_CLAMP_TO_EDGE, so the same is done here. + * + * \param t Texture object whose wrap modes are to be set + * \param swrap Wrap mode for the \a s texture coordinate + * \param twrap Wrap mode for the \a t texture coordinate + */ + static void i830SetTexWrapping(i830TextureObjectPtr tex, GLenum swrap, GLenum twrap) { - if(I830_DEBUG&DEBUG_DRI) - fprintf(stderr, "%s\n", __FUNCTION__); - tex->Setup[I830_TEXREG_MCS] &= ~(TEXCOORD_ADDR_U_MASK|TEXCOORD_ADDR_V_MASK); switch( swrap ) { @@ -87,13 +92,19 @@ tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP); break; case GL_CLAMP: + case GL_CLAMP_TO_EDGE: tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_CLAMP); break; - case GL_CLAMP_TO_EDGE: + case GL_CLAMP_TO_BORDER: tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_CLAMP_BORDER); break; - default: break; + case GL_MIRRORED_REPEAT: + tex->Setup[I830_TEXREG_MCS] |= + TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_MIRROR); + break; + default: + _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__); } switch( twrap ) { @@ -101,88 +112,101 @@ tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP); break; case GL_CLAMP: + case GL_CLAMP_TO_EDGE: tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_CLAMP); break; - case GL_CLAMP_TO_EDGE: + case GL_CLAMP_TO_BORDER: tex->Setup[I830_TEXREG_MCS] |= TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_CLAMP_BORDER); break; - default: break; + case GL_MIRRORED_REPEAT: + tex->Setup[I830_TEXREG_MCS] |= + TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_MIRROR); + break; + default: + _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__); } } -static void i830SetTexFilter(i830ContextPtr imesa, - i830TextureObjectPtr t, - GLenum minf, GLenum magf, - GLfloat bias) +static void i830SetTexMaxAnisotropy( i830TextureObjectPtr t, GLfloat max ) { - int minFilt = 0, mipFilt = 0, magFilt = 0; + t->max_anisotropy = max; +} - if(I830_DEBUG&DEBUG_DRI) - fprintf(stderr, "%s\n", __FUNCTION__); - switch (minf) { - case GL_NEAREST: - minFilt = FILTER_NEAREST; - mipFilt = MIPFILTER_NONE; - break; - case GL_LINEAR: - minFilt = FILTER_LINEAR; - mipFilt = MIPFILTER_NONE; - break; - case GL_NEAREST_MIPMAP_NEAREST: - minFilt = FILTER_NEAREST; - mipFilt = MIPFILTER_NEAREST; +/** + * Set the texture magnification and minification modes. + * + * \param t Texture whose filter modes are to be set + * \param minf Texture minification mode + * \param magf Texture magnification mode + * \param bias LOD bias for this texture unit. + */ -/* if(magf == GL_LINEAR && 0) { */ -/* bias -= 0.5; */ -/* } */ +static void i830SetTexFilter( i830TextureObjectPtr t, + GLenum minf, GLenum magf ) +{ + int minFilt = 0, mipFilt = 0, magFilt = 0; - break; - case GL_LINEAR_MIPMAP_NEAREST: - minFilt = FILTER_LINEAR; - mipFilt = MIPFILTER_NEAREST; - break; - case GL_NEAREST_MIPMAP_LINEAR: - minFilt = FILTER_NEAREST; - mipFilt = MIPFILTER_LINEAR; + if(I830_DEBUG&DEBUG_DRI) + fprintf(stderr, "%s\n", __FUNCTION__); -/* if(magf == GL_LINEAR && 0) { */ -/* bias -= 0.5; */ -/* } */ + if ( t->max_anisotropy > 1.0 ) { + minFilt = FILTER_ANISOTROPIC; + magFilt = FILTER_ANISOTROPIC; + } + else { + switch (minf) { + case GL_NEAREST: + minFilt = FILTER_NEAREST; + mipFilt = MIPFILTER_NONE; + break; + case GL_LINEAR: + minFilt = FILTER_LINEAR; + mipFilt = MIPFILTER_NONE; + break; + case GL_NEAREST_MIPMAP_NEAREST: + minFilt = FILTER_NEAREST; + mipFilt = MIPFILTER_NEAREST; + break; + case GL_LINEAR_MIPMAP_NEAREST: + minFilt = FILTER_LINEAR; + mipFilt = MIPFILTER_NEAREST; + break; + case GL_NEAREST_MIPMAP_LINEAR: + minFilt = FILTER_NEAREST; + mipFilt = MIPFILTER_LINEAR; + break; + case GL_LINEAR_MIPMAP_LINEAR: + minFilt = FILTER_LINEAR; + mipFilt = MIPFILTER_LINEAR; + break; + default: + _mesa_problem(NULL, "%s: Unsupported min. filter %d", __FUNCTION__, + (int) minf ); + break; + } - break; - case GL_LINEAR_MIPMAP_LINEAR: - minFilt = FILTER_LINEAR; - mipFilt = MIPFILTER_LINEAR; - break; - default: - fprintf(stderr, "i830SetTexFilter(): not supported min. filter %d\n", - (int)minf); - break; + switch (magf) { + case GL_NEAREST: + magFilt = FILTER_NEAREST; + break; + case GL_LINEAR: + magFilt = FILTER_LINEAR; + break; + default: + _mesa_problem(NULL, "%s: Unsupported mag. filter %d", __FUNCTION__, + (int) magf ); + break; + } } - switch (magf) { - case GL_NEAREST: - magFilt = FILTER_NEAREST; - break; - case GL_LINEAR: - magFilt = FILTER_LINEAR; - break; - default: - fprintf(stderr, "i830SetTexFilter(): not supported mag. filter %d\n", - (int)magf); - break; - } - t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIN_FILTER_MASK; t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIP_FILTER_MASK; t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MAG_FILTER_MASK; t->Setup[I830_TEXREG_TM0S3] |= ((minFilt << TM0S3_MIN_FILTER_SHIFT) | (mipFilt << TM0S3_MIP_FILTER_SHIFT) | (magFilt << TM0S3_MAG_FILTER_SHIFT)); - - i830ComputeLodBias(imesa, t, bias); } static void i830SetTexBorderColor(i830TextureObjectPtr t, GLubyte color[4]) @@ -195,6 +219,55 @@ } +/** + * Allocate space for and load the mesa images into the texture memory block. + * This will happen before drawing with a new texture, or drawing with a + * texture after it was swapped out or teximaged again. + */ + +static i830TextureObjectPtr i830AllocTexObj( struct gl_texture_object *texObj ) +{ + i830TextureObjectPtr t; + + t = CALLOC_STRUCT( i830_texture_object_t ); + texObj->DriverData = t; + if ( t != NULL ) { + /* Initialize non-image-dependent parts of the state: + */ + t->base.tObj = texObj; + + t->Setup[I830_TEXREG_TM0LI] = STATE3D_LOAD_STATE_IMMEDIATE_2; + t->Setup[I830_TEXREG_TM0S0] = TM0S0_USE_FENCE; + t->Setup[I830_TEXREG_TM0S1] = 0; + t->Setup[I830_TEXREG_TM0S2] = 0; + t->Setup[I830_TEXREG_TM0S3] = 0; + + t->Setup[I830_TEXREG_NOP0] = 0; + t->Setup[I830_TEXREG_NOP1] = 0; + t->Setup[I830_TEXREG_NOP2] = 0; + + t->Setup[I830_TEXREG_MCS] = (STATE3D_MAP_COORD_SET_CMD | + MAP_UNIT(0) | + ENABLE_TEXCOORD_PARAMS | + TEXCOORDS_ARE_NORMAL | + TEXCOORDTYPE_CARTESIAN | + ENABLE_ADDR_V_CNTL | + TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP) | + ENABLE_ADDR_U_CNTL | + TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP)); + + make_empty_list( & t->base ); + + i830SetTexWrapping( t, texObj->WrapS, texObj->WrapT ); + i830SetTexMaxAnisotropy( t, texObj->MaxAnisotropy ); + i830SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); + i830SetTexBorderColor( t, texObj->_BorderChan ); + } + + return t; +} + + static void i830TexParameter( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLenum pname, const GLfloat *params ) @@ -209,7 +282,7 @@ return; /* Can't do the update now as we don't know whether to flush - * vertices or not. Setting imesa->new_state means that + * vertices or not. Setting imesa->NewGLState means that * i830UpdateTextureState() will be called before any triangles are * rendered. If a statechange has occurred, it will be detected at * that point, and buffered vertices flushed. @@ -217,10 +290,9 @@ switch (pname) { case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: - { - GLfloat bias = ctx->Texture.Unit[unit].LodBias; - i830SetTexFilter( imesa, t, tObj->MinFilter, tObj->MagFilter, bias ); - } + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + i830SetTexMaxAnisotropy( t, tObj->MaxAnisotropy ); + i830SetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); break; case GL_TEXTURE_WRAP_S: @@ -229,7 +301,7 @@ break; case GL_TEXTURE_BORDER_COLOR: - i830SetTexBorderColor( t, tObj->BorderColor ); + i830SetTexBorderColor( t, tObj->_BorderChan ); break; case GL_TEXTURE_BASE_LEVEL: @@ -240,7 +312,7 @@ * reloading the textures. A project for someone? */ I830_FIREVERTICES( I830_CONTEXT(ctx) ); - i830SwapOutTexObj( imesa, t ); + driSwapOutTextureObject( (driTextureObject *) t ); break; default: @@ -285,15 +357,8 @@ break; case GL_TEXTURE_LOD_BIAS_EXT: - { - struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; - i830TextureObjectPtr t = (i830TextureObjectPtr) tObj->DriverData; - i830ComputeLodBias(imesa, t, *param); - /* Do a state change */ - if (t == imesa->CurrentTexObj[unit]) { - I830_STATECHANGE( imesa, I830_UPLOAD_TEX_N(unit) ); - } - } + i830ComputeLodBias( imesa, unit, *param ); + I830_STATECHANGE( imesa, I830_UPLOAD_TEX_N(unit) ); break; default: @@ -309,11 +374,19 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - i830TextureObjectPtr t = (i830TextureObjectPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; if (t) { I830_FIREVERTICES( I830_CONTEXT(ctx) ); - i830SwapOutTexObj( I830_CONTEXT(ctx), t ); + driSwapOutTextureObject( t ); + } + else { + t = (driTextureObject *) i830AllocTexObj( texObj ); + if (!t) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); + return; + } } + _mesa_store_teximage2d( ctx, target, level, internalFormat, width, height, border, format, type, pixels, packing, texObj, texImage ); @@ -330,10 +403,10 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - i830TextureObjectPtr t = (i830TextureObjectPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; if (t) { I830_FIREVERTICES( I830_CONTEXT(ctx) ); - i830SwapOutTexObj( I830_CONTEXT(ctx), t ); + driSwapOutTextureObject( t ); } _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels, packing, texObj, @@ -341,72 +414,31 @@ } + static void i830BindTexture( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj ) { - if (target == GL_TEXTURE_2D) { - i830ContextPtr imesa = I830_CONTEXT( ctx ); - i830TextureObjectPtr t = (i830TextureObjectPtr) tObj->DriverData; - - if (!t) { - GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias; - t = CALLOC_STRUCT(i830_texture_object_t); - - /* Initialize non-image-dependent parts of the state: - */ - t->globj = tObj; - t->Setup[I830_TEXREG_TM0LI] = STATE3D_LOAD_STATE_IMMEDIATE_2; - t->Setup[I830_TEXREG_TM0S0] = TM0S0_USE_FENCE; - t->Setup[I830_TEXREG_TM0S1] = 0; - t->Setup[I830_TEXREG_TM0S2] = 0; - t->Setup[I830_TEXREG_TM0S3] = 0; - - t->Setup[I830_TEXREG_NOP0] = 0; - t->Setup[I830_TEXREG_NOP1] = 0; - t->Setup[I830_TEXREG_NOP2] = 0; - - t->Setup[I830_TEXREG_MCS] = (STATE3D_MAP_COORD_SET_CMD | - MAP_UNIT(0) | - ENABLE_TEXCOORD_PARAMS | - TEXCOORDS_ARE_NORMAL | - TEXCOORDTYPE_CARTESIAN | - ENABLE_ADDR_V_CNTL | - TEXCOORD_ADDR_V_MODE(TEXCOORDMODE_WRAP) | - ENABLE_ADDR_U_CNTL | - TEXCOORD_ADDR_U_MODE(TEXCOORDMODE_WRAP)); - - - t->dirty_images = ~0; - - tObj->DriverData = t; - make_empty_list( t ); - - i830SetTexWrapping( t, tObj->WrapS, tObj->WrapT ); - i830SetTexFilter( imesa, t, tObj->MinFilter, tObj->MagFilter, bias ); - i830SetTexBorderColor( t, tObj->BorderColor ); - } + if (!tObj->DriverData) { + i830AllocTexObj( tObj ); } } + static void i830DeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) { - i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData; + driTextureObject * t = (driTextureObject *) tObj->DriverData; - if (t) { + if ( t != NULL ) { i830ContextPtr imesa = I830_CONTEXT( ctx ); - if (imesa) + + if ( imesa ) { I830_FIREVERTICES( imesa ); - i830DestroyTexObj( imesa, t ); - tObj->DriverData = 0; + } + + driDestroyTextureObject( t ); } } -static GLboolean i830IsTextureResident( GLcontext *ctx, - struct gl_texture_object *tObj ) -{ - i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData; - return t && t->MemBlock; -} static const struct gl_texture_format * i830ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, @@ -419,6 +451,7 @@ switch ( internalFormat ) { case 4: case GL_RGBA: + case GL_COMPRESSED_RGBA: if ( format == GL_BGRA ) { if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) { return &_mesa_texformat_argb8888; @@ -434,6 +467,7 @@ case 3: case GL_RGB: + case GL_COMPRESSED_RGB: if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) { return &_mesa_texformat_rgb565; } @@ -468,6 +502,7 @@ case GL_ALPHA8: case GL_ALPHA12: case GL_ALPHA16: + case GL_COMPRESSED_ALPHA: return &_mesa_texformat_al88; case 1: @@ -476,6 +511,7 @@ case GL_LUMINANCE8: case GL_LUMINANCE12: case GL_LUMINANCE16: + case GL_COMPRESSED_LUMINANCE: return &_mesa_texformat_l8; case 2: @@ -486,6 +522,7 @@ case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: + case GL_COMPRESSED_LUMINANCE_ALPHA: return &_mesa_texformat_al88; case GL_INTENSITY: @@ -493,10 +530,18 @@ case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: + case GL_COMPRESSED_INTENSITY: return &_mesa_texformat_i8; + case GL_YCBCR_MESA: + if (type == GL_UNSIGNED_SHORT_8_8_MESA || + type == GL_UNSIGNED_BYTE) + return &_mesa_texformat_ycbcr; + else + return &_mesa_texformat_ycbcr_rev; + default: - fprintf(stderr, "unexpected texture format in %s", __FUNCTION__); + fprintf(stderr, "unexpected texture format in %s\n", __FUNCTION__); return NULL; } @@ -505,32 +550,29 @@ void i830DDInitTextureFuncs( GLcontext *ctx ) { - ctx->Driver.TexEnv = i830TexEnv; - ctx->Driver.ChooseTextureFormat = i830ChooseTextureFormat; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; - ctx->Driver.TexImage2D = i830TexImage2D; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; - ctx->Driver.TexSubImage2D = i830TexSubImage2D; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - ctx->Driver.BindTexture = i830BindTexture; - ctx->Driver.DeleteTexture = i830DeleteTexture; - ctx->Driver.TexParameter = i830TexParameter; - ctx->Driver.UpdateTexturePalette = 0; - ctx->Driver.IsTextureResident = i830IsTextureResident; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - { - GLuint tmp = ctx->Texture.CurrentUnit; - ctx->Texture.CurrentUnit = 0; - i830BindTexture( ctx, GL_TEXTURE_2D, ctx->Texture.Unit[0].Current2D); - ctx->Texture.CurrentUnit = 1; - i830BindTexture( ctx, GL_TEXTURE_2D, ctx->Texture.Unit[1].Current2D); - ctx->Texture.CurrentUnit = tmp; - } + i830ContextPtr imesa = I830_CONTEXT(ctx); + + ctx->Driver.TexEnv = i830TexEnv; + ctx->Driver.ChooseTextureFormat = i830ChooseTextureFormat; + ctx->Driver.TexImage1D = _mesa_store_teximage1d; + ctx->Driver.TexImage2D = i830TexImage2D; + ctx->Driver.TexImage3D = _mesa_store_teximage3d; + ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; + ctx->Driver.TexSubImage2D = i830TexSubImage2D; + ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + ctx->Driver.BindTexture = i830BindTexture; + ctx->Driver.DeleteTexture = i830DeleteTexture; + ctx->Driver.TexParameter = i830TexParameter; + ctx->Driver.UpdateTexturePalette = NULL; + ctx->Driver.IsTextureResident = driIsTextureResident; + ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + + driInitTextureObjects( ctx, & imesa->swapped, + DRI_TEXMGR_DO_TEXTURE_2D + | DRI_TEXMGR_DO_TEXTURE_RECT ); } Index: xc/lib/GL/mesa/src/drv/i830/i830_tex.h diff -u xc/lib/GL/mesa/src/drv/i830/i830_tex.h:1.1 xc/lib/GL/mesa/src/drv/i830/i830_tex.h:1.2 --- xc/lib/GL/mesa/src/drv/i830/i830_tex.h:1.1 Mon Sep 9 15:18:48 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_tex.h Sun Sep 28 16:15:14 2003 @@ -28,63 +28,44 @@ #define I830TEX_INC #include "mtypes.h" -#include "mmath.h" -#include "mm.h" #include "i830_context.h" #include "i830_3d_reg.h" +#include "texmem.h" #define I830_TEX_MAXLEVELS 10 struct i830_texture_object_t { - struct i830_texture_object_t *next, *prev; - GLuint age; - struct gl_texture_object *globj; - int Pitch; - int Height; - int texelBytes; - int totalSize; - int bound; - PMemBlock MemBlock; - char *BufAddr; - GLuint min_level; - GLuint max_level; - GLuint dirty_images; - GLenum palette_format; - GLuint palette[256]; - struct - { - const struct gl_texture_image *image; - int offset; /* into BufAddr */ - int height; - int internalFormat; - }image[I830_TEX_MAXLEVELS]; - - /* Support for multitexture. - * */ - GLuint current_unit; - GLuint Setup[I830_TEX_SETUP_SIZE]; - GLuint dirty; - GLuint firstLevel,lastLevel; + driTextureObject base; + + int texelBytes; + int Pitch; + int Height; + char *BufAddr; + GLenum palette_format; + GLuint palette[256]; + struct { + const struct gl_texture_image *image; + int offset; /* into BufAddr */ + int height; + int internalFormat; + } image[6][I830_TEX_MAXLEVELS]; + + /* Support for multitexture. + */ + + GLuint current_unit; + GLuint Setup[I830_TEX_SETUP_SIZE]; + GLuint dirty; + + GLfloat max_anisotropy; }; void i830UpdateTextureState( GLcontext *ctx ); void i830DDInitTextureFuncs( GLcontext *ctx ); void i830UpdateTexUnitProj( GLcontext *ctx, GLuint unit, GLboolean state ); - void i830DestroyTexObj( i830ContextPtr imesa, i830TextureObjectPtr t ); -void i830SwapOutTexObj( i830ContextPtr imesa, i830TextureObjectPtr t ); -int i830UploadTexImages( i830ContextPtr imesa, i830TextureObjectPtr t ); - -void i830ResetGlobalLRU( i830ContextPtr imesa ); -void i830TexturesGone( i830ContextPtr imesa, - GLuint start, GLuint end, - GLuint in_use ); - -void i830PrintLocalLRU( i830ContextPtr imesa ); -void i830PrintGlobalLRU( i830ContextPtr imesa ); -void i830UpdateTexLRU( i830ContextPtr imesa, i830TextureObjectPtr t ); - +int i830UploadTexImagesLocked( i830ContextPtr imesa, i830TextureObjectPtr t ); #endif Index: xc/lib/GL/mesa/src/drv/i830/i830_texmem.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_texmem.c:1.3 xc/lib/GL/mesa/src/drv/i830/i830_texmem.c:1.5 --- xc/lib/GL/mesa/src/drv/i830/i830_texmem.c:1.3 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_texmem.c Tue Nov 4 10:32:41 2003 @@ -25,7 +25,7 @@ **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_texmem.c,v 1.3 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_texmem.c,v 1.5 2003/11/04 15:32:41 tsi Exp $ */ /* * Author: @@ -35,9 +35,6 @@ * Keith Whitwell */ -#include -#include - #include "glheader.h" #include "macros.h" #include "mtypes.h" @@ -45,8 +42,6 @@ #include "enums.h" #include "texformat.h" -#include "mm.h" - #include "i830_screen.h" #include "i830_dri.h" @@ -58,261 +53,105 @@ void i830DestroyTexObj(i830ContextPtr imesa, i830TextureObjectPtr t) { - if (!t) return; - - /* This is sad - need to sync *in case* we upload a texture - * to this newly free memory... - */ - if (t->MemBlock) { - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (imesa && t->age > imesa->dirtyAge) - imesa->dirtyAge = t->age; - } - - if (t->globj) - t->globj->DriverData = 0; + unsigned i; - if (imesa) { - if (imesa->CurrentTexObj[0] == t) { - imesa->CurrentTexObj[0] = 0; - imesa->dirty &= ~I830_UPLOAD_TEX0; - } - if (imesa->CurrentTexObj[1] == t) { - imesa->CurrentTexObj[1] = 0; - imesa->dirty &= ~I830_UPLOAD_TEX1; + /* See if it was the driver's current object. + */ + if ( imesa != NULL ) { + for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ ) { + if ( t == imesa->CurrentTexObj[ i ] ) { + imesa->CurrentTexObj[ i ] = NULL; + imesa->dirty &= ~(I830_UPLOAD_TEX0 << i); + } } } - - remove_from_list(t); - free(t); } - -void i830SwapOutTexObj(i830ContextPtr imesa, i830TextureObjectPtr t) +#if defined(i386) || defined(__i386__) +/* From linux kernel i386 header files, copes with odd sizes better + * than COPY_DWORDS would: + */ +static __inline__ void * __memcpy(void * to, const void * from, size_t n) { -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - - if (t->MemBlock) { - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (t->age > imesa->dirtyAge) - imesa->dirtyAge = t->age; - } - - t->dirty_images = ~0; - move_to_tail(&(imesa->SwappedOut), t); -} - +int d0, d1, d2; +__asm__ __volatile__( + "rep ; movsl\n\t" + "testb $2,%b4\n\t" + "je 1f\n\t" + "movsw\n" + "1:\ttestb $1,%b4\n\t" + "je 2f\n\t" + "movsb\n" + "2:" + : "=&c" (d0), "=&D" (d1), "=&S" (d2) + :"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from) + : "memory"); +return (to); +} +#else +/* Allow compilation on other architectures */ +#define __memcpy memcpy +#endif /* Upload an image from mesa's internal copy. */ -static void i830UploadTexLevel( i830TextureObjectPtr t, int hwlevel ) +static void i830UploadTexLevel( i830ContextPtr imesa, + i830TextureObjectPtr t, int hwlevel ) { - int level = hwlevel + t->firstLevel; - const struct gl_texture_image *image = t->image[hwlevel].image; - int i,j; + const struct gl_texture_image *image = t->image[0][hwlevel].image; + int j; if (!image || !image->Data) return; - if (0) fprintf(stderr, "Uploading level : %d\n", level); - - switch (image->TexFormat->MesaFormat) { - case MESA_FORMAT_I8: - case MESA_FORMAT_L8: + if (image->Width * image->TexFormat->TexelBytes == t->Pitch) { + GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[0][hwlevel].offset); + GLubyte *src = (GLubyte *)image->Data; + + memcpy( dst, src, t->Pitch * image->Height ); + } + else switch (image->TexFormat->TexelBytes) { + case 1: { - GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset); + GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[0][hwlevel].offset); GLubyte *src = (GLubyte *)image->Data; for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = src[0]; - src++; - } + __memcpy(dst, src, image->Width ); + src += image->Width; } } break; - case MESA_FORMAT_AL88: - case MESA_FORMAT_RGB565: - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_ARGB4444: + case 2: { - GLushort *dst = (GLushort *)(t->BufAddr + t->image[hwlevel].offset); + GLushort *dst = (GLushort *)(t->BufAddr + t->image[0][hwlevel].offset); GLushort *src = (GLushort *)image->Data; for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = src[0]; - src++; - } + __memcpy(dst, src, image->Width * 2 ); + src += image->Width; } } break; - case MESA_FORMAT_ARGB8888: + case 4: { - GLuint *dst = (GLuint *)(t->BufAddr + t->image[hwlevel].offset); + GLuint *dst = (GLuint *)(t->BufAddr + t->image[0][hwlevel].offset); GLuint *src = (GLuint *)image->Data; for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/4)) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = src[0]; - src++; - } + __memcpy(dst, src, image->Width * 4 ); + src += image->Width; } } break; default: - fprintf(stderr, "Not supported texture format %s\n", - _mesa_lookup_enum_by_nr(image->Format)); - } -} - -void i830PrintLocalLRU( i830ContextPtr imesa ) -{ - i830TextureObjectPtr t; - int sz = 1 << (imesa->i830Screen->logTextureGranularity); - - foreach( t, &imesa->TexObjList ) { - if (!t->globj) - fprintf(stderr, "Placeholder %d at %x sz %x\n", - t->MemBlock->ofs / sz, - t->MemBlock->ofs, - t->MemBlock->size); - else - fprintf(stderr, "Texture at %x sz %x\n", - t->MemBlock->ofs, - t->MemBlock->size); - - } -} - -void i830PrintGlobalLRU( i830ContextPtr imesa ) -{ - int i, j; - I830TexRegion *list = imesa->sarea->texList; - - for (i = 0, j = I830_NR_TEX_REGIONS ; i < I830_NR_TEX_REGIONS ; i++) { - fprintf(stderr, "list[%d] age %d next %d prev %d\n", - j, list[j].age, list[j].next, list[j].prev); - j = list[j].next; - if (j == I830_NR_TEX_REGIONS) break; - } - - if (j != I830_NR_TEX_REGIONS) - fprintf(stderr, "Loop detected in global LRU\n"); -} - - -void i830ResetGlobalLRU( i830ContextPtr imesa ) -{ - I830TexRegion *list = imesa->sarea->texList; - int sz = 1 << imesa->i830Screen->logTextureGranularity; - int i; - - /* (Re)initialize the global circular LRU list. The last element - * in the array (I830_NR_TEX_REGIONS) is the sentinal. Keeping it - * at the end of the array allows it to be addressed rationally - * when looking up objects at a particular location in texture - * memory. - */ - for (i = 0 ; (i+1) * sz <= imesa->i830Screen->textureSize ; i++) { - list[i].prev = i-1; - list[i].next = i+1; - list[i].age = 0; - } - - i--; - list[0].prev = I830_NR_TEX_REGIONS; - list[i].prev = i-1; - list[i].next = I830_NR_TEX_REGIONS; - list[I830_NR_TEX_REGIONS].prev = i; - list[I830_NR_TEX_REGIONS].next = 0; - imesa->sarea->texAge = 0; -} - - -void i830UpdateTexLRU( i830ContextPtr imesa, i830TextureObjectPtr t ) -{ - int i; - int logsz = imesa->i830Screen->logTextureGranularity; - int start = t->MemBlock->ofs >> logsz; - int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz; - I830TexRegion *list = imesa->sarea->texList; - - imesa->texAge = ++imesa->sarea->texAge; - - /* Update our local LRU - */ - move_to_head( &(imesa->TexObjList), t ); - - /* Update the global LRU - */ - for (i = start ; i <= end ; i++) { - - list[i].in_use = 1; - list[i].age = imesa->texAge; - - /* remove_from_list(i) - */ - list[(unsigned)list[i].next].prev = list[i].prev; - list[(unsigned)list[i].prev].next = list[i].next; - - /* insert_at_head(list, i) - */ - list[i].prev = I830_NR_TEX_REGIONS; - list[i].next = list[I830_NR_TEX_REGIONS].next; - list[(unsigned)list[I830_NR_TEX_REGIONS].next].prev = i; - list[I830_NR_TEX_REGIONS].next = i; - } -} - - -/* Called for every shared texture region which has increased in age - * since we last held the lock. - * - * Figures out which of our textures have been ejected by other clients, - * and pushes a placeholder texture onto the LRU list to represent - * the other client's textures. - */ -void i830TexturesGone( i830ContextPtr imesa, - GLuint offset, - GLuint size, - GLuint in_use ) -{ - i830TextureObjectPtr t, tmp; - - if (I830_DEBUG&DEBUG_TEXTURE) - fprintf(stderr, "%s\n", __FUNCTION__); - - foreach_s ( t, tmp, &imesa->TexObjList ) { - if (t->MemBlock == 0 || - t->MemBlock->ofs >= offset + size || - t->MemBlock->ofs + t->MemBlock->size <= offset) - continue; - - /* It overlaps - kick it off. Need to hold onto the currently bound - * objects, however. - */ - if (t->bound) - i830SwapOutTexObj( imesa, t ); - else - i830DestroyTexObj( imesa, t ); - } - - if (in_use) { - t = (i830TextureObjectPtr) calloc(1,sizeof(*t)); - if (!t) return; - - t->MemBlock = mmAllocMem( imesa->texHeap, size, 0, offset); - insert_at_head( &imesa->TexObjList, t ); + fprintf(stderr, "%s: Not supported texel size %d\n", + __FUNCTION__, image->TexFormat->TexelBytes); } } @@ -321,39 +160,21 @@ * other client's texture objects to make room for the upload. */ -int i830UploadTexImages( i830ContextPtr imesa, i830TextureObjectPtr t ) +int i830UploadTexImagesLocked( i830ContextPtr imesa, i830TextureObjectPtr t ) { - int i; int ofs; - int numLevels; - - /* Do we need to eject LRU texture objects? - */ - if (!t->MemBlock) { - while (1) - { - t->MemBlock = mmAllocMem( imesa->texHeap, t->totalSize, 12, 0 ); - if (t->MemBlock) - break; -/* - if (imesa->TexObjList.prev == imesa->CurrentTexObj[0] || - imesa->TexObjList.prev == imesa->CurrentTexObj[1]) { - fprintf(stderr, "Hit bound texture in upload\n"); - i830PrintLocalLRU( imesa ); - return -1; - } -*/ - if (imesa->TexObjList.prev == &(imesa->TexObjList)) { - fprintf(stderr, "Failed to upload texture, sz %d\n", t->totalSize); - mmDumpMemInfo( imesa->texHeap ); - return -1; - } + if ( t->base.memBlock == NULL ) { + int heap; - i830SwapOutTexObj( imesa, imesa->TexObjList.prev ); + heap = driAllocateTexture( imesa->texture_heaps, imesa->nr_heaps, + (driTextureObject *) t ); + if ( heap == -1 ) { + return -1; } - ofs = t->MemBlock->ofs; + /* Set the base offset of the texture image */ + ofs = t->base.memBlock->ofs; t->BufAddr = imesa->i830Screen->tex.map + ofs; t->Setup[I830_TEXREG_TM0S0] = (TM0S0_USE_FENCE | (imesa->i830Screen->textureOffset + ofs)); @@ -370,20 +191,29 @@ if (t == imesa->CurrentTexObj[3]) I830_STATECHANGE(imesa, I830_UPLOAD_TEX3); #endif - if (t->MemBlock) - i830UpdateTexLRU( imesa, t ); } - if (imesa->dirtyAge >= GET_DISPATCH_AGE(imesa)) - i830WaitAgeLocked( imesa, imesa->dirtyAge ); - numLevels = t->lastLevel - t->firstLevel + 1; - for (i = 0 ; i < numLevels ; i++) - if (t->dirty_images & (1<<(i+t->firstLevel))) - i830UploadTexLevel( t, i ); + /* Let the world know we've used this memory recently. + */ + driUpdateTextureLRU( (driTextureObject *) t ); + + if (imesa->texture_heaps[0]->timestamp >= GET_DISPATCH_AGE(imesa)) + i830WaitAgeLocked( imesa, imesa->texture_heaps[0]->timestamp ); - t->dirty_images = 0; - imesa->sarea->perf_boxes |= I830_BOX_TEXTURE_LOAD; + /* Upload any images that are new */ + if (t->base.dirty_images[0]) { + int i; + const int numLevels = t->base.lastLevel - t->base.firstLevel + 1; + + for (i = 0 ; i < numLevels ; i++) { + if ( (t->base.dirty_images[0] & (1 << (i+t->base.firstLevel))) != 0 ) { + i830UploadTexLevel( imesa, t, i ); + } + } + t->base.dirty_images[0] = 0; + imesa->sarea->perf_boxes |= I830_BOX_TEXTURE_LOAD; + } return 0; } Index: xc/lib/GL/mesa/src/drv/i830/i830_texstate.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_texstate.c:1.3 xc/lib/GL/mesa/src/drv/i830/i830_texstate.c:1.5 --- xc/lib/GL/mesa/src/drv/i830/i830_texstate.c:1.3 Mon Dec 9 20:26:53 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_texstate.c Tue Dec 2 08:02:37 2003 @@ -25,7 +25,7 @@ **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_texstate.c,v 1.3 2002/12/10 01:26:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_texstate.c,v 1.5 2003/12/02 13:02:37 alanh Exp $ */ /* * Author: @@ -34,8 +34,6 @@ * Heavily based on the I810 driver, which was written by: * Keith Whitwell */ -#include -#include #include "glheader.h" #include "macros.h" @@ -61,11 +59,10 @@ static void i830SetTexImages( i830ContextPtr imesa, struct gl_texture_object *tObj ) { - GLuint height, width, pitch, i, textureFormat; + GLuint total_height, pitch, i, textureFormat; i830TextureObjectPtr t = (i830TextureObjectPtr) tObj->DriverData; const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel]; - GLint firstLevel, lastLevel, numLevels; - GLint log2Width, log2Height; + GLint numLevels; switch( baseImage->TexFormat->MesaFormat ) { case MESA_FORMAT_L8: @@ -103,6 +100,18 @@ textureFormat = MAPSURF_32BIT | MT_32BIT_ARGB8888; break; + case MESA_FORMAT_YCBCR_REV: + t->texelBytes = 2; + textureFormat = (MAPSURF_422 | MT_422_YCRCB_NORMAL | + TM0S1_COLORSPACE_CONVERSION); + break; + + case MESA_FORMAT_YCBCR: + t->texelBytes = 2; + textureFormat = (MAPSURF_422 | MT_422_YCRCB_SWAPY | /* ??? */ + TM0S1_COLORSPACE_CONVERSION); + break; + default: fprintf(stderr, "%s: bad image format\n", __FUNCTION__); free( t ); @@ -110,77 +119,59 @@ } /* Compute which mipmap levels we really want to send to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. - * Yes, this looks overly complicated, but it's all needed. */ - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ - - /* save these values */ - t->firstLevel = firstLevel; - t->lastLevel = lastLevel; - - numLevels = lastLevel - firstLevel + 1; - - if (0) fprintf(stderr, - "%s : " - "NumLevels : %d\n" - "firstLevel : %d\n" - "lastLevel : %d\n", - __FUNCTION__, - numLevels, - firstLevel, - lastLevel); - log2Width = tObj->Image[firstLevel]->WidthLog2; - log2Height = tObj->Image[firstLevel]->HeightLog2; + driCalculateTextureFirstLastLevel( (driTextureObject *) t ); + /* Figure out the amount of memory required to hold all the mipmap * levels. Choose the smallest pitch to accomodate the largest * mipmap: */ - width = tObj->Image[firstLevel]->Width * t->texelBytes; + numLevels = t->base.lastLevel - t->base.firstLevel + 1; + + /* Pitch would be subject to additional rules if texture memory were + * tiled. Currently it isn't. + */ + if (0) { + pitch = 128; + while (pitch < tObj->Image[t->base.firstLevel]->Width * t->texelBytes) + pitch *= 2; + } + else { + pitch = tObj->Image[t->base.firstLevel]->Width * t->texelBytes; + pitch = (pitch + 3) & ~3; + } - pitch = width; /* All images must be loaded at this pitch. Count the number of * lines required: */ - for ( height = i = 0 ; i < numLevels ; i++ ) { - t->image[i].image = tObj->Image[firstLevel + i]; - if (!t->image[i].image) { - break; - } - t->image[i].offset = height * pitch; - t->image[i].internalFormat = baseImage->Format; - height += t->image[i].image->Height; + for ( total_height = i = 0 ; i < numLevels ; i++ ) { + t->image[0][i].image = tObj->Image[t->base.firstLevel + i]; + if (!t->image[0][i].image) + break; + + t->image[0][i].offset = total_height * pitch; + t->image[0][i].internalFormat = baseImage->Format; + total_height += t->image[0][i].image->Height; } t->Pitch = pitch; - t->totalSize = height*pitch; - t->max_level = i-1; - + t->base.totalSize = total_height*pitch; t->Setup[I830_TEXREG_TM0S1] = - ((((1 << log2Height) - 1) << TM0S1_HEIGHT_SHIFT) | - (((1 << log2Width) - 1) << TM0S1_WIDTH_SHIFT) | + (((tObj->Image[t->base.firstLevel]->Height - 1) << TM0S1_HEIGHT_SHIFT) | + ((tObj->Image[t->base.firstLevel]->Width - 1) << TM0S1_WIDTH_SHIFT) | textureFormat); t->Setup[I830_TEXREG_TM0S2] = - ((((pitch / 4) - 1) << TM0S2_PITCH_SHIFT)); - + ((((pitch / 4) - 1) << TM0S2_PITCH_SHIFT)); t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MAX_MIP_MASK; t->Setup[I830_TEXREG_TM0S3] &= ~TM0S3_MIN_MIP_MASK; - t->Setup[I830_TEXREG_TM0S3] |= - ((numLevels - 1)*4) << TM0S3_MIN_MIP_SHIFT; - + t->Setup[I830_TEXREG_TM0S3] |= ((numLevels - 1)*4) << TM0S3_MIN_MIP_SHIFT; t->dirty = I830_UPLOAD_TEX0 | I830_UPLOAD_TEX1; + LOCK_HARDWARE( imesa ); - i830UploadTexImages( imesa, t ); + i830UploadTexImagesLocked( imesa, t ); UNLOCK_HARDWARE( imesa ); } @@ -245,6 +236,7 @@ break; case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: imesa->TexBlend[curTex][0] = (STATE3D_MAP_BLEND_OP_CMD(curTex) | TEXPIPE_COLOR | ENABLE_TEXOUTPUT_WRT_SEL | @@ -377,6 +369,7 @@ case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: imesa->TexBlend[curTex][0] = (STATE3D_MAP_BLEND_OP_CMD(curTex) | TEXPIPE_COLOR | ENABLE_TEXOUTPUT_WRT_SEL | @@ -488,6 +481,7 @@ case GL_DECAL: switch(format) { case GL_RGB: + case GL_YCBCR_MESA: imesa->TexBlend[curTex][0] = (STATE3D_MAP_BLEND_OP_CMD(curTex) | TEXPIPE_COLOR | ENABLE_TEXOUTPUT_WRT_SEL | @@ -629,6 +623,7 @@ case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: imesa->TexBlend[curTex][0] = (STATE3D_MAP_BLEND_OP_CMD(curTex) | TEXPIPE_COLOR | ENABLE_TEXOUTPUT_WRT_SEL | @@ -834,6 +829,7 @@ break; case GL_LUMINANCE: case GL_RGB: + case GL_YCBCR_MESA: imesa->TexBlend[curTex][0] = (STATE3D_MAP_BLEND_OP_CMD(curTex) | TEXPIPE_COLOR | ENABLE_TEXOUTPUT_WRT_SEL | @@ -1025,6 +1021,8 @@ GLuint args_RGB[3]; GLuint args_A[3]; GLuint texel_op = GetTexelOp(unit); + GLuint rgb_shift = texUnit->CombineScaleShiftRGB; + GLuint alpha_shift = texUnit->CombineScaleShiftA; int i; if(I830_DEBUG&DEBUG_TEXTURE) @@ -1040,33 +1038,35 @@ case GL_ADD: blendop = TEXBLENDOP_ADD; break; - case GL_ADD_SIGNED_ARB: + case GL_ADD_SIGNED: blendop = TEXBLENDOP_ADDSIGNED; break; - case GL_INTERPOLATE_ARB: + case GL_INTERPOLATE: blendop = TEXBLENDOP_BLEND; break; - case GL_SUBTRACT_ARB: + case GL_SUBTRACT: blendop = TEXBLENDOP_SUBTRACT; break; - default: - return; - } - - switch(texUnit->CombineScaleShiftRGB) { - case 0: - blendop |= TEXOP_SCALE_1X; - break; - case 1: - blendop |= TEXOP_SCALE_2X; - break; - case 2: - blendop |= TEXOP_SCALE_4X; + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + /* The EXT version of the DOT3 extension does not support the + * scale factor, but the ARB version (and the version in OpenGL + * 1.3) does. + */ + rgb_shift = 0; + alpha_shift = 0; + /* FALLTHROUGH */ + + case GL_DOT3_RGB: + case GL_DOT3_RGBA: + blendop = TEXBLENDOP_DOT3; break; default: return; } + blendop |= (rgb_shift << TEXOP_SCALE_SHIFT); + switch(texUnit->CombineModeA) { case GL_REPLACE: ablendop = TEXBLENDOP_ARG1; @@ -1077,46 +1077,39 @@ case GL_ADD: ablendop = TEXBLENDOP_ADD; break; - case GL_ADD_SIGNED_ARB: + case GL_ADD_SIGNED: ablendop = TEXBLENDOP_ADDSIGNED; break; - case GL_INTERPOLATE_ARB: + case GL_INTERPOLATE: ablendop = TEXBLENDOP_BLEND; break; - case GL_SUBTRACT_ARB: + case GL_SUBTRACT: ablendop = TEXBLENDOP_SUBTRACT; break; default: return; } - switch(texUnit->CombineScaleShiftA) { - case 0: - ablendop |= TEXOP_SCALE_1X; - break; - case 1: - ablendop |= TEXOP_SCALE_2X; - break; - case 2: - ablendop |= TEXOP_SCALE_4X; - break; - default: - return; + if ( (texUnit->CombineModeRGB == GL_DOT3_RGBA_EXT) + || (texUnit->CombineModeRGB == GL_DOT3_RGBA) ) { + ablendop = TEXBLENDOP_DOT3; } + ablendop |= (alpha_shift << TEXOP_SCALE_SHIFT); + /* Handle RGB args */ for(i = 0; i < 3; i++) { switch(texUnit->CombineSourceRGB[i]) { case GL_TEXTURE: args_RGB[i] = texel_op; break; - case GL_CONSTANT_ARB: + case GL_CONSTANT: args_RGB[i] = TEXBLENDARG_FACTOR_N; break; - case GL_PRIMARY_COLOR_ARB: + case GL_PRIMARY_COLOR: args_RGB[i] = TEXBLENDARG_DIFFUSE; break; - case GL_PREVIOUS_ARB: + case GL_PREVIOUS: args_RGB[i] = TEXBLENDARG_CURRENT; break; default: @@ -1149,13 +1142,13 @@ case GL_TEXTURE: args_A[i] = texel_op; break; - case GL_CONSTANT_ARB: + case GL_CONSTANT: args_A[i] = TEXBLENDARG_FACTOR_N; break; - case GL_PRIMARY_COLOR_ARB: + case GL_PRIMARY_COLOR: args_A[i] = TEXBLENDARG_DIFFUSE; break; - case GL_PREVIOUS_ARB: + case GL_PREVIOUS: args_A[i] = TEXBLENDARG_CURRENT; break; default: @@ -1267,7 +1260,7 @@ if (0) fprintf(stderr, "i830UpdateTexEnv called : %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode)); - if(texUnit->EnvMode == GL_COMBINE_ARB) { + if(texUnit->EnvMode == GL_COMBINE) { i830SetTexEnvCombine(imesa, texUnit, unit); @@ -1275,7 +1268,7 @@ i830SetBlend_GL1_2(imesa, unit, texUnit->EnvMode, - t->image[0].internalFormat); + t->image[0][0].internalFormat); /* add blend color */ { @@ -1308,151 +1301,249 @@ } +/* This is bogus -- can't load the same texture object on two units. + */ static void i830TexSetUnit( i830TextureObjectPtr t, GLuint unit ) { - if(I830_DEBUG&DEBUG_TEXTURE) - fprintf(stderr, "%s unit(%d)\n", __FUNCTION__, unit); + if(I830_DEBUG&DEBUG_TEXTURE) + fprintf(stderr, "%s unit(%d)\n", __FUNCTION__, unit); - t->Setup[I830_TEXREG_TM0LI] = (STATE3D_LOAD_STATE_IMMEDIATE_2 | - (LOAD_TEXTURE_MAP0 << unit) | 4); + t->Setup[I830_TEXREG_TM0LI] = (STATE3D_LOAD_STATE_IMMEDIATE_2 | + (LOAD_TEXTURE_MAP0 << unit) | 4); - I830_SET_FIELD(t->Setup[I830_TEXREG_MCS], MAP_UNIT_MASK, MAP_UNIT(unit)); - - t->current_unit = unit; + I830_SET_FIELD(t->Setup[I830_TEXREG_MCS], MAP_UNIT_MASK, MAP_UNIT(unit)); + + t->current_unit = unit; + t->base.bound |= (1U << unit); } #define TEXCOORDTYPE_MASK (~((1<<13)|(1<<12)|(1<<11))) -static void i830UpdateTexUnit( GLcontext *ctx, GLuint unit ) + +static GLboolean enable_tex_common( GLcontext *ctx, GLuint unit ) { i830ContextPtr imesa = I830_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *tObj = texUnit->_Current; + i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData; + GLuint mcs = t->Setup[I830_TEXREG_MCS] & TEXCOORDTYPE_MASK; - imesa->TexEnabledMask &= ~(I830_TEX_UNIT_ENABLED(unit)); + /* Handle projective texturing */ + if (imesa->vertex_format & (1<<31)) { + mcs |= TEXCOORDTYPE_HOMOGENEOUS; + } else { + mcs |= TEXCOORDTYPE_CARTESIAN; + } - if (texUnit->_ReallyEnabled == TEXTURE0_2D) - { - struct gl_texture_object *tObj = texUnit->_Current; - i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData; - GLuint mcs = t->Setup[I830_TEXREG_MCS] & TEXCOORDTYPE_MASK; - - /* Handle projective texturing */ - if (imesa->vertex_format & (1<<31)) { - mcs |= TEXCOORDTYPE_HOMOGENEOUS; - } else { - mcs |= TEXCOORDTYPE_CARTESIAN; - } + /* Fallback if there's a texture border */ + if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) { + return GL_FALSE; + } - /* Fallback if there's a texture border */ - if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) { - FALLBACK( imesa, I830_FALLBACK_TEXTURE, GL_TRUE ); - return; + /* Upload teximages (not pipelined) + */ + if (t->base.dirty_images[0]) { + i830SetTexImages( imesa, tObj ); + if (!t->base.memBlock) { + return GL_FALSE; } + } - /* Upload teximages (not pipelined) - */ - if (t->dirty_images) { -/* I830_FIREVERTICES(imesa); */ - i830SetTexImages( imesa, tObj ); - if (!t->MemBlock) { - FALLBACK( imesa, I830_FALLBACK_TEXTURE, GL_TRUE ); - return; - } - } + /* Update state if this is a different texture object to last + * time. + */ + if (imesa->CurrentTexObj[unit] != t || + mcs != t->Setup[I830_TEXREG_MCS]) { - /* Update state if this is a different texture object to last - * time. - */ - if (imesa->CurrentTexObj[unit] != t || - mcs != t->Setup[I830_TEXREG_MCS]) { - I830_STATECHANGE(imesa, (I830_UPLOAD_TEX0<Setup[I830_TEXREG_MCS] = mcs; - imesa->CurrentTexObj[unit] = t; - i830TexSetUnit(t, unit); + if ( imesa->CurrentTexObj[unit] != NULL ) { + /* The old texture is no longer bound to this texture unit. + * Mark it as such. + */ + + imesa->CurrentTexObj[unit]->base.bound &= ~(1U << unit); } - /* Update texture environment if texture object image format or - * texture environment state has changed. - * - * KW: doesn't work -- change from tex0 only to tex0+tex1 gets - * missed (need to update last stage flag?). Call - * i830UpdateTexEnv always. + I830_STATECHANGE(imesa, (I830_UPLOAD_TEX0<Setup[I830_TEXREG_MCS] = mcs; + imesa->CurrentTexObj[unit] = t; + i830TexSetUnit(t, unit); + } + + /* Update texture environment if texture object image format or + * texture environment state has changed. + * + * KW: doesn't work -- change from tex0 only to tex0+tex1 gets + * missed (need to update last stage flag?). Call + * i830UpdateTexEnv always. + */ + if (tObj->Image[tObj->BaseLevel]->Format != + imesa->TexEnvImageFmt[unit]) { + imesa->TexEnvImageFmt[unit] = tObj->Image[tObj->BaseLevel]->Format; + } + i830UpdateTexEnv( ctx, unit ); + imesa->TexEnabledMask |= I830_TEX_UNIT_ENABLED(unit); + + return GL_TRUE; +} + +static GLboolean enable_tex_rect( GLcontext *ctx, GLuint unit ) +{ + i830ContextPtr imesa = I830_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *tObj = texUnit->_Current; + i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData; + GLuint mcs = t->Setup[I830_TEXREG_MCS]; + + mcs &= ~TEXCOORDS_ARE_NORMAL; + mcs |= TEXCOORDS_ARE_IN_TEXELUNITS; + + if (mcs != t->Setup[I830_TEXREG_MCS]) { + I830_STATECHANGE(imesa, (I830_UPLOAD_TEX0<Setup[I830_TEXREG_MCS] = mcs; + } + + return GL_TRUE; +} + + +static GLboolean enable_tex_2d( GLcontext *ctx, GLuint unit ) +{ + i830ContextPtr imesa = I830_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *tObj = texUnit->_Current; + i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData; + GLuint mcs = t->Setup[I830_TEXREG_MCS]; + + mcs &= ~TEXCOORDS_ARE_IN_TEXELUNITS; + mcs |= TEXCOORDS_ARE_NORMAL; + + if (mcs != t->Setup[I830_TEXREG_MCS]) { + I830_STATECHANGE(imesa, (I830_UPLOAD_TEX0<Setup[I830_TEXREG_MCS] = mcs; + } + + return GL_TRUE; +} + + +static GLboolean disable_tex0( GLcontext *ctx ) +{ + const int unit = 0; + i830ContextPtr imesa = I830_CONTEXT(ctx); + + /* This is happening too often. I need to conditionally send diffuse + * state to the card. Perhaps a diffuse dirty flag of some kind. + * Will need to change this logic if more than 2 texture units are + * used. We need to only do this up to the last unit enabled, or unit + * one if nothing is enabled. + */ + + if ( imesa->CurrentTexObj[unit] != NULL ) { + /* The old texture is no longer bound to this texture unit. + * Mark it as such. */ - if (tObj->Image[tObj->BaseLevel]->Format != - imesa->TexEnvImageFmt[unit]) { - imesa->TexEnvImageFmt[unit] = tObj->Image[tObj->BaseLevel]->Format; - } - i830UpdateTexEnv( ctx, unit ); - imesa->TexEnabledMask |= I830_TEX_UNIT_ENABLED(unit); + + imesa->CurrentTexObj[unit]->base.bound &= ~(1U << unit); + imesa->CurrentTexObj[unit] = NULL; + } + + imesa->TexEnvImageFmt[unit] = 0; + imesa->dirty &= ~(I830_UPLOAD_TEX_N(unit)); + + imesa->TexBlend[unit][0] = (STATE3D_MAP_BLEND_OP_CMD(unit) | + TEXPIPE_COLOR | + ENABLE_TEXOUTPUT_WRT_SEL | + TEXOP_OUTPUT_CURRENT | + DISABLE_TEX_CNTRL_STAGE | + TEXOP_SCALE_1X | + TEXOP_MODIFY_PARMS | + TEXBLENDOP_ARG1); + imesa->TexBlend[unit][1] = (STATE3D_MAP_BLEND_OP_CMD(unit) | + TEXPIPE_ALPHA | + ENABLE_TEXOUTPUT_WRT_SEL | + TEXOP_OUTPUT_CURRENT | + TEXOP_SCALE_1X | + TEXOP_MODIFY_PARMS | + TEXBLENDOP_ARG1); + imesa->TexBlend[unit][2] = (STATE3D_MAP_BLEND_ARG_CMD(unit) | + TEXPIPE_COLOR | + TEXBLEND_ARG1 | + TEXBLENDARG_MODIFY_PARMS | + TEXBLENDARG_CURRENT); + imesa->TexBlend[unit][3] = (STATE3D_MAP_BLEND_ARG_CMD(unit) | + TEXPIPE_ALPHA | + TEXBLEND_ARG1 | + TEXBLENDARG_MODIFY_PARMS | + TEXBLENDARG_CURRENT); + imesa->TexBlendColorPipeNum[unit] = 0; + imesa->TexBlendWordsUsed[unit] = 4; + I830_STATECHANGE(imesa, (I830_UPLOAD_TEXBLEND_N(unit))); + + return GL_TRUE; +} + +static GLboolean i830UpdateTexUnit( GLcontext *ctx, GLuint unit ) +{ + i830ContextPtr imesa = I830_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + + imesa->TexEnabledMask &= ~(I830_TEX_UNIT_ENABLED(unit)); + + if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) { + return (enable_tex_common( ctx, unit ) && + enable_tex_2d( ctx, unit )); + } + else if (texUnit->_ReallyEnabled == TEXTURE_RECT_BIT) { + return (enable_tex_common( ctx, unit ) && + enable_tex_rect( ctx, unit )); } else if (texUnit->_ReallyEnabled) { - FALLBACK( imesa, I830_FALLBACK_TEXTURE, GL_TRUE ); + return GL_FALSE; } else if (unit == 0) { - /* This is happening too often. I need to conditionally send diffuse - * state to the card. Perhaps a diffuse dirty flag of some kind. - * Will need to change this logic if more than 2 texture units are - * used. We need to only do this up to the last unit enabled, or unit - * one if nothing is enabled. - */ - imesa->CurrentTexObj[unit] = 0; - imesa->TexEnvImageFmt[unit] = 0; - imesa->dirty &= ~(I830_UPLOAD_TEX_N(unit)); - - imesa->TexBlend[unit][0] = (STATE3D_MAP_BLEND_OP_CMD(unit) | - TEXPIPE_COLOR | - ENABLE_TEXOUTPUT_WRT_SEL | - TEXOP_OUTPUT_CURRENT | - DISABLE_TEX_CNTRL_STAGE | - TEXOP_SCALE_1X | - TEXOP_MODIFY_PARMS | - TEXBLENDOP_ARG1); - imesa->TexBlend[unit][1] = (STATE3D_MAP_BLEND_OP_CMD(unit) | - TEXPIPE_ALPHA | - ENABLE_TEXOUTPUT_WRT_SEL | - TEXOP_OUTPUT_CURRENT | - TEXOP_SCALE_1X | - TEXOP_MODIFY_PARMS | - TEXBLENDOP_ARG1); - imesa->TexBlend[unit][2] = (STATE3D_MAP_BLEND_ARG_CMD(unit) | - TEXPIPE_COLOR | - TEXBLEND_ARG1 | - TEXBLENDARG_MODIFY_PARMS | - TEXBLENDARG_CURRENT); - imesa->TexBlend[unit][3] = (STATE3D_MAP_BLEND_ARG_CMD(unit) | - TEXPIPE_ALPHA | - TEXBLEND_ARG1 | - TEXBLENDARG_MODIFY_PARMS | - TEXBLENDARG_CURRENT); - imesa->TexBlendColorPipeNum[unit] = 0; - imesa->TexBlendWordsUsed[unit] = 4; - I830_STATECHANGE(imesa, (I830_UPLOAD_TEXBLEND_N(unit))); + return disable_tex0( ctx ); + } + else { + return GL_TRUE; } } + /* Called from vb code to update projective texturing properly */ void i830UpdateTexUnitProj( GLcontext *ctx, GLuint unit, GLboolean state ) { i830ContextPtr imesa = I830_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *tObj = texUnit->_Current; + i830TextureObjectPtr t; + GLuint mcs; + + if (!tObj) return; + + t = (i830TextureObjectPtr)tObj->DriverData; + mcs = (t->Setup[I830_TEXREG_MCS] & + TEXCOORDTYPE_MASK & + ~TEXCOORDS_ARE_NORMAL); + + /* Handle projective texturing */ + if (state) { + mcs |= TEXCOORDTYPE_HOMOGENEOUS; + } else { + mcs |= TEXCOORDTYPE_CARTESIAN; + } + + if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) { + mcs |= TEXCOORDS_ARE_NORMAL; + } + else if (texUnit->_ReallyEnabled == TEXTURE_RECT_BIT) { + mcs |= TEXCOORDS_ARE_IN_TEXELUNITS; + } + else + return; - if (texUnit->_ReallyEnabled == TEXTURE0_2D) - { - struct gl_texture_object *tObj = texUnit->_Current; - i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData; - GLuint mcs = t->Setup[I830_TEXREG_MCS] & TEXCOORDTYPE_MASK; - - /* Handle projective texturing */ - if (state) { - mcs |= TEXCOORDTYPE_HOMOGENEOUS; - } else { - mcs |= TEXCOORDTYPE_CARTESIAN; - } - - if (mcs != t->Setup[I830_TEXREG_MCS]) { - I830_STATECHANGE(imesa, (I830_UPLOAD_TEX0<Setup[I830_TEXREG_MCS] = mcs; - } + if (mcs != t->Setup[I830_TEXREG_MCS]) { + I830_STATECHANGE(imesa, (I830_UPLOAD_TEX0<Setup[I830_TEXREG_MCS] = mcs; } } @@ -1461,35 +1552,29 @@ { i830ContextPtr imesa = I830_CONTEXT(ctx); int pipe_num = 0; + GLboolean ok; + + ok = (i830UpdateTexUnit( ctx, 0 ) && + i830UpdateTexUnit( ctx, 1 ) && + i830UpdateTexUnit( ctx, 2 ) && + i830UpdateTexUnit( ctx, 3 )); - if (0) fprintf(stderr, "%s\n", __FUNCTION__); - FALLBACK( imesa, I830_FALLBACK_TEXTURE, GL_FALSE ); + FALLBACK( imesa, I830_FALLBACK_TEXTURE, !ok ); - i830UpdateTexUnit( ctx, 0 ); - i830UpdateTexUnit( ctx, 1 ); -#if 0 - i830UpdateTexUnit( ctx, 2 ); - i830UpdateTexUnit( ctx, 3 ); -#endif /* Make sure last stage is set correctly */ -#if 0 if(imesa->TexEnabledMask & I830_TEX_UNIT_ENABLED(3)) { pipe_num = imesa->TexBlendColorPipeNum[3]; imesa->TexBlend[3][pipe_num] |= TEXOP_LAST_STAGE; } else if(imesa->TexEnabledMask & I830_TEX_UNIT_ENABLED(2)) { pipe_num = imesa->TexBlendColorPipeNum[2]; imesa->TexBlend[2][pipe_num] |= TEXOP_LAST_STAGE; - } else -#endif - if(imesa->TexEnabledMask & I830_TEX_UNIT_ENABLED(1)) { + } else if(imesa->TexEnabledMask & I830_TEX_UNIT_ENABLED(1)) { pipe_num = imesa->TexBlendColorPipeNum[1]; imesa->TexBlend[1][pipe_num] |= TEXOP_LAST_STAGE; - if (0) fprintf(stderr, "Unit One is last enabled\n"); } else { pipe_num = imesa->TexBlendColorPipeNum[0]; imesa->TexBlend[0][pipe_num] |= TEXOP_LAST_STAGE; - if (0) fprintf(stderr, "Unit Zero is last enabled\n"); } } Index: xc/lib/GL/mesa/src/drv/i830/i830_tris.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_tris.c:1.4 xc/lib/GL/mesa/src/drv/i830/i830_tris.c:1.5 --- xc/lib/GL/mesa/src/drv/i830/i830_tris.c:1.4 Mon Dec 9 20:26:54 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_tris.c Sun Sep 28 16:15:15 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_tris.c,v 1.4 2002/12/10 01:26:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_tris.c,v 1.5 2003/09/28 20:15:15 alanh Exp $ */ /************************************************************************** Copyright 2001 VA Linux Systems Inc., Fremont, California. @@ -33,9 +33,6 @@ * Jeff Hartmann */ -#include -#include - #include "glheader.h" #include "context.h" #include "macros.h" @@ -666,21 +663,21 @@ { i830ContextPtr imesa = I830_CONTEXT(ctx); - if (imesa->new_state) { - if (imesa->new_state & _NEW_TEXTURE) { + if (imesa->NewGLState) { + if (imesa->NewGLState & _NEW_TEXTURE) { I830_FIREVERTICES( imesa ); - i830UpdateTextureState( ctx ); /* may modify imesa->new_state */ + i830UpdateTextureState( ctx ); /* may modify imesa->NewGLState */ } if (!imesa->Fallback) { - if (imesa->new_state & _I830_NEW_VERTEX) + if (imesa->NewGLState & _I830_NEW_VERTEX) i830ChooseVertexState( ctx ); - if (imesa->new_state & _I830_NEW_RENDERSTATE) + if (imesa->NewGLState & _I830_NEW_RENDERSTATE) i830ChooseRenderState( ctx ); } - imesa->new_state = 0; + imesa->NewGLState = 0; } _tnl_run_pipeline( ctx ); @@ -851,7 +848,7 @@ tnl->Driver.Render.PrimitiveNotify = i830RenderPrimitive; tnl->Driver.Render.Finish = i830RenderFinish; tnl->Driver.Render.BuildVertices = i830BuildVertices; - imesa->new_state |= (_I830_NEW_RENDERSTATE|_I830_NEW_VERTEX); + imesa->NewGLState |= (_I830_NEW_RENDERSTATE|_I830_NEW_VERTEX); } } } Index: xc/lib/GL/mesa/src/drv/i830/i830_vb.c diff -u xc/lib/GL/mesa/src/drv/i830/i830_vb.c:1.5 xc/lib/GL/mesa/src/drv/i830/i830_vb.c:1.6 --- xc/lib/GL/mesa/src/drv/i830/i830_vb.c:1.5 Mon Dec 9 20:26:54 2002 +++ xc/lib/GL/mesa/src/drv/i830/i830_vb.c Sun Sep 28 16:15:15 2003 @@ -23,14 +23,13 @@ * Adapted for use on the I830M: * Jeff Hartmann */ -/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_vb.c,v 1.5 2002/12/10 01:26:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/i830/i830_vb.c,v 1.6 2003/09/28 20:15:15 alanh Exp $ */ #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "colormac.h" -#include "mmath.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" @@ -446,24 +445,24 @@ if (!newinputs) return; - if (newinputs & VERT_CLIP) { + if (newinputs & VERT_BIT_CLIP) { setup_tab[imesa->SetupIndex].emit( ctx, start, count, v, stride ); } else { GLuint ind = 0; - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) ind |= I830_RGBA_BIT; - if (newinputs & VERT_SPEC_RGB) + if (newinputs & VERT_BIT_COLOR1) ind |= I830_SPEC_BIT; - if (newinputs & VERT_TEX0) + if (newinputs & VERT_BIT_TEX0) ind |= I830_TEX0_BIT; - if (newinputs & VERT_TEX1) + if (newinputs & VERT_BIT_TEX1) ind |= I830_TEX1_BIT; - if (newinputs & VERT_FOG_COORD) + if (newinputs & VERT_BIT_FOG) ind |= I830_FOG_BIT; #if 0 @@ -491,11 +490,11 @@ if (ctx->Fog.Enabled) ind |= I830_FOG_BIT; - /* unit 1 */ - if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY) + if (ctx->Texture._EnabledUnits & 0x2) + /* unit 1 enabled */ ind |= I830_TEX1_BIT|I830_TEX0_BIT; - /* unit 0 */ - else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) + else if (ctx->Texture._EnabledUnits & 0x1) + /* unit 0 enabled */ ind |= I830_TEX0_BIT; imesa->SetupIndex = ind; Index: xc/lib/GL/mesa/src/drv/mga/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/mga/Imakefile.inc:1.3 xc/lib/GL/mesa/src/drv/mga/Imakefile.inc:1.5 --- xc/lib/GL/mesa/src/drv/mga/Imakefile.inc:1.3 Fri Feb 22 16:33:05 2002 +++ xc/lib/GL/mesa/src/drv/mga/Imakefile.inc Sun Sep 28 16:15:16 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/mga/Imakefile.inc,v 1.3 2002/02/22 21:33:05 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/mga/Imakefile.inc,v 1.5 2003/09/28 20:15:16 alanh Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=ByteOrder + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ @@ -34,78 +34,77 @@ -I$(MESADRVSRCDIR)/mga X_INCLUDES = -I$(XINCLUDESRC) -I$(EXTINCSRC) - MGASRCS = $(MESADRVMGABUILDDIR)mgabuffers.c \ - $(MESADRVMGABUILDDIR)mgadd.c \ + MGASRCS = $(MESADRVMGABUILDDIR)mgadd.c \ $(MESADRVMGABUILDDIR)mgarender.c \ $(MESADRVMGABUILDDIR)mgaioctl.c \ $(MESADRVMGABUILDDIR)mgapixel.c \ $(MESADRVMGABUILDDIR)mgaspan.c \ $(MESADRVMGABUILDDIR)mgastate.c \ $(MESADRVMGABUILDDIR)mgatex.c \ - $(MESADRVMGABUILDDIR)mgatexcnv.c \ $(MESADRVMGABUILDDIR)mgatexmem.c \ + $(MESADRVMGABUILDDIR)mga_texstate.c \ + $(MESADRVMGABUILDDIR)mga_texcombine.c \ $(MESADRVMGABUILDDIR)mgatris.c \ $(MESADRVMGABUILDDIR)mgavb.c \ $(MESADRVMGABUILDDIR)mga_xmesa.c \ - MGAOBJS = $(MESADRVMGABUILDDIR)mgabuffers.o \ - $(MESADRVMGABUILDDIR)mgadd.o \ + MGAOBJS = $(MESADRVMGABUILDDIR)mgadd.o \ $(MESADRVMGABUILDDIR)mgarender.o \ $(MESADRVMGABUILDDIR)mgaioctl.o \ $(MESADRVMGABUILDDIR)mgapixel.o \ $(MESADRVMGABUILDDIR)mgaspan.o \ $(MESADRVMGABUILDDIR)mgastate.o \ $(MESADRVMGABUILDDIR)mgatex.o \ - $(MESADRVMGABUILDDIR)mgatexcnv.o \ $(MESADRVMGABUILDDIR)mgatexmem.o \ + $(MESADRVMGABUILDDIR)mga_texstate.o \ + $(MESADRVMGABUILDDIR)mga_texcombine.o \ $(MESADRVMGABUILDDIR)mgatris.o \ $(MESADRVMGABUILDDIR)mgavb.o \ $(MESADRVMGABUILDDIR)mga_xmesa.o - MGAUOBJS = $(MESADRVMGABUILDDIR)unshared/mgabuffers.o \ - $(MESADRVMGABUILDDIR)unshared/mgadd.o \ + MGAUOBJS = $(MESADRVMGABUILDDIR)unshared/mgadd.o \ $(MESADRVMGABUILDDIR)unshared/mgarender.o \ $(MESADRVMGABUILDDIR)unshared/mgaioctl.o \ $(MESADRVMGABUILDDIR)unshared/mgapixel.o \ $(MESADRVMGABUILDDIR)unshared/mgaspan.o \ $(MESADRVMGABUILDDIR)unshared/mgastate.o \ $(MESADRVMGABUILDDIR)unshared/mgatex.o \ - $(MESADRVMGABUILDDIR)unshared/mgatexcnv.o \ $(MESADRVMGABUILDDIR)unshared/mgatexmem.o \ + $(MESADRVMGABUILDDIR)unshared/mga_texstate.o \ + $(MESADRVMGABUILDDIR)unshared/mga_texcombine.o \ $(MESADRVMGABUILDDIR)unshared/mgatris.o \ $(MESADRVMGABUILDDIR)unshared/mgavb.o \ $(MESADRVMGABUILDDIR)unshared/mga_xmesa.o - MGADOBJS = $(MESADRVMGABUILDDIR)debugger/mgabuffers.o \ - $(MESADRVMGABUILDDIR)debugger/mgadd.o \ + MGADOBJS = $(MESADRVMGABUILDDIR)debugger/mgadd.o \ $(MESADRVMGABUILDDIR)debugger/mgarender.o \ $(MESADRVMGABUILDDIR)debugger/mgaioctl.o \ $(MESADRVMGABUILDDIR)debugger/mgapixel.o \ $(MESADRVMGABUILDDIR)debugger/mgaspan.o \ $(MESADRVMGABUILDDIR)debugger/mgastate.o \ $(MESADRVMGABUILDDIR)debugger/mgatex.o \ - $(MESADRVMGABUILDDIR)debugger/mgatexcnv.o \ $(MESADRVMGABUILDDIR)debugger/mgatexmem.o \ + $(MESADRVMGABUILDDIR)debugger/mga_texstate.o \ + $(MESADRVMGABUILDDIR)debugger/mga_texcombine.o \ $(MESADRVMGABUILDDIR)debugger/mgatris.o \ $(MESADRVMGABUILDDIR)debugger/mgavb.o \ $(MESADRVMGABUILDDIR)debugger/mga_xmesa.o - MGAPOBJS = $(MESADRVMGABUILDDIR)profiled/mgabuffers.o \ - $(MESADRVMGABUILDDIR)profiled/mgadd.o \ + MGAPOBJS = $(MESADRVMGABUILDDIR)profiled/mgadd.o \ $(MESADRVMGABUILDDIR)profiled/mgarender.o \ $(MESADRVMGABUILDDIR)profiled/mgaioctl.o \ $(MESADRVMGABUILDDIR)profiled/mgapixel.o \ $(MESADRVMGABUILDDIR)profiled/mgaspan.o \ $(MESADRVMGABUILDDIR)profiled/mgastate.o \ $(MESADRVMGABUILDDIR)profiled/mgatex.o \ - $(MESADRVMGABUILDDIR)profiled/mgatexcnv.o \ $(MESADRVMGABUILDDIR)profiled/mgatexmem.o \ + $(MESADRVMGABUILDDIR)profiled/mga_texstate.o \ + $(MESADRVMGABUILDDIR)profiled/mga_texcombine.o \ $(MESADRVMGABUILDDIR)profiled/mgatris.o \ $(MESADRVMGABUILDDIR)profiled/mgavb.o \ $(MESADRVMGABUILDDIR)profiled/mga_xmesa.o #ifdef NeedToLinkMesaSrc -LinkSourceFile(mgabuffers.c, $(MESADRVSRCDIR)/mga) LinkSourceFile(mgadd.c, $(MESADRVSRCDIR)/mga) LinkSourceFile(mgarender.c, $(MESADRVSRCDIR)/mga) LinkSourceFile(mgaioctl.c, $(MESADRVSRCDIR)/mga) @@ -113,8 +112,9 @@ LinkSourceFile(mgaspan.c, $(MESADRVSRCDIR)/mga) LinkSourceFile(mgastate.c, $(MESADRVSRCDIR)/mga) LinkSourceFile(mgatex.c, $(MESADRVSRCDIR)/mga) -LinkSourceFile(mgatexcnv.c, $(MESADRVSRCDIR)/mga) LinkSourceFile(mgatexmem.c, $(MESADRVSRCDIR)/mga) +LinkSourceFile(mga_texstate.c, $(MESADRVSRCDIR)/mga) +LinkSourceFile(mga_texcombine.c, $(MESADRVSRCDIR)/mga) LinkSourceFile(mgatris.c, $(MESADRVSRCDIR)/mga) LinkSourceFile(mgavb.c, $(MESADRVSRCDIR)/mga) LinkSourceFile(mga_xmesa.c, $(MESADRVSRCDIR)/mga) Index: xc/lib/GL/mesa/src/drv/mga/mga_texcombine.c diff -u /dev/null xc/lib/GL/mesa/src/drv/mga/mga_texcombine.c:1.4 --- /dev/null Sat Feb 28 21:41:15 2004 +++ xc/lib/GL/mesa/src/drv/mga/mga_texcombine.c Tue Dec 2 08:02:37 2003 @@ -0,0 +1,672 @@ +/* + * Copyright (c) 2003 Ville Syrjala + * + * 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. + * + * Authors: + * Ville Syrjala + */ + +#include "glheader.h" + +#include "mgacontext.h" +#include "mgatex.h" +#include "mgaregs.h" + +/* + * GL_ARB_texture_env_combine + * GL_EXT_texture_env_combine + * GL_ARB_texture_env_crossbar + * GL_ATI_texture_env_combine3 + */ + +#define ARG_DISABLE 0xffffffff +#define MGA_ARG1 0 +#define MGA_ARG2 1 +#define MGA_ALPHA 2 + +GLboolean mgaUpdateTextureEnvCombine( GLcontext *ctx, int unit ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + const int source = mmesa->tmu_source[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source]; + GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit); + GLuint numColorArgs = 0, numAlphaArgs = 0; + GLuint arg1[3], arg2[3], alpha[3]; + int args[3]; + int i; + + switch (texUnit->CombineModeRGB) { + case GL_REPLACE: + numColorArgs = 1; + break; + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_SUBTRACT: + numColorArgs = 2; + break; + case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + numColorArgs = 3; + break; + default: + return GL_FALSE; + } + + switch (texUnit->CombineModeA) { + case GL_REPLACE: + numAlphaArgs = 1; + break; + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_SUBTRACT: + numAlphaArgs = 2; + break; + default: + return GL_FALSE; + } + + /* Start fresh :) */ + *reg = 0; + + /* COLOR */ + for (i = 0; i < 3; i++) { + arg1[i] = 0; + arg2[i] = 0; + alpha[i] = 0; + } + + for (i = 0;i < numColorArgs; i++) { + switch (texUnit->CombineSourceRGB[i]) { + case GL_TEXTURE: + arg1[i] |= 0; + arg2[i] |= ARG_DISABLE; + alpha[i] |= TD0_color_alpha_currtex; + break; + case GL_TEXTURE0: + if (source == 0) { + arg1[i] |= 0; + arg2[i] |= ARG_DISABLE; + alpha[i] |= TD0_color_alpha_currtex; + } else { + if (ctx->Texture._EnabledUnits != 0x03) { + /* disable texturing */ + mmesa->setup.dwgctl &= DC_opcod_MASK; + mmesa->setup.dwgctl |= DC_opcod_trap; + mmesa->hw.alpha_sel = AC_alphasel_diffused; + /* return GL_TRUE since we don't need a fallback */ + return GL_TRUE; + } + arg1[i] |= ARG_DISABLE; + arg2[i] |= ARG_DISABLE; + alpha[i] |= TD0_color_alpha_prevtex; + } + break; + case GL_TEXTURE1: + if (source == 0) { + if (ctx->Texture._EnabledUnits != 0x03) { + /* disable texturing */ + mmesa->setup.dwgctl &= DC_opcod_MASK; + mmesa->setup.dwgctl |= DC_opcod_trap; + mmesa->hw.alpha_sel = AC_alphasel_diffused; + /* return GL_TRUE since we don't need a fallback */ + return GL_TRUE; + } + arg1[i] |= ARG_DISABLE; + /* G400 specs (TDUALSTAGE0) */ + arg2[i] |= TD0_color_arg2_prevstage; + alpha[i] |= TD0_color_alpha_prevstage; + } else { + arg1[i] |= 0; + arg2[i] |= ARG_DISABLE; + alpha[i] |= TD0_color_alpha_currtex; + } + break; + case GL_CONSTANT: + if (mmesa->fcol_used && + mmesa->envcolor[source] != mmesa->envcolor[!source]) + return GL_FALSE; + + arg1[i] |= ARG_DISABLE; + arg2[i] |= TD0_color_arg2_fcol; + alpha[i] |= TD0_color_alpha_fcol; + + mmesa->setup.fcol = mmesa->envcolor[source]; + mmesa->fcol_used = GL_TRUE; + break; + case GL_PRIMARY_COLOR: + arg1[i] |= ARG_DISABLE; + /* G400 specs (TDUALSTAGE1) */ + if (unit == 0 || (mmesa->setup.tdualstage0 & + ((TD0_color_sel_mul & TD0_color_sel_add) | + (TD0_alpha_sel_mul & TD0_alpha_sel_add)))) { + arg2[i] |= TD0_color_arg2_diffuse; + alpha[i] |= TD0_color_alpha_diffuse; + } else { + arg2[i] |= ARG_DISABLE; + alpha[i] |= ARG_DISABLE; + } + break; + case GL_PREVIOUS: + arg1[i] |= ARG_DISABLE; + if (unit == 0) { + arg2[i] |= TD0_color_arg2_diffuse; + alpha[i] |= TD0_color_alpha_diffuse; + } else { + arg2[i] |= TD0_color_arg2_prevstage; + alpha[i] |= TD0_color_alpha_prevstage; + } + break; + default: + return GL_FALSE; + } + + switch (texUnit->CombineOperandRGB[i]) { + case GL_SRC_COLOR: + arg1[i] |= 0; + arg2[i] |= 0; + if (texUnit->CombineSourceRGB[i] == GL_CONSTANT && + RGBA_EQUAL( mmesa->envcolor[source] )) { + alpha[i] |= 0; + } else { + alpha[i] |= ARG_DISABLE; + } + break; + case GL_ONE_MINUS_SRC_COLOR: + arg1[i] |= TD0_color_arg1_inv_enable; + arg2[i] |= TD0_color_arg2_inv_enable; + if (texUnit->CombineSourceRGB[i] == GL_CONSTANT && + RGBA_EQUAL( mmesa->envcolor[source] )) { + alpha[i] |= (TD0_color_alpha1inv_enable | + TD0_color_alpha2inv_enable); + } else { + alpha[i] |= ARG_DISABLE; + } + break; + case GL_SRC_ALPHA: + arg1[i] |= TD0_color_arg1_replicatealpha_enable; + arg2[i] |= TD0_color_arg2_replicatealpha_enable; + alpha[i] |= 0; + break; + case GL_ONE_MINUS_SRC_ALPHA: + arg1[i] |= (TD0_color_arg1_replicatealpha_enable | + TD0_color_arg1_inv_enable); + arg2[i] |= (TD0_color_arg2_replicatealpha_enable | + TD0_color_arg2_inv_enable); + alpha[i] |= (TD0_color_alpha1inv_enable | + TD0_color_alpha2inv_enable); + break; + } + } + + switch (texUnit->CombineModeRGB) { + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + /* Special handling for ATI_texture_env_combine3. + * If Arg1 == Arg0 or Arg1 == Arg2 we can use arg1 or arg2 as input for + * both multiplier and adder. + */ + /* Arg1 == arg1 */ + if (arg1[1] == arg1[0]) { + if ((arg1[1] | arg2[2]) != ARG_DISABLE) { + *reg |= arg1[1] | arg2[2]; + args[0] = MGA_ARG1; args[1] = MGA_ARG1; args[2] = MGA_ARG2; + break; + } else + if ((arg1[1] | alpha[2]) != ARG_DISABLE) { + *reg |= arg1[1] | alpha[2]; + args[0] = MGA_ARG1; args[1] = MGA_ARG1; args[2] = MGA_ALPHA; + break; + } + } + if (arg1[1] == arg1[2]) { + if ((arg1[1] | arg2[0]) != ARG_DISABLE) { + *reg |= arg1[1] | arg2[0]; + args[0] = MGA_ARG2; args[1] = MGA_ARG1; args[2] = MGA_ARG1; + break; + } else + if ((arg1[1] | alpha[0]) != ARG_DISABLE) { + *reg |= arg1[1] | alpha[0]; + args[0] = MGA_ALPHA; args[1] = MGA_ARG1; args[2] = MGA_ARG1; + break; + } + } + /* fallthrough */ + case GL_MODULATE_SUBTRACT_ATI: + /* Arg1 == arg2 */ + if (arg2[1] == arg2[0]) { + if ((arg2[1] | arg1[2]) != ARG_DISABLE) { + *reg |= arg2[1] | arg1[2]; + args[0] = MGA_ARG2; args[1] = MGA_ARG2; args[2] = MGA_ARG1; + break; + } else + if ((arg2[1] | alpha[2]) != ARG_DISABLE) { + *reg |= arg2[1] | alpha[2]; + args[0] = MGA_ARG2; args[1] = MGA_ARG2; args[2] = MGA_ALPHA; + break; + } + } + if (arg2[1] == arg2[2]) { + if ((arg2[1] | arg1[0]) != ARG_DISABLE) { + *reg |= arg2[1] | arg1[0]; + args[0] = MGA_ARG1; args[1] = MGA_ARG2; args[2] = MGA_ARG2; + break; + } else + if ((arg2[1] | alpha[0]) != ARG_DISABLE) { + *reg |= arg2[1] | alpha[0]; + args[0] = MGA_ALPHA; args[1] = MGA_ARG2; args[2] = MGA_ARG2; + break; + } + } + /* fallthrough */ + default: + /* Find working combo of arg1, arg2 and alpha. + * + * Keep the Arg0 != alpha cases first since there's + * no way to get alpha out by itself (GL_REPLACE). + * + * Keep the Arg2 == alpha cases first because only alpha has the + * capabilities to function as Arg2 (GL_INTERPOLATE). Also good for + * GL_ADD, GL_ADD_SIGNED, GL_SUBTRACT since we can't get alpha to the + * adder. + * + * Keep the Arg1 == alpha cases last for GL_MODULATE_ADD_ATI, + * GL_MODULATE_SIGNED_ADD_ATI. Again because we can't get alpha to the + * adder. + * + * GL_MODULATE_SUBTRACT_ATI needs special treatment since it requires + * that Arg1 == arg2. This requirement clashes with those of other modes. + */ + if ((arg1[0] | arg2[1] | alpha[2]) != ARG_DISABLE) { + *reg |= arg1[0] | arg2[1] | alpha[2]; + args[0] = MGA_ARG1; args[1] = MGA_ARG2; args[2] = MGA_ALPHA; + } else + if ((arg1[1] | arg2[0] | alpha[2]) != ARG_DISABLE && + texUnit->CombineModeRGB != GL_MODULATE_SUBTRACT_ATI) { + *reg |= arg1[1] | arg2[0] | alpha[2]; + args[0] = MGA_ARG2; args[1] = MGA_ARG1; args[2] = MGA_ALPHA; + } else + if ((arg1[1] | arg2[2] | alpha[0]) != ARG_DISABLE && + texUnit->CombineModeRGB != GL_MODULATE_SUBTRACT_ATI) { + *reg |= arg1[1] | arg2[2] | alpha[0]; + args[0] = MGA_ALPHA; args[1] = MGA_ARG1; args[2] = MGA_ARG2; + } else + if ((arg1[2] | arg2[1] | alpha[0]) != ARG_DISABLE) { + *reg |= arg1[2] | arg2[1] | alpha[0]; + args[0] = MGA_ALPHA; args[1] = MGA_ARG2; args[2] = MGA_ARG1; + } else + if ((arg1[0] | arg2[2] | alpha[1]) != ARG_DISABLE) { + *reg |= arg1[0] | arg2[2] | alpha[1]; + args[0] = MGA_ARG1; args[1] = MGA_ALPHA; args[2] = MGA_ARG2; + } else + if ((arg1[2] | arg2[0] | alpha[1]) != ARG_DISABLE) { + *reg |= arg1[2] | arg2[0] | alpha[1]; + args[0] = MGA_ARG2; args[1] = MGA_ALPHA; args[2] = MGA_ARG1; + } else { + /* nothing suitable */ + return GL_FALSE; + } + } + + switch (texUnit->CombineModeRGB) { + case GL_REPLACE: + if (texUnit->CombineScaleShiftRGB) { + return GL_FALSE; + } + + if (args[0] == MGA_ARG1) { + *reg |= TD0_color_sel_arg1; + } else if (args[0] == MGA_ARG2) { + *reg |= TD0_color_sel_arg2; + } else if (args[0] == MGA_ALPHA) { + /* Can't get alpha out by itself */ + return GL_FALSE; + } + break; + case GL_MODULATE: + if (texUnit->CombineScaleShiftRGB == 1) { + *reg |= TD0_color_modbright_2x; + } else if (texUnit->CombineScaleShiftRGB == 2) { + *reg |= TD0_color_modbright_4x; + } + + *reg |= TD0_color_sel_mul; + + if (args[0] == MGA_ALPHA || args[1] == MGA_ALPHA) { + if (args[0] == MGA_ARG1 || args[1] == MGA_ARG1) { + *reg |= TD0_color_arg2mul_alpha2; + } else if (args[0] == MGA_ARG2 || args[1] == MGA_ARG2) { + *reg |= TD0_color_arg1mul_alpha1; + } + } + break; + case GL_ADD_SIGNED: + *reg |= TD0_color_addbias_enable; + /* fallthrough */ + case GL_ADD: + if (args[0] == MGA_ALPHA || args[1] == MGA_ALPHA) { + /* Can't get alpha to the adder */ + return GL_FALSE; + } + if (texUnit->CombineScaleShiftRGB == 1) { + *reg |= TD0_color_add2x_enable; + } else if (texUnit->CombineScaleShiftRGB == 2) { + return GL_FALSE; + } + + *reg |= (TD0_color_add_add | + TD0_color_sel_add); + break; + case GL_INTERPOLATE: + if (args[2] != MGA_ALPHA) { + /* Only alpha can function as Arg2 */ + return GL_FALSE; + } + if (texUnit->CombineScaleShiftRGB == 1) { + *reg |= TD0_color_add2x_enable; + } else if (texUnit->CombineScaleShiftRGB == 2) { + return GL_FALSE; + } + + *reg |= (TD0_color_arg1mul_alpha1 | + TD0_color_blend_enable | + TD0_color_arg1add_mulout | + TD0_color_arg2add_mulout | + TD0_color_add_add | + TD0_color_sel_add); + + /* Have to do this with xor since GL_ONE_MINUS_SRC_ALPHA may have + * already touched this bit. + */ + *reg ^= TD0_color_alpha1inv_enable; + + if (args[0] == MGA_ARG2) { + /* Swap arguments */ + *reg ^= (TD0_color_arg1mul_alpha1 | + TD0_color_arg2mul_alpha2 | + TD0_color_alpha1inv_enable | + TD0_color_alpha2inv_enable); + } + + if (ctx->Texture._EnabledUnits != 0x03) { + /* Linear blending mode needs dualtex enabled */ + *(reg+1) = (TD0_color_arg2_prevstage | + TD0_color_sel_arg2 | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_arg2); + mmesa->force_dualtex = GL_TRUE; + } + break; + case GL_SUBTRACT: + if (args[0] == MGA_ALPHA || args[1] == MGA_ALPHA) { + /* Can't get alpha to the adder */ + return GL_FALSE; + } + if (texUnit->CombineScaleShiftRGB == 1) { + *reg |= TD0_color_add2x_enable; + } else if (texUnit->CombineScaleShiftRGB == 2) { + return GL_FALSE; + } + + *reg |= (TD0_color_add_sub | + TD0_color_sel_add); + + if (args[0] == MGA_ARG2) { + /* Swap arguments */ + *reg ^= (TD0_color_arg1_inv_enable | + TD0_color_arg2_inv_enable); + } + break; + case GL_MODULATE_SIGNED_ADD_ATI: + *reg |= TD0_color_addbias_enable; + /* fallthrough */ + case GL_MODULATE_ADD_ATI: + if (args[1] == MGA_ALPHA) { + /* Can't get alpha to the adder */ + return GL_FALSE; + } + if (texUnit->CombineScaleShiftRGB == 1) { + *reg |= TD0_color_add2x_enable; + } else if (texUnit->CombineScaleShiftRGB == 2) { + return GL_FALSE; + } + + *reg |= (TD0_color_add_add | + TD0_color_sel_add); + + if (args[1] == args[0] || args[1] == args[2]) { + *reg |= TD0_color_arg1add_mulout; + if (args[0] == MGA_ALPHA || args[2] == MGA_ALPHA) + *reg |= TD0_color_arg1mul_alpha1; + + if (args[1] == MGA_ARG1) { + /* Swap adder arguments */ + *reg ^= (TD0_color_arg1add_mulout | + TD0_color_arg2add_mulout); + if (args[0] == MGA_ALPHA || args[2] == MGA_ALPHA) { + /* Swap multiplier arguments */ + *reg ^= (TD0_color_arg1mul_alpha1 | + TD0_color_arg2mul_alpha2); + } + } + } else { + *reg |= (TD0_color_arg2mul_alpha2 | + TD0_color_arg1add_mulout); + + if (args[1] == MGA_ARG1) { + /* Swap arguments */ + *reg ^= (TD0_color_arg1mul_alpha1 | + TD0_color_arg2mul_alpha2 | + TD0_color_arg1add_mulout | + TD0_color_arg2add_mulout); + } + } + break; + case GL_MODULATE_SUBTRACT_ATI: + if (args[1] != MGA_ARG2) { + /* Can't swap arguments */ + return GL_FALSE; + } + if (texUnit->CombineScaleShiftRGB == 1) { + *reg |= TD0_color_add2x_enable; + } else if (texUnit->CombineScaleShiftRGB == 2) { + return GL_FALSE; + } + + *reg |= (TD0_color_add_sub | + TD0_color_sel_add); + + if (args[1] == args[0] || args[1] == args[2]) { + *reg |= TD0_color_arg1add_mulout; + if (args[0] == MGA_ALPHA || args[2] == MGA_ALPHA) + *reg |= TD0_color_arg1mul_alpha1; + } else { + *reg |= (TD0_color_arg2mul_alpha2 | + TD0_color_arg1add_mulout); + } + break; + } + + + /* ALPHA */ + for (i = 0; i < 2; i++) { + arg1[i] = 0; + arg2[i] = 0; + } + + for (i = 0; i < numAlphaArgs; i++) { + switch (texUnit->CombineSourceA[i]) { + case GL_TEXTURE: + arg1[i] |= 0; + arg2[i] |= ARG_DISABLE; + break; + case GL_TEXTURE0: + if (source == 0) { + arg1[i] |= 0; + arg2[i] |= ARG_DISABLE; + } else { + if (ctx->Texture._EnabledUnits != 0x03) { + /* disable texturing */ + mmesa->setup.dwgctl &= DC_opcod_MASK; + mmesa->setup.dwgctl |= DC_opcod_trap; + mmesa->hw.alpha_sel = AC_alphasel_diffused; + /* return GL_TRUE since we don't need a fallback */ + return GL_TRUE; + } + arg1[i] |= ARG_DISABLE; + arg2[i] |= TD0_alpha_arg2_prevtex; + } + break; + case GL_TEXTURE1: + if (source == 0) { + if (ctx->Texture._EnabledUnits != 0x03) { + /* disable texturing */ + mmesa->setup.dwgctl &= DC_opcod_MASK; + mmesa->setup.dwgctl |= DC_opcod_trap; + mmesa->hw.alpha_sel = AC_alphasel_diffused; + /* return GL_TRUE since we don't need a fallback */ + return GL_TRUE; + } + arg1[i] |= ARG_DISABLE; + /* G400 specs (TDUALSTAGE0) */ + arg2[i] |= TD0_alpha_arg2_prevstage; + } else { + arg1[i] |= 0; + arg2[i] |= ARG_DISABLE; + } + break; + case GL_CONSTANT: + if (mmesa->fcol_used && + mmesa->envcolor[source] != mmesa->envcolor[!source]) + return GL_FALSE; + + arg1[i] |= ARG_DISABLE; + arg2[i] |= TD0_alpha_arg2_fcol; + + mmesa->setup.fcol = mmesa->envcolor[source]; + mmesa->fcol_used = GL_TRUE; + break; + case GL_PRIMARY_COLOR: + arg1[i] |= ARG_DISABLE; + /* G400 specs (TDUALSTAGE1) */ + if (unit == 0 || (mmesa->setup.tdualstage0 & + ((TD0_color_sel_mul & TD0_color_sel_add) | + (TD0_alpha_sel_mul & TD0_alpha_sel_add)))) { + arg2[i] |= TD0_alpha_arg2_diffuse; + } else { + arg2[i] |= ARG_DISABLE; + } + break; + case GL_PREVIOUS: + arg1[i] |= ARG_DISABLE; + if (unit == 0) { + arg2[i] |= TD0_alpha_arg2_diffuse; + } else { + arg2[i] |= TD0_alpha_arg2_prevstage; + } + break; + default: + return GL_FALSE; + } + + switch (texUnit->CombineOperandA[i]) { + case GL_SRC_ALPHA: + arg1[i] |= 0; + arg2[i] |= 0; + break; + case GL_ONE_MINUS_SRC_ALPHA: + arg1[i] |= TD0_alpha_arg1_inv_enable; + arg2[i] |= TD0_alpha_arg2_inv_enable; + break; + } + } + + /* Find a working combo of arg1 and arg2 */ + if ((arg1[0] | arg2[1]) != ARG_DISABLE) { + *reg |= arg1[0] | arg2[1]; + args[0] = MGA_ARG1; args[1] = MGA_ARG2; + } else + if ((arg1[1] | arg2[0]) != ARG_DISABLE) { + *reg |= arg1[1] | arg2[0]; + args[0] = MGA_ARG2; args[1] = MGA_ARG1; + } else { + /* nothing suitable */ + return GL_FALSE; + } + + switch (texUnit->CombineModeA) { + case GL_REPLACE: + if (texUnit->CombineScaleShiftA) { + return GL_FALSE; + } + + if (args[0] == MGA_ARG1) { + *reg |= TD0_alpha_sel_arg1; + } else if (args[0] == MGA_ARG2) { + *reg |= TD0_alpha_sel_arg2; + } + break; + case GL_MODULATE: + if (texUnit->CombineScaleShiftA == 1) { + *reg |= TD0_alpha_modbright_2x; + } else if (texUnit->CombineScaleShiftA == 2) { + *reg |= TD0_alpha_modbright_4x; + } + + *reg |= TD0_alpha_sel_mul; + break; + case GL_ADD_SIGNED: + *reg |= TD0_alpha_addbias_enable; + /* fallthrough */ + case GL_ADD: + if (texUnit->CombineScaleShiftA == 1) { + *reg |= TD0_alpha_add2x_enable; + } else if (texUnit->CombineScaleShiftA == 2) { + return GL_FALSE; + } + + *reg |= (TD0_alpha_add_enable | + TD0_alpha_sel_add); + break; + case GL_SUBTRACT: + if (texUnit->CombineScaleShiftA == 1) { + *reg |= TD0_alpha_add2x_enable; + } else if (texUnit->CombineScaleShiftA == 2) { + return GL_FALSE; + } + + *reg |= (TD0_alpha_add_disable | + TD0_alpha_sel_add); + + if (args[0] == MGA_ARG2) { + /* Swap arguments */ + *reg ^= (TD0_alpha_arg1_inv_enable | + TD0_alpha_arg2_inv_enable); + } + break; + } + + return GL_TRUE; +} + + Index: xc/lib/GL/mesa/src/drv/mga/mga_texstate.c diff -u /dev/null xc/lib/GL/mesa/src/drv/mga/mga_texstate.c:1.2 --- /dev/null Sat Feb 28 21:41:15 2004 +++ xc/lib/GL/mesa/src/drv/mga/mga_texstate.c Tue Dec 2 08:02:37 2003 @@ -0,0 +1,901 @@ +/* + * Copyright 2000-2001 VA Linux Systems, Inc. + * (c) Copyright IBM Corporation 2002 + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEMS, IBM AND/OR THEIR SUPPLIERS 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. + * + * Authors: + * Ian Romanick + * Keith Whitwell + */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_texstate.c,v 1.2 2003/12/02 13:02:37 alanh Exp $ */ + +#include "mm.h" +#include "mgacontext.h" +#include "mgatex.h" +#include "mgaregs.h" +#include "mgatris.h" +#include "mgaioctl.h" + +#include "context.h" +#include "enums.h" +#include "macros.h" +#include "imports.h" + +#include "simple_list.h" +#include "texformat.h" + +#define MGA_USE_TABLE_FOR_FORMAT +#ifdef MGA_USE_TABLE_FOR_FORMAT +#define TMC_nr_tformat (MESA_FORMAT_YCBCR_REV + 1) +static const unsigned TMC_tformat[ TMC_nr_tformat ] = +{ + [MESA_FORMAT_ARGB8888] = TMC_tformat_tw32, + [MESA_FORMAT_RGB565] = TMC_tformat_tw16, + [MESA_FORMAT_ARGB4444] = TMC_tformat_tw12, + [MESA_FORMAT_ARGB1555] = TMC_tformat_tw15, + [MESA_FORMAT_AL88] = TMC_tformat_tw8al, + [MESA_FORMAT_I8] = TMC_tformat_tw8a, + [MESA_FORMAT_CI8] = TMC_tformat_tw8 , + [MESA_FORMAT_YCBCR] = TMC_tformat_tw422uyvy, + [MESA_FORMAT_YCBCR_REV] = TMC_tformat_tw422, +}; +#endif + +static void +mgaSetTexImages( mgaContextPtr mmesa, + const struct gl_texture_object * tObj ) +{ + mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData; + struct gl_texture_image *baseImage = tObj->Image[ tObj->BaseLevel ]; + GLint totalSize; + GLint width, height; + GLint i; + GLint numLevels; + GLint log2Width, log2Height; + GLuint txformat = 0; + GLint ofs; + + /* Set the hardware texture format + */ +#ifndef MGA_USE_TABLE_FOR_FORMAT + switch (baseImage->TexFormat->MesaFormat) { + + case MESA_FORMAT_ARGB8888: txformat = TMC_tformat_tw32; break; + case MESA_FORMAT_RGB565: txformat = TMC_tformat_tw16; break; + case MESA_FORMAT_ARGB4444: txformat = TMC_tformat_tw12; break; + case MESA_FORMAT_ARGB1555: txformat = TMC_tformat_tw15; break; + case MESA_FORMAT_AL88: txformat = TMC_tformat_tw8al; break; + case MESA_FORMAT_I8: txformat = TMC_tformat_tw8a; break; + case MESA_FORMAT_CI8: txformat = TMC_tformat_tw8; break; + case MESA_FORMAT_YCBCR: txformat = TMC_tformat_tw422uyvy; break; + case MESA_FORMAT_YCBCR_REV: txformat = TMC_tformat_tw422; break; + + default: + _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); + return; + } +#else + if ( (baseImage->TexFormat->MesaFormat >= TMC_nr_tformat) + || (TMC_tformat[ baseImage->TexFormat->MesaFormat ] == 0) ) + { + _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); + return; + } + + txformat = TMC_tformat[ baseImage->TexFormat->MesaFormat ]; + +#endif /* MGA_USE_TABLE_FOR_FORMAT */ + + driCalculateTextureFirstLastLevel( (driTextureObject *) t ); + if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) { + log2Width = 0; + log2Height = 0; + } else { + log2Width = tObj->Image[t->base.firstLevel]->WidthLog2; + log2Height = tObj->Image[t->base.firstLevel]->HeightLog2; + } + + width = tObj->Image[t->base.firstLevel]->Width; + height = tObj->Image[t->base.firstLevel]->Height; + + numLevels = MIN2( t->base.lastLevel - t->base.firstLevel + 1, + MGA_IS_G200(mmesa) ? G200_TEX_MAXLEVELS : G400_TEX_MAXLEVELS); + + + totalSize = 0; + for ( i = 0 ; i < numLevels ; i++ ) { + const struct gl_texture_image * const texImage = + tObj->Image[ i + t->base.firstLevel ]; + int size; + + if (texImage == NULL) + break; + + size = texImage->Width * texImage->Height * + baseImage->TexFormat->TexelBytes; + + t->offsets[i] = totalSize; + t->base.dirty_images[0] |= (1<base.lastLevel = t->base.firstLevel + numLevels - 1; + t->base.totalSize = totalSize; + + /* setup hardware register values */ + t->setup.texctl &= (TMC_tformat_MASK & TMC_tpitch_MASK + & TMC_tpitchext_MASK); + t->setup.texctl |= txformat; + + + /* Set the texture width. In order to support non-power of 2 textures and + * textures larger than 1024 texels wide, "linear" pitch must be used. For + * the linear pitch, if the width is 2048, a value of zero is used. + */ + + t->setup.texctl |= TMC_tpitchlin_enable; + t->setup.texctl |= MGA_FIELD( TMC_tpitchext, width & (2048 - 1) ); + + + /* G400 specifies the number of mip levels in a strange way. Since there + * are up to 11 levels, it requires 4 bits. Three of the bits are at the + * high end of TEXFILTER. The other bit is in the middle. Weird. + */ + numLevels--; + t->setup.texfilter &= TF_mapnb_MASK & TF_mapnbhigh_MASK & TF_reserved_MASK; + t->setup.texfilter |= MGA_FIELD( TF_mapnb, numLevels & 0x7 ); + t->setup.texfilter |= MGA_FIELD( TF_mapnbhigh, (numLevels >> 3) & 0x1 ); + + /* warp texture registers */ + ofs = MGA_IS_G200(mmesa) ? 28 : 11; + + t->setup.texwidth = (MGA_FIELD(TW_twmask, width - 1) | + MGA_FIELD(TW_rfw, (10 - log2Width - 8) & 63 ) | + MGA_FIELD(TW_tw, (log2Width + ofs ) | 0x40 )); + + t->setup.texheight = (MGA_FIELD(TH_thmask, height - 1) | + MGA_FIELD(TH_rfh, (10 - log2Height - 8) & 63 ) | + MGA_FIELD(TH_th, (log2Height + ofs ) | 0x40 )); + + mgaUploadTexImages( mmesa, t ); +} + + +/* ================================================================ + * Texture unit state management + */ + +static void mgaUpdateTextureEnvG200( GLcontext *ctx, GLuint unit ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current; + mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData; + GLenum format = tObj->Image[tObj->BaseLevel]->Format; + + if (tObj != ctx->Texture.Unit[0].Current2D && + tObj != ctx->Texture.Unit[0].CurrentRect) + return; + + + t->setup.texctl &= ~TMC_tmodulate_enable; + t->setup.texctl2 &= ~(TMC_decalblend_enable | + TMC_idecal_enable | + TMC_decaldis_enable); + + switch (ctx->Texture.Unit[0].EnvMode) { + case GL_REPLACE: + if (format == GL_ALPHA) + t->setup.texctl2 |= TMC_idecal_enable; + + if (format == GL_RGB || format == GL_LUMINANCE) + mmesa->hw.alpha_sel = AC_alphasel_diffused; + else + mmesa->hw.alpha_sel = AC_alphasel_fromtex; + break; + + case GL_MODULATE: + t->setup.texctl |= TMC_tmodulate_enable; + + if (format == GL_ALPHA) + t->setup.texctl2 |= (TMC_idecal_enable | + TMC_decaldis_enable); + + if (format == GL_RGB || format == GL_LUMINANCE) + mmesa->hw.alpha_sel = AC_alphasel_diffused; + else + mmesa->hw.alpha_sel = AC_alphasel_modulated; + break; + + case GL_DECAL: + if (format == GL_RGB || format == GL_RGBA) + t->setup.texctl2 |= TMC_decalblend_enable; + else + t->setup.texctl2 |= TMC_idecal_enable; + + mmesa->hw.alpha_sel = AC_alphasel_diffused; + break; + + case GL_BLEND: + if (format == GL_ALPHA) { + t->setup.texctl2 |= TMC_idecal_enable; + mmesa->hw.alpha_sel = AC_alphasel_modulated; + } else { + t->texenv_fallback = GL_TRUE; + } + break; + + default: + break; + } +} + + +#define MGA_REPLACE 0 +#define MGA_MODULATE 1 +#define MGA_DECAL 2 +#define MGA_ADD 3 +#define MGA_MAX_COMBFUNC 4 + +static const GLuint g400_color_combine[][MGA_MAX_COMBFUNC] = +{ + /* Unit 0: + */ + { + /* GL_REPLACE + * Cv = Cs + * Av = Af + */ + (TD0_color_sel_arg1 | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_arg2), + + /* GL_MODULATE + * Cv = Cf Cs + * Av = Af + */ + (TD0_color_arg2_diffuse | + TD0_color_sel_mul | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_arg2), + + /* GL_DECAL + * Cv = Cs + * Av = Af + */ + (TD0_color_sel_arg1 | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_arg2), + + /* GL_ADD + * Cv = Cf + Cs + * Av = Af + */ + (TD0_color_arg2_diffuse | + TD0_color_add_add | + TD0_color_sel_add | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_arg2), + }, + + /* Unit 1: + */ + { + /* GL_REPLACE + * Cv = Cs + * Av = Ap + */ + (TD0_color_sel_arg1 | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_arg2), + + /* GL_MODULATE + * Cv = Cp Cs + * Av = Ap + */ + (TD0_color_arg2_prevstage | + TD0_color_sel_mul | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_arg2), + + /* GL_DECAL + * Cv = Cs + * Av = Ap + */ + (TD0_color_sel_arg1 | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_arg2), + + /* GL_ADD + * Cv = Cp + Cs + * Av = Ap + */ + (TD0_color_arg2_prevstage | + TD0_color_add_add | + TD0_color_sel_add | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_arg2), + }, +}; + +static const GLuint g400_color_alpha_combine[][MGA_MAX_COMBFUNC] = +{ + /* Unit 0: + */ + { + /* GL_REPLACE + * Cv = Cs + * Av = As + */ + (TD0_color_sel_arg1 | + TD0_alpha_sel_arg1), + + /* GL_MODULATE + * Cv = Cf Cs + * Av = Af As + */ + (TD0_color_arg2_diffuse | + TD0_color_sel_mul | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_mul), + + /* GL_DECAL + * tmp = Cf ( 1 - As ) + * Cv = tmp + Cs As + * Av = Af + */ + (TD0_color_arg2_diffuse | + TD0_color_alpha_currtex | + TD0_color_alpha1inv_enable | + TD0_color_arg1mul_alpha1 | + TD0_color_blend_enable | + TD0_color_arg1add_mulout | + TD0_color_arg2add_mulout | + TD0_color_add_add | + TD0_color_sel_add | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_arg2), + + /* GL_ADD + * Cv = Cf + Cs + * Av = Af As + */ + (TD0_color_arg2_diffuse | + TD0_color_add_add | + TD0_color_sel_add | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_mul), + }, + + /* Unit 1: + */ + { + /* GL_REPLACE + * Cv = Cs + * Av = As + */ + (TD0_color_sel_arg1 | + TD0_alpha_sel_arg1), + + /* GL_MODULATE + * Cv = Cp Cs + * Av = Ap As + */ + (TD0_color_arg2_prevstage | + TD0_color_sel_mul | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_mul), + + /* GL_DECAL + * tmp = Cp ( 1 - As ) + * Cv = tmp + Cs As + * Av = Ap + */ + (TD0_color_arg2_prevstage | + TD0_color_alpha_currtex | + TD0_color_alpha1inv_enable | + TD0_color_arg1mul_alpha1 | + TD0_color_blend_enable | + TD0_color_arg1add_mulout | + TD0_color_arg2add_mulout | + TD0_color_add_add | + TD0_color_sel_add | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_arg2), + + /* GL_ADD + * Cv = Cp + Cs + * Av = Ap As + */ + (TD0_color_arg2_prevstage | + TD0_color_add_add | + TD0_color_sel_add | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_mul), + }, +}; + +static const GLuint g400_alpha_combine[][MGA_MAX_COMBFUNC] = +{ + /* Unit 0: + */ + { + /* GL_REPLACE + * Cv = Cf + * Av = As + */ + (TD0_color_arg2_diffuse | + TD0_color_sel_arg2 | + TD0_alpha_sel_arg1), + + /* GL_MODULATE + * Cv = Cf + * Av = Af As + */ + (TD0_color_arg2_diffuse | + TD0_color_sel_arg2 | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_mul), + + /* GL_DECAL (undefined) + * Cv = Cf + * Av = Af + */ + (TD0_color_arg2_diffuse | + TD0_color_sel_arg2 | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_arg2), + + /* GL_ADD + * Cv = Cf + * Av = Af As + */ + (TD0_color_arg2_diffuse | + TD0_color_sel_arg2 | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_mul), + }, + + /* Unit 1: + */ + { + /* GL_REPLACE + * Cv = Cp + * Av = As + */ + (TD0_color_arg2_prevstage | + TD0_color_sel_arg2 | + TD0_alpha_sel_arg1), + + /* GL_MODULATE + * Cv = Cp + * Av = Ap As + */ + (TD0_color_arg2_prevstage | + TD0_color_sel_arg2 | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_mul), + + /* GL_DECAL (undefined) + * Cv = Cp + * Av = Ap + */ + (TD0_color_arg2_prevstage | + TD0_color_sel_arg2 | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_arg2), + + /* GL_ADD + * Cv = Cp + * Av = Ap As + */ + (TD0_color_arg2_prevstage | + TD0_color_sel_arg2 | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_mul), + }, +}; + +static GLboolean mgaUpdateTextureEnvBlend( GLcontext *ctx, int unit ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + const int source = mmesa->tmu_source[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source]; + const struct gl_texture_object *tObj = texUnit->_Current; + GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit); + GLenum format = tObj->Image[tObj->BaseLevel]->Format; + + *reg = 0; + + if (format == GL_ALPHA) { + /* Cv = Cf */ + *reg |= (TD0_color_arg2_diffuse | + TD0_color_sel_arg2); + /* Av = Af As */ + *reg |= (TD0_alpha_arg2_diffuse | + TD0_alpha_sel_mul); + return GL_TRUE; + } + + /* C1 = Cf ( 1 - Cs ) */ + *reg |= (TD0_color_arg1_inv_enable | + TD0_color_arg2_diffuse | + TD0_color_sel_mul); + + if (format == GL_RGB || format == GL_LUMINANCE) { + /* A1 = Af */ + *reg |= (TD0_alpha_arg2_diffuse | + TD0_alpha_sel_arg2); + } else + if (format == GL_RGBA || format == GL_LUMINANCE_ALPHA) { + /* A1 = Af As */ + *reg |= (TD0_alpha_arg2_diffuse | + TD0_alpha_sel_mul); + } else + if (format == GL_INTENSITY) { + /* A1 = Af ( 1 - As ) */ + *reg |= (TD0_alpha_arg1_inv_enable | + TD0_alpha_arg2_diffuse | + TD0_alpha_sel_mul); + } + + if (RGB_ZERO(mmesa->envcolor[source]) && + (format != GL_INTENSITY || ALPHA_ZERO(mmesa->envcolor[source]))) + return GL_TRUE; /* all done */ + + if (ctx->Texture._EnabledUnits == 0x03) + return GL_FALSE; /* need both units */ + + mmesa->force_dualtex = GL_TRUE; + reg = &mmesa->setup.tdualstage1; + *reg = 0; + + if (RGB_ZERO(mmesa->envcolor[source])) { + /* Cv = C1 */ + *reg |= (TD0_color_arg2_prevstage | + TD0_color_sel_arg2); + } else + if (RGB_ONE(mmesa->envcolor[source])) { + /* Cv = C1 + Cs */ + *reg |= (TD0_color_arg2_prevstage | + TD0_color_add_add | + TD0_color_sel_add); + } else + if (RGBA_EQUAL(mmesa->envcolor[source])) { + /* Cv = C1 + Cc Cs */ + *reg |= (TD0_color_arg2_prevstage | + TD0_color_alpha_fcol | + TD0_color_arg2mul_alpha2 | + TD0_color_arg1add_mulout | + TD0_color_add_add | + TD0_color_sel_add); + + mmesa->setup.fcol = mmesa->envcolor[source]; + } else { + return GL_FALSE; + } + + if (format != GL_INTENSITY || ALPHA_ZERO(mmesa->envcolor[source])) { + /* Av = A1 */ + *reg |= (TD0_alpha_arg2_prevstage | + TD0_alpha_sel_arg2); + } else + if (ALPHA_ONE(mmesa->envcolor[source])) { + /* Av = A1 + As */ + *reg |= (TD0_alpha_arg2_prevstage | + TD0_alpha_add_enable | + TD0_alpha_sel_add); + } else { + return GL_FALSE; + } + + return GL_TRUE; +} + +static void mgaUpdateTextureEnvG400( GLcontext *ctx, GLuint unit ) +{ + mgaContextPtr mmesa = MGA_CONTEXT( ctx ); + const int source = mmesa->tmu_source[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source]; + const struct gl_texture_object *tObj = texUnit->_Current; + GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit); + mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData; + GLenum format = tObj->Image[tObj->BaseLevel]->Format; + + if (tObj != ctx->Texture.Unit[source].Current2D && + tObj != ctx->Texture.Unit[source].CurrentRect) + return; + + switch (ctx->Texture.Unit[source].EnvMode) { + case GL_REPLACE: + if (format == GL_ALPHA) { + *reg = g400_alpha_combine[unit][MGA_REPLACE]; + } else if (format == GL_RGB || format == GL_LUMINANCE) { + *reg = g400_color_combine[unit][MGA_REPLACE]; + } else { + *reg = g400_color_alpha_combine[unit][MGA_REPLACE]; + } + break; + + case GL_MODULATE: + if (format == GL_ALPHA) { + *reg = g400_alpha_combine[unit][MGA_MODULATE]; + } else if (format == GL_RGB || format == GL_LUMINANCE) { + *reg = g400_color_combine[unit][MGA_MODULATE]; + } else { + *reg = g400_color_alpha_combine[unit][MGA_MODULATE]; + } + break; + + case GL_DECAL: + if (format == GL_RGB) { + *reg = g400_color_combine[unit][MGA_DECAL]; + } else if (format == GL_RGBA) { + *reg = g400_color_alpha_combine[unit][MGA_DECAL]; + if (ctx->Texture._EnabledUnits != 0x03) { + /* Linear blending mode needs dual texturing enabled */ + *(reg+1) = (TD0_color_arg2_prevstage | + TD0_color_sel_arg2 | + TD0_alpha_arg2_prevstage | + TD0_alpha_sel_arg2); + mmesa->force_dualtex = GL_TRUE; + } + } else { + /* Undefined */ + *reg = g400_alpha_combine[unit][MGA_DECAL]; + } + break; + + case GL_ADD: + if (format == GL_ALPHA) { + *reg = g400_alpha_combine[unit][MGA_ADD]; + } else if (format == GL_RGB || format == GL_LUMINANCE) { + *reg = g400_color_combine[unit][MGA_ADD]; + } else if (format == GL_RGBA || format == GL_LUMINANCE_ALPHA) { + *reg = g400_color_alpha_combine[unit][MGA_ADD]; + } else if (format == GL_INTENSITY) { + /* Cv = Cf + Cs + * Av = Af + As + */ + if (unit == 0) { + *reg = (TD0_color_arg2_diffuse | + TD0_color_add_add | + TD0_color_sel_add | + TD0_alpha_arg2_diffuse | + TD0_alpha_add_enable | + TD0_alpha_sel_add); + } else { + *reg = (TD0_color_arg2_prevstage | + TD0_color_add_add | + TD0_color_sel_add | + TD0_alpha_arg2_prevstage | + TD0_alpha_add_enable | + TD0_alpha_sel_add); + } + } + break; + + case GL_BLEND: + if (!mgaUpdateTextureEnvBlend(ctx, unit)) + t->texenv_fallback = GL_TRUE; + break; + + case GL_COMBINE: + if (!mgaUpdateTextureEnvCombine(ctx, unit)) + t->texenv_fallback = GL_TRUE; + break; + default: + break; + } +} + +static void disable_tex( GLcontext *ctx, int unit ) +{ + mgaContextPtr mmesa = MGA_CONTEXT( ctx ); + + /* Texture unit disabled */ + + if ( mmesa->CurrentTexObj[unit] != NULL ) { + /* The old texture is no longer bound to this texture unit. + * Mark it as such. + */ + + mmesa->CurrentTexObj[unit]->base.bound &= ~(1UL << unit); + mmesa->CurrentTexObj[unit] = NULL; + } + + if ( unit != 0 && !mmesa->force_dualtex ) { + mmesa->setup.tdualstage1 = mmesa->setup.tdualstage0; + } + + if ( ctx->Texture._EnabledUnits == 0 ) { + mmesa->setup.dwgctl &= DC_opcod_MASK; + mmesa->setup.dwgctl |= DC_opcod_trap; + mmesa->hw.alpha_sel = AC_alphasel_diffused; + } + + mmesa->dirty |= MGA_UPLOAD_CONTEXT | (MGA_UPLOAD_TEX0 << unit); +} + +static GLboolean enable_tex( GLcontext *ctx, int unit ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + const int source = mmesa->tmu_source[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source]; + const struct gl_texture_object *tObj = texUnit->_Current; + mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData; + + /* Upload teximages (not pipelined) + */ + if (t->base.dirty_images[0]) { + FLUSH_BATCH( mmesa ); + mgaSetTexImages( mmesa, tObj ); + if ( t->base.memBlock == NULL ) { + return GL_FALSE; + } + } + + return GL_TRUE; +} + +static GLboolean update_tex_common( GLcontext *ctx, int unit ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + const int source = mmesa->tmu_source[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source]; + struct gl_texture_object *tObj = texUnit->_Current; + mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData; + + /* Fallback if there's a texture border */ + if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) { + return GL_FALSE; + } + + + /* Update state if this is a different texture object to last + * time. + */ + if ( mmesa->CurrentTexObj[unit] != t ) { + if ( mmesa->CurrentTexObj[unit] != NULL ) { + /* The old texture is no longer bound to this texture unit. + * Mark it as such. + */ + + mmesa->CurrentTexObj[unit]->base.bound &= ~(1UL << unit); + } + + mmesa->CurrentTexObj[unit] = t; + t->base.bound |= (1UL << unit); + + driUpdateTextureLRU( (driTextureObject *) t ); /* done too often */ + } + + /* register setup */ + if ( unit == 1 ) { + mmesa->setup.tdualstage1 = mmesa->setup.tdualstage0; + } + + t->texenv_fallback = GL_FALSE; + + /* Set this before mgaUpdateTextureEnvG400() since + * GL_ARB_texture_env_crossbar may have to disable texturing. + */ + mmesa->setup.dwgctl &= DC_opcod_MASK; + mmesa->setup.dwgctl |= DC_opcod_texture_trap; + + /* FIXME: The Radeon has some cached state so that it can avoid calling + * FIXME: UpdateTextureEnv in some cases. Is that possible here? + */ + if (MGA_IS_G400(mmesa)) { + /* G400: Regardless of texture env mode, we use the alpha from the + * texture unit (AC_alphasel_fromtex) since it will have already + * been modulated by the incoming fragment color, if needed. + * We don't want (AC_alphasel_modulate) since that'll effectively + * do the modulation twice. + */ + mmesa->hw.alpha_sel = AC_alphasel_fromtex; + + mgaUpdateTextureEnvG400( ctx, unit ); + } else { + mgaUpdateTextureEnvG200( ctx, unit ); + } + + t->setup.texctl2 &= TMC_dualtex_MASK; + if (ctx->Texture._EnabledUnits == 0x03 || mmesa->force_dualtex) { + t->setup.texctl2 |= TMC_dualtex_enable; + } + + mmesa->dirty |= MGA_UPLOAD_CONTEXT | (MGA_UPLOAD_TEX0 << unit); + + FALLBACK( ctx, MGA_FALLBACK_BORDER_MODE, t->border_fallback ); + return !t->border_fallback && !t->texenv_fallback; +} + + +static GLboolean updateTextureUnit( GLcontext *ctx, int unit ) +{ + mgaContextPtr mmesa = MGA_CONTEXT( ctx ); + const int source = mmesa->tmu_source[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source]; + + + if ( texUnit->_ReallyEnabled == TEXTURE_2D_BIT || + texUnit->_ReallyEnabled == TEXTURE_RECT_BIT ) { + return(enable_tex( ctx, unit ) && + update_tex_common( ctx, unit )); + } + else if ( texUnit->_ReallyEnabled ) { + return GL_FALSE; + } + else { + disable_tex( ctx, unit ); + return GL_TRUE; + } +} + +/* The G400 is now programmed quite differently wrt texture environment. + */ +void mgaUpdateTextureState( GLcontext *ctx ) +{ + mgaContextPtr mmesa = MGA_CONTEXT( ctx ); + GLboolean ok; + unsigned i; + + mmesa->force_dualtex = GL_FALSE; + mmesa->fcol_used = GL_FALSE; + + /* This works around a quirk with the MGA hardware. If only OpenGL + * TEXTURE1 is enabled, then the hardware TEXTURE0 must be used. The + * hardware TEXTURE1 can ONLY be used when hardware TEXTURE0 is also used. + */ + + mmesa->tmu_source[0] = 0; + mmesa->tmu_source[1] = 1; + + if ((ctx->Texture._EnabledUnits & 0x03) == 0x02) { + /* only texture 1 enabled */ + mmesa->tmu_source[0] = 1; + mmesa->tmu_source[1] = 0; + } + + for ( i = 0, ok = GL_TRUE + ; (i < ctx->Const.MaxTextureUnits) && ok + ; i++ ) { + ok = updateTextureUnit( ctx, i ); + } + + FALLBACK( ctx, MGA_FALLBACK_TEXTURE, !ok ); +} Index: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c diff -u xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c:1.18 xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c:1.22 --- xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c:1.18 Mon Dec 16 11:18:52 2002 +++ xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c Mon Dec 8 17:45:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c,v 1.18 2002/12/16 16:18:52 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c,v 1.22 2003/12/08 22:45:30 alanh Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. @@ -28,17 +28,12 @@ #ifdef GLX_DIRECT_RENDERING -#include -#include - -#include "xf86drm.h" #include "mga_common.h" #include "mga_xmesa.h" #include "context.h" #include "matrix.h" -#include "mmath.h" #include "simple_list.h" -#include "mem.h" +#include "imports.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -54,27 +49,20 @@ #include "mgaioctl.h" #include "mgatris.h" #include "mgavb.h" -#include "mgabuffers.h" #include "mgapixel.h" - -#include "xf86dri.h" #include "mga_xmesa.h" - #include "mga_dri.h" +#include "utils.h" +#include "vblank.h" +#include "glxextensions.h" + #ifndef MGA_DEBUG -int MGA_DEBUG = (0 -/* | DEBUG_ALWAYS_SYNC */ -/* | DEBUG_VERBOSE_MSG */ -/* | DEBUG_VERBOSE_LRU */ -/* | DEBUG_VERBOSE_DRI */ -/* | DEBUG_VERBOSE_IOCTL */ -/* | DEBUG_VERBOSE_2D */ -/* | DEBUG_VERBOSE_FALLBACK */ - ); +int MGA_DEBUG = 0; #endif +static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); static GLboolean mgaInitDriver(__DRIscreenPrivate *sPriv) @@ -82,34 +70,8 @@ mgaScreenPrivate *mgaScreen; MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv; - if (MGA_DEBUG&DEBUG_VERBOSE_DRI) - fprintf(stderr, "mgaInitDriver\n"); - - /* Check the DRI version */ - { - int major, minor, patch; - if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) { - if (major != 4 || minor < 0) { - __driUtilMessage("MGA DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch); - return GL_FALSE; - } - } - } - - /* Check that the DDX driver version is compatible */ - if (sPriv->ddxMajor != 1 || - sPriv->ddxMinor < 0) { - __driUtilMessage("MGA DRI driver expected DDX driver version 1.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch); + if ( ! driCheckDriDdxDrmVersions( sPriv, "MGA", 4, 0, 1, 0, 3, 0 ) ) return GL_FALSE; - } - - /* Check that the DRM driver version is compatible */ - if (sPriv->drmMajor != 3 || - sPriv->drmMinor < 0) { - __driUtilMessage("MGA DRI driver expected DRM driver version 3.0.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch); - return GL_FALSE; - } - /* Allocate the private area */ mgaScreen = (mgaScreenPrivate *)MALLOC(sizeof(mgaScreenPrivate)); @@ -138,6 +100,23 @@ } } + mgaScreen->linecomp_sane = (sPriv->ddxMajor > 1) || (sPriv->ddxMinor > 1) + || ((sPriv->ddxMinor == 1) && (sPriv->ddxPatch > 0)); + if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + + if ( glx_enable_extension != NULL ) { + if ( mgaScreen->linecomp_sane ) { + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); + } + + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + } + } if (serverInfo->chipset != MGA_CARD_TYPE_G200 && serverInfo->chipset != MGA_CARD_TYPE_G400) { @@ -278,12 +257,69 @@ }; +static const char * const g400_extensions[] = +{ + "GL_ARB_multitexture", + "GL_ARB_texture_env_add", + "GL_EXT_texture_env_add", + "GL_ARB_texture_env_combine", + "GL_EXT_texture_env_combine", + "GL_ARB_texture_env_crossbar", + "GL_ATI_texture_env_combine3", + "GL_EXT_texture_edge_clamp", + "GL_SGIS_texture_edge_clamp", +#if defined (MESA_packed_depth_stencil) + "GL_MESA_packed_depth_stencil", +#endif + NULL +}; + +static const char * const card_extensions[] = +{ + "GL_ARB_multisample", + "GL_ARB_texture_compression", + "GL_EXT_blend_logic_op", + "GL_EXT_fog_coord", + /* paletted_textures currently doesn't work, but we could fix them later */ +#if 0 + "GL_EXT_shared_texture_palette", + "GL_EXT_paletted_texture", +#endif + "GL_EXT_secondary_color", + "GL_EXT_stencil_wrap", + "GL_MESA_ycbcr_texture", + "GL_SGIS_generate_mipmap", + "GL_SGIS_texture_lod", + "GL_NV_texture_rectangle", + NULL +}; + +static const struct dri_debug_control debug_control[] = +{ + { "fall", DEBUG_VERBOSE_FALLBACK }, + { "tex", DEBUG_VERBOSE_TEXTURE }, + { "ioctl", DEBUG_VERBOSE_IOCTL }, + { "verb", DEBUG_VERBOSE_MSG }, + { "dri", DEBUG_VERBOSE_DRI }, + { NULL, 0 } +}; + + +static int +get_ust_nop( int64_t * ust ) +{ + *ust = 1; + return 0; +} + + static GLboolean -mgaCreateContext( Display *dpy, const __GLcontextModes *mesaVis, +mgaCreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate ) { int i; + unsigned maxlevels; GLcontext *ctx, *shareCtx; mgaContextPtr mmesa; __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; @@ -305,7 +341,7 @@ shareCtx = ((mgaContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - mmesa->glCtx = _mesa_create_context(mesaVis, shareCtx, mmesa, GL_TRUE); + mmesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void *) mmesa, GL_TRUE); if (!mmesa->glCtx) { FREE(mmesa); return GL_FALSE; @@ -313,7 +349,6 @@ driContextPriv->driverPrivate = mmesa; /* Init mga state */ - mmesa->display = dpy; mmesa->hHWContext = driContextPriv->hHWContext; mmesa->driFd = sPriv->fd; mmesa->driHwLock = &sPriv->pSAREA->lock; @@ -323,13 +358,20 @@ mmesa->sarea = (void *)saPriv; mmesa->glBuffer = NULL; - make_empty_list(&mmesa->SwappedOut); - - mmesa->lastTexHeap = mgaScreen->texVirtual[MGA_AGP_HEAP] ? 2 : 1; + (void) memset( mmesa->texture_heaps, 0, sizeof( mmesa->texture_heaps ) ); + make_empty_list( & mmesa->swapped ); - for (i = 0 ; i < mmesa->lastTexHeap ; i++) { - mmesa->texHeap[i] = mmInit( 0, mgaScreen->textureSize[i]); - make_empty_list(&mmesa->TexObjList[i]); + mmesa->nr_heaps = mgaScreen->texVirtual[MGA_AGP_HEAP] ? 2 : 1; + for ( i = 0 ; i < mmesa->nr_heaps ; i++ ) { + mmesa->texture_heaps[i] = driCreateTextureHeap( i, mmesa, + mgaScreen->textureSize[i], + 6, + MGA_NR_TEX_REGIONS, + mmesa->sarea->texList[i], + & mmesa->sarea->texAge[i], + & mmesa->swapped, + sizeof( mgaTextureObject_t ), + (destroy_texture_object_t *) mgaDestroyTexObj ); } /* Set the maximum texture size small enough that we can guarentee @@ -337,22 +379,26 @@ * on the card at once. */ ctx = mmesa->glCtx; - { - int nr = 2; - - if (mgaScreen->chipset == MGA_CARD_TYPE_G200) - nr = 1; - - if (mgaScreen->textureSize[0] < nr*1024*1024) { - ctx->Const.MaxTextureLevels = 9; - } else if (mgaScreen->textureSize[0] < nr*4*1024*1024) { - ctx->Const.MaxTextureLevels = 10; - } else { - ctx->Const.MaxTextureLevels = 11; - } + if ( mgaScreen->chipset == MGA_CARD_TYPE_G200 ) { + ctx->Const.MaxTextureUnits = 1; + maxlevels = G200_TEX_MAXLEVELS; - ctx->Const.MaxTextureUnits = nr; } + else { + ctx->Const.MaxTextureUnits = 2; + maxlevels = G400_TEX_MAXLEVELS; + } + + driCalculateMaxTextureLevels( mmesa->texture_heaps, + mmesa->nr_heaps, + & ctx->Const, + 4, + 11, /* max 2D texture size is 2048x2048 */ + 0, /* 3D textures unsupported. */ + 0, /* cube textures unsupported. */ + 11, /* max texture rect size is 2048x2048 */ + maxlevels, + GL_FALSE ); ctx->Const.MinLineWidth = 1.0; ctx->Const.MinLineWidthAA = 1.0; @@ -360,6 +406,7 @@ ctx->Const.MaxLineWidthAA = 10.0; ctx->Const.LineWidthGranularity = 1.0; + mmesa->default32BitTextures = (mesaVis->rgbBits >= 24); mmesa->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24; switch (mesaVis->depthBits) { @@ -386,7 +433,6 @@ mmesa->haveHwStipple = GL_FALSE; mmesa->RenderIndex = -1; /* impossible value */ - mmesa->new_state = ~0; mmesa->dirty = ~0; mmesa->vertex_format = 0; mmesa->CurrentTexObj[0] = 0; @@ -420,7 +466,11 @@ ctx->DriverCtx = (void *) mmesa; mmesa->glCtx = ctx; - mgaDDExtensionsInit( ctx ); + driInitExtensions( ctx, card_extensions, GL_FALSE ); + + if (MGA_IS_G400(MGA_CONTEXT(ctx))) { + driInitExtensions( ctx, g400_extensions, GL_FALSE ); + } mgaDDInitStateFuncs( ctx ); mgaDDInitTextureFuncs( ctx ); @@ -435,6 +485,22 @@ driContextPriv->driverPrivate = (void *) mmesa; +#if DO_DEBUG + MGA_DEBUG = driParseDebugString( getenv( "MGA_DEBUG" ), + debug_control ); +#endif + + mmesa->vblank_flags = ((mmesa->mgaScreen->irq == 0) + || !mmesa->mgaScreen->linecomp_sane) + ? VBLANK_FLAG_NO_IRQ : driGetDefaultVBlankFlags(); + + mmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); + if ( mmesa->get_ust == NULL ) { + mmesa->get_ust = get_ust_nop; + } + + (*mmesa->get_ust)( & mmesa->swap_ust ); + return GL_TRUE; } @@ -444,10 +510,15 @@ mgaContextPtr mmesa = (mgaContextPtr) driContextPriv->driverPrivate; if (MGA_DEBUG&DEBUG_VERBOSE_DRI) - fprintf(stderr, "mgaDestroyContext\n"); + fprintf( stderr, "[%s:%d] mgaDestroyContext start\n", + __FILE__, __LINE__ ); assert(mmesa); /* should never be null */ if (mmesa) { + GLboolean release_texture_heaps; + + + release_texture_heaps = (mmesa->glCtx->Shared->RefCount == 1); _swsetup_DestroyContext( mmesa->glCtx ); _tnl_DestroyContext( mmesa->glCtx ); _ac_DestroyContext( mmesa->glCtx ); @@ -458,15 +529,32 @@ /* free the Mesa context */ mmesa->glCtx->DriverCtx = NULL; _mesa_destroy_context(mmesa->glCtx); - /* free the mga context */ + + if ( release_texture_heaps ) { + /* This share group is about to go away, free our private + * texture object data. + */ + int i; + + for ( i = 0 ; i < mmesa->nr_heaps ; i++ ) { + driDestroyTextureHeap( mmesa->texture_heaps[ i ] ); + mmesa->texture_heaps[ i ] = NULL; + } + + assert( is_empty_list( & mmesa->swapped ) ); + } + FREE(mmesa); } + + if (MGA_DEBUG&DEBUG_VERBOSE_DRI) + fprintf( stderr, "[%s:%d] mgaDestroyContext done\n", + __FILE__, __LINE__ ); } static GLboolean -mgaCreateBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, +mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) @@ -496,6 +584,24 @@ _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate)); } +static void +mgaSwapBuffers(__DRIdrawablePrivate *dPriv) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + mgaContextPtr mmesa; + GLcontext *ctx; + mmesa = (mgaContextPtr) dPriv->driContextPriv->driverPrivate; + ctx = mmesa->glCtx; + + if (ctx->Visual.doubleBufferMode) { + _mesa_notifySwapBuffers( ctx ); + mgaCopyBuffer( dPriv ); + } + } else { + /* XXX this shouldn't be an error but we can't handle it for now */ + _mesa_problem(NULL, "%s: drawable has no context!\n", __FUNCTION__); + } +} static GLboolean mgaUnbindContext(__DRIcontextPrivate *driContextPriv) @@ -508,13 +614,7 @@ } static GLboolean -mgaOpenFullScreen(__DRIcontextPrivate *driContextPriv) -{ - return GL_TRUE; -} - -static GLboolean -mgaCloseFullScreen(__DRIcontextPrivate *driContextPriv) +mgaOpenCloseFullScreen(__DRIcontextPrivate *driContextPriv) { return GL_TRUE; } @@ -568,7 +668,7 @@ if (*(dPriv->pStamp) != mmesa->lastStamp) { mmesa->lastStamp = *(dPriv->pStamp); - mmesa->SetupNewInputs |= VERT_CLIP; + mmesa->SetupNewInputs |= VERT_BIT_CLIP; mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK); mgaUpdateRects( mmesa, (MGA_FRONT|MGA_BACK) ); } @@ -583,31 +683,34 @@ sarea->ctxOwner=me; } - for (i = 0 ; i < mmesa->lastTexHeap ; i++) - if (sarea->texAge[i] != mmesa->texAge[i]) - mgaAgeTextures( mmesa, i ); + for ( i = 0 ; i < mmesa->nr_heaps ; i++ ) { + DRI_AGE_TEXTURES( mmesa->texture_heaps[ i ] ); + } sarea->last_quiescent = -1; /* just kill it for now */ } - static const struct __DriverAPIRec mgaAPI = { - mgaInitDriver, - mgaDestroyScreen, - mgaCreateContext, - mgaDestroyContext, - mgaCreateBuffer, - mgaDestroyBuffer, - mgaSwapBuffers, - mgaMakeCurrent, - mgaUnbindContext, - mgaOpenFullScreen, - mgaCloseFullScreen + .InitDriver = mgaInitDriver, + .DestroyScreen = mgaDestroyScreen, + .CreateContext = mgaCreateContext, + .DestroyContext = mgaDestroyContext, + .CreateBuffer = mgaCreateBuffer, + .DestroyBuffer = mgaDestroyBuffer, + .SwapBuffers = mgaSwapBuffers, + .MakeCurrent = mgaMakeCurrent, + .UnbindContext = mgaUnbindContext, + .OpenFullScreen = mgaOpenCloseFullScreen, + .CloseFullScreen = mgaOpenCloseFullScreen, + .GetSwapInfo = getSwapInfo, + .GetMSC = driGetMSC32, + .WaitForMSC = driWaitForMSC32, + .WaitForSBC = NULL, + .SwapBuffersMSC = NULL }; - /* * This is the bootstrap function for the driver. * The __driCreateScreen name is the symbol that libGL.so fetches. @@ -622,5 +725,29 @@ } +/** + * Get information about previous buffer swaps. + */ +static int +getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ) +{ + mgaContextPtr mmesa; + if ( (dPriv == NULL) || (dPriv->driContextPriv == NULL) + || (dPriv->driContextPriv->driverPrivate == NULL) + || (sInfo == NULL) ) { + return -1; + } + + mmesa = (mgaContextPtr) dPriv->driContextPriv->driverPrivate; + sInfo->swap_count = mmesa->swap_count; + sInfo->swap_ust = mmesa->swap_ust; + sInfo->swap_missed_count = mmesa->swap_missed_count; + + sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0) + ? driCalculateSwapUsage( dPriv, 0, mmesa->swap_missed_ust ) + : 0.0; + + return 0; +} #endif Index: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h diff -u xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h:1.12 xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h:1.13 --- xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h:1.12 Mon Dec 16 11:18:52 2002 +++ xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h Sun Sep 28 16:15:16 2003 @@ -24,7 +24,7 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h,v 1.12 2002/12/16 16:18:52 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h,v 1.13 2003/09/28 20:15:16 alanh Exp $ */ #ifndef _MGA_INIT_H_ #define _MGA_INIT_H_ @@ -47,6 +47,9 @@ int cpp; /* for front and back buffers */ GLint agpMode; unsigned int irq; /* IRQ number (0 means none) */ + GLboolean linecomp_sane; /* GL_TRUE if line comp. programmed correctly + * by the DDX driver. + */ unsigned int mAccess; Index: xc/lib/GL/mesa/src/drv/mga/mgabuffers.c diff -u xc/lib/GL/mesa/src/drv/mga/mgabuffers.c:1.13 xc/lib/GL/mesa/src/drv/mga/mgabuffers.c:removed --- xc/lib/GL/mesa/src/drv/mga/mgabuffers.c:1.13 Tue Nov 5 12:46:08 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgabuffers.c Sat Feb 28 21:41:15 2004 @@ -1,270 +0,0 @@ -/* - * Copyright 2000-2001 VA Linux Systems, Inc. - * All Rights Reserved. - * - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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. - * - * Authors: - * Keith Whitwell - */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.c,v 1.13 2002/11/05 17:46:08 tsi Exp $ */ - -#include -#include "mgacontext.h" -#include "mgabuffers.h" -#include "mgastate.h" -#include "mgaioctl.h" -#include "mgatris.h" - -static void mgaXMesaSetFrontClipRects( mgaContextPtr mmesa ) -{ - __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; - - if (driDrawable->numClipRects == 0) { - static XF86DRIClipRectRec zeroareacliprect = {0,0,0,0}; - mmesa->numClipRects = 1; - mmesa->pClipRects = &zeroareacliprect; - } else { - mmesa->numClipRects = driDrawable->numClipRects; - mmesa->pClipRects = driDrawable->pClipRects; - } - mmesa->drawX = driDrawable->x; - mmesa->drawY = driDrawable->y; - - mmesa->setup.dstorg = mmesa->drawOffset; - mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS; -} - - -static void mgaXMesaSetBackClipRects( mgaContextPtr mmesa ) -{ - __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; - - if (driDrawable->numBackClipRects == 0) - { - if (driDrawable->numClipRects == 0) { - static XF86DRIClipRectRec zeroareacliprect = {0,0,0,0}; - mmesa->numClipRects = 1; - mmesa->pClipRects = &zeroareacliprect; - } else { - mmesa->numClipRects = driDrawable->numClipRects; - mmesa->pClipRects = driDrawable->pClipRects; - } - mmesa->drawX = driDrawable->x; - mmesa->drawY = driDrawable->y; - } else { - mmesa->numClipRects = driDrawable->numBackClipRects; - mmesa->pClipRects = driDrawable->pBackClipRects; - mmesa->drawX = driDrawable->backX; - mmesa->drawY = driDrawable->backY; - } - - mmesa->setup.dstorg = mmesa->drawOffset; - mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS; -} - - - -#if 0 -static void mgaUpdateRectsFromSarea( mgaContextPtr mmesa ) -{ - __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; - __DRIscreenPrivate *driScreen = mmesa->driScreen; - MGASAREAPrivPtr sarea = mmesa->sarea; - int i = 0, top = 0; - - - if (sarea->exported_buffers & MGA_BACK) { - - driDrawable->numBackClipRects = sarea->exported_nback; - driDrawable->pBackClipRects = mmesa->tmp_boxes[0]; - - top = sarea->exported_nback; - for (i = 0 ; i < top ; i++) - driDrawable->pBackClipRects[i] = - *(XF86DRIClipRectPtr)&(sarea->exported_boxes[i]); - } - - - if (sarea->exported_buffers & MGA_FRONT) - { - int start = top; - - driDrawable->numClipRects = sarea->exported_nfront; - driDrawable->pClipRects = mmesa->tmp_boxes[1]; - - top += sarea->exported_nfront; - for ( ; i < top ; i++) - driDrawable->pClipRects[i-start] = - *(XF86DRIClipRectPtr)&(sarea->exported_boxes[i]); - - } - - - - driDrawable->index = sarea->exported_index; - driDrawable->lastStamp = sarea->exported_stamp; - driDrawable->x = sarea->exported_front_x; - driDrawable->y = sarea->exported_front_y; - driDrawable->backX = sarea->exported_back_x; - driDrawable->backY = sarea->exported_back_y; - driDrawable->w = sarea->exported_w; - driDrawable->h = sarea->exported_h; - driDrawable->pStamp = - &(driScreen->pSAREA->drawableTable[driDrawable->index].stamp); - - mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK) & ~(sarea->exported_buffers); -} -#endif - -#if 0 -static void printSareaRects( mgaContextPtr mmesa ) -{ - __DRIscreenPrivate *driScreen = mmesa->driScreen; - MGASAREAPrivPtr sarea = mmesa->sarea; - int i; - - fprintf(stderr, "sarea->exported: %d\n", sarea->exported_drawable); - fprintf(stderr, "sarea->exported_index: %d\n", sarea->exported_index); - fprintf(stderr, "sarea->exported_stamp: %d\n", sarea->exported_stamp); - fprintf(stderr, "sarea->exported_front_x: %d\n", sarea->exported_front_x); - fprintf(stderr, "sarea->exported_front_y: %d\n", sarea->exported_front_y); - fprintf(stderr, "sarea->exported_back_x: %d\n", sarea->exported_back_x); - fprintf(stderr, "sarea->exported_back_y: %d\n", sarea->exported_back_y); - fprintf(stderr, "sarea->exported_w: %d\n", sarea->exported_w); - fprintf(stderr, "sarea->exported_h: %d\n", sarea->exported_h); - fprintf(stderr, "sarea->exported_buffers: %d\n", sarea->exported_buffers); - fprintf(stderr, "sarea->exported_nfront: %d\n", sarea->exported_nfront); - fprintf(stderr, "sarea->exported_nback: %d\n", sarea->exported_nback); - - i = 0; - if (sarea->exported_buffers & MGA_BACK) - for ( ; i < sarea->exported_nback ; i++) - fprintf(stderr, "back %d: %d,%d-%d,%d\n", i, - sarea->exported_boxes[i].x1, sarea->exported_boxes[i].y1, - sarea->exported_boxes[i].x2, sarea->exported_boxes[i].y2); - - if (sarea->exported_buffers & MGA_FRONT) { - int start = i; - int top = i + sarea->exported_nfront; - for ( ; i < top ; i++) - fprintf(stderr, "front %d: %d,%d-%d,%d\n", - i - start, - sarea->exported_boxes[i].x1, sarea->exported_boxes[i].y1, - sarea->exported_boxes[i].x2, sarea->exported_boxes[i].y2); - } - - fprintf(stderr, "drawableTable[%d].stamp: %d\n", - sarea->exported_index, - driScreen->pSAREA->drawableTable[sarea->exported_index].stamp); -} - -static void printMmesaRects( mgaContextPtr mmesa ) -{ - __DRIscreenPrivate *driScreen = mmesa->driScreen; - __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; - int nr = mmesa->numClipRects; - int i; - - fprintf(stderr, "driDrawable->draw: %ld\n", driDrawable->draw); - fprintf(stderr, "driDrawable->index: %d\n", driDrawable->index); - fprintf(stderr, "driDrawable->lastStamp: %d\n", driDrawable->lastStamp); - fprintf(stderr, "mmesa->drawX: %d\n", mmesa->drawX); - fprintf(stderr, "mmesa->drawY: %d\n", mmesa->drawY); - fprintf(stderr, "driDrawable->w: %d\n", driDrawable->w); - fprintf(stderr, "driDrawable->h: %d\n", driDrawable->h); - - for (i = 0 ; i < nr ; i++) - fprintf(stderr, "box %d: %d,%d-%d,%d\n", i, - mmesa->pClipRects[i].x1, mmesa->pClipRects[i].y1, - mmesa->pClipRects[i].x2, mmesa->pClipRects[i].y2); - - fprintf(stderr, "mmesa->draw_buffer: %d\n", mmesa->draw_buffer); - fprintf(stderr, "drawableTable[%d].stamp: %d\n", - driDrawable->index, - driScreen->pSAREA->drawableTable[driDrawable->index].stamp); -} -#endif - - - -void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers ) -{ - __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; - MGASAREAPrivPtr sarea = mmesa->sarea; - -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - - DRI_VALIDATE_DRAWABLE_INFO(mmesa->display, mmesa->driScreen, driDrawable); - mmesa->dirty_cliprects = 0; - - if (mmesa->draw_buffer == MGA_FRONT) - mgaXMesaSetFrontClipRects( mmesa ); - else - mgaXMesaSetBackClipRects( mmesa ); - -#if 0 - printMmesaRects(mmesa); -#endif - - sarea->req_drawable = driDrawable->draw; - sarea->req_draw_buffer = mmesa->draw_buffer; - - mgaUpdateClipping( mmesa->glCtx ); - mgaCalcViewport( mmesa->glCtx ); - - mmesa->dirty |= MGA_UPLOAD_CLIPRECTS; -} - - - -void mgaDDSetDrawBuffer(GLcontext *ctx, GLenum mode ) -{ - mgaContextPtr mmesa = MGA_CONTEXT(ctx); - - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - - - if (mode == GL_FRONT_LEFT) - { - mmesa->drawOffset = mmesa->mgaScreen->frontOffset; - mmesa->readOffset = mmesa->mgaScreen->frontOffset; - mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset; - mmesa->dirty |= MGA_UPLOAD_CONTEXT; - mmesa->draw_buffer = MGA_FRONT; - mgaXMesaSetFrontClipRects( mmesa ); - FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE ); - } - else if (mode == GL_BACK_LEFT) - { - mmesa->drawOffset = mmesa->mgaScreen->backOffset; - mmesa->readOffset = mmesa->mgaScreen->backOffset; - mmesa->setup.dstorg = mmesa->mgaScreen->backOffset; - mmesa->draw_buffer = MGA_BACK; - mmesa->dirty |= MGA_UPLOAD_CONTEXT; - mgaXMesaSetBackClipRects( mmesa ); - FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE ); - } - else - { - FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE ); - } -} - Index: xc/lib/GL/mesa/src/drv/mga/mgabuffers.h diff -u xc/lib/GL/mesa/src/drv/mga/mgabuffers.h:1.7 xc/lib/GL/mesa/src/drv/mga/mgabuffers.h:removed --- xc/lib/GL/mesa/src/drv/mga/mgabuffers.h:1.7 Wed Oct 30 07:51:35 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgabuffers.h Sat Feb 28 21:41:15 2004 @@ -1,36 +0,0 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgabuffers.h,v 1.7 2002/10/30 12:51:35 alanh Exp $ */ -/* - * Copyright 2000-2001 VA Linux Systems, Inc. - * All Rights Reserved. - * - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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. - * - * Authors: - * Keith Whitwell - */ - -#ifndef MGA_BUFFERS_H -#define MGA_BUFFERS_H - -void mgaDDSetDrawBuffer(GLcontext *ctx, GLenum mode ); - -void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers ); - -#endif Index: xc/lib/GL/mesa/src/drv/mga/mgacontext.h diff -u xc/lib/GL/mesa/src/drv/mga/mgacontext.h:1.7 xc/lib/GL/mesa/src/drv/mga/mgacontext.h:1.12 --- xc/lib/GL/mesa/src/drv/mga/mgacontext.h:1.7 Mon Dec 16 11:18:52 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgacontext.h Fri Jan 23 14:09:31 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgacontext.h,v 1.7 2002/12/16 16:18:52 dawes Exp $*/ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgacontext.h,v 1.12 2004/01/23 19:09:31 dawes Exp $*/ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. @@ -29,14 +29,13 @@ #ifndef MGALIB_INC #define MGALIB_INC -#include #include "dri_util.h" #include "mtypes.h" #include "xf86drm.h" #include "mm.h" -#include "mem.h" #include "mga_sarea.h" - +#include "texmem.h" +#include "macros.h" #define MGA_SET_FIELD(reg,mask,val) reg = ((reg) & (mask)) | ((val) & ~(mask)) #define MGA_FIELD(field,val) (((val) << (field ## _SHIFT)) & ~(field ## _MASK)) @@ -55,23 +54,13 @@ #define MGA_FALLBACK_TEXTURE 0x1 #define MGA_FALLBACK_DRAW_BUFFER 0x2 #define MGA_FALLBACK_READ_BUFFER 0x4 -#define MGA_FALLBACK_LOGICOP 0x8 +#define MGA_FALLBACK_BLEND 0x8 #define MGA_FALLBACK_RENDERMODE 0x10 #define MGA_FALLBACK_STENCIL 0x20 #define MGA_FALLBACK_DEPTH 0x40 +#define MGA_FALLBACK_BORDER_MODE 0x80 -/* For mgaCtx->new_state. - */ -#define MGA_NEW_DEPTH 0x1 -#define MGA_NEW_ALPHA 0x2 -#define MGA_NEW_CLIP 0x8 -#define MGA_NEW_TEXTURE 0x20 -#define MGA_NEW_CULL 0x40 -#define MGA_NEW_WARP 0x80 -#define MGA_NEW_STENCIL 0x100 -#define MGA_NEW_CONTEXT 0x200 - /* Use the templated vertex formats: */ #define TAG(x) mga##x @@ -88,51 +77,119 @@ -/* Reasons why the GL_BLEND fallback mightn't work: +/* Texture environment color */ -#define MGA_BLEND_ENV_COLOR 0x1 -#define MGA_BLEND_MULTITEX 0x2 +#define RGB_ZERO(c) (((c) & 0xffffff) == 0x000000) +#define RGB_ONE(c) (((c) & 0xffffff) == 0xffffff) +#define ALPHA_ZERO(c) (((c) >> 24) == 0x00) +#define ALPHA_ONE(c) (((c) >> 24) == 0xff) +#define RGBA_EQUAL(c) ((c) == PACK_COLOR_8888( (c) & 0xff, (c) & 0xff, \ + (c) & 0xff, (c) & 0xff )) struct mga_texture_object_s; struct mga_screen_private_s; -#define MGA_TEX_MAXLEVELS 5 +#define G200_TEX_MAXLEVELS 5 +#define G400_TEX_MAXLEVELS 11 typedef struct mga_texture_object_s { - struct mga_texture_object_s *next; - struct mga_texture_object_s *prev; - struct gl_texture_object *tObj; - struct mga_context_t *ctx; - PMemBlock MemBlock; - GLuint offsets[MGA_TEX_MAXLEVELS]; - int lastLevel; - GLuint dirty_images; - GLuint totalSize; - int texelBytes; - GLuint age; - int bound; - int heap; /* agp or card */ + driTextureObject base; + + /* The G200 only has the ability to use 5 mipmap levels (including the + * base level). The G400 does not have this restriction, but it still + * only has 5 offset pointers in the hardware. The trick on the G400 is + * upto the first 4 offset pointers point to mipmap levels. The last + * offset pointer tells how large the preceeding mipmap is. This value is + * then used to determine where the remaining mipmaps are. + * + * For example, if the first offsets[0] through offsets[2] are used as + * pointers, then offset[3] will be the size of the mipmap pointed to by + * offsets[2]. So mipmap level 3 will be at (offsets[2]+offsets[3]). For + * each successive mipmap level, offsets[3] is divided by 4 and added to + * the previous address. So mipmap level 4 will be at + * (offsets[2]+offsets[3]+(offsets[3] / 4)). + * + * The last pointer is selected by setting TO_texorgoffsetsel in its + * pointer. In the previous example, offset[2] would have + * TO_texorgoffsetsel or'ed in before writing it to the hardware. + * + * In the current driver all of the mipmaps are packed together linearly + * with mipmap level 0. Therefore offsets[0] points to the base of the + * texture (and has TO_texorgoffsetsel or'ed in), and offsets[1] is the + * size of the base texture. + * + * There is a possible optimization available here. At times the driver + * may not be able to allocate a single block of memory for the complete + * texture without ejecting some other textures from memory. It may be + * possible to put some of the lower mipmap levels (i.e., the larger + * mipmaps) in memory separate from the higher levels. + * + * The implementation should be fairly obvious, but getting "right" would + * likely be non-trivial. A first allocation for the entire texture would + * be attempted with a flag that says "don't eject other textures." If + * that failed, an additional allocation would be attmpted for just the + * base map. The process would repeat with the block of lower maps. The + * tricky parts would be in detecting when some of the levels had been + * ejected from texture memory by other textures and preventing the + * 4th allocation (for all the smallest mipmap levels) from kicking out + * any of the first three. + * + * This array holds G400_TEX_MAXLEVELS pointers to remove an if-statement + * in a loop in mgaSetTexImages. Values past G200_TEX_MAXLEVELS are not + * used. + */ + GLuint offsets[G400_TEX_MAXLEVELS]; + + int texelBytes; + GLuint age; mga_texture_regs_t setup; + + /* If one texture dimension wraps with GL_CLAMP and the other with + * GL_CLAMP_TO_EDGE, we have to fallback to software. We would also have + * to fallback for GL_CLAMP_TO_BORDER. + */ + GLboolean border_fallback; + /* Depending on multitxturing and environment color + * GL_BLEND may have to be a software fallback. + */ + GLboolean texenv_fallback; } mgaTextureObject_t; +struct mga_hw_state { + GLuint specen; + GLuint cull; + GLuint cull_dualtex; + GLuint stencil; + GLuint stencilctl; + GLuint stencil_enable; + GLuint zmode; + GLuint rop; + GLuint alpha_func; + GLuint alpha_func_enable; + GLuint blend_func; + GLuint blend_func_enable; + GLuint alpha_sel; +}; + struct mga_context_t { GLcontext *glCtx; - unsigned int lastStamp; /* fullscreen breaks dpriv->laststamp, - * need to shadow it here. */ + unsigned int lastStamp; /* fullscreen breaks dpriv->laststamp, + * need to shadow it here. */ + + /* Hardware state management + */ + struct mga_hw_state hw; /* Bookkeeping for texturing */ - int lastTexHeap; - struct mga_texture_object_s TexObjList[MGA_NR_TEX_HEAPS]; - struct mga_texture_object_s SwappedOut; + unsigned nr_heaps; + driTexHeap * texture_heaps[ MGA_NR_TEX_HEAPS ]; + driTextureObject swapped; + struct mga_texture_object_s *CurrentTexObj[2]; - memHeap_t *texHeap[MGA_NR_TEX_HEAPS]; - int c_texupload; - int c_texusage; - int tex_thrash; /* Map GL texture units onto hardware. @@ -151,10 +208,11 @@ struct gl_client_array UbyteColor; struct gl_client_array UbyteSecondaryColor; - /* Support for limited GL_BLEND fallback + /* Texture environment color. */ - unsigned int blend_flags; - unsigned int envcolor; + unsigned int envcolor[2]; + GLboolean fcol_used; + GLboolean force_dualtex; /* Rasterization state */ @@ -166,7 +224,7 @@ GLenum raster_primitive; GLenum render_primitive; - char *verts; + GLubyte *verts; GLint vertex_stride_shift; GLuint vertex_format; GLuint vertex_size; @@ -180,8 +238,7 @@ /* Manage driver and hardware state */ - GLuint new_gl_state; - GLuint new_state; + GLuint NewGLState; GLuint dirty; mga_context_regs_t setup; @@ -205,13 +262,21 @@ /* VBI */ GLuint vbl_seq; + GLuint vblank_flags; + + int64_t swap_ust; + int64_t swap_missed_ust; + + GLuint swap_count; + GLuint swap_missed_count; + + PFNGLXGETUSTPROC get_ust; /* Drawable, cliprect and scissor information */ int dirty_cliprects; /* which sets of cliprects are uptodate? */ int draw_buffer; /* which buffer are we rendering to */ unsigned int drawOffset; /* draw buffer address in space */ - int read_buffer; int readOffset; int drawX, drawY; /* origin of drawable in draw buffer */ int lastX, lastY; /* detect DSTORG bug */ @@ -237,7 +302,6 @@ drmContext hHWContext; drmLock *driHwLock; int driFd; - Display *display; __DRIdrawablePrivate *driDrawable; __DRIscreenPrivate *driScreen; struct mga_screen_private_s *mgaScreen; @@ -246,51 +310,38 @@ #define MGA_CONTEXT(ctx) ((mgaContextPtr)(ctx->DriverCtx)) -#define MGAPACKCOLOR555(r,g,b,a) \ - ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \ - ((a) ? 0x8000 : 0)) - -#define MGAPACKCOLOR565(r,g,b) \ - ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) - -#define MGAPACKCOLOR88(l, a) \ - (((l) << 8) | (a)) -#define MGAPACKCOLOR888(r,g,b) \ - (((r) << 16) | ((g) << 8) | (b)) -#define MGAPACKCOLOR8888(r,g,b,a) \ - (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) - -#define MGAPACKCOLOR4444(r,g,b,a) \ - ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) +/* ================================================================ + * Debugging: + */ +#define DO_DEBUG 1 -#define MGA_DEBUG 0 -#ifndef MGA_DEBUG +#if DO_DEBUG extern int MGA_DEBUG; +#else +#define MGA_DEBUG 0 #endif -#define DEBUG_ALWAYS_SYNC 0x1 -#define DEBUG_VERBOSE_MSG 0x2 -#define DEBUG_VERBOSE_LRU 0x4 -#define DEBUG_VERBOSE_DRI 0x8 -#define DEBUG_VERBOSE_IOCTL 0x10 -#define DEBUG_VERBOSE_2D 0x20 -#define DEBUG_VERBOSE_FALLBACK 0x40 +#define DEBUG_VERBOSE_MSG 0x01 +#define DEBUG_VERBOSE_DRI 0x02 +#define DEBUG_VERBOSE_IOCTL 0x04 +#define DEBUG_VERBOSE_TEXTURE 0x08 +#define DEBUG_VERBOSE_FALLBACK 0x10 static __inline__ GLuint mgaPackColor(GLuint cpp, GLubyte r, GLubyte g, GLubyte b, GLubyte a) { - switch (cpp) { - case 2: - return MGAPACKCOLOR565(r,g,b); - case 4: - return MGAPACKCOLOR8888(r,g,b,a); - default: - return 0; - } + switch (cpp) { + case 2: + return PACK_COLOR_565( r, g, b ); + case 4: + return PACK_COLOR_8888( a, r, g, b ); + default: + return 0; + } } Index: xc/lib/GL/mesa/src/drv/mga/mgadd.c diff -u xc/lib/GL/mesa/src/drv/mga/mgadd.c:1.14 xc/lib/GL/mesa/src/drv/mga/mgadd.c:1.15 --- xc/lib/GL/mesa/src/drv/mga/mgadd.c:1.14 Wed Oct 30 07:51:35 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgadd.c Sun Sep 28 16:15:16 2003 @@ -24,15 +24,11 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.14 2002/10/30 12:51:35 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.15 2003/09/28 20:15:16 alanh Exp $ */ #include "mtypes.h" - -#include -#include - #include "mm.h" #include "mgacontext.h" #include "mgadd.h" @@ -42,12 +38,9 @@ #include "mgatris.h" #include "mgavb.h" #include "mga_xmesa.h" -#include "extensions.h" -#if defined(USE_X86_ASM) -#include "X86/common_x86_asm.h" -#endif +#include "utils.h" -#define MGA_DATE "20020221" +#define DRIVER_DATE "20030328" /*************************************** @@ -59,52 +52,19 @@ { mgaContextPtr mmesa = MGA_CONTEXT( ctx ); static char buffer[128]; + unsigned offset; switch ( name ) { case GL_VENDOR: return (GLubyte *) "VA Linux Systems Inc."; case GL_RENDERER: - sprintf( buffer, "Mesa DRI %s " MGA_DATE, - MGA_IS_G400(mmesa) ? "G400" : - MGA_IS_G200(mmesa) ? "G200" : "MGA" ); - - /* Append any AGP-specific information. - */ - switch ( mmesa->mgaScreen->agpMode ) { - case 1: - strncat( buffer, " AGP 1x", 7 ); - break; - case 2: - strncat( buffer, " AGP 2x", 7 ); - break; - case 4: - strncat( buffer, " AGP 4x", 7 ); - break; - } - - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - } -#endif -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif + offset = driGetRendererString( buffer, + MGA_IS_G400(mmesa) ? "G400" : + MGA_IS_G200(mmesa) ? "G200" : "MGA", + DRIVER_DATE, + mmesa->mgaScreen->agpMode ); + return (GLubyte *)buffer; default: @@ -129,40 +89,6 @@ UNLOCK_HARDWARE( mmesa ); } -void mgaDDExtensionsInit( GLcontext *ctx ) -{ - /* paletted_textures currently doesn't work, but we could fix them later */ - /* - _mesa_enable_extension( ctx, "GL_EXT_shared_texture_palette" ); - _mesa_enable_extension( ctx, "GL_EXT_paletted_texture" ); - */ - - _mesa_enable_extension( ctx, "GL_ARB_texture_compression" ); - _mesa_enable_extension( ctx, "GL_ARB_multisample" ); - - _mesa_enable_extension( ctx, "GL_SGIS_generate_mipmap" ); - - /* Turn on multitexture and texenv_add for the G400. - */ - if (MGA_IS_G400(MGA_CONTEXT(ctx))) { - _mesa_enable_extension( ctx, "GL_ARB_multitexture" ); - _mesa_enable_extension( ctx, "GL_ARB_texture_env_add" ); - - _mesa_enable_extension( ctx, "GL_EXT_texture_env_add" ); - -#if defined (MESA_packed_depth_stencil) - _mesa_enable_extension( ctx, "GL_MESA_packed_depth_stencil" ); -#endif - -#if defined (MESA_experimetal_agp_allocator) - if (!getenv("MGA_DISABLE_AGP_ALLOCATOR")) - _mesa_enable_extension( ctx, "GL_MESA_experimental_agp_allocator" ); -#endif - } -} - - - void mgaDDInitDriverFuncs( GLcontext *ctx ) { ctx->Driver.GetBufferSize = mgaBufferSize; Index: xc/lib/GL/mesa/src/drv/mga/mgadd.h diff -u xc/lib/GL/mesa/src/drv/mga/mgadd.h:1.3 xc/lib/GL/mesa/src/drv/mga/mgadd.h:1.4 --- xc/lib/GL/mesa/src/drv/mga/mgadd.h:1.3 Wed Oct 30 07:51:35 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgadd.h Sun Sep 28 16:15:16 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.h,v 1.3 2002/10/30 12:51:35 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.h,v 1.4 2003/09/28 20:15:16 alanh Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. @@ -32,6 +32,5 @@ #include "context.h" void mgaDDInitDriverFuncs( GLcontext *ctx ); -void mgaDDExtensionsInit( GLcontext *ctx ); #endif Index: xc/lib/GL/mesa/src/drv/mga/mgaioctl.c diff -u xc/lib/GL/mesa/src/drv/mga/mgaioctl.c:1.16 xc/lib/GL/mesa/src/drv/mga/mgaioctl.c:1.19 --- xc/lib/GL/mesa/src/drv/mga/mgaioctl.c:1.16 Mon Dec 16 11:18:52 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgaioctl.c Thu Jan 22 22:57:05 2004 @@ -25,9 +25,7 @@ * Keith Whitwell * Gareth Hughes */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.c,v 1.16 2002/12/16 16:18:52 dawes Exp $ */ - -#include +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.c,v 1.19 2004/01/23 03:57:05 dawes Exp $ */ #include "mtypes.h" #include "macros.h" @@ -42,11 +40,10 @@ #include "mgavb.h" #include "mgaioctl.h" #include "mgatris.h" -#include "mgabuffers.h" +#include "mga_common.h" +#include "vblank.h" -#include "xf86drm.h" -#include "mga_common.h" static void mga_iload_dma_ioctl(mgaContextPtr mmesa, unsigned long dest, @@ -60,6 +57,13 @@ fprintf(stderr, "DRM_IOCTL_MGA_ILOAD idx %d dst %x length %d\n", buf->idx, (int) dest, length); + if ( (length & MGA_ILOAD_MASK) != 0 ) { + UNLOCK_HARDWARE( mmesa ); + fprintf( stderr, "%s: Invalid ILOAD datasize (%d), must be " + "multiple of %u.\n", __FUNCTION__, length, MGA_ILOAD_ALIGN ); + exit( 1 ); + } + iload.idx = buf->idx; iload.dstorg = dest; iload.length = length; @@ -277,64 +281,11 @@ } -int nrswaps; - - -void mgaWaitForVBlank( mgaContextPtr mmesa ) -{ - drmVBlank vbl; - int ret; - - if ( !mmesa->mgaScreen->irq ) - return; - - if ( getenv("LIBGL_SYNC_REFRESH") ) { - /* Wait for until the next vertical blank */ - vbl.request.type = DRM_VBLANK_RELATIVE; - vbl.request.sequence = 1; - } else if ( getenv("LIBGL_THROTTLE_REFRESH") ) { - /* Wait for at least one vertical blank since the last call */ - vbl.request.type = DRM_VBLANK_ABSOLUTE; - vbl.request.sequence = mmesa->vbl_seq + 1; - } else { - return; - } - - if ((ret = drmWaitVBlank( mmesa->driFd, &vbl ))) { - fprintf(stderr, "%s: drmWaitVBlank returned %d, IRQs don't seem to be" - " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH" - " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret); - exit(1); - } - - mmesa->vbl_seq = vbl.reply.sequence; -} - - -/* - * Copy the back buffer to the front buffer. - */ -void mgaSwapBuffers(Display *dpy, void *drawablePrivate) +static void mgaWaitForFrameCompletion( mgaContextPtr mmesa ) { - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - mgaContextPtr mmesa; - XF86DRIClipRectPtr pbox; - GLint nbox; - GLint ret, wait = 0; - GLint i; + unsigned wait = 0; GLuint last_frame, last_wrap; - assert(dPriv); - assert(dPriv->driContextPriv); - assert(dPriv->driContextPriv->driverPrivate); - - mmesa = (mgaContextPtr) dPriv->driContextPriv->driverPrivate; - - FLUSH_BATCH( mmesa ); - - mgaWaitForVBlank( mmesa ); - - LOCK_HARDWARE( mmesa ); last_frame = mmesa->sarea->last_frame.head; last_wrap = mmesa->sarea->last_frame.wrap; @@ -358,12 +309,46 @@ } UPDATE_LOCK( mmesa, DRM_LOCK_FLUSH ); - for ( i = 0 ; i < 1024 ; i++ ) { - /* Don't just hammer the register... */ - } + UNLOCK_HARDWARE( mmesa ); + DO_USLEEP( 1 ); + LOCK_HARDWARE( mmesa ); } if ( wait ) fprintf( stderr, "\n" ); +} + + +/* + * Copy the back buffer to the front buffer. + */ +void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv ) +{ + mgaContextPtr mmesa; + XF86DRIClipRectPtr pbox; + GLint nbox; + GLint ret; + GLint i; + GLboolean missed_target; + + + assert(dPriv); + assert(dPriv->driContextPriv); + assert(dPriv->driContextPriv->driverPrivate); + + mmesa = (mgaContextPtr) dPriv->driContextPriv->driverPrivate; + + FLUSH_BATCH( mmesa ); + + LOCK_HARDWARE( mmesa ); + mgaWaitForFrameCompletion( mmesa ); + UNLOCK_HARDWARE( mmesa ); + driWaitForVBlank( dPriv, & mmesa->vbl_seq, mmesa->vblank_flags, + & missed_target ); + if ( missed_target ) { + mmesa->swap_missed_count++; + (void) (*mmesa->get_ust)( & mmesa->swap_missed_ust ); + } + LOCK_HARDWARE( mmesa ); /* Use the frontbuffer cliprects */ @@ -397,6 +382,8 @@ UNLOCK_HARDWARE( mmesa ); mmesa->dirty |= MGA_UPLOAD_CLIPRECTS; + mmesa->swap_count++; + (void) (*mmesa->get_ust)( & mmesa->swap_ust ); } @@ -440,18 +427,17 @@ } -static int intersect_rect( XF86DRIClipRectPtr out, - XF86DRIClipRectPtr a, - XF86DRIClipRectPtr b ) +static GLboolean intersect_rect( XF86DRIClipRectPtr out, + const XF86DRIClipRectPtr a, + const XF86DRIClipRectPtr b ) { *out = *a; if (b->x1 > out->x1) out->x1 = b->x1; if (b->y1 > out->y1) out->y1 = b->y1; if (b->x2 < out->x2) out->x2 = b->x2; if (b->y2 < out->y2) out->y2 = b->y2; - if (out->x1 > out->x2) return 0; - if (out->y1 > out->y2) return 0; - return 1; + + return ((out->x1 < out->x2) && (out->y1 < out->y2)); } @@ -557,7 +543,7 @@ vertex.idx = buffer->idx; vertex.used = buffer->used; vertex.discard = discard; - drmCommandWrite( mmesa->driFd, DRM_MGA_VERTEX, + drmCommandWrite( mmesa->driFd, DRM_MGA_VERTEX, &vertex, sizeof(drmMGAVertex) ); age_mmesa(mmesa, mmesa->sarea->last_enqueue); @@ -601,7 +587,7 @@ { if (MGA_DEBUG&DEBUG_VERBOSE_IOCTL) fprintf(stderr, "mgaGetIloadBuffer (buffer now %p)\n", - mmesa->iload_buffer); + (void *)mmesa->iload_buffer); mmesa->iload_buffer = mga_get_buffer_ioctl( mmesa ); } Index: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h diff -u xc/lib/GL/mesa/src/drv/mga/mgaioctl.h:1.11 xc/lib/GL/mesa/src/drv/mga/mgaioctl.h:1.13 --- xc/lib/GL/mesa/src/drv/mga/mgaioctl.h:1.11 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgaioctl.h Tue Dec 2 08:02:38 2003 @@ -25,7 +25,7 @@ * Keith Whitwell * Gareth Hughes */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.11 2002/10/30 12:51:36 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaioctl.h,v 1.13 2003/12/02 13:02:38 alanh Exp $ */ #ifndef MGA_IOCTL_H #define MGA_IOCTL_H @@ -33,7 +33,8 @@ #include "mgacontext.h" #include "mga_xmesa.h" -void mgaSwapBuffers( Display *dpy, void *drawablePrivate ); +void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv ); +void mgaWaitForVBlank( mgaContextPtr mmesa ); GLuint *mgaAllocVertexDwords( mgaContextPtr mmesa, int dwords ); @@ -103,8 +104,9 @@ if ( ret < 0 ) { \ drmCommandNone( mmesa->driFd, DRM_MGA_RESET ); \ UNLOCK_HARDWARE( mmesa ); \ - fprintf( stderr, "%s: flush ret=%d\n", __FUNCTION__, ret ); \ - /*fprintf( stderr, "drmMGAFlushDMA: return = %d\n", ret );*/ \ + fprintf( stderr, "%s: flush return = %s (%d), flags = 0x%08x\n", \ + __FUNCTION__, strerror( -ret ), -ret, \ + (unsigned)(flags) ); \ exit( 1 ); \ } \ } while (0) Index: xc/lib/GL/mesa/src/drv/mga/mgapixel.c diff -u xc/lib/GL/mesa/src/drv/mga/mgapixel.c:1.9 xc/lib/GL/mesa/src/drv/mga/mgapixel.c:1.10 --- xc/lib/GL/mesa/src/drv/mga/mgapixel.c:1.9 Tue Nov 5 12:46:08 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgapixel.c Sun Sep 28 16:15:17 2003 @@ -25,7 +25,7 @@ * Keith Whitwell * Gareth Hughes */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.c,v 1.9 2002/11/05 17:46:08 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.c,v 1.10 2003/09/28 20:15:17 alanh Exp $ */ #include "enums.h" #include "mtypes.h" @@ -35,12 +35,12 @@ #include "mgacontext.h" #include "mgaioctl.h" #include "mgapixel.h" -#include "mgabuffers.h" +#include "mgastate.h" -#include "xf86drm.h" #include "mga_common.h" #include "swrast/swrast.h" +#include "imports.h" #define IS_AGP_MEM( mmesa, p ) \ ((unsigned long)mmesa->mgaScreen->buffers.map <= ((unsigned long)p) && \ @@ -134,7 +134,7 @@ !ctx->Color.ColorMask[2] || !ctx->Color.ColorMask[3] || ctx->Color.ColorLogicOpEnabled || - ctx->Texture._ReallyEnabled || + ctx->Texture._EnabledUnits || ctx->Depth.OcclusionTest ) && ctx->Current.RasterPosValid && @@ -639,42 +639,8 @@ * the same block of agp space which isn't used for anything else at * present. */ -#if defined(MESA_hacked_agp_allocator) -static void mgaDDFreeAgpMemory( GLcontext *ctx, void *ptr ) -{ - (void) ptr; -} - -static void *mgaDDAllocateAgpMemory( GLcontext *ctx, GLsizei size ) -{ - mgaContextPtr mmesa = MGA_CONTEXT(ctx); - - if (size < mmesa->mgaScreen->textureSize[MGA_AGP_HEAP]) - return mmesa->mgaScreen->texVirtual[MGA_AGP_HEAP]; - else - return 0; -} - -static GLint mgaDDGetAgpOffset( GLcontext *ctx, const void *ptr ) -{ - mgaContextPtr mmesa = MGA_CONTEXT(ctx); - - if (!IS_AGP_MEM(mmesa, ptr)) - return -1; - - return AGP_OFFSET(mmesa, ptr); -} -#endif - - void mgaDDInitPixelFuncs( GLcontext *ctx ) { -#if defined (MESA_experimetal_agp_allocator) - ctx->Driver.AllocateAgpMemory = mgaDDAllocateAgpMemory; - ctx->Driver.GetAgpOffset = mgaDDGetAgpOffset; - ctx->Driver.FreeAgpMemory = mgaDDFreeAgpMemory; -#endif - /* Pixel path fallbacks. */ ctx->Driver.Accum = _swrast_Accum; Index: xc/lib/GL/mesa/src/drv/mga/mgaregs.h diff -u xc/lib/GL/mesa/src/drv/mga/mgaregs.h:1.6 xc/lib/GL/mesa/src/drv/mga/mgaregs.h:1.7 --- xc/lib/GL/mesa/src/drv/mga/mgaregs.h:1.6 Sat Jan 11 22:55:46 2003 +++ xc/lib/GL/mesa/src/drv/mga/mgaregs.h Sun Sep 28 16:15:17 2003 @@ -19,7 +19,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaregs.h,v 1.6 2003/01/12 03:55:46 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaregs.h,v 1.7 2003/09/28 20:15:17 alanh Exp $ */ #ifndef _MGAREGS_H_ #define _MGAREGS_H_ @@ -1052,6 +1052,7 @@ # define TMC_tformat_tw8a 0x7 /* val 7, shift 0 */ # define TMC_tformat_tw8al 0x8 /* val 8, shift 0 */ # define TMC_tformat_tw422 0xa /* val 10, shift 0 */ +# define TMC_tformat_tw422uyvy 0xb /* val 11, shift 0 */ # define TMC_tpitchlin_MASK 0xfffffeff /* bit 8 */ # define TMC_tpitchlin_disable 0x0 # define TMC_tpitchlin_enable 0x100 @@ -1137,6 +1138,13 @@ # define TF_magfilter_nrst 0x0 /* val 0, shift 4 */ # define TF_magfilter_bilin 0x20 /* val 2, shift 4 */ # define TF_magfilter_cnst 0x30 /* val 3, shift 4 */ +# define TF_uvoffset_SHIFT 17 +# define TF_uvoffset_OGL (0U << TF_uvoffset_SHIFT) +# define TF_uvoffset_D3D (1U << TF_uvoffset_SHIFT) +# define TF_uvoffset_MASK (~(1U << TF_uvoffset_SHIFT)) +# define TF_reserved_MASK (~0x1ff00) /* bits 8-16 */ +# define TF_mapnbhigh_SHIFT 18 +# define TF_mapnbhigh_MASK (~(1U << TF_mapnbhigh_SHIFT)) # define TF_avgstride_MASK 0xfff7ffff /* bit 19 */ # define TF_avgstride_disable 0x0 # define TF_avgstride_enable 0x80000 @@ -1377,5 +1385,11 @@ /**************** (END) AUTOMATICLY GENERATED REGISTER FILE ******************/ +/* Copied from mga_drv.h kernel file. + */ + +#define MGA_ILOAD_ALIGN 64 +#define MGA_ILOAD_MASK (MGA_ILOAD_ALIGN - 1) + #endif /* _MGAREGS_H_ */ Index: xc/lib/GL/mesa/src/drv/mga/mgarender.c diff -u xc/lib/GL/mesa/src/drv/mga/mgarender.c:1.4 xc/lib/GL/mesa/src/drv/mga/mgarender.c:1.5 --- xc/lib/GL/mesa/src/drv/mga/mgarender.c:1.4 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgarender.c Sun Sep 28 16:15:17 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgarender.c,v 1.4 2002/10/30 12:51:36 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgarender.c,v 1.5 2003/09/28 20:15:17 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -42,9 +42,8 @@ #include "glheader.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" -#include "mmath.h" #include "tnl/t_context.h" @@ -102,7 +101,7 @@ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK ); tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags ); - MGA_CONTEXT(ctx)->SetupNewInputs |= VERT_CLIP; + MGA_CONTEXT(ctx)->SetupNewInputs |= VERT_BIT_CLIP; } #define LOCAL_VARS mgaContextPtr mmesa = MGA_CONTEXT(ctx) @@ -165,20 +164,20 @@ static void mga_check_render( GLcontext *ctx, struct gl_pipeline_stage *stage ) { - GLuint inputs = VERT_CLIP|VERT_RGBA; + GLuint inputs = VERT_BIT_CLIP | VERT_BIT_COLOR0; if (ctx->RenderMode == GL_RENDER) { if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - inputs |= VERT_SPEC_RGB; + inputs |= VERT_BIT_COLOR1; if (ctx->Texture.Unit[0]._ReallyEnabled) - inputs |= VERT_TEX(0); + inputs |= VERT_BIT_TEX0; if (ctx->Texture.Unit[1]._ReallyEnabled) - inputs |= VERT_TEX(1); + inputs |= VERT_BIT_TEX1; if (ctx->Fog.Enabled) - inputs |= VERT_FOG_COORD; + inputs |= VERT_BIT_FOG; } stage->inputs = inputs; Index: xc/lib/GL/mesa/src/drv/mga/mgaspan.c diff -u xc/lib/GL/mesa/src/drv/mga/mgaspan.c:1.11 xc/lib/GL/mesa/src/drv/mga/mgaspan.c:1.12 --- xc/lib/GL/mesa/src/drv/mga/mgaspan.c:1.11 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgaspan.c Sun Sep 28 16:15:17 2003 @@ -24,7 +24,7 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.c,v 1.11 2002/10/30 12:51:36 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgaspan.c,v 1.12 2003/09/28 20:15:17 alanh Exp $ */ #include "mtypes.h" #include "mgadd.h" @@ -116,7 +116,7 @@ #undef INIT_MONO_PIXEL #define INIT_MONO_PIXEL(p, color) \ - p = MGAPACKCOLOR565( color[0], color[1], color[2] ) + p = PACK_COLOR_565( color[0], color[1], color[2] ) #define WRITE_RGBA( _x, _y, r, g, b, a ) \ @@ -148,7 +148,7 @@ #undef INIT_MONO_PIXEL #define INIT_MONO_PIXEL(p, color) \ - p = MGAPACKCOLOR8888( color[0], color[1], color[2], color[3] ) + p = PACK_COLOR_8888( color[3], color[0], color[1], color[2] ) #define WRITE_RGBA(_x, _y, r, g, b, a) \ @@ -233,20 +233,28 @@ -static void mgaDDSetReadBuffer(GLcontext *ctx, GLframebuffer *buffer, - GLenum mode ) +/* + * This function is called to specify which buffer to read and write + * for software rasterization (swrast) fallbacks. This doesn't necessarily + * correspond to glDrawBuffer() or glReadBuffer() calls. + */ +static void mgaDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer, + GLuint bufferBit) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); - if (mode == GL_FRONT_LEFT) + if (bufferBit == FRONT_LEFT_BIT) { + mmesa->drawOffset = mmesa->mgaScreen->frontOffset; mmesa->readOffset = mmesa->mgaScreen->frontOffset; - mmesa->read_buffer = MGA_FRONT; } - else + else if (bufferBit == BACK_LEFT_BIT) { + mmesa->drawOffset = mmesa->mgaScreen->backOffset; mmesa->readOffset = mmesa->mgaScreen->backOffset; - mmesa->read_buffer = MGA_BACK; + } + else { + assert(0); } } @@ -255,7 +263,7 @@ mgaContextPtr mmesa = MGA_CONTEXT(ctx); struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SetReadBuffer = mgaDDSetReadBuffer; + swdd->SetBuffer = mgaDDSetBuffer; switch (mmesa->mgaScreen->cpp) { case 2: Index: xc/lib/GL/mesa/src/drv/mga/mgastate.c diff -u xc/lib/GL/mesa/src/drv/mga/mgastate.c:1.13 xc/lib/GL/mesa/src/drv/mga/mgastate.c:1.15 --- xc/lib/GL/mesa/src/drv/mga/mgastate.c:1.13 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgastate.c Tue Dec 2 08:02:38 2003 @@ -24,11 +24,11 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.13 2002/10/30 12:51:36 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.15 2003/12/02 13:02:38 alanh Exp $ */ -#include #include "mtypes.h" +#include "colormac.h" #include "dd.h" #include "mm.h" @@ -40,19 +40,17 @@ #include "mgatris.h" #include "mgaioctl.h" #include "mgaregs.h" -#include "mgabuffers.h" #include "swrast/swrast.h" #include "array_cache/acache.h" #include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" #include "swrast_setup/swrast_setup.h" +static void updateSpecularLighting( GLcontext *ctx ); - -/* Some outstanding problems with accelerating logic ops... - */ -#if defined(ACCEL_ROP) -static GLuint mgarop_NoBLK[16] = { +static const GLuint mgarop_NoBLK[16] = { DC_atype_rpl | 0x00000000, DC_atype_rstr | 0x00080000, DC_atype_rstr | 0x00040000, DC_atype_rpl | 0x000c0000, DC_atype_rstr | 0x00020000, DC_atype_rstr | 0x000a0000, @@ -62,476 +60,237 @@ DC_atype_rpl | 0x00030000, DC_atype_rstr | 0x000b0000, DC_atype_rstr | 0x00070000, DC_atype_rpl | 0x000f0000 }; -#endif +/* ============================================================= + * Alpha blending + */ -static void mgaUpdateStencil(const GLcontext *ctx) +static void mgaDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); - GLuint stencil = 0, stencilctl = 0; - - if (ctx->Stencil.Enabled) - { - stencil = ctx->Stencil.Ref | - ( ctx->Stencil.ValueMask << 8 ) | - ( ctx->Stencil.WriteMask << 16 ); - - switch (ctx->Stencil.Function) - { - case GL_NEVER: - MGA_SET_FIELD(stencilctl, SC_smode_MASK, SC_smode_snever); - break; - case GL_LESS: - MGA_SET_FIELD(stencilctl, SC_smode_MASK, SC_smode_slt); - break; - case GL_LEQUAL: - MGA_SET_FIELD(stencilctl, SC_smode_MASK, SC_smode_slte); - break; - case GL_GREATER: - MGA_SET_FIELD(stencilctl, SC_smode_MASK, SC_smode_sgt); - break; - case GL_GEQUAL: - MGA_SET_FIELD(stencilctl, SC_smode_MASK, SC_smode_sgte); - break; - case GL_NOTEQUAL: - MGA_SET_FIELD(stencilctl, SC_smode_MASK, SC_smode_sne); - break; - case GL_EQUAL: - MGA_SET_FIELD(stencilctl, SC_smode_MASK, SC_smode_se); - break; - case GL_ALWAYS: - MGA_SET_FIELD(stencilctl, SC_smode_MASK, SC_smode_salways); - default: - break; - } - - switch (ctx->Stencil.FailFunc) - { - case GL_KEEP: - MGA_SET_FIELD(stencilctl, SC_sfailop_MASK, SC_sfailop_keep); - break; - case GL_ZERO: - MGA_SET_FIELD(stencilctl, SC_sfailop_MASK, SC_sfailop_zero); - break; - case GL_REPLACE: - MGA_SET_FIELD(stencilctl, SC_sfailop_MASK, SC_sfailop_replace); - break; - case GL_INCR: - MGA_SET_FIELD(stencilctl, SC_sfailop_MASK, SC_sfailop_incrsat); - break; - case GL_DECR: - MGA_SET_FIELD(stencilctl, SC_sfailop_MASK, SC_sfailop_decrsat); - break; - case GL_INVERT: - MGA_SET_FIELD(stencilctl, SC_sfailop_MASK, SC_sfailop_invert); - break; - default: - break; - } + GLubyte refByte; + GLuint a; - switch (ctx->Stencil.ZFailFunc) - { - case GL_KEEP: - MGA_SET_FIELD(stencilctl, SC_szfailop_MASK, SC_szfailop_keep); - break; - case GL_ZERO: - MGA_SET_FIELD(stencilctl, SC_szfailop_MASK, SC_szfailop_zero); - break; - case GL_REPLACE: - MGA_SET_FIELD(stencilctl, SC_szfailop_MASK, SC_szfailop_replace); - break; - case GL_INCR: - MGA_SET_FIELD(stencilctl, SC_szfailop_MASK, SC_szfailop_incrsat); - break; - case GL_DECR: - MGA_SET_FIELD(stencilctl, SC_szfailop_MASK, SC_szfailop_decrsat); - break; - case GL_INVERT: - MGA_SET_FIELD(stencilctl, SC_szfailop_MASK, SC_szfailop_invert); - break; - default: - break; - } + CLAMPED_FLOAT_TO_UBYTE(refByte, ref); - switch (ctx->Stencil.ZPassFunc) - { - case GL_KEEP: - MGA_SET_FIELD(stencilctl, SC_szpassop_MASK, SC_szpassop_keep); - break; - case GL_ZERO: - MGA_SET_FIELD(stencilctl, SC_szpassop_MASK, SC_szpassop_zero); - break; - case GL_REPLACE: - MGA_SET_FIELD(stencilctl, SC_szpassop_MASK, SC_szpassop_replace); - break; - case GL_INCR: - MGA_SET_FIELD(stencilctl, SC_szpassop_MASK, SC_szpassop_incrsat); - break; - case GL_DECR: - MGA_SET_FIELD(stencilctl, SC_szpassop_MASK, SC_szpassop_decrsat); - break; - case GL_INVERT: - MGA_SET_FIELD(stencilctl, SC_szpassop_MASK, SC_szpassop_invert); - break; - default: - break; - } + switch ( func ) { + case GL_NEVER: + a = AC_atmode_alt; + refByte = 0; + break; + case GL_LESS: + a = AC_atmode_alt; + break; + case GL_GEQUAL: + a = AC_atmode_agte; + break; + case GL_LEQUAL: + a = AC_atmode_alte; + break; + case GL_GREATER: + a = AC_atmode_agt; + break; + case GL_NOTEQUAL: + a = AC_atmode_ane; + break; + case GL_EQUAL: + a = AC_atmode_ae; + break; + case GL_ALWAYS: + a = AC_atmode_noacmp; + break; + default: + a = 0; + break; } - mmesa->setup.stencil = stencil; - mmesa->setup.stencilctl = stencilctl; - mmesa->dirty |= MGA_UPLOAD_CONTEXT; + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + mmesa->hw.alpha_func = a | MGA_FIELD( AC_atref, refByte ); } -static void mgaDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref, - GLuint mask) +static void updateBlendLogicOp(GLcontext *ctx) { - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_STENCIL; -} + mgaContextPtr mmesa = MGA_CONTEXT(ctx); -static void mgaDDStencilMask(GLcontext *ctx, GLuint mask) -{ - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_STENCIL; + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + + mmesa->hw.blend_func_enable = + (ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled) ? ~0 : 0; + + FALLBACK( ctx, MGA_FALLBACK_BLEND, + ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled && + mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) ); } -static void mgaDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail, - GLenum zpass) +static void mgaDDBlendEquation(GLcontext *ctx, GLenum mode) { - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_STENCIL; + updateBlendLogicOp( ctx ); } -static void mgaDDClearDepth(GLcontext *ctx, GLclampd d) +static void mgaDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); + GLuint src; + GLuint dst; - /* KW: should the ~ be there? */ - switch (mmesa->setup.maccess & ~MA_zwidth_MASK) { - case MA_zwidth_16: mmesa->ClearDepth = d * 0x0000ffff; break; - case MA_zwidth_24: mmesa->ClearDepth = d * 0xffffff00; break; - case MA_zwidth_32: mmesa->ClearDepth = d * 0xffffffff; break; - default: return; + switch (ctx->Color.BlendSrcRGB) { + case GL_ZERO: + src = AC_src_zero; break; + case GL_SRC_ALPHA: + src = AC_src_src_alpha; break; + case GL_ONE: + default: /* never happens */ + src = AC_src_one; break; + case GL_DST_COLOR: + src = AC_src_dst_color; break; + case GL_ONE_MINUS_DST_COLOR: + src = AC_src_om_dst_color; break; + case GL_ONE_MINUS_SRC_ALPHA: + src = AC_src_om_src_alpha; break; + case GL_DST_ALPHA: + src = (ctx->Visual.alphaBits > 0) + ? AC_src_dst_alpha : AC_src_one; + break; + case GL_ONE_MINUS_DST_ALPHA: + src = (ctx->Visual.alphaBits > 0) + ? AC_src_om_dst_alpha : AC_src_zero; + break; + case GL_SRC_ALPHA_SATURATE: + src = (ctx->Visual.alphaBits > 0) + ? AC_src_src_alpha_sat : AC_src_zero; + break; } -} -static void mgaUpdateZMode(const GLcontext *ctx) -{ - mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - int zmode = 0; - - if (ctx->Depth.Test) { - switch(ctx->Depth.Func) { - case GL_NEVER: - /* can't do this in h/w, we'll use a s/w fallback */ - zmode = DC_zmode_nozcmp; - break; - case GL_ALWAYS: - zmode = DC_zmode_nozcmp; break; - case GL_LESS: - zmode = DC_zmode_zlt; break; - case GL_LEQUAL: - zmode = DC_zmode_zlte; break; - case GL_EQUAL: - zmode = DC_zmode_ze; break; - case GL_GREATER: - zmode = DC_zmode_zgt; break; - case GL_GEQUAL: - zmode = DC_zmode_zgte; break; - case GL_NOTEQUAL: - zmode = DC_zmode_zne; break; - default: - break; - } - - if (ctx->Depth.Mask) - zmode |= DC_atype_zi; - else - zmode |= DC_atype_i; - } - else { - zmode |= DC_zmode_nozcmp; - zmode |= DC_atype_i; /* don't write to zbuffer */ + switch (ctx->Color.BlendDstRGB) { + case GL_SRC_ALPHA: + dst = AC_dst_src_alpha; break; + case GL_ONE_MINUS_SRC_ALPHA: + dst = AC_dst_om_src_alpha; break; + default: /* never happens */ + case GL_ZERO: + dst = AC_dst_zero; break; + case GL_ONE: + dst = AC_dst_one; break; + case GL_SRC_COLOR: + dst = AC_dst_src_color; break; + case GL_ONE_MINUS_SRC_COLOR: + dst = AC_dst_om_src_color; break; + case GL_DST_ALPHA: + dst = (ctx->Visual.alphaBits > 0) + ? AC_dst_dst_alpha : AC_dst_one; + break; + case GL_ONE_MINUS_DST_ALPHA: + dst = (ctx->Visual.alphaBits > 0) + ? AC_dst_om_dst_alpha : AC_dst_zero; + break; } -#if defined(ACCEL_ROP) - mmesa->setup.dwgctl &= DC_bop_MASK; - if (ctx->Color.ColorLogicOpEnabled) - zmode |= mgarop_NoBLK[(ctx->Color.LogicOp)&0xf]; - else - zmode |= mgarop_NoBLK[GL_COPY & 0xf]; -#endif + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + mmesa->hw.blend_func = (src | dst); - mmesa->setup.dwgctl &= DC_zmode_MASK & DC_atype_MASK; - mmesa->setup.dwgctl |= zmode; - mmesa->dirty |= MGA_UPLOAD_CONTEXT; -} - - -static void mgaDDAlphaFunc(GLcontext *ctx, GLenum func, GLchan ref) -{ - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_ALPHA; -} - - -static void mgaDDBlendEquation(GLcontext *ctx, GLenum mode) -{ - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_ALPHA; - - /* BlendEquation sets ColorLogicOpEnabled in an unexpected - * manner. - */ - FALLBACK( ctx, MGA_FALLBACK_LOGICOP, - (ctx->Color.ColorLogicOpEnabled && - ctx->Color.LogicOp != GL_COPY)); -} - -static void mgaDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor) -{ - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_ALPHA; + FALLBACK( ctx, MGA_FALLBACK_BLEND, + ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled && + mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) ); } static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA ) { - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_ALPHA; + mgaDDBlendFunc( ctx, sfactorRGB, dfactorRGB ); } +/* ============================================================= + * Depth testing + */ - -static void mgaDDLightModelfv(GLcontext *ctx, GLenum pname, - const GLfloat *param) -{ - if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) { - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_TEXTURE; - } -} - - -static void mgaDDShadeModel(GLcontext *ctx, GLenum mode) +static void mgaDDDepthFunc(GLcontext *ctx, GLenum func) { - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_TEXTURE; -} + mgaContextPtr mmesa = MGA_CONTEXT( ctx ); + int zmode; + switch (func) { + case GL_NEVER: + /* can't do this in h/w, we'll use a s/w fallback */ + FALLBACK (ctx, MGA_FALLBACK_DEPTH, ctx->Depth.Test); + + /* FALLTHROUGH */ + case GL_ALWAYS: + zmode = DC_zmode_nozcmp; break; + case GL_LESS: + zmode = DC_zmode_zlt; break; + case GL_LEQUAL: + zmode = DC_zmode_zlte; break; + case GL_EQUAL: + zmode = DC_zmode_ze; break; + case GL_GREATER: + zmode = DC_zmode_zgt; break; + case GL_GEQUAL: + zmode = DC_zmode_zgte; break; + case GL_NOTEQUAL: + zmode = DC_zmode_zne; break; + default: + zmode = 0; break; + } -static void mgaDDDepthFunc(GLcontext *ctx, GLenum func) -{ - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_DEPTH; + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + mmesa->hw.zmode &= DC_zmode_MASK; + mmesa->hw.zmode |= zmode; } static void mgaDDDepthMask(GLcontext *ctx, GLboolean flag) { - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_DEPTH; -} + mgaContextPtr mmesa = MGA_CONTEXT( ctx ); -#if defined(ACCEL_ROP) -static void mgaDDLogicOp( GLcontext *ctx, GLenum opcode ) -{ - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_DEPTH; -} -#else -static void mgaDDLogicOp( GLcontext *ctx, GLenum opcode ) -{ - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - FALLBACK( ctx, MGA_FALLBACK_LOGICOP, - (ctx->Color.ColorLogicOpEnabled && opcode != GL_COPY) ); -} -#endif + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + mmesa->hw.zmode &= DC_atype_MASK; + mmesa->hw.zmode |= (flag) ? DC_atype_zi : DC_atype_i; +} -static void mgaDDFogfv(GLcontext *ctx, GLenum pname, const GLfloat *param) +static void mgaDDClearDepth(GLcontext *ctx, GLclampd d) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); - if (pname == GL_FOG_COLOR) { - GLuint color = MGAPACKCOLOR888((GLubyte)(ctx->Fog.Color[0]*255.0F), - (GLubyte)(ctx->Fog.Color[1]*255.0F), - (GLubyte)(ctx->Fog.Color[2]*255.0F)); - - MGA_STATECHANGE(mmesa, MGA_UPLOAD_CONTEXT); - mmesa->setup.fogcolor = color; + /* Select the Z depth. The ~ is used because the _MASK values in the + * MGA driver are used to mask OFF the selected bits. In this case, + * we want to mask off everything except the MA_zwidth bits. + */ + switch (mmesa->setup.maccess & ~MA_zwidth_MASK) { + case MA_zwidth_16: mmesa->ClearDepth = d * 0x0000ffff; break; + case MA_zwidth_24: mmesa->ClearDepth = d * 0xffffff00; break; + case MA_zwidth_32: mmesa->ClearDepth = d * 0xffffffff; break; + default: return; } } - - /* ============================================================= - * Alpha blending + * Fog */ -static void mgaUpdateAlphaMode(GLcontext *ctx) +static void mgaDDFogfv(GLcontext *ctx, GLenum pname, const GLfloat *param) { - mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; - int a = 0; - - /* determine source of alpha for blending and testing */ - if ( !ctx->Texture._ReallyEnabled ) { - a |= AC_alphasel_diffused; - } - else { - /* G400: Regardless of texture env mode, we use the alpha from the - * texture unit (AC_alphasel_fromtex) since it will have already - * been modulated by the incoming fragment color, if needed. - * We don't want (AC_alphasel_modulate) since that'll effectively - * do the modulation twice. - */ - if (MGA_IS_G400(mmesa)) { - a |= AC_alphasel_fromtex; - } - else { - /* G200 */ - switch (ctx->Texture.Unit[0].EnvMode) { - case GL_DECAL: - a |= AC_alphasel_diffused; - case GL_REPLACE: - a |= AC_alphasel_fromtex; - break; - case GL_BLEND: - case GL_MODULATE: - a |= AC_alphasel_modulated; - break; - default: - break; - } - } - } - - - /* alpha test control. - */ - if (ctx->Color.AlphaEnabled) { - GLubyte ref = ctx->Color.AlphaRef; - switch (ctx->Color.AlphaFunc) { - case GL_NEVER: - a |= AC_atmode_alt; - ref = 0; - break; - case GL_LESS: - a |= AC_atmode_alt; - break; - case GL_GEQUAL: - a |= AC_atmode_agte; - break; - case GL_LEQUAL: - a |= AC_atmode_alte; - break; - case GL_GREATER: - a |= AC_atmode_agt; - break; - case GL_NOTEQUAL: - a |= AC_atmode_ane; - break; - case GL_EQUAL: - a |= AC_atmode_ae; - break; - case GL_ALWAYS: - a |= AC_atmode_noacmp; - break; - default: - break; - } - a |= MGA_FIELD(AC_atref,ref); - } + mgaContextPtr mmesa = MGA_CONTEXT(ctx); - /* blending control */ - if (ctx->Color.BlendEnabled) { - switch (ctx->Color.BlendSrcRGB) { - case GL_ZERO: - a |= AC_src_zero; break; - case GL_SRC_ALPHA: - a |= AC_src_src_alpha; break; - case GL_ONE: - a |= AC_src_one; break; - case GL_DST_COLOR: - a |= AC_src_dst_color; break; - case GL_ONE_MINUS_DST_COLOR: - a |= AC_src_om_dst_color; break; - case GL_ONE_MINUS_SRC_ALPHA: - a |= AC_src_om_src_alpha; break; - case GL_DST_ALPHA: - if (mgaScreen->cpp == 4) - a |= AC_src_dst_alpha; - else - a |= AC_src_one; - break; - case GL_ONE_MINUS_DST_ALPHA: - if (mgaScreen->cpp == 4) - a |= AC_src_om_dst_alpha; - else - a |= AC_src_zero; - break; - case GL_SRC_ALPHA_SATURATE: - if (ctx->Visual.alphaBits > 0) - a |= AC_src_src_alpha_sat; - else - a |= AC_src_zero; - break; - default: /* never happens */ - break; - } + if (pname == GL_FOG_COLOR) { + GLuint color = PACK_COLOR_888((GLubyte)(ctx->Fog.Color[0]*255.0F), + (GLubyte)(ctx->Fog.Color[1]*255.0F), + (GLubyte)(ctx->Fog.Color[2]*255.0F)); - switch (ctx->Color.BlendDstRGB) { - case GL_SRC_ALPHA: - a |= AC_dst_src_alpha; break; - case GL_ONE_MINUS_SRC_ALPHA: - a |= AC_dst_om_src_alpha; break; - case GL_ZERO: - a |= AC_dst_zero; break; - case GL_ONE: - a |= AC_dst_one; break; - case GL_SRC_COLOR: - a |= AC_dst_src_color; break; - case GL_ONE_MINUS_SRC_COLOR: - a |= AC_dst_om_src_color; break; - case GL_DST_ALPHA: - if (mgaScreen->cpp == 4) - a |= AC_dst_dst_alpha; - else - a |= AC_dst_one; - break; - case GL_ONE_MINUS_DST_ALPHA: - if (mgaScreen->cpp == 4) - a |= AC_dst_om_dst_alpha; - else - a |= AC_dst_zero; - break; - default: /* never happens */ - break; - } - } else { - a |= AC_src_one|AC_dst_zero; + MGA_STATECHANGE(mmesa, MGA_UPLOAD_CONTEXT); + mmesa->setup.fogcolor = color; } - - mmesa->setup.alphactrl = (AC_amode_alpha_channel | - AC_astipple_disable | - AC_aten_disable | - AC_atmode_noacmp | - a); - - mmesa->dirty |= MGA_UPLOAD_CONTEXT; } - /* ============================================================= - * Hardware clipping + * Scissoring */ + void mgaUpdateClipping(const GLcontext *ctx) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); @@ -554,13 +313,6 @@ mmesa->scissor_rect.x2 = x2; mmesa->scissor_rect.y2 = y2; - if (MGA_DEBUG&DEBUG_VERBOSE_2D) - fprintf(stderr, "SET SCISSOR %d,%d-%d,%d\n", - mmesa->scissor_rect.x1, - mmesa->scissor_rect.y1, - mmesa->scissor_rect.x2, - mmesa->scissor_rect.y2); - mmesa->dirty |= MGA_UPLOAD_CLIPRECTS; } } @@ -569,19 +321,10 @@ static void mgaDDScissor( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) { - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_CLIP; -} - - -static void mgaDDClearColor(GLcontext *ctx, - const GLchan color[4] ) -{ - mgaContextPtr mmesa = MGA_CONTEXT(ctx); - - mmesa->ClearColor = mgaPackColor( mmesa->mgaScreen->cpp, - color[0], color[1], - color[2], color[3]); + if ( ctx->Scissor.Enabled ) { + FLUSH_BATCH( MGA_CONTEXT(ctx) ); /* don't pipeline cliprect changes */ + mgaUpdateClipping( ctx ); + } } @@ -589,45 +332,39 @@ * Culling */ + #define _CULL_DISABLE 0 #define _CULL_NEGATIVE ((1<<11)|(1<<5)|(1<<16)) #define _CULL_POSITIVE (1<<11) - -void mgaUpdateCull( GLcontext *ctx ) +static void mgaDDCullFaceFrontFace(GLcontext *ctx, GLenum unused) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); - GLuint mode = _CULL_DISABLE; + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); if (ctx->Polygon.CullFlag && - mmesa->raster_primitive == GL_TRIANGLES && ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) { - mode = _CULL_NEGATIVE; - if (ctx->Polygon.CullFaceMode == GL_FRONT) - mode ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE); - if (ctx->Polygon.FrontFace != GL_CCW) - mode ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE); - if (ctx->Texture._ReallyEnabled == (TEXTURE0_2D|TEXTURE1_2D)) - mode ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE); /* warp bug? */ - } + mmesa->hw.cull = _CULL_NEGATIVE; - mmesa->setup.wflag = mode; - mmesa->dirty |= MGA_UPLOAD_CONTEXT; -} + if (ctx->Polygon.CullFaceMode == GL_FRONT) + mmesa->hw.cull ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE); + if (ctx->Polygon.FrontFace != GL_CCW) + mmesa->hw.cull ^= (_CULL_POSITIVE ^ _CULL_NEGATIVE); -static void mgaDDCullFaceFrontFace(GLcontext *ctx, GLenum mode) -{ - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_CULL; + mmesa->hw.cull_dualtex = mmesa->hw.cull ^ + (_CULL_POSITIVE ^ _CULL_NEGATIVE); /* warp bug? */ + } + else { + mmesa->hw.cull = _CULL_DISABLE; + mmesa->hw.cull_dualtex = _CULL_DISABLE; + } } - - /* ============================================================= - * Color masks + * Masks */ static void mgaDDColorMask(GLcontext *ctx, @@ -653,17 +390,13 @@ } } + /* ============================================================= - * Polygon stipple - * - * The mga supports a subset of possible 4x4 stipples natively, GL - * wants 32x32. Fortunately stipple is usually a repeating pattern. - * - * Note: the fully opaque pattern (0xffff) has been disabled in order - * to work around a conformance issue. + * Polygon state */ + static int mgaStipples[16] = { - 0xffff1, /* See above note */ + 0xffff, 0xa5a5, 0x5a5a, 0xa0a0, @@ -681,6 +414,14 @@ 0x0000 }; +/** + * The MGA supports a subset of possible 4x4 stipples natively, GL + * wants 32x32. Fortunately stipple is usually a repeating pattern. + * + * \param ctx GL rendering context to be affected + * \param mask Pointer to the 32x32 stipple mask + */ + static void mgaDDPolygonStipple( GLcontext *ctx, const GLubyte *mask ) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); @@ -729,93 +470,208 @@ } } + /* ============================================================= + * Rendering attributes + * + * We really don't want to recalculate all this every time we bind a + * texture. These things shouldn't change all that often, so it makes + * sense to break them out of the core texture state update routines. */ -static void mgaDDPrintDirty( const char *msg, GLuint state ) +static void updateSpecularLighting( GLcontext *ctx ) { - fprintf(stderr, "%s (0x%x): %s%s%s%s%s%s%s\n", - msg, - (unsigned int) state, - (state & MGA_WAIT_AGE) ? "wait-age, " : "", - (state & MGA_UPLOAD_TEX0IMAGE) ? "upload-tex0-img, " : "", - (state & MGA_UPLOAD_TEX1IMAGE) ? "upload-tex1-img, " : "", - (state & MGA_UPLOAD_CONTEXT) ? "upload-ctx, " : "", - (state & MGA_UPLOAD_TEX0) ? "upload-tex0, " : "", - (state & MGA_UPLOAD_TEX1) ? "upload-tex1, " : "", - (state & MGA_UPLOAD_PIPE) ? "upload-pipe, " : "" - ); + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + unsigned int specen; + + specen = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TMC_specen_enable : 0; + + if ( specen != mmesa->hw.specen ) { + mmesa->hw.specen = specen; + mmesa->dirty |= MGA_UPLOAD_TEX0 | MGA_UPLOAD_TEX1; + } } -/* Push the state into the sarea and/or texture memory. + +/* ============================================================= + * Materials */ -void mgaEmitHwStateLocked( mgaContextPtr mmesa ) + + +static void mgaDDLightModelfv(GLcontext *ctx, GLenum pname, + const GLfloat *param) { - MGASAREAPrivPtr sarea = mmesa->sarea; + if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) { + FLUSH_BATCH( MGA_CONTEXT(ctx) ); + updateSpecularLighting( ctx ); + } +} - if (MGA_DEBUG & DEBUG_VERBOSE_MSG) - mgaDDPrintDirty( "mgaEmitHwStateLocked", mmesa->dirty ); - if ((mmesa->dirty & MGA_UPLOAD_TEX0IMAGE) && mmesa->CurrentTexObj[0]) - mgaUploadTexImages(mmesa, mmesa->CurrentTexObj[0]); +/* ============================================================= + * Stencil + */ + + +static void mgaDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref, + GLuint mask) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + GLuint stencil; + GLuint stencilctl; + + stencil = MGA_FIELD( S_sref, ref ) | MGA_FIELD( S_smsk, mask ); + switch (func) + { + case GL_NEVER: + stencilctl = SC_smode_snever; + break; + case GL_LESS: + stencilctl = SC_smode_slt; + break; + case GL_LEQUAL: + stencilctl = SC_smode_slte; + break; + case GL_GREATER: + stencilctl = SC_smode_sgt; + break; + case GL_GEQUAL: + stencilctl = SC_smode_sgte; + break; + case GL_NOTEQUAL: + stencilctl = SC_smode_sne; + break; + case GL_EQUAL: + stencilctl = SC_smode_se; + break; + case GL_ALWAYS: + default: + stencilctl = SC_smode_salways; + break; + } - if ((mmesa->dirty & MGA_UPLOAD_TEX1IMAGE) && mmesa->CurrentTexObj[1]) - mgaUploadTexImages(mmesa, mmesa->CurrentTexObj[1]); + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + mmesa->hw.stencil &= (S_sref_MASK & S_smsk_MASK); + mmesa->hw.stencil |= stencil; + mmesa->hw.stencilctl &= SC_smode_MASK; + mmesa->hw.stencilctl |= stencilctl; +} - if (mmesa->dirty & MGA_UPLOAD_CONTEXT) { - memcpy( &sarea->ContextState, &mmesa->setup, sizeof(mmesa->setup)); - } +static void mgaDDStencilMask(GLcontext *ctx, GLuint mask) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); - if ((mmesa->dirty & MGA_UPLOAD_TEX0) && mmesa->CurrentTexObj[0]) { - memcpy(&sarea->TexState[0], - &mmesa->CurrentTexObj[0]->setup, - sizeof(sarea->TexState[0])); - } + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + mmesa->hw.stencil &= S_swtmsk_MASK; + mmesa->hw.stencil |= MGA_FIELD( S_swtmsk, mask ); +} - if ((mmesa->dirty & MGA_UPLOAD_TEX1) && mmesa->CurrentTexObj[1]) { - memcpy(&sarea->TexState[1], - &mmesa->CurrentTexObj[1]->setup, - sizeof(sarea->TexState[1])); - } +static void mgaDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail, + GLenum zpass) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + GLuint stencilctl; - if (sarea->TexState[0].texctl2 != - sarea->TexState[1].texctl2) { - memcpy(&sarea->TexState[1], - &sarea->TexState[0], - sizeof(sarea->TexState[0])); - mmesa->dirty |= MGA_UPLOAD_TEX1|MGA_UPLOAD_TEX0; + stencilctl = 0; + switch (ctx->Stencil.FailFunc[0]) + { + case GL_KEEP: + stencilctl |= SC_sfailop_keep; + break; + case GL_ZERO: + stencilctl |= SC_sfailop_zero; + break; + case GL_REPLACE: + stencilctl |= SC_sfailop_replace; + break; + case GL_INCR: + stencilctl |= SC_sfailop_incrsat; + break; + case GL_DECR: + stencilctl |= SC_sfailop_decrsat; + break; + case GL_INCR_WRAP: + stencilctl |= SC_sfailop_incr; + break; + case GL_DECR_WRAP: + stencilctl |= SC_sfailop_decr; + break; + case GL_INVERT: + stencilctl |= SC_sfailop_invert; + break; + default: + break; } - if (mmesa->dirty & MGA_UPLOAD_PIPE) { -/* mmesa->sarea->wacceptseq = mmesa->hw_primitive; */ - mmesa->sarea->WarpPipe = mmesa->vertex_format; - mmesa->sarea->vertsize = mmesa->vertex_size; + switch (ctx->Stencil.ZFailFunc[0]) + { + case GL_KEEP: + stencilctl |= SC_szfailop_keep; + break; + case GL_ZERO: + stencilctl |= SC_szfailop_zero; + break; + case GL_REPLACE: + stencilctl |= SC_szfailop_replace; + break; + case GL_INCR: + stencilctl |= SC_szfailop_incrsat; + break; + case GL_DECR: + stencilctl |= SC_szfailop_decrsat; + break; + case GL_INCR_WRAP: + stencilctl |= SC_szfailop_incr; + break; + case GL_DECR_WRAP: + stencilctl |= SC_szfailop_decr; + break; + case GL_INVERT: + stencilctl |= SC_szfailop_invert; + break; + default: + break; } - mmesa->sarea->dirty |= mmesa->dirty; - - mmesa->dirty &= (MGA_UPLOAD_CLIPRECTS|MGA_WAIT_AGE); - - /* This is a bit of a hack but seems to be the best place to ensure - * that separate specular is disabled when not needed. - */ - if (mmesa->glCtx->Texture._ReallyEnabled == 0 || - !mmesa->glCtx->Light.Enabled || - mmesa->glCtx->Light.Model.ColorControl == GL_SINGLE_COLOR) { - sarea->TexState[0].texctl2 &= ~TMC_specen_enable; - sarea->TexState[1].texctl2 &= ~TMC_specen_enable; + switch (ctx->Stencil.ZPassFunc[0]) + { + case GL_KEEP: + stencilctl |= SC_szpassop_keep; + break; + case GL_ZERO: + stencilctl |= SC_szpassop_zero; + break; + case GL_REPLACE: + stencilctl |= SC_szpassop_replace; + break; + case GL_INCR: + stencilctl |= SC_szpassop_incrsat; + break; + case GL_DECR: + stencilctl |= SC_szpassop_decrsat; + break; + case GL_INCR_WRAP: + stencilctl |= SC_szpassop_incr; + break; + case GL_DECR_WRAP: + stencilctl |= SC_szpassop_decr; + break; + case GL_INVERT: + stencilctl |= SC_szpassop_invert; + break; + default: + break; } -} -/* Fallback to swrast for select and feedback. - */ -static void mgaRenderMode( GLcontext *ctx, GLenum mode ) -{ - FALLBACK( ctx, MGA_FALLBACK_RENDERMODE, (mode != GL_RENDER) ); + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + mmesa->hw.stencilctl &= (SC_sfailop_MASK & SC_szfailop_MASK + & SC_szpassop_MASK); + mmesa->hw.stencilctl |= stencilctl; } /* ============================================================= + * Window position and viewport transformation */ void mgaCalcViewport( GLcontext *ctx ) @@ -849,39 +705,197 @@ mgaCalcViewport( ctx ); } + +/* ============================================================= + * Miscellaneous + */ + +static void mgaDDClearColor(GLcontext *ctx, + const GLfloat color[4] ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + GLubyte c[4]; + CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); + + mmesa->ClearColor = mgaPackColor( mmesa->mgaScreen->cpp, + c[0], c[1], c[2], c[3]); +} + + +/* Fallback to swrast for select and feedback. + */ +static void mgaRenderMode( GLcontext *ctx, GLenum mode ) +{ + FALLBACK( ctx, MGA_FALLBACK_RENDERMODE, (mode != GL_RENDER) ); +} + + +static void mgaDDLogicOp( GLcontext *ctx, GLenum opcode ) +{ + mgaContextPtr mmesa = MGA_CONTEXT( ctx ); + + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + mmesa->hw.rop = mgarop_NoBLK[ opcode & 0x0f ]; +} + + +static void mgaXMesaSetFrontClipRects( mgaContextPtr mmesa ) +{ + __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; + + if (driDrawable->numClipRects == 0) { + static XF86DRIClipRectRec zeroareacliprect = {0,0,0,0}; + mmesa->numClipRects = 1; + mmesa->pClipRects = &zeroareacliprect; + } else { + mmesa->numClipRects = driDrawable->numClipRects; + mmesa->pClipRects = driDrawable->pClipRects; + } + mmesa->drawX = driDrawable->x; + mmesa->drawY = driDrawable->y; + + mmesa->setup.dstorg = mmesa->drawOffset; + mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS; +} + + +static void mgaXMesaSetBackClipRects( mgaContextPtr mmesa ) +{ + __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; + + if (driDrawable->numBackClipRects == 0) + { + if (driDrawable->numClipRects == 0) { + static XF86DRIClipRectRec zeroareacliprect = {0,0,0,0}; + mmesa->numClipRects = 1; + mmesa->pClipRects = &zeroareacliprect; + } else { + mmesa->numClipRects = driDrawable->numClipRects; + mmesa->pClipRects = driDrawable->pClipRects; + } + mmesa->drawX = driDrawable->x; + mmesa->drawY = driDrawable->y; + } else { + mmesa->numClipRects = driDrawable->numBackClipRects; + mmesa->pClipRects = driDrawable->pBackClipRects; + mmesa->drawX = driDrawable->backX; + mmesa->drawY = driDrawable->backY; + } + + mmesa->setup.dstorg = mmesa->drawOffset; + mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS; +} + + +void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers ) +{ + __DRIdrawablePrivate *driDrawable = mmesa->driDrawable; + MGASAREAPrivPtr sarea = mmesa->sarea; + + + DRI_VALIDATE_DRAWABLE_INFO(mmesa->driScreen, driDrawable); + mmesa->dirty_cliprects = 0; + + if (mmesa->draw_buffer == MGA_FRONT) + mgaXMesaSetFrontClipRects( mmesa ); + else + mgaXMesaSetBackClipRects( mmesa ); + + + sarea->req_drawable = driDrawable->draw; + sarea->req_draw_buffer = mmesa->draw_buffer; + + mgaUpdateClipping( mmesa->glCtx ); + mgaCalcViewport( mmesa->glCtx ); + + mmesa->dirty |= MGA_UPLOAD_CLIPRECTS; +} + + +static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + + FLUSH_BATCH( mmesa ); + + /* + * _DrawDestMask is easier to cope with than . + */ + switch ( ctx->Color._DrawDestMask ) { + case FRONT_LEFT_BIT: + mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset; + mmesa->dirty |= MGA_UPLOAD_CONTEXT; + mmesa->draw_buffer = MGA_FRONT; + mgaXMesaSetFrontClipRects( mmesa ); + FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE ); + break; + case BACK_LEFT_BIT: + mmesa->setup.dstorg = mmesa->mgaScreen->backOffset; + mmesa->draw_buffer = MGA_BACK; + mmesa->dirty |= MGA_UPLOAD_CONTEXT; + mgaXMesaSetBackClipRects( mmesa ); + FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE ); + break; + default: + /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ + FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE ); + return; + } + + /* We want to update the s/w rast state too so that r200SetBuffer() + * gets called. + */ + _swrast_DrawBuffer(ctx, mode); +} + + +static void mgaDDReadBuffer(GLcontext *ctx, GLenum mode ) +{ + /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */ +} + + /* ============================================================= + * State enable/disable */ + static void mgaDDEnable(GLcontext *ctx, GLenum cap, GLboolean state) { mgaContextPtr mmesa = MGA_CONTEXT( ctx ); switch(cap) { - case GL_ALPHA_TEST: - FLUSH_BATCH( mmesa ); - mmesa->new_state |= MGA_NEW_ALPHA; + case GL_DITHER: + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + if (!ctx->Color.DitherFlag) + mmesa->setup.maccess |= MA_nodither_enable; + else + mmesa->setup.maccess &= ~MA_nodither_enable; break; - case GL_BLEND: + case GL_LIGHTING: + case GL_COLOR_SUM_EXT: FLUSH_BATCH( mmesa ); - mmesa->new_state |= MGA_NEW_ALPHA; - - /* For some reason enable(GL_BLEND) affects ColorLogicOpEnabled. - */ - FALLBACK( ctx, MGA_FALLBACK_LOGICOP, - (ctx->Color.ColorLogicOpEnabled && - ctx->Color.LogicOp != GL_COPY)); + updateSpecularLighting( ctx ); + break; + case GL_ALPHA_TEST: + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + mmesa->hw.alpha_func_enable = (state) ? ~0 : 0; break; case GL_DEPTH_TEST: - FLUSH_BATCH( mmesa ); - mmesa->new_state |= MGA_NEW_DEPTH; + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); FALLBACK (ctx, MGA_FALLBACK_DEPTH, ctx->Depth.Func == GL_NEVER && ctx->Depth.Test); break; + case GL_SCISSOR_TEST: FLUSH_BATCH( mmesa ); mmesa->scissor = state; - mmesa->new_state |= MGA_NEW_CLIP; + mgaUpdateClipping( ctx ); break; + case GL_FOG: MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); if (ctx->Fog.Enabled) @@ -890,39 +904,34 @@ mmesa->setup.maccess &= ~MA_fogen_enable; break; case GL_CULL_FACE: - FLUSH_BATCH( mmesa ); - mmesa->new_state |= MGA_NEW_CULL; + mgaDDCullFaceFrontFace( ctx, 0 ); break; case GL_TEXTURE_1D: case GL_TEXTURE_2D: case GL_TEXTURE_3D: - FLUSH_BATCH( mmesa ); - mmesa->new_state |= (MGA_NEW_TEXTURE|MGA_NEW_ALPHA); break; case GL_POLYGON_STIPPLE: if (mmesa->haveHwStipple && mmesa->raster_primitive == GL_TRIANGLES) { - FLUSH_BATCH(mmesa); - mmesa->dirty |= MGA_UPLOAD_CONTEXT; + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); mmesa->setup.dwgctl &= ~(0xf<<20); if (state) mmesa->setup.dwgctl |= mmesa->poly_stipple; } break; + + case GL_BLEND: case GL_COLOR_LOGIC_OP: - FLUSH_BATCH( mmesa ); -#if !defined(ACCEL_ROP) - FALLBACK( ctx, MGA_FALLBACK_LOGICOP, - (state && ctx->Color.LogicOp != GL_COPY)); -#else - mmesa->new_state |= MGA_NEW_DEPTH; -#endif + updateBlendLogicOp( ctx ); break; + case GL_STENCIL_TEST: - FLUSH_BATCH( mmesa ); - if (mmesa->hw_stencil) - mmesa->new_state |= MGA_NEW_STENCIL; - else + MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); + if (mmesa->hw_stencil) { + mmesa->hw.stencil_enable = ( state ) ? ~0 : 0; + } + else { FALLBACK( ctx, MGA_FALLBACK_STENCIL, state ); + } default: break; } @@ -932,56 +941,124 @@ /* ============================================================= */ - - -/* ============================================================= - */ - -static void mgaDDPrintState( const char *msg, GLuint state ) +static void mgaDDPrintDirty( const char *msg, GLuint state ) { - fprintf(stderr, "%s (0x%x): %s%s%s%s%s%s\n", + fprintf(stderr, "%s (0x%03x): %s%s%s%s%s%s%s\n", msg, - state, - (state & MGA_NEW_DEPTH) ? "depth, " : "", - (state & MGA_NEW_ALPHA) ? "alpha, " : "", - (state & MGA_NEW_CLIP) ? "clip, " : "", - (state & MGA_NEW_CULL) ? "cull, " : "", - (state & MGA_NEW_TEXTURE) ? "texture, " : "", - (state & MGA_NEW_CONTEXT) ? "context, " : ""); + (unsigned int) state, + (state & MGA_WAIT_AGE) ? "wait-age " : "", + (state & MGA_UPLOAD_TEX0IMAGE) ? "upload-tex0-img " : "", + (state & MGA_UPLOAD_TEX1IMAGE) ? "upload-tex1-img " : "", + (state & MGA_UPLOAD_CONTEXT) ? "upload-ctx " : "", + (state & MGA_UPLOAD_TEX0) ? "upload-tex0 " : "", + (state & MGA_UPLOAD_TEX1) ? "upload-tex1 " : "", + (state & MGA_UPLOAD_PIPE) ? "upload-pipe " : "" + ); } -void mgaDDUpdateHwState( GLcontext *ctx ) +/* Push the state into the sarea and/or texture memory. + */ +void mgaEmitHwStateLocked( mgaContextPtr mmesa ) { - mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - int new_state = mmesa->new_state; + MGASAREAPrivPtr sarea = mmesa->sarea; + GLcontext * ctx = mmesa->glCtx; - if (new_state) - { - FLUSH_BATCH( mmesa ); + if (MGA_DEBUG & DEBUG_VERBOSE_MSG) + mgaDDPrintDirty( __FUNCTION__, mmesa->dirty ); + + if (mmesa->dirty & MGA_UPLOAD_CONTEXT) { + mmesa->setup.wflag = _CULL_DISABLE; + if (mmesa->raster_primitive == GL_TRIANGLES) { + if ((ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT && + ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT)) { + mmesa->setup.wflag = mmesa->hw.cull_dualtex; + } + else { + mmesa->setup.wflag = mmesa->hw.cull; + } + } + + mmesa->setup.stencil = mmesa->hw.stencil + & mmesa->hw.stencil_enable; + mmesa->setup.stencilctl = mmesa->hw.stencilctl + & mmesa->hw.stencil_enable; + + /* If depth testing is not enabled, then use the no Z-compare / no + * Z-write mode. Otherwise, use whatever is set in hw.zmode. + */ + mmesa->setup.dwgctl &= (DC_zmode_MASK & DC_atype_MASK); + mmesa->setup.dwgctl |= (ctx->Depth.Test) + ? mmesa->hw.zmode : (DC_zmode_nozcmp | DC_atype_i); + + mmesa->setup.dwgctl &= DC_bop_MASK; + mmesa->setup.dwgctl |= (ctx->Color._LogicOpEnabled) + ? mmesa->hw.rop : mgarop_NoBLK[ GL_COPY & 0x0f ]; + + mmesa->setup.alphactrl &= AC_src_MASK & AC_dst_MASK & AC_atmode_MASK + & AC_atref_MASK & AC_alphasel_MASK; + mmesa->setup.alphactrl |= + (mmesa->hw.alpha_func & mmesa->hw.alpha_func_enable) | + (mmesa->hw.blend_func & mmesa->hw.blend_func_enable) | + ((AC_src_one | AC_dst_zero) & ~mmesa->hw.blend_func_enable) | + mmesa->hw.alpha_sel; + + memcpy( &sarea->ContextState, &mmesa->setup, sizeof(mmesa->setup)); + } + + if ((mmesa->dirty & MGA_UPLOAD_TEX0) && mmesa->CurrentTexObj[0]) { + memcpy(&sarea->TexState[0], + &mmesa->CurrentTexObj[0]->setup, + sizeof(sarea->TexState[0])); + } + + if ((mmesa->dirty & MGA_UPLOAD_TEX1) && mmesa->CurrentTexObj[1]) { + memcpy(&sarea->TexState[1], + &mmesa->CurrentTexObj[1]->setup, + sizeof(sarea->TexState[1])); + } + + if (mmesa->dirty & (MGA_UPLOAD_TEX0 | MGA_UPLOAD_TEX1)) { + sarea->TexState[0].texctl2 &= ~TMC_specen_enable; + sarea->TexState[1].texctl2 &= ~TMC_specen_enable; + sarea->TexState[0].texctl2 |= mmesa->hw.specen; + sarea->TexState[1].texctl2 |= mmesa->hw.specen; + } + + if (mmesa->dirty & MGA_UPLOAD_PIPE) { +/* mmesa->sarea->wacceptseq = mmesa->hw_primitive; */ + mmesa->sarea->WarpPipe = mmesa->vertex_format; + mmesa->sarea->vertsize = mmesa->vertex_size; + } - mmesa->new_state = 0; + mmesa->sarea->dirty |= mmesa->dirty; + mmesa->dirty &= MGA_UPLOAD_CLIPRECTS; +} - if (MESA_VERBOSE&VERBOSE_DRIVER) - mgaDDPrintState("UpdateHwState", new_state); +/* ============================================================= + */ - if (new_state & MGA_NEW_DEPTH) - mgaUpdateZMode(ctx); - if (new_state & MGA_NEW_ALPHA) - mgaUpdateAlphaMode(ctx); +static void mgaDDValidateState( GLcontext *ctx ) +{ + mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - if (new_state & MGA_NEW_CLIP) - mgaUpdateClipping(ctx); + FLUSH_BATCH( mmesa ); - if (new_state & MGA_NEW_STENCIL) - mgaUpdateStencil(ctx); + if (mmesa->NewGLState & _NEW_TEXTURE) { + mgaUpdateTextureState(ctx); + } - if (new_state & (MGA_NEW_WARP|MGA_NEW_CULL)) - mgaUpdateCull(ctx); + if (!mmesa->Fallback) { + if (mmesa->NewGLState & _MGA_NEW_RASTERSETUP) { + mgaChooseVertexState( ctx ); + } - if (new_state & (MGA_NEW_WARP|MGA_NEW_TEXTURE)) - mgaUpdateTextureState(ctx); + if (mmesa->NewGLState & _MGA_NEW_RENDERSTATE) { + mgaChooseRenderState( ctx ); + } } + + mmesa->NewGLState = 0; } @@ -991,25 +1068,40 @@ _swsetup_InvalidateState( ctx, new_state ); _ac_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); - MGA_CONTEXT(ctx)->new_gl_state |= new_state; + MGA_CONTEXT(ctx)->NewGLState |= new_state; } +static void mgaRunPipeline( GLcontext *ctx ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + + if (mmesa->NewGLState) { + mgaDDValidateState( ctx ); + } + + if (mmesa->dirty) { + mgaEmitHwStateLocked( mmesa ); + } + + _tnl_run_pipeline( ctx ); +} + void mgaInitState( mgaContextPtr mmesa ) { mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; GLcontext *ctx = mmesa->glCtx; - if (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT) { + if (ctx->Visual.doubleBufferMode) { + /* use back buffer by default */ mmesa->draw_buffer = MGA_BACK; - mmesa->read_buffer = MGA_BACK; mmesa->drawOffset = mmesa->mgaScreen->backOffset; mmesa->readOffset = mmesa->mgaScreen->backOffset; mmesa->setup.dstorg = mgaScreen->backOffset; } else { + /* use front buffer by default */ mmesa->draw_buffer = MGA_FRONT; - mmesa->read_buffer = MGA_FRONT; mmesa->drawOffset = mmesa->mgaScreen->frontOffset; mmesa->readOffset = mmesa->mgaScreen->frontOffset; mmesa->setup.dstorg = mgaScreen->frontOffset; @@ -1042,45 +1134,56 @@ mmesa->setup.maccess |= MA_zwidth_24; break; case 32: - mmesa->setup.maccess |= MA_pwidth_32; + mmesa->setup.maccess |= MA_zwidth_32; break; } + mmesa->hw.blend_func = AC_src_one | AC_dst_zero; + mmesa->hw.blend_func_enable = 0; + mmesa->hw.alpha_func = AC_atmode_noacmp | MGA_FIELD( AC_atref, 0x00 ); + mmesa->hw.alpha_func_enable = 0; + mmesa->hw.rop = mgarop_NoBLK[ GL_COPY & 0x0f ]; + mmesa->hw.zmode = DC_zmode_zlt | DC_atype_zi; + mmesa->hw.stencil = MGA_FIELD( S_sref, 0x00) | MGA_FIELD( S_smsk, 0xff ) | + MGA_FIELD( S_swtmsk, 0xff ); + mmesa->hw.stencilctl = SC_smode_salways | SC_sfailop_keep + | SC_szfailop_keep | SC_szpassop_keep; + mmesa->hw.stencil_enable = 0; + mmesa->hw.cull = _CULL_DISABLE; + mmesa->hw.cull_dualtex = _CULL_DISABLE; + mmesa->hw.specen = 0; + mmesa->hw.alpha_sel = AC_alphasel_diffused; + mmesa->setup.dwgctl = (DC_opcod_trap | - DC_atype_i | DC_linear_xy | - DC_zmode_nozcmp | DC_solid_disable | DC_arzero_disable | DC_sgnzero_disable | DC_shftzero_enable | - (0xC << DC_bop_SHIFT) | - (0x0 << DC_trans_SHIFT) | + MGA_FIELD( DC_bop, 0xC ) | + MGA_FIELD( DC_trans, 0x0 ) | DC_bltmod_bmonolef | DC_pattern_disable | DC_transc_disable | DC_clipdis_disable); - mmesa->setup.plnwt = ~0; - mmesa->setup.alphactrl = ( AC_src_one | - AC_dst_zero | - AC_amode_FCOL | - AC_astipple_disable | - AC_aten_disable | - AC_atmode_noacmp | - AC_alphasel_fromtex ); - - mmesa->setup.fogcolor = - MGAPACKCOLOR888((GLubyte)(ctx->Fog.Color[0]*255.0F), - (GLubyte)(ctx->Fog.Color[1]*255.0F), - (GLubyte)(ctx->Fog.Color[2]*255.0F)); + mmesa->setup.alphactrl = (AC_amode_alpha_channel | + AC_astipple_disable | + AC_aten_disable); + + mmesa->setup.fogcolor = PACK_COLOR_888((GLubyte)(ctx->Fog.Color[0]*255.0F), + (GLubyte)(ctx->Fog.Color[1]*255.0F), + (GLubyte)(ctx->Fog.Color[2]*255.0F)); mmesa->setup.wflag = 0; mmesa->setup.tdualstage0 = 0; mmesa->setup.tdualstage1 = 0; mmesa->setup.fcol = 0; - mmesa->new_state = ~0; + mmesa->dirty |= MGA_UPLOAD_CONTEXT; + + mmesa->envcolor[0] = 0; + mmesa->envcolor[1] = 0; } @@ -1097,12 +1200,12 @@ ctx->Driver.DepthMask = mgaDDDepthMask; ctx->Driver.Fogfv = mgaDDFogfv; ctx->Driver.Scissor = mgaDDScissor; - ctx->Driver.ShadeModel = mgaDDShadeModel; ctx->Driver.CullFace = mgaDDCullFaceFrontFace; ctx->Driver.FrontFace = mgaDDCullFaceFrontFace; ctx->Driver.ColorMask = mgaDDColorMask; - ctx->Driver.SetDrawBuffer = mgaDDSetDrawBuffer; + ctx->Driver.DrawBuffer = mgaDDDrawBuffer; + ctx->Driver.ReadBuffer = mgaDDReadBuffer; ctx->Driver.ClearColor = mgaDDClearColor; ctx->Driver.ClearDepth = mgaDDClearDepth; ctx->Driver.LogicOpcode = mgaDDLogicOp; @@ -1126,4 +1229,6 @@ ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + + TNL_CONTEXT(ctx)->Driver.RunPipeline = mgaRunPipeline; } Index: xc/lib/GL/mesa/src/drv/mga/mgastate.h diff -u xc/lib/GL/mesa/src/drv/mga/mgastate.h:1.5 xc/lib/GL/mesa/src/drv/mga/mgastate.h:1.6 --- xc/lib/GL/mesa/src/drv/mga/mgastate.h:1.5 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgastate.h Sun Sep 28 16:15:17 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.h,v 1.5 2002/10/30 12:51:36 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.h,v 1.6 2003/09/28 20:15:17 alanh Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. @@ -29,14 +29,11 @@ #ifndef _MGA_STATE_H #define _MGA_STATE_H - extern void mgaInitState( mgaContextPtr mmesa ); extern void mgaDDInitStateFuncs(GLcontext *ctx); -extern void mgaDDUpdateHwState( GLcontext *ctx ); extern void mgaUpdateClipping(const GLcontext *ctx); extern void mgaUpdateCull( GLcontext *ctx ); extern void mgaCalcViewport( GLcontext *ctx ); - - +extern void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers ); #endif Index: xc/lib/GL/mesa/src/drv/mga/mgatex.c diff -u xc/lib/GL/mesa/src/drv/mga/mgatex.c:1.14 xc/lib/GL/mesa/src/drv/mga/mgatex.c:1.16 --- xc/lib/GL/mesa/src/drv/mga/mgatex.c:1.14 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgatex.c Tue Dec 2 08:02:38 2003 @@ -24,12 +24,9 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.14 2002/10/30 12:51:36 alanh Exp $ */ - -#include -#include -#include +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.16 2003/12/02 13:02:38 alanh Exp $ */ +#include "glheader.h" #include "mm.h" #include "mgacontext.h" #include "mgatex.h" @@ -37,76 +34,83 @@ #include "mgatris.h" #include "mgaioctl.h" +#include "colormac.h" +#include "context.h" #include "enums.h" #include "simple_list.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "texformat.h" #include "texstore.h" #include "swrast/swrast.h" -#define TEX_0 1 -#define TEX_1 2 - -/* - * mgaDestroyTexObj - * Free all memory associated with a texture and NULL any pointers - * to it. +/** + * Set the texture wrap modes. + * Currently \c GL_REPEAT, \c GL_CLAMP and \c GL_CLAMP_TO_EDGE are supported. + * + * \param t Texture object whose wrap modes are to be set + * \param swrap Wrap mode for the \a s texture coordinate + * \param twrap Wrap mode for the \a t texture coordinate */ -void -mgaDestroyTexObj( mgaContextPtr mmesa, mgaTextureObjectPtr t ) + +static void +mgaSetTexWrapping( mgaTextureObjectPtr t, GLenum swrap, GLenum twrap ) { - if ( !t ) return; + GLboolean is_clamp = GL_FALSE; + GLboolean is_clamp_to_edge = GL_FALSE; - /* free the texture memory */ - if (t->MemBlock) { - mmFreeMem( t->MemBlock ); - t->MemBlock = 0; + t->setup.texctl &= (TMC_clampu_MASK & TMC_clampv_MASK); + t->setup.texctl2 &= (TMC_borderen_MASK); - if (mmesa && t->age > mmesa->dirtyAge) - mmesa->dirtyAge = t->age; + switch( swrap ) { + case GL_REPEAT: + break; + case GL_CLAMP: + t->setup.texctl |= TMC_clampu_enable; + is_clamp = GL_TRUE; + break; + case GL_CLAMP_TO_EDGE: + t->setup.texctl |= TMC_clampu_enable; + is_clamp_to_edge = GL_TRUE; + break; + default: + _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__); } - /* free mesa's link */ - if (t->tObj) - t->tObj->DriverData = NULL; - - /* see if it was the driver's current object */ - if (mmesa) { - if (t->bound & TEX_0) mmesa->CurrentTexObj[0] = 0; - if (t->bound & TEX_1) mmesa->CurrentTexObj[1] = 0; + switch( twrap ) { + case GL_REPEAT: + break; + case GL_CLAMP: + t->setup.texctl |= TMC_clampv_enable; + is_clamp = GL_TRUE; + break; + case GL_CLAMP_TO_EDGE: + t->setup.texctl |= TMC_clampv_enable; + is_clamp_to_edge = GL_TRUE; + break; + default: + _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__); } - - remove_from_list(t); - FREE( t ); -} - - -/* - * mgaSetTexWrappings - */ -static void mgaSetTexWrapping( mgaTextureObjectPtr t, - GLenum sWrap, - GLenum tWrap ) -{ - GLuint val = 0; - if (sWrap != GL_REPEAT) - val |= TMC_clampu_enable; - - if (tWrap != GL_REPEAT) - val |= TMC_clampv_enable; + if ( is_clamp ) { + t->setup.texctl2 |= TMC_borderen_enable; + } - t->setup.texctl &= ~(TMC_clampu_enable|TMC_clampv_enable); - t->setup.texctl |= val; + t->border_fallback = (is_clamp && is_clamp_to_edge); } -/* - * mgaSetTexFilter +/** + * Set the texture magnification and minification modes. + * + * \param t Texture whose filter modes are to be set + * \param minf Texture minification mode + * \param magf Texture magnification mode */ -static void mgaSetTexFilter(mgaTextureObjectPtr t, GLenum minf, GLenum magf) + +static void +mgaSetTexFilter( mgaTextureObjectPtr t, GLenum minf, GLenum magf ) { GLuint val = 0; @@ -129,129 +133,85 @@ /* See OpenGL 1.2 specification */ if (magf == GL_LINEAR && (minf == GL_NEAREST_MIPMAP_NEAREST || minf == GL_NEAREST_MIPMAP_LINEAR)) { - val |= (0x20 << TF_fthres_SHIFT); /* c = 0.5 */ + val |= MGA_FIELD( TF_fthres, 0x20 ); /* c = 0.5 */ } else { - val |= (0x10 << TF_fthres_SHIFT); /* c = 0 */ + val |= MGA_FIELD( TF_fthres, 0x10 ); /* c = 0 */ } - t->setup.texfilter &= (TF_minfilter_MASK | - TF_magfilter_MASK | + /* Mask off the bits for the fields we are setting. Remember, the MGA mask + * defines have 0s for the bits in the named fields. This is the opposite + * of most of the other drivers. + */ + + t->setup.texfilter &= (TF_minfilter_MASK & + TF_magfilter_MASK & TF_fthres_MASK); t->setup.texfilter |= val; } -/* - * mgaSetTexBorderColor - */ static void mgaSetTexBorderColor(mgaTextureObjectPtr t, GLubyte color[4]) { - t->setup.texbordercol = MGAPACKCOLOR8888(color[0],color[1], - color[2],color[3]); + t->setup.texbordercol = PACK_COLOR_8888(color[3], color[0], + color[1], color[2] ); } -static GLint mgaChooseTexFormat( mgaContextPtr mmesa, - struct gl_texture_image *texImage, - GLenum format, GLenum type ) +static const struct gl_texture_format * +mgaChooseTextureFormat( GLcontext *ctx, GLint internalFormat, + GLenum format, GLenum type ) { + mgaContextPtr mmesa = MGA_CONTEXT(ctx); const GLboolean do32bpt = mmesa->default32BitTextures; - const struct gl_texture_format *texFormat; - GLint ret; - if ( 0 ) - fprintf( stderr, "internal=%s format=%s type=%s\n", - texImage->IntFormat == 3 ? "GL_RGB (3)" : - texImage->IntFormat == 4 ? "GL_RGBA (4)" : - _mesa_lookup_enum_by_nr( texImage->IntFormat ), - _mesa_lookup_enum_by_nr( format ), - _mesa_lookup_enum_by_nr( type ) ); - -#define SET_FORMAT( r, gl ) \ - do { \ - ret = (r); \ - texFormat = &(gl); \ - } while (0) - -#define SET_FORMAT_32BPT( r32, gl32, r16, gl16 ) \ - do { \ - if ( do32bpt ) { \ - ret = (r32); \ - texFormat = &(gl32); \ - } else { \ - ret = (r16); \ - texFormat = &(gl16); \ - } \ - } while (0) - - switch ( texImage->IntFormat ) { - /* GH: Bias towards GL_RGB, GL_RGBA texture formats. This has - * got to be better than sticking them way down the end of this - * huge list. - */ + switch ( internalFormat ) { case 4: case GL_RGBA: case GL_COMPRESSED_RGBA: if ( format == GL_BGRA ) { if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) { - SET_FORMAT( TMC_tformat_tw32, _mesa_texformat_argb8888 ); - break; - } else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) { - SET_FORMAT( TMC_tformat_tw12, _mesa_texformat_argb4444 ); - break; - } else if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) { - SET_FORMAT( TMC_tformat_tw15, _mesa_texformat_argb1555 ); - break; + return &_mesa_texformat_argb8888; + } + else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) { + return &_mesa_texformat_argb4444; + } + else if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) { + return &_mesa_texformat_argb1555; } } - SET_FORMAT_32BPT( TMC_tformat_tw32, _mesa_texformat_argb8888, - TMC_tformat_tw12, _mesa_texformat_argb4444 ); - break; + return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; case 3: case GL_RGB: case GL_COMPRESSED_RGB: if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) { - SET_FORMAT( TMC_tformat_tw16, _mesa_texformat_rgb565 ); - break; + return &_mesa_texformat_rgb565; } - SET_FORMAT_32BPT( TMC_tformat_tw32, _mesa_texformat_argb8888, - TMC_tformat_tw16, _mesa_texformat_rgb565 ); - break; + return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; - /* GH: Okay, keep checking as normal. Still test for GL_RGB, - * GL_RGBA formats first. - */ case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - SET_FORMAT_32BPT( TMC_tformat_tw32, _mesa_texformat_argb8888, - TMC_tformat_tw12, _mesa_texformat_argb4444 ); - break; + return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; case GL_RGBA4: case GL_RGBA2: - SET_FORMAT( TMC_tformat_tw12, _mesa_texformat_argb4444 ); - break; + return &_mesa_texformat_argb4444; case GL_RGB5_A1: - SET_FORMAT( TMC_tformat_tw15, _mesa_texformat_argb1555 ); - break; + return &_mesa_texformat_argb1555; case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: - SET_FORMAT_32BPT( TMC_tformat_tw32, _mesa_texformat_argb8888, - TMC_tformat_tw16, _mesa_texformat_rgb565 ); - break; + return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; case GL_RGB5: case GL_RGB4: case GL_R3_G3_B2: - SET_FORMAT( TMC_tformat_tw16, _mesa_texformat_rgb565 ); - break; + return &_mesa_texformat_rgb565; case GL_ALPHA: case GL_ALPHA4: @@ -260,8 +220,7 @@ case GL_ALPHA16: case GL_COMPRESSED_ALPHA: /* FIXME: This will report incorrect component sizes... */ - SET_FORMAT( TMC_tformat_tw12, _mesa_texformat_argb4444 ); - break; + return MGA_IS_G400(mmesa) ? &_mesa_texformat_al88 : &_mesa_texformat_argb4444; case 1: case GL_LUMINANCE: @@ -271,8 +230,7 @@ case GL_LUMINANCE16: case GL_COMPRESSED_LUMINANCE: /* FIXME: This will report incorrect component sizes... */ - SET_FORMAT( TMC_tformat_tw16, _mesa_texformat_rgb565 ); - break; + return MGA_IS_G400(mmesa) ? &_mesa_texformat_al88 : &_mesa_texformat_rgb565; case 2: case GL_LUMINANCE_ALPHA: @@ -284,8 +242,7 @@ case GL_LUMINANCE16_ALPHA16: case GL_COMPRESSED_LUMINANCE_ALPHA: /* FIXME: This will report incorrect component sizes... */ - SET_FORMAT( TMC_tformat_tw12, _mesa_texformat_argb4444 ); - break; + return MGA_IS_G400(mmesa) ? &_mesa_texformat_al88 : &_mesa_texformat_argb4444; case GL_INTENSITY: case GL_INTENSITY4: @@ -294,8 +251,15 @@ case GL_INTENSITY16: case GL_COMPRESSED_INTENSITY: /* FIXME: This will report incorrect component sizes... */ - SET_FORMAT( TMC_tformat_tw12, _mesa_texformat_argb4444 ); - break; + return MGA_IS_G400(mmesa) ? &_mesa_texformat_i8 : &_mesa_texformat_argb4444; + + case GL_YCBCR_MESA: + if (MGA_IS_G400(mmesa) && + (type == GL_UNSIGNED_SHORT_8_8_APPLE || + type == GL_UNSIGNED_BYTE)) + return &_mesa_texformat_ycbcr; + else + return &_mesa_texformat_ycbcr_rev; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: @@ -304,513 +268,71 @@ case GL_COLOR_INDEX8_EXT: case GL_COLOR_INDEX12_EXT: case GL_COLOR_INDEX16_EXT: - SET_FORMAT( TMC_tformat_tw8, _mesa_texformat_ci8 ); - break; + return &_mesa_texformat_ci8; default: - fprintf( stderr, "bad texture format in mgaChooseTexFormat() %d", - texImage->IntFormat ); - return -1; + _mesa_problem( ctx, "unexpected texture format in %s", __FUNCTION__ ); + return NULL; } - texImage->TexFormat = texFormat; - - return ret; + return NULL; /* never get here */ } -/* - * mgaCreateTexObj + + +/** * Allocate space for and load the mesa images into the texture memory block. * This will happen before drawing with a new texture, or drawing with a * texture after it was swapped out or teximaged again. */ -static void mgaCreateTexObj(mgaContextPtr mmesa, - struct gl_texture_object *tObj) -{ - const GLint baseLevel = tObj->BaseLevel; - struct gl_texture_image *image = tObj->Image[baseLevel]; - mgaTextureObjectPtr t; - int i, ofs; - int LastLevel; - int s, s2; - int tformat; - - if (!image) return; - - tObj->DriverData = t = CALLOC( sizeof( *t ) ); - if (!t) { - fprintf(stderr, "mgaCreateTexObj: Failed to malloc mgaTextureObject\n" ); - return; - } - - /* FIXME: Use the real DD interface... - */ - tformat = mgaChooseTexFormat( mmesa, image, image->Format, - GL_UNSIGNED_BYTE ); - t->texelBytes = image->TexFormat->TexelBytes; - - /* We are going to upload all levels that are present, even if - * later levels wouldn't be used by the current filtering mode. This - * allows the filtering mode to change without forcing another upload - * of the images. - */ - LastLevel = MGA_TEX_MAXLEVELS-1; - - ofs = 0; - for ( i = 0 ; i <= LastLevel ; i++ ) { - if ( !tObj->Image[i] ) { - LastLevel = i - 1; - break; - } - - t->offsets[i] = ofs; - t->dirty_images |= (1<Image[i]->Width, 8 ) * - MAX2( tObj->Image[i]->Height, 8 ) * - t->texelBytes) + 31) & ~31; - } - t->totalSize = ofs; - t->lastLevel = LastLevel; - t->tObj = tObj; - t->ctx = mmesa; - t->age = 0; - t->bound = 0; - t->MemBlock = 0; - - insert_at_tail(&(mmesa->SwappedOut), t); - - - /* setup hardware register values */ - t->setup.texctl = TMC_takey_1 | TMC_tamask_0 | tformat; - - if (image->WidthLog2 >= 3) - t->setup.texctl |= ((image->WidthLog2 - 3) << TMC_tpitch_SHIFT); - else - t->setup.texctl |= (TMC_tpitchlin_enable | - (image->Width << TMC_tpitchext_SHIFT)); - - - t->setup.texctl2 = TMC_ckstransdis_enable; - - if ( mmesa->glCtx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR ) - t->setup.texctl2 |= TMC_specen_enable; - - - t->setup.texfilter = (TF_minfilter_nrst | - TF_magfilter_nrst | - TF_filteralpha_enable | - (0x10 << TF_fthres_SHIFT) | - (LastLevel << TF_mapnb_SHIFT)); - - /* warp texture registers */ - ofs = MGA_IS_G200(mmesa) ? 28 : 11; - s = image->Width; - s2 = image->WidthLog2; - t->setup.texwidth = (MGA_FIELD(TW_twmask, s - 1) | - MGA_FIELD(TW_rfw, (10 - s2 - 8) & 63 ) | - MGA_FIELD(TW_tw, (s2 + ofs ) | 0x40 )); - - - s = image->Height; - s2 = image->HeightLog2; - t->setup.texheight = (MGA_FIELD(TH_thmask, s - 1) | - MGA_FIELD(TH_rfh, (10 - s2 - 8) & 63 ) | - MGA_FIELD(TH_th, (s2 + ofs ) | 0x40 )); - - - /* set all the register values for filtering, border, etc */ - mgaSetTexWrapping( t, tObj->WrapS, tObj->WrapT ); - mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); - mgaSetTexBorderColor( t, tObj->BorderColor ); -} - - - - -static void mgaUpdateTextureEnvG200( GLcontext *ctx ) -{ - struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current; - mgaTextureObjectPtr t; - - if (!tObj || !tObj->DriverData) - return; - - t = (mgaTextureObjectPtr)tObj->DriverData; - - t->setup.texctl2 &= ~TMC_decalblend_enable; - - switch (ctx->Texture.Unit[0].EnvMode) { - case GL_REPLACE: - t->setup.texctl &= ~TMC_tmodulate_enable; - break; - case GL_MODULATE: - t->setup.texctl |= TMC_tmodulate_enable; - break; - case GL_DECAL: - t->setup.texctl &= ~TMC_tmodulate_enable; - t->setup.texctl2 |= TMC_decalblend_enable; - break; - case GL_BLEND: - FALLBACK( ctx, MGA_FALLBACK_TEXTURE, GL_TRUE ); - break; - default: - break; - } -} - -static void mgaUpdateTextureEnvG400( GLcontext *ctx, int unit ) -{ - mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit); - GLuint source = mmesa->tmu_source[unit]; - struct gl_texture_object *tObj = ctx->Texture.Unit[source]._Current; - GLenum format; - - if ( tObj != ctx->Texture.Unit[source].Current2D || !tObj ) - return; - - format = tObj->Image[tObj->BaseLevel]->Format; - - switch (ctx->Texture.Unit[source].EnvMode) { - case GL_REPLACE: - if (format == GL_RGB || format == GL_LUMINANCE) { - *reg = (TD0_color_sel_arg1 | - TD0_alpha_arg2_diffuse | - TD0_alpha_sel_arg2 ); - } - else if (format == GL_ALPHA) { - *reg = (TD0_color_sel_arg2 | - TD0_color_arg2_diffuse | - TD0_alpha_sel_arg1 ); - } - else { - *reg = (TD0_color_sel_arg1 | - TD0_alpha_sel_arg1 ); - } - break; - - case GL_MODULATE: - if (unit == 0) { - *reg = ( TD0_color_arg2_diffuse | - TD0_color_sel_mul | - TD0_alpha_arg2_diffuse | - TD0_alpha_sel_mul); - } - else { - *reg = ( TD0_color_arg2_prevstage | - TD0_color_alpha_prevstage | - TD0_color_sel_mul | - TD0_alpha_arg2_prevstage | - TD0_alpha_sel_mul); - } - break; - case GL_DECAL: - if (format == GL_RGB) { - if (unit == 0) { - *reg = (TD0_color_sel_arg1 | - TD0_alpha_arg2_diffuse | - TD0_alpha_sel_arg2 ); - } - else { - *reg = (TD0_color_sel_arg1 | - TD0_alpha_arg2_prevstage | - TD0_alpha_sel_arg2 ); - } - } - else if ( format == GL_RGBA ) { -#if 0 - if (unit == 0) { - /* this doesn't work */ - *reg = (TD0_color_arg2_diffuse | - TD0_color_alpha_currtex | - TD0_color_alpha2inv_enable | - TD0_color_arg2mul_alpha2 | - TD0_color_arg1mul_alpha1 | - TD0_color_blend_enable | - TD0_color_arg1add_mulout | - TD0_color_arg2add_mulout | - TD0_color_add_add | - TD0_color_sel_mul | - TD0_alpha_arg2_diffuse | - TD0_alpha_sel_arg2 ); - } - else { - *reg = (TD0_color_arg2_prevstage | - TD0_color_alpha_currtex | - TD0_color_alpha2inv_enable | - TD0_color_arg2mul_alpha2 | - TD0_color_arg1mul_alpha1 | - TD0_color_add_add | - TD0_color_sel_add | - TD0_alpha_arg2_prevstage | - TD0_alpha_sel_arg2 ); - } -#else - /* s/w fallback, pretty sure we can't do in h/w */ - FALLBACK( ctx, MGA_FALLBACK_TEXTURE, GL_TRUE ); - if ( MGA_DEBUG & DEBUG_VERBOSE_FALLBACK ) - fprintf( stderr, "FALLBACK: GL_DECAL RGBA texture, unit=%d\n", - unit ); -#endif - } - else { - if (unit == 0) { - *reg = ( TD0_color_arg2_diffuse | - TD0_color_sel_arg2 | - TD0_alpha_arg2_diffuse | - TD0_alpha_sel_arg2); - } - else { - *reg = ( TD0_color_arg2_prevstage | - TD0_color_sel_arg2 | - TD0_alpha_arg2_prevstage | - TD0_alpha_sel_arg2); - } - } - break; - - case GL_ADD: - if (unit == 0) { - if (format == GL_INTENSITY) - *reg = ( TD0_color_arg2_diffuse | - TD0_color_add_add | - TD0_color_sel_add | - TD0_alpha_arg2_diffuse | - TD0_alpha_add_enable | - TD0_alpha_sel_add); - else if (format == GL_ALPHA) - *reg = ( TD0_color_arg2_diffuse | - TD0_color_sel_mul | - TD0_alpha_arg2_diffuse | - TD0_alpha_sel_mul); - else - *reg = ( TD0_color_arg2_diffuse | - TD0_color_add_add | - TD0_color_sel_add | - TD0_alpha_arg2_diffuse | - TD0_alpha_sel_mul); - } - else { - if (format == GL_INTENSITY) { - *reg = ( TD0_color_arg2_prevstage | - TD0_color_add_add | - TD0_color_sel_add | - TD0_alpha_arg2_prevstage | - TD0_alpha_add_enable | - TD0_alpha_sel_add); - } - else if (format == GL_ALPHA) { - *reg = ( TD0_color_arg2_prevstage | - TD0_color_sel_mul | - TD0_alpha_arg2_prevstage | - TD0_alpha_sel_mul); - } - else { - *reg = ( TD0_color_arg2_prevstage | - TD0_color_alpha_prevstage | - TD0_color_add_add | - TD0_color_sel_add | - TD0_alpha_arg2_prevstage | - TD0_alpha_sel_mul); - } - } - break; - - case GL_BLEND: - if (format == GL_ALPHA) { - *reg = ( TD0_color_arg2_diffuse | - TD0_color_sel_mul | - TD0_alpha_arg2_diffuse | - TD0_alpha_sel_mul); - } - else { - FALLBACK( ctx, MGA_FALLBACK_TEXTURE, GL_TRUE ); - if ( MGA_DEBUG & DEBUG_VERBOSE_FALLBACK ) - fprintf( stderr, "FALLBACK: GL_BLEND envcolor=0x%08x\n", - mmesa->envcolor ); - - /* Do singletexture GL_BLEND with 'all ones' env-color - * by using both texture units. Multitexture gl_blend - * is a fallback. - */ - if (unit == 0) { - /* Part 1: R1 = Rf ( 1 - Rt ) - * A1 = Af At - */ - *reg = ( TD0_color_arg2_diffuse | - TD0_color_arg1_inv_enable | - TD0_color_sel_mul | - TD0_alpha_arg2_diffuse | - TD0_alpha_sel_arg1); - } else { - /* Part 2: R2 = R1 + Rt - * A2 = A1 - */ - *reg = ( TD0_color_arg2_prevstage | - TD0_color_add_add | - TD0_color_sel_add | - TD0_alpha_arg2_prevstage | - TD0_alpha_sel_arg2); - } - } - break; - default: - break; - } -} - - -static void mgaUpdateTextureObject( GLcontext *ctx, int hw_unit ) +static mgaTextureObjectPtr +mgaAllocTexObj( struct gl_texture_object *tObj ) { mgaTextureObjectPtr t; - struct gl_texture_object *tObj; - GLuint enabled; - mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - GLuint gl_unit = mmesa->tmu_source[hw_unit]; - - - enabled = ctx->Texture.Unit[gl_unit]._ReallyEnabled; - tObj = ctx->Texture.Unit[gl_unit]._Current; - - if (enabled != TEXTURE0_2D) { - if (enabled) - FALLBACK( ctx, MGA_FALLBACK_TEXTURE, GL_TRUE ); - return; - } - - if (tObj->Image[tObj->BaseLevel]->Border > 0) { - FALLBACK( ctx, MGA_FALLBACK_TEXTURE, GL_TRUE ); - if ( MGA_DEBUG & DEBUG_VERBOSE_FALLBACK ) - fprintf( stderr, "FALLBACK: texture border\n" ); - return; - } - - if ( !tObj->DriverData ) { - mgaCreateTexObj( mmesa, tObj ); - if ( !tObj->DriverData ) { - FALLBACK( ctx, MGA_FALLBACK_TEXTURE, GL_TRUE ); - return; - } - } - - t = (mgaTextureObjectPtr)tObj->DriverData; - - if (t->dirty_images) - mmesa->dirty |= (MGA_UPLOAD_TEX0IMAGE << hw_unit); - - mmesa->CurrentTexObj[hw_unit] = t; - t->bound |= hw_unit+1; - -/* if (t->MemBlock) */ -/* mgaUpdateTexLRU( mmesa, t ); */ - - t->setup.texctl2 &= ~TMC_dualtex_enable; - if (ctx->Texture._ReallyEnabled == (TEXTURE0_2D|TEXTURE1_2D)) - t->setup.texctl2 |= TMC_dualtex_enable; - - t->setup.texctl2 &= ~TMC_specen_enable; - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - t->setup.texctl2 |= TMC_specen_enable; -} - - - + t = CALLOC( sizeof( *t ) ); + tObj->DriverData = t; + if ( t != NULL ) { + /* Initialize non-image-dependent parts of the state: + */ + t->base.tObj = tObj; -/* The G400 is now programmed quite differently wrt texture environment. - */ -void mgaUpdateTextureState( GLcontext *ctx ) -{ - mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - FALLBACK( ctx, MGA_FALLBACK_TEXTURE, GL_FALSE ); + t->setup.texctl = TMC_takey_1 | TMC_tamask_0; + t->setup.texctl2 = TMC_ckstransdis_enable; + t->setup.texfilter = TF_filteralpha_enable | TF_uvoffset_OGL; - if (mmesa->CurrentTexObj[0]) { - mmesa->CurrentTexObj[0]->bound = 0; - mmesa->CurrentTexObj[0] = 0; - } + t->border_fallback = GL_FALSE; + t->texenv_fallback = GL_FALSE; - if (mmesa->CurrentTexObj[1]) { - mmesa->CurrentTexObj[1]->bound = 0; - mmesa->CurrentTexObj[1] = 0; - } + make_empty_list( & t->base ); - if (ctx->Texture._ReallyEnabled == TEXTURE1_2D) { - mmesa->tmu_source[0] = 1; - } else { - mmesa->tmu_source[0] = 0; - } - - if (MGA_IS_G400(mmesa)) { - mgaUpdateTextureObject( ctx, 0 ); - mgaUpdateTextureEnvG400( ctx, 0 ); - - mmesa->setup.tdualstage1 = mmesa->setup.tdualstage0; - - if (ctx->Texture._ReallyEnabled == (TEXTURE0_2D|TEXTURE1_2D)) { - mgaUpdateTextureObject( ctx, 1 ); - mgaUpdateTextureEnvG400( ctx, 1 ); - mmesa->dirty |= MGA_UPLOAD_TEX1; - } - } else { - mgaUpdateTextureObject( ctx, 0 ); - mgaUpdateTextureEnvG200( ctx ); + mgaSetTexWrapping( t, tObj->WrapS, tObj->WrapT ); + mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); + mgaSetTexBorderColor( t, tObj->_BorderChan ); } - mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_TEX0; - - mmesa->setup.dwgctl &= DC_opcod_MASK; - mmesa->setup.dwgctl |= (ctx->Texture._ReallyEnabled - ? DC_opcod_texture_trap - : DC_opcod_trap); + return( t ); } - - static void mgaDDTexEnv( GLcontext *ctx, GLenum target, GLenum pname, const GLfloat *param ) { + GLuint unit = ctx->Texture.CurrentUnit; + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; mgaContextPtr mmesa = MGA_CONTEXT(ctx); - - if (pname == GL_TEXTURE_ENV_MODE) { - /* force the texture state to be updated */ - FLUSH_BATCH( MGA_CONTEXT(ctx) ); - MGA_CONTEXT(ctx)->new_state |= (MGA_NEW_TEXTURE | - MGA_NEW_ALPHA); - } - else if (pname == GL_TEXTURE_ENV_COLOR) - { - struct gl_texture_unit *texUnit = - &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - GLfloat *fc = texUnit->EnvColor; + switch( pname ) { + case GL_TEXTURE_ENV_COLOR: { GLubyte c[4]; - GLuint col; - COPY_4V(c, fc); - col = mgaPackColor( mmesa->mgaScreen->cpp, c[0], c[1], c[2], c[3] ); - mmesa->envcolor = (c[3]<<24) | (c[0]<<16) | (c[1]<<8) | (c[2]); - - if (mmesa->setup.fcol != col) { - FLUSH_BATCH(mmesa); - mmesa->setup.fcol = col; - mmesa->dirty |= MGA_UPLOAD_CONTEXT; - - mmesa->blend_flags &= ~MGA_BLEND_ENV_COLOR; - - /* Actually just require all four components to be - * equal. This permits a single-pass GL_BLEND. - * - * More complex multitexture/multipass fallbacks - * for blend can be done later. - */ - if (mmesa->envcolor != 0x0 && mmesa->envcolor != 0xffffffff) - mmesa->blend_flags |= MGA_BLEND_ENV_COLOR; - } + UNCLAMPED_FLOAT_TO_RGBA_CHAN( c, texUnit->EnvColor ); + mmesa->envcolor[unit] = PACK_COLOR_8888( c[3], c[0], c[1], c[2] ); + break; + } } } @@ -823,14 +345,26 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - mgaTextureObjectPtr t = (mgaTextureObjectPtr) texObj->DriverData; - if (t) { - mgaDestroyTexObj( MGA_CONTEXT(ctx), t ); - texObj->DriverData = 0; + driTextureObject * t = (driTextureObject *) texObj->DriverData; + + + if ( t != NULL ) { + driSwapOutTextureObject( t ); + } + else { + t = (driTextureObject *) mgaAllocTexObj( texObj ); + if ( t == NULL ) { + _mesa_error( ctx, GL_OUT_OF_MEMORY, "glTexImage2D" ); + return; + } } + _mesa_store_teximage2d( ctx, target, level, internalFormat, width, height, border, format, type, pixels, packing, texObj, texImage ); + level -= t->firstLevel; + if (level >= 0) + t->dirty_images[0] |= (1UL << level); } static void mgaTexSubImage2D( GLcontext *ctx, @@ -844,44 +378,60 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - mgaTextureObjectPtr t = (mgaTextureObjectPtr) texObj->DriverData; - if (t) { - mgaDestroyTexObj( MGA_CONTEXT(ctx), t ); - texObj->DriverData = 0; + driTextureObject * t = (driTextureObject *) texObj->DriverData; + + + assert( t != NULL ); /* this _should_ be true */ + if ( t != NULL ) { + driSwapOutTextureObject( t ); + } + else { + t = (driTextureObject *) mgaAllocTexObj( texObj ); + if ( t == NULL ) { + _mesa_error( ctx, GL_OUT_OF_MEMORY, "glTexImage2D" ); + return; + } } + _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels, packing, texObj, texImage); - + level -= t->firstLevel; + if (level >= 0) + t->dirty_images[0] |= (1UL << level); } - - -/* - * mgaTexParameter - * This just changes variables and flags for a state update, which - * will happen at the next mgaUpdateTextureState +/** + * Changes variables and flags for a state update, which will happen at the + * next UpdateTextureState */ + static void mgaDDTexParameter( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLenum pname, const GLfloat *params ) { - mgaContextPtr mmesa = MGA_CONTEXT( ctx ); + mgaContextPtr mmesa = MGA_CONTEXT( ctx ); mgaTextureObjectPtr t; t = (mgaTextureObjectPtr) tObj->DriverData; - /* if we don't have a hardware texture, it will be automatically - created with current state before it is used, so we don't have - to do anything now */ - if ( !t || !t->bound || target != GL_TEXTURE_2D ) { + /* If we don't have a hardware texture, it will be automatically + * created with current state before it is used, so we don't have + * to do anything now + */ + + if ( (t == NULL) || + (target != GL_TEXTURE_2D && + target != GL_TEXTURE_RECTANGLE_NV) ) { return; } switch (pname) { case GL_TEXTURE_MIN_FILTER: + driSwapOutTextureObject( (driTextureObject *) t ); + /* FALLTHROUGH */ case GL_TEXTURE_MAG_FILTER: FLUSH_BATCH(mmesa); mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); @@ -895,14 +445,24 @@ case GL_TEXTURE_BORDER_COLOR: FLUSH_BATCH(mmesa); - mgaSetTexBorderColor(t,tObj->BorderColor); + mgaSetTexBorderColor(t, tObj->_BorderChan); + break; + + case GL_TEXTURE_BASE_LEVEL: + case GL_TEXTURE_MAX_LEVEL: + case GL_TEXTURE_MIN_LOD: + case GL_TEXTURE_MAX_LOD: + /* This isn't the most efficient solution but there doesn't appear to + * be a nice alternative. Since there's no LOD clamping, + * we just have to rely on loading the right subset of mipmap levels + * to simulate a clamped LOD. + */ + driSwapOutTextureObject( (driTextureObject *) t ); break; default: return; } - - mmesa->new_state |= MGA_NEW_TEXTURE; } @@ -910,19 +470,12 @@ mgaDDBindTexture( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj ) { - mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - int unit = ctx->Texture.CurrentUnit; - - FLUSH_BATCH(mmesa); - - if (mmesa->CurrentTexObj[unit]) { - mmesa->CurrentTexObj[unit]->bound &= ~(unit+1); - mmesa->CurrentTexObj[unit] = 0; + if ( target == GL_TEXTURE_2D || + target == GL_TEXTURE_RECTANGLE_NV ) { + if ( tObj->DriverData == NULL ) { + mgaAllocTexObj( tObj ); + } } - - /* force the texture state to be updated - */ - MGA_CONTEXT(ctx)->new_state |= MGA_NEW_TEXTURE; } @@ -930,53 +483,50 @@ mgaDDDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) { mgaContextPtr mmesa = MGA_CONTEXT( ctx ); - mgaTextureObjectPtr t = (mgaTextureObjectPtr)tObj->DriverData; + driTextureObject * t = (driTextureObject *) tObj->DriverData; if ( t ) { - if (mmesa) { - if (t->bound) { - FLUSH_BATCH(mmesa); - if (t->bound & TEX_0) mmesa->CurrentTexObj[0] = 0; - if (t->bound & TEX_1) mmesa->CurrentTexObj[1] = 0; - } - mmesa->new_state |= MGA_NEW_TEXTURE; + if ( mmesa ) { + FLUSH_BATCH( mmesa ); } - mgaDestroyTexObj( mmesa, t ); + driDestroyTextureObject( t ); } } -static GLboolean -mgaDDIsTextureResident( GLcontext *ctx, struct gl_texture_object *t ) -{ - mgaTextureObjectPtr mt = (mgaTextureObjectPtr)t->DriverData; - return mt && mt->MemBlock; -} - - void mgaDDInitTextureFuncs( GLcontext *ctx ) { - ctx->Driver.TexEnv = mgaDDTexEnv; + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + - ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; - ctx->Driver.TexImage2D = mgaTexImage2D; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; - ctx->Driver.TexSubImage2D = mgaTexSubImage2D; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - ctx->Driver.BindTexture = mgaDDBindTexture; - ctx->Driver.DeleteTexture = mgaDDDeleteTexture; - ctx->Driver.TexParameter = mgaDDTexParameter; - ctx->Driver.UpdateTexturePalette = 0; - ctx->Driver.IsTextureResident = mgaDDIsTextureResident; + ctx->Driver.ChooseTextureFormat = mgaChooseTextureFormat; + ctx->Driver.TexImage1D = _mesa_store_teximage1d; + ctx->Driver.TexImage2D = mgaTexImage2D; + ctx->Driver.TexImage3D = _mesa_store_teximage3d; + ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; + ctx->Driver.TexSubImage2D = mgaTexSubImage2D; + ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + + ctx->Driver.BindTexture = mgaDDBindTexture; + ctx->Driver.CreateTexture = NULL; /* FIXME: Is this used??? */ + ctx->Driver.DeleteTexture = mgaDDDeleteTexture; + ctx->Driver.IsTextureResident = driIsTextureResident; + ctx->Driver.PrioritizeTexture = NULL; + ctx->Driver.ActiveTexture = NULL; + ctx->Driver.UpdateTexturePalette = NULL; + + ctx->Driver.TexEnv = mgaDDTexEnv; + ctx->Driver.TexParameter = mgaDDTexParameter; + + driInitTextureObjects( ctx, & mmesa->swapped, + (DRI_TEXMGR_DO_TEXTURE_2D | + DRI_TEXMGR_DO_TEXTURE_RECT) ); } Index: xc/lib/GL/mesa/src/drv/mga/mgatex.h diff -u xc/lib/GL/mesa/src/drv/mga/mgatex.h:1.7 xc/lib/GL/mesa/src/drv/mga/mgatex.h:1.8 --- xc/lib/GL/mesa/src/drv/mga/mgatex.h:1.7 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgatex.h Sun Sep 28 16:15:18 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.h,v 1.7 2002/10/30 12:51:36 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.h,v 1.8 2003/09/28 20:15:18 alanh Exp $ */ /* * Copyright 2000-2001 VA Linux Systems, Inc. * All Rights Reserved. @@ -40,23 +40,12 @@ */ void mgaUpdateTextureState( GLcontext *ctx ); -void mgaConvertTexture( GLuint *dest, int texelBytes, - struct gl_texture_image *image, - int x, int y, int width, int height ); - - -void mgaUploadSubImageLocked( mgaContextPtr mmesa, - mgaTextureObjectPtr t, - int level, - int x, int y, int width, int height ); - int mgaUploadTexImages( mgaContextPtr mmesa, mgaTextureObjectPtr t ); void mgaDestroyTexObj( mgaContextPtr mmesa, mgaTextureObjectPtr t ); -void mgaAgeTextures( mgaContextPtr mmesa, int heap ); - void mgaDDInitTextureFuncs( GLcontext *ctx ); +GLboolean mgaUpdateTextureEnvCombine( GLcontext *ctx, int unit ); #endif Index: xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c diff -u xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c:1.3 xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c:removed --- xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c:1.3 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c Sat Feb 28 21:41:15 2004 @@ -1,256 +0,0 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexcnv.c,v 1.3 2002/10/30 12:51:36 alanh Exp $ */ -/* - * Copyright 2000-2001 VA Linux Systems, Inc. - * All Rights Reserved. - * - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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. - * - * Authors: - * Keith Whitwell - */ - -#include -#include - -#include - -#include "mm.h" -#include "mgacontext.h" -#include "mgatex.h" - - -/* - * mgaConvertTexture - * Converts a mesa format texture to the apropriate hardware format - * Note that sometimes width may be larger than the texture, like 64x1 - * for an 8x8 texture. This happens when we have to crutch the pitch - * limits of the mga by uploading a block of texels as a single line. - */ -void mgaConvertTexture( GLuint *destPtr, int texelBytes, - struct gl_texture_image *image, - int x, int y, int width, int height ) -{ - register int i, j; - GLubyte *src; - int stride; - - if (0) - fprintf(stderr, "texture image %p\n", image->Data); - - if (image->Data == 0) - return; - - /* FIXME: g400 luminance_alpha internal format */ - switch (texelBytes) { - case 1: - switch (image->Format) { - case GL_COLOR_INDEX: - case GL_INTENSITY: - case GL_LUMINANCE: - case GL_ALPHA: - src = (GLubyte *)image->Data + ( y * image->Width + x ); - stride = (image->Width - width); - for ( i = height ; i ; i-- ) { - for ( j = width >> 2 ; j ; j-- ) { - - *destPtr++ = src[0] | ( src[1] << 8 ) | ( src[2] << 16 ) | ( src[3] << 24 ); - src += 4; - } - src += stride; - } - break; - default: - goto format_error; - } - break; - case 2: - switch (image->Format) { - case GL_RGB: - src = (GLubyte *)image->Data + ( y * image->Width + x ) * 3; - stride = (image->Width - width) * 3; - for ( i = height ; i ; i-- ) { - for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR565(src[0],src[1],src[2]) | - ( MGAPACKCOLOR565(src[3],src[4],src[5]) << 16 ); - src += 6; - } - src += stride; - } - break; - case GL_RGBA: - src = (GLubyte *)image->Data + ( y * image->Width + x ) * 4; - stride = (image->Width - width) * 4; - for ( i = height ; i ; i-- ) { - for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR4444(src[0],src[1],src[2],src[3]) | - ( MGAPACKCOLOR4444(src[4],src[5],src[6],src[7]) << 16 ); - src += 8; - } - src += stride; - } - break; - case GL_LUMINANCE: - src = (GLubyte *)image->Data + ( y * image->Width + x ); - stride = (image->Width - width); - for ( i = height ; i ; i-- ) { - for ( j = width >> 1 ; j ; j-- ) { - /* FIXME: should probably use 555 texture to get true grey */ - *destPtr++ = MGAPACKCOLOR565(src[0],src[0],src[0]) | - ( MGAPACKCOLOR565(src[1],src[1],src[1]) << 16 ); - src += 2; - } - src += stride; - } - break; - case GL_INTENSITY: - src = (GLubyte *)image->Data + ( y * image->Width + x ); - stride = (image->Width - width); - for ( i = height ; i ; i-- ) { - for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR4444(src[0],src[0],src[0],src[0]) | - ( MGAPACKCOLOR4444(src[1],src[1],src[1],src[1]) << 16 ); - src += 2; - } - src += stride; - } - break; - case GL_ALPHA: - src = (GLubyte *)image->Data + ( y * image->Width + x ); - stride = (image->Width - width); - for ( i = height ; i ; i-- ) { - for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR4444(255,255,255,src[0]) | - ( MGAPACKCOLOR4444(255,255,255,src[1]) << 16 ); - src += 2; - } - src += stride; - } - break; - case GL_LUMINANCE_ALPHA: - src = (GLubyte *)image->Data + ( y * image->Width + x ) * 2; - stride = (image->Width - width) * 2; - for ( i = height ; i ; i-- ) { - for ( j = width >> 1 ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR4444(src[0],src[0],src[0],src[1]) | - ( MGAPACKCOLOR4444(src[2],src[2],src[2],src[3]) << 16 ); - src += 4; - } - src += stride; - } - break; - default: - goto format_error; - } - break; - case 4: - switch (image->Format) { - case GL_RGB: - src = (GLubyte *)image->Data + ( y * image->Width + x ) * 3; - stride = (image->Width - width) * 3; - for ( i = height ; i ; i-- ) { - for ( j = width ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR8888(src[0],src[1],src[2], 255); - src += 3; - } - src += stride; - } - break; - case GL_RGBA: - src = (GLubyte *)image->Data + ( y * image->Width + x ) * 4; - stride = (image->Width - width) * 4; - for ( i = height ; i ; i-- ) { - for ( j = width ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR8888(src[0],src[1],src[2],src[3]); - src += 4; - } - src += stride; - } - break; - case GL_LUMINANCE: - src = (GLubyte *)image->Data + ( y * image->Width + x ); - stride = (image->Width - width); - for ( i = height ; i ; i-- ) { - for ( j = width ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR8888(src[0],src[0],src[0], 255); - src += 1; - } - src += stride; - } - break; - case GL_INTENSITY: - src = (GLubyte *)image->Data + ( y * image->Width + x ); - stride = (image->Width - width); - for ( i = height ; i ; i-- ) { - for ( j = width ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR8888(src[0],src[0],src[0],src[0]); - src += 1; - } - src += stride; - } - break; - case GL_ALPHA: - src = (GLubyte *)image->Data + ( y * image->Width + x ); - stride = (image->Width - width); - for ( i = height ; i ; i-- ) { - for ( j = width ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR8888(255,255,255,src[0]); - src += 1; - } - src += stride; - } - break; - case GL_LUMINANCE_ALPHA: - src = (GLubyte *)image->Data + ( y * image->Width + x ) * 2; - stride = (image->Width - width) * 2; - for ( i = height ; i ; i-- ) { - for ( j = width ; j ; j-- ) { - - *destPtr++ = MGAPACKCOLOR8888(src[0],src[0], - src[0],src[1]); - src += 2; - } - src += stride; - } - break; - default: - goto format_error; - } - break; - default: - goto format_error; - } - - return; - - format_error: - - fprintf(stderr, "Unsupported texelBytes %i, image->Format %i\n", - (int)texelBytes, (int)image->Format ); -} Index: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c diff -u xc/lib/GL/mesa/src/drv/mga/mgatexmem.c:1.7 xc/lib/GL/mesa/src/drv/mga/mgatexmem.c:1.10 --- xc/lib/GL/mesa/src/drv/mga/mgatexmem.c:1.7 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgatexmem.c Thu Jan 22 22:57:05 2004 @@ -24,541 +24,255 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.7 2002/10/30 12:51:36 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.10 2004/01/23 03:57:05 dawes Exp $ */ -#include -#include -#include +#include "glheader.h" #include "mm.h" #include "mgacontext.h" #include "mgatex.h" #include "mgaregs.h" #include "mgaioctl.h" +#include "mga_xmesa.h" -#include "mem.h" +#include "imports.h" #include "simple_list.h" -static void -mgaSwapOutTexObj(mgaContextPtr mmesa, mgaTextureObjectPtr t) -{ - if (t->MemBlock) { - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (t->age > mmesa->dirtyAge) - mmesa->dirtyAge = t->age; - } - - t->dirty_images = ~0; - move_to_tail(&(mmesa->SwappedOut), t); -} - -static void -mgaPrintLocalLRU( mgaContextPtr mmesa, int heap ) -{ - mgaTextureObjectPtr t; - int sz = 1 << (mmesa->mgaScreen->logTextureGranularity[heap]); - - fprintf(stderr, "\nLocal LRU, heap %d:\n", heap); - - foreach( t, &(mmesa->TexObjList[heap]) ) { - if (!t->tObj) - fprintf(stderr, "Placeholder %d at %x sz %x\n", - t->MemBlock->ofs / sz, - t->MemBlock->ofs, - t->MemBlock->size); - else - fprintf(stderr, "Texture (bound %d) at %x sz %x\n", - t->bound, - t->MemBlock->ofs, - t->MemBlock->size); - } - - fprintf(stderr, "\n\n"); -} - -static void -mgaPrintGlobalLRU( mgaContextPtr mmesa, int heap ) +/** + * Destroy any device-dependent state associated with the texture. This may + * include NULLing out hardware state that points to the texture. + */ +void +mgaDestroyTexObj( mgaContextPtr mmesa, mgaTextureObjectPtr t ) { - int i, j; - drmTextureRegion *list = mmesa->sarea->texList[heap]; + unsigned i; - fprintf(stderr, "\nGlobal LRU, heap %d list %p:\n", heap, list); - for (i = 0, j = MGA_NR_TEX_REGIONS ; i < MGA_NR_TEX_REGIONS ; i++) { - fprintf(stderr, "list[%d] age %d next %d prev %d\n", - j, list[j].age, list[j].next, list[j].prev); - j = list[j].next; - if (j == MGA_NR_TEX_REGIONS) break; - } + /* See if it was the driver's current object. + */ - if (j != MGA_NR_TEX_REGIONS) { - fprintf(stderr, "Loop detected in global LRU\n\n\n"); - for (i = 0 ; i < MGA_NR_TEX_REGIONS ; i++) { - fprintf(stderr, "list[%d] age %d next %d prev %d\n", - i, list[i].age, list[i].next, list[i].prev); - } - } + if ( mmesa != NULL ) + { + if ( t->age > mmesa->dirtyAge ) + mmesa->dirtyAge = t->age; - fprintf(stderr, "\n\n"); + for ( i = 0 ; i < mmesa->glCtx->Const.MaxTextureUnits ; i++ ) + { + if ( t == mmesa->CurrentTexObj[ i ] ) { + mmesa->CurrentTexObj[ i ] = NULL; + } + } + } } -static void mgaResetGlobalLRU( mgaContextPtr mmesa, GLuint heap ) +/** + * Upload a texture image from system memory to either on-card or AGP + * memory. Uploads to on-card memory are performed using an ILOAD operation. + * This is used for both initial loading of the entire image, and texSubImage + * updates. + * + * Performed with the hardware lock held. + * + * Even though this function is named "upload subimage," the entire image + * is uploaded. + * + * \param mmesa Driver context. + * \param t Texture to be uploaded. + * \param hwlevel Mipmap level of the texture to be uploaded. + * + * \bug As mentioned above, this fuction actually copies the entier mipmap + * level. There should be a version of this function that performs + * sub-rectangle uploads. This will perform quite a bit better if only + * a small portion of a larger texture has been updated. Care would + * need to be take with such an implementation once glCopyTexImage has + * been hardware accelerated. + */ +static void mgaUploadSubImage( mgaContextPtr mmesa, + mgaTextureObjectPtr t, GLint hwlevel ) { - drmTextureRegion *list = mmesa->sarea->texList[heap]; - int sz = 1 << mmesa->mgaScreen->logTextureGranularity[heap]; - int i; - - mmesa->texAge[heap] = ++mmesa->sarea->texAge[heap]; + struct gl_texture_image * texImage; + unsigned offset; + unsigned texelBytes; + unsigned length; + const int level = hwlevel + t->base.firstLevel; - if (0) fprintf(stderr, "mgaResetGlobalLRU %d\n", (int)heap); - /* (Re)initialize the global circular LRU list. The last element - * in the array (MGA_NR_TEX_REGIONS) is the sentinal. Keeping it - * at the end of the array allows it to be addressed rationally - * when looking up objects at a particular location in texture - * memory. - */ - for (i = 0 ; (i+1) * sz <= mmesa->mgaScreen->textureSize[heap] ; i++) { - list[i].prev = i-1; - list[i].next = i+1; - list[i].age = mmesa->sarea->texAge[heap]; + if ( (hwlevel < 0) + || (hwlevel >= (MGA_IS_G200(mmesa) + ? G200_TEX_MAXLEVELS : G400_TEX_MAXLEVELS)) ) { + fprintf( stderr, "[%s:%d] level = %d\n", __FILE__, __LINE__, level ); + return; } - i--; - list[0].prev = MGA_NR_TEX_REGIONS; - list[i].prev = i-1; - list[i].next = MGA_NR_TEX_REGIONS; - list[MGA_NR_TEX_REGIONS].prev = i; - list[MGA_NR_TEX_REGIONS].next = 0; - -} - - -static void mgaUpdateTexLRU( mgaContextPtr mmesa, mgaTextureObjectPtr t ) -{ - int i; - int heap = t->heap; - int logsz = mmesa->mgaScreen->logTextureGranularity[heap]; - int start = t->MemBlock->ofs >> logsz; - int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz; - drmTextureRegion *list = mmesa->sarea->texList[heap]; - - mmesa->texAge[heap] = ++mmesa->sarea->texAge[heap]; - - if (!t->MemBlock) { - fprintf(stderr, "no memblock\n\n"); + texImage = t->base.tObj->Image[level]; + if ( texImage == NULL ) { + fprintf( stderr, "[%s:%d] Image[%d] = NULL\n", __FILE__, __LINE__, + level ); return; } - /* Update our local LRU - */ - move_to_head( &(mmesa->TexObjList[heap]), t ); - - if (0) - fprintf(stderr, "mgaUpdateTexLRU heap %d list %p\n", heap, list); - - - /* Update the global LRU - */ - for (i = start ; i <= end ; i++) { - - list[i].in_use = 1; - list[i].age = mmesa->texAge[heap]; - - /* remove_from_list(i) - */ - list[(unsigned)list[i].next].prev = list[i].prev; - list[(unsigned)list[i].prev].next = list[i].next; - - /* insert_at_head(list, i) - */ - list[i].prev = MGA_NR_TEX_REGIONS; - list[i].next = list[MGA_NR_TEX_REGIONS].next; - list[(unsigned)list[MGA_NR_TEX_REGIONS].next].prev = i; - list[MGA_NR_TEX_REGIONS].next = i; - } - - if (0) { - mgaPrintGlobalLRU(mmesa, t->heap); - mgaPrintLocalLRU(mmesa, t->heap); + if (texImage->Data == NULL) { + fprintf(stderr, "null texture image data tObj %p level %d\n", + (void *)t->base.tObj, level); + return; } -} - -/* Called for every shared texture region which has increased in age - * since we last held the lock. - * - * Figures out which of our textures have been ejected by other clients, - * and pushes a placeholder texture onto the LRU list to represent - * the other client's textures. - */ -static void mgaTexturesGone( mgaContextPtr mmesa, - GLuint heap, - GLuint offset, - GLuint size, - GLuint in_use ) -{ - mgaTextureObjectPtr t, tmp; - - foreach_s ( t, tmp, &(mmesa->TexObjList[heap]) ) { - - if (t->MemBlock->ofs >= offset + size || - t->MemBlock->ofs + t->MemBlock->size <= offset) - continue; - - - - - /* It overlaps - kick it off. Need to hold onto the currently bound - * objects, however. - */ - if (t->bound) - mgaSwapOutTexObj( mmesa, t ); - else - mgaDestroyTexObj( mmesa, t ); + /* find the proper destination offset for this level */ + if ( MGA_IS_G200(mmesa) ) { + offset = (t->base.memBlock->ofs + t->offsets[hwlevel]); } + else { + unsigned i; - - if (in_use) { - t = (mgaTextureObjectPtr) CALLOC(sizeof(*t)); - if (!t) return; - - t->heap = heap; - t->MemBlock = mmAllocMem( mmesa->texHeap[heap], size, 0, offset); - if (!t->MemBlock) { - fprintf(stderr, "Couldn't alloc placeholder sz %x ofs %x\n", - (int)size, (int)offset); - mmDumpMemInfo( mmesa->texHeap[heap]); - return; + offset = t->base.memBlock->ofs; + for ( i = 0 ; i < hwlevel ; i++ ) { + offset += (t->offsets[1] >> (i * 2)); } - insert_at_head( &(mmesa->TexObjList[heap]), t ); } -} - -void mgaAgeTextures( mgaContextPtr mmesa, int heap ) -{ - MGASAREAPrivPtr sarea = mmesa->sarea; - int sz = 1 << (mmesa->mgaScreen->logTextureGranularity[heap]); - int idx, nr = 0; - /* Have to go right round from the back to ensure stuff ends up - * LRU in our local list... Fix with a cursor pointer. + /* Copy the texture from system memory to a memory space that can be + * directly used by the hardware for texturing. */ - for (idx = sarea->texList[heap][MGA_NR_TEX_REGIONS].prev ; - idx != MGA_NR_TEX_REGIONS && nr < MGA_NR_TEX_REGIONS ; - idx = sarea->texList[heap][idx].prev, nr++) - { - /* If switching texturing schemes, then the SAREA might not - * have been properly cleared, so we need to reset the - * global texture LRU. - */ - if ( idx * sz > mmesa->mgaScreen->textureSize[heap] ) { - nr = MGA_NR_TEX_REGIONS; - break; - } - if (sarea->texList[heap][idx].age > mmesa->texAge[heap]) { - mgaTexturesGone(mmesa, heap, idx * sz, sz, - sarea->texList[heap][idx].in_use); - } - } + texelBytes = texImage->TexFormat->TexelBytes; + length = texImage->Width * texImage->Height * texelBytes; + if ( t->base.heap->heapId == MGA_CARD_HEAP ) { + unsigned tex_offset = 0; + unsigned to_copy; - if (nr == MGA_NR_TEX_REGIONS) { - mgaTexturesGone(mmesa, heap, 0, - mmesa->mgaScreen->textureSize[heap], 0); - mgaResetGlobalLRU( mmesa, heap ); - } - - if (0) { - mgaPrintGlobalLRU( mmesa, heap ); - mgaPrintLocalLRU( mmesa, heap ); - } - - mmesa->texAge[heap] = sarea->texAge[heap]; - mmesa->dirty |= MGA_UPLOAD_TEX0IMAGE | MGA_UPLOAD_TEX1IMAGE; -} - -/* - * mgaUploadSubImageLocked - * - * Perform an iload based update of a resident buffer. This is used for - * both initial loading of the entire image, and texSubImage updates. - * - * Performed with the hardware lock held. - */ -void mgaUploadSubImageLocked( mgaContextPtr mmesa, - mgaTextureObjectPtr t, - int level, - int x, int y, int width, int height ) -{ - int x2; - int dwords; - int offset; - struct gl_texture_image *image; - int texelBytes, texelsPerDword, texelMaccess, length; - - if ( level < 0 || level >= MGA_TEX_MAXLEVELS ) - return; - - image = t->tObj->Image[level]; - if ( !image ) return; - - - if (image->Data == 0) { - fprintf(stderr, "null texture image data tObj %p level %d\n", - t->tObj, level); - return; - } - - - /* find the proper destination offset for this level */ - offset = (t->MemBlock->ofs + - t->offsets[level]); - - - texelBytes = t->texelBytes; - switch( texelBytes ) { - case 1: - texelsPerDword = 4; - texelMaccess = 0; - break; - case 2: - texelsPerDword = 2; - texelMaccess = 1; - break; - case 4: - texelsPerDword = 1; - texelMaccess = 2; - break; - default: - return; - } - - - /* We can't do a subimage update if pitch is < 32 texels due - * to hardware XY addressing limits, so we will need to - * linearly upload all modified rows. - */ - if ( image->Width < 32 ) { - x = 0; - width = image->Width * height; - height = 1; - - /* Assume that 1x1 textures aren't going to cause a - * bus error if we read up to four texels from that - * location: + /* We may not be able to upload the entire texture in one batch due to + * register limits or dma buffer limits. Split the copy up into maximum + * sized chunks. */ -/* if ( width < texelsPerDword ) { */ -/* width = texelsPerDword; */ -/* } */ - } else { - /* pad the size out to dwords. The image is a pointer - to the entire image, so we can safely reference - outside the x,y,width,height bounds if we need to */ - x2 = x + width; - x2 = (x2 + (texelsPerDword-1)) & ~(texelsPerDword-1); - x = (x + (texelsPerDword-1)) & ~(texelsPerDword-1); - width = x2 - x; - } - /* we may not be able to upload the entire texture in one - batch due to register limits or dma buffer limits. - Recursively split it up. */ - while ( 1 ) { - dwords = height * width / texelsPerDword; - if ( dwords * 4 <= MGA_BUFFER_SIZE ) { - break; - } + offset += mmesa->mgaScreen->textureOffset[ t->base.heap->heapId ]; + while ( length != 0 ) { + mgaGetILoadBufferLocked( mmesa ); - mgaUploadSubImageLocked( mmesa, t, level, x, y, - width, height >> 1 ); - y += ( height >> 1 ); - height -= ( height >> 1 ); - } + /* The kernel ILOAD ioctl requires that the lenght be an even multiple + * of MGA_ILOAD_ALIGN. + */ + length = ((length) + MGA_ILOAD_MASK) & ~MGA_ILOAD_MASK; - length = dwords * 4; + to_copy = MIN2( length, MGA_BUFFER_SIZE ); + (void) memcpy( mmesa->iload_buffer->address, + (GLubyte *) texImage->Data + tex_offset, to_copy ); - /* Fill in the secondary buffer with properly converted texels - * from the mesa buffer. */ - /* FIXME: the sync for direct copy reduces speed.. */ - if(t->heap == MGA_CARD_HEAP ) { - mgaGetILoadBufferLocked( mmesa ); - mgaConvertTexture( (GLuint *)mmesa->iload_buffer->address, - texelBytes, image, x, y, width, height ); - if(length < 64) length = 64; - - if (0) - fprintf(stderr, "TexelBytes : %d, offset: %d, length : %d\n", - texelBytes, - mmesa->mgaScreen->textureOffset[t->heap] + - offset + - y * width * 4/texelsPerDword, - length); + if ( MGA_DEBUG & DEBUG_VERBOSE_TEXTURE ) + fprintf(stderr, "[%s:%d] address/size = 0x%08lx/%d\n", + __FILE__, __LINE__, + (long) (offset + tex_offset), + to_copy ); - mgaFireILoadLocked( mmesa, - mmesa->mgaScreen->textureOffset[t->heap] + - offset + - y * width * 4/texelsPerDword, - length); + mgaFireILoadLocked( mmesa, offset + tex_offset, to_copy ); + tex_offset += to_copy; + length -= to_copy; + } } else { + /* FIXME: the sync for direct copy reduces speed.. */ /* This works, is slower for uploads to card space and needs * additional synchronization with the dma stream. */ UPDATE_LOCK(mmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT); - mgaConvertTexture( (GLuint *) - (mmesa->mgaScreen->texVirtual[t->heap] + - offset + - y * width * 4/texelsPerDword), - texelBytes, image, x, y, width, height ); - } -} - - -static void mgaUploadTexLevel( mgaContextPtr mmesa, - mgaTextureObjectPtr t, - int l ) -{ - mgaUploadSubImageLocked( mmesa, - t, - l, - 0, 0, - t->tObj->Image[l]->Width, - t->tObj->Image[l]->Height); -} - - - -#if 0 -static void mgaMigrateTexture( mgaContextPtr mmesa, mgaTextureObjectPtr t ) -{ - /* NOT DONE */ -} -#endif - - -static int mgaChooseTexHeap( mgaContextPtr mmesa, mgaTextureObjectPtr t ) -{ - int freeagp, freecard; - int fitincard, fitinagp; - int totalcard, totalagp; - TMemBlock *b; - - totalcard = totalagp = fitincard = fitinagp = freeagp = freecard = 0; - - b = mmesa->texHeap[0]; - while(b) - { - totalcard += b->size; - if(b->free) if(t->totalSize <= b->size)fitincard = 1; - b = b->next; - } - - b = mmesa->texHeap[1]; - while(b) - { - totalagp += b->size; - if(b->free) if(t->totalSize <= b->size)fitinagp = 1; - b = b->next; - } + memcpy( mmesa->mgaScreen->texVirtual[t->base.heap->heapId] + offset, + texImage->Data, length ); - if(fitincard)return 0; - if(fitinagp)return 1; - - if(totalcard && totalagp) - { - int ages; - int ratio = (totalcard > totalagp) ? totalcard / totalagp : totalagp / totalcard; - ages = mmesa->sarea->texAge[0] + mmesa->sarea->texAge[1]; - if( (ages % ratio) == 0)return totalcard > totalagp ? 1 : 0; - else return totalcard > totalagp ? 0 : 1; + if ( MGA_DEBUG & DEBUG_VERBOSE_TEXTURE ) + fprintf(stderr, "[%s:%d] address/size = 0x%08lx/%d\n", + __FILE__, __LINE__, + (long) (mmesa->mgaScreen->texVirtual[t->base.heap->heapId] + + offset), + length); } - - if(totalagp) return 1; - return 0; } +/** + * Upload the texture images associated with texture \a t. This might + * require the allocation of texture memory. + * + * \param mmesa Context pointer + * \param t Texture to be uploaded + */ + int mgaUploadTexImages( mgaContextPtr mmesa, mgaTextureObjectPtr t ) { - int heap; int i; int ofs; - heap = t->heap = mgaChooseTexHeap( mmesa, t ); - /* Do we need to eject LRU texture objects? - */ - if (!t->MemBlock) { - while (1) - { - mgaTextureObjectPtr tmp = mmesa->TexObjList[heap].prev; - - t->MemBlock = mmAllocMem( mmesa->texHeap[heap], - t->totalSize, - 6, 0 ); - if (t->MemBlock) - break; - - if (mmesa->TexObjList[heap].prev->bound) { - fprintf(stderr, "Hit bound texture in upload\n"); - return -1; - } + if ( (t == NULL) || (t->base.totalSize == 0) ) + return 0; - if (mmesa->TexObjList[heap].prev == - &(mmesa->TexObjList[heap])) - { - fprintf(stderr, "Failed to upload texture, sz %d\n", t->totalSize); - mmDumpMemInfo( mmesa->texHeap[heap] ); - return -1; - } + LOCK_HARDWARE( mmesa ); - mgaDestroyTexObj( mmesa, tmp ); - } + if (t->base.memBlock == NULL ) { + int heap; - ofs = t->MemBlock->ofs - + mmesa->mgaScreen->textureOffset[heap] - ; - - t->setup.texorg = ofs; - t->setup.texorg1 = ofs + t->offsets[1]; - t->setup.texorg2 = ofs + t->offsets[2]; - t->setup.texorg3 = ofs + t->offsets[3]; - t->setup.texorg4 = ofs + t->offsets[4]; + heap = driAllocateTexture( mmesa->texture_heaps, mmesa->nr_heaps, + (driTextureObject *) t ); + if ( heap == -1 ) { + UNLOCK_HARDWARE( mmesa ); + return -1; + } + + ofs = mmesa->mgaScreen->textureOffset[ heap ] + + t->base.memBlock->ofs; + + if ( MGA_IS_G200(mmesa) ) { + t->setup.texorg = ofs; + t->setup.texorg1 = ofs + t->offsets[1]; + t->setup.texorg2 = ofs + t->offsets[2]; + t->setup.texorg3 = ofs + t->offsets[3]; + t->setup.texorg4 = ofs + t->offsets[4]; + } + else { + t->setup.texorg = ofs | TO_texorgoffsetsel; + t->setup.texorg1 = t->offsets[1]; + t->setup.texorg2 = 0; + t->setup.texorg3 = 0; + t->setup.texorg4 = 0; + } mmesa->dirty |= MGA_UPLOAD_CONTEXT; } /* Let the world know we've used this memory recently. */ - mgaUpdateTexLRU( mmesa, t ); - + driUpdateTextureLRU( (driTextureObject *) t ); - if (MGA_DEBUG&DEBUG_VERBOSE_LRU) - fprintf(stderr, "dispatch age: %d age freed memory: %d\n", + if (MGA_DEBUG&DEBUG_VERBOSE_TEXTURE) + fprintf(stderr, "[%s:%d] dispatch age: %d age freed memory: %d\n", + __FILE__, __LINE__, GET_DISPATCH_AGE(mmesa), mmesa->dirtyAge); if (mmesa->dirtyAge >= GET_DISPATCH_AGE(mmesa)) mgaWaitAgeLocked( mmesa, mmesa->dirtyAge ); - if (t->dirty_images) { - if (MGA_DEBUG&DEBUG_VERBOSE_LRU) - fprintf(stderr, "*"); - - for (i = 0 ; i <= t->lastLevel ; i++) - if (t->dirty_images & (1<base.dirty_images[0]) { + const int numLevels = t->base.lastLevel - t->base.firstLevel + 1; + + if (MGA_DEBUG&DEBUG_VERBOSE_TEXTURE) + fprintf(stderr, "[%s:%d] dirty_images[0] = 0x%04x\n", + __FILE__, __LINE__, t->base.dirty_images[0] ); + + for (i = 0 ; i < numLevels ; i++) { + if ( (t->base.dirty_images[0] & (1U << i)) != 0 ) { + mgaUploadSubImage( mmesa, t, i ); + } + } + t->base.dirty_images[0] = 0; } - t->dirty_images = 0; + UNLOCK_HARDWARE( mmesa ); + return 0; } Index: xc/lib/GL/mesa/src/drv/mga/mgatris.c diff -u xc/lib/GL/mesa/src/drv/mga/mgatris.c:1.10 xc/lib/GL/mesa/src/drv/mga/mgatris.c:1.12 --- xc/lib/GL/mesa/src/drv/mga/mgatris.c:1.10 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgatris.c Tue Dec 2 08:02:38 2003 @@ -24,10 +24,7 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.10 2002/10/30 12:51:36 alanh Exp $ */ - -#include -#include +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.12 2003/12/02 13:02:38 alanh Exp $ */ #include "mtypes.h" #include "macros.h" @@ -676,31 +673,21 @@ /**********************************************************************/ - -#define _MGA_NEW_RENDERSTATE (_DD_NEW_LINE_STIPPLE | \ - _DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE | \ - _DD_NEW_TRI_OFFSET | \ - _DD_NEW_TRI_STIPPLE | \ - _NEW_POLYGONSTIPPLE) - - #define POINT_FALLBACK (DD_POINT_SMOOTH) #define LINE_FALLBACK (DD_LINE_SMOOTH | DD_LINE_STIPPLE) #define TRI_FALLBACK (DD_TRI_SMOOTH | DD_TRI_UNFILLED) -#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK| \ - DD_TRI_STIPPLE) +#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK) #define ANY_RASTER_FLAGS (DD_FLATSHADE|DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET| \ DD_TRI_UNFILLED) -static void mgaChooseRenderState(GLcontext *ctx) +void mgaChooseRenderState(GLcontext *ctx) { TNLcontext *tnl = TNL_CONTEXT(ctx); mgaContextPtr mmesa = MGA_CONTEXT(ctx); GLuint flags = ctx->_TriangleCaps; GLuint index = 0; - if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) { + if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS|DD_TRI_STIPPLE)) { if (flags & ANY_RASTER_FLAGS) { if (flags & DD_TRI_LIGHT_TWOSIDE) index |= MGA_TWOSIDE_BIT; if (flags & DD_TRI_OFFSET) index |= MGA_OFFSET_BIT; @@ -725,9 +712,11 @@ if (flags & TRI_FALLBACK) mmesa->draw_tri = mga_fallback_tri; - if ((flags & DD_TRI_STIPPLE) && !mmesa->haveHwStipple) - mmesa->draw_tri = mga_fallback_tri; - + index |= MGA_FALLBACK_BIT; + } + + if ((flags & DD_TRI_STIPPLE) && !mmesa->haveHwStipple) { + mmesa->draw_tri = mga_fallback_tri; index |= MGA_FALLBACK_BIT; } } @@ -759,36 +748,6 @@ /**********************************************************************/ -static void mgaRunPipeline( GLcontext *ctx ) -{ - mgaContextPtr mmesa = MGA_CONTEXT(ctx); - - if (mmesa->new_state) { - mgaDDUpdateHwState( ctx ); - } - - if (!mmesa->Fallback && mmesa->new_gl_state) { - if (mmesa->new_gl_state & _MGA_NEW_RASTERSETUP) - mgaChooseVertexState( ctx ); - - if (mmesa->new_gl_state & _MGA_NEW_RENDERSTATE) - mgaChooseRenderState( ctx ); - - mmesa->new_gl_state = 0; - - /* Circularity: mgaDDUpdateHwState can affect mmesa->Fallback, - * but mgaChooseVertexState can affect mmesa->new_state. Hence - * the second check. (Fix this...) - */ - if (mmesa->new_state) { - mgaDDUpdateHwState( ctx ); - } - } - - _tnl_run_pipeline( ctx ); -} - - static GLenum reduced_prim[GL_POLYGON+1] = { GL_POINTS, GL_LINES, @@ -812,18 +771,21 @@ mgaContextPtr mmesa = MGA_CONTEXT( ctx ); FLUSH_BATCH( mmesa ); + + /* Update culling */ + if (mmesa->raster_primitive != prim) + mmesa->dirty |= MGA_UPLOAD_CONTEXT; + mmesa->raster_primitive = prim; /* mmesa->hw_primitive = hwprim; */ mmesa->hw_primitive = MGA_WA_TRIANGLES; /* disable mgarender.c for now */ - mgaUpdateCull(ctx); if (ctx->Polygon.StippleFlag && mmesa->haveHwStipple) { mmesa->dirty |= MGA_UPLOAD_CONTEXT; + mmesa->setup.dwgctl &= ~(0xf<<20); if (mmesa->raster_primitive == GL_TRIANGLES) mmesa->setup.dwgctl |= mmesa->poly_stipple; - else - mmesa->setup.dwgctl &= ~(0xf<<20); } } @@ -864,6 +826,28 @@ /* Manage total rasterization fallbacks */ /**********************************************************************/ +static const char * const fallbackStrings[] = { + "Texture mode", + "glDrawBuffer(GL_FRONT_AND_BACK)", + "read buffer", + "glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ZERO)", + "glRenderMode(selection or feedback)", + "No hardware stencil", + "glDepthFunc( GL_NEVER )", + "Mixing GL_CLAMP_TO_EDGE and GL_CLAMP" +}; + +static const char *getFallbackString(GLuint bit) +{ + int i = 0; + while (bit > 1) { + i++; + bit >>= 1; + } + return fallbackStrings[i]; +} + + void mgaFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) { TNLcontext *tnl = TNL_CONTEXT(ctx); @@ -876,6 +860,10 @@ FLUSH_BATCH(mmesa); _swsetup_Wakeup( ctx ); mmesa->RenderIndex = ~0; + if (MGA_DEBUG & DEBUG_VERBOSE_FALLBACK) { + fprintf(stderr, "MGA begin rasterization fallback: 0x%x %s\n", + bit, getFallbackString(bit)); + } } } else { @@ -886,8 +874,12 @@ tnl->Driver.Render.PrimitiveNotify = mgaRenderPrimitive; tnl->Driver.Render.Finish = mgaRenderFinish; tnl->Driver.Render.BuildVertices = mgaBuildVertices; - mmesa->new_gl_state |= (_MGA_NEW_RENDERSTATE | - _MGA_NEW_RASTERSETUP); + mmesa->NewGLState |= (_MGA_NEW_RENDERSTATE | + _MGA_NEW_RASTERSETUP); + if (MGA_DEBUG & DEBUG_VERBOSE_FALLBACK) { + fprintf(stderr, "MGA end rasterization fallback: 0x%x %s\n", + bit, getFallbackString(bit)); + } } } } @@ -905,7 +897,6 @@ mmesa->RenderIndex = ~0; - tnl->Driver.RunPipeline = mgaRunPipeline; tnl->Driver.Render.Start = mgaCheckTexSizes; tnl->Driver.Render.Finish = mgaRenderFinish; tnl->Driver.Render.PrimitiveNotify = mgaRenderPrimitive; Index: xc/lib/GL/mesa/src/drv/mga/mgatris.h diff -u xc/lib/GL/mesa/src/drv/mga/mgatris.h:1.10 xc/lib/GL/mesa/src/drv/mga/mgatris.h:1.12 --- xc/lib/GL/mesa/src/drv/mga/mgatris.h:1.10 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgatris.h Tue Dec 2 08:02:38 2003 @@ -24,7 +24,7 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.h,v 1.10 2002/10/30 12:51:36 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.h,v 1.12 2003/12/02 13:02:38 alanh Exp $ */ #ifndef MGATRIS_INC #define MGATRIS_INC @@ -32,12 +32,21 @@ #include "mtypes.h" extern void mgaDDInitTriFuncs( GLcontext *ctx ); - +extern void mgaChooseRenderState( GLcontext *ctx ); extern void mgaRasterPrimitive( GLcontext *ctx, GLenum prim, GLuint hwprim ); extern void mgaFallback( GLcontext *ctx, GLuint bit, GLboolean mode ); #define FALLBACK( ctx, bit, mode ) mgaFallback( ctx, bit, mode ) - +#define _MGA_NEW_RENDERSTATE (_DD_NEW_POINT_SMOOTH | \ + _DD_NEW_LINE_SMOOTH | \ + _DD_NEW_LINE_STIPPLE | \ + _DD_NEW_TRI_SMOOTH | \ + _DD_NEW_FLATSHADE | \ + _DD_NEW_TRI_LIGHT_TWOSIDE | \ + _DD_NEW_TRI_OFFSET | \ + _DD_NEW_TRI_UNFILLED | \ + _DD_NEW_TRI_STIPPLE | \ + _NEW_POLYGONSTIPPLE) #endif Index: xc/lib/GL/mesa/src/drv/mga/mgavb.c diff -u xc/lib/GL/mesa/src/drv/mga/mgavb.c:1.14 xc/lib/GL/mesa/src/drv/mga/mgavb.c:1.17 --- xc/lib/GL/mesa/src/drv/mga/mgavb.c:1.14 Wed Oct 30 07:51:36 2002 +++ xc/lib/GL/mesa/src/drv/mga/mgavb.c Tue Dec 2 08:02:38 2003 @@ -24,7 +24,7 @@ * Authors: * Keith Whitwell */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.14 2002/10/30 12:51:36 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgavb.c,v 1.17 2003/12/02 13:02:38 alanh Exp $ */ #include "mgacontext.h" #include "mgavb.h" @@ -34,18 +34,14 @@ #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "colormac.h" -#include "mmath.h" #include "tnl/t_context.h" #include "swrast_setup/swrast_setup.h" #include "swrast/swrast.h" -#include -#include - #define MGA_TEX1_BIT 0x1 #define MGA_TEX0_BIT 0x2 @@ -125,8 +121,8 @@ #define IMPORT_FLOAT_COLORS mga_import_float_colors #define IMPORT_FLOAT_SPEC_COLORS mga_import_float_spec_colors -#define INTERP_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].interp -#define COPY_PV_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].copy_pv +#define INTERP_VERTEX setup_tab[mmesa->SetupIndex].interp +#define COPY_PV_VERTEX setup_tab[mmesa->SetupIndex].copy_pv /*********************************************************************** @@ -344,6 +340,9 @@ tnl->Driver.Render.Interp = setup_tab[mmesa->SetupIndex].interp; tnl->Driver.Render.CopyPV = setup_tab[mmesa->SetupIndex].copy_pv; } + if (mmesa->Fallback) { + tnl->Driver.Render.Start(ctx); + } } } @@ -363,24 +362,24 @@ if (!newinputs) return; - if (newinputs & VERT_CLIP) { + if (newinputs & VERT_BIT_CLIP) { setup_tab[mmesa->SetupIndex].emit( ctx, start, count, v, stride ); } else { GLuint ind = 0; - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) ind |= MGA_RGBA_BIT; - if (newinputs & VERT_SPEC_RGB) + if (newinputs & VERT_BIT_COLOR1) ind |= MGA_SPEC_BIT; - if (newinputs & VERT_TEX0) + if (newinputs & VERT_BIT_TEX0) ind |= MGA_TEX0_BIT; - if (newinputs & VERT_TEX1) + if (newinputs & VERT_BIT_TEX1) ind |= MGA_TEX0_BIT|MGA_TEX1_BIT; - if (newinputs & VERT_FOG_COORD) + if (newinputs & VERT_BIT_FOG) ind |= MGA_FOG_BIT; if (mmesa->SetupIndex & MGA_PTEX_BIT) @@ -407,15 +406,18 @@ if (ctx->Fog.Enabled) ind |= MGA_FOG_BIT; - if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY) { - if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) { + if (ctx->Texture._EnabledUnits & 0x2) { + /* unit 1 enabled */ + if (ctx->Texture._EnabledUnits & 0x1) { + /* unit 0 enabled */ ind |= MGA_TEX1_BIT|MGA_TEX0_BIT; } else { ind |= MGA_TEX0_BIT; } } - else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) { + else if (ctx->Texture._EnabledUnits & 0x1) { + /* unit 0 enabled */ ind |= MGA_TEX0_BIT; } @@ -431,7 +433,6 @@ if (setup_tab[ind].vertex_format != mmesa->vertex_format) { FLUSH_BATCH(mmesa); - mmesa->new_state |= MGA_NEW_WARP; mmesa->dirty |= MGA_UPLOAD_PIPE; mmesa->vertex_format = setup_tab[ind].vertex_format; mmesa->vertex_size = setup_tab[ind].vertex_size; @@ -468,7 +469,6 @@ } } - mmesa->new_state |= MGA_NEW_WARP; mmesa->dirty |= MGA_UPLOAD_PIPE; mmesa->vertex_format = setup_tab[0].vertex_format; mmesa->vertex_size = setup_tab[0].vertex_size; Index: xc/lib/GL/mesa/src/drv/r128/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/r128/Imakefile.inc:1.4 xc/lib/GL/mesa/src/drv/r128/Imakefile.inc:1.5 --- xc/lib/GL/mesa/src/drv/r128/Imakefile.inc:1.4 Fri Feb 22 16:44:57 2002 +++ xc/lib/GL/mesa/src/drv/r128/Imakefile.inc Tue May 27 12:34:33 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile.inc,v 1.4 2002/02/22 21:44:57 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile.inc,v 1.5 2003/05/27 16:34:33 tsi Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=ByteOrder + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ Index: xc/lib/GL/mesa/src/drv/r128/r128_context.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_context.c:1.8 xc/lib/GL/mesa/src/drv/r128/r128_context.c:1.10 --- xc/lib/GL/mesa/src/drv/r128/r128_context.c:1.8 Wed Oct 30 07:51:38 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_context.c Mon Dec 8 17:45:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.c,v 1.8 2002/10/30 12:51:38 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.c,v 1.10 2003/12/08 22:45:30 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -33,7 +33,19 @@ * */ -#include +#include "glheader.h" +#include "context.h" +#include "simple_list.h" +#include "imports.h" +#include "matrix.h" +#include "extensions.h" + +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "array_cache/acache.h" + +#include "tnl/tnl.h" +#include "tnl/t_pipeline.h" #include "r128_context.h" #include "r128_ioctl.h" @@ -44,34 +56,41 @@ #include "r128_tris.h" #include "r128_vb.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "array_cache/acache.h" - -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - -#include "context.h" -#include "simple_list.h" -#include "mem.h" -#include "matrix.h" +#include "vblank.h" +#include "utils.h" +#include "texmem.h" #ifndef R128_DEBUG -int R128_DEBUG = (0 -/* | DEBUG_ALWAYS_SYNC */ -/* | DEBUG_VERBOSE_API */ -/* | DEBUG_VERBOSE_MSG */ -/* | DEBUG_VERBOSE_LRU */ -/* | DEBUG_VERBOSE_DRI */ -/* | DEBUG_VERBOSE_IOCTL */ -/* | DEBUG_VERBOSE_2D */ - ); +int R128_DEBUG = 0; #endif +static const char * const card_extensions[] = +{ + "GL_ARB_multitexture", + "GL_ARB_texture_env_add", + "GL_ARB_texture_mirrored_repeat", + "GL_EXT_texture_edge_clamp", + "GL_EXT_texture_env_add", + "GL_IBM_texture_mirrored_repeat", + "GL_SGIS_generate_mipmap", + "GL_SGIS_texture_edge_clamp", + NULL +}; + +static const struct dri_debug_control debug_control[] = +{ + { "ioctl", DEBUG_VERBOSE_IOCTL }, + { "verb", DEBUG_VERBOSE_MSG }, + { "dri", DEBUG_VERBOSE_DRI }, + { "2d", DEBUG_VERBOSE_2D }, + { "sync", DEBUG_ALWAYS_SYNC }, + { "api", DEBUG_VERBOSE_API }, + { NULL, 0 } +}; + /* Create the device specific context. */ -GLboolean r128CreateContext( Display *dpy, const __GLcontextModes *glVisual, +GLboolean r128CreateContext( const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate ) { @@ -91,7 +110,7 @@ shareCtx = ((r128ContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, rmesa, GL_TRUE); + rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) rmesa, GL_TRUE); if (!rmesa->glCtx) { FREE(rmesa); return GL_FALSE; @@ -99,7 +118,6 @@ driContextPriv->driverPrivate = rmesa; ctx = rmesa->glCtx; - rmesa->display = dpy; rmesa->driContext = driContextPriv; rmesa->driScreen = sPriv; rmesa->driDrawable = NULL; @@ -115,34 +133,48 @@ rmesa->CurrentTexObj[0] = NULL; rmesa->CurrentTexObj[1] = NULL; - make_empty_list( &rmesa->SwappedOut ); + (void) memset( rmesa->texture_heaps, 0, sizeof( rmesa->texture_heaps ) ); + make_empty_list( & rmesa->swapped ); + + rmesa->nr_heaps = r128scrn->numTexHeaps; + for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { + rmesa->texture_heaps[i] = driCreateTextureHeap( i, rmesa, + r128scrn->texSize[i], + 12, + R128_NR_TEX_REGIONS, + rmesa->sarea->texList[i], + & rmesa->sarea->texAge[i], + & rmesa->swapped, + sizeof( r128TexObj ), + (destroy_texture_object_t *) r128DestroyTexObj ); - for ( i = 0 ; i < r128scrn->numTexHeaps ; i++ ) { - make_empty_list( &rmesa->TexObjList[i] ); - rmesa->texHeap[i] = mmInit( 0, r128scrn->texSize[i] ); - rmesa->lastTexAge[i] = -1; + driSetTextureSwapCounterLocation( rmesa->texture_heaps[i], + & rmesa->c_textureSwaps ); } - rmesa->lastTexHeap = r128scrn->numTexHeaps; + rmesa->RenderIndex = -1; /* Impossible value */ rmesa->vert_buf = NULL; rmesa->num_verts = 0; - /* KW: Set the maximum texture size small enough that we can - * guarentee that both texture units can bind a maximal texture - * and have them both in on-card memory at once. (Kevin or - * Gareth: Please check these numbers are OK) + /* Set the maximum texture size small enough that we can guarentee that + * all texture units can bind a maximal texture and have them both in + * texturable memory at once. */ - if ( r128scrn->texSize[0] < 2*1024*1024 ) { - ctx->Const.MaxTextureLevels = 9; - } else if ( r128scrn->texSize[0] < 8*1024*1024 ) { - ctx->Const.MaxTextureLevels = 10; - } else { - ctx->Const.MaxTextureLevels = 11; - } ctx->Const.MaxTextureUnits = 2; + driCalculateMaxTextureLevels( rmesa->texture_heaps, + rmesa->nr_heaps, + & ctx->Const, + 4, + 10, /* max 2D texture size is 1024x1024 */ + 0, /* 3D textures unsupported. */ + 0, /* cube textures unsupported. */ + 0, /* texture rectangles unsupported. */ + 11, + GL_FALSE ); + /* No wide points. */ ctx->Const.MinPointSize = 1.0; @@ -159,11 +191,7 @@ ctx->Const.LineWidthGranularity = 1.0; #if ENABLE_PERF_BOXES - if ( getenv( "LIBGL_PERFORMANCE_BOXES" ) ) { - rmesa->boxes = 1; - } else { - rmesa->boxes = 0; - } + rmesa->boxes = (getenv( "LIBGL_PERFORMANCE_BOXES" ) != NULL); #endif /* Initialize the software rasterizer and helper modules. @@ -183,9 +211,12 @@ _swrast_allow_pixel_fog( ctx, GL_FALSE ); _swrast_allow_vertex_fog( ctx, GL_TRUE ); + driInitExtensions( ctx, card_extensions, GL_TRUE ); + if (sPriv->drmMinor >= 4) + _mesa_enable_extension( ctx, "GL_MESA_ycbcr_texture" ); + r128InitVB( ctx ); r128InitTriFuncs( ctx ); - r128DDInitExtensions( ctx ); r128DDInitDriverFuncs( ctx ); r128DDInitIoctlFuncs( ctx ); r128DDInitStateFuncs( ctx ); @@ -193,8 +224,18 @@ r128DDInitTextureFuncs( ctx ); r128DDInitState( rmesa ); + rmesa->do_irqs = (rmesa->r128Screen->irq && !getenv("R128_NO_IRQS")); + + rmesa->vblank_flags = (rmesa->r128Screen->irq != 0) + ? driGetDefaultVBlankFlags() : VBLANK_FLAG_NO_IRQ; + driContextPriv->driverPrivate = (void *)rmesa; +#if DO_DEBUG + R128_DEBUG = driParseDebugString( getenv( "R128_DEBUG" ), + debug_control ); +#endif + return GL_TRUE; } @@ -206,25 +247,10 @@ assert(rmesa); /* should never be null */ if ( rmesa ) { - if (rmesa->glCtx->Shared->RefCount == 1) { - /* This share group is about to go away, free our private - * texture object data. - */ - r128TexObjPtr t, next_t; - int i; + GLboolean release_texture_heaps; - for ( i = 0 ; i < rmesa->r128Screen->numTexHeaps ; i++ ) { - foreach_s ( t, next_t, &rmesa->TexObjList[i] ) { - r128DestroyTexObj( rmesa, t ); - } - mmDestroy( rmesa->texHeap[i] ); - rmesa->texHeap[i] = NULL; - } - foreach_s ( t, next_t, &rmesa->SwappedOut ) { - r128DestroyTexObj( rmesa, t ); - } - } + release_texture_heaps = (rmesa->glCtx->Shared->RefCount == 1); _swsetup_DestroyContext( rmesa->glCtx ); _tnl_DestroyContext( rmesa->glCtx ); @@ -237,6 +263,20 @@ rmesa->glCtx->DriverCtx = NULL; _mesa_destroy_context(rmesa->glCtx); + if ( release_texture_heaps ) { + /* This share group is about to go away, free our private + * texture object data. + */ + int i; + + for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { + driDestroyTextureHeap( rmesa->texture_heaps[ i ] ); + rmesa->texture_heaps[ i ] = NULL; + } + + assert( is_empty_list( & rmesa->swapped ) ); + } + FREE( rmesa ); } Index: xc/lib/GL/mesa/src/drv/r128/r128_context.h diff -u xc/lib/GL/mesa/src/drv/r128/r128_context.h:1.12 xc/lib/GL/mesa/src/drv/r128/r128_context.h:1.13 --- xc/lib/GL/mesa/src/drv/r128/r128_context.h:1.12 Mon Dec 16 11:18:52 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_context.h Sun Sep 28 16:15:20 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.12 2002/12/16 16:18:52 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.13 2003/09/28 20:15:20 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -38,8 +38,6 @@ #ifdef GLX_DIRECT_RENDERING -#include - #include "dri_util.h" #include "xf86drm.h" @@ -47,9 +45,10 @@ #include "mtypes.h" -#include "r128_sarea.h" #include "r128_reg.h" +#include "texmem.h" + struct r128_context; typedef struct r128_context r128ContextRec; typedef struct r128_context *r128ContextPtr; @@ -68,9 +67,8 @@ #define R128_NEW_MASKS 0x0020 #define R128_NEW_RENDER_NOT 0x0040 #define R128_NEW_WINDOW 0x0080 -#define R128_NEW_TEXTURE 0x0100 -#define R128_NEW_CONTEXT 0x0200 -#define R128_NEW_ALL 0x03ff +#define R128_NEW_CONTEXT 0x0100 +#define R128_NEW_ALL 0x01ff /* Flags for software fallback cases: */ @@ -141,7 +139,7 @@ GLuint vertex_stride_shift; GLuint vertex_format; GLuint num_verts; - char *verts; + GLubyte *verts; CARD32 ClearColor; /* Color used to clear color buffer */ CARD32 ClearDepth; /* Value used to clear depth buffer */ @@ -157,12 +155,11 @@ /* Texture object bookkeeping */ + unsigned nr_heaps; + driTexHeap * texture_heaps[ R128_NR_TEX_HEAPS ]; + driTextureObject swapped; + r128TexObjPtr CurrentTexObj[2]; - r128TexObj TexObjList[R128_NR_TEX_HEAPS]; - r128TexObj SwappedOut; - memHeap_t *texHeap[R128_NR_TEX_HEAPS]; - GLint lastTexAge[R128_NR_TEX_HEAPS]; - GLint lastTexHeap; /* Fallback rasterization functions */ @@ -180,11 +177,13 @@ /* Page flipping */ GLuint doPageFlip; - GLuint currentPage; + + /* Busy waiting + */ + GLuint do_irqs; /* Drawable, cliprect and scissor information */ - GLenum DrawBuffer; /* Optimize draw buffer update */ GLint drawOffset, drawPitch; GLint readOffset, readPitch; @@ -196,8 +195,6 @@ /* Mirrors of some DRI state */ - Display *display; /* X server display */ - __DRIcontextPrivate *driContext; /* DRI context */ __DRIscreenPrivate *driScreen; /* DRI screen */ __DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */ @@ -224,6 +221,7 @@ /* VBI */ GLuint vbl_seq; + GLuint vblank_flags; }; #define R128_CONTEXT(ctx) ((r128ContextPtr)(ctx->DriverCtx)) @@ -236,8 +234,7 @@ (rmesa->r128Screen->chipset == R128_CARD_TYPE_R128_MOBILITY) -extern GLboolean r128CreateContext( Display *dpy, - const __GLcontextModes *glVisual, +extern GLboolean r128CreateContext( const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate ); Index: xc/lib/GL/mesa/src/drv/r128/r128_dd.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_dd.c:1.15 xc/lib/GL/mesa/src/drv/r128/r128_dd.c:1.16 --- xc/lib/GL/mesa/src/drv/r128/r128_dd.c:1.15 Wed Oct 30 07:51:38 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_dd.c Sun Sep 28 16:15:20 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.c,v 1.15 2002/10/30 12:51:38 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.c,v 1.16 2003/09/28 20:15:20 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -40,12 +40,10 @@ #include "r128_dd.h" #include "context.h" -#include "extensions.h" -#if defined(USE_X86_ASM) -#include "X86/common_x86_asm.h" -#endif -#define R128_DATE "20020221" +#include "utils.h" + +#define DRIVER_DATE "20030328" /* Return the width and height of the current color buffer. @@ -68,59 +66,28 @@ { r128ContextPtr rmesa = R128_CONTEXT(ctx); static char buffer[128]; + unsigned offset; + const char * card_name = "Rage 128"; + GLuint agp_mode = rmesa->r128Screen->IsPCI ? 0 : + rmesa->r128Screen->AGPMode; switch ( name ) { case GL_VENDOR: return (GLubyte *)"VA Linux Systems, Inc."; case GL_RENDERER: - sprintf( buffer, "Mesa DRI Rage128 " R128_DATE ); - - /* Append any chipset-specific information. + /* Select the spefic chipset. */ if ( R128_IS_PRO( rmesa ) ) { - strncat( buffer, " Pro", 4 ); + card_name = "Rage 128 Pro"; } - if ( R128_IS_MOBILITY( rmesa ) ) { - strncat( buffer, " M3", 3 ); + else if ( R128_IS_MOBILITY( rmesa ) ) { + card_name = "Rage 128 Mobility"; } - /* Append any AGP-specific information. - */ - switch ( rmesa->r128Screen->AGPMode ) { - case 1: - strncat( buffer, " AGP 1x", 7 ); - break; - case 2: - strncat( buffer, " AGP 2x", 7 ); - break; - case 4: - strncat( buffer, " AGP 4x", 7 ); - break; - } + offset = driGetRendererString( buffer, card_name, DRIVER_DATE, + agp_mode ); - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - } -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif -#endif return (GLubyte *)buffer; default: @@ -168,16 +135,6 @@ } -/* Initialize the extensions supported by this driver. - */ -void r128DDInitExtensions( GLcontext *ctx ) -{ - _mesa_enable_extension( ctx, "GL_ARB_multitexture" ); - _mesa_enable_extension( ctx, "GL_ARB_texture_env_add" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_env_add" ); - _mesa_enable_imaging_extensions( ctx ); -} - /* Initialize the driver's misc functions. */ void r128DDInitDriverFuncs( GLcontext *ctx ) Index: xc/lib/GL/mesa/src/drv/r128/r128_dd.h diff -u xc/lib/GL/mesa/src/drv/r128/r128_dd.h:1.3 xc/lib/GL/mesa/src/drv/r128/r128_dd.h:1.4 --- xc/lib/GL/mesa/src/drv/r128/r128_dd.h:1.3 Sun Jan 7 20:07:20 2001 +++ xc/lib/GL/mesa/src/drv/r128/r128_dd.h Sun Sep 28 16:15:20 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.h,v 1.3 2001/01/08 01:07:20 martin Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.h,v 1.4 2003/09/28 20:15:20 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -38,7 +38,6 @@ #ifdef GLX_DIRECT_RENDERING -extern void r128DDInitExtensions( GLcontext *ctx ); extern void r128DDInitDriverFuncs( GLcontext *ctx ); #endif Index: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c:1.10 xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c:1.13 --- xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c:1.10 Mon Dec 16 11:18:53 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c,v 1.10 2002/12/16 16:18:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c,v 1.13 2004/01/23 03:57:05 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -32,15 +32,18 @@ * */ +#define STANDALONE_MMIO #include "r128_context.h" #include "r128_state.h" #include "r128_ioctl.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "swrast/swrast.h" +#include "vblank.h" + #define R128_TIMEOUT 2048 #define R128_IDLE_RETRY 32 @@ -247,6 +250,7 @@ { r128ContextPtr rmesa; GLint nbox, i, ret; + GLboolean missed_target; assert(dPriv); assert(dPriv->driContextPriv); @@ -257,7 +261,7 @@ if ( R128_DEBUG & DEBUG_VERBOSE_API ) { fprintf( stderr, "\n********************************\n" ); fprintf( stderr, "\n%s( %p )\n\n", - __FUNCTION__, rmesa->glCtx ); + __FUNCTION__, (void *)rmesa->glCtx ); fflush( stderr ); } @@ -265,8 +269,6 @@ LOCK_HARDWARE( rmesa ); - nbox = rmesa->numClipRects; /* must be in locked region */ - /* Throttle the frame rate -- only allow one pending swap buffers * request at a time. */ @@ -276,13 +278,15 @@ rmesa->hardwareWentIdle = 0; } - r128WaitForVBlank( rmesa ); + UNLOCK_HARDWARE( rmesa ); + driWaitForVBlank( dPriv, &rmesa->vbl_seq, rmesa->vblank_flags, &missed_target ); + LOCK_HARDWARE( rmesa ); - nbox = dPriv->numClipRects; + nbox = dPriv->numClipRects; /* must be in locked region */ for ( i = 0 ; i < nbox ; ) { GLint nr = MIN2( i + R128_NR_SAREA_CLIPRECTS , nbox ); - XF86DRIClipRectPtr box = rmesa->pClipRects; + XF86DRIClipRectPtr box = dPriv->pClipRects; XF86DRIClipRectPtr b = rmesa->sarea->boxes; GLint n = 0; @@ -325,6 +329,7 @@ { r128ContextPtr rmesa; GLint ret; + GLboolean missed_target; assert(dPriv); assert(dPriv->driContextPriv); @@ -334,7 +339,7 @@ if ( R128_DEBUG & DEBUG_VERBOSE_API ) { fprintf( stderr, "\n%s( %p ): page=%d\n\n", - __FUNCTION__, rmesa->glCtx, rmesa->currentPage ); + __FUNCTION__, (void *)rmesa->glCtx, rmesa->sarea->pfCurrentPage ); } FLUSH_BATCH( rmesa ); @@ -350,28 +355,28 @@ rmesa->hardwareWentIdle = 0; } - r128WaitForVBlank( rmesa ); + UNLOCK_HARDWARE( rmesa ); + driWaitForVBlank( dPriv, &rmesa->vbl_seq, rmesa->vblank_flags, &missed_target ); + LOCK_HARDWARE( rmesa ); /* The kernel will have been initialized to perform page flipping * on a swapbuffers ioctl. */ - ret = drmCommandNone( rmesa->driFd, DRM_R128_SWAP ); + ret = drmCommandNone( rmesa->driFd, DRM_R128_FLIP ); UNLOCK_HARDWARE( rmesa ); if ( ret ) { - fprintf( stderr, "DRM_R128_SWAP: return = %d\n", ret ); + fprintf( stderr, "DRM_R128_FLIP: return = %d\n", ret ); exit( 1 ); } - if ( rmesa->currentPage == 0 ) { + if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->drawOffset = rmesa->r128Screen->frontOffset; rmesa->drawPitch = rmesa->r128Screen->frontPitch; - rmesa->currentPage = 1; } else { rmesa->drawOffset = rmesa->r128Screen->backOffset; rmesa->drawPitch = rmesa->r128Screen->backPitch; - rmesa->currentPage = 0; } rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) | @@ -800,40 +805,6 @@ } } -void r128WaitForVBlank( r128ContextPtr rmesa ) -{ - drmVBlank vbl; - int ret; - - if ( !rmesa->r128Screen->irq ) - return; - - if ( getenv("LIBGL_SYNC_REFRESH") ) { - /* Wait for until the next vertical blank */ - vbl.request.type = DRM_VBLANK_RELATIVE; - vbl.request.sequence = 1; - } else if ( getenv("LIBGL_THROTTLE_REFRESH") ) { - /* Wait for at least one vertical blank since the last call */ - vbl.request.type = DRM_VBLANK_ABSOLUTE; - vbl.request.sequence = rmesa->vbl_seq + 1; - } else { - return; - } - - UNLOCK_HARDWARE( rmesa ); - - if ((ret = drmWaitVBlank( rmesa->driFd, &vbl ))) { - fprintf(stderr, "%s: drmWaitVBlank returned %d, IRQs don't seem to be" - " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH" - " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret); - exit(1); - } - - rmesa->vbl_seq = vbl.reply.sequence; - - LOCK_HARDWARE( rmesa ); -} - void r128DDInitIoctlFuncs( GLcontext *ctx ) { ctx->Driver.Clear = r128DDClear; Index: xc/lib/GL/mesa/src/drv/r128/r128_lock.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_lock.c:1.5 xc/lib/GL/mesa/src/drv/r128/r128_lock.c:1.6 --- xc/lib/GL/mesa/src/drv/r128/r128_lock.c:1.5 Wed Oct 30 07:51:38 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_lock.c Sun Sep 28 16:15:20 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.c,v 1.5 2002/10/30 12:51:38 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_lock.c,v 1.6 2003/09/28 20:15:20 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -35,6 +35,7 @@ #include "r128_context.h" #include "r128_lock.h" #include "r128_tex.h" +#include "r128_state.h" #if DEBUG_LOCKING char *prevLockFile = NULL; @@ -42,6 +43,36 @@ #endif +/* Turn on/off page flipping according to the flags in the sarea: + */ +static void +r128UpdatePageFlipping( r128ContextPtr rmesa ) +{ + int use_back; + + rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip; + + use_back = (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT); + use_back ^= (rmesa->sarea->pfCurrentPage == 1); + + if ( R128_DEBUG & DEBUG_VERBOSE_API ) + fprintf(stderr, "%s allow %d current %d\n", __FUNCTION__, + rmesa->doPageFlip, + rmesa->sarea->pfCurrentPage ); + + if ( use_back ) { + rmesa->drawOffset = rmesa->r128Screen->backOffset; + rmesa->drawPitch = rmesa->r128Screen->backPitch; + } else { + rmesa->drawOffset = rmesa->r128Screen->frontOffset; + rmesa->drawPitch = rmesa->r128Screen->frontPitch; + } + + rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) | + (rmesa->drawOffset >> 5)); + rmesa->new_state |= R128_NEW_WINDOW; +} + /* Update the hardware state. This is called if another context has * grabbed the hardware lock, which includes the X server. This * function also updates the driver's window state after the X server @@ -67,11 +98,12 @@ * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO( rmesa->display, sPriv, dPriv ); + DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); if ( rmesa->lastStamp != dPriv->lastStamp ) { + r128UpdatePageFlipping( rmesa ); rmesa->lastStamp = dPriv->lastStamp; - rmesa->new_state |= R128_NEW_WINDOW | R128_NEW_CLIP; + rmesa->new_state |= R128_NEW_CLIP; rmesa->SetupNewInputs = ~0; } @@ -85,9 +117,7 @@ rmesa->dirty = R128_UPLOAD_ALL; } - for ( i = 0 ; i < rmesa->lastTexHeap ; i++ ) { - if ( rmesa->texHeap[i] && sarea->texAge[i] != rmesa->lastTexAge[i] ) { - r128AgeTextures( rmesa, i ); - } + for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { + DRI_AGE_TEXTURES( rmesa->texture_heaps[i] ); } } Index: xc/lib/GL/mesa/src/drv/r128/r128_screen.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_screen.c:1.8 xc/lib/GL/mesa/src/drv/r128/r128_screen.c:1.10 --- xc/lib/GL/mesa/src/drv/r128/r128_screen.c:1.8 Mon Dec 16 11:18:53 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_screen.c Sun Sep 28 16:15:20 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.c,v 1.8 2002/12/16 16:18:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_screen.c,v 1.10 2003/09/28 20:15:20 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -41,7 +41,12 @@ #include "r128_vb.h" #include "context.h" -#include "mem.h" +#include "imports.h" + +#include "utils.h" +#include "vblank.h" + +#include "glxextensions.h" #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... @@ -65,6 +70,9 @@ r128ScreenPtr r128Screen; R128DRIPtr r128DRIPriv = (R128DRIPtr)sPriv->pDevPriv; + if ( ! driCheckDriDdxDrmVersions( sPriv, "Rage128", 4, 0, 4, 0, 2, 2 ) ) + return NULL; + /* Allocate the private area */ r128Screen = (r128ScreenPtr) CALLOC( sizeof(*r128Screen) ); if ( !r128Screen ) return NULL; @@ -172,6 +180,22 @@ r128Screen->driScreen = sPriv; + if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + + if ( glx_enable_extension != NULL ) { + if ( r128Screen->irq != 0 ) { + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); + } + + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + } + } + return r128Screen; } @@ -200,58 +224,8 @@ /* Initialize the fullscreen mode. */ static GLboolean -r128OpenFullScreen( __DRIcontextPrivate *driContextPriv ) +r128OpenCloseFullScreen( __DRIcontextPrivate *driContextPriv ) { -#if 0 - r128ContextPtr rmesa = (r128ContextPtr)driContextPriv->driverPrivate; - drmR128Fullscreen fullscreen; - GLint ret; - - /* FIXME: Do we need to check this? - */ - if ( !r128Ctx->glCtx->Visual.doubleBufferMode ) - return GL_TRUE; - - LOCK_HARDWARE( rmesa ); - r128WaitForIdleLocked( rmesa ); - - /* Ignore errors. If this fails, we simply don't do page flipping. - */ - fullscreen.func = DRM_R128_INIT_FULLSCREEN; - ret = drmCommandWrite( rmesa->driFd, DRM_R128_FULLSCREEN, - &fullscreen, sizeof(drmR128Fullscreen) ); - - UNLOCK_HARDWARE( rmesa ); - - rmesa->doPageFlip = ( ret == 0 ); -#endif - - return GL_TRUE; -} - -/* Shut down the fullscreen mode. - */ -static GLboolean -r128CloseFullScreen( __DRIcontextPrivate *driContextPriv ) -{ -#if 0 - r128ContextPtr rmesa = (r128ContextPtr)driContextPriv->driverPrivate; - drmR128Fullscreen fullscreen; - LOCK_HARDWARE( rmesa ); - r128WaitForIdleLocked( rmesa ); - - /* Don't care if this fails, we're not page flipping anymore. - */ - fullscreen.func = DRM_R128_CLEANUP_FULLSCREEN; - drmCommandWrite( rmesa->driFd, DRM_R128_FULLSCREEN, - &fullscreen, sizeof(drmR128Fullscreen) ); - - UNLOCK_HARDWARE( rmesa ); - - rmesa->doPageFlip = GL_FALSE; - rmesa->currentPage = 0; -#endif - return GL_TRUE; } @@ -260,8 +234,7 @@ * data. */ static GLboolean -r128CreateBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, +r128CreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) @@ -290,19 +263,15 @@ /* Copy the back color buffer to the front color buffer */ static void -r128SwapBuffers(Display *dpy, void *drawablePrivate) +r128SwapBuffers(__DRIdrawablePrivate *dPriv) { - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - (void) dpy; - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { r128ContextPtr rmesa; GLcontext *ctx; rmesa = (r128ContextPtr) dPriv->driContextPriv->driverPrivate; ctx = rmesa->glCtx; if (ctx->Visual.doubleBufferMode) { - _mesa_swapbuffers( ctx ); /* flush pending rendering comands */ - + _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ if ( rmesa->doPageFlip ) { r128PageFlip( dPriv ); } @@ -313,7 +282,7 @@ } else { /* XXX this shouldn't be an error but we can't handle it for now */ - _mesa_problem(NULL, "r128SwapBuffers: drawable has no context!\n"); + _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__); } } @@ -325,31 +294,6 @@ { sPriv->private = (void *) r128CreateScreen( sPriv ); - /* Check the DRI version */ - { - int major, minor, patch; - if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 4 || minor < 0 ) { - __driUtilMessage( "R128 DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch ); - return GL_FALSE; - } - } - } - - /* Check that the DDX driver version is compatible */ - if ( sPriv->ddxMajor != 4 || - sPriv->ddxMinor < 0 ) { - __driUtilMessage( "R128 DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch ); - return GL_FALSE; - } - - /* Check that the DRM driver version is compatible */ - if ( sPriv->drmMajor != 2 || - sPriv->drmMinor < 2 ) { - __driUtilMessage( "R128 DRI driver expected DRM driver version 2.2.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); - return GL_FALSE; - } - if ( !sPriv->private ) { r128DestroyScreen( sPriv ); return GL_FALSE; @@ -359,28 +303,48 @@ } - -/* This function is called by libGL.so as soon as libGL.so is loaded. - * This is where we'd register new extension functions with the - * dispatcher. +/** + * This function is called by libGL.so as soon as libGL.so is loaded. + * This is where we register new extension functions with the dispatcher. + * + * \todo This interface has been deprecated, so we should probably remove + * this function before the next XFree86 release. */ void __driRegisterExtensions( void ) { + PFNGLXENABLEEXTENSIONPROC glx_enable_extension; + + if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { + glx_enable_extension = (PFNGLXENABLEEXTENSIONPROC) + glXGetProcAddress( (const GLubyte *) "__glXEnableExtension" ); + + if ( glx_enable_extension != NULL ) { + glx_enable_extension( "GLX_SGI_swap_control", GL_FALSE ); + glx_enable_extension( "GLX_SGI_video_sync", GL_FALSE ); + glx_enable_extension( "GLX_MESA_swap_control", GL_FALSE ); + } + } } static struct __DriverAPIRec r128API = { - r128InitDriver, - r128DestroyScreen, - r128CreateContext, - r128DestroyContext, - r128CreateBuffer, - r128DestroyBuffer, - r128SwapBuffers, - r128MakeCurrent, - r128UnbindContext, - r128OpenFullScreen, - r128CloseFullScreen + .InitDriver = r128InitDriver, + .DestroyScreen = r128DestroyScreen, + .CreateContext = r128CreateContext, + .DestroyContext = r128DestroyContext, + .CreateBuffer = r128CreateBuffer, + .DestroyBuffer = r128DestroyBuffer, + .SwapBuffers = r128SwapBuffers, + .MakeCurrent = r128MakeCurrent, + .UnbindContext = r128UnbindContext, + .OpenFullScreen = r128OpenCloseFullScreen, + .CloseFullScreen = r128OpenCloseFullScreen, + .GetSwapInfo = NULL, + .GetMSC = driGetMSC32, + .WaitForMSC = driWaitForMSC32, + .WaitForSBC = NULL, + .SwapBuffersMSC = NULL + }; Index: xc/lib/GL/mesa/src/drv/r128/r128_span.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_span.c:1.8 xc/lib/GL/mesa/src/drv/r128/r128_span.c:1.9 --- xc/lib/GL/mesa/src/drv/r128/r128_span.c:1.8 Wed Oct 30 07:51:39 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_span.c Sun Sep 28 16:15:20 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.c,v 1.8 2002/10/30 12:51:39 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_span.c,v 1.9 2003/09/28 20:15:20 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -40,7 +40,7 @@ #include "r128_span.h" #include "r128_tex.h" -#include "swrast/s_pb.h" /* for PB_SIZE */ +#include "swrast/swrast.h" #define DBG 0 @@ -219,8 +219,8 @@ #define WRITE_DEPTH_PIXELS() \ do { \ - GLint ox[PB_SIZE]; \ - GLint oy[PB_SIZE]; \ + GLint ox[MAX_WIDTH]; \ + GLint oy[MAX_WIDTH]; \ for ( i = 0 ; i < n ; i++ ) { \ ox[i] = x[i] + dPriv->x; \ } \ @@ -253,8 +253,8 @@ GLint i, remaining = n; \ \ while ( remaining > 0 ) { \ - GLint ox[PB_SIZE]; \ - GLint oy[PB_SIZE]; \ + GLint ox[MAX_WIDTH]; \ + GLint oy[MAX_WIDTH]; \ GLint count; \ \ if ( remaining <= 128 ) { \ @@ -296,8 +296,8 @@ #define WRITE_DEPTH_PIXELS() \ do { \ - GLint ox[PB_SIZE]; \ - GLint oy[PB_SIZE]; \ + GLint ox[MAX_WIDTH]; \ + GLint oy[MAX_WIDTH]; \ for ( i = 0 ; i < n ; i++ ) { \ ox[i] = x[i] + dPriv->x; \ } \ @@ -330,8 +330,8 @@ GLint i, remaining = n; \ \ while ( remaining > 0 ) { \ - GLint ox[PB_SIZE]; \ - GLint oy[PB_SIZE]; \ + GLint ox[MAX_WIDTH]; \ + GLint oy[MAX_WIDTH]; \ GLint count; \ \ if ( remaining <= 128 ) { \ @@ -378,20 +378,35 @@ -static void r128DDSetReadBuffer( GLcontext *ctx, - GLframebuffer *colorBuffer, - GLenum mode ) +/* + * This function is called to specify which buffer to read and write + * for software rasterization (swrast) fallbacks. This doesn't necessarily + * correspond to glDrawBuffer() or glReadBuffer() calls. + */ +static void r128DDSetBuffer( GLcontext *ctx, + GLframebuffer *colorBuffer, + GLuint bufferBit ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); - switch ( mode ) { - case GL_FRONT_LEFT: - rmesa->readOffset = rmesa->r128Screen->frontOffset; - rmesa->readPitch = rmesa->r128Screen->frontPitch; + switch ( bufferBit ) { + case FRONT_LEFT_BIT: + if ( rmesa->sarea->pfCurrentPage == 1 ) { + rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset; + rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch; + } else { + rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset; + rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch; + } break; - case GL_BACK_LEFT: - rmesa->readOffset = rmesa->r128Screen->backOffset; - rmesa->readPitch = rmesa->r128Screen->backPitch; + case BACK_LEFT_BIT: + if ( rmesa->sarea->pfCurrentPage == 1 ) { + rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset; + rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch; + } else { + rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset; + rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch; + } break; default: break; @@ -404,7 +419,7 @@ r128ContextPtr rmesa = R128_CONTEXT(ctx); struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SetReadBuffer = r128DDSetReadBuffer; + swdd->SetBuffer = r128DDSetBuffer; switch ( rmesa->r128Screen->cpp ) { case 2: Index: xc/lib/GL/mesa/src/drv/r128/r128_state.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_state.c:1.11 xc/lib/GL/mesa/src/drv/r128/r128_state.c:1.12 --- xc/lib/GL/mesa/src/drv/r128/r128_state.c:1.11 Wed Oct 30 07:51:39 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_state.c Sun Sep 28 16:15:21 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.c,v 1.11 2002/10/30 12:51:39 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_state.c,v 1.12 2003/09/28 20:15:21 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -42,9 +42,8 @@ #include "r128_tex.h" #include "context.h" -#include "mmath.h" #include "enums.h" - +#include "colormac.h" #include "swrast/swrast.h" #include "array_cache/acache.h" #include "tnl/tnl.h" @@ -64,7 +63,9 @@ GLuint t = rmesa->setup.tex_cntl_c; if ( ctx->Color.AlphaEnabled ) { - GLubyte ref = ctx->Color.AlphaRef; + GLubyte ref; + + CLAMPED_FLOAT_TO_UBYTE(ref, ctx->Color.AlphaRef); a &= ~(R128_ALPHA_TEST_MASK | R128_REF_ALPHA_MASK); @@ -182,7 +183,7 @@ } } -static void r128DDAlphaFunc( GLcontext *ctx, GLenum func, GLchan ref ) +static void r128DDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); @@ -658,13 +659,18 @@ */ static void r128DDClearColor( GLcontext *ctx, - const GLchan color[4] ) + const GLfloat color[4] ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); + GLubyte c[4]; + + CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); rmesa->ClearColor = r128PackColor( rmesa->r128Screen->cpp, - color[0], color[1], - color[2], color[3] ); + c[0], c[1], c[2], c[3] ); } static void r128DDLogicOpCode( GLcontext *ctx, GLenum opcode ) @@ -678,35 +684,41 @@ } } -static void r128DDSetDrawBuffer( GLcontext *ctx, GLenum mode ) +static void r128DDDrawBuffer( GLcontext *ctx, GLenum mode ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); FLUSH_BATCH( rmesa ); - if ( rmesa->DrawBuffer != mode ) { - rmesa->DrawBuffer = mode; + /* + * _DrawDestMask is easier to cope with than . + */ + switch ( ctx->Color._DrawDestMask ) { + case FRONT_LEFT_BIT: + FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE ); + break; + case BACK_LEFT_BIT: + FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE ); + break; + default: + /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ + FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_TRUE ); + break; + } - switch ( mode ) { - case GL_FRONT_LEFT: - rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset; - rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch; - FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE ); - break; - case GL_BACK_LEFT: - rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset; - rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch; - FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE ); - break; - default: - FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_TRUE ); - break; - } + /* We want to update the s/w rast state too so that r128DDSetBuffer() + * gets called. + */ + _swrast_DrawBuffer(ctx, mode); - rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) | - (rmesa->drawOffset >> 5)); - rmesa->new_state |= R128_NEW_WINDOW; - } + rmesa->setup.dst_pitch_offset_c = (((rmesa->drawPitch/8) << 21) | + (rmesa->drawOffset >> 5)); + rmesa->new_state |= R128_NEW_WINDOW; +} + +static void r128DDReadBuffer( GLcontext *ctx, GLenum mode ) +{ + /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */ } @@ -842,7 +854,6 @@ case GL_TEXTURE_2D: case GL_TEXTURE_3D: FLUSH_BATCH( rmesa ); - rmesa->new_state |= R128_NEW_TEXTURE; break; case GL_POLYGON_STIPPLE: @@ -874,7 +885,7 @@ static void r128DDPrintDirty( const char *msg, GLuint state ) { fprintf( stderr, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s\n", + "%s: (0x%x) %s%s%s%s%s%s%s%s%s\n", msg, state, (state & R128_UPLOAD_CORE) ? "core, " : "", @@ -882,8 +893,6 @@ (state & R128_UPLOAD_SETUP) ? "setup, " : "", (state & R128_UPLOAD_TEX0) ? "tex0, " : "", (state & R128_UPLOAD_TEX1) ? "tex1, " : "", - (state & R128_UPLOAD_TEX0IMAGES) ? "tex0 images, " : "", - (state & R128_UPLOAD_TEX1IMAGES) ? "tex1 images, " : "", (state & R128_UPLOAD_MASKS) ? "masks, " : "", (state & R128_UPLOAD_WINDOW) ? "window, " : "", (state & R128_UPLOAD_CLIPRECTS) ? "cliprects, " : "", @@ -912,21 +921,11 @@ r128DDPrintDirty( "r128EmitHwStateLocked", rmesa->dirty ); } - if ( rmesa->dirty & R128_UPLOAD_TEX0IMAGES ) { - if ( t0 ) r128UploadTexImages( rmesa, t0 ); - rmesa->dirty &= ~R128_UPLOAD_TEX0IMAGES; - } - if ( rmesa->dirty & R128_UPLOAD_TEX1IMAGES ) { - if ( t1 ) r128UploadTexImages( rmesa, t1 ); - rmesa->dirty &= ~R128_UPLOAD_TEX1IMAGES; - } - if ( rmesa->dirty & (R128_UPLOAD_CONTEXT | R128_UPLOAD_SETUP | R128_UPLOAD_MASKS | R128_UPLOAD_WINDOW | - R128_UPLOAD_CORE | - R128_UPLOAD_TEX0) ) { + R128_UPLOAD_CORE) ) { memcpy( &sarea->ContextState, regs, sizeof(sarea->ContextState) ); } @@ -965,7 +964,7 @@ static void r128DDPrintState( const char *msg, GLuint flags ) { fprintf( stderr, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s\n", + "%s: (0x%x) %s%s%s%s%s%s%s%s\n", msg, flags, (flags & R128_NEW_CONTEXT) ? "context, " : "", @@ -973,7 +972,6 @@ (flags & R128_NEW_DEPTH) ? "depth, " : "", (flags & R128_NEW_FOG) ? "fog, " : "", (flags & R128_NEW_CLIP) ? "clip, " : "", - (flags & R128_NEW_TEXTURE) ? "texture, " : "", (flags & R128_NEW_CULL) ? "cull, " : "", (flags & R128_NEW_MASKS) ? "masks, " : "", (flags & R128_NEW_WINDOW) ? "window, " : "" ); @@ -984,7 +982,7 @@ r128ContextPtr rmesa = R128_CONTEXT(ctx); int new_state = rmesa->new_state; - if ( new_state ) + if ( new_state || rmesa->NewGLState & _NEW_TEXTURE ) { FLUSH_BATCH( rmesa ); @@ -1016,8 +1014,9 @@ if ( new_state & R128_NEW_WINDOW ) r128UpdateWindow( ctx ); - if ( new_state & R128_NEW_TEXTURE ) + if ( rmesa->NewGLState & _NEW_TEXTURE ) { r128UpdateTextureState( ctx ); + } } } @@ -1072,12 +1071,10 @@ rmesa->Fallback = 0; - if ( rmesa->glCtx->Visual.doubleBufferMode ) { - rmesa->DrawBuffer = GL_BACK_LEFT; + if ( rmesa->glCtx->Visual.doubleBufferMode && rmesa->sarea->pfCurrentPage == 0 ) { rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset; rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch; } else { - rmesa->DrawBuffer = GL_FRONT_LEFT; rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset; rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch; } @@ -1192,7 +1189,8 @@ ctx->Driver.ClearIndex = NULL; ctx->Driver.ClearColor = r128DDClearColor; - ctx->Driver.SetDrawBuffer = r128DDSetDrawBuffer; + ctx->Driver.DrawBuffer = r128DDDrawBuffer; + ctx->Driver.ReadBuffer = r128DDReadBuffer; ctx->Driver.IndexMask = NULL; ctx->Driver.ColorMask = r128DDColorMask; Index: xc/lib/GL/mesa/src/drv/r128/r128_tex.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_tex.c:1.14 xc/lib/GL/mesa/src/drv/r128/r128_tex.c:1.16 --- xc/lib/GL/mesa/src/drv/r128/r128_tex.c:1.14 Tue Nov 5 12:46:08 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_tex.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.14 2002/11/05 17:46:08 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.16 2004/01/23 03:57:05 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -43,12 +43,12 @@ #include "context.h" #include "macros.h" -#include "mmath.h" #include "simple_list.h" #include "enums.h" #include "texstore.h" #include "texformat.h" -#include "mem.h" +#include "imports.h" +#include "colormac.h" #define TEX_0 1 #define TEX_1 2 @@ -68,6 +68,12 @@ case GL_REPEAT: t->setup.tex_cntl |= R128_TEX_CLAMP_S_WRAP; break; + case GL_CLAMP_TO_BORDER: + t->setup.tex_cntl |= R128_TEX_CLAMP_S_BORDER_COLOR; + break; + case GL_MIRRORED_REPEAT: + t->setup.tex_cntl |= R128_TEX_CLAMP_S_MIRROR; + break; } switch ( twrap ) { @@ -80,6 +86,12 @@ case GL_REPEAT: t->setup.tex_cntl |= R128_TEX_CLAMP_T_WRAP; break; + case GL_CLAMP_TO_BORDER: + t->setup.tex_cntl |= R128_TEX_CLAMP_T_BORDER_COLOR; + break; + case GL_MIRRORED_REPEAT: + t->setup.tex_cntl |= R128_TEX_CLAMP_T_MIRROR; + break; } } @@ -129,24 +141,27 @@ r128TexObjPtr t; if ( R128_DEBUG & DEBUG_VERBOSE_API ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, texObj ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)texObj ); } t = (r128TexObjPtr) CALLOC_STRUCT( r128_tex_obj ); - if (!t) - return NULL; + texObj->DriverData = t; + if ( t != NULL ) { - /* Initialize non-image-dependent parts of the state: - */ - t->tObj = texObj; - t->dirty_images = ~0; - - make_empty_list( t ); - - r128SetTexWrap( t, texObj->WrapS, texObj->WrapT ); - /*r128SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );*/ - r128SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); - r128SetTexBorderColor( t, texObj->BorderColor ); + /* Initialize non-image-dependent parts of the state: + */ + t->base.tObj = texObj; + + /* FIXME Something here to set initial values for other parts of + * FIXME t->setup? + */ + + make_empty_list( (driTextureObject *) t ); + + r128SetTexWrap( t, texObj->WrapS, texObj->WrapT ); + r128SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); + r128SetTexBorderColor( t, texObj->_BorderChan ); + } return t; } @@ -167,6 +182,7 @@ case GL_ALPHA8: case GL_ALPHA12: case GL_ALPHA16: + case GL_COMPRESSED_ALPHA: case 2: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE4_ALPHA4: @@ -175,8 +191,10 @@ case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: + case GL_COMPRESSED_LUMINANCE_ALPHA: case 4: case GL_RGBA: + case GL_COMPRESSED_RGBA: case GL_RGBA2: case GL_RGB5_A1: case GL_RGBA8: @@ -192,6 +210,7 @@ case 3: case GL_RGB: + case GL_COMPRESSED_RGB: case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: @@ -210,6 +229,7 @@ case GL_LUMINANCE8: case GL_LUMINANCE12: case GL_LUMINANCE16: + case GL_COMPRESSED_LUMINANCE: if (rmesa->r128Screen->cpp == 4) return &_mesa_texformat_argb8888; /* inefficient but accurate */ else @@ -221,6 +241,7 @@ case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: + case GL_COMPRESSED_INTENSITY: if (rmesa->r128Screen->cpp == 4) return &_mesa_texformat_argb8888; /* inefficient but accurate */ else @@ -235,8 +256,15 @@ case GL_COLOR_INDEX16_EXT: return &_mesa_texformat_ci8; + case GL_YCBCR_MESA: + if (type == GL_UNSIGNED_SHORT_8_8_APPLE || + type == GL_UNSIGNED_BYTE) + return &_mesa_texformat_ycbcr; + else + return &_mesa_texformat_ycbcr_rev; + default: - _mesa_problem( ctx, "unexpected format in r128ChooseTextureFormat" ); + _mesa_problem( ctx, "unexpected format in %s", __FUNCTION__ ); return NULL; } } @@ -250,19 +278,17 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - r128ContextPtr rmesa = R128_CONTEXT(ctx); - r128TexObjPtr t = (r128TexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; if ( t ) { - r128SwapOutTexObj( R128_CONTEXT(ctx), t ); + driSwapOutTextureObject( t ); } else { - t = r128AllocTexObj(texObj); + t = (driTextureObject *) r128AllocTexObj(texObj); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); return; } - texObj->DriverData = t; } /* Note, this will call r128ChooseTextureFormat */ @@ -270,8 +296,7 @@ width, border, format, type, pixels, packing, texObj, texImage ); - t->dirty_images |= (1 << level); - rmesa->new_state |= R128_NEW_TEXTURE; + t->dirty_images[0] |= (1 << level); } @@ -286,29 +311,25 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - r128ContextPtr rmesa = R128_CONTEXT(ctx); - r128TexObjPtr t = (r128TexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; assert( t ); /* this _should_ be true */ if ( t ) { - r128SwapOutTexObj( R128_CONTEXT(ctx), t ); - t->dirty_images |= (1 << level); + driSwapOutTextureObject( t ); } else { - t = r128AllocTexObj(texObj); + t = (driTextureObject *) r128AllocTexObj(texObj); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D"); return; } - texObj->DriverData = t; } _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, format, type, pixels, packing, texObj, texImage); - t->dirty_images |= (1 << level); - rmesa->new_state |= R128_NEW_TEXTURE; + t->dirty_images[0] |= (1 << level); } @@ -320,19 +341,17 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - r128ContextPtr rmesa = R128_CONTEXT(ctx); - r128TexObjPtr t = (r128TexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; if ( t ) { - r128SwapOutTexObj( R128_CONTEXT(ctx), t ); + driSwapOutTextureObject( (driTextureObject *) t ); } else { - t = r128AllocTexObj(texObj); + t = (driTextureObject *) r128AllocTexObj(texObj); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); return; } - texObj->DriverData = t; } /* Note, this will call r128ChooseTextureFormat */ @@ -340,8 +359,7 @@ width, height, border, format, type, pixels, &ctx->Unpack, texObj, texImage); - t->dirty_images |= (1 << level); - rmesa->new_state |= R128_NEW_TEXTURE; + t->dirty_images[0] |= (1 << level); } @@ -356,27 +374,24 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - r128ContextPtr rmesa = R128_CONTEXT(ctx); - r128TexObjPtr t = (r128TexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; assert( t ); /* this _should_ be true */ if ( t ) { - r128SwapOutTexObj( R128_CONTEXT(ctx), t ); + driSwapOutTextureObject( t ); } else { - t = r128AllocTexObj(texObj); + t = (driTextureObject *) r128AllocTexObj(texObj); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); return; } - texObj->DriverData = t; } _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels, packing, texObj, texImage); - t->dirty_images |= (1 << level); - rmesa->new_state |= R128_NEW_TEXTURE; + t->dirty_images[0] |= (1 << level); } @@ -395,7 +410,7 @@ switch ( pname ) { case GL_TEXTURE_ENV_MODE: FLUSH_BATCH( rmesa ); - rmesa->new_state |= R128_NEW_TEXTURE | R128_NEW_ALPHA; + rmesa->new_state |= R128_NEW_ALPHA; break; case GL_TEXTURE_ENV_COLOR: @@ -409,8 +424,6 @@ FLUSH_BATCH( rmesa ); rmesa->setup.constant_color_c = rmesa->env_color; - rmesa->new_state |= R128_NEW_TEXTURE; - /* More complex multitexture/multipass fallbacks for GL_BLEND * can be done later, but this allows a single pass GL_BLEND * in some cases (ie. Performer town demo). This is only @@ -485,31 +498,22 @@ if ( ( target != GL_TEXTURE_2D ) && ( target != GL_TEXTURE_1D ) ) return; - if (!t) { - t = r128AllocTexObj(tObj); - if (!t) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexParameter"); - return; - } - tObj->DriverData = t; - } - switch ( pname ) { case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: - if ( t->bound ) FLUSH_BATCH( rmesa ); + if ( t->base.bound ) FLUSH_BATCH( rmesa ); r128SetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); break; case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: - if ( t->bound ) FLUSH_BATCH( rmesa ); + if ( t->base.bound ) FLUSH_BATCH( rmesa ); r128SetTexWrap( t, tObj->WrapS, tObj->WrapT ); break; case GL_TEXTURE_BORDER_COLOR: - if ( t->bound ) FLUSH_BATCH( rmesa ); - r128SetTexBorderColor( t, tObj->BorderColor ); + if ( t->base.bound ) FLUSH_BATCH( rmesa ); + r128SetTexBorderColor( t, tObj->_BorderChan ); break; case GL_TEXTURE_BASE_LEVEL: @@ -521,70 +525,50 @@ * we just have to rely on loading the right subset of mipmap levels * to simulate a clamped LOD. */ - if ( t->bound ) FLUSH_BATCH( rmesa ); - r128SwapOutTexObj( rmesa, t ); + if ( t->base.bound ) FLUSH_BATCH( rmesa ); + driSwapOutTextureObject( (driTextureObject *) t ); break; default: return; } - - rmesa->new_state |= R128_NEW_TEXTURE; } static void r128DDBindTexture( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj ) { - r128ContextPtr rmesa = R128_CONTEXT(ctx); - GLint unit = ctx->Texture.CurrentUnit; - if ( R128_DEBUG & DEBUG_VERBOSE_API ) { - fprintf( stderr, "%s( %p ) unit=%d\n", - __FUNCTION__, tObj, unit ); + fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, (void *)tObj, + ctx->Texture.CurrentUnit ); } - FLUSH_BATCH( rmesa ); - - if ( rmesa->CurrentTexObj[unit] ) { - rmesa->CurrentTexObj[unit]->bound &= ~(1 << unit); - rmesa->CurrentTexObj[unit] = NULL; + if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) { + if ( tObj->DriverData == NULL ) { + r128AllocTexObj( tObj ); + } } - - rmesa->new_state |= R128_NEW_TEXTURE; } static void r128DDDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); - r128TexObjPtr t = (r128TexObjPtr)tObj->DriverData; + driTextureObject * t = (driTextureObject *) tObj->DriverData; if ( t ) { - if ( t->bound ) { + if ( t->bound && rmesa ) { FLUSH_BATCH( rmesa ); - - if ( t->bound & TEX_0 ) rmesa->CurrentTexObj[0] = NULL; - if ( t->bound & TEX_1 ) rmesa->CurrentTexObj[1] = NULL; - rmesa->new_state |= R128_NEW_TEXTURE; } - r128DestroyTexObj( rmesa, t ); - tObj->DriverData = NULL; + driDestroyTextureObject( t ); } } -static GLboolean r128DDIsTextureResident( GLcontext *ctx, - struct gl_texture_object *tObj ) +void r128DDInitTextureFuncs( GLcontext *ctx ) { - r128TexObjPtr t = (r128TexObjPtr)tObj->DriverData; - - return ( t && t->memBlock ); -} - + r128ContextPtr rmesa = R128_CONTEXT(ctx); -void r128DDInitTextureFuncs( GLcontext *ctx ) -{ ctx->Driver.TexEnv = r128DDTexEnv; ctx->Driver.ChooseTextureFormat = r128ChooseTextureFormat; ctx->Driver.TexImage1D = r128TexImage1D; @@ -604,6 +588,10 @@ ctx->Driver.DeleteTexture = r128DDDeleteTexture; ctx->Driver.UpdateTexturePalette = NULL; ctx->Driver.ActiveTexture = NULL; - ctx->Driver.IsTextureResident = r128DDIsTextureResident; + ctx->Driver.IsTextureResident = driIsTextureResident; ctx->Driver.PrioritizeTexture = NULL; + + driInitTextureObjects( ctx, & rmesa->swapped, + DRI_TEXMGR_DO_TEXTURE_1D + | DRI_TEXMGR_DO_TEXTURE_2D ); } Index: xc/lib/GL/mesa/src/drv/r128/r128_tex.h diff -u xc/lib/GL/mesa/src/drv/r128/r128_tex.h:1.7 xc/lib/GL/mesa/src/drv/r128/r128_tex.h:1.8 --- xc/lib/GL/mesa/src/drv/r128/r128_tex.h:1.7 Fri Feb 22 16:44:58 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_tex.h Sun Sep 28 16:15:21 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.h,v 1.7 2002/02/22 21:44:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.h,v 1.8 2003/09/28 20:15:21 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -40,18 +40,10 @@ extern void r128UpdateTextureState( GLcontext *ctx ); -extern void r128SwapOutTexObj( r128ContextPtr rmesa, r128TexObjPtr t ); - extern void r128UploadTexImages( r128ContextPtr rmesa, r128TexObjPtr t ); -extern void r128AgeTextures( r128ContextPtr rmesa, int heap ); extern void r128DestroyTexObj( r128ContextPtr rmesa, r128TexObjPtr t ); -extern void r128UpdateTexLRU( r128ContextPtr rmesa, r128TexObjPtr t ); - -extern void r128PrintLocalLRU( r128ContextPtr rmesa, int heap ); -extern void r128PrintGlobalLRU( r128ContextPtr rmesa, int heap ); - extern void r128DDInitTextureFuncs( GLcontext *ctx ); Index: xc/lib/GL/mesa/src/drv/r128/r128_texmem.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_texmem.c:1.1 xc/lib/GL/mesa/src/drv/r128/r128_texmem.c:1.3 --- xc/lib/GL/mesa/src/drv/r128/r128_texmem.c:1.1 Fri Feb 22 16:44:58 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_texmem.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texmem.c,v 1.1 2002/02/22 21:44:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texmem.c,v 1.3 2004/01/23 03:57:05 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -42,10 +42,9 @@ #include "context.h" #include "macros.h" -#include "mmath.h" #include "simple_list.h" #include "texformat.h" -#include "mem.h" +#include "imports.h" #define TEX_0 1 #define TEX_1 2 @@ -55,272 +54,32 @@ */ void r128DestroyTexObj( r128ContextPtr rmesa, r128TexObjPtr t ) { -#if ENABLE_PERF_BOXES - /* Bump the performace counter */ - rmesa->c_textureSwaps++; -#endif - if ( !t ) return; - - if ( t->memBlock ) { - mmFreeMem( t->memBlock ); - t->memBlock = NULL; - } - - if ( t->tObj ) - t->tObj->DriverData = NULL; - - if ( t->bound & TEX_0 ) rmesa->CurrentTexObj[0] = NULL; - if ( t->bound & TEX_1 ) rmesa->CurrentTexObj[1] = NULL; - - remove_from_list( t ); - FREE( t ); -} - -/* Keep track of swapped out texture objects. - */ -void r128SwapOutTexObj( r128ContextPtr rmesa, r128TexObjPtr t ) -{ -#if ENABLE_PERF_BOXES - /* Bump the performace counter */ - rmesa->c_textureSwaps++; -#endif - if ( t->memBlock ) { - mmFreeMem( t->memBlock ); - t->memBlock = NULL; - } - - t->dirty_images = ~0; - move_to_tail( &rmesa->SwappedOut, t ); -} - -/* Print out debugging information about texture LRU. - */ -void r128PrintLocalLRU( r128ContextPtr rmesa, int heap ) -{ - r128TexObjPtr t; - int sz = 1 << (rmesa->r128Screen->logTexGranularity[heap]); - - fprintf( stderr, "\nLocal LRU, heap %d:\n", heap ); - - foreach ( t, &rmesa->TexObjList[heap] ) { - if ( !t->tObj ) { - fprintf( stderr, "Placeholder %d at 0x%x sz 0x%x\n", - t->memBlock->ofs / sz, - t->memBlock->ofs, - t->memBlock->size ); - } else { - fprintf( stderr, "Texture (bound %d) at 0x%x sz 0x%x\n", - t->bound, - t->memBlock->ofs, - t->memBlock->size ); - } - } - - fprintf( stderr, "\n" ); -} - -void r128PrintGlobalLRU( r128ContextPtr rmesa, int heap ) -{ - r128_tex_region_t *list = rmesa->sarea->texList[heap]; - int i, j; - - fprintf( stderr, "\nGlobal LRU, heap %d list %p:\n", heap, list ); - - for ( i = 0, j = R128_NR_TEX_REGIONS ; i < R128_NR_TEX_REGIONS ; i++ ) { - fprintf( stderr, "list[%d] age %d next %d prev %d\n", - j, list[j].age, list[j].next, list[j].prev ); - j = list[j].next; - if ( j == R128_NR_TEX_REGIONS ) break; - } - - if ( j != R128_NR_TEX_REGIONS ) { - fprintf( stderr, "Loop detected in global LRU\n" ); - for ( i = 0 ; i < R128_NR_TEX_REGIONS ; i++ ) { - fprintf( stderr, "list[%d] age %d next %d prev %d\n", - i, list[i].age, list[i].next, list[i].prev ); - } - } - - fprintf( stderr, "\n" ); -} - -/* Reset the global texture LRU. - */ -static void r128ResetGlobalLRU( r128ContextPtr rmesa, int heap ) -{ - r128_tex_region_t *list = rmesa->sarea->texList[heap]; - int sz = 1 << rmesa->r128Screen->logTexGranularity[heap]; - int i; - - /* (Re)initialize the global circular LRU list. The last element in - * the array (R128_NR_TEX_REGIONS) is the sentinal. Keeping it at - * the end of the array allows it to be addressed rationally when - * looking up objects at a particular location in texture memory. - */ - for ( i = 0 ; (i+1) * sz <= rmesa->r128Screen->texSize[heap] ; i++ ) { - list[i].prev = i-1; - list[i].next = i+1; - list[i].age = 0; - } - - i--; - list[0].prev = R128_NR_TEX_REGIONS; - list[i].prev = i-1; - list[i].next = R128_NR_TEX_REGIONS; - list[R128_NR_TEX_REGIONS].prev = i; - list[R128_NR_TEX_REGIONS].next = 0; - rmesa->sarea->texAge[heap] = 0; -} - -/* Update the local and glock texture LRUs. - */ -void r128UpdateTexLRU( r128ContextPtr rmesa, r128TexObjPtr t ) -{ - int heap = t->heap; - r128_tex_region_t *list = rmesa->sarea->texList[heap]; - int log2sz = rmesa->r128Screen->logTexGranularity[heap]; - int start = t->memBlock->ofs >> log2sz; - int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz; - int i; - - rmesa->lastTexAge[heap] = ++rmesa->sarea->texAge[heap]; + unsigned i; - if ( !t->memBlock ) { - fprintf( stderr, "no memblock\n\n" ); - return; - } - - /* Update our local LRU */ - move_to_head( &rmesa->TexObjList[heap], t ); - - /* Update the global LRU */ - for ( i = start ; i <= end ; i++ ) { - list[i].in_use = 1; - list[i].age = rmesa->lastTexAge[heap]; - - /* remove_from_list(i) */ - list[(CARD32)list[i].next].prev = list[i].prev; - list[(CARD32)list[i].prev].next = list[i].next; - - /* insert_at_head(list, i) */ - list[i].prev = R128_NR_TEX_REGIONS; - list[i].next = list[R128_NR_TEX_REGIONS].next; - list[(CARD32)list[R128_NR_TEX_REGIONS].next].prev = i; - list[R128_NR_TEX_REGIONS].next = i; - } - - if ( 0 ) { - r128PrintGlobalLRU( rmesa, t->heap ); - r128PrintLocalLRU( rmesa, t->heap ); - } -} - -/* Update our notion of what textures have been changed since we last - * held the lock. This pertains to both our local textures and the - * textures belonging to other clients. Keep track of other client's - * textures by pushing a placeholder texture onto the LRU list -- these - * are denoted by (tObj == NULL). - */ -static void r128TexturesGone( r128ContextPtr rmesa, int heap, - int offset, int size, int in_use ) -{ - r128TexObjPtr t, tmp; - - foreach_s ( t, tmp, &rmesa->TexObjList[heap] ) { - if ( t->memBlock->ofs >= offset + size || - t->memBlock->ofs + t->memBlock->size <= offset ) - continue; - - /* It overlaps - kick it out. Need to hold onto the currently - * bound objects, however. - */ - if ( t->bound ) { - r128SwapOutTexObj( rmesa, t ); - } else { - r128DestroyTexObj( rmesa, t ); - } - } - - if ( in_use ) { - t = (r128TexObjPtr) CALLOC( sizeof(*t) ); - if ( !t ) return; - - t->memBlock = mmAllocMem( rmesa->texHeap[heap], size, 0, offset ); - if ( !t->memBlock ) { - fprintf( stderr, "Couldn't alloc placeholder sz %x ofs %x\n", - (int)size, (int)offset ); - mmDumpMemInfo( rmesa->texHeap[heap] ); - return; - } - insert_at_head( &rmesa->TexObjList[heap], t ); - } -} - -/* Update our client's shared texture state. If another client has - * modified a region in which we have textures, then we need to figure - * out which of our textures has been removed, and update our global - * LRU. - */ -void r128AgeTextures( r128ContextPtr rmesa, int heap ) -{ - R128SAREAPrivPtr sarea = rmesa->sarea; - - if ( sarea->texAge[heap] != rmesa->lastTexAge[heap] ) { - int sz = 1 << rmesa->r128Screen->logTexGranularity[heap]; - int nr = 0; - int idx; - - /* Have to go right round from the back to ensure stuff ends up - * LRU in our local list... Fix with a cursor pointer. - */ - for ( idx = sarea->texList[heap][R128_NR_TEX_REGIONS].prev ; - idx != R128_NR_TEX_REGIONS && nr < R128_NR_TEX_REGIONS ; - idx = sarea->texList[heap][idx].prev, nr++ ) - { - /* If switching texturing schemes, then the SAREA might not - * have been properly cleared, so we need to reset the - * global texture LRU. - */ - if ( idx * sz > rmesa->r128Screen->texSize[heap] ) { - nr = R128_NR_TEX_REGIONS; - break; - } - - if ( sarea->texList[heap][idx].age > rmesa->lastTexAge[heap] ) { - r128TexturesGone( rmesa, heap, idx * sz, sz, - sarea->texList[heap][idx].in_use ); - } - } - /* If switching texturing schemes, then the SAREA might not - * have been properly cleared, so we need to reset the - * global texture LRU. - */ - if ( nr == R128_NR_TEX_REGIONS ) { - r128TexturesGone( rmesa, heap, 0, - rmesa->r128Screen->texSize[heap], 0 ); - r128ResetGlobalLRU( rmesa, heap ); - } - - if ( 0 ) { - r128PrintGlobalLRU( rmesa, heap ); - r128PrintLocalLRU( rmesa, heap ); - } + /* See if it was the driver's current object. + */ - rmesa->dirty |= (R128_UPLOAD_CONTEXT | - R128_UPLOAD_TEX0IMAGES | - R128_UPLOAD_TEX1IMAGES); - rmesa->lastTexAge[heap] = sarea->texAge[heap]; - } + if ( rmesa != NULL ) + { + for ( i = 0 ; i < rmesa->glCtx->Const.MaxTextureUnits ; i++ ) + { + if ( t == rmesa->CurrentTexObj[ i ] ) { + assert( t->base.bound & (1 << i) ); + rmesa->CurrentTexObj[ i ] = NULL; + } + } + } } -/* Upload the texture image associated with texture `t' at level `level' - * at the address relative to `start'. +/** + * Upload the texture image associated with texture \a t at the specified + * level at the address relative to \a start. */ -static void r128UploadSubImage( r128ContextPtr rmesa, - r128TexObjPtr t, int level, - int x, int y, int width, int height ) +static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, + GLint level, + GLint x, GLint y, GLint width, GLint height ) { struct gl_texture_image *image; int texelsPerDword = 0; @@ -334,7 +93,7 @@ if ( ( level < 0 ) || ( level > R128_MAX_TEXTURE_LEVELS ) ) return; - image = t->tObj->Image[level]; + image = t->base.tObj->Image[level]; if ( !image ) return; @@ -417,7 +176,7 @@ } dwords = width * height / texelsPerDword; - offset = t->bufAddr + t->image[level - t->firstLevel].offset; + offset = t->bufAddr + t->image[level - t->base.firstLevel].offset; #if ENABLE_PERF_BOXES /* Bump the performace counter */ @@ -446,15 +205,16 @@ CARD32 *dst; drmBufPtr buffer; + assert(image->Data); + height = MIN2(remaining, rows); /* Grab the indirect buffer for the texture blit */ + LOCK_HARDWARE( rmesa ); buffer = r128GetBufferLocked( rmesa ); dst = (CARD32 *)((char *)buffer->address + R128_HOSTDATA_BLIT_OFFSET); - assert(image->Data); - /* Copy the next chunck of the texture image into the blit buffer */ { const GLubyte *src = (const GLubyte *) image->Data + @@ -466,6 +226,7 @@ r128FireBlitLocked( rmesa, buffer, offset, pitch, format, x, y, width, height ); + UNLOCK_HARDWARE( rmesa ); } rmesa->new_state |= R128_NEW_CONTEXT; @@ -477,73 +238,34 @@ * require removing our own and/or other client's texture objects to * make room for these images. */ -/* NOTE: This function is only called while holding the hardware lock */ void r128UploadTexImages( r128ContextPtr rmesa, r128TexObjPtr t ) { - const GLint numLevels = t->lastLevel - t->firstLevel + 1; - GLint i, heap; + const GLint numLevels = t->base.lastLevel - t->base.firstLevel + 1; + GLint i; if ( R128_DEBUG & DEBUG_VERBOSE_API ) { fprintf( stderr, "%s( %p, %p )\n", - __FUNCTION__, rmesa->glCtx, t ); + __FUNCTION__, (void *)rmesa->glCtx, (void *)t ); } assert(t); - /* Choose the heap appropriately */ - heap = t->heap = R128_CARD_HEAP; - if ( !rmesa->r128Screen->IsPCI && - t->totalSize > rmesa->r128Screen->texSize[heap] ) { - heap = t->heap = R128_AGP_HEAP; - } - - /* Do we need to eject LRU texture objects? */ - if ( !t->memBlock ) { - /* Allocate a memory block on a 4k boundary (1<<12 == 4096) */ - t->memBlock = mmAllocMem( rmesa->texHeap[heap], t->totalSize, 12, 0 ); - - /* Try AGP before kicking anything out of local mem */ - if ( !t->memBlock && heap == R128_CARD_HEAP ) { - t->memBlock = mmAllocMem( rmesa->texHeap[R128_AGP_HEAP], - t->totalSize, 12, 0 ); - - if ( t->memBlock ) - heap = t->heap = R128_AGP_HEAP; - } + LOCK_HARDWARE( rmesa ); - /* Kick out textures until the requested texture fits */ - while ( !t->memBlock ) { - if ( rmesa->TexObjList[heap].prev->bound ) { - fprintf( stderr, - "r128UploadTexImages: ran into bound texture\n" ); - return; - } - if ( rmesa->TexObjList[heap].prev == &rmesa->TexObjList[heap] ) { - if ( rmesa->r128Screen->IsPCI ) { - fprintf( stderr, "r128UploadTexImages: upload texture " - "failure on local texture heaps, sz=%d\n", - t->totalSize ); - return; - } else if ( heap == R128_CARD_HEAP ) { - heap = t->heap = R128_AGP_HEAP; - continue; - } else { - fprintf( stderr, "r128UploadTexImages: upload texture " - "failure on both local and AGP texture heaps, " - "sz=%d\n", - t->totalSize ); - return; - } - } + if ( !t->base.memBlock ) { + int heap; - r128SwapOutTexObj( rmesa, rmesa->TexObjList[heap].prev ); - t->memBlock = mmAllocMem( rmesa->texHeap[heap], - t->totalSize, 12, 0 ); + heap = driAllocateTexture( rmesa->texture_heaps, rmesa->nr_heaps, + (driTextureObject *) t ); + if ( heap == -1 ) { + UNLOCK_HARDWARE( rmesa ); + return; } /* Set the base offset of the texture image */ - t->bufAddr = rmesa->r128Screen->texOffset[heap] + t->memBlock->ofs; + t->bufAddr = rmesa->r128Screen->texOffset[heap] + + t->base.memBlock->ofs; /* Set texture offsets for each mipmap level */ if ( t->setup.tex_cntl & R128_MIP_MAP_DISABLE ) { @@ -556,37 +278,25 @@ t->setup.tex_offset[j] = t->bufAddr + t->image[i].offset; } } - - /* Force loading the new state into the hardware */ - switch ( t->bound ) { - case 1: - rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_TEX0; - break; - - case 2: - rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_TEX1; - break; - - default: - return; - } } - /* Let the world know we've used this memory recently */ - r128UpdateTexLRU( rmesa, t ); + /* Let the world know we've used this memory recently. + */ + driUpdateTextureLRU( (driTextureObject *) t ); + UNLOCK_HARDWARE( rmesa ); /* Upload any images that are new */ - if ( t->dirty_images ) { + if ( t->base.dirty_images[0] ) { for ( i = 0 ; i < numLevels; i++ ) { - const GLint j = t->firstLevel + i; /* the texObj's level */ - if ( t->dirty_images & (1 << j) ) { - r128UploadSubImage( rmesa, t, j, 0, 0, - t->image[i].width, t->image[i].height ); + const GLint j = t->base.firstLevel + i; /* the texObj's level */ + if ( t->base.dirty_images[0] & (1 << j) ) { + uploadSubImage( rmesa, t, j, 0, 0, + t->image[i].width, t->image[i].height ); } } rmesa->setup.tex_cntl_c |= R128_TEX_CACHE_FLUSH; rmesa->dirty |= R128_UPLOAD_CONTEXT; - t->dirty_images = 0; + t->base.dirty_images[0] = 0; } } Index: xc/lib/GL/mesa/src/drv/r128/r128_texobj.h diff -u xc/lib/GL/mesa/src/drv/r128/r128_texobj.h:1.5 xc/lib/GL/mesa/src/drv/r128/r128_texobj.h:1.6 --- xc/lib/GL/mesa/src/drv/r128/r128_texobj.h:1.5 Fri Feb 22 16:44:58 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_texobj.h Sun Sep 28 16:15:21 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texobj.h,v 1.5 2002/02/22 21:44:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texobj.h,v 1.6 2003/09/28 20:15:21 alanh Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -52,34 +52,18 @@ /* Texture object in locally shared texture space. */ struct r128_tex_obj { - r128TexObjPtr next, prev; + driTextureObject base; - struct gl_texture_object *tObj; /* Mesa texture object */ - - PMemBlock memBlock; /* Memory block containing texture */ CARD32 bufAddr; /* Offset to start of locally shared texture block */ - CARD32 dirty_images; /* Flags for whether or not - images need to be uploaded to - local or AGP texture space */ - GLuint age; - GLint bound; /* Texture unit currently bound to */ - GLint heap; /* Texture heap currently stored in */ r128TexImage image[R128_MAX_TEXTURE_LEVELS]; /* Image data for all mipmap levels */ - GLint totalSize; /* Total size of the texture - including all mipmap levels */ CARD32 textureFormat; /* Actual hardware format */ r128_texture_regs_t setup; /* Setup regs for texture */ - - /* texObj->Image[firstLevel] through texObj->Image[lastLevel] are the - * images to upload. - */ - GLint firstLevel, lastLevel; }; #endif /* _R128_TEXOBJ_H_ */ Index: xc/lib/GL/mesa/src/drv/r128/r128_texstate.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_texstate.c:1.1 xc/lib/GL/mesa/src/drv/r128/r128_texstate.c:1.4 --- xc/lib/GL/mesa/src/drv/r128/r128_texstate.c:1.1 Fri Feb 22 16:44:58 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_texstate.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texstate.c,v 1.1 2002/02/22 21:44:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texstate.c,v 1.4 2004/01/23 03:57:05 dawes Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -33,6 +33,12 @@ * Brian Paul */ +#include "glheader.h" +#include "imports.h" +#include "context.h" +#include "macros.h" +#include "texformat.h" + #include "r128_context.h" #include "r128_state.h" #include "r128_ioctl.h" @@ -40,11 +46,6 @@ #include "r128_tris.h" #include "r128_tex.h" -#include "context.h" -#include "macros.h" -#include "mem.h" -#include "texformat.h" - static void r128SetTexImages( r128ContextPtr rmesa, const struct gl_texture_object *tObj ) @@ -60,7 +61,7 @@ assert(baseImage); if ( R128_DEBUG & DEBUG_VERBOSE_API ) - fprintf( stderr, "%s( %p )\n", __FUNCTION__, tObj ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)tObj ); switch (baseImage->TexFormat->MesaFormat) { case MESA_FORMAT_ARGB8888: @@ -78,29 +79,29 @@ case MESA_FORMAT_CI8: t->textureFormat = R128_DATATYPE_CI8; break; + case MESA_FORMAT_YCBCR: + t->textureFormat = R128_DATATYPE_YVYU422; + break; + case MESA_FORMAT_YCBCR_REV: + t->textureFormat = R128_DATATYPE_VYUY422; + break; default: - _mesa_problem(rmesa->glCtx, "Bad texture format in r128SetTexImages"); + _mesa_problem(rmesa->glCtx, "Bad texture format in %s", __FUNCTION__); }; /* Compute which mipmap levels we really want to send to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. - * Yes, this looks overly complicated, but it's all needed. */ - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ + + driCalculateTextureFirstLastLevel( (driTextureObject *) t ); + firstLevel = t->base.firstLevel; + lastLevel = t->base.lastLevel; log2Pitch = tObj->Image[firstLevel]->WidthLog2; log2Height = tObj->Image[firstLevel]->HeightLog2; log2Size = MAX2(log2Pitch, log2Height); log2MinSize = log2Size; - t->dirty_images = 0; + t->base.dirty_images[0] = 0; totalSize = 0; for ( i = firstLevel; i <= lastLevel; i++ ) { const struct gl_texture_image *texImage; @@ -117,7 +118,7 @@ t->image[i - firstLevel].width = tObj->Image[i]->Width; t->image[i - firstLevel].height = tObj->Image[i]->Height; - t->dirty_images |= (1 << i); + t->base.dirty_images[0] |= (1 << i); totalSize += (tObj->Image[i]->Height * tObj->Image[i]->Width * @@ -127,9 +128,9 @@ totalSize = (totalSize + 31) & ~31; } - t->totalSize = totalSize; - t->firstLevel = firstLevel; - t->lastLevel = lastLevel; + t->base.totalSize = totalSize; + t->base.firstLevel = firstLevel; + t->base.lastLevel = lastLevel; /* Set the texture format */ t->setup.tex_cntl &= ~(0xf << 16); @@ -151,9 +152,7 @@ else t->setup.tex_cntl &= ~R128_MIP_MAP_DISABLE; - /* XXX this is done in r128EmitHwStateLocked(): - r128UploadTexImages( rmesa, t ); - */ + /* FYI: r128UploadTexImages( rmesa, t ); used to be called here */ } @@ -194,7 +193,7 @@ #define INPUT_PREVIOUS (R128_INPUT_FACTOR_PREV_COLOR | \ R128_INP_FACTOR_A_PREV_ALPHA) -static void r128UpdateTextureEnv( GLcontext *ctx, int unit ) +static GLboolean r128UpdateTextureEnv( GLcontext *ctx, int unit ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); GLint source = rmesa->tmu_source[unit]; @@ -205,7 +204,7 @@ if ( R128_DEBUG & DEBUG_VERBOSE_API ) { fprintf( stderr, "%s( %p, %d )\n", - __FUNCTION__, ctx, unit ); + __FUNCTION__, (void *)ctx, unit ); } if ( unit == 0 ) { @@ -235,7 +234,7 @@ break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; @@ -258,7 +257,7 @@ break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; @@ -282,7 +281,7 @@ break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; @@ -318,14 +317,13 @@ default: combine |= (COLOR_COMB_MODULATE | /* C = fallback */ ALPHA_COMB_MODULATE); /* A = fallback */ - FALLBACK( rmesa, R128_FALLBACK_TEXTURE, GL_TRUE ); - break; + return GL_FALSE; } break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; } @@ -334,7 +332,7 @@ * to software rendering. */ if ( rmesa->blend_flags ) { - FALLBACK( rmesa, R128_FALLBACK_TEXTURE, GL_TRUE ); + return GL_FALSE; } switch ( format ) { case GL_RGBA: @@ -359,8 +357,7 @@ default: combine |= (COLOR_COMB_MODULATE | /* C = fallback */ ALPHA_COMB_MODULATE); /* A = fallback */ - FALLBACK( rmesa, R128_FALLBACK_TEXTURE, GL_TRUE ); - break; + return GL_FALSE; } break; case GL_RGB: @@ -385,8 +382,7 @@ default: combine |= (COLOR_COMB_MODULATE | /* C = fallback */ ALPHA_COMB_COPY_INPUT); /* A = fallback */ - FALLBACK( rmesa, R128_FALLBACK_TEXTURE, GL_TRUE ); - break; + return GL_FALSE; } break; case GL_ALPHA: @@ -416,8 +412,7 @@ default: combine |= (COLOR_COMB_MODULATE | /* C = fallback */ ALPHA_COMB_MODULATE); /* A = fallback */ - FALLBACK( rmesa, R128_FALLBACK_TEXTURE, GL_TRUE ); - break; + return GL_FALSE; } switch ( rmesa->env_color & 0xff000000 ) { case 0x00000000: @@ -436,13 +431,12 @@ default: combine |= (COLOR_COMB_MODULATE | /* C = fallback */ ALPHA_COMB_MODULATE); /* A = fallback */ - FALLBACK( rmesa, R128_FALLBACK_TEXTURE, GL_TRUE ); - break; + return GL_FALSE; } break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; @@ -468,130 +462,185 @@ break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; default: - return; + return GL_FALSE; + } + + if ( rmesa->tex_combine[unit] != combine ) { + rmesa->tex_combine[unit] = combine; + rmesa->dirty |= R128_UPLOAD_TEX0 << unit; + } + return GL_TRUE; +} + +static void disable_tex( GLcontext *ctx, int unit ) +{ + r128ContextPtr rmesa = R128_CONTEXT(ctx); + + FLUSH_BATCH( rmesa ); + + if ( rmesa->CurrentTexObj[unit] ) { + rmesa->CurrentTexObj[unit]->base.bound &= ~(1 << unit); + rmesa->CurrentTexObj[unit] = NULL; } - rmesa->tex_combine[unit] = combine; + rmesa->setup.tex_cntl_c &= ~(R128_TEXMAP_ENABLE << unit); + rmesa->setup.tex_size_pitch_c &= ~(R128_TEX_SIZE_PITCH_MASK << + (R128_SEC_TEX_SIZE_PITCH_SHIFT * unit)); + rmesa->dirty |= R128_UPLOAD_CONTEXT; + + /* If either texture unit is disabled, then multitexturing is not + * happening. + */ + + rmesa->blend_flags &= ~R128_BLEND_MULTITEX; } -static void r128UpdateTextureUnit( GLcontext *ctx, int unit ) +static GLboolean enable_tex_2d( GLcontext *ctx, int unit ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); const int source = rmesa->tmu_source[unit]; const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source]; - const struct gl_texture_object *tObj = ctx->Texture.Unit[source]._Current; - r128TexObjPtr t = tObj->DriverData; + const struct gl_texture_object *tObj = texUnit->_Current; + r128TexObjPtr t = (r128TexObjPtr) tObj->DriverData; - assert(unit == 0 || unit == 1); /* only two tex units */ + /* Need to load the 2d images associated with this unit. + */ + if ( t->base.dirty_images[0] ) { + /* FIXME: For Radeon, RADEON_FIREVERTICES is called here. Should + * FIXME: something similar be done for R128? + */ + /* FLUSH_BATCH( rmesa ); */ - if (texUnit->_ReallyEnabled & (TEXTURE0_1D | TEXTURE0_2D)) { + r128SetTexImages( rmesa, tObj ); + r128UploadTexImages( rmesa, t ); + if ( !t->base.memBlock ) + return GL_FALSE; + } - assert(t); /* should have driver tex data by now */ + return GL_TRUE; +} - /* Fallback if there's a texture border */ - if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) { - FALLBACK( rmesa, R128_FALLBACK_TEXTURE, GL_TRUE ); - return; - } +static GLboolean update_tex_common( GLcontext *ctx, int unit ) +{ + r128ContextPtr rmesa = R128_CONTEXT(ctx); + const int source = rmesa->tmu_source[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source]; + const struct gl_texture_object *tObj = texUnit->_Current; + r128TexObjPtr t = (r128TexObjPtr) tObj->DriverData; - /* Upload teximages */ - if (t->dirty_images) { - r128SetTexImages( rmesa, tObj ); - } - /* Bind to the given texture unit */ - rmesa->CurrentTexObj[unit] = t; - t->bound |= (1 << unit); + /* Fallback if there's a texture border */ + if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) { + return GL_FALSE; + } - if ( t->memBlock ) - r128UpdateTexLRU( rmesa, t ); - /* register setup */ - if ( unit == 0 ) { - rmesa->setup.tex_cntl_c |= R128_TEXMAP_ENABLE; - rmesa->setup.tex_size_pitch_c |= t->setup.tex_size_pitch << 0; - rmesa->setup.scale_3d_cntl &= ~R128_TEX_CACHE_SPLIT; - t->setup.tex_cntl &= ~R128_SEC_SELECT_SEC_ST; - } - else { - rmesa->setup.tex_cntl_c |= R128_SEC_TEXMAP_ENABLE; - rmesa->setup.tex_size_pitch_c |= t->setup.tex_size_pitch << 16; - rmesa->setup.scale_3d_cntl |= R128_TEX_CACHE_SPLIT; - t->setup.tex_cntl |= R128_SEC_SELECT_SEC_ST; + /* Update state if this is a different texture object to last + * time. + */ + if ( rmesa->CurrentTexObj[unit] != t ) { + if ( rmesa->CurrentTexObj[unit] != NULL ) { + /* The old texture is no longer bound to this texture unit. + * Mark it as such. + */ + + rmesa->CurrentTexObj[unit]->base.bound &= + ~(1UL << unit); } + + rmesa->CurrentTexObj[unit] = t; + t->base.bound |= (1UL << unit); + rmesa->dirty |= R128_UPLOAD_TEX0 << unit; + + driUpdateTextureLRU( (driTextureObject *) t ); /* XXX: should be locked! */ } - else if (texUnit->_ReallyEnabled) { - /* 3D or cube map texture enabled - fallback */ - FALLBACK( rmesa, R128_FALLBACK_TEXTURE, GL_TRUE ); + + /* FIXME: We need to update the texture unit if any texture parameters have + * changed, but this texture was already bound. This could be changed to + * work like the Radeon driver where the texture object has it's own + * dirty state flags + */ + rmesa->dirty |= R128_UPLOAD_TEX0 << unit; + + /* register setup */ + rmesa->setup.tex_size_pitch_c &= ~(R128_TEX_SIZE_PITCH_MASK << + (R128_SEC_TEX_SIZE_PITCH_SHIFT * unit)); + + if ( unit == 0 ) { + rmesa->setup.tex_cntl_c |= R128_TEXMAP_ENABLE; + rmesa->setup.tex_size_pitch_c |= t->setup.tex_size_pitch << 0; + rmesa->setup.scale_3d_cntl &= ~R128_TEX_CACHE_SPLIT; + t->setup.tex_cntl &= ~R128_SEC_SELECT_SEC_ST; } else { - /* texture unit disabled */ + rmesa->setup.tex_cntl_c |= R128_SEC_TEXMAP_ENABLE; + rmesa->setup.tex_size_pitch_c |= t->setup.tex_size_pitch << 16; + rmesa->setup.scale_3d_cntl |= R128_TEX_CACHE_SPLIT; + t->setup.tex_cntl |= R128_SEC_SELECT_SEC_ST; + + /* If the second TMU is enabled, then multitexturing is happening. + */ + if ( R128_IS_PLAIN( rmesa ) ) + rmesa->blend_flags |= R128_BLEND_MULTITEX; } -} + rmesa->dirty |= R128_UPLOAD_CONTEXT; -void r128UpdateTextureState( GLcontext *ctx ) + + /* FIXME: The Radeon has some cached state so that it can avoid calling + * FIXME: UpdateTextureEnv in some cases. Is that possible here? + */ + return r128UpdateTextureEnv( ctx, unit ); +} + +static GLboolean updateTextureUnit( GLcontext *ctx, int unit ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); + const int source = rmesa->tmu_source[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source]; - if ( R128_DEBUG & DEBUG_VERBOSE_API ) { - fprintf( stderr, "%s( %p ) enabled=0x%x\n", - __FUNCTION__, ctx, ctx->Texture._ReallyEnabled ); + + if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) { + return (enable_tex_2d( ctx, unit ) && + update_tex_common( ctx, unit )); } + else if ( texUnit->_ReallyEnabled ) { + return GL_FALSE; + } + else { + disable_tex( ctx, unit ); + return GL_TRUE; + } +} - /* Clear any texturing fallbacks */ - FALLBACK( rmesa, R128_FALLBACK_TEXTURE, GL_FALSE ); - /* Unbind any currently bound textures */ - if ( rmesa->CurrentTexObj[0] ) rmesa->CurrentTexObj[0]->bound = 0; - if ( rmesa->CurrentTexObj[1] ) rmesa->CurrentTexObj[1]->bound = 0; - rmesa->CurrentTexObj[0] = NULL; - rmesa->CurrentTexObj[1] = NULL; - - /* Disable all texturing until it is known to be good */ - rmesa->setup.tex_cntl_c &= ~(R128_TEXMAP_ENABLE | - R128_SEC_TEXMAP_ENABLE); - rmesa->setup.tex_size_pitch_c = 0x00000000; +void r128UpdateTextureState( GLcontext *ctx ) +{ + r128ContextPtr rmesa = R128_CONTEXT(ctx); + GLboolean ok; + - /* - * Now examine texture enable state to do rest of setup. + /* This works around a quirk with the R128 hardware. If only OpenGL + * TEXTURE1 is enabled, then the hardware TEXTURE0 must be used. The + * hardware TEXTURE1 can ONLY be used when hardware TEXTURE0 is also used. */ + rmesa->tmu_source[0] = 0; rmesa->tmu_source[1] = 1; - rmesa->blend_flags &= ~R128_BLEND_MULTITEX; - if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY) { - if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) { - /* both texture 0 and 1 enabled */ - if ( R128_IS_PLAIN( rmesa ) ) - rmesa->blend_flags |= R128_BLEND_MULTITEX; - r128UpdateTextureUnit( ctx, 0 ); - r128UpdateTextureEnv( ctx, 0 ); - r128UpdateTextureUnit( ctx, 1 ); - r128UpdateTextureEnv( ctx, 1 ); - rmesa->dirty |= (R128_UPLOAD_TEX0IMAGES | R128_UPLOAD_TEX0 | - R128_UPLOAD_TEX1IMAGES | R128_UPLOAD_TEX1); - } - else { - /* only texture 1 enabled */ - rmesa->tmu_source[0] = 1; - rmesa->tmu_source[1] = 0; - r128UpdateTextureUnit( ctx, 0 ); - r128UpdateTextureEnv( ctx, 0 ); - rmesa->dirty |= (R128_UPLOAD_TEX0IMAGES | R128_UPLOAD_TEX0); - } - } - else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) { - /* only texture 0 enabled */ - r128UpdateTextureUnit( ctx, 0 ); - r128UpdateTextureEnv( ctx, 0 ); - rmesa->dirty |= (R128_UPLOAD_TEX0IMAGES | R128_UPLOAD_TEX0); + if ((ctx->Texture._EnabledUnits & 0x03) == 0x02) { + /* only texture 1 enabled */ + rmesa->tmu_source[0] = 1; + rmesa->tmu_source[1] = 0; } - rmesa->dirty |= R128_UPLOAD_CONTEXT; + ok = (updateTextureUnit( ctx, 0 ) && + updateTextureUnit( ctx, 1 )); + + FALLBACK( rmesa, R128_FALLBACK_TEXTURE, !ok ); } Index: xc/lib/GL/mesa/src/drv/r128/r128_tris.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_tris.c:1.8 xc/lib/GL/mesa/src/drv/r128/r128_tris.c:1.9 --- xc/lib/GL/mesa/src/drv/r128/r128_tris.c:1.8 Wed Oct 30 07:51:43 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_tris.c Sun Sep 28 16:15:21 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v 1.8 2002/10/30 12:51:43 alanh Exp $ */ /* -*- c-basic-offset: 3 -*- */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v 1.9 2003/09/28 20:15:21 alanh Exp $ */ /* -*- c-basic-offset: 3 -*- */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -33,9 +33,6 @@ * */ -#include -#include - #include "glheader.h" #include "mtypes.h" #include "colormac.h" @@ -586,7 +583,7 @@ { r128ContextPtr rmesa = R128_CONTEXT(ctx); - if (rmesa->new_state) + if (rmesa->new_state || rmesa->NewGLState & _NEW_TEXTURE) r128DDUpdateHWState( ctx ); if (!rmesa->Fallback && rmesa->NewGLState) { @@ -702,6 +699,7 @@ void r128InitTriFuncs( GLcontext *ctx ) { + r128ContextPtr rmesa = R128_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); static int firsttime = 1; @@ -716,6 +714,8 @@ tnl->Driver.Render.PrimitiveNotify = r128RenderPrimitive; tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; tnl->Driver.Render.BuildVertices = r128BuildVertices; + rmesa->NewGLState |= (_R128_NEW_RENDER_STATE| + _R128_NEW_VERTEX_STATE); /* r128Fallback( ctx, 0x100000, 1 ); */ } Index: xc/lib/GL/mesa/src/drv/r128/r128_vb.c diff -u xc/lib/GL/mesa/src/drv/r128/r128_vb.c:1.15 xc/lib/GL/mesa/src/drv/r128/r128_vb.c:1.17 --- xc/lib/GL/mesa/src/drv/r128/r128_vb.c:1.15 Wed Oct 30 07:51:43 2002 +++ xc/lib/GL/mesa/src/drv/r128/r128_vb.c Sun Sep 28 16:15:22 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.c,v 1.15 2002/10/30 12:51:43 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_vb.c,v 1.17 2003/09/28 20:15:22 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -35,10 +35,9 @@ #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "colormac.h" -#include "mmath.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" @@ -362,6 +361,9 @@ tnl->Driver.Render.Interp = setup_tab[rmesa->SetupIndex].interp; tnl->Driver.Render.CopyPV = setup_tab[rmesa->SetupIndex].copy_pv; } + if (rmesa->Fallback) { + tnl->Driver.Render.Start(ctx); + } } } @@ -380,24 +382,24 @@ if (!newinputs) return; - if (newinputs & VERT_CLIP) { + if (newinputs & VERT_BIT_CLIP) { setup_tab[rmesa->SetupIndex].emit( ctx, start, count, v, stride ); } else { GLuint ind = 0; - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) ind |= R128_RGBA_BIT; - if (newinputs & VERT_SPEC_RGB) + if (newinputs & VERT_BIT_COLOR1) ind |= R128_SPEC_BIT; - if (newinputs & VERT_TEX0) + if (newinputs & VERT_BIT_TEX0) ind |= R128_TEX0_BIT; - if (newinputs & VERT_TEX1) + if (newinputs & VERT_BIT_TEX1) ind |= R128_TEX1_BIT; - if (newinputs & VERT_FOG_COORD) + if (newinputs & VERT_BIT_FOG) ind |= R128_FOG_BIT; if (rmesa->SetupIndex & R128_PTEX_BIT) @@ -423,7 +425,7 @@ if (ctx->Fog.Enabled) ind |= R128_FOG_BIT; - if (ctx->Texture._ReallyEnabled) { + if (ctx->Texture._EnabledUnits) { ind |= R128_TEX0_BIT; if (ctx->Texture.Unit[0]._ReallyEnabled && ctx->Texture.Unit[1]._ReallyEnabled) @@ -490,7 +492,7 @@ r128ContextPtr rmesa = R128_CONTEXT(ctx); GLuint size = TNL_CONTEXT(ctx)->vb.Size; - rmesa->verts = (char *)ALIGN_MALLOC(size * 4 * 16, 32); + rmesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32); { static int firsttime = 1; Index: xc/lib/GL/mesa/src/drv/r200/Imakefile diff -u xc/lib/GL/mesa/src/drv/r200/Imakefile:1.2 xc/lib/GL/mesa/src/drv/r200/Imakefile:1.3 --- xc/lib/GL/mesa/src/drv/r200/Imakefile:1.2 Mon Nov 25 09:04:51 2002 +++ xc/lib/GL/mesa/src/drv/r200/Imakefile Fri Nov 7 19:18:39 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r200/Imakefile,v 1.2 2002/11/25 14:04:51 eich Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r200/Imakefile,v 1.3 2003/11/08 00:18:39 dawes Exp $ #include @@ -75,5 +75,9 @@ #endif #endif +#ifdef i386Architecture +ObjectFromAsmSource(r200_vtxtmp_x86, NullParameter) +#endif + DependTarget() Index: xc/lib/GL/mesa/src/drv/r200/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/r200/Imakefile.inc:1.2 xc/lib/GL/mesa/src/drv/r200/Imakefile.inc:1.3 --- xc/lib/GL/mesa/src/drv/r200/Imakefile.inc:1.2 Fri Nov 29 09:41:33 2002 +++ xc/lib/GL/mesa/src/drv/r200/Imakefile.inc Tue May 27 12:34:34 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r200/Imakefile.inc,v 1.2 2002/11/29 14:41:33 eich Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r200/Imakefile.inc,v 1.3 2003/05/27 16:34:34 tsi Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=ByteOrder + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ Index: xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c:1.1 xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c:1.1 Wed Oct 30 07:51:51 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c Sun Sep 28 16:15:22 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c,v 1.1 2002/10/30 12:51:51 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_cmdbuf.c,v 1.2 2003/09/28 20:15:22 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -32,6 +32,13 @@ * Keith Whitwell */ +#include "glheader.h" +#include "imports.h" +#include "macros.h" +#include "context.h" +#include "swrast/swrast.h" +#include "simple_list.h" + #include "r200_context.h" #include "r200_state.h" #include "r200_ioctl.h" @@ -39,12 +46,6 @@ #include "r200_sanity.h" #include "radeon_reg.h" -#include "mem.h" -#include "macros.h" -#include "context.h" -#include "swrast/swrast.h" -#include "simple_list.h" - static void print_state_atom( struct r200_state_atom *state ) { int i; @@ -131,13 +132,6 @@ R200_VF_PRIM_WALK_LIST | R200_VF_COLOR_ORDER_RGBA | (vertex_nr << R200_VF_VERTEX_NUMBER_SHIFT)); - - - if (R200_DEBUG & DEBUG_SYNC) { - fprintf(stderr, "\nSyncing\n\n"); - R200_FIREVERTICES( rmesa ); - r200Finish( rmesa->glCtx ); - } } @@ -162,8 +156,7 @@ cmd[2] |= nr << R200_VF_VERTEX_NUMBER_SHIFT; if (R200_DEBUG & DEBUG_SYNC) { - fprintf(stderr, "\nSyncing in %s\n\n", __FUNCTION__); - R200_FIREVERTICES( rmesa ); + fprintf(stderr, "%s: Syncing\n", __FUNCTION__); r200Finish( rmesa->glCtx ); } } @@ -202,6 +195,7 @@ cmd[1].i, primitive); assert(!rmesa->dma.flush); + rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; rmesa->dma.flush = r200FlushElts; rmesa->store.elts_start = ((char *)cmd) - rmesa->store.cmd_buf; Index: xc/lib/GL/mesa/src/drv/r200/r200_context.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_context.c:1.2 xc/lib/GL/mesa/src/drv/r200/r200_context.c:1.6 --- xc/lib/GL/mesa/src/drv/r200/r200_context.c:1.2 Mon Dec 16 11:18:53 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_context.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.c,v 1.2 2002/12/16 16:18:53 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.c,v 1.6 2004/01/23 03:57:05 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,13 +25,29 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ +#include "glheader.h" +#include "api_arrayelt.h" +#include "context.h" +#include "simple_list.h" +#include "imports.h" +#include "matrix.h" +#include "extensions.h" +#include "state.h" + +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "array_cache/acache.h" + +#include "tnl/tnl.h" +#include "tnl/t_pipeline.h" #include "r200_context.h" #include "r200_ioctl.h" @@ -44,28 +60,10 @@ #include "r200_vtxfmt.h" #include "r200_maos.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "array_cache/acache.h" - -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - -#include "attrib.h" -#include "api_arrayelt.h" -#include "context.h" -#include "simple_list.h" -#include "mem.h" -#include "matrix.h" -#include "state.h" -#include "extensions.h" -#include "state.h" -#if defined(USE_X86_ASM) -#include "X86/common_x86_asm.h" -#endif - -#define R200_DATE "20020827" +#define DRIVER_DATE "20030328" +#include "vblank.h" +#include "utils.h" #ifndef R200_DEBUG int R200_DEBUG = (0); #endif @@ -92,60 +90,21 @@ { r200ContextPtr rmesa = R200_CONTEXT(ctx); static char buffer[128]; + unsigned offset; + GLuint agp_mode = rmesa->r200Screen->IsPCI ? 0 : + rmesa->r200Screen->AGPMode; switch ( name ) { case GL_VENDOR: return (GLubyte *)"Tungsten Graphics, Inc."; case GL_RENDERER: - sprintf( buffer, "Mesa DRI R200 " R200_DATE); + offset = driGetRendererString( buffer, "R200", DRIVER_DATE, + agp_mode ); - /* Append any chipset-specific information. None yet. - */ - - /* Append any AGP-specific information. - */ - switch ( rmesa->r200Screen->AGPMode ) { - case 1: - strncat( buffer, " AGP 1x", 7 ); - break; - case 2: - strncat( buffer, " AGP 2x", 7 ); - break; - case 4: - strncat( buffer, " AGP 4x", 7 ); - break; - } - - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - } -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif -#endif - - if ( !(rmesa->TclFallback & R200_TCL_FALLBACK_TCL_DISABLE) ) { - strncat( buffer, " TCL", 4 ); - } - else { - strncat( buffer, " NO-TCL", 7 ); - } + sprintf( & buffer[ offset ], " %sTCL", + !(rmesa->TclFallback & R200_TCL_FALLBACK_TCL_DISABLE) + ? "" : "NO-" ); return (GLubyte *)buffer; @@ -155,36 +114,41 @@ } - -/* Initialize the extensions supported by this driver. +/* Extension strings exported by the R200 driver. */ -static void r200InitExtensions( GLcontext *ctx ) +static const char * const card_extensions[] = { - _mesa_enable_imaging_extensions( ctx ); - - _mesa_enable_extension( ctx, "GL_ARB_multitexture" ); - _mesa_enable_extension( ctx, "GL_ARB_texture_env_add" ); - _mesa_enable_extension( ctx, "GL_ARB_texture_env_combine" ); - _mesa_enable_extension( ctx, "GL_ARB_texture_env_dot3" ); - - _mesa_enable_extension( ctx, "GL_EXT_blend_logic_op" ); - _mesa_enable_extension( ctx, "GL_EXT_stencil_wrap" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_env_add" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_env_combine" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_env_dot3" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_filter_anisotropic" ); - _mesa_enable_extension( ctx, "GL_EXT_texture_lod_bias" ); - _mesa_enable_extension( ctx, "GL_EXT_secondary_color" ); - _mesa_enable_extension( ctx, "GL_EXT_blend_subtract" ); - _mesa_enable_extension( ctx, "GL_EXT_blend_minmax" ); - -/* _mesa_enable_extension( ctx, "GL_EXT_fog_coord" ); */ - - _mesa_enable_extension( ctx, "GL_MESA_pack_invert" ); - _mesa_enable_extension( ctx, "GL_MESA_ycbcr_texture" ); - _mesa_enable_extension( ctx, "GL_NV_texture_rectangle" ); - -} + "GL_ARB_multisample", + "GL_ARB_multitexture", + "GL_ARB_texture_border_clamp", + "GL_ARB_texture_compression", + "GL_ARB_texture_env_add", + "GL_ARB_texture_env_combine", + "GL_ARB_texture_env_dot3", + "GL_ARB_texture_mirrored_repeat", + "GL_EXT_blend_logic_op", + "GL_EXT_blend_minmax", + "GL_EXT_blend_subtract", + "GL_EXT_secondary_color", + "GL_EXT_stencil_wrap", + "GL_EXT_texture_edge_clamp", + "GL_EXT_texture_env_add", + "GL_EXT_texture_env_combine", + "GL_EXT_texture_env_dot3", + "GL_EXT_texture_filter_anisotropic", + "GL_EXT_texture_lod_bias", + "GL_ATI_texture_env_combine3", + "GL_ATI_texture_mirror_once", + "GL_IBM_texture_mirrored_repeat", + "GL_MESA_pack_invert", + "GL_MESA_ycbcr_texture", + "GL_NV_blend_square", + "GL_NV_texture_rectangle", + "GL_SGIS_generate_mipmap", + "GL_SGIS_texture_border_clamp", + "GL_SGIS_texture_edge_clamp", + NULL +}; extern const struct gl_pipeline_stage _r200_render_stage; extern const struct gl_pipeline_stage _r200_tcl_stage; @@ -216,7 +180,7 @@ /* Else do them here. */ - &_r200_render_stage, +/* &_r200_render_stage, */ /* FIXME: bugs with ut2003 */ &_tnl_render_stage, /* FALLBACK: */ 0, }; @@ -236,67 +200,51 @@ ctx->Driver.Bitmap = NULL; } -static void add_debug_flags( const char *debug ) +static const struct dri_debug_control debug_control[] = { - if (strstr(debug, "fall")) - R200_DEBUG |= DEBUG_FALLBACKS; - - if (strstr(debug, "tex")) - R200_DEBUG |= DEBUG_TEXTURE; - - if (strstr(debug, "ioctl")) - R200_DEBUG |= DEBUG_IOCTL; - - if (strstr(debug, "prim")) - R200_DEBUG |= DEBUG_PRIMS; - - if (strstr(debug, "vert")) - R200_DEBUG |= DEBUG_VERTS; - - if (strstr(debug, "state")) - R200_DEBUG |= DEBUG_STATE; - - if (strstr(debug, "code")) - R200_DEBUG |= DEBUG_CODEGEN; - - if (strstr(debug, "vfmt") || strstr(debug, "vtxf")) - R200_DEBUG |= DEBUG_VFMT; - - if (strstr(debug, "verb")) - R200_DEBUG |= DEBUG_VERBOSE; - - if (strstr(debug, "dri")) - R200_DEBUG |= DEBUG_DRI; - - if (strstr(debug, "dma")) - R200_DEBUG |= DEBUG_DMA; - - if (strstr(debug, "san")) - R200_DEBUG |= DEBUG_SANITY; + { "fall", DEBUG_FALLBACKS }, + { "tex", DEBUG_TEXTURE }, + { "ioctl", DEBUG_IOCTL }, + { "prim", DEBUG_PRIMS }, + { "vert", DEBUG_VERTS }, + { "state", DEBUG_STATE }, + { "code", DEBUG_CODEGEN }, + { "vfmt", DEBUG_VFMT }, + { "vtxf", DEBUG_VFMT }, + { "verb", DEBUG_VERBOSE }, + { "dri", DEBUG_DRI }, + { "dma", DEBUG_DMA }, + { "san", DEBUG_SANITY }, + { "sync", DEBUG_SYNC }, + { "pix", DEBUG_PIXEL }, + { "mem", DEBUG_MEMORY }, + { NULL, 0 } +}; - if (strstr(debug, "sync")) - R200_DEBUG |= DEBUG_SYNC; - if (strstr(debug, "pix")) - R200_DEBUG |= DEBUG_PIXEL; +static int +get_ust_nop( int64_t * ust ) +{ + *ust = 1; + return 0; } + /* Create the device specific context. */ -GLboolean r200CreateContext( Display *dpy, const __GLcontextModes *glVisual, +GLboolean r200CreateContext( const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate) { __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - r200ScreenPtr r200Screen = (r200ScreenPtr)(sPriv->private); + r200ScreenPtr screen = (r200ScreenPtr)(sPriv->private); r200ContextPtr rmesa; GLcontext *ctx, *shareCtx; int i; - assert(dpy); assert(glVisual); assert(driContextPriv); - assert(r200Screen); + assert(screen); /* Allocate the R200 context */ rmesa = (r200ContextPtr) CALLOC( sizeof(*rmesa) ); @@ -308,7 +256,7 @@ shareCtx = ((r200ContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, rmesa, GL_TRUE); + rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) rmesa, GL_TRUE); if (!rmesa->glCtx) { FREE(rmesa); return GL_FALSE; @@ -316,7 +264,6 @@ driContextPriv->driverPrivate = rmesa; /* Init r200 context data */ - rmesa->dri.display = dpy; rmesa->dri.context = driContextPriv; rmesa->dri.screen = sPriv; rmesa->dri.drawable = NULL; /* Set by XMesaMakeCurrent */ @@ -325,44 +272,55 @@ rmesa->dri.fd = sPriv->fd; rmesa->dri.drmMinor = sPriv->drmMinor; - rmesa->r200Screen = r200Screen; + rmesa->r200Screen = screen; rmesa->sarea = (RADEONSAREAPrivPtr)((GLubyte *)sPriv->pSAREA + - r200Screen->sarea_priv_offset); + screen->sarea_priv_offset); rmesa->dma.buf0_address = rmesa->r200Screen->buffers->list[0].address; - for ( i = 0 ; i < r200Screen->numTexHeaps ; i++ ) { - make_empty_list( &rmesa->texture.objects[i] ); - rmesa->texture.heap[i] = mmInit( 0, r200Screen->texSize[i] ); - rmesa->texture.age[i] = -1; + (void) memset( rmesa->texture_heaps, 0, sizeof( rmesa->texture_heaps ) ); + make_empty_list( & rmesa->swapped ); + + rmesa->nr_heaps = 1 /* screen->numTexHeaps */ ; + for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { + rmesa->texture_heaps[i] = driCreateTextureHeap( i, rmesa, + screen->texSize[i], + 12, + RADEON_NR_TEX_REGIONS, + rmesa->sarea->texList[i], + & rmesa->sarea->texAge[i], + & rmesa->swapped, + sizeof( r200TexObj ), + (destroy_texture_object_t *) r200DestroyTexObj ); } - rmesa->texture.numHeaps = r200Screen->numTexHeaps; - make_empty_list( &rmesa->texture.swapped ); rmesa->swtcl.RenderIndex = ~0; rmesa->lost_context = 1; - /* KW: Set the maximum texture size small enough that we can - * guarentee that both texture units can bind a maximal texture - * and have them both in on-card memory at once. - * Test for 2 textures * 4 bytes/texel * size * size. + /* Set the maximum texture size small enough that we can guarentee that + * all texture units can bind a maximal texture and have them both in + * texturable memory at once. */ - ctx = rmesa->glCtx; - if (r200Screen->texSize[RADEON_CARD_HEAP] >= 2 * 4 * 2048 * 2048) { - ctx->Const.MaxTextureLevels = 12; /* 2048x2048 */ - } - else if (r200Screen->texSize[RADEON_CARD_HEAP] >= 2 * 4 * 1024 * 1024) { - ctx->Const.MaxTextureLevels = 11; /* 1024x1024 */ - } - else if (r200Screen->texSize[RADEON_CARD_HEAP] >= 2 * 4 * 512 * 512) { - ctx->Const.MaxTextureLevels = 10; /* 512x512 */ - } - else { - ctx->Const.MaxTextureLevels = 9; /* 256x256 */ - } + ctx = rmesa->glCtx; ctx->Const.MaxTextureUnits = 2; + + driCalculateMaxTextureLevels( rmesa->texture_heaps, + rmesa->nr_heaps, + & ctx->Const, + 4, + 11, /* max 2D texture size is 2048x2048 */ +#if ENABLE_HW_3D_TEXTURE + 8, /* max 3D texture size is 256^3 */ +#else + 0, /* 3D textures unsupported */ +#endif + 11, /* max cube texture size is 2048x2048 */ + 11, /* max texture rectangle size is 2048x2048 */ + 12, + GL_FALSE ); + ctx->Const.MaxTextureMaxAnisotropy = 16.0; /* No wide points. @@ -378,7 +336,6 @@ ctx->Const.MaxLineWidthAA = 10.0; ctx->Const.LineWidthGranularity = 0.0625; - /* Initialize the software rasterizer and helper modules. */ _swrast_CreateContext( ctx ); @@ -391,6 +348,7 @@ */ _tnl_destroy_pipeline( ctx ); _tnl_install_pipeline( ctx, r200_pipeline ); + ctx->Driver.FlushVertices = r200FlushVertices; /* Try and keep materials and vertices separate: */ @@ -410,7 +368,10 @@ _math_matrix_set_identity( &rmesa->TexGenMatrix[1] ); _math_matrix_set_identity( &rmesa->tmpmat ); - r200InitExtensions( ctx ); + driInitExtensions( ctx, card_extensions, GL_TRUE ); + if (rmesa->r200Screen->drmSupportsCubeMaps) + _mesa_enable_extension( ctx, "GL_ARB_texture_cube_map" ); + r200InitDriverFuncs( ctx ); r200InitIoctlFuncs( ctx ); r200InitStateFuncs( ctx ); @@ -435,15 +396,26 @@ rmesa->do_usleeps = !getenv("R200_NO_USLEEPS"); - rmesa->prefer_agp_client_texturing = - (getenv("R200_AGP_CLIENT_TEXTURES") != 0); - + + rmesa->vblank_flags = (rmesa->r200Screen->irq != 0) + ? driGetDefaultVBlankFlags() : VBLANK_FLAG_NO_IRQ; + + rmesa->prefer_gart_client_texturing = + (getenv("R200_GART_CLIENT_TEXTURES") != 0); + rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); + if ( rmesa->get_ust == NULL ) { + rmesa->get_ust = get_ust_nop; + } + + (*rmesa->get_ust)( & rmesa->swap_ust ); + + #if DO_DEBUG - if (getenv("R200_DEBUG")) - add_debug_flags( getenv("R200_DEBUG") ); - if (getenv("RADEON_DEBUG")) - add_debug_flags( getenv("RADEON_DEBUG") ); + R200_DEBUG = driParseDebugString( getenv( "R200_DEBUG" ), + debug_control ); + R200_DEBUG |= driParseDebugString( getenv( "RADEON_DEBUG" ), + debug_control ); #endif if (getenv("R200_NO_RAST")) { @@ -483,33 +455,16 @@ /* Free r200 context resources */ assert(rmesa); /* should never be null */ if ( rmesa ) { - if (rmesa->glCtx->Shared->RefCount == 1) { - /* This share group is about to go away, free our private - * texture object data. - */ - r200TexObjPtr t, next_t; - int i; - - for ( i = 0 ; i < rmesa->texture.numHeaps ; i++ ) { - foreach_s ( t, next_t, &rmesa->texture.objects[i] ) { - r200DestroyTexObj( rmesa, t ); - } - mmDestroy( rmesa->texture.heap[i] ); - rmesa->texture.heap[i] = NULL; - } + GLboolean release_texture_heaps; - foreach_s ( t, next_t, &rmesa->texture.swapped ) { - r200DestroyTexObj( rmesa, t ); - } - } + release_texture_heaps = (rmesa->glCtx->Shared->RefCount == 1); _swsetup_DestroyContext( rmesa->glCtx ); _tnl_DestroyContext( rmesa->glCtx ); _ac_DestroyContext( rmesa->glCtx ); _swrast_DestroyContext( rmesa->glCtx ); r200DestroySwtcl( rmesa->glCtx ); - r200ReleaseArrays( rmesa->glCtx, ~0 ); if (rmesa->dma.current.buf) { @@ -530,6 +485,20 @@ rmesa->state.scissor.pClipRects = 0; } + if ( release_texture_heaps ) { + /* This share group is about to go away, free our private + * texture object data. + */ + int i; + + for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { + driDestroyTextureHeap( rmesa->texture_heaps[ i ] ); + rmesa->texture_heaps[ i ] = NULL; + } + + assert( is_empty_list( & rmesa->swapped ) ); + } + FREE( rmesa ); } } @@ -538,19 +507,15 @@ void -r200SwapBuffers(Display *dpy, void *drawablePrivate) +r200SwapBuffers( __DRIdrawablePrivate *dPriv ) { - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - (void) dpy; - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { r200ContextPtr rmesa; GLcontext *ctx; rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate; ctx = rmesa->glCtx; if (ctx->Visual.doubleBufferMode) { - _mesa_swapbuffers( ctx ); /* flush pending rendering comands */ - + _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ if ( rmesa->doPageFlip ) { r200PageFlip( dPriv ); } @@ -561,7 +526,7 @@ } else { /* XXX this shouldn't be an error but we can't handle it for now */ - _mesa_problem(NULL, "r200SwapBuffers: drawable has no context!\n"); + _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__); } } @@ -575,32 +540,32 @@ __DRIdrawablePrivate *driReadPriv ) { if ( driContextPriv ) { - r200ContextPtr newR200Ctx = + r200ContextPtr newCtx = (r200ContextPtr) driContextPriv->driverPrivate; if (R200_DEBUG & DEBUG_DRI) - fprintf(stderr, "%s ctx %p\n", __FUNCTION__, newR200Ctx->glCtx); + fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)newCtx->glCtx); - if ( newR200Ctx->dri.drawable != driDrawPriv ) { - newR200Ctx->dri.drawable = driDrawPriv; - r200UpdateWindow( newR200Ctx->glCtx ); - r200UpdateViewportOffset( newR200Ctx->glCtx ); + if ( newCtx->dri.drawable != driDrawPriv ) { + newCtx->dri.drawable = driDrawPriv; + r200UpdateWindow( newCtx->glCtx ); + r200UpdateViewportOffset( newCtx->glCtx ); } - _mesa_make_current2( newR200Ctx->glCtx, + _mesa_make_current2( newCtx->glCtx, (GLframebuffer *) driDrawPriv->driverPrivate, (GLframebuffer *) driReadPriv->driverPrivate ); - if ( !newR200Ctx->glCtx->Viewport.Width ) { - _mesa_set_viewport( newR200Ctx->glCtx, 0, 0, + if ( !newCtx->glCtx->Viewport.Width ) { + _mesa_set_viewport( newCtx->glCtx, 0, 0, driDrawPriv->w, driDrawPriv->h ); } - if (newR200Ctx->vb.enabled) - r200VtxfmtMakeCurrent( newR200Ctx->glCtx ); + if (newCtx->vb.enabled) + r200VtxfmtMakeCurrent( newCtx->glCtx ); - _mesa_update_state( newR200Ctx->glCtx ); - r200ValidateState( newR200Ctx->glCtx ); + _mesa_update_state( newCtx->glCtx ); + r200ValidateState( newCtx->glCtx ); } else { if (R200_DEBUG & DEBUG_DRI) @@ -621,14 +586,8 @@ r200ContextPtr rmesa = (r200ContextPtr) driContextPriv->driverPrivate; if (R200_DEBUG & DEBUG_DRI) - fprintf(stderr, "%s ctx %p\n", __FUNCTION__, rmesa->glCtx); + fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)rmesa->glCtx); r200VtxfmtUnbindContext( rmesa->glCtx ); return GL_TRUE; } - - - - - - Index: xc/lib/GL/mesa/src/drv/r200/r200_context.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_context.h:1.2 xc/lib/GL/mesa/src/drv/r200/r200_context.h:1.6 --- xc/lib/GL/mesa/src/drv/r200/r200_context.h:1.2 Mon Dec 16 11:18:54 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_context.h Fri Jan 23 14:09:33 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.h,v 1.6 2004/01/23 19:09:33 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -37,15 +38,17 @@ #ifdef GLX_DIRECT_RENDERING -#include #include "dri_util.h" -#include "xf86drm.h" #include "radeon_common.h" +#include "texmem.h" #include "macros.h" #include "mtypes.h" +#include "colormac.h" #include "r200_reg.h" +#define ENABLE_HW_3D_TEXTURE 0 /* XXX this is temporary! */ + struct r200_context; typedef struct r200_context r200ContextRec; typedef struct r200_context *r200ContextPtr; @@ -63,6 +66,11 @@ #define R200_FALLBACK_BLEND_EQ 0x10 #define R200_FALLBACK_BLEND_FUNC 0x20 #define R200_FALLBACK_DISABLE 0x40 +#define R200_FALLBACK_BORDER_MODE 0x80 + +/* The blit width for texture uploads + */ +#define BLIT_WIDTH_BYTES 1024 /* Use the templated vertex format: */ @@ -127,18 +135,11 @@ /* Texture object in locally shared texture space. */ struct r200_tex_obj { - r200TexObjPtr next, prev; - - struct gl_texture_object *tObj; /* Mesa texture object */ + driTextureObject base; - PMemBlock memBlock; /* Memory block containing texture */ GLuint bufAddr; /* Offset to start of locally shared texture block */ - GLuint dirty_images; /* Flags for whether or not - images need to be uploaded to - local or AGP texture space */ - GLuint dirty_state; /* Flags (1 per texunit) for whether or not this texobj has dirty hardware state @@ -146,25 +147,20 @@ brought into the texunit. */ - GLint heap; /* Texture heap currently stored in */ - - drmRadeonTexImage image[RADEON_MAX_TEXTURE_LEVELS]; - - GLint totalSize; /* Total size of the texture - including all mipmap levels */ + drmRadeonTexImage image[6][RADEON_MAX_TEXTURE_LEVELS]; + /* Six, for the cube faces */ GLuint pp_txfilter; /* hardware register values */ GLuint pp_txformat; - GLuint pp_txoffset; + GLuint pp_txformat_x; + GLuint pp_txoffset; /* Image location in texmem. + All cube faces follow. */ GLuint pp_txsize; /* npot only */ GLuint pp_txpitch; /* npot only */ GLuint pp_border_color; + GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */ - /* texObj->Image[firstLevel] through texObj->Image[lastLevel] are the - * images to upload. - */ - GLint firstLevel; - GLint lastLevel; + GLboolean border_fallback; }; @@ -194,8 +190,8 @@ /* Trying to keep these relatively short as the variables are becoming - * extravagently long. Drop the R200_ off the front of everything - - * I think we know we're in the r200 driver by now, and keep the + * extravagently long. Drop the driver name prefix off the front of + * everything - I think we know which driver we're in by now, and keep the * prefix to 3 letters unless absolutely impossible. */ @@ -246,10 +242,10 @@ #define VPT_SE_VPORT_ZOFFSET 6 #define VPT_STATE_SIZE 7 -#define ZBS_CMD_0 0 -#define ZBS_SE_ZBIAS_FACTOR 1 -#define ZBS_SE_ZBIAS_CONSTANT 2 -#define ZBS_STATE_SIZE 3 +#define ZBS_CMD_0 0 +#define ZBS_SE_ZBIAS_FACTOR 1 +#define ZBS_SE_ZBIAS_CONSTANT 2 +#define ZBS_STATE_SIZE 3 #define MSC_CMD_0 0 #define MSC_RE_MISC 1 @@ -260,16 +256,26 @@ #define TAM_STATE_SIZE 2 #define TEX_CMD_0 0 -#define TEX_PP_TXFILTER 1 -#define TEX_PP_TXFORMAT 2 -#define TEX_PP_TXFORMAT_X 3 -#define TEX_PP_TXSIZE 4 -#define TEX_PP_TXPITCH 5 -#define TEX_PP_BORDER_COLOR 6 +#define TEX_PP_TXFILTER 1 /*2c00*/ +#define TEX_PP_TXFORMAT 2 /*2c04*/ +#define TEX_PP_TXFORMAT_X 3 /*2c08*/ +#define TEX_PP_TXSIZE 4 /*2c0c*/ +#define TEX_PP_TXPITCH 5 /*2c10*/ +#define TEX_PP_BORDER_COLOR 6 /*2c14*/ #define TEX_CMD_1 7 -#define TEX_PP_TXOFFSET 8 +#define TEX_PP_TXOFFSET 8 /*2d00 */ #define TEX_STATE_SIZE 9 +#define CUBE_CMD_0 0 /* 1 register follows */ +#define CUBE_PP_CUBIC_FACES 1 /* 0x2c18 */ +#define CUBE_CMD_1 2 /* 5 registers follow */ +#define CUBE_PP_CUBIC_OFFSET_F1 3 /* 0x2d04 */ +#define CUBE_PP_CUBIC_OFFSET_F2 4 /* 0x2d08 */ +#define CUBE_PP_CUBIC_OFFSET_F3 5 /* 0x2d0c */ +#define CUBE_PP_CUBIC_OFFSET_F4 6 /* 0x2d10 */ +#define CUBE_PP_CUBIC_OFFSET_F5 7 /* 0x2d14 */ +#define CUBE_STATE_SIZE 8 + #define PIX_CMD_0 0 #define PIX_PP_TXCBLEND 1 #define PIX_PP_TXCBLEND2 2 @@ -492,6 +498,7 @@ struct r200_state_atom tam; struct r200_state_atom tf; struct r200_state_atom tex[2]; + struct r200_state_atom cube[2]; struct r200_state_atom zbs; struct r200_state_atom mtl[2]; struct r200_state_atom mat[5]; @@ -516,16 +523,6 @@ struct r200_texture_state texture; }; -struct r200_texture { - r200TexObj objects[R200_NR_TEX_HEAPS]; - r200TexObj swapped; - - memHeap_t *heap[R200_NR_TEX_HEAPS]; - GLint age[R200_NR_TEX_HEAPS]; - - GLint numHeaps; -}; - /* Need refcounting on dma buffers: */ struct r200_dma_buffer { @@ -533,7 +530,7 @@ drmBufPtr buf; }; -#define GET_START(rvb) (rmesa->r200Screen->agp_buffer_offset + \ +#define GET_START(rvb) (rmesa->r200Screen->gart_buffer_offset + \ (rvb)->address - rmesa->dma.buf0_address + \ (rvb)->start) @@ -563,8 +560,6 @@ }; struct r200_dri_mirror { - Display *display; /* X server display */ - __DRIcontextPrivate *context; /* DRI context */ __DRIscreenPrivate *screen; /* DRI screen */ __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */ @@ -618,7 +613,7 @@ GLuint vertex_size; GLuint vertex_stride_shift; GLuint vertex_format; - char *verts; + GLubyte *verts; /* Fallback rasterization functions */ @@ -683,8 +678,6 @@ struct dynfn MultiTexCoord1fvARB; }; -struct _vb; - struct dfn_generators { struct dynfn *(*Vertex2f)( GLcontext *, const int * ); struct dynfn *(*Vertex2fv)( GLcontext *, const int * ); @@ -715,9 +708,14 @@ }; -struct r200_vb { - /* Keep these first: referenced from codegen templates: - */ + +struct r200_prim { + GLuint start; + GLuint end; + GLuint prim; +}; + +struct r200_vbinfo { GLint counter, initial_counter; GLint *dmaptr; void (*notify)( void ); @@ -742,23 +740,13 @@ r200_color_t *specptr; GLfloat *texcoordptr[2]; - GLcontext *context; /* current context : Single thread only! */ -}; - -struct r200_prim { - GLuint start; - GLuint end; - GLuint prim; -}; -struct r200_vbinfo { GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */ GLuint primflags; - GLboolean enabled; /* R200_NO_VTXFMT//R200_NO_TCL env vars */ + GLboolean enabled; /* *_NO_VTXFMT / *_NO_TCL env vars */ GLboolean installed; GLboolean fell_back; GLboolean recheck; - GLint initial_counter; GLint nrverts; GLuint vtxfmt_0, vtxfmt_1; @@ -786,7 +774,9 @@ /* Texture object bookkeeping */ - struct r200_texture texture; + unsigned nr_heaps; + driTexHeap * texture_heaps[ R200_NR_TEX_HEAPS ]; + driTextureObject swapped; /* Rasterization and vertex state: @@ -820,7 +810,7 @@ /* Clientdata textures; */ - GLuint prefer_agp_client_texturing; + GLuint prefer_gart_client_texturing; /* Drawable, cliprect and scissor information */ @@ -843,9 +833,18 @@ GLuint TexGenCompSel; GLmatrix tmpmat; - /* VBI + /* VBI / buffer swap */ GLuint vbl_seq; + GLuint vblank_flags; + + int64_t swap_ust; + int64_t swap_missed_ust; + + GLuint swap_count; + GLuint swap_missed_count; + + PFNGLXGETUSTPROC get_ust; /* r200_tcl.c */ @@ -885,11 +884,10 @@ extern void r200DestroyContext( __DRIcontextPrivate *driContextPriv ); -extern GLboolean r200CreateContext( Display *dpy, - const __GLcontextModes *glVisual, +extern GLboolean r200CreateContext( const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate); -extern void r200SwapBuffers(Display *dpy, void *drawablePrivate); +extern void r200SwapBuffers( __DRIdrawablePrivate *dPriv ); extern GLboolean r200MakeCurrent( __DRIcontextPrivate *driContextPriv, __DRIdrawablePrivate *driDrawPriv, __DRIdrawablePrivate *driReadPriv ); @@ -920,6 +918,7 @@ #define DEBUG_SANITY 0x800 #define DEBUG_SYNC 0x1000 #define DEBUG_PIXEL 0x2000 +#define DEBUG_MEMORY 0x4000 #endif #endif /* __R200_CONTEXT_H__ */ Index: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c:1.4 xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c:1.7 --- xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c:1.4 Mon Dec 16 19:32:56 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c,v 1.4 2002/12/17 00:32:56 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.c,v 1.7 2004/01/23 03:57:05 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,13 +25,20 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ +#include "glheader.h" +#include "imports.h" +#include "macros.h" +#include "context.h" +#include "swrast/swrast.h" + #include "r200_context.h" #include "r200_state.h" #include "r200_ioctl.h" @@ -39,23 +46,13 @@ #include "r200_sanity.h" #include "radeon_reg.h" -#include "mem.h" -#include "macros.h" -#include "context.h" -#include "swrast/swrast.h" +#include "vblank.h" -#include /* for usleep */ #define R200_TIMEOUT 512 #define R200_IDLE_RETRY 16 -static void do_usleep( int nr, const char *caller ) -{ - if (0) fprintf(stderr, "usleep %d in %s\n", nr, caller ); - if (1) usleep( nr ); -} - static void r200WaitForIdle( r200ContextPtr rmesa ); @@ -94,6 +91,15 @@ } + if (R200_DEBUG & DEBUG_MEMORY) { + if (! driValidateTextureHeaps( rmesa->texture_heaps, rmesa->nr_heaps, + & rmesa->swapped ) ) { + fprintf( stderr, "%s: texture memory is inconsistent - expect " + "mangled textures\n", __FUNCTION__ ); + } + } + + cmd.bufsz = rmesa->store.cmd_used; cmd.buf = rmesa->store.cmd_buf; @@ -123,7 +129,6 @@ rmesa->store.statenr = 0; rmesa->store.cmd_used = 0; rmesa->dma.nr_released_bufs = 0; -/* rmesa->lost_context = 0; */ rmesa->lost_context = 1; return ret; } @@ -143,7 +148,7 @@ UNLOCK_HARDWARE( rmesa ); if (ret) { - fprintf(stderr, "drmRadeonCmdBuffer: %d\n", ret); + fprintf(stderr, "drmRadeonCmdBuffer: %d (exiting)\n", ret); exit(ret); } } @@ -197,10 +202,10 @@ if (rmesa->dma.nr_released_bufs) { r200FlushCmdBufLocked( rmesa, __FUNCTION__ ); } - + if (rmesa->do_usleeps) { UNLOCK_HARDWARE( rmesa ); - do_usleep(1, __FUNCTION__); + DO_USLEEP( 1 ); LOCK_HARDWARE( rmesa ); } } @@ -287,6 +292,8 @@ rmesa->dma.current.ptr += bytes; /* bug - if alignment > 7 */ rmesa->dma.current.start = rmesa->dma.current.ptr = (rmesa->dma.current.ptr + 0x7) & ~0x7; + + assert( rmesa->dma.current.ptr <= rmesa->dma.current.end ); } void r200AllocDmaRegionVerts( r200ContextPtr rmesa, @@ -378,7 +385,7 @@ while (r200GetLastFrame (rmesa) < sarea->last_frame) { UNLOCK_HARDWARE( rmesa ); if (rmesa->do_usleeps) - do_usleep(1, __FUNCTION__); + DO_USLEEP( 1 ); LOCK_HARDWARE( rmesa ); } } @@ -392,6 +399,8 @@ { r200ContextPtr rmesa; GLint nbox, i, ret; + GLboolean missed_target; + int64_t ust; assert(dPriv); assert(dPriv->driContextPriv); @@ -400,7 +409,7 @@ rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate; if ( R200_DEBUG & DEBUG_IOCTL ) { - fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, rmesa->glCtx ); + fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, (void *)rmesa->glCtx ); } R200_FIREVERTICES( rmesa ); @@ -412,14 +421,15 @@ * request at a time. */ r200WaitForFrameCompletion( rmesa ); + UNLOCK_HARDWARE( rmesa ); + driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); + LOCK_HARDWARE( rmesa ); - r200WaitForVBlank( rmesa ); - - nbox = rmesa->dri.drawable->numClipRects; /* must be in locked region */ + nbox = dPriv->numClipRects; /* must be in locked region */ for ( i = 0 ; i < nbox ; ) { GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS , nbox ); - XF86DRIClipRectPtr box = rmesa->dri.drawable->pClipRects; + XF86DRIClipRectPtr box = dPriv->pClipRects; XF86DRIClipRectPtr b = rmesa->sarea->boxes; GLint n = 0; @@ -440,12 +450,24 @@ UNLOCK_HARDWARE( rmesa ); rmesa->lost_context = 1; + + rmesa->swap_count++; + (*rmesa->get_ust)( & ust ); + if ( missed_target ) { + rmesa->swap_missed_count++; + rmesa->swap_missed_ust = ust - rmesa->swap_ust; + } + + rmesa->swap_ust = ust; + + sched_yield(); } void r200PageFlip( const __DRIdrawablePrivate *dPriv ) { r200ContextPtr rmesa; GLint ret; + GLboolean missed_target; assert(dPriv); assert(dPriv->driContextPriv); @@ -461,7 +483,7 @@ R200_FIREVERTICES( rmesa ); LOCK_HARDWARE( rmesa ); - if (!rmesa->dri.drawable->numClipRects) { + if (!dPriv->numClipRects) { UNLOCK_HARDWARE( rmesa ); usleep( 10000 ); /* throttle invisible client 10ms */ return; @@ -470,7 +492,7 @@ /* Need to do this for the perf box placement: */ { - XF86DRIClipRectPtr box = rmesa->dri.drawable->pClipRects; + XF86DRIClipRectPtr box = dPriv->pClipRects; XF86DRIClipRectPtr b = rmesa->sarea->boxes; b[0] = box[0]; rmesa->sarea->nbox = 1; @@ -480,18 +502,26 @@ * request at a time. */ r200WaitForFrameCompletion( rmesa ); - - r200WaitForVBlank( rmesa ); + UNLOCK_HARDWARE( rmesa ); + driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); + if ( missed_target ) { + rmesa->swap_missed_count++; + (void) (*rmesa->get_ust)( & rmesa->swap_missed_ust ); + } + LOCK_HARDWARE( rmesa ); ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_FLIP ); UNLOCK_HARDWARE( rmesa ); if ( ret ) { - fprintf( stderr, "DRM_R200_FLIP: return = %d\n", ret ); + fprintf( stderr, "DRM_RADEON_FLIP: return = %d\n", ret ); exit( 1 ); } + rmesa->swap_count++; + (void) (*rmesa->get_ust)( & rmesa->swap_ust ); + if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset; rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch; @@ -501,7 +531,8 @@ } R200_STATECHANGE( rmesa, ctx ); - rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset; + rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset + + rmesa->r200Screen->fbLocation; rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch; } @@ -559,8 +590,11 @@ mask &= ~DD_STENCIL_BIT; } - if ( mask ) + if ( mask ) { + if (R200_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask); _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + } if ( !flags ) return; @@ -590,13 +624,13 @@ /* Clear throttling needs more thought. */ - if ( rmesa->sarea->last_clear - clear <= 8 ) { + if ( rmesa->sarea->last_clear - clear <= 25 ) { break; } if (rmesa->do_usleeps) { UNLOCK_HARDWARE( rmesa ); - do_usleep(1, __FUNCTION__); + DO_USLEEP( 1 ); LOCK_HARDWARE( rmesa ); } } @@ -681,7 +715,7 @@ do { ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_CP_IDLE); if (ret) - do_usleep( 1, __FUNCTION__ ); + DO_USLEEP( 1 ); } while (ret && ++i < 100); if ( ret < 0 ) { @@ -691,6 +725,7 @@ } } + static void r200WaitForIdle( r200ContextPtr rmesa ) { LOCK_HARDWARE(rmesa); @@ -699,41 +734,6 @@ } -void r200WaitForVBlank( r200ContextPtr rmesa ) -{ - drmVBlank vbl; - int ret; - - if ( !rmesa->r200Screen->irq ) - return; - - if ( getenv("LIBGL_SYNC_REFRESH") ) { - /* Wait for until the next vertical blank */ - vbl.request.type = DRM_VBLANK_RELATIVE; - vbl.request.sequence = 1; - } else if ( getenv("LIBGL_THROTTLE_REFRESH") ) { - /* Wait for at least one vertical blank since the last call */ - vbl.request.type = DRM_VBLANK_ABSOLUTE; - vbl.request.sequence = rmesa->vbl_seq + 1; - } else { - return; - } - - UNLOCK_HARDWARE( rmesa ); - - if ((ret = drmWaitVBlank( rmesa->dri.fd, &vbl ))) { - fprintf(stderr, "%s: drmWaitVBlank returned %d, IRQs don't seem to be" - " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH" - " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret); - exit(1); - } else if (R200_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "%s: drmWaitVBlank returned %d\n", __FUNCTION__, ret); - rmesa->vbl_seq = vbl.reply.sequence; - - LOCK_HARDWARE( rmesa ); -} - - void r200Flush( GLcontext *ctx ) { r200ContextPtr rmesa = R200_CONTEXT( ctx ); @@ -770,7 +770,7 @@ } -/* This version of AllocateMemoryNV allocates only agp memory, and +/* This version of AllocateMemoryMESA allocates only GART memory, and * only does so after the point at which the driver has been * initialized. * @@ -779,8 +779,9 @@ * the kernel data structures, and the current context to get the * device fd. */ -void *r200AllocateMemoryNV(GLsizei size, GLfloat readfreq, - GLfloat writefreq, GLfloat priority) +void *r200AllocateMemoryMESA(Display *dpy, int scrn, GLsizei size, + GLfloat readfreq, GLfloat writefreq, + GLfloat priority) { GET_CURRENT_CONTEXT(ctx); r200ContextPtr rmesa; @@ -792,7 +793,7 @@ fprintf(stderr, "%s sz %d %f/%f/%f\n", __FUNCTION__, size, readfreq, writefreq, priority); - if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || rmesa->r200Screen->IsPCI ) + if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || !rmesa->r200Screen->gartTextures.map) return NULL; if (getenv("R200_NO_ALLOC")) @@ -801,7 +802,7 @@ if (rmesa->dri.drmMinor < 6) return NULL; - alloc.region = RADEON_MEM_REGION_AGP; + alloc.region = RADEON_MEM_REGION_GART; alloc.alignment = 0; alloc.size = size; alloc.region_offset = ®ion_offset; @@ -816,14 +817,14 @@ } { - char *region_start = (char *)rmesa->r200Screen->agpTextures.map; + char *region_start = (char *)rmesa->r200Screen->gartTextures.map; return (void *)(region_start + region_offset); } } -/* Called via glXFreeMemoryNV() */ -void r200FreeMemoryNV(GLvoid *pointer) +/* Called via glXFreeMemoryMESA() */ +void r200FreeMemoryMESA(Display *dpy, int scrn, GLvoid *pointer) { GET_CURRENT_CONTEXT(ctx); r200ContextPtr rmesa; @@ -834,7 +835,7 @@ if (R200_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s %p\n", __FUNCTION__, pointer); - if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || rmesa->r200Screen->IsPCI ) { + if (!ctx || !(rmesa = R200_CONTEXT(ctx)) || !rmesa->r200Screen->gartTextures.map) { fprintf(stderr, "%s: no context\n", __FUNCTION__); return; } @@ -842,16 +843,16 @@ if (rmesa->dri.drmMinor < 6) return; - region_offset = (char *)pointer - (char *)rmesa->r200Screen->agpTextures.map; + region_offset = (char *)pointer - (char *)rmesa->r200Screen->gartTextures.map; if (region_offset < 0 || - region_offset > rmesa->r200Screen->agpTextures.size) { + region_offset > rmesa->r200Screen->gartTextures.size) { fprintf(stderr, "offset %d outside range 0..%d\n", region_offset, - rmesa->r200Screen->agpTextures.size); + rmesa->r200Screen->gartTextures.size); return; } - memfree.region = RADEON_MEM_REGION_AGP; + memfree.region = RADEON_MEM_REGION_GART; memfree.region_offset = region_offset; ret = drmCommandWrite( rmesa->r200Screen->driScreen->fd, @@ -862,8 +863,8 @@ fprintf(stderr, "%s: DRM_RADEON_FREE ret %d\n", __FUNCTION__, ret); } -/* Called via glXGetAGPOffsetMESA() */ -GLuint r200GetAGPOffset(const GLvoid *pointer) +/* Called via glXGetMemoryOffsetMESA() */ +GLuint r200GetMemoryOffsetMESA(Display *dpy, int scrn, const GLvoid *pointer) { GET_CURRENT_CONTEXT(ctx); r200ContextPtr rmesa; @@ -874,41 +875,41 @@ return ~0; } - if (!r200IsAgpMemory( rmesa, pointer, 0 )) + if (!r200IsGartMemory( rmesa, pointer, 0 )) return ~0; if (rmesa->dri.drmMinor < 6) return ~0; - card_offset = r200AgpOffsetFromVirtual( rmesa, pointer ); + card_offset = r200GartOffsetFromVirtual( rmesa, pointer ); - return card_offset - rmesa->r200Screen->agp_base; + return card_offset - rmesa->r200Screen->gart_base; } -GLboolean r200IsAgpMemory( r200ContextPtr rmesa, const GLvoid *pointer, +GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid *pointer, GLint size ) { - int offset = (char *)pointer - (char *)rmesa->r200Screen->agpTextures.map; + int offset = (char *)pointer - (char *)rmesa->r200Screen->gartTextures.map; int valid = (size >= 0 && offset >= 0 && - offset + size < rmesa->r200Screen->agpTextures.size); + offset + size < rmesa->r200Screen->gartTextures.size); if (R200_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "r200IsAgpMemory( %p ) : %d\n", pointer, valid ); + fprintf(stderr, "r200IsGartMemory( %p ) : %d\n", pointer, valid ); return valid; } -GLuint r200AgpOffsetFromVirtual( r200ContextPtr rmesa, const GLvoid *pointer ) +GLuint r200GartOffsetFromVirtual( r200ContextPtr rmesa, const GLvoid *pointer ) { - int offset = (char *)pointer - (char *)rmesa->r200Screen->agpTextures.map; + int offset = (char *)pointer - (char *)rmesa->r200Screen->gartTextures.map; - if (offset < 0 || offset > rmesa->r200Screen->agpTextures.size) + if (offset < 0 || offset > rmesa->r200Screen->gartTextures.size) return ~0; else - return rmesa->r200Screen->agp_texture_offset + offset; + return rmesa->r200Screen->gart_texture_offset + offset; } Index: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_ioctl.h:1.1 xc/lib/GL/mesa/src/drv/r200/r200_ioctl.h:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_ioctl.h:1.1 Wed Oct 30 07:51:52 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_ioctl.h Sun Sep 28 16:15:23 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_ioctl.h,v 1.2 2003/09/28 20:15:23 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -104,15 +105,16 @@ extern void r200WaitForVBlank( r200ContextPtr rmesa ); extern void r200InitIoctlFuncs( GLcontext *ctx ); -extern void *r200AllocateMemoryNV( GLsizei size, GLfloat readfreq, +extern void *r200AllocateMemoryMESA( Display *dpy, int scrn, + GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority ); -extern void r200FreeMemoryNV( GLvoid *pointer ); -extern GLuint r200GetAGPOffset( const GLvoid *pointer ); -extern GLboolean r200IsAgpMemory( r200ContextPtr rmesa, const GLvoid *pointer, - GLint size ); +extern void r200FreeMemoryMESA( Display *dpy, int scrn, GLvoid *pointer ); +extern GLuint r200GetMemoryOffsetMESA( Display *dpy, int scrn, const GLvoid *pointer ); +extern GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid *pointer, + GLint size ); -extern GLuint r200AgpOffsetFromVirtual( r200ContextPtr rmesa, - const GLvoid *pointer ); +extern GLuint r200GartOffsetFromVirtual( r200ContextPtr rmesa, + const GLvoid *pointer ); /* ================================================================ * Helper macros: @@ -171,14 +173,15 @@ static __inline char *r200AllocCmdBuf( r200ContextPtr rmesa, int bytes, const char *where ) { + char * head; + if (rmesa->store.cmd_used + bytes > R200_CMD_BUF_SZ) - r200FlushCmdBuf( rmesa, __FUNCTION__ ); - - { - char *head = rmesa->store.cmd_buf + rmesa->store.cmd_used; - rmesa->store.cmd_used += bytes; - return head; - } + r200FlushCmdBuf( rmesa, where ); + + head = rmesa->store.cmd_buf + rmesa->store.cmd_used; + rmesa->store.cmd_used += bytes; + assert( rmesa->store.cmd_used <= R200_CMD_BUF_SZ ); + return head; } Index: xc/lib/GL/mesa/src/drv/r200/r200_lock.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_lock.c:1.1 xc/lib/GL/mesa/src/drv/r200/r200_lock.c:1.3 --- xc/lib/GL/mesa/src/drv/r200/r200_lock.c:1.1 Wed Oct 30 07:51:52 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_lock.c Tue Dec 2 08:02:39 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_lock.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_lock.c,v 1.3 2003/12/02 13:02:39 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -51,7 +52,7 @@ int use_back; rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip; - use_back = (rmesa->glCtx->Color.DriverDrawBuffer == GL_BACK_LEFT); + use_back = (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT); use_back ^= (rmesa->sarea->pfCurrentPage == 1); if (use_back) { @@ -63,7 +64,8 @@ } R200_STATECHANGE( rmesa, ctx ); - rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset; + rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset + + rmesa->r200Screen->fbLocation; rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch; } @@ -82,6 +84,7 @@ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; __DRIscreenPrivate *sPriv = rmesa->dri.screen; RADEONSAREAPrivPtr sarea = rmesa->sarea; + int i; drmGetLock( rmesa->dri.fd, rmesa->dri.hwContext, flags ); @@ -93,11 +96,14 @@ * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO( rmesa->dri.display, sPriv, dPriv ); + DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); if ( rmesa->lastStamp != dPriv->lastStamp ) { r200UpdatePageFlipping( rmesa ); - r200SetCliprects( rmesa, rmesa->glCtx->Color.DriverDrawBuffer ); + if (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT) + r200SetCliprects( rmesa, GL_BACK_LEFT ); + else + r200SetCliprects( rmesa, GL_FRONT_LEFT ); r200UpdateViewportOffset( rmesa->glCtx ); rmesa->lastStamp = dPriv->lastStamp; } @@ -105,4 +111,8 @@ if ( sarea->ctxOwner != rmesa->dri.hwContext ) { sarea->ctxOwner = rmesa->dri.hwContext; } + + for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { + DRI_AGE_TEXTURES( rmesa->texture_heaps[ i ] ); + } } Index: xc/lib/GL/mesa/src/drv/r200/r200_lock.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_lock.h:1.1 xc/lib/GL/mesa/src/drv/r200/r200_lock.h:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_lock.h:1.1 Wed Oct 30 07:51:52 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_lock.h Sun Sep 28 16:15:23 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_lock.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_lock.h,v 1.2 2003/09/28 20:15:23 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: Index: xc/lib/GL/mesa/src/drv/r200/r200_maos.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_maos.h:1.1 xc/lib/GL/mesa/src/drv/r200/r200_maos.h:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_maos.h:1.1 Wed Oct 30 07:51:52 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_maos.h Sun Sep 28 16:15:23 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos.h,v 1.2 2003/09/28 20:15:23 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: Index: xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c:1.3 xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c:1.5 --- xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c:1.3 Sun Feb 23 18:59:01 2003 +++ xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c,v 1.3 2003/02/23 23:59:01 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c,v 1.5 2004/01/23 03:57:05 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -35,8 +36,7 @@ #include "glheader.h" #include "mtypes.h" #include "colormac.h" -#include "mem.h" -#include "mmath.h" +#include "imports.h" #include "macros.h" #include "swrast_setup/swrast_setup.h" @@ -70,7 +70,7 @@ if (R200_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s count %d stride %d out %p\n", - __FUNCTION__, count, stride, out); + __FUNCTION__, count, stride, (void *)out); for (i = 0; i < count; i++) { out->red = *data; @@ -175,6 +175,28 @@ } +static void emit_vec4( GLcontext *ctx, + struct r200_dma_region *rvb, + char *data, + int stride, + int count ) +{ + int i; + int *out = (int *)(rvb->address + rvb->start); + + if (R200_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s count %d stride %d\n", + __FUNCTION__, count, stride); + + if (stride == 4) + COPY_DWORDS( out, data, count ); + else + for (i = 0; i < count; i++) { + out[0] = *(int *)data; + out++; + data += stride; + } +} static void emit_vec8( GLcontext *ctx, @@ -212,7 +234,7 @@ if (R200_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s count %d stride %d out %p data %p\n", - __FUNCTION__, count, stride, out, data); + __FUNCTION__, count, stride, (void *)out, data); if (stride == 12) COPY_DWORDS( out, data, count*3 ); @@ -285,6 +307,9 @@ /* Emit the data */ switch (size) { + case 1: + emit_vec4( ctx, rvb, data, stride, count ); + break; case 2: emit_vec8( ctx, rvb, data, stride, count ); break; @@ -304,7 +329,7 @@ -/* Emit any changed arrays to new agp memory, re-emit a packet to +/* Emit any changed arrays to new GART memory, re-emit a packet to * update the arrays. */ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) @@ -339,7 +364,7 @@ } - if (inputs & VERT_NORM) { + if (inputs & VERT_BIT_NORMAL) { if (!rmesa->tcl.norm.buf) emit_vector( ctx, &(rmesa->tcl.norm), @@ -352,7 +377,7 @@ component[nr++] = &rmesa->tcl.norm; } - if (inputs & VERT_RGBA) { + if (inputs & VERT_BIT_COLOR0) { if (VB->ColorPtr[0]->Type == GL_UNSIGNED_BYTE) { if (!rmesa->tcl.rgba.buf) emit_ubyte_rgba( ctx, @@ -391,7 +416,7 @@ } - if (inputs & VERT_SPEC_RGB) { + if (inputs & VERT_BIT_COLOR1) { if (!rmesa->tcl.spec.buf) { if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE) r200_import_float_spec_colors( ctx ); @@ -413,7 +438,7 @@ /* vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] & */ /* ~(R200_TCL_VTX_Q0|R200_TCL_VTX_Q1)); */ - if (inputs & VERT_TEX0) { + if (inputs & VERT_BIT_TEX0) { if (!rmesa->tcl.tex[0].buf) emit_vector( ctx, &(rmesa->tcl.tex[0]), @@ -426,7 +451,7 @@ component[nr++] = &rmesa->tcl.tex[0]; } - if (inputs & VERT_TEX1) { + if (inputs & VERT_BIT_TEX1) { if (!rmesa->tcl.tex[1].buf) emit_vector( ctx, &(rmesa->tcl.tex[1]), @@ -446,9 +471,6 @@ rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = vfmt1; } - -/* fprintf(stderr, "VTXFMT_0: %x VTXFMT_1: %x\n", vfmt0, vfmt1); */ - rmesa->tcl.nr_aos_components = nr; rmesa->tcl.vertex_format = vfmt0; } @@ -461,21 +483,21 @@ if (R200_DEBUG & DEBUG_VERTS) _tnl_print_vert_flags( __FUNCTION__, newinputs ); - if (newinputs & VERT_OBJ) + if (newinputs & VERT_BIT_POS) r200ReleaseDmaRegion( rmesa, &rmesa->tcl.obj, __FUNCTION__ ); - if (newinputs & VERT_NORM) + if (newinputs & VERT_BIT_NORMAL) r200ReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ ); - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) r200ReleaseDmaRegion( rmesa, &rmesa->tcl.rgba, __FUNCTION__ ); - if (newinputs & VERT_SPEC_RGB) + if (newinputs & VERT_BIT_COLOR1) r200ReleaseDmaRegion( rmesa, &rmesa->tcl.spec, __FUNCTION__ ); - if (newinputs & VERT_TEX0) + if (newinputs & VERT_BIT_TEX0) r200ReleaseDmaRegion( rmesa, &rmesa->tcl.tex[0], __FUNCTION__ ); - if (newinputs & VERT_TEX1) + if (newinputs & VERT_BIT_TEX1) r200ReleaseDmaRegion( rmesa, &rmesa->tcl.tex[1], __FUNCTION__ ); } Index: xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c:1.1 xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c:1.1 Wed Oct 30 07:51:52 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c Sun Sep 28 16:15:23 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_maos_verts.c,v 1.2 2003/09/28 20:15:23 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,21 +25,16 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ -#include "r200_context.h" -#include "r200_state.h" -#include "r200_ioctl.h" -#include "r200_tex.h" -#include "r200_tcl.h" -#include "r200_swtcl.h" -#include "r200_maos.h" - +#include "glheader.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "enums.h" @@ -51,6 +46,15 @@ #include "tnl/t_pipeline.h" #include "tnl/t_imm_debug.h" +#include "r200_context.h" +#include "r200_state.h" +#include "r200_ioctl.h" +#include "r200_tex.h" +#include "r200_tcl.h" +#include "r200_swtcl.h" +#include "r200_maos.h" + + #define R200_TCL_MAX_SETUP 13 union emit_union { float f; GLuint ui; GLubyte ub[4]; }; @@ -256,19 +260,19 @@ } } - if (inputs & VERT_NORM) { + if (inputs & VERT_BIT_NORMAL) { req |= R200_CP_VC_FRMT_N0; } - if (inputs & VERT_RGBA) { + if (inputs & VERT_BIT_COLOR0) { req |= R200_CP_VC_FRMT_PKCOLOR; } - if (inputs & VERT_SPEC_RGB) { + if (inputs & VERT_BIT_COLOR1) { req |= R200_CP_VC_FRMT_PKSPEC; } - if (inputs & VERT_TEX0) { + if (inputs & VERT_BIT_TEX0) { req |= R200_CP_VC_FRMT_ST0; if (VB->TexCoordPtr[0]->size == 4) { @@ -277,7 +281,7 @@ } } - if (inputs & VERT_TEX1) { + if (inputs & VERT_BIT_TEX1) { req |= R200_CP_VC_FRMT_ST1; if (VB->TexCoordPtr[1]->size == 4) { Index: xc/lib/GL/mesa/src/drv/r200/r200_pixel.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_pixel.c:1.2 xc/lib/GL/mesa/src/drv/r200/r200_pixel.c:1.4 --- xc/lib/GL/mesa/src/drv/r200/r200_pixel.c:1.2 Mon Dec 16 11:18:54 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_pixel.c Tue Dec 2 08:02:39 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_pixel.c,v 1.2 2002/12/16 16:18:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_pixel.c,v 1.4 2003/12/02 13:02:39 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -32,20 +32,18 @@ * Keith Whitwell */ +#include "glheader.h" #include "enums.h" #include "mtypes.h" #include "macros.h" #include "texutil.h" +#include "swrast/swrast.h" + #include "r200_context.h" #include "r200_ioctl.h" #include "r200_pixel.h" #include "r200_swtcl.h" -#include "xf86drm.h" -#include "swrast/swrast.h" - - - static GLboolean @@ -96,7 +94,7 @@ !ctx->Color.ColorMask[2] || !ctx->Color.ColorMask[3] || ctx->Color.ColorLogicOpEnabled || - ctx->Texture._ReallyEnabled || + ctx->Texture._EnabledUnits || ctx->Depth.OcclusionTest ) && ctx->Current.RasterPosValid); @@ -162,12 +160,12 @@ if (R200_DEBUG & DEBUG_PIXEL) fprintf(stderr, "%s\n", __FUNCTION__); - /* Only accelerate reading to agp buffers. + /* Only accelerate reading to GART buffers. */ - if ( !r200IsAgpMemory(rmesa, pixels, + if ( !r200IsGartMemory(rmesa, pixels, pitch * height * rmesa->r200Screen->cpp ) ) { if (R200_DEBUG & DEBUG_PIXEL) - fprintf(stderr, "%s: dest not agp\n", __FUNCTION__); + fprintf(stderr, "%s: dest not GART\n", __FUNCTION__); return GL_FALSE; } @@ -217,9 +215,10 @@ { __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; int nbox = dPriv->numClipRects; - int src_offset = rmesa->state.color.drawOffset; + int src_offset = rmesa->state.color.drawOffset + + rmesa->r200Screen->fbLocation; int src_pitch = rmesa->state.color.drawPitch * rmesa->r200Screen->cpp; - int dst_offset = r200AgpOffsetFromVirtual( rmesa, pixels); + int dst_offset = r200GartOffsetFromVirtual( rmesa, pixels ); int dst_pitch = pitch * rmesa->r200Screen->cpp; XF86DRIClipRectRec *box = dPriv->pClipRects; int i; @@ -290,7 +289,7 @@ GLint x, GLint y, GLsizei width, GLsizei height, GLint pitch, const void *pixels, - GLuint dest, GLuint planemask) + GLuint planemask) { r200ContextPtr rmesa = R200_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; @@ -299,7 +298,7 @@ int i; int blit_format; int size; - int src_offset = r200AgpOffsetFromVirtual( rmesa, pixels); + int src_offset = r200GartOffsetFromVirtual( rmesa, pixels ); int src_pitch = pitch * rmesa->r200Screen->cpp; if (R200_DEBUG & DEBUG_PIXEL) @@ -356,7 +355,7 @@ blit_format, src_pitch, src_offset, rmesa->state.color.drawPitch * rmesa->r200Screen->cpp, - rmesa->state.color.drawOffset, + rmesa->state.color.drawOffset + rmesa->r200Screen->fbLocation, bx - x, by - y, bx, by, bw, bh ); @@ -379,7 +378,7 @@ { r200ContextPtr rmesa = R200_CONTEXT(ctx); GLint pitch = unpack->RowLength ? unpack->RowLength : width; - GLuint dest, planemask; + GLuint planemask; GLuint cpp = rmesa->r200Screen->cpp; GLint size = width * pitch * cpp; @@ -390,8 +389,6 @@ case GL_RGB: case GL_RGBA: case GL_BGRA: - dest = rmesa->state.color.drawOffset; - planemask = r200PackColor(cpp, ctx->Color.ColorMask[RCOMP], ctx->Color.ColorMask[GCOMP], @@ -404,11 +401,11 @@ if (planemask != ~0) return GL_FALSE; /* fix me -- should be possible */ - /* Can't do conversions on agp reads/draws. + /* Can't do conversions on GART reads/draws. */ - if ( !r200IsAgpMemory( rmesa, pixels, size ) ) { + if ( !r200IsGartMemory( rmesa, pixels, size ) ) { if (R200_DEBUG & DEBUG_PIXEL) - fprintf(stderr, "%s: not agp memory\n", __FUNCTION__); + fprintf(stderr, "%s: not GART memory\n", __FUNCTION__); return GL_FALSE; } @@ -428,10 +425,9 @@ return GL_FALSE; } - if ( r200IsAgpMemory(rmesa, pixels, size) ) + if ( r200IsGartMemory(rmesa, pixels, size) ) { - do_draw_pix( ctx, x, y, width, height, pitch, pixels, - dest, planemask ); + do_draw_pix( ctx, x, y, width, height, pitch, pixels, planemask ); return GL_TRUE; } else if (0) Index: xc/lib/GL/mesa/src/drv/r200/r200_reg.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_reg.h:1.2 xc/lib/GL/mesa/src/drv/r200/r200_reg.h:1.3 --- xc/lib/GL/mesa/src/drv/r200/r200_reg.h:1.2 Mon Dec 16 11:18:54 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_reg.h Sun Sep 28 16:15:23 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_reg.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_reg.h,v 1.3 2003/09/28 20:15:23 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -818,6 +818,8 @@ #define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) #define R200_CLAMP_S_CLAMP_BORDER (4 << 23) #define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) +#define R200_CLAMP_S_CLAMP_GL (6 << 23) +#define R200_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) #define R200_CLAMP_S_MASK (7 << 23) #define R200_WRAPEN_T (1 << 26) #define R200_CLAMP_T_WRAP (0 << 27) @@ -826,6 +828,8 @@ #define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) #define R200_CLAMP_T_CLAMP_BORDER (4 << 27) #define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) +#define R200_CLAMP_T_CLAMP_GL (6 << 27) +#define R200_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) #define R200_CLAMP_T_MASK (7 << 27) #define R200_KILL_LT_ZERO (1 << 30) #define R200_BORDER_MODE_OGL (0 << 31) @@ -854,30 +858,37 @@ #define R200_TXFORMAT_WIDTH_SHIFT 8 #define R200_TXFORMAT_HEIGHT_MASK (15 << 12) #define R200_TXFORMAT_HEIGHT_SHIFT 12 -#define R200_TXFORMAT_F5_WIDTH_MASK (15 << 15) /* cube face 5 */ -#define R200_TXFORMAT_F5_WIDTH_SHIFT 15 +#define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */ +#define R200_TXFORMAT_F5_WIDTH_SHIFT 16 #define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20) #define R200_TXFORMAT_F5_HEIGHT_SHIFT 20 -#define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) #define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) #define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) #define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) #define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24) #define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24) #define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24) +#define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) +#define R200_TXFORMAT_ST_ROUTE_SHIFT 24 #define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) #define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) #define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) #define R200_PP_TXFORMAT_X_0 0x2c08 -#define R200_DEPTH_LOG2_MASK (0xff << 0) +#define R200_DEPTH_LOG2_MASK (0xf << 0) #define R200_DEPTH_LOG2_SHIFT 0 +#define R200_VOLUME_FILTER_SHIFT 4 +#define R200_VOLUME_FILTER_MASK (1 << 4) +#define R200_VOLUME_FILTER_NEAREST (0 << 4) +#define R200_VOLUME_FILTER_LINEAR (1 << 4) #define R200_WRAPEN_Q (1 << 8) #define R200_CLAMP_Q_WRAP (0 << 9) #define R200_CLAMP_Q_MIRROR (1 << 9) #define R200_CLAMP_Q_CLAMP_LAST (2 << 9) #define R200_CLAMP_Q_MIRROR_CLAMP_LAST (3 << 9) -#define R200_CLAMP_Q_CLAMP_BORDER (6 << 9) -#define R200_CLAMP_Q_MIRROR_CLAMP_BORDER (7 << 9) +#define R200_CLAMP_Q_CLAMP_BORDER (4 << 9) +#define R200_CLAMP_Q_MIRROR_CLAMP_BORDER (5 << 9) +#define R200_CLAMP_Q_CLAMP_GL (6 << 9) +#define R200_CLAMP_Q_MIRROR_CLAMP_GL (7 << 9) #define R200_CLAMP_Q_MASK (7 << 9) #define R200_MIN_MIP_LEVEL_MASK (0xff << 12) #define R200_MIN_MIP_LEVEL_SHIFT 12 @@ -889,12 +900,29 @@ #define R200_TEXCOORD_1D_PROJ (5 << 16) #define R200_TEXCOORD_1D (6 << 16) #define R200_TEXCOORD_ZERO (7 << 16) +#define R200_TEXCOORD_MASK (7 << 16) #define R200_LOD_BIAS_MASK (0xfff80000) #define R200_LOD_BIAS_SHIFT 19 #define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */ #define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */ #define R200_PP_BORDER_COLOR_0 0x2c14 #define R200_PP_CUBIC_FACES_0 0x2c18 +#define R200_FACE_WIDTH_1_SHIFT 0 +#define R200_FACE_HEIGHT_1_SHIFT 4 +#define R200_FACE_WIDTH_1_MASK (0xf << 0) +#define R200_FACE_HEIGHT_1_MASK (0xf << 4) +#define R200_FACE_WIDTH_2_SHIFT 8 +#define R200_FACE_HEIGHT_2_SHIFT 12 +#define R200_FACE_WIDTH_2_MASK (0xf << 8) +#define R200_FACE_HEIGHT_2_MASK (0xf << 12) +#define R200_FACE_WIDTH_3_SHIFT 16 +#define R200_FACE_HEIGHT_3_SHIFT 20 +#define R200_FACE_WIDTH_3_MASK (0xf << 16) +#define R200_FACE_HEIGHT_3_MASK (0xf << 20) +#define R200_FACE_WIDTH_4_SHIFT 24 +#define R200_FACE_HEIGHT_4_SHIFT 28 +#define R200_FACE_WIDTH_4_MASK (0xf << 24) +#define R200_FACE_HEIGHT_4_MASK (0xf << 28) #define R200_PP_TXFILTER_1 0x2c20 #define R200_PP_TXFORMAT_1 0x2c24 #define R200_PP_TXFORMAT_X_1 0x2c28 @@ -1406,11 +1434,5 @@ #define R200_CP_CMD_BITBLT_MULTI 0xC0009B00 #define R200_CP_CMD_TRANS_BITBLT 0xC0009C00 - -#define R200_AGP_TEX_OFFSET 0x02000000 - - - - #endif Index: xc/lib/GL/mesa/src/drv/r200/r200_sanity.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_sanity.c:1.1 xc/lib/GL/mesa/src/drv/r200/r200_sanity.c:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_sanity.c:1.1 Wed Oct 30 07:51:52 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_sanity.c Sun Sep 28 16:15:24 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_sanity.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_sanity.c,v 1.2 2003/09/28 20:15:24 alanh Exp $ */ /************************************************************************** Copyright 2002 ATI Technologies Inc., Ontario, Canada, and @@ -33,6 +33,9 @@ * */ +#include "glheader.h" +#include "imports.h" + #include "r200_context.h" #include "r200_ioctl.h" #include "r200_sanity.h" @@ -122,6 +125,18 @@ { R200_SE_VTX_STATE_CNTL, 1, "R200_SE_VTX_STATE_CNTL" }, { R200_RE_POINTSIZE, 1, "R200_RE_POINTSIZE" }, { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" }, + { R200_PP_CUBIC_FACES_0, 1, "R200_PP_CUBIC_FACES_0" }, /* 61 */ + { R200_PP_CUBIC_OFFSET_F1_0, 5, "R200_PP_CUBIC_OFFSET_F1_0" }, /* 62 */ + { R200_PP_CUBIC_FACES_1, 1, "R200_PP_CUBIC_FACES_1" }, + { R200_PP_CUBIC_OFFSET_F1_1, 5, "R200_PP_CUBIC_OFFSET_F1_1" }, + { R200_PP_CUBIC_FACES_2, 1, "R200_PP_CUBIC_FACES_2" }, + { R200_PP_CUBIC_OFFSET_F1_2, 5, "R200_PP_CUBIC_OFFSET_F1_2" }, + { R200_PP_CUBIC_FACES_3, 1, "R200_PP_CUBIC_FACES_3" }, + { R200_PP_CUBIC_OFFSET_F1_3, 5, "R200_PP_CUBIC_OFFSET_F1_3" }, + { R200_PP_CUBIC_FACES_4, 1, "R200_PP_CUBIC_FACES_4" }, + { R200_PP_CUBIC_OFFSET_F1_4, 5, "R200_PP_CUBIC_OFFSET_F1_4" }, + { R200_PP_CUBIC_FACES_5, 1, "R200_PP_CUBIC_FACES_5" }, + { R200_PP_CUBIC_OFFSET_F1_5, 5, "R200_PP_CUBIC_OFFSET_F1_5" }, }; struct reg_names { @@ -1307,10 +1322,3 @@ return 0; } - - -/* Do the same job to a native command stream - * -- pull apart packets after they are built. - * -- understand SCALAR, VECTOR stores - * -- understand INDIRECT registers & trace down into indirect buffers. - */ Index: xc/lib/GL/mesa/src/drv/r200/r200_screen.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_screen.c:1.2 xc/lib/GL/mesa/src/drv/r200/r200_screen.c:1.7 --- xc/lib/GL/mesa/src/drv/r200/r200_screen.c:1.2 Mon Dec 16 11:18:54 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_screen.c Thu Dec 18 16:56:37 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_screen.c,v 1.2 2002/12/16 16:18:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_screen.c,v 1.7 2003/12/18 21:56:37 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -33,14 +34,22 @@ */ #include -#include +#include "glheader.h" +#include "imports.h" +#include "context.h" + +#define STANDALONE_MMIO #include "r200_screen.h" #include "r200_context.h" #include "r200_ioctl.h" +#include "radeon_macros.h" +#include "radeon_reg.h" -#include "mem.h" -#include "context.h" +#include "utils.h" +#include "vblank.h" + +#include "glxextensions.h" #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... @@ -54,64 +63,34 @@ #define PCI_CHIP_R200_LW 0x4C57 #define PCI_CHIP_R200_LY 0x4C59 #define PCI_CHIP_R200_LZ 0x4C5A -#define PCI_CHIP_RV200_QW 0x5157 +#define PCI_CHIP_RV200_QW 0x5157 /* Radeon 7500 - not an R200 at all */ #endif static r200ScreenPtr __r200Screen; +static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); + /* Create the device specific screen private data struct. */ static r200ScreenPtr r200CreateScreen( __DRIscreenPrivate *sPriv ) { - r200ScreenPtr r200Screen; - RADEONDRIPtr r200DRIPriv = (RADEONDRIPtr)sPriv->pDevPriv; - - /* Check the DRI version */ - { - int major, minor, patch; - if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 4 || minor < 0 ) { - __driUtilMessage( "R200 DRI driver expected DRI version 4.0.x " - "but got version %d.%d.%d", - major, minor, patch ); - return NULL; - } - } - } + r200ScreenPtr screen; + RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv; + unsigned char *RADEONMMIO; - /* Check that the DDX driver version is compatible */ - if ( sPriv->ddxMajor != 4 || - sPriv->ddxMinor < 0 ) { - __driUtilMessage( "R200 DRI driver expected DDX driver version 4.0.x " - "but got version %d.%d.%d", - sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch ); + if ( ! driCheckDriDdxDrmVersions( sPriv, "R200", 4, 0, 4, 0, 1, 5 ) ) return NULL; - } - - /* Check that the DRM driver version is compatible - * -- R200 support added at 1.5.0. - */ - if ( sPriv->drmMajor != 1 || - sPriv->drmMinor < 5) { - __driUtilMessage( "R200 DRI driver expected DRM driver version 1.5.x " - "but got version %d.%d.%d", - sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); - return NULL; - } - - /* Allocate the private area */ - r200Screen = (r200ScreenPtr) CALLOC( sizeof(*r200Screen) ); - if ( !r200Screen ) { - __driUtilMessage("%s: CALLOC r200Screen struct failed", + screen = (r200ScreenPtr) CALLOC( sizeof(*screen) ); + if ( !screen ) { + __driUtilMessage("%s: Could not allocate memory for screen structure", __FUNCTION__); return NULL; } - - switch ( r200DRIPriv->deviceID ) { + switch ( dri_priv->deviceID ) { case PCI_CHIP_R200_QD: case PCI_CHIP_R200_QE: case PCI_CHIP_R200_QF: @@ -123,10 +102,10 @@ case PCI_CHIP_R200_LY: case PCI_CHIP_R200_LZ: __driUtilMessage("r200CreateScreen(): Device isn't an r200!\n"); - FREE( r200Screen ); + FREE( screen ); return NULL; default: - r200Screen->chipset = R200_CHIPSET_R200; + screen->chipset = R200_CHIPSET_R200; break; } @@ -134,142 +113,177 @@ /* This is first since which regions we map depends on whether or * not we are using a PCI card. */ - r200Screen->IsPCI = r200DRIPriv->IsPCI; + screen->IsPCI = dri_priv->IsPCI; { int ret; drmRadeonGetParam gp; - gp.param = RADEON_PARAM_AGP_BUFFER_OFFSET; - gp.value = &r200Screen->agp_buffer_offset; + gp.param = RADEON_PARAM_GART_BUFFER_OFFSET; + gp.value = &screen->gart_buffer_offset; ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); if (ret) { - FREE( r200Screen ); - fprintf(stderr, "drmR200GetParam: %d\n", ret); + FREE( screen ); + fprintf(stderr, "drmRadeonGetParam (RADEON_PARAM_GART_BUFFER_OFFSET): %d\n", ret); return NULL; } - r200Screen->agp_texture_offset = - r200Screen->agp_buffer_offset + 2*1024*1024; - - if (sPriv->drmMinor >= 6) { - gp.param = RADEON_PARAM_AGP_BASE; - gp.value = &r200Screen->agp_base; + gp.param = RADEON_PARAM_GART_BASE; + gp.value = &screen->gart_base; ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); if (ret) { - FREE( r200Screen ); - fprintf(stderr, - "drmR200GetParam (RADEON_PARAM_AGP_BUFFER_OFFSET): %d\n", - ret); + FREE( screen ); + fprintf(stderr, "drmR200GetParam (RADEON_PARAM_GART_BASE): %d\n", ret); return NULL; } - } - if (sPriv->drmMinor >= 6) { + gp.param = RADEON_PARAM_IRQ_NR; - gp.value = &r200Screen->irq; + gp.value = &screen->irq; ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); if (ret) { - FREE( r200Screen ); - fprintf(stderr, "drmR200GetParam (RADEON_PARAM_IRQ_NR): %d\n", ret); + FREE( screen ); + fprintf(stderr, "drmRadeonGetParam (RADEON_PARAM_IRQ_NR): %d\n", ret); return NULL; } - } + /* Check if kernel module is new enough to support cube maps */ + screen->drmSupportsCubeMaps = (sPriv->drmMinor >= 7); + } } - r200Screen->mmio.handle = r200DRIPriv->registerHandle; - r200Screen->mmio.size = r200DRIPriv->registerSize; + screen->mmio.handle = dri_priv->registerHandle; + screen->mmio.size = dri_priv->registerSize; if ( drmMap( sPriv->fd, - r200Screen->mmio.handle, - r200Screen->mmio.size, - &r200Screen->mmio.map ) ) { - FREE( r200Screen ); - __driUtilMessage("r200CreateScreen(): drmMap failed\n"); + screen->mmio.handle, + screen->mmio.size, + &screen->mmio.map ) ) { + FREE( screen ); + __driUtilMessage("%s: drmMap failed\n", __FUNCTION__ ); return NULL; } - r200Screen->status.handle = r200DRIPriv->statusHandle; - r200Screen->status.size = r200DRIPriv->statusSize; + RADEONMMIO = screen->mmio.map; + + screen->status.handle = dri_priv->statusHandle; + screen->status.size = dri_priv->statusSize; if ( drmMap( sPriv->fd, - r200Screen->status.handle, - r200Screen->status.size, - &r200Screen->status.map ) ) { - drmUnmap( r200Screen->mmio.map, r200Screen->mmio.size ); - FREE( r200Screen ); - __driUtilMessage("r200CreateScreen(): drmMap (2) failed\n"); + screen->status.handle, + screen->status.size, + &screen->status.map ) ) { + drmUnmap( screen->mmio.map, screen->mmio.size ); + FREE( screen ); + __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ ); return NULL; } - r200Screen->scratch = (__volatile__ CARD32 *) - ((GLubyte *)r200Screen->status.map + RADEON_SCRATCH_REG_OFFSET); + screen->scratch = (__volatile__ CARD32 *) + ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET); - r200Screen->buffers = drmMapBufs( sPriv->fd ); - if ( !r200Screen->buffers ) { - drmUnmap( r200Screen->status.map, r200Screen->status.size ); - drmUnmap( r200Screen->mmio.map, r200Screen->mmio.size ); - FREE( r200Screen ); - __driUtilMessage("r200CreateScreen(): drmMapBufs failed\n"); + screen->buffers = drmMapBufs( sPriv->fd ); + if ( !screen->buffers ) { + drmUnmap( screen->status.map, screen->status.size ); + drmUnmap( screen->mmio.map, screen->mmio.size ); + FREE( screen ); + __driUtilMessage("%s: drmMapBufs failed\n", __FUNCTION__ ); return NULL; } - if ( !r200Screen->IsPCI ) { - r200Screen->agpTextures.handle = r200DRIPriv->agpTexHandle; - r200Screen->agpTextures.size = r200DRIPriv->agpTexMapSize; + if ( dri_priv->gartTexHandle && dri_priv->gartTexMapSize ) { + screen->gartTextures.handle = dri_priv->gartTexHandle; + screen->gartTextures.size = dri_priv->gartTexMapSize; if ( drmMap( sPriv->fd, - r200Screen->agpTextures.handle, - r200Screen->agpTextures.size, - (drmAddressPtr)&r200Screen->agpTextures.map ) ) { - drmUnmapBufs( r200Screen->buffers ); - drmUnmap( r200Screen->status.map, r200Screen->status.size ); - drmUnmap( r200Screen->mmio.map, r200Screen->mmio.size ); - FREE( r200Screen ); - __driUtilMessage("r200CreateScreen(): IsPCI failed\n"); + screen->gartTextures.handle, + screen->gartTextures.size, + (drmAddressPtr)&screen->gartTextures.map ) ) { + drmUnmapBufs( screen->buffers ); + drmUnmap( screen->status.map, screen->status.size ); + drmUnmap( screen->mmio.map, screen->mmio.size ); + FREE( screen ); + __driUtilMessage("%s: drmMAP failed for GART texture area\n", __FUNCTION__); return NULL; } + + screen->gart_texture_offset = dri_priv->gartTexOffset + ( screen->IsPCI + ? INREG( RADEON_AIC_LO_ADDR ) + : ( ( INREG( RADEON_MC_AGP_LOCATION ) & 0x0ffffU ) << 16 ) ); } + screen->cpp = dri_priv->bpp / 8; + screen->AGPMode = dri_priv->AGPMode; + screen->fbLocation = ( INREG( RADEON_MC_FB_LOCATION ) & 0xffff ) << 16; - r200Screen->cpp = r200DRIPriv->bpp / 8; - r200Screen->AGPMode = r200DRIPriv->AGPMode; + if ( sPriv->drmMinor >= 10 ) { + drmRadeonSetParam sp; - r200Screen->frontOffset = r200DRIPriv->frontOffset; - r200Screen->frontPitch = r200DRIPriv->frontPitch; - r200Screen->backOffset = r200DRIPriv->backOffset; - r200Screen->backPitch = r200DRIPriv->backPitch; - r200Screen->depthOffset = r200DRIPriv->depthOffset; - r200Screen->depthPitch = r200DRIPriv->depthPitch; - - r200Screen->texOffset[RADEON_CARD_HEAP] = r200DRIPriv->textureOffset; - r200Screen->texSize[RADEON_CARD_HEAP] = r200DRIPriv->textureSize; - r200Screen->logTexGranularity[RADEON_CARD_HEAP] = - r200DRIPriv->log2TexGran; - - if ( r200Screen->IsPCI ) { - r200Screen->numTexHeaps = RADEON_NR_TEX_HEAPS - 1; - r200Screen->texOffset[RADEON_AGP_HEAP] = 0; - r200Screen->texSize[RADEON_AGP_HEAP] = 0; - r200Screen->logTexGranularity[RADEON_AGP_HEAP] = 0; - } else { - r200Screen->numTexHeaps = RADEON_NR_TEX_HEAPS; - r200Screen->texOffset[RADEON_AGP_HEAP] = - r200DRIPriv->agpTexOffset + R200_AGP_TEX_OFFSET; - r200Screen->texSize[RADEON_AGP_HEAP] = r200DRIPriv->agpTexMapSize; - r200Screen->logTexGranularity[RADEON_AGP_HEAP] = - r200DRIPriv->log2AGPTexGran; + sp.param = RADEON_SETPARAM_FB_LOCATION; + sp.value = screen->fbLocation; + + drmCommandWrite( sPriv->fd, DRM_RADEON_SETPARAM, + &sp, sizeof( sp ) ); } + screen->frontOffset = dri_priv->frontOffset; + screen->frontPitch = dri_priv->frontPitch; + screen->backOffset = dri_priv->backOffset; + screen->backPitch = dri_priv->backPitch; + screen->depthOffset = dri_priv->depthOffset; + screen->depthPitch = dri_priv->depthPitch; + + screen->texOffset[RADEON_CARD_HEAP] = dri_priv->textureOffset + + screen->fbLocation; + screen->texSize[RADEON_CARD_HEAP] = dri_priv->textureSize; + screen->logTexGranularity[RADEON_CARD_HEAP] = + dri_priv->log2TexGran; + + if ( !screen->gartTextures.map ) { + screen->numTexHeaps = RADEON_NR_TEX_HEAPS - 1; + screen->texOffset[RADEON_GART_HEAP] = 0; + screen->texSize[RADEON_GART_HEAP] = 0; + screen->logTexGranularity[RADEON_GART_HEAP] = 0; + } else { + screen->numTexHeaps = RADEON_NR_TEX_HEAPS; + screen->texOffset[RADEON_GART_HEAP] = screen->gart_texture_offset; + screen->texSize[RADEON_GART_HEAP] = dri_priv->gartTexMapSize; + screen->logTexGranularity[RADEON_GART_HEAP] = + dri_priv->log2GARTTexGran; + } + + screen->driScreen = sPriv; + screen->sarea_priv_offset = dri_priv->sarea_priv_offset; + + if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + + if ( glx_enable_extension != NULL ) { + if ( screen->irq != 0 ) { + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); + } + + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); - r200Screen->driScreen = sPriv; - r200Screen->sarea_priv_offset = r200DRIPriv->sarea_priv_offset; - return r200Screen; + if ( driCompareGLXAPIVersion( 20030818 ) >= 0 ) { + sPriv->psc->allocateMemory = r200AllocateMemoryMESA; + sPriv->psc->freeMemory = r200FreeMemoryMESA; + sPriv->psc->memoryOffset = r200GetMemoryOffsetMESA; + + (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" ); + } + } + } + + return screen; } /* Destroy the device specific screen private data struct. @@ -277,20 +291,19 @@ static void r200DestroyScreen( __DRIscreenPrivate *sPriv ) { - r200ScreenPtr r200Screen = (r200ScreenPtr)sPriv->private; + r200ScreenPtr screen = (r200ScreenPtr)sPriv->private; - if (!r200Screen) + if (!screen) return; - if ( !r200Screen->IsPCI ) { - drmUnmap( r200Screen->agpTextures.map, - r200Screen->agpTextures.size ); - } - drmUnmapBufs( r200Screen->buffers ); - drmUnmap( r200Screen->status.map, r200Screen->status.size ); - drmUnmap( r200Screen->mmio.map, r200Screen->mmio.size ); + if ( screen->gartTextures.map ) { + drmUnmap( screen->gartTextures.map, screen->gartTextures.size ); + } + drmUnmapBufs( screen->buffers ); + drmUnmap( screen->status.map, screen->status.size ); + drmUnmap( screen->mmio.map, screen->mmio.size ); - FREE( r200Screen ); + FREE( screen ); sPriv->private = NULL; } @@ -313,11 +326,10 @@ * data. */ static GLboolean -r200CreateBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) +r200CreateBuffer( __DRIscreenPrivate *driScrnPriv, + __DRIdrawablePrivate *driDrawPriv, + const __GLcontextModes *mesaVis, + GLboolean isPixmap ) { if (isPixmap) { return GL_FALSE; /* not implemented */ @@ -362,21 +374,25 @@ } static struct __DriverAPIRec r200API = { - r200InitDriver, - r200DestroyScreen, - r200CreateContext, - r200DestroyContext, - r200CreateBuffer, - r200DestroyBuffer, - r200SwapBuffers, - r200MakeCurrent, - r200UnbindContext, - r200OpenCloseFullScreen, - r200OpenCloseFullScreen + .InitDriver = r200InitDriver, + .DestroyScreen = r200DestroyScreen, + .CreateContext = r200CreateContext, + .DestroyContext = r200DestroyContext, + .CreateBuffer = r200CreateBuffer, + .DestroyBuffer = r200DestroyBuffer, + .SwapBuffers = r200SwapBuffers, + .MakeCurrent = r200MakeCurrent, + .UnbindContext = r200UnbindContext, + .OpenFullScreen = r200OpenCloseFullScreen, + .CloseFullScreen = r200OpenCloseFullScreen, + .GetSwapInfo = getSwapInfo, + .GetMSC = driGetMSC32, + .WaitForMSC = driWaitForMSC32, + .WaitForSBC = NULL, + .SwapBuffersMSC = NULL }; - /* * This is the bootstrap function for the driver. * The __driCreateScreen name is the symbol that libGL.so fetches. @@ -392,45 +408,57 @@ } -/* This function is called by libGL.so as soon as libGL.so is loaded. - * This is where we'd register new extension functions with the dispatcher. +/** + * This function is called by libGL.so to allow the driver to dynamically + * extend libGL. We can add new GLX functions and/or new GL functions. + * Note that _mesa_create_context() will probably add most of the newer + * OpenGL extension functions into the dispatcher. + * + * \todo This interface has been deprecated, so we should probably remove + * this function before the next XFree86 release. */ void __driRegisterExtensions( void ) { - /* dlopen ourself */ - void *dll = dlopen(NULL, RTLD_GLOBAL); - if (dll) { - typedef void *(*registerFunc)(const char *funcName, void *funcAddr); - typedef void (*registerString)(const char *extName); - - /* Get pointers to libGL's __glXRegisterGLXFunction - * and __glXRegisterGLXExtensionString, if they exist. - */ - registerFunc regFunc = (registerFunc) dlsym(dll, "__glXRegisterGLXFunction"); - registerString regString = (registerString) dlsym(dll, "__glXRegisterGLXExtensionString"); - - if (regFunc) { - /* register our GLX extensions with libGL */ - void *p; - p = regFunc("glXAllocateMemoryNV", (void *) r200AllocateMemoryNV); - if (p) - ; /* XXX already registered - what to do, wrap? */ - - p = regFunc("glXFreeMemoryNV", (void *) r200FreeMemoryNV); - if (p) - ; /* XXX already registered - what to do, wrap? */ - - p = regFunc("glXGetAGPOffsetMESA", (void *) r200GetAGPOffset); - if (p) - ; /* XXX already registered - what to do, wrap? */ - } + PFNGLXENABLEEXTENSIONPROC glx_enable_extension; + - if (regString) { - regString("GLX_NV_vertex_array_range"); - regString("GLX_MESA_agp_offset"); + if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { + glx_enable_extension = (PFNGLXENABLEEXTENSIONPROC) + glXGetProcAddress( (const GLubyte *) "__glXEnableExtension" ); + + if ( glx_enable_extension != NULL ) { + (*glx_enable_extension)( "GLX_SGI_swap_control", GL_FALSE ); + (*glx_enable_extension)( "GLX_SGI_video_sync", GL_FALSE ); + (*glx_enable_extension)( "GLX_MESA_swap_control", GL_FALSE ); + (*glx_enable_extension)( "GLX_MESA_swap_frame_usage", GL_FALSE ); } + } +} + - dlclose(dll); +/** + * Get information about previous buffer swaps. + */ +static int +getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ) +{ + r200ContextPtr rmesa; + + if ( (dPriv == NULL) || (dPriv->driContextPriv == NULL) + || (dPriv->driContextPriv->driverPrivate == NULL) + || (sInfo == NULL) ) { + return -1; } + + rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate; + sInfo->swap_count = rmesa->swap_count; + sInfo->swap_ust = rmesa->swap_ust; + sInfo->swap_missed_count = rmesa->swap_missed_count; + + sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0) + ? driCalculateSwapUsage( dPriv, 0, rmesa->swap_missed_ust ) + : 0.0; + + return 0; } Index: xc/lib/GL/mesa/src/drv/r200/r200_screen.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_screen.h:1.1 xc/lib/GL/mesa/src/drv/r200/r200_screen.h:1.3 --- xc/lib/GL/mesa/src/drv/r200/r200_screen.h:1.1 Wed Oct 30 07:51:52 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_screen.h Tue Dec 2 08:02:39 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_screen.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_screen.h,v 1.3 2003/12/02 13:02:39 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -37,7 +38,6 @@ #ifdef GLX_DIRECT_RENDERING -#include #include "dri_util.h" #include "xf86drm.h" #include "radeon_common.h" @@ -63,6 +63,7 @@ int AGPMode; unsigned int irq; /* IRQ number (0 means none) */ + unsigned int fbLocation; unsigned int frontOffset; unsigned int frontPitch; unsigned int backOffset; @@ -79,7 +80,7 @@ r200RegionRec mmio; r200RegionRec status; - r200RegionRec agpTextures; + r200RegionRec gartTextures; drmBufMapPtr buffers; @@ -87,9 +88,11 @@ __DRIscreenPrivate *driScreen; unsigned int sarea_priv_offset; - unsigned int agp_buffer_offset; /* offset in card memory space */ - unsigned int agp_texture_offset; /* offset in card memory space */ - unsigned int agp_base; + unsigned int gart_buffer_offset; /* offset in card memory space */ + unsigned int gart_texture_offset; /* offset in card memory space */ + unsigned int gart_base; + + GLboolean drmSupportsCubeMaps; /* need radeon kernel module >=1.7 */ } r200ScreenRec, *r200ScreenPtr; #endif Index: xc/lib/GL/mesa/src/drv/r200/r200_span.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_span.c:1.1 xc/lib/GL/mesa/src/drv/r200/r200_span.c:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_span.c:1.1 Wed Oct 30 07:51:52 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_span.c Sun Sep 28 16:15:24 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_span.c,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_span.c,v 1.2 2003/09/28 20:15:24 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,21 +25,25 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ +#include "glheader.h" +#include "imports.h" +#include "swrast/swrast.h" +#include "colormac.h" + #include "r200_context.h" #include "r200_ioctl.h" #include "r200_state.h" #include "r200_span.h" #include "r200_tex.h" -#include "swrast/swrast.h" - #define DBG 0 #define LOCAL_VARS \ @@ -179,7 +183,7 @@ * Depth buffer */ -/* The R200 has depth tiling on all the time, so we have to convert +/* The Radeon family has depth tiling on all the time, so we have to convert * the x,y coordinates into the memory bus address (mba) in the same * manner as the engine. In each case, the linear block address (ba) * is calculated, and then wired with x and y to produce the final @@ -285,33 +289,46 @@ #include "stenciltmp.h" -static void r200SetReadBuffer( GLcontext *ctx, - GLframebuffer *colorBuffer, - GLenum mode ) +/* + * This function is called to specify which buffer to read and write + * for software rasterization (swrast) fallbacks. This doesn't necessarily + * correspond to glDrawBuffer() or glReadBuffer() calls. + */ +static void r200SetBuffer( GLcontext *ctx, + GLframebuffer *colorBuffer, + GLuint bufferBit ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - switch ( mode ) { - case GL_FRONT_LEFT: + switch ( bufferBit ) { + case FRONT_LEFT_BIT: if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset; rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch; + rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset; + rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch; } else { rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset; rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch; + rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset; + rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch; } break; - case GL_BACK_LEFT: + case BACK_LEFT_BIT: if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset; rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch; + rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset; + rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch; } else { rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset; rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch; + rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset; + rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch; } break; default: - assert(0); + _mesa_problem(ctx, "Bad bufferBit in %s", __FUNCTION__); break; } } @@ -359,7 +376,7 @@ r200ContextPtr rmesa = R200_CONTEXT(ctx); struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SetReadBuffer = r200SetReadBuffer; + swdd->SetBuffer = r200SetBuffer; switch ( rmesa->r200Screen->cpp ) { case 2: Index: xc/lib/GL/mesa/src/drv/r200/r200_span.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_span.h:1.1 xc/lib/GL/mesa/src/drv/r200/r200_span.h:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_span.h:1.1 Wed Oct 30 07:51:52 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_span.h Sun Sep 28 16:15:24 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_span.h,v 1.1 2002/10/30 12:51:52 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_span.h,v 1.2 2003/09/28 20:15:24 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: Index: xc/lib/GL/mesa/src/drv/r200/r200_state.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_state.c:1.4 xc/lib/GL/mesa/src/drv/r200/r200_state.c:1.7 --- xc/lib/GL/mesa/src/drv/r200/r200_state.c:1.4 Sun Feb 23 18:59:01 2003 +++ xc/lib/GL/mesa/src/drv/r200/r200_state.c Tue Dec 2 08:02:39 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state.c,v 1.4 2003/02/23 23:59:01 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state.c,v 1.7 2003/12/02 13:02:39 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,27 +25,20 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ -#include "r200_context.h" -#include "r200_ioctl.h" -#include "r200_state.h" -#include "r200_tcl.h" -#include "r200_tex.h" -#include "r200_swtcl.h" -#include "r200_vtxfmt.h" - -#include "mem.h" -#include "mmath.h" +#include "glheader.h" +#include "imports.h" +#include "api_arrayelt.h" #include "enums.h" #include "colormac.h" -#include "light.h" -#include "api_arrayelt.h" +#include "state.h" #include "swrast/swrast.h" #include "array_cache/acache.h" @@ -54,19 +47,31 @@ #include "swrast_setup/swrast_setup.h" +#include "r200_context.h" +#include "r200_ioctl.h" +#include "r200_state.h" +#include "r200_tcl.h" +#include "r200_tex.h" +#include "r200_swtcl.h" +#include "r200_vtxfmt.h" + + /* ============================================================= * Alpha blending */ -static void r200AlphaFunc( GLcontext *ctx, GLenum func, GLchan ref ) +static void r200AlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); int pp_misc = rmesa->hw.ctx.cmd[CTX_PP_MISC]; + GLubyte refByte; + + CLAMPED_FLOAT_TO_UBYTE(refByte, ref); R200_STATECHANGE( rmesa, ctx ); pp_misc &= ~(R200_ALPHA_TEST_OP_MASK | R200_REF_ALPHA_MASK); - pp_misc |= (ref & R200_REF_ALPHA_MASK); + pp_misc |= (refByte & R200_REF_ALPHA_MASK); switch ( func ) { case GL_NEVER: @@ -94,7 +99,7 @@ pp_misc |= R200_ALPHA_TEST_PASS; break; } - + rmesa->hw.ctx.cmd[CTX_PP_MISC] = pp_misc; } @@ -104,24 +109,24 @@ GLuint b = rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] & ~R200_COMB_FCN_MASK; switch ( mode ) { - case GL_FUNC_ADD_EXT: + case GL_FUNC_ADD: case GL_LOGIC_OP: b |= R200_COMB_FCN_ADD_CLAMP; break; - case GL_FUNC_SUBTRACT_EXT: + case GL_FUNC_SUBTRACT: b |= R200_COMB_FCN_SUB_CLAMP; break; - case GL_FUNC_REVERSE_SUBTRACT_EXT: + case GL_FUNC_REVERSE_SUBTRACT: b |= R200_COMB_FCN_RSUB_CLAMP; break; - case GL_MIN_EXT: + case GL_MIN: b |= R200_COMB_FCN_MIN; break; - case GL_MAX_EXT: + case GL_MAX: b |= R200_COMB_FCN_MAX; break; @@ -157,6 +162,12 @@ case GL_ONE_MINUS_DST_COLOR: b |= R200_SRC_BLEND_GL_ONE_MINUS_DST_COLOR; break; + case GL_SRC_COLOR: + b |= R200_SRC_BLEND_GL_SRC_COLOR; + break; + case GL_ONE_MINUS_SRC_COLOR: + b |= R200_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR; + break; case GL_SRC_ALPHA: b |= R200_SRC_BLEND_GL_SRC_ALPHA; break; @@ -207,6 +218,12 @@ case GL_ONE_MINUS_SRC_ALPHA: b |= R200_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA; break; + case GL_DST_COLOR: + b |= R200_DST_BLEND_GL_DST_COLOR; + break; + case GL_ONE_MINUS_DST_COLOR: + b |= R200_DST_BLEND_GL_ONE_MINUS_DST_COLOR; + break; case GL_DST_ALPHA: b |= R200_DST_BLEND_GL_DST_ALPHA; break; @@ -248,7 +265,7 @@ static void r200DepthFunc( GLcontext *ctx, GLenum func ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - + R200_STATECHANGE( rmesa, ctx ); rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &= ~R200_Z_TEST_MASK; @@ -430,7 +447,7 @@ MALLOC( rmesa->state.scissor.numAllocedClipRects * sizeof(XF86DRIClipRectRec) ); - if (!rmesa->state.scissor.numAllocedClipRects) { + if ( rmesa->state.scissor.pClipRects == NULL ) { rmesa->state.scissor.numAllocedClipRects = 0; return; } @@ -552,8 +569,7 @@ */ static void r200PointSize( GLcontext *ctx, GLfloat size ) { - if (R200_DEBUG & DEBUG_STATE) - fprintf(stderr, "%s: %f\n", __FUNCTION__, size ); + if (0) fprintf(stderr, "%s: %f\n", __FUNCTION__, size ); } /* ============================================================= @@ -704,6 +720,7 @@ rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] &= ~R200_OUTPUT_COLOR_0; rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] &= ~R200_OUTPUT_COLOR_1; rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] &= ~R200_LIGHTING_ENABLE; + p &= ~R200_SPECULAR_ENABLE; rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] |= R200_DIFFUSE_SPECULAR_COMBINE; @@ -737,9 +754,9 @@ } if (ctx->Fog.Enabled) { - rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |= - ((R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT)); - rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_1; + rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] |= + ((R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT)); + rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] |= R200_OUTPUT_COLOR_1; } if ( rmesa->hw.ctx.cmd[CTX_PP_CNTL] != p ) { @@ -1000,7 +1017,6 @@ } -/* R200_STATECHANGE( rmesa, glt ); */ if (ctx->Light.Enabled) { GLint p; @@ -1050,9 +1066,15 @@ case GL_POSITION: { /* positions picked up in update_light, but can do flag here */ - GLuint flag = (p&1)? R200_LIGHT_1_IS_LOCAL : R200_LIGHT_0_IS_LOCAL; + GLuint flag; GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2; + /* FIXME: Set RANGE_ATTEN only when needed */ + if (p&1) + flag = R200_LIGHT_1_IS_LOCAL; + else + flag = R200_LIGHT_0_IS_LOCAL; + R200_STATECHANGE(rmesa, tcl); if (l->EyePosition[3] != 0.0F) rmesa->hw.tcl.cmd[idx] |= flag; @@ -1098,6 +1120,31 @@ return; } + /* Set RANGE_ATTEN only when needed */ + switch (pname) { + case GL_POSITION: + case GL_LINEAR_ATTENUATION: + case GL_QUADRATIC_ATTENUATION: + { + GLuint flag; + GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2; + + if (p&1) + flag = R200_LIGHT_1_ENABLE_RANGE_ATTEN; + else + flag = R200_LIGHT_0_ENABLE_RANGE_ATTEN; + + R200_STATECHANGE(rmesa, tcl); + if (l->EyePosition[3] != 0.0F && + (l->LinearAttenuation != 0.0F || l->QuadraticAttenuation != 0.0F)) + rmesa->hw.tcl.cmd[idx] |= flag; + else + rmesa->hw.tcl.cmd[idx] &= ~flag; + break; + } + default: + break; + } } @@ -1202,7 +1249,7 @@ GLuint p; for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipEnabled[p]) { + if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p]; R200_STATECHANGE( rmesa, ucp[p] ); @@ -1223,8 +1270,8 @@ GLint ref, GLuint mask ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - GLuint refmask = ((ctx->Stencil.Ref << R200_STENCIL_REF_SHIFT) | - (ctx->Stencil.ValueMask << R200_STENCIL_MASK_SHIFT)); + GLuint refmask = ((ctx->Stencil.Ref[0] << R200_STENCIL_REF_SHIFT) | + (ctx->Stencil.ValueMask[0] << R200_STENCIL_MASK_SHIFT)); R200_STATECHANGE( rmesa, ctx ); R200_STATECHANGE( rmesa, msk ); @@ -1233,7 +1280,7 @@ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~(R200_STENCIL_REF_MASK| R200_STENCIL_VALUE_MASK); - switch ( ctx->Stencil.Function ) { + switch ( ctx->Stencil.Function[0] ) { case GL_NEVER: rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_TEST_NEVER; break; @@ -1270,7 +1317,7 @@ R200_STATECHANGE( rmesa, msk ); rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~R200_STENCIL_WRITE_MASK; rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |= - (ctx->Stencil.WriteMask << R200_STENCIL_WRITEMASK_SHIFT); + (ctx->Stencil.WriteMask[0] << R200_STENCIL_WRITEMASK_SHIFT); } static void r200StencilOp( GLcontext *ctx, GLenum fail, @@ -1283,7 +1330,7 @@ R200_STENCIL_ZFAIL_MASK | R200_STENCIL_ZPASS_MASK); - switch ( ctx->Stencil.FailFunc ) { + switch ( ctx->Stencil.FailFunc[0] ) { case GL_KEEP: rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_FAIL_KEEP; break; @@ -1310,7 +1357,7 @@ break; } - switch ( ctx->Stencil.ZFailFunc ) { + switch ( ctx->Stencil.ZFailFunc[0] ) { case GL_KEEP: rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZFAIL_KEEP; break; @@ -1337,7 +1384,7 @@ break; } - switch ( ctx->Stencil.ZPassFunc ) { + switch ( ctx->Stencil.ZPassFunc[0] ) { case GL_KEEP: rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= R200_STENCIL_ZPASS_KEEP; break; @@ -1372,7 +1419,7 @@ rmesa->state.stencil.clear = ((GLuint) ctx->Stencil.Clear | (0xff << R200_STENCIL_MASK_SHIFT) | - (ctx->Stencil.WriteMask << R200_STENCIL_WRITEMASK_SHIFT)); + (ctx->Stencil.WriteMask[0] << R200_STENCIL_WRITEMASK_SHIFT)); } @@ -1483,11 +1530,17 @@ * Miscellaneous */ -static void r200ClearColor( GLcontext *ctx, const GLchan c[4] ) +static void r200ClearColor( GLcontext *ctx, const GLfloat c[4] ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLubyte color[4]; + CLAMPED_FLOAT_TO_UBYTE(color[0], c[0]); + CLAMPED_FLOAT_TO_UBYTE(color[1], c[1]); + CLAMPED_FLOAT_TO_UBYTE(color[2], c[2]); + CLAMPED_FLOAT_TO_UBYTE(color[3], c[3]); rmesa->state.color.clear = r200PackColor( rmesa->r200Screen->cpp, - c[0], c[1], c[2], c[3] ); + color[0], color[1], + color[2], color[3] ); } @@ -1560,7 +1613,7 @@ } -static void r200SetDrawBuffer( GLcontext *ctx, GLenum mode ) +static void r200DrawBuffer( GLcontext *ctx, GLenum mode ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); @@ -1570,41 +1623,42 @@ R200_FIREVERTICES(rmesa); /* don't pipeline cliprect changes */ - switch ( mode ) { - case GL_FRONT_LEFT: + /* + * _DrawDestMask is easier to cope with than . + */ + switch ( ctx->Color._DrawDestMask ) { + case FRONT_LEFT_BIT: FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE ); - if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) { - rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset; - rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch; - } else { - rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset; - rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch; - } r200SetCliprects( rmesa, GL_FRONT_LEFT ); break; - case GL_BACK_LEFT: + case BACK_LEFT_BIT: FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE ); - if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) { - rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset; - rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch; - } else { - rmesa->state.color.drawOffset = rmesa->r200Screen->backOffset; - rmesa->state.color.drawPitch = rmesa->r200Screen->backPitch; - } r200SetCliprects( rmesa, GL_BACK_LEFT ); break; default: + /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_TRUE ); return; } + /* We want to update the s/w rast state too so that r200SetBuffer() + * gets called. + */ + _swrast_DrawBuffer(ctx, mode); + R200_STATECHANGE( rmesa, ctx ); - rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = (rmesa->state.color.drawOffset & - R200_COLOROFFSET_MASK); + rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = ((rmesa->state.color.drawOffset + + rmesa->r200Screen->fbLocation) + & R200_COLOROFFSET_MASK); rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch; } +static void r200ReadBuffer( GLcontext *ctx, GLenum mode ) +{ + /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */ +} + /* ============================================================= * State enable/disable */ @@ -1706,6 +1760,7 @@ rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~R200_TCL_FOG_MASK; } r200UpdateSpecular( ctx ); /* for PK_SPEC */ + _mesa_allow_light_in_model( ctx, !state ); break; case GL_LIGHT0: @@ -1934,7 +1989,7 @@ R200_DB_STATECHANGE( rmesa, &rmesa->hw.mat[idx] ); } -static void upload_matrix_t( r200ContextPtr rmesa, GLfloat *src, int idx ) +static void upload_matrix_t( r200ContextPtr rmesa, const GLfloat *src, int idx ) { float *dest = ((float *)R200_DB_STATE( mat[idx] ))+MAT_ELT_0; memcpy(dest, src, 16*sizeof(float)); @@ -1960,7 +2015,7 @@ if (!ctx->Texture.Unit[unit]._ReallyEnabled) continue; - if (ctx->TextureMatrix[unit].type != MATRIX_IDENTITY) { + if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) { rmesa->TexMatEnabled |= (R200_TEXGEN_TEXMAT_0_ENABLE| R200_TEXMAT_0_ENABLE) << unit; @@ -1972,11 +2027,11 @@ */ _math_matrix_mul_matrix( &rmesa->tmpmat, &rmesa->TexGenMatrix[unit], - &ctx->TextureMatrix[unit] ); + ctx->TextureMatrixStack[unit].Top ); upload_matrix( rmesa, rmesa->tmpmat.m, R200_MTX_TEX0+unit ); } else { - upload_matrix( rmesa, ctx->TextureMatrix[unit].m, + upload_matrix( rmesa, ctx->TextureMatrixStack[unit].Top->m, R200_MTX_TEX0+unit ); } } @@ -2022,8 +2077,8 @@ /* Need these for lighting (shouldn't upload otherwise) */ if (new_state & (_NEW_MODELVIEW)) { - upload_matrix( rmesa, ctx->ModelView.m, R200_MTX_MV ); - upload_matrix_t( rmesa, ctx->ModelView.inv, R200_MTX_IMV ); + upload_matrix( rmesa, ctx->ModelviewMatrixStack.Top->m, R200_MTX_MV ); + upload_matrix_t( rmesa, ctx->ModelviewMatrixStack.Top->inv, R200_MTX_IMV ); } /* Does this need to be triggered on eg. modelview for @@ -2040,7 +2095,7 @@ /* emit all active clip planes if projection matrix changes. */ if (new_state & (_NEW_PROJECTION)) { - if (ctx->Transform._AnyClip) + if (ctx->Transform.ClipPlanesEnabled) r200UpdateClipPlanes( ctx ); } @@ -2095,7 +2150,8 @@ ctx->Driver.UpdateState = r200InvalidateState; ctx->Driver.LightingSpaceChange = r200LightingSpaceChange; - ctx->Driver.SetDrawBuffer = r200SetDrawBuffer; + ctx->Driver.DrawBuffer = r200DrawBuffer; + ctx->Driver.ReadBuffer = r200ReadBuffer; ctx->Driver.AlphaFunc = r200AlphaFunc; ctx->Driver.BlendEquation = r200BlendEquation; Index: xc/lib/GL/mesa/src/drv/r200/r200_state.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_state.h:1.2 xc/lib/GL/mesa/src/drv/r200/r200_state.h:1.3 --- xc/lib/GL/mesa/src/drv/r200/r200_state.h:1.2 Tue Nov 5 12:46:08 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_state.h Sun Sep 28 16:15:25 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state.h,v 1.2 2002/11/05 17:46:08 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state.h,v 1.3 2003/09/28 20:15:25 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: Index: xc/lib/GL/mesa/src/drv/r200/r200_state_init.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_state_init.c:1.4 xc/lib/GL/mesa/src/drv/r200/r200_state_init.c:1.6 --- xc/lib/GL/mesa/src/drv/r200/r200_state_init.c:1.4 Sat Feb 22 01:21:11 2003 +++ xc/lib/GL/mesa/src/drv/r200/r200_state_init.c Tue Dec 2 08:02:39 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state_init.c,v 1.4 2003/02/22 06:21:11 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_state_init.c,v 1.6 2003/12/02 13:02:39 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -32,19 +32,10 @@ * Keith Whitwell */ -#include "r200_context.h" -#include "r200_ioctl.h" -#include "r200_state.h" -#include "r200_tcl.h" -#include "r200_tex.h" -#include "r200_swtcl.h" -#include "r200_vtxfmt.h" - -#include "mem.h" -#include "mmath.h" +#include "glheader.h" +#include "imports.h" #include "enums.h" #include "colormac.h" -#include "light.h" #include "api_arrayelt.h" #include "swrast/swrast.h" @@ -53,6 +44,14 @@ #include "tnl/t_pipeline.h" #include "swrast_setup/swrast_setup.h" +#include "r200_context.h" +#include "r200_ioctl.h" +#include "r200_state.h" +#include "r200_tcl.h" +#include "r200_tex.h" +#include "r200_swtcl.h" +#include "r200_vtxfmt.h" + /* ============================================================= * State initialization */ @@ -131,28 +130,15 @@ CHECK( always, GL_TRUE ) -CHECK( tex_any, ctx->Texture._ReallyEnabled ) +CHECK( never, GL_FALSE ) +CHECK( tex_any, ctx->Texture._EnabledUnits ) CHECK( tex, ctx->Texture.Unit[idx]._ReallyEnabled ) CHECK( fog, ctx->Fog.Enabled ) TCL_CHECK( tcl, GL_TRUE ) -TCL_CHECK( tcl_tex_any, ctx->Texture._ReallyEnabled ) TCL_CHECK( tcl_tex, ctx->Texture.Unit[idx]._ReallyEnabled ) TCL_CHECK( tcl_lighting, ctx->Light.Enabled ) -TCL_CHECK( tcl_eyespace_or_lighting, ctx->_NeedEyeCoords || ctx->Light.Enabled ) TCL_CHECK( tcl_light, ctx->Light.Enabled && ctx->Light.Light[idx].Enabled ) -TCL_CHECK( tcl_ucp, ctx->Transform.ClipEnabled[idx] ) -/* TCL_CHECK( tcl_eyespace_or_fog, ctx->_NeedEyeCoords || ctx->Fog.Enabled ) */ - - -static GLboolean check_tcl_eyespace_or_fog( GLcontext *ctx, int idx ) -{ - r200ContextPtr rmesa = R200_CONTEXT(ctx); - int res; - (void) idx; - res = !rmesa->TclFallback && (ctx->_NeedEyeCoords || ctx->Fog.Enabled); - fprintf(stderr, "%s: %d\n", __FUNCTION__, res); - return res; -} +TCL_CHECK( tcl_ucp, (ctx->Transform.ClipPlanesEnabled & (1 << idx)) ) /* Initialize the context's hardware state. @@ -246,6 +232,15 @@ ALLOC_STATE( tex[0], tex_any, TEX_STATE_SIZE, "TEX/tex-0", 0 ); ALLOC_STATE( tex[1], tex_any, TEX_STATE_SIZE, "TEX/tex-1", 1 ); + if (rmesa->r200Screen->drmSupportsCubeMaps) { + ALLOC_STATE( cube[0], tex_any, CUBE_STATE_SIZE, "CUBE/tex-0", 0 ); + ALLOC_STATE( cube[1], tex_any, CUBE_STATE_SIZE, "CUBE/tex-1", 1 ); + } + else { + ALLOC_STATE( cube[0], never, CUBE_STATE_SIZE, "CUBE/tex-0", 0 ); + ALLOC_STATE( cube[1], never, CUBE_STATE_SIZE, "CUBE/tex-1", 1 ); + } + ALLOC_STATE( tcl, tcl, TCL_STATE_SIZE, "TCL/tcl", 0 ); ALLOC_STATE( msl, tcl, MSL_STATE_SIZE, "MSL/matrix-select", 0 ); ALLOC_STATE( tcg, tcl, TCG_STATE_SIZE, "TCG/texcoordgen", 0 ); @@ -301,6 +296,10 @@ rmesa->hw.tex[0].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_0); rmesa->hw.tex[1].cmd[TEX_CMD_0] = cmdpkt(R200_EMIT_PP_TXFILTER_1); rmesa->hw.tex[1].cmd[TEX_CMD_1] = cmdpkt(R200_EMIT_PP_TXOFFSET_1); + rmesa->hw.cube[0].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_0); + rmesa->hw.cube[0].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_0); + rmesa->hw.cube[1].cmd[CUBE_CMD_0] = cmdpkt(R200_EMIT_PP_CUBIC_FACES_1); + rmesa->hw.cube[1].cmd[CUBE_CMD_1] = cmdpkt(R200_EMIT_PP_CUBIC_OFFSETS_1); rmesa->hw.pix[0].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_0); rmesa->hw.pix[1].cmd[PIX_CMD_0] = cmdpkt(R200_EMIT_PP_TXCBLEND_1); rmesa->hw.zbs.cmd[ZBS_CMD_0] = cmdpkt(RADEON_EMIT_SE_ZBIAS_FACTOR); @@ -351,8 +350,8 @@ /* Initial Harware state: */ - rmesa->hw.ctx.cmd[CTX_PP_MISC] = (R200_ALPHA_TEST_PASS | - R200_RIGHT_HAND_CUBE_OGL); + rmesa->hw.ctx.cmd[CTX_PP_MISC] = (R200_ALPHA_TEST_PASS + /* | R200_RIGHT_HAND_CUBE_OGL*/); rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] = (R200_FOG_VERTEX | R200_FOG_USE_SPEC_ALPHA); @@ -364,7 +363,7 @@ R200_DST_BLEND_GL_ZERO ); rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHOFFSET] = - rmesa->r200Screen->depthOffset; + rmesa->r200Screen->depthOffset + rmesa->r200Screen->fbLocation; rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] = ((rmesa->r200Screen->depthPitch & @@ -465,16 +464,26 @@ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = 0x00000000; rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = 0x00000000; - rmesa->hw.tex[0].cmd[TEX_PP_TXFILTER] = R200_BORDER_MODE_OGL; - rmesa->hw.tex[0].cmd[TEX_PP_TXFORMAT] = - (R200_TXFORMAT_ST_ROUTE_STQ0 | - (2 << R200_TXFORMAT_WIDTH_SHIFT) | - (2 << R200_TXFORMAT_HEIGHT_SHIFT)); - rmesa->hw.tex[0].cmd[TEX_PP_TXOFFSET] = 0; - rmesa->hw.tex[0].cmd[TEX_PP_BORDER_COLOR] = 0; - rmesa->hw.tex[0].cmd[TEX_PP_TXFORMAT_X] = - (/* R200_TEXCOORD_PROJ | */ - 0x100000); /* Small default bias */ + for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) { + rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] = R200_BORDER_MODE_OGL; + rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] = + ((i << R200_TXFORMAT_ST_ROUTE_SHIFT) | /* <-- note i */ + (2 << R200_TXFORMAT_WIDTH_SHIFT) | + (2 << R200_TXFORMAT_HEIGHT_SHIFT)); + rmesa->hw.tex[i].cmd[TEX_PP_TXOFFSET] = + rmesa->r200Screen->texOffset[RADEON_CARD_HEAP]; + rmesa->hw.tex[i].cmd[TEX_PP_BORDER_COLOR] = 0; + rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT_X] = + (/* R200_TEXCOORD_PROJ | */ + 0x100000); /* Small default bias */ + + rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_FACES] = 0; + rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F1] = 0; + rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F2] = 0; + rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F3] = 0; + rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F4] = 0; + rmesa->hw.cube[i].cmd[CUBE_PP_CUBIC_OFFSET_F5] = 0; + } rmesa->hw.pix[0].cmd[PIX_PP_TXCBLEND] = (R200_TXC_ARG_A_ZERO | @@ -500,17 +509,6 @@ R200_TXA_CLAMP_0_1 | R200_TXA_OUTPUT_REG_R0); - rmesa->hw.tex[1].cmd[TEX_PP_TXFILTER] = R200_BORDER_MODE_OGL; - rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] = - (R200_TXFORMAT_ST_ROUTE_STQ1 | - (2 << R200_TXFORMAT_WIDTH_SHIFT) | - (2 << R200_TXFORMAT_HEIGHT_SHIFT)); - rmesa->hw.tex[1].cmd[TEX_PP_TXOFFSET] = 0; - rmesa->hw.tex[1].cmd[TEX_PP_BORDER_COLOR] = 0; - rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT_X] = - (/* R200_TEXCOORD_PROJ | */ - 0x100000); /* Small default bias */ - rmesa->hw.pix[1].cmd[PIX_PP_TXCBLEND] = (R200_TXC_ARG_A_ZERO | R200_TXC_ARG_B_ZERO | @@ -653,7 +651,7 @@ ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION, &l->LinearAttenuation ); ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION, - &l->QuadraticAttenuation ); + &l->QuadraticAttenuation ); } ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT, Index: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c:1.3 xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c:1.6 --- xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c:1.3 Mon Dec 23 10:29:26 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c Sun Sep 28 16:15:25 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c,v 1.3 2002/12/23 15:29:26 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.c,v 1.6 2003/09/28 20:15:25 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -36,16 +37,17 @@ #include "mtypes.h" #include "colormac.h" #include "enums.h" -#include "mem.h" -#include "mmath.h" -#include "macros.h" #include "image.h" +#include "imports.h" +#include "macros.h" -#include "swrast_setup/swrast_setup.h" +#include "swrast/s_context.h" #include "swrast/s_fog.h" +#include "swrast_setup/swrast_setup.h" #include "math/m_translate.h" #include "tnl/tnl.h" #include "tnl/t_context.h" +#include "tnl/t_imm_exec.h" #include "tnl/t_pipeline.h" #include "r200_context.h" @@ -275,7 +277,7 @@ TNLcontext *tnl = TNL_CONTEXT(ctx); rmesa->swtcl.SetupIndex = ind; - + if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { tnl->Driver.Render.Interp = r200_interp_extras; tnl->Driver.Render.CopyPV = r200_copy_pv_extras; @@ -374,9 +376,9 @@ if (ctx->Fog.Enabled || (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)) ind |= R200_SPEC_BIT; - if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY) + if (ctx->Texture._EnabledUnits & 0x2) /* unit 1 enabled */ ind |= R200_TEX0_BIT|R200_TEX1_BIT; - else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) + else if (ctx->Texture._EnabledUnits & 0x1) /* unit 1 enabled */ ind |= R200_TEX0_BIT; r200SetVertexFormat( ctx, ind ); @@ -390,9 +392,11 @@ if (R200_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s\n", __FUNCTION__); + rmesa->dma.flush = 0; + if (rmesa->dma.current.buf) { struct r200_dma_region *current = &rmesa->dma.current; - GLuint current_offset = (rmesa->r200Screen->agp_buffer_offset + + GLuint current_offset = (rmesa->r200Screen->gart_buffer_offset + current->buf->buf->idx * RADEON_BUFFER_SIZE + current->start); @@ -414,8 +418,6 @@ rmesa->swtcl.numverts = 0; current->start = current->ptr; - - rmesa->dma.flush = 0; } } @@ -431,6 +433,7 @@ r200RefillCurrentDmaRegion( rmesa ); if (!rmesa->dma.flush) { + rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; rmesa->dma.flush = flush_last_swtcl_prim; } @@ -442,7 +445,7 @@ { - GLubyte *head = rmesa->dma.current.address + rmesa->dma.current.ptr; + GLubyte *head = (GLubyte *) (rmesa->dma.current.address + rmesa->dma.current.ptr); rmesa->dma.current.ptr += bytes; rmesa->swtcl.numverts += nverts; return head; @@ -534,7 +537,7 @@ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK ); tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags ); - R200_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_CLIP; + R200_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_CLIP; } static void ELT_FALLBACK( GLcontext *ctx, @@ -546,7 +549,7 @@ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK ); tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); tnl->Driver.Render.PrimTabElts[flags&PRIM_MODE_MASK]( ctx, start, count, flags ); - R200_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_CLIP; + R200_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_CLIP; } @@ -586,7 +589,7 @@ \ r200EmitVertexAOS( rmesa, \ rmesa->swtcl.vertex_size, \ - (rmesa->r200Screen->agp_buffer_offset + \ + (rmesa->r200Screen->gart_buffer_offset + \ rmesa->swtcl.indexed_verts.buf->buf->idx * \ RADEON_BUFFER_SIZE + \ rmesa->swtcl.indexed_verts.start)); \ @@ -680,20 +683,20 @@ static void r200_check_render( GLcontext *ctx, struct gl_pipeline_stage *stage ) { - GLuint inputs = VERT_OBJ|VERT_CLIP|VERT_RGBA; + GLuint inputs = VERT_BIT_POS | VERT_BIT_CLIP | VERT_BIT_COLOR0; if (ctx->RenderMode == GL_RENDER) { if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - inputs |= VERT_SPEC_RGB; + inputs |= VERT_BIT_COLOR1; if (ctx->Texture.Unit[0]._ReallyEnabled) - inputs |= VERT_TEX(0); + inputs |= VERT_BIT_TEX0; if (ctx->Texture.Unit[1]._ReallyEnabled) - inputs |= VERT_TEX(1); + inputs |= VERT_BIT_TEX1; if (ctx->Fog.Enabled) - inputs |= VERT_FOG_COORD; + inputs |= VERT_BIT_FOG; } stage->inputs = inputs; @@ -858,6 +861,7 @@ #define RASTERIZE(x) r200RasterPrimitive( ctx, reduced_hw_prim[x] ) #define RENDER_PRIMITIVE rmesa->swtcl.render_primitive +#undef TAG #define TAG(x) x #include "tnl_dd/t_dd_unfilled.h" #undef IND @@ -1009,18 +1013,19 @@ /* Transition to/from hardware rasterization. */ /**********************************************************************/ -static char *fallbackStrings[] = { +static const char * const fallbackStrings[] = { "Texture mode", "glDrawBuffer(GL_FRONT_AND_BACK)", "glEnable(GL_STENCIL) without hw stencil buffer", "glRenderMode(selection or feedback)", "glBlendEquation", - "glBlendFunc(mode != ADD)" - "R200_NO_RAST" + "glBlendFunc(mode != ADD)", + "R200_NO_RAST", + "Mixing GL_CLAMP_TO_BORDER and GL_CLAMP (or GL_MIRROR_CLAMP_ATI)" }; -static char *getFallbackString(GLuint bit) +static const char *getFallbackString(GLuint bit) { int i = 0; while (bit > 1) { @@ -1133,7 +1138,7 @@ GLfloat f; if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) - f = _mesa_z_to_fogfactor(ctx, ctx->Current.FogCoord); + f = _mesa_z_to_fogfactor(ctx, ctx->Current.Attrib[VERT_ATTRIB_FOG][0]); else f = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance); @@ -1223,6 +1228,14 @@ } +void r200FlushVertices( GLcontext *ctx, GLuint flags ) +{ + _tnl_flush_vertices( ctx, flags ); + + if (flags & FLUSH_STORED_VERTICES) + R200_NEWPRIM( R200_CONTEXT( ctx ) ); +} + /**********************************************************************/ /* Initialization. */ /**********************************************************************/ @@ -1246,7 +1259,7 @@ tnl->Driver.Render.ResetLineStipple = r200ResetLineStipple; tnl->Driver.Render.BuildVertices = r200BuildVertices; - rmesa->swtcl.verts = (char *)ALIGN_MALLOC( size * 16 * 4, 32 ); + rmesa->swtcl.verts = (GLubyte *)ALIGN_MALLOC( size * 16 * 4, 32 ); rmesa->swtcl.RenderIndex = ~0; rmesa->swtcl.render_primitive = GL_TRIANGLES; rmesa->swtcl.hw_primitive = 0; Index: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h:1.2 xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h:1.3 --- xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h:1.2 Mon Dec 16 11:18:55 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h Tue May 6 19:52:08 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h,v 1.2 2002/12/16 16:18:55 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_swtcl.h,v 1.3 2003/05/06 23:52:08 daenzer Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -42,6 +42,7 @@ extern void r200InitSwtcl( GLcontext *ctx ); extern void r200DestroySwtcl( GLcontext *ctx ); +extern void r200FlushVertices( GLcontext *ctx, GLuint flags ); extern void r200ChooseRenderState( GLcontext *ctx ); extern void r200ChooseVertexState( GLcontext *ctx ); Index: xc/lib/GL/mesa/src/drv/r200/r200_tcl.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_tcl.c:1.2 xc/lib/GL/mesa/src/drv/r200/r200_tcl.c:1.3 --- xc/lib/GL/mesa/src/drv/r200/r200_tcl.c:1.2 Mon Dec 16 11:18:55 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_tcl.c Sun Sep 28 16:15:25 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tcl.c,v 1.2 2002/12/16 16:18:55 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tcl.c,v 1.3 2003/09/28 20:15:25 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,22 +25,16 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ -#include "r200_context.h" -#include "r200_state.h" -#include "r200_ioctl.h" -#include "r200_tex.h" -#include "r200_tcl.h" -#include "r200_swtcl.h" -#include "r200_maos.h" - -#include "mmath.h" +#include "glheader.h" +#include "imports.h" #include "mtypes.h" #include "enums.h" #include "colormac.h" @@ -50,6 +44,14 @@ #include "tnl/tnl.h" #include "tnl/t_pipeline.h" +#include "r200_context.h" +#include "r200_state.h" +#include "r200_ioctl.h" +#include "r200_tex.h" +#include "r200_tcl.h" +#include "r200_swtcl.h" +#include "r200_maos.h" + #define HAVE_POINTS 1 @@ -100,32 +102,22 @@ #define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx) -#define ELTS_VARS GLushort *dest +#define ELT_TYPE GLushort #define ELT_INIT(prim, hw_prim) \ r200TclPrimitive( ctx, prim, hw_prim | R200_VF_PRIM_WALK_IND ) -#define GET_ELTS() rmesa->tcl.Elts - +#define GET_MESA_ELTS() rmesa->tcl.Elts -#define NEW_PRIMITIVE() R200_NEWPRIM( rmesa ) -#define NEW_BUFFER() r200RefillCurrentDmaRegion( rmesa ) /* Don't really know how many elts will fit in what's left of cmdbuf, * as there is state to emit, etc: */ -#if 0 -#define GET_CURRENT_VB_MAX_ELTS() \ - ((R200_CMD_BUF_SZ - (rmesa->store.cmd_used + 16)) / 2) -#define GET_SUBSEQUENT_VB_MAX_ELTS() ((R200_CMD_BUF_SZ - 16) / 2) -#else /* Testing on isosurf shows a maximum around here. Don't know if it's * the card or driver or kernel module that is causing the behaviour. */ -#define GET_CURRENT_VB_MAX_ELTS() 300 -#define GET_SUBSEQUENT_VB_MAX_ELTS() 300 -#endif +#define GET_MAX_HW_ELTS() 300 #define RESET_STIPPLE() do { \ R200_STATECHANGE( rmesa, lin ); \ @@ -144,32 +136,22 @@ } while (0) -/* How do you extend an existing primitive? - */ -#define ALLOC_ELTS(nr) \ -do { \ - if (rmesa->dma.flush == r200FlushElts && \ - rmesa->store.cmd_used + nr*2 < R200_CMD_BUF_SZ) { \ - \ - dest = (GLushort *)(rmesa->store.cmd_buf + \ - rmesa->store.cmd_used); \ - rmesa->store.cmd_used += nr*2; \ - } \ - else { \ - if (rmesa->dma.flush) \ - rmesa->dma.flush( rmesa ); \ - \ - r200EmitAOS( rmesa, \ - rmesa->tcl.aos_components, \ - rmesa->tcl.nr_aos_components, \ - 0 ); \ - \ - dest = r200AllocEltsOpenEnded( rmesa, \ - rmesa->tcl.hw_primitive, \ - nr ); \ - } \ -} while (0) +#define ALLOC_ELTS(nr) r200AllocElts( rmesa, nr ) +static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr ) +{ + if (rmesa->dma.flush) + rmesa->dma.flush( rmesa ); + + r200EmitAOS( rmesa, + rmesa->tcl.aos_components, + rmesa->tcl.nr_aos_components, 0 ); + + return r200AllocEltsOpenEnded( rmesa, rmesa->tcl.hw_primitive, nr ); +} + + +#define CLOSE_ELTS() R200_NEWPRIM( rmesa ) /* TODO: Try to extend existing primitive if both are identical, @@ -214,17 +196,15 @@ #ifdef MESA_BIG_ENDIAN /* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */ -#define EMIT_ELT(offset, x) do { \ +#define EMIT_ELT(dest, offset, x) do { \ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \ (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0) #else -#define EMIT_ELT(offset, x) (dest)[offset] = (GLushort) (x) +#define EMIT_ELT(dest, offset, x) (dest)[offset] = (GLushort) (x) #endif -#define EMIT_TWO_ELTS(offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x); -#define INCR_ELTS( nr ) dest += nr -#define RELEASE_ELT_VERTS() \ - r200ReleaseArrays( ctx, ~0 ) + +#define EMIT_TWO_ELTS(dest, offset, x, y) *(GLuint *)((dest)+offset) = ((y)<<16)|(x); @@ -292,7 +272,7 @@ if (VB->Count == 0) return GL_FALSE; - r200ReleaseArrays( ctx, stage->changed_inputs ); + r200ReleaseArrays( ctx, ~0 /* stage->changed_inputs */ ); r200EmitArrays( ctx, stage->inputs ); rmesa->tcl.Elts = VB->Elts; @@ -326,55 +306,48 @@ struct gl_pipeline_stage *stage ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - GLuint inputs = VERT_OBJ; + GLuint inputs = VERT_BIT_POS; /* Validate state: */ if (rmesa->NewGLState) r200ValidateState( ctx ); - if (0) - fprintf(stderr, "%s: RE %d TGE %d NN %d\n", - __FUNCTION__, - ctx->Texture.Unit[0]._ReallyEnabled, - ctx->Texture.Unit[0].TexGenEnabled, - rmesa->TexGenNeedNormals[0]); - if (ctx->RenderMode == GL_RENDER) { /* Make all this event-driven: */ if (ctx->Light.Enabled) { - inputs |= VERT_NORM; + inputs |= VERT_BIT_NORMAL; - if (ctx->Light.ColorMaterialEnabled) { - inputs |= VERT_RGBA; + if (1 || ctx->Light.ColorMaterialEnabled) { + inputs |= VERT_BIT_COLOR0; } } else { - inputs |= VERT_RGBA; + inputs |= VERT_BIT_COLOR0; if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) { - inputs |= VERT_SPEC_RGB; + inputs |= VERT_BIT_COLOR1; } } if (ctx->Texture.Unit[0]._ReallyEnabled) { if (ctx->Texture.Unit[0].TexGenEnabled) { if (rmesa->TexGenNeedNormals[0]) { - inputs |= VERT_NORM; + inputs |= VERT_BIT_NORMAL; } } else { - inputs |= VERT_TEX(0); + inputs |= VERT_BIT_TEX0; } } if (ctx->Texture.Unit[1]._ReallyEnabled) { if (ctx->Texture.Unit[1].TexGenEnabled) { if (rmesa->TexGenNeedNormals[1]) { - inputs |= VERT_NORM; + inputs |= VERT_BIT_NORMAL; } } else { - inputs |= VERT_TEX(1); + inputs |= VERT_BIT_TEX1; } } Index: xc/lib/GL/mesa/src/drv/r200/r200_tcl.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_tcl.h:1.2 xc/lib/GL/mesa/src/drv/r200/r200_tcl.h:1.3 --- xc/lib/GL/mesa/src/drv/r200/r200_tcl.h:1.2 Mon Dec 16 11:18:55 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_tcl.h Sun Sep 28 16:15:25 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tcl.h,v 1.2 2002/12/16 16:18:55 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tcl.h,v 1.3 2003/09/28 20:15:25 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: Index: xc/lib/GL/mesa/src/drv/r200/r200_tex.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_tex.c:1.2 xc/lib/GL/mesa/src/drv/r200/r200_tex.c:1.4 --- xc/lib/GL/mesa/src/drv/r200/r200_tex.c:1.2 Tue Nov 5 12:46:08 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_tex.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tex.c,v 1.2 2002/11/05 17:46:08 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tex.c,v 1.4 2004/01/23 03:57:05 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -32,42 +32,68 @@ * Keith Whitwell */ -#include "r200_context.h" -#include "r200_state.h" -#include "r200_ioctl.h" -#include "r200_swtcl.h" -#include "r200_tex.h" - +#include "glheader.h" +#include "imports.h" #include "colormac.h" #include "context.h" #include "enums.h" #include "image.h" -#include "mem.h" -#include "mmath.h" #include "simple_list.h" #include "texformat.h" #include "texstore.h" #include "texutil.h" +#include "texmem.h" +#include "r200_context.h" +#include "r200_state.h" +#include "r200_ioctl.h" +#include "r200_swtcl.h" +#include "r200_tex.h" -/* ============================================================= - * Utility functions: + + +/** + * Set the texture wrap modes. + * + * \param t Texture object whose wrap modes are to be set + * \param swrap Wrap mode for the \a s texture coordinate + * \param twrap Wrap mode for the \a t texture coordinate */ -static void r200SetTexWrap( r200TexObjPtr t, GLenum swrap, GLenum twrap ) +static void r200SetTexWrap( r200TexObjPtr t, GLenum swrap, GLenum twrap, GLenum rwrap ) { - t->pp_txfilter &= ~(R200_CLAMP_S_MASK | R200_CLAMP_T_MASK); + GLboolean is_clamp = GL_FALSE; + GLboolean is_clamp_to_border = GL_FALSE; + + t->pp_txfilter &= ~(R200_CLAMP_S_MASK | R200_CLAMP_T_MASK | R200_BORDER_MODE_D3D); switch ( swrap ) { case GL_REPEAT: t->pp_txfilter |= R200_CLAMP_S_WRAP; break; case GL_CLAMP: - t->pp_txfilter |= R200_CLAMP_S_CLAMP_LAST; + t->pp_txfilter |= R200_CLAMP_S_CLAMP_GL; + is_clamp = GL_TRUE; break; case GL_CLAMP_TO_EDGE: t->pp_txfilter |= R200_CLAMP_S_CLAMP_LAST; break; + case GL_CLAMP_TO_BORDER: + t->pp_txfilter |= R200_CLAMP_S_CLAMP_GL; + is_clamp_to_border = GL_TRUE; + break; + case GL_MIRRORED_REPEAT: + t->pp_txfilter |= R200_CLAMP_S_MIRROR; + break; + case GL_MIRROR_CLAMP_ATI: + t->pp_txfilter |= R200_CLAMP_S_MIRROR_CLAMP_GL; + is_clamp = GL_TRUE; + break; + case GL_MIRROR_CLAMP_TO_EDGE_ATI: + t->pp_txfilter |= R200_CLAMP_S_MIRROR_CLAMP_LAST; + break; + default: + _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__); } switch ( twrap ) { @@ -75,12 +101,66 @@ t->pp_txfilter |= R200_CLAMP_T_WRAP; break; case GL_CLAMP: - t->pp_txfilter |= R200_CLAMP_T_CLAMP_LAST; + t->pp_txfilter |= R200_CLAMP_T_CLAMP_GL; + is_clamp = GL_TRUE; break; case GL_CLAMP_TO_EDGE: t->pp_txfilter |= R200_CLAMP_T_CLAMP_LAST; break; + case GL_CLAMP_TO_BORDER: + t->pp_txfilter |= R200_CLAMP_T_CLAMP_GL | R200_BORDER_MODE_D3D; + is_clamp_to_border = GL_TRUE; + break; + case GL_MIRRORED_REPEAT: + t->pp_txfilter |= R200_CLAMP_T_MIRROR; + break; + case GL_MIRROR_CLAMP_ATI: + t->pp_txfilter |= R200_CLAMP_T_MIRROR_CLAMP_GL; + is_clamp = GL_TRUE; + break; + case GL_MIRROR_CLAMP_TO_EDGE_ATI: + t->pp_txfilter |= R200_CLAMP_T_MIRROR_CLAMP_LAST; + break; + default: + _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__); } + + t->pp_txformat_x &= ~R200_CLAMP_Q_MASK; + + switch ( rwrap ) { + case GL_REPEAT: + t->pp_txformat_x |= R200_CLAMP_Q_WRAP; + break; + case GL_CLAMP: + t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_GL; + is_clamp = GL_TRUE; + break; + case GL_CLAMP_TO_EDGE: + t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_LAST; + break; + case GL_CLAMP_TO_BORDER: + t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_GL; + is_clamp_to_border = GL_TRUE; + break; + case GL_MIRRORED_REPEAT: + t->pp_txformat_x |= R200_CLAMP_Q_MIRROR; + break; + case GL_MIRROR_CLAMP_ATI: + t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_GL; + is_clamp = GL_TRUE; + break; + case GL_MIRROR_CLAMP_TO_EDGE_ATI: + t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_LAST; + break; + default: + _mesa_problem(NULL, "bad R wrap mode in %s", __FUNCTION__); + } + + if ( is_clamp_to_border ) { + t->pp_txfilter |= R200_BORDER_MODE_D3D; + } + + t->border_fallback = (is_clamp && is_clamp_to_border); } static void r200SetTexMaxAnisotropy( r200TexObjPtr t, GLfloat max ) @@ -100,11 +180,20 @@ } } +/** + * Set the texture magnification and minification modes. + * + * \param t Texture whose filter modes are to be set + * \param minf Texture minification mode + * \param magf Texture magnification mode + */ + static void r200SetTexFilter( r200TexObjPtr t, GLenum minf, GLenum magf ) { GLuint anisotropy = (t->pp_txfilter & R200_MAX_ANISO_MASK); t->pp_txfilter &= ~(R200_MIN_FILTER_MASK | R200_MAG_FILTER_MASK); + t->pp_txformat_x &= ~R200_VOLUME_FILTER_MASK; if ( anisotropy == R200_MAX_ANISO_1_TO_1 ) { switch ( minf ) { @@ -146,12 +235,17 @@ } } + /* Note we don't have 3D mipmaps so only use the mag filter setting + * to set the 3D texture filter mode. + */ switch ( magf ) { case GL_NEAREST: t->pp_txfilter |= R200_MAG_FILTER_NEAREST; + t->pp_txformat_x |= R200_VOLUME_FILTER_NEAREST; break; case GL_LINEAR: t->pp_txfilter |= R200_MAG_FILTER_LINEAR; + t->pp_txformat_x |= R200_VOLUME_FILTER_LINEAR; break; } } @@ -162,27 +256,36 @@ } +/** + * Allocate space for and load the mesa images into the texture memory block. + * This will happen before drawing with a new texture, or drawing with a + * texture after it was swapped out or teximaged again. + */ + static r200TexObjPtr r200AllocTexObj( struct gl_texture_object *texObj ) { r200TexObjPtr t; t = CALLOC_STRUCT( r200_tex_obj ); - if (!t) - return NULL; + texObj->DriverData = t; + if ( t != NULL ) { + if ( R200_DEBUG & DEBUG_TEXTURE ) { + fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)texObj, (void *)t ); + } - if ( R200_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, texObj, t ); - } + /* Initialize non-image-dependent parts of the state: + */ + t->base.tObj = texObj; + t->border_fallback = GL_FALSE; - t->tObj = texObj; - make_empty_list( t ); + make_empty_list( & t->base ); + + r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR ); + r200SetTexMaxAnisotropy( t, texObj->MaxAnisotropy ); + r200SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); + r200SetTexBorderColor( t, texObj->_BorderChan ); + } - /* Initialize non-image-dependent parts of the state: - */ - r200SetTexWrap( t, texObj->WrapS, texObj->WrapT ); - r200SetTexMaxAnisotropy( t, texObj->MaxAnisotropy ); - r200SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); - r200SetTexBorderColor( t, texObj->BorderColor ); return t; } @@ -197,6 +300,7 @@ switch ( internalFormat ) { case 4: case GL_RGBA: + case GL_COMPRESSED_RGBA: if ( format == GL_BGRA ) { if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) { return &_mesa_texformat_argb8888; @@ -212,6 +316,7 @@ case 3: case GL_RGB: + case GL_COMPRESSED_RGB: if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) { return &_mesa_texformat_rgb565; } @@ -246,6 +351,7 @@ case GL_ALPHA8: case GL_ALPHA12: case GL_ALPHA16: + case GL_COMPRESSED_ALPHA: return &_mesa_texformat_al88; case 1: @@ -254,6 +360,7 @@ case GL_LUMINANCE8: case GL_LUMINANCE12: case GL_LUMINANCE16: + case GL_COMPRESSED_LUMINANCE: return &_mesa_texformat_al88; case 2: @@ -264,6 +371,7 @@ case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: + case GL_COMPRESSED_LUMINANCE_ALPHA: return &_mesa_texformat_al88; case GL_INTENSITY: @@ -271,6 +379,7 @@ case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: + case GL_COMPRESSED_INTENSITY: /* At the moment, glean & conform both fail using the i8 internal * format. */ @@ -285,7 +394,7 @@ return &_mesa_texformat_ycbcr_rev; default: - _mesa_problem(ctx, "unexpected texture format in r200ChoosTexFormat"); + _mesa_problem(ctx, "unexpected texture format in %s", __FUNCTION__); return NULL; } @@ -333,6 +442,15 @@ return 0; break; + case GL_RGB: + if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) { + texImage->TexFormat = &_mesa_texformat_rgb565; + texelBytes = 2; + } + else + return 0; + break; + case GL_YCBCR_MESA: if ( format == GL_YCBCR_MESA && type == GL_UNSIGNED_SHORT_8_8_REV_APPLE ) { @@ -376,7 +494,7 @@ * relaxed, but would need to store the image pitch somewhere, * as packing details might change before image is uploaded: */ - if (!r200IsAgpMemory( rmesa, pixels, srcHeight * srcRowStride ) || + if (!r200IsGartMemory( rmesa, pixels, srcHeight * srcRowStride ) || (srcRowStride & 63)) return 0; @@ -402,27 +520,25 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - r200ContextPtr rmesa = R200_CONTEXT(ctx); - r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; if ( t ) { - r200SwapOutTexObj( rmesa, t ); + driSwapOutTextureObject( t ); } else { - t = r200AllocTexObj( texObj ); + t = (driTextureObject *) r200AllocTexObj( texObj ); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); return; } - texObj->DriverData = t; } - /* Note, this will call r200ChooseTextureFormat */ + /* Note, this will call ChooseTextureFormat */ _mesa_store_teximage1d(ctx, target, level, internalFormat, width, border, format, type, pixels, &ctx->Unpack, texObj, texImage); - t->dirty_images |= (1 << level); + t->dirty_images[0] |= (1 << level); } @@ -435,28 +551,25 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - r200ContextPtr rmesa = R200_CONTEXT(ctx); - r200TexObjPtr t = (r200TexObjPtr)texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; assert( t ); /* this _should_ be true */ if ( t ) { - r200SwapOutTexObj( rmesa, t ); - t->dirty_images |= (1 << level); + driSwapOutTextureObject( t ); } else { - t = r200AllocTexObj(texObj); + t = (driTextureObject *) r200AllocTexObj( texObj ); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D"); return; } - texObj->DriverData = t; } _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, format, type, pixels, packing, texObj, texImage); - t->dirty_images |= (1 << level); + t->dirty_images[0] |= (1 << level); } @@ -468,19 +581,33 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - r200ContextPtr rmesa = R200_CONTEXT(ctx); - r200TexObjPtr t = (r200TexObjPtr)texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; + GLuint face; - if ( t ) { - r200SwapOutTexObj( rmesa, t ); + /* which cube face or ordinary 2D image */ + switch (target) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; + ASSERT(face < 6); + break; + default: + face = 0; + } + + if ( t != NULL ) { + driSwapOutTextureObject( t ); } else { - t = r200AllocTexObj( texObj ); + t = (driTextureObject *) r200AllocTexObj( texObj ); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); return; } - texObj->DriverData = t; } texImage->IsClientData = GL_FALSE; @@ -498,8 +625,8 @@ fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__); /* Normal path: copy (to cached memory) and eventually upload - * via another copy to agp memory and then a blit... Could - * eliminate one copy by going straight to (permanent) agp. + * via another copy to GART memory and then a blit... Could + * eliminate one copy by going straight to (permanent) GART. * * Note, this will call r200ChooseTextureFormat. */ @@ -507,7 +634,7 @@ width, height, border, format, type, pixels, &ctx->Unpack, texObj, texImage); - t->dirty_images |= (1 << level); + t->dirty_images[face] |= (1 << level); } } @@ -521,30 +648,138 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - r200ContextPtr rmesa = R200_CONTEXT(ctx); - r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; + GLuint face; -/* fprintf(stderr, "%s\n", __FUNCTION__); */ + + /* which cube face or ordinary 2D image */ + switch (target) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; + ASSERT(face < 6); + break; + default: + face = 0; + } assert( t ); /* this _should_ be true */ if ( t ) { - r200SwapOutTexObj( rmesa, t ); + driSwapOutTextureObject( t ); } else { - t = r200AllocTexObj(texObj); + t = (driTextureObject *) r200AllocTexObj( texObj ); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D"); return; } - texObj->DriverData = t; } _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels, packing, texObj, texImage); - t->dirty_images |= (1 << level); + t->dirty_images[face] |= (1 << level); +} + + +#if ENABLE_HW_3D_TEXTURE +static void r200TexImage3D( GLcontext *ctx, GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint height, GLint depth, + GLint border, + GLenum format, GLenum type, const GLvoid *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage ) +{ + driTextureObject * t = (driTextureObject *) texObj->DriverData; + + if ( t ) { + driSwapOutTextureObject( t ); + } + else { + t = r200AllocTexObj( texObj ); + if (!t) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); + return; + } + } + + texImage->IsClientData = GL_FALSE; + +#if 0 + if (r200ValidateClientStorage( ctx, target, + internalFormat, + width, height, + format, type, pixels, + packing, texObj, texImage)) { + if (R200_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s: Using client storage\n", __FUNCTION__); + } + else +#endif + { + if (R200_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__); + + /* Normal path: copy (to cached memory) and eventually upload + * via another copy to GART memory and then a blit... Could + * eliminate one copy by going straight to (permanent) GART. + * + * Note, this will call r200ChooseTextureFormat. + */ + _mesa_store_teximage3d(ctx, target, level, internalFormat, + width, height, depth, border, + format, type, pixels, + &ctx->Unpack, texObj, texImage); + + t->dirty_images[0] |= (1 << level); + } +} +#endif + + +#if ENABLE_HW_3D_TEXTURE +static void +r200TexSubImage3D( GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, + const GLvoid *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage ) +{ + driTextureObject * t = (driTextureObject *) texObj->DriverData; + +/* fprintf(stderr, "%s\n", __FUNCTION__); */ + + assert( t ); /* this _should_ be true */ + if ( t ) { + driSwapOutTextureObject( t ); + } + else { + t = r200AllocTexObj(texObj); + if (!t) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage3D"); + return; + } + texObj->DriverData = t; + } + + _mesa_store_texsubimage3d(ctx, target, level, xoffset, yoffset, zoffset, + width, height, depth, + format, type, pixels, packing, texObj, texImage); + + t->dirty_images[0] |= (1 << level); } +#endif + static void r200TexEnv( GLcontext *ctx, GLenum target, @@ -603,11 +838,16 @@ } } + +/** + * Changes variables and flags for a state update, which will happen at the + * next UpdateTextureState + */ + static void r200TexParameter( GLcontext *ctx, GLenum target, struct gl_texture_object *texObj, GLenum pname, const GLfloat *params ) { - r200ContextPtr rmesa = R200_CONTEXT(ctx); r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData; if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) { @@ -615,7 +855,8 @@ _mesa_lookup_enum_by_nr( pname ) ); } - if (!t) + if ( ( target != GL_TEXTURE_2D ) && + ( target != GL_TEXTURE_1D ) ) return; switch ( pname ) { @@ -628,11 +869,12 @@ case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: - r200SetTexWrap( t, texObj->WrapS, texObj->WrapT ); + case GL_TEXTURE_WRAP_R: + r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR ); break; case GL_TEXTURE_BORDER_COLOR: - r200SetTexBorderColor( t, texObj->BorderColor ); + r200SetTexBorderColor( t, texObj->_BorderChan ); break; case GL_TEXTURE_BASE_LEVEL: @@ -640,11 +882,11 @@ case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative for R200. Since there's no LOD clamping, + * be a nice alternative. Since there's no LOD clamping, * we just have to rely on loading the right subset of mipmap levels * to simulate a clamped LOD. */ - r200SwapOutTexObj( rmesa, t ); + driSwapOutTextureObject( (driTextureObject *) t ); break; default: @@ -661,17 +903,14 @@ static void r200BindTexture( GLcontext *ctx, GLenum target, struct gl_texture_object *texObj ) { - r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData; - GLuint unit = ctx->Texture.CurrentUnit; - if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) { - fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, texObj, unit ); + fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, (void *)texObj, + ctx->Texture.CurrentUnit ); } if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) { - if ( !t ) { - t = r200AllocTexObj( texObj ); - texObj->DriverData = t; + if ( texObj->DriverData == NULL ) { + r200AllocTexObj( texObj ); } } } @@ -680,61 +919,20 @@ struct gl_texture_object *texObj ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, texObj ); + fprintf( stderr, "%s( %p (target = %s) )\n", __FUNCTION__, (void *)texObj, + _mesa_lookup_enum_by_nr( texObj->Target ) ); } - if ( t ) { + if ( t != NULL ) { if ( rmesa ) { R200_FIREVERTICES( rmesa ); } - r200DestroyTexObj( rmesa, t ); - texObj->DriverData = NULL; - } -} - -static GLboolean r200IsTextureResident( GLcontext *ctx, - struct gl_texture_object *texObj ) -{ - r200TexObjPtr t = (r200TexObjPtr) texObj->DriverData; - - return ( t && t->memBlock ); -} - -static void r200InitTextureObjects( GLcontext *ctx ) -{ - r200ContextPtr rmesa = R200_CONTEXT(ctx); - struct gl_texture_object *texObj; - GLuint tmp = ctx->Texture.CurrentUnit; - - ctx->Texture.CurrentUnit = 0; - - texObj = ctx->Texture.Unit[0].Current1D; - r200BindTexture( ctx, GL_TEXTURE_1D, texObj ); - move_to_tail( &rmesa->texture.swapped, - (r200TexObjPtr)texObj->DriverData ); - - texObj = ctx->Texture.Unit[0].Current2D; - r200BindTexture( ctx, GL_TEXTURE_2D, texObj ); - move_to_tail( &rmesa->texture.swapped, - (r200TexObjPtr)texObj->DriverData ); - - ctx->Texture.CurrentUnit = 1; - - texObj = ctx->Texture.Unit[1].Current1D; - r200BindTexture( ctx, GL_TEXTURE_1D, texObj ); - move_to_tail( &rmesa->texture.swapped, - (r200TexObjPtr)texObj->DriverData ); - - texObj = ctx->Texture.Unit[1].Current2D; - r200BindTexture( ctx, GL_TEXTURE_2D, texObj ); - move_to_tail( &rmesa->texture.swapped, - (r200TexObjPtr)texObj->DriverData ); - - ctx->Texture.CurrentUnit = tmp; + driDestroyTextureObject( t ); + } } /* Need: @@ -760,13 +958,24 @@ void r200InitTextureFuncs( GLcontext *ctx ) { + r200ContextPtr rmesa = R200_CONTEXT(ctx); + + ctx->Driver.ChooseTextureFormat = r200ChooseTextureFormat; ctx->Driver.TexImage1D = r200TexImage1D; ctx->Driver.TexImage2D = r200TexImage2D; +#if ENABLE_HW_3D_TEXTURE + ctx->Driver.TexImage3D = r200TexImage3D; +#else ctx->Driver.TexImage3D = _mesa_store_teximage3d; +#endif ctx->Driver.TexSubImage1D = r200TexSubImage1D; ctx->Driver.TexSubImage2D = r200TexSubImage2D; +#if ENABLE_HW_3D_TEXTURE + ctx->Driver.TexSubImage3D = r200TexSubImage3D; +#else ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; +#endif ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; @@ -777,7 +986,7 @@ ctx->Driver.BindTexture = r200BindTexture; ctx->Driver.CreateTexture = NULL; /* FIXME: Is this used??? */ ctx->Driver.DeleteTexture = r200DeleteTexture; - ctx->Driver.IsTextureResident = r200IsTextureResident; + ctx->Driver.IsTextureResident = driIsTextureResident; ctx->Driver.PrioritizeTexture = NULL; ctx->Driver.ActiveTexture = NULL; ctx->Driver.UpdateTexturePalette = NULL; @@ -786,5 +995,7 @@ ctx->Driver.TexParameter = r200TexParameter; ctx->Driver.TexGen = r200TexGen; - r200InitTextureObjects( ctx ); + driInitTextureObjects( ctx, & rmesa->swapped, + DRI_TEXMGR_DO_TEXTURE_1D + | DRI_TEXMGR_DO_TEXTURE_2D ); } Index: xc/lib/GL/mesa/src/drv/r200/r200_tex.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_tex.h:1.1 xc/lib/GL/mesa/src/drv/r200/r200_tex.h:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_tex.h:1.1 Wed Oct 30 07:51:53 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_tex.h Sun Sep 28 16:15:25 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tex.h,v 1.1 2002/10/30 12:51:53 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_tex.h,v 1.2 2003/09/28 20:15:25 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -39,15 +40,9 @@ extern void r200UpdateTextureState( GLcontext *ctx ); -extern int r200UploadTexImages( r200ContextPtr rmesa, r200TexObjPtr t ); +extern int r200UploadTexImages( r200ContextPtr rmesa, r200TexObjPtr t, GLuint face ); -extern void r200AgeTextures( r200ContextPtr rmesa, int heap ); extern void r200DestroyTexObj( r200ContextPtr rmesa, r200TexObjPtr t ); -extern void r200SwapOutTexObj( r200ContextPtr rmesa, r200TexObjPtr t ); - -extern void r200PrintLocalLRU( r200ContextPtr rmesa, int heap ); -extern void r200PrintGlobalLRU( r200ContextPtr rmesa, int heap ); -extern void r200UpdateTexLRU( r200ContextPtr rmesa, r200TexObjPtr t ); extern void r200InitTextureFuncs( GLcontext *ctx ); Index: xc/lib/GL/mesa/src/drv/r200/r200_texmem.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_texmem.c:1.5 xc/lib/GL/mesa/src/drv/r200/r200_texmem.c:1.7 --- xc/lib/GL/mesa/src/drv/r200/r200_texmem.c:1.5 Mon Dec 16 19:32:56 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_texmem.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_texmem.c,v 1.5 2002/12/17 00:32:56 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_texmem.c,v 1.7 2004/01/23 03:57:05 dawes Exp $ */ /************************************************************************** Copyright (C) Tungsten Graphics 2002. All Rights Reserved. @@ -36,279 +36,46 @@ * */ -#include "radeon_reg.h" +#include "glheader.h" +#include "imports.h" +#include "context.h" +#include "colormac.h" +#include "macros.h" +#include "simple_list.h" +#include "radeon_reg.h" /* gets definition for usleep */ #include "r200_context.h" #include "r200_state.h" #include "r200_ioctl.h" #include "r200_swtcl.h" #include "r200_tex.h" -#include "context.h" -#include "colormac.h" -#include "mmath.h" -#include "macros.h" -#include "simple_list.h" -#include "enums.h" -#include "mem.h" +#include /* for usleep() */ -#include /* for usleep */ -/* Destroy hardware state associated with texture `t'. +/** + * Destroy any device-dependent state associated with the texture. This may + * include NULLing out hardware state that points to the texture. */ -void r200DestroyTexObj( r200ContextPtr rmesa, r200TexObjPtr t ) +void +r200DestroyTexObj( r200ContextPtr rmesa, r200TexObjPtr t ) { - if ( !t ) - return; - if ( R200_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj ); - } - - if ( t->memBlock ) { - mmFreeMem( t->memBlock ); - t->memBlock = NULL; - } - - if ( t->tObj ) - t->tObj->DriverData = NULL; - - if ( rmesa ) { - if ( t == rmesa->state.texture.unit[0].texobj ) { - rmesa->state.texture.unit[0].texobj = NULL; - remove_from_list( &rmesa->hw.tex[0] ); - make_empty_list( &rmesa->hw.tex[0] ); - } - - if ( t == rmesa->state.texture.unit[1].texobj ) { - rmesa->state.texture.unit[1].texobj = NULL; - remove_from_list( &rmesa->hw.tex[1] ); - make_empty_list( &rmesa->hw.tex[1] ); - } - } - - remove_from_list( t ); - FREE( t ); -} - - -/* Keep track of swapped out texture objects. - */ -void r200SwapOutTexObj( r200ContextPtr rmesa, r200TexObjPtr t ) -{ - if ( R200_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj ); - } - - if ( t->memBlock ) { - mmFreeMem( t->memBlock ); - t->memBlock = NULL; - } - - t->dirty_images = ~0; - move_to_tail( &rmesa->texture.swapped, t ); -} - -/* Print out debugging information about texture LRU. - */ -void r200PrintLocalLRU( r200ContextPtr rmesa, int heap ) -{ - r200TexObjPtr t; - int sz = 1 << (rmesa->r200Screen->logTexGranularity[heap]); - - fprintf( stderr, "\nLocal LRU, heap %d:\n", heap ); - - foreach ( t, &rmesa->texture.objects[heap] ) { - if (!t->memBlock) - continue; - if (!t->tObj) { - fprintf( stderr, "Placeholder %d at 0x%x sz 0x%x\n", - t->memBlock->ofs / sz, - t->memBlock->ofs, - t->memBlock->size ); - } else { - fprintf( stderr, "Texture at 0x%x sz 0x%x\n", - t->memBlock->ofs, - t->memBlock->size ); - } - } - - fprintf( stderr, "\n" ); -} - -void r200PrintGlobalLRU( r200ContextPtr rmesa, int heap ) -{ - radeon_tex_region_t *list = rmesa->sarea->texList[heap]; - int i, j; - - fprintf( stderr, "\nGlobal LRU, heap %d list %p:\n", heap, list ); - - for ( i = 0, j = RADEON_NR_TEX_REGIONS ; i < RADEON_NR_TEX_REGIONS ; i++ ) { - fprintf( stderr, "list[%d] age %d next %d prev %d\n", - j, list[j].age, list[j].next, list[j].prev ); - j = list[j].next; - if ( j == RADEON_NR_TEX_REGIONS ) break; - } - - if ( j != RADEON_NR_TEX_REGIONS ) { - fprintf( stderr, "Loop detected in global LRU\n" ); - for ( i = 0 ; i < RADEON_NR_TEX_REGIONS ; i++ ) { - fprintf( stderr, "list[%d] age %d next %d prev %d\n", - i, list[i].age, list[i].next, list[i].prev ); - } - } - - fprintf( stderr, "\n" ); -} - -/* Reset the global texture LRU. - */ -static void r200ResetGlobalLRU( r200ContextPtr rmesa, int heap ) -{ - radeon_tex_region_t *list = rmesa->sarea->texList[heap]; - int sz = 1 << rmesa->r200Screen->logTexGranularity[heap]; - int i; - - /* - * (Re)initialize the global circular LRU list. The last element in - * the array (RADEON_NR_TEX_REGIONS) is the sentinal. Keeping it at - * the end of the array allows it to be addressed rationally when - * looking up objects at a particular location in texture memory. - */ - for ( i = 0 ; (i+1) * sz <= rmesa->r200Screen->texSize[heap] ; i++ ) { - list[i].prev = i-1; - list[i].next = i+1; - list[i].age = 0; - } - - i--; - list[0].prev = RADEON_NR_TEX_REGIONS; - list[i].prev = i-1; - list[i].next = RADEON_NR_TEX_REGIONS; - list[RADEON_NR_TEX_REGIONS].prev = i; - list[RADEON_NR_TEX_REGIONS].next = 0; - rmesa->sarea->texAge[heap] = 0; -} - -/* Update the local and glock texture LRUs. - */ -void r200UpdateTexLRU(r200ContextPtr rmesa, r200TexObjPtr t ) -{ - int heap = t->heap; - radeon_tex_region_t *list = rmesa->sarea->texList[heap]; - int sz = rmesa->r200Screen->logTexGranularity[heap]; - int i, start, end; - - rmesa->texture.age[heap] = ++rmesa->sarea->texAge[heap]; - - if ( !t->memBlock ) - return; - - start = t->memBlock->ofs >> sz; - end = (t->memBlock->ofs + t->memBlock->size-1) >> sz; - - /* Update our local LRU */ - move_to_head( &rmesa->texture.objects[heap], t ); - - /* Update the global LRU */ - for ( i = start ; i <= end ; i++ ) { - list[i].in_use = 1; - list[i].age = rmesa->texture.age[heap]; - - /* remove_from_list(i) */ - list[(CARD32)list[i].next].prev = list[i].prev; - list[(CARD32)list[i].prev].next = list[i].next; - - /* insert_at_head(list, i) */ - list[i].prev = RADEON_NR_TEX_REGIONS; - list[i].next = list[RADEON_NR_TEX_REGIONS].next; - list[(CARD32)list[RADEON_NR_TEX_REGIONS].next].prev = i; - list[RADEON_NR_TEX_REGIONS].next = i; - } - - if ( 0 ) { - r200PrintGlobalLRU( rmesa, t->heap ); - r200PrintLocalLRU( rmesa, t->heap ); + fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)t, (void *)t->base.tObj ); } -} -/* Update our notion of what textures have been changed since we last - * held the lock. This pertains to both our local textures and the - * textures belonging to other clients. Keep track of other client's - * textures by pushing a placeholder texture onto the LRU list -- these - * are denoted by (tObj == NULL). - */ -static void r200TexturesGone( r200ContextPtr rmesa, int heap, - int offset, int size, int in_use ) -{ - r200TexObjPtr t, tmp; + if ( rmesa != NULL ) { + unsigned i; - foreach_s ( t, tmp, &rmesa->texture.objects[heap] ) { - if ( !t->memBlock || - t->memBlock->ofs >= offset + size || - t->memBlock->ofs + t->memBlock->size <= offset ) - continue; - /* It overlaps - kick it out. Need to hold onto the currently - * bound objects, however. - */ - r200SwapOutTexObj( rmesa, t ); - } - - if ( in_use ) { - t = (r200TexObjPtr) CALLOC( sizeof(*t) ); - if ( !t ) return; - - t->memBlock = mmAllocMem( rmesa->texture.heap[heap], size, 0, offset ); - if ( !t->memBlock ) { - fprintf( stderr, "Couldn't alloc placeholder sz %x ofs %x\n", - (int)size, (int)offset ); - mmDumpMemInfo( rmesa->texture.heap[heap] ); - return; - } - insert_at_head( &rmesa->texture.objects[heap], t ); - } -} - -/* Update our client's shared texture state. If another client has - * modified a region in which we have textures, then we need to figure - * out which of our textures has been removed, and update our global - * LRU. - */ -void r200AgeTextures( r200ContextPtr rmesa, int heap ) -{ - RADEONSAREAPrivPtr sarea = rmesa->sarea; - - if ( sarea->texAge[heap] != rmesa->texture.age[heap] ) { - int sz = 1 << rmesa->r200Screen->logTexGranularity[heap]; - int nr = 0; - int idx; - - for ( idx = sarea->texList[heap][RADEON_NR_TEX_REGIONS].prev ; - idx != RADEON_NR_TEX_REGIONS && nr < RADEON_NR_TEX_REGIONS ; - idx = sarea->texList[heap][idx].prev, nr++ ) - { - /* If switching texturing schemes, then the SAREA might not - * have been properly cleared, so we need to reset the - * global texture LRU. - */ - if ( idx * sz > rmesa->r200Screen->texSize[heap] ) { - nr = RADEON_NR_TEX_REGIONS; - break; - } - - if ( sarea->texList[heap][idx].age > rmesa->texture.age[heap] ) { - r200TexturesGone( rmesa, heap, idx * sz, sz, - sarea->texList[heap][idx].in_use ); + for ( i = 0 ; i < rmesa->glCtx->Const.MaxTextureUnits ; i++ ) { + if ( t == rmesa->state.texture.unit[i].texobj ) { + rmesa->state.texture.unit[i].texobj = NULL; + remove_from_list( &rmesa->hw.tex[i] ); + make_empty_list( &rmesa->hw.tex[i] ); + remove_from_list( &rmesa->hw.cube[i] ); + make_empty_list( &rmesa->hw.cube[i] ); } } - - if ( nr == RADEON_NR_TEX_REGIONS ) { - r200TexturesGone( rmesa, heap, 0, - rmesa->r200Screen->texSize[heap], 0 ); - r200ResetGlobalLRU( rmesa, heap ); - } - - rmesa->texture.age[heap] = sarea->texAge[heap]; } } @@ -318,35 +85,45 @@ */ -static void r200UploadAGPClientSubImage( r200ContextPtr rmesa, - r200TexObjPtr t, - struct gl_texture_image *texImage, - GLint hwlevel, - GLint x, GLint y, - GLint width, GLint height ) +static void r200UploadGARTClientSubImage( r200ContextPtr rmesa, + r200TexObjPtr t, + struct gl_texture_image *texImage, + GLint hwlevel, + GLint x, GLint y, + GLint width, GLint height ) { const struct gl_texture_format *texFormat = texImage->TexFormat; - GLuint pitch = t->image[0].width * texFormat->TexelBytes; + GLuint srcPitch, dstPitch; int blit_format; int srcOffset; - + /* + * XXX it appears that we always upload the full image, not a subimage. + * I.e. x==0, y==0, width=texWidth, height=texWidth. If this is ever + * changed, the src pitch will have to change. + */ switch ( texFormat->TexelBytes ) { case 1: blit_format = R200_CP_COLOR_FORMAT_CI8; + srcPitch = t->image[0][0].width * texFormat->TexelBytes; + dstPitch = t->image[0][0].width * texFormat->TexelBytes; break; case 2: blit_format = R200_CP_COLOR_FORMAT_RGB565; + srcPitch = t->image[0][0].width * texFormat->TexelBytes; + dstPitch = t->image[0][0].width * texFormat->TexelBytes; break; case 4: blit_format = R200_CP_COLOR_FORMAT_ARGB8888; + srcPitch = t->image[0][0].width * texFormat->TexelBytes; + dstPitch = t->image[0][0].width * texFormat->TexelBytes; break; default: return; } - t->image[hwlevel].data = texImage->Data; - srcOffset = r200AgpOffsetFromVirtual( rmesa, texImage->Data ); + t->image[0][hwlevel].data = texImage->Data; + srcOffset = r200GartOffsetFromVirtual( rmesa, texImage->Data ); assert( srcOffset != ~0 ); @@ -358,14 +135,14 @@ r200EmitWait( rmesa, RADEON_WAIT_3D ); r200EmitBlit( rmesa, blit_format, - pitch, + srcPitch, srcOffset, - t->image[0].width * texFormat->TexelBytes, /* dst pitch! */ + dstPitch, t->bufAddr, x, y, - t->image[hwlevel].x + x, - t->image[hwlevel].y + y, + t->image[0][hwlevel].x + x, + t->image[0][hwlevel].y + y, width, height ); @@ -379,7 +156,7 @@ GLint width, GLint height ) { const struct gl_texture_format *texFormat = texImage->TexFormat; - int blit_format, blit_pitch, done; + int blit_format, dstPitch, done; switch ( texFormat->TexelBytes ) { case 1: @@ -395,64 +172,71 @@ return; } - t->image[0].data = texImage->Data; + t->image[0][0].data = texImage->Data; /* Currently don't need to cope with small pitches. */ width = texImage->Width; height = texImage->Height; - blit_pitch = t->pp_txpitch + 32; + dstPitch = t->pp_txpitch + 32; - if (rmesa->prefer_agp_client_texturing && texImage->IsClientData) { - /* In this case, could also use agp texturing. This is + if (rmesa->prefer_gart_client_texturing && texImage->IsClientData) { + /* In this case, could also use GART texturing. This is * currently disabled, but has been tested & works. */ - t->pp_txoffset = r200AgpOffsetFromVirtual( rmesa, texImage->Data ); + t->pp_txoffset = r200GartOffsetFromVirtual( rmesa, texImage->Data ); t->pp_txpitch = texImage->RowStride * texFormat->TexelBytes - 32; if (R200_DEBUG & DEBUG_TEXTURE) fprintf(stderr, - "Using agp texturing for rectangular client texture\n"); + "Using GART texturing for rectangular client texture\n"); /* Release FB memory allocated for this image: */ - if ( t->memBlock ) { - mmFreeMem( t->memBlock ); - t->memBlock = NULL; + /* FIXME This may not be correct as driSwapOutTextureObject sets + * FIXME dirty_images. It may be fine, though. + */ + if ( t->base.memBlock ) { + driSwapOutTextureObject( (driTextureObject *) t ); } - } else if (texImage->IsClientData) { - /* Data already in agp memory, with usable pitch. + /* Data already in GART memory, with usable pitch. */ + GLuint srcPitch; + srcPitch = texImage->RowStride * texFormat->TexelBytes; r200EmitBlit( rmesa, blit_format, - texImage->RowStride * texFormat->TexelBytes, - r200AgpOffsetFromVirtual( rmesa, texImage->Data ), - blit_pitch, t->bufAddr, + srcPitch, + r200GartOffsetFromVirtual( rmesa, texImage->Data ), + dstPitch, t->bufAddr, 0, 0, 0, 0, width, height ); } else { - /* Data not in agp memory, or bad pitch. + /* Data not in GART memory, or bad pitch. */ for (done = 0; done < height ; ) { struct r200_dma_region region; - int lines = MIN2( height - done, RADEON_BUFFER_SIZE / blit_pitch ); - int src_pitch = texImage->RowStride * texFormat->TexelBytes; - char *tex = (char *)texImage->Data + done * src_pitch; + int lines = MIN2( height - done, RADEON_BUFFER_SIZE / dstPitch ); + int src_pitch; + char *tex; + + src_pitch = texImage->RowStride * texFormat->TexelBytes; + + tex = (char *)texImage->Data + done * src_pitch; memset(®ion, 0, sizeof(region)); - r200AllocDmaRegion( rmesa, ®ion, lines * blit_pitch, 64 ); + r200AllocDmaRegion( rmesa, ®ion, lines * dstPitch, 64 ); /* Copy texdata to dma: */ if (0) - fprintf(stderr, "%s: src_pitch %d blit_pitch %d\n", - __FUNCTION__, src_pitch, blit_pitch); + fprintf(stderr, "%s: src_pitch %d dst_pitch %d\n", + __FUNCTION__, src_pitch, dstPitch); - if (src_pitch == blit_pitch) { + if (src_pitch == dstPitch) { memcpy( region.address, tex, lines * src_pitch ); } else { @@ -460,7 +244,7 @@ int i; for (i = 0 ; i < lines ; i++) { memcpy( buf, tex, src_pitch ); - buf += blit_pitch; + buf += dstPitch; tex += src_pitch; } } @@ -471,8 +255,8 @@ */ r200EmitBlit( rmesa, blit_format, - blit_pitch, GET_START( ®ion ), - blit_pitch, t->bufAddr, + dstPitch, GET_START( ®ion ), + dstPitch, t->bufAddr, 0, 0, 0, done, width, lines ); @@ -486,36 +270,57 @@ } -/* Upload the texture image associated with texture `t' at level `level' - * at the address relative to `start'. - */ -static void r200UploadSubImage( r200ContextPtr rmesa, - r200TexObjPtr t, - GLint hwlevel, - GLint x, GLint y, GLint width, GLint height ) +/** + * Upload the texture image associated with texture \a t at the specified + * level at the address relative to \a start. + */ +static void uploadSubImage( r200ContextPtr rmesa, r200TexObjPtr t, + GLint hwlevel, + GLint x, GLint y, GLint width, GLint height, + GLuint face ) { - struct gl_texture_image *texImage; - const struct gl_texture_format *texFormat; - GLint texelsPerDword = 0; - GLuint format, pitch, offset; + struct gl_texture_image *texImage = NULL; + GLuint offset; GLint imageWidth, imageHeight; GLint ret; drmRadeonTexture tex; drmRadeonTexImage tmp; - int level = hwlevel + t->firstLevel; + const int level = hwlevel + t->base.firstLevel; if ( R200_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s level %d %dx%d\n", __FUNCTION__, - level, width, height); + fprintf( stderr, "%s( %p, %p ) level/width/height/face = %d/%d/%d/%u\n", + __FUNCTION__, (void *)t, (void *)t->base.tObj, level, width, height, face ); } + ASSERT(face < 6); + /* Ensure we have a valid texture to upload */ if ( ( hwlevel < 0 ) || ( hwlevel >= RADEON_MAX_TEXTURE_LEVELS ) ) { - _mesa_problem(NULL, "bad texture level in r200UploadSubimage"); + _mesa_problem(NULL, "bad texture level in %s", __FUNCTION__); return; } - texImage = t->tObj->Image[level]; + switch (face) { + case 0: + texImage = t->base.tObj->Image[level]; + break; + case 1: + texImage = t->base.tObj->NegX[level]; + break; + case 2: + texImage = t->base.tObj->PosY[level]; + break; + case 3: + texImage = t->base.tObj->NegY[level]; + break; + case 4: + texImage = t->base.tObj->PosZ[level]; + break; + case 5: + texImage = t->base.tObj->NegZ[level]; + break; + } + if ( !texImage ) { if ( R200_DEBUG & DEBUG_TEXTURE ) fprintf( stderr, "%s: texImage %d is NULL!\n", __FUNCTION__, level ); @@ -528,7 +333,7 @@ } - if (t->tObj->Target == GL_TEXTURE_RECTANGLE_NV) { + if (t->base.tObj->Target == GL_TEXTURE_RECTANGLE_NV) { assert(level == 0); assert(hwlevel == 0); if ( R200_DEBUG & DEBUG_TEXTURE ) @@ -538,9 +343,9 @@ } else if (texImage->IsClientData) { if ( R200_DEBUG & DEBUG_TEXTURE ) - fprintf( stderr, "%s: image data is in agp client storage\n", + fprintf( stderr, "%s: image data is in GART client storage\n", __FUNCTION__); - r200UploadAGPClientSubImage( rmesa, t, texImage, hwlevel, + r200UploadGARTClientSubImage( rmesa, t, texImage, hwlevel, x, y, width, height ); return; } @@ -549,56 +354,51 @@ __FUNCTION__); - texFormat = texImage->TexFormat; - - switch ( texFormat->TexelBytes ) { - case 1: - texelsPerDword = 4; - break; - case 2: - texelsPerDword = 2; - break; - case 4: - texelsPerDword = 1; - break; - } - - format = t->pp_txformat & R200_TXFORMAT_FORMAT_MASK; - imageWidth = texImage->Width; imageHeight = texImage->Height; offset = t->bufAddr; - pitch = (t->image[0].width * texFormat->TexelBytes) / 64; - - if ( R200_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) - { + if ( R200_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) { GLint imageX = 0; GLint imageY = 0; - GLint blitX = t->image[hwlevel].x; - GLint blitY = t->image[hwlevel].y; - GLint blitWidth = t->image[hwlevel].width; - GLint blitHeight = t->image[hwlevel].height; + GLint blitX = t->image[face][hwlevel].x; + GLint blitY = t->image[face][hwlevel].y; + GLint blitWidth = t->image[face][hwlevel].width; + GLint blitHeight = t->image[face][hwlevel].height; fprintf( stderr, " upload image: %d,%d at %d,%d\n", imageWidth, imageHeight, imageX, imageY ); fprintf( stderr, " upload blit: %d,%d at %d,%d\n", blitWidth, blitHeight, blitX, blitY ); - fprintf( stderr, " blit ofs: 0x%07x pitch: 0x%x " - "level: %d/%d format: %x\n", - (GLuint)offset, (GLuint)pitch, hwlevel, level, format ); + fprintf( stderr, " blit ofs: 0x%07x level: %d/%d\n", + (GLuint)offset, hwlevel, level ); } - t->image[hwlevel].data = texImage->Data; + t->image[face][hwlevel].data = texImage->Data; + /* Init the DRM_RADEON_TEXTURE command / drmRadeonTexture struct. + * NOTE: we're always use a 1KB-wide blit and I8 texture format. + * We used to use 1, 2 and 4-byte texels and used to use the texture + * width to dictate the blit width - but that won't work for compressed + * textures. (Brian) + */ tex.offset = offset; - tex.pitch = pitch; - tex.format = format; - tex.width = imageWidth; - tex.height = imageHeight; + tex.pitch = BLIT_WIDTH_BYTES / 64; + tex.format = R200_TXFORMAT_I8; /* any 1-byte texel format */ + if (texImage->TexFormat->TexelBytes) { + tex.width = imageWidth * texImage->TexFormat->TexelBytes; /* in bytes */ + tex.height = imageHeight; + } + else { + tex.width = imageWidth; /* compressed */ + tex.height = imageHeight; + if (tex.height < 4) + tex.height = 4; + } tex.image = &tmp; - memcpy( &tmp, &t->image[hwlevel], sizeof(drmRadeonTexImage) ); + /* copy (x,y,width,height,data) */ + memcpy( &tmp, &t->image[face][hwlevel], sizeof(drmRadeonTexImage) ); LOCK_HARDWARE( rmesa ); do { @@ -614,122 +414,89 @@ UNLOCK_HARDWARE( rmesa ); if ( ret ) { - fprintf( stderr, "DRM_R200_TEXTURE: return = %d\n", ret ); - fprintf( stderr, " offset=0x%08x pitch=0x%x format=%d\n", - offset, pitch, format ); + fprintf( stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret ); + fprintf( stderr, " offset=0x%08x\n", + offset ); fprintf( stderr, " image width=%d height=%d\n", imageWidth, imageHeight ); fprintf( stderr, " blit width=%d height=%d data=%p\n", - t->image[hwlevel].width, t->image[hwlevel].height, - t->image[hwlevel].data ); + t->image[face][hwlevel].width, t->image[face][hwlevel].height, + t->image[face][hwlevel].data ); exit( 1 ); } } - -/* Upload the texture images associated with texture `t'. This might - * require removing our own and/or other client's texture objects to - * make room for these images. +/** + * Upload the texture images associated with texture \a t. This might + * require the allocation of texture memory. + * + * \param rmesa Context pointer + * \param t Texture to be uploaded + * \param face Cube map face to be uploaded. Zero for non-cube maps. */ -int r200UploadTexImages( r200ContextPtr rmesa, r200TexObjPtr t ) + +int r200UploadTexImages( r200ContextPtr rmesa, r200TexObjPtr t, GLuint face ) { - const int numLevels = t->lastLevel - t->firstLevel + 1; - int heap; - r200TexObjPtr t0 = rmesa->state.texture.unit[0].texobj; - r200TexObjPtr t1 = rmesa->state.texture.unit[1].texobj; + const int numLevels = t->base.lastLevel - t->base.firstLevel + 1; if ( R200_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) { fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__, - rmesa->glCtx, t->tObj, t->totalSize, - t->firstLevel, t->lastLevel ); + (void *)rmesa->glCtx, (void *)t->base.tObj, t->base.totalSize, + t->base.firstLevel, t->base.lastLevel ); } - if ( !t || t->totalSize == 0 ) + if ( !t || t->base.totalSize == 0 ) return 0; if (R200_DEBUG & DEBUG_SYNC) { - fprintf(stderr, "\nSyncing\n\n"); - R200_FIREVERTICES( rmesa ); + fprintf(stderr, "%s: Syncing\n", __FUNCTION__ ); r200Finish( rmesa->glCtx ); } LOCK_HARDWARE( rmesa ); - /* Choose the heap appropriately */ - heap = t->heap = RADEON_CARD_HEAP; + if ( t->base.memBlock == NULL ) { + int heap; - /* Do we need to eject LRU texture objects? */ - if ( !t->memBlock ) { - /* Allocate a memory block on a 1k boundary (1<<10 == 1024) */ - t->memBlock = mmAllocMem( rmesa->texture.heap[heap], - t->totalSize, 10, 0 ); - - - /* Kick out textures until the requested texture fits */ - while ( !t->memBlock ) { - if ( rmesa->texture.objects[heap].prev == t0 || - rmesa->texture.objects[heap].prev == t1 ) { - fprintf( stderr, - "r200UploadTexImages: ran into bound texture\n" ); - UNLOCK_HARDWARE( rmesa ); - return -1; - } - if ( rmesa->texture.objects[heap].prev == - &rmesa->texture.objects[heap] ) { - if ( rmesa->r200Screen->IsPCI ) { - fprintf( stderr, "r200UploadTexImages: upload texture " - "failure on local texture heaps, sz=%d\n", - t->totalSize ); - UNLOCK_HARDWARE( rmesa ); - return -1; - } else { - fprintf( stderr, "r200UploadTexImages: upload texture " - "failure on both local and AGP texture heaps, " - "sz=%d\n", - t->totalSize ); - UNLOCK_HARDWARE( rmesa ); - return -1; - } - } - - r200SwapOutTexObj( rmesa, rmesa->texture.objects[heap].prev ); - - t->memBlock = mmAllocMem( rmesa->texture.heap[heap], - t->totalSize, 12, 0 ); + heap = driAllocateTexture( rmesa->texture_heaps, rmesa->nr_heaps, + (driTextureObject *) t ); + if ( heap == -1 ) { + UNLOCK_HARDWARE( rmesa ); + return -1; } /* Set the base offset of the texture image */ - t->bufAddr = rmesa->r200Screen->texOffset[heap] + t->memBlock->ofs; + t->bufAddr = rmesa->r200Screen->texOffset[heap] + + t->base.memBlock->ofs; t->pp_txoffset = t->bufAddr; + /* Mark this texobj as dirty on all units: */ t->dirty_state = TEX_ALL; } - /* Let the world know we've used this memory recently */ - r200UpdateTexLRU( rmesa, t ); + /* Let the world know we've used this memory recently. + */ + driUpdateTextureLRU( (driTextureObject *) t ); UNLOCK_HARDWARE( rmesa ); /* Upload any images that are new */ - if (t->dirty_images) { - int hwlevel; - for ( hwlevel = 0 ; hwlevel < numLevels ; hwlevel++ ) { - if ( t->dirty_images & (1 << (hwlevel+t->firstLevel)) ) { - r200UploadSubImage( rmesa, t, hwlevel, - 0, 0, - t->image[hwlevel].width, - t->image[hwlevel].height ); + if (t->base.dirty_images[face]) { + int i; + for ( i = 0 ; i < numLevels ; i++ ) { + if ( (t->base.dirty_images[face] & (1 << (i+t->base.firstLevel))) != 0 ) { + uploadSubImage( rmesa, t, i, 0, 0, t->image[face][i].width, + t->image[face][i].height, face ); } } - t->dirty_images = 0; + t->base.dirty_images[face] = 0; } - if (R200_DEBUG & DEBUG_SYNC) { - fprintf(stderr, "\nSyncing\n\n"); + fprintf(stderr, "%s: Syncing\n", __FUNCTION__ ); r200Finish( rmesa->glCtx ); } Index: xc/lib/GL/mesa/src/drv/r200/r200_texstate.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_texstate.c:1.3 xc/lib/GL/mesa/src/drv/r200/r200_texstate.c:1.6 --- xc/lib/GL/mesa/src/drv/r200/r200_texstate.c:1.3 Sat Feb 15 17:18:47 2003 +++ xc/lib/GL/mesa/src/drv/r200/r200_texstate.c Thu Jan 22 22:57:05 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_texstate.c,v 1.3 2003/02/15 22:18:47 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_texstate.c,v 1.6 2004/01/23 03:57:05 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,13 +25,21 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ +#include "glheader.h" +#include "imports.h" +#include "context.h" +#include "macros.h" +#include "texformat.h" +#include "enums.h" + #include "r200_context.h" #include "r200_state.h" #include "r200_ioctl.h" @@ -39,230 +47,179 @@ #include "r200_tex.h" #include "r200_tcl.h" -#include "colormac.h" -#include "context.h" -#include "enums.h" -#include "macros.h" -#include "mem.h" -#include "mmath.h" -#include "simple_list.h" -#include "texformat.h" +#define R200_TXFORMAT_AL88 R200_TXFORMAT_AI88 +#define R200_TXFORMAT_YCBCR R200_TXFORMAT_YVYU422 +#define R200_TXFORMAT_YCBCR_REV R200_TXFORMAT_VYUY422 + +#define _COLOR(f) \ + [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f, 0 } +#define _ALPHA(f) \ + [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f | R200_TXFORMAT_ALPHA_IN_MAP, 0 } +#define _YUV(f) \ + [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f, R200_YUV_TO_RGB } +#define _INVALID(f) \ + [ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 } +#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_YCBCR_REV) \ + && (tx_table[f].format != 0xffffffff) ) + +static const struct { + GLuint format, filter; +} +tx_table[] = +{ + _ALPHA(RGBA8888), + _ALPHA(ARGB8888), + _INVALID(RGB888), + _COLOR(RGB565), + _ALPHA(ARGB4444), + _ALPHA(ARGB1555), + _ALPHA(AL88), + _INVALID(A8), + _INVALID(L8), + _COLOR(I8), + _INVALID(CI8), + _YUV(YCBCR), + _YUV(YCBCR_REV), +}; +#undef _COLOR +#undef _ALPHA +#undef _INVALID + +/** + * This function computes the number of bytes of storage needed for + * the given texture object (all mipmap levels, all cube faces). + * The \c image[face][level].x/y/width/height parameters for upload/blitting + * are computed here. \c pp_txfilter, \c pp_txformat, etc. will be set here + * too. + * + * \param rmesa Context pointer + * \param tObj GL texture object whose images are to be posted to + * hardware state. + */ static void r200SetTexImages( r200ContextPtr rmesa, - struct gl_texture_object *tObj, - GLenum target ) + struct gl_texture_object *tObj ) { r200TexObjPtr t = (r200TexObjPtr)tObj->DriverData; const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel]; - GLint totalSize; - GLint texelsPerDword = 0, blitWidth = 0, blitPitch = 0; - GLint x, y, width, height; + GLint curOffset; GLint i; - GLint firstLevel=0, lastLevel=0, numLevels; - GLint log2Width, log2Height; - GLuint txformat = 0; - - t->pp_txfilter &= ~R200_YUV_TO_RGB; + GLint numLevels; + GLint log2Width, log2Height, log2Depth; /* Set the hardware texture format */ - switch (baseImage->TexFormat->MesaFormat) { - case MESA_FORMAT_I8: - txformat = R200_TXFORMAT_I8; - break; - case MESA_FORMAT_AL88: - txformat = R200_TXFORMAT_AI88; - break; - case MESA_FORMAT_RGBA8888: - txformat = R200_TXFORMAT_RGBA8888; - break; - case MESA_FORMAT_ARGB8888: - txformat = R200_TXFORMAT_ARGB8888; - break; - case MESA_FORMAT_RGB565: - txformat = R200_TXFORMAT_RGB565; - break; - case MESA_FORMAT_ARGB1555: - txformat = R200_TXFORMAT_ARGB1555; - break; - case MESA_FORMAT_ARGB4444: - txformat = R200_TXFORMAT_ARGB4444; - break; - case MESA_FORMAT_YCBCR: - txformat = R200_TXFORMAT_YVYU422; - t->pp_txfilter |= R200_YUV_TO_RGB; - break; - case MESA_FORMAT_YCBCR_REV: - txformat = R200_TXFORMAT_VYUY422; - t->pp_txfilter |= R200_YUV_TO_RGB; - break; - default: - _mesa_problem(NULL, "unexpected texture format in r200TexImage2D"); - return; - } t->pp_txformat &= ~(R200_TXFORMAT_FORMAT_MASK | R200_TXFORMAT_ALPHA_IN_MAP); - t->pp_txformat |= txformat; + t->pp_txfilter &= ~R200_YUV_TO_RGB; - if ( txformat == R200_TXFORMAT_RGBA8888 || - txformat == R200_TXFORMAT_ARGB8888 || - txformat == R200_TXFORMAT_ARGB4444 || - txformat == R200_TXFORMAT_ARGB1555 || - txformat == R200_TXFORMAT_AI88 ) { - t->pp_txformat |= R200_TXFORMAT_ALPHA_IN_MAP; - } - - /* The R200 has a 64-byte minimum pitch for all blits. We - * calculate the equivalent number of texels to simplify the - * calculation of the texture image area. - */ - switch ( baseImage->TexFormat->TexelBytes ) { - case 1: - texelsPerDword = 4; - blitPitch = 64; - break; - case 2: - texelsPerDword = 2; - blitPitch = 32; - break; - case 4: - texelsPerDword = 1; - blitPitch = 16; - break; - default: - assert(0); + if ( VALID_FORMAT( baseImage->TexFormat->MesaFormat ) ) { + t->pp_txformat |= tx_table[ baseImage->TexFormat->MesaFormat ].format; + t->pp_txfilter |= tx_table[ baseImage->TexFormat->MesaFormat ].filter; + } + else { + _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); + return; } - /* Select the larger of the two widths for our global texture image - * coordinate space. As the R200 has very strict offset rules, we - * can't upload mipmaps directly and have to reference their location - * from the aligned start of the whole image. - */ - blitWidth = MAX2( baseImage->Width, blitPitch ); - /* Calculate mipmap offsets and dimensions. + /* Compute which mipmap levels we really want to send to the hardware. */ - totalSize = 0; - x = 0; - y = 0; - /* Compute which mipmap levels we really want to send to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. - * Yes, this looks overly complicated, but it's all needed. - */ - if (R200_DEBUG & DEBUG_TEXTURE) - fprintf(stderr, - "%s: BaseLevel %d MinLod %f MaxLod %f MaxLevel %d\n", - __FUNCTION__, - tObj->BaseLevel, tObj->MinLod, tObj->MaxLod, - tObj->MaxLevel); - - - switch (target) { - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - firstLevel = tObj->BaseLevel + (GLint)(tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - lastLevel = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ - log2Width = tObj->Image[firstLevel]->WidthLog2; - log2Height = tObj->Image[firstLevel]->HeightLog2; - break; - case GL_TEXTURE_RECTANGLE_NV: - firstLevel = lastLevel = 0; - log2Width = log2Height = 1; /* ? */ - break; - default: - return; - } + driCalculateTextureFirstLastLevel( (driTextureObject *) t ); + log2Width = tObj->Image[t->base.firstLevel]->WidthLog2; + log2Height = tObj->Image[t->base.firstLevel]->HeightLog2; + log2Depth = tObj->Image[t->base.firstLevel]->DepthLog2; - /* save these values */ - t->firstLevel = firstLevel; - t->lastLevel = lastLevel; - - numLevels = lastLevel - firstLevel + 1; - - if (R200_DEBUG & DEBUG_TEXTURE) - fprintf(stderr, - "%s: firstLevel %d last Level %d w,h: %d,%d log(w,h) %d,%d\n", - __FUNCTION__, firstLevel, lastLevel, - tObj->Image[firstLevel]->Width, - tObj->Image[firstLevel]->Height, - tObj->Image[firstLevel]->WidthLog2, - tObj->Image[firstLevel]->HeightLog2); + numLevels = t->base.lastLevel - t->base.firstLevel + 1; - assert(numLevels <= RADEON_MAX_TEXTURE_LEVELS); - for ( i = 0 ; i < numLevels ; i++ ) { + /* Calculate mipmap offsets and dimensions for blitting (uploading) + * The idea is that we lay out the mipmap levels within a block of + * memory organized as a rectangle of width BLIT_WIDTH_BYTES. + */ + curOffset = 0; + + for (i = 0; i < numLevels; i++) { const struct gl_texture_image *texImage; GLuint size; - texImage = tObj->Image[i + firstLevel]; + texImage = tObj->Image[i + t->base.firstLevel]; if ( !texImage ) break; - width = texImage->Width; - height = texImage->Height; - - /* Texture images have a minimum pitch of 32 bytes (half of the - * 64-byte minimum pitch for blits). For images that have a - * width smaller than this, we must pad each texture image - * scanline out to this amount. - */ - if ( width < blitPitch / 2 ) { - width = blitPitch / 2; + /* find image size in bytes */ + if (texImage->IsCompressed) { + size = texImage->CompressedSize; } - - if (target == GL_TEXTURE_RECTANGLE_NV) - size = ((width*baseImage->TexFormat->TexelBytes+63)&~63) * height; - else - size = width * height * baseImage->TexFormat->TexelBytes; - - totalSize += size; - - if (target != GL_TEXTURE_RECTANGLE_NV) { - while ( width < blitWidth && height > 1 ) { - width *= 2; - height /= 2; - } + else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) { + size = ((texImage->Width * texImage->TexFormat->TexelBytes + 63) + & ~63) * texImage->Height; } - - t->image[i].x = x; - t->image[i].y = y; - t->image[i].width = width; - t->image[i].height = height; - - /* While blits must have a pitch of at least 64 bytes, mipmaps - * must be aligned on a 32-byte boundary (just like each texture - * image scanline). - */ - if ( width >= blitWidth ) { - y += height; - } else { - x += width; - if ( x >= blitWidth ) { - x = 0; - y++; - } + else { + int w = texImage->Width * texImage->TexFormat->TexelBytes; + if (w < 32) + w = 32; + size = w * texImage->Height * texImage->Depth; } + assert(size > 0); + + + /* Align to 32-byte offset. It is faster to do this unconditionally + * (no branch penalty). + */ + + curOffset = (curOffset + 0x1f) & ~0x1f; + + t->image[0][i].x = curOffset % BLIT_WIDTH_BYTES; + t->image[0][i].y = curOffset / BLIT_WIDTH_BYTES; + t->image[0][i].width = MIN2(size, BLIT_WIDTH_BYTES); + t->image[0][i].height = size / t->image[0][i].width; + +#if 0 + /* for debugging only and only applicable to non-rectangle targets */ + assert(size % t->image[0][i].width == 0); + assert(t->image[0][i].x == 0 + || (size < BLIT_WIDTH_BYTES && t->image[0][i].height == 1)); +#endif + + if (0) + fprintf(stderr, + "level %d: %dx%d x=%d y=%d w=%d h=%d size=%d at %d\n", + i, texImage->Width, texImage->Height, + t->image[0][i].x, t->image[0][i].y, + t->image[0][i].width, t->image[0][i].height, size, curOffset); + + curOffset += size; - if ( 0 ) - fprintf( stderr, "level=%d p=%d %dx%d -> %dx%d at (%d,%d)\n", - i, blitWidth, baseImage->Width, baseImage->Height, - t->image[i].width, t->image[i].height, - t->image[i].x, t->image[i].y ); } /* Align the total size of texture memory block. */ - t->totalSize = (totalSize + RADEON_OFFSET_MASK) & ~RADEON_OFFSET_MASK; + t->base.totalSize = (curOffset + RADEON_OFFSET_MASK) & ~RADEON_OFFSET_MASK; + + /* Setup remaining cube face blits, if needed */ + if (tObj->Target == GL_TEXTURE_CUBE_MAP) { + /* Round totalSize up to multiple of BLIT_WIDTH_BYTES */ + const GLuint faceSize = (t->base.totalSize + BLIT_WIDTH_BYTES - 1) + & ~(BLIT_WIDTH_BYTES-1); + const GLuint lines = faceSize / BLIT_WIDTH_BYTES; + GLuint face; + /* reuse face 0 x/y/width/height - just adjust y */ + for (face = 1; face < 6; face++) { + for (i = 0; i < numLevels; i++) { + t->image[face][i].x = t->image[0][i].x; + t->image[face][i].y = t->image[0][i].y + face * lines; + t->image[face][i].width = t->image[0][i].width; + t->image[face][i].height = t->image[0][i].height; + } + } + t->base.totalSize = 6 * faceSize; /* total texmem needed */ + } + /* Hardware state: */ @@ -270,23 +227,50 @@ t->pp_txfilter |= (numLevels - 1) << R200_MAX_MIP_LEVEL_SHIFT; t->pp_txformat &= ~(R200_TXFORMAT_WIDTH_MASK | - R200_TXFORMAT_HEIGHT_MASK); + R200_TXFORMAT_HEIGHT_MASK | + R200_TXFORMAT_CUBIC_MAP_ENABLE | + R200_TXFORMAT_F5_WIDTH_MASK | + R200_TXFORMAT_F5_HEIGHT_MASK); t->pp_txformat |= ((log2Width << R200_TXFORMAT_WIDTH_SHIFT) | (log2Height << R200_TXFORMAT_HEIGHT_SHIFT)); - t->pp_txsize = (((tObj->Image[firstLevel]->Width - 1) << 0) | - ((tObj->Image[firstLevel]->Height - 1) << 16)); + t->pp_txformat_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK); + if (tObj->Target == GL_TEXTURE_3D) { + t->pp_txformat_x |= (log2Depth << R200_DEPTH_LOG2_SHIFT); + t->pp_txformat_x |= R200_TEXCOORD_VOLUME; + } + else if (tObj->Target == GL_TEXTURE_CUBE_MAP) { + ASSERT(log2Width == log2height); + t->pp_txformat |= ((log2Width << R200_TXFORMAT_F5_WIDTH_SHIFT) | + (log2Height << R200_TXFORMAT_F5_HEIGHT_SHIFT) | + (R200_TXFORMAT_CUBIC_MAP_ENABLE)); + t->pp_txformat_x |= R200_TEXCOORD_CUBIC_ENV; + t->pp_cubic_faces = ((log2Width << R200_FACE_WIDTH_1_SHIFT) | + (log2Height << R200_FACE_HEIGHT_1_SHIFT) | + (log2Width << R200_FACE_WIDTH_2_SHIFT) | + (log2Height << R200_FACE_HEIGHT_2_SHIFT) | + (log2Width << R200_FACE_WIDTH_3_SHIFT) | + (log2Height << R200_FACE_HEIGHT_3_SHIFT) | + (log2Width << R200_FACE_WIDTH_4_SHIFT) | + (log2Height << R200_FACE_HEIGHT_4_SHIFT)); + } + + t->pp_txsize = (((tObj->Image[t->base.firstLevel]->Width - 1) << 0) | + ((tObj->Image[t->base.firstLevel]->Height - 1) << 16)); /* Only need to round to nearest 32 for textures, but the blitter * requires 64-byte aligned pitches, and we may/may not need the - * blitter. + * blitter. NPOT only! */ - t->pp_txpitch = ((tObj->Image[firstLevel]->Width * baseImage->TexFormat->TexelBytes) + 63) & ~(63); + if (baseImage->IsCompressed) + t->pp_txpitch = (tObj->Image[t->base.firstLevel]->Width + 63) & ~(63); + else + t->pp_txpitch = ((tObj->Image[t->base.firstLevel]->Width * baseImage->TexFormat->TexelBytes) + 63) & ~(63); t->pp_txpitch -= 32; t->dirty_state = TEX_ALL; - r200UploadTexImages( rmesa, t ); + /* FYI: r200UploadTexImages( rmesa, t ) used to be called here */ } @@ -493,7 +477,7 @@ (R200_TXA_ARG_A_DIFFUSE_ALPHA | R200_TXA_ARG_B_ZERO | R200_TXA_ARG_C_R0_ALPHA | - R200_TXC_COMP_ARG_B | + R200_TXA_COMP_ARG_B | R200_TXA_OP_MADD), }, @@ -540,7 +524,7 @@ (R200_TXA_ARG_A_R0_ALPHA | R200_TXA_ARG_B_ZERO | R200_TXA_ARG_C_R1_ALPHA | - R200_TXC_COMP_ARG_B | + R200_TXA_COMP_ARG_B | R200_TXA_OP_MADD), }, @@ -587,7 +571,7 @@ (R200_TXA_ARG_A_R0_ALPHA | R200_TXA_ARG_B_ZERO | R200_TXA_ARG_C_R2_ALPHA | - R200_TXC_COMP_ARG_B | + R200_TXA_COMP_ARG_B | R200_TXA_OP_MADD), } }; @@ -639,6 +623,17 @@ R200_TXC_ARG_A_DIFFUSE_ALPHA | R200_TXC_COMP_ARG_A }; +/* GL_ZERO table - indices 0-3 + * GL_ONE table - indices 1-4 + */ +static GLuint r200_zero_color[] = +{ + R200_TXC_ARG_A_ZERO, + R200_TXC_ARG_A_ZERO | R200_TXC_COMP_ARG_A, + R200_TXC_ARG_A_ZERO, + R200_TXC_ARG_A_ZERO | R200_TXC_COMP_ARG_A, + R200_TXC_ARG_A_ZERO +}; /* The alpha tables only have GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA. */ @@ -650,24 +645,33 @@ R200_TXA_ARG_A_R2_ALPHA }, { - R200_TXA_ARG_A_R0_ALPHA | R200_TXC_COMP_ARG_A, - R200_TXA_ARG_A_R1_ALPHA | R200_TXC_COMP_ARG_A, - R200_TXA_ARG_A_R2_ALPHA | R200_TXC_COMP_ARG_A + R200_TXA_ARG_A_R0_ALPHA | R200_TXA_COMP_ARG_A, + R200_TXA_ARG_A_R1_ALPHA | R200_TXA_COMP_ARG_A, + R200_TXA_ARG_A_R2_ALPHA | R200_TXA_COMP_ARG_A }, }; static GLuint r200_tfactor_alpha[] = { R200_TXA_ARG_A_TFACTOR_ALPHA, - R200_TXA_ARG_A_TFACTOR_ALPHA | R200_TXC_COMP_ARG_A + R200_TXA_ARG_A_TFACTOR_ALPHA | R200_TXA_COMP_ARG_A }; static GLuint r200_primary_alpha[] = { R200_TXA_ARG_A_DIFFUSE_ALPHA, - R200_TXA_ARG_A_DIFFUSE_ALPHA | R200_TXC_COMP_ARG_A + R200_TXA_ARG_A_DIFFUSE_ALPHA | R200_TXA_COMP_ARG_A }; +/* GL_ZERO table - indices 0-1 + * GL_ONE table - indices 1-2 + */ +static GLuint r200_zero_alpha[] = +{ + R200_TXA_ARG_A_ZERO, + R200_TXA_ARG_A_ZERO | R200_TXA_COMP_ARG_A, + R200_TXA_ARG_A_ZERO, +}; /* Extract the arg from slot A, shift it into the correct argument slot @@ -698,7 +702,7 @@ * Texture unit state management */ -static void r200UpdateTextureEnv( GLcontext *ctx, int unit ) +static GLboolean r200UpdateTextureEnv( GLcontext *ctx, int unit ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -706,12 +710,18 @@ GLuint color_scale = rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2]; GLuint alpha_scale = rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2]; + /* texUnit->_Current can be NULL if and only if the texture unit is + * not actually enabled. + */ + assert( (texUnit->_ReallyEnabled == 0) + || (texUnit->_Current != NULL) ); + if ( R200_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, ctx, unit ); + fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit ); } /* Set the texture environment state. Isn't this nice and clean? - * The R200 will automagically set the texture alpha to 0xff when + * The chip will automagically set the texture alpha to 0xff when * the texture format does not include an alpha component. This * reduces the amount of special-casing we have to do, alpha-only * textures being a notable exception. @@ -753,7 +763,7 @@ break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; @@ -777,7 +787,7 @@ break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; @@ -798,7 +808,7 @@ break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; @@ -822,7 +832,7 @@ break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; @@ -846,7 +856,7 @@ break; case GL_COLOR_INDEX: default: - return; + return GL_FALSE; } break; @@ -874,27 +884,33 @@ numColorArgs = 2; break; case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: numColorArgs = 3; break; default: - return; + return GL_FALSE; } switch ( texUnit->CombineModeA ) { case GL_REPLACE: numAlphaArgs = 1; break; - case GL_SUBTRACT: case GL_MODULATE: case GL_ADD: case GL_ADD_SIGNED: + case GL_SUBTRACT: numAlphaArgs = 2; break; case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: numAlphaArgs = 3; break; default: - return; + return GL_FALSE; } /* Step 1: @@ -920,8 +936,14 @@ else color_arg[i] = r200_register_color[op][0]; break; + case GL_ZERO: + color_arg[i] = r200_zero_color[op]; + break; + case GL_ONE: + color_arg[i] = r200_zero_color[op+1]; + break; default: - return; + return GL_FALSE; } } @@ -945,8 +967,14 @@ else alpha_arg[i] = r200_register_alpha[op][0]; break; + case GL_ZERO: + alpha_arg[i] = r200_zero_alpha[op]; + break; + case GL_ONE: + alpha_arg[i] = r200_zero_alpha[op+1]; + break; default: - return; + return GL_FALSE; } } @@ -973,14 +1001,6 @@ R200_COLOR_ARG( 0, A ); R200_COLOR_ARG( 1, C ); break; - case GL_SUBTRACT: - color_combine = (R200_TXC_ARG_B_ZERO | - R200_TXC_COMP_ARG_B | - R200_TXC_NEG_ARG_C | - R200_TXC_OP_MADD); - R200_COLOR_ARG( 0, A ); - R200_COLOR_ARG( 1, C ); - break; case GL_ADD_SIGNED: color_combine = (R200_TXC_ARG_B_ZERO | R200_TXC_COMP_ARG_B | @@ -989,6 +1009,14 @@ R200_COLOR_ARG( 0, A ); R200_COLOR_ARG( 1, C ); break; + case GL_SUBTRACT: + color_combine = (R200_TXC_ARG_B_ZERO | + R200_TXC_COMP_ARG_B | + R200_TXC_NEG_ARG_C | + R200_TXC_OP_MADD); + R200_COLOR_ARG( 0, A ); + R200_COLOR_ARG( 1, C ); + break; case GL_INTERPOLATE: color_combine = (R200_TXC_OP_LERP); R200_COLOR_ARG( 0, B ); @@ -998,6 +1026,10 @@ case GL_DOT3_RGB_EXT: case GL_DOT3_RGBA_EXT: + /* The EXT version of the DOT3 extension does not support the + * scale factor, but the ARB version (and the version in OpenGL + * 1.3) does. + */ RGBshift = 0; Ashift = 0; /* FALLTHROUGH */ @@ -1025,8 +1057,28 @@ R200_COLOR_ARG( 1, B ); break; + case GL_MODULATE_ADD_ATI: + color_combine = (R200_TXC_OP_MADD); + R200_COLOR_ARG( 0, A ); + R200_COLOR_ARG( 1, C ); + R200_COLOR_ARG( 2, B ); + break; + case GL_MODULATE_SIGNED_ADD_ATI: + color_combine = (R200_TXC_BIAS_ARG_C | /* new */ + R200_TXC_OP_MADD); /* was ADDSIGNED */ + R200_COLOR_ARG( 0, A ); + R200_COLOR_ARG( 1, C ); + R200_COLOR_ARG( 2, B ); + break; + case GL_MODULATE_SUBTRACT_ATI: + color_combine = (R200_TXC_NEG_ARG_C | + R200_TXC_OP_MADD); + R200_COLOR_ARG( 0, A ); + R200_COLOR_ARG( 1, C ); + R200_COLOR_ARG( 2, B ); + break; default: - return; + return GL_FALSE; } switch ( texUnit->CombineModeA ) { @@ -1044,24 +1096,24 @@ break; case GL_ADD: alpha_combine = (R200_TXA_ARG_B_ZERO | - R200_TXC_COMP_ARG_B | + R200_TXA_COMP_ARG_B | R200_TXA_OP_MADD); R200_ALPHA_ARG( 0, A ); R200_ALPHA_ARG( 1, C ); break; - case GL_SUBTRACT: + case GL_ADD_SIGNED: alpha_combine = (R200_TXA_ARG_B_ZERO | - R200_TXC_COMP_ARG_B | - R200_TXC_NEG_ARG_C | - R200_TXA_OP_MADD); + R200_TXA_COMP_ARG_B | + R200_TXA_BIAS_ARG_C | /* new */ + R200_TXA_OP_MADD); /* was ADDSIGNED */ R200_ALPHA_ARG( 0, A ); R200_ALPHA_ARG( 1, C ); break; - case GL_ADD_SIGNED: + case GL_SUBTRACT: alpha_combine = (R200_TXA_ARG_B_ZERO | - R200_TXC_COMP_ARG_B | - R200_TXC_BIAS_ARG_C | /* new */ - R200_TXA_OP_MADD); /* was ADDSIGNED */ + R200_TXA_COMP_ARG_B | + R200_TXA_NEG_ARG_C | + R200_TXA_OP_MADD); R200_ALPHA_ARG( 0, A ); R200_ALPHA_ARG( 1, C ); break; @@ -1071,18 +1123,38 @@ R200_ALPHA_ARG( 1, A ); R200_ALPHA_ARG( 2, C ); break; + + case GL_MODULATE_ADD_ATI: + alpha_combine = (R200_TXA_OP_MADD); + R200_ALPHA_ARG( 0, A ); + R200_ALPHA_ARG( 1, C ); + R200_ALPHA_ARG( 2, B ); + break; + case GL_MODULATE_SIGNED_ADD_ATI: + alpha_combine = (R200_TXA_BIAS_ARG_C | /* new */ + R200_TXA_OP_MADD); /* was ADDSIGNED */ + R200_ALPHA_ARG( 0, A ); + R200_ALPHA_ARG( 1, C ); + R200_ALPHA_ARG( 2, B ); + break; + case GL_MODULATE_SUBTRACT_ATI: + alpha_combine = (R200_TXA_NEG_ARG_C | + R200_TXA_OP_MADD); + R200_ALPHA_ARG( 0, A ); + R200_ALPHA_ARG( 1, C ); + R200_ALPHA_ARG( 2, B ); + break; default: - return; + return GL_FALSE; } - if ( texUnit->CombineModeRGB == GL_DOT3_RGB ) { + if ( (texUnit->CombineModeRGB == GL_DOT3_RGB_EXT) + || (texUnit->CombineModeRGB == GL_DOT3_RGB) ) { alpha_scale |= R200_TXA_DOT_ALPHA; } /* Step 3: - * Apply the scale factor. The EXT version of the DOT3 extension does - * not support the scale factor, but the ARB version (and the version in - * OpenGL 1.3) does. + * Apply the scale factor. */ color_scale &= ~R200_TXC_SCALE_MASK; alpha_scale &= ~R200_TXA_SCALE_MASK; @@ -1094,7 +1166,7 @@ break; default: - return; + return GL_FALSE; } } @@ -1108,23 +1180,32 @@ rmesa->hw.pix[unit].cmd[PIX_PP_TXCBLEND2] = color_scale; rmesa->hw.pix[unit].cmd[PIX_PP_TXABLEND2] = alpha_scale; } + + return GL_TRUE; } -#define TEXOBJ_TXFILTER_MASK (R200_MAX_MIP_LEVEL_MASK | \ +#define TEXOBJ_TXFILTER_MASK (R200_MAX_MIP_LEVEL_MASK | \ R200_MIN_FILTER_MASK | \ R200_MAG_FILTER_MASK | \ R200_MAX_ANISO_MASK | \ - R200_YUV_TO_RGB | \ + R200_YUV_TO_RGB | \ R200_YUV_TEMPERATURE_MASK | \ R200_CLAMP_S_MASK | \ - R200_CLAMP_T_MASK) + R200_CLAMP_T_MASK | \ + R200_BORDER_MODE_D3D ) #define TEXOBJ_TXFORMAT_MASK (R200_TXFORMAT_WIDTH_MASK | \ R200_TXFORMAT_HEIGHT_MASK | \ R200_TXFORMAT_FORMAT_MASK | \ - R200_TXFORMAT_ALPHA_IN_MAP | \ + R200_TXFORMAT_F5_WIDTH_MASK | \ + R200_TXFORMAT_F5_HEIGHT_MASK | \ + R200_TXFORMAT_ALPHA_IN_MAP | \ + R200_TXFORMAT_CUBIC_MAP_ENABLE | \ R200_TXFORMAT_NON_POWER2) +#define TEXOBJ_TXFORMAT_X_MASK (R200_DEPTH_LOG2_MASK | \ + R200_TEXCOORD_MASK | \ + R200_VOLUME_FILTER_MASK) static void import_tex_obj_state( r200ContextPtr rmesa, @@ -1137,13 +1218,28 @@ cmd[TEX_PP_TXFILTER] |= texobj->pp_txfilter & TEXOBJ_TXFILTER_MASK; cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK; cmd[TEX_PP_TXFORMAT] |= texobj->pp_txformat & TEXOBJ_TXFORMAT_MASK; + cmd[TEX_PP_TXFORMAT_X] &= ~TEXOBJ_TXFORMAT_X_MASK; + cmd[TEX_PP_TXFORMAT_X] |= texobj->pp_txformat_x & TEXOBJ_TXFORMAT_X_MASK; cmd[TEX_PP_TXSIZE] = texobj->pp_txsize; /* NPOT only! */ cmd[TEX_PP_TXPITCH] = texobj->pp_txpitch; /* NPOT only! */ cmd[TEX_PP_TXOFFSET] = texobj->pp_txoffset; cmd[TEX_PP_BORDER_COLOR] = texobj->pp_border_color; - texobj->dirty_state &= ~(1<hw.tex[unit] ); + + if (texobj->base.tObj->Target == GL_TEXTURE_CUBE_MAP) { + GLuint *cube_cmd = R200_DB_STATE( cube[unit] ); + GLuint bytesPerFace = texobj->base.totalSize / 6; + ASSERT(texobj->totalSize % 6 == 0); + cube_cmd[CUBE_PP_CUBIC_FACES] = texobj->pp_cubic_faces; + cube_cmd[CUBE_PP_CUBIC_OFFSET_F1] = texobj->pp_txoffset + 1 * bytesPerFace; + cube_cmd[CUBE_PP_CUBIC_OFFSET_F2] = texobj->pp_txoffset + 2 * bytesPerFace; + cube_cmd[CUBE_PP_CUBIC_OFFSET_F3] = texobj->pp_txoffset + 3 * bytesPerFace; + cube_cmd[CUBE_PP_CUBIC_OFFSET_F4] = texobj->pp_txoffset + 4 * bytesPerFace; + cube_cmd[CUBE_PP_CUBIC_OFFSET_F5] = texobj->pp_txoffset + 5 * bytesPerFace; + R200_DB_STATECHANGE( rmesa, &rmesa->hw.cube[unit] ); + } + + texobj->dirty_state &= ~(1<TexGenEnabled |= R200_TEXMAT_0_ENABLE<TexGenMatrix[unit].m[0] = s_plane[0]; rmesa->TexGenMatrix[unit].m[4] = s_plane[1]; @@ -1168,10 +1266,46 @@ rmesa->TexGenMatrix[unit].m[5] = t_plane[1]; rmesa->TexGenMatrix[unit].m[9] = t_plane[2]; rmesa->TexGenMatrix[unit].m[13] = t_plane[3]; + + /* NOTE: r_plane goes in the 4th row, not 3rd! */ + rmesa->TexGenMatrix[unit].m[3] = r_plane[0]; + rmesa->TexGenMatrix[unit].m[7] = r_plane[1]; + rmesa->TexGenMatrix[unit].m[11] = r_plane[2]; + rmesa->TexGenMatrix[unit].m[15] = r_plane[3]; + rmesa->NewGLState |= _NEW_TEXTURE_MATRIX; } } +/* Need this special matrix to get correct reflection map coords */ +static void +set_texgen_reflection_matrix( r200ContextPtr rmesa, GLuint unit ) +{ + static const GLfloat m[16] = { + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, 0, -1, + 0, 0, -1, 0 }; + _math_matrix_loadf( &(rmesa->TexGenMatrix[unit]), m); + _math_matrix_analyse( &(rmesa->TexGenMatrix[unit]) ); + rmesa->TexGenEnabled |= R200_TEXMAT_0_ENABLE<TexGenMatrix[unit]), m); + _math_matrix_analyse( &(rmesa->TexGenMatrix[unit]) ); + rmesa->TexGenEnabled |= R200_TEXMAT_0_ENABLE<Texture.Unit[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; GLuint inputshift = R200_TEXGEN_0_INPUT_SHIFT + unit*4; GLuint tmp = rmesa->TexGenEnabled; @@ -1192,7 +1326,7 @@ if (0) fprintf(stderr, "%s unit %d\n", __FUNCTION__, unit); - if ((texUnit->TexGenEnabled & (S_BIT|T_BIT)) == 0) { + if ((texUnit->TexGenEnabled & (S_BIT|T_BIT|R_BIT)) == 0) { /* Disabled, no fallback: */ rmesa->TexGenInputs |= @@ -1203,42 +1337,58 @@ /* Very easy to do this, in fact would remove a fallback case * elsewhere, but I haven't done it yet... Fallback: */ - fprintf(stderr, "fallback Q_BIT\n"); + /*fprintf(stderr, "fallback Q_BIT\n");*/ return GL_FALSE; } - else if ((texUnit->TexGenEnabled & (S_BIT|T_BIT)) != (S_BIT|T_BIT) || - texUnit->GenModeS != texUnit->GenModeT) { + else if (texUnit->TexGenEnabled == (S_BIT|T_BIT) && + texUnit->GenModeS == texUnit->GenModeT) { + /* OK */ + rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit; + /* continue */ + } + else if (texUnit->TexGenEnabled == (S_BIT|T_BIT|R_BIT) && + texUnit->GenModeS == texUnit->GenModeT && + texUnit->GenModeT == texUnit->GenModeR) { + /* OK */ + rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit; + /* continue */ + } + else { /* Mixed modes, fallback: */ -/* fprintf(stderr, "fallback mixed texgen\n"); */ + /* fprintf(stderr, "fallback mixed texgen\n"); */ return GL_FALSE; } - else - rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit; + + rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit; switch (texUnit->GenModeS) { case GL_OBJECT_LINEAR: rmesa->TexGenInputs |= R200_TEXGEN_INPUT_OBJ << inputshift; set_texgen_matrix( rmesa, unit, texUnit->ObjectPlaneS, - texUnit->ObjectPlaneT); + texUnit->ObjectPlaneT, + texUnit->ObjectPlaneR); break; case GL_EYE_LINEAR: rmesa->TexGenInputs |= R200_TEXGEN_INPUT_EYE << inputshift; set_texgen_matrix( rmesa, unit, texUnit->EyePlaneS, - texUnit->EyePlaneT); + texUnit->EyePlaneT, + texUnit->EyePlaneR); break; case GL_REFLECTION_MAP_NV: rmesa->TexGenNeedNormals[unit] = GL_TRUE; rmesa->TexGenInputs |= R200_TEXGEN_INPUT_EYE_REFLECT<TexGenNeedNormals[unit] = GL_TRUE; rmesa->TexGenInputs |= R200_TEXGEN_INPUT_EYE_NORMAL<NewGLState |= _NEW_TEXTURE_MATRIX; } - if (0) - fprintf(stderr, "%s unit %d neednormals %d\n", __FUNCTION__, unit, - rmesa->TexGenNeedNormals[unit]); - return GL_TRUE; } @@ -1273,7 +1419,15 @@ if (rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (R200_TEX_0_ENABLE<state.texture.unit[unit].texobj = 0; + if ( rmesa->state.texture.unit[unit].texobj != NULL ) { + /* The old texture is no longer bound to this texture unit. + * Mark it as such. + */ + + rmesa->state.texture.unit[unit].texobj->base.bound &= ~(1UL << unit); + rmesa->state.texture.unit[unit].texobj = NULL; + } + R200_STATECHANGE( rmesa, ctx ); rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= ~((R200_TEX_0_ENABLE | R200_TEX_BLEND_0_ENABLE) << unit); @@ -1289,14 +1443,15 @@ /* Actually want to keep all units less than max active texture * enabled, right? Fix this for >2 texunits. */ + /* FIXME: What should happen here if r200UpdateTextureEnv fails? */ if (unit == 0) r200UpdateTextureEnv( ctx, unit ); - + { GLuint inputshift = R200_TEXGEN_0_INPUT_SHIFT + unit*4; GLuint tmp = rmesa->TexGenEnabled; - + rmesa->TexGenEnabled &= ~(R200_TEXGEN_TEXMAT_0_ENABLE<TexGenEnabled &= ~(R200_TEXMAT_0_ENABLE<TexGenEnabled &= ~(R200_TEXGEN_INPUT_MASK<pp_txformat & R200_TXFORMAT_NON_POWER2) { t->pp_txformat &= ~R200_TXFORMAT_NON_POWER2; - t->dirty_images = ~0; + t->base.dirty_images[0] = ~0; + } + + ASSERT(tObj->Target == GL_TEXTURE_2D || tObj->Target == GL_TEXTURE_1D); + + if ( t->base.dirty_images[0] ) { + R200_FIREVERTICES( rmesa ); + r200SetTexImages( rmesa, tObj ); + r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, 0 ); + if ( !t->base.memBlock ) + return GL_FALSE; + } + + return GL_TRUE; +} + +#if ENABLE_HW_3D_TEXTURE +static GLboolean enable_tex_3d( GLcontext *ctx, int unit ) +{ + r200ContextPtr rmesa = R200_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *tObj = texUnit->_Current; + r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData; + + /* Need to load the 3d images associated with this unit. + */ + if (t->pp_txformat & R200_TXFORMAT_NON_POWER2) { + t->pp_txformat &= ~R200_TXFORMAT_NON_POWER2; + t->base.dirty_images[0] = ~0; } - if ( t->dirty_images ) { + ASSERT(tObj->Target == GL_TEXTURE_3D); + + /* R100 & R200 do not support mipmaps for 3D textures. + */ + if ( (tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR) ) { + return GL_FALSE; + } + + if ( t->base.dirty_images[0] ) { R200_FIREVERTICES( rmesa ); - r200SetTexImages( rmesa, tObj, GL_TEXTURE_2D ); - if ( !t->memBlock ) + r200SetTexImages( rmesa, tObj ); + r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, 0 ); + if ( !t->base.memBlock ) return GL_FALSE; } + + return GL_TRUE; +} +#endif + +static GLboolean enable_tex_cube( GLcontext *ctx, int unit ) +{ + r200ContextPtr rmesa = R200_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *tObj = texUnit->_Current; + r200TexObjPtr t = (r200TexObjPtr) tObj->DriverData; + GLuint face; + + /* Need to load the 2d images associated with this unit. + */ + if (t->pp_txformat & R200_TXFORMAT_NON_POWER2) { + t->pp_txformat &= ~R200_TXFORMAT_NON_POWER2; + for (face = 0; face < 6; face++) + t->base.dirty_images[face] = ~0; + } + + ASSERT(tObj->Target == GL_TEXTURE_CUBE_MAP); + + if ( t->base.dirty_images[0] || t->base.dirty_images[1] || + t->base.dirty_images[2] || t->base.dirty_images[3] || + t->base.dirty_images[4] || t->base.dirty_images[5] ) { + /* flush */ + R200_FIREVERTICES( rmesa ); + /* layout memory space, once for all faces */ + r200SetTexImages( rmesa, tObj ); + } + + /* upload (per face) */ + for (face = 0; face < 6; face++) { + if (t->base.dirty_images[face]) { + r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, face ); + } + } + if ( !t->base.memBlock ) { + /* texmem alloc failed, use s/w fallback */ + return GL_FALSE; + } + return GL_TRUE; } @@ -1345,13 +1580,16 @@ if (!(t->pp_txformat & R200_TXFORMAT_NON_POWER2)) { t->pp_txformat |= R200_TXFORMAT_NON_POWER2; - t->dirty_images = ~0; + t->base.dirty_images[0] = ~0; } - if ( t->dirty_images ) { + ASSERT(tObj->Target == GL_TEXTURE_RECTANGLE_NV); + + if ( t->base.dirty_images[0] ) { R200_FIREVERTICES( rmesa ); - r200SetTexImages( rmesa, tObj, GL_TEXTURE_RECTANGLE_NV ); - if ( !t->memBlock && !rmesa->prefer_agp_client_texturing ) + r200SetTexImages( rmesa, tObj ); + r200UploadTexImages( rmesa, (r200TexObjPtr) tObj->DriverData, 0 ); + if ( !t->base.memBlock && !rmesa->prefer_gart_client_texturing ) return GL_FALSE; } @@ -1369,15 +1607,25 @@ /* Fallback if there's a texture border */ if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) - return GL_FALSE; + return GL_FALSE; /* Update state if this is a different texture object to last * time. */ if ( rmesa->state.texture.unit[unit].texobj != t ) { + if ( rmesa->state.texture.unit[unit].texobj != NULL ) { + /* The old texture is no longer bound to this texture unit. + * Mark it as such. + */ + + rmesa->state.texture.unit[unit].texobj->base.bound &= + ~(1UL << unit); + } + rmesa->state.texture.unit[unit].texobj = t; + t->base.bound |= (1UL << unit); t->dirty_state |= 1<dirty_state & (1<recheck_texgen[unit]) { GLboolean fallback = !r200_validate_texgen( ctx, unit ); TCL_FALLBACK( ctx, (R200_TCL_FALLBACK_TEXGEN_0<state.texture.unit[unit].envMode != texUnit->EnvMode ) { rmesa->state.texture.unit[unit].format = format; rmesa->state.texture.unit[unit].envMode = texUnit->EnvMode; - r200UpdateTextureEnv( ctx, unit ); + if ( ! r200UpdateTextureEnv( ctx, unit ) ) { + return GL_FALSE; + } } - - return GL_TRUE; + + FALLBACK( rmesa, R200_FALLBACK_BORDER_MODE, t->border_fallback ); + return !t->border_fallback; } @@ -1422,14 +1673,24 @@ { struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - if ( texUnit->_ReallyEnabled & (TEXTURE0_RECT) ) { + if ( texUnit->_ReallyEnabled & (TEXTURE_RECT_BIT) ) { return (enable_tex_rect( ctx, unit ) && update_tex_common( ctx, unit )); } - else if ( texUnit->_ReallyEnabled & (TEXTURE0_1D|TEXTURE0_2D) ) { + else if ( texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT) ) { return (enable_tex_2d( ctx, unit ) && update_tex_common( ctx, unit )); } +#if ENABLE_HW_3D_TEXTURE + else if ( texUnit->_ReallyEnabled & (TEXTURE_3D_BIT) ) { + return (enable_tex_3d( ctx, unit ) && + update_tex_common( ctx, unit )); + } +#endif + else if ( texUnit->_ReallyEnabled & (TEXTURE_CUBE_BIT) ) { + return (enable_tex_cube( ctx, unit ) && + update_tex_common( ctx, unit )); + } else if ( texUnit->_ReallyEnabled ) { return GL_FALSE; } Index: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c:1.3 xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c:1.6 --- xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c:1.3 Mon Dec 16 11:18:55 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c Thu Jan 22 22:57:06 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c,v 1.3 2002/12/16 16:18:55 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.c,v 1.6 2004/01/23 03:57:06 dawes Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -33,18 +34,18 @@ */ #include "glheader.h" +#include "imports.h" #include "r200_context.h" #include "r200_state.h" #include "r200_ioctl.h" #include "r200_tex.h" #include "r200_tcl.h" +#include "r200_swtcl.h" #include "r200_vtxfmt.h" #include "api_noop.h" #include "api_arrayelt.h" #include "context.h" -#include "mem.h" -#include "mmath.h" #include "mtypes.h" #include "enums.h" #include "glapi.h" @@ -57,9 +58,7 @@ #include "tnl/t_context.h" #include "tnl/t_array_api.h" -struct r200_vb vb; - -static void r200FlushVertices( GLcontext *, GLuint ); +static void r200VtxFmtFlushVertices( GLcontext *, GLuint ); static void count_func( const char *name, struct dynfn *l ) { @@ -108,33 +107,32 @@ fprintf(stderr, "%s\n", __FUNCTION__); assert(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT); - assert(vb.context == ctx); if (rmesa->vb.vtxfmt_0 & R200_VTX_N0) { - ctx->Current.Normal[0] = vb.normalptr[0]; - ctx->Current.Normal[1] = vb.normalptr[1]; - ctx->Current.Normal[2] = vb.normalptr[2]; + ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0] = rmesa->vb.normalptr[0]; + ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1] = rmesa->vb.normalptr[1]; + ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2] = rmesa->vb.normalptr[2]; } switch( VTX_COLOR(rmesa->vb.vtxfmt_0, 0) ) { case R200_VTX_PK_RGBA: - ctx->Current.Color[0] = UBYTE_TO_FLOAT( vb.colorptr->red ); - ctx->Current.Color[1] = UBYTE_TO_FLOAT( vb.colorptr->green ); - ctx->Current.Color[2] = UBYTE_TO_FLOAT( vb.colorptr->blue ); - ctx->Current.Color[3] = UBYTE_TO_FLOAT( vb.colorptr->alpha ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->red ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->green ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->blue ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->alpha ); break; case R200_VTX_FP_RGB: - ctx->Current.Color[0] = vb.floatcolorptr[0]; - ctx->Current.Color[1] = vb.floatcolorptr[1]; - ctx->Current.Color[2] = vb.floatcolorptr[2]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = rmesa->vb.floatcolorptr[0]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = rmesa->vb.floatcolorptr[1]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = rmesa->vb.floatcolorptr[2]; break; case R200_VTX_FP_RGBA: - ctx->Current.Color[0] = vb.floatcolorptr[0]; - ctx->Current.Color[1] = vb.floatcolorptr[1]; - ctx->Current.Color[2] = vb.floatcolorptr[2]; - ctx->Current.Color[3] = vb.floatcolorptr[3]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = rmesa->vb.floatcolorptr[0]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = rmesa->vb.floatcolorptr[1]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = rmesa->vb.floatcolorptr[2]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = rmesa->vb.floatcolorptr[3]; break; default: @@ -142,23 +140,23 @@ } if (VTX_COLOR(rmesa->vb.vtxfmt_0, 1) == R200_VTX_PK_RGBA) { - ctx->Current.SecondaryColor[0] = UBYTE_TO_FLOAT( vb.specptr->red ); - ctx->Current.SecondaryColor[1] = UBYTE_TO_FLOAT( vb.specptr->green ); - ctx->Current.SecondaryColor[2] = UBYTE_TO_FLOAT( vb.specptr->blue ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] = UBYTE_TO_FLOAT( rmesa->vb.specptr->red ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] = UBYTE_TO_FLOAT( rmesa->vb.specptr->green ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] = UBYTE_TO_FLOAT( rmesa->vb.specptr->blue ); } if (rmesa->vb.vtxfmt_1 & (7 << R200_VTX_TEX0_COMP_CNT_SHIFT)) { - ctx->Current.Texcoord[0][0] = vb.texcoordptr[0][0]; - ctx->Current.Texcoord[0][1] = vb.texcoordptr[0][1]; - ctx->Current.Texcoord[0][2] = 0.0F; - ctx->Current.Texcoord[0][3] = 1.0F; + ctx->Current.Attrib[VERT_ATTRIB_TEX0][0] = rmesa->vb.texcoordptr[0][0]; + ctx->Current.Attrib[VERT_ATTRIB_TEX0][1] = rmesa->vb.texcoordptr[0][1]; + ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] = 0.0F; + ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] = 1.0F; } if (rmesa->vb.vtxfmt_1 & (7 << R200_VTX_TEX1_COMP_CNT_SHIFT)) { - ctx->Current.Texcoord[1][0] = vb.texcoordptr[1][0]; - ctx->Current.Texcoord[1][1] = vb.texcoordptr[1][1]; - ctx->Current.Texcoord[1][2] = 0.0F; - ctx->Current.Texcoord[1][3] = 1.0F; + ctx->Current.Attrib[VERT_ATTRIB_TEX1][0] = rmesa->vb.texcoordptr[1][0]; + ctx->Current.Attrib[VERT_ATTRIB_TEX1][1] = rmesa->vb.texcoordptr[1][1]; + ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] = 0.0F; + ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] = 1.0F; } ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT; @@ -183,12 +181,13 @@ struct r200_dma_region tmp = rmesa->dma.current; tmp.buf->refcount++; - tmp.aos_size = vb.vertex_size; - tmp.aos_stride = vb.vertex_size; + tmp.aos_size = rmesa->vb.vertex_size; + tmp.aos_stride = rmesa->vb.vertex_size; tmp.aos_start = GET_START(&tmp); rmesa->dma.current.ptr = rmesa->dma.current.start += - (vb.initial_counter - vb.counter) * vb.vertex_size * 4; + (rmesa->vb.initial_counter - rmesa->vb.counter) * + rmesa->vb.vertex_size * 4; rmesa->tcl.vertex_format = rmesa->vb.vtxfmt_0; rmesa->tcl.aos_components[0] = &tmp; @@ -231,7 +230,7 @@ rmesa->vb.primlist[i].end); if (rmesa->vb.primlist[i].start < rmesa->vb.primlist[i].end) - r200EmitPrimitive( vb.context, + r200EmitPrimitive( rmesa->glCtx, rmesa->vb.primlist[i].start, rmesa->vb.primlist[i].end, rmesa->vb.primlist[i].prim ); @@ -245,20 +244,24 @@ static void start_prim( r200ContextPtr rmesa, GLuint mode ) { if (R200_DEBUG & DEBUG_VFMT) - fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter); + fprintf(stderr, "%s %d\n", __FUNCTION__, + rmesa->vb.initial_counter - rmesa->vb.counter); - rmesa->vb.primlist[rmesa->vb.nrprims].start = vb.initial_counter - vb.counter; + rmesa->vb.primlist[rmesa->vb.nrprims].start = + rmesa->vb.initial_counter - rmesa->vb.counter; rmesa->vb.primlist[rmesa->vb.nrprims].prim = mode; } static void note_last_prim( r200ContextPtr rmesa, GLuint flags ) { if (R200_DEBUG & DEBUG_VFMT) - fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter); + fprintf(stderr, "%s %d\n", __FUNCTION__, + rmesa->vb.initial_counter - rmesa->vb.counter); if (rmesa->vb.prim[0] != GL_POLYGON+1) { rmesa->vb.primlist[rmesa->vb.nrprims].prim |= flags; - rmesa->vb.primlist[rmesa->vb.nrprims].end = vb.initial_counter - vb.counter; + rmesa->vb.primlist[rmesa->vb.nrprims].end = + rmesa->vb.initial_counter - rmesa->vb.counter; if (++(rmesa->vb.nrprims) == R200_MAX_PRIMS) flush_prims( rmesa ); @@ -272,12 +275,12 @@ GLfloat *src = (GLfloat *)(rmesa->dma.current.address + rmesa->dma.current.ptr + (rmesa->vb.primlist[rmesa->vb.nrprims].start + n) * - vb.vertex_size * 4); + rmesa->vb.vertex_size * 4); if (R200_DEBUG & DEBUG_VFMT) fprintf(stderr, "copy_vertex %d\n", rmesa->vb.primlist[rmesa->vb.nrprims].start + n); - for (i = 0 ; i < vb.vertex_size; i++) { + for (i = 0 ; i < rmesa->vb.vertex_size; i++) { dst[i] = src[i]; } } @@ -289,7 +292,8 @@ static GLuint copy_dma_verts( r200ContextPtr rmesa, GLfloat (*tmp)[15] ) { GLuint ovf, i; - GLuint nr = (vb.initial_counter - vb.counter) - rmesa->vb.primlist[rmesa->vb.nrprims].start; + GLuint nr = (rmesa->vb.initial_counter - rmesa->vb.counter) - + rmesa->vb.primlist[rmesa->vb.nrprims].start; if (R200_DEBUG & DEBUG_VFMT) fprintf(stderr, "%s %d verts\n", __FUNCTION__, nr); @@ -332,13 +336,16 @@ return 2; } case GL_TRIANGLE_STRIP: - ovf = MIN2( nr-1, 2 ); + ovf = MIN2( nr, 2 ); for (i = 0 ; i < ovf ; i++) copy_vertex( rmesa, nr-ovf+i, tmp[i] ); return i; case GL_QUAD_STRIP: - ovf = MIN2( nr-1, 2 ); - if (nr > 2) ovf += nr&1; + switch (nr) { + case 0: ovf = 0; break; + case 1: ovf = 1; break; + default: ovf = 2 + (nr&1); break; + } for (i = 0 ; i < ovf ; i++) copy_vertex( rmesa, nr-ovf+i, tmp[i] ); return i; @@ -350,30 +357,30 @@ static void VFMT_FALLBACK_OUTSIDE_BEGIN_END( const char *caller ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); r200ContextPtr rmesa = R200_CONTEXT(ctx); if (R200_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS)) fprintf(stderr, "%s from %s\n", __FUNCTION__, caller); if (ctx->Driver.NeedFlush) - r200FlushVertices( ctx, ctx->Driver.NeedFlush ); + r200VtxFmtFlushVertices( ctx, ctx->Driver.NeedFlush ); if (ctx->NewState) _mesa_update_state( ctx ); /* clear state so fell_back sticks */ _tnl_wakeup_exec( ctx ); + ctx->Driver.FlushVertices = r200FlushVertices; assert( rmesa->dma.flush == 0 ); rmesa->vb.fell_back = GL_TRUE; rmesa->vb.installed = GL_FALSE; -/* vb.context = 0; */ } static void VFMT_FALLBACK( const char *caller ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); r200ContextPtr rmesa = R200_CONTEXT(ctx); GLfloat tmp[3][15]; GLuint i, prim; @@ -404,15 +411,15 @@ prim = rmesa->vb.prim[0]; ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1; _tnl_wakeup_exec( ctx ); + ctx->Driver.FlushVertices = r200FlushVertices; assert(rmesa->dma.flush == 0); rmesa->vb.fell_back = GL_TRUE; rmesa->vb.installed = GL_FALSE; - vb.context = 0; glBegin( prim ); if (rmesa->vb.installed_color_3f_sz == 4) - alpha = ctx->Current.Color[3]; + alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]; /* Replay saved vertices */ @@ -457,50 +464,51 @@ /* Replay current vertex */ if (ind0 & R200_VTX_N0) - glNormal3fv( vb.normalptr ); + glNormal3fv( rmesa->vb.normalptr ); if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) - glColor4ub( vb.colorptr->red, vb.colorptr->green, vb.colorptr->blue, vb.colorptr->alpha ); + glColor4ub( rmesa->vb.colorptr->red, rmesa->vb.colorptr->green, rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha ); else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) - glColor4fv( vb.floatcolorptr ); + glColor4fv( rmesa->vb.floatcolorptr ); else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) { if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0) - glColor4f( vb.floatcolorptr[0], - vb.floatcolorptr[1], - vb.floatcolorptr[2], + glColor4f( rmesa->vb.floatcolorptr[0], + rmesa->vb.floatcolorptr[1], + rmesa->vb.floatcolorptr[2], alpha ); else - glColor3fv( vb.floatcolorptr ); + glColor3fv( rmesa->vb.floatcolorptr ); } if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) - _glapi_Dispatch->SecondaryColor3ubEXT( vb.specptr->red, vb.specptr->green, vb.specptr->blue ); + _glapi_Dispatch->SecondaryColor3ubEXT( rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue ); if (ind1 & (7 << R200_VTX_TEX0_COMP_CNT_SHIFT)) - glTexCoord2fv( vb.texcoordptr[0] ); + glTexCoord2fv( rmesa->vb.texcoordptr[0] ); if (ind1 & (7 << R200_VTX_TEX1_COMP_CNT_SHIFT)) - glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, vb.texcoordptr[1] ); + glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, rmesa->vb.texcoordptr[1] ); } static void wrap_buffer( void ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); r200ContextPtr rmesa = R200_CONTEXT(ctx); GLfloat tmp[3][15]; GLuint i, nrverts; if (R200_DEBUG & (DEBUG_VFMT|DEBUG_PRIMS)) - fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter); + fprintf(stderr, "%s %d\n", __FUNCTION__, + rmesa->vb.initial_counter - rmesa->vb.counter); /* Don't deal with parity. */ - if ((((vb.initial_counter - vb.counter) - + if ((((rmesa->vb.initial_counter - rmesa->vb.counter) - rmesa->vb.primlist[rmesa->vb.nrprims].start) & 1)) { - vb.counter++; - vb.initial_counter++; + rmesa->vb.counter++; + rmesa->vb.initial_counter++; return; } @@ -529,12 +537,12 @@ /* Reset counter, dmaptr */ - vb.dmaptr = (int *)(rmesa->dma.current.ptr + rmesa->dma.current.address); - vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) / - (vb.vertex_size * 4); - vb.counter--; - vb.initial_counter = vb.counter; - vb.notify = wrap_buffer; + rmesa->vb.dmaptr = (int *)(rmesa->dma.current.ptr + rmesa->dma.current.address); + rmesa->vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) / + (rmesa->vb.vertex_size * 4); + rmesa->vb.counter--; + rmesa->vb.initial_counter = rmesa->vb.counter; + rmesa->vb.notify = wrap_buffer; rmesa->dma.flush = flush_prims; @@ -549,15 +557,15 @@ for (i = 0 ; i < nrverts; i++) { if (R200_DEBUG & DEBUG_VERTS) { int j; - fprintf(stderr, "re-emit vertex %d to %p\n", i, vb.dmaptr); + fprintf(stderr, "re-emit vertex %d to %p\n", i, (void *)rmesa->vb.dmaptr); if (R200_DEBUG & DEBUG_VERBOSE) - for (j = 0 ; j < vb.vertex_size; j++) + for (j = 0 ; j < rmesa->vb.vertex_size; j++) fprintf(stderr, "\t%08x/%f\n", *(int*)&tmp[i][j], tmp[i][j]); } - memcpy( vb.dmaptr, tmp[i], vb.vertex_size * 4 ); - vb.dmaptr += vb.vertex_size; - vb.counter--; + memcpy( rmesa->vb.dmaptr, tmp[i], rmesa->vb.vertex_size * 4 ); + rmesa->vb.dmaptr += rmesa->vb.vertex_size; + rmesa->vb.counter--; } } @@ -571,7 +579,7 @@ if (rmesa->TclFallback || rmesa->vb.fell_back || ctx->CompileFlag) return GL_FALSE; - + if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) ctx->Driver.FlushVertices( ctx, FLUSH_UPDATE_CURRENT ); @@ -585,12 +593,10 @@ * checking for overflow) is cheaper than sending floats * directly. */ - if (ctx->Light.ColorMaterialEnabled) { - if (1 || ctx->Color.AlphaEnabled) - ind0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT; - else - ind0 |= R200_VTX_FP_RGB << R200_VTX_COLOR_0_SHIFT; - } + if (ctx->Light.ColorMaterialEnabled) + ind0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT; + else + ind0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT; } else { /* TODO: make this data driven? @@ -608,8 +614,8 @@ ind0 |= R200_VTX_N0; } } else { - if (ctx->Current.Texcoord[0][2] != 0.0F || - ctx->Current.Texcoord[0][3] != 1.0) { + if (ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] != 0.0F || + ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] != 1.0) { if (R200_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS)) fprintf(stderr, "%s: rq0\n", __FUNCTION__); return GL_FALSE; @@ -624,8 +630,8 @@ ind0 |= R200_VTX_N0; } } else { - if (ctx->Current.Texcoord[1][2] != 0.0F || - ctx->Current.Texcoord[1][3] != 1.0) { + if (ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] != 0.0F || + ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] != 1.0) { if (R200_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS)) fprintf(stderr, "%s: rq1\n", __FUNCTION__); return GL_FALSE; @@ -642,71 +648,71 @@ rmesa->vb.vtxfmt_1 = ind1; rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive; - vb.vertex_size = 3; - vb.normalptr = ctx->Current.Normal; - vb.colorptr = NULL; - vb.floatcolorptr = ctx->Current.Color; - vb.specptr = NULL; - vb.floatspecptr = ctx->Current.SecondaryColor; - vb.texcoordptr[0] = ctx->Current.Texcoord[0]; - vb.texcoordptr[1] = ctx->Current.Texcoord[1]; + rmesa->vb.vertex_size = 3; + rmesa->vb.normalptr = ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; + rmesa->vb.colorptr = NULL; + rmesa->vb.floatcolorptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; + rmesa->vb.specptr = NULL; + rmesa->vb.floatspecptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; + rmesa->vb.texcoordptr[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; + rmesa->vb.texcoordptr[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1]; /* Run through and initialize the vertex components in the order * the hardware understands: */ if (ind0 & R200_VTX_N0) { - vb.normalptr = &vb.vertex[vb.vertex_size].f; - vb.vertex_size += 3; - vb.normalptr[0] = ctx->Current.Normal[0]; - vb.normalptr[1] = ctx->Current.Normal[1]; - vb.normalptr[2] = ctx->Current.Normal[2]; + rmesa->vb.normalptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f; + rmesa->vb.vertex_size += 3; + rmesa->vb.normalptr[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]; + rmesa->vb.normalptr[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]; + rmesa->vb.normalptr[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]; } if (VTX_COLOR(ind0, 0) == R200_VTX_PK_RGBA) { - vb.colorptr = &vb.vertex[vb.vertex_size].color; - vb.vertex_size += 1; - UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->red, ctx->Current.Color[0] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->green, ctx->Current.Color[1] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->blue, ctx->Current.Color[2] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->alpha, ctx->Current.Color[3] ); + rmesa->vb.colorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].color; + rmesa->vb.vertex_size += 1; + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->alpha, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] ); } else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGBA) { - vb.floatcolorptr = &vb.vertex[vb.vertex_size].f; - vb.vertex_size += 4; - vb.floatcolorptr[0] = ctx->Current.Color[0]; - vb.floatcolorptr[1] = ctx->Current.Color[1]; - vb.floatcolorptr[2] = ctx->Current.Color[2]; - vb.floatcolorptr[3] = ctx->Current.Color[3]; + rmesa->vb.floatcolorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f; + rmesa->vb.vertex_size += 4; + rmesa->vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]; + rmesa->vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]; + rmesa->vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]; + rmesa->vb.floatcolorptr[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]; } else if (VTX_COLOR(ind0, 0) == R200_VTX_FP_RGB) { - vb.floatcolorptr = &vb.vertex[vb.vertex_size].f; - vb.vertex_size += 3; - vb.floatcolorptr[0] = ctx->Current.Color[0]; - vb.floatcolorptr[1] = ctx->Current.Color[1]; - vb.floatcolorptr[2] = ctx->Current.Color[2]; + rmesa->vb.floatcolorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f; + rmesa->vb.vertex_size += 3; + rmesa->vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]; + rmesa->vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]; + rmesa->vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]; } if (VTX_COLOR(ind0, 1) == R200_VTX_PK_RGBA) { - vb.specptr = &vb.vertex[vb.vertex_size].color; - vb.vertex_size += 1; - UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->red, ctx->Current.SecondaryColor[0] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->green, ctx->Current.SecondaryColor[1] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->blue, ctx->Current.SecondaryColor[2] ); + rmesa->vb.specptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].color; + rmesa->vb.vertex_size += 1; + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] ); } if (ind1 & (7 << R200_VTX_TEX0_COMP_CNT_SHIFT)) { - vb.texcoordptr[0] = &vb.vertex[vb.vertex_size].f; - vb.vertex_size += 2; - vb.texcoordptr[0][0] = ctx->Current.Texcoord[0][0]; - vb.texcoordptr[0][1] = ctx->Current.Texcoord[0][1]; + rmesa->vb.texcoordptr[0] = &rmesa->vb.vertex[rmesa->vb.vertex_size].f; + rmesa->vb.vertex_size += 2; + rmesa->vb.texcoordptr[0][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][0]; + rmesa->vb.texcoordptr[0][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][1]; } if (ind1 & (7 << R200_VTX_TEX1_COMP_CNT_SHIFT)) { - vb.texcoordptr[1] = &vb.vertex[vb.vertex_size].f; - vb.vertex_size += 2; - vb.texcoordptr[1][0] = ctx->Current.Texcoord[1][0]; - vb.texcoordptr[1][1] = ctx->Current.Texcoord[1][1]; + rmesa->vb.texcoordptr[1] = &rmesa->vb.vertex[rmesa->vb.vertex_size].f; + rmesa->vb.vertex_size += 2; + rmesa->vb.texcoordptr[1][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][0]; + rmesa->vb.texcoordptr[1][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][1]; } if (rmesa->vb.installed_vertex_format != rmesa->vb.vtxfmt_0) { @@ -756,10 +762,9 @@ fprintf(stderr, "reinstall (new install)\n"); _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); - ctx->Driver.FlushVertices = r200FlushVertices; + ctx->Driver.FlushVertices = r200VtxFmtFlushVertices; ctx->Driver.NewList = r200NewList; rmesa->vb.installed = GL_TRUE; - vb.context = ctx; } else if (R200_DEBUG & DEBUG_VFMT) fprintf(stderr, "%s: already installed", __FUNCTION__); @@ -772,8 +777,8 @@ if (rmesa->dma.flush) rmesa->dma.flush( rmesa ); _tnl_wakeup_exec( ctx ); + ctx->Driver.FlushVertices = r200FlushVertices; rmesa->vb.installed = GL_FALSE; - vb.context = 0; } } } @@ -785,7 +790,7 @@ static void r200_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); r200ContextPtr rmesa = R200_CONTEXT( ctx ); if (R200_DEBUG & DEBUG_VFMT) @@ -797,7 +802,7 @@ return; } _mesa_noop_Materialfv( face, pname, params ); - r200UpdateMaterial( vb.context ); + r200UpdateMaterial( ctx ); } @@ -805,7 +810,7 @@ */ static void r200_Begin( GLenum mode ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); r200ContextPtr rmesa = R200_CONTEXT(ctx); if (R200_DEBUG & DEBUG_VFMT) @@ -837,7 +842,7 @@ } - if (rmesa->dma.flush && vb.counter < 12) { + if (rmesa->dma.flush && rmesa->vb.counter < 12) { if (R200_DEBUG & DEBUG_VFMT) fprintf(stderr, "%s: flush almost-empty buffers\n", __FUNCTION__); flush_prims( rmesa ); @@ -846,20 +851,20 @@ /* Need to arrange to save vertices here? Or always copy from dma (yuk)? */ if (!rmesa->dma.flush) { - if (rmesa->dma.current.ptr + 12*vb.vertex_size*4 > + if (rmesa->dma.current.ptr + 12*rmesa->vb.vertex_size*4 > rmesa->dma.current.end) { R200_NEWPRIM( rmesa ); r200RefillCurrentDmaRegion( rmesa ); } - vb.dmaptr = (int *)(rmesa->dma.current.address + rmesa->dma.current.ptr); - vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) / - (vb.vertex_size * 4); - vb.counter--; - vb.initial_counter = vb.counter; - vb.notify = wrap_buffer; + rmesa->vb.dmaptr = (int *)(rmesa->dma.current.address + rmesa->dma.current.ptr); + rmesa->vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) / + (rmesa->vb.vertex_size * 4); + rmesa->vb.counter--; + rmesa->vb.initial_counter = rmesa->vb.counter; + rmesa->vb.notify = wrap_buffer; rmesa->dma.flush = flush_prims; - vb.context->Driver.NeedFlush |= FLUSH_STORED_VERTICES; + ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; } @@ -871,7 +876,7 @@ static void r200_End( void ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); r200ContextPtr rmesa = R200_CONTEXT(ctx); if (R200_DEBUG & DEBUG_VFMT) @@ -931,7 +936,7 @@ return GL_TRUE; } -static void r200FlushVertices( GLcontext *ctx, GLuint flags ) +static void r200VtxFmtFlushVertices( GLcontext *ctx, GLuint flags ) { r200ContextPtr rmesa = R200_CONTEXT( ctx ); @@ -939,7 +944,6 @@ fprintf(stderr, "%s\n", __FUNCTION__); assert(rmesa->vb.installed); - assert(vb.context == ctx); if (flags & FLUSH_UPDATE_CURRENT) { r200_copy_to_current( ctx ); @@ -950,11 +954,10 @@ } if (flags & FLUSH_STORED_VERTICES) { - r200ContextPtr rmesa = R200_CONTEXT( ctx ); assert (rmesa->dma.flush == 0 || rmesa->dma.flush == flush_prims); if (rmesa->dma.flush == flush_prims) - flush_prims( R200_CONTEXT( ctx ) ); + flush_prims( rmesa ); ctx->Driver.NeedFlush &= ~FLUSH_STORED_VERTICES; } } @@ -1032,7 +1035,6 @@ TNL_CONTEXT(ctx)->Driver.NotifyBegin = r200NotifyBegin; - vb.context = ctx; rmesa->vb.enabled = 1; rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive; rmesa->vb.primflags = 0; @@ -1079,42 +1081,11 @@ void r200VtxfmtUnbindContext( GLcontext *ctx ) { - if (R200_CONTEXT(ctx)->vb.installed) { - assert(vb.context == ctx); - VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ ); - } - - TNL_CONTEXT(ctx)->Driver.NotifyBegin = 0; } void r200VtxfmtMakeCurrent( GLcontext *ctx ) { - r200ContextPtr rmesa = R200_CONTEXT( ctx ); - -#if defined(THREADS) - static GLboolean ThreadSafe = GL_FALSE; /* In thread-safe mode? */ - if (!ThreadSafe) { - static unsigned long knownID; - static GLboolean firstCall = GL_TRUE; - if (firstCall) { - knownID = _glthread_GetID(); - firstCall = GL_FALSE; - } - else if (knownID != _glthread_GetID()) { - ThreadSafe = GL_TRUE; - - if (R200_DEBUG & (DEBUG_DRI|DEBUG_VFMT)) - fprintf(stderr, "**** Multithread situation!\n"); - } - } - if (ThreadSafe) - return; -#endif - - if (rmesa->vb.enabled) { - TNL_CONTEXT(ctx)->Driver.NotifyBegin = r200NotifyBegin; - } } Index: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h diff -u xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h:1.1 xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h:1.1 Wed Oct 30 07:51:53 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h Sun Sep 28 16:15:26 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h,v 1.1 2002/10/30 12:51:53 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt.h,v 1.2 2003/09/28 20:15:26 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,7 +25,8 @@ 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. -*/ + +**************************************************************************/ /* * Authors: @@ -41,9 +42,6 @@ -extern struct r200_vb vb; - - extern void r200VtxfmtUpdate( GLcontext *ctx ); extern void r200VtxfmtInit( GLcontext *ctx ); extern void r200VtxfmtInvalidate( GLcontext *ctx ); @@ -80,8 +78,8 @@ #define FIXUP2( CODE, OFFSET, CHECKVAL, NEWVAL ) \ do { \ while (*(int *)(CODE+OFFSET) != CHECKVAL) OFFSET++; \ - fprintf(stderr, "%s/%d CVAL %x OFFSET %d VAL %x\n", __FUNCTION__, \ - __LINE__, CHECKVAL, OFFSET, (int)(NEWVAL)); \ + /*fprintf(stderr, "%s/%d CVAL %x OFFSET %d VAL %x\n", __FUNCTION__,*/ \ + /* __LINE__, CHECKVAL, OFFSET, (int)(NEWVAL));*/ \ *(int *)(CODE+OFFSET) = (int)(NEWVAL); \ OFFSET += 4; \ } while (0) Index: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c:1.2 xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c:1.3 --- xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c:1.2 Mon Dec 16 11:18:56 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c Sun Sep 28 16:15:26 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c,v 1.2 2002/12/16 16:18:56 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_c.c,v 1.3 2003/09/28 20:15:26 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,13 +25,16 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ +#include "glheader.h" +#include "imports.h" #include "mtypes.h" #include "colormac.h" #include "simple_list.h" @@ -46,65 +49,73 @@ */ static void r200_Vertex3f( GLfloat x, GLfloat y, GLfloat z ) { + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); int i; - *vb.dmaptr++ = *(int *)&x; - *vb.dmaptr++ = *(int *)&y; - *vb.dmaptr++ = *(int *)&z; + *rmesa->vb.dmaptr++ = *(int *)&x; + *rmesa->vb.dmaptr++ = *(int *)&y; + *rmesa->vb.dmaptr++ = *(int *)&z; - for (i = 3; i < vb.vertex_size; i++) - *vb.dmaptr++ = vb.vertex[i].i; + for (i = 3; i < rmesa->vb.vertex_size; i++) + *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i; - if (--vb.counter == 0) - vb.notify(); + if (--rmesa->vb.counter == 0) + rmesa->vb.notify(); } static void r200_Vertex3fv( const GLfloat *v ) { + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); int i; - *vb.dmaptr++ = *(int *)&v[0]; - *vb.dmaptr++ = *(int *)&v[1]; - *vb.dmaptr++ = *(int *)&v[2]; + *rmesa->vb.dmaptr++ = *(int *)&v[0]; + *rmesa->vb.dmaptr++ = *(int *)&v[1]; + *rmesa->vb.dmaptr++ = *(int *)&v[2]; - for (i = 3; i < vb.vertex_size; i++) - *vb.dmaptr++ = vb.vertex[i].i; + for (i = 3; i < rmesa->vb.vertex_size; i++) + *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i; - if (--vb.counter == 0) - vb.notify(); + if (--rmesa->vb.counter == 0) + rmesa->vb.notify(); } static void r200_Vertex2f( GLfloat x, GLfloat y ) { + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); int i; - *vb.dmaptr++ = *(int *)&x; - *vb.dmaptr++ = *(int *)&y; - *vb.dmaptr++ = 0; + *rmesa->vb.dmaptr++ = *(int *)&x; + *rmesa->vb.dmaptr++ = *(int *)&y; + *rmesa->vb.dmaptr++ = 0; - for (i = 3; i < vb.vertex_size; i++) - *vb.dmaptr++ = vb.vertex[i].i; + for (i = 3; i < rmesa->vb.vertex_size; i++) + *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i; - if (--vb.counter == 0) - vb.notify(); + if (--rmesa->vb.counter == 0) + rmesa->vb.notify(); } static void r200_Vertex2fv( const GLfloat *v ) { + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); int i; - *vb.dmaptr++ = *(int *)&v[0]; - *vb.dmaptr++ = *(int *)&v[1]; - *vb.dmaptr++ = 0; + *rmesa->vb.dmaptr++ = *(int *)&v[0]; + *rmesa->vb.dmaptr++ = *(int *)&v[1]; + *rmesa->vb.dmaptr++ = 0; - for (i = 3; i < vb.vertex_size; i++) - *vb.dmaptr++ = vb.vertex[i].i; + for (i = 3; i < rmesa->vb.vertex_size; i++) + *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i; - if (--vb.counter == 0) - vb.notify(); + if (--rmesa->vb.counter == 0) + rmesa->vb.notify(); } @@ -113,7 +124,9 @@ */ static void r200_Color3ub_ub( GLubyte r, GLubyte g, GLubyte b ) { - r200_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.colorptr; dest->red = r; dest->green = g; dest->blue = b; @@ -122,7 +135,9 @@ static void r200_Color3ubv_ub( const GLubyte *v ) { - r200_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.colorptr; dest->red = v[0]; dest->green = v[1]; dest->blue = v[2]; @@ -131,7 +146,9 @@ static void r200_Color4ub_ub( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { - r200_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.colorptr; dest->red = r; dest->green = g; dest->blue = b; @@ -140,13 +157,17 @@ static void r200_Color4ubv_ub( const GLubyte *v ) { - *(GLuint *)vb.colorptr = LE32_TO_CPU(*(GLuint *)v); + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + *(GLuint *)rmesa->vb.colorptr = LE32_TO_CPU(*(GLuint *)v); } static void r200_Color3f_ub( GLfloat r, GLfloat g, GLfloat b ) { - r200_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.colorptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b ); @@ -155,7 +176,9 @@ static void r200_Color3fv_ub( const GLfloat *v ) { - r200_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.colorptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] ); @@ -164,7 +187,9 @@ static void r200_Color4f_ub( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) { - r200_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.colorptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b ); @@ -173,7 +198,9 @@ static void r200_Color4fv_ub( const GLfloat *v ) { - r200_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.colorptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] ); @@ -185,7 +212,9 @@ */ static void r200_Color3ub_4f( GLubyte r, GLubyte g, GLubyte b ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); @@ -194,7 +223,9 @@ static void r200_Color3ubv_4f( const GLubyte *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); @@ -203,7 +234,9 @@ static void r200_Color4ub_4f( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); @@ -212,7 +245,9 @@ static void r200_Color4ubv_4f( const GLubyte *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); @@ -222,7 +257,9 @@ static void r200_Color3f_4f( GLfloat r, GLfloat g, GLfloat b ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = r; dest[1] = g; dest[2] = b; @@ -231,7 +268,9 @@ static void r200_Color3fv_4f( const GLfloat *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -240,7 +279,9 @@ static void r200_Color4f_4f( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = r; dest[1] = g; dest[2] = b; @@ -249,7 +290,9 @@ static void r200_Color4fv_4f( const GLfloat *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -261,7 +304,9 @@ */ static void r200_Color3ub_3f( GLubyte r, GLubyte g, GLubyte b ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); @@ -269,7 +314,9 @@ static void r200_Color3ubv_3f( const GLubyte *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); @@ -277,26 +324,32 @@ static void r200_Color4ub_3f( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); - vb.context->Current.Color[3] = UBYTE_TO_FLOAT(a); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(a); } static void r200_Color4ubv_3f( const GLubyte *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); - vb.context->Current.Color[3] = UBYTE_TO_FLOAT(v[3]); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(v[3]); } static void r200_Color3f_3f( GLfloat r, GLfloat g, GLfloat b ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = r; dest[1] = g; dest[2] = b; @@ -304,7 +357,9 @@ static void r200_Color3fv_3f( const GLfloat *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -312,20 +367,24 @@ static void r200_Color4f_3f( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = r; dest[1] = g; dest[2] = b; - vb.context->Current.Color[3] = a; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = a; } static void r200_Color4fv_3f( const GLfloat *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; - vb.context->Current.Color[3] = v[3]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = v[3]; } @@ -333,7 +392,9 @@ */ static void r200_SecondaryColor3ubEXT_ub( GLubyte r, GLubyte g, GLubyte b ) { - r200_color_t *dest = vb.specptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.specptr; dest->red = r; dest->green = g; dest->blue = b; @@ -342,7 +403,9 @@ static void r200_SecondaryColor3ubvEXT_ub( const GLubyte *v ) { - r200_color_t *dest = vb.specptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.specptr; dest->red = v[0]; dest->green = v[1]; dest->blue = v[2]; @@ -351,7 +414,9 @@ static void r200_SecondaryColor3fEXT_ub( GLfloat r, GLfloat g, GLfloat b ) { - r200_color_t *dest = vb.specptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.specptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b ); @@ -360,7 +425,9 @@ static void r200_SecondaryColor3fvEXT_ub( const GLfloat *v ) { - r200_color_t *dest = vb.specptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + r200_color_t *dest = rmesa->vb.specptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] ); @@ -369,7 +436,9 @@ static void r200_SecondaryColor3ubEXT_3f( GLubyte r, GLubyte g, GLubyte b ) { - GLfloat *dest = vb.floatspecptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatspecptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); @@ -378,7 +447,9 @@ static void r200_SecondaryColor3ubvEXT_3f( const GLubyte *v ) { - GLfloat *dest = vb.floatspecptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatspecptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); @@ -387,7 +458,9 @@ static void r200_SecondaryColor3fEXT_3f( GLfloat r, GLfloat g, GLfloat b ) { - GLfloat *dest = vb.floatspecptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatspecptr; dest[0] = r; dest[1] = g; dest[2] = b; @@ -396,7 +469,9 @@ static void r200_SecondaryColor3fvEXT_3f( const GLfloat *v ) { - GLfloat *dest = vb.floatspecptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatspecptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -409,7 +484,9 @@ */ static void r200_Normal3f( GLfloat n0, GLfloat n1, GLfloat n2 ) { - GLfloat *dest = vb.normalptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.normalptr; dest[0] = n0; dest[1] = n1; dest[2] = n2; @@ -417,7 +494,9 @@ static void r200_Normal3fv( const GLfloat *v ) { - GLfloat *dest = vb.normalptr; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.normalptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -428,59 +507,83 @@ */ static void r200_TexCoord1f( GLfloat s ) { - GLfloat *dest = vb.texcoordptr[0]; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[0]; dest[0] = s; dest[1] = 0; } static void r200_TexCoord1fv( const GLfloat *v ) { - GLfloat *dest = vb.texcoordptr[0]; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[0]; dest[0] = v[0]; dest[1] = 0; } static void r200_TexCoord2f( GLfloat s, GLfloat t ) { - GLfloat *dest = vb.texcoordptr[0]; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[0]; dest[0] = s; dest[1] = t; } static void r200_TexCoord2fv( const GLfloat *v ) { - GLfloat *dest = vb.texcoordptr[0]; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[0]; dest[0] = v[0]; dest[1] = v[1]; } /* MultiTexcoord + * + * Technically speaking, these functions should subtract GL_TEXTURE0 from + * \c target before masking and using it. The value of GL_TEXTURE0 is 0x84C0, + * which has the low-order 5 bits 0. For all possible valid values of + * \c target. Subtracting GL_TEXTURE0 has the net effect of masking \c target + * with 0x1F. Masking with 0x1F and then masking with 0x01 is redundant, so + * the subtraction has been omitted. */ + static void r200_MultiTexCoord1fARB( GLenum target, GLfloat s ) { - GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1]; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[target & 1]; dest[0] = s; dest[1] = 0; } static void r200_MultiTexCoord1fvARB( GLenum target, const GLfloat *v ) { - GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1]; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[target & 1]; dest[0] = v[0]; dest[1] = 0; } static void r200_MultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t ) { - GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1]; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[target & 1]; dest[0] = s; dest[1] = t; } static void r200_MultiTexCoord2fvARB( GLenum target, const GLfloat *v ) { - GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1]; + GET_CURRENT_CONTEXT(ctx); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[target & 1]; dest[0] = v[0]; dest[1] = v[1]; } @@ -503,29 +606,30 @@ #define CHOOSE(FN, FNTYPE, MASK0, MASK1, ARGS1, ARGS2 ) \ static void choose_##FN ARGS1 \ { \ - r200ContextPtr rmesa = R200_CONTEXT(vb.context); \ + GET_CURRENT_CONTEXT(ctx); \ + r200ContextPtr rmesa = R200_CONTEXT(ctx); \ int key[2]; \ struct dynfn *dfn; \ \ - key[0] = rmesa->vb.vtxfmt_0 & MASK0; \ - key[1] = rmesa->vb.vtxfmt_1 & MASK1; \ + key[0] = rmesa->vb.vtxfmt_0 & MASK0; \ + key[1] = rmesa->vb.vtxfmt_1 & MASK1; \ \ dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \ if (dfn == 0) \ - dfn = rmesa->vb.codegen.FN( vb.context, key ); \ + dfn = rmesa->vb.codegen.FN( ctx, key ); \ else if (R200_DEBUG & DEBUG_CODEGEN) \ fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \ \ if (dfn) \ - vb.context->Exec->FN = (FNTYPE)(dfn->code); \ + ctx->Exec->FN = (FNTYPE)(dfn->code); \ else { \ if (R200_DEBUG & DEBUG_CODEGEN) \ fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \ - vb.context->Exec->FN = r200_##FN; \ + ctx->Exec->FN = r200_##FN; \ } \ \ - vb.context->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ - vb.context->Exec->FN ARGS2; \ + ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ + ctx->Exec->FN ARGS2; \ } @@ -540,22 +644,22 @@ #define CHOOSE_COLOR(FN, FNTYPE, NR, MASK0, MASK1, ARGS1, ARGS2 ) \ static void choose_##FN ARGS1 \ { \ - GLcontext *ctx = vb.context; \ - r200ContextPtr rmesa = R200_CONTEXT(vb.context); \ + GET_CURRENT_CONTEXT(ctx); \ + r200ContextPtr rmesa = R200_CONTEXT(ctx); \ int key[2]; \ struct dynfn *dfn; \ \ - key[0] = rmesa->vb.vtxfmt_0 & MASK0; \ - key[1] = rmesa->vb.vtxfmt_1 & MASK1; \ + key[0] = rmesa->vb.vtxfmt_0 & MASK0; \ + key[1] = rmesa->vb.vtxfmt_1 & MASK1; \ \ - if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_PK_RGBA) { \ + if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_PK_RGBA) { \ ctx->Exec->FN = r200_##FN##_ub; \ } \ else if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_FP_RGB) { \ \ if (rmesa->vb.installed_color_3f_sz != NR) { \ rmesa->vb.installed_color_3f_sz = NR; \ - if (NR == 3) ctx->Current.Color[3] = 1.0; \ + if (NR == 3) ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = 1.0; \ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \ r200_copy_to_current( ctx ); \ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \ @@ -597,7 +701,8 @@ #define CHOOSE_SECONDARY_COLOR(FN, FNTYPE, MASK0, MASK1, ARGS1, ARGS2 ) \ static void choose_##FN ARGS1 \ { \ - r200ContextPtr rmesa = R200_CONTEXT(vb.context); \ + GET_CURRENT_CONTEXT(ctx); \ + r200ContextPtr rmesa = R200_CONTEXT(ctx); \ int key[2]; \ struct dynfn *dfn; \ \ @@ -606,21 +711,21 @@ \ dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \ if (dfn == 0) \ - dfn = rmesa->vb.codegen.FN( vb.context, key ); \ + dfn = rmesa->vb.codegen.FN( ctx, key ); \ else if (R200_DEBUG & DEBUG_CODEGEN) \ fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \ \ if (dfn) \ - vb.context->Exec->FN = (FNTYPE)(dfn->code); \ + ctx->Exec->FN = (FNTYPE)(dfn->code); \ else { \ if (R200_DEBUG & DEBUG_CODEGEN) \ fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \ - vb.context->Exec->FN = (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \ + ctx->Exec->FN = (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \ ? r200_##FN##_ub : r200_##FN##_3f; \ } \ \ - vb.context->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ - vb.context->Exec->FN ARGS2; \ + ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ + ctx->Exec->FN ARGS2; \ } Index: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c:1.1 xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c:1.2 --- xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c:1.1 Wed Oct 30 07:51:53 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c Sun Sep 28 16:15:26 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c,v 1.1 2002/10/30 12:51:53 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_sse.c,v 1.2 2003/09/28 20:15:26 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,63 +25,201 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ -#include -#include -#include "mem.h" +#include "glheader.h" +#include "imports.h" #include "simple_list.h" #include "r200_vtxfmt.h" #if defined(USE_SSE_ASM) +#include "X86/common_x86_asm.h" + +#define EXTERN( FUNC ) \ +extern const char *FUNC; \ +extern const char *FUNC##_end + +EXTERN( _sse_Attribute2fv ); +EXTERN( _sse_Attribute2f ); +EXTERN( _sse_Attribute3fv ); +EXTERN( _sse_Attribute3f ); +EXTERN( _sse_MultiTexCoord2fv ); +EXTERN( _sse_MultiTexCoord2f ); +EXTERN( _sse_MultiTexCoord2fv_2 ); +EXTERN( _sse_MultiTexCoord2f_2 ); /* Build specialized versions of the immediate calls on the fly for - * the current state. ???P4 SSE2 versions??? + * the current state. */ +static struct dynfn *r200_makeSSEAttribute2fv( struct dynfn * cache, const int * key, + const char * name, void * dest) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (R200_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key[0] ); + + DFN ( _sse_Attribute2fv, (*cache) ); + FIXUP(dfn->code, 10, 0x0, (int)dest); + return dfn; +} + +static struct dynfn *r200_makeSSEAttribute2f( struct dynfn * cache, const int * key, + const char * name, void * dest ) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (R200_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key[0] ); + + DFN ( _sse_Attribute2f, (*cache) ); + FIXUP(dfn->code, 8, 0x0, (int)dest); + return dfn; +} + +static struct dynfn *r200_makeSSEAttribute3fv( struct dynfn * cache, const int * key, + const char * name, void * dest) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (R200_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key[0] ); + + DFN ( _sse_Attribute3fv, (*cache) ); + FIXUP(dfn->code, 13, 0x0, (int)dest); + FIXUP(dfn->code, 18, 0x8, 8+(int)dest); + return dfn; +} + +static struct dynfn *r200_makeSSEAttribute3f( struct dynfn * cache, const int * key, + const char * name, void * dest ) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (R200_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key[0] ); + + DFN ( _sse_Attribute3f, (*cache) ); + FIXUP(dfn->code, 12, 0x0, (int)dest); + FIXUP(dfn->code, 17, 0x8, 8+(int)dest); + return dfn; +} + +static struct dynfn *r200_makeSSENormal3fv( GLcontext *ctx, const int *key ) +{ + r200ContextPtr rmesa = R200_CONTEXT(ctx); + + return r200_makeSSEAttribute3fv( & rmesa->vb.dfn_cache.Normal3fv, key, + __FUNCTION__, rmesa->vb.normalptr ); +} + +static struct dynfn *r200_makeSSENormal3f( GLcontext *ctx, const int * key ) +{ + r200ContextPtr rmesa = R200_CONTEXT(ctx); + + return r200_makeSSEAttribute3f( & rmesa->vb.dfn_cache.Normal3f, key, + __FUNCTION__, rmesa->vb.normalptr ); +} + +static struct dynfn *r200_makeSSEColor3fv( GLcontext *ctx, const int * key ) +{ + if (VTX_COLOR(key[0],0) != R200_VTX_FP_RGB) + return 0; + else + { + r200ContextPtr rmesa = R200_CONTEXT(ctx); + + return r200_makeSSEAttribute3fv( & rmesa->vb.dfn_cache.Color3fv, key, + __FUNCTION__, rmesa->vb.floatcolorptr ); + } +} + +static struct dynfn *r200_makeSSEColor3f( GLcontext *ctx, const int * key ) +{ + if (VTX_COLOR(key[0],0) != R200_VTX_FP_RGB) + return 0; + else + { + r200ContextPtr rmesa = R200_CONTEXT(ctx); + + return r200_makeSSEAttribute3f( & rmesa->vb.dfn_cache.Color3f, key, + __FUNCTION__, rmesa->vb.floatcolorptr ); + } +} + +static struct dynfn *r200_makeSSETexCoord2fv( GLcontext *ctx, const int * key ) +{ + r200ContextPtr rmesa = R200_CONTEXT(ctx); + + return r200_makeSSEAttribute2fv( & rmesa->vb.dfn_cache.TexCoord2fv, key, + __FUNCTION__, rmesa->vb.texcoordptr[0] ); +} + +static struct dynfn *r200_makeSSETexCoord2f( GLcontext *ctx, const int * key ) +{ + r200ContextPtr rmesa = R200_CONTEXT(ctx); -static struct dynfn *makeSSENormal3fv( GLcontext *ctx, const int *key ) + return r200_makeSSEAttribute2f( & rmesa->vb.dfn_cache.TexCoord2f, key, + __FUNCTION__, rmesa->vb.texcoordptr[0] ); +} + +static struct dynfn *r200_makeSSEMultiTexCoord2fv( GLcontext *ctx, const int * key ) { - /* Requires P4 (sse2?) - */ - static unsigned char temp[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $0x12345678,%edx */ - 0xf3, 0x0f, 0x7e, 0x00, /* movq (%eax),%xmm0 */ - 0x66, 0x0f, 0x6e, 0x48, 0x08, /* movd 0x8(%eax),%xmm1 */ - 0x66, 0x0f, 0xd6, 0x42, 0x0c, /* movq %xmm0,0xc(%edx) */ - 0x66, 0x0f, 0x7e, 0x4a, 0x14, /* movd %xmm1,0x14(%edx) */ - 0xc3, /* ret */ - }; + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + r200ContextPtr rmesa = R200_CONTEXT(ctx); + + if (R200_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] ); + if (rmesa->vb.texcoordptr[1] == rmesa->vb.texcoordptr[0]+4) { + DFN ( _sse_MultiTexCoord2fv, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); + FIXUP(dfn->code, 18, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]); + } else { + DFN ( _sse_MultiTexCoord2fv_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); + FIXUP(dfn->code, 14, 0x0, (int)rmesa->vb.texcoordptr); + } + return dfn; +} +static struct dynfn *r200_makeSSEMultiTexCoord2f( GLcontext *ctx, const int * key ) +{ struct dynfn *dfn = MALLOC_STRUCT( dynfn ); r200ContextPtr rmesa = R200_CONTEXT(ctx); - insert_at_head( &rmesa->vb.dfn_cache.Normal3fv, dfn ); - dfn->key[0] = key[0]; - dfn->key[1] = key[1]; - - dfn->code = ALIGN_MALLOC( sizeof(temp), 16 ); - memcpy (dfn->code, temp, sizeof(temp)); - FIXUP(dfn->code, 5, 0x0, (int)vb.normalptr); + + if (R200_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] ); + + if (rmesa->vb.texcoordptr[1] == rmesa->vb.texcoordptr[0]+4) { + DFN ( _sse_MultiTexCoord2f, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); + FIXUP(dfn->code, 16, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]); + } else { + DFN ( _sse_MultiTexCoord2f_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); + FIXUP(dfn->code, 15, 0x0, (int)rmesa->vb.texcoordptr); + } return dfn; } void r200InitSSECodegen( struct dfn_generators *gen ) { - /* Need to: - * - check kernel sse support - * - check p4/sse2 - */ - (void) makeSSENormal3fv; + if ( cpu_has_xmm ) { + gen->Normal3fv = (void *) r200_makeSSENormal3fv; + gen->Normal3f = (void *) r200_makeSSENormal3f; + gen->Color3fv = (void *) r200_makeSSEColor3fv; + gen->Color3f = (void *) r200_makeSSEColor3f; + gen->TexCoord2fv = (void *) r200_makeSSETexCoord2fv; + gen->TexCoord2f = (void *) r200_makeSSETexCoord2f; + gen->MultiTexCoord2fvARB = (void *) r200_makeSSEMultiTexCoord2fv; + gen->MultiTexCoord2fARB = (void *) r200_makeSSEMultiTexCoord2f; + } } - #else void r200InitSSECodegen( struct dfn_generators *gen ) @@ -90,7 +228,3 @@ } #endif - - - - Index: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c diff -u xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c:1.2 xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c:1.3 --- xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c:1.2 Mon Dec 16 11:18:56 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c Sun Sep 28 16:15:26 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c,v 1.2 2002/12/16 16:18:56 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxfmt_x86.c,v 1.3 2003/09/28 20:15:26 alanh Exp $ */ /* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. @@ -25,17 +25,16 @@ 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. -*/ + +**************************************************************************/ /* * Authors: * Keith Whitwell */ -#include -#include -#include "mem.h" -#include "mmath.h" +#include "glheader.h" +#include "imports.h" #include "simple_list.h" #include "r200_vtxfmt.h" @@ -45,8 +44,10 @@ extern const char *FUNC; \ extern const char *FUNC##_end -EXTERN ( _x86_Normal3fv ); -EXTERN ( _x86_Normal3f ); +EXTERN ( _x86_Attribute2fv ); +EXTERN ( _x86_Attribute2f ); +EXTERN ( _x86_Attribute3fv ); +EXTERN ( _x86_Attribute3f ); EXTERN ( _x86_Vertex3fv_6 ); EXTERN ( _x86_Vertex3fv_8 ); EXTERN ( _x86_Vertex3fv ); @@ -56,14 +57,10 @@ EXTERN ( _x86_Color4ubv_ub ); EXTERN ( _x86_Color4ubv_4f ); EXTERN ( _x86_Color4ub_ub ); -EXTERN ( _x86_Color3fv_3f ); -EXTERN ( _x86_Color3f_3f ); -EXTERN ( _x86_TexCoord2fv ); -EXTERN ( _x86_TexCoord2f ); -EXTERN ( _x86_MultiTexCoord2fvARB ); -EXTERN ( _x86_MultiTexCoord2fvARB_2 ); -EXTERN ( _x86_MultiTexCoord2fARB ); -EXTERN ( _x86_MultiTexCoord2fARB_2 ); +EXTERN ( _x86_MultiTexCoord2fv ); +EXTERN ( _x86_MultiTexCoord2fv_2 ); +EXTERN ( _x86_MultiTexCoord2f ); +EXTERN ( _x86_MultiTexCoord2f_2 ); /* Build specialized versions of the immediate calls on the fly for @@ -77,43 +74,43 @@ if (R200_DEBUG & DEBUG_CODEGEN) fprintf(stderr, "%s 0x%08x 0x%08x %d\n", __FUNCTION__, - key[0], key[1], vb.vertex_size ); + key[0], key[1], rmesa->vb.vertex_size ); - switch (vb.vertex_size) { + switch (rmesa->vb.vertex_size) { case 4: { DFN ( _x86_Vertex3f_4, rmesa->vb.dfn_cache.Vertex3f ); - FIXUP(dfn->code, 2, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 25, 0x0, (int)&vb.vertex[3]); - FIXUP(dfn->code, 36, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 46, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 51, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 60, 0x0, (int)&vb.notify); + FIXUP(dfn->code, 2, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 25, 0x0, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 36, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 46, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 51, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 60, 0x0, (int)&rmesa->vb.notify); break; } case 6: { DFN ( _x86_Vertex3f_6, rmesa->vb.dfn_cache.Vertex3f ); - FIXUP(dfn->code, 3, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 28, 0x0, (int)&vb.vertex[3]); - FIXUP(dfn->code, 34, 0x0, (int)&vb.vertex[4]); - FIXUP(dfn->code, 40, 0x0, (int)&vb.vertex[5]); - FIXUP(dfn->code, 57, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 63, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 70, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 79, 0x0, (int)&vb.notify); + FIXUP(dfn->code, 3, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 28, 0x0, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 34, 0x0, (int)&rmesa->vb.vertex[4]); + FIXUP(dfn->code, 40, 0x0, (int)&rmesa->vb.vertex[5]); + FIXUP(dfn->code, 57, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 63, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 70, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 79, 0x0, (int)&rmesa->vb.notify); break; } default: { DFN ( _x86_Vertex3f, rmesa->vb.dfn_cache.Vertex3f ); - FIXUP(dfn->code, 3, 0x0, (int)&vb.vertex[3]); - FIXUP(dfn->code, 9, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 37, 0x0, vb.vertex_size-3); - FIXUP(dfn->code, 44, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 50, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 56, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 67, 0x0, (int)&vb.notify); + FIXUP(dfn->code, 3, 0x0, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 9, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 37, 0x0, rmesa->vb.vertex_size-3); + FIXUP(dfn->code, 44, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 50, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 56, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 67, 0x0, (int)&rmesa->vb.notify); break; } } @@ -130,20 +127,20 @@ if (R200_DEBUG & DEBUG_CODEGEN) fprintf(stderr, "%s 0x%08x 0x%08x %d\n", __FUNCTION__, - key[0], key[1], vb.vertex_size ); + key[0], key[1], rmesa->vb.vertex_size ); - switch (vb.vertex_size) { + switch (rmesa->vb.vertex_size) { case 6: { DFN ( _x86_Vertex3fv_6, rmesa->vb.dfn_cache.Vertex3fv ); - FIXUP(dfn->code, 1, 0x00000000, (int)&vb.dmaptr); - FIXUP(dfn->code, 27, 0x0000001c, (int)&vb.vertex[3]); - FIXUP(dfn->code, 33, 0x00000020, (int)&vb.vertex[4]); - FIXUP(dfn->code, 45, 0x00000024, (int)&vb.vertex[5]); - FIXUP(dfn->code, 56, 0x00000000, (int)&vb.dmaptr); - FIXUP(dfn->code, 61, 0x00000004, (int)&vb.counter); - FIXUP(dfn->code, 67, 0x00000004, (int)&vb.counter); - FIXUP(dfn->code, 76, 0x00000008, (int)&vb.notify); + FIXUP(dfn->code, 1, 0x00000000, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 27, 0x0000001c, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 33, 0x00000020, (int)&rmesa->vb.vertex[4]); + FIXUP(dfn->code, 45, 0x00000024, (int)&rmesa->vb.vertex[5]); + FIXUP(dfn->code, 56, 0x00000000, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 61, 0x00000004, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 67, 0x00000004, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 76, 0x00000008, (int)&rmesa->vb.notify); break; } @@ -151,16 +148,16 @@ case 8: { DFN ( _x86_Vertex3fv_8, rmesa->vb.dfn_cache.Vertex3fv ); - FIXUP(dfn->code, 1, 0x00000000, (int)&vb.dmaptr); - FIXUP(dfn->code, 27, 0x0000001c, (int)&vb.vertex[3]); - FIXUP(dfn->code, 33, 0x00000020, (int)&vb.vertex[4]); - FIXUP(dfn->code, 45, 0x0000001c, (int)&vb.vertex[5]); - FIXUP(dfn->code, 51, 0x00000020, (int)&vb.vertex[6]); - FIXUP(dfn->code, 63, 0x00000024, (int)&vb.vertex[7]); - FIXUP(dfn->code, 74, 0x00000000, (int)&vb.dmaptr); - FIXUP(dfn->code, 79, 0x00000004, (int)&vb.counter); - FIXUP(dfn->code, 85, 0x00000004, (int)&vb.counter); - FIXUP(dfn->code, 94, 0x00000008, (int)&vb.notify); + FIXUP(dfn->code, 1, 0x00000000, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 27, 0x0000001c, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 33, 0x00000020, (int)&rmesa->vb.vertex[4]); + FIXUP(dfn->code, 45, 0x0000001c, (int)&rmesa->vb.vertex[5]); + FIXUP(dfn->code, 51, 0x00000020, (int)&rmesa->vb.vertex[6]); + FIXUP(dfn->code, 63, 0x00000024, (int)&rmesa->vb.vertex[7]); + FIXUP(dfn->code, 74, 0x00000000, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 79, 0x00000004, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 85, 0x00000004, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 94, 0x00000008, (int)&rmesa->vb.notify); break; } @@ -169,13 +166,13 @@ default: { DFN ( _x86_Vertex3fv, rmesa->vb.dfn_cache.Vertex3fv ); - FIXUP(dfn->code, 8, 0x01010101, (int)&vb.dmaptr); - FIXUP(dfn->code, 32, 0x00000006, vb.vertex_size-3); - FIXUP(dfn->code, 37, 0x00000058, (int)&vb.vertex[3]); - FIXUP(dfn->code, 45, 0x01010101, (int)&vb.dmaptr); - FIXUP(dfn->code, 50, 0x02020202, (int)&vb.counter); - FIXUP(dfn->code, 58, 0x02020202, (int)&vb.counter); - FIXUP(dfn->code, 67, 0x0, (int)&vb.notify); + FIXUP(dfn->code, 8, 0x01010101, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 32, 0x00000006, rmesa->vb.vertex_size-3); + FIXUP(dfn->code, 37, 0x00000058, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 45, 0x01010101, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 50, 0x02020202, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 58, 0x02020202, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 67, 0x0, (int)&rmesa->vb.notify); break; } } @@ -183,37 +180,88 @@ return dfn; } -struct dynfn *r200_makeX86Normal3fv( GLcontext *ctx, const int *key ) +static struct dynfn * +r200_makeX86Attribute2fv( struct dynfn * cache, const int *key, + const char * name, void * dest ) { struct dynfn *dfn = MALLOC_STRUCT( dynfn ); - r200ContextPtr rmesa = R200_CONTEXT(ctx); - int i = 0; if (R200_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] ); + fprintf(stderr, "%s 0x%08x\n", name, key[0] ); - DFN ( _x86_Normal3fv, rmesa->vb.dfn_cache.Normal3fv ); + DFN ( _x86_Attribute2fv, (*cache) ); + FIXUP(dfn->code, 11, 0x0, (int)dest); + FIXUP(dfn->code, 16, 0x4, 4+(int)dest); - FIXUP2(dfn->code, i, 0x0, (int)vb.normalptr); - FIXUP2(dfn->code, i, 0x4, 4+(int)vb.normalptr); - FIXUP2(dfn->code, i, 0x8, 8+(int)vb.normalptr); - fprintf(stderr, "%s done\n", __FUNCTION__); return dfn; } -struct dynfn *r200_makeX86Normal3f( GLcontext *ctx, const int *key ) +static struct dynfn * +r200_makeX86Attribute2f( struct dynfn * cache, const int *key, + const char * name, void * dest ) { struct dynfn *dfn = MALLOC_STRUCT( dynfn ); - r200ContextPtr rmesa = R200_CONTEXT(ctx); if (R200_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] ); + fprintf(stderr, "%s 0x%08x\n", name, key[0] ); + + DFN ( _x86_Attribute2f, (*cache) ); + FIXUP(dfn->code, 1, 0x0, (int)dest); + + return dfn; +} + + +static struct dynfn * +r200_makeX86Attribute3fv( struct dynfn * cache, const int *key, + const char * name, void * dest ) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (R200_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key[0] ); + + DFN ( _x86_Attribute3fv, (*cache) ); + FIXUP(dfn->code, 14, 0x0, (int)dest); + FIXUP(dfn->code, 20, 0x4, 4+(int)dest); + FIXUP(dfn->code, 25, 0x8, 8+(int)dest); - DFN ( _x86_Normal3f, rmesa->vb.dfn_cache.Normal3f ); - FIXUP(dfn->code, 1, 0x12345678, (int)vb.normalptr); return dfn; } +static struct dynfn * +r200_makeX86Attribute3f( struct dynfn * cache, const int *key, + const char * name, void * dest ) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (R200_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key[0] ); + + DFN ( _x86_Attribute3f, (*cache) ); + FIXUP(dfn->code, 14, 0x0, (int)dest); + FIXUP(dfn->code, 20, 0x4, 4+(int)dest); + FIXUP(dfn->code, 25, 0x8, 8+(int)dest); + + return dfn; +} + +struct dynfn *r200_makeX86Normal3fv( GLcontext *ctx, const int *key ) +{ + r200ContextPtr rmesa = R200_CONTEXT(ctx); + + return r200_makeX86Attribute3fv( & rmesa->vb.dfn_cache.Normal3fv, key, + __FUNCTION__, rmesa->vb.normalptr ); +} + +struct dynfn *r200_makeX86Normal3f( GLcontext *ctx, const int *key ) +{ + r200ContextPtr rmesa = R200_CONTEXT(ctx); + + return r200_makeX86Attribute3f( & rmesa->vb.dfn_cache.Normal3f, key, + __FUNCTION__, rmesa->vb.normalptr ); +} + struct dynfn *r200_makeX86Color4ubv( GLcontext *ctx, const int *key ) { struct dynfn *dfn = MALLOC_STRUCT( dynfn ); @@ -225,17 +273,17 @@ if (VTX_COLOR(key[0],0) == R200_VTX_PK_RGBA) { DFN ( _x86_Color4ubv_ub, rmesa->vb.dfn_cache.Color4ubv); - FIXUP(dfn->code, 5, 0x12345678, (int)vb.colorptr); + FIXUP(dfn->code, 5, 0x12345678, (int)rmesa->vb.colorptr); return dfn; } else { DFN ( _x86_Color4ubv_4f, rmesa->vb.dfn_cache.Color4ubv); FIXUP(dfn->code, 2, 0x00000000, (int)_mesa_ubyte_to_float_color_tab); - FIXUP(dfn->code, 27, 0xdeadbeaf, (int)vb.floatcolorptr); - FIXUP(dfn->code, 33, 0xdeadbeaf, (int)vb.floatcolorptr+4); - FIXUP(dfn->code, 55, 0xdeadbeaf, (int)vb.floatcolorptr+8); - FIXUP(dfn->code, 61, 0xdeadbeaf, (int)vb.floatcolorptr+12); + FIXUP(dfn->code, 27, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr); + FIXUP(dfn->code, 33, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+4); + FIXUP(dfn->code, 55, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+8); + FIXUP(dfn->code, 61, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+12); return dfn; } } @@ -250,10 +298,10 @@ r200ContextPtr rmesa = R200_CONTEXT(ctx); DFN ( _x86_Color4ub_ub, rmesa->vb.dfn_cache.Color4ub ); - FIXUP(dfn->code, 18, 0x0, (int)vb.colorptr); - FIXUP(dfn->code, 24, 0x0, (int)vb.colorptr+1); - FIXUP(dfn->code, 30, 0x0, (int)vb.colorptr+2); - FIXUP(dfn->code, 36, 0x0, (int)vb.colorptr+3); + FIXUP(dfn->code, 18, 0x0, (int)rmesa->vb.colorptr); + FIXUP(dfn->code, 24, 0x0, (int)rmesa->vb.colorptr+1); + FIXUP(dfn->code, 30, 0x0, (int)rmesa->vb.colorptr+2); + FIXUP(dfn->code, 36, 0x0, (int)rmesa->vb.colorptr+3); return dfn; } else @@ -267,15 +315,10 @@ return 0; else { - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); r200ContextPtr rmesa = R200_CONTEXT(ctx); - if (R200_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] ); - - DFN ( _x86_Color3fv_3f, rmesa->vb.dfn_cache.Color3fv ); - FIXUP(dfn->code, 5, 0x0, (int)vb.floatcolorptr); - return dfn; + return r200_makeX86Attribute3fv( & rmesa->vb.dfn_cache.Color3fv, key, + __FUNCTION__, rmesa->vb.floatcolorptr ); } } @@ -285,15 +328,10 @@ return 0; else { - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); r200ContextPtr rmesa = R200_CONTEXT(ctx); - if (R200_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key[0] ); - - DFN ( _x86_Color3f_3f, rmesa->vb.dfn_cache.Color3f ); - FIXUP(dfn->code, 1, 0x12345678, (int)vb.floatcolorptr); - return dfn; + return r200_makeX86Attribute3f( & rmesa->vb.dfn_cache.Color3f, key, + __FUNCTION__, rmesa->vb.floatcolorptr ); } } @@ -301,74 +339,35 @@ struct dynfn *r200_makeX86TexCoord2fv( GLcontext *ctx, const int *key ) { - - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); r200ContextPtr rmesa = R200_CONTEXT(ctx); - if (R200_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] ); - - DFN ( _x86_TexCoord2fv, rmesa->vb.dfn_cache.TexCoord2fv ); - FIXUP(dfn->code, 5, 0x12345678, (int)vb.texcoordptr[0]); - return dfn; + return r200_makeX86Attribute2fv( & rmesa->vb.dfn_cache.TexCoord2fv, key, + __FUNCTION__, rmesa->vb.texcoordptr[0] ); } struct dynfn *r200_makeX86TexCoord2f( GLcontext *ctx, const int *key ) { - - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); r200ContextPtr rmesa = R200_CONTEXT(ctx); - if (R200_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] ); - - DFN ( _x86_TexCoord2f, rmesa->vb.dfn_cache.TexCoord2f ); - FIXUP(dfn->code, 1, 0x12345678, (int)vb.texcoordptr[0]); - return dfn; + return r200_makeX86Attribute2f( & rmesa->vb.dfn_cache.TexCoord2f, key, + __FUNCTION__, rmesa->vb.texcoordptr[0] ); } struct dynfn *r200_makeX86MultiTexCoord2fvARB( GLcontext *ctx, const int *key ) { -#if 0 - static char temp[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0x8b, 0x4c, 0x24, 0x08, /* mov 0x8(%esp,1),%ecx */ - 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */ - 0x83, 0xe0, 0x01, /* and $0x1,%eax */ - 0x8b, 0x11, /* mov (%ecx),%edx */ - 0xc1, 0xe0, 0x03, /* shl $0x3,%eax */ - 0x8b, 0x49, 0x04, /* mov 0x4(%ecx),%ecx */ - 0x89, 0x90, 0, 0, 0, 0,/* mov %edx,DEST(%eax) */ - 0x89, 0x88, 0, 0, 0, 0,/* mov %ecx,DEST+8(%eax) */ - 0xc3, /* ret */ - }; - static char temp2[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0x8b, 0x4c, 0x24, 0x08, /* mov 0x8(%esp,1),%ecx */ - 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */ - 0x83, 0xe0, 0x01, /* and $0x1,%eax */ - 0x8b, 0x14, 0x85, 0, 0, 0, 0, /* mov DEST(,%eax,4),%edx */ - 0x8b, 0x01, /* mov (%ecx),%eax */ - 0x89, 0x02, /* mov %eax,(%edx) */ - 0x8b, 0x41, 0x04, /* mov 0x4(%ecx),%eax */ - 0x89, 0x42, 0x04, /* mov %eax,0x4(%edx) */ - 0xc3, /* ret */ - }; -#endif - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); r200ContextPtr rmesa = R200_CONTEXT(ctx); if (R200_DEBUG & DEBUG_CODEGEN) fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] ); - if (vb.texcoordptr[1] == vb.texcoordptr[0]+4) { - DFN ( _x86_MultiTexCoord2fvARB, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); - FIXUP(dfn->code, 26, 0xdeadbeef, (int)vb.texcoordptr[0]); - FIXUP(dfn->code, 32, 0xdeadbeef, (int)vb.texcoordptr[0]+4); + if (rmesa->vb.texcoordptr[1] == rmesa->vb.texcoordptr[0]+4) { + DFN ( _x86_MultiTexCoord2fv, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); + FIXUP(dfn->code, 21, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]); + FIXUP(dfn->code, 27, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]+4); } else { - DFN ( _x86_MultiTexCoord2fvARB_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); - FIXUP(dfn->code, 19, 0x0, (int)vb.texcoordptr); + DFN ( _x86_MultiTexCoord2fv_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); + FIXUP(dfn->code, 14, 0x0, (int)rmesa->vb.texcoordptr); } return dfn; } @@ -376,48 +375,23 @@ struct dynfn *r200_makeX86MultiTexCoord2fARB( GLcontext *ctx, const int *key ) { -#if 0 - static char temp[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%esp,1),%edx */ - 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */ - 0x8b, 0x4c, 0x24, 0x0c, /* mov 0xc(%esp,1),%ecx */ - 0x83, 0xe0, 0x01, /* and $0x1,%eax */ - 0xc1, 0xe0, 0x03, /* shl $0x3,%eax */ - 0x89, 0x90, 0, 0, 0, 0, /* mov %edx,DEST(%eax) */ - 0x89, 0x88, 0, 0, 0, 0, /* mov %ecx,DEST+8(%eax) */ - 0xc3, /* ret */ - }; - - static char temp2[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%esp,1),%edx */ - 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */ - 0x8b, 0x4c, 0x24, 0x0c, /* mov 0xc(%esp,1),%ecx */ - 0x83, 0xe0, 0x01, /* and $0x1,%eax */ - 0x8b, 0x04, 0x85, 0, 0, 0, 0, /* mov DEST(,%eax,4),%eax */ - 0x89, 0x10, /* mov %edx,(%eax) */ - 0x89, 0x48, 0x04, /* mov %ecx,0x4(%eax) */ - 0xc3, /* ret */ - }; -#endif struct dynfn *dfn = MALLOC_STRUCT( dynfn ); r200ContextPtr rmesa = R200_CONTEXT(ctx); if (R200_DEBUG & DEBUG_CODEGEN) fprintf(stderr, "%s 0x%08x 0x%08x\n", __FUNCTION__, key[0], key[1] ); - if (vb.texcoordptr[1] == vb.texcoordptr[0]+4) { - DFN ( _x86_MultiTexCoord2fARB, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); - FIXUP(dfn->code, 25, 0xdeadbeef, (int)vb.texcoordptr[0]); - FIXUP(dfn->code, 31, 0xdeadbeef, (int)vb.texcoordptr[0]+4); + if (rmesa->vb.texcoordptr[1] == rmesa->vb.texcoordptr[0]+4) { + DFN ( _x86_MultiTexCoord2f, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); + FIXUP(dfn->code, 20, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]); + FIXUP(dfn->code, 26, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]+4); } else { /* Note: this might get generated multiple times, even though the * actual emitted code is the same. */ - DFN ( _x86_MultiTexCoord2fARB_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); - FIXUP(dfn->code, 23, 0x0, (int)vb.texcoordptr); + DFN ( _x86_MultiTexCoord2f_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); + FIXUP(dfn->code, 18, 0x0, (int)rmesa->vb.texcoordptr); } return dfn; } Index: xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S diff -u xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S:1.2 xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S:1.4 --- xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S:1.2 Thu Nov 7 13:31:59 2002 +++ xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S Fri Nov 7 19:18:39 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S,v 1.2 2002/11/07 18:31:59 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_vtxtmp_x86.S,v 1.4 2003/11/08 00:18:39 dawes Exp $ */ /************************************************************************** Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas. @@ -28,20 +28,10 @@ #define GLOBL( x ) \ .globl x; \ -x##: +x: .data .align 4 -GLOBL( _x86_Normal3fv) - movl 4(%esp), %eax /* load 'v' off stack */ - movl (%eax), %ecx /* load v[0] */ - movl 4(%eax), %edx /* load v[1] */ - movl 8(%eax), %eax /* load v[2] */ - movl %ecx, 0 /* store v[0] to current vertex */ - movl %edx, 4 /* store v[1] to current vertex */ - movl %eax, 8 /* store v[2] to current vertex */ - ret -GLOBL ( _x86_Normal3fv_end ) /* vertex 3f vertex size 4 @@ -218,19 +208,70 @@ .6: jmp *0 GLOBL ( _x86_Vertex3fv_end ) -/* - Normal 3f -*/ -GLOBL ( _x86_Normal3f ) - movl $0x12345678, %edx + +/** + * Generic handler for 2 float format data. This can be used for + * TexCoord2f and possibly other functions. + */ + +GLOBL ( _x86_Attribute2f ) + movl $0x0, %edx movl 4(%esp), %eax + movl 8(%esp), %ecx movl %eax, (%edx) - movl 8(%esp), %eax - movl %eax, 4(%edx) + movl %ecx, 4(%edx) + ret +GLOBL ( _x86_Attribute2f_end ) + + +/** + * Generic handler for 2 float vector format data. This can be used for + * TexCoord2fv and possibly other functions. + */ + +GLOBL( _x86_Attribute2fv) + movl 4(%esp), %eax /* load 'v' off stack */ + movl (%eax), %ecx /* load v[0] */ + movl 4(%eax), %eax /* load v[1] */ + movl %ecx, 0 /* store v[0] to current vertex */ + movl %eax, 4 /* store v[1] to current vertex */ + ret +GLOBL ( _x86_Attribute2fv_end ) + + +/** + * Generic handler for 3 float format data. This can be used for + * Normal3f, Color3f (when the color target is also float), or + * TexCoord3f. + */ + +GLOBL ( _x86_Attribute3f ) + movl 4(%esp), %ecx + movl 8(%esp), %edx movl 12(%esp), %eax - movl %eax, 8(%edx) + movl %ecx, 0 + movl %edx, 4 + movl %eax, 8 + ret +GLOBL ( _x86_Attribute3f_end ) + +/** + * Generic handler for 3 float vector format data. This can be used for + * Normal3f, Color3f (when the color target is also float), or + * TexCoord3f. + */ + +GLOBL( _x86_Attribute3fv) + movl 4(%esp), %eax /* load 'v' off stack */ + movl (%eax), %ecx /* load v[0] */ + movl 4(%eax), %edx /* load v[1] */ + movl 8(%eax), %eax /* load v[2] */ + movl %ecx, 0 /* store v[0] to current vertex */ + movl %edx, 4 /* store v[1] to current vertex */ + movl %eax, 8 /* store v[2] to current vertex */ ret -GLOBL ( _x86_Normal3f_end ) +GLOBL ( _x86_Attribute3fv_end ) + /* Color 4ubv_ub @@ -290,69 +331,13 @@ ret GLOBL( _x86_Color4ub_ub_end ) -/* - Color3fv_3f -*/ -GLOBL( _x86_Color3fv_3f ) - movl 4(%esp), %eax - movl $0, %edx - movl (%eax), %ecx - movl %ecx, (%edx) - movl 4(%eax), %ecx - movl %ecx, 4(%edx) - movl 8(%eax), %ecx - movl %ecx, 8(%edx) - ret -GLOBL( _x86_Color3fv_3f_end ) - -/* - Color3f_3f -*/ -GLOBL( _x86_Color3f_3f ) - movl $0x12345678, %edx - movl 4(%esp), %eax - movl %eax, (%edx) - movl 8(%esp,1), %eax - movl %eax, 4(%edx) - movl 12(%esp), %eax - movl %eax, 8(%edx) - ret -GLOBL( _x86_Color3f_3f_end ) /* - TexCoord2fv + MultiTexCoord2fv st0/st1 */ - -GLOBL( _x86_TexCoord2fv ) - movl 4(%esp), %eax - movl $0x12345678, %edx - movl (%eax), %ecx - movl 4(%eax), %eax - movl %ecx, (%edx) - movl %eax, 4(%edx) - ret - -GLOBL( _x86_TexCoord2fv_end ) -/* - TexCoord2f -*/ -GLOBL( _x86_TexCoord2f ) - movl $0x12345678, %edx - movl 4(%esp), %eax - movl 8(%esp), %ecx - movl %eax, (%edx) - movl %ecx, 4(%edx) - ret -GLOBL( _x86_TexCoord2f_end ) - -/* - MultiTexCoord2fvARB st0/st1 -*/ -GLOBL( _x86_MultiTexCoord2fvARB ) - +GLOBL( _x86_MultiTexCoord2fv ) movl 4(%esp), %eax movl 8(%esp), %ecx - sub $0x84c0, %eax and $1, %eax movl (%ecx), %edx shl $3, %eax @@ -360,15 +345,15 @@ movl %edx, 0xdeadbeef(%eax) movl %ecx, 0xdeadbeef(%eax) ret -GLOBL( _x86_MultiTexCoord2fvARB_end ) +GLOBL( _x86_MultiTexCoord2fv_end ) + /* - MultiTexCoord2fvARB + MultiTexCoord2fv */ -GLOBL( _x86_MultiTexCoord2fvARB_2 ) +GLOBL( _x86_MultiTexCoord2fv_2 ) movl 4(%esp,1), %eax movl 8(%esp,1), %ecx - sub $0x84c0, %eax and $0x1, %eax movl 0(,%eax,4), %edx movl (%ecx), %eax @@ -376,35 +361,134 @@ movl 4(%ecx), %eax movl %eax, 4(%edx) ret - -GLOBL( _x86_MultiTexCoord2fvARB_2_end ) +GLOBL( _x86_MultiTexCoord2fv_2_end ) /* - MultiTexCoord2fARB st0/st1 + MultiTexCoord2f st0/st1 */ -GLOBL( _x86_MultiTexCoord2fARB ) +GLOBL( _x86_MultiTexCoord2f ) movl 4(%esp), %eax movl 8(%esp), %edx - sub $0x84c0, %eax movl 12(%esp), %ecx and $1, %eax shl $3, %eax movl %edx, 0xdeadbeef(%eax) movl %ecx, 0xdeadbeef(%eax) ret -GLOBL( _x86_MultiTexCoord2fARB_end ) +GLOBL( _x86_MultiTexCoord2f_end ) /* - MultiTexCoord2fARB + MultiTexCoord2f */ -GLOBL( _x86_MultiTexCoord2fARB_2 ) +GLOBL( _x86_MultiTexCoord2f_2 ) movl 4(%esp), %eax movl 8(%esp), %edx - sub $0x84c0, %eax movl 12(%esp,1), %ecx and $1,%eax movl 0(,%eax,4), %eax movl %edx, (%eax) movl %ecx, 4(%eax) ret -GLOBL( _x86_MultiTexCoord2fARB_2_end ) +GLOBL( _x86_MultiTexCoord2f_2_end ) + +#if defined(USE_SSE_ASM) +/** + * This can be used as a template for either Color3fv (when the color + * target is also a 3f) or Normal3fv. + */ + +GLOBL( _sse_Attribute3fv ) + movl 4(%esp), %eax + movlps (%eax), %xmm0 + movl 8(%eax), %eax + movlps %xmm0, 0 + movl %eax, 8 + ret +GLOBL( _sse_Attribute3fv_end ) + +/** + * This can be used as a template for either Color3f (when the color + * target is also a 3f) or Normal3f. + */ + +GLOBL( _sse_Attribute3f ) + movlps 4(%esp), %xmm0 + movl 12(%esp), %eax + movlps %xmm0, 0 + movl %eax, 8 + ret +GLOBL( _sse_Attribute3f_end ) + + +/** + * Generic handler for 2 float vector format data. This can be used for + * TexCoord2fv and possibly other functions. + */ + +GLOBL( _sse_Attribute2fv ) + movl 4(%esp), %eax + movlps (%eax), %xmm0 + movlps %xmm0, 0 + ret +GLOBL( _sse_Attribute2fv_end ) + + +/** + * Generic handler for 2 float format data. This can be used for + * TexCoord2f and possibly other functions. + */ + +GLOBL( _sse_Attribute2f ) + movlps 4(%esp), %xmm0 + movlps %xmm0, 0 + ret +GLOBL( _sse_Attribute2f_end ) + +/* + MultiTexCoord2fv st0/st1 +*/ +GLOBL( _sse_MultiTexCoord2fv ) + movl 4(%esp), %eax + movl 8(%esp), %ecx + and $1, %eax + movlps (%ecx), %xmm0 + movlps %xmm0, 0xdeadbeef(,%eax,8) + ret +GLOBL( _sse_MultiTexCoord2fv_end ) + +/* + MultiTexCoord2fv +*/ +GLOBL( _sse_MultiTexCoord2fv_2 ) + movl 4(%esp), %eax + movl 8(%esp), %ecx + and $0x1, %eax + movl 0(,%eax,4), %edx + movlps (%ecx), %xmm0 + movlps %xmm0, (%edx) + ret +GLOBL( _sse_MultiTexCoord2fv_2_end ) + +/* + MultiTexCoord2f st0/st1 +*/ +GLOBL( _sse_MultiTexCoord2f ) + movl 4(%esp), %eax + and $1, %eax + movlps 8(%esp), %xmm0 + movlps %xmm0, 0xdeadbeef(,%eax,8) + ret +GLOBL( _sse_MultiTexCoord2f_end ) + +/* + MultiTexCoord2f +*/ +GLOBL( _sse_MultiTexCoord2f_2 ) + movl 4(%esp), %eax + movlps 8(%esp), %xmm0 + and $1,%eax + movl 0(,%eax,4), %eax + movlps %xmm0, (%eax) + ret +GLOBL( _sse_MultiTexCoord2f_2_end ) +#endif Index: xc/lib/GL/mesa/src/drv/radeon/Imakefile diff -u xc/lib/GL/mesa/src/drv/radeon/Imakefile:1.11 xc/lib/GL/mesa/src/drv/radeon/Imakefile:1.12 --- xc/lib/GL/mesa/src/drv/radeon/Imakefile:1.11 Mon Nov 25 09:04:51 2002 +++ xc/lib/GL/mesa/src/drv/radeon/Imakefile Fri Nov 7 19:18:40 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/radeon/Imakefile,v 1.11 2002/11/25 14:04:51 eich Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/radeon/Imakefile,v 1.12 2003/11/08 00:18:40 dawes Exp $ #include @@ -75,5 +75,9 @@ #endif #endif +#ifdef i386Architecture +ObjectFromAsmSource(radeon_vtxtmp_x86, NullParameter) +#endif + DependTarget() Index: xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc:1.4 xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc:1.6 --- xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc:1.4 Wed Oct 30 07:51:54 2002 +++ xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc Sun Sep 28 16:15:27 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc,v 1.4 2002/10/30 12:51:54 alanh Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc,v 1.6 2003/09/28 20:15:27 alanh Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=ByteOrder + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ @@ -36,7 +36,6 @@ X_INCLUDES = -I$(XINCLUDESRC) -I$(EXTINCSRC) RADEONSRCS = $(MESADRVRADEONBUILDDIR)radeon_context.c \ - $(MESADRVRADEONBUILDDIR)radeon_compat.c \ $(MESADRVRADEONBUILDDIR)radeon_ioctl.c \ $(MESADRVRADEONBUILDDIR)radeon_lock.c \ $(MESADRVRADEONBUILDDIR)radeon_maos.c \ @@ -57,7 +56,6 @@ $(MESADRVRADEONBUILDDIR)radeon_vtxfmt_c.c RADEONOBJS = $(MESADRVRADEONBUILDDIR)radeon_context.o \ - $(MESADRVRADEONBUILDDIR)radeon_compat.o \ $(MESADRVRADEONBUILDDIR)radeon_ioctl.o \ $(MESADRVRADEONBUILDDIR)radeon_lock.o \ $(MESADRVRADEONBUILDDIR)radeon_maos.o \ @@ -81,7 +79,6 @@ #endif RADEONUOBJS = $(MESADRVRADEONBUILDDIR)unshared/radeon_context.o \ - $(MESADRVRADEONBUILDDIR)unshared/radeon_compat.o \ $(MESADRVRADEONBUILDDIR)unshared/radeon_ioctl.o \ $(MESADRVRADEONBUILDDIR)unshared/radeon_lock.o \ $(MESADRVRADEONBUILDDIR)unshared/radeon_maos.o \ @@ -105,7 +102,6 @@ #endif RADEONDOBJS = $(MESADRVRADEONBUILDDIR)debugger/radeon_context.o \ - $(MESADRVRADEONBUILDDIR)debugger/radeon_compat.o \ $(MESADRVRADEONBUILDDIR)debugger/radeon_ioctl.o \ $(MESADRVRADEONBUILDDIR)debugger/radeon_lock.o \ $(MESADRVRADEONBUILDDIR)debugger/radeon_maos.o \ @@ -129,7 +125,6 @@ #endif RADEONPOBJS = $(MESADRVRADEONBUILDDIR)profiled/radeon_context.o \ - $(MESADRVRADEONBUILDDIR)profiled/radeon_compat.o \ $(MESADRVRADEONBUILDDIR)profiled/radeon_ioctl.o \ $(MESADRVRADEONBUILDDIR)profiled/radeon_lock.o \ $(MESADRVRADEONBUILDDIR)profiled/radeon_maos.o \ @@ -154,7 +149,6 @@ #ifdef NeedToLinkMesaSrc LinkSourceFile(radeon_context.c, $(MESADRVSRCDIR)/radeon) -LinkSourceFile(radeon_compat.c, $(MESADRVSRCDIR)/radeon) LinkSourceFile(radeon_ioctl.c, $(MESADRVSRCDIR)/radeon) LinkSourceFile(radeon_lock.c, $(MESADRVSRCDIR)/radeon) LinkSourceFile(radeon_maos.c, $(MESADRVSRCDIR)/radeon) Index: xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c:1.1 xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c:removed --- xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c:1.1 Wed Oct 30 07:51:54 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c Sat Feb 28 21:41:17 2004 @@ -1,301 +0,0 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_compat.c,v 1.1 2002/10/30 12:51:54 alanh Exp $ */ -/************************************************************************** - -Copyright 2002 ATI Technologies Inc., Ontario, Canada, and - Tungsten Graphics Inc., Austin, Texas. - -All Rights Reserved. - -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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. - -**************************************************************************/ - -/* - * Authors: - * Keith Whitwell - * - */ - -#include "radeon_context.h" -#include "radeon_state.h" -#include "radeon_ioctl.h" -#include "mem.h" - -static struct { - int start; - int len; - const char *name; -} packet[RADEON_MAX_STATE_PACKETS] = { - { RADEON_PP_MISC,7,"RADEON_PP_MISC" }, - { RADEON_PP_CNTL,3,"RADEON_PP_CNTL" }, - { RADEON_RB3D_COLORPITCH,1,"RADEON_RB3D_COLORPITCH" }, - { RADEON_RE_LINE_PATTERN,2,"RADEON_RE_LINE_PATTERN" }, - { RADEON_SE_LINE_WIDTH,1,"RADEON_SE_LINE_WIDTH" }, - { RADEON_PP_LUM_MATRIX,1,"RADEON_PP_LUM_MATRIX" }, - { RADEON_PP_ROT_MATRIX_0,2,"RADEON_PP_ROT_MATRIX_0" }, - { RADEON_RB3D_STENCILREFMASK,3,"RADEON_RB3D_STENCILREFMASK" }, - { RADEON_SE_VPORT_XSCALE,6,"RADEON_SE_VPORT_XSCALE" }, - { RADEON_SE_CNTL,2,"RADEON_SE_CNTL" }, - { RADEON_SE_CNTL_STATUS,1,"RADEON_SE_CNTL_STATUS" }, - { RADEON_RE_MISC,1,"RADEON_RE_MISC" }, - { RADEON_PP_TXFILTER_0,6,"RADEON_PP_TXFILTER_0" }, - { RADEON_PP_BORDER_COLOR_0,1,"RADEON_PP_BORDER_COLOR_0" }, - { RADEON_PP_TXFILTER_1,6,"RADEON_PP_TXFILTER_1" }, - { RADEON_PP_BORDER_COLOR_1,1,"RADEON_PP_BORDER_COLOR_1" }, - { RADEON_PP_TXFILTER_2,6,"RADEON_PP_TXFILTER_2" }, - { RADEON_PP_BORDER_COLOR_2,1,"RADEON_PP_BORDER_COLOR_2" }, - { RADEON_SE_ZBIAS_FACTOR,2,"RADEON_SE_ZBIAS_FACTOR" }, - { RADEON_SE_TCL_OUTPUT_VTX_FMT,11,"RADEON_SE_TCL_OUTPUT_VTX_FMT" }, - { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED,17,"RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED" }, -}; - - -static void radeonCompatEmitPacket( radeonContextPtr rmesa, - struct radeon_state_atom *state ) -{ - RADEONSAREAPrivPtr sarea = rmesa->sarea; - radeon_context_regs_t *ctx = &sarea->ContextState; - radeon_texture_regs_t *tex0 = &sarea->TexState[0]; - radeon_texture_regs_t *tex1 = &sarea->TexState[1]; - int i; - int *buf = state->cmd; - - for ( i = 0 ; i < state->cmd_size ; ) { - drmRadeonCmdHeader *header = (drmRadeonCmdHeader *)&buf[i++]; - - if (RADEON_DEBUG & DEBUG_STATE) - fprintf(stderr, "%s %d: %s\n", __FUNCTION__, header->packet.packet_id, - packet[(int)header->packet.packet_id].name); - - switch (header->packet.packet_id) { - case RADEON_EMIT_PP_MISC: - ctx->pp_misc = buf[i++]; - ctx->pp_fog_color = buf[i++]; - ctx->re_solid_color = buf[i++]; - ctx->rb3d_blendcntl = buf[i++]; - ctx->rb3d_depthoffset = buf[i++]; - ctx->rb3d_depthpitch = buf[i++]; - ctx->rb3d_zstencilcntl = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_CONTEXT; - break; - case RADEON_EMIT_PP_CNTL: - ctx->pp_cntl = buf[i++]; - ctx->rb3d_cntl = buf[i++]; - ctx->rb3d_coloroffset = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_CONTEXT; - break; - case RADEON_EMIT_RB3D_COLORPITCH: - ctx->rb3d_colorpitch = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_CONTEXT; - break; - case RADEON_EMIT_RE_LINE_PATTERN: - ctx->re_line_pattern = buf[i++]; - ctx->re_line_state = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_LINE; - break; - case RADEON_EMIT_SE_LINE_WIDTH: - ctx->se_line_width = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_LINE; - break; - case RADEON_EMIT_PP_LUM_MATRIX: - ctx->pp_lum_matrix = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_BUMPMAP; - break; - case RADEON_EMIT_PP_ROT_MATRIX_0: - ctx->pp_rot_matrix_0 = buf[i++]; - ctx->pp_rot_matrix_1 = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_BUMPMAP; - break; - case RADEON_EMIT_RB3D_STENCILREFMASK: - ctx->rb3d_stencilrefmask = buf[i++]; - ctx->rb3d_ropcntl = buf[i++]; - ctx->rb3d_planemask = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_MASKS; - break; - case RADEON_EMIT_SE_VPORT_XSCALE: - ctx->se_vport_xscale = buf[i++]; - ctx->se_vport_xoffset = buf[i++]; - ctx->se_vport_yscale = buf[i++]; - ctx->se_vport_yoffset = buf[i++]; - ctx->se_vport_zscale = buf[i++]; - ctx->se_vport_zoffset = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_VIEWPORT; - break; - case RADEON_EMIT_SE_CNTL: - ctx->se_cntl = buf[i++]; - ctx->se_coord_fmt = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_CONTEXT | RADEON_UPLOAD_VERTFMT; - break; - case RADEON_EMIT_SE_CNTL_STATUS: - ctx->se_cntl_status = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_SETUP; - break; - case RADEON_EMIT_RE_MISC: - ctx->re_misc = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_MISC; - break; - case RADEON_EMIT_PP_TXFILTER_0: - tex0->pp_txfilter = buf[i++]; - tex0->pp_txformat = buf[i++]; - tex0->pp_txoffset = buf[i++]; - tex0->pp_txcblend = buf[i++]; - tex0->pp_txablend = buf[i++]; - tex0->pp_tfactor = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_TEX0; - break; - case RADEON_EMIT_PP_BORDER_COLOR_0: - tex0->pp_border_color = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_TEX0; - break; - case RADEON_EMIT_PP_TXFILTER_1: - tex1->pp_txfilter = buf[i++]; - tex1->pp_txformat = buf[i++]; - tex1->pp_txoffset = buf[i++]; - tex1->pp_txcblend = buf[i++]; - tex1->pp_txablend = buf[i++]; - tex1->pp_tfactor = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_TEX1; - break; - case RADEON_EMIT_PP_BORDER_COLOR_1: - tex1->pp_border_color = buf[i++]; - sarea->dirty |= RADEON_UPLOAD_TEX1; - break; - - case RADEON_EMIT_SE_ZBIAS_FACTOR: - i++; - i++; - break; - - case RADEON_EMIT_PP_TXFILTER_2: - case RADEON_EMIT_PP_BORDER_COLOR_2: - case RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT: - case RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED: - default: - /* These states aren't understood by radeon drm 1.1 */ - fprintf(stderr, "Tried to emit unsupported state\n"); - return; - } - } -} - - - -static void radeonCompatEmitStateLocked( radeonContextPtr rmesa ) -{ - struct radeon_state_atom *state, *tmp; - - if (RADEON_DEBUG & (DEBUG_STATE|DEBUG_PRIMS)) - fprintf(stderr, "%s\n", __FUNCTION__); - - if (rmesa->lost_context) { - if (RADEON_DEBUG & (DEBUG_STATE|DEBUG_PRIMS|DEBUG_IOCTL)) - fprintf(stderr, "%s - lost context\n", __FUNCTION__); - - foreach_s( state, tmp, &(rmesa->hw.clean) ) - move_to_tail(&(rmesa->hw.dirty), state ); - - rmesa->lost_context = 0; - } - - foreach_s( state, tmp, &(rmesa->hw.dirty) ) { - if (!state->is_tcl) - radeonCompatEmitPacket( rmesa, state ); - move_to_head( &(rmesa->hw.clean), state ); - } -} - - - -static void radeonCompatEmitPrimitiveLocked( radeonContextPtr rmesa, - GLuint hw_primitive, - GLuint nverts, - XF86DRIClipRectPtr pbox, - GLuint nbox ) -{ - int i; - - for ( i = 0 ; i < nbox ; ) { - int nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS, nbox ); - XF86DRIClipRectPtr b = rmesa->sarea->boxes; - drmRadeonVertex vtx; - - rmesa->sarea->dirty |= RADEON_UPLOAD_CLIPRECTS; - rmesa->sarea->nbox = nr - i; - - for ( ; i < nr ; i++) - *b++ = pbox[i]; - - if (RADEON_DEBUG & DEBUG_IOCTL) - fprintf(stderr, - "RadeonFlushVertexBuffer: prim %x buf %d verts %d " - "disc %d nbox %d\n", - hw_primitive, - rmesa->dma.current.buf->buf->idx, - nverts, - nr == nbox, - rmesa->sarea->nbox ); - - vtx.prim = hw_primitive; - vtx.idx = rmesa->dma.current.buf->buf->idx; - vtx.count = nverts; - vtx.discard = (nr == nbox); - - drmCommandWrite( rmesa->dri.fd, - DRM_RADEON_VERTEX, - &vtx, sizeof(vtx)); - } -} - - - -/* No 'start' for 1.1 vertices ioctl: only one vertex prim/buffer! - */ -void radeonCompatEmitPrimitive( radeonContextPtr rmesa, - GLuint vertex_format, - GLuint hw_primitive, - GLuint nrverts ) -{ - if (RADEON_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "%s\n", __FUNCTION__); - - LOCK_HARDWARE( rmesa ); - - radeonCompatEmitStateLocked( rmesa ); - rmesa->sarea->vc_format = vertex_format; - - if (rmesa->state.scissor.enabled) { - radeonCompatEmitPrimitiveLocked( rmesa, - hw_primitive, - nrverts, - rmesa->state.scissor.pClipRects, - rmesa->state.scissor.numClipRects ); - } - else { - radeonCompatEmitPrimitiveLocked( rmesa, - hw_primitive, - nrverts, - rmesa->pClipRects, - rmesa->numClipRects ); - } - - - UNLOCK_HARDWARE( rmesa ); -} - Index: xc/lib/GL/mesa/src/drv/radeon/radeon_context.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_context.c:1.7 xc/lib/GL/mesa/src/drv/radeon/radeon_context.c:1.13 --- xc/lib/GL/mesa/src/drv/radeon/radeon_context.c:1.7 Sat Feb 8 16:26:45 2003 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_context.c Thu Jan 22 22:57:06 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_context.c,v 1.7 2003/02/08 21:26:45 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_context.c,v 1.13 2004/01/23 03:57:06 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -32,9 +33,22 @@ * Kevin E. Martin * Gareth Hughes * Keith Whitwell - * */ +#include "glheader.h" +#include "api_arrayelt.h" +#include "context.h" +#include "simple_list.h" +#include "imports.h" +#include "matrix.h" +#include "extensions.h" + +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "array_cache/acache.h" + +#include "tnl/tnl.h" +#include "tnl/t_pipeline.h" #include "radeon_context.h" #include "radeon_ioctl.h" @@ -46,25 +60,10 @@ #include "radeon_vtxfmt.h" #include "radeon_maos.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "array_cache/acache.h" - -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - -#include "api_arrayelt.h" -#include "context.h" -#include "simple_list.h" -#include "mem.h" -#include "matrix.h" -#include "extensions.h" -#if defined(USE_X86_ASM) -#include "X86/common_x86_asm.h" -#endif - -#define RADEON_DATE "20020611" +#define DRIVER_DATE "20030328" +#include "vblank.h" +#include "utils.h" #ifndef RADEON_DEBUG int RADEON_DEBUG = (0); #endif @@ -91,64 +90,21 @@ { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); static char buffer[128]; + unsigned offset; + GLuint agp_mode = rmesa->radeonScreen->IsPCI ? 0 : + rmesa->radeonScreen->AGPMode; switch ( name ) { case GL_VENDOR: return (GLubyte *)"Tungsten Graphics, Inc."; case GL_RENDERER: - sprintf( buffer, "Mesa DRI Radeon " RADEON_DATE); + offset = driGetRendererString( buffer, "Radeon", DRIVER_DATE, + agp_mode ); - /* Append any chipset-specific information. None yet. - */ - - /* Append any AGP-specific information. - */ - switch ( rmesa->radeonScreen->AGPMode ) { - case 1: - strncat( buffer, " AGP 1x", 7 ); - break; - case 2: - strncat( buffer, " AGP 2x", 7 ); - break; - case 4: - strncat( buffer, " AGP 4x", 7 ); - break; - } - - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - } -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif -#endif - - if ( rmesa->dri.drmMinor < 3 ) { - strncat( buffer, " DRM-COMPAT", 11 ); - } - - if ( !(rmesa->TclFallback & RADEON_TCL_FALLBACK_TCL_DISABLE) ) { - strncat( buffer, " TCL", 4 ); - } - else { - strncat( buffer, " NO-TCL", 7 ); - } + sprintf( & buffer[ offset ], " %sTCL", + !(rmesa->TclFallback & RADEON_TCL_FALLBACK_TCL_DISABLE) + ? "" : "NO-" ); return (GLubyte *)buffer; @@ -160,7 +116,7 @@ /* Extension strings exported by the R100 driver. */ -static const char * const radeon_extensions[] = +static const char * const card_extensions[] = { "GL_ARB_multisample", "GL_ARB_multitexture", @@ -172,33 +128,25 @@ "GL_ARB_texture_mirrored_repeat", "GL_EXT_blend_logic_op", "GL_EXT_blend_subtract", -/* "GL_EXT_fog_coord", */ "GL_EXT_secondary_color", + "GL_EXT_texture_edge_clamp", "GL_EXT_texture_env_add", "GL_EXT_texture_env_combine", "GL_EXT_texture_env_dot3", "GL_EXT_texture_filter_anisotropic", "GL_EXT_texture_lod_bias", + "GL_ATI_texture_env_combine3", "GL_ATI_texture_mirror_once", "GL_IBM_texture_mirrored_repeat", + "GL_MESA_ycbcr_texture", "GL_NV_blend_square", "GL_SGIS_generate_mipmap", "GL_SGIS_texture_border_clamp", + "GL_SGIS_texture_edge_clamp", NULL }; -/* Initialize the extensions supported by this driver. - */ -static void radeonInitExtensions( GLcontext *ctx ) -{ - unsigned i; - _mesa_enable_imaging_extensions( ctx ); - - for ( i = 0 ; radeon_extensions[i] != NULL ; i++ ) { - _mesa_enable_extension( ctx, radeon_extensions[i] ); - } -} - +extern const struct gl_pipeline_stage _radeon_texrect_stage; extern const struct gl_pipeline_stage _radeon_render_stage; extern const struct gl_pipeline_stage _radeon_tcl_stage; @@ -217,18 +165,10 @@ &_tnl_texgen_stage, &_tnl_texture_transform_stage, - /* Try again to go to tcl? - * - no good for asymmetric-twoside (do with multipass) - * - no good for asymmetric-unfilled (do with multipass) - * - good for material - * - good for texgen - * - need to manipulate a bit of state - * - * - worth it/not worth it? - */ - - /* Else do them here. + /* Scale texture rectangle to 0..1. */ + &_radeon_texrect_stage, + &_radeon_render_stage, &_tnl_render_stage, /* FALLBACK: */ 0, @@ -249,25 +189,49 @@ ctx->Driver.Bitmap = NULL; } +static const struct dri_debug_control debug_control[] = +{ + { "fall", DEBUG_FALLBACKS }, + { "tex", DEBUG_TEXTURE }, + { "ioctl", DEBUG_IOCTL }, + { "prim", DEBUG_PRIMS }, + { "vert", DEBUG_VERTS }, + { "state", DEBUG_STATE }, + { "code", DEBUG_CODEGEN }, + { "vfmt", DEBUG_VFMT }, + { "vtxf", DEBUG_VFMT }, + { "verb", DEBUG_VERBOSE }, + { "dri", DEBUG_DRI }, + { "dma", DEBUG_DMA }, + { "san", DEBUG_SANITY }, + { NULL, 0 } +}; + + +static int +get_ust_nop( int64_t * ust ) +{ + *ust = 1; + return 0; +} /* Create the device specific context. */ -static GLboolean -radeonCreateContext( Display *dpy, const __GLcontextModes *glVisual, +GLboolean +radeonCreateContext( const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate) { __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - radeonScreenPtr radeonScreen = (radeonScreenPtr)(sPriv->private); + radeonScreenPtr screen = (radeonScreenPtr)(sPriv->private); radeonContextPtr rmesa; GLcontext *ctx, *shareCtx; int i; - assert(dpy); assert(glVisual); assert(driContextPriv); - assert(radeonScreen); + assert(screen); /* Allocate the Radeon context */ rmesa = (radeonContextPtr) CALLOC( sizeof(*rmesa) ); @@ -279,7 +243,7 @@ shareCtx = ((radeonContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, rmesa, GL_TRUE); + rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) rmesa, GL_TRUE); if (!rmesa->glCtx) { FREE(rmesa); return GL_FALSE; @@ -287,59 +251,62 @@ driContextPriv->driverPrivate = rmesa; /* Init radeon context data */ - rmesa->dri.display = dpy; rmesa->dri.context = driContextPriv; rmesa->dri.screen = sPriv; rmesa->dri.drawable = NULL; /* Set by XMesaMakeCurrent */ rmesa->dri.hwContext = driContextPriv->hHWContext; rmesa->dri.hwLock = &sPriv->pSAREA->lock; rmesa->dri.fd = sPriv->fd; + rmesa->dri.drmMinor = sPriv->drmMinor; - /* If we don't have 1.3, fallback to the 1.1 interfaces. - */ - if (getenv("RADEON_COMPAT") || sPriv->drmMinor < 3 ) - rmesa->dri.drmMinor = 1; - else - rmesa->dri.drmMinor = sPriv->drmMinor; - - rmesa->radeonScreen = radeonScreen; + rmesa->radeonScreen = screen; rmesa->sarea = (RADEONSAREAPrivPtr)((GLubyte *)sPriv->pSAREA + - radeonScreen->sarea_priv_offset); + screen->sarea_priv_offset); rmesa->dma.buf0_address = rmesa->radeonScreen->buffers->list[0].address; - for ( i = 0 ; i < radeonScreen->numTexHeaps ; i++ ) { - make_empty_list( &rmesa->texture.objects[i] ); - rmesa->texture.heap[i] = mmInit( 0, radeonScreen->texSize[i] ); - rmesa->texture.age[i] = -1; + (void) memset( rmesa->texture_heaps, 0, sizeof( rmesa->texture_heaps ) ); + make_empty_list( & rmesa->swapped ); + + rmesa->nr_heaps = screen->numTexHeaps; + for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { + rmesa->texture_heaps[i] = driCreateTextureHeap( i, rmesa, + screen->texSize[i], + 12, + RADEON_NR_TEX_REGIONS, + rmesa->sarea->texList[i], + & rmesa->sarea->texAge[i], + & rmesa->swapped, + sizeof( radeonTexObj ), + (destroy_texture_object_t *) radeonDestroyTexObj ); + + driSetTextureSwapCounterLocation( rmesa->texture_heaps[i], + & rmesa->c_textureSwaps ); } - rmesa->texture.numHeaps = radeonScreen->numTexHeaps; - make_empty_list( &rmesa->texture.swapped ); rmesa->swtcl.RenderIndex = ~0; rmesa->lost_context = 1; - /* KW: Set the maximum texture size small enough that we can - * guarentee that both texture units can bind a maximal texture - * and have them both in on-card memory at once. - * Test for 2 textures * 4 bytes/texel * size * size. + /* Set the maximum texture size small enough that we can guarentee that + * all texture units can bind a maximal texture and have them both in + * texturable memory at once. */ - ctx = rmesa->glCtx; - if (radeonScreen->texSize[RADEON_CARD_HEAP] >= 2 * 4 * 2048 * 2048) { - ctx->Const.MaxTextureLevels = 12; /* 2048x2048 */ - } - else if (radeonScreen->texSize[RADEON_CARD_HEAP] >= 2 * 4 * 1024 * 1024) { - ctx->Const.MaxTextureLevels = 11; /* 1024x1024 */ - } - else if (radeonScreen->texSize[RADEON_CARD_HEAP] >= 2 * 4 * 512 * 512) { - ctx->Const.MaxTextureLevels = 10; /* 512x512 */ - } - else { - ctx->Const.MaxTextureLevels = 9; /* 256x256 */ - } + ctx = rmesa->glCtx; ctx->Const.MaxTextureUnits = 2; + + driCalculateMaxTextureLevels( rmesa->texture_heaps, + rmesa->nr_heaps, + & ctx->Const, + 4, + 11, /* max 2D texture size is 2048x2048 */ + 0, /* 3D textures unsupported. */ + 0, /* cube textures unsupported. */ + 11, /* max rect texture size is 2048x2048. */ + 12, + GL_FALSE ); + ctx->Const.MaxTextureMaxAnisotropy = 16.0; /* No wide points. @@ -361,14 +328,10 @@ * etc. */ ctx->Const.MaxArrayLockSize = - MIN2( ctx->Const.MaxArrayLockSize, - RADEON_BUFFER_SIZE / RADEON_MAX_TCL_VERTSIZE ); - - if (getenv("LIBGL_PERFORMANCE_BOXES")) - rmesa->boxes = 1; - else - rmesa->boxes = 0; + MIN2( ctx->Const.MaxArrayLockSize, + RADEON_BUFFER_SIZE / RADEON_MAX_TCL_VERTSIZE ); + rmesa->boxes = (getenv("LIBGL_PERFORMANCE_BOXES") != NULL); /* Initialize the software rasterizer and helper modules. */ @@ -382,6 +345,7 @@ */ _tnl_destroy_pipeline( ctx ); _tnl_install_pipeline( ctx, radeon_pipeline ); + ctx->Driver.FlushVertices = radeonFlushVertices; /* Try and keep materials and vertices separate: */ @@ -390,6 +354,11 @@ /* _mesa_allow_light_in_model( ctx, GL_FALSE ); */ + /* Try and keep materials and vertices separate: + */ + _tnl_isolate_materials( ctx, GL_TRUE ); + + /* Configure swrast to match hardware characteristics: */ _swrast_allow_pixel_fog( ctx, GL_FALSE ); @@ -403,7 +372,11 @@ _math_matrix_set_identity( &rmesa->TexGenMatrix[1] ); _math_matrix_set_identity( &rmesa->tmpmat ); - radeonInitExtensions( ctx ); + driInitExtensions( ctx, card_extensions, GL_TRUE ); + + if (rmesa->dri.drmMinor >= 9) + _mesa_enable_extension( ctx, "GL_NV_texture_rectangle"); + radeonInitDriverFuncs( ctx ); radeonInitIoctlFuncs( ctx ); radeonInitStateFuncs( ctx ); @@ -412,90 +385,26 @@ radeonInitState( rmesa ); radeonInitSwtcl( ctx ); - rmesa->do_irqs = (rmesa->radeonScreen->irq && !getenv("RADEON_NO_IRQS")); - rmesa->irqsEmitted = 0; rmesa->iw.irq_seq = -1; + rmesa->irqsEmitted = 0; + rmesa->do_irqs = (rmesa->radeonScreen->irq && !getenv("RADEON_NO_IRQS")); rmesa->do_usleeps = !getenv("RADEON_NO_USLEEPS"); - -#if DO_DEBUG - if (getenv("RADEON_DEBUG_FALLBACKS")) - RADEON_DEBUG |= DEBUG_FALLBACKS; - - if (getenv("RADEON_DEBUG_TEXTURE")) - RADEON_DEBUG |= DEBUG_TEXTURE; - if (getenv("RADEON_DEBUG_IOCTL")) - RADEON_DEBUG |= DEBUG_IOCTL; + rmesa->vblank_flags = (rmesa->radeonScreen->irq != 0) + ? driGetDefaultVBlankFlags() : VBLANK_FLAG_NO_IRQ; - if (getenv("RADEON_DEBUG_PRIMS")) - RADEON_DEBUG |= DEBUG_PRIMS; - - if (getenv("RADEON_DEBUG_VERTS")) - RADEON_DEBUG |= DEBUG_VERTS; - - if (getenv("RADEON_DEBUG_STATE")) - RADEON_DEBUG |= DEBUG_STATE; - - if (getenv("RADEON_DEBUG_CODEGEN")) - RADEON_DEBUG |= DEBUG_CODEGEN; - - if (getenv("RADEON_DEBUG_VTXFMT")) - RADEON_DEBUG |= DEBUG_VFMT; - - if (getenv("RADEON_DEBUG_VERBOSE")) - RADEON_DEBUG |= DEBUG_VERBOSE; - - if (getenv("RADEON_DEBUG_DRI")) - RADEON_DEBUG |= DEBUG_DRI; - - if (getenv("RADEON_DEBUG_DMA")) - RADEON_DEBUG |= DEBUG_DMA; - - if (getenv("RADEON_DEBUG_SANITY")) - RADEON_DEBUG |= DEBUG_SANITY; - - if (getenv("RADEON_DEBUG")) - { - const char *debug = getenv("RADEON_DEBUG"); - if (strstr(debug, "fall")) - RADEON_DEBUG |= DEBUG_FALLBACKS; - - if (strstr(debug, "tex")) - RADEON_DEBUG |= DEBUG_TEXTURE; - - if (strstr(debug, "ioctl")) - RADEON_DEBUG |= DEBUG_IOCTL; - - if (strstr(debug, "prim")) - RADEON_DEBUG |= DEBUG_PRIMS; - - if (strstr(debug, "vert")) - RADEON_DEBUG |= DEBUG_VERTS; - - if (strstr(debug, "state")) - RADEON_DEBUG |= DEBUG_STATE; - - if (strstr(debug, "code")) - RADEON_DEBUG |= DEBUG_CODEGEN; - - if (strstr(debug, "vfmt") || strstr(debug, "vtxf")) - RADEON_DEBUG |= DEBUG_VFMT; - - if (strstr(debug, "verb")) - RADEON_DEBUG |= DEBUG_VERBOSE; - - if (strstr(debug, "dri")) - RADEON_DEBUG |= DEBUG_DRI; - - if (strstr(debug, "dma")) - RADEON_DEBUG |= DEBUG_DMA; - - if (strstr(debug, "san")) - RADEON_DEBUG |= DEBUG_SANITY; + rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); + if ( rmesa->get_ust == NULL ) { + rmesa->get_ust = get_ust_nop; } + (*rmesa->get_ust)( & rmesa->swap_ust ); + +#if DO_DEBUG + RADEON_DEBUG = driParseDebugString( getenv( "RADEON_DEBUG" ), + debug_control ); #endif if (getenv("RADEON_NO_RAST")) { @@ -507,7 +416,6 @@ fprintf(stderr, " your card if it isn't capable of TCL!\n"); rmesa->radeonScreen->chipset |= RADEON_CHIPSET_TCL; } else if (getenv("RADEON_TCL_FORCE_DISABLE") || - rmesa->dri.drmMinor < 3 || !(rmesa->radeonScreen->chipset & RADEON_CHIPSET_TCL)) { rmesa->radeonScreen->chipset &= ~RADEON_CHIPSET_TCL; fprintf(stderr, "disabling TCL support\n"); @@ -528,8 +436,7 @@ */ /* Destroy the Mesa and driver specific context data. */ -static void -radeonDestroyContext( __DRIcontextPrivate *driContextPriv ) +void radeonDestroyContext( __DRIcontextPrivate *driContextPriv ) { GET_CURRENT_CONTEXT(ctx); radeonContextPtr rmesa = (radeonContextPtr) driContextPriv->driverPrivate; @@ -544,33 +451,16 @@ /* Free radeon context resources */ assert(rmesa); /* should never be null */ if ( rmesa ) { - if (rmesa->glCtx->Shared->RefCount == 1) { - /* This share group is about to go away, free our private - * texture object data. - */ - radeonTexObjPtr t, next_t; - int i; + GLboolean release_texture_heaps; - for ( i = 0 ; i < rmesa->texture.numHeaps ; i++ ) { - foreach_s ( t, next_t, &rmesa->texture.objects[i] ) { - radeonDestroyTexObj( rmesa, t ); - } - mmDestroy( rmesa->texture.heap[i] ); - rmesa->texture.heap[i] = NULL; - } - - foreach_s ( t, next_t, &rmesa->texture.swapped ) { - radeonDestroyTexObj( rmesa, t ); - } - } + release_texture_heaps = (rmesa->glCtx->Shared->RefCount == 1); _swsetup_DestroyContext( rmesa->glCtx ); _tnl_DestroyContext( rmesa->glCtx ); _ac_DestroyContext( rmesa->glCtx ); _swrast_DestroyContext( rmesa->glCtx ); radeonDestroySwtcl( rmesa->glCtx ); - radeonReleaseArrays( rmesa->glCtx, ~0 ); if (rmesa->dma.current.buf) { radeonReleaseDmaRegion( rmesa, &rmesa->dma.current, __FUNCTION__ ); @@ -590,74 +480,30 @@ rmesa->state.scissor.pClipRects = 0; } - FREE( rmesa ); - } - -#if 0 - /* Use this to force shared object profiling. */ - glx_fini_prof(); -#endif -} - - -/* Initialize the driver specific screen private data. - */ -static GLboolean -radeonInitDriver( __DRIscreenPrivate *sPriv ) -{ - sPriv->private = (void *) radeonCreateScreen( sPriv ); - if ( !sPriv->private ) { - radeonDestroyScreen( sPriv ); - return GL_FALSE; - } + if ( release_texture_heaps ) { + /* This share group is about to go away, free our private + * texture object data. + */ + int i; - return GL_TRUE; -} + for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { + driDestroyTextureHeap( rmesa->texture_heaps[ i ] ); + rmesa->texture_heaps[ i ] = NULL; + } + assert( is_empty_list( & rmesa->swapped ) ); + } -/* Create and initialize the Mesa and driver specific pixmap buffer - * data. - */ -static GLboolean -radeonCreateBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - const GLboolean swDepth = GL_FALSE; - const GLboolean swAlpha = GL_FALSE; - const GLboolean swAccum = mesaVis->accumRedBits > 0; - const GLboolean swStencil = mesaVis->stencilBits > 0 && - mesaVis->depthBits != 24; - driDrawPriv->driverPrivate = (void *) - _mesa_create_framebuffer( mesaVis, - swDepth, - swStencil, - swAccum, - swAlpha ); - return (driDrawPriv->driverPrivate != NULL); + FREE( rmesa ); } } -static void -radeonDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) -{ - _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate)); -} - -static void -radeonSwapBuffers(Display *dpy, void *drawablePrivate) +void +radeonSwapBuffers( __DRIdrawablePrivate *dPriv ) { - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - (void) dpy; if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { radeonContextPtr rmesa; @@ -665,7 +511,7 @@ rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate; ctx = rmesa->glCtx; if (ctx->Visual.doubleBufferMode) { - _mesa_swapbuffers( ctx ); /* flush pending rendering comands */ + _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ if ( rmesa->doPageFlip ) { radeonPageFlip( dPriv ); @@ -677,7 +523,7 @@ } else { /* XXX this shouldn't be an error but we can't handle it for now */ - _mesa_problem(NULL, "radeonSwapBuffers: drawable has no context!\n"); + _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__); } } @@ -685,39 +531,39 @@ /* Force the context `c' to be the current context and associate with it * buffer `b'. */ -static GLboolean +GLboolean radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, __DRIdrawablePrivate *driDrawPriv, __DRIdrawablePrivate *driReadPriv ) { if ( driContextPriv ) { - radeonContextPtr newRadeonCtx = + radeonContextPtr newCtx = (radeonContextPtr) driContextPriv->driverPrivate; if (RADEON_DEBUG & DEBUG_DRI) - fprintf(stderr, "%s ctx %p\n", __FUNCTION__, newRadeonCtx->glCtx); + fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)newCtx->glCtx); - if ( newRadeonCtx->dri.drawable != driDrawPriv ) { - newRadeonCtx->dri.drawable = driDrawPriv; - radeonUpdateWindow( newRadeonCtx->glCtx ); - radeonUpdateViewportOffset( newRadeonCtx->glCtx ); + if ( newCtx->dri.drawable != driDrawPriv ) { + newCtx->dri.drawable = driDrawPriv; + radeonUpdateWindow( newCtx->glCtx ); + radeonUpdateViewportOffset( newCtx->glCtx ); } - - _mesa_make_current2( newRadeonCtx->glCtx, + + _mesa_make_current2( newCtx->glCtx, (GLframebuffer *) driDrawPriv->driverPrivate, (GLframebuffer *) driReadPriv->driverPrivate ); - if ( !newRadeonCtx->glCtx->Viewport.Width ) { - _mesa_set_viewport( newRadeonCtx->glCtx, 0, 0, + if ( !newCtx->glCtx->Viewport.Width ) { + _mesa_set_viewport( newCtx->glCtx, 0, 0, driDrawPriv->w, driDrawPriv->h ); } - if (newRadeonCtx->vb.enabled) - radeonVtxfmtMakeCurrent( newRadeonCtx->glCtx ); + if (newCtx->vb.enabled) + radeonVtxfmtMakeCurrent( newCtx->glCtx ); } else { if (RADEON_DEBUG & DEBUG_DRI) - fprintf(stderr, "%s ctx %p\n", __FUNCTION__, NULL); + fprintf(stderr, "%s ctx is null\n", __FUNCTION__); _mesa_make_current( 0, 0 ); } @@ -728,68 +574,13 @@ /* Force the context `c' to be unbound from its buffer. */ -static GLboolean +GLboolean radeonUnbindContext( __DRIcontextPrivate *driContextPriv ) { radeonContextPtr rmesa = (radeonContextPtr) driContextPriv->driverPrivate; if (RADEON_DEBUG & DEBUG_DRI) - fprintf(stderr, "%s ctx %p\n", __FUNCTION__, rmesa->glCtx); + fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)rmesa->glCtx); - radeonVtxfmtUnbindContext( rmesa->glCtx ); return GL_TRUE; } - -/* Fullscreen mode isn't used for much -- could be a way to shrink - * front/back buffers & get more texture memory if the client has - * changed the video resolution. - * - * Pageflipping is now done automatically whenever there is a single - * 3d client. - */ -static GLboolean -radeonOpenCloseFullScreen( __DRIcontextPrivate *driContextPriv ) -{ - return GL_TRUE; -} - - - -/* This function is called by libGL.so as soon as libGL.so is loaded. - * This is where we'd register new extension functions with the dispatcher. - */ -void -__driRegisterExtensions( void ) -{ -} - - - -static struct __DriverAPIRec radeonAPI = { - radeonInitDriver, - radeonDestroyScreen, - radeonCreateContext, - radeonDestroyContext, - radeonCreateBuffer, - radeonDestroyBuffer, - radeonSwapBuffers, - radeonMakeCurrent, - radeonUnbindContext, - radeonOpenCloseFullScreen, - radeonOpenCloseFullScreen -}; - - - -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &radeonAPI); - return (void *) psp; -} Index: xc/lib/GL/mesa/src/drv/radeon/radeon_context.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_context.h:1.6 xc/lib/GL/mesa/src/drv/radeon/radeon_context.h:1.10 --- xc/lib/GL/mesa/src/drv/radeon/radeon_context.h:1.6 Mon Dec 16 11:18:58 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_context.h Fri Jan 23 14:09:33 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_context.h,v 1.6 2002/12/16 16:18:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_context.h,v 1.10 2004/01/23 19:09:33 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -39,11 +40,18 @@ #ifdef GLX_DIRECT_RENDERING +#include "dri_util.h" +#include "radeon_common.h" +#include "texmem.h" + +#include "macros.h" +#include "mtypes.h" +#include "colormac.h" + struct radeon_context; typedef struct radeon_context radeonContextRec; typedef struct radeon_context *radeonContextPtr; -#include "mtypes.h" #include "radeon_lock.h" #include "radeon_screen.h" #include "mm.h" @@ -57,6 +65,11 @@ #define RADEON_FALLBACK_BLEND_EQ 0x0010 #define RADEON_FALLBACK_BLEND_FUNC 0x0020 #define RADEON_FALLBACK_DISABLE 0x0040 +#define RADEON_FALLBACK_BORDER_MODE 0x0080 + +/* The blit width for texture uploads + */ +#define BLIT_WIDTH_BYTES 1024 /* Use the templated vertex format: */ @@ -122,18 +135,11 @@ /* Texture object in locally shared texture space. */ struct radeon_tex_obj { - radeonTexObjPtr next, prev; - - struct gl_texture_object *tObj; /* Mesa texture object */ + driTextureObject base; - PMemBlock memBlock; /* Memory block containing texture */ GLuint bufAddr; /* Offset to start of locally shared texture block */ - GLuint dirty_images; /* Flags for whether or not - images need to be uploaded to - local or AGP texture space */ - GLuint dirty_state; /* Flags (1 per texunit) for whether or not this texobj has dirty hardware state @@ -141,23 +147,19 @@ brought into the texunit. */ - GLint heap; /* Texture heap currently stored in */ - - drmRadeonTexImage image[RADEON_MAX_TEXTURE_LEVELS]; - - GLint totalSize; /* Total size of the texture - including all mipmap levels */ + drmRadeonTexImage image[6][RADEON_MAX_TEXTURE_LEVELS]; + /* Six, for the cube faces */ GLuint pp_txfilter; /* hardware register values */ GLuint pp_txformat; - GLuint pp_txoffset; + GLuint pp_txoffset; /* Image location in texmem. + All cube faces follow. */ + GLuint pp_txsize; /* npot only */ + GLuint pp_txpitch; /* npot only */ GLuint pp_border_color; + GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */ - /* texObj->Image[firstLevel] through texObj->Image[lastLevel] are the - * images to upload. - */ - GLint firstLevel; - GLint lastLevel; + GLboolean border_fallback; }; @@ -185,8 +187,8 @@ /* Trying to keep these relatively short as the variables are becoming - * extravagently long. Drop the RADEON_ off the front of everything - - * I think we know we're in the radeon driver by now, and keep the + * extravagently long. Drop the driver name prefix off the front of + * everything - I think we know which driver we're in by now, and keep the * prefix to 3 letters unless absolutely impossible. */ @@ -250,6 +252,11 @@ #define TEX_PP_BORDER_COLOR 8 #define TEX_STATE_SIZE 9 +#define TXR_CMD_0 0 /* rectangle textures */ +#define TXR_PP_TEX_SIZE 1 /* 0x1d04, 0x1d0c for NPOT! */ +#define TXR_PP_TEX_PITCH 2 /* 0x1d08, 0x1d10 for NPOT! */ +#define TXR_STATE_SIZE 3 + #define ZBS_CMD_0 0 #define ZBS_SE_ZBIAS_FACTOR 1 #define ZBS_SE_ZBIAS_CONSTANT 2 @@ -413,6 +420,7 @@ struct radeon_state_atom grd; /* guard band clipping */ struct radeon_state_atom fog; struct radeon_state_atom glt; + struct radeon_state_atom txr[2]; /* for NPOT */ }; struct radeon_state { @@ -427,15 +435,6 @@ struct radeon_texture_state texture; }; -struct radeon_texture { - radeonTexObj objects[RADEON_NR_TEX_HEAPS]; - radeonTexObj swapped; - - memHeap_t *heap[RADEON_NR_TEX_HEAPS]; - GLint age[RADEON_NR_TEX_HEAPS]; - - GLint numHeaps; -}; /* Need refcounting on dma buffers: */ @@ -444,7 +443,7 @@ drmBufPtr buf; }; -#define GET_START(rvb) (rmesa->radeonScreen->agp_buffer_offset + \ +#define GET_START(rvb) (rmesa->radeonScreen->gart_buffer_offset + \ (rvb)->address - rmesa->dma.buf0_address + \ (rvb)->start) @@ -474,8 +473,6 @@ }; struct radeon_dri_mirror { - Display *display; /* X server display */ - __DRIcontextPrivate *context; /* DRI context */ __DRIscreenPrivate *screen; /* DRI screen */ __DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */ @@ -529,7 +526,7 @@ GLuint vertex_size; GLuint vertex_stride_shift; GLuint vertex_format; - char *verts; + GLubyte *verts; /* Fallback rasterization functions */ @@ -594,8 +591,6 @@ struct dynfn MultiTexCoord1fvARB; }; -struct _vb; - struct dfn_generators { struct dynfn *(*Vertex2f)( GLcontext *, int ); struct dynfn *(*Vertex2fv)( GLcontext *, int ); @@ -626,9 +621,14 @@ }; -struct radeon_vb { - /* Keep these first: referenced from codegen templates: - */ + +struct radeon_prim { + GLuint start; + GLuint end; + GLuint prim; +}; + +struct radeon_vbinfo { GLint counter, initial_counter; GLint *dmaptr; void (*notify)( void ); @@ -653,23 +653,12 @@ radeon_color_t *specptr; GLfloat *texcoordptr[2]; - GLcontext *context; /* current context : Single thread only! */ -}; - -struct radeon_prim { - GLuint start; - GLuint end; - GLuint prim; -}; - -struct radeon_vbinfo { GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */ GLuint primflags; - GLboolean enabled; /* RADEON_NO_VTXFMT//RADEON_NO_TCL env vars */ + GLboolean enabled; /* *_NO_VTXFMT / *_NO_TCL env vars */ GLboolean installed; GLboolean fell_back; GLboolean recheck; - GLint initial_counter; GLint nrverts; GLuint vertex_format; @@ -697,7 +686,9 @@ /* Texture object bookkeeping */ - struct radeon_texture texture; + unsigned nr_heaps; + driTexHeap * texture_heaps[ RADEON_NR_TEX_HEAPS ]; + driTextureObject swapped; /* Rasterization and vertex state: @@ -751,6 +742,15 @@ /* VBI */ GLuint vbl_seq; + GLuint vblank_flags; + + int64_t swap_ust; + int64_t swap_missed_ust; + + GLuint swap_count; + GLuint swap_missed_count; + + PFNGLXGETUSTPROC get_ust; /* radeon_tcl.c */ @@ -799,6 +799,17 @@ #define RADEON_OLD_PACKETS 1 + +extern void radeonDestroyContext( __DRIcontextPrivate *driContextPriv ); +extern GLboolean radeonCreateContext(const __GLcontextModes *glVisual, + __DRIcontextPrivate *driContextPriv, + void *sharedContextPrivate); +extern void radeonSwapBuffers( __DRIdrawablePrivate *dPriv ); +extern GLboolean radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, + __DRIdrawablePrivate *driDrawPriv, + __DRIdrawablePrivate *driReadPriv ); +extern GLboolean radeonUnbindContext( __DRIcontextPrivate *driContextPriv ); + /* ================================================================ * Debugging: */ Index: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c:1.11 xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c:1.15 --- xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c:1.11 Wed Jan 29 17:04:59 2003 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c Thu Jan 22 22:57:06 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c,v 1.11 2003/01/29 22:04:59 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c,v 1.15 2004/01/23 03:57:06 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -32,32 +33,27 @@ * Kevin E. Martin * Gareth Hughes * Keith Whitwell - * */ +#include "glheader.h" +#include "imports.h" +#include "simple_list.h" +#include "swrast/swrast.h" + #include "radeon_context.h" #include "radeon_state.h" #include "radeon_ioctl.h" #include "radeon_tcl.h" #include "radeon_sanity.h" +#define STANDALONE_MMIO #include "radeon_macros.h" /* for INREG() */ -#include "mem.h" -#include "macros.h" -#include "swrast/swrast.h" -#include "simple_list.h" +#include "vblank.h" #define RADEON_TIMEOUT 512 #define RADEON_IDLE_RETRY 16 -#include /* for usleep() */ - -static void do_usleep( int nr, const char *caller ) -{ - if (0) fprintf(stderr, "usleep %d in %s\n", nr, caller ); - if (1) usleep( nr ); -} static void radeonWaitForIdle( radeonContextPtr rmesa ); @@ -165,7 +161,6 @@ drmRadeonCmdHeader *cmd; - assert(rmesa->dri.drmMinor >= 3); assert(!(primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND)); radeonEmitState( rmesa ); @@ -257,7 +252,6 @@ if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s %d\n", __FUNCTION__, min_nr); - assert(rmesa->dri.drmMinor >= 3); assert((primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND)); radeonEmitState( rmesa ); @@ -301,6 +295,7 @@ cmd[1].i, vertex_format, primitive); assert(!rmesa->dma.flush); + rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; rmesa->dma.flush = radeonFlushElts; rmesa->store.elts_start = ((char *)cmd) - rmesa->store.cmd_buf; @@ -319,7 +314,6 @@ rmesa->ioctl.vertex_offset = offset; #else drmRadeonCmdHeader *cmd; - assert(rmesa->dri.drmMinor >= 3); if (RADEON_DEBUG & (DEBUG_PRIMS|DEBUG_IOCTL)) fprintf(stderr, "%s: vertex_size 0x%x offset 0x%x \n", @@ -358,7 +352,6 @@ if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s\n", __FUNCTION__); - assert(rmesa->dri.drmMinor >= 3); cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa, sz * sizeof(int), __FUNCTION__ ); @@ -393,6 +386,73 @@ #endif } +/* using already shifted color_fmt! */ +void radeonEmitBlit( radeonContextPtr rmesa, /* FIXME: which drmMinor is required? */ + GLuint color_fmt, + GLuint src_pitch, + GLuint src_offset, + GLuint dst_pitch, + GLuint dst_offset, + GLint srcx, GLint srcy, + GLint dstx, GLint dsty, + GLuint w, GLuint h ) +{ + drmRadeonCmdHeader *cmd; + + if (RADEON_DEBUG & DEBUG_IOCTL) + fprintf(stderr, "%s src %x/%x %d,%d dst: %x/%x %d,%d sz: %dx%d\n", + __FUNCTION__, + src_pitch, src_offset, srcx, srcy, + dst_pitch, dst_offset, dstx, dsty, + w, h); + + assert( (src_pitch & 63) == 0 ); + assert( (dst_pitch & 63) == 0 ); + assert( (src_offset & 1023) == 0 ); + assert( (dst_offset & 1023) == 0 ); + assert( w < (1<<16) ); + assert( h < (1<<16) ); + + cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa, 8 * sizeof(int), + __FUNCTION__ ); + + + cmd[0].i = 0; + cmd[0].header.cmd_type = RADEON_CMD_PACKET3; + cmd[1].i = RADEON_CP_PACKET3_CNTL_BITBLT_MULTI | (5 << 16); + cmd[2].i = (RADEON_GMC_SRC_PITCH_OFFSET_CNTL | + RADEON_GMC_DST_PITCH_OFFSET_CNTL | + RADEON_GMC_BRUSH_NONE | + color_fmt | + RADEON_GMC_SRC_DATATYPE_COLOR | + RADEON_ROP3_S | + RADEON_DP_SRC_SOURCE_MEMORY | + RADEON_GMC_CLR_CMP_CNTL_DIS | + RADEON_GMC_WR_MSK_DIS ); + + cmd[3].i = ((src_pitch/64)<<22) | (src_offset >> 10); + cmd[4].i = ((dst_pitch/64)<<22) | (dst_offset >> 10); + cmd[5].i = (srcx << 16) | srcy; + cmd[6].i = (dstx << 16) | dsty; /* dst */ + cmd[7].i = (w << 16) | h; +} + + +void radeonEmitWait( radeonContextPtr rmesa, GLuint flags ) +{ + if (rmesa->dri.drmMinor >= 6) { + drmRadeonCmdHeader *cmd; + + assert( !(flags & ~(RADEON_WAIT_2D|RADEON_WAIT_3D)) ); + + cmd = (drmRadeonCmdHeader *)radeonAllocCmdBuf( rmesa, 1 * sizeof(int), + __FUNCTION__ ); + cmd[0].i = 0; + cmd[0].wait.cmd_type = RADEON_CMD_WAIT; + cmd[0].wait.flags = flags; + } +} + static int radeonFlushCmdBufLocked( radeonContextPtr rmesa, const char * caller ) @@ -423,8 +483,13 @@ ret = radeonSanityCmdBuffer( rmesa, rmesa->numClipRects, rmesa->pClipRects); + if (ret) { + fprintf(stderr, "drmSanityCommandWrite: %d\n", ret); + goto out; + } } + cmd.bufsz = rmesa->store.cmd_used; cmd.buf = rmesa->store.cmd_buf; @@ -440,6 +505,10 @@ DRM_RADEON_CMDBUF, &cmd, sizeof(cmd) ); + if (ret) + fprintf(stderr, "drmCommandWrite: %d\n", ret); + + out: rmesa->store.primnr = 0; rmesa->store.statenr = 0; rmesa->store.cmd_used = 0; @@ -457,8 +526,6 @@ int ret; - assert (rmesa->dri.drmMinor >= 3); - LOCK_HARDWARE( rmesa ); ret = radeonFlushCmdBufLocked( rmesa, caller ); @@ -466,12 +533,11 @@ UNLOCK_HARDWARE( rmesa ); if (ret) { - fprintf(stderr, "drmRadeonCmdBuffer: %d\n", ret); + fprintf(stderr, "drmRadeonCmdBuffer: %d (exiting)\n", ret); exit(ret); } } - /* ============================================================= * Hardware vertex buffer handling */ @@ -618,9 +684,6 @@ rmesa->dma.current.ptr += bytes; /* bug - if alignment > 7 */ rmesa->dma.current.start = rmesa->dma.current.ptr = (rmesa->dma.current.ptr + 0x7) & ~0x7; - - if ( rmesa->dri.drmMinor < 3 ) - radeonRefillCurrentDmaRegion( rmesa ); } void radeonAllocDmaRegionVerts( radeonContextPtr rmesa, @@ -653,12 +716,10 @@ else ret = -EINVAL; -#ifndef __alpha__ if ( ret == -EINVAL ) { frame = INREG( RADEON_LAST_FRAME_REG ); ret = 0; } -#endif if ( ret ) { fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret ); exit(1); @@ -725,7 +786,7 @@ while (radeonGetLastFrame (rmesa) < sarea->last_frame) { UNLOCK_HARDWARE( rmesa ); if (rmesa->do_usleeps) - do_usleep(1, __FUNCTION__); + DO_USLEEP( 1 ); LOCK_HARDWARE( rmesa ); } } @@ -737,6 +798,8 @@ { radeonContextPtr rmesa; GLint nbox, i, ret; + GLboolean missed_target; + int64_t ust; assert(dPriv); assert(dPriv->driContextPriv); @@ -745,25 +808,25 @@ rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate; if ( RADEON_DEBUG & DEBUG_IOCTL ) { - fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, rmesa->glCtx ); + fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, (void *)rmesa->glCtx ); } RADEON_FIREVERTICES( rmesa ); - LOCK_HARDWARE( rmesa ); - /* Throttle the frame rate -- only allow one pending swap buffers * request at a time. */ radeonWaitForFrameCompletion( rmesa ); - radeonWaitForVBlank( rmesa ); + UNLOCK_HARDWARE( rmesa ); + driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); + LOCK_HARDWARE( rmesa ); - nbox = rmesa->dri.drawable->numClipRects; /* must be in locked region */ + nbox = dPriv->numClipRects; /* must be in locked region */ for ( i = 0 ; i < nbox ; ) { GLint nr = MIN2( i + RADEON_NR_SAREA_CLIPRECTS , nbox ); - XF86DRIClipRectPtr box = rmesa->dri.drawable->pClipRects; + XF86DRIClipRectPtr box = dPriv->pClipRects; XF86DRIClipRectPtr b = rmesa->sarea->boxes; GLint n = 0; @@ -783,12 +846,21 @@ } UNLOCK_HARDWARE( rmesa ); + rmesa->swap_count++; + (*rmesa->get_ust)( & ust ); + if ( missed_target ) { + rmesa->swap_missed_count++; + rmesa->swap_missed_ust = ust - rmesa->swap_ust; + } + + rmesa->swap_ust = ust; } void radeonPageFlip( const __DRIdrawablePrivate *dPriv ) { radeonContextPtr rmesa; GLint ret; + GLboolean missed_target; assert(dPriv); assert(dPriv->driContextPriv); @@ -797,30 +869,34 @@ rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate; if ( RADEON_DEBUG & DEBUG_IOCTL ) { - fprintf(stderr, "%s %d\n", __FUNCTION__, - rmesa->sarea->pfCurrentPage ); + fprintf(stderr, "%s: pfCurrentPage: %d\n", __FUNCTION__, + rmesa->sarea->pfCurrentPage); } RADEON_FIREVERTICES( rmesa ); - LOCK_HARDWARE( rmesa ); /* Need to do this for the perf box placement: */ - if (rmesa->dri.drawable->numClipRects) + if (dPriv->numClipRects) { - XF86DRIClipRectPtr box = rmesa->dri.drawable->pClipRects; + XF86DRIClipRectPtr box = dPriv->pClipRects; XF86DRIClipRectPtr b = rmesa->sarea->boxes; b[0] = box[0]; rmesa->sarea->nbox = 1; } - - /* Throttle the frame rate -- only allow one pending swap buffers + /* Throttle the frame rate -- only allow a few pending swap buffers * request at a time. */ radeonWaitForFrameCompletion( rmesa ); - radeonWaitForVBlank( rmesa ); + UNLOCK_HARDWARE( rmesa ); + driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); + if ( missed_target ) { + rmesa->swap_missed_count++; + (void) (*rmesa->get_ust)( & rmesa->swap_missed_ust ); + } + LOCK_HARDWARE( rmesa ); ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_FLIP ); @@ -831,6 +907,9 @@ exit( 1 ); } + rmesa->swap_count++; + (void) (*rmesa->get_ust)( & rmesa->swap_ust ); + if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset; rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch; @@ -840,7 +919,8 @@ } RADEON_STATECHANGE( rmesa, ctx ); - rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset; + rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset + + rmesa->radeonScreen->fbLocation; rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch; } @@ -896,8 +976,11 @@ mask &= ~DD_STENCIL_BIT; } - if ( mask ) + if ( mask ) { + if (RADEON_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask); _swrast_Clear( ctx, mask, all, cx, cy, cw, ch ); + } if ( !flags ) return; @@ -924,12 +1007,10 @@ } else ret = -EINVAL; -#ifndef __alpha__ if ( ret == -EINVAL ) { clear = INREG( RADEON_LAST_CLEAR_REG ); ret = 0; } -#endif if ( ret ) { fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret ); exit(1); @@ -945,7 +1026,7 @@ if ( rmesa->do_usleeps ) { UNLOCK_HARDWARE( rmesa ); - do_usleep(1, __FUNCTION__); + DO_USLEEP( 1 ); LOCK_HARDWARE( rmesa ); } } @@ -1032,14 +1113,6 @@ do { ret = drmCommandNone( fd, DRM_RADEON_CP_IDLE); } while ( ret && errno == EBUSY && i++ < RADEON_IDLE_RETRY ); - if (ret && ret != -EBUSY) { - /* - * JO - I'm reluctant to print this message while holding the lock - * - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "%s: CP idle %d\n", __FUNCTION__, ret); - */ - } } while ( ( ret == -EBUSY ) && ( to++ < RADEON_TIMEOUT ) ); if ( ret < 0 ) { @@ -1052,47 +1125,12 @@ static void radeonWaitForIdle( radeonContextPtr rmesa ) { - LOCK_HARDWARE(rmesa); - radeonWaitForIdleLocked( rmesa ); - UNLOCK_HARDWARE(rmesa); + LOCK_HARDWARE(rmesa); + radeonWaitForIdleLocked( rmesa ); + UNLOCK_HARDWARE(rmesa); } -void radeonWaitForVBlank( radeonContextPtr rmesa ) -{ - drmVBlank vbl; - int ret; - - if ( !rmesa->radeonScreen->irq ) - return; - - if ( getenv("LIBGL_SYNC_REFRESH") ) { - /* Wait for at least one vertical blank since the last call */ - vbl.request.type = DRM_VBLANK_RELATIVE; - vbl.request.sequence = 1; - } else if ( getenv("LIBGL_THROTTLE_REFRESH") ) { - /* Wait for at least one vertical blank since the last call */ - vbl.request.type = DRM_VBLANK_ABSOLUTE; - vbl.request.sequence = rmesa->vbl_seq + 1; - } else { - return; - } - - UNLOCK_HARDWARE( rmesa ); - - if ((ret = drmWaitVBlank( rmesa->dri.fd, &vbl ))) { - fprintf(stderr, "%s: drmWaitVBlank returned %d, IRQs don't seem to be" - " working correctly.\nTry running with LIBGL_THROTTLE_REFRESH" - " and LIBL_SYNC_REFRESH unset.\n", __FUNCTION__, ret); - exit(1); - } else if (RADEON_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "%s: drmWaitVBlank returned %d\n", __FUNCTION__, ret); - - rmesa->vbl_seq = vbl.reply.sequence; - - LOCK_HARDWARE( rmesa ); -} - void radeonFlush( GLcontext *ctx ) { radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); @@ -1103,13 +1141,11 @@ if (rmesa->dma.flush) rmesa->dma.flush( rmesa ); - if (rmesa->dri.drmMinor >= 3) { - if (!is_empty_list(&rmesa->hw.dirty)) - radeonEmitState( rmesa ); + if (!is_empty_list(&rmesa->hw.dirty)) + radeonEmitState( rmesa ); - if (rmesa->store.cmd_used) - radeonFlushCmdBuf( rmesa, __FUNCTION__ ); - } + if (rmesa->store.cmd_used) + radeonFlushCmdBuf( rmesa, __FUNCTION__ ); } /* Make sure all commands have been sent to the hardware and have Index: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h:1.6 xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h:1.8 --- xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h:1.6 Mon Dec 16 11:18:58 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h Fri Oct 24 11:25:07 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h,v 1.6 2002/12/16 16:18:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.h,v 1.8 2003/10/24 15:25:07 tsi Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -31,7 +32,6 @@ * Authors: * Kevin E. Martin * Gareth Hughes - * */ #ifndef __RADEON_IOCTL_H__ @@ -65,7 +65,17 @@ GLuint n, GLuint offset ); +extern void radeonEmitBlit( radeonContextPtr rmesa, + GLuint color_fmt, + GLuint src_pitch, + GLuint src_offset, + GLuint dst_pitch, + GLuint dst_offset, + GLint srcx, GLint srcy, + GLint dstx, GLint dsty, + GLuint w, GLuint h ); +extern void radeonEmitWait( radeonContextPtr rmesa, GLuint flags ); extern void radeonFlushCmdBuf( radeonContextPtr rmesa, const char * ); extern void radeonRefillCurrentDmaRegion( radeonContextPtr rmesa ); @@ -94,14 +104,6 @@ extern void radeonInitIoctlFuncs( GLcontext *ctx ); extern void radeonGetAllParams( radeonContextPtr rmesa ); -/* radeon_compat.c: - */ -extern void radeonCompatEmitPrimitive( radeonContextPtr rmesa, - GLuint vertex_format, - GLuint hw_primitive, - GLuint nrverts ); - - /* ================================================================ * Helper macros: */ Index: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c:1.5 xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c:1.7 --- xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c:1.5 Wed Oct 30 07:51:55 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c Tue Dec 2 08:02:39 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c,v 1.5 2002/10/30 12:51:55 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c,v 1.7 2003/12/02 13:02:39 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -31,9 +32,9 @@ * Authors: * Kevin E. Martin * Gareth Hughes - * */ +#include "glheader.h" #include "radeon_context.h" #include "radeon_lock.h" #include "radeon_tex.h" @@ -52,12 +53,10 @@ { int use_back; - if (rmesa->dri.drmMinor < 3) - return; rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip; - use_back = (rmesa->glCtx->Color.DriverDrawBuffer == GL_BACK_LEFT); + use_back = (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT); use_back ^= (rmesa->sarea->pfCurrentPage == 1); if ( RADEON_DEBUG & DEBUG_VERBOSE ) @@ -74,7 +73,8 @@ } RADEON_STATECHANGE( rmesa, ctx ); - rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset; + rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset + + rmesa->radeonScreen->fbLocation; rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch; } @@ -93,7 +93,6 @@ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; __DRIscreenPrivate *sPriv = rmesa->dri.screen; RADEONSAREAPrivPtr sarea = rmesa->sarea; - int i; drmGetLock( rmesa->dri.fd, rmesa->dri.hwContext, flags ); @@ -105,22 +104,24 @@ * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO( rmesa->dri.display, sPriv, dPriv ); + DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); if ( rmesa->lastStamp != dPriv->lastStamp ) { radeonUpdatePageFlipping( rmesa ); - radeonSetCliprects( rmesa, rmesa->glCtx->Color.DriverDrawBuffer ); + if (rmesa->glCtx->Color._DrawDestMask == BACK_LEFT_BIT) + radeonSetCliprects( rmesa, GL_BACK_LEFT ); + else + radeonSetCliprects( rmesa, GL_FRONT_LEFT ); radeonUpdateViewportOffset( rmesa->glCtx ); rmesa->lastStamp = dPriv->lastStamp; } if ( sarea->ctxOwner != rmesa->dri.hwContext ) { + int i; sarea->ctxOwner = rmesa->dri.hwContext; - for ( i = 0 ; i < rmesa->texture.numHeaps ; i++ ) { - if ( rmesa->texture.heap[i] && sarea->texAge[i] != rmesa->texture.age[i] ) { - radeonAgeTextures( rmesa, i ); - } + for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { + DRI_AGE_TEXTURES( rmesa->texture_heaps[ i ] ); } } } Index: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h:1.3 xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h:1.4 --- xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h:1.3 Wed Oct 30 07:51:55 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h Sun Sep 28 16:15:28 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h,v 1.3 2002/10/30 12:51:55 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h,v 1.4 2003/09/28 20:15:28 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -31,7 +32,6 @@ * Authors: * Kevin E. Martin * Gareth Hughes - * */ #ifndef __RADEON_LOCK_H__ Index: xc/lib/GL/mesa/src/drv/radeon/radeon_maos.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_maos.h:1.1 xc/lib/GL/mesa/src/drv/radeon/radeon_maos.h:1.2 --- xc/lib/GL/mesa/src/drv/radeon/radeon_maos.h:1.1 Wed Oct 30 07:51:55 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_maos.h Sun Sep 28 16:15:28 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos.h,v 1.1 2002/10/30 12:51:55 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos.h,v 1.2 2003/09/28 20:15:28 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,31 +6,31 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAHPICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Keith Whitwell - * */ #ifndef __RADEON_MAOS_H__ Index: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c:1.1 xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c:1.2 --- xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c:1.1 Wed Oct 30 07:51:55 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c Sun Sep 28 16:15:28 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c,v 1.1 2002/10/30 12:51:55 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_arrays.c,v 1.2 2003/09/28 20:15:28 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,37 +6,36 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Keith Whitwell - * */ #include "glheader.h" +#include "imports.h" #include "mtypes.h" -#include "colormac.h" -#include "mem.h" #include "mmath.h" #include "macros.h" @@ -262,7 +261,8 @@ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size); + fprintf(stderr, "%s count %d size %d stride %d\n", + __FUNCTION__, count, size, stride); assert (!rvb->buf); @@ -409,7 +409,7 @@ -/* Emit any changed arrays to new agp memory, re-emit a packet to +/* Emit any changed arrays to new GART memory, re-emit a packet to * update the arrays. */ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) @@ -444,7 +444,7 @@ } - if (inputs & VERT_NORM) { + if (inputs & VERT_BIT_NORMAL) { if (!rmesa->tcl.norm.buf) emit_vector( ctx, &(rmesa->tcl.norm), @@ -457,7 +457,7 @@ component[nr++] = &rmesa->tcl.norm; } - if (inputs & VERT_RGBA) { + if (inputs & VERT_BIT_COLOR0) { if (VB->ColorPtr[0]->Type == GL_UNSIGNED_BYTE) { if (!rmesa->tcl.rgba.buf) emit_ubyte_rgba( ctx, @@ -483,7 +483,6 @@ emitsize = 3; } - if (!rmesa->tcl.rgba.buf) emit_vector( ctx, &(rmesa->tcl.rgba), @@ -497,7 +496,7 @@ } - if (inputs & VERT_SPEC_RGB) { + if (inputs & VERT_BIT_COLOR1) { if (!rmesa->tcl.spec.buf) { if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE) radeon_import_float_spec_colors( ctx ); @@ -517,7 +516,7 @@ vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] & ~(RADEON_TCL_VTX_Q0|RADEON_TCL_VTX_Q1)); - if (inputs & VERT_TEX0) { + if (inputs & VERT_BIT_TEX0) { if (!rmesa->tcl.tex[0].buf) emit_tex_vector( ctx, &(rmesa->tcl.tex[0]), @@ -536,7 +535,7 @@ component[nr++] = &rmesa->tcl.tex[0]; } - if (inputs & VERT_TEX1) { + if (inputs & VERT_BIT_TEX1) { if (!rmesa->tcl.tex[1].buf) emit_tex_vector( ctx, &(rmesa->tcl.tex[1]), @@ -572,21 +571,21 @@ if (RADEON_DEBUG & DEBUG_VERTS) _tnl_print_vert_flags( __FUNCTION__, newinputs ); - if (newinputs & VERT_OBJ) + if (newinputs & VERT_BIT_POS) radeonReleaseDmaRegion( rmesa, &rmesa->tcl.obj, __FUNCTION__ ); - if (newinputs & VERT_NORM) + if (newinputs & VERT_BIT_NORMAL) radeonReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ ); - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) radeonReleaseDmaRegion( rmesa, &rmesa->tcl.rgba, __FUNCTION__ ); - if (newinputs & VERT_SPEC_RGB) + if (newinputs & VERT_BIT_COLOR1) radeonReleaseDmaRegion( rmesa, &rmesa->tcl.spec, __FUNCTION__ ); - if (newinputs & VERT_TEX0) + if (newinputs & VERT_BIT_TEX0) radeonReleaseDmaRegion( rmesa, &rmesa->tcl.tex[0], __FUNCTION__ ); - if (newinputs & VERT_TEX1) + if (newinputs & VERT_BIT_TEX1) radeonReleaseDmaRegion( rmesa, &rmesa->tcl.tex[1], __FUNCTION__ ); } Index: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_vbtmp.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_maos_vbtmp.h:1.1 xc/lib/GL/mesa/src/drv/radeon/radeon_maos_vbtmp.h:1.2 --- xc/lib/GL/mesa/src/drv/radeon/radeon_maos_vbtmp.h:1.1 Wed Oct 30 07:51:55 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_maos_vbtmp.h Sun Sep 28 16:15:28 2003 @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -39,21 +39,20 @@ void *dest ) { LOCALVARS - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLuint (*tc0)[4], (*tc1)[4]; - GLfloat *fog; - GLuint (*tc2)[4], (*norm)[3]; + struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; + GLuint (*tc0)[4], (*tc1)[4], (*tc2)[4]; + GLfloat (*fog)[4]; + GLuint (*norm)[4]; GLubyte (*col)[4], (*spec)[4]; GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride; GLuint tc2_stride, norm_stride; GLuint (*coord)[4]; - GLuint coord_stride; + GLuint coord_stride; /* object coordinates */ GLubyte dummy[4]; int i; union emit_union *v = (union emit_union *)dest; - if (RADEON_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s\n", __FUNCTION__); @@ -63,14 +62,14 @@ */ if (VB->ObjPtr->size < 3) { if (VB->ObjPtr->flags & VEC_NOT_WRITEABLE) { - VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE ); + VB->import_data( ctx, VERT_BIT_POS, VEC_NOT_WRITEABLE ); } _mesa_vector4f_clean_elem( VB->ObjPtr, VB->Count, 2 ); } if (DO_W && VB->ObjPtr->size < 4) { if (VB->ObjPtr->flags & VEC_NOT_WRITEABLE) { - VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE ); + VB->import_data( ctx, VERT_BIT_POS, VEC_NOT_WRITEABLE ); } _mesa_vector4f_clean_elem( VB->ObjPtr, VB->Count, 3 ); } @@ -84,7 +83,7 @@ tc2_stride = VB->TexCoordPtr[t2]->stride; if (DO_PTEX && VB->TexCoordPtr[t2]->size < 4) { if (VB->TexCoordPtr[t2]->flags & VEC_NOT_WRITEABLE) { - VB->import_data( ctx, VERT_TEX2, VEC_NOT_WRITEABLE ); + VB->import_data( ctx, VERT_BIT_TEX2, VEC_NOT_WRITEABLE ); } _mesa_vector4f_clean_elem( VB->TexCoordPtr[t2], VB->Count, 3 ); } @@ -97,12 +96,12 @@ tc1_stride = VB->TexCoordPtr[t1]->stride; if (DO_PTEX && VB->TexCoordPtr[t1]->size < 4) { if (VB->TexCoordPtr[t1]->flags & VEC_NOT_WRITEABLE) { - VB->import_data( ctx, VERT_TEX1, VEC_NOT_WRITEABLE ); + VB->import_data( ctx, VERT_BIT_TEX1, VEC_NOT_WRITEABLE ); } _mesa_vector4f_clean_elem( VB->TexCoordPtr[t1], VB->Count, 3 ); } } else { - tc1 = (GLuint (*)[4])&ctx->Current.Texcoord[1]; /* could be anything, really */ + tc1 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX1]; /* could be anything, really */ tc1_stride = 0; } } @@ -114,12 +113,12 @@ tc0 = (GLuint (*)[4])VB->TexCoordPtr[t0]->data; if (DO_PTEX && VB->TexCoordPtr[t0]->size < 4) { if (VB->TexCoordPtr[t0]->flags & VEC_NOT_WRITEABLE) { - VB->import_data( ctx, VERT_TEX0, VEC_NOT_WRITEABLE ); + VB->import_data( ctx, VERT_BIT_TEX0, VEC_NOT_WRITEABLE ); } _mesa_vector4f_clean_elem( VB->TexCoordPtr[t0], VB->Count, 3 ); } } else { - tc0 = (GLuint (*)[4])&ctx->Current.Texcoord[0]; /* could be anything, really */ + tc0 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX0]; /* could be anything, really */ tc0_stride = 0; } @@ -128,10 +127,10 @@ if (DO_NORM) { if (VB->NormalPtr) { norm_stride = VB->NormalPtr->stride; - norm = (GLuint (*)[3])VB->NormalPtr->data; + norm = (GLuint (*)[4])VB->NormalPtr->data; } else { norm_stride = 0; - norm = (GLuint (*)[3])&ctx->Current.Normal; + norm = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; } } @@ -149,7 +148,6 @@ col = &dummy; /* any old memory is fine */ col_stride = 0; } - } if (DO_SPEC) { @@ -162,7 +160,6 @@ spec = &dummy; spec_stride = 0; } - } if (DO_FOG) { @@ -170,10 +167,9 @@ fog = VB->FogCoordPtr->data; fog_stride = VB->FogCoordPtr->stride; } else { - fog = (GLfloat *)&dummy; *fog = 0; + fog = (GLfloat (*)[4])&dummy; fog[0][0] = 0.0F; fog_stride = 0; } - } @@ -187,13 +183,13 @@ if (DO_TEX2) tc2 = (GLuint (*)[4])((GLubyte *)tc2 + start * tc2_stride); if (DO_NORM) - norm = (GLuint (*)[3])((GLubyte *)norm + start * norm_stride); + norm = (GLuint (*)[4])((GLubyte *)norm + start * norm_stride); if (DO_RGBA) STRIDE_4UB(col, start * col_stride); if (DO_SPEC) STRIDE_4UB(spec, start * spec_stride); if (DO_FOG) - STRIDE_F(fog, start * fog_stride); + fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride); } for (i=start; i < end; i++) { @@ -216,7 +212,7 @@ v[2].ui = norm[0][2]; if (TCL_DEBUG) fprintf(stderr, "norm: %.2f %.2f %.2f ", v[0].f, v[1].f, v[2].f); v += 3; - norm = (GLuint (*)[3])((GLubyte *)norm + norm_stride); + norm = (GLuint (*)[4])((GLubyte *)norm + norm_stride); } if (DO_RGBA) { v[0].ui = LE32_TO_CPU(*(GLuint *)&col[0]); @@ -232,8 +228,8 @@ STRIDE_4UB(spec, spec_stride); } if (DO_FOG) { - v[0].specular.alpha = fog[0] * 255.0; - STRIDE_F(fog, fog_stride); + v[0].specular.alpha = fog[0][0] * 255.0; + fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride); } if (TCL_DEBUG) fprintf(stderr, "%x ", v[0].ui); v++; @@ -306,7 +302,8 @@ v[0].specular.blue = spec[i][2]; } if (DO_FOG) { - v[0].specular.alpha = fog[i] * 255.0; + GLfloat *f = (GLfloat *) ((GLubyte *)fog + fog_stride); + v[0].specular.alpha = *f * 255.0; } v++; } Index: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c:1.1 xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c:1.2 --- xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c:1.1 Wed Oct 30 07:51:55 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c Sun Sep 28 16:15:28 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c,v 1.1 2002/10/30 12:51:55 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_maos_verts.c,v 1.2 2003/09/28 20:15:28 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,33 +6,42 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Keith Whitwell - * */ +#include "glheader.h" +#include "imports.h" +#include "mtypes.h" + +#include "array_cache/acache.h" +#include "tnl/tnl.h" +#include "tnl/t_pipeline.h" +#include "tnl/t_imm_debug.h" + #include "radeon_context.h" #include "radeon_state.h" #include "radeon_ioctl.h" @@ -41,16 +50,6 @@ #include "radeon_swtcl.h" #include "radeon_maos.h" -#include "mmath.h" -#include "mtypes.h" -#include "enums.h" -#include "colormac.h" -#include "light.h" - -#include "array_cache/acache.h" -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" -#include "tnl/t_imm_debug.h" #define RADEON_TCL_MAX_SETUP 13 @@ -257,19 +256,19 @@ } } - if (inputs & VERT_NORM) { + if (inputs & VERT_BIT_NORMAL) { req |= RADEON_CP_VC_FRMT_N0; } - if (inputs & VERT_RGBA) { + if (inputs & VERT_BIT_COLOR0) { req |= RADEON_CP_VC_FRMT_PKCOLOR; } - if (inputs & VERT_SPEC_RGB) { + if (inputs & VERT_BIT_COLOR1) { req |= RADEON_CP_VC_FRMT_PKSPEC; } - if (inputs & VERT_TEX0) { + if (inputs & VERT_BIT_TEX0) { req |= RADEON_CP_VC_FRMT_ST0; if (VB->TexCoordPtr[0]->size == 4) { @@ -278,7 +277,7 @@ } } - if (inputs & VERT_TEX1) { + if (inputs & VERT_BIT_TEX1) { req |= RADEON_CP_VC_FRMT_ST1; if (VB->TexCoordPtr[1]->size == 4) { Index: xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c:1.1 xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c:1.2 --- xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c:1.1 Wed Oct 30 07:51:55 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c Sun Sep 28 16:15:28 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c,v 1.1 2002/10/30 12:51:55 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_sanity.c,v 1.2 2003/09/28 20:15:28 alanh Exp $ */ /************************************************************************** Copyright 2002 ATI Technologies Inc., Ontario, Canada, and @@ -33,6 +33,8 @@ * */ +#include "glheader.h" + #include "radeon_context.h" #include "radeon_ioctl.h" #include "radeon_sanity.h" @@ -80,6 +82,61 @@ { RADEON_SE_ZBIAS_FACTOR,2,"RADEON_SE_ZBIAS_FACTOR" }, { RADEON_SE_TCL_OUTPUT_VTX_FMT,11,"RADEON_SE_TCL_OUTPUT_VTX_FMT" }, { RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED,17,"RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED" }, + { 0, 4, "R200_PP_TXCBLEND_0" }, + { 0, 4, "R200_PP_TXCBLEND_1" }, + { 0, 4, "R200_PP_TXCBLEND_2" }, + { 0, 4, "R200_PP_TXCBLEND_3" }, + { 0, 4, "R200_PP_TXCBLEND_4" }, + { 0, 4, "R200_PP_TXCBLEND_5" }, + { 0, 4, "R200_PP_TXCBLEND_6" }, + { 0, 4, "R200_PP_TXCBLEND_7" }, + { 0, 6, "R200_SE_TCL_LIGHT_MODEL_CTL_0" }, + { 0, 6, "R200_PP_TFACTOR_0" }, + { 0, 4, "R200_SE_VTX_FMT_0" }, + { 0, 1, "R200_SE_VAP_CNTL" }, + { 0, 5, "R200_SE_TCL_MATRIX_SEL_0" }, + { 0, 5, "R200_SE_TCL_TEX_PROC_CTL_2" }, + { 0, 1, "R200_SE_TCL_UCP_VERT_BLEND_CTL" }, + { 0, 6, "R200_PP_TXFILTER_0" }, + { 0, 6, "R200_PP_TXFILTER_1" }, + { 0, 6, "R200_PP_TXFILTER_2" }, + { 0, 6, "R200_PP_TXFILTER_3" }, + { 0, 6, "R200_PP_TXFILTER_4" }, + { 0, 6, "R200_PP_TXFILTER_5" }, + { 0, 1, "R200_PP_TXOFFSET_0" }, + { 0, 1, "R200_PP_TXOFFSET_1" }, + { 0, 1, "R200_PP_TXOFFSET_2" }, + { 0, 1, "R200_PP_TXOFFSET_3" }, + { 0, 1, "R200_PP_TXOFFSET_4" }, + { 0, 1, "R200_PP_TXOFFSET_5" }, + { 0, 1, "R200_SE_VTE_CNTL" }, + { 0, 1, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" }, + { 0, 1, "R200_PP_TAM_DEBUG3" }, + { 0, 1, "R200_PP_CNTL_X" }, + { 0, 1, "R200_RB3D_DEPTHXY_OFFSET" }, + { 0, 1, "R200_RE_AUX_SCISSOR_CNTL" }, + { 0, 2, "R200_RE_SCISSOR_TL_0" }, + { 0, 2, "R200_RE_SCISSOR_TL_1" }, + { 0, 2, "R200_RE_SCISSOR_TL_2" }, + { 0, 1, "R200_SE_VAP_CNTL_STATUS" }, + { 0, 1, "R200_SE_VTX_STATE_CNTL" }, + { 0, 1, "R200_RE_POINTSIZE" }, + { 0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" }, + { 0, 1, "R200_PP_CUBIC_FACES_0" }, /* 61 */ + { 0, 5, "R200_PP_CUBIC_OFFSET_F1_0" }, /* 62 */ + { 0, 1, "R200_PP_CUBIC_FACES_1" }, + { 0, 5, "R200_PP_CUBIC_OFFSET_F1_1" }, + { 0, 1, "R200_PP_CUBIC_FACES_2" }, + { 0, 5, "R200_PP_CUBIC_OFFSET_F1_2" }, + { 0, 1, "R200_PP_CUBIC_FACES_3" }, + { 0, 5, "R200_PP_CUBIC_OFFSET_F1_3" }, + { 0, 1, "R200_PP_CUBIC_FACES_4" }, + { 0, 5, "R200_PP_CUBIC_OFFSET_F1_4" }, + { 0, 1, "R200_PP_CUBIC_FACES_5" }, + { 0, 5, "R200_PP_CUBIC_OFFSET_F1_5" }, + { RADEON_PP_TEX_SIZE_0, 2, "RADEON_PP_TEX_SIZE_0" }, + { RADEON_PP_TEX_SIZE_1, 2, "RADEON_PP_TEX_SIZE_1" }, + { RADEON_PP_TEX_SIZE_2, 2, "RADEON_PP_TEX_SIZE_1" }, }; struct reg_names { @@ -166,7 +223,13 @@ { RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE, "RADEON_SE_TCL_SPECULAR_BLUE" }, { RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA, "RADEON_SE_TCL_SPECULAR_ALPHA" }, { RADEON_SE_TCL_SHININESS, "RADEON_SE_TCL_SHININESS" }, - { RADEON_SE_COORD_FMT, "RADEON_SE_COORD_FMT" } + { RADEON_SE_COORD_FMT, "RADEON_SE_COORD_FMT" }, + { RADEON_PP_TEX_SIZE_0, "RADEON_PP_TEX_SIZE_0" }, + { RADEON_PP_TEX_SIZE_1, "RADEON_PP_TEX_SIZE_1" }, + { RADEON_PP_TEX_SIZE_2, "RADEON_PP_TEX_SIZE_2" }, + { RADEON_PP_TEX_SIZE_0+4, "RADEON_PP_TEX_PITCH_0" }, + { RADEON_PP_TEX_SIZE_1+4, "RADEON_PP_TEX_PITCH_1" }, + { RADEON_PP_TEX_SIZE_2+4, "RADEON_PP_TEX_PITCH_2" }, }; static struct reg_names scalar_names[] = { @@ -599,16 +662,16 @@ static char *primname[0xf] = { "NONE", - "POINT", - "LINE", + "POINTS", + "LINES", "LINE_STRIP", - "TRI_LIST", - "TRI_FAN", - "TRI_STRIP", + "TRIANGLES", + "TRIANGLE_FAN", + "TRIANGLE_STRIP", "TRI_TYPE_2", "RECT_LIST", - "3VRT_POINT_LIST", - "3VRT_LINE_LIST", + "3VRT_POINTS", + "3VRT_LINES", }; static int print_prim_and_flags( int prim ) Index: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c:1.6 xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c:1.10 --- xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c:1.6 Mon Dec 16 11:18:58 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c Thu Dec 18 16:56:37 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c,v 1.6 2002/12/16 16:18:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c,v 1.10 2003/12/18 21:56:37 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -34,9 +35,19 @@ * */ +#include "glheader.h" +#include "imports.h" + +#define STANDALONE_MMIO +#include "radeon_context.h" #include "radeon_screen.h" -#include "mem.h" +#include "radeon_macros.h" + +#include "utils.h" +#include "context.h" +#include "vblank.h" +#include "glxextensions.h" #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... @@ -54,157 +65,123 @@ #define PCI_CHIP_RADEON_LY 0x4C59 #define PCI_CHIP_RADEON_LZ 0x4C5A -#define PCI_CHIP_RV200_QW 0x5157 /* a confusing name for a radeon */ +#define PCI_CHIP_RV200_QW 0x5157 /* Radeon 7500 - not an R200 at all */ #endif +static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); /* Create the device specific screen private data struct. */ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) { - radeonScreenPtr radeonScreen; - RADEONDRIPtr radeonDRIPriv = (RADEONDRIPtr)sPriv->pDevPriv; - - /* Check the DRI version */ - { - int major, minor, patch; - if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 4 || minor < 0 ) { - __driUtilMessage( "Radeon DRI driver expected DRI version 4.0.x " - "but got version %d.%d.%d", - major, minor, patch ); - return NULL; - } - } - } + radeonScreenPtr screen; + RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv; + unsigned char *RADEONMMIO; - /* Check that the DDX driver version is compatible */ - if ( sPriv->ddxMajor != 4 || - sPriv->ddxMinor < 0 ) { - __driUtilMessage( "Radeon DRI driver expected DDX driver version 4.0.x " - "but got version %d.%d.%d", - sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch ); - return NULL; - } - - /* Check that the DRM driver version is compatible */ - /* KW: Check minor number here too -- compatibility mode is broken - * atm. - */ - if ( sPriv->drmMajor != 1 || - sPriv->drmMinor < 3) { - __driUtilMessage( "Radeon DRI driver expected DRM driver version 1.3.x " - "or newer but got version %d.%d.%d", - sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); + if ( ! driCheckDriDdxDrmVersions( sPriv, "Radeon", 4, 0, 4, 0, 1, 3 ) ) return NULL; - } - /* Allocate the private area */ - radeonScreen = (radeonScreenPtr) CALLOC( sizeof(*radeonScreen) ); - if ( !radeonScreen ) { - __driUtilMessage("%s: CALLOC radeonScreen struct failed", + screen = (radeonScreenPtr) CALLOC( sizeof(*screen) ); + if ( !screen ) { + __driUtilMessage("%s: Could not allocate memory for screen structure", __FUNCTION__); return NULL; } - if ( sPriv->drmMinor < 3 || - getenv("RADEON_COMPAT")) { - fprintf( stderr, "Radeon DRI driver:\n\t" - "Compatibility mode for DRM driver version %d.%d.%d\n\t" - "TCL will be disabled, expect reduced performance\n\t" - "(prefer DRM radeon.o 1.3.x or newer)\n\t", - sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); - } - /* This is first since which regions we map depends on whether or * not we are using a PCI card. */ - radeonScreen->IsPCI = radeonDRIPriv->IsPCI; + screen->IsPCI = dri_priv->IsPCI; - if (sPriv->drmMinor >= 3) { + { int ret; drmRadeonGetParam gp; - gp.param = RADEON_PARAM_AGP_BUFFER_OFFSET; - gp.value = &radeonScreen->agp_buffer_offset; + gp.param = RADEON_PARAM_GART_BUFFER_OFFSET; + gp.value = &screen->gart_buffer_offset; ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); if (ret) { - FREE( radeonScreen ); - fprintf(stderr, "drmRadeonGetParam (RADEON_PARAM_AGP_BUFFER_OFFSET): %d\n", ret); + FREE( screen ); + fprintf(stderr, "drmRadeonGetParam (RADEON_PARAM_GART_BUFFER_OFFSET): %d\n", ret); return NULL; } if (sPriv->drmMinor >= 6) { gp.param = RADEON_PARAM_IRQ_NR; - gp.value = &radeonScreen->irq; + gp.value = &screen->irq; ret = drmCommandWriteRead( sPriv->fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp)); if (ret) { - FREE( radeonScreen ); + FREE( screen ); fprintf(stderr, "drmRadeonGetParam (RADEON_PARAM_IRQ_NR): %d\n", ret); return NULL; } } - } - radeonScreen->mmio.handle = radeonDRIPriv->registerHandle; - radeonScreen->mmio.size = radeonDRIPriv->registerSize; + screen->mmio.handle = dri_priv->registerHandle; + screen->mmio.size = dri_priv->registerSize; if ( drmMap( sPriv->fd, - radeonScreen->mmio.handle, - radeonScreen->mmio.size, - &radeonScreen->mmio.map ) ) { - FREE( radeonScreen ); - __driUtilMessage("radeonCreateScreen(): drmMap failed\n"); + screen->mmio.handle, + screen->mmio.size, + &screen->mmio.map ) ) { + FREE( screen ); + __driUtilMessage("%s: drmMap failed\n", __FUNCTION__ ); return NULL; } - radeonScreen->status.handle = radeonDRIPriv->statusHandle; - radeonScreen->status.size = radeonDRIPriv->statusSize; + RADEONMMIO = screen->mmio.map; + + screen->status.handle = dri_priv->statusHandle; + screen->status.size = dri_priv->statusSize; if ( drmMap( sPriv->fd, - radeonScreen->status.handle, - radeonScreen->status.size, - &radeonScreen->status.map ) ) { - drmUnmap( radeonScreen->mmio.map, radeonScreen->mmio.size ); - FREE( radeonScreen ); - __driUtilMessage("radeonCreateScreen(): drmMap (2) failed\n"); + screen->status.handle, + screen->status.size, + &screen->status.map ) ) { + drmUnmap( screen->mmio.map, screen->mmio.size ); + FREE( screen ); + __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ ); return NULL; } - radeonScreen->scratch = (__volatile__ CARD32 *) - ((GLubyte *)radeonScreen->status.map + RADEON_SCRATCH_REG_OFFSET); + screen->scratch = (__volatile__ CARD32 *) + ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET); - radeonScreen->buffers = drmMapBufs( sPriv->fd ); - if ( !radeonScreen->buffers ) { - drmUnmap( radeonScreen->status.map, radeonScreen->status.size ); - drmUnmap( radeonScreen->mmio.map, radeonScreen->mmio.size ); - FREE( radeonScreen ); - __driUtilMessage("radeonCreateScreen(): drmMapBufs failed\n"); + screen->buffers = drmMapBufs( sPriv->fd ); + if ( !screen->buffers ) { + drmUnmap( screen->status.map, screen->status.size ); + drmUnmap( screen->mmio.map, screen->mmio.size ); + FREE( screen ); + __driUtilMessage("%s: drmMapBufs failed\n", __FUNCTION__ ); return NULL; } - if ( !radeonScreen->IsPCI ) { - radeonScreen->agpTextures.handle = radeonDRIPriv->agpTexHandle; - radeonScreen->agpTextures.size = radeonDRIPriv->agpTexMapSize; + if ( dri_priv->gartTexHandle && dri_priv->gartTexMapSize ) { + screen->gartTextures.handle = dri_priv->gartTexHandle; + screen->gartTextures.size = dri_priv->gartTexMapSize; if ( drmMap( sPriv->fd, - radeonScreen->agpTextures.handle, - radeonScreen->agpTextures.size, - (drmAddressPtr)&radeonScreen->agpTextures.map ) ) { - drmUnmapBufs( radeonScreen->buffers ); - drmUnmap( radeonScreen->status.map, radeonScreen->status.size ); - drmUnmap( radeonScreen->mmio.map, radeonScreen->mmio.size ); - FREE( radeonScreen ); - __driUtilMessage("radeonCreateScreen(): IsPCI failed\n"); + screen->gartTextures.handle, + screen->gartTextures.size, + (drmAddressPtr)&screen->gartTextures.map ) ) { + drmUnmapBufs( screen->buffers ); + drmUnmap( screen->status.map, screen->status.size ); + drmUnmap( screen->mmio.map, screen->mmio.size ); + FREE( screen ); + __driUtilMessage("%s: drmMap failed for GART texture area\n", __FUNCTION__); return NULL; } + + screen->gart_texture_offset = dri_priv->gartTexOffset + ( screen->IsPCI + ? INREG( RADEON_AIC_LO_ADDR ) + : ( ( INREG( RADEON_MC_AGP_LOCATION ) & 0x0ffffU ) << 16 ) ); } - radeonScreen->chipset = 0; - switch ( radeonDRIPriv->deviceID ) { + screen->chipset = 0; + switch ( dri_priv->deviceID ) { default: fprintf(stderr, "unknown chip id, assuming full radeon support\n"); case PCI_CHIP_RADEON_QD: @@ -213,7 +190,7 @@ case PCI_CHIP_RADEON_QG: case PCI_CHIP_RV200_QW: case PCI_CHIP_RADEON_LW: - radeonScreen->chipset |= RADEON_CHIPSET_TCL; + screen->chipset |= RADEON_CHIPSET_TCL; case PCI_CHIP_RADEON_QY: case PCI_CHIP_RADEON_QZ: case PCI_CHIP_RADEON_LY: @@ -221,57 +198,241 @@ break; } - radeonScreen->cpp = radeonDRIPriv->bpp / 8; - radeonScreen->AGPMode = radeonDRIPriv->AGPMode; + screen->cpp = dri_priv->bpp / 8; + screen->AGPMode = dri_priv->AGPMode; + + screen->fbLocation = ( INREG( RADEON_MC_FB_LOCATION ) & 0xffff ) << 16; + + if ( sPriv->drmMinor >= 10 ) { + drmRadeonSetParam sp; - radeonScreen->frontOffset = radeonDRIPriv->frontOffset; - radeonScreen->frontPitch = radeonDRIPriv->frontPitch; - radeonScreen->backOffset = radeonDRIPriv->backOffset; - radeonScreen->backPitch = radeonDRIPriv->backPitch; - radeonScreen->depthOffset = radeonDRIPriv->depthOffset; - radeonScreen->depthPitch = radeonDRIPriv->depthPitch; - - radeonScreen->texOffset[RADEON_CARD_HEAP] = radeonDRIPriv->textureOffset; - radeonScreen->texSize[RADEON_CARD_HEAP] = radeonDRIPriv->textureSize; - radeonScreen->logTexGranularity[RADEON_CARD_HEAP] = - radeonDRIPriv->log2TexGran; - - if ( radeonScreen->IsPCI ) { - radeonScreen->numTexHeaps = RADEON_NR_TEX_HEAPS - 1; - radeonScreen->texOffset[RADEON_AGP_HEAP] = 0; - radeonScreen->texSize[RADEON_AGP_HEAP] = 0; - radeonScreen->logTexGranularity[RADEON_AGP_HEAP] = 0; + sp.param = RADEON_SETPARAM_FB_LOCATION; + sp.value = screen->fbLocation; + + drmCommandWrite( sPriv->fd, DRM_RADEON_SETPARAM, + &sp, sizeof( sp ) ); + } + + screen->frontOffset = dri_priv->frontOffset; + screen->frontPitch = dri_priv->frontPitch; + screen->backOffset = dri_priv->backOffset; + screen->backPitch = dri_priv->backPitch; + screen->depthOffset = dri_priv->depthOffset; + screen->depthPitch = dri_priv->depthPitch; + + screen->texOffset[RADEON_CARD_HEAP] = dri_priv->textureOffset + + screen->fbLocation; + screen->texSize[RADEON_CARD_HEAP] = dri_priv->textureSize; + screen->logTexGranularity[RADEON_CARD_HEAP] = + dri_priv->log2TexGran; + + if ( !screen->gartTextures.map + || getenv( "RADEON_GARTTEXTURING_FORCE_DISABLE" ) ) { + screen->numTexHeaps = RADEON_NR_TEX_HEAPS - 1; + screen->texOffset[RADEON_GART_HEAP] = 0; + screen->texSize[RADEON_GART_HEAP] = 0; + screen->logTexGranularity[RADEON_GART_HEAP] = 0; } else { - radeonScreen->numTexHeaps = RADEON_NR_TEX_HEAPS; - radeonScreen->texOffset[RADEON_AGP_HEAP] = - radeonDRIPriv->agpTexOffset + RADEON_AGP_TEX_OFFSET; - radeonScreen->texSize[RADEON_AGP_HEAP] = radeonDRIPriv->agpTexMapSize; - radeonScreen->logTexGranularity[RADEON_AGP_HEAP] = - radeonDRIPriv->log2AGPTexGran; + screen->numTexHeaps = RADEON_NR_TEX_HEAPS; + screen->texOffset[RADEON_GART_HEAP] = screen->gart_texture_offset; + screen->texSize[RADEON_GART_HEAP] = dri_priv->gartTexMapSize; + screen->logTexGranularity[RADEON_GART_HEAP] = + dri_priv->log2GARTTexGran; + } + + if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + + if ( glx_enable_extension != NULL ) { + if ( screen->irq != 0 ) { + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); + } + + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + } } - radeonScreen->driScreen = sPriv; - radeonScreen->sarea_priv_offset = radeonDRIPriv->sarea_priv_offset; - return radeonScreen; + screen->driScreen = sPriv; + screen->sarea_priv_offset = dri_priv->sarea_priv_offset; + return screen; } /* Destroy the device specific screen private data struct. */ void radeonDestroyScreen( __DRIscreenPrivate *sPriv ) { - radeonScreenPtr radeonScreen = (radeonScreenPtr)sPriv->private; + radeonScreenPtr screen = (radeonScreenPtr)sPriv->private; - if (!radeonScreen) + if (!screen) return; - if ( !radeonScreen->IsPCI ) { - drmUnmap( radeonScreen->agpTextures.map, - radeonScreen->agpTextures.size ); - } - drmUnmapBufs( radeonScreen->buffers ); - drmUnmap( radeonScreen->status.map, radeonScreen->status.size ); - drmUnmap( radeonScreen->mmio.map, radeonScreen->mmio.size ); + if ( screen->gartTextures.map ) { + drmUnmap( screen->gartTextures.map, screen->gartTextures.size ); + } + drmUnmapBufs( screen->buffers ); + drmUnmap( screen->status.map, screen->status.size ); + drmUnmap( screen->mmio.map, screen->mmio.size ); - FREE( radeonScreen ); + FREE( screen ); sPriv->private = NULL; } + + +/* Initialize the driver specific screen private data. + */ +static GLboolean +radeonInitDriver( __DRIscreenPrivate *sPriv ) +{ + sPriv->private = (void *) radeonCreateScreen( sPriv ); + if ( !sPriv->private ) { + radeonDestroyScreen( sPriv ); + return GL_FALSE; + } + + return GL_TRUE; +} + + + +/* Create and initialize the Mesa and driver specific pixmap buffer + * data. + */ +static GLboolean +radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv, + __DRIdrawablePrivate *driDrawPriv, + const __GLcontextModes *mesaVis, + GLboolean isPixmap ) +{ + if (isPixmap) { + return GL_FALSE; /* not implemented */ + } + else { + const GLboolean swDepth = GL_FALSE; + const GLboolean swAlpha = GL_FALSE; + const GLboolean swAccum = mesaVis->accumRedBits > 0; + const GLboolean swStencil = mesaVis->stencilBits > 0 && + mesaVis->depthBits != 24; + driDrawPriv->driverPrivate = (void *) + _mesa_create_framebuffer( mesaVis, + swDepth, + swStencil, + swAccum, + swAlpha ); + return (driDrawPriv->driverPrivate != NULL); + } +} + + +static void +radeonDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) +{ + _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate)); +} + + + + +/* Fullscreen mode isn't used for much -- could be a way to shrink + * front/back buffers & get more texture memory if the client has + * changed the video resolution. + * + * Pageflipping is now done automatically whenever there is a single + * 3d client. + */ +static GLboolean +radeonOpenCloseFullScreen( __DRIcontextPrivate *driContextPriv ) +{ + return GL_TRUE; +} + +static struct __DriverAPIRec radeonAPI = { + .InitDriver = radeonInitDriver, + .DestroyScreen = radeonDestroyScreen, + .CreateContext = radeonCreateContext, + .DestroyContext = radeonDestroyContext, + .CreateBuffer = radeonCreateBuffer, + .DestroyBuffer = radeonDestroyBuffer, + .SwapBuffers = radeonSwapBuffers, + .MakeCurrent = radeonMakeCurrent, + .UnbindContext = radeonUnbindContext, + .OpenFullScreen = radeonOpenCloseFullScreen, + .CloseFullScreen = radeonOpenCloseFullScreen, + .GetSwapInfo = getSwapInfo, + .GetMSC = driGetMSC32, + .WaitForMSC = driWaitForMSC32, + .WaitForSBC = NULL, + .SwapBuffersMSC = NULL +}; + + + +/* + * This is the bootstrap function for the driver. + * The __driCreateScreen name is the symbol that libGL.so fetches. + * Return: pointer to a __DRIscreenPrivate. + */ +void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, + int numConfigs, __GLXvisualConfig *config) +{ + __DRIscreenPrivate *psp; + psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &radeonAPI); + return (void *) psp; +} + + +/** + * This function is called by libGL.so as soon as libGL.so is loaded. + * This is where we'd register new extension functions with the dispatcher. + * + * \todo This interface has been deprecated, so we should probably remove + * this function before the next XFree86 release. + */ +void +__driRegisterExtensions( void ) +{ + PFNGLXENABLEEXTENSIONPROC glx_enable_extension; + + + if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { + glx_enable_extension = (PFNGLXENABLEEXTENSIONPROC) + glXGetProcAddress( (const GLubyte *) "__glXEnableExtension" ); + + if ( glx_enable_extension != NULL ) { + (*glx_enable_extension)( "GLX_SGI_swap_control", GL_FALSE ); + (*glx_enable_extension)( "GLX_SGI_video_sync", GL_FALSE ); + (*glx_enable_extension)( "GLX_MESA_swap_control", GL_FALSE ); + (*glx_enable_extension)( "GLX_MESA_swap_frame_usage", GL_FALSE ); + } + } +} + + +/** + * Get information about previous buffer swaps. + */ +static int +getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ) +{ + radeonContextPtr rmesa; + + if ( (dPriv == NULL) || (dPriv->driContextPriv == NULL) + || (dPriv->driContextPriv->driverPrivate == NULL) + || (sInfo == NULL) ) { + return -1; + } + + rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate; + sInfo->swap_count = rmesa->swap_count; + sInfo->swap_ust = rmesa->swap_ust; + sInfo->swap_missed_count = rmesa->swap_missed_count; + + sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0) + ? driCalculateSwapUsage( dPriv, 0, rmesa->swap_missed_ust ) + : 0.0; + + return 0; +} Index: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h:1.5 xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h:1.7 --- xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h:1.5 Mon Dec 16 11:18:58 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h Tue Dec 2 08:02:39 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h,v 1.5 2002/12/16 16:18:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h,v 1.7 2003/12/02 13:02:39 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -31,7 +32,6 @@ * Authors: * Kevin E. Martin * Gareth Hughes - * */ #ifndef __RADEON_SCREEN_H__ @@ -67,6 +67,7 @@ int AGPMode; unsigned int irq; /* IRQ number (0 means none) */ + unsigned int fbLocation; unsigned int frontOffset; unsigned int frontPitch; unsigned int backOffset; @@ -83,7 +84,7 @@ radeonRegionRec mmio; radeonRegionRec status; - radeonRegionRec agpTextures; + radeonRegionRec gartTextures; drmBufMapPtr buffers; @@ -91,7 +92,8 @@ __DRIscreenPrivate *driScreen; unsigned int sarea_priv_offset; - unsigned int agp_buffer_offset; /* offset in card memory space */ + unsigned int gart_buffer_offset; /* offset in card memory space */ + unsigned int gart_texture_offset; /* offset in card memory space */ } radeonScreenRec, *radeonScreenPtr; extern radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ); Index: xc/lib/GL/mesa/src/drv/radeon/radeon_span.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_span.c:1.6 xc/lib/GL/mesa/src/drv/radeon/radeon_span.c:1.7 --- xc/lib/GL/mesa/src/drv/radeon/radeon_span.c:1.6 Wed Oct 30 07:51:56 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_span.c Sun Sep 28 16:15:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.c,v 1.6 2002/10/30 12:51:56 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.c,v 1.7 2003/09/28 20:15:29 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -35,14 +36,15 @@ * */ +#include "glheader.h" +#include "swrast/swrast.h" + #include "radeon_context.h" #include "radeon_ioctl.h" #include "radeon_state.h" #include "radeon_span.h" #include "radeon_tex.h" -#include "swrast/swrast.h" - #define DBG 0 #define LOCAL_VARS \ @@ -150,22 +152,27 @@ #define INIT_MONO_PIXEL(p, color) \ p = PACK_COLOR_8888( color[3], color[0], color[1], color[2] ) -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \ - (g << 8) | \ - (r << 16) | \ - (a << 24) ) +#define WRITE_RGBA( _x, _y, r, g, b, a ) \ +do { \ + *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \ + (g << 8) | \ + (r << 16) | \ + (a << 24) ); \ +} while (0) -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = p +#define WRITE_PIXEL( _x, _y, p ) \ +do { \ + *(GLuint *)(buf + _x*4 + _y*pitch) = p; \ +} while (0) -#define READ_RGBA( rgba, _x, _y ) \ -do { \ - GLuint p = *(GLuint *)(read_buf + _x*4 + _y*pitch); \ - rgba[0] = (p >> 16) & 0xff; \ - rgba[1] = (p >> 8) & 0xff; \ - rgba[2] = (p >> 0) & 0xff; \ - rgba[3] = (p >> 24) & 0xff; \ +#define READ_RGBA( rgba, _x, _y ) \ +do { \ + volatile GLuint *ptr = (volatile GLuint *)(read_buf + _x*4 + _y*pitch); \ + GLuint p = *ptr; \ + rgba[0] = (p >> 16) & 0xff; \ + rgba[1] = (p >> 8) & 0xff; \ + rgba[2] = (p >> 0) & 0xff; \ + rgba[3] = (p >> 24) & 0xff; \ } while (0) #define TAG(x) radeon##x##_ARGB8888 @@ -177,37 +184,17 @@ * Depth buffer */ -/* The Radeon has depth tiling on all the time, so we have to convert +/* The Radeon family has depth tiling on all the time, so we have to convert * the x,y coordinates into the memory bus address (mba) in the same * manner as the engine. In each case, the linear block address (ba) * is calculated, and then wired with x and y to produce the final * memory address. */ -static __inline GLuint radeon_mba_z16( radeonContextPtr rmesa, - GLint x, GLint y ) -{ - radeonScreenPtr radeonScreen = rmesa->radeonScreen; - GLuint pitch = radeonScreen->frontPitch; - GLuint ba, address = 0; /* a[0] = 0 */ - - ba = (y / 16) * (pitch / 32) + (x / 32); - - address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */ - address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */ - address |= (x & 0x8) << 4; /* a[7] = x[3] */ - address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ - address |= (y & 0x8) << 7; /* a[10] = y[3] */ - address |= ((x & 0x10) ^ (y & 0x10)) << 7; /* a[11] = x[4] ^ y[4] */ - address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ - - return address; -} static GLuint radeon_mba_z32( radeonContextPtr rmesa, GLint x, GLint y ) { - radeonScreenPtr radeonScreen = rmesa->radeonScreen; - GLuint pitch = radeonScreen->frontPitch; + GLuint pitch = rmesa->radeonScreen->frontPitch; GLuint ba, address = 0; /* a[0..1] = 0 */ ba = (y / 16) * (pitch / 16) + (x / 16); @@ -226,6 +213,24 @@ return address; } +static __inline GLuint radeon_mba_z16( radeonContextPtr rmesa, GLint x, GLint y ) +{ + GLuint pitch = rmesa->radeonScreen->frontPitch; + GLuint ba, address = 0; /* a[0] = 0 */ + + ba = (y / 16) * (pitch / 32) + (x / 32); + + address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */ + address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */ + address |= (x & 0x8) << 4; /* a[7] = x[3] */ + address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ + address |= (y & 0x8) << 7; /* a[10] = y[3] */ + address |= ((x & 0x10) ^ (y & 0x10)) << 7; /* a[11] = x[4] ^ y[4] */ + address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ + + return address; +} + /* 16-bit depth buffer functions */ @@ -284,29 +289,42 @@ #include "stenciltmp.h" -static void radeonSetReadBuffer( GLcontext *ctx, - GLframebuffer *colorBuffer, - GLenum mode ) +/* + * This function is called to specify which buffer to read and write + * for software rasterization (swrast) fallbacks. This doesn't necessarily + * correspond to glDrawBuffer() or glReadBuffer() calls. + */ +static void radeonSetBuffer( GLcontext *ctx, + GLframebuffer *colorBuffer, + GLuint bufferBit ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - switch ( mode ) { - case GL_FRONT_LEFT: + switch ( bufferBit ) { + case FRONT_LEFT_BIT: if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.pixel.readOffset = rmesa->radeonScreen->backOffset; rmesa->state.pixel.readPitch = rmesa->radeonScreen->backPitch; + rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset; + rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch; } else { rmesa->state.pixel.readOffset = rmesa->radeonScreen->frontOffset; rmesa->state.pixel.readPitch = rmesa->radeonScreen->frontPitch; + rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset; + rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch; } break; - case GL_BACK_LEFT: + case BACK_LEFT_BIT: if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.pixel.readOffset = rmesa->radeonScreen->frontOffset; rmesa->state.pixel.readPitch = rmesa->radeonScreen->frontPitch; + rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset; + rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch; } else { rmesa->state.pixel.readOffset = rmesa->radeonScreen->backOffset; rmesa->state.pixel.readPitch = rmesa->radeonScreen->backPitch; + rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset; + rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch; } break; default: @@ -323,6 +341,7 @@ static void radeonSpanRenderStart( GLcontext *ctx ) { radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); + RADEON_FIREVERTICES( rmesa ); LOCK_HARDWARE( rmesa ); radeonWaitForIdleLocked( rmesa ); @@ -340,7 +359,7 @@ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SetReadBuffer = radeonSetReadBuffer; + swdd->SetBuffer = radeonSetBuffer; switch ( rmesa->radeonScreen->cpp ) { case 2: Index: xc/lib/GL/mesa/src/drv/radeon/radeon_span.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_span.h:1.2 xc/lib/GL/mesa/src/drv/radeon/radeon_span.h:1.3 --- xc/lib/GL/mesa/src/drv/radeon/radeon_span.h:1.2 Fri Feb 22 16:45:01 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_span.h Sun Sep 28 16:15:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.h,v 1.2 2002/02/22 21:45:01 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.h,v 1.3 2003/09/28 20:15:29 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -31,7 +32,6 @@ * Authors: * Kevin E. Martin * Gareth Hughes - * */ #ifndef __RADEON_SPAN_H__ Index: xc/lib/GL/mesa/src/drv/radeon/radeon_state.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_state.c:1.8 xc/lib/GL/mesa/src/drv/radeon/radeon_state.c:1.10 --- xc/lib/GL/mesa/src/drv/radeon/radeon_state.c:1.8 Mon Dec 16 11:18:58 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_state.c Tue Dec 2 08:02:39 2003 @@ -1,47 +1,44 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.c,v 1.8 2002/12/16 16:18:58 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.c,v 1.10 2003/12/02 13:02:39 alanh Exp $ */ +/************************************************************************** + +Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California. + +All Rights Reserved. + +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + /* - * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California. - * - * All Rights Reserved. - * - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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. - * * Authors: - * Gareth Hughes - * Keith Whitwell + * Gareth Hughes + * Keith Whitwell */ -#include "radeon_context.h" -#include "radeon_ioctl.h" -#include "radeon_state.h" -#include "radeon_tcl.h" -#include "radeon_tex.h" -#include "radeon_swtcl.h" -#include "radeon_vtxfmt.h" - -#include "mem.h" -#include "mmath.h" +#include "glheader.h" +#include "imports.h" +#include "api_arrayelt.h" #include "enums.h" #include "colormac.h" -#include "light.h" -#include "api_arrayelt.h" +#include "state.h" #include "swrast/swrast.h" #include "array_cache/acache.h" @@ -49,28 +46,30 @@ #include "tnl/t_pipeline.h" #include "swrast_setup/swrast_setup.h" - -#define MODEL_PROJ 0 -#define MODEL 1 -#define MODEL_IT 2 -#define TEXMAT_0 3 -#define TEXMAT_1 4 -#define TEXMAT_2 5 - +#include "radeon_context.h" +#include "radeon_ioctl.h" +#include "radeon_state.h" +#include "radeon_tcl.h" +#include "radeon_tex.h" +#include "radeon_swtcl.h" +#include "radeon_vtxfmt.h" /* ============================================================= * Alpha blending */ -static void radeonAlphaFunc( GLcontext *ctx, GLenum func, GLchan ref ) +static void radeonAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); int pp_misc = rmesa->hw.ctx.cmd[CTX_PP_MISC]; + GLubyte refByte; + + CLAMPED_FLOAT_TO_UBYTE(refByte, ref); RADEON_STATECHANGE( rmesa, ctx ); pp_misc &= ~(RADEON_ALPHA_TEST_OP_MASK | RADEON_REF_ALPHA_MASK); - pp_misc |= (ref & RADEON_REF_ALPHA_MASK); + pp_misc |= (refByte & RADEON_REF_ALPHA_MASK); switch ( func ) { case GL_NEVER: @@ -119,7 +118,10 @@ break; default: - fallback = GL_TRUE; + if (ctx->Color.BlendEnabled) + fallback = GL_TRUE; + else + b |= RADEON_COMB_FCN_ADD_CLAMP; break; } @@ -180,7 +182,12 @@ case GL_ONE_MINUS_CONSTANT_COLOR: case GL_CONSTANT_ALPHA: case GL_ONE_MINUS_CONSTANT_ALPHA: - fallback = GL_TRUE; + if (ctx->Color.BlendEnabled) + fallback = GL_TRUE; + else + b |= RADEON_SRC_BLEND_GL_ONE; + break; + default: break; } @@ -219,7 +226,12 @@ case GL_ONE_MINUS_CONSTANT_COLOR: case GL_CONSTANT_ALPHA: case GL_ONE_MINUS_CONSTANT_ALPHA: - fallback = GL_TRUE; + if (ctx->Color.BlendEnabled) + fallback = GL_TRUE; + else + b |= RADEON_DST_BLEND_GL_ZERO; + break; + default: break; } @@ -441,8 +453,7 @@ MALLOC( rmesa->state.scissor.numAllocedClipRects * sizeof(XF86DRIClipRectRec) ); - if (!rmesa->state.scissor.numAllocedClipRects) { -/* FALLBACK( rmesa, RADEON_FALLBACK_MEMORY, GL_TRUE ); */ + if ( rmesa->state.scissor.pClipRects == NULL ) { rmesa->state.scissor.numAllocedClipRects = 0; return; } @@ -683,61 +694,60 @@ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); CARD32 p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; - if ( ctx->_TriangleCaps & DD_SEPARATE_SPECULAR ) { - p |= RADEON_SPECULAR_ENABLE; - } else { - p &= ~RADEON_SPECULAR_ENABLE; - } + RADEON_STATECHANGE( rmesa, tcl ); - if ( rmesa->hw.ctx.cmd[CTX_PP_CNTL] != p ) { - RADEON_STATECHANGE( rmesa, ctx ); - rmesa->hw.ctx.cmd[CTX_PP_CNTL] = p; - } + rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR; + rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE; + rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC; + rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_DIFFUSE; + rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE; - /* Bizzare: have to leave lighting enabled to get fog. - */ - RADEON_STATECHANGE( rmesa, tcl ); - if ((ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { + p &= ~RADEON_SPECULAR_ENABLE; + + rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_DIFFUSE_SPECULAR_COMBINE; + + + if (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) { rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR; rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE; rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC; rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; - } - else if (ctx->Fog.Enabled) { - if (ctx->Light.Enabled) { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; - } else { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; - } + p |= RADEON_SPECULAR_ENABLE; + rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= + ~RADEON_DIFFUSE_SPECULAR_COMBINE; } else if (ctx->Light.Enabled) { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR; rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC; rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; } else if (ctx->Fog.ColorSumEnabled ) { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE; rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC; rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE; + p |= RADEON_SPECULAR_ENABLE; } else { - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_SPECULAR; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~RADEON_TCL_VTX_PK_SPEC; rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_DIFFUSE; - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE; + } + + if (ctx->Fog.Enabled) { + rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_SPECULAR; + rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_PK_SPEC; + + /* Bizzare: have to leave lighting enabled to get fog. + */ + rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; + } + + if ( ctx->_TriangleCaps & DD_SEPARATE_SPECULAR ) { + assert( (p & RADEON_SPECULAR_ENABLE) != 0 ); + } else { + assert( (p & RADEON_SPECULAR_ENABLE) == 0 ); + } + + if ( rmesa->hw.ctx.cmd[CTX_PP_CNTL] != p ) { + RADEON_STATECHANGE( rmesa, ctx ); + rmesa->hw.ctx.cmd[CTX_PP_CNTL] = p; } /* Update vertex/render formats @@ -997,7 +1007,6 @@ } -/* RADEON_STATECHANGE( rmesa, glt ); */ if (ctx->Light.Enabled) { GLint p; @@ -1047,9 +1056,15 @@ case GL_POSITION: { /* positions picked up in update_light, but can do flag here */ - GLuint flag = (p&1)? RADEON_LIGHT_1_IS_LOCAL : RADEON_LIGHT_0_IS_LOCAL; + GLuint flag; GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2; + /* FIXME: Set RANGE_ATTEN only when needed */ + if (p&1) + flag = RADEON_LIGHT_1_IS_LOCAL; + else + flag = RADEON_LIGHT_0_IS_LOCAL; + RADEON_STATECHANGE(rmesa, tcl); if (l->EyePosition[3] != 0.0F) rmesa->hw.tcl.cmd[idx] |= flag; @@ -1075,6 +1090,7 @@ rmesa->hw.tcl.cmd[idx] |= flag; else rmesa->hw.tcl.cmd[idx] &= ~flag; + break; } @@ -1094,6 +1110,31 @@ return; } + /* Set RANGE_ATTEN only when needed */ + switch (pname) { + case GL_POSITION: + case GL_LINEAR_ATTENUATION: + case GL_QUADRATIC_ATTENUATION: + { + GLuint flag; + GLuint idx = TCL_PER_LIGHT_CTL_0 + p/2; + + if (p&1) + flag = RADEON_LIGHT_1_ENABLE_RANGE_ATTEN; + else + flag = RADEON_LIGHT_0_ENABLE_RANGE_ATTEN; + + RADEON_STATECHANGE(rmesa, tcl); + if (l->EyePosition[3] != 0.0F && + (l->LinearAttenuation != 0.0F || l->QuadraticAttenuation != 0.0F)) + rmesa->hw.tcl.cmd[idx] |= flag; + else + rmesa->hw.tcl.cmd[idx] &= ~flag; + break; + } + default: + break; + } } @@ -1134,14 +1175,6 @@ case GL_LIGHT_MODEL_COLOR_CONTROL: radeonUpdateSpecular(ctx); - - RADEON_STATECHANGE( rmesa, tcl ); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= - ~RADEON_DIFFUSE_SPECULAR_COMBINE; - else - rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= - RADEON_DIFFUSE_SPECULAR_COMBINE; break; default: @@ -1206,7 +1239,7 @@ GLuint p; for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipEnabled[p]) { + if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { GLint *ip = (GLint *)ctx->Transform._ClipUserPlane[p]; RADEON_STATECHANGE( rmesa, ucp[p] ); @@ -1227,8 +1260,8 @@ GLint ref, GLuint mask ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - GLuint refmask = ((ctx->Stencil.Ref << RADEON_STENCIL_REF_SHIFT) | - (ctx->Stencil.ValueMask << RADEON_STENCIL_MASK_SHIFT)); + GLuint refmask = ((ctx->Stencil.Ref[0] << RADEON_STENCIL_REF_SHIFT) | + (ctx->Stencil.ValueMask[0] << RADEON_STENCIL_MASK_SHIFT)); RADEON_STATECHANGE( rmesa, ctx ); RADEON_STATECHANGE( rmesa, msk ); @@ -1237,7 +1270,7 @@ rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~(RADEON_STENCIL_REF_MASK| RADEON_STENCIL_VALUE_MASK); - switch ( ctx->Stencil.Function ) { + switch ( ctx->Stencil.Function[0] ) { case GL_NEVER: rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_TEST_NEVER; break; @@ -1274,7 +1307,7 @@ RADEON_STATECHANGE( rmesa, msk ); rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] &= ~RADEON_STENCIL_WRITE_MASK; rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |= - (ctx->Stencil.WriteMask << RADEON_STENCIL_WRITEMASK_SHIFT); + (ctx->Stencil.WriteMask[0] << RADEON_STENCIL_WRITEMASK_SHIFT); } static void radeonStencilOp( GLcontext *ctx, GLenum fail, @@ -1287,7 +1320,7 @@ RADEON_STENCIL_ZFAIL_MASK | RADEON_STENCIL_ZPASS_MASK); - switch ( ctx->Stencil.FailFunc ) { + switch ( ctx->Stencil.FailFunc[0] ) { case GL_KEEP: rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_FAIL_KEEP; break; @@ -1308,7 +1341,7 @@ break; } - switch ( ctx->Stencil.ZFailFunc ) { + switch ( ctx->Stencil.ZFailFunc[0] ) { case GL_KEEP: rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZFAIL_KEEP; break; @@ -1329,7 +1362,7 @@ break; } - switch ( ctx->Stencil.ZPassFunc ) { + switch ( ctx->Stencil.ZPassFunc[0] ) { case GL_KEEP: rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_STENCIL_ZPASS_KEEP; break; @@ -1358,7 +1391,7 @@ rmesa->state.stencil.clear = ((GLuint) ctx->Stencil.Clear | (0xff << RADEON_STENCIL_MASK_SHIFT) | - (ctx->Stencil.WriteMask << RADEON_STENCIL_WRITEMASK_SHIFT)); + (ctx->Stencil.WriteMask[0] << RADEON_STENCIL_WRITEMASK_SHIFT)); } @@ -1468,9 +1501,14 @@ * Miscellaneous */ -static void radeonClearColor( GLcontext *ctx, const GLchan c[4] ) +static void radeonClearColor( GLcontext *ctx, const GLfloat color[4] ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLubyte c[4]; + CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); rmesa->state.color.clear = radeonPackColor( rmesa->radeonScreen->cpp, c[0], c[1], c[2], c[3] ); } @@ -1545,7 +1583,7 @@ } -static void radeonSetDrawBuffer( GLcontext *ctx, GLenum mode ) +static void radeonDrawBuffer( GLcontext *ctx, GLenum mode ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); @@ -1555,44 +1593,41 @@ RADEON_FIREVERTICES(rmesa); /* don't pipeline cliprect changes */ - switch ( mode ) { - case GL_FRONT_LEFT: + /* + * _DrawDestMask is easier to cope with than . + */ + switch ( ctx->Color._DrawDestMask ) { + case FRONT_LEFT_BIT: FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE ); - if ( rmesa->sarea->pfCurrentPage == 1 ) { - rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset; - rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch; - } else { - rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset; - rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch; - } - rmesa->state.pixel.readOffset = rmesa->state.color.drawOffset; - rmesa->state.pixel.readPitch = rmesa->state.color.drawPitch; radeonSetCliprects( rmesa, GL_FRONT_LEFT ); break; - case GL_BACK_LEFT: + case BACK_LEFT_BIT: FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE ); - if ( rmesa->sarea->pfCurrentPage == 1 ) { - rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset; - rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch; - } else { - rmesa->state.color.drawOffset = rmesa->radeonScreen->backOffset; - rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch; - } - rmesa->state.pixel.readOffset = rmesa->state.color.drawOffset; - rmesa->state.pixel.readPitch = rmesa->state.color.drawPitch; radeonSetCliprects( rmesa, GL_BACK_LEFT ); break; default: + /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_TRUE ); return; } + /* We want to update the s/w rast state too so that r200SetBuffer() + * gets called. + */ + _swrast_DrawBuffer(ctx, mode); + RADEON_STATECHANGE( rmesa, ctx ); - rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = (rmesa->state.color.drawOffset & - RADEON_COLOROFFSET_MASK); + rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = ((rmesa->state.color.drawOffset + + rmesa->radeonScreen->fbLocation) + & RADEON_COLOROFFSET_MASK); rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch; } +static void radeonReadBuffer( GLcontext *ctx, GLenum mode ) +{ + /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */ +} + /* ============================================================= * State enable/disable @@ -1637,6 +1672,18 @@ } else { rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE; } + + /* Catch a possible fallback: + */ + if (state) { + ctx->Driver.BlendEquation( ctx, ctx->Color.BlendEquation ); + ctx->Driver.BlendFunc( ctx, ctx->Color.BlendSrcRGB, + ctx->Color.BlendDstRGB ); + } + else { + FALLBACK( rmesa, RADEON_FALLBACK_BLEND_FUNC, GL_FALSE ); + FALLBACK( rmesa, RADEON_FALLBACK_BLEND_EQ, GL_FALSE ); + } break; case GL_CLIP_PLANE0: @@ -1697,6 +1744,7 @@ radeonUpdateSpecular( ctx ); /* for PK_SPEC */ if (rmesa->TclFallback) radeonChooseVertexState( ctx ); + _mesa_allow_light_in_model( ctx, !state ); break; case GL_LIGHT0: @@ -1730,14 +1778,6 @@ case GL_LIGHTING: RADEON_STATECHANGE(rmesa, tcl); - if (state) { -/* rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE; */ -/* rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] |= RADEON_TCL_COMPUTE_DIFFUSE; */ - } - else { -/* rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_LIGHTING_ENABLE; */ -/* rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] &= ~RADEON_TCL_COMPUTE_DIFFUSE; */ - } radeonUpdateSpecular(ctx); check_twoside_fallback( ctx ); break; @@ -1779,44 +1819,29 @@ break; case GL_POLYGON_OFFSET_POINT: - if (rmesa->dri.drmMinor == 1) { - radeonChooseRenderState( ctx ); - } - else { - RADEON_STATECHANGE( rmesa, set ); - if ( state ) { - rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_POINT; - } else { - rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_POINT; - } + RADEON_STATECHANGE( rmesa, set ); + if ( state ) { + rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_POINT; + } else { + rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_POINT; } break; case GL_POLYGON_OFFSET_LINE: - if (rmesa->dri.drmMinor == 1) { - radeonChooseRenderState( ctx ); - } - else { - RADEON_STATECHANGE( rmesa, set ); - if ( state ) { - rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_LINE; - } else { - rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_LINE; - } + RADEON_STATECHANGE( rmesa, set ); + if ( state ) { + rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_LINE; + } else { + rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_LINE; } break; case GL_POLYGON_OFFSET_FILL: - if (rmesa->dri.drmMinor == 1) { - radeonChooseRenderState( ctx ); - } - else { - RADEON_STATECHANGE( rmesa, set ); - if ( state ) { - rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_TRI; - } else { - rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_TRI; - } + RADEON_STATECHANGE( rmesa, set ); + if ( state ) { + rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_ZBIAS_ENABLE_TRI; + } else { + rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_ZBIAS_ENABLE_TRI; } break; @@ -1894,7 +1919,8 @@ RADEON_STATECHANGE( rmesa, tcl ); if (RADEON_DEBUG & DEBUG_STATE) - fprintf(stderr, "%s %d\n", __FUNCTION__, ctx->_NeedEyeCoords); + fprintf(stderr, "%s %d BEFORE %x\n", __FUNCTION__, ctx->_NeedEyeCoords, + rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]); if (ctx->_NeedEyeCoords) tmp = ctx->Transform.RescaleNormals; @@ -1906,6 +1932,10 @@ } else { rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_RESCALE_NORMALS; } + + if (RADEON_DEBUG & DEBUG_STATE) + fprintf(stderr, "%s %d AFTER %x\n", __FUNCTION__, ctx->_NeedEyeCoords, + rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]); } /* ============================================================= @@ -1951,7 +1981,7 @@ for (unit = 0 ; unit < 2; unit++) { if (!ctx->Texture.Unit[unit]._ReallyEnabled) { } - else if (ctx->TextureMatrix[unit].type != MATRIX_IDENTITY) { + else if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) { GLuint inputshift = RADEON_TEXGEN_0_INPUT_SHIFT + unit*4; rmesa->TexMatEnabled |= (RADEON_TEXGEN_TEXMAT_0_ENABLE| @@ -1963,13 +1993,13 @@ */ _math_matrix_mul_matrix( &rmesa->tmpmat, &rmesa->TexGenMatrix[unit], - &ctx->TextureMatrix[unit] ); + ctx->TextureMatrixStack[unit].Top ); upload_matrix( rmesa, rmesa->tmpmat.m, TEXMAT_0+unit ); } else { rmesa->TexMatEnabled |= (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift; - upload_matrix( rmesa, ctx->TextureMatrix[unit].m, + upload_matrix( rmesa, ctx->TextureMatrixStack[unit].Top->m, TEXMAT_0+unit ); } } @@ -2024,8 +2054,8 @@ /* Need these for lighting (shouldn't upload otherwise) */ if (new_state & (_NEW_MODELVIEW)) { - upload_matrix( rmesa, ctx->ModelView.m, MODEL ); - upload_matrix_t( rmesa, ctx->ModelView.inv, MODEL_IT ); + upload_matrix( rmesa, ctx->ModelviewMatrixStack.Top->m, MODEL ); + upload_matrix_t( rmesa, ctx->ModelviewMatrixStack.Top->inv, MODEL_IT ); } /* Does this need to be triggered on eg. modelview for @@ -2042,7 +2072,7 @@ /* emit all active clip planes if projection matrix changes. */ if (new_state & (_NEW_PROJECTION)) { - if (ctx->Transform._AnyClip) + if (ctx->Transform.ClipPlanesEnabled) radeonUpdateClipPlanes( ctx ); } @@ -2090,8 +2120,6 @@ } - - /* Initialize the driver's state functions. */ void radeonInitStateFuncs( GLcontext *ctx ) @@ -2099,7 +2127,8 @@ ctx->Driver.UpdateState = radeonInvalidateState; ctx->Driver.LightingSpaceChange = radeonLightingSpaceChange; - ctx->Driver.SetDrawBuffer = radeonSetDrawBuffer; + ctx->Driver.DrawBuffer = radeonDrawBuffer; + ctx->Driver.ReadBuffer = radeonReadBuffer; ctx->Driver.AlphaFunc = radeonAlphaFunc; ctx->Driver.BlendEquation = radeonBlendEquation; @@ -2126,10 +2155,7 @@ ctx->Driver.LineWidth = radeonLineWidth; ctx->Driver.LogicOpcode = radeonLogicOpCode; ctx->Driver.PolygonMode = radeonPolygonMode; - - if (RADEON_CONTEXT(ctx)->dri.drmMinor > 1) - ctx->Driver.PolygonOffset = radeonPolygonOffset; - + ctx->Driver.PolygonOffset = radeonPolygonOffset; ctx->Driver.PolygonStipple = radeonPolygonStipple; ctx->Driver.RenderMode = radeonRenderMode; ctx->Driver.Scissor = radeonScissor; Index: xc/lib/GL/mesa/src/drv/radeon/radeon_state.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_state.h:1.5 xc/lib/GL/mesa/src/drv/radeon/radeon_state.h:1.6 --- xc/lib/GL/mesa/src/drv/radeon/radeon_state.h:1.5 Tue Nov 5 12:46:09 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_state.h Sun Sep 28 16:15:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.h,v 1.5 2002/11/05 17:46:09 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state.h,v 1.6 2003/09/28 20:15:29 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ Index: xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c:1.3 xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c:1.5 --- xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c:1.3 Sat Feb 22 01:21:11 2003 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c Tue Dec 2 08:02:39 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c,v 1.3 2003/02/22 06:21:11 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_state_init.c,v 1.5 2003/12/02 13:02:39 alanh Exp $ */ /* * Copyright 2000, 2001 VA Linux Systems Inc., Fremont, California. * @@ -28,19 +28,8 @@ * Keith Whitwell */ -#include "radeon_context.h" -#include "radeon_ioctl.h" -#include "radeon_state.h" -#include "radeon_tcl.h" -#include "radeon_tex.h" -#include "radeon_swtcl.h" -#include "radeon_vtxfmt.h" - -#include "mem.h" -#include "mmath.h" -#include "enums.h" -#include "colormac.h" -#include "light.h" +#include "glheader.h" +#include "imports.h" #include "api_arrayelt.h" #include "swrast/swrast.h" @@ -49,6 +38,14 @@ #include "tnl/t_pipeline.h" #include "swrast_setup/swrast_setup.h" +#include "radeon_context.h" +#include "radeon_ioctl.h" +#include "radeon_state.h" +#include "radeon_tcl.h" +#include "radeon_tex.h" +#include "radeon_swtcl.h" +#include "radeon_vtxfmt.h" + /* ============================================================= * State initialization */ @@ -129,14 +126,17 @@ TCL_CHECK( tcl_lit5, ctx->Light.Enabled && ctx->Light.Light[5].Enabled ) TCL_CHECK( tcl_lit6, ctx->Light.Enabled && ctx->Light.Light[6].Enabled ) TCL_CHECK( tcl_lit7, ctx->Light.Enabled && ctx->Light.Light[7].Enabled ) -TCL_CHECK( tcl_ucp0, ctx->Transform.ClipEnabled[0] ) -TCL_CHECK( tcl_ucp1, ctx->Transform.ClipEnabled[1] ) -TCL_CHECK( tcl_ucp2, ctx->Transform.ClipEnabled[2] ) -TCL_CHECK( tcl_ucp3, ctx->Transform.ClipEnabled[3] ) -TCL_CHECK( tcl_ucp4, ctx->Transform.ClipEnabled[4] ) -TCL_CHECK( tcl_ucp5, ctx->Transform.ClipEnabled[5] ) +TCL_CHECK( tcl_ucp0, (ctx->Transform.ClipPlanesEnabled & 0x1) ) +TCL_CHECK( tcl_ucp1, (ctx->Transform.ClipPlanesEnabled & 0x2) ) +TCL_CHECK( tcl_ucp2, (ctx->Transform.ClipPlanesEnabled & 0x4) ) +TCL_CHECK( tcl_ucp3, (ctx->Transform.ClipPlanesEnabled & 0x8) ) +TCL_CHECK( tcl_ucp4, (ctx->Transform.ClipPlanesEnabled & 0x10) ) +TCL_CHECK( tcl_ucp5, (ctx->Transform.ClipPlanesEnabled & 0x20) ) TCL_CHECK( tcl_eyespace_or_fog, ctx->_NeedEyeCoords || ctx->Fog.Enabled ) +CHECK( txr0, (ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_RECT_BIT)) +CHECK( txr1, (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_RECT_BIT)) + /* Initialize the context's hardware state. @@ -249,6 +249,8 @@ ALLOC_STATE( lit[5], tcl_lit5, LIT_STATE_SIZE, "LIT/light-5", 1 ); ALLOC_STATE( lit[6], tcl_lit6, LIT_STATE_SIZE, "LIT/light-6", 1 ); ALLOC_STATE( lit[7], tcl_lit7, LIT_STATE_SIZE, "LIT/light-7", 1 ); + ALLOC_STATE( txr[0], txr0, TXR_STATE_SIZE, "TXR/txr-0", 0 ); + ALLOC_STATE( txr[1], txr1, TXR_STATE_SIZE, "TXR/txr-1", 0 ); /* Fill in the packet headers: @@ -271,6 +273,8 @@ rmesa->hw.tcl.cmd[TCL_CMD_0] = cmdpkt(RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT); rmesa->hw.mtl.cmd[MTL_CMD_0] = cmdpkt(RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED); + rmesa->hw.txr[0].cmd[TXR_CMD_0] = cmdpkt(RADEON_EMIT_PP_TEX_SIZE_0); + rmesa->hw.txr[1].cmd[TXR_CMD_0] = cmdpkt(RADEON_EMIT_PP_TEX_SIZE_1); rmesa->hw.grd.cmd[GRD_CMD_0] = cmdscl( RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR, 1, 4 ); rmesa->hw.fog.cmd[FOG_CMD_0] = @@ -318,7 +322,7 @@ RADEON_DST_BLEND_GL_ZERO ); rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHOFFSET] = - rmesa->radeonScreen->depthOffset; + rmesa->radeonScreen->depthOffset + rmesa->radeonScreen->fbLocation; rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] = ((rmesa->radeonScreen->depthPitch & @@ -408,57 +412,38 @@ rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZSCALE] = 0x00000000; rmesa->hw.vpt.cmd[VPT_SE_VPORT_ZOFFSET] = 0x00000000; - rmesa->hw.tex[0].cmd[TEX_PP_TXFILTER] = RADEON_BORDER_MODE_OGL; - rmesa->hw.tex[0].cmd[TEX_PP_TXFORMAT] = - (RADEON_TXFORMAT_ENDIAN_NO_SWAP | - RADEON_TXFORMAT_PERSPECTIVE_ENABLE | - RADEON_TXFORMAT_ST_ROUTE_STQ0 | - (2 << RADEON_TXFORMAT_WIDTH_SHIFT) | - (2 << RADEON_TXFORMAT_HEIGHT_SHIFT)); - rmesa->hw.tex[0].cmd[TEX_PP_TXOFFSET] = 0x2000; - rmesa->hw.tex[0].cmd[TEX_PP_BORDER_COLOR] = 0; - rmesa->hw.tex[0].cmd[TEX_PP_TXCBLEND] = - (RADEON_COLOR_ARG_A_ZERO | - RADEON_COLOR_ARG_B_ZERO | - RADEON_COLOR_ARG_C_CURRENT_COLOR | - RADEON_BLEND_CTL_ADD | - RADEON_SCALE_1X | - RADEON_CLAMP_TX); - rmesa->hw.tex[0].cmd[TEX_PP_TXABLEND] = - (RADEON_ALPHA_ARG_A_ZERO | - RADEON_ALPHA_ARG_B_ZERO | - RADEON_ALPHA_ARG_C_CURRENT_ALPHA | - RADEON_BLEND_CTL_ADD | - RADEON_SCALE_1X | - RADEON_CLAMP_TX); - rmesa->hw.tex[0].cmd[TEX_PP_TFACTOR] = 0; - - rmesa->hw.tex[1].cmd[TEX_PP_TXFILTER] = RADEON_BORDER_MODE_OGL; - rmesa->hw.tex[1].cmd[TEX_PP_TXFORMAT] = - (RADEON_TXFORMAT_ENDIAN_NO_SWAP | - RADEON_TXFORMAT_PERSPECTIVE_ENABLE | - RADEON_TXFORMAT_ST_ROUTE_STQ1 | - (2 << RADEON_TXFORMAT_WIDTH_SHIFT) | - (2 << RADEON_TXFORMAT_HEIGHT_SHIFT)); - rmesa->hw.tex[1].cmd[TEX_PP_TXOFFSET] = 0x8000; - rmesa->hw.tex[1].cmd[TEX_PP_BORDER_COLOR] = 0; - rmesa->hw.tex[1].cmd[TEX_PP_TXCBLEND] = - (RADEON_COLOR_ARG_A_ZERO | - RADEON_COLOR_ARG_B_ZERO | - RADEON_COLOR_ARG_C_CURRENT_COLOR | - RADEON_BLEND_CTL_ADD | - RADEON_SCALE_1X | - RADEON_CLAMP_TX); - rmesa->hw.tex[1].cmd[TEX_PP_TXABLEND] = - (RADEON_ALPHA_ARG_A_ZERO | - RADEON_ALPHA_ARG_B_ZERO | - RADEON_ALPHA_ARG_C_CURRENT_ALPHA | - RADEON_BLEND_CTL_ADD | - RADEON_SCALE_1X | - RADEON_CLAMP_TX); - rmesa->hw.tex[1].cmd[TEX_PP_TFACTOR] = 0; + for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) { + rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] = RADEON_BORDER_MODE_OGL; + rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] = + (RADEON_TXFORMAT_ENDIAN_NO_SWAP | + RADEON_TXFORMAT_PERSPECTIVE_ENABLE | + (i << 24) | /* This is one of RADEON_TXFORMAT_ST_ROUTE_STQ[012] */ + (2 << RADEON_TXFORMAT_WIDTH_SHIFT) | + (2 << RADEON_TXFORMAT_HEIGHT_SHIFT)); + + /* Initialize the texture offset to the start of the card texture heap */ + rmesa->hw.tex[i].cmd[TEX_PP_TXOFFSET] = + rmesa->radeonScreen->texOffset[RADEON_CARD_HEAP]; + + rmesa->hw.tex[i].cmd[TEX_PP_BORDER_COLOR] = 0; + rmesa->hw.tex[i].cmd[TEX_PP_TXCBLEND] = + (RADEON_COLOR_ARG_A_ZERO | + RADEON_COLOR_ARG_B_ZERO | + RADEON_COLOR_ARG_C_CURRENT_COLOR | + RADEON_BLEND_CTL_ADD | + RADEON_SCALE_1X | + RADEON_CLAMP_TX); + rmesa->hw.tex[i].cmd[TEX_PP_TXABLEND] = + (RADEON_ALPHA_ARG_A_ZERO | + RADEON_ALPHA_ARG_B_ZERO | + RADEON_ALPHA_ARG_C_CURRENT_ALPHA | + RADEON_BLEND_CTL_ADD | + RADEON_SCALE_1X | + RADEON_CLAMP_TX); + rmesa->hw.tex[i].cmd[TEX_PP_TFACTOR] = 0; + } - /* Can oly add ST1 at the time of doing some multitex but can keep + /* Can only add ST1 at the time of doing some multitex but can keep * it after that. Errors if DIFFUSE is missing. */ rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] = @@ -535,15 +520,6 @@ ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color ); ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, 0 ); - - /* Set up vector and scalar state commands: - */ -/* upload_matrix( rmesa, ctx->ModelView.m, MODEL ); */ -/* upload_matrix_t( rmesa, ctx->ModelView.inv, MODEL_IT ); */ -/* upload_matrix( rmesa, ctx->TextureMatrix[0].m, TEXMAT_0 ); */ -/* upload_matrix( rmesa, ctx->TextureMatrix[1].m, TEXMAT_1 ); */ -/* upload_matrix( rmesa, ctx->_ModelProjectMatrix.m, TEXMAT_2 ); */ - rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE; rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE; rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE; Index: xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c:1.4 xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c:1.7 --- xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c:1.4 Sat Feb 15 17:18:48 2003 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c Sun Sep 28 16:15:29 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c,v 1.4 2003/02/15 22:18:48 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c,v 1.7 2003/09/28 20:15:29 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,45 +6,45 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Keith Whitwell - * */ #include "glheader.h" #include "mtypes.h" #include "colormac.h" #include "enums.h" -#include "mem.h" -#include "mmath.h" +#include "imports.h" #include "macros.h" #include "swrast_setup/swrast_setup.h" #include "math/m_translate.h" #include "tnl/tnl.h" #include "tnl/t_context.h" +#include "tnl/t_imm_exec.h" #include "tnl/t_pipeline.h" #include "radeon_context.h" @@ -67,7 +67,6 @@ #define RADEON_MAX_SETUP 0x40 static void flush_last_swtcl_prim( radeonContextPtr rmesa ); -static void flush_last_swtcl_prim_compat( radeonContextPtr rmesa ); static struct { void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint ); @@ -265,7 +264,7 @@ if (!setup_tab[rmesa->swtcl.SetupIndex].check_tex_sizes(ctx)) { GLuint ind = rmesa->swtcl.SetupIndex |= (RADEON_PTEX_BIT|RADEON_RGBA_BIT); - /* Radeon handles projective textures nicely; just have to change + /* Projective textures are handled nicely; just have to change * up to the new vertex format. */ if (setup_tab[ind].vertex_format != rmesa->swtcl.vertex_format) { @@ -282,8 +281,7 @@ } if (rmesa->dma.flush != 0 && - rmesa->dma.flush != flush_last_swtcl_prim && - rmesa->dma.flush != flush_last_swtcl_prim_compat) + rmesa->dma.flush != flush_last_swtcl_prim) rmesa->dma.flush( rmesa ); } @@ -317,9 +315,11 @@ if (ctx->Fog.Enabled || (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)) ind |= RADEON_SPEC_BIT; - if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY) + if (ctx->Texture._EnabledUnits & 0x2) + /* unit 1 enabled */ ind |= RADEON_TEX0_BIT|RADEON_TEX1_BIT; - else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) + else if (ctx->Texture._EnabledUnits & 0x1) + /* unit 0 enabled */ ind |= RADEON_TEX0_BIT; rmesa->swtcl.SetupIndex = ind; @@ -375,9 +375,11 @@ if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s\n", __FUNCTION__); + rmesa->dma.flush = 0; + if (rmesa->dma.current.buf) { struct radeon_dma_region *current = &rmesa->dma.current; - GLuint current_offset = (rmesa->radeonScreen->agp_buffer_offset + + GLuint current_offset = (rmesa->radeonScreen->gart_buffer_offset + current->buf->buf->idx * RADEON_BUFFER_SIZE + current->start); @@ -400,48 +402,7 @@ rmesa->swtcl.numverts = 0; current->start = current->ptr; - - rmesa->dma.flush = 0; - } -} - - -static void flush_last_swtcl_prim_compat( radeonContextPtr rmesa ) -{ - struct radeon_dma_region *current = &rmesa->dma.current; - - if (RADEON_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "%s buf %p start %d ptr %d\n", - __FUNCTION__, - current->buf, - current->start, - current->ptr); - - assert (!(rmesa->swtcl.hw_primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND)); - assert (current->start + - rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == - current->ptr); - assert (current->start == 0); - - if (current->ptr && current->buf) { - assert (current->buf->refcount == 1); - - radeonCompatEmitPrimitive( rmesa, - rmesa->swtcl.vertex_format, - rmesa->swtcl.hw_primitive, - rmesa->swtcl.numverts); - - /* The buffer has been released: - */ - FREE(current->buf); - current->buf = 0; - current->start = 0; - current->ptr = current->end; - } - - rmesa->swtcl.numverts = 0; - rmesa->dma.flush = 0; } @@ -456,22 +417,19 @@ radeonRefillCurrentDmaRegion( rmesa ); if (!rmesa->dma.flush) { - if (rmesa->dri.drmMinor == 1) - rmesa->dma.flush = flush_last_swtcl_prim_compat; - else - rmesa->dma.flush = flush_last_swtcl_prim; + rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; + rmesa->dma.flush = flush_last_swtcl_prim; } assert( vsize == rmesa->swtcl.vertex_size * 4 ); - assert( rmesa->dma.flush == flush_last_swtcl_prim || - rmesa->dma.flush == flush_last_swtcl_prim_compat); + assert( rmesa->dma.flush == flush_last_swtcl_prim ); assert (rmesa->dma.current.start + rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == rmesa->dma.current.ptr); { - GLubyte *head = rmesa->dma.current.address + rmesa->dma.current.ptr; + GLubyte *head = (GLubyte *)(rmesa->dma.current.address + rmesa->dma.current.ptr); rmesa->dma.current.ptr += bytes; rmesa->swtcl.numverts += nverts; return head; @@ -563,7 +521,7 @@ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK ); tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags ); - RADEON_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_CLIP; + RADEON_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_CLIP; } static void ELT_FALLBACK( GLcontext *ctx, @@ -575,7 +533,7 @@ tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK ); tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); tnl->Driver.Render.PrimTabElts[flags&PRIM_MODE_MASK]( ctx, start, count, flags ); - RADEON_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_CLIP; + RADEON_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_CLIP; } @@ -620,7 +578,7 @@ \ radeonEmitVertexAOS( rmesa, \ rmesa->swtcl.vertex_size, \ - (rmesa->radeonScreen->agp_buffer_offset + \ + (rmesa->radeonScreen->gart_buffer_offset + \ rmesa->swtcl.indexed_verts.buf->buf->idx * \ RADEON_BUFFER_SIZE + \ rmesa->swtcl.indexed_verts.start)); \ @@ -679,15 +637,6 @@ ctx->Line.StippleFlag) /* GH: THIS IS A HACK!!! */ return GL_TRUE; - if (rmesa->dri.drmMinor < 3) { - /* drm 1.1 doesn't support vertex primitives starting in the - * middle of a buffer. It doesn't support sane indexed vertices - * either. drm 1.2 fixes both of these problems, but we don't have a - * compatibility layer to that version yet. - */ - return GL_TRUE; - } - tnl->Driver.Render.Start( ctx ); if (VB->Elts) { @@ -721,20 +670,20 @@ static void radeon_check_render( GLcontext *ctx, struct gl_pipeline_stage *stage ) { - GLuint inputs = VERT_OBJ|VERT_CLIP|VERT_RGBA; + GLuint inputs = VERT_BIT_POS | VERT_BIT_CLIP | VERT_BIT_COLOR0; if (ctx->RenderMode == GL_RENDER) { if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - inputs |= VERT_SPEC_RGB; + inputs |= VERT_BIT_COLOR1; if (ctx->Texture.Unit[0]._ReallyEnabled) - inputs |= VERT_TEX(0); + inputs |= VERT_BIT_TEX0; if (ctx->Texture.Unit[1]._ReallyEnabled) - inputs |= VERT_TEX(1); + inputs |= VERT_BIT_TEX1; if (ctx->Fog.Enabled) - inputs |= VERT_FOG_COORD; + inputs |= VERT_BIT_FOG; } stage->inputs = inputs; @@ -764,6 +713,132 @@ }; +/**************************************************************************/ + +/* Radeon texture rectangle expects coords in 0..1 range, not 0..dimension + * as in the extension spec. Need to translate here. + * + * Note that swrast expects 0..dimension, so if a fallback is active, + * don't do anything. (Maybe need to configure swrast to match hw) + */ +struct texrect_stage_data { + GLvector4f texcoord[MAX_TEXTURE_UNITS]; +}; + +#define TEXRECT_STAGE_DATA(stage) ((struct texrect_stage_data *)stage->privatePtr) + + +static GLboolean run_texrect_stage( GLcontext *ctx, + struct gl_pipeline_stage *stage ) +{ + struct texrect_stage_data *store = TEXRECT_STAGE_DATA(stage); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + GLuint i; + + if (rmesa->Fallback) + return GL_TRUE; + + for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) { + if (!(ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_RECT_BIT)) + continue; + + if (stage->changed_inputs & VERT_BIT_TEX(i)) { + struct gl_texture_object *texObj = ctx->Texture.Unit[i].CurrentRect; + struct gl_texture_image *texImage = texObj->Image[texObj->BaseLevel]; + const GLfloat iw = 1.0/texImage->Width; + const GLfloat ih = 1.0/texImage->Height; + GLfloat *in = (GLfloat *)VB->TexCoordPtr[i]->data; + GLint instride = VB->TexCoordPtr[i]->stride; + GLfloat (*out)[4] = store->texcoord[i].data; + GLint j; + + for (j = 0 ; j < VB->Count ; j++) { + out[j][0] = in[0] * iw; + out[j][1] = in[1] * ih; + in = (GLfloat *)((GLubyte *)in + instride); + } + } + + VB->TexCoordPtr[i] = &store->texcoord[i]; + } + + return GL_TRUE; +} + + +/* Called the first time stage->run() is invoked. + */ +static GLboolean alloc_texrect_data( GLcontext *ctx, + struct gl_pipeline_stage *stage ) +{ + struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; + struct texrect_stage_data *store; + GLuint i; + + stage->privatePtr = CALLOC(sizeof(*store)); + store = TEXRECT_STAGE_DATA(stage); + if (!store) + return GL_FALSE; + + for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) + _mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 ); + + /* Now run the stage. + */ + stage->run = run_texrect_stage; + return stage->run( ctx, stage ); +} + + +static void check_texrect( GLcontext *ctx, + struct gl_pipeline_stage *stage ) +{ + GLuint flags = 0; + + if (ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_RECT_BIT) + flags |= VERT_BIT_TEX0; + + if (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_RECT_BIT) + flags |= VERT_BIT_TEX1; + + stage->inputs = flags; + stage->outputs = flags; + stage->active = (flags != 0); +} + + +static void free_texrect_data( struct gl_pipeline_stage *stage ) +{ + struct texrect_stage_data *store = TEXRECT_STAGE_DATA(stage); + GLuint i; + + if (store) { + for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++) + if (store->texcoord[i].data) + _mesa_vector4f_free( &store->texcoord[i] ); + FREE( store ); + stage->privatePtr = 0; + } +} + + +const struct gl_pipeline_stage _radeon_texrect_stage = +{ + "radeon texrect stage", /* name */ + _NEW_TEXTURE, /* check_state */ + _NEW_TEXTURE, /* run_state */ + GL_TRUE, /* active? */ + 0, /* inputs */ + 0, /* outputs */ + 0, /* changed_inputs */ + NULL, /* private data */ + free_texrect_data, /* destructor */ + check_texrect, /* check */ + alloc_texrect_data, /* run -- initially set to init */ +}; + /**************************************************************************/ @@ -790,6 +865,7 @@ * Emit primitives as inline vertices * ***********************************************************************/ +#undef LOCAL_VARS #define CTX_ARG radeonContextPtr rmesa #define CTX_ARG2 rmesa #define GET_VERTEX_DWORDS() rmesa->swtcl.vertex_size @@ -821,7 +897,6 @@ #define RADEON_TWOSIDE_BIT 0x01 #define RADEON_UNFILLED_BIT 0x02 -#define RADEON_OFFSET_BIT 0x04 /* drmMinor == 1 */ #define RADEON_MAX_TRIFUNC 0x08 @@ -834,7 +909,7 @@ #define DO_FALLBACK 0 -#define DO_OFFSET (IND & RADEON_OFFSET_BIT) +#define DO_OFFSET 0 #define DO_UNFILLED (IND & RADEON_UNFILLED_BIT) #define DO_TWOSIDE (IND & RADEON_TWOSIDE_BIT) #define DO_FLAT 0 @@ -877,6 +952,9 @@ #define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = LE32_TO_CPU(spec[idx]) #undef LOCAL_VARS +#undef TAG +#undef INIT + #define LOCAL_VARS(n) \ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \ GLuint color[n], spec[n]; \ @@ -917,22 +995,6 @@ #define TAG(x) x##_twoside_unfilled #include "tnl_dd/t_dd_tritmp.h" -#define IND (RADEON_OFFSET_BIT) -#define TAG(x) x##_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (RADEON_TWOSIDE_BIT|RADEON_OFFSET_BIT) -#define TAG(x) x##_twoside_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (RADEON_UNFILLED_BIT|RADEON_OFFSET_BIT) -#define TAG(x) x##_unfilled_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (RADEON_TWOSIDE_BIT|RADEON_UNFILLED_BIT|RADEON_OFFSET_BIT) -#define TAG(x) x##_twoside_unfilled_offset -#include "tnl_dd/t_dd_tritmp.h" - static void init_rast_tab( void ) { @@ -940,10 +1002,6 @@ init_twoside(); init_unfilled(); init_twoside_unfilled(); - init_offset(); - init_twoside_offset(); - init_unfilled_offset(); - init_twoside_unfilled_offset(); } /**********************************************************************/ @@ -1002,8 +1060,6 @@ if (flags & DD_TRI_LIGHT_TWOSIDE) index |= RADEON_TWOSIDE_BIT; if (flags & DD_TRI_UNFILLED) index |= RADEON_UNFILLED_BIT; - if ((flags & DD_TRI_OFFSET) && - rmesa->dri.drmMinor == 1) index |= RADEON_OFFSET_BIT; if (index != rmesa->swtcl.RenderIndex) { tnl->Driver.Render.Points = rast_tab[index].points; @@ -1065,18 +1121,19 @@ /* Transition to/from hardware rasterization. */ /**********************************************************************/ -static char *fallbackStrings[] = { +static const char * const fallbackStrings[] = { "Texture mode", "glDrawBuffer(GL_FRONT_AND_BACK)", "glEnable(GL_STENCIL) without hw stencil buffer", "glRenderMode(selection or feedback)", "glBlendEquation", - "glBlendFunc(mode != ADD)" - "RADEON_NO_RAST" + "glBlendFunc", + "RADEON_NO_RAST", + "Mixing GL_CLAMP_TO_BORDER and GL_CLAMP (or GL_MIRROR_CLAMP_ATI)" }; -static char *getFallbackString(GLuint bit) +static const char *getFallbackString(GLuint bit) { int i = 0; while (bit > 1) { @@ -1134,6 +1191,14 @@ } +void radeonFlushVertices( GLcontext *ctx, GLuint flags ) +{ + _tnl_flush_vertices( ctx, flags ); + + if (flags & FLUSH_STORED_VERTICES) + RADEON_NEWPRIM( RADEON_CONTEXT( ctx ) ); +} + /**********************************************************************/ /* Initialization. */ /**********************************************************************/ @@ -1157,7 +1222,7 @@ tnl->Driver.Render.ResetLineStipple = radeonResetLineStipple; tnl->Driver.Render.BuildVertices = radeonBuildVertices; - rmesa->swtcl.verts = (char *)ALIGN_MALLOC( size * 16 * 4, 32 ); + rmesa->swtcl.verts = (GLubyte *)ALIGN_MALLOC( size * 16 * 4, 32 ); rmesa->swtcl.RenderIndex = ~0; rmesa->swtcl.render_primitive = GL_TRIANGLES; rmesa->swtcl.hw_primitive = 0; Index: xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.h:1.1 xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.h:1.3 --- xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.h:1.1 Wed Oct 30 07:51:57 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.h Sun Sep 28 16:15:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.h,v 1.1 2002/10/30 12:51:57 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.h,v 1.3 2003/09/28 20:15:30 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -43,6 +43,7 @@ extern void radeonInitSwtcl( GLcontext *ctx ); extern void radeonDestroySwtcl( GLcontext *ctx ); +extern void radeonFlushVertices( GLcontext *ctx, GLuint flags ); extern void radeonChooseRenderState( GLcontext *ctx ); extern void radeonChooseVertexState( GLcontext *ctx ); Index: xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c:1.1 xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c:1.2 --- xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c:1.1 Wed Oct 30 07:51:57 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c Sun Sep 28 16:15:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c,v 1.1 2002/10/30 12:51:57 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.c,v 1.2 2003/09/28 20:15:30 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,33 +6,43 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Keith Whitwell - * */ +#include "glheader.h" +#include "imports.h" +#include "light.h" +#include "mtypes.h" +#include "enums.h" + +#include "array_cache/acache.h" +#include "tnl/tnl.h" +#include "tnl/t_pipeline.h" + #include "radeon_context.h" #include "radeon_state.h" #include "radeon_ioctl.h" @@ -41,16 +51,6 @@ #include "radeon_swtcl.h" #include "radeon_maos.h" -#include "mmath.h" -#include "mtypes.h" -#include "enums.h" -#include "colormac.h" -#include "light.h" - -#include "array_cache/acache.h" -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - /* @@ -85,17 +85,18 @@ #define HW_POLYGON RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN -static GLboolean discreet_prim[0x10] = { - 0, /* none */ - 1, /* points */ - 1, /* lines */ - 0, /* line_strip */ - 1, /* tri_list */ - 0, /* tri_fan */ - 0, /* tri_type_2 */ - 1, /* rect list (unused) */ - 1, /* 3 vert point */ - 1, /* 3 vert line */ +static GLboolean discrete_prim[0x10] = { + 0, /* 0 none */ + 1, /* 1 points */ + 1, /* 2 lines */ + 0, /* 3 line_strip */ + 1, /* 4 tri_list */ + 0, /* 5 tri_fan */ + 0, /* 6 tri_type2 */ + 1, /* 7 rect list (unused) */ + 1, /* 8 3vert point */ + 1, /* 9 3vert line */ + 0, 0, 0, 0, @@ -105,32 +106,23 @@ #define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx) -#define ELTS_VARS GLushort *dest +#define ELT_TYPE GLushort #define ELT_INIT(prim, hw_prim) \ radeonTclPrimitive( ctx, prim, hw_prim | RADEON_CP_VC_CNTL_PRIM_WALK_IND ) -#define GET_ELTS() rmesa->tcl.Elts - +#define GET_MESA_ELTS() rmesa->tcl.Elts -#define NEW_PRIMITIVE() RADEON_NEWPRIM( rmesa ) -#define NEW_BUFFER() radeonRefillCurrentDmaRegion( rmesa ) /* Don't really know how many elts will fit in what's left of cmdbuf, * as there is state to emit, etc: */ -#if 0 -#define GET_CURRENT_VB_MAX_ELTS() \ - ((RADEON_CMD_BUF_SZ - (rmesa->store.cmd_used + 16)) / 2) -#define GET_SUBSEQUENT_VB_MAX_ELTS() ((RADEON_CMD_BUF_SZ - 16) / 2) -#else /* Testing on isosurf shows a maximum around here. Don't know if it's * the card or driver or kernel module that is causing the behaviour. */ -#define GET_CURRENT_VB_MAX_ELTS() 300 -#define GET_SUBSEQUENT_VB_MAX_ELTS() 300 -#endif +#define GET_MAX_HW_ELTS() 300 + #define RESET_STIPPLE() do { \ RADEON_STATECHANGE( rmesa, lin ); \ @@ -149,37 +141,29 @@ } while (0) -/* How do you extend an existing primitive? - */ -#define ALLOC_ELTS(nr) \ -do { \ - if (rmesa->dma.flush == radeonFlushElts && \ - rmesa->store.cmd_used + nr*2 < RADEON_CMD_BUF_SZ) { \ - \ - dest = (GLushort *)(rmesa->store.cmd_buf + \ - rmesa->store.cmd_used); \ - rmesa->store.cmd_used += nr*2; \ - } \ - else { \ - if (rmesa->dma.flush) \ - rmesa->dma.flush( rmesa ); \ - \ - radeonEmitAOS( rmesa, \ - rmesa->tcl.aos_components, \ - rmesa->tcl.nr_aos_components, \ - 0 ); \ - \ - dest = radeonAllocEltsOpenEnded( rmesa, \ - rmesa->tcl.vertex_format, \ - rmesa->tcl.hw_primitive, \ - nr ); \ - } \ -} while (0) + +#define ALLOC_ELTS(nr) radeonAllocElts( rmesa, nr ) + +static GLushort *radeonAllocElts( radeonContextPtr rmesa, GLuint nr ) +{ + if (rmesa->dma.flush) + rmesa->dma.flush( rmesa ); + + radeonEmitAOS( rmesa, + rmesa->tcl.aos_components, + rmesa->tcl.nr_aos_components, 0 ); + + return radeonAllocEltsOpenEnded( rmesa, + rmesa->tcl.vertex_format, + rmesa->tcl.hw_primitive, nr ); +} + +#define CLOSE_ELTS() RADEON_NEWPRIM( rmesa ) /* TODO: Try to extend existing primitive if both are identical, - * discreet and there are no intervening state changes. (Somewhat + * discrete and there are no intervening state changes. (Somewhat * duplicates changes to DrawArrays code) */ static void EMIT_PRIM( GLcontext *ctx, @@ -221,17 +205,15 @@ #ifdef MESA_BIG_ENDIAN /* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */ -#define EMIT_ELT(offset, x) do { \ +#define EMIT_ELT(dest, offset, x) do { \ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \ (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0) #else -#define EMIT_ELT(offset, x) (dest)[offset] = (GLushort) (x) +#define EMIT_ELT(dest, offset, x) (dest)[offset] = (GLushort) (x) #endif -#define EMIT_TWO_ELTS(offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x); -#define INCR_ELTS( nr ) dest += nr -#define RELEASE_ELT_VERTS() \ - radeonReleaseArrays( ctx, ~0 ) + +#define EMIT_TWO_ELTS(dest, offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x); @@ -267,7 +249,7 @@ GLuint newprim = hw_prim | RADEON_CP_VC_CNTL_TCL_ENABLE; if (newprim != rmesa->tcl.hw_primitive || - !discreet_prim[hw_prim&0xf]) { + !discrete_prim[hw_prim&0xf]) { RADEON_NEWPRIM( rmesa ); rmesa->tcl.hw_primitive = newprim; } @@ -344,43 +326,43 @@ struct gl_pipeline_stage *stage ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - GLuint inputs = VERT_OBJ; + GLuint inputs = VERT_BIT_POS; if (ctx->RenderMode == GL_RENDER) { /* Make all this event-driven: */ if (ctx->Light.Enabled) { - inputs |= VERT_NORM; + inputs |= VERT_BIT_NORMAL; - if (ctx->Light.ColorMaterialEnabled) { - inputs |= VERT_RGBA; + if (1 || ctx->Light.ColorMaterialEnabled) { + inputs |= VERT_BIT_COLOR0; } } else { - inputs |= VERT_RGBA; + inputs |= VERT_BIT_COLOR0; if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) { - inputs |= VERT_SPEC_RGB; + inputs |= VERT_BIT_COLOR1; } } if (ctx->Texture.Unit[0]._ReallyEnabled) { if (ctx->Texture.Unit[0].TexGenEnabled) { if (rmesa->TexGenNeedNormals[0]) { - inputs |= VERT_NORM; + inputs |= VERT_BIT_NORMAL; } } else { - inputs |= VERT_TEX(0); + inputs |= VERT_BIT_TEX0; } } if (ctx->Texture.Unit[1]._ReallyEnabled) { if (ctx->Texture.Unit[1].TexGenEnabled) { if (rmesa->TexGenNeedNormals[1]) { - inputs |= VERT_NORM; + inputs |= VERT_BIT_NORMAL; } } else { - inputs |= VERT_TEX(1); + inputs |= VERT_BIT_TEX1; } } Index: xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h:1.2 xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h:1.3 --- xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h:1.2 Sat Feb 8 16:26:45 2003 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h Sun Sep 28 16:15:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h,v 1.2 2003/02/08 21:26:45 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tcl.h,v 1.3 2003/09/28 20:15:30 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAHPICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -56,8 +57,11 @@ #define RADEON_TCL_FALLBACK_TEXGEN_1 0x20 /* texgen, unit 1 */ #define RADEON_TCL_FALLBACK_TEXGEN_2 0x40 /* texgen, unit 2 */ #define RADEON_TCL_FALLBACK_TCL_DISABLE 0x80 /* user disable */ +#define RADEON_TCL_FALLBACK_TEXRECT_0 0x100 /* texture rectangle */ +#define RADEON_TCL_FALLBACK_TEXRECT_1 0x200 /* texture rectangle */ +#define RADEON_TCL_FALLBACK_TEXRECT_2 0x400 /* texture rectangle */ -#define RADEON_MAX_TCL_VERTSIZE (15*4) +#define RADEON_MAX_TCL_VERTSIZE (15*4) #define TCL_FALLBACK( ctx, bit, mode ) radeonTclFallback( ctx, bit, mode ) Index: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c:1.9 xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c:1.11 --- xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c:1.9 Mon Dec 16 11:18:59 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c Thu Jan 22 22:57:06 2004 @@ -1,80 +1,97 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c,v 1.9 2002/12/16 16:18:59 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c,v 1.11 2004/01/23 03:57:06 dawes Exp $ */ +/* +Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and + VA Linux Systems Inc., Fremont, California. + +All Rights Reserved. + +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. +*/ + /* - * Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and - * VA Linux Systems Inc., Fremont, California. - * - * All Rights Reserved. - * - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. - * * Authors: * Gareth Hughes * Brian Paul */ -#include "radeon_context.h" -#include "radeon_state.h" -#include "radeon_ioctl.h" -#include "radeon_swtcl.h" -#include "radeon_tex.h" - +#include "glheader.h" +#include "imports.h" #include "colormac.h" #include "context.h" #include "enums.h" #include "image.h" -#include "mem.h" #include "simple_list.h" #include "texformat.h" #include "texstore.h" +#include "radeon_context.h" +#include "radeon_state.h" +#include "radeon_ioctl.h" +#include "radeon_swtcl.h" +#include "radeon_tex.h" + -/* ============================================================= - * Utility functions: + +/** + * Set the texture wrap modes. + * + * \param t Texture object whose wrap modes are to be set + * \param swrap Wrap mode for the \a s texture coordinate + * \param twrap Wrap mode for the \a t texture coordinate */ static void radeonSetTexWrap( radeonTexObjPtr t, GLenum swrap, GLenum twrap ) { - t->pp_txfilter &= ~(RADEON_CLAMP_S_MASK | RADEON_CLAMP_T_MASK); + GLboolean is_clamp = GL_FALSE; + GLboolean is_clamp_to_border = GL_FALSE; + + t->pp_txfilter &= ~(RADEON_CLAMP_S_MASK | RADEON_CLAMP_T_MASK | RADEON_BORDER_MODE_D3D); switch ( swrap ) { case GL_REPEAT: t->pp_txfilter |= RADEON_CLAMP_S_WRAP; break; case GL_CLAMP: - t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_LAST; + t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_GL; + is_clamp = GL_TRUE; break; case GL_CLAMP_TO_EDGE: t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_LAST; break; case GL_CLAMP_TO_BORDER: - t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_BORDER; + t->pp_txfilter |= RADEON_CLAMP_S_CLAMP_GL; + is_clamp_to_border = GL_TRUE; break; case GL_MIRRORED_REPEAT: t->pp_txfilter |= RADEON_CLAMP_S_MIRROR; break; case GL_MIRROR_CLAMP_ATI: - t->pp_txfilter |= RADEON_CLAMP_S_MIRROR_CLAMP_BORDER; + t->pp_txfilter |= RADEON_CLAMP_S_MIRROR_CLAMP_GL; + is_clamp = GL_TRUE; break; case GL_MIRROR_CLAMP_TO_EDGE_ATI: t->pp_txfilter |= RADEON_CLAMP_S_MIRROR_CLAMP_LAST; break; + default: + _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__); } switch ( twrap ) { @@ -82,24 +99,35 @@ t->pp_txfilter |= RADEON_CLAMP_T_WRAP; break; case GL_CLAMP: - t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_LAST; + t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_GL; + is_clamp = GL_TRUE; break; case GL_CLAMP_TO_EDGE: t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_LAST; break; case GL_CLAMP_TO_BORDER: - t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_BORDER; + t->pp_txfilter |= RADEON_CLAMP_T_CLAMP_GL; + is_clamp_to_border = GL_TRUE; break; case GL_MIRRORED_REPEAT: t->pp_txfilter |= RADEON_CLAMP_T_MIRROR; break; case GL_MIRROR_CLAMP_ATI: - t->pp_txfilter |= RADEON_CLAMP_T_MIRROR_CLAMP_BORDER; + t->pp_txfilter |= RADEON_CLAMP_T_MIRROR_CLAMP_GL; + is_clamp = GL_TRUE; break; case GL_MIRROR_CLAMP_TO_EDGE_ATI: t->pp_txfilter |= RADEON_CLAMP_T_MIRROR_CLAMP_LAST; break; + default: + _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__); + } + + if ( is_clamp_to_border ) { + t->pp_txfilter |= RADEON_BORDER_MODE_D3D; } + + t->border_fallback = (is_clamp && is_clamp_to_border); } static void radeonSetTexMaxAnisotropy( radeonTexObjPtr t, GLfloat max ) @@ -119,6 +147,14 @@ } } +/** + * Set the texture magnification and minification modes. + * + * \param t Texture whose filter modes are to be set + * \param minf Texture minification mode + * \param magf Texture magnification mode + */ + static void radeonSetTexFilter( radeonTexObjPtr t, GLenum minf, GLenum magf ) { GLuint anisotropy = (t->pp_txfilter & RADEON_MAX_ANISO_MASK); @@ -181,27 +217,40 @@ } +/** + * Allocate space for and load the mesa images into the texture memory block. + * This will happen before drawing with a new texture, or drawing with a + * texture after it was swapped out or teximaged again. + */ + static radeonTexObjPtr radeonAllocTexObj( struct gl_texture_object *texObj ) { radeonTexObjPtr t; t = CALLOC_STRUCT( radeon_tex_obj ); - if (!t) - return NULL; + texObj->DriverData = t; + if ( t != NULL ) { + if ( RADEON_DEBUG & DEBUG_TEXTURE ) { + fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)texObj, (void *)t ); + } - if ( RADEON_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, texObj, t ); - } + /* Initialize non-image-dependent parts of the state: + */ + t->base.tObj = texObj; + t->border_fallback = GL_FALSE; - t->tObj = texObj; - make_empty_list( t ); + t->pp_txfilter = RADEON_BORDER_MODE_OGL; + t->pp_txformat = (RADEON_TXFORMAT_ENDIAN_NO_SWAP | + RADEON_TXFORMAT_PERSPECTIVE_ENABLE); + + make_empty_list( & t->base ); + + radeonSetTexWrap( t, texObj->WrapS, texObj->WrapT ); + radeonSetTexMaxAnisotropy( t, texObj->MaxAnisotropy ); + radeonSetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); + radeonSetTexBorderColor( t, texObj->_BorderChan ); + } - /* Initialize non-image-dependent parts of the state: - */ - radeonSetTexWrap( t, texObj->WrapS, texObj->WrapT ); - radeonSetTexMaxAnisotropy( t, texObj->MaxAnisotropy ); - radeonSetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); - radeonSetTexBorderColor( t, texObj->BorderColor ); return t; } @@ -298,8 +347,15 @@ case GL_COMPRESSED_INTENSITY: return &_mesa_texformat_i8; + case GL_YCBCR_MESA: + if (type == GL_UNSIGNED_SHORT_8_8_APPLE || + type == GL_UNSIGNED_BYTE) + return &_mesa_texformat_ycbcr; + else + return &_mesa_texformat_ycbcr_rev; + default: - _mesa_problem(ctx, "unexpected texture format in radeonChoosTexFormat"); + _mesa_problem(ctx, "unexpected texture format in %s", __FUNCTION__); return NULL; } @@ -315,27 +371,25 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; if ( t ) { - radeonSwapOutTexObj( rmesa, t ); + driSwapOutTextureObject( t ); } else { - t = radeonAllocTexObj( texObj ); + t = (driTextureObject *) radeonAllocTexObj( texObj ); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); return; } - texObj->DriverData = t; } - /* Note, this will call radeonChooseTextureFormat */ + /* Note, this will call ChooseTextureFormat */ _mesa_store_teximage1d(ctx, target, level, internalFormat, width, border, format, type, pixels, &ctx->Unpack, texObj, texImage); - t->dirty_images |= (1 << level); + t->dirty_images[0] |= (1 << level); } @@ -348,28 +402,25 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - radeonTexObjPtr t = (radeonTexObjPtr)texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; assert( t ); /* this _should_ be true */ if ( t ) { - radeonSwapOutTexObj( rmesa, t ); - t->dirty_images |= (1 << level); + driSwapOutTextureObject( t ); } else { - t = radeonAllocTexObj(texObj); + t = (driTextureObject *) radeonAllocTexObj( texObj ); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D"); return; } - texObj->DriverData = t; } _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, format, type, pixels, packing, texObj, texImage); - t->dirty_images |= (1 << level); + t->dirty_images[0] |= (1 << level); } @@ -381,29 +432,41 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - radeonTexObjPtr t = (radeonTexObjPtr)texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; + GLuint face; -/* fprintf(stderr, "%s\n", __FUNCTION__); */ + /* which cube face or ordinary 2D image */ + switch (target) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; + ASSERT(face < 6); + break; + default: + face = 0; + } - if ( t ) { - radeonSwapOutTexObj( rmesa, t ); + if ( t != NULL ) { + driSwapOutTextureObject( t ); } else { - t = radeonAllocTexObj( texObj ); + t = (driTextureObject *) radeonAllocTexObj( texObj ); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); return; } - texObj->DriverData = t; } - /* Note, this will call radeonChooseTextureFormat */ + /* Note, this will call ChooseTextureFormat */ _mesa_store_teximage2d(ctx, target, level, internalFormat, width, height, border, format, type, pixels, &ctx->Unpack, texObj, texImage); - t->dirty_images |= (1 << level); + t->dirty_images[face] |= (1 << level); } @@ -416,29 +479,42 @@ struct gl_texture_object *texObj, struct gl_texture_image *texImage ) { - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; + GLuint face; -/* fprintf(stderr, "%s\n", __FUNCTION__); */ + + /* which cube face or ordinary 2D image */ + switch (target) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; + ASSERT(face < 6); + break; + default: + face = 0; + } assert( t ); /* this _should_ be true */ if ( t ) { - radeonSwapOutTexObj( rmesa, t ); + driSwapOutTextureObject( t ); } else { - t = radeonAllocTexObj(texObj); + t = (driTextureObject *) radeonAllocTexObj( texObj ); if (!t) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D"); return; } - texObj->DriverData = t; } _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels, packing, texObj, texImage); - t->dirty_images |= (1 << level); + t->dirty_images[face] |= (1 << level); } @@ -501,11 +577,16 @@ } } + +/** + * Changes variables and flags for a state update, which will happen at the + * next UpdateTextureState + */ + static void radeonTexParameter( GLcontext *ctx, GLenum target, struct gl_texture_object *texObj, GLenum pname, const GLfloat *params ) { - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData; if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) { @@ -531,7 +612,7 @@ break; case GL_TEXTURE_BORDER_COLOR: - radeonSetTexBorderColor( t, texObj->BorderColor ); + radeonSetTexBorderColor( t, texObj->_BorderChan ); break; case GL_TEXTURE_BASE_LEVEL: @@ -539,11 +620,11 @@ case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative for Radeon. Since there's no LOD clamping, + * be a nice alternative. Since there's no LOD clamping, * we just have to rely on loading the right subset of mipmap levels * to simulate a clamped LOD. */ - radeonSwapOutTexObj( rmesa, t ); + driSwapOutTextureObject( (driTextureObject *) t ); break; default: @@ -560,17 +641,14 @@ static void radeonBindTexture( GLcontext *ctx, GLenum target, struct gl_texture_object *texObj ) { - radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData; - GLuint unit = ctx->Texture.CurrentUnit; - if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) { - fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, texObj, unit ); + fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, (void *)texObj, + ctx->Texture.CurrentUnit ); } if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) { - if ( !t ) { - t = radeonAllocTexObj( texObj ); - texObj->DriverData = t; + if ( texObj->DriverData == NULL ) { + radeonAllocTexObj( texObj ); } } } @@ -579,61 +657,20 @@ struct gl_texture_object *texObj ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData; + driTextureObject * t = (driTextureObject *) texObj->DriverData; if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, texObj ); + fprintf( stderr, "%s( %p (target = %s) )\n", __FUNCTION__, (void *)texObj, + _mesa_lookup_enum_by_nr( texObj->Target ) ); } - if ( t ) { + if ( t != NULL ) { if ( rmesa ) { RADEON_FIREVERTICES( rmesa ); } - radeonDestroyTexObj( rmesa, t ); - texObj->DriverData = NULL; - } -} - -static GLboolean radeonIsTextureResident( GLcontext *ctx, - struct gl_texture_object *texObj ) -{ - radeonTexObjPtr t = (radeonTexObjPtr) texObj->DriverData; - - return ( t && t->memBlock ); -} - -static void radeonInitTextureObjects( GLcontext *ctx ) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - struct gl_texture_object *texObj; - GLuint tmp = ctx->Texture.CurrentUnit; - - ctx->Texture.CurrentUnit = 0; - - texObj = ctx->Texture.Unit[0].Current1D; - radeonBindTexture( ctx, GL_TEXTURE_1D, texObj ); - move_to_tail( &rmesa->texture.swapped, - (radeonTexObjPtr)texObj->DriverData ); - - texObj = ctx->Texture.Unit[0].Current2D; - radeonBindTexture( ctx, GL_TEXTURE_2D, texObj ); - move_to_tail( &rmesa->texture.swapped, - (radeonTexObjPtr)texObj->DriverData ); - - ctx->Texture.CurrentUnit = 1; - - texObj = ctx->Texture.Unit[1].Current1D; - radeonBindTexture( ctx, GL_TEXTURE_1D, texObj ); - move_to_tail( &rmesa->texture.swapped, - (radeonTexObjPtr)texObj->DriverData ); - - texObj = ctx->Texture.Unit[1].Current2D; - radeonBindTexture( ctx, GL_TEXTURE_2D, texObj ); - move_to_tail( &rmesa->texture.swapped, - (radeonTexObjPtr)texObj->DriverData ); - - ctx->Texture.CurrentUnit = tmp; + driDestroyTextureObject( t ); + } } /* Need: @@ -659,6 +696,9 @@ void radeonInitTextureFuncs( GLcontext *ctx ) { + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + ctx->Driver.ChooseTextureFormat = radeonChooseTextureFormat; ctx->Driver.TexImage1D = radeonTexImage1D; ctx->Driver.TexImage2D = radeonTexImage2D; @@ -676,7 +716,7 @@ ctx->Driver.BindTexture = radeonBindTexture; ctx->Driver.CreateTexture = NULL; /* FIXME: Is this used??? */ ctx->Driver.DeleteTexture = radeonDeleteTexture; - ctx->Driver.IsTextureResident = radeonIsTextureResident; + ctx->Driver.IsTextureResident = driIsTextureResident; ctx->Driver.PrioritizeTexture = NULL; ctx->Driver.ActiveTexture = NULL; ctx->Driver.UpdateTexturePalette = NULL; @@ -685,5 +725,7 @@ ctx->Driver.TexParameter = radeonTexParameter; ctx->Driver.TexGen = radeonTexGen; - radeonInitTextureObjects( ctx ); + driInitTextureObjects( ctx, & rmesa->swapped, + DRI_TEXMGR_DO_TEXTURE_1D + | DRI_TEXMGR_DO_TEXTURE_2D ); } Index: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_tex.h:1.3 xc/lib/GL/mesa/src/drv/radeon/radeon_tex.h:1.4 --- xc/lib/GL/mesa/src/drv/radeon/radeon_tex.h:1.3 Fri Feb 22 16:45:01 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_tex.h Sun Sep 28 16:15:30 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.h,v 1.3 2002/02/22 21:45:01 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.h,v 1.4 2003/09/28 20:15:30 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -41,15 +42,10 @@ extern void radeonUpdateTextureState( GLcontext *ctx ); -extern int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t ); +extern int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t, + GLuint face ); -extern void radeonAgeTextures( radeonContextPtr rmesa, int heap ); extern void radeonDestroyTexObj( radeonContextPtr rmesa, radeonTexObjPtr t ); -extern void radeonSwapOutTexObj( radeonContextPtr rmesa, radeonTexObjPtr t ); - -extern void radeonPrintLocalLRU( radeonContextPtr rmesa, int heap ); -extern void radeonPrintGlobalLRU( radeonContextPtr rmesa, int heap ); -extern void radeonUpdateTexLRU( radeonContextPtr rmesa, radeonTexObjPtr t ); extern void radeonInitTextureFuncs( GLcontext *ctx ); Index: xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c:1.7 xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c:1.9 --- xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c:1.7 Mon Dec 16 11:18:59 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c Thu Jan 22 22:57:06 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c,v 1.7 2002/12/16 16:18:59 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texmem.c,v 1.9 2004/01/23 03:57:06 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,26 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 on the rights to use, copy, modify, merge, publish, +distribute, sub license, 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 (including the +next paragraph) 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 +NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR THEIR +SUPPLIERS 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. **************************************************************************/ @@ -34,311 +36,190 @@ * */ -#include "radeon_context.h" -#include "radeon_tex.h" - +#include "glheader.h" +#include "imports.h" #include "context.h" +#include "macros.h" #include "simple_list.h" -#include "mem.h" +#include "radeon_context.h" +#include "radeon_ioctl.h" +#include "radeon_tex.h" -/* Destroy hardware state associated with texture `t'. +/** + * Destroy any device-dependent state associated with the texture. This may + * include NULLing out hardware state that points to the texture. */ -void radeonDestroyTexObj( radeonContextPtr rmesa, radeonTexObjPtr t ) +void +radeonDestroyTexObj( radeonContextPtr rmesa, radeonTexObjPtr t ) { - if ( !t ) - return; - if ( RADEON_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj ); - } - - if ( t->memBlock ) { - mmFreeMem( t->memBlock ); - t->memBlock = NULL; + fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)t, (void *)t->base.tObj ); } - if ( t->tObj ) - t->tObj->DriverData = NULL; - - if ( rmesa ) { - /* Bump the performace counter */ - rmesa->c_textureSwaps++; + if ( rmesa != NULL ) { + unsigned i; - if ( t == rmesa->state.texture.unit[0].texobj ) { - rmesa->state.texture.unit[0].texobj = NULL; - remove_from_list( &rmesa->hw.tex[0] ); - make_empty_list( &rmesa->hw.tex[0] ); - } - if ( t == rmesa->state.texture.unit[1].texobj ) { - rmesa->state.texture.unit[1].texobj = NULL; - remove_from_list( &rmesa->hw.tex[1] ); - make_empty_list( &rmesa->hw.tex[1] ); + for ( i = 0 ; i < rmesa->glCtx->Const.MaxTextureUnits ; i++ ) { + if ( t == rmesa->state.texture.unit[i].texobj ) { + rmesa->state.texture.unit[i].texobj = NULL; + remove_from_list( &rmesa->hw.tex[i] ); + make_empty_list( &rmesa->hw.tex[i] ); + } } } - - remove_from_list( t ); - FREE( t ); } -/* Keep track of swapped out texture objects. - */ -void radeonSwapOutTexObj( radeonContextPtr rmesa, radeonTexObjPtr t ) -{ - if ( RADEON_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj ); - } - - /* Bump the performace counter */ - rmesa->c_textureSwaps++; - - if ( t->memBlock ) { - mmFreeMem( t->memBlock ); - t->memBlock = NULL; - } - - t->dirty_images = ~0; - move_to_tail( &rmesa->texture.swapped, t ); -} - -/* Print out debugging information about texture LRU. +/* ------------------------------------------------------------ + * Texture image conversions */ -void radeonPrintLocalLRU( radeonContextPtr rmesa, int heap ) -{ - radeonTexObjPtr t; - int sz = 1 << (rmesa->radeonScreen->logTexGranularity[heap]); - - fprintf( stderr, "\nLocal LRU, heap %d:\n", heap ); - foreach ( t, &rmesa->texture.objects[heap] ) { - if (!t->tObj) { - fprintf( stderr, "Placeholder %d at 0x%x sz 0x%x\n", - t->memBlock->ofs / sz, - t->memBlock->ofs, - t->memBlock->size ); - } else { - fprintf( stderr, "Texture at 0x%x sz 0x%x\n", - t->memBlock->ofs, - t->memBlock->size ); - } - } - fprintf( stderr, "\n" ); -} - -void radeonPrintGlobalLRU( radeonContextPtr rmesa, int heap ) +static void radeonUploadRectSubImage( radeonContextPtr rmesa, + radeonTexObjPtr t, + struct gl_texture_image *texImage, + GLint x, GLint y, + GLint width, GLint height ) { - radeon_tex_region_t *list = rmesa->sarea->texList[heap]; - int i, j; - - fprintf( stderr, "\nGlobal LRU, heap %d list %p:\n", heap, list ); + const struct gl_texture_format *texFormat = texImage->TexFormat; + int blit_format, dstPitch, done; - for ( i = 0, j = RADEON_NR_TEX_REGIONS ; i < RADEON_NR_TEX_REGIONS ; i++ ) { - fprintf( stderr, "list[%d] age %d next %d prev %d\n", - j, list[j].age, list[j].next, list[j].prev ); - j = list[j].next; - if ( j == RADEON_NR_TEX_REGIONS ) break; - } - - if ( j != RADEON_NR_TEX_REGIONS ) { - fprintf( stderr, "Loop detected in global LRU\n" ); - for ( i = 0 ; i < RADEON_NR_TEX_REGIONS ; i++ ) { - fprintf( stderr, "list[%d] age %d next %d prev %d\n", - i, list[i].age, list[i].next, list[i].prev ); - } + switch ( texFormat->TexelBytes ) { + case 1: + blit_format = RADEON_GMC_DST_8BPP_CI; + break; + case 2: + blit_format = RADEON_GMC_DST_16BPP; + break; + case 4: + blit_format = RADEON_GMC_DST_32BPP; + break; + default: + fprintf( stderr, "radeonUploadRectSubImage: unknown blit_format (texelbytes=%d)\n", + texFormat->TexelBytes); + return; } - fprintf( stderr, "\n" ); -} + t->image[0][0].data = texImage->Data; -/* Reset the global texture LRU. - */ -static void radeonResetGlobalLRU( radeonContextPtr rmesa, int heap ) -{ - radeon_tex_region_t *list = rmesa->sarea->texList[heap]; - int sz = 1 << rmesa->radeonScreen->logTexGranularity[heap]; - int i; - - /* - * (Re)initialize the global circular LRU list. The last element in - * the array (RADEON_NR_TEX_REGIONS) is the sentinal. Keeping it at - * the end of the array allows it to be addressed rationally when - * looking up objects at a particular location in texture memory. + /* Currently don't need to cope with small pitches. */ - for ( i = 0 ; (i+1) * sz <= rmesa->radeonScreen->texSize[heap] ; i++ ) { - list[i].prev = i-1; - list[i].next = i+1; - list[i].age = 0; - } - - i--; - list[0].prev = RADEON_NR_TEX_REGIONS; - list[i].prev = i-1; - list[i].next = RADEON_NR_TEX_REGIONS; - list[RADEON_NR_TEX_REGIONS].prev = i; - list[RADEON_NR_TEX_REGIONS].next = 0; - rmesa->sarea->texAge[heap] = 0; -} + width = texImage->Width; + height = texImage->Height; + dstPitch = t->pp_txpitch + 32; -/* Update the local and glock texture LRUs. - */ -void radeonUpdateTexLRU(radeonContextPtr rmesa, radeonTexObjPtr t ) -{ - int heap = t->heap; - radeon_tex_region_t *list = rmesa->sarea->texList[heap]; - int sz = rmesa->radeonScreen->logTexGranularity[heap]; - int start = t->memBlock->ofs >> sz; - int end = (t->memBlock->ofs + t->memBlock->size-1) >> sz; - int i; - - rmesa->texture.age[heap] = ++rmesa->sarea->texAge[heap]; + { /* FIXME: prefer GART-texturing if possible */ + /* Data not in GART memory, or bad pitch. + */ + for (done = 0; done < height ; ) { + struct radeon_dma_region region; + int lines = MIN2( height - done, RADEON_BUFFER_SIZE / dstPitch ); + int src_pitch; + char *tex; - if ( !t->memBlock ) { - fprintf( stderr, "no memblock\n\n" ); - return; - } + src_pitch = texImage->RowStride * texFormat->TexelBytes; - /* Update our local LRU */ - move_to_head( &rmesa->texture.objects[heap], t ); + tex = (char *)texImage->Data + done * src_pitch; - /* Update the global LRU */ - for ( i = start ; i <= end ; i++ ) { - list[i].in_use = 1; - list[i].age = rmesa->texture.age[heap]; - - /* remove_from_list(i) */ - list[(CARD32)list[i].next].prev = list[i].prev; - list[(CARD32)list[i].prev].next = list[i].next; - - /* insert_at_head(list, i) */ - list[i].prev = RADEON_NR_TEX_REGIONS; - list[i].next = list[RADEON_NR_TEX_REGIONS].next; - list[(CARD32)list[RADEON_NR_TEX_REGIONS].next].prev = i; - list[RADEON_NR_TEX_REGIONS].next = i; - } - - if ( 0 ) { - radeonPrintGlobalLRU( rmesa, t->heap ); - radeonPrintLocalLRU( rmesa, t->heap ); - } -} + memset(®ion, 0, sizeof(region)); + radeonAllocDmaRegion( rmesa, ®ion, lines * dstPitch, 1024 ); -/* Update our notion of what textures have been changed since we last - * held the lock. This pertains to both our local textures and the - * textures belonging to other clients. Keep track of other client's - * textures by pushing a placeholder texture onto the LRU list -- these - * are denoted by (tObj == NULL). - */ -static void radeonTexturesGone( radeonContextPtr rmesa, int heap, - int offset, int size, int in_use ) -{ - radeonTexObjPtr t, tmp; - - foreach_s ( t, tmp, &rmesa->texture.objects[heap] ) { - if ( t->memBlock->ofs >= offset + size || - t->memBlock->ofs + t->memBlock->size <= offset ) - continue; - - /* It overlaps - kick it out. Need to hold onto the currently - * bound objects, however. - */ - radeonSwapOutTexObj( rmesa, t ); - } + /* Copy texdata to dma: + */ + if (0) + fprintf(stderr, "%s: src_pitch %d dst_pitch %d\n", + __FUNCTION__, src_pitch, dstPitch); + + if (src_pitch == dstPitch) { + memcpy( region.address, tex, lines * src_pitch ); + } + else { + char *buf = region.address; + int i; + for (i = 0 ; i < lines ; i++) { + memcpy( buf, tex, src_pitch ); + buf += dstPitch; + tex += src_pitch; + } + } - if ( in_use ) { - t = (radeonTexObjPtr) CALLOC( sizeof(*t) ); - if ( !t ) return; - - t->memBlock = mmAllocMem( rmesa->texture.heap[heap], size, 0, offset ); - if ( !t->memBlock ) { - fprintf( stderr, "Couldn't alloc placeholder sz %x ofs %x\n", - (int)size, (int)offset ); - mmDumpMemInfo( rmesa->texture.heap[heap] ); - return; - } - insert_at_head( &rmesa->texture.objects[heap], t ); - } -} + radeonEmitWait( rmesa, RADEON_WAIT_3D ); -/* Update our client's shared texture state. If another client has - * modified a region in which we have textures, then we need to figure - * out which of our textures has been removed, and update our global - * LRU. - */ -void radeonAgeTextures( radeonContextPtr rmesa, int heap ) -{ - RADEONSAREAPrivPtr sarea = rmesa->sarea; + - if ( sarea->texAge[heap] != rmesa->texture.age[heap] ) { - int sz = 1 << rmesa->radeonScreen->logTexGranularity[heap]; - int nr = 0; - int idx; - - for ( idx = sarea->texList[heap][RADEON_NR_TEX_REGIONS].prev ; - idx != RADEON_NR_TEX_REGIONS && nr < RADEON_NR_TEX_REGIONS ; - idx = sarea->texList[heap][idx].prev, nr++ ) - { - /* If switching texturing schemes, then the SAREA might not - * have been properly cleared, so we need to reset the - * global texture LRU. + /* Blit to framebuffer */ - if ( idx * sz > rmesa->radeonScreen->texSize[heap] ) { - nr = RADEON_NR_TEX_REGIONS; - break; - } + radeonEmitBlit( rmesa, + blit_format, + dstPitch, GET_START( ®ion ), + dstPitch, t->bufAddr, + 0, 0, + 0, done, + width, lines ); + + radeonEmitWait( rmesa, RADEON_WAIT_2D ); - if ( sarea->texList[heap][idx].age > rmesa->texture.age[heap] ) { - radeonTexturesGone( rmesa, heap, idx * sz, sz, - sarea->texList[heap][idx].in_use ); - } - } - - if ( nr == RADEON_NR_TEX_REGIONS ) { - radeonTexturesGone( rmesa, heap, 0, - rmesa->radeonScreen->texSize[heap], 0 ); - radeonResetGlobalLRU( rmesa, heap ); + radeonReleaseDmaRegion( rmesa, ®ion, __FUNCTION__ ); + done += lines; } - - rmesa->texture.age[heap] = sarea->texAge[heap]; } } -/* ============================================================= - * Texture image conversions - */ - -/* Upload the texture image associated with texture `t' at level `level' - * at the address relative to `start'. - */ -static void radeonUploadSubImage( radeonContextPtr rmesa, - radeonTexObjPtr t, GLint level, - GLint x, GLint y, GLint width, GLint height ) +/** + * Upload the texture image associated with texture \a t at the specified + * level at the address relative to \a start. + */ +static void uploadSubImage( radeonContextPtr rmesa, radeonTexObjPtr t, + GLint hwlevel, + GLint x, GLint y, GLint width, GLint height, + GLuint face ) { - struct gl_texture_image *texImage; - const struct gl_texture_format *texFormat; - GLint texelsPerDword = 0; - GLuint format, pitch, offset; + struct gl_texture_image *texImage = NULL; + GLuint offset; GLint imageWidth, imageHeight; GLint ret; drmRadeonTexture tex; drmRadeonTexImage tmp; + const int level = hwlevel + t->base.firstLevel; if ( RADEON_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->tObj ); + fprintf( stderr, "%s( %p, %p ) level/width/height/face = %d/%d/%d/%u\n", + __FUNCTION__, (void *)t, (void *)t->base.tObj, level, width, height, face ); } + ASSERT(face < 6); + /* Ensure we have a valid texture to upload */ - level += t->firstLevel; - if ( ( level < 0 ) || ( level >= RADEON_MAX_TEXTURE_LEVELS ) ) { - _mesa_problem(NULL, "bad texture level in radeonUploadSubimage"); + if ( ( hwlevel < 0 ) || ( hwlevel >= RADEON_MAX_TEXTURE_LEVELS ) ) { + _mesa_problem(NULL, "bad texture level in %s", __FUNCTION__); return; } - texImage = t->tObj->Image[level]; + switch (face) { + case 0: + texImage = t->base.tObj->Image[level]; + break; + case 1: + texImage = t->base.tObj->NegX[level]; + break; + case 2: + texImage = t->base.tObj->PosY[level]; + break; + case 3: + texImage = t->base.tObj->NegY[level]; + break; + case 4: + texImage = t->base.tObj->PosZ[level]; + break; + case 5: + texImage = t->base.tObj->NegZ[level]; + break; + } + if ( !texImage ) { if ( RADEON_DEBUG & DEBUG_TEXTURE ) fprintf( stderr, "%s: texImage %d is NULL!\n", __FUNCTION__, level ); @@ -350,199 +231,147 @@ return; } - texFormat = texImage->TexFormat; - switch ( texFormat->TexelBytes ) { - case 1: - texelsPerDword = 4; - break; - case 2: - texelsPerDword = 2; - break; - case 4: - texelsPerDword = 1; - break; + if (t->base.tObj->Target == GL_TEXTURE_RECTANGLE_NV) { + assert(level == 0); + assert(hwlevel == 0); + if ( RADEON_DEBUG & DEBUG_TEXTURE ) + fprintf( stderr, "%s: image data is rectangular\n", __FUNCTION__); + radeonUploadRectSubImage( rmesa, t, texImage, x, y, width, height ); + return; } - format = t->pp_txformat & RADEON_TXFORMAT_FORMAT_MASK; - imageWidth = texImage->Width; imageHeight = texImage->Height; offset = t->bufAddr; - pitch = (t->image[0].width * texFormat->TexelBytes) / 64; - -#if 0 - /* Bump the performace counter */ - rmesa->c_textureBytes += (dwords << 2); -#endif if ( RADEON_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) { GLint imageX = 0; GLint imageY = 0; - GLint blitX = t->image[level].x; - GLint blitY = t->image[level].y; - GLint blitWidth = t->image[level].width; - GLint blitHeight = t->image[level].height; + GLint blitX = t->image[face][hwlevel].x; + GLint blitY = t->image[face][hwlevel].y; + GLint blitWidth = t->image[face][hwlevel].width; + GLint blitHeight = t->image[face][hwlevel].height; fprintf( stderr, " upload image: %d,%d at %d,%d\n", imageWidth, imageHeight, imageX, imageY ); fprintf( stderr, " upload blit: %d,%d at %d,%d\n", blitWidth, blitHeight, blitX, blitY ); - fprintf( stderr, " blit ofs: 0x%07x pitch: 0x%x " - "level: %d format: %x\n", - (GLuint)offset, (GLuint)pitch, level, format ); + fprintf( stderr, " blit ofs: 0x%07x level: %d/%d\n", + (GLuint)offset, hwlevel, level ); } - t->image[level].data = texImage->Data; + t->image[face][hwlevel].data = texImage->Data; + /* Init the DRM_RADEON_TEXTURE command / drmRadeonTexture struct. + * NOTE: we're always use a 1KB-wide blit and I8 texture format. + * We used to use 1, 2 and 4-byte texels and used to use the texture + * width to dictate the blit width - but that won't work for compressed + * textures. (Brian) + */ tex.offset = offset; - tex.pitch = pitch; - tex.format = format; - tex.width = imageWidth; - tex.height = imageHeight; + tex.pitch = BLIT_WIDTH_BYTES / 64; + tex.format = RADEON_TXFORMAT_I8; /* any 1-byte texel format */ + if (texImage->TexFormat->TexelBytes) { + tex.width = imageWidth * texImage->TexFormat->TexelBytes; /* in bytes */ + tex.height = imageHeight; + } + else { + tex.width = imageWidth; /* compressed */ + tex.height = imageHeight; + if (tex.height < 4) + tex.height = 4; + } tex.image = &tmp; - memcpy( &tmp, &t->image[level], sizeof(drmRadeonTexImage) ); + /* copy (x,y,width,height,data) */ + memcpy( &tmp, &t->image[face][hwlevel], sizeof(drmRadeonTexImage) ); + LOCK_HARDWARE( rmesa ); do { ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_TEXTURE, &tex, sizeof(drmRadeonTexture) ); } while ( ret && errno == EAGAIN ); + UNLOCK_HARDWARE( rmesa ); + if ( ret ) { - UNLOCK_HARDWARE( rmesa ); fprintf( stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret ); - fprintf( stderr, " offset=0x%08x pitch=0x%x format=%d\n", - offset, pitch, format ); + fprintf( stderr, " offset=0x%08x\n", + offset ); fprintf( stderr, " image width=%d height=%d\n", imageWidth, imageHeight ); fprintf( stderr, " blit width=%d height=%d data=%p\n", - t->image[level].width, t->image[level].height, - t->image[level].data ); + t->image[face][hwlevel].width, t->image[face][hwlevel].height, + t->image[face][hwlevel].data ); exit( 1 ); } } -/* Upload the texture images associated with texture `t'. This might - * require removing our own and/or other client's texture objects to - * make room for these images. + +/** + * Upload the texture images associated with texture \a t. This might + * require the allocation of texture memory. + * + * \param rmesa Context pointer + * \param t Texture to be uploaded + * \param face Cube map face to be uploaded. Zero for non-cube maps. */ -int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t ) + +int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t, GLuint face ) { - const int numLevels = t->lastLevel - t->firstLevel + 1; - int i; - int heap; - radeonTexObjPtr t0 = rmesa->state.texture.unit[0].texobj; - radeonTexObjPtr t1 = rmesa->state.texture.unit[1].texobj; + const int numLevels = t->base.lastLevel - t->base.firstLevel + 1; if ( RADEON_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) { fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__, - rmesa->glCtx, t->tObj, t->totalSize, - t->firstLevel, t->lastLevel ); + (void *)rmesa->glCtx, (void *)t->base.tObj, t->base.totalSize, + t->base.firstLevel, t->base.lastLevel ); } - if ( !t || t->totalSize == 0 ) + if ( !t || t->base.totalSize == 0 ) return 0; LOCK_HARDWARE( rmesa ); - /* Choose the heap appropriately */ - heap = t->heap = RADEON_CARD_HEAP; -#if 0 - if ( !rmesa->radeonScreen->IsPCI && - t->totalSize > rmesa->radeonScreen->texSize[heap] ) { - heap = t->heap = RADEON_AGP_HEAP; - } -#endif - - /* Do we need to eject LRU texture objects? */ - if ( !t->memBlock ) { - /* Allocate a memory block on a 4k boundary (1<<12 == 4096) */ - t->memBlock = mmAllocMem( rmesa->texture.heap[heap], - t->totalSize, 12, 0 ); - -#if 0 - /* Try AGP before kicking anything out of local mem */ - if ( !t->memBlock && heap == RADEON_CARD_HEAP ) { - t->memBlock = mmAllocMem( rmesa->texture.heap[RADEON_AGP_HEAP], - t->totalSize, 12, 0 ); + if ( t->base.memBlock == NULL ) { + int heap; - if ( t->memBlock ) - heap = t->heap = RADEON_AGP_HEAP; - } -#endif - - /* Kick out textures until the requested texture fits */ - while ( !t->memBlock ) { - if ( rmesa->texture.objects[heap].prev == t0 || - rmesa->texture.objects[heap].prev == t1 ) { - fprintf( stderr, - "radeonUploadTexImages: ran into bound texture\n" ); - UNLOCK_HARDWARE( rmesa ); - return -1; - } - if ( rmesa->texture.objects[heap].prev == - &rmesa->texture.objects[heap] ) { - if ( rmesa->radeonScreen->IsPCI ) { - fprintf( stderr, "radeonUploadTexImages: upload texture " - "failure on local texture heaps, sz=%d\n", - t->totalSize ); - UNLOCK_HARDWARE( rmesa ); - return -1; -#if 0 - } else if ( heap == RADEON_CARD_HEAP ) { - heap = t->heap = RADEON_AGP_HEAP; - continue; -#endif - } else { - fprintf( stderr, "radeonUploadTexImages: upload texture " - "failure on both local and AGP texture heaps, " - "sz=%d\n", - t->totalSize ); - UNLOCK_HARDWARE( rmesa ); - return -1; - } - } - - radeonSwapOutTexObj( rmesa, rmesa->texture.objects[heap].prev ); - - t->memBlock = mmAllocMem( rmesa->texture.heap[heap], - t->totalSize, 12, 0 ); + heap = driAllocateTexture( rmesa->texture_heaps, rmesa->nr_heaps, + (driTextureObject *) t ); + if ( heap == -1 ) { + UNLOCK_HARDWARE( rmesa ); + return -1; } /* Set the base offset of the texture image */ - t->bufAddr = rmesa->radeonScreen->texOffset[heap] + t->memBlock->ofs; + t->bufAddr = rmesa->radeonScreen->texOffset[heap] + + t->base.memBlock->ofs; t->pp_txoffset = t->bufAddr; -#if 0 - /* Fix AGP texture offsets */ - if ( heap == RADEON_AGP_HEAP ) { - t->setup.pp_tx_offset += RADEON_AGP_TEX_OFFSET + - rmesa->radeonScreen->agpTexOffset; - } -#endif /* Mark this texobj as dirty on all units: */ t->dirty_state = TEX_ALL; } - /* Let the world know we've used this memory recently */ - radeonUpdateTexLRU( rmesa, t ); + + /* Let the world know we've used this memory recently. + */ + driUpdateTextureLRU( (driTextureObject *) t ); + UNLOCK_HARDWARE( rmesa ); + /* Upload any images that are new */ - if (t->dirty_images) { + if (t->base.dirty_images[face]) { + int i; for ( i = 0 ; i < numLevels ; i++ ) { - if ( t->dirty_images & (1 << i) ) { - radeonUploadSubImage( rmesa, t, i, 0, 0, - t->image[i].width, t->image[i].height ); + if ( (t->base.dirty_images[face] & (1 << (i+t->base.firstLevel))) != 0 ) { + uploadSubImage( rmesa, t, i, 0, 0, t->image[face][i].width, + t->image[face][i].height, face ); } } - t->dirty_images = 0; + t->base.dirty_images[face] = 0; } - - UNLOCK_HARDWARE( rmesa ); - return 0; } Index: xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c:1.6 xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c:1.9 --- xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c:1.6 Mon Dec 16 11:18:59 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c Thu Jan 22 22:57:06 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c,v 1.6 2002/12/16 16:18:59 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_texstate.c,v 1.9 2004/01/23 03:57:06 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -31,9 +32,16 @@ * Authors: * Kevin E. Martin * Gareth Hughes - * */ +#include "glheader.h" +#include "imports.h" +#include "colormac.h" +#include "context.h" +#include "macros.h" +#include "texformat.h" +#include "enums.h" + #include "radeon_context.h" #include "radeon_state.h" #include "radeon_ioctl.h" @@ -41,179 +49,159 @@ #include "radeon_tex.h" #include "radeon_tcl.h" -#include "context.h" -#include "enums.h" -#include "mem.h" -#include "texformat.h" +#define RADEON_TXFORMAT_AL88 RADEON_TXFORMAT_AI88 +#define RADEON_TXFORMAT_YCBCR RADEON_TXFORMAT_YVYU422 +#define RADEON_TXFORMAT_YCBCR_REV RADEON_TXFORMAT_VYUY422 + +#define _COLOR(f) \ + [ MESA_FORMAT_ ## f ] = { RADEON_TXFORMAT_ ## f, 0 } +#define _ALPHA(f) \ + [ MESA_FORMAT_ ## f ] = { RADEON_TXFORMAT_ ## f | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 } +#define _YUV(f) \ + [ MESA_FORMAT_ ## f ] = { RADEON_TXFORMAT_ ## f, RADEON_YUV_TO_RGB } +#define _INVALID(f) \ + [ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 } +#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_YCBCR_REV) \ + && (tx_table[f].format != 0xffffffff) ) +static const struct { + GLuint format, filter; +} +tx_table[] = +{ + _ALPHA(RGBA8888), + _ALPHA(ARGB8888), + _INVALID(RGB888), + _COLOR(RGB565), + _ALPHA(ARGB4444), + _ALPHA(ARGB1555), + _ALPHA(AL88), + _INVALID(A8), + _INVALID(L8), + _COLOR(I8), + _INVALID(CI8), + _YUV(YCBCR), + _YUV(YCBCR_REV), +}; + +#undef _COLOR +#undef _ALPHA +#undef _INVALID + +/** + * This function computes the number of bytes of storage needed for + * the given texture object (all mipmap levels, all cube faces). + * The \c image[face][level].x/y/width/height parameters for upload/blitting + * are computed here. \c pp_txfilter, \c pp_txformat, etc. will be set here + * too. + * + * \param rmesa Context pointer + * \param tObj GL texture object whose images are to be posted to + * hardware state. + */ static void radeonSetTexImages( radeonContextPtr rmesa, struct gl_texture_object *tObj ) { radeonTexObjPtr t = (radeonTexObjPtr)tObj->DriverData; const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel]; - GLint totalSize; - GLint texelsPerDword = 0, blitWidth = 0, blitPitch = 0; - GLint x, y, width, height; + GLint curOffset; GLint i; - GLint firstLevel, lastLevel, numLevels; - GLint log2Width, log2Height; - GLuint txformat = 0; + GLint numLevels; + GLint log2Width, log2Height, log2Depth; /* Set the hardware texture format */ - switch (baseImage->TexFormat->MesaFormat) { - case MESA_FORMAT_I8: - txformat = RADEON_TXFORMAT_I8; - break; - case MESA_FORMAT_AL88: - txformat = RADEON_TXFORMAT_AI88; - break; - case MESA_FORMAT_RGBA8888: - txformat = RADEON_TXFORMAT_RGBA8888; - break; - case MESA_FORMAT_ARGB8888: - txformat = RADEON_TXFORMAT_ARGB8888; - break; - case MESA_FORMAT_RGB565: - txformat = RADEON_TXFORMAT_RGB565; - break; - case MESA_FORMAT_ARGB1555: - txformat = RADEON_TXFORMAT_ARGB1555; - break; - case MESA_FORMAT_ARGB4444: - txformat = RADEON_TXFORMAT_ARGB4444; - break; - default: - _mesa_problem(NULL, "unexpected texture format in radeonTexImage2D"); - return; - } t->pp_txformat &= ~(RADEON_TXFORMAT_FORMAT_MASK | RADEON_TXFORMAT_ALPHA_IN_MAP); - t->pp_txformat |= txformat; + t->pp_txfilter &= ~RADEON_YUV_TO_RGB; - if ( txformat == RADEON_TXFORMAT_RGBA8888 || - txformat == RADEON_TXFORMAT_ARGB4444 || - txformat == RADEON_TXFORMAT_ARGB1555 || - txformat == RADEON_TXFORMAT_AI88 ) { - t->pp_txformat |= RADEON_TXFORMAT_ALPHA_IN_MAP; + if ( VALID_FORMAT( baseImage->TexFormat->MesaFormat ) ) { + t->pp_txformat |= tx_table[ baseImage->TexFormat->MesaFormat ].format; + t->pp_txfilter |= tx_table[ baseImage->TexFormat->MesaFormat ].filter; } - - /* The Radeon has a 64-byte minimum pitch for all blits. We - * calculate the equivalent number of texels to simplify the - * calculation of the texture image area. - */ - switch ( baseImage->TexFormat->TexelBytes ) { - case 1: - texelsPerDword = 4; - blitPitch = 64; - break; - case 2: - texelsPerDword = 2; - blitPitch = 32; - break; - case 4: - texelsPerDword = 1; - blitPitch = 16; - break; + else { + _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); + return; } - /* Select the larger of the two widths for our global texture image - * coordinate space. As the Radeon has very strict offset rules, we - * can't upload mipmaps directly and have to reference their location - * from the aligned start of the whole image. - */ - blitWidth = MAX2( baseImage->Width, blitPitch ); - - /* Calculate mipmap offsets and dimensions. - */ - totalSize = 0; - x = 0; - y = 0; /* Compute which mipmap levels we really want to send to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. - * Yes, this looks overly complicated, but it's all needed. */ - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ - - /* save these values */ - t->firstLevel = firstLevel; - t->lastLevel = lastLevel; - numLevels = lastLevel - firstLevel + 1; - - log2Width = tObj->Image[firstLevel]->WidthLog2; - log2Height = tObj->Image[firstLevel]->HeightLog2; + driCalculateTextureFirstLastLevel( (driTextureObject *) t ); + log2Width = tObj->Image[t->base.firstLevel]->WidthLog2; + log2Height = tObj->Image[t->base.firstLevel]->HeightLog2; + log2Depth = tObj->Image[t->base.firstLevel]->DepthLog2; + + numLevels = t->base.lastLevel - t->base.firstLevel + 1; + + assert(numLevels <= RADEON_MAX_TEXTURE_LEVELS); + + /* Calculate mipmap offsets and dimensions for blitting (uploading) + * The idea is that we lay out the mipmap levels within a block of + * memory organized as a rectangle of width BLIT_WIDTH_BYTES. + */ + curOffset = 0; - for ( i = 0 ; i < numLevels ; i++ ) { + for (i = 0; i < numLevels; i++) { const struct gl_texture_image *texImage; GLuint size; - texImage = tObj->Image[i + firstLevel]; + texImage = tObj->Image[i + t->base.firstLevel]; if ( !texImage ) break; - width = texImage->Width; - height = texImage->Height; + /* find image size in bytes */ + if (texImage->IsCompressed) { + size = texImage->CompressedSize; + } + else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) { + size = ((texImage->Width * texImage->TexFormat->TexelBytes + 63) + & ~63) * texImage->Height; + } + else { + int w = texImage->Width * texImage->TexFormat->TexelBytes; + if (w < 32) + w = 32; + size = w * texImage->Height * texImage->Depth; + } + assert(size > 0); + - /* Texture images have a minimum pitch of 32 bytes (half of the - * 64-byte minimum pitch for blits). For images that have a - * width smaller than this, we must pad each texture image - * scanline out to this amount. + /* Align to 32-byte offset. It is faster to do this unconditionally + * (no branch penalty). */ - if ( width < blitPitch / 2 ) { - width = blitPitch / 2; - } - size = width * height * baseImage->TexFormat->TexelBytes; - totalSize += size; - ASSERT( (totalSize & 31) == 0 ); - - while ( width < blitWidth && height > 1 ) { - width *= 2; - height /= 2; - } + curOffset = (curOffset + 0x1f) & ~0x1f; - assert(i < RADEON_MAX_TEXTURE_LEVELS); - t->image[i].x = x; - t->image[i].y = y; - - t->image[i].width = width; - t->image[i].height = height; - - /* While blits must have a pitch of at least 64 bytes, mipmaps - * must be aligned on a 32-byte boundary (just like each texture - * image scanline). - */ - if ( width >= blitWidth ) { - y += height; - } else { - x += width; - if ( x >= blitWidth ) { - x = 0; - y++; - } - } + t->image[0][i].x = curOffset % BLIT_WIDTH_BYTES; + t->image[0][i].y = curOffset / BLIT_WIDTH_BYTES; + t->image[0][i].width = MIN2(size, BLIT_WIDTH_BYTES); + t->image[0][i].height = size / t->image[0][i].width; + +#if 0 + /* for debugging only and only applicable to non-rectangle targets */ + assert(size % t->image[0][i].width == 0); + assert(t->image[0][i].x == 0 + || (size < BLIT_WIDTH_BYTES && t->image[0][i].height == 1)); +#endif + + if (0) + fprintf(stderr, + "level %d: %dx%d x=%d y=%d w=%d h=%d size=%d at %d\n", + i, texImage->Width, texImage->Height, + t->image[0][i].x, t->image[0][i].y, + t->image[0][i].width, t->image[0][i].height, size, curOffset); + + curOffset += size; - if ( 0 ) - fprintf( stderr, "level=%d p=%d %dx%d -> %dx%d at (%d,%d)\n", - i, blitWidth, baseImage->Width, baseImage->Height, - t->image[i].width, t->image[i].height, - t->image[i].x, t->image[i].y ); } /* Align the total size of texture memory block. */ - t->totalSize = (totalSize + RADEON_OFFSET_MASK) & ~RADEON_OFFSET_MASK; + t->base.totalSize = (curOffset + RADEON_OFFSET_MASK) & ~RADEON_OFFSET_MASK; /* Hardware state: */ @@ -221,13 +209,27 @@ t->pp_txfilter |= (numLevels - 1) << RADEON_MAX_MIP_LEVEL_SHIFT; t->pp_txformat &= ~(RADEON_TXFORMAT_WIDTH_MASK | - RADEON_TXFORMAT_HEIGHT_MASK); + RADEON_TXFORMAT_HEIGHT_MASK | + RADEON_TXFORMAT_CUBIC_MAP_ENABLE); t->pp_txformat |= ((log2Width << RADEON_TXFORMAT_WIDTH_SHIFT) | (log2Height << RADEON_TXFORMAT_HEIGHT_SHIFT)); + t->pp_txsize = (((tObj->Image[t->base.firstLevel]->Width - 1) << 0) | + ((tObj->Image[t->base.firstLevel]->Height - 1) << 16)); + + /* Only need to round to nearest 32 for textures, but the blitter + * requires 64-byte aligned pitches, and we may/may not need the + * blitter. NPOT only! + */ + if (baseImage->IsCompressed) + t->pp_txpitch = (tObj->Image[t->base.firstLevel]->Width + 63) & ~(63); + else + t->pp_txpitch = ((tObj->Image[t->base.firstLevel]->Width * baseImage->TexFormat->TexelBytes) + 63) & ~(63); + t->pp_txpitch -= 32; + t->dirty_state = TEX_ALL; - radeonUploadTexImages( rmesa, t ); + /* FYI: radeonUploadTexImages( rmesa, t ); used to be called here */ } @@ -605,7 +607,7 @@ }; -/* GL_EXT_texture_env_combine support +/* GL_ARB_texture_env_combine support */ /* The color tables have combine functions for GL_SRC_COLOR, @@ -659,6 +661,19 @@ RADEON_COLOR_ARG_A_CURRENT_ALPHA | RADEON_COMP_ARG_A }; +/* GL_ZERO table - indices 0-3 + * GL_ONE table - indices 1-4 + */ +static GLuint radeon_zero_color[] = +{ + RADEON_COLOR_ARG_A_ZERO, + RADEON_COLOR_ARG_A_ZERO | RADEON_COMP_ARG_A, + RADEON_COLOR_ARG_A_ZERO, + RADEON_COLOR_ARG_A_ZERO | RADEON_COMP_ARG_A, + RADEON_COLOR_ARG_A_ZERO +}; + + /* The alpha tables only have GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA. */ static GLuint radeon_texture_alpha[][RADEON_MAX_TEXTURE_UNITS] = @@ -693,28 +708,38 @@ RADEON_ALPHA_ARG_A_CURRENT_ALPHA | RADEON_COMP_ARG_A }; +/* GL_ZERO table - indices 0-1 + * GL_ONE table - indices 1-2 + */ +static GLuint radeon_zero_alpha[] = +{ + RADEON_ALPHA_ARG_A_ZERO, + RADEON_ALPHA_ARG_A_ZERO | RADEON_COMP_ARG_A, + RADEON_ALPHA_ARG_A_ZERO +}; + /* Extract the arg from slot A, shift it into the correct argument slot * and set the corresponding complement bit. */ -#define RADEON_COLOR_ARG( n, arg ) \ -do { \ - color_combine |= \ - ((color_arg[n] & RADEON_COLOR_ARG_MASK) \ - << RADEON_COLOR_ARG_##arg##_SHIFT); \ - color_combine |= \ - ((color_arg[n] >> RADEON_COMP_ARG_SHIFT) \ - << RADEON_COMP_ARG_##arg##_SHIFT); \ +#define RADEON_COLOR_ARG( n, arg ) \ +do { \ + color_combine |= \ + ((color_arg[n] & RADEON_COLOR_ARG_MASK) \ + << RADEON_COLOR_ARG_##arg##_SHIFT); \ + color_combine |= \ + ((color_arg[n] >> RADEON_COMP_ARG_SHIFT) \ + << RADEON_COMP_ARG_##arg##_SHIFT); \ } while (0) -#define RADEON_ALPHA_ARG( n, arg ) \ -do { \ - alpha_combine |= \ - ((alpha_arg[n] & RADEON_ALPHA_ARG_MASK) \ - << RADEON_ALPHA_ARG_##arg##_SHIFT); \ - alpha_combine |= \ - ((alpha_arg[n] >> RADEON_COMP_ARG_SHIFT) \ - << RADEON_COMP_ARG_##arg##_SHIFT); \ +#define RADEON_ALPHA_ARG( n, arg ) \ +do { \ + alpha_combine |= \ + ((alpha_arg[n] & RADEON_ALPHA_ARG_MASK) \ + << RADEON_ALPHA_ARG_##arg##_SHIFT); \ + alpha_combine |= \ + ((alpha_arg[n] >> RADEON_COMP_ARG_SHIFT) \ + << RADEON_COMP_ARG_##arg##_SHIFT); \ } while (0) @@ -726,381 +751,464 @@ { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - const struct gl_texture_object *tObj = texUnit->_Current; - const GLenum format = tObj->Image[tObj->BaseLevel]->Format; GLuint color_combine, alpha_combine; - GLuint color_arg[3], alpha_arg[3]; - GLuint i, numColorArgs = 0, numAlphaArgs = 0; + + /* texUnit->_Current can be NULL if and only if the texture unit is + * not actually enabled. + */ + assert( (texUnit->_ReallyEnabled == 0) + || (texUnit->_Current != NULL) ); if ( RADEON_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %d ) format=%s\n", __FUNCTION__, - ctx, unit, _mesa_lookup_enum_by_nr( format ) ); + fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit ); } /* Set the texture environment state. Isn't this nice and clean? - * The Radeon will automagically set the texture alpha to 0xff when + * The chip will automagically set the texture alpha to 0xff when * the texture format does not include an alpha component. This * reduces the amount of special-casing we have to do, alpha-only * textures being a notable exception. */ - switch ( texUnit->EnvMode ) { - case GL_REPLACE: - switch ( format ) { - case GL_RGBA: - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - color_combine = radeon_color_combine[unit][RADEON_REPLACE]; - alpha_combine = radeon_alpha_combine[unit][RADEON_REPLACE]; - break; - case GL_ALPHA: - color_combine = radeon_color_combine[unit][RADEON_DISABLE]; - alpha_combine = radeon_alpha_combine[unit][RADEON_REPLACE]; - break; - case GL_LUMINANCE: - case GL_RGB: - color_combine = radeon_color_combine[unit][RADEON_REPLACE]; - alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE]; - break; - case GL_COLOR_INDEX: - default: - return GL_FALSE; - } - break; - - case GL_MODULATE: - switch ( format ) { - case GL_RGBA: - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - color_combine = radeon_color_combine[unit][RADEON_MODULATE]; - alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; - break; - case GL_ALPHA: - color_combine = radeon_color_combine[unit][RADEON_DISABLE]; - alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; - break; - case GL_RGB: - case GL_LUMINANCE: - color_combine = radeon_color_combine[unit][RADEON_MODULATE]; - alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE]; - break; - case GL_COLOR_INDEX: - default: - return GL_FALSE; - } - break; - - case GL_DECAL: - switch ( format ) { - case GL_RGBA: - case GL_RGB: - color_combine = radeon_color_combine[unit][RADEON_DECAL]; - alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE]; - break; - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - color_combine = radeon_color_combine[unit][RADEON_DISABLE]; - alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE]; - break; - case GL_COLOR_INDEX: - default: - return GL_FALSE; - } - break; - - case GL_BLEND: - switch ( format ) { - case GL_RGBA: - case GL_RGB: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - color_combine = radeon_color_combine[unit][RADEON_BLEND]; - alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; - break; - case GL_ALPHA: - color_combine = radeon_color_combine[unit][RADEON_DISABLE]; - alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; - break; - case GL_INTENSITY: - color_combine = radeon_color_combine[unit][RADEON_BLEND]; - alpha_combine = radeon_alpha_combine[unit][RADEON_BLEND]; - break; - case GL_COLOR_INDEX: - default: - return GL_FALSE; - } - break; - - case GL_ADD: - switch ( format ) { - case GL_RGBA: - case GL_RGB: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - color_combine = radeon_color_combine[unit][RADEON_ADD]; - alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; - break; - case GL_ALPHA: - color_combine = radeon_color_combine[unit][RADEON_DISABLE]; - alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; - break; - case GL_INTENSITY: - color_combine = radeon_color_combine[unit][RADEON_ADD]; - alpha_combine = radeon_alpha_combine[unit][RADEON_ADD]; - break; - case GL_COLOR_INDEX: - default: - return GL_FALSE; - } - break; - - case GL_COMBINE_EXT: + if ( !texUnit->_ReallyEnabled ) { /* Don't cache these results. */ rmesa->state.texture.unit[unit].format = 0; rmesa->state.texture.unit[unit].envMode = 0; + color_combine = radeon_color_combine[unit][RADEON_DISABLE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE]; + } + else { + const struct gl_texture_object *tObj = texUnit->_Current; + const GLenum format = tObj->Image[tObj->BaseLevel]->Format; + GLuint color_arg[3], alpha_arg[3]; + GLuint i, numColorArgs = 0, numAlphaArgs = 0; + GLuint RGBshift = texUnit->CombineScaleShiftRGB; + GLuint Ashift = texUnit->CombineScaleShiftA; - /* Step 0: - * Calculate how many arguments we need to process. - */ - switch ( texUnit->CombineModeRGB ) { + switch ( texUnit->EnvMode ) { case GL_REPLACE: - numColorArgs = 1; + switch ( format ) { + case GL_RGBA: + case GL_LUMINANCE_ALPHA: + case GL_INTENSITY: + color_combine = radeon_color_combine[unit][RADEON_REPLACE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_REPLACE]; + break; + case GL_ALPHA: + color_combine = radeon_color_combine[unit][RADEON_DISABLE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_REPLACE]; + break; + case GL_LUMINANCE: + case GL_RGB: + case GL_YCBCR_MESA: + color_combine = radeon_color_combine[unit][RADEON_REPLACE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE]; + break; + case GL_COLOR_INDEX: + default: + return GL_FALSE; + } break; + case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_SUBTRACT: - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - numColorArgs = 2; + switch ( format ) { + case GL_RGBA: + case GL_LUMINANCE_ALPHA: + case GL_INTENSITY: + color_combine = radeon_color_combine[unit][RADEON_MODULATE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; + break; + case GL_ALPHA: + color_combine = radeon_color_combine[unit][RADEON_DISABLE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; + break; + case GL_RGB: + case GL_LUMINANCE: + case GL_YCBCR_MESA: + color_combine = radeon_color_combine[unit][RADEON_MODULATE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE]; + break; + case GL_COLOR_INDEX: + default: + return GL_FALSE; + } break; - case GL_INTERPOLATE: - numColorArgs = 3; + + case GL_DECAL: + switch ( format ) { + case GL_RGBA: + case GL_RGB: + case GL_YCBCR_MESA: + color_combine = radeon_color_combine[unit][RADEON_DECAL]; + alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE]; + break; + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_INTENSITY: + color_combine = radeon_color_combine[unit][RADEON_DISABLE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE]; + break; + case GL_COLOR_INDEX: + default: + return GL_FALSE; + } break; - default: - return GL_FALSE; - } - switch ( texUnit->CombineModeA ) { - case GL_REPLACE: - numAlphaArgs = 1; + case GL_BLEND: + switch ( format ) { + case GL_RGBA: + case GL_RGB: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_YCBCR_MESA: + color_combine = radeon_color_combine[unit][RADEON_BLEND]; + alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; + break; + case GL_ALPHA: + color_combine = radeon_color_combine[unit][RADEON_DISABLE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; + break; + case GL_INTENSITY: + color_combine = radeon_color_combine[unit][RADEON_BLEND]; + alpha_combine = radeon_alpha_combine[unit][RADEON_BLEND]; + break; + case GL_COLOR_INDEX: + default: + return GL_FALSE; + } break; - case GL_MODULATE: + case GL_ADD: - case GL_ADD_SIGNED: - case GL_SUBTRACT: - numAlphaArgs = 2; - break; - case GL_INTERPOLATE: - numAlphaArgs = 3; + switch ( format ) { + case GL_RGBA: + case GL_RGB: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_YCBCR_MESA: + color_combine = radeon_color_combine[unit][RADEON_ADD]; + alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; + break; + case GL_ALPHA: + color_combine = radeon_color_combine[unit][RADEON_DISABLE]; + alpha_combine = radeon_alpha_combine[unit][RADEON_MODULATE]; + break; + case GL_INTENSITY: + color_combine = radeon_color_combine[unit][RADEON_ADD]; + alpha_combine = radeon_alpha_combine[unit][RADEON_ADD]; + break; + case GL_COLOR_INDEX: + default: + return GL_FALSE; + } break; - default: - return GL_FALSE; - } - /* Step 1: - * Extract the color and alpha combine function arguments. - */ - for ( i = 0 ; i < numColorArgs ; i++ ) { - const GLuint op = texUnit->CombineOperandRGB[i] - GL_SRC_COLOR; - ASSERT(op >= 0); - ASSERT(op <= 3); - switch ( texUnit->CombineSourceRGB[i] ) { - case GL_TEXTURE: - color_arg[i] = radeon_texture_color[op][unit]; + case GL_COMBINE: + /* Don't cache these results. + */ + rmesa->state.texture.unit[unit].format = 0; + rmesa->state.texture.unit[unit].envMode = 0; + + /* Step 0: + * Calculate how many arguments we need to process. + */ + switch ( texUnit->CombineModeRGB ) { + case GL_REPLACE: + numColorArgs = 1; break; - case GL_CONSTANT: - color_arg[i] = radeon_tfactor_color[op]; + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_SUBTRACT: + case GL_DOT3_RGB: + case GL_DOT3_RGBA: + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + numColorArgs = 2; break; - case GL_PRIMARY_COLOR: - color_arg[i] = radeon_primary_color[op]; + case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + numColorArgs = 3; break; - case GL_PREVIOUS: - color_arg[i] = radeon_previous_color[op]; + default: + return GL_FALSE; + } + + switch ( texUnit->CombineModeA ) { + case GL_REPLACE: + numAlphaArgs = 1; + break; + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_SUBTRACT: + numAlphaArgs = 2; + break; + case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + numAlphaArgs = 3; break; default: return GL_FALSE; } - } - for ( i = 0 ; i < numAlphaArgs ; i++ ) { - const GLuint op = texUnit->CombineOperandA[i] - GL_SRC_ALPHA; - ASSERT(op >= 0); - ASSERT(op <= 1); - switch ( texUnit->CombineSourceA[i] ) { - case GL_TEXTURE: - alpha_arg[i] = radeon_texture_alpha[op][unit]; + /* Step 1: + * Extract the color and alpha combine function arguments. + */ + for ( i = 0 ; i < numColorArgs ; i++ ) { + const GLuint op = texUnit->CombineOperandRGB[i] - GL_SRC_COLOR; + assert(op >= 0); + assert(op <= 3); + switch ( texUnit->CombineSourceRGB[i] ) { + case GL_TEXTURE: + color_arg[i] = radeon_texture_color[op][unit]; + break; + case GL_CONSTANT: + color_arg[i] = radeon_tfactor_color[op]; + break; + case GL_PRIMARY_COLOR: + color_arg[i] = radeon_primary_color[op]; + break; + case GL_PREVIOUS: + color_arg[i] = radeon_previous_color[op]; + break; + case GL_ZERO: + color_arg[i] = radeon_zero_color[op]; + break; + case GL_ONE: + color_arg[i] = radeon_zero_color[op+1]; + break; + default: + return GL_FALSE; + } + } + + for ( i = 0 ; i < numAlphaArgs ; i++ ) { + const GLuint op = texUnit->CombineOperandA[i] - GL_SRC_ALPHA; + assert(op >= 0); + assert(op <= 1); + switch ( texUnit->CombineSourceA[i] ) { + case GL_TEXTURE: + alpha_arg[i] = radeon_texture_alpha[op][unit]; + break; + case GL_CONSTANT: + alpha_arg[i] = radeon_tfactor_alpha[op]; + break; + case GL_PRIMARY_COLOR: + alpha_arg[i] = radeon_primary_alpha[op]; + break; + case GL_PREVIOUS: + alpha_arg[i] = radeon_previous_alpha[op]; + break; + case GL_ZERO: + alpha_arg[i] = radeon_zero_alpha[op]; + break; + case GL_ONE: + alpha_arg[i] = radeon_zero_alpha[op+1]; + break; + default: + return GL_FALSE; + } + } + + /* Step 2: + * Build up the color and alpha combine functions. + */ + switch ( texUnit->CombineModeRGB ) { + case GL_REPLACE: + color_combine = (RADEON_COLOR_ARG_A_ZERO | + RADEON_COLOR_ARG_B_ZERO | + RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, C ); + break; + case GL_MODULATE: + color_combine = (RADEON_COLOR_ARG_C_ZERO | + RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, A ); + RADEON_COLOR_ARG( 1, B ); + break; + case GL_ADD: + color_combine = (RADEON_COLOR_ARG_B_ZERO | + RADEON_COMP_ARG_B | + RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, A ); + RADEON_COLOR_ARG( 1, C ); break; - case GL_CONSTANT: - alpha_arg[i] = radeon_tfactor_alpha[op]; + case GL_ADD_SIGNED: + color_combine = (RADEON_COLOR_ARG_B_ZERO | + RADEON_COMP_ARG_B | + RADEON_BLEND_CTL_ADDSIGNED | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, A ); + RADEON_COLOR_ARG( 1, C ); break; - case GL_PRIMARY_COLOR: - alpha_arg[i] = radeon_primary_alpha[op]; + case GL_SUBTRACT: + color_combine = (RADEON_COLOR_ARG_B_ZERO | + RADEON_COMP_ARG_B | + RADEON_BLEND_CTL_SUBTRACT | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, A ); + RADEON_COLOR_ARG( 1, C ); + break; + case GL_INTERPOLATE: + color_combine = (RADEON_BLEND_CTL_BLEND | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, B ); + RADEON_COLOR_ARG( 1, A ); + RADEON_COLOR_ARG( 2, C ); + break; + + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + /* The EXT version of the DOT3 extension does not support the + * scale factor, but the ARB version (and the version in OpenGL + * 1.3) does. + */ + RGBshift = 0; + Ashift = 0; + /* FALLTHROUGH */ + + case GL_DOT3_RGB: + case GL_DOT3_RGBA: + /* The R100 / RV200 only support a 1X multiplier in hardware + * w/the ARB version. + */ + if ( RGBshift != (RADEON_SCALE_1X >> RADEON_SCALE_SHIFT) ) { + return GL_FALSE; + } + + RGBshift += 2; + Ashift = RGBshift; + + color_combine = (RADEON_COLOR_ARG_C_ZERO | + RADEON_BLEND_CTL_DOT3 | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, A ); + RADEON_COLOR_ARG( 1, B ); + break; + + case GL_MODULATE_ADD_ATI: + color_combine = (RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, A ); + RADEON_COLOR_ARG( 1, C ); + RADEON_COLOR_ARG( 2, B ); break; - case GL_PREVIOUS: - alpha_arg[i] = radeon_previous_alpha[op]; + case GL_MODULATE_SIGNED_ADD_ATI: + color_combine = (RADEON_BLEND_CTL_ADDSIGNED | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, A ); + RADEON_COLOR_ARG( 1, C ); + RADEON_COLOR_ARG( 2, B ); + break; + case GL_MODULATE_SUBTRACT_ATI: + color_combine = (RADEON_BLEND_CTL_SUBTRACT | + RADEON_CLAMP_TX); + RADEON_COLOR_ARG( 0, A ); + RADEON_COLOR_ARG( 1, C ); + RADEON_COLOR_ARG( 2, B ); break; default: return GL_FALSE; } - } - /* Step 2: - * Build up the color and alpha combine functions. - */ - switch ( texUnit->CombineModeRGB ) { - case GL_REPLACE: - color_combine = (RADEON_COLOR_ARG_A_ZERO | - RADEON_COLOR_ARG_B_ZERO | - RADEON_BLEND_CTL_ADD | - RADEON_CLAMP_TX); - RADEON_COLOR_ARG( 0, C ); - break; - case GL_MODULATE: - color_combine = (RADEON_COLOR_ARG_C_ZERO | - RADEON_BLEND_CTL_ADD | - RADEON_CLAMP_TX); - RADEON_COLOR_ARG( 0, A ); - RADEON_COLOR_ARG( 1, B ); - break; - case GL_ADD: - color_combine = (RADEON_COLOR_ARG_B_ZERO | - RADEON_COMP_ARG_B | - RADEON_BLEND_CTL_ADD | - RADEON_CLAMP_TX); - RADEON_COLOR_ARG( 0, A ); - RADEON_COLOR_ARG( 1, C ); - break; - case GL_ADD_SIGNED: - color_combine = (RADEON_COLOR_ARG_B_ZERO | - RADEON_COMP_ARG_B | - RADEON_BLEND_CTL_ADDSIGNED | - RADEON_CLAMP_TX); - RADEON_COLOR_ARG( 0, A ); - RADEON_COLOR_ARG( 1, C ); - break; - case GL_SUBTRACT: - color_combine = (RADEON_COLOR_ARG_B_ZERO | - RADEON_COMP_ARG_B | - RADEON_BLEND_CTL_SUBTRACT | - RADEON_CLAMP_TX); - RADEON_COLOR_ARG( 0, A ); - RADEON_COLOR_ARG( 1, C ); - break; - case GL_INTERPOLATE: - color_combine = (RADEON_BLEND_CTL_BLEND | - RADEON_CLAMP_TX); - RADEON_COLOR_ARG( 0, B ); - RADEON_COLOR_ARG( 1, A ); - RADEON_COLOR_ARG( 2, C ); - break; + switch ( texUnit->CombineModeA ) { + case GL_REPLACE: + alpha_combine = (RADEON_ALPHA_ARG_A_ZERO | + RADEON_ALPHA_ARG_B_ZERO | + RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX); + RADEON_ALPHA_ARG( 0, C ); + break; + case GL_MODULATE: + alpha_combine = (RADEON_ALPHA_ARG_C_ZERO | + RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX); + RADEON_ALPHA_ARG( 0, A ); + RADEON_ALPHA_ARG( 1, B ); + break; + case GL_ADD: + alpha_combine = (RADEON_ALPHA_ARG_B_ZERO | + RADEON_COMP_ARG_B | + RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX); + RADEON_ALPHA_ARG( 0, A ); + RADEON_ALPHA_ARG( 1, C ); + break; + case GL_ADD_SIGNED: + alpha_combine = (RADEON_ALPHA_ARG_B_ZERO | + RADEON_COMP_ARG_B | + RADEON_BLEND_CTL_ADDSIGNED | + RADEON_CLAMP_TX); + RADEON_ALPHA_ARG( 0, A ); + RADEON_ALPHA_ARG( 1, C ); + break; + case GL_SUBTRACT: + alpha_combine = (RADEON_COLOR_ARG_B_ZERO | + RADEON_COMP_ARG_B | + RADEON_BLEND_CTL_SUBTRACT | + RADEON_CLAMP_TX); + RADEON_ALPHA_ARG( 0, A ); + RADEON_ALPHA_ARG( 1, C ); + break; + case GL_INTERPOLATE: + alpha_combine = (RADEON_BLEND_CTL_BLEND | + RADEON_CLAMP_TX); + RADEON_ALPHA_ARG( 0, B ); + RADEON_ALPHA_ARG( 1, A ); + RADEON_ALPHA_ARG( 2, C ); + break; + + case GL_MODULATE_ADD_ATI: + alpha_combine = (RADEON_BLEND_CTL_ADD | + RADEON_CLAMP_TX); + RADEON_ALPHA_ARG( 0, A ); + RADEON_ALPHA_ARG( 1, C ); + RADEON_ALPHA_ARG( 2, B ); + break; + case GL_MODULATE_SIGNED_ADD_ATI: + alpha_combine = (RADEON_BLEND_CTL_ADDSIGNED | + RADEON_CLAMP_TX); + RADEON_ALPHA_ARG( 0, A ); + RADEON_ALPHA_ARG( 1, C ); + RADEON_ALPHA_ARG( 2, B ); + break; + case GL_MODULATE_SUBTRACT_ATI: + alpha_combine = (RADEON_BLEND_CTL_SUBTRACT | + RADEON_CLAMP_TX); + RADEON_ALPHA_ARG( 0, A ); + RADEON_ALPHA_ARG( 1, C ); + RADEON_ALPHA_ARG( 2, B ); + break; + default: + return GL_FALSE; + } - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - if ( texUnit->CombineScaleShiftRGB - != (RADEON_SCALE_1X >> RADEON_SCALE_SHIFT) ) - { - return GL_FALSE; + if ( (texUnit->CombineModeRGB == GL_DOT3_RGB_EXT) + || (texUnit->CombineModeRGB == GL_DOT3_RGB) ) { + alpha_combine |= RADEON_DOT_ALPHA_DONT_REPLICATE; } - /* FALLTHROUGH */ - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - color_combine = (RADEON_COLOR_ARG_C_ZERO | - RADEON_BLEND_CTL_DOT3 | - RADEON_CLAMP_TX); - RADEON_COLOR_ARG( 0, A ); - RADEON_COLOR_ARG( 1, B ); - break; - default: - return GL_FALSE; - } + /* Step 3: + * Apply the scale factor. + */ + color_combine |= (RGBshift << RADEON_SCALE_SHIFT); + alpha_combine |= (Ashift << RADEON_SCALE_SHIFT); - switch ( texUnit->CombineModeA ) { - case GL_REPLACE: - alpha_combine = (RADEON_ALPHA_ARG_A_ZERO | - RADEON_ALPHA_ARG_B_ZERO | - RADEON_BLEND_CTL_ADD | - RADEON_CLAMP_TX); - RADEON_ALPHA_ARG( 0, C ); - break; - case GL_MODULATE: - alpha_combine = (RADEON_ALPHA_ARG_C_ZERO | - RADEON_BLEND_CTL_ADD | - RADEON_CLAMP_TX); - RADEON_ALPHA_ARG( 0, A ); - RADEON_ALPHA_ARG( 1, B ); - break; - case GL_ADD: - alpha_combine = (RADEON_ALPHA_ARG_B_ZERO | - RADEON_COMP_ARG_B | - RADEON_BLEND_CTL_ADD | - RADEON_CLAMP_TX); - RADEON_ALPHA_ARG( 0, A ); - RADEON_ALPHA_ARG( 1, C ); - break; - case GL_ADD_SIGNED: - alpha_combine = (RADEON_ALPHA_ARG_B_ZERO | - RADEON_COMP_ARG_B | - RADEON_BLEND_CTL_ADDSIGNED | - RADEON_CLAMP_TX); - RADEON_ALPHA_ARG( 0, A ); - RADEON_ALPHA_ARG( 1, C ); - break; - case GL_SUBTRACT: - alpha_combine = (RADEON_COLOR_ARG_B_ZERO | - RADEON_COMP_ARG_B | - RADEON_BLEND_CTL_SUBTRACT | - RADEON_CLAMP_TX); - RADEON_ALPHA_ARG( 0, A ); - RADEON_ALPHA_ARG( 1, C ); - break; - case GL_INTERPOLATE: - alpha_combine = (RADEON_BLEND_CTL_BLEND | - RADEON_CLAMP_TX); - RADEON_ALPHA_ARG( 0, B ); - RADEON_ALPHA_ARG( 1, A ); - RADEON_ALPHA_ARG( 2, C ); + /* All done! + */ break; + default: return GL_FALSE; } - - if ( (texUnit->CombineModeRGB == GL_DOT3_RGB_EXT) - || (texUnit->CombineModeRGB == GL_DOT3_RGB_ARB) ) { - alpha_combine |= RADEON_DOT_ALPHA_DONT_REPLICATE; - } - - /* Step 3: - * Apply the scale factor. The EXT version of the DOT3 extension does - * not support the scale factor, but the ARB version (and the version in - * OpenGL 1.3) does. The catch is that the Radeon only supports a 1X - * multiplier in hardware w/the ARB version. - */ - if ( texUnit->CombineModeRGB != GL_DOT3_RGB_EXT && - texUnit->CombineModeRGB != GL_DOT3_RGBA_EXT && - texUnit->CombineModeRGB != GL_DOT3_RGB && - texUnit->CombineModeRGB != GL_DOT3_RGBA ) { - color_combine |= (texUnit->CombineScaleShiftRGB << RADEON_SCALE_SHIFT); - alpha_combine |= (texUnit->CombineScaleShiftA << RADEON_SCALE_SHIFT); - } - else - { - color_combine |= RADEON_SCALE_4X; - alpha_combine |= RADEON_SCALE_4X; - } - - /* All done! - */ - break; - - default: - return GL_FALSE; } if ( rmesa->hw.tex[unit].cmd[TEX_PP_TXCBLEND] != color_combine || @@ -1109,7 +1217,7 @@ rmesa->hw.tex[unit].cmd[TEX_PP_TXCBLEND] = color_combine; rmesa->hw.tex[unit].cmd[TEX_PP_TXABLEND] = alpha_combine; } - + return GL_TRUE; } @@ -1117,13 +1225,20 @@ RADEON_MIN_FILTER_MASK | \ RADEON_MAG_FILTER_MASK | \ RADEON_MAX_ANISO_MASK | \ + RADEON_YUV_TO_RGB | \ + RADEON_YUV_TEMPERATURE_MASK | \ RADEON_CLAMP_S_MASK | \ - RADEON_CLAMP_T_MASK) + RADEON_CLAMP_T_MASK | \ + RADEON_BORDER_MODE_D3D ) #define TEXOBJ_TXFORMAT_MASK (RADEON_TXFORMAT_WIDTH_MASK | \ RADEON_TXFORMAT_HEIGHT_MASK | \ RADEON_TXFORMAT_FORMAT_MASK | \ - RADEON_TXFORMAT_ALPHA_IN_MAP) + RADEON_TXFORMAT_F5_WIDTH_MASK | \ + RADEON_TXFORMAT_F5_HEIGHT_MASK | \ + RADEON_TXFORMAT_ALPHA_IN_MAP | \ + RADEON_TXFORMAT_CUBIC_MAP_ENABLE | \ + RADEON_TXFORMAT_NON_POWER2) static void import_tex_obj_state( radeonContextPtr rmesa, @@ -1133,14 +1248,21 @@ GLuint *cmd = RADEON_DB_STATE( tex[unit] ); cmd[TEX_PP_TXFILTER] &= ~TEXOBJ_TXFILTER_MASK; - cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK; cmd[TEX_PP_TXFILTER] |= texobj->pp_txfilter & TEXOBJ_TXFILTER_MASK; + cmd[TEX_PP_TXFORMAT] &= ~TEXOBJ_TXFORMAT_MASK; cmd[TEX_PP_TXFORMAT] |= texobj->pp_txformat & TEXOBJ_TXFORMAT_MASK; cmd[TEX_PP_TXOFFSET] = texobj->pp_txoffset; cmd[TEX_PP_BORDER_COLOR] = texobj->pp_border_color; - texobj->dirty_state &= ~(1<hw.tex[unit] ); + + if (texobj->base.tObj->Target == GL_TEXTURE_RECTANGLE_NV) { + GLuint *txr_cmd = RADEON_DB_STATE( txr[unit] ); + txr_cmd[TXR_PP_TEX_SIZE] = texobj->pp_txsize; /* NPOT only! */ + txr_cmd[TXR_PP_TEX_PITCH] = texobj->pp_txpitch; /* NPOT only! */ + RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.txr[unit] ); + } + + texobj->dirty_state &= ~(1<TexGenEnabled |= RADEON_TEXMAT_0_ENABLE<TexGenMatrix[unit].m[0] = s_plane[0]; rmesa->TexGenMatrix[unit].m[4] = s_plane[1]; @@ -1185,10 +1307,6 @@ rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_INPUT_MASK<TexGenNeedNormals[unit] = 0; - if (0) - fprintf(stderr, "%s unit %d cleared texgenEnabled %x\n", __FUNCTION__, - unit, rmesa->TexGenEnabled); - if ((texUnit->TexGenEnabled & (S_BIT|T_BIT)) == 0) { /* Disabled, no fallback: */ @@ -1207,7 +1325,7 @@ texUnit->GenModeS != texUnit->GenModeT) { /* Mixed modes, fallback: */ -/* fprintf(stderr, "fallback mixed texgen\n"); */ + /* fprintf(stderr, "fallback mixed texgen\n"); */ return GL_FALSE; } else @@ -1250,100 +1368,28 @@ rmesa->NewGLState |= _NEW_TEXTURE_MATRIX; } -/* fprintf(stderr, "%s unit %d texgenEnabled %x\n", __FUNCTION__, */ -/* unit, rmesa->TexGenEnabled); */ return GL_TRUE; } - - -static GLboolean radeonUpdateTextureUnit( GLcontext *ctx, int unit ) +static void disable_tex( GLcontext *ctx, int unit ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - - if ( texUnit->_ReallyEnabled & (TEXTURE0_1D|TEXTURE0_2D) ) { - struct gl_texture_object *tObj = texUnit->_Current; - radeonTexObjPtr t = (radeonTexObjPtr) tObj->DriverData; - GLenum format; - - /* Fallback if there's a texture border */ - if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) - return GL_FALSE; - - /* Upload teximages (not pipelined) - */ - if ( t->dirty_images ) { - RADEON_FIREVERTICES( rmesa ); - radeonSetTexImages( rmesa, tObj ); - /* Fallback if we can't upload: + if (rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (RADEON_TEX_0_ENABLE<state.texture.unit[unit].texobj != NULL ) { + /* The old texture is no longer bound to this texture unit. + * Mark it as such. */ - if ( !t->memBlock ) - return GL_FALSE; - } - - /* Update state if this is a different texture object to last - * time. - */ - if ( rmesa->state.texture.unit[unit].texobj != t ) { - rmesa->state.texture.unit[unit].texobj = t; - t->dirty_state |= 1<hw.ctx.cmd[CTX_PP_CNTL] & (RADEON_TEX_0_ENABLE<hw.ctx.cmd[CTX_PP_CNTL] |= - (RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit; - - RADEON_STATECHANGE( rmesa, tcl ); - - if (unit == 0) - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_ST0; - else - rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_ST1; - - rmesa->recheck_texgen[unit] = GL_TRUE; - } - - if (t->dirty_state & (1<recheck_texgen[unit]) { - GLboolean fallback = !radeon_validate_texgen( ctx, unit ); - TCL_FALLBACK( ctx, (RADEON_TCL_FALLBACK_TEXGEN_0<recheck_texgen[unit] = 0; - rmesa->NewGLState |= _NEW_TEXTURE_MATRIX; + rmesa->state.texture.unit[unit].texobj->base.bound &= ~(1UL << unit); + rmesa->state.texture.unit[unit].texobj = NULL; } - format = tObj->Image[tObj->BaseLevel]->Format; - if ( rmesa->state.texture.unit[unit].format != format || - rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode ) { - rmesa->state.texture.unit[unit].format = format; - rmesa->state.texture.unit[unit].envMode = texUnit->EnvMode; - if ( ! radeonUpdateTextureEnv( ctx, unit ) ) { - return GL_FALSE; - } - } - } - else if ( texUnit->_ReallyEnabled ) { - /* 3d textures, etc: - */ - return GL_FALSE; - } - else if (rmesa->hw.ctx.cmd[CTX_PP_CNTL] & (RADEON_TEX_0_ENABLE<state.texture.unit[unit].texobj = 0; RADEON_STATECHANGE( rmesa, ctx ); rmesa->hw.ctx.cmd[CTX_PP_CNTL] &= - ~((RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit); + ~((RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit); RADEON_STATECHANGE( rmesa, tcl ); switch (unit) { @@ -1376,7 +1422,7 @@ rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_INPUT_MASK<TexGenNeedNormals[unit] = 0; rmesa->TexGenEnabled |= - (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift; + (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift; if (tmp != rmesa->TexGenEnabled) { rmesa->recheck_texgen[unit] = GL_TRUE; @@ -1384,10 +1430,166 @@ } } } +} + +static GLboolean enable_tex_2d( GLcontext *ctx, int unit ) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *tObj = texUnit->_Current; + radeonTexObjPtr t = (radeonTexObjPtr) tObj->DriverData; + + /* Need to load the 2d images associated with this unit. + */ + if (t->pp_txformat & RADEON_TXFORMAT_NON_POWER2) { + t->pp_txformat &= ~RADEON_TXFORMAT_NON_POWER2; + t->base.dirty_images[0] = ~0; + } + + ASSERT(tObj->Target == GL_TEXTURE_2D || tObj->Target == GL_TEXTURE_1D); + + if ( t->base.dirty_images[0] ) { + RADEON_FIREVERTICES( rmesa ); + radeonSetTexImages( rmesa, tObj ); + radeonUploadTexImages( rmesa, (radeonTexObjPtr) tObj->DriverData, 0 ); + if ( !t->base.memBlock ) + return GL_FALSE; + } return GL_TRUE; } +static GLboolean enable_tex_rect( GLcontext *ctx, int unit ) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *tObj = texUnit->_Current; + radeonTexObjPtr t = (radeonTexObjPtr) tObj->DriverData; + + if (!(t->pp_txformat & RADEON_TXFORMAT_NON_POWER2)) { + t->pp_txformat |= RADEON_TXFORMAT_NON_POWER2; + t->base.dirty_images[0] = ~0; + } + + ASSERT(tObj->Target == GL_TEXTURE_RECTANGLE_NV); + + if ( t->base.dirty_images[0] ) { + RADEON_FIREVERTICES( rmesa ); + radeonSetTexImages( rmesa, tObj ); + radeonUploadTexImages( rmesa, (radeonTexObjPtr) tObj->DriverData, 0 ); + if ( !t->base.memBlock /* && !rmesa->prefer_gart_client_texturing FIXME */ ) { + fprintf(stderr, "%s: upload failed\n", __FUNCTION__); + return GL_FALSE; + } + } + + return GL_TRUE; +} + + +static GLboolean update_tex_common( GLcontext *ctx, int unit ) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *tObj = texUnit->_Current; + radeonTexObjPtr t = (radeonTexObjPtr) tObj->DriverData; + GLenum format; + + /* Fallback if there's a texture border */ + if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) { + fprintf(stderr, "%s: border\n", __FUNCTION__); + return GL_FALSE; + } + + /* Update state if this is a different texture object to last + * time. + */ + if ( rmesa->state.texture.unit[unit].texobj != t ) { + if ( rmesa->state.texture.unit[unit].texobj != NULL ) { + /* The old texture is no longer bound to this texture unit. + * Mark it as such. + */ + + rmesa->state.texture.unit[unit].texobj->base.bound &= + ~(1UL << unit); + } + + rmesa->state.texture.unit[unit].texobj = t; + t->base.bound |= (1UL << unit); + t->dirty_state |= 1<hw.ctx.cmd[CTX_PP_CNTL] & (RADEON_TEX_0_ENABLE<hw.ctx.cmd[CTX_PP_CNTL] |= + (RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit; + + RADEON_STATECHANGE( rmesa, tcl ); + + if (unit == 0) + rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_ST0; + else + rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_TCL_VTX_ST1; + + rmesa->recheck_texgen[unit] = GL_TRUE; + } + + if (t->dirty_state & (1<recheck_texgen[unit]) { + GLboolean fallback = !radeon_validate_texgen( ctx, unit ); + TCL_FALLBACK( ctx, (RADEON_TCL_FALLBACK_TEXGEN_0<recheck_texgen[unit] = 0; + rmesa->NewGLState |= _NEW_TEXTURE_MATRIX; + } + + format = tObj->Image[tObj->BaseLevel]->Format; + if ( rmesa->state.texture.unit[unit].format != format || + rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode ) { + rmesa->state.texture.unit[unit].format = format; + rmesa->state.texture.unit[unit].envMode = texUnit->EnvMode; + if ( ! radeonUpdateTextureEnv( ctx, unit ) ) { + return GL_FALSE; + } + } + + FALLBACK( rmesa, RADEON_FALLBACK_BORDER_MODE, t->border_fallback ); + return !t->border_fallback; +} + + + +static GLboolean radeonUpdateTextureUnit( GLcontext *ctx, int unit ) +{ + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + + TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_TEXRECT_0 << unit, 0 ); + + if ( texUnit->_ReallyEnabled & (TEXTURE_RECT_BIT) ) { + TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_TEXRECT_0 << unit, 1 ); + + return (enable_tex_rect( ctx, unit ) && + update_tex_common( ctx, unit )); + } + else if ( texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT) ) { + return (enable_tex_2d( ctx, unit ) && + update_tex_common( ctx, unit )); + } + else if ( texUnit->_ReallyEnabled ) { + return GL_FALSE; + } + else { + disable_tex( ctx, unit ); + return GL_TRUE; + } +} + void radeonUpdateTextureState( GLcontext *ctx ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); Index: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c:1.5 xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c:1.8 --- xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c:1.5 Mon Dec 16 11:18:59 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c Thu Jan 22 22:57:06 2004 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c,v 1.5 2002/12/16 16:18:59 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c,v 1.8 2004/01/23 03:57:06 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,45 +6,37 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Keith Whitwell - * */ #include "glheader.h" -#include "radeon_context.h" -#include "radeon_state.h" -#include "radeon_ioctl.h" -#include "radeon_tex.h" -#include "radeon_tcl.h" -#include "radeon_vtxfmt.h" - +#include "imports.h" #include "api_noop.h" #include "api_arrayelt.h" #include "context.h" -#include "mem.h" -#include "mmath.h" #include "mtypes.h" #include "enums.h" #include "glapi.h" @@ -57,9 +49,15 @@ #include "tnl/t_context.h" #include "tnl/t_array_api.h" -struct radeon_vb vb; +#include "radeon_context.h" +#include "radeon_state.h" +#include "radeon_ioctl.h" +#include "radeon_tex.h" +#include "radeon_tcl.h" +#include "radeon_swtcl.h" +#include "radeon_vtxfmt.h" -static void radeonFlushVertices( GLcontext *, GLuint ); +static void radeonVtxfmtFlushVertices( GLcontext *, GLuint ); static void count_func( const char *name, struct dynfn *l ) { @@ -105,48 +103,47 @@ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); assert(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT); - assert(vb.context == ctx); if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_N0) { - ctx->Current.Normal[0] = vb.normalptr[0]; - ctx->Current.Normal[1] = vb.normalptr[1]; - ctx->Current.Normal[2] = vb.normalptr[2]; + ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0] = rmesa->vb.normalptr[0]; + ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1] = rmesa->vb.normalptr[1]; + ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2] = rmesa->vb.normalptr[2]; } if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_PKCOLOR) { - ctx->Current.Color[0] = UBYTE_TO_FLOAT( vb.colorptr->red ); - ctx->Current.Color[1] = UBYTE_TO_FLOAT( vb.colorptr->green ); - ctx->Current.Color[2] = UBYTE_TO_FLOAT( vb.colorptr->blue ); - ctx->Current.Color[3] = UBYTE_TO_FLOAT( vb.colorptr->alpha ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->red ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->green ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->blue ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT( rmesa->vb.colorptr->alpha ); } if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_FPCOLOR) { - ctx->Current.Color[0] = vb.floatcolorptr[0]; - ctx->Current.Color[1] = vb.floatcolorptr[1]; - ctx->Current.Color[2] = vb.floatcolorptr[2]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] = rmesa->vb.floatcolorptr[0]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] = rmesa->vb.floatcolorptr[1]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] = rmesa->vb.floatcolorptr[2]; } if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_FPALPHA) - ctx->Current.Color[3] = vb.floatcolorptr[3]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = rmesa->vb.floatcolorptr[3]; if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_PKSPEC) { - ctx->Current.SecondaryColor[0] = UBYTE_TO_FLOAT( vb.specptr->red ); - ctx->Current.SecondaryColor[1] = UBYTE_TO_FLOAT( vb.specptr->green ); - ctx->Current.SecondaryColor[2] = UBYTE_TO_FLOAT( vb.specptr->blue ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] = UBYTE_TO_FLOAT( rmesa->vb.specptr->red ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] = UBYTE_TO_FLOAT( rmesa->vb.specptr->green ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] = UBYTE_TO_FLOAT( rmesa->vb.specptr->blue ); } if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_ST0) { - ctx->Current.Texcoord[0][0] = vb.texcoordptr[0][0]; - ctx->Current.Texcoord[0][1] = vb.texcoordptr[0][1]; - ctx->Current.Texcoord[0][2] = 0.0F; - ctx->Current.Texcoord[0][3] = 1.0F; + ctx->Current.Attrib[VERT_ATTRIB_TEX0][0] = rmesa->vb.texcoordptr[0][0]; + ctx->Current.Attrib[VERT_ATTRIB_TEX0][1] = rmesa->vb.texcoordptr[0][1]; + ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] = 0.0F; + ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] = 1.0F; } if (rmesa->vb.vertex_format & RADEON_CP_VC_FRMT_ST1) { - ctx->Current.Texcoord[1][0] = vb.texcoordptr[1][0]; - ctx->Current.Texcoord[1][1] = vb.texcoordptr[1][1]; - ctx->Current.Texcoord[1][2] = 0.0F; - ctx->Current.Texcoord[1][3] = 1.0F; + ctx->Current.Attrib[VERT_ATTRIB_TEX1][0] = rmesa->vb.texcoordptr[1][0]; + ctx->Current.Attrib[VERT_ATTRIB_TEX1][1] = rmesa->vb.texcoordptr[1][1]; + ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] = 0.0F; + ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] = 1.0F; } ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT; @@ -171,12 +168,12 @@ struct radeon_dma_region tmp = rmesa->dma.current; tmp.buf->refcount++; - tmp.aos_size = vb.vertex_size; - tmp.aos_stride = vb.vertex_size; + tmp.aos_size = rmesa->vb.vertex_size; + tmp.aos_stride = rmesa->vb.vertex_size; tmp.aos_start = GET_START(&tmp); rmesa->dma.current.ptr = rmesa->dma.current.start += - (vb.initial_counter - vb.counter) * vb.vertex_size * 4; + (rmesa->vb.initial_counter - rmesa->vb.counter) * rmesa->vb.vertex_size * 4; rmesa->tcl.vertex_format = rmesa->vb.vertex_format; rmesa->tcl.aos_components[0] = &tmp; @@ -210,7 +207,7 @@ rmesa->vb.primlist[i].start, rmesa->vb.primlist[i].end); - radeonEmitPrimitive( vb.context, + radeonEmitPrimitive( rmesa->glCtx, rmesa->vb.primlist[i].start, rmesa->vb.primlist[i].end, rmesa->vb.primlist[i].prim ); @@ -224,20 +221,20 @@ static void start_prim( radeonContextPtr rmesa, GLuint mode ) { if (RADEON_DEBUG & DEBUG_VFMT) - fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter); + fprintf(stderr, "%s %d\n", __FUNCTION__, rmesa->vb.initial_counter - rmesa->vb.counter); - rmesa->vb.primlist[rmesa->vb.nrprims].start = vb.initial_counter - vb.counter; + rmesa->vb.primlist[rmesa->vb.nrprims].start = rmesa->vb.initial_counter - rmesa->vb.counter; rmesa->vb.primlist[rmesa->vb.nrprims].prim = mode; } static void note_last_prim( radeonContextPtr rmesa, GLuint flags ) { if (RADEON_DEBUG & DEBUG_VFMT) - fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter); + fprintf(stderr, "%s %d\n", __FUNCTION__, rmesa->vb.initial_counter - rmesa->vb.counter); if (rmesa->vb.prim[0] != GL_POLYGON+1) { rmesa->vb.primlist[rmesa->vb.nrprims].prim |= flags; - rmesa->vb.primlist[rmesa->vb.nrprims].end = vb.initial_counter - vb.counter; + rmesa->vb.primlist[rmesa->vb.nrprims].end = rmesa->vb.initial_counter - rmesa->vb.counter; if (++(rmesa->vb.nrprims) == RADEON_MAX_PRIMS) flush_prims( rmesa ); @@ -251,12 +248,12 @@ GLfloat *src = (GLfloat *)(rmesa->dma.current.address + rmesa->dma.current.ptr + (rmesa->vb.primlist[rmesa->vb.nrprims].start + n) * - vb.vertex_size * 4); + rmesa->vb.vertex_size * 4); if (RADEON_DEBUG & DEBUG_VFMT) fprintf(stderr, "copy_vertex %d\n", rmesa->vb.primlist[rmesa->vb.nrprims].start + n); - for (i = 0 ; i < vb.vertex_size; i++) { + for (i = 0 ; i < rmesa->vb.vertex_size; i++) { dst[i] = src[i]; } } @@ -268,7 +265,7 @@ static GLuint copy_dma_verts( radeonContextPtr rmesa, GLfloat (*tmp)[15] ) { GLuint ovf, i; - GLuint nr = (vb.initial_counter - vb.counter) - rmesa->vb.primlist[rmesa->vb.nrprims].start; + GLuint nr = (rmesa->vb.initial_counter - rmesa->vb.counter) - rmesa->vb.primlist[rmesa->vb.nrprims].start; if (RADEON_DEBUG & DEBUG_VFMT) fprintf(stderr, "%s %d verts\n", __FUNCTION__, nr); @@ -311,13 +308,16 @@ return 2; } case GL_TRIANGLE_STRIP: - ovf = MIN2( nr-1, 2 ); + ovf = MIN2(nr, 2); for (i = 0 ; i < ovf ; i++) copy_vertex( rmesa, nr-ovf+i, tmp[i] ); return i; case GL_QUAD_STRIP: - ovf = MIN2( nr-1, 2 ); - if (nr > 2) ovf += nr&1; + switch (nr) { + case 0: ovf = 0; break; + case 1: ovf = 1; break; + default: ovf = 2 + (nr&1); break; + } for (i = 0 ; i < ovf ; i++) copy_vertex( rmesa, nr-ovf+i, tmp[i] ); return i; @@ -329,30 +329,30 @@ static void VFMT_FALLBACK_OUTSIDE_BEGIN_END( const char *caller ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS)) fprintf(stderr, "%s from %s\n", __FUNCTION__, caller); if (ctx->Driver.NeedFlush) - radeonFlushVertices( ctx, ctx->Driver.NeedFlush ); + radeonVtxfmtFlushVertices( ctx, ctx->Driver.NeedFlush ); if (ctx->NewState) _mesa_update_state( ctx ); /* clear state so fell_back sticks */ _tnl_wakeup_exec( ctx ); + ctx->Driver.FlushVertices = radeonFlushVertices; assert( rmesa->dma.flush == 0 ); rmesa->vb.fell_back = GL_TRUE; rmesa->vb.installed = GL_FALSE; - vb.context = 0; } static void VFMT_FALLBACK( const char *caller ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); GLfloat tmp[3][15]; GLuint i, prim; @@ -382,15 +382,15 @@ prim = rmesa->vb.prim[0]; ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1; _tnl_wakeup_exec( ctx ); + ctx->Driver.FlushVertices = radeonFlushVertices; assert(rmesa->dma.flush == 0); rmesa->vb.fell_back = GL_TRUE; rmesa->vb.installed = GL_FALSE; - vb.context = 0; glBegin( prim ); if (rmesa->vb.installed_color_3f_sz == 4) - alpha = ctx->Current.Color[3]; + alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]; /* Replay saved vertices */ @@ -436,50 +436,50 @@ /* Replay current vertex */ if (ind & RADEON_CP_VC_FRMT_N0) - glNormal3fv( vb.normalptr ); + glNormal3fv( rmesa->vb.normalptr ); if (ind & RADEON_CP_VC_FRMT_PKCOLOR) - glColor4ub( vb.colorptr->red, vb.colorptr->green, vb.colorptr->blue, vb.colorptr->alpha ); + glColor4ub( rmesa->vb.colorptr->red, rmesa->vb.colorptr->green, rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha ); else if (ind & RADEON_CP_VC_FRMT_FPALPHA) - glColor4fv( vb.floatcolorptr ); + glColor4fv( rmesa->vb.floatcolorptr ); else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) { if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0) - glColor4f( vb.floatcolorptr[0], - vb.floatcolorptr[1], - vb.floatcolorptr[2], + glColor4f( rmesa->vb.floatcolorptr[0], + rmesa->vb.floatcolorptr[1], + rmesa->vb.floatcolorptr[2], alpha ); else - glColor3fv( vb.floatcolorptr ); + glColor3fv( rmesa->vb.floatcolorptr ); } if (ind & RADEON_CP_VC_FRMT_PKSPEC) - _glapi_Dispatch->SecondaryColor3ubEXT( vb.specptr->red, vb.specptr->green, vb.specptr->blue ); + _glapi_Dispatch->SecondaryColor3ubEXT( rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue ); if (ind & RADEON_CP_VC_FRMT_ST0) - glTexCoord2fv( vb.texcoordptr[0] ); + glTexCoord2fv( rmesa->vb.texcoordptr[0] ); if (ind & RADEON_CP_VC_FRMT_ST1) - glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, vb.texcoordptr[1] ); + glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, rmesa->vb.texcoordptr[1] ); } static void wrap_buffer( void ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); GLfloat tmp[3][15]; GLuint i, nrverts; if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_PRIMS)) - fprintf(stderr, "%s %d\n", __FUNCTION__, vb.initial_counter - vb.counter); + fprintf(stderr, "%s %d\n", __FUNCTION__, rmesa->vb.initial_counter - rmesa->vb.counter); /* Don't deal with parity. */ - if ((((vb.initial_counter - vb.counter) - + if ((((rmesa->vb.initial_counter - rmesa->vb.counter) - rmesa->vb.primlist[rmesa->vb.nrprims].start) & 1)) { - vb.counter++; - vb.initial_counter++; + rmesa->vb.counter++; + rmesa->vb.initial_counter++; return; } @@ -508,12 +508,12 @@ /* Reset counter, dmaptr */ - vb.dmaptr = (int *)(rmesa->dma.current.ptr + rmesa->dma.current.address); - vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) / - (vb.vertex_size * 4); - vb.counter--; - vb.initial_counter = vb.counter; - vb.notify = wrap_buffer; + rmesa->vb.dmaptr = (int *)(rmesa->dma.current.ptr + rmesa->dma.current.address); + rmesa->vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) / + (rmesa->vb.vertex_size * 4); + rmesa->vb.counter--; + rmesa->vb.initial_counter = rmesa->vb.counter; + rmesa->vb.notify = wrap_buffer; rmesa->dma.flush = flush_prims; @@ -527,15 +527,15 @@ for (i = 0 ; i < nrverts; i++) { if (RADEON_DEBUG & DEBUG_VERTS) { int j; - fprintf(stderr, "re-emit vertex %d to %p\n", i, vb.dmaptr); + fprintf(stderr, "re-emit vertex %d to %p\n", i, (void *)rmesa->vb.dmaptr); if (RADEON_DEBUG & DEBUG_VERBOSE) - for (j = 0 ; j < vb.vertex_size; j++) + for (j = 0 ; j < rmesa->vb.vertex_size; j++) fprintf(stderr, "\t%08x/%f\n", *(int*)&tmp[i][j], tmp[i][j]); } - memcpy( vb.dmaptr, tmp[i], vb.vertex_size * 4 ); - vb.dmaptr += vb.vertex_size; - vb.counter--; + memcpy( rmesa->vb.dmaptr, tmp[i], rmesa->vb.vertex_size * 4 ); + rmesa->vb.dmaptr += rmesa->vb.vertex_size; + rmesa->vb.counter--; } } @@ -563,11 +563,11 @@ * directly. */ if (ctx->Light.ColorMaterialEnabled) { - ind |= RADEON_CP_VC_FRMT_FPCOLOR; - if (ctx->Color.AlphaEnabled) { - ind |= RADEON_CP_VC_FRMT_FPALPHA; - } + ind |= (RADEON_CP_VC_FRMT_FPCOLOR | + RADEON_CP_VC_FRMT_FPALPHA); } + else + ind |= RADEON_CP_VC_FRMT_PKCOLOR; /* for alpha? */ } else { /* TODO: make this data driven? @@ -585,8 +585,8 @@ ind |= RADEON_CP_VC_FRMT_N0; } } else { - if (ctx->Current.Texcoord[0][2] != 0.0F || - ctx->Current.Texcoord[0][3] != 1.0) { + if (ctx->Current.Attrib[VERT_ATTRIB_TEX0][2] != 0.0F || + ctx->Current.Attrib[VERT_ATTRIB_TEX0][3] != 1.0) { if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS)) fprintf(stderr, "%s: rq0\n", __FUNCTION__); return GL_FALSE; @@ -601,8 +601,8 @@ ind |= RADEON_CP_VC_FRMT_N0; } } else { - if (ctx->Current.Texcoord[1][2] != 0.0F || - ctx->Current.Texcoord[1][3] != 1.0) { + if (ctx->Current.Attrib[VERT_ATTRIB_TEX1][2] != 0.0F || + ctx->Current.Attrib[VERT_ATTRIB_TEX1][3] != 1.0) { if (RADEON_DEBUG & (DEBUG_VFMT|DEBUG_FALLBACKS)) fprintf(stderr, "%s: rq1\n", __FUNCTION__); return GL_FALSE; @@ -616,72 +616,71 @@ RADEON_NEWPRIM(rmesa); rmesa->vb.vertex_format = ind; - vb.vertex_size = 3; + rmesa->vb.vertex_size = 3; rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive; - vb.normalptr = ctx->Current.Normal; - vb.colorptr = NULL; - vb.floatcolorptr = ctx->Current.Color; - vb.specptr = NULL; - vb.floatspecptr = ctx->Current.SecondaryColor; - vb.texcoordptr[0] = ctx->Current.Texcoord[0]; - vb.texcoordptr[1] = ctx->Current.Texcoord[1]; + rmesa->vb.normalptr = ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; + rmesa->vb.colorptr = NULL; + rmesa->vb.floatcolorptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; + rmesa->vb.specptr = NULL; + rmesa->vb.floatspecptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; + rmesa->vb.texcoordptr[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; + rmesa->vb.texcoordptr[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1]; /* Run through and initialize the vertex components in the order * the hardware understands: */ if (ind & RADEON_CP_VC_FRMT_N0) { - vb.normalptr = &vb.vertex[vb.vertex_size].f; - vb.vertex_size += 3; - vb.normalptr[0] = ctx->Current.Normal[0]; - vb.normalptr[1] = ctx->Current.Normal[1]; - vb.normalptr[2] = ctx->Current.Normal[2]; + rmesa->vb.normalptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f; + rmesa->vb.vertex_size += 3; + rmesa->vb.normalptr[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]; + rmesa->vb.normalptr[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]; + rmesa->vb.normalptr[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]; } if (ind & RADEON_CP_VC_FRMT_PKCOLOR) { - vb.colorptr = &vb.vertex[vb.vertex_size].color; - vb.vertex_size += 1; - UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->red, ctx->Current.Color[0] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->green, ctx->Current.Color[1] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->blue, ctx->Current.Color[2] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.colorptr->alpha, ctx->Current.Color[3] ); + rmesa->vb.colorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].color; + rmesa->vb.vertex_size += 1; + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.colorptr->alpha, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] ); } if (ind & RADEON_CP_VC_FRMT_FPCOLOR) { assert(!(ind & RADEON_CP_VC_FRMT_PKCOLOR)); - vb.floatcolorptr = &vb.vertex[vb.vertex_size].f; - vb.vertex_size += 3; - vb.floatcolorptr[0] = ctx->Current.Color[0]; - vb.floatcolorptr[1] = ctx->Current.Color[1]; - vb.floatcolorptr[2] = ctx->Current.Color[2]; + rmesa->vb.floatcolorptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].f; + rmesa->vb.vertex_size += 3; + rmesa->vb.floatcolorptr[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]; + rmesa->vb.floatcolorptr[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]; + rmesa->vb.floatcolorptr[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]; if (ind & RADEON_CP_VC_FRMT_FPALPHA) { - vb.vertex_size += 1; - vb.floatcolorptr[3] = ctx->Current.Color[3]; + rmesa->vb.vertex_size += 1; + rmesa->vb.floatcolorptr[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]; } } if (ind & RADEON_CP_VC_FRMT_PKSPEC) { - vb.specptr = &vb.vertex[vb.vertex_size].color; - vb.vertex_size += 1; - UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->red, ctx->Current.SecondaryColor[0] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->green, ctx->Current.SecondaryColor[1] ); - UNCLAMPED_FLOAT_TO_CHAN( vb.specptr->blue, ctx->Current.SecondaryColor[2] ); + rmesa->vb.specptr = &rmesa->vb.vertex[rmesa->vb.vertex_size].color; + rmesa->vb.vertex_size += 1; + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] ); + UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] ); } - if (ind & RADEON_CP_VC_FRMT_ST0) { - vb.texcoordptr[0] = &vb.vertex[vb.vertex_size].f; - vb.vertex_size += 2; - vb.texcoordptr[0][0] = ctx->Current.Texcoord[0][0]; - vb.texcoordptr[0][1] = ctx->Current.Texcoord[0][1]; + rmesa->vb.texcoordptr[0] = &rmesa->vb.vertex[rmesa->vb.vertex_size].f; + rmesa->vb.vertex_size += 2; + rmesa->vb.texcoordptr[0][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][0]; + rmesa->vb.texcoordptr[0][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0][1]; } if (ind & RADEON_CP_VC_FRMT_ST1) { - vb.texcoordptr[1] = &vb.vertex[vb.vertex_size].f; - vb.vertex_size += 2; - vb.texcoordptr[1][0] = ctx->Current.Texcoord[1][0]; - vb.texcoordptr[1][1] = ctx->Current.Texcoord[1][1]; + rmesa->vb.texcoordptr[1] = &rmesa->vb.vertex[rmesa->vb.vertex_size].f; + rmesa->vb.vertex_size += 2; + rmesa->vb.texcoordptr[1][0] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][0]; + rmesa->vb.texcoordptr[1][1] = ctx->Current.Attrib[VERT_ATTRIB_TEX1][1]; } if (rmesa->vb.installed_vertex_format != rmesa->vb.vertex_format) { @@ -697,7 +696,6 @@ return GL_TRUE; } - void radeonVtxfmtInvalidate( GLcontext *ctx ) { radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); @@ -731,10 +729,9 @@ fprintf(stderr, "reinstall (new install)\n"); _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); - ctx->Driver.FlushVertices = radeonFlushVertices; + ctx->Driver.FlushVertices = radeonVtxfmtFlushVertices; ctx->Driver.NewList = radeonNewList; rmesa->vb.installed = GL_TRUE; - vb.context = ctx; } else if (RADEON_DEBUG & DEBUG_VFMT) fprintf(stderr, "%s: already installed", __FUNCTION__); @@ -747,8 +744,8 @@ if (rmesa->dma.flush) rmesa->dma.flush( rmesa ); _tnl_wakeup_exec( ctx ); + ctx->Driver.FlushVertices = radeonFlushVertices; rmesa->vb.installed = GL_FALSE; - vb.context = 0; } } } @@ -760,7 +757,7 @@ static void radeon_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); if (RADEON_DEBUG & DEBUG_VFMT) @@ -772,7 +769,7 @@ return; } _mesa_noop_Materialfv( face, pname, params ); - radeonUpdateMaterial( vb.context ); + radeonUpdateMaterial( ctx ); } @@ -780,11 +777,12 @@ */ static void radeon_Begin( GLenum mode ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - + if (RADEON_DEBUG & DEBUG_VFMT) - fprintf(stderr, "%s\n", __FUNCTION__); + fprintf(stderr, "%s( %s )\n", __FUNCTION__, + _mesa_lookup_enum_by_nr( mode )); if (mode > GL_POLYGON) { _mesa_error( ctx, GL_INVALID_ENUM, "glBegin" ); @@ -811,7 +809,7 @@ } - if (rmesa->dma.flush && vb.counter < 12) { + if (rmesa->dma.flush && rmesa->vb.counter < 12) { if (RADEON_DEBUG & DEBUG_VFMT) fprintf(stderr, "%s: flush almost-empty buffers\n", __FUNCTION__); flush_prims( rmesa ); @@ -820,20 +818,20 @@ /* Need to arrange to save vertices here? Or always copy from dma (yuk)? */ if (!rmesa->dma.flush) { - if (rmesa->dma.current.ptr + 12*vb.vertex_size*4 > + if (rmesa->dma.current.ptr + 12*rmesa->vb.vertex_size*4 > rmesa->dma.current.end) { RADEON_NEWPRIM( rmesa ); radeonRefillCurrentDmaRegion( rmesa ); } - vb.dmaptr = (int *)(rmesa->dma.current.address + rmesa->dma.current.ptr); - vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) / - (vb.vertex_size * 4); - vb.counter--; - vb.initial_counter = vb.counter; - vb.notify = wrap_buffer; + rmesa->vb.dmaptr = (int *)(rmesa->dma.current.address + rmesa->dma.current.ptr); + rmesa->vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) / + (rmesa->vb.vertex_size * 4); + rmesa->vb.counter--; + rmesa->vb.initial_counter = rmesa->vb.counter; + rmesa->vb.notify = wrap_buffer; rmesa->dma.flush = flush_prims; - vb.context->Driver.NeedFlush |= FLUSH_STORED_VERTICES; + ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; } @@ -845,7 +843,7 @@ static void radeon_End( void ) { - GLcontext *ctx = vb.context; + GET_CURRENT_CONTEXT(ctx); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); if (RADEON_DEBUG & DEBUG_VFMT) @@ -905,7 +903,7 @@ return GL_TRUE; } -static void radeonFlushVertices( GLcontext *ctx, GLuint flags ) +static void radeonVtxfmtFlushVertices( GLcontext *ctx, GLuint flags ) { radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); @@ -913,7 +911,6 @@ fprintf(stderr, "%s\n", __FUNCTION__); assert(rmesa->vb.installed); - assert(vb.context == ctx); if (flags & FLUSH_UPDATE_CURRENT) { radeon_copy_to_current( ctx ); @@ -1006,7 +1003,6 @@ TNL_CONTEXT(ctx)->Driver.NotifyBegin = radeonNotifyBegin; - vb.context = ctx; rmesa->vb.enabled = 1; rmesa->vb.prim = &ctx->Driver.CurrentExecPrimitive; rmesa->vb.primflags = 0; @@ -1051,44 +1047,10 @@ } } -void radeonVtxfmtUnbindContext( GLcontext *ctx ) -{ - if (RADEON_CONTEXT(ctx)->vb.installed) { - assert(vb.context == ctx); - VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ ); - } - - TNL_CONTEXT(ctx)->Driver.NotifyBegin = 0; -} void radeonVtxfmtMakeCurrent( GLcontext *ctx ) { - radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); - -#if defined(THREADS) - static GLboolean ThreadSafe = GL_FALSE; /* In thread-safe mode? */ - if (!ThreadSafe) { - static unsigned long knownID; - static GLboolean firstCall = GL_TRUE; - if (firstCall) { - knownID = _glthread_GetID(); - firstCall = GL_FALSE; - } - else if (knownID != _glthread_GetID()) { - ThreadSafe = GL_TRUE; - - if (RADEON_DEBUG & (DEBUG_DRI|DEBUG_VFMT)) - fprintf(stderr, "**** Multithread situation!\n"); - } - } - if (ThreadSafe) - return; -#endif - - if (rmesa->vb.enabled) { - TNL_CONTEXT(ctx)->Driver.NotifyBegin = radeonNotifyBegin; - } } Index: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h:1.3 xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h:1.4 --- xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h:1.3 Sat Dec 21 12:02:16 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h Sun Sep 28 16:15:31 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h,v 1.3 2002/12/21 17:02:16 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.h,v 1.4 2003/09/28 20:15:31 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,31 +6,31 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ /* * Authors: * Keith Whitwell - * */ #ifndef __RADEON_VTXFMT_H__ @@ -41,10 +41,6 @@ #include "radeon_context.h" - -extern struct radeon_vb vb; - - extern void radeonVtxfmtUpdate( GLcontext *ctx ); extern void radeonVtxfmtInit( GLcontext *ctx ); extern void radeonVtxfmtInvalidate( GLcontext *ctx ); @@ -77,13 +73,13 @@ /* Useful for figuring out the offsets: */ -#define FIXUP2( CODE, OFFSET, CHECKVAL, NEWVAL ) \ -do { \ - while (*(int *)(CODE+OFFSET) != CHECKVAL) OFFSET++; \ - /* fprintf(stderr, "%s/%d CVAL %x OFFSET %d VAL %x\n", __FUNCTION__, */ \ -/* __LINE__, CHECKVAL, OFFSET, (int)(NEWVAL)); */ \ - *(int *)(CODE+OFFSET) = (int)(NEWVAL); \ - OFFSET += 4; \ +#define FIXUP2( CODE, OFFSET, CHECKVAL, NEWVAL ) \ +do { \ + while (*(int *)(CODE+OFFSET) != CHECKVAL) OFFSET++; \ + fprintf(stderr, "%s/%d CVAL %x OFFSET %d VAL %x\n", __FUNCTION__, \ + __LINE__, CHECKVAL, OFFSET, (int)(NEWVAL)); \ + *(int *)(CODE+OFFSET) = (int)(NEWVAL); \ + OFFSET += 4; \ } while (0) /* Index: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c:1.2 xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c:1.3 --- xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c:1.2 Mon Dec 16 11:18:59 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c Sun Sep 28 16:15:31 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c,v 1.2 2002/12/16 16:18:59 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_c.c,v 1.3 2003/09/28 20:15:31 alanh Exp $ */ /************************************************************************** Copyright 2002 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -31,6 +32,7 @@ * Authors: * Keith Whitwell */ +#include "glheader.h" #include "mtypes.h" #include "colormac.h" #include "simple_list.h" @@ -45,65 +47,73 @@ */ static void radeon_Vertex3f( GLfloat x, GLfloat y, GLfloat z ) { + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); int i; - *vb.dmaptr++ = *(int *)&x; - *vb.dmaptr++ = *(int *)&y; - *vb.dmaptr++ = *(int *)&z; + *rmesa->vb.dmaptr++ = *(int *)&x; + *rmesa->vb.dmaptr++ = *(int *)&y; + *rmesa->vb.dmaptr++ = *(int *)&z; - for (i = 3; i < vb.vertex_size; i++) - *vb.dmaptr++ = vb.vertex[i].i; + for (i = 3; i < rmesa->vb.vertex_size; i++) + *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i; - if (--vb.counter == 0) - vb.notify(); + if (--rmesa->vb.counter == 0) + rmesa->vb.notify(); } static void radeon_Vertex3fv( const GLfloat *v ) { + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); int i; - *vb.dmaptr++ = *(int *)&v[0]; - *vb.dmaptr++ = *(int *)&v[1]; - *vb.dmaptr++ = *(int *)&v[2]; + *rmesa->vb.dmaptr++ = *(int *)&v[0]; + *rmesa->vb.dmaptr++ = *(int *)&v[1]; + *rmesa->vb.dmaptr++ = *(int *)&v[2]; - for (i = 3; i < vb.vertex_size; i++) - *vb.dmaptr++ = vb.vertex[i].i; + for (i = 3; i < rmesa->vb.vertex_size; i++) + *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i; - if (--vb.counter == 0) - vb.notify(); + if (--rmesa->vb.counter == 0) + rmesa->vb.notify(); } static void radeon_Vertex2f( GLfloat x, GLfloat y ) { + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); int i; - *vb.dmaptr++ = *(int *)&x; - *vb.dmaptr++ = *(int *)&y; - *vb.dmaptr++ = 0; + *rmesa->vb.dmaptr++ = *(int *)&x; + *rmesa->vb.dmaptr++ = *(int *)&y; + *rmesa->vb.dmaptr++ = 0; - for (i = 3; i < vb.vertex_size; i++) - *vb.dmaptr++ = *(int *)&vb.vertex[i]; + for (i = 3; i < rmesa->vb.vertex_size; i++) + *rmesa->vb.dmaptr++ = *(int *)&rmesa->vb.vertex[i]; - if (--vb.counter == 0) - vb.notify(); + if (--rmesa->vb.counter == 0) + rmesa->vb.notify(); } static void radeon_Vertex2fv( const GLfloat *v ) { + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); int i; - *vb.dmaptr++ = *(int *)&v[0]; - *vb.dmaptr++ = *(int *)&v[1]; - *vb.dmaptr++ = 0; + *rmesa->vb.dmaptr++ = *(int *)&v[0]; + *rmesa->vb.dmaptr++ = *(int *)&v[1]; + *rmesa->vb.dmaptr++ = 0; - for (i = 3; i < vb.vertex_size; i++) - *vb.dmaptr++ = vb.vertex[i].i; + for (i = 3; i < rmesa->vb.vertex_size; i++) + *rmesa->vb.dmaptr++ = rmesa->vb.vertex[i].i; - if (--vb.counter == 0) - vb.notify(); + if (--rmesa->vb.counter == 0) + rmesa->vb.notify(); } @@ -112,7 +122,9 @@ */ static void radeon_Color3ub_ub( GLubyte r, GLubyte g, GLubyte b ) { - radeon_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.colorptr; dest->red = r; dest->green = g; dest->blue = b; @@ -121,7 +133,9 @@ static void radeon_Color3ubv_ub( const GLubyte *v ) { - radeon_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.colorptr; dest->red = v[0]; dest->green = v[1]; dest->blue = v[2]; @@ -130,7 +144,9 @@ static void radeon_Color4ub_ub( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { - radeon_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.colorptr; dest->red = r; dest->green = g; dest->blue = b; @@ -139,13 +155,17 @@ static void radeon_Color4ubv_ub( const GLubyte *v ) { - *(GLuint *)vb.colorptr = LE32_TO_CPU(*(GLuint *)v); + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + *(GLuint *)rmesa->vb.colorptr = LE32_TO_CPU(*(GLuint *)v); } static void radeon_Color3f_ub( GLfloat r, GLfloat g, GLfloat b ) { - radeon_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.colorptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b ); @@ -154,7 +174,9 @@ static void radeon_Color3fv_ub( const GLfloat *v ) { - radeon_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.colorptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] ); @@ -163,7 +185,9 @@ static void radeon_Color4f_ub( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) { - radeon_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.colorptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b ); @@ -172,7 +196,9 @@ static void radeon_Color4fv_ub( const GLfloat *v ) { - radeon_color_t *dest = vb.colorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.colorptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] ); @@ -184,7 +210,9 @@ */ static void radeon_Color3ub_4f( GLubyte r, GLubyte g, GLubyte b ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); @@ -193,7 +221,9 @@ static void radeon_Color3ubv_4f( const GLubyte *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); @@ -202,7 +232,9 @@ static void radeon_Color4ub_4f( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); @@ -211,7 +243,9 @@ static void radeon_Color4ubv_4f( const GLubyte *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); @@ -221,7 +255,9 @@ static void radeon_Color3f_4f( GLfloat r, GLfloat g, GLfloat b ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = r; dest[1] = g; dest[2] = b; @@ -230,7 +266,9 @@ static void radeon_Color3fv_4f( const GLfloat *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -239,7 +277,9 @@ static void radeon_Color4f_4f( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = r; dest[1] = g; dest[2] = b; @@ -248,7 +288,9 @@ static void radeon_Color4fv_4f( const GLfloat *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -260,7 +302,9 @@ */ static void radeon_Color3ub_3f( GLubyte r, GLubyte g, GLubyte b ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); @@ -268,7 +312,9 @@ static void radeon_Color3ubv_3f( const GLubyte *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); @@ -276,26 +322,32 @@ static void radeon_Color4ub_3f( GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); - vb.context->Current.Color[3] = UBYTE_TO_FLOAT(a); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(a); } static void radeon_Color4ubv_3f( const GLubyte *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); - vb.context->Current.Color[3] = UBYTE_TO_FLOAT(v[3]); + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = UBYTE_TO_FLOAT(v[3]); } static void radeon_Color3f_3f( GLfloat r, GLfloat g, GLfloat b ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = r; dest[1] = g; dest[2] = b; @@ -303,7 +355,9 @@ static void radeon_Color3fv_3f( const GLfloat *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -311,20 +365,24 @@ static void radeon_Color4f_3f( GLfloat r, GLfloat g, GLfloat b, GLfloat a ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = r; dest[1] = g; dest[2] = b; - vb.context->Current.Color[3] = a; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = a; } static void radeon_Color4fv_3f( const GLfloat *v ) { - GLfloat *dest = vb.floatcolorptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatcolorptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; - vb.context->Current.Color[3] = v[3]; + ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = v[3]; } @@ -332,7 +390,9 @@ */ static void radeon_SecondaryColor3ubEXT_ub( GLubyte r, GLubyte g, GLubyte b ) { - radeon_color_t *dest = vb.specptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.specptr; dest->red = r; dest->green = g; dest->blue = b; @@ -341,7 +401,9 @@ static void radeon_SecondaryColor3ubvEXT_ub( const GLubyte *v ) { - radeon_color_t *dest = vb.specptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.specptr; dest->red = v[0]; dest->green = v[1]; dest->blue = v[2]; @@ -350,7 +412,9 @@ static void radeon_SecondaryColor3fEXT_ub( GLfloat r, GLfloat g, GLfloat b ) { - radeon_color_t *dest = vb.specptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.specptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, r ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, g ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, b ); @@ -359,7 +423,9 @@ static void radeon_SecondaryColor3fvEXT_ub( const GLfloat *v ) { - radeon_color_t *dest = vb.specptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeon_color_t *dest = rmesa->vb.specptr; UNCLAMPED_FLOAT_TO_UBYTE( dest->red, v[0] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->green, v[1] ); UNCLAMPED_FLOAT_TO_UBYTE( dest->blue, v[2] ); @@ -368,7 +434,9 @@ static void radeon_SecondaryColor3ubEXT_3f( GLubyte r, GLubyte g, GLubyte b ) { - GLfloat *dest = vb.floatspecptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatspecptr; dest[0] = UBYTE_TO_FLOAT(r); dest[1] = UBYTE_TO_FLOAT(g); dest[2] = UBYTE_TO_FLOAT(b); @@ -377,7 +445,9 @@ static void radeon_SecondaryColor3ubvEXT_3f( const GLubyte *v ) { - GLfloat *dest = vb.floatspecptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatspecptr; dest[0] = UBYTE_TO_FLOAT(v[0]); dest[1] = UBYTE_TO_FLOAT(v[1]); dest[2] = UBYTE_TO_FLOAT(v[2]); @@ -386,7 +456,9 @@ static void radeon_SecondaryColor3fEXT_3f( GLfloat r, GLfloat g, GLfloat b ) { - GLfloat *dest = vb.floatspecptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatspecptr; dest[0] = r; dest[1] = g; dest[2] = b; @@ -395,7 +467,9 @@ static void radeon_SecondaryColor3fvEXT_3f( const GLfloat *v ) { - GLfloat *dest = vb.floatspecptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.floatspecptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -407,7 +481,9 @@ */ static void radeon_Normal3f( GLfloat n0, GLfloat n1, GLfloat n2 ) { - GLfloat *dest = vb.normalptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.normalptr; dest[0] = n0; dest[1] = n1; dest[2] = n2; @@ -415,7 +491,9 @@ static void radeon_Normal3fv( const GLfloat *v ) { - GLfloat *dest = vb.normalptr; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.normalptr; dest[0] = v[0]; dest[1] = v[1]; dest[2] = v[2]; @@ -426,59 +504,83 @@ */ static void radeon_TexCoord1f( GLfloat s ) { - GLfloat *dest = vb.texcoordptr[0]; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[0]; dest[0] = s; dest[1] = 0; } static void radeon_TexCoord1fv( const GLfloat *v ) { - GLfloat *dest = vb.texcoordptr[0]; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[0]; dest[0] = v[0]; dest[1] = 0; } static void radeon_TexCoord2f( GLfloat s, GLfloat t ) { - GLfloat *dest = vb.texcoordptr[0]; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[0]; dest[0] = s; dest[1] = t; } static void radeon_TexCoord2fv( const GLfloat *v ) { - GLfloat *dest = vb.texcoordptr[0]; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[0]; dest[0] = v[0]; dest[1] = v[1]; } /* MultiTexcoord + * + * Technically speaking, these functions should subtract GL_TEXTURE0 from + * \c target before masking and using it. The value of GL_TEXTURE0 is 0x84C0, + * which has the low-order 5 bits 0. For all possible valid values of + * \c target. Subtracting GL_TEXTURE0 has the net effect of masking \c target + * with 0x1F. Masking with 0x1F and then masking with 0x01 is redundant, so + * the subtraction has been omitted. */ + static void radeon_MultiTexCoord1fARB( GLenum target, GLfloat s ) { - GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1]; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[target & 1]; dest[0] = s; dest[1] = 0; } static void radeon_MultiTexCoord1fvARB( GLenum target, const GLfloat *v ) { - GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1]; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[target & 1]; dest[0] = v[0]; dest[1] = 0; } static void radeon_MultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t ) { - GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1]; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[target & 1]; dest[0] = s; dest[1] = t; } static void radeon_MultiTexCoord2fvARB( GLenum target, const GLfloat *v ) { - GLfloat *dest = vb.texcoordptr[(target - GL_TEXTURE0_ARB)&1]; + GET_CURRENT_CONTEXT(ctx); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat *dest = rmesa->vb.texcoordptr[target & 1]; dest[0] = v[0]; dest[1] = v[1]; } @@ -501,25 +603,27 @@ #define CHOOSE(FN, FNTYPE, MASK, ACTIVE, ARGS1, ARGS2 ) \ static void choose_##FN ARGS1 \ { \ - radeonContextPtr rmesa = RADEON_CONTEXT(vb.context); \ + GET_CURRENT_CONTEXT(ctx); \ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \ int key = rmesa->vb.vertex_format & (MASK|ACTIVE); \ - struct dynfn *dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \ + struct dynfn *dfn; \ \ + dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \ if (dfn == 0) \ - dfn = rmesa->vb.codegen.FN( vb.context, key ); \ + dfn = rmesa->vb.codegen.FN( ctx, key ); \ else if (RADEON_DEBUG & DEBUG_CODEGEN) \ fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \ \ if (dfn) \ - vb.context->Exec->FN = (FNTYPE)(dfn->code); \ + ctx->Exec->FN = (FNTYPE)(dfn->code); \ else { \ if (RADEON_DEBUG & DEBUG_CODEGEN) \ fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \ - vb.context->Exec->FN = radeon_##FN; \ + ctx->Exec->FN = radeon_##FN; \ } \ \ - vb.context->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ - vb.context->Exec->FN ARGS2; \ + ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ + ctx->Exec->FN ARGS2; \ } @@ -534,8 +638,8 @@ #define CHOOSE_COLOR(FN, FNTYPE, NR, MASK, ACTIVE, ARGS1, ARGS2 ) \ static void choose_##FN ARGS1 \ { \ - GLcontext *ctx = vb.context; \ - radeonContextPtr rmesa = RADEON_CONTEXT(vb.context); \ + GET_CURRENT_CONTEXT(ctx); \ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \ int key = rmesa->vb.vertex_format & (MASK|ACTIVE); \ struct dynfn *dfn; \ \ @@ -547,7 +651,7 @@ \ if (rmesa->vb.installed_color_3f_sz != NR) { \ rmesa->vb.installed_color_3f_sz = NR; \ - if (NR == 3) ctx->Current.Color[3] = 1.0; \ + if (NR == 3) ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3] = 1.0; \ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \ radeon_copy_to_current( ctx ); \ _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \ @@ -589,22 +693,22 @@ #define CHOOSE_SECONDARY_COLOR(FN, FNTYPE, MASK, ACTIVE, ARGS1, ARGS2 ) \ static void choose_##FN ARGS1 \ { \ - GLcontext *ctx = vb.context; \ - radeonContextPtr rmesa = RADEON_CONTEXT(vb.context); \ + GET_CURRENT_CONTEXT(ctx); \ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \ int key = rmesa->vb.vertex_format & (MASK|ACTIVE); \ struct dynfn *dfn = lookup( &rmesa->vb.dfn_cache.FN, key ); \ \ if (dfn == 0) \ - dfn = rmesa->vb.codegen.FN( vb.context, key ); \ + dfn = rmesa->vb.codegen.FN( ctx, key ); \ else if (RADEON_DEBUG & DEBUG_CODEGEN) \ fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \ \ if (dfn) \ - vb.context->Exec->FN = (FNTYPE)(dfn->code); \ + ctx->Exec->FN = (FNTYPE)(dfn->code); \ else { \ if (RADEON_DEBUG & DEBUG_CODEGEN) \ fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \ - vb.context->Exec->FN = ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \ + ctx->Exec->FN = ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \ ? radeon_##FN##_ub : radeon_##FN##_3f; \ } \ \ Index: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c:1.1 xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c:1.2 --- xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c:1.1 Wed Oct 30 07:51:58 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c Sun Sep 28 16:15:31 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c,v 1.1 2002/10/30 12:51:58 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_sse.c,v 1.2 2003/09/28 20:15:31 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -32,50 +33,193 @@ * Keith Whitwell */ -#include -#include -#include "mem.h" +#include "glheader.h" +#include "imports.h" #include "simple_list.h" #include "radeon_vtxfmt.h" #if defined(USE_SSE_ASM) #include "X86/common_x86_asm.h" +#define EXTERN( FUNC ) \ +extern const char *FUNC; \ +extern const char *FUNC##_end + +EXTERN( _sse_Attribute2fv ); +EXTERN( _sse_Attribute2f ); +EXTERN( _sse_Attribute3fv ); +EXTERN( _sse_Attribute3f ); +EXTERN( _sse_MultiTexCoord2fv ); +EXTERN( _sse_MultiTexCoord2f ); +EXTERN( _sse_MultiTexCoord2fv_2 ); +EXTERN( _sse_MultiTexCoord2f_2 ); + /* Build specialized versions of the immediate calls on the fly for - * the current state. ???P4 SSE2 versions??? + * the current state. */ +static struct dynfn *radeon_makeSSEAttribute2fv( struct dynfn * cache, int key, + const char * name, void * dest) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (RADEON_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key ); -static struct dynfn *makeSSENormal3fv( GLcontext *ctx, int key ) + DFN ( _sse_Attribute2fv, (*cache) ); + FIXUP(dfn->code, 10, 0x0, (int)dest); + return dfn; +} + +static struct dynfn *radeon_makeSSEAttribute2f( struct dynfn * cache, int key, + const char * name, void * dest ) { - /* Requires P4 (sse2?) - */ - static unsigned char temp[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0xba, 0x78, 0x56, 0x34, 0x12, /* mov $0x12345678,%edx */ - 0xf3, 0x0f, 0x7e, 0x00, /* movq (%eax),%xmm0 */ - 0x66, 0x0f, 0x6e, 0x48, 0x08, /* movd 0x8(%eax),%xmm1 */ - 0x66, 0x0f, 0xd6, 0x42, 0x0c, /* movq %xmm0,0xc(%edx) */ - 0x66, 0x0f, 0x7e, 0x4a, 0x14, /* movd %xmm1,0x14(%edx) */ - 0xc3, /* ret */ - }; + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + if (RADEON_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key ); + DFN ( _sse_Attribute2f, (*cache) ); + FIXUP(dfn->code, 8, 0x0, (int)dest); + return dfn; +} + +static struct dynfn *radeon_makeSSEAttribute3fv( struct dynfn * cache, int key, + const char * name, void * dest) +{ struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (RADEON_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key ); + + DFN ( _sse_Attribute3fv, (*cache) ); + FIXUP(dfn->code, 13, 0x0, (int)dest); + FIXUP(dfn->code, 18, 0x8, 8+(int)dest); + return dfn; +} + +static struct dynfn *radeon_makeSSEAttribute3f( struct dynfn * cache, int key, + const char * name, void * dest ) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (RADEON_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key ); + + DFN ( _sse_Attribute3f, (*cache) ); + FIXUP(dfn->code, 12, 0x0, (int)dest); + FIXUP(dfn->code, 17, 0x8, 8+(int)dest); + return dfn; +} + +static struct dynfn * radeon_makeSSENormal3fv( GLcontext *ctx, int key ) +{ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - insert_at_head( &rmesa->vb.dfn_cache.Normal3fv, dfn ); - dfn->key = key; - dfn->code = ALIGN_MALLOC( sizeof(temp), 16 ); - memcpy (dfn->code, temp, sizeof(temp)); - FIXUP(dfn->code, 5, 0x0, (int)vb.normalptr); + return radeon_makeSSEAttribute3fv( & rmesa->vb.dfn_cache.Normal3fv, key, + __FUNCTION__, rmesa->vb.normalptr ); +} + +static struct dynfn *radeon_makeSSENormal3f( GLcontext *ctx, int key ) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + return radeon_makeSSEAttribute3f( & rmesa->vb.dfn_cache.Normal3f, key, + __FUNCTION__, rmesa->vb.normalptr ); +} + +static struct dynfn *radeon_makeSSEColor3fv( GLcontext *ctx, int key ) +{ + if (key & (RADEON_CP_VC_FRMT_PKCOLOR|RADEON_CP_VC_FRMT_FPALPHA)) + return 0; + else + { + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + return radeon_makeSSEAttribute3fv( & rmesa->vb.dfn_cache.Color3fv, key, + __FUNCTION__, rmesa->vb.floatcolorptr ); + } +} + +static struct dynfn *radeon_makeSSEColor3f( GLcontext *ctx, int key ) +{ + if (key & (RADEON_CP_VC_FRMT_PKCOLOR|RADEON_CP_VC_FRMT_FPALPHA)) + return 0; + else + { + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + return radeon_makeSSEAttribute3f( & rmesa->vb.dfn_cache.Color3f, key, + __FUNCTION__, rmesa->vb.floatcolorptr ); + } +} + +static struct dynfn *radeon_makeSSETexCoord2fv( GLcontext *ctx, int key ) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + return radeon_makeSSEAttribute2fv( & rmesa->vb.dfn_cache.TexCoord2fv, key, + __FUNCTION__, rmesa->vb.texcoordptr[0] ); +} + +static struct dynfn *radeon_makeSSETexCoord2f( GLcontext *ctx, int key ) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + return radeon_makeSSEAttribute2f( & rmesa->vb.dfn_cache.TexCoord2f, key, + __FUNCTION__, rmesa->vb.texcoordptr[0] ); +} + +static struct dynfn *radeon_makeSSEMultiTexCoord2fv( GLcontext *ctx, int key ) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + if (RADEON_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key ); + + if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) == + (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) { + DFN ( _sse_MultiTexCoord2fv, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); + FIXUP(dfn->code, 18, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]); + } else { + DFN ( _sse_MultiTexCoord2fv_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); + FIXUP(dfn->code, 14, 0x0, (int)rmesa->vb.texcoordptr); + } + return dfn; +} + +static struct dynfn *radeon_makeSSEMultiTexCoord2f( GLcontext *ctx, int key ) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + if (RADEON_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key ); + + if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) == + (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) { + DFN ( _sse_MultiTexCoord2f, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); + FIXUP(dfn->code, 16, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]); + } else { + DFN ( _sse_MultiTexCoord2f_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); + FIXUP(dfn->code, 15, 0x0, (int)rmesa->vb.texcoordptr); + } return dfn; } void radeonInitSSECodegen( struct dfn_generators *gen ) { - if ( cpu_has_xmm && cpu_has_xmm2 ) - /*gen->Normal3fv = */ (void)makeSSENormal3fv; + if ( cpu_has_xmm ) { + gen->Normal3fv = (void *) radeon_makeSSENormal3fv; + gen->Normal3f = (void *) radeon_makeSSENormal3f; + gen->Color3fv = (void *) radeon_makeSSEColor3fv; + gen->Color3f = (void *) radeon_makeSSEColor3f; + gen->TexCoord2fv = (void *) radeon_makeSSETexCoord2fv; + gen->TexCoord2f = (void *) radeon_makeSSETexCoord2f; + gen->MultiTexCoord2fvARB = (void *) radeon_makeSSEMultiTexCoord2fv; + gen->MultiTexCoord2fARB = (void *) radeon_makeSSEMultiTexCoord2f; + } } #else Index: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c:1.2 xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c:1.3 --- xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c:1.2 Sat Dec 21 12:02:16 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c Sun Sep 28 16:15:31 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c,v 1.2 2002/12/21 17:02:16 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt_x86.c,v 1.3 2003/09/28 20:15:31 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -6,24 +6,25 @@ All Rights Reserved. -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 -on the rights to use, copy, modify, merge, publish, distribute, sub -license, 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 (including the next -paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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. +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 (including the +next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. **************************************************************************/ @@ -32,10 +33,8 @@ * Keith Whitwell */ -#include -#include -#include "mem.h" -#include "mmath.h" +#include "glheader.h" +#include "imports.h" #include "simple_list.h" #include "radeon_vtxfmt.h" @@ -45,8 +44,10 @@ extern const char *FUNC; \ extern const char *FUNC##_end -EXTERN ( _x86_Normal3fv ); -EXTERN ( _x86_Normal3f ); +EXTERN ( _x86_Attribute2fv ); +EXTERN ( _x86_Attribute2f ); +EXTERN ( _x86_Attribute3fv ); +EXTERN ( _x86_Attribute3f ); EXTERN ( _x86_Vertex3fv_6 ); EXTERN ( _x86_Vertex3fv_8 ); EXTERN ( _x86_Vertex3fv ); @@ -56,14 +57,10 @@ EXTERN ( _x86_Color4ubv_ub ); EXTERN ( _x86_Color4ubv_4f ); EXTERN ( _x86_Color4ub_ub ); -EXTERN ( _x86_Color3fv_3f ); -EXTERN ( _x86_Color3f_3f ); -EXTERN ( _x86_TexCoord2fv ); -EXTERN ( _x86_TexCoord2f ); -EXTERN ( _x86_MultiTexCoord2fvARB ); -EXTERN ( _x86_MultiTexCoord2fvARB_2 ); -EXTERN ( _x86_MultiTexCoord2fARB ); -EXTERN ( _x86_MultiTexCoord2fARB_2 ); +EXTERN ( _x86_MultiTexCoord2fv ); +EXTERN ( _x86_MultiTexCoord2fv_2 ); +EXTERN ( _x86_MultiTexCoord2f ); +EXTERN ( _x86_MultiTexCoord2f_2 ); /* Build specialized versions of the immediate calls on the fly for @@ -76,43 +73,43 @@ struct dynfn *dfn = MALLOC_STRUCT( dynfn ); if (RADEON_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x %d\n", __FUNCTION__, key, vb.vertex_size ); + fprintf(stderr, "%s 0x%08x %d\n", __FUNCTION__, key, rmesa->vb.vertex_size ); - switch (vb.vertex_size) { + switch (rmesa->vb.vertex_size) { case 4: { DFN ( _x86_Vertex3f_4, rmesa->vb.dfn_cache.Vertex3f ); - FIXUP(dfn->code, 2, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 25, 0x0, (int)&vb.vertex[3]); - FIXUP(dfn->code, 36, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 46, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 51, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 60, 0x0, (int)&vb.notify); + FIXUP(dfn->code, 2, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 25, 0x0, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 36, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 46, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 51, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 60, 0x0, (int)&rmesa->vb.notify); break; } case 6: { DFN ( _x86_Vertex3f_6, rmesa->vb.dfn_cache.Vertex3f ); - FIXUP(dfn->code, 3, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 28, 0x0, (int)&vb.vertex[3]); - FIXUP(dfn->code, 34, 0x0, (int)&vb.vertex[4]); - FIXUP(dfn->code, 40, 0x0, (int)&vb.vertex[5]); - FIXUP(dfn->code, 57, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 63, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 70, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 79, 0x0, (int)&vb.notify); + FIXUP(dfn->code, 3, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 28, 0x0, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 34, 0x0, (int)&rmesa->vb.vertex[4]); + FIXUP(dfn->code, 40, 0x0, (int)&rmesa->vb.vertex[5]); + FIXUP(dfn->code, 57, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 63, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 70, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 79, 0x0, (int)&rmesa->vb.notify); break; } default: { DFN ( _x86_Vertex3f, rmesa->vb.dfn_cache.Vertex3f ); - FIXUP(dfn->code, 3, 0x0, (int)&vb.vertex[3]); - FIXUP(dfn->code, 9, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 37, 0x0, vb.vertex_size-3); - FIXUP(dfn->code, 44, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 50, 0x0, (int)&vb.dmaptr); - FIXUP(dfn->code, 56, 0x0, (int)&vb.counter); - FIXUP(dfn->code, 67, 0x0, (int)&vb.notify); + FIXUP(dfn->code, 3, 0x0, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 9, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 37, 0x0, rmesa->vb.vertex_size-3); + FIXUP(dfn->code, 44, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 50, 0x0, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 56, 0x0, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 67, 0x0, (int)&rmesa->vb.notify); break; } } @@ -128,20 +125,20 @@ struct dynfn *dfn = MALLOC_STRUCT( dynfn ); if (RADEON_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x %d\n", __FUNCTION__, key, vb.vertex_size ); + fprintf(stderr, "%s 0x%08x %d\n", __FUNCTION__, key, rmesa->vb.vertex_size ); - switch (vb.vertex_size) { + switch (rmesa->vb.vertex_size) { case 6: { DFN ( _x86_Vertex3fv_6, rmesa->vb.dfn_cache.Vertex3fv ); - FIXUP(dfn->code, 1, 0x00000000, (int)&vb.dmaptr); - FIXUP(dfn->code, 27, 0x0000001c, (int)&vb.vertex[3]); - FIXUP(dfn->code, 33, 0x00000020, (int)&vb.vertex[4]); - FIXUP(dfn->code, 45, 0x00000024, (int)&vb.vertex[5]); - FIXUP(dfn->code, 56, 0x00000000, (int)&vb.dmaptr); - FIXUP(dfn->code, 61, 0x00000004, (int)&vb.counter); - FIXUP(dfn->code, 67, 0x00000004, (int)&vb.counter); - FIXUP(dfn->code, 76, 0x00000008, (int)&vb.notify); + FIXUP(dfn->code, 1, 0x00000000, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 27, 0x0000001c, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 33, 0x00000020, (int)&rmesa->vb.vertex[4]); + FIXUP(dfn->code, 45, 0x00000024, (int)&rmesa->vb.vertex[5]); + FIXUP(dfn->code, 56, 0x00000000, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 61, 0x00000004, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 67, 0x00000004, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 76, 0x00000008, (int)&rmesa->vb.notify); break; } @@ -149,16 +146,16 @@ case 8: { DFN ( _x86_Vertex3fv_8, rmesa->vb.dfn_cache.Vertex3fv ); - FIXUP(dfn->code, 1, 0x00000000, (int)&vb.dmaptr); - FIXUP(dfn->code, 27, 0x0000001c, (int)&vb.vertex[3]); - FIXUP(dfn->code, 33, 0x00000020, (int)&vb.vertex[4]); - FIXUP(dfn->code, 45, 0x0000001c, (int)&vb.vertex[5]); - FIXUP(dfn->code, 51, 0x00000020, (int)&vb.vertex[6]); - FIXUP(dfn->code, 63, 0x00000024, (int)&vb.vertex[7]); - FIXUP(dfn->code, 74, 0x00000000, (int)&vb.dmaptr); - FIXUP(dfn->code, 79, 0x00000004, (int)&vb.counter); - FIXUP(dfn->code, 85, 0x00000004, (int)&vb.counter); - FIXUP(dfn->code, 94, 0x00000008, (int)&vb.notify); + FIXUP(dfn->code, 1, 0x00000000, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 27, 0x0000001c, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 33, 0x00000020, (int)&rmesa->vb.vertex[4]); + FIXUP(dfn->code, 45, 0x0000001c, (int)&rmesa->vb.vertex[5]); + FIXUP(dfn->code, 51, 0x00000020, (int)&rmesa->vb.vertex[6]); + FIXUP(dfn->code, 63, 0x00000024, (int)&rmesa->vb.vertex[7]); + FIXUP(dfn->code, 74, 0x00000000, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 79, 0x00000004, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 85, 0x00000004, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 94, 0x00000008, (int)&rmesa->vb.notify); break; } @@ -167,13 +164,13 @@ default: { DFN ( _x86_Vertex3fv, rmesa->vb.dfn_cache.Vertex3fv ); - FIXUP(dfn->code, 8, 0x01010101, (int)&vb.dmaptr); - FIXUP(dfn->code, 32, 0x00000006, vb.vertex_size-3); - FIXUP(dfn->code, 37, 0x00000058, (int)&vb.vertex[3]); - FIXUP(dfn->code, 45, 0x01010101, (int)&vb.dmaptr); - FIXUP(dfn->code, 50, 0x02020202, (int)&vb.counter); - FIXUP(dfn->code, 58, 0x02020202, (int)&vb.counter); - FIXUP(dfn->code, 67, 0x0, (int)&vb.notify); + FIXUP(dfn->code, 8, 0x01010101, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 32, 0x00000006, rmesa->vb.vertex_size-3); + FIXUP(dfn->code, 37, 0x00000058, (int)&rmesa->vb.vertex[3]); + FIXUP(dfn->code, 45, 0x01010101, (int)&rmesa->vb.dmaptr); + FIXUP(dfn->code, 50, 0x02020202, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 58, 0x02020202, (int)&rmesa->vb.counter); + FIXUP(dfn->code, 67, 0x0, (int)&rmesa->vb.notify); break; } } @@ -181,37 +178,88 @@ return dfn; } -struct dynfn *radeon_makeX86Normal3fv( GLcontext *ctx, int key ) +static struct dynfn * +radeon_makeX86Attribute2fv( struct dynfn * cache, int key, + const char * name, void * dest ) { struct dynfn *dfn = MALLOC_STRUCT( dynfn ); - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - int i = 0; if (RADEON_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key ); + fprintf(stderr, "%s 0x%08x\n", name, key ); - DFN ( _x86_Normal3fv, rmesa->vb.dfn_cache.Normal3fv ); + DFN ( _x86_Attribute2fv, (*cache) ); + FIXUP(dfn->code, 11, 0x0, (int)dest); + FIXUP(dfn->code, 16, 0x4, 4+(int)dest); - FIXUP2(dfn->code, i, 0x0, (int)vb.normalptr); - FIXUP2(dfn->code, i, 0x4, 4+(int)vb.normalptr); - FIXUP2(dfn->code, i, 0x8, 8+(int)vb.normalptr); - /* fprintf(stderr, "%s done\n", __FUNCTION__); */ return dfn; } -struct dynfn *radeon_makeX86Normal3f( GLcontext *ctx, int key ) +static struct dynfn * +radeon_makeX86Attribute2f( struct dynfn * cache, int key, + const char * name, void * dest ) { struct dynfn *dfn = MALLOC_STRUCT( dynfn ); - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); if (RADEON_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key ); + fprintf(stderr, "%s 0x%08x\n", name, key ); + + DFN ( _x86_Attribute2f, (*cache) ); + FIXUP(dfn->code, 1, 0x0, (int)dest); + + return dfn; +} + + +static struct dynfn * +radeon_makeX86Attribute3fv( struct dynfn * cache, int key, + const char * name, void * dest ) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (RADEON_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key ); + + DFN ( _x86_Attribute3fv, (*cache) ); + FIXUP(dfn->code, 14, 0x0, (int)dest); + FIXUP(dfn->code, 20, 0x4, 4+(int)dest); + FIXUP(dfn->code, 25, 0x8, 8+(int)dest); - DFN ( _x86_Normal3f, rmesa->vb.dfn_cache.Normal3f ); - FIXUP(dfn->code, 1, 0x12345678, (int)vb.normalptr); return dfn; } +static struct dynfn * +radeon_makeX86Attribute3f( struct dynfn * cache, int key, + const char * name, void * dest ) +{ + struct dynfn *dfn = MALLOC_STRUCT( dynfn ); + + if (RADEON_DEBUG & DEBUG_CODEGEN) + fprintf(stderr, "%s 0x%08x\n", name, key ); + + DFN ( _x86_Attribute3f, (*cache) ); + FIXUP(dfn->code, 14, 0x0, (int)dest); + FIXUP(dfn->code, 20, 0x4, 4+(int)dest); + FIXUP(dfn->code, 25, 0x8, 8+(int)dest); + + return dfn; +} + +struct dynfn *radeon_makeX86Normal3fv( GLcontext *ctx, int key ) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + return radeon_makeX86Attribute3fv( & rmesa->vb.dfn_cache.Normal3fv, key, + __FUNCTION__, rmesa->vb.normalptr ); +} + +struct dynfn *radeon_makeX86Normal3f( GLcontext *ctx, int key ) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + return radeon_makeX86Attribute3f( & rmesa->vb.dfn_cache.Normal3f, key, + __FUNCTION__, rmesa->vb.normalptr ); +} + struct dynfn *radeon_makeX86Color4ubv( GLcontext *ctx, int key ) { struct dynfn *dfn = MALLOC_STRUCT( dynfn ); @@ -223,17 +271,17 @@ if (key & RADEON_CP_VC_FRMT_PKCOLOR) { DFN ( _x86_Color4ubv_ub, rmesa->vb.dfn_cache.Color4ubv); - FIXUP(dfn->code, 5, 0x12345678, (int)vb.colorptr); + FIXUP(dfn->code, 5, 0x12345678, (int)rmesa->vb.colorptr); return dfn; } else { DFN ( _x86_Color4ubv_4f, rmesa->vb.dfn_cache.Color4ubv); FIXUP(dfn->code, 2, 0x00000000, (int)_mesa_ubyte_to_float_color_tab); - FIXUP(dfn->code, 27, 0xdeadbeaf, (int)vb.floatcolorptr); - FIXUP(dfn->code, 33, 0xdeadbeaf, (int)vb.floatcolorptr+4); - FIXUP(dfn->code, 55, 0xdeadbeaf, (int)vb.floatcolorptr+8); - FIXUP(dfn->code, 61, 0xdeadbeaf, (int)vb.floatcolorptr+12); + FIXUP(dfn->code, 27, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr); + FIXUP(dfn->code, 33, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+4); + FIXUP(dfn->code, 55, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+8); + FIXUP(dfn->code, 61, 0xdeadbeaf, (int)rmesa->vb.floatcolorptr+12); return dfn; } } @@ -248,10 +296,10 @@ radeonContextPtr rmesa = RADEON_CONTEXT(ctx); DFN ( _x86_Color4ub_ub, rmesa->vb.dfn_cache.Color4ub ); - FIXUP(dfn->code, 18, 0x0, (int)vb.colorptr); - FIXUP(dfn->code, 24, 0x0, (int)vb.colorptr+1); - FIXUP(dfn->code, 30, 0x0, (int)vb.colorptr+2); - FIXUP(dfn->code, 36, 0x0, (int)vb.colorptr+3); + FIXUP(dfn->code, 18, 0x0, (int)rmesa->vb.colorptr); + FIXUP(dfn->code, 24, 0x0, (int)rmesa->vb.colorptr+1); + FIXUP(dfn->code, 30, 0x0, (int)rmesa->vb.colorptr+2); + FIXUP(dfn->code, 36, 0x0, (int)rmesa->vb.colorptr+3); return dfn; } else @@ -265,15 +313,10 @@ return 0; else { - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - if (RADEON_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key ); - - DFN ( _x86_Color3fv_3f, rmesa->vb.dfn_cache.Color3fv ); - FIXUP(dfn->code, 5, 0x0, (int)vb.floatcolorptr); - return dfn; + return radeon_makeX86Attribute3fv( & rmesa->vb.dfn_cache.Color3fv, key, + __FUNCTION__, rmesa->vb.floatcolorptr ); } } @@ -283,15 +326,10 @@ return 0; else { - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - if (RADEON_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key ); - - DFN ( _x86_Color3f_3f, rmesa->vb.dfn_cache.Color3f ); - FIXUP(dfn->code, 1, 0x12345678, (int)vb.floatcolorptr); - return dfn; + return radeon_makeX86Attribute3f( & rmesa->vb.dfn_cache.Color3f, key, + __FUNCTION__, rmesa->vb.floatcolorptr ); } } @@ -299,61 +337,22 @@ struct dynfn *radeon_makeX86TexCoord2fv( GLcontext *ctx, int key ) { - - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - if (RADEON_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key ); - - DFN ( _x86_TexCoord2fv, rmesa->vb.dfn_cache.TexCoord2fv ); - FIXUP(dfn->code, 5, 0x12345678, (int)vb.texcoordptr[0]); - return dfn; + return radeon_makeX86Attribute2fv( & rmesa->vb.dfn_cache.TexCoord2fv, key, + __FUNCTION__, rmesa->vb.texcoordptr[0] ); } struct dynfn *radeon_makeX86TexCoord2f( GLcontext *ctx, int key ) { - - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - if (RADEON_DEBUG & DEBUG_CODEGEN) - fprintf(stderr, "%s 0x%08x\n", __FUNCTION__, key ); - - DFN ( _x86_TexCoord2f, rmesa->vb.dfn_cache.TexCoord2f ); - FIXUP(dfn->code, 1, 0x12345678, (int)vb.texcoordptr[0]); - return dfn; + return radeon_makeX86Attribute2f( & rmesa->vb.dfn_cache.TexCoord2f, key, + __FUNCTION__, rmesa->vb.texcoordptr[0] ); } struct dynfn *radeon_makeX86MultiTexCoord2fvARB( GLcontext *ctx, int key ) { -#if 0 - static char temp[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0x8b, 0x4c, 0x24, 0x08, /* mov 0x8(%esp,1),%ecx */ - 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */ - 0x83, 0xe0, 0x01, /* and $0x1,%eax */ - 0x8b, 0x11, /* mov (%ecx),%edx */ - 0xc1, 0xe0, 0x03, /* shl $0x3,%eax */ - 0x8b, 0x49, 0x04, /* mov 0x4(%ecx),%ecx */ - 0x89, 0x90, 0, 0, 0, 0,/* mov %edx,DEST(%eax) */ - 0x89, 0x88, 0, 0, 0, 0,/* mov %ecx,DEST+8(%eax) */ - 0xc3, /* ret */ - }; - static char temp2[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0x8b, 0x4c, 0x24, 0x08, /* mov 0x8(%esp,1),%ecx */ - 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */ - 0x83, 0xe0, 0x01, /* and $0x1,%eax */ - 0x8b, 0x14, 0x85, 0, 0, 0, 0, /* mov DEST(,%eax,4),%edx */ - 0x8b, 0x01, /* mov (%ecx),%eax */ - 0x89, 0x02, /* mov %eax,(%edx) */ - 0x8b, 0x41, 0x04, /* mov 0x4(%ecx),%eax */ - 0x89, 0x42, 0x04, /* mov %eax,0x4(%edx) */ - 0xc3, /* ret */ - }; -#endif - struct dynfn *dfn = MALLOC_STRUCT( dynfn ); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); @@ -362,12 +361,12 @@ if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) == (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) { - DFN ( _x86_MultiTexCoord2fvARB, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); - FIXUP(dfn->code, 26, 0xdeadbeef, (int)vb.texcoordptr[0]); - FIXUP(dfn->code, 32, 0xdeadbeef, (int)vb.texcoordptr[0]+4); + DFN ( _x86_MultiTexCoord2fv, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); + FIXUP(dfn->code, 21, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]); + FIXUP(dfn->code, 27, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]+4); } else { - DFN ( _x86_MultiTexCoord2fvARB_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); - FIXUP(dfn->code, 19, 0x0, (int)vb.texcoordptr); + DFN ( _x86_MultiTexCoord2fv_2, rmesa->vb.dfn_cache.MultiTexCoord2fvARB ); + FIXUP(dfn->code, 14, 0x0, (int)rmesa->vb.texcoordptr); } return dfn; } @@ -375,31 +374,6 @@ struct dynfn *radeon_makeX86MultiTexCoord2fARB( GLcontext *ctx, int key ) { -#if 0 - static char temp[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%esp,1),%edx */ - 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */ - 0x8b, 0x4c, 0x24, 0x0c, /* mov 0xc(%esp,1),%ecx */ - 0x83, 0xe0, 0x01, /* and $0x1,%eax */ - 0xc1, 0xe0, 0x03, /* shl $0x3,%eax */ - 0x89, 0x90, 0, 0, 0, 0, /* mov %edx,DEST(%eax) */ - 0x89, 0x88, 0, 0, 0, 0, /* mov %ecx,DEST+8(%eax) */ - 0xc3, /* ret */ - }; - - static char temp2[] = { - 0x8b, 0x44, 0x24, 0x04, /* mov 0x4(%esp,1),%eax */ - 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%esp,1),%edx */ - 0x2d, 0xc0, 0x84, 0x00, 0x00, /* sub $0x84c0,%eax */ - 0x8b, 0x4c, 0x24, 0x0c, /* mov 0xc(%esp,1),%ecx */ - 0x83, 0xe0, 0x01, /* and $0x1,%eax */ - 0x8b, 0x04, 0x85, 0, 0, 0, 0, /* mov DEST(,%eax,4),%eax */ - 0x89, 0x10, /* mov %edx,(%eax) */ - 0x89, 0x48, 0x04, /* mov %ecx,0x4(%eax) */ - 0xc3, /* ret */ - }; -#endif struct dynfn *dfn = MALLOC_STRUCT( dynfn ); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); @@ -408,16 +382,16 @@ if ((key & (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) == (RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST1)) { - DFN ( _x86_MultiTexCoord2fARB, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); - FIXUP(dfn->code, 25, 0xdeadbeef, (int)vb.texcoordptr[0]); - FIXUP(dfn->code, 31, 0xdeadbeef, (int)vb.texcoordptr[0]+4); + DFN ( _x86_MultiTexCoord2f, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); + FIXUP(dfn->code, 20, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]); + FIXUP(dfn->code, 26, 0xdeadbeef, (int)rmesa->vb.texcoordptr[0]+4); } else { /* Note: this might get generated multiple times, even though the * actual emitted code is the same. */ - DFN ( _x86_MultiTexCoord2fARB_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); - FIXUP(dfn->code, 23, 0x0, (int)vb.texcoordptr); + DFN ( _x86_MultiTexCoord2f_2, rmesa->vb.dfn_cache.MultiTexCoord2fARB ); + FIXUP(dfn->code, 18, 0x0, (int)rmesa->vb.texcoordptr); } return dfn; } Index: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S diff -u xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S:1.2 xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S:1.4 --- xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S:1.2 Thu Nov 7 13:32:00 2002 +++ xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S Fri Nov 7 19:18:40 2003 @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S,v 1.2 2002/11/07 18:32:00 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_vtxtmp_x86.S,v 1.4 2003/11/08 00:18:40 dawes Exp $ */ /************************************************************************** Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas. @@ -28,20 +28,10 @@ #define GLOBL( x ) \ .globl x; \ -x##: +x: .data .align 4 -GLOBL( _x86_Normal3fv) - movl 4(%esp), %eax /* load 'v' off stack */ - movl (%eax), %ecx /* load v[0] */ - movl 4(%eax), %edx /* load v[1] */ - movl 8(%eax), %eax /* load v[2] */ - movl %ecx, 0 /* store v[0] to current vertex */ - movl %edx, 4 /* store v[1] to current vertex */ - movl %eax, 8 /* store v[2] to current vertex */ - ret -GLOBL ( _x86_Normal3fv_end ) /* vertex 3f vertex size 4 @@ -218,19 +208,70 @@ .6: jmp *0 GLOBL ( _x86_Vertex3fv_end ) -/* - Normal 3f -*/ -GLOBL ( _x86_Normal3f ) - movl $0x12345678, %edx + +/** + * Generic handler for 2 float format data. This can be used for + * TexCoord2f and possibly other functions. + */ + +GLOBL ( _x86_Attribute2f ) + movl $0x0, %edx movl 4(%esp), %eax + movl 8(%esp), %ecx movl %eax, (%edx) - movl 8(%esp), %eax - movl %eax, 4(%edx) + movl %ecx, 4(%edx) + ret +GLOBL ( _x86_Attribute2f_end ) + + +/** + * Generic handler for 2 float vector format data. This can be used for + * TexCoord2fv and possibly other functions. + */ + +GLOBL( _x86_Attribute2fv) + movl 4(%esp), %eax /* load 'v' off stack */ + movl (%eax), %ecx /* load v[0] */ + movl 4(%eax), %eax /* load v[1] */ + movl %ecx, 0 /* store v[0] to current vertex */ + movl %eax, 4 /* store v[1] to current vertex */ + ret +GLOBL ( _x86_Attribute2fv_end ) + + +/** + * Generic handler for 3 float format data. This can be used for + * Normal3f, Color3f (when the color target is also float), or + * TexCoord3f. + */ + +GLOBL ( _x86_Attribute3f ) + movl 4(%esp), %ecx + movl 8(%esp), %edx movl 12(%esp), %eax - movl %eax, 8(%edx) + movl %ecx, 0 + movl %edx, 4 + movl %eax, 8 + ret +GLOBL ( _x86_Attribute3f_end ) + +/** + * Generic handler for 3 float vector format data. This can be used for + * Normal3f, Color3f (when the color target is also float), or + * TexCoord3f. + */ + +GLOBL( _x86_Attribute3fv) + movl 4(%esp), %eax /* load 'v' off stack */ + movl (%eax), %ecx /* load v[0] */ + movl 4(%eax), %edx /* load v[1] */ + movl 8(%eax), %eax /* load v[2] */ + movl %ecx, 0 /* store v[0] to current vertex */ + movl %edx, 4 /* store v[1] to current vertex */ + movl %eax, 8 /* store v[2] to current vertex */ ret -GLOBL ( _x86_Normal3f_end ) +GLOBL ( _x86_Attribute3fv_end ) + /* Color 4ubv_ub @@ -290,69 +331,13 @@ ret GLOBL( _x86_Color4ub_ub_end ) -/* - Color3fv_3f -*/ -GLOBL( _x86_Color3fv_3f ) - movl 4(%esp), %eax - movl $0, %edx - movl (%eax), %ecx - movl %ecx, (%edx) - movl 4(%eax), %ecx - movl %ecx, 4(%edx) - movl 8(%eax), %ecx - movl %ecx, 8(%edx) - ret -GLOBL( _x86_Color3fv_3f_end ) - -/* - Color3f_3f -*/ -GLOBL( _x86_Color3f_3f ) - movl $0x12345678, %edx - movl 4(%esp), %eax - movl %eax, (%edx) - movl 8(%esp,1), %eax - movl %eax, 4(%edx) - movl 12(%esp), %eax - movl %eax, 8(%edx) - ret -GLOBL( _x86_Color3f_3f_end ) /* - TexCoord2fv + MultiTexCoord2fv st0/st1 */ - -GLOBL( _x86_TexCoord2fv ) - movl 4(%esp), %eax - movl $0x12345678, %edx - movl (%eax), %ecx - movl 4(%eax), %eax - movl %ecx, (%edx) - movl %eax, 4(%edx) - ret - -GLOBL( _x86_TexCoord2fv_end ) -/* - TexCoord2f -*/ -GLOBL( _x86_TexCoord2f ) - movl $0x12345678, %edx - movl 4(%esp), %eax - movl 8(%esp), %ecx - movl %eax, (%edx) - movl %ecx, 4(%edx) - ret -GLOBL( _x86_TexCoord2f_end ) - -/* - MultiTexCoord2fvARB st0/st1 -*/ -GLOBL( _x86_MultiTexCoord2fvARB ) - +GLOBL( _x86_MultiTexCoord2fv ) movl 4(%esp), %eax movl 8(%esp), %ecx - sub $0x84c0, %eax and $1, %eax movl (%ecx), %edx shl $3, %eax @@ -360,15 +345,15 @@ movl %edx, 0xdeadbeef(%eax) movl %ecx, 0xdeadbeef(%eax) ret -GLOBL( _x86_MultiTexCoord2fvARB_end ) +GLOBL( _x86_MultiTexCoord2fv_end ) + /* - MultiTexCoord2fvARB + MultiTexCoord2fv */ -GLOBL( _x86_MultiTexCoord2fvARB_2 ) +GLOBL( _x86_MultiTexCoord2fv_2 ) movl 4(%esp,1), %eax movl 8(%esp,1), %ecx - sub $0x84c0, %eax and $0x1, %eax movl 0(,%eax,4), %edx movl (%ecx), %eax @@ -376,35 +361,134 @@ movl 4(%ecx), %eax movl %eax, 4(%edx) ret - -GLOBL( _x86_MultiTexCoord2fvARB_2_end ) +GLOBL( _x86_MultiTexCoord2fv_2_end ) /* - MultiTexCoord2fARB st0/st1 + MultiTexCoord2f st0/st1 */ -GLOBL( _x86_MultiTexCoord2fARB ) +GLOBL( _x86_MultiTexCoord2f ) movl 4(%esp), %eax movl 8(%esp), %edx - sub $0x84c0, %eax movl 12(%esp), %ecx and $1, %eax shl $3, %eax movl %edx, 0xdeadbeef(%eax) movl %ecx, 0xdeadbeef(%eax) ret -GLOBL( _x86_MultiTexCoord2fARB_end ) +GLOBL( _x86_MultiTexCoord2f_end ) /* - MultiTexCoord2fARB + MultiTexCoord2f */ -GLOBL( _x86_MultiTexCoord2fARB_2 ) +GLOBL( _x86_MultiTexCoord2f_2 ) movl 4(%esp), %eax movl 8(%esp), %edx - sub $0x84c0, %eax movl 12(%esp,1), %ecx and $1,%eax movl 0(,%eax,4), %eax movl %edx, (%eax) movl %ecx, 4(%eax) ret -GLOBL( _x86_MultiTexCoord2fARB_2_end ) +GLOBL( _x86_MultiTexCoord2f_2_end ) + +#if defined(USE_SSE_ASM) +/** + * This can be used as a template for either Color3fv (when the color + * target is also a 3f) or Normal3fv. + */ + +GLOBL( _sse_Attribute3fv ) + movl 4(%esp), %eax + movlps (%eax), %xmm0 + movl 8(%eax), %eax + movlps %xmm0, 0 + movl %eax, 8 + ret +GLOBL( _sse_Attribute3fv_end ) + +/** + * This can be used as a template for either Color3f (when the color + * target is also a 3f) or Normal3f. + */ + +GLOBL( _sse_Attribute3f ) + movlps 4(%esp), %xmm0 + movl 12(%esp), %eax + movlps %xmm0, 0 + movl %eax, 8 + ret +GLOBL( _sse_Attribute3f_end ) + + +/** + * Generic handler for 2 float vector format data. This can be used for + * TexCoord2fv and possibly other functions. + */ + +GLOBL( _sse_Attribute2fv ) + movl 4(%esp), %eax + movlps (%eax), %xmm0 + movlps %xmm0, 0 + ret +GLOBL( _sse_Attribute2fv_end ) + + +/** + * Generic handler for 2 float format data. This can be used for + * TexCoord2f and possibly other functions. + */ + +GLOBL( _sse_Attribute2f ) + movlps 4(%esp), %xmm0 + movlps %xmm0, 0 + ret +GLOBL( _sse_Attribute2f_end ) + +/* + MultiTexCoord2fv st0/st1 +*/ +GLOBL( _sse_MultiTexCoord2fv ) + movl 4(%esp), %eax + movl 8(%esp), %ecx + and $1, %eax + movlps (%ecx), %xmm0 + movlps %xmm0, 0xdeadbeef(,%eax,8) + ret +GLOBL( _sse_MultiTexCoord2fv_end ) + +/* + MultiTexCoord2fv +*/ +GLOBL( _sse_MultiTexCoord2fv_2 ) + movl 4(%esp), %eax + movl 8(%esp), %ecx + and $0x1, %eax + movl 0(,%eax,4), %edx + movlps (%ecx), %xmm0 + movlps %xmm0, (%edx) + ret +GLOBL( _sse_MultiTexCoord2fv_2_end ) + +/* + MultiTexCoord2f st0/st1 +*/ +GLOBL( _sse_MultiTexCoord2f ) + movl 4(%esp), %eax + and $1, %eax + movlps 8(%esp), %xmm0 + movlps %xmm0, 0xdeadbeef(,%eax,8) + ret +GLOBL( _sse_MultiTexCoord2f_end ) + +/* + MultiTexCoord2f +*/ +GLOBL( _sse_MultiTexCoord2f_2 ) + movl 4(%esp), %eax + movlps 8(%esp), %xmm0 + and $1,%eax + movl 0(,%eax,4), %eax + movlps %xmm0, (%eax) + ret +GLOBL( _sse_MultiTexCoord2f_2_end ) +#endif Index: xc/lib/GL/mesa/src/drv/sis/Imakefile diff -u xc/lib/GL/mesa/src/drv/sis/Imakefile:1.22 xc/lib/GL/mesa/src/drv/sis/Imakefile:1.23 --- xc/lib/GL/mesa/src/drv/sis/Imakefile:1.22 Mon Nov 25 09:04:52 2002 +++ xc/lib/GL/mesa/src/drv/sis/Imakefile Sun Sep 28 16:15:33 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/sis/Imakefile,v 1.22 2002/11/25 14:04:52 eich Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/sis/Imakefile,v 1.23 2003/09/28 20:15:33 alanh Exp $ #include @@ -32,18 +32,14 @@ #include "../../SPARC/Imakefile.inc" #endif -XCOMM SIS_DEFINES = -DSIS_USE_HW_CULL -DSIS_USE_FASTPATH -SIS_DEFINES = -DSIS_USE_HW_CULL - XCOMM DEBUG_DEFINES = -DDEBUG_LOCKING XCOMM DEBUG_DEFINES = -DSIS_DEBUG DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(MESA_ASM_DEFINES) \ - $(DEBUG_DEFINES) $(STEREO_DEFINES) + $(DEBUG_DEFINES) INCLUDES = $(X_INCLUDES) $(MESA_INCLUDES) $(DRI_INCLUDES) - DRIOBJS = $(GLXLIBSRC)/mesa/dri/dri_mesa.o \ - $(GLXLIBSRC)/dri/dri_tmm.o + DRIOBJS = $(GLXLIBSRC)/dri/dri_util.o DRMOBJS = $(GLXLIBSRC)/dri/drm/xf86drm.o \ $(GLXLIBSRC)/dri/drm/xf86drmHash.o \ @@ -59,8 +55,8 @@ #endif SRCS = $(SISSRCS) - OBJS = $(DRIOBJS) $(DRMOBJS) $(COREMESAOBJS) \ - $(MESA_ASM_OBJS) $(SISOBJS) $(HIOBJS) + OBJS = $(LOOBJS) $(DRIOBJS) $(DRMOBJS) $(COREMESAOBJS) \ + $(MESA_ASM_OBJS) $(COMMONOBJS) $(SISOBJS) $(HIOBJS) REQUIREDLIBS = MathLibrary $(LDPRELIB) $(GLXLIB) $(XONLYLIB) Index: xc/lib/GL/mesa/src/drv/sis/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/sis/Imakefile.inc:1.1 xc/lib/GL/mesa/src/drv/sis/Imakefile.inc:1.3 --- xc/lib/GL/mesa/src/drv/sis/Imakefile.inc:1.1 Fri Mar 23 14:18:43 2001 +++ xc/lib/GL/mesa/src/drv/sis/Imakefile.inc Sun Sep 28 16:15:33 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/sis/Imakefile.inc,v 1.1 2001/03/23 19:18:43 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/sis/Imakefile.inc,v 1.3 2003/09/28 20:15:33 alanh Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,15 +16,17 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines $(SIS_DEFINES) - DRI_INCLUDES = -I$(GLXLIBSRC)/dri -I$(GLXLIBSRC)/glx \ - -I$(INCLUDESRC) -I$(INCLUDESRC)/GL \ - -I$(GLXLIBSRC)/mesa/dri \ + DRI_DEFINES = GlxDefines $(SIS_DEFINES) -DX_BYTE_ORDER=$(X_BYTE_ORDER) + DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ + -I$(GLXLIBSRC)/glx \ + -I$(INCLUDESRC) \ + -I$(INCLUDESRC)/GL \ -I$(SERVERSRC)/GL/dri \ -I$(XF86OSSRC) \ -I$(XF86DRIVERSRC)/sis \ + -I$(XF86COMSRC) \ -I$(GLXLIBSRC)/dri/drm \ - -I$(GLXLIBSRC)/mesa/src/X + -I$(GLXLIBSRC)/include #endif MESA_INCLUDES = -I$(MESASRCDIR)/src -I$(MESASRCDIR)/include \ @@ -43,107 +45,100 @@ #endif #endif -#if 0 - STEREO_SRC = $(MESADRVSISBUILDDIR)sis_stereo.c - STEREO_OBJ = $(MESADRVSISBUILDDIR)sis_stereo.o - STEREO_UOBJ = $(MESADRVSISBUILDDIR)unshared/sis_stereo.o - STEREO_DOBJ = $(MESADRVSISBUILDDIR)debugger/sis_stereo.o - STEREO_POBJ = $(MESADRVSISBUILDDIR)profiled/sis_stereo.o - STEREO_DEFINES = -DSIS_STEREO=1 -#ifdef NeedToLinkMesaSrc -LinkSourceFile(sis_stereo.c, $(MESADRVSRCDIR)/sis) -#endif -#else - STEREO_DEFINES = -DSIS_STEREO=0 -#endif - - SISSRCS = $(MESADRVSISBUILDDIR)sis_render.c \ - $(MESADRVSISBUILDDIR)sis_mesa.c \ - $(MESADRVSISBUILDDIR)sis_ctx.c \ - $(MESADRVSISBUILDDIR)sis_alloc.c \ + SISSRCS = $(MESADRVSISBUILDDIR)sis_alloc.c \ + $(MESADRVSISBUILDDIR)sis_dd.c \ + $(MESADRVSISBUILDDIR)sis_lock.c \ + $(MESADRVSISBUILDDIR)sis_context.c \ $(MESADRVSISBUILDDIR)sis_fog.c \ $(MESADRVSISBUILDDIR)sis_clear.c \ + $(MESADRVSISBUILDDIR)sis_screen.c \ + $(MESADRVSISBUILDDIR)sis_state.c \ $(MESADRVSISBUILDDIR)sis_stencil.c \ - $(MESADRVSISBUILDDIR)sis_texture.c \ - $(MESADRVSISBUILDDIR)sis_xwin.c \ - $(MESADRVSISBUILDDIR)sis_xmesa.c \ $(MESADRVSISBUILDDIR)sis_span.c \ - $(MESADRVSISBUILDDIR)sis_fastpath.c \ - $(DEBUG_SRC) \ - $(STEREO_SRC) - - SISOBJS = $(MESADRVSISBUILDDIR)sis_render.o \ - $(MESADRVSISBUILDDIR)sis_mesa.o \ - $(MESADRVSISBUILDDIR)sis_ctx.o \ - $(MESADRVSISBUILDDIR)sis_alloc.o \ + $(MESADRVSISBUILDDIR)sis_tex.c \ + $(MESADRVSISBUILDDIR)sis_texstate.c \ + $(MESADRVSISBUILDDIR)sis_tris.c \ + $(MESADRVSISBUILDDIR)sis_vb.c \ + $(DEBUG_SRC) + + SISOBJS = $(MESADRVSISBUILDDIR)sis_alloc.o \ + $(MESADRVSISBUILDDIR)sis_dd.o \ + $(MESADRVSISBUILDDIR)sis_lock.o \ + $(MESADRVSISBUILDDIR)sis_context.o \ $(MESADRVSISBUILDDIR)sis_fog.o \ $(MESADRVSISBUILDDIR)sis_clear.o \ + $(MESADRVSISBUILDDIR)sis_screen.o \ + $(MESADRVSISBUILDDIR)sis_state.o \ $(MESADRVSISBUILDDIR)sis_stencil.o \ - $(MESADRVSISBUILDDIR)sis_texture.o \ - $(MESADRVSISBUILDDIR)sis_xwin.o \ - $(MESADRVSISBUILDDIR)sis_xmesa.o \ $(MESADRVSISBUILDDIR)sis_span.o \ - $(MESADRVSISBUILDDIR)sis_fastpath.o \ - $(DEBUG_OBJ) \ - $(STEREO_OBJ) - - SISUOBJS = $(MESADRVSISBUILDDIR)unshared/sis_render.o \ - $(MESADRVSISBUILDDIR)unshared/sis_mesa.o \ - $(MESADRVSISBUILDDIR)unshared/sis_ctx.o \ - $(MESADRVSISBUILDDIR)unshared/sis_alloc.o \ + $(MESADRVSISBUILDDIR)sis_tex.o \ + $(MESADRVSISBUILDDIR)sis_texstate.o \ + $(MESADRVSISBUILDDIR)sis_tris.o \ + $(MESADRVSISBUILDDIR)sis_vb.o \ + $(DEBUG_OBJ) + + SISUOBJS = $(MESADRVSISBUILDDIR)unshared/sis_alloc.o \ + $(MESADRVSISBUILDDIR)unshared/sis_dd.o \ + $(MESADRVSISBUILDDIR)unshared/sis_lock.o \ + $(MESADRVSISBUILDDIR)unshared/sis_context.o \ $(MESADRVSISBUILDDIR)unshared/sis_fog.o \ $(MESADRVSISBUILDDIR)unshared/sis_clear.o \ + $(MESADRVSISBUILDDIR)unshared/sis_screen.o \ + $(MESADRVSISBUILDDIR)unshared/sis_state.o \ $(MESADRVSISBUILDDIR)unshared/sis_stencil.o \ - $(MESADRVSISBUILDDIR)unshared/sis_texture.o \ - $(MESADRVSISBUILDDIR)unshared/sis_xwin.o \ - $(MESADRVSISBUILDDIR)unshared/sis_xmesa.o \ $(MESADRVSISBUILDDIR)unshared/sis_span.o \ - $(MESADRVSISBUILDDIR)unshared/sis_fastpath.o \ - $(DEBUG_UOBJ) \ - $(STEREO_UOBJ) - - SISDOBJS = $(MESADRVSISBUILDDIR)debugger/sis_render.o \ - $(MESADRVSISBUILDDIR)debugger/sis_mesa.o \ - $(MESADRVSISBUILDDIR)debugger/sis_ctx.o \ - $(MESADRVSISBUILDDIR)debugger/sis_alloc.o \ + $(MESADRVSISBUILDDIR)unshared/sis_tex.o \ + $(MESADRVSISBUILDDIR)unshared/sis_texstate.o \ + $(MESADRVSISBUILDDIR)unshared/sis_tris.o \ + $(MESADRVSISBUILDDIR)unshared/sis_vb.o \ + $(DEBUG_UOBJ) + + SISDOBJS = $(MESADRVSISBUILDDIR)debugger/sis_alloc.o \ + $(MESADRVSISBUILDDIR)debugger/sis_dd.o \ + $(MESADRVSISBUILDDIR)debugger/sis_lock.o \ + $(MESADRVSISBUILDDIR)debugger/sis_context.o \ $(MESADRVSISBUILDDIR)debugger/sis_fog.o \ $(MESADRVSISBUILDDIR)debugger/sis_clear.o \ + $(MESADRVSISBUILDDIR)debugger/sis_screen.o \ + $(MESADRVSISBUILDDIR)debugger/sis_state.o \ $(MESADRVSISBUILDDIR)debugger/sis_stencil.o \ - $(MESADRVSISBUILDDIR)debugger/sis_texture.o \ - $(MESADRVSISBUILDDIR)debugger/sis_xwin.o \ - $(MESADRVSISBUILDDIR)debugger/sis_xmesa.o \ $(MESADRVSISBUILDDIR)debugger/sis_span.o \ - $(MESADRVSISBUILDDIR)debugger/sis_fastpath.o \ - $(DEBUG_DOBJ) \ - $(STEREO_DOBJ) - - SISPOBJS = $(MESADRVSISBUILDDIR)profiled/sis_render.o \ - $(MESADRVSISBUILDDIR)profiled/sis_mesa.o \ - $(MESADRVSISBUILDDIR)profiled/sis_ctx.o \ - $(MESADRVSISBUILDDIR)profiled/sis_alloc.o \ + $(MESADRVSISBUILDDIR)debugger/sis_tex.o \ + $(MESADRVSISBUILDDIR)debugger/sis_texstate.o \ + $(MESADRVSISBUILDDIR)debugger/sis_tris.o \ + $(MESADRVSISBUILDDIR)debugger/sis_vb.o \ + $(DEBUG_DOBJ) + + SISPOBJS = $(MESADRVSISBUILDDIR)profiled/sis_alloc.o \ + $(MESADRVSISBUILDDIR)profiled/sis_dd.o \ + $(MESADRVSISBUILDDIR)profiled/sis_lock.o \ + $(MESADRVSISBUILDDIR)profiled/sis_context.o \ $(MESADRVSISBUILDDIR)profiled/sis_fog.o \ $(MESADRVSISBUILDDIR)profiled/sis_clear.o \ + $(MESADRVSISBUILDDIR)profiled/sis_screen.o \ + $(MESADRVSISBUILDDIR)profiled/sis_state.o \ $(MESADRVSISBUILDDIR)profiled/sis_stencil.o \ - $(MESADRVSISBUILDDIR)profiled/sis_texture.o \ - $(MESADRVSISBUILDDIR)profiled/sis_xwin.o \ - $(MESADRVSISBUILDDIR)profiled/sis_xmesa.o \ $(MESADRVSISBUILDDIR)profiled/sis_span.o \ - $(MESADRVSISBUILDDIR)profiled/sis_fastpath.o \ - $(DEBUG_POBJ) \ - $(STEREO_POBJ) + $(MESADRVSISBUILDDIR)profiled/sis_tex.o \ + $(MESADRVSISBUILDDIR)profiled/sis_texstate.o \ + $(MESADRVSISBUILDDIR)profiled/sis_tris.o \ + $(MESADRVSISBUILDDIR)profiled/sis_vb.o \ + $(DEBUG_POBJ) #ifdef NeedToLinkMesaSrc -LinkSourceFile(sis_render.c, $(MESADRVSRCDIR)/sis) -LinkSourceFile(sis_mesa.c, $(MESADRVSRCDIR)/sis) -LinkSourceFile(sis_ctx.c, $(MESADRVSRCDIR)/sis) LinkSourceFile(sis_alloc.c, $(MESADRVSRCDIR)/sis) +LinkSourceFile(sis_dd.c, $(MESADRVSRCDIR)/sis) +LinkSourceFile(sis_lock.c, $(MESADRVSRCDIR)/sis) +LinkSourceFile(sis_context.c, $(MESADRVSRCDIR)/sis) LinkSourceFile(sis_fog.c, $(MESADRVSRCDIR)/sis) LinkSourceFile(sis_clear.c, $(MESADRVSRCDIR)/sis) +LinkSourceFile(sis_screen.c $(MESADRVSRCDIR)/sis) +LinkSourceFile(sis_state.c, $(MESADRVSRCDIR)/sis) LinkSourceFile(sis_stencil.c, $(MESADRVSRCDIR)/sis) -LinkSourceFile(sis_texture.c, $(MESADRVSRCDIR)/sis) -LinkSourceFile(sis_xwin.c, $(MESADRVSRCDIR)/sis) -LinkSourceFile(sis_xmesa.c, $(MESADRVSRCDIR)/sis) LinkSourceFile(sis_span.c, $(MESADRVSRCDIR)/sis) -LinkSourceFile(sis_fastpath.c, $(MESADRVSRCDIR)/sis) +LinkSourceFile(sis_tex.c, $(MESADRVSRCDIR)/sis) +LinkSourceFile(sis_texstate.c, $(MESADRVSRCDIR)/sis) +LinkSourceFile(sis_tris.c, $(MESADRVSRCDIR)/sis) +LinkSourceFile(sis_vb.c, $(MESADRVSRCDIR)/sis) #endif Index: xc/lib/GL/mesa/src/drv/sis/sis_alloc.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_alloc.c:1.7 xc/lib/GL/mesa/src/drv/sis/sis_alloc.c:1.11 --- xc/lib/GL/mesa/src/drv/sis/sis_alloc.c:1.7 Sun Jan 7 20:07:29 2001 +++ xc/lib/GL/mesa/src/drv/sis/sis_alloc.c Mon Dec 22 12:48:03 2003 @@ -1,51 +1,43 @@ /************************************************************************** Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt All Rights Reserved. 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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_alloc.c,v 1.7 2001/01/08 01:07:29 martin Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_alloc.c,v 1.11 2003/12/22 17:48:03 tsi Exp $ */ /* * Authors: - * Sung-Ching Lin - * + * Sung-Ching Lin + * Eric Anholt */ -#include +#include "sis_context.h" +#include "sis_alloc.h" -#include "sis_ctx.h" -#include "sis_mesa.h" +#include "sis_common.h" -#if defined(XFree86Server) && !defined(XF86DRI) -# include "xf86fbman.h" -#else -# define CONFIG_DRM_SIS -# include "drm.h" -# undef CONFIG_DRM_SIS -# include "sis_drm.h" -# include -#endif +#include #define Z_BUFFER_HW_ALIGNMENT 16 #define Z_BUFFER_HW_PLUS (16 + 4) @@ -54,494 +46,204 @@ #define DRAW_BUFFER_HW_ALIGNMENT 16 #define DRAW_BUFFER_HW_PLUS (16 + 4) -#define TEXTURE_HW_ALIGNMENT 4 -#define TEXTURE_HW_PLUS (4 + 4) - -#ifdef ROUNDUP -#undef ROUNDUP -#endif -#define ROUNDUP(nbytes, pad) (((nbytes)+(pad-1))/(pad)) - -#ifdef ALIGNMENT -#undef ALIGNMENT -#endif -#define ALIGNMENT(value, align) (ROUNDUP((value),(align))*(align)) - -#if defined(XFree86Server) && !defined(XF86DRI) - -static void * -sis_alloc_fb (__GLSiScontext * hwcx, GLuint size, void **free) -{ - GLcontext *ctx = hwcx->gc; - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - - ScreenPtr pScreen = xmesa->display; - - GLuint offset; - BoxPtr pBox; - - size = ROUNDUP (size, GET_DEPTH (hwcx)); - *free = xf86AllocateLinearOffscreenArea (pScreen, size, 1, - NULL, NULL, NULL); - - if (!*free) - return NULL; - - pBox = &((FBAreaPtr) (*free))->box; - offset = pBox->y1 * GET_PITCH (hwcx) + pBox->x1 * GET_DEPTH (hwcx); - - return GET_FbBase (hwcx) + offset; -} - -static void -sis_free_fb (int hHWContext, void *free) -{ - xf86FreeOffscreenArea ((FBAreaPtr) free); -} - -#else - -int gDRMSubFD = -1; - -/* debug */ -#if 1 +#define ALIGNMENT(value, align) (((value) + (align) - 1) / (align) * (align)) static int _total_video_memory_used = 0; static int _total_video_memory_count = 0; -static void * -sis_alloc_fb (__GLSiScontext * hwcx, GLuint size, void **free) +void * +sisAllocFB( sisContextPtr smesa, GLuint size, void **handle ) { - GLcontext *ctx = hwcx->gc; - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; + drm_sis_mem_t fb; - drm_sis_mem_t fb; + _total_video_memory_used += size; - _total_video_memory_used += size; + fb.context = smesa->hHWContext; + fb.size = size; + if (drmCommandWriteRead( smesa->driFd, DRM_SIS_FB_ALLOC, &fb, + sizeof(drm_sis_mem_t) ) || fb.offset == 0) + { + return NULL; + } + *handle = (void *)fb.free; - fb.context = xmesa->driContextPriv->hHWContext; - fb.size = size; - if(ioctl(hwcx->drmSubFD, SIS_IOCTL_FB_ALLOC, &fb) || !fb.offset) - return NULL; - *free = (void *)fb.free; - - /* debug */ - /* memset(fb.offset + GET_FbBase(hwcx), 0xff, size); */ - - if (SIS_VERBOSE&VERBOSE_SIS_MEMORY) - { - fprintf(stderr, "sis_alloc_fb: size=%u, offset=%lu, pid=%lu, count=%d\n", - size, (DWORD)fb.offset, (DWORD)getpid(), - ++_total_video_memory_count); - } + if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) { + fprintf(stderr, "sisAllocFB: size=%d, offset=%lu, pid=%d, count=%d\n", + size, fb.offset, (GLint)getpid(), + ++_total_video_memory_count); + } - return (void *)(fb.offset + GET_FbBase(hwcx)); + return (void *)(smesa->FbBase + fb.offset); } -static void -sis_free_fb (int hHWContext, void *free) +void +sisFreeFB( sisContextPtr smesa, void *handle ) { - drm_sis_mem_t fb; + drm_sis_mem_t fb; - if (SIS_VERBOSE&VERBOSE_SIS_MEMORY) - { - fprintf(stderr, "sis_free_fb: free=%lu, pid=%lu, count=%d\n", - (DWORD)free, (DWORD)getpid(), --_total_video_memory_count); - } - - fb.context = hHWContext; - fb.free = (unsigned long)free; - ioctl(gDRMSubFD, SIS_IOCTL_FB_FREE, &fb); -} + if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) { + fprintf(stderr, "sisFreeFB: free=%p, pid=%d, count=%d\n", + handle, (GLint)getpid(), --_total_video_memory_count); + } -#else + fb.context = smesa->hHWContext; + fb.free = handle; + drmCommandWrite( smesa->driFd, DRM_SIS_FB_FREE, &fb, sizeof(drm_sis_mem_t) ); +} -static void * -sis_alloc_fb (__GLSiScontext * hwcx, GLuint size, void **free) +void * +sisAllocAGP( sisContextPtr smesa, GLuint size, void **handle ) { - static char *vidmem_base = 0x400000; - char *rval = vidmem_base; + drm_sis_mem_t agp; + + if (smesa->AGPSize == 0) + return NULL; - vidmem_base += size; - if(vidmem_base >= 31*0x100000) - return NULL; - - *free = rval + (DWORD)hwcx->FbBase; + agp.context = smesa->hHWContext; + agp.size = size; + if (drmCommandWriteRead( smesa->driFd, DRM_SIS_AGP_ALLOC, &agp, + sizeof(drm_sis_mem_t) ) || agp.offset == 0) + { + return NULL; + } + *handle = (void *)agp.free; - return rval + (DWORD)hwcx->FbBase; -} + if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) { + fprintf(stderr, "sisAllocAGP: size=%u, offset=%lu, pid=%d, count=%d\n", + size, agp.offset, (GLint)getpid(), + ++_total_video_memory_count); + } -static void -sis_free_fb (int hHWContext, void *free) -{ - return; + return (void *)(smesa->AGPBase + agp.offset); } -#endif - -#endif - -static void * -sis_alloc_agp (__GLSiScontext * hwcx, GLuint size, void **free) +void +sisFreeAGP( sisContextPtr smesa, void *handle ) { - GLcontext *ctx = hwcx->gc; - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; + drm_sis_mem_t agp; - drm_sis_mem_t agp; + if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) { + fprintf(stderr, "sisFreeAGP: free=%p, pid=%d, count=%d\n", + handle, (GLint)getpid(), --_total_video_memory_count); + } - if(!hwcx->AGPSize) - return NULL; - - agp.context = xmesa->driContextPriv->hHWContext; - agp.size = size; - if(ioctl(hwcx->drmSubFD, SIS_IOCTL_AGP_ALLOC, &agp) || !agp.offset) - return NULL; - *free = (void *)agp.free; - - if (SIS_VERBOSE&VERBOSE_SIS_MEMORY) - { - fprintf(stderr, "sis_alloc_agp: size=%u, offset=%lu, pid=%lu, count=%d\n", - size, (DWORD)agp.offset, (DWORD)getpid(), - ++_total_video_memory_count); - } - - return (void *)(agp.offset + GET_AGPBase(hwcx)); + agp.context = smesa->hHWContext; + agp.free = handle; + drmCommandWrite( smesa->driFd, DRM_SIS_AGP_FREE, &agp, + sizeof(drm_sis_mem_t) ); } -static void -sis_free_agp (int hHWContext, void *free) +void +sisAllocZStencilBuffer( sisContextPtr smesa ) { - drm_sis_mem_t agp; + GLuint z_depth; + GLuint totalBytes; + int width2; - if (SIS_VERBOSE&VERBOSE_SIS_MEMORY) - { - fprintf(stderr, "sis_free_agp: free=%lu, pid=%lu, count=%d\n", - (DWORD)free, (DWORD)getpid(), --_total_video_memory_count); - } - - agp.context = hHWContext; - agp.free = (unsigned long)free; - ioctl(gDRMSubFD, SIS_IOCTL_AGP_FREE, &agp); -} + GLubyte *addr; -/* debug */ -static unsigned int Total_Real_Textures_Used = 0; -static unsigned int Total_Textures_Used = 0; + z_depth = ( smesa->glCtx->Visual.depthBits + + smesa->glCtx->Visual.stencilBits ) / 8; -void -sis_alloc_z_stencil_buffer (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; + width2 = ALIGNMENT( smesa->width * z_depth, 4 ); - XMesaBuffer xm_buffer = xmesa->xm_buffer; - sisBufferInfo *priv = (sisBufferInfo *) xm_buffer->private; + totalBytes = smesa->height * width2 + Z_BUFFER_HW_PLUS; - GLuint z_depth; - GLuint totalBytes; - int width2; + addr = sisAllocFB( smesa, totalBytes, &smesa->zbFree ); + if (addr == NULL) + { + fprintf (stderr, "SIS driver : out of video memory\n"); + sis_fatal_error (); + } - GLubyte *addr; + if (SIS_VERBOSE & VERBOSE_SIS_BUFFER) { + fprintf(stderr, "sis_alloc_z_stencil_buffer: addr=%p\n", addr); + } - z_depth = (ctx->Visual->DepthBits + ctx->Visual->StencilBits) / 8; + addr = (GLubyte *)ALIGNMENT( (unsigned long)addr, Z_BUFFER_HW_ALIGNMENT ); - width2 = ALIGNMENT (xm_buffer->width * z_depth, 4); + smesa->depthbuffer = (void *) addr; + smesa->depthPitch = width2; + smesa->depthOffset = (unsigned long)addr - (unsigned long)smesa->FbBase; - totalBytes = xm_buffer->height * width2 + Z_BUFFER_HW_PLUS; + /* set pZClearPacket */ + memset( &smesa->zClearPacket, 0, sizeof(ENGPACKET) ); - if (xm_buffer->depthbuffer) - { - sis_free_z_stencil_buffer (xm_buffer); - } + smesa->zClearPacket.dwSrcPitch = (z_depth == 2) ? 0x80000000 : 0xf0000000; + smesa->zClearPacket.dwDestBaseAddr = (unsigned long)(addr - + (unsigned long)smesa->FbBase); + smesa->zClearPacket.wDestPitch = width2; + smesa->zClearPacket.stdwDestPos.wY = 0; + smesa->zClearPacket.stdwDestPos.wX = 0; - addr = sis_alloc_fb (hwcx, totalBytes, &priv->zbFree); - if (!addr) - { - fprintf (stderr, "SIS driver : out of video memory\n"); - sis_fatal_error (); - } + smesa->zClearPacket.wDestHeight = smesa->virtualY; + smesa->zClearPacket.stdwDim.wWidth = (GLshort)width2 / z_depth; + smesa->zClearPacket.stdwDim.wHeight = (GLshort)smesa->height; + smesa->zClearPacket.stdwCmd.cRop = 0xf0; - if (SIS_VERBOSE&VERBOSE_SIS_BUFFER) - { - fprintf(stderr, "sis_alloc_z_stencil_buffer: addr=%lu\n", (DWORD)addr); - } - - addr = (GLubyte *) ALIGNMENT ((unsigned long) addr, Z_BUFFER_HW_ALIGNMENT); - - xm_buffer->depthbuffer = (void *) addr; - - /* software render */ - hwcx->swZBase = addr; - hwcx->swZPitch = width2; - - /* set pZClearPacket */ - memset (priv->pZClearPacket, 0, sizeof (ENGPACKET)); - - priv->pZClearPacket->dwSrcPitch = (z_depth == 2) ? 0x80000000 : 0xf0000000; - priv->pZClearPacket->dwDestBaseAddr = - (DWORD) addr - (DWORD) GET_FbBase (hwcx); - priv->pZClearPacket->wDestPitch = width2; - priv->pZClearPacket->stdwDestPos.wY = 0; - priv->pZClearPacket->stdwDestPos.wX = 0; - - priv->pZClearPacket->wDestHeight = hwcx->virtualY; - priv->pZClearPacket->stdwDim.wWidth = (WORD) width2 / z_depth; - priv->pZClearPacket->stdwDim.wHeight = (WORD) xm_buffer->height; - priv->pZClearPacket->stdwCmd.cRop = 0xf0; - - if (hwcx->blockWrite) - { - priv->pZClearPacket->stdwCmd.cCmd0 = (BYTE) (CMD0_PAT_FG_COLOR); - priv->pZClearPacket->stdwCmd.cCmd1 = - (BYTE) (CMD1_DIR_X_INC | CMD1_DIR_Y_INC); - } - else - { - priv->pZClearPacket->stdwCmd.cCmd0 = 0; - priv->pZClearPacket->stdwCmd.cCmd1 = - (BYTE) (CMD1_DIR_X_INC | CMD1_DIR_Y_INC); - } + if (smesa->blockWrite) + smesa->zClearPacket.stdwCmd.cCmd0 = CMD0_PAT_FG_COLOR; + else + smesa->zClearPacket.stdwCmd.cCmd0 = 0; + smesa->zClearPacket.stdwCmd.cCmd1 = CMD1_DIR_X_INC | CMD1_DIR_Y_INC; } void -sis_free_z_stencil_buffer (XMesaBuffer buf) +sisFreeZStencilBuffer( sisContextPtr smesa ) { - sisBufferInfo *priv = (sisBufferInfo *) buf->private; - XMesaContext xmesa = buf->xm_context; - - sis_free_fb (xmesa->driContextPriv->hHWContext, priv->zbFree); - priv->zbFree = NULL; - buf->depthbuffer = NULL; + sisFreeFB( smesa, smesa->zbFree ); + smesa->zbFree = NULL; + smesa->depthbuffer = NULL; } void -sis_alloc_back_image (GLcontext * ctx, XMesaImage *image, void **free, - ENGPACKET *packet) +sisAllocBackbuffer( sisContextPtr smesa ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - XMesaBuffer xm_buffer = xmesa->xm_buffer; + GLuint depth = smesa->bytesPerPixel; + GLuint size, width2; - GLuint depth = GET_DEPTH (hwcx); - GLuint size, width2; + char *addr; - GLbyte *addr; + width2 = (depth == 2) ? ALIGNMENT (smesa->width, 2) : smesa->width; + size = width2 * smesa->height * depth + DRAW_BUFFER_HW_PLUS; - if (image->data) - { - sis_free_back_image (xm_buffer, image, *free); - *free = NULL; - } - - width2 = (depth == 2) ? ALIGNMENT (xm_buffer->width, 2) : xm_buffer->width; - size = width2 * xm_buffer->height * depth + DRAW_BUFFER_HW_PLUS; - - /* Fixme: unique context alloc/free back-buffer? */ - addr = sis_alloc_fb (hwcx, size, free); - if (!addr) - { + /* Fixme: unique context alloc/free back-buffer? */ + addr = sisAllocFB( smesa, size, &smesa->bbFree ); + if (addr == NULL) + { fprintf (stderr, "SIS driver : out of video memory\n"); sis_fatal_error (); - } - - addr = (GLbyte *) ALIGNMENT ((unsigned long) addr, DRAW_BUFFER_HW_ALIGNMENT); + } - image->data = (char *)addr; + addr = (char *)ALIGNMENT( (unsigned long)addr, DRAW_BUFFER_HW_ALIGNMENT ); - image->bytes_per_line = width2 * depth; - image->bits_per_pixel = depth * 8; + smesa->backbuffer = addr; + smesa->backOffset = (unsigned long)(addr - (unsigned long)smesa->FbBase); + smesa->backPitch = width2 * depth; - memset (packet, 0, sizeof (ENGPACKET)); - - packet->dwSrcPitch = (depth == 2) ? 0x80000000 : 0xf0000000; - packet->dwDestBaseAddr = - (DWORD) addr - (DWORD) GET_FbBase (hwcx); - packet->wDestPitch = image->bytes_per_line; - packet->stdwDestPos.wY = 0; - packet->stdwDestPos.wX = 0; - - packet->wDestHeight = hwcx->virtualY; - packet->stdwDim.wWidth = (WORD) width2; - packet->stdwDim.wHeight = (WORD) xm_buffer->height; - packet->stdwCmd.cRop = 0xf0; - - if (hwcx->blockWrite) - { - packet->stdwCmd.cCmd0 = (BYTE) (CMD0_PAT_FG_COLOR); - packet->stdwCmd.cCmd1 = - (BYTE) (CMD1_DIR_X_INC | CMD1_DIR_Y_INC); - } - else - { - packet->stdwCmd.cCmd0 = 0; - packet->stdwCmd.cCmd1 = (BYTE) (CMD1_DIR_X_INC | CMD1_DIR_Y_INC); - } -} - -void -sis_free_back_image (XMesaBuffer buf, XMesaImage *image, void *free) -{ - XMesaContext xmesa = buf->xm_context; - - sis_free_fb (xmesa->driContextPriv->hHWContext, free); - image->data = NULL; -} - -void -sis_alloc_texture_image (GLcontext * ctx, GLtextureImage * image) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; + memset ( &smesa->cbClearPacket, 0, sizeof(ENGPACKET) ); - GLuint size; + smesa->cbClearPacket.dwSrcPitch = (depth == 2) ? 0x80000000 : 0xf0000000; + smesa->cbClearPacket.dwDestBaseAddr = smesa->backOffset; + smesa->cbClearPacket.wDestPitch = smesa->backPitch; + smesa->cbClearPacket.stdwDestPos.wY = 0; + smesa->cbClearPacket.stdwDestPos.wX = 0; - SIStextureArea *area = image->DriverData; - char *addr; + smesa->cbClearPacket.wDestHeight = smesa->virtualY; + smesa->cbClearPacket.stdwDim.wWidth = (GLshort) width2; + smesa->cbClearPacket.stdwDim.wHeight = (GLshort) smesa->height; + smesa->cbClearPacket.stdwCmd.cRop = 0xf0; - GLuint texel_size; - GLenum driver_format; - - if (area) - sis_free_texture_image (image); - - area = calloc (1, sizeof (SIStextureArea)); - if (!area){ - fprintf (stderr, "SIS Driver : allocating context fails\n"); - sis_fatal_error (); - return; - } - - switch (image->IntFormat) - { - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - texel_size = 1; - driver_format = GL_ALPHA8; - break; - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - texel_size = 1; - driver_format = GL_LUMINANCE8; - break; - case 2: - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - texel_size = 2; - driver_format = GL_LUMINANCE8_ALPHA8; - break; - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - texel_size = 1; - driver_format = GL_INTENSITY8; - break; - case 3: - case GL_RGB: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - texel_size = 4; - driver_format = GL_RGB8; - break; - case 4: - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - texel_size = 4; - driver_format = GL_RGBA8; - break; - default: - assert(0); - return; - } - - size = image->Width * image->Height * texel_size + TEXTURE_HW_PLUS; - - do{ - addr = sis_alloc_fb (hwcx, size, &area->free); - area->memType = VIDEO_TYPE; - if(addr) break; - - /* TODO: swap to agp memory*/ - /* video memory allocation fails */ - addr = sis_alloc_agp(hwcx, size, &area->free); - area->memType = AGP_TYPE; - if(addr) break; - - /* TODO: swap to system memory */ - } - while(0); - - if (!addr){ - fprintf (stderr, "SIS driver : out of video/agp memory\n"); - sis_fatal_error (); - return; - } - - area->Data = - (GLbyte *) ALIGNMENT ((unsigned long) addr, TEXTURE_HW_ALIGNMENT); - area->Pitch = image->Width * texel_size; - area->Format = driver_format; - area->Size = image->Width * image->Height * texel_size; - area->texelSize = texel_size; - area->hHWContext = xmesa->driContextPriv->hHWContext; - - /* debug */ - area->realSize = area->Size; - Total_Real_Textures_Used += area->realSize; - Total_Textures_Used++; - - image->DriverData = area; + if (smesa->blockWrite) + smesa->cbClearPacket.stdwCmd.cCmd0 = (GLbyte)(CMD0_PAT_FG_COLOR); + else + smesa->cbClearPacket.stdwCmd.cCmd0 = 0; + smesa->cbClearPacket.stdwCmd.cCmd1 = CMD1_DIR_X_INC | CMD1_DIR_Y_INC; } void -sis_free_texture_image (GLtextureImage * image) +sisFreeBackbuffer( sisContextPtr smesa ) { - SIStextureArea *area = (SIStextureArea *) image->DriverData; - - /* debug */ - Total_Real_Textures_Used -= area->realSize; - Total_Textures_Used--; - - if (!area) - return; - - if (area->Data) - switch(area->memType){ - case VIDEO_TYPE: - sis_free_fb (area->hHWContext, area->free); - break; - case AGP_TYPE: - sis_free_agp (area->hHWContext, area->free); - break; - default: - assert(0); - } - - free (area); - image->DriverData = NULL; + sisFreeFB( smesa, smesa->bbFree ); + smesa->backbuffer = NULL; } Index: xc/lib/GL/mesa/src/drv/sis/sis_alloc.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_alloc.h:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_alloc.h Mon Dec 8 19:15:21 2003 @@ -0,0 +1,44 @@ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_alloc.h,v 1.2 2003/12/09 00:15:21 alanh Exp $ */ + +/* + * Authors: + * Eric Anholt + */ + +enum { + VIDEO_TYPE, + AGP_TYPE +}; + +void sisAllocZStencilBuffer( sisContextPtr smesa ); +void sisFreeZStencilBuffer( sisContextPtr smesa ); +void sisAllocBackbuffer( sisContextPtr smesa ); +void sisFreeBackbuffer ( sisContextPtr smesa ); +void *sisAllocFB( sisContextPtr smesa, GLuint size, void **handle ); +void sisFreeFB( sisContextPtr smesa, void *handle ); +void *sisAllocAGP( sisContextPtr smesa, GLuint size, void **handle ); +void sisFreeAGP( sisContextPtr smesa, void *handle ); Index: xc/lib/GL/mesa/src/drv/sis/sis_clear.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_clear.c:1.5 xc/lib/GL/mesa/src/drv/sis/sis_clear.c:1.8 --- xc/lib/GL/mesa/src/drv/sis/sis_clear.c:1.5 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_clear.c Mon Dec 8 19:15:21 2003 @@ -1,425 +1,414 @@ /************************************************************************** Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt All Rights Reserved. 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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_clear.c,v 1.5 2000/09/26 15:56:48 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_clear.c,v 1.8 2003/12/09 00:15:21 alanh Exp $ */ /* * Authors: - * Sung-Ching Lin - * + * Sung-Ching Lin + * Eric Anholt */ -#include "sis_ctx.h" -#include "sis_mesa.h" +#include "sis_context.h" +#include "sis_state.h" #include "sis_lock.h" -__inline__ static GLbitfield sis_3D_Clear (GLcontext * ctx, GLbitfield mask, - GLint x, GLint y, GLint width, - GLint height); -__inline__ static void sis_clear_color_buffer (GLcontext * ctx, GLint x, - GLint y, GLint width, - GLint height); -__inline__ static void sis_clear_z_stencil_buffer (GLcontext * ctx, - GLbitfield mask, GLint x, - GLint y, GLint width, - GLint height); - -GLbitfield -sis_Clear (GLcontext * ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height) +#include "swrast/swrast.h" +#include "mmath.h" + +static GLbitfield sis_3D_Clear( GLcontext * ctx, GLbitfield mask, + GLint x, GLint y, GLint width, + GLint height ); +static void sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, + GLint y, GLint width, GLint height ); +static void sis_clear_z_stencil_buffer( GLcontext * ctx, + GLbitfield mask, GLint x, + GLint y, GLint width, + GLint height ); + +static void +set_color_pattern( sisContextPtr smesa, GLubyte red, GLubyte green, + GLubyte blue, GLubyte alpha ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; + /* XXX only RGB565 and ARGB8888 */ + switch (smesa->colorFormat) + { + case DST_FORMAT_ARGB_8888: + smesa->clearColorPattern = (alpha << 24) + + (red << 16) + (green << 8) + (blue); + break; + case DST_FORMAT_RGB_565: + smesa->clearColorPattern = ((red >> 3) << 11) + + ((green >> 2) << 5) + (blue >> 3); + smesa->clearColorPattern |= smesa->clearColorPattern << 16; + break; + default: + assert(0); + } +} + +void +sisUpdateZStencilPattern( sisContextPtr smesa, GLclampd z, GLint stencil ) +{ + GLuint zPattern; + + switch (smesa->zFormat) + { + case SiS_ZFORMAT_Z16: + zPattern = FLOAT_TO_USHORT(z); + zPattern |= zPattern << 16; + break; + case SiS_ZFORMAT_S8Z24: + zPattern = FLOAT_TO_UINT(z) >> 8; + zPattern |= stencil << 24; + break; + case SiS_ZFORMAT_Z32: + zPattern = FLOAT_TO_UINT(z); + break; + default: + assert(0); + } + smesa->clearZStencilPattern = zPattern; +} + +void +sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all, + GLint x, GLint y, GLint width, GLint height ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); - XMesaBuffer xm_buffer = xmesa->xm_buffer; GLint x1, y1, width1, height1; - if (all) - { + if (all) { GLframebuffer *buffer = ctx->DrawBuffer; x1 = 0; y1 = 0; width1 = buffer->Width; height1 = buffer->Height; - } - else - { + } else { x1 = x; y1 = Y_FLIP(y+height-1); width1 = width; height1 = height; - } + } + /* XXX: Scissoring */ - LOCK_HARDWARE (); + LOCK_HARDWARE(); - /* - * TODO: no considering multiple-buffer and clear buffer - * differs from current draw buffer - */ - - if ((ctx->Visual->StencilBits && - ((mask | GL_DEPTH_BUFFER_BIT) ^ (mask | GL_STENCIL_BUFFER_BIT))) - || (*(DWORD *) (ctx->Color.ColorMask) != 0xffffffff) - ) - { - /* only Clear either depth or stencil buffer */ - mask = sis_3D_Clear (ctx, mask, x1, y1, width1, height1); - } - - if (mask & ctx->Color.DrawDestMask) - { - sis_clear_color_buffer (ctx, x1, y1, width1, height1); - mask &= ~ctx->Color.DrawDestMask; - } - if (mask & (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)) - { - if (xm_buffer->depthbuffer) - sis_clear_z_stencil_buffer (ctx, mask, x1, y1, width1, height1); - mask &= ~(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - } - if (mask & GL_ACCUM_BUFFER_BIT) - { - } + /* Mask out any non-existent buffers */ + if (ctx->Visual.depthBits == 0 || !ctx->Depth.Mask) + mask &= ~DD_DEPTH_BIT; + if (ctx->Visual.stencilBits == 0) + mask &= ~DD_STENCIL_BIT; + + /* The 3d clear code is use for masked clears because I don't know how to do + * masked clears with the 2d functions. 3d isn't used in general because + * it's slower, even in the case of clearing multiple buffers + */ + if ((smesa->current.hwDstMask != 0xffffffff && + (mask & (DD_BACK_LEFT_BIT | DD_FRONT_LEFT_BIT)) != 0) || + (ctx->Stencil.WriteMask[0] < 0xff && (mask & DD_STENCIL_BIT) != 0) ) + { + mask = sis_3D_Clear( ctx, mask, x1, y1, width1, height1 ); + } + + if ( mask & DD_FRONT_LEFT_BIT || mask & DD_BACK_LEFT_BIT) { + sis_clear_color_buffer( ctx, mask, x1, y1, width1, height1 ); + mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); + } + + if (mask & (DD_DEPTH_BIT | DD_STENCIL_BIT)) { + if (smesa->depthbuffer != NULL) + sis_clear_z_stencil_buffer( ctx, mask, x1, y1, width1, height1 ); + mask &= ~(DD_DEPTH_BIT | DD_STENCIL_BIT); + } - UNLOCK_HARDWARE (); + UNLOCK_HARDWARE(); - return mask; + if (mask != 0) + _swrast_Clear( ctx, mask, all, x1, y1, width, height ); } + void -sis_ClearDepth (GLcontext * ctx, GLclampd d) +sisDDClearColor( GLcontext * ctx, const GLfloat color[4] ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; + sisContextPtr smesa = SIS_CONTEXT(ctx); + GLubyte c[4]; + + CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); - set_z_stencil_pattern (hwcx, d, ctx->Stencil.Clear); + set_color_pattern( smesa, c[0], c[1], c[2], c[3] ); } void -sis_ClearStencil (GLcontext * ctx, GLint s) +sisDDClearDepth( GLcontext * ctx, GLclampd d ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - set_z_stencil_pattern (hwcx, ctx->Depth.Clear, s); + sisContextPtr smesa = SIS_CONTEXT(ctx); + sisUpdateZStencilPattern( smesa, d, ctx->Stencil.Clear ); } -#define MAKE_CLEAR_COLOR_8888(cc) \ - ( (((DWORD)(((GLubyte *)(cc))[3] * 255.0 + 0.5))<<24) | \ - (((DWORD)(((GLubyte *)(cc))[0] * 255.0 + 0.5))<<16) | \ - (((DWORD)(((GLubyte *)(cc))[1] * 255.0 + 0.5))<<8) | \ - ((DWORD)(((GLubyte *)(cc))[2] * 255.0 + 0.5)) ) - -__inline__ static GLbitfield -sis_3D_Clear (GLcontext * ctx, GLbitfield mask, - GLint x, GLint y, GLint width, GLint height) +void +sisDDClearStencil( GLcontext * ctx, GLint s ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; + sisContextPtr smesa = SIS_CONTEXT(ctx); - __GLSiSHardware *current = &hwcx->current; + sisUpdateZStencilPattern( smesa, ctx->Depth.Clear, s ); +} -#define RESETSTATE (GFLAG_ENABLESETTING | GFLAG_ENABLESETTING2 | \ - GFLAG_ZSETTING | GFLAG_DESTSETTING | \ - GFLAG_STENCILSETTING | GFLAG_CLIPPING) -#define STEN_OP (SiS_SFAIL_REPLACE | SiS_SPASS_ZFAIL_REPLACE | \ - SiS_SPASS_ZPASS_REPLACE) - - float left, top, right, bottom, zClearVal; - DWORD dwColor=0; - DWORD bClrColor, bClrDepth, bClrStencil; - DWORD dwPrimitiveSet; - DWORD dwEnable1, dwEnable2, dwDepthMask=0, dwSten1=0, dwSten2=0; - - int count; - BoxPtr pExtents; - - bClrColor = 0; - bClrDepth = (mask & GL_DEPTH_BUFFER_BIT) && - (ctx->Visual->DepthBits); - bClrStencil = (mask & GL_STENCIL_BUFFER_BIT) && - (ctx->Visual->StencilBits); - - /* update HW state */ - /* TODO: if enclosing sis_Clear by sis_RenderStart and sis_RenderEnd is - * uniform, but it seems needless to do so - */ - if (hwcx->GlobalFlag) - { - sis_update_render_state (hwcx, 0); - } - - dwEnable2 = 0; - if (bClrColor) - { - dwColor = MAKE_CLEAR_COLOR_8888 (ctx->Color.ClearColor); - } - else - { - dwEnable2 |= 0x8000; - } - - if (bClrDepth && bClrStencil) - { - DWORD wmask, smask; - GLstencil sten; +static GLbitfield +sis_3D_Clear( GLcontext * ctx, GLbitfield mask, + GLint x, GLint y, GLint width, GLint height ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); - zClearVal = ctx->Depth.Clear; - sten = ctx->Stencil.Clear; - wmask = (DWORD) ctx->Stencil.WriteMask; - smask = 0xff; + __GLSiSHardware *current = &smesa->current; + float left, top, right, bottom, zClearVal; + GLboolean bClrColor, bClrDepth, bClrStencil; + GLint dwPrimitiveSet; + GLint dwEnable1 = 0, dwEnable2 = MASK_ColorMaskWriteEnable; + GLint dwDepthMask = 0, dwSten1 = 0, dwSten2 = 0; + GLint dirtyflags = GFLAG_ENABLESETTING | GFLAG_ENABLESETTING2 | + GFLAG_CLIPPING | GFLAG_DESTSETTING; + int count; + XF86DRIClipRectPtr pExtents; + + bClrColor = (mask & (DD_BACK_LEFT_BIT | DD_FRONT_LEFT_BIT)) != 0; + bClrDepth = (mask & DD_DEPTH_BIT) != 0; + bClrStencil = (mask & DD_STENCIL_BIT) != 0; + + if (smesa->GlobalFlag & GFLAG_RENDER_STATES) + sis_update_render_state( smesa ); + + if (bClrStencil) { + dwSten1 = STENCIL_FORMAT_8 | SiS_STENCIL_ALWAYS | + (ctx->Stencil.Clear << 8) | 0xff; + dwSten2 = SiS_SFAIL_REPLACE | SiS_SPASS_ZFAIL_REPLACE | + SiS_SPASS_ZPASS_REPLACE; dwEnable1 = MASK_ZWriteEnable | MASK_StencilTestEnable; dwEnable2 |= MASK_ZMaskWriteEnable; - dwDepthMask = ((wmask << 24) | 0x00ffffff); - dwSten1 = S_8 | (((DWORD) sten << 8) | smask) | SiS_STENCIL_ALWAYS; - dwSten2 = STEN_OP; - } - else if (bClrDepth) - { - zClearVal = ctx->Depth.Clear; + dwDepthMask |= ctx->Stencil.WriteMask[0] << 24; + } else if (bClrDepth) { dwEnable1 = MASK_ZWriteEnable; dwEnable2 |= MASK_ZMaskWriteEnable; - dwDepthMask = 0xffffff; - } - else if (bClrStencil) - { - DWORD wmask, smask; - GLstencil sten; - - sten = (GLstencil) ctx->Stencil.Clear; - wmask = (DWORD) ctx->Stencil.WriteMask; - smask = 0xff; + } - zClearVal = 0; - dwEnable1 = MASK_ZWriteEnable | MASK_StencilTestEnable; - dwEnable2 |= MASK_ZMaskWriteEnable; - dwDepthMask = (wmask << 24) & 0xff000000; - dwSten1 = S_8 | (((DWORD) sten << 8) | smask) | SiS_STENCIL_ALWAYS; - dwSten2 = STEN_OP; - } - else - { - dwEnable2 &= ~MASK_ZMaskWriteEnable; - dwEnable1 = 0L; - zClearVal = 1; - } - - mWait3DCmdQueue (35); - MMIO (REG_3D_TEnable, dwEnable1); - MMIO (REG_3D_TEnable2, dwEnable2); - if (bClrDepth | bClrStencil) - { - MMIO (REG_3D_ZSet, current->hwZ); - MMIO (REG_3D_ZStWriteMask, dwDepthMask); - MMIO (REG_3D_ZAddress, current->hwOffsetZ); - } - if (bClrColor) - { - MMIO (REG_3D_DstSet, (current->hwDstSet & 0x00ffffff) | 0xc000000); - MMIO (REG_3D_DstAddress, current->hwOffsetDest); - } - else - { - MMIO (REG_3D_DstAlphaWriteMask, 0L); - } - if (bClrStencil) - { - MMIO (REG_3D_StencilSet, dwSten1); - MMIO (REG_3D_StencilSet2, dwSten2); - } - - if (ctx->Color.DriverDrawBuffer == GL_FRONT_LEFT) - { - sis_get_clip_rects (xmesa, &pExtents, &count); - } - else - { + if (bClrDepth) { + zClearVal = ctx->Depth.Clear; + if (ctx->Visual.depthBits != 32) + dwDepthMask |= 0x00ffffff; + else + dwDepthMask = 0xffffffff; + } else + zClearVal = 0.0; + + mWait3DCmdQueue(9); + MMIO(REG_3D_TEnable, dwEnable1); + MMIO(REG_3D_TEnable2, dwEnable2); + if (bClrDepth || bClrStencil) { + MMIO(REG_3D_ZSet, (current->hwZ & ~MASK_ZTestMode) | SiS_Z_COMP_ALWAYS); + dirtyflags |= GFLAG_ZSETTING; + } + if (bClrColor) { + MMIO(REG_3D_DstSet, (current->hwDstSet & ~MASK_ROP2) | LOP_COPY); + } else { + MMIO(REG_3D_DstAlphaWriteMask, 0L); + } + if (bClrStencil) { + MMIO(REG_3D_StencilSet, dwSten1); + MMIO(REG_3D_StencilSet2, dwSten2); + dirtyflags |= GFLAG_STENCILSETTING; + } + + if (mask & DD_FRONT_LEFT_BIT) { + pExtents = smesa->driDrawable->pClipRects; + count = smesa->driDrawable->numClipRects; + } else { pExtents = NULL; count = 1; - } + } - while(count--) - { + while(count--) { left = x; - right = x + width - 1; + right = x + width; top = y; - bottom = y + height - 1; + bottom = y + height; + + if (pExtents != NULL) { + GLuint x1, y1, x2, y2; + + x1 = pExtents->x1 - smesa->driDrawable->x; + y1 = pExtents->y1 - smesa->driDrawable->y; + x2 = pExtents->x2 - smesa->driDrawable->x - 1; + y2 = pExtents->y2 - smesa->driDrawable->y - 1; + + left = (left > x1) ? left : x1; + right = (right > x2) ? x2 : right; + top = (top > y1) ? top : y1; + bottom = (bottom > y2) ? y2 : bottom; + pExtents++; + if (left > right || top > bottom) + continue; + } - if (pExtents) - { - GLuint origin_x, origin_y; - GLuint x1, y1, x2, y2; - - sis_get_drawable_origin (xmesa, &origin_x, &origin_y); - - x1 = pExtents->x1 - origin_x; - y1 = pExtents->y1 - origin_y; - x2 = pExtents->x2 - origin_x - 1; - y2 = pExtents->y2 - origin_y - 1; - - left = (left > x1) ? left : x1; - right = (right > x2) ? x2 : right; - top = (top > y1) ? top : y1; - bottom = (bottom > y2) ? y2 : bottom; - if (left > right || top > bottom) - continue; - pExtents++; - } + mWait3DCmdQueue(20); - MMIO (REG_3D_ClipTopBottom, ((DWORD) top << 13) | (DWORD) bottom); - MMIO (REG_3D_ClipLeftRight, ((DWORD) left << 13) | (DWORD) right); + MMIO(REG_3D_ClipTopBottom, ((GLint)top << 13) | (GLint)bottom); + MMIO(REG_3D_ClipLeftRight, ((GLint)left << 13) | (GLint)right); /* the first triangle */ - dwPrimitiveSet = (OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBc | - SHADE_FLAT_VertexC); - MMIO (REG_3D_PrimitiveSet, dwPrimitiveSet); - - MMIO (REG_3D_TSZa, *(DWORD *) & zClearVal); - MMIO (REG_3D_TSXa, *(DWORD *) & right); - MMIO (REG_3D_TSYa, *(DWORD *) & top); - MMIO (REG_3D_TSARGBa, dwColor); - - MMIO (REG_3D_TSZb, *(DWORD *) & zClearVal); - MMIO (REG_3D_TSXb, *(DWORD *) & left); - MMIO (REG_3D_TSYb, *(DWORD *) & top); - MMIO (REG_3D_TSARGBb, dwColor); - - MMIO (REG_3D_TSZc, *(DWORD *) & zClearVal); - MMIO (REG_3D_TSXc, *(DWORD *) & left); - MMIO (REG_3D_TSYc, *(DWORD *) & bottom); - MMIO (REG_3D_TSARGBc, dwColor); + dwPrimitiveSet = OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBc | + SHADE_FLAT_VertexC; + MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet); + + MMIO(REG_3D_TSZa, *(GLint *) &zClearVal); + MMIO(REG_3D_TSXa, *(GLint *) &right); + MMIO(REG_3D_TSYa, *(GLint *) &top); + MMIO(REG_3D_TSARGBa, smesa->clearColorPattern); + + MMIO(REG_3D_TSZb, *(GLint *) &zClearVal); + MMIO(REG_3D_TSXb, *(GLint *) &left); + MMIO(REG_3D_TSYb, *(GLint *) &top); + MMIO(REG_3D_TSARGBb, smesa->clearColorPattern); + + MMIO(REG_3D_TSZc, *(GLint *) &zClearVal); + MMIO(REG_3D_TSXc, *(GLint *) &left); + MMIO(REG_3D_TSYc, *(GLint *) &bottom); + MMIO(REG_3D_TSARGBc, smesa->clearColorPattern); /* second triangle */ - dwPrimitiveSet = (OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBb | - SHADE_FLAT_VertexB); - MMIO (REG_3D_PrimitiveSet, dwPrimitiveSet); - - MMIO (REG_3D_TSZb, *(DWORD *) & zClearVal); - MMIO (REG_3D_TSXb, *(DWORD *) & right); - MMIO (REG_3D_TSYb, *(DWORD *) & bottom); - MMIO (REG_3D_TSARGBb, dwColor); - } + dwPrimitiveSet = OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBb | + SHADE_FLAT_VertexB; + MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet); + + MMIO(REG_3D_TSZb, *(GLint *) &zClearVal); + MMIO(REG_3D_TSXb, *(GLint *) &right); + MMIO(REG_3D_TSYb, *(GLint *) &bottom); + MMIO(REG_3D_TSARGBb, smesa->clearColorPattern); + } + + mEndPrimitive(); + + /* If DD_FRONT_LEFT_BIT is set, we've only cleared the front buffer so far */ + if ((mask & DD_FRONT_LEFT_BIT) != 0 && (mask & DD_BACK_LEFT_BIT) != 0) + sis_3D_Clear( ctx, DD_BACK_LEFT_BIT, x, y, width, height ); - mEndPrimitive (); + smesa->GlobalFlag |= dirtyflags; - hwcx->GlobalFlag |= RESETSTATE; - -#undef RESETSTATE -#undef STEN_OP - - /* - * TODO: will mesa call several times if multiple draw buffer - */ - return (mask & ~(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)); + return mask & ~(DD_DEPTH_BIT | DD_STENCIL_BIT | DD_BACK_LEFT_BIT | + DD_FRONT_LEFT_BIT); } -__inline__ static void -sis_bitblt_clear_cmd (__GLSiScontext * hwcx, ENGPACKET * pkt) +static void +sis_bitblt_clear_cmd( sisContextPtr smesa, ENGPACKET * pkt ) { - LPDWORD lpdwDest, lpdwSrc; - int i; + GLint *lpdwDest, *lpdwSrc; + int i; - lpdwSrc = (DWORD *) pkt + 1; - lpdwDest = (DWORD *) (GET_IOBase (hwcx) + REG_SRC_ADDR) + 1; + lpdwSrc = (GLint *) pkt + 1; + lpdwDest = (GLint *) (GET_IOBase (smesa) + REG_SRC_ADDR) + 1; - mWait3DCmdQueue (10); + mWait3DCmdQueue (10); - *lpdwDest++ = *lpdwSrc++; - lpdwSrc++; - lpdwDest++; - for (i = 3; i < 8; i++) - { + *lpdwDest++ = *lpdwSrc++; + lpdwSrc++; + lpdwDest++; + for (i = 3; i < 8; i++) { *lpdwDest++ = *lpdwSrc++; - } - - MMIO (REG_CMD0, *(DWORD *) & pkt->stdwCmd); - MMIO (0x8240, -1); + } + MMIO(REG_CMD0, *(GLint *) & pkt->stdwCmd); + MMIO(REG_CommandQueue, -1); } -__inline__ static void -sis_clear_color_buffer (GLcontext * ctx, - GLint x, GLint y, GLint width, GLint height) +static void +sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y, + GLint width, GLint height ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - XMesaBuffer xm_buffer = xmesa->xm_buffer; - sisBufferInfo *priv = (sisBufferInfo *) xm_buffer->private; + sisContextPtr smesa = SIS_CONTEXT(ctx); - int count; - GLuint origin_x, origin_y; - GLuint depth = GET_DEPTH (hwcx); - BoxPtr pExtents = NULL; - GLint xx, yy; - GLint x0, y0, width0, height0; - - ENGPACKET stEngPacket; - - GLuint pitch; - - switch (ctx->Color.DriverDrawBuffer) - { - case GL_BACK_LEFT: - priv->pCbClearPacket->stdwDestPos.wY = y; - priv->pCbClearPacket->stdwDestPos.wX = x; - priv->pCbClearPacket->stdwDim.wWidth = (WORD) width; - priv->pCbClearPacket->stdwDim.wHeight = (WORD) height; - priv->pCbClearPacket->dwFgRopColor = hwcx->clearColorPattern; + int count; + GLuint depth = smesa->bytesPerPixel; + XF86DRIClipRectPtr pExtents = NULL; + GLint xx, yy; + GLint x0, y0, width0, height0; + + ENGPACKET stEngPacket; + + /* Clear back buffer */ + if (mask & DD_BACK_LEFT_BIT) { + smesa->cbClearPacket.stdwDestPos.wY = y; + smesa->cbClearPacket.stdwDestPos.wX = x; + smesa->cbClearPacket.stdwDim.wWidth = (GLshort) width; + smesa->cbClearPacket.stdwDim.wHeight = (GLshort) height; + smesa->cbClearPacket.dwFgRopColor = smesa->clearColorPattern; - sis_bitblt_clear_cmd (hwcx, priv->pCbClearPacket); - return; - case GL_FRONT_LEFT: - x0 = x; - y0 = y; - width0 = width; - height0 = height; - - pitch = GET_PITCH (hwcx); - sis_get_drawable_origin (xmesa, &origin_x, &origin_y); - sis_get_clip_rects (xmesa, &pExtents, &count); - break; - case GL_BACK_RIGHT: - case GL_FRONT_RIGHT: - default: - assert (0); + sis_bitblt_clear_cmd( smesa, &smesa->cbClearPacket ); + } + + if ((mask & DD_FRONT_LEFT_BIT) == 0) return; - } - - memset (&stEngPacket, 0, sizeof (ENGPACKET)); - while (count--) - { - GLint x2 = pExtents->x1 - origin_x; - GLint y2 = pExtents->y1 - origin_y; - GLint xx2 = pExtents->x2 - origin_x; - GLint yy2 = pExtents->y2 - origin_y; + /* Clear front buffer */ + x0 = x; + y0 = y; + width0 = width; + height0 = height; + + pExtents = smesa->driDrawable->pClipRects; + count = smesa->driDrawable->numClipRects; + + memset( &stEngPacket, 0, sizeof (ENGPACKET) ); + + stEngPacket.dwSrcPitch = (depth == 2) ? 0x80000000 : 0xc0000000; + stEngPacket.dwDestBaseAddr = smesa->frontOffset; + stEngPacket.wDestPitch = smesa->frontPitch; + /* TODO: set maximum value? */ + stEngPacket.wDestHeight = smesa->virtualY; + stEngPacket.stdwCmd.cRop = 0xf0; + stEngPacket.dwFgRopColor = smesa->clearColorPattern; + + /* for SGRAM Block Write Enable */ + if (smesa->blockWrite) + stEngPacket.stdwCmd.cCmd0 = CMD0_PAT_FG_COLOR; + else + stEngPacket.stdwCmd.cCmd0 = 0; + stEngPacket.stdwCmd.cCmd1 = CMD1_DIR_X_INC | CMD1_DIR_Y_INC; + + while (count--) { + GLint x2 = pExtents->x1 - smesa->driDrawable->x; + GLint y2 = pExtents->y1 - smesa->driDrawable->y; + GLint xx2 = pExtents->x2 - smesa->driDrawable->x; + GLint yy2 = pExtents->y2 - smesa->driDrawable->y; x = (x0 > x2) ? x0 : x2; y = (y0 > y2) ? y0 : y2; @@ -432,178 +421,28 @@ if (width <= 0 || height <= 0) continue; - stEngPacket.dwSrcPitch = (depth == 2) ? 0x80000000 : 0xc0000000; - stEngPacket.stdwDestPos.wY = y + origin_y; - stEngPacket.stdwDestPos.wX = x + origin_x; - stEngPacket.dwDestBaseAddr = (DWORD) 0; - stEngPacket.wDestPitch = pitch; - /* TODO: set maximum value? */ - stEngPacket.wDestHeight = hwcx->virtualY; - stEngPacket.stdwDim.wWidth = (WORD) width; - stEngPacket.stdwDim.wHeight = (WORD) height; - stEngPacket.stdwCmd.cRop = 0xf0; - stEngPacket.dwFgRopColor = hwcx->clearColorPattern; - - /* for SGRAM Block Write Enable */ - if (hwcx->blockWrite) - { - stEngPacket.stdwCmd.cCmd0 = (BYTE) (CMD0_PAT_FG_COLOR); - stEngPacket.stdwCmd.cCmd1 = - (BYTE) (CMD1_DIR_X_INC | CMD1_DIR_Y_INC); - } - else - { - stEngPacket.stdwCmd.cCmd0 = 0; - stEngPacket.stdwCmd.cCmd1 = - (BYTE) (CMD1_DIR_X_INC | CMD1_DIR_Y_INC); - } - - sis_bitblt_clear_cmd (hwcx, &stEngPacket); - } -} - -__inline__ static void -sis_clear_z_stencil_buffer (GLcontext * ctx, GLbitfield mask, - GLint x, GLint y, GLint width, GLint height) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - XMesaBuffer xm_buffer = xmesa->xm_buffer; - sisBufferInfo *priv = (sisBufferInfo *) xmesa->xm_buffer->private; - - /* TODO: check write mask */ - - if (!xm_buffer->depthbuffer) - return; - - /* TODO: consider alignment of width, height? */ - priv->pZClearPacket->stdwDestPos.wY = y; - priv->pZClearPacket->stdwDestPos.wX = x; - priv->pZClearPacket->stdwDim.wWidth = (WORD) width; - priv->pZClearPacket->stdwDim.wHeight = (WORD) height; - priv->pZClearPacket->dwFgRopColor = hwcx->clearZStencilPattern; - - sis_bitblt_clear_cmd (hwcx, priv->pZClearPacket); -} - -__inline__ static void -sis_bitblt_copy_cmd (__GLSiScontext * hwcx, ENGPACKET * pkt) -{ - LPDWORD lpdwDest, lpdwSrc; - int i; - - lpdwSrc = (DWORD *) pkt; - lpdwDest = (DWORD *) (GET_IOBase (hwcx) + REG_SRC_ADDR); - - mWait3DCmdQueue (10); - - for (i = 0; i < 7; i++) - { - *lpdwDest++ = *lpdwSrc++; - } + stEngPacket.stdwDestPos.wY = y; + stEngPacket.stdwDestPos.wX = x; + stEngPacket.stdwDim.wWidth = (GLshort)width; + stEngPacket.stdwDim.wHeight = (GLshort)height; - MMIO (REG_CMD0, *(DWORD *) & pkt->stdwCmd); - MMIO (0x8240, -1); + sis_bitblt_clear_cmd( smesa, &stEngPacket ); + } } -__inline__ static void -sis_swap_image (XMesaBuffer b, XMesaDrawable d, XMesaImage * image) +static void +sis_clear_z_stencil_buffer( GLcontext * ctx, GLbitfield mask, + GLint x, GLint y, GLint width, GLint height ) { - XMesaContext xmesa = b->xm_context; - __GLSiScontext *hwcx = (__GLSiScontext *) b->xm_context->private; - - GLuint depth = GET_DEPTH (hwcx); - ENGPACKET stEngPacket; - DWORD src; - GLuint srcPitch, dstPitch; - - BoxPtr pExtents; - BoxRec box; - int count; - GLuint origin_x, origin_y; - - memset (&stEngPacket, 0, sizeof (ENGPACKET)); - - if (!sis_get_clip_rects (xmesa, &pExtents, &count)) - { - sis_get_drawable_box (xmesa, &box); - pExtents = &box; - count = 1; - } - - src = (DWORD) image->data - (DWORD) GET_FbBase (hwcx); - srcPitch = image->bytes_per_line; - dstPitch = GET_PITCH (hwcx); - sis_get_drawable_origin (xmesa, &origin_x, &origin_y); - - while(count --) - { - stEngPacket.dwSrcPitch = (depth == 2) ? 0x80000000 : 0xc0000000; - - stEngPacket.dwSrcBaseAddr = src; - stEngPacket.dwSrcPitch |= srcPitch; - - stEngPacket.stdwSrcPos.wY = pExtents->y1 - origin_y; - stEngPacket.stdwSrcPos.wX = pExtents->x1 - origin_x; - stEngPacket.stdwDestPos.wY = pExtents->y1; - stEngPacket.stdwDestPos.wX = pExtents->x1; - stEngPacket.dwDestBaseAddr = (DWORD) 0; - stEngPacket.wDestPitch = dstPitch; - - /* TODO: set maximum value? */ - stEngPacket.wDestHeight = hwcx->virtualY; - stEngPacket.stdwDim.wWidth = (WORD) pExtents->x2 - pExtents->x1; - stEngPacket.stdwDim.wHeight = (WORD) pExtents->y2 - pExtents->y1; - stEngPacket.stdwCmd.cRop = 0xcc; - - if (hwcx->blockWrite) - { - stEngPacket.stdwCmd.cCmd0 = (BYTE) (CMD0_PAT_FG_COLOR); - stEngPacket.stdwCmd.cCmd1 = - (BYTE) (CMD1_DIR_X_INC | CMD1_DIR_Y_INC); - } - else - { - stEngPacket.stdwCmd.cCmd0 = 0; - stEngPacket.stdwCmd.cCmd1 = - (BYTE) (CMD1_DIR_X_INC | CMD1_DIR_Y_INC); - } + sisContextPtr smesa = SIS_CONTEXT(ctx); - sis_bitblt_copy_cmd (hwcx, &stEngPacket); + /* TODO: consider alignment of width, height? */ + smesa->zClearPacket.stdwDestPos.wY = y; + smesa->zClearPacket.stdwDestPos.wX = x; + smesa->zClearPacket.stdwDim.wWidth = (GLshort) width; + smesa->zClearPacket.stdwDim.wHeight = (GLshort) height; + smesa->zClearPacket.dwFgRopColor = smesa->clearZStencilPattern; - pExtents++; - } + sis_bitblt_clear_cmd( smesa, &smesa->zClearPacket ); } -void -sis_swap_buffers (XMesaBuffer b) -{ - XMesaContext xmesa = b->xm_context; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - GLcontext *ctx = hwcx->gc; - - /* debug */ - /* return; */ - - /* frame control */ - /* TODO: need lock? */ - -#if 1 - { - int repeat = 0; - - while(((*hwcx->FrameCountPtr) - *(DWORD volatile *)(hwcx->IOBase+0x8a2c) - > SIS_MAX_FRAME_LENGTH) && - (repeat++ < 10)); - } -#endif - - LOCK_HARDWARE (); - - sis_swap_image (b, b->frontbuffer, b->backimage); - *(DWORD *)(hwcx->IOBase+0x8a2c) = *hwcx->FrameCountPtr; - (*hwcx->FrameCountPtr)++; - - UNLOCK_HARDWARE (); -} Index: xc/lib/GL/mesa/src/drv/sis/sis_common.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_common.h:1.5 xc/lib/GL/mesa/src/drv/sis/sis_common.h:removed --- xc/lib/GL/mesa/src/drv/sis/sis_common.h:1.5 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_common.h Sat Feb 28 21:41:18 2004 @@ -1,230 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_common.h,v 1.5 2000/09/26 15:56:48 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#ifndef _sis_common_h_ -#define _sis_common_h_ - -#include "types.h" -#include "sis_xmesaP.h" - -#if 0 -#define free(x) -#define calloc(x,y) sis_debug_malloc((x)*(y)) -extern void *sis_debug_malloc(int x); -#endif - -#if defined(SIS_DUMP) -#include "sis_debug.h" -#endif - -#if SIS_STEREO -# include "sis_stereo.h" -#else -# define STEREO_OFFSET(v) 0 -# define STEREO_SAMPLE(v) do{}while(0) -#endif - -#ifdef XFree86Server -# include "resource.h" -# include "windowstr.h" -# include "gcstruct.h" -# include "GL/xf86glx.h" -# include "xf86glx_util.h" -# include "xf86_ansic.h" -# include "xf86_libc.h" -#else -# ifdef GLX_DIRECT_RENDERING -# include -# include -# include -# include -# include "dri_mesaint.h" -typedef struct _Box -{ - short x1, y1, x2, y2; -} -BoxRec; -#define NullBox ((BoxPtr)0) -typedef struct _Box *BoxPtr; -# endif -#endif - -typedef unsigned short WORD; -typedef unsigned long DWORD; -typedef unsigned int UINT; -typedef int INT; -typedef long LONG; -typedef DWORD *LPDWORD; - -/* BitBlt Commands */ -#define Index_SR_Misc_Ctrl11 0x3e -#define CMD0_DD_ENABLE 0x06 -#define CMD0_SRC_VIDEO 0x00 -#define CMD0_SRC_CPU 0x10 -#define CMD0_PAT_FG_COLOR 0x00 -#define CMD1_DIR_X_DEC 0x00 -#define CMD1_DIR_X_INC 0x01 -#define CMD1_DIR_Y_DEC 0x00 -#define CMD1_DIR_Y_INC 0x02 -#define REG_SRC_ADDR 0x8200 -#define REG_CMD0 0x823c - -typedef struct -{ - WORD wSrcPitch; - WORD wDestPitch; -} -_PITCH; -typedef struct -{ - WORD wWidth; - WORD wHeight; -} -_DIM; -typedef struct -{ - WORD wY; - WORD wX; -} -_POS; - -typedef struct -{ - BYTE cCmd0; - BYTE cRop; - BYTE cCmd1; - BYTE cReserved; -} -_CMD; - -typedef struct -{ - WORD wStatus0; - BYTE cStatus0_BYTE3; - BYTE cStatus0_BYTE4; -} -_CMDQUESTATUS; - -typedef struct -{ - DWORD dwSrcBaseAddr; - DWORD dwSrcPitch; - _POS stdwSrcPos; - _POS stdwDestPos; - DWORD dwDestBaseAddr; - WORD wDestPitch; - WORD wDestHeight; - _DIM stdwDim; - DWORD dwFgRopColor; - DWORD dwBgRopColor; - DWORD dwSrcHiCKey; - DWORD dwSrcLoCKey; - DWORD dwMaskA; - DWORD dwMaskB; - DWORD dwClipA; - DWORD dwClipB; - _CMD stdwCmd; - _CMDQUESTATUS stdwCmdQueStatus; -} -ENGPACKET, *LPENGPACKET; - -/* Hardware Info */ -#include "sis_reg.h" -#include "sis_init.h" - -typedef struct gl_texture_object GLtextureObject; -typedef struct gl_texture_image GLtextureImage; - -#define VIDEO_TYPE 0 -#define AGP_TYPE 1 - -typedef struct sis_texure_area -{ - GLbyte *Data; - GLenum Format; - void *free; - GLuint memType; - GLuint Pitch; - GLuint Size; - GLuint texelSize; - unsigned int hHWContext; - - /* Debug */ - GLuint realSize; -} -SIStextureArea; - -/* dirtyFlag */ -#define SIS_TEX_ENV 0x1 -#define SIS_TEX_IMAGE 0x2 /* image in video memory is stale */ -#define SIS_TEX_PARAMETER 0x4 -#define SIS_TEX_ALL (SIS_TEX_IMAGE | SIS_TEX_PARAMETER) - -typedef struct sis_texobj_area -{ - DWORD dirtyFlag; - GLboolean valid; - struct sis_texobj_area *prev, *next; -} -sisTexobjInfo; - -typedef struct sis_buffer_private -{ - void *zbFree, *bbFree; - - ENGPACKET *pZClearPacket, *pCbClearPacket; - - ENGPACKET zClearPacket, cbClearPacket; - -#if SIS_STEREO - XMesaImage *pStereoImages[3]; - ENGPACKET *pStereoPackets[3]; - void *stereoFrees[3]; /* stereoFrees[0] is useless */ - - ENGPACKET stereoPackets[2]; -#endif -} -sisBufferInfo; - -/* HW capability */ -#define SIS_MAX_MIPMAP_LEVEL 11 -#define SIS_MAX_TEXTURE_SIZE 2048 -#define SIS_MAX_TEXTURES 2 - -#define SIS_MAX_FRAME_LENGTH 3 - -DWORD doFPtoFixedNoRound (DWORD dwInValue, int nFraction); - -#define Y_FLIP(Y) (xmesa->xm_buffer->bottom-(Y)) -#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_common2.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_common2.h:1.3 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_common2.h Mon Dec 8 19:15:21 2003 @@ -0,0 +1,142 @@ +/************************************************************************** + +Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +All Rights Reserved. + +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL SILICON INTEGRATED SYSTEMS CORP 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_common2.h,v 1.3 2003/12/09 00:15:21 alanh Exp $ */ + +/* + * Authors: + * Sung-Ching Lin + */ + +#ifndef _sis_common_h_ +#define _sis_common_h_ + +#if 0 +#define free(x) +#define calloc(x,y) sis_debug_malloc((x)*(y)) +extern void *sis_debug_malloc(int x); +#endif + +#if defined(SIS_DUMP) +#include "sis_debug.h" +#endif + +#ifdef GLX_DIRECT_RENDERING +# include +# include +# include +typedef struct _Box +{ + short x1, y1, x2, y2; +} +BoxRec; +#define NullBox ((BoxPtr)0) +typedef struct _Box *BoxPtr; +#endif /* GLX_DIRECT_RENDERING */ + +/* BitBlt Commands */ +#define CMD0_DD_ENABLE 0x06 +#define CMD0_SRC_VIDEO 0x00 +#define CMD0_SRC_CPU 0x10 +#define CMD0_PAT_FG_COLOR 0x00 +#define CMD1_DIR_X_DEC 0x00 +#define CMD1_DIR_X_INC 0x01 +#define CMD1_DIR_Y_DEC 0x00 +#define CMD1_DIR_Y_INC 0x02 +#define REG_SRC_ADDR 0x8200 +#define REG_CMD0 0x823c + +typedef struct +{ + GLshort wSrcPitch; + GLshort wDestPitch; +} +_PITCH; +typedef struct +{ + GLshort wWidth; + GLshort wHeight; +} +_DIM; +typedef struct +{ + GLshort wY; + GLshort wX; +} +_POS; + +typedef struct +{ + GLubyte cCmd0; + GLubyte cRop; + GLubyte cCmd1; + GLubyte cReserved; +} +_CMD; + +typedef struct +{ + GLshort wStatus0; + GLbyte cStatus0_GLbyte3; + GLbyte cStatus0_GLbyte4; +} +_CMDQUESTATUS; + +typedef struct +{ + GLint dwSrcBaseAddr; + GLint dwSrcPitch; + _POS stdwSrcPos; + _POS stdwDestPos; + GLint dwDestBaseAddr; + GLshort wDestPitch; + GLshort wDestHeight; + _DIM stdwDim; + GLint dwFgRopColor; + GLint dwBgRopColor; + GLint dwSrcHiCKey; + GLint dwSrcLoCKey; + GLint dwMaskA; + GLint dwMaskB; + GLint dwClipA; + GLint dwClipB; + _CMD stdwCmd; + _CMDQUESTATUS stdwCmdQueStatus; +} +ENGPACKET, *LPENGPACKET; + +/* Hardware Info */ +#include "sis_reg.h" + +/* HW capability */ +#define SIS_MAX_TEXTURE_SIZE 2048 +#define SIS_MAX_TEXTURES 2 + +#define SIS_MAX_FRAME_LENGTH 3 + +GLint doFPtoFixedNoRound( GLfloat dwInValue, int nFraction ); + +#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_context.c diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_context.c:1.3 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_context.c Mon Dec 8 19:15:21 2003 @@ -0,0 +1,502 @@ +/************************************************************************** + +Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_context.c,v 1.3 2003/12/09 00:15:21 alanh Exp $ */ + +/* + * Authors: + * Sung-Ching Lin + * Eric Anholt + */ + +#include "sis_dri.h" + +#include "sis_context.h" +#include "sis_state.h" +#include "sis_dd.h" +#include "sis_span.h" +#include "sis_stencil.h" +#include "sis_tex.h" +#include "sis_tris.h" +#include "sis_vb.h" + +#include "imports.h" +#include "matrix.h" +#include "extensions.h" +#include "utils.h" + +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "array_cache/acache.h" + +#include "tnl/tnl.h" +#include "tnl/t_pipeline.h" + +int GlobalCurrentHwcx = -1; +int GlobalHwcxCountBase = 1; +int GlobalCmdQueueLen = 0; + +static const char * const card_extensions[] = +{ + "GL_ARB_multitexture", + "GL_EXT_texture_lod_bias", + NULL +}; + +void +WaitEngIdle (sisContextPtr smesa) +{ + GLuint engineState; + + do { + engineState = MMIO_READ(REG_CommandQueue); + } while ((engineState & SiS_EngIdle) != SiS_EngIdle); +} + +void +Wait2DEngIdle (sisContextPtr smesa) +{ + GLuint engineState; + + do { + engineState = MMIO_READ(REG_CommandQueue); + } while ((engineState & SiS_EngIdle2d) != SiS_EngIdle2d); +} + +/* To be called from mWait3DCmdQueue. Separate function for profiling + * purposes, and speed doesn't matter because we're spinning anyway. + */ +void +WaitingFor3dIdle(sisContextPtr smesa, int wLen) +{ + while (*(smesa->CurrentQueueLenPtr) < wLen) { + *(smesa->CurrentQueueLenPtr) = + (MMIO_READ(REG_CommandQueue) & MASK_QueueLen) - 20; + } +} + +GLboolean +sisCreateContext( const __GLcontextModes *glVisual, + __DRIcontextPrivate *driContextPriv, + void *sharedContextPrivate ) +{ + GLcontext *ctx, *shareCtx; + __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; + sisContextPtr smesa; + sisScreenPtr sisScreen; + int i; + + smesa = (sisContextPtr)CALLOC( sizeof(*smesa) ); + if ( smesa == NULL ) + return GL_FALSE; + + /* Allocate the Mesa context */ + if (sharedContextPrivate) + shareCtx = ((sisContextPtr)sharedContextPrivate)->glCtx; + else + shareCtx = NULL; + smesa->glCtx = _mesa_create_context( glVisual, shareCtx, (void *) smesa, + GL_TRUE); + if (smesa->glCtx == NULL) { + FREE(smesa); + return GL_FALSE; + } + driContextPriv->driverPrivate = smesa; + ctx = smesa->glCtx; + + sisScreen = smesa->sisScreen = (sisScreenPtr)(sPriv->private); + + smesa->driContext = driContextPriv; + smesa->driScreen = sPriv; + smesa->driDrawable = NULL; + smesa->hHWContext = driContextPriv->hHWContext; + smesa->driHwLock = &sPriv->pSAREA->lock; + smesa->driFd = sPriv->fd; + + smesa->virtualX = sisScreen->screenX; + smesa->virtualY = sisScreen->screenY; + smesa->bytesPerPixel = sisScreen->cpp; + smesa->IOBase = sisScreen->mmio.map; + smesa->Chipset = sisScreen->deviceID; + smesa->irqEnabled = sisScreen->irqEnabled; + + smesa->FbBase = sPriv->pFB; + smesa->displayWidth = sPriv->fbWidth; + smesa->frontPitch = sPriv->fbStride; + + smesa->sarea = (SISSAREAPriv *)((char *)sPriv->pSAREA + + sisScreen->sarea_priv_offset); + +#if defined(SIS_DUMP) + IOBase4Debug = GET_IOBase (smesa); +#endif + + /* support ARGB8888 and RGB565 */ + switch (smesa->bytesPerPixel) + { + case 4: + smesa->redMask = 0x00ff0000; + smesa->greenMask = 0x0000ff00; + smesa->blueMask = 0x000000ff; + smesa->alphaMask = 0xff000000; + smesa->colorFormat = DST_FORMAT_ARGB_8888; + break; + case 2: + smesa->redMask = 0xf800; + smesa->greenMask = 0x07e0; + smesa->blueMask = 0x001f; + smesa->alphaMask = 0; + smesa->colorFormat = DST_FORMAT_RGB_565; + break; + default: + assert (0); + } + + /* TODO: index mode */ + + smesa->CurrentQueueLenPtr = &(smesa->sarea->QueueLength); + smesa->FrameCountPtr = &(smesa->sarea->FrameCount); + + /* set AGP */ + smesa->AGPSize = sisScreen->agp.size; + smesa->AGPBase = sisScreen->agp.map; + smesa->AGPAddr = sisScreen->agp.handle; + + /* set AGP command buffer */ + smesa->AGPCmdModeEnabled = GL_FALSE; + if (smesa->AGPSize != 0 && getenv("SIS_NO_AGP") == NULL) { + if (sisScreen->AGPCmdBufSize != 0) { + smesa->AGPCmdBufBase = smesa->AGPBase + sisScreen->AGPCmdBufOffset; + smesa->AGPCmdBufAddr = smesa->AGPAddr + sisScreen->AGPCmdBufOffset; + smesa->AGPCmdBufSize = sisScreen->AGPCmdBufSize; + + smesa->pAGPCmdBufNext = (GLint *)&(smesa->sarea->AGPCmdBufNext); + smesa->AGPCmdModeEnabled = GL_TRUE; + } + } + + smesa->GlobalFlag = 0L; + + smesa->Fallback = 0; + + /* Initialize the software rasterizer and helper modules. + */ + _swrast_CreateContext( ctx ); + _ac_CreateContext( ctx ); + _tnl_CreateContext( ctx ); + _swsetup_CreateContext( ctx ); + + _swrast_allow_pixel_fog( ctx, GL_TRUE ); + _swrast_allow_vertex_fog( ctx, GL_FALSE ); + + sisDDInitStateFuncs( ctx ); + sisDDInitState( smesa ); /* Initializes smesa->zFormat, important */ + sisInitVB( ctx ); + sisInitTriFuncs( ctx ); + sisDDInitDriverFuncs( ctx ); + sisDDInitSpanFuncs( ctx ); + sisDDInitStencilFuncs( ctx ); + sisDDInitTextureFuncs( ctx ); + + driInitExtensions( ctx, card_extensions, GL_FALSE ); + + /* TODO */ + /* smesa->blockWrite = SGRAMbw = IsBlockWrite (); */ + smesa->blockWrite = GL_FALSE; + + for (i = 0; i < SIS_MAX_TEXTURES; i++) { + smesa->TexStates[i] = 0; + smesa->PrevTexFormat[i] = 0; + } + + return GL_TRUE; +} + +void +sisDestroyContext ( __DRIcontextPrivate *driContextPriv ) +{ + sisContextPtr smesa = (sisContextPtr)driContextPriv->driverPrivate; + + assert( smesa != NULL ); + + if ( smesa != NULL ) { + _swsetup_DestroyContext( smesa->glCtx ); + _tnl_DestroyContext( smesa->glCtx ); + _ac_DestroyContext( smesa->glCtx ); + _swrast_DestroyContext( smesa->glCtx ); + + /* free the Mesa context */ + /* XXX: Is the next line needed? The DriverCtx (smesa) reference is + * needed for sisDDDeleteTexture, since it needs to call the FB/AGP free + * function. + */ + /* smesa->glCtx->DriverCtx = NULL; */ + _mesa_destroy_context(smesa->glCtx); + } + + FREE( smesa ); +} + +GLboolean +sisMakeCurrent( __DRIcontextPrivate *driContextPriv, + __DRIdrawablePrivate *driDrawPriv, + __DRIdrawablePrivate *driReadPriv ) +{ + if ( driContextPriv ) { + GET_CURRENT_CONTEXT(ctx); + sisContextPtr oldSisCtx = ctx ? SIS_CONTEXT(ctx) : NULL; + sisContextPtr newSisCtx = (sisContextPtr) driContextPriv->driverPrivate; + + if ( newSisCtx != oldSisCtx) { + newSisCtx->GlobalFlag = GFLAG_ALL; + } + + newSisCtx->driDrawable = driDrawPriv; + + _mesa_make_current2( newSisCtx->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); + + sisUpdateBufferSize( newSisCtx ); + sisUpdateClipping( newSisCtx->glCtx ); + + if ( newSisCtx->glCtx->Viewport.Width == 0 ) { + _mesa_set_viewport(newSisCtx->glCtx, 0, 0, + driDrawPriv->w, driDrawPriv->h); + } + } else { + _mesa_make_current( 0, 0 ); + } + + return GL_TRUE; +} + +GLboolean +sisUnbindContext( __DRIcontextPrivate *driContextPriv ) +{ + return GL_TRUE; +} + +void +sis_update_render_state( sisContextPtr smesa ) +{ + __GLSiSHardware *prev = &smesa->prev; + + mWait3DCmdQueue (45); + + if (smesa->GlobalFlag & GFLAG_ENABLESETTING) { + if (!smesa->clearTexCache) { + MMIO(REG_3D_TEnable, prev->hwCapEnable); + } else { + MMIO(REG_3D_TEnable, prev->hwCapEnable | MASK_TextureCacheClear); + MMIO(REG_3D_TEnable, prev->hwCapEnable); + smesa->clearTexCache = GL_FALSE; + } + } + + if (smesa->GlobalFlag & GFLAG_ENABLESETTING2) + MMIO(REG_3D_TEnable2, prev->hwCapEnable2); + + /* Z Setting */ + if (smesa->GlobalFlag & GFLAG_ZSETTING) + { + MMIO(REG_3D_ZSet, prev->hwZ); + MMIO(REG_3D_ZStWriteMask, prev->hwZMask); + MMIO(REG_3D_ZAddress, prev->hwOffsetZ); + } + + /* Alpha Setting */ + if (smesa->GlobalFlag & GFLAG_ALPHASETTING) + MMIO(REG_3D_AlphaSet, prev->hwAlpha); + + if (smesa->GlobalFlag & GFLAG_DESTSETTING) { + MMIO(REG_3D_DstSet, prev->hwDstSet); + MMIO(REG_3D_DstAlphaWriteMask, prev->hwDstMask); + MMIO(REG_3D_DstAddress, prev->hwOffsetDest); + } + + /* Line Setting */ +#if 0 + if (smesa->GlobalFlag & GFLAG_LINESETTING) + MMIO(REG_3D_LinePattern, prev->hwLinePattern); +#endif + + /* Fog Setting */ + if (smesa->GlobalFlag & GFLAG_FOGSETTING) + { + MMIO(REG_3D_FogSet, prev->hwFog); + MMIO(REG_3D_FogInverseDistance, prev->hwFogInverse); + MMIO(REG_3D_FogFarDistance, prev->hwFogFar); + MMIO(REG_3D_FogFactorDensity, prev->hwFogDensity); + } + + /* Stencil Setting */ + if (smesa->GlobalFlag & GFLAG_STENCILSETTING) { + MMIO(REG_3D_StencilSet, prev->hwStSetting); + MMIO(REG_3D_StencilSet2, prev->hwStSetting2); + } + + /* Miscellaneous Setting */ + if (smesa->GlobalFlag & GFLAG_DSTBLEND) + MMIO(REG_3D_DstBlendMode, prev->hwDstSrcBlend); + if (smesa->GlobalFlag & GFLAG_CLIPPING) { + MMIO(REG_3D_ClipTopBottom, prev->clipTopBottom); + MMIO(REG_3D_ClipLeftRight, prev->clipLeftRight); + } + + smesa->GlobalFlag &= ~GFLAG_RENDER_STATES; +} + +void +sis_update_texture_state (sisContextPtr smesa) +{ + __GLSiSHardware *prev = &smesa->prev; + + mWait3DCmdQueue (55); + if (smesa->clearTexCache || (smesa->GlobalFlag & GFLAG_TEXTUREADDRESS)) { + MMIO(REG_3D_TEnable, prev->hwCapEnable | MASK_TextureCacheClear); + MMIO(REG_3D_TEnable, prev->hwCapEnable); + smesa->clearTexCache = GL_FALSE; + } + + /* Texture Setting */ + if (smesa->GlobalFlag & CFLAG_TEXTURERESET) + MMIO(REG_3D_TextureSet, prev->texture[0].hwTextureSet); + + if (smesa->GlobalFlag & GFLAG_TEXTUREMIPMAP) + MMIO(REG_3D_TextureMip, prev->texture[0].hwTextureMip); + + /* + MMIO(REG_3D_TextureTransparencyColorHigh, prev->texture[0].hwTextureClrHigh); + MMIO(REG_3D_TextureTransparencyColorLow, prev->texture[0].hwTextureClrLow); + */ + + if (smesa->GlobalFlag & GFLAG_TEXBORDERCOLOR) + MMIO(REG_3D_TextureBorderColor, prev->texture[0].hwTextureBorderColor); + + if (smesa->GlobalFlag & GFLAG_TEXTUREADDRESS) { + switch ((prev->texture[0].hwTextureSet & MASK_TextureLevel) >> 8) + { + case 11: + MMIO(REG_3D_TextureAddress11, prev->texture[0].texOffset11); + case 10: + MMIO(REG_3D_TextureAddress10, prev->texture[0].texOffset10); + MMIO(REG_3D_TexturePitch10, prev->texture[0].texPitch10); + case 9: + MMIO(REG_3D_TextureAddress9, prev->texture[0].texOffset9); + case 8: + MMIO(REG_3D_TextureAddress8, prev->texture[0].texOffset8); + MMIO(REG_3D_TexturePitch8, prev->texture[0].texPitch89); + case 7: + MMIO(REG_3D_TextureAddress7, prev->texture[0].texOffset7); + case 6: + MMIO(REG_3D_TextureAddress6, prev->texture[0].texOffset6); + MMIO(REG_3D_TexturePitch6, prev->texture[0].texPitch67); + case 5: + MMIO(REG_3D_TextureAddress5, prev->texture[0].texOffset5); + case 4: + MMIO(REG_3D_TextureAddress4, prev->texture[0].texOffset4); + MMIO(REG_3D_TexturePitch4, prev->texture[0].texPitch45); + case 3: + MMIO(REG_3D_TextureAddress3, prev->texture[0].texOffset3); + case 2: + MMIO(REG_3D_TextureAddress2, prev->texture[0].texOffset2); + MMIO(REG_3D_TexturePitch2, prev->texture[0].texPitch23); + case 1: + MMIO(REG_3D_TextureAddress1, prev->texture[0].texOffset1); + case 0: + MMIO(REG_3D_TextureAddress0, prev->texture[0].texOffset0); + MMIO(REG_3D_TexturePitch0, prev->texture[0].texPitch01); + } + } + if (smesa->GlobalFlag & CFLAG_TEXTURERESET_1) + MMIO(REG_3D_Texture1Set, prev->texture[1].hwTextureSet); + if (smesa->GlobalFlag & GFLAG_TEXTUREMIPMAP_1) + MMIO(REG_3D_Texture1Mip, prev->texture[1].hwTextureMip); + + if (smesa->GlobalFlag & GFLAG_TEXBORDERCOLOR_1) { + MMIO(REG_3D_Texture1BorderColor, + prev->texture[1].hwTextureBorderColor); + } + if (smesa->GlobalFlag & GFLAG_TEXTUREADDRESS_1) { + switch ((prev->texture[1].hwTextureSet & MASK_TextureLevel) >> 8) + { + case 11: + MMIO(REG_3D_Texture1Address11, prev->texture[1].texOffset11); + case 10: + MMIO(REG_3D_Texture1Address10, prev->texture[1].texOffset10); + MMIO(REG_3D_Texture1Pitch10, prev->texture[1].texPitch10); + case 9: + MMIO(REG_3D_Texture1Address9, prev->texture[1].texOffset9); + case 8: + MMIO(REG_3D_Texture1Address8, prev->texture[1].texOffset8); + MMIO(REG_3D_Texture1Pitch8, prev->texture[1].texPitch89); + case 7: + MMIO(REG_3D_Texture1Address7, prev->texture[1].texOffset7); + case 6: + MMIO(REG_3D_Texture1Address6, prev->texture[1].texOffset6); + MMIO(REG_3D_Texture1Pitch6, prev->texture[1].texPitch67); + case 5: + MMIO(REG_3D_Texture1Address5, prev->texture[1].texOffset5); + case 4: + MMIO(REG_3D_Texture1Address4, prev->texture[1].texOffset4); + MMIO(REG_3D_Texture1Pitch4, prev->texture[1].texPitch45); + case 3: + MMIO(REG_3D_Texture1Address3, prev->texture[1].texOffset3); + case 2: + MMIO(REG_3D_Texture1Address2, prev->texture[1].texOffset2); + MMIO(REG_3D_Texture1Pitch2, prev->texture[1].texPitch23); + case 1: + MMIO(REG_3D_Texture1Address1, prev->texture[1].texOffset1); + case 0: + MMIO(REG_3D_Texture1Address0, prev->texture[1].texOffset0); + MMIO(REG_3D_Texture1Pitch0, prev->texture[1].texPitch01); + } + } + + /* texture environment */ + if (smesa->GlobalFlag & GFLAG_TEXTUREENV) { + MMIO(REG_3D_TextureBlendFactor, prev->hwTexEnvColor); + MMIO(REG_3D_TextureColorBlendSet0, prev->hwTexBlendColor0); + MMIO(REG_3D_TextureAlphaBlendSet0, prev->hwTexBlendAlpha0); + } + if (smesa->GlobalFlag & GFLAG_TEXTUREENV_1) { + MMIO(REG_3D_TextureBlendFactor, prev->hwTexEnvColor); + MMIO(REG_3D_TextureColorBlendSet1, prev->hwTexBlendColor1); + MMIO(REG_3D_TextureAlphaBlendSet1, prev->hwTexBlendAlpha1); + } + + smesa->GlobalFlag &= ~GFLAG_TEXTURE_STATES; +} + +void +sis_fatal_error (void) +{ + /* free video memory, or the framebuffer device will do it automatically */ + + fprintf(stderr, "Fatal errors in sis_dri.so\n"); + exit (-1); +} Index: xc/lib/GL/mesa/src/drv/sis/sis_context.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_context.h:1.3 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_context.h Mon Dec 8 19:15:21 2003 @@ -0,0 +1,436 @@ +/************************************************************************** + +Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_context.h,v 1.3 2003/12/09 00:15:21 alanh Exp $ */ + +/* + * Authors: + * Sung-Ching Lin + * Eric Anholt + */ + +#ifndef _sis_ctx_h_ +#define _sis_ctx_h_ + +#include "context.h" +#include "dri_util.h" + +#include "sis_screen.h" +#include "sis_common2.h" +#include "sis_dri.h" + +/* for GLboolean */ +#include + +#define PCI_CHIP_SIS300 0x0300 +#define PCI_CHIP_SIS630 0x6300 +#define PCI_CHIP_SIS540 0x5300 + +#define NEW_TEXTURING 0x1 +#define NEW_TEXTURE_ENV 0x2 + +/* Flags for software fallback cases: + */ +#define SIS_FALLBACK_TEXTURE 0x0001 +#define SIS_FALLBACK_TEXTURE0 0x0002 +#define SIS_FALLBACK_TEXTURE1 0x0004 +#define SIS_FALLBACK_TEXENV0 0x0008 +#define SIS_FALLBACK_TEXENV1 0x0010 +#define SIS_FALLBACK_DRAW_BUFFER 0x0020 +#define SIS_FALLBACK_STENCIL 0x0040 +#define SIS_FALLBACK_FORCE 0x8000 + +/* Flags for hardware state that needs to be updated */ +#define GFLAG_ENABLESETTING 0x00000001 +#define GFLAG_ENABLESETTING2 0x00000002 +#define GFLAG_ZSETTING 0x00000004 +#define GFLAG_ALPHASETTING 0x00000008 +#define GFLAG_DESTSETTING 0x00000010 +#define GFLAG_LINESETTING 0x00000020 +#define GFLAG_STENCILSETTING 0x00000040 +#define GFLAG_FOGSETTING 0x00000080 +#define GFLAG_DSTBLEND 0x00000100 +#define GFLAG_CLIPPING 0x00000200 +#define CFLAG_TEXTURERESET 0x00000400 +#define GFLAG_TEXTUREMIPMAP 0x00000800 +#define GFLAG_TEXBORDERCOLOR 0x00001000 +#define GFLAG_TEXTUREADDRESS 0x00002000 +#define GFLAG_TEXTUREENV 0x00004000 +#define CFLAG_TEXTURERESET_1 0x00008000 +#define GFLAG_TEXTUREMIPMAP_1 0x00010000 +#define GFLAG_TEXBORDERCOLOR_1 0x00020000 +#define GFLAG_TEXTUREADDRESS_1 0x00040000 +#define GFLAG_TEXTUREENV_1 0x00080000 +#define GFLAG_ALL 0x000fffff + +#define GFLAG_TEXTURE_STATES (CFLAG_TEXTURERESET | GFLAG_TEXTUREMIPMAP | \ + GFLAG_TEXBORDERCOLOR | GFLAG_TEXTUREADDRESS | \ + CFLAG_TEXTURERESET_1 | GFLAG_TEXTUREMIPMAP_1 | \ + GFLAG_TEXBORDERCOLOR_1 | \ + GFLAG_TEXTUREADDRESS_1 | \ + GFLAG_TEXTUREENV | GFLAG_TEXTUREENV_1) + + +#define GFLAG_RENDER_STATES (GFLAG_ENABLESETTING | GFLAG_ENABLESETTING2 | \ + GFLAG_ZSETTING | GFLAG_ALPHASETTING | \ + GFLAG_DESTSETTING | GFLAG_FOGSETTING | \ + GFLAG_STENCILSETTING | GFLAG_DSTBLEND | \ + GFLAG_CLIPPING) + +/* Use the templated vertex format: + */ +#define TAG(x) sis##x +#include "tnl_dd/t_dd_vertex.h" +#undef TAG + +/* Subpixel offsets for window coordinates (triangles): + */ +#define SUBPIXEL_X (-0.5F) +#define SUBPIXEL_Y (-0.5F) + +#define SIS_MAX_TEXTURE_LEVELS 11 + +typedef struct { + GLbyte *Data; /* Pointer to texture in offscreen */ + GLuint memType; /* VIDEO_TYPE or AGP_TYPE */ + void *handle; /* Handle for sisFree*() */ + GLuint pitch; + GLuint size; +} sisTexImage; + +typedef struct sis_tex_obj { + sisTexImage image[SIS_MAX_TEXTURE_LEVELS]; /* Image data for each mipmap + * level */ + GLenum format; /* One of GL_ALPHA, GL_INTENSITY, GL_LUMINANCE, + * GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA */ + GLint hwformat; /* One of the TEXEL_ defines */ + GLint numImages; /* Number of images loaded into .image */ +} sisTexObj, *sisTexObjPtr; + +/* + ** Device dependent context state + */ +typedef struct __GLSiSTextureRec +{ + GLint hwTextureSet; + GLint hwTextureMip; + GLint hwTextureClrHigh; + GLint hwTextureClrLow; + GLint hwTextureBorderColor; + + GLint texOffset0; + GLint texOffset1; + GLint texOffset2; + GLint texOffset3; + GLint texOffset4; + GLint texOffset5; + GLint texOffset6; + GLint texOffset7; + GLint texOffset8; + GLint texOffset9; + GLint texOffset10; + GLint texOffset11; + + GLint texPitch01; + GLint texPitch23; + GLint texPitch45; + GLint texPitch67; + GLint texPitch89; + GLint texPitch10; +} __GLSiSTexture; + +typedef struct __GLSiSHardwareRec +{ + GLint hwCapEnable, hwCapEnable2; /* Enable Setting */ + + GLint hwOffsetZ, hwZ; /* Z Setting */ + + GLint hwZBias, hwZMask; /* Z Setting */ + + GLint hwAlpha; /* Alpha Setting */ + + GLint hwDstSet, hwDstMask; /* Destination Setting */ + + GLint hwOffsetDest; /* Destination Setting */ + + GLint hwLinePattern; /* Line Setting */ + + GLint hwFog; /* Fog Setting */ + + GLint hwFogFar, hwFogInverse; /* Fog Distance setting */ + + GLint hwFogDensity; /* Fog factor & density */ + + GLint hwStSetting, hwStSetting2; /* Stencil Setting */ + + GLint hwStOffset; /* Stencil Setting */ + + GLint hwDstSrcBlend; /* Blending mode Setting */ + + GLint clipTopBottom; /* Clip for Top & Bottom */ + + GLint clipLeftRight; /* Clip for Left & Right */ + + struct __GLSiSTextureRec texture[2]; + + GLint hwTexEnvColor; /* Texture Blending Setting */ + + GLint hwTexBlendColor0; + GLint hwTexBlendColor1; + GLint hwTexBlendAlpha0; + GLint hwTexBlendAlpha1; + +} +__GLSiSHardware; + +typedef struct sis_context sisContextRec; +typedef struct sis_context *sisContextPtr; + +typedef void (*sis_quad_func)( sisContextPtr, + sisVertex *, + sisVertex *, + sisVertex *, + sisVertex * ); + +typedef void (*sis_tri_func)( sisContextPtr, + sisVertex *, + sisVertex *, + sisVertex * ); + +typedef void (*sis_line_func)( sisContextPtr, + sisVertex *, + sisVertex * ); + +typedef void (*sis_point_func)( sisContextPtr, + sisVertex * ); + +/* Device dependent context state */ + +struct sis_context +{ + /* This must be first in this structure */ + GLcontext *glCtx; + + /* Temporaries for translating away float colors: + */ + struct gl_client_array UbyteColor; + struct gl_client_array UbyteSecondaryColor; + + GLuint NewGLState; + GLuint Fallback; + GLuint SetupIndex; + GLuint SetupNewInputs; + GLuint RenderIndex; + GLfloat hw_viewport[16]; + GLfloat depth_scale; + GLuint vertex_size; + GLuint vertex_stride_shift; + GLuint vertex_format; + GLuint num_verts; + GLubyte *verts; + + unsigned int virtualX, virtualY; + unsigned int bytesPerPixel; + unsigned char *IOBase; + unsigned char *FbBase; + unsigned int displayWidth; + unsigned int frontOffset; + unsigned int frontPitch; + + /* HW RGBA layout */ + unsigned int redMask, greenMask, blueMask, alphaMask; + unsigned int colorFormat; + + /* Z format */ + unsigned int zFormat; + + /* Clear patterns, 4 bytes */ + unsigned int clearColorPattern; + unsigned int clearZStencilPattern; + + /* Fallback rasterization functions + */ + sis_point_func draw_point; + sis_line_func draw_line; + sis_tri_func draw_tri; + sis_quad_func draw_quad; + + GLuint hw_primitive; + GLenum raster_primitive; + GLenum render_primitive; + + /* DRM fd */ + int driFd; + + /* AGP Memory */ + unsigned int AGPSize; + unsigned char *AGPBase; + unsigned int AGPAddr; + + /* AGP Command Buffer */ + /* TODO: use Global variables */ + + unsigned char *AGPCmdBufBase; + GLint AGPCmdBufAddr; + unsigned int AGPCmdBufSize; + GLint *pAGPCmdBufNext; + GLboolean AGPCmdModeEnabled; + + /* register 0x89F4 */ + GLint AGPParseSet; + + /* register 0x89F8 */ + GLint dwPrimitiveSet; + + __GLSiSHardware prev, current; + + int Chipset; + + GLint drawableID; + + /* SGRAM block write */ + GLboolean blockWrite; + + GLint GlobalFlag; + + /* Stereo */ + GLboolean isFullScreen; + GLboolean useStereo; + GLboolean stereoEnabled; + int stereo_drawIndex; + int stereo_drawSide; + GLboolean irqEnabled; + + GLboolean clearTexCache; + + GLuint TexStates[SIS_MAX_TEXTURES]; + GLuint PrevTexFormat[SIS_MAX_TEXTURES]; + + int *CurrentQueueLenPtr; + unsigned int *FrameCountPtr; + + /* Front/back/depth buffer info */ + GLuint width, height; /* size of buffers */ + GLint bottom; /* used for FLIP macro */ + GLvoid *backbuffer; + unsigned int backOffset; + unsigned int backPitch; + GLvoid *depthbuffer; + unsigned int depthOffset; + unsigned int depthPitch; + void *zbFree, *bbFree; /* Cookies for freeing buffers */ + ENGPACKET zClearPacket, cbClearPacket; + + /* Drawable, cliprect and scissor information + */ + GLint drawOffset, drawPitch; + GLint readOffset, readPitch; + + /* Mirrors of some DRI state + */ + __DRIcontextPrivate *driContext; /* DRI context */ + __DRIscreenPrivate *driScreen; /* DRI screen */ + __DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */ + + unsigned int lastStamp; /* mirror driDrawable->lastStamp */ + + drmContext hHWContext; + drmLock *driHwLock; + + sisScreenPtr sisScreen; /* Screen private DRI data */ + SISSAREAPrivPtr sarea; /* Private SAREA data */ + +}; + +#define SIS_CONTEXT(ctx) ((sisContextPtr)(ctx->DriverCtx)) + +/* Macros */ +#define GET_IOBase(x) ((x)->IOBase) + +#define Y_FLIP(Y) (smesa->bottom - (Y)) + +#define SISPACKCOLOR565( r, g, b ) \ + ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) + +#define SISPACKCOLOR8888( r, g, b, a ) \ + (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) + +#define SIS_VERBOSE 0 + + +#define MMIO(reg, value) \ +{\ + *(GLint *)(GET_IOBase(smesa) + (reg)) = value; \ +} + +#define MMIO_READ(reg) *(volatile GLint *)(smesa->IOBase + (reg)) +#define MMIO_READf(reg) *(volatile GLfloat *)(smesa->IOBase + (reg)) + +#define mEndPrimitive() \ +{ \ + *(GET_IOBase(smesa) + REG_3D_EndPrimitiveList) = 0xFF; \ + *(GLint *)(GET_IOBase(smesa) + 0x8b60) = (GLint)(-1); \ +} + +/* Lock required */ +#define mWait3DCmdQueue(wLen) \ +/* Update the mirrored queue pointer if it doesn't indicate enough space */ \ +if (*(smesa->CurrentQueueLenPtr) < (wLen)) { \ + *(smesa->CurrentQueueLenPtr) = \ + (*(GLint *)(GET_IOBase(smesa) + REG_CommandQueue) & MASK_QueueLen) - 20; \ + /* Spin and wait if the queue is actually too full */ \ + if (*(smesa->CurrentQueueLenPtr) < (wLen)) \ + WaitingFor3dIdle(smesa, wLen); \ + *(smesa->CurrentQueueLenPtr) -= wLen; \ +} + +enum _sis_verbose { + VERBOSE_SIS_BUFFER = 0x1, + VERBOSE_SIS_MEMORY = 0x2 +}; + +extern GLboolean sisCreateContext( const __GLcontextModes *glVisual, + __DRIcontextPrivate *driContextPriv, + void *sharedContextPrivate ); +extern void sisDestroyContext( __DRIcontextPrivate * ); + +extern GLboolean sisMakeCurrent( __DRIcontextPrivate *driContextPriv, + __DRIdrawablePrivate *driDrawPriv, + __DRIdrawablePrivate *driReadPriv ); + +extern GLboolean sisUnbindContext( __DRIcontextPrivate *driContextPriv ); + +void WaitEngIdle (sisContextPtr smesa); +void Wait2DEngIdle (sisContextPtr smesa); +void WaitingFor3dIdle(sisContextPtr smesa, int wLen); + +/* update to hw */ +extern void sis_update_texture_state( sisContextPtr smesa ); +extern void sis_update_render_state( sisContextPtr smesa ); + +void sis_fatal_error (void); + +#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_ctx.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_ctx.c:1.3 xc/lib/GL/mesa/src/drv/sis/sis_ctx.c:removed --- xc/lib/GL/mesa/src/drv/sis/sis_ctx.c:1.3 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_ctx.c Sat Feb 28 21:41:18 2004 @@ -1,874 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_ctx.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#ifdef XFree86Server -# define PSZ 8 -# include "cfb.h" -# undef PSZ -# include "cfb16.h" -# include "cfb24.h" -# include "cfb32.h" -# include "cfb24_32.h" -/* for SISPtr */ -# include "xf86.h" -# include "xf86_OSproc.h" -# include "xf86Resources.h" -# include "xf86Version.h" -# include "xf86PciInfo.h" -# include "xf86Pci.h" -# include "xf86cmap.h" -# include "vgaHW.h" -# include "xf86RAC.h" -# include "sis_regs.h" -# include "sis.h" -# include "dristruct.h" -# include "dri.h" -#else -#include "sis_dri.h" -#endif - -#include "extensions.h" - -#include "sis_ctx.h" -#include "sis_mesa.h" - -int GlobalCurrentHwcx = -1; -int GlobalHwcxCountBase = 1; -int GlobalCmdQueueLen = 0; - -void -WaitEngIdle (__GLSiScontext * hwcx) -{ - BYTE *IOBase = GET_IOBase (hwcx); - BYTE cEngineState; - - cEngineState = *((BYTE volatile *) (IOBase + 0x8243)); - while (((cEngineState & 0x80) == 0) || - ((cEngineState & 0x40) == 0) || ((cEngineState & 0x20) == 0)) - { - cEngineState = *((BYTE volatile *) (IOBase + 0x8243)); - } -} - -void -Wait2DEngIdle (__GLSiScontext * hwcx) -{ - BYTE *IOBase = GET_IOBase (hwcx); - BYTE cEngineState; - - cEngineState = *((BYTE volatile *) (IOBase + 0x8243)); - while (!(cEngineState & 0x80)) - { - cEngineState = *((BYTE volatile *) (IOBase + 0x8243)); - } -} - -static void -sis_init_opengl_state (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *current = &hwcx->current; - __GLSiSHardware *prev = &(hwcx->prev); - - /* - prev->hwCapEnable = INIT_6327_CapsEnable ; - prev->hwCapEnable = 0x000000a0; - */ - /* add Texture Perspective Enable */ - prev->hwCapEnable = 0x000002a0; - - /* - prev->hwCapEnable2 = INIT_6327_CapsEnable2; - prev->hwCapEnable2 = 0x00aa0080; - */ - /* if multi-texture enabled, disable Z pre-test */ - prev->hwCapEnable2 = 0x00000000; - - /* Z test mode is LE */ - prev->hwZ = INIT_6327_ZSet; - - /* TODO : maybe call sis_DepthFunc to update is a better way */ - ctx->Driver.DepthFunc (ctx, ctx->Depth.Func); - - /* Depth mask */ - prev->hwZMask = INIT_6327_ZMask; - - /* Alpha test mode is ALWAYS, Alpha ref value is 0 */ - prev->hwAlpha = INIT_6327_AlphaSet; - - /* ROP2 is COPYPEN */ - prev->hwDstSet = INIT_6327_DstSet; - - /* color mask */ - prev->hwDstMask = INIT_6327_DstMask; - - /* LinePattern is 0, Repeat Factor is 0 */ - prev->hwLinePattern = 0x00008000; - - /* Fog mode is Linear Fog, Fog color is (0, 0, 0) */ - prev->hwFog = INIT_6327_FogSet; - - /* Src blend is BLEND_ONE, Dst blend is D3DBLEND_ZERO */ - prev->hwDstSrcBlend = INIT_6327_BlendMode; - - /* Texture mapping mode is Tile */ -#if 0 - prev->texture[0].hwTextqureSet = INIT_6327_TextureSet; -#endif - /* Magnified & minified texture filter is NEAREST */ -#if 0 - prev->texture[0].hwTextureMip = INIT_6327_TextureMip; -#endif - - /* Texture Blending seeting */ - prev->hwTexBlendClr0 = INIT_6327_TextureColorBlend0; - - prev->hwTexBlendClr1 = INIT_6327_TextureColorBlend1; - - prev->hwTexBlendAlpha0 = INIT_6327_TextureAlphaBlend0; - - prev->hwTexBlendAlpha1 = INIT_6327_TextureAlphaBlend1; - - memcpy (current, prev, sizeof (__GLSiSHardware)); - - /* Init the texture transparency color high range value */ -#if 0 - lpdwRegIO = ((LPDWORD)hwcx->lpEngIO + REG_3D_TransparencyColorHigh); - prev->hwTextureClrHigh = INIT_6326_TextureClrHigh; - *(lpdwRegIO) = INIT_6327_TextureClrHigh; -#endif -} - -static void -sis_init_user_setting (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - /* disable all unsupported per-pixel extensions */ - gl_extensions_disable (ctx, "GL_EXT_blend_color"); - gl_extensions_disable (ctx, "GL_EXT_blend_minmax"); - gl_extensions_disable (ctx, "GL_EXT_blend_logic_op"); - gl_extensions_disable (ctx, "GL_EXT_blend_subtract"); - gl_extensions_disable (ctx, "GL_EXT_paletted_texture"); - gl_extensions_disable (ctx, "GL_EXT_point_parameters"); - gl_extensions_disable (ctx, "GL_EXT_texture3D"); - gl_extensions_disable (ctx, "GL_INGR_blend_func_separate"); - gl_extensions_disable (ctx, "GL_PGI_misc_hints"); - gl_extensions_disable (ctx, "GL_EXT_clip_volume_hint"); - gl_extensions_disable (ctx, "GL_EXT_texture_env_add"); - - /* TODO: driver doesn't handle this */ - if (getenv ("SIS_SINGLE_TEXTURE")) - gl_extensions_disable (ctx, "GL_ARB_multitexture"); - - /* turning off the extension has more speed */ - /* if mesa supports indirect VB rendering, remove it */ - - /* if disable it, quake3 will have broken triangle */ - /* gl_extensions_disable (ctx, "GL_EXT_compiled_vertex_array"); */ - - /* debug */ - if(getenv ("SIS_NO_AGP_CMDS")) - hwcx->AGPCmdModeEnabled = GL_FALSE; - -#if SIS_STEREO - if(getenv ("SIS_STEREO") && hwcx->irqEnabled) - hwcx->useStereo = GL_TRUE; - else - hwcx->useStereo = GL_FALSE; - - { - float val; - char *str; - - /* TODO: error check */ - if((str=getenv("SIS_STEREO_OFFSET"))){ - val= atof(str); - if(val>0 && val<1){ - StereoInitOffset = val; - } - } - - if((str=getenv("SIS_STEREO_SCALE"))){ - val= atof(str); - if(val>0){ - StereoInitScale = val; - } - } - } - - if(getenv("SIS_STEREO_DYNAMIC_Z")) - StereoDynamicZ = GL_TRUE; -#endif -} - -void -SiSCreateContext (XMesaContext xmesa) -{ - GLcontext *ctx = xmesa->gl_ctx; - __GLSiScontext *hwcx; - - int i; - - hwcx = (__GLSiScontext *) calloc (1, sizeof (__GLSiScontext)); - if (!hwcx) - { - fprintf (stderr, "SIS Driver : allocating context fails\n"); - sis_fatal_error (); - return; - } - - /* set gc */ - hwcx->gc = ctx; - xmesa->private = hwcx; - - /* set static part in ctx->Driver */ - sis_init_driver (ctx); - - /* Set 2D data (from X-Server) */ - /* i assume the data will not change during X-server's lifetime */ -#ifdef XFree86Server - { - ScrnInfoPtr pScrn = xf86Screens[xmesa->display->myNum]; - SISPtr pSiS = SISPTR (pScrn); - - hwcx->virtualX = pSiS->pScrn->virtualX; - hwcx->virtualY = pSiS->pScrn->virtualY; - hwcx->bytesPerPixel = (pSiS->pScrn->bitsPerPixel + 7) / 8; - hwcx->IOBase = pSiS->IOBase; - hwcx->FbBase = pSiS->FbBase; - hwcx->displayWidth = pSiS->pScrn->displayWidth * hwcx->bytesPerPixel; - hwcx->pitch = pSiS->scrnOffset; - hwcx->Chipset = pSiS->Chipset; - hwcx->drmSubFD = pSiS->drmSubFD; -#if SIS_STEREO - hwcx->irqEnabled = pSiS->irqEnabled; -#endif - } -#else - { - __DRIscreenPrivate *psp = xmesa->driContextPriv->driScreenPriv; - SISDRIPtr priv = (SISDRIPtr) psp->pDevPriv; - - hwcx->virtualX = priv->width; - hwcx->virtualY = priv->height; - hwcx->bytesPerPixel = priv->bytesPerPixel; - hwcx->IOBase = priv->regs.map; - hwcx->FbBase = psp->pFB; - hwcx->displayWidth = psp->fbWidth; - hwcx->pitch = psp->fbStride; - hwcx->Chipset = priv->deviceID; - /* TODO: make sure psp->fd is sub-driver's fd */ - hwcx->drmSubFD = psp->fd; -#if SIS_STEREO - hwcx->irqEnabled = priv->irqEnabled; -#endif - } -#endif - -#if defined(SIS_DUMP) - IOBase4Debug = GET_IOBase (hwcx); -#endif - - /* support ARGB8888 and RGB565 */ - switch (hwcx->bytesPerPixel) - { - case 4: - hwcx->redMask = 0x00ff0000; - hwcx->greenMask = 0x0000ff00; - hwcx->blueMask = 0x000000ff; - hwcx->alphaMask = 0xff000000; - hwcx->colorFormat = DST_FORMAT_ARGB_8888; - break; - case 2: - hwcx->redMask = 0xf800; - hwcx->greenMask = 0x07e0; - hwcx->blueMask = 0x001f; - hwcx->alphaMask = 0; - hwcx->colorFormat = DST_FORMAT_RGB_565; - break; - default: - assert (0); - } - - sis_sw_init_driver (ctx); - - /* TODO: index mode */ - -#if defined(XFree86Server) - { -#if defined(XF86DRI) - ScreenPtr pScreen = xmesa->display; - ScrnInfoPtr pScrn = xf86Screens[xmesa->display->myNum]; - SISPtr pSiS = SISPTR (pScrn); - - if (pSiS->directRenderingEnabled) - { - SISSAREAPriv *saPriv = (SISSAREAPriv *) DRIGetSAREAPrivate (pScreen); - - drmContextPtr contextPtr; - - /* in DR, the action is done by DRI */ - hwcx->pDRIContextPriv = DRICreateContextPriv (pScreen, contextPtr, 0); - if (!contextPtr) - { - /* TODO */ - assert(0); - } - - hwcx->serialNumber = (int) *contextPtr; - hwcx->CurrentHwcxPtr = &(saPriv->CtxOwner); - hwcx->CurrentQueueLenPtr = pSiS->cmdQueueLenPtr; - /* hwcx->FrameCountPtr = */ - - /* what does this do? */ - /* - drmFreeReservedContextList (contextPtr); - */ - - /* TODO, set AGP command buffer */ - hwcx->AGPCmdModeEnabled = GL_FALSE; - } - else -#endif - { - hwcx->serialNumber = GlobalHwcxCountBase++; - hwcx->CurrentHwcxPtr = &GlobalCurrentHwcx; - hwcx->CurrentQueueLenPtr = pSiS->cmdQueueLenPtr; - /* hwcx->FrameCountPtr = */ - - /* TODO, set AGP command buffer */ - hwcx->AGPCmdModeEnabled = GL_FALSE; - } - } -#else - { - __DRIscreenPrivate *psp = xmesa->driContextPriv->driScreenPriv; - SISDRIPtr priv = (SISDRIPtr) psp->pDevPriv; - SISSAREAPriv *saPriv = (SISSAREAPriv *) (((char *) psp->pSAREA) + - sizeof (XF86DRISAREARec)); - - /* or use xmesa->driContextPriv->contextID - * use hHWContext is better, but limit ID to [0..2^31-1] (modify driver) - * hHWContext is CARD32 - */ - hwcx->serialNumber = xmesa->driContextPriv->hHWContext; - hwcx->CurrentHwcxPtr = &(saPriv->CtxOwner); - hwcx->CurrentQueueLenPtr = &(saPriv->QueueLength); - hwcx->FrameCountPtr = &(saPriv->FrameCount); - - /* set AGP */ - hwcx->AGPSize = priv->agp.size; - hwcx->AGPBase = priv->agp.map; - hwcx->AGPAddr = priv->agp.handle; - - /* set AGP command buffer */ - hwcx->AGPCmdModeEnabled = GL_FALSE; - if (hwcx->AGPSize){ - if(priv->AGPCmdBufSize){ - hwcx->AGPCmdBufBase = hwcx->AGPBase + priv->AGPCmdBufOffset; - hwcx->AGPCmdBufAddr = hwcx->AGPAddr + priv->AGPCmdBufOffset; - hwcx->AGPCmdBufSize = priv->AGPCmdBufSize; - - hwcx->pAGPCmdBufNext = (DWORD *)&(saPriv->AGPCmdBufNext); - hwcx->AGPCmdModeEnabled = GL_TRUE; - } - } - } -#endif - - hwcx->GlobalFlag = 0L; - - hwcx->swRenderFlag = 0; - hwcx->swForceRender = GL_FALSE; - hwcx->Primitive = 0; - hwcx->useFastPath = GL_FALSE; - - /* TODO */ - /* hwcx->blockWrite = SGRAMbw = IsBlockWrite (); */ - hwcx->blockWrite = GL_FALSE; - - /* this function will over-write AGPCmdModeEnabled */ - /* TODO: pay attention to side-effect */ - sis_init_user_setting (ctx); - - sis_init_opengl_state (ctx); - sis_set_buffer_static (ctx); - set_color_pattern (hwcx, 0, 0, 0, 0); - set_z_stencil_pattern (hwcx, 1.0, 0); - - /* TODO: need to clear cache? */ - hwcx->clearTexCache = GL_TRUE; - - hwcx->AGPParseSet = 0x00000040; - hwcx->dwPrimitiveSet = 0x00060000; - - for (i = 0; i < SIS_MAX_TEXTURES; i++) - { - hwcx->TexStates[i] = 0; - hwcx->PrevTexFormat[i] = 0; - } - -#if SIS_STEREO - hwcx->isFullScreen = GL_FALSE; - hwcx->stereoEnabled = GL_FALSE; -#endif -} - -void -SiSDestroyContext (XMesaContext xmesa) -{ - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - -#if defined(XFree86Server) && defined(XF86DRI) - DRIDestroyContextPriv ((DRIContextPrivPtr)hwcx->pDRIContextPriv); -#endif - - /* - * TODO: if the context ID given by kernel will be recycled, - * then, the current ID will set to -1 if the current ID - * is equal to my id - */ - free (hwcx); -} - -void -sis_update_render_state (__GLSiScontext * hwcx, GLuint stateType) -{ - __GLSiSHardware *prev = &hwcx->prev; - - mWait3DCmdQueue (45); - - if (hwcx->GlobalFlag & GFLAG_ENABLESETTING) - { - if (!hwcx->clearTexCache) - { - MMIO (REG_3D_TEnable, prev->hwCapEnable); - } - else - { - MMIO (REG_3D_TEnable, prev->hwCapEnable | MASK_TextureCacheClear); - MMIO (REG_3D_TEnable, prev->hwCapEnable); - hwcx->clearTexCache = GL_FALSE; - } - } - - if (hwcx->GlobalFlag & GFLAG_ENABLESETTING2) - { - MMIO (REG_3D_TEnable2, prev->hwCapEnable2); - } - - /* Z Setting */ - if (hwcx->GlobalFlag & GFLAG_ZSETTING) - { - MMIO (REG_3D_ZSet, prev->hwZ); - MMIO (REG_3D_ZStWriteMask, prev->hwZMask); - MMIO (REG_3D_ZAddress, prev->hwOffsetZ); - } - - /* Alpha Setting */ - if (hwcx->GlobalFlag & GFLAG_ALPHASETTING) - { - MMIO (REG_3D_AlphaSet, prev->hwAlpha); - } - - if (hwcx->GlobalFlag & GFLAG_DESTSETTING) - { - MMIO (REG_3D_DstSet, prev->hwDstSet); - MMIO (REG_3D_DstAlphaWriteMask, prev->hwDstMask); - MMIO (REG_3D_DstAddress, prev->hwOffsetDest); - } - - /* Line Setting */ -#if 0 - if (hwcx->GlobalFlag & GFLAG_LINESETTING) - { - MMIO(REG_3D_LinePattern, prev->hwLinePattern); - } -#endif - - /* Fog Setting */ - if (hwcx->GlobalFlag & GFLAG_FOGSETTING) - { - MMIO (REG_3D_FogSet, prev->hwFog); - MMIO (REG_3D_FogInverseDistance, prev->hwFogInverse); - MMIO (REG_3D_FogFarDistance, prev->hwFogFar); - MMIO (REG_3D_FogFactorDensity, prev->hwFogDensity); - } - - /* Stencil Setting */ - if (hwcx->GlobalFlag & GFLAG_STENCILSETTING) - { - MMIO (REG_3D_StencilSet, prev->hwStSetting); - MMIO (REG_3D_StencilSet2, prev->hwStSetting2); - } - - /* Miscellaneous Setting */ - if (hwcx->GlobalFlag & GFLAG_DSTBLEND) - { - MMIO (REG_3D_DstBlendMode, prev->hwDstSrcBlend); - } - if (hwcx->GlobalFlag & GFLAG_CLIPPING) - { - MMIO (REG_3D_ClipTopBottom, prev->clipTopBottom); - MMIO (REG_3D_ClipLeftRight, prev->clipLeftRight); - } - - hwcx->GlobalFlag &= ~GFLAG_RENDER_STATES; -} - -void -sis_update_texture_state (__GLSiScontext * hwcx) -{ - __GLSiSHardware *prev = &hwcx->prev; - - mWait3DCmdQueue (55); - - if (hwcx->clearTexCache) - { - MMIO (REG_3D_TEnable, prev->hwCapEnable | MASK_TextureCacheClear); - MMIO (REG_3D_TEnable, prev->hwCapEnable); - hwcx->clearTexCache = GL_FALSE; - } - - /* Texture Setting */ - if (hwcx->GlobalFlag & CFLAG_TEXTURERESET) - { - MMIO (REG_3D_TextureSet, prev->texture[0].hwTextureSet); - } - if (hwcx->GlobalFlag & GFLAG_TEXTUREMIPMAP) - { - MMIO (REG_3D_TextureMip, prev->texture[0].hwTextureMip); - } - - /* - MMIO(REG_3D_TextureTransparencyColorHigh, prev->texture[0].hwTextureClrHigh); - MMIO(REG_3D_TextureTransparencyColorLow, prev->texture[0].hwTextureClrLow); - */ - - if (hwcx->GlobalFlag & GFLAG_TEXBORDERCOLOR) - { - MMIO (REG_3D_TextureBorderColor, prev->texture[0].hwTextureBorderColor); - } - if (hwcx->GlobalFlag & GFLAG_TEXTUREADDRESS) - { - MMIO (REG_3D_TEnable, prev->hwCapEnable | MASK_TextureCacheClear); - MMIO (REG_3D_TEnable, prev->hwCapEnable); - - switch ((prev->texture[0].hwTextureSet & MASK_TextureLevel) >> 8) - { - case 11: - MMIO (REG_3D_TextureAddress11, prev->texture[0].texOffset11); - case 10: - MMIO (REG_3D_TextureAddress10, prev->texture[0].texOffset10); - MMIO (REG_3D_TexturePitch10, prev->texture[0].texPitch10); - case 9: - MMIO (REG_3D_TextureAddress9, prev->texture[0].texOffset9); - case 8: - MMIO (REG_3D_TextureAddress8, prev->texture[0].texOffset8); - MMIO (REG_3D_TexturePitch8, prev->texture[0].texPitch89); - case 7: - MMIO (REG_3D_TextureAddress7, prev->texture[0].texOffset7); - case 6: - MMIO (REG_3D_TextureAddress6, prev->texture[0].texOffset6); - MMIO (REG_3D_TexturePitch6, prev->texture[0].texPitch67); - case 5: - MMIO (REG_3D_TextureAddress5, prev->texture[0].texOffset5); - case 4: - MMIO (REG_3D_TextureAddress4, prev->texture[0].texOffset4); - MMIO (REG_3D_TexturePitch4, prev->texture[0].texPitch45); - case 3: - MMIO (REG_3D_TextureAddress3, prev->texture[0].texOffset3); - case 2: - MMIO (REG_3D_TextureAddress2, prev->texture[0].texOffset2); - MMIO (REG_3D_TexturePitch2, prev->texture[0].texPitch23); - case 1: - MMIO (REG_3D_TextureAddress1, prev->texture[0].texOffset1); - case 0: - MMIO (REG_3D_TextureAddress0, prev->texture[0].texOffset0); - MMIO (REG_3D_TexturePitch0, prev->texture[0].texPitch01); - } - } - if (hwcx->GlobalFlag & CFLAG_TEXTURERESET_1) - { - MMIO (REG_3D_Texture1Set, prev->texture[1].hwTextureSet); - } - if (hwcx->GlobalFlag & GFLAG_TEXTUREMIPMAP_1) - { - MMIO (REG_3D_Texture1Mip, prev->texture[1].hwTextureMip); - } - - if (hwcx->GlobalFlag & GFLAG_TEXBORDERCOLOR_1) - { - MMIO (REG_3D_Texture1BorderColor, - prev->texture[1].hwTextureBorderColor); - } - if (hwcx->GlobalFlag & GFLAG_TEXTUREADDRESS_1) - { - switch ((prev->texture[1].hwTextureSet & MASK_TextureLevel) >> 8) - { - case 11: - MMIO (REG_3D_Texture1Address11, prev->texture[1].texOffset11); - case 10: - MMIO (REG_3D_Texture1Address10, prev->texture[1].texOffset10); - MMIO (REG_3D_Texture1Pitch10, prev->texture[1].texPitch10); - case 9: - MMIO (REG_3D_Texture1Address9, prev->texture[1].texOffset9); - case 8: - MMIO (REG_3D_Texture1Address8, prev->texture[1].texOffset8); - MMIO (REG_3D_Texture1Pitch8, prev->texture[1].texPitch89); - case 7: - MMIO (REG_3D_Texture1Address7, prev->texture[1].texOffset7); - case 6: - MMIO (REG_3D_Texture1Address6, prev->texture[1].texOffset6); - MMIO (REG_3D_Texture1Pitch6, prev->texture[1].texPitch67); - case 5: - MMIO (REG_3D_Texture1Address5, prev->texture[1].texOffset5); - case 4: - MMIO (REG_3D_Texture1Address4, prev->texture[1].texOffset4); - MMIO (REG_3D_Texture1Pitch4, prev->texture[1].texPitch45); - case 3: - MMIO (REG_3D_Texture1Address3, prev->texture[1].texOffset3); - case 2: - MMIO (REG_3D_Texture1Address2, prev->texture[1].texOffset2); - MMIO (REG_3D_Texture1Pitch2, prev->texture[1].texPitch23); - case 1: - MMIO (REG_3D_Texture1Address1, prev->texture[1].texOffset1); - case 0: - MMIO (REG_3D_Texture1Address0, prev->texture[1].texOffset0); - MMIO (REG_3D_Texture1Pitch0, prev->texture[1].texPitch01); - } - } - - /* texture environment */ - if (hwcx->GlobalFlag & GFLAG_TEXTUREENV) - { - MMIO (REG_3D_TextureBlendFactor, prev->hwTexEnvColor); - MMIO (REG_3D_TextureColorBlendSet0, prev->hwTexBlendClr0); - MMIO (REG_3D_TextureAlphaBlendSet0, prev->hwTexBlendAlpha0); - } - if (hwcx->GlobalFlag & GFLAG_TEXTUREENV_1) - { - MMIO (REG_3D_TextureBlendFactor, prev->hwTexEnvColor); - MMIO (REG_3D_TextureColorBlendSet1, prev->hwTexBlendClr1); - MMIO (REG_3D_TextureAlphaBlendSet1, prev->hwTexBlendAlpha1); - } - - hwcx->GlobalFlag &= ~GFLAG_TEXTURE_STATES; -} - -void -sis_validate_all_state (__GLSiScontext * hwcx) -{ - __GLSiSHardware *prev = &hwcx->prev; - - mEndPrimitive (); - mWait3DCmdQueue (40); - - /* Enable Setting */ - MMIO (REG_3D_TEnable, prev->hwCapEnable); - MMIO (REG_3D_TEnable2, prev->hwCapEnable2); - - /* Z Setting */ - /* if (prev->hwCapEnable & MASK_ZTestEnable) { */ - MMIO (REG_3D_ZSet, prev->hwZ); - MMIO (REG_3D_ZStWriteMask, prev->hwZMask); - MMIO (REG_3D_ZAddress, prev->hwOffsetZ); - /* } */ - - /* Alpha Setting */ - if (prev->hwCapEnable & MASK_AlphaTestEnable) - { - MMIO (REG_3D_AlphaSet, prev->hwAlpha); - } - - /* Destination Setting */ - MMIO (REG_3D_DstSet, prev->hwDstSet); - MMIO (REG_3D_DstAlphaWriteMask, prev->hwDstMask); - MMIO (REG_3D_DstAddress, prev->hwOffsetDest); - - /* Line Setting */ -#if 0 - if (prev->hwCapEnable2 & MASK_LinePatternEnable) { - MMIO(REG_3D_LinePattern, prev->hwLinePattern); - } -#endif - - /* Fog Setting */ - if (prev->hwCapEnable & MASK_FogEnable) - { - MMIO (REG_3D_FogSet, prev->hwFog); - MMIO (REG_3D_FogInverseDistance, prev->hwFogInverse); - MMIO (REG_3D_FogFarDistance, prev->hwFogFar); - MMIO (REG_3D_FogFactorDensity, prev->hwFogDensity); - } - - /* Stencil Setting */ - if (prev->hwCapEnable & MASK_StencilTestEnable) - { - MMIO (REG_3D_StencilSet, prev->hwStSetting); - MMIO (REG_3D_StencilSet2, prev->hwStSetting2); - } - - /* Miscellaneous Setting */ - if (prev->hwCapEnable & MASK_BlendEnable) - { - MMIO (REG_3D_DstBlendMode, prev->hwDstSrcBlend); - } - - MMIO (REG_3D_ClipTopBottom, prev->clipTopBottom); - MMIO (REG_3D_ClipLeftRight, prev->clipLeftRight); - - /* TODO */ - /* Texture Setting */ - /* if (prev->hwCapEnable & MASK_TextureEnable) */ - { - MMIO (REG_3D_TEnable, prev->hwCapEnable | MASK_TextureCacheClear); - - MMIO (REG_3D_TEnable, prev->hwCapEnable); - - MMIO (REG_3D_TextureSet, prev->texture[0].hwTextureSet); - MMIO (REG_3D_TextureMip, prev->texture[0].hwTextureMip); - /* - MMIO(REG_3D_TextureTransparencyColorHigh, prev->texture[0].hwTextureClrHigh); - MMIO(REG_3D_TextureTransparencyColorLow, prev->texture[0].hwTextureClrLow); - */ - MMIO (REG_3D_TextureBorderColor, prev->texture[0].hwTextureBorderColor); - - switch ((prev->texture[0].hwTextureSet & MASK_TextureLevel) >> 8) - { - case 11: - MMIO (REG_3D_TextureAddress11, prev->texture[0].texOffset11); - case 10: - MMIO (REG_3D_TextureAddress10, prev->texture[0].texOffset10); - MMIO (REG_3D_TexturePitch10, prev->texture[0].texPitch10); - case 9: - MMIO (REG_3D_TextureAddress9, prev->texture[0].texOffset9); - case 8: - MMIO (REG_3D_TextureAddress8, prev->texture[0].texOffset8); - MMIO (REG_3D_TexturePitch8, prev->texture[0].texPitch89); - case 7: - MMIO (REG_3D_TextureAddress7, prev->texture[0].texOffset7); - case 6: - MMIO (REG_3D_TextureAddress6, prev->texture[0].texOffset6); - MMIO (REG_3D_TexturePitch6, prev->texture[0].texPitch67); - case 5: - MMIO (REG_3D_TextureAddress5, prev->texture[0].texOffset5); - case 4: - MMIO (REG_3D_TextureAddress4, prev->texture[0].texOffset4); - MMIO (REG_3D_TexturePitch4, prev->texture[0].texPitch45); - case 3: - MMIO (REG_3D_TextureAddress3, prev->texture[0].texOffset3); - case 2: - MMIO (REG_3D_TextureAddress2, prev->texture[0].texOffset2); - MMIO (REG_3D_TexturePitch2, prev->texture[0].texPitch23); - case 1: - MMIO (REG_3D_TextureAddress1, prev->texture[0].texOffset1); - case 0: - MMIO (REG_3D_TextureAddress0, prev->texture[0].texOffset0); - MMIO (REG_3D_TexturePitch0, prev->texture[0].texPitch01); - } - - /* TODO */ - /* if (hwcx->ctx->Texture.Unit[1].ReallyEnabled) */ - { - MMIO (REG_3D_Texture1Set, prev->texture[1].hwTextureSet); - MMIO (REG_3D_Texture1Mip, prev->texture[1].hwTextureMip); - /* - MMIO(REG_3D_Texture1TransparencyColorHigh, prev->texture[1].hwTextureClrHigh); - MMIO(REG_3D_Texture1TransparencyColorLow, prev->texture[1].hwTextureClrLow); - */ - MMIO (REG_3D_Texture1BorderColor, prev->texture[1].hwTextureBorderColor); - - switch ((prev->texture[1].hwTextureSet & MASK_TextureLevel) >> 8) - { - case 11: - MMIO (REG_3D_Texture1Address11, prev->texture[1].texOffset11); - case 10: - MMIO (REG_3D_Texture1Address10, prev->texture[1].texOffset10); - MMIO (REG_3D_Texture1Pitch10, prev->texture[1].texPitch10); - case 9: - MMIO (REG_3D_Texture1Address9, prev->texture[1].texOffset9); - case 8: - MMIO (REG_3D_Texture1Address8, prev->texture[1].texOffset8); - MMIO (REG_3D_Texture1Pitch8, prev->texture[1].texPitch89); - case 7: - MMIO (REG_3D_Texture1Address7, prev->texture[1].texOffset7); - case 6: - MMIO (REG_3D_Texture1Address6, prev->texture[1].texOffset6); - MMIO (REG_3D_Texture1Pitch6, prev->texture[1].texPitch67); - case 5: - MMIO (REG_3D_Texture1Address5, prev->texture[1].texOffset5); - case 4: - MMIO (REG_3D_Texture1Address4, prev->texture[1].texOffset4); - MMIO (REG_3D_Texture1Pitch4, prev->texture[1].texPitch45); - case 3: - MMIO (REG_3D_Texture1Address3, prev->texture[1].texOffset3); - case 2: - MMIO (REG_3D_Texture1Address2, prev->texture[1].texOffset2); - MMIO (REG_3D_Texture1Pitch2, prev->texture[1].texPitch23); - case 1: - MMIO (REG_3D_Texture1Address1, prev->texture[1].texOffset1); - case 0: - MMIO (REG_3D_Texture1Address0, prev->texture[1].texOffset0); - MMIO (REG_3D_Texture1Pitch0, prev->texture[1].texPitch01); - } - } - - /* texture environment */ - MMIO (REG_3D_TextureBlendFactor, prev->hwTexEnvColor); - MMIO (REG_3D_TextureColorBlendSet0, prev->hwTexBlendClr0); - MMIO (REG_3D_TextureColorBlendSet1, prev->hwTexBlendClr1); - MMIO (REG_3D_TextureAlphaBlendSet0, prev->hwTexBlendAlpha0); - MMIO (REG_3D_TextureAlphaBlendSet1, prev->hwTexBlendAlpha1); - } - - hwcx->GlobalFlag = 0; -} - -void -sis_fatal_error (void) -{ - /* free video memory, or the framebuffer device will do it automatically */ - -#ifdef XFree86Server - FatalError ("Fatal errors in libGLcore.a\n"); -#else - fprintf(stderr, "Fatal errors in sis_dri.so\n"); - exit (-1); -#endif -} Index: xc/lib/GL/mesa/src/drv/sis/sis_ctx.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_ctx.h:1.5 xc/lib/GL/mesa/src/drv/sis/sis_ctx.h:removed --- xc/lib/GL/mesa/src/drv/sis/sis_ctx.h:1.5 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_ctx.h Sat Feb 28 21:41:18 2004 @@ -1,292 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_ctx.h,v 1.5 2000/09/26 15:56:48 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#ifndef _sis_ctx_h_ -#define _sis_ctx_h_ - -#include "sis_common.h" - -/* for GLboolean */ -#include - -#define PCI_CHIP_SIS300 0x0300 -#define PCI_CHIP_SIS630 0x6300 -#define PCI_CHIP_SIS540 0x5300 - -#define SIS_STATE_TRIANGLE 1 -#define SIS_STATE_LINE 2 -#define SIS_STATE_POINT 3 - -/* for swRenderFlag */ -#define SIS_SW_TRIANGLE 0x1 -#define SIS_SW_LINE 0x2 -#define SIS_SW_POINT 0x4 -#define SIS_SW_TEXTURE_DIM 0x8 -#define SIS_SW_TEXTURE_OBJ 0x10 -#define SIS_SW_TEXTURE_OBJ1 0x20 -#define SIS_SW_TEXTURE_ENV 0x100 -#define SIS_SW_TEXTURE_ENV1 0x200 - -#define SIS_SW_TEXTURE (SIS_SW_TEXTURE_DIM | \ - SIS_SW_TEXTURE_OBJ | SIS_SW_TEXTURE_OBJ1 | \ - SIS_SW_TEXTURE_ENV | SIS_SW_TEXTURE_ENV1) -#define SIS_SW_ALL (SIS_SW_POINT | SIS_SW_LINE | SIS_SW_TRIANGLE | \ - SIS_SW_TEXTURE) - -/* - ** Device dependent context state - */ -typedef struct __GLSiSTextureRec -{ - DWORD hwTextureSet; - DWORD hwTextureMip; - DWORD hwTextureClrHigh; - DWORD hwTextureClrLow; - DWORD hwTextureBorderColor; - - DWORD texOffset0; - DWORD texOffset1; - DWORD texOffset2; - DWORD texOffset3; - DWORD texOffset4; - DWORD texOffset5; - DWORD texOffset6; - DWORD texOffset7; - DWORD texOffset8; - DWORD texOffset9; - DWORD texOffset10; - DWORD texOffset11; - - DWORD texPitch01; - DWORD texPitch23; - DWORD texPitch45; - DWORD texPitch67; - DWORD texPitch89; - DWORD texPitch10; -} -__GLSiSTexture; - -typedef struct __GLSiSHardwareRec -{ - DWORD hwCapEnable, hwCapEnable2; /* Enable Setting */ - - DWORD hwOffsetZ, hwZ; /* Z Setting */ - - DWORD hwZBias, hwZMask; /* Z Setting */ - - DWORD hwAlpha; /* Alpha Setting */ - - DWORD hwDstSet, hwDstMask; /* Destination Setting */ - - DWORD hwOffsetDest; /* Destination Setting */ - - DWORD hwLinePattern; /* Line Setting */ - - DWORD hwFog; /* Fog Setting */ - - DWORD hwFogFar, hwFogInverse; /* Fog Distance setting */ - - DWORD hwFogDensity; /* Fog factor & density */ - - DWORD hwStSetting, hwStSetting2; /* Stencil Setting */ - - DWORD hwStOffset; /* Stencil Setting */ - - DWORD hwDstSrcBlend; /* Blending mode Setting */ - - DWORD clipTopBottom; /* Clip for Top & Bottom */ - - DWORD clipLeftRight; /* Clip for Left & Right */ - - struct __GLSiSTextureRec texture[2]; - - DWORD hwTexEnvColor; /* Texture Blending Setting */ - - DWORD hwTexBlendClr0; - DWORD hwTexBlendClr1; - DWORD hwTexBlendAlpha0; - DWORD hwTexBlendAlpha1; - -} -__GLSiSHardware; - -/* Device dependent context state */ - -typedef struct __GLSiScontextRec -{ - /* This must be first in this structure */ - GLcontext *gc; - - unsigned int virtualX, virtualY; - unsigned int bytesPerPixel; - unsigned char *IOBase; - unsigned char *FbBase; - unsigned int displayWidth; - unsigned int pitch; - - /* For Software Renderer */ - GLubyte *swRenderBase; - GLuint swRenderPitch; - GLubyte *swZBase; - GLuint swZPitch; - GLuint pixelValue; - GLboolean swForceRender; - - /* HW RGBA layout */ - unsigned int redMask, greenMask, blueMask, alphaMask; - unsigned int colorFormat; - - /* Z format */ - unsigned int zFormat; - - /* Clear patterns, 4 bytes */ - unsigned int clearColorPattern; - unsigned int clearZStencilPattern; - - /* Render Function */ - points_func PointsFunc; - line_func LineFunc; - triangle_func TriangleFunc; - quad_func QuadFunc; - rect_func RectFunc; - - /* DRM fd */ - int drmSubFD; - - /* AGP Memory */ - unsigned int AGPSize; - unsigned char *AGPBase; - unsigned int AGPAddr; - - /* AGP Command Buffer */ - /* TODO: use Global variables */ - unsigned char *AGPCmdBufBase; - DWORD AGPCmdBufAddr; - unsigned int AGPCmdBufSize; - DWORD *pAGPCmdBufNext; - GLboolean AGPCmdModeEnabled; - GLboolean UseAGPCmdMode; - - /* register 0x89F4 */ - DWORD AGPParseSet; - - /* register 0x89F8 */ - DWORD dwPrimitiveSet; - - __GLSiSHardware prev, current; - - DWORD chipVer; - int Chipset; - - DWORD drawableID; - - /* SGRAM block write */ - GLboolean blockWrite; - - GLuint swRenderFlag; - GLenum Primitive; - - /* Fast Path */ - GLboolean useFastPath; - - DWORD GlobalFlag; - - DWORD rawLockMask; - DWORD lockMask; - - void (*SwapBuffers)(XMesaBuffer b); - - /* Stereo */ - GLboolean isFullScreen; - GLboolean useStereo; - GLboolean stereoEnabled; - int stereo_drawIndex; - int stereo_drawSide; - GLboolean irqEnabled; - - int serialNumber; - -#if defined(XFree86Server) && defined(XF86DRI) - void *pDRIContextPriv; -#endif - - GLboolean clearTexCache; - - GLuint TexStates[SIS_MAX_TEXTURES]; - GLuint PrevTexFormat[SIS_MAX_TEXTURES]; - - int *CurrentHwcxPtr; - int *CurrentQueueLenPtr; - unsigned int *FrameCountPtr; -} -__GLSiScontext; - -/* Macros */ -#define GET_IOBase(x) ((x)->IOBase) -#define GET_FbBase(x) ((x)->FbBase) -#define GET_AGPBase(x) ((x)->AGPBase) -#define GET_DEPTH(x) ((x)->bytesPerPixel) -#define GET_WIDTH(x) ((x)->displayWidth) -#define GET_PITCH(x) ((x)->pitch) -#define GET_FbPos(hwcx,x,y) (GET_FbBase(hwcx)+(x)*GET_DEPTH(hwcx)\ - +(y)*GET_PITCH(hwcx)) - -#define GET_ColorFormat(x) ((x)->colorFormat) - -#define GET_RMASK(x) ((x)->redMask) -#define GET_GMASK(x) ((x)->greenMask) -#define GET_BMASK(x) ((x)->blueMask) -#define GET_AMASK(x) ((x)->alphaMask) - -/* update to hwcx->prev */ -extern void sis_update_drawable_state (GLcontext * ctx); - -/* update to hw */ -extern void sis_update_texture_state (__GLSiScontext * hwcx); -extern void sis_update_render_state (__GLSiScontext * hwcx, GLuint stateType); -extern void sis_validate_all_state (__GLSiScontext * hwcx); - -extern void sis_set_scissor (GLcontext * gc); - -/* AGP */ -void sis_StartAGP (GLcontext * ctx); -void sis_FlushAGP (GLcontext * ctx); -extern float *AGP_CurrentPtr; - -/* DRM FD */ -extern int gDRMSubFD; - -void sis_fatal_error (void); - -#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_dd.c diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_dd.c:1.3 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_dd.c Mon Dec 8 19:15:21 2003 @@ -0,0 +1,176 @@ +/************************************************************************** + +Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_dd.c,v 1.3 2003/12/09 00:15:21 alanh Exp $ */ + +/* + * Authors: + * Sung-Ching Lin + * Eric Anholt + * + */ + +#include "sis_context.h" +#include "sis_dd.h" +#include "sis_lock.h" +#include "sis_alloc.h" +#include "sis_state.h" + +#include "swrast/swrast.h" + +#include "utils.h" + +#define DRIVER_DATE "20030810" + +/* Return the width and height of the given buffer. + */ +static void +sisDDGetBufferSize( GLframebuffer *buffer, + GLuint *width, GLuint *height ) +{ + GET_CURRENT_CONTEXT(ctx); + sisContextPtr smesa = SIS_CONTEXT(ctx); + + LOCK_HARDWARE(); + *width = smesa->driDrawable->w; + *height = smesa->driDrawable->h; + UNLOCK_HARDWARE(); +} + +/* Return various strings for glGetString(). + */ +static const GLubyte * +sisDDGetString( GLcontext *ctx, GLenum name ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + static char buffer[128]; + unsigned offset; + GLuint agp_mode = (smesa->AGPSize > 0); + + switch ( name ) + { + case GL_VENDOR: + return (GLubyte *)"Eric Anholt"; + + case GL_RENDERER: + offset = driGetRendererString( buffer, "SiS", DRIVER_DATE, agp_mode ); + + return (GLubyte *)buffer; + + default: + return NULL; + } +} + +/* Send all commands to the hardware. No-op, due to mmio. + */ +static void +sisDDFlush( GLcontext *ctx ) +{ + /* Do nothing */ +} + +/* Make sure all commands have been sent to the hardware and have + * completed processing. + */ +static void +sisDDFinish( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + sisDDFlush( ctx ); + WaitEngIdle( smesa ); +} + +void +sisUpdateBufferSize( sisContextPtr smesa ) +{ + __GLSiSHardware *current = &smesa->current; + __GLSiSHardware *prev = &smesa->prev; + GLuint z_depth; + + /* XXX Should get the base offset of the frontbuffer from the X Server */ + smesa->frontOffset = smesa->driDrawable->x * smesa->bytesPerPixel + + smesa->driDrawable->y * smesa->frontPitch; + + if ( smesa->width == smesa->driDrawable->w && + smesa->height == smesa->driDrawable->h ) + { + return; + } + + smesa->width = smesa->driDrawable->w; + smesa->height = smesa->driDrawable->h; + smesa->bottom = smesa->height - 1; + + if ( smesa->backbuffer ) + sisFreeBackbuffer( smesa ); + if ( smesa->depthbuffer ) + sisFreeZStencilBuffer( smesa ); + + if ( smesa->glCtx->Visual.depthBits > 0 ) + sisAllocZStencilBuffer( smesa ); + if ( smesa->glCtx->Visual.doubleBufferMode ) + sisAllocBackbuffer( smesa ); + + switch (smesa->zFormat) + { + case SiS_ZFORMAT_Z16: + z_depth = 2; + break; + case SiS_ZFORMAT_Z32: + case SiS_ZFORMAT_S8Z24: + z_depth = 4; + break; + default: + assert( 0 ); + } + + current->hwZ &= ~MASK_ZBufferPitch; + current->hwZ |= smesa->width * z_depth >> 2; + current->hwOffsetZ = smesa->depthOffset >> 2; + + if ((current->hwOffsetZ != prev->hwOffsetZ) || (current->hwZ != prev->hwZ)) { + prev->hwOffsetZ = current->hwOffsetZ; + prev->hwZ = current->hwZ; + smesa->GlobalFlag |= GFLAG_ZSETTING; + } + + sisUpdateClipping( smesa->glCtx ); +} + +/* Initialize the driver's misc functions. + */ +void +sisDDInitDriverFuncs( GLcontext *ctx ) +{ + ctx->Driver.GetBufferSize = sisDDGetBufferSize; + ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.GetString = sisDDGetString; + ctx->Driver.Finish = sisDDFinish; + ctx->Driver.Flush = sisDDFlush; + ctx->Driver.Error = NULL; +} Index: xc/lib/GL/mesa/src/drv/sis/sis_dd.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_dd.h:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_dd.h Mon Dec 8 19:15:22 2003 @@ -0,0 +1,42 @@ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_dd.h,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ + +/* + * Authors: + * Eric Anholt + */ + +#ifndef __SIS_DD_H__ +#define __SIS_DD_H__ + +#ifdef GLX_DIRECT_RENDERING + +extern void sisUpdateBufferSize( sisContextPtr smesa ); + +extern void sisDDInitDriverFuncs( GLcontext *ctx ); + +#endif +#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_debug.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_debug.c:1.5 xc/lib/GL/mesa/src/drv/sis/sis_debug.c:1.7 --- xc/lib/GL/mesa/src/drv/sis/sis_debug.c:1.5 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_debug.c Mon Dec 8 19:15:22 2003 @@ -18,13 +18,13 @@ 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +IN NO EVENT SHALL SILICON INTEGRATED SYSTEMS CORP 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. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_debug.c,v 1.5 2000/09/26 15:56:48 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_debug.c,v 1.7 2003/12/09 00:15:22 alanh Exp $ */ /* * Authors: @@ -40,8 +40,7 @@ #include #include -#include "sis_ctx.h" -#include "sis_mesa.h" +#include "sis_context.h" /* for SiS 300/630/540 */ #define MMIOLength (0x8FFF-0x8800+1) @@ -53,7 +52,7 @@ char *prevLockFile = NULL; int prevLockLine = 0; -DWORD _empty[0x10000]; +GLint _empty[0x10000]; void dump_agp (void *addr, int dword_count) @@ -81,14 +80,14 @@ d2f_once (GLcontext * ctx) { XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; + sisContextPtr smesa = SIS_CONTEXT(ctx); static int serialNumber = -1; - if (serialNumber == hwcx->serialNumber) + if (serialNumber == smesa->serialNumber) return; else - serialNumber = hwcx->serialNumber; + serialNumber = smesa->serialNumber; d2f(); } Index: xc/lib/GL/mesa/src/drv/sis/sis_debug.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_debug.h:1.3 xc/lib/GL/mesa/src/drv/sis/sis_debug.h:1.4 --- xc/lib/GL/mesa/src/drv/sis/sis_debug.h:1.3 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_debug.h Mon Dec 8 19:15:22 2003 @@ -18,13 +18,13 @@ 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +IN NO EVENT SILICON INTEGRATED SYSTEMS CORP 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. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_debug.h,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_debug.h,v 1.4 2003/12/09 00:15:22 alanh Exp $ */ /* * Authors: Index: xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c:1.3 xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c:removed --- xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c:1.3 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c Sat Feb 28 21:41:18 2004 @@ -1,227 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_fastpath.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -/* - * FOR - * 1. triangle/strip with 2-texture with no other capability - * (depth-offset, edge-flag...) - * 2. smooth shading - * 3. render to backbuffer - * 4. use AGP command mode - */ - -#ifdef PC_HEADER -#include "all.h" -#else -#include "glheader.h" -#include "clip.h" -#include "context.h" -#include "light.h" -#include "lines.h" -#include "macros.h" -#include "matrix.h" -#include "pb.h" -#include "points.h" -#include "pipeline.h" -#include "stages.h" -#include "types.h" -#include "vb.h" -#include "vbcull.h" -#include "vbrender.h" -#include "vbindirect.h" -#include "xform.h" -#endif - -#include "sis_ctx.h" -#include "sis_mesa.h" - -#define WRITE_SMOOTH_W_T2(v) \ -do{ \ - DWORD dcSARGB; \ - \ - AGP_CurrentPtr[0] = VB->Win.data[v][0] - 0.5; \ - AGP_CurrentPtr[1] = Y_FLIP (VB->Win.data[v][1]) + 0.5; \ - AGP_CurrentPtr[2] = VB->Win.data[v][2] / 65535.0; \ - AGP_CurrentPtr[3] = VB->Win.data[v][3]; \ - RGBA8ConvertToBGRA8 (&dcSARGB, VB->ColorPtr->data[v]); \ - ((DWORD *)AGP_CurrentPtr)[4] = dcSARGB; \ - AGP_CurrentPtr[5] = VB->TexCoordPtr[0]->data[v][0]; \ - AGP_CurrentPtr[6] = VB->TexCoordPtr[0]->data[v][1]; \ - AGP_CurrentPtr[7] = VB->TexCoordPtr[1]->data[v][0]; \ - AGP_CurrentPtr[8] = VB->TexCoordPtr[1]->data[v][1]; \ - AGP_CurrentPtr+=9; \ -}while(0) - - /* TODO or use for loop and let compiler unroll it */ -#define COPY_SMOOTH_W_T2(i) \ -do{ \ - AGP_CurrentPtr[0] = (AGP_CurrentPtr+(i)*9)[0]; \ - AGP_CurrentPtr[1] = (AGP_CurrentPtr+(i)*9)[1]; \ - AGP_CurrentPtr[2] = (AGP_CurrentPtr+(i)*9)[2]; \ - AGP_CurrentPtr[3] = (AGP_CurrentPtr+(i)*9)[3]; \ - AGP_CurrentPtr[4] = (AGP_CurrentPtr+(i)*9)[4]; \ - AGP_CurrentPtr[5] = (AGP_CurrentPtr+(i)*9)[5]; \ - AGP_CurrentPtr[6] = (AGP_CurrentPtr+(i)*9)[6]; \ - AGP_CurrentPtr[7] = (AGP_CurrentPtr+(i)*9)[7]; \ - AGP_CurrentPtr[8] = (AGP_CurrentPtr+(i)*9)[8]; \ - AGP_CurrentPtr+=9; \ -}while(0) - -#if defined(SIS_USE_FASTPATH) -static void sis_render_vb( struct vertex_buffer *VB ) -{ - GLcontext *ctx = VB->ctx; - GLuint i, next, prim; - GLuint parity = VB->Parity; - render_func *tab; - GLuint count = VB->Count; - - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - if(!hwcx->useFastPath){ - gl_render_vb(VB); - return; - } - - if (VB->Indirect) { - return; -#ifndef SIS_USE_HW_CULL - } else if (VB->CullMode & CULL_MASK_ACTIVE) { - tab = ctx->Driver.RenderVBCulledTab; - - /* TODO: check */ - if (!VB->CullDone) - gl_fast_copy_vb( VB ); -#endif - } else if (VB->CullMode & CLIP_MASK_ACTIVE) { - tab = ctx->Driver.RenderVBClippedTab; - } else { - tab = ctx->Driver.RenderVBRawTab; - } - - /* TODO: know what does it do */ - gl_import_client_data( VB, ctx->RenderFlags, - (VB->ClipOrMask - ? VEC_WRITABLE|VEC_GOOD_STRIDE - : VEC_GOOD_STRIDE)); - - ctx->Driver.RenderStart( ctx ); - - if(tab != ctx->Driver.RenderVBRawTab){ - for ( i= VB->CopyStart ; i < count ; parity = 0, i = next ) - { - prim = VB->Primitive[i]; - next = VB->NextPrimitive[i]; - - tab[prim]( VB, i, next, parity ); - } - } - else{ - for ( i= VB->CopyStart ; i < count ; parity = 0, i = next ) - { - prim = VB->Primitive[i]; - next = VB->NextPrimitive[i]; - - if(prim == GL_TRIANGLE_STRIP) - { - int j; - - /* assume size >= 3 */ - /* assert(next-i+1 >= 3); */ - - if(i+2 >=next) - break; - - if(parity){ - WRITE_SMOOTH_W_T2(i+1); - WRITE_SMOOTH_W_T2(i); - WRITE_SMOOTH_W_T2(i+2); - } - else{ - WRITE_SMOOTH_W_T2(i); - WRITE_SMOOTH_W_T2(i+1); - WRITE_SMOOTH_W_T2(i+2); - } - - for(j=i+3; jDriver.RenderFinish( ctx ); -} -#endif - -GLuint sis_RegisterPipelineStages (struct gl_pipeline_stage *out, - const struct gl_pipeline_stage *in, - GLuint nr) -{ - GLuint i, o; - - for (i = o = 0 ; i < nr ; i++) { - switch (in[i].ops) { - case PIPE_OP_RENDER: - out[o] = in[i]; -#if defined(SIS_USE_FASTPATH) - if (in[i].run == gl_render_vb) { - out[o].run = sis_render_vb; - } -#endif - o++; - break; - default: - out[o++] = in[i]; - break; - } - } - - return o; -} Index: xc/lib/GL/mesa/src/drv/sis/sis_fog.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_fog.c:1.3 xc/lib/GL/mesa/src/drv/sis/sis_fog.c:1.5 --- xc/lib/GL/mesa/src/drv/sis/sis_fog.c:1.3 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_fog.c Mon Dec 8 19:15:22 2003 @@ -1,175 +1,190 @@ /************************************************************************** Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt All Rights Reserved. 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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_fog.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_fog.c,v 1.5 2003/12/09 00:15:22 alanh Exp $ */ /* * Authors: - * Sung-Ching Lin - * + * Sung-Ching Lin + * Eric Anholt */ -#include "sis_ctx.h" -#include "sis_mesa.h" +#include "sis_context.h" +#include "sis_state.h" +#include "swrast/swrast.h" -static DWORD convertFtToFogFt (DWORD dwInValue); +#include "mmath.h" + +static GLint convertFtToFogFt( GLfloat dwInValue ); void -sis_Fogfv (GLcontext * ctx, GLenum pname, const GLfloat * params) +sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - __GLSiSHardware *current = &hwcx->current; - - GLubyte dwFogColor[4]; - DWORD dwArg; - float fArg; - - switch (pname) - { - case GL_FOG_MODE: - current->hwFog &= ~(FOGMODE_LINEAR | FOGMODE_EXP | FOGMODE_EXP2); + sisContextPtr smesa = SIS_CONTEXT(ctx); + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + float fArg; + GLint fogColor; + + switch (pname) + { + case GL_FOG_MODE: + current->hwFog &= ~MASK_FogMode; switch (ctx->Fog.Mode) - { - case GL_LINEAR: - current->hwFog |= FOGMODE_LINEAR; - break; - case GL_EXP: - current->hwFog |= FOGMODE_EXP; - break; - case GL_EXP2: - current->hwFog |= FOGMODE_EXP2; - break; - } + { + case GL_LINEAR: + current->hwFog |= FOGMODE_LINEAR; + break; + case GL_EXP: + current->hwFog |= FOGMODE_EXP; + break; + case GL_EXP2: + current->hwFog |= FOGMODE_EXP2; + break; + } + if (current->hwFog != prev->hwFog) { + prev->hwFog = current->hwFog; + smesa->GlobalFlag |= GFLAG_FOGSETTING; + } break; - case GL_FOG_DENSITY: - dwArg = *(DWORD *) (&(ctx->Fog.Density)); - current->hwFogDensity = 0; - current->hwFogDensity |= convertFtToFogFt (dwArg); + case GL_FOG_DENSITY: + current->hwFogDensity = convertFtToFogFt( ctx->Fog.Density ); + if (current->hwFogDensity != prev->hwFogDensity) { + prev->hwFogDensity = current->hwFogDensity; + smesa->GlobalFlag |= GFLAG_FOGSETTING; + } break; - case GL_FOG_START: - case GL_FOG_END: + case GL_FOG_START: + case GL_FOG_END: fArg = 1.0 / (ctx->Fog.End - ctx->Fog.Start); - current->hwFogInverse = doFPtoFixedNoRound (*(DWORD *) (&fArg), 10); + current->hwFogInverse = doFPtoFixedNoRound( fArg, 10 ); if (pname == GL_FOG_END) - { - dwArg = *(DWORD *) (&(ctx->Fog.End)); - if (hwcx->Chipset == PCI_CHIP_SIS300) - { - current->hwFogFar = doFPtoFixedNoRound (dwArg, 10); - } - else - { - current->hwFogFar = doFPtoFixedNoRound (dwArg, 6); - } - } + { + if (smesa->Chipset == PCI_CHIP_SIS300) + current->hwFogFar = doFPtoFixedNoRound( ctx->Fog.End, 10 ); + else + current->hwFogFar = doFPtoFixedNoRound( ctx->Fog.End, 6 ); + } + if (current->hwFogFar != prev->hwFogFar || + current->hwFogInverse != prev->hwFogInverse) + { + prev->hwFogFar = current->hwFogFar; + prev->hwFogInverse = current->hwFogInverse; + smesa->GlobalFlag |= GFLAG_FOGSETTING; + } break; - case GL_FOG_INDEX: + case GL_FOG_INDEX: /* TODO */ break; - case GL_FOG_COLOR: - *((DWORD *) dwFogColor) = 0; - dwFogColor[2] = (GLubyte)((ctx->Fog.Color[0]) * 255.0); - dwFogColor[1] = (GLubyte)((ctx->Fog.Color[1]) * 255.0); - dwFogColor[0] = (GLubyte)((ctx->Fog.Color[2]) * 255.0); + case GL_FOG_COLOR: + fogColor = FLOAT_TO_UBYTE( ctx->Fog.Color[0] ) << 16; + fogColor |= FLOAT_TO_UBYTE( ctx->Fog.Color[1] ) << 8; + fogColor |= FLOAT_TO_UBYTE( ctx->Fog.Color[2] ); current->hwFog &= 0xff000000; - current->hwFog |= *((DWORD *) dwFogColor); + current->hwFog |= fogColor; + if (current->hwFog != prev->hwFog) { + prev->hwFog = current->hwFog; + smesa->GlobalFlag |= GFLAG_FOGSETTING; + } break; - } + } } -DWORD -doFPtoFixedNoRound (DWORD dwInValue, int nFraction) +GLint +doFPtoFixedNoRound( GLfloat dwInValue, int nFraction ) { - DWORD dwMantissa; - int nTemp; - - if (dwInValue == 0) - return 0; - nTemp = (int) (dwInValue & 0x7F800000) >> 23; - nTemp = nTemp - 127 + nFraction - 23; - dwMantissa = (dwInValue & 0x007FFFFF) | 0x00800000; - - if (nTemp < -25) - return 0; - if (nTemp > 0) - { + GLint dwMantissa; + int nTemp; + union { int i; float f; } u; + GLint val; + + u.f = dwInValue; + val = u.i; + + if (val == 0) + return 0; + nTemp = (int) (val & 0x7F800000) >> 23; + nTemp = nTemp - 127 + nFraction - 23; + dwMantissa = (val & 0x007FFFFF) | 0x00800000; + + if (nTemp < -25) + return 0; + if (nTemp > 0) dwMantissa <<= nTemp; - } - else - { + else { nTemp = -nTemp; dwMantissa >>= nTemp; - } - if (dwInValue & 0x80000000) - { + } + if (val & 0x80000000) dwMantissa = ~dwMantissa + 1; - } - return (dwMantissa); + return dwMantissa; } /* s[8].23->s[7].10 */ -static DWORD -convertFtToFogFt (DWORD dwInValue) +static GLint +convertFtToFogFt( GLfloat dwInValue ) { - DWORD dwMantissa, dwExp; - DWORD dwRet; - - if (dwInValue == 0) - return 0; - - /* ----- Standard float Format: s[8].23 ----- - * ----- = (-1)^S * 2^(E - 127) * (1 + M / 2^23) ----- - * ----- = (-1)^S * 2^((E-63) - 64) * (1 + (M/2^13) / 2^10) ----- - * ----- Density float Format: s[7].10 ----- - * ----- New Exponential = E - 63 ----- - * ----- New Mantissa = M / 2^13 ----- - * ----- ----- - */ - - dwExp = (dwInValue & 0x7F800000) >> 23; - dwExp -= 63; - - if ((LONG) dwExp < 0) - return 0; - - if (dwExp <= 0x7F) - { - dwMantissa = (dwInValue & 0x007FFFFF) >> (23 - 10); - } - else - { + GLint dwMantissa, dwExp; + GLint dwRet; + union { int i; float f; } u; + GLint val; + + u.f = dwInValue; + val = u.i; + + if (val == 0) + return 0; + + /* ----- Standard float Format: s[8].23 ----- + * ----- = (-1)^S * 2^(E - 127) * (1 + M / 2^23) ----- + * ----- = (-1)^S * 2^((E-63) - 64) * (1 + (M/2^13) / 2^10) ----- + * ----- Density float Format: s[7].10 ----- + * ----- New Exponential = E - 63 ----- + * ----- New Mantissa = M / 2^13 ----- + * ----- ----- + */ + + dwExp = (val & 0x7F800000) >> 23; + dwExp -= 63; + + if (dwExp < 0) + return 0; + + if (dwExp <= 0x7F) + dwMantissa = (val & 0x007FFFFF) >> (23 - 10); + else { /* ----- To Return +Max(or -Max) ----- */ dwExp = 0x7F; dwMantissa = 0x3FF; - } + } - dwRet = (dwInValue & 0x80000000) >> (31 - 17); /* Shift Sign Bit */ + dwRet = (val & 0x80000000) >> (31 - 17); /* Shift Sign Bit */ - dwRet |= (dwExp << 10) | dwMantissa; + dwRet |= (dwExp << 10) | dwMantissa; - return (dwRet); + return dwRet; } Index: xc/lib/GL/mesa/src/drv/sis/sis_init.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_init.h:1.3 xc/lib/GL/mesa/src/drv/sis/sis_init.h:removed --- xc/lib/GL/mesa/src/drv/sis/sis_init.h:1.3 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_init.h Sat Feb 28 21:41:18 2004 @@ -1,294 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_init.h,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#ifndef _sis_init_h_ -#define _sis_init_h_ - -typedef LONG fixed; - -typedef struct _FIXEDCOLOR -{ - fixed r, g, b, a; -} -FIXEDCOLOR; - -#define COMMANDMODE_MMIO 1 -#define COMMANDMODE_WC 2 -#define COMMANDMODE_AGP 0 -#define _HAS_AGPBUF 1 - -#define floatConvertToFixedRGB(fixedColor, floatColor)\ -{\ - fixedColor.r = (fixed) (floatColor.r * gc->constants.oneOverRedScale * ((float) 0xffffff));\ - fixedColor.g = (fixed) (floatColor.g * gc->constants.oneOverGreenScale * ((float) 0xffffff));\ - fixedColor.b = (fixed) (floatColor.b * gc->constants.oneOverBlueScale * ((float) 0xffffff));\ - fixedColor.a = (fixed) (floatColor.a * gc->constants.oneOverAlphaScale * ((float) 0xffffff));\ -} - -/* Optimize */ -#define RGBA8ConvertToBGRA8(fixedColor, color)\ -{\ - ((GLubyte *)fixedColor)[0] = ((GLubyte *)color)[2] ; \ - ((GLubyte *)fixedColor)[1] = ((GLubyte *)color)[1] ; \ - ((GLubyte *)fixedColor)[2] = ((GLubyte *)color)[0] ; \ - ((GLubyte *)fixedColor)[3] = ((GLubyte *)color)[3] ; \ -} - -/* Put ARGB into DWORD */ -#define setTSARGB(dcSARGB, fixedColor)\ -{\ - dcSARGB = ((fixedColor.a & 0x00ff0000) << 8 | \ - (fixedColor.r & 0x00ff0000) | \ - (fixedColor.g & 0x00ff0000) >> 8 | \ - (fixedColor.b & 0x00ff0000) >> 16 ); \ -} - -#define setTSFS(dwFactor, fFactor) \ -{\ - (dwFactor) = ((fixed)((fFactor) * 0xff)) << 24;\ -} - -#define MMIO(reg, value) \ -{\ - *(LPDWORD)(GET_IOBase(hwcx) + (reg)) = value; \ -} - -#define mEndPrimitive() \ -{ \ - *(GET_IOBase(hwcx) + REG_3D_EndPrimitiveList) = 0xFF; \ - *(DWORD *)(GET_IOBase(hwcx) + 0x8b60) = (DWORD)(-1); \ -} - -#define INIT_6327_CapsEnable 0x00000080 -#define INIT_6327_CapsEnable2 0x00000000 - -#define INIT_6327_ZSet 0x00030000 -#define INIT_6327_ZMask 0xffffffff -#define INIT_6327_AlphaSet 0x07000000 -#define INIT_6327_DstSet 0x0C000000 -#define INIT_6327_DstMask 0xffffffff -#define INIT_6327_FogSet 0x04000000 -#define INIT_6327_BlendMode 0x00000001 -#define INIT_6327_TextureSet 0x00030000 -#define INIT_6327_TextureMip 0x00000000 -/* #define INIT_6327_Texture0BlendSet 0x33031941 */ -#define INIT_6327_TextureColorBlend0 0xC1485000 -#define INIT_6327_TextureAlphaBlend0 0x333A0000 -#define INIT_6327_Texture1Set 0x00030000 -#define INIT_6327_Texture1Set2 0x00000000 -/* #define INIT_6327_Texture1BlendSet 0x00000000 */ -#define INIT_6327_TextureColorBlend1 0x294B4000 -#define INIT_6327_TextureAlphaBlend1 0x333A0000 -/* #define INIT_6327_TexAddrType 0x00001000 */ -/* #define INIT_6326_InputColorFormat 0xA0000000 */ -#define INIT_6327_ParsingSet 0x00000060 - -#define SiS_Z_COMP_NEVER 0x00000000 -#define SiS_Z_COMP_S_LT_B 0x00010000 -#define SiS_Z_COMP_S_EQ_B 0x00020000 -#define SiS_Z_COMP_S_LE_B 0x00030000 -#define SiS_Z_COMP_S_GT_B 0x00040000 -#define SiS_Z_COMP_S_NE_B 0x00050000 -#define SiS_Z_COMP_S_GE_B 0x00060000 -#define SiS_Z_COMP_ALWAYS 0x00070000 - -#define SiS_ALPHA_NEVER 0x00000000 -#define SiS_ALPHA_LESS 0x01000000 -#define SiS_ALPHA_EQUAL 0x02000000 -#define SiS_ALPHA_LEQUAL 0x03000000 -#define SiS_ALPHA_GREATER 0x04000000 -#define SiS_ALPHA_NOTEQUAL 0x05000000 -#define SiS_ALPHA_GEQUAL 0x06000000 -#define SiS_ALPHA_ALWAYS 0x07000000 - -#define SiS_STENCIL_NEVER 0x00000000 -#define SiS_STENCIL_LESS 0x01000000 -#define SiS_STENCIL_EQUAL 0x02000000 -#define SiS_STENCIL_LEQUAL 0x03000000 -#define SiS_STENCIL_GREATER 0x04000000 -#define SiS_STENCIL_NOTEQUAL 0x05000000 -#define SiS_STENCIL_GEQUAL 0x06000000 -#define SiS_STENCIL_ALWAYS 0x07000000 - -#define SiS_SFAIL_KEEP 0x00000000 -#define SiS_SFAIL_ZERO 0x00100000 -#define SiS_SFAIL_REPLACE 0x00200000 -#define SiS_SFAIL_INVERT 0x00500000 -#define SiS_SFAIL_INCR 0x00600000 -#define SiS_SFAIL_DECR 0x00700000 - -#define SiS_SPASS_ZFAIL_KEEP 0x00000000 -#define SiS_SPASS_ZFAIL_ZERO 0x00010000 -#define SiS_SPASS_ZFAIL_REPLACE 0x00020000 -#define SiS_SPASS_ZFAIL_INVERT 0x00050000 -#define SiS_SPASS_ZFAIL_INCR 0x00060000 -#define SiS_SPASS_ZFAIL_DECR 0x00070000 - -#define SiS_SPASS_ZPASS_KEEP 0x00000000 -#define SiS_SPASS_ZPASS_ZERO 0x00001000 -#define SiS_SPASS_ZPASS_REPLACE 0x00002000 -#define SiS_SPASS_ZPASS_INVERT 0x00005000 -#define SiS_SPASS_ZPASS_INCR 0x00006000 -#define SiS_SPASS_ZPASS_DECR 0x00007000 - -#define SiS_D_ZERO 0x00000000 -#define SiS_D_ONE 0x00000010 -#define SiS_D_SRC_COLOR 0x00000020 -#define SiS_D_ONE_MINUS_SRC_COLOR 0x00000030 -#define SiS_D_SRC_ALPHA 0x00000040 -#define SiS_D_ONE_MINUS_SRC_ALPHA 0x00000050 -#define SiS_D_DST_ALPHA 0x00000060 -#define SiS_D_ONE_MINUS_DST_ALPHA 0x00000070 - -#define SiS_S_ZERO 0x00000000 -#define SiS_S_ONE 0x00000001 -#define SiS_S_SRC_ALPHA 0x00000004 -#define SiS_S_ONE_MINUS_SRC_ALPHA 0x00000005 -#define SiS_S_DST_ALPHA 0x00000006 -#define SiS_S_ONE_MINUS_DST_ALPHA 0x00000007 -#define SiS_S_DST_COLOR 0x00000008 -#define SiS_S_ONE_MINUS_DST_COLOR 0x00000009 -#define SiS_S_SRC_ALPHA_SATURATE 0x0000000a - -/* Logic Op */ -#define LOP_CLEAR 0x00000000 -#define LOP_NOR 0x01000000 -#define LOP_AND_INVERTED 0x02000000 -#define LOP_COPY_INVERTED 0x03000000 -#define LOP_AND_REVERSE 0x04000000 -#define LOP_INVERT 0x05000000 -#define LOP_XOR 0x06000000 -#define LOP_NAND 0x07000000 -#define LOP_AND 0x08000000 -#define LOP_EQUIV 0x09000000 -#define LOP_NOOP 0x0a000000 -#define LOP_OR_INVERTED 0x0b000000 -#define LOP_COPY 0x0c000000 -#define LOP_OR_REVERSE 0x0d000000 -#define LOP_OR 0x0e000000 -#define LOP_SET 0x0f000000 - -/* Get lock before calling this */ -#define mWait3DCmdQueue(wLen)\ -do{\ - while ( *(hwcx->CurrentQueueLenPtr) < (int)(wLen))\ - {\ - *(hwcx->CurrentQueueLenPtr) = \ - (int)(*(DWORD *)(GET_IOBase(hwcx) + REG_QUELEN) & MASK_QUELEN) \ - - (int)20; \ - }\ - *(hwcx->CurrentQueueLenPtr) -= (int)(wLen);\ -}while(0) - -#if 0 -#define mWait3DCmdQueue(wLen) do{}while(0); -#endif - -#define GFLAG_ENABLESETTING 0x00000001 -#define GFLAG_ENABLESETTING2 0x00000002 -#define GFLAG_ZSETTING 0x00000004 -#define GFLAG_ALPHASETTING 0x00000008 -#define GFLAG_DESTSETTING 0x00000010 -#define GFLAG_LINESETTING 0x00000020 -#define GFLAG_STENCILSETTING 0x00000040 -#define GFLAG_FOGSETTING 0x00000080 -#define GFLAG_DSTBLEND 0x00000100 -#define GFLAG_CLIPPING 0x00000200 -#define CFLAG_TEXTURERESET 0x00000400 -#define GFLAG_TEXTUREMIPMAP 0x00000800 -#define GFLAG_TEXBORDERCOLOR 0x00001000 -#define GFLAG_TEXTUREADDRESS 0x00002000 -#define GFLAG_TEXTUREENV 0x00004000 -#define CFLAG_TEXTURERESET_1 0x00008000 -#define GFLAG_TEXTUREMIPMAP_1 0x00010000 -#define GFLAG_TEXBORDERCOLOR_1 0x00020000 -#define GFLAG_TEXTUREADDRESS_1 0x00040000 -#define GFLAG_TEXTUREENV_1 0x00080000 - -#define GFLAG_TEXTURE_STATES (CFLAG_TEXTURERESET | GFLAG_TEXTUREMIPMAP | \ - GFLAG_TEXBORDERCOLOR | GFLAG_TEXTUREADDRESS | \ - CFLAG_TEXTURERESET_1 | GFLAG_TEXTUREMIPMAP_1 | \ - GFLAG_TEXBORDERCOLOR_1 | \ - GFLAG_TEXTUREADDRESS_1 | \ - GFLAG_TEXTUREENV | GFLAG_TEXTUREENV_1) - - -#define GFLAG_RENDER_STATES (GFLAG_ENABLESETTING | GFLAG_ENABLESETTING2 | \ - GFLAG_ZSETTING | GFLAG_ALPHASETTING | \ - GFLAG_DESTSETTING | GFLAG_FOGSETTING | \ - GFLAG_STENCILSETTING | GFLAG_DSTBLEND | \ - GFLAG_CLIPPING) - - - -#define Index_SR_Ext_BIOS 0x10 -#define REVISION_6205BASE 3 -#define SiS6326 (REVISION_6205BASE+20) /* 6326 A/B/C0 */ -#define SiS6326C (REVISION_6205BASE+21) /* 6326 C1 */ -#define SiS6326C5 (REVISION_6205BASE+22) /* 6326 C5 */ -#define SiS6326G (REVISION_6205BASE+25) /* 6326 C1 */ -#define SiS6326D0 (REVISION_6205BASE+30) /* 6326 D0 */ -#define SiS6326D1 (REVISION_6205BASE+31) /* 6326 D1 */ -#define SiS6326D2 (REVISION_6205BASE+32) /* 6326 D2 */ -#define SiS6326H0 (REVISION_6205BASE+35) /* 6326 H0 */ -#define SiS6215A (REVISION_6205BASE+1) /* 6205 B2, Video only version */ -#define SiS6215B (REVISION_6205BASE+2) /* 6205 D3, Video only version */ -#define SiS6215C (REVISION_6205BASE+3) /* 6205 B2, Video XOR version */ -#define SiS6205B (REVISION_6205BASE+4) /* 6205 B2 */ -#define SiS6205D (REVISION_6205BASE+5) /* 6205 D3 */ -#define SiS5597 (REVISION_6205BASE+7) /* Jedi, 5597, 5598 */ - -#define REVISION_6205 {{0x6326, 0xAF, 0, SiS6326 },\ - {0x6326, 0xC1, 0, SiS6326C },\ - {0x6326, 0x92, 0, SiS6326D2},\ - {0x6326, 0x92, 1, SiS6326D2},\ - {0x6326, 0x0A, 0, SiS6326G },\ - {0x6326, 0xD0, 0, SiS6326D0},\ - {0x6326, 0xD1, 0, SiS6326D1},\ - {0x6326, 0xD2, 0, SiS6326D2},\ - {0x6326, 0xD2, 1, SiS6326D2},\ - {0x6326, 0x0B, 0, SiS6326H0},\ - {0x6326, 0x0B, 1, SiS6326H0},\ - {0x0200, 0x6F, 0, SiS5597 },\ - {0x0205, 0x6F, 0, SiS5597 },\ - {0x0205, 0x44, 1, SiS6215A },\ - {0x0205, 0xD3, 1, SiS6215B },\ - {0x0204, 0x2F, 1, SiS6215C },\ - {0x0205, 0x44, 0, SiS6205B },\ - {0x0205, 0xD3, 0, SiS6205D }} - -#define REG_QUELEN 0x8240 /* Byte for 201C */ -#define MASK_QUELEN 0xffff - -#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h:1.5 xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h:removed --- xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h:1.5 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h Sat Feb 28 21:41:18 2004 @@ -1,277 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_linefunc.h,v 1.5 2000/09/26 15:56:48 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#define SIS_TRI_FUNC 0 - -#define SIS_MMIO_WRITE_VERTEX(v, i) \ - if(SIS_STEREO && hwcx->stereoEnabled) \ - { \ - MMIOBase[(REG_3D_TSXa+(i)*0x30)/4] = VB->Win.data[v][0] - 0.5 + STEREO_OFFSET(v); \ - MMIOBase[(REG_3D_TSYa+(i)*0x30)/4] = Y_FLIP (VB->Win.data[v][1]) + 0.5; \ - } \ - else \ - { \ - MMIOBase[(REG_3D_TSXa+(i)*0x30)/4] = VB->Win.data[v][0] - 0.5 ; \ - MMIOBase[(REG_3D_TSYa+(i)*0x30)/4] = Y_FLIP (VB->Win.data[v][1]) + 0.5; \ - } \ -\ - if (ctx->TriangleCaps & DD_TRI_OFFSET) \ - { \ - if(SIS_TRI_FUNC){ \ - MMIOBase[(REG_3D_TSZa+(i)*0x30)/4] = \ - (VB->Win.data[v][2] + ctx->PolygonZoffset) / SIS_DEPTH_SCALE; \ - } \ - else{ \ - MMIOBase[(REG_3D_TSZa+(i)*0x30)/4] = \ - (VB->Win.data[v][2] + ctx->LineZoffset) / SIS_DEPTH_SCALE; \ - } \ - } \ - else \ - { \ - MMIOBase[(REG_3D_TSZa+(i)*0x30)/4] = VB->Win.data[v][2] / SIS_DEPTH_SCALE; \ - } \ -\ - if (SIS_STATES & SIS_TEXTURE0) \ - { \ - if(VB->TexCoordPtr[0]->size == 4){ \ - MMIOBase[(REG_3D_TSUAa+(i)*0x30)/4] = VB->TexCoordPtr[0]->data[v][0] / \ - VB->TexCoordPtr[0]->data[v][3]; \ - MMIOBase[(REG_3D_TSVAa+(i)*0x30)/4] = VB->TexCoordPtr[0]->data[v][1] / \ - VB->TexCoordPtr[0]->data[v][3]; \ - } \ - else{ \ - MMIOBase[(REG_3D_TSUAa+(i)*0x30)/4] = VB->TexCoordPtr[0]->data[v][0]; \ - MMIOBase[(REG_3D_TSVAa+(i)*0x30)/4] = VB->TexCoordPtr[0]->data[v][1]; \ - } \ - } \ -\ - if (SIS_STATES & SIS_TEXTURE1) \ - { \ - if(VB->TexCoordPtr[1]->size == 4){ \ - MMIOBase[(REG_3D_TSUBa+(i)*0x30)/4] = VB->TexCoordPtr[1]->data[v][0] / \ - VB->TexCoordPtr[1]->data[v][3]; \ - MMIOBase[(REG_3D_TSVBa+(i)*0x30)/4] = VB->TexCoordPtr[1]->data[v][1] / \ - VB->TexCoordPtr[1]->data[v][3]; \ - } \ - else{ \ - MMIOBase[(REG_3D_TSUBa+(i)*0x30)/4] = VB->TexCoordPtr[1]->data[v][0]; \ - MMIOBase[(REG_3D_TSVBa+(i)*0x30)/4] = VB->TexCoordPtr[1]->data[v][1]; \ - } \ - } \ -\ - if (SIS_STATES & (SIS_USE_W)) \ - { \ - if(VB->TexCoordPtr[0]->size == 4){ \ - MMIOBase[(REG_3D_TSWGa+(i)*0x30)/4] = VB->Win.data[v][3] * \ - VB->TexCoordPtr[0]->data[v][3]; \ - } \ - else{ \ - MMIOBase[(REG_3D_TSWGa+(i)*0x30)/4] = VB->Win.data[v][3]; \ - } \ - } \ -\ - if (SIS_STATES & (SIS_SMOOTH)) \ - { \ - DWORD dcSARGB; \ -\ - RGBA8ConvertToBGRA8 (&dcSARGB, VB->ColorPtr->data[v]); \ -\ - ((DWORD *) MMIOBase)[(REG_3D_TSARGBa+(i)*0x30)/4] = dcSARGB; \ - } \ - else if(LAST_VERTEX) \ - { \ - DWORD dcSARGB; \ -\ - RGBA8ConvertToBGRA8 (&dcSARGB, VB->ColorPtr->data[pv]); \ -\ - ((DWORD *) MMIOBase)[(REG_3D_TSARGBa+(i)*0x30)/4] = dcSARGB; \ - } \ - -static void -SIS_TAG (sis_line) (GLcontext * ctx, GLuint vert0, GLuint vert1, GLuint pv) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - struct vertex_buffer *VB = ctx->VB; - float *MMIOBase = (float *) GET_IOBase (hwcx); - - STEREO_SAMPLE(vert0); - - mWait3DCmdQueue (10 * 2 + 1); - - if (SIS_STATES & (SIS_SMOOTH)) - { - hwcx->dwPrimitiveSet &= ~0x07001f07; - hwcx->dwPrimitiveSet |= - (OP_3D_FIRE_TSARGBb | SHADE_GOURAUD | OP_3D_LINE_DRAW); - - ((DWORD *) MMIOBase)[REG_3D_PrimitiveSet / 4] = hwcx->dwPrimitiveSet; - } - else - { - hwcx->dwPrimitiveSet &= ~0x07001f07; - hwcx->dwPrimitiveSet |= - (OP_3D_FIRE_TSARGBb | SHADE_FLAT_VertexB | OP_3D_LINE_DRAW); - - ((DWORD *) MMIOBase)[REG_3D_PrimitiveSet / 4] = hwcx->dwPrimitiveSet; - } - -#define LAST_VERTEX 0 - SIS_MMIO_WRITE_VERTEX (vert0, 0); -#undef LAST_VERTEX -#define LAST_VERTEX 1 - SIS_MMIO_WRITE_VERTEX (vert1, 1); -#undef LAST_VERTEX - - /* debug - mEndPrimitive (); - WaitEngIdle(hwcx); - d2f_once (ctx); - */ -} - -#define SIS_AGP_WRITE_VERTEX(v) \ -do{ \ -if(SIS_STEREO && hwcx->stereoEnabled) \ -{ \ - AGP_CurrentPtr[0] = VB->Win.data[v][0] - 0.5 + STEREO_OFFSET(v); \ -} \ -else \ -{ \ - AGP_CurrentPtr[0] = VB->Win.data[v][0] - 0.5; \ -} \ -AGP_CurrentPtr[1] = Y_FLIP (VB->Win.data[v][1]) + 0.5; \ -\ -if (ctx->TriangleCaps & DD_TRI_OFFSET){ \ - if(SIS_TRI_FUNC){ \ - AGP_CurrentPtr[2] = (VB->Win.data[v][2] + ctx->PolygonZoffset) / SIS_DEPTH_SCALE; \ - } \ - else{ \ - AGP_CurrentPtr[2] = (VB->Win.data[v][2] + ctx->LineZoffset) / SIS_DEPTH_SCALE; \ - } \ -} \ -else{ \ - AGP_CurrentPtr[2] = VB->Win.data[v][2] / SIS_DEPTH_SCALE; \ -}\ -AGP_CurrentPtr+=3; \ -if (SIS_STATES & (SIS_USE_W)) \ -{ \ - if(VB->TexCoordPtr[0]->size == 4){ \ - AGP_CurrentPtr[0] = VB->Win.data[v][3] * \ - VB->TexCoordPtr[0]->data[v][3]; \ - } \ - else{ \ - AGP_CurrentPtr[0] = VB->Win.data[v][3]; \ - } \ - AGP_CurrentPtr+=1; \ -} \ -\ -if (SIS_STATES & (SIS_SMOOTH)) \ -{ \ - RGBA8ConvertToBGRA8 (&dcSARGB, VB->ColorPtr->data[v]); \ - ((DWORD *)AGP_CurrentPtr)[0] = dcSARGB; \ -} \ -else if(FIRST_VERTEX) \ -{ \ - RGBA8ConvertToBGRA8 (&dcSARGB, VB->ColorPtr->data[pv]); \ - ((DWORD *)AGP_CurrentPtr)[0] = dcSARGB; \ -} \ -else \ -{ \ - ((DWORD *)AGP_CurrentPtr)[0] = dcSARGB; \ -} \ -AGP_CurrentPtr+=1; \ -\ -if (SIS_STATES & SIS_TEXTURE0) \ -{ \ - if(VB->TexCoordPtr[0]->size == 4){ \ - AGP_CurrentPtr[0] = VB->TexCoordPtr[0]->data[v][0] / \ - VB->TexCoordPtr[0]->data[v][3]; \ - AGP_CurrentPtr[1] = VB->TexCoordPtr[0]->data[v][1] / \ - VB->TexCoordPtr[0]->data[v][3]; \ - } \ - else{ \ - AGP_CurrentPtr[0] = VB->TexCoordPtr[0]->data[v][0]; \ - AGP_CurrentPtr[1] = VB->TexCoordPtr[0]->data[v][1]; \ - } \ - AGP_CurrentPtr+=2; \ -} \ -\ -if (SIS_STATES & SIS_TEXTURE1) \ -{ \ - if(VB->TexCoordPtr[1]->size == 4){ \ - AGP_CurrentPtr[0] = VB->TexCoordPtr[1]->data[v][0] / \ - VB->TexCoordPtr[1]->data[v][3]; \ - AGP_CurrentPtr[1] = VB->TexCoordPtr[1]->data[v][1] / \ - VB->TexCoordPtr[1]->data[v][3]; \ - } \ - else{ \ - AGP_CurrentPtr[0] = VB->TexCoordPtr[1]->data[v][0]; \ - AGP_CurrentPtr[1] = VB->TexCoordPtr[1]->data[v][1]; \ - } \ - AGP_CurrentPtr+=2; \ -} \ -}while(0) - -static void -SIS_TAG (sis_agp_line) (GLcontext * ctx, GLuint vert0, GLuint vert1, - GLuint pv) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - struct vertex_buffer *VB = ctx->VB; - - DWORD dcSARGB; - - STEREO_SAMPLE(vert0); - -#if 0 - if ((DWORD) AGP_CurrentPtr - (DWORD) AGP_StartPtr >= (AGP_ALLOC_SIZE - 0x10)) - { - sis_FlushAGP (ctx); - sis_StartAGP (ctx); - } -#endif - -#define FIRST_VERTEX 1 - SIS_AGP_WRITE_VERTEX (vert0); -#undef FIRST_VERTEX -#define FIRST_VERTEX 0 - SIS_AGP_WRITE_VERTEX (vert1); -#undef FIRST_VERTEX -} - -#undef SIS_TRI_FUNC Index: xc/lib/GL/mesa/src/drv/sis/sis_lock.c diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_lock.c:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_lock.c Mon Dec 8 19:15:22 2003 @@ -0,0 +1,76 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_lock.c,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ + +/* + * Authors: + * Eric Anholt + */ + +#include "context.h" +#include "sis_context.h" +#include "sis_lock.h" +#include "sis_dd.h" +#include "sis_state.h" + +/* Update the hardware state. This is called if another context has + * grabbed the hardware lock, which includes the X server. This + * function also updates the driver's window state after the X server + * moves, resizes or restacks a window -- the change will be reflected + * in the drawable position and clip rects. Since the X server grabs + * the hardware lock when it changes the window state, this routine will + * automatically be called after such a change. + */ +void +sisGetLock( sisContextPtr smesa, GLuint flags ) +{ + __DRIdrawablePrivate *dPriv = smesa->driDrawable; + __DRIscreenPrivate *sPriv = smesa->driScreen; + SISSAREAPrivPtr sarea = smesa->sarea; + + drmGetLock( smesa->driFd, smesa->hHWContext, flags ); + + /* The window might have moved, so we might need to get new clip + * rects. + * + * NOTE: This releases and regrabs the hw lock to allow the X server + * to respond to the DRI protocol request for new drawable info. + * Since the hardware state depends on having the latest drawable + * clip rects, all state checking must be done _after_ this call. + */ + DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); + + if ( smesa->lastStamp != dPriv->lastStamp ) { + sisUpdateBufferSize( smesa ); + sisUpdateClipping( smesa->glCtx ); + sisDDDrawBuffer( smesa->glCtx, smesa->glCtx->Color.DrawBuffer ); + smesa->lastStamp = dPriv->lastStamp; + } + + if ( sarea->CtxOwner != smesa->hHWContext ) { + sarea->CtxOwner = smesa->hHWContext; + smesa->GlobalFlag = GFLAG_ALL; + } +} Index: xc/lib/GL/mesa/src/drv/sis/sis_lock.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_lock.h:1.3 xc/lib/GL/mesa/src/drv/sis/sis_lock.h:1.5 --- xc/lib/GL/mesa/src/drv/sis/sis_lock.h:1.3 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_lock.h Mon Dec 8 19:15:22 2003 @@ -1,50 +1,41 @@ /************************************************************************** Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt All Rights Reserved. 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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_lock.h,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_lock.h,v 1.5 2003/12/09 00:15:22 alanh Exp $ */ /* * Authors: - * Sung-Ching Lin - * + * Sung-Ching Lin + * Eric Anholt */ -#ifndef _sis_dri_h_ -#define _sis_dri_h_ +#ifndef __SIS_LOCK_H +#define __SIS_LOCK_H -/* from tdfx */ -#define SIS_VALIDATE_DRAWABLE_INFO(dpy, psp, pdp) \ -do { \ - while (*(pdp->pStamp) != pdp->lastStamp) { \ - DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ - DRI_MESA_VALIDATE_DRAWABLE_INFO(dpy, psp->myNum, pdp); \ - DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ - sis_SetDrawBuffer (ctx, ctx->Color.DriverDrawBuffer); \ - } \ -} while (0) +extern void sisGetLock( sisContextPtr smesa, GLuint flags ); #ifdef DEBUG_LOCKING extern char *prevLockFile; @@ -71,66 +62,26 @@ #define DEBUG_CHECK_LOCK() #endif -#ifdef XFree86Server - -/* TODO, X-server will inform us if drawable state changed? */ -#define LOCK_HARDWARE() \ - do { \ - mEndPrimitive(); \ - sis_SetDrawBuffer (ctx, ctx->Color.DriverDrawBuffer); \ - if(*(hwcx->CurrentHwcxPtr) != hwcx->serialNumber) \ - sis_validate_all_state(hwcx); \ - } while (0) - -#define UNLOCK_HARDWARE() \ - do { \ - mEndPrimitive(); \ - } while (0) - -#else - -#define DRM_LIGHT_LOCK_RETURN(fd,lock,context,__ret) \ - do { \ - DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ - if (__ret) drmGetLock(fd,context,0); \ - } while(0) - /* Lock the hardware using the global current context */ -#define LOCK_HARDWARE() \ - do { \ - int stamp; \ - char __ret=0; \ - __DRIdrawablePrivate *dPriv = xmesa->driContextPriv->driDrawablePriv; \ - __DRIscreenPrivate *sPriv = dPriv->driScreenPriv; \ - mEndPrimitive(); \ - DEBUG_CHECK_LOCK(); \ - DEBUG_LOCK(); \ - DRM_LIGHT_LOCK_RETURN(sPriv->fd, &sPriv->pSAREA->lock, \ - dPriv->driContextPriv->hHWContext, __ret); \ - stamp=dPriv->lastStamp; \ - XMESA_VALIDATE_DRAWABLE_INFO(xmesa->display, sPriv, dPriv); \ - if (*(dPriv->pStamp)!=stamp) \ - { \ - sis_SetDrawBuffer (ctx, ctx->Color.DriverDrawBuffer); \ - } \ - if(__ret && (*(hwcx->CurrentHwcxPtr) != hwcx->serialNumber)) \ - { \ - sis_validate_all_state(hwcx); \ - } \ +#define LOCK_HARDWARE() \ + do { \ + char __ret=0; \ + mEndPrimitive(); \ + DEBUG_CHECK_LOCK(); \ + DRM_CAS( smesa->driHwLock, smesa->hHWContext, \ + (DRM_LOCK_HELD | smesa->hHWContext), __ret ); \ + if ( __ret != 0 ) \ + sisGetLock( smesa, 0 ); \ + DEBUG_LOCK(); \ } while (0) /* Unlock the hardware using the global current context */ -#define UNLOCK_HARDWARE() \ - do { \ - __DRIdrawablePrivate *dPriv = xmesa->driContextPriv->driDrawablePriv; \ - __DRIscreenPrivate *sPriv = dPriv->driScreenPriv; \ - mEndPrimitive(); \ - DEBUG_RESET(); \ - *(hwcx->CurrentHwcxPtr) = hwcx->serialNumber; \ - DRM_UNLOCK(sPriv->fd, &sPriv->pSAREA->lock, \ - dPriv->driContextPriv->hHWContext); \ +#define UNLOCK_HARDWARE() \ + do { \ + mEndPrimitive(); \ + DRM_UNLOCK(smesa->driFd, smesa->driHwLock, \ + smesa->hHWContext); \ + DEBUG_RESET(); \ } while (0) #endif - -#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_mesa.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_mesa.c:1.7 xc/lib/GL/mesa/src/drv/sis/sis_mesa.c:removed --- xc/lib/GL/mesa/src/drv/sis/sis_mesa.c:1.7 Wed Oct 30 07:52:00 2002 +++ xc/lib/GL/mesa/src/drv/sis/sis_mesa.c Sat Feb 28 21:41:18 2004 @@ -1,1578 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_mesa.c,v 1.7 2002/10/30 12:52:00 alanh Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#include "sis_ctx.h" -#include "sis_mesa.h" -#include "sis_lock.h" - -#include "state.h" - -void -sis_RenderStart (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - LOCK_HARDWARE (); - - if (hwcx->Primitive & hwcx->swRenderFlag) - { - WaitEngIdle (hwcx); - } - - if (ctx->Texture.ReallyEnabled) - { - sis_validate_texture (ctx); - if (hwcx->swRenderFlag & SIS_SW_TEXTURE) - { - hwcx->swForceRender = GL_TRUE; - gl_update_state(ctx); - hwcx->swForceRender = GL_FALSE; - } - else - { - if (hwcx->GlobalFlag & GFLAG_TEXTURE_STATES) - sis_update_texture_state (hwcx); - } - } - - if (hwcx->GlobalFlag & GFLAG_RENDER_STATES) - { - sis_update_render_state (hwcx, 0); - } - - if (hwcx->UseAGPCmdMode) - { - sis_StartAGP (ctx); - } - -#if defined(SIS_DUMP) - d2f_once (ctx); -#endif -} - -void -sis_RenderFinish (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - if (hwcx->UseAGPCmdMode) - { - sis_FlushAGP (ctx); - } - - UNLOCK_HARDWARE (); -} - -void -sis_ReducedPrimitiveChange (GLcontext * ctx, GLenum primitive) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - /* it is possible several primitive types per VB */ - if (hwcx->UseAGPCmdMode) - { - sis_FlushAGP (ctx); - sis_StartAGP (ctx); - } - else - { - mEndPrimitive(); - - /* - * do nothing now because each hw's primitive-type will be set - * per primitive - */ - - /* TODO: if above rule changes, remember to modify */ - } - - hwcx->AGPParseSet &= ~0xf; - switch (primitive) - { - case GL_POINT: - case GL_POINTS: - hwcx->Primitive = SIS_SW_POINT; - hwcx->AGPParseSet |= 0x0; - break; - case GL_LINE: - case GL_LINES: - hwcx->Primitive = SIS_SW_LINE; - hwcx->AGPParseSet |= 0x4; - break; - case GL_POLYGON: - hwcx->Primitive = SIS_SW_TRIANGLE; - hwcx->AGPParseSet |= 0x8; - break; - } -} - -void -sis_init_driver (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - ctx->Driver.UpdateState = sis_UpdateState; - - ctx->Driver.RenderStart = sis_RenderStart; - ctx->Driver.RenderFinish = sis_RenderFinish; - ctx->Driver.ReducedPrimitiveChange = sis_ReducedPrimitiveChange; - ctx->Driver.Finish = sis_Finish; - ctx->Driver.Flush = sis_Flush; - - ctx->Driver.AlphaFunc = sis_AlphaFunc; - ctx->Driver.BlendEquation = sis_BlendEquation; - ctx->Driver.BlendFunc = sis_BlendFunc; - ctx->Driver.BlendFuncSeparate = sis_BlendFuncSeparate; - ctx->Driver.ClearDepth = sis_ClearDepth; - ctx->Driver.CullFace = sis_CullFace; - ctx->Driver.FrontFace = sis_FrontFace; - ctx->Driver.DepthFunc = sis_DepthFunc; - ctx->Driver.DepthMask = sis_DepthMask; - ctx->Driver.DepthRange = sis_DepthRange; - ctx->Driver.Enable = sis_Enable; - ctx->Driver.Fogfv = sis_Fogfv; - ctx->Driver.Hint = sis_Hint; - ctx->Driver.Lightfv = sis_Lightfv; - ctx->Driver.LightModelfv = sis_LightModelfv; - ctx->Driver.PolygonMode = sis_PolygonMode; - ctx->Driver.Scissor = sis_Scissor; - ctx->Driver.ShadeModel = sis_ShadeModel; - ctx->Driver.ClearStencil = sis_ClearStencil; - ctx->Driver.StencilFunc = sis_StencilFunc; - ctx->Driver.StencilMask = sis_StencilMask; - ctx->Driver.StencilOp = sis_StencilOp; - ctx->Driver.Viewport = sis_Viewport; - - ctx->Driver.Clear = sis_Clear; - - ctx->Driver.TexEnv = sis_TexEnv; - ctx->Driver.TexImage = sis_TexImage; - ctx->Driver.TexSubImage = sis_TexSubImage; - ctx->Driver.TexParameter = sis_TexParameter; - ctx->Driver.BindTexture = sis_BindTexture; - ctx->Driver.DeleteTexture = sis_DeleteTexture; - ctx->Driver.UpdateTexturePalette = sis_UpdateTexturePalette; - ctx->Driver.ActiveTexture = sis_ActiveTexture; - ctx->Driver.IsTextureResident = sis_IsTextureResident; - ctx->Driver.PrioritizeTexture = sis_PrioritizeTexture; - - ctx->Driver.ClearColor = sis_ClearColor; - ctx->Driver.SetDrawBuffer = sis_SetDrawBuffer; - ctx->Driver.SetReadBuffer = sis_SetReadBuffer; - ctx->Driver.GetBufferSize = sis_GetBufferSize; - ctx->Driver.GetString = sis_GetString; - ctx->Driver.ColorMask = sis_ColorMask; - ctx->Driver.LogicOp = sis_LogicOp; - ctx->Driver.Dither = sis_Dither; - ctx->Driver.GetParameteri = sis_GetParameteri; - ctx->Driver.DrawPixels = sis_DrawPixels; - ctx->Driver.Bitmap = sis_Bitmap; - - /* Optimization */ -#ifdef NOT_DONE - ctx->Driver.RasterSetup = sis_ChooseRasterSetupFunc(ctx); - ctx->Driver.RegisterVB = sis_RegisterVB; - ctx->Driver.UnregisterVB = sis_UnregisterVB; - ctx->Driver.ResetVB = sis_ResetVB; - ctx->Driver.ResetCvaVB = sis_ResetCvaVB; -#endif - - /* Fast Path */ - ctx->Driver.RegisterPipelineStages = sis_RegisterPipelineStages; - - /* driver-specific */ - hwcx->SwapBuffers = sis_swap_buffers; - -#ifdef SIS_USE_HW_CULL - /* set capability flag */ - ctx->Driver.TriangleCaps = DD_TRI_CULL; -#endif -} - -void -sis_UpdateState (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - sis_set_render_func (ctx); - - /* ?? duplicate in sis_Enable */ - if (ctx->NewState & NEW_FOG) - { - if (ctx->RasterMask & FOG_BIT) - current->hwCapEnable |= MASK_FogEnable; - else - current->hwCapEnable &= ~MASK_FogEnable; - } - - /* TODO: mesa->NewState. In sis_Enable? */ - if (ctx->RasterMask & STENCIL_BIT) - { - current->hwCapEnable |= - (MASK_StencilTestEnable | MASK_StencilWriteEnable); - } - else - { - current->hwCapEnable &= - ~(MASK_StencilTestEnable | MASK_StencilWriteEnable); - } - - /* NEW_TEXTURE_ENABLE depends on glEnable() instead of ReallyEnabled */ - /* if (ctx->NewState & NEW_TEXTURE_ENABLE) */ - if(1) - { - if (ctx->Texture.ReallyEnabled & - (TEXTURE0_1D | TEXTURE0_2D | TEXTURE1_1D | TEXTURE1_2D)) - { - current->hwCapEnable |= MASK_TextureEnable; - - current->hwCapEnable &= ~MASK_TextureNumUsed; - if (ctx->Texture.ReallyEnabled & TEXTURE1_ANY) - current->hwCapEnable |= 0x00002000; - else - current->hwCapEnable |= 0x00001000; - } - else - { - current->hwCapEnable &= ~MASK_TextureEnable; - } - -#if 1 - /* TODO : if unmark these, error in multitexture */ - if(ctx->NewState & NEW_TEXTURE_ENABLE) - { - int i; - for (i = 0; i < SIS_MAX_TEXTURES; i++) - { - hwcx->TexStates[i] |= (NEW_TEXTURING | NEW_TEXTURE_ENV); - } - } -#endif - } - - /* enable setting 1 */ - if (current->hwCapEnable ^ prev->hwCapEnable) - { - prev->hwCapEnable = current->hwCapEnable; - hwcx->GlobalFlag |= GFLAG_ENABLESETTING; - } - - /* enable setting 2 */ - if (current->hwCapEnable2 ^ prev->hwCapEnable2) - { - prev->hwCapEnable2 = current->hwCapEnable2; - hwcx->GlobalFlag |= GFLAG_ENABLESETTING2; - } - - /* TODO: if fog disable, don't check */ - if (current->hwCapEnable & MASK_FogEnable) - { - /* fog setting */ - if (current->hwFog ^ prev->hwFog) - { - prev->hwFog = current->hwFog; - hwcx->GlobalFlag |= GFLAG_FOGSETTING; - } - if (current->hwFogFar ^ prev->hwFogFar) - { - prev->hwFogFar = current->hwFogFar; - hwcx->GlobalFlag |= GFLAG_FOGSETTING; - } - if (current->hwFogInverse ^ prev->hwFogInverse) - { - prev->hwFogInverse = current->hwFogInverse; - hwcx->GlobalFlag |= GFLAG_FOGSETTING; - } - if (current->hwFogDensity ^ prev->hwFogDensity) - { - prev->hwFogDensity = current->hwFogDensity; - hwcx->GlobalFlag |= GFLAG_FOGSETTING; - } - } - -#ifdef NOT_DONE - sis_set_render_vb_tabs(ctx); -#endif - - /* TODO: assume when isFullScreen/DrawBuffer changed, UpdateState - * will be called - */ -#if SIS_STEREO - if(hwcx->isFullScreen && - (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT) && - hwcx->useStereo) - { - if(!hwcx->stereoEnabled){ - sis_init_stereo(ctx); - } - } - else{ - if(hwcx->stereoEnabled){ - sis_final_stereo(ctx); - } - } -#endif - - /* TODO : 1. where to handle SIS_SW_TEXTURE? - * 2. sw<->hw - * 3. sw-render only if next primitve need to do - */ -} - -void -sis_set_buffer_static (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - GLvisual *visual = ctx->Visual; - - switch (hwcx->bytesPerPixel) - { - case 2: - /* TODO: don't check - if (hwcx->redMask == 0xf800 && hwcx->greenMask == 0x07e0 && - hwcx->blueMask == 0x001f) - */ - { - current->hwDstSet |= DST_FORMAT_RGB_565; - } - break; - case 4: - /* - if (hwcx->redMask == 0xff0000 && hwcx->greenMask == 0xff00 && - hwcx->blueMask == 0xff) - */ - { - switch (visual->AlphaBits) - { - case 0: - case 1: - case 2: - case 4: - case 8: - /* TODO */ - current->hwDstSet |= DST_FORMAT_ARGB_8888; - break; - } - } - break; - default: - assert (0); - } - - switch (visual->DepthBits) - { - case 0: - current->hwCapEnable &= ~MASK_ZWriteEnable; - case 16: - hwcx->zFormat = Z_16; - current->hwCapEnable |= MASK_ZWriteEnable; - break; - case 32: - hwcx->zFormat = Z_32; - current->hwCapEnable |= MASK_ZWriteEnable; - break; - case 24: - assert (visual->StencilBits); - hwcx->zFormat = S_8_Z_24; - current->hwCapEnable |= MASK_StencilBufferEnable; - current->hwCapEnable |= MASK_ZWriteEnable; - break; - } - - current->hwZ &= ~MASK_ZBufferFormat; - current->hwZ |= hwcx->zFormat; - - /* Destination Color Format */ - if (current->hwDstSet ^ prev->hwDstSet) - { - prev->hwDstSet = current->hwDstSet; - hwcx->GlobalFlag |= GFLAG_DESTSETTING; - } - - /* Z Buffer Data Format */ - if (current->hwZ ^ prev->hwZ) - { - prev->hwZ = current->hwZ; - hwcx->GlobalFlag |= GFLAG_ZSETTING; - } - - sis_sw_set_zfuncs_static (ctx); -} - -void -sis_Finish (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - sis_Flush (ctx); - - WaitEngIdle (hwcx); -} - -void -sis_Flush (GLcontext * ctx) -{ - /* do nothing now */ -} - -void -sis_AlphaFunc (GLcontext * ctx, GLenum func, GLclampf ref) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - /* TODO: ref is type GLclampf, but mesa has scaled it to 0 - 255.0 */ - current->hwAlpha = ((unsigned char) ref) << 16; - - /* Alpha Test function */ - current->hwAlpha &= ~0x07000000; - switch (func) - { - case GL_NEVER: - current->hwAlpha |= SiS_ALPHA_NEVER; - break; - case GL_LESS: - current->hwAlpha |= SiS_ALPHA_LESS; - break; - case GL_EQUAL: - current->hwAlpha |= SiS_ALPHA_EQUAL; - break; - case GL_LEQUAL: - current->hwAlpha |= SiS_ALPHA_LEQUAL; - break; - case GL_GREATER: - current->hwAlpha |= SiS_ALPHA_GREATER; - break; - case GL_NOTEQUAL: - current->hwAlpha |= SiS_ALPHA_NOTEQUAL; - break; - case GL_GEQUAL: - current->hwAlpha |= SiS_ALPHA_GEQUAL; - break; - case GL_ALWAYS: - current->hwAlpha |= SiS_ALPHA_ALWAYS; - break; - } - - prev->hwAlpha = current->hwAlpha; - hwcx->GlobalFlag |= GFLAG_ALPHASETTING; -} - -void -sis_BlendEquation (GLcontext * ctx, GLenum mode) -{ - /* version 1.2 specific */ - /* TODO: 300 don't support, fall back? */ -} - -void -sis_BlendFunc (GLcontext * ctx, GLenum sfactor, GLenum dfactor) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - /* TODO: in ICD, if no blend, it will reset these value */ - /* blending enable */ - current->hwDstSrcBlend = 0x10000; /* Default destination alpha */ - - switch (dfactor) - { - case GL_ZERO: - current->hwDstSrcBlend |= SiS_D_ZERO; - break; - case GL_ONE: - current->hwDstSrcBlend |= SiS_D_ONE; - break; - case GL_SRC_COLOR: - current->hwDstSrcBlend |= SiS_D_SRC_COLOR; - break; - case GL_ONE_MINUS_SRC_COLOR: - current->hwDstSrcBlend |= SiS_D_ONE_MINUS_SRC_COLOR; - break; - case GL_SRC_ALPHA: - current->hwDstSrcBlend |= SiS_D_SRC_ALPHA; - break; - case GL_ONE_MINUS_SRC_ALPHA: - current->hwDstSrcBlend |= SiS_D_ONE_MINUS_SRC_ALPHA; - break; - case GL_DST_ALPHA: - current->hwDstSrcBlend |= SiS_D_DST_ALPHA; - break; - case GL_ONE_MINUS_DST_ALPHA: - current->hwDstSrcBlend |= SiS_D_ONE_MINUS_DST_ALPHA; - break; - } - - switch (sfactor) - { - case GL_ZERO: - current->hwDstSrcBlend |= SiS_S_ZERO; - break; - case GL_ONE: - current->hwDstSrcBlend |= SiS_S_ONE; - break; - case GL_SRC_ALPHA: - current->hwDstSrcBlend |= SiS_S_SRC_ALPHA; - break; - case GL_ONE_MINUS_SRC_ALPHA: - current->hwDstSrcBlend |= SiS_S_ONE_MINUS_SRC_ALPHA; - break; - case GL_DST_ALPHA: - current->hwDstSrcBlend |= SiS_S_DST_ALPHA; - break; - case GL_ONE_MINUS_DST_ALPHA: - current->hwDstSrcBlend |= SiS_S_ONE_MINUS_DST_ALPHA; - break; - case GL_DST_COLOR: - current->hwDstSrcBlend |= SiS_S_DST_COLOR; - break; - case GL_ONE_MINUS_DST_COLOR: - current->hwDstSrcBlend |= SiS_S_ONE_MINUS_DST_COLOR; - break; - case GL_SRC_ALPHA_SATURATE: - current->hwDstSrcBlend |= SiS_S_SRC_ALPHA_SATURATE; - break; - } - - if (current->hwDstSrcBlend ^ prev->hwDstSrcBlend) - { - prev->hwDstSrcBlend = current->hwDstSrcBlend; - hwcx->GlobalFlag |= GFLAG_DSTBLEND; - } -} - -void -sis_BlendFuncSeparate (GLcontext * ctx, GLenum sfactorRGB, - GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA) -{ -} - -void -sis_CullFace (GLcontext * ctx, GLenum mode) -{ -#ifdef SIS_USE_HW_CULL - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - hwcx->AGPParseSet &= ~0x00008000; - hwcx->dwPrimitiveSet &= ~0x08000000; - - /* TODO : GL_FRONT_AND_BACK must be handled elsewhere */ - if((mode == GL_FRONT && ctx->Polygon.FrontFace == GL_CCW) || - (mode == GL_BACK && ctx->Polygon.FrontFace == GL_CW)) - { - hwcx->AGPParseSet |= 0x00008000; - hwcx->dwPrimitiveSet |= 0x08000000; - } -#endif -} - -void -sis_FrontFace (GLcontext * ctx, GLenum mode) -{ -#ifdef SIS_USE_HW_CULL - sis_CullFace (ctx, ctx->Polygon.CullFaceMode); -#endif -} - -void -sis_DepthFunc (GLcontext * ctx, GLenum func) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - GLuint hwZFunc = 0; - - switch (func) - { - case GL_LESS: - hwZFunc = SiS_Z_COMP_S_LT_B; - break; - case GL_GEQUAL: - hwZFunc = SiS_Z_COMP_S_GE_B; - break; - case GL_LEQUAL: - hwZFunc = SiS_Z_COMP_S_LE_B; - break; - case GL_GREATER: - hwZFunc = SiS_Z_COMP_S_GT_B; - break; - case GL_NOTEQUAL: - hwZFunc = SiS_Z_COMP_S_NE_B; - break; - case GL_EQUAL: - hwZFunc = SiS_Z_COMP_S_EQ_B; - break; - case GL_ALWAYS: - hwZFunc = SiS_Z_COMP_ALWAYS; - break; - case GL_NEVER: - hwZFunc = SiS_Z_COMP_NEVER; - break; - } - current->hwZ &= ~MASK_ZTestMode; - current->hwZ |= hwZFunc; - - if (current->hwZ ^ prev->hwZ) - { - prev->hwZ = current->hwZ; - - hwcx->GlobalFlag |= GFLAG_ZSETTING; - } -} - -void -sis_DepthMask (GLcontext * ctx, GLboolean flag) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - if (ctx->Visual->StencilBits) - { - if (flag || ctx->Stencil.WriteMask) - { - current->hwCapEnable |= MASK_ZWriteEnable; - if (flag && ctx->Stencil.WriteMask == 0xff) - { - current->hwCapEnable2 &= ~MASK_ZMaskWriteEnable; - } - else - { - current->hwCapEnable2 |= MASK_ZMaskWriteEnable; - current->hwZMask = ((DWORD) ctx->Stencil.WriteMask << 24) | - ((flag) ? 0x00ffffff : 0); - - if (current->hwZMask ^ prev->hwZMask) - { - prev->hwZMask = current->hwZMask; - hwcx->GlobalFlag |= GFLAG_ZSETTING; - } - } - } - else - { - current->hwCapEnable &= ~MASK_ZWriteEnable; - } - } - else - { - if (flag) - { - current->hwCapEnable |= MASK_ZWriteEnable; - current->hwCapEnable2 &= ~MASK_ZMaskWriteEnable; - } - else - { - current->hwCapEnable &= ~MASK_ZWriteEnable; - } - } -} - -void -sis_DepthRange (GLcontext * ctx, GLclampd nearval, GLclampd farval) -{ - /* mesa handles it? */ -} - -void -sis_Enable (GLcontext * ctx, GLenum cap, GLboolean state) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *current = &hwcx->current; - - switch (cap) - { - case GL_ALPHA_TEST: - if (state) - { - current->hwCapEnable |= MASK_AlphaTestEnable; - } - else - { - current->hwCapEnable &= ~MASK_AlphaTestEnable; - } - break; -/* - case GL_AUTO_NORMAL: - break; -*/ - case GL_BLEND: - /* TODO: */ - if(state) - /* if (state & !ctx->Color.ColorLogicOpEnabled) */ - { - current->hwCapEnable |= MASK_BlendEnable; - } - else - { - current->hwCapEnable &= ~MASK_BlendEnable; - } - break; -/* - case GL_CLIP_PLANE0: - case GL_CLIP_PLANE1: - case GL_CLIP_PLANE2: - case GL_CLIP_PLANE3: - case GL_CLIP_PLANE4: - case GL_CLIP_PLANE5: - break; - case GL_COLOR_MATERIAL: - break; -*/ - case GL_CULL_FACE: -#ifdef SIS_USE_HW_CULL - if (state) - { - current->hwCapEnable |= MASK_CullEnable; - } - else - { - current->hwCapEnable &= ~MASK_CullEnable; - } -#endif - break; - case GL_DEPTH_TEST: - if (state && xmesa->xm_buffer->depthbuffer) - { - current->hwCapEnable |= MASK_ZTestEnable; - } - else - { - current->hwCapEnable &= ~MASK_ZTestEnable; - } - break; - case GL_DITHER: - if (state) - { - current->hwCapEnable |= MASK_DitherEnable; - } - else - { - current->hwCapEnable &= ~MASK_DitherEnable; - } - break; -/* - case GL_FOG: - break; - case GL_LIGHT0: - case GL_LIGHT1: - case GL_LIGHT2: - case GL_LIGHT3: - case GL_LIGHT4: - case GL_LIGHT5: - case GL_LIGHT6: - case GL_LIGHT7: - break; - case GL_LIGHTING: - break; - case GL_LINE_SMOOTH: - break; - case GL_LINE_STIPPLE: - break; - case GL_INDEX_LOGIC_OP: - break; -*/ - case GL_COLOR_LOGIC_OP: - if (state) - { - sis_LogicOp (ctx, ctx->Color.LogicOp); - } - else - { - sis_LogicOp (ctx, GL_COPY); - } - break; -/* - case GL_MAP1_COLOR_4: - break; - case GL_MAP1_INDEX: - break; - case GL_MAP1_NORMAL: - break; - case GL_MAP1_TEXTURE_COORD_1: - break; - case GL_MAP1_TEXTURE_COORD_2: - break; - case GL_MAP1_TEXTURE_COORD_3: - break; - case GL_MAP1_TEXTURE_COORD_4: - break; - case GL_MAP1_VERTEX_3: - break; - case GL_MAP1_VERTEX_4: - break; - case GL_MAP2_COLOR_4: - break; - case GL_MAP2_INDEX: - break; - case GL_MAP2_NORMAL: - break; - case GL_MAP2_TEXTURE_COORD_1: - break; - case GL_MAP2_TEXTURE_COORD_2: - break; - case GL_MAP2_TEXTURE_COORD_3: - break; - case GL_MAP2_TEXTURE_COORD_4: - break; - case GL_MAP2_VERTEX_3: - break; - case GL_MAP2_VERTEX_4: - break; - case GL_NORMALIZE: - break; - case GL_POINT_SMOOTH: - break; - case GL_POLYGON_SMOOTH: - break; - case GL_POLYGON_STIPPLE: - break; - case GL_POLYGON_OFFSET_POINT: - break; - case GL_POLYGON_OFFSET_LINE: - break; - case GL_POLYGON_OFFSET_FILL: - case GL_POLYGON_OFFSET_EXT: - break; - case GL_RESCALE_NORMAL_EXT: - break; -*/ - case GL_SCISSOR_TEST: - sis_set_scissor (ctx); - break; -/* - case GL_SHARED_TEXTURE_PALETTE_EXT: - break; -*/ - case GL_STENCIL_TEST: - if (state) - { - current->hwCapEnable |= (MASK_StencilTestEnable | - MASK_StencilWriteEnable); - } - else - { - current->hwCapEnable &= ~(MASK_StencilTestEnable | - MASK_StencilWriteEnable); - } - break; -/* - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_TEXTURE_3D: - break; - case GL_TEXTURE_GEN_Q: - break; - case GL_TEXTURE_GEN_R: - break; - case GL_TEXTURE_GEN_S: - break; - case GL_TEXTURE_GEN_T: - break; - - case GL_VERTEX_ARRAY: - break; - case GL_NORMAL_ARRAY: - break; - case GL_COLOR_ARRAY: - break; - case GL_INDEX_ARRAY: - break; - case GL_TEXTURE_COORD_ARRAY: - break; - case GL_EDGE_FLAG_ARRAY: - break; -*/ - } -} - -void -sis_Hint (GLcontext * ctx, GLenum target, GLenum mode) -{ -#if 0 - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - __GLSiSHardware *current = &hwcx->current; -#endif - - switch (target) - { - case GL_FOG_HINT: - switch (mode) - { - case GL_DONT_CARE: - break; - case GL_FASTEST: - /* vertex fog */ - /* TODO */ - break; - case GL_NICEST: - /* pixel fog */ - break; - } - break; - case GL_LINE_SMOOTH_HINT: - break; - case GL_PERSPECTIVE_CORRECTION_HINT: -#if 0 - if (mode == GL_NICEST) - current->hwCapEnable |= MASK_TexturePerspectiveEnable; - else if (!(ctx->RasterMask & FOG_BIT)) - current->hwCapEnable &= ~MASK_TexturePerspectiveEnable; -#endif - break; - case GL_POINT_SMOOTH_HINT: - break; - case GL_POLYGON_SMOOTH_HINT: - break; - } -} - -void -sis_Lightfv (GLcontext * ctx, GLenum light, - GLenum pname, const GLfloat * params, GLint nparams) -{ -} - -void -sis_LightModelfv (GLcontext * ctx, GLenum pname, const GLfloat * params) -{ -} - -void -sis_PolygonMode (GLcontext * ctx, GLenum face, GLenum mode) -{ -} - -void -sis_Scissor (GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ - if (ctx->Scissor.Enabled) - sis_set_scissor (ctx); -} - -void -sis_ShadeModel (GLcontext * ctx, GLenum mode) -{ -} - -void -sis_Viewport (GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ -} - -void -sis_ClearColor (GLcontext * ctx, GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - set_color_pattern (hwcx, red, green, blue, alpha); - -} - -/* TODO */ -void -sis_ClearIndex (GLcontext * ctx, GLuint index) -{ -} - -void sis_set_render_pos(GLcontext * ctx, GLubyte *base, GLuint pitch) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - assert (base != NULL); - - if (SIS_VERBOSE&VERBOSE_SIS_BUFFER){ - fprintf(stderr, "set drawing position: base=%lx, pitch=%lu\n", - (long)base, (long)pitch); - } - - /* software render */ - hwcx->swRenderBase = base; - hwcx->swRenderPitch = pitch; - - current->hwOffsetDest = ((DWORD) base - (DWORD) GET_FbBase (hwcx)) >> 1; - current->hwDstSet &= ~MASK_DstBufferPitch; - current->hwDstSet |= pitch >> 2; - - /* destination setting */ - if (current->hwDstSet ^ prev->hwDstSet) - { - prev->hwDstSet = current->hwDstSet; - hwcx->GlobalFlag |= GFLAG_DESTSETTING; - } - - if (current->hwOffsetDest ^ prev->hwOffsetDest) - { - prev->hwOffsetDest = current->hwOffsetDest; - hwcx->GlobalFlag |= GFLAG_DESTSETTING; - } -} - -GLboolean -sis_SetDrawBuffer (GLcontext * ctx, GLenum mode) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - XMesaBuffer xm_buffer = xmesa->xm_buffer; - GLubyte *base; - GLuint pitch; - GLboolean retval = GL_FALSE; - - /* if new context bind, the function will be call? */ - switch (mode) - { - case GL_BACK_LEFT: - base = (GLubyte *) xm_buffer->backimage->data; - pitch = xm_buffer->backimage->bytes_per_line; - - retval = GL_TRUE; - break; - case GL_FRONT_LEFT: - base = sis_get_drawable_pos (xmesa); - pitch = GET_PITCH (hwcx); - retval = GL_TRUE; - break; - case GL_BACK_RIGHT: - case GL_FRONT_RIGHT: - default: - assert (0); - return GL_FALSE; - } - - sis_set_render_pos(ctx, base, pitch); - - return retval; -} - -void -sis_SetReadBuffer (GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum buffer) -{ - /* TODO */ -} - -GLboolean -sis_ColorMask (GLcontext * ctx, - GLboolean rmask, GLboolean gmask, - GLboolean bmask, GLboolean amask) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - - if (rmask & gmask & bmask & - (!ctx->Visual->AlphaBits | amask)) - { - current->hwCapEnable2 &= ~(MASK_AlphaMaskWriteEnable | - MASK_ColorMaskWriteEnable); - } - else - { - current->hwCapEnable2 |= (MASK_AlphaMaskWriteEnable | - MASK_ColorMaskWriteEnable); - - current->hwDstMask = (rmask) ? GET_RMASK (hwcx) : 0 | - (gmask) ? GET_GMASK (hwcx) : 0 | - (bmask) ? GET_BMASK (hwcx) : 0 | - (amask) ? GET_AMASK (hwcx) : 0; - } - - if (current->hwDstMask ^ prev->hwDstMask) - { - prev->hwDstMask = current->hwDstMask; - hwcx->GlobalFlag |= GFLAG_DESTSETTING; - } - - return GL_TRUE; -} - -GLboolean -sis_LogicOp (GLcontext * ctx, GLenum op) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - if (ctx->Color.ColorLogicOpEnabled) - { - current->hwDstSet &= ~MASK_ROP2; - switch (op) - { - case GL_CLEAR: - current->hwDstSet |= LOP_CLEAR; - break; - case GL_SET: - current->hwDstSet |= LOP_SET; - break; - case GL_COPY: - current->hwDstSet |= LOP_COPY; - break; - case GL_COPY_INVERTED: - current->hwDstSet |= LOP_COPY_INVERTED; - break; - case GL_NOOP: - current->hwDstSet |= LOP_NOOP; - break; - case GL_INVERT: - current->hwDstSet |= LOP_INVERT; - break; - case GL_AND: - current->hwDstSet |= LOP_AND; - break; - case GL_NAND: - current->hwDstSet |= LOP_NAND; - break; - case GL_OR: - current->hwDstSet |= LOP_OR; - break; - case GL_NOR: - current->hwDstSet |= LOP_NOR; - break; - case GL_XOR: - current->hwDstSet |= LOP_XOR; - break; - case GL_EQUIV: - current->hwDstSet |= LOP_EQUIV; - break; - case GL_AND_REVERSE: - current->hwDstSet |= LOP_AND_REVERSE; - break; - case GL_AND_INVERTED: - current->hwDstSet |= LOP_AND_INVERTED; - break; - case GL_OR_REVERSE: - current->hwDstSet |= LOP_OR_REVERSE; - break; - case GL_OR_INVERTED: - current->hwDstSet |= LOP_OR_INVERTED; - break; - } - - if (current->hwDstSet ^ prev->hwDstSet) - { - prev->hwDstSet = current->hwDstSet; - hwcx->GlobalFlag |= GFLAG_DESTSETTING; - } - } - return GL_TRUE; -} - -void -sis_Dither (GLcontext * ctx, GLboolean enable) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *current = &hwcx->current; - - if (enable) - { - current->hwCapEnable |= MASK_DitherEnable; - } - else - { - current->hwCapEnable &= ~MASK_DitherEnable; - } -} - -GLint -sis_GetParameteri (const GLcontext * ctx, GLint param) -{ - switch (param) - { - case DD_HAVE_HARDWARE_FOG: - /* - * fragment fogging is not free when compared with hardware - * vertex fogging because of the overhead of W - */ - return 0; -/* - case DD_MAX_TEXTURE_SIZE: - return SIS_MAX_TEXTURE_SIZE; - case DD_MAX_TEXTURES: - return SIS_MAX_TEXTURES; -*/ - } - return 0; -} - -/* just sync between CPU and rendering-engine */ -GLboolean sis_DrawPixels (GLcontext * ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid * pixels) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - WaitEngIdle (hwcx); - return 0; -} - -GLboolean sis_Bitmap (GLcontext * ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte * bitmap) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - ctx->Driver.RenderStart( ctx ); - - WaitEngIdle (hwcx); - /* TODO: use tdfx's Bitmap */ - - ctx->Driver.RenderFinish( ctx ); - - return 0; -} - -void -set_color_pattern (__GLSiScontext * hwcx, GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha) -{ - /* XXX only RGB565 and ARGB8888 */ - switch (GET_ColorFormat (hwcx)) - { - case DST_FORMAT_ARGB_8888: - hwcx->clearColorPattern = (alpha << 24) + - (red << 16) + (green << 8) + (blue); - break; - case DST_FORMAT_RGB_565: - hwcx->clearColorPattern = ((red >> 3) << 11) + - ((green >> 2) << 5) + (blue >> 3); - hwcx->clearColorPattern |= hwcx->clearColorPattern << 16; - break; - default: - assert (0); - } -} - -void -set_z_stencil_pattern (__GLSiScontext * hwcx, GLclampd z, int stencil) -{ - GLuint zPattern, stencilPattern; - GLboolean dword_pattern; - - if (z <= (float) 0.0) - zPattern = 0x0; - else if (z >= (float) 1.0) - zPattern = 0xFFFFFFFF; - else - zPattern = doFPtoFixedNoRound (*(DWORD *) & z, 32); - - stencilPattern = 0; - - switch (hwcx->zFormat) - { - case Z_16: - zPattern = zPattern >> 16; - zPattern &= 0x0000FFFF; - dword_pattern = GL_FALSE; - break; - case S_8_Z_24: - zPattern = zPattern >> 8; - zPattern &= 0x00FFFFFF; - stencilPattern = (stencilPattern << 24); - dword_pattern = GL_TRUE; - break; - case Z_32: - dword_pattern = GL_TRUE; - break; - default: - assert (0); - } - hwcx->clearZStencilPattern = zPattern | stencilPattern; - /* ?? */ - if (!dword_pattern) - hwcx->clearZStencilPattern |= (zPattern | stencilPattern) << 16; -} - -void -sis_update_drawable_state (GLcontext * ctx) -{ - const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *current = &hwcx->current; - __GLSiSHardware *prev = &hwcx->prev; - - XMesaBuffer xm_buffer = xmesa->xm_buffer; - GLuint z_depth; - - sis_SetDrawBuffer (ctx, ctx->Color.DriverDrawBuffer); - /* TODO: call sis_SetReadBuffer? */ - - switch (hwcx->zFormat) - { - case Z_16: - z_depth = 2; - break; - case Z_32: - case S_8_Z_24: - z_depth = 4; - break; - default: - assert (0); - } - - current->hwZ &= ~MASK_ZBufferPitch; - current->hwZ |= xm_buffer->width * z_depth >> 2; - /* TODO, in xfree 3.9.18, no ctx->Buffer */ - current->hwOffsetZ = ((DWORD) (xm_buffer->depthbuffer) - - (DWORD) GET_FbBase (hwcx)) >> 2; - - if ((current->hwOffsetZ ^ prev->hwOffsetZ) - || (current->hwZ ^ prev->hwZ)) - { - prev->hwOffsetZ = current->hwOffsetZ; - prev->hwZ = current->hwZ; - - /* Z setting */ - hwcx->GlobalFlag |= GFLAG_ZSETTING; - } -} - -void -sis_GetBufferSize (GLframebuffer *buffer, GLuint * width, GLuint * height) -{ - GET_CURRENT_CONTEXT(ctx); - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *current = &hwcx->current; - __GLSiSHardware *prev = &hwcx->prev; - - GLuint winwidth, winheight; - XMesaBuffer xm_buffer = xmesa->xm_buffer; - -#ifndef XFree86Server - SIS_VALIDATE_DRAWABLE_INFO (xmesa->display, - xmesa->driContextPriv->driScreenPriv, - xmesa->driContextPriv->driDrawablePriv); -#endif - sis_get_drawable_size (xmesa, &winwidth, &winheight); - - *width = winwidth; - *height = winheight; - - if (winwidth != xm_buffer->width || winheight != xm_buffer->height) - { - GLuint z_depth; - - if (SIS_VERBOSE&VERBOSE_SIS_BUFFER) - { - fprintf(stderr, "GetBufferSize: before=(%d,%d), after=(%d,%d)\n", - xm_buffer->width, xm_buffer->height, winwidth, winheight); - } - - xm_buffer->width = winwidth; - xm_buffer->height = winheight; - - /* update hwcx->isFullScreen */ - /* TODO: Does X-server have exclusive-mode? */ - /* TODO: physical screen width/height will be changed dynamicly */ - -#if SIS_STEREO - if((hwcx->virtualX == winwidth) && (hwcx->virtualY == winheight)) - hwcx->isFullScreen = GL_TRUE; - else - hwcx->isFullScreen = GL_FALSE; -#endif - - if (xm_buffer->db_state) - { - sisBufferInfo *priv = (sisBufferInfo *) xm_buffer->private; - - sis_alloc_back_image (ctx, xm_buffer->backimage, &priv->bbFree, - &priv->cbClearPacket); - } - - if (ctx->Visual->DepthBits) - sis_alloc_z_stencil_buffer (ctx); - - switch (hwcx->zFormat) - { - case Z_16: - z_depth = 2; - break; - case Z_32: - case S_8_Z_24: - z_depth = 4; - break; - default: - assert (0); - } - - sis_SetDrawBuffer (ctx, ctx->Color.DriverDrawBuffer); - /* TODO: call sis_SetReadBuffer? */ - - current->hwZ &= ~MASK_ZBufferPitch; - current->hwZ |= xm_buffer->width * z_depth >> 2; - /* TODO, in xfree 3.9.18, no ctx->Buffer */ - current->hwOffsetZ = ((DWORD) (xm_buffer->depthbuffer) - - (DWORD) GET_FbBase (hwcx)) >> 2; - - if ((current->hwOffsetZ ^ prev->hwOffsetZ) - || (current->hwZ ^ prev->hwZ)) - { - prev->hwOffsetZ = current->hwOffsetZ; - prev->hwZ = current->hwZ; - - /* Z setting */ - hwcx->GlobalFlag |= GFLAG_ZSETTING; - } - } - - /* Needed by Y_FLIP macro */ - xm_buffer->bottom = (int) winheight - 1; - - sis_set_scissor (ctx); -} - -const GLubyte * -sis_GetString (GLcontext * ctx, GLenum name) -{ - (void) ctx; - - switch (name) - { - case GL_RENDERER: -#ifdef XFree86Server - return (GLubyte *)"SIS 300/630/530 IR Mode"; -#else - return (GLubyte *)"SiS 300/630/530 DR Mode"; -#endif - default: - return NULL; - } -} - -const char * -sis_ExtensionString (GLcontext * ctx) -{ - return NULL; -} - -void -sis_set_scissor (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - GLint x1, y1, x2, y2; - - /* ?? from context.c, do it 2 times */ - - x1 = 0; - y1 = 0; - x2 = xmesa->xm_buffer->width - 1; - y2 = xmesa->xm_buffer->height - 1; - - if (ctx->Scissor.Enabled) - { - if (ctx->Scissor.X > x1) - { - x1 = ctx->Scissor.X; - } - if (ctx->Scissor.Y > y1) - { - y1 = ctx->Scissor.Y; - } - if (ctx->Scissor.X + ctx->Scissor.Width - 1 < x2) - { - x2 = ctx->Scissor.X + ctx->Scissor.Width - 1; - } - if (ctx->Scissor.Y + ctx->Scissor.Height - 1 < y2) - { - y2 = ctx->Scissor.Y + ctx->Scissor.Height - 1; - } - } - - y1 = Y_FLIP (y1); - y2 = Y_FLIP (y2); - - current->clipTopBottom = (y2 << 13) | y1; - current->clipLeftRight = (x1 << 13) | x2; - - if ((current->clipTopBottom ^ prev->clipTopBottom) || - (current->clipLeftRight ^ prev->clipLeftRight)) - { - prev->clipTopBottom = current->clipTopBottom; - prev->clipLeftRight = current->clipLeftRight; - hwcx->GlobalFlag |= GFLAG_CLIPPING; - } -} Index: xc/lib/GL/mesa/src/drv/sis/sis_mesa.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_mesa.h:1.4 xc/lib/GL/mesa/src/drv/sis/sis_mesa.h:removed --- xc/lib/GL/mesa/src/drv/sis/sis_mesa.h:1.4 Wed Oct 30 07:52:00 2002 +++ xc/lib/GL/mesa/src/drv/sis/sis_mesa.h Sat Feb 28 21:41:18 2004 @@ -1,235 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_mesa.h,v 1.4 2002/10/30 12:52:00 alanh Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#ifndef _sis_mesa_h_ -#define _sis_mesa_h_ - -void sis_UpdateState (GLcontext * ctx); -void sis_ClearIndex (GLcontext * ctx, GLuint index); -void sis_ClearColor (GLcontext * ctx, GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha); -GLbitfield sis_Clear (GLcontext * ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height); -GLboolean sis_SetDrawBuffer (GLcontext * ctx, GLenum mode); -void sis_SetReadBuffer (GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum buffer); -void sis_GetBufferSize (GLframebuffer * buffer, GLuint * width, GLuint * height); -const char *sis_ExtensionString (GLcontext * ctx); -const GLubyte *sis_GetString (GLcontext * ctx, GLenum name); -void sis_Finish (GLcontext * ctx); -void sis_Flush (GLcontext * ctx); -GLboolean sis_IndexMask (GLcontext * ctx, GLuint mask); -GLboolean sis_ColorMask (GLcontext * ctx, - GLboolean rmask, GLboolean gmask, - GLboolean bmask, GLboolean amask); -GLboolean sis_LogicOp (GLcontext * ctx, GLenum op); -void sis_Dither (GLcontext * ctx, GLboolean enable); -void sis_Error (GLcontext * ctx); -void sis_NearFar (GLcontext * ctx, GLfloat nearVal, GLfloat farVal); -GLint sis_GetParameteri (const GLcontext * ctx, GLint param); -GLboolean sis_DrawPixels (GLcontext * ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid * pixels); -GLboolean sis_Bitmap (GLcontext * ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte * bitmap); -void sis_RenderStart (GLcontext * ctx); -void sis_RenderFinish (GLcontext * ctx); - -typedef void (*sis_setup_func_t)(struct vertex_buffer *, GLuint, GLuint); -sis_setup_func_t sis_ChooseRasterSetupFunc (GLcontext * ctx); - -void sis_ReducedPrimitiveChange (GLcontext * ctx, GLenum primitive); -GLboolean sis_MultipassFunc (struct vertex_buffer *VB, GLuint passno); - -/* - * Texture - */ -void sis_validate_texture (GLcontext * ctx); - -void sis_TexEnv( GLcontext *ctx, GLenum target, GLenum pname, - const GLfloat *param ); - -void sis_TexImage (GLcontext * ctx, GLenum target, - struct gl_texture_object *tObj, GLint level, - GLint internalFormat, - const struct gl_texture_image *image); - -void sis_TexSubImage (GLcontext * ctx, GLenum target, - struct gl_texture_object *tObj, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLint internalFormat, - const struct gl_texture_image *image); - -void sis_TexParameter (GLcontext * ctx, GLenum target, - struct gl_texture_object *tObj, - GLenum pname, const GLfloat * params); - -void sis_BindTexture (GLcontext * ctx, GLenum target, - struct gl_texture_object *tObj); - -void sis_DeleteTexture (GLcontext * ctx, struct gl_texture_object *tObj); - -void sis_UpdateTexturePalette (GLcontext * ctx, - struct gl_texture_object *tObj); - -void sis_UseGlobalTexturePalette (GLcontext * ctx, GLboolean state); - -void sis_ActiveTexture (GLcontext * ctx, GLuint texUnitNumber); - -GLboolean sis_IsTextureResident (GLcontext * ctx, - struct gl_texture_object *t); -void sis_PrioritizeTexture (GLcontext * ctx, - struct gl_texture_object *t, GLclampf priority); - -/* - * Optimization - */ -void sis_RegisterVB (struct vertex_buffer *VB); -void sis_UnregisterVB (struct vertex_buffer *VB); -void sis_ResetVB (struct vertex_buffer *VB); -void sis_ResetCvaVB (struct vertex_buffer *VB, GLuint stages); -GLuint sis_RegisterPipelineStages (struct gl_pipeline_stage *out, - const struct gl_pipeline_stage *in, - GLuint nr); -GLboolean sis_BuildPrecalcPipeline (GLcontext * ctx); -GLboolean sis_BuildEltPipeline (GLcontext * ctx); -void sis_OptimizePrecalcPipeline (GLcontext * ctx, struct gl_pipeline *pipe); -void sis_OptimizeImmediatePipeline (GLcontext * ctx, - struct gl_pipeline *pipe); - -/* - * State-Change - */ -void sis_AlphaFunc (GLcontext * ctx, GLenum func, GLclampf ref); -void sis_BlendEquation (GLcontext * ctx, GLenum mode); -void sis_BlendFunc (GLcontext * ctx, GLenum sfactor, GLenum dfactor); -void sis_BlendFuncSeparate (GLcontext * ctx, GLenum sfactorRGB, - GLenum dfactorRGB, GLenum sfactorA, - GLenum dfactorA); -void sis_ClearDepth (GLcontext * ctx, GLclampd d); -void sis_CullFace (GLcontext * ctx, GLenum mode); -void sis_FrontFace (GLcontext * ctx, GLenum mode); -void sis_DepthFunc (GLcontext * ctx, GLenum func); -void sis_DepthMask (GLcontext * ctx, GLboolean flag); -void sis_DepthRange (GLcontext * ctx, GLclampd nearval, GLclampd farval); -void sis_Enable (GLcontext * ctx, GLenum cap, GLboolean state); -void sis_Fogfv (GLcontext * ctx, GLenum pname, const GLfloat * params); -void sis_Hint (GLcontext * ctx, GLenum target, GLenum mode); -void sis_Lightfv (GLcontext * ctx, GLenum light, - GLenum pname, const GLfloat * params, GLint nparams); -void sis_LightModelfv (GLcontext * ctx, GLenum pname, const GLfloat * params); -void sis_PolygonMode (GLcontext * ctx, GLenum face, GLenum mode); -void sis_Scissor (GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h); -void sis_ShadeModel (GLcontext * ctx, GLenum mode); -void sis_ClearStencil (GLcontext * ctx, GLint s); -void sis_StencilFunc (GLcontext * ctx, GLenum func, GLint ref, GLuint mask); -void sis_StencilMask (GLcontext * ctx, GLuint mask); -void sis_StencilOp (GLcontext * ctx, GLenum fail, GLenum zfail, GLenum zpass); -void sis_Viewport (GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h); - -/* - * Buffer Allocation - */ -void sis_alloc_z_stencil_buffer (GLcontext * ctx); -void sis_free_z_stencil_buffer (XMesaBuffer buf); -void sis_alloc_back_image (GLcontext * ctx, XMesaImage *image, void **free, - ENGPACKET *packet); -void sis_free_back_image (XMesaBuffer buf, XMesaImage *image, void *free); -void sis_alloc_texture_image (GLcontext * ctx, GLtextureImage * image); -void sis_free_texture_image (GLtextureImage * image); - -/* - * Raster-Function Picker - */ -void sis_set_render_func (GLcontext * ctx); - -/* - * VB Rendering Function - */ -void sis_init_vbrender (void); -void sis_set_render_vb_tabs (GLcontext * ctx); - -/* - * Local - */ -void set_color_pattern (__GLSiScontext * hwcx, GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha); - -void set_z_stencil_pattern (__GLSiScontext * hwcx, GLclampd z, int stencil); - -void sis_init_driver (GLcontext * ctx); -void sis_sw_init_driver (GLcontext * ctx); -void sis_sw_set_zfuncs_static (GLcontext * ctx); - -void WaitEngIdle (__GLSiScontext * hwcx); -void Wait2DEngIdle (__GLSiScontext * hwcx); - -void sis_set_buffer_static (GLcontext * ctx); -void sis_set_render_pos(GLcontext * ctx, GLubyte *base, GLuint pitch); - -/* - * X window system Information - */ -#define sis_is_window(xmesa) (!((xmesa)->xm_buffer->pixmap_flag)) -GLboolean sis_get_clip_rects (XMesaContext xmesa, BoxPtr * ppExtents, - int *pCount); -void *sis_get_drawable_pos (XMesaContext xmesa); -void sis_get_drawable_origin (XMesaContext xmesa, GLuint * x, GLuint * y); -void sis_get_drawable_size (XMesaContext xmesa, GLuint * w, GLuint * h); -void sis_get_drawable_box (XMesaContext xmesa, BoxPtr pBox); - -/* GLX */ -void SiSCreateContext (XMesaContext xmesa); -void SiSDestroyContext (XMesaContext xmesa); -void sis_swap_buffers (XMesaBuffer b); -void SiSDestroyBuffer (XMesaBuffer buf); - -/* Profile */ -#ifndef SIS_DEBUG -# define SIS_VERBOSE 0 -#else -extern int SIS_VERBOSE; -#endif - -enum _sis_verbose { - VERBOSE_SIS_BUFFER = 0x1, - VERBOSE_SIS_MEMORY = 0x2 -}; - -#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_reg.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_reg.h:1.3 xc/lib/GL/mesa/src/drv/sis/sis_reg.h:1.5 --- xc/lib/GL/mesa/src/drv/sis/sis_reg.h:1.3 Tue Sep 26 11:56:48 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_reg.h Mon Dec 8 19:15:22 2003 @@ -1,6 +1,7 @@ /************************************************************************** Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a @@ -15,21 +16,21 @@ next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. +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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_reg.h,v 1.3 2000/09/26 15:56:48 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_reg.h,v 1.5 2003/12/09 00:15:22 alanh Exp $ */ /* * Authors: - * Sung-Ching Lin - * + * Sung-Ching Lin + * Eric Anholt */ #ifndef _sis_reg_h_ @@ -38,6 +39,9 @@ /* * Define All the Register Address of 6327 */ + +#define REG_CommandQueue 0x8240 + #define REG_3D_TSFSa 0x8800 #define REG_3D_TSZa 0x8804 #define REG_3D_TSXa 0x8808 @@ -213,196 +217,37 @@ #define REG_3D_TexturePalette 0x8C00 - -/* - * Define All the Register Address of 6327 - */ -#define X_REG_3D_TSFSa 0 -#define X_REG_3D_TSZa 4 -#define X_REG_3D_TSXa 8 -#define X_REG_3D_TSYa 12 -#define X_REG_3D_TSARGBa 16 -#define X_REG_3D_TSWGa 20 -#define X_REG_3D_TSUAa 24 -#define X_REG_3D_TSVAa 28 -#define X_REG_3D_TSUBa 32 -#define X_REG_3D_TSVBa 36 -#define X_REG_3D_TSUCa 40 -#define X_REG_3D_TSVCa 44 - -#define X_REG_3D_TSFSb 48 -#define X_REG_3D_TSZb 52 -#define X_REG_3D_TSXb 56 -#define X_REG_3D_TSYb 60 -#define X_REG_3D_TSARGBb 64 -#define X_REG_3D_TSWGb 68 -#define X_REG_3D_TSUAb 72 -#define X_REG_3D_TSVAb 76 -#define X_REG_3D_TSUBb 80 -#define X_REG_3D_TSVBb 84 -#define X_REG_3D_TSUCb 88 -#define X_REG_3D_TSVCb 92 - -#define X_REG_3D_TSFSc 96 -#define X_REG_3D_TSZc 100 -#define X_REG_3D_TSXc 104 -#define X_REG_3D_TSYc 108 -#define X_REG_3D_TSARGBc 112 -#define X_REG_3D_TSWGc 116 -#define X_REG_3D_TSUAc 120 -#define X_REG_3D_TSVAc 124 -#define X_REG_3D_TSUBc 128 -#define X_REG_3D_TSVBc 132 -#define X_REG_3D_TSUCc 136 -#define X_REG_3D_TSVCc 140 - -#define X_REG_3D_ParsingSet 176 -#define X_REG_3D_PrimitiveSet 180 -#define X_REG_3D_ShadeMode 180 -#define X_REG_3D_EngineFire 184 -#define X_REG_3D_EngineStatus 184 -#define X_REG_3D_TEnable 188 -#define X_REG_3D_TEnable2 192 - -#define X_REG_3D_ZSet 196 -#define X_REG_3D_ZBias 200 -#define X_REG_3D_ZStWriteMask 204 - -#define X_REG_3D_ZAddress 208 -#define X_REG_3D_AlphaSet 212 -#define X_REG_3D_AlphaAddress 216 -#define X_REG_3D_DstSet 220 -#define X_REG_3D_DstAlphaWriteMask 224 - -#define X_REG_3D_DstAddress 228 - -#define X_REG_3D_LinePattern 232 - -#define X_REG_3D_FogSet 236 -#define X_REG_3D_FogFarDistance 240 -#define X_REG_3D_FogInverseDistance 244 -#define X_REG_3D_FogFactorDensity 248 - -#define X_REG_3D_StencilSet 256 -#define X_REG_3D_StencilSet2 260 -#define X_REG_3D_StencilAddress 264 - -#define X_REG_3D_DstBlendMode 268 -#define X_REG_3D_SrcBlendMode 268 -#define X_REG_3D_ClipTopBottom 272 -#define X_REG_3D_ClipLeftRight 276 -#define X_REG_3D_Brightness 280 - -#define X_REG_3D_BumpMapSet 292 -#define X_REG_3D_BumpMapAddress 296 -#define X_REG_3D_BumpMapPitch 300 -#define X_REG_3D_BumpMapMatrix0 304 -#define X_REG_3D_BumpMapMatrix1 308 - - -/* - * Define the Texture Register Address of 6327 - */ -#define X_REG_3D_Texture0Set 312 -#define X_REG_3D_Texture0WidthHeight 312 -#define X_REG_3D_Texture0Set2 316 - -#define X_REG_3D_Texture0TransparencyColorHigh 320 -#define X_REG_3D_Texture0TransparencyColorLow 324 -#define X_REG_3D_Texture0BorderColor 328 -#define X_REG_3D_Texture0Address0 332 -#define X_REG_3D_Texture0Address1 336 -#define X_REG_3D_Texture0Address2 340 -#define X_REG_3D_Texture0Address3 344 -#define X_REG_3D_Texture0Address4 348 -#define X_REG_3D_Texture0Address5 352 -#define X_REG_3D_Texture0Address6 356 -#define X_REG_3D_Texture0Address7 360 -#define X_REG_3D_Texture0Address8 364 -#define X_REG_3D_Texture0Address9 368 -#define X_REG_3D_Texture0Address10 372 -#define X_REG_3D_Texture0Address11 376 -#define X_REG_3D_Texture0Pitch0 380 -#define X_REG_3D_Texture0Pitch1 380 -#define X_REG_3D_Texture0Pitch2 384 -#define X_REG_3D_Texture0Pitch3 384 -#define X_REG_3D_Texture0Pitch4 388 -#define X_REG_3D_Texture0Pitch5 388 -#define X_REG_3D_Texture0Pitch6 392 -#define X_REG_3D_Texture0Pitch7 392 -#define X_REG_3D_Texture0Pitch8 396 -#define X_REG_3D_Texture0Pitch9 396 -#define X_REG_3D_Texture0Pitch10 400 - -#define X_REG_3D_Texture1Set 408 -#define X_REG_3D_Texture1WidthHeight 408 -#define X_REG_3D_Texture1Set2 412 - -#define X_REG_3D_Texture1TransparencyColorHigh 416 -#define X_REG_3D_Texture1TransparencyColorLow 420 -#define X_REG_3D_Texture1BorderColor 424 -#define X_REG_3D_Texture1Address0 428 -#define X_REG_3D_Texture1Address1 432 -#define X_REG_3D_Texture1Address2 436 -#define X_REG_3D_Texture1Address3 440 -#define X_REG_3D_Texture1Address4 444 -#define X_REG_3D_Texture1Address5 448 -#define X_REG_3D_Texture1Address6 452 -#define X_REG_3D_Texture1Address7 456 -#define X_REG_3D_Texture1Address8 460 -#define X_REG_3D_Texture1Address9 464 -#define X_REG_3D_Texture1Address10 468 -#define X_REG_3D_Texture1Address11 472 -#define X_REG_3D_Texture1Pitch0 476 -#define X_REG_3D_Texture1Pitch1 476 -#define X_REG_3D_Texture1Pitch2 480 -#define X_REG_3D_Texture1Pitch3 480 -#define X_REG_3D_Texture1Pitch4 484 -#define X_REG_3D_Texture1Pitch5 484 -#define X_REG_3D_Texture1Pitch6 488 -#define X_REG_3D_Texture1Pitch7 488 -#define X_REG_3D_Texture1Pitch8 492 -#define X_REG_3D_Texture1Pitch9 492 -#define X_REG_3D_Texture1Pitch10 496 - -#define X_REG_3D_TextureBlendFactor 504 -#define X_REG_3D_TextureColorBlendSet0 508 -#define X_REG_3D_TextureColorBlendSet1 512 -#define X_REG_3D_TextureAlphaBlendSet0 516 -#define X_REG_3D_TextureAlphaBlendSet1 520 - /* - * Define the End of Primitive List of 6326 + * REG_CommandQueue -- (8240h-8243h) */ -#define X_REG_3D_EndPrimitiveList 524 - - -/* - * Define the Stipple Register Address of 6326 - */ -#define X_REG_3D_Stipple0 540 - -#define X_REG_3D_TexturePalette 1520 - +#define MASK_QueueLen 0x0000ffff +#define SiS_EngIdle2d 0x80000000 +#define SiS_EngIdle 0xe0000000 +#define MASK_EngState 0xf0000000 /* * REG_3D_ParsingSet -- Define Parsing Mask (89F4h-89F7h) */ -#define MASK_VertexDWSize 0xF0000000 -#define MASK_VertexDataFormat 0x0FFF0000 -#define MASK_PsVertex_HAS_RHW 0x08000000 -#define MASK_PsVertex_HAS_NORMALXYZ 0x04000000 -#define MASK_PsVertex_HAS_DIFFUSE 0x02000000 -#define MASK_PsVertex_HAS_SPECULAR 0x01000000 -#define MASK_PsUVSet 0x00FF0000 -#define MASK_PsVertex_HAS_1SetUV 0x00800000 -#define MASK_PsVertex_HAS_2SetUV 0x00C00000 -#define MASK_PsVertex_HAS_3SetUV 0x00E00000 -#define MASK_PsVertex_HAS_UVSet1 0x00800000 -#define MASK_PsVertex_HAS_UVSet2 0x00400000 -#define MASK_PsVertex_HAS_UVSet3 0x00200000 -#define MASK_PsCullDirection_CCW 0x00008000 -#define MASK_PsShadingMode 0x00007000 +#define MASK_VertexDWSize 0xF0000000 +#define MASK_VertexDataFormat 0x0FFF0000 +#define MASK_PsVertex_HAS_RHW 0x08000000 +#define MASK_PsVertex_HAS_NORMALXYZ 0x04000000 +#define MASK_PsVertex_HAS_DIFFUSE 0x02000000 +#define MASK_PsVertex_HAS_SPECULAR 0x01000000 +#define MASK_PsUVSet 0x00FF0000 +#define MASK_PsVertex_HAS_1SetUV 0x00800000 +#define MASK_PsVertex_HAS_2SetUV 0x00C00000 +#define MASK_PsVertex_HAS_3SetUV 0x00E00000 +#define MASK_PsVertex_HAS_UVSet1 0x00800000 +#define MASK_PsVertex_HAS_UVSet2 0x00400000 +#define MASK_PsVertex_HAS_UVSet3 0x00200000 +#define MASK_PsCullDirection_CCW 0x00008000 +#define MASK_PsShadingMode 0x00007000 +/* XXX Shading modes just a guess, but seem to work*/ +#define MASK_PsShadingFlatA 0x00001000 +#define MASK_PsShadingFlatB 0x00002000 +#define MASK_PsShadingFlatC 0x00003000 +#define MASK_PsShadingSmooth 0x00004000 #define MASK_PsTextureFrom 0x000003F0 #define MASK_PsTexture0FromA 0x00000000 #define MASK_PsTexture1FromA 0x00000000 @@ -417,6 +262,7 @@ #define MASK_PsTriangleList 0x00000008 #define MASK_PsTriangleStrip 0x00000009 #define MASK_PsTriangleFan 0x0000000A + /* * REG_3D_PrimitiveSet -- Define Fire Primitive Mask (89F8h-89FBh) */ @@ -427,6 +273,52 @@ #define MASK_Texture0From 0x00300000 #define MASK_ShadingMode 0x07000000 #define MASK_CullDirection 0x08000000 + +#define OP_3D_POINT_DRAW 0x00000000 +#define OP_3D_LINE_DRAW 0x00000001 +#define OP_3D_TRIANGLE_DRAW 0x00000002 + +#define OP_3D_DIRECTION_RIGHT 0x00000000 +#define OP_3D_DIRECTION_LEFT 0x00000100 +#define OP_3D_DIRECTION_HORIZONTAL 0x00000000 +#define OP_3D_DIRECTION_VERTICAL 0x00000100 + +#define OP_3D_FIRE_TFIRE 0x00000000 +#define OP_3D_FIRE_TSARGBa 0x00000100 +#define OP_3D_FIRE_TSWa 0x00000200 +#define OP_3D_FIRE_TSVAa 0x00000300 +#define OP_3D_FIRE_TSVBa 0x00000400 +#define OP_3D_FIRE_TSVCa 0x00000500 + +#define OP_3D_FIRE_TSARGBb 0x00000900 +#define OP_3D_FIRE_TSWb 0x00000a00 +#define OP_3D_FIRE_TSVAb 0x00000b00 +#define OP_3D_FIRE_TSVBb 0x00000c00 +#define OP_3D_FIRE_TSVCb 0x00000d00 + +#define OP_3D_FIRE_TSARGBc 0x00001100 +#define OP_3D_FIRE_TSWc 0x00001200 +#define OP_3D_FIRE_TSVAc 0x00001300 +#define OP_3D_FIRE_TSVBc 0x00001400 +#define OP_3D_FIRE_TSVCc 0x00001500 + +#define OP_3D_Texture0FromA 0x00000000 +#define OP_3D_Texture0FromB 0x00100000 +#define OP_3D_Texture0FromC 0x00200000 +#define OP_3D_Texture1FromA 0x00000000 +#define OP_3D_Texture1FromB 0x00040000 +#define OP_3D_Texture1FromC 0x00080000 +#define OP_3D_TextureBumpFromA 0x00000000 +#define OP_3D_TextureBumpFromB 0x00010000 +#define OP_3D_TextureBumpFromC 0x00020000 + +#define OP_3D_CullDirection_CCW 0x08000000 + +#define SHADE_FLAT_VertexA 0x01000000 +#define SHADE_FLAT_VertexB 0x02000000 +#define SHADE_FLAT_VertexC 0x03000000 +#define SHADE_GOURAUD 0x04000000 + /* * Define Command Queue Length Mask (89FCh-89FF) */ @@ -465,8 +357,6 @@ #define MASK_TextureCWrapUCorrection 0x40000000 #define MASK_TextureCWrapVCorrection 0x80000000 - - /* * REG_3D_TEnable2 -- Define Capility Enable Mask2 (8A04h-8A07h) */ @@ -500,6 +390,28 @@ #define MASK_ZBufferInSystem 0x00080000 #define MASK_ZBufferFormat 0x01F00000 +#define SiS_Z_COMP_NEVER 0x00000000 +#define SiS_Z_COMP_S_LT_B 0x00010000 +#define SiS_Z_COMP_S_EQ_B 0x00020000 +#define SiS_Z_COMP_S_LE_B 0x00030000 +#define SiS_Z_COMP_S_GT_B 0x00040000 +#define SiS_Z_COMP_S_NE_B 0x00050000 +#define SiS_Z_COMP_S_GE_B 0x00060000 +#define SiS_Z_COMP_ALWAYS 0x00070000 + +#define SiS_ZFORMAT_Z16 0x00000000 +#define SiS_ZFORMAT_Z16_INT 0x00100000 +#define SiS_ZFORMAT_S1Z15 0x00400000 +#define SiS_ZFORMAT_S1Z15_INT 0x00500000 +#define SiS_ZFORMAT_Z32 0x00800000 +#define SiS_ZFORMAT_S1Z31 0x00C00000 +#define SiS_ZFORMAT_S2Z30 0x00D00000 +#define SiS_ZFORMAT_S4Z28 0x00E00000 +#define SiS_ZFORMAT_S8Z24 0x00F00000 +#define SiS_ZFORMAT_FZ30 0x01800000 +#define SiS_ZFORMAT_FS1Z30 0x01C00000 +#define SiS_ZFORMAT_FS2Z30 0x01D00000 + /* * REG_3D_ZBias -- Define Z Buffer Setting Mask (8A0Ch-8A0Fh) */ @@ -524,6 +436,15 @@ #define MASK_AlphaBufferInSystem 0x08000000 #define MASK_AlphaBufferFormat 0x30000000 +#define SiS_ALPHA_NEVER 0x00000000 +#define SiS_ALPHA_LESS 0x01000000 +#define SiS_ALPHA_EQUAL 0x02000000 +#define SiS_ALPHA_LEQUAL 0x03000000 +#define SiS_ALPHA_GREATER 0x04000000 +#define SiS_ALPHA_NOTEQUAL 0x05000000 +#define SiS_ALPHA_GEQUAL 0x06000000 +#define SiS_ALPHA_ALWAYS 0x07000000 + /* * REG_3D_AlphaAddress -- Define Alpha Buffer Base Address(8A1Ch-8A1Fh) */ @@ -540,6 +461,43 @@ #define MASK_Dst7BitFormat 0x007F0000 #define MASK_ROP2 0x0F000000 +#define DST_FORMAT_RGB_555 0x00100000 +#define DST_FORMAT_RGB_565 0x00110000 +#define DST_FORMAT_ARGB_1555 0x00120000 +#define DST_FORMAT_ARGB_4444 0x00130000 +#define DST_FORMAT_ARGB_1888 0x00300000 +#define DST_FORMAT_ARGB_2888 0x00310000 +#define DST_FORMAT_ARGB_4888 0x00320000 +#define DST_FORMAT_ARGB_8888 0x00330000 +#define DST_FORMAT_ARGB_0888 0x00340000 + +#define DST_FORMAT_BGR_555 0x00500000 +#define DST_FORMAT_BGR_565 0x00510000 +#define DST_FORMAT_ABGR_1555 0x00520000 +#define DST_FORMAT_ABGR_4444 0x00530000 +#define DST_FORMAT_ABGR_1888 0x00700000 +#define DST_FORMAT_ABGR_2888 0x00710000 +#define DST_FORMAT_ABGR_4888 0x00720000 +#define DST_FORMAT_ABGR_8888 0x00730000 +#define DST_FORMAT_ABGR_0888 0x00740000 + +#define LOP_CLEAR 0x00000000 +#define LOP_NOR 0x01000000 +#define LOP_AND_INVERTED 0x02000000 +#define LOP_COPY_INVERTED 0x03000000 +#define LOP_AND_REVERSE 0x04000000 +#define LOP_INVERT 0x05000000 +#define LOP_XOR 0x06000000 +#define LOP_NAND 0x07000000 +#define LOP_AND 0x08000000 +#define LOP_EQUIV 0x09000000 +#define LOP_NOOP 0x0a000000 +#define LOP_OR_INVERTED 0x0b000000 +#define LOP_COPY 0x0c000000 +#define LOP_OR_REVERSE 0x0d000000 +#define LOP_OR 0x0e000000 +#define LOP_SET 0x0f000000 + /* * REG_3D_DstAlphaWriteMask -- Define Destination/Alpha Buffer Write Mask (8A24h-8A27h) */ @@ -565,71 +523,311 @@ #define MASK_FogMode 0x07000000 #define MASK_FogZLookup 0x08000000 +#define FOGMODE_CHEAP 0x04000000 +#define FOGMODE_LINEAR 0x05000000 +#define FOGMODE_EXP 0x06000000 +#define FOGMODE_EXP2 0x07000000 + /* - * REG_3D_FogStartEnd -- Define Fog Start End Setting (8A34h-8A37h) + * REG_3D_FogStartEnd -- Define Fog Start End Setting (0x8A34 - 0x8A37) */ -#define MASK_FogFarDistance 0x0007FFFF +#define MASK_FogFarDistance 0x0007FFFF /* - * REG_3D_FogStartEnd -- Define Fog End Setting (8A38h-8A3Bh) + * REG_3D_FogStartEnd -- Define Fog End Setting (0x8A38 - 0x8A3B) */ -#define MASK_FogInvFarDistance 0x0007FFFF +#define MASK_FogInvFarDistance 0x0007FFFF +/* + * REG_3D_FogFactorDensity (0x8A3C - 0x8A3F) + */ #define MASK_FogDensity 0x0003FFFF #define MASK_FogFactor 0xFF000000 -#define MASK_StencilMaskValue 0x000000FF -#define MASK_StencilReferenceValue 0x0000FF00 -#define MASK_StencilTestMode 0x07000000 -#define MASK_StencilBufferInSystem 0x08000000 -#define MASK_StencilFormat 0x30000000 +/* + * REG_3D_StencilSet -- Define stencil test (8A44h-8A47h) + */ +#define MASK_StencilValueMask 0x000000ff +#define MASK_StencilRefMask 0x0000ff00 +#define MASK_StencilTestMode 0x07000000 +#define MASK_StencilBufferInSystem 0x08000000 +#define MASK_StencilFormat 0x30000000 + +#define SiS_STENCIL_NEVER 0x00000000 +#define SiS_STENCIL_LESS 0x01000000 +#define SiS_STENCIL_EQUAL 0x02000000 +#define SiS_STENCIL_LEQUAL 0x03000000 +#define SiS_STENCIL_GREATER 0x04000000 +#define SiS_STENCIL_NOTEQUAL 0x05000000 +#define SiS_STENCIL_GEQUAL 0x06000000 +#define SiS_STENCIL_ALWAYS 0x07000000 + +#define STENCIL_FORMAT_1 0x00000000 +#define STENCIL_FORMAT_2 0x10000000 +#define STENCIL_FORMAT_4 0x20000000 +#define STENCIL_FORMAT_8 0x30000000 -#define MASK_StencilMode_ALWAYS 0x07000000 +/* + * REG_3D_StencilSet2 -- Define stencil test (8A4h-8A47h) + */ #define MASK_StencilBufferPitch 0x00000FFF #define MASK_StencilZPassOp 0x00007000 #define MASK_StencilZFailOp 0x00070000 #define MASK_StencilFailOp 0x00700000 #define MASK_StencilWriteMask 0xFF000000 -#define MASK_StencilZPassOp_REPLACE 0x00002000 -#define MASK_StencilZFailOp_REPLACE 0x00020000 -#define MASK_StencilFailOp_REPLACE 0x00200000 -#define MASK_StencilAddress 0xFFFFFFFF - -#define MASK_SrcBlendMode 0x0000000F -#define MASK_DstBlendMode 0x000000F0 -#define MASK_DSTBLEND_ZERO 0x00000000 -#define MASK_DSTBLEND_ONE 0x00000010 -#define MASK_DSTBLEND_SRC_COLOR 0x00000020 -#define MASK_DSTBLEND_INV_SRC_COLOR 0x00000030 -#define MASK_DSTBLEND_SRC_ALPHA 0x00000040 -#define MASK_DSTBLEND_INV_SRC_ALPHA 0x00000050 -#define MASK_DSTBLEND_DST_ALPHA 0x00000060 -#define MASK_DSTBLEND_INV_DST_ALPHA 0x00000070 -#define MASK_DSTBLEND_DST_COLOR 0x00000080 -#define MASK_DSTBLEND_INV_DST_COLOR 0x00000090 -#define MASK_DSTBLEND_SRC_ALPHA_SAT 0x000000A0 - -#define MASK_SRCBLEND_ZERO 0x00000000 -#define MASK_SRCBLEND_ONE 0x00000001 -#define MASK_SRCBLEND_SRC_COLOR 0x00000002 -#define MASK_SRCBLEND_INV_SRC_COLOR 0x00000003 -#define MASK_SRCBLEND_SRC_ALPHA 0x00000004 -#define MASK_SRCBLEND_INV_SRC_ALPHA 0x00000005 -#define MASK_SRCBLEND_DST_ALPHA 0x00000006 -#define MASK_SRCBLEND_INV_DST_ALPHA 0x00000007 -#define MASK_SRCBLEND_DST_COLOR 0x00000008 -#define MASK_SRCBLEND_INV_DST_COLOR 0x00000009 -#define MASK_SRCBLEND_SRC_ALPHA_SAT 0x0000000A -#define MASK_SRCBLEND_BOTH_SRC_ALPHA 0x0000000B -#define MASK_SRCBLEND_BOTH_INV_SRC_ALPHA 0x0000000C - -#define MASK_BottomClip 0x00001FFF -#define MASK_TopClip 0x03FFE000 +#define SiS_SFAIL_KEEP 0x00000000 +#define SiS_SFAIL_ZERO 0x00100000 +#define SiS_SFAIL_REPLACE 0x00200000 +#define SiS_SFAIL_INVERT 0x00500000 +#define SiS_SFAIL_INCR 0x00600000 +#define SiS_SFAIL_DECR 0x00700000 + +#define SiS_SPASS_ZFAIL_KEEP 0x00000000 +#define SiS_SPASS_ZFAIL_ZERO 0x00010000 +#define SiS_SPASS_ZFAIL_REPLACE 0x00020000 +#define SiS_SPASS_ZFAIL_INVERT 0x00050000 +#define SiS_SPASS_ZFAIL_INCR 0x00060000 +#define SiS_SPASS_ZFAIL_DECR 0x00070000 + +#define SiS_SPASS_ZPASS_KEEP 0x00000000 +#define SiS_SPASS_ZPASS_ZERO 0x00001000 +#define SiS_SPASS_ZPASS_REPLACE 0x00002000 +#define SiS_SPASS_ZPASS_INVERT 0x00005000 +#define SiS_SPASS_ZPASS_INCR 0x00006000 +#define SiS_SPASS_ZPASS_DECR 0x00007000 + +/* + * REG_3D_DstBlendMode (0x8A50 - 0x8A53) + */ +#define MASK_SrcBlendMode 0x0000000F +#define MASK_DstBlendMode 0x000000F0 + +#define SiS_D_ZERO 0x00000000 +#define SiS_D_ONE 0x00000010 +#define SiS_D_SRC_COLOR 0x00000020 +#define SiS_D_ONE_MINUS_SRC_COLOR 0x00000030 +#define SiS_D_SRC_ALPHA 0x00000040 +#define SiS_D_ONE_MINUS_SRC_ALPHA 0x00000050 +#define SiS_D_DST_ALPHA 0x00000060 +#define SiS_D_ONE_MINUS_DST_ALPHA 0x00000070 +#define SiS_D_DST_COLOR 0x00000080 +#define SiS_D_ONE_MINUS_DST_COLOR 0x00000090 +#define SiS_D_SRC_ALPHA_SAT 0x000000a0 + +#define SiS_S_ZERO 0x00000000 +#define SiS_S_ONE 0x00000001 +#define SiS_S_SRC_COLOR 0x00000002 +#define SiS_S_ONE_MINUS_SRC_COLOR 0x00000003 +#define SiS_S_SRC_ALPHA 0x00000004 +#define SiS_S_ONE_MINUS_SRC_ALPHA 0x00000005 +#define SiS_S_DST_ALPHA 0x00000006 +#define SiS_S_ONE_MINUS_DST_ALPHA 0x00000007 +#define SiS_S_DST_COLOR 0x00000008 +#define SiS_S_ONE_MINUS_DST_COLOR 0x00000009 +#define SiS_S_SRC_ALPHA_SATURATE 0x0000000a +#define SiS_S_BOTH_SRC_ALPHA 0x0000000b +#define SiS_S_BOTH_ONE_MINUS_SRC_ALPHA 0x0000000c + +/* + * REG_3D_DstBlendMode (0x8A54 - 0x8A57) + */ +#define MASK_BottomClip 0x00001FFF +#define MASK_TopClip 0x03FFE000 + +/* + * REG_3D_DstBlendMode (0x8A58 - 0x8A5B) + */ +#define MASK_RightClip 0x00001FFF +#define MASK_LeftClip 0x03FFE000 + +/* + * REG_3D_TextureSet (0x8A7C - 0x8A7F) + * REG_3D_Texture1Set (0x8ADC - 0x8ADF) + */ +#define MASK_TextureHeight 0x0000000F +#define MASK_TextureWidth 0x000000F0 +#define MASK_TextureLevel 0x00000F00 +#define MASK_TextureSignYUVFormat 0x00001000 +#define MASK_TextureMappingMode 0x00FF0000 +#define MASK_TextureWrapU 0x00010000 +#define MASK_TextureWrapV 0x00020000 +#define MASK_TextureMirrorU 0x00040000 +#define MASK_TextureMirrorV 0x00080000 +#define MASK_TextureClampU 0x00100000 +#define MASK_TextureClampV 0x00200000 +#define MASK_TextureBorderU 0x00400000 +#define MASK_TextureBorderV 0x00800000 +#define MASK_TextureFormat 0xFF000000 +#define MASK_TextureBitDepth 0x70000000 +#define MASK_TextureRgbOrder 0x80000000 + +#define TEXEL_INDEX1 0x00000000 +#define TEXEL_INDEX2 0x01000000 +#define TEXEL_INDEX4 0x02000000 +#define TEXEL_INDEX8 0x03000000 + +#define TEXEL_INDEX1WithAlpha 0x04000000 +#define TEXEL_INDEX2WithAlpha 0x05000000 +#define TEXEL_INDEX4WithAlpha 0x06000000 +#define TEXEL_INDEX8WithAlpha 0x07000000 + +#define TEXEL_I1 0x10000000 +#define TEXEL_I2 0x11000000 +#define TEXEL_I4 0x12000000 +#define TEXEL_I8 0x13000000 + +#define TEXEL_DXT1 0x19000000 +#define TEXEL_DXT2 0x1A000000 +#define TEXEL_DXT3 0x1B000000 + +#define TEXEL_YUV422 0x20000000 +#define TEXEL_YVU422 0x21000000 +#define TEXEL_UVY422 0x22000000 +#define TEXEL_VUY422 0x23000000 +#define TEXEL_YUV411 0x24000000 + +#define TEXEL_L1 0x30000000 +#define TEXEL_L2 0x31000000 +#define TEXEL_L4 0x32000000 +#define TEXEL_L8 0x33000000 + +#define TEXEL_AL11 0x34000000 +#define TEXEL_AL44 0x35000000 +#define TEXEL_AL26 0x37000000 +#define TEXEL_AL88 0x38000000 + +#define TEXEL_A1 0x40000000 +#define TEXEL_A2 0x41000000 +#define TEXEL_A4 0x42000000 +#define TEXEL_A8 0x43000000 + +#define TEXEL_RGB_332_8 0x50000000 +#define TEXEL_RGB_233_8 0x51000000 +#define TEXEL_RGB_232_8 0x52000000 +#define TEXEL_ARGB_1232_8 0x53000000 +#define TEXEL_ARGB_2222_8 0x54000000 + +#define TEXEL_RGB_555_16 0x60000000 +#define TEXEL_RGB_565_16 0x61000000 +#define TEXEL_ARGB_1555_16 0x62000000 +#define TEXEL_ARGB_4444_16 0x63000000 + +#define TEXEL_ARGB_1888_32 0x70000000 +#define TEXEL_ARGB_2888_32 0x71000000 +#define TEXEL_ARGB_4888_32 0x72000000 +#define TEXEL_ARGB_8888_32 0x73000000 +#define TEXEL_ARGB_0888_32 0x74000000 + +#define TEXEL_BGR_332_8 0xD0000000 +#define TEXEL_BGR_233_8 0xD1000000 +#define TEXEL_BGR_232_8 0xD2000000 +#define TEXEL_ABGR_1232_8 0xD3000000 +#define TEXEL_ABGR_2222_8 0xD4000000 + +#define TEXEL_BGR_555_16 0xE0000000 +#define TEXEL_BGR_565_16 0xE1000000 +#define TEXEL_ABGR_1555_16 0xE2000000 +#define TEXEL_ABGR_4444_16 0xE3000000 + +#define TEXEL_ABGR_1888_32 0xF0000000 +#define TEXEL_ABGR_2888_32 0xF1000000 +#define TEXEL_ABGR_4888_32 0xF2000000 +#define TEXEL_ABGR_8888_32 0xF3000000 +#define TEXEL_ABGR_0888_32 0xF4000000 + +#define TEXEL_VU88 0x00000000 +#define TEXEL_LVU655 0x00800000 +#define TEXEL_LVU888 0x01000000 +#define TEXEL_UV88 0x02000000 +#define TEXEL_LUV655 0x02800000 +#define TEXEL_LUV888 0x03000000 + +/* + * REG_3D_TextureMip (0x8A80 - 0x8A83) + * REG_3D_Texture1Mip (0x8AE0 - 0x8AE3) + */ +#define MASK_TextureAnisotropyRatio 0x0000000F +#define MASK_TextureMipmapLodBias 0x00003FF0 +#define MASK_TextureFilterMin 0x0001C000 +#define MASK_TextureFilterMag 0x00020000 +#define MASK_TextureFilter 0x0003C000 +#define MASK_TextureLevelInSystem 0x3FFC0000 +#define MASK_TextureLevel0InSystem 0x00040000 +#define MASK_TextureBlockLength 0xF0000000 + +#define TEXTURE_FILTER_NEAREST 0x00000000 +#define TEXTURE_FILTER_LINEAR 0x00004000 +#define TEXTURE_FILTER_NEAREST_MIP_NEAREST 0x00008000 +#define TEXTURE_FILTER_NEAREST_MIP_LINEAR 0x00010000 +#define TEXTURE_FILTER_LINEAR_MIP_NEAREST 0x0000c000 +#define TEXTURE_FILTER_LINEAR_MIP_LINEAR 0x00014000 + +/* + * REG_3D_TextureTransparencyColorHigh (0x8A84 - 0x8A87) + * REG_3D_Texture1TransparencyColorHigh (0x8AE4 - 0x8AE7) + */ +#define MASK_TextureTransparencyColorHighB 0x000000FF +#define MASK_TextureTransparencyColorHighG 0x0000FF00 +#define MASK_TextureTransparencyColorHighR 0x00FF0000 +#define MASK_TextureAlphaTransparencyMode 0x08000000 + +/* + * REG_3D_TextureTransparencyColorLow (0x8A88 - 0x8A8B) + * REG_3D_Texture1TransparencyColorLow (0x8AE8 - 0x8AEB) + */ +#define MASK_TextureTransparencyColorLowB 0x000000FF +#define MASK_TextureTransparencyColorLowG 0x0000FF00 +#define MASK_TextureTransparencyColorLowR 0x00FF0000 +#define MASK_TextureBlockHeight 0x07000000 +#define MASK_TextureBlockWidth 0x70000000 + +/* + * REG_3D_TextureTransparencyColorLow (0x8A8C - 0x8A8F) + * REG_3D_Texture1TransparencyColorLow (0x8AEC - 0x8AEF) + */ +#define MASK_TextureBorderColorB 0x000000FF +#define MASK_TextureBorderColorG 0x0000FF00 +#define MASK_TextureBorderColorR 0x00FF0000 +#define MASK_TextureBorderColorA 0xFF000000 -#define MASK_RightClip 0x00001FFF -#define MASK_LeftClip 0x03FFE000 +/* + * REG_3D_TexturePitch0-10 (0x8AC0 - 0x8AD7) + * REG_3D_Texture1Pitch0-10 (0x8B20 - 0x8B37) + */ +#define MASK_TexturePitchOdd 0x000003FF +#define MASK_TexturePitchEven 0x03FF0000 +#define SHIFT_TexturePitchEven 16 + +/* + * REG_3D_TextureColorBlendSet0 (0x8B40 - 0x8B43) + * REG_3D_TextureColorBlendSet1 (0x8B44 - 0x8B46) + * REG_3D_TextureAlphaBlendSet0 (0x8B40 - 0x8B43) + * REG_3D_TextureAlphaBlendSet1 (0x8B44 - 0x8B46) + */ +#define STAGE0_C_CF 0xa1485000 +#define STAGE0_C_CS 0xc1485000 +#define STAGE0_C_CFCS 0xa1705000 +#define STAGE0_C_CFOMAS_CSAS 0xc534c001 +#define STAGE0_C_CFOMCS_CCCS 0x4530c001 + +#define STAGE0_A_AF 0x63230000 +#define STAGE0_A_AS 0xc3230000 +#define STAGE0_A_AFAS 0x63c30000 +#define STAGE0_A_AFOMAS_ACAS 0x46c60001 + +#define STAGE1_C_CF 0xa1485000 +#define STAGE1_C_CS 0xe1485000 +#define STAGE1_C_CFCS 0xa1785000 +#define STAGE1_C_CFOMAS_CSAS 0xe5394001 +#define STAGE1_C_CFOMCS_CCCS 0x45394001 + +#define STAGE1_A_AF 0xa3230000 +#define STAGE1_A_AS 0xe3230000 +#define STAGE1_A_AFAS 0xa3e30000 +#define STAGE1_A_AFOMAS_ACAS 0x4aea0001 +/* What registers are these associated with? */ #define MASK_BMMemoryInSystem 0x00000080 #define MASK_BMHeight 0x00000F00 #define MASK_BMWidth 0x0000F000 @@ -649,334 +847,12 @@ #define MASK_BMMatrix10 0x000007FF #define MASK_BMMatrix11 0x07FF0000 -#define MASK_TextureHeight 0x0000000F -#define MASK_TextureWidth 0x000000F0 -#define MASK_TextureLevel 0x00000F00 -#define MASK_TextureSignYUVFormat 0x00001000 -#define MASK_TextureMappingMode 0x00FF0000 -#define MASK_TextureWrapU 0x00010000 -#define MASK_TextureWrapV 0x00020000 -#define MASK_TextureMirrorU 0x00040000 -#define MASK_TextureMirrorV 0x00080000 -#define MASK_TextureClampU 0x00100000 -#define MASK_TextureClampV 0x00200000 -#define MASK_TextureBorderU 0x00400000 -#define MASK_TextureBorderV 0x00800000 -#define MASK_TextureFormat 0xFF000000 -#define MASK_TextureBitDepth 0x70000000 -#define MASK_TextureRgbOrder 0x80000000 - -#define MASK_TextureAnisotropyRatio 0x0000000F -#define MASK_TextureMipmapLodBias 0x00003FF0 -#define MASK_TextureFilterMin 0x0001C000 -#define MASK_TextureFilterMag 0x00020000 -#define MASK_TextureFilter 0x0003C000 -#define MASK_TextureLevelInSystem 0x3FFC0000 -#define MASK_TextureLevel0InSystem 0x00040000 -#define MASK_TextureBlockLength 0xF0000000 - -#define MASK_TextureTransparencyColorHighB 0x000000FF -#define MASK_TextureTransparencyColorHighG 0x0000FF00 -#define MASK_TextureTransparencyColorHighR 0x00FF0000 -#define MASK_TextureAlphaTransparencyMode 0x08000000 - -#define MASK_TextureTransparencyColorLowB 0x000000FF -#define MASK_TextureTransparencyColorLowG 0x0000FF00 -#define MASK_TextureTransparencyColorLowR 0x00FF0000 -#define MASK_TextureBlockHeight 0x07000000 -#define MASK_TextureBlockWidth 0x70000000 - -#define MASK_TextureBorderColorB 0x000000FF -#define MASK_TextureBorderColorG 0x0000FF00 -#define MASK_TextureBorderColorR 0x00FF0000 -#define MASK_TextureBorderColorA 0xFF000000 - -#define MASK_TexturePitchOdd 0x000003FF -#define MASK_TexturePitchEven 0x03FF0000 -#define SHIFT_TexturePitchEven 16 - #define MASK_TextureRealInSystem 0x00000001 #define MASK_TextureDowngrade 0x00000002 -#define OP_3D_POINT_DRAW 0x00000000 -#define OP_3D_LINE_DRAW 0x00000001 -#define OP_3D_TRIANGLE_DRAW 0x00000002 - -#define OP_3D_DIRECTION_RIGHT 0x00000000 -#define OP_3D_DIRECTION_LEFT 0x00000100 -#define OP_3D_DIRECTION_HORIZONTAL 0x00000000 -#define OP_3D_DIRECTION_VERTICAL 0x00000100 - -#define OP_3D_FIRE_TFIRE 0x00000000 -#define OP_3D_FIRE_TSARGBa 0x00000100 -#define OP_3D_FIRE_TSWa 0x00000200 -#define OP_3D_FIRE_TSVAa 0x00000300 -#define OP_3D_FIRE_TSVBa 0x00000400 -#define OP_3D_FIRE_TSVCa 0x00000500 - -#define OP_3D_FIRE_TSARGBb 0x00000900 -#define OP_3D_FIRE_TSWb 0x00000a00 -#define OP_3D_FIRE_TSVAb 0x00000b00 -#define OP_3D_FIRE_TSVBb 0x00000c00 -#define OP_3D_FIRE_TSVCb 0x00000d00 - -#define OP_3D_FIRE_TSARGBc 0x00001100 -#define OP_3D_FIRE_TSWc 0x00001200 -#define OP_3D_FIRE_TSVAc 0x00001300 -#define OP_3D_FIRE_TSVBc 0x00001400 -#define OP_3D_FIRE_TSVCc 0x00001500 - -#define OP_3D_Texture0FromA 0x00000000 -#define OP_3D_Texture0FromB 0x00100000 -#define OP_3D_Texture0FromC 0x00200000 -#define OP_3D_Texture1FromA 0x00000000 -#define OP_3D_Texture1FromB 0x00040000 -#define OP_3D_Texture1FromC 0x00080000 -#define OP_3D_TextureBumpFromA 0x00000000 -#define OP_3D_TextureBumpFromB 0x00010000 -#define OP_3D_TextureBumpFromC 0x00020000 - -#define SHADE_FLAT_VertexA 0x01000000 -#define SHADE_FLAT_VertexB 0x02000000 -#define SHADE_FLAT_VertexC 0x03000000 -#define SHADE_GOURAUD 0x04000000 - -#define Z_BUFFER_FORMAT_Z16 0x00000000 -#define Z_BUFFER_FORMAT_Z16_INT 0x00100000 -#define Z_BUFFER_FORMAT_S1Z15 0x00400000 -#define Z_BUFFER_FORMAT_S1Z15_INT 0x00500000 -#define Z_BUFFER_FORMAT_Z32 0x00800000 -#define Z_BUFFER_FORMAT_S1Z31 0x00C00000 -#define Z_BUFFER_FORMAT_S2Z30 0x00D00000 -#define Z_BUFFER_FORMAT_S4Z28 0x00E00000 -#define Z_BUFFER_FORMAT_S8Z24 0x00F00000 -#define Z_BUFFER_FORMAT_FZ30 0x01800000 -#define Z_BUFFER_FORMAT_FS1Z30 0x01C00000 -#define Z_BUFFER_FORMAT_FS2Z30 0x01D00000 -#define MASK_Z_BUFFER_FORMAT 0x01F00000 - #define ALPHA_BUFFER_FORMAT_1 0x00000000 #define ALPHA_BUFFER_FORMAT_2 0x10000000 #define ALPHA_BUFFER_FORMAT_4 0x20000000 #define ALPHA_BUFFER_FORMAT_8 0x30000000 -#define DST_FORMAT_RGB_555 0x00100000 -#define DST_FORMAT_RGB_565 0x00110000 -#define DST_FORMAT_ARGB_1555 0x00120000 -#define DST_FORMAT_ARGB_4444 0x00130000 -#define DST_FORMAT_ARGB_1888 0x00300000 -#define DST_FORMAT_ARGB_2888 0x00310000 -#define DST_FORMAT_ARGB_4888 0x00320000 -#define DST_FORMAT_ARGB_8888 0x00330000 -#define DST_FORMAT_ARGB_0888 0x00340000 - -#define DST_FORMAT_BGR_555 0x00500000 -#define DST_FORMAT_BGR_565 0x00510000 -#define DST_FORMAT_ABGR_1555 0x00520000 -#define DST_FORMAT_ABGR_4444 0x00530000 -#define DST_FORMAT_ABGR_1888 0x00700000 -#define DST_FORMAT_ABGR_2888 0x00710000 -#define DST_FORMAT_ABGR_4888 0x00720000 -#define DST_FORMAT_ABGR_8888 0x00730000 -#define DST_FORMAT_ABGR_0888 0x00740000 - -#define MASK_TEXTURE_FORMAT 0xFF000000 - -#define TEXEL_INDEX1 0x00000000 -#define TEXEL_INDEX2 0x01000000 -#define TEXEL_INDEX4 0x02000000 -#define TEXEL_INDEX8 0x03000000 - -#define TEXEL_INDEX1WithAlpha 0x04000000 -#define TEXEL_INDEX2WithAlpha 0x05000000 -#define TEXEL_INDEX4WithAlpha 0x06000000 -#define TEXEL_INDEX8WithAlpha 0x07000000 - -#define TEXEL_I1 0x10000000 -#define TEXEL_I2 0x11000000 -#define TEXEL_I4 0x12000000 -#define TEXEL_I8 0x13000000 - -#define TEXEL_DXT1 0x19000000 -#define TEXEL_DXT2 0x1A000000 -#define TEXEL_DXT3 0x1B000000 - -#define TEXEL_YUV422 0x20000000 -#define TEXEL_YVU422 0x21000000 -#define TEXEL_UVY422 0x22000000 -#define TEXEL_VUY422 0x23000000 -#define TEXEL_YUV411 0x24000000 - -#define TEXEL_L1 0x30000000 -#define TEXEL_L2 0x31000000 -#define TEXEL_L4 0x32000000 -#define TEXEL_L8 0x33000000 - -#define TEXEL_AL11 0x34000000 -#define TEXEL_AL44 0x35000000 -#define TEXEL_AL26 0x37000000 -#define TEXEL_AL88 0x38000000 - -#define TEXEL_A1 0x40000000 -#define TEXEL_A2 0x41000000 -#define TEXEL_A4 0x42000000 -#define TEXEL_A8 0x43000000 - -#define TEXEL_RGB_332_8 0x50000000 -#define TEXEL_RGB_233_8 0x51000000 -#define TEXEL_RGB_232_8 0x52000000 -#define TEXEL_ARGB_1232_8 0x53000000 -#define TEXEL_ARGB_2222_8 0x54000000 - -#define TEXEL_RGB_555_16 0x60000000 -#define TEXEL_RGB_565_16 0x61000000 -#define TEXEL_ARGB_1555_16 0x62000000 -#define TEXEL_ARGB_4444_16 0x63000000 - -#define TEXEL_ARGB_1888_32 0x70000000 -#define TEXEL_ARGB_2888_32 0x71000000 -#define TEXEL_ARGB_4888_32 0x72000000 -#define TEXEL_ARGB_8888_32 0x73000000 -#define TEXEL_ARGB_0888_32 0x74000000 - -#define TEXEL_BGR_332_8 0xD0000000 -#define TEXEL_BGR_233_8 0xD1000000 -#define TEXEL_BGR_232_8 0xD2000000 -#define TEXEL_ABGR_1232_8 0xD3000000 -#define TEXEL_ABGR_2222_8 0xD4000000 - -#define TEXEL_BGR_555_16 0xE0000000 -#define TEXEL_BGR_565_16 0xE1000000 -#define TEXEL_ABGR_1555_16 0xE2000000 -#define TEXEL_ABGR_4444_16 0xE3000000 - -#define TEXEL_ABGR_1888_32 0xF0000000 -#define TEXEL_ABGR_2888_32 0xF1000000 -#define TEXEL_ABGR_4888_32 0xF2000000 -#define TEXEL_ABGR_8888_32 0xF3000000 -#define TEXEL_ABGR_0888_32 0xF4000000 - -#define TEXEL_VU88 0x00000000 -#define TEXEL_LVU655 0x00800000 -#define TEXEL_LVU888 0x01000000 -#define TEXEL_UV88 0x02000000 -#define TEXEL_LUV655 0x02800000 -#define TEXEL_LUV888 0x03000000 - -#define FOGMODE_CHEAP 0x04000000 -#define FOGMODE_LINEAR 0x05000000 -#define FOGMODE_EXP 0x06000000 -#define FOGMODE_EXP2 0x07000000 - -#define Z_16 0x00000000 -#define S_1_Z_15 0x00400000 -#define Z_32 0x00800000 -#define S_1_Z_31 0x00c00000 -#define S_2_Z_30 0x00d00000 -#define S_4_Z_28 0x00e00000 -#define S_8_Z_24 0x00f00000 - -#define S_1 0x00000000 -#define S_2 0x10000000 -#define S_4 0x20000000 -#define S_8 0x30000000 - -#define TEXTURE_FILTER_NEAREST 0x00000000 -#define TEXTURE_FILTER_LINEAR 0x00004000 -#define TEXTURE_FILTER_NEAREST_MIP_NEAREST 0x00008000 -#define TEXTURE_FILTER_NEAREST_MIP_LINEAR 0x00010000 -#define TEXTURE_FILTER_LINEAR_MIP_NEAREST 0x0000c000 -#define TEXTURE_FILTER_LINEAR_MIP_LINEAR 0x00014000 - -#define A_REPLACE_RGB_STAGE0 0xa1485000 -#define A_REPLACE_A_STAGE0 0xc3230000 -#define L_REPLACE__RGB_STAGE0 0xc1485000 -#define L_REPLACE__A_STAGE0 0x63230000 -#define LA_REPLACE__RGB_STAGE0 0xc1485000 -#define LA_REPLACE__A_STAGE0 0xc3230000 -#define I_REPLACE__RGB_STAGE0 0xc1485000 -#define I_REPLACE__A_STAGE0 0xc3230000 -#define RGB_REPLACE__RGB_STAGE0 0xc1485000 -#define RGB_REPLACE__A_STAGE0 0x63230000 -#define RGBA_REPLACE__RGB_STAGE0 0xc1485000 -#define RGBA_REPLACE__A_STAGE0 0xc3230000 - -#define A_MODULATE_RGB_STAGE0 0xa1485000 -#define A_MODULATE_A_STAGE0 0x63c30000 -#define L_MODULATE__RGB_STAGE0 0xa1705000 -#define L_MODULATE__A_STAGE0 0x63230000 -#define LA_MODULATE__RGB_STAGE0 0xa1705000 -#define LA_MODULATE__A_STAGE0 0x63c30000 -#define I_MODULATE__RGB_STAGE0 0xa1705000 -#define I_MODULATE__A_STAGE0 0x63c30000 -#define RGB_MODULATE__RGB_STAGE0 0xa1705000 -#define RGB_MODULATE__A_STAGE0 0x63230000 -#define RGBA_MODULATE__RGB_STAGE0 0xa1705000 -#define RGBA_MODULATE__A_STAGE0 0x63c30000 - -#define RGB_DECAL__RGB_STAGE0 0xc1485000 -#define RGB_DECAL__A_STAGE0 0x63230000 -#define RGBA_DECAL__RGB_STAGE0 0xc534c001 -#define RGBA_DECAL__A_STAGE0 0x63230000 - -#define A_BLEND_RGB_STAGE0 0xa1485000 -#define A_BLEND_A_STAGE0 0x63c30000 -#define L_BLEND__RGB_STAGE0 0x4530c001 -#define L_BLEND__A_STAGE0 0x63230000 -#define LA_BLEND__RGB_STAGE0 0x4530c001 -#define LA_BLEND__A_STAGE0 0x63c30000 -#define I_BLEND__RGB_STAGE0 0x4530c001 -#define I_BLEND__A_STAGE0 0x46c60001 -#define RGB_BLEND__RGB_STAGE0 0x4530c001 -#define RGB_BLEND__A_STAGE0 0x63230000 -#define RGBA_BLEND__RGB_STAGE0 0x4530c001 -#define RGBA_BLEND__A_STAGE0 0x63c30000 - -#define RGB_STAGE1 0xa1485000 -#define A_STAGE1 0xa3230000 - -#define A_REPLACE_RGB_STAGE1 0xa1485000 -#define A_REPLACE_A_STAGE1 0xe3230000 -#define L_REPLACE__RGB_STAGE1 0xe1485000 -#define L_REPLACE__A_STAGE1 0xa3230000 -#define LA_REPLACE__RGB_STAGE1 0xe1485000 -#define LA_REPLACE__A_STAGE1 0xe3230000 -#define I_REPLACE__RGB_STAGE1 0xe1485000 -#define I_REPLACE__A_STAGE1 0xe3230000 -#define RGB_REPLACE__RGB_STAGE1 0xe1485000 -#define RGB_REPLACE__A_STAGE1 0xa3230000 -#define RGBA_REPLACE__RGB_STAGE1 0xe1485000 -#define RGBA_REPLACE__A_STAGE1 0xe3230000 - -#define A_MODULATE_RGB_STAGE1 0xa1485000 -#define A_MODULATE_A_STAGE1 0xa3e30000 -#define L_MODULATE__RGB_STAGE1 0xa1785000 -#define L_MODULATE__A_STAGE1 0xa3230000 -#define LA_MODULATE__RGB_STAGE1 0xa1785000 -#define LA_MODULATE__A_STAGE1 0xa3e30000 -#define I_MODULATE__RGB_STAGE1 0xa1785000 -#define I_MODULATE__A_STAGE1 0xa3e30000 -#define RGB_MODULATE__RGB_STAGE1 0xa1785000 -#define RGB_MODULATE__A_STAGE1 0xa3230000 -#define RGBA_MODULATE__RGB_STAGE1 0xa1785000 -#define RGBA_MODULATE__A_STAGE1 0xa3e30000 - -#define RGB_DECAL__RGB_STAGE1 0xe1485000 -#define RGB_DECAL__A_STAGE1 0xa3230000 -#define RGBA_DECAL__RGB_STAGE1 0xe5394001 -#define RGBA_DECAL__A_STAGE1 0xa3230000 - -#define A_BLEND_RGB_STAGE1 0xa1485000 -#define A_BLEND_A_STAGE1 0xa3e30000 -#define L_BLEND__RGB_STAGE1 0x45394001 -#define L_BLEND__A_STAGE1 0xa3230000 -#define LA_BLEND__RGB_STAGE1 0x45394001 -#define LA_BLEND__A_STAGE1 0xa3e30000 -#define I_BLEND__RGB_STAGE1 0x45394001 -#define I_BLEND__A_STAGE1 0x4aea0001 -#define RGB_BLEND__RGB_STAGE1 0x45394001 -#define RGB_BLEND__A_STAGE1 0xa3230000 -#define RGBA_BLEND__RGB_STAGE1 0x45394001 -#define RGBA_BLEND__A_STAGE1 0xa3e30000 - #endif Index: xc/lib/GL/mesa/src/drv/sis/sis_render.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_render.c:1.5 xc/lib/GL/mesa/src/drv/sis/sis_render.c:removed --- xc/lib/GL/mesa/src/drv/sis/sis_render.c:1.5 Tue Sep 26 11:56:49 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_render.c Sat Feb 28 21:41:18 2004 @@ -1,526 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_render.c,v 1.5 2000/09/26 15:56:49 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#include "sis_ctx.h" -#include "sis_mesa.h" - -#define SIS_SMOOTH 0x1 -#define SIS_USE_W 0x2 -#define SIS_TEXTURE0 0x4 -#define SIS_TEXTURE1 0x8 -#define SIS_TRI_OFFSET 0x10 -#define SIS_USE_Z 0x11 -#define SIS_FALLBACK 0x80000000 - -#define SIS_DEPTH_SCALE 1.0 - -/* - * TODO: assert(hwcx->AGPCmdBufSize % AGP_ALLOC_SIZE == 0) - * depends on VB_SIZE is better - */ -#define AGP_ALLOC_SIZE 0x10000 -/* #define AGP_ALLOC_SIZE (VB_SIZE/3*4 * 9) */ -static DWORD AGP_EngineOffset; -static DWORD *AGP_StartPtr; -/* export to sis_fastpath.c */ -float *AGP_CurrentPtr; - -#define SIS_TAG(x) x##_flat -#define SIS_STATES (0) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_smooth -#define SIS_STATES (SIS_SMOOTH) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_flat_w -#define SIS_STATES (SIS_USE_W) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_smooth_w -#define SIS_STATES (SIS_SMOOTH | SIS_USE_W) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_flat_t0 -#define SIS_STATES (SIS_TEXTURE0) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_smooth_t0 -#define SIS_STATES (SIS_SMOOTH | SIS_TEXTURE0) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_flat_w_t0 -#define SIS_STATES (SIS_USE_W | SIS_TEXTURE0) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_smooth_w_t0 -#define SIS_STATES (SIS_SMOOTH | SIS_USE_W | SIS_TEXTURE0) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_flat_t1 -#define SIS_STATES (SIS_TEXTURE1) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_smooth_t1 -#define SIS_STATES (SIS_SMOOTH | SIS_TEXTURE1) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_flat_w_t1 -#define SIS_STATES (SIS_USE_W | SIS_TEXTURE1) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_smooth_w_t1 -#define SIS_STATES (SIS_SMOOTH | SIS_USE_W | SIS_TEXTURE1) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_flat_t2 -#define SIS_STATES (SIS_TEXTURE0 | SIS_TEXTURE1) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_smooth_t2 -#define SIS_STATES (SIS_SMOOTH | SIS_TEXTURE0 | SIS_TEXTURE1) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_flat_w_t2 -#define SIS_STATES (SIS_USE_W | SIS_TEXTURE0 | SIS_TEXTURE1) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -#define SIS_TAG(x) x##_smooth_w_t2 -#define SIS_STATES (SIS_SMOOTH | SIS_USE_W | SIS_TEXTURE0 | SIS_TEXTURE1) -#include "sis_linefunc.h" -#include "sis_trifunc.h" - -static line_func sis_draw_line_func[32] = { - sis_line_flat, - sis_line_smooth, - sis_line_flat_w, - sis_line_smooth_w, - sis_line_flat_t0, - sis_line_smooth_t0, - sis_line_flat_w_t0, - sis_line_smooth_w_t0, - sis_line_flat_t1, - sis_line_smooth_t1, - sis_line_flat_w_t1, - sis_line_smooth_w_t1, - sis_line_flat_t2, - sis_line_smooth_t2, - sis_line_flat_w_t2, - sis_line_smooth_w_t2, -}; - -static line_func sis_agp_draw_line_func[32] = { - sis_agp_line_flat, - sis_agp_line_smooth, - sis_agp_line_flat_w, - sis_agp_line_smooth_w, - sis_agp_line_flat_t0, - sis_agp_line_smooth_t0, - sis_agp_line_flat_w_t0, - sis_agp_line_smooth_w_t0, - sis_agp_line_flat_t1, - sis_agp_line_smooth_t1, - sis_agp_line_flat_w_t1, - sis_agp_line_smooth_w_t1, - sis_agp_line_flat_t2, - sis_agp_line_smooth_t2, - sis_agp_line_flat_w_t2, - sis_agp_line_smooth_w_t2, -}; - -/* TODO: get another path if not clipped */ -static void -sis_line_clip (GLcontext * ctx, GLuint vert0, GLuint vert1, GLuint pv) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - BoxPtr pExtents; - int count; - GLuint x, y; - - sis_get_drawable_origin (xmesa, &x, &y); - sis_get_clip_rects (xmesa, &pExtents, &count); - - while (count--) - { - DWORD clipTopBottom, clipLeftRight; - - clipTopBottom = ((pExtents->y1 - y) << 13) | (pExtents->y2 - y - 1); - clipLeftRight = ((pExtents->x1 - x) << 13) | (pExtents->x2 - x - 1); - - mWait3DCmdQueue (5); - - MMIO (REG_3D_ClipTopBottom, clipTopBottom); - MMIO (REG_3D_ClipLeftRight, clipLeftRight); - - (hwcx->LineFunc) (ctx, vert0, vert1, pv); - mEndPrimitive (); - - pExtents++; - } - hwcx->GlobalFlag |= GFLAG_CLIPPING; -} - -static triangle_func sis_fill_triangle_func[32] = { - sis_tri_flat, - sis_tri_smooth, - sis_tri_flat_w, - sis_tri_smooth_w, - sis_tri_flat_t0, - sis_tri_smooth_t0, - sis_tri_flat_w_t0, - sis_tri_smooth_w_t0, - sis_tri_flat_t1, - sis_tri_smooth_t1, - sis_tri_flat_w_t1, - sis_tri_smooth_w_t1, - sis_tri_flat_t2, - sis_tri_smooth_t2, - sis_tri_flat_w_t2, - sis_tri_smooth_w_t2, -}; - -static triangle_func sis_agp_fill_triangle_func[32] = { - sis_agp_tri_flat, - sis_agp_tri_smooth, - sis_agp_tri_flat_w, - sis_agp_tri_smooth_w, - sis_agp_tri_flat_t0, - sis_agp_tri_smooth_t0, - sis_agp_tri_flat_w_t0, - sis_agp_tri_smooth_w_t0, - sis_agp_tri_flat_t1, - sis_agp_tri_smooth_t1, - sis_agp_tri_flat_w_t1, - sis_agp_tri_smooth_w_t1, - sis_agp_tri_flat_t2, - sis_agp_tri_smooth_t2, - sis_agp_tri_flat_w_t2, - sis_agp_tri_smooth_w_t2, -}; - -#define USE_XYZ 0x08000000 -#define USE_W 0x04000000 -#define USE_RGB 0x01000000 -#define USE_UV1 0x00400000 -#define USE_UV2 0x00200000 -#define USE_FLAT 0x0001000 -#define USE_SMOOTH 0x0004000 - -static DWORD AGPParsingValues[32] = { - (4 << 28) | USE_XYZ | USE_RGB | USE_FLAT, - (4 << 28) | USE_XYZ | USE_RGB | USE_SMOOTH, - (5 << 28) | USE_XYZ | USE_W | USE_RGB | USE_FLAT, - (5 << 28) | USE_XYZ | USE_W | USE_RGB | USE_SMOOTH, - (6 << 28) | USE_XYZ | USE_RGB | USE_UV1 | USE_FLAT, - (6 << 28) | USE_XYZ | USE_RGB | USE_UV1 | USE_SMOOTH, - (7 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV1 | USE_FLAT, - (7 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV1 | USE_SMOOTH, - (6 << 28) | USE_XYZ | USE_RGB | USE_UV2 | USE_FLAT, - (6 << 28) | USE_XYZ | USE_RGB | USE_UV2 | USE_SMOOTH, - (7 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV2 | USE_FLAT, - (7 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV2 | USE_SMOOTH, - (8 << 28) | USE_XYZ | USE_RGB | USE_UV1 | USE_UV2 | USE_FLAT, - (8 << 28) | USE_XYZ | USE_RGB | USE_UV1 | USE_UV2 | USE_SMOOTH, - (9 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV1 | USE_UV2 | USE_FLAT, - (9 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV1 | USE_UV2 | USE_SMOOTH, -}; - -static void -sis_tri_clip (GLcontext * ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - BoxPtr pExtents; - int count; - GLuint x, y; - - sis_get_drawable_origin (xmesa, &x, &y); - sis_get_clip_rects (xmesa, &pExtents, &count); - - while (count--) - { - DWORD clipTopBottom, clipLeftRight; - - clipTopBottom = ((pExtents->y1 - y) << 13) | (pExtents->y2 - y - 1); - clipLeftRight = ((pExtents->x1 - x) << 13) | (pExtents->x2 - x - 1); - - mWait3DCmdQueue (5); - - MMIO (REG_3D_ClipTopBottom, clipTopBottom); - MMIO (REG_3D_ClipLeftRight, clipLeftRight); - - (hwcx->TriangleFunc) (ctx, v0, v1, v2, pv); - mEndPrimitive (); - - pExtents++; - } - hwcx->GlobalFlag |= GFLAG_CLIPPING; -} - -void -sis_set_render_func (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - GLuint caps = ctx->TriangleCaps; - int line_index = 0; - int tri_index = 0; - - if(hwcx->swForceRender){ - ctx->Driver.LineFunc = NULL; - ctx->Driver.TriangleFunc = NULL; - return; - } - - ctx->IndirectTriangles &= ~(DD_LINE_SW_RASTERIZE | DD_TRI_SW_RASTERIZE); - hwcx->swRenderFlag &= ~(SIS_SW_POINT | SIS_SW_LINE | SIS_SW_TRIANGLE); - -/* - * TODO: Mesa 3.3 will set ctx->TriangleCaps to DD_SELECT - */ -#if 0 - if ((caps & (DD_SELECT | DD_FEEDBACK)) - /* Fixme */ - || (ctx->Texture.ReallyEnabled & (TEXTURE0_3D | TEXTURE1_3D))) - { - line_index |= SIS_FALLBACK; - tri_index |= SIS_FALLBACK; - } -#endif - - /* always set */ - hwcx->swRenderFlag |= SIS_SW_POINT; - - if ((caps & DD_LINE_STIPPLE) || (caps & DD_LINE_WIDTH)) - { - line_index |= SIS_FALLBACK; - hwcx->swRenderFlag |= SIS_SW_LINE; - } - - if ((caps & DD_TRI_STIPPLE)) - { - tri_index |= SIS_FALLBACK; - hwcx->swRenderFlag |= SIS_SW_TRIANGLE; - } - - if (ctx->Light.ShadeModel == GL_SMOOTH) - { - line_index |= SIS_SMOOTH; - tri_index |= SIS_SMOOTH; - } - - if (ctx->RasterMask & FOG_BIT) - { - line_index |= SIS_USE_W; - tri_index |= SIS_USE_W; - } - - if (ctx->Texture.ReallyEnabled) - { - line_index |= SIS_USE_W; - tri_index |= SIS_USE_W; - - if (ctx->Texture.ReallyEnabled & TEXTURE0_ANY) - { - line_index |= SIS_TEXTURE0; - tri_index |= SIS_TEXTURE0; - } - if (ctx->Texture.ReallyEnabled & TEXTURE1_ANY) - { - line_index |= SIS_TEXTURE1; - tri_index |= SIS_TEXTURE1; - } - } - - /* TODO, use Pick */ - hwcx->UseAGPCmdMode = GL_FALSE; - - if (line_index & SIS_FALLBACK) - { - ctx->IndirectTriangles |= DD_LINE_SW_RASTERIZE; - hwcx->LineFunc = NULL; - } - else - { - if ((ctx->Color.DriverDrawBuffer == GL_FRONT_LEFT) && - sis_is_window (xmesa)) - { - hwcx->LineFunc = sis_draw_line_func[line_index]; - ctx->Driver.LineFunc = sis_line_clip; - } - else - { - if (hwcx->AGPCmdModeEnabled) - { - ctx->Driver.LineFunc = sis_agp_draw_line_func[line_index]; - hwcx->UseAGPCmdMode = GL_TRUE; - } - else - { - ctx->Driver.LineFunc = sis_draw_line_func[line_index]; - } - } - } - - if (tri_index & SIS_FALLBACK) - { - ctx->IndirectTriangles |= DD_TRI_SW_RASTERIZE; - hwcx->TriangleFunc = NULL; - } - else - { - if ((ctx->Color.DriverDrawBuffer == GL_FRONT_LEFT) && - sis_is_window (xmesa)) - { - hwcx->TriangleFunc = sis_fill_triangle_func[tri_index]; - ctx->Driver.TriangleFunc = sis_tri_clip; - } - else - { - if (hwcx->AGPCmdModeEnabled) - { - ctx->Driver.TriangleFunc = sis_agp_fill_triangle_func[tri_index]; - hwcx->UseAGPCmdMode = GL_TRUE; - } - else - { - ctx->Driver.TriangleFunc = sis_fill_triangle_func[tri_index]; - } - } - } - - /* fast path */ - if(!(ctx->TriangleCaps & (DD_TRI_UNFILLED | DD_TRI_LIGHT_TWOSIDE)) && - (ctx->Driver.TriangleFunc == sis_agp_tri_smooth_w_t2) && - (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT)){ - hwcx->useFastPath = GL_TRUE; - } - else{ - hwcx->useFastPath = GL_FALSE; - } - - /* TODO: AGP and MMIO use different sis_set_render_state */ - hwcx->AGPParseSet &= ~0xffff7000; - hwcx->AGPParseSet |= AGPParsingValues[line_index & ~SIS_FALLBACK]; - - /* Debug, test sw-render - ctx->Driver.LineFunc = NULL; - ctx->Driver.TriangleFunc = NULL; - hwcx->swRenderFlag = ~0x0; - ctx->Visual->DepthMax = (sizeof(GLdepth)==2)?0xffff:0xffffffff; - ctx->Visual->DepthMaxF = (double)(sizeof(GLdepth)==2)?0xffff:0xffffffff; - */ -} - -void -sis_StartAGP (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - DWORD start, end; - - start = *(hwcx->pAGPCmdBufNext); - end = start + AGP_ALLOC_SIZE; - if (end >= hwcx->AGPCmdBufSize) - { - start = 0; - end = AGP_ALLOC_SIZE; - } - - /* - * TODO: use AGP_EngineOffset to get a safe value and not query current - * postion processed every time - * ?? use < instead of <= - */ - do - { - AGP_EngineOffset = - *(DWORD volatile *) (GET_IOBase (hwcx) + REG_3D_AGPCmBase) - - (DWORD) hwcx->AGPCmdBufAddr; - } - while ((AGP_EngineOffset <= end) && (AGP_EngineOffset >= start) - && ((*(GET_IOBase (hwcx) + 0x8243) & 0xe0) != 0xe0)); - - AGP_StartPtr = (DWORD *) (start + hwcx->AGPCmdBufBase); - AGP_CurrentPtr = (float *) AGP_StartPtr; -} - -void -sis_FlushAGP (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - /* TODO: wait queue length */ - - if((DWORD *)AGP_CurrentPtr == AGP_StartPtr) - { - return; - } - - mWait3DCmdQueue (5); - mEndPrimitive (); - MMIO (REG_3D_AGPCmBase, ((DWORD) AGP_StartPtr - (DWORD) hwcx->AGPCmdBufBase) - + (DWORD) hwcx->AGPCmdBufAddr); - MMIO (REG_3D_AGPTtDwNum, - (((DWORD) AGP_CurrentPtr - (DWORD) AGP_StartPtr) >> 2) | 0x50000000); - MMIO (REG_3D_ParsingSet, hwcx->AGPParseSet); - - MMIO (REG_3D_AGPCmFire, (DWORD) (-1)); - mEndPrimitive (); - - *(hwcx->pAGPCmdBufNext) = - (DWORD) AGP_CurrentPtr - (DWORD) hwcx->AGPCmdBufBase; - *(hwcx->pAGPCmdBufNext) = (*(hwcx->pAGPCmdBufNext) + 0xf) & ~0xf; -} Index: xc/lib/GL/mesa/src/drv/sis/sis_screen.c diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_screen.c:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_screen.c Mon Dec 8 19:15:22 2003 @@ -0,0 +1,274 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_screen.c,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ + +/* + * Authors: + * Eric Anholt + */ + +#include "dri_util.h" + +#include "context.h" +#include "utils.h" +#include "imports.h" + +#include "sis_context.h" +#include "sis_dri.h" +#include "sis_lock.h" + +/* Create the device specific screen private data struct. + */ +static sisScreenPtr +sisCreateScreen( __DRIscreenPrivate *sPriv ) +{ + sisScreenPtr sisScreen; + SISDRIPtr sisDRIPriv = (SISDRIPtr)sPriv->pDevPriv; + + if ( !driCheckDriDdxDrmVersions( sPriv, "SiS", 4, 0, 0, 1, 1, 0 ) ) + return NULL; + + /* Allocate the private area */ + sisScreen = (sisScreenPtr)CALLOC( sizeof(*sisScreen) ); + if ( sisScreen == NULL ) + return NULL; + + sisScreen->screenX = sisDRIPriv->width; + sisScreen->screenY = sisDRIPriv->height; + sisScreen->cpp = sisDRIPriv->bytesPerPixel; + sisScreen->irqEnabled = sisDRIPriv->bytesPerPixel; + sisScreen->deviceID = sisDRIPriv->deviceID; + sisScreen->AGPCmdBufOffset = sisDRIPriv->AGPCmdBufOffset; + sisScreen->AGPCmdBufSize = sisDRIPriv->AGPCmdBufSize; + sisScreen->sarea_priv_offset = sizeof(XF86DRISAREARec); + + sisScreen->mmio.handle = sisDRIPriv->regs.handle; + sisScreen->mmio.size = sisDRIPriv->regs.size; + if ( drmMap( sPriv->fd, sisScreen->mmio.handle, sisScreen->mmio.size, + &sisScreen->mmio.map ) ) + { + FREE( sisScreen ); + return NULL; + } + + if (sisDRIPriv->agp.size) { + sisScreen->agp.handle = sisDRIPriv->agp.handle; + sisScreen->agp.size = sisDRIPriv->agp.size; + if ( drmMap( sPriv->fd, sisScreen->agp.handle, sisScreen->agp.size, + &sisScreen->agp.map ) ) + { + sisScreen->agp.size = 0; + } + } + + sisScreen->driScreen = sPriv; + + return sisScreen; +} + +/* Destroy the device specific screen private data struct. + */ +static void +sisDestroyScreen( __DRIscreenPrivate *sPriv ) +{ + sisScreenPtr sisScreen = (sisScreenPtr)sPriv->private; + + if ( sisScreen == NULL ) + return; + + if (sisScreen->agp.size != 0) + drmUnmap( sisScreen->agp.map, sisScreen->agp.size ); + drmUnmap( sisScreen->mmio.map, sisScreen->mmio.size ); + + FREE( sisScreen ); + sPriv->private = NULL; +} + +/* Create and initialize the Mesa and driver specific pixmap buffer + * data. + */ +static GLboolean +sisCreateBuffer( __DRIscreenPrivate *driScrnPriv, + __DRIdrawablePrivate *driDrawPriv, + const __GLcontextModes *mesaVis, + GLboolean isPixmap ) +{ + if (isPixmap) + return GL_FALSE; /* not implemented */ + + driDrawPriv->driverPrivate = (void *)_mesa_create_framebuffer( + mesaVis, + GL_FALSE, /* software depth buffer? */ + mesaVis->stencilBits > 0, + mesaVis->accumRedBits > 0, + mesaVis->alphaBits > 0 ); /* XXX */ + return (driDrawPriv->driverPrivate != NULL); +} + + +static void +sisDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) +{ + _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate)); +} + +__inline__ static void +sis_bitblt_copy_cmd (sisContextPtr smesa, ENGPACKET * pkt) +{ + GLint *lpdwDest, *lpdwSrc; + int i; + + lpdwSrc = (GLint *) pkt; + lpdwDest = (GLint *) (GET_IOBase (smesa) + REG_SRC_ADDR); + + mWait3DCmdQueue (10); + + for (i = 0; i < 7; i++) + *lpdwDest++ = *lpdwSrc++; + + MMIO(REG_CMD0, *(GLint *)&pkt->stdwCmd); + MMIO(REG_CommandQueue, -1); +} + +static void sisCopyBuffer( __DRIdrawablePrivate *dPriv ) +{ + sisContextPtr smesa = (sisContextPtr)dPriv->driContextPriv->driverPrivate; + int i; + ENGPACKET stEngPacket; + + while ((*smesa->FrameCountPtr) - MMIO_READ(0x8a2c) > SIS_MAX_FRAME_LENGTH) + ; + + LOCK_HARDWARE(); + + stEngPacket.dwSrcBaseAddr = smesa->backOffset; + stEngPacket.dwSrcPitch = smesa->backPitch | + ((smesa->bytesPerPixel == 2) ? 0x80000000 : 0xc0000000); + stEngPacket.dwDestBaseAddr = 0; + stEngPacket.wDestPitch = smesa->frontPitch; + /* TODO: set maximum value? */ + stEngPacket.wDestHeight = smesa->virtualY; + + stEngPacket.stdwCmd.cRop = 0xcc; + + if (smesa->blockWrite) + stEngPacket.stdwCmd.cCmd0 = CMD0_PAT_FG_COLOR; + else + stEngPacket.stdwCmd.cCmd0 = 0; + stEngPacket.stdwCmd.cCmd1 = CMD1_DIR_X_INC | CMD1_DIR_Y_INC; + + for (i = 0; i < dPriv->numClipRects; i++) { + XF86DRIClipRectPtr box = &dPriv->pClipRects[i]; + stEngPacket.stdwSrcPos.wY = box->y1 - dPriv->y; + stEngPacket.stdwSrcPos.wX = box->x1 - dPriv->x; + stEngPacket.stdwDestPos.wY = box->y1; + stEngPacket.stdwDestPos.wX = box->x1; + + stEngPacket.stdwDim.wWidth = (GLshort) box->x2 - box->x1; + stEngPacket.stdwDim.wHeight = (GLshort) box->y2 - box->y1; + sis_bitblt_copy_cmd( smesa, &stEngPacket ); + } + + *(GLint *)(smesa->IOBase+0x8a2c) = *smesa->FrameCountPtr; + (*smesa->FrameCountPtr)++; + + UNLOCK_HARDWARE (); +} + + +/* Copy the back color buffer to the front color buffer */ +static void +sisSwapBuffers(__DRIdrawablePrivate *dPriv) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + sisContextPtr smesa = (sisContextPtr) dPriv->driContextPriv->driverPrivate; + GLcontext *ctx = smesa->glCtx; + + if (ctx->Visual.doubleBufferMode) { + _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ + sisCopyBuffer( dPriv ); + } + } else { + /* XXX this shouldn't be an error but we can't handle it for now */ + _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__); + } +} + + +/* Initialize the driver specific screen private data. + */ +static GLboolean +sisInitDriver( __DRIscreenPrivate *sPriv ) +{ + sPriv->private = (void *) sisCreateScreen( sPriv ); + + if ( !sPriv->private ) { + sisDestroyScreen( sPriv ); + return GL_FALSE; + } + + return GL_TRUE; +} + +/* Fullscreen mode change stub + */ +static GLboolean +sisOpenCloseFullScreen( __DRIcontextPrivate *driContextPriv ) +{ + return GL_TRUE; +} + +static struct __DriverAPIRec sisAPI = { + .InitDriver = sisInitDriver, + .DestroyScreen = sisDestroyScreen, + .CreateContext = sisCreateContext, + .DestroyContext = sisDestroyContext, + .CreateBuffer = sisCreateBuffer, + .DestroyBuffer = sisDestroyBuffer, + .SwapBuffers = sisSwapBuffers, + .MakeCurrent = sisMakeCurrent, + .UnbindContext = sisUnbindContext, + .OpenFullScreen = sisOpenCloseFullScreen, + .CloseFullScreen = sisOpenCloseFullScreen, + .GetSwapInfo = NULL, + .GetMSC = NULL, + .WaitForMSC = NULL, + .WaitForSBC = NULL, + .SwapBuffersMSC = NULL + +}; + +/* + * This is the bootstrap function for the driver. + * The __driCreateScreen name is the symbol that libGL.so fetches. + * Return: pointer to a __DRIscreenPrivate. + */ +void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, + int numConfigs, __GLXvisualConfig *config) +{ + __DRIscreenPrivate *psp; + psp = __driUtilCreateScreen( dpy, scrn, psc, numConfigs, config, &sisAPI ); + return (void *)psp; +} Index: xc/lib/GL/mesa/src/drv/sis/sis_screen.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_screen.h:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_screen.h Mon Dec 8 19:15:22 2003 @@ -0,0 +1,59 @@ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_screen.h,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ + +/* + * Authors: + * Eric Anholt + */ + +#ifndef __SIS_SCREEN_H +#define __SIS_SCREEN_H + +typedef struct { + drmHandle handle; /* Handle to the DRM region */ + drmSize size; /* Size of the DRM region */ + drmAddress map; /* Mapping of the DRM region */ +} sisRegionRec2, *sisRegionPtr2; + +typedef struct { + sisRegionRec2 mmio; + sisRegionRec2 agp; + + unsigned int AGPCmdBufOffset; + unsigned int AGPCmdBufSize; + + int deviceID; + int irqEnabled; + + int cpp; + unsigned int screenX, screenY; + + __DRIscreenPrivate *driScreen; + unsigned int sarea_priv_offset; + +} sisScreenRec, *sisScreenPtr; + +#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_span.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_span.c:1.5 xc/lib/GL/mesa/src/drv/sis/sis_span.c:1.7 --- xc/lib/GL/mesa/src/drv/sis/sis_span.c:1.5 Wed Mar 21 11:14:26 2001 +++ xc/lib/GL/mesa/src/drv/sis/sis_span.c Mon Dec 8 19:15:22 2003 @@ -1,52 +1,56 @@ /************************************************************************** Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt All Rights Reserved. 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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_span.c,v 1.5 2001/03/21 16:14:26 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_span.c,v 1.7 2003/12/09 00:15:22 alanh Exp $ */ /* * Authors: - * Sung-Ching Lin - * + * Sung-Ching Lin + * Eric Anholt */ -#include "sis_ctx.h" -#include "sis_mesa.h" +#include "sis_context.h" +#include "sis_span.h" + +#include "swrast/swrast.h" #define DBG 0 -/* from mga */ -/* TODO: should lock drawable in these routines because glBitmap will - * call this function without locking, or modify sis_Bitmap - */ +#define LOCAL_VARS \ + sisContextPtr smesa = SIS_CONTEXT(ctx); \ + char *buf = (char *)(smesa->FbBase + smesa->drawOffset); \ + char *read_buf = (char *)(smesa->FbBase + smesa->readOffset); \ + GLuint p; \ + (void) read_buf; (void) buf; (void) p + +#define LOCAL_DEPTH_VARS \ + sisContextPtr smesa = SIS_CONTEXT(ctx); \ + char *buf = smesa->depthbuffer; \ -#define LOCAL_VARS \ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \ - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; \ - GLuint pitch = hwcx->swRenderPitch; \ - char *buf = (char *)hwcx->swRenderBase +#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS #define CLIPPIXEL(_x,_y) (_x >= minx && _x < maxx && \ _y >= miny && _y < maxy) @@ -61,260 +65,247 @@ if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \ } -#define HW_LOCK() do{}while(0); +#define HW_LOCK() do {} while(0); -#define HW_CLIPLOOP() \ - do { \ - BoxPtr _pExtents; \ - int _nc; \ - GLuint _x, _y; \ - sis_get_drawable_origin (xmesa, &_x, &_y); \ - sis_get_clip_rects (xmesa, &_pExtents, &_nc); \ - while (_nc--) { \ - int minx = _pExtents->x1 - _x; \ - int miny = _pExtents->y1 - _y; \ - int maxx = _pExtents->x2 - _x; \ - int maxy = _pExtents->y2 - _y; \ - _pExtents++; - -#define HW_ENDCLIPLOOP() \ - } \ - } while (0) +#define HW_CLIPLOOP() \ + do { \ + __DRIdrawablePrivate *dPriv = smesa->driDrawable; \ + int _nc = dPriv->numClipRects; \ + \ + while ( _nc-- ) { \ + int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \ + int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \ + int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \ + int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y; + +#define HW_ENDCLIPLOOP() \ + } \ + } while (0) -#define HW_UNLOCK() do{}while(0); +#define HW_UNLOCK() do {} while(0); /* RGB565 */ -#define INIT_MONO_PIXEL(p) \ - GLushort p = hwcx->pixelValue; +#define INIT_MONO_PIXEL(p, color) \ + p = SISPACKCOLOR565( color[0], color[1], color[2] ) #define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLushort *)(buf + _x*2 + _y*pitch) = ( ((r & 0xf8) << 8) | \ - ((g & 0xfc) << 3) | \ - (b >> 3)) + *(GLushort *)(buf + _x*2 + _y*smesa->drawPitch) = \ + (((r & 0xf8) << 8) | \ + ((g & 0xfc) << 3) | \ + (b >> 3)) #define WRITE_PIXEL( _x, _y, p ) \ - *(GLushort *)(buf + _x*2 + _y*pitch) = p + *(GLushort *)(buf + _x*2 + _y*smesa->drawPitch) = p #define READ_RGBA( rgba, _x, _y ) \ do { \ - GLushort p = *(GLushort *)(buf + _x*2 + _y*pitch); \ + GLushort p = *(GLushort *)(read_buf + _x*2 + _y*smesa->readPitch); \ rgba[0] = (p & 0xf800) >> 8; \ rgba[1] = (p & 0x07e0) >> 3; \ rgba[2] = (p & 0x001f) << 3; \ - rgba[3] = 0; \ + rgba[3] = 0xff; \ } while(0) -#define TAG(x) sis_##x##_565 +#define TAG(x) sis##x##_565 #include "spantmp.h" -static void sis_Color_565( GLcontext *ctx, - GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - hwcx->pixelValue = ((red & 0xf8) << 8) | - ((green & 0xfc) << 3) | - (blue >> 3); -} /* ARGB8888 */ #undef INIT_MONO_PIXEL -#define INIT_MONO_PIXEL(p) \ - GLuint p = hwcx->pixelValue; +#define INIT_MONO_PIXEL(p, color) \ + p = SISPACKCOLOR8888( color[0], color[1], color[2], color[3] ) #define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = ( ((a) << 24) | \ - ((r) << 16) | \ - ((g) << 8) | \ - ((b))) + *(GLuint *)(buf + _x*4 + _y*smesa->drawPitch) = \ + (((a) << 24) | \ + ((r) << 16) | \ + ((g) << 8) | \ + ((b))) #define WRITE_PIXEL( _x, _y, p ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = p + *(GLuint *)(buf + _x*4 + _y*smesa->drawPitch) = p #define READ_RGBA( rgba, _x, _y ) \ do { \ - GLuint p = *(GLuint *)(buf + _x*4 + _y*pitch); \ + GLuint p = *(GLuint *)(read_buf + _x*4 + _y*smesa->readPitch); \ rgba[0] = (p >> 16) & 0xff; \ rgba[1] = (p >> 8) & 0xff; \ rgba[2] = (p >> 0) & 0xff; \ - rgba[3] = (p >> 24) & 0xff; \ + rgba[3] = 0xff; \ } while(0) -#define TAG(x) sis_##x##_8888 +#define TAG(x) sis##x##_8888 #include "spantmp.h" -static void sis_Color_8888( GLcontext *ctx, - GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - hwcx->pixelValue = (red << 16) | - (green << 8) | - (blue) | - (alpha << 24); -} -void sis_sw_init_driver( GLcontext *ctx ) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - if (hwcx->colorFormat == DST_FORMAT_RGB_565) { - ctx->Driver.Color = sis_Color_565; - ctx->Driver.WriteRGBASpan = sis_WriteRGBASpan_565; - ctx->Driver.WriteRGBSpan = sis_WriteRGBSpan_565; - ctx->Driver.WriteMonoRGBASpan = sis_WriteMonoRGBASpan_565; - ctx->Driver.WriteRGBAPixels = sis_WriteRGBAPixels_565; - ctx->Driver.WriteMonoRGBAPixels = sis_WriteMonoRGBAPixels_565; - ctx->Driver.ReadRGBASpan = sis_ReadRGBASpan_565; - ctx->Driver.ReadRGBAPixels = sis_ReadRGBAPixels_565; - } - else if(hwcx->colorFormat == DST_FORMAT_ARGB_8888){ - ctx->Driver.Color = sis_Color_8888; - ctx->Driver.WriteRGBASpan = sis_WriteRGBASpan_8888; - ctx->Driver.WriteRGBSpan = sis_WriteRGBSpan_8888; - ctx->Driver.WriteMonoRGBASpan = sis_WriteMonoRGBASpan_8888; - ctx->Driver.WriteRGBAPixels = sis_WriteRGBAPixels_8888; - ctx->Driver.WriteMonoRGBAPixels = sis_WriteMonoRGBAPixels_8888; - ctx->Driver.ReadRGBASpan = sis_ReadRGBASpan_8888; - ctx->Driver.ReadRGBAPixels = sis_ReadRGBAPixels_8888; - } - else{ - assert(0); - } +/* 16 bit depthbuffer functions. + */ +#define WRITE_DEPTH( _x, _y, d ) \ + *(GLushort *)(buf + _x*2 + _y*smesa->depthPitch) = d; + +#define READ_DEPTH( d, _x, _y ) \ + d = *(GLushort *)(buf + _x*2 + _y*smesa->depthPitch); + +#define TAG(x) sis##x##_16 +#include "depthtmp.h" + + +/* 32 bit depthbuffer functions. + */ +#define WRITE_DEPTH( _x, _y, d ) \ + *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) = d; + +#define READ_DEPTH( d, _x, _y ) \ + d = *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch); + +#define TAG(x) sis##x##_32 +#include "depthtmp.h" + + +/* 8/24 bit interleaved depth/stencil functions + */ +#define WRITE_DEPTH( _x, _y, d ) { \ + GLuint tmp = *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch); \ + tmp &= 0xff000000; \ + tmp |= (d & 0x00ffffff); \ + *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) = tmp; \ +} + +#define READ_DEPTH( d, _x, _y ) { \ + d = *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) & 0x00ffffff; \ +} - ctx->Driver.WriteCI8Span =NULL; - ctx->Driver.WriteCI32Span =NULL; - ctx->Driver.WriteMonoCISpan =NULL; - ctx->Driver.WriteCI32Pixels =NULL; - ctx->Driver.WriteMonoCIPixels =NULL; - ctx->Driver.ReadCI32Span =NULL; - ctx->Driver.ReadCI32Pixels =NULL; +#define TAG(x) sis##x##_24_8 +#include "depthtmp.h" + +#define WRITE_STENCIL( _x, _y, d ) { \ + GLuint tmp = *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch); \ + tmp &= 0x00ffffff; \ + tmp |= (d << 24); \ + *(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) = tmp; \ } -/* Depth/Stencil Functions - * use sizeof(GLdepth) to know the Z rnage of mesa is - * 0 ~ 2^16-1 or 0 ~ 2^32-1 +#define READ_STENCIL( d, _x, _y ) \ + d = (*(GLuint *)(buf + _x*4 + _y*smesa->depthPitch) & 0xff000000) >> 24; + +#define TAG(x) sis##x##_24_8 +#include "stenciltmp.h" + +/* + * This function is called to specify which buffer to read and write + * for software rasterization (swrast) fallbacks. This doesn't necessarily + * correspond to glDrawBuffer() or glReadBuffer() calls. */ -#define SIS_SW_Z_BASE(x,y) \ - ((SIS_SW_DTYPE *)(hwcx->swZBase + (x)*sizeof(SIS_SW_DTYPE) + \ - (y)*hwcx->swZPitch)) - -/* Z16 */ -#define SIS_TAG(x) x##_Z16 -#define SIS_SW_DTYPE GLushort -#define SIS_SW_D2I(D,I) \ - do{ \ - if(sizeof(GLdepth) == 2) \ - I = D; \ - else \ - I = D << 16; \ - }while(0) -#define SIS_SW_I2D(I,D) \ - do{ \ - if(sizeof(GLdepth) == 2) \ - D = I; \ - else \ - D = I >> 16; \ - }while(0) -#include "sis_swzfunc.h" - -/* Z32 */ -#define SIS_TAG(x) x##_Z32 -#define SIS_SW_DTYPE GLuint -#define SIS_SW_D2I(D,I) \ - do{ \ - if(sizeof(GLdepth) == 4) \ - I = D; \ - else \ - I = D >> 16; \ - }while(0) -#define SIS_SW_I2D(I,D) \ - do{ \ - if(sizeof(GLdepth) == 4) \ - D = I; \ - else \ - D = I << 16; \ - }while(0) -#include "sis_swzfunc.h" - -#define SIS_SW_STENCIL_FUNC - -/* S8Z24 */ -# define SIS_TAG(x) x##_S8Z24 -# define SIS_SW_DTYPE GLuint -# define SIS_SW_D2I(D,I) \ - do{ \ - if(sizeof(GLdepth) == 4) \ - I = (D << 8); \ - else \ - I = (D >> 8); \ - }while(0) -# define SIS_SW_I2D(I,D) \ - do{ \ - if(sizeof(GLdepth) == 4){ \ - D &= 0xff000000; \ - D |= (I >> 8); \ - } \ - else{ \ - D &= 0xff000000; \ - D |= (I << 8); \ - } \ - }while(0) -# define SIS_SW_S2I(S,I) \ - do{ \ - I = (S >> 24); \ - }while(0) -# define SIS_SW_I2S(I,S) \ - do{ \ - S &= 0x00ffffff; \ - S |= (I << 24); \ - }while(0) -# include "sis_swzfunc.h" +static void sisDDSetBuffer( GLcontext *ctx, + GLframebuffer *colorBuffer, + GLuint bufferBit ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + switch ( bufferBit ) { + case FRONT_LEFT_BIT: + smesa->drawOffset = smesa->readOffset = smesa->frontOffset; + smesa->drawPitch = smesa->readPitch = smesa->frontPitch; + break; + case BACK_LEFT_BIT: + smesa->drawOffset = smesa->readOffset = smesa->backOffset; + smesa->drawPitch = smesa->readPitch = smesa->backPitch; + break; + default: + break; + } +} + +static void sisSpanRenderStart( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); -#undef SIS_SW_STENCIL_FUNC + WaitEngIdle( smesa ); +} + +static void sisSpanRenderFinish( GLcontext *ctx ) +{ + _swrast_flush( ctx ); +} void -sis_sw_set_zfuncs_static (GLcontext * ctx) +sisDDInitSpanFuncs( GLcontext *ctx ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; + sisContextPtr smesa = SIS_CONTEXT(ctx); + struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); + + swdd->SetBuffer = sisDDSetBuffer; - switch (hwcx->zFormat) - { - case Z_16: - ctx->Driver.ReadDepthSpan = sis_ReadDepthSpan_Z16; - ctx->Driver.ReadDepthPixels = sis_ReadDepthPixels_Z16; - ctx->Driver.WriteDepthSpan = sis_WriteDepthSpan_Z16; - ctx->Driver.WriteDepthPixels = sis_WriteDepthPixels_Z16; - - ctx->Driver.ReadStencilSpan = NULL; - ctx->Driver.ReadStencilPixels = NULL; - ctx->Driver.WriteStencilSpan = NULL; - ctx->Driver.WriteStencilPixels = NULL; + switch (smesa->zFormat) + { + case SiS_ZFORMAT_Z16: + swdd->ReadDepthSpan = sisReadDepthSpan_16; + swdd->ReadDepthPixels = sisReadDepthPixels_16; + swdd->WriteDepthSpan = sisWriteDepthSpan_16; + swdd->WriteDepthPixels = sisWriteDepthPixels_16; + + swdd->ReadStencilSpan = NULL; + swdd->ReadStencilPixels = NULL; + swdd->WriteStencilSpan = NULL; + swdd->WriteStencilPixels = NULL; break; - case Z_32: - ctx->Driver.ReadDepthSpan = sis_ReadDepthSpan_Z32; - ctx->Driver.ReadDepthPixels = sis_ReadDepthPixels_Z32; - ctx->Driver.WriteDepthSpan = sis_WriteDepthSpan_Z32; - ctx->Driver.WriteDepthPixels = sis_WriteDepthPixels_Z32; - - ctx->Driver.ReadStencilSpan = NULL; - ctx->Driver.ReadStencilPixels = NULL; - ctx->Driver.WriteStencilSpan = NULL; - ctx->Driver.WriteStencilPixels = NULL; + case SiS_ZFORMAT_Z32: + swdd->ReadDepthSpan = sisReadDepthSpan_32; + swdd->ReadDepthPixels = sisReadDepthPixels_32; + swdd->WriteDepthSpan = sisWriteDepthSpan_32; + swdd->WriteDepthPixels = sisWriteDepthPixels_32; + + swdd->ReadStencilSpan = NULL; + swdd->ReadStencilPixels = NULL; + swdd->WriteStencilSpan = NULL; + swdd->WriteStencilPixels = NULL; break; - case S_8_Z_24: - ctx->Driver.ReadDepthSpan = sis_ReadDepthSpan_S8Z24; - ctx->Driver.ReadDepthPixels = sis_ReadDepthPixels_S8Z24; - ctx->Driver.WriteDepthSpan = sis_WriteDepthSpan_S8Z24; - ctx->Driver.WriteDepthPixels = sis_WriteDepthPixels_S8Z24; - - ctx->Driver.ReadStencilSpan = sis_ReadStencilSpan_S8Z24; - ctx->Driver.ReadStencilPixels = sis_ReadStencilPixels_S8Z24; - ctx->Driver.WriteStencilSpan = sis_WriteStencilSpan_S8Z24; - ctx->Driver.WriteStencilPixels = sis_WriteStencilPixels_S8Z24; + case SiS_ZFORMAT_S8Z24: + swdd->ReadDepthSpan = sisReadDepthSpan_24_8; + swdd->ReadDepthPixels = sisReadDepthPixels_24_8; + swdd->WriteDepthSpan = sisWriteDepthSpan_24_8; + swdd->WriteDepthPixels = sisWriteDepthPixels_24_8; + + swdd->ReadStencilSpan = sisReadStencilSpan_24_8; + swdd->ReadStencilPixels = sisReadStencilPixels_24_8; + swdd->WriteStencilSpan = sisWriteStencilSpan_24_8; + swdd->WriteStencilPixels = sisWriteStencilPixels_24_8; + break; + } + + switch ( smesa->bytesPerPixel ) + { + case 2: + swdd->WriteRGBASpan = sisWriteRGBASpan_565; + swdd->WriteRGBSpan = sisWriteRGBSpan_565; + swdd->WriteMonoRGBASpan = sisWriteMonoRGBASpan_565; + swdd->WriteRGBAPixels = sisWriteRGBAPixels_565; + swdd->WriteMonoRGBAPixels = sisWriteMonoRGBAPixels_565; + swdd->ReadRGBASpan = sisReadRGBASpan_565; + swdd->ReadRGBAPixels = sisReadRGBAPixels_565; break; - } + case 4: + swdd->WriteRGBASpan = sisWriteRGBASpan_8888; + swdd->WriteRGBSpan = sisWriteRGBSpan_8888; + swdd->WriteMonoRGBASpan = sisWriteMonoRGBASpan_8888; + swdd->WriteRGBAPixels = sisWriteRGBAPixels_8888; + swdd->WriteMonoRGBAPixels = sisWriteMonoRGBAPixels_8888; + swdd->ReadRGBASpan = sisReadRGBASpan_8888; + swdd->ReadRGBAPixels = sisReadRGBAPixels_8888; + break; + default: + assert(0); + break; + } + + swdd->WriteCI8Span = NULL; + swdd->WriteCI32Span = NULL; + swdd->WriteMonoCISpan = NULL; + swdd->WriteCI32Pixels = NULL; + swdd->WriteMonoCIPixels = NULL; + swdd->ReadCI32Span = NULL; + swdd->ReadCI32Pixels = NULL; + + swdd->SpanRenderStart = sisSpanRenderStart; + swdd->SpanRenderFinish = sisSpanRenderFinish; } Index: xc/lib/GL/mesa/src/drv/sis/sis_span.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_span.h:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_span.h Mon Dec 8 19:15:22 2003 @@ -0,0 +1,40 @@ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_span.h,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ + +/* + * Authors: + * Eric Anholt + */ + +#ifndef __SIS_SPAN_H__ +#define __SIS_SPAN_H__ + +#ifdef GLX_DIRECT_RENDERING + +extern void sisDDInitSpanFuncs( GLcontext *ctx ); + +#endif +#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_state.c diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_state.c:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_state.c Mon Dec 8 19:15:22 2003 @@ -0,0 +1,884 @@ +/************************************************************************** + +Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_state.c,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ + +/* + * Authors: + * Sung-Ching Lin + * Eric Anholt + */ + +#include "sis_context.h" +#include "sis_state.h" +#include "sis_tris.h" +#include "sis_lock.h" +#include "sis_tex.h" + +#include "context.h" +#include "enums.h" +#include "colormac.h" +#include "swrast/swrast.h" +#include "array_cache/acache.h" +#include "tnl/tnl.h" +#include "swrast_setup/swrast_setup.h" + +#include "tnl/t_pipeline.h" + +/* ============================================================= + * Alpha blending + */ + +static void +sisDDAlphaFunc( GLcontext * ctx, GLenum func, GLfloat ref ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + GLubyte refbyte; + + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + CLAMPED_FLOAT_TO_UBYTE(refbyte, ref); + current->hwAlpha = refbyte << 16; + + /* Alpha Test function */ + switch (func) + { + case GL_NEVER: + current->hwAlpha |= SiS_ALPHA_NEVER; + break; + case GL_LESS: + current->hwAlpha |= SiS_ALPHA_LESS; + break; + case GL_EQUAL: + current->hwAlpha |= SiS_ALPHA_EQUAL; + break; + case GL_LEQUAL: + current->hwAlpha |= SiS_ALPHA_LEQUAL; + break; + case GL_GREATER: + current->hwAlpha |= SiS_ALPHA_GREATER; + break; + case GL_NOTEQUAL: + current->hwAlpha |= SiS_ALPHA_NOTEQUAL; + break; + case GL_GEQUAL: + current->hwAlpha |= SiS_ALPHA_GEQUAL; + break; + case GL_ALWAYS: + current->hwAlpha |= SiS_ALPHA_ALWAYS; + break; + } + + prev->hwAlpha = current->hwAlpha; + smesa->GlobalFlag |= GFLAG_ALPHASETTING; +} + +static void +sisDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + /* TODO: in ICD, if no blend, it will reset these value */ + /* blending enable */ + current->hwDstSrcBlend = 0x10000; /* Default destination alpha */ + + switch (dfactor) + { + case GL_ZERO: + current->hwDstSrcBlend |= SiS_D_ZERO; + break; + case GL_ONE: + current->hwDstSrcBlend |= SiS_D_ONE; + break; + case GL_SRC_COLOR: + current->hwDstSrcBlend |= SiS_D_SRC_COLOR; + break; + case GL_ONE_MINUS_SRC_COLOR: + current->hwDstSrcBlend |= SiS_D_ONE_MINUS_SRC_COLOR; + break; + case GL_SRC_ALPHA: + current->hwDstSrcBlend |= SiS_D_SRC_ALPHA; + break; + case GL_ONE_MINUS_SRC_ALPHA: + current->hwDstSrcBlend |= SiS_D_ONE_MINUS_SRC_ALPHA; + break; + case GL_DST_ALPHA: + current->hwDstSrcBlend |= SiS_D_DST_ALPHA; + break; + case GL_ONE_MINUS_DST_ALPHA: + current->hwDstSrcBlend |= SiS_D_ONE_MINUS_DST_ALPHA; + break; + } + + switch (sfactor) + { + case GL_ZERO: + current->hwDstSrcBlend |= SiS_S_ZERO; + break; + case GL_ONE: + current->hwDstSrcBlend |= SiS_S_ONE; + break; + case GL_SRC_ALPHA: + current->hwDstSrcBlend |= SiS_S_SRC_ALPHA; + break; + case GL_ONE_MINUS_SRC_ALPHA: + current->hwDstSrcBlend |= SiS_S_ONE_MINUS_SRC_ALPHA; + break; + case GL_DST_ALPHA: + current->hwDstSrcBlend |= SiS_S_DST_ALPHA; + break; + case GL_ONE_MINUS_DST_ALPHA: + current->hwDstSrcBlend |= SiS_S_ONE_MINUS_DST_ALPHA; + break; + case GL_DST_COLOR: + current->hwDstSrcBlend |= SiS_S_DST_COLOR; + break; + case GL_ONE_MINUS_DST_COLOR: + current->hwDstSrcBlend |= SiS_S_ONE_MINUS_DST_COLOR; + break; + case GL_SRC_ALPHA_SATURATE: + current->hwDstSrcBlend |= SiS_S_SRC_ALPHA_SATURATE; + break; + } + + if (current->hwDstSrcBlend != prev->hwDstSrcBlend) { + prev->hwDstSrcBlend = current->hwDstSrcBlend; + smesa->GlobalFlag |= GFLAG_DSTBLEND; + } +} + +/* ============================================================= + * Depth testing + */ + +static void +sisDDDepthFunc( GLcontext * ctx, GLenum func ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + current->hwZ &= ~MASK_ZTestMode; + switch (func) + { + case GL_LESS: + current->hwZ |= SiS_Z_COMP_S_LT_B; + break; + case GL_GEQUAL: + current->hwZ |= SiS_Z_COMP_S_GE_B; + break; + case GL_LEQUAL: + current->hwZ |= SiS_Z_COMP_S_LE_B; + break; + case GL_GREATER: + current->hwZ |= SiS_Z_COMP_S_GT_B; + break; + case GL_NOTEQUAL: + current->hwZ |= SiS_Z_COMP_S_NE_B; + break; + case GL_EQUAL: + current->hwZ |= SiS_Z_COMP_S_EQ_B; + break; + case GL_ALWAYS: + current->hwZ |= SiS_Z_COMP_ALWAYS; + break; + case GL_NEVER: + current->hwZ |= SiS_Z_COMP_NEVER; + break; + } + + if (current->hwZ != prev->hwZ) { + prev->hwZ = current->hwZ; + smesa->GlobalFlag |= GFLAG_ZSETTING; + } +} + +void +sisDDDepthMask( GLcontext * ctx, GLboolean flag ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + if (!ctx->Depth.Test) + flag = GL_FALSE; + + if (ctx->Visual.stencilBits) { + if (flag || (ctx->Stencil.WriteMask[0] != 0)) { + current->hwCapEnable |= MASK_ZWriteEnable; + if (flag && (ctx->Stencil.WriteMask[0] == 0xff)) { + current->hwCapEnable2 &= ~MASK_ZMaskWriteEnable; + } else { + current->hwCapEnable2 |= MASK_ZMaskWriteEnable; + current->hwZMask = (ctx->Stencil.WriteMask[0] << 24) | + ((flag) ? 0x00ffffff : 0); + + if (current->hwZMask ^ prev->hwZMask) { + prev->hwZMask = current->hwZMask; + smesa->GlobalFlag |= GFLAG_ZSETTING; + } + } + } else { + current->hwCapEnable &= ~MASK_ZWriteEnable; + } + } else { + if (flag) { + current->hwCapEnable |= MASK_ZWriteEnable; + current->hwCapEnable2 &= ~MASK_ZMaskWriteEnable; + } else { + current->hwCapEnable &= ~MASK_ZWriteEnable; + } + } +} + +/* ============================================================= + * Clipping + */ + +void +sisUpdateClipping( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + GLint x1, y1, x2, y2; + + x1 = 0; + y1 = 0; + x2 = smesa->width - 1; + y2 = smesa->height - 1; + + if (ctx->Scissor.Enabled) { + if (ctx->Scissor.X > x1) + x1 = ctx->Scissor.X; + if (ctx->Scissor.Y > y1) + y1 = ctx->Scissor.Y; + if (ctx->Scissor.X + ctx->Scissor.Width - 1 < x2) + x2 = ctx->Scissor.X + ctx->Scissor.Width - 1; + if (ctx->Scissor.Y + ctx->Scissor.Height - 1 < y2) + y2 = ctx->Scissor.Y + ctx->Scissor.Height - 1; + } + + y1 = Y_FLIP(y1); + y2 = Y_FLIP(y2); + + current->clipTopBottom = (y2 << 13) | y1; + current->clipLeftRight = (x1 << 13) | x2; + + if ((current->clipTopBottom ^ prev->clipTopBottom) || + (current->clipLeftRight ^ prev->clipLeftRight)) + { + prev->clipTopBottom = current->clipTopBottom; + prev->clipLeftRight = current->clipLeftRight; + smesa->GlobalFlag |= GFLAG_CLIPPING; + } +} + +static void +sisDDScissor( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) +{ + if (ctx->Scissor.Enabled) + sisUpdateClipping( ctx ); +} + +/* ============================================================= + * Culling + */ + +static void +sisUpdateCull( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + GLint cullflag, frontface; + + cullflag = ctx->Polygon.CullFaceMode; + frontface = ctx->Polygon.FrontFace; + + smesa->AGPParseSet &= ~(MASK_PsCullDirection_CCW); + smesa->dwPrimitiveSet &= ~(MASK_CullDirection); + + if((cullflag == GL_FRONT && frontface == GL_CCW) || + (cullflag == GL_BACK && frontface == GL_CW)) + { + smesa->AGPParseSet |= MASK_PsCullDirection_CCW; + smesa->dwPrimitiveSet |= OP_3D_CullDirection_CCW; + } +} + + +static void +sisDDCullFace( GLcontext *ctx, GLenum mode ) +{ + sisUpdateCull( ctx ); +} + +static void +sisDDFrontFace( GLcontext *ctx, GLenum mode ) +{ + sisUpdateCull( ctx ); +} + +/* ============================================================= + * Masks + */ + +static void sisDDColorMask( GLcontext *ctx, + GLboolean r, GLboolean g, + GLboolean b, GLboolean a ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + if (r && g && b && ((ctx->Visual.alphaBits == 0) || a)) { + current->hwCapEnable2 &= ~(MASK_AlphaMaskWriteEnable | + MASK_ColorMaskWriteEnable); + } else { + current->hwCapEnable2 |= (MASK_AlphaMaskWriteEnable | + MASK_ColorMaskWriteEnable); + + current->hwDstMask = (r) ? smesa->redMask : 0 | + (g) ? smesa->greenMask : 0 | + (b) ? smesa->blueMask : 0 | + (a) ? smesa->alphaMask : 0; + } + + if (current->hwDstMask != prev->hwDstMask) { + prev->hwDstMask = current->hwDstMask; + smesa->GlobalFlag |= GFLAG_DESTSETTING; + } +} + +/* ============================================================= + * Rendering attributes + */ + +static void sisDDShadeModel( GLcontext *ctx, GLenum mode ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + /* Signal to sisRasterPrimitive to recalculate dwPrimitiveSet */ + smesa->hw_primitive = -1; +} + +/* ============================================================= + * Window position + */ + +/* ============================================================= + * Viewport + */ + +static void sisCalcViewport( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + const GLfloat *v = ctx->Viewport._WindowMap.m; + GLfloat *m = smesa->hw_viewport; + + /* See also sis_translate_vertex. + */ + m[MAT_SX] = v[MAT_SX]; + m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X; + m[MAT_SY] = - v[MAT_SY]; + m[MAT_TY] = - v[MAT_TY] + smesa->driDrawable->h + SUBPIXEL_Y; + m[MAT_SZ] = v[MAT_SZ] * smesa->depth_scale; + m[MAT_TZ] = v[MAT_TZ] * smesa->depth_scale; +} + +static void sisDDViewport( GLcontext *ctx, + GLint x, GLint y, + GLsizei width, GLsizei height ) +{ + sisCalcViewport( ctx ); +} + +static void sisDDDepthRange( GLcontext *ctx, + GLclampd nearval, GLclampd farval ) +{ + sisCalcViewport( ctx ); +} + +/* ============================================================= + * Miscellaneous + */ + +static void +sisDDLogicOpCode( GLcontext *ctx, GLenum opcode ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + if (!ctx->Color.ColorLogicOpEnabled) + return; + + current->hwDstSet &= ~MASK_ROP2; + switch (opcode) + { + case GL_CLEAR: + current->hwDstSet |= LOP_CLEAR; + break; + case GL_SET: + current->hwDstSet |= LOP_SET; + break; + case GL_COPY: + current->hwDstSet |= LOP_COPY; + break; + case GL_COPY_INVERTED: + current->hwDstSet |= LOP_COPY_INVERTED; + break; + case GL_NOOP: + current->hwDstSet |= LOP_NOOP; + break; + case GL_INVERT: + current->hwDstSet |= LOP_INVERT; + break; + case GL_AND: + current->hwDstSet |= LOP_AND; + break; + case GL_NAND: + current->hwDstSet |= LOP_NAND; + break; + case GL_OR: + current->hwDstSet |= LOP_OR; + break; + case GL_NOR: + current->hwDstSet |= LOP_NOR; + break; + case GL_XOR: + current->hwDstSet |= LOP_XOR; + break; + case GL_EQUIV: + current->hwDstSet |= LOP_EQUIV; + break; + case GL_AND_REVERSE: + current->hwDstSet |= LOP_AND_REVERSE; + break; + case GL_AND_INVERTED: + current->hwDstSet |= LOP_AND_INVERTED; + break; + case GL_OR_REVERSE: + current->hwDstSet |= LOP_OR_REVERSE; + break; + case GL_OR_INVERTED: + current->hwDstSet |= LOP_OR_INVERTED; + break; + } + + if (current->hwDstSet ^ prev->hwDstSet) { + prev->hwDstSet = current->hwDstSet; + smesa->GlobalFlag |= GFLAG_DESTSETTING; + } +} + +void sisDDDrawBuffer( GLcontext *ctx, GLenum mode ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + /* + * _DrawDestMask is easier to cope with than . + */ + switch ( ctx->Color._DrawDestMask ) { + case FRONT_LEFT_BIT: + case BACK_LEFT_BIT: + FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE ); + break; + default: + /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ + FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_TRUE ); + return; + } + + /* We want to update the s/w rast state too so that sisDDSetBuffer() + * gets called. + */ + _swrast_DrawBuffer(ctx, mode); + + current->hwOffsetDest = (smesa->drawOffset) >> 1; + current->hwDstSet &= ~MASK_DstBufferPitch; + current->hwDstSet |= smesa->drawPitch >> 2; + + if (current->hwDstSet != prev->hwDstSet) { + prev->hwDstSet = current->hwDstSet; + smesa->GlobalFlag |= GFLAG_DESTSETTING; + } + + if (current->hwOffsetDest != prev->hwOffsetDest) { + prev->hwOffsetDest = current->hwOffsetDest; + smesa->GlobalFlag |= GFLAG_DESTSETTING; + } +} + +/* ============================================================= + * Polygon stipple + */ + +/* ============================================================= + * Render mode + */ + +/* ============================================================= + * State enable/disable + */ + +static void +sisDDEnable( GLcontext * ctx, GLenum cap, GLboolean state ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + __GLSiSHardware *current = &smesa->current; + + switch (cap) + { + case GL_ALPHA_TEST: + if (state) + current->hwCapEnable |= MASK_AlphaTestEnable; + else + current->hwCapEnable &= ~MASK_AlphaTestEnable; + break; + case GL_BLEND: + /* TODO: */ + if (state) + /* if (state & !ctx->Color.ColorLogicOpEnabled) */ + current->hwCapEnable |= MASK_BlendEnable; + else + current->hwCapEnable &= ~MASK_BlendEnable; + break; + case GL_CULL_FACE: + if (state) + current->hwCapEnable |= MASK_CullEnable; + else + current->hwCapEnable &= ~MASK_CullEnable; + break; + case GL_DEPTH_TEST: + if (state && smesa->depthbuffer) + current->hwCapEnable |= MASK_ZTestEnable; + else + current->hwCapEnable &= ~MASK_ZTestEnable; + sisDDDepthMask( ctx, ctx->Depth.Mask ); + break; + case GL_DITHER: + if (state) + current->hwCapEnable |= MASK_DitherEnable; + else + current->hwCapEnable &= ~MASK_DitherEnable; + break; + case GL_FOG: + if (state) + current->hwCapEnable |= MASK_FogEnable; + else + current->hwCapEnable &= ~MASK_FogEnable; + break; + case GL_COLOR_LOGIC_OP: + if (state) + sisDDLogicOpCode( ctx, ctx->Color.LogicOp ); + else + sisDDLogicOpCode( ctx, GL_COPY ); + break; + case GL_SCISSOR_TEST: + sisUpdateClipping( ctx ); + break; + case GL_STENCIL_TEST: + if (state) { + if (smesa->zFormat != SiS_ZFORMAT_S8Z24) + FALLBACK(smesa, SIS_FALLBACK_STENCIL, 1); + else + current->hwCapEnable |= (MASK_StencilTestEnable | + MASK_StencilWriteEnable); + } else { + FALLBACK(smesa, SIS_FALLBACK_STENCIL, 0); + current->hwCapEnable &= ~(MASK_StencilTestEnable | + MASK_StencilWriteEnable); + } + break; + } +} + +/* ============================================================= + * Pixel functions + */ + +static void +sisDDDrawPixels( GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + LOCK_HARDWARE(); + _swrast_DrawPixels( ctx, x, y, width, height, format, type, unpack, pixels ); + UNLOCK_HARDWARE(); +} + +static void +sisDDReadPixels( GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *pack, + GLvoid *pixels ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + LOCK_HARDWARE(); + _swrast_ReadPixels( ctx, x, y, width, height, format, type, pack, + pixels); + UNLOCK_HARDWARE(); +} + +static void +sisDDBitmap( GLcontext *ctx, GLint px, GLint py, + GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + LOCK_HARDWARE(); + _swrast_Bitmap( ctx, px, py, width, height, unpack, bitmap ); + UNLOCK_HARDWARE(); +} + +/* ============================================================= + * State initialization, management + */ + +/* Called before beginning of rendering. */ +void +sisUpdateHWState( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + if (smesa->NewGLState & _NEW_TEXTURE) + sisUpdateTextureState( ctx ); + + /* enable setting 1 */ + if (current->hwCapEnable ^ prev->hwCapEnable) { + prev->hwCapEnable = current->hwCapEnable; + smesa->GlobalFlag |= GFLAG_ENABLESETTING; + } + + /* enable setting 2 */ + if (current->hwCapEnable2 ^ prev->hwCapEnable2) { + prev->hwCapEnable2 = current->hwCapEnable2; + smesa->GlobalFlag |= GFLAG_ENABLESETTING2; + } + + if (smesa->GlobalFlag & GFLAG_RENDER_STATES) + sis_update_render_state( smesa ); + + if (smesa->GlobalFlag & GFLAG_TEXTURE_STATES) + sis_update_texture_state( smesa ); +} + +static void +sisDDInvalidateState( GLcontext *ctx, GLuint new_state ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + _swrast_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); + _ac_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); + smesa->NewGLState |= new_state; +} + +/* Initialize the context's hardware state. + */ +void sisDDInitState( sisContextPtr smesa ) +{ + __GLSiSHardware *current = &smesa->current; + __GLSiSHardware *prev = &(smesa->prev); + GLcontext *ctx = smesa->glCtx; + + /* add Texture Perspective Enable */ + prev->hwCapEnable = MASK_FogPerspectiveEnable | MASK_TextureCacheEnable | + MASK_TexturePerspectiveEnable | MASK_DitherEnable; + /*| MASK_SpecularEnable*/ + + /* + prev->hwCapEnable2 = 0x00aa0080; + */ + /* if multi-texture enabled, disable Z pre-test */ + prev->hwCapEnable2 = MASK_TextureMipmapBiasEnable; + + /* Z test mode is LESS */ + prev->hwZ = SiS_Z_COMP_S_LT_B; + + /* Depth mask */ + prev->hwZMask = 0xffffffff; + + /* Alpha test mode is ALWAYS, alpha ref value is 0 */ + prev->hwAlpha = SiS_ALPHA_ALWAYS; + + /* ROP2 is COPYPEN */ + prev->hwDstSet = LOP_COPY; + + /* color mask */ + prev->hwDstMask = 0xffffffff; + + /* LinePattern is 0, Repeat Factor is 0 */ + prev->hwLinePattern = 0x00008000; + + /* Src blend is BLEND_ONE, Dst blend is D3DBLEND_ZERO */ + prev->hwDstSrcBlend = SiS_S_ONE | SiS_D_ZERO; + + /* Stenciling disabled, function ALWAYS, ref value zero, mask all ones */ + prev->hwStSetting = STENCIL_FORMAT_8 | SiS_STENCIL_ALWAYS | 0xff; + /* Op is KEEP for all three operations */ + prev->hwStSetting2 = SiS_SFAIL_KEEP | SiS_SPASS_ZFAIL_KEEP | + SiS_SPASS_ZPASS_KEEP; + + /* Texture mapping mode is Tile */ +#if 0 + prev->texture[0].hwTextureSet = 0x00030000; +#endif + /* Magnified & minified texture filter is NEAREST */ +#if 0 + prev->texture[0].hwTextureMip = 0; +#endif + + /* Texture Blending setting -- use fragment color/alpha*/ + prev->hwTexBlendColor0 = STAGE0_C_CF; + prev->hwTexBlendColor1 = STAGE1_C_CF; + prev->hwTexBlendAlpha0 = STAGE0_A_AF; + prev->hwTexBlendAlpha1 = STAGE1_A_AF; + + switch (smesa->bytesPerPixel) + { + case 2: + prev->hwDstSet |= DST_FORMAT_RGB_565; + break; + case 4: + prev->hwDstSet |= DST_FORMAT_ARGB_8888; + break; + } + + switch (ctx->Visual.depthBits) + { + case 0: + prev->hwCapEnable &= ~MASK_ZWriteEnable; + case 16: + smesa->zFormat = SiS_ZFORMAT_Z16; + prev->hwCapEnable |= MASK_ZWriteEnable; + smesa->depth_scale = 1.0 / (GLfloat)0xffff; + break; + case 32: + smesa->zFormat = SiS_ZFORMAT_Z32; + prev->hwCapEnable |= MASK_ZWriteEnable; + smesa->depth_scale = 1.0 / (GLfloat)0xffffffff; + break; + case 24: + assert (ctx->Visual.stencilBits); + smesa->zFormat = SiS_ZFORMAT_S8Z24; + prev->hwCapEnable |= MASK_StencilBufferEnable; + prev->hwCapEnable |= MASK_ZWriteEnable; + smesa->depth_scale = 1.0 / (GLfloat)0xffffff; + break; + } + + prev->hwZ |= smesa->zFormat; + + /* TODO: need to clear cache? */ + smesa->clearTexCache = GL_TRUE; + + smesa->clearColorPattern = 0; + + smesa->AGPParseSet = MASK_PsTexture1FromB; + smesa->dwPrimitiveSet = OP_3D_Texture1FromB | OP_3D_TextureBumpFromC; + + sisUpdateZStencilPattern( smesa, 1.0, 0 ); + sisUpdateCull( ctx ); + + memcpy( current, prev, sizeof (__GLSiSHardware) ); + + /* Set initial fog settings. Start and end are the same case. */ + sisDDFogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density ); + sisDDFogfv( ctx, GL_FOG_END, &ctx->Fog.End ); + sisDDFogfv( ctx, GL_FOG_MODE, NULL ); +} + +/* Initialize the driver's state functions. + */ +void sisDDInitStateFuncs( GLcontext *ctx ) +{ + ctx->Driver.UpdateState = sisDDInvalidateState; + + ctx->Driver.Clear = sisDDClear; + ctx->Driver.ClearColor = sisDDClearColor; + ctx->Driver.ClearDepth = sisDDClearDepth; + ctx->Driver.ClearStencil = sisDDClearStencil; + + ctx->Driver.AlphaFunc = sisDDAlphaFunc; + ctx->Driver.Bitmap = sisDDBitmap; + ctx->Driver.BlendFunc = sisDDBlendFunc; + ctx->Driver.ColorMask = sisDDColorMask; + ctx->Driver.CullFace = sisDDCullFace; + ctx->Driver.DepthMask = sisDDDepthMask; + ctx->Driver.DepthFunc = sisDDDepthFunc; + ctx->Driver.DepthRange = sisDDDepthRange; + ctx->Driver.DrawBuffer = sisDDDrawBuffer; + ctx->Driver.DrawPixels = sisDDDrawPixels; + ctx->Driver.Enable = sisDDEnable; + ctx->Driver.FrontFace = sisDDFrontFace; + ctx->Driver.Fogfv = sisDDFogfv; + ctx->Driver.Hint = NULL; + ctx->Driver.Lightfv = NULL; + ctx->Driver.LogicOpcode = sisDDLogicOpCode; + ctx->Driver.PolygonMode = NULL; + ctx->Driver.PolygonStipple = NULL; + ctx->Driver.ReadBuffer = NULL; + ctx->Driver.ReadPixels = sisDDReadPixels; + ctx->Driver.RenderMode = NULL; + ctx->Driver.Scissor = sisDDScissor; + ctx->Driver.ShadeModel = sisDDShadeModel; + ctx->Driver.Viewport = sisDDViewport; + + /* Pixel path fallbacks. + */ + ctx->Driver.Accum = _swrast_Accum; + ctx->Driver.CopyPixels = _swrast_CopyPixels; + + /* Swrast hooks for imaging extensions: + */ + ctx->Driver.CopyColorTable = _swrast_CopyColorTable; + ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; + ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; +} Index: xc/lib/GL/mesa/src/drv/sis/sis_state.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_state.h:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_state.h Mon Dec 8 19:15:22 2003 @@ -0,0 +1,57 @@ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_state.h,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ + +/* + * Authors: + * Eric Anholt + */ + +#ifndef __SIS_STATE_H__ +#define __SIS_STATE_H__ + +#ifdef GLX_DIRECT_RENDERING + +#include "sis_context.h" + +extern void sisDDInitState( sisContextPtr smesa ); +extern void sisDDInitStateFuncs( GLcontext *ctx ); + +extern void sisDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, + GLint x, GLint y, GLint width, GLint height ); +extern void sisDDClearColor( GLcontext * ctx, const GLfloat color[4] ); +extern void sisDDClearDepth( GLcontext * ctx, GLclampd d ); +extern void sisDDClearStencil( GLcontext * ctx, GLint s ); +extern void sisDDFogfv( GLcontext * ctx, GLenum pname, const GLfloat * params ); +extern void sisDDDepthMask( GLcontext * ctx, GLboolean flag ); + +extern void sisUpdateClipping( GLcontext * gc ); +extern void sisUpdateZStencilPattern( sisContextPtr smesa, GLclampd z, + int stencil ); +extern void sisDDDrawBuffer( GLcontext *ctx, GLenum mode ); +extern void sisUpdateHWState( GLcontext *ctx ); + +#endif +#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_stencil.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_stencil.c:1.3 xc/lib/GL/mesa/src/drv/sis/sis_stencil.c:1.5 --- xc/lib/GL/mesa/src/drv/sis/sis_stencil.c:1.3 Tue Sep 26 11:56:49 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_stencil.c Mon Dec 8 19:15:22 2003 @@ -1,52 +1,52 @@ /************************************************************************** Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt All Rights Reserved. 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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. **************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_stencil.c,v 1.3 2000/09/26 15:56:49 tsi Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_stencil.c,v 1.5 2003/12/09 00:15:22 alanh Exp $ */ /* * Authors: - * Sung-Ching Lin - * + * Sung-Ching Lin + * Eric Anholt */ -#include "sis_ctx.h" -#include "sis_mesa.h" +#include "sis_context.h" +#include "sis_state.h" +#include "sis_stencil.h" -void -sis_StencilFunc (GLcontext * ctx, GLenum func, GLint ref, GLuint mask) +static void +sisDDStencilFunc( GLcontext * ctx, GLenum func, GLint ref, GLuint mask ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - /* set reference */ - current->hwStSetting = ((DWORD) ref << 8) | mask; + sisContextPtr smesa = SIS_CONTEXT(ctx); + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + /* set reference */ + current->hwStSetting = STENCIL_FORMAT_8 | (ctx->Stencil.Ref[0] << 8) | + ctx->Stencil.ValueMask[0]; - current->hwStSetting &= ~0x07000000; switch (func) { case GL_NEVER: @@ -75,35 +75,33 @@ break; } - if ((current->hwStSetting2 ^ prev->hwStSetting2) || - (current->hwStSetting ^ prev->hwStSetting)) - { + if (current->hwStSetting != prev->hwStSetting) + { prev->hwStSetting = current->hwStSetting; - prev->hwStSetting2 = current->hwStSetting2; - hwcx->GlobalFlag |= GFLAG_STENCILSETTING; - } + smesa->GlobalFlag |= GFLAG_STENCILSETTING; + } } -void -sis_StencilMask (GLcontext * ctx, GLuint mask) +static void +sisDDStencilMask( GLcontext * ctx, GLuint mask ) { - if (!ctx->Visual->StencilBits) + if (!ctx->Visual.stencilBits) return; /* set Z buffer Write Enable */ - sis_DepthMask (ctx, ctx->Depth.Mask); + sisDDDepthMask (ctx, ctx->Depth.Mask); } -void -sis_StencilOp (GLcontext * ctx, GLenum fail, GLenum zfail, GLenum zpass) +static void +sisDDStencilOp( GLcontext * ctx, GLenum fail, GLenum zfail, GLenum zpass ) { - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; + sisContextPtr smesa = SIS_CONTEXT(ctx); + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; - current->hwStSetting2 &= ~0x00777000; + current->hwStSetting2 &= ~(MASK_StencilZPassOp | MASK_StencilZFailOp | + MASK_StencilFailOp); switch (fail) { @@ -171,13 +169,17 @@ break; } - if ((current->hwStSetting2 ^ prev->hwStSetting2) || - (current->hwStSetting ^ prev->hwStSetting)) - { - prev->hwStSetting = current->hwStSetting; + if (current->hwStSetting2 != prev->hwStSetting2) + { prev->hwStSetting2 = current->hwStSetting2; + smesa->GlobalFlag |= GFLAG_STENCILSETTING; + } +} - hwcx->GlobalFlag |= GFLAG_STENCILSETTING; - - } +void +sisDDInitStencilFuncs( GLcontext *ctx ) +{ + ctx->Driver.StencilFunc = sisDDStencilFunc; + ctx->Driver.StencilMask = sisDDStencilMask; + ctx->Driver.StencilOp = sisDDStencilOp; } Index: xc/lib/GL/mesa/src/drv/sis/sis_stencil.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_stencil.h:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_stencil.h Mon Dec 8 19:15:22 2003 @@ -0,0 +1,40 @@ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_stencil.h,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ + +/* + * Authors: + * Eric Anholt + */ + +#ifndef __SIS_STENCIL_H__ +#define __SIS_STENCIL_H__ + +#ifdef GLX_DIRECT_RENDERING + +extern void sisDDInitStencilFuncs( GLcontext *ctx ); + +#endif +#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h:1.3 xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h:removed --- xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h:1.3 Tue Sep 26 11:56:49 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h Sat Feb 28 21:41:18 2004 @@ -1,187 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_swzfunc.h,v 1.3 2000/09/26 15:56:49 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -static void SIS_TAG (sis_WriteDepthSpan) (GLcontext * ctx, GLuint n, GLint x, - GLint y, const GLdepth depth[], - const GLubyte mask[]) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIS_SW_DTYPE *base = SIS_SW_Z_BASE (x, Y_FLIP (y)); - - int i; - for (i = 0; i < n; i++, base++) - { - if (mask[i]) - SIS_SW_I2D (depth[i], *base); - } -} - -static void SIS_TAG (sis_ReadDepthSpan) (GLcontext * ctx, GLuint n, GLint x, - GLint y, GLdepth depth[]) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIS_SW_DTYPE *base = SIS_SW_Z_BASE (x, Y_FLIP (y)); - - int i; - for (i = 0; i < n; i++, base++) - { - SIS_SW_D2I (*base, depth[i]); - } -} - -static void SIS_TAG (sis_WriteDepthPixels) (GLcontext * ctx, GLuint n, - const GLint x[], const GLint y[], - const GLdepth depth[], - const GLubyte mask[]) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIS_SW_DTYPE *base; - - int i; - for (i = 0; i < n; i++, base++) - { - if (mask[i]) - { - base = SIS_SW_Z_BASE (x[i], Y_FLIP (y[i])); - SIS_SW_I2D (depth[i], *base); - } - } -} - -static void SIS_TAG (sis_ReadDepthPixels) (GLcontext * ctx, GLuint n, - const GLint x[], const GLint y[], - GLdepth depth[]) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIS_SW_DTYPE *base; - - int i; - for (i = 0; i < n; i++, base++) - { - base = SIS_SW_Z_BASE (x[i], Y_FLIP (y[i])); - SIS_SW_D2I (*base, depth[i]); - } -} - -#ifdef SIS_SW_STENCIL_FUNC - -static void SIS_TAG (sis_WriteStencilSpan) (GLcontext * ctx, GLuint n, - GLint x, GLint y, - const GLstencil depth[], - const GLubyte mask[]) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIS_SW_DTYPE *base = SIS_SW_Z_BASE (x, Y_FLIP (y)); - - int i; - for (i = 0; i < n; i++, base++) - { - if (mask[i]) - SIS_SW_I2S (depth[i], *base); - } -} - -static void SIS_TAG (sis_ReadStencilSpan) (GLcontext * ctx, GLuint n, GLint x, - GLint y, GLstencil depth[]) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIS_SW_DTYPE *base = SIS_SW_Z_BASE (x, Y_FLIP (y)); - - int i; - for (i = 0; i < n; i++, base++) - { - SIS_SW_S2I (*base, depth[i]); - } -} - -static void SIS_TAG (sis_WriteStencilPixels) (GLcontext * ctx, GLuint n, - const GLint x[], - const GLint y[], - const GLstencil depth[], - const GLubyte mask[]) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIS_SW_DTYPE *base; - - int i; - for (i = 0; i < n; i++, base++) - { - if (mask[i]) - { - base = SIS_SW_Z_BASE (x[i], Y_FLIP (y[i])); - SIS_SW_I2S (depth[i], *base); - } - } -} - -static void SIS_TAG (sis_ReadStencilPixels) (GLcontext * ctx, GLuint n, - const GLint x[], const GLint y[], - GLstencil depth[]) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIS_SW_DTYPE *base; - - int i; - for (i = 0; i < n; i++, base++) - { - base = SIS_SW_Z_BASE (x[i], Y_FLIP (y[i])); - SIS_SW_S2I (*base, depth[i]); - } -} - -# undef SIS_SW_S2I -# undef SIS_SW_I2S - -#endif - -#undef SIS_TAG -#undef SIS_SW_DTYPE -#undef SIS_SW_D2I -#undef SIS_SW_I2D Index: xc/lib/GL/mesa/src/drv/sis/sis_tex.c diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_tex.c:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_tex.c Mon Dec 8 19:15:22 2003 @@ -0,0 +1,473 @@ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_tex.c,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ + +/* + * Authors: + * Eric Anholt + */ + +#include "sis_context.h" +#include "sis_alloc.h" +#include "sis_tex.h" + +#include "swrast/swrast.h" +#include "imports.h" +#include "texformat.h" +#include "texstore.h" +#include "teximage.h" + +#define ALIGN(value, align) (char *)((long)(value + align - 1) & ~(align - 1)) + +#define TEXTURE_HW_ALIGNMENT 4 +#define TEXTURE_HW_PLUS (4 + 4) + +static sisTexObjPtr +sisAllocTexObj( struct gl_texture_object *texObj ) +{ + sisTexObjPtr t; + + t = (sisTexObjPtr) CALLOC_STRUCT( sis_tex_obj ); + texObj->DriverData = t; + return t; +} + +static void +sisAllocTexImage( sisContextPtr smesa, sisTexObjPtr t, int level, + const struct gl_texture_image *image ) +{ + char *addr; + int size, texel_size; + + if (t->format == 0) { + t->format = image->Format; + switch (t->format) + { + case GL_RGBA: + t->hwformat = TEXEL_ARGB_8888_32; + break; + case GL_INTENSITY: + t->hwformat = TEXEL_I8; + break; + case GL_ALPHA: + t->hwformat = TEXEL_A8; + break; + case GL_LUMINANCE: + t->hwformat = TEXEL_L8; + break; + case GL_LUMINANCE_ALPHA: + t->hwformat = TEXEL_AL88; + break; + case GL_RGB: + t->hwformat = TEXEL_ARGB_0888_32; + break; + default: + assert(0); + } + } + assert(t->format == image->Format); + + texel_size = image->TexFormat->TexelBytes; + size = image->Width * image->Height * texel_size + TEXTURE_HW_PLUS; + + addr = sisAllocFB( smesa, size, &t->image[level].handle ); + if (addr == NULL) { + addr = sisAllocAGP( smesa, size, &t->image[level].handle ); + if (addr == NULL) { + fprintf (stderr, "SIS driver : out of video/agp memory\n"); + sis_fatal_error(); + } + t->image[level].memType = AGP_TYPE; + } + else + t->image[level].memType = VIDEO_TYPE; + + t->image[level].Data = ALIGN(addr, TEXTURE_HW_ALIGNMENT); + t->image[level].pitch = image->Width * texel_size; + t->image[level].size = image->Width * image->Height * texel_size; + t->numImages++; +} + +static void +sisFreeTexImage( sisContextPtr smesa, sisTexObjPtr t, int level ) +{ + if (t->image[level].Data == NULL) + return; + + switch (t->image[level].memType) + { + case VIDEO_TYPE: + sisFreeFB( smesa, t->image[level].handle ); + break; + case AGP_TYPE: + sisFreeAGP( smesa, t->image[level].handle ); + break; + } + t->image[level].Data = NULL; + t->image[level].handle = NULL; + /* If there are no textures loaded any more, reset the hw format so the + * object can be reused for new formats + */ + t->numImages--; + if (t->numImages == 0) { + t->format = 0; + t->hwformat = 0; + } +} + +static void +sisDDTexEnv( GLcontext *ctx, GLenum target, GLenum pname, const GLfloat *param ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; +} + +static void +sisDDTexParameter( GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj, GLenum pname, + const GLfloat *params ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING; +} + +static void +sisDDBindTexture( GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + sisTexObjPtr t; + + if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) { + if ( texObj->DriverData == NULL ) { + sisAllocTexObj( texObj ); + } + } + + t = texObj->DriverData; + + if (t == NULL) + return; + + if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format) { + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; + smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format; + } + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING; +} + +static void +sisDDDeleteTexture( GLcontext * ctx, struct gl_texture_object *texObj ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + sisTexObjPtr t; + int i; + + smesa->clearTexCache = GL_TRUE; + + t = texObj->DriverData; + if (t == NULL) { + /* + * this shows the texture is default object and never be a + * argument of sisDDTexImage* + */ + return; + } + for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { + sisFreeTexImage( smesa, t, i ); + } + + FREE(t); + texObj->DriverData = NULL; +} + +static GLboolean sisDDIsTextureResident( GLcontext * ctx, + struct gl_texture_object *texObj ) +{ + return (texObj->DriverData != NULL); +} + +static const struct gl_texture_format * +sisDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, + GLenum format, GLenum type ) +{ + /* XXX 16-bit internal texture formats? */ + switch ( internalFormat ) { + case GL_ALPHA: + case GL_ALPHA4: + case GL_ALPHA8: + case GL_ALPHA12: + case GL_ALPHA16: + return &_mesa_texformat_a8; + case 1: + case GL_LUMINANCE: + case GL_LUMINANCE4: + case GL_LUMINANCE8: + case GL_LUMINANCE12: + case GL_LUMINANCE16: + return &_mesa_texformat_l8; + case 2: + case GL_LUMINANCE_ALPHA: + case GL_LUMINANCE4_ALPHA4: + case GL_LUMINANCE6_ALPHA2: + case GL_LUMINANCE8_ALPHA8: + case GL_LUMINANCE12_ALPHA4: + case GL_LUMINANCE12_ALPHA12: + case GL_LUMINANCE16_ALPHA16: + return &_mesa_texformat_al88; + case GL_INTENSITY: + case GL_INTENSITY4: + case GL_INTENSITY8: + case GL_INTENSITY12: + case GL_INTENSITY16: + return &_mesa_texformat_i8; + case GL_R3_G3_B2: + case GL_RGB4: + case GL_RGB5: + case 3: + case GL_RGB: + case GL_RGB8: + case GL_RGB10: + case GL_RGB12: + case GL_RGB16: + return &_mesa_texformat_argb8888 /*_mesa_texformat_rgb888*/; /* XXX */ + case GL_RGBA2: + case GL_RGBA4: + case GL_RGB5_A1: + case 4: + case GL_RGBA: + case GL_RGBA8: + case GL_RGB10_A2: + case GL_RGBA12: + case GL_RGBA16: + return &_mesa_texformat_argb8888; + default: + _mesa_problem(ctx, "unexpected format in tdfxDDChooseTextureFormat: %d", + internalFormat); + return NULL; + } +} + +static void sisDDTexImage1D( GLcontext *ctx, GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint border, + GLenum format, GLenum type, const GLvoid *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + sisTexObjPtr t; + + if ( texObj->DriverData == NULL ) + sisAllocTexObj( texObj ); + t = texObj->DriverData; + + /* Note, this will call sisDDChooseTextureFormat */ + _mesa_store_teximage1d( ctx, target, level, internalFormat, + width, border, format, type, + pixels, packing, texObj, texImage ); + + /* Allocate offscreen space for the texture */ + sisFreeTexImage(smesa, t, level); + sisAllocTexImage(smesa, t, level, texImage); + + /* Upload the texture */ + memcpy(t->image[level].Data, texImage->Data, t->image[level].size); + + if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format) + { + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; + smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format; + } + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING; +} + + +static void sisDDTexSubImage1D( GLcontext *ctx, + GLenum target, + GLint level, + GLint xoffset, + GLsizei width, + GLenum format, GLenum type, + const GLvoid *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + sisTexObjPtr t; + GLuint copySize; + GLint texelBytes; + char *src, *dst; + + if ( texObj->DriverData == NULL ) + sisAllocTexObj( texObj ); + t = texObj->DriverData; + + _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, + format, type, pixels, packing, texObj, + texImage); + + /* Allocate offscreen space for the texture */ + sisFreeTexImage(smesa, t, level); + sisAllocTexImage(smesa, t, level, texImage); + + /* Upload the texture */ + texelBytes = texImage->TexFormat->TexelBytes; + + copySize = width * texelBytes; + src = (char *)texImage->Data + xoffset * texelBytes; + dst = t->image[level].Data + xoffset * texelBytes; + + memcpy( dst, src, copySize ); + + smesa->clearTexCache = GL_TRUE; + + if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format) + { + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; + smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format; + } + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING; +} + +static void sisDDTexImage2D( GLcontext *ctx, GLenum target, GLint level, + GLint internalFormat, + GLint width, GLint height, GLint border, + GLenum format, GLenum type, const GLvoid *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + sisTexObjPtr t; + + if ( texObj->DriverData == NULL ) + sisAllocTexObj( texObj ); + t = texObj->DriverData; + + /* Note, this will call sisDDChooseTextureFormat */ + _mesa_store_teximage2d(ctx, target, level, internalFormat, + width, height, border, format, type, pixels, + &ctx->Unpack, texObj, texImage); + + /* Allocate offscreen space for the texture */ + sisFreeTexImage(smesa, t, level); + sisAllocTexImage(smesa, t, level, texImage); + + /* Upload the texture */ + memcpy(t->image[level].Data, texImage->Data, t->image[level].size); + + if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format) + { + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; + smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format; + } + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING; +} + +static void sisDDTexSubImage2D( GLcontext *ctx, + GLenum target, + GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + sisTexObjPtr t; + GLuint copySize; + GLint texelBytes; + char *src, *dst; + int j; + GLuint soffset; + + if ( texObj->DriverData == NULL ) + sisAllocTexObj( texObj ); + t = texObj->DriverData; + + _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, + height, format, type, pixels, packing, texObj, + texImage); + + /* Allocate offscreen space for the texture */ + sisFreeTexImage(smesa, t, level); + sisAllocTexImage(smesa, t, level, texImage); + + /* Upload the texture */ + texelBytes = texImage->TexFormat->TexelBytes; + + copySize = width * texelBytes; + src = (char *)texImage->Data + (xoffset + yoffset * texImage->Width) * + texelBytes; + dst = t->image[level].Data + (xoffset + yoffset * texImage->Width) * + texelBytes; + soffset = texImage->Width * texelBytes; + + for (j = yoffset; j < yoffset + height; j++) { + memcpy( dst, src, copySize ); + src += soffset; + dst += soffset; + } + + smesa->clearTexCache = GL_TRUE; + + if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format) + { + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; + smesa->PrevTexFormat[ctx->Texture.CurrentUnit] = t->format; + } + smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING; + +} + +void sisDDInitTextureFuncs( GLcontext *ctx ) +{ + ctx->Driver.TexEnv = sisDDTexEnv; + ctx->Driver.ChooseTextureFormat = sisDDChooseTextureFormat; + ctx->Driver.TexImage1D = sisDDTexImage1D; + ctx->Driver.TexSubImage1D = sisDDTexSubImage1D; + ctx->Driver.TexImage2D = sisDDTexImage2D; + ctx->Driver.TexSubImage2D = sisDDTexSubImage2D; + ctx->Driver.TexImage3D = _mesa_store_teximage3d; + ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + ctx->Driver.TexParameter = sisDDTexParameter; + ctx->Driver.BindTexture = sisDDBindTexture; + ctx->Driver.DeleteTexture = sisDDDeleteTexture; + ctx->Driver.IsTextureResident = sisDDIsTextureResident; + ctx->Driver.PrioritizeTexture = NULL; +} Index: xc/lib/GL/mesa/src/drv/sis/sis_tex.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_tex.h:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_tex.h Mon Dec 8 19:15:22 2003 @@ -0,0 +1,41 @@ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_tex.h,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ + +/* + * Authors: + * Eric Anholt + */ + +#ifndef __SIS_TEX_H__ +#define __SIS_TEX_H__ + +#ifdef GLX_DIRECT_RENDERING + +extern void sisDDInitTextureFuncs( GLcontext *ctx ); +extern void sisUpdateTextureState( GLcontext *ctx ); + +#endif /* GLX_DIRECT_RENDERING */ +#endif /* __SIS_TEX_H__ */ Index: xc/lib/GL/mesa/src/drv/sis/sis_texstate.c diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_texstate.c:1.3 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_texstate.c Mon Dec 8 19:15:22 2003 @@ -0,0 +1,672 @@ +/************************************************************************** + +Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. + +**************************************************************************/ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_texstate.c,v 1.3 2003/12/09 00:15:22 alanh Exp $ */ + +/* + * Authors: + * Sung-Ching Lin + * Eric Anholt + */ + +#include "glheader.h" +#include "imports.h" +#include "context.h" +#include "macros.h" +#include "texformat.h" + +#include "sis_context.h" +#include "sis_state.h" +#include "sis_tex.h" +#include "sis_tris.h" +#include "sis_alloc.h" + +static GLint TransferTexturePitch (GLint dwPitch); + +/* Handle texenv stuff, called from validate_texture (renderstart) */ +static void +sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, + int unit ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + struct gl_texture_unit *texture_unit = &ctx->Texture.Unit[unit]; + + sisTexObjPtr t = texObj->DriverData; + + switch (texture_unit->EnvMode) + { + case GL_REPLACE: + FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0); + switch (t->format) + { + case GL_ALPHA: + current->hwTexBlendColor0 = STAGE0_C_CF; + current->hwTexBlendAlpha0 = STAGE0_A_AS; + break; + case GL_LUMINANCE: + case GL_RGB: + current->hwTexBlendColor0 = STAGE0_C_CS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; + break; + case GL_INTENSITY: + case GL_LUMINANCE_ALPHA: + case GL_RGBA: + current->hwTexBlendColor0 = STAGE0_C_CS; + current->hwTexBlendAlpha0 = STAGE0_A_AS; + break; + } + break; + + case GL_MODULATE: + FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0); + switch (t->format) + { + case GL_ALPHA: + current->hwTexBlendColor0 = STAGE0_C_CF; + current->hwTexBlendAlpha0 = STAGE0_A_AFAS; + break; + case GL_LUMINANCE: + case GL_RGB: + current->hwTexBlendColor0 = STAGE0_C_CFCS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; + break; + case GL_INTENSITY: + case GL_LUMINANCE_ALPHA: + case GL_RGBA: + current->hwTexBlendColor0 = STAGE0_C_CFCS; + current->hwTexBlendAlpha0 = STAGE0_A_AFAS; + break; + } + break; + + case GL_DECAL: + FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0); + switch (t->format) + { + case GL_RGB: + current->hwTexBlendColor0 = STAGE0_C_CS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; + break; + case GL_RGBA: + current->hwTexBlendColor0 = STAGE0_C_CFOMAS_CSAS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; + break; + } + break; + + case GL_BLEND: + FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 1); +#if 0 /* XXX Blending broken */ + current->hwTexEnvColor = + ((GLint) (texture_unit->EnvColor[3])) << 24 | + ((GLint) (texture_unit->EnvColor[0])) << 16 | + ((GLint) (texture_unit->EnvColor[1])) << 8 | + ((GLint) (texture_unit->EnvColor[2])); + switch (t->format) + { + case GL_ALPHA: + current->hwTexBlendColor0 = STAGE0_C_CF; + current->hwTexBlendAlpha0 = STAGE0_A_AFAS; + break; + case GL_LUMINANCE: + case GL_RGB: + current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS; + current->hwTexBlendAlpha0 = STAGE0_A_AF; + break; + case GL_INTENSITY: + current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS; + current->hwTexBlendAlpha0 = STAGE0_A_AFOMAS_ACAS; + break; + case GL_LUMINANCE_ALPHA: + case GL_RGBA: + current->hwTexBlendColor0 = STAGE0_C_CFOMCS_CCCS; + current->hwTexBlendAlpha0 = STAGE0_A_AFAS; + break; + } + break; +#endif + } + + if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) || + (current->hwTexBlendAlpha0 != prev->hwTexBlendAlpha0) || + (current->hwTexEnvColor != prev->hwTexEnvColor)) + { + prev->hwTexEnvColor = current->hwTexEnvColor; + prev->hwTexBlendColor0 = current->hwTexBlendColor0; + prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0; + smesa->GlobalFlag |= GFLAG_TEXTUREENV; + } +} + +/* Handle texenv stuff, called from validate_texture (renderstart) */ +static void +sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, + int unit) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + struct gl_texture_unit *texture_unit = &ctx->Texture.Unit[unit]; + + sisTexObjPtr t = texObj->DriverData; + + switch (texture_unit->EnvMode) + { + case GL_REPLACE: + FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 0); + switch (t->format) + { + case GL_ALPHA: + current->hwTexBlendColor1 = STAGE1_C_CF; + current->hwTexBlendAlpha1 = STAGE1_A_AS; + break; + case GL_LUMINANCE: + case GL_RGB: + current->hwTexBlendColor1 = STAGE1_C_CS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; + break; + case GL_INTENSITY: + case GL_LUMINANCE_ALPHA: + case GL_RGBA: + current->hwTexBlendColor1 = STAGE1_C_CS; + current->hwTexBlendAlpha1 = STAGE1_A_AS; + break; + } + break; + + case GL_MODULATE: + FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 0); + switch (t->format) + { + case GL_ALPHA: + current->hwTexBlendColor1 = STAGE1_C_CF; + current->hwTexBlendAlpha1 = STAGE1_A_AFAS; + break; + case GL_LUMINANCE: + case GL_RGB: + current->hwTexBlendColor1 = STAGE1_C_CFCS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; + break; + case GL_INTENSITY: + case GL_LUMINANCE_ALPHA: + case GL_RGBA: + current->hwTexBlendColor1 = STAGE1_C_CFCS; + current->hwTexBlendAlpha1 = STAGE1_A_AFAS; + break; + } + break; + + case GL_DECAL: + FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 0); + switch (t->format) + { + case GL_RGB: + current->hwTexBlendColor1 = STAGE1_C_CS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; + break; + case GL_RGBA: + current->hwTexBlendColor1 = STAGE1_C_CFOMAS_CSAS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; + break; + } + break; + + case GL_BLEND: + FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 1); +#if 0 /* XXX Blending broken */ + current->hwTexEnvColor = + ((GLint) (texture_unit->EnvColor[3])) << 24 | + ((GLint) (texture_unit->EnvColor[0])) << 16 | + ((GLint) (texture_unit->EnvColor[1])) << 8 | + ((GLint) (texture_unit->EnvColor[2])); + switch (t->format) + { + case GL_ALPHA: + current->hwTexBlendColor1 = STAGE1_C_CF; + current->hwTexBlendAlpha1 = STAGE1_A_AFAS; + break; + case GL_LUMINANCE: + case GL_RGB: + current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS; + current->hwTexBlendAlpha1 = STAGE1_A_AF; + break; + case GL_INTENSITY: + current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS; + current->hwTexBlendAlpha1 = STAGE1_A_AFOMAS_ACAS; + break; + case GL_LUMINANCE_ALPHA: + case GL_RGBA: + current->hwTexBlendColor1 = STAGE1_C_CFOMCS_CCCS; + current->hwTexBlendAlpha1 = STAGE1_A_AFAS; + break; + } + break; +#endif + } + + if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) || + (current->hwTexBlendAlpha1 != prev->hwTexBlendAlpha1) || + (current->hwTexEnvColor != prev->hwTexEnvColor)) + { + prev->hwTexBlendColor1 = current->hwTexBlendColor1; + prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1; + prev->hwTexEnvColor = current->hwTexEnvColor; + smesa->GlobalFlag |= GFLAG_TEXTUREENV_1; + } +} + +/* Returns 0 if a software fallback is necessary */ +static GLboolean +sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj, + int hw_unit ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + int ok = 1; + + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + sisTexObjPtr t = texObj->DriverData; + + GLint firstLevel, lastLevel; + GLint i; + + current->texture[hw_unit].hwTextureMip = 0UL; + current->texture[hw_unit].hwTextureSet = t->hwformat; + + if ((texObj->MinFilter == GL_NEAREST) || (texObj->MinFilter == GL_LINEAR)) { + firstLevel = lastLevel = texObj->BaseLevel; + } else { + /* Compute which mipmap levels we really want to send to the hardware. + * This depends on the base image size, GL_TEXTURE_MIN_LOD, + * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL. + * Yes, this looks overly complicated, but it's all needed. + */ + + firstLevel = texObj->BaseLevel + (GLint)(texObj->MinLod + 0.5); + firstLevel = MAX2(firstLevel, texObj->BaseLevel); + lastLevel = texObj->BaseLevel + (GLint)(texObj->MaxLod + 0.5); + lastLevel = MAX2(lastLevel, texObj->BaseLevel); + lastLevel = MIN2(lastLevel, texObj->BaseLevel + + texObj->Image[texObj->BaseLevel]->MaxLog2); + lastLevel = MIN2(lastLevel, texObj->MaxLevel); + lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ + } + + current->texture[hw_unit].hwTextureSet |= (lastLevel << 8); + + switch (texObj->MagFilter) + { + case GL_NEAREST: + current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_NEAREST; + break; + case GL_LINEAR: + current->texture[hw_unit].hwTextureMip |= (TEXTURE_FILTER_LINEAR << 3); + break; + } + + { + GLint b; + + /* The mipmap lod biasing is based on experiment. It seems there's a + * limit of around +4/-4 to the bias value; we're being conservative. + */ + b = (GLint) (ctx->Texture.Unit[hw_unit].LodBias * 32.0); + if (b > 127) + b = 127; + else if (b < -128) + b = -128; + + current->texture[hw_unit].hwTextureMip |= ((b << 4) & + MASK_TextureMipmapLodBias); + } + + switch (texObj->MinFilter) + { + case GL_NEAREST: + current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_NEAREST; + break; + case GL_LINEAR: + current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_LINEAR; + break; + case GL_NEAREST_MIPMAP_NEAREST: + current->texture[hw_unit].hwTextureMip |= + TEXTURE_FILTER_NEAREST_MIP_NEAREST; + break; + case GL_NEAREST_MIPMAP_LINEAR: + current->texture[hw_unit].hwTextureMip |= + TEXTURE_FILTER_NEAREST_MIP_LINEAR; + break; + case GL_LINEAR_MIPMAP_NEAREST: + current->texture[hw_unit].hwTextureMip |= + TEXTURE_FILTER_LINEAR_MIP_NEAREST; + break; + case GL_LINEAR_MIPMAP_LINEAR: + current->texture[hw_unit].hwTextureMip |= + TEXTURE_FILTER_LINEAR_MIP_LINEAR; + break; + } + + switch (texObj->WrapS) + { + case GL_REPEAT: + current->texture[hw_unit].hwTextureSet |= MASK_TextureWrapU; + break; + case GL_CLAMP: + current->texture[hw_unit].hwTextureSet |= MASK_TextureClampU; + break; + case GL_CLAMP_TO_EDGE: + /* + * ?? not support yet + */ + ok = 0; + break; + } + + switch (texObj->WrapT) + { + case GL_REPEAT: + current->texture[hw_unit].hwTextureSet |= MASK_TextureWrapV; + break; + case GL_CLAMP: + current->texture[hw_unit].hwTextureSet |= MASK_TextureClampV; + break; + case GL_CLAMP_TO_EDGE: + /* + * ?? not support yet + */ + ok = 0; + break; + } + +/* + if (current->texture[hw_unit].hwTextureSet & MASK_TextureClampU) { + current->texture[hw_unit].hwTextureSet &= ~MASK_TextureClampU; + current->texture[hw_unit].hwTextureSet |= MASK_TextureBorderU; + } + + if (current->texture[hw_unit].hwTextureSet & MASK_TextureClampV) { + current->texture[hw_unit].hwTextureSet &= ~MASK_TextureClampV; + current->texture[hw_unit].hwTextureSet |= MASK_TextureBorderV; + } +*/ + current->texture[hw_unit].hwTextureBorderColor = + ((GLuint) texObj->BorderColor[3] << 24) + + ((GLuint) texObj->BorderColor[0] << 16) + + ((GLuint) texObj->BorderColor[1] << 8) + + ((GLuint) texObj->BorderColor[2]); + + if (current->texture[hw_unit].hwTextureBorderColor != + prev->texture[hw_unit].hwTextureBorderColor) + { + prev->texture[hw_unit].hwTextureBorderColor = + current->texture[hw_unit].hwTextureBorderColor; + if (hw_unit == 1) + smesa->GlobalFlag |= GFLAG_TEXBORDERCOLOR_1; + else + smesa->GlobalFlag |= GFLAG_TEXBORDERCOLOR; + } + + current->texture[hw_unit].hwTextureSet |= + texObj->Image[firstLevel]->WidthLog2 << 4; + current->texture[hw_unit].hwTextureSet |= + texObj->Image[firstLevel]->HeightLog2; + + if (hw_unit == 0) + smesa->GlobalFlag |= GFLAG_TEXTUREADDRESS; + else + smesa->GlobalFlag |= GFLAG_TEXTUREADDRESS_1; + + for (i = firstLevel; i <= lastLevel; i++) + { + GLuint texOffset = 0; + GLuint texPitch = TransferTexturePitch( t->image[i].pitch ); + + switch (t->image[i].memType) + { + case VIDEO_TYPE: + texOffset = ((unsigned long)t->image[i].Data - (unsigned long)smesa->FbBase); + break; + case AGP_TYPE: + texOffset = ((unsigned long)t->image[i].Data - (unsigned long)smesa->AGPBase) + + (unsigned long) smesa->AGPAddr; + current->texture[hw_unit].hwTextureMip |= + (MASK_TextureLevel0InSystem << i); + break; + } + + switch (i) + { + case 0: + prev->texture[hw_unit].texOffset0 = texOffset; + prev->texture[hw_unit].texPitch01 = texPitch << 16; + break; + case 1: + prev->texture[hw_unit].texOffset1 = texOffset; + prev->texture[hw_unit].texPitch01 |= texPitch; + break; + case 2: + prev->texture[hw_unit].texOffset2 = texOffset; + prev->texture[hw_unit].texPitch23 = texPitch << 16; + break; + case 3: + prev->texture[hw_unit].texOffset3 = texOffset; + prev->texture[hw_unit].texPitch23 |= texPitch; + break; + case 4: + prev->texture[hw_unit].texOffset4 = texOffset; + prev->texture[hw_unit].texPitch45 = texPitch << 16; + break; + case 5: + prev->texture[hw_unit].texOffset5 = texOffset; + prev->texture[hw_unit].texPitch45 |= texPitch; + break; + case 6: + prev->texture[hw_unit].texOffset6 = texOffset; + prev->texture[hw_unit].texPitch67 = texPitch << 16; + break; + case 7: + prev->texture[hw_unit].texOffset7 = texOffset; + prev->texture[hw_unit].texPitch67 |= texPitch; + break; + case 8: + prev->texture[hw_unit].texOffset8 = texOffset; + prev->texture[hw_unit].texPitch89 = texPitch << 16; + break; + case 9: + prev->texture[hw_unit].texOffset9 = texOffset; + prev->texture[hw_unit].texPitch89 |= texPitch; + break; + case 10: + prev->texture[hw_unit].texOffset10 = texOffset; + prev->texture[hw_unit].texPitch10 = texPitch << 16; + break; + case 11: + prev->texture[hw_unit].texOffset11 = texOffset; + prev->texture[hw_unit].texPitch10 |= texPitch; + break; + } + } + + if (current->texture[hw_unit].hwTextureSet != + prev->texture[hw_unit].hwTextureSet) + { + prev->texture[hw_unit].hwTextureSet = + current->texture[hw_unit].hwTextureSet; + if (hw_unit == 1) + smesa->GlobalFlag |= CFLAG_TEXTURERESET_1; + else + smesa->GlobalFlag |= CFLAG_TEXTURERESET; + } + if (current->texture[hw_unit].hwTextureMip != + prev->texture[hw_unit].hwTextureMip) + { + prev->texture[hw_unit].hwTextureMip = + current->texture[hw_unit].hwTextureMip; + if (hw_unit == 1) + smesa->GlobalFlag |= GFLAG_TEXTUREMIPMAP_1; + else + smesa->GlobalFlag |= GFLAG_TEXTUREMIPMAP; + } + + return ok; +} + +/* Disable a texture unit, called from validate_texture */ +static void +sis_reset_texture_env (GLcontext *ctx, int hw_unit) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + __GLSiSHardware *prev = &smesa->prev; + __GLSiSHardware *current = &smesa->current; + + if (hw_unit == 1) + { + current->hwTexBlendColor1 = STAGE1_C_CF; + current->hwTexBlendAlpha1 = STAGE1_A_AF; + + if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) || + (current->hwTexBlendAlpha1 != prev->hwTexBlendAlpha1) || + (current->hwTexEnvColor != prev->hwTexEnvColor)) + { + prev->hwTexBlendColor1 = current->hwTexBlendColor1; + prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1; + prev->hwTexEnvColor = current->hwTexEnvColor; + smesa->GlobalFlag |= GFLAG_TEXTUREENV_1; + } + } else { + current->hwTexBlendColor0 = STAGE0_C_CF; + current->hwTexBlendAlpha0 = STAGE0_A_AF; + + if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) || + (current->hwTexBlendAlpha0 != prev->hwTexBlendAlpha0) || + (current->hwTexEnvColor != prev->hwTexEnvColor)) + { + prev->hwTexBlendColor0 = current->hwTexBlendColor0; + prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0; + prev->hwTexEnvColor = current->hwTexEnvColor; + smesa->GlobalFlag |= GFLAG_TEXTUREENV; + } + } +} + +static void updateTextureUnit( GLcontext *ctx, int unit ) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + struct gl_texture_object *texObj = texUnit->_Current; + GLint fallbackbit; + + if (unit == 0) + fallbackbit = SIS_FALLBACK_TEXTURE0; + else + fallbackbit = SIS_FALLBACK_TEXTURE1; + + if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) { + if (smesa->TexStates[unit] & NEW_TEXTURING) { + GLboolean ok; + + ok = sis_set_texobj_parm (ctx, texObj, unit); + FALLBACK( smesa, fallbackbit, !ok ); + } + if (smesa->TexStates[unit] & NEW_TEXTURE_ENV) { + if (unit == 0) + sis_set_texture_env0( ctx, texObj, unit ); + else + sis_set_texture_env1( ctx, texObj, unit ); + } + smesa->TexStates[unit] = 0; + } else if ( texUnit->_ReallyEnabled ) { + /* fallback */ + FALLBACK( smesa, fallbackbit, 1 ); + } else { + sis_reset_texture_env( ctx, unit ); + FALLBACK( smesa, fallbackbit, 0 ); + } +} + + +void sisUpdateTextureState( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + int i; + __GLSiSHardware *current = &smesa->current; + +#if 1 + /* TODO : if unmark these, error in multitexture */ /* XXX */ + for (i = 0; i < SIS_MAX_TEXTURES; i++) + smesa->TexStates[i] |= (NEW_TEXTURING | NEW_TEXTURE_ENV); +#endif + + updateTextureUnit( ctx, 0 ); + updateTextureUnit( ctx, 1 ); + + /* XXX Issues with the 2nd unit but not the first being enabled? */ + if ( ctx->Texture.Unit[0]._ReallyEnabled & + (TEXTURE_1D_BIT | TEXTURE_2D_BIT) || + ctx->Texture.Unit[1]._ReallyEnabled & + (TEXTURE_1D_BIT | TEXTURE_2D_BIT) ) + { + current->hwCapEnable |= MASK_TextureEnable; + current->hwCapEnable &= ~MASK_TextureNumUsed; + if (ctx->Texture.Unit[1]._ReallyEnabled) + current->hwCapEnable |= 0x00002000; + else + current->hwCapEnable |= 0x00001000; + } else { + current->hwCapEnable &= ~MASK_TextureEnable; + } +} + +static GLint +BitScanForward( GLshort w ) +{ + GLint i; + + for (i = 0; i < 16; i++) { + if (w & (1 << i)) + break; + } + return i; +} + +static GLint +TransferTexturePitch( GLint dwPitch ) +{ + GLint dwRet, i; + + i = BitScanForward( (GLshort)dwPitch ); + dwRet = dwPitch >> i; + dwRet |= i << 9; + return dwRet; +} Index: xc/lib/GL/mesa/src/drv/sis/sis_texture.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_texture.c:1.5 xc/lib/GL/mesa/src/drv/sis/sis_texture.c:removed --- xc/lib/GL/mesa/src/drv/sis/sis_texture.c:1.5 Tue Sep 26 11:56:49 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_texture.c Sat Feb 28 21:41:18 2004 @@ -1,928 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_texture.c,v 1.5 2000/09/26 15:56:49 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#include "sis_ctx.h" -#include "sis_mesa.h" - -static void -sis_set_texture_env0 (GLcontext * ctx, GLtextureObject * object, int unit); - -static void -sis_set_texture_env1 (GLcontext * ctx, GLtextureObject * object, int unit); - -static void -sis_set_texobj_parm (GLcontext * ctx, GLtextureObject * object, int hw_unit); - -static void sis_reset_texture_env (GLcontext * ctx, int hw_unit); - -static DWORD TransferTexturePitch (DWORD dwPitch); - -void -sis_validate_texture (GLcontext * ctx) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - struct gl_texture_unit *tex_unit; - struct gl_texture_object *tObj; - sisTexobjInfo *texObjArea; - - if(ctx->Texture.ReallyEnabled & (TEXTURE0_3D | TEXTURE1_3D)) - { - hwcx->swRenderFlag |= SIS_SW_TEXTURE_DIM; - return; - } - else - { - hwcx->swRenderFlag &= ~SIS_SW_TEXTURE_DIM; - } - - if ((ctx->Texture.ReallyEnabled & TEXTURE0_ANY) && - (ctx->Texture.ReallyEnabled & TEXTURE1_ANY)) - { - int unit; - - for (unit = 0; unit <= 1; unit++) - { - tex_unit = &ctx->Texture.Unit[unit]; - tObj = tex_unit->Current; - texObjArea = (sisTexobjInfo *) tObj->DriverData; - - if (hwcx->TexStates[unit] & NEW_TEXTURING) - { - hwcx->swRenderFlag &= ~(SIS_SW_TEXTURE_OBJ << unit); - sis_set_texobj_parm (ctx, tObj, unit); - } - - if (hwcx->TexStates[unit] & NEW_TEXTURE_ENV) - { - hwcx->swRenderFlag &= ~(SIS_SW_TEXTURE_ENV << unit); - if (unit == 0) - sis_set_texture_env0 (ctx, tObj, unit); - else - sis_set_texture_env1 (ctx, tObj, unit); - } - - hwcx->TexStates[unit] = 0; - } - } - else - { - int unit = (ctx->Texture.ReallyEnabled & TEXTURE0_ANY) ? 0 : 1; - - tex_unit = &ctx->Texture.Unit[unit]; - tObj = tex_unit->Current; - texObjArea = (sisTexobjInfo *) tObj->DriverData; - - if (hwcx->TexStates[unit] & NEW_TEXTURING) - sis_set_texobj_parm (ctx, tObj, unit); - - if (hwcx->TexStates[unit] & NEW_TEXTURE_ENV) - { - if(unit == 0){ - sis_set_texture_env0 (ctx, tObj, unit); - sis_reset_texture_env (ctx, 1); - } - else{ - sis_set_texture_env1 (ctx, tObj, unit); - sis_reset_texture_env (ctx, 0); - } - } - - hwcx->TexStates[unit] = 0; - } -} - -void -sis_TexEnv( GLcontext *ctx, GLenum target, GLenum pname, - const GLfloat *param ) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - hwcx->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; -} - -void -sis_TexImage (GLcontext * ctx, GLenum target, - struct gl_texture_object *tObj, GLint level, - GLint internalFormat, const struct gl_texture_image *image) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIStextureArea *area; - - if (target == GL_TEXTURE_3D || image->Border) - return; - - if (!tObj->DriverData) - { - sisTexobjInfo *info; - - info = (sisTexobjInfo *)calloc (1, sizeof (sisTexobjInfo)); - - /* TODO */ - assert(info); - - info->prev = info->next = NULL; - info->valid = GL_FALSE; - tObj->DriverData = info; - } - - if (image->DriverData) - { - /* image has a copy in video memory, and it may be in the cache */ - - ((sisTexobjInfo *) tObj->DriverData)->dirtyFlag |= SIS_TEX_ALL; - } - else - { - /* Optimize */ - ((sisTexobjInfo *) tObj->DriverData)->dirtyFlag |= (SIS_TEX_PARAMETER - | SIS_TEX_ENV); - } - - sis_alloc_texture_image (ctx, (struct gl_texture_image *) image); - - area = (SIStextureArea *) image->DriverData; - assert (area->Data); - - if (area->Format == GL_RGB8) - { - int i; - GLbyte *src = (GLbyte *)image->Data; - GLbyte *dst = area->Data; - - for (i = 0; i < area->Size / 4; i++) - { - *(DWORD *)dst = *(DWORD *)src & 0x00ffffff; - src += 3; - dst += 4; - } - } - else - { - memcpy (area->Data, image->Data, area->Size); - } - - if (hwcx->PrevTexFormat[ctx->Texture.CurrentUnit] != area->Format) - { - hwcx->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; - hwcx->PrevTexFormat[ctx->Texture.CurrentUnit] = area->Format; - } - hwcx->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING; -} - -void -sis_TexSubImage (GLcontext * ctx, GLenum target, - struct gl_texture_object *tObj, GLint level, GLint xoffset, - GLint yoffset, GLsizei width, GLsizei height, GLint - internalFormat, const struct gl_texture_image *image) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - SIStextureArea *area; - int i, j; - GLbyte *src, *dst; - GLuint soffset, doffset; - - area = (SIStextureArea *) image->DriverData; - - hwcx->clearTexCache = GL_TRUE; - - { - /* - * Optimize - */ - WaitEngIdle (hwcx); - } - - if (area->Format == GL_RGB8) - { - src = (GLbyte *)image->Data + (xoffset + yoffset * image->Width) * 3; - dst = area->Data + (xoffset + yoffset * image->Width) * 4; - soffset = (image->Width - width) * 3; - doffset = (image->Width - width) * 4; - for (j = yoffset; j < yoffset + height; j++) - { - for (i = xoffset; i < xoffset + width; i++) - { - *(DWORD *)dst = *(DWORD *)src & 0x00ffffff; - src += 3; - dst += 4; - } - src += soffset; - dst += doffset; - } - } - else - { - GLuint texelSize = area->texelSize; - GLuint copySize = texelSize * width; - - src = (GLbyte *)image->Data + - (xoffset + yoffset * image->Width) * texelSize; - dst = area->Data + (xoffset + yoffset * image->Width) * texelSize; - soffset = image->Width * texelSize; - - for (j = yoffset; j < yoffset + height; j++) - { - memcpy (dst, src, copySize); - src += soffset; - dst += soffset; - } - } -} - -void -sis_TexParameter (GLcontext * ctx, GLenum target, - struct gl_texture_object *tObj, GLenum pname, const - GLfloat * params) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - if (tObj->DriverData) - ((sisTexobjInfo *) tObj->DriverData)->dirtyFlag |= SIS_TEX_PARAMETER; - - hwcx->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING; -} - -void -sis_BindTexture (GLcontext * ctx, GLenum target, - struct gl_texture_object *tObj) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - SIStextureArea *area; - - if (!tObj->Image[0]) - return; - - if (!(area = (SIStextureArea *) tObj->Image[0]->DriverData)) - return; - - if (hwcx->PrevTexFormat[ctx->Texture.CurrentUnit] != area->Format) - { - hwcx->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; - hwcx->PrevTexFormat[ctx->Texture.CurrentUnit] = area->Format; - } - hwcx->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURING; -} - -void -sis_DeleteTexture (GLcontext * ctx, struct gl_texture_object *tObj) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - int i; - - for (i = 0; i < MAX_TEXTURE_LEVELS; i++) - { - if (tObj->Image[i]) - sis_free_texture_image (tObj->Image[i]); - } - - if (tObj->DriverData) - { - free (tObj->DriverData); - tObj->DriverData = NULL; - } - else - { - /* - * this shows the texture is default object and never be a - * argument of sis_TexImage - */ - } - - hwcx->clearTexCache = GL_TRUE; -} - -void -sis_UpdateTexturePalette (GLcontext * ctx, struct gl_texture_object *tObj) -{ - -} - -void -sis_UseGlobalTexturePalette (GLcontext * ctx, GLboolean state) -{ - -} - -void -sis_ActiveTexture (GLcontext * ctx, GLuint texUnitNumber) -{ -} - -GLboolean sis_IsTextureResident (GLcontext * ctx, struct gl_texture_object *t) -{ - return GL_TRUE; -} - -void -sis_PrioritizeTexture (GLcontext * ctx, - struct gl_texture_object *t, GLclampf priority) -{ -} - -static void -sis_set_texture_env0 (GLcontext * ctx, GLtextureObject * object, int unit) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - struct gl_texture_unit *texture_unit = &ctx->Texture.Unit[unit]; - - GLtextureImage *image = object->Image[0]; - SIStextureArea *area = (SIStextureArea *) image->DriverData; - - /* - current->hwTexBlendClr1 = RGB_STAGE1; - current->hwTexBlendAlpha1 = A_STAGE1; - */ - - switch (texture_unit->EnvMode) - { - case GL_REPLACE: - switch (area->Format) - { - case GL_ALPHA8: - current->hwTexBlendClr0 = A_REPLACE_RGB_STAGE0; - current->hwTexBlendAlpha0 = A_REPLACE_A_STAGE0; - break; - case GL_INTENSITY8: - case GL_RGB8: - current->hwTexBlendClr0 = RGB_REPLACE__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGB_REPLACE__A_STAGE0; - break; - case GL_LUMINANCE8: - case GL_LUMINANCE8_ALPHA8: - case GL_RGBA8: - current->hwTexBlendClr0 = RGBA_REPLACE__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGBA_REPLACE__A_STAGE0; - break; - } - break; - - case GL_MODULATE: - switch (area->Format) - { - case GL_ALPHA8: - current->hwTexBlendClr0 = A_MODULATE_RGB_STAGE0; - current->hwTexBlendAlpha0 = A_MODULATE_A_STAGE0; - break; - case GL_LUMINANCE8: - case GL_RGB8: - current->hwTexBlendClr0 = RGB_MODULATE__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGB_MODULATE__A_STAGE0; - break; - case GL_INTENSITY8: - case GL_LUMINANCE8_ALPHA8: - case GL_RGBA8: - current->hwTexBlendClr0 = RGBA_MODULATE__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGBA_MODULATE__A_STAGE0; - break; - } - break; - - case GL_DECAL: - switch (area->Format) - { - case GL_RGB8: - current->hwTexBlendClr0 = RGB_DECAL__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGB_DECAL__A_STAGE0; - break; - case GL_RGBA8: - current->hwTexBlendClr0 = RGBA_DECAL__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGBA_DECAL__A_STAGE0; - break; - } - break; - - case GL_BLEND: - current->hwTexEnvColor = - ((DWORD) (texture_unit->EnvColor[3])) << 24 | - ((DWORD) (texture_unit->EnvColor[0])) << 16 | - ((DWORD) (texture_unit->EnvColor[1])) << 8 | - ((DWORD) (texture_unit->EnvColor[2])); - switch (area->Format) - { - case GL_ALPHA8: - current->hwTexBlendClr0 = A_BLEND_RGB_STAGE0; - current->hwTexBlendAlpha0 = A_BLEND_A_STAGE0; - break; - case GL_LUMINANCE8: - case GL_RGB8: - current->hwTexBlendClr0 = RGB_BLEND__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGB_BLEND__A_STAGE0; - break; - case GL_INTENSITY8: - current->hwTexBlendClr0 = I_BLEND__RGB_STAGE0; - current->hwTexBlendAlpha0 = I_BLEND__A_STAGE0; - break; - case GL_LUMINANCE8_ALPHA8: - case GL_RGBA8: - current->hwTexBlendClr0 = RGBA_BLEND__RGB_STAGE0; - current->hwTexBlendAlpha0 = RGBA_BLEND__A_STAGE0; - break; - } - break; - } - - if ((current->hwTexBlendClr0 ^ prev->hwTexBlendClr0) || - (current->hwTexBlendAlpha0 ^ prev->hwTexBlendAlpha0) || - (current->hwTexEnvColor ^ prev->hwTexEnvColor)) - { - prev->hwTexEnvColor = current->hwTexEnvColor; - prev->hwTexBlendClr0 = current->hwTexBlendClr0; - prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0; - hwcx->GlobalFlag |= GFLAG_TEXTUREENV; - } -} - -void -sis_set_texture_env1 (GLcontext * ctx, GLtextureObject * object, int unit) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - struct gl_texture_unit *texture_unit = &ctx->Texture.Unit[unit]; - GLtextureImage *image = object->Image[0]; - SIStextureArea *area = (SIStextureArea *) image->DriverData; - - /* - current->hwTexBlendClr1 = RGB_STAGE1; current->hwTexBlendAlpha1 = - A_STAGE1; - */ - - switch (texture_unit->EnvMode) - { - case GL_REPLACE: - switch (area->Format) - { - case GL_ALPHA8: - current->hwTexBlendClr1 = A_REPLACE_RGB_STAGE1; - current->hwTexBlendAlpha1 = A_REPLACE_A_STAGE1; - break; - case GL_INTENSITY8: - case GL_RGB8: - current->hwTexBlendClr1 = RGB_REPLACE__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGB_REPLACE__A_STAGE1; - break; - case GL_LUMINANCE8: - case GL_LUMINANCE8_ALPHA8: - case GL_RGBA8: - current->hwTexBlendClr1 = RGBA_REPLACE__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGBA_REPLACE__A_STAGE1; - break; - } - break; - - case GL_MODULATE: - switch (area->Format) - { - case GL_ALPHA8: - current->hwTexBlendClr1 = A_MODULATE_RGB_STAGE1; - current->hwTexBlendAlpha1 = A_MODULATE_A_STAGE1; - break; - case GL_LUMINANCE8: - case GL_RGB8: - current->hwTexBlendClr1 = RGB_MODULATE__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGB_MODULATE__A_STAGE1; - break; - case GL_INTENSITY8: - case GL_LUMINANCE8_ALPHA8: - case GL_RGBA8: - current->hwTexBlendClr1 = RGBA_MODULATE__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGBA_MODULATE__A_STAGE1; - break; - } - break; - - case GL_DECAL: - - switch (area->Format) - { - case GL_RGB8: - current->hwTexBlendClr1 = RGB_DECAL__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGB_DECAL__A_STAGE1; - break; - case GL_RGBA8: - current->hwTexBlendClr1 = RGBA_DECAL__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGBA_DECAL__A_STAGE1; - break; - } - break; - - case GL_BLEND: - current->hwTexEnvColor = - ((DWORD) (texture_unit->EnvColor[3])) << 24 | - ((DWORD) (texture_unit->EnvColor[0])) << 16 | - ((DWORD) (texture_unit->EnvColor[1])) << 8 | - ((DWORD) (texture_unit->EnvColor[2])); - switch (area->Format) - { - case GL_ALPHA8: - current->hwTexBlendClr1 = A_BLEND_RGB_STAGE1; - current->hwTexBlendAlpha1 = A_BLEND_A_STAGE1; - break; - case GL_LUMINANCE8: - case GL_RGB8: - current->hwTexBlendClr1 = RGB_BLEND__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGB_BLEND__A_STAGE1; - break; - case GL_INTENSITY8: - current->hwTexBlendClr1 = I_BLEND__RGB_STAGE1; - current->hwTexBlendAlpha1 = I_BLEND__A_STAGE1; - break; - case GL_LUMINANCE8_ALPHA8: - case GL_RGBA8: - current->hwTexBlendClr1 = RGBA_BLEND__RGB_STAGE1; - current->hwTexBlendAlpha1 = RGBA_BLEND__A_STAGE1; - break; - } - break; - } - - if ((current->hwTexBlendClr1 ^ prev->hwTexBlendClr1) || - (current->hwTexBlendAlpha1 ^ prev->hwTexBlendAlpha1) || - (current->hwTexEnvColor ^ prev->hwTexEnvColor)) - { - prev->hwTexBlendClr1 = current->hwTexBlendClr1; - prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1; - prev->hwTexEnvColor = current->hwTexEnvColor; - hwcx->GlobalFlag |= GFLAG_TEXTUREENV_1; - } -} - -static void -sis_set_texobj_parm (GLcontext * ctx, GLtextureObject * object, int hw_unit) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - GLtextureImage *image = object->Image[0]; - SIStextureArea *area = (SIStextureArea *) image->DriverData; - - GLint TxLevel; - GLint i; - - current->texture[hw_unit].hwTextureSet = 0UL; - current->texture[hw_unit].hwTextureMip = 0UL; - - switch (area->Format) - { - case GL_RGBA8: - current->texture[hw_unit].hwTextureSet |= TEXEL_ABGR_8888_32; - break; - case GL_INTENSITY8: - current->texture[hw_unit].hwTextureSet |= TEXEL_I8; - break; - case GL_ALPHA8: - current->texture[hw_unit].hwTextureSet |= TEXEL_A8; - break; - case GL_LUMINANCE8: - current->texture[hw_unit].hwTextureSet |= TEXEL_L8; - break; - case GL_LUMINANCE8_ALPHA8: - current->texture[hw_unit].hwTextureSet |= TEXEL_AL88; - break; - case GL_RGB8: - current->texture[hw_unit].hwTextureSet |= TEXEL_ABGR_0888_32; - break; - default: - hwcx->swRenderFlag |= SIS_SW_TEXTURE_OBJ; - } - - if ((object->MinFilter == GL_NEAREST) || (object->MinFilter == GL_LINEAR)) - { - TxLevel = 0; - } - else - { - TxLevel = object->P; - } - - if (TxLevel < SIS_MAX_MIPMAP_LEVEL) - { - current->texture[hw_unit].hwTextureSet |= (TxLevel << 8); - } - else - { - /* can i limit capacity */ - hwcx->swRenderFlag |= SIS_SW_TEXTURE_OBJ; - } - - switch (object->MagFilter) - { - case GL_NEAREST: - current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_NEAREST; - break; - - case GL_LINEAR: - current->texture[hw_unit].hwTextureMip |= (TEXTURE_FILTER_LINEAR << 3); - break; - } - - switch (object->MinFilter) - { - case GL_NEAREST: - current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_NEAREST; - break; - - case GL_LINEAR: - current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_LINEAR; - break; - - case GL_NEAREST_MIPMAP_NEAREST: - current->texture[hw_unit].hwTextureMip |= - TEXTURE_FILTER_NEAREST_MIP_NEAREST; - break; - - case GL_NEAREST_MIPMAP_LINEAR: - current->texture[hw_unit].hwTextureMip |= - TEXTURE_FILTER_NEAREST_MIP_LINEAR; - break; - - case GL_LINEAR_MIPMAP_NEAREST: - current->texture[hw_unit].hwTextureMip |= - TEXTURE_FILTER_LINEAR_MIP_NEAREST; - break; - - case GL_LINEAR_MIPMAP_LINEAR: - current->texture[hw_unit].hwTextureMip |= - TEXTURE_FILTER_LINEAR_MIP_LINEAR; - break; - } - - switch (object->WrapS) - { - case GL_REPEAT: - current->texture[hw_unit].hwTextureSet |= MASK_TextureWrapU; - break; - case GL_CLAMP: - current->texture[hw_unit].hwTextureSet |= MASK_TextureClampU; - break; - case GL_CLAMP_TO_EDGE: - /* - * ?? not support yet - */ - break; - } - - switch (object->WrapT) - { - case GL_REPEAT: - current->texture[hw_unit].hwTextureSet |= MASK_TextureWrapV; - break; - case GL_CLAMP: - current->texture[hw_unit].hwTextureSet |= MASK_TextureClampV; - break; - case GL_CLAMP_TO_EDGE: - /* - * ?? not support yet - */ - break; - } - -/* - if (current->texture[hw_unit].hwTextureSet & MASK_TextureClampU) { - current->texture[hw_unit].hwTextureSet &= ~MASK_TextureClampU; - current->texture[hw_unit].hwTextureSet |= MASK_TextureBorderU; - } - - if (current->texture[hw_unit].hwTextureSet & MASK_TextureClampV) { - current->texture[hw_unit].hwTextureSet &= ~MASK_TextureClampV; - current->texture[hw_unit].hwTextureSet |= MASK_TextureBorderV; - } -*/ - current->texture[hw_unit].hwTextureBorderColor = - ((GLuint) object->BorderColor[3] << 24) + - ((GLuint) object->BorderColor[0] << 16) + - ((GLuint) object->BorderColor[1] << 8) + - ((GLuint) object->BorderColor[2]); - - if (current->texture[hw_unit].hwTextureBorderColor ^ - prev->texture[hw_unit].hwTextureBorderColor) - { - prev->texture[hw_unit].hwTextureBorderColor = - current->texture[hw_unit].hwTextureBorderColor; - if (hw_unit == 1) - hwcx->GlobalFlag |= GFLAG_TEXBORDERCOLOR_1; - else - hwcx->GlobalFlag |= GFLAG_TEXBORDERCOLOR; - } - - current->texture[hw_unit].hwTextureSet |= (image->WidthLog2 << 4); - current->texture[hw_unit].hwTextureSet |= (image->HeightLog2); - - { - if (hw_unit == 0) - hwcx->GlobalFlag |= GFLAG_TEXTUREADDRESS; - else - hwcx->GlobalFlag |= GFLAG_TEXTUREADDRESS_1; - - for (i = 0; i < TxLevel + 1; i++) - { - SIStextureArea *area = (SIStextureArea *) object->Image[i]->DriverData; - GLuint texOffset; - GLuint texPitch = TransferTexturePitch (area->Pitch); - - switch(area->memType){ - case VIDEO_TYPE: - texOffset = ((char *) area->Data - (char *) GET_FbBase (hwcx)); - break; - case AGP_TYPE: - texOffset = ((char *) area->Data - (char *) GET_AGPBase (hwcx)) + - (unsigned long) hwcx->AGPAddr; - current->texture[hw_unit].hwTextureMip |= (0x40000 << i); - break; - default: - assert(0); - } - - switch (i) - { - case 0: - prev->texture[hw_unit].texOffset0 = texOffset; - prev->texture[hw_unit].texPitch01 = texPitch << 16; - break; - case 1: - prev->texture[hw_unit].texOffset1 = texOffset; - prev->texture[hw_unit].texPitch01 |= texPitch; - break; - case 2: - prev->texture[hw_unit].texOffset2 = texOffset; - prev->texture[hw_unit].texPitch23 = texPitch << 16; - break; - case 3: - prev->texture[hw_unit].texOffset3 = texOffset; - prev->texture[hw_unit].texPitch23 |= texPitch; - break; - case 4: - prev->texture[hw_unit].texOffset4 = texOffset; - prev->texture[hw_unit].texPitch45 = texPitch << 16; - break; - case 5: - prev->texture[hw_unit].texOffset5 = texOffset; - prev->texture[hw_unit].texPitch45 |= texPitch; - break; - case 6: - prev->texture[hw_unit].texOffset6 = texOffset; - prev->texture[hw_unit].texPitch67 = texPitch << 16; - break; - case 7: - prev->texture[hw_unit].texOffset7 = texOffset; - prev->texture[hw_unit].texPitch67 |= texPitch; - break; - case 8: - prev->texture[hw_unit].texOffset8 = texOffset; - prev->texture[hw_unit].texPitch89 = texPitch << 16; - break; - case 9: - prev->texture[hw_unit].texOffset9 = texOffset; - prev->texture[hw_unit].texPitch89 |= texPitch; - break; - case 10: - prev->texture[hw_unit].texOffset10 = texOffset; - prev->texture[hw_unit].texPitch10 = texPitch << 16; - break; - case 11: - prev->texture[hw_unit].texOffset11 = texOffset; - prev->texture[hw_unit].texPitch10 |= texPitch; - break; - } - } - } - - if (current->texture[hw_unit].hwTextureSet ^ - prev->texture[hw_unit].hwTextureSet) - { - prev->texture[hw_unit].hwTextureSet = - current->texture[hw_unit].hwTextureSet; - if (hw_unit == 1) - hwcx->GlobalFlag |= CFLAG_TEXTURERESET_1; - else - hwcx->GlobalFlag |= CFLAG_TEXTURERESET; - } - if (current->texture[hw_unit].hwTextureMip ^ - prev->texture[hw_unit].hwTextureMip) - { - prev->texture[hw_unit].hwTextureMip = - current->texture[hw_unit].hwTextureMip; - if (hw_unit == 1) - hwcx->GlobalFlag |= GFLAG_TEXTUREMIPMAP_1; - else - hwcx->GlobalFlag |= GFLAG_TEXTUREMIPMAP; - } -} - -static void -sis_reset_texture_env (GLcontext * ctx, int hw_unit) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __GLSiSHardware *prev = &hwcx->prev; - __GLSiSHardware *current = &hwcx->current; - - if (hw_unit == 1) - { - current->hwTexBlendClr1 = RGB_STAGE1; - current->hwTexBlendAlpha1 = A_STAGE1; - - if ((current->hwTexBlendClr1 ^ prev->hwTexBlendClr1) || - (current->hwTexBlendAlpha1 ^ prev->hwTexBlendAlpha1) || - (current->hwTexEnvColor ^ prev->hwTexEnvColor)) - { - prev->hwTexBlendClr1 = current->hwTexBlendClr1; - prev->hwTexBlendAlpha1 = current->hwTexBlendAlpha1; - prev->hwTexEnvColor = current->hwTexEnvColor; - hwcx->GlobalFlag |= GFLAG_TEXTUREENV_1; - } - } - else - { - current->hwTexBlendClr0 = RGB_STAGE1; - current->hwTexBlendAlpha0 = A_STAGE1; - - if ((current->hwTexBlendClr0 ^ prev->hwTexBlendClr0) || - (current->hwTexBlendAlpha0 ^ prev->hwTexBlendAlpha0) || - (current->hwTexEnvColor ^ prev->hwTexEnvColor)) - { - prev->hwTexBlendClr0 = current->hwTexBlendClr0; - prev->hwTexBlendAlpha0 = current->hwTexBlendAlpha0; - prev->hwTexEnvColor = current->hwTexEnvColor; - hwcx->GlobalFlag |= GFLAG_TEXTUREENV; - } - } -} - -static DWORD -BitScanForward (WORD w) -{ - DWORD i; - - for (i = 0; i < 16; i++) - { - if (w & (1 << i)) - break; - } - return (i); -} - -static DWORD -TransferTexturePitch (DWORD dwPitch) -{ - DWORD dwRet, i; - - i = BitScanForward ((WORD) dwPitch); - dwRet = dwPitch >> i; - dwRet |= i << 9; - return (dwRet); -} Index: xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h:1.3 xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h:removed --- xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h:1.3 Tue Sep 26 11:56:49 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h Sat Feb 28 21:41:18 2004 @@ -1,125 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_trifunc.h,v 1.3 2000/09/26 15:56:49 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#define SIS_TRI_FUNC 1 - -static void -SIS_TAG (sis_tri) (GLcontext * ctx, GLuint v0, GLuint v1, GLuint v2, - GLuint pv) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - struct vertex_buffer *VB = ctx->VB; - float *MMIOBase = (float *) GET_IOBase (hwcx); - - STEREO_SAMPLE(v0); - - /* specular color is considered */ - mWait3DCmdQueue (10 * 3 + 1); - - if (SIS_STATES & (SIS_SMOOTH)) - { - /* - * not move it to UpdateState because maybe optimization can be done - * according to FAN and STRIP - */ - hwcx->dwPrimitiveSet &= ~0x07001f07; - hwcx->dwPrimitiveSet |= - (OP_3D_FIRE_TSARGBc | SHADE_GOURAUD | OP_3D_TRIANGLE_DRAW); - } - else - { - hwcx->dwPrimitiveSet &= ~0x07001f07; - hwcx->dwPrimitiveSet |= - (OP_3D_FIRE_TSARGBc | SHADE_FLAT_VertexC | OP_3D_TRIANGLE_DRAW); - } - - { - ((DWORD *) MMIOBase)[REG_3D_PrimitiveSet / 4] = hwcx->dwPrimitiveSet; - } - -#define LAST_VERTEX 0 - SIS_MMIO_WRITE_VERTEX (v0, 0); - SIS_MMIO_WRITE_VERTEX (v1, 1); -#undef LAST_VERTEX -#define LAST_VERTEX 1 - SIS_MMIO_WRITE_VERTEX (v2, 2); -#undef LAST_VERTEX - - /* debug - mEndPrimitive (); - WaitEngIdle(hwcx); - d2f_once (ctx); - */ -} - -static void -SIS_TAG (sis_agp_tri) (GLcontext * ctx, GLuint v0, GLuint v1, - GLuint v2, GLuint pv) -{ - XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - struct vertex_buffer *VB = ctx->VB; - - DWORD dcSARGB; - - STEREO_SAMPLE(v0); - - /* delete if VB size <= AGP_ALLOC_SIZE */ -#if 0 - if ((DWORD) AGP_CurrentPtr - (DWORD) AGP_StartPtr >= (AGP_ALLOC_SIZE - 0x10)) - { - sis_FlushAGP (ctx); - sis_StartAGP (ctx); - } -#endif - -#define FIRST_VERTEX 1 - SIS_AGP_WRITE_VERTEX (v0); -#undef FIRST_VERTEX -#define FIRST_VERTEX 0 - SIS_AGP_WRITE_VERTEX (v1); - SIS_AGP_WRITE_VERTEX (v2); -#undef FIRST_VERTEX -} - -#undef SIS_MMIO_WRITE_VERTEX -#undef SIS_AGP_WRITE_VERTEX - -#undef SIS_TAG -#undef SIS_IS_SMOOTH -#undef SIS_STATES -#undef SIS_TRI_FUNC Index: xc/lib/GL/mesa/src/drv/sis/sis_tris.c diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_tris.c:1.3 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_tris.c Mon Dec 8 19:15:22 2003 @@ -0,0 +1,953 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_tris.c,v 1.3 2003/12/09 00:15:22 alanh Exp $ */ +/************************************************************************** + +Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP 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. + +**************************************************************************/ + +/* + * Authors: + * Sung-Ching Lin + * Eric Anholt + */ + +#include "glheader.h" +#include "mtypes.h" +#include "colormac.h" +#include "macros.h" + +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" + +#include "sis_tris.h" +#include "sis_state.h" +#include "sis_vb.h" +#include "sis_lock.h" + +static const GLuint hw_prim[GL_POLYGON+1] = { + OP_3D_POINT_DRAW, /* GL_POINTS */ + OP_3D_LINE_DRAW, /* GL_LINES */ + OP_3D_LINE_DRAW, /* GL_LINE_LOOP */ + OP_3D_LINE_DRAW, /* GL_LINE_STRIP */ + OP_3D_TRIANGLE_DRAW, /* GL_TRIANGLES */ + OP_3D_TRIANGLE_DRAW, /* GL_TRIANGLE_STRIP */ + OP_3D_TRIANGLE_DRAW, /* GL_TRIANGLE_FAN */ + OP_3D_TRIANGLE_DRAW, /* GL_QUADS */ + OP_3D_TRIANGLE_DRAW, /* GL_QUAD_STRIP */ + OP_3D_TRIANGLE_DRAW /* GL_POLYGON */ +}; + +static const GLuint hw_prim_mmio_fire[OP_3D_TRIANGLE_DRAW+1] = { + OP_3D_FIRE_TSARGBa, + OP_3D_FIRE_TSARGBb, + OP_3D_FIRE_TSARGBc +}; + +static const GLuint hw_prim_mmio_shade[OP_3D_TRIANGLE_DRAW+1] = { + SHADE_FLAT_VertexA, + SHADE_FLAT_VertexB, + SHADE_FLAT_VertexC +}; + +static const GLuint hw_prim_agp_type[OP_3D_TRIANGLE_DRAW+1] = { + MASK_PsPointList, + MASK_PsLineList, + MASK_PsTriangleList +}; + +static const GLuint hw_prim_agp_shade[OP_3D_TRIANGLE_DRAW+1] = { + MASK_PsShadingFlatA, + MASK_PsShadingFlatB, + MASK_PsShadingFlatC +}; + +static void sisRasterPrimitive( GLcontext *ctx, GLuint hwprim ); +static void sisRenderPrimitive( GLcontext *ctx, GLenum prim ); +static void sisMakeRoomAGP( sisContextPtr smesa, GLint num ); +static void sisUpdateAGP( sisContextPtr smesa ); +static void sisFireVertsAGP( sisContextPtr smesa ); + +static float *AGP_StartPtr; +static float *AGP_WritePtr; /* Current write position */ +static float *AGP_ReadPtr; /* Last known engine readposition */ +static long AGP_SpaceLeft; /* Last known engine readposition */ + +/*********************************************************************** + * Emit primitives as inline vertices * + ***********************************************************************/ + +/* Future optimizations: + * + * The previous code only emitted W when fog or textures were enabled. + */ + +#define SIS_MMIO_WRITE_VERTEX(_v, i, lastvert) \ +do { \ + MMIOBase[(REG_3D_TSXa+(i)*0x30)/4] = _v->v.x; \ + MMIOBase[(REG_3D_TSYa+(i)*0x30)/4] = _v->v.y; \ + MMIOBase[(REG_3D_TSZa+(i)*0x30)/4] = _v->v.z; \ + MMIOBase[(REG_3D_TSWGa+(i)*0x30)/4] = _v->v.w; \ + /*((GLint *) MMIOBase)[(REG_3D_TSFSa+(i)*0x30)/4] = _v->ui[5];*/ \ + if (SIS_STATES & SIS_VERT_TEX0) { \ + MMIOBase[(REG_3D_TSUAa+(i)*0x30)/4] = _v->v.u0; \ + MMIOBase[(REG_3D_TSVAa+(i)*0x30)/4] = _v->v.v0; \ + } \ + if (SIS_STATES & SIS_VERT_TEX1) { \ + MMIOBase[(REG_3D_TSUBa+(i)*0x30)/4] = _v->v.u1; \ + MMIOBase[(REG_3D_TSVBa+(i)*0x30)/4] = _v->v.v1; \ + } \ + /*MMIOBase[(REG_3D_TSUCa+(i)*0x30)/4] = _v->v.u2; \ + MMIOBase[(REG_3D_TSVCa+(i)*0x30)/4] = _v->v.v2;*/ \ + /* the ARGB write of the last vertex of the primitive fires the 3d engine*/ \ + if (lastvert || (SIS_STATES & SIS_VERT_SMOOTH)) \ + ((GLint *) MMIOBase)[(REG_3D_TSARGBa+(i)*0x30)/4] = _v->ui[4]; \ +} while (0); + +#define SIS_AGP_WRITE_VERTEX(_v) \ +do { \ + AGP_WritePtr[0] = _v->v.x; \ + AGP_WritePtr[1] = _v->v.y; \ + AGP_WritePtr[2] = _v->v.z; \ + AGP_WritePtr[3] = _v->v.w; \ + ((GLint *)AGP_WritePtr)[4] = _v->ui[4]; \ + AGP_WritePtr += 5; \ + if (SIS_STATES & SIS_VERT_TEX0) { \ + AGP_WritePtr[0] = _v->v.u0; \ + AGP_WritePtr[1] = _v->v.v0; \ + AGP_WritePtr += 2; \ + } \ + if (SIS_STATES & SIS_VERT_TEX1) { \ + AGP_WritePtr[0] = _v->v.u1; \ + AGP_WritePtr[1] = _v->v.v1; \ + AGP_WritePtr += 2; \ + } \ +} while(0) + +#define MMIO_VERT_REG_COUNT 10 + +#define SIS_VERT_SMOOTH 0x01 +#define SIS_VERT_TEX0 0x02 +#define SIS_VERT_TEX1 0x04 + +static sis_quad_func sis_quad_func_agp[8]; +static sis_tri_func sis_tri_func_agp[8]; +static sis_line_func sis_line_func_agp[8]; +static sis_point_func sis_point_func_agp[8]; +static sis_quad_func sis_quad_func_mmio[8]; +static sis_tri_func sis_tri_func_mmio[8]; +static sis_line_func sis_line_func_mmio[8]; +static sis_point_func sis_point_func_mmio[8]; + +/* XXX: These definitions look questionable */ +#define USE_XYZ MASK_PsVertex_HAS_RHW +#define USE_W MASK_PsVertex_HAS_NORMALXYZ +#define USE_RGB MASK_PsVertex_HAS_SPECULAR +#define USE_UV1 MASK_PsVertex_HAS_UVSet2 +#define USE_UV2 MASK_PsVertex_HAS_UVSet3 + +static GLint AGPParsingValues[8] = { + (5 << 28) | USE_XYZ | USE_W | USE_RGB, + (5 << 28) | USE_XYZ | USE_W | USE_RGB, + (7 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV1, + (7 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV1, + (7 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV2, + (7 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV2, + (9 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV1 | USE_UV2, + (9 << 28) | USE_XYZ | USE_W | USE_RGB | USE_UV1 | USE_UV2, +}; + +#define SIS_STATES (0) +#define TAG(x) x##_none +#include "sis_tritmp.h" + +#define SIS_STATES (SIS_VERT_SMOOTH) +#define TAG(x) x##_s +#include "sis_tritmp.h" + +#define SIS_STATES (SIS_VERT_TEX0) +#define TAG(x) x##_t0 +#include "sis_tritmp.h" + +#define SIS_STATES (SIS_VERT_SMOOTH | SIS_VERT_TEX0) +#define TAG(x) x##_st0 +#include "sis_tritmp.h" + +#define SIS_STATES (SIS_VERT_TEX1) +#define TAG(x) x##_t1 +#include "sis_tritmp.h" + +#define SIS_STATES (SIS_VERT_SMOOTH | SIS_VERT_TEX1) +#define TAG(x) x##_st1 +#include "sis_tritmp.h" + +#define SIS_STATES (SIS_VERT_TEX0 | SIS_VERT_TEX1) +#define TAG(x) x##_t0t1 +#include "sis_tritmp.h" + +#define SIS_STATES (SIS_VERT_SMOOTH | SIS_VERT_TEX0 | SIS_VERT_TEX1) +#define TAG(x) x##_st0t1 +#include "sis_tritmp.h" + +/*********************************************************************** + * Macros for t_dd_tritmp.h to draw basic primitives * + ***********************************************************************/ + +#define POINT( v0 ) smesa->draw_point( smesa, v0 ) +#define LINE( v0, v1 ) smesa->draw_line( smesa, v0, v1 ) +#define TRI( a, b, c ) smesa->draw_tri( smesa, a, b, c ) +#define QUAD( a, b, c, d ) smesa->draw_quad( smesa, a, b, c, d ) + +/*********************************************************************** + * Build render functions from dd templates * + ***********************************************************************/ + +#define SIS_OFFSET_BIT 0x01 +#define SIS_TWOSIDE_BIT 0x02 +#define SIS_UNFILLED_BIT 0x04 +#define SIS_FALLBACK_BIT 0x08 +#define SIS_MAX_TRIFUNC 0x10 + + +static struct { + points_func points; + line_func line; + triangle_func triangle; + quad_func quad; +} rast_tab[SIS_MAX_TRIFUNC]; + + +#define DO_FALLBACK (IND & SIS_FALLBACK_BIT) +#define DO_OFFSET (IND & SIS_OFFSET_BIT) +#define DO_UNFILLED (IND & SIS_UNFILLED_BIT) +#define DO_TWOSIDE (IND & SIS_TWOSIDE_BIT) +#define DO_FLAT 0 +#define DO_TRI 1 +#define DO_QUAD 1 +#define DO_LINE 1 +#define DO_POINTS 1 +#define DO_FULL_QUAD 1 + +#define HAVE_RGBA 1 +#define HAVE_SPEC 1 +#define HAVE_BACK_COLORS 0 +#define HAVE_HW_FLATSHADE 1 +#define VERTEX sisVertex +#define TAB rast_tab + +#define DEPTH_SCALE 1.0 +#define UNFILLED_TRI unfilled_tri +#define UNFILLED_QUAD unfilled_quad +#define VERT_X(_v) _v->v.x +#define VERT_Y(_v) _v->v.y +#define VERT_Z(_v) _v->v.z +#define AREA_IS_CCW( a ) (a > 0) +#define GET_VERTEX(e) (smesa->verts + (e << smesa->vertex_stride_shift)) + +#define VERT_SET_RGBA( v, c ) \ + do { \ + sis_color_t *vc = (sis_color_t *)&(v)->ui[coloroffset]; \ + vc->blue = (c)[2]; \ + vc->green = (c)[1]; \ + vc->red = (c)[0]; \ + vc->alpha = (c)[3]; \ + } while (0) +#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset] +#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset] +#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx] + +#define VERT_SET_SPEC( v0, c ) \ + if (havespec) { \ + (v0)->v.specular.red = (c)[0]; \ + (v0)->v.specular.green = (c)[1]; \ + (v0)->v.specular.blue = (c)[2]; \ + } +#define VERT_COPY_SPEC( v0, v1 ) \ + if (havespec) { \ + (v0)->v.specular.red = v1->v.specular.red; \ + (v0)->v.specular.green = v1->v.specular.green; \ + (v0)->v.specular.blue = v1->v.specular.blue; \ + } + +#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5] +#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx] + +#define LOCAL_VARS(n) \ + sisContextPtr smesa = SIS_CONTEXT(ctx); \ + GLuint color[n], spec[n]; \ + GLuint coloroffset = (smesa->vertex_size == 4 ? 3 : 4); \ + GLboolean havespec = (smesa->vertex_size == 4 ? 0 : 1); \ + (void) color; (void) spec; (void) coloroffset; (void) havespec; + +/*********************************************************************** + * Helpers for rendering unfilled primitives * + ***********************************************************************/ + +#define RASTERIZE(x) if (smesa->hw_primitive != hw_prim[x]) \ + sisRasterPrimitive( ctx, hw_prim[x] ) +#define RENDER_PRIMITIVE smesa->render_primitive +#define IND SIS_FALLBACK_BIT +#define TAG(x) x +#include "tnl_dd/t_dd_unfilled.h" +#undef IND + + +/*********************************************************************** + * Generate GL render functions * + ***********************************************************************/ + + +#define IND (0) +#define TAG(x) x +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_OFFSET_BIT) +#define TAG(x) x##_offset +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_TWOSIDE_BIT) +#define TAG(x) x##_twoside +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_TWOSIDE_BIT | SIS_OFFSET_BIT) +#define TAG(x) x##_twoside_offset +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_UNFILLED_BIT) +#define TAG(x) x##_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_OFFSET_BIT | SIS_UNFILLED_BIT) +#define TAG(x) x##_offset_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_TWOSIDE_BIT | SIS_UNFILLED_BIT) +#define TAG(x) x##_twoside_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_TWOSIDE_BIT | SIS_OFFSET_BIT | SIS_UNFILLED_BIT) +#define TAG(x) x##_twoside_offset_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_FALLBACK_BIT) +#define TAG(x) x##_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_OFFSET_BIT | SIS_FALLBACK_BIT) +#define TAG(x) x##_offset_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_TWOSIDE_BIT | SIS_FALLBACK_BIT) +#define TAG(x) x##_twoside_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_TWOSIDE_BIT | SIS_OFFSET_BIT | SIS_FALLBACK_BIT) +#define TAG(x) x##_twoside_offset_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_UNFILLED_BIT | SIS_FALLBACK_BIT) +#define TAG(x) x##_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_OFFSET_BIT | SIS_UNFILLED_BIT | SIS_FALLBACK_BIT) +#define TAG(x) x##_offset_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_TWOSIDE_BIT | SIS_UNFILLED_BIT | SIS_FALLBACK_BIT) +#define TAG(x) x##_twoside_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (SIS_TWOSIDE_BIT | SIS_OFFSET_BIT | SIS_UNFILLED_BIT | \ + SIS_FALLBACK_BIT) +#define TAG(x) x##_twoside_offset_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + + +static void init_rast_tab( void ) +{ + init(); + init_offset(); + init_twoside(); + init_twoside_offset(); + init_unfilled(); + init_offset_unfilled(); + init_twoside_unfilled(); + init_twoside_offset_unfilled(); + init_fallback(); + init_offset_fallback(); + init_twoside_fallback(); + init_twoside_offset_fallback(); + init_unfilled_fallback(); + init_offset_unfilled_fallback(); + init_twoside_unfilled_fallback(); + init_twoside_offset_unfilled_fallback(); +} + + + +/*********************************************************************** + * Rasterization fallback helpers * + ***********************************************************************/ + + +/* This code is hit only when a mix of accelerated and unaccelerated + * primitives are being drawn, and only for the unaccelerated + * primitives. + */ +static void +sis_fallback_quad( sisContextPtr smesa, + sisVertex *v0, + sisVertex *v1, + sisVertex *v2, + sisVertex *v3 ) +{ + GLcontext *ctx = smesa->glCtx; + SWvertex v[4]; + sis_translate_vertex( ctx, v0, &v[0] ); + sis_translate_vertex( ctx, v1, &v[1] ); + sis_translate_vertex( ctx, v2, &v[2] ); + sis_translate_vertex( ctx, v3, &v[3] ); + _swrast_Triangle( ctx, &v[0], &v[1], &v[3] ); + _swrast_Triangle( ctx, &v[1], &v[2], &v[3] ); +} + +static void +sis_fallback_tri( sisContextPtr smesa, + sisVertex *v0, + sisVertex *v1, + sisVertex *v2 ) +{ + GLcontext *ctx = smesa->glCtx; + SWvertex v[3]; + sis_translate_vertex( ctx, v0, &v[0] ); + sis_translate_vertex( ctx, v1, &v[1] ); + sis_translate_vertex( ctx, v2, &v[2] ); + _swrast_Triangle( ctx, &v[0], &v[1], &v[2] ); +} + + +static void +sis_fallback_line( sisContextPtr smesa, + sisVertex *v0, + sisVertex *v1 ) +{ + GLcontext *ctx = smesa->glCtx; + SWvertex v[2]; + sis_translate_vertex( ctx, v0, &v[0] ); + sis_translate_vertex( ctx, v1, &v[1] ); + _swrast_Line( ctx, &v[0], &v[1] ); +} + + +static void +sis_fallback_point( sisContextPtr smesa, + sisVertex *v0 ) +{ + GLcontext *ctx = smesa->glCtx; + SWvertex v[1]; + sis_translate_vertex( ctx, v0, &v[0] ); + _swrast_Point( ctx, &v[0] ); +} + + + +/**********************************************************************/ +/* Render unclipped begin/end objects */ +/**********************************************************************/ + +#define VERT(x) (sisVertex *)(sisverts + (x << shift)) +#define RENDER_POINTS( start, count ) \ + for ( ; start < count ; start++) \ + smesa->draw_point( smesa, VERT(start) ) +#define RENDER_LINE( v0, v1 ) smesa->draw_line( smesa, VERT(v0), VERT(v1) ) +#define RENDER_TRI( v0, v1, v2 ) smesa->draw_tri( smesa, VERT(v0), VERT(v1), \ + VERT(v2) ) +#define RENDER_QUAD( v0, v1, v2, v3 ) smesa->draw_quad( smesa, VERT(v0), \ + VERT(v1), VERT(v2), VERT(v3)) +#define INIT(x) sisRenderPrimitive( ctx, x ) +#undef LOCAL_VARS +#define LOCAL_VARS \ + sisContextPtr smesa = SIS_CONTEXT(ctx); \ + const GLuint shift = smesa->vertex_stride_shift; \ + const char *sisverts = (char *)smesa->verts; \ + const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \ + (void) elt; +#define RESET_STIPPLE +#define RESET_OCCLUSION +#define PRESERVE_VB_DEFS +#define ELT(x) (x) +#define TAG(x) sis_##x##_verts +#include "tnl/t_vb_rendertmp.h" +#undef ELT +#undef TAG +#define TAG(x) sis_##x##_elts +#define ELT(x) elt[x] +#include "tnl/t_vb_rendertmp.h" + + +/**********************************************************************/ +/* Render clipped primitives */ +/**********************************************************************/ + +static void sisRenderClippedPoly( GLcontext *ctx, const GLuint *elts, GLuint n ) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; + + /* Render the new vertices as an unclipped polygon. + */ + { + GLuint *tmp = VB->Elts; + VB->Elts = (GLuint *)elts; + tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END ); + VB->Elts = tmp; + } +} + +static void sisRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + tnl->Driver.Render.Line( ctx, ii, jj ); +} + +#if 0 +static void sisFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts, + GLuint n ) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + GLuint vertsize = smesa->vertex_size; + GLuint *vb = r128AllocDmaLow( rmesa, (n-2) * 3 * 4 * vertsize ); + GLubyte *sisverts = (GLubyte *)smesa->verts; + const GLuint shift = smesa->vertex_stride_shift; + const GLuint *start = (const GLuint *)VERT(elts[0]); + int i,j; + + smesa->num_verts += (n-2) * 3; + + for (i = 2 ; i < n ; i++) { + COPY_DWORDS( j, vb, vertsize, (sisVertexPtr) VERT(elts[i-1]) ); + COPY_DWORDS( j, vb, vertsize, (sisVertexPtr) VERT(elts[i]) ); + COPY_DWORDS( j, vb, vertsize, (sisVertexPtr) start ); + } +} +#endif + + + + +/**********************************************************************/ +/* Choose render functions */ +/**********************************************************************/ + +#define _SIS_NEW_RENDER_STATE (_DD_NEW_LINE_STIPPLE | \ + _DD_NEW_LINE_SMOOTH | \ + _DD_NEW_POINT_SMOOTH | \ + _DD_NEW_TRI_SMOOTH | \ + _DD_NEW_TRI_UNFILLED | \ + _DD_NEW_TRI_LIGHT_TWOSIDE | \ + _DD_NEW_TRI_OFFSET) \ + + +#define POINT_FALLBACK (DD_POINT_SMOOTH) +#define LINE_FALLBACK (DD_LINE_STIPPLE|DD_LINE_SMOOTH) +#define TRI_FALLBACK (DD_TRI_SMOOTH) +#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK) +#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED) + + +static void sisChooseRenderState(GLcontext *ctx) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + GLuint flags = ctx->_TriangleCaps; + GLuint index = 0; + GLuint vertindex = 0; + + if (ctx->Texture.Unit[0]._ReallyEnabled) + vertindex |= SIS_VERT_TEX0; + if (ctx->Texture.Unit[1]._ReallyEnabled) + vertindex |= SIS_VERT_TEX1; + if (ctx->Light.ShadeModel == GL_SMOOTH) + vertindex |= SIS_VERT_SMOOTH; + + if (smesa->AGPCmdModeEnabled) { + smesa->draw_quad = sis_quad_func_agp[vertindex]; + smesa->draw_tri = sis_tri_func_agp[vertindex]; + smesa->draw_line = sis_line_func_agp[vertindex]; + smesa->draw_point = sis_point_func_agp[vertindex]; + } else { + smesa->draw_quad = sis_quad_func_mmio[vertindex]; + smesa->draw_tri = sis_tri_func_mmio[vertindex]; + smesa->draw_line = sis_line_func_mmio[vertindex]; + smesa->draw_point = sis_point_func_mmio[vertindex]; + } + smesa->AGPParseSet &= ~(MASK_VertexDWSize | MASK_VertexDataFormat); + smesa->AGPParseSet |= AGPParsingValues[vertindex]; + + if (flags & (ANY_RASTER_FLAGS|ANY_FALLBACK_FLAGS)) { + + if (flags & ANY_RASTER_FLAGS) { + if (flags & DD_TRI_LIGHT_TWOSIDE) index |= SIS_TWOSIDE_BIT; + if (flags & DD_TRI_OFFSET) index |= SIS_OFFSET_BIT; + if (flags & DD_TRI_UNFILLED) index |= SIS_UNFILLED_BIT; + } + + /* Hook in fallbacks for specific primitives. + */ + if (flags & ANY_FALLBACK_FLAGS) { + if (flags & POINT_FALLBACK) + smesa->draw_point = sis_fallback_point; + if (flags & LINE_FALLBACK) + smesa->draw_line = sis_fallback_line; + if (flags & TRI_FALLBACK) { + smesa->draw_quad = sis_fallback_quad; + smesa->draw_tri = sis_fallback_tri; + } + index |= SIS_FALLBACK_BIT; + } + } + + if (index != smesa->RenderIndex) { + TNLcontext *tnl = TNL_CONTEXT(ctx); + tnl->Driver.Render.Points = rast_tab[index].points; + tnl->Driver.Render.Line = rast_tab[index].line; + tnl->Driver.Render.Triangle = rast_tab[index].triangle; + tnl->Driver.Render.Quad = rast_tab[index].quad; + + if (index == 0) { + tnl->Driver.Render.PrimTabVerts = sis_render_tab_verts; + tnl->Driver.Render.PrimTabElts = sis_render_tab_elts; + tnl->Driver.Render.ClippedLine = rast_tab[index].line; + /*XXX: sisFastRenderClippedPoly*/ + tnl->Driver.Render.ClippedPolygon = sisRenderClippedPoly; + } else { + tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; + tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; + tnl->Driver.Render.ClippedLine = sisRenderClippedLine; + tnl->Driver.Render.ClippedPolygon = sisRenderClippedPoly; + } + + smesa->RenderIndex = index; + } +} + +/**********************************************************************/ +/* Multipass rendering for front buffering */ +/**********************************************************************/ +static GLboolean multipass_cliprect( GLcontext *ctx, GLuint pass ) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + + if (pass >= smesa->driDrawable->numClipRects) { + return GL_FALSE; + } else { + GLint x1, y1, x2, y2; + + x1 = smesa->driDrawable->pClipRects[pass].x1 - smesa->driDrawable->x; + y1 = smesa->driDrawable->pClipRects[pass].y1 - smesa->driDrawable->y; + x2 = smesa->driDrawable->pClipRects[pass].x2 - smesa->driDrawable->x; + y2 = smesa->driDrawable->pClipRects[pass].y2 - smesa->driDrawable->y; + + if (ctx->Scissor.Enabled) { + GLint scisy1 = Y_FLIP(ctx->Scissor.Y + ctx->Scissor.Height - 1); + GLint scisy2 = Y_FLIP(ctx->Scissor.Y); + + if (ctx->Scissor.X > x1) + x1 = ctx->Scissor.X; + if (scisy1 > y1) + y1 = scisy1; + if (ctx->Scissor.X + ctx->Scissor.Width - 1 < x2) + x2 = ctx->Scissor.X + ctx->Scissor.Width - 1; + if (scisy2 < y2) + y2 = scisy2; + } + + MMIO(REG_3D_ClipTopBottom, y1 << 13 | y2); + MMIO(REG_3D_ClipLeftRight, x1 << 13 | x2); + /* Mark that we clobbered these registers */ + smesa->GlobalFlag |= GFLAG_CLIPPING; + return GL_TRUE; + } +} + + + +/**********************************************************************/ +/* Validate state at pipeline start */ +/**********************************************************************/ + +static void sisRunPipeline( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + + LOCK_HARDWARE(); + sisUpdateHWState( ctx ); + + if (smesa->AGPCmdModeEnabled) { + AGP_WritePtr = (GLfloat *)smesa->AGPCmdBufBase + *smesa->pAGPCmdBufNext; + AGP_StartPtr = AGP_WritePtr; + AGP_ReadPtr = (GLfloat *)((long)MMIO_READ(REG_3D_AGPCmBase) - + (long)smesa->AGPCmdBufAddr + (long)smesa->AGPCmdBufBase); + sisUpdateAGP( smesa ); + } + + if (!smesa->Fallback && smesa->NewGLState) { + if (smesa->NewGLState & _SIS_NEW_VERTEX_STATE) + sisChooseVertexState( ctx ); + + if (smesa->NewGLState & (_SIS_NEW_RENDER_STATE | _NEW_TEXTURE)) + sisChooseRenderState( ctx ); + + smesa->NewGLState = 0; + } + + _tnl_run_pipeline( ctx ); + + if (smesa->AGPCmdModeEnabled) + sisFireVertsAGP( smesa ); + else + mEndPrimitive(); + UNLOCK_HARDWARE(); +} + +/**********************************************************************/ +/* High level hooks for t_vb_render.c */ +/**********************************************************************/ + +/* This is called when Mesa switches between rendering triangle + * primitives (such as GL_POLYGON, GL_QUADS, GL_TRIANGLE_STRIP, etc), + * and lines, points and bitmaps. + */ + +static void sisRasterPrimitive( GLcontext *ctx, GLuint hwprim ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + if (smesa->hw_primitive != hwprim) { + if (smesa->AGPCmdModeEnabled) { + sisFireVertsAGP( smesa ); + smesa->AGPParseSet &= ~(MASK_PsDataType | MASK_PsShadingMode); + smesa->AGPParseSet |= hw_prim_agp_type[hwprim]; + if (ctx->Light.ShadeModel == GL_FLAT) + smesa->AGPParseSet |= hw_prim_agp_shade[hwprim]; + else + smesa->AGPParseSet |= MASK_PsShadingSmooth; + } else { + mEndPrimitive(); + smesa->dwPrimitiveSet &= ~(MASK_DrawPrimitiveCommand | + MASK_SetFirePosition | MASK_ShadingMode); + smesa->dwPrimitiveSet |= hwprim | hw_prim_mmio_fire[hwprim]; + if (ctx->Light.ShadeModel == GL_FLAT) + smesa->dwPrimitiveSet |= hw_prim_mmio_shade[hwprim]; + else + smesa->dwPrimitiveSet |= SHADE_GOURAUD; + } + } + smesa->hw_primitive = hwprim; +} + +static void sisRenderPrimitive( GLcontext *ctx, GLenum prim ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + + smesa->render_primitive = prim; + if (prim >= GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED)) + return; + sisRasterPrimitive( ctx, hw_prim[prim] ); +} + + +static void sisRenderStart( GLcontext *ctx ) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + sisContextPtr smesa = SIS_CONTEXT(ctx); + + /* Check for projective texturing. Make sure all texcoord + * pointers point to something. (fix in mesa?) + */ + sisCheckTexSizes( ctx ); + + if (ctx->Color._DrawDestMask == FRONT_LEFT_BIT && + smesa->driDrawable->numClipRects != 0) + { + multipass_cliprect(ctx, 0); + if (smesa->driDrawable->numClipRects > 1) + tnl->Driver.Render.Multipass = multipass_cliprect; + else + tnl->Driver.Render.Multipass = NULL; + } else { + tnl->Driver.Render.Multipass = NULL; + } +} + +static void sisRenderFinish( GLcontext *ctx ) +{ +} + +/* Update SpaceLeft after an engine or current write pointer update */ +static void sisUpdateAGP( sisContextPtr smesa ) +{ + /* ReadPtr == WritePtr is the empty case */ + if (AGP_ReadPtr <= AGP_WritePtr) + AGP_SpaceLeft = (long)smesa->AGPCmdBufBase + (long)smesa->AGPCmdBufSize - + (long)AGP_WritePtr; + else + AGP_SpaceLeft = AGP_ReadPtr - AGP_WritePtr - 4; +} + +/* Fires a set of vertices that have been written from AGP_StartPtr to + * AGP_WritePtr, using the smesa->AGPParseSet format. + */ +void +sisFireVertsAGP( sisContextPtr smesa ) +{ + if (AGP_WritePtr == AGP_StartPtr) + return; + + mWait3DCmdQueue(5); + mEndPrimitive(); + MMIO(REG_3D_AGPCmBase, (long)AGP_StartPtr - (long)smesa->AGPCmdBufBase + + (long)smesa->AGPCmdBufAddr); + MMIO(REG_3D_AGPTtDwNum, (((long)AGP_WritePtr - (long)AGP_StartPtr) >> 2) | + 0x50000000); + MMIO(REG_3D_ParsingSet, smesa->AGPParseSet); + + MMIO(REG_3D_AGPCmFire, (GLint)(-1)); + mEndPrimitive(); + + *(smesa->pAGPCmdBufNext) = (((long)AGP_WritePtr - + (long)smesa->AGPCmdBufBase) + 0xf) & ~0xf; + AGP_StartPtr = AGP_WritePtr; + sisUpdateAGP( smesa ); +} + +/* Make sure there are more than num dwords left in the AGP queue. */ +static void +sisMakeRoomAGP( sisContextPtr smesa, GLint num ) +{ + int size = num * 4; + + if (size <= AGP_SpaceLeft) { + AGP_SpaceLeft -= size; + return; + } + /* Wrapping */ + if (AGP_WritePtr + num > (GLfloat *)(smesa->AGPCmdBufBase + + smesa->AGPCmdBufSize)) + { + sisFireVertsAGP( smesa ); + AGP_WritePtr = (GLfloat *)smesa->AGPCmdBufBase; + AGP_StartPtr = AGP_WritePtr; + sisUpdateAGP( smesa ); + WaitEngIdle( smesa ); /* XXX Why is this necessary? */ + } + + if (size > AGP_SpaceLeft) { + /* Update the cached engine read pointer */ + AGP_ReadPtr = (GLfloat *)((long)MMIO_READ(REG_3D_AGPCmBase) - + (long)smesa->AGPCmdBufAddr + (long)smesa->AGPCmdBufBase); + sisUpdateAGP( smesa ); + while (size > AGP_SpaceLeft) { + /* Spin until space is available. */ + AGP_ReadPtr = (GLfloat *)((long)MMIO_READ(REG_3D_AGPCmBase) - + (long)smesa->AGPCmdBufAddr + (long)smesa->AGPCmdBufBase); + sisUpdateAGP( smesa ); + } + } + AGP_SpaceLeft -= size; +} + +/**********************************************************************/ +/* Transition to/from hardware rasterization. */ +/**********************************************************************/ + +void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + sisContextPtr smesa = SIS_CONTEXT(ctx); + GLuint oldfallback = smesa->Fallback; + + if (mode) { + smesa->Fallback |= bit; + if (oldfallback == 0) { + _swsetup_Wakeup( ctx ); + smesa->RenderIndex = ~0; + } + } + else { + smesa->Fallback &= ~bit; + if (oldfallback == bit) { + _swrast_flush( ctx ); + tnl->Driver.Render.Start = sisRenderStart; + tnl->Driver.Render.PrimitiveNotify = sisRenderPrimitive; + tnl->Driver.Render.Finish = sisRenderFinish; + tnl->Driver.Render.BuildVertices = sisBuildVertices; + smesa->NewGLState |= (_SIS_NEW_RENDER_STATE| + _SIS_NEW_VERTEX_STATE); + } + } +} + + +/**********************************************************************/ +/* Initialization. */ +/**********************************************************************/ + +void sisInitTriFuncs( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); + static int firsttime = 1; + + if (firsttime) { + init_rast_tab(); + firsttime = 0; + + sis_vert_init_none(); + sis_vert_init_s(); + sis_vert_init_t0(); + sis_vert_init_st0(); + sis_vert_init_t1(); + sis_vert_init_st1(); + sis_vert_init_t0t1(); + sis_vert_init_st0t1(); + } + + tnl->Driver.RunPipeline = sisRunPipeline; + tnl->Driver.Render.Start = sisRenderStart; + tnl->Driver.Render.Finish = sisRenderFinish; + tnl->Driver.Render.PrimitiveNotify = sisRenderPrimitive; + tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; + tnl->Driver.Render.BuildVertices = sisBuildVertices; + tnl->Driver.Render.Multipass = NULL; + + if (getenv("SIS_FORCE_FALLBACK") != NULL) + sisFallback(ctx, SIS_FALLBACK_FORCE, 1); + else + sisFallback(ctx, SIS_FALLBACK_FORCE, 0); + + smesa->RenderIndex = ~0; + smesa->NewGLState |= (_SIS_NEW_RENDER_STATE| + _SIS_NEW_VERTEX_STATE); +} Index: xc/lib/GL/mesa/src/drv/sis/sis_tris.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_tris.h:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_tris.h Mon Dec 8 19:15:22 2003 @@ -0,0 +1,44 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_tris.h,v 1.2 2003/12/09 00:15:22 alanh Exp $ */ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ + +/* + * Authors: + * Eric Anholt + */ + +#ifndef __SIS_TRIS_H__ +#define __SIS_TRIS_H__ + +#include "mtypes.h" + +extern void sisInitTriFuncs( GLcontext *ctx ); + + +extern void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode ); +#define FALLBACK( smesa, bit, mode ) sisFallback( smesa->glCtx, bit, mode ) + + +#endif /* __SIS_TRIS_H__ */ Index: xc/lib/GL/mesa/src/drv/sis/sis_tritmp.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_tritmp.h:1.3 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_tritmp.h Mon Dec 8 19:15:22 2003 @@ -0,0 +1,150 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_tritmp.h,v 1.3 2003/12/09 00:15:22 alanh Exp $ */ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ + +/* + * Authors: + * Eric Anholt + */ + +#define AGP_VERT_REG_COUNT (5 + \ + ((SIS_STATES & SIS_VERT_TEX0) != 0) * 2 + \ + ((SIS_STATES & SIS_VERT_TEX1) != 0) * 2) + +static void TAG(sis_draw_quad_mmio)( sisContextPtr smesa, + sisVertexPtr v0, + sisVertexPtr v1, + sisVertexPtr v2, + sisVertexPtr v3 ) +{ + float *MMIOBase = (float *)GET_IOBase (smesa); + + mWait3DCmdQueue (MMIO_VERT_REG_COUNT * 6 + 1); + ((GLint *) MMIOBase)[REG_3D_PrimitiveSet / 4] = smesa->dwPrimitiveSet; + SIS_MMIO_WRITE_VERTEX(v0, 0, 0); + SIS_MMIO_WRITE_VERTEX(v1, 1, 0); + SIS_MMIO_WRITE_VERTEX(v3, 2, 1); + SIS_MMIO_WRITE_VERTEX(v1, 0, 0); + SIS_MMIO_WRITE_VERTEX(v2, 1, 0); + SIS_MMIO_WRITE_VERTEX(v3, 2, 1); +} + +static void TAG(sis_draw_tri_mmio)( sisContextPtr smesa, + sisVertexPtr v0, + sisVertexPtr v1, + sisVertexPtr v2 ) +{ + float *MMIOBase = (float *)GET_IOBase (smesa); + + mWait3DCmdQueue (MMIO_VERT_REG_COUNT * 3 + 1); + ((GLint *) MMIOBase)[REG_3D_PrimitiveSet / 4] = smesa->dwPrimitiveSet; + SIS_MMIO_WRITE_VERTEX(v0, 0, 0); + SIS_MMIO_WRITE_VERTEX(v1, 1, 0); + SIS_MMIO_WRITE_VERTEX(v2, 2, 1); +} + +static void TAG(sis_draw_line_mmio)( sisContextPtr smesa, + sisVertexPtr v0, + sisVertexPtr v1 ) +{ + float *MMIOBase = (float *)GET_IOBase (smesa); + + mWait3DCmdQueue (MMIO_VERT_REG_COUNT * 2 + 1); + ((GLint *) MMIOBase)[REG_3D_PrimitiveSet / 4] = smesa->dwPrimitiveSet; + SIS_MMIO_WRITE_VERTEX(v0, 0, 0); + SIS_MMIO_WRITE_VERTEX(v1, 1, 1); +} + +static void TAG(sis_draw_point_mmio)( sisContextPtr smesa, + sisVertexPtr v0 ) +{ + float *MMIOBase = (float *)GET_IOBase (smesa); + + mWait3DCmdQueue (MMIO_VERT_REG_COUNT * 1 + 1); + ((GLint *) MMIOBase)[REG_3D_PrimitiveSet / 4] = smesa->dwPrimitiveSet; + SIS_MMIO_WRITE_VERTEX(v0, 1, 1); +} + +static void TAG(sis_draw_quad_agp)( sisContextPtr smesa, + sisVertexPtr v0, + sisVertexPtr v1, + sisVertexPtr v2, + sisVertexPtr v3 ) +{ + sisMakeRoomAGP(smesa, AGP_VERT_REG_COUNT * 6); + + SIS_AGP_WRITE_VERTEX(v0); + SIS_AGP_WRITE_VERTEX(v1); + SIS_AGP_WRITE_VERTEX(v3); + SIS_AGP_WRITE_VERTEX(v1); + SIS_AGP_WRITE_VERTEX(v2); + SIS_AGP_WRITE_VERTEX(v3); +} + +static void TAG(sis_draw_tri_agp)( sisContextPtr smesa, + sisVertexPtr v0, + sisVertexPtr v1, + sisVertexPtr v2 ) +{ + sisMakeRoomAGP(smesa, AGP_VERT_REG_COUNT * 3); + + SIS_AGP_WRITE_VERTEX(v0); + SIS_AGP_WRITE_VERTEX(v1); + SIS_AGP_WRITE_VERTEX(v2); +} + +static void TAG(sis_draw_line_agp)( sisContextPtr smesa, + sisVertexPtr v0, + sisVertexPtr v1 ) +{ + sisMakeRoomAGP(smesa, AGP_VERT_REG_COUNT * 2); + + SIS_AGP_WRITE_VERTEX(v0); + SIS_AGP_WRITE_VERTEX(v1); +} + +static void TAG(sis_draw_point_agp)( sisContextPtr smesa, + sisVertexPtr v0 ) +{ + sisMakeRoomAGP(smesa, AGP_VERT_REG_COUNT * 1); + + SIS_AGP_WRITE_VERTEX(v0); +} + +static __inline void TAG(sis_vert_init)( void ) +{ + sis_quad_func_agp[SIS_STATES] = TAG(sis_draw_quad_agp); + sis_tri_func_agp[SIS_STATES] = TAG(sis_draw_tri_agp); + sis_line_func_agp[SIS_STATES] = TAG(sis_draw_line_agp); + sis_point_func_agp[SIS_STATES] = TAG(sis_draw_point_agp); + sis_quad_func_mmio[SIS_STATES] = TAG(sis_draw_quad_mmio); + sis_tri_func_mmio[SIS_STATES] = TAG(sis_draw_tri_mmio); + sis_line_func_mmio[SIS_STATES] = TAG(sis_draw_line_mmio); + sis_point_func_mmio[SIS_STATES] = TAG(sis_draw_point_mmio); +} + +#undef AGP_VERT_REG_COUNT +#undef TAG +#undef SIS_STATES Index: xc/lib/GL/mesa/src/drv/sis/sis_vb.c diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_vb.c:1.3 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_vb.c Mon Dec 8 19:15:23 2003 @@ -0,0 +1,463 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_vb.c,v 1.3 2003/12/09 00:15:23 alanh Exp $ */ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ + +/* + * Authors: + * Eric Anholt + */ + +#include "glheader.h" +#include "mtypes.h" +#include "imports.h" +#include "macros.h" +#include "colormac.h" + +#include "swrast_setup/swrast_setup.h" +#include "tnl/t_context.h" + +#include "sis_context.h" +#include "sis_vb.h" +#include "sis_tris.h" +#include "sis_state.h" + + +#define SIS_TEX1_BIT 0x1 +#define SIS_TEX0_BIT 0x2 +#define SIS_RGBA_BIT 0x4 +#define SIS_SPEC_BIT 0x8 +#define SIS_FOG_BIT 0x10 +#define SIS_XYZW_BIT 0x20 +#define SIS_PTEX_BIT 0x40 +#define SIS_MAX_SETUP 0x80 + +static struct { + void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint ); + interp_func interp; + copy_pv_func copy_pv; + GLboolean (*check_tex_sizes)( GLcontext *ctx ); + GLuint vertex_size; + GLuint vertex_stride_shift; + GLuint vertex_format; +} setup_tab[SIS_MAX_SETUP]; + +#define TEX0_VERTEX_FORMAT 1 +#define TEX1_VERTEX_FORMAT 2 + +#define TINY_VERTEX_FORMAT 0 +#define NOTEX_VERTEX_FORMAT 0 +#define PROJ_TEX1_VERTEX_FORMAT 0 +#define TEX2_VERTEX_FORMAT 0 +#define TEX3_VERTEX_FORMAT 0 +#define PROJ_TEX3_VERTEX_FORMAT 0 + +#define DO_XYZW (IND & SIS_XYZW_BIT) +#define DO_RGBA (IND & SIS_RGBA_BIT) +#define DO_SPEC (IND & SIS_SPEC_BIT) +#define DO_FOG (IND & SIS_FOG_BIT) +#define DO_TEX0 (IND & SIS_TEX0_BIT) +#define DO_TEX1 (IND & SIS_TEX1_BIT) +#define DO_TEX2 0 +#define DO_TEX3 0 +#define DO_PTEX (IND & SIS_PTEX_BIT) + +#define VERTEX sisVertex +#define VERTEX_COLOR sis_color_t +#define LOCALVARS sisContextPtr smesa = SIS_CONTEXT(ctx); +#define GET_VIEWPORT_MAT() smesa->hw_viewport +#define GET_TEXSOURCE(n) n +#define GET_VERTEX_FORMAT() smesa->vertex_format +#define GET_VERTEX_STORE() smesa->verts +#define GET_VERTEX_STRIDE_SHIFT() smesa->vertex_stride_shift +#define GET_UBYTE_COLOR_STORE() &smesa->UbyteColor +#define GET_UBYTE_SPEC_COLOR_STORE() &smesa->UbyteSecondaryColor + +#define HAVE_HW_VIEWPORT 0 +#define HAVE_HW_DIVIDE 0 +#define HAVE_RGBA_COLOR 0 +#define HAVE_TINY_VERTICES 0 +#define HAVE_NOTEX_VERTICES 0 +#define HAVE_TEX0_VERTICES 1 +#define HAVE_TEX1_VERTICES 1 +#define HAVE_TEX2_VERTICES 0 +#define HAVE_TEX3_VERTICES 0 +#define HAVE_PTEX_VERTICES 0 + +#define UNVIEWPORT_VARS GLfloat h = SIS_CONTEXT(ctx)->driDrawable->h +#define UNVIEWPORT_X(x) x - SUBPIXEL_X +#define UNVIEWPORT_Y(y) - y + h + SUBPIXEL_Y +#define UNVIEWPORT_Z(z) z / smesa->depth_scale + +#define PTEX_FALLBACK() FALLBACK(smesa, SIS_FALLBACK_TEXTURE, 1) + +#define IMPORT_FLOAT_COLORS sis_import_float_colors +#define IMPORT_FLOAT_SPEC_COLORS sis_import_float_spec_colors + +#define INTERP_VERTEX setup_tab[smesa->SetupIndex].interp +#define COPY_PV_VERTEX setup_tab[smesa->SetupIndex].copy_pv + +/*********************************************************************** + * Generate pv-copying and translation functions * + ***********************************************************************/ + +#define TAG(x) sis_##x +#include "tnl_dd/t_dd_vb.c" + +/*********************************************************************** + * Generate vertex emit and interp functions * + ***********************************************************************/ + + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT) +#define TAG(x) x##_wg +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_SPEC_BIT) +#define TAG(x) x##_wgs +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_TEX0_BIT) +#define TAG(x) x##_wgt0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_TEX0_BIT|SIS_TEX1_BIT) +#define TAG(x) x##_wgt0t1 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_TEX0_BIT|SIS_PTEX_BIT) +#define TAG(x) x##_wgpt0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_SPEC_BIT|SIS_TEX0_BIT) +#define TAG(x) x##_wgst0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_SPEC_BIT|SIS_TEX0_BIT|\ + SIS_TEX1_BIT) +#define TAG(x) x##_wgst0t1 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_SPEC_BIT|SIS_TEX0_BIT|\ + SIS_PTEX_BIT) +#define TAG(x) x##_wgspt0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_FOG_BIT) +#define TAG(x) x##_wgf +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_FOG_BIT|SIS_SPEC_BIT) +#define TAG(x) x##_wgfs +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_FOG_BIT|SIS_TEX0_BIT) +#define TAG(x) x##_wgft0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_FOG_BIT|SIS_TEX0_BIT|\ + SIS_TEX1_BIT) +#define TAG(x) x##_wgft0t1 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_FOG_BIT|SIS_TEX0_BIT|\ + SIS_PTEX_BIT) +#define TAG(x) x##_wgfpt0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_FOG_BIT|SIS_SPEC_BIT|\ + SIS_TEX0_BIT) +#define TAG(x) x##_wgfst0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_FOG_BIT|SIS_SPEC_BIT|\ + SIS_TEX0_BIT|SIS_TEX1_BIT) +#define TAG(x) x##_wgfst0t1 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_XYZW_BIT|SIS_RGBA_BIT|SIS_FOG_BIT|SIS_SPEC_BIT|\ + SIS_TEX0_BIT|SIS_PTEX_BIT) +#define TAG(x) x##_wgfspt0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_TEX0_BIT) +#define TAG(x) x##_t0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_TEX0_BIT|SIS_TEX1_BIT) +#define TAG(x) x##_t0t1 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_FOG_BIT) +#define TAG(x) x##_f +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_FOG_BIT|SIS_TEX0_BIT) +#define TAG(x) x##_ft0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_FOG_BIT|SIS_TEX0_BIT|SIS_TEX1_BIT) +#define TAG(x) x##_ft0t1 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT) +#define TAG(x) x##_g +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_SPEC_BIT) +#define TAG(x) x##_gs +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_TEX0_BIT) +#define TAG(x) x##_gt0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_TEX0_BIT|SIS_TEX1_BIT) +#define TAG(x) x##_gt0t1 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_SPEC_BIT|SIS_TEX0_BIT) +#define TAG(x) x##_gst0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_SPEC_BIT|SIS_TEX0_BIT|SIS_TEX1_BIT) +#define TAG(x) x##_gst0t1 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_FOG_BIT) +#define TAG(x) x##_gf +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_FOG_BIT|SIS_SPEC_BIT) +#define TAG(x) x##_gfs +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_FOG_BIT|SIS_TEX0_BIT) +#define TAG(x) x##_gft0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_FOG_BIT|SIS_TEX0_BIT|SIS_TEX1_BIT) +#define TAG(x) x##_gft0t1 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_FOG_BIT|SIS_SPEC_BIT|SIS_TEX0_BIT) +#define TAG(x) x##_gfst0 +#include "tnl_dd/t_dd_vbtmp.h" + +#define IND (SIS_RGBA_BIT|SIS_FOG_BIT|SIS_SPEC_BIT|SIS_TEX0_BIT|\ + SIS_TEX1_BIT) +#define TAG(x) x##_gfst0t1 +#include "tnl_dd/t_dd_vbtmp.h" + + +static void init_setup_tab( void ) +{ + init_wg(); + init_wgs(); + init_wgt0(); + init_wgt0t1(); + init_wgpt0(); + init_wgst0(); + init_wgst0t1(); + init_wgspt0(); + init_wgf(); + init_wgfs(); + init_wgft0(); + init_wgft0t1(); + init_wgfpt0(); + init_wgfst0(); + init_wgfst0t1(); + init_wgfspt0(); + init_t0(); + init_t0t1(); + init_f(); + init_ft0(); + init_ft0t1(); + init_g(); + init_gs(); + init_gt0(); + init_gt0t1(); + init_gst0(); + init_gst0t1(); + init_gf(); + init_gfs(); + init_gft0(); + init_gft0t1(); + init_gfst0(); + init_gfst0t1(); +} + + + +void sisPrintSetupFlags(char *msg, GLuint flags ) +{ + fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n", + msg, + (int)flags, + (flags & SIS_XYZW_BIT) ? " xyzw," : "", + (flags & SIS_RGBA_BIT) ? " rgba," : "", + (flags & SIS_SPEC_BIT) ? " spec," : "", + (flags & SIS_FOG_BIT) ? " fog," : "", + (flags & SIS_TEX0_BIT) ? " tex-0," : "", + (flags & SIS_TEX1_BIT) ? " tex-1," : ""); +} + + + +void sisCheckTexSizes( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + + if (!setup_tab[smesa->SetupIndex].check_tex_sizes(ctx)) { + TNLcontext *tnl = TNL_CONTEXT(ctx); + + /* Invalidate stored verts + */ + smesa->SetupNewInputs = ~0; + smesa->SetupIndex |= SIS_PTEX_BIT; + + if (!smesa->Fallback && + !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { + tnl->Driver.Render.Interp = setup_tab[smesa->SetupIndex].interp; + tnl->Driver.Render.CopyPV = setup_tab[smesa->SetupIndex].copy_pv; + } + } +} + +void sisBuildVertices( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint newinputs ) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + GLubyte *v = ((GLubyte *)smesa->verts + (start<vertex_stride_shift)); + GLuint stride = 1 << smesa->vertex_stride_shift; + + newinputs |= smesa->SetupNewInputs; + smesa->SetupNewInputs = 0; + + if (!newinputs) + return; + + if (newinputs & VERT_BIT_POS) { + setup_tab[smesa->SetupIndex].emit( ctx, start, count, v, stride ); + } else { + GLuint ind = 0; + + if (newinputs & VERT_BIT_COLOR0) + ind |= SIS_RGBA_BIT; + + if (newinputs & VERT_BIT_COLOR1) + ind |= SIS_SPEC_BIT; + + if (newinputs & VERT_BIT_TEX0) + ind |= SIS_TEX0_BIT; + + if (newinputs & VERT_BIT_TEX1) + ind |= SIS_TEX1_BIT; + + if (newinputs & VERT_BIT_FOG) + ind |= SIS_FOG_BIT; + + if (smesa->SetupIndex & SIS_PTEX_BIT) + ind = ~0; + + ind &= smesa->SetupIndex; + + if (ind) { + setup_tab[ind].emit( ctx, start, count, v, stride ); + } + } +} + +void sisChooseVertexState( GLcontext *ctx ) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + sisContextPtr smesa = SIS_CONTEXT( ctx ); + GLuint ind = SIS_XYZW_BIT | SIS_RGBA_BIT; + + if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) + ind |= SIS_SPEC_BIT; + + if (ctx->Fog.Enabled) + ind |= SIS_FOG_BIT; + + if (ctx->Texture._EnabledUnits) { + ind |= SIS_TEX0_BIT; + if (ctx->Texture.Unit[0]._ReallyEnabled && + ctx->Texture.Unit[1]._ReallyEnabled) + ind |= SIS_TEX1_BIT; + } + + smesa->SetupIndex = ind; + + if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE | DD_TRI_UNFILLED)) { + tnl->Driver.Render.Interp = sis_interp_extras; + tnl->Driver.Render.CopyPV = sis_copy_pv_extras; + } else { + tnl->Driver.Render.Interp = setup_tab[ind].interp; + tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv; + } + + if (setup_tab[ind].vertex_format != smesa->vertex_format) { + smesa->vertex_format = setup_tab[ind].vertex_format; + smesa->vertex_size = setup_tab[ind].vertex_size; + smesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift; + } +} + + +void sisInitVB( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + GLuint size = TNL_CONTEXT(ctx)->vb.Size; + static int firsttime = 1; + + smesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32); + + if (firsttime) { + init_setup_tab(); + firsttime = 0; + } +} + +void sisFreeVB( GLcontext *ctx ) +{ + sisContextPtr smesa = SIS_CONTEXT( ctx ); + if (smesa->verts) { + ALIGN_FREE(smesa->verts); + smesa->verts = NULL; + } + + + if (smesa->UbyteSecondaryColor.Ptr) { + ALIGN_FREE(smesa->UbyteSecondaryColor.Ptr); + smesa->UbyteSecondaryColor.Ptr = NULL; + } + + if (smesa->UbyteColor.Ptr) { + ALIGN_FREE(smesa->UbyteColor.Ptr); + smesa->UbyteColor.Ptr = NULL; + } +} Index: xc/lib/GL/mesa/src/drv/sis/sis_vb.h diff -u /dev/null xc/lib/GL/mesa/src/drv/sis/sis_vb.h:1.2 --- /dev/null Sat Feb 28 21:41:18 2004 +++ xc/lib/GL/mesa/src/drv/sis/sis_vb.h Mon Dec 8 19:15:23 2003 @@ -0,0 +1,62 @@ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_vb.h,v 1.2 2003/12/09 00:15:23 alanh Exp $ */ +/************************************************************************** + +Copyright 2003 Eric Anholt +All Rights Reserved. + +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 +on the rights to use, copy, modify, merge, publish, distribute, sub +license, 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 (including the next +paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL +ERIC ANHOLT 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. + +**************************************************************************/ + +/* + * Authors: + * Eric Anholt + */ + +#ifndef __SIS_VB_H__ +#define __SIS_VB_H__ + +#include "mtypes.h" +#include "swrast/swrast.h" +#include "sis_context.h" + +#define _SIS_NEW_VERTEX_STATE (_DD_NEW_SEPARATE_SPECULAR | \ + _DD_NEW_TRI_LIGHT_TWOSIDE | \ + _DD_NEW_TRI_UNFILLED | \ + _NEW_TEXTURE | \ + _NEW_FOG) + +extern void sisCheckTexSizes( GLcontext *ctx ); +extern void sisChooseVertexState( GLcontext *ctx ); + +extern void sisBuildVertices( GLcontext *ctx, GLuint start, GLuint count, + GLuint newinputs ); + +extern void sisPrintSetupFlags( char *msg, GLuint flags ); + +extern void sisInitVB( GLcontext *ctx ); +extern void sisFreeVB( GLcontext *ctx ); + +extern void sis_translate_vertex( GLcontext *ctx, + const sisVertex *src, + SWvertex *dst ); + +extern void sis_print_vertex( GLcontext *ctx, const sisVertex *v ); + +#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_xf86glx.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_xf86glx.c:1.1 xc/lib/GL/mesa/src/drv/sis/sis_xf86glx.c:removed --- xc/lib/GL/mesa/src/drv/sis/sis_xf86glx.c:1.1 Fri Jun 30 15:30:29 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_xf86glx.c Sat Feb 28 21:41:18 2004 @@ -1,962 +0,0 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_xf86glx.c,v 1.1 2000/06/30 19:30:29 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - * $PI: xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v 1.15 1999/08/04 18:14:14 faith Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "xf86glxint.h" -#include "xmesaP.h" -#include - -/* - * This define is for the glcore.h header file. - * If you add it here, then make sure you also add it in - * ../../../glx/Imakefile. - */ -#if 0 -#define DEBUG -#include -#undef DEBUG -#else -#include -#endif - - -/* - * This structure is statically allocated in the __glXScreens[] - * structure. This struct is not used anywhere other than in - * __glXScreenInit to initialize each of the active screens - * (__glXActiveScreens[]). Several of the fields must be initialized by - * the screenProbe routine before they are copied to the active screens - * struct. In particular, the contextCreate, pGlxVisual, numVisuals, - * and numUsableVisuals fields must be initialized. - */ -__GLXscreenInfo __glDDXScreenInfo = { - __MESA_screenProbe, /* Must be generic and handle all screens */ - __MESA_createContext, /* Substitute screen's createContext routine */ - __MESA_createBuffer, /* Substitute screen's createBuffer routine */ - NULL, /* Set up pGlxVisual in probe */ - NULL, /* Set up pVisualPriv in probe */ - 0, /* Set up numVisuals in probe */ - 0, /* Set up numUsableVisuals in probe */ - "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ - "Version String", /* GLXversion is overwritten by __glXScreenInit */ - "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ - NULL /* WrappedPositionWindow is overwritten */ -}; - -__GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_MESA, - __MESA_resetExtension, - __MESA_initVisuals, - __MESA_setVisualConfigs -}; - -__MESA_screen MESAScreens[MAXSCREENS]; -__GLcontext *MESA_CC = NULL; - -int numConfigs = 0; -__GLXvisualConfig *visualConfigs = NULL; -void **visualPrivates = NULL; - -static int count_bits(unsigned int n) -{ - int bits = 0; - - while (n > 0) { - if (n & 1) bits++; - n >>= 1; - } - return bits; -} - -static XMesaVisual find_mesa_visual(int screen, VisualID vid) -{ - XMesaVisual xm_vis = NULL; - __MESA_screen *pMScr = &MESAScreens[screen]; - int i; - - for (i = 0; i < pMScr->num_vis; i++) { - if (pMScr->glx_vis[i].vid == vid) { - break; - } - } - - if (i < pMScr->num_vis) { - xm_vis = pMScr->xm_vis[i]; - } - return xm_vis; -} - -#define VISUAL_CONFIG(rgba,accum,back,depth,stencil,rating) \ -{ \ - -1, /* vid */ \ - -1, /* class */ \ - rgba, /* rgba */ \ - -1, -1, -1, 0, /* rgba sizes, alpha not supported, yet */ \ - -1, -1, -1, 0, /* rgba masks, alpha not supported, yet */ \ - accum, accum, accum, accum, /* rgba accum sizes */ \ - back, /* doubleBuffer */ \ - GL_FALSE, /* stereo */ \ - -1, /* bufferSize */ \ - depth, /* depthSize */ \ - stencil, /* stencilSize */ \ - 0, /* auxBuffers */ \ - 0, /* level */ \ - rating, /* visualRating */ \ - 0, /* transparentPixel */ \ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ \ - 0 /* transparentIndex */ \ -} - -#define IS_RGBA GL_TRUE -#define IS_CI GL_FALSE -#define HAS_ACCUM ACCUM_BITS -#define NO_ACCUM 0 -#define HAS_BACK GL_TRUE -#define NO_BACK GL_FALSE -#define HAS_DEPTH DEPTH_BITS -#define NO_DEPTH 0 -#define HAS_STENCIL STENCIL_BITS -#define NO_STENCIL 0 - -static __GLXvisualConfig __MESAvisualConfigs[] = { - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, NO_BACK, 0, 0, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, NO_BACK, 16, 0, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, NO_BACK, 32, 0, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, NO_BACK, 24, 8, 0), - - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, HAS_BACK, 0, 0, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, HAS_BACK, 16, 0, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, HAS_BACK, 32, 0, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, HAS_BACK, 24, 8, 0), - - VISUAL_CONFIG(IS_RGBA, HAS_ACCUM, NO_BACK, 0, 0, 0), - VISUAL_CONFIG(IS_RGBA, HAS_ACCUM, NO_BACK, 16, 0, 0), - VISUAL_CONFIG(IS_RGBA, HAS_ACCUM, NO_BACK, 32, 0, 0), - VISUAL_CONFIG(IS_RGBA, HAS_ACCUM, NO_BACK, 24, 8, 0), - - VISUAL_CONFIG(IS_RGBA, HAS_ACCUM, HAS_BACK, 0, 0, 0), - VISUAL_CONFIG(IS_RGBA, HAS_ACCUM, HAS_BACK, 16, 0, 0), - VISUAL_CONFIG(IS_RGBA, HAS_ACCUM, HAS_BACK, 32, 0, 0), - VISUAL_CONFIG(IS_RGBA, HAS_ACCUM, HAS_BACK, 24, 8, 0), -/* - VISUAL_CONFIG( IS_CI, NO_ACCUM, NO_BACK, NO_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, NO_BACK, HAS_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, HAS_BACK, NO_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, HAS_BACK, HAS_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, NO_BACK, NO_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, HAS_BACK, HAS_DEPTH, HAS_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, HAS_BACK, HAS_DEPTH, HAS_STENCIL, 0), -*/ -}; - -/* -static __GLXvisualConfig __MESAvisualConfigs[] = { - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, NO_BACK, NO_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, NO_BACK, HAS_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, HAS_BACK, NO_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, HAS_BACK, HAS_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, NO_BACK, NO_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG(IS_RGBA, NO_ACCUM, HAS_BACK, HAS_DEPTH, HAS_STENCIL, 0), - VISUAL_CONFIG(IS_RGBA, HAS_ACCUM, HAS_BACK, HAS_DEPTH, HAS_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, NO_BACK, NO_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, NO_BACK, HAS_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, HAS_BACK, NO_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, HAS_BACK, HAS_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, NO_BACK, NO_DEPTH, NO_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, HAS_BACK, HAS_DEPTH, HAS_STENCIL, 0), - VISUAL_CONFIG( IS_CI, NO_ACCUM, HAS_BACK, HAS_DEPTH, HAS_STENCIL, 0), -}; -*/ - -static int __numMESAvisualConfigs = - sizeof(__MESAvisualConfigs)/sizeof(__GLXvisualConfig); -static int __numRGBconfigs = -1; -static int __numCIconfigs = -1; - -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numVisuals = *nvisualp; - int numMesaVisuals = 0; - int numMergedVisualConfigs = 0; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLXvisualConfig *glXVisualPtr = NULL; - __GLXvisualConfig *pMergedVisualConfigs = NULL; - void **glXVisualPriv; - void **pMergedVisualPriv; - int *mesaConfigUsed; - int *driverConfigUsed; - int found_default = FALSE; - int i, j, k; - int is_rgb; - Bool match; - - /* Alloc space for the list of merged GLX visuals */ - pMergedVisualConfigs = - (__GLXvisualConfig *)__glXMalloc((numConfigs + - __numMESAvisualConfigs) * - sizeof(__GLXvisualConfig)); - if (!pMergedVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of merged GLX visual privates */ - pMergedVisualPriv = - (void **)__glXMalloc((numConfigs + __numMESAvisualConfigs) * - sizeof(void *)); - if (!pMergedVisualPriv) { - __glXFree(pMergedVisualConfigs); - return FALSE; - } - - /* Compute the intersection of the driver's visual configs */ - mesaConfigUsed = __glXCalloc(__numMESAvisualConfigs, sizeof(int)); - driverConfigUsed = __glXCalloc(numConfigs, sizeof(int)); - - for (i = j = 0; i < numConfigs; i++) { - k = 0; - while ((k < __numMESAvisualConfigs) && (!driverConfigUsed[i])) { - if (!mesaConfigUsed[k]) { - -#ifdef DEBUG_VISUAL_CONFIG -#define TEST_AND_COPY(fld) do { \ - if (match) { \ - if ((__MESAvisualConfigs[k].fld == visualConfigs[i].fld) || \ - (__MESAvisualConfigs[k].fld == -1)) { \ - pMergedVisualConfigs[j].fld = visualConfigs[i].fld; \ - } \ - else if (visualConfigs[i].fld == -1) { \ - pMergedVisualConfigs[j].fld = __MESAvisualConfigs[k].fld; \ - } \ - else { \ - match = FALSE; \ - xf86DrvMsg (0, 0, "[GLXVisualInit] mismatch: " \ - "(%s) DriverVisualConfig[%d] MesaVisualConfig[%d]\n", \ - #fld, i, k); \ - } \ - } \ - } while (0) -#else -#define TEST_AND_COPY(fld) do { \ - if (match) { \ - if ((__MESAvisualConfigs[k].fld == visualConfigs[i].fld) || \ - (__MESAvisualConfigs[k].fld == -1)) { \ - pMergedVisualConfigs[j].fld = visualConfigs[i].fld; \ - } \ - else if (visualConfigs[i].fld == -1) { \ - pMergedVisualConfigs[j].fld = __MESAvisualConfigs[k].fld; \ - } \ - else { \ - match = FALSE; \ - } \ - } \ - } while (0) -#endif - - match = TRUE; - TEST_AND_COPY(class); - TEST_AND_COPY(rgba); - TEST_AND_COPY(redSize); - TEST_AND_COPY(greenSize); - TEST_AND_COPY(blueSize); - TEST_AND_COPY(alphaSize); - TEST_AND_COPY(redMask); - TEST_AND_COPY(greenMask); - TEST_AND_COPY(blueMask); - TEST_AND_COPY(alphaMask); - TEST_AND_COPY(accumRedSize); - TEST_AND_COPY(accumGreenSize); - TEST_AND_COPY(accumBlueSize); - TEST_AND_COPY(accumAlphaSize); - TEST_AND_COPY(doubleBuffer); - TEST_AND_COPY(stereo); - TEST_AND_COPY(bufferSize); - TEST_AND_COPY(depthSize); - TEST_AND_COPY(stencilSize); - TEST_AND_COPY(auxBuffers); - TEST_AND_COPY(level); - TEST_AND_COPY(visualRating); - TEST_AND_COPY(transparentPixel); - TEST_AND_COPY(transparentRed); - TEST_AND_COPY(transparentGreen); - TEST_AND_COPY(transparentBlue); - TEST_AND_COPY(transparentAlpha); - TEST_AND_COPY(transparentIndex); - if (match) { - driverConfigUsed[i] = TRUE; - mesaConfigUsed[k] = TRUE; - pMergedVisualPriv[j] = visualPrivates[i]; - j++; -#ifdef DEBUG_VISUAL_CONFIG - xf86DrvMsg (0, 0, "[GLXVisualInit] MATCH: " - "DriverVisualConfig[%d] MesaVisualConfig[%d]\n", i, k); -#endif - } - } - k++; - } - } - - /* - ** If SetVisualConfigs was not called, then just make all of Mesa's - ** visual configs available. - */ - if (!numConfigs) { - memcpy(pMergedVisualConfigs, __MESAvisualConfigs, - sizeof(__GLXvisualConfig) * __numMESAvisualConfigs); - memset(pMergedVisualPriv, 0, sizeof(void *) * __numMESAvisualConfigs); - memset(mesaConfigUsed, TRUE, sizeof(int) * __numMESAvisualConfigs); - j = __numMESAvisualConfigs; - } - - /* - ** This code is not currently used. When the visual caveat - ** extension is supported by the DRI and Mesa, we can take advantage - ** of this code. - */ -#if 0 - /* Add any unclaimed MESA configs w/ slow caveat */ - for (i = 0; i < __numMESAvisualConfigs; i++) { - if (!mesaConfigUsed[i]) { - memcpy(&pMergedVisualConfigs[j], &__MESAvisualConfigs[i], - sizeof(__GLXvisualConfig)); - pMergedVisualConfigs[j].visualRating = GLX_SLOW_VISUAL_EXT; - j++; -#ifdef DEBUG_VISUAL_CONFIG - xf86DrvMsg (0, 0, "[GLXVisualInit] slow config: " - "MesaVisualConfig[%d]\n", i); -#endif - } - } - - /* Add any unclaimed driver configs w/ nonconformant caveat */ - for (i = 0; i < numConfigs; i++) { - if (!driverConfigUsed[i]) { - memcpy(&pMergedVisualConfigs[j], &visualConfigs[i], - sizeof(__GLXvisualConfig)); - pMergedVisualConfigs[j].visualRating = GLX_NON_CONFORMANT_VISUAL_EXT; - j++; -#ifdef DEBUG_VISUAL_CONFIG - xf86DrvMsg (0, 0, "[GLXVisualInit] non-conformant config: " - "DriverVisualConfig[%d]\n", i); -#endif - } - } -#endif - - numMergedVisualConfigs = j; - - /* Count the number of RGB and CI visual configs */ - __numRGBconfigs = __numCIconfigs = 0; - for (i = 0; i < numMergedVisualConfigs; i++) { - if (pMergedVisualConfigs[i].rgba) - __numRGBconfigs++; - else - __numCIconfigs++; - } - - /* Count the total number of visuals to compute */ - for (i = 0; i < numVisuals; i++) { - numMesaVisuals += - (pVisual[i].class == TrueColor || pVisual[i].class == DirectColor) - ? __numRGBconfigs : __numCIconfigs; - } - - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numMesaVisuals * sizeof(VisualID)); - if (!orig_vid) { - __glXFree(pMergedVisualPriv); - __glXFree(pMergedVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - glXVisualPtr = (__GLXvisualConfig *)__glXMalloc(numMesaVisuals * - sizeof(__GLXvisualConfig)); - if (!glXVisualPtr) { - __glXFree(orig_vid); - __glXFree(pMergedVisualPriv); - __glXFree(pMergedVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numMesaVisuals * sizeof(void *)); - if (!glXVisualPriv) { - __glXFree(glXVisualPtr); - __glXFree(orig_vid); - __glXFree(pMergedVisualPriv); - __glXFree(pMergedVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numMesaVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - __glXFree(glXVisualPriv); - __glXFree(glXVisualPtr); - __glXFree(orig_vid); - __glXFree(pMergedVisualPriv); - __glXFree(pMergedVisualConfigs); - return FALSE; - } - - /* Initialize the new visuals */ - for (i = j = 0; i < numVisuals; i++) { - is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - for (k = 0; k < numMergedVisualConfigs; k++) { - if (pMergedVisualConfigs[k].rgba != is_rgb) - continue; - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - glXVisualPtr[j] = pMergedVisualConfigs[k]; - glXVisualPtr[j].vid = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (glXVisualPtr[j].class == -1) { - glXVisualPtr[j].class = pVisual[i].class; - glXVisualPtr[j].redSize = count_bits(pVisual[i].redMask); - glXVisualPtr[j].greenSize = count_bits(pVisual[i].greenMask); - glXVisualPtr[j].blueSize = count_bits(pVisual[i].blueMask); - glXVisualPtr[j].alphaSize = 0; /* Not supported in Mesa */ - glXVisualPtr[j].redMask = pVisual[i].redMask; - glXVisualPtr[j].greenMask = pVisual[i].greenMask; - glXVisualPtr[j].blueMask = pVisual[i].blueMask; - glXVisualPtr[j].alphaMask = 0; /* Not supported in Mesa */ - glXVisualPtr[j].bufferSize = rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pMergedVisualPriv[k]; - - j++; - } - } - - /* Save the GLX visuals in the screen structure */ - MESAScreens[screenInfo.numScreens-1].num_vis = numMesaVisuals; - MESAScreens[screenInfo.numScreens-1].glx_vis = glXVisualPtr; - MESAScreens[screenInfo.numScreens-1].private = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numMesaVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numMesaVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } - - /* Update the X server's visuals */ - *nvisualp = numMesaVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - __glXFree(pVisual); - - /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pMergedVisualPriv); - __glXFree(pMergedVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) xfree(visualPrivates); - visualPrivates = NULL; - - return TRUE; -} - -void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -Bool __MESA_initVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, int *rootDepthp, - VisualID *defaultVisp, unsigned long sizes, - int bitsPerRGB) -{ - /* - * Setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} - -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __MESA_screen *pMScr = &MESAScreens[screen]; - __GLXvisualConfig *pGLXVis = pMScr->glx_vis; - VisualPtr pVis; - int i, j; - - for (i = 0; i < pMScr->num_vis; i++, pGLXVis++) { - pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++, pVis++) { - if (pVis->class == pGLXVis->class && - pVis->nplanes == pGLXVis->bufferSize) { - - /* Fixup the masks */ - pGLXVis->redMask = pVis->redMask; - pGLXVis->greenMask = pVis->greenMask; - pGLXVis->blueMask = pVis->blueMask; - - /* Recalc the sizes */ - pGLXVis->redSize = count_bits(pGLXVis->redMask); - pGLXVis->greenSize = count_bits(pGLXVis->greenMask); - pGLXVis->blueSize = count_bits(pGLXVis->blueMask); - } - } - } -} - -static void init_screen_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __GLXvisualConfig *pGLXVis = MESAScreens[screen].glx_vis; - XMesaVisual *pXMesaVisual; - VisualPtr pVis; - int *used; - int i, j; - - /* Alloc space for the list of XMesa visuals */ - pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis * - sizeof(XMesaVisual)); - - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); - - for (i = 0; i < MESAScreens[screen].num_vis; i++, pGLXVis++) { - - pVis = pScreen->visuals; - for (j = 0; j < pScreen->numVisuals; j++, pVis++) { - - if (pVis->class == pGLXVis->class && - pVis->nplanes == pGLXVis->bufferSize && - !used[j]) { - - if (pVis->redMask == pGLXVis->redMask && - pVis->greenMask == pGLXVis->greenMask && - pVis->blueMask == pGLXVis->blueMask) { - - /* Create the XMesa visual */ - pXMesaVisual[i] = - XMesaCreateVisual(pScreen, - pVis, - pGLXVis->rgba, - (pGLXVis->alphaSize > 0), - pGLXVis->doubleBuffer, - pGLXVis->stereo, - GL_TRUE, /* ximage_flag */ - pGLXVis->depthSize, - pGLXVis->stencilSize, - pGLXVis->accumRedSize, - pGLXVis->level); - - /* Set the VisualID */ - pGLXVis->vid = pVis->vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - } - } - - __glXFree(used); - - MESAScreens[screen].xm_vis = pXMesaVisual; -} - -Bool __MESA_screenProbe(int screen) -{ - /* - * Set up the current screen's visuals. - */ - __glDDXScreenInfo.pGlxVisual = MESAScreens[screen].glx_vis; - __glDDXScreenInfo.pVisualPriv = MESAScreens[screen].private; - __glDDXScreenInfo.numVisuals = - __glDDXScreenInfo.numUsableVisuals = MESAScreens[screen].num_vis; - - /* - * Set the current screen's createContext routine. This could be - * wrapped by a DDX GLX context creation routine. - */ - __glDDXScreenInfo.createContext = __MESA_createContext; - - /* - * The ordering of the rgb compenents might have been changed by the - * driver after mi initialized them. - */ - fixup_visuals(screen); - - /* - * Find the GLX visuals that are supported by this screen and create - * XMesa's visuals. - */ - init_screen_visuals(screen); - - return TRUE; -} - -extern void __MESA_resetExtension(void) -{ - int i, j; - - XMesaReset(); - - for (i = 0; i < screenInfo.numScreens; i++) { - for (j = 0; j < MESAScreens[i].num_vis; j++) { - XMesaDestroyVisual(MESAScreens[i].xm_vis[j]); - } - __glXFree(MESAScreens[i].glx_vis); - MESAScreens[i].glx_vis = NULL; - MESAScreens[i].num_vis = 0; - } - MESA_CC = NULL; -} - -void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv) -{ - DrawablePtr pDraw = glxPriv->pDraw; - XMesaVisual xm_vis = find_mesa_visual(pDraw->pScreen->myNum, - glxPriv->pGlxVisual->vid); - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - __MESA_buffer buf; - - buf = (__MESA_buffer)__glXMalloc(sizeof(struct __MESA_bufferRec)); - - /* Create Mesa's buffers */ - if (glxPriv->type == DRAWABLE_WINDOW) { - buf->xm_buf = (void *)XMesaCreateWindowBuffer(xm_vis, - (WindowPtr)pDraw); - } else { - buf->xm_buf = (void *)XMesaCreatePixmapBuffer(xm_vis, - (PixmapPtr)pDraw, 0); - } - - /* Wrap the front buffer's resize routine */ - buf->fbresize = glPriv->frontBuffer.resize; - glPriv->frontBuffer.resize = __MESA_resizeBuffers; - - /* Wrap the swap buffers routine */ - buf->fbswap = glxPriv->swapBuffers; - glxPriv->swapBuffers = __MESA_swapBuffers; - - /* Save Mesa's private buffer structure */ - glPriv->private = (void *)buf; - glPriv->freePrivate = __MESA_destroyBuffer; -} - -GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buffer, - GLint x, GLint y, - GLuint width, GLuint height, - __GLdrawablePrivate *glPriv, - GLuint bufferMask) -{ - __MESA_buffer buf = (__MESA_buffer)glPriv->private; - - if (buf->xm_buf && buf->xm_buf->xm_context) { - GLcontext *ctx = buf->xm_buf->xm_context->gl_ctx; - XMesaForceCurrent(buf->xm_buf->xm_context); - (*ctx->CurrentDispatch->ResizeBuffersMESA)(); - if (MESA_CC) - XMesaForceCurrent(MESA_CC->xm_ctx); - } - - return (*buf->fbresize)(buffer, x, y, width, height, glPriv, bufferMask); -} - -GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv) -{ - __MESA_buffer buf = (__MESA_buffer)glxPriv->glPriv.private; - - /* - ** Do not call the wrapped swap buffers routine since Mesa has - ** already done the swap. - */ - XMesaSwapBuffers(buf->xm_buf); - - return GL_TRUE; -} - -void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv) -{ - __MESA_buffer buf = (__MESA_buffer)glPriv->private; - __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other; - - /* Destroy Mesa's buffers */ - if (buf->xm_buf) - XMesaDestroyBuffer(buf->xm_buf); - - /* Unwrap these routines */ - glxPriv->swapBuffers = buf->fbswap; - glPriv->frontBuffer.resize = buf->fbresize; - - __glXFree(glPriv->private); - glPriv->private = NULL; -} - -__GLinterface *__MESA_createContext(__GLimports *imports, - __GLcontextModes *modes, - __GLinterface *shareGC) -{ - __GLcontext *gl_ctx; - XMesaContext m_share = NULL; - XMesaVisual xm_vis; - __GLXcontext *glxc = (__GLXcontext *)imports->other; - - gl_ctx = (__GLcontext *)__glXMalloc(sizeof(__GLcontext)); - if (!gl_ctx) - return NULL; - - gl_ctx->iface.imports = *imports; - - gl_ctx->iface.exports.destroyContext = __MESA_destroyContext; - gl_ctx->iface.exports.loseCurrent = __MESA_loseCurrent; - gl_ctx->iface.exports.makeCurrent = __MESA_makeCurrent; - gl_ctx->iface.exports.shareContext = __MESA_shareContext; - gl_ctx->iface.exports.copyContext = __MESA_copyContext; - gl_ctx->iface.exports.forceCurrent = __MESA_forceCurrent; - gl_ctx->iface.exports.notifyResize = __MESA_notifyResize; - gl_ctx->iface.exports.notifyDestroy = __MESA_notifyDestroy; - gl_ctx->iface.exports.notifySwapBuffers = __MESA_notifySwapBuffers; - gl_ctx->iface.exports.dispatchExec = __MESA_dispatchExec; - gl_ctx->iface.exports.beginDispatchOverride = __MESA_beginDispatchOverride; - gl_ctx->iface.exports.endDispatchOverride = __MESA_endDispatchOverride; - - if (shareGC) m_share = ((__GLcontext *)shareGC)->xm_ctx; - xm_vis = find_mesa_visual(glxc->pScreen->myNum, glxc->pGlxVisual->vid); - if (xm_vis) { - gl_ctx->xm_ctx = XMesaCreateContext(xm_vis, m_share); - } else { - __glXFree(gl_ctx); - gl_ctx = NULL; - } - - return (__GLinterface *)gl_ctx; -} - -GLboolean __MESA_destroyContext(__GLcontext *gc) -{ - XMesaDestroyContext(gc->xm_ctx); - __glXFree(gc); - return GL_TRUE; -} - -GLboolean __MESA_loseCurrent(__GLcontext *gc) -{ - MESA_CC = NULL; - __glXLastContext = NULL; - return XMesaLoseCurrent(gc->xm_ctx); -} - -GLboolean __MESA_makeCurrent(__GLcontext *gc, __GLdrawablePrivate *glPriv) -{ - __MESA_buffer buf = (__MESA_buffer)glPriv->private; - - MESA_CC = gc; - return XMesaMakeCurrent(gc->xm_ctx, buf->xm_buf); -} - -GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare) -{ - /* NOT_DONE */ - ErrorF("__MESA_shareContext\n"); - return GL_FALSE; -} - -GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask) -{ - /* NOT_DONE */ - ErrorF("__MESA_copyContext\n"); - return GL_FALSE; -} - -GLboolean __MESA_forceCurrent(__GLcontext *gc) -{ - MESA_CC = gc; - return XMesaForceCurrent(gc->xm_ctx); -} - -GLboolean __MESA_notifyResize(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_notifyResize\n"); - return GL_FALSE; -} - -void __MESA_notifyDestroy(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_notifyDestroy\n"); - return; -} - -void __MESA_notifySwapBuffers(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_notifySwapBuffers\n"); - return; -} - -struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_dispatchExec\n"); - return NULL; -} - -void __MESA_beginDispatchOverride(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_beginDispatchOverride\n"); - return; -} - -void __MESA_endDispatchOverride(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_endDispatchOverride\n"); - return; -} - -GLint __glEvalComputeK(GLenum target) -{ - switch (target) { - case GL_MAP1_VERTEX_4: - case GL_MAP1_COLOR_4: - case GL_MAP1_TEXTURE_COORD_4: - case GL_MAP2_VERTEX_4: - case GL_MAP2_COLOR_4: - case GL_MAP2_TEXTURE_COORD_4: - return 4; - case GL_MAP1_VERTEX_3: - case GL_MAP1_TEXTURE_COORD_3: - case GL_MAP1_NORMAL: - case GL_MAP2_VERTEX_3: - case GL_MAP2_TEXTURE_COORD_3: - case GL_MAP2_NORMAL: - return 3; - case GL_MAP1_TEXTURE_COORD_2: - case GL_MAP2_TEXTURE_COORD_2: - return 2; - case GL_MAP1_TEXTURE_COORD_1: - case GL_MAP2_TEXTURE_COORD_1: - case GL_MAP1_INDEX: - case GL_MAP2_INDEX: - return 1; - default: - return 0; - } -} - -GLuint __glFloorLog2(GLuint val) -{ - int c = 0; - - while (val > 1) { - c++; - val >>= 1; - } - return c; -} - Index: xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c:1.10 xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c:removed --- xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c:1.10 Sat May 19 14:29:18 2001 +++ xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c Sat Feb 28 21:41:18 2004 @@ -1,520 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c,v 1.10 2001/05/19 18:29:18 dawes Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#include -#include -#include "sis_dri.h" - -#include "sis_ctx.h" -#include "sis_mesa.h" - -#include -#include "context.h" -#include "macros.h" -#include "matrix.h" -#include "mmath.h" -#include "vbxform.h" -#include "types.h" - -#if 0 -void *sis_debug_malloc(x){ - static char buf[2000000]; - static int count = 0; - void *retval; - - retval = &(buf[count]); - count += x; - return retval; -} -#endif - -static XMesaContext XMesa = NULL; /* Current X/Mesa context pointer */ - -#ifndef SIS_VERBOSE -int SIS_VERBOSE = 0 -/* | VERBOSE_SIS_MEMORY */ -/* | VERBOSE_SIS_BUFFER */ -; -#endif - -static GLboolean IsDriverInit = GL_FALSE; -static sisRegion global_regs, global_agp; -static GLubyte *global_FbBase; - -GLboolean XMesaInitDriver (__DRIscreenPrivate * driScrnPriv) -{ - SISDRIPtr priv = (SISDRIPtr) driScrnPriv->pDevPriv; - - /* Check the DRI version */ - { - int major, minor, patch; - if (XF86DRIQueryVersion(driScrnPriv->display, &major, &minor, &patch)) { - if (major != 4 || minor < 0) { - char msg[1000]; - sprintf(msg, "sis DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch); - __driMesaMessage(msg); - return GL_FALSE; - } - } - } - - /* Check that the DDX driver version is compatible */ - if (driScrnPriv->ddxMajor != 0 || - driScrnPriv->ddxMinor != 1 || - driScrnPriv->ddxPatch < 0) { - char msg[1000]; - sprintf(msg, "sis DRI driver expected DDX driver version 0.1.x but got version %d.%d.%d", driScrnPriv->ddxMajor, driScrnPriv->ddxMinor, driScrnPriv->ddxPatch); - __driMesaMessage(msg); - return GL_FALSE; - } - - /* Check that the DRM driver version is compatible */ - if (driScrnPriv->drmMajor != 1 || - driScrnPriv->drmMinor != 0 || - driScrnPriv->drmPatch < 0) { - char msg[1000]; - sprintf(msg, "sis DRI driver expected DRM driver version 1.0.x but got version %d.%d.%d", driScrnPriv->drmMajor, driScrnPriv->drmMinor, driScrnPriv->drmPatch); - __driMesaMessage(msg); - return GL_FALSE; - } - - assert (driScrnPriv->devPrivSize == sizeof (SISDRIRec)); - - /* Fixme: in quake3, when context changed, XMesaInitDriver is called - * but XMesaResetDriver isn't. so i must check if regions are - * mapped two times. - * I can't use .map to know if they are mapped - */ - if(IsDriverInit){ - priv->regs = global_regs; - priv->agp = global_agp; - /* XXX */ - driScrnPriv->pFB = global_FbBase; - return GL_TRUE; - } - - if (drmMap (driScrnPriv->fd, priv->regs.handle, priv->regs.size, - &priv->regs.map)) - { - return GL_FALSE; - } - - if (priv->agp.size) - { - if (drmMap (driScrnPriv->fd, priv->agp.handle, priv->agp.size, - &priv->agp.map)) - { - priv->agp.size = 0; - } - } - - IsDriverInit = GL_TRUE; - global_regs = priv->regs; - global_agp = priv->agp; - global_FbBase = driScrnPriv->pFB; - - gDRMSubFD = driScrnPriv->fd; - - return GL_TRUE; -} - -void -XMesaResetDriver (__DRIscreenPrivate * driScrnPriv) -{ - SISDRIPtr priv = (SISDRIPtr) driScrnPriv->pDevPriv; - - drmUnmap (priv->regs.map, priv->regs.size); - priv->regs.map = 0; - - if (priv->agp.size) - { - drmUnmap (priv->agp.map, priv->agp.size); - priv->agp.map = 0; - } - - IsDriverInit = GL_FALSE; -} - -/* from tdfx */ -extern void __driRegisterExtensions(void); /* silence compiler warning */ - -/* This function is called by libGL.so as soon as libGL.so is loaded. - * This is where we'd register new extension functions with the dispatcher. - */ -void __driRegisterExtensions(void) -{ -#if 0 - /* Example. Also look in fxdd.c for more details. */ - { - const int _gloffset_FooBarEXT = 555; /* just an example number! */ - if (_glapi_add_entrypoint("glFooBarEXT", _gloffset_FooBarEXT)) { - void *f = glXGetProcAddressARB("glFooBarEXT"); - assert(f); - } - } -#endif -} - -GLvisual *XMesaCreateVisual(Display *dpy, - __DRIscreenPrivate *driScrnPriv, - const XVisualInfo *visinfo, - const __GLXvisualConfig *config) -{ - /* Drivers may change the args to _mesa_create_visual() in order to - * setup special visuals. - */ - return _mesa_create_visual( config->rgba, - config->doubleBuffer, - config->stereo, - _mesa_bitcount(visinfo->red_mask), - _mesa_bitcount(visinfo->green_mask), - _mesa_bitcount(visinfo->blue_mask), - config->alphaSize, - 0, /* index bits */ - config->depthSize, - config->stencilSize, - config->accumRedSize, - config->accumGreenSize, - config->accumBlueSize, - config->accumAlphaSize, - 0 /* num samples */ ); -} - -GLboolean XMesaCreateContext(Display *dpy, GLvisual *mesaVis, - __DRIcontextPrivate *driContextPriv) -{ - XMesaContext c; - - if (SIS_VERBOSE){ - fprintf(stderr, "XMesaCreateContext\n"); - } - - c = (XMesaContext) calloc (1, sizeof (struct xmesa_context)); - if (!c) - return GL_FALSE; - - c->xm_visual = (XMesaVisual) calloc (1, sizeof (struct xmesa_visual)); - if (!c->xm_visual) - return GL_FALSE; - c->xm_visual->gl_visual = mesaVis; - c->xm_visual->display = dpy; - - c->gl_ctx = driContextPriv->mesaContext; - - c->xm_buffer = NULL; - c->display = dpy; - - c->gl_ctx->Driver.UpdateState = sis_UpdateState; - - c->driContextPriv = driContextPriv; - - c->gl_ctx->DriverCtx = (void *)c; - - SiSCreateContext (c); - - /* Fixme */ - if (c->gl_ctx->NrPipelineStages) - c->gl_ctx->NrPipelineStages = - sis_RegisterPipelineStages( c->gl_ctx->PipelineStage, - c->gl_ctx->PipelineStage, - c->gl_ctx->NrPipelineStages); - - driContextPriv->driverPrivate = (void *) c; - - /* TODO, to make VB->Win.data[][2] ranges 0 - 1.0 */ - /* Fixme, software render, z span seems all 0 */ - mesaVis->DepthMax = 1; - mesaVis->DepthMaxF = 1.0f; - - return GL_TRUE; -} - -void XMesaDestroyContext(__DRIcontextPrivate *driContextPriv) -{ - XMesaContext c = (XMesaContext) driContextPriv->driverPrivate; - - SiSDestroyContext (c); - - if (c->xm_buffer) - c->xm_buffer->xm_context = NULL; - - if (XMesa == c) - XMesa = NULL; - - free(c->xm_visual); - free (c); -} - -GLframebuffer *XMesaCreateWindowBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - GLvisual *mesaVis) -{ - if (mesaVis->RGBAflag){ - return gl_create_framebuffer (mesaVis, GL_FALSE, GL_FALSE, - (mesaVis->AccumRedBits) ? GL_TRUE : GL_FALSE, - GL_FALSE); - } - else{ - return gl_create_framebuffer (mesaVis, - (mesaVis->DepthBits) ? GL_TRUE : GL_FALSE, - (mesaVis->StencilBits) ? GL_TRUE : GL_FALSE, - (mesaVis->AccumRedBits) ? GL_TRUE : GL_FALSE, - GL_FALSE); - } -} - -static XMesaBuffer SISCreateWindowBuffer ( Display *dpy, - __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - GLvisual *mesaVis, - XMesaContext xmesa) -{ - XMesaBuffer b = (XMesaBuffer) calloc (1, sizeof (struct xmesa_buffer)); - - if (SIS_VERBOSE&VERBOSE_SIS_BUFFER){ - fprintf(stderr, "SISCreateWindowBuffer: drawable ID=%lu\n", - (DWORD)driDrawPriv); - } - - if (!b) - return NULL; - - b->xm_context = NULL; - b->xm_visual = xmesa->xm_visual; - b->display = dpy; - b->pixmap_flag = GL_FALSE; - b->db_state = mesaVis->DBflag; - b->gl_buffer = driDrawPriv->mesaBuffer; - b->frontbuffer = driDrawPriv->draw; - - /* set 0 for buffer update */ - b->width = 0; - b->height = 0; - - if (b->backimage) - { -#if 0 - XMesaDestroyImage (b->backimage); -#else - free(b->backimage); -#endif - b->backimage = NULL; - } - -#if 0 - b->backimage = XCreateImage (b->display, - b->xm_visual->visinfo->visual, - GET_VISUAL_DEPTH (b->xm_visual), ZPixmap, 0, - NULL, b->width, b->height, 8, 0); -#else - b->backimage = (XMesaImage *) calloc (1, sizeof (XImage)); -#endif - - b->driDrawPriv = driDrawPriv; - - { - sisBufferInfo *buf_info; - - b->private = calloc (1, sizeof (sisBufferInfo)); - buf_info = (sisBufferInfo *)(b->private); - - buf_info->pZClearPacket = &buf_info->zClearPacket; - buf_info->pCbClearPacket = &buf_info->cbClearPacket; - } - - return b; -} - -GLframebuffer *XMesaCreatePixmapBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - GLvisual *mesaVis) -{ - /* not implement yet */ - return NULL; -} - -static void SISDestroyBuffer (XMesaBuffer b) -{ - if (SIS_VERBOSE&VERBOSE_SIS_BUFFER){ - fprintf(stderr, "SISDestroyBuffer: b=%lu\n", (DWORD)b); - } - - if (b->backimage && b->backimage->data) - { - sisBufferInfo *priv = (sisBufferInfo *) b->private; - - sis_free_back_image (b, b->backimage, priv->bbFree); -#if SIS_STEREO - { - XMesaContext xmesa = (XMesaContext) b->xm_context; - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - GLcontext *ctx = xmesa->gl_ctx; - - if(hwcx->stereoEnabled){ - sis_final_stereo(ctx); - hwcx->stereoEnabled = GL_FALSE; - } - } -#endif - } - - if (b->depthbuffer) - { - sis_free_z_stencil_buffer (b); - } - - assert (b->private); - free (b->private); - b->private = NULL; - - if (b->xm_context) - b->xm_context->xm_buffer = NULL; - -#if 0 - XMesaDestroyImage (b->backimage); -#else - free(b->backimage); -#endif - - /* TODO : if b doesn't exist, do something */ - - free (b); -} - -void XMesaSwapBuffers(__DRIdrawablePrivate *driDrawPriv) -{ - __GLSiScontext *hwcx; - - if(!XMesa) - return; - - FLUSH_VB( XMesa->gl_ctx, "swap buffers" ); - - hwcx = (__GLSiScontext *) XMesa->private; - (hwcx->SwapBuffers)(XMesa->xm_buffer); -} - -GLboolean XMesaUnbindContext(__DRIcontextPrivate *driContextPriv) -{ - /* TODO */ - return GL_TRUE; -} - -GLboolean -XMesaOpenFullScreen(__DRIcontextPrivate *driContextPriv) -{ - return GL_TRUE; -} - -GLboolean -XMesaCloseFullScreen(__DRIcontextPrivate *driContextPriv) -{ - return GL_TRUE; -} - -GLboolean XMesaMakeCurrent(__DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv) -{ - if (driContextPriv) - { - XMesaContext c = (XMesaContext) driContextPriv->driverPrivate; - XMesaBuffer b; - - /* TODO: ??? */ - if ((c->gl_ctx == gl_get_current_context ()) && - (driContextPriv->driDrawablePriv == driDrawPriv) && - c->xm_buffer->wasCurrent) - { - return GL_TRUE; - } - - if (SIS_VERBOSE&VERBOSE_SIS_BUFFER){ - fprintf(stderr, "XMesaMakeCurrent: c=%lu, b=%lu\n", (DWORD)c, (DWORD)b); - fprintf(stderr, "XMesaMakeCurrent: drawable ID=%lu\n", (DWORD)b->frontbuffer); - fprintf(stderr, "XMesaMakeCurrent: width=%d, height=%d\n", - b->width, b->height); - { - __DRIdrawablePrivate *dPriv = c->driContextPriv->driDrawablePriv; - fprintf(stderr, "XMesaMakeCurrent: width=%d, height=%d\n", - dPriv->w, dPriv->h); - } - } - - b = SISCreateWindowBuffer(c->display, - driContextPriv->driScreenPriv, - driDrawPriv, - c->gl_ctx->Visual, - c); - - if (c->xm_buffer){ - /* TODO: ??? */ - c->xm_buffer->xm_context = NULL; - SISDestroyBuffer(c->xm_buffer); - } - - b->xm_context = c; - c->xm_buffer = b; - - gl_make_current (c->gl_ctx, b->gl_buffer); - XMesa = c; - - if(b->width == 0){ - GLuint width, height; - - sis_GetBufferSize (c->gl_ctx, &width, &height); - } - - sis_update_drawable_state(c->gl_ctx); - - if (c->gl_ctx->Viewport.Width == 0) - { - /* initialize viewport to window size */ - gl_Viewport (c->gl_ctx, 0, 0, b->width, b->height); - c->gl_ctx->Scissor.Width = b->width; - c->gl_ctx->Scissor.Height = b->height; - } - - c->xm_buffer->wasCurrent = GL_TRUE; - } - else - { - gl_make_current (NULL, NULL); - XMesa = NULL; - } - - return GL_TRUE; -} Index: xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h diff -u xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h:1.5 xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h:removed --- xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h:1.5 Tue Sep 26 11:56:49 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h Sat Feb 28 21:41:18 2004 @@ -1,114 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.3 - * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. - * - * 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 - * BRIAN PAUL 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. - */ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_xmesaP.h,v 1.5 2000/09/26 15:56:49 tsi Exp $ */ - -#ifndef XMESAP_H -#define XMESAP_H - - -#ifdef XFree86Server -# include "GL/xf86glx.h" -# include "xf86glx_util.h" -#else -# ifdef GLX_DIRECT_RENDERING -# include "dri_mesa.h" -# endif -#endif - -#ifdef XFree86Server -# include "GL/xmesa.h" -#else -# include -# include -# include "GL/xmesa_x.h" -# include "GL/gl.h" -typedef struct xmesa_context *XMesaContext; -typedef struct xmesa_visual *XMesaVisual; -typedef struct xmesa_buffer *XMesaBuffer; -#endif - -#include "types.h" - -#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) -# include "xdriP.h" -#else -# define DRI_DRAWABLE_ARG -# define DRI_DRAWABLE_PARM -# define DRI_CTX_ARG -#endif - -struct xmesa_visual { - GLvisual *gl_visual; /* Device independent visual parameters */ - XMesaDisplay *display; /* The X11 display */ - XMesaVisualInfo visinfo; /* X's visual info */ -}; - -struct xmesa_context { - GLcontext *gl_ctx; /* the core library context */ - XMesaVisual xm_visual; /* Describes the buffers */ - XMesaBuffer xm_buffer; /* current draw framebuffer */ - XMesaBuffer xm_read_buffer; /* current read framebuffer */ - GLboolean use_read_buffer; /* read from the xm_read_buffer/ */ - - XMesaDisplay *display; /* == xm_visual->display */ - -#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) - __DRIcontextPrivate *driContextPriv; /* back pointer to DRI context - * used for locking - */ -#endif - void *private; /* device-specific private context */ -}; - -struct xmesa_buffer { - GLboolean wasCurrent; /* was ever the current buffer? */ - GLframebuffer *gl_buffer; /* depth, stencil, accum, etc buffers */ - XMesaVisual xm_visual; /* the X/Mesa visual */ - - XMesaContext xm_context; /* the context associated with this buffer */ - XMesaDisplay *display; - GLboolean pixmap_flag; /* is the buffer a Pixmap? */ - XMesaDrawable frontbuffer; /* either a window or pixmap */ - XMesaImage *backimage; /* back buffer simulated XImage */ - - GLvoid *depthbuffer; - - GLboolean db_state; /* GL_FALSE = single buffered */ - - GLuint width, height; /* size of buffer */ - - GLint bottom; /* used for FLIP macro below */ - -#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) - __DRIdrawablePrivate *driDrawPriv; /* back pointer to DRI drawable - * used for direct access to framebuffer - */ -#endif - - void *private; /* device-specific private drawable */ - - struct xmesa_buffer *Next; /* Linked list pointer: */ -}; - -#endif Index: xc/lib/GL/mesa/src/drv/sis/sis_xwin.c diff -u xc/lib/GL/mesa/src/drv/sis/sis_xwin.c:1.3 xc/lib/GL/mesa/src/drv/sis/sis_xwin.c:removed --- xc/lib/GL/mesa/src/drv/sis/sis_xwin.c:1.3 Tue Sep 26 11:56:49 2000 +++ xc/lib/GL/mesa/src/drv/sis/sis_xwin.c Sat Feb 28 21:41:18 2004 @@ -1,205 +0,0 @@ -/************************************************************************** - -Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. -All Rights Reserved. - -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_xwin.c,v 1.3 2000/09/26 15:56:49 tsi Exp $ */ - -/* - * Authors: - * Sung-Ching Lin - * - */ - -#include "sis_ctx.h" -#include "sis_mesa.h" - -#ifdef XFree86Server - -GLboolean -sis_get_clip_rects (XMesaContext xmesa, BoxPtr *ppExtents, int *pCount) -{ - XMesaDrawable d = xmesa->xm_buffer->frontbuffer; - - if (d->type == DRAWABLE_WINDOW) - { - RegionPtr pClipList = &((WindowPtr) d)->clipList; - RegDataPtr data = pClipList->data; - - if (data) - { - *ppExtents = - (BoxPtr) ((GLubyte *) (pClipList->data) + sizeof (RegDataRec)); - *pCount = data->numRects; - } - else - { - *ppExtents = &(pClipList->extents); - *pCount = 1; - } - } - else{ - /* Pixmap */ - /* - * TODO : sis_clear_color_buffer, sis_line_clip, sis_tri_clip don't - * consider this situation and result in page fault - */ - *ppExtents = NULL; - *pCount = 0; - return GL_FALSE; - } - - return GL_TRUE; -} - -void * -sis_get_drawable_pos (XMesaContext xmesa) -{ - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - XMesaDrawable d = xmesa->xm_buffer->frontbuffer; - - return GET_FbBase (hwcx) + - (d->x) * GET_DEPTH (hwcx) + (d->y) * GET_PITCH (hwcx); -} - -void -sis_get_drawable_origin (XMesaContext xmesa, GLuint * x, GLuint * y) -{ - XMesaDrawable d = xmesa->xm_buffer->frontbuffer; - - *x = d->x; - *y = d->y; -} - -void -sis_get_drawable_size (XMesaContext xmesa, GLuint * w, GLuint * h) -{ - XMesaDrawable d = xmesa->xm_buffer->frontbuffer; - - *w = d->width; - *h = d->height; -} - -void -sis_get_drawable_box (XMesaContext xmesa, BoxPtr pBox) -{ - XMesaDrawable d = xmesa->xm_buffer->frontbuffer; - - pBox->x1 = d->x; - pBox->y1 = d->y; - pBox->x2 = d->x + d->width; - pBox->y2 = d->y + d->height; -} - -#else - -GLboolean -sis_get_clip_rects (XMesaContext xmesa, BoxPtr * ppExtents, int *pCount) -{ - __DRIdrawablePrivate *dPriv = xmesa->driContextPriv->driDrawablePriv; - -/* - if (!sis_is_window (xmesa)) - { - return GL_FALSE; - } -*/ - -/* - XMESA_VALIDATE_DRAWABLE_INFO (xmesa->display, - xmesa->driContextPriv->driScreenPriv, - dPriv); -*/ - - *ppExtents = (BoxPtr) dPriv->pClipRects; - *pCount = dPriv->numClipRects; - - return GL_TRUE; -} - -void * -sis_get_drawable_pos (XMesaContext xmesa) -{ - __GLSiScontext *hwcx = (__GLSiScontext *) xmesa->private; - - __DRIdrawablePrivate *dPriv = xmesa->driContextPriv->driDrawablePriv; - -/* - XMESA_VALIDATE_DRAWABLE_INFO (xmesa->display, - xmesa->driContextPriv->driScreenPriv, - dPriv); -*/ - - return GET_FbBase (hwcx) + (dPriv->x) * GET_DEPTH (hwcx) + - (dPriv->y) * GET_PITCH (hwcx); -} - -void -sis_get_drawable_origin (XMesaContext xmesa, GLuint * x, GLuint * y) -{ - __DRIdrawablePrivate *dPriv = xmesa->driContextPriv->driDrawablePriv; - -/* - XMESA_VALIDATE_DRAWABLE_INFO (xmesa->display, - xmesa->driContextPriv->driScreenPriv, - dPriv); -*/ - - *x = dPriv->x; - *y = dPriv->y; -} - -void -sis_get_drawable_size (XMesaContext xmesa, GLuint * w, GLuint * h) -{ - __DRIdrawablePrivate *dPriv = xmesa->driContextPriv->driDrawablePriv; - -/* - XMESA_VALIDATE_DRAWABLE_INFO (xmesa->display, - xmesa->driContextPriv->driScreenPriv, - dPriv); -*/ - - *w = dPriv->w; - *h = dPriv->h; -} - -void -sis_get_drawable_box (XMesaContext xmesa, BoxPtr pBox) -{ - __DRIdrawablePrivate *dPriv = xmesa->driContextPriv->driDrawablePriv; - -/* - XMESA_VALIDATE_DRAWABLE_INFO (xmesa->display, - xmesa->driContextPriv->driScreenPriv, - dPriv); -*/ - - pBox->x1 = dPriv->x; - pBox->y1 = dPriv->y; - pBox->x2 = dPriv->x + dPriv->w; - pBox->y2 = dPriv->y + dPriv->h; -} - -#endif Index: xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc diff -u xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc:1.4 xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc:1.5 --- xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc:1.4 Fri Feb 22 16:45:03 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc Tue May 27 12:34:34 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc,v 1.4 2002/02/22 21:45:03 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc,v 1.5 2003/05/27 16:34:34 tsi Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=ByteOrder + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c:1.11 xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c:1.14 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c:1.11 Tue Jan 14 23:16:39 2003 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c Thu Jan 22 22:57:07 2004 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c,v 1.11 2003/01/15 04:16:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c,v 1.14 2004/01/23 03:57:07 dawes Exp $ */ /* * Original rewrite: @@ -55,16 +55,6 @@ #include "tnl/t_pipeline.h" -#if 0 -/* Example extension function */ -static void -fxFooBarEXT(GLint i) -{ - printf("You called glFooBarEXT(%d)\n", i); -} -#endif - - /* * Enable/Disable the extensions for this context. */ @@ -89,28 +79,14 @@ _mesa_enable_extension( ctx, "GL_EXT_texture_env_combine" ); } +#if 0 + _mesa_enable_extension( ctx, "GL_ARB_texture_cube_map"); + _mesa_enable_extension( ctx, "GL_NV_texture_rectangle"); +#endif + if (fxMesa->haveHwStencil) { _mesa_enable_extension( ctx, "GL_EXT_stencil_wrap" ); } - - /* Example of hooking in an extension function. - * For DRI-based drivers, also see __driRegisterExtensions in the - * tdfx_xmesa.c file. - */ -#if 0 - { - void **dispatchTable = (void **) ctx->Exec; - const int _gloffset_FooBarEXT = 555; /* just an example number! */ - const int tabSize = _glapi_get_dispatch_table_size(); - assert(_gloffset_FooBarEXT < tabSize); - dispatchTable[_gloffset_FooBarEXT] = (void *) tdfxFooBarEXT; - /* XXX You would also need to hook into the display list dispatch - * table. Really, the implementation of extensions might as well - * be in the core of Mesa since core Mesa and the device driver - * is one big shared lib. - */ - } -#endif } @@ -127,7 +103,7 @@ }; -GLboolean tdfxCreateContext( Display *dpy, const __GLcontextModes *mesaVis, +GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate ) { @@ -138,7 +114,6 @@ TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) ((char *) sPriv->pSAREA + sizeof(XF86DRISAREARec)); - /* Allocate tdfx context */ fxMesa = (tdfxContextPtr) CALLOC( sizeof(tdfxContextRec) ); if (!fxMesa) @@ -149,7 +124,8 @@ shareCtx = ((tdfxContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - fxMesa->glCtx = _mesa_create_context(mesaVis, shareCtx, fxMesa, GL_TRUE); + + fxMesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void *) fxMesa, GL_TRUE); if (!fxMesa->glCtx) { FREE(fxMesa); return GL_FALSE; @@ -227,10 +203,8 @@ ctx = fxMesa->glCtx; if ( TDFX_IS_NAPALM( fxMesa ) ) { ctx->Const.MaxTextureLevels = 12; - ctx->Const.NumCompressedTextureFormats = 1; } else { ctx->Const.MaxTextureLevels = 9; - ctx->Const.NumCompressedTextureFormats = 0; } ctx->Const.MaxTextureUnits = TDFX_IS_BANSHEE( fxMesa ) ? 1 : 2; @@ -372,7 +346,7 @@ FxI32 result[2]; if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, fxMesa ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)fxMesa ); } #if DEBUG_LOCKING @@ -487,7 +461,7 @@ tdfxContextPtr fxMesa = (tdfxContextPtr) driContextPriv->driverPrivate; if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, fxMesa ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)fxMesa ); } if ( fxMesa ) { @@ -529,7 +503,7 @@ tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, driContextPriv ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driContextPriv ); } if ( driContextPriv && (tdfxContextPtr) driContextPriv == fxMesa ) { @@ -547,7 +521,7 @@ __DRIdrawablePrivate *driReadPriv ) { if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, driContextPriv ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driContextPriv ); } if ( driContextPriv ) { Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h:1.5 xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h:1.6 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h:1.5 Sun Feb 24 16:51:10 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h Sun Sep 28 16:15:36 2003 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h,v 1.5 2002/02/24 21:51:10 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h,v 1.6 2003/09/28 20:15:36 alanh Exp $ */ /* * Original rewrite: @@ -56,7 +56,7 @@ #include "context.h" #include "macros.h" #include "matrix.h" -#include "mem.h" +#include "imports.h" #include "mtypes.h" #include "tdfx_screen.h" @@ -507,7 +507,7 @@ /* Used to track changes between Glide's state and Mesa's */ struct tdfx_texstate { - GLuint Enabled; /* bitmask of all units */ + GLuint Enabled[2]; /* values ala ctx->Texture.Unit[i]._ReallyEnabled */ GLenum EnvMode[TDFX_NUM_TMU]; /* index is Glide index, not OpenGL */ GLenum TexFormat[TDFX_NUM_TMU]; /* index is Glide index, not OpenGL */ }; @@ -885,7 +885,7 @@ GLuint vertexFormat; /* the current format */ GLuint vertex_stride_shift; void *layout[TDFX_NUM_LAYOUTS]; - char *verts; /* tdfxVertices, arbitarily packed */ + GLubyte *verts; /* tdfxVertices, arbitarily packed */ GLfloat hw_viewport[16]; @@ -947,8 +947,7 @@ extern GLboolean -tdfxCreateContext( Display *dpy, - const __GLcontextModes *mesaVis, +tdfxCreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate ); Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c:1.10 xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c:1.11 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c:1.10 Wed Oct 30 07:52:00 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c Sun Sep 28 16:15:36 2003 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c,v 1.10 2002/10/30 12:52:00 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c,v 1.11 2003/09/28 20:15:36 alanh Exp $ */ /* * Original rewrite: @@ -49,7 +49,7 @@ #endif -#define TDFX_DATE "20020221" +#define TDFX_DATE "20021125" /* These are used in calls to FX_grColorMaskv() */ Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c:1.5 xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c:1.6 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c:1.5 Mon Dec 16 11:19:00 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c Sun Sep 28 16:15:36 2003 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c,v 1.5 2002/12/16 16:19:00 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c,v 1.6 2003/09/28 20:15:36 alanh Exp $ */ /* * Original rewrite: @@ -54,7 +54,7 @@ drmGetLock( fxMesa->driFd, fxMesa->hHWContext, 0 ); /* This macro will update dPriv's cliprects if needed */ - DRI_VALIDATE_DRAWABLE_INFO( cPriv->display, sPriv, dPriv ); + DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); if ( saPriv->fifoOwner != fxMesa->hHWContext ) { fxMesa->Glide.grDRIImportFifo( saPriv->fifoPtr, saPriv->fifoRead ); Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c:1.4 xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c:1.5 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c:1.4 Fri Feb 22 16:45:03 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c Sun Sep 28 16:15:36 2003 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c,v 1.4 2002/02/22 21:45:03 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_pixels.c,v 1.5 2003/09/28 20:15:36 alanh Exp $ */ /* * Original rewrite: @@ -64,6 +64,7 @@ } while (0); +#if 0 static FxBool FX_grLfbLock(tdfxContextPtr fxMesa, GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode, GrOriginLocation_t origin, @@ -76,7 +77,7 @@ UNLOCK_HARDWARE(fxMesa); return result; } - +#endif #define FX_grLfbUnlock(fxMesa, t, b) \ @@ -511,7 +512,7 @@ GL_FRONT) ? (fxMesa->screen_width) : (info.strideInBytes / 2); const GLushort *src = (const GLushort *) info.lfbPtr + scrY * srcStride + scrX; - const GLubyte *dst = (GLubyte *) _mesa_image_address(packing, + GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage, width, height, format, type, 0, 0, 0); const GLint dstStride = _mesa_image_row_stride(packing, width, format, type); @@ -572,7 +573,7 @@ + scrY * srcStride + scrX; const GLint dstStride = _mesa_image_row_stride(packing, width, format, type); - const GLubyte *dst = (GLubyte *) _mesa_image_address(packing, + GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage, width, height, format, type, 0, 0, 0); const GLint widthInBytes = width * 4; @@ -616,7 +617,7 @@ !ctx->Color.ColorMask[2] || !ctx->Color.ColorMask[3] || ctx->Color.ColorLogicOpEnabled || - ctx->Texture._ReallyEnabled || + ctx->Texture._EnabledUnits || ctx->Depth.OcclusionTest || fxMesa->Fallback) { @@ -662,7 +663,7 @@ { const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT) ? (fxMesa->screen_width * 4) : (info.strideInBytes); - const GLubyte *dst = (const GLubyte *) info.lfbPtr + GLubyte *dst = (GLubyte *) info.lfbPtr + scrY * dstStride + scrX * 4; const GLint srcStride = _mesa_image_row_stride(unpack, width, format, type); Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c:1.4 xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c:1.5 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c:1.4 Fri Feb 22 16:45:03 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c Sun Sep 28 16:15:36 2003 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c,v 1.4 2002/02/22 21:45:03 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c,v 1.5 2003/09/28 20:15:36 alanh Exp $ */ /* * Original rewrite: @@ -67,7 +67,7 @@ mask &= ~(DD_ACCUM_BIT); if (mask & DD_STENCIL_BIT) { - if (!fxMesa->haveHwStencil || ctx->Stencil.WriteMask != 0xff) { + if (!fxMesa->haveHwStencil || ctx->Stencil.WriteMask[0] != 0xff) { /* Napalm seems to have trouble with stencil write masks != 0xff */ /* do stencil clear in software */ mask &= ~(DD_STENCIL_BIT); @@ -275,7 +275,7 @@ fxMesa->Color.ClearAlpha, fxMesa->Depth.Clear); FX_grColorMaskv_NoLock(ctx, true4); - if (ctx->Color.DrawDestMask & FRONT_LEFT_BIT) + if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT) fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER); if (!ctx->Depth.Test || !ctx->Depth.Mask) fxMesa->Glide.grDepthMask(FXFALSE); @@ -295,7 +295,7 @@ fxMesa->Glide.grDepthMask(FXTRUE); } FX_grColorMaskv_NoLock(ctx, true4); - if (ctx->Color.DrawDestMask & FRONT_LEFT_BIT) + if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT) fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER); } } @@ -532,7 +532,7 @@ GLcontext *ctx = fxMesa->glCtx; int unit; for (unit = 0; unit < TDFX_NUM_TMU; unit++) { - if (ctx->Texture.Unit[unit]._ReallyEnabled == TEXTURE0_2D) { + if (ctx->Texture.Unit[unit]._ReallyEnabled == TEXTURE_2D_BIT) { struct gl_texture_object *tObj = ctx->Texture.Unit[unit].Current2D; tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj); if (ti && ti->reloadImages && ti->whichTMU != TDFX_TMU_NONE) { Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c:1.3 xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c:1.5 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c:1.3 Fri Feb 22 16:45:03 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c Thu Jan 22 22:57:07 2004 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c,v 1.3 2002/02/22 21:45:03 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c,v 1.5 2004/01/23 03:57:07 dawes Exp $ */ /* * Original rewrite: @@ -34,8 +34,6 @@ * */ -#include - #include "tdfx_dri.h" #include "tdfx_context.h" #include "tdfx_lock.h" @@ -119,22 +117,16 @@ static GLboolean tdfxInitDriver( __DRIscreenPrivate *sPriv ) { - int major, minor, patch; - if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, sPriv ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)sPriv ); } - /* Check the DRI version */ - if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 4 || - minor < 0 ) { - __driUtilMessage( - "3dfx DRI driver expected DRI version 4.0.x " - "but got version %d.%d.%d", - major, minor, patch ); - return GL_FALSE; - } + /* Check the DRI externsion version */ + if ( sPriv->driMajor != 4 || sPriv->driMinor < 0 ) { + __driUtilMessage( "tdfx DRI driver expected DRI version 4.0.x " + "but got version %d.%d.%d", + sPriv->driMajor, sPriv->driMinor, sPriv->driPatch ); + return GL_FALSE; } /* Check that the DDX driver version is compatible */ @@ -167,8 +159,7 @@ static GLboolean -tdfxCreateBuffer( Display *dpy, - __DRIscreenPrivate *driScrnPriv, +tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) @@ -196,15 +187,15 @@ static void -tdfxSwapBuffers(Display *dpy, void *drawablePrivate) +tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv ) + { - __DRIdrawablePrivate *driDrawPriv = (__DRIdrawablePrivate*) drawablePrivate; GET_CURRENT_CONTEXT(ctx); tdfxContextPtr fxMesa = 0; GLframebuffer *mesaBuffer; if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) { - fprintf( stderr, "%s( %p )\n", __FUNCTION__, driDrawPriv ); + fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driDrawPriv ); } mesaBuffer = (GLframebuffer *) driDrawPriv->driverPrivate; @@ -221,7 +212,7 @@ if ( curDrawPriv == driDrawPriv ) { /* swapping window bound to current context, flush first */ - _mesa_swapbuffers( ctx ); + _mesa_notifySwapBuffers( ctx ); LOCK_HARDWARE( fxMesa ); } else { @@ -299,61 +290,30 @@ } - -/* This function is called by libGL.so as soon as libGL.so is loaded. - * This is where we'd register new extension functions with the dispatcher. - */ -void __driRegisterExtensions( void ) -{ -#if 0 - /* Example. Also look in tdfx_dd.c for more details. */ - { - const int _gloffset_FooBarEXT = 555; /* just an example number! */ - if ( _glapi_add_entrypoint( "glFooBarEXT", _gloffset_FooBarEXT ) ) { - void *f = glXGetProcAddressARB( "glFooBarEXT" ); - assert( f ); - } - } -#endif -} - static GLboolean -tdfxOpenFullScreen(__DRIcontextPrivate *driContextPriv) +tdfxOpenCloseFullScreen(__DRIcontextPrivate *driContextPriv) { -#if 0 /* When new glide3 calls exist */ - fprintf(stderr,"***** XMesaOpenFullScreen *****\n"); - return((GLboolean)grDRISetupFullScreen(GL_TRUE)); -#else return GL_TRUE; -#endif } -static GLboolean -tdfxCloseFullScreen(__DRIcontextPrivate *driContextPriv) -{ -#if 0 /* When new glide3 calls exist */ - fprintf(stderr,"***** XMesaCloseFullScreen *****\n"); - return((GLboolean)grDRISetupFullScreen(GL_FALSE)); -#else - return GL_TRUE; -#endif -} - - - -static struct __DriverAPIRec tdfxAPI = { - tdfxInitDriver, - tdfxDestroyScreen, - tdfxCreateContext, - tdfxDestroyContext, - tdfxCreateBuffer, - tdfxDestroyBuffer, - tdfxSwapBuffers, - tdfxMakeCurrent, - tdfxUnbindContext, - tdfxOpenFullScreen, - tdfxCloseFullScreen +static const struct __DriverAPIRec tdfxAPI = { + .InitDriver = tdfxInitDriver, + .DestroyScreen = tdfxDestroyScreen, + .CreateContext = tdfxCreateContext, + .DestroyContext = tdfxDestroyContext, + .CreateBuffer = tdfxCreateBuffer, + .DestroyBuffer = tdfxDestroyBuffer, + .SwapBuffers = tdfxSwapBuffers, + .MakeCurrent = tdfxMakeCurrent, + .UnbindContext = tdfxUnbindContext, + .OpenFullScreen = tdfxOpenCloseFullScreen, + .CloseFullScreen = tdfxOpenCloseFullScreen, + .GetSwapInfo = NULL, + .GetMSC = NULL, + .WaitForMSC = NULL, + .WaitForSBC = NULL, + .SwapBuffersMSC = NULL }; Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c:1.7 xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c:1.8 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c:1.7 Wed Oct 30 07:52:00 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c Sun Sep 28 16:15:37 2003 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c,v 1.7 2002/10/30 12:52:00 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c,v 1.8 2003/09/28 20:15:37 alanh Exp $ */ /* * Original rewrite: @@ -1307,21 +1307,19 @@ } /* Set the buffer used for reading */ -static void tdfxDDSetReadBuffer( GLcontext *ctx, - GLframebuffer *buffer, GLenum mode ) +static void tdfxDDSetBuffer( GLcontext *ctx, + GLframebuffer *buffer, GLuint bufferBit ) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); (void) buffer; - switch ( mode ) { - case GL_FRONT_LEFT: - fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER; + switch ( bufferBit ) { + case FRONT_LEFT_BIT: + fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER; break; - - case GL_BACK_LEFT: - fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER; + case BACK_LEFT_BIT: + fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER; break; - default: break; } @@ -1336,7 +1334,7 @@ tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); - swdd->SetReadBuffer = tdfxDDSetReadBuffer; + swdd->SetBuffer = tdfxDDSetBuffer; if ( VISUAL_EQUALS_RGBA(ctx->Visual, 5, 6, 5, 0) ) { Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c:1.7 xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c:1.8 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c:1.7 Wed Oct 30 07:52:00 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c Sun Sep 28 16:15:37 2003 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c,v 1.7 2002/10/30 12:52:00 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c,v 1.8 2003/09/28 20:15:37 alanh Exp $ */ /* * Original rewrite: @@ -37,6 +37,7 @@ */ #include "mtypes.h" +#include "colormac.h" #include "texformat.h" #include "texstore.h" @@ -66,7 +67,7 @@ tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GrCmpFnc_t func; GrAlphaBlendFnc_t srcRGB, dstRGB, srcA, dstA; - GrAlpha_t ref = ctx->Color.AlphaRef; + GrAlpha_t ref = (GLint) (ctx->Color.AlphaRef * 255.0); if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) { fprintf( stderr, "%s()\n", __FUNCTION__ ); @@ -257,7 +258,7 @@ } } -static void tdfxDDAlphaFunc( GLcontext *ctx, GLenum func, GLchan ref ) +static void tdfxDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) { tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx ); @@ -468,13 +469,13 @@ if (fxMesa->haveHwStencil) { if (ctx->Stencil.Enabled) { - fxMesa->Stencil.Function = ctx->Stencil.Function - GL_NEVER; - fxMesa->Stencil.RefValue = ctx->Stencil.Ref; - fxMesa->Stencil.ValueMask = ctx->Stencil.ValueMask; - fxMesa->Stencil.WriteMask = ctx->Stencil.WriteMask; - fxMesa->Stencil.FailFunc = convertGLStencilOp(ctx->Stencil.FailFunc); - fxMesa->Stencil.ZFailFunc =convertGLStencilOp(ctx->Stencil.ZFailFunc); - fxMesa->Stencil.ZPassFunc =convertGLStencilOp(ctx->Stencil.ZPassFunc); + fxMesa->Stencil.Function = ctx->Stencil.Function[0] - GL_NEVER; + fxMesa->Stencil.RefValue = ctx->Stencil.Ref[0]; + fxMesa->Stencil.ValueMask = ctx->Stencil.ValueMask[0]; + fxMesa->Stencil.WriteMask = ctx->Stencil.WriteMask[0]; + fxMesa->Stencil.FailFunc = convertGLStencilOp(ctx->Stencil.FailFunc[0]); + fxMesa->Stencil.ZFailFunc = convertGLStencilOp(ctx->Stencil.ZFailFunc[0]); + fxMesa->Stencil.ZPassFunc = convertGLStencilOp(ctx->Stencil.ZPassFunc[0]); fxMesa->Stencil.Clear = ctx->Stencil.Clear & 0xff; } fxMesa->dirty |= TDFX_UPLOAD_STENCIL; @@ -796,12 +797,17 @@ static void tdfxDDClearColor( GLcontext *ctx, - const GLchan color[4] ) + const GLfloat color[4] ) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); + GLubyte c[4]; FLUSH_BATCH( fxMesa ); - fxMesa->Color.ClearColor = TDFXPACKCOLOR888( color[0], color[1], color[2] ); - fxMesa->Color.ClearAlpha = color[3]; + CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); + fxMesa->Color.ClearColor = TDFXPACKCOLOR888( c[0], c[1], c[2] ); + fxMesa->Color.ClearAlpha = c[3]; } @@ -871,7 +877,7 @@ m[MAT_SZ] = v[MAT_SZ]; m[MAT_TZ] = v[MAT_TZ]; - fxMesa->SetupNewInputs |= VERT_CLIP; + fxMesa->SetupNewInputs |= VERT_BIT_CLIP; } @@ -996,7 +1002,7 @@ /* Set the buffer used for drawing */ /* XXX support for separate read/draw buffers hasn't been tested */ -static void tdfxDDSetDrawBuffer( GLcontext *ctx, GLenum mode ) +static void tdfxDDDrawBuffer( GLcontext *ctx, GLenum mode ) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); @@ -1006,31 +1012,41 @@ FLUSH_BATCH( fxMesa ); - switch( mode) { - case GL_FRONT_LEFT: + /* + * _DrawDestMask is easier to cope with than . + */ + switch ( ctx->Color._DrawDestMask ) { + case FRONT_LEFT_BIT: fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER; fxMesa->new_state |= TDFX_NEW_RENDER; FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; - - case GL_BACK_LEFT: + case BACK_LEFT_BIT: fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER; fxMesa->new_state |= TDFX_NEW_RENDER; FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; - - case GL_NONE: + case 0: FX_grColorMaskv( ctx, false4 ); FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; - default: FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_TRUE ); break; } + + /* We want to update the s/w rast state too so that tdfxDDSetBuffer() + * gets called. + */ + _swrast_DrawBuffer(ctx, mode); } +static void tdfxDDReadBuffer( GLcontext *ctx, GLenum mode ) +{ + /* XXX ??? */ +} + /* ============================================================= * Polygon stipple @@ -1282,7 +1298,7 @@ fxMesa->TexState.EnvMode[i] = ~0; fxMesa->TexState.TexFormat[i] = ~0; - fxMesa->TexState.Enabled = 0; + fxMesa->TexState.Enabled[i] = 0; } if ( ctx->Visual.doubleBufferMode) { @@ -1373,7 +1389,8 @@ */ ctx->Driver.ClearIndex = NULL; ctx->Driver.ClearColor = tdfxDDClearColor; - ctx->Driver.SetDrawBuffer = tdfxDDSetDrawBuffer; + ctx->Driver.DrawBuffer = tdfxDDDrawBuffer; + ctx->Driver.ReadBuffer = tdfxDDReadBuffer; ctx->Driver.IndexMask = NULL; ctx->Driver.ColorMask = tdfxDDColorMask; Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c:1.5 xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c:1.7 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c:1.5 Fri Feb 22 16:45:04 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c Thu Jan 22 22:57:07 2004 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c,v 1.5 2002/02/22 21:45:04 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c,v 1.7 2004/01/23 03:57:07 dawes Exp $ */ /* * Original rewrite: @@ -504,7 +504,7 @@ #if 0 discardedCount++; if (discardedCount > MAX_DISCARDS + 1) { - _mesa_problem(NULL, "tdfx driver: extreme texmem fragmentation"); + _mesa_problem(NULL, "%s: extreme texmem fragmentation", __FUNCTION__); _glthread_UNLOCK_MUTEX(mesaShared->Mutex); return BAD_ADDRESS; } @@ -521,7 +521,7 @@ fxMesa->stats.texSwaps++; } else { - _mesa_problem(NULL, "tdfx driver: extreme texmem fragmentation"); + _mesa_problem(NULL, "%s: extreme texmem fragmentation", __FUNCTION__); _glthread_UNLOCK_MUTEX(mesaShared->Mutex); return BAD_ADDRESS; } @@ -621,10 +621,8 @@ FxU32 startAddr; startAddr = FindStartAddr(fxMesa, tmu, texmemsize); if (startAddr == BAD_ADDRESS) { - char err[100]; - sprintf(err, "AllocTexMem returned NULL! tmu=%d texmemsize=%d\n", - (int) tmu, (int) texmemsize); - _mesa_problem(fxMesa->glCtx, err); + _mesa_problem(fxMesa->glCtx, "%s returned NULL! tmu=%d texmemsize=%d", + __FUNCTION__, (int) tmu, (int) texmemsize); return NULL; } else { @@ -721,7 +719,7 @@ } break; default: - _mesa_problem(NULL, "error in tdfxTMDownloadTexture: bad tmu"); + _mesa_problem(NULL, "%s: bad tmu (%d)", __FUNCTION__, (int)targetTMU); return; } } @@ -794,7 +792,7 @@ break; default: - _mesa_problem(ctx, "error in tdfxTMReloadMipMapLevel(): wrong tmu"); + _mesa_problem(ctx, "%s: bad tmu (%d)", __FUNCTION__, (int)tmu); break; } UNLOCK_HARDWARE(fxMesa); @@ -859,7 +857,7 @@ ti->tm[TDFX_TMU1] = AllocTexMem(fxMesa, TDFX_TMU1, texmemsize); break; default: - _mesa_problem(NULL, "error in tdfxTMMoveInTM() -> bad tmu (%d)"); + _mesa_problem(NULL, "%s: bad tmu (%d)", __FUNCTION__, (int)targetTMU); return; } @@ -882,7 +880,7 @@ tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj); if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxTMMoveOutTM(%p (%d))\n", tObj, tObj->Name); + fprintf(stderr, "fxmesa: %s(%p (%d))\n", __FUNCTION__, (void *)tObj, tObj->Name); } /* @@ -905,7 +903,7 @@ RemoveRange_NoLock(fxMesa, TDFX_TMU1, ti->tm[TDFX_TMU1]); break; default: - _mesa_problem(NULL, "tdfx driver: bad tmu in tdfxTMMOveOutTM()"); + _mesa_problem(NULL, "%s: bad tmu (%d)", __FUNCTION__, (int)ti->whichTMU); return; } Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c:1.2 xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c:1.4 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c:1.2 Fri Feb 22 16:45:04 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c Mon Dec 22 12:48:03 2003 @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c,v 1.2 2002/02/22 21:45:04 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texstate.c,v 1.4 2003/12/22 17:48:03 tsi Exp $ */ /* * Original rewrite: @@ -799,7 +799,7 @@ break; default: - _mesa_problem(ctx, "Bad envMode in SetupTexEnvNapalm"); + _mesa_problem(ctx, "%s: Bad envMode", __FUNCTION__); } fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_ENV; @@ -1009,7 +1009,7 @@ break; default: - _mesa_problem(NULL, "bad texture env mode in SetupSingleTexEnvVoodoo3"); + _mesa_problem(ctx, "bad texture env mode in %s", __FUNCTION__); } if (colorComb.Function != fxMesa->ColorCombine.Function || @@ -1251,7 +1251,7 @@ fxMesa->AlphaCombine.Invert = FXFALSE; } else { - /*_mesa_problem(ctx, "Unexpected dual texture mode encountered\n");*/ + /*_mesa_problem(ctx, "%s: Unexpected dual texture mode encountered", __FUNCTION__);*/ return GL_FALSE; } @@ -1478,6 +1478,7 @@ fxMesa->dirty |= TDFX_UPLOAD_TEXTURE_ENV; } +#ifdef UNUSED static void print_state(tdfxContextPtr fxMesa) { GLcontext *ctx = fxMesa->glCtx; @@ -1487,19 +1488,19 @@ GLenum base1 = tObj1->Image[tObj1->BaseLevel] ? tObj1->Image[tObj1->BaseLevel]->Format : 99; printf("Unit 0: Enabled: GL=%d Gr=%d\n", ctx->Texture.Unit[0]._ReallyEnabled, - fxMesa->TexState.Enabled); + fxMesa->TexState.Enabled[0]); printf(" EnvMode: GL=0x%x Gr=0x%x\n", ctx->Texture.Unit[0].EnvMode, fxMesa->TexState.EnvMode[0]); printf(" BaseFmt: GL=0x%x Gr=0x%x\n", base0, fxMesa->TexState.TexFormat[0]); printf("Unit 1: Enabled: GL=%d Gr=%d\n", ctx->Texture.Unit[1]._ReallyEnabled, - fxMesa->TexState.Enabled); + fxMesa->TexState.Enabled[1]); printf(" EnvMode: GL=0x%x Gr:0x%x\n", ctx->Texture.Unit[1].EnvMode, fxMesa->TexState.EnvMode[1]); printf(" BaseFmt: GL=0x%x Gr:0x%x\n", base1, fxMesa->TexState.TexFormat[1]); } - +#endif /* * When we're only using a single texture unit, we always use the 0th @@ -1543,7 +1544,7 @@ if (TDFX_IS_NAPALM(fxMesa)) { /* see if we really need to update the unit */ - if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled || + if (fxMesa->TexState.Enabled[unit] != ctx->Texture.Unit[unit]._ReallyEnabled || envMode != fxMesa->TexState.EnvMode[0] || envMode == GL_COMBINE_EXT || baseFormat != fxMesa->TexState.TexFormat[0]) { @@ -1577,7 +1578,7 @@ otherEnv->Alpha.Shift = 0; otherEnv->Alpha.Invert = FXFALSE; - fxMesa->TexState.Enabled = ctx->Texture._ReallyEnabled; + fxMesa->TexState.Enabled[unit] = ctx->Texture.Unit[unit]._ReallyEnabled; fxMesa->TexState.EnvMode[0] = envMode; fxMesa->TexState.TexFormat[0] = baseFormat; fxMesa->TexState.EnvMode[1] = 0; @@ -1588,7 +1589,7 @@ /* Voodoo3 */ /* see if we really need to update the unit */ - if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled || + if (fxMesa->TexState.Enabled[unit] != ctx->Texture.Unit[unit]._ReallyEnabled || envMode != fxMesa->TexState.EnvMode[0] || envMode == GL_COMBINE_EXT || baseFormat != fxMesa->TexState.TexFormat[0]) { @@ -1596,7 +1597,7 @@ /* software fallback */ FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE); } - fxMesa->TexState.Enabled = ctx->Texture._ReallyEnabled; + fxMesa->TexState.Enabled[unit] = ctx->Texture.Unit[unit]._ReallyEnabled; fxMesa->TexState.EnvMode[0] = envMode; fxMesa->TexState.TexFormat[0] = baseFormat; fxMesa->TexState.EnvMode[1] = 0; @@ -1850,7 +1851,7 @@ GLboolean hw1 = GL_TRUE, hw2 = GL_TRUE; /* check if we really need to update glide unit 1 */ - if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled || + if (fxMesa->TexState.Enabled[0] != ctx->Texture.Unit[0]._ReallyEnabled || envMode0 != fxMesa->TexState.EnvMode[1] || envMode0 == GL_COMBINE_EXT || baseImage0->Format != fxMesa->TexState.TexFormat[1] || @@ -1859,10 +1860,11 @@ baseImage0->Format, &fxMesa->TexCombineExt[1]); fxMesa->TexState.EnvMode[1] = envMode0; fxMesa->TexState.TexFormat[1] = baseImage0->Format; + fxMesa->TexState.Enabled[0] = ctx->Texture.Unit[0]._ReallyEnabled; } /* check if we really need to update glide unit 0 */ - if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled || + if (fxMesa->TexState.Enabled[1] != ctx->Texture.Unit[1]._ReallyEnabled || envMode1 != fxMesa->TexState.EnvMode[0] || envMode1 == GL_COMBINE_EXT || baseImage1->Format != fxMesa->TexState.TexFormat[0] || @@ -1871,9 +1873,9 @@ baseImage1->Format, &fxMesa->TexCombineExt[0]); fxMesa->TexState.EnvMode[0] = envMode1; fxMesa->TexState.TexFormat[0] = baseImage1->Format; + fxMesa->TexState.Enabled[1] = ctx->Texture.Unit[1]._ReallyEnabled; } - fxMesa->TexState.Enabled = ctx->Texture._ReallyEnabled; if (!hw1 || !hw2) { FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE); @@ -1887,7 +1889,8 @@ unit0 = 0; unit1 = 1 - unit0; - if (fxMesa->TexState.Enabled != ctx->Texture._ReallyEnabled || + if (fxMesa->TexState.Enabled[0] != ctx->Texture.Unit[0]._ReallyEnabled || + fxMesa->TexState.Enabled[1] != ctx->Texture.Unit[1]._ReallyEnabled || envMode0 != fxMesa->TexState.EnvMode[unit0] || envMode0 == GL_COMBINE_EXT || envMode1 != fxMesa->TexState.EnvMode[unit1] || @@ -1906,7 +1909,8 @@ fxMesa->TexState.TexFormat[unit0] = baseImage0->Format; fxMesa->TexState.EnvMode[unit1] = envMode1; fxMesa->TexState.TexFormat[unit1] = baseImage1->Format; - fxMesa->TexState.Enabled = ctx->Texture._ReallyEnabled; + fxMesa->TexState.Enabled[0] = ctx->Texture.Unit[0]._ReallyEnabled; + fxMesa->TexState.Enabled[1] = ctx->Texture.Unit[1]._ReallyEnabled; } } } @@ -1916,31 +1920,29 @@ tdfxUpdateTextureState( GLcontext *ctx ) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); - GLuint tex2Denabled = ctx->Texture._ReallyEnabled; - - if (!fxMesa->haveTwoTMUs) - tex2Denabled &= TEXTURE0_2D; FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_BORDER, GL_FALSE); FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_FALSE); - switch (tex2Denabled) { - case TEXTURE0_2D: + if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT && + ctx->Texture.Unit[1]._ReallyEnabled == 0) { LOCK_HARDWARE( fxMesa ); /* XXX remove locking eventually */ setupTextureSingleTMU(ctx, 0); UNLOCK_HARDWARE( fxMesa ); - break; - case TEXTURE1_2D: + } + else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 && + ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT) { LOCK_HARDWARE( fxMesa ); setupTextureSingleTMU(ctx, 1); UNLOCK_HARDWARE( fxMesa ); - break; - case (TEXTURE0_2D | TEXTURE1_2D): + } + else if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT && + ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT) { LOCK_HARDWARE( fxMesa ); setupTextureDoubleTMU(ctx); UNLOCK_HARDWARE( fxMesa ); - break; - default: + } + else { /* disable hardware texturing */ if (TDFX_IS_NAPALM(fxMesa)) { fxMesa->ColorCombineExt.SourceA = GR_CMBX_ITRGB; @@ -1978,12 +1980,19 @@ fxMesa->AlphaCombine.Invert = FXFALSE; } - fxMesa->TexState.Enabled = 0; + fxMesa->TexState.Enabled[0] = 0; + fxMesa->TexState.Enabled[1] = 0; fxMesa->TexState.EnvMode[0] = 0; fxMesa->TexState.EnvMode[1] = 0; fxMesa->dirty |= TDFX_UPLOAD_COLOR_COMBINE; fxMesa->dirty |= TDFX_UPLOAD_ALPHA_COMBINE; + + if (ctx->Texture.Unit[0]._ReallyEnabled != 0 || + ctx->Texture.Unit[1]._ReallyEnabled != 0) { + /* software texture (cube map, rect tex, etc */ + FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE); + } } } @@ -2027,7 +2036,9 @@ fxMesa->tScale1 = ti1->tScale; } - if (ctx->Texture._ReallyEnabled == TEXTURE0_2D) { + if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT && + ctx->Texture.Unit[0]._ReallyEnabled == 0) { + /* Only unit 0 2D enabled */ if (shared->umaTexMemory) { fxMesa->TexSource[0].StartAddress = ti0->tm[0]->startAddr; fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH; @@ -2058,14 +2069,18 @@ } } } - else if (ctx->Texture._ReallyEnabled == TEXTURE1_2D) { + else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 && + ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT) { + /* Only unit 1 2D enabled */ if (shared->umaTexMemory) { fxMesa->TexSource[0].StartAddress = ti1->tm[0]->startAddr; fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH; fxMesa->TexSource[0].Info = &(ti1->info); } } - else if (ctx->Texture._ReallyEnabled == (TEXTURE0_2D | TEXTURE1_2D)) { + else if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT && + ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT) { + /* Both 2D enabled */ if (shared->umaTexMemory) { const FxU32 tmu0 = 0, tmu1 = 1; fxMesa->TexSource[tmu0].StartAddress = ti0->tm[0]->startAddr; Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c:1.4 xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c:1.6 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c:1.4 Wed Oct 30 07:52:01 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c Thu Jan 22 22:57:07 2004 @@ -23,15 +23,12 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c,v 1.4 2002/10/30 12:52:01 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tris.c,v 1.6 2004/01/23 03:57:07 dawes Exp $ */ /* Authors: * Keith Whitwell */ -#include -#include - #include "glheader.h" #include "mtypes.h" #include "macros.h" @@ -219,7 +216,7 @@ { tdfxContextPtr imesa = TDFX_CONTEXT( ctx ); - fprintf(stderr, "vertex at %p\n", v); + fprintf(stderr, "vertex at %p\n", (void *)v); if (imesa->vertexFormat == TDFX_LAYOUT_TINY) { fprintf(stderr, "x %f y %f z %f\n", v->v.x, v->v.y, v->v.z); @@ -565,9 +562,9 @@ { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GLuint shift = fxMesa->vertex_stride_shift; - char *fxVB = fxMesa->verts + (start << shift); + GLubyte *fxVB = fxMesa->verts + (start << shift); int stride = 1<vertex_stride_shift; - char *fxVB = fxMesa->verts + (start << shift); + GLubyte *fxVB = fxMesa->verts + (start << shift); int stride = 1<vertex_stride_shift; - char *fxVB = fxMesa->verts + (start << shift); + GLubyte *fxVB = fxMesa->verts + (start << shift); int stride = 1<vertex_stride_shift; - char *fxVB = fxMesa->verts + (start << shift); + GLubyte *fxVB = fxMesa->verts + (start << shift); int stride = 1<vertex_stride_shift; - char *fxVB = fxMesa->verts + (start << shift); + GLubyte *fxVB = fxMesa->verts + (start << shift); (void) flags; fxMesa->Glide.grDrawVertexArrayContiguous( GR_TRIANGLES, count-start, @@ -705,7 +702,7 @@ { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GLuint shift = fxMesa->vertex_stride_shift; - char *fxVB = fxMesa->verts + (start << shift); + GLubyte *fxVB = fxMesa->verts + (start << shift); int mode; (void) flags; @@ -729,7 +726,7 @@ { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GLuint shift = fxMesa->vertex_stride_shift; - char *fxVB = fxMesa->verts + (start << shift); + GLubyte *fxVB = fxMesa->verts + (start << shift); (void) flags; fxMesa->Glide.grDrawVertexArrayContiguous( GR_TRIANGLE_FAN, count-start, @@ -743,7 +740,7 @@ { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GLuint shift = fxMesa->vertex_stride_shift; - char *fxVB = fxMesa->verts; + GLubyte *fxVB = fxMesa->verts; GLuint i; (void) flags; @@ -762,7 +759,7 @@ { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GLuint shift = fxMesa->vertex_stride_shift; - char *fxVB = fxMesa->verts + (start << shift); + GLubyte *fxVB = fxMesa->verts + (start << shift); (void) flags; count -= (count-start)&1; @@ -778,7 +775,7 @@ { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GLuint shift = fxMesa->vertex_stride_shift; - char *fxVB = fxMesa->verts + (start << shift); + GLubyte *fxVB = fxMesa->verts + (start << shift); (void) flags; fxMesa->Glide.grDrawVertexArrayContiguous( GR_POLYGON, count-start, Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c:1.3 xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c:1.4 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c:1.3 Wed Oct 30 07:52:01 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c Sun Sep 28 16:15:38 2003 @@ -22,14 +22,13 @@ * * */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c,v 1.3 2002/10/30 12:52:01 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_vb.c,v 1.4 2003/09/28 20:15:38 alanh Exp $ */ #include "glheader.h" #include "mtypes.h" -#include "mem.h" +#include "imports.h" #include "macros.h" #include "colormac.h" -#include "mmath.h" #include "math/m_translate.h" #include "swrast_setup/swrast_setup.h" @@ -262,7 +261,7 @@ GLuint newinputs ) { tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx ); - char *v = (fxMesa->verts + (start<vertex_stride_shift)); + GLubyte *v = (fxMesa->verts + (start<vertex_stride_shift)); GLuint stride = 1<vertex_stride_shift; newinputs |= fxMesa->SetupNewInputs; @@ -271,18 +270,18 @@ if (!newinputs) return; - if (newinputs & VERT_CLIP) { + if (newinputs & VERT_BIT_CLIP) { setup_tab[fxMesa->SetupIndex].emit( ctx, start, count, v, stride ); } else { GLuint ind = 0; - if (newinputs & VERT_RGBA) + if (newinputs & VERT_BIT_COLOR0) ind |= TDFX_RGBA_BIT; - if (newinputs & VERT_TEX0) + if (newinputs & VERT_BIT_TEX0) ind |= TDFX_TEX0_BIT; - if (newinputs & VERT_TEX1) + if (newinputs & VERT_BIT_TEX1) ind |= TDFX_TEX0_BIT|TDFX_TEX1_BIT; if (fxMesa->SetupIndex & TDFX_PTEX_BIT) @@ -303,9 +302,11 @@ tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx ); GLuint ind = TDFX_XYZ_BIT|TDFX_RGBA_BIT; - if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY) + if (ctx->Texture._EnabledUnits & 0x2) + /* unit 1 enabled */ ind |= TDFX_W_BIT|TDFX_TEX1_BIT|TDFX_TEX0_BIT; - else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) + else if (ctx->Texture._EnabledUnits & 0x1) + /* unit 0 enabled */ ind |= TDFX_W_BIT|TDFX_TEX0_BIT; else if (ctx->Fog.Enabled) ind |= TDFX_W_BIT; @@ -340,7 +341,7 @@ firsttime = 0; } - fxMesa->verts = (char *)ALIGN_MALLOC(size * sizeof(tdfxVertex), 32); + fxMesa->verts = (GLubyte *)ALIGN_MALLOC(size * sizeof(tdfxVertex), 32); fxMesa->vertexFormat = setup_tab[TDFX_XYZ_BIT|TDFX_RGBA_BIT].vertex_format; fxMesa->vertex_stride_shift = setup_tab[(TDFX_XYZ_BIT| TDFX_RGBA_BIT)].vertex_stride_shift; Index: xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h diff -u xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h:1.1 xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h:1.2 --- xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h:1.1 Fri Feb 22 16:45:04 2002 +++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_vbtmp.h Sun Sep 28 16:15:38 2003 @@ -12,8 +12,8 @@ GLubyte (*col)[4]; GLuint tc0_stride, tc1_stride, col_stride; GLuint tc0_size, tc1_size; - GLfloat (*proj)[4] = VB->ProjectedClipPtr->data; - GLuint proj_stride = VB->ProjectedClipPtr->stride; + GLfloat (*proj)[4] = VB->NdcPtr->data; + GLuint proj_stride = VB->NdcPtr->stride; tdfxVertex *v = (tdfxVertex *)dest; GLfloat u0scale,v0scale,u1scale,v1scale; const GLubyte *mask = VB->ClipMask; @@ -185,8 +185,8 @@ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; GLubyte (*col)[4]; GLuint col_stride; - GLfloat (*proj)[4] = VB->ProjectedClipPtr->data; - GLuint proj_stride = VB->ProjectedClipPtr->stride; + GLfloat (*proj)[4] = VB->NdcPtr->data; + GLuint proj_stride = VB->NdcPtr->stride; GLfloat *v = (GLfloat *)dest; const GLubyte *mask = VB->ClipMask; const GLfloat *s = fxMesa->hw_viewport; Index: xc/lib/GL/mesa/src/math/Imakefile.inc diff -u xc/lib/GL/mesa/src/math/Imakefile.inc:1.2 xc/lib/GL/mesa/src/math/Imakefile.inc:1.3 --- xc/lib/GL/mesa/src/math/Imakefile.inc:1.2 Thu Nov 14 16:01:17 2002 +++ xc/lib/GL/mesa/src/math/Imakefile.inc Sun Sep 28 16:15:39 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/math/Imakefile.inc,v 1.2 2002/11/14 21:01:17 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/math/Imakefile.inc,v 1.3 2003/09/28 20:15:39 alanh Exp $ #ifndef MesaMathBuildDir #define MesaMathBuildDir $(GLXLIBSRC)/mesa/src/math/ @@ -9,48 +9,40 @@ MESA_MATH_SRCS = $(MESAMATHBUILDDIR)m_debug_clip.c \ $(MESAMATHBUILDDIR)m_debug_norm.c \ $(MESAMATHBUILDDIR)m_debug_xform.c \ - $(MESAMATHBUILDDIR)m_debug_vertex.c \ $(MESAMATHBUILDDIR)m_eval.c \ $(MESAMATHBUILDDIR)m_matrix.c \ $(MESAMATHBUILDDIR)m_translate.c \ $(MESAMATHBUILDDIR)m_vector.c \ - $(MESAMATHBUILDDIR)m_vertices.c \ $(MESAMATHBUILDDIR)m_xform.c #ifdef NeedToLinkMesaSrc LinkSourceFile(m_debug_clip.c, $(MESASRCDIR)/src/math) LinkSourceFile(m_debug_norm.c, $(MESASRCDIR)/src/math) -LinkSourceFile(m_debug_vertex.c, $(MESASRCDIR)/src/math) LinkSourceFile(m_debug_xform.c, $(MESASRCDIR)/src/math) LinkSourceFile(m_eval.c, $(MESASRCDIR)/src/math) LinkSourceFile(m_matrix.c, $(MESASRCDIR)/src/math) LinkSourceFile(m_translate.c, $(MESASRCDIR)/src/math) LinkSourceFile(m_vector.c, $(MESASRCDIR)/src/math) -LinkSourceFile(m_vertices.c, $(MESASRCDIR)/src/math) LinkSourceFile(m_xform.c, $(MESASRCDIR)/src/math) #endif MESA_MATH_OBJS = $(MESAMATHBUILDDIR)m_debug_clip.o \ $(MESAMATHBUILDDIR)m_debug_norm.o \ $(MESAMATHBUILDDIR)m_debug_xform.o \ - $(MESAMATHBUILDDIR)m_debug_vertex.o \ $(MESAMATHBUILDDIR)m_eval.o \ $(MESAMATHBUILDDIR)m_matrix.o \ $(MESAMATHBUILDDIR)m_translate.o \ $(MESAMATHBUILDDIR)m_vector.o \ - $(MESAMATHBUILDDIR)m_vertices.o \ $(MESAMATHBUILDDIR)m_xform.o #if defined(DoSharedLib) && DoSharedLib MESA_MATH_UOBJS = $(MESAMATHBUILDDIR)unshared/m_debug_clip.o \ $(MESAMATHBUILDDIR)unshared/m_debug_norm.o \ $(MESAMATHBUILDDIR)unshared/m_debug_xform.o \ - $(MESAMATHBUILDDIR)unshared/m_debug_vertex.o \ $(MESAMATHBUILDDIR)unshared/m_eval.o \ $(MESAMATHBUILDDIR)unshared/m_matrix.o \ $(MESAMATHBUILDDIR)unshared/m_translate.o \ $(MESAMATHBUILDDIR)unshared/m_vector.o \ - $(MESAMATHBUILDDIR)unshared/m_vertices.o \ $(MESAMATHBUILDDIR)unshared/m_xform.o #else MATH_MESA_UOBJS = $(MESA_MATH_OBJS) @@ -59,22 +51,18 @@ MESA_MATH_DOBJS = $(MESAMATHBUILDDIR)debugger/m_debug_clip.o \ $(MESAMATHBUILDDIR)debugger/m_debug_norm.o \ $(MESAMATHBUILDDIR)debugger/m_debug_xform.o \ - $(MESAMATHBUILDDIR)debugger/m_debug_vertex.o \ $(MESAMATHBUILDDIR)debugger/m_eval.o \ $(MESAMATHBUILDDIR)debugger/m_matrix.o \ $(MESAMATHBUILDDIR)debugger/m_translate.o \ $(MESAMATHBUILDDIR)debugger/m_vector.o \ - $(MESAMATHBUILDDIR)debugger/m_vertices.o \ $(MESAMATHBUILDDIR)debugger/m_xform.o MESA_MATH_POBJS = $(MESAMATHBUILDDIR)profiled/m_debug_clip.o \ $(MESAMATHBUILDDIR)profiled/m_debug_norm.o \ $(MESAMATHBUILDDIR)profiled/m_debug_xform.o \ - $(MESAMATHBUILDDIR)profiled/m_debug_vertex.o \ $(MESAMATHBUILDDIR)profiled/m_eval.o \ $(MESAMATHBUILDDIR)profiled/m_matrix.o \ $(MESAMATHBUILDDIR)profiled/m_translate.o \ $(MESAMATHBUILDDIR)profiled/m_vector.o \ - $(MESAMATHBUILDDIR)profiled/m_vertices.o \ $(MESAMATHBUILDDIR)profiled/m_xform.o Index: xc/lib/GL/mesa/src/swrast/Imakefile.inc diff -u xc/lib/GL/mesa/src/swrast/Imakefile.inc:1.2 xc/lib/GL/mesa/src/swrast/Imakefile.inc:1.3 --- xc/lib/GL/mesa/src/swrast/Imakefile.inc:1.2 Thu Nov 14 16:01:17 2002 +++ xc/lib/GL/mesa/src/swrast/Imakefile.inc Sun Sep 28 16:15:40 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/swrast/Imakefile.inc,v 1.2 2002/11/14 21:01:17 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/swrast/Imakefile.inc,v 1.3 2003/09/28 20:15:40 alanh Exp $ #ifndef MesaSwrastBuildDir #define MesaSwrastBuildDir $(GLXLIBSRC)/mesa/src/swrast/ @@ -25,11 +25,9 @@ $(MESASWRASTBUILDDIR)s_lines.c \ $(MESASWRASTBUILDDIR)s_logic.c \ $(MESASWRASTBUILDDIR)s_masking.c \ - $(MESASWRASTBUILDDIR)s_pb.c \ $(MESASWRASTBUILDDIR)s_pixeltex.c \ $(MESASWRASTBUILDDIR)s_points.c \ $(MESASWRASTBUILDDIR)s_readpix.c \ - $(MESASWRASTBUILDDIR)s_scissor.c \ $(MESASWRASTBUILDDIR)s_span.c \ $(MESASWRASTBUILDDIR)s_stencil.c \ $(MESASWRASTBUILDDIR)s_texstore.c \ @@ -57,11 +55,9 @@ LinkSourceFile(s_lines.c, $(MESASRCDIR)/src/swrast) LinkSourceFile(s_logic.c, $(MESASRCDIR)/src/swrast) LinkSourceFile(s_masking.c, $(MESASRCDIR)/src/swrast) -LinkSourceFile(s_pb.c, $(MESASRCDIR)/src/swrast) LinkSourceFile(s_pixeltex.c, $(MESASRCDIR)/src/swrast) LinkSourceFile(s_points.c, $(MESASRCDIR)/src/swrast) LinkSourceFile(s_readpix.c, $(MESASRCDIR)/src/swrast) -LinkSourceFile(s_scissor.c, $(MESASRCDIR)/src/swrast) LinkSourceFile(s_span.c, $(MESASRCDIR)/src/swrast) LinkSourceFile(s_stencil.c, $(MESASRCDIR)/src/swrast) LinkSourceFile(s_texstore.c, $(MESASRCDIR)/src/swrast) @@ -89,11 +85,9 @@ $(MESASWRASTBUILDDIR)s_lines.o \ $(MESASWRASTBUILDDIR)s_logic.o \ $(MESASWRASTBUILDDIR)s_masking.o \ - $(MESASWRASTBUILDDIR)s_pb.o \ $(MESASWRASTBUILDDIR)s_pixeltex.o \ $(MESASWRASTBUILDDIR)s_points.o \ $(MESASWRASTBUILDDIR)s_readpix.o \ - $(MESASWRASTBUILDDIR)s_scissor.o \ $(MESASWRASTBUILDDIR)s_span.o \ $(MESASWRASTBUILDDIR)s_stencil.o \ $(MESASWRASTBUILDDIR)s_texstore.o \ @@ -121,11 +115,9 @@ $(MESASWRASTBUILDDIR)unshared/s_lines.o \ $(MESASWRASTBUILDDIR)unshared/s_logic.o \ $(MESASWRASTBUILDDIR)unshared/s_masking.o \ - $(MESASWRASTBUILDDIR)unshared/s_pb.o \ $(MESASWRASTBUILDDIR)unshared/s_pixeltex.o \ $(MESASWRASTBUILDDIR)unshared/s_points.o \ $(MESASWRASTBUILDDIR)unshared/s_readpix.o \ - $(MESASWRASTBUILDDIR)unshared/s_scissor.o \ $(MESASWRASTBUILDDIR)unshared/s_span.o \ $(MESASWRASTBUILDDIR)unshared/s_stencil.o \ $(MESASWRASTBUILDDIR)unshared/s_texstore.o \ @@ -155,11 +147,9 @@ $(MESASWRASTBUILDDIR)debugger/s_lines.o \ $(MESASWRASTBUILDDIR)debugger/s_logic.o \ $(MESASWRASTBUILDDIR)debugger/s_masking.o \ - $(MESASWRASTBUILDDIR)debugger/s_pb.o \ $(MESASWRASTBUILDDIR)debugger/s_pixeltex.o \ $(MESASWRASTBUILDDIR)debugger/s_points.o \ $(MESASWRASTBUILDDIR)debugger/s_readpix.o \ - $(MESASWRASTBUILDDIR)debugger/s_scissor.o \ $(MESASWRASTBUILDDIR)debugger/s_span.o \ $(MESASWRASTBUILDDIR)debugger/s_stencil.o \ $(MESASWRASTBUILDDIR)debugger/s_texstore.o \ @@ -186,11 +176,9 @@ $(MESASWRASTBUILDDIR)profiled/s_lines.o \ $(MESASWRASTBUILDDIR)profiled/s_logic.o \ $(MESASWRASTBUILDDIR)profiled/s_masking.o \ - $(MESASWRASTBUILDDIR)profiled/s_pb.o \ $(MESASWRASTBUILDDIR)profiled/s_pixeltex.o \ $(MESASWRASTBUILDDIR)profiled/s_points.o \ $(MESASWRASTBUILDDIR)profiled/s_readpix.o \ - $(MESASWRASTBUILDDIR)profiled/s_scissor.o \ $(MESASWRASTBUILDDIR)profiled/s_span.o \ $(MESASWRASTBUILDDIR)profiled/s_stencil.o \ $(MESASWRASTBUILDDIR)profiled/s_texstore.o \ Index: xc/lib/GL/mesa/src/tnl/Imakefile.inc diff -u xc/lib/GL/mesa/src/tnl/Imakefile.inc:1.2 xc/lib/GL/mesa/src/tnl/Imakefile.inc:1.3 --- xc/lib/GL/mesa/src/tnl/Imakefile.inc:1.2 Thu Nov 14 16:01:17 2002 +++ xc/lib/GL/mesa/src/tnl/Imakefile.inc Sun Sep 28 16:15:40 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/tnl/Imakefile.inc,v 1.2 2002/11/14 21:01:17 tsi Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/tnl/Imakefile.inc,v 1.3 2003/09/28 20:15:40 alanh Exp $ #ifndef MesaTnlBuildDir #define MesaTnlBuildDir $(GLXLIBSRC)/mesa/src/tnl/ @@ -23,6 +23,7 @@ $(MESATNLBUILDDIR)t_vb_light.c \ $(MESATNLBUILDDIR)t_vb_normals.c \ $(MESATNLBUILDDIR)t_vb_points.c \ + $(MESATNLBUILDDIR)t_vb_program.c \ $(MESATNLBUILDDIR)t_vb_render.c \ $(MESATNLBUILDDIR)t_vb_texgen.c \ $(MESATNLBUILDDIR)t_vb_texmat.c \ @@ -46,6 +47,7 @@ LinkSourceFile(t_vb_light.c, $(MESASRCDIR)/src/tnl) LinkSourceFile(t_vb_normals.c, $(MESASRCDIR)/src/tnl) LinkSourceFile(t_vb_points.c, $(MESASRCDIR)/src/tnl) +LinkSourceFile(t_vb_program.c, $(MESASRCDIR)/src/tnl) LinkSourceFile(t_vb_render.c, $(MESASRCDIR)/src/tnl) LinkSourceFile(t_vb_texgen.c, $(MESASRCDIR)/src/tnl) LinkSourceFile(t_vb_texmat.c, $(MESASRCDIR)/src/tnl) @@ -69,6 +71,7 @@ $(MESATNLBUILDDIR)t_vb_light.o \ $(MESATNLBUILDDIR)t_vb_normals.o \ $(MESATNLBUILDDIR)t_vb_points.o \ + $(MESATNLBUILDDIR)t_vb_program.o \ $(MESATNLBUILDDIR)t_vb_render.o \ $(MESATNLBUILDDIR)t_vb_texgen.o \ $(MESATNLBUILDDIR)t_vb_texmat.o \ @@ -92,6 +95,7 @@ $(MESATNLBUILDDIR)unshared/t_vb_light.o \ $(MESATNLBUILDDIR)unshared/t_vb_normals.o \ $(MESATNLBUILDDIR)unshared/t_vb_points.o \ + $(MESATNLBUILDDIR)unshared/t_vb_program.o \ $(MESATNLBUILDDIR)unshared/t_vb_render.o \ $(MESATNLBUILDDIR)unshared/t_vb_texgen.o \ $(MESATNLBUILDDIR)unshared/t_vb_texmat.o \ @@ -117,6 +121,7 @@ $(MESATNLBUILDDIR)debugger/t_vb_light.o \ $(MESATNLBUILDDIR)debugger/t_vb_normals.o \ $(MESATNLBUILDDIR)debugger/t_vb_points.o \ + $(MESATNLBUILDDIR)debugger/t_vb_program.o \ $(MESATNLBUILDDIR)debugger/t_vb_render.o \ $(MESATNLBUILDDIR)debugger/t_vb_texgen.o \ $(MESATNLBUILDDIR)debugger/t_vb_texmat.o \ @@ -139,6 +144,7 @@ $(MESATNLBUILDDIR)profiled/t_vb_light.o \ $(MESATNLBUILDDIR)profiled/t_vb_normals.o \ $(MESATNLBUILDDIR)profiled/t_vb_points.o \ + $(MESATNLBUILDDIR)profiled/t_vb_program.o \ $(MESATNLBUILDDIR)profiled/t_vb_render.o \ $(MESATNLBUILDDIR)profiled/t_vb_texgen.o \ $(MESATNLBUILDDIR)profiled/t_vb_texmat.o \ Index: xc/lib/GLU/libnurbs/internals/Imakefile diff -u xc/lib/GLU/libnurbs/internals/Imakefile:1.9 xc/lib/GLU/libnurbs/internals/Imakefile:1.12 --- xc/lib/GLU/libnurbs/internals/Imakefile:1.9 Fri Dec 13 23:41:12 2002 +++ xc/lib/GLU/libnurbs/internals/Imakefile Thu Oct 23 17:30:04 2003 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GLU/libnurbs/internals/Imakefile,v 1.9 2002/12/14 04:41:12 dawes Exp $ +XCOMM $XFree86: xc/lib/GLU/libnurbs/internals/Imakefile,v 1.12 2003/10/23 21:30:04 tsi Exp $ XCOMM License Applicability. Except to the extent portions of this file are XCOMM made subject to an alternative license as permitted in the SGI Free @@ -7,21 +7,21 @@ XCOMM this file except in compliance with the License. You may obtain a copy XCOMM of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 XCOMM Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -XCOMM +XCOMM XCOMM http://oss.sgi.com/projects/FreeB -XCOMM +XCOMM XCOMM Note that, as provided in the License, the Software is distributed on an XCOMM "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS XCOMM DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND XCOMM CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A XCOMM PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -XCOMM +XCOMM XCOMM Original Code. The Original Code is: OpenGL Sample Implementation, XCOMM Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, XCOMM Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. XCOMM Copyright in any portions created by third parties is as indicated XCOMM elsewhere herein. All Rights Reserved. -XCOMM +XCOMM XCOMM Additional Notice Provisions: The application programming interfaces XCOMM established by SGI in conjunction with the Original Code are The XCOMM OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -143,19 +143,21 @@ -I$(TOP)/include \ -I$(TOP)/include/GL -#if SystemV4 || defined(LynxOSArchitecture) +#if defined(SGIArchitecture) +OSDEFINES = -D_SCO_DS +#elif SystemV4 || defined(LynxOSArchitecture) || defined(OS2Architecture) OSDEFINES = -DNEEDCEILF #elif defined(DarwinArchitecture) # if OSMajorVersion <= 5 OSDEFINES = -DNEEDCEILF # endif +#elif defined(LinuxArchitecture) && (LinuxCLibMajorVersion < 6) +OSDEFINES = -DNEEDCEILF #else OSDEFINES = -D_EXTENSIONS_ #endif -DEFINES = $(OSDEFINES) \ - -DLIBRARYBUILD \ - -DNDEBUG +DEFINES = $(OSDEFINES) -DLIBRARYBUILD -DNDEBUG LibraryObjectRule() Index: xc/lib/GLw/Imakefile diff -u xc/lib/GLw/Imakefile:1.3 xc/lib/GLw/Imakefile:1.4 --- xc/lib/GLw/Imakefile:1.3 Sat Apr 6 13:24:46 2002 +++ xc/lib/GLw/Imakefile Fri Feb 13 18:58:29 2004 @@ -1,31 +1,51 @@ /* * Copyright (c) 2000 by The XFree86 Project, Inc. + * All rights reserved. * - * 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 XFREE86 PROJECT 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. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from The XFree86 Project, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -XCOMM $XFree86: xc/lib/GLw/Imakefile,v 1.3 2002/04/06 18:24:46 tsi Exp $ +XCOMM $XFree86: xc/lib/GLw/Imakefile,v 1.4 2004/02/13 23:58:29 dawes Exp $ XCOMM XCOMM Imakefile for GLw library - lots of modifications for XFree86 by Index: xc/lib/ICE/ICElib.h diff -u xc/lib/ICE/ICElib.h:3.4 xc/lib/ICE/ICElib.h:3.5 --- xc/lib/ICE/ICElib.h:3.4 Fri Dec 14 14:53:35 2001 +++ xc/lib/ICE/ICElib.h Mon Nov 17 17:20:05 2003 @@ -26,7 +26,7 @@ Author: Ralph Mor, X Consortium ******************************************************************************/ -/* $XFree86: xc/lib/ICE/ICElib.h,v 3.4 2001/12/14 19:53:35 dawes Exp $ */ +/* $XFree86: xc/lib/ICE/ICElib.h,v 3.5 2003/11/17 22:20:05 dawes Exp $ */ #ifndef _ICELIB_H_ #define _ICELIB_H_ @@ -39,11 +39,7 @@ #define True 1 #define False 0 -#if NeedFunctionPrototypes typedef void *IcePointer; -#else -typedef char *IcePointer; -#endif typedef enum { IcePoAuthHaveReply, @@ -103,16 +99,13 @@ typedef struct _IceListenObj *IceListenObj; typedef void (*IceWatchProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IcePointer /* clientData */, Bool /* opening */, IcePointer * /* watchData */ -#endif ); typedef void (*IcePoProcessMsgProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IcePointer /* clientData */, int /* opcode */, @@ -120,17 +113,14 @@ Bool /* swap */, IceReplyWaitInfo * /* replyWait */, Bool * /* replyReadyRet */ -#endif ); typedef void (*IcePaProcessMsgProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IcePointer /* clientData */, int /* opcode */, unsigned long /* length */, Bool /* swap */ -#endif ); typedef struct { @@ -146,7 +136,6 @@ } IcePaVersionRec; typedef IcePoAuthStatus (*IcePoAuthProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IcePointer * /* authStatePtr */, Bool /* cleanUp */, @@ -156,11 +145,9 @@ int * /* replyDataLenRet */, IcePointer * /* replyDataRet */, char ** /* errorStringRet */ -#endif ); typedef IcePaAuthStatus (*IcePaAuthProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IcePointer * /* authStatePtr */, Bool /* swap */, @@ -169,17 +156,13 @@ int * /* replyDataLenRet */, IcePointer * /* replyDataRet */, char ** /* errorStringRet */ -#endif ); typedef Bool (*IceHostBasedAuthProc) ( -#if NeedFunctionPrototypes char * /* hostName */ -#endif ); typedef Status (*IceProtocolSetupProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* majorVersion */, int /* minorVersion */, @@ -187,31 +170,23 @@ char * /* release */, IcePointer * /* clientDataRet */, char ** /* failureReasonRet */ -#endif ); typedef void (*IceProtocolActivateProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IcePointer /* clientData */ -#endif ); typedef void (*IceIOErrorProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); typedef void (*IcePingReplyProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IcePointer /* clientData */ -#endif ); typedef void (*IceErrorHandler) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, Bool /* swap */, int /* offendingMinorOpcode */, @@ -219,13 +194,10 @@ int /* errorClass */, int /* severity */, IcePointer /* values */ -#endif ); typedef void (*IceIOErrorHandler) ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); @@ -236,7 +208,6 @@ _XFUNCPROTOBEGIN extern int IceRegisterForProtocolSetup ( -#if NeedFunctionPrototypes char * /* protocolName */, char * /* vendor */, char * /* release */, @@ -246,11 +217,9 @@ char ** /* authNames */, IcePoAuthProc * /* authProcs */, IceIOErrorProc /* IOErrorProc */ -#endif ); extern int IceRegisterForProtocolReply ( -#if NeedFunctionPrototypes char * /* protocolName */, char * /* vendor */, char * /* release */, @@ -263,120 +232,88 @@ IceProtocolSetupProc /* protocolSetupProc */, IceProtocolActivateProc /* protocolActivateProc */, IceIOErrorProc /* IOErrorProc */ -#endif ); extern IceConn IceOpenConnection ( -#if NeedFunctionPrototypes char * /* networkIdsList */, IcePointer /* context */, Bool /* mustAuthenticate */, int /* majorOpcodeCheck */, int /* errorLength */, char * /* errorStringRet */ -#endif ); extern IcePointer IceGetConnectionContext ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern Status IceListenForConnections ( -#if NeedFunctionPrototypes int * /* countRet */, IceListenObj ** /* listenObjsRet */, int /* errorLength */, char * /* errorStringRet */ -#endif ); extern Status IceListenForWellKnownConnections ( -#if NeedFunctionPrototypes char * /* port */, int * /* countRet */, IceListenObj ** /* listenObjsRet */, int /* errorLength */, char * /* errorStringRet */ -#endif ); extern int IceGetListenConnectionNumber ( -#if NeedFunctionPrototypes IceListenObj /* listenObj */ -#endif ); extern char *IceGetListenConnectionString ( -#if NeedFunctionPrototypes IceListenObj /* listenObj */ -#endif ); extern char *IceComposeNetworkIdList ( -#if NeedFunctionPrototypes int /* count */, IceListenObj * /* listenObjs */ -#endif ); extern void IceFreeListenObjs ( -#if NeedFunctionPrototypes int /* count */, IceListenObj * /* listenObjs */ -#endif ); extern void IceSetHostBasedAuthProc ( -#if NeedFunctionPrototypes IceListenObj /* listenObj */, IceHostBasedAuthProc /* hostBasedAuthProc */ -#endif ); extern IceConn IceAcceptConnection ( -#if NeedFunctionPrototypes IceListenObj /* listenObj */, IceAcceptStatus * /* statusRet */ -#endif ); extern void IceSetShutdownNegotiation ( -#if NeedFunctionPrototypes IceConn /* iceConn */, Bool /* negotiate */ -#endif ); extern Bool IceCheckShutdownNegotiation ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern IceCloseStatus IceCloseConnection ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern Status IceAddConnectionWatch ( -#if NeedFunctionPrototypes IceWatchProc /* watchProc */, IcePointer /* clientData */ -#endif ); extern void IceRemoveConnectionWatch ( -#if NeedFunctionPrototypes IceWatchProc /* watchProc */, IcePointer /* clientData */ -#endif ); extern IceProtocolSetupStatus IceProtocolSetup ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* myOpcode */, IcePointer /* clientData */, @@ -387,127 +324,88 @@ char ** /* releaseRet */, int /* errorLength */, char * /* errorStringRet */ -#endif ); extern Status IceProtocolShutdown ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* majorOpcode */ -#endif ); extern IceProcessMessagesStatus IceProcessMessages ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IceReplyWaitInfo * /* replyWait */, Bool * /* replyReadyRet */ -#endif ); extern Status IcePing ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IcePingReplyProc /* pingReplyProc */, IcePointer /* clientData */ -#endif ); extern char *IceAllocScratch ( -#if NeedFunctionPrototypes IceConn /* iceConn */, unsigned long /* size */ -#endif ); extern int IceFlush ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern int IceGetOutBufSize ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern int IceGetInBufSize ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern IceConnectStatus IceConnectionStatus ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern char *IceVendor ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern char *IceRelease ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern int IceProtocolVersion ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern int IceProtocolRevision ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern int IceConnectionNumber ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern char *IceConnectionString ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern unsigned long IceLastSentSequenceNumber ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern unsigned long IceLastReceivedSequenceNumber ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern Bool IceSwapping ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern IceErrorHandler IceSetErrorHandler ( -#if NeedFunctionPrototypes IceErrorHandler /* handler */ -#endif ); extern IceIOErrorHandler IceSetIOErrorHandler ( -#if NeedFunctionPrototypes IceIOErrorHandler /* handler */ -#endif ); @@ -516,21 +414,15 @@ */ extern Status IceInitThreads ( -#if NeedFunctionPrototypes void -#endif ); extern void IceAppLockConn ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern void IceAppUnlockConn ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); _XFUNCPROTOEND Index: xc/lib/ICE/ICElibint.h diff -u xc/lib/ICE/ICElibint.h:1.6 xc/lib/ICE/ICElibint.h:1.7 --- xc/lib/ICE/ICElibint.h:1.6 Fri Dec 14 14:53:35 2001 +++ xc/lib/ICE/ICElibint.h Mon Nov 17 17:20:05 2003 @@ -26,7 +26,7 @@ Author: Ralph Mor, X Consortium ******************************************************************************/ -/* $XFree86: xc/lib/ICE/ICElibint.h,v 1.6 2001/12/14 19:53:35 dawes Exp $ */ +/* $XFree86: xc/lib/ICE/ICElibint.h,v 1.7 2003/11/17 22:20:05 dawes Exp $ */ #ifndef _ICELIBINT_H_ #define _ICELIBINT_H_ @@ -127,7 +127,6 @@ */ typedef void (*_IceProcessCoreMsgProc) ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* opcode */, unsigned long /* length */, @@ -135,7 +134,6 @@ IceReplyWaitInfo * /* replyWait */, Bool * /* replyReadyRet */, Bool * /* connectionClosedRet */ -#endif ); typedef struct { @@ -411,173 +409,129 @@ extern void _IceErrorBadMajor ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* offendingMajor */, int /* offendingMinor */, int /* severity */ -#endif ); extern void _IceErrorNoAuthentication ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* offendingMinor */ -#endif ); extern void _IceErrorNoVersion ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* offendingMinor */ -#endif ); extern void _IceErrorSetupFailed ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* offendingMinor */, char * /* reason */ -#endif ); extern void _IceErrorAuthenticationRejected ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* offendingMinor */, char * /* reason */ -#endif ); extern void _IceErrorAuthenticationFailed ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* offendingMinor */, char * /* reason */ -#endif ); extern void _IceErrorProtocolDuplicate ( -#if NeedFunctionPrototypes IceConn /* iceConn */, char * /* protocolName */ -#endif ); extern void _IceErrorMajorOpcodeDuplicate ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* majorOpcode */ -#endif ); extern void _IceErrorUnknownProtocol ( -#if NeedFunctionPrototypes IceConn /* iceConn */, char * /* protocolName */ -#endif ); extern void _IceAddOpcodeMapping ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* hisOpcode */, int /* myOpcode */ -#endif ); extern char *_IceGetPeerName ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern void _IceFreeConnection ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern void _IceAddReplyWait ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IceReplyWaitInfo * /* replyWait */ -#endif ); extern IceReplyWaitInfo *_IceSearchReplyWaits ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* majorOpcode */ -#endif ); extern void _IceSetReplyReady ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IceReplyWaitInfo * /* replyWait */ -#endif ); extern Bool _IceCheckReplyReady ( -#if NeedFunctionPrototypes IceConn /* iceConn */, IceReplyWaitInfo * /* replyWait */ -#endif ); extern void _IceConnectionOpened ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern void _IceConnectionClosed ( -#if NeedFunctionPrototypes IceConn /* iceConn */ -#endif ); extern void _IceGetPoAuthData ( -#if NeedFunctionPrototypes char * /* protocol_name */, char * /* address */, char * /* auth_name */, unsigned short * /* auth_data_length_ret */, char ** /* auth_data_ret */ -#endif ); extern void _IceGetPaAuthData ( -#if NeedFunctionPrototypes char * /* protocol_name */, char * /* address */, char * /* auth_name */, unsigned short * /* auth_data_length_ret */, char ** /* auth_data_ret */ -#endif ); extern void _IceGetPoValidAuthIndices ( -#if NeedFunctionPrototypes char * /* protocol_name */, char * /* address */, int /* num_auth_names */, char ** /* auth_names */, int * /* num_indices_ret */, int * /* indices_ret */ -#endif ); extern void _IceGetPaValidAuthIndices ( -#if NeedFunctionPrototypes char * /* protocol_name */, char * /* address */, int /* num_auth_names */, char ** /* auth_names */, int * /* num_indices_ret */, int * /* indices_ret */ -#endif ); #endif /* _ICELIBINT_H_ */ Index: xc/lib/ICE/ICEmsg.h diff -u xc/lib/ICE/ICEmsg.h:1.4 xc/lib/ICE/ICEmsg.h:1.5 --- xc/lib/ICE/ICEmsg.h:1.4 Thu Dec 20 14:40:59 2001 +++ xc/lib/ICE/ICEmsg.h Mon Nov 17 17:20:05 2003 @@ -26,7 +26,7 @@ Author: Ralph Mor, X Consortium ******************************************************************************/ -/* $XFree86: xc/lib/ICE/ICEmsg.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */ +/* $XFree86: xc/lib/ICE/ICEmsg.h,v 1.5 2003/11/17 22:20:05 dawes Exp $ */ #ifndef _ICEMSG_H_ #define _ICEMSG_H_ @@ -42,65 +42,51 @@ */ extern Status _IceRead ( -#if NeedFunctionPrototypes IceConn /* iceConn */, unsigned long /* nbytes */, char * /* ptr */ -#endif ); extern void _IceReadSkip ( -#if NeedFunctionPrototypes IceConn /* iceConn */, unsigned long /* nbytes */ -#endif ); extern void _IceWrite ( -#if NeedFunctionPrototypes IceConn /* iceConn */, unsigned long /* nbytes */, char * /* ptr */ -#endif ); extern void _IceErrorBadMinor ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* majorOpcode */, int /* offendingMinor */, int /* severity */ -#endif ); extern void _IceErrorBadState ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* majorOpcode */, int /* offendingMinor */, int /* severity */ -#endif ); extern void _IceErrorBadLength ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* majorOpcode */, int /* offendingMinor */, int /* severity */ -#endif ); extern void _IceErrorBadValue ( -#if NeedFunctionPrototypes IceConn /* iceConn */, int /* majorOpcode */, int /* offendingMinor */, int /* offset */, int /* length */, IcePointer /* value */ -#endif ); Index: xc/lib/ICE/ICEutil.h diff -u xc/lib/ICE/ICEutil.h:1.4 xc/lib/ICE/ICEutil.h:1.5 --- xc/lib/ICE/ICEutil.h:1.4 Thu Dec 20 14:40:59 2001 +++ xc/lib/ICE/ICEutil.h Mon Nov 17 17:20:05 2003 @@ -26,7 +26,7 @@ Author: Ralph Mor, X Consortium ******************************************************************************/ -/* $XFree86: xc/lib/ICE/ICEutil.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */ +/* $XFree86: xc/lib/ICE/ICEutil.h,v 1.5 2003/11/17 22:20:05 dawes Exp $ */ #ifndef _ICEUTIL_H_ #define _ICEUTIL_H_ @@ -80,64 +80,46 @@ */ extern char *IceAuthFileName ( -#if NeedFunctionPrototypes void -#endif ); extern int IceLockAuthFile ( -#if NeedFunctionPrototypes char * /* file_name */, int /* retries */, int /* timeout */, long /* dead */ -#endif ); extern void IceUnlockAuthFile ( -#if NeedFunctionPrototypes char * /* file_name */ -#endif ); extern IceAuthFileEntry *IceReadAuthFileEntry ( -#if NeedFunctionPrototypes FILE * /* auth_file */ -#endif ); extern void IceFreeAuthFileEntry ( -#if NeedFunctionPrototypes IceAuthFileEntry * /* auth */ -#endif ); extern Status IceWriteAuthFileEntry ( -#if NeedFunctionPrototypes FILE * /* auth_file */, IceAuthFileEntry * /* auth */ -#endif ); extern IceAuthFileEntry *IceGetAuthFileEntry ( -#if NeedFunctionPrototypes char * /* protocol_name */, char * /* network_id */, char * /* auth_name */ -#endif ); extern char *IceGenerateMagicCookie ( -#if NeedFunctionPrototypes int /* len */ -#endif ); extern void IceSetPaAuthData ( -#if NeedFunctionPrototypes int /* numEntries */, IceAuthDataEntry * /* entries */ -#endif ); _XFUNCPROTOEND Index: xc/lib/ICE/authutil.c diff -u xc/lib/ICE/authutil.c:3.9 xc/lib/ICE/authutil.c:3.10 --- xc/lib/ICE/authutil.c:3.9 Fri May 31 14:45:41 2002 +++ xc/lib/ICE/authutil.c Wed Nov 26 16:48:18 2003 @@ -26,7 +26,7 @@ Author: Ralph Mor, X Consortium ******************************************************************************/ -/* $XFree86: xc/lib/ICE/authutil.c,v 3.9 2002/05/31 18:45:41 dawes Exp $ */ +/* $XFree86: xc/lib/ICE/authutil.c,v 3.10 2003/11/26 21:48:18 herrb Exp $ */ #include #include "ICElibint.h" @@ -418,25 +418,21 @@ if (!read_short (file, &len)) return (0); - if (len == 0) - { - data = 0; - } - else - { - data = malloc ((unsigned) len + 1); - - if (!data) + data = malloc ((unsigned) len + 1); + + if (!data) return (0); - - if (fread (data, (int) sizeof (char), (int) len, file) != len) + + if (len != 0) + { + if (fread (data, (int) sizeof (char), (int) len, file) != len) { free (data); return (0); - } - - data[len] = '\0'; + } + } + data[len] = '\0'; *stringp = data; Index: xc/lib/ICE/process.c diff -u xc/lib/ICE/process.c:3.8 xc/lib/ICE/process.c:3.10 --- xc/lib/ICE/process.c:3.8 Fri Dec 14 14:53:36 2001 +++ xc/lib/ICE/process.c Thu Oct 23 17:31:49 2003 @@ -26,7 +26,7 @@ Author: Ralph Mor, X Consortium ******************************************************************************/ -/* $XFree86: xc/lib/ICE/process.c,v 3.8 2001/12/14 19:53:36 dawes Exp $ */ +/* $XFree86: xc/lib/ICE/process.c,v 3.10 2003/10/23 21:31:49 tsi Exp $ */ #include #include "ICElibint.h" @@ -37,11 +37,11 @@ * Check for bad length */ -#define CHECK_SIZE_MATCH(_iceConn, _opcode, _expected_len, _actual_len, _severity) \ +#define CHECK_SIZE_MATCH(_iceConn, _opcode, _expected_len, _actual_len, _severity, _return) \ if ((((_actual_len) - SIZEOF (iceMsg)) >> 3) != _expected_len) \ { \ _IceErrorBadLength (_iceConn, 0, _opcode, _severity); \ - return (0); \ + return (_return); \ } #define CHECK_AT_LEAST_SIZE(_iceConn, _opcode, _expected_len, _actual_len, _severity) \ @@ -187,7 +187,7 @@ CHECK_SIZE_MATCH (iceConn, ICE_ByteOrder, header->length, SIZEOF (iceByteOrderMsg), - IceFatalToConnection); + IceFatalToConnection, IceProcessMessagesIOError); if (byteOrder != IceMSBfirst && byteOrder != IceLSBfirst) { @@ -1697,8 +1697,10 @@ char *pData, *pStart, *pEnd; Bool replyReady; +#if 0 /* No-op */ CHECK_AT_LEAST_SIZE (iceConn, ICE_ConnectionReply, length, SIZEOF (iceConnectionReplyMsg), IceFatalToConnection); +#endif IceReadCompleteMessage (iceConn, SIZEOF (iceConnectionReplyMsg), iceConnectionReplyMsg, message, pStart); @@ -2196,8 +2198,10 @@ char *pData, *pStart, *pEnd; Bool replyReady; +#if 0 /* No-op */ CHECK_AT_LEAST_SIZE (iceConn, ICE_ProtocolReply, length, SIZEOF (iceProtocolReplyMsg), IceFatalToProtocol); +#endif IceReadCompleteMessage (iceConn, SIZEOF (iceProtocolReplyMsg), iceProtocolReplyMsg, message, pStart); @@ -2304,7 +2308,7 @@ { CHECK_SIZE_MATCH (iceConn, ICE_Ping, - length, SIZEOF (icePingMsg), IceFatalToConnection); + length, SIZEOF (icePingMsg), IceFatalToConnection, 0); PingReply (iceConn); @@ -2321,7 +2325,7 @@ { CHECK_SIZE_MATCH (iceConn, ICE_PingReply, - length, SIZEOF (icePingReplyMsg), IceFatalToConnection); + length, SIZEOF (icePingReplyMsg), IceFatalToConnection, 0); if (iceConn->ping_waits) { @@ -2354,7 +2358,7 @@ *connectionClosedRet = False; CHECK_SIZE_MATCH (iceConn, ICE_WantToClose, - length, SIZEOF (iceWantToCloseMsg), IceFatalToConnection); + length, SIZEOF (iceWantToCloseMsg), IceFatalToConnection, 0); if (iceConn->want_to_close || iceConn->open_ref_count == 0) { @@ -2411,7 +2415,7 @@ { CHECK_SIZE_MATCH (iceConn, ICE_NoClose, - length, SIZEOF (iceNoCloseMsg), IceFatalToConnection); + length, SIZEOF (iceNoCloseMsg), IceFatalToConnection, 0); if (iceConn->want_to_close) { Index: xc/lib/PEX5/Imakefile diff -u xc/lib/PEX5/Imakefile:1.4 xc/lib/PEX5/Imakefile:removed --- xc/lib/PEX5/Imakefile:1.4 Wed Jan 17 14:41:30 2001 +++ xc/lib/PEX5/Imakefile Sat Feb 28 21:41:20 2004 @@ -1,91 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:44:20 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/lib/PEX5/Imakefile,v 1.4 2001/01/17 19:41:30 dawes Exp $ - -#define DoNormalLib NormalLibPex -#define DoSharedLib SharedLibPex -#define DoExtraLib SharedLibPex -#define DoDebugLib DebugLibPex -#define DoProfileLib ProfileLibPex -#define LibName PEX5 -#define SoRev SOPEXREV -#define IncSubdir X11 -#define IncSubSubdir PEX5 - -#include - -#ifdef SharedPexReqs -REQUIREDLIBS = SharedPexReqs -#endif - -#ifdef PexNativeFPFormat -NATIVE_FP_FORMAT = PexNativeFPFormat -FP_DEFINES = -DNATIVE_FP_FORMAT=$(NATIVE_FP_FORMAT) -#endif - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -DEFINES = $(FP_DEFINES) $(ALLOC_DEFINES) - -HEADERS = PEXlib.h \ - PEXlibint.h \ - PEX.h \ - PEXproto.h \ - PEXprotost.h - -SRCS = pl_convert.c \ - pl_escape.c \ - pl_font.c \ - pl_free.c \ - pl_lut.c \ - pl_nameset.c \ - pl_oc_attr.c \ - pl_oc_dec.c \ - pl_oc_enc.c \ - pl_oc_prim.c \ - pl_oc_str.c \ - pl_oc_util.c \ - pl_pc.c \ - pl_pick.c \ - pl_rdr.c \ - pl_sc.c \ - pl_startup.c \ - pl_struct.c \ - pl_util.c \ - pl_wks.c - -OBJS = pl_convert.o \ - pl_escape.o \ - pl_font.o \ - pl_free.o \ - pl_lut.o \ - pl_nameset.o \ - pl_oc_attr.o \ - pl_oc_dec.o \ - pl_oc_enc.o \ - pl_oc_prim.o \ - pl_oc_str.o \ - pl_oc_util.o \ - pl_pc.o \ - pl_pick.o \ - pl_rdr.o \ - pl_sc.o \ - pl_startup.o \ - pl_struct.o \ - pl_util.o \ - pl_wks.o - - -#include - -/* Work around a problem with SunPro C 4.2 (ix86) */ -#ifdef HasSunC -SpecialCLibObjectRule(pl_util,,-g) -#endif - -DependTarget() Index: xc/lib/PEX5/PEX.h diff -u xc/lib/PEX5/PEX.h:1.1.1.2 xc/lib/PEX5/PEX.h:removed --- xc/lib/PEX5/PEX.h:1.1.1.2 Tue Jan 16 17:06:15 2001 +++ xc/lib/PEX5/PEX.h Sat Feb 28 21:41:20 2004 @@ -1,1222 +0,0 @@ -#ifndef _PEX_H_ -#define _PEX_H_ - -/* $Xorg: PEX.h,v 1.3 2000/08/17 19:44:20 cpqbld Exp $ */ - -/******************************************************************************/ -/* Copyright 1987,1991 by Digital Equipment Corporation, Maynard, Mass. */ -/* */ -/* (c) Copyright Hewlett-Packard Company, 1992, Fort Collins, Colorado */ -/* */ -/* All Rights Reserved */ -/* */ -/* Permission to use, copy, modify, and distribute this software and its */ -/* documentation for any purpose and without fee is hereby granted, */ -/* provided that the above copyright notices appear in all copies and that */ -/* both the copyright notices and this permission notice appear in */ -/* supporting documentation, and that the names of Digital or */ -/* Hewlett-Packard not be used in advertising or publicity pertaining to */ -/* distribution of the software without specific, written prior permission. */ -/* */ -/* DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */ -/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL */ -/* DIGITAL 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. */ -/* */ -/* HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS */ -/* SOFTWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard */ -/* shall not be liable for errors contained herein or direct, indirect, */ -/* special, incidental or consequential damages in connection with the */ -/* furnishing, performance or use of this software. */ -/* */ -/******************************************************************************/ - -/* - * PEX extension name - */ -#define PEX_NAME_STRING "X3D-PEX" - -/* - * PEX protocol major and minor numbers - */ -#define PEX_PROTO_MAJOR 5 /* 5.1 protocol */ -#define PEX_PROTO_MINOR 1 /* 5.1 protocol */ - -/* - * PEX standard subsets - */ -#define PEXCompleteImplementation 0 -#define PEXImmediateMode (1L<<0) -#define PEXWorkstationOnly (1L<<1) -#define PEXStructureMode (1L<<2) - -/* - * enumerated type information - */ -#define PEXETCounts 0 -#define PEXETIndex (1L<<0) -#define PEXETMnemonic (1L<<1) -#define PEXETAll (PEXETIndex | PEXETMnemonic) - -/* enumerated types */ -#define PEXETMarkerType 1 -#define PEXETATextStyle 2 -#define PEXETInteriorStyle 3 -#define PEXETHatchStyle 4 -#define PEXETLineType 5 -#define PEXETSurfaceEdgeType 6 -#define PEXETPickDeviceType 7 -#define PEXETPolylineInterpMethod 8 -#define PEXETCurveApproxMethod 9 -#define PEXETReflectionModel 10 -#define PEXETSurfaceInterpMethod 11 -#define PEXETSurfaceApproxMethod 12 -#define PEXETModelClipOperator 13 -#define PEXETLightType 14 -#define PEXETColorType 15 -#define PEXETFloatFormat 16 -#define PEXETHLHSRMode 17 -#define PEXETPromptEchoType 18 -#define PEXETDisplayUpdateMode 19 -#define PEXETColorApproxType 20 -#define PEXETColorApproxModel 21 -#define PEXETGDP2D 22 -#define PEXETGDP 23 -#define PEXETGSE 24 -#define PEXETTrimCurveApproxMethod 25 -#define PEXETRenderingColorModel 26 -#define PEXETParaSurfCharacteristics 27 -#define PEXETEscape 28 -#define PEXETPickOneMethod 29 -#define PEXETPickAllMethod 30 - -/* enumerated type values */ - -/* marker types */ -#define PEXMarkerDot 1 -#define PEXMarkerCross 2 -#define PEXMarkerAsterisk 3 -#define PEXMarkerCircle 4 -#define PEXMarkerX 5 - -/* marker type mnemonics */ -#define PEXETMMarkerDot "Dot" -#define PEXETMMarkerCross "Cross" -#define PEXETMMarkerAsterisk "Asterisk" -#define PEXETMMarkerCircle "Circle" -#define PEXETMMarkerX "X" - -/* annotation text styles */ -#define PEXATextNotConnected 1 -#define PEXATextConnected 2 - -/* annotation text style mnemonics */ -#define PEXETMATextNotConnected "NotConnected" -#define PEXETMATextConnected "Connected" - -/* interior styles */ -#define PEXInteriorStyleHollow 1 -#define PEXInteriorStyleSolid 2 -#define PEXInteriorStylePattern 3 -#define PEXInteriorStyleHatch 4 -#define PEXInteriorStyleEmpty 5 - -/* interior style mnemonics */ -#define PEXETMInteriorStyleHollow "Hollow" -#define PEXETMInteriorStyleSolid "Solid" -#define PEXETMInteriorStylePattern "Pattern" -#define PEXETMInteriorStyleHatch "Hatch" -#define PEXETMInteriorStyleEmpty "Empty" - -/* hatch style */ - -/* line types */ -#define PEXLineTypeSolid 1 -#define PEXLineTypeDashed 2 -#define PEXLineTypeDotted 3 -#define PEXLineTypeDashDot 4 - -/* line type mnemonics */ -#define PEXETMLineTypeSolid "Solid" -#define PEXETMLineTypeDashed "Dashed" -#define PEXETMLineTypeDotted "Dotted" -#define PEXETMLineTypeDashDot "DashDot" - -/* surface edge types */ -#define PEXSurfaceEdgeSolid 1 -#define PEXSurfaceEdgeDashed 2 -#define PEXSurfaceEdgeDotted 3 -#define PEXSurfaceEdgeDashDot 4 - -/* surface edge type mnemonics */ -#define PEXETMSurfaceEdgeSolid "Solid" -#define PEXETMSurfaceEdgeDashed "Dashed" -#define PEXETMSurfaceEdgeDotted "Dotted" -#define PEXETMSurfaceEdgeDashDot "DashDot" - -/* pick device types */ -#define PEXPickDeviceDCHitBox 1 -#define PEXPickDeviceNPCHitVolume 2 - -/* pick device type mnemonics */ -#define PEXETMPickDeviceDCHitBox "DC_HitBox" -#define PEXETMPickDeviceNPCHitVolume "NPC_HitVolume" - -/* polyline interpolation methods */ -#define PEXPolylineInterpNone 1 -#define PEXPolylineInterpColor 2 - -/* polyline interpolation method mnemonics */ -#define PEXETMPolylineInterpNone "None" -#define PEXETMPolylineInterpColor "Color" - -/* curve, surface and trim curve approximation methods */ -#define PEXApproxImpDep 1 -#define PEXApproxConstantBetweenKnots 2 -#define PEXApproxWCChordalSize 3 -#define PEXApproxNPCChordalSize 4 -#define PEXApproxDCChordalSize 5 -#define PEXCurveApproxWCChordalDev 6 -#define PEXCurveApproxNPCChordalDev 7 -#define PEXCurveApproxDCChordalDev 8 -#define PEXSurfaceApproxWCPlanarDev 6 -#define PEXSurfaceApproxNPCPlanarDev 7 -#define PEXSurfaceApproxDCPlanarDev 8 -#define PEXApproxWCRelative 9 -#define PEXApproxNPCRelative 10 -#define PEXApproxDCRelative 11 - -/* curve, surface and trim curve approximation method mnemonics */ - /* PEXApproxImpDep is an implementation-dependent string */ -#define PEXETMApproxConstantBetweenKnots "ConstantBetweenKnots" -#define PEXETMApproxWCChordalSize "WCS_ChordalSize" -#define PEXETMApproxNPCChordalSize "NPC_ChordalSize" -#define PEXETMApproxDCChordalSize "DC_ChordalSize" -#define PEXETMCurveApproxWCChordalDev "WCS_ChordalDev" -#define PEXETMCurveApproxNPCChordalDev "NPC_ChordalDev" -#define PEXETMCurveApproxDCChordalDev "DC_ChordalDev" -#define PEXETMSurfaceApproxWCPlanarDev "WCS_PlanarDev" -#define PEXETMSurfaceApproxNPCPlanarDev "NPC_PlanarDev" -#define PEXETMSurfaceApproxDCPlanarDev "DC_PlanarDev" -#define PEXETMApproxWCRelative "WCS_Relative" -#define PEXETMApproxNPCRelative "NPC_Relative" -#define PEXETMApproxDCRelative "DC_Relative" - -/* reflection models */ -#define PEXReflectionNone 1 -#define PEXReflectionAmbient 2 -#define PEXReflectionDiffuse 3 -#define PEXReflectionSpecular 4 - -/* reflection model mnemonics */ -#define PEXETMReflectionNone "NoShading" -#define PEXETMReflectionAmbient "Ambient" -#define PEXETMReflectionDiffuse "Diffuse" -#define PEXETMReflectionSpecular "Specular" - -/* surface interpolation methods */ -#define PEXSurfaceInterpNone 1 -#define PEXSurfaceInterpColor 2 -#define PEXSurfaceInterpDotProduct 3 -#define PEXSurfaceInterpNormal 4 - -/* surface interpolation method mnemonics */ -#define PEXETMSurfaceInterpNone "None" -#define PEXETMSurfaceInterpColor "Color" -#define PEXETMSurfaceInterpDotProduct "DotProduct" -#define PEXETMSurfaceInterpNormal "Normal" - -/* model clip operators */ -#define PEXModelClipReplace 1 -#define PEXModelClipIntersection 2 - -/* model clip operator mnemonics */ -#define PEXETMModelClipReplace "Replace" -#define PEXETMModelClipIntersection "Intersection" - -/* light types */ -#define PEXLightAmbient 1 -#define PEXLightWCVector 2 -#define PEXLightWCPoint 3 -#define PEXLightWCSpot 4 - -/* light type mnemonics */ -#define PEXETMLightAmbient "Ambient" -#define PEXETMLightWCVector "WCS_Vector" -#define PEXETMLightWCPoint "WCS_Point" -#define PEXETMLightWCSpot "WCS_Spot" - -/* color types */ -#define PEXColorTypeIndexed 0 -#define PEXColorTypeRGB 1 -#define PEXColorTypeCIE 2 -#define PEXColorTypeHSV 3 -#define PEXColorTypeHLS 4 -#define PEXColorTypeRGB8 5 -#define PEXColorTypeRGB16 6 - -/* color type mnemonics */ -#define PEXETMColorTypeIndexed "Indexed" -#define PEXETMColorTypeRGB "RGBFloat" -#define PEXETMColorTypeCIE "CIEFloat" -#define PEXETMColorTypeHSV "HSVFloat" -#define PEXETMColorTypeHLS "HLSFloat" -#define PEXETMColorTypeRGB8 "RGBInt8" -#define PEXETMColorTypeRGB16 "RGBInt16" - -/* float formats */ -#define PEXIEEE_754_32 1 -#define PEXDEC_F_Floating 2 -#define PEXIEEE_754_64 3 -#define PEXDEC_D_Floating 4 - -/* float format mnemonics */ -#define PEXETMIEEE_754_32 "IEEE_754_32" -#define PEXETMDEC_F_Floating "DEC_F_Floating" -#define PEXETMIEEE_754_64 "IEEE_754_64" -#define PEXETMDEC_D_Floating "DEC_D_Floating" - -/* HLHSR modes */ -#define PEXHLHSROff 1 -#define PEXHLHSRZBuffer 2 -#define PEXHLHSRPainters 3 -#define PEXHLHSRScanline 4 -#define PEXHLHSRHiddenLineOnly 5 -#define PEXHLHSRZBufferID 6 - -/* HLHSR mode mnemonics */ -#define PEXETMHLHSROff "Off" -#define PEXETMHLHSRZBuffer "ZBuffer" -#define PEXETMHLHSRPainters "Painters" -#define PEXETMHLHSRScanline "Scanline" -#define PEXETMHLHSRHiddenLineOnly "HiddenLineOnly" -#define PEXETMHLHSRZBufferID "ZBufferId" - -/* prompt echo types */ -#define PEXEchoPrimitive 1 -#define PEXEchoStructure 2 -#define PEXEchoNetwork 3 - -/* prompt echo type mnemonics */ -#define PEXETMEchoPrimitive "EchoPrimitive" -#define PEXETMEchoStructure "EchoStructure" -#define PEXETMEchoNetwork "EchoNetwork" - -/* display update methods */ -#define PEXVisualizeEach 1 -#define PEXVisualizeEasy 2 -#define PEXVisualizeNone 3 -#define PEXSimulateSome 4 -#define PEXVisualizeWhenever 5 - -/* display update method mnemonics */ -#define PEXETMVisualizeEach "VisualizeEach" -#define PEXETMVisualizeEasy "VisualizeEasy" -#define PEXETMVisualizeNone "VisualizeNone" -#define PEXETMSimulateSome "SimulateSome" -#define PEXETMVisualizeWhenever "VisualizeWhenever" - -/* color approximation types */ -#define PEXColorSpace 1 -#define PEXColorRange 2 - -/* color approximation type mnemonics */ -#define PEXETMColorSpace "ColorSpace" -#define PEXETMColorRange "ColorRange" - -/* color approximation models */ -#define PEXColorApproxRGB 1 -#define PEXColorApproxCIE 2 -#define PEXColorApproxHSV 3 -#define PEXColorApproxHLS 4 -#define PEXColorApproxYIQ 5 - -/* color approximation model mnemonics */ -#define PEXETMColorApproxRGB "RGB" -#define PEXETMColorApproxCIE "CIE" -#define PEXETMColorApproxHSV "HSV" -#define PEXETMColorApproxHLS "HLS" -#define PEXETMColorApproxYIQ "YIQ" - -/* rendering color models */ -#define PEXRenderingColorModelImpDep 0 -#define PEXRenderingColorModelRGB 1 -#define PEXRenderingColorModelCIE 2 -#define PEXRenderingColorModelHSV 3 -#define PEXRenderingColorModelHLS 4 - -/* rendering color model mnemonics */ - /* PEXETMRenderingColorModelImpDep is an implementation-dependent string */ -#define PEXETMRenderingColorModelRGB "RGB" -#define PEXETMRenderingColorModelCIE "CIE" -#define PEXETMRenderingColorModelHSV "HSV" -#define PEXETMRenderingColorModelHLS "HLS" - -/* parametric surface characteristics */ -#define PEXPSCNone 1 -#define PEXPSCImpDep 2 -#define PEXPSCIsoCurves 3 -#define PEXPSCMCLevelCurves 4 -#define PEXPSCWCLevelCurves 5 - -/* parametric surface characteristic mnemonics */ -#define PEXETMPSCNone "None" - /* PEXETMPSCImpDep is an implementation-dependent string */ -#define PEXETMPSCIsoCurves "IsoparametricCurves" -#define PEXETMPSCMCLevelCurves "MC_LevelCurves" -#define PEXETMPSCWCLevelCurves "WC_LevelCurves" - -/* standard escape identifiers */ -#define PEXEscapeSetEchoColor 1 - -/* standard escape identifier mnemonics */ -#define PEXETMEscapeSetEchoColor "SetEchoColor" - -/* pick one methods */ -#define PEXPickLast 1 -#define PEXPickClosestZ 2 -#define PEXPickVisibleAny 3 -#define PEXPickVisibleClosest 4 - -/* pick one method mnemonics */ -#define PEXETMPickLast "Last" -#define PEXETMPickClosestZ "ClosestZ" -#define PEXETMPickVisibleAny "VisibleAny" -#define PEXETMPickVisibleClosest "VisibleClosest" - -/* pick all methods */ -#define PEXPickAllAll 1 -#define PEXPickAllVisible 2 - -/* pick all method mnemonics */ -#define PEXETMPickAllAll "All" -#define PEXETMPickAllVisible "Visible" - - -/* - * implementation dependent constants - */ -#define PEXIDDitheringSupported 1 -#define PEXIDMaxEdgeWidth 2 -#define PEXIDMaxLineWidth 3 -#define PEXIDMaxMarkerSize 4 -#define PEXIDMaxModelClipPlanes 5 -#define PEXIDMaxNameSetNames 6 -#define PEXIDMaxNonAmbientLights 7 -#define PEXIDMaxNURBOrder 8 -#define PEXIDMaxTrimCurveOrder 9 -#define PEXIDMinEdgeWidth 10 -#define PEXIDMinLineWidth 11 -#define PEXIDMinMarkerSize 12 -#define PEXIDNominalEdgeWidth 13 -#define PEXIDNominalLineWidth 14 -#define PEXIDNominalMarkerSize 15 -#define PEXIDNumSupportedEdgeWidths 16 -#define PEXIDNumSupportedLineWidths 17 -#define PEXIDNumSupportedMarkerSizes 18 -#define PEXIDBestColorApprox 19 -#define PEXIDTransparencySupported 20 -#define PEXIDDoubleBufferingSupported 21 -#define PEXIDChromaticityRedU 22 -#define PEXIDChromaticityRedV 23 -#define PEXIDLuminanceRed 24 -#define PEXIDChromaticityGreenU 25 -#define PEXIDChromaticityGreenV 26 -#define PEXIDLuminanceGreen 27 -#define PEXIDChromaticityBlueU 28 -#define PEXIDChromaticityBlueV 29 -#define PEXIDLuminanceBlue 30 -#define PEXIDChromaticityWhiteU 31 -#define PEXIDChromaticityWhiteV 32 -#define PEXIDLuminanceWhite 33 -#define PEXIDMaxHitsEventSupported 34 - -/* values for PEXIDBestColorApprox */ -#define PEXColorApproxAnyValues 0 -#define PEXColorApproxPowersOf2 1 - -/* - * match rendering targets - */ -#define PEXAnyDrawable 0 -#define PEXWindowDrawable 1 -#define PEXPixmapDrawable 2 -#define PEXBufferDrawable 3 - - -/* - * output primitive and attribute values - */ - -/* shape hints */ -#define PEXShapeComplex 0 -#define PEXShapeNonConvex 1 -#define PEXShapeConvex 2 -#define PEXShapeUnknown 3 - -/* contour hints */ -#define PEXContourDisjoint 0 -#define PEXContourNested 1 -#define PEXContourIntersecting 2 -#define PEXContourUnknown 3 - -/* facet and vertex attributes bitmask */ -#define PEXGANone 0 -#define PEXGAColor (1L<<0) -#define PEXGANormal (1L<<1) -#define PEXGAEdges (1L<<2) - -/* flags (e.g., switches, visibility, and edges) */ -#define PEXOff 0 -#define PEXOn 1 - -/* HLHSR identifier for PEXHLHSRZBufferID HLHSR mode */ -#define PEXHLHSRIDDisable 0 -#define PEXHLHSRIDEnable 1 - -/* text path direction */ -#define PEXPathRight 0 -#define PEXPathLeft 1 -#define PEXPathUp 2 -#define PEXPathDown 3 - -/* text vertical alignment */ -#define PEXVAlignNormal 0 -#define PEXVAlignTop 1 -#define PEXVAlignCap 2 -#define PEXVAlignHalf 3 -#define PEXVAlignBase 4 -#define PEXVAlignBottom 5 - -/* text horizontal alignment */ -#define PEXHAlignNormal 0 -#define PEXHAlignLeft 1 -#define PEXHAlignCenter 2 -#define PEXHAlignRight 3 - -/* text precision */ -#define PEXStringPrecision 0 -#define PEXCharPrecision 1 -#define PEXStrokePrecision 2 - -/* character set width */ -#define PEXCSByte 0 -#define PEXCSShort 1 -#define PEXCSLong 2 - -/* curve and surface types */ -#define PEXRational 0 -#define PEXNonRational 1 - -/* clipping */ -#define PEXClipXY (1L<<0) -#define PEXClipBack (1L<<1) -#define PEXClipFront (1L<<2) -#define PEXClippingAll (PEXClipXY | PEXClipBack | PEXClipFront) - -#define PEXClip 0 -#define PEXNoClip 1 - -/* cull modes */ -#define PEXNone 0 -#define PEXBackFaces 1 -#define PEXFrontFaces 2 - -/* local transform composition types */ -#define PEXPreConcatenate 0 -#define PEXPostConcatenate 1 -#define PEXReplace 2 - -/* isoparametric curves placement types */ -#define PEXUniformPlacement 0 -#define PEXNonUniformPlacement 1 - -/* aspect source flags (ASFs) */ -#define PEXBundled 0 -#define PEXIndividual 1 - -/* mask values for setting ASFs */ -#define PEXASFMarkerType (1L<<0) -#define PEXASFMarkerScale (1L<<1) -#define PEXASFMarkerColor (1L<<2) -#define PEXASFTextFontIndex (1L<<3) -#define PEXASFTextPrec (1L<<4) -#define PEXASFCharExpansion (1L<<5) -#define PEXASFCharSpacing (1L<<6) -#define PEXASFTextColor (1L<<7) -#define PEXASFLineType (1L<<8) -#define PEXASFLineWidth (1L<<9) -#define PEXASFLineColor (1L<<10) -#define PEXASFCurveApprox (1L<<11) -#define PEXASFPolylineInterp (1L<<12) -#define PEXASFInteriorStyle (1L<<13) -#define PEXASFInteriorStyleIndex (1L<<14) -#define PEXASFSurfaceColor (1L<<15) -#define PEXASFSurfaceInterp (1L<<16) -#define PEXASFReflectionModel (1L<<17) -#define PEXASFReflectionAttr (1L<<18) -#define PEXASFBFInteriorStyle (1L<<19) -#define PEXASFBFInteriorStyleIndex (1L<<20) -#define PEXASFBFSurfaceColor (1L<<21) -#define PEXASFBFSurfaceInterp (1L<<22) -#define PEXASFBFReflectionModel (1L<<23) -#define PEXASFBFReflectionAttr (1L<<24) -#define PEXASFSurfaceApprox (1L<<25) -#define PEXASFSurfaceEdges (1L<<26) -#define PEXASFSurfaceEdgeType (1L<<27) -#define PEXASFSurfaceEdgeWidth (1L<<28) -#define PEXASFSurfaceEdgeColor (1L<<29) - - -/* - * resource identifier value when resource is referenced, but freed - */ -#define PEXAlreadyFreed 1 - - -/* - * pipeline context - */ - -/* pipeline context attributes bitmask shift values */ -#define PEXPCMarkerType 0 -#define PEXPCMarkerScale 1 -#define PEXPCMarkerColor 2 -#define PEXPCMarkerBundleIndex 3 -#define PEXPCTextFont 4 -#define PEXPCTextPrecision 5 -#define PEXPCCharExpansion 6 -#define PEXPCCharSpacing 7 -#define PEXPCTextColor 8 -#define PEXPCCharHeight 9 -#define PEXPCCharUpVector 10 -#define PEXPCTextPath 11 -#define PEXPCTextAlignment 12 -#define PEXPCATextHeight 13 -#define PEXPCATextUpVector 14 -#define PEXPCATextPath 15 -#define PEXPCATextAlignment 16 -#define PEXPCATextStyle 17 -#define PEXPCTextBundleIndex 18 -#define PEXPCLineType 19 -#define PEXPCLineWidth 20 -#define PEXPCLineColor 21 -#define PEXPCCurveApprox 22 -#define PEXPCPolylineInterp 23 -#define PEXPCLineBundleIndex 24 -#define PEXPCInteriorStyle 25 -#define PEXPCInteriorStyleIndex 26 -#define PEXPCSurfaceColor 27 -#define PEXPCReflectionAttr 28 -#define PEXPCReflectionModel 29 -#define PEXPCSurfaceInterp 30 -#define PEXPCBFInteriorStyle 31 - -#define PEXPCBFInteriorStyleIndex 32 -#define PEXPCBFSurfaceColor 33 -#define PEXPCBFReflectionAttr 34 -#define PEXPCBFReflectionModel 35 -#define PEXPCBFSurfaceInterp 36 -#define PEXPCSurfaceApprox 37 -#define PEXPCCullingMode 38 -#define PEXPCDistinguishFlag 39 -#define PEXPCPatternSize 40 -#define PEXPCPatternRefPoint 41 -#define PEXPCPatternRefVec1 42 -#define PEXPCPatternRefVec2 43 -#define PEXPCInteriorBundleIndex 44 -#define PEXPCSurfaceEdgeFlag 45 -#define PEXPCSurfaceEdgeType 46 -#define PEXPCSurfaceEdgeWidth 47 -#define PEXPCSurfaceEdgeColor 48 -#define PEXPCEdgeBundleIndex 49 -#define PEXPCLocalTransform 50 -#define PEXPCGlobalTransform 51 -#define PEXPCModelClip 52 -#define PEXPCModelClipVolume 53 -#define PEXPCViewIndex 54 -#define PEXPCLightState 55 -#define PEXPCDepthCueIndex 56 -#define PEXPCASFValues 57 -#define PEXPCPickID 58 -#define PEXPCHLHSRIdentifier 59 -#define PEXPCNameSet 60 -#define PEXPCColorApproxIndex 61 -#define PEXPCRenderingColorModel 62 -#define PEXPCParaSurfCharacteristics 63 -#define PEXPCMaxShift 63 - - -/* - * renderer and renderer picking - */ - -/* renderer state */ -#define PEXIdle 0 -#define PEXRendering 1 -#define PEXPicking 2 - -/* renderer dynamics */ -#define PEXDynamic 0 -#define PEXNotDynamic 1 - -/* renderer echo modes */ -#define PEXNoEcho 0 -#define PEXEcho 1 -#define PEXUnEcho 2 - -/* renderer attributes bitmask */ -#define PEXRAPipelineContext (1L<<0) -#define PEXRACurrentPath (1L<<1) -#define PEXRAMarkerBundle (1L<<2) -#define PEXRATextBundle (1L<<3) -#define PEXRALineBundle (1L<<4) -#define PEXRAInteriorBundle (1L<<5) -#define PEXRAEdgeBundle (1L<<6) -#define PEXRAViewTable (1L<<7) -#define PEXRAColorTable (1L<<8) -#define PEXRADepthCueTable (1L<<9) -#define PEXRALightTable (1L<<10) -#define PEXRAColorApproxTable (1L<<11) -#define PEXRAPatternTable (1L<<12) -#define PEXRATextFontTable (1L<<13) -#define PEXRAHighlightIncl (1L<<14) -#define PEXRAHighlightExcl (1L<<15) -#define PEXRAInvisibilityIncl (1L<<16) -#define PEXRAInvisibilityExcl (1L<<17) -#define PEXRARendererState (1L<<18) -#define PEXRAHLHSRMode (1L<<19) -#define PEXRANPCSubVolume (1L<<20) -#define PEXRAViewport (1L<<21) -#define PEXRAClipList (1L<<22) -#define PEXRAPickIncl (1L<<23) -#define PEXRAPickExcl (1L<<24) -#define PEXRAPickStartPath (1L<<25) -#define PEXRABackgroundColor (1L<<26) -#define PEXRAClearImage (1L<<27) -#define PEXRAClearZ (1L<<28) -#define PEXRAEchoMode (1L<<29) -#define PEXRAMaxShift 29 - -/* renderer dynamics bitmask */ -/* tables */ -#define PEXRDTMarkerBundle (1L<<0) -#define PEXRDTTextBundle (1L<<1) -#define PEXRDTLineBundle (1L<<2) -#define PEXRDTInteriorBundle (1L<<3) -#define PEXRDTEdgeBundle (1L<<4) -#define PEXRDTViewTable (1L<<5) -#define PEXRDTColorTable (1L<<6) -#define PEXRDTDepthCueTable (1L<<7) -#define PEXRDTLightTable (1L<<8) -#define PEXRDTColorApproxTable (1L<<9) -#define PEXRDTPatternTable (1L<<10) -#define PEXRDTTextFontTable (1L<<11) -#define PEXRDTMarkerBundleContents (1L<<16) -#define PEXRDTTextBundleContents (1L<<17) -#define PEXRDTLineBundleContents (1L<<18) -#define PEXRDTInteriorBundleContents (1L<<19) -#define PEXRDTEdgeBundleContents (1L<<20) -#define PEXRDTViewTableContents (1L<<21) -#define PEXRDTColorTableContents (1L<<22) -#define PEXRDTDepthCueTableContents (1L<<23) -#define PEXRDTLightTableContents (1L<<24) -#define PEXRDTColorApproxContents (1L<<25) -#define PEXRDTPatternTableContents (1L<<26) -#define PEXRDTTextFontTableContents (1L<<27) -/* name sets */ -#define PEXRDNHighlightNameSet (1L<<0) -#define PEXRDNInvisibilityNameSet (1L<<1) -#define PEXRDNPickNameSet (1L<<2) -#define PEXRDNHighlightNameSetContents (1L<<16) -#define PEXRDNInvisibilityNameSetContents (1L<<17) -#define PEXRDNPickNameSetContents (1L<<18) -/* attributes */ -#define PEXRDAHLHSRMode (1L<<0) -#define PEXRDANPCSubVolume (1L<<1) -#define PEXRDAViewport (1L<<2) -#define PEXRDAClipList (1L<<3) -#define PEXRDAEchoMode (1L<<4) - -/* renderer pick status */ -#define PEXNoPick 0 -#define PEXPick 1 -#define PEXAbortedPick 2 - - -/* - * name set - */ - -/* name set changes */ -#define PEXNSAdd 0 -#define PEXNSRemove 1 -#define PEXNSReplace 2 - - -/* - * look up table - */ - -/* table types */ -#define PEXLUTLineBundle 1 -#define PEXLUTMarkerBundle 2 -#define PEXLUTTextBundle 3 -#define PEXLUTInteriorBundle 4 -#define PEXLUTEdgeBundle 5 -#define PEXLUTPattern 6 -#define PEXLUTTextFont 7 -#define PEXLUTColor 8 -#define PEXLUTView 9 -#define PEXLUTLight 10 -#define PEXLUTDepthCue 11 -#define PEXLUTColorApprox 12 - -/* status in PEXGetTableEntry */ -#define PEXDefaultEntry 0 -#define PEXDefinedEntry 1 - -/* return type in PEXGetTableEntry and PEXGetTableEntries */ -#define PEXSetValue 0 -#define PEXRealizedValue 1 - - -/* - * structure - */ - -/* structure editing mode */ -#define PEXStructureInsert 0 -#define PEXStructureReplace 1 - -/* whence in structure element ranges */ -#define PEXBeginning 0 -#define PEXCurrent 1 -#define PEXEnd 2 - -/* structure info */ -#define PEXElementPtr (1L<<0) -#define PEXNumElements (1L<<1) -#define PEXLengthStructure (1L<<2) -#define PEXHasRefs (1L<<3) -#define PEXEditMode (1L<<4) - -/* structures in network */ -#define PEXAll 0 -#define PEXOrphans 1 - -/* ancestors and descendents*/ -#define PEXTopPart 0 -#define PEXBottomPart 1 - -/* element search */ -#define PEXForward 0 -#define PEXBackward 1 - -/* element info bitmask */ -#define PEXElementType (1L<<0) -#define PEXElementSize (1L<<1) -#define PEXElementData (1L<<2) - - -/* - * search context - */ - -/* element search status */ -#define PEXNotFound 1 -#define PEXFound 2 - -/* search context attributes bitmask */ -#define PEXSCPosition (1L<<0) -#define PEXSCDistance (1L<<1) -#define PEXSCCeiling (1L<<2) -#define PEXSCModelClipFlag (1L<<3) -#define PEXSCStartPath (1L<<4) -#define PEXSCNormalList (1L<<5) -#define PEXSCInvertedList (1L<<6) -#define PEXSCMaxShift 6 - - -/* - * PHIGS workstation - */ - -/* workstation update state */ -#define PEXNotPending 0 -#define PEXPending 1 - -/* workstation visual state */ -#define PEXCorrect 0 -#define PEXDeferred 1 -#define PEXSimulated 2 - -/* workstation display state */ -#define PEXEmpty 0 -#define PEXNotEmpty 1 - -/* workstation buffer mode */ -#define PEXSingleBuffered 0 -#define PEXDoubleBuffered 1 - -/* workstation dynamics */ -#define PEXIMM 0 -#define PEXIRG 1 -#define PEXCBS 2 - -/* workstation structure posting priorities */ -#define PEXHigher 0 -#define PEXLower 1 - -/* workstation attributes bitmask shift values */ -#define PEXPWDisplayUpdate 0 -#define PEXPWVisualState 1 -#define PEXPWDisplaySurface 2 -#define PEXPWViewUpdate 3 -#define PEXPWDefinedViews 4 -#define PEXPWWorkstationUpdate 5 -#define PEXPWReqNPCSubVolume 6 -#define PEXPWCurNPCSubVolume 7 -#define PEXPWReqViewport 8 -#define PEXPWCurViewport 9 -#define PEXPWHLHSRUpdate 10 -#define PEXPWReqHLHSRMode 11 -#define PEXPWCurHLHSRMode 12 -#define PEXPWDrawable 13 -#define PEXPWMarkerBundle 14 -#define PEXPWTextBundle 15 -#define PEXPWLineBundle 16 -#define PEXPWInteriorBundle 17 -#define PEXPWEdgeBundle 18 -#define PEXPWColorTable 19 -#define PEXPWDepthCueTable 20 -#define PEXPWLightTable 21 -#define PEXPWColorApproxTable 22 -#define PEXPWPatternTable 23 -#define PEXPWTextFontTable 24 -#define PEXPWHighlightIncl 25 -#define PEXPWHighlightExcl 26 -#define PEXPWInvisibilityIncl 27 -#define PEXPWInvisibilityExcl 28 -#define PEXPWPostedStructures 29 -#define PEXPWNumPriorities 30 -#define PEXPWBufferUpdate 31 - -#define PEXPWReqBufferMode 32 -#define PEXPWCurBufferMode 33 -#define PEXPWMaxShift 33 - -/* values for indices to returned workstation dynamics */ -#define PEXPWDViewRep 0 -#define PEXPWDMarkerBundle 1 -#define PEXPWDTextBundle 2 -#define PEXPWDLineBundle 3 -#define PEXPWDInteriorBundle 4 -#define PEXPWDEdgeBundle 5 -#define PEXPWDColorTable 6 -#define PEXPWDPatternTable 7 -#define PEXPWDWorkstationTransform 8 -#define PEXPWDHighlightFilter 9 -#define PEXPWDInvisibilityFilter 10 -#define PEXPWDHLHSRMode 11 -#define PEXPWDStructureModify 12 -#define PEXPWDPostStructure 13 -#define PEXPWDUnpostStructure 14 -#define PEXPWDDeleteStructure 15 -#define PEXPWDReferenceModify 16 -#define PEXPWDBufferModify 17 -#define PEXPWDLightTable 18 -#define PEXPWDDepthCueTable 19 -#define PEXPWDColorApproxTable 20 - - -/* - * workstation picking - */ - -/* workstation pick status */ - /* PEXNoPick defined the same as for renderer pick */ - /* PEXPick defined the same as for renderer pick */ - -/* pick echo modes */ - /* PEXNoEcho defined the same as for renderer echo */ - /* PEXEcho defined the same as for renderer echo */ - -/* pick path order */ -#define PEXTopFirst 0 -#define PEXBottomFirst 1 - -/* pick all, more hits flag */ -#define PEXMoreHits 0 -#define PEXNoMoreHits 1 -#define PEXMayBeMoreHits 2 - -/* workstation pick device attributes bitmask */ -#define PEXPDPickStatus (1L<<0) -#define PEXPDPickPath (1L<<1) -#define PEXPDPickPathOrder (1L<<2) -#define PEXPDPickIncl (1L<<3) -#define PEXPDPickExcl (1L<<4) -#define PEXPDPickDataRec (1L<<5) -#define PEXPDPromptEchoType (1L<<6) -#define PEXPDEchoVolume (1L<<7) -#define PEXPDEchoSwitch (1L<<8) -#define PEXPDMaxShift 8 - -/* workstation pick measure attributes bitmask */ -#define PEXPMStatus (1L<<0) -#define PEXPMPath (1L<<1) -#define PEXPMMaxShift 1 - -/* - * events - */ -#define PEXMaxHitsReached 0 -#define PEXMaxEvent 0 - - -/* - * errors - */ -#define BadPEXColorType 0 -#define BadPEXRendererState 1 -#define BadPEXFloatingPointFormat 2 -#define BadPEXLabel 3 -#define BadPEXLookupTable 4 -#define BadPEXNameSet 5 -#define BadPEXPath 6 -#define BadPEXFont 7 -#define BadPEXWorkstation 8 -#define BadPEXPickMeasure 9 -#define BadPEXPipelineContext 10 -#define BadPEXRenderer 11 -#define BadPEXSearchContext 12 -#define BadPEXStructure 13 -#define BadPEXOutputCommand 14 -#define PEXMaxError 14 - - -/* - * protocol output command codes - */ -#define PEXOCAll 0 -#define PEXOCMarkerType 1 -#define PEXOCMarkerScale 2 -#define PEXOCMarkerColorIndex 3 -#define PEXOCMarkerColor 4 -#define PEXOCMarkerBundleIndex 5 -#define PEXOCTextFontIndex 6 -#define PEXOCTextPrecision 7 -#define PEXOCCharExpansion 8 -#define PEXOCCharSpacing 9 -#define PEXOCTextColorIndex 10 -#define PEXOCTextColor 11 -#define PEXOCCharHeight 12 -#define PEXOCCharUpVector 13 -#define PEXOCTextPath 14 -#define PEXOCTextAlignment 15 -#define PEXOCATextHeight 16 -#define PEXOCATextUpVector 17 -#define PEXOCATextPath 18 -#define PEXOCATextAlignment 19 -#define PEXOCATextStyle 20 -#define PEXOCTextBundleIndex 21 -#define PEXOCLineType 22 -#define PEXOCLineWidth 23 -#define PEXOCLineColorIndex 24 -#define PEXOCLineColor 25 -#define PEXOCCurveApprox 26 -#define PEXOCPolylineInterpMethod 27 -#define PEXOCLineBundleIndex 28 -#define PEXOCInteriorStyle 29 -#define PEXOCInteriorStyleIndex 30 -#define PEXOCSurfaceColorIndex 31 -#define PEXOCSurfaceColor 32 -#define PEXOCReflectionAttributes 33 -#define PEXOCReflectionModel 34 -#define PEXOCSurfaceInterpMethod 35 -#define PEXOCBFInteriorStyle 36 -#define PEXOCBFInteriorStyleIndex 37 -#define PEXOCBFSurfaceColorIndex 38 -#define PEXOCBFSurfaceColor 39 -#define PEXOCBFReflectionAttributes 40 -#define PEXOCBFReflectionModel 41 -#define PEXOCBFSurfaceInterpMethod 42 -#define PEXOCSurfaceApprox 43 -#define PEXOCFacetCullingMode 44 -#define PEXOCFacetDistinguishFlag 45 -#define PEXOCPatternSize 46 -#define PEXOCPatternAttributes2D 47 -#define PEXOCPatternAttributes 48 -#define PEXOCInteriorBundleIndex 49 -#define PEXOCSurfaceEdgeFlag 50 -#define PEXOCSurfaceEdgeType 51 -#define PEXOCSurfaceEdgeWidth 52 -#define PEXOCSurfaceEdgeColorIndex 53 -#define PEXOCSurfaceEdgeColor 54 -#define PEXOCEdgeBundleIndex 55 -#define PEXOCIndividualASF 56 -#define PEXOCLocalTransform 57 -#define PEXOCLocalTransform2D 58 -#define PEXOCGlobalTransform 59 -#define PEXOCGlobalTransform2D 60 -#define PEXOCModelClipFlag 61 -#define PEXOCModelClipVolume 62 -#define PEXOCModelClipVolume2D 63 -#define PEXOCRestoreModelClipVolume 64 -#define PEXOCViewIndex 65 -#define PEXOCLightSourceState 66 -#define PEXOCDepthCueIndex 67 -#define PEXOCPickID 68 -#define PEXOCHLHSRID 69 -#define PEXOCColorApproxIndex 70 -#define PEXOCRenderingColorModel 71 -#define PEXOCParaSurfCharacteristics 72 -#define PEXOCAddToNameSet 73 -#define PEXOCRemoveFromNameSet 74 -#define PEXOCExecuteStructure 75 -#define PEXOCLabel 76 -#define PEXOCApplicationData 77 -#define PEXOCGSE 78 -#define PEXOCMarkers 79 -#define PEXOCMarkers2D 80 -#define PEXOCText 81 -#define PEXOCText2D 82 -#define PEXOCAnnotationText 83 -#define PEXOCAnnotationText2D 84 -#define PEXOCPolyline 85 -#define PEXOCPolyline2D 86 -#define PEXOCPolylineSetWithData 87 -#define PEXOCNURBCurve 88 -#define PEXOCFillArea 89 -#define PEXOCFillArea2D 90 -#define PEXOCFillAreaWithData 91 -#define PEXOCFillAreaSet 92 -#define PEXOCFillAreaSet2D 93 -#define PEXOCFillAreaSetWithData 94 -#define PEXOCTriangleStrip 95 -#define PEXOCQuadrilateralMesh 96 -#define PEXOCSetOfFillAreaSets 97 -#define PEXOCNURBSurface 98 -#define PEXOCCellArray 99 -#define PEXOCCellArray2D 100 -#define PEXOCExtendedCellArray 101 -#define PEXOCGDP 102 -#define PEXOCGDP2D 103 -#define PEXOCNoop 104 -#define PEXOCNil 0xffff - - -/* - * protocol request codes - */ -#define PEXRCGetExtensionInfo 1 -#define PEXRCGetEnumTypeInfo 2 -#define PEXRCGetImpDepConstants 3 -#define PEXRCCreateLookupTable 4 -#define PEXRCCopyLookupTable 5 -#define PEXRCFreeLookupTable 6 -#define PEXRCGetTableInfo 7 -#define PEXRCGetPredefinedEntries 8 -#define PEXRCGetDefinedIndices 9 -#define PEXRCGetTableEntry 10 -#define PEXRCGetTableEntries 11 -#define PEXRCSetTableEntries 12 -#define PEXRCDeleteTableEntries 13 -#define PEXRCCreatePipelineContext 14 -#define PEXRCCopyPipelineContext 15 -#define PEXRCFreePipelineContext 16 -#define PEXRCGetPipelineContext 17 -#define PEXRCChangePipelineContext 18 -#define PEXRCCreateRenderer 19 -#define PEXRCFreeRenderer 20 -#define PEXRCChangeRenderer 21 -#define PEXRCGetRendererAttributes 22 -#define PEXRCGetRendererDynamics 23 -#define PEXRCBeginRendering 24 -#define PEXRCEndRendering 25 -#define PEXRCBeginStructure 26 -#define PEXRCEndStructure 27 -#define PEXRCRenderOutputCommands 28 -#define PEXRCRenderNetwork 29 -#define PEXRCCreateStructure 30 -#define PEXRCCopyStructure 31 -#define PEXRCDestroyStructures 32 -#define PEXRCGetStructureInfo 33 -#define PEXRCGetElementInfo 34 -#define PEXRCGetStructuresInNetwork 35 -#define PEXRCGetAncestors 36 -#define PEXRCGetDescendants 37 -#define PEXRCFetchElements 38 -#define PEXRCSetEditingMode 39 -#define PEXRCSetElementPointer 40 -#define PEXRCSetElementPointerAtLabel 41 -#define PEXRCElementSearch 42 -#define PEXRCStoreElements 43 -#define PEXRCDeleteElements 44 -#define PEXRCDeleteElementsToLabel 45 -#define PEXRCDeleteBetweenLabels 46 -#define PEXRCCopyElements 47 -#define PEXRCChangeStructureRefs 48 -#define PEXRCCreateNameSet 49 -#define PEXRCCopyNameSet 50 -#define PEXRCFreeNameSet 51 -#define PEXRCGetNameSet 52 -#define PEXRCChangeNameSet 53 -#define PEXRCCreateSearchContext 54 -#define PEXRCCopySearchContext 55 -#define PEXRCFreeSearchContext 56 -#define PEXRCGetSearchContext 57 -#define PEXRCChangeSearchContext 58 -#define PEXRCSearchNetwork 59 -#define PEXRCCreateWorkstation 60 -#define PEXRCFreeWorkstation 61 -#define PEXRCGetWorkstationAttributes 62 -#define PEXRCGetWorkstationDynamics 63 -#define PEXRCGetWorkstationViewRep 64 -#define PEXRCRedrawAllStructures 65 -#define PEXRCUpdateWorkstation 66 -#define PEXRCRedrawClipRegion 67 -#define PEXRCExecuteDeferredActions 68 -#define PEXRCSetWorkstationViewPriority 69 -#define PEXRCSetWorkstationDisplayUpdateMode 70 -#define PEXRCMapDCtoWC 71 -#define PEXRCMapWCtoDC 72 -#define PEXRCSetWorkstationViewRep 73 -#define PEXRCSetWorkstationWindow 74 -#define PEXRCSetWorkstationViewport 75 -#define PEXRCSetWorkstationHLHSRMode 76 -#define PEXRCSetWorkstationBufferMode 77 -#define PEXRCPostStructure 78 -#define PEXRCUnpostStructure 79 -#define PEXRCUnpostAllStructures 80 -#define PEXRCGetWorkstationPostings 81 -#define PEXRCGetPickDevice 82 -#define PEXRCChangePickDevice 83 -#define PEXRCCreatePickMeasure 84 -#define PEXRCFreePickMeasure 85 -#define PEXRCGetPickMeasure 86 -#define PEXRCUpdatePickMeasure 87 -#define PEXRCLoadFont 88 -#define PEXRCUnloadFont 89 -#define PEXRCQueryFont 90 -#define PEXRCListFonts 91 -#define PEXRCListFontsWithInfo 92 -#define PEXRCQueryTextExtents 93 -#define PEXRCMatchRenderingTargets 94 -#define PEXRCEscape 95 -#define PEXRCEscapeWithReply 96 -#define PEXRCRenderElements 97 -#define PEXRCAccumulateState 98 -#define PEXRCBeginPickOne 99 -#define PEXRCEndPickOne 100 -#define PEXRCPickOne 101 -#define PEXRCBeginPickAll 102 -#define PEXRCEndPickAll 103 -#define PEXRCPickAll 104 - -#endif /* _PEX_H_ */ Index: xc/lib/PEX5/PEX5-def.cpp diff -u xc/lib/PEX5/PEX5-def.cpp:1.1.1.3 xc/lib/PEX5/PEX5-def.cpp:removed --- xc/lib/PEX5/PEX5-def.cpp:1.1.1.3 Tue Jan 16 17:06:18 2001 +++ xc/lib/PEX5/PEX5-def.cpp Sat Feb 28 21:41:20 2004 @@ -1,283 +0,0 @@ -LIBRARY PEX5 -VERSION LIBRARY_VERSION -EXPORTS - PEXAccumulateState - PEXAddToNameSet - PEXAnnotationText - PEXAnnotationText2D - PEXApplicationData - PEXBeginPickAll - PEXBeginPickOne - PEXBeginRendering - PEXBeginStructure - PEXBuildTransform - PEXBuildTransform2D - PEXCellArray - PEXCellArray2D - PEXChangeNameSet - PEXChangePickDevice - PEXChangePipelineContext - PEXChangeRenderer - PEXChangeSearchContext - PEXChangeStructureRefs - PEXCopyBytesToOC - PEXCopyElements - PEXCopyLookupTable - PEXCopyNameSet - PEXCopyPipelineContext - PEXCopySearchContext - PEXCopyStructure - PEXCountOCs - PEXCreateLookupTable - PEXCreateNameSet - PEXCreatePickMeasure - PEXCreatePipelineContext - PEXCreateRenderer - PEXCreateSearchContext - PEXCreateStructure - PEXCreateWorkstation - PEXDecodeOCs - PEXDeleteBetweenLabels - PEXDeleteElements - PEXDeleteTableEntries - PEXDeleteToLabel - PEXDestroyStructures - PEXElementSearch - PEXEncodeOCs - PEXEncodedAnnoText - PEXEncodedAnnoText2D - PEXEncodedText - PEXEncodedText2D - PEXEndPickAll - PEXEndPickOne - PEXEndRendering - PEXEndStructure - PEXEscape - PEXEscapeWithReply - PEXExecuteDeferredActions - PEXExecuteStructure - PEXExtendedCellArray - PEXFetchElements - PEXFetchElementsAndSend - PEXFillArea - PEXFillArea2D - PEXFillAreaSet - PEXFillAreaSet2D - PEXFillAreaSetWithData - PEXFillAreaWithData - PEXFinishOCs - PEXFreeEnumInfo - PEXFreeFontInfo - PEXFreeFontNames - PEXFreeLookupTable - PEXFreeNameSet - PEXFreeOCData - PEXFreePCAttributes - PEXFreePDAttributes - PEXFreePMAttributes - PEXFreePickMeasure - PEXFreePickPaths - PEXFreePipelineContext - PEXFreeRenderer - PEXFreeRendererAttributes - PEXFreeSCAttributes - PEXFreeSearchContext - PEXFreeStructurePaths - PEXFreeTableEntries - PEXFreeWorkstation - PEXFreeWorkstationAttributes - PEXGDP - PEXGDP2D - PEXGSE - PEXGeoNormFillArea - PEXGeoNormFillAreaSet - PEXGeoNormQuadrilateralMesh - PEXGeoNormSetOfFillAreaSets - PEXGeoNormTriangleStrip - PEXGetAncestors - PEXGetDefinedIndices - PEXGetDescendants - PEXGetElementInfo - PEXGetEnumTypeInfo - PEXGetExtensionInfo - PEXGetImpDepConstants - PEXGetNameSet - PEXGetOCAddr - PEXGetPickDevice - PEXGetPickMeasure - PEXGetPipelineContext - PEXGetPredefinedEntries - PEXGetProtocolFloatFormat - PEXGetRendererAttributes - PEXGetRendererDynamics - PEXGetSearchContext - PEXGetSizeOCs - PEXGetStructureInfo - PEXGetStructuresInNetwork - PEXGetTableEntries - PEXGetTableEntry - PEXGetTableInfo - PEXGetWorkstationAttributes - PEXGetWorkstationDynamics - PEXGetWorkstationPostings - PEXGetWorkstationViewRep - PEXIdentityMatrix - PEXIdentityMatrix2D - PEXInitialize - PEXInvertMatrix - PEXInvertMatrix2D - PEXLabel - PEXListFonts - PEXListFontsWithInfo - PEXLoadFont - PEXLookAtViewMatrix - PEXMapDCToWC - PEXMapWCToDC - PEXMapXCToNPC - PEXMapXCToNPC2D - PEXMarkers - PEXMarkers2D - PEXMatchRenderingTargets - PEXMatrixMult - PEXMatrixMult2D - PEXNPCToXCTransform - PEXNPCToXCTransform2D - PEXNURBCurve - PEXNURBSurface - PEXNoop - PEXNormalizeVectors - PEXNormalizeVectors2D - PEXOrthoProjMatrix - PEXPerspProjMatrix - PEXPickAll - PEXPickOne - PEXPolarViewMatrix - PEXPolyline - PEXPolyline2D - PEXPolylineSetWithData - PEXPostStructure - PEXQuadrilateralMesh - PEXQueryEncodedTextExtents - PEXQueryFont - PEXQueryTextExtents - PEXRedrawAllStructures - PEXRedrawClipRegion - PEXRemoveFromNameSet - PEXRenderElements - PEXRenderNetwork - PEXRestoreModelClipVolume - PEXRotate - PEXRotate2D - PEXRotateGeneral - PEXScale - PEXScale2D - PEXSearchNetwork - PEXSendOCs - PEXSetATextAlignment - PEXSetATextHeight - PEXSetATextPath - PEXSetATextStyle - PEXSetATextUpVector - PEXSetBFInteriorStyle - PEXSetBFInteriorStyleIndex - PEXSetBFReflectionAttributes - PEXSetBFReflectionModel - PEXSetBFSurfaceColor - PEXSetBFSurfaceColorIndex - PEXSetBFSurfaceInterpMethod - PEXSetCharExpansion - PEXSetCharHeight - PEXSetCharSpacing - PEXSetCharUpVector - PEXSetColorApproxIndex - PEXSetCurveApprox - PEXSetDepthCueIndex - PEXSetEchoColor - PEXSetEdgeBundleIndex - PEXSetEditingMode - PEXSetElementPtr - PEXSetElementPtrAtLabel - PEXSetFacetCullingMode - PEXSetFacetDistinguishFlag - PEXSetGlobalTransform - PEXSetGlobalTransform2D - PEXSetHLHSRID - PEXSetIndividualASF - PEXSetInteriorBundleIndex - PEXSetInteriorStyle - PEXSetInteriorStyleIndex - PEXSetLightSourceState - PEXSetLineBundleIndex - PEXSetLineColor - PEXSetLineColorIndex - PEXSetLineType - PEXSetLineWidth - PEXSetLocalTransform - PEXSetLocalTransform2D - PEXSetMarkerBundleIndex - PEXSetMarkerColor - PEXSetMarkerColorIndex - PEXSetMarkerScale - PEXSetMarkerType - PEXSetModelClipFlag - PEXSetModelClipVolume - PEXSetModelClipVolume2D - PEXSetOfFillAreaSets - PEXSetParaSurfCharacteristics - PEXSetPatternAttributes - PEXSetPatternAttributes2D - PEXSetPatternSize - PEXSetPickID - PEXSetPolylineInterpMethod - PEXSetReflectionAttributes - PEXSetReflectionModel - PEXSetRenderingColorModel - PEXSetSurfaceApprox - PEXSetSurfaceColor - PEXSetSurfaceColorIndex - PEXSetSurfaceEdgeColor - PEXSetSurfaceEdgeColorIndex - PEXSetSurfaceEdgeFlag - PEXSetSurfaceEdgeType - PEXSetSurfaceEdgeWidth - PEXSetSurfaceInterpMethod - PEXSetTableEntries - PEXSetTextAlignment - PEXSetTextBundleIndex - PEXSetTextColor - PEXSetTextColorIndex - PEXSetTextFontIndex - PEXSetTextPath - PEXSetTextPrecision - PEXSetViewIndex - PEXSetWorkstationBufferMode - PEXSetWorkstationDisplayUpdateMode - PEXSetWorkstationHLHSRMode - PEXSetWorkstationViewPriority - PEXSetWorkstationViewRep - PEXSetWorkstationViewport - PEXSetWorkstationWindow - PEXStartOCs - PEXText - PEXText2D - PEXTransformPoints - PEXTransformPoints2D - PEXTransformPoints2DH - PEXTransformPoints4D - PEXTransformVectors - PEXTransformVectors2D - PEXTranslate - PEXTranslate2D - PEXTriangleStrip - PEXUnloadFont - PEXUnpostAllStructures - PEXUnpostStructure - PEXUpdatePickMeasure - PEXUpdateWorkstation - PEXViewMappingMatrix - PEXViewMappingMatrix2D - PEXViewOrientationMatrix - PEXViewOrientationMatrix2D - PEXXCToNPCTransform - PEXXCToNPCTransform2D -/* $Xorg: PEX5-def.cpp,v 1.3 2000/08/17 19:44:20 cpqbld Exp $ */ Index: xc/lib/PEX5/PEXlib.h diff -u xc/lib/PEX5/PEXlib.h:1.1.1.2 xc/lib/PEX5/PEXlib.h:removed --- xc/lib/PEX5/PEXlib.h:1.1.1.2 Tue Jan 16 17:06:18 2001 +++ xc/lib/PEX5/PEXlib.h Sat Feb 28 21:41:20 2004 @@ -1,4426 +0,0 @@ -#ifndef _PEXLIB_H_ -#define _PEXLIB_H_ - -/* $Xorg: PEXlib.h,v 1.3 2000/08/17 19:44:20 cpqbld Exp $ */ - -/******************************************************************************/ -/* Copyright 1987,1991 by Digital Equipment Corporation, Maynard, Mass. */ -/* */ -/* (c) Copyright Hewlett-Packard Company, 1992, Fort Collins, Colorado */ -/* */ -/* All Rights Reserved */ -/* */ -/* Permission to use, copy, modify, and distribute this software and its */ -/* documentation for any purpose and without fee is hereby granted, */ -/* provided that the above copyright notices appear in all copies and that */ -/* both the copyright notices and this permission notice appear in */ -/* supporting documentation, and that the names of Digital or */ -/* Hewlett-Packard not be used in advertising or publicity pertaining to */ -/* distribution of the software without specific, written prior permission. */ -/* */ -/* DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */ -/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL */ -/* DIGITAL 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. */ -/* */ -/* HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS */ -/* SOFTWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard */ -/* shall not be liable for errors contained herein or direct, indirect, */ -/* special, incidental or consequential damages in connection with the */ -/* furnishing, performance or use of this software. */ -/* */ -/******************************************************************************/ - -#include -#include -#include - -/* - * floating point min and max values - */ -#define PEXMinFloatIeee_754_32 1.40129846432481707e-45 -#define PEXMaxFloatIeee_754_32 3.40282346638528860e+38 -#define PEXMinFloatIeee_754_64 4.94065645841246544e-324 -#define PEXMaxFloatIeee_754_64 1.797693134862315708e+308 - -/* - * constants for PEXInitiliaze - failure return values and error string length - */ -#define PEXBadExtension 1 -#define PEXBadProtocolVersion 2 -#define PEXBadFloatConversion 3 -#define PEXBadLocalAlloc 4 - -#define PEXErrorStringLength 80 - - -/* - * type definitions - */ -typedef XID PEXFont; -typedef XID PEXLookupTable; -typedef XID PEXNameSet; -typedef XID PEXPickMeasure; -typedef XID PEXPipelineContext; -typedef XID PEXRenderer; -typedef XID PEXSearchContext; -typedef XID PEXStructure; -typedef XID PEXWorkstation; - -typedef unsigned long PEXBitmask; -typedef unsigned short PEXBitmaskShort; -typedef short PEXColorType; -typedef unsigned char PEXContourHint; -typedef unsigned short PEXCoordType; -typedef short PEXComposition; -typedef unsigned short PEXCullMode; -typedef unsigned char PEXDynamicType; -typedef short PEXEnumTypeIndex; -typedef float PEXMatrix[4][4]; -typedef float PEXMatrix3x3[3][3]; -typedef unsigned long PEXName; -typedef int PEXOCRequestType; -typedef unsigned short PEXShapeHint; -typedef unsigned char PEXSwitch; -typedef unsigned short PEXTableIndex; -typedef unsigned short PEXTypeOrTableIndex; - -#if NeedFunctionPrototypes -typedef void *PEXPointer; -#else -typedef char *PEXPointer; -#endif - - -/* - * PEX extension information - */ -typedef struct { - unsigned short major_version; - unsigned short minor_version; - unsigned long release; - unsigned long subset_info; - char *vendor_name; - int major_opcode; - int first_event; - int first_error; -} PEXExtensionInfo; - -/* - * enumerated type information - */ -typedef struct { - PEXEnumTypeIndex index; - char *descriptor; /* null terminated string */ -} PEXEnumTypeDesc; - -/* - * implementation dependent constants - */ -typedef union { - unsigned long integer; - float flt_point; -} PEXImpDepConstant; - -/* - * match rendering targets - */ -typedef struct { - int depth; - int type; - Visual *visual; -} PEXRenderingTarget; - - -/* - * output primitive and attribute - */ - -/* output command request types */ -#define PEXOCRender 0 -#define PEXOCStore 1 -#define PEXOCRenderSingle 2 -#define PEXOCStoreSingle 3 - -/* coordinates */ -typedef struct { - float x; - float y; - float z; -} PEXCoord; - -typedef struct { - float x; - float y; -} PEXCoord2D; - -typedef struct { - float x; - float y; - float z; - float w; -} PEXCoord4D; - -/* coordinate lists without data */ -typedef struct { - unsigned long count; /* number of points */ - PEXCoord2D *points; -} PEXListOfCoord2D; /* Pointer to an array of 2D points */ - -typedef struct { - unsigned long count; /* number of points */ - PEXCoord *points; -} PEXListOfCoord; /* Pointer to an array of 3D points */ - -typedef struct { - unsigned long count; /* number of points */ - PEXCoord4D *points; -} PEXListOfCoord4D; /* Pointer to an array of 4D points */ - -typedef union { - PEXCoord2D *point_2d; - PEXCoord *point; - PEXCoord4D *point_4d; -} PEXArrayOfCoord; /* Pointer to array of points */ - -/* colors */ -typedef struct { - float red; - float green; - float blue; -} PEXColorRGB; - -typedef struct { - float hue; - float saturation; - float value; -} PEXColorHSV; - -typedef struct { - float hue; - float lightness; - float saturation; -} PEXColorHLS; - -typedef struct { - float x; - float y; - float z; -} PEXColorCIE; - -typedef struct { - unsigned char red; - unsigned char green; - unsigned char blue; - unsigned char reserved; -} PEXColorRGB8; - -typedef struct { - unsigned short red; - unsigned short green; - unsigned short blue; - unsigned short reserved; -} PEXColorRGB16; - -typedef struct { - PEXTableIndex index; - unsigned short reserved; -} PEXColorIndexed; - -typedef union { - PEXColorIndexed indexed; - PEXColorRGB rgb; - PEXColorHSV hsv; - PEXColorHLS hls; - PEXColorCIE cie; - PEXColorRGB8 rgb8; - PEXColorRGB16 rgb16; -} PEXColor; - -typedef union { - PEXColorIndexed *indexed; - PEXColorRGB *rgb; - PEXColorHSV *hsv; - PEXColorHLS *hls; - PEXColorCIE *cie; - PEXColorRGB8 *rgb8; - PEXColorRGB16 *rgb16; -} PEXArrayOfColor; - -/* vectors */ -typedef struct { - float x; - float y; - float z; -} PEXVector; - -typedef struct { - float x; - float y; -} PEXVector2D; - -/* facet data */ -typedef struct { - PEXColorIndexed index; - PEXVector normal; -} PEXColorIndexedNormal; - -typedef struct { - PEXColorRGB rgb; - PEXVector normal; -} PEXColorRGBNormal; - -typedef struct { - PEXColorCIE cie; - PEXVector normal; -} PEXColorCIENormal; - -typedef struct { - PEXColorHSV hsv; - PEXVector normal; -} PEXColorHSVNormal; - -typedef struct { - PEXColorHLS hls; - PEXVector normal; -} PEXColorHLSNormal; - -typedef struct { - PEXColorRGB8 rgb8; - PEXVector normal; -} PEXColorRGB8Normal; - -typedef struct { - PEXColorRGB16 rgb16; - PEXVector normal; -} PEXColorRGB16Normal; - -typedef union { - PEXColorIndexed index; - PEXColorRGB rgb; - PEXColorHSV hsv; - PEXColorHLS hls; - PEXColorCIE cie; - PEXColorRGB8 rgb8; - PEXColorRGB16 rgb16; - PEXVector normal; - PEXColorIndexedNormal index_normal; - PEXColorRGBNormal rgb_normal; - PEXColorHSVNormal hsv_normal; - PEXColorHLSNormal hls_normal; - PEXColorCIENormal cie_normal; - PEXColorRGB8Normal rgb8_normal; - PEXColorRGB16Normal rgb16_normal; -} PEXFacetData; - -typedef union { - PEXColorIndexed *index; - PEXColorRGB *rgb; - PEXColorHSV *hsv; - PEXColorHLS *hls; - PEXColorCIE *cie; - PEXColorRGB8 *rgb8; - PEXColorRGB16 *rgb16; - PEXVector *normal; - PEXColorIndexedNormal *index_normal; - PEXColorRGBNormal *rgb_normal; - PEXColorCIENormal *cie_normal; - PEXColorHSVNormal *hsv_normal; - PEXColorHLSNormal *hls_normal; - PEXColorRGB8Normal *rgb8_normal; - PEXColorRGB16Normal *rgb16_normal; -} PEXArrayOfFacetData; - -/* vertex data */ -typedef struct { - PEXCoord point; - PEXColorIndexed index; -} PEXVertexIndexed; - -typedef struct { - PEXCoord point; - PEXColorRGB rgb; -} PEXVertexRGB; - -typedef struct { - PEXCoord point; - PEXColorHSV hsv; -} PEXVertexHSV; - -typedef struct { - PEXCoord point; - PEXColorHLS hls; -} PEXVertexHLS; - -typedef struct { - PEXCoord point; - PEXColorCIE cie; -} PEXVertexCIE; - -typedef struct { - PEXCoord point; - PEXColorRGB8 rgb8; -} PEXVertexRGB8; - -typedef struct { - PEXCoord point; - PEXColorRGB16 rgb16; -} PEXVertexRGB16; - -typedef struct { - PEXCoord point; - PEXVector normal; -} PEXVertexNormal; - -typedef struct { - PEXCoord point; - unsigned int edge; -} PEXVertexEdge; - -typedef struct { - PEXCoord point; - PEXColorIndexed index; - PEXVector normal; -} PEXVertexIndexedNormal; - -typedef struct { - PEXCoord point; - PEXColorRGB rgb; - PEXVector normal; -} PEXVertexRGBNormal; - -typedef struct { - PEXCoord point; - PEXColorHSV hsv; - PEXVector normal; -} PEXVertexHSVNormal; - -typedef struct { - PEXCoord point; - PEXColorHLS hls; - PEXVector normal; -} PEXVertexHLSNormal; - -typedef struct { - PEXCoord point; - PEXColorCIE cie; - PEXVector normal; -} PEXVertexCIENormal; - -typedef struct { - PEXCoord point; - PEXColorRGB8 rgb8; - PEXVector normal; -} PEXVertexRGB8Normal; - -typedef struct { - PEXCoord point; - PEXColorRGB16 rgb16; - PEXVector normal; -} PEXVertexRGB16Normal; - -typedef struct { - PEXCoord point; - PEXColorIndexed index; - unsigned int edge; -} PEXVertexIndexedEdge; - -typedef struct { - PEXCoord point; - PEXColorRGB rgb; - unsigned int edge; -} PEXVertexRGBEdge; - -typedef struct { - PEXCoord point; - PEXColorHSV hsv; - unsigned int edge; -} PEXVertexHSVEdge; - -typedef struct { - PEXCoord point; - PEXColorHLS hls; - unsigned int edge; -} PEXVertexHLSEdge; - -typedef struct { - PEXCoord point; - PEXColorCIE cie; - unsigned int edge; -} PEXVertexCIEEdge; - -typedef struct { - PEXCoord point; - PEXColorRGB8 rgb8; - unsigned int edge; -} PEXVertexRGB8Edge; - -typedef struct { - PEXCoord point; - PEXColorRGB16 rgb16; - unsigned int edge; -} PEXVertexRGB16Edge; - -typedef struct { - PEXCoord point; - PEXVector normal; - unsigned int edge; -} PEXVertexNormalEdge; - -typedef struct { - PEXCoord point; - PEXColorIndexed index; - PEXVector normal; - unsigned int edge; -} PEXVertexIndexedNormalEdge; - -typedef struct { - PEXCoord point; - PEXColorRGB rgb; - PEXVector normal; - unsigned int edge; -} PEXVertexRGBNormalEdge; - -typedef struct { - PEXCoord point; - PEXColorHSV hsv; - PEXVector normal; - unsigned int edge; -} PEXVertexHSVNormalEdge; - -typedef struct { - PEXCoord point; - PEXColorHLS hls; - PEXVector normal; - unsigned int edge; -} PEXVertexHLSNormalEdge; - -typedef struct { - PEXCoord point; - PEXColorCIE cie; - PEXVector normal; - unsigned int edge; -} PEXVertexCIENormalEdge; - -typedef struct { - PEXCoord point; - PEXColorRGB8 rgb8; - PEXVector normal; - unsigned int edge; -} PEXVertexRGB8NormalEdge; - -typedef struct { - PEXCoord point; - PEXColorRGB16 rgb16; - PEXVector normal; - unsigned int edge; -} PEXVertexRGB16NormalEdge; - -typedef union { - PEXCoord *no_data; - PEXVertexIndexed *index; - PEXVertexRGB *rgb; - PEXVertexHSV *hsv; - PEXVertexHLS *hls; - PEXVertexCIE *cie; - PEXVertexRGB8 *rgb8; - PEXVertexRGB16 *rgb16; - PEXVertexNormal *normal; - PEXVertexEdge *edge; - PEXVertexIndexedNormal *index_normal; - PEXVertexRGBNormal *rgb_normal; - PEXVertexHSVNormal *hsv_normal; - PEXVertexHLSNormal *hls_normal; - PEXVertexCIENormal *cie_normal; - PEXVertexRGB8Normal *rgb8_normal; - PEXVertexRGB16Normal *rgb16_normal; - PEXVertexIndexedEdge *index_edge; - PEXVertexRGBEdge *rgb_edge; - PEXVertexHSVEdge *hsv_edge; - PEXVertexHLSEdge *hls_edge; - PEXVertexCIEEdge *cie_edge; - PEXVertexRGB8Edge *rgb8_edge; - PEXVertexRGB16Edge *rgb16_edge; - PEXVertexNormalEdge *normal_edge; - PEXVertexIndexedNormalEdge *index_normal_edge; - PEXVertexRGBNormalEdge *rgb_normal_edge; - PEXVertexHSVNormalEdge *hsv_normal_edge; - PEXVertexHLSNormalEdge *hls_normal_edge; - PEXVertexCIENormalEdge *cie_normal_edge; - PEXVertexRGB8NormalEdge *rgb8_normal_edge; - PEXVertexRGB16NormalEdge *rgb16_normal_edge; -} PEXArrayOfVertex; - -typedef struct { - unsigned long count; /* number of vertices */ - PEXArrayOfVertex vertices; /* pointer to vertices */ -} PEXListOfVertex; - -/* connectivity list for set of fill area sets */ -typedef struct { - unsigned short count; /* number of shorts */ - unsigned short *shorts; -} PEXListOfUShort; - -typedef struct { - unsigned short count; /* number of lists */ - PEXListOfUShort *lists; -} PEXConnectivityData; - -/* encoded text */ -typedef struct { - unsigned short character_set; - unsigned char character_set_width; - unsigned char encoding_state; - unsigned short reserved; - unsigned short length; - char *ch; -} PEXEncodedTextData; - -typedef struct { - unsigned short count; /* number of encodings */ - PEXEncodedTextData *encoded_text; -} PEXListOfEncodedText; - -/* trimming curves */ -typedef struct { - unsigned short count; /* number of floats */ - float *floats; -} PEXListOfFloat; - -typedef struct { - PEXSwitch visibility; - unsigned char reserved; - unsigned short order; - PEXCoordType rationality; - PEXEnumTypeIndex approx_method; - float tolerance; - float tmin, tmax; - PEXListOfFloat knots; - unsigned short count; /* number of control points */ - PEXArrayOfCoord control_points; -} PEXTrimCurve; - -typedef struct { - unsigned short count; /* number of curves */ - PEXTrimCurve *curves; -} PEXListOfTrimCurve; - -/* half spaces */ -typedef struct { - PEXCoord point; - PEXVector vector; -} PEXHalfSpace; - -typedef struct { - PEXCoord2D point; - PEXVector2D vector; -} PEXHalfSpace2D; - -/* parametric surface characteristics */ -typedef struct { - unsigned short placement_type; - unsigned short reserved; - unsigned short u_count; - unsigned short v_count; -} PEXPSCIsoparametricCurves; - -typedef struct { - PEXCoord origin; - PEXVector direction; - unsigned short count; /* number of parameters */ - unsigned short reserved; - float *parameters; -} PEXPSCLevelCurves; - -typedef struct { - unsigned short length; - char *data; -} PEXPSCImpDepData; - -typedef union { - PEXPSCIsoparametricCurves iso_curves; - PEXPSCLevelCurves level_curves; - PEXPSCImpDepData imp_dep; -} PEXPSCData; - - -/* - * pipeline context - */ -typedef struct { - PEXColorType type; - unsigned short reserved; - PEXColor value; -} PEXColorSpecifier; - -typedef struct { - unsigned short vertical; - unsigned short horizontal; -} PEXTextAlignment; - -typedef struct { - PEXEnumTypeIndex method; - unsigned short reserved; - float tolerance; -} PEXCurveApprox; - -typedef struct { - float ambient; - float diffuse; - float specular; - float specular_conc; - float transmission; - PEXColorSpecifier specular_color; -} PEXReflectionAttributes; - -typedef struct { - PEXEnumTypeIndex method; - unsigned short reserved; - float u_tolerance; - float v_tolerance; -} PEXSurfaceApprox; - -typedef struct { - unsigned short count; /* number of half spaces */ - PEXHalfSpace *half_spaces; -} PEXModelClipVolume; - -typedef struct { - unsigned short count; /* number of lights */ - PEXTableIndex *indices; -} PEXListOfLight; - -typedef struct { - short type; - PEXPSCData psc; -} PEXPSCSpecifier; - -typedef struct { - PEXEnumTypeIndex marker_type; - float marker_scale; - PEXColorSpecifier marker_color; - PEXTableIndex marker_bundle_index; - PEXTableIndex text_font; - unsigned short text_precision; - float char_expansion; - float char_spacing; - PEXColorSpecifier text_color; - float char_height; - PEXVector2D char_up_vector; - unsigned short text_path; - PEXTextAlignment text_alignment; - float atext_height; - PEXVector2D atext_up_vector; - unsigned short atext_path; - PEXTextAlignment atext_alignment; - PEXEnumTypeIndex atext_style; - PEXTableIndex text_bundle_index; - PEXEnumTypeIndex line_type; - float line_width; - PEXColorSpecifier line_color; - PEXCurveApprox curve_approx; - PEXEnumTypeIndex polyline_interp; - PEXTableIndex line_bundle_index; - PEXEnumTypeIndex interior_style; - PEXTypeOrTableIndex interior_style_index; - PEXColorSpecifier surface_color; - PEXReflectionAttributes reflection_attr; - PEXEnumTypeIndex reflection_model; - PEXEnumTypeIndex surface_interp; - PEXEnumTypeIndex bf_interior_style; - PEXTypeOrTableIndex bf_interior_style_index; - PEXColorSpecifier bf_surface_color; - PEXReflectionAttributes bf_reflection_attr; - PEXEnumTypeIndex bf_reflection_model; - PEXEnumTypeIndex bf_surface_interp; - PEXSurfaceApprox surface_approx; - unsigned short culling_mode; - Bool distinguish; - PEXCoord2D pattern_size; - PEXCoord pattern_ref_point; - PEXVector pattern_ref_vec1; - PEXVector pattern_ref_vec2; - PEXTableIndex interior_bundle_index; - PEXSwitch surface_edges; - PEXEnumTypeIndex surface_edge_type; - float surface_edge_width; - PEXColorSpecifier surface_edge_color; - PEXTableIndex edge_bundle_index; - PEXMatrix local_transform; - PEXMatrix global_transform; - unsigned short model_clip; - PEXModelClipVolume model_clip_volume; - PEXTableIndex view_index; - PEXListOfLight light_state; - PEXTableIndex depth_cue_index; - PEXBitmask asf_enables; - PEXBitmask asf_values; - long pick_id; - unsigned long hlhsr_id; - PEXNameSet name_set; - PEXTableIndex color_approx_index; - PEXEnumTypeIndex rendering_color_model; - PEXPSCSpecifier para_surf_char; -} PEXPCAttributes; - -/* macros for setting bits in a PC attribute bitmask */ - -#define PEXSetPCAttributeMask(mask, attr) \ - mask[((attr)) >> 5] |= (unsigned long) 1 << ( ((attr)) & 0x1f) - -#define PEXSetPCAttributeMaskAll(mask) \ - mask[0] = 0xffffffff; \ - mask[1] = 0xffffffff; \ - mask[2] = 0x0 - - -/* - * renderer - */ -typedef struct { - short xmin; - short ymin; - short xmax; - short ymax; -} PEXDeviceRect; - -typedef struct { - unsigned short count; /* number of device rectangles */ - PEXDeviceRect *rectangles; -} PEXListOfClipRect; - -typedef struct { - PEXCoord min; - PEXCoord max; -} PEXNPCSubVolume; - -typedef struct { - short x; - short y; - float z; -} PEXDeviceCoord; - -typedef struct { - short x; - short y; -} PEXDeviceCoord2D; - -typedef struct { - PEXDeviceCoord min; - PEXDeviceCoord max; - PEXSwitch use_drawable; - unsigned char reserved[3]; -} PEXViewport; - -typedef struct { - PEXStructure structure; - unsigned long offset; -} PEXElementRef; - -typedef struct { - unsigned long count; /* number of elements */ - PEXElementRef *elements; -} PEXStructurePath; - -typedef struct { - PEXStructure sid; - unsigned long offset; - unsigned long pick_id; -} PEXPickElementRef; - -typedef struct { - unsigned long count; /* number of elements */ - PEXPickElementRef *elements; -} PEXPickPath; - -typedef struct { - PEXPipelineContext pipeline_context; - PEXStructurePath current_path; - PEXLookupTable marker_bundle; - PEXLookupTable text_bundle; - PEXLookupTable line_bundle; - PEXLookupTable interior_bundle; - PEXLookupTable edge_bundle; - PEXLookupTable view_table; - PEXLookupTable color_table; - PEXLookupTable depth_cue_table; - PEXLookupTable light_table; - PEXLookupTable color_approx_table; - PEXLookupTable pattern_table; - PEXLookupTable text_font_table; - PEXNameSet highlight_incl; - PEXNameSet highlight_excl; - PEXNameSet invisibility_incl; - PEXNameSet invisibility_excl; - int renderer_state; - PEXEnumTypeIndex hlhsr_mode; - PEXNPCSubVolume npc_subvolume; - PEXViewport viewport; - PEXListOfClipRect clip_list; - PEXNameSet pick_incl; - PEXNameSet pick_excl; - PEXStructurePath pick_start_path; - PEXColorSpecifier background_color; - Bool clear_image; - Bool clear_z; - int echo_mode; -} PEXRendererAttributes; - -/* renderer picking */ -typedef PEXNPCSubVolume PEXPDNPCHitVolume; - -typedef struct { - PEXDeviceCoord2D position; - float distance; -} PEXPDDCHitBox; - -typedef struct { - unsigned short length; /* number of bytes in record */ - char *record; -} PEXPickDataRecord; - -typedef union { - PEXPDNPCHitVolume volume; - PEXPDDCHitBox box; - PEXPickDataRecord data; -} PEXPickRecord; - - -/* - * name set - */ -typedef struct { - PEXNameSet inclusion; - PEXNameSet exclusion; -} PEXNameSetPair; - -typedef struct { - unsigned short count; /* number of pairs */ - PEXNameSetPair *pairs; -} PEXListOfNameSetPair; - - -/* - * font - */ -typedef struct { - Atom name; - unsigned long value; -} PEXFontProp; - -typedef struct { - unsigned long first_glyph; - unsigned long last_glyph; - unsigned long default_glyph; - Bool all_exist; - Bool stroke; - unsigned short count; /* number of properties */ - PEXFontProp *props; -} PEXFontInfo; - -typedef struct { - unsigned short length; - char *ch; -} PEXStringData; - -typedef struct { - PEXCoord2D lower_left; - PEXCoord2D upper_right; - PEXCoord2D concat_point; -} PEXTextExtent; - - -/* - * look up table - */ -typedef struct { - unsigned short definable_entries; - unsigned short predefined_count; - unsigned short predefined_min; - unsigned short predefined_max; -} PEXTableInfo; - -typedef struct { - PEXEnumTypeIndex type; - PEXEnumTypeIndex interp_method; - PEXCurveApprox curve_approx; - float width; - PEXColorSpecifier color; -} PEXLineBundleEntry; - -typedef struct { - PEXEnumTypeIndex type; - short reserved; - float scale; - PEXColorSpecifier color; -} PEXMarkerBundleEntry; - -typedef struct { - PEXTableIndex font_index; - PEXEnumTypeIndex precision; - float char_expansion; - float char_spacing; - PEXColorSpecifier color; -} PEXTextBundleEntry; - -typedef struct { - PEXEnumTypeIndex style; - PEXTypeOrTableIndex style_index; - PEXEnumTypeIndex reflection_model; - PEXEnumTypeIndex interp_method; - PEXEnumTypeIndex bf_style; - PEXTypeOrTableIndex bf_style_index; - PEXEnumTypeIndex bf_reflection_model; - PEXEnumTypeIndex bf_interp_method; - PEXSurfaceApprox surface_approx; - PEXColorSpecifier color; - PEXReflectionAttributes reflection_attr; - PEXColorSpecifier bf_color; - PEXReflectionAttributes bf_reflection_attr; -} PEXInteriorBundleEntry; - -typedef struct { - PEXSwitch edge_flag; - unsigned char reserved; - PEXEnumTypeIndex type; - float width; - PEXColorSpecifier color; -} PEXEdgeBundleEntry; - -typedef struct { - PEXColorType color_type; - unsigned short row_count; - unsigned short col_count; - PEXArrayOfColor colors; /* pointer to 2D array of colors */ -} PEXPatternEntry; - -typedef PEXColorSpecifier PEXColorEntry; - -typedef struct { - unsigned short count; /* number of fonts */ - PEXFont *fonts; -} PEXTextFontEntry; - -typedef struct { - PEXEnumTypeIndex type; - unsigned short reserved; - PEXVector direction; - PEXCoord point; - float concentration; - float spread_angle; - float attenuation1; - float attenuation2; - PEXColorSpecifier color; -} PEXLightEntry; - -typedef struct { - PEXSwitch mode; - unsigned char reserved[3]; - float front_plane; - float back_plane; - float front_scaling; - float back_scaling; - PEXColorSpecifier color; -} PEXDepthCueEntry; - -typedef struct { - PEXEnumTypeIndex type; - PEXEnumTypeIndex model; - unsigned short max1; - unsigned short max2; - unsigned short max3; - PEXSwitch dither; - unsigned char reserved; - unsigned long mult1; - unsigned long mult2; - unsigned long mult3; - float weight1; - float weight2; - float weight3; - unsigned long base_pixel; -} PEXColorApproxEntry; - -typedef struct { - unsigned short clip_flags; - unsigned short reserved; - PEXNPCSubVolume clip_limits; - PEXMatrix orientation; - PEXMatrix mapping; -} PEXViewEntry; - - -/* - * structure - */ -typedef struct { - unsigned long element_count; - unsigned long size; - Bool has_refs; - unsigned short edit_mode; - unsigned long element_pointer; -} PEXStructureInfo; - -typedef struct { - unsigned short type; - unsigned short length; -} PEXElementInfo; - - -/* - * search context - */ -typedef struct { - PEXCoord position; - float distance; - unsigned short ceiling; - Bool model_clip_flag; - PEXStructurePath start_path; - PEXListOfNameSetPair normal; - PEXListOfNameSetPair inverted; -} PEXSCAttributes; - - -/* - * PHIGS workstation - */ -typedef struct { - PEXTableIndex index; - unsigned short reserved; - PEXViewEntry view; -} PEXViewRep; - -typedef struct { - unsigned short count; /* number of views */ - PEXTableIndex *views; -} PEXListOfView; - -typedef struct { - PEXStructure sid; - float priority; -} PEXPostedStructure; - -typedef struct { - unsigned long count; /* number of posted structures*/ - PEXPostedStructure *structures; -} PEXListOfPostedStructure; - -typedef struct { - short drawable_update; - int visual_state; - int drawable_surface; - int view_update; - PEXListOfView defined_views; - int wks_update; - PEXNPCSubVolume req_npc_subvolume; - PEXNPCSubVolume cur_npc_subvolume; - PEXViewport req_workstation_viewport; - PEXViewport cur_workstation_viewport; - int hlhsr_update; - PEXEnumTypeIndex req_hlhsr_mode; - PEXEnumTypeIndex cur_hlhsr_mode; - Drawable drawable; - PEXLookupTable marker_bundle; - PEXLookupTable text_bundle; - PEXLookupTable line_bundle; - PEXLookupTable interior_bundle; - PEXLookupTable edge_bundle; - PEXLookupTable color_table; - PEXLookupTable depth_cue_table; - PEXLookupTable light_table; - PEXLookupTable color_approx_table; - PEXLookupTable pattern_table; - PEXLookupTable text_font_table; - PEXNameSet highlight_incl; - PEXNameSet highlight_excl; - PEXNameSet invisibility_incl; - PEXNameSet invisibility_excl; - PEXListOfPostedStructure posted_structures; - unsigned long count_priorities; - int buffer_update; - int req_buffer_mode; - int cur_buffer_mode; -} PEXWorkstationAttributes; - -/* macros for setting bits in a workstation attribute bitmask */ - -#define PEXSetPWAttributeMask(mask, attr) \ - mask[((attr)) >> 5] |= (unsigned long) 1 << ( ((attr)) & 0x1f) - -#define PEXSetPWAttributeMaskAll(mask) \ - mask[0] = 0xffffffff; \ - mask[1] = 0x00000003 - -typedef struct { - unsigned char view_rep; - unsigned char marker_bundle; - unsigned char text_bundle; - unsigned char line_bundle; - unsigned char interior_bundle; - unsigned char edge_bundle; - unsigned char color_table; - unsigned char pattern_table; - unsigned char wks_transform; - unsigned char highlight_filter; - unsigned char invisibility_filter; - unsigned char hlhsr_mode; - unsigned char structure_modify; - unsigned char post_structure; - unsigned char unpost_structure; - unsigned char delete_structure; - unsigned char reference_modify; - unsigned char buffer_modify; - unsigned char light_table; - unsigned char depth_cue_table; - unsigned char color_approx_table; -} PEXWorkstationDynamics; - - -/* - * workstation picking - */ -typedef struct { - unsigned short status; - PEXPickPath pick_path; -} PEXPMAttributes; - -typedef struct { - unsigned short status; - PEXPickPath path; - int path_order; - PEXNameSet inclusion; - PEXNameSet exclusion; - PEXPickRecord pick_record; - PEXEnumTypeIndex prompt_echo_type; - PEXViewport echo_volume; - int echo_switch; -} PEXPDAttributes; - - -/* - * errors - */ -/* similar to XErrorEvent - use to access additional info in OC error */ -typedef struct { - int type; - Display *display; /* Display the event was read from */ - XID resourceid; /* resource id of renderer or structure */ - unsigned long serial; /* serial number of failed request */ - unsigned char error_code; /* error code of failed request */ - unsigned char request_code; /* Major op-code of failed request */ - unsigned char minor_code; /* Minor op-code of failed request */ - unsigned short op_code; /* op-code of failed output command */ - unsigned short count; /* number of output commands successfully */ - /* executed before error */ -} PEXOCErrorEvent; - - -/* - * events - */ -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - PEXRenderer renderer; -} PEXMaxHitsReachedEvent; - - -/* - * encode and decode - */ -typedef struct { - unsigned short oc_type; - union { - struct { - unsigned long count; - PEXName *names; - } AddToNameSet; - struct { - int length; - char *data; - } ApplicationData; - struct { - PEXCoord point1; - PEXCoord point2; - PEXCoord point3; - unsigned int col_count; - unsigned int row_count; - PEXTableIndex *color_indices; - } CellArray; - struct { - PEXCoord2D point1; - PEXCoord2D point2; - unsigned int col_count; - unsigned int row_count; - PEXTableIndex *color_indices; - } CellArray2D; - struct { - PEXCoord origin; - PEXCoord offset; - unsigned int count; - PEXEncodedTextData *encoded_text; - } EncodedAnnoText; - struct { - PEXCoord2D origin; - PEXCoord2D offset; - unsigned int count; - PEXEncodedTextData *encoded_text; - } EncodedAnnoText2D; - struct { - PEXCoord origin; - PEXVector vector1; - PEXVector vector2; - unsigned int count; - PEXEncodedTextData *encoded_text; - } EncodedText; - struct { - PEXCoord2D origin; - unsigned int count; - PEXEncodedTextData *encoded_text; - } EncodedText2D; - struct { - PEXStructure structure; - } ExecuteStructure; - struct { - PEXCoord point1; - PEXCoord point2; - PEXCoord point3; - unsigned int col_count; - unsigned int row_count; - int color_type; - PEXArrayOfColor colors; - } ExtendedCellArray; - struct { - int shape_hint; - int ignore_edges; - unsigned int count; - PEXCoord *points; - } FillArea; - struct { - int shape_hint; - int ignore_edges; - unsigned int count; - PEXCoord2D *points; - } FillArea2D; - struct { - int shape_hint; - int ignore_edges; - int contour_hint; - unsigned int count; - PEXListOfCoord *point_lists; - } FillAreaSet; - struct { - int shape_hint; - int ignore_edges; - int contour_hint; - unsigned int count; - PEXListOfCoord2D *point_lists; - } FillAreaSet2D; - struct { - int shape_hint; - int ignore_edges; - int contour_hint; - unsigned int facet_attributes; - unsigned int vertex_attributes; - int color_type; - unsigned int count; - PEXFacetData facet_data; - PEXListOfVertex *vertex_lists; - } FillAreaSetWithData; - struct { - int shape_hint; - int ignore_edges; - unsigned int facet_attributes; - unsigned int vertex_attributes; - int color_type; - PEXFacetData facet_data; - unsigned int count; - PEXArrayOfVertex vertices; - } FillAreaWithData; - struct { - long gdp_id; - unsigned int count; - PEXCoord *points; - unsigned long length; - char *data; - } GDP; - struct { - long gdp_id; - unsigned int count; - PEXCoord2D *points; - unsigned long length; - char *data; - } GDP2D; - struct { - long id; - int length; - char *data; - } GSE; - struct { - long label; - } Label; - struct { - unsigned int count; - PEXCoord *points; - } Markers; - struct { - unsigned int count; - PEXCoord2D *points; - } Markers2D; - struct { - int rationality; - int order; - float *knots; - unsigned int count; - PEXArrayOfCoord points; - double tmin; - double tmax; - } NURBCurve; - struct { - int rationality; - int uorder; - int vorder; - float *uknots; - float *vknots; - unsigned int col_count; - unsigned int row_count; - PEXArrayOfCoord points; - unsigned int curve_count; - PEXListOfTrimCurve *trim_curves; - } NURBSurface; - struct { - unsigned int count; - PEXCoord *points; - } Polyline; - struct { - unsigned int count; - PEXCoord2D *points; - } Polyline2D; - struct { - unsigned int vertex_attributes; - int color_type; - unsigned int count; - PEXListOfVertex *vertex_lists; - } PolylineSetWithData; - struct { - int shape_hint; - unsigned int facet_attributes; - unsigned int vertex_attributes; - int color_type; - PEXArrayOfFacetData facet_data; - unsigned int col_count; - unsigned int row_count; - PEXArrayOfVertex vertices; - } QuadrilateralMesh; - struct { - unsigned long count; - PEXName *names; - } RemoveFromNameSet; - struct { - int halignment; - int valignment; - } SetATextAlignment; - struct { - double height; - } SetATextHeight; - struct { - int path; - } SetATextPath; - struct { - int style; - } SetATextStyle; - struct { - PEXVector2D vector; - } SetATextUpVector; - struct { - int style; - } SetBFInteriorStyle; - struct { - int index; - } SetBFInteriorStyleIndex; - struct { - PEXReflectionAttributes attributes; - } SetBFReflectionAttributes; - struct { - int model; - } SetBFReflectionModel; - struct { - int color_type; - PEXColor color; - } SetBFSurfaceColor; - struct { - unsigned int index; - } SetBFSurfaceColorIndex; - struct { - int method; - } SetBFSurfaceInterpMethod; - struct { - double expansion; - } SetCharExpansion; - struct { - double height; - } SetCharHeight; - struct { - double spacing; - } SetCharSpacing; - struct { - PEXVector2D vector; - } SetCharUpVector; - struct { - unsigned int index; - } SetColorApproxIndex; - struct { - int method; - double tolerance; - } SetCurveApprox; - struct { - unsigned int index; - } SetDepthCueIndex; - struct { - unsigned int index; - } SetEdgeBundleIndex; - struct { - int mode; - } SetFacetCullingMode; - struct { - int flag; - } SetFacetDistinguishFlag; - struct { - PEXMatrix transform; - } SetGlobalTransform; - struct { - PEXMatrix3x3 transform; - } SetGlobalTransform2D; - struct { - unsigned long hlhsr_id; - } SetHLHSRID; - struct { - unsigned long attribute; - int asf; - } SetIndividualASF; - struct { - unsigned int index; - } SetInteriorBundleIndex; - struct { - int style; - } SetInteriorStyle; - struct { - int index; - } SetInteriorStyleIndex; - struct { - unsigned int enable_count; - PEXTableIndex *enable; - unsigned int disable_count; - PEXTableIndex *disable; - } SetLightSourceState; - struct { - unsigned int index; - } SetLineBundleIndex; - struct { - int color_type; - PEXColor color; - } SetLineColor; - struct { - unsigned int index; - } SetLineColorIndex; - struct { - int line_type; - } SetLineType; - struct { - double width; - } SetLineWidth; - struct { - int composition; - PEXMatrix transform; - } SetLocalTransform; - struct { - int composition; - PEXMatrix3x3 transform; - } SetLocalTransform2D; - struct { - unsigned int index; - } SetMarkerBundleIndex; - struct { - int color_type; - PEXColor color; - } SetMarkerColor; - struct { - unsigned int index; - } SetMarkerColorIndex; - struct { - double scale; - } SetMarkerScale; - struct { - int marker_type; - } SetMarkerType; - struct { - int flag; - } SetModelClipFlag; - struct { - int op; - unsigned int count; - PEXHalfSpace *half_spaces; - } SetModelClipVolume; - struct { - int op; - unsigned int count; - PEXHalfSpace2D *half_spaces; - } SetModelClipVolume2D; - struct { - int shape_hint; - unsigned int facet_attributes; - unsigned int vertex_attributes; - unsigned int edge_attributes; - int contour_hint; - int contours_all_one; - int color_type; - unsigned int set_count; - PEXArrayOfFacetData facet_data; - unsigned int vertex_count; - PEXArrayOfVertex vertices; - unsigned int index_count; - PEXSwitch *edge_flags; - PEXConnectivityData *connectivity; - } SetOfFillAreaSets; - struct { - int psc_type; - PEXPSCData characteristics; - } SetParaSurfCharacteristics; - struct { - PEXCoord ref_point; - PEXVector vector1; - PEXVector vector2; - } SetPatternAttributes; - struct { - PEXCoord2D ref_point; - } SetPatternAttributes2D; - struct { - double width; - double height; - } SetPatternSize; - struct { - unsigned long pick_id; - } SetPickID; - struct { - int method; - } SetPolylineInterpMethod; - struct { - PEXReflectionAttributes attributes; - } SetReflectionAttributes; - struct { - int model; - } SetReflectionModel; - struct { - int model; - } SetRenderingColorModel; - struct { - int method; - double utolerance; - double vtolerance; - } SetSurfaceApprox; - struct { - int color_type; - PEXColor color; - } SetSurfaceColor; - struct { - unsigned int index; - } SetSurfaceColorIndex; - struct { - int color_type; - PEXColor color; - } SetSurfaceEdgeColor; - struct { - unsigned int index; - } SetSurfaceEdgeColorIndex; - struct { - int flag; - } SetSurfaceEdgeFlag; - struct { - int edge_type; - } SetSurfaceEdgeType; - struct { - double width; - } SetSurfaceEdgeWidth; - struct { - int method; - } SetSurfaceInterpMethod; - struct { - int halignment; - int valignment; - } SetTextAlignment; - struct { - unsigned int index; - } SetTextBundleIndex; - struct { - int color_type; - PEXColor color; - } SetTextColor; - struct { - unsigned int index; - } SetTextColorIndex; - struct { - unsigned int index; - } SetTextFontIndex; - struct { - int path; - } SetTextPath; - struct { - int precision; - } SetTextPrecision; - struct { - unsigned int index; - } SetViewIndex; - struct { - unsigned int facet_attributes; - unsigned int vertex_attributes; - int color_type; - PEXArrayOfFacetData facet_data; - unsigned int count; - PEXArrayOfVertex vertices; - } TriangleStrip; - } data; -} PEXOCData; - - -/* - * encoded output commands - */ - -/* macro for inquiring max length for PEXGetOCAddr */ - -#define PEXGetOCAddrMaxSize(_display) \ - ((_display)->bufmax - (_display)->buffer) /* this macro returns the */ - /* maximum allowable size (in */ - /* bytes) for PEXGetOCAddr */ - /* individual implementations */ - /* can modify the value, but */ - /* the minimum allowed is 1024*/ - - -/* - * constants for utilities - */ - -/* constants for PEXRotate */ -#define PEXXAxis 1 -#define PEXYAxis 2 -#define PEXZAxis 3 - -/* constants for utilities error return status */ -#define PEXBadVector 1 -#define PEXBadVectors 2 -#define PEXBadLimits 3 -#define PEXBadViewport 4 -#define PEXBadPlanes 5 -#define PEXBadPRP 6 -#define PEXBadMatrix 7 -#define PEXBadPrimitive 8 -#define PEXBadDistance 9 -#define PEXBadAxis 10 -#define PEXBadHomoCoord 11 -#define PEXBadSubVolume 12 - -_XFUNCPROTOBEGIN - -/* - * function declarations - */ - -extern void PEXAccumulateState( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - unsigned long /* count */, - PEXElementRef * /* elements */ -#endif -); - -extern void PEXAddToNameSet( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned long /* count */, - PEXName * /* names */ -#endif -); - -extern void PEXAnnotationText( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord * /* origin */, - PEXCoord * /* offset */, - int /* length */, - char * /* string */ -#endif -); - -extern void PEXAnnotationText2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord2D * /* origin */, - PEXCoord2D * /* offset */, - int /* length */, - char * /* string */ -#endif -); - -extern void PEXApplicationData( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* length */, - char * /* data */ -#endif -); - -extern void PEXBeginPickAll( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - PEXRenderer /* renderer */, - long /* structure_id */, - int /* method */, - int /* send_event */, - int /* max_hits */, - int /* pick_device_type */, - PEXPickRecord * /* pick_record */ -#endif -); - -extern void PEXBeginPickOne( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - PEXRenderer /* renderer */, - long /* structure_id */, - int /* method */, - int /* pick_device_type */, - PEXPickRecord * /* pick_record */ -#endif -); - -extern void PEXBeginRendering( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - PEXRenderer /* renderer */ -#endif -); - -extern void PEXBeginStructure( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - long /* structure_id */ -#endif -); - -extern void PEXBuildTransform( -#if NeedFunctionPrototypes - PEXCoord * /* fixed_point */, - PEXVector * /* trans_vector */, - double /* angle_x */, - double /* angle_y */, - double /* angle_z */, - PEXVector * /* scale_vector */, - PEXMatrix /* matrix_return */ -#endif -); - -extern void PEXBuildTransform2D( -#if NeedFunctionPrototypes - PEXCoord2D * /* fixed_point */, - PEXVector2D * /* trans_vector */, - double /* angle_z */, - PEXVector2D * /* scale_vector */, - PEXMatrix3x3 /* matrix_return */ -#endif -); - -extern void PEXCellArray( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord * /* point1 */, - PEXCoord * /* point2 */, - PEXCoord * /* point3 */, - unsigned int /* col_count */, - unsigned int /* row_count */, - PEXTableIndex * /* color_indices */ -#endif -); - -extern void PEXCellArray2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord2D * /* point1 */, - PEXCoord2D * /* point2 */, - unsigned int /* col_count */, - unsigned int /* row_count */, - PEXTableIndex * /* color_indices */ -#endif -); - -extern void PEXChangeNameSet( -#if NeedFunctionPrototypes - Display * /* display */, - PEXNameSet /* nameset */, - int /* action */, - unsigned long /* count */, - PEXName * /* names */ -#endif -); - -extern void PEXChangePickDevice( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - int /* pick_device_type */, - unsigned long /* value_mask */, - PEXPDAttributes * /* values */ -#endif -); - -extern void PEXChangePipelineContext( -#if NeedFunctionPrototypes - Display * /* display */, - PEXPipelineContext /* context */, - unsigned long * /* value_mask */, - PEXPCAttributes * /* values */ -#endif -); - -extern void PEXChangeRenderer( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - unsigned long /* value_mask */, - PEXRendererAttributes * /* values */ -#endif -); - -extern void PEXChangeSearchContext( -#if NeedFunctionPrototypes - Display * /* display */, - PEXSearchContext /* context */, - unsigned long /* value_mask */, - PEXSCAttributes * /* values */ -#endif -); - -extern void PEXChangeStructureRefs( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* old_structure */, - PEXStructure /* new_structure */ -#endif -); - -extern void PEXCopyBytesToOC( -#if NeedFunctionPrototypes - Display * /* display */, - int /* length */, - char * /* data */ -#endif -); - -extern void PEXCopyElements( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* src_structure */, - int /* src_whence1 */, - long /* src_offset1 */, - int /* src_whence2 */, - long /* src_offset2 */, - PEXStructure /* dst_structure */, - int /* dst_whence */, - long /* dst_offset */ -#endif -); - -extern void PEXCopyLookupTable( -#if NeedFunctionPrototypes - Display * /* display */, - PEXLookupTable /* src_table */, - PEXLookupTable /* dst_table */ -#endif -); - -extern void PEXCopyNameSet( -#if NeedFunctionPrototypes - Display * /* display */, - PEXNameSet /* src_nameset */, - PEXNameSet /* dst_nameset */ -#endif -); - -extern void PEXCopyPipelineContext( -#if NeedFunctionPrototypes - Display * /* display */, - unsigned long * /* value_mask */, - PEXPipelineContext /* src_context */, - PEXPipelineContext /* dst_context */ -#endif -); - -extern void PEXCopySearchContext( -#if NeedFunctionPrototypes - Display * /* display */, - unsigned long /* value_mask */, - PEXSearchContext /* src_context */, - PEXSearchContext /* dst_context */ -#endif -); - -extern void PEXCopyStructure( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* src_structure */, - PEXStructure /* dst_structure */ -#endif -); - -extern PEXLookupTable PEXCreateLookupTable( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - int /* table_type */ -#endif -); - -extern PEXNameSet PEXCreateNameSet( -#if NeedFunctionPrototypes - Display * /* display */ -#endif -); - -extern PEXPickMeasure PEXCreatePickMeasure( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - int /* pick_device_type */ -#endif -); - -extern PEXPipelineContext PEXCreatePipelineContext( -#if NeedFunctionPrototypes - Display * /* display */, - unsigned long * /* value_mask */, - PEXPCAttributes * /* values */ -#endif -); - -extern PEXRenderer PEXCreateRenderer( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - unsigned long /* value_mask */, - PEXRendererAttributes * /* values */ -#endif -); - -extern PEXSearchContext PEXCreateSearchContext( -#if NeedFunctionPrototypes - Display * /* display */, - unsigned long /* value_mask */, - PEXSCAttributes * /* values */ -#endif -); - -extern PEXStructure PEXCreateStructure( -#if NeedFunctionPrototypes - Display * /* display */ -#endif -); - -extern PEXWorkstation PEXCreateWorkstation( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - PEXLookupTable /* line_bundle */, - PEXLookupTable /* marker_bundle */, - PEXLookupTable /* text_bundle */, - PEXLookupTable /* interior_bundle */, - PEXLookupTable /* edge_bundle */, - PEXLookupTable /* color_table */, - PEXLookupTable /* pattern_table */, - PEXLookupTable /* font_table */, - PEXLookupTable /* depth_cue_table */, - PEXLookupTable /* light_table */, - PEXLookupTable /* color_approx_table */, - PEXNameSet /* highlight_incl */, - PEXNameSet /* highlight_excl */, - PEXNameSet /* invisibility_incl */, - PEXNameSet /* invisibility_excl */, - int /* buffer_mode */ -#endif -); - -extern PEXOCData *PEXDecodeOCs( -#if NeedFunctionPrototypes - int /* float_format */, - unsigned long /* oc_count */, - unsigned long /* length */, - char * /* encoded_ocs */ -#endif -); - -extern void PEXDeleteBetweenLabels( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - long /* label1 */, - long /* label2 */ -#endif -); - -extern void PEXDeleteElements( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* whence1 */, - long /* offset1 */, - int /* whence2 */, - long /* offset2 */ -#endif -); - -extern void PEXDeleteTableEntries( -#if NeedFunctionPrototypes - Display * /* display */, - PEXLookupTable /* table */, - unsigned int /* start */, - unsigned int /* count */ -#endif -); - -extern void PEXDeleteToLabel( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* whence */, - long /* offset */, - long /* label */ -#endif -); - -extern void PEXDestroyStructures( -#if NeedFunctionPrototypes - Display * /* display */, - unsigned long /* count */, - PEXStructure * /* structures */ -#endif -); - -extern Status PEXElementSearch( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* whence */, - long /* offset */, - int /* direction */, - unsigned long /* incl_count */, - unsigned short * /* incl_list */, - unsigned long /* excl_count */, - unsigned short * /* excl_list */, - unsigned long * /* elem_offset_return */ -#endif -); - -extern char *PEXEncodeOCs( -#if NeedFunctionPrototypes - int /* float_format */, - unsigned long /* oc_count */, - PEXOCData * /* oc_data */, - unsigned long * /* length_return */ -#endif -); - -extern void PEXEncodedAnnoText( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord * /* origin */, - PEXCoord * /* offset */, - unsigned int /* count */, - PEXEncodedTextData * /* encoded_text */ -#endif -); - -extern void PEXEncodedAnnoText2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord2D * /* origin */, - PEXCoord2D * /* offset */, - unsigned int /* count */, - PEXEncodedTextData * /* encoded_text */ -#endif -); - -extern void PEXEncodedText( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord * /* origin */, - PEXVector * /* vector1 */, - PEXVector * /* vector2 */, - unsigned int /* count */, - PEXEncodedTextData * /* encoded_text */ -#endif -); - -extern void PEXEncodedText2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord2D * /* origin */, - unsigned int /* count */, - PEXEncodedTextData * /* encoded_text */ -#endif -); - -extern PEXPickPath *PEXEndPickAll( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - int * /* status_return */, - int * /* more_return */, - unsigned long * /* count_return */ -#endif -); - -extern PEXPickPath *PEXEndPickOne( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - int * /* status_return */, - int * /* undetectable_return */ -#endif -); - -extern void PEXEndRendering( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - int /* flush */ -#endif -); - -extern void PEXEndStructure( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */ -#endif -); - -extern void PEXEscape( -#if NeedFunctionPrototypes - Display * /* display */, - unsigned long /* escape_id */, - int /* length */, - char * /* escape_data */ -#endif -); - -extern char *PEXEscapeWithReply( -#if NeedFunctionPrototypes - Display * /* display */, - unsigned long /* escape_id */, - int /* length */, - char * /* escape_data */, - unsigned long * /* reply_length_return */ -#endif -); - -extern void PEXExecuteDeferredActions( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */ -#endif -); - -extern void PEXExecuteStructure( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXStructure /* structure */ -#endif -); - -extern void PEXExtendedCellArray( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord * /* point1 */, - PEXCoord * /* point2 */, - PEXCoord * /* point3 */, - unsigned int /* col_count */, - unsigned int /* row_count */, - int /* color_type */, - PEXArrayOfColor /* colors */ -#endif -); - -extern Status PEXFetchElements( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* whence1 */, - long /* offset1 */, - int /* whence2 */, - long /* offset2 */, - int /* float_format */, - unsigned long * /* count_return */, - unsigned long * /* length_return */, - char ** /* ocs_return */ -#endif -); - -extern Status PEXFetchElementsAndSend( -#if NeedFunctionPrototypes - Display * /* src_display */, - PEXStructure /* structure */, - int /* whence1 */, - long /* offset1 */, - int /* whence2 */, - long /* offset2 */, - Display * /* dst_display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */ -#endif -); - -extern void PEXFillArea( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* shape_hint */, - int /* ignore_edges */, - unsigned int /* count */, - PEXCoord * /* points */ -#endif -); - -extern void PEXFillArea2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* shape_hint */, - int /* ignore_edges */, - unsigned int /* count */, - PEXCoord2D * /* points */ -#endif -); - -extern void PEXFillAreaSet( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* shape_hint */, - int /* ignore_edges */, - int /* contour_hint */, - unsigned int /* count */, - PEXListOfCoord * /* point_lists */ -#endif -); - -extern void PEXFillAreaSet2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* shape_hint */, - int /* ignore_edges */, - int /* contour_hint */, - unsigned int /* count */, - PEXListOfCoord2D * /* point_lists */ -#endif -); - -extern void PEXFillAreaSetWithData( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* shape_hint */, - int /* ignore_edges */, - int /* contour_hint */, - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - int /* color_type */, - unsigned int /* count */, - PEXFacetData * /* facet_data */, - PEXListOfVertex * /* vertex_lists */ -#endif -); - -extern void PEXFillAreaWithData( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* shape_hint */, - int /* ignore_edges */, - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - int /* color_type */, - PEXFacetData * /* facet_data */, - unsigned int /* count */, - PEXArrayOfVertex /* vertices */ -#endif -); - -extern void PEXFinishOCs( -#if NeedFunctionPrototypes - Display * /* display */ -#endif -); - -extern void PEXFreeEnumInfo( -#if NeedFunctionPrototypes - unsigned long /* count */, - unsigned long * /* info_count */, - PEXEnumTypeDesc * /* enum_info */ -#endif -); - -extern void PEXFreeFontInfo( -#if NeedFunctionPrototypes - unsigned long /* count */, - PEXFontInfo * /* font_info */ -#endif -); - -extern void PEXFreeFontNames( -#if NeedFunctionPrototypes - unsigned long /* count */, - char ** /* font_names */ -#endif -); - -extern void PEXFreeLookupTable( -#if NeedFunctionPrototypes - Display * /* display */, - PEXLookupTable /* table */ -#endif -); - -extern void PEXFreeNameSet( -#if NeedFunctionPrototypes - Display * /* display */, - PEXNameSet /* nameset */ -#endif -); - -extern void PEXFreeOCData( -#if NeedFunctionPrototypes - unsigned long /* count */, - PEXOCData * /* oc_data */ -#endif -); - -extern void PEXFreePCAttributes( -#if NeedFunctionPrototypes - PEXPCAttributes * /* values */ -#endif -); - -extern void PEXFreePDAttributes( -#if NeedFunctionPrototypes - PEXPDAttributes * /* values */ -#endif -); - -extern void PEXFreePMAttributes( -#if NeedFunctionPrototypes - PEXPMAttributes * /* values */ -#endif -); - -extern void PEXFreePickMeasure( -#if NeedFunctionPrototypes - Display * /* display */, - PEXPickMeasure /* pick_measure */ -#endif -); - -extern void PEXFreePickPaths( -#if NeedFunctionPrototypes - unsigned long /* count */, - PEXPickPath * /* pick_paths */ -#endif -); - -extern void PEXFreePipelineContext( -#if NeedFunctionPrototypes - Display * /* display */, - PEXPipelineContext /* context */ -#endif -); - -extern void PEXFreeRenderer( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */ -#endif -); - -extern void PEXFreeRendererAttributes( -#if NeedFunctionPrototypes - PEXRendererAttributes * /* values */ -#endif -); - -extern void PEXFreeSCAttributes( -#if NeedFunctionPrototypes - PEXSCAttributes * /* values */ -#endif -); - -extern void PEXFreeSearchContext( -#if NeedFunctionPrototypes - Display * /* display */, - PEXSearchContext /* context */ -#endif -); - -extern void PEXFreeStructurePaths( -#if NeedFunctionPrototypes - unsigned long /* count */, - PEXStructurePath * /* paths */ -#endif -); - -extern void PEXFreeTableEntries( -#if NeedFunctionPrototypes - int /* table_type */, - unsigned int /* count */, - PEXPointer /* entries */ -#endif -); - -extern void PEXFreeWorkstation( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */ -#endif -); - -extern void PEXFreeWorkstationAttributes( -#if NeedFunctionPrototypes - PEXWorkstationAttributes * /* values */ -#endif -); - -extern void PEXGDP( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - long /* gdp_id */, - unsigned int /* count */, - PEXCoord * /* points */, - unsigned long /* length */, - char * /* data */ -#endif -); - -extern void PEXGDP2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - long /* gdp_id */, - unsigned int /* count */, - PEXCoord2D * /* points */, - unsigned long /* length */, - char * /* data */ -#endif -); - -extern void PEXGSE( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - long /* id */, - int /* length */, - char * /* data */ -#endif -); - -extern int PEXGeoNormFillArea( -#if NeedFunctionPrototypes - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - int /* color_type */, - PEXFacetData * /* facet_data */, - unsigned int /* count */, - PEXArrayOfVertex /* vertices */ -#endif -); - -extern int PEXGeoNormFillAreaSet( -#if NeedFunctionPrototypes - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - int /* color_type */, - unsigned int /* count */, - PEXFacetData * /* facet_data */, - PEXListOfVertex * /* vertex_lists */ -#endif -); - -extern int PEXGeoNormQuadrilateralMesh( -#if NeedFunctionPrototypes - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - int /* color_type */, - PEXArrayOfFacetData /* facet_data */, - unsigned int /* col_count */, - unsigned int /* row_count */, - PEXArrayOfVertex /* vertices */ -#endif -); - -extern int PEXGeoNormSetOfFillAreaSets( -#if NeedFunctionPrototypes - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - int /* color_type */, - unsigned int /* set_count */, - PEXArrayOfFacetData /* facet_data */, - unsigned int /* vertex_count */, - PEXArrayOfVertex /* vertices */, - unsigned int /* index_count */, - PEXConnectivityData * /* connectivity */ -#endif -); - -extern int PEXGeoNormTriangleStrip( -#if NeedFunctionPrototypes - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - int /* color_type */, - PEXArrayOfFacetData /* facet_data */, - unsigned int /* count */, - PEXArrayOfVertex /* vertices */ -#endif -); - -extern PEXStructurePath *PEXGetAncestors( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* path_part */, - unsigned long /* path_depth */, - unsigned long * /* count_return */ -#endif -); - -extern Status PEXGetDefinedIndices( -#if NeedFunctionPrototypes - Display * /* display */, - PEXLookupTable /* table */, - unsigned long * /* count_return */, - PEXTableIndex ** /* indices_return */ -#endif -); - -extern PEXStructurePath *PEXGetDescendants( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* path_part */, - unsigned long /* path_depth */, - unsigned long * /* count_return */ -#endif -); - -extern Status PEXGetElementInfo( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* whence1 */, - long /* offset1 */, - int /* whence2 */, - long /* offset2 */, - int /* float_format */, - unsigned long * /* count_return */, - PEXElementInfo ** /* info_return */ -#endif -); - -extern Status PEXGetEnumTypeInfo( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - unsigned long /* count */, - int * /* enum_types */, - unsigned long /* item_mask */, - unsigned long ** /* info_count_return */, - PEXEnumTypeDesc ** /* enum_info_return */ -#endif -); - -extern PEXExtensionInfo *PEXGetExtensionInfo( -#if NeedFunctionPrototypes - Display * /* display */ -#endif -); - -extern Status PEXGetImpDepConstants( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - unsigned long /* count */, - unsigned short * /* names */, - PEXImpDepConstant ** /* constants_return */ -#endif -); - -extern Status PEXGetNameSet( -#if NeedFunctionPrototypes - Display * /* display */, - PEXNameSet /* nameset */, - unsigned long * /* count_return */, - PEXName ** /* names_return */ -#endif -); - -extern char *PEXGetOCAddr( -#if NeedFunctionPrototypes - Display * /* display */, - int /* length */ -#endif -); - -extern PEXPDAttributes *PEXGetPickDevice( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - int /* pick_device_type */, - unsigned long /* value_mask */ -#endif -); - -extern PEXPMAttributes *PEXGetPickMeasure( -#if NeedFunctionPrototypes - Display * /* display */, - PEXPickMeasure /* pick_measure */, - unsigned long /* value_mask */ -#endif -); - -extern PEXPCAttributes *PEXGetPipelineContext( -#if NeedFunctionPrototypes - Display * /* display */, - PEXPipelineContext /* context */, - unsigned long * /* value_mask */ -#endif -); - -extern Status PEXGetPredefinedEntries( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - int /* table_type */, - unsigned int /* start */, - unsigned int /* count */, - PEXPointer * /* entries_return */ -#endif -); - -extern int PEXGetProtocolFloatFormat( -#if NeedFunctionPrototypes - Display * /* display */ -#endif -); - -extern PEXRendererAttributes *PEXGetRendererAttributes( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - unsigned long /* value_mask */ -#endif -); - -extern Status PEXGetRendererDynamics( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - unsigned long * /* tables_return */, - unsigned long * /* name_sets_return */, - unsigned long * /* attributes_return */ -#endif -); - -extern PEXSCAttributes *PEXGetSearchContext( -#if NeedFunctionPrototypes - Display * /* display */, - PEXSearchContext /* context */, - unsigned long /* value_mask */ -#endif -); - -extern int PEXGetSizeOCs( -#if NeedFunctionPrototypes - int /* float_format */, - int /* oc_count */, - PEXOCData * /* oc_data */ -#endif -); - -extern Status PEXGetStructureInfo( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* float_format */, - unsigned long /* value_mask */, - PEXStructureInfo * /* info_return */ -#endif -); - -extern PEXStructure *PEXGetStructuresInNetwork( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* which */, - unsigned long * /* count_return */ -#endif -); - -extern Status PEXGetTableEntries( -#if NeedFunctionPrototypes - Display * /* display */, - PEXLookupTable /* table */, - unsigned int /* start */, - unsigned int /* count */, - int /* value_type */, - int * /* table_type_return */, - PEXPointer * /* entries_return */ -#endif -); - -extern PEXPointer PEXGetTableEntry( -#if NeedFunctionPrototypes - Display * /* display */, - PEXLookupTable /* table */, - unsigned int /* index */, - int /* value_type */, - int * /* status_return */, - int * /* table_type_return */ -#endif -); - -extern Status PEXGetTableInfo( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - int /* table_type */, - PEXTableInfo * /* info_return */ -#endif -); - -extern PEXWorkstationAttributes *PEXGetWorkstationAttributes( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - unsigned long * /* value_mask */ -#endif -); - -extern Status PEXGetWorkstationDynamics( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - PEXWorkstationDynamics * /* dynamics_return */ -#endif -); - -extern Status PEXGetWorkstationPostings( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - unsigned long * /* count_return */, - PEXWorkstation ** /* postings_return */ -#endif -); - -extern Status PEXGetWorkstationViewRep( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - unsigned int /* index */, - int * /* update_return */, - PEXViewRep * /* req_view_return */, - PEXViewRep * /* cur_view_return */ -#endif -); - -extern void PEXIdentityMatrix( -#if NeedFunctionPrototypes - PEXMatrix /* transform_return */ -#endif -); - -extern void PEXIdentityMatrix2D( -#if NeedFunctionPrototypes - PEXMatrix3x3 /* transform_return */ -#endif -); - -extern int PEXInitialize( -#if NeedFunctionPrototypes - Display * /* display */, - PEXExtensionInfo ** /* info_return */, - int /* length */, - char * /* error_string */ -#endif -); - -extern int PEXInvertMatrix( -#if NeedFunctionPrototypes - PEXMatrix /* transform */, - PEXMatrix /* transform_return */ -#endif -); - -extern int PEXInvertMatrix2D( -#if NeedFunctionPrototypes - PEXMatrix3x3 /* transform */, - PEXMatrix3x3 /* transform_return */ -#endif -); - -extern void PEXLabel( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - long /* label */ -#endif -); - -extern char **PEXListFonts( -#if NeedFunctionPrototypes - Display * /* display */, - char * /* pattern */, - unsigned int /* max_names */, - unsigned long * /* count_return */ -#endif -); - -extern char **PEXListFontsWithInfo( -#if NeedFunctionPrototypes - Display * /* display */, - char * /* pattern */, - unsigned int /* max_names */, - unsigned long * /* count_return */, - PEXFontInfo ** /* info_return */ -#endif -); - -extern PEXFont PEXLoadFont( -#if NeedFunctionPrototypes - Display * /* display */, - char * /* font_name */ -#endif -); - -extern int PEXLookAtViewMatrix( -#if NeedFunctionPrototypes - PEXCoord * /* from */, - PEXCoord * /* to */, - PEXVector * /* up */, - PEXMatrix /* matrix_return */ -#endif -); - -extern Status PEXMapDCToWC( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - unsigned long /* dc_count */, - PEXDeviceCoord * /* dc_points */, - unsigned int * /* view_index_return */, - unsigned long * /* wc_count_return */, - PEXCoord ** /* wc_points_return */ -#endif -); - -extern Status PEXMapWCToDC( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - unsigned long /* wc_count */, - PEXCoord * /* wc_points */, - unsigned int /* view_index */, - unsigned long * /* dc_count_return */, - PEXDeviceCoord ** /* dc_points_return */ -#endif -); - -extern int PEXMapXCToNPC( -#if NeedFunctionPrototypes - int /* point_count */, - PEXDeviceCoord2D * /* points */, - unsigned int /* window_height */, - double /* z_dc */, - PEXDeviceCoord * /* viewport */, - PEXNPCSubVolume * /* npc_sub_volume */, - int /* view_count */, - PEXViewEntry * /* views */, - int * /* view_return */, - int * /* count_return */, - PEXCoord * /* points_return */ -#endif -); - -extern int PEXMapXCToNPC2D( -#if NeedFunctionPrototypes - int /* point_count */, - PEXDeviceCoord2D * /* points */, - unsigned int /* window_height */, - PEXDeviceCoord2D * /* viewport */, - PEXNPCSubVolume * /* npc_sub_volume */, - int /* view_count */, - PEXViewEntry * /* views */, - int * /* view_return */, - int * /* count_return */, - PEXCoord2D * /* points_return */ -#endif -); - -extern void PEXMarkers( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* count */, - PEXCoord * /* points */ -#endif -); - -extern void PEXMarkers2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* count */, - PEXCoord2D * /* points */ -#endif -); - -extern Status PEXMatchRenderingTargets( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - int /* depth */, - int /* type */, - Visual * /* visual */, - unsigned long /* max_targets */, - unsigned long * /* count_return */, - PEXRenderingTarget ** /* targets_return */ -#endif -); - -extern void PEXMatrixMult( -#if NeedFunctionPrototypes - PEXMatrix /* matrix1 */, - PEXMatrix /* matrix2 */, - PEXMatrix /* matrix_return */ -#endif -); - -extern void PEXMatrixMult2D( -#if NeedFunctionPrototypes - PEXMatrix3x3 /* matrix1 */, - PEXMatrix3x3 /* matrix2 */, - PEXMatrix3x3 /* matrix_return */ -#endif -); - -extern int PEXNPCToXCTransform( -#if NeedFunctionPrototypes - PEXNPCSubVolume * /* npc_sub_volume */, - PEXDeviceCoord * /* viewport */, - unsigned int /* window_height */, - PEXMatrix /* transform_return */ -#endif -); - -extern int PEXNPCToXCTransform2D( -#if NeedFunctionPrototypes - PEXNPCSubVolume * /* npc_sub_volume */, - PEXDeviceCoord2D * /* viewport */, - unsigned int /* window_height */, - PEXMatrix3x3 /* transform_return */ -#endif -); - -extern void PEXNURBCurve( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* rationality */, - int /* order */, - float * /* knots */, - unsigned int /* count */, - PEXArrayOfCoord /* points */, - double /* tmin */, - double /* tmax */ -#endif -); - -extern void PEXNURBSurface( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* rationality */, - int /* uorder */, - int /* vorder */, - float * /* uknots */, - float * /* vknots */, - unsigned int /* col_count */, - unsigned int /* row_count */, - PEXArrayOfCoord /* points */, - unsigned int /* curve_count */, - PEXListOfTrimCurve * /* trim_curves */ -#endif -); - -extern void PEXNoop( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */ -#endif -); - -extern int PEXNormalizeVectors( -#if NeedFunctionPrototypes - int /* count */, - PEXVector * /* vectors */, - PEXVector * /* vectors_return */ -#endif -); - -extern int PEXNormalizeVectors2D( -#if NeedFunctionPrototypes - int /* count */, - PEXVector2D * /* vectors */, - PEXVector2D * /* vectors_return */ -#endif -); - -extern int PEXOrthoProjMatrix( -#if NeedFunctionPrototypes - double /* height */, - double /* aspect */, - double /* near */, - double /* far */, - PEXMatrix /* matrix_return */ -#endif -); - -extern int PEXPerspProjMatrix( -#if NeedFunctionPrototypes - double /* fovy */, - double /* distance */, - double /* aspect */, - double /* near */, - double /* far */, - PEXMatrix /* matrix_return */ -#endif -); - -extern PEXPickPath *PEXPickAll( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - PEXRenderer /* renderer */, - int /* method */, - int /* max_hits */, - int /* pick_device_type */, - PEXPickRecord * /* pick_record */, - int * /* status_return */, - int * /* more_return */, - unsigned long * /* count_return */ -#endif -); - -extern PEXPickPath *PEXPickOne( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - PEXRenderer /* renderer */, - PEXStructure /* structure */, - int /* method */, - int /* pick_device_type */, - PEXPickRecord * /* pick_record */, - int * /* status_return */, - int * /* undetectable_return */ -#endif -); - -extern int PEXPolarViewMatrix( -#if NeedFunctionPrototypes - PEXCoord * /* from */, - double /* distance */, - double /* azimuth */, - double /* altitude */, - double /* twist */, - PEXMatrix /* matrix_return */ -#endif -); - -extern void PEXPolyline( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* count */, - PEXCoord * /* points */ -#endif -); - -extern void PEXPolyline2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* count */, - PEXCoord2D * /* points */ -#endif -); - -extern void PEXPolylineSetWithData( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* vertex_attributes */, - int /* color_type */, - unsigned int /* count */, - PEXListOfVertex * /* vertex_lists */ -#endif -); - -extern void PEXPostStructure( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - PEXStructure /* structure */, - double /* priority */ -#endif -); - -extern void PEXQuadrilateralMesh( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* shape_hint */, - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - int /* color_type */, - PEXArrayOfFacetData /* facet_data */, - unsigned int /* col_count */, - unsigned int /* row_count */, - PEXArrayOfVertex /* vertices */ -#endif -); - -extern PEXTextExtent *PEXQueryEncodedTextExtents( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - unsigned int /* font_table_index */, - int /* path */, - double /* expansion */, - double /* spacing */, - double /* height */, - int /* halign */, - int /* valign */, - unsigned long /* count */, - PEXListOfEncodedText * /* encoded_text */ -#endif -); - -extern PEXFontInfo *PEXQueryFont( -#if NeedFunctionPrototypes - Display * /* display */, - PEXFont /* font */ -#endif -); - -extern PEXTextExtent *PEXQueryTextExtents( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - unsigned int /* font_table_index */, - int /* path */, - double /* expansion */, - double /* spacing */, - double /* height */, - int /* halign */, - int /* valign */, - unsigned long /* count */, - PEXStringData * /* text */ -#endif -); - -extern void PEXRedrawAllStructures( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */ -#endif -); - -extern void PEXRedrawClipRegion( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - unsigned long /* count */, - PEXDeviceRect * /* clip_rectangles */ -#endif -); - -extern void PEXRemoveFromNameSet( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned long /* count */, - PEXName * /* names */ -#endif -); - -extern void PEXRenderElements( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - PEXStructure /* structure */, - int /* whence1 */, - long /* offset1 */, - int /* whence2 */, - long /* offset2 */ -#endif -); - -extern void PEXRenderNetwork( -#if NeedFunctionPrototypes - Display * /* display */, - Drawable /* drawable */, - PEXRenderer /* renderer */, - PEXStructure /* structure */ -#endif -); - -extern void PEXRestoreModelClipVolume( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */ -#endif -); - -extern int PEXRotate( -#if NeedFunctionPrototypes - int /* axis */, - double /* angle */, - PEXMatrix /* matrix_return */ -#endif -); - -extern void PEXRotate2D( -#if NeedFunctionPrototypes - double /* angle */, - PEXMatrix3x3 /* matrix_return */ -#endif -); - -extern int PEXRotateGeneral( -#if NeedFunctionPrototypes - PEXCoord * /* point1 */, - PEXCoord * /* point2 */, - double /* angle */, - PEXMatrix /* matrix_return */ -#endif -); - -extern void PEXScale( -#if NeedFunctionPrototypes - PEXVector * /* scale_vector */, - PEXMatrix /* matrix_return */ -#endif -); - -extern void PEXScale2D( -#if NeedFunctionPrototypes - PEXVector2D * /* scale_vector */, - PEXMatrix3x3 /* matrix_return */ -#endif -); - -extern Status PEXSearchNetwork( -#if NeedFunctionPrototypes - Display * /* display */, - PEXSearchContext /* context */, - PEXStructurePath ** /* path_return */ -#endif -); - -extern void PEXSendOCs( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* float_format */, - unsigned long /* oc_count */, - unsigned int /* length */, - char * /* encoded_ocs */ -#endif -); - -extern void PEXSetATextAlignment( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* halignment */, - int /* valignment */ -#endif -); - -extern void PEXSetATextHeight( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - double /* height */ -#endif -); - -extern void PEXSetATextPath( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* path */ -#endif -); - -extern void PEXSetATextStyle( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* style */ -#endif -); - -extern void PEXSetATextUpVector( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXVector2D * /* vector */ -#endif -); - -extern void PEXSetBFInteriorStyle( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* style */ -#endif -); - -extern void PEXSetBFInteriorStyleIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* index */ -#endif -); - -extern void PEXSetBFReflectionAttributes( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXReflectionAttributes * /* attributes */ -#endif -); - -extern void PEXSetBFReflectionModel( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* model */ -#endif -); - -extern void PEXSetBFSurfaceColor( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* color_type */, - PEXColor * /* color */ -#endif -); - -extern void PEXSetBFSurfaceColorIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetBFSurfaceInterpMethod( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* method */ -#endif -); - -extern void PEXSetCharExpansion( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - double /* expansion */ -#endif -); - -extern void PEXSetCharHeight( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - double /* height */ -#endif -); - -extern void PEXSetCharSpacing( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - double /* spacing */ -#endif -); - -extern void PEXSetCharUpVector( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXVector2D * /* vector */ -#endif -); - -extern void PEXSetColorApproxIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetCurveApprox( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* method */, - double /* tolerance */ -#endif -); - -extern void PEXSetDepthCueIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetEchoColor( -#if NeedFunctionPrototypes - Display * /* display */, - PEXRenderer /* renderer */, - int /* color_type */, - PEXColor * /* color */ -#endif -); - -extern void PEXSetEdgeBundleIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetEditingMode( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* mode */ -#endif -); - -extern void PEXSetElementPtr( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - int /* whence */, - long /* offset */ -#endif -); - -extern void PEXSetElementPtrAtLabel( -#if NeedFunctionPrototypes - Display * /* display */, - PEXStructure /* structure */, - long /* label */, - long /* offset */ -#endif -); - -extern void PEXSetFacetCullingMode( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* mode */ -#endif -); - -extern void PEXSetFacetDistinguishFlag( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* flag */ -#endif -); - -extern void PEXSetGlobalTransform( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXMatrix /* transform */ -#endif -); - -extern void PEXSetGlobalTransform2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXMatrix3x3 /* transform */ -#endif -); - -extern void PEXSetHLHSRID( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned long /* hlhsr_id */ -#endif -); - -extern void PEXSetIndividualASF( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned long /* attribute */, - int /* asf */ -#endif -); - -extern void PEXSetInteriorBundleIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetInteriorStyle( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* style */ -#endif -); - -extern void PEXSetInteriorStyleIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* index */ -#endif -); - -extern void PEXSetLightSourceState( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* enable_count */, - PEXTableIndex * /* enable */, - unsigned int /* disable_count */, - PEXTableIndex * /* disable */ -#endif -); - -extern void PEXSetLineBundleIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetLineColor( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* color_type */, - PEXColor * /* color */ -#endif -); - -extern void PEXSetLineColorIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetLineType( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* line_type */ -#endif -); - -extern void PEXSetLineWidth( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - double /* width */ -#endif -); - -extern void PEXSetLocalTransform( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* composition */, - PEXMatrix /* transform */ -#endif -); - -extern void PEXSetLocalTransform2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* composition */, - PEXMatrix3x3 /* transform */ -#endif -); - -extern void PEXSetMarkerBundleIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetMarkerColor( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* color_type */, - PEXColor * /* color */ -#endif -); - -extern void PEXSetMarkerColorIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetMarkerScale( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - double /* scale */ -#endif -); - -extern void PEXSetMarkerType( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* marker_type */ -#endif -); - -extern void PEXSetModelClipFlag( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* flag */ -#endif -); - -extern void PEXSetModelClipVolume( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* op */, - unsigned int /* count */, - PEXHalfSpace * /* half_spaces */ -#endif -); - -extern void PEXSetModelClipVolume2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* op */, - unsigned int /* count */, - PEXHalfSpace2D * /* half_spaces */ -#endif -); - -extern void PEXSetOfFillAreaSets( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* shape_hint */, - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - unsigned int /* edge_attributes */, - int /* contour_hint */, - int /* contours_all_one */, - int /* color_type */, - unsigned int /* set_count */, - PEXArrayOfFacetData /* facet_data */, - unsigned int /* vertex_count */, - PEXArrayOfVertex /* vertices */, - unsigned int /* index_count */, - PEXSwitch * /* edge_flags */, - PEXConnectivityData * /* connectivity */ -#endif -); - -extern void PEXSetParaSurfCharacteristics( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* psc_type */, - PEXPSCData * /* characteristics */ -#endif -); - -extern void PEXSetPatternAttributes( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord * /* ref_point */, - PEXVector * /* vector1 */, - PEXVector * /* vector2 */ -#endif -); - -extern void PEXSetPatternAttributes2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord2D * /* ref_point */ -#endif -); - -extern void PEXSetPatternSize( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - double /* width */, - double /* height */ -#endif -); - -extern void PEXSetPickID( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned long /* pick_id */ -#endif -); - -extern void PEXSetPolylineInterpMethod( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* method */ -#endif -); - -extern void PEXSetReflectionAttributes( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXReflectionAttributes * /* attributes */ -#endif -); - -extern void PEXSetReflectionModel( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* model */ -#endif -); - -extern void PEXSetRenderingColorModel( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* model */ -#endif -); - -extern void PEXSetSurfaceApprox( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* method */, - double /* utolerance */, - double /* vtolerance */ -#endif -); - -extern void PEXSetSurfaceColor( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* color_type */, - PEXColor * /* color */ -#endif -); - -extern void PEXSetSurfaceColorIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetSurfaceEdgeColor( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* color_type */, - PEXColor * /* color */ -#endif -); - -extern void PEXSetSurfaceEdgeColorIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetSurfaceEdgeFlag( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* flag */ -#endif -); - -extern void PEXSetSurfaceEdgeType( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* edge_type */ -#endif -); - -extern void PEXSetSurfaceEdgeWidth( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - double /* width */ -#endif -); - -extern void PEXSetSurfaceInterpMethod( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* method */ -#endif -); - -extern void PEXSetTableEntries( -#if NeedFunctionPrototypes - Display * /* display */, - PEXLookupTable /* table */, - unsigned int /* start */, - unsigned int /* count */, - int /* table_type */, - PEXPointer /* entries */ -#endif -); - -extern void PEXSetTextAlignment( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* halignment */, - int /* valignment */ -#endif -); - -extern void PEXSetTextBundleIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetTextColor( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* color_type */, - PEXColor * /* color */ -#endif -); - -extern void PEXSetTextColorIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetTextFontIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetTextPath( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* path */ -#endif -); - -extern void PEXSetTextPrecision( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* precision */ -#endif -); - -extern void PEXSetViewIndex( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* index */ -#endif -); - -extern void PEXSetWorkstationBufferMode( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - int /* buffer_mode */ -#endif -); - -extern void PEXSetWorkstationDisplayUpdateMode( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - int /* update_mode */ -#endif -); - -extern void PEXSetWorkstationHLHSRMode( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - int /* hlhsr_mode */ -#endif -); - -extern void PEXSetWorkstationViewPriority( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - unsigned int /* index1 */, - unsigned int /* index2 */, - int /* priority */ -#endif -); - -extern void PEXSetWorkstationViewRep( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - unsigned int /* view_index */, - PEXViewEntry * /* values */ -#endif -); - -extern void PEXSetWorkstationViewport( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - PEXViewport * /* viewport */ -#endif -); - -extern void PEXSetWorkstationWindow( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - PEXNPCSubVolume * /* workstation_window */ -#endif -); - -extern Status PEXStartOCs( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - int /* float_format */, - int /* oc_count */, - int /* word_count */ -#endif -); - -extern void PEXText( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord * /* origin */, - PEXVector * /* vector1 */, - PEXVector * /* vector2 */, - int /* length */, - char * /* string */ -#endif -); - -extern void PEXText2D( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - PEXCoord2D * /* origin */, - int /* length */, - char * /* string */ -#endif -); - -extern int PEXTransformPoints( -#if NeedFunctionPrototypes - PEXMatrix /* transform */, - int /* count */, - PEXCoord * /* points */, - PEXCoord * /* points_return */ -#endif -); - -extern int PEXTransformPoints2D( -#if NeedFunctionPrototypes - PEXMatrix3x3 /* transform */, - int /* count */, - PEXCoord2D * /* points */, - PEXCoord2D * /* points_return */ -#endif -); - -extern void PEXTransformPoints2DH( -#if NeedFunctionPrototypes - PEXMatrix3x3 /* transform */, - int /* count */, - PEXCoord * /* points */, - PEXCoord * /* points_return */ -#endif -); - -extern void PEXTransformPoints4D( -#if NeedFunctionPrototypes - PEXMatrix /* transform */, - int /* count */, - PEXCoord4D * /* points */, - PEXCoord4D * /* points_return */ -#endif -); - -extern void PEXTransformVectors( -#if NeedFunctionPrototypes - PEXMatrix /* transform */, - int /* count */, - PEXVector * /* vectors */, - PEXVector * /* vectors_return */ -#endif -); - -extern void PEXTransformVectors2D( -#if NeedFunctionPrototypes - PEXMatrix3x3 /* transform */, - int /* count */, - PEXVector2D * /* vectors */, - PEXVector2D * /* vectors_return */ -#endif -); - -extern void PEXTranslate( -#if NeedFunctionPrototypes - PEXVector * /* trans_vector */, - PEXMatrix /* matrix_return */ -#endif -); - -extern void PEXTranslate2D( -#if NeedFunctionPrototypes - PEXVector2D * /* trans_vector */, - PEXMatrix3x3 /* matrix_return */ -#endif -); - -extern void PEXTriangleStrip( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */, - unsigned int /* facet_attributes */, - unsigned int /* vertex_attributes */, - int /* color_type */, - PEXArrayOfFacetData /* facet_data */, - unsigned int /* count */, - PEXArrayOfVertex /* vertices */ -#endif -); - -extern void PEXUnloadFont( -#if NeedFunctionPrototypes - Display * /* display */, - PEXFont /* font */ -#endif -); - -extern void PEXUnpostAllStructures( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */ -#endif -); - -extern void PEXUnpostStructure( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */, - PEXStructure /* structure */ -#endif -); - -extern void PEXUpdatePickMeasure( -#if NeedFunctionPrototypes - Display * /* display */, - PEXPickMeasure /* pick_measure */, - int /* pick_device_type */, - PEXPickRecord * /* pick_record */ -#endif -); - -extern void PEXUpdateWorkstation( -#if NeedFunctionPrototypes - Display * /* display */, - PEXWorkstation /* workstation */ -#endif -); - -extern int PEXViewMappingMatrix( -#if NeedFunctionPrototypes - PEXCoord2D * /* frame */, - PEXNPCSubVolume * /* viewport */, - int /* perspective */, - PEXCoord * /* prp */, - double /* view_plane */, - double /* back_plane */, - double /* front_plane */, - PEXMatrix /* matrix_return */ -#endif -); - -extern int PEXViewMappingMatrix2D( -#if NeedFunctionPrototypes - PEXCoord2D * /* frame */, - PEXCoord2D * /* viewport */, - PEXMatrix3x3 /* matrix_return */ -#endif -); - -extern int PEXViewOrientationMatrix( -#if NeedFunctionPrototypes - PEXCoord * /* vrp */, - PEXVector * /* vpn */, - PEXVector * /* vup */, - PEXMatrix /* matrix_return */ -#endif -); - -extern int PEXViewOrientationMatrix2D( -#if NeedFunctionPrototypes - PEXCoord2D * /* vrp */, - PEXVector2D * /* vup */, - PEXMatrix3x3 /* matrix_return */ -#endif -); - -extern int PEXXCToNPCTransform( -#if NeedFunctionPrototypes - PEXNPCSubVolume * /* npc_sub_volume */, - PEXDeviceCoord * /* viewport */, - unsigned int /* window_height */, - PEXMatrix /* transform_return */ -#endif -); - -extern int PEXXCToNPCTransform2D( -#if NeedFunctionPrototypes - PEXNPCSubVolume * /* npc_sub_volume */, - PEXDeviceCoord2D * /* viewport */, - unsigned int /* window_height */, - PEXMatrix3x3 /* transform_return */ -#endif -); - -extern unsigned long PEXCountOCs( -#if NeedFunctionPrototypes - int /* float_format */, - unsigned long /* length */, - char * /* encoded_ocs */ -#endif -); - -_XFUNCPROTOEND - -#endif /* _PEXLIB_H_ */ Index: xc/lib/PEX5/PEXlibint.h diff -u xc/lib/PEX5/PEXlibint.h:3.3 xc/lib/PEX5/PEXlibint.h:removed --- xc/lib/PEX5/PEXlibint.h:3.3 Fri Dec 14 14:53:39 2001 +++ xc/lib/PEX5/PEXlibint.h Sat Feb 28 21:41:20 2004 @@ -1,1056 +0,0 @@ -/* $Xorg: PEXlibint.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */ - -/****************************************************************************** - -Copyright 1992, 1998 The Open Group - -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. - -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 -OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987,1991 by Digital Equipment Corporation, Maynard, Massachusetts - - All Rights Reserved - -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 Digital not be used in advertising or publicity -pertaining to distribution of the software without specific, written prior -permission. Digital make no representations about the suitability -of this software for any purpose. It is provided "as is" without express or -implied warranty. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL 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. -******************************************************************************/ - -#ifndef _PEXLIBINT_H_ -#define _PEXLIBINT_H_ - -#define NEED_REPLIES -#include -#include -#include "PEXproto.h" -#include "pl_convert.h" -#include "pl_store.h" -#include "pl_extract.h" -#include "pl_xdata.h" - - -/* ------------------------------------------------------------------------- - * Display extension data structures and macros. - * ------------------------------------------------------------------------- */ - -/* - * For each display initialized by PEXInitialize(), a record is allocated - * which holds various information about that display. These records are - * maintained in a linked list. The record for the most recently referenced - * display is always kept at the beginning of the list (for quick access). - */ - -typedef struct PEXDisplayInfo -{ - Display *display; /* pointer to X display structure */ - XExtCodes *extCodes; /* extension codes */ - PEXExtensionInfo *extInfo; /* extension info */ - unsigned char extOpcode; /* opcode for pex extension */ - unsigned short fpFormat; /* floating point format */ - char fpConvert; /* flag for floating point conversion */ - PEXEnumTypeDesc *fpSupport; /* float formats supported by server */ - int fpCount; /* number of float formats supported */ - XID lastResID; /* renderer/structure ID of last OC */ - int lastReqType; /* request type (store/rend) of last OC */ - int lastReqNum; /* request number of last OC */ - struct PEXDisplayInfo *next; /* next in list */ -} PEXDisplayInfo; - - -/* - * Insert a new record in the beginning of the linked list. - */ - -#define PEXAddDisplayInfo(_display, _info) \ -\ -{ \ - _info->display = _display; \ -\ - _info->next = PEXDisplayInfoHeader; \ - PEXDisplayInfoHeader = _info; \ -} - - -/* - * Remove the record assosicated with '_display' from the linked list - * and return a pointer to it in '_info'. - */ - -#define PEXRemoveDisplayInfo(_display, _info) \ -\ -{ \ - PEXDisplayInfo *prev = NULL; \ -\ - _info = PEXDisplayInfoHeader; \ -\ - while (_info && _info->display != _display) \ - { \ - prev = _info; \ - _info = _info->next; \ - } \ -\ - if (_info) \ - if (!prev) \ - PEXDisplayInfoHeader = _info->next; \ - else \ - prev->next = _info->next; \ -} - - -/* - * Return the info assosicated with '_display' in '_info'. - * If the info is not the first in the list, move it to the front. - */ - -#define PEXGetDisplayInfo(_display, _info) \ -\ -{ \ - if ((_info = PEXDisplayInfoHeader)) \ - { \ - if (PEXDisplayInfoHeader->display != _display) \ - { \ - PEXDisplayInfo *prev = PEXDisplayInfoHeader; \ -\ - _info = _info->next; \ - while (_info && _info->display != _display) \ - { \ - prev = _info; \ - _info = _info->next; \ - } \ -\ - if (_info) \ - { \ - prev->next = _info->next; \ - _info->next = PEXDisplayInfoHeader; \ - PEXDisplayInfoHeader = _info; \ - } \ - } \ - } \ -} - - - -/* ------------------------------------------------------------------------- - * Memory related macros. - * ------------------------------------------------------------------------- */ - -#define PAD(_size) (3 - (((_size) + 3) & 0x3)) - -#define PADDED_BYTES(_bytes) (_bytes + PAD (_bytes)) - -#define NUMWORDS(_size) (((unsigned int) ((_size) + 3)) >> 2) - -#define NUMBYTES(_len) (((unsigned int) (_len)) << 2) - -#define LENOF(_ctype) (SIZEOF (_ctype) >> 2) - - -/* - * Count the number of ones in a longword. - */ - -#define CountOnes(_mask, _countReturn) \ - _countReturn = ((_mask) - (((_mask)>>1)&0x77777777) \ - - (((_mask)>>2)&0x33333333) - (((_mask)>>3)&0x11111111)); \ - _countReturn = ((((_countReturn)+((_countReturn)>>4)) & 0x0F0F0F0F) % 255) - - - -/* ------------------------------------------------------------------------- - * Macros for dealing with the transport buffer. - * ------------------------------------------------------------------------- */ - -/* - * The maximum protocol request size. - */ - -#define MAX_REQUEST_SIZE ((1<<16) - 1) - - -/* - * Has the X transport buffer been flushed? - */ - -#define XBufferFlushed(_display) \ - ((_display)->buffer == (_display)->bufptr) - - -/* - * The number of bytes left in the X transport buffer. - */ - -#define BytesLeftInXBuffer(_display) \ - ((_display)->bufmax - (_display)->bufptr) - - -/* - * The number of words left in the X transport buffer. - */ - -#define WordsLeftInXBuffer(_display) \ - (((_display)->bufmax - (_display)->bufptr) >> 2) - - -/* - * See if XSynchronize has been called. If so, send request right away. - */ - -#define PEXSyncHandle(_display)\ - if ((_display)->synchandler) (*(_display)->synchandler) (_display) - - -/* - * Read a reply into a scratch buffer. - */ - -#define XREAD_INTO_SCRATCH(_display, _pBuf, _numBytes) \ - _pBuf = (char *) _XAllocTemp (_display, (unsigned long) (_numBytes)); \ - _XRead (_display, _pBuf, (long) (_numBytes)); - -#define FINISH_WITH_SCRATCH(_display, _pBuf, _numBytes) \ - _XFreeTemp (_display, _pBuf, (unsigned long) (_numBytes)); - - -/* ------------------------------------------------------------------------- - * Output Command request header. The pexOpCode field specifies the type - * of request - Render Output Commands or Store Elements. - * ------------------------------------------------------------------------- */ - -typedef struct pexOCRequestHeader -{ - CARD8 extOpcode; - CARD8 pexOpcode; - CARD16 reqLength B16; - INT16 fpFormat B16; - CARD16 pad B16; - CARD32 target B32; - CARD32 numCommands B32; -} pexOCRequestHeader; - - - -/* ------------------------------------------------------------------------- - * Macros for setting up requests. - * ------------------------------------------------------------------------- */ - -/* - * Request names and opcodes. - */ - -#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) -#define REQNAME(_name_) pex##_name_##Req -#define REQOPCODE(_name_) PEXRC##_name_ -#define REQSIZE(_name_) sz_pex##_name_##Req -#else -#define REQNAME(_name_) pex/**/_name_/**/Req -#define REQOPCODE(_name_) PEXRC/**/_name_ -#define REQSIZE(_name_) sz_pex/**/_name_/**/Req -#endif - - -/* - * PEXGetReq sets up a request to be sent to the X server. If there isn't - * enough room left in the X buffer, it is flushed before the new request - * is started. - */ - -#define PEXGetReq(_name, _req) \ - if ((display->bufptr + REQSIZE(_name)) > display->bufmax) \ - _XFlush (display); \ - _req = (char *) (display->last_req = display->bufptr); \ - display->bufptr += REQSIZE(_name); \ - display->request++ - - -/* - * PEXGetReqExtra is the same as PEXGetReq and except that an additional - * "n" bytes are allocated after the request. "n" will be padded to a word - * boundary. - */ - -#define PEXGetReqExtra(_name, _n, _req) \ - if ((display->bufptr + REQSIZE(_name) + \ - PADDED_BYTES (_n)) > display->bufmax) _XFlush (display); \ - _req = (char *) (display->last_req = display->bufptr); \ - display->bufptr += (REQSIZE(_name) + PADDED_BYTES (_n)); \ - display->request++ - - -/* - * BEGIN_REQUEST_HEADER and END_REQUEST_HEADER are used to hide - * the extra work that has to be done on 64 bit clients. On such - * machines, all structure pointers must point to an 8 byte boundary. - * As a result, we must first store the request header info in - * a static data stucture, then bcopy it into the transport buffer. - */ - -#ifndef WORD64 - -#define BEGIN_REQUEST_HEADER(_name, _pBuf, _pReq) \ -{ \ - PEXDisplayInfo *pexDisplayInfo; \ - PEXGetDisplayInfo (display, pexDisplayInfo); \ - _pReq = (REQNAME(_name) *) _pBuf; - -#define END_REQUEST_HEADER(_name, _pBuf, _pReq) \ - _pBuf += REQSIZE(_name); \ -} - -#else /* WORD64 */ - -#define BEGIN_REQUEST_HEADER(_name, _pBuf, _pReq) \ -{ \ - PEXDisplayInfo *pexDisplayInfo; \ - REQNAME(_name) tReq; \ - PEXGetDisplayInfo (display, pexDisplayInfo); \ - _pReq = &tReq; - -#define END_REQUEST_HEADER(_name, _pBuf, _pReq) \ - memcpy (_pBuf, _pReq, REQSIZE(_name)); \ - _pBuf += REQSIZE(_name); \ -} - -#endif /* WORD64 */ - - -/* - * Macros used to store the request header info. - */ - -#define PEXStoreReqHead(_name, _req) \ - _req->reqType = pexDisplayInfo->extOpcode; \ - _req->opcode = REQOPCODE(_name); \ - _req->length = (REQSIZE(_name)) >> 2; - - -#define PEXStoreFPReqHead(_name, _fpFormat, _req) \ - _req->reqType = pexDisplayInfo->extOpcode; \ - _req->opcode = REQOPCODE(_name); \ - _req->length = (REQSIZE(_name)) >> 2; \ - _req->fpFormat = _fpFormat; - -#define PEXStoreReqExtraHead(_name, _extraBytes, _req) \ - _req->reqType = pexDisplayInfo->extOpcode; \ - _req->opcode = REQOPCODE(_name); \ - _req->length = (REQSIZE(_name) + PADDED_BYTES (_extraBytes)) >> 2; - -#define PEXStoreFPReqExtraHead(_name, _fpFormat, _extraBytes, _req) \ - _req->reqType = pexDisplayInfo->extOpcode; \ - _req->opcode = REQOPCODE(_name); \ - _req->length = (REQSIZE(_name) + PADDED_BYTES (_extraBytes)) >> 2; \ - _req->fpFormat = _fpFormat; - - - -/* - * Return flag for floating point conversion, as well as the - * float format to convert to. The call to this macro must come - * after BEGIN_REQUEST_HEADER and before END_REQUEST_HEADER. - */ - -#define CHECK_FP(_fpConvert, _fpFormat) \ - _fpConvert = pexDisplayInfo->fpConvert; \ - _fpFormat = pexDisplayInfo->fpFormat; - - - -/* ------------------------------------------------------------------------- - * Get pointer to a structure in a buffer stream. On 64 bit clients, - * all structure pointers must point to an 8 byte boundary. As a result, - * we must first bcopy into a static data structure, then return a pointer - * to this static data structure. - * - * Note: GET_STRUCT_PTR must be used in the declaration section of a block. - * ------------------------------------------------------------------------- */ - -#ifndef WORD64 - -#define GET_STRUCT_PTR(_name, _pBuf, _pStruct) \ - _pStruct = (_name *) _pBuf; - -#else /* WORD64 */ - -#define GET_STRUCT_PTR(_name, _pBuf, _pStruct) \ - _name tStruct; \ - memcpy (&tStruct, _pBuf, SIZEOF (_name)); \ - _pStruct = &tStruct; - -#endif /* WORD64 */ - - - -/* ------------------------------------------------------------------------- - * Color related macros. - * ------------------------------------------------------------------------- */ - -/* - * Protocol color size based on color type (in bytes). - */ - -#define GetColorSize(_type) \ - ((_type) == PEXColorTypeIndexed ? SIZEOF (pexIndexedColor) : \ - ((_type) == PEXColorTypeRGB8 ? SIZEOF (pexRgb8Color) : \ - ((_type) == PEXColorTypeRGB16 ? SIZEOF (pexRgb16Color) : \ - SIZEOF (pexRgbFloatColor)))) - -/* - * Protocol color size based on color type (in words). - */ - -#define GetColorLength(_type)\ - ((_type) == PEXColorTypeIndexed ? LENOF (pexIndexedColor) :\ - ((_type) == PEXColorTypeRGB8 ? LENOF (pexRgb8Color) :\ - ((_type) == PEXColorTypeRGB16 ? LENOF (pexRgb16Color) : \ - LENOF (pexRgbFloatColor)))) - -/* - * Client color size based on color type (in bytes). - */ - -#define GetClientColorSize(_type) \ - ((_type) == PEXColorTypeIndexed ? sizeof (PEXColorIndexed) : \ - ((_type) == PEXColorTypeRGB8 ? sizeof (PEXColorRGB8) : \ - ((_type) == PEXColorTypeRGB16 ? sizeof (PEXColorRGB16) : \ - sizeof (PEXColorRGB)))) - - - -/* ------------------------------------------------------------------------- - * Constants - * ------------------------------------------------------------------------- */ - -/* - * IEEE-754-32 is the most common floating point type. Vendors who have - * a different native floating point format should define NATIVE_FP_FORMAT - * at compile time via the -D switch (this is done by modifying the vendors - * config file to include a "#define PexNativeFPFormat your_format". - */ - -#ifndef NATIVE_FP_FORMAT -#define NATIVE_FP_FORMAT PEXIEEE_754_32 -#endif - - -/* - * The PEXlib SI supports Cray floating point format, but this constant - * is not a registered float format, so it's not found in PEX.h. We define - * it here. - * - * If a vendor wants to add support for his own float format in PEXlib, he - * should add a consant here for the format, and bump up NUM_FP_FORMATS. - * Then he must modify the fp conversion function table found in the file - * pl_global_def.h to include his format. - * - * Note : Floating point formats 1-4 are registered with PEX at this time. - */ - -#define PEXCRAY_Floating 5 - -#define NUM_FP_FORMATS 5 - - -/* - * Maximum size of pick cache in bytes. - */ - -#define MAX_PICK_CACHE_SIZE 2048 - - -/* - * Protocol data structure sizes. SIZEOF (rec) == sz_rec. - */ - -#define sz_pexAccumulateStateReq 12 -#define sz_pexAddToNameSet 4 -#define sz_pexRemoveFromNameSet 4 -#define sz_pexAnnotationText 32 -#define sz_pexAnnotationText2D 24 -#define sz_pexApplicationData 8 -#define sz_pexATextStyle 8 -#define sz_pexBeginPickAllReq 28 -#define sz_pexBeginPickOneReq 20 -#define sz_pexBeginRenderingReq 12 -#define sz_pexBeginStructureReq 12 -#define sz_pexCellArray 48 -#define sz_pexCellArray2D 28 -#define sz_pexChangeNameSetReq 12 -#define sz_pexChangePickDeviceReq 20 -#define sz_pexChangePipelineContextReq 24 -#define sz_pexChangeRendererReq 16 -#define sz_pexChangeSearchContextReq 16 -#define sz_pexChangeStructureRefsReq 12 -#define sz_pexCharExpansion 8 -#define sz_pexCharHeight 8 -#define sz_pexATextHeight 8 -#define sz_pexCharSpacing 8 -#define sz_pexCharUpVector 12 -#define sz_pexATextUpVector 12 -#define sz_pexCopyElementsReq 36 -#define sz_pexCopyLookupTableReq 12 -#define sz_pexCopyNameSetReq 12 -#define sz_pexCopyPipelineContextReq 24 -#define sz_pexCopySearchContextReq 16 -#define sz_pexCopyStructureReq 12 -#define sz_pexCreateLookupTableReq 16 -#define sz_pexCreatePickMeasureReq 16 -#define sz_pexCreatePipelineContextReq 24 -#define sz_pexCreateRendererReq 20 -#define sz_pexCreateSearchContextReq 16 -#define sz_pexCreateWorkstationReq 76 -#define sz_pexFacetCullingMode 8 -#define sz_pexCurveApprox 12 -#define sz_pexDeleteBetweenLabelsReq 16 -#define sz_pexDeleteElementsReq 24 -#define sz_pexDeleteElementsToLabelReq 20 -#define sz_pexDeleteTableEntriesReq 12 -#define sz_pexDestroyStructuresReq 8 -#define sz_pexFacetDistinguishFlag 8 -#define sz_pexElementSearchReply 32 -#define sz_pexElementSearchReq 28 -#define sz_pexEndPickAllReply 32 -#define sz_pexEndPickAllReq 8 -#define sz_pexEndPickOneReply 32 -#define sz_pexEndPickOneReq 8 -#define sz_pexEndRenderingReq 12 -#define sz_pexEscapeReq 8 -#define sz_pexEscapeWithReplyReq sz_pexEscapeReq -#define sz_pexEscapeWithReplyReply 32 -#define sz_pexExecuteStructure 8 -#define sz_pexExtendedCellArray 52 -#define sz_pexFillAreaWithData 16 -#define sz_pexFillAreaSetWithData 20 -#define sz_pexFetchElementsReply 32 -#define sz_pexFetchElementsReq 28 -#define sz_pexFillArea 8 -#define sz_pexFillArea2D 8 -#define sz_pexFillAreaSet 12 -#define sz_pexFillAreaSet2D 12 -#define sz_pexGDP 16 -#define sz_pexGDP2D 16 -#define sz_pexGetAncestorsReply 32 -#define sz_pexGetAncestorsReq 16 -#define sz_pexGetDescendantsReq sz_pexGetAncestorsReq -#define sz_pexGetDefinedIndicesReply 32 -#define sz_pexGetElementInfoReply 32 -#define sz_pexGetElementInfoReq 28 -#define sz_pexGetEnumTypeInfoReply 32 -#define sz_pexGetEnumTypeInfoReq 16 -#define sz_pexGetExtensionInfoReply 32 -#define sz_pexGetExtensionInfoReq 8 -#define sz_pexGetImpDepConstantsReply 32 -#define sz_pexGetImpDepConstantsReq 16 -#define sz_pexGetNameSetReply 32 -#define sz_pexGetPickDeviceReply 32 -#define sz_pexGetPickDeviceReq 16 -#define sz_pexGetPickMeasureReply 32 -#define sz_pexGetPickMeasureReq 12 -#define sz_pexGetPipelineContextReply 32 -#define sz_pexGetPipelineContextReq 24 -#define sz_pexGetPredefinedEntriesReply 32 -#define sz_pexGetPredefinedEntriesReq 20 -#define sz_pexGetRendererAttributesReply 32 -#define sz_pexGetRendererAttributesReq 16 -#define sz_pexGetRendererDynamicsReply 32 -#define sz_pexGetSearchContextReply 32 -#define sz_pexGetSearchContextReq 16 -#define sz_pexGetStructureInfoReply 32 -#define sz_pexGetStructureInfoReq 12 -#define sz_pexGetStructuresInNetworkRepl 32 -#define sz_pexGetStructuresInNetworkReq 12 -#define sz_pexGetTableEntriesReply 32 -#define sz_pexGetTableEntriesReq 16 -#define sz_pexGetTableEntryReply 32 -#define sz_pexGetTableEntryReq 16 -#define sz_pexGetTableInfoReply 32 -#define sz_pexGetTableInfoReq 12 -#define sz_pexGetWorkstationAttributesReply 32 -#define sz_pexGetWorkstationAttributesReq 20 -#define sz_pexGetWorkstationDynamicsReply 32 -#define sz_pexGetWorkstationDynamicsReq 8 -#define sz_pexGetWorkstationPostingsReply 32 -#define sz_pexGetWorkstationViewRepReply 32 -#define sz_pexGetWorkstationViewRepReq 12 -#define sz_pexGlobalTransform 68 -#define sz_pexGlobalTransform2D 40 -#define sz_pexGSE 12 -#define sz_pexHLHSRID 8 -#define sz_pexInteriorStyle 8 -#define sz_pexBFInteriorStyle 8 -#define sz_pexLabel 8 -#define sz_pexLightSourceState 8 -#define sz_pexLineType 8 -#define sz_pexLineWidth 8 -#define sz_pexSurfaceEdgeWidth 8 -#define sz_pexListFontsReply 32 -#define sz_pexListFontsReq 8 -#define sz_pexListFontsWithInfoReply 32 -#define sz_pexListFontsWithInfoReq 12 -#define sz_pexLoadFontReq 12 -#define sz_pexLocalTransform 72 -#define sz_pexLocalTransform2D 44 -#define sz_pexLookupTable 4 -#define sz_pexMapDCtoWCReply 32 -#define sz_pexMapDCtoWCReq 16 -#define sz_pexMapWCtoDCReply 32 -#define sz_pexMapWCtoDCReq 16 -#define sz_pexMarkers 4 -#define sz_pexMarkers2D 4 - -#define sz_pexMarkerBundleIndex 8 -#define sz_pexTextBundleIndex 8 -#define sz_pexLineBundleIndex 8 -#define sz_pexInteriorBundleIndex 8 -#define sz_pexInteriorStyleIndex 8 -#define sz_pexBFInteriorStyleIndex 8 -#define sz_pexEdgeBundleIndex 8 -#define sz_pexViewIndex 8 -#define sz_pexDepthCueIndex 8 -#define sz_pexColorApproxIndex 8 - -#define sz_pexMarkerColorIndex 8 -#define sz_pexTextColorIndex 8 -#define sz_pexLineColorIndex 8 -#define sz_pexSurfaceColorIndex 8 -#define sz_pexBFSurfaceColorIndex 8 -#define sz_pexSurfaceEdgeColorIndex 8 - -#define sz_pexMarkerColor 8 -#define sz_pexTextColor 8 -#define sz_pexLineColor 8 -#define sz_pexSurfaceColor 8 -#define sz_pexBFSurfaceColor 8 -#define sz_pexSurfaceEdgeColor 8 - -#define sz_pexTextFontIndex 8 - -#define sz_pexMarkerScale 8 -#define sz_pexMarkerType 8 -#define sz_pexMatchRenderingTargetsReply 32 -#define sz_pexMatchRenderingTargetsReq 20 -#define sz_pexMaxHitsReachedEvent 32 -#define sz_pexModelClipFlag 8 -#define sz_pexModelClipVolume 8 -#define sz_pexModelClipVolume2D 8 -#define sz_pexNoop 4 -#define sz_pexNURBCurve 24 -#define sz_pexNURBSurface 28 -#define sz_pexParaSurfCharacteristics 8 -#define sz_pexPatternAttributes 40 -#define sz_pexPatternAttributes2D 12 -#define sz_pexPatternSize 12 -#define sz_pexPickAllReply 32 -#define sz_pexPickAllReq 20 -#define sz_pexPickID 8 -#define sz_pexPickOneReply 32 -#define sz_pexPickOneReq 20 -#define sz_pexPolyline 4 -#define sz_pexPolyline2D 4 -#define sz_pexPolylineInterpMethod 8 -#define sz_pexPolylineSetWithData 12 -#define sz_pexPostStructureReq 20 -#define sz_pexQuadrilateralMesh 16 -#define sz_pexQueryFontReply 32 -#define sz_pexQueryFontReq 8 -#define sz_pexQueryTextExtentsReply 32 -#define sz_pexQueryTextExtentsReq 36 -#define sz_pexRedrawClipRegionReq 12 -#define sz_pexRenderElementsReq 28 -#define sz_pexRenderNetworkReq 16 -#define sz_pexRenderOutputCommandsReq 16 -#define sz_pexRenderingColorModel 8 -#define sz_pexReq 4 -#define sz_pexResourceReq 8 -#define sz_pexFreeLookupTableReq sz_pexResourceReq -#define sz_pexGetDefinedIndicesReq sz_pexResourceReq -#define sz_pexFreePipelineContextReq sz_pexResourceReq -#define sz_pexFreeRendererReq sz_pexResourceReq -#define sz_pexGetRendererDynamicsReq sz_pexResourceReq -#define sz_pexEndStructureReq sz_pexResourceReq -#define sz_pexCreateStructureReq sz_pexResourceReq -#define sz_pexCreateNameSetReq sz_pexResourceReq -#define sz_pexFreeNameSetReq sz_pexResourceReq -#define sz_pexGetNameSetReq sz_pexResourceReq -#define sz_pexFreeSearchContextReq sz_pexResourceReq -#define sz_pexFreeWorkstationReq sz_pexResourceReq -#define sz_pexRedrawAllStructuresReq sz_pexResourceReq -#define sz_pexUpdateWorkstationReq sz_pexResourceReq -#define sz_pexExecuteDeferredActionsReq sz_pexResourceReq -#define sz_pexUnpostAllStructuresReq sz_pexResourceReq -#define sz_pexGetWorkstationPostingsReq sz_pexResourceReq -#define sz_pexFreePickMeasureReq sz_pexResourceReq -#define sz_pexUnloadFontReq sz_pexResourceReq -#define sz_pexSearchNetworkReq sz_pexResourceReq -#define sz_pexRestoreModelClipVolume 4 -#define sz_pexSetOfFillAreaSets 24 -#define sz_pexSearchNetworkReply 32 -#define sz_pexIndividualASF 12 -#define sz_pexSetEditingModeReq 12 -#define sz_pexSetElementPointerAtLabelReq 16 -#define sz_pexSetElementPointerReq 16 -#define sz_pexSetTableEntriesReq 16 -#define sz_pexSetWorkstationBufferModeReq 12 -#define sz_pexSetWorkstationDisplayUpdateModeReq 12 -#define sz_pexSetWorkstationHLHSRModeReq 12 -#define sz_pexSetWorkstationViewPriorityReq 16 -#define sz_pexSetWorkstationViewRepReq 172 -#define sz_pexSetWorkstationViewportReq 32 -#define sz_pexSetWorkstationWindowReq 36 -#define sz_pexStoreElementsReq 16 -#define sz_pexSurfaceApprox 16 -#define sz_pexSurfaceEdgeFlag 8 -#define sz_pexSurfaceEdgeType 8 -#define sz_pexSurfaceInterpMethod 8 -#define sz_pexBFSurfaceInterpMethod 8 -#define sz_pexReflectionAttributes 28 -#define sz_pexBFReflectionAttributes 28 -#define sz_pexReflectionModel 8 -#define sz_pexBFReflectionModel 8 -#define sz_pexText 44 -#define sz_pexText2D 16 -#define sz_pexTextAlignment 8 -#define sz_pexATextAlignment 8 -#define sz_pexTextPath 8 -#define sz_pexATextPath 8 -#define sz_pexTextPrecision 8 -#define sz_pexTriangleStrip 16 -#define sz_pexUnpostStructureReq 12 -#define sz_pexUpdatePickMeasureReq 12 -#define sz_pexCieColor 12 -#define sz_pexColor 12 -#define sz_pexColorApproxEntry 40 -#define sz_pexColorSpecifier 4 -#define sz_pexColorEntry sz_pexColorSpecifier -#define sz_pexCoord2D 8 -#define sz_pexCoord3D 12 -#define sz_pexCoord4D 16 -#define sz_pexCullMode 2 -#define sz_pexCurveApproxData 8 -#define sz_pexDepthCueEntry 24 -#define sz_pexDeviceCoord 8 -#define sz_pexDeviceCoord2D 4 -#define sz_pexDeviceRect 8 -#define sz_pexEdgeBundleEntry 12 -#define sz_pexElementInfo 4 -#define sz_pexElementPos 8 -#define sz_pexElementRange 16 -#define sz_pexElementRef 8 -#define sz_pexEnumTypeDesc 4 -#define sz_pexEnumTypeIndex 4 -#define sz_pexEscapeSetEchoColorData 8 -#define sz_pexExtentInfo 24 -#define sz_pexFloatColor 12 -#define sz_pexFont 4 -#define sz_pexFontInfo 20 -#define sz_pexFontProp 8 -#define sz_pexHalfSpace 24 -#define sz_pexHalfSpace2D 16 -#define sz_pexHlsColor 12 -#define sz_pexHsvColor 12 -#define sz_pexIndexedColor 4 -#define sz_pexInteriorBundleEntry 28 -#define sz_pexLightEntry 48 -#define sz_pexLineBundleEntry 20 -#define sz_pexLocalTransform2DData 40 -#define sz_pexLocalTransform3DData 68 -#define sz_pexMarkerBundleEntry 12 -#define sz_pexMatrix 64 -#define sz_pexMatrix3X3 36 -#define sz_pexMonoEncoding 8 -#define sz_pexName 4 -#define sz_pexNameSet 4 -#define sz_pexNameSetPair 8 -#define sz_pexNpcSubvolume 24 -#define sz_pexPD_NPC_HitVolume sz_pexNpcSubvolume -#define sz_pexOutputCommandError 32 -#define sz_pexPD_DC_HitBox 8 -#define sz_pexPSC_IsoparametricCurves 8 -#define sz_pexPSC_LevelCurves 28 -#define sz_pexPatternEntry 8 -#define sz_pexPickElementRef 12 -#define sz_pexPickRecord 4 -#define sz_pexReflectionAttr 24 -#define sz_pexRendererTarget 8 -#define sz_pexRgb16Color 8 -#define sz_pexRgb8Color 4 -#define sz_pexRgbFloatColor 12 -#define sz_pexString 2 -#define sz_pexStructure 4 -#define sz_pexStructureInfo 8 -#define sz_pexSurfaceApproxData 12 -#define sz_pexSwitch 1 -#define sz_pexTableInfo 8 -#define sz_pexTableIndex 2 -#define sz_pexTextAlignmentData 4 -#define sz_pexTextBundleEntry 16 -#define sz_pexTextFontEntry 4 -#define sz_pexTrimCurve 28 -#define sz_pexVector2D 8 -#define sz_pexVector3D 12 -#define sz_pexVertex 12 -#define sz_pexViewEntry 156 -#define sz_pexViewRep 160 -#define sz_pexViewport 20 - -/* from PEXlibint.h */ -#define sz_pexOCRequestHeader 16 - -/* for X-Window system protocol elements */ -#define sz_CARD32 4 -#define sz_CARD16 2 -#define sz_CARD8 1 -#define sz_INT32 4 -#define sz_INT16 2 - -/* for other things */ -#define sz_char 1 -#define sz_short 2 -#define sz_long 4 -#define sz_float 4 - - - -/* ------------------------------------------------------------------------- - * Externally defined globals. - * ------------------------------------------------------------------------- */ - -/* - * Linked list of open displays. - */ - -extern PEXDisplayInfo *PEXDisplayInfoHeader; - - -/* - * Pick path cache. - */ - -extern PEXPickPath *PEXPickCache; -extern unsigned int PEXPickCacheSize; -extern int PEXPickCacheInUse; - - -/* - * Floating point conversion function table. - */ - -extern void (*(PEX_fp_convert[NUM_FP_FORMATS][NUM_FP_FORMATS]))(); - - - -/* ------------------------------------------------------------------------- - * Function prototypes for PEXlib internal functions. - * ------------------------------------------------------------------------- */ - -extern void _PEXCopyPaddedBytesToOC( -#if NeedFunctionPrototypes - Display * /* display */, - int /* numBytes */, - char * /* data */ -#endif -); - -extern void _PEXSendBytesToOC( -#if NeedFunctionPrototypes - Display * /* display */, - int /* numBytes */, - char * /* data */ -#endif -); - -extern void _PEXOCFacet( -#if NeedFunctionPrototypes - Display * /* display */, - int /* colorType */, - unsigned int /* facetAttr */, - PEXFacetData * /* facetData */, - int /* fpFormat */ -#endif -); - -extern void _PEXOCListOfFacet( -#if NeedFunctionPrototypes - Display * /* display */, - int /* count */, - int /* colorType */, - unsigned int /* facetAttr */, - PEXArrayOfFacetData /* facetData */, - int /* fpFormat */ -#endif -); - -extern void _PEXOCListOfVertex( -#if NeedFunctionPrototypes - Display * /* display */, - int /* count */, - int /* colorType */, - unsigned int /* vertAttr */, - PEXArrayOfVertex /* vertData */, - int /* fpFormat */ -#endif -); - -extern void _PEXOCListOfColor( -#if NeedFunctionPrototypes - Display * /* display */, - int /* count */, - int /* colorType */, - PEXArrayOfColor /* colors */, - int /* fpFormat */ -#endif -); - -extern void _PEXStoreFacet( -#if NeedFunctionPrototypes - int /* colorType */, - unsigned int /* facetAttr */, - PEXFacetData * /* facetData */, - char ** /* bufPtr */, - int /* fpFormat */ -#endif -); - -extern void _PEXStoreListOfFacet( -#if NeedFunctionPrototypes - int /* count */, - int /* colorType */, - unsigned int /* facetAttr */, - PEXArrayOfFacetData /* facetData */, - char ** /* bufPtr */, - int /* fpFormat */ -#endif -); - -extern void _PEXStoreListOfVertex( -#if NeedFunctionPrototypes - int /* count */, - int /* colorType */, - unsigned int /* vertAttr */, - PEXArrayOfVertex /* vertData */, - char ** /* bufPtr */, - int /* fpFormat */ -#endif -); - -extern void _PEXStoreListOfColor( -#if NeedFunctionPrototypes - int /* count */, - int /* colorType */, - PEXArrayOfColor /* colors */, - char ** /* bufPtr */, - int /* fpFormat */ -#endif -); - -extern void _PEXExtractFacet( -#if NeedFunctionPrototypes - char ** /* bufPtr */, - int /* colorType */, - unsigned int /* facetAttr */, - PEXFacetData * /* facetData */, - int /* fpFormat */ -#endif -); - -extern void _PEXExtractListOfFacet( -#if NeedFunctionPrototypes - int /* count */, - char ** /* bufPtr */, - int /* colorType */, - unsigned int /* facetAttr */, - PEXArrayOfFacetData /* facetData */, - int /* fpFormat */ -#endif -); - -extern void _PEXExtractListOfVertex( -#if NeedFunctionPrototypes - int /* count */, - char ** /* bufPtr */, - int /* colorType */, - unsigned int /* vertAttr */, - PEXArrayOfVertex /* vertData */, - int /* fpFormat */ -#endif -); - -extern void _PEXExtractListOfColor( -#if NeedFunctionPrototypes - int /* count */, - char ** /* bufPtr */, - int /* colorType */, - PEXArrayOfColor /* colors */, - int /* fpFormat */ -#endif -); - -extern void _PEXGenOCBadLengthError( -#if NeedFunctionPrototypes - Display * /* display */, - XID /* resource_id */, - PEXOCRequestType /* req_type */ -#endif -); - - - -/* ------------------------------------------------------------------------- - * Miscellaneous. - * ------------------------------------------------------------------------- */ - -/* - * Argument types in function definitions. - */ - -#define INPUT -#define OUTPUT -#define INOUT - - -/* - * Xlib defines min and max as macros; Must undef since min and max - * are field names in PEXlib data structures. - */ - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - -#endif /* _PEXLIBINT_H_ */ - - Index: xc/lib/PEX5/PEXproto.h diff -u xc/lib/PEX5/PEXproto.h:1.2 xc/lib/PEX5/PEXproto.h:removed --- xc/lib/PEX5/PEXproto.h:1.2 Fri Dec 14 14:53:44 2001 +++ xc/lib/PEX5/PEXproto.h Sat Feb 28 21:41:20 2004 @@ -1,2245 +0,0 @@ -/* $Xorg: PEXproto.h,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */ -/* - -Copyright 1992, 1998 The Open Group - -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. - -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 OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/****************************************************************************** -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -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 Sun Microsystems not be used in advertising or publicity -pertaining to distribution of the software without specific, written prior -permission. Sun Microsystems makes no representations about the -suitability of this software for any purpose. It is provided "as is" without -express or implied warranty. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS 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. -******************************************************************************/ - -/* Definitions for the PEX used by server and c bindings */ - -/* - * This packet-construction scheme makes the following assumptions: - * - * 1. The compiler is able to generate code which addresses one- and two-byte - * quantities. In the worst case, this would be done with bit-fields. If - * bit-fields are used it may be necessary to reorder the request fields in - * this file, depending on the order in which the machine assigns bit fields - * to machine words. There may also be a problem with sign extension, as K+R - * specify that bitfields are always unsigned. - * - * 2. 2- and 4-byte fields in packet structures must be ordered by hand such - * that they are naturally-aligned, so that no compiler will ever insert - * padding bytes. - * - * 3. All packets are hand-padded to a multiple of 4 bytes, for the same reason. - */ - -#ifndef _PEXPROTO_H_ -#define _PEXPROTO_H_ - -/* In the following typedefs, comments appear that say "LISTof Foo( numItems )", - * "CLIST of Foo()", and "SINGLE Foo()". These are used when the protocol - * specifies that a request or reply contains a variable length list of - * (possibly variable types of) objects. - * - * A LISTof list is one for which we have already been given the length. - * The items in the list are of type "Foo". The number of items in the list - * appears parenthetically after the type. ("numItems" in our example.) - * Any other information needed to parse the list is also passed in the - * parentheses. (E.g., "tableType" in a list of table entries.) - * - * A CLISTof list is the same, except that the first 4 bytes of the list - * indicate the number of items in the list. The length may need to be - * byte-swapped. - * - * A SINGLE item of an indeterminate length is indicated in the same - * manner. (E.g., a "SINGLE TableEntry()".) Any other information - * needed to parse the item is also passed in the parentheses. - * (E.g., "itemMask" in a set of pipeline context attributes.) - * - * If no information is given in the parentheses, then the size is - * implicit. - * - * Variable length padding is noted with a comment, with the number - * of bytes of padding required as calculated from the value in - * the parentheses. (number of bytes of padding = n?(3-((n-1)%4):0 , where - * n is the parenthetical value.) - */ - -#define XID CARD32 -#define Drawable CARD32 - -#include - -/* Matches revision 5.1C */ - -/**************************************************************** - * REPLIES * - ****************************************************************/ -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD16 majorVersion B16; - CARD16 minorVersion B16; - CARD32 release B32; - CARD32 lengthName B32; - CARD32 subsetInfo B32; - BYTE pad[8]; - /* LISTof CARD8 follows -- Don't swap */ - /* pad */ - } pexGetExtensionInfoReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* NOT 0; this is an extra-large reply*/ - CARD32 numLists B32; - BYTE pad[20]; /* lists of lists begin afterwards */ - /* LISTof CLISTof pexEnumTypeDesc( numLists ) */ - /* pad */ - } pexGetEnumTypeInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* LISTof VALUE() */ - } pexGetImpDepConstantsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 escapeID B32; - CARD8 escape_specific[20]; - /* more escape specific data, treat as */ - /* LISTof CARD8( length ) */ - } pexEscapeWithReplyReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; - BYTE pad[24]; - /* LISTof RENDERER_TARGET( ) */ - } pexMatchRenderingTargetsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - CARD16 unused B16; - CARD16 definableEntries B16; - CARD16 numPredefined B16; - CARD16 predefinedMin B16; - CARD16 predefinedMax B16; - BYTE pad[14]; - } pexGetTableInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 unused B32; - CARD32 numEntries B32; - BYTE pad[16]; - /* LISTof TableEntry( numEntries, tableType ) */ - } pexGetPredefinedEntriesReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numIndices B32; - BYTE pad[20]; - /* LISTof pexTableIndex( numIndices ) */ - /* pad( numIndices ) */ - } pexGetDefinedIndicesReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD16 status B16; - CARD16 tableType B16; - BYTE pad[20]; - /* SINGLE TableEntry( tableType ) */ - } pexGetTableEntryReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD16 tableType B16; - CARD16 unused B16; - CARD32 numEntries B32; - BYTE pad[16]; - /* LISTof TableEntry( numEntries, tableType ) */ - } pexGetTableEntriesReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE PipelineContextAttributes( itemMask ) */ - } pexGetPipelineContextReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE RendererAttributes( itemMask ) */ - } pexGetRendererAttributesReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - pexBitmask tables B32; - pexBitmask namesets B32; - pexBitmask attributes B32; - BYTE pad[12]; -} pexGetRendererDynamicsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - CARD16 editMode B16; - CARD16 unused B16; - CARD32 elementPtr B32; - CARD32 numElements B32; - CARD32 lengthStructure B32; - CARD16 hasRefs B16; - BYTE pad[6]; - } pexGetStructureInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numInfo B32; - BYTE pad[20]; - /* LISTof pexElementInfo( numInfo ) */ - } pexGetElementInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD8 unused[8]; - CARD32 numStructures B32; - BYTE pad[12]; - /* LISTof pexStructure( numStructures ) */ - } pexGetStructuresInNetworkReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD8 unused[12]; - CARD32 numPaths B32; - BYTE pad[8]; - /* LISTof CLISTof pexElementRef( numPaths ) */ - } pexGetAncestorsReply; - -typedef pexGetAncestorsReply pexGetDescendantsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numElements B32; - BYTE pad[20]; - /* LISTof OutputCommand( numElements ) */ - } pexFetchElementsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - CARD16 status B16; - CARD16 unused B16; - CARD32 foundOffset B32; - BYTE pad[16]; - } pexElementSearchReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numNames B32; - BYTE pad[20]; - /* LISTof pexName( numNames ) */ - } pexGetNameSetReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE SearchContextAttributes( itemMask ) */ - } pexGetSearchContextReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 unused B32; - CARD32 numItems B32; - BYTE pad[16]; - /* LISTof pexElementRef( numItems ) */ - } pexSearchNetworkReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE WksInfo( itemMask ) */ - } pexGetWorkstationAttributesReply; - - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - pexDynamicType viewRep; - pexDynamicType markerBundle; - pexDynamicType textBundle; - pexDynamicType lineBundle; - pexDynamicType interiorBundle; - pexDynamicType edgeBundle; - pexDynamicType colorTable; - pexDynamicType patternTable; - pexDynamicType wksTransform; - pexDynamicType highlightFilter; - pexDynamicType invisibilityFilter; - pexDynamicType HlhsrMode; - pexDynamicType structureModify; - pexDynamicType postStructure; - pexDynamicType unpostStructure; - pexDynamicType deleteStructure; - pexDynamicType referenceModify; - pexDynamicType bufferModify; - pexDynamicType lightTable; - pexDynamicType depthCueTable; - pexDynamicType colorApproxTable; - CARD8 pad[3]; - } pexGetWorkstationDynamicsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* 4 + 76*fp/4 */ - CARD16 viewUpdate B16; /* Pending, NotPending */ - BYTE pad[22]; - /* SINGLE pexViewRep() requested */ - /* SINGLE pexViewRep() current */ - } pexGetWorkstationViewRepReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD16 viewIndex B16; - CARD16 unused B16; - CARD32 numCoords B32; - BYTE pad[16]; - /* LISTof pexCoord3D( numCoords ) */ - } pexMapDCtoWCReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 unused B32; - CARD32 numCoords B32; - BYTE pad[16]; - /* LISTof pexDeviceCoord( numCoords ) */ - } pexMapWCtoDCReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* LISTof pexPhigsWksID() */ - } pexGetWorkstationPostingsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE PickDeviceAttributes( itemMask ) */ - } pexGetPickDeviceReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* SINGLE pexPickMeasureAttributes( itemMask ) */ - } pexGetPickMeasureReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numPickElRefs B32; - pexEnumTypeIndex pickStatus B16; - CARD8 betterPick; - BYTE pad[17]; - /* LISTof pexPickElementRef ( numPickElRefs ) */ - } pexEndPickOneReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numPickElRefs B32; - pexEnumTypeIndex pickStatus B16; - CARD8 betterPick; - BYTE pad[17]; - /* LISTof pexPickElementRef ( numPickElRefs ) */ - } pexPickOneReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numPicked B32; - pexEnumTypeIndex pickStatus B16; - pexEnumTypeIndex morePicks B16; - BYTE pad[16]; - /* LISTof CLISTof pexPickElementRef ( numPicked ) */ - } pexEndPickAllReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numPicked B32; - pexEnumTypeIndex pickStatus B16; - pexEnumTypeIndex morePicks B16; - BYTE pad[16]; - /* LISTof CLISTof pexPickElementRef ( numPicked ) */ - } pexPickAllReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 lengthFontInfo B32; - CARD8 pad[20]; - /* SINGLE pexFontInfo() */ - } pexQueryFontReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numStrings B32; - BYTE pad[20]; - /* LISTof pexString( numStrings ) */ - } pexListFontsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - CARD32 numStrings B32; - BYTE pad[20]; - /* LISTof pexString( numStrings ) */ - /* CLISTof pexFontInfo() */ - } pexListFontsWithInfoReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 length B32; /* not 0 */ - BYTE pad[24]; - /* LISTof ExtentInfo() */ - } pexQueryTextExtentsReply; - -/**************************************************************** - * REQUESTS * - ****************************************************************/ -/* Request structure */ - -typedef struct { - CARD8 reqType; - CARD8 opcode; /* meaning depends on request type */ - CARD16 length B16; - /* length in 4 bytes quantities */ - /* of whole request, including this header */ -} pexReq; - -/***************************************************************** - * structures that follow request. - *****************************************************************/ - -/* ResourceReq is used for any request which has a resource ID - ( or Atom or Time ) as its one and only argument. */ - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - CARD32 id B32; /* a Structure, Renderer, Font, LUT, etc. */ - } pexResourceReq; - - -/***************************************************************** - * Specific Requests - *****************************************************************/ - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - CARD16 clientProtocolMajor B16; - CARD16 clientProtocolMinor B16; -} pexGetExtensionInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - Drawable drawable B32; - pexBitmask itemMask B32; - CARD32 numEnums B32; - /* LISTof CARD16( numEnums ) */ - /* pad( numEnums*2 ) */ -} pexGetEnumTypeInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - Drawable drawable B32; - CARD32 numNames B32; - /* LISTof pexImpDepConstantNames ( numNames ) */ - /* pad */ -} pexGetImpDepConstantsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - Drawable drawable B32; - CARD8 depth; - CARD8 unused; - CARD16 type B16; - CARD32 visualID B32; - CARD32 maxTriplets B32; -} pexMatchRenderingTargetsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 + n */ - CARD32 escapeID B32; - /* 4n bytes of additional escape data to skip */ -} pexEscapeReq; - -typedef pexEscapeReq pexEscapeWithReplyReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - Drawable drawableExample B32; - pexLookupTable lut B32; - pexTableType tableType B16; - CARD16 unused B16; -} pexCreateLookupTableReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexLookupTable src B32; - pexLookupTable dst B32; -} pexCopyLookupTableReq; - -typedef pexResourceReq pexFreeLookupTableReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - Drawable drawableExample B32; - pexTableType tableType B16; - CARD16 unused B16; -} pexGetTableInfoReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - Drawable drawableExample B32; - pexTableType tableType B16; - pexTableIndex start B16; - CARD16 count B16; - CARD16 pad B16; -} pexGetPredefinedEntriesReq; - -typedef pexResourceReq pexGetDefinedIndicesReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - CARD16 valueType B16; - pexLookupTable lut B32; - pexTableIndex index B16; - CARD16 pad B16; -} pexGetTableEntryReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - CARD16 valueType B16; - pexLookupTable lut B32; - pexTableIndex start B16; - CARD16 count B16; -} pexGetTableEntriesReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexLookupTable lut B32; - pexTableIndex start B16; - CARD16 count B16; -/* LISTof TableEntry( count ) */ -} pexSetTableEntriesReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexLookupTable lut B32; - pexTableIndex start B16; - CARD16 count B16; -} pexDeleteTableEntriesReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPC pc B32; - pexBitmask itemMask0 B32; - pexBitmask itemMask1 B32; - pexBitmask itemMask2 B32; - /* SINGLE PipelineContextAttributes( itemMask ) */ -} pexCreatePipelineContextReq; - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexPC src B32; - pexPC dst B32; - pexBitmask itemMask0 B32; - pexBitmask itemMask1 B32; - pexBitmask itemMask2 B32; -} pexCopyPipelineContextReq; - -typedef pexResourceReq pexFreePipelineContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPC pc B32; - pexBitmask itemMask0 B32; - pexBitmask itemMask1 B32; - pexBitmask itemMask2 B32; -} pexGetPipelineContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPC pc B32; - pexBitmask itemMask0 B32; - pexBitmask itemMask1 B32; - pexBitmask itemMask2 B32; - /* SINGLE PipelineContextAttributes( itemMask ) */ -} pexChangePipelineContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexRenderer rdr B32; - Drawable drawable B32; - pexBitmask itemMask B32; - /* SINGLE RendererAttributes( itemMask ) */ -} pexCreateRendererReq; - -typedef pexResourceReq pexFreeRendererReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexRenderer rdr B32; - pexBitmask itemMask B32; - /* SINGLE RendererAttributes( itemMask ) */ -} pexChangeRendererReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexRenderer rdr B32; - pexBitmask itemMask B32; -} pexGetRendererAttributesReq; - -typedef pexResourceReq pexGetRendererDynamicsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - Drawable drawable B32; -} pexBeginRenderingReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - pexSwitch flushFlag; - BYTE pad[3]; -} pexEndRenderingReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexRenderer rdr B32; - pexStructure sid B32; -} pexBeginStructureReq; - -typedef pexResourceReq pexEndStructureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexRenderer rdr B32; - CARD32 numCommands B32; - /* LISTof OutputCommand( numCommands ) */ -} pexRenderOutputCommandsReq; -/* individual output commands may be found in the section "Output Commands" */ - - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 7 */ - pexRenderer rdr B32; - pexStructure sid B32; - CARD16 position1_whence B16; - CARD16 unused1 B16; - INT32 position1_offset B32; - CARD16 position2_whence B16; - CARD16 unused2 B16; - INT32 position2_offset B32; -} pexRenderElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 + 2n */ - pexRenderer rdr B32; - CARD32 numElRefs B32; - /* LISTof pexElementRef( numElRefs ) */ -} pexAccumulateStateReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexRenderer rdr B32; - Drawable drawable B32; - pexStructure sid B32; -} pexRenderNetworkReq; - -typedef pexResourceReq pexCreateStructureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexStructure src B32; - pexStructure dst B32; -} pexCopyStructureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD32 numStructures B32; - /* LISTof pexStructure( numStructures ) */ -} pexDestroyStructuresReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexEnumTypeIndex fpFormat B16; - CARD16 itemMask B16; - pexStructure sid B32; -} pexGetStructureInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 7 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexStructure sid B32; - CARD16 position1_whence B16; - CARD16 unused1 B16; - INT32 position1_offset B32; - CARD16 position2_whence B16; - CARD16 unused2 B16; - INT32 position2_offset B32; -} pexGetElementInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexStructure sid B32; - CARD16 which B16; - CARD16 pad B16; -} pexGetStructuresInNetworkReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexStructure sid B32; - CARD16 pathOrder B16; - CARD16 unused B16; - CARD32 pathDepth B32; -} pexGetAncestorsReq; - -typedef pexGetAncestorsReq pexGetDescendantsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 7 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexStructure sid B32; - CARD16 position1_whence B16; - CARD16 unused1 B16; - INT32 position1_offset B32; - CARD16 position2_whence B16; - CARD16 unused2 B16; - INT32 position2_offset B32; -} pexFetchElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexStructure sid B32; - CARD16 mode B16; - CARD16 pad B16; -} pexSetEditingModeReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexStructure sid B32; - CARD16 position_whence B16; - CARD16 unused B16; - INT32 position_offset B32; -} pexSetElementPointerReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexStructure sid B32; - INT32 label B32; - INT32 offset B32; -} pexSetElementPointerAtLabelReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexStructure sid B32; - CARD16 position_whence B16; - CARD16 unused B16; - INT32 position_offset B32; - CARD32 direction B32; - CARD32 numIncls B32; - CARD32 numExcls B32; - /* LISTof CARD16( numIncls ) */ - /* pad( numIncls*2 ) */ - /* LISTof CARD16( numExcls ) */ - /* pad( numExcls*2 ) */ -} pexElementSearchReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexStructure sid B32; - CARD32 numCommands B32; - /* LISTof OutputCommand( numCommands ) */ -} pexStoreElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 */ - pexStructure sid B32; - CARD16 position1_whence B16; - CARD16 unused1 B16; - INT32 position1_offset B32; - CARD16 position2_whence B16; - CARD16 unused2 B16; - INT32 position2_offset B32; -} pexDeleteElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexStructure sid B32; - CARD16 position_whence B16; - CARD16 unused B16; - INT32 position_offset B32; - INT32 label B32; -} pexDeleteElementsToLabelReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexStructure sid B32; - INT32 label1 B32; - INT32 label2 B32; -} pexDeleteBetweenLabelsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 9 */ - pexStructure src B32; - CARD16 srcPosition1_whence B16; - CARD16 unused1 B16; - INT32 srcPosition1_offset B32; - CARD16 srcPosition2_whence B16; - CARD16 unused2 B16; - INT32 srcPosition2_offset B32; - pexStructure dst B32; - CARD16 dstPosition_whence B16; - CARD16 unused3 B16; - INT32 dstPosition_offset B32; -} pexCopyElementsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexStructure old_id B32; - pexStructure new_id B32; -} pexChangeStructureRefsReq; - -typedef pexResourceReq pexCreateNameSetReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexNameSet src B32; - pexNameSet dst B32; -} pexCopyNameSetReq; - -typedef pexResourceReq pexFreeNameSetReq; - -typedef pexResourceReq pexGetNameSetReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexNameSet ns B32; - CARD16 action B16; - CARD16 unused B16; - /* LISTof pexName() */ -} pexChangeNameSetReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexSC sc B32; - pexBitmask itemMask B32; - /* SINGLE SearchContextAttributes( itemMask ) */ -} pexCreateSearchContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexSC src B32; - pexSC dst B32; - pexBitmask itemMask B32; -} pexCopySearchContextReq; - -typedef pexResourceReq pexFreeSearchContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexSC sc B32; - pexBitmask itemMask B32; -} pexGetSearchContextReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexSC sc B32; - pexBitmask itemMask B32; - /* SINGLE SearchContextAttributes( itemMask ) */ -} pexChangeSearchContextReq; - -typedef pexResourceReq pexSearchNetworkReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 19 */ - pexPhigsWks wks B32; - Drawable drawable B32; - pexLookupTable markerBundle B32; - pexLookupTable textBundle B32; - pexLookupTable lineBundle B32; - pexLookupTable interiorBundle B32; - pexLookupTable edgeBundle B32; - pexLookupTable colorTable B32; - pexLookupTable depthCueTable B32; - pexLookupTable lightTable B32; - pexLookupTable colorApproxTable B32; - pexLookupTable patternTable B32; - pexLookupTable textFontTable B32; - pexNameSet highlightIncl B32; - pexNameSet highlightExcl B32; - pexNameSet invisIncl B32; - pexNameSet invisExcl B32; - CARD16 bufferMode B16; - CARD16 pad B16; -} pexCreateWorkstationReq; - -typedef pexResourceReq pexFreeWorkstationReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - pexBitmask itemMask0 B32; - pexBitmask itemMask1 B32; -} pexGetWorkstationAttributesReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - Drawable drawable B32; -} pexGetWorkstationDynamicsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexEnumTypeIndex fpFormat B16; - pexTableIndex index B16; - pexPhigsWks wks B32; -} pexGetWorkstationViewRepReq; - -typedef pexResourceReq pexRedrawAllStructuresReq; - -typedef pexResourceReq pexUpdateWorkstationReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexPhigsWks wks B32; - CARD32 numRects B32; - /* LISTof pexDeviceRect( numRects ) */ -} pexRedrawClipRegionReq; - -typedef pexResourceReq pexExecuteDeferredActionsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexPhigsWks wks B32; - pexTableIndex index1 B16; - pexTableIndex index2 B16; - CARD16 priority B16; - CARD16 pad B16; -} pexSetWorkstationViewPriorityReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPhigsWks wks B32; - pexEnumTypeIndex displayUpdate B16; - CARD16 pad B16; -} pexSetWorkstationDisplayUpdateModeReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - CARD32 numCoords B32; - /* LISTof pexDeviceCoord( numCoords ) */ -} pexMapDCtoWCReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 index B16; - pexPhigsWks wks B32; - CARD32 numCoords B32; - /* LISTof pexCoord3D( numCoords ) */ -} pexMapWCtoDCReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 43 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused1 B16; - pexPhigsWks wks B32; - pexTableIndex index B16; - CARD16 unused2 B16; - CARD16 clipFlags B16; - CARD16 unused3 B16; - PEXFLOAT clipLimits_xmin B32; - PEXFLOAT clipLimits_ymin B32; - PEXFLOAT clipLimits_zmin B32; - PEXFLOAT clipLimits_xmax B32; - PEXFLOAT clipLimits_ymax B32; - PEXFLOAT clipLimits_zmax B32; - pexMatrix view_orientation; - pexMatrix view_mapping; -} pexSetWorkstationViewRepReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 9 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - PEXFLOAT npcSubvolume_xmin B32; - PEXFLOAT npcSubvolume_ymin B32; - PEXFLOAT npcSubvolume_zmin B32; - PEXFLOAT npcSubvolume_xmax B32; - PEXFLOAT npcSubvolume_ymax B32; - PEXFLOAT npcSubvolume_zmax B32; -} pexSetWorkstationWindowReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 8 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - INT16 viewport_xmin B16; - INT16 viewport_ymin B16; - PEXFLOAT viewport_zmin B32; - INT16 viewport_xmax B16; - INT16 viewport_ymax B16; - PEXFLOAT viewport_zmax B32; - pexSwitch useDrawable; - BYTE pad[3]; -} pexSetWorkstationViewportReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPhigsWks wks B32; - pexEnumTypeIndex mode B16; - CARD16 pad B16; -} pexSetWorkstationHLHSRModeReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPhigsWks wks B32; - CARD16 bufferMode B16; - CARD16 pad B16; -} pexSetWorkstationBufferModeReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 5 */ - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - pexStructure sid B32; - PEXFLOAT priority B32; -} pexPostStructureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPhigsWks wks B32; - pexStructure sid B32; -} pexUnpostStructureReq; - -typedef pexResourceReq pexUnpostAllStructuresReq; - -typedef pexResourceReq pexGetWorkstationPostingsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex devType B16; - pexPhigsWks wks B32; - pexBitmask itemMask B32; -} pexGetPickDeviceReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 unused B16; - pexPhigsWks wks B32; - pexEnumTypeIndex devType B16; - CARD16 unused2 B16; - pexBitmask itemMask B32; - /* SINGLE PickDeviceAttributes( itemMask ) */ -} pexChangePickDeviceReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 4 */ - pexPhigsWks wks B32; - pexPickMeasure pm B32; - pexEnumTypeIndex devType B16; - CARD16 pad B16; -} pexCreatePickMeasureReq; - -typedef pexResourceReq pexFreePickMeasureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 3 */ - pexPickMeasure pm B32; - pexBitmask itemMask B32; -} pexGetPickMeasureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexPickMeasure pm B32; - CARD32 numBytes B32; - /* LISTof CARD8( numBytes ) */ - /* pad( numBytes ) */ -} pexUpdatePickMeasureReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 + n */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex method B16; - pexRenderer rdr B32; - Drawable drawable B32; - INT32 sid B32; - /* SINGLE PickRecord () */ -} pexBeginPickOneReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - pexRenderer rdr B32; -} pexEndPickOneReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 + n */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex method B16; - pexRenderer rdr B32; - Drawable drawable B32; - pexStructure sid B32; - /* SINGLE PickRecord () */ -} pexPickOneReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 7 + n */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex method B16; - CARD8 sendEvent; - CARD8 unused[3]; - pexRenderer rdr B32; - Drawable drawable B32; - INT32 sid B32; - CARD32 pickMaxHits B32; - /* SINGLE PickRecord () */ -} pexBeginPickAllReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 2 */ - pexRenderer rdr B32; -} pexEndPickAllReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; /* 6 + n */ - pexEnumTypeIndex fpFormat B16; - pexEnumTypeIndex method B16; - pexRenderer rdr B32; - Drawable drawable B32; - CARD32 pickMaxHits B32; - /* SINGLE RendererPickRecord () */ -} pexPickAllReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexFont font B32; - CARD32 numBytes B32; - /* LISTof CARD8( numBytes ) -- don't swap */ - /* pad( numBytes ) */ -} pexLoadFontReq; - -typedef pexResourceReq pexUnloadFontReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexFont font B32; -} pexQueryFontReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD16 maxNames B16; - CARD16 numChars B16; - /* LISTof CARD8( numChars ) -- don't swap */ - /* pad( numBytes ) */ -} pexListFontsReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - CARD16 unused B16; - CARD16 maxNames B16; - CARD16 numChars B16; - CARD16 pad B16; - /* LISTof CARD8( numChars ) */ - /* pad( numBytes ) */ -} pexListFontsWithInfoReq; - -typedef struct { - CARD8 reqType; - CARD8 opcode; - CARD16 length B16; - pexEnumTypeIndex fpFormat B16; - CARD16 textPath B16; - pexTableIndex fontGroupIndex B16; - CARD16 unused B16; - XID id B32; /* renderer, wks, or text font lut */ - PEXFLOAT charExpansion B32; - PEXFLOAT charSpacing B32; - PEXFLOAT charHeight B32; - CARD16 alignment_vertical B16; - CARD16 alignment_horizontal B16; - CARD32 numStrings B32; - /* LISTof LISTof MONO_ENCODINGS() */ - /* pad() */ -} pexQueryTextExtentsReq; - -/***************************************************************** - * Output Commands - *****************************************************************/ - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex markerType B16; - CARD16 pad B16; -} pexMarkerType; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT scale B32; -} pexMarkerScale; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexTableIndex index B16; - CARD16 pad B16; -} pexMarkerBundleIndex; - -typedef pexMarkerBundleIndex pexMarkerColorIndex; -typedef pexMarkerBundleIndex pexTextColorIndex; -typedef pexMarkerBundleIndex pexLineColorIndex; -typedef pexMarkerBundleIndex pexSurfaceColorIndex; -typedef pexMarkerBundleIndex pexBFSurfaceColorIndex; -typedef pexMarkerBundleIndex pexSurfaceEdgeColorIndex; - -typedef pexMarkerBundleIndex pexTextFontIndex; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexColorType colorType B16; - CARD16 unused B16; - /* SINGLE COLOR(colorType) */ -} pexMarkerColor; - -typedef pexMarkerColor pexTextColor; -typedef pexMarkerColor pexLineColor; -typedef pexMarkerColor pexSurfaceColor; -typedef pexMarkerColor pexBFSurfaceColor; -typedef pexMarkerColor pexSurfaceEdgeColor; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex style B16; - CARD16 pad B16; -} pexATextStyle; - -typedef pexMarkerBundleIndex pexTextBundleIndex; -typedef pexMarkerBundleIndex pexLineBundleIndex; -typedef pexMarkerBundleIndex pexInteriorBundleIndex; -typedef pexMarkerBundleIndex pexInteriorStyleIndex; -typedef pexMarkerBundleIndex pexBFInteriorStyleIndex; -typedef pexMarkerBundleIndex pexEdgeBundleIndex; -typedef pexMarkerBundleIndex pexViewIndex; -typedef pexMarkerBundleIndex pexDepthCueIndex; -typedef pexMarkerBundleIndex pexColorApproxIndex; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 precision B16; - CARD16 pad B16; -} pexTextPrecision; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT expansion B32; -} pexCharExpansion; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT spacing B32; -} pexCharSpacing; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT height B32; -} pexCharHeight; -typedef pexCharHeight pexATextHeight; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT up_x B32; - PEXFLOAT up_y B32; -} pexCharUpVector; -typedef pexCharUpVector pexATextUpVector; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 path B16; - CARD16 pad B16; -} pexTextPath; -typedef pexTextPath pexATextPath; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 alignment_vertical B16; - CARD16 alignment_horizontal B16; -} pexTextAlignment; -typedef pexTextAlignment pexATextAlignment; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex lineType B16; - CARD16 pad B16; -} pexLineType; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT width B32; -} pexLineWidth; -typedef pexLineWidth pexSurfaceEdgeWidth; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex approxMethod B16; - CARD16 unused B16; - PEXFLOAT tolerance B32; -} pexCurveApprox; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex polylineInterp B16; - CARD16 pad B16; -} pexPolylineInterpMethod; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex interiorStyle B16; - CARD16 pad B16; -} pexInteriorStyle; -typedef pexInteriorStyle pexBFInteriorStyle; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT ambient B32; - PEXFLOAT diffuse B32; - PEXFLOAT specular B32; - PEXFLOAT specularConc B32; - PEXFLOAT transmission B32; - pexColorType specular_colorType B16; - CARD16 unused B16; - /* SINGLE COLOR(specular_colorType) */ -} pexReflectionAttributes; -typedef pexReflectionAttributes pexBFReflectionAttributes; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex reflectionModel B16; - CARD16 pad B16; -} pexReflectionModel; -typedef pexReflectionModel pexBFReflectionModel; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex surfaceInterp B16; - CARD16 pad B16; -} pexSurfaceInterpMethod; -typedef pexSurfaceInterpMethod pexBFSurfaceInterpMethod; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex approxMethod B16; - CARD16 unused B16; - PEXFLOAT uTolerance B32; - PEXFLOAT vTolerance B32; -} pexSurfaceApprox; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexCullMode cullMode B16; - CARD16 pad B16; -} pexFacetCullingMode; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexSwitch distinguish; - BYTE pad[3]; -} pexFacetDistinguishFlag; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT size_x B32; - PEXFLOAT size_y B32; -} pexPatternSize; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT point_x B32; - PEXFLOAT point_y B32; -} pexPatternAttributes2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT refPt_x B32; - PEXFLOAT refPt_y B32; - PEXFLOAT refPt_z B32; - PEXFLOAT vector1_x B32; - PEXFLOAT vector1_y B32; - PEXFLOAT vector1_z B32; - PEXFLOAT vector2_x B32; - PEXFLOAT vector2_y B32; - PEXFLOAT vector2_z B32; -} pexPatternAttributes; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexSwitch onoff; - BYTE pad[3]; -} pexSurfaceEdgeFlag; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex edgeType B16; - CARD16 pad B16; -} pexSurfaceEdgeType; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexAsfAttribute attribute B32; - pexAsfValue source; - BYTE pad[3]; -} pexIndividualASF; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexComposition compType B16; - CARD16 unused B16; - pexMatrix matrix; -} pexLocalTransform; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexComposition compType B16; - CARD16 unused B16; - pexMatrix3X3 matrix3X3; -} pexLocalTransform2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexMatrix matrix; -} pexGlobalTransform; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexMatrix3X3 matrix3X3; -} pexGlobalTransform2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexSwitch onoff; - BYTE pad[3]; -} pexModelClipFlag; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex modelClipOperator B16; - CARD16 numHalfSpaces B16; - /* LISTof pexHalfSpace( numHalfSpaces ) */ -} pexModelClipVolume; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex modelClipOperator B16; - CARD16 numHalfSpaces B16; - /* LISTof pexHalfSpace2D( numHalfSpaces ) */ -} pexModelClipVolume2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; -} pexRestoreModelClipVolume; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 numEnable B16; - CARD16 numDisable B16; - /* LISTof pexTableIndex( numEnable ) */ - /* pad( ( numEnable )*2 ) */ - /* LISTof pexTableIndex( numDisable ) */ - /* pad( ( numDisable )*2 ) */ -} pexLightSourceState; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD32 pickId B32; -} pexPickID; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD32 hlhsrID B32; -} pexHLHSRID; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex model B16; - CARD16 pad B16; -} pexRenderingColorModel; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexEnumTypeIndex characteristics B16; - CARD16 length B16; - /* SINGLEof PARAMETRIC_SURFACE_CHARACTERISTICS */ -} pexParaSurfCharacteristics; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - /* LISTof pexName() */ -} pexAddToNameSet; -typedef pexAddToNameSet pexRemoveFromNameSet; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexStructure id B32; -} pexExecuteStructure; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - INT32 label B32; -} pexLabel; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 numElements B16; - CARD16 unused B16; - /* LISTof CARD8( numElements ) -- don't swap */ - /* pad( numElements ) */ -} pexApplicationData; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD32 id B32; - CARD16 numElements B16; - CARD16 unused B16; - /* LISTof CARD8( numElements ) -- don't swap */ - /* pad( numElements ) */ -} pexGSE; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - /* LISTof pexCoord3D() */ -} pexMarkers; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - /* LISTof pexCoord2D() */ -} pexMarkers2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT origin_x B32; - PEXFLOAT origin_y B32; - PEXFLOAT origin_z B32; - PEXFLOAT vector1_x B32; - PEXFLOAT vector1_y B32; - PEXFLOAT vector1_z B32; - PEXFLOAT vector2_x B32; - PEXFLOAT vector2_y B32; - PEXFLOAT vector2_z B32; - CARD16 numEncodings B16; - CARD16 unused B16; - /* LISTof pexMonoEncoding( numEncodings ) */ -} pexText; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT origin_x B32; - PEXFLOAT origin_y B32; - CARD16 numEncodings B16; - CARD16 unused B16; - /* LISTof pexMonoEncoding( numEncodings ) */ -} pexText2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT origin_x B32; - PEXFLOAT origin_y B32; - PEXFLOAT origin_z B32; - PEXFLOAT offset_x B32; - PEXFLOAT offset_y B32; - PEXFLOAT offset_z B32; - CARD16 numEncodings B16; - CARD16 unused B16; - /* LISTof pexMonoEncoding( numEncodings ) */ -} pexAnnotationText; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT origin_x B32; - PEXFLOAT origin_y B32; - PEXFLOAT offset_x B32; - PEXFLOAT offset_y B32; - CARD16 numEncodings B16; - CARD16 unused B16; - /* LISTof pexMonoEncoding( numEncodings ) */ -} pexAnnotationText2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - /* LISTof pexCoord3D() */ -} pexPolyline; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - /* LISTof pexCoord2D() */ -} pexPolyline2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexColorType colorType B16; - pexBitmaskShort vertexAttribs B16; - CARD32 numLists B32; - /* LISTof CLISTof pexVertex( numLists, vertexAttribs, colorType ) */ -} pexPolylineSetWithData; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 curveOrder B16; - pexCoordType coordType B16; - PEXFLOAT tmin B32; - PEXFLOAT tmax B32; - CARD32 numKnots B32; - CARD32 numPoints B32; - /* LISTof FLOAT( numKnots ) */ - /* LISTof {pexCoord3D|pexCoord4D}( numPoints, coordType ) */ -} pexNURBCurve; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 pad; - /* LISTof pexCoord3D() */ -} pexFillArea; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 unused; - /* LISTof pexCoord2D() */ -} pexFillArea2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 unused; - pexColorType colorType B16; - pexBitmaskShort facetAttribs B16; - pexBitmaskShort vertexAttribs B16; - CARD16 unused2 B16; - /* SINGLE Facet( facetAttribs, vertexAttribs, colorType ) */ -} pexFillAreaWithData; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 contourHint; - CARD32 numLists B32; - /* LISTof CLISTof Coord3D( numLists ) */ -} pexFillAreaSet; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 contourHint; - CARD32 numLists B32; - /* LISTof CLISTof Coord2D( numLists ) */ -} pexFillAreaSet2D; - - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 shape B16; - pexSwitch ignoreEdges; - CARD8 contourHint; - pexColorType colorType B16; - pexBitmaskShort facetAttribs B16; - pexBitmaskShort vertexAttribs B16; - CARD16 unused2 B16; - CARD32 numLists B32; - /* pexOptData( facetAttribs ) */ - /* LISTof CLISTof pexVertex( numLists, vertexAttribs, colorType ) */ -} pexFillAreaSetWithData; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexColorType colorType B16; - pexBitmaskShort facetAttribs B16; - pexBitmaskShort vertexAttribs B16; - CARD16 unused B16; - CARD32 numVertices B32; - /* number of OptData is numVert - 2 */ - /* LISTof pexOptData( facetAttribs, colorType ) */ - /* LISTof pexVertex( numVertices, vertexAttribs, colorType ) */ -} pexTriangleStrip; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexColorType colorType B16; - CARD16 mPts B16; - CARD16 nPts B16; - pexBitmaskShort facetAttribs B16; - pexBitmaskShort vertexAttribs B16; - CARD16 shape B16; - /* actually, there are (mPts-1)*(nPts-1) opt data entries */ - /* LISTof pexOptData( facetAttribs, colorType ) */ - /* LISTof pexVertex( mPts, nPts, vertexAttribs, colorType ) */ -} pexQuadrilateralMesh; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - CARD16 shape B16; - pexColorType colorType B16; - CARD16 FAS_Attributes B16; - CARD16 vertexAttributes B16; - CARD16 edgeAttributes B16; - CARD8 contourHint; - pexSwitch contourCountsFlag; - CARD16 numFAS B16; - CARD16 numVertices B16; - CARD16 numEdges B16; - CARD16 numContours B16; - /* LISTof OPT_DATA( numFAS ) */ - /* LISTof pexVertex( numVertices ) */ - /* LISTof CARD8( numEdges ) */ - /* pad( numEdges ) */ - /* LISTof CLISTof CLISTof CARD16( numFAS, numContours, numEdges ) */ - /* pad */ -} pexSetOfFillAreaSets; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexCoordType type B16; - CARD16 uOrder B16; - CARD16 vOrder B16; - CARD16 unused B16; - CARD32 numUknots B32; - CARD32 numVknots B32; - CARD16 mPts B16; - CARD16 nPts B16; - CARD32 numLists B32; - /* LISTof FLOAT( numUknots ) */ - /* LISTof FLOAT( numVKnots ) */ - /* LISTof {pexCoord3D|pexCoord4D}( mPts, nPts, surfaceType ) */ - /* LISTof CLISTof pexTrimCurve( numLists ) */ -} pexNURBSurface; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT point1_x B32; - PEXFLOAT point1_y B32; - PEXFLOAT point1_z B32; - PEXFLOAT point2_x B32; - PEXFLOAT point2_y B32; - PEXFLOAT point2_z B32; - PEXFLOAT point3_x B32; - PEXFLOAT point3_y B32; - PEXFLOAT point3_z B32; - CARD32 dx B32; - CARD32 dy B32; - /* LISTof pexTableIndex( dx, dy ) */ - /* pad( 2*dx*dy ) */ -} pexCellArray; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - PEXFLOAT point1_x B32; - PEXFLOAT point1_y B32; - PEXFLOAT point2_x B32; - PEXFLOAT point2_y B32; - CARD32 dx B32; - CARD32 dy B32; - /* LISTof pexTableIndex( dx, dy ) */ - /* pad( 2*dx*dy ) */ -} pexCellArray2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - pexColorType colorType B16; - CARD16 unused B16; - PEXFLOAT point1_x B32; - PEXFLOAT point1_y B32; - PEXFLOAT point1_z B32; - PEXFLOAT point2_x B32; - PEXFLOAT point2_y B32; - PEXFLOAT point2_z B32; - PEXFLOAT point3_x B32; - PEXFLOAT point3_y B32; - PEXFLOAT point3_z B32; - CARD32 dx B32; - CARD32 dy B32; - /* LISTof pexColorSpecifier( dx, dy ) */ -} pexExtendedCellArray; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - INT32 gdpId B32; - CARD32 numPoints B32; - CARD32 numBytes B32; - /* LISTof pexCoord3D( numPoints ) */ - /* LISTof CARD8( numBytes ) -- don't swap */ - /* pad( numBytes ) */ -} pexGDP; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; - INT32 gdpId B32; - CARD32 numPoints B32; - CARD32 numBytes B32; - /* LISTof pexCoord2D( numPoints ) */ - /* LISTof CARD8( numBytes ) -- don't swap */ - /* pad( numBytes ) */ -} pexGDP2D; - -typedef struct { - CARD16 oc_opcode B16; - CARD16 oc_length B16; -} pexNoop; - -/**************************************************************** - * EVENTS * - ****************************************************************/ -/* Event structure */ - -typedef struct { - BYTE type; /* X_Event */ - CARD8 what; /* unused */ - CARD16 sequenceNumber B16; - CARD32 rdr B32; - BYTE pad[24]; -} pexMaxHitsReachedEvent; - -#undef XID -#undef Drawable - -#endif /* _PEXPROTO_H_ */ - Index: xc/lib/PEX5/PEXprotost.h diff -u xc/lib/PEX5/PEXprotost.h:1.2 xc/lib/PEX5/PEXprotost.h:removed --- xc/lib/PEX5/PEXprotost.h:1.2 Fri Dec 14 14:53:44 2001 +++ xc/lib/PEX5/PEXprotost.h Sat Feb 28 21:41:20 2004 @@ -1,682 +0,0 @@ -/* $Xorg: PEXprotost.h,v 1.4 2001/02/09 02:03:27 xorgcvs Exp $ */ -/* - -Copyright 1992, 1998 The Open Group - -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. - -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 OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - - -/****************************************************************************** -Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. - - All Rights Reserved - -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 Sun Microsystems not be used in advertising or publicity -pertaining to distribution of the software without specific, written prior -permission. Sun Microsystems makes no representations about the -suitability of this software for any purpose. It is provided "as is" without -express or implied warranty. - -SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT -SHALL SUN MICROSYSTEMS 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. -******************************************************************************/ - -#ifndef _PEXPROTOST_H_ -#define _PEXPROTOST_H_ - -/* Matches revision 5.1C */ - -#include /* defines things like CARD32 */ - - -/* This is FLOAT as defined and used by the Protocol Encoding */ -#ifndef WORD64 -typedef float PEXFLOAT; -#else -typedef CARD32 PEXFLOAT; -#endif - - -typedef CARD32 pexAsfAttribute; -typedef CARD8 pexAsfValue; -typedef CARD32 pexBitmask; -typedef CARD16 pexBitmaskShort; -typedef CARD16 pexCoordType; /* rational, nonrational */ -typedef CARD16 pexComposition; -typedef CARD16 pexCullMode; -typedef BYTE pexDynamicType; -typedef INT16 pexEnumTypeIndex; -typedef XID pexLookupTable; -typedef CARD32 pexName; -typedef XID pexNameSet; -typedef XID pexPC; -typedef XID pexFont; - -#ifndef WORD64 -typedef PEXFLOAT pexMatrix[4][4]; -typedef PEXFLOAT pexMatrix3X3[3][3]; -#else -typedef CARD8 pexMatrix[64]; -typedef CARD8 pexMatrix3X3[36]; -#endif - -typedef XID pexPhigsWks; -typedef XID pexPickMeasure; -typedef XID pexRenderer; -typedef XID pexSC; -typedef XID pexStructure; -typedef CARD8 pexSwitch; -typedef CARD16 pexTableIndex; -typedef CARD16 pexTableType; /* could be smaller if it ever helps */ -typedef CARD16 pexTextHAlignment; -typedef CARD16 pexTextVAlignment; -typedef CARD16 pexTypeOrTableIndex; -typedef pexEnumTypeIndex pexColorType; /* ColorType */ - -/* included in others */ -typedef struct { - CARD16 length B16; - /* list of CARD8 -- don't swap */ -} pexString; - -typedef struct { - pexStructure sid B32; - PEXFLOAT priority B32; -} pexStructureInfo; - -typedef struct { - PEXFLOAT x B32; - PEXFLOAT y B32; -} pexVector2D; - -typedef struct { - PEXFLOAT x B32; - PEXFLOAT y B32; - PEXFLOAT z B32; -} pexVector3D; - -/* Coord structures */ - -typedef struct { - PEXFLOAT x B32; - PEXFLOAT y B32; -} pexCoord2D; - -typedef struct { - PEXFLOAT x B32; - PEXFLOAT y B32; - PEXFLOAT z B32; -} pexCoord3D; - -typedef struct { - PEXFLOAT x B32; - PEXFLOAT y B32; - PEXFLOAT z B32; - PEXFLOAT w B32; -} pexCoord4D; - - -/* Color structures */ -typedef struct { - PEXFLOAT red B32; - PEXFLOAT green B32; - PEXFLOAT blue B32; -} pexRgbFloatColor; - -typedef struct { - PEXFLOAT hue B32; - PEXFLOAT saturation B32; - PEXFLOAT value B32; -} pexHsvColor; - -typedef struct { - PEXFLOAT hue B32; - PEXFLOAT lightness B32; - PEXFLOAT saturation B32; -} pexHlsColor; - -typedef struct { - PEXFLOAT x B32; - PEXFLOAT y B32; - PEXFLOAT z B32; -} pexCieColor; - -typedef struct { - CARD8 red; - CARD8 green; - CARD8 blue; - CARD8 pad; -} pexRgb8Color; - -typedef struct { - CARD16 red B16; - CARD16 green B16; - CARD16 blue B16; - CARD16 pad B16; -} pexRgb16Color; - -typedef struct { - pexTableIndex index B16; - CARD16 pad B16; -} pexIndexedColor; - -typedef struct { - union { - pexIndexedColor indexed; - pexRgb8Color rgb8; - pexRgb16Color rgb16; - pexRgbFloatColor rgbFloat; - pexHsvColor hsvFloat; - pexHlsColor hlsFloat; - pexCieColor cieFloat; - } format; -} pexColor; - -typedef struct { - PEXFLOAT first B32; - PEXFLOAT second B32; - PEXFLOAT third B32; -} pexFloatColor; - -typedef struct { - pexColorType colorType B16; /* ColorType enumerated type */ - CARD16 unused B16; - /* SINGLE COLOR(colorType) */ -} pexColorSpecifier; - - -typedef struct { - pexEnumTypeIndex approxMethod B16; - CARD16 unused B16; - PEXFLOAT tolerance B32; -} pexCurveApproxData; - -typedef struct { - INT16 x B16; - INT16 y B16; - PEXFLOAT z B32; -} pexDeviceCoord; - -typedef struct { - INT16 x B16; - INT16 y B16; -} pexDeviceCoord2D; - -typedef struct { - INT16 xmin B16; - INT16 ymin B16; - INT16 xmax B16; - INT16 ymax B16; -} pexDeviceRect; - -typedef struct { - CARD16 elementType B16; - CARD16 length B16; -} pexElementInfo; - -typedef struct { - CARD16 whence B16; - CARD16 unused B16; - INT32 offset B32; -} pexElementPos; - -typedef struct { - pexElementPos position1; /* pexElementPos is 8 bytes long */ - pexElementPos position2; -} pexElementRange; - -typedef struct { - pexStructure structure B32; - CARD32 offset B32; -} pexElementRef; - -typedef struct { - PEXFLOAT lowerLeft_x B32; - PEXFLOAT lowerLeft_y B32; - PEXFLOAT upperRight_x B32; - PEXFLOAT upperRight_y B32; - PEXFLOAT concatpoint_x B32; - PEXFLOAT concatpoint_y B32; -} pexExtentInfo; - -typedef struct { - pexEnumTypeIndex index B16; - CARD16 descriptor_length B16; -} pexEnumTypeDesc; - -typedef struct { - PEXFLOAT point_x B32; - PEXFLOAT point_y B32; - PEXFLOAT point_z B32; - PEXFLOAT vector_x B32; - PEXFLOAT vector_y B32; - PEXFLOAT vector_z B32; -} pexHalfSpace; - -typedef struct { - pexNameSet incl B32; - pexNameSet excl B32; -} pexNameSetPair; - -typedef struct { - PEXFLOAT point_x B32; - PEXFLOAT point_y B32; - PEXFLOAT vector_x B32; - PEXFLOAT vector_y B32; -} pexHalfSpace2D; - -typedef struct { - CARD16 composition B16; - CARD16 unused B16; - pexMatrix matrix; -} pexLocalTransform3DData; - -typedef struct { - CARD16 composition B16; - CARD16 unused B16; - pexMatrix3X3 matrix; -} pexLocalTransform2DData; - -typedef struct { - PEXFLOAT xmin B32; - PEXFLOAT ymin B32; - PEXFLOAT zmin B32; - PEXFLOAT xmax B32; - PEXFLOAT ymax B32; - PEXFLOAT zmax B32; -} pexNpcSubvolume; - -/* an OPT_DATA structure cannot be defined because it has variable content - * and size. An union structure could be used to define a template for - * the data. However, since unions pad to a fixed amount of space and the - * protocol uses variable lengths, this is not appropriate for protocol - * data types. The most correct way of defining this data is to define - * one data structure for every possible combination of color, normal and - * edge data that could be given with a vertex or facet. - */ - -typedef struct { - pexStructure sid B32; - CARD32 offset B32; - CARD32 pickid B32; -} pexPickElementRef; - -/* pexPickPath is the old name of the above strucutre. - This is wrong, since the above is a Pick Element Ref - a Pick Path is a list of Pick Element Refs so naming - this structure pexPickPath was wrong, but it can't just - be changed without effecting lots of other code....... */ - -typedef pexPickElementRef pexPickPath; - -typedef struct { - pexTextVAlignment vertical B16; - pexTextHAlignment horizontal B16; -} pexTextAlignmentData; - -typedef struct { - pexSwitch visibility; - CARD8 unused; - CARD16 order B16; - pexCoordType type B16; - INT16 approxMethod B16; - PEXFLOAT tolerance B32; - PEXFLOAT tMin B32; - PEXFLOAT tMax B32; - CARD32 numKnots B32; - CARD32 numCoord B32; - /* LISTof FLOAT(numKnots) -- length = order + number of coords */ - /* LISTof {pexCoord3D|pexCoord4D}(numCoord) */ -} pexTrimCurve; - -typedef struct { - CARD8 depth; - CARD8 unused; - CARD16 type B16; - CARD32 visualID B32; -} pexRendererTarget; - -typedef struct { - pexEnumTypeIndex pickType B16; - CARD16 unused B16; - /* SINGLE HITBOX() */ -} pexPickRecord; - -typedef struct { - PEXFLOAT ambient B32; - PEXFLOAT diffuse B32; - PEXFLOAT specular B32; - PEXFLOAT specularConc B32; - PEXFLOAT transmission B32; /* 0.0 = opaque, 1.0 = transparent */ - pexColorType specular_colorType B16; - CARD16 unused B16; - /* SINGLE COLOR() */ -} pexReflectionAttr; - -typedef struct { - pexEnumTypeIndex approxMethod B16; - CARD16 unused B16; - PEXFLOAT uTolerance B32; - PEXFLOAT vTolerance B32; -} pexSurfaceApproxData; - - -typedef struct { - PEXFLOAT point_x B32; - PEXFLOAT point_y B32; - PEXFLOAT point_z B32; - /* SINGLE OPT_DATA() */ -} pexVertex; - - -typedef struct { - INT16 xmin B16; - INT16 ymin B16; - PEXFLOAT zmin B32; - INT16 xmax B16; - INT16 ymax B16; - PEXFLOAT zmax B32; - pexSwitch useDrawable; - BYTE pad[3]; -} pexViewport; - -typedef struct { - CARD16 clipFlags B16; - CARD16 unused B16; - PEXFLOAT clipLimits_xmin B32; - PEXFLOAT clipLimits_ymin B32; - PEXFLOAT clipLimits_zmin B32; - PEXFLOAT clipLimits_xmax B32; - PEXFLOAT clipLimits_ymax B32; - PEXFLOAT clipLimits_zmax B32; - pexMatrix orientation; - pexMatrix mapping; -} pexViewEntry; - -typedef struct { - pexTableIndex index B16; - CARD16 unused1 B16; - CARD16 clipFlags B16; - CARD16 unused2 B16; - PEXFLOAT clipLimits_xmin B32; - PEXFLOAT clipLimits_ymin B32; - PEXFLOAT clipLimits_zmin B32; - PEXFLOAT clipLimits_xmax B32; - PEXFLOAT clipLimits_ymax B32; - PEXFLOAT clipLimits_zmax B32; - pexMatrix orientation; - pexMatrix mapping; -} pexViewRep; - -/* - * typedefs for lookup tables - */ - -typedef struct { - CARD16 definableEntries B16; - CARD16 numPredefined B16; - CARD16 predefinedMin B16; - CARD16 predefinedMax B16; -} pexTableInfo; - -typedef struct { - pexEnumTypeIndex lineType B16; - pexEnumTypeIndex polylineInterp B16; - pexEnumTypeIndex curveApprox_method B16; - CARD16 unused1 B16; - PEXFLOAT curveApprox_tolerance B32; - PEXFLOAT lineWidth B32; - pexColorType lineColorType B16; - CARD16 unused2 B16; - /* SINGLE COLOR(lineColorType) */ -} pexLineBundleEntry; - -typedef struct { - pexEnumTypeIndex markerType B16; - INT16 unused1 B16; - PEXFLOAT markerScale B32; - pexColorType markerColorType B16; - CARD16 unused2 B16; - /* SINGLE COLOR(markerColorType) */ -} pexMarkerBundleEntry; - -typedef struct { - CARD16 textFontIndex B16; - CARD16 textPrecision B16; - PEXFLOAT charExpansion B32; - PEXFLOAT charSpacing B32; - pexColorType textColorType B16; - CARD16 unused B16; - /* SINGLE COLOR(textColorType) */ -} pexTextBundleEntry; - - -/* - Note that since an InteriorBundleEntry contains 4 embedded instances of - pexColorSpecifier, a variable-sized item, a data structure cannot be - defined for it. -*/ -typedef struct { - pexEnumTypeIndex interiorStyle B16; - INT16 interiorStyleIndex B16; - pexEnumTypeIndex reflectionModel B16; - pexEnumTypeIndex surfaceInterp B16; - pexEnumTypeIndex bfInteriorStyle B16; - INT16 bfInteriorStyleIndex B16; - pexEnumTypeIndex bfReflectionModel B16; - pexEnumTypeIndex bfSurfaceInterp B16; - pexEnumTypeIndex surfaceApprox_method B16; - CARD16 unused B16; - PEXFLOAT surfaceApproxuTolerance B32; - PEXFLOAT surfaceApproxvTolerance B32; - /* SINGLE pexColorSpecifier surfaceColor */ - /* SINGLE pexReflectionAttr reflectionAttr */ - /* SINGLE pexColorSpecifier bfSurfaceColor */ - /* SINGLE pexReflectionAttr bfReflectionAttr */ -} pexInteriorBundleEntry; - -typedef struct { - pexSwitch edges; - CARD8 unused1; - pexEnumTypeIndex edgeType B16; - PEXFLOAT edgeWidth B32; - pexColorType edgeColorType B16; - CARD16 unused2 B16; - /* SINGLE COLOR(edgeColorType) */ -} pexEdgeBundleEntry; - -typedef struct { - pexColorType colorType B16; - CARD16 numx B16; - CARD16 numy B16; - CARD16 unused B16; - /* LISTof Color(numx, numy) 2D array of colors */ -} pexPatternEntry; - -/* a pexColorEntry is just a pexColorSpecifier -*/ - -typedef struct { - CARD32 numFonts B32; - /* LISTof pexFont( numFonts ) */ -} pexTextFontEntry; - -/* a pexViewEntry is defined above */ - -typedef struct { - pexEnumTypeIndex lightType B16; - INT16 unused1 B16; - PEXFLOAT direction_x B32; - PEXFLOAT direction_y B32; - PEXFLOAT direction_z B32; - PEXFLOAT point_x B32; - PEXFLOAT point_y B32; - PEXFLOAT point_z B32; - PEXFLOAT concentration B32; - PEXFLOAT spreadAngle B32; - PEXFLOAT attenuation1 B32; - PEXFLOAT attenuation2 B32; - pexColorType lightColorType B16; - CARD16 unused2 B16; - /* SINGLE COLOR(lightColorType) */ -} pexLightEntry; - -typedef struct { - pexSwitch mode; - CARD8 unused1; - CARD16 unused2 B16; - PEXFLOAT frontPlane B32; - PEXFLOAT backPlane B32; - PEXFLOAT frontScaling B32; - PEXFLOAT backScaling B32; - pexColorType depthCueColorType B16; - CARD16 unused3 B16; - /* SINGLE COLOR(depthCueColorType) */ -} pexDepthCueEntry; - -typedef struct { - INT16 approxType B16; - INT16 approxModel B16; - CARD16 max1 B16; - CARD16 max2 B16; - CARD16 max3 B16; - CARD8 dither; - CARD8 unused; - CARD32 mult1 B32; - CARD32 mult2 B32; - CARD32 mult3 B32; - PEXFLOAT weight1 B32; - PEXFLOAT weight2 B32; - PEXFLOAT weight3 B32; - CARD32 basePixel B32; -} pexColorApproxEntry; - - -/* Font structures */ - -typedef struct { - Atom name B32; - CARD32 value B32; -} pexFontProp; - -typedef struct { - CARD32 firstGlyph B32; - CARD32 lastGlyph B32; - CARD32 defaultGlyph B32; - pexSwitch allExist; - pexSwitch strokeFont; - CARD16 unused B16; - CARD32 numProps B32; - /* LISTof pexFontProp(numProps) */ -} pexFontInfo; - - -/* Text Structures */ - -typedef struct { - INT16 characterSet B16; - CARD8 characterSetWidth; - CARD8 encodingState; - CARD16 unused B16; - CARD16 numChars B16; - /* LISTof CHARACTER( numChars ) */ - /* pad */ -} pexMonoEncoding; - -/* CHARACTER is either a CARD8, a CARD16, or a CARD32 */ - - -/* Parametric Surface Characteristics types */ - -/* type 1 None */ - -/* type 2 Implementation Dependent */ - -typedef struct { - CARD16 placementType B16; - CARD16 unused B16; - CARD16 numUcurves B16; - CARD16 numVcurves B16; -} pexPSC_IsoparametricCurves; /* type 3 */ - -typedef struct { - PEXFLOAT origin_x B32; - PEXFLOAT origin_y B32; - PEXFLOAT origin_z B32; - PEXFLOAT direction_x B32; - PEXFLOAT direction_y B32; - PEXFLOAT direction_z B32; - CARD16 numberIntersections B16; - CARD16 pad B16; - /* LISTof pexCoord3D( numIntersections ) */ -} pexPSC_LevelCurves; /* type 4: MC - type 5: WC */ - -/* Pick Device data records */ - -typedef struct { - INT16 position_x B16; - INT16 position_y B16; - PEXFLOAT distance B32; -} pexPD_DC_HitBox; /* pick device 1 */ - -typedef pexNpcSubvolume pexPD_NPC_HitVolume; /* pick device 2 */ - - -/* Output Command errors */ - -typedef struct { - CARD8 type; /* 0 */ - CARD8 errorCode; /* 14 */ - CARD16 sequenceNumber B16; - CARD32 resourceId B32; /* renderer or structure */ - CARD16 minorCode B16; - CARD8 majorCode; - CARD8 unused; - CARD16 opcode B16; /* opcode of failed output command */ - CARD16 numCommands B16; /* number successfully done before error */ - BYTE pad[16]; -} pexOutputCommandError; - - -/* Registered PEX Escapes */ - -typedef struct { - INT16 fpFormat B16; - CARD8 unused[2]; - CARD32 rdr B32; /* renderer ID */ - /* SINGLE ColorSpecifier() */ -} pexEscapeSetEchoColorData; - -#endif /* _PEXPROTOST_H_ */ Index: xc/lib/PEX5/jump_funcs diff -u xc/lib/PEX5/jump_funcs:3.2 xc/lib/PEX5/jump_funcs:removed --- xc/lib/PEX5/jump_funcs:3.2 Wed Jan 17 14:41:30 2001 +++ xc/lib/PEX5/jump_funcs Sat Feb 28 21:41:20 2004 @@ -1,420 +0,0 @@ -# $Xorg: jump_funcs,v 1.3 2000/08/17 19:44:21 cpqbld Exp $ -# -# -# -# $XFree86: xc/lib/PEX5/jump_funcs,v 3.2 2001/01/17 19:41:30 dawes Exp $ -# -00000000 T _PEXEscape libPEX5 pl_escape -00000000 T _PEXEscapeWithReply libPEX5 pl_escape -00000000 T _PEXSetEchoColor libPEX5 pl_escape -00000000 T _PEXLoadFont libPEX5 pl_font -00000000 T _PEXUnloadFont libPEX5 pl_font -00000000 T _PEXQueryFont libPEX5 pl_font -00000000 T _PEXListFonts libPEX5 pl_font -00000000 T _PEXListFontsWithInfo libPEX5 pl_font -00000000 T _PEXQueryTextExtents libPEX5 pl_font -00000000 T _PEXQueryEncodedTextExtents libPEX5 pl_font -00000000 T _PEXFreeEnumInfo libPEX5 pl_free -00000000 T _PEXFreeFontInfo libPEX5 pl_free -00000000 T _PEXFreeFontNames libPEX5 pl_free -00000000 T _PEXFreePCAttributes libPEX5 pl_free -00000000 T _PEXFreePDAttributes libPEX5 pl_free -00000000 T _PEXFreePMAttributes libPEX5 pl_free -00000000 T _PEXFreePickPaths libPEX5 pl_free -00000000 T _PEXFreeRendererAttributes libPEX5 pl_free -00000000 T _PEXFreeSCAttributes libPEX5 pl_free -00000000 T _PEXFreeStructurePaths libPEX5 pl_free -00000000 T _PEXFreeTableEntries libPEX5 pl_free -00000000 T _PEXFreeWorkstationAttributes libPEX5 pl_free -00000000 T _PEXFreeOCData libPEX5 pl_free -00000000 T _PEXCreateLookupTable libPEX5 pl_lut -00000000 T _PEXFreeLookupTable libPEX5 pl_lut -00000000 T _PEXCopyLookupTable libPEX5 pl_lut -00000000 T _PEXGetTableInfo libPEX5 pl_lut -00000000 T _PEXGetPredefinedEntries libPEX5 pl_lut -00000000 T _PEXGetDefinedIndices libPEX5 pl_lut -00000000 T _PEXGetTableEntry libPEX5 pl_lut -00000000 T _PEXGetTableEntries libPEX5 pl_lut -00000000 T _PEXSetTableEntries libPEX5 pl_lut -00000000 T _PEXDeleteTableEntries libPEX5 pl_lut -00000000 T _PEXCreateNameSet libPEX5 pl_nameset -00000000 T _PEXFreeNameSet libPEX5 pl_nameset -00000000 T _PEXCopyNameSet libPEX5 pl_nameset -00000000 T _PEXGetNameSet libPEX5 pl_nameset -00000000 T _PEXChangeNameSet libPEX5 pl_nameset -00000000 T _PEXSetMarkerType libPEX5 pl_oc_attr -00000000 T _PEXSetMarkerScale libPEX5 pl_oc_attr -00000000 T _PEXSetMarkerColorIndex libPEX5 pl_oc_attr -00000000 T _PEXSetMarkerColor libPEX5 pl_oc_attr -00000000 T _PEXSetMarkerBundleIndex libPEX5 pl_oc_attr -00000000 T _PEXSetTextFontIndex libPEX5 pl_oc_attr -00000000 T _PEXSetTextPrecision libPEX5 pl_oc_attr -00000000 T _PEXSetCharExpansion libPEX5 pl_oc_attr -00000000 T _PEXSetCharSpacing libPEX5 pl_oc_attr -00000000 T _PEXSetTextColorIndex libPEX5 pl_oc_attr -00000000 T _PEXSetTextColor libPEX5 pl_oc_attr -00000000 T _PEXSetCharHeight libPEX5 pl_oc_attr -00000000 T _PEXSetCharUpVector libPEX5 pl_oc_attr -00000000 T _PEXSetTextPath libPEX5 pl_oc_attr -00000000 T _PEXSetTextAlignment libPEX5 pl_oc_attr -00000000 T _PEXSetATextHeight libPEX5 pl_oc_attr -00000000 T _PEXSetATextUpVector libPEX5 pl_oc_attr -00000000 T _PEXSetATextPath libPEX5 pl_oc_attr -00000000 T _PEXSetATextAlignment libPEX5 pl_oc_attr -00000000 T _PEXSetATextStyle libPEX5 pl_oc_attr -00000000 T _PEXSetTextBundleIndex libPEX5 pl_oc_attr -00000000 T _PEXSetLineType libPEX5 pl_oc_attr -00000000 T _PEXSetLineWidth libPEX5 pl_oc_attr -00000000 T _PEXSetLineColorIndex libPEX5 pl_oc_attr -00000000 T _PEXSetLineColor libPEX5 pl_oc_attr -00000000 T _PEXSetCurveApprox libPEX5 pl_oc_attr -00000000 T _PEXSetPolylineInterpMethod libPEX5 pl_oc_attr -00000000 T _PEXSetLineBundleIndex libPEX5 pl_oc_attr -00000000 T _PEXSetInteriorStyle libPEX5 pl_oc_attr -00000000 T _PEXSetInteriorStyleIndex libPEX5 pl_oc_attr -00000000 T _PEXSetSurfaceColorIndex libPEX5 pl_oc_attr -00000000 T _PEXSetSurfaceColor libPEX5 pl_oc_attr -00000000 T _PEXSetReflectionAttributes libPEX5 pl_oc_attr -00000000 T _PEXSetReflectionModel libPEX5 pl_oc_attr -00000000 T _PEXSetSurfaceInterpMethod libPEX5 pl_oc_attr -00000000 T _PEXSetBFInteriorStyle libPEX5 pl_oc_attr -00000000 T _PEXSetBFInteriorStyleIndex libPEX5 pl_oc_attr -00000000 T _PEXSetBFSurfaceColorIndex libPEX5 pl_oc_attr -00000000 T _PEXSetBFSurfaceColor libPEX5 pl_oc_attr -00000000 T _PEXSetBFReflectionAttributes libPEX5 pl_oc_attr -00000000 T _PEXSetBFReflectionModel libPEX5 pl_oc_attr -00000000 T _PEXSetBFSurfaceInterpMethod libPEX5 pl_oc_attr -00000000 T _PEXSetSurfaceApprox libPEX5 pl_oc_attr -00000000 T _PEXSetFacetCullingMode libPEX5 pl_oc_attr -00000000 T _PEXSetFacetDistinguishFlag libPEX5 pl_oc_attr -00000000 T _PEXSetPatternSize libPEX5 pl_oc_attr -00000000 T _PEXSetPatternAttributes2D libPEX5 pl_oc_attr -00000000 T _PEXSetPatternAttributes libPEX5 pl_oc_attr -00000000 T _PEXSetInteriorBundleIndex libPEX5 pl_oc_attr -00000000 T _PEXSetSurfaceEdgeFlag libPEX5 pl_oc_attr -00000000 T _PEXSetSurfaceEdgeType libPEX5 pl_oc_attr -00000000 T _PEXSetSurfaceEdgeWidth libPEX5 pl_oc_attr -00000000 T _PEXSetSurfaceEdgeColorIndex libPEX5 pl_oc_attr -00000000 T _PEXSetSurfaceEdgeColor libPEX5 pl_oc_attr -00000000 T _PEXSetEdgeBundleIndex libPEX5 pl_oc_attr -00000000 T _PEXSetIndividualASF libPEX5 pl_oc_attr -00000000 T _PEXSetLocalTransform libPEX5 pl_oc_attr -00000000 T _PEXSetLocalTransform2D libPEX5 pl_oc_attr -00000000 T _PEXSetGlobalTransform libPEX5 pl_oc_attr -00000000 T _PEXSetGlobalTransform2D libPEX5 pl_oc_attr -00000000 T _PEXSetModelClipFlag libPEX5 pl_oc_attr -00000000 T _PEXSetModelClipVolume libPEX5 pl_oc_attr -00000000 T _PEXSetModelClipVolume2D libPEX5 pl_oc_attr -00000000 T _PEXRestoreModelClipVolume libPEX5 pl_oc_attr -00000000 T _PEXSetViewIndex libPEX5 pl_oc_attr -00000000 T _PEXSetLightSourceState libPEX5 pl_oc_attr -00000000 T _PEXSetDepthCueIndex libPEX5 pl_oc_attr -00000000 T _PEXSetPickID libPEX5 pl_oc_attr -00000000 T _PEXSetHLHSRID libPEX5 pl_oc_attr -00000000 T _PEXSetColorApproxIndex libPEX5 pl_oc_attr -00000000 T _PEXSetParaSurfCharacteristics libPEX5 pl_oc_attr -00000000 T _PEXSetRenderingColorModel libPEX5 pl_oc_attr -00000000 T _PEXAddToNameSet libPEX5 pl_oc_attr -00000000 T _PEXRemoveFromNameSet libPEX5 pl_oc_attr -00000000 T _PEXDecodeOCs libPEX5 pl_oc_dec -00000000 T __PEXDecodeEnumType libPEX5 pl_oc_dec -00000000 T __PEXDecodeTableIndex libPEX5 pl_oc_dec -00000000 T __PEXDecodeColor libPEX5 pl_oc_dec -00000000 T __PEXDecodeFloat libPEX5 pl_oc_dec -00000000 T __PEXDecodeCARD16 libPEX5 pl_oc_dec -00000000 T __PEXDecodeVector2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeTextAlignment libPEX5 pl_oc_dec -00000000 T __PEXDecodeCurveApprox libPEX5 pl_oc_dec -00000000 T __PEXDecodeReflectionAttr libPEX5 pl_oc_dec -00000000 T __PEXDecodeSurfaceApprox libPEX5 pl_oc_dec -00000000 T __PEXDecodeCullMode libPEX5 pl_oc_dec -00000000 T __PEXDecodeSwitch libPEX5 pl_oc_dec -00000000 T __PEXDecodePatternSize libPEX5 pl_oc_dec -00000000 T __PEXDecodePatternAttr2D libPEX5 pl_oc_dec -00000000 T __PEXDecodePatternAttr libPEX5 pl_oc_dec -00000000 T __PEXDecodeASF libPEX5 pl_oc_dec -00000000 T __PEXDecodeLocalTransform libPEX5 pl_oc_dec -00000000 T __PEXDecodeLocalTransform2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeGlobalTransform libPEX5 pl_oc_dec -00000000 T __PEXDecodeGlobalTransform2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeModelClipVolume libPEX5 pl_oc_dec -00000000 T __PEXDecodeModelClipVolume2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeRestoreModelClip libPEX5 pl_oc_dec -00000000 T __PEXDecodeLightSourceState libPEX5 pl_oc_dec -00000000 T __PEXDecodeID libPEX5 pl_oc_dec -00000000 T __PEXDecodePSC libPEX5 pl_oc_dec -00000000 T __PEXDecodeNameSet libPEX5 pl_oc_dec -00000000 T __PEXDecodeExecuteStructure libPEX5 pl_oc_dec -00000000 T __PEXDecodeLabel libPEX5 pl_oc_dec -00000000 T __PEXDecodeApplicationData libPEX5 pl_oc_dec -00000000 T __PEXDecodeGSE libPEX5 pl_oc_dec -00000000 T __PEXDecodeMarkers libPEX5 pl_oc_dec -00000000 T __PEXDecodeMarkers2D libPEX5 pl_oc_dec -00000000 T __PEXDecodePolyline libPEX5 pl_oc_dec -00000000 T __PEXDecodePolyline2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeText libPEX5 pl_oc_dec -00000000 T __PEXDecodeText2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeAnnoText libPEX5 pl_oc_dec -00000000 T __PEXDecodeAnnoText2D libPEX5 pl_oc_dec -00000000 T __PEXDecodePolylineSet libPEX5 pl_oc_dec -00000000 T __PEXDecodeNURBCurve libPEX5 pl_oc_dec -00000000 T __PEXDecodeFillArea libPEX5 pl_oc_dec -00000000 T __PEXDecodeFillArea2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeFillAreaWithData libPEX5 pl_oc_dec -00000000 T __PEXDecodeFillAreaSet libPEX5 pl_oc_dec -00000000 T __PEXDecodeFillAreaSet2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeFillAreaSetWithData libPEX5 pl_oc_dec -00000000 T __PEXDecodeTriangleStrip libPEX5 pl_oc_dec -00000000 T __PEXDecodeQuadMesh libPEX5 pl_oc_dec -00000000 T __PEXDecodeSOFA libPEX5 pl_oc_dec -00000000 T __PEXDecodeNURBSurface libPEX5 pl_oc_dec -00000000 T __PEXDecodeCellArray libPEX5 pl_oc_dec -00000000 T __PEXDecodeCellArray2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeExtendedCellArray libPEX5 pl_oc_dec -00000000 T __PEXDecodeGDP libPEX5 pl_oc_dec -00000000 T __PEXDecodeGDP2D libPEX5 pl_oc_dec -00000000 T __PEXDecodeNoop libPEX5 pl_oc_dec -00000000 T _PEXEncodeOCs libPEX5 pl_oc_enc -00000000 T __PEXEncodeEnumType libPEX5 pl_oc_enc -00000000 T __PEXEncodeTableIndex libPEX5 pl_oc_enc -00000000 T __PEXEncodeColor libPEX5 pl_oc_enc -00000000 T __PEXEncodeFloat libPEX5 pl_oc_enc -00000000 T __PEXEncodeCARD16 libPEX5 pl_oc_enc -00000000 T __PEXEncodeVector2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeTextAlignment libPEX5 pl_oc_enc -00000000 T __PEXEncodeCurveApprox libPEX5 pl_oc_enc -00000000 T __PEXEncodeReflectionAttr libPEX5 pl_oc_enc -00000000 T __PEXEncodeSurfaceApprox libPEX5 pl_oc_enc -00000000 T __PEXEncodeCullMode libPEX5 pl_oc_enc -00000000 T __PEXEncodeSwitch libPEX5 pl_oc_enc -00000000 T __PEXEncodePatternSize libPEX5 pl_oc_enc -00000000 T __PEXEncodePatternAttr2D libPEX5 pl_oc_enc -00000000 T __PEXEncodePatternAttr libPEX5 pl_oc_enc -00000000 T __PEXEncodeASF libPEX5 pl_oc_enc -00000000 T __PEXEncodeLocalTransform libPEX5 pl_oc_enc -00000000 T __PEXEncodeLocalTransform2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeGlobalTransform libPEX5 pl_oc_enc -00000000 T __PEXEncodeGlobalTransform2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeModelClipVolume libPEX5 pl_oc_enc -00000000 T __PEXEncodeModelClipVolume2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeRestoreModelClip libPEX5 pl_oc_enc -00000000 T __PEXEncodeLightSourceState libPEX5 pl_oc_enc -00000000 T __PEXEncodeID libPEX5 pl_oc_enc -00000000 T __PEXEncodePSC libPEX5 pl_oc_enc -00000000 T __PEXEncodeNameSet libPEX5 pl_oc_enc -00000000 T __PEXEncodeExecuteStructure libPEX5 pl_oc_enc -00000000 T __PEXEncodeLabel libPEX5 pl_oc_enc -00000000 T __PEXEncodeApplicationData libPEX5 pl_oc_enc -00000000 T __PEXEncodeGSE libPEX5 pl_oc_enc -00000000 T __PEXEncodeMarkers libPEX5 pl_oc_enc -00000000 T __PEXEncodePolyline libPEX5 pl_oc_enc -00000000 T __PEXEncodeMarkers2D libPEX5 pl_oc_enc -00000000 T __PEXEncodePolyline2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeText libPEX5 pl_oc_enc -00000000 T __PEXEncodeText2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeAnnoText libPEX5 pl_oc_enc -00000000 T __PEXEncodeAnnoText2D libPEX5 pl_oc_enc -00000000 T __PEXEncodePolylineSet libPEX5 pl_oc_enc -00000000 T __PEXEncodeNURBCurve libPEX5 pl_oc_enc -00000000 T __PEXEncodeFillArea libPEX5 pl_oc_enc -00000000 T __PEXEncodeFillArea2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeFillAreaWithData libPEX5 pl_oc_enc -00000000 T __PEXEncodeFillAreaSet libPEX5 pl_oc_enc -00000000 T __PEXEncodeFillAreaSet2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeFillAreaSetWithData libPEX5 pl_oc_enc -00000000 T __PEXEncodeTriangleStrip libPEX5 pl_oc_enc -00000000 T __PEXEncodeQuadMesh libPEX5 pl_oc_enc -00000000 T __PEXEncodeSOFA libPEX5 pl_oc_enc -00000000 T __PEXEncodeNURBSurface libPEX5 pl_oc_enc -00000000 T __PEXEncodeCellArray libPEX5 pl_oc_enc -00000000 T __PEXEncodeCellArray2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeExtendedCellArray libPEX5 pl_oc_enc -00000000 T __PEXEncodeGDP libPEX5 pl_oc_enc -00000000 T __PEXEncodeGDP2D libPEX5 pl_oc_enc -00000000 T __PEXEncodeNoop libPEX5 pl_oc_enc -00000000 T _PEXMarkers libPEX5 pl_oc_prim -00000000 T _PEXMarkers2D libPEX5 pl_oc_prim -00000000 T _PEXText libPEX5 pl_oc_prim -00000000 T _PEXText2D libPEX5 pl_oc_prim -00000000 T _PEXAnnotationText libPEX5 pl_oc_prim -00000000 T _PEXAnnotationText2D libPEX5 pl_oc_prim -00000000 T _PEXEncodedText libPEX5 pl_oc_prim -00000000 T _PEXEncodedText2D libPEX5 pl_oc_prim -00000000 T _PEXEncodedAnnoText libPEX5 pl_oc_prim -00000000 T _PEXEncodedAnnoText2D libPEX5 pl_oc_prim -00000000 T _PEXPolyline libPEX5 pl_oc_prim -00000000 T _PEXPolyline2D libPEX5 pl_oc_prim -00000000 T _PEXPolylineSetWithData libPEX5 pl_oc_prim -00000000 T _PEXNURBCurve libPEX5 pl_oc_prim -00000000 T _PEXFillArea libPEX5 pl_oc_prim -00000000 T _PEXFillArea2D libPEX5 pl_oc_prim -00000000 T _PEXFillAreaWithData libPEX5 pl_oc_prim -00000000 T _PEXFillAreaSet libPEX5 pl_oc_prim -00000000 T _PEXFillAreaSet2D libPEX5 pl_oc_prim -00000000 T _PEXFillAreaSetWithData libPEX5 pl_oc_prim -00000000 T _PEXSetOfFillAreaSets libPEX5 pl_oc_prim -00000000 T _PEXTriangleStrip libPEX5 pl_oc_prim -00000000 T _PEXQuadrilateralMesh libPEX5 pl_oc_prim -00000000 T _PEXNURBSurface libPEX5 pl_oc_prim -00000000 T _PEXCellArray libPEX5 pl_oc_prim -00000000 T _PEXCellArray2D libPEX5 pl_oc_prim -00000000 T _PEXExtendedCellArray libPEX5 pl_oc_prim -00000000 T _PEXGDP libPEX5 pl_oc_prim -00000000 T _PEXGDP2D libPEX5 pl_oc_prim -00000000 T _PEXExecuteStructure libPEX5 pl_oc_struct -00000000 T _PEXLabel libPEX5 pl_oc_struct -00000000 T _PEXNoop libPEX5 pl_oc_struct -00000000 T _PEXApplicationData libPEX5 pl_oc_struct -00000000 T _PEXGSE libPEX5 pl_oc_struct -00000000 T _PEXStartOCs libPEX5 pl_oc_util -00000000 T _PEXFinishOCs libPEX5 pl_oc_util -00000000 T __PEXSendBytesToOC libPEX5 pl_oc_util -00000000 T _PEXCopyBytesToOC libPEX5 pl_oc_util -00000000 T __PEXCopyPaddedBytesToOC libPEX5 pl_oc_util -00000000 T _PEXGetOCAddr libPEX5 pl_oc_util -00000000 T _PEXSendOCs libPEX5 pl_oc_util -00000000 T __PEXGenOCBadLengthError libPEX5 pl_oc_util -00000000 T _PEXGetSizeOCs libPEX5 pl_oc_util -00000000 T _PEXCountOCs libPEX5 pl_oc_util -00000000 T _PEXCreatePipelineContext libPEX5 pl_pc -00000000 T _PEXFreePipelineContext libPEX5 pl_pc -00000000 T _PEXCopyPipelineContext libPEX5 pl_pc -00000000 T _PEXGetPipelineContext libPEX5 pl_pc -00000000 T _PEXChangePipelineContext libPEX5 pl_pc -00000000 T _PEXCreatePickMeasure libPEX5 pl_pick -00000000 T _PEXFreePickMeasure libPEX5 pl_pick -00000000 T _PEXGetPickMeasure libPEX5 pl_pick -00000000 T _PEXUpdatePickMeasure libPEX5 pl_pick -00000000 T _PEXGetPickDevice libPEX5 pl_pick -00000000 T _PEXChangePickDevice libPEX5 pl_pick -00000000 T __PEXConvertMaxHitsEvent libPEX5 pl_pick -00000000 T _PEXBeginPickOne libPEX5 pl_pick -00000000 T _PEXEndPickOne libPEX5 pl_pick -00000000 T _PEXPickOne libPEX5 pl_pick -00000000 T _PEXBeginPickAll libPEX5 pl_pick -00000000 T _PEXEndPickAll libPEX5 pl_pick -00000000 T _PEXPickAll libPEX5 pl_pick -00000000 T _PEXCreateRenderer libPEX5 pl_rdr -00000000 T _PEXFreeRenderer libPEX5 pl_rdr -00000000 T _PEXGetRendererAttributes libPEX5 pl_rdr -00000000 T _PEXGetRendererDynamics libPEX5 pl_rdr -00000000 T _PEXChangeRenderer libPEX5 pl_rdr -00000000 T _PEXBeginRendering libPEX5 pl_rdr -00000000 T _PEXEndRendering libPEX5 pl_rdr -00000000 T _PEXBeginStructure libPEX5 pl_rdr -00000000 T _PEXEndStructure libPEX5 pl_rdr -00000000 T _PEXRenderNetwork libPEX5 pl_rdr -00000000 T _PEXRenderElements libPEX5 pl_rdr -00000000 T _PEXAccumulateState libPEX5 pl_rdr -00000000 T _PEXCreateSearchContext libPEX5 pl_sc -00000000 T _PEXFreeSearchContext libPEX5 pl_sc -00000000 T _PEXCopySearchContext libPEX5 pl_sc -00000000 T _PEXGetSearchContext libPEX5 pl_sc -00000000 T _PEXChangeSearchContext libPEX5 pl_sc -00000000 T _PEXSearchNetwork libPEX5 pl_sc -00000000 T _PEXInitialize libPEX5 pl_startup -00000000 T _PEXGetExtensionInfo libPEX5 pl_startup -00000000 T _PEXGetProtocolFloatFormat libPEX5 pl_startup -00000000 T _PEXGetEnumTypeInfo libPEX5 pl_startup -00000000 T _PEXGetImpDepConstants libPEX5 pl_startup -00000000 T _PEXMatchRenderingTargets libPEX5 pl_startup -00000000 T __PEXConvertOCError libPEX5 pl_startup -00000000 T __PEXPrintOCError libPEX5 pl_startup -00000000 T __PEXCloseDisplay libPEX5 pl_startup -00000000 T _PEXCreateStructure libPEX5 pl_struct -00000000 T _PEXDestroyStructures libPEX5 pl_struct -00000000 T _PEXCopyStructure libPEX5 pl_struct -00000000 T _PEXGetStructureInfo libPEX5 pl_struct -00000000 T _PEXGetElementInfo libPEX5 pl_struct -00000000 T _PEXGetStructuresInNetwork libPEX5 pl_struct -00000000 T _PEXGetAncestors libPEX5 pl_struct -00000000 T _PEXGetDescendants libPEX5 pl_struct -00000000 T _PEXFetchElements libPEX5 pl_struct -00000000 T _PEXFetchElementsAndSend libPEX5 pl_struct -00000000 T _PEXSetEditingMode libPEX5 pl_struct -00000000 T _PEXSetElementPtr libPEX5 pl_struct -00000000 T _PEXSetElementPtrAtLabel libPEX5 pl_struct -00000000 T _PEXElementSearch libPEX5 pl_struct -00000000 T _PEXDeleteElements libPEX5 pl_struct -00000000 T _PEXDeleteToLabel libPEX5 pl_struct -00000000 T _PEXDeleteBetweenLabels libPEX5 pl_struct -00000000 T _PEXCopyElements libPEX5 pl_struct -00000000 T _PEXChangeStructureRefs libPEX5 pl_struct -00000000 T _PEXRotate libPEX5 pl_util -00000000 T _PEXRotate2D libPEX5 pl_util -00000000 T _PEXRotateGeneral libPEX5 pl_util -00000000 T _PEXScale libPEX5 pl_util -00000000 T _PEXScale2D libPEX5 pl_util -00000000 T _PEXTranslate libPEX5 pl_util -00000000 T _PEXTranslate2D libPEX5 pl_util -00000000 T _PEXMatrixMult libPEX5 pl_util -00000000 T _PEXMatrixMult2D libPEX5 pl_util -00000000 T _PEXBuildTransform libPEX5 pl_util -00000000 T _PEXBuildTransform2D libPEX5 pl_util -00000000 T _PEXViewOrientationMatrix libPEX5 pl_util -00000000 T _PEXViewOrientationMatrix2D libPEX5 pl_util -00000000 T _PEXViewMappingMatrix libPEX5 pl_util -00000000 T _PEXViewMappingMatrix2D libPEX5 pl_util -00000000 T _PEXLookAtViewMatrix libPEX5 pl_util -00000000 T _PEXPolarViewMatrix libPEX5 pl_util -00000000 T _PEXOrthoProjMatrix libPEX5 pl_util -00000000 T _PEXPerspProjMatrix libPEX5 pl_util -00000000 T _PEXTransformPoints libPEX5 pl_util -00000000 T _PEXTransformPoints2D libPEX5 pl_util -00000000 T _PEXTransformPoints4D libPEX5 pl_util -00000000 T _PEXTransformPoints2DH libPEX5 pl_util -00000000 T _PEXTransformVectors libPEX5 pl_util -00000000 T _PEXTransformVectors2D libPEX5 pl_util -00000000 T _PEXNormalizeVectors libPEX5 pl_util -00000000 T _PEXNormalizeVectors2D libPEX5 pl_util -00000000 T _PEXNPCToXCTransform libPEX5 pl_util -00000000 T _PEXNPCToXCTransform2D libPEX5 pl_util -00000000 T _PEXXCToNPCTransform libPEX5 pl_util -00000000 T _PEXXCToNPCTransform2D libPEX5 pl_util -00000000 T _PEXMapXCToNPC libPEX5 pl_util -00000000 T _PEXMapXCToNPC2D libPEX5 pl_util -00000000 T _PEXInvertMatrix libPEX5 pl_util -00000000 T _PEXInvertMatrix2D libPEX5 pl_util -00000000 T _PEXIdentityMatrix libPEX5 pl_util -00000000 T _PEXIdentityMatrix2D libPEX5 pl_util -00000000 T _PEXGeoNormFillArea libPEX5 pl_util -00000000 T _PEXGeoNormFillAreaSet libPEX5 pl_util -00000000 T _PEXGeoNormTriangleStrip libPEX5 pl_util -00000000 T _PEXGeoNormQuadrilateralMesh libPEX5 pl_util -00000000 T _PEXGeoNormSetOfFillAreaSets libPEX5 pl_util -00000000 T _PEXCreateWorkstation libPEX5 pl_wks -00000000 T _PEXFreeWorkstation libPEX5 pl_wks -00000000 T _PEXGetWorkstationAttributes libPEX5 pl_wks -00000000 T _PEXGetWorkstationDynamics libPEX5 pl_wks -00000000 T _PEXGetWorkstationViewRep libPEX5 pl_wks -00000000 T _PEXGetWorkstationPostings libPEX5 pl_wks -00000000 T _PEXSetWorkstationViewPriority libPEX5 pl_wks -00000000 T _PEXSetWorkstationDisplayUpdateMode libPEX5 pl_wks -00000000 T _PEXSetWorkstationBufferMode libPEX5 pl_wks -00000000 T _PEXSetWorkstationViewRep libPEX5 pl_wks -00000000 T _PEXSetWorkstationWindow libPEX5 pl_wks -00000000 T _PEXSetWorkstationViewport libPEX5 pl_wks -00000000 T _PEXSetWorkstationHLHSRMode libPEX5 pl_wks -00000000 T _PEXRedrawAllStructures libPEX5 pl_wks -00000000 T _PEXUpdateWorkstation libPEX5 pl_wks -00000000 T _PEXExecuteDeferredActions libPEX5 pl_wks -00000000 T _PEXMapDCToWC libPEX5 pl_wks -00000000 T _PEXMapWCToDC libPEX5 pl_wks -00000000 T _PEXPostStructure libPEX5 pl_wks -00000000 T _PEXUnpostStructure libPEX5 pl_wks -00000000 T _PEXUnpostAllStructures libPEX5 pl_wks -00000000 T _PEXRedrawClipRegion libPEX5 pl_wks -00000000 T __PEXIEEE32toDECF libPEX5 pl_convert -00000000 T __PEXDECFtoIEEE32 libPEX5 pl_convert -00000000 T __PEXOCFacet libPEX5 pl_oc_util -00000000 T __PEXOCListOfFacet libPEX5 pl_oc_util -00000000 T __PEXOCListOfVertex libPEX5 pl_oc_util -00000000 T __PEXOCListOfColor libPEX5 pl_oc_util -00000000 T __PEXStoreFacet libPEX5 pl_oc_util -00000000 T __PEXStoreListOfFacet libPEX5 pl_oc_util -00000000 T __PEXStoreListOfVertex libPEX5 pl_oc_util -00000000 T __PEXStoreListOfColor libPEX5 pl_oc_util -00000000 T __PEXExtractFacet libPEX5 pl_oc_util -00000000 T __PEXExtractListOfFacet libPEX5 pl_oc_util -00000000 T __PEXExtractListOfVertex libPEX5 pl_oc_util -00000000 T __PEXExtractListOfColor libPEX5 pl_oc_util Index: xc/lib/PEX5/jump_ignore diff -u xc/lib/PEX5/jump_ignore:3.2 xc/lib/PEX5/jump_ignore:removed --- xc/lib/PEX5/jump_ignore:3.2 Wed Jan 17 14:41:30 2001 +++ xc/lib/PEX5/jump_ignore Sat Feb 28 21:41:20 2004 @@ -1,6 +0,0 @@ -# $Xorg: jump_ignore,v 1.3 2000/08/17 19:44:21 cpqbld Exp $ -# -# -# -# $XFree86: xc/lib/PEX5/jump_ignore,v 3.2 2001/01/17 19:41:30 dawes Exp $ -# jump_ignore Index: xc/lib/PEX5/jump_vars diff -u xc/lib/PEX5/jump_vars:3.2 xc/lib/PEX5/jump_vars:removed --- xc/lib/PEX5/jump_vars:3.2 Wed Jan 17 14:41:30 2001 +++ xc/lib/PEX5/jump_vars Sat Feb 28 21:41:20 2004 @@ -1,13 +0,0 @@ -# $Xorg: jump_vars,v 1.3 2000/08/17 19:44:21 cpqbld Exp $ -# -# -# -# $XFree86: xc/lib/PEX5/jump_vars,v 3.2 2001/01/17 19:41:30 dawes Exp $ -# -00000004 D _PEXDisplayInfoHeader libPEX5 pl_startup -00000004 D _PEXPickCache libPEX5 pl_startup -00000004 D _PEXPickCacheSize libPEX5 pl_startup -00000004 D _PEXPickCacheInUse libPEX5 pl_startup -00000260 D _PEX_encode_oc_funcs libPEX5 pl_startup -00000260 D _PEX_decode_oc_funcs libPEX5 pl_startup -00000100 D _PEX_fp_convert libPEX5 pl_startup Index: xc/lib/PEX5/pl_convert.c diff -u xc/lib/PEX5/pl_convert.c:1.2 xc/lib/PEX5/pl_convert.c:removed --- xc/lib/PEX5/pl_convert.c:1.2 Fri Dec 14 14:53:45 2001 +++ xc/lib/PEX5/pl_convert.c Sat Feb 28 21:41:20 2004 @@ -1,238 +0,0 @@ -/* $Xorg: pl_convert.c,v 1.4 2001/02/09 02:03:27 xorgcvs Exp $ */ -/* - -Copyright 1992, 1998 The Open Group - -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. - -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 OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/****************************************************************************** -FOR VAX/IEEE conversions: - -Copyright 1988-1991 -Center for Information Technology Integration (CITI) -Information Technology Division -University of Michigan -Ann Arbor, Michigan - All Rights Reserved -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, 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 names of -CITI or THE UNIVERSITY OF MICHIGAN not be used in advertising or -publicity pertaining to distribution of the software without -specific, written prior permission. - -THE SOFTWARE IS PROVIDED "AS IS." CITI AND THE UNIVERSITY OF -MICHIGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN -NO EVENT SHALL CITI OR THE UNIVERSITY OF MICHIGAN 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. - -******************************************************************************/ - -#include "PEXlib.h" -#include "PEXlibint.h" - - -void _PEXIEEE32toDECF (srcVal, dstVal) - -INPUT char *srcVal; -OUTPUT char *dstVal; - -{ - register CARD32 IEEEnum = *(CARD32 *) srcVal; - CARD32 *IEEEnumP = (CARD32 *) dstVal; - CARD32 result; - - if ((IEEE_SIGN_MASK & IEEEnum) == MAX_IEEE_POSITIVE) - { - *IEEEnumP = MAX_VAX_POSITIVE | (0x80000000&IEEEnum)>>16; - return; - }; - - if ((IEEE_SIGN_MASK & IEEEnum) == MIN_IEEE_POSITIVE) - { - *IEEEnumP = MIN_VAX_POSITIVE; - return; - }; - - /* - * these bitfields should OR into mutually exclusive fields in - * result field. - */ - - result = ((((BITMASK(8)<<23) & IEEEnum)>>23)+IEEE_TO_VAX_BIAS)<<7; - result |= ((BITMASK(7)<<16)&IEEEnum)>>16; - result |= (BITMASK(16)&IEEEnum)<<16; - result |= (0x80000000&IEEEnum)>>16; - *IEEEnumP = result; -} - - - -void _PEXDECFtoIEEE32 (srcVal, dstVal) - -INPUT char *srcVal; -OUTPUT char *dstVal; - -{ - register CARD32 Vaxnum = *(CARD32 *) srcVal; - CARD32 *VaxnumP = (CARD32 *) dstVal; - CARD32 result; - - if ((VAX_SIGN_MASK & Vaxnum) == MAX_VAX_POSITIVE) - { - *VaxnumP = MAX_IEEE_POSITIVE | - (((0x00008000)&Vaxnum) ? 0x80000000 : 0L); - return; - } - - if ((VAX_SIGN_MASK & Vaxnum) == MIN_VAX_POSITIVE) - { - *VaxnumP = MIN_IEEE_POSITIVE; - return; - } - - /* - * these bitfields should OR into mutually exclusive fields in - * result field. - */ - - result = ((((BITMASK(8)<<7) & Vaxnum)>>7)+VAX_TO_IEEE_BIAS)<<23; - result |= (((BITMASK(7) & Vaxnum)<<16) | - (((BITMASK(16)<<16) & Vaxnum)>>16)); - result |= ( (0x00008000 & Vaxnum) ? 0x80000000 : 0L); - *VaxnumP = result; -} - - - -#ifdef CRAY - -void _PEXIEEE32toCRAY (srcVal, dstVal) - -INPUT char *srcVal; -OUTPUT char *dstVal; - -{ - unsigned char *PC = (unsigned char *) srcVal; - float *result = (float *) dstVal; - - union { - struct ieee_single is; - long l; - } c; - - union { - struct cray_single vc; - float iis; - } ieee; - - - c.l = PC[0] << 24 | PC[1] << 16 | PC[2] << 8 | PC[3]; - if (PC[0] & 0x80) - c.l |= ~0xffffffff; - - if (c.is.exp == 0) - { - ieee.iis = 0.0; - } - else if (c.is.exp == 0xff) - { - /* - * If the IEEE float we are decoding indicates - * an IEEE overflow condition, we manufacture - * a Cray overflow condition. - */ - - SET_MAX_SNG_CRAY (ieee.vc); - } - else - { - ieee.vc.sign = c.is.sign; - ieee.vc.exp = c.is.exp - IEEE_SNG_BIAS + CRAY_BIAS; - ieee.vc.mantissa = c.is.mantissa | (1 << 23); - ieee.vc.mantissa2 = 0; - } - - *result = ieee.iis; -} - - - -void _PEXCRAYtoIEEE32 (srcVal, dstVal) - -INPUT char *srcVal; -OUTPUT char *dstVal; - -{ - unsigned char *PC = (unsigned char *) dstVal; - struct cray_single vc; - float *fptr; - - struct ieee_single ais; - union { - struct ieee_single is; - unsigned iis; - } ieee; - - fptr = (float *) &vc; - *fptr = *((float *) srcVal); - - if (vc.exp >= MAX_CRAY_SNG) - { - SET_MAX_SNG_IEEE (ieee.is); - } - else if (vc.exp < MIN_CRAY_SNG || - (vc.mantissa == 0 && vc.mantissa2 == 0)) - { - /* - * On the Cray, there is no hidden mantissa bit. - * So, if the mantissa is zero, the number is zero. - */ - - SET_MIN_SNG_IEEE (ieee.is); - } - else - { - ieee.is.exp = vc.exp - CRAY_BIAS + IEEE_SNG_BIAS; - ieee.is.mantissa = vc.mantissa; - /* Hidden bit removed by truncation */ - } - - ieee.is.sign = vc.sign; - - PC[0] = ieee.iis >> 24; - PC[1] = ieee.iis >> 16; - PC[2] = ieee.iis >> 8; - PC[3] = ieee.iis; -} - -#endif /* CRAY */ Index: xc/lib/PEX5/pl_convert.h diff -u xc/lib/PEX5/pl_convert.h:1.2 xc/lib/PEX5/pl_convert.h:removed --- xc/lib/PEX5/pl_convert.h:1.2 Fri Dec 14 14:53:47 2001 +++ xc/lib/PEX5/pl_convert.h Sat Feb 28 21:41:20 2004 @@ -1,349 +0,0 @@ -/* $Xorg: pl_convert.h,v 1.4 2001/02/09 02:03:27 xorgcvs Exp $ */ -/* - -Copyright 1992, 1998 The Open Group - -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. - -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 OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/* ------------------------------------------------------------------------- - * Structures for fiddling with 16 and 32 bit data on 64 bit machines - * ------------------------------------------------------------------------- */ - -#ifdef WORD64 - -typedef struct { - int value :32; -} Long; - -typedef struct { - int value :16; - int pad :16; -} Short; - -typedef struct { - int value :8; - int pad :24; -} Char; - -typedef struct { - unsigned int value :32; -} ULong; - -typedef struct { - unsigned int value :16; -} UShort; - -typedef struct { - unsigned char value; -} UChar; - -#endif /* WORD64 */ - - - -/* ------------------------------------------------------------------------- - * Floating point conversion macros - * ------------------------------------------------------------------------- */ - -/* - * Host->Network - * _srcVal = host floating point value - * _dstBuf = buffer to store network float - */ - -#define FP_CONVERT_HTON_BUFF(_srcVal, _dstBuf, _fpFormat) \ -{ \ - PEX_fp_convert[NATIVE_FP_FORMAT-1][_fpFormat-1](&(_srcVal), _dstBuf); \ -} - - -/* - * Host->Network - * _srcVal = host floating point value - * _dstVal = store network float in this value (on 64 bit machines, - * _dstVal is most probably a bitfield, so we can't take &_dstVal. - */ - -#ifndef WORD64 - -#define FP_CONVERT_HTON(_srcVal, _dstVal, _fpFormat) \ -{ \ - FP_CONVERT_HTON_BUFF (_srcVal, &(_dstVal), _fpFormat); \ -} - -#define FP_CONVERT_DHTON(_srcVal, _dstVal, _fpFormat) \ -{ \ - float single = _srcVal; \ - FP_CONVERT_HTON_BUFF (single, &(_dstVal), _fpFormat); \ -} - -#else /* WORD64 */ - -#define FP_CONVERT_HTON(_srcVal, _dstVal, _fpFormat) \ -{ \ - Long temp; \ - FP_CONVERT_HTON_BUFF (_srcVal, &temp, _fpFormat); \ - _dstVal = temp.value; \ -} - -#define FP_CONVERT_DHTON(_srcVal, _dstVal, _fpFormat) \ -{ \ - float single = _srcVal; \ - Long temp; \ - FP_CONVERT_HTON_BUFF (single, &temp, _fpFormat); \ - _dstVal = temp.value; \ -} - -#endif /* WORD64 */ - - -/* - * Network->Host - * _srcBuf = buffer containing network floating point value - * _dstVal = store host float in this value - */ - -#define FP_CONVERT_NTOH_BUFF(_srcBuf, _dstVal, _fpFormat) \ -{ \ - PEX_fp_convert[_fpFormat-1][NATIVE_FP_FORMAT-1](_srcBuf, &_dstVal); \ -} - - -/* - * Network->Host - * _srcVal = network floating point value - * _dstVal = store host float in this value - */ - -#ifndef WORD64 - -#define FP_CONVERT_NTOH(_srcVal, _dstVal, _fpFormat) \ -{ \ - FP_CONVERT_NTOH_BUFF (&(_srcVal), _dstVal, _fpFormat); \ -} - -#else /* WORD64 */ - -#define FP_CONVERT_NTOH(_srcVal, _dstVal, _fpFormat) \ -{ \ - Long temp; \ - temp.value = _srcVal; \ - FP_CONVERT_NTOH_BUFF (&temp, _dstVal, _fpFormat); \ -} - -#endif /* WORD64 */ - - - -/* ------------------------------------------------------------------------- - * Macros for 64 bit conversion - * ------------------------------------------------------------------------- */ - -#ifdef WORD64 - -#define CARD64_TO_32(_val, _pBuf) \ -{ \ - Long _d; \ - _d.value = _val; \ - memcpy (_pBuf, &_d, SIZEOF (CARD32)); \ -} - -#define CARD64_TO_16(_val, _pBuf) \ -{ \ - Short _d; \ - _d.value = _val; \ - memcpy (_pBuf, &_d, SIZEOF (CARD16)); \ -} - -#define INT64_TO_32(_val, _pBuf) \ -{ \ - Long _d; \ - _d.value = _val; \ - memcpy (_pBuf, &_d, SIZEOF (INT32)); \ -} - -#define INT64_TO_16(_val, _pBuf) \ -{ \ - Short _d; \ - _d.value = _val; \ - memcpy (_pBuf, &_d, SIZEOF (INT16)); \ -} - - -#define CARD32_TO_64(_pBuf, _val) \ -{ \ - _val = *(_pBuf + 0) & 0xff; /* 0xff incase _pBuf is signed */ \ - _val <<= 8; \ - _val |= *(_pBuf + 1) & 0xff;\ - _val <<= 8; \ - _val |= *(_pBuf + 2) & 0xff;\ - _val <<= 8; \ - _val |= *(_pBuf + 3) & 0xff;\ -} - -#define CARD16_TO_64(_pBuf, _val) \ -{ \ - _val = *(_pBuf + 0) & 0xff; /* 0xff incase _pBuf is signed */ \ - _val <<= 8; \ - _val |= *(_pBuf + 1) & 0xff;\ -} - -#define INT32_TO_64(_pBuf, _val) \ -{ \ - _val = *(_pBuf + 0) & 0xff; /* 0xff incase _pBuf is signed */ \ - _val <<= 8; \ - _val |= *(_pBuf + 1) & 0xff;\ - _val <<= 8; \ - _val |= *(_pBuf + 2) & 0xff;\ - _val <<= 8; \ - _val |= *(_pBuf + 3) & 0xff;\ -} - -#define INT16_TO_64(_pBuf, _val) \ -{ \ - _val = *(_pBuf + 0) & 0xff; /* 0xff incase _pBuf is signed */ \ - _val <<= 8; \ - _val |= *(_pBuf + 1) & 0xff;\ -} - -#endif /* WORD64 */ - - - -/* ------------------------------------------------------------------------- - * DEC/IEEE float conversions - * ------------------------------------------------------------------------- */ - -/* - * Copyright 1988-1991 - * Center for Information Technology Integration (CITI) - * Information Technology Division - * University of Michigan - * Ann Arbor, Michigan - * - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and - * its documentation for any purpose and without fee is hereby - * granted, 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 names of - * CITI or THE UNIVERSITY OF MICHIGAN not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS." CITI AND THE UNIVERSITY OF - * MICHIGAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN - * NO EVENT SHALL CITI OR THE UNIVERSITY OF MICHIGAN 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. - */ - -#define BITMASK(n) ((((unsigned long)1)<