diff options
Diffstat (limited to 'miext/shadow')
| -rw-r--r-- | miext/shadow/Makefile.am | 32 | ||||
| -rw-r--r-- | miext/shadow/Makefile.in | 797 | ||||
| -rw-r--r-- | miext/shadow/shadow.c | 252 | ||||
| -rw-r--r-- | miext/shadow/shadow.h | 181 | ||||
| -rw-r--r-- | miext/shadow/shalloc.c | 50 | ||||
| -rw-r--r-- | miext/shadow/shpacked.c | 118 | ||||
| -rw-r--r-- | miext/shadow/shplanar.c | 180 | ||||
| -rw-r--r-- | miext/shadow/shplanar8.c | 175 | ||||
| -rw-r--r-- | miext/shadow/shrot16pack.c | 30 | ||||
| -rw-r--r-- | miext/shadow/shrot16pack_180.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot16pack_270.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot16pack_270YX.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot16pack_90.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot16pack_90YX.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot32pack.c | 30 | ||||
| -rw-r--r-- | miext/shadow/shrot32pack_180.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot32pack_270.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot32pack_90.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot8pack.c | 30 | ||||
| -rw-r--r-- | miext/shadow/shrot8pack_180.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot8pack_270.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrot8pack_90.c | 31 | ||||
| -rw-r--r-- | miext/shadow/shrotate.c | 313 | ||||
| -rw-r--r-- | miext/shadow/shrotpack.h | 187 | ||||
| -rw-r--r-- | miext/shadow/shrotpackYX.h | 160 | 
25 files changed, 2876 insertions, 0 deletions
| diff --git a/miext/shadow/Makefile.am b/miext/shadow/Makefile.am new file mode 100644 index 0000000..30f7bda --- /dev/null +++ b/miext/shadow/Makefile.am @@ -0,0 +1,32 @@ +noinst_LTLIBRARIES = libshadow.la + +AM_CFLAGS = $(DIX_CFLAGS) + +if XORG +sdk_HEADERS = shadow.h +endif + +libshadow_la_SOURCES =		\ +	shadow.c		\ +	shadow.h		\ +	shalloc.c		\ +	shpacked.c		\ +	shplanar8.c		\ +	shplanar.c		\ +	shrot16pack_180.c	\ +	shrot16pack_270.c	\ +	shrot16pack_270YX.c	\ +	shrot16pack_90.c	\ +	shrot16pack_90YX.c	\ +	shrot16pack.c		\ +	shrot32pack_180.c	\ +	shrot32pack_270.c	\ +	shrot32pack_90.c	\ +	shrot32pack.c		\ +	shrot8pack_180.c	\ +	shrot8pack_270.c	\ +	shrot8pack_90.c		\ +	shrot8pack.c		\ +	shrotate.c		\ +	shrotpack.h		\ +	shrotpackYX.h diff --git a/miext/shadow/Makefile.in b/miext/shadow/Makefile.in new file mode 100644 index 0000000..1b5caac --- /dev/null +++ b/miext/shadow/Makefile.in @@ -0,0 +1,797 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = miext/shadow +DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ +	$(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ +	$(top_srcdir)/m4/ax_tls.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ +	$(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ +	$(top_builddir)/include/xorg-server.h \ +	$(top_builddir)/include/dix-config.h \ +	$(top_builddir)/include/xorg-config.h \ +	$(top_builddir)/include/xkb-config.h \ +	$(top_builddir)/include/xwin-config.h \ +	$(top_builddir)/include/kdrive-config.h \ +	$(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libshadow_la_LIBADD = +am_libshadow_la_OBJECTS = shadow.lo shalloc.lo shpacked.lo \ +	shplanar8.lo shplanar.lo shrot16pack_180.lo shrot16pack_270.lo \ +	shrot16pack_270YX.lo shrot16pack_90.lo shrot16pack_90YX.lo \ +	shrot16pack.lo shrot32pack_180.lo shrot32pack_270.lo \ +	shrot32pack_90.lo shrot32pack.lo shrot8pack_180.lo \ +	shrot8pack_270.lo shrot8pack_90.lo shrot8pack.lo shrotate.lo +libshadow_la_OBJECTS = $(am_libshadow_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ +	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ +	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ +	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ +	$(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo "  CC    " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ +	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +	$(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo "  CCLD  " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo "  GEN   " $@; +SOURCES = $(libshadow_la_SOURCES) +DIST_SOURCES = $(libshadow_la_SOURCES) +am__sdk_HEADERS_DIST = shadow.h +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ +    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ +    *) f=$$p;; \ +  esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ +  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ +  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ +  for p in $$list; do echo "$$p $$p"; done | \ +  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ +  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ +    if (++n[$$2] == $(am__install_max)) \ +      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ +    END { for (dir in files) print dir, files[dir] }' +am__base_list = \ +  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ +  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(sdkdir)" +HEADERS = $(sdk_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +ARM_BACKTRACE_CFLAGS = @ARM_BACKTRACE_CFLAGS@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_FONT_PATH = @BASE_FONT_PATH@ +BUILD_DATE = @BUILD_DATE@ +BUILD_TIME = @BUILD_TIME@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DARWIN_LIBS = @DARWIN_LIBS@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ +DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DGA_CFLAGS = @DGA_CFLAGS@ +DGA_LIBS = @DGA_LIBS@ +DIX_CFLAGS = @DIX_CFLAGS@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ +DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ +DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ +DMXMODULES_LIBS = @DMXMODULES_LIBS@ +DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ +DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ +DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ +DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOXYGEN = @DOXYGEN@ +DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ +DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ +DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ +DRIPROTO_LIBS = @DRIPROTO_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_TLS = @GLX_TLS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ +KDRIVE_INCS = @KDRIVE_INCS@ +KDRIVE_LIBS = @KDRIVE_LIBS@ +KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ +KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ +KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ +LAUNCHD_ID_PREFIX = @LAUNCHD_ID_PREFIX@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ +LIBDRM_LIBS = @LIBDRM_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ +PERL = @PERL@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SYSCONFDIR = @SYSCONFDIR@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ +X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ +XDMCP_CFLAGS = @XDMCP_CFLAGS@ +XDMCP_LIBS = @XDMCP_LIBS@ +XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ +XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ +XDMX_CFLAGS = @XDMX_CFLAGS@ +XDMX_LIBS = @XDMX_LIBS@ +XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ +XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ +XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ +XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ +XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ +XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ +XLIB_CFLAGS = @XLIB_CFLAGS@ +XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS = @XORG_OS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ +XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ +XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ +XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ +XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ +XSERVER_LIBS = @XSERVER_LIBS@ +XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ +XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ +XVFB_LIBS = @XVFB_LIBS@ +XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ +XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ +XWINMODULES_LIBS = @XWINMODULES_LIBS@ +XWIN_LIBS = @XWIN_LIBS@ +XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +abi_videodrv = @abi_videodrv@ +abi_xinput = @abi_xinput@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +driverdir = @driverdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extdir = @extdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +logdir = @logdir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sdkdir = @sdkdir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libshadow.la +AM_CFLAGS = $(DIX_CFLAGS) +@XORG_TRUE@sdk_HEADERS = shadow.h +libshadow_la_SOURCES = \ +	shadow.c		\ +	shadow.h		\ +	shalloc.c		\ +	shpacked.c		\ +	shplanar8.c		\ +	shplanar.c		\ +	shrot16pack_180.c	\ +	shrot16pack_270.c	\ +	shrot16pack_270YX.c	\ +	shrot16pack_90.c	\ +	shrot16pack_90YX.c	\ +	shrot16pack.c		\ +	shrot32pack_180.c	\ +	shrot32pack_270.c	\ +	shrot32pack_90.c	\ +	shrot32pack.c		\ +	shrot8pack_180.c	\ +	shrot8pack_270.c	\ +	shrot8pack_90.c		\ +	shrot8pack.c		\ +	shrotate.c		\ +	shrotpack.h		\ +	shrotpackYX.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps) +	@for dep in $?; do \ +	  case '$(am__configure_deps)' in \ +	    *$$dep*) \ +	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ +	        && { if test -f $@; then exit 0; else break; fi; }; \ +	      exit 1;; \ +	  esac; \ +	done; \ +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign miext/shadow/Makefile'; \ +	$(am__cd) $(top_srcdir) && \ +	  $(AUTOMAKE) --foreign miext/shadow/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +	@case '$?' in \ +	  *config.status*) \ +	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ +	  *) \ +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ +	esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: +	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) +	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ +	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ +	  test "$$dir" != "$$p" || dir=.; \ +	  echo "rm -f \"$${dir}/so_locations\""; \ +	  rm -f "$${dir}/so_locations"; \ +	done +libshadow.la: $(libshadow_la_OBJECTS) $(libshadow_la_DEPENDENCIES)  +	$(AM_V_CCLD)$(LINK)  $(libshadow_la_OBJECTS) $(libshadow_la_LIBADD) $(LIBS) + +mostlyclean-compile: +	-rm -f *.$(OBJEXT) + +distclean-compile: +	-rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shalloc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shpacked.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shplanar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shplanar8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_180.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_270.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_270YX.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_90.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot16pack_90YX.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot32pack.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot32pack_180.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot32pack_270.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot32pack_90.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot8pack.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot8pack_180.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot8pack_270.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrot8pack_90.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrotate.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@	$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: +	-rm -f *.lo + +clean-libtool: +	-rm -rf .libs _libs +install-sdkHEADERS: $(sdk_HEADERS) +	@$(NORMAL_INSTALL) +	test -z "$(sdkdir)" || $(MKDIR_P) "$(DESTDIR)$(sdkdir)" +	@list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ +	for p in $$list; do \ +	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ +	  echo "$$d$$p"; \ +	done | $(am__base_list) | \ +	while read files; do \ +	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(sdkdir)'"; \ +	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(sdkdir)" || exit $$?; \ +	done + +uninstall-sdkHEADERS: +	@$(NORMAL_UNINSTALL) +	@list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ +	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ +	test -n "$$files" || exit 0; \ +	echo " ( cd '$(DESTDIR)$(sdkdir)' && rm -f" $$files ")"; \ +	cd "$(DESTDIR)$(sdkdir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ +	unique=`for i in $$list; do \ +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ +	  done | \ +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ +	      END { if (nonempty) { for (i in files) print i; }; }'`; \ +	mkid -fID $$unique +tags: TAGS + +TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \ +		$(TAGS_FILES) $(LISP) +	set x; \ +	here=`pwd`; \ +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \ +	unique=`for i in $$list; do \ +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ +	  done | \ +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ +	      END { if (nonempty) { for (i in files) print i; }; }'`; \ +	shift; \ +	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ +	  test -n "$$unique" || unique=$$empty_fix; \ +	  if test $$# -gt 0; then \ +	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ +	      "$$@" $$unique; \ +	  else \ +	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ +	      $$unique; \ +	  fi; \ +	fi +ctags: CTAGS +CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \ +		$(TAGS_FILES) $(LISP) +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \ +	unique=`for i in $$list; do \ +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ +	  done | \ +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ +	      END { if (nonempty) { for (i in files) print i; }; }'`; \ +	test -z "$(CTAGS_ARGS)$$unique" \ +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ +	     $$unique + +GTAGS: +	here=`$(am__cd) $(top_builddir) && pwd` \ +	  && $(am__cd) $(top_srcdir) \ +	  && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) +	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ +	list='$(DISTFILES)'; \ +	  dist_files=`for file in $$list; do echo $$file; done | \ +	  sed -e "s|^$$srcdirstrip/||;t" \ +	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ +	case $$dist_files in \ +	  */*) $(MKDIR_P) `echo "$$dist_files" | \ +			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ +			   sort -u` ;; \ +	esac; \ +	for file in $$dist_files; do \ +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ +	  if test -d $$d/$$file; then \ +	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ +	    if test -d "$(distdir)/$$file"; then \ +	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ +	    fi; \ +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ +	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ +	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ +	    fi; \ +	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ +	  else \ +	    test -f "$(distdir)/$$file" \ +	    || cp -p $$d/$$file "$(distdir)/$$file" \ +	    || exit 1; \ +	  fi; \ +	done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: +	for dir in "$(DESTDIR)$(sdkdir)"; do \ +	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \ +	done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ +	  `test -z '$(STRIP)' || \ +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: +	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) +	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: +	@echo "This command is intended for maintainers to use" +	@echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ +	mostlyclean-am + +distclean: distclean-am +	-rm -rf ./$(DEPDIR) +	-rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ +	distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-sdkHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am +	-rm -rf ./$(DEPDIR) +	-rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ +	mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-sdkHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ +	clean-libtool clean-noinstLTLIBRARIES ctags distclean \ +	distclean-compile distclean-generic distclean-libtool \ +	distclean-tags distdir dvi dvi-am html html-am info info-am \ +	install install-am install-data install-data-am install-dvi \ +	install-dvi-am install-exec install-exec-am install-html \ +	install-html-am install-info install-info-am install-man \ +	install-pdf install-pdf-am install-ps install-ps-am \ +	install-sdkHEADERS install-strip installcheck installcheck-am \ +	installdirs maintainer-clean maintainer-clean-generic \ +	mostlyclean mostlyclean-compile mostlyclean-generic \ +	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ +	uninstall-am uninstall-sdkHEADERS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c new file mode 100644 index 0000000..cb1b299 --- /dev/null +++ b/miext/shadow/shadow.c @@ -0,0 +1,252 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include <stdlib.h> + +#include    <X11/X.h> +#include    "scrnintstr.h" +#include    "windowstr.h" +#include    "dixfontstr.h" +#include    "mi.h" +#include    "regionstr.h" +#include    "globals.h" +#include    "gcstruct.h" +#include    "shadow.h" + +static DevPrivateKeyRec shadowScrPrivateKeyRec; +#define shadowScrPrivateKey (&shadowScrPrivateKeyRec) + +#define wrap(priv, real, mem) {\ +    priv->mem = real->mem; \ +    real->mem = shadow##mem; \ +} + +#define unwrap(priv, real, mem) {\ +    real->mem = priv->mem; \ +} + +static void +shadowRedisplay(ScreenPtr pScreen) +{ +    shadowBuf(pScreen); +    RegionPtr pRegion; + +    if (!pBuf || !pBuf->pDamage || !pBuf->update) +	return; +    pRegion = DamageRegion(pBuf->pDamage); +    if (RegionNotEmpty(pRegion)) { +	(*pBuf->update)(pScreen, pBuf); +	DamageEmpty(pBuf->pDamage); +    } +} + +static void +shadowBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead) +{ +    ScreenPtr pScreen = (ScreenPtr) data; + +    shadowRedisplay(pScreen); +} + +static void +shadowWakeupHandler(pointer data, int i, pointer LastSelectMask) +{ +} + +static void +shadowGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, +	       unsigned int format, unsigned long planeMask, char *pdstLine) +{ +    ScreenPtr pScreen = pDrawable->pScreen; +    shadowBuf(pScreen); + +    /* Many apps use GetImage to sync with the visable frame buffer */ +    if (pDrawable->type == DRAWABLE_WINDOW) +	shadowRedisplay(pScreen); +    unwrap(pBuf, pScreen, GetImage); +    pScreen->GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); +    wrap(pBuf, pScreen, GetImage); +} + +#define BACKWARDS_COMPATIBILITY + +static Bool +shadowCloseScreen(int i, ScreenPtr pScreen) +{ +    shadowBuf(pScreen); + +    unwrap(pBuf, pScreen, GetImage); +    unwrap(pBuf, pScreen, CloseScreen); +    shadowRemove(pScreen, pBuf->pPixmap); +    DamageDestroy(pBuf->pDamage); +#ifdef BACKWARDS_COMPATIBILITY +    RegionUninit(&pBuf->damage); /* bc */ +#endif +    if (pBuf->pPixmap) +	pScreen->DestroyPixmap(pBuf->pPixmap); +    free(pBuf); +    return pScreen->CloseScreen(i, pScreen); +} + +#ifdef BACKWARDS_COMPATIBILITY +static void +shadowReportFunc(DamagePtr pDamage, RegionPtr pRegion, void *closure) +{ +    ScreenPtr pScreen = closure; +    shadowBufPtr pBuf = (shadowBufPtr) +	dixLookupPrivate(&pScreen->devPrivates, shadowScrPrivateKey); + +    /* Register the damaged region, use DamageReportNone below when we +     * want to break BC below... */ +    RegionUnion(&pDamage->damage, &pDamage->damage, pRegion); + +    /* +     * BC hack.  In 7.0 and earlier several drivers would inspect the +     * 'damage' member directly, so we have to keep it existing. +     */ +    RegionCopy(&pBuf->damage, pRegion); +} +#endif + +Bool +shadowSetup(ScreenPtr pScreen) +{ +    shadowBufPtr pBuf; + +    if (!dixRegisterPrivateKey(&shadowScrPrivateKeyRec, PRIVATE_SCREEN, 0)) +	return FALSE; + +    if (!DamageSetup(pScreen)) +	return FALSE; + +    pBuf = malloc(sizeof(shadowBufRec)); +    if (!pBuf) +	return FALSE; +#ifdef BACKWARDS_COMPATIBILITY +    pBuf->pDamage = DamageCreate((DamageReportFunc)shadowReportFunc,  +		    		 (DamageDestroyFunc)NULL, +				 DamageReportRawRegion, +				 TRUE, pScreen, pScreen); +#else +    pBuf->pDamage = DamageCreate((DamageReportFunc)NULL,  +		    		 (DamageDestroyFunc)NULL, +				 DamageReportNone, +				 TRUE, pScreen, pScreen); +#endif +    if (!pBuf->pDamage) { +	free(pBuf); +	return FALSE; +    } + +    wrap(pBuf, pScreen, CloseScreen); +    wrap(pBuf, pScreen, GetImage); +    pBuf->update = 0; +    pBuf->window = 0; +    pBuf->pPixmap = 0; +    pBuf->closure = 0; +    pBuf->randr = 0; +#ifdef BACKWARDS_COMPATIBILITY +    RegionNull(&pBuf->damage); /* bc */ +#endif + +    dixSetPrivate(&pScreen->devPrivates, shadowScrPrivateKey, pBuf); +    return TRUE; +} + +Bool +shadowAdd(ScreenPtr pScreen, PixmapPtr pPixmap, ShadowUpdateProc update, +	  ShadowWindowProc window, int randr, void *closure) +{ +    shadowBuf(pScreen); + +    if (!RegisterBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, +					(pointer)pScreen)) +	return FALSE; + +    /* +     * Map simple rotation values to bitmasks; fortunately, +     * these are all unique +     */ +    switch (randr) { +    case 0: +	randr = SHADOW_ROTATE_0; +	break; +    case 90: +	randr = SHADOW_ROTATE_90; +	break; +    case 180: +	randr = SHADOW_ROTATE_180; +	break; +    case 270: +	randr = SHADOW_ROTATE_270; +	break; +    } +    pBuf->update = update; +    pBuf->window = window; +    pBuf->randr = randr; +    pBuf->closure = closure; +    pBuf->pPixmap = pPixmap; +    DamageRegister(&pPixmap->drawable, pBuf->pDamage); +    return TRUE; +} + +void +shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap) +{ +    shadowBuf(pScreen); + +    if (pBuf->pPixmap) { +	DamageUnregister(&pBuf->pPixmap->drawable, pBuf->pDamage); +	pBuf->update = 0; +	pBuf->window = 0; +	pBuf->randr = 0; +	pBuf->closure = 0; +	pBuf->pPixmap = 0; +    } + +    RemoveBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, +				 (pointer) pScreen); +} + +Bool +shadowInit(ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window) +{ +    PixmapPtr pPixmap; +     +    pPixmap = pScreen->CreatePixmap(pScreen, pScreen->width, pScreen->height, +				    pScreen->rootDepth, 0); +    if (!pPixmap) +	return FALSE; +     +    if (!shadowSetup(pScreen)) { +	pScreen->DestroyPixmap(pPixmap); +	return FALSE; +    } + +    shadowAdd(pScreen, pPixmap, update, window, SHADOW_ROTATE_0, 0); + +    return TRUE; +} diff --git a/miext/shadow/shadow.h b/miext/shadow/shadow.h new file mode 100644 index 0000000..f447305 --- /dev/null +++ b/miext/shadow/shadow.h @@ -0,0 +1,181 @@ +/* + * + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 _SHADOW_H_ +#define _SHADOW_H_ + +#include "scrnintstr.h" + +#include "picturestr.h" + +#include "damage.h" +#include "damagestr.h" +typedef struct _shadowBuf   *shadowBufPtr; + +typedef void (*ShadowUpdateProc) (ScreenPtr pScreen, +				  shadowBufPtr pBuf); + +#define SHADOW_WINDOW_RELOCATE 1 +#define SHADOW_WINDOW_READ 2 +#define SHADOW_WINDOW_WRITE 4 + +typedef void *(*ShadowWindowProc) (ScreenPtr	pScreen, +				   CARD32	row, +				   CARD32	offset, +				   int		mode, +				   CARD32	*size, +				   void		*closure); + +/* BC hack: do not move the damage member.  see shadow.c for explanation. */ +typedef struct _shadowBuf { +    DamagePtr           pDamage; +    ShadowUpdateProc	update; +    ShadowWindowProc	window; +    RegionRec		damage; +    PixmapPtr		pPixmap; +    void		*closure; +    int			randr; + +    /* screen wrappers */ +    GetImageProcPtr     GetImage; +    CloseScreenProcPtr  CloseScreen; +} shadowBufRec; + +/* Match defines from randr extension */ +#define SHADOW_ROTATE_0	    1 +#define SHADOW_ROTATE_90    2 +#define SHADOW_ROTATE_180   4 +#define SHADOW_ROTATE_270   8 +#define SHADOW_ROTATE_ALL   (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\ +			     SHADOW_ROTATE_180|SHADOW_ROTATE_270) +#define SHADOW_REFLECT_X    16 +#define SHADOW_REFLECT_Y    32 +#define SHADOW_REFLECT_ALL  (SHADOW_REFLECT_X|SHADOW_REFLECT_Y) + +extern _X_EXPORT DevPrivateKey shadowScrPrivateKey; + +#define shadowGetBuf(pScr) ((shadowBufPtr) \ +    dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey)) +#define shadowBuf(pScr)            shadowBufPtr pBuf = shadowGetBuf(pScr) +#define shadowDamage(pBuf)  DamageRegion(pBuf->pDamage)     + +extern _X_EXPORT Bool +shadowSetup (ScreenPtr pScreen); + +extern _X_EXPORT Bool +shadowAdd (ScreenPtr	    pScreen, +	   PixmapPtr	    pPixmap, +	   ShadowUpdateProc update, +	   ShadowWindowProc window, +	   int		    randr, +	   void		    *closure); + +extern _X_EXPORT void +shadowRemove (ScreenPtr pScreen, PixmapPtr pPixmap); + +extern _X_EXPORT Bool +shadowInit (ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window); + +extern _X_EXPORT void * +shadowAlloc (int width, int height, int bpp); + +extern _X_EXPORT void +shadowUpdatePacked (ScreenPtr	    pScreen, +		    shadowBufPtr    pBuf); + +extern _X_EXPORT void +shadowUpdatePlanar4 (ScreenPtr	    pScreen, +		     shadowBufPtr   pBuf); + +extern _X_EXPORT void +shadowUpdatePlanar4x8 (ScreenPtr    pScreen, +		       shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotatePacked (ScreenPtr    pScreen, +			  shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate8_90 (ScreenPtr    pScreen, +			shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate16_90 (ScreenPtr    pScreen, +			 shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate16_90YX (ScreenPtr    pScreen, +			   shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate32_90 (ScreenPtr    pScreen, +			 shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate8_180 (ScreenPtr    pScreen, +			 shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate16_180 (ScreenPtr    pScreen, +			  shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate32_180 (ScreenPtr    pScreen, +			  shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate8_270 (ScreenPtr    pScreen, +			 shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate16_270 (ScreenPtr    pScreen, +			  shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate16_270YX (ScreenPtr    pScreen, +			    shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate32_270 (ScreenPtr    pScreen, +			  shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate8 (ScreenPtr    pScreen, +		     shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate16 (ScreenPtr    pScreen, +		      shadowBufPtr pBuf); + +extern _X_EXPORT void +shadowUpdateRotate32 (ScreenPtr    pScreen, +		      shadowBufPtr pBuf); + +typedef void (* shadowUpdateProc)(ScreenPtr, shadowBufPtr); + +extern _X_EXPORT shadowUpdateProc shadowUpdatePackedWeak(void); +extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4Weak(void); +extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4x8Weak(void); +extern _X_EXPORT shadowUpdateProc shadowUpdateRotatePackedWeak(void); + +#endif /* _SHADOW_H_ */ diff --git a/miext/shadow/shalloc.c b/miext/shadow/shalloc.c new file mode 100644 index 0000000..f57cb52 --- /dev/null +++ b/miext/shadow/shalloc.c @@ -0,0 +1,50 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include    <X11/X.h> +#include    "scrnintstr.h" +#include    "windowstr.h" +#include    <X11/fonts/font.h> +#include    "dixfontstr.h" +#include    <X11/fonts/fontstruct.h> +#include    "mi.h" +#include    "regionstr.h" +#include    "globals.h" +#include    "gcstruct.h" +#include    "shadow.h" + +void * +shadowAlloc (int width, int height, int bpp) +{ +    int	    stride; +    void    *fb; + +    /* Cant use PixmapBytePad -- the structure is probably not initialized yet */ +    stride = BitmapBytePad (width * bpp); +    fb = malloc(stride * height); +    return fb; +} diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c new file mode 100644 index 0000000..06606bc --- /dev/null +++ b/miext/shadow/shpacked.c @@ -0,0 +1,118 @@ +/* + * + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include <stdlib.h> + +#include    <X11/X.h> +#include    "scrnintstr.h" +#include    "windowstr.h" +#include    <X11/fonts/font.h> +#include    "dixfontstr.h" +#include    <X11/fonts/fontstruct.h> +#include    "mi.h" +#include    "regionstr.h" +#include    "globals.h" +#include    "gcstruct.h" +#include    "shadow.h" +#include    "fb.h" + +void +shadowUpdatePacked (ScreenPtr	    pScreen, +		    shadowBufPtr    pBuf) +{ +    RegionPtr	damage = shadowDamage (pBuf); +    PixmapPtr	pShadow = pBuf->pPixmap; +    int		nbox = RegionNumRects (damage); +    BoxPtr	pbox = RegionRects (damage); +    FbBits	*shaBase, *shaLine, *sha; +    FbStride	shaStride; +    int		scrBase, scrLine, scr; +    int		shaBpp; +    int		shaXoff, shaYoff; /* XXX assumed to be zero */ +    int		x, y, w, h, width; +    int         i; +    FbBits	*winBase = NULL, *win; +    CARD32      winSize; + +    fbGetDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); +    while (nbox--) +    { +	x = pbox->x1 * shaBpp; +	y = pbox->y1; +	w = (pbox->x2 - pbox->x1) * shaBpp; +	h = pbox->y2 - pbox->y1; + +	scrLine = (x >> FB_SHIFT); +	shaLine = shaBase + y * shaStride + (x >> FB_SHIFT); +				    +	x &= FB_MASK; +	w = (w + x + FB_MASK) >> FB_SHIFT; +	 +	while (h--) +	{ +	    winSize = 0; +	    scrBase = 0; +	    width = w; +	    scr = scrLine; +	    sha = shaLine; +	    while (width) { +		/* how much remains in this window */ +		i = scrBase + winSize - scr; +		if (i <= 0 || scr < scrBase) +		{ +		    winBase = (FbBits *) (*pBuf->window) (pScreen, +							  y, +							  scr * sizeof (FbBits), +							  SHADOW_WINDOW_WRITE, +							  &winSize, +							  pBuf->closure); +		    if(!winBase) +			return; +		    scrBase = scr; +		    winSize /= sizeof (FbBits); +		    i = winSize; +		} +		win = winBase + (scr - scrBase); +		if (i > width) +		    i = width; +		width -= i; +		scr += i; +#define PickBit(a,i)	(((a) >> (i)) & 1) +		memcpy(win, sha, i * sizeof(FbBits)); +		sha += i; +	    } +	    shaLine += shaStride; +	    y++; +	} +	pbox++; +    } +} + +shadowUpdateProc +shadowUpdatePackedWeak(void) { +    return shadowUpdatePacked; +} diff --git a/miext/shadow/shplanar.c b/miext/shadow/shplanar.c new file mode 100644 index 0000000..9ca3f3f --- /dev/null +++ b/miext/shadow/shplanar.c @@ -0,0 +1,180 @@ +/* + * + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include <stdlib.h> + +#include    <X11/X.h> +#include    "scrnintstr.h" +#include    "windowstr.h" +#include    <X11/fonts/font.h> +#include    "dixfontstr.h" +#include    <X11/fonts/fontstruct.h> +#include    "mi.h" +#include    "regionstr.h" +#include    "globals.h" +#include    "gcstruct.h" +#include    "shadow.h" +#include    "fb.h" + +/* + * 32 4-bit pixels per write + */ + +#define PL_SHIFT    7	     +#define PL_UNIT	    (1 << PL_SHIFT) +#define PL_MASK	    (PL_UNIT - 1) + +/* + *  32->8 conversion: + * + *      7 6 5 4 3 2 1 0 + *      A B C D E F G H + * + *      3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 + *      1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * m    . . . H . . . G . . . F . . . E . . . D . . . C . . . B . . . A + * m1   G . . . F . . . E . . . D . . . C . . . B . . . A . . . . . . .	    m << (7 - (p)) + * m2   . H . . . G . . . F . . . E . . . D . . . C . . . B . . . A . .	    (m >> (p)) << 2 + * m3   G               E               C               A                   m1 & 0x80808080 + * m4     H               F               D               B                 m2 & 0x40404040 + * m5   G H             E F             C D             A B                 m3 | m4 + * m6   G H             E F             C D     G H     A B     E F         m5 | (m5 >> 20) + * m7   G H             E F             C D     G H     A B C D E F G H     m6 | (m6 >> 10) + */ + +#if 0 +#define GetBits(p,o,d) {\ +    m = sha[o]; \ +    m1 = m << (7 - (p)); \ +    m2 = (m >> (p)) << 2; \ +    m3 = m1 & 0x80808080; \ +    m4 = m2 & 0x40404040; \ +    m5 = m3 | m4; \ +    m6 = m5 | (m5 >> 20); \ +    d = m6 | (m6 >> 10); \ +} +#else +#define GetBits(p,o,d) {\ +    m = sha[o]; \ +    m5 = ((m << (7 - (p))) & 0x80808080) | (((m >> (p)) << 2) & 0x40404040); \ +    m6 = m5 | (m5 >> 20); \ +    d = m6 | (m6 >> 10); \ +} +#endif + +void +shadowUpdatePlanar4 (ScreenPtr	    pScreen, +		     shadowBufPtr   pBuf) +{ +    RegionPtr	damage = shadowDamage (pBuf); +    PixmapPtr	pShadow = pBuf->pPixmap; +    int		nbox = RegionNumRects (damage); +    BoxPtr	pbox = RegionRects (damage); +    CARD32	*shaBase, *shaLine, *sha; +    FbStride	shaStride; +    int		scrBase, scrLine, scr; +    int		shaBpp; +    int		shaXoff, shaYoff;   /* XXX assumed to be zero */ +    int		x, y, w, h, width; +    int         i; +    CARD32	*winBase = NULL, *win; +    CARD32	winSize; +    int		plane; +    CARD32	m,m5,m6; +    CARD8	s1, s2, s3, s4; + +    fbGetStipDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); +    while (nbox--) +    { +	x = (pbox->x1) * shaBpp; +	y = (pbox->y1); +	w = (pbox->x2 - pbox->x1) * shaBpp; +	h = pbox->y2 - pbox->y1; + +	w = (w + (x & PL_MASK) + PL_MASK) >> PL_SHIFT; +	x &= ~PL_MASK; +	 +	scrLine = (x >> PL_SHIFT); +	shaLine = shaBase + y * shaStride + (x >> FB_SHIFT); +	 +	while (h--) +	{ +	    for (plane = 0; plane < 4; plane++) +	    { +		width = w; +		scr = scrLine; +		sha = shaLine; +		winSize = 0; +		scrBase = 0; +		while (width) { +		    /* how much remains in this window */ +		    i = scrBase + winSize - scr; +		    if (i <= 0 || scr < scrBase) +		    { +			winBase = (CARD32 *) (*pBuf->window) (pScreen, +							      y, +							      (scr << 4) | (plane), +							      SHADOW_WINDOW_WRITE, +							      &winSize, +							      pBuf->closure); +			if(!winBase) +			return; +			winSize >>= 2; +			scrBase = scr; +			i = winSize; +		    } +		    win = winBase + (scr - scrBase); +		    if (i > width) +		    i = width; +		    width -= i; +		    scr += i; +		    +		    while (i--) +		    { +			GetBits(plane,0,s1); +			GetBits(plane,1,s2); +			GetBits(plane,2,s3); +			GetBits(plane,3,s4); +			*win++ = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24); +			sha += 4; +		    } +		} +	    } +	    shaLine += shaStride; +	    y++; +	} +	pbox++; +    } +} + +shadowUpdateProc shadowUpdatePlanar4Weak(void) { +    return shadowUpdatePlanar4; +} + +shadowUpdateProc shadowUpdatePlanar4x8Weak(void) { +    return shadowUpdatePlanar4x8; +} diff --git a/miext/shadow/shplanar8.c b/miext/shadow/shplanar8.c new file mode 100644 index 0000000..f8b255d --- /dev/null +++ b/miext/shadow/shplanar8.c @@ -0,0 +1,175 @@ +/* + * + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include <stdlib.h> + +#include    <X11/X.h> +#include    "scrnintstr.h" +#include    "windowstr.h" +#include    <X11/fonts/font.h> +#include    "dixfontstr.h" +#include    <X11/fonts/fontstruct.h> +#include    "mi.h" +#include    "regionstr.h" +#include    "globals.h" +#include    "gcstruct.h" +#include    "shadow.h" +#include    "fb.h" + +/* + * Expose 8bpp depth 4 + */ + +/* + *  32->8 conversion: + * + *      7 6 5 4 3 2 1 0 + *      A B C D E F G H + * + *      3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 + *      1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * m1   D x x x x x x x C x x x x x x x B x x x x x x x A x x x x x x x     sha[0] << (7-(p)) + * m2   x x x x H x x x x x x x G x x x x x x x F x x x x x x x E x x x     sha[1] << (3-(p)) + * m3   D               C               B               A                   m1 & 0x80808080 + * m4           H               G               F               E           m2 & 0x08080808 + * m5   D       H       C       G       B       F       A       E	    m3 | m4 + * m6                     D       H       C       G       B       F         m5 >> 9 + * m7   D       H       C D     G H     B C     F G     A B     E F         m5 | m6 + * m8                                       D       H       C D     G H     m7 >> 18 + * m9   D       H       C D     G H     B C D   F G H   A B C D E F G H     m7 | m8 + */ + +#define PL_SHIFT    8 +#define PL_UNIT	    (1 << PL_SHIFT) +#define PL_MASK	    (PL_UNIT - 1) + +#if 0 +#define GetBits(p,o,d) { \ +    CARD32	m1,m2,m3,m4,m5,m6,m7,m8; \ +    m1 = sha[o] << (7 - (p)); \ +    m2 = sha[(o)+1] << (3 - (p)); \ +    m3 = m1 & 0x80808080; \ +    m4 = m2 & 0x08080808; \ +    m5 = m3 | m4; \ +    m6 = m5 >> 9; \ +    m7 = m5 | m6; \ +    m8 = m7 >> 18; \ +    d = m7 | m8; \ +} +#else +#define GetBits(p,o,d) { \ +    CARD32	m5,m7; \ +    m5 = ((sha[o] << (7 - (p))) & 0x80808080) | ((sha[(o)+1] << (3 - (p))) & 0x08080808); \ +    m7 = m5 | (m5 >> 9); \ +    d = m7 | (m7 >> 18); \ +} +#endif + +void +shadowUpdatePlanar4x8 (ScreenPtr	pScreen, +		       shadowBufPtr	pBuf) +{ +    RegionPtr	damage = shadowDamage (pBuf); +    PixmapPtr	pShadow = pBuf->pPixmap; +    int		nbox = RegionNumRects (damage); +    BoxPtr	pbox = RegionRects (damage); +    CARD32	*shaBase, *shaLine, *sha; +    CARD8	s1, s2, s3, s4; +    FbStride	shaStride; +    int		scrBase, scrLine, scr; +    int		shaBpp; +    int		shaXoff, shaYoff;   /* XXX assumed to be zero */ +    int		x, y, w, h, width; +    int         i; +    CARD32	*winBase = NULL, *win; +    CARD32	winSize; +    int		plane; + +    fbGetStipDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); +    while (nbox--) +    { +	x = pbox->x1 * shaBpp; +	y = pbox->y1; +	w = (pbox->x2 - pbox->x1) * shaBpp; +	h = pbox->y2 - pbox->y1; + +	w = (w + (x & PL_MASK) + PL_MASK) >> PL_SHIFT; +	x &= ~PL_MASK; +	 +	scrLine = (x >> PL_SHIFT); +	shaLine = shaBase + y * shaStride + (x >> FB_SHIFT); +	 +	while (h--) +	{ +	    for (plane = 0; plane < 4; plane++) +	    { +		width = w; +		scr = scrLine; +		sha = shaLine; +		winSize = 0; +		scrBase = 0; +		while (width) { +		    /* how much remains in this window */ +		    i = scrBase + winSize - scr; +		    if (i <= 0 || scr < scrBase) +		    { +			winBase = (CARD32 *) (*pBuf->window) (pScreen, +							      y, +							      (scr << 4) | (plane), +							      SHADOW_WINDOW_WRITE, +							      &winSize, +							      pBuf->closure); +			if(!winBase) +			    return; +			winSize >>= 2; +			scrBase = scr; +			i = winSize; +		    } +		    win = winBase + (scr - scrBase); +		    if (i > width) +		    i = width; +		    width -= i; +		    scr += i; +		    +		    while (i--) +		    { +			GetBits(plane,0,s1); +			GetBits(plane,2,s2); +			GetBits(plane,4,s3); +			GetBits(plane,6,s4); +			*win++ = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24); +			sha += 8; +		    } +		} +	    } +	    shaLine += shaStride; +	    y++; +	} +	pbox++; +    } +} +		     diff --git a/miext/shadow/shrot16pack.c b/miext/shadow/shrot16pack.c new file mode 100644 index 0000000..0b7faca --- /dev/null +++ b/miext/shadow/shrot16pack.c @@ -0,0 +1,30 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate16 +#define Data	CARD16 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot16pack_180.c b/miext/shadow/shrot16pack_180.c new file mode 100644 index 0000000..d8f2633 --- /dev/null +++ b/miext/shadow/shrot16pack_180.c @@ -0,0 +1,31 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate16_180 +#define Data	CARD16 +#define ROTATE	180 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot16pack_270.c b/miext/shadow/shrot16pack_270.c new file mode 100644 index 0000000..4aa4713 --- /dev/null +++ b/miext/shadow/shrot16pack_270.c @@ -0,0 +1,31 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate16_270 +#define Data	CARD16 +#define ROTATE	270 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot16pack_270YX.c b/miext/shadow/shrot16pack_270YX.c new file mode 100644 index 0000000..0df1fd5 --- /dev/null +++ b/miext/shadow/shrot16pack_270YX.c @@ -0,0 +1,31 @@ +/* + * Copyright  2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate16_270YX +#define Data	CARD16 +#define ROTATE	270 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpackYX.h" diff --git a/miext/shadow/shrot16pack_90.c b/miext/shadow/shrot16pack_90.c new file mode 100644 index 0000000..81e4915 --- /dev/null +++ b/miext/shadow/shrot16pack_90.c @@ -0,0 +1,31 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate16_90 +#define Data	CARD16 +#define ROTATE	90 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot16pack_90YX.c b/miext/shadow/shrot16pack_90YX.c new file mode 100644 index 0000000..5fc3b23 --- /dev/null +++ b/miext/shadow/shrot16pack_90YX.c @@ -0,0 +1,31 @@ +/* + * Copyright  2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate16_90YX +#define Data	CARD16 +#define ROTATE	90 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpackYX.h" diff --git a/miext/shadow/shrot32pack.c b/miext/shadow/shrot32pack.c new file mode 100644 index 0000000..4a9cbc0 --- /dev/null +++ b/miext/shadow/shrot32pack.c @@ -0,0 +1,30 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate32 +#define Data	CARD32 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot32pack_180.c b/miext/shadow/shrot32pack_180.c new file mode 100644 index 0000000..8f5fb57 --- /dev/null +++ b/miext/shadow/shrot32pack_180.c @@ -0,0 +1,31 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate32_180 +#define Data	CARD32 +#define ROTATE	180 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot32pack_270.c b/miext/shadow/shrot32pack_270.c new file mode 100644 index 0000000..7d52fd2 --- /dev/null +++ b/miext/shadow/shrot32pack_270.c @@ -0,0 +1,31 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate32_270 +#define Data	CARD32 +#define ROTATE	270 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot32pack_90.c b/miext/shadow/shrot32pack_90.c new file mode 100644 index 0000000..0abeb5c --- /dev/null +++ b/miext/shadow/shrot32pack_90.c @@ -0,0 +1,31 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate32_90 +#define Data	CARD32 +#define ROTATE	90 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot8pack.c b/miext/shadow/shrot8pack.c new file mode 100644 index 0000000..552d838 --- /dev/null +++ b/miext/shadow/shrot8pack.c @@ -0,0 +1,30 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate8 +#define Data	CARD8 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot8pack_180.c b/miext/shadow/shrot8pack_180.c new file mode 100644 index 0000000..526d8f1 --- /dev/null +++ b/miext/shadow/shrot8pack_180.c @@ -0,0 +1,31 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate8_180 +#define Data	CARD8 +#define ROTATE	180 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot8pack_270.c b/miext/shadow/shrot8pack_270.c new file mode 100644 index 0000000..73f82a7 --- /dev/null +++ b/miext/shadow/shrot8pack_270.c @@ -0,0 +1,31 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate8_270 +#define Data	CARD8 +#define ROTATE	270 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrot8pack_90.c b/miext/shadow/shrot8pack_90.c new file mode 100644 index 0000000..73060ca --- /dev/null +++ b/miext/shadow/shrot8pack_90.c @@ -0,0 +1,31 @@ +/* + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 FUNC	shadowUpdateRotate8_90 +#define Data	CARD8 +#define ROTATE	90 + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "shrotpack.h" diff --git a/miext/shadow/shrotate.c b/miext/shadow/shrotate.c new file mode 100644 index 0000000..c389826 --- /dev/null +++ b/miext/shadow/shrotate.c @@ -0,0 +1,313 @@ +/* + * + * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include    <X11/X.h> +#include    "scrnintstr.h" +#include    "windowstr.h" +#include    <X11/fonts/font.h> +#include    "dixfontstr.h" +#include    <X11/fonts/fontstruct.h> +#include    "mi.h" +#include    "regionstr.h" +#include    "globals.h" +#include    "gcstruct.h" +#include    "shadow.h" +#include    "fb.h" + +/* + * These indicate which way the source (shadow) is scanned when + * walking the screen in a particular direction + */ + +#define LEFT_TO_RIGHT	1 +#define RIGHT_TO_LEFT	-1 +#define TOP_TO_BOTTOM	2 +#define BOTTOM_TO_TOP	-2 + +void +shadowUpdateRotatePacked (ScreenPtr	pScreen, +			  shadowBufPtr	pBuf) +{ +    RegionPtr	damage = shadowDamage (pBuf); +    PixmapPtr	pShadow = pBuf->pPixmap; +    int		nbox = RegionNumRects (damage); +    BoxPtr	pbox = RegionRects (damage); +    FbBits	*shaBits; +    FbStride	shaStride; +    int		shaBpp; +    int		shaXoff, shaYoff; +    int		box_x1, box_x2, box_y1, box_y2; +    int		sha_x1 = 0, sha_y1 = 0; +    int		scr_x1 = 0, scr_x2 = 0, scr_y1 = 0, scr_y2 = 0, scr_w, scr_h; +    int		scr_x, scr_y; +    int		w; +    int		pixelsPerBits; +    int		pixelsMask; +    FbStride	shaStepOverY = 0, shaStepDownY = 0; +    FbStride	shaStepOverX = 0, shaStepDownX = 0; +    FbBits	*shaLine, *sha; +    int		shaHeight = pShadow->drawable.height; +    int		shaWidth = pShadow->drawable.width; +    FbBits	shaMask; +    int		shaFirstShift, shaShift; +    int		o_x_dir; +    int		o_y_dir; +    int		x_dir; +    int		y_dir; + +    fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff); +    pixelsPerBits = (sizeof (FbBits) * 8) / shaBpp; +    pixelsMask = ~(pixelsPerBits - 1); +    shaMask = FbBitsMask (FB_UNIT-shaBpp, shaBpp); +    /* +     * Compute rotation related constants to walk the shadow +     */ +    o_x_dir = LEFT_TO_RIGHT; +    o_y_dir = TOP_TO_BOTTOM; +    if (pBuf->randr & SHADOW_REFLECT_X) +	o_x_dir = -o_x_dir; +    if (pBuf->randr & SHADOW_REFLECT_Y) +	o_y_dir = -o_y_dir; +    switch (pBuf->randr & (SHADOW_ROTATE_ALL)) { +    case SHADOW_ROTATE_0:	/* upper left shadow -> upper left screen */ +    default: +	x_dir = o_x_dir; +	y_dir = o_y_dir; +	break; +    case SHADOW_ROTATE_90:    	/* upper right shadow -> upper left screen */ +	x_dir = o_y_dir; +	y_dir = -o_x_dir; +	break; +    case SHADOW_ROTATE_180:	/* lower right shadow -> upper left screen */ +	x_dir = -o_x_dir; +	y_dir = -o_y_dir; +	break; +    case SHADOW_ROTATE_270:	/* lower left shadow -> upper left screen */ +	x_dir = -o_y_dir; +	y_dir = o_x_dir; +	break; +    } +    switch (x_dir) { +    case LEFT_TO_RIGHT: +	shaStepOverX = shaBpp; +	shaStepOverY = 0; +	break; +    case TOP_TO_BOTTOM: +	shaStepOverX = 0; +	shaStepOverY = shaStride; +	break; +    case RIGHT_TO_LEFT: +	shaStepOverX = -shaBpp; +	shaStepOverY = 0; +	break; +    case BOTTOM_TO_TOP: +	shaStepOverX = 0; +	shaStepOverY = -shaStride; +	break; +    } +    switch (y_dir) { +    case TOP_TO_BOTTOM: +	shaStepDownX = 0; +	shaStepDownY = shaStride; +	break; +    case RIGHT_TO_LEFT: +	shaStepDownX = -shaBpp; +	shaStepDownY = 0; +	break; +    case BOTTOM_TO_TOP: +	shaStepDownX = 0; +	shaStepDownY = -shaStride; +	break; +    case LEFT_TO_RIGHT: +	shaStepDownX = shaBpp; +	shaStepDownY = 0; +	break; +    } +     +    while (nbox--) +    { +        box_x1 = pbox->x1; +        box_y1 = pbox->y1; +        box_x2 = pbox->x2; +        box_y2 = pbox->y2; +        pbox++; + +	/* +	 * Compute screen and shadow locations for this box +	 */ +	switch (x_dir) { +	case LEFT_TO_RIGHT: +	    scr_x1 = box_x1 & pixelsMask; +	    scr_x2 = (box_x2 + pixelsPerBits - 1) & pixelsMask; +	     +	    sha_x1 = scr_x1; +	    break; +	case TOP_TO_BOTTOM: +	    scr_x1 = box_y1 & pixelsMask; +	    scr_x2 = (box_y2 + pixelsPerBits - 1) & pixelsMask; + +	    sha_y1 = scr_x1; +	    break; +	case RIGHT_TO_LEFT: +	    scr_x1 = (shaWidth - box_x2) & pixelsMask; +	    scr_x2 = (shaWidth - box_x1 + pixelsPerBits - 1) & pixelsMask; + +	    sha_x1 = (shaWidth - scr_x1 - 1); +	    break; +	case BOTTOM_TO_TOP: +	    scr_x1 = (shaHeight - box_y2) & pixelsMask; +	    scr_x2 = (shaHeight - box_y1 + pixelsPerBits - 1) & pixelsMask; +	     +	    sha_y1 = (shaHeight - scr_x1 - 1); +	    break; +	} +	switch (y_dir) { +	case TOP_TO_BOTTOM: +	    scr_y1 = box_y1; +	    scr_y2 = box_y2; + +	    sha_y1 = scr_y1; +	    break; +	case RIGHT_TO_LEFT: +	    scr_y1 = (shaWidth - box_x2); +	    scr_y2 = (shaWidth - box_x1); + +	    sha_x1 = box_x2 - 1; +	    break; +	case BOTTOM_TO_TOP: +	    scr_y1 = shaHeight - box_y2; +	    scr_y2 = shaHeight - box_y1; +	     +	    sha_y1 = box_y2 - 1; +	    break; +	case LEFT_TO_RIGHT: +	    scr_y1 = box_x1; +	    scr_y2 = box_x2; + +	    sha_x1 = box_x1; +	    break; +	} +	scr_w = ((scr_x2 - scr_x1) * shaBpp) >> FB_SHIFT; +	scr_h = scr_y2 - scr_y1; +	scr_y = scr_y1; + +	/* shift amount for first pixel on screen */  +	shaFirstShift = FB_UNIT - ((sha_x1 * shaBpp) & FB_MASK) - shaBpp; +	 +	/* pointer to shadow data first placed on screen */ +	shaLine = (shaBits +  +		   sha_y1 * shaStride +  +		   ((sha_x1 * shaBpp) >> FB_SHIFT)); + +	/* +	 * Copy the bits, always write across the physical frame buffer +	 * to take advantage of write combining. +	 */ +	while (scr_h--) +	{ +	    int	    p; +	    FbBits  bits; +	    FbBits  *win; +	    int	    i; +	    CARD32  winSize; +	     +	    sha = shaLine; +	    shaShift = shaFirstShift; +	    w = scr_w; +	    scr_x = scr_x1 * shaBpp >> FB_SHIFT; + +	    while (w) +	    { +		/* +		 * Map some of this line +		 */ +		win = (FbBits *) (*pBuf->window) (pScreen, +						  scr_y, +						  scr_x << 2, +						  SHADOW_WINDOW_WRITE, +						  &winSize, +						  pBuf->closure); +		i = (winSize >> 2); +		if (i > w) +		    i = w; +		w -= i; +		scr_x += i; +		/* +		 * Copy the portion of the line mapped +		 */ +		while (i--) +		{ +		    bits = 0; +		    p = pixelsPerBits; +		    /* +		     * Build one word of output from multiple inputs +		     *  +		     * Note that for 90/270 rotations, this will walk +		     * down the shadow hitting each scanline once. +		     * This is probably not very efficient. +		     */ +		    while (p--) +		    { +			bits = FbScrLeft(bits, shaBpp); +			bits |= FbScrRight (*sha, shaShift) & shaMask; + +			shaShift -= shaStepOverX; +			if (shaShift >= FB_UNIT) +			{ +			    shaShift -= FB_UNIT; +			    sha--; +			} +			else if (shaShift < 0) +			{ +			    shaShift += FB_UNIT; +			    sha++; +			} +			sha += shaStepOverY; +		    } +		    *win++ = bits; +		} +	    } +	    scr_y++; +	    shaFirstShift -= shaStepDownX; +	    if (shaFirstShift >= FB_UNIT) +	    { +		shaFirstShift -= FB_UNIT; +		shaLine--; +	    } +	    else if (shaFirstShift < 0) +	    { +		shaFirstShift += FB_UNIT; +		shaLine++; +	    } +	    shaLine += shaStepDownY; +	} +    } +} + +shadowUpdateProc shadowUpdateRotatePackedWeak(void) { +    return shadowUpdateRotatePacked; +} diff --git a/miext/shadow/shrotpack.h b/miext/shadow/shrotpack.h new file mode 100644 index 0000000..2d1a87c --- /dev/null +++ b/miext/shadow/shrotpack.h @@ -0,0 +1,187 @@ +/* + * + * Copyright © 2000 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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. + */ + +/* + * Thanks to Daniel Chemko <dchemko@intrinsyc.com> for making the 90 and 180 + * orientations work. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include <stdlib.h> + +#include    <X11/X.h> +#include    "scrnintstr.h" +#include    "windowstr.h" +#include    <X11/fonts/font.h> +#include    "dixfontstr.h" +#include    <X11/fonts/fontstruct.h> +#include    "mi.h" +#include    "regionstr.h" +#include    "globals.h" +#include    "gcstruct.h" +#include    "shadow.h" +#include    "fb.h" + +#define DANDEBUG         0 + +#if ROTATE == 270 + +#define SCRLEFT(x,y,w,h)    (pScreen->height - ((y) + (h))) +#define SCRY(x,y,w,h)	    (x) +#define SCRWIDTH(x,y,w,h)   (h) +#define FIRSTSHA(x,y,w,h)   (((y) + (h) - 1) * shaStride + (x)) +#define STEPDOWN(x,y,w,h)   ((w)--) +#define NEXTY(x,y,w,h)	    ((x)++) +#define SHASTEPX(stride)    -(stride) +#define SHASTEPY(stride)    (1) + +#elif ROTATE == 90 + +#define SCRLEFT(x,y,w,h)    (y) +#define SCRY(x,y,w,h)	    (pScreen->width - ((x) + (w)) - 1) +#define SCRWIDTH(x,y,w,h)   (h) +#define FIRSTSHA(x,y,w,h)   ((y) * shaStride + (x + w - 1)) +#define STEPDOWN(x,y,w,h)   ((w)--) +#define NEXTY(x,y,w,h)	    ((void)(x)) +#define SHASTEPX(stride)    (stride) +#define SHASTEPY(stride)    (-1) + +#elif ROTATE == 180 + +#define SCRLEFT(x,y,w,h)    (pScreen->width - ((x) + (w))) +#define SCRY(x,y,w,h)	    (pScreen->height - ((y) + (h)) - 1) +#define SCRWIDTH(x,y,w,h)   (w) +#define FIRSTSHA(x,y,w,h)   ((y + h - 1) * shaStride + (x + w - 1)) +#define STEPDOWN(x,y,w,h)   ((h)--) +#define NEXTY(x,y,w,h)	    ((void)(y)) +#define SHASTEPX(stride)    (-1) +#define SHASTEPY(stride)    -(stride) + +#else + +#define SCRLEFT(x,y,w,h)    (x) +#define SCRY(x,y,w,h)	    (y) +#define SCRWIDTH(x,y,w,h)   (w) +#define FIRSTSHA(x,y,w,h)   ((y) * shaStride + (x)) +#define STEPDOWN(x,y,w,h)   ((h)--) +#define NEXTY(x,y,w,h)	    ((y)++) +#define SHASTEPX(stride)    (1) +#define SHASTEPY(stride)    (stride) + +#endif + +void +FUNC (ScreenPtr	    pScreen, +      shadowBufPtr  pBuf) +{ +    RegionPtr	damage = shadowDamage (pBuf); +    PixmapPtr	pShadow = pBuf->pPixmap; +    int		nbox = RegionNumRects (damage); +    BoxPtr	pbox = RegionRects (damage); +    FbBits	*shaBits; +    Data	*shaBase, *shaLine, *sha; +    FbStride	shaStride; +    int		scrBase, scrLine, scr; +    int		shaBpp; +    int		shaXoff, shaYoff;   /* XXX assumed to be zero */ +    int		x, y, w, h, width; +    int         i; +    Data	*winBase = NULL, *win; +    CARD32	winSize; + +    fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff); +    shaBase = (Data *) shaBits; +    shaStride = shaStride * sizeof (FbBits) / sizeof (Data); +#if (DANDEBUG > 1) +    ErrorF ("-> Entering Shadow Update:\r\n   |- Origins: pShadow=%x, pScreen=%x, damage=%x\r\n   |- Metrics: shaStride=%d, shaBase=%x, shaBpp=%d\r\n   |                                                     \n", pShadow, pScreen, damage, shaStride, shaBase, shaBpp); +#endif +    while (nbox--) +    { +        x = pbox->x1; +        y = pbox->y1; +        w = (pbox->x2 - pbox->x1); +        h = pbox->y2 - pbox->y1; +         +#if (DANDEBUG > 2) +        ErrorF ("   |-> Redrawing box - Metrics: X=%d, Y=%d, Width=%d, Height=%d\n", x, y, w, h); +#endif +        scrLine = SCRLEFT(x,y,w,h); +        shaLine = shaBase + FIRSTSHA(x,y,w,h); +         +        while (STEPDOWN(x,y,w,h)) +        { +            winSize = 0; +            scrBase = 0; +            width = SCRWIDTH(x,y,w,h); +            scr = scrLine; +            sha = shaLine; +#if (DANDEBUG > 3) +            ErrorF ("   |   |-> StepDown - Metrics: width=%d, scr=%x, sha=%x\n", width, scr, sha); +#endif +            while (width) +            { +                /*  how much remains in this window */ +                i = scrBase + winSize - scr; +                if (i <= 0 || scr < scrBase) +                { +                    winBase = (Data *) (*pBuf->window) (pScreen, +							SCRY(x,y,w,h), +							scr * sizeof (Data), +							SHADOW_WINDOW_WRITE, +							&winSize, +							pBuf->closure); +                    if(!winBase) +                        return; +                    scrBase = scr; +                    winSize /= sizeof (Data); +                    i = winSize; +#if(DANDEBUG > 4) +                    ErrorF ("   |   |   |-> Starting New Line - Metrics: winBase=%x, scrBase=%x, winSize=%d\r\n   |   |   |   Xstride=%d, Ystride=%d, w=%d h=%d\n", winBase, scrBase, winSize, SHASTEPX(shaStride), SHASTEPY(shaStride), w, h); +#endif +                } +                win = winBase + (scr - scrBase); +                if (i > width) +                    i = width; +                width -= i; +                scr += i; +#if(DANDEBUG > 5) +		ErrorF ("   |   |   |-> Writing Line - Metrics: win=%x, sha=%x\n", win, sha); +#endif +                while (i--) +                { +#if(DANDEBUG > 6) +		    ErrorF ("   |   |   |-> Writing Pixel - Metrics: win=%x, sha=%d, remaining=%d\n", win, sha, i); +#endif +                    *win++ = *sha; +                    sha += SHASTEPX(shaStride); +                } /*  i */ +            } /*  width */ +            shaLine += SHASTEPY(shaStride); +            NEXTY(x,y,w,h); +        } /*  STEPDOWN */ +        pbox++; +    } /*  nbox */ +} diff --git a/miext/shadow/shrotpackYX.h b/miext/shadow/shrotpackYX.h new file mode 100644 index 0000000..7d36bd1 --- /dev/null +++ b/miext/shadow/shrotpackYX.h @@ -0,0 +1,160 @@ +/* + * Copyright © 2004 Philip Blundell + * + * 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 Philip Blundell not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Philip Blundell makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL PHILIP BLUNDELL 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    <X11/X.h> +#include    "scrnintstr.h" +#include    "windowstr.h" +#include    "dixfontstr.h" +#include    "mi.h" +#include    "regionstr.h" +#include    "globals.h" +#include    "gcstruct.h" +#include    "shadow.h" +#include    "fb.h" + +#if ROTATE == 270 + +#define WINSTEPX(stride)    (stride) +#define WINSTART(x,y)       (((pScreen->height - 1) - y) + (x * winStride)) +#define WINSTEPY()	    -1 + +#elif ROTATE == 90 + +#define WINSTEPX(stride)    (-stride) +#define WINSTEPY()	    1 +#define WINSTART(x,y)       (((pScreen->width - 1 - x) * winStride) + y) + +#else + +#error This rotation is not supported here + +#endif + +#ifdef __arm__ +#define PREFETCH +#endif + +void +FUNC (ScreenPtr	    pScreen, +      shadowBufPtr  pBuf); + +void +FUNC (ScreenPtr	    pScreen, +      shadowBufPtr  pBuf) +{ +    RegionPtr	damage = shadowDamage(pBuf); +    PixmapPtr	pShadow = pBuf->pPixmap; +    int		nbox = RegionNumRects (damage); +    BoxPtr	pbox = RegionRects (damage); +    FbBits	*shaBits; +    Data	*shaBase, *shaLine, *sha; +    FbStride	shaStride, winStride; +    int		shaBpp; +    int		shaXoff, shaYoff;   /* XXX assumed to be zero */ +    int		x, y, w, h; +    Data	*winBase, *win, *winLine; +    CARD32	winSize; + +    fbGetDrawable (&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff, shaYoff); +    shaBase = (Data *) shaBits; +    shaStride = shaStride * sizeof (FbBits) / sizeof (Data); + +    winBase = (Data *) (*pBuf->window) (pScreen, 0, 0, +					SHADOW_WINDOW_WRITE, +					&winSize, pBuf->closure); +    winStride = (Data *) (*pBuf->window) (pScreen, 1, 0, +					  SHADOW_WINDOW_WRITE, +					  &winSize, pBuf->closure) - winBase; + +    while (nbox--) +    { +        x = pbox->x1; +        y = pbox->y1; +        w = (pbox->x2 - pbox->x1); +        h = pbox->y2 - pbox->y1; + +	shaLine = shaBase + (y * shaStride) + x; +#ifdef PREFETCH +	__builtin_prefetch (shaLine); +#endif +	winLine = winBase + WINSTART(x, y); + +        while (h--) +        { +	    sha = shaLine; +	    win = winLine; + +            while (sha < (shaLine + w - 16)) +            { +#ifdef PREFETCH +		__builtin_prefetch (sha + shaStride); +#endif +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); + +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); + +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); + +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); +		*win = *sha++; +		win += WINSTEPX(winStride); +            } + +            while (sha < (shaLine + w)) +            { +		*win = *sha++; +		win += WINSTEPX(winStride); +            } + +	    y++; +	    shaLine += shaStride; +	    winLine += WINSTEPY(); +        } +        pbox++; +    } /*  nbox */ +} | 
