summaryrefslogtreecommitdiff
path: root/xserver/hw/xfree86/xf8_32bpp
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2006-11-26 18:19:47 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2006-11-26 18:19:47 +0000
commit04f51aaa1f5b0cac419d2891812446c790b9c581 (patch)
tree7d104a653aff8d7488bc039ba435118115c18807 /xserver/hw/xfree86/xf8_32bpp
parent4a168ba45f33263ee86fc398ff32f108cffb1330 (diff)
Importing xserver from X.Org 7.2RC2
Diffstat (limited to 'xserver/hw/xfree86/xf8_32bpp')
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/Makefile.am38
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/Makefile.in880
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfb8_32.h227
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfb8_32module.c39
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbbstore.c105
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c549
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbcpyplane.c43
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbgc.c646
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbgc32.c2
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbgc8.c2
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbgcmisc.c152
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c620
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbimage.c174
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbpntwin.c180
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c328
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/cfbwindow.c121
-rw-r--r--xserver/hw/xfree86/xf8_32bpp/xf86overlay.c1254
17 files changed, 5360 insertions, 0 deletions
diff --git a/xserver/hw/xfree86/xf8_32bpp/Makefile.am b/xserver/hw/xfree86/xf8_32bpp/Makefile.am
new file mode 100644
index 000000000..3050b81d1
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/Makefile.am
@@ -0,0 +1,38 @@
+module_LTLIBRARIES = libxf8_32bpp.la
+
+sdk_HEADERS = cfb8_32.h
+
+INCLUDES = $(XORG_INCS) -I$(top_srcdir)/mfb -I$(top_srcdir)/cfb
+
+AM_CFLAGS = $(XORG_CFLAGS)
+
+libxf8_32bpp_la_LDFLAGS = -avoid-version
+
+libxf8_32bpp_la_SOURCES = \
+ cfbbstore.c \
+ cfbcpyarea.c \
+ cfbcpyplane.c \
+ cfbgcmisc.c \
+ cfbimage.c \
+ cfbpntwin.c \
+ cfbscrinit.c \
+ cfbwindow.c \
+ xf86overlay.c \
+ cfb8_32module.c \
+ cfbgc8.c \
+ cfbgc32.c \
+ cfbgcunder.c
+
+libxf8_32bpp_la_LIBADD = $(top_builddir)/cfb32/libcfb32.la
+
+EXTRA_DIST = cfbgc.c
+
+cfbgc8.c: $(srcdir)/cfbgc.c
+ echo '#define PSZ 8' > $@
+ echo '#include "$(srcdir)/cfbgc.c"' >> $@
+
+cfbgc32.c: $(srcdir)/cfbgc.c
+ echo '#define PSZ 32' > $@
+ echo '#include "$(srcdir)/cfbgc.c"' >> $@
+
+DISTCLEANFILES = cfbgc8.c cfbgc32.c
diff --git a/xserver/hw/xfree86/xf8_32bpp/Makefile.in b/xserver/hw/xfree86/xf8_32bpp/Makefile.in
new file mode 100644
index 000000000..23bbfe135
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/Makefile.in
@@ -0,0 +1,880 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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@
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+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 = hw/xfree86/xf8_32bpp
+DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.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/xgl-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
+CONFIG_CLEAN_FILES =
+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 = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(sdkdir)"
+moduleLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(module_LTLIBRARIES)
+libxf8_32bpp_la_DEPENDENCIES = $(top_builddir)/cfb32/libcfb32.la
+am_libxf8_32bpp_la_OBJECTS = cfbbstore.lo cfbcpyarea.lo cfbcpyplane.lo \
+ cfbgcmisc.lo cfbimage.lo cfbpntwin.lo cfbscrinit.lo \
+ cfbwindow.lo xf86overlay.lo cfb8_32module.lo cfbgc8.lo \
+ cfbgc32.lo cfbgcunder.lo
+libxf8_32bpp_la_OBJECTS = $(am_libxf8_32bpp_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libxf8_32bpp_la_SOURCES)
+DIST_SOURCES = $(libxf8_32bpp_la_SOURCES)
+sdkHEADERS_INSTALL = $(INSTALL_HEADER)
+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@
+AFB_FALSE = @AFB_FALSE@
+AFB_TRUE = @AFB_TRUE@
+AGP_FALSE = @AGP_FALSE@
+AGP_TRUE = @AGP_TRUE@
+AIGLX_FALSE = @AIGLX_FALSE@
+AIGLX_TRUE = @AIGLX_TRUE@
+ALLOCA = @ALLOCA@
+ALPHA_VIDEO_FALSE = @ALPHA_VIDEO_FALSE@
+ALPHA_VIDEO_TRUE = @ALPHA_VIDEO_TRUE@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+APPDEFAULTDIR = @APPDEFAULTDIR@
+APPGROUP_FALSE = @APPGROUP_FALSE@
+APPGROUP_TRUE = @APPGROUP_TRUE@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+ARM_VIDEO_FALSE = @ARM_VIDEO_FALSE@
+ARM_VIDEO_TRUE = @ARM_VIDEO_TRUE@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_FONT_PATH = @BASE_FONT_PATH@
+BSD_KBD_MODE_FALSE = @BSD_KBD_MODE_FALSE@
+BSD_KBD_MODE_TRUE = @BSD_KBD_MODE_TRUE@
+BUILDDOCS_FALSE = @BUILDDOCS_FALSE@
+BUILDDOCS_TRUE = @BUILDDOCS_TRUE@
+BUILD_DATE = @BUILD_DATE@
+BUILD_KBD_MODE_FALSE = @BUILD_KBD_MODE_FALSE@
+BUILD_KBD_MODE_TRUE = @BUILD_KBD_MODE_TRUE@
+BUILD_LINUXDOC_FALSE = @BUILD_LINUXDOC_FALSE@
+BUILD_LINUXDOC_TRUE = @BUILD_LINUXDOC_TRUE@
+BUILD_PDFDOC_FALSE = @BUILD_PDFDOC_FALSE@
+BUILD_PDFDOC_TRUE = @BUILD_PDFDOC_TRUE@
+BUILD_XORGCFG_FALSE = @BUILD_XORGCFG_FALSE@
+BUILD_XORGCFG_TRUE = @BUILD_XORGCFG_TRUE@
+CC = @CC@
+CCAS = @CCAS@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFB_FALSE = @CFB_FALSE@
+CFB_TRUE = @CFB_TRUE@
+CFLAGS = @CFLAGS@
+COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
+COMPOSITE_FALSE = @COMPOSITE_FALSE@
+COMPOSITE_TRUE = @COMPOSITE_TRUE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CUP_FALSE = @CUP_FALSE@
+CUP_TRUE = @CUP_TRUE@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBE_FALSE = @DBE_FALSE@
+DBE_TRUE = @DBE_TRUE@
+DEBUG_FALSE = @DEBUG_FALSE@
+DEBUG_TRUE = @DEBUG_TRUE@
+DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
+DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DGA_FALSE = @DGA_FALSE@
+DGA_TRUE = @DGA_TRUE@
+DIX_CFLAGS = @DIX_CFLAGS@
+DLLTOOL = @DLLTOOL@
+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@
+DMX_BUILD_LNX_FALSE = @DMX_BUILD_LNX_FALSE@
+DMX_BUILD_LNX_TRUE = @DMX_BUILD_LNX_TRUE@
+DMX_BUILD_USB_FALSE = @DMX_BUILD_USB_FALSE@
+DMX_BUILD_USB_TRUE = @DMX_BUILD_USB_TRUE@
+DMX_FALSE = @DMX_FALSE@
+DMX_TRUE = @DMX_TRUE@
+DPMSExtension_FALSE = @DPMSExtension_FALSE@
+DPMSExtension_TRUE = @DPMSExtension_TRUE@
+DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
+DRIPROTO_LIBS = @DRIPROTO_LIBS@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DRI_FALSE = @DRI_FALSE@
+DRI_TRUE = @DRI_TRUE@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EVI_FALSE = @EVI_FALSE@
+EVI_TRUE = @EVI_TRUE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FBDEVHW_FALSE = @FBDEVHW_FALSE@
+FBDEVHW_TRUE = @FBDEVHW_TRUE@
+FFLAGS = @FFLAGS@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+FONTCACHE_FALSE = @FONTCACHE_FALSE@
+FONTCACHE_TRUE = @FONTCACHE_TRUE@
+FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@
+FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+FREETYPE_REQUIRES = @FREETYPE_REQUIRES@
+GLX_DEFINES = @GLX_DEFINES@
+GLX_FALSE = @GLX_FALSE@
+GLX_TRUE = @GLX_TRUE@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+H3600_TS_FALSE = @H3600_TS_FALSE@
+H3600_TS_TRUE = @H3600_TS_TRUE@
+I386_VIDEO_FALSE = @I386_VIDEO_FALSE@
+I386_VIDEO_TRUE = @I386_VIDEO_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_LIBXF86CONFIG_FALSE = @INSTALL_LIBXF86CONFIG_FALSE@
+INSTALL_LIBXF86CONFIG_TRUE = @INSTALL_LIBXF86CONFIG_TRUE@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_SETUID_FALSE = @INSTALL_SETUID_FALSE@
+INSTALL_SETUID_TRUE = @INSTALL_SETUID_TRUE@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT10_STUB_FALSE = @INT10_STUB_FALSE@
+INT10_STUB_TRUE = @INT10_STUB_TRUE@
+INT10_VM86_FALSE = @INT10_VM86_FALSE@
+INT10_VM86_TRUE = @INT10_VM86_TRUE@
+INT10_X86EMU_FALSE = @INT10_X86EMU_FALSE@
+INT10_X86EMU_TRUE = @INT10_X86EMU_TRUE@
+KDRIVEFBDEV_FALSE = @KDRIVEFBDEV_FALSE@
+KDRIVEFBDEV_TRUE = @KDRIVEFBDEV_TRUE@
+KDRIVEVESA_FALSE = @KDRIVEVESA_FALSE@
+KDRIVEVESA_TRUE = @KDRIVEVESA_TRUE@
+KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_FALSE = @KDRIVE_FALSE@
+KDRIVE_HW_FALSE = @KDRIVE_HW_FALSE@
+KDRIVE_HW_TRUE = @KDRIVE_HW_TRUE@
+KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_LIBS = @KDRIVE_LIBS@
+KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
+KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
+KDRIVE_TRUE = @KDRIVE_TRUE@
+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@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINUXDOC = @LINUXDOC@
+LINUX_ALPHA_FALSE = @LINUX_ALPHA_FALSE@
+LINUX_ALPHA_TRUE = @LINUX_ALPHA_TRUE@
+LINUX_IA64_FALSE = @LINUX_IA64_FALSE@
+LINUX_IA64_TRUE = @LINUX_IA64_TRUE@
+LNXACPI_FALSE = @LNXACPI_FALSE@
+LNXACPI_TRUE = @LNXACPI_TRUE@
+LNXAPM_FALSE = @LNXAPM_FALSE@
+LNXAPM_TRUE = @LNXAPM_TRUE@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MAKE_HTML = @MAKE_HTML@
+MAKE_PDF = @MAKE_PDF@
+MAKE_PS = @MAKE_PS@
+MAKE_TEXT = @MAKE_TEXT@
+MESA_SOURCE = @MESA_SOURCE@
+MFB_FALSE = @MFB_FALSE@
+MFB_TRUE = @MFB_TRUE@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MITSHM_FALSE = @MITSHM_FALSE@
+MITSHM_TRUE = @MITSHM_TRUE@
+MKFONTDIR = @MKFONTDIR@
+MKFONTSCALE = @MKFONTSCALE@
+MMX_CAPABLE_FALSE = @MMX_CAPABLE_FALSE@
+MMX_CAPABLE_TRUE = @MMX_CAPABLE_TRUE@
+MULTIBUFFER_FALSE = @MULTIBUFFER_FALSE@
+MULTIBUFFER_TRUE = @MULTIBUFFER_TRUE@
+NEED_STRLCAT_FALSE = @NEED_STRLCAT_FALSE@
+NEED_STRLCAT_TRUE = @NEED_STRLCAT_TRUE@
+NEED_VSNPRINTF_FALSE = @NEED_VSNPRINTF_FALSE@
+NEED_VSNPRINTF_TRUE = @NEED_VSNPRINTF_TRUE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PPC_VIDEO_FALSE = @PPC_VIDEO_FALSE@
+PPC_VIDEO_TRUE = @PPC_VIDEO_TRUE@
+PROJECTROOT = @PROJECTROOT@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+RAWCPP = @RAWCPP@
+RAWCPPFLAGS = @RAWCPPFLAGS@
+RECORD_FALSE = @RECORD_FALSE@
+RECORD_TRUE = @RECORD_TRUE@
+RES_FALSE = @RES_FALSE@
+RES_TRUE = @RES_TRUE@
+RGB_DB = @RGB_DB@
+SCREENSAVER_FALSE = @SCREENSAVER_FALSE@
+SCREENSAVER_TRUE = @SCREENSAVER_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
+SOLARIS_ASM_INLINE_FALSE = @SOLARIS_ASM_INLINE_FALSE@
+SOLARIS_ASM_INLINE_TRUE = @SOLARIS_ASM_INLINE_TRUE@
+SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
+SOLARIS_USL_CONSOLE_FALSE = @SOLARIS_USL_CONSOLE_FALSE@
+SOLARIS_USL_CONSOLE_TRUE = @SOLARIS_USL_CONSOLE_TRUE@
+SPARC64_VIDEO_FALSE = @SPARC64_VIDEO_FALSE@
+SPARC64_VIDEO_TRUE = @SPARC64_VIDEO_TRUE@
+STRIP = @STRIP@
+SUN_KBD_MODE_FALSE = @SUN_KBD_MODE_FALSE@
+SUN_KBD_MODE_TRUE = @SUN_KBD_MODE_TRUE@
+SYS_LIBS = @SYS_LIBS@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_FALSE = @TSLIB_FALSE@
+TSLIB_LIBS = @TSLIB_LIBS@
+TSLIB_TRUE = @TSLIB_TRUE@
+USE_CURSES_FALSE = @USE_CURSES_FALSE@
+USE_CURSES_TRUE = @USE_CURSES_TRUE@
+USE_RGB_BUILTIN_FALSE = @USE_RGB_BUILTIN_FALSE@
+USE_RGB_BUILTIN_TRUE = @USE_RGB_BUILTIN_TRUE@
+VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
+VENDOR_RELEASE = @VENDOR_RELEASE@
+VENDOR_STRING = @VENDOR_STRING@
+VENDOR_STRING_SHORT = @VENDOR_STRING_SHORT@
+VERSION = @VERSION@
+X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XACE_FALSE = @XACE_FALSE@
+XACE_TRUE = @XACE_TRUE@
+XCALIBRATE_FALSE = @XCALIBRATE_FALSE@
+XCALIBRATE_TRUE = @XCALIBRATE_TRUE@
+XCSECURITY_FALSE = @XCSECURITY_FALSE@
+XCSECURITY_TRUE = @XCSECURITY_TRUE@
+XDMAUTH_FALSE = @XDMAUTH_FALSE@
+XDMAUTH_TRUE = @XDMAUTH_TRUE@
+XDMCP_CFLAGS = @XDMCP_CFLAGS@
+XDMCP_FALSE = @XDMCP_FALSE@
+XDMCP_LIBS = @XDMCP_LIBS@
+XDMCP_TRUE = @XDMCP_TRUE@
+XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
+XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_LIBS = @XDMX_LIBS@
+XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@
+XEGLMODULES_LIBS = @XEGLMODULES_LIBS@
+XEGL_FALSE = @XEGL_FALSE@
+XEGL_LIBS = @XEGL_LIBS@
+XEGL_TRUE = @XEGL_TRUE@
+XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_FALSE = @XEPHYR_FALSE@
+XEPHYR_INCS = @XEPHYR_INCS@
+XEPHYR_LIBS = @XEPHYR_LIBS@
+XEPHYR_TRUE = @XEPHYR_TRUE@
+XEVIE_FALSE = @XEVIE_FALSE@
+XEVIE_TRUE = @XEVIE_TRUE@
+XF86BIGFONT_FALSE = @XF86BIGFONT_FALSE@
+XF86BIGFONT_TRUE = @XF86BIGFONT_TRUE@
+XF86CONFIGFILE = @XF86CONFIGFILE@
+XF86UTILS_FALSE = @XF86UTILS_FALSE@
+XF86UTILS_TRUE = @XF86UTILS_TRUE@
+XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@
+XGLMODULES_LIBS = @XGLMODULES_LIBS@
+XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
+XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
+XGLX_FALSE = @XGLX_FALSE@
+XGLX_LIBS = @XGLX_LIBS@
+XGLX_TRUE = @XGLX_TRUE@
+XGL_FALSE = @XGL_FALSE@
+XGL_LIBS = @XGL_LIBS@
+XGL_MODULE_PATH = @XGL_MODULE_PATH@
+XGL_TRUE = @XGL_TRUE@
+XINERAMA_FALSE = @XINERAMA_FALSE@
+XINERAMA_TRUE = @XINERAMA_TRUE@
+XINPUT_FALSE = @XINPUT_FALSE@
+XINPUT_TRUE = @XINPUT_TRUE@
+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@
+XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
+XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
+XNEST_FALSE = @XNEST_FALSE@
+XNEST_LIBS = @XNEST_LIBS@
+XNEST_TRUE = @XNEST_TRUE@
+XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@
+XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@
+XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@
+XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@
+XORG_BUS_FREEBSDPCI_FALSE = @XORG_BUS_FREEBSDPCI_FALSE@
+XORG_BUS_FREEBSDPCI_TRUE = @XORG_BUS_FREEBSDPCI_TRUE@
+XORG_BUS_IX86PCI_FALSE = @XORG_BUS_IX86PCI_FALSE@
+XORG_BUS_IX86PCI_TRUE = @XORG_BUS_IX86PCI_TRUE@
+XORG_BUS_LINUXPCI_FALSE = @XORG_BUS_LINUXPCI_FALSE@
+XORG_BUS_LINUXPCI_TRUE = @XORG_BUS_LINUXPCI_TRUE@
+XORG_BUS_NETBSDPCI_FALSE = @XORG_BUS_NETBSDPCI_FALSE@
+XORG_BUS_NETBSDPCI_TRUE = @XORG_BUS_NETBSDPCI_TRUE@
+XORG_BUS_PPCPCI_FALSE = @XORG_BUS_PPCPCI_FALSE@
+XORG_BUS_PPCPCI_TRUE = @XORG_BUS_PPCPCI_TRUE@
+XORG_BUS_SPARCPCI_FALSE = @XORG_BUS_SPARCPCI_FALSE@
+XORG_BUS_SPARCPCI_TRUE = @XORG_BUS_SPARCPCI_TRUE@
+XORG_BUS_SPARC_FALSE = @XORG_BUS_SPARC_FALSE@
+XORG_BUS_SPARC_TRUE = @XORG_BUS_SPARC_TRUE@
+XORG_CFLAGS = @XORG_CFLAGS@
+XORG_CORE_LIBS = @XORG_CORE_LIBS@
+XORG_FALSE = @XORG_FALSE@
+XORG_INCS = @XORG_INCS@
+XORG_LIBS = @XORG_LIBS@
+XORG_LOADER_SPARC_FALSE = @XORG_LOADER_SPARC_FALSE@
+XORG_LOADER_SPARC_TRUE = @XORG_LOADER_SPARC_TRUE@
+XORG_OS = @XORG_OS@
+XORG_OS_KBD = @XORG_OS_KBD@
+XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_TRUE = @XORG_TRUE@
+XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
+XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
+XPRINT_CFLAGS = @XPRINT_CFLAGS@
+XPRINT_FALSE = @XPRINT_FALSE@
+XPRINT_LIBS = @XPRINT_LIBS@
+XPRINT_TRUE = @XPRINT_TRUE@
+XP_USE_FREETYPE_FALSE = @XP_USE_FREETYPE_FALSE@
+XP_USE_FREETYPE_TRUE = @XP_USE_FREETYPE_TRUE@
+XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
+XSDLSERVER_FALSE = @XSDLSERVER_FALSE@
+XSDLSERVER_TRUE = @XSDLSERVER_TRUE@
+XSDL_INCS = @XSDL_INCS@
+XSDL_LIBS = @XSDL_LIBS@
+XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
+XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
+XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
+XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
+XSERVER_LIBS = @XSERVER_LIBS@
+XTRAP_FALSE = @XTRAP_FALSE@
+XTRAP_TRUE = @XTRAP_TRUE@
+XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
+XVFB_FALSE = @XVFB_FALSE@
+XVFB_LIBS = @XVFB_LIBS@
+XVFB_TRUE = @XVFB_TRUE@
+XVMC_FALSE = @XVMC_FALSE@
+XVMC_TRUE = @XVMC_TRUE@
+XV_FALSE = @XV_FALSE@
+XV_TRUE = @XV_TRUE@
+XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
+XWINMODULES_LIBS = @XWINMODULES_LIBS@
+XWIN_CLIPBOARD_FALSE = @XWIN_CLIPBOARD_FALSE@
+XWIN_CLIPBOARD_TRUE = @XWIN_CLIPBOARD_TRUE@
+XWIN_FALSE = @XWIN_FALSE@
+XWIN_GLX_WINDOWS_FALSE = @XWIN_GLX_WINDOWS_FALSE@
+XWIN_GLX_WINDOWS_TRUE = @XWIN_GLX_WINDOWS_TRUE@
+XWIN_LIBS = @XWIN_LIBS@
+XWIN_MULTIWINDOWEXTWM_FALSE = @XWIN_MULTIWINDOWEXTWM_FALSE@
+XWIN_MULTIWINDOWEXTWM_TRUE = @XWIN_MULTIWINDOWEXTWM_TRUE@
+XWIN_MULTIWINDOW_FALSE = @XWIN_MULTIWINDOW_FALSE@
+XWIN_MULTIWINDOW_TRUE = @XWIN_MULTIWINDOW_TRUE@
+XWIN_NATIVEGDI_FALSE = @XWIN_NATIVEGDI_FALSE@
+XWIN_NATIVEGDI_TRUE = @XWIN_NATIVEGDI_TRUE@
+XWIN_PRIMARYFB_FALSE = @XWIN_PRIMARYFB_FALSE@
+XWIN_PRIMARYFB_TRUE = @XWIN_PRIMARYFB_TRUE@
+XWIN_RANDR_FALSE = @XWIN_RANDR_FALSE@
+XWIN_RANDR_TRUE = @XWIN_RANDR_TRUE@
+XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
+XWIN_SYSTEM_LIBS = @XWIN_SYSTEM_LIBS@
+XWIN_TRUE = @XWIN_TRUE@
+XWIN_XV_FALSE = @XWIN_XV_FALSE@
+XWIN_XV_TRUE = @XWIN_XV_TRUE@
+YACC = @YACC@
+__XCONFIGFILE__ = @__XCONFIGFILE__@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_AS = @ac_ct_AS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+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@
+datadir = @datadir@
+driverdir = @driverdir@
+exec_prefix = @exec_prefix@
+extdir = @extdir@
+ft_config = @ft_config@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+logdir = @logdir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sdkdir = @sdkdir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+xglmoduledir = @xglmoduledir@
+xpconfigdir = @xpconfigdir@
+module_LTLIBRARIES = libxf8_32bpp.la
+sdk_HEADERS = cfb8_32.h
+INCLUDES = $(XORG_INCS) -I$(top_srcdir)/mfb -I$(top_srcdir)/cfb
+AM_CFLAGS = $(XORG_CFLAGS)
+libxf8_32bpp_la_LDFLAGS = -avoid-version
+libxf8_32bpp_la_SOURCES = \
+ cfbbstore.c \
+ cfbcpyarea.c \
+ cfbcpyplane.c \
+ cfbgcmisc.c \
+ cfbimage.c \
+ cfbpntwin.c \
+ cfbscrinit.c \
+ cfbwindow.c \
+ xf86overlay.c \
+ cfb8_32module.c \
+ cfbgc8.c \
+ cfbgc32.c \
+ cfbgcunder.c
+
+libxf8_32bpp_la_LIBADD = $(top_builddir)/cfb32/libcfb32.la
+EXTRA_DIST = cfbgc.c
+DISTCLEANFILES = cfbgc8.c cfbgc32.c
+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 \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/xf8_32bpp/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign hw/xfree86/xf8_32bpp/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
+install-moduleLTLIBRARIES: $(module_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(moduledir)" || $(mkdir_p) "$(DESTDIR)$(moduledir)"
+ @list='$(module_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moduledir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moduledir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-moduleLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(module_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$p"; \
+ done
+
+clean-moduleLTLIBRARIES:
+ -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES)
+ @list='$(module_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
+libxf8_32bpp.la: $(libxf8_32bpp_la_OBJECTS) $(libxf8_32bpp_la_DEPENDENCIES)
+ $(LINK) -rpath $(moduledir) $(libxf8_32bpp_la_LDFLAGS) $(libxf8_32bpp_la_OBJECTS) $(libxf8_32bpp_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfb8_32module.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbbstore.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbcpyarea.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbcpyplane.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbgc32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbgc8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbgcmisc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbgcunder.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbimage.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbpntwin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbscrinit.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfbwindow.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86overlay.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@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
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-sdkHEADERS: $(sdk_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sdkdir)" || $(mkdir_p) "$(DESTDIR)$(sdkdir)"
+ @list='$(sdk_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(sdkHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(sdkdir)/$$f'"; \
+ $(sdkHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(sdkdir)/$$f"; \
+ done
+
+uninstall-sdkHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sdk_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(sdkdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(sdkdir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && 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)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$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)$(moduledir)" "$(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 -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+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-moduleLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-moduleLTLIBRARIES install-sdkHEADERS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+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-info-am uninstall-moduleLTLIBRARIES \
+ uninstall-sdkHEADERS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-moduleLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-moduleLTLIBRARIES 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-info-am \
+ uninstall-moduleLTLIBRARIES uninstall-sdkHEADERS
+
+
+cfbgc8.c: $(srcdir)/cfbgc.c
+ echo '#define PSZ 8' > $@
+ echo '#include "$(srcdir)/cfbgc.c"' >> $@
+
+cfbgc32.c: $(srcdir)/cfbgc.c
+ echo '#define PSZ 32' > $@
+ echo '#include "$(srcdir)/cfbgc.c"' >> $@
+# 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/xserver/hw/xfree86/xf8_32bpp/cfb8_32.h b/xserver/hw/xfree86/xf8_32bpp/cfb8_32.h
new file mode 100644
index 000000000..969fa290f
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfb8_32.h
@@ -0,0 +1,227 @@
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#ifndef _CFB8_32_H
+#define _CFB8_32_H
+
+#include "gcstruct.h"
+
+typedef struct {
+ GCOps *Ops8bpp;
+ GCOps *Ops32bpp;
+ unsigned long changes;
+ Bool OpsAre8bpp;
+} cfb8_32GCRec, *cfb8_32GCPtr;
+
+typedef struct {
+ unsigned char key;
+ void (*EnableDisableFBAccess)(int scrnIndex, Bool enable);
+ pointer visualData;
+} cfb8_32ScreenRec, *cfb8_32ScreenPtr;
+
+
+extern int cfb8_32GCPrivateIndex; /* XXX */
+extern int cfb8_32GetGCPrivateIndex(void);
+extern int cfb8_32ScreenPrivateIndex; /* XXX */
+extern int cfb8_32GetScreenPrivateIndex(void);
+
+void
+cfb8_32SaveAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+);
+
+void
+cfb8_32RestoreAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+);
+
+RegionPtr
+cfb8_32CopyArea(
+ DrawablePtr pSrcDraw,
+ DrawablePtr pDstDraw,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+);
+
+void
+cfbDoBitblt8To32(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask
+);
+
+void
+cfbDoBitblt32To8(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask
+);
+
+
+void
+cfb8_32ValidateGC8(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+);
+
+void
+cfb8_32ValidateGC32(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+);
+
+void
+cfb32ValidateGC_Underlay(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+);
+
+Bool cfb8_32CreateGC(GCPtr pGC);
+
+void
+cfb8_32GetSpans(
+ DrawablePtr pDraw,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pchardstStart
+);
+
+void
+cfb8_32PutImage (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+);
+
+void
+cfb8_32GetImage (
+ DrawablePtr pDraw,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planeMask,
+ char *pdstLine
+);
+
+void
+cfb8_32PaintWindow (
+ WindowPtr pWin,
+ RegionPtr pRegion,
+ int what
+);
+
+Bool
+cfb8_32ScreenInit (
+ ScreenPtr pScreen,
+ pointer pbits,
+ int xsize, int ysize,
+ int dpix, int dpiy,
+ int width
+);
+
+void
+cfb8_32FillBoxSolid8 (
+ DrawablePtr pDraw,
+ int nbox,
+ BoxPtr pBox,
+ unsigned long color
+);
+
+
+void
+cfb8_32FillBoxSolid32 (
+ DrawablePtr pDraw,
+ int nbox,
+ BoxPtr pBox,
+ unsigned long color
+);
+
+RegionPtr
+cfb8_32CopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+);
+
+void
+cfbDoBitblt8To8GXcopy(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm
+);
+
+void
+cfbDoBitblt24To24GXcopy(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm
+);
+
+Bool cfb8_32CreateWindow(WindowPtr pWin);
+Bool cfb8_32DestroyWindow(WindowPtr pWin);
+
+Bool
+cfb8_32PositionWindow(
+ WindowPtr pWin,
+ int x, int y
+);
+
+void
+cfb8_32CopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc
+);
+
+Bool
+cfb8_32ChangeWindowAttributes(
+ WindowPtr pWin,
+ unsigned long mask
+);
+
+
+#define CFB8_32_GET_GC_PRIVATE(pGC)\
+ (cfb8_32GCPtr)((pGC)->devPrivates[cfb8_32GetGCPrivateIndex()].ptr)
+
+#define CFB8_32_GET_SCREEN_PRIVATE(pScreen)\
+ (cfb8_32ScreenPtr)((pScreen)->devPrivates[cfb8_32GetScreenPrivateIndex()].ptr)
+
+Bool xf86Overlay8Plus32Init (ScreenPtr pScreen);
+
+#endif /* _CFB8_32_H */
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfb8_32module.c b/xserver/hw/xfree86/xf8_32bpp/cfb8_32module.c
new file mode 100644
index 000000000..5afabe52d
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfb8_32module.c
@@ -0,0 +1,39 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(xf8_32bppSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "xf8_32bpp",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+_X_EXPORT XF86ModuleData xf8_32bppModuleData = {
+ &VersRec,
+ xf8_32bppSetup,
+ NULL
+};
+
+static pointer
+xf8_32bppSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ if (!LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ if (!LoadSubModule(module, "cfb32", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ return (pointer)1; /* non-NULL required to indicate success */
+}
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbbstore.c b/xserver/hw/xfree86/xf8_32bpp/cfbbstore.c
new file mode 100644
index 000000000..f4d570f8b
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbbstore.c
@@ -0,0 +1,105 @@
+
+#define PSZ 8
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include <X11/X.h>
+#include "mibstore.h"
+#include "regionstr.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+
+void
+cfb8_32SaveAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ DDXPointPtr pPt;
+ DDXPointPtr pPtsInit;
+ BoxPtr pBox;
+ int i;
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ PixmapPtr pScrPix;
+
+ if(pPixmap->drawable.bitsPerPixel == 32) {
+ cfb32SaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
+ return;
+ }
+
+ i = REGION_NUM_RECTS(prgnSave);
+ pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec));
+ if (!pPtsInit)
+ return;
+
+ pBox = REGION_RECTS(prgnSave);
+ pPt = pPtsInit;
+ while (--i >= 0) {
+ pPt->x = pBox->x1 + xorg;
+ pPt->y = pBox->y1 + yorg;
+ pPt++;
+ pBox++;
+ }
+
+ pScrPix = (PixmapPtr) pScreen->devPrivate;
+
+ cfbDoBitblt32To8((DrawablePtr) pScrPix, (DrawablePtr)pPixmap,
+ GXcopy, prgnSave, pPtsInit, ~0L);
+
+ DEALLOCATE_LOCAL (pPtsInit);
+}
+
+
+void
+cfb8_32RestoreAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ DDXPointPtr pPt;
+ DDXPointPtr pPtsInit;
+ BoxPtr pBox;
+ int i;
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ PixmapPtr pScrPix;
+
+ i = REGION_NUM_RECTS(prgnRestore);
+ pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i*sizeof(DDXPointRec));
+ if (!pPtsInit)
+ return;
+
+ pBox = REGION_RECTS(prgnRestore);
+ pPt = pPtsInit;
+ while (--i >= 0) {
+ pPt->x = pBox->x1 - xorg;
+ pPt->y = pBox->y1 - yorg;
+ pPt++;
+ pBox++;
+ }
+
+ pScrPix = (PixmapPtr) pScreen->devPrivate;
+
+ if(pPixmap->drawable.bitsPerPixel == 32) {
+ if(pWin->drawable.depth == 24)
+ cfb32DoBitbltCopy((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
+ GXcopy, prgnRestore, pPtsInit, 0x00ffffff);
+ else
+ cfb32DoBitbltCopy((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
+ GXcopy, prgnRestore, pPtsInit, ~0);
+ } else {
+ cfbDoBitblt8To32((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
+ GXcopy, prgnRestore, pPtsInit, ~0L);
+ }
+
+ DEALLOCATE_LOCAL (pPtsInit);
+}
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c b/xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c
new file mode 100644
index 000000000..c2eb1a04e
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c
@@ -0,0 +1,549 @@
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <stdlib.h>
+
+#include <X11/X.h>
+#include <X11/Xmd.h>
+#include "servermd.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "resource.h"
+#include "colormap.h"
+#include "colormapst.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mi.h"
+#include "mistruct.h"
+#include "dix.h"
+#include "mibstore.h"
+
+
+RegionPtr
+cfb8_32CopyArea(
+ DrawablePtr pSrcDraw,
+ DrawablePtr pDstDraw,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+
+ if(pSrcDraw->bitsPerPixel == 32) {
+ if(pDstDraw->bitsPerPixel == 32) {
+ if((pGC->alu == GXcopy) && (pGC->planemask == 0xff000000)) {
+ return cfb32BitBlt (pSrcDraw, pDstDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty,
+ cfbDoBitblt8To8GXcopy, 0L);
+ }
+ return(cfb32CopyArea(pSrcDraw, pDstDraw, pGC, srcx, srcy,
+ width, height, dstx, dsty));
+ } else {
+ /* have to translate 32 -> 8 copies */
+ return cfb32BitBlt (pSrcDraw, pDstDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty,
+ cfbDoBitblt32To8, 0L);
+ }
+ } else {
+ if(pDstDraw->bitsPerPixel == 32) {
+ /* have to translate 8 -> 32 copies */
+ return cfb32BitBlt (pSrcDraw, pDstDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty,
+ cfbDoBitblt8To32, 0L);
+ } else {
+ return(cfbCopyArea(pSrcDraw, pDstDraw, pGC, srcx, srcy,
+ width, height, dstx, dsty));
+ }
+ }
+}
+
+
+
+
+void
+cfbDoBitblt8To32(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm
+){
+ BoxPtr pbox = REGION_RECTS(prgnDst);
+ int nbox = REGION_NUM_RECTS(prgnDst);
+ unsigned char *ptr8, *ptr32;
+ unsigned char *data8, *data32;
+ int pitch8, pitch32;
+ int height, width, i;
+
+ cfbGetByteWidthAndPointer(pSrc, pitch8, ptr8);
+ cfbGetByteWidthAndPointer(pDst, pitch32, ptr32);
+ ptr32 += 3; /* point to the top byte */
+
+ pm >>= 24;
+
+ if((pm == 0xff) && (rop == GXcopy)) {
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ data8 = ptr8 + (pptSrc->y * pitch8) + pptSrc->x;
+ data32 = ptr32 + (pbox->y1 * pitch32) + (pbox->x1 << 2);
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ for(i = 0; i < width; i++)
+ data32[i << 2] = data8[i];
+ data8 += pitch8;
+ data32 += pitch32;
+ }
+ }
+ } else { /* it ain't pretty, but hey */
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ data8 = ptr8 + (pptSrc->y * pitch8) + pptSrc->x;
+ data32 = ptr32 + (pbox->y1 * pitch32) + (pbox->x1 << 2);
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ switch(rop) {
+ case GXcopy:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = (data8[i] & pm) | (data32[i<<2] & ~pm);
+ break;
+ case GXor:
+ for(i = 0; i < width; i++)
+ data32[i<<2] |= data8[i] & pm;
+ break;
+ case GXclear:
+ for(i = 0; i < width; i++)
+ data32[i<<2] &= ~pm;
+ break;
+ case GXand:
+ for(i = 0; i < width; i++)
+ data32[i<<2] &= data8[i] | ~pm;
+ break;
+ case GXandReverse:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~data32[i<<2] & (data8[i] | ~pm);
+ break;
+ case GXandInverted:
+ for(i = 0; i < width; i++)
+ data32[i<<2] &= ~data8[i] | ~pm;
+ break;
+ case GXnoop:
+ return;
+ case GXxor:
+ for(i = 0; i < width; i++)
+ data32[i<<2] ^= data8[i] & pm;
+ break;
+ case GXnor:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~(data32[i<<2] | (data8[i] & pm));
+ break;
+ case GXequiv:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~(data32[i<<2] ^ (data8[i] & pm));
+ break;
+ case GXinvert:
+ for(i = 0; i < width; i++)
+ data32[i<<2] ^= pm;
+ break;
+ case GXorReverse:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~data32[i<<2] | (data8[i] & pm);
+ break;
+ case GXcopyInverted:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = (~data8[i] & pm) | (data32[i<<2] & ~pm);
+ break;
+ case GXorInverted:
+ for(i = 0; i < width; i++)
+ data32[i<<2] |= ~data8[i] & pm;
+ break;
+ case GXnand:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~(data32[i<<2] & (data8[i] | ~pm));
+ break;
+ case GXset:
+ for(i = 0; i < width; i++)
+ data32[i<<2] |= pm;
+ break;
+ }
+ data8 += pitch8;
+ data32 += pitch32;
+ }
+ }
+ }
+}
+
+
+void
+cfbDoBitblt32To8(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm
+){
+ BoxPtr pbox = REGION_RECTS(prgnDst);
+ int nbox = REGION_NUM_RECTS(prgnDst);
+ unsigned char *ptr8, *ptr32;
+ unsigned char *data8, *data32;
+ int pitch8, pitch32;
+ int height, width, i;
+
+ cfbGetByteWidthAndPointer(pDst, pitch8, ptr8);
+ cfbGetByteWidthAndPointer(pSrc, pitch32, ptr32);
+ ptr32 += 3; /* point to the top byte */
+
+ if(((pm & 0xff) == 0xff) && (rop == GXcopy)) {
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ data8 = ptr8 + (pbox->y1 * pitch8) + pbox->x1;
+ data32 = ptr32 + (pptSrc->y * pitch32) + (pptSrc->x << 2);
+
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ for(i = 0; i < width; i++)
+ data8[i] = data32[i << 2];
+ data8 += pitch8;
+ data32 += pitch32;
+ }
+ }
+ } else {
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ data8 = ptr8 + (pbox->y1 * pitch8) + pbox->x1;
+ data32 = ptr32 + (pptSrc->y * pitch32) + (pptSrc->x << 2);
+
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ switch(rop) {
+ case GXcopy:
+ for(i = 0; i < width; i++)
+ data8[i] = (data32[i<<2] & pm) | (data8[i] & ~pm);
+ break;
+ case GXor:
+ for(i = 0; i < width; i++)
+ data8[i] |= data32[i<<2] & pm;
+ break;
+ case GXclear:
+ for(i = 0; i < width; i++)
+ data8[i] &= ~pm;
+ break;
+ case GXand:
+ for(i = 0; i < width; i++)
+ data8[i] &= data32[i<<2] | ~pm;
+ break;
+ case GXandReverse:
+ for(i = 0; i < width; i++)
+ data8[i] = ~data8[i] & (data32[i<<2] | ~pm);
+ break;
+ case GXandInverted:
+ for(i = 0; i < width; i++)
+ data8[i] &= ~data32[i<<2] | ~pm;
+ break;
+ case GXnoop:
+ return;
+ case GXxor:
+ for(i = 0; i < width; i++)
+ data8[i] ^= data32[i<<2] & pm;
+ break;
+ case GXnor:
+ for(i = 0; i < width; i++)
+ data8[i] = ~(data8[i] | (data32[i<<2] & pm));
+ break;
+ case GXequiv:
+ for(i = 0; i < width; i++)
+ data8[i] = ~(data8[i] ^ (data32[i<<2] & pm));
+ break;
+ case GXinvert:
+ for(i = 0; i < width; i++)
+ data8[i] ^= pm;
+ break;
+ case GXorReverse:
+ for(i = 0; i < width; i++)
+ data8[i] = ~data8[i] | (data32[i<<2] & pm);
+ break;
+ case GXcopyInverted:
+ for(i = 0; i < width; i++)
+ data8[i] = (~data32[i<<2] & pm) | (data8[i] & ~pm);
+ break;
+ case GXorInverted:
+ for(i = 0; i < width; i++)
+ data8[i] |= ~data32[i<<2] & pm;
+ break;
+ case GXnand:
+ for(i = 0; i < width; i++)
+ data8[i] = ~(data8[i] & (data32[i<<2] | ~pm));
+ break;
+ case GXset:
+ for(i = 0; i < width; i++)
+ data8[i] |= pm;
+ break;
+ }
+ data8 += pitch8;
+ data32 += pitch32;
+ }
+ }
+ }
+}
+
+
+
+static void
+Do8To8Blt(
+ unsigned char *SrcPtr,
+ int SrcPitch,
+ unsigned char *DstPtr,
+ int DstPitch,
+ int nbox,
+ DDXPointPtr pptSrc,
+ BoxPtr pbox,
+ int xdir, int ydir
+){
+ int i, j, width, height, ydir2;
+ CARD8 *src, *dst;
+
+ SrcPtr += 3;
+ DstPtr += 3;
+ xdir *= 4;
+ ydir2 = ydir * DstPitch;
+ ydir *= SrcPitch;
+
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ src = SrcPtr + (pptSrc->y * SrcPitch) + (pptSrc->x << 2);
+ dst = DstPtr + (pbox->y1 * DstPitch) + (pbox->x1 << 2);
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ if(ydir < 0) {
+ src += (height - 1) * SrcPitch;
+ dst += (height - 1) * DstPitch;
+ }
+
+ if(xdir < 0) {
+ register int tmp = (width - 1) << 2;
+ src += tmp;
+ dst += tmp;
+ }
+
+ while(height--) {
+ for(i = width, j = 0; i--; j+=xdir)
+ dst[j] = src[j];
+ src += ydir;
+ dst += ydir2;
+ }
+ }
+}
+
+static void
+Do24To24Blt(
+ unsigned char *SrcPtr,
+ int SrcPitch,
+ unsigned char *DstPtr,
+ int DstPitch,
+ int nbox,
+ DDXPointPtr pptSrc,
+ BoxPtr pbox,
+ int xdir, int ydir
+){
+ int i, j, width, height, ydir2;
+ CARD8 *src, *dst;
+
+ xdir *= 4;
+ ydir2 = ydir * DstPitch;
+ ydir *= SrcPitch;
+
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ src = SrcPtr + (pptSrc->y * SrcPitch) + (pptSrc->x << 2);
+ dst = DstPtr + (pbox->y1 * DstPitch) + (pbox->x1 << 2);
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ if(ydir < 0) {
+ src += (height - 1) * SrcPitch;
+ dst += (height - 1) * DstPitch;
+ }
+
+ if(xdir < 0) {
+ register int tmp = (width - 1) << 2;
+ src += tmp;
+ dst += tmp;
+ }
+
+ while(height--) {
+ for(i = width, j = 0; i--; j+=xdir) {
+ *((CARD16*)(dst + j)) = *((CARD32*)(src + j));
+ dst[j + 2] = src[j + 2];
+ }
+ src += ydir;
+ dst += ydir2;
+ }
+ }
+}
+
+
+static void
+cfb8_32DoBitBlt(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ void (*DoBlt)(
+ unsigned char *SrcPtr,
+ int SrcPitch,
+ unsigned char *DstPtr,
+ int DstPitch,
+ int nbox,
+ DDXPointPtr pptSrc,
+ BoxPtr pbox,
+ int xdir, int ydir)
+){
+ int nbox, careful, SrcPitch, DstPitch;
+ BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
+ DDXPointPtr pptTmp, pptNew1, pptNew2;
+ int xdir, ydir;
+ unsigned char *SrcPtr, *DstPtr;
+
+ /* XXX we have to err on the side of safety when both are windows,
+ * because we don't know if IncludeInferiors is being used.
+ */
+ careful = ((pSrc == pDst) ||
+ ((pSrc->type == DRAWABLE_WINDOW) &&
+ (pDst->type == DRAWABLE_WINDOW)));
+
+ pbox = REGION_RECTS(prgnDst);
+ nbox = REGION_NUM_RECTS(prgnDst);
+
+ pboxNew1 = NULL;
+ pptNew1 = NULL;
+ pboxNew2 = NULL;
+ pptNew2 = NULL;
+ if (careful && (pptSrc->y < pbox->y1)) {
+ /* walk source botttom to top */
+ ydir = -1;
+
+ if (nbox > 1) {
+ /* keep ordering in each band, reverse order of bands */
+ pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ if(!pboxNew1)
+ return;
+ pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
+ if(!pptNew1) {
+ DEALLOCATE_LOCAL(pboxNew1);
+ return;
+ }
+ pboxBase = pboxNext = pbox+nbox-1;
+ while (pboxBase >= pbox) {
+ while ((pboxNext >= pbox) &&
+ (pboxBase->y1 == pboxNext->y1))
+ pboxNext--;
+ pboxTmp = pboxNext+1;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp <= pboxBase) {
+ *pboxNew1++ = *pboxTmp++;
+ *pptNew1++ = *pptTmp++;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew1 -= nbox;
+ pbox = pboxNew1;
+ pptNew1 -= nbox;
+ pptSrc = pptNew1;
+ }
+ } else {
+ /* walk source top to bottom */
+ ydir = 1;
+ }
+
+ if (careful && (pptSrc->x < pbox->x1)) {
+ /* walk source right to left */
+ xdir = -1;
+
+ if (nbox > 1) {
+ /* reverse order of rects in each band */
+ pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
+ if(!pboxNew2 || !pptNew2) {
+ if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
+ if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
+ if (pboxNew1) {
+ DEALLOCATE_LOCAL(pptNew1);
+ DEALLOCATE_LOCAL(pboxNew1);
+ }
+ return;
+ }
+ pboxBase = pboxNext = pbox;
+ while (pboxBase < pbox+nbox) {
+ while ((pboxNext < pbox+nbox) &&
+ (pboxNext->y1 == pboxBase->y1))
+ pboxNext++;
+ pboxTmp = pboxNext;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp != pboxBase) {
+ *pboxNew2++ = *--pboxTmp;
+ *pptNew2++ = *--pptTmp;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew2 -= nbox;
+ pbox = pboxNew2;
+ pptNew2 -= nbox;
+ pptSrc = pptNew2;
+ }
+ } else {
+ /* walk source left to right */
+ xdir = 1;
+ }
+
+ cfbGetByteWidthAndPointer(pSrc, SrcPitch, SrcPtr);
+ cfbGetByteWidthAndPointer(pDst, DstPitch, DstPtr);
+
+ (*DoBlt)(SrcPtr,SrcPitch,DstPtr,DstPitch,nbox,pptSrc,pbox,xdir,ydir);
+
+ if (pboxNew2) {
+ DEALLOCATE_LOCAL(pptNew2);
+ DEALLOCATE_LOCAL(pboxNew2);
+ }
+ if (pboxNew1) {
+ DEALLOCATE_LOCAL(pptNew1);
+ DEALLOCATE_LOCAL(pboxNew1);
+ }
+
+}
+
+
+/* A couple routines to speed up full planemask copies */
+
+void
+cfbDoBitblt8To8GXcopy(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm
+){
+ cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do8To8Blt);
+}
+
+
+void
+cfbDoBitblt24To24GXcopy(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm
+){
+ cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do24To24Blt);
+}
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbcpyplane.c b/xserver/hw/xfree86/xf8_32bpp/cfbcpyplane.c
new file mode 100644
index 000000000..011b9e763
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbcpyplane.c
@@ -0,0 +1,43 @@
+/* $XFree86$ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xmd.h>
+#include <X11/Xproto.h>
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "regionstr.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mi.h"
+
+
+RegionPtr
+cfb8_32CopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ /* There's actually much more to it than this */
+
+ if((pDst->bitsPerPixel == 8) && (pSrc->bitsPerPixel != 32)){
+ return(cfbCopyPlane(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane));
+ }
+
+
+ return(miCopyPlane (pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane));
+}
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbgc.c b/xserver/hw/xfree86/xf8_32bpp/cfbgc.c
new file mode 100644
index 000000000..a7787caa9
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbgc.c
@@ -0,0 +1,646 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+
+/*
+
+PSZ 8 16 24 32
+PIXEL_ADDR True True True True
+NO_ONE_RECT False False False False
+WriteBitGroup True True True True
+FOUR_BIT_CODE True False False False
+LOWMEMFTPT False False False False
+
+*/
+
+
+/* This gets built twice. Once for 8bpp and another for 32bpp */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xmd.h>
+#include <X11/Xproto.h>
+#include "cfb.h"
+#include <X11/fonts/fontstruct.h>
+#include "dixfontstr.h"
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include "region.h"
+
+#include "mistruct.h"
+#include "mibstore.h"
+#include "migc.h"
+#include "mioverlay.h"
+
+#include "cfb8_32.h"
+#include "cfbmskbits.h"
+#include "cfb8bit.h"
+
+
+#if PSZ == 8
+# define useTEGlyphBlt cfbTEGlyphBlt8
+#else
+# ifdef WriteBitGroup
+# define useTEGlyphBlt cfbImageGlyphBlt8
+# else
+# define useTEGlyphBlt cfbTEGlyphBlt
+# endif
+#endif
+
+#ifdef WriteBitGroup
+# define useImageGlyphBlt cfbImageGlyphBlt8
+# define usePolyGlyphBlt cfbPolyGlyphBlt8
+#else
+# define useImageGlyphBlt miImageGlyphBlt
+# define usePolyGlyphBlt miPolyGlyphBlt
+#endif
+
+#ifdef FOUR_BIT_CODE
+# define usePushPixels cfbPushPixels8
+#else
+# define usePushPixels mfbPushPixels
+#endif
+
+#ifdef PIXEL_ADDR
+# define ZeroPolyArc cfbZeroPolyArcSS8Copy
+#else
+# define ZeroPolyArc miZeroPolyArc
+#endif
+
+
+static GCOps cfb8_32TEOps1Rect = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfb8_32PutImage,
+ cfb8_32CopyArea,
+ cfb8_32CopyPlane,
+ cfbPolyPoint,
+#ifdef PIXEL_ADDR
+ cfb8LineSS1Rect,
+ cfb8SegmentSS1Rect,
+#else
+ cfbLineSS,
+ cfbSegmentSS,
+#endif
+ miPolyRectangle,
+ ZeroPolyArc,
+ cfbFillPoly1RectCopy,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useTEGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+};
+
+static GCOps cfb8_32NonTEOps1Rect = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfb8_32PutImage,
+ cfb8_32CopyArea,
+ cfb8_32CopyPlane,
+ cfbPolyPoint,
+#ifdef PIXEL_ADDR
+ cfb8LineSS1Rect,
+ cfb8SegmentSS1Rect,
+#else
+ cfbLineSS,
+ cfbSegmentSS,
+#endif
+ miPolyRectangle,
+ ZeroPolyArc,
+ cfbFillPoly1RectCopy,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useImageGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+};
+
+static GCOps cfb8_32TEOps = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfb8_32PutImage,
+ cfb8_32CopyArea,
+ cfb8_32CopyPlane,
+ cfbPolyPoint,
+ cfbLineSS,
+ cfbSegmentSS,
+ miPolyRectangle,
+ ZeroPolyArc,
+ miFillPolygon,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useTEGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+};
+
+static GCOps cfb8_32NonTEOps = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfb8_32PutImage,
+ cfb8_32CopyArea,
+ cfb8_32CopyPlane,
+ cfbPolyPoint,
+ cfbLineSS,
+ cfbSegmentSS,
+ miPolyRectangle,
+#ifdef PIXEL_ADDR
+ cfbZeroPolyArcSS8Copy,
+#else
+ miZeroPolyArc,
+#endif
+ miFillPolygon,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useImageGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+};
+
+static GCOps *
+cfb8_32MatchCommon (GCPtr pGC, cfbPrivGCPtr devPriv)
+{
+ if (pGC->lineWidth != 0)
+ return 0;
+ if (pGC->lineStyle != LineSolid)
+ return 0;
+ if (pGC->fillStyle != FillSolid)
+ return 0;
+ if (devPriv->rop != GXcopy)
+ return 0;
+ if (pGC->font &&
+ FONTMAXBOUNDS(pGC->font,rightSideBearing) -
+ FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 &&
+ FONTMINBOUNDS(pGC->font,characterWidth) >= 0)
+ {
+ if (TERMINALFONT(pGC->font)
+#ifdef FOUR_BIT_CODE
+ && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
+#endif
+ )
+#ifdef NO_ONE_RECT
+ return &cfb8_32TEOps1Rect;
+#else
+ if (devPriv->oneRect)
+ return &cfb8_32TEOps1Rect;
+ else
+ return &cfb8_32TEOps;
+#endif
+ else
+#ifdef NO_ONE_RECT
+ return &cfb8_32NonTEOps1Rect;
+#else
+ if (devPriv->oneRect)
+ return &cfb8_32NonTEOps1Rect;
+ else
+ return &cfb8_32NonTEOps;
+#endif
+ }
+ return 0;
+}
+
+
+/* Clipping conventions
+ if the drawable is a window
+ CT_REGION ==> pCompositeClip really is the composite
+ CT_other ==> pCompositeClip is the window clip region
+ if the drawable is a pixmap
+ CT_REGION ==> pCompositeClip is the translated client region
+ clipped to the pixmap boundary
+ CT_other ==> pCompositeClip is the pixmap bounding box
+*/
+
+void
+#if PSZ == 8
+cfb8_32ValidateGC8(
+#else
+cfb8_32ValidateGC32(
+#endif
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+){
+ int mask; /* stateChanges */
+ int index; /* used for stepping through bitfields */
+ int new_rrop;
+ int new_line, new_text, new_fillspans, new_fillarea;
+ /* flags for changing the proc vector */
+ cfbPrivGCPtr devPriv;
+ int oneRect;
+
+ pGC->lastWinOrg.x = pDrawable->x;
+ pGC->lastWinOrg.y = pDrawable->y;
+ devPriv = cfbGetGCPrivate(pGC);
+
+ new_rrop = FALSE;
+ new_line = FALSE;
+ new_text = FALSE;
+ new_fillspans = FALSE;
+ new_fillarea = FALSE;
+
+ /*
+ * if the client clip is different or moved OR the subwindowMode has
+ * changed OR the window's clip has changed since the last validation
+ * we need to recompute the composite clip
+ */
+
+ if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
+ (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)))
+ {
+ miComputeCompositeClip (pGC, pDrawable);
+#ifdef NO_ONE_RECT
+ devPriv->oneRect = FALSE;
+#else
+ oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1;
+ if (oneRect != devPriv->oneRect)
+ new_line = TRUE;
+ devPriv->oneRect = oneRect;
+#endif
+ }
+
+ mask = changes;
+ while (mask) {
+ index = lowbit (mask);
+ mask &= ~index;
+
+ switch (index) {
+ case GCFunction:
+ case GCForeground:
+ new_rrop = TRUE;
+ break;
+ case GCPlaneMask:
+ new_rrop = TRUE;
+ new_text = TRUE;
+ break;
+ case GCBackground:
+ break;
+ case GCLineStyle:
+ case GCLineWidth:
+ new_line = TRUE;
+ break;
+ case GCJoinStyle:
+ case GCCapStyle:
+ break;
+ case GCFillStyle:
+ new_text = TRUE;
+ new_fillspans = TRUE;
+ new_line = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCFillRule:
+ break;
+ case GCTile:
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCStipple:
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCTileStipXOrigin:
+ case GCTileStipYOrigin:
+ break;
+ case GCFont:
+ new_text = TRUE;
+ break;
+ case GCSubwindowMode:
+ case GCGraphicsExposures:
+ case GCClipXOrigin:
+ case GCClipYOrigin:
+ case GCClipMask:
+ case GCDashOffset:
+ case GCDashList:
+ case GCArcMode:
+ default:
+ break;
+ }
+ }
+
+ /*
+ * If the drawable has changed, ensure suitable
+ * entries are in the proc vector.
+ */
+ if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS)))
+ new_fillspans = TRUE; /* deal with FillSpans later */
+
+ if (new_rrop)
+ {
+ int old_rrop;
+
+ old_rrop = devPriv->rop;
+ devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel,
+ pGC->planemask,
+ &devPriv->and, &devPriv->xor);
+ if (old_rrop == devPriv->rop)
+ new_rrop = FALSE;
+ else
+ {
+#ifdef PIXEL_ADDR
+ new_line = TRUE;
+#endif
+#ifdef WriteBitGroup
+ new_text = TRUE;
+#endif
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ }
+ }
+
+ if(!pGC->ops)
+ pGC->ops = & cfb8_32NonTEOps;
+
+ if (new_rrop || new_fillspans || new_text || new_fillarea || new_line)
+ {
+ GCOps *newops;
+
+ if ((newops = cfb8_32MatchCommon (pGC, devPriv)))
+ {
+ if (pGC->ops->devPrivate.val)
+ miDestroyGCOps (pGC->ops);
+ pGC->ops = newops;
+ new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0;
+ }
+ else
+ {
+ if (!pGC->ops->devPrivate.val)
+ {
+ pGC->ops = miCreateGCOps (pGC->ops);
+ pGC->ops->devPrivate.val = 1;
+ }
+ }
+ }
+
+ /* deal with the changes we've collected */
+ if (new_line)
+ {
+ pGC->ops->FillPolygon = miFillPolygon;
+#ifdef NO_ONE_RECT
+ if (pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
+ break;
+ default:
+ pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
+ break;
+ }
+ }
+#else
+ if (devPriv->oneRect && pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
+ break;
+ default:
+ pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
+ break;
+ }
+ }
+#endif
+ if (pGC->lineWidth == 0)
+ {
+#ifdef PIXEL_ADDR
+ if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
+ {
+ switch (devPriv->rop)
+ {
+ case GXxor:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor;
+ break;
+ case GXcopy:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy;
+ break;
+ default:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8General;
+ break;
+ }
+ }
+ else
+#endif
+ pGC->ops->PolyArc = miZeroPolyArc;
+ }
+ else
+ pGC->ops->PolyArc = miPolyArc;
+ pGC->ops->PolySegment = miPolySegment;
+ switch (pGC->lineStyle)
+ {
+ case LineSolid:
+ if(pGC->lineWidth == 0)
+ {
+ if (pGC->fillStyle == FillSolid)
+ {
+#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT)
+ if (devPriv->oneRect &&
+ ((pDrawable->x >= pGC->pScreen->width - 32768) &&
+ (pDrawable->y >= pGC->pScreen->height - 32768)))
+ {
+ pGC->ops->Polylines = cfb8LineSS1Rect;
+ pGC->ops->PolySegment = cfb8SegmentSS1Rect;
+ } else
+#endif
+#ifdef NO_ONE_RECT
+ {
+ pGC->ops->Polylines = cfb8LineSS1Rect;
+ pGC->ops->PolySegment = cfb8SegmentSS1Rect;
+ }
+#else
+ {
+ pGC->ops->Polylines = cfbLineSS;
+ pGC->ops->PolySegment = cfbSegmentSS;
+ }
+#endif
+ }
+ else
+ pGC->ops->Polylines = miZeroLine;
+ }
+ else
+ pGC->ops->Polylines = miWideLine;
+ break;
+ case LineOnOffDash:
+ case LineDoubleDash:
+ if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
+ {
+ pGC->ops->Polylines = cfbLineSD;
+ pGC->ops->PolySegment = cfbSegmentSD;
+ } else
+ pGC->ops->Polylines = miWideDash;
+ break;
+ }
+ }
+
+ if (new_text && (pGC->font))
+ {
+ if (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
+ FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
+ FONTMINBOUNDS(pGC->font,characterWidth) < 0)
+ {
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+ pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
+ }
+ else
+ {
+#ifdef WriteBitGroup
+ if (pGC->fillStyle == FillSolid)
+ {
+ if (devPriv->rop == GXcopy)
+ pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8;
+ else
+#ifdef FOUR_BIT_CODE
+ pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8;
+#else
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+#endif
+ }
+ else
+#endif
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+ /* special case ImageGlyphBlt for terminal emulator fonts */
+#if !defined(WriteBitGroup) || PSZ == 8
+ if (TERMINALFONT(pGC->font) &&
+ (pGC->planemask & PMSK) == PMSK
+#ifdef FOUR_BIT_CODE
+ && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
+#endif
+ )
+ {
+ pGC->ops->ImageGlyphBlt = useTEGlyphBlt;
+ }
+ else
+#endif
+ {
+#ifdef WriteBitGroup
+ if (devPriv->rop == GXcopy &&
+ pGC->fillStyle == FillSolid &&
+ (pGC->planemask & PMSK) == PMSK)
+ pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8;
+ else
+#endif
+ pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
+ }
+ }
+ }
+
+
+ if (new_fillspans) {
+ switch (pGC->fillStyle) {
+ case FillSolid:
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillSpans = cfbSolidSpansCopy;
+ break;
+ case GXxor:
+ pGC->ops->FillSpans = cfbSolidSpansXor;
+ break;
+ default:
+ pGC->ops->FillSpans = cfbSolidSpansGeneral;
+ break;
+ }
+ break;
+ case FillTiled:
+ pGC->ops->FillSpans = cfbUnnaturalTileFS;
+ break;
+ case FillStippled:
+ case FillOpaqueStippled:
+ pGC->ops->FillSpans = cfbUnnaturalStippleFS;
+ break;
+ default:
+ FatalError("cfbValidateGC: illegal fillStyle\n");
+ }
+ } /* end of new_fillspans */
+
+ if (new_fillarea) {
+#ifndef FOUR_BIT_CODE
+ pGC->ops->PolyFillRect = miPolyFillRect;
+ if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled)
+ {
+ pGC->ops->PolyFillRect = cfbPolyFillRect;
+ }
+#endif
+#ifdef FOUR_BIT_CODE
+ pGC->ops->PushPixels = mfbPushPixels;
+ if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy)
+ pGC->ops->PushPixels = cfbPushPixels8;
+#endif
+ pGC->ops->PolyFillArc = miPolyFillArc;
+ if (pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop)
+ {
+ case GXcopy:
+ pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
+ break;
+ default:
+ pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral;
+ break;
+ }
+ }
+ }
+}
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbgc32.c b/xserver/hw/xfree86/xf8_32bpp/cfbgc32.c
new file mode 100644
index 000000000..61a97b97b
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbgc32.c
@@ -0,0 +1,2 @@
+#define PSZ 32
+#include "./cfbgc.c"
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbgc8.c b/xserver/hw/xfree86/xf8_32bpp/cfbgc8.c
new file mode 100644
index 000000000..53e4f95e4
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbgc8.c
@@ -0,0 +1,2 @@
+#define PSZ 8
+#include "./cfbgc.c"
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbgcmisc.c b/xserver/hw/xfree86/xf8_32bpp/cfbgcmisc.c
new file mode 100644
index 000000000..3d1af095a
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbgcmisc.c
@@ -0,0 +1,152 @@
+/* $XFree86$ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <stdlib.h>
+
+#include <X11/X.h>
+#include <X11/Xmd.h>
+#include <X11/Xproto.h>
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include <X11/fonts/fontstruct.h>
+#include "dixfontstr.h"
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include "region.h"
+
+#include "mistruct.h"
+#include "mibstore.h"
+#include "migc.h"
+
+
+static void cfb8_32ValidateGC(GCPtr, unsigned long, DrawablePtr);
+static void cfb8_32DestroyGC(GCPtr pGC);
+static void cfb32DestroyGC_Underlay(GCPtr pGC);
+
+static
+GCFuncs cfb8_32GCFuncs = {
+ cfb8_32ValidateGC,
+ miChangeGC,
+ miCopyGC,
+ cfb8_32DestroyGC,
+ miChangeClip,
+ miDestroyClip,
+ miCopyClip,
+};
+
+
+static
+GCFuncs cfb32GCFuncs_Underlay = {
+ cfb32ValidateGC_Underlay,
+ miChangeGC,
+ miCopyGC,
+ cfb32DestroyGC_Underlay,
+ miChangeClip,
+ miDestroyClip,
+ miCopyClip,
+};
+
+static void
+cfb32DestroyGC_Underlay(GCPtr pGC)
+{
+ if (pGC->freeCompClip)
+ REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
+
+ if(pGC->ops)
+ miDestroyGCOps(pGC->ops);
+}
+
+
+static void
+cfb8_32DestroyGC(GCPtr pGC)
+{
+ cfb8_32GCPtr pGCPriv = CFB8_32_GET_GC_PRIVATE(pGC);
+
+ if (pGC->freeCompClip)
+ REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
+ if(pGCPriv->Ops8bpp)
+ miDestroyGCOps(pGCPriv->Ops8bpp);
+ if(pGCPriv->Ops32bpp)
+ miDestroyGCOps(pGCPriv->Ops32bpp);
+}
+
+Bool
+cfb8_32CreateGC(GCPtr pGC)
+{
+ cfb8_32GCPtr pGCPriv;
+ cfbPrivGC *pPriv;
+
+ if (PixmapWidthPaddingInfo[pGC->depth].padPixelsLog2 == LOG2_BITMAP_PAD)
+ return (mfbCreateGC(pGC));
+
+ pGC->clientClip = NULL;
+ pGC->clientClipType = CT_NONE;
+ pGC->miTranslate = 1;
+ pGC->fExpose = TRUE;
+ pGC->freeCompClip = FALSE;
+ pGC->pRotatedPixmap = (PixmapPtr) NULL;
+
+ pPriv = cfbGetGCPrivate(pGC);
+ pPriv->rop = pGC->alu;
+ pPriv->oneRect = FALSE;
+
+ pGC->ops = NULL;
+
+ if (pGC->depth == 8) {
+ pGC->funcs = &cfb8_32GCFuncs;
+
+ pGCPriv = CFB8_32_GET_GC_PRIVATE(pGC);
+ pGCPriv->Ops8bpp = NULL;
+ pGCPriv->Ops32bpp = NULL;
+ pGCPriv->OpsAre8bpp = FALSE;
+ pGCPriv->changes = 0;
+ } else
+ pGC->funcs = &cfb32GCFuncs_Underlay;
+
+ return TRUE;
+}
+
+
+static void
+cfb8_32ValidateGC(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+){
+ cfb8_32GCPtr pGCPriv = CFB8_32_GET_GC_PRIVATE(pGC);
+
+ if(pDraw->bitsPerPixel == 32) {
+ if(pGCPriv->OpsAre8bpp) {
+ int origChanges = changes;
+ pGC->ops = pGCPriv->Ops32bpp;
+ changes |= pGCPriv->changes;
+ pGCPriv->changes = origChanges;
+ pGCPriv->OpsAre8bpp = FALSE;
+ } else
+ pGCPriv->changes |= changes;
+
+ cfb8_32ValidateGC32(pGC, changes, pDraw);
+ pGCPriv->Ops32bpp = pGC->ops;
+ } else { /* bitsPerPixel == 8 */
+ if(!pGCPriv->OpsAre8bpp) {
+ int origChanges = changes;
+ pGC->ops = pGCPriv->Ops8bpp;
+ changes |= pGCPriv->changes;
+ pGCPriv->changes = origChanges;
+ pGCPriv->OpsAre8bpp = TRUE;
+ } else
+ pGCPriv->changes |= changes;
+
+ cfb8_32ValidateGC8(pGC, changes, pDraw);
+ pGCPriv->Ops8bpp = pGC->ops;
+ }
+}
+
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c b/xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c
new file mode 100644
index 000000000..d90321355
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c
@@ -0,0 +1,620 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+#define PSZ 32
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xmd.h>
+#include <X11/Xproto.h>
+#include "cfb.h"
+#include <X11/fonts/fontstruct.h>
+#include "dixfontstr.h"
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include "region.h"
+
+#include "mistruct.h"
+#include "mibstore.h"
+#include "migc.h"
+#include "mioverlay.h"
+
+#include "cfbmskbits.h"
+#include "cfb8bit.h"
+#include "cfb8_32.h"
+
+#ifdef WriteBitGroup
+# define useTEGlyphBlt cfbImageGlyphBlt8
+#else
+# define useTEGlyphBlt cfbTEGlyphBlt
+#endif
+
+#ifdef WriteBitGroup
+# define useImageGlyphBlt cfbImageGlyphBlt8
+# define usePolyGlyphBlt cfbPolyGlyphBlt8
+#else
+# define useImageGlyphBlt miImageGlyphBlt
+# define usePolyGlyphBlt miPolyGlyphBlt
+#endif
+
+#ifdef FOUR_BIT_CODE
+# define usePushPixels cfbPushPixels8
+#else
+# define usePushPixels mfbPushPixels
+#endif
+
+#ifdef PIXEL_ADDR
+# define ZeroPolyArc cfbZeroPolyArcSS8Copy
+#else
+# define ZeroPolyArc miZeroPolyArc
+#endif
+
+
+static GCOps cfbTEOps1Rect = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfbPutImage,
+ cfbCopyArea,
+ cfbCopyPlane,
+ cfbPolyPoint,
+#ifdef PIXEL_ADDR
+ cfb8LineSS1Rect,
+ cfb8SegmentSS1Rect,
+#else
+ cfbLineSS,
+ cfbSegmentSS,
+#endif
+ miPolyRectangle,
+ ZeroPolyArc,
+ cfbFillPoly1RectCopy,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useTEGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+};
+
+static GCOps cfbNonTEOps1Rect = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfbPutImage,
+ cfbCopyArea,
+ cfbCopyPlane,
+ cfbPolyPoint,
+#ifdef PIXEL_ADDR
+ cfb8LineSS1Rect,
+ cfb8SegmentSS1Rect,
+#else
+ cfbLineSS,
+ cfbSegmentSS,
+#endif
+ miPolyRectangle,
+ ZeroPolyArc,
+ cfbFillPoly1RectCopy,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useImageGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+};
+
+static GCOps cfbTEOps = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfbPutImage,
+ cfbCopyArea,
+ cfbCopyPlane,
+ cfbPolyPoint,
+ cfbLineSS,
+ cfbSegmentSS,
+ miPolyRectangle,
+ ZeroPolyArc,
+ miFillPolygon,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useTEGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+};
+
+static GCOps cfbNonTEOps = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfbPutImage,
+ cfbCopyArea,
+ cfbCopyPlane,
+ cfbPolyPoint,
+ cfbLineSS,
+ cfbSegmentSS,
+ miPolyRectangle,
+#ifdef PIXEL_ADDR
+ cfbZeroPolyArcSS8Copy,
+#else
+ miZeroPolyArc,
+#endif
+ miFillPolygon,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useImageGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+};
+
+static GCOps *
+cfb32MatchCommon_Underlay(
+ GCPtr pGC,
+ cfbPrivGCPtr devPriv)
+{
+ if (pGC->lineWidth != 0)
+ return 0;
+ if (pGC->lineStyle != LineSolid)
+ return 0;
+ if (pGC->fillStyle != FillSolid)
+ return 0;
+ if (devPriv->rop != GXcopy)
+ return 0;
+ if (pGC->font &&
+ FONTMAXBOUNDS(pGC->font,rightSideBearing) -
+ FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 &&
+ FONTMINBOUNDS(pGC->font,characterWidth) >= 0)
+ {
+ if (TERMINALFONT(pGC->font)
+#ifdef FOUR_BIT_CODE
+ && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
+#endif
+ )
+#ifdef NO_ONE_RECT
+ return &cfbTEOps1Rect;
+#else
+ if (devPriv->oneRect)
+ return &cfbTEOps1Rect;
+ else
+ return &cfbTEOps;
+#endif
+ else
+#ifdef NO_ONE_RECT
+ return &cfbNonTEOps1Rect;
+#else
+ if (devPriv->oneRect)
+ return &cfbNonTEOps1Rect;
+ else
+ return &cfbNonTEOps;
+#endif
+ }
+ return 0;
+}
+
+
+void
+cfb32ValidateGC_Underlay(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+){
+ int mask; /* stateChanges */
+ int index; /* used for stepping through bitfields */
+ int new_rrop;
+ int new_line, new_text, new_fillspans, new_fillarea;
+ /* flags for changing the proc vector */
+ cfbPrivGCPtr devPriv;
+ int oneRect;
+
+ pGC->lastWinOrg.x = pDrawable->x;
+ pGC->lastWinOrg.y = pDrawable->y;
+ devPriv = cfbGetGCPrivate(pGC);
+
+ new_rrop = FALSE;
+ new_line = FALSE;
+ new_text = FALSE;
+ new_fillspans = FALSE;
+ new_fillarea = FALSE;
+
+ /*
+ * if the client clip is different or moved OR the subwindowMode has
+ * changed OR the window's clip has changed since the last validation
+ * we need to recompute the composite clip
+ */
+
+ if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
+ (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
+ )
+ {
+ if(pDrawable->type == DRAWABLE_WINDOW)
+ miOverlayComputeCompositeClip (pGC, (WindowPtr)pDrawable);
+ else
+ miComputeCompositeClip (pGC, pDrawable);
+#ifdef NO_ONE_RECT
+ devPriv->oneRect = FALSE;
+#else
+ oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1;
+ if (oneRect != devPriv->oneRect)
+ new_line = TRUE;
+ devPriv->oneRect = oneRect;
+#endif
+ }
+
+ mask = changes;
+ while (mask) {
+ index = lowbit (mask);
+ mask &= ~index;
+
+ switch (index) {
+ case GCFunction:
+ case GCForeground:
+ new_rrop = TRUE;
+ break;
+ case GCPlaneMask:
+ new_rrop = TRUE;
+ new_text = TRUE;
+ break;
+ case GCBackground:
+ break;
+ case GCLineStyle:
+ case GCLineWidth:
+ new_line = TRUE;
+ break;
+ case GCJoinStyle:
+ case GCCapStyle:
+ break;
+ case GCFillStyle:
+ new_text = TRUE;
+ new_fillspans = TRUE;
+ new_line = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCFillRule:
+ break;
+ case GCTile:
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCStipple:
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCTileStipXOrigin:
+ case GCTileStipYOrigin:
+ break;
+ case GCFont:
+ new_text = TRUE;
+ break;
+ case GCSubwindowMode:
+ case GCGraphicsExposures:
+ case GCClipXOrigin:
+ case GCClipYOrigin:
+ case GCClipMask:
+ case GCDashOffset:
+ case GCDashList:
+ case GCArcMode:
+ default:
+ break;
+ }
+ }
+
+ /*
+ * If the drawable has changed, ensure suitable
+ * entries are in the proc vector.
+ */
+ if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS)))
+ new_fillspans = TRUE; /* deal with FillSpans later */
+
+ if (new_rrop)
+ {
+ int old_rrop;
+
+ old_rrop = devPriv->rop;
+ devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel,
+ pGC->planemask,
+ &devPriv->and, &devPriv->xor);
+ if (old_rrop == devPriv->rop)
+ new_rrop = FALSE;
+ else
+ {
+#ifdef PIXEL_ADDR
+ new_line = TRUE;
+#endif
+#ifdef WriteBitGroup
+ new_text = TRUE;
+#endif
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ }
+ }
+
+ if(!pGC->ops)
+ pGC->ops = & cfbNonTEOps;
+
+
+ if (new_rrop || new_fillspans || new_text || new_fillarea || new_line)
+ {
+ GCOps *newops;
+
+ if ((newops = cfb32MatchCommon_Underlay (pGC, devPriv)))
+ {
+ if (pGC->ops->devPrivate.val)
+ miDestroyGCOps (pGC->ops);
+ pGC->ops = newops;
+ new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0;
+ }
+ else
+ {
+ if (!pGC->ops->devPrivate.val)
+ {
+ pGC->ops = miCreateGCOps (pGC->ops);
+ pGC->ops->devPrivate.val = 1;
+ }
+ }
+ }
+
+ /* deal with the changes we've collected */
+ if (new_line)
+ {
+ pGC->ops->FillPolygon = miFillPolygon;
+#ifdef NO_ONE_RECT
+ if (pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
+ break;
+ default:
+ pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
+ break;
+ }
+ }
+#else
+ if (devPriv->oneRect && pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
+ break;
+ default:
+ pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
+ break;
+ }
+ }
+#endif
+ if (pGC->lineWidth == 0)
+ {
+#ifdef PIXEL_ADDR
+ if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
+ {
+ switch (devPriv->rop)
+ {
+ case GXxor:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor;
+ break;
+ case GXcopy:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy;
+ break;
+ default:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8General;
+ break;
+ }
+ }
+ else
+#endif
+ pGC->ops->PolyArc = miZeroPolyArc;
+ }
+ else
+ pGC->ops->PolyArc = miPolyArc;
+ pGC->ops->PolySegment = miPolySegment;
+ switch (pGC->lineStyle)
+ {
+ case LineSolid:
+ if(pGC->lineWidth == 0)
+ {
+ if (pGC->fillStyle == FillSolid)
+ {
+#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT)
+ if (devPriv->oneRect &&
+ ((pDrawable->x >= pGC->pScreen->width - 32768) &&
+ (pDrawable->y >= pGC->pScreen->height - 32768)))
+ {
+ pGC->ops->Polylines = cfb8LineSS1Rect;
+ pGC->ops->PolySegment = cfb8SegmentSS1Rect;
+ } else
+#endif
+#ifdef NO_ONE_RECT
+ {
+ pGC->ops->Polylines = cfb8LineSS1Rect;
+ pGC->ops->PolySegment = cfb8SegmentSS1Rect;
+ }
+#else
+ {
+ pGC->ops->Polylines = cfbLineSS;
+ pGC->ops->PolySegment = cfbSegmentSS;
+ }
+#endif
+ }
+ else
+ pGC->ops->Polylines = miZeroLine;
+ }
+ else
+ pGC->ops->Polylines = miWideLine;
+ break;
+ case LineOnOffDash:
+ case LineDoubleDash:
+ if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
+ {
+ pGC->ops->Polylines = cfbLineSD;
+ pGC->ops->PolySegment = cfbSegmentSD;
+ } else
+ pGC->ops->Polylines = miWideDash;
+ break;
+ }
+ }
+
+ if (new_text && (pGC->font))
+ {
+ if (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
+ FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
+ FONTMINBOUNDS(pGC->font,characterWidth) < 0)
+ {
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+ pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
+ }
+ else
+ {
+#ifdef WriteBitGroup
+ if (pGC->fillStyle == FillSolid)
+ {
+ if (devPriv->rop == GXcopy)
+ pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8;
+ else
+#ifdef FOUR_BIT_CODE
+ pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8;
+#else
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+#endif
+ }
+ else
+#endif
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+ /* special case ImageGlyphBlt for terminal emulator fonts */
+#if !defined(WriteBitGroup) || PSZ == 8
+ if (TERMINALFONT(pGC->font) &&
+ (pGC->planemask & PMSK) == PMSK
+#ifdef FOUR_BIT_CODE
+ && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
+#endif
+ )
+ {
+ pGC->ops->ImageGlyphBlt = useTEGlyphBlt;
+ }
+ else
+#endif
+ {
+#ifdef WriteBitGroup
+ if (devPriv->rop == GXcopy &&
+ pGC->fillStyle == FillSolid &&
+ (pGC->planemask & PMSK) == PMSK)
+ pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8;
+ else
+#endif
+ pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
+ }
+ }
+ }
+
+
+ if (new_fillspans) {
+ switch (pGC->fillStyle) {
+ case FillSolid:
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillSpans = cfbSolidSpansCopy;
+ break;
+ case GXxor:
+ pGC->ops->FillSpans = cfbSolidSpansXor;
+ break;
+ default:
+ pGC->ops->FillSpans = cfbSolidSpansGeneral;
+ break;
+ }
+ break;
+ case FillTiled:
+ pGC->ops->FillSpans = cfbUnnaturalTileFS;
+ break;
+ case FillStippled:
+ case FillOpaqueStippled:
+ pGC->ops->FillSpans = cfbUnnaturalStippleFS;
+ break;
+ default:
+ FatalError("cfbValidateGC: illegal fillStyle\n");
+ }
+ } /* end of new_fillspans */
+
+ if (new_fillarea) {
+#ifndef FOUR_BIT_CODE
+ pGC->ops->PolyFillRect = miPolyFillRect;
+ if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled)
+ {
+ pGC->ops->PolyFillRect = cfbPolyFillRect;
+ }
+#endif
+#ifdef FOUR_BIT_CODE
+ pGC->ops->PushPixels = mfbPushPixels;
+ if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy)
+ pGC->ops->PushPixels = cfbPushPixels8;
+#endif
+ pGC->ops->PolyFillArc = miPolyFillArc;
+ if (pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop)
+ {
+ case GXcopy:
+ pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
+ break;
+ default:
+ pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral;
+ break;
+ }
+ }
+ }
+}
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbimage.c b/xserver/hw/xfree86/xf8_32bpp/cfbimage.c
new file mode 100644
index 000000000..01a5a5eb6
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbimage.c
@@ -0,0 +1,174 @@
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/X.h>
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include "gcstruct.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "servermd.h"
+#include "mi.h"
+
+
+void
+cfb8_32GetImage (
+ DrawablePtr pDraw,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planemask,
+ char *pdstLine
+){
+ if(!w || !h) return;
+
+ if (!cfbDrawableEnabled (pDraw))
+ return;
+
+ if(pDraw->depth == 24){
+ cfb32GetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+ return;
+ }
+
+ if((pDraw->bitsPerPixel == 8) || (pDraw->bitsPerPixel == 1)){
+ cfbGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+ return;
+ }
+
+ /* source is depth 8, 32 bpp */
+ if(format != ZPixmap) {
+ miGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+ return;
+ } else {
+ BoxRec box;
+ DDXPointRec ptSrc;
+ RegionRec rgnDst;
+ ScreenPtr pScreen;
+ PixmapPtr pPixmap;
+
+ pScreen = pDraw->pScreen;
+ pPixmap = GetScratchPixmapHeader(pScreen, w, h, 8, 8,
+ PixmapBytePad(w,8), (pointer)pdstLine);
+ if (!pPixmap)
+ return;
+ if ((planemask & 0xff) != 0xff)
+ memset((char *)pdstLine, 0, pPixmap->devKind * h);
+ ptSrc.x = sx + pDraw->x;
+ ptSrc.y = sy + pDraw->y;
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = w;
+ box.y2 = h;
+ REGION_INIT(pScreen, &rgnDst, &box, 1);
+ cfbDoBitblt32To8(pDraw, (DrawablePtr)pPixmap, GXcopy, &rgnDst,
+ &ptSrc, planemask);
+ REGION_UNINIT(pScreen, &rgnDst);
+ FreeScratchPixmapHeader(pPixmap);
+ }
+}
+
+void
+cfb8_32PutImage (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ if(!w || !h) return;
+
+ if((pDraw->bitsPerPixel == 8) || (format != XYPixmap)){
+ cfbPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage);
+ return;
+ } else { /* moving an 8bpp XYPixmap to a 32bpp screen */
+ unsigned long oldFg, oldBg;
+ XID gcv[3];
+ unsigned long oldPlanemask;
+ unsigned long i;
+ long bytesPer;
+
+ oldPlanemask = pGC->planemask;
+ oldFg = pGC->fgPixel;
+ oldBg = pGC->bgPixel;
+ gcv[0] = ~0L;
+ gcv[1] = 0;
+ DoChangeGC(pGC, GCForeground | GCBackground, gcv, 0);
+ bytesPer = (long)h * BitmapBytePad(w + leftPad);
+
+ for (i = 0x80000000; i & 0xff000000; i >>= 1, pImage += bytesPer)
+ {
+ if (i & oldPlanemask)
+ {
+ gcv[0] = i;
+ DoChangeGC(pGC, GCPlaneMask, gcv, 0);
+ ValidateGC(pDraw, pGC);
+ (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
+ XYBitmap, pImage);
+ }
+ }
+ gcv[0] = oldPlanemask;
+ gcv[1] = oldFg;
+ gcv[2] = oldBg;
+ DoChangeGC(pGC, GCPlaneMask | GCForeground | GCBackground, gcv, 0);
+ ValidateGC(pDraw, pGC);
+ }
+}
+
+
+
+
+void
+cfb8_32GetSpans(
+ DrawablePtr pDraw,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pDst
+){
+ int pitch, i;
+ CARD8 *ptr, *ptrBase;
+
+ if (!cfbDrawableEnabled (pDraw))
+ return;
+
+ if(pDraw->bitsPerPixel == 1) {
+ mfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+ return;
+ }
+
+ if(pDraw->depth == 24) {
+ cfb32GetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+ return;
+ } else if(pDraw->bitsPerPixel == 8) {
+ cfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+ return;
+ }
+
+ /* gotta get spans from a depth 8 window */
+ cfbGetByteWidthAndPointer(pDraw, pitch, ptrBase);
+ ptrBase += 3; /* point to top byte */
+
+ while(nspans--) {
+ ptr = ptrBase + (ppt->y * pitch) + (ppt->x << 2);
+
+ for(i = *pwidth; i--; ptr += 4)
+ *(pDst++) = *ptr;
+
+ pDst = (char*)((long)(pDst + 3) & ~3L);
+
+ ppt++; pwidth++;
+ }
+}
+
+
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbpntwin.c b/xserver/hw/xfree86/xf8_32bpp/cfbpntwin.c
new file mode 100644
index 000000000..a1b988716
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbpntwin.c
@@ -0,0 +1,180 @@
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+
+#include "windowstr.h"
+#include "regionstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mi.h"
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
+void
+cfb8_32PaintWindow(
+ WindowPtr pWin,
+ RegionPtr pRegion,
+ int what
+){
+ WindowPtr pBgWin;
+ int xorg, yorg;
+
+ switch (what) {
+ case PW_BACKGROUND:
+ switch (pWin->backgroundState) {
+ case None:
+ break;
+ case ParentRelative:
+ do {
+ pWin = pWin->parent;
+ } while (pWin->backgroundState == ParentRelative);
+ (*pWin->drawable.pScreen->PaintWindowBackground)(
+ pWin, pRegion, what);
+ break;
+ case BackgroundPixmap:
+ xorg = pWin->drawable.x;
+ yorg = pWin->drawable.y;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ int index = pWin->drawable.pScreen->myNum;
+ if(WindowTable[index] == pWin) {
+ xorg -= panoramiXdataPtr[index].x;
+ yorg -= panoramiXdataPtr[index].y;
+ }
+ }
+#endif
+ cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
+ pWin->background.pixmap, xorg, yorg, GXcopy,
+ (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000);
+ break;
+ case BackgroundPixel:
+ if(pWin->drawable.depth == 24)
+ cfb8_32FillBoxSolid32 ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion),
+ REGION_RECTS(pRegion),
+ pWin->background.pixel);
+ else
+ cfb8_32FillBoxSolid8 ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion),
+ REGION_RECTS(pRegion),
+ pWin->background.pixel);
+ break;
+ }
+ break;
+ case PW_BORDER:
+ if (pWin->borderIsPixel) {
+ if(pWin->drawable.depth == 24) {
+ cfb8_32FillBoxSolid32 ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion),
+ REGION_RECTS(pRegion),
+ pWin->border.pixel);
+ } else
+ cfb8_32FillBoxSolid8 ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion),
+ REGION_RECTS(pRegion),
+ pWin->border.pixel);
+ } else {
+ for (pBgWin = pWin;
+ pBgWin->backgroundState == ParentRelative;
+ pBgWin = pBgWin->parent);
+
+ xorg = pBgWin->drawable.x;
+ yorg = pBgWin->drawable.y;
+
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ int index = pWin->drawable.pScreen->myNum;
+ if(WindowTable[index] == pBgWin) {
+ xorg -= panoramiXdataPtr[index].x;
+ yorg -= panoramiXdataPtr[index].y;
+ }
+ }
+#endif
+ cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
+ pWin->border.pixmap, xorg, yorg, GXcopy,
+ (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000);
+ }
+ break;
+ }
+
+}
+
+void
+cfb8_32FillBoxSolid8(
+ DrawablePtr pDraw,
+ int nbox,
+ BoxPtr pbox,
+ unsigned long color
+){
+ CARD8 *ptr, *data;
+ int pitch, height, width, i;
+ CARD8 c = (CARD8)color;
+
+ cfbGetByteWidthAndPointer(pDraw, pitch, ptr);
+ ptr += 3; /* point to the top byte */
+
+ while(nbox--) {
+ data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2);
+ width = (pbox->x2 - pbox->x1) << 2;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ for(i = 0; i < width; i+=4)
+ data[i] = c;
+ data += pitch;
+ }
+ pbox++;
+ }
+}
+
+
+void
+cfb8_32FillBoxSolid32(
+ DrawablePtr pDraw,
+ int nbox,
+ BoxPtr pbox,
+ unsigned long color
+){
+ CARD8 *ptr, *data;
+ CARD16 *ptr2, *data2;
+ int pitch, pitch2;
+ int height, width, i;
+ CARD8 c = (CARD8)(color >> 16);
+ CARD16 c2 = (CARD16)color;
+
+ cfbGetByteWidthAndPointer(pDraw, pitch, ptr);
+ cfbGetTypedWidthAndPointer(pDraw, pitch2, ptr2, CARD16, CARD16);
+ ptr += 2; /* point to the third byte */
+
+ while(nbox--) {
+ data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2);
+ data2 = ptr2 + (pbox->y1 * pitch2) + (pbox->x1 << 1);
+ width = (pbox->x2 - pbox->x1) << 1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ for(i = 0; i < width; i+=2) {
+ data[i << 1] = c;
+ data2[i] = c2;
+ }
+ data += pitch;
+ data2 += pitch2;
+ }
+ pbox++;
+ }
+}
+
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c b/xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c
new file mode 100644
index 000000000..7cbdb5a66
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c
@@ -0,0 +1,328 @@
+
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xmd.h>
+#include "misc.h"
+#include "servermd.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "resource.h"
+#include "colormap.h"
+#include "colormapst.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mi.h"
+#include "micmap.h"
+#include "mistruct.h"
+#include "dix.h"
+#include "mibstore.h"
+#include "mioverlay.h"
+#include "xf86.h"
+#include "xf86str.h"
+#include "globals.h"
+
+/* CAUTION: We require that cfb8 and cfb32 were NOT
+ compiled with CFB_NEED_SCREEN_PRIVATE */
+
+static BSFuncRec cfb8_32BSFuncRec = {
+ cfb8_32SaveAreas,
+ cfb8_32RestoreAreas,
+ (BackingStoreSetClipmaskRgnProcPtr) 0,
+ (BackingStoreGetImagePixmapProcPtr) 0,
+ (BackingStoreGetSpansPixmapProcPtr) 0,
+};
+
+
+int cfb8_32GCPrivateIndex;
+int cfb8_32GetGCPrivateIndex(void) { return cfb8_32GCPrivateIndex; }
+int cfb8_32ScreenPrivateIndex;
+int cfb8_32GetScreenPrivateIndex(void) { return cfb8_32ScreenPrivateIndex; }
+static unsigned long cfb8_32Generation = 0;
+
+static Bool
+cfb8_32AllocatePrivates(ScreenPtr pScreen)
+{
+ cfb8_32ScreenPtr pScreenPriv;
+
+ if(cfb8_32Generation != serverGeneration) {
+ if(((cfb8_32GCPrivateIndex = AllocateGCPrivateIndex()) < 0) ||
+ ((cfb8_32ScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0))
+ return FALSE;
+ cfb8_32Generation = serverGeneration;
+ }
+
+ if (!(pScreenPriv = xalloc(sizeof(cfb8_32ScreenRec))))
+ return FALSE;
+
+ pScreen->devPrivates[cfb8_32ScreenPrivateIndex].ptr = (pointer)pScreenPriv;
+
+
+ /* All cfb will have the same GC and Window private indicies */
+ if(!mfbAllocatePrivates(pScreen,&cfbWindowPrivateIndex, &cfbGCPrivateIndex))
+ return FALSE;
+
+ /* The cfb indicies are the mfb indicies. Reallocating them resizes them */
+ if(!AllocateWindowPrivate(pScreen,cfbWindowPrivateIndex,sizeof(cfbPrivWin)))
+ return FALSE;
+
+ if(!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
+ return FALSE;
+
+ if(!AllocateGCPrivate(pScreen, cfb8_32GCPrivateIndex, sizeof(cfb8_32GCRec)))
+ return FALSE;
+
+ return TRUE;
+}
+
+static void DestroyColormapNoop(
+ ColormapPtr pColormap)
+{
+ /* NOOP */
+}
+
+static void StoreColorsNoop(
+ ColormapPtr pColormap,
+ int ndef,
+ xColorItem * pdef)
+{
+ /* NOOP */
+}
+
+static Bool
+cfb8_32SetupScreen(
+ ScreenPtr pScreen,
+ pointer pbits, /* pointer to screen bitmap */
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy, /* dots per inch */
+ int width /* pixel width of frame buffer */
+){
+ if (!cfb8_32AllocatePrivates(pScreen))
+ return FALSE;
+ pScreen->defColormap = FakeClientID(0);
+ /* let CreateDefColormap do whatever it wants for pixels */
+ pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
+ pScreen->QueryBestSize = mfbQueryBestSize;
+ /* SaveScreen */
+ pScreen->GetImage = cfb8_32GetImage;
+ pScreen->GetSpans = cfb8_32GetSpans;
+ pScreen->CreateWindow = cfb8_32CreateWindow;
+ pScreen->DestroyWindow = cfb8_32DestroyWindow;
+ pScreen->PositionWindow = cfb8_32PositionWindow;
+ pScreen->ChangeWindowAttributes = cfb8_32ChangeWindowAttributes;
+ pScreen->RealizeWindow = cfb32MapWindow; /* OK */
+ pScreen->UnrealizeWindow = cfb32UnmapWindow; /* OK */
+ pScreen->PaintWindowBackground = cfb8_32PaintWindow;
+ pScreen->PaintWindowBorder = cfb8_32PaintWindow;
+ pScreen->CopyWindow = cfb8_32CopyWindow;
+ pScreen->CreatePixmap = cfb32CreatePixmap; /* OK */
+ pScreen->DestroyPixmap = cfb32DestroyPixmap; /* OK */
+ pScreen->RealizeFont = mfbRealizeFont;
+ pScreen->UnrealizeFont = mfbUnrealizeFont;
+ pScreen->CreateGC = cfb8_32CreateGC;
+ pScreen->CreateColormap = miInitializeColormap;
+ pScreen->DestroyColormap = DestroyColormapNoop;
+ pScreen->InstallColormap = miInstallColormap;
+ pScreen->UninstallColormap = miUninstallColormap;
+ pScreen->ListInstalledColormaps = miListInstalledColormaps;
+ pScreen->StoreColors = StoreColorsNoop;
+ pScreen->ResolveColor = miResolveColor;
+ pScreen->BitmapToRegion = mfbPixmapToRegion;
+
+ mfbRegisterCopyPlaneProc (pScreen, cfb8_32CopyPlane);
+ return TRUE;
+}
+
+typedef struct {
+ pointer pbits;
+ int width;
+} miScreenInitParmsRec, *miScreenInitParmsPtr;
+
+static Bool
+cfb8_32CreateScreenResources(ScreenPtr pScreen)
+{
+ miScreenInitParmsPtr pScrInitParms;
+ int pitch;
+ Bool retval;
+
+ /* get the pitch before mi destroys it */
+ pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate;
+ pitch = pScrInitParms->width << 2;
+
+ if((retval = miCreateScreenResources(pScreen))) {
+ /* fix the screen pixmap */
+ PixmapPtr pPix = (PixmapPtr)pScreen->devPrivate;
+ pPix->drawable.bitsPerPixel = 32;
+ pPix->drawable.depth = 8;
+ pPix->devKind = pitch;
+ }
+
+ return retval;
+}
+
+
+static Bool
+cfb8_32CloseScreen (int i, ScreenPtr pScreen)
+{
+ cfb8_32ScreenPtr pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
+ if(pScreenPriv->visualData)
+ xfree(pScreenPriv->visualData);
+
+ xfree((pointer) pScreenPriv);
+ pScreen->devPrivates[cfb8_32ScreenPrivateIndex].ptr = NULL;
+
+ return(cfb32CloseScreen(i, pScreen));
+}
+
+static void
+cfb8_32TransFunc(
+ ScreenPtr pScreen,
+ int nbox,
+ BoxPtr pbox
+){
+ cfb8_32FillBoxSolid8(&(WindowTable[pScreen->myNum]->drawable),
+ nbox, pbox, xf86Screens[pScreen->myNum]->colorKey);
+}
+
+static Bool
+cfb8_32InOverlayFunc(WindowPtr pWin)
+{
+ return (pWin->drawable.depth == 8);
+}
+
+static Bool
+cfb8_32FinishScreenInit(
+ ScreenPtr pScreen,
+ pointer pbits, /* pointer to screen bitmap */
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy, /* dots per inch */
+ int width /* pixel width of frame buffer */
+){
+ VisualPtr visuals;
+ DepthPtr depths;
+ int nvisuals;
+ int ndepths;
+ int rootdepth;
+ VisualID defaultVisual;
+
+ rootdepth = 0;
+ if (!miInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
+ &defaultVisual,((unsigned long)1<<(32-1)), 8, -1))
+ return FALSE;
+ if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
+ rootdepth, ndepths, depths,
+ defaultVisual, nvisuals, visuals))
+ return FALSE;
+
+ pScreen->BackingStoreFuncs = cfb8_32BSFuncRec;
+ pScreen->CreateScreenResources = cfb8_32CreateScreenResources;
+ pScreen->CloseScreen = cfb8_32CloseScreen;
+ pScreen->GetScreenPixmap = cfb32GetScreenPixmap; /* OK */
+ pScreen->SetScreenPixmap = cfb32SetScreenPixmap; /* OK */
+
+ if (! miInitOverlay(pScreen, cfb8_32InOverlayFunc, cfb8_32TransFunc))
+ return FALSE;
+
+ return TRUE;
+}
+
+static void
+cfb8_32EnableDisableFBAccess (
+ int index,
+ Bool enable
+){
+ ScreenPtr pScreen = screenInfo.screens[index];
+ cfb8_32ScreenPtr pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
+
+ miOverlaySetRootClip(pScreen, enable);
+
+ (*pScreenPriv->EnableDisableFBAccess) (index, enable);
+}
+
+static Atom overlayVisualsAtom;
+
+typedef struct {
+ CARD32 overlay_visual;
+ CARD32 transparent_type;
+ CARD32 value;
+ CARD32 layer;
+} overlayVisualRec;
+
+static void
+cfb8_32SetupVisuals (ScreenPtr pScreen)
+{
+ cfb8_32ScreenPtr pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
+ char atomString[] = {"SERVER_OVERLAY_VISUALS"};
+ overlayVisualRec *overlayVisuals;
+ VisualID *visuals = NULL;
+ int numVisuals = 0;
+ DepthPtr pDepth = pScreen->allowedDepths;
+ int numDepths = pScreen->numDepths;
+ int i;
+
+ /* find depth 8 visuals */
+ for(i = 0; i < numDepths; i++, pDepth++) {
+ if(pDepth->depth == 8) {
+ numVisuals = pDepth->numVids;
+ visuals = pDepth->vids;
+ break;
+ }
+ }
+
+ if(!numVisuals || !visuals) {
+ ErrorF("No overlay visuals found!\n");
+ return;
+ }
+
+ if(!(overlayVisuals = xalloc(numVisuals * sizeof(overlayVisualRec))))
+ return;
+
+ for(i = 0; i < numVisuals; i++) {
+ overlayVisuals[i].overlay_visual = visuals[i];
+ overlayVisuals[i].transparent_type = 1; /* transparent pixel */
+ overlayVisuals[i].value = pScreenPriv->key;
+ overlayVisuals[i].layer = 1;
+ }
+
+ overlayVisualsAtom = MakeAtom(atomString, sizeof(atomString) - 1, TRUE);
+ xf86RegisterRootWindowProperty(pScreen->myNum, overlayVisualsAtom,
+ overlayVisualsAtom, 32, numVisuals * 4, overlayVisuals);
+ pScreenPriv->visualData = (pointer)overlayVisuals;
+}
+
+Bool
+cfb8_32ScreenInit(
+ ScreenPtr pScreen,
+ pointer pbits, /* pointer to screen bitmap */
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy, /* dots per inch */
+ int w /* pixel width of frame buffer */
+){
+ cfb8_32ScreenPtr pScreenPriv;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if (!cfb8_32SetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, w))
+ return FALSE;
+
+ pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
+ pScreenPriv->key = pScrn->colorKey;
+ pScreenPriv->visualData = NULL;
+
+
+ pScreenPriv->EnableDisableFBAccess = pScrn->EnableDisableFBAccess;
+ pScrn->EnableDisableFBAccess = cfb8_32EnableDisableFBAccess;
+
+
+ if(cfb8_32FinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, w))
+ {
+ cfb8_32SetupVisuals(pScreen);
+ return TRUE;
+ }
+ return FALSE;
+}
diff --git a/xserver/hw/xfree86/xf8_32bpp/cfbwindow.c b/xserver/hw/xfree86/xf8_32bpp/cfbwindow.c
new file mode 100644
index 000000000..ce741cb55
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/cfbwindow.c
@@ -0,0 +1,121 @@
+
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <stdlib.h>
+
+#include <X11/X.h>
+#include "scrnintstr.h"
+#include "windowstr.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mistruct.h"
+#include "regionstr.h"
+#include "cfbmskbits.h"
+#include "mioverlay.h"
+
+
+/* We don't bother with cfb's fastBackground/Border so we don't
+ need to use the Window privates */
+
+
+Bool
+cfb8_32CreateWindow(WindowPtr pWin)
+{
+ cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
+
+ pPrivWin->fastBackground = FALSE;
+ pPrivWin->fastBorder = FALSE;
+
+ pWin->drawable.bitsPerPixel = 32;
+ return TRUE;
+}
+
+
+Bool
+cfb8_32DestroyWindow(WindowPtr pWin)
+{
+ return TRUE;
+}
+
+Bool
+cfb8_32PositionWindow(
+ WindowPtr pWin,
+ int x, int y
+){
+ return TRUE;
+}
+
+void
+cfb8_32CopyWindow(pWin, ptOldOrg, prgnSrc)
+ WindowPtr pWin;
+ DDXPointRec ptOldOrg;
+ RegionPtr prgnSrc;
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DDXPointPtr ppt, pptSrc;
+ RegionRec rgnDst;
+ RegionPtr borderClip = &pWin->borderClip;
+ BoxPtr pbox;
+ int dx, dy, i, nbox;
+ WindowPtr pwinRoot;
+ Bool doUnderlay = miOverlayCopyUnderlay(pScreen);
+ Bool freeReg = FALSE;
+
+ pwinRoot = WindowTable[pScreen->myNum];
+
+ if(doUnderlay)
+ freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
+
+ REGION_NULL(pScreen, &rgnDst);
+
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+ REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ REGION_INTERSECT(pScreen, &rgnDst, borderClip, prgnSrc);
+
+ pbox = REGION_RECTS(&rgnDst);
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(!nbox ||
+ !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
+ {
+ REGION_UNINIT(pScreen, &rgnDst);
+ return;
+ }
+ ppt = pptSrc;
+
+ for (i = nbox; --i >= 0; ppt++, pbox++)
+ {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ if(doUnderlay)
+ cfbDoBitblt24To24GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
+ GXcopy, &rgnDst, pptSrc, ~0);
+ else
+ cfbDoBitblt8To8GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
+ GXcopy, &rgnDst, pptSrc, ~0);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ REGION_UNINIT(pScreen, &rgnDst);
+ if(freeReg)
+ REGION_DESTROY(pScreen, borderClip);
+}
+
+Bool
+cfb8_32ChangeWindowAttributes(
+ WindowPtr pWin,
+ unsigned long mask
+){
+ return TRUE;
+}
+
+
+
+
diff --git a/xserver/hw/xfree86/xf8_32bpp/xf86overlay.c b/xserver/hw/xfree86/xf8_32bpp/xf86overlay.c
new file mode 100644
index 000000000..c5585ca6d
--- /dev/null
+++ b/xserver/hw/xfree86/xf8_32bpp/xf86overlay.c
@@ -0,0 +1,1254 @@
+
+/*
+ Copyright (C) 1998. The XFree86 Project Inc.
+
+ Written by Mark Vojkovich (mvojkovi@ucsd.edu)
+*/
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_OSproc.h"
+
+#include <X11/X.h>
+#include "scrnintstr.h"
+#include "regionstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "migc.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "colormapst.h"
+#include "cfb8_32.h"
+
+#define IS_DIRTY 1
+#define IS_SHARED 2
+
+/** Screen Functions **/
+
+static Bool OverlayCloseScreen (int, ScreenPtr);
+static Bool OverlayCreateGC(GCPtr pGC);
+static Bool OverlayDestroyPixmap(PixmapPtr);
+static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int);
+static Bool OverlayChangeWindowAttributes(WindowPtr, unsigned long);
+static void OverlayPaintWindow(WindowPtr, RegionPtr, int);
+
+/** Funcs **/
+static void OverlayValidateGC(GCPtr, unsigned long, DrawablePtr);
+static void OverlayChangeGC(GCPtr, unsigned long);
+static void OverlayCopyGC(GCPtr, unsigned long, GCPtr);
+static void OverlayDestroyGC(GCPtr);
+static void OverlayChangeClip(GCPtr, int, pointer, int);
+static void OverlayDestroyClip(GCPtr);
+static void OverlayCopyClip(GCPtr, GCPtr);
+
+
+static PixmapPtr OverlayRefreshPixmap(PixmapPtr);
+
+static GCFuncs OverlayGCFuncs = {
+ OverlayValidateGC, OverlayChangeGC,
+ OverlayCopyGC, OverlayDestroyGC,
+ OverlayChangeClip, OverlayDestroyClip,
+ OverlayCopyClip
+};
+
+
+/** Pixmap Ops */
+static void PixmapFillSpans(DrawablePtr, GCPtr, int, DDXPointPtr, int *,
+ int);
+static void PixmapSetSpans(DrawablePtr, GCPtr, char *, DDXPointPtr,
+ int *, int, int);
+static void PixmapPutImage(DrawablePtr, GCPtr, int, int, int, int, int,
+ int, int, char *);
+static void PixmapPushPixels(GCPtr, PixmapPtr, DrawablePtr, int, int,
+ int, int);
+static RegionPtr PixmapCopyArea(DrawablePtr, DrawablePtr, GCPtr, int, int,
+ int, int, int, int);
+static RegionPtr PixmapCopyPlane(DrawablePtr, DrawablePtr, GCPtr, int, int,
+ int, int, int, int, unsigned long);
+static void PixmapPolyPoint(DrawablePtr, GCPtr, int, int, xPoint *);
+static void PixmapPolylines(DrawablePtr, GCPtr, int, int, DDXPointPtr);
+static void PixmapPolySegment(DrawablePtr, GCPtr, int, xSegment *);
+static void PixmapPolyRectangle(DrawablePtr, GCPtr, int, xRectangle *);
+static void PixmapPolyArc(DrawablePtr, GCPtr, int, xArc *);
+static void PixmapFillPolygon(DrawablePtr, GCPtr, int, int, int,
+ DDXPointPtr);
+static void PixmapPolyFillRect(DrawablePtr, GCPtr, int, xRectangle *);
+static void PixmapPolyFillArc(DrawablePtr, GCPtr, int, xArc *);
+static int PixmapPolyText8(DrawablePtr, GCPtr, int, int, int, char *);
+static int PixmapPolyText16(DrawablePtr, GCPtr, int, int, int,
+ unsigned short *);
+static void PixmapImageText8(DrawablePtr, GCPtr, int, int, int, char *);
+static void PixmapImageText16(DrawablePtr, GCPtr, int, int, int,
+ unsigned short *);
+static void PixmapImageGlyphBlt(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+static void PixmapPolyGlyphBlt(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+
+static GCOps PixmapGCOps = {
+ PixmapFillSpans, PixmapSetSpans,
+ PixmapPutImage, PixmapCopyArea,
+ PixmapCopyPlane, PixmapPolyPoint,
+ PixmapPolylines, PixmapPolySegment,
+ PixmapPolyRectangle, PixmapPolyArc,
+ PixmapFillPolygon, PixmapPolyFillRect,
+ PixmapPolyFillArc, PixmapPolyText8,
+ PixmapPolyText16, PixmapImageText8,
+ PixmapImageText16, PixmapImageGlyphBlt,
+ PixmapPolyGlyphBlt, PixmapPushPixels,
+ {NULL} /* devPrivate */
+};
+
+
+/** Window Ops **/
+static void WindowFillSpans(DrawablePtr, GCPtr, int, DDXPointPtr, int *,
+ int);
+static void WindowSetSpans(DrawablePtr, GCPtr, char *, DDXPointPtr,
+ int *, int, int);
+static void WindowPutImage(DrawablePtr, GCPtr, int, int, int, int, int,
+ int, int, char *);
+static void WindowPushPixels(GCPtr, PixmapPtr, DrawablePtr, int, int,
+ int, int);
+static RegionPtr WindowCopyArea(DrawablePtr, DrawablePtr, GCPtr, int, int,
+ int, int, int, int);
+static RegionPtr WindowCopyPlane(DrawablePtr, DrawablePtr, GCPtr, int, int,
+ int, int, int, int, unsigned long);
+static void WindowPolyPoint(DrawablePtr, GCPtr, int, int, xPoint *);
+static void WindowPolylines(DrawablePtr, GCPtr, int, int, DDXPointPtr);
+static void WindowPolySegment(DrawablePtr, GCPtr, int, xSegment *);
+static void WindowPolyRectangle(DrawablePtr, GCPtr, int, xRectangle *);
+static void WindowPolyArc(DrawablePtr, GCPtr, int, xArc *);
+static void WindowFillPolygon(DrawablePtr, GCPtr, int, int, int,
+ DDXPointPtr);
+static void WindowPolyFillRect(DrawablePtr, GCPtr, int, xRectangle *);
+static void WindowPolyFillArc(DrawablePtr, GCPtr, int, xArc *);
+static int WindowPolyText8(DrawablePtr, GCPtr, int, int, int, char *);
+static int WindowPolyText16(DrawablePtr, GCPtr, int, int, int,
+ unsigned short *);
+static void WindowImageText8(DrawablePtr, GCPtr, int, int, int, char *);
+static void WindowImageText16(DrawablePtr, GCPtr, int, int, int,
+ unsigned short *);
+static void WindowImageGlyphBlt(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+static void WindowPolyGlyphBlt(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+
+static GCOps WindowGCOps = {
+ WindowFillSpans, WindowSetSpans,
+ WindowPutImage, WindowCopyArea,
+ WindowCopyPlane, WindowPolyPoint,
+ WindowPolylines, WindowPolySegment,
+ WindowPolyRectangle, WindowPolyArc,
+ WindowFillPolygon, WindowPolyFillRect,
+ WindowPolyFillArc, WindowPolyText8,
+ WindowPolyText16, WindowImageText8,
+ WindowImageText16, WindowImageGlyphBlt,
+ WindowPolyGlyphBlt, WindowPushPixels,
+ {NULL} /* devPrivate */
+};
+
+/** privates **/
+
+typedef struct {
+ CloseScreenProcPtr CloseScreen;
+ CreateGCProcPtr CreateGC;
+ CreatePixmapProcPtr CreatePixmap;
+ DestroyPixmapProcPtr DestroyPixmap;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ int LockPrivate;
+} OverlayScreenRec, *OverlayScreenPtr;
+
+typedef struct {
+ GCFuncs *wrapFuncs;
+ GCOps *wrapOps;
+ GCOps *overlayOps;
+ unsigned long fg;
+ unsigned long bg;
+ unsigned long pm;
+ PixmapPtr tile;
+} OverlayGCRec, *OverlayGCPtr;
+
+typedef struct {
+ PixmapPtr pix32;
+ CARD32 dirty;
+} OverlayPixmapRec, *OverlayPixmapPtr;
+
+
+static int OverlayScreenIndex = -1;
+static int OverlayGCIndex = -1;
+static int OverlayPixmapIndex = -1;
+static unsigned long OverlayGeneration = 0;
+
+/** Macros **/
+
+#define TILE_EXISTS(pGC) (!(pGC)->tileIsPixel && (pGC)->tile.pixmap)
+
+#define OVERLAY_GET_PIXMAP_PRIVATE(pPix) \
+ (OverlayPixmapPtr)((pPix)->devPrivates[OverlayPixmapIndex].ptr)
+
+#define OVERLAY_GET_SCREEN_PRIVATE(pScreen) \
+ (OverlayScreenPtr)((pScreen)->devPrivates[OverlayScreenIndex].ptr)
+
+#define OVERLAY_GET_GC_PRIVATE(pGC) \
+ (OverlayGCPtr)((pGC)->devPrivates[OverlayGCIndex].ptr)
+
+#define OVERLAY_GC_FUNC_PROLOGUE(pGC)\
+ OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\
+ (pGC)->funcs = pGCPriv->wrapFuncs;\
+ if(pGCPriv->overlayOps) \
+ (pGC)->ops = pGCPriv->wrapOps
+
+#define OVERLAY_GC_FUNC_EPILOGUE(pGC)\
+ pGCPriv->wrapFuncs = (pGC)->funcs;\
+ (pGC)->funcs = &OverlayGCFuncs;\
+ if(pGCPriv->overlayOps) { \
+ pGCPriv->wrapOps = (pGC)->ops;\
+ (pGC)->ops = pGCPriv->overlayOps;\
+ }
+
+#define WINDOW_GC_OP_PROLOGUE(pGC)\
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE((pGC)->pScreen);\
+ OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\
+ unsigned long oldfg = (pGC)->fgPixel;\
+ unsigned long oldbg = (pGC)->bgPixel;\
+ unsigned long oldpm = (pGC)->planemask;\
+ PixmapPtr oldtile = (pGC)->tile.pixmap;\
+ (pGC)->fgPixel = pGCPriv->fg;\
+ (pGC)->bgPixel = pGCPriv->bg;\
+ (pGC)->planemask = pGCPriv->pm;\
+ if(pGCPriv->tile) (pGC)->tile.pixmap = pGCPriv->tile;\
+ (pGC)->funcs = pGCPriv->wrapFuncs;\
+ (pGC)->ops = pGCPriv->wrapOps;\
+ pScreenPriv->LockPrivate++
+
+
+#define WINDOW_GC_OP_EPILOGUE(pGC)\
+ pGCPriv->wrapOps = (pGC)->ops;\
+ pGCPriv->wrapFuncs = (pGC)->funcs;\
+ (pGC)->fgPixel = oldfg;\
+ (pGC)->bgPixel = oldbg;\
+ (pGC)->planemask = oldpm;\
+ (pGC)->tile.pixmap = oldtile;\
+ (pGC)->funcs = &OverlayGCFuncs;\
+ (pGC)->ops = &WindowGCOps;\
+ pScreenPriv->LockPrivate--
+
+
+#define PIXMAP_GC_OP_PROLOGUE(pGC)\
+ OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\
+ OverlayPixmapPtr pPixPriv = OVERLAY_GET_PIXMAP_PRIVATE((PixmapPtr)pDraw);\
+ pGC->funcs = pGCPriv->wrapFuncs;\
+ pGC->ops = pGCPriv->wrapOps
+
+#define PIXMAP_GC_OP_EPILOGUE(pGC)\
+ pGCPriv->wrapOps = pGC->ops;\
+ pGC->funcs = &OverlayGCFuncs;\
+ pGC->ops = &PixmapGCOps;\
+ pPixPriv->dirty |= IS_DIRTY
+
+
+Bool
+xf86Overlay8Plus32Init (ScreenPtr pScreen)
+{
+ OverlayScreenPtr pScreenPriv;
+
+ if(OverlayGeneration != serverGeneration) {
+ if(((OverlayScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
+ ((OverlayGCIndex = AllocateGCPrivateIndex()) < 0) ||
+ ((OverlayPixmapIndex = AllocatePixmapPrivateIndex()) < 0))
+ return FALSE;
+
+ OverlayGeneration = serverGeneration;
+ }
+
+ if (!AllocateGCPrivate(pScreen, OverlayGCIndex, sizeof(OverlayGCRec)))
+ return FALSE;
+
+ if (!AllocatePixmapPrivate(pScreen, OverlayPixmapIndex,
+ sizeof(OverlayPixmapRec)))
+ return FALSE;
+
+ if (!(pScreenPriv = xalloc(sizeof(OverlayScreenRec))))
+ return FALSE;
+
+ pScreen->devPrivates[OverlayScreenIndex].ptr = (pointer)pScreenPriv;
+
+ pScreenPriv->CreateGC = pScreen->CreateGC;
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreenPriv->CreatePixmap = pScreen->CreatePixmap;
+ pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap;
+ pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
+ pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
+ pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
+
+ pScreen->CreateGC = OverlayCreateGC;
+ pScreen->CloseScreen = OverlayCloseScreen;
+ pScreen->CreatePixmap = OverlayCreatePixmap;
+ pScreen->DestroyPixmap = OverlayDestroyPixmap;
+ pScreen->ChangeWindowAttributes = OverlayChangeWindowAttributes;
+ pScreen->PaintWindowBackground = OverlayPaintWindow;
+ pScreen->PaintWindowBorder = OverlayPaintWindow;
+
+ pScreenPriv->LockPrivate = 0;
+
+ /* allocate the key in the default map */
+ if(pScreen->defColormap) {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ColormapPtr pmap;
+ xColorItem color;
+
+ pmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, RT_COLORMAP);
+
+ pmap->red[pScrn->colorKey].refcnt = AllocPrivate;
+ pmap->red[pScrn->colorKey].fShared = FALSE;
+ pmap->freeRed--;
+
+ color.red = color.blue = color.green = 0;
+ color.pixel = pScrn->colorKey;
+ color.flags = DoRed | DoGreen | DoBlue;
+
+ StoreColors(pmap, 1, &color);
+ }
+
+ return TRUE;
+}
+
+
+/*********************** Screen Funcs ***********************/
+
+Bool
+OverlayCreateGC(GCPtr pGC)
+{
+ ScreenPtr pScreen = pGC->pScreen;
+ OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ Bool ret;
+
+ pScreen->CreateGC = pScreenPriv->CreateGC;
+
+ if((ret = (*pScreen->CreateGC)(pGC)) && (pGC->depth != 1)) {
+ pGCPriv->wrapFuncs = pGC->funcs;
+ pGC->funcs = &OverlayGCFuncs;
+ pGCPriv->wrapOps = NULL;
+ pGCPriv->overlayOps = NULL;
+ pGCPriv->tile = NULL;
+ }
+
+ pScreen->CreateGC = OverlayCreateGC;
+
+ return ret;
+}
+
+static PixmapPtr
+OverlayCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
+{
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ PixmapPtr pPix;
+
+ pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
+ pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth);
+ pScreen->CreatePixmap = OverlayCreatePixmap;
+
+ /* We initialize all the privates */
+ if(pPix) {
+ OverlayPixmapPtr pPriv = OVERLAY_GET_PIXMAP_PRIVATE(pPix);
+ pPriv->pix32 = NULL;
+ pPriv->dirty = IS_DIRTY;
+ if(!w || !h)
+ pPriv->dirty |= IS_SHARED;
+ }
+
+ return pPix;
+}
+
+static Bool
+OverlayDestroyPixmap(PixmapPtr pPix)
+{
+ ScreenPtr pScreen = pPix->drawable.pScreen;
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ Bool result;
+
+ pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
+
+ if((pPix->refcnt == 1) && (pPix->drawable.bitsPerPixel == 8)) {
+ OverlayPixmapPtr pPriv = OVERLAY_GET_PIXMAP_PRIVATE(pPix);
+ if(pPriv->pix32) {
+ if(pPriv->pix32->refcnt != 1)
+ ErrorF("Warning! private pix refcnt = %i\n", pPriv->pix32->refcnt);
+ (*pScreen->DestroyPixmap)(pPriv->pix32);
+ }
+ pPriv->pix32 = NULL;
+ }
+
+ result = (*pScreen->DestroyPixmap) (pPix);
+ pScreen->DestroyPixmap = OverlayDestroyPixmap;
+
+ return result;
+}
+
+static Bool
+OverlayCloseScreen (int i, ScreenPtr pScreen)
+{
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+
+ pScreen->CreateGC = pScreenPriv->CreateGC;
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
+ pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
+ pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
+ pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
+ pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
+
+ xfree ((pointer) pScreenPriv);
+
+ return (*pScreen->CloseScreen) (i, pScreen);
+}
+
+
+
+static Bool
+OverlayChangeWindowAttributes (WindowPtr pWin, unsigned long mask)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ Bool result;
+
+ if(pWin->drawable.depth == 8) {
+ if((mask & CWBackPixmap) &&
+ (pWin->backgroundState == BackgroundPixmap))
+ OverlayRefreshPixmap(pWin->background.pixmap);
+
+ if((mask & CWBorderPixmap) && !pWin->borderIsPixel)
+ OverlayRefreshPixmap(pWin->border.pixmap);
+ }
+
+ pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
+ result = (*pScreen->ChangeWindowAttributes) (pWin, mask);
+ pScreen->ChangeWindowAttributes = OverlayChangeWindowAttributes;
+
+ return result;
+}
+
+static void
+OverlayPaintWindow(
+ WindowPtr pWin,
+ RegionPtr pReg,
+ int what
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ OverlayPixmapPtr pixPriv;
+ PixmapPtr oldPix = NULL;
+
+ if(what == PW_BACKGROUND) {
+ if(pWin->drawable.depth == 8) {
+ if(pWin->backgroundState == ParentRelative) {
+ do {
+ pWin = pWin->parent;
+ } while (pWin->backgroundState == ParentRelative);
+ }
+
+ if(pWin->backgroundState == BackgroundPixmap) {
+ oldPix = pWin->background.pixmap;
+ pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix);
+ /* have to do this here because alot of applications
+ incorrectly assume changes to a pixmap that is
+ a window background go into effect immediatedly */
+ if(pixPriv->dirty & IS_DIRTY)
+ OverlayRefreshPixmap(pWin->background.pixmap);
+ pWin->background.pixmap = pixPriv->pix32;
+ }
+ }
+
+ pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
+ (*pScreen->PaintWindowBackground) (pWin, pReg, what);
+ pScreen->PaintWindowBackground = OverlayPaintWindow;
+
+ if(oldPix)
+ pWin->background.pixmap = oldPix;
+ } else {
+ if((pWin->drawable.depth == 8) && !pWin->borderIsPixel) {
+ oldPix = pWin->border.pixmap;
+ pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix);
+ if(pixPriv->dirty & IS_DIRTY)
+ OverlayRefreshPixmap(pWin->border.pixmap);
+ pWin->border.pixmap = pixPriv->pix32;
+ }
+
+ pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
+ (*pScreen->PaintWindowBorder) (pWin, pReg, what);
+ pScreen->PaintWindowBorder = OverlayPaintWindow;
+
+ if(oldPix)
+ pWin->border.pixmap = oldPix;
+ }
+}
+
+
+/*********************** GC Funcs *****************************/
+
+
+static PixmapPtr
+OverlayRefreshPixmap(PixmapPtr pix8)
+{
+ OverlayPixmapPtr pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(pix8);
+ ScreenPtr pScreen = pix8->drawable.pScreen;
+
+ if(!pixPriv->pix32) {
+ PixmapPtr newPix;
+
+ newPix = (*pScreen->CreatePixmap)(pScreen, pix8->drawable.width,
+ pix8->drawable.height, 24);
+ newPix->drawable.depth = 8; /* Bad Mark! Bad Mark! */
+ pixPriv->pix32 = newPix;
+ }
+
+ if(pixPriv->dirty) {
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ GCPtr pGC;
+
+ pGC = GetScratchGC(8, pScreen);
+
+ pScreenPriv->LockPrivate++; /* don't modify this one */
+ ValidateGC((DrawablePtr)pixPriv->pix32, pGC);
+
+ (*pGC->ops->CopyArea)((DrawablePtr)pix8, (DrawablePtr)pixPriv->pix32,
+ pGC, 0, 0, pix8->drawable.width, pix8->drawable.height, 0, 0);
+ pScreenPriv->LockPrivate--;
+ FreeScratchGC(pGC);
+
+ pixPriv->dirty &= ~IS_DIRTY;
+ pixPriv->pix32->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ }
+
+ return pixPriv->pix32;
+}
+
+
+static void
+OverlayValidateGC(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+){
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pGC->pScreen);
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+
+ if(pScreenPriv->LockPrivate < 0) {
+ ErrorF("Something is wrong in OverlayValidateGC!\n");
+ pScreenPriv->LockPrivate = 0;
+ }
+
+ if(pGC->depth == 24) {
+ unsigned long oldpm = pGC->planemask;
+ pGCPriv->overlayOps = NULL;
+
+ if(pDraw->type == DRAWABLE_WINDOW)
+ pGC->planemask &= 0x00ffffff;
+ else
+ pGC->planemask |= 0xff000000;
+
+ if(oldpm != pGC->planemask) changes |= GCPlaneMask;
+
+ (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
+
+ } else { /* depth == 8 */
+ unsigned long newChanges = 0;
+
+ if(pDraw->bitsPerPixel == 32) {
+
+ if(pGC->fillStyle == FillTiled)
+ pGCPriv->tile = OverlayRefreshPixmap(pGC->tile.pixmap);
+ else pGCPriv->tile = NULL;
+
+ if(pGCPriv->overlayOps != &WindowGCOps) {
+ newChanges = GCForeground | GCBackground | GCPlaneMask;
+ if(pGCPriv->tile)
+ newChanges |= GCTile;
+ }
+ pGCPriv->overlayOps = &WindowGCOps;
+
+ if(!pScreenPriv->LockPrivate) {
+ unsigned long oldfg = pGC->fgPixel;
+ unsigned long oldbg = pGC->bgPixel;
+ unsigned long oldpm = pGC->planemask;
+ PixmapPtr oldtile = pGC->tile.pixmap;
+
+ pGC->fgPixel = pGCPriv->fg = oldfg << 24;
+ pGC->bgPixel = pGCPriv->bg = oldbg << 24;
+ pGC->planemask = pGCPriv->pm = oldpm << 24;
+ if(pGCPriv->tile)
+ pGC->tile.pixmap = pGCPriv->tile;
+
+ (*pGC->funcs->ValidateGC)(pGC, changes | newChanges, pDraw);
+
+ pGC->fgPixel = oldfg;
+ pGC->bgPixel = oldbg;
+ pGC->planemask = oldpm;
+ pGC->tile.pixmap = oldtile;
+ } else {
+ pGCPriv->fg = pGC->fgPixel;
+ pGCPriv->bg = pGC->bgPixel;
+ pGCPriv->pm = pGC->planemask;
+
+ (*pGC->funcs->ValidateGC)(pGC, changes | newChanges, pDraw);
+ }
+
+ } else { /* bitsPerPixel == 8 */
+ if(pGCPriv->overlayOps == &WindowGCOps) {
+ newChanges = GCForeground | GCBackground | GCPlaneMask;
+ if(pGCPriv->tile)
+ newChanges |= GCTile;
+ }
+ pGCPriv->overlayOps = &PixmapGCOps;
+
+ (*pGC->funcs->ValidateGC)(pGC, changes | newChanges, pDraw);
+ }
+ }
+
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+
+static void
+OverlayDestroyGC(GCPtr pGC)
+{
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->DestroyGC)(pGC);
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+OverlayChangeGC (
+ GCPtr pGC,
+ unsigned long mask
+){
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeGC) (pGC, mask);
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+OverlayCopyGC (
+ GCPtr pGCSrc,
+ unsigned long mask,
+ GCPtr pGCDst
+){
+ OVERLAY_GC_FUNC_PROLOGUE (pGCDst);
+ (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
+ OVERLAY_GC_FUNC_EPILOGUE (pGCDst);
+}
+static void
+OverlayChangeClip (
+ GCPtr pGC,
+ int type,
+ pointer pvalue,
+ int nrects
+){
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+OverlayCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
+{
+ OVERLAY_GC_FUNC_PROLOGUE (pgcDst);
+ (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
+ OVERLAY_GC_FUNC_EPILOGUE (pgcDst);
+}
+
+static void
+OverlayDestroyClip(GCPtr pGC)
+{
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+ (* pGC->funcs->DestroyClip)(pGC);
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+
+
+/******************* Window GC ops ***********************/
+
+static void
+WindowFillSpans(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowSetSpans(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ register DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static RegionPtr
+WindowCopyArea(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+ RegionPtr ret;
+
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->CopyArea)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static RegionPtr
+WindowCopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ RegionPtr ret;
+
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+WindowPolyPoint(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ xPoint *pptInit
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolylines(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolySegment(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyRectangle(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowFillPolygon(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyFillRect(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyFillArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static int
+WindowPolyText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ int ret;
+
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static int
+WindowPolyText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ int ret;
+
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+WindowImageText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowImageText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowImageGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPushPixels(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+
+/******************* Pixmap GC ops ***********************/
+
+static void
+PixmapFillSpans(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapSetSpans(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ register DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static RegionPtr
+PixmapCopyArea(
+ DrawablePtr pSrc,
+ DrawablePtr pDraw,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+ RegionPtr ret;
+
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->CopyArea)(pSrc, pDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static RegionPtr
+PixmapCopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ RegionPtr ret;
+
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+PixmapPolyPoint(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ xPoint *pptInit
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolylines(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolySegment(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyRectangle(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapFillPolygon(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyFillRect(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyFillArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static int
+PixmapPolyText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ int ret;
+
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static int
+PixmapPolyText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ int ret;
+
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+PixmapImageText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapImageText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapImageGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPushPixels(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+