Remove xf8_32wid, it's dead code with no maintainer interest. Also remove
cfb24, since xf8_32wid was the only user.
This commit is contained in:
parent
2e28f4104d
commit
14fdd81614
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
||||||
|
2006-01-25 Adam Jackson <ajax@freedesktop.org>
|
||||||
|
|
||||||
|
* Makefile.am:
|
||||||
|
* cfb24/Makefile.am:
|
||||||
|
* cfb24/cfbrrop24.h:
|
||||||
|
* configure.ac:
|
||||||
|
* hw/xfree86/Makefile.am:
|
||||||
|
* hw/xfree86/dixmods/Makefile.am:
|
||||||
|
* hw/xfree86/xf8_32wid/Makefile.am:
|
||||||
|
* hw/xfree86/xf8_32wid/cfb8_32wid.h:
|
||||||
|
* hw/xfree86/xf8_32wid/cfb8_32widmodule.c:
|
||||||
|
* hw/xfree86/xf8_32wid/cfbscrinit.c:
|
||||||
|
* hw/xfree86/xf8_32wid/cfbwid.c:
|
||||||
|
* hw/xfree86/xf8_32wid/cfbwindow.c:
|
||||||
|
Remove xf8_32wid, it's dead code with no maintainer interest. Also
|
||||||
|
remove cfb24, since xf8_32wid was the only user.
|
||||||
|
|
||||||
2006-01-19 Daniel Stone <daniel@freedesktop.org>
|
2006-01-19 Daniel Stone <daniel@freedesktop.org>
|
||||||
|
|
||||||
* GL/symlink-mesa.sh:
|
* GL/symlink-mesa.sh:
|
||||||
|
|
|
@ -11,10 +11,6 @@ endif
|
||||||
if CFB
|
if CFB
|
||||||
CFB_DIR=cfb
|
CFB_DIR=cfb
|
||||||
CFB16_DIR=cfb16
|
CFB16_DIR=cfb16
|
||||||
# cfb24 is only used by xf8_32wid, which is only used by sunffb on SPARC
|
|
||||||
if BUILD_XF8_32WID
|
|
||||||
CFB24_DIR=cfb24
|
|
||||||
endif
|
|
||||||
CFB32_DIR=cfb32
|
CFB32_DIR=cfb32
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -57,7 +53,6 @@ SUBDIRS = \
|
||||||
$(AFB_DIR) \
|
$(AFB_DIR) \
|
||||||
$(CFB_DIR) \
|
$(CFB_DIR) \
|
||||||
$(CFB16_DIR) \
|
$(CFB16_DIR) \
|
||||||
$(CFB24_DIR) \
|
|
||||||
$(CFB32_DIR) \
|
$(CFB32_DIR) \
|
||||||
record \
|
record \
|
||||||
xfixes \
|
xfixes \
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
noinst_LTLIBRARIES = libcfb24.la
|
|
||||||
|
|
||||||
include $(top_srcdir)/cfb/Makefile.am.inc
|
|
||||||
|
|
||||||
libcfb24_la_SOURCES = $(libcfb_common_sources) $(libcfb_gen_sources)
|
|
||||||
|
|
||||||
EXTRA_DIST = cfbrrop24.h
|
|
||||||
|
|
||||||
AM_CFLAGS = -DPSZ=24 $(DIX_CFLAGS) $(PLATFORMDEFS) @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
|
||||||
|
|
||||||
INCLUDES = $(CFB_INCLUDES) -I$(top_srcdir)/hw/xfree86/os-support
|
|
|
@ -1,54 +0,0 @@
|
||||||
/* $XFree86: xc/programs/Xserver/cfb24/cfbrrop24.h,v 3.1tsi Exp $ */
|
|
||||||
|
|
||||||
#define RROP_DECLARE \
|
|
||||||
unsigned long piQxelAnd[3], piQxelXor[3], spiQxelXor[8];
|
|
||||||
|
|
||||||
#define RROP_COPY_SETUP(ptn) \
|
|
||||||
spiQxelXor[0] = ptn & 0xFFFFFF; \
|
|
||||||
spiQxelXor[2] = ptn << 24; \
|
|
||||||
spiQxelXor[3] = (ptn & 0xFFFF00)>> 8; \
|
|
||||||
spiQxelXor[4] = ptn << 16; \
|
|
||||||
spiQxelXor[5] = (ptn & 0xFF0000)>> 16; \
|
|
||||||
spiQxelXor[6] = ptn << 8; \
|
|
||||||
spiQxelXor[1] = spiQxelXor[7] = 0;
|
|
||||||
|
|
||||||
#define RROP_SOLID24_COPY(dst,index) {\
|
|
||||||
register int idx = ((index) & 3)<< 1; \
|
|
||||||
*(dst) = (*(dst) & cfbrmask[idx])|spiQxelXor[idx]; \
|
|
||||||
idx++; \
|
|
||||||
*((dst)+1) = (*((dst)+1) & cfbrmask[idx])|spiQxelXor[idx]; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define RROP_SET_SETUP(xor, and) \
|
|
||||||
spiQxelXor[0] = xor & 0xFFFFFF; \
|
|
||||||
spiQxelXor[1] = xor << 24; \
|
|
||||||
spiQxelXor[2] = xor << 16; \
|
|
||||||
spiQxelXor[3] = xor << 8; \
|
|
||||||
spiQxelXor[4] = (xor >> 8) & 0xFFFF; \
|
|
||||||
spiQxelXor[5] = (xor >> 16) & 0xFF; \
|
|
||||||
piQxelAnd[0] = (and & 0xFFFFFF)|(and << 24); \
|
|
||||||
piQxelAnd[1] = (and << 16)|((and >> 8) & 0xFFFF); \
|
|
||||||
piQxelAnd[2] = (and << 8)|((and >> 16) & 0xFF); \
|
|
||||||
piQxelXor[0] = (xor & 0xFFFFFF)|(xor << 24); \
|
|
||||||
piQxelXor[1] = (xor << 16)|((xor >> 8) & 0xFFFF); \
|
|
||||||
piQxelXor[2] = (xor << 8)|((xor >> 16) & 0xFF);
|
|
||||||
|
|
||||||
|
|
||||||
#define RROP_SOLID24_SET(dst,index) {\
|
|
||||||
switch((index) & 3){ \
|
|
||||||
case 0: \
|
|
||||||
*(dst) = ((*(dst) & (piQxelAnd[0] |0xFF000000))^(piQxelXor[0] & 0xFFFFFF)); \
|
|
||||||
break; \
|
|
||||||
case 3: \
|
|
||||||
*(dst) = ((*(dst) & (piQxelAnd[2]|0xFF))^(piQxelXor[2] & 0xFFFFFF00)); \
|
|
||||||
break; \
|
|
||||||
case 1: \
|
|
||||||
*(dst) = ((*(dst) & (piQxelAnd[0]|0xFFFFFF))^(piQxelXor[0] & 0xFF000000)); \
|
|
||||||
*((dst)+1) = ((*((dst)+1) & (piQxelAnd[1]|0xFFFF0000))^(piQxelXor[1] & 0xFFFF)); \
|
|
||||||
break; \
|
|
||||||
case 2: \
|
|
||||||
*(dst) = ((*(dst) & (piQxelAnd[1]|0xFFFF))^(piQxelXor[1] & 0xFFFF0000)); \
|
|
||||||
*((dst)+1) = ((*((dst)+1) & (piQxelAnd[2]|0xFFFFFF00))^(piQxelXor[2] & 0xFF)); \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
}
|
|
|
@ -168,7 +168,6 @@ dnl hw/xfree86/os-support/bus/Makefile.am, among others.
|
||||||
dnl ---------------------------------------------------------------------------
|
dnl ---------------------------------------------------------------------------
|
||||||
DEFAULT_INT10="x86emu"
|
DEFAULT_INT10="x86emu"
|
||||||
use_x86_asm="no"
|
use_x86_asm="no"
|
||||||
build_xf8_32wid="yes"
|
|
||||||
|
|
||||||
dnl Override defaults as needed for specific platforms:
|
dnl Override defaults as needed for specific platforms:
|
||||||
|
|
||||||
|
@ -199,7 +198,6 @@ case $host_cpu in
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
sparc*)
|
sparc*)
|
||||||
build_xf8_32wid="yes" # used by sunffb driver
|
|
||||||
xorg_loader_sparcmuldiv="yes"
|
xorg_loader_sparcmuldiv="yes"
|
||||||
SPARC64_VIDEO=yes
|
SPARC64_VIDEO=yes
|
||||||
BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
|
BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
|
||||||
|
@ -215,8 +213,6 @@ case $host_cpu in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
AM_CONDITIONAL(BUILD_XF8_32WID, [test x$build_xf8_32wid = xyes])
|
|
||||||
|
|
||||||
dnl BSD *_video.c selection
|
dnl BSD *_video.c selection
|
||||||
AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])
|
AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])
|
||||||
AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes])
|
AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes])
|
||||||
|
@ -1524,7 +1520,6 @@ lbx/Makefile
|
||||||
mfb/Makefile
|
mfb/Makefile
|
||||||
cfb/Makefile
|
cfb/Makefile
|
||||||
cfb16/Makefile
|
cfb16/Makefile
|
||||||
cfb24/Makefile
|
|
||||||
cfb32/Makefile
|
cfb32/Makefile
|
||||||
ilbm/Makefile
|
ilbm/Makefile
|
||||||
iplan2p4/Makefile
|
iplan2p4/Makefile
|
||||||
|
@ -1584,7 +1579,6 @@ hw/xfree86/xf1bpp/Makefile
|
||||||
hw/xfree86/xf4bpp/Makefile
|
hw/xfree86/xf4bpp/Makefile
|
||||||
hw/xfree86/xf8_16bpp/Makefile
|
hw/xfree86/xf8_16bpp/Makefile
|
||||||
hw/xfree86/xf8_32bpp/Makefile
|
hw/xfree86/xf8_32bpp/Makefile
|
||||||
hw/xfree86/xf8_32wid/Makefile
|
|
||||||
hw/xfree86/utils/Makefile
|
hw/xfree86/utils/Makefile
|
||||||
hw/xfree86/utils/cvt/Makefile
|
hw/xfree86/utils/cvt/Makefile
|
||||||
hw/xfree86/utils/gtf/Makefile
|
hw/xfree86/utils/gtf/Makefile
|
||||||
|
|
|
@ -6,12 +6,12 @@ DOC_SUBDIR = doc
|
||||||
|
|
||||||
SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support parser rac \
|
SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support parser rac \
|
||||||
ramdac shadowfb vbe vgahw xaa xf1bpp xf4bpp xf8_16bpp \
|
ramdac shadowfb vbe vgahw xaa xf1bpp xf4bpp xf8_16bpp \
|
||||||
xf8_32bpp xf8_32wid loader scanpci dixmods exa \
|
xf8_32bpp loader scanpci dixmods exa \
|
||||||
$(DRI_SUBDIR) utils $(DOC_SUBDIR) getconfig
|
$(DRI_SUBDIR) utils $(DOC_SUBDIR) getconfig
|
||||||
|
|
||||||
DIST_SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support \
|
DIST_SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support \
|
||||||
parser rac ramdac shadowfb vbe vgahw xaa xf1bpp xf4bpp \
|
parser rac ramdac shadowfb vbe vgahw xaa xf1bpp xf4bpp \
|
||||||
xf8_16bpp xf8_32bpp xf8_32wid loader scanpci dixmods dri exa \
|
xf8_16bpp xf8_32bpp loader scanpci dixmods dri exa \
|
||||||
utils doc getconfig
|
utils doc getconfig
|
||||||
|
|
||||||
bin_PROGRAMS = Xorg
|
bin_PROGRAMS = Xorg
|
||||||
|
|
|
@ -10,15 +10,9 @@ if XTRAP
|
||||||
XTRAPMOD = libxtrap.la
|
XTRAPMOD = libxtrap.la
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# cfb24 is only used by xf8_32wid, which is only used by sunffb on SPARC
|
|
||||||
if BUILD_XF8_32WID
|
|
||||||
CFB24MOD = libcfb24.la
|
|
||||||
endif
|
|
||||||
|
|
||||||
module_LTLIBRARIES = libafb.la \
|
module_LTLIBRARIES = libafb.la \
|
||||||
libcfb.la \
|
libcfb.la \
|
||||||
libcfb16.la \
|
libcfb16.la \
|
||||||
$(CFB24MOD) \
|
|
||||||
libcfb32.la \
|
libcfb32.la \
|
||||||
libfb.la \
|
libfb.la \
|
||||||
libmfb.la \
|
libmfb.la \
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
if BUILD_XF8_32WID
|
|
||||||
module_LTLIBRARIES = libxf8_32wid.la
|
|
||||||
endif
|
|
||||||
|
|
||||||
sdk_HEADERS = cfb8_32wid.h
|
|
||||||
|
|
||||||
libxf8_32wid_la_LDFLAGS = -avoid-version
|
|
||||||
|
|
||||||
INCLUDES = $(XORG_INCS) -I$(top_srcdir)/mfb -I$(top_srcdir)/cfb
|
|
||||||
AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
|
||||||
|
|
||||||
libxf8_32wid_la_SOURCES = \
|
|
||||||
cfb8_32widmodule.c \
|
|
||||||
cfbscrinit.c \
|
|
||||||
cfbwindow.c \
|
|
||||||
cfbwid.c
|
|
||||||
|
|
||||||
#libxf8_32wid_la_LIBADD = $(top_builddir)/cfb16/libcfb16.la \
|
|
||||||
# $(top_builddir)/cfb24/libcfb24.la \
|
|
||||||
# $(top_builddir)/cfb32/libcfb32.la
|
|
|
@ -1,94 +0,0 @@
|
||||||
/* $XFree86$ */
|
|
||||||
|
|
||||||
#ifndef _CFB8_32WID_H
|
|
||||||
#define _CFB8_32WID_H
|
|
||||||
|
|
||||||
#include "regionstr.h"
|
|
||||||
#include "windowstr.h"
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
unsigned int (*WidGet)(WindowPtr);
|
|
||||||
Bool (*WidAlloc)(WindowPtr);
|
|
||||||
void (*WidFree)(WindowPtr);
|
|
||||||
void (*WidFillBox)(DrawablePtr, DrawablePtr, int, BoxPtr);
|
|
||||||
void (*WidCopyArea)(DrawablePtr, RegionPtr, DDXPointPtr);
|
|
||||||
} cfb8_32WidOps;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
pointer pix8;
|
|
||||||
int width8;
|
|
||||||
pointer pix32;
|
|
||||||
int width32;
|
|
||||||
|
|
||||||
/* WID information */
|
|
||||||
pointer pixWid;
|
|
||||||
int widthWid;
|
|
||||||
int bitsPerWid;
|
|
||||||
cfb8_32WidOps *WIDOps;
|
|
||||||
} cfb8_32WidScreenRec, *cfb8_32WidScreenPtr;
|
|
||||||
|
|
||||||
extern int cfb8_32WidScreenPrivateIndex; /* XXX */
|
|
||||||
extern int cfb8_32WidGetScreenPrivateIndex(void);
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidScreenInit (
|
|
||||||
ScreenPtr pScreen,
|
|
||||||
pointer pbits32,
|
|
||||||
pointer pbits8,
|
|
||||||
pointer pbitsWid,
|
|
||||||
int xsize, int ysize,
|
|
||||||
int dpix, int dpiy,
|
|
||||||
int width32,
|
|
||||||
int width8,
|
|
||||||
int widthWid,
|
|
||||||
int bitsPerWid,
|
|
||||||
cfb8_32WidOps *WIDOps
|
|
||||||
);
|
|
||||||
|
|
||||||
/* cfbwindow.c */
|
|
||||||
|
|
||||||
void
|
|
||||||
cfb8_32WidPaintWindow (
|
|
||||||
WindowPtr pWin,
|
|
||||||
RegionPtr pRegion,
|
|
||||||
int what
|
|
||||||
);
|
|
||||||
|
|
||||||
Bool cfb8_32WidCreateWindow(WindowPtr pWin);
|
|
||||||
Bool cfb8_32WidDestroyWindow(WindowPtr pWin);
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidPositionWindow(
|
|
||||||
WindowPtr pWin,
|
|
||||||
int x, int y
|
|
||||||
);
|
|
||||||
|
|
||||||
void
|
|
||||||
cfb8_32WidCopyWindow(
|
|
||||||
WindowPtr pWin,
|
|
||||||
DDXPointRec ptOldOrg,
|
|
||||||
RegionPtr prgnSrc
|
|
||||||
);
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidChangeWindowAttributes(
|
|
||||||
WindowPtr pWin,
|
|
||||||
unsigned long mask
|
|
||||||
);
|
|
||||||
|
|
||||||
void
|
|
||||||
cfb8_32WidWindowExposures(
|
|
||||||
WindowPtr pWin,
|
|
||||||
RegionPtr pReg,
|
|
||||||
RegionPtr pOtherReg
|
|
||||||
);
|
|
||||||
|
|
||||||
/* cfbwid.c */
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidGenericOpsInit(cfb8_32WidScreenPtr pScreenPriv);
|
|
||||||
|
|
||||||
#define CFB8_32WID_GET_SCREEN_PRIVATE(pScreen)\
|
|
||||||
(cfb8_32WidScreenPtr)((pScreen)->devPrivates[cfb8_32WidGetScreenPrivateIndex()].ptr)
|
|
||||||
|
|
||||||
#endif /* _CFB8_32WID_H */
|
|
|
@ -1,50 +0,0 @@
|
||||||
/* $XFree86$ */
|
|
||||||
|
|
||||||
#ifdef HAVE_XORG_CONFIG_H
|
|
||||||
#include <xorg-config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XFree86LOADER
|
|
||||||
|
|
||||||
#include "xf86Module.h"
|
|
||||||
|
|
||||||
static MODULESETUPPROTO(xf8_32widSetup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo VersRec =
|
|
||||||
{
|
|
||||||
"xf8_32wid",
|
|
||||||
MODULEVENDORSTRING,
|
|
||||||
MODINFOSTRING1,
|
|
||||||
MODINFOSTRING2,
|
|
||||||
XORG_VERSION_CURRENT,
|
|
||||||
1, 0, 0,
|
|
||||||
ABI_CLASS_ANSIC, /* Only need the ansic layer */
|
|
||||||
ABI_ANSIC_VERSION,
|
|
||||||
NULL,
|
|
||||||
{0,0,0,0} /* signature, to be patched into the file by a tool */
|
|
||||||
};
|
|
||||||
|
|
||||||
XF86ModuleData xf8_32widModuleData = { &VersRec, xf8_32widSetup, NULL };
|
|
||||||
|
|
||||||
static pointer
|
|
||||||
xf8_32widSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
|
||||||
{
|
|
||||||
if (!LoadSubModule(module, "mfb", NULL, NULL, NULL, NULL,
|
|
||||||
errmaj, errmin))
|
|
||||||
return NULL;
|
|
||||||
if (!LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
|
|
||||||
errmaj, errmin))
|
|
||||||
return NULL;
|
|
||||||
if (!LoadSubModule(module, "cfb16", NULL, NULL, NULL, NULL,
|
|
||||||
errmaj, errmin))
|
|
||||||
return NULL;
|
|
||||||
if (!LoadSubModule(module, "cfb24", 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,390 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 1999. The XFree86 Project Inc.
|
|
||||||
|
|
||||||
Written by David S. Miller (davem@redhat.com)
|
|
||||||
|
|
||||||
Based largely upon the xf8_16bpp module which is
|
|
||||||
Mark Vojkovich's work.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* $XFree86$ */
|
|
||||||
|
|
||||||
#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_32wid.h"
|
|
||||||
#include "mi.h"
|
|
||||||
#include "micmap.h"
|
|
||||||
#include "mistruct.h"
|
|
||||||
#include "gcstruct.h"
|
|
||||||
#include "dix.h"
|
|
||||||
#include "mibstore.h"
|
|
||||||
#include "xf86str.h"
|
|
||||||
#include "xf86.h"
|
|
||||||
|
|
||||||
/* CAUTION: We require that cfb8 and cfb32 were NOT
|
|
||||||
compiled with CFB_NEED_SCREEN_PRIVATE */
|
|
||||||
|
|
||||||
int cfb8_32WidScreenPrivateIndex;
|
|
||||||
int cfb8_32WidGetScreenPrivateIndex(void)
|
|
||||||
{
|
|
||||||
return cfb8_32WidScreenPrivateIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned long cfb8_32WidGeneration = 0;
|
|
||||||
extern WindowPtr *WindowTable;
|
|
||||||
|
|
||||||
static PixmapPtr cfb8_32WidGetWindowPixmap(WindowPtr pWin);
|
|
||||||
|
|
||||||
static void
|
|
||||||
cfb8_32WidSaveAreas(
|
|
||||||
PixmapPtr pPixmap,
|
|
||||||
RegionPtr prgnSave,
|
|
||||||
int xorg,
|
|
||||||
int yorg,
|
|
||||||
WindowPtr pWin
|
|
||||||
);
|
|
||||||
|
|
||||||
static void
|
|
||||||
cfb8_32WidRestoreAreas(
|
|
||||||
PixmapPtr pPixmap,
|
|
||||||
RegionPtr prgnRestore,
|
|
||||||
int xorg,
|
|
||||||
int yorg,
|
|
||||||
WindowPtr pWin
|
|
||||||
);
|
|
||||||
|
|
||||||
static BSFuncRec cfb8_32WidBSFuncRec = {
|
|
||||||
cfb8_32WidSaveAreas,
|
|
||||||
cfb8_32WidRestoreAreas,
|
|
||||||
(BackingStoreSetClipmaskRgnProcPtr) 0,
|
|
||||||
(BackingStoreGetImagePixmapProcPtr) 0,
|
|
||||||
(BackingStoreGetSpansPixmapProcPtr) 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
|
||||||
cfb8_32WidGetSpans(
|
|
||||||
DrawablePtr pDraw,
|
|
||||||
int wMax,
|
|
||||||
DDXPointPtr ppt,
|
|
||||||
int *pwidth,
|
|
||||||
int nspans,
|
|
||||||
char *pchardstStart
|
|
||||||
);
|
|
||||||
|
|
||||||
static void
|
|
||||||
cfb8_32WidGetImage (
|
|
||||||
DrawablePtr pDraw,
|
|
||||||
int sx, int sy, int w, int h,
|
|
||||||
unsigned int format,
|
|
||||||
unsigned long planeMask,
|
|
||||||
char *pdstLine
|
|
||||||
);
|
|
||||||
|
|
||||||
static Bool cfb8_32WidCreateGC(GCPtr pGC);
|
|
||||||
static void cfb8_32WidEnableDisableFBAccess(int index, Bool enable);
|
|
||||||
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
cfb8_32WidAllocatePrivates(ScreenPtr pScreen)
|
|
||||||
{
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv;
|
|
||||||
|
|
||||||
if (cfb8_32WidGeneration != serverGeneration) {
|
|
||||||
if ((cfb8_32WidScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0)
|
|
||||||
return FALSE;
|
|
||||||
cfb8_32WidGeneration = serverGeneration;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(pScreenPriv = xalloc(sizeof(cfb8_32WidScreenRec))))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
pScreen->devPrivates[cfb8_32WidScreenPrivateIndex].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;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
cfb8_32WidSetupScreen(
|
|
||||||
ScreenPtr pScreen,
|
|
||||||
int xsize, int ysize, /* in pixels */
|
|
||||||
int dpix, int dpiy
|
|
||||||
){
|
|
||||||
if (!cfb8_32WidAllocatePrivates(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_32WidGetImage;
|
|
||||||
pScreen->GetSpans = cfb8_32WidGetSpans;
|
|
||||||
pScreen->CreateWindow = cfb8_32WidCreateWindow;
|
|
||||||
pScreen->DestroyWindow = cfb8_32WidDestroyWindow;
|
|
||||||
pScreen->PositionWindow = cfb8_32WidPositionWindow;
|
|
||||||
pScreen->ChangeWindowAttributes = cfb8_32WidChangeWindowAttributes;
|
|
||||||
pScreen->RealizeWindow = cfb32MapWindow; /* OK */
|
|
||||||
pScreen->UnrealizeWindow = cfb32UnmapWindow; /* OK */
|
|
||||||
pScreen->PaintWindowBackground = cfb8_32WidPaintWindow;
|
|
||||||
pScreen->PaintWindowBorder = cfb8_32WidPaintWindow;
|
|
||||||
pScreen->CopyWindow = cfb8_32WidCopyWindow;
|
|
||||||
pScreen->CreatePixmap = cfb32CreatePixmap; /* OK */
|
|
||||||
pScreen->DestroyPixmap = cfb32DestroyPixmap; /* OK */
|
|
||||||
pScreen->RealizeFont = mfbRealizeFont;
|
|
||||||
pScreen->UnrealizeFont = mfbUnrealizeFont;
|
|
||||||
pScreen->CreateGC = cfb8_32WidCreateGC;
|
|
||||||
pScreen->CreateColormap = miInitializeColormap;
|
|
||||||
pScreen->DestroyColormap = (void (*)())NoopDDA;
|
|
||||||
pScreen->InstallColormap = miInstallColormap;
|
|
||||||
pScreen->UninstallColormap = miUninstallColormap;
|
|
||||||
pScreen->ListInstalledColormaps = miListInstalledColormaps;
|
|
||||||
pScreen->StoreColors = (void (*)())NoopDDA;
|
|
||||||
pScreen->ResolveColor = miResolveColor;
|
|
||||||
pScreen->BitmapToRegion = mfbPixmapToRegion;
|
|
||||||
|
|
||||||
mfbRegisterCopyPlaneProc (pScreen, cfbCopyPlane);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
cfb8_32WidCreateScreenResources(ScreenPtr pScreen)
|
|
||||||
{
|
|
||||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
|
|
||||||
PixmapPtr pix8, pix32, pixWid;
|
|
||||||
|
|
||||||
xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
|
|
||||||
|
|
||||||
pix8 = (*pScreen->CreatePixmap)(pScreen, 0, 0, 8);
|
|
||||||
pix32 = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScrn->depth);
|
|
||||||
pixWid = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreenPriv->bitsPerWid);
|
|
||||||
if (!pix32 || !pix8 || !pixWid)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
pix8->drawable.width = pScreen->width;
|
|
||||||
pix8->drawable.height = pScreen->height;
|
|
||||||
pix8->devKind = pScreenPriv->width8;
|
|
||||||
pix8->devPrivate.ptr = pScreenPriv->pix8;
|
|
||||||
|
|
||||||
pix32->drawable.width = pScreen->width;
|
|
||||||
pix32->drawable.height = pScreen->height;
|
|
||||||
pix32->devKind = pScreenPriv->width32 * 4;
|
|
||||||
pix32->devPrivate.ptr = pScreenPriv->pix32;
|
|
||||||
|
|
||||||
pixWid->drawable.width = pScreen->width;
|
|
||||||
pixWid->drawable.height = pScreen->height;
|
|
||||||
pixWid->devKind = (pScreenPriv->widthWid * pScreenPriv->bitsPerWid) / 8;
|
|
||||||
pixWid->devPrivate.ptr = pScreenPriv->pixWid;
|
|
||||||
|
|
||||||
pScreenPriv->pix8 = (pointer) pix8;
|
|
||||||
pScreenPriv->pix32 = (pointer) pix32;
|
|
||||||
pScreenPriv->pixWid = (pointer) pixWid;
|
|
||||||
|
|
||||||
pScreen->devPrivate = (pointer) pix32;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
cfb8_32WidCloseScreen (int i, ScreenPtr pScreen)
|
|
||||||
{
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
|
|
||||||
|
|
||||||
xfree((pointer) pScreenPriv);
|
|
||||||
|
|
||||||
return cfb32CloseScreen(i, pScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
cfb8_32WidFinishScreenInit(
|
|
||||||
ScreenPtr pScreen,
|
|
||||||
int xsize, int ysize, /* in pixels */
|
|
||||||
int dpix, int dpiy /* dots per inch */
|
|
||||||
){
|
|
||||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
|
||||||
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, NULL, xsize, ysize, dpix, dpiy, 0,
|
|
||||||
rootdepth, ndepths, depths,
|
|
||||||
defaultVisual, nvisuals, visuals))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
pScreen->BackingStoreFuncs = cfb8_32WidBSFuncRec;
|
|
||||||
pScreen->CreateScreenResources = cfb8_32WidCreateScreenResources;
|
|
||||||
pScreen->CloseScreen = cfb8_32WidCloseScreen;
|
|
||||||
pScreen->GetWindowPixmap = cfb8_32WidGetWindowPixmap;
|
|
||||||
pScreen->WindowExposures = cfb8_32WidWindowExposures;
|
|
||||||
|
|
||||||
pScrn->EnableDisableFBAccess = cfb8_32WidEnableDisableFBAccess;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidScreenInit(
|
|
||||||
ScreenPtr pScreen,
|
|
||||||
pointer pbits32, /* pointer to screen bitmap */
|
|
||||||
pointer pbits8,
|
|
||||||
pointer pbitsWid, /* pointer to WID bitmap */
|
|
||||||
int xsize, int ysize, /* in pixels */
|
|
||||||
int dpix, int dpiy, /* dots per inch */
|
|
||||||
int width32, /* pixel width of frame buffer */
|
|
||||||
int width8,
|
|
||||||
int widthWid,
|
|
||||||
int bitsPerWid,
|
|
||||||
cfb8_32WidOps *WIDOps
|
|
||||||
){
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv;
|
|
||||||
|
|
||||||
if (!WIDOps || !WIDOps->WidGet || !WIDOps->WidAlloc || !WIDOps->WidFree)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (!cfb8_32WidSetupScreen(pScreen, xsize, ysize, dpix, dpiy))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
|
|
||||||
pScreenPriv->pix8 = pbits8;
|
|
||||||
pScreenPriv->pix32 = pbits32;
|
|
||||||
pScreenPriv->pixWid = pbitsWid;
|
|
||||||
pScreenPriv->width8 = width8;
|
|
||||||
pScreenPriv->width32 = width32;
|
|
||||||
pScreenPriv->widthWid = widthWid;
|
|
||||||
pScreenPriv->bitsPerWid = bitsPerWid;
|
|
||||||
|
|
||||||
pScreenPriv->WIDOps = xalloc(sizeof(cfb8_32WidOps));
|
|
||||||
if (!pScreenPriv->WIDOps)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
*(pScreenPriv->WIDOps) = *WIDOps;
|
|
||||||
|
|
||||||
if (!WIDOps->WidFillBox || !WIDOps->WidCopyArea)
|
|
||||||
cfb8_32WidGenericOpsInit(pScreenPriv);
|
|
||||||
|
|
||||||
return cfb8_32WidFinishScreenInit(pScreen, xsize, ysize, dpix, dpiy);
|
|
||||||
}
|
|
||||||
|
|
||||||
static PixmapPtr
|
|
||||||
cfb8_32WidGetWindowPixmap(WindowPtr pWin)
|
|
||||||
{
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
|
|
||||||
|
|
||||||
return ((pWin->drawable.bitsPerPixel == 8) ?
|
|
||||||
(PixmapPtr) pScreenPriv->pix8 : (PixmapPtr) pScreenPriv->pix32);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
cfb8_32WidGetImage (DrawablePtr pDraw, int sx, int sy, int w, int h,
|
|
||||||
unsigned int format, unsigned long planemask, char *pdstLine)
|
|
||||||
{
|
|
||||||
if (!w || !h)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (pDraw->bitsPerPixel == 8)
|
|
||||||
cfbGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
|
|
||||||
else
|
|
||||||
cfb32GetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
cfb8_32WidGetSpans(DrawablePtr pDraw, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pDst)
|
|
||||||
{
|
|
||||||
if (pDraw->bitsPerPixel == 8)
|
|
||||||
cfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
|
|
||||||
else
|
|
||||||
cfb32GetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
cfb8_32WidSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, WindowPtr pWin)
|
|
||||||
{
|
|
||||||
if (pWin->drawable.bitsPerPixel == 8)
|
|
||||||
cfbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
|
|
||||||
else
|
|
||||||
cfb32SaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
cfb8_32WidRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int yorg, WindowPtr pWin)
|
|
||||||
{
|
|
||||||
if (pWin->drawable.bitsPerPixel == 8)
|
|
||||||
cfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
|
|
||||||
else
|
|
||||||
cfb32RestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
cfb8_32WidCreateGC(GCPtr pGC)
|
|
||||||
{
|
|
||||||
if (pGC->depth == 8)
|
|
||||||
return cfbCreateGC(pGC);
|
|
||||||
else
|
|
||||||
return cfb32CreateGC(pGC);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
cfb8_32WidEnableDisableFBAccess(int index, Bool enable)
|
|
||||||
{
|
|
||||||
ScreenPtr pScreen = xf86Screens[index]->pScreen;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
|
|
||||||
static DevUnion devPrivates8[MAXSCREENS];
|
|
||||||
static DevUnion devPrivates32[MAXSCREENS];
|
|
||||||
PixmapPtr pix8, pix32;
|
|
||||||
|
|
||||||
pix8 = (PixmapPtr) pScreenPriv->pix8;
|
|
||||||
pix32 = (PixmapPtr) pScreenPriv->pix32;
|
|
||||||
|
|
||||||
if (enable) {
|
|
||||||
pix8->devPrivate = devPrivates8[index];
|
|
||||||
pix32->devPrivate = devPrivates32[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
xf86EnableDisableFBAccess (index, enable);
|
|
||||||
|
|
||||||
if (!enable) {
|
|
||||||
devPrivates8[index] = pix8->devPrivate;
|
|
||||||
pix8->devPrivate.ptr = 0;
|
|
||||||
devPrivates32[index] = pix32->devPrivate;
|
|
||||||
pix32->devPrivate.ptr = 0;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,151 +0,0 @@
|
||||||
/* $XFree86$ */
|
|
||||||
|
|
||||||
#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"
|
|
||||||
|
|
||||||
#include "mfb.h"
|
|
||||||
#define PSZ 8
|
|
||||||
#include "cfb.h"
|
|
||||||
#undef PSZ
|
|
||||||
#include "cfb16.h"
|
|
||||||
#include "cfb24.h"
|
|
||||||
#include "cfb32.h"
|
|
||||||
|
|
||||||
#include "cfb8_32wid.h"
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidFillBox1(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
|
|
||||||
{
|
|
||||||
WindowPtr pWin = (WindowPtr) pWinDraw;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
|
|
||||||
unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
|
|
||||||
|
|
||||||
if (wid & 1)
|
|
||||||
mfbSolidWhiteArea((DrawablePtr)pWin, nbox, pBox, GXset, NullPixmap);
|
|
||||||
else
|
|
||||||
mfbSolidBlackArea((DrawablePtr)pWin, nbox, pBox, GXset, NullPixmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidCopyArea1(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
|
|
||||||
{
|
|
||||||
mfbDoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidFillBox8(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
|
|
||||||
{
|
|
||||||
WindowPtr pWin = (WindowPtr) pWinDraw;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
|
|
||||||
unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
|
|
||||||
|
|
||||||
cfbFillBoxSolid(pixWid, nbox, pBox, wid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidCopyArea8(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
|
|
||||||
{
|
|
||||||
cfbDoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidFillBox16(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
|
|
||||||
{
|
|
||||||
WindowPtr pWin = (WindowPtr) pWinDraw;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
|
|
||||||
unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
|
|
||||||
|
|
||||||
cfb16FillBoxSolid(pixWid, nbox, pBox, wid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidCopyArea16(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
|
|
||||||
{
|
|
||||||
cfb16DoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidFillBox24(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
|
|
||||||
{
|
|
||||||
WindowPtr pWin = (WindowPtr) pWinDraw;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
|
|
||||||
unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
|
|
||||||
|
|
||||||
cfb24FillBoxSolid(pixWid, nbox, pBox, wid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidCopyArea24(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
|
|
||||||
{
|
|
||||||
cfb24DoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidFillBox32(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
|
|
||||||
{
|
|
||||||
WindowPtr pWin = (WindowPtr) pWinDraw;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
|
|
||||||
unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
|
|
||||||
|
|
||||||
cfb32FillBoxSolid(pixWid, nbox, pBox, wid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
WidCopyArea32(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
|
|
||||||
{
|
|
||||||
cfb32DoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidGenericOpsInit(cfb8_32WidScreenPtr pScreenPriv)
|
|
||||||
{
|
|
||||||
cfb8_32WidOps *WIDOps = pScreenPriv->WIDOps;
|
|
||||||
|
|
||||||
switch (pScreenPriv->bitsPerWid) {
|
|
||||||
case 1:
|
|
||||||
WIDOps->WidFillBox = WidFillBox1;
|
|
||||||
WIDOps->WidCopyArea = WidCopyArea1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 8:
|
|
||||||
WIDOps->WidFillBox = WidFillBox8;
|
|
||||||
WIDOps->WidCopyArea = WidCopyArea8;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 16:
|
|
||||||
WIDOps->WidFillBox = WidFillBox16;
|
|
||||||
WIDOps->WidCopyArea = WidCopyArea16;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 24:
|
|
||||||
WIDOps->WidFillBox = WidFillBox24;
|
|
||||||
WIDOps->WidCopyArea = WidCopyArea24;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 32:
|
|
||||||
WIDOps->WidFillBox = WidFillBox32;
|
|
||||||
WIDOps->WidCopyArea = WidCopyArea32;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
|
@ -1,288 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 1999. The XFree86 Project Inc.
|
|
||||||
|
|
||||||
Written by David S. Miller (davem@redhat.com)
|
|
||||||
|
|
||||||
Based largely upon the xf8_16bpp module which is
|
|
||||||
Mark Vojkovich's work.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbwindow.c,v 1.2tsi Exp $ */
|
|
||||||
|
|
||||||
#ifdef HAVE_XORG_CONFIG_H
|
|
||||||
#include <xorg-config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <X11/X.h>
|
|
||||||
#include "scrnintstr.h"
|
|
||||||
#include "windowstr.h"
|
|
||||||
#define PSZ 8
|
|
||||||
#include "cfb.h"
|
|
||||||
#undef PSZ
|
|
||||||
#include "cfb32.h"
|
|
||||||
#include "cfb8_32wid.h"
|
|
||||||
#include "mistruct.h"
|
|
||||||
#include "regionstr.h"
|
|
||||||
#include "cfbmskbits.h"
|
|
||||||
#include "xf86.h"
|
|
||||||
|
|
||||||
/* We don't bother with cfb's fastBackground/Border so we don't
|
|
||||||
need to use the Window privates */
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidCreateWindow(WindowPtr pWin)
|
|
||||||
{
|
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
|
|
||||||
cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
|
|
||||||
|
|
||||||
pPrivWin->fastBackground = FALSE;
|
|
||||||
pPrivWin->fastBorder = FALSE;
|
|
||||||
|
|
||||||
if (!pScreenPriv->WIDOps->WidAlloc(pWin))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidDestroyWindow(WindowPtr pWin)
|
|
||||||
{
|
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
|
|
||||||
|
|
||||||
pScreenPriv->WIDOps->WidFree(pWin);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidPositionWindow(WindowPtr pWin, int x, int y)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
SegregateChildrenBpp(WindowPtr pWin, RegionPtr pReg, int subtract, int bpp, int other_bpp)
|
|
||||||
{
|
|
||||||
WindowPtr pChild;
|
|
||||||
|
|
||||||
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) {
|
|
||||||
if (pChild->drawable.bitsPerPixel == bpp) {
|
|
||||||
if (subtract) {
|
|
||||||
REGION_SUBTRACT(pWin->drawable.pScreen, pReg,
|
|
||||||
pReg, &pChild->borderClip);
|
|
||||||
} else {
|
|
||||||
REGION_UNION(pWin->drawable.pScreen, pReg,
|
|
||||||
pReg, &pChild->borderClip);
|
|
||||||
}
|
|
||||||
if (pChild->firstChild)
|
|
||||||
SegregateChildrenBpp(pChild, pReg,
|
|
||||||
!subtract, other_bpp, bpp);
|
|
||||||
} else {
|
|
||||||
if (pChild->firstChild)
|
|
||||||
SegregateChildrenBpp(pChild, pReg,
|
|
||||||
subtract, bpp, other_bpp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
cfb8_32WidCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|
||||||
{
|
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
|
|
||||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
|
||||||
PixmapPtr pPixChildren;
|
|
||||||
DDXPointPtr ppt, pptSrc;
|
|
||||||
RegionRec rgnDst, rgnOther, rgnPixmap;
|
|
||||||
BoxPtr pbox;
|
|
||||||
int i, nbox, dx, dy, other_bpp;
|
|
||||||
|
|
||||||
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, &pWin->borderClip, prgnSrc);
|
|
||||||
|
|
||||||
if ((nbox = REGION_NUM_RECTS(&rgnDst)) == 0) {
|
|
||||||
/* Nothing to render. */
|
|
||||||
REGION_UNINIT(pScreen, &rgnDst);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* First, copy the WID plane for the whole area. */
|
|
||||||
pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec));
|
|
||||||
if(pptSrc) {
|
|
||||||
pbox = REGION_RECTS(&rgnDst);
|
|
||||||
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
|
|
||||||
ppt->x = pbox->x1 + dx;
|
|
||||||
ppt->y = pbox->y1 + dy;
|
|
||||||
}
|
|
||||||
|
|
||||||
pScreenPriv->WIDOps->WidCopyArea((DrawablePtr)pScreenPriv->pixWid,
|
|
||||||
&rgnDst, pptSrc);
|
|
||||||
|
|
||||||
DEALLOCATE_LOCAL(pptSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Next, we copy children which have a different
|
|
||||||
* bpp than pWin into a temporary pixmap. We will
|
|
||||||
* toss this pixmap back onto the framebuffer before
|
|
||||||
* we return.
|
|
||||||
*/
|
|
||||||
if (pWin->drawable.bitsPerPixel == 8)
|
|
||||||
other_bpp = pScrn->bitsPerPixel;
|
|
||||||
else
|
|
||||||
other_bpp = 8;
|
|
||||||
|
|
||||||
REGION_NULL(pScreen, &rgnOther);
|
|
||||||
SegregateChildrenBpp(pWin, &rgnOther, 0,
|
|
||||||
other_bpp, pWin->drawable.bitsPerPixel);
|
|
||||||
pPixChildren = NULL;
|
|
||||||
if (REGION_NOTEMPTY(pScreen, &rgnOther)) {
|
|
||||||
REGION_INTERSECT(pScreen, &rgnOther, &rgnOther, prgnSrc);
|
|
||||||
nbox = REGION_NUM_RECTS(&rgnOther);
|
|
||||||
if (nbox) {
|
|
||||||
int width = rgnOther.extents.x2 - rgnOther.extents.x1;
|
|
||||||
int height = rgnOther.extents.y2 - rgnOther.extents.y1;
|
|
||||||
int depth = (other_bpp == 8) ? 8 : pScrn->depth;
|
|
||||||
|
|
||||||
if (other_bpp == 8)
|
|
||||||
pPixChildren = cfbCreatePixmap(pScreen, width, height, depth);
|
|
||||||
else
|
|
||||||
pPixChildren = cfb32CreatePixmap(pScreen, width, height, depth);
|
|
||||||
}
|
|
||||||
if (nbox &&
|
|
||||||
pPixChildren &&
|
|
||||||
(pptSrc = (DDXPointPtr) ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
|
|
||||||
pbox = REGION_RECTS(&rgnOther);
|
|
||||||
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
|
|
||||||
ppt->x = pbox->x1 + dx;
|
|
||||||
ppt->y = pbox->y1 + dy;
|
|
||||||
}
|
|
||||||
|
|
||||||
REGION_NULL(pScreen, &rgnPixmap);
|
|
||||||
REGION_COPY(pScreen, &rgnPixmap, &rgnOther);
|
|
||||||
REGION_TRANSLATE(pScreen, &rgnPixmap, -(rgnOther.extents.x1), -(rgnOther.extents.y1));
|
|
||||||
|
|
||||||
if (other_bpp == 8)
|
|
||||||
cfbDoBitbltCopy((DrawablePtr)pScreenPriv->pix8,
|
|
||||||
(DrawablePtr)pPixChildren,
|
|
||||||
GXcopy, &rgnPixmap, pptSrc, ~0L);
|
|
||||||
else
|
|
||||||
cfb32DoBitbltCopy((DrawablePtr)pScreenPriv->pix32,
|
|
||||||
(DrawablePtr)pPixChildren,
|
|
||||||
GXcopy, &rgnPixmap, pptSrc, ~0L);
|
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &rgnPixmap);
|
|
||||||
|
|
||||||
DEALLOCATE_LOCAL(pptSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
REGION_SUBTRACT(pScreen, &rgnDst, &rgnDst, &rgnOther);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now copy the parent along with all child windows using the same depth. */
|
|
||||||
nbox = REGION_NUM_RECTS(&rgnDst);
|
|
||||||
if(nbox &&
|
|
||||||
(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
|
|
||||||
pbox = REGION_RECTS(&rgnDst);
|
|
||||||
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
|
|
||||||
ppt->x = pbox->x1 + dx;
|
|
||||||
ppt->y = pbox->y1 + dy;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pWin->drawable.bitsPerPixel == 8)
|
|
||||||
cfbDoBitbltCopy((DrawablePtr)pScreenPriv->pix8,
|
|
||||||
(DrawablePtr)pScreenPriv->pix8,
|
|
||||||
GXcopy, &rgnDst, pptSrc, ~0L);
|
|
||||||
else
|
|
||||||
cfb32DoBitbltCopy((DrawablePtr)pScreenPriv->pix32,
|
|
||||||
(DrawablePtr)pScreenPriv->pix32,
|
|
||||||
GXcopy, &rgnDst, pptSrc, ~0L);
|
|
||||||
|
|
||||||
DEALLOCATE_LOCAL(pptSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &rgnDst);
|
|
||||||
|
|
||||||
if (pPixChildren) {
|
|
||||||
nbox = REGION_NUM_RECTS(&rgnOther);
|
|
||||||
pptSrc = (DDXPointPtr) ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec));
|
|
||||||
if (pptSrc) {
|
|
||||||
pbox = REGION_RECTS(&rgnOther);
|
|
||||||
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
|
|
||||||
ppt->x = pbox->x1 - rgnOther.extents.x1;
|
|
||||||
ppt->y = pbox->y1 - rgnOther.extents.y1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (other_bpp == 8)
|
|
||||||
cfbDoBitbltCopy((DrawablePtr)pPixChildren,
|
|
||||||
(DrawablePtr)pScreenPriv->pix8,
|
|
||||||
GXcopy, &rgnOther, pptSrc, ~0L);
|
|
||||||
else
|
|
||||||
cfb32DoBitbltCopy((DrawablePtr)pPixChildren,
|
|
||||||
(DrawablePtr)pScreenPriv->pix32,
|
|
||||||
GXcopy, &rgnOther, pptSrc, ~0L);
|
|
||||||
|
|
||||||
DEALLOCATE_LOCAL(pptSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (other_bpp == 8)
|
|
||||||
cfbDestroyPixmap(pPixChildren);
|
|
||||||
else
|
|
||||||
cfb32DestroyPixmap(pPixChildren);
|
|
||||||
}
|
|
||||||
REGION_UNINIT(pScreen, &rgnOther);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
|
||||||
cfb8_32WidChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
cfb8_32WidWindowExposures(WindowPtr pWin, RegionPtr pReg, RegionPtr pOtherReg)
|
|
||||||
{
|
|
||||||
/* Fill in the WID channel before rendering of
|
|
||||||
* the exposed window area.
|
|
||||||
*/
|
|
||||||
if (REGION_NUM_RECTS(pReg)) {
|
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
|
|
||||||
|
|
||||||
pScreenPriv->WIDOps->WidFillBox((DrawablePtr)pScreenPriv->pixWid,
|
|
||||||
(DrawablePtr)pWin,
|
|
||||||
REGION_NUM_RECTS(pReg), REGION_RECTS(pReg));
|
|
||||||
}
|
|
||||||
|
|
||||||
miWindowExposures(pWin, pReg, pOtherReg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
cfb8_32WidPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
|
|
||||||
{
|
|
||||||
if (what == PW_BORDER) {
|
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
||||||
cfb8_32WidScreenPtr pScreenPriv =
|
|
||||||
CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
|
|
||||||
|
|
||||||
pScreenPriv->WIDOps->WidFillBox((DrawablePtr)pScreenPriv->pixWid,
|
|
||||||
(DrawablePtr)pWin,
|
|
||||||
REGION_NUM_RECTS(pRegion),
|
|
||||||
REGION_RECTS(pRegion));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pWin->drawable.bitsPerPixel == 8)
|
|
||||||
cfbPaintWindow(pWin, pRegion, what);
|
|
||||||
else
|
|
||||||
cfb32PaintWindow(pWin, pRegion, what);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user