Merge branch 'master' into mpx

This commit is contained in:
Peter Hutterer 2008-05-26 17:37:31 +09:30
commit 26c1958c32
155 changed files with 34604 additions and 13167 deletions

8
.gitignore vendored
View File

@ -37,14 +37,6 @@ xorg-server.pc
stamp-h?
do-not-use-config.h
do-not-use-config.h.in
afb/afbbltC.c
afb/afbbltCI.c
afb/afbbltG.c
afb/afbbltO.c
afb/afbbltX.c
afb/afbseg.c
afb/afbtileC.c
afb/afbtileG.c
cfb/cfb8lineCO.c
cfb/cfb8lineCP.c
cfb/cfb8lineG.c

View File

@ -1,9 +0,0 @@
SUBDIRS = glx
WINDOWS_EXTRAS = \
windows/ChangeLog \
windows/glwindows.h \
windows/glwrap.c \
windows/indirect.c
EXTRA_DIST = symlink-mesa.sh $(WINDOWS_EXTRAS)

13
GL/glx/.gitignore vendored
View File

@ -1,13 +0,0 @@
glapi.c
glcontextmodes.c
glcontextmodes.h
glthread.c
indirect_dispatch.c
indirect_dispatch.h
indirect_dispatch_swap.c
indirect_reqsize.c
indirect_reqsize.h
indirect_size.h
indirect_size_get.c
indirect_size_get.h
indirect_table.c

View File

@ -1,528 +0,0 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Brian E. Paul <brian@precisioninsight.com>
*
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <string.h>
#include <dlfcn.h>
#define _NEED_GL_CORE_IF
#include <GL/xmesa.h>
#include <GL/internal/glcore.h>
#include <glxserver.h>
#include <glxscreens.h>
#include <glxdrawable.h>
#include <glxcontext.h>
#include <glxutil.h>
#include "os.h"
#define XMesaCreateVisual (*glcore->XMesaCreateVisual)
#define XMesaDestroyVisual (*glcore->XMesaDestroyVisual)
#define XMesaCreateWindowBuffer (*glcore->XMesaCreateWindowBuffer)
#define XMesaCreatePixmapBuffer (*glcore->XMesaCreatePixmapBuffer)
#define XMesaDestroyBuffer (*glcore->XMesaDestroyBuffer)
#define XMesaSwapBuffers (*glcore->XMesaSwapBuffers)
#define XMesaResizeBuffers (*glcore->XMesaResizeBuffers)
#define XMesaCreateContext (*glcore->XMesaCreateContext)
#define XMesaDestroyContext (*glcore->XMesaDestroyContext)
#define XMesaCopyContext (*glcore->XMesaCopyContext)
#define XMesaMakeCurrent2 (*glcore->XMesaMakeCurrent2)
#define XMesaForceCurrent (*glcore->XMesaForceCurrent)
#define XMesaLoseCurrent (*glcore->XMesaLoseCurrent)
typedef struct __GLXMESAscreen __GLXMESAscreen;
typedef struct __GLXMESAcontext __GLXMESAcontext;
typedef struct __GLXMESAdrawable __GLXMESAdrawable;
struct __GLXMESAscreen {
__GLXscreen base;
int index;
int num_vis;
XMesaVisual *xm_vis;
void *driver;
const __GLcoreModule *glcore;
};
struct __GLXMESAcontext {
__GLXcontext base;
XMesaContext xmesa;
};
struct __GLXMESAdrawable {
__GLXdrawable base;
XMesaBuffer xm_buf;
__GLXMESAscreen *screen;
};
static XMesaVisual find_mesa_visual(__GLXscreen *screen, XID fbconfigID);
static void
__glXMesaDrawableDestroy(__GLXdrawable *base)
{
__GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base;
const __GLcoreModule *glcore = glxPriv->screen->glcore;
if (glxPriv->xm_buf != NULL)
XMesaDestroyBuffer(glxPriv->xm_buf);
xfree(glxPriv);
}
static GLboolean
__glXMesaDrawableResize(__GLXdrawable *base)
{
__GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base;
const __GLcoreModule *glcore = glxPriv->screen->glcore;
XMesaResizeBuffers(glxPriv->xm_buf);
return GL_TRUE;
}
static GLboolean
__glXMesaDrawableSwapBuffers(__GLXdrawable *base)
{
__GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base;
const __GLcoreModule *glcore = glxPriv->screen->glcore;
/* This is terrifying: XMesaSwapBuffers() ends up calling CopyArea
* to do the buffer swap, but this assumes that the server holds
* the lock and has its context visible. If another screen uses a
* DRI driver, that will have installed the DRI enter/leave server
* functions, which lifts the lock during GLX dispatch. This is
* why we need to re-take the lock and swap in the server context
* before calling XMesaSwapBuffers() here. /me shakes head. */
__glXenterServer(GL_FALSE);
XMesaSwapBuffers(glxPriv->xm_buf);
__glXleaveServer(GL_FALSE);
return GL_TRUE;
}
static __GLXdrawable *
__glXMesaScreenCreateDrawable(__GLXscreen *screen,
DrawablePtr pDraw, int type,
XID drawId,
__GLXconfig *modes)
{
__GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
const __GLcoreModule *glcore = mesaScreen->glcore;
__GLXMESAdrawable *glxPriv;
XMesaVisual xm_vis;
glxPriv = xalloc(sizeof *glxPriv);
if (glxPriv == NULL)
return NULL;
memset(glxPriv, 0, sizeof *glxPriv);
glxPriv->screen = mesaScreen;
if (!__glXDrawableInit(&glxPriv->base, screen,
pDraw, type, drawId, modes)) {
xfree(glxPriv);
return NULL;
}
glxPriv->base.destroy = __glXMesaDrawableDestroy;
glxPriv->base.resize = __glXMesaDrawableResize;
glxPriv->base.swapBuffers = __glXMesaDrawableSwapBuffers;
xm_vis = find_mesa_visual(screen, modes->fbconfigID);
if (xm_vis == NULL) {
ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
modes->visualID);
xfree(glxPriv);
return NULL;
}
if (glxPriv->base.type == DRAWABLE_WINDOW) {
glxPriv->xm_buf = XMesaCreateWindowBuffer(xm_vis, (WindowPtr)pDraw);
} else {
glxPriv->xm_buf = XMesaCreatePixmapBuffer(xm_vis, (PixmapPtr)pDraw, 0);
}
if (glxPriv->xm_buf == NULL) {
xfree(glxPriv);
return NULL;
}
return &glxPriv->base;
}
static void
__glXMesaContextDestroy(__GLXcontext *baseContext)
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
__GLXMESAscreen *screen = (__GLXMESAscreen *) context->base.pGlxScreen;
const __GLcoreModule *glcore = screen->glcore;
XMesaDestroyContext(context->xmesa);
__glXContextDestroy(&context->base);
xfree(context);
}
static int
__glXMesaContextMakeCurrent(__GLXcontext *baseContext)
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
__GLXMESAdrawable *drawPriv = (__GLXMESAdrawable *) context->base.drawPriv;
__GLXMESAdrawable *readPriv = (__GLXMESAdrawable *) context->base.readPriv;
__GLXMESAscreen *screen = (__GLXMESAscreen *) context->base.pGlxScreen;
const __GLcoreModule *glcore = screen->glcore;
return XMesaMakeCurrent2(context->xmesa,
drawPriv->xm_buf,
readPriv->xm_buf);
}
static int
__glXMesaContextLoseCurrent(__GLXcontext *baseContext)
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
__GLXMESAscreen *screen = (__GLXMESAscreen *) context->base.pGlxScreen;
const __GLcoreModule *glcore = screen->glcore;
return XMesaLoseCurrent(context->xmesa);
}
static int
__glXMesaContextCopy(__GLXcontext *baseDst,
__GLXcontext *baseSrc,
unsigned long mask)
{
__GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst;
__GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc;
__GLXMESAscreen *screen = (__GLXMESAscreen *) dst->base.pGlxScreen;
const __GLcoreModule *glcore = screen->glcore;
return XMesaCopyContext(src->xmesa, dst->xmesa, mask);
}
static int
__glXMesaContextForceCurrent(__GLXcontext *baseContext)
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
__GLXMESAscreen *screen = (__GLXMESAscreen *) context->base.pGlxScreen;
const __GLcoreModule *glcore = screen->glcore;
/* GlxSetRenderTables() call for XGL moved in XMesaForceCurrent() */
return XMesaForceCurrent(context->xmesa);
}
static __GLXcontext *
__glXMesaScreenCreateContext(__GLXscreen *screen,
__GLXconfig *config,
__GLXcontext *baseShareContext)
{
__GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
const __GLcoreModule *glcore = mesaScreen->glcore;
__GLXMESAcontext *context;
__GLXMESAcontext *shareContext = (__GLXMESAcontext *) baseShareContext;
XMesaVisual xm_vis;
XMesaContext xm_share;
context = xalloc (sizeof (__GLXMESAcontext));
if (context == NULL)
return NULL;
memset(context, 0, sizeof *context);
context->base.pGlxScreen = screen;
context->base.config = config;
context->base.destroy = __glXMesaContextDestroy;
context->base.makeCurrent = __glXMesaContextMakeCurrent;
context->base.loseCurrent = __glXMesaContextLoseCurrent;
context->base.copy = __glXMesaContextCopy;
context->base.forceCurrent = __glXMesaContextForceCurrent;
xm_vis = find_mesa_visual(screen, config->fbconfigID);
if (!xm_vis) {
ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
config->visualID);
xfree(context);
return NULL;
}
xm_share = shareContext ? shareContext->xmesa : NULL;
context->xmesa = XMesaCreateContext(xm_vis, xm_share);
if (!context->xmesa) {
xfree(context);
return NULL;
}
return &context->base;
}
static void
__glXMesaScreenDestroy(__GLXscreen *screen)
{
__GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
const __GLcoreModule *glcore = mesaScreen->glcore;
int i;
if (mesaScreen->xm_vis) {
for (i = 0; i < mesaScreen->base.numFBConfigs; i++) {
if (mesaScreen->xm_vis[i])
XMesaDestroyVisual(mesaScreen->xm_vis[i]);
}
xfree(mesaScreen->xm_vis);
}
dlclose(mesaScreen->driver);
__glXScreenDestroy(screen);
xfree(screen);
}
static XMesaVisual
find_mesa_visual(__GLXscreen *screen, XID fbconfigID)
{
__GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
const __GLXconfig *config;
unsigned i = 0;
for (config = screen->fbconfigs; config != NULL; config = config->next) {
if (config->fbconfigID == fbconfigID)
return mesaScreen->xm_vis[i];
i++;
}
return NULL;
}
const static int numBack = 2;
const static int numDepth = 2;
const static int numStencil = 2;
static const int glx_visual_types[] = {
GLX_STATIC_GRAY,
GLX_GRAY_SCALE,
GLX_STATIC_COLOR,
GLX_PSEUDO_COLOR,
GLX_TRUE_COLOR,
GLX_DIRECT_COLOR
};
static __GLXconfig *
createFBConfigsForVisual(__GLXscreen *screen, ScreenPtr pScreen,
VisualPtr visual, __GLXconfig *config)
{
int back, depth, stencil;
/* FIXME: Ok, I'm making all this up... anybody has a better idea? */
for (back = numBack - 1; back >= 0; back--)
for (depth = 0; depth < numDepth; depth++)
for (stencil = 0; stencil < numStencil; stencil++) {
config->next = xcalloc(sizeof(*config), 1);
config = config->next;
config->visualRating = GLX_NONE;
config->visualType = glx_visual_types[visual->class];
config->xRenderable = GL_TRUE;
config->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
config->rgbMode = (visual->class >= TrueColor);
config->colorIndexMode = !config->rgbMode;
config->renderType =
(config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
config->doubleBufferMode = back;
config->haveDepthBuffer = depth;
config->depthBits = depth ? visual->nplanes : 0;
config->haveStencilBuffer = stencil;
config->stencilBits = stencil ? visual->bitsPerRGBValue : 0;
config->haveAccumBuffer = 0;
config->redBits = Ones(visual->redMask);
config->greenBits = Ones(visual->greenMask);
config->blueBits = Ones(visual->blueMask);
config->alphaBits = 0;
config->redMask = visual->redMask;
config->greenMask = visual->greenMask;
config->blueMask = visual->blueMask;
config->alphaMask = 0;
config->rgbBits = config->rgbMode ? visual->nplanes : 0;
config->indexBits = config->colorIndexMode ? visual->nplanes : 0;
}
return config;
}
static void
createFBConfigs(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
{
__GLXconfig head, *tail;
int i;
/* We assume here that each existing visual correspond to a
* different visual class. Note, this runs before COMPOSITE adds
* its visual, so it's not entirely crazy. */
pGlxScreen->numFBConfigs = pScreen->numVisuals * numBack * numDepth * numStencil;
head.next = NULL;
tail = &head;
for (i = 0; i < pScreen->numVisuals; i++)
tail = createFBConfigsForVisual(pGlxScreen, pScreen,
&pScreen->visuals[i], tail);
pGlxScreen->fbconfigs = head.next;
}
static void
createMesaVisuals(__GLXMESAscreen *pMesaScreen)
{
const __GLcoreModule *glcore = pMesaScreen->glcore;
__GLXconfig *config;
ScreenPtr pScreen;
VisualPtr visual = NULL;
int i, j;
i = 0;
pScreen = pMesaScreen->base.pScreen;
pMesaScreen->xm_vis =
xcalloc(pMesaScreen->base.numFBConfigs, sizeof (XMesaVisual));
for (config = pMesaScreen->base.fbconfigs; config != NULL; config = config->next) {
for (j = 0; j < pScreen->numVisuals; j++)
if (pScreen->visuals[j].vid == config->visualID) {
visual = &pScreen->visuals[j];
break;
}
pMesaScreen->xm_vis[i++] =
XMesaCreateVisual(pScreen,
visual,
config->rgbMode,
(config->alphaBits > 0),
config->doubleBufferMode,
config->stereoMode,
GL_TRUE, /* ximage_flag */
config->depthBits,
config->stencilBits,
config->accumRedBits,
config->accumGreenBits,
config->accumBlueBits,
config->accumAlphaBits,
config->samples,
config->level,
config->visualRating);
}
}
static const char dri_driver_path[] = DRI_DRIVER_PATH;
static __GLXscreen *
__glXMesaScreenProbe(ScreenPtr pScreen)
{
__GLXMESAscreen *screen;
char filename[128];
screen = xalloc(sizeof *screen);
if (screen == NULL)
return NULL;
snprintf(filename, sizeof filename, "%s/%s.so",
dri_driver_path, "libGLcore");
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
if (screen->driver == NULL) {
LogMessage(X_ERROR, "GLX error: dlopen of %s failed (%s)\n",
filename, dlerror());
goto handle_error;
}
screen->glcore = dlsym(screen->driver, __GL_CORE);
if (screen->glcore == NULL) {
LogMessage(X_ERROR, "GLX error: dlsym for %s failed (%s)\n",
__GL_CORE, dlerror());
goto handle_error;
}
/*
* Find the GLX visuals that are supported by this screen and create
* XMesa's visuals.
*/
createFBConfigs(&screen->base, pScreen);
__glXScreenInit(&screen->base, pScreen);
/* Now that GLX has created the corresponding X visual, create the mesa visuals. */
createMesaVisuals(screen);
screen->base.destroy = __glXMesaScreenDestroy;
screen->base.createContext = __glXMesaScreenCreateContext;
screen->base.createDrawable = __glXMesaScreenCreateDrawable;
screen->base.swapInterval = NULL;
screen->base.pScreen = pScreen;
LogMessage(X_INFO, "GLX: Loaded and initialized %s\n", filename);
return &screen->base;
handle_error:
if (screen->driver)
dlclose(screen->driver);
xfree(screen);
FatalError("GLX: could not load software renderer\n");
return NULL;
}
__GLXprovider __glXMesaProvider = {
__glXMesaScreenProbe,
"MESA",
NULL
};
__GLXprovider *
GlxGetMesaProvider (void)
{
return &__glXMesaProvider;
}

View File

@ -1,180 +0,0 @@
#!/bin/sh
#
# A script that symlinks source files from Mesa to modular
#
# Author: Soren Sandmann (sandmann@redhat.com) (original)
# adapted for Mesa by Adam Jackson (ajax@nwnk.net)
#
# Things we would like to do
#
# - Check that all the relevant files exist
# - AUTHORS, autogen.sh, configure.ac, ...
# - Check that we have actually linked everything
# - if a file doesn't need to be linked, then it needs
# to be listed as "not-linked"
# - Compute diffs between all the files (shouldn't be necessary)
# - possibly check that files are listet in Makefile.am's
# - Clean target directory of irrelevant files
#
check_destinations () {
# don't do anything - we are relying on the side
# effect of dst_dir
true
}
check_exist() {
# Check whether $1 exists
if [ ! -e $1 ] ; then
error "$1 not found"
fi
}
delete_existing() {
# Delete $2
rm -f $2
}
link_files() {
# Link $1 to $2
if [ ! -e $2 ] ; then
ln -s $1 $2
fi
}
main() {
check_args $1 $2
run check_destinations "Creating destination directories"
run check_exist "Checking that the source files exist"
run delete_existing "Deleting existing files"
run link_files "Linking files"
}
## actual symlinking
symlink_glx() {
# this is... unpleasant
src_dir src/glx/x11
dst_dir glx
action indirect_size.h
action glcontextmodes.c
action glcontextmodes.h
action indirect_dispatch.c
action indirect_dispatch.h
action indirect_dispatch_swap.c
action indirect_reqsize.c
action indirect_reqsize.h
action indirect_size_get.c
action indirect_size_get.h
action indirect_table.c
src_dir src/mesa/glapi
action glapi.c
action glthread.c
}
#########
#
# Helper functions
#
#########
error() {
echo
echo \ \ \ error:\ \ \ $1
exit 1
}
# printing out what's going on
run_module() {
# $1 module
# $2 explanation
echo -n $EXPLANATION for $1 module ...\
symlink_$1
echo DONE
}
run() {
# $1 what to do
# $2 explanation
ACTION=$1 EXPLANATION=$2 run_module glx
}
src_dir() {
REAL_SRC_DIR=$SRC_DIR/$1
if [ ! -d $REAL_SRC_DIR ] ; then
error "Source directory $REAL_SRC_DIR does not exist"
fi
}
dst_dir() {
REAL_DST_DIR=$DST_DIR/$1
if [ ! -d $REAL_DST_DIR ] ; then
mkdir -p $REAL_DST_DIR
fi
}
action() {
if [ -z $2 ] ; then
$ACTION $REAL_SRC_DIR/$1 $REAL_DST_DIR/$1
else
$ACTION $REAL_SRC_DIR/$1 $REAL_DST_DIR/$2
fi
}
usage() {
echo symlink-mesa.sh src-dir dst-dir
echo src-dir: the Mesa source directory
echo dst-dir: the GL subdirectory of the Xserver modular tree
}
# Check commandline args
check_args() {
if [ -z $1 ] ; then
echo Missing source dir
usage
exit 1
fi
if [ -z $2 ] ; then
echo Missing destination dir
usage
exit 1
fi
if [ ! -d $1 ] ; then
echo $1 is not a dir
usage
exit 1
fi
if [ ! -d $2 ] ; then
echo $2 is not a dir
usage
exit 1
fi
if [ $1 = $2 ] ; then
echo source and destination can\'t be the same
usage
exit 1
fi
D=`dirname "$relpath"`
B=`basename "$relpath"`
abspath="`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B"
SRC_DIR=`( cd $1 ; pwd )`
DST_DIR=`(cd $2 ; pwd )`
}
main $1 $2

View File

@ -9,16 +9,12 @@ if XTRAP
XTRAP_DIR=XTrap
endif
if AFB
AFB_DIR=afb
endif
if MFB
MFB_DIR=mfb
endif
if GLX
GLX_DIR=GL
GLX_DIR=glx
endif
if DBE
@ -44,7 +40,6 @@ SUBDIRS = \
xkb \
$(DBE_DIR) \
$(MFB_DIR) \
$(AFB_DIR) \
$(RECORD_DIR) \
xfixes \
damageext \
@ -88,13 +83,12 @@ DIST_SUBDIRS = \
xkb \
dbe \
mfb \
afb \
record \
xfixes \
damageext \
XTrap \
composite \
GL \
glx \
exa \
config \
hw

View File

@ -850,10 +850,6 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
VisualPtr pVisual = NULL;
int i;
/* if screen is 0, orig is already the correct visual ID */
if (screen == 0)
return orig;
for (i = 0; i < PanoramiXNumVisuals; i++) {
if (orig == PanoramiXVisuals[i].vid) {
pVisual = &PanoramiXVisuals[i];
@ -864,6 +860,10 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
if (!pVisual)
return 0;
/* if screen is 0, orig is already the correct visual ID */
if (screen == 0)
return orig;
/* found the original, now translate it relative to the backend screen */
for (i = 0; i < pOtherScreen->numVisuals; i++) {
VisualPtr pOtherVisual = &pOtherScreen->visuals[i];

View File

@ -1,51 +0,0 @@
noinst_LTLIBRARIES = libafb.la
AM_CFLAGS = $(DIX_CFLAGS)
libafb_gen_sources = afbbltC.c afbbltX.c afbbltCI.c afbbltO.c afbbltG.c afbtileC.c afbtileG.c afbseg.c
DISTCLEANFILES = $(libafb_gen_sources)
libafb_la_SOURCES = afbgc.c afbwindow.c afbfont.c afbfillrct.c afbpixmap.c \
afbimage.c afbline.c afbbres.c afbhrzvert.c afbbresd.c afbpushpxl.c afbply1rct.c \
afbzerarc.c afbfillarc.c afbfillsp.c afbsetsp.c afbscrinit.c afbplygblt.c \
afbclip.c afbgetsp.c afbpolypnt.c afbbitblt.c afbcmap.c afbimggblt.c afbpntarea.c \
afbmisc.c afbtegblt.c $(libafb_gen_sources)
INCLUDES = -I$(top_srcdir)/mfb -I$(top_srcdir)/hw/xfree86/os-support
EXTRA_DIST = afbline.c afbblt.c afbtile.c README Xdaniver.doc
afbseg.c:
echo "#define POLYSEGMENT" > $@
echo "#include \"$(srcdir)/afbline.c\"" >> $@
afbbltC.c:
echo "#define MROP Mcopy" > $@
echo "#include \"$(srcdir)/afbblt.c\"" >> $@
afbbltX.c:
echo "#define MROP Mxor" > $@
echo "#include \"$(srcdir)/afbblt.c\"" >> $@
afbbltCI.c:
echo "#define MROP McopyInverted" > $@
echo "#include \"$(srcdir)/afbblt.c\"" >> $@
afbbltO.c:
echo "#define MROP Mor" > $@
echo "#include \"$(srcdir)/afbblt.c\"" >> $@
afbbltG.c:
echo "#define MROP 0" > $@
echo "#include \"$(srcdir)/afbblt.c\"" >> $@
afbtileC.c:
echo "#define MROP Mcopy" > $@
echo "#include \"$(srcdir)/afbtile.c\"" >> $@
afbtileG.c:
echo "#define MROP 0" > $@
echo "#include \"$(srcdir)/afbtile.c\"" >> $@
sdk_HEADERS = afb.h

View File

@ -1,10 +0,0 @@
All stuff in this directory is based on Xdaniver (read Xdaniver.doc).
Actually this is the same code as in the ilbm directory, except that here the
conversion from normal bitplanes to interleaved bitplanes didn't happen.
--
Geert Uytterhoeven Geert.Uytterhoeven@cs.kuleuven.ac.be
Wavelets, Linux/m68k on Amiga http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

View File

@ -1,218 +0,0 @@
What is it?
-----------
Xdaniver is a fast, colour X11R6 server for the Amiga's custom chip set
under NetBSD 1.0 and NetBSD-current, supporting all the Amiga's display
depths from 1 to 4 (upto 16 colours) on ECS machines and 1 to 8 (upto 256
colours) on AGA machines (though, not all resolutions are available, see
General Information below).
Xdaniver is designed to be a drop-in replacement for the Xmono server provided
with the X11R6 binary distribution supplied by Bernd Ernesti available from
ftp.uni-regensburg.de or one of its mirrors.
Unlike previous colour X servers for the Amiga that emulate a chunky pixel
screen in fast RAM, use the standard frame buffer drivers provided with the
X11R6 source code to draw and then use a chunky to planar conversion routine
to write the results to the screen (all very slow), Xdaniver uses a heavily
modified mono frame buffer driver to draw directly using the Amiga's planar
format. The net result is much faster drawing and support for all the Amiga's
custom display depths but, as usual, the fewer planes used, the faster the
drawing operations of the X server. Even so, on my A1200 with a 33Mhz 68030,
I'm getting reasonable performance when using 8 bit planes in Dbl NTSC mode.
Installation
------------
You will need to have first obtained and installed the X11R6 binary
distribution available from ftp.uni-regensburg.de in
/pub/NetBSD-Amiga/contrib/X11 or one of its mirrors. Xdaniver has been
compiled to expect font and configuration files sitting under
/usr/local/X11R6, if your setup is different you will need to provide a
symbolic link from /usr/local/X11R6 to where your tree resides or supply
several command line flags to the server.
To get Xdaniver running as the default X server, copy the uncompressed binary
into /usr/local/X11R6/bin, remove the current X file from that directory
(which is a symbolic link to Xmono) and replace it with a link to Xdaniver:
gzip -d < X11R6.Xdaniver.1.01.tar.gz | tar xvf -
mv Xdaniver /usr/local/X11R6/bin
cd /usr/local/X11R6/bin
rm X
ln -s Xdaniver X
Note that on some setups, the devices /dev/kbd, /dev/mouse and /dev/view??
have been created to be accessable only by superuser; Xdaniver needs to open
these devices. To workaround this problem, log on as superuser and then
either make Xdaniver setuid root:
chown root Xdaniver
chmod 4755 Xdaniver
or give everyone access the devices:
chmod 666 /dev/kbd /dev/mouse /dev/view??
the latter option is a possible cause of a security hole if your machine is
ever used multi-user.
General Information
-------------------
The default resolution of the server is 700x430 and the default depth 4. AGA
users might what to increase the display depth by editing the startx script
and providing a -depth <depth> argument to Xdaniver on the xinit line of the
script. As always, the lower the depth, the faster the drawing and window
manipulation of the server.
The resolution can be altered similarly by suppling -width <width> and
-height <height> arguments to the server.
The NetBSD kernel selects actual screen modes by picking a mode who's
natural, non-overscanned size best-fits the requested resolution.
Unfortunately, for AGA users, the 1.0 kernel only has support for the
Dbl-NTSC AGA display mode and only this mode has support for depths greater
than 4. The NetBSD-current (work-in-progress) kernel also has support for
Dbl-PAL but still no support for the Super72 or other super-hires modes
(perhaps some kind, kernel-hacker could add support for them ?).
If you have a 2 button mouse (like me) you might want to try and use the 3
button mouse emulation. On other systems, it is usual for the left and right
buttons to be provided and emulate the middle button by pressing both
buttons together, however, the middle button is tends to be used more than
the right button so I have provided two options:
-emulateright (or -3), the two physical mouse buttons act as left and middle
and pressing them both together emulates the right button.
-emulatemiddle (or -2), the two physical mouse buttons act as left and right
and pressing them both together emulated the middle button.
When using screen depths of less than 6 (4 is the maximum for ECS machines)
the lack of possible colours on screen at once causes problems for many X
applications. Specifying -cc 2 as a command line argument to Xdaniver
causes the server to switch the default visual type from PsuedoColor to
StaticColor; to put it simply, the server prefills the colormap with a
selection of 16 colours (depth 4) and when an application asks for a
particular colour, its gets allocated one that is closest to one from the
selection of 16. This removes the 'WARNING: Cannot allocate colormap entry
for "XXX"' errors but at the expense of applications not being able to get
the precise colour they wanted. Also, some badly written X applications fail
altogether when presented with a StaticColor visual.
Bugs/Limitations
----------------
The limited choice of display resolutions for AGA/ECS machines is a real
pain - requires a kernel change to fix. Worse still, the kernel specifies
the maximum overscan resolution on the Dbl-NTSC to be 724x482 but selecting
anything more than 702x430 on my machine causes the screen either sheer
diagonally (as if the bytes per row calculation in Xdaniver or the kernel is
wrong) or completely loose sync (suggesting a custom chip register sync
calculation bug). As other, non-aga modes aren't affected when selection
overscan both problems seem to point to a kernel driver bug. Also, depths
greater than 4 for AGA users are only supported by the kernel in the Dbl-NTSC
mode (and Dbl-PAL with the current-NetBSD kernel).
I know of one bug so-far (there will be more), The PutImage request of an XY
format image expects the bitplane order to be the reverse of that specified
in the X protocol but since virtually all applications use the Z (chunky)
format, you are unlikely to come across this problem.
The PutImage request of Z format images is a little slow - when I have time
I'll try and add one of the fast assembly chunky-to-planar routines developed
for doom style games/demos. Unfortunately, the current crop all require a
picture size that is a multiple of 32 pixels and so cannot be used out-of-the-
box.
Some extra performance could easily be squeezed out of the terminal font
drawing code (used by xterm) - when I have time I'll add the code.
The Amiga's blitter and sprites are totally unused and will remain so
until/if someone else adds support to the kernel. The blitter would help
speed up screen scrolling and window manipulation and sprite support could
be used for the X pointer shape (if small enough) which would speed up all
drawing operations (no need to remove the software based pointer shape
first, draw, then replace the pointer shape).
I removed the X image extension (XIE) from the X server as it increased the
size of the binary by some 400k. I haven't come across any applications that
need it yet (I haven't been looking!) so if you need the extension for some
reason send me e-mail and I'll build a server with the extension included.
The 3 button mouse emulation is very simple - to emulate the 3rd button you
have to press both button precisely at the same moment - I've got quite good
at it now. When I have some spare time I'll add a timer so you will have a
few milli-seconds between one button being pressed and the next and it still
being registered as the emulated button.
AGA users don't forget to provide the -A flag to loadbsd to enable the one
AGA mode in the 1.0 kernel but only if you have a VGA, multisync or dual-scan
monitor, of course !
Xdaniver has been tested on:
A1200, 33Mhz 68030, 8Mb RAM and NetBSD 1.0 by myself.
A4000/40, 12Mb RAM and NetBSD 1.0 by Andreas Holzhammer.
A3000, 12Mb RAM and NetBSD 1.0 by Charlie Root, Stuart Park and others.
A3000, 25Mhz 68040, 18Mb RAM and NetBSD-current by Michael K. Sanders.
A2000, 8Mb RAM and NetBSD (version unknown) by Hubert Feyrer.
Release and Bug Fix History
---------------------------
1.0 - First release
1.01 Bugs fixed:
- Narrow (<32 pixels) Z format GetImage requests corrupted the stack
and could cause the server to core dump. (Xpaint caused this problem)
- Drawing dots (PolyPoint request) into a clipped window caused a
c pointer to go out of range, causing a core dump (xv showed this
problem).
New features:
- Simple 3 button mouse emulation using a 2 button mouse; specify
-emulate_middle (or -2) or -emulate_right (or -3) on the server's
command line and press both mouse buttons together emulate the 'missing'
button.
- Basic beep sound support added by sending bell characters to the
console.
- Source code released.
Disclaimer and Copyright Notices
--------------------------------
Multi-depth planar frame buffer code:
Copyright (c) 1995 by Daniver Limited.
Large portions:
Copyright (c) 1994 by Eduardo Horvath.
Copyright (c) 1987-1995 by the Regents of the University of California.
Copyright (c) 1987 by Sun Microsystems, Inc. Mountain View, CA.
Copyright (c) 1987-1995 by X Consortium.
Copyright (c) 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
Copyright (c) 1989 Network Computing Devices, Inc., Mountain View, California.
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. The Daniver Limited,
the above companies and individuals makes no representations about the
suitability of this software for any purpose. It is provided "as is" without
express or implied warranty.
Credits
-------
Thanks to Bernd Ernesti for making the operating system server source code
available for others to use and Eduardo Horvath and Andy Heffernan, who (I
think) did the original Xmono server port.
Also, many thanks to the first brave users who tested Xdaniver for me on other
Amiga setups and found a few bugs in the process.
Gary Henderson.
Daytime: garyh@wet.sbi.com
Home: gary@daniver.demon.co.uk

972
afb/afb.h
View File

@ -1,972 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
/* Monochrome Frame Buffer definitions
written by drewry, september 1986
*/
#include "pixmap.h"
#include "region.h"
#include "gc.h"
#include "colormap.h"
#include "regionstr.h"
#include "privates.h"
#include "mibstore.h"
#include "mfb.h"
extern int afbInverseAlu[];
/* warning: PixelType definition duplicated in maskbits.h */
#ifndef PixelType
#define PixelType CARD32
#endif /* PixelType */
#define AFB_MAX_DEPTH 8
/* afbbitblt.c */
extern void afbDoBitblt(
DrawablePtr /*pSrc*/,
DrawablePtr /*pDst*/,
int /*alu*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
unsigned long /*planemask*/
);
extern RegionPtr afbCopyArea(
DrawablePtr /*pSrcDrawable*/,
DrawablePtr /*pDstDrawable*/,
GCPtr/*pGC*/,
int /*srcx*/,
int /*srcy*/,
int /*width*/,
int /*height*/,
int /*dstx*/,
int /*dsty*/
);
/* afbbltC.c */
extern void afbDoBitbltCopy(
DrawablePtr /*pSrc*/,
DrawablePtr /*pDst*/,
int /*alu*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
unsigned long /*planemask*/
);
/* afbbltCI.c */
extern void afbDoBitbltCopyInverted(
DrawablePtr /*pSrc*/,
DrawablePtr /*pDst*/,
int /*alu*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
unsigned long /*planemask*/
);
/* afbbltG.c */
extern void afbDoBitbltGeneral(
DrawablePtr /*pSrc*/,
DrawablePtr /*pDst*/,
int /*alu*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
unsigned long /*planemask*/
);
/* afbbltO.c */
extern void afbDoBitbltOr(
DrawablePtr /*pSrc*/,
DrawablePtr /*pDst*/,
int /*alu*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
unsigned long /*planemask*/
);
/* afbbltX.c */
extern void afbDoBitbltXor(
DrawablePtr /*pSrc*/,
DrawablePtr /*pDst*/,
int /*alu*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
unsigned long /*planemask*/
);
/* afbbres.c */
extern void afbBresS(
PixelType * /*addrl*/,
int /*nlwidth*/,
int /*sizeDst*/,
int /*depthDst*/,
int /*signdx*/,
int /*signdy*/,
int /*axis*/,
int /*x1*/,
int /*y1*/,
int /*e*/,
int /*e1*/,
int /*e2*/,
int /*len*/,
unsigned char * /*rrops*/
);
/* afbbresd.c */
extern void afbBresD(
int * /*pdashIndex*/,
unsigned char * /*pDash*/,
int /*numInDashList*/,
int * /*pdashOffset*/,
int /*isDoubleDash*/,
PixelType * /*addrl*/,
int /*nlwidth*/,
int /*sizeDst*/,
int /*depthDst*/,
int /*signdx*/,
int /*signdy*/,
int /*axis*/,
int /*x1*/,
int /*y1*/,
int /*e*/,
int /*e1*/,
int /*e2*/,
int /*len*/,
unsigned char * /*rrops*/,
unsigned char * /*bgrrops*/
);
/* afbclip.c */
extern RegionPtr afbPixmapToRegion(
PixmapPtr /*pPix*/
);
/* afbcmap.c */
extern int afbListInstalledColormaps(
ScreenPtr /*pScreen*/,
Colormap * /*pmaps*/
);
extern void afbInstallColormap(
ColormapPtr /*pmap*/
);
extern void afbUninstallColormap(
ColormapPtr /*pmap*/
);
extern void afbResolveColor(
unsigned short * /*pred*/,
unsigned short * /*pgreen*/,
unsigned short * /*pblue*/,
VisualPtr /*pVisual*/
);
extern Bool afbInitializeColormap(
ColormapPtr /*pmap*/
);
extern Bool afbInitVisuals(
VisualPtr * /*visualp*/,
DepthPtr * /*depthp*/,
int * /*nvisualp*/,
int * /*ndepthp*/,
int * /*rootDepthp*/,
VisualID * /*defaultVisp*/,
unsigned long /*sizes*/,
int /*bitsPerRGB*/
);
/* afbfillarc.c */
extern void afbPolyFillArcSolid(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,
int /*narcs*/,
xArc * /*parcs*/
);
/* afbfillrct.c */
extern void afbPolyFillRect(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
int /*nrectFill*/,
xRectangle * /*prectInit*/
);
/* afbply1rct.c */
extern void afbFillPolygonSolid(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
int /*mode*/,
int /*shape*/,
int /*count*/,
DDXPointPtr /*ptsIn*/
);
/* afbfillsp.c */
extern void afbSolidFS(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
int /*nInit*/,
DDXPointPtr /*pptInit*/,
int * /*pwidthInit*/,
int /*fSorted*/
);
extern void afbStippleFS(
DrawablePtr /*pDrawable*/,
GCPtr/*pGC*/,
int /*nInit*/,
DDXPointPtr /*pptInit*/,
int * /*pwidthInit*/,
int /*fSorted*/
);
extern void afbTileFS(
DrawablePtr /*pDrawable*/,
GCPtr/*pGC*/,
int /*nInit*/,
DDXPointPtr /*pptInit*/,
int * /*pwidthInit*/,
int /*fSorted*/
);
extern void afbUnnaturalTileFS(
DrawablePtr /*pDrawable*/,
GCPtr/*pGC*/,
int /*nInit*/,
DDXPointPtr /*pptInit*/,
int * /*pwidthInit*/,
int /*fSorted*/
);
extern void afbUnnaturalStippleFS(
DrawablePtr /*pDrawable*/,
GCPtr/*pGC*/,
int /*nInit*/,
DDXPointPtr /*pptInit*/,
int * /*pwidthInit*/,
int /*fSorted*/
);
extern void afbOpaqueStippleFS(
DrawablePtr /*pDrawable*/,
GCPtr/*pGC*/,
int /*nInit*/,
DDXPointPtr /*pptInit*/,
int * /*pwidthInit*/,
int /*fSorted*/
);
extern void afbUnnaturalOpaqueStippleFS(
DrawablePtr /*pDrawable*/,
GCPtr/*pGC*/,
int /*nInit*/,
DDXPointPtr /*pptInit*/,
int * /*pwidthInit*/,
int /*fSorted*/
);
/* afbfont.c */
extern Bool afbRealizeFont(
ScreenPtr /*pscr*/,
FontPtr /*pFont*/
);
extern Bool afbUnrealizeFont(
ScreenPtr /*pscr*/,
FontPtr /*pFont*/
);
/* afbgc.c */
extern Bool afbCreateGC(
GCPtr /*pGC*/
);
extern void afbReduceRop(
int /*alu*/,
Pixel /*src*/,
unsigned long /*planemask*/,
int /*depth*/,
unsigned char * /*rrops*/
);
/* afbgetsp.c */
extern void afbGetSpans(
DrawablePtr /*pDrawable*/,
int /*wMax*/,
DDXPointPtr /*ppt*/,
int * /*pwidth*/,
int /*nspans*/,
char * /*pdstStart*/
);
/* afbhrzvert.c */
extern void afbHorzS(
PixelType * /*addrl*/,
int /*nlwidth*/,
int /*sizeDst*/,
int /*depthDst*/,
int /*x1*/,
int /*y1*/,
int /*len*/,
unsigned char * /*rrops*/
);
extern void afbVertS(
PixelType * /*addrl*/,
int /*nlwidth*/,
int /*sizeDst*/,
int /*depthDst*/,
int /*x1*/,
int /*y1*/,
int /*len*/,
unsigned char * /*rrops*/
);
/* afbigbblak.c */
extern void afbImageGlyphBlt (
DrawablePtr /*pDrawable*/,
GCPtr/*pGC*/,
int /*x*/,
int /*y*/,
unsigned int /*nglyph*/,
CharInfoPtr * /*ppci*/,
pointer /*pglyphBase*/
);
/* afbigbwht.c */
/* afbimage.c */
extern void afbPutImage(
DrawablePtr /*dst*/,
GCPtr /*pGC*/,
int /*depth*/,
int /*x*/,
int /*y*/,
int /*w*/,
int /*h*/,
int /*leftPad*/,
int /*format*/,
char * /*pImage*/
);
extern void afbGetImage(
DrawablePtr /*pDrawable*/,
int /*sx*/,
int /*sy*/,
int /*w*/,
int /*h*/,
unsigned int /*format*/,
unsigned long /*planeMask*/,
char * /*pdstLine*/
);
/* afbline.c */
extern void afbLineSS(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
int /*mode*/,
int /*npt*/,
DDXPointPtr /*pptInit*/
);
extern void afbLineSD(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
int /*mode*/,
int /*npt*/,
DDXPointPtr /*pptInit*/
);
/* afbmisc.c */
extern void afbQueryBestSize(
int /*class*/,
unsigned short * /*pwidth*/,
unsigned short * /*pheight*/,
ScreenPtr /*pScreen*/
);
/* afbpntarea.c */
extern void afbSolidFillArea(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
unsigned char * /*rrops*/
);
extern void afbStippleAreaPPW(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
PixmapPtr /*pstipple*/,
unsigned char * /*rrops*/
);
extern void afbStippleArea(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
PixmapPtr /*pstipple*/,
int /*xOff*/,
int /*yOff*/,
unsigned char * /*rrops*/
);
/* afbplygblt.c */
extern void afbPolyGlyphBlt(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
int /*x*/,
int /*y*/,
unsigned int /*nglyph*/,
CharInfoPtr * /*ppci*/,
pointer /*pglyphBase*/
);
/* afbpixmap.c */
extern PixmapPtr afbCreatePixmap(
ScreenPtr /*pScreen*/,
int /*width*/,
int /*height*/,
int /*depth*/,
unsigned /*usage_hint*/
);
extern Bool afbDestroyPixmap(
PixmapPtr /*pPixmap*/
);
extern void afbXRotatePixmap(
PixmapPtr /*pPix*/,
int /*rw*/
);
extern void afbYRotatePixmap(
PixmapPtr /*pPix*/,
int /*rh*/
);
extern void afbCopyRotatePixmap(
PixmapPtr /*psrcPix*/,
PixmapPtr * /*ppdstPix*/,
int /*xrot*/,
int /*yrot*/
);
/* afbpolypnt.c */
extern void afbPolyPoint(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
int /*mode*/,
int /*npt*/,
xPoint * /*pptInit*/
);
/* afbpushpxl.c */
extern void afbPushPixels(
GCPtr /*pGC*/,
PixmapPtr /*pBitMap*/,
DrawablePtr /*pDrawable*/,
int /*dx*/,
int /*dy*/,
int /*xOrg*/,
int /*yOrg*/
);
/* afbscrinit.c */
extern Bool afbScreenInit(
ScreenPtr /*pScreen*/,
pointer /*pbits*/,
int /*xsize*/,
int /*ysize*/,
int /*dpix*/,
int /*dpiy*/,
int /*width*/
);
/* afbseg.c */
extern void afbSegmentSS(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
int /*nseg*/,
xSegment * /*pSeg*/
);
extern void afbSegmentSD(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
int /*nseg*/,
xSegment * /*pSeg*/
);
/* afbsetsp.c */
extern void afbSetSpans(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
char * /*psrc*/,
DDXPointPtr /*ppt*/,
int * /*pwidth*/,
int /*nspans*/,
int /*fSorted*/
);
/* afbtegblt.c */
extern void afbTEGlyphBlt(
DrawablePtr /*pDrawable*/,
GCPtr/*pGC*/,
int /*x*/,
int /*y*/,
unsigned int /*nglyph*/,
CharInfoPtr * /*ppci*/,
pointer /*pglyphBase*/
);
/* afbtileC.c */
extern void afbTileAreaPPWCopy(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
int /*alu*/,
PixmapPtr /*ptile*/,
unsigned long /*planemask*/
);
/* afbtileG.c */
extern void afbTileAreaPPWGeneral(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
int /*alu*/,
PixmapPtr /*ptile*/,
unsigned long /*planemask*/
);
extern void afbTileAreaCopy(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
int /*alu*/,
PixmapPtr /*ptile*/,
int /*xOff*/,
int /*yOff*/,
unsigned long /*planemask*/
);
/* afbtileG.c */
extern void afbTileAreaGeneral(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
int /*alu*/,
PixmapPtr /*ptile*/,
int /*xOff*/,
int /*yOff*/,
unsigned long /*planemask*/
);
extern void afbOpaqueStippleAreaPPWCopy(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
int /*alu*/,
PixmapPtr /*ptile*/,
unsigned char */*rropsOS*/,
unsigned long /*planemask*/
);
/* afbtileG.c */
extern void afbOpaqueStippleAreaPPWGeneral(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
int /*alu*/,
PixmapPtr /*ptile*/,
unsigned char */*rropsOS*/,
unsigned long /*planemask*/
);
extern void afbOpaqueStippleAreaCopy(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
int /*alu*/,
PixmapPtr /*ptile*/,
int /*xOff*/,
int /*yOff*/,
unsigned char */*rropsOS*/,
unsigned long /*planemask*/
);
/* afbtileG.c */
extern void afbOpaqueStippleAreaGeneral(
DrawablePtr /*pDraw*/,
int /*nbox*/,
BoxPtr /*pbox*/,
int /*alu*/,
PixmapPtr /*ptile*/,
int /*xOff*/,
int /*yOff*/,
unsigned char */*rropsOS*/,
unsigned long /*planemask*/
);
/* afbwindow.c */
extern Bool afbCreateWindow(
WindowPtr /*pWin*/
);
extern Bool afbDestroyWindow(
WindowPtr /*pWin*/
);
extern Bool afbMapWindow(
WindowPtr /*pWindow*/
);
extern Bool afbPositionWindow(
WindowPtr /*pWin*/,
int /*x*/,
int /*y*/
);
extern Bool afbUnmapWindow(
WindowPtr /*pWindow*/
);
extern void afbCopyWindow(
WindowPtr /*pWin*/,
DDXPointRec /*ptOldOrg*/,
RegionPtr /*prgnSrc*/
);
extern Bool afbChangeWindowAttributes(
WindowPtr /*pWin*/,
unsigned long /*mask*/
);
/* afbzerarc.c */
extern void afbZeroPolyArcSS(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,
int /*narcs*/,
xArc * /*parcs*/
);
/*
private field of pixmap
pixmap.devPrivate = (PixelType *)pointer_to_bits
pixmap.devKind = width_of_pixmap_in_bytes
private field of screen
a pixmap, for which we allocate storage. devPrivate is a pointer to
the bits in the hardware framebuffer. note that devKind can be poked to
make the code work for framebuffers that are wider than their
displayable screen (e.g. the early vsII, which displayed 960 pixels
across, but was 1024 in the hardware.)
private field of GC
*/
typedef struct {
unsigned char rrops[AFB_MAX_DEPTH]; /* reduction of rasterop to 1 of 3 */
unsigned char rropOS[AFB_MAX_DEPTH]; /* rop for opaque stipple */
} afbPrivGC;
typedef afbPrivGC *afbPrivGCPtr;
extern DevPrivateKey afbScreenPrivateKey;
extern DevPrivateKey afbGCPrivateKey;
extern DevPrivateKey afbWindowPrivateKey;
#ifdef PIXMAP_PER_WINDOW
extern DevPrivateKey frameWindowPrivateKey;
#endif
#define afbGetGCPrivate(pGC) \
((afbPrivGC *)dixLookupPrivate(&(pGC)->devPrivates, afbGCPrivateKey))
/* Common macros for extracting drawing information */
#define afbGetTypedWidth(pDrawable,wtype)( \
(((pDrawable)->type == DRAWABLE_WINDOW) ? \
(int)(((PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey)->devKind) : \
(int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
#define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char)
#define afbGetPixelWidth(pDrawable) afbGetTypedWidth(pDrawable, PixelType)
#define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
PixmapPtr _pPix; \
if ((pDrawable)->type == DRAWABLE_WINDOW) \
_pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
else \
_pPix = (PixmapPtr)(pDrawable); \
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
(width) = ((int) _pPix->devKind) / sizeof (wtype); \
}
#define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\
PixmapPtr _pPix; \
if ((pDrawable)->type == DRAWABLE_WINDOW) \
_pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
else \
_pPix = (PixmapPtr)(pDrawable); \
(pointer) = (PixelType *)_pPix->devPrivate.ptr; \
(width) = ((int)_pPix->devKind) / sizeof (PixelType); \
(size) = (width) * _pPix->drawable.height; \
(dep) = _pPix->drawable.depth; (void)(dep); \
}
#define afbGetByteWidthAndPointer(pDrawable, width, pointer) \
afbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
#define afbGetPixelWidthAndPointer(pDrawable, width, pointer) \
afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
#define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
PixmapPtr _pPix = (PixmapPtr)dixLookupPrivate(&(pWin)->drawable.pScreen->devPrivates, afbScreenPrivateKey); \
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
(width) = ((int) _pPix->devKind) / sizeof (wtype); \
}
#define afbGetWindowPixelWidthAndPointer(pWin, width, pointer) \
afbGetWindowTypedWidthAndPointer(pWin, width, pointer, PixelType, PixelType)
#define afbGetWindowByteWidthAndPointer(pWin, width, pointer) \
afbGetWindowTypedWidthAndPointer(pWin, width, pointer, char, char)
/* afb uses the following macros to calculate addresses in drawables.
* To support banked framebuffers, the macros come in four flavors.
* All four collapse into the same definition on unbanked devices.
*
* afbScanlineFoo - calculate address and do bank switching
* afbScanlineFooNoBankSwitch - calculate address, don't bank switch
* afbScanlineFooSrc - calculate address, switch source bank
* afbScanlineFooDst - calculate address, switch destination bank
*/
/* The NoBankSwitch versions are the same for banked and unbanked cases */
#define afbScanlineIncNoBankSwitch(_ptr, _off) _ptr += (_off)
#define afbScanlineOffsetNoBankSwitch(_ptr, _off) ((_ptr) + (_off))
#define afbScanlineDeltaNoBankSwitch(_ptr, _y, _w) \
afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w))
#define afbScanlineNoBankSwitch(_ptr, _x, _y, _w) \
afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
#ifdef MFB_LINE_BANK
#include "afblinebank.h" /* get macro definitions from this file */
#else /* !MFB_LINE_BANK - unbanked case */
#define afbScanlineInc(_ptr, _off) afbScanlineIncNoBankSwitch(_ptr, _off)
#define afbScanlineIncSrc(_ptr, _off) afbScanlineInc(_ptr, _off)
#define afbScanlineIncDst(_ptr, _off) afbScanlineInc(_ptr, _off)
#define afbScanlineOffset(_ptr, _off) afbScanlineOffsetNoBankSwitch(_ptr, _off)
#define afbScanlineOffsetSrc(_ptr, _off) afbScanlineOffset(_ptr, _off)
#define afbScanlineOffsetDst(_ptr, _off) afbScanlineOffset(_ptr, _off)
#define afbScanlineSrc(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w)
#define afbScanlineDst(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w)
#define afbScanlineDeltaSrc(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w)
#define afbScanlineDeltaDst(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w)
#endif /* MFB_LINE_BANK */
#define afbScanlineDelta(_ptr, _y, _w) \
afbScanlineOffset(_ptr, (_y) * (_w))
#define afbScanline(_ptr, _x, _y, _w) \
afbScanlineOffset(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
/* precomputed information about each glyph for GlyphBlt code.
this saves recalculating the per glyph information for each box.
*/
typedef struct _afbpos{
int xpos; /* xposition of glyph's origin */
int xchar; /* x position mod 32 */
int leftEdge;
int rightEdge;
int topEdge;
int bottomEdge;
PixelType *pdstBase; /* longword with character origin */
int widthGlyph; /* width in bytes of this glyph */
} afbTEXTPOS;
/* reduced raster ops for afb */
#define RROP_BLACK GXclear
#define RROP_WHITE GXset
#define RROP_NOP GXnoop
#define RROP_INVERT GXinvert
#define RROP_COPY GXcopy
/* macros for afbbitblt.c, afbfillsp.c
these let the code do one switch on the rop per call, rather
than a switch on the rop per item (span or rectangle.)
*/
#define fnCLEAR(src, dst) (0)
#define fnAND(src, dst) (src & dst)
#define fnANDREVERSE(src, dst) (src & ~dst)
#define fnCOPY(src, dst) (src)
#define fnANDINVERTED(src, dst) (~src & dst)
#define fnNOOP(src, dst) (dst)
#define fnXOR(src, dst) (src ^ dst)
#define fnOR(src, dst) (src | dst)
#define fnNOR(src, dst) (~(src | dst))
#define fnEQUIV(src, dst) (~src ^ dst)
#define fnINVERT(src, dst) (~dst)
#define fnORREVERSE(src, dst) (src | ~dst)
#define fnCOPYINVERTED(src, dst) (~src)
#define fnORINVERTED(src, dst) (~src | dst)
#define fnNAND(src, dst) (~(src & dst))
#undef fnSET
#define fnSET(src, dst) (~0)
/* Using a "switch" statement is much faster in most cases
* since the compiler can do a look-up table or multi-way branch
* instruction, depending on the architecture. The result on
* A Sun 3/50 is at least 2.5 times faster, assuming a uniform
* distribution of RasterOp operation types.
*
* However, doing some profiling on a running system reveals
* GXcopy is the operation over 99.5% of the time and
* GXxor is the next most frequent (about .4%), so we make special
* checks for those first.
*
* Note that this requires a change to the "calling sequence"
* since we can't engineer a "switch" statement to have an lvalue.
*/
#undef DoRop
#define DoRop(result, alu, src, dst) \
{ \
if (alu == GXcopy) \
result = fnCOPY (src, dst); \
else if (alu == GXxor) \
result = fnXOR (src, dst); \
else \
switch (alu) { \
case GXclear: \
result = fnCLEAR (src, dst); \
break; \
case GXand: \
result = fnAND (src, dst); \
break; \
case GXandReverse: \
result = fnANDREVERSE (src, dst); \
break; \
case GXandInverted: \
result = fnANDINVERTED (src, dst); \
break; \
default: \
case GXnoop: \
result = fnNOOP (src, dst); \
break; \
case GXor: \
result = fnOR (src, dst); \
break; \
case GXnor: \
result = fnNOR (src, dst); \
break; \
case GXequiv: \
result = fnEQUIV (src, dst); \
break; \
case GXinvert: \
result = fnINVERT (src, dst); \
break; \
case GXorReverse: \
result = fnORREVERSE (src, dst); \
break; \
case GXcopyInverted: \
result = fnCOPYINVERTED (src, dst); \
break; \
case GXorInverted: \
result = fnORINVERTED (src, dst); \
break; \
case GXnand: \
result = fnNAND (src, dst); \
break; \
case GXset: \
result = fnSET (src, dst); \
break; \
} \
}
/* C expression fragments for various operations. These get passed in
* as -D's on the compile command line. See afb/Imakefile. This
* fixes XBUG 6319.
*
* This seems like a good place to point out that afb's use of the
* words black and white is an unfortunate misnomer. In afb code, black
* means zero, and white means one.
*/
#define MFB_OPEQ_WHITE |=
#define MFB_OPEQ_BLACK &=~
#define MFB_OPEQ_INVERT ^=
#define MFB_EQWHOLEWORD_WHITE =~0
#define MFB_EQWHOLEWORD_BLACK =0
#define MFB_EQWHOLEWORD_INVERT ^=~0
#define MFB_OP_WHITE /* nothing */
#define MFB_OP_BLACK ~

View File

@ -1,343 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include <X11/X.h>
#include <X11/Xprotostr.h>
#include "regionstr.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "mi.h"
#include "afb.h"
#include "maskbits.h"
/* CopyArea and CopyPlane for a monchrome frame buffer
clip the source rectangle to the source's available bits. (this
avoids copying unnecessary pieces that will just get exposed anyway.)
this becomes the new shape of the destination.
clip the destination region to the composite clip in the
GC. this requires translating the destination region to (dstx, dsty).
build a list of source points, one for each rectangle in the
destination. this is a simple translation.
go do the multiple rectangle copies
do graphics exposures
*/
/** Optimized for drawing pixmaps into windows, especially when drawing into
** unobscured windows. Calls to the general-purpose region code were
** replaced with rectangle-to-rectangle clipping comparisions. This is
** possible, since the pixmap is a single rectangle. In an unobscured
** window, the destination clip is also a single rectangle, and region
** code can be avoided entirely. This is a big savings, since the region
** code uses XAlloc() and makes many function calls.
**
** In addition, if source is a pixmap, there is no need to call the
** expensive miHandleExposures() routine. Instead, we simply return NULL.
**
** Previously, drawing a pixmap into an unobscured window executed at least
** 8 XAlloc()'s, 30 function calls, and hundreds of lines of code.
**
** Now, the same operation requires no XAlloc()'s, no region function calls,
** and much less overhead. Nice for drawing lots of small pixmaps.
*/
void
afbDoBitblt(DrawablePtr pSrc, DrawablePtr pDst, int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, long unsigned int planemask)
{
switch (alu) {
case GXcopy:
afbDoBitbltCopy(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
break;
case GXxor:
afbDoBitbltXor(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
break;
case GXcopyInverted:
afbDoBitbltCopyInverted(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
break;
case GXor:
afbDoBitbltOr(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
break;
default:
afbDoBitbltGeneral(pSrc, pDst, alu, prgnDst, pptSrc, planemask);
break;
}
}
typedef void (*afb_blit_func)
(DrawablePtr, DrawablePtr, int, RegionPtr, DDXPointPtr, unsigned long);
static RegionPtr
afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, afb_blit_func doBitBlt, long unsigned int planemask)
{
RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
Bool freeSrcClip = FALSE;
RegionPtr prgnExposed;
RegionRec rgnDst;
DDXPointPtr pptSrc;
register DDXPointPtr ppt;
register BoxPtr pbox;
int i;
register int dx;
register int dy;
xRectangle origSource;
DDXPointRec origDest;
int numRects;
BoxRec fastBox;
int fastClip = 0; /* for fast clipping with pixmap source */
int fastExpose = 0; /* for fast exposures with pixmap source */
origSource.x = srcx;
origSource.y = srcy;
origSource.width = width;
origSource.height = height;
origDest.x = dstx;
origDest.y = dsty;
if ((pSrcDrawable != pDstDrawable) && pSrcDrawable->pScreen->SourceValidate)
(*pSrcDrawable->pScreen->SourceValidate)(pSrcDrawable, srcx, srcy, width,
height);
srcx += pSrcDrawable->x;
srcy += pSrcDrawable->y;
/* clip the source */
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE))
prgnSrcClip = pGC->pCompositeClip;
else
fastClip = 1;
else if (pGC->subWindowMode == IncludeInferiors)
if (!((WindowPtr)pSrcDrawable)->parent)
/*
* special case bitblt from root window in
* IncludeInferiors mode; just like from a pixmap
*/
fastClip = 1;
else if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE))
prgnSrcClip = pGC->pCompositeClip;
else {
prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
freeSrcClip = TRUE;
}
else
prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
fastBox.x1 = srcx;
fastBox.y1 = srcy;
fastBox.x2 = srcx + width;
fastBox.y2 = srcy + height;
/* Don't create a source region if we are doing a fast clip */
if (fastClip) {
fastExpose = 1;
/*
* clip the source; if regions extend beyond the source size,
* make sure exposure events get sent
*/
if (fastBox.x1 < pSrcDrawable->x) {
fastBox.x1 = pSrcDrawable->x;
fastExpose = 0;
}
if (fastBox.y1 < pSrcDrawable->y) {
fastBox.y1 = pSrcDrawable->y;
fastExpose = 0;
}
if (fastBox.x2 > pSrcDrawable->x + (int)pSrcDrawable->width) {
fastBox.x2 = pSrcDrawable->x + (int)pSrcDrawable->width;
fastExpose = 0;
}
if (fastBox.y2 > pSrcDrawable->y + (int)pSrcDrawable->height) {
fastBox.y2 = pSrcDrawable->y + (int)pSrcDrawable->height;
fastExpose = 0;
}
} else {
REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
}
dstx += pDstDrawable->x;
dsty += pDstDrawable->y;
if (pDstDrawable->type == DRAWABLE_WINDOW)
if (!((WindowPtr)pDstDrawable)->realized) {
if (!fastClip)
REGION_UNINIT(pGC->pScreen, &rgnDst);
if (freeSrcClip)
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
return NULL;
}
dx = srcx - dstx;
dy = srcy - dsty;
/* Translate and clip the dst to the destination composite clip */
if (fastClip) {
RegionPtr cclip;
/* Translate the region directly */
fastBox.x1 -= dx;
fastBox.x2 -= dx;
fastBox.y1 -= dy;
fastBox.y2 -= dy;
/* If the destination composite clip is one rectangle we can
do the clip directly. Otherwise we have to create a full
blown region and call intersect */
cclip = pGC->pCompositeClip;
if (REGION_NUM_RECTS(cclip) == 1) {
BoxPtr pBox = REGION_RECTS(cclip);
if (fastBox.x1 < pBox->x1)
fastBox.x1 = pBox->x1;
if (fastBox.x2 > pBox->x2)
fastBox.x2 = pBox->x2;
if (fastBox.y1 < pBox->y1)
fastBox.y1 = pBox->y1;
if (fastBox.y2 > pBox->y2)
fastBox.y2 = pBox->y2;
/* Check to see if the region is empty */
if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
REGION_NULL(pGC->pScreen, &rgnDst);
} else {
REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
}
} else {
/* We must turn off fastClip now, since we must create
a full blown region. It is intersected with the
composite clip below. */
fastClip = 0;
REGION_INIT(pGC->pScreen, &rgnDst, &fastBox,1);
}
} else
REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
if (!fastClip) {
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst,
pGC->pCompositeClip);
}
/* Do bit blitting */
numRects = REGION_NUM_RECTS(&rgnDst);
if (numRects && width && height) {
if(!(pptSrc = (DDXPointPtr)xalloc(numRects *
sizeof(DDXPointRec)))) {
REGION_UNINIT(pGC->pScreen, &rgnDst);
if (freeSrcClip)
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
return NULL;
}
pbox = REGION_RECTS(&rgnDst);
ppt = pptSrc;
for (i = numRects; --i >= 0; pbox++, ppt++) {
ppt->x = pbox->x1 + dx;
ppt->y = pbox->y1 + dy;
}
(*doBitBlt)(pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc,
planemask);
xfree(pptSrc);
}
prgnExposed = NULL;
if (pGC->fExpose) {
/* Pixmap sources generate a NoExposed (we return NULL to do this) */
if (!fastExpose)
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
origSource.x, origSource.y,
(int)origSource.width,
(int)origSource.height, origDest.x,
origDest.y, (unsigned long)0);
}
REGION_UNINIT(pGC->pScreen, &rgnDst);
if (freeSrcClip)
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
return prgnExposed;
}
RegionPtr
afbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty)
{
afb_blit_func doBitBlt;
switch (pGC->alu) {
case GXcopy:
doBitBlt = afbDoBitbltCopy;
break;
case GXxor:
doBitBlt = afbDoBitbltXor;
break;
case GXcopyInverted:
doBitBlt = afbDoBitbltCopyInverted;
break;
case GXor:
doBitBlt = afbDoBitbltOr;
break;
default:
doBitBlt = afbDoBitbltGeneral;
break;
}
return(afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
width, height, dstx, dsty, doBitBlt, pGC->planemask));
}

View File

@ -1,563 +0,0 @@
/*
* afb copy area
*/
/*
Copyright (c) 1989 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
Author: Keith Packard
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include <X11/X.h>
#include <X11/Xmd.h>
#include <X11/Xproto.h>
#include "afb.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "regionstr.h"
#include "maskbits.h"
#include "fastblt.h"
#include "mergerop.h"
void
MROP_NAME(afbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
DrawablePtr pSrc, pDst;
int alu;
RegionPtr prgnDst;
DDXPointPtr pptSrc;
unsigned long planemask;
{
PixelType *psrcBase, *pdstBase; /* start of src and dst bitmaps */
int widthSrc, widthDst; /* add to get to same position in next line */
int sizeSrc, sizeDst;
BoxPtr pbox;
int nbox;
BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
/* temporaries for shuffling rectangles */
DDXPointPtr pptTmp, pptNew1, pptNew2;
/* shuffling boxes entails shuffling the
source points too */
int w, h;
int xdir; /* 1 = left right, -1 = right left/ */
int ydir; /* 1 = top down, -1 = bottom up */
PixelType *psrcLine, *pdstLine;
/* pointers to line with current src and dst */
register PixelType *psrc; /* pointer to current src longword */
register PixelType *pdst; /* pointer to current dst longword */
MROP_DECLARE_REG()
/* following used for looping through a line */
PixelType startmask, endmask; /* masks for writing ends of dst */
int nlMiddle; /* whole longwords in dst */
int xoffSrc, xoffDst;
register int leftShift, rightShift;
register PixelType bits;
register PixelType bits1;
register int nl; /* temp copy of nlMiddle */
int careful;
int depthSrc;
int depthDst;
MROP_INITIALIZE(alu,0);
afbGetPixelWidthSizeDepthAndPointer(pSrc, widthSrc, sizeSrc, depthSrc,
psrcBase);
afbGetPixelWidthSizeDepthAndPointer(pDst, widthDst, sizeDst, depthDst,
pdstBase);
/* Special case where depth of dest pixmap is 1 but source pixmap isn't
* Used for GetImage to copy a plane from a source pixmap to a particular
* dest pixmap plane.
* Note: planemask should have only one bit set or several planes from
* the source will be copied to the same dest plane.
*/
if (depthDst == 1 && depthDst != depthSrc)
sizeDst = 0;
/* 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;
widthSrc = -widthSrc;
widthDst = -widthDst;
if (nbox > 1) {
/* keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
if(!pboxNew1)
return;
pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
if(!pptNew1) {
xfree(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)xalloc(sizeof(BoxRec) * nbox);
pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox);
if(!pboxNew2 || !pptNew2) {
if (pptNew2)
xfree(pptNew2);
if (pboxNew2)
xfree(pboxNew2);
if (pboxNew1) {
xfree(pptNew1);
xfree(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;
}
while(nbox--) {
int d;
for (d = 0; d < depthSrc; d++) {
PixelType *psrcB;
PixelType *pdstB;
if (!(planemask & (1 << d)))
continue;
psrcB = psrcBase + sizeSrc * d; /* @@@ NEXT PLANE @@@ */
pdstB = pdstBase + sizeDst * d; /* @@@ NEXT PLANE @@@ */
w = pbox->x2 - pbox->x1;
h = pbox->y2 - pbox->y1;
if (ydir == -1) { /* start at last scanline of rectangle */
psrcLine = afbScanlineDeltaSrc(psrcB, -(pptSrc->y+h-1), widthSrc);
pdstLine = afbScanlineDeltaDst(pdstB, -(pbox->y2-1), widthDst);
} else { /* start at first scanline */
psrcLine = afbScanlineDeltaSrc(psrcB, pptSrc->y, widthSrc);
pdstLine = afbScanlineDeltaDst(pdstB, pbox->y1, widthDst);
}
if ((pbox->x1 & PIM) + w <= PPW) {
maskpartialbits (pbox->x1, w, startmask);
endmask = 0;
nlMiddle = 0;
} else {
maskbits(pbox->x1, w, startmask, endmask, nlMiddle);
}
if (xdir == 1) {
xoffSrc = pptSrc->x & PIM;
xoffDst = pbox->x1 & PIM;
pdstLine += (pbox->x1 >> PWSH);
psrcLine += (pptSrc->x >> PWSH);
#ifdef DO_UNALIGNED_BITBLT
nl = xoffSrc - xoffDst;
psrcLine = (PixelType *)(((unsigned char *) psrcLine) + nl);
#else
if (xoffSrc == xoffDst)
#endif
{
while (h--) {
psrc = psrcLine;
pdst = pdstLine;
if (startmask) {
*pdst = MROP_MASK(*psrc, *pdst, startmask);
psrc++;
pdst++;
}
nl = nlMiddle;
#ifdef LARGE_INSTRUCTION_CACHE
#ifdef FAST_CONSTANT_OFFSET_MODE
psrc += nl & (UNROLL-1);
pdst += nl & (UNROLL-1);
#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
#define LoopReset \
pdst += UNROLL; \
psrc += UNROLL;
#else
#define BodyOdd(n) *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++;
#define BodyEven(n) BodyOdd(n)
#define LoopReset ;
#endif
PackedLoop
#undef BodyOdd
#undef BodyEven
#undef LoopReset
#else
#ifdef NOTDEF
/* you'd think this would be faster --
* a single instruction instead of 6
* but measurements show it to be ~15% slower
*/
while ((nl -= 6) >= 0) {
asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0"
: "=m" (*(char *)pdst)
: "m" (*(char *)psrc)
: "d0", "d1", "d2", "d3",
"a2", "a3");
pdst += 6;
}
nl += 6;
while (nl--)
*pdst++ = *psrc++;
#endif
DuffL(nl, label1,
*pdst = MROP_SOLID (*psrc, *pdst);
pdst++; psrc++;)
#endif
if (endmask)
*pdst = MROP_MASK(*psrc, *pdst, endmask);
afbScanlineIncDst(pdstLine, widthDst);
afbScanlineIncSrc(psrcLine, widthSrc);
}
}
#ifndef DO_UNALIGNED_BITBLT
else {
if (xoffSrc > xoffDst) {
leftShift = (xoffSrc - xoffDst);
rightShift = PPW - leftShift;
} else {
rightShift = (xoffDst - xoffSrc);
leftShift = PPW - rightShift;
}
while (h--) {
psrc = psrcLine;
pdst = pdstLine;
bits = 0;
if (xoffSrc > xoffDst)
bits = *psrc++;
if (startmask) {
bits1 = BitLeft(bits,leftShift);
bits = *psrc++;
bits1 |= BitRight(bits,rightShift);
*pdst = MROP_MASK(bits1, *pdst, startmask);
pdst++;
}
nl = nlMiddle;
#ifdef LARGE_INSTRUCTION_CACHE
bits1 = bits;
#ifdef FAST_CONSTANT_OFFSET_MODE
psrc += nl & (UNROLL-1);
pdst += nl & (UNROLL-1);
#define BodyOdd(n) \
bits = psrc[-n]; \
pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]);
#define BodyEven(n) \
bits1 = psrc[-n]; \
pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]);
#define LoopReset \
pdst += UNROLL; \
psrc += UNROLL;
#else
#define BodyOdd(n) \
bits = *psrc++; \
*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \
pdst++;
#define BodyEven(n) \
bits1 = *psrc++; \
*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \
pdst++;
#define LoopReset ;
#endif /* !FAST_CONSTANT_OFFSET_MODE */
PackedLoop
#undef BodyOdd
#undef BodyEven
#undef LoopReset
#else
DuffL(nl,label2,
bits1 = BitLeft(bits, leftShift);
bits = *psrc++;
*pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
pdst++;
)
#endif
if (endmask) {
bits1 = BitLeft(bits, leftShift);
if (BitLeft(endmask, rightShift)) {
bits = *psrc;
bits1 |= BitRight(bits, rightShift);
}
*pdst = MROP_MASK (bits1, *pdst, endmask);
}
afbScanlineIncDst(pdstLine, widthDst);
afbScanlineIncSrc(psrcLine, widthSrc);
}
}
#endif /* DO_UNALIGNED_BITBLT */
} else { /* xdir == -1 */
xoffSrc = (pptSrc->x + w - 1) & PIM;
xoffDst = (pbox->x2 - 1) & PIM;
pdstLine += ((pbox->x2-1) >> PWSH) + 1;
psrcLine += ((pptSrc->x+w - 1) >> PWSH) + 1;
#ifdef DO_UNALIGNED_BITBLT
nl = xoffSrc - xoffDst;
psrcLine = (PixelType *)
(((unsigned char *) psrcLine) + nl);
#else
if (xoffSrc == xoffDst)
#endif
{
while (h--) {
psrc = psrcLine;
pdst = pdstLine;
if (endmask) {
pdst--;
psrc--;
*pdst = MROP_MASK (*psrc, *pdst, endmask);
}
nl = nlMiddle;
#ifdef LARGE_INSTRUCTION_CACHE
#ifdef FAST_CONSTANT_OFFSET_MODE
psrc -= nl & (UNROLL - 1);
pdst -= nl & (UNROLL - 1);
#define BodyOdd(n) pdst[n-1] = MROP_SOLID (psrc[n-1], pdst[n-1]);
#define BodyEven(n) BodyOdd(n)
#define LoopReset \
pdst -= UNROLL;\
psrc -= UNROLL;
#else
#define BodyOdd(n) --pdst; --psrc; *pdst = MROP_SOLID(*psrc, *pdst);
#define BodyEven(n) BodyOdd(n)
#define LoopReset ;
#endif
PackedLoop
#undef BodyOdd
#undef BodyEven
#undef LoopReset
#else
DuffL(nl,label3,
--pdst; --psrc; *pdst = MROP_SOLID (*psrc, *pdst);)
#endif
if (startmask) {
--pdst;
--psrc;
*pdst = MROP_MASK(*psrc, *pdst, startmask);
}
afbScanlineIncDst(pdstLine, widthDst);
afbScanlineIncSrc(psrcLine, widthSrc);
}
}
#ifndef DO_UNALIGNED_BITBLT
else {
if (xoffDst > xoffSrc) {
rightShift = (xoffDst - xoffSrc);
leftShift = PPW - rightShift;
} else {
leftShift = (xoffSrc - xoffDst);
rightShift = PPW - leftShift;
}
while (h--) {
psrc = psrcLine;
pdst = pdstLine;
bits = 0;
if (xoffDst > xoffSrc)
bits = *--psrc;
if (endmask) {
bits1 = BitRight(bits, rightShift);
bits = *--psrc;
bits1 |= BitLeft(bits, leftShift);
pdst--;
*pdst = MROP_MASK(bits1, *pdst, endmask);
}
nl = nlMiddle;
#ifdef LARGE_INSTRUCTION_CACHE
bits1 = bits;
#ifdef FAST_CONSTANT_OFFSET_MODE
psrc -= nl & (UNROLL - 1);
pdst -= nl & (UNROLL - 1);
#define BodyOdd(n) \
bits = psrc[n-1]; \
pdst[n-1] = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),pdst[n-1]);
#define BodyEven(n) \
bits1 = psrc[n-1]; \
pdst[n-1] = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),pdst[n-1]);
#define LoopReset \
pdst -= UNROLL; \
psrc -= UNROLL;
#else
#define BodyOdd(n) \
bits = *--psrc; --pdst; \
*pdst = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*pdst);
#define BodyEven(n) \
bits1 = *--psrc; --pdst; \
*pdst = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*pdst);
#define LoopReset ;
#endif
PackedLoop
#undef BodyOdd
#undef BodyEven
#undef LoopReset
#else
DuffL(nl, label4,
bits1 = BitRight(bits, rightShift);
bits = *--psrc;
--pdst;
*pdst = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*pdst);
)
#endif
if (startmask) {
bits1 = BitRight(bits, rightShift);
if (BitRight (startmask, leftShift)) {
bits = *--psrc;
bits1 |= BitLeft(bits, leftShift);
}
--pdst;
*pdst = MROP_MASK(bits1, *pdst, startmask);
}
afbScanlineIncDst(pdstLine, widthDst);
afbScanlineIncSrc(psrcLine, widthSrc);
}
}
#endif
}
}
pbox++;
pptSrc++;
}
if (pboxNew2) {
xfree(pptNew2);
xfree(pboxNew2);
}
if (pboxNew1) {
xfree(pptNew1);
xfree(pboxNew1);
}
}

View File

@ -1,323 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "misc.h"
#include "afb.h"
#include "maskbits.h"
#include "miline.h"
/* Solid bresenham line */
/* NOTES
e2 is used less often than e1, so it's not in a register
*/
void
afbBresS(addrlbase, nlwidth, sizeDst, depthDst, signdx, signdy, axis, x1, y1,
e, e1, e2, len, rrops)
PixelType *addrlbase; /* pointer to base of bitmap */
int nlwidth; /* width in longwords of bitmap */
int sizeDst;
int depthDst;
int signdx, signdy; /* signs of directions */
int axis; /* major axis (Y_AXIS or X_AXIS) */
int x1, y1; /* initial point */
register int e; /* error accumulator */
register int e1; /* bresenham increments */
int e2;
int len; /* length of line */
unsigned char *rrops;
{
register int yinc; /* increment to next scanline, in bytes */
register PixelType *addrl; /* bitmask long pointer */
register PixelType bit; /* current bit being set/cleared/etc. */
PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */
PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */
register int e3 = e2-e1;
PixelType tmp;
int saveE;
int saveLen;
int d;
/* point to longword containing first point */
yinc = signdy * nlwidth;
e = e-e1; /* to make looping easier */
if (!len)
return;
saveLen = len;
saveE = e;
for (d = 0; d < depthDst; d++) {
addrl = afbScanline(addrlbase, x1, y1, nlwidth);
addrlbase += sizeDst; /* @@@ NEXT PLANE @@@ */
len = saveLen;
e = saveE;
bit = mfbGetmask(x1 & PIM);
switch (rrops[d]) {
case RROP_BLACK:
if (axis == X_AXIS) {
if (signdx > 0) {
tmp = *addrl;
for (;;) {
tmp &= ~bit;
if (!--len)
break;
bit = SCRRIGHT(bit,1);
e += e1;
if (e >= 0) {
*addrl = tmp;
afbScanlineInc(addrl, yinc);
e += e3;
if (!bit) {
bit = leftbit;
addrl ++;
}
tmp = *addrl;
} else if (!bit) {
*addrl = tmp;
bit = leftbit;
addrl ++;
tmp = *addrl;
}
}
*addrl = tmp;
} else {
tmp = *addrl;
for (;;) {
tmp &= ~bit;
if (!--len)
break;
e += e1;
bit = SCRLEFT(bit,1);
if (e >= 0) {
*addrl = tmp;
afbScanlineInc(addrl, yinc);
e += e3;
if (!bit) {
bit = rightbit;
addrl --;
}
tmp = *addrl;
} else if (!bit) {
*addrl = tmp;
bit = rightbit;
addrl --;
tmp = *addrl;
}
}
*addrl = tmp;
}
} /* if X_AXIS */ else {
if (signdx > 0) {
while(len--) {
*addrl &= ~bit;
e += e1;
if (e >= 0) {
bit = SCRRIGHT(bit,1);
if (!bit) { bit = leftbit;addrl ++; }
e += e3;
}
afbScanlineInc(addrl, yinc);
}
} else {
while(len--) {
*addrl &= ~bit;
e += e1;
if (e >= 0) {
bit = SCRLEFT(bit,1);
if (!bit) { bit = rightbit;addrl --; }
e += e3;
}
afbScanlineInc(addrl, yinc);
}
}
} /* else Y_AXIS */
break;
case RROP_WHITE:
if (axis == X_AXIS) {
if (signdx > 0) {
tmp = *addrl;
for (;;) {
tmp |= bit;
if (!--len)
break;
e += e1;
bit = SCRRIGHT(bit,1);
if (e >= 0) {
*addrl = tmp;
afbScanlineInc(addrl, yinc);
e += e3;
if (!bit) {
bit = leftbit;
addrl ++;
}
tmp = *addrl;
} else if (!bit) {
*addrl = tmp;
bit = leftbit;
addrl ++;
tmp = *addrl;
}
}
*addrl = tmp;
} else {
tmp = *addrl;
for (;;) {
tmp |= bit;
if (!--len)
break;
e += e1;
bit = SCRLEFT(bit,1);
if (e >= 0) {
*addrl = tmp;
afbScanlineInc(addrl, yinc);
e += e3;
if (!bit) {
bit = rightbit;
addrl --;
}
tmp = *addrl;
} else if (!bit) {
*addrl = tmp;
bit = rightbit;
addrl --;
tmp = *addrl;
}
}
*addrl = tmp;
}
} /* if X_AXIS */ else {
if (signdx > 0) {
while(len--) {
*addrl |= bit;
e += e1;
if (e >= 0) {
bit = SCRRIGHT(bit,1);
if (!bit) { bit = leftbit;addrl ++; }
e += e3;
}
afbScanlineInc(addrl, yinc);
}
} else {
while(len--) {
*addrl |= bit;
e += e1;
if (e >= 0) {
bit = SCRLEFT(bit,1);
if (!bit) { bit = rightbit;addrl --; }
e += e3;
}
afbScanlineInc(addrl, yinc);
}
}
} /* else Y_AXIS */
break;
case RROP_INVERT:
if (axis == X_AXIS) {
if (signdx > 0) {
while(len--) {
*addrl ^= bit;
e += e1;
if (e >= 0) {
afbScanlineInc(addrl, yinc);
e += e3;
}
bit = SCRRIGHT(bit,1);
if (!bit) { bit = leftbit;addrl ++; }
}
} else {
while(len--) {
*addrl ^= bit;
e += e1;
if (e >= 0) {
afbScanlineInc(addrl, yinc);
e += e3;
}
bit = SCRLEFT(bit,1);
if (!bit) { bit = rightbit;addrl --; }
}
}
} /* if X_AXIS */ else {
if (signdx > 0) {
while(len--) {
*addrl ^= bit;
e += e1;
if (e >= 0) {
bit = SCRRIGHT(bit,1);
if (!bit) { bit = leftbit;addrl ++; }
e += e3;
}
afbScanlineInc(addrl, yinc);
}
} else {
while(len--) {
*addrl ^= bit;
e += e1;
if (e >= 0) {
bit = SCRLEFT(bit,1);
if (!bit) { bit = rightbit; addrl --; }
e += e3;
}
afbScanlineInc(addrl, yinc);
}
}
} /* else Y_AXIS */
} /* switch */
} /* for (d = ... ) */
}

View File

@ -1,214 +0,0 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "misc.h"
#include "afb.h"
#include "maskbits.h"
#include "miline.h"
/* Dashed bresenham line */
#define StepDash\
if (!--dashRemaining) { \
if (++ dashIndex == numInDashList) \
dashIndex = 0; \
dashRemaining = pDash[dashIndex]; \
rop = fgrop; \
if (dashIndex & 1) \
rop = bgrop; \
}
void
afbBresD(pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash,
addrlbase, nlwidth, sizeDst, depthDst,
signdx, signdy, axis, x1, y1, e, e1, e2, len, rrops, bgrrops)
int *pdashIndex; /* current dash */
unsigned char *pDash; /* dash list */
int numInDashList; /* total length of dash list */
int *pdashOffset; /* offset into current dash */
int isDoubleDash;
PixelType *addrlbase; /* pointer to base of bitmap */
int nlwidth; /* width in longwords of bitmap */
int sizeDst;
int depthDst;
int signdx, signdy; /* signs of directions */
int axis; /* major axis (Y_AXIS or X_AXIS) */
int x1, y1; /* initial point */
register int e; /* error accumulator */
register int e1; /* bresenham increments */
int e2;
int len; /* length of line */
unsigned char *rrops;
unsigned char *bgrrops;
{
register int yinc; /* increment to next scanline, in bytes */
register PixelType *addrl;
register int e3 = e2-e1;
register unsigned long bit;
PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */
PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */
int dashIndex;
int dashOffset;
int dashRemaining;
int rop;
int fgrop;
int bgrop;
int saveE;
int saveLen;
int d;
dashOffset = *pdashOffset;
dashIndex = *pdashIndex;
dashRemaining = pDash[dashIndex] - dashOffset;
/* point to longword containing first point */
yinc = signdy * nlwidth;
e = e-e1; /* to make looping easier */
saveE = e;
saveLen = len;
for (d = 0; d < depthDst; d++) {
addrl = afbScanline(addrlbase, x1, y1, nlwidth);
addrlbase += sizeDst; /* @@@ NEXT PLANE @@@ */
fgrop = rrops[d];
bgrop = bgrrops[d];
e = saveE;
len = saveLen;
bit = mfbGetmask(x1 & PIM);
rop = fgrop;
if (!isDoubleDash)
bgrop = -1;
if (dashIndex & 1)
rop = bgrop;
if (axis == X_AXIS) {
if (signdx > 0) {
while(len--) {
if (rop == RROP_BLACK)
*addrl &= ~bit;
else if (rop == RROP_WHITE)
*addrl |= bit;
else if (rop == RROP_INVERT)
*addrl ^= bit;
e += e1;
if (e >= 0) {
afbScanlineInc(addrl, yinc);
e += e3;
}
bit = SCRRIGHT(bit,1);
if (!bit) { bit = leftbit;addrl ++; }
StepDash
}
} else {
while(len--) {
if (rop == RROP_BLACK)
*addrl &= ~bit;
else if (rop == RROP_WHITE)
*addrl |= bit;
else if (rop == RROP_INVERT)
*addrl ^= bit;
e += e1;
if (e >= 0) {
afbScanlineInc(addrl, yinc);
e += e3;
}
bit = SCRLEFT(bit,1);
if (!bit) { bit = rightbit;addrl --; }
StepDash
}
}
} /* if X_AXIS */ else {
if (signdx > 0) {
while(len--) {
if (rop == RROP_BLACK)
*addrl &= ~bit;
else if (rop == RROP_WHITE)
*addrl |= bit;
else if (rop == RROP_INVERT)
*addrl ^= bit;
e += e1;
if (e >= 0) {
bit = SCRRIGHT(bit,1);
if (!bit) { bit = leftbit;addrl ++; }
e += e3;
}
afbScanlineInc(addrl, yinc);
StepDash
}
} else {
while(len--) {
if (rop == RROP_BLACK)
*addrl &= ~bit;
else if (rop == RROP_WHITE)
*addrl |= bit;
else if (rop == RROP_INVERT)
*addrl ^= bit;
e += e1;
if (e >= 0) {
bit = SCRLEFT(bit,1);
if (!bit) { bit = rightbit;addrl --; }
e += e3;
}
afbScanlineInc(addrl, yinc);
StepDash
}
}
} /* else Y_AXIS */
} /* for (d = ...) */
*pdashIndex = dashIndex;
*pdashOffset = pDash[dashIndex] - dashRemaining;
}

View File

@ -1,248 +0,0 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include <X11/X.h>
#include "regionstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "gc.h"
#include "maskbits.h"
#include "mi.h"
#include "afb.h"
#define ADDRECT(reg,r,fr,rx1,ry1,rx2,ry2) \
if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \
(!((reg)->data->numRects && \
((r-1)->y1 == (ry1)) && \
((r-1)->y2 == (ry2)) && \
((r-1)->x1 <= (rx1)) && \
((r-1)->x2 >= (rx2))))) \
{ \
if ((reg)->data->numRects == (reg)->data->size) \
{ \
miRectAlloc(reg, 1); \
fr = REGION_BOXPTR(reg); \
r = fr + (reg)->data->numRects; \
} \
r->x1 = (rx1); \
r->y1 = (ry1); \
r->x2 = (rx2); \
r->y2 = (ry2); \
(reg)->data->numRects++; \
if(r->x1 < (reg)->extents.x1) \
(reg)->extents.x1 = r->x1; \
if(r->x2 > (reg)->extents.x2) \
(reg)->extents.x2 = r->x2; \
r++; \
}
/* Convert bitmap clip mask into clipping region.
* First, goes through each line and makes boxes by noting the transitions
* from 0 to 1 and 1 to 0.
* Then it coalesces the current line with the previous if they have boxes
* at the same X coordinates.
*/
RegionPtr
afbPixmapToRegion(pPix)
PixmapPtr pPix;
{
register RegionPtr pReg;
register PixelType *pw, w;
register int ib;
int width, h, base, rx1 = 0, crects;
PixelType *pwLineEnd;
int irectPrevStart, irectLineStart;
register BoxPtr prectO, prectN;
BoxPtr FirstRect, rects, prectLineStart;
Bool fInBox, fSame;
register PixelType mask0 = mfbGetmask(0);
PixelType *pwLine;
int nWidth;
pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1);
if(!pReg)
return NullRegion;
FirstRect = REGION_BOXPTR(pReg);
rects = FirstRect;
pwLine = (PixelType *) pPix->devPrivate.ptr;
nWidth = pPix->devKind / PGSZB;
width = pPix->drawable.width;
pReg->extents.x1 = width - 1;
pReg->extents.x2 = 0;
irectPrevStart = -1;
for(h = 0; h < pPix->drawable.height; h++) {
pw = pwLine;
pwLine += nWidth;
irectLineStart = rects - FirstRect;
/* If the Screen left most bit of the word is set, we're starting in
* a box */
if(*pw & mask0) {
fInBox = TRUE;
rx1 = 0;
}
else
fInBox = FALSE;
/* Process all words which are fully in the pixmap */
pwLineEnd = pw + (width >> PWSH);
for (base = 0; pw < pwLineEnd; base += PPW) {
w = *pw++;
if (fInBox) {
if (!~w)
continue;
} else {
if (!w)
continue;
}
for(ib = 0; ib < PPW; ib++) {
/* If the Screen left most bit of the word is set, we're
* starting a box */
if(w & mask0) {
if(!fInBox) {
rx1 = base + ib;
/* start new box */
fInBox = TRUE;
}
} else {
if(fInBox) {
/* end box */
ADDRECT(pReg, rects, FirstRect,
rx1, h, base + ib, h + 1);
fInBox = FALSE;
}
}
/* Shift the word VISUALLY left one. */
w = SCRLEFT(w, 1);
}
}
if(width & PIM) {
/* Process final partial word on line */
w = *pw++;
for(ib = 0; ib < (width & PIM); ib++) {
/* If the Screen left most bit of the word is set, we're
* starting a box */
if(w & mask0) {
if(!fInBox) {
rx1 = base + ib;
/* start new box */
fInBox = TRUE;
}
} else {
if(fInBox) {
/* end box */
ADDRECT(pReg, rects, FirstRect,
rx1, h, base + ib, h + 1);
fInBox = FALSE;
}
}
/* Shift the word VISUALLY left one. */
w = SCRLEFT(w, 1);
}
}
/* If scanline ended with last bit set, end the box */
if(fInBox) {
ADDRECT(pReg, rects, FirstRect,
rx1, h, base + (width & PIM), h + 1);
}
/* if all rectangles on this line have the same x-coords as
* those on the previous line, then add 1 to all the previous y2s and
* throw away all the rectangles from this line
*/
fSame = FALSE;
if(irectPrevStart != -1) {
crects = irectLineStart - irectPrevStart;
if(crects == ((rects - FirstRect) - irectLineStart)) {
prectO = FirstRect + irectPrevStart;
prectN = prectLineStart = FirstRect + irectLineStart;
fSame = TRUE;
while(prectO < prectLineStart) {
if((prectO->x1 != prectN->x1) || (prectO->x2 != prectN->x2)) {
fSame = FALSE;
break;
}
prectO++;
prectN++;
}
if (fSame) {
prectO = FirstRect + irectPrevStart;
while(prectO < prectLineStart) {
prectO->y2 += 1;
prectO++;
}
rects -= crects;
pReg->data->numRects -= crects;
}
}
}
if(!fSame)
irectPrevStart = irectLineStart;
}
if (!pReg->data->numRects)
pReg->extents.x1 = pReg->extents.x2 = 0;
else
{
pReg->extents.y1 = REGION_BOXPTR(pReg)->y1;
pReg->extents.y2 = REGION_END(pReg)->y2;
if (pReg->data->numRects == 1) {
xfree(pReg->data);
pReg->data = (RegDataPtr)NULL;
}
}
#ifdef DEBUG
if (!miValidRegion(pReg))
FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
#endif
return(pReg);
}

View File

@ -1,84 +0,0 @@
/************************************************************
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
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 no-
tice appear in all copies and that both that copyright no-
tice and this permission notice appear in supporting docu-
mentation, and that the names of Sun or X Consortium
not be used in advertising or publicity pertaining to
distribution of the software without specific prior
written permission. Sun and X Consortium make no
representations about the suitability of this software for
any purpose. It is provided "as is" without any express or
implied warranty.
SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xproto.h>
#include "scrnintstr.h"
#include "colormapst.h"
#include "resource.h"
#include "micmap.h"
#include "afb.h"
int
afbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
{
return miListInstalledColormaps(pScreen, pmaps);
}
void
afbInstallColormap(ColormapPtr pmap)
{
miInstallColormap(pmap);
}
void
afbUninstallColormap(ColormapPtr pmap)
{
miUninstallColormap(pmap);
}
void
afbResolveColor(short unsigned int *pred, short unsigned int *pgreen, short unsigned int *pblue, register VisualPtr pVisual)
{
miResolveColor(pred, pgreen, pblue, pVisual);
}
Bool
afbInitializeColormap(register ColormapPtr pmap)
{
return miInitializeColormap(pmap);
}
/*
* Given a list of formats for a screen, create a list
* of visuals and depths for the screen which correspond to
* the set which can be used with this version of afb.
*/
Bool
afbInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, int *ndepthp, int *rootDepthp, VisualID *defaultVisp, long unsigned int sizes, int bitsPerRGB)
{
return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
defaultVisp, sizes, bitsPerRGB, -1);
}

View File

@ -1,347 +0,0 @@
/************************************************************
Copyright (c) 1989 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
********************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xprotostr.h>
#include "regionstr.h"
#include "gcstruct.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "afb.h"
#include "maskbits.h"
#include "mifillarc.h"
#include "mi.h"
static void
afbFillEllipseSolid(DrawablePtr pDraw, xArc *arc, register unsigned char *rrops)
{
int x, y, e;
int yk, xk, ym, xm, dx, dy, xorg, yorg;
register int slw;
miFillArcRec info;
PixelType *addrlt, *addrlb;
register PixelType *pdst;
PixelType *addrl;
register int n;
register int d;
int nlwidth;
register int xpos;
PixelType startmask, endmask;
int nlmiddle;
int depthDst;
int sizeDst;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
addrlt);
miFillArcSetup(arc, &info);
MIFILLARCSETUP();
xorg += pDraw->x;
yorg += pDraw->y;
addrlb = addrlt;
addrlt += nlwidth * (yorg - y);
addrlb += nlwidth * (yorg + y + dy);
while (y) {
addrlt += nlwidth;
addrlb -= nlwidth;
MIFILLARCSTEP(slw);
if (!slw)
continue;
xpos = xorg - x;
pdst = addrl = afbScanlineOffset(addrlt, (xpos >> PWSH));
if (((xpos & PIM) + slw) < PPW) {
maskpartialbits(xpos, slw, startmask);
for (d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */
switch (rrops[d]) {
case RROP_BLACK:
*pdst &= ~startmask;
break;
case RROP_WHITE:
*pdst |= startmask;
break;
case RROP_INVERT:
*pdst ^= startmask;
break;
case RROP_NOP:
break;
}
}
if (miFillArcLower(slw)) {
pdst = afbScanlineOffset(addrlb, (xpos >> PWSH));
for (d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */
switch (rrops[d]) {
case RROP_BLACK:
*pdst &= ~startmask;
break;
case RROP_WHITE:
*pdst |= startmask;
break;
case RROP_INVERT:
*pdst ^= startmask;
break;
case RROP_NOP:
break;
}
}
}
continue;
}
maskbits(xpos, slw, startmask, endmask, nlmiddle);
for (d = 0; d < depthDst; d++, addrl += sizeDst) { /* @@@ NEXT PLANE @@@ */
n = nlmiddle;
pdst = addrl;
switch (rrops[d]) {
case RROP_BLACK:
if (startmask)
*pdst++ &= ~startmask;
while (n--)
*pdst++ = 0;
if (endmask)
*pdst &= ~endmask;
break;
case RROP_WHITE:
if (startmask)
*pdst++ |= startmask;
while (n--)
*pdst++ = ~0;
if (endmask)
*pdst |= endmask;
break;
case RROP_INVERT:
if (startmask)
*pdst++ ^= startmask;
while (n--)
*pdst++ ^= ~0;
if (endmask)
*pdst ^= endmask;
break;
case RROP_NOP:
break;
}
}
if (!miFillArcLower(slw))
continue;
addrl = afbScanlineOffset(addrlb, (xpos >> PWSH));
for (d = 0; d < depthDst; d++, addrl += sizeDst) { /* @@@ NEXT PLANE @@@ */
n = nlmiddle;
pdst = addrl;
switch (rrops[d]) {
case RROP_BLACK:
if (startmask)
*pdst++ &= ~startmask;
while (n--)
*pdst++ = 0;
if (endmask)
*pdst &= ~endmask;
break;
case RROP_WHITE:
if (startmask)
*pdst++ |= startmask;
while (n--)
*pdst++ = ~0;
if (endmask)
*pdst |= endmask;
break;
case RROP_INVERT:
if (startmask)
*pdst++ ^= startmask;
while (n--)
*pdst++ ^= ~0;
if (endmask)
*pdst ^= endmask;
break;
case RROP_NOP:
break;
}
}
}
}
#define FILLSPAN(xl,xr,addr) \
if (xr >= xl) { \
width = xr - xl + 1; \
addrl = afbScanlineOffset(addr, (xl >> PWSH)); \
if (((xl & PIM) + width) < PPW) { \
maskpartialbits(xl, width, startmask); \
for (pdst = addrl, d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */ \
switch (rrops[d]) { \
case RROP_BLACK: \
*pdst &= ~startmask; \
break; \
case RROP_WHITE: \
*pdst |= startmask; \
break; \
case RROP_INVERT: \
*pdst ^= startmask; \
break; \
case RROP_NOP: \
break; \
} \
} \
} else { \
maskbits(xl, width, startmask, endmask, nlmiddle); \
for (d = 0; d < depthDst; d++, addrl += sizeDst) { /* @@@ NEXT PLANE @@@ */ \
n = nlmiddle; \
pdst = addrl; \
switch (rrops[d]) { \
case RROP_BLACK: \
if (startmask) \
*pdst++ &= ~startmask; \
while (n--) \
*pdst++ = 0; \
if (endmask) \
*pdst &= ~endmask; \
break; \
case RROP_WHITE: \
if (startmask) \
*pdst++ |= startmask; \
while (n--) \
*pdst++ = ~0; \
if (endmask) \
*pdst |= endmask; \
break; \
case RROP_INVERT: \
if (startmask) \
*pdst++ ^= startmask; \
while (n--) \
*pdst++ ^= ~0; \
if (endmask) \
*pdst ^= endmask; \
break; \
case RROP_NOP: \
break; \
} \
} \
} \
}
#define FILLSLICESPANS(flip,addr) \
if (!flip) { \
FILLSPAN(xl, xr, addr); \
} else { \
xc = xorg - x; \
FILLSPAN(xc, xr, addr); \
xc += slw - 1; \
FILLSPAN(xl, xc, addr); \
}
static void
afbFillArcSliceSolidCopy(DrawablePtr pDraw, GCPtr pGC, xArc *arc, register unsigned char *rrops)
{
PixelType *addrl;
register PixelType *pdst;
register int n;
register int d;
int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
register int x, y, e;
miFillArcRec info;
miArcSliceRec slice;
int xl, xr, xc;
PixelType *addrlt, *addrlb;
int nlwidth;
int width;
PixelType startmask, endmask;
int nlmiddle;
int sizeDst;
int depthDst;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
addrlt);
miFillArcSetup(arc, &info);
miFillArcSliceSetup(arc, &slice, pGC);
MIFILLARCSETUP();
xorg += pDraw->x;
yorg += pDraw->y;
addrlb = addrlt;
addrlt = afbScanlineDeltaNoBankSwitch(addrlt, yorg - y, nlwidth);
addrlb = afbScanlineDeltaNoBankSwitch(addrlb, yorg + y + dy, nlwidth);
slice.edge1.x += pDraw->x;
slice.edge2.x += pDraw->x;
while (y > 0) {
afbScanlineIncNoBankSwitch(addrlt, nlwidth);
afbScanlineIncNoBankSwitch(addrlb, -nlwidth);
MIFILLARCSTEP(slw);
MIARCSLICESTEP(slice.edge1);
MIARCSLICESTEP(slice.edge2);
if (miFillSliceUpper(slice)) {
MIARCSLICEUPPER(xl, xr, slice, slw);
FILLSLICESPANS(slice.flip_top, addrlt);
}
if (miFillSliceLower(slice)) {
MIARCSLICELOWER(xl, xr, slice, slw);
FILLSLICESPANS(slice.flip_bot, addrlb);
}
}
}
void
afbPolyFillArcSolid(register DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
{
afbPrivGC *priv;
register xArc *arc;
register int i;
BoxRec box;
RegionPtr cclip;
unsigned char *rrops;
priv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey);
rrops = priv->rrops;
cclip = pGC->pCompositeClip;
for (arc = parcs, i = narcs; --i >= 0; arc++) {
if (miFillArcEmpty(arc))
continue;
if (miCanFillArc(arc)) {
box.x1 = arc->x + pDraw->x;
box.y1 = arc->y + pDraw->y;
box.x2 = box.x1 + (int)arc->width + 1;
box.y2 = box.y1 + (int)arc->height + 1;
if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) {
if ((arc->angle2 >= FULLCIRCLE) ||
(arc->angle2 <= -FULLCIRCLE))
afbFillEllipseSolid(pDraw, arc, rrops);
else
afbFillArcSliceSolidCopy(pDraw, pGC, arc, rrops);
continue;
}
}
miPolyFillArc(pDraw, pGC, 1, arc);
}
}

View File

@ -1,292 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xprotostr.h>
#include "pixmapstr.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "regionstr.h"
#include "scrnintstr.h"
#include "afb.h"
#include "maskbits.h"
#define MODEQ(a, b) ((a) %= (b))
/*
filled rectangles.
translate the rectangles, clip them, and call the
helper function in the GC.
*/
#define NUM_STACK_RECTS 1024
void
afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *prectInit)
/* number of rectangles to fill */
/* Pointer to first rectangle to fill */
{
xRectangle *prect;
RegionPtr prgnClip;
register BoxPtr pbox;
register BoxPtr pboxClipped;
BoxPtr pboxClippedBase;
BoxPtr pextent;
BoxRec stackRects[NUM_STACK_RECTS];
int numRects;
int n;
int xorg, yorg;
afbPrivGC *priv;
unsigned char *rrops;
unsigned char *rropsOS;
priv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey);
prgnClip = pGC->pCompositeClip;
rrops = priv->rrops;
rropsOS = priv->rropOS;
prect = prectInit;
xorg = pDrawable->x;
yorg = pDrawable->y;
if (xorg || yorg) {
prect = prectInit;
n = nrectFill;
Duff(n, prect->x += xorg; prect->y += yorg; prect++);
}
prect = prectInit;
numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
if (numRects > NUM_STACK_RECTS) {
pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec));
if (!pboxClippedBase)
return;
}
else
pboxClippedBase = stackRects;
pboxClipped = pboxClippedBase;
if (REGION_NUM_RECTS(prgnClip) == 1) {
int x1, y1, x2, y2, bx2, by2;
pextent = REGION_RECTS(prgnClip);
x1 = pextent->x1;
y1 = pextent->y1;
x2 = pextent->x2;
y2 = pextent->y2;
while (nrectFill--) {
if ((pboxClipped->x1 = prect->x) < x1)
pboxClipped->x1 = x1;
if ((pboxClipped->y1 = prect->y) < y1)
pboxClipped->y1 = y1;
bx2 = (int) prect->x + (int) prect->width;
if (bx2 > x2)
bx2 = x2;
pboxClipped->x2 = bx2;
by2 = (int) prect->y + (int) prect->height;
if (by2 > y2)
by2 = y2;
pboxClipped->y2 = by2;
prect++;
if ((pboxClipped->x1 < pboxClipped->x2) &&
(pboxClipped->y1 < pboxClipped->y2)) {
pboxClipped++;
}
}
} else {
int x1, y1, x2, y2, bx2, by2;
pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
x1 = pextent->x1;
y1 = pextent->y1;
x2 = pextent->x2;
y2 = pextent->y2;
while (nrectFill--) {
BoxRec box;
if ((box.x1 = prect->x) < x1)
box.x1 = x1;
if ((box.y1 = prect->y) < y1)
box.y1 = y1;
bx2 = (int) prect->x + (int) prect->width;
if (bx2 > x2)
bx2 = x2;
box.x2 = bx2;
by2 = (int) prect->y + (int) prect->height;
if (by2 > y2)
by2 = y2;
box.y2 = by2;
prect++;
if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
continue;
n = REGION_NUM_RECTS (prgnClip);
pbox = REGION_RECTS(prgnClip);
/* clip the rectangle to each box in the clip region
this is logically equivalent to calling Intersect()
*/
while(n--) {
pboxClipped->x1 = max(box.x1, pbox->x1);
pboxClipped->y1 = max(box.y1, pbox->y1);
pboxClipped->x2 = min(box.x2, pbox->x2);
pboxClipped->y2 = min(box.y2, pbox->y2);
pbox++;
/* see if clipping left anything */
if(pboxClipped->x1 < pboxClipped->x2 &&
pboxClipped->y1 < pboxClipped->y2) {
pboxClipped++;
}
}
}
}
if (pboxClipped != pboxClippedBase) {
switch (pGC->fillStyle) {
case FillSolid:
afbSolidFillArea(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, rrops);
break;
case FillTiled:
switch (pGC->alu) {
case GXcopy:
if (pGC->pRotatedPixmap)
afbTileAreaPPWCopy(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, GXcopy,
pGC->pRotatedPixmap, pGC->planemask);
else
afbTileAreaCopy (pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, GXcopy,
pGC->tile.pixmap,
pGC->patOrg.x, pGC->patOrg.y,
pGC->planemask);
break;
default:
if (pGC->pRotatedPixmap)
afbTileAreaPPWGeneral(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, pGC->alu,
pGC->pRotatedPixmap,
pGC->planemask);
else
afbTileAreaGeneral(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, pGC->alu,
pGC->tile.pixmap,
pGC->patOrg.x, pGC->patOrg.y,
pGC->planemask);
break;
} /* switch (alu) */
break;
case FillStippled:
if (pGC->pRotatedPixmap)
afbStippleAreaPPW(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, pGC->pRotatedPixmap, rrops);
else
afbStippleArea(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, pGC->stipple,
pGC->patOrg.x, pGC->patOrg.y, rrops);
break;
case FillOpaqueStippled:
switch (pGC->alu) {
case GXcopy:
if (pGC->pRotatedPixmap)
afbOpaqueStippleAreaPPWCopy(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, GXcopy,
pGC->pRotatedPixmap,
rropsOS, pGC->planemask);
else
afbOpaqueStippleAreaCopy(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, GXcopy,
pGC->stipple,
pGC->patOrg.x, pGC->patOrg.y, rropsOS,
pGC->planemask);
break;
default:
if (pGC->pRotatedPixmap)
afbOpaqueStippleAreaPPWGeneral(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, pGC->alu,
pGC->pRotatedPixmap,
rropsOS,
pGC->planemask);
else
afbOpaqueStippleAreaGeneral(pDrawable, pboxClipped-pboxClippedBase,
pboxClippedBase, pGC->alu,
pGC->stipple,
pGC->patOrg.x, pGC->patOrg.y,
rropsOS,
pGC->planemask);
break;
} /* switch (alu) */
break;
}
}
if (pboxClippedBase != stackRects)
xfree(pboxClippedBase);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +0,0 @@
/*
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include <X11/Xproto.h>
#include "afb.h"
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "scrnintstr.h"
/*ARGSUSED*/
Bool
afbRealizeFont( pscr, pFont)
ScreenPtr pscr;
FontPtr pFont;
{
return (TRUE);
}
/*ARGSUSED*/
Bool
afbUnrealizeFont( pscr, pFont)
ScreenPtr pscr;
FontPtr pFont;
{
return (TRUE);
}

View File

@ -1,685 +0,0 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <string.h>
#include <X11/X.h>
#include <X11/Xmd.h>
#include <X11/Xproto.h>
#include "afb.h"
#include "dixfontstr.h"
#include <X11/fonts/fontstruct.h>
#include "gcstruct.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "region.h"
#include "mistruct.h"
#include "migc.h"
#include "maskbits.h"
static void afbDestroyGC(GCPtr);
static void afbValidateGC(GCPtr, unsigned long, DrawablePtr);
static GCFuncs afbFuncs = {
afbValidateGC,
miChangeGC,
miCopyGC,
afbDestroyGC,
miChangeClip,
miDestroyClip,
miCopyClip
};
static GCOps afbGCOps = {
afbSolidFS,
afbSetSpans,
afbPutImage,
afbCopyArea,
miCopyPlane,
afbPolyPoint,
afbLineSS,
afbSegmentSS,
miPolyRectangle,
afbZeroPolyArcSS,
afbFillPolygonSolid,
afbPolyFillRect,
afbPolyFillArcSolid,
miPolyText8,
miPolyText16,
miImageText8,
miImageText16,
afbTEGlyphBlt,
afbPolyGlyphBlt,
afbPushPixels
};
static void
afbReduceOpaqueStipple(PixelType fg, PixelType bg, unsigned long planemask,
int depth, unsigned char *rop)
{
register int d;
register Pixel mask = 1;
bg ^= fg;
for (d = 0; d < depth; d++, mask <<= 1) {
if (!(planemask & mask))
rop[d] = RROP_NOP;
else if (!(bg & mask)) {
/* Both fg and bg have a 0 or 1 in this plane */
if (fg & mask)
rop[d] = RROP_WHITE;
else
rop[d] = RROP_BLACK;
} else {
/* Both fg and bg have different bits on this plane */
if (fg & mask)
rop[d] = RROP_COPY;
else
rop[d] = RROP_INVERT;
}
}
}
Bool
afbCreateGC(pGC)
register GCPtr pGC;
{
afbPrivGC *pPriv;
pGC->clientClip = NULL;
pGC->clientClipType = CT_NONE;
/* some of the output primitives aren't really necessary, since
they will be filled in ValidateGC because of dix/CreateGC()
setting all the change bits. Others are necessary because although
they depend on being a monochrome frame buffer, they don't change
*/
pGC->ops = &afbGCOps;
pGC->funcs = &afbFuncs;
/* afb wants to translate before scan convesion */
pGC->miTranslate = 1;
pPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey);
afbReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth,
pPriv->rrops);
afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
pGC->depth, pPriv->rropOS);
pGC->fExpose = TRUE;
pGC->pRotatedPixmap = NullPixmap;
pGC->freeCompClip = FALSE;
return TRUE;
}
static void
afbComputeCompositeClip(GCPtr pGC, DrawablePtr pDrawable)
{
if (pDrawable->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr) pDrawable;
RegionPtr pregWin;
Bool freeTmpClip, freeCompClip;
if (pGC->subWindowMode == IncludeInferiors) {
pregWin = NotClippedByChildren(pWin);
freeTmpClip = TRUE;
} else {
pregWin = &pWin->clipList;
freeTmpClip = FALSE;
}
freeCompClip = pGC->freeCompClip;
/*
* if there is no client clip, we can get by with just keeping the
* pointer we got, and remembering whether or not should destroy (or
* maybe re-use) it later. this way, we avoid unnecessary copying of
* regions. (this wins especially if many clients clip by children
* and have no client clip.)
*/
if (pGC->clientClipType == CT_NONE) {
if (freeCompClip)
REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
pGC->pCompositeClip = pregWin;
pGC->freeCompClip = freeTmpClip;
} else {
/*
* we need one 'real' region to put into the composite clip. if
* pregWin the current composite clip are real, we can get rid of
* one. if pregWin is real and the current composite clip isn't,
* use pregWin for the composite clip. if the current composite
* clip is real and pregWin isn't, use the current composite
* clip. if neither is real, create a new region.
*/
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
pDrawable->x + pGC->clipOrg.x,
pDrawable->y + pGC->clipOrg.y);
if (freeCompClip) {
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin,
pGC->clientClip);
if (freeTmpClip)
REGION_DESTROY(pGC->pScreen, pregWin);
} else if (freeTmpClip) {
REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, pGC->clientClip);
pGC->pCompositeClip = pregWin;
} else {
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
pregWin, pGC->clientClip);
}
pGC->freeCompClip = TRUE;
REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
-(pDrawable->x + pGC->clipOrg.x),
-(pDrawable->y + pGC->clipOrg.y));
}
} /* end of composite clip for a window */
else {
BoxRec pixbounds;
/* XXX should we translate by drawable.x/y here ? */
pixbounds.x1 = 0;
pixbounds.y1 = 0;
pixbounds.x2 = pDrawable->width;
pixbounds.y2 = pDrawable->height;
if (pGC->freeCompClip) {
REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
} else {
pGC->freeCompClip = TRUE;
pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
}
if (pGC->clientClipType == CT_REGION) {
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, -pGC->clipOrg.x,
-pGC->clipOrg.y);
REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
pGC->pCompositeClip, pGC->clientClip);
REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, pGC->clipOrg.x,
pGC->clipOrg.y);
}
} /* end of composite clip for pixmap */
} /* end afbComputeCompositeClip */
/* 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
*/
/*ARGSUSED*/
static void
afbValidateGC(pGC, changes, pDrawable)
register GCPtr pGC;
unsigned long changes;
DrawablePtr pDrawable;
{
register afbPrivGCPtr devPriv;
int mask; /* stateChanges */
int index; /* used for stepping through bitfields */
int xrot, yrot; /* rotations for tile and stipple pattern */
/* flags for changing the proc vector
and updating things in devPriv
*/
int new_rotate, new_rrop, new_line, new_text, new_fill;
DDXPointRec oldOrg; /* origin of thing GC was last used with */
oldOrg = pGC->lastWinOrg;
pGC->lastWinOrg.x = pDrawable->x;
pGC->lastWinOrg.y = pDrawable->y;
/* we need to re-rotate the tile if the previous window/pixmap
origin (oldOrg) differs from the new window/pixmap origin
(pGC->lastWinOrg)
*/
new_rotate = (oldOrg.x != pGC->lastWinOrg.x) ||
(oldOrg.y != pGC->lastWinOrg.y);
devPriv = (afbPrivGCPtr)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey);
/*
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)))
afbComputeCompositeClip(pGC, pDrawable);
new_rrop = FALSE;
new_line = FALSE;
new_text = FALSE;
new_fill = FALSE;
mask = changes;
while (mask) {
index = lowbit(mask);
mask &= ~index;
/* this switch acculmulates a list of which procedures
might have to change due to changes in the GC. in
some cases (e.g. changing one 16 bit tile for another)
we might not really need a change, but the code is
being paranoid.
this sort of batching wins if, for example, the alu
and the font have been changed, or any other pair
of items that both change the same thing.
*/
switch (index) {
case GCPlaneMask:
case GCFunction:
case GCForeground:
new_rrop = TRUE;
break;
case GCBackground:
new_rrop = TRUE; /* for opaque stipples */
break;
case GCLineStyle:
case GCLineWidth:
case GCJoinStyle:
new_line = TRUE;
break;
case GCCapStyle:
break;
case GCFillStyle:
new_fill = TRUE;
break;
case GCFillRule:
break;
case GCTile:
if(pGC->tileIsPixel)
break;
new_rotate = TRUE;
new_fill = TRUE;
break;
case GCStipple:
if(pGC->stipple == (PixmapPtr)NULL)
break;
new_rotate = TRUE;
new_fill = TRUE;
break;
case GCTileStipXOrigin:
new_rotate = TRUE;
break;
case GCTileStipYOrigin:
new_rotate = TRUE;
break;
case GCFont:
new_text = TRUE;
break;
case GCSubwindowMode:
break;
case GCGraphicsExposures:
break;
case GCClipXOrigin:
break;
case GCClipYOrigin:
break;
case GCClipMask:
break;
case GCDashOffset:
break;
case GCDashList:
break;
case GCArcMode:
break;
default:
break;
}
}
/* deal with the changes we've collected .
new_rrop must be done first because subsequent things
depend on it.
*/
if(new_rotate || new_fill) {
Bool new_pix = FALSE;
/* figure out how much to rotate */
xrot = pGC->patOrg.x;
yrot = pGC->patOrg.y;
xrot += pDrawable->x;
yrot += pDrawable->y;
switch (pGC->fillStyle) {
case FillTiled:
/* copy current tile and stipple */
if (!pGC->tileIsPixel &&
(pGC->tile.pixmap->drawable.width <= PPW) &&
!(pGC->tile.pixmap->drawable.width &
(pGC->tile.pixmap->drawable.width - 1))) {
afbCopyRotatePixmap(pGC->tile.pixmap, &pGC->pRotatedPixmap,
xrot, yrot);
new_pix = TRUE;
}
break;
case FillStippled:
case FillOpaqueStippled:
if (pGC->stipple && (pGC->stipple->drawable.width <= PPW) &&
!(pGC->stipple->drawable.width &
(pGC->stipple->drawable.width - 1))) {
afbCopyRotatePixmap(pGC->stipple, &pGC->pRotatedPixmap,
xrot, yrot);
new_pix = TRUE;
}
}
/* destroy any previously rotated tile or stipple */
if (!new_pix && pGC->pRotatedPixmap) {
(*pDrawable->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
pGC->pRotatedPixmap = (PixmapPtr)NULL;
}
}
/*
* duck out here when the GC is unchanged
*/
if (!changes)
return;
if (new_rrop || new_fill) {
afbReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pDrawable->depth,
devPriv->rrops);
afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
pGC->depth, devPriv->rropOS);
new_fill = TRUE;
}
if (new_line || new_fill || new_text) {
if (!pGC->ops->devPrivate.val) {
pGC->ops = miCreateGCOps(pGC->ops);
pGC->ops->devPrivate.val = 1;
}
}
if (new_line || new_fill) {
if (pGC->lineWidth == 0) {
if (pGC->lineStyle == LineSolid && pGC->fillStyle == FillSolid)
pGC->ops->PolyArc = afbZeroPolyArcSS;
else
pGC->ops->PolyArc = miZeroPolyArc;
} else
pGC->ops->PolyArc = miPolyArc;
if (pGC->lineStyle == LineSolid) {
if(pGC->lineWidth == 0) {
if (pGC->fillStyle == FillSolid) {
pGC->ops->PolySegment = afbSegmentSS;
pGC->ops->Polylines = afbLineSS;
}
else
{
pGC->ops->PolySegment = miPolySegment;
pGC->ops->Polylines = miZeroLine;
}
} else {
pGC->ops->PolySegment = miPolySegment;
pGC->ops->Polylines = miWideLine;
}
} else {
if(pGC->lineWidth == 0 && pGC->fillStyle == FillSolid) {
pGC->ops->PolySegment = afbSegmentSD;
pGC->ops->Polylines = afbLineSD;
} else {
pGC->ops->PolySegment = miPolySegment;
pGC->ops->Polylines = miWideDash;
}
}
}
if (new_text || new_fill) {
if ((pGC->font) &&
(FONTMAXBOUNDS(pGC->font,rightSideBearing) -
FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
FONTMINBOUNDS(pGC->font,characterWidth) < 0)) {
pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
} else {
/* special case ImageGlyphBlt for terminal emulator fonts */
if ((pGC->font) &&
TERMINALFONT(pGC->font)) {
pGC->ops->ImageGlyphBlt = afbTEGlyphBlt;
} else {
pGC->ops->ImageGlyphBlt = afbImageGlyphBlt;
}
/* now do PolyGlyphBlt */
if (pGC->fillStyle == FillSolid) {
pGC->ops->PolyGlyphBlt = afbPolyGlyphBlt;
} else {
pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
}
}
}
if (new_fill) {
/* install a suitable fillspans and pushpixels */
pGC->ops->PushPixels = afbPushPixels;
pGC->ops->FillPolygon = miFillPolygon;
pGC->ops->PolyFillArc = miPolyFillArc;
switch (pGC->fillStyle) {
case FillSolid:
pGC->ops->FillSpans = afbSolidFS;
pGC->ops->FillPolygon = afbFillPolygonSolid;
pGC->ops->PolyFillArc = afbPolyFillArcSolid;
break;
case FillTiled:
if (pGC->pRotatedPixmap)
pGC->ops->FillSpans = afbTileFS;
else
pGC->ops->FillSpans = afbUnnaturalTileFS;
break;
case FillOpaqueStippled:
if (pGC->pRotatedPixmap)
pGC->ops->FillSpans = afbOpaqueStippleFS;
else
pGC->ops->FillSpans = afbUnnaturalOpaqueStippleFS;
break;
case FillStippled:
if (pGC->pRotatedPixmap)
pGC->ops->FillSpans = afbStippleFS;
else
pGC->ops->FillSpans = afbUnnaturalStippleFS;
break;
}
} /* end of new_fill */
}
static void
afbDestroyGC(pGC)
GCPtr pGC;
{
if (pGC->pRotatedPixmap)
(*pGC->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
if (pGC->freeCompClip)
REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
miDestroyGCOps(pGC->ops);
}
void
afbReduceRop(alu, src, planemask, depth, rop)
register int alu;
register Pixel src;
register unsigned long planemask;
int depth;
register unsigned char *rop;
{
register int d;
register Pixel mask = 1;
for (d = 0; d < depth; d++, mask <<= 1) {
if (!(planemask & mask))
rop[d] = RROP_NOP;
else if ((src & mask) == 0) /* src is black */
switch (alu) {
case GXclear:
rop[d] = RROP_BLACK;
break;
case GXand:
rop[d] = RROP_BLACK;
break;
case GXandReverse:
rop[d] = RROP_BLACK;
break;
case GXcopy:
rop[d] = RROP_BLACK;
break;
case GXandInverted:
rop[d] = RROP_NOP;
break;
case GXnoop:
rop[d] = RROP_NOP;
break;
case GXxor:
rop[d] = RROP_NOP;
break;
case GXor:
rop[d] = RROP_NOP;
break;
case GXnor:
rop[d] = RROP_INVERT;
break;
case GXequiv:
rop[d] = RROP_INVERT;
break;
case GXinvert:
rop[d] = RROP_INVERT;
break;
case GXorReverse:
rop[d] = RROP_INVERT;
break;
case GXcopyInverted:
rop[d] = RROP_WHITE;
break;
case GXorInverted:
rop[d] = RROP_WHITE;
break;
case GXnand:
rop[d] = RROP_WHITE;
break;
case GXset:
rop[d] = RROP_WHITE;
break;
}
else /* src is white */
switch (alu) {
case GXclear:
rop[d] = RROP_BLACK;
break;
case GXand:
rop[d] = RROP_NOP;
break;
case GXandReverse:
rop[d] = RROP_INVERT;
break;
case GXcopy:
rop[d] = RROP_WHITE;
break;
case GXandInverted:
rop[d] = RROP_BLACK;
break;
case GXnoop:
rop[d] = RROP_NOP;
break;
case GXxor:
rop[d] = RROP_INVERT;
break;
case GXor:
rop[d] = RROP_WHITE;
break;
case GXnor:
rop[d] = RROP_BLACK;
break;
case GXequiv:
rop[d] = RROP_NOP;
break;
case GXinvert:
rop[d] = RROP_INVERT;
break;
case GXorReverse:
rop[d] = RROP_WHITE;
break;
case GXcopyInverted:
rop[d] = RROP_BLACK;
break;
case GXorInverted:
rop[d] = RROP_NOP;
break;
case GXnand:
rop[d] = RROP_INVERT;
break;
case GXset:
rop[d] = RROP_WHITE;
break;
}
}
}

View File

@ -1,165 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include "misc.h"
#include "region.h"
#include "gc.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "afb.h"
#include "maskbits.h"
#include "servermd.h"
/* GetSpans -- for each span, gets bits from drawable starting at ppt[i]
* and continuing for pwidth[i] bits
* Each scanline returned will be server scanline padded, i.e., it will come
* out to an integral number of words.
*/
/*ARGSUSED*/
void
afbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
DrawablePtr pDrawable; /* drawable from which to get bits */
int wMax; /* largest value of all *pwidths */
register DDXPointPtr ppt; /* points to start copying from */
int *pwidth; /* list of number of bits to copy */
int nspans; /* number of scanlines to copy */
char *pchardstStart; /* where to put the bits */
{
PixelType *pdstStart = (PixelType *)pchardstStart;
register PixelType *pdst; /* where to put the bits */
register PixelType *psrc; /* where to get the bits */
register PixelType tmpSrc; /* scratch buffer for bits */
PixelType *psrcBase; /* start of src bitmap */
int widthSrc; /* width of pixmap in bytes */
int sizeSrc;
int depthSrc;
register DDXPointPtr pptLast; /* one past last point to get */
int xEnd; /* last pixel to copy from */
register int nstart;
register int d;
int nend = 0;
int srcStartOver;
PixelType startmask, endmask;
unsigned int srcBit;
int nlMiddle, nl;
int w;
pptLast = ppt + nspans;
afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthSrc, sizeSrc, depthSrc,
psrcBase);
pdst = pdstStart;
while(ppt < pptLast) {
/* XXX should this really be << PWSH, or * 8, or * PGSZB? */
xEnd = min(ppt->x + *pwidth, widthSrc << PWSH);
pwidth++;
for (d = 0; d < depthSrc; d++) {
psrc = afbScanline(psrcBase, ppt->x, ppt->y, widthSrc);
psrcBase += sizeSrc; /* @@@ NEXT PLANE @@@ */
w = xEnd - ppt->x;
srcBit = ppt->x & PIM;
if (srcBit + w <= PPW)
{
getandputbits0(psrc, srcBit, w, pdst);
pdst++;
}
else
{
maskbits(ppt->x, w, startmask, endmask, nlMiddle);
if (startmask)
nstart = PPW - srcBit;
else
nstart = 0;
if (endmask)
nend = xEnd & PIM;
srcStartOver = srcBit + nstart > PLST;
if (startmask)
{
getandputbits0(psrc, srcBit, nstart, pdst);
if(srcStartOver)
psrc++;
}
nl = nlMiddle;
#ifdef FASTPUTBITS
Duff(nl, putbits(*psrc, nstart, PPW, pdst); psrc++; pdst++;);
#else
while (nl--)
{
tmpSrc = *psrc;
putbits(tmpSrc, nstart, PPW, pdst);
psrc++;
pdst++;
}
#endif
if (endmask)
{
putbits(*psrc, nstart, nend, pdst);
if(nstart + nend > PPW)
pdst++;
}
if (startmask || endmask)
pdst++;
}
}
ppt++;
}
}

View File

@ -1,209 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "gc.h"
#include "window.h"
#include "pixmap.h"
#include "region.h"
#include "afb.h"
#include "maskbits.h"
/* horizontal solid line
abs(len) > 1
*/
void
afbHorzS(pbase, nlwidth, sizeDst, depthDst, x1, y1, len, rrops)
PixelType *pbase; /* pointer to base of bitmap */
register int nlwidth; /* width in longwords of bitmap */
int sizeDst;
int depthDst;
int x1; /* initial point */
int y1;
int len; /* length of line */
register unsigned char *rrops;
{
register PixelType *addrl;
register PixelType startmask;
register PixelType endmask;
register int nlmiddle;
register int d;
int saveNLmiddle;
/* force the line to go left to right
but don't draw the last point
*/
if (len < 0) {
x1 += len;
x1 += 1;
len = -len;
}
/* all bits inside same longword */
if ( ((x1 & PIM) + len) < PPW) {
maskpartialbits(x1, len, startmask);
for (d = 0; d < depthDst; d++) {
addrl = afbScanline(pbase, x1, y1, nlwidth);
pbase += sizeDst; /* @@@ NEXT PLANE @@@ */
switch (rrops[d]) {
case RROP_BLACK:
*addrl &= ~startmask;
break;
case RROP_WHITE:
*addrl |= startmask;
break;
case RROP_INVERT:
*addrl ^= startmask;
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ...) */
} else {
maskbits(x1, len, startmask, endmask, nlmiddle);
saveNLmiddle = nlmiddle;
for (d = 0; d < depthDst; d++) {
addrl = afbScanline(pbase, x1, y1, nlwidth);
pbase += sizeDst; /* @@@ NEXT PLANE @@@ */
nlmiddle = saveNLmiddle;
switch (rrops[d]) {
case RROP_BLACK:
if (startmask)
*addrl++ &= ~startmask;
Duff (nlmiddle, *addrl++ = 0x0);
if (endmask)
*addrl &= ~endmask;
break;
case RROP_WHITE:
if (startmask)
*addrl++ |= startmask;
Duff (nlmiddle, *addrl++ = ~0);
if (endmask)
*addrl |= endmask;
break;
case RROP_INVERT:
if (startmask)
*addrl++ ^= startmask;
Duff (nlmiddle, *addrl++ ^= ~0);
if (endmask)
*addrl ^= endmask;
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ... ) */
}
}
/* vertical solid line
this uses do loops because pcc (Ultrix 1.2, bsd 4.2) generates
better code. sigh. we know that len will never be 0 or 1, so
it's OK to use it.
*/
void
afbVertS(pbase, nlwidth, sizeDst, depthDst, x1, y1, len, rrops)
PixelType *pbase; /* pointer to base of bitmap */
register int nlwidth; /* width in longwords of bitmap */
int sizeDst;
int depthDst;
int x1, y1; /* initial point */
register int len; /* length of line */
unsigned char *rrops;
{
register PixelType *addrl;
register PixelType bitmask;
int saveLen;
int d;
if (len < 0) {
nlwidth = -nlwidth;
len = -len;
}
saveLen = len;
for (d = 0; d < depthDst; d++) {
addrl = afbScanline(pbase, x1, y1, nlwidth);
pbase += sizeDst; /* @@@ NEXT PLANE @@@ */
len = saveLen;
switch (rrops[d]) {
case RROP_BLACK:
bitmask = mfbGetrmask(x1 & PIM);
Duff(len, *addrl &= bitmask; afbScanlineInc(addrl, nlwidth) );
break;
case RROP_WHITE:
bitmask = mfbGetmask(x1 & PIM);
Duff(len, *addrl |= bitmask; afbScanlineInc(addrl, nlwidth) );
break;
case RROP_INVERT:
bitmask = mfbGetmask(x1 & PIM);
Duff(len, *addrl ^= bitmask; afbScanlineInc(addrl, nlwidth) );
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ...) */
}

View File

@ -1,272 +0,0 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <string.h>
#include <X11/X.h>
#include "windowstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "gcstruct.h"
#include "afb.h"
#include "maskbits.h"
#include "servermd.h"
#include "mfb.h"
void
afbPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage)
DrawablePtr pDraw;
GCPtr pGC;
int depth, x, y, width, height;
int leftPad;
int format;
char *pImage;
{
PixmapPtr pPixmap;
if ((width == 0) || (height == 0))
return;
if (format != ZPixmap || depth == 1 || pDraw->depth == 1) {
pPixmap = GetScratchPixmapHeader(pDraw->pScreen, width+leftPad, height,
depth, depth,
BitmapBytePad(width+leftPad),
(pointer)pImage);
if (!pPixmap)
return;
pGC->fExpose = FALSE;
if (format == XYBitmap)
(void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
0, width, height, x, y, 1);
else {
(void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
0, width, height, x, y);
}
pGC->fExpose = TRUE;
FreeScratchPixmapHeader(pPixmap);
} else {
/* Chunky to planar conversion required */
PixmapPtr pPixmap;
ScreenPtr pScreen = pDraw->pScreen;
int widthSrc;
int start_srcshift;
register int b;
register int dstshift;
register int shift_step;
register PixelType dst;
register PixelType srcbits;
register PixelType *pdst;
register PixelType *psrc;
int start_bit;
register int nl;
register int h;
register int d;
int sizeDst;
PixelType *pdstBase;
int widthDst;
int depthDst;
/* Create a tmp pixmap */
pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap)
return;
afbGetPixelWidthSizeDepthAndPointer((DrawablePtr)pPixmap, widthDst,
sizeDst, depthDst, pdstBase);
widthSrc = PixmapWidthInPadUnits(width, depth);
/* XXX: if depth == 8, use fast chunky to planar assembly function.*/
if (depth > 4) {
start_srcshift = 24;
shift_step = 8;
} else {
start_srcshift = 28;
shift_step = 4;
}
for (d = 0; d < depth; d++, pdstBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
start_bit = start_srcshift + d;
psrc = (PixelType *)pImage;
pdst = pdstBase;
h = height;
while (h--) {
dstshift = PPW - 1;
dst = 0;
nl = widthSrc;
while (nl--) {
srcbits = *psrc++;
for (b = start_bit; b >= 0; b -= shift_step) {
dst |= ((srcbits >> b) & 1) << dstshift;
if (--dstshift < 0) {
dstshift = PPW - 1;
*pdst++ = dst;
dst = 0;
}
}
}
if (dstshift != PPW - 1)
*pdst++ = dst;
}
} /* for (d = ...) */
pGC->fExpose = FALSE;
(void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0,
width, height, x, y);
pGC->fExpose = TRUE;
(*pScreen->DestroyPixmap)(pPixmap);
}
}
void
afbGetImage(pDrawable, sx, sy, width, height, format, planemask, pdstLine)
DrawablePtr pDrawable;
int sx, sy, width, height;
unsigned int format;
unsigned long planemask;
char *pdstLine;
{
BoxRec box;
DDXPointRec ptSrc;
RegionRec rgnDst;
ScreenPtr pScreen;
PixmapPtr pPixmap;
if ((width == 0) || (height == 0))
return;
pScreen = pDrawable->pScreen;
sx += pDrawable->x;
sy += pDrawable->y;
if (format == XYPixmap || pDrawable->depth == 1) {
pPixmap = GetScratchPixmapHeader(pScreen, width, height, 1, 1,
BitmapBytePad(width), (pointer)pdstLine);
if (!pPixmap)
return;
ptSrc.x = sx;
ptSrc.y = sy;
box.x1 = 0;
box.y1 = 0;
box.x2 = width;
box.y2 = height;
REGION_INIT(pScreen, &rgnDst, &box, 1);
pPixmap->drawable.depth = 1;
pPixmap->drawable.bitsPerPixel = 1;
/* dix layer only ever calls GetImage with 1 bit set in planemask
* when format is XYPixmap.
*/
afbDoBitblt(pDrawable, (DrawablePtr)pPixmap, GXcopy, &rgnDst, &ptSrc,
planemask);
FreeScratchPixmapHeader(pPixmap);
REGION_UNINIT(pScreen, &rgnDst);
} else {
/* Planar to chunky conversion required */
PixelType *psrcBits;
PixelType *psrcLine;
PixelType startmask, endmask;
int depthSrc;
int widthSrc;
int sizeSrc;
int sizeDst;
int widthDst;
register PixelType *psrc;
register PixelType *pdst;
register PixelType dst;
register PixelType srcbits;
register int d;
register int b;
register int dstshift;
register int shift_step;
register int start_endbit;
int start_startbit;
register int end_endbit = 0;
register int start_dstshift;
register int nl;
register int h;
int nlmiddle;
widthDst = PixmapWidthInPadUnits(width, pDrawable->depth);
sizeDst = widthDst * height;
/* Clear the dest image */
bzero(pdstLine, sizeDst << 2);
afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthSrc, sizeSrc,
depthSrc, psrcBits);
psrcBits = afbScanline(psrcBits, sx, sy, widthSrc);
start_startbit = PPW - 1 - (sx & PIM);
if ((sx & PIM) + width < PPW) {
maskpartialbits(sx, width, startmask);
nlmiddle = 0;
endmask = 0;
start_endbit = PPW - ((sx + width) & PIM);
} else {
maskbits(sx, width, startmask, endmask, nlmiddle);
start_endbit = 0;
end_endbit = PPW - ((sx + width) & PIM);
}
/* ZPixmap images have either 4 or 8 bits per pixel dependent on
* depth.
*/
if (depthSrc > 4) {
start_dstshift = 24;
shift_step = 8;
} else {
start_dstshift = 28;
shift_step = 4;
}
#define SHIFT_BITS(start_bit,end_bit) \
for (b = (start_bit); b >= (end_bit); b--) { \
dst |= ((srcbits >> b) & 1) << dstshift; \
if ((dstshift -= shift_step) < 0) { \
dstshift = start_dstshift + d; \
*pdst++ = dst; \
dst = *pdst; \
} \
} \
for (d = 0; d < depthSrc; d++, psrcBits += sizeSrc) { /* @@@ NEXT PLANE @@@ */
psrcLine = psrcBits;
pdst = (PixelType *)pdstLine;
h = height;
while (h--) {
psrc = psrcLine;
psrcLine += widthSrc;
dst = *pdst;
dstshift = start_dstshift + d;
if (startmask) {
srcbits = *psrc++ & startmask;
SHIFT_BITS(start_startbit, start_endbit);
}
nl = nlmiddle;
while (nl--) {
srcbits = *psrc++;
SHIFT_BITS(PPW - 1, 0);
}
if (endmask) {
srcbits = *psrc & endmask;
SHIFT_BITS(PPW - 1, end_endbit);
}
if (dstshift != start_dstshift + d)
*pdst++ = dst;
} /* while (h--) */
} /* for (d = ...) */
}
}

View File

@ -1,472 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include <X11/Xproto.h>
#include "afb.h"
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "regionstr.h"
#include "maskbits.h"
/*
we should eventually special-case fixed-width fonts for ImageText.
this works for fonts with glyphs <= 32 bits wide.
the clipping calculations are done for worst-case fonts.
we make no assumptions about the heights, widths, or bearings
of the glyphs. if we knew that the glyphs are all the same height,
we could clip the tops and bottoms per clipping box, rather
than per character per clipping box. if we knew that the glyphs'
left and right bearings were wlle-behaved, we could clip a single
character at the start, output until the last unclipped
character, and then clip the last one. this is all straightforward
to determine based on max-bounds and min-bounds from the font.
there is some inefficiency introduced in the per-character
clipping to make what's going on clearer.
(it is possible, for example, for a font to be defined in which the
next-to-last character in a font would be clipped out, but the last
one wouldn't. the code below deals with this.)
Image text looks at the bits in the glyph and the fg and bg in the
GC. it paints a rectangle, as defined in the protocol dcoument,
and the paints the characters.
the register allocations for startmask and endmask may not
be the right thing. are there two other deserving candidates?
xoff, pdst, pglyph, and tmpSrc seem like the right things, though.
*/
void
afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
DrawablePtr pDrawable;
GC *pGC;
int x, y;
unsigned int nglyph;
CharInfoPtr *ppci; /* array of character info */
pointer pglyphBase; /* start of array of glyphs */
{
ExtentInfoRec info; /* used by QueryGlyphExtents() */
BoxRec bbox; /* string's bounding box */
xRectangle backrect;/* backing rectangle to paint.
in the general case, NOT necessarily
the same as the string's bounding box
*/
CharInfoPtr pci;
int xorg, yorg; /* origin of drawable in bitmap */
int widthDst; /* width of dst in longwords */
/* these keep track of the character origin */
PixelType *pdstBase;
/* points to longword with character origin */
int xchar; /* xorigin of char (mod 32) */
/* these are used for placing the glyph */
register int xoff; /* x offset of left edge of glyph (mod 32) */
register PixelType *pdst;
/* pointer to current longword in dst */
register int d;
int depthDst;
int sizeDst;
int hSave;
int w; /* width of glyph in bits */
int h; /* height of glyph */
int widthGlyph; /* width of glyph, in bytes */
unsigned char rrops[AFB_MAX_DEPTH];
register unsigned char *pglyph;
/* pointer to current row of glyph */
unsigned char *pglyphSave;
/* used for putting down glyph */
register PixelType tmpSrc;
/* for getting bits from glyph */
register PixelType startmask;
register PixelType endmask;
register int nFirst;/* bits of glyph in current longword */
PixelType *pdstSave;
int oldFill;
afbPrivGC *pPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey);
xorg = pDrawable->x;
yorg = pDrawable->y;
afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
pdstBase);
QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
backrect.x = x;
backrect.y = y - FONTASCENT(pGC->font);
backrect.width = info.overallWidth;
backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
x += xorg;
y += yorg;
bbox.x1 = x + info.overallLeft;
bbox.x2 = x + info.overallRight;
bbox.y1 = y - info.overallAscent;
bbox.y2 = y + info.overallDescent;
oldFill = pGC->fillStyle;
pGC->fillStyle = FillSolid;
afbReduceRop (pGC->alu, pGC->bgPixel, pGC->planemask, pGC->depth,
pPriv->rrops);
afbPolyFillRect(pDrawable, pGC, 1, &backrect);
pGC->fillStyle = oldFill;
afbReduceRop (pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth,
pPriv->rrops);
afbReduceRop (GXcopy, pGC->fgPixel, pGC->planemask, pGC->depth, rrops);
/* the faint-hearted can open their eyes now */
switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
case rgnOUT:
break;
case rgnIN:
pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
xchar = x & PIM;
while(nglyph--) {
pci = *ppci;
pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
hSave = pci->metrics.ascent + pci->metrics.descent;
widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
/* start at top scanline of glyph */
pdstSave = afbScanlineDelta(pdstBase, -pci->metrics.ascent,
widthDst);
/* find correct word in scanline and x offset within it
for left edge of glyph
*/
xoff = xchar + pci->metrics.leftSideBearing;
if (xoff > PLST) {
pdstSave++;
xoff &= PIM;
} else if (xoff < 0) {
xoff += PPW;
pdstSave--;
}
for (d = 0; d < depthDst; d++) {
h = hSave;
pdst = pdstSave;
pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */
pglyph = pglyphSave;
if ((xoff + w) <= PPW) {
/* glyph all in one longword */
maskpartialbits(xoff, w, startmask);
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_WHITE:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_NOP:
break;
}
} else {
/* glyph crosses longword boundary */
maskPPWbits(xoff, w, startmask, endmask);
nFirst = PPW - xoff;
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
*(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_WHITE:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
*(pdst+1) |= SCRLEFT(tmpSrc, nFirst) & endmask;
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_NOP:
break;
}
} /* glyph crosses longwords boundary */
} /* depth loop */
/* update character origin */
x += pci->metrics.characterWidth;
xchar += pci->metrics.characterWidth;
if (xchar > PLST) {
xchar -= PPW;
pdstBase++;
} else if (xchar < 0) {
xchar += PPW;
pdstBase--;
}
ppci++;
} /* while nglyph-- */
break;
case rgnPART:
{
afbTEXTPOS *ppos;
int nbox;
BoxPtr pbox;
RegionPtr cclip;
int xpos; /* x position of char origin */
int i;
BoxRec clip;
int leftEdge, rightEdge;
int topEdge, bottomEdge;
int glyphRow; /* first row of glyph not wholly
clipped out */
int glyphCol; /* leftmost visible column of glyph */
#if GETLEFTBITS_ALIGNMENT > 1
int getWidth; /* bits to get from glyph */
#endif
if(!(ppos = (afbTEXTPOS *)xalloc(nglyph * sizeof(afbTEXTPOS))))
return;
pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
xpos = x;
xchar = xpos & PIM;
for (i = 0; i < nglyph; i++) {
pci = ppci[i];
ppos[i].xpos = xpos;
ppos[i].xchar = xchar;
ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
ppos[i].topEdge = y - pci->metrics.ascent;
ppos[i].bottomEdge = y + pci->metrics.descent;
ppos[i].pdstBase = pdstBase;
ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
xpos += pci->metrics.characterWidth;
xchar += pci->metrics.characterWidth;
if (xchar > PLST) {
xchar &= PIM;
pdstBase++;
} else if (xchar < 0) {
xchar += PPW;
pdstBase--;
}
}
cclip = pGC->pCompositeClip;
pbox = REGION_RECTS(cclip);
nbox = REGION_NUM_RECTS(cclip);
/* HACK ALERT
since we continue out of the loop below so often, it
is easier to increment pbox at the top than at the end.
don't try this at home.
*/
pbox--;
while(nbox--) {
pbox++;
clip.x1 = max(bbox.x1, pbox->x1);
clip.y1 = max(bbox.y1, pbox->y1);
clip.x2 = min(bbox.x2, pbox->x2);
clip.y2 = min(bbox.y2, pbox->y2);
if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
continue;
for(i=0; i<nglyph; i++) {
pci = ppci[i];
xchar = ppos[i].xchar;
/* clip the left and right edges */
if (ppos[i].leftEdge < clip.x1)
leftEdge = clip.x1;
else
leftEdge = ppos[i].leftEdge;
if (ppos[i].rightEdge > clip.x2)
rightEdge = clip.x2;
else
rightEdge = ppos[i].rightEdge;
w = rightEdge - leftEdge;
if (w <= 0)
continue;
/* clip the top and bottom edges */
if (ppos[i].topEdge < clip.y1)
topEdge = clip.y1;
else
topEdge = ppos[i].topEdge;
if (ppos[i].bottomEdge > clip.y2)
bottomEdge = clip.y2;
else
bottomEdge = ppos[i].bottomEdge;
hSave = bottomEdge - topEdge;
if (hSave <= 0)
continue;
glyphRow = (topEdge - y) + pci->metrics.ascent;
widthGlyph = ppos[i].widthGlyph;
pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
pglyphSave += (glyphRow * widthGlyph);
glyphCol = (leftEdge - ppos[i].xpos) -
(pci->metrics.leftSideBearing);
#if GETLEFTBITS_ALIGNMENT > 1
getWidth = w + glyphCol;
#endif
pdstSave = afbScanlineDelta(ppos[i].pdstBase, -(y-topEdge),
widthDst);
xoff = xchar + (leftEdge - ppos[i].xpos);
if (xoff > PLST) {
xoff &= PIM;
pdstSave++;
} else if (xoff < 0) {
xoff += PPW;
pdstSave--;
}
for (d = 0; d < depthDst; d++) {
h = hSave;
pdst = pdstSave;
pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */
pglyph = pglyphSave;
if ((xoff + w) <= PPW) {
maskpartialbits(xoff, w, startmask);
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_WHITE:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_NOP:
break;
}
} else {
maskPPWbits(xoff, w, startmask, endmask);
nFirst = PPW - xoff;
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
*(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_WHITE:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst |= SCRRIGHT(tmpSrc, xoff) & startmask;
*(pdst+1) |= SCRLEFT(tmpSrc, nFirst) & endmask;
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_NOP:
break;
}
}
} /* depth */
} /* for each glyph */
} /* while nbox-- */
xfree(ppos);
break;
}
default:
break;
}
}

View File

@ -1,707 +0,0 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <stdlib.h>
#include "gcstruct.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "regionstr.h"
#include "scrnintstr.h"
#include "mistruct.h"
#include "afb.h"
#include "maskbits.h"
#include "miline.h"
/* single-pixel lines on a color frame buffer
NON-SLOPED LINES
horizontal lines are always drawn left to right; we have to
move the endpoints right by one after they're swapped.
horizontal lines will be confined to a single band of a
region. the code finds that band (giving up if the lower
bound of the band is above the line we're drawing); then it
finds the first box in that band that contains part of the
line. we clip the line to subsequent boxes in that band.
vertical lines are always drawn top to bottom (y-increasing.)
this requires adding one to the y-coordinate of each endpoint
after swapping.
SLOPED LINES
when clipping a sloped line, we bring the second point inside
the clipping box, rather than one beyond it, and then add 1 to
the length of the line before drawing it. this lets us use
the same box for finding the outcodes for both endpoints. since
the equation for clipping the second endpoint to an edge gives us
1 beyond the edge, we then have to move the point towards the
first point by one step on the major axis.
eventually, there will be a diagram here to explain what's going
on. the method uses Cohen-Sutherland outcodes to determine
outsideness, and a method similar to Pike's layers for doing the
actual clipping.
*/
void
#ifdef POLYSEGMENT
afbSegmentSS(pDrawable, pGC, nseg, pSeg)
DrawablePtr pDrawable;
GCPtr pGC;
int nseg;
register xSegment *pSeg;
#else
afbLineSS(pDrawable, pGC, mode, npt, pptInit)
DrawablePtr pDrawable;
GCPtr pGC;
int mode; /* Origin or Previous */
int npt; /* number of points */
DDXPointPtr pptInit;
#endif
{
int nboxInit;
register int nbox;
BoxPtr pboxInit;
register BoxPtr pbox;
#ifndef POLYSEGMENT
register DDXPointPtr ppt; /* pointer to list of translated points */
#endif
unsigned int oc1; /* outcode of point 1 */
unsigned int oc2; /* outcode of point 2 */
PixelType *addrlBase; /* pointer to start of drawable */
int nlwidth; /* width in longwords of destination pixmap */
int xorg, yorg; /* origin of window */
int adx; /* abs values of dx and dy */
int ady;
int signdx; /* sign of dx and dy */
int signdy;
int e, e1, e2; /* bresenham error and increments */
int len; /* length of segment */
int axis; /* major axis */
int octant;
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
int depthDst;
#ifndef POLYSEGMENT
PixelType *addrl; /* address of destination pixmap */
int d;
#endif
int sizeDst;
unsigned char *rrops;
/* a bunch of temporaries */
register int y1, y2;
register int x1, x2;
RegionPtr cclip;
cclip = pGC->pCompositeClip;
rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey))->rrops;
pboxInit = REGION_RECTS(cclip);
nboxInit = REGION_NUM_RECTS(cclip);
afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
addrlBase);
xorg = pDrawable->x;
yorg = pDrawable->y;
#ifdef POLYSEGMENT
while (nseg--)
#else
ppt = pptInit;
x2 = ppt->x + xorg;
y2 = ppt->y + yorg;
while(--npt)
#endif
{
nbox = nboxInit;
pbox = pboxInit;
#ifdef POLYSEGMENT
x1 = pSeg->x1 + xorg;
y1 = pSeg->y1 + yorg;
x2 = pSeg->x2 + xorg;
y2 = pSeg->y2 + yorg;
pSeg++;
#else
x1 = x2;
y1 = y2;
++ppt;
if (mode == CoordModePrevious) {
xorg = x1;
yorg = y1;
}
x2 = ppt->x + xorg;
y2 = ppt->y + yorg;
#endif
if (x1 == x2) /* vertical line */
{
/* make the line go top to bottom of screen, keeping
endpoint semantics
*/
if (y1 > y2) {
register int tmp;
tmp = y2;
y2 = y1 + 1;
y1 = tmp + 1;
#ifdef POLYSEGMENT
if (pGC->capStyle != CapNotLast)
y1--;
#endif
}
#ifdef POLYSEGMENT
else if (pGC->capStyle != CapNotLast)
y2++;
#endif
/* get to first band that might contain part of line */
while ((nbox) && (pbox->y2 <= y1)) {
pbox++;
nbox--;
}
if (nbox) {
/* stop when lower edge of box is beyond end of line */
while((nbox) && (y2 >= pbox->y1)) {
if ((x1 >= pbox->x1) && (x1 < pbox->x2)) {
int y1t, y2t;
/* this box has part of the line in it */
y1t = max(y1, pbox->y1);
y2t = min(y2, pbox->y2);
if (y1t != y2t)
afbVertS(addrlBase, nlwidth, sizeDst, depthDst, x1, y1t,
y2t-y1t, rrops); /* @@@ NEXT PLANE PASSED @@@ */
}
nbox--;
pbox++;
}
}
#ifndef POLYSEGMENT
y2 = ppt->y + yorg;
#endif
} else if (y1 == y2) /* horizontal line */ {
/* force line from left to right, keeping
endpoint semantics
*/
if (x1 > x2) {
register int tmp;
tmp = x2;
x2 = x1 + 1;
x1 = tmp + 1;
#ifdef POLYSEGMENT
if (pGC->capStyle != CapNotLast)
x1--;
#endif
}
#ifdef POLYSEGMENT
else if (pGC->capStyle != CapNotLast)
x2++;
#endif
/* find the correct band */
while( (nbox) && (pbox->y2 <= y1)) {
pbox++;
nbox--;
}
/* try to draw the line, if we haven't gone beyond it */
if ((nbox) && (pbox->y1 <= y1)) {
int tmp;
/* when we leave this band, we're done */
tmp = pbox->y1;
while((nbox) && (pbox->y1 == tmp)) {
int x1t, x2t;
if (pbox->x2 <= x1) {
/* skip boxes until one might contain start point */
nbox--;
pbox++;
continue;
}
/* stop if left of box is beyond right of line */
if (pbox->x1 >= x2) {
nbox = 0;
break;
}
x1t = max(x1, pbox->x1);
x2t = min(x2, pbox->x2);
if (x1t != x2t)
afbHorzS(addrlBase, nlwidth, sizeDst, depthDst, x1t, y1,
x2t-x1t, rrops); /* @@@ NEXT PLANE PASSED @@@ */
nbox--;
pbox++;
}
}
#ifndef POLYSEGMENT
x2 = ppt->x + xorg;
#endif
}
else /* sloped line */
{
CalcLineDeltas(x1, y1, x2, y2, adx, ady,
signdx, signdy, 1, 1, octant);
if (adx > ady) {
axis = X_AXIS;
e1 = ady << 1;
e2 = e1 - (adx << 1);
e = e1 - adx;
} else {
axis = Y_AXIS;
e1 = adx << 1;
e2 = e1 - (ady << 1);
e = e1 - ady;
SetYMajorOctant(octant);
}
FIXUP_ERROR(e, octant, bias);
/* we have bresenham parameters and two points.
all we have to do now is clip and draw.
*/
while(nbox--) {
oc1 = 0;
oc2 = 0;
OUTCODES(oc1, x1, y1, pbox);
OUTCODES(oc2, x2, y2, pbox);
if ((oc1 | oc2) == 0) {
if (axis == X_AXIS)
len = adx;
else
len = ady;
#ifdef POLYSEGMENT
if (pGC->capStyle != CapNotLast)
len++;
#endif
afbBresS(addrlBase, nlwidth, sizeDst, depthDst, signdx, signdy,
axis, x1, y1, e, e1, e2, len, rrops); /* @@@ NEXT PLANE PASSED @@@ */
break;
} else if (oc1 & oc2) {
pbox++;
} else {
int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
int clip1 = 0, clip2 = 0;
int clipdx, clipdy;
int err;
if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
pbox->y2-1,
&new_x1, &new_y1, &new_x2, &new_y2,
adx, ady, &clip1, &clip2,
octant, bias, oc1, oc2) == -1) {
pbox++;
continue;
}
if (axis == X_AXIS)
len = abs(new_x2 - new_x1);
else
len = abs(new_y2 - new_y1);
#ifdef POLYSEGMENT
if (clip2 != 0 || pGC->capStyle != CapNotLast)
len++;
#else
len += (clip2 != 0);
#endif
if (len) {
/* unwind bresenham error term to first point */
if (clip1) {
clipdx = abs(new_x1 - x1);
clipdy = abs(new_y1 - y1);
if (axis == X_AXIS)
err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
else
err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
}
else
err = e;
afbBresS(addrlBase, nlwidth, sizeDst, depthDst, signdx,
signdy, axis, new_x1, new_y1, err, e1, e2, len,
rrops); /* @@@ NEXT PLANE PASSED @@@ */
}
pbox++;
}
} /* while (nbox--) */
} /* sloped line */
} /* while (nline--) */
#ifndef POLYSEGMENT
/* paint the last point if the end style isn't CapNotLast.
(Assume that a projecting, butt, or round cap that is one
pixel wide is the same as the single pixel of the endpoint.)
*/
if ((pGC->capStyle != CapNotLast) &&
((ppt->x + xorg != pptInit->x + pDrawable->x) ||
(ppt->y + yorg != pptInit->y + pDrawable->y) ||
(ppt == pptInit + 1))) {
nbox = nboxInit;
pbox = pboxInit;
while (nbox--) {
if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) &&
(y2 < pbox->y2)) {
for (d = 0; d < depthDst; d++) {
addrl = afbScanline(addrlBase, x2, y2, nlwidth);
addrlBase += sizeDst; /* @@@ NEXT PLANE @@@ */
switch(rrops[d]) {
case RROP_BLACK:
*addrl &= mfbGetrmask(x2 & PIM);
break;
case RROP_WHITE:
*addrl |= mfbGetmask(x2 & PIM);
break;
case RROP_INVERT:
*addrl ^= mfbGetmask(x2 & PIM);
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ...) */
break;
} else
pbox++;
}
}
#endif
}
/*
* Draw dashed 1-pixel lines.
*/
void
#ifdef POLYSEGMENT
afbSegmentSD(pDrawable, pGC, nseg, pSeg)
DrawablePtr pDrawable;
register GCPtr pGC;
int nseg;
register xSegment *pSeg;
#else
afbLineSD(pDrawable, pGC, mode, npt, pptInit)
DrawablePtr pDrawable;
register GCPtr pGC;
int mode; /* Origin or Previous */
int npt; /* number of points */
DDXPointPtr pptInit;
#endif
{
int nboxInit;
register int nbox;
BoxPtr pboxInit;
register BoxPtr pbox;
#ifndef POLYSEGMENT
register DDXPointPtr ppt; /* pointer to list of translated points */
#endif
register unsigned int oc1; /* outcode of point 1 */
register unsigned int oc2; /* outcode of point 2 */
PixelType *addrlBase; /* address of destination pixmap */
int nlwidth; /* width in longwords of destination pixmap */
int sizeDst;
int depthDst;
int xorg, yorg; /* origin of window */
int adx; /* abs values of dx and dy */
int ady;
int signdx; /* sign of dx and dy */
int signdy;
int e, e1, e2; /* bresenham error and increments */
int len; /* length of segment */
int axis; /* major axis */
int octant;
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
int x1, x2, y1, y2;
RegionPtr cclip;
unsigned char *rrops;
unsigned char bgrrops[AFB_MAX_DEPTH];
unsigned char *pDash;
int dashOffset;
int numInDashList;
int dashIndex;
int isDoubleDash;
int dashIndexTmp, dashOffsetTmp;
int unclippedlen;
#ifndef POLYSEGMENT
PixelType *addrl;
int d;
#endif
cclip = pGC->pCompositeClip;
rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey))->rrops;
pboxInit = REGION_RECTS(cclip);
nboxInit = REGION_NUM_RECTS(cclip);
afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
addrlBase);
/* compute initial dash values */
pDash = (unsigned char *) pGC->dash;
numInDashList = pGC->numInDashList;
isDoubleDash = (pGC->lineStyle == LineDoubleDash);
dashIndex = 0;
dashOffset = 0;
miStepDash ((int)pGC->dashOffset, &dashIndex, pDash,
numInDashList, &dashOffset);
if (isDoubleDash)
afbReduceRop (pGC->alu, pGC->bgPixel, pGC->planemask, pGC->depth,
bgrrops);
xorg = pDrawable->x;
yorg = pDrawable->y;
#ifdef POLYSEGMENT
while (nseg--)
#else
ppt = pptInit;
x2 = ppt->x + xorg;
y2 = ppt->y + yorg;
while(--npt)
#endif
{
nbox = nboxInit;
pbox = pboxInit;
#ifdef POLYSEGMENT
x1 = pSeg->x1 + xorg;
y1 = pSeg->y1 + yorg;
x2 = pSeg->x2 + xorg;
y2 = pSeg->y2 + yorg;
pSeg++;
#else
x1 = x2;
y1 = y2;
++ppt;
if (mode == CoordModePrevious) {
xorg = x1;
yorg = y1;
}
x2 = ppt->x + xorg;
y2 = ppt->y + yorg;
#endif
CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy,
1, 1, octant);
if (adx > ady) {
axis = X_AXIS;
e1 = ady << 1;
e2 = e1 - (adx << 1);
e = e1 - adx;
unclippedlen = adx;
} else {
axis = Y_AXIS;
e1 = adx << 1;
e2 = e1 - (ady << 1);
e = e1 - ady;
unclippedlen = ady;
SetYMajorOctant(octant);
}
FIXUP_ERROR(e, octant, bias);
/* we have bresenham parameters and two points.
all we have to do now is clip and draw.
*/
while(nbox--) {
oc1 = 0;
oc2 = 0;
OUTCODES(oc1, x1, y1, pbox);
OUTCODES(oc2, x2, y2, pbox);
if ((oc1 | oc2) == 0) {
#ifdef POLYSEGMENT
if (pGC->capStyle != CapNotLast)
unclippedlen++;
dashIndexTmp = dashIndex;
dashOffsetTmp = dashOffset;
afbBresD(&dashIndexTmp, pDash, numInDashList, &dashOffsetTmp,
isDoubleDash, addrlBase, nlwidth, sizeDst, depthDst,
signdx, signdy, axis, x1, y1, e, e1, e2, unclippedlen,
rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */
break;
#else
afbBresD(&dashIndex, pDash, numInDashList, &dashOffset,
isDoubleDash, addrlBase, nlwidth, sizeDst, depthDst,
signdx, signdy, axis, x1, y1, e, e1, e2, unclippedlen,
rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */
goto dontStep;
#endif
} else if (oc1 & oc2) {
pbox++;
} else /* have to clip */ {
int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
int clip1 = 0, clip2 = 0;
int clipdx, clipdy;
int err;
if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, pbox->y2-1,
&new_x1, &new_y1, &new_x2, &new_y2,
adx, ady, &clip1, &clip2,
octant, bias, oc1, oc2) == -1) {
pbox++;
continue;
}
dashIndexTmp = dashIndex;
dashOffsetTmp = dashOffset;
if (clip1) {
int dlen;
if (axis == X_AXIS)
dlen = abs(new_x1 - x1);
else
dlen = abs(new_y1 - y1);
miStepDash (dlen, &dashIndexTmp, pDash,
numInDashList, &dashOffsetTmp);
}
if (axis == X_AXIS)
len = abs(new_x2 - new_x1);
else
len = abs(new_y2 - new_y1);
#ifdef POLYSEGMENT
if (clip2 != 0 || pGC->capStyle != CapNotLast)
len++;
#else
len += (clip2 != 0);
#endif
if (len) {
/* unwind bresenham error term to first point */
if (clip1) {
clipdx = abs(new_x1 - x1);
clipdy = abs(new_y1 - y1);
if (axis == X_AXIS)
err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
else
err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
}
else
err = e;
afbBresD(&dashIndexTmp, pDash, numInDashList, &dashOffsetTmp,
isDoubleDash, addrlBase, nlwidth, sizeDst, depthDst,
signdx, signdy, axis, new_x1, new_y1, err, e1, e2,
len, rrops, bgrrops); /* @@@ NEXT PLANE PASSED @@@ */
}
pbox++;
}
} /* while (nbox--) */
#ifndef POLYSEGMENT
/*
* walk the dash list around to the next line
*/
miStepDash (unclippedlen, &dashIndex, pDash,
numInDashList, &dashOffset);
dontStep: ;
#endif
} /* while (nline--) */
#ifndef POLYSEGMENT
/* paint the last point if the end style isn't CapNotLast.
(Assume that a projecting, butt, or round cap that is one
pixel wide is the same as the single pixel of the endpoint.)
*/
if ((pGC->capStyle != CapNotLast) &&
((dashIndex & 1) == 0 || isDoubleDash) &&
((ppt->x + xorg != pptInit->x + pDrawable->x) ||
(ppt->y + yorg != pptInit->y + pDrawable->y) ||
(ppt == pptInit + 1))) {
nbox = nboxInit;
pbox = pboxInit;
while (nbox--) {
if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) &&
(y2 < pbox->y2)) {
int rop;
for (d = 0; d < depthDst; d++) {
addrl = afbScanline(addrlBase, x2, y2, nlwidth);
addrlBase += sizeDst; /* @@@ NEXT PLANE @@@ */
rop = rrops[d];
if (dashIndex & 1)
rop = bgrrops[d];
switch (rop) {
case RROP_BLACK:
*addrl &= mfbGetrmask(x2 & PIM);
break;
case RROP_WHITE:
*addrl |= mfbGetmask(x2 & PIM);
break;
case RROP_INVERT:
*addrl ^= mfbGetmask(x2 & PIM);
break;
case RROP_NOP:
break;
}
} /* for (d = ...) */
break;
} else
pbox++;
}
}
#endif
}

View File

@ -1,94 +0,0 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "misc.h"
#include "cursor.h"
#include "scrnintstr.h"
#include "afb.h"
/*ARGSUSED*/
void
afbQueryBestSize(class, pwidth, pheight, pScreen)
int class;
unsigned short *pwidth;
unsigned short *pheight;
ScreenPtr pScreen;
{
unsigned width, test;
switch(class) {
case CursorShape:
if (*pwidth > pScreen->width)
*pwidth = pScreen->width;
if (*pheight > pScreen->height)
*pheight = pScreen->height;
break;
case TileShape:
case StippleShape:
width = *pwidth;
if (!width) break;
/* Return the closes power of two not less than what they gave me */
test = 0x80000000;
/* Find the highest 1 bit in the width given */
while(!(test & width))
test >>= 1;
/* If their number is greater than that, bump up to the next
* power of two */
if((test - 1) & width)
test <<= 1;
*pwidth = test;
/* We don't care what height they use */
break;
}
}

View File

@ -1,299 +0,0 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
/* pixmap management
written by drewry, september 1986
on a monchrome device, a pixmap is a bitmap.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <string.h>
#include <X11/Xmd.h>
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "maskbits.h"
#include "afb.h"
#include "mi.h"
#include "servermd.h"
#include "mfb.h"
PixmapPtr
afbCreatePixmap(pScreen, width, height, depth, usage_hint)
ScreenPtr pScreen;
int width;
int height;
int depth;
unsigned usage_hint;
{
PixmapPtr pPixmap;
size_t datasize;
size_t paddedWidth;
paddedWidth = BitmapBytePad(width);
if (paddedWidth > 32767 || height > 32767 || depth > 4)
return NullPixmap;
datasize = height * paddedWidth * depth;
pPixmap = AllocatePixmap(pScreen, datasize);
if (!pPixmap)
return(NullPixmap);
pPixmap->drawable.type = DRAWABLE_PIXMAP;
pPixmap->drawable.class = 0;
pPixmap->drawable.pScreen = pScreen;
pPixmap->drawable.depth = depth;
pPixmap->drawable.bitsPerPixel = depth;
pPixmap->drawable.id = 0;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pPixmap->drawable.x = 0;
pPixmap->drawable.y = 0;
pPixmap->drawable.width = width;
pPixmap->drawable.height = height;
pPixmap->devKind = paddedWidth;
pPixmap->refcnt = 1;
pPixmap->devPrivate.ptr = datasize ?
(pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
pPixmap->usage_hint = usage_hint;
return(pPixmap);
}
Bool
afbDestroyPixmap(pPixmap)
PixmapPtr pPixmap;
{
if(--pPixmap->refcnt)
return(TRUE);
dixFreePrivates(pPixmap->devPrivates);
xfree(pPixmap);
return(TRUE);
}
static PixmapPtr
afbCopyPixmap(PixmapPtr pSrc)
{
register PixmapPtr pDst;
int size;
ScreenPtr pScreen;
size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth;
pScreen = pSrc->drawable.pScreen;
pDst = (*pScreen->CreatePixmap)(pScreen,
pSrc->drawable.width,
pSrc->drawable.height,
pSrc->drawable.depth, 0);
if (!pDst)
return(NullPixmap);
memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);
return(pDst);
}
/* replicates a pattern to be a full 32 bits wide.
relies on the fact that each scnaline is longword padded.
doesn't do anything if pixmap is not a factor of 32 wide.
changes width field of pixmap if successful, so that the fast
XRotatePixmap code gets used if we rotate the pixmap later.
calculate number of times to repeat
for each scanline of pattern
zero out area to be filled with replicate
left shift and or in original as many times as needed
*/
static void
afbPadPixmap(PixmapPtr pPixmap)
{
register int width = pPixmap->drawable.width;
register int h;
register PixelType mask;
register PixelType *p;
register PixelType bits; /* real pattern bits */
register int i;
int d;
int rep; /* repeat count for pattern */
if (width >= PPW)
return;
rep = PPW/width;
if (rep*width != PPW)
return;
mask = mfbGetendtab(width);
p = (PixelType *)(pPixmap->devPrivate.ptr);
for (d = 0; d < pPixmap->drawable.depth; d++) {
for (h = 0; h < pPixmap->drawable.height; h++) {
*p &= mask;
bits = *p;
for(i = 1; i < rep; i++) {
bits = SCRRIGHT(bits, width);
*p |= bits;
}
p++; /* @@@ NEXT PLANE @@@ */
}
}
pPixmap->drawable.width = PPW;
}
/* Rotates pixmap pPix by w pixels to the right on the screen. Assumes that
* words are PPW bits wide, and that the least significant bit appears on the
* left.
*/
void
afbXRotatePixmap(pPix, rw)
PixmapPtr pPix;
register int rw;
{
register PixelType *pw, *pwFinal;
register PixelType t;
if (pPix == NullPixmap)
return;
pw = (PixelType *)pPix->devPrivate.ptr;
rw %= (int)pPix->drawable.width;
if (rw < 0)
rw += (int)pPix->drawable.width;
if(pPix->drawable.width == PPW) {
pwFinal = pw + pPix->drawable.height * pPix->drawable.depth;
while(pw < pwFinal) {
t = *pw;
*pw++ = SCRRIGHT(t, rw) |
(SCRLEFT(t, (PPW-rw)) & mfbGetendtab(rw));
}
} else {
/* We no longer do this. Validate doesn't try to rotate odd-size
* tiles or stipples. afbUnnatural<tile/stipple>FS works directly off
* the unrotate tile/stipple in the GC
*/
ErrorF("X internal error: trying to rotate odd-sized pixmap.\n");
}
}
/* Rotates pixmap pPix by h lines. Assumes that h is always less than
pPix->height
works on any width.
*/
void
afbYRotatePixmap(pPix, rh)
register PixmapPtr pPix;
int rh;
{
int nbyDown; /* bytes to move down to row 0; also offset of
row rh */
int nbyUp; /* bytes to move up to line rh; also
offset of first line moved down to 0 */
char *pbase;
char *ptmp;
int height;
int d;
if (pPix == NullPixmap)
return;
height = (int) pPix->drawable.height;
rh %= height;
if (rh < 0)
rh += height;
nbyDown = rh * pPix->devKind;
nbyUp = (pPix->devKind * height) - nbyDown;
if(!(ptmp = (char *)xalloc(nbyUp)))
return;
for (d = 0; d < pPix->drawable.depth; d++) {
pbase = (char *)pPix->devPrivate.ptr + pPix->devKind * height * d; /* @@@ NEXT PLANE @@@ */
memmove(ptmp, pbase, nbyUp); /* save the low rows */
memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */
memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */
}
xfree(ptmp);
}
void
afbCopyRotatePixmap(psrcPix, ppdstPix, xrot, yrot)
register PixmapPtr psrcPix, *ppdstPix;
int xrot, yrot;
{
register PixmapPtr pdstPix;
if ((pdstPix = *ppdstPix) &&
(pdstPix->devKind == psrcPix->devKind) &&
(pdstPix->drawable.height == psrcPix->drawable.height) &&
(pdstPix->drawable.depth == psrcPix->drawable.depth)) {
memmove((char *)pdstPix->devPrivate.ptr,
(char *)psrcPix->devPrivate.ptr,
psrcPix->drawable.height * psrcPix->devKind *
psrcPix->drawable.depth);
pdstPix->drawable.width = psrcPix->drawable.width;
pdstPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
} else {
if (pdstPix)
/* FIX XBUG 6168 */
(*pdstPix->drawable.pScreen->DestroyPixmap)(pdstPix);
*ppdstPix = pdstPix = afbCopyPixmap(psrcPix);
if (!pdstPix)
return;
}
afbPadPixmap(pdstPix);
if (xrot)
afbXRotatePixmap(pdstPix, xrot);
if (yrot)
afbYRotatePixmap(pdstPix, yrot);
}

View File

@ -1,300 +0,0 @@
/*
*
Copyright (c) 1990 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
*
* Author: Keith Packard, MIT X Consortium
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include <X11/X.h>
#include "gcstruct.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "regionstr.h"
#include "scrnintstr.h"
#include "mistruct.h"
#include "afb.h"
#include "maskbits.h"
#if defined(mips) || defined(sparc)
#define GetHighWord(x) (((int)(x)) >> 16)
#else
#define GetHighWord(x) (((int)(x)) / 65536)
#endif
#if IMAGE_BYTE_ORDER == MSBFirst
#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int)((short) (i))))
#define coordToInt(x,y) (((x) << 16) | (y))
#define intToX(i) (GetHighWord(i))
#define intToY(i) ((int)((short) i))
#else
#define intToCoord(i,x,y) (((x) = (int)((short) (i))), ((y) = GetHighWord(i)))
#define coordToInt(x,y) (((y) << 16) | (x))
#define intToX(i) ((int)((short) (i)))
#define intToY(i) (GetHighWord(i))
#endif
void
afbFillPolygonSolid (pDrawable, pGC, shape, mode, count, ptsIn)
DrawablePtr pDrawable;
GCPtr pGC;
int shape;
int mode;
int count;
DDXPointPtr ptsIn;
{
afbPrivGCPtr devPriv;
int nlwidth;
PixelType *addrl, *addr;
int maxy;
int origin;
register int vertex1, vertex2;
int c;
BoxPtr extents;
int clip;
int y;
int *vertex1p = NULL, *vertex2p;
int *endp;
int x1 = 0, x2 = 0;
int dx1 = 0, dx2 = 0;
int dy1 = 0, dy2 = 0;
int e1 = 0, e2 = 0;
int step1 = 0, step2 = 0;
int sign1 = 0, sign2 = 0;
int h;
int l, r;
PixelType mask, bits = ~((PixelType)0);
int nmiddle;
register unsigned char *rrops;
register int n;
register int d;
int sizeDst;
int depthDst;
register PixelType *pdst;
devPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey);
if (mode == CoordModePrevious || shape != Convex ||
REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
return;
}
origin = *((int *) &pDrawable->x);
origin -= (origin & 0x8000) << 1;
extents = &pGC->pCompositeClip->extents;
vertex1 = *((int *) &extents->x1) - origin;
vertex2 = *((int *) &extents->x2) - origin - 0x00010001;
clip = 0;
y = 32767;
maxy = 0;
vertex2p = (int *) ptsIn;
endp = vertex2p + count;
while (count--) {
c = *vertex2p;
clip |= (c - vertex1) | (vertex2 - c);
c = intToY(c);
if (c < y) {
y = c;
vertex1p = vertex2p;
}
vertex2p++;
if (c > maxy)
maxy = c;
}
if (y == maxy)
return;
if (clip & 0x80008000) {
miFillPolygon (pDrawable, pGC, shape, mode, vertex2p - (int *) ptsIn, ptsIn);
return;
}
afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
addrl);
rrops = devPriv->rrops;
addrl = afbScanlineDelta(addrl, y + pDrawable->y, nlwidth);
origin = intToX(origin);
vertex2p = vertex1p;
vertex2 = vertex1 = *vertex2p++;
if (vertex2p == endp)
vertex2p = (int *) ptsIn;
#define Setup(c,x,vertex,dx,dy,e,sign,step) {\
x = intToX(vertex); \
if ((dy = intToY(c) - y)) { \
dx = intToX(c) - x; \
step = 0; \
if (dx >= 0) { \
e = 0; \
sign = 1; \
if (dx >= dy) {\
step = dx / dy; \
dx = dx % dy; \
} \
} else { \
e = 1 - dy; \
sign = -1; \
dx = -dx; \
if (dx >= dy) { \
step = - (dx / dy); \
dx = dx % dy; \
} \
} \
} \
x += origin; \
vertex = c; \
}
#define Step(x,dx,dy,e,sign,step) {\
x += step; \
if ((e += dx) > 0) { \
x += sign; \
e -= dy; \
} \
}
for (;;) {
if (y == intToY(vertex1)) {
do {
if (vertex1p == (int *) ptsIn)
vertex1p = endp;
c = *--vertex1p;
Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1)
} while (y >= intToY(vertex1));
h = dy1;
} else {
Step(x1,dx1,dy1,e1,sign1,step1)
h = intToY(vertex1) - y;
}
if (y == intToY(vertex2)) {
do {
c = *vertex2p++;
if (vertex2p == endp)
vertex2p = (int *) ptsIn;
Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2)
} while (y >= intToY(vertex2));
if (dy2 < h)
h = dy2;
} else {
Step(x2,dx2,dy2,e2,sign2,step2)
if ((c = (intToY(vertex2) - y)) < h)
h = c;
}
/* fill spans for this segment */
y += h;
for (;;) {
l = x1;
r = x2;
nmiddle = x2 - x1;
if (nmiddle < 0) {
nmiddle = -nmiddle;
l = x2;
r = x1;
}
c = l & PIM;
l -= c;
l = l >> PWSH;
addr = addrl + l;
if (c + nmiddle < PPW) {
mask = SCRRIGHT (bits,c) ^ SCRRIGHT (bits,c+nmiddle);
for (pdst = addr, d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */
switch (rrops[d]) {
case RROP_BLACK:
*pdst &= ~mask;
break;
case RROP_WHITE:
*pdst |= mask;
break;
case RROP_INVERT:
*pdst ^= mask;
break;
case RROP_NOP:
break;
}
}
} else {
if (c) {
mask = SCRRIGHT(bits, c);
for (pdst = addr, d = 0; d < depthDst; d++, pdst += sizeDst) { /* @@@ NEXT PLANE @@@ */
switch (rrops[d]) {
case RROP_BLACK:
*pdst &= ~mask;
break;
case RROP_WHITE:
*pdst |= mask;
break;
case RROP_INVERT:
*pdst ^= mask;
break;
case RROP_NOP:
break;
}
}
nmiddle += c - PPW;
addr++;
}
nmiddle >>= PWSH;
mask = ~SCRRIGHT(bits, r & PIM);
for (d = 0; d < depthDst; d++, addr += sizeDst) { /* @@@ NEXT PLANE @@@ */
n = nmiddle;
pdst = addr;
switch (rrops[d]) {
case RROP_BLACK:
Duff (n, *pdst++ = 0;)
if (mask)
*pdst &= ~mask;
break;
case RROP_WHITE:
Duff (n, *pdst++ = ~0;);
if (mask)
*pdst |= mask;
break;
case RROP_INVERT:
Duff (n, *pdst++ ^= ~0;);
if (mask)
*pdst ^= mask;
break;
case RROP_NOP:
break;
}
}
}
if (!--h)
break;
afbScanlineInc(addrl, nlwidth);
Step(x1,dx1,dy1,e1,sign1,step1)
Step(x2,dx2,dy2,e2,sign2,step2)
}
if (y == maxy)
break;
afbScanlineInc(addrl, nlwidth);
}
}

View File

@ -1,463 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include <X11/Xproto.h>
#include "afb.h"
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "regionstr.h"
#include "maskbits.h"
/*
this works for fonts with glyphs <= 32 bits wide.
the clipping calculations are done for worst-case fonts.
we make no assumptions about the heights, widths, or bearings
of the glyphs. if we knew that the glyphs are all the same height,
we could clip the tops and bottoms per clipping box, rather
than per character per clipping box. if we knew that the glyphs'
left and right bearings were wlle-behaved, we could clip a single
character at the start, output until the last unclipped
character, and then clip the last one. this is all straightforward
to determine based on max-bounds and min-bounds from the font.
there is some inefficiency introduced in the per-character
clipping to make what's going on clearer.
(it is possible, for example, for a font to be defined in which the
next-to-last character in a font would be clipped out, but the last
one wouldn't. the code below deals with this.)
*/
void
afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
DrawablePtr pDrawable;
GC *pGC;
int x, y;
unsigned int nglyph;
CharInfoPtr *ppci; /* array of character info */
pointer pglyphBase; /* start of array of glyphs */
{
ExtentInfoRec info; /* used by QueryGlyphExtents() */
BoxRec bbox; /* string's bounding box */
CharInfoPtr pci;
int xorg, yorg; /* origin of drawable in bitmap */
int widthDst; /* width of dst in longwords */
/* these keep track of the character origin */
PixelType *pdstBase;
/* points to longword with character origin */
int xchar; /* xorigin of char (mod 32) */
/* these are used for placing the glyph */
register int xoff; /* x offset of left edge of glyph (mod 32) */
register PixelType *pdst; /* pointer to current longword in dst */
register int d;
int depthDst;
int sizeDst;
int hSave;
int w; /* width of glyph in bits */
int h; /* height of glyph */
int widthGlyph; /* width of glyph, in bytes */
unsigned char *rrops;
register unsigned char *pglyph;
/* pointer to current row of glyph */
unsigned char *pglyphSave;
/* used for putting down glyph */
register PixelType tmpSrc;
/* for getting bits from glyph */
register PixelType startmask;
register PixelType endmask;
register int nFirst; /* bits of glyph in current longword */
PixelType *pdstSave;
xorg = pDrawable->x;
yorg = pDrawable->y;
afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
pdstBase);
QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
x += xorg;
y += yorg;
bbox.x1 = x + info.overallLeft;
bbox.x2 = x + info.overallRight;
bbox.y1 = y - info.overallAscent;
bbox.y2 = y + info.overallDescent;
rrops = ((afbPrivGCPtr)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey))->rrops;
switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
case rgnOUT:
break;
case rgnIN:
pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
xchar = x & PIM;
while(nglyph--) {
pci = *ppci;
pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
hSave = pci->metrics.ascent + pci->metrics.descent;
widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
/* start at top scanline of glyph */
pdstSave = afbScanlineDelta(pdstBase, -pci->metrics.ascent,
widthDst);
/* find correct word in scanline and x offset within it
for left edge of glyph
*/
xoff = xchar + pci->metrics.leftSideBearing;
if (xoff > PLST) {
pdstSave++;
xoff &= PIM;
} else if (xoff < 0) {
xoff += PPW;
pdstSave--;
}
for (d = 0; d < depthDst; d++) {
h = hSave;
pdst = pdstSave;
pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */
pglyph = pglyphSave;
if ((xoff + w) <= PPW) {
/* glyph all in one longword */
maskpartialbits(xoff, w, startmask);
switch (rrops[d]) {
case RROP_WHITE:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_BLACK:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_INVERT:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
}
} else {
/* glyph crosses longword boundary */
maskPPWbits(xoff, w, startmask, endmask);
nFirst = PPW - xoff;
switch (rrops[d]) {
case RROP_WHITE:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
*(pdst+1) |= (SCRLEFT(tmpSrc, nFirst) & endmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_BLACK:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
*(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_INVERT:
while (h--) {
getleftbits(pglyph, w, tmpSrc);
*pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
*(pdst+1) ^= (SCRLEFT(tmpSrc, nFirst) & endmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
}
} /* glyph crosses longwords boundary */
} /* depth loop */
/* update character origin */
x += pci->metrics.characterWidth;
xchar += pci->metrics.characterWidth;
if (xchar > PLST) {
xchar -= PPW;
pdstBase++;
} else if (xchar < 0) {
xchar += PPW;
pdstBase--;
}
ppci++;
} /* while nglyph-- */
break;
case rgnPART:
{
afbTEXTPOS *ppos;
int nbox;
BoxPtr pbox;
RegionPtr cclip;
int xpos; /* x position of char origin */
int i;
BoxRec clip;
int leftEdge, rightEdge;
int topEdge, bottomEdge;
int glyphRow; /* first row of glyph not wholly
clipped out */
int glyphCol; /* leftmost visible column of glyph */
#if GETLEFTBITS_ALIGNMENT > 1
int getWidth; /* bits to get from glyph */
#endif
if(!(ppos = (afbTEXTPOS *)xalloc(nglyph * sizeof(afbTEXTPOS))))
return;
pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
xpos = x;
xchar = xpos & PIM;
for (i = 0; i < nglyph; i++) {
pci = ppci[i];
ppos[i].xpos = xpos;
ppos[i].xchar = xchar;
ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
ppos[i].topEdge = y - pci->metrics.ascent;
ppos[i].bottomEdge = y + pci->metrics.descent;
ppos[i].pdstBase = pdstBase;
ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
xpos += pci->metrics.characterWidth;
xchar += pci->metrics.characterWidth;
if (xchar > PLST) {
xchar &= PIM;
pdstBase++;
} else if (xchar < 0) {
xchar += PPW;
pdstBase--;
}
}
cclip = pGC->pCompositeClip;
pbox = REGION_RECTS(cclip);
nbox = REGION_NUM_RECTS(cclip);
/* HACK ALERT
since we continue out of the loop below so often, it
is easier to increment pbox at the top than at the end.
don't try this at home.
*/
pbox--;
while(nbox--) {
pbox++;
clip.x1 = max(bbox.x1, pbox->x1);
clip.y1 = max(bbox.y1, pbox->y1);
clip.x2 = min(bbox.x2, pbox->x2);
clip.y2 = min(bbox.y2, pbox->y2);
if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
continue;
for(i=0; i<nglyph; i++) {
pci = ppci[i];
xchar = ppos[i].xchar;
/* clip the left and right edges */
if (ppos[i].leftEdge < clip.x1)
leftEdge = clip.x1;
else
leftEdge = ppos[i].leftEdge;
if (ppos[i].rightEdge > clip.x2)
rightEdge = clip.x2;
else
rightEdge = ppos[i].rightEdge;
w = rightEdge - leftEdge;
if (w <= 0)
continue;
/* clip the top and bottom edges */
if (ppos[i].topEdge < clip.y1)
topEdge = clip.y1;
else
topEdge = ppos[i].topEdge;
if (ppos[i].bottomEdge > clip.y2)
bottomEdge = clip.y2;
else
bottomEdge = ppos[i].bottomEdge;
hSave = bottomEdge - topEdge;
if (hSave <= 0)
continue;
glyphRow = (topEdge - y) + pci->metrics.ascent;
widthGlyph = ppos[i].widthGlyph;
pglyphSave = FONTGLYPHBITS(pglyphBase, pci);
pglyphSave += (glyphRow * widthGlyph);
glyphCol = (leftEdge - ppos[i].xpos) -
(pci->metrics.leftSideBearing);
#if GETLEFTBITS_ALIGNMENT > 1
getWidth = w + glyphCol;
#endif
pdstSave = afbScanlineDelta(ppos[i].pdstBase, -(y-topEdge),
widthDst);
xoff = xchar + (leftEdge - ppos[i].xpos);
if (xoff > PLST) {
xoff &= PIM;
pdstSave++;
} else if (xoff < 0) {
xoff += PPW;
pdstSave--;
}
for (d = 0; d < depthDst; d++) {
h = hSave;
pdst = pdstSave;
pdstSave += sizeDst; /* @@@ NEXT PLANE @@@ */
pglyph = pglyphSave;
if ((xoff + w) <= PPW) {
maskpartialbits(xoff, w, startmask);
switch (rrops[d]) {
case RROP_WHITE:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_BLACK:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_INVERT:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
}
} else {
maskPPWbits(xoff, w, startmask, endmask);
nFirst = PPW - xoff;
switch (rrops[d]) {
case RROP_WHITE:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst |= (SCRRIGHT(tmpSrc, xoff) & startmask);
*(pdst+1) |= (SCRLEFT(tmpSrc, nFirst) & endmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_BLACK:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst &= ~(SCRRIGHT(tmpSrc, xoff) & startmask);
*(pdst+1) &= ~(SCRLEFT(tmpSrc, nFirst) & endmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
case RROP_INVERT:
while (h--) {
getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
*pdst ^= (SCRRIGHT(tmpSrc, xoff) & startmask);
*(pdst+1) ^= (SCRLEFT(tmpSrc, nFirst) & endmask);
pglyph += widthGlyph;
afbScanlineInc(pdst, widthDst);
}
break;
}
}
} /* depth */
} /* for each glyph */
} /* while nbox-- */
xfree(ppos);
break;
}
default:
break;
}
}

View File

@ -1,655 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "windowstr.h"
#include "regionstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "afb.h"
#include "maskbits.h"
/*
the solid fillers are called for rectangles and window backgrounds.
the boxes are already translated.
maybe this should always take a pixmap instead of a drawable?
NOTE:
iy = ++iy < tileHeight ? iy : 0
is equivalent to iy%= tileheight, and saves a division.
*/
/*ARGSUSED*/
void
afbSolidFillArea (pDraw, nbox, pbox, rrops)
DrawablePtr pDraw;
int nbox;
BoxPtr pbox;
register unsigned char *rrops;
{
int nlwidth; /* width in longwords of the drawable */
int w; /* width of current box */
register int h; /* height of current box */
register PixelType *p; /* pointer to bits we're writing */
register int nlw; /* loop version of nlwMiddle */
register PixelType startmask;
register PixelType endmask;
/* masks for reggedy bits at either end of line */
register int nlwExtra;
/* to get from right of box to left of next span */
int nlwMiddle; /* number of longwords between sides of boxes */
PixelType *pbits; /* pointer to start of drawable */
PixelType *saveP;
int saveH;
int depthDst;
int sizeDst;
register int d;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
pbits);
while (nbox--) {
w = pbox->x2 - pbox->x1;
saveH = pbox->y2 - pbox->y1;
saveP = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
if ( ((pbox->x1 & PIM) + w) < PPW) {
for (d = 0; d < depthDst; d++) {
h = saveH;
p = saveP;
saveP += sizeDst; /* @@@ NEXT PLANE @@@ */
maskpartialbits(pbox->x1, w, startmask);
nlwExtra = nlwidth;
switch (rrops[d]) {
case RROP_BLACK:
Duff(h, *p &= ~startmask; afbScanlineInc(p, nlwExtra));
break;
case RROP_WHITE:
Duff(h, *p |= startmask; afbScanlineInc(p, nlwExtra));
break;
case RROP_INVERT:
Duff(h, *p ^= startmask; afbScanlineInc(p, nlwExtra));
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ..) */
} else {
maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
for (d = 0; d < depthDst; d++) {
h = saveH;
p = saveP;
saveP += sizeDst; /* @@@ NEXT PLANE @@@ */
nlwExtra = nlwidth - nlwMiddle;
if (startmask && endmask) {
nlwExtra -= 1;
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
nlw = nlwMiddle;
*p &= ~startmask;
p++;
Duff(nlw, *p++ = 0);
*p &= ~endmask;
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_WHITE:
while (h--) {
nlw = nlwMiddle;
*p |= startmask;
p++;
Duff(nlw, *p++ = ~0);
*p |= endmask;
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_INVERT:
while (h--) {
nlw = nlwMiddle;
*p ^= startmask;
p++;
Duff(nlw, *p++ ^= ~0);
*p ^= endmask;
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_NOP:
break;
}
} else if (startmask && !endmask) {
nlwExtra -= 1;
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
nlw = nlwMiddle;
*p &= ~startmask;
p++;
Duff(nlw, *p++ = 0);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_WHITE:
while (h--) {
nlw = nlwMiddle;
*p |= startmask;
p++;
Duff(nlw, *p++ = ~0);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_INVERT:
while (h--) {
nlw = nlwMiddle;
*p ^= startmask;
p++;
Duff(nlw, *p++ ^= ~0);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_NOP:
break;
}
} else if (!startmask && endmask) {
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
nlw = nlwMiddle;
Duff(nlw, *p++ = 0);
*p &= ~endmask;
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_WHITE:
while (h--) {
nlw = nlwMiddle;
Duff(nlw, *p++ = ~0);
*p |= endmask;
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_INVERT:
while (h--) {
nlw = nlwMiddle;
Duff(nlw, *p++ ^= ~0);
*p ^= endmask;
afbScanlineInc(p, nlwExtra);
}
case RROP_NOP:
break;
}
} else { /* no ragged bits at either end */
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
nlw = nlwMiddle;
Duff(nlw, *p++ = 0);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_WHITE:
while (h--) {
nlw = nlwMiddle;
Duff(nlw, *p++ = ~0);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_INVERT:
while (h--) {
nlw = nlwMiddle;
Duff(nlw, *p++ ^= ~0);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_NOP:
break;
} /* switch */
}
} /* for (d = 0 ... ) */
}
pbox++;
}
}
/* stipple a list of boxes -
you can use the reduced rasterop for stipples. if rrop is
black, AND the destination with (not stipple pattern). if rrop is
white OR the destination with the stipple pattern. if rrop is invert,
XOR the destination with the stipple pattern.
*/
/*ARGSUSED*/
void
afbStippleAreaPPW (pDraw, nbox, pbox, pstipple, rrops)
DrawablePtr pDraw;
int nbox;
BoxPtr pbox;
PixmapPtr pstipple;
unsigned char *rrops;
{
register PixelType *psrc;
/* pointer to bits in tile, if needed */
int tileHeight; /* height of the tile */
register PixelType srcpix;
int nlwidth; /* width in longwords of the drawable */
int w; /* width of current box */
register int nlw; /* loop version of nlwMiddle */
register PixelType *p; /* pointer to bits we're writing */
register int h; /* height of current box */
PixelType startmask;
PixelType endmask; /* masks for reggedy bits at either end of line */
int nlwMiddle; /* number of longwords between sides of boxes */
int nlwExtra; /* to get from right of box to left of next span */
int sizeDst;
int depthDst;
int d;
int saveIy;
register int iy; /* index of current scanline in tile */
PixelType *pbits; /* pointer to start of drawable */
PixelType *pBase;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
pBase);
tileHeight = pstipple->drawable.height;
psrc = (PixelType *)(pstipple->devPrivate.ptr);
while (nbox--) {
w = pbox->x2 - pbox->x1;
saveIy = pbox->y1 % tileHeight;
pbits = pBase;
if ( ((pbox->x1 & PIM) + w) < PPW) {
maskpartialbits(pbox->x1, w, startmask);
nlwExtra = nlwidth;
for (d = 0; d < depthDst; d++) {
p = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
pbits += sizeDst; /* @@@ NEXT PLANE @@@ */
iy = saveIy;
h = pbox->y2 - pbox->y1;
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
*p &= ~(srcpix & startmask);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_WHITE:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
*p |= (srcpix & startmask);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_INVERT:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
*p ^= (srcpix & startmask);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ...) */
} else {
maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
for (d = 0; d < depthDst; d++) {
nlwExtra = nlwidth - nlwMiddle;
p = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
pbits += sizeDst; /* @@@ NEXT PLANE @@@ */
iy = saveIy;
h = pbox->y2 - pbox->y1;
if (startmask && endmask) {
nlwExtra -= 1;
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
*p &= ~(srcpix & startmask);
p++;
Duff (nlw, *p++ &= ~srcpix);
*p &= ~(srcpix & endmask);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_WHITE:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
*p |= (srcpix & startmask);
p++;
Duff (nlw, *p++ |= srcpix);
*p |= (srcpix & endmask);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_INVERT:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
*p ^= (srcpix & startmask);
p++;
Duff (nlw, *p++ ^= srcpix);
*p ^= (srcpix & endmask);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_NOP:
break;
} /* switch */
} else if (startmask && !endmask) {
nlwExtra -= 1;
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
*p &= ~(srcpix & startmask);
p++;
Duff(nlw, *p++ &= ~srcpix);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_WHITE:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
*p |= (srcpix & startmask);
p++;
Duff(nlw, *p++ |= srcpix);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_INVERT:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
*p ^= (srcpix & startmask);
p++;
Duff(nlw, *p++ ^= srcpix);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_NOP:
break;
} /* switch */
} else if (!startmask && endmask) {
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
Duff(nlw, *p++ &= ~srcpix);
*p &= ~(srcpix & endmask);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_WHITE:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
Duff(nlw, *p++ |= srcpix);
*p |= (srcpix & endmask);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_INVERT:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
Duff(nlw, *p++ ^= srcpix);
*p ^= (srcpix & endmask);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_NOP:
break;
} /* switch */
} else { /* no ragged bits at either end */
switch (rrops[d]) {
case RROP_BLACK:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
Duff(nlw, *p++ &= ~srcpix);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_WHITE:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
Duff(nlw, *p++ |= srcpix);
afbScanlineInc(p, nlwExtra);
}
break;
case RROP_INVERT:
while (h--) {
srcpix = psrc[iy];
iy = ++iy < tileHeight ? iy : 0;
nlw = nlwMiddle;
Duff(nlw, *p++ ^= srcpix);
afbScanlineInc(p, nlwExtra);
}
break;
} /* switch */
}
} /* for (d = ...) */
}
pbox++;
}
}
void
afbStippleArea (pDraw, nbox, pbox, pTile, xOff, yOff, rrops)
DrawablePtr pDraw;
int nbox;
BoxPtr pbox;
PixmapPtr pTile;
int xOff;
int yOff;
unsigned char *rrops;
{
register PixelType *psrc; /* pointer to bits in tile, if needed */
int nlwidth; /* width in longwords of the drawable */
register int h; /* height of current box */
register PixelType *pdst; /* pointer to bits we're writing */
int sizeDst;
int depthDst;
int tileLine;
int iline;
int w, width, x, xSrc, ySrc, srcStartOver, nend;
int tlwidth, rem, tileWidth, tileHeight, endinc;
int saveW;
register int rop;
PixelType *psrcT;
int d;
int nstart;
PixelType startmask;
PixelType endmask; /* masks for reggedy bits at either end of line */
int nlMiddle; /* number of longwords between sides of boxes */
int iy;
PixelType *pBase; /* pointer to start of drawable */
PixelType *saveP;
PixelType *pStartDst;
PixelType *pStartTile;
int saveH;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
pBase);
tileHeight = pTile->drawable.height;
tileWidth = pTile->drawable.width;
tlwidth = pTile->devKind / sizeof (PixelType);
xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth);
ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight);
while (nbox--) {
saveW = pbox->x2 - pbox->x1;
iline = (pbox->y1 - ySrc) % tileHeight;
psrcT = (PixelType *) pTile->devPrivate.ptr;
tileLine = iline * tlwidth;
saveH = pbox->y2 - pbox->y1;
saveP = afbScanline(pBase, pbox->x1, pbox->y1, nlwidth);
for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
h = saveH;
pStartDst = saveP;
pStartTile = psrcT + tileLine;
iy = iline;
while (h--) {
x = pbox->x1;
width = saveW;
pdst = pStartDst;
rop = rrops[d];
while(width > 0) {
psrc = pStartTile;
w = min(tileWidth, width);
if((rem = (x - xSrc) % tileWidth) != 0) {
/* if we're in the middle of the tile, get
as many bits as will finish the span, or
as many as will get to the left edge of the tile,
or a longword worth, starting at the appropriate
offset in the tile.
*/
w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
endinc = rem / BITMAP_SCANLINE_PAD;
getandputrrop((psrc + endinc), (rem & PIM), (x & PIM),
w, pdst, rop)
if((x & PIM) + w >= PPW)
pdst++;
} else if(((x & PIM) + w) < PPW) {
/* doing < PPW bits is easy, and worth special-casing */
putbitsrrop(*psrc, x & PIM, w, pdst, rop);
} else {
/* start at the left edge of the tile,
and put down as much as we can
*/
maskbits(x, w, startmask, endmask, nlMiddle);
if (startmask)
nstart = PPW - (x & PIM);
else
nstart = 0;
if (endmask)
nend = (x + w) & PIM;
else
nend = 0;
srcStartOver = nstart > PLST;
if(startmask) {
putbitsrrop(*psrc, (x & PIM), nstart, pdst, rop);
pdst++;
if(srcStartOver)
psrc++;
}
while(nlMiddle--) {
getandputrrop0(psrc, nstart, PPW, pdst, rop);
pdst++;
psrc++;
}
if(endmask) {
getandputrrop0(psrc, nstart, nend, pdst, rop);
}
}
x += w;
width -= w;
} /* while (width > 0) */
pStartDst += nlwidth;
if (++iy >= tileHeight) {
iy = 0;
pStartTile = psrcT;
} else
pStartTile += tlwidth;
} /* while (h) */
} /* for (d = ... ) */
pbox++;
} /* for each box */
}

View File

@ -1,146 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xprotostr.h>
#include "pixmapstr.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "regionstr.h"
#include "scrnintstr.h"
#include "afb.h"
#include "maskbits.h"
void
afbPolyPoint(pDrawable, pGC, mode, npt, pptInit)
register DrawablePtr pDrawable;
GCPtr pGC;
int mode; /* Origin or Previous */
int npt;
xPoint *pptInit;
{
register BoxPtr pbox;
register int nbox;
register int d;
register PixelType *addrl;
PixelType *pBase;
PixelType *pBaseSave;
int nlwidth;
int sizeDst;
int depthDst;
int nptTmp;
register xPoint *ppt;
register int x;
register int y;
register unsigned char *rrops;
afbPrivGC *pGCPriv;
pGCPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey);
afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
pBaseSave);
rrops = pGCPriv->rrops;
if ((mode == CoordModePrevious) && (npt > 1))
for (ppt = pptInit + 1, nptTmp = npt - 1; --nptTmp >= 0; ppt++) {
ppt->x += (ppt-1)->x;
ppt->y += (ppt-1)->y;
}
nbox = REGION_NUM_RECTS(pGC->pCompositeClip);
pbox = REGION_RECTS(pGC->pCompositeClip);
for (; --nbox >= 0; pbox++)
for (d = 0, pBase = pBaseSave; d < depthDst; d++, pBase += sizeDst) { /* @@@ NEXT PLANE @@@ */
addrl = pBase;
switch (rrops[d]) {
case RROP_BLACK:
for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
x = ppt->x + pDrawable->x;
y = ppt->y + pDrawable->y;
if ((x >= pbox->x1) && (x < pbox->x2) &&
(y >= pbox->y1) && (y < pbox->y2))
*afbScanline(addrl, x, y, nlwidth) &= mfbGetrmask(x & PIM);
}
break;
case RROP_WHITE:
for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
x = ppt->x + pDrawable->x;
y = ppt->y + pDrawable->y;
if ((x >= pbox->x1) && (x < pbox->x2) &&
(y >= pbox->y1) && (y < pbox->y2))
*afbScanline(addrl, x, y, nlwidth) |= mfbGetmask(x & PIM);
}
break;
case RROP_INVERT:
for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) {
x = ppt->x + pDrawable->x;
y = ppt->y + pDrawable->y;
if ((x >= pbox->x1) && (x < pbox->x2) &&
(y >= pbox->y1) && (y < pbox->y2))
*afbScanline(addrl, x, y, nlwidth) ^= mfbGetmask(x & PIM);
}
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ...) */
}

View File

@ -1,169 +0,0 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <string.h>
#include <X11/X.h>
#include "gcstruct.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "regionstr.h"
#include "maskbits.h"
#include "afb.h"
#define NPT 128
/* afbPushPixels -- squeegees the forground color of pGC through pBitMap
* into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
* be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
* is set in the bitmap, the fill style is put onto the drawable using
* the GC's logical function. The drawable is not changed where the bitmap
* has a zero bit or outside the area covered by the stencil.
*/
void
afbPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg)
{
int h, dxDivPPW, ibEnd;
PixelType *pwLineStart;
register PixelType *pw, *pwEnd;
register PixelType mask;
register int ib;
register PixelType w;
register int ipt; /* index into above arrays */
Bool fInBox;
DDXPointRec pt[NPT];
int width[NPT];
/* Now scan convert the pixmap and use the result to call fillspans in
* in the drawable with the original GC */
ipt = 0;
dxDivPPW = dx/PPW;
for (h = 0; h < dy; h++) {
pw = (PixelType *)
(((char *)(pBitMap->devPrivate.ptr))+(h * pBitMap->devKind));
pwLineStart = pw;
/* Process all words which are fully in the pixmap */
fInBox = FALSE;
pwEnd = pwLineStart + dxDivPPW;
while(pw < pwEnd) {
w = *pw;
mask = mfbGetendtab(1);
for(ib = 0; ib < PPW; ib++) {
if(w & mask) {
if(!fInBox) {
pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
pt[ipt].y = h + yOrg;
/* start new box */
fInBox = TRUE;
}
} else {
if(fInBox) {
width[ipt] = ((pw - pwLineStart) << PWSH) +
ib + xOrg - pt[ipt].x;
if (++ipt >= NPT) {
(*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt,
width, TRUE);
ipt = 0;
}
/* end box */
fInBox = FALSE;
}
}
mask = SCRRIGHT(mask, 1);
}
pw++;
}
ibEnd = dx & PIM;
if(ibEnd) {
/* Process final partial word on line */
w = *pw;
mask = mfbGetendtab(1);
for(ib = 0; ib < ibEnd; ib++) {
if(w & mask) {
if(!fInBox) {
/* start new box */
pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
pt[ipt].y = h + yOrg;
fInBox = TRUE;
}
} else {
if(fInBox) {
/* end box */
width[ipt] = ((pw - pwLineStart) << PWSH) +
ib + xOrg - pt[ipt].x;
if (++ipt >= NPT) {
(*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt,
width, TRUE);
ipt = 0;
}
fInBox = FALSE;
}
}
mask = SCRRIGHT(mask, 1);
}
}
/* If scanline ended with last bit set, end the box */
if(fInBox) {
width[ipt] = dx + xOrg - pt[ipt].x;
if (++ipt >= NPT) {
(*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE);
ipt = 0;
}
}
}
/* Flush any remaining spans */
if (ipt) {
(*pGC->ops->FillSpans)(pDrawable, pGC, ipt, pt, width, TRUE);
}
}

View File

@ -1,218 +0,0 @@
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include <X11/X.h>
#include <X11/Xproto.h> /* for xColorItem */
#include <X11/Xmd.h>
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "windowstr.h"
#include "resource.h"
#include "colormap.h"
#include "afb.h"
#include "mistruct.h"
#include "dix.h"
#include "mi.h"
#include "mibstore.h"
#include "migc.h"
#include "servermd.h"
#ifdef PIXMAP_PER_WINDOW
DevPrivateKey frameWindowPrivateKey = &frameWindowPrivateKey;
#endif
DevPrivateKey afbGCPrivateKey = &afbGCPrivateKey;
DevPrivateKey afbScreenPrivateKey = &afbScreenPrivateKey;
static Bool
afbCloseScreen(int index, ScreenPtr pScreen)
{
int d;
DepthPtr depths = pScreen->allowedDepths;
for (d = 0; d < pScreen->numDepths; d++)
xfree(depths[d].vids);
xfree(depths);
xfree(pScreen->visuals);
xfree(dixLookupPrivate(&pScreen->devPrivates, afbScreenPrivateKey));
return(TRUE);
}
static Bool
afbCreateScreenResources(ScreenPtr pScreen)
{
Bool retval;
pointer oldDevPrivate = pScreen->devPrivate;
pScreen->devPrivate = dixLookupPrivate(&pScreen->devPrivates,
afbScreenPrivateKey);
retval = miCreateScreenResources(pScreen);
/* Modify screen's pixmap devKind value stored off devPrivate to
* be the width of a single plane in longs rather than the width
* of a chunky screen in longs as incorrectly setup by the mi routine.
*/
((PixmapPtr)pScreen->devPrivate)->devKind = BitmapBytePad(pScreen->width);
dixSetPrivate(&pScreen->devPrivates, afbScreenPrivateKey,
pScreen->devPrivate);
pScreen->devPrivate = oldDevPrivate;
return(retval);
}
static PixmapPtr
afbGetWindowPixmap(WindowPtr pWin)
{
#ifdef PIXMAP_PER_WINDOW
return (PixmapPtr)dixLookupPrivate(&pWin->devPrivates,
frameWindowPrivateKey);
#else
ScreenPtr pScreen = pWin->drawable.pScreen;
return (* pScreen->GetScreenPixmap)(pScreen);
#endif
}
static void
afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
{
#ifdef PIXMAP_PER_WINDOW
dixSetPrivate(&pWin->devPrivates, frameWindowPrivateKey, pPix);
#else
(* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
#endif
}
static Bool
afbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey)
{
if (pGCKey)
*pGCKey = afbGCPrivateKey;
pScreen->GetWindowPixmap = afbGetWindowPixmap;
pScreen->SetWindowPixmap = afbSetWindowPixmap;
return dixRequestPrivate(afbGCPrivateKey, sizeof(afbPrivGC));
}
/* dts * (inch/dot) * (25.4 mm / inch) = mm */
Bool
afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, int dpix, int dpiy, int width)
/* pointer to screen bitmap */
/* in pixels */
/* dots per inch */
/* pixel width of frame buffer */
{
VisualPtr visuals;
DepthPtr depths;
int nvisuals;
int ndepths;
int rootdepth;
VisualID defaultVisual;
pointer oldDevPrivate;
rootdepth = 0;
if (!afbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
&defaultVisual, 256, 8)) {
ErrorF("afbInitVisuals: FALSE\n");
return FALSE;
}
if (!afbAllocatePrivates(pScreen, NULL)) {
ErrorF("afbAllocatePrivates: FALSE\n");
return FALSE;
}
pScreen->defColormap = (Colormap)FakeClientID(0);
/* whitePixel, blackPixel */
pScreen->blackPixel = 0;
pScreen->whitePixel = 0;
pScreen->QueryBestSize = afbQueryBestSize;
/* SaveScreen */
pScreen->GetImage = afbGetImage;
pScreen->GetSpans = afbGetSpans;
pScreen->CreateWindow = afbCreateWindow;
pScreen->DestroyWindow = afbDestroyWindow;
pScreen->PositionWindow = afbPositionWindow;
pScreen->ChangeWindowAttributes = afbChangeWindowAttributes;
pScreen->RealizeWindow = afbMapWindow;
pScreen->UnrealizeWindow = afbUnmapWindow;
pScreen->CopyWindow = afbCopyWindow;
pScreen->CreatePixmap = afbCreatePixmap;
pScreen->DestroyPixmap = afbDestroyPixmap;
pScreen->RealizeFont = afbRealizeFont;
pScreen->UnrealizeFont = afbUnrealizeFont;
pScreen->CreateGC = afbCreateGC;
pScreen->CreateColormap = afbInitializeColormap;
pScreen->DestroyColormap = (DestroyColormapProcPtr)NoopDDA;
pScreen->InstallColormap = afbInstallColormap;
pScreen->UninstallColormap = afbUninstallColormap;
pScreen->ListInstalledColormaps = afbListInstalledColormaps;
pScreen->StoreColors = (StoreColorsProcPtr)NoopDDA;
pScreen->ResolveColor = afbResolveColor;
pScreen->BitmapToRegion = afbPixmapToRegion;
oldDevPrivate = pScreen->devPrivate;
if (!miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, rootdepth,
ndepths, depths, defaultVisual, nvisuals, visuals)) {
ErrorF("miScreenInit: FALSE\n");
return FALSE;
}
pScreen->CloseScreen = afbCloseScreen;
pScreen->CreateScreenResources = afbCreateScreenResources;
dixSetPrivate(&pScreen->devPrivates, afbScreenPrivateKey,
pScreen->devPrivate);
pScreen->devPrivate = oldDevPrivate;
return TRUE;
}

View File

@ -1,257 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include "misc.h"
#include "regionstr.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "afb.h"
#include "maskbits.h"
#include "servermd.h"
/* afbSetScanline -- copies the bits from psrc to the drawable starting at
* (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc
* starts on the scanline. (I.e., if this scanline passes through multiple
* boxes, we may not want to start grabbing bits at psrc but at some offset
* further on.)
*/
static void
afbSetScanline(int y, int xOrigin, int xStart, int xEnd, PixelType *psrc,
int alu, PixelType *pdstBase, int widthDst, int sizeDst,
int depthDst, int sizeSrc)
{
int w; /* width of scanline in bits */
register PixelType *pdst; /* where to put the bits */
register PixelType tmpSrc; /* scratch buffer to collect bits in */
int dstBit; /* offset in bits from beginning of
* word */
register int nstart; /* number of bits from first partial */
register int nend; /* " " last partial word */
int offSrc;
PixelType startmask, endmask;
PixelType *savePsrc = psrc + ((xStart - xOrigin) >> PWSH);
int nlMiddle, nl;
int d;
for (d = 0; d < depthDst; d++) {
pdst = afbScanline(pdstBase, xStart, y, widthDst) + sizeDst * d; /* @@@ NEXT PLANE @@@ */
psrc = savePsrc + sizeSrc * d; /* @@@ NEXT PLANE @@@ */
offSrc = (xStart - xOrigin) & PIM;
w = xEnd - xStart;
dstBit = xStart & PIM;
if (dstBit + w <= PPW) {
getandputrop(psrc, offSrc, dstBit, w, pdst, alu)
} else {
maskbits(xStart, w, startmask, endmask, nlMiddle);
if (startmask)
nstart = PPW - dstBit;
else
nstart = 0;
if (endmask)
nend = xEnd & PIM;
else
nend = 0;
if (startmask) {
getandputrop(psrc, offSrc, dstBit, nstart, pdst, alu)
pdst++;
offSrc += nstart;
if (offSrc > PLST) {
psrc++;
offSrc -= PPW;
}
}
nl = nlMiddle;
while (nl--) {
getbits(psrc, offSrc, PPW, tmpSrc);
DoRop(*pdst, alu, tmpSrc, *pdst);
pdst++;
psrc++;
}
if (endmask) {
getandputrop0(psrc, offSrc, nend, pdst, alu);
}
}
}
}
/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at
* ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines
* are in increasing Y order.
* Source bit lines are server scanline padded so that they always begin
* on a word boundary.
*/
void
afbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted)
DrawablePtr pDrawable;
GCPtr pGC;
char *pcharsrc;
register DDXPointPtr ppt;
int *pwidth;
int nspans;
int fSorted;
{
PixelType *psrc = (PixelType *)pcharsrc;
PixelType *pdstBase; /* start of dst bitmap */
int widthDst; /* width of bitmap in words */
int sizeDst;
int depthDst;
int sizeSrc = 0;
register BoxPtr pbox, pboxLast, pboxTest;
register DDXPointPtr pptLast;
int alu;
RegionPtr prgnDst;
int xStart, xEnd;
int yMax;
alu = pGC->alu;
prgnDst = pGC->pCompositeClip;
pptLast = ppt + nspans;
yMax = pDrawable->y + (int) pDrawable->height;
afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
pdstBase);
pbox = REGION_RECTS(prgnDst);
pboxLast = pbox + REGION_NUM_RECTS(prgnDst);
if(fSorted) {
/* scan lines sorted in ascending order. Because they are sorted, we
* don't have to check each scanline against each clip box. We can be
* sure that this scanline only has to be clipped to boxes at or after the
* beginning of this y-band
*/
pboxTest = pbox;
while(ppt < pptLast) {
pbox = pboxTest;
if(ppt->y >= yMax)
break;
while(pbox < pboxLast) {
if(pbox->y1 > ppt->y) {
/* scanline is before clip box */
break;
} else if(pbox->y2 <= ppt->y) {
/* clip box is before scanline */
pboxTest = ++pbox;
continue;
} else if(pbox->x1 > ppt->x + *pwidth) {
/* clip box is to right of scanline */
break;
} else if(pbox->x2 <= ppt->x) {
/* scanline is to right of clip box */
pbox++;
continue;
}
/* at least some of the scanline is in the current clip box */
xStart = max(pbox->x1, ppt->x);
xEnd = min(ppt->x + *pwidth, pbox->x2);
sizeSrc = PixmapWidthInPadUnits(*pwidth, 1);
afbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, pdstBase,
widthDst, sizeDst, depthDst, sizeSrc);
if(ppt->x + *pwidth <= pbox->x2) {
/* End of the line, as it were */
break;
} else
pbox++;
}
/* We've tried this line against every box; it must be outside them
* all. move on to the next point */
ppt++;
psrc += sizeSrc * depthDst;
pwidth++;
}
} else {
/* scan lines not sorted. We must clip each line against all the boxes */
while(ppt < pptLast) {
if(ppt->y >= 0 && ppt->y < yMax) {
for(pbox = REGION_RECTS(prgnDst); pbox< pboxLast; pbox++) {
if(pbox->y1 > ppt->y) {
/* rest of clip region is above this scanline,
* skip it */
break;
}
if(pbox->y2 <= ppt->y) {
/* clip box is below scanline */
pbox++;
break;
}
if(pbox->x1 <= ppt->x + *pwidth &&
pbox->x2 > ppt->x) {
xStart = max(pbox->x1, ppt->x);
xEnd = min(pbox->x2, ppt->x + *pwidth);
sizeSrc = PixmapWidthInPadUnits(*pwidth, 1);
afbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu,
pdstBase, widthDst, sizeDst, depthDst,
sizeSrc);
}
}
}
psrc += sizeSrc * depthDst;
ppt++;
pwidth++;
}
}
}

View File

@ -1,586 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include <X11/Xproto.h>
#include "afb.h"
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "gcstruct.h"
#include "windowstr.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "regionstr.h"
#include "maskbits.h"
/*
this works for fonts with glyphs <= PPW bits wide.
This should be called only with a terminal-emulator font;
this means that the FIXED_METRICS flag is set, and that
glyphbounds == charbounds.
in theory, this goes faster; even if it doesn't, it reduces the
flicker caused by writing a string over itself with image text (since
the background gets repainted per character instead of per string.)
this seems to be important for some converted X10 applications.
Image text looks at the bits in the glyph and the fg and bg in the
GC. it paints a rectangle, as defined in the protocol dcoument,
and the paints the characters.
*/
#if defined(NO_3_60_CG4) && defined(FASTPUTBITS) && defined(FASTGETBITS)
#define FASTCHARS
#endif
/*
* this macro "knows" that only characters <= 8 bits wide will
* fit this case (which is why it is independent of GLYPHPADBYTES)
*/
#if (BITMAP_BIT_ORDER == MSBFirst) && (GLYPHPADBYTES != 4)
#if GLYPHPADBYTES == 1
#define ShiftAmnt 24
#else
#define ShiftAmnt 16
#endif
/*
* Note: for BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER, SCRRIGHT() evaluates its
* first argument more than once. Thus the imbedded char++ have to be moved.
* (DHD)
*/
#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
#if PPW == 32
#define GetBits4 c = (*char1++ << ShiftAmnt) | \
SCRRIGHT (*char2++ << ShiftAmnt, xoff2) | \
SCRRIGHT (*char3++ << ShiftAmnt, xoff3) | \
SCRRIGHT (*char4++ << ShiftAmnt, xoff4);
#else /* PPW */
#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \
(SCRRIGHT (*char2++ << ShiftAmnt, xoff2) << 32 ) | \
(SCRRIGHT (*char3++ << ShiftAmnt, xoff3) << 32 ) | \
(SCRRIGHT (*char4++ << ShiftAmnt, xoff4) << 32 ) | \
(*char5++ << ShiftAmnt) | \
SCRRIGHT (*char6++ << ShiftAmnt, xoff6) | \
SCRRIGHT (*char7++ << ShiftAmnt, xoff7) | \
SCRRIGHT (*char8++ << ShiftAmnt, xoff8);
#endif /* PPW */
#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
#if PPW == 32
#define GetBits4 c = (*char1++ << ShiftAmnt) | \
SCRRIGHT (*char2 << ShiftAmnt, xoff2) | \
SCRRIGHT (*char3 << ShiftAmnt, xoff3) | \
SCRRIGHT (*char4 << ShiftAmnt, xoff4); \
char2++; char3++; char4++;
#else /* PPW == 64 */
#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \
(SCRRIGHT (*char2 << ShiftAmnt, xoff2) << 32 ) | \
(SCRRIGHT (*char3 << ShiftAmnt, xoff3) << 32 ) | \
(SCRRIGHT (*char4 << ShiftAmnt, xoff4) << 32 ) | \
(*char5++ << ShiftAmnt) | \
SCRRIGHT (*char6 << ShiftAmnt, xoff6) | \
SCRRIGHT (*char7 << ShiftAmnt, xoff7) | \
SCRRIGHT (*char8 << ShiftAmnt, xoff8); \
char2++; char3++; char4++; char6++; char7++; char8++;
#endif /* PPW */
#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
#else /* (BITMAP_BIT_ORDER != MSBFirst) || (GLYPHPADBYTES == 4) */
#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
#if PPW == 32
#define GetBits4 c = *char1++ | \
SCRRIGHT (*char2++, xoff2) | \
SCRRIGHT (*char3++, xoff3) | \
SCRRIGHT (*char4++, xoff4);
#else /* PPW == 64 */
#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \
(SCRRIGHT (*char2++, xoff2) << 64 ) | \
(SCRRIGHT (*char3++, xoff3) << 64 ) | \
(SCRRIGHT (*char4++, xoff4) << 64 ) | \
SCRRIGHT (*char5++, xoff5) | \
SCRRIGHT (*char6++, xoff6) | \
SCRRIGHT (*char7++, xoff7) | \
SCRRIGHT (*char8++, xoff8));
#endif /* PPW */
#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
#if PPW == 32
#define GetBits4 c = *char1++ | \
SCRRIGHT (*char2, xoff2) | \
SCRRIGHT (*char3, xoff3) | \
SCRRIGHT (*char4, xoff4); \
char2++; char3++; char4++;
#else /* PPW == 64 */
#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \
(SCRRIGHT (*char2, xoff2) << 64 ) | \
(SCRRIGHT (*char3, xoff3) << 64 ) | \
(SCRRIGHT (*char4, xoff4) << 64 ) | \
SCRRIGHT (*char5, xoff5) | \
SCRRIGHT (*char6, xoff6) | \
SCRRIGHT (*char7, xoff7) | \
SCRRIGHT (*char8, xoff8)); \
char2++; char3++; char4++; \
char5++; char6++; char7++; char8++;
#endif /* PPW */
#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
#endif /* BITMAP_BIT_ORDER && GLYPHPADBYTES */
#if GLYPHPADBYTES == 1
typedef unsigned char *glyphPointer;
#define USE_LEFTBITS
#endif
#if GLYPHPADBYTES == 2
typedef unsigned short *glyphPointer;
#define USE_LEFTBITS
#endif
#if GLYPHPADBYTES == 4
typedef unsigned int *glyphPointer;
#endif
#ifdef USE_LEFTBITS
#define GetBits1 getleftbits (char1, widthGlyph, c); \
c &= glyphMask; \
char1 = (glyphPointer) (((char *) char1) + glyphBytes);
#else
#define GetBits1 c = *char1++;
#endif
void
afbTEGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
DrawablePtr pDrawable;
GC *pGC;
int x, y;
unsigned int nglyph;
CharInfoPtr *ppci; /* array of character info */
pointer pglyphBase; /* start of array of glyphs */
{
FontPtr pfont = pGC->font;
int widthDst;
PixelType *pdstBase; /* pointer to longword with top row
of current glyph */
int h; /* height of glyph and char */
register int xpos; /* current x */
int ypos; /* current y */
int widthGlyph;
int hTmp; /* counter for height */
register PixelType startmask, endmask;
int nfirst; /* used if glyphs spans a longword boundary */
BoxRec bbox; /* for clipping */
int widthGlyphs;
int sizeDst;
int depthDst;
PixelType *saveDst;
register PixelType *dst;
register PixelType c;
register int d;
register int xoff1, xoff2, xoff3, xoff4;
register glyphPointer char1, char2, char3, char4;
glyphPointer schar1, schar2, schar3, schar4;
#if PPW == 64
register int xoff5, xoff6, xoff7, xoff8;
register glyphPointer char5, char6, char7, char8;
glyphPointer schar5, schar6, schar7, schar8;
#endif /* PPW */
unsigned char *rrops;
#ifdef USE_LEFTBITS
register PixelType glyphMask;
register PixelType tmpSrc;
register int glyphBytes;
#endif
afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
pdstBase);
xpos = x + pDrawable->x;
ypos = y + pDrawable->y;
widthGlyph = FONTMAXBOUNDS(pfont,characterWidth);
h = FONTASCENT(pfont) + FONTDESCENT(pfont);
xpos += FONTMAXBOUNDS(pfont,leftSideBearing);
ypos -= FONTASCENT(pfont);
rrops = ((afbPrivGCPtr)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey))->rropOS;
bbox.x1 = xpos;
bbox.x2 = xpos + (widthGlyph * nglyph);
bbox.y1 = ypos;
bbox.y2 = ypos + h;
switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
case rgnPART:
/* this is the WRONG thing to do, but it works.
calling the non-terminal text is easy, but slow, given
what we know about the font.
the right thing to do is something like:
for each clip rectangle
compute at which row the glyph starts to be in it,
and at which row the glyph ceases to be in it
compute which is the first glyph inside the left
edge, and the last one inside the right edge
draw a fractional first glyph, using only
the rows we know are in
draw all the whole glyphs, using the appropriate rows
draw any pieces of the last glyph, using the right rows
this way, the code would take advantage of knowing that
all glyphs are the same height and don't overlap.
one day...
*/
afbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
case rgnOUT:
return;
}
pdstBase = afbScanlineDeltaNoBankSwitch(pdstBase, ypos, widthDst);
widthGlyphs = widthGlyph * PGSZB;
#ifdef USE_LEFTBITS
glyphMask = mfbGetendtab(widthGlyph);
glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci);
#endif
if (nglyph >= PGSZB && widthGlyphs <= PPW) {
while (nglyph >= PGSZB) {
nglyph -= PGSZB;
xoff1 = xpos & PIM;
xoff2 = widthGlyph;
xoff3 = xoff2 + widthGlyph;
xoff4 = xoff3 + widthGlyph;
#if PPW == 64
xoff5 = xoff4 + widthGlyph;
xoff6 = xoff5 + widthGlyph;
xoff7 = xoff6 + widthGlyph;
xoff8 = xoff7 + widthGlyph;
#endif /* PPW */
schar1 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
schar2 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
schar3 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
schar4 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
#if PPW == 64
schar5 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
schar6 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
schar7 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
schar8 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++));
#endif /* PPW */
hTmp = h;
saveDst = afbScanlineOffset(pdstBase, (xpos >> PWSH)); /* switch now */
#ifndef FASTCHARS
if (xoff1 + widthGlyphs <= PPW) {
maskpartialbits (xoff1, widthGlyphs, startmask);
#endif
for (d = 0; d < depthDst; d++) {
hTmp = h;
dst = saveDst;
saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */
switch (rrops[d]) {
case RROP_BLACK:
while (hTmp--) {
#ifdef FASTCHARS
FASTPUTBITS(0, xoff1, widthGlyphs, dst);
#else
*(dst) &= ~startmask;
#endif
afbScanlineInc(dst, widthDst);
}
break;
case RROP_WHITE:
while (hTmp--) {
#ifdef FASTCHARS
FASTPUTBITS(~0, xoff1, widthGlyphs, dst);
#else
*(dst) |= startmask;
#endif
afbScanlineInc(dst, widthDst);
}
break;
case RROP_INVERT:
char1 = schar1;
char2 = schar2;
char3 = schar3;
char4 = schar4;
/* XXX */
while (hTmp--) {
GetBits4
#ifdef FASTCHARS
# if BITMAP_BIT_ORDER == MSBFirst
c >>= PPW - widthGlyphs;
# endif
FASTPUTBITS(~c, xoff1, widthGlyphs, dst);
#else
*(dst) = ((*dst) & ~startmask) | (~SCRRIGHT(c, xoff1) & startmask);
#endif
afbScanlineInc(dst, widthDst);
}
break;
case RROP_COPY:
char1 = schar1;
char2 = schar2;
char3 = schar3;
char4 = schar4;
while (hTmp--) {
GetBits4
#ifdef FASTCHARS
# if BITMAP_BIT_ORDER == MSBFirst
c >>= PPW - widthGlyphs;
#endif
FASTPUTBITS(c, xoff1, widthGlyphs, dst);
#else
*(dst) = ((*dst) & ~startmask) | (SCRRIGHT(c, xoff1) & startmask);
#endif
afbScanlineInc(dst, widthDst);
}
break;
case RROP_NOP:
break;
} /* switch (rrops[d]) */
} /* for (d = ... ) */
#ifndef FASTCHARS
} else {
maskPPWbits (xoff1, widthGlyphs, startmask, endmask);
nfirst = PPW - xoff1;
for (d = 0; d < depthDst; d++) {
hTmp = h;
dst = saveDst;
saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */
switch (rrops[d]) {
case RROP_BLACK:
while (hTmp--) {
dst[0] &= ~startmask;
dst[1] &= ~endmask;
afbScanlineInc(dst, widthDst);
}
break;
case RROP_WHITE:
while (hTmp--) {
dst[0] |= startmask;
dst[1] |= endmask;
afbScanlineInc(dst, widthDst);
}
break;
case RROP_INVERT:
char1 = schar1;
char2 = schar2;
char3 = schar3;
char4 = schar4;
while (hTmp--) {
GetBits4
dst[0] = (dst[0] & ~startmask) | (~SCRRIGHT(c,xoff1) & startmask);
dst[1] = (dst[1] & ~endmask) | (~SCRLEFT(c,nfirst) & endmask);
afbScanlineInc(dst, widthDst);
}
break;
case RROP_COPY:
char1 = schar1;
char2 = schar2;
char3 = schar3;
char4 = schar4;
while (hTmp--) {
GetBits4
dst[0] = (dst[0] & ~startmask) | (SCRRIGHT(c,xoff1) & startmask);
dst[1] = (dst[1] & ~endmask) | (SCRLEFT(c,nfirst) & endmask);
afbScanlineInc(dst, widthDst);
}
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ... ) */
}
#endif
xpos += widthGlyphs;
}
}
while(nglyph--) {
xoff1 = xpos & PIM;
schar1 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
hTmp = h;
saveDst = afbScanlineOffset(pdstBase, (xpos >> PWSH));
if (xoff1 + widthGlyph <= PPW) {
maskpartialbits (xoff1, widthGlyph, startmask);
for (d = 0; d < depthDst; d++) {
hTmp = h;
dst = saveDst;
saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */
char1 = schar1;
switch (rrops[d]) {
case RROP_BLACK:
while (hTmp--) {
(*dst) &= ~startmask;
afbScanlineInc(dst, widthDst);
}
break;
case RROP_WHITE:
while (hTmp--) {
(*dst) |= startmask;
afbScanlineInc(dst, widthDst);
}
break;
case RROP_INVERT:
while (hTmp--) {
#ifdef FASTCHARS
#ifdef USE_LEFTBITS
FASTGETBITS (char1,0,widthGlyph,c);
char1 = (glyphPointer) (((char *) char1) + glyphBytes);
#else
c = *char1++;
#if BITMAP_BIT_ORDER == MSBFirst
c >>= PPW - widthGlyph;
#endif
#endif
FASTPUTBITS (~c,xoff1,widthGlyph,dst);
#else
GetBits1
(*dst) = ((*dst) & ~startmask) | (~SCRRIGHT(c, xoff1) & startmask);
#endif
afbScanlineInc(dst, widthDst);
}
break;
case RROP_COPY:
while (hTmp--) {
#ifdef FASTCHARS
#ifdef USE_LEFTBITS
FASTGETBITS (char1,0,widthGlyph,c);
char1 = (glyphPointer) (((char *) char1) + glyphBytes);
#else
c = *char1++;
#if BITMAP_BIT_ORDER == MSBFirst
c >>= PPW - widthGlyph;
#endif
#endif
FASTPUTBITS (c,xoff1,widthGlyph,dst);
#else
GetBits1
(*dst) = ((*dst) & ~startmask) | (SCRRIGHT(c, xoff1) & startmask);
#endif
afbScanlineInc(dst, widthDst);
}
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ...) */
} else {
maskPPWbits (xoff1, widthGlyph, startmask, endmask);
nfirst = PPW - xoff1;
for (d = 0; d < depthDst; d++) {
hTmp = h;
dst = saveDst;
saveDst += sizeDst; /* @@@ NEXT PLANE @@@ */
char1 = schar1;
switch (rrops[d]) {
case RROP_BLACK:
while (hTmp--) {
dst[0] &= ~startmask;
dst[1] &= ~endmask;
afbScanlineInc(dst, widthDst);
}
break;
case RROP_WHITE:
while (hTmp--) {
dst[0] |= startmask;
dst[1] |= endmask;
afbScanlineInc(dst, widthDst);
}
break;
case RROP_INVERT:
while (hTmp--) {
GetBits1
dst[0] = (dst[0] & ~startmask) | (~SCRRIGHT(c,xoff1) & startmask);
dst[1] = (dst[1] & ~endmask) | (~SCRLEFT(c,nfirst) & endmask);
afbScanlineInc(dst, widthDst);
}
break;
case RROP_COPY:
while (hTmp--) {
GetBits1
dst[0] = (dst[0] & ~startmask) | (SCRRIGHT(c,xoff1) & startmask);
dst[1] = (dst[1] & ~endmask) | (SCRLEFT(c,nfirst) & endmask);
afbScanlineInc(dst, widthDst);
}
break;
case RROP_NOP:
break;
} /* switch */
} /* for (d = ...) */
}
xpos += widthGlyph;
}
}

View File

@ -1,857 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "windowstr.h"
#include "regionstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "afb.h"
#include "maskbits.h"
#include "mergerop.h"
/*
the boxes are already translated.
NOTE:
iy = ++iy < tileHeight ? iy : 0
is equivalent to iy%= tileheight, and saves a division.
*/
/*
tile area with a PPW bit wide pixmap
*/
void
MROP_NAME(afbTileAreaPPW)(pDraw, nbox, pbox, alu, ptile, planemask)
DrawablePtr pDraw;
int nbox;
BoxPtr pbox;
int alu;
PixmapPtr ptile;
unsigned long planemask;
{
register PixelType *psrc;
/* pointer to bits in tile, if needed */
int tileHeight; /* height of the tile */
register PixelType srcpix;
int nlwidth; /* width in longwords of the drawable */
int w; /* width of current box */
MROP_DECLARE_REG ()
register int h; /* height of current box */
register int nlw; /* loop version of nlwMiddle */
register PixelType *p; /* pointer to bits we're writing */
int sizeDst;
int depthDst;
register int d;
PixelType startmask;
PixelType endmask; /* masks for reggedy bits at either end of line */
int nlwMiddle; /* number of longwords between sides of boxes */
int nlwExtra; /* to get from right of box to left of next span */
register int iy; /* index of current scanline in tile */
PixelType *pbits; /* pointer to start of drawable */
PixelType *saveP;
PixelType *pSaveSrc;
int saveH;
int saveIY;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
pbits);
MROP_INITIALIZE(alu,~0)
tileHeight = ptile->drawable.height;
pSaveSrc = (PixelType *)(ptile->devPrivate.ptr);
while (nbox--) {
w = pbox->x2 - pbox->x1;
saveH = pbox->y2 - pbox->y1;
saveIY = pbox->y1 % tileHeight;
saveP = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
psrc = pSaveSrc;
if (((pbox->x1 & PIM) + w) < PPW) {
maskpartialbits(pbox->x1, w, startmask);
nlwExtra = nlwidth;
for (d = 0; d < depthDst; d++, saveP += sizeDst, psrc += tileHeight) { /* @@@ NEXT PLANE @@@ */
if (!(planemask & (1 << d)))
continue;
p = saveP;
h = saveH;
iy = saveIY;
while (h--) {
srcpix = psrc[iy];
iy++;
if (iy == tileHeight)
iy = 0;
*p = MROP_MASK(srcpix,*p,startmask);
afbScanlineInc(p, nlwExtra);
}
}
} else {
maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
for (d = 0; d < depthDst; d++, saveP += sizeDst, psrc += tileHeight) { /* @@@ NEXT PLANE @@@ */
if (!(planemask & (1 << d)))
continue;
p = saveP;
h = saveH;
iy = saveIY;
nlwExtra = nlwidth - nlwMiddle;
if (startmask && endmask) {
nlwExtra -= 1;
while (h--) {
srcpix = psrc[iy];
iy++;
if (iy == tileHeight)
iy = 0;
nlw = nlwMiddle;
*p = MROP_MASK (srcpix,*p,startmask);
p++;
while (nlw--) {
*p = MROP_SOLID(srcpix,*p);
p++;
}
*p = MROP_MASK(srcpix,*p,endmask);
afbScanlineInc(p, nlwExtra);
}
} else if (startmask && !endmask) {
nlwExtra -= 1;
while (h--) {
srcpix = psrc[iy];
iy++;
if (iy == tileHeight)
iy = 0;
nlw = nlwMiddle;
*p = MROP_MASK(srcpix,*p,startmask);
p++;
while (nlw--) {
*p = MROP_SOLID(srcpix,*p);
p++;
}
afbScanlineInc(p, nlwExtra);
}
} else if (!startmask && endmask) {
while (h--) {
srcpix = psrc[iy];
iy++;
if (iy == tileHeight)
iy = 0;
nlw = nlwMiddle;
while (nlw--) {
*p = MROP_SOLID(srcpix,*p);
p++;
}
*p = MROP_MASK(srcpix,*p,endmask);
afbScanlineInc(p, nlwExtra);
}
} else { /* no ragged bits at either end */
while (h--) {
srcpix = psrc[iy];
iy++;
if (iy == tileHeight)
iy = 0;
nlw = nlwMiddle;
while (nlw--) {
*p = MROP_SOLID (srcpix,*p);
p++;
}
afbScanlineInc(p, nlwExtra);
}
}
} /* for (d = ...) */
}
pbox++;
}
}
void
MROP_NAME(afbTileArea)(pDraw, nbox, pbox, alu, pTile, xOff, yOff, planemask)
DrawablePtr pDraw;
int nbox;
BoxPtr pbox;
int alu;
PixmapPtr pTile;
int xOff;
int yOff;
unsigned long planemask;
{
register PixelType *psrc;
/* pointer to bits in tile, if needed */
int nlwidth; /* width in longwords of the drawable */
MROP_DECLARE_REG ()
register int h; /* height of current box */
register PixelType *pdst; /* pointer to bits we're writing */
register PixelType tmpsrc;
#if (MROP) != Mcopy
register PixelType tmpdst;
#endif
int sizeDst;
int depthDst;
int sizeTile;
int tileLine;
int iline;
int w, width, x, xSrc, ySrc, srcStartOver, nend;
int tlwidth, rem, tileWidth, tileHeight, endinc;
int saveW;
PixelType *psrcT;
int d;
int nstart;
PixelType startmask;
PixelType endmask; /* masks for reggedy bits at either end of line */
int nlMiddle; /* number of longwords between sides of boxes */
int iy;
PixelType *pBase; /* pointer to start of drawable */
PixelType *saveP;
PixelType *pStartDst;
PixelType *pStartTile;
int saveH;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
pBase);
MROP_INITIALIZE(alu,~0)
tileHeight = pTile->drawable.height;
tileWidth = pTile->drawable.width;
tlwidth = pTile->devKind / sizeof (PixelType);
sizeTile = tlwidth * tileHeight;
xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth);
ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight);
while (nbox--) {
saveW = pbox->x2 - pbox->x1;
iline = (pbox->y1 - ySrc) % tileHeight;
psrcT = (PixelType *) pTile->devPrivate.ptr;
tileLine = iline * tlwidth;
saveH = pbox->y2 - pbox->y1;
saveP = afbScanline(pBase, pbox->x1, pbox->y1, nlwidth);
for (d = 0; d < depthDst; d++, psrcT += sizeTile, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
if (!(planemask & (1 << d)))
continue;
h = saveH;
pStartDst = saveP;
pStartTile = psrcT + tileLine;
iy = iline;
while (h--) {
x = pbox->x1;
width = saveW;
pdst = pStartDst;
while(width > 0) {
psrc = pStartTile;
w = min(tileWidth, width);
if((rem = (x - xSrc) % tileWidth) != 0) {
/* if we're in the middle of the tile, get
as many bits as will finish the span, or
as many as will get to the left edge of the tile,
or a longword worth, starting at the appropriate
offset in the tile.
*/
w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
endinc = rem / BITMAP_SCANLINE_PAD;
getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
#if (MROP) != Mcopy
getbits (pdst, (x & PIM), w, tmpdst);
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
putbits (tmpsrc, (x & PIM), w, pdst);
if((x & PIM) + w >= PPW)
pdst++;
} else if(((x & PIM) + w) < PPW) {
/* doing < PPW bits is easy, and worth special-casing */
tmpsrc = *psrc;
#if (MROP) != Mcopy
getbits (pdst, (x & PIM), w, tmpdst);
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
putbits (tmpsrc, (x & PIM), w, pdst);
} else {
/* start at the left edge of the tile,
and put down as much as we can
*/
maskbits(x, w, startmask, endmask, nlMiddle);
if (startmask)
nstart = PPW - (x & PIM);
else
nstart = 0;
if (endmask)
nend = (x + w) & PIM;
else
nend = 0;
srcStartOver = nstart > PLST;
if(startmask) {
tmpsrc = *psrc;
#if (MROP) != Mcopy
getbits (pdst, (x & PIM), nstart, tmpdst);
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
putbits (tmpsrc, (x & PIM), nstart, pdst);
pdst++;
if(srcStartOver)
psrc++;
}
while(nlMiddle--) {
getbits (psrc, nstart, PPW, tmpsrc);
#if (MROP) != Mcopy
tmpdst = *pdst;
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
*pdst++ = tmpsrc;
/*putbits (tmpsrc, 0, PPW, pdst);
pdst++;*/
psrc++;
}
if(endmask) {
getbits (psrc, nstart, nend, tmpsrc);
#if (MROP) != Mcopy
tmpdst = *pdst;
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
putbits (tmpsrc, 0, nend, pdst);
}
}
x += w;
width -= w;
} /* while (width > 0) */
pStartDst += nlwidth;
if (++iy >= tileHeight) {
iy = 0;
pStartTile = psrcT;
} else
pStartTile += tlwidth;
} /* while (h) */
} /* for (d = ... ) */
pbox++;
} /* for each box */
}
void
MROP_NAME(afbOpaqueStippleAreaPPW)(pDraw, nbox, pbox, alu, ptile,
rropsOS, planemask)
DrawablePtr pDraw;
int nbox;
BoxPtr pbox;
int alu;
PixmapPtr ptile;
register unsigned char *rropsOS;
unsigned long planemask;
{
register PixelType *psrc;
/* pointer to bits in tile, if needed */
int tileHeight; /* height of the tile */
register PixelType srcpix = 0;
int nlwidth; /* width in longwords of the drawable */
int w; /* width of current box */
MROP_DECLARE_REG ()
register int h; /* height of current box */
register int nlw; /* loop version of nlwMiddle */
register PixelType *p; /* pointer to bits we're writing */
int sizeDst;
int depthDst;
register int d;
PixelType startmask;
PixelType endmask; /* masks for reggedy bits at either end of line */
int nlwMiddle; /* number of longwords between sides of boxes */
int nlwExtra; /* to get from right of box to left of next span */
register int iy; /* index of current scanline in tile */
PixelType *pbits; /* pointer to start of drawable */
PixelType *saveP;
int saveH;
int saveIY;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
pbits);
MROP_INITIALIZE(alu,~0)
tileHeight = ptile->drawable.height;
psrc = (PixelType *)(ptile->devPrivate.ptr);
while (nbox--) {
w = pbox->x2 - pbox->x1;
saveH = pbox->y2 - pbox->y1;
saveIY = pbox->y1 % tileHeight;
saveP = afbScanline(pbits, pbox->x1, pbox->y1, nlwidth);
if ( ((pbox->x1 & PIM) + w) < PPW) {
maskpartialbits(pbox->x1, w, startmask);
nlwExtra = nlwidth;
for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
if (!(planemask & (1 << d)))
continue;
p = saveP;
h = saveH;
iy = saveIY;
while (h--) {
switch (rropsOS[d]) {
case RROP_BLACK:
srcpix = 0;
break;
case RROP_WHITE:
srcpix = ~0;
break;
case RROP_COPY:
srcpix = psrc[iy];
break;
case RROP_INVERT:
srcpix = ~psrc[iy];
break;
}
iy++;
if (iy == tileHeight)
iy = 0;
*p = MROP_MASK(srcpix,*p,startmask);
afbScanlineInc(p, nlwExtra);
}
}
} else {
maskbits(pbox->x1, w, startmask, endmask, nlwMiddle);
for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
if (!(planemask & (1 << d)))
continue;
p = saveP;
h = saveH;
iy = saveIY;
nlwExtra = nlwidth - nlwMiddle;
if (startmask && endmask) {
nlwExtra -= 1;
while (h--) {
switch (rropsOS[d]) {
case RROP_BLACK:
srcpix = 0;
break;
case RROP_WHITE:
srcpix = ~0;
break;
case RROP_COPY:
srcpix = psrc[iy];
break;
case RROP_INVERT:
srcpix = ~psrc[iy];
break;
}
iy++;
if (iy == tileHeight)
iy = 0;
nlw = nlwMiddle;
*p = MROP_MASK (srcpix,*p,startmask);
p++;
while (nlw--) {
*p = MROP_SOLID(srcpix,*p);
p++;
}
*p = MROP_MASK(srcpix,*p,endmask);
afbScanlineInc(p, nlwExtra);
}
} else if (startmask && !endmask) {
nlwExtra -= 1;
while (h--) {
switch (rropsOS[d]) {
case RROP_BLACK:
srcpix = 0;
break;
case RROP_WHITE:
srcpix = ~0;
break;
case RROP_COPY:
srcpix = psrc[iy];
break;
case RROP_INVERT:
srcpix = ~psrc[iy];
break;
}
iy++;
if (iy == tileHeight)
iy = 0;
nlw = nlwMiddle;
*p = MROP_MASK(srcpix,*p,startmask);
p++;
while (nlw--) {
*p = MROP_SOLID(srcpix,*p);
p++;
}
afbScanlineInc(p, nlwExtra);
}
} else if (!startmask && endmask) {
while (h--) {
switch (rropsOS[d]) {
case RROP_BLACK:
srcpix = 0;
break;
case RROP_WHITE:
srcpix = ~0;
break;
case RROP_COPY:
srcpix = psrc[iy];
break;
case RROP_INVERT:
srcpix = ~psrc[iy];
break;
}
iy++;
if (iy == tileHeight)
iy = 0;
nlw = nlwMiddle;
while (nlw--) {
*p = MROP_SOLID(srcpix,*p);
p++;
}
*p = MROP_MASK(srcpix,*p,endmask);
afbScanlineInc(p, nlwExtra);
}
} else { /* no ragged bits at either end */
while (h--) {
switch (rropsOS[d]) {
case RROP_BLACK:
srcpix = 0;
break;
case RROP_WHITE:
srcpix = ~0;
break;
case RROP_COPY:
srcpix = psrc[iy];
break;
case RROP_INVERT:
srcpix = ~psrc[iy];
break;
}
iy++;
if (iy == tileHeight)
iy = 0;
nlw = nlwMiddle;
while (nlw--) {
*p = MROP_SOLID (srcpix,*p);
p++;
}
afbScanlineInc(p, nlwExtra);
}
}
} /* for (d = ...) */
}
pbox++;
}
}
void
MROP_NAME(afbOpaqueStippleArea)(pDraw, nbox, pbox, alu, pTile, xOff, yOff,
rropsOS, planemask)
DrawablePtr pDraw;
int nbox;
BoxPtr pbox;
int alu;
PixmapPtr pTile;
int xOff;
int yOff;
register unsigned char *rropsOS;
unsigned long planemask;
{
register PixelType *psrc;
/* pointer to bits in tile, if needed */
int nlwidth; /* width in longwords of the drawable */
MROP_DECLARE_REG ()
register int h; /* height of current box */
register PixelType *pdst; /* pointer to bits we're writing */
register PixelType tmpsrc = 0;
#if (MROP) != Mcopy
register PixelType tmpdst;
#endif
int sizeDst;
int depthDst;
int tileLine;
int iline;
int w, width, x, xSrc, ySrc, srcStartOver, nend;
int tlwidth, rem, tileWidth, tileHeight, endinc;
int saveW;
PixelType *psrcT;
int d;
int nstart;
PixelType startmask;
PixelType endmask; /* masks for reggedy bits at either end of line */
int nlMiddle; /* number of longwords between sides of boxes */
int iy;
PixelType *pBase; /* pointer to start of drawable */
PixelType *saveP;
PixelType *pStartDst;
PixelType *pStartTile;
int saveH;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
pBase);
MROP_INITIALIZE(alu,~0)
tileHeight = pTile->drawable.height;
tileWidth = pTile->drawable.width;
tlwidth = pTile->devKind / sizeof (PixelType);
xSrc = pDraw->x + ((xOff % tileWidth) - tileWidth);
ySrc = pDraw->y + ((yOff % tileHeight) - tileHeight);
while (nbox--) {
saveW = pbox->x2 - pbox->x1;
iline = (pbox->y1 - ySrc) % tileHeight;
psrcT = (PixelType *) pTile->devPrivate.ptr;
tileLine = iline * tlwidth;
saveH = pbox->y2 - pbox->y1;
saveP = afbScanline(pBase, pbox->x1, pbox->y1, nlwidth);
for (d = 0; d < depthDst; d++, saveP += sizeDst) { /* @@@ NEXT PLANE @@@ */
if (!(planemask & (1 << d)))
continue;
h = saveH;
pStartDst = saveP;
pStartTile = psrcT + tileLine;
iy = iline;
while (h--) {
x = pbox->x1;
width = saveW;
pdst = pStartDst;
while(width > 0) {
psrc = pStartTile;
w = min(tileWidth, width);
if((rem = (x - xSrc) % tileWidth) != 0) {
/* if we're in the middle of the tile, get
as many bits as will finish the span, or
as many as will get to the left edge of the tile,
or a longword worth, starting at the appropriate
offset in the tile.
*/
w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_PAD);
endinc = rem / BITMAP_SCANLINE_PAD;
switch (rropsOS[d]) {
case RROP_BLACK:
tmpsrc = 0;
break;
case RROP_WHITE:
tmpsrc = ~0;
break;
case RROP_COPY:
getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
break;
case RROP_INVERT:
getbits ((psrc+endinc), (rem&PIM), w, tmpsrc);
tmpsrc = ~tmpsrc;
break;
}
#if (MROP) != Mcopy
getbits (pdst, (x & PIM), w, tmpdst);
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
putbits (tmpsrc, (x & PIM), w, pdst);
if((x & PIM) + w >= PPW)
pdst++;
} else if(((x & PIM) + w) < PPW) {
/* doing < PPW bits is easy, and worth special-casing */
switch (rropsOS[d]) {
case RROP_BLACK:
tmpsrc = 0;
break;
case RROP_WHITE:
tmpsrc = ~0;
break;
case RROP_COPY:
tmpsrc = *psrc;
break;
case RROP_INVERT:
tmpsrc = ~*psrc;
break;
}
#if (MROP) != Mcopy
getbits (pdst, (x & PIM), w, tmpdst);
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
putbits (tmpsrc, (x & PIM), w, pdst);
} else {
/* start at the left edge of the tile,
and put down as much as we can
*/
maskbits(x, w, startmask, endmask, nlMiddle);
if (startmask)
nstart = PPW - (x & PIM);
else
nstart = 0;
if (endmask)
nend = (x + w) & PIM;
else
nend = 0;
srcStartOver = nstart > PLST;
if(startmask) {
switch (rropsOS[d]) {
case RROP_BLACK:
tmpsrc = 0;
break;
case RROP_WHITE:
tmpsrc = ~0;
break;
case RROP_COPY:
tmpsrc = *psrc;
break;
case RROP_INVERT:
tmpsrc = ~*psrc;
break;
}
#if (MROP) != Mcopy
getbits (pdst, (x & PIM), nstart, tmpdst);
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
putbits (tmpsrc, (x & PIM), nstart, pdst);
pdst++;
if(srcStartOver)
psrc++;
}
while(nlMiddle--) {
switch (rropsOS[d]) {
case RROP_BLACK:
tmpsrc = 0;
break;
case RROP_WHITE:
tmpsrc = ~0;
break;
case RROP_COPY:
getbits (psrc, nstart, PPW, tmpsrc);
break;
case RROP_INVERT:
getbits (psrc, nstart, PPW, tmpsrc);
tmpsrc = ~tmpsrc;
break;
}
#if (MROP) != Mcopy
tmpdst = *pdst;
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
*pdst++ = tmpsrc;
/*putbits (tmpsrc, 0, PPW, pdst);
pdst++; */
psrc++;
}
if(endmask) {
switch (rropsOS[d]) {
case RROP_BLACK:
tmpsrc = 0;
break;
case RROP_WHITE:
tmpsrc = ~0;
break;
case RROP_COPY:
getbits (psrc, nstart, nend, tmpsrc);
break;
case RROP_INVERT:
getbits (psrc, nstart, nend, tmpsrc);
tmpsrc = ~tmpsrc;
break;
}
#if (MROP) != Mcopy
tmpdst = *pdst;
tmpsrc = DoMergeRop (tmpsrc, tmpdst);
#endif
putbits (tmpsrc, 0, nend, pdst);
}
}
x += w;
width -= w;
} /* while (width > 0) */
pStartDst += nlwidth;
if (++iy >= tileHeight) {
iy = 0;
pStartTile = psrcT;
} else
pStartTile += tlwidth;
} /* while (h) */
} /* for (d = ... ) */
pbox++;
} /* for each box */
}

View File

@ -1,164 +0,0 @@
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
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.
******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include <X11/X.h>
#include "scrnintstr.h"
#include "windowstr.h"
#include "privates.h"
#include "afb.h"
#include "mistruct.h"
#include "regionstr.h"
#include "maskbits.h"
Bool
afbCreateWindow(WindowPtr pWin)
{
return (TRUE);
}
/* This always returns true, because Xfree can't fail. It might be possible
* on some devices for Destroy to fail */
Bool
afbDestroyWindow(WindowPtr pWin)
{
return (TRUE);
}
/*ARGSUSED*/
Bool
afbMapWindow(pWindow)
WindowPtr pWindow;
{
return (TRUE);
}
/*ARGSUSED*/
Bool
afbPositionWindow(WindowPtr pWin, int x, int y)
{
/* This is the "wrong" fix to the right problem, but it doesn't really
* cost very much. When the window is moved, we need to invalidate any
* RotatedPixmap that exists in any GC currently validated against this
* window.
*/
pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
/* Again, we have no failure modes indicated by any of the routines
* we've called, so we have to assume it worked */
return (TRUE);
}
/*ARGSUSED*/
Bool
afbUnmapWindow(pWindow)
WindowPtr pWindow;
{
return (TRUE);
}
/* UNCLEAN!
this code calls the bitblt helper code directly.
afbCopyWindow copies only the parts of the destination that are
visible in the source.
*/
void
afbCopyWindow(pWin, ptOldOrg, prgnSrc)
WindowPtr pWin;
DDXPointRec ptOldOrg;
RegionPtr prgnSrc;
{
DDXPointPtr pptSrc;
register DDXPointPtr ppt;
RegionPtr prgnDst;
register BoxPtr pbox;
register int dx, dy;
register int i, nbox;
WindowPtr pwinRoot;
pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
REGION_INTERSECT(pWin->drawable.pScreen, prgnDst, &pWin->borderClip,
prgnSrc);
pbox = REGION_RECTS(prgnDst);
nbox = REGION_NUM_RECTS(prgnDst);
if(!(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec))))
return;
ppt = pptSrc;
for (i=nbox; --i >= 0; ppt++, pbox++) {
ppt->x = pbox->x1 + dx;
ppt->y = pbox->y1 + dy;
}
afbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst,
pptSrc, ~0);
xfree(pptSrc);
REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
}
Bool
afbChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
{
return (TRUE);
}

View File

@ -1,201 +0,0 @@
/************************************************************
Copyright (c) 1989 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM 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 X Consortium 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 X Consortium.
********************************************************/
/* Derived from:
* "Algorithm for drawing ellipses or hyperbolae with a digital plotter"
* by M. L. V. Pitteway
* The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include <X11/Xprotostr.h>
#include "regionstr.h"
#include "gcstruct.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "afb.h"
#include "maskbits.h"
#include "mizerarc.h"
#include "mi.h"
/*
* Note: LEFTMOST must be the bit leftmost in the actual screen
* representation. This depends also on the IMAGE_BYTE_ORDER.
* LONG2CHARS() takes care of the re-ordering as required. (DHD)
*/
#if (BITMAP_BIT_ORDER == MSBFirst)
#define LEFTMOST ((PixelType) LONG2CHARS((1 << PLST)))
#else
#define LEFTMOST ((PixelType) LONG2CHARS(1))
#endif
#define Pixelate(base,yoff,xoff) \
{ \
paddr = afbScanlineOffset(base, (yoff) + ((xoff)>>PWSH)); \
pmask = SCRRIGHT(LEFTMOST, (xoff) & PIM); \
for (de = 0; de < depthDst; de++, paddr += sizeDst) /* @@@ NEXT PLANE @@@ */ \
switch (rrops[de]) { \
case RROP_BLACK: \
*paddr &= ~pmask; \
break; \
case RROP_WHITE: \
*paddr |= pmask; \
break; \
case RROP_INVERT: \
*paddr ^= pmask; \
break; \
case RROP_NOP: \
break; \
} \
}
#define DoPix(bit,base,yoff,xoff) if (mask & bit) Pixelate(base,yoff,xoff);
static void
afbZeroArcSS(DrawablePtr pDraw, GCPtr pGC, xArc *arc)
{
miZeroArcRec info;
Bool do360;
register int de;
register int x, y, a, b, d, mask;
register int k1, k3, dx, dy;
PixelType *addrl;
PixelType *yorgl, *yorgol;
int nlwidth, yoffset, dyoffset;
int sizeDst, depthDst;
PixelType pmask;
register PixelType *paddr;
register unsigned char *rrops;
rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
afbGCPrivateKey))->rrops;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
addrl);
do360 = miZeroArcSetup(arc, &info, TRUE);
yorgl = addrl + ((info.yorg + pDraw->y) * nlwidth);
yorgol = addrl + ((info.yorgo + pDraw->y) * nlwidth);
info.xorg += pDraw->x;
info.xorgo += pDraw->x;
MIARCSETUP();
yoffset = y ? nlwidth : 0;
dyoffset = 0;
mask = info.initialMask;
if (!(arc->width & 1)) {
DoPix(2, yorgl, 0, info.xorgo);
DoPix(8, yorgol, 0, info.xorgo);
}
if (!info.end.x || !info.end.y) {
mask = info.end.mask;
info.end = info.altend;
}
if (do360 && (arc->width == arc->height) && !(arc->width & 1)) {
int xoffset = nlwidth;
PixelType *yorghl = afbScanlineDeltaNoBankSwitch(yorgl, info.h, nlwidth);
int xorghp = info.xorg + info.h;
int xorghn = info.xorg - info.h;
while (1) {
Pixelate(yorgl, yoffset, info.xorg + x);
Pixelate(yorgl, yoffset, info.xorg - x);
Pixelate(yorgol, -yoffset, info.xorg - x);
Pixelate(yorgol, -yoffset, info.xorg + x);
if (a < 0)
break;
Pixelate(yorghl, -xoffset, xorghp - y);
Pixelate(yorghl, -xoffset, xorghn + y);
Pixelate(yorghl, xoffset, xorghn + y);
Pixelate(yorghl, xoffset, xorghp - y);
xoffset += nlwidth;
MIARCCIRCLESTEP(yoffset += nlwidth;);
}
x = info.w;
yoffset = info.h * nlwidth;
} else if (do360) {
while (y < info.h || x < info.w) {
MIARCOCTANTSHIFT(dyoffset = nlwidth;);
Pixelate(yorgl, yoffset, info.xorg + x);
Pixelate(yorgl, yoffset, info.xorgo - x);
Pixelate(yorgol, -yoffset, info.xorgo - x);
Pixelate(yorgol, -yoffset, info.xorg + x);
MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
}
} else {
while (y < info.h || x < info.w) {
MIARCOCTANTSHIFT(dyoffset = nlwidth;);
if ((x == info.start.x) || (y == info.start.y)) {
mask = info.start.mask;
info.start = info.altstart;
}
DoPix(1, yorgl, yoffset, info.xorg + x);
DoPix(2, yorgl, yoffset, info.xorgo - x);
DoPix(4, yorgol, -yoffset, info.xorgo - x);
DoPix(8, yorgol, -yoffset, info.xorg + x);
if ((x == info.end.x) || (y == info.end.y)) {
mask = info.end.mask;
info.end = info.altend;
}
MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
}
}
if ((x == info.start.x) || (y == info.start.y))
mask = info.start.mask;
DoPix(1, yorgl, yoffset, info.xorg + x);
DoPix(4, yorgol, -yoffset, info.xorgo - x);
if (arc->height & 1) {
DoPix(2, yorgl, yoffset, info.xorgo - x);
DoPix(8, yorgol, -yoffset, info.xorg + x);
}
}
void
afbZeroPolyArcSS(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
{
register xArc *arc;
register int i;
BoxRec box;
RegionPtr cclip;
cclip = pGC->pCompositeClip;
for (arc = parcs, i = narcs; --i >= 0; arc++) {
if (miCanZeroArc(arc)) {
box.x1 = arc->x + pDraw->x;
box.y1 = arc->y + pDraw->y;
box.x2 = box.x1 + (int)arc->width + 1;
box.y2 = box.y1 + (int)arc->height + 1;
if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN)
afbZeroArcSS(pDraw, pGC, arc);
else
miZeroPolyArc(pDraw, pGC, 1, arc);
} else
miPolyArc(pDraw, pGC, 1, arc);
}
}

View File

@ -493,7 +493,6 @@ AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir
[ APPLE_APPLICATIONS_DIR="${withval}" ],
[ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ])
AC_SUBST([APPLE_APPLICATIONS_DIR])
AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
AC_ARG_WITH(launchagents-dir,AS_HELP_STRING([--with-launchagents-dir=PATH], [Path to launchd's LaunchAgents directory (default: /Library/LaunchAgents)]),
[ launchagentsdir="${withval}" ],
[ launchagentsdir="/Library/LaunchAgents" ])
@ -573,7 +572,6 @@ AC_ARG_ENABLE(xglx, AS_HELP_STRING([--enable-xglx], [Build Xglx xgl mo
AC_ARG_ENABLE(xegl, AS_HELP_STRING([--enable-xegl], [Build Xegl xgl module (default: no)]), [XEGL=$enableval], [XEGL=no])
dnl legacy fb support
AC_ARG_ENABLE(mfb, AS_HELP_STRING([--enable-mfb], [Build legacy mono framebuffer support (default: disable)]), [MFB=$enableval], [MFB=no])
AC_ARG_ENABLE(afb, AS_HELP_STRING([--enable-afb], [Build legacy advanced framebuffer support (default: disable)]), [AFB=$enableval], [AFB=no])
dnl kdrive and its subsystems
AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no])
AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])
@ -581,9 +579,6 @@ AC_ARG_ENABLE(xsdl, AS_HELP_STRING([--enable-xsdl], [Build the kdrive
AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto])
AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto])
AC_ARG_ENABLE(kdrive-vesa, AS_HELP_STRING([--enable-kdrive-vesa], [Build the kdrive VESA-based servers (default: auto)]), [KDRIVEVESA=$enableval], [KDRIVEVESA=auto])
dnl xprint
AC_ARG_ENABLE(freetype, AS_HELP_STRING([ --enable-freetype], [Build Xprint FreeType backend (default: yes)]), [XP_USE_FREETYPE=$enableval],[XP_USE_FREETYPE=no])
AC_ARG_WITH(freetype-config, AS_HELP_STRING([ --with-freetype-config=PROG], [Use FreeType configuration program PROG (default: auto)]), freetype_config=$withval, freetype_config=auto)
dnl chown/chmod to be setuid root as part of build
@ -854,22 +849,12 @@ if test "x$RES" = xyes; then
REQUIRED_MODULES="$REQUIRED_MODULES resourceproto"
fi
if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then
if test "x$GLX" = xyes; then
PKG_CHECK_MODULES([XLIB], [x11])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.9])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.9 gl >= 7.1.0])
AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/GL/glx/libglx.la'
test -d GL || mkdir GL
case $host_os in
solaris*)
SYMLINK_MESA="/usr/bin/bash $srcdir/GL/symlink-mesa.sh" ;;
*) SYMLINK_MESA=$srcdir/GL/symlink-mesa.sh ;;
esac
$SYMLINK_MESA $MESA_SOURCE GL/
if test $? -ne 0; then
AC_MSG_ERROR([Failed to link Mesa source tree. Please specify a proper path to Mesa sources, or disable GLX.])
fi
GLX_LIBS='$(top_builddir)/glx/libglx.la'
GLX_SYS_LIBS="$GLX_SYS_LIBS $DLOPEN_LIBS"
else
GLX=no
@ -895,7 +880,7 @@ if test "x$DRI" = xyes; then
AC_DEFINE(XF86DRI, 1, [Build DRI extension])
PKG_CHECK_MODULES([DRIPROTO], [xf86driproto])
PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.0])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.1])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.1 gl >= 7.1.0])
PKG_CHECK_EXISTS(libdrm >= 2.2.0,
[AC_DEFINE([HAVE_LIBDRM_2_2], 1,
[Has version 2.2 (or newer) of the drm library])])
@ -1124,7 +1109,6 @@ FB_LIB='$(top_builddir)/fb/libfb.la'
FB_INC='-I$(top_srcdir)/fb'
MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow'
MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
XPSTUBS_LIB='$(top_builddir)/dix/libxpstubs.la'
CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
@ -1231,7 +1215,7 @@ AC_MSG_RESULT([$XVFB])
AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
if test "x$XVFB" = xyes; then
XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB"
XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB"
XVFB_SYS_LIBS="$XVFBMODULES_LIBS"
AC_SUBST([XVFB_LIBS])
AC_SUBST([XVFB_SYS_LIBS])
@ -1249,7 +1233,7 @@ AC_MSG_RESULT([$XNEST])
AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
if test "x$XNEST" = xyes; then
XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $DIX_LIB $OS_LIB $CONFIG_LIB"
XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $OS_LIB $CONFIG_LIB"
XNEST_SYS_LIBS="$XNESTMODULES_LIBS"
AC_SUBST([XNEST_LIBS])
AC_SUBST([XNEST_SYS_LIBS])
@ -1279,7 +1263,7 @@ AC_MSG_RESULT([$XGL])
AM_CONDITIONAL(XGL, [test "x$XGL" = xyes])
if test "x$XGL" = xyes; then
XGL_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB"
XGL_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB"
XGL_SYS_LIBS="$XGLMODULES_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS"
AC_SUBST([XGL_LIBS])
AC_SUBST([XGL_SYS_LIBS])
@ -1301,7 +1285,7 @@ AC_MSG_RESULT([$XEGL])
AM_CONDITIONAL(XEGL, [test "x$XEGL" = xyes])
if test "x$XEGL" = xyes; then
XEGL_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB"
XEGL_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB"
XEGL_SYS_LIBS = "$XEGL_SYS_LIBS $XEGLMODULES_LIBS $GLX_SYS_LIBS"
AC_SUBST([XEGL_LIBS])
AC_SUBST([XEGL_SYS_LIBS])
@ -1318,7 +1302,7 @@ AC_MSG_RESULT([$XGLX])
AM_CONDITIONAL(XGLX, [test "x$XGLX" = xyes])
if test "x$XGLX" = xyes; then
XGLX_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB"
XGLX_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB"
XGLX_SYS_LIBS="$XGLX_SYS_LIBS $XGLXMODULES_LIBS $GLX_SYS_LIBS"
AC_SUBST([XGLX_LIBS])
AC_SUBST([XGLX_SYS_LIBS])
@ -1336,7 +1320,7 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then
XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XPSTUBS_LIB $SELINUX_LIB"
XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $SELINUX_LIB"
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
SAVE_LIBS=$LIBS
@ -1344,6 +1328,7 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then
CFLAGS=$PCIACCESS_CFLAGS
LIBS=$PCIACCESS_LIBS
AC_CHECK_FUNCS([pci_system_init_dev_mem])
AC_CHECK_FUNCS([pci_device_enable])
LIBS=$SAVE_LIBS
CFLAGS=$SAVE_CFLAGS
XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS"
@ -1595,10 +1580,8 @@ AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
dnl legacy fb support
test "x$MFB" = xauto && MFB="$XORG"
test "x$AFB" = xauto && AFB="$XORG"
AM_CONDITIONAL(MFB, [test "x$MFB" = xyes])
AM_CONDITIONAL(AFB, [test "x$AFB" = xyes])
if test "x$MFB" = xyes -o "x$AFB" = xyes; then
if test "x$MFB" = xyes; then
if test "x$XORG" != xyes; then
AC_MSG_ERROR([legacy fb support requires the Xorg server])
fi
@ -1678,7 +1661,7 @@ if test "x$XQUARTZ" = xyes; then
AC_DEFINE(XQUARTZ,1,[Have Quartz])
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
DARWIN_GLX_LIBS='$(top_builddir)/hw/xquartz/GL/libCGLCore.la $(top_builddir)/GL/glx/libglx.la'
DARWIN_GLX_LIBS='$(top_builddir)/hw/xquartz/GL/libCGLCore.la $(top_builddir)/glx/libglx.la'
DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $DARWIN_GLX_LIBS"
AC_SUBST([DARWIN_LIBS])
@ -1702,21 +1685,6 @@ AM_CONDITIONAL(HAVE_XPLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes])
AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes])
AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
if test "x$LAUNCHD" = "xauto"; then
if test "x$XQUARTZ" = "xyes" ; then
LAUNCHD=yes
else
unset LAUNCHD
AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])
fi
fi
if test "x$LAUNCHD" = "xyes" ; then
AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
fi
AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"])
dnl DMX DDX
AC_MSG_CHECKING([whether to build Xdmx DDX])
@ -1864,7 +1832,7 @@ if test "$KDRIVE" = yes; then
KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS"
KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB"
KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB"
KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a'
case $host_os in
*linux*)
@ -2004,10 +1972,8 @@ XORG_MANPAGE_SECTIONS
AC_OUTPUT([
Makefile
GL/Makefile
GL/glx/Makefile
glx/Makefile
include/Makefile
afb/Makefile
composite/Makefile
damageext/Makefile
dbe/Makefile

View File

@ -1,6 +1,4 @@
standard_dix_libs = libdix.la libxpstubs.la
noinst_LTLIBRARIES = $(standard_dix_libs)
noinst_LTLIBRARIES = libdix.la
AM_CFLAGS = $(DIX_CFLAGS) \
-DVENDOR_NAME=\""@VENDOR_NAME@"\" \
@ -39,9 +37,6 @@ libdix_la_SOURCES = \
window.c \
strcasecmp.c
libxpstubs_la_SOURCES = \
xpstubs.c
EXTRA_DIST = buildatoms BuiltInAtoms CHANGES Xserver.d Xserver-dtrace.h.in
# Install list of protocol names

View File

@ -246,7 +246,6 @@ int main(int argc, char *argv[], char *envp[])
display = "0";
InitGlobals();
InitRegions();
CheckUserParameters(argc, argv, envp);

View File

@ -1,50 +0,0 @@
/*
Copyright 1996, 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.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "misc.h"
#include <X11/fonts/font.h>
extern Bool XpClientIsBitmapClient(ClientPtr client);
extern Bool XpClientIsPrintClient(ClientPtr client, FontPathElementPtr fpe);
Bool
XpClientIsBitmapClient(
ClientPtr client)
{
return TRUE;
}
Bool
XpClientIsPrintClient(
ClientPtr client,
FontPathElementPtr fpe)
{
return FALSE;
}

View File

@ -261,6 +261,21 @@ exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
pExaScr->info->pixmapPitchAlign);
}
static void
ExaDamageReport(DamagePtr pDamage, RegionPtr pReg, void *pClosure)
{
PixmapPtr pPixmap = pClosure;
ExaPixmapPriv(pPixmap);
RegionPtr pDamageReg = DamageRegion(pDamage);
if (pExaPixmap->pendingDamage) {
REGION_UNION(pScreen, pDamageReg, pDamageReg, pReg);
pExaPixmap->pendingDamage = FALSE;
}
}
/**
* exaCreatePixmap() creates a new pixmap.
*
@ -352,7 +367,7 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
pExaPixmap->area = NULL;
/* Set up damage tracking */
pExaPixmap->pDamage = DamageCreate (NULL, NULL, DamageReportNone, TRUE,
pExaPixmap->pDamage = DamageCreate (ExaDamageReport, NULL, DamageReportRawRegion, TRUE,
pScreen, pPixmap);
if (pExaPixmap->pDamage == NULL) {

View File

@ -262,6 +262,7 @@ exaDoShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
if (format == ZPixmap)
{
PixmapPtr pPixmap;
ExaPixmapPriv(exaGetDrawablePixmap(pDrawable));
pPixmap = GetScratchPixmapHeader(pDrawable->pScreen, w, h, depth,
BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data);
@ -272,7 +273,8 @@ exaDoShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
pGC->alu))
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
else
ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST,
DamagePendingRegion(pExaPixmap->pDamage));
fbCopyArea((DrawablePtr)pPixmap, pDrawable, pGC, sx, sy, sw, sh, dx, dy);
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
@ -316,7 +318,7 @@ exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format,
pGC->alu))
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
else
ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, &region);
fbShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy,
data);
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
@ -487,7 +489,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
int src_off_x, src_off_y;
int dst_off_x, dst_off_y;
ExaMigrationRec pixmaps[2];
RegionPtr region = NULL;
RegionPtr srcregion = NULL, dstregion = NULL;
xRectangle *rects;
pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable);
pDstPixmap = exaGetDrawablePixmap (pDstDrawable);
@ -495,33 +498,38 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y);
exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y);
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
pGC->fillStyle, pGC->alu)) {
xRectangle *rects = xalloc(nbox * sizeof(xRectangle));
rects = xalloc(nbox * sizeof(xRectangle));
if (rects) {
int i;
for (i = 0; i < nbox; i++) {
rects[i].x = pbox[i].x1 + dst_off_x;
rects[i].y = pbox[i].y1 + dst_off_y;
rects[i].x = pbox[i].x1 + dx + src_off_x;
rects[i].y = pbox[i].y1 + dy + src_off_y;
rects[i].width = pbox[i].x2 - pbox[i].x1;
rects[i].height = pbox[i].y2 - pbox[i].y1;
}
region = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED);
srcregion = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED);
xfree(rects);
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
pGC->fillStyle, pGC->alu)) {
dstregion = REGION_CREATE(pScreen, NullBox, 0);
REGION_COPY(pScreen, dstregion, srcregion);
REGION_TRANSLATE(pScreen, dstregion, dst_off_x - dx - src_off_x,
dst_off_y - dy - src_off_y);
}
}
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
pixmaps[0].pPix = pDstPixmap;
pixmaps[0].pReg = region;
pixmaps[0].pReg = dstregion;
pixmaps[1].as_dst = FALSE;
pixmaps[1].as_src = TRUE;
pixmaps[1].pPix = pSrcPixmap;
pixmaps[1].pReg = NULL;
pixmaps[1].pReg = srcregion;
pSrcExaPixmap = ExaGetPixmapPriv (pSrcPixmap);
pDstExaPixmap = ExaGetPixmapPriv (pDstPixmap);
@ -594,17 +602,21 @@ fallback:
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable,
exaDrawableLocation(pSrcDrawable),
exaDrawableLocation(pDstDrawable)));
exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, region);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, dstregion);
exaPrepareAccessReg (pSrcDrawable, EXA_PREPARE_SRC, srcregion);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse,
upsidedown, bitplane, closure);
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
out:
if (region) {
REGION_UNINIT(pScreen, region);
REGION_DESTROY(pScreen, region);
if (dstregion) {
REGION_UNINIT(pScreen, dstregion);
REGION_DESTROY(pScreen, dstregion);
}
if (srcregion) {
REGION_UNINIT(pScreen, srcregion);
REGION_DESTROY(pScreen, srcregion);
}
}
@ -960,10 +972,8 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
int dstBpp;
int dstXoff, dstYoff;
FbBits depthMask;
Bool fallback;
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
ExaPixmapPriv(pPixmap);
ExaMigrationRec pixmaps[1];
RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
BoxRec extents = *REGION_EXTENTS(pScreen, pending_damage);
int xoff, yoff;
@ -972,16 +982,8 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
return;
depthMask = FbFullMask(pDrawable->depth);
fallback = (pGC->planemask & depthMask) != depthMask;
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = fallback ? NULL : pending_damage;
exaDoMigration(pixmaps, 1, FALSE);
if (fallback)
if ((pGC->planemask & depthMask) != depthMask)
{
ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase);
return;
@ -1004,7 +1006,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
extents.y1 -= yoff;
extents.y2 -= yoff;
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg);
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pending_damage);
if (TERMINALFONT (pGC->font) && !glyph)
{

View File

@ -116,7 +116,7 @@ exaPixmapShouldBeInFB (PixmapPtr pPix)
* If the pixmap is currently dirty, this copies at least the dirty area from
* FB to system or vice versa. Both areas must be allocated.
*/
static _X_INLINE void
static void
exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
Bool (*transfer) (PixmapPtr pPix, int x, int y, int w, int h,
char *sys, int sys_pitch), CARD8 *fallback_src,
@ -301,6 +301,9 @@ exaDoMoveInPixmap (ExaMigrationPtr migrate)
ExaScreenPriv (pScreen);
ExaPixmapPriv (pPixmap);
if (migrate->as_dst)
pExaPixmap->pendingDamage = TRUE;
/* If we're VT-switched away, no touching card memory allowed. */
if (pExaScr->swappedOut)
return;
@ -369,6 +372,9 @@ exaDoMoveOutPixmap (ExaMigrationPtr migrate)
PixmapPtr pPixmap = migrate->pPix;
ExaPixmapPriv (pPixmap);
if (migrate->as_dst)
pExaPixmap->pendingDamage = TRUE;
if (!pExaPixmap->area || exaPixmapIsPinned(pPixmap))
return;

View File

@ -226,6 +226,7 @@ typedef struct {
* location.
*/
DamagePtr pDamage;
Bool pendingDamage;
/**
* The valid regions mark the valid bits (at least, as they're derived from
* damage, which may be overreported) of a pixmap's system and FB copies.

View File

@ -97,12 +97,15 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
int x, int y, int w, int h, int leftPad, int format,
char *bits)
{
ExaPixmapPriv(exaGetDrawablePixmap(pDrawable));
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
pGC->alu))
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
else
ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST,
DamagePendingRegion(pExaPixmap->pDamage));
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
}

View File

@ -5,14 +5,11 @@ endif
noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY)
AM_CFLAGS = \
-I@MESA_SOURCE@/include \
@DIX_CFLAGS@ \
@GL_CFLAGS@ \
@XLIB_CFLAGS@ \
@LIBDRM_CFLAGS@ \
@DRIPROTO_CFLAGS@ \
-I@MESA_SOURCE@/src/mesa/glapi \
-I@MESA_SOURCE@/src/mesa/main \
-DXFree86Server \
@GLX_DEFINES@ \
@GLX_ARCH_DEFINES@
@ -28,18 +25,23 @@ INCLUDES = \
-I$(top_srcdir)/hw/xfree86/dri2 \
-I$(top_srcdir)/mi
nodist_libglx_la_SOURCES = indirect_size.h \
glapi.c \
glthread.c \
glapi_sources = \
indirect_dispatch.c \
indirect_dispatch.h \
indirect_dispatch_swap.c \
indirect_reqsize.c \
indirect_reqsize.h \
indirect_size.h \
indirect_size_get.c \
indirect_size_get.h \
indirect_table.c
indirect_table.c \
dispatch.h \
glapitable.h \
glapitemp.h \
glapi.c \
glapi.h \
glthread.c \
glthread.h
libglxdri_la_SOURCES = \
glxdri.c \
@ -47,12 +49,14 @@ libglxdri_la_SOURCES = \
extension_string.c \
extension_string.h
#if XQUARTZ
XQUARTZ_libglx_la_SOURCES = glcontextmodes.c
#endif
libglx_la_SOURCES = \
$(XQUARTZ_libglx_la_SOURCES) \
$(indirect_sources) \
$(glapi_sources) \
indirect_util.c \
indirect_util.h \
indirect_program.c \
indirect_table.h \
indirect_texture_compression.c \
g_disptab.h \
glxbyteorder.h \
glxcmds.c \
@ -61,17 +65,13 @@ libglx_la_SOURCES = \
glxdrawable.h \
glxext.c \
glxext.h \
glxglcore.c \
glxdriswrast.c \
glxdricommon.c \
glxscreens.c \
glxscreens.h \
glxserver.h \
glxutil.c \
glxutil.h \
indirect_program.c \
indirect_table.h \
indirect_texture_compression.c \
indirect_util.c \
indirect_util.h \
render2.c \
render2swap.c \
renderpix.c \

3829
glx/dispatch.h Normal file

File diff suppressed because it is too large Load Diff

1064
glx/glapi.c Normal file

File diff suppressed because it is too large Load Diff

160
glx/glapi.h Normal file
View File

@ -0,0 +1,160 @@
/*
* Mesa 3-D graphics library
* Version: 6.5
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \mainpage Mesa GL API Module
*
* \section GLAPIIntroduction Introduction
*
* The Mesa GL API module is responsible for dispatching all the
* gl*() functions. All GL functions are dispatched by jumping through
* the current dispatch table (basically a struct full of function
* pointers.)
*
* A per-thread current dispatch table and per-thread current context
* pointer are managed by this module too.
*
* This module is intended to be non-Mesa-specific so it can be used
* with the X/DRI libGL also.
*/
#ifndef _GLAPI_H
#define _GLAPI_H
#include "GL/gl.h"
#include "glapitable.h"
#include "glthread.h"
typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
#if defined(USE_MGL_NAMESPACE)
#define _glapi_set_dispatch _mglapi_set_dispatch
#define _glapi_get_dispatch _mglapi_get_dispatch
#define _glapi_set_context _mglapi_set_context
#define _glapi_get_context _mglapi_get_context
#define _glapi_Context _mglapi_Context
#define _glapi_Dispatch _mglapi_Dispatch
#endif
/**
** Define the GET_CURRENT_CONTEXT() macro.
** \param C local variable which will hold the current context.
**/
#if defined (GLX_USE_TLS)
const extern void *_glapi_Context;
const extern struct _glapi_table *_glapi_Dispatch;
extern __thread void * _glapi_tls_Context
__attribute__((tls_model("initial-exec")));
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
#else
extern void *_glapi_Context;
extern struct _glapi_table *_glapi_Dispatch;
# ifdef THREADS
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context())
# else
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context
# endif
#endif /* defined (GLX_USE_TLS) */
/**
** GL API public functions
**/
extern void
_glapi_noop_enable_warnings(GLboolean enable);
extern void
_glapi_set_warning_func(_glapi_warning_func func);
extern void
_glapi_check_multithread(void);
extern void
_glapi_set_context(void *context);
extern void *
_glapi_get_context(void);
extern void
_glapi_set_dispatch(struct _glapi_table *dispatch);
extern struct _glapi_table *
_glapi_get_dispatch(void);
extern int
_glapi_begin_dispatch_override(struct _glapi_table *override);
extern void
_glapi_end_dispatch_override(int layer);
struct _glapi_table *
_glapi_get_override_dispatch(int layer);
extern GLuint
_glapi_get_dispatch_table_size(void);
extern void
_glapi_check_table(const struct _glapi_table *table);
extern int
_glapi_add_dispatch( const char * const * function_names,
const char * parameter_signature );
extern GLint
_glapi_get_proc_offset(const char *funcName);
extern _glapi_proc
_glapi_get_proc_address(const char *funcName);
extern const char *
_glapi_get_proc_name(GLuint offset);
#endif

1174
glx/glapioffsets.h Normal file

File diff suppressed because it is too large Load Diff

816
glx/glapitable.h Normal file
View File

@ -0,0 +1,816 @@
/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
/*
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL, IBM,
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#if !defined( _GLAPI_TABLE_H_ )
# define _GLAPI_TABLE_H_
#ifndef GLAPIENTRYP
# ifndef GLAPIENTRY
# define GLAPIENTRY
# endif
# define GLAPIENTRYP GLAPIENTRY *
#endif
typedef void (*_glapi_proc)(void); /* generic function pointer */
struct _glapi_table
{
void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
void (GLAPIENTRYP EndList)(void); /* 1 */
void (GLAPIENTRYP CallList)(GLuint list); /* 2 */
void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */
void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */
GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */
void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */
void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */
void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */
void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */
void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */
void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */
void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */
void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */
void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */
void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */
void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */
void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */
void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */
void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */
void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */
void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */
void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */
void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */
void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */
void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */
void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */
void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */
void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */
void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */
void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */
void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */
void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */
void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */
void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */
void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */
void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */
void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */
void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */
void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */
void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */
void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */
void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */
void (GLAPIENTRYP End)(void); /* 43 */
void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */
void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */
void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */
void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */
void (GLAPIENTRYP Indexi)(GLint c); /* 48 */
void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */
void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */
void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */
void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */
void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */
void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */
void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */
void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */
void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */
void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */
void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */
void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */
void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */
void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */
void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */
void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */
void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */
void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */
void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */
void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */
void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */
void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */
void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */
void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */
void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */
void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */
void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */
void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */
void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */
void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */
void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */
void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */
void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */
void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */
void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */
void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */
void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */
void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */
void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */
void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */
void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */
void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */
void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */
void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */
void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */
void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */
void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */
void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */
void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */
void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */
void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */
void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */
void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */
void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */
void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */
void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */
void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */
void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */
void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */
void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */
void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */
void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */
void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */
void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */
void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */
void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */
void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */
void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */
void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */
void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */
void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */
void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */
void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */
void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */
void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */
void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */
void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */
void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */
void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */
void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */
void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */
void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */
void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */
void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */
void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */
void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */
void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */
void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */
void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */
void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */
void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */
void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */
void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */
void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */
void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */
void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */
void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */
void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */
void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */
void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */
void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */
void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */
void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */
void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */
void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */
void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */
void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */
void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */
void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */
void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */
void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */
void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */
void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */
void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */
void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */
void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */
void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */
void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */
void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */
void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */
void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */
void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */
void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */
void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */
void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */
void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */
void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */
void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */
void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */
void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */
void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */
void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */
void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */
void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */
void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */
void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */
void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */
void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */
void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */
void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */
void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */
void (GLAPIENTRYP TexGenf)(GLenum coord, GLenum pname, GLfloat param); /* 190 */
void (GLAPIENTRYP TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */
void (GLAPIENTRYP TexGeni)(GLenum coord, GLenum pname, GLint param); /* 192 */
void (GLAPIENTRYP TexGeniv)(GLenum coord, GLenum pname, const GLint * params); /* 193 */
void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */
void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */
GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */
void (GLAPIENTRYP InitNames)(void); /* 197 */
void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */
void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */
void (GLAPIENTRYP PopName)(void); /* 200 */
void (GLAPIENTRYP PushName)(GLuint name); /* 201 */
void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */
void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */
void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */
void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */
void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */
void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */
void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */
void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */
void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */
void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */
void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */
void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */
void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */
void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */
void (GLAPIENTRYP Finish)(void); /* 216 */
void (GLAPIENTRYP Flush)(void); /* 217 */
void (GLAPIENTRYP PopAttrib)(void); /* 218 */
void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */
void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */
void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */
void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */
void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */
void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */
void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */
void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */
void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */
void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */
void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */
void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */
void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */
void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */
void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */
void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */
void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */
void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */
void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */
void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */
void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */
void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */
void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */
void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */
void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */
void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */
void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */
void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */
void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */
void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */
void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */
void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */
void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */
void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */
void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */
void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */
void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */
void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */
void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */
void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */
void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */
void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */
GLenum (GLAPIENTRYP GetError)(void); /* 261 */
void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */
void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */
void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */
void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */
void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */
void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */
void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */
void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */
void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */
void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */
void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */
void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */
void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */
const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */
void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */
void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */
void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */
void (GLAPIENTRYP GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */
void (GLAPIENTRYP GetTexGeniv)(GLenum coord, GLenum pname, GLint * params); /* 280 */
void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */
void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */
void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */
void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */
void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */
GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */
void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
void (GLAPIENTRYP LoadIdentity)(void); /* 290 */
void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */
void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */
void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */
void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */
void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */
void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */
void (GLAPIENTRYP PopMatrix)(void); /* 297 */
void (GLAPIENTRYP PushMatrix)(void); /* 298 */
void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */
void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */
void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */
void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */
void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */
void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */
void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */
void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */
void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */
void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */
void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */
void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */
void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */
void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */
void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */
void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */
void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */
void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */
void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */
void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */
void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */
void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */
void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */
GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */
void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */
void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */
void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */
void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */
void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */
void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */
void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */
void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */
void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */
void (GLAPIENTRYP BlendEquation)(GLenum mode); /* 337 */
void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */
void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */
void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */
void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */
void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */
void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */
void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */
void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */
void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */
void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */
void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */
void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */
void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */
void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */
void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */
void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */
void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */
void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */
void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */
void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */
void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */
void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */
void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */
void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */
void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */
void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */
void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */
void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */
void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */
void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */
void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */
void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */
void (GLAPIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
void (GLAPIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
void (GLAPIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
void (GLAPIENTRYP ActiveTextureARB)(GLenum texture); /* 374 */
void (GLAPIENTRYP ClientActiveTextureARB)(GLenum texture); /* 375 */
void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */
void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */
void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */
void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */
void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */
void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */
void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */
void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */
void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */
void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */
void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */
void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */
void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */
void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */
void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */
void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */
void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */
void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */
void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */
void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */
void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */
void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */
void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */
void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */
void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */
void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */
void (GLAPIENTRYP MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */
void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */
void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */
GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */
GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */
void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */
void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */
void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */
void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */
void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */
void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */
void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */
void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */
GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */
GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */
void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */
void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */
void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); /* 423 */
void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */
void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */
void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */
void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */
void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */
void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */
void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 430 */
void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 431 */
void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 432 */
void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 433 */
void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 434 */
void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 435 */
void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 436 */
void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 437 */
void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 438 */
void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 439 */
void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 440 */
void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 441 */
void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 442 */
void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 443 */
void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 444 */
void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 445 */
void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 446 */
void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 447 */
void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 448 */
void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 449 */
void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 450 */
void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 451 */
void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 452 */
void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 453 */
void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 454 */
void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 455 */
void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 456 */
void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 457 */
void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 458 */
void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 459 */
void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 460 */
void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 461 */
void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 462 */
void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 463 */
void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 464 */
void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 465 */
void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 466 */
void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 467 */
void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 468 */
void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 469 */
void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 470 */
void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 471 */
void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 472 */
void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 473 */
void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 474 */
void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 475 */
void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 476 */
void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 477 */
void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 478 */
void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 479 */
void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 480 */
void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 481 */
void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 482 */
void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 483 */
void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 484 */
void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 485 */
void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 486 */
void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 487 */
void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 488 */
void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 489 */
void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 490 */
void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 491 */
void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 492 */
void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 493 */
void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 494 */
void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 495 */
void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 496 */
void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 497 */
void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 498 */
void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 499 */
void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 500 */
void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 501 */
void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 502 */
void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 503 */
void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 504 */
void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 505 */
void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 506 */
GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 507 */
GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 508 */
GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 509 */
void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 510 */
void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 511 */
void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 512 */
void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 513 */
void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 514 */
void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 515 */
void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 516 */
GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 517 */
void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 518 */
void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 519 */
GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 520 */
GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 521 */
void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 522 */
void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 523 */
void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 524 */
void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 525 */
GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 526 */
void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 527 */
void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 528 */
void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 529 */
void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 530 */
GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 531 */
void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 532 */
void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 533 */
void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 534 */
void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 535 */
void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 536 */
void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 537 */
void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 538 */
void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 539 */
void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 540 */
void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 541 */
void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 542 */
void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 543 */
void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 544 */
void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 545 */
void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 546 */
void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 547 */
void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 548 */
void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 549 */
void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 550 */
void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 551 */
void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 552 */
void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 553 */
void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 554 */
void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 555 */
void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 556 */
void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 557 */
void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 558 */
GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 559 */
void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 560 */
void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 561 */
void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 562 */
void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 563 */
void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 564 */
void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 565 */
void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 566 */
void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 567 */
void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 568 */
void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 569 */
void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */
void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 571 */
void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */
void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */
void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */
void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */
void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 576 */
void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 577 */
void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 578 */
void (GLAPIENTRYP UnlockArraysEXT)(void); /* 579 */
void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 580 */
void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 581 */
void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 582 */
void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 583 */
void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 584 */
void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 585 */
void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 586 */
void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 587 */
void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 588 */
void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 589 */
void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 590 */
void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 591 */
void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 592 */
void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 593 */
void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 594 */
void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 595 */
void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 596 */
void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 597 */
void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */
void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 599 */
void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 600 */
void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 601 */
void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 602 */
void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 603 */
void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 604 */
void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 605 */
void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 606 */
void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 607 */
void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 608 */
void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 609 */
void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 610 */
void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 611 */
void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 612 */
void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 613 */
void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 614 */
void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 615 */
void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 616 */
void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 617 */
void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 618 */
void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 619 */
void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 620 */
void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 621 */
void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 622 */
void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 623 */
void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 624 */
void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 625 */
void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 626 */
void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 627 */
void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 628 */
void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 629 */
void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 630 */
void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 631 */
void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 632 */
void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 633 */
void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 634 */
void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 635 */
void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 636 */
void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 637 */
void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 638 */
void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 639 */
void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 640 */
void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 641 */
void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 642 */
void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 643 */
void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 644 */
void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 645 */
void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 646 */
void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 647 */
void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 648 */
void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 649 */
void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 650 */
void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 651 */
void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 652 */
void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 653 */
GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 654 */
void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 655 */
GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 656 */
GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 657 */
void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 658 */
void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 659 */
void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 660 */
void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 661 */
void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 662 */
void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 663 */
void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 664 */
void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 665 */
void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 666 */
void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 667 */
void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 668 */
void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 669 */
void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */
GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */
void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */
void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 673 */
void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 674 */
void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 675 */
void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 676 */
void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 677 */
void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 678 */
void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 679 */
void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 680 */
void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 681 */
void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 682 */
void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 683 */
void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 684 */
void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 685 */
void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 686 */
void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 687 */
void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 688 */
void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 689 */
void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 690 */
void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 691 */
void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 692 */
void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 693 */
void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 694 */
void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 695 */
void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 696 */
void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 697 */
void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 698 */
void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 699 */
void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 700 */
void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 701 */
void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 702 */
void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 703 */
void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 704 */
void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 705 */
void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 706 */
void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 707 */
void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 708 */
void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 709 */
void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 710 */
void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 711 */
void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 712 */
void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 713 */
void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 714 */
void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 715 */
void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 716 */
void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 717 */
void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 718 */
void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 719 */
void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 720 */
void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 721 */
void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 722 */
void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 723 */
void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 724 */
void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 725 */
void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 726 */
GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 727 */
void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 728 */
void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 729 */
void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 730 */
void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 731 */
void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 732 */
void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 733 */
void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 734 */
void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 735 */
void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 736 */
GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 737 */
void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 738 */
void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 739 */
void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 740 */
void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 741 */
void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 742 */
void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 743 */
void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 744 */
void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 745 */
void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 746 */
void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 747 */
GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 748 */
void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 749 */
void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 750 */
void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 751 */
void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 752 */
void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */
void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 754 */
void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 755 */
void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 756 */
void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 757 */
void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 758 */
void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 759 */
GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 760 */
GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 761 */
void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 762 */
void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 763 */
void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 764 */
void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 765 */
void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 766 */
void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */
void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 768 */
void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 769 */
};
#endif /* !defined( _GLAPI_TABLE_H_ ) */

6655
glx/glapitemp.h Normal file

File diff suppressed because it is too large Load Diff

2260
glx/glprocs.h Normal file

File diff suppressed because it is too large Load Diff

378
glx/glthread.c Normal file
View File

@ -0,0 +1,378 @@
/*
* Mesa 3-D graphics library
* Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* XXX There's probably some work to do in order to make this file
* truly reusable outside of Mesa.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include "glthread.h"
/*
* This file should still compile even when THREADS is not defined.
* This is to make things easier to deal with on the makefile scene..
*/
#ifdef THREADS
#include <errno.h>
/*
* Error messages
*/
#define INIT_TSD_ERROR "_glthread_: failed to allocate key for thread specific data"
#define GET_TSD_ERROR "_glthread_: failed to get thread specific data"
#define SET_TSD_ERROR "_glthread_: thread failed to set thread specific data"
/*
* Magic number to determine if a TSD object has been initialized.
* Kind of a hack but there doesn't appear to be a better cross-platform
* solution.
*/
#define INIT_MAGIC 0xff8adc98
/*
* POSIX Threads -- The best way to go if your platform supports them.
* Solaris >= 2.5 have POSIX threads, IRIX >= 6.4 reportedly
* has them, and many of the free Unixes now have them.
* Be sure to use appropriate -mt or -D_REENTRANT type
* compile flags when building.
*/
#ifdef PTHREADS
unsigned long
_glthread_GetID(void)
{
return (unsigned long) pthread_self();
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
perror(INIT_TSD_ERROR);
exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
return pthread_getspecific(tsd->key);
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
if (pthread_setspecific(tsd->key, ptr) != 0) {
perror(SET_TSD_ERROR);
exit(-1);
}
}
#endif /* PTHREADS */
/*
* Solaris/Unix International Threads -- Use only if POSIX threads
* aren't available on your Unix platform. Solaris 2.[34] are examples
* of platforms where this is the case. Be sure to use -mt and/or
* -D_REENTRANT when compiling.
*/
#ifdef SOLARIS_THREADS
#define USE_LOCK_FOR_KEY /* undef this to try a version without
lock for the global key... */
unsigned long
_glthread_GetID(void)
{
abort(); /* XXX not implemented yet */
return (unsigned long) 0;
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
if ((errno = mutex_init(&tsd->keylock, 0, NULL)) != 0 ||
(errno = thr_keycreate(&(tsd->key), free)) != 0) {
perror(INIT_TSD_ERROR);
exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
void* ret;
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
#ifdef USE_LOCK_FOR_KEY
mutex_lock(&tsd->keylock);
thr_getspecific(tsd->key, &ret);
mutex_unlock(&tsd->keylock);
#else
if ((errno = thr_getspecific(tsd->key, &ret)) != 0) {
perror(GET_TSD_ERROR);
exit(-1);
}
#endif
return ret;
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
if ((errno = thr_setspecific(tsd->key, ptr)) != 0) {
perror(SET_TSD_ERROR);
exit(-1);
}
}
#undef USE_LOCK_FOR_KEY
#endif /* SOLARIS_THREADS */
/*
* Win32 Threads. The only available option for Windows 95/NT.
* Be sure that you compile using the Multithreaded runtime, otherwise
* bad things will happen.
*/
#ifdef WIN32_THREADS
void FreeTSD(_glthread_TSD *p)
{
if (p->initMagic==INIT_MAGIC) {
TlsFree(p->key);
p->initMagic=0;
}
}
void InsteadOf_exit(int nCode)
{
DWORD dwErr=GetLastError();
}
unsigned long
_glthread_GetID(void)
{
return GetCurrentThreadId();
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
tsd->key = TlsAlloc();
if (tsd->key == TLS_OUT_OF_INDEXES) {
perror("Mesa:_glthread_InitTSD");
InsteadOf_exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
return TlsGetValue(tsd->key);
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
/* the following code assumes that the _glthread_TSD has been initialized
to zero at creation */
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
if (TlsSetValue(tsd->key, ptr) == 0) {
perror("Mesa:_glthread_SetTSD");
InsteadOf_exit(-1);
}
}
#endif /* WIN32_THREADS */
/*
* XFree86 has its own thread wrapper, Xthreads.h
* We wrap it again for GL.
*/
#ifdef USE_XTHREADS
unsigned long
_glthread_GetID(void)
{
return (unsigned long) xthread_self();
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
if (xthread_key_create(&tsd->key, NULL) != 0) {
perror(INIT_TSD_ERROR);
exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
void *ptr;
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
xthread_get_specific(tsd->key, &ptr);
return ptr;
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
xthread_set_specific(tsd->key, ptr);
}
#endif /* XTHREAD */
/*
* BeOS threads
*/
#ifdef BEOS_THREADS
unsigned long
_glthread_GetID(void)
{
return (unsigned long) find_thread(NULL);
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
tsd->key = tls_allocate();
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
return tls_get(tsd->key);
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
tls_set(tsd->key, ptr);
}
#endif /* BEOS_THREADS */
#else /* THREADS */
/*
* no-op functions
*/
unsigned long
_glthread_GetID(void)
{
return 0;
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
(void) tsd;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
(void) tsd;
return NULL;
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
(void) tsd;
(void) ptr;
}
#endif /* THREADS */

319
glx/glthread.h Normal file
View File

@ -0,0 +1,319 @@
/*
* Mesa 3-D graphics library
* Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* Thread support for gl dispatch.
*
* Initial version by John Stone (j.stone@acm.org) (johns@cs.umr.edu)
* and Christoph Poliwoda (poliwoda@volumegraphics.com)
* Revised by Keith Whitwell
* Adapted for new gl dispatcher by Brian Paul
*
*
*
* DOCUMENTATION
*
* This thread module exports the following types:
* _glthread_TSD Thread-specific data area
* _glthread_Thread Thread datatype
* _glthread_Mutex Mutual exclusion lock
*
* Macros:
* _glthread_DECLARE_STATIC_MUTEX(name) Declare a non-local mutex
* _glthread_INIT_MUTEX(name) Initialize a mutex
* _glthread_LOCK_MUTEX(name) Lock a mutex
* _glthread_UNLOCK_MUTEX(name) Unlock a mutex
*
* Functions:
* _glthread_GetID(v) Get integer thread ID
* _glthread_InitTSD() Initialize thread-specific data
* _glthread_GetTSD() Get thread-specific data
* _glthread_SetTSD() Set thread-specific data
*
*/
/*
* If this file is accidentally included by a non-threaded build,
* it should not cause the build to fail, or otherwise cause problems.
* In general, it should only be included when needed however.
*/
#ifndef GLTHREAD_H
#define GLTHREAD_H
#if defined(USE_MGL_NAMESPACE)
#define _glapi_Dispatch _mglapi_Dispatch
#endif
#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\
defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
&& !defined(THREADS)
# define THREADS
#endif
#ifdef VMS
#include <GL/vms_x_fix.h>
#endif
/*
* POSIX threads. This should be your choice in the Unix world
* whenever possible. When building with POSIX threads, be sure
* to enable any compiler flags which will cause the MT-safe
* libc (if one exists) to be used when linking, as well as any
* header macros for MT-safe errno, etc. For Solaris, this is the -mt
* compiler flag. On Solaris with gcc, use -D_REENTRANT to enable
* proper compiling for MT-safe libc etc.
*/
#if defined(PTHREADS)
#include <pthread.h> /* POSIX threads headers */
typedef struct {
pthread_key_t key;
int initMagic;
} _glthread_TSD;
typedef pthread_t _glthread_Thread;
typedef pthread_mutex_t _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) \
static _glthread_Mutex name = PTHREAD_MUTEX_INITIALIZER
#define _glthread_INIT_MUTEX(name) \
pthread_mutex_init(&(name), NULL)
#define _glthread_DESTROY_MUTEX(name) \
pthread_mutex_destroy(&(name))
#define _glthread_LOCK_MUTEX(name) \
(void) pthread_mutex_lock(&(name))
#define _glthread_UNLOCK_MUTEX(name) \
(void) pthread_mutex_unlock(&(name))
#endif /* PTHREADS */
/*
* Solaris threads. Use only up to Solaris 2.4.
* Solaris 2.5 and higher provide POSIX threads.
* Be sure to compile with -mt on the Solaris compilers, or
* use -D_REENTRANT if using gcc.
*/
#ifdef SOLARIS_THREADS
#include <thread.h>
typedef struct {
thread_key_t key;
mutex_t keylock;
int initMagic;
} _glthread_TSD;
typedef thread_t _glthread_Thread;
typedef mutex_t _glthread_Mutex;
/* XXX need to really implement mutex-related macros */
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
#define _glthread_INIT_MUTEX(name) (void) name
#define _glthread_DESTROY_MUTEX(name) (void) name
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
#endif /* SOLARIS_THREADS */
/*
* Windows threads. Should work with Windows NT and 95.
* IMPORTANT: Link with multithreaded runtime library when THREADS are
* used!
*/
#ifdef WIN32_THREADS
#include <windows.h>
typedef struct {
DWORD key;
int initMagic;
} _glthread_TSD;
typedef HANDLE _glthread_Thread;
typedef CRITICAL_SECTION _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) /*static*/ _glthread_Mutex name = {0,0,0,0,0,0}
#define _glthread_INIT_MUTEX(name) InitializeCriticalSection(&name)
#define _glthread_DESTROY_MUTEX(name) DeleteCriticalSection(&name)
#define _glthread_LOCK_MUTEX(name) EnterCriticalSection(&name)
#define _glthread_UNLOCK_MUTEX(name) LeaveCriticalSection(&name)
#endif /* WIN32_THREADS */
/*
* XFree86 has its own thread wrapper, Xthreads.h
* We wrap it again for GL.
*/
#ifdef USE_XTHREADS
#include <X11/Xthreads.h>
typedef struct {
xthread_key_t key;
int initMagic;
} _glthread_TSD;
typedef xthread_t _glthread_Thread;
typedef xmutex_rec _glthread_Mutex;
#ifdef XMUTEX_INITIALIZER
#define _glthread_DECLARE_STATIC_MUTEX(name) \
static _glthread_Mutex name = XMUTEX_INITIALIZER
#else
#define _glthread_DECLARE_STATIC_MUTEX(name) \
static _glthread_Mutex name
#endif
#define _glthread_INIT_MUTEX(name) \
xmutex_init(&(name))
#define _glthread_DESTROY_MUTEX(name) \
xmutex_clear(&(name))
#define _glthread_LOCK_MUTEX(name) \
(void) xmutex_lock(&(name))
#define _glthread_UNLOCK_MUTEX(name) \
(void) xmutex_unlock(&(name))
#endif /* USE_XTHREADS */
/*
* BeOS threads. R5.x required.
*/
#ifdef BEOS_THREADS
#include <kernel/OS.h>
#include <support/TLS.h>
typedef struct {
int32 key;
int initMagic;
} _glthread_TSD;
typedef thread_id _glthread_Thread;
/* Use Benaphore, aka speeder semaphore */
typedef struct {
int32 lock;
sem_id sem;
} benaphore;
typedef benaphore _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = { 0, 0 }
#define _glthread_INIT_MUTEX(name) name.sem = create_sem(0, #name"_benaphore"), name.lock = 0
#define _glthread_DESTROY_MUTEX(name) delete_sem(name.sem), name.lock = 0
#define _glthread_LOCK_MUTEX(name) if (name.sem == 0) _glthread_INIT_MUTEX(name); \
if (atomic_add(&(name.lock), 1) >= 1) acquire_sem(name.sem)
#define _glthread_UNLOCK_MUTEX(name) if (atomic_add(&(name.lock), -1) > 1) release_sem(name.sem)
#endif /* BEOS_THREADS */
#ifndef THREADS
/*
* THREADS not defined
*/
typedef int _glthread_TSD;
typedef int _glthread_Thread;
typedef int _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
#define _glthread_INIT_MUTEX(name) (void) name
#define _glthread_DESTROY_MUTEX(name) (void) name
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
#endif /* THREADS */
/*
* Platform independent thread specific data API.
*/
extern unsigned long
_glthread_GetID(void);
extern void
_glthread_InitTSD(_glthread_TSD *);
extern void *
_glthread_GetTSD(_glthread_TSD *);
extern void
_glthread_SetTSD(_glthread_TSD *, void *);
#if defined(GLX_USE_TLS)
extern __thread struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec")));
#define GET_DISPATCH() _glapi_tls_Dispatch
#elif !defined(GL_CALL)
# if defined(THREADS)
# define GET_DISPATCH() \
((__builtin_expect( _glapi_Dispatch != NULL, 1 )) \
? _glapi_Dispatch : _glapi_get_dispatch())
# else
# define GET_DISPATCH() _glapi_Dispatch
# endif /* defined(THREADS) */
#endif /* ndef GL_CALL */
#endif /* THREADS_H */

View File

@ -52,6 +52,7 @@
#define DRI_NEW_INTERFACE_ONLY
#include "glxserver.h"
#include "glxutil.h"
#include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h"
@ -63,7 +64,6 @@
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
typedef struct __GLXDRIconfig __GLXDRIconfig;
struct __GLXDRIscreen {
__GLXscreen base;
@ -108,11 +108,6 @@ struct __GLXDRIdrawable {
#endif
};
struct __GLXDRIconfig {
__GLXconfig config;
__DRIconfig *driConfig;
};
static void
__glXDRIleaveServer(GLboolean rendering)
{
@ -797,22 +792,6 @@ getDrawableInfo(__DRIdrawable *driDrawable,
return retval;
}
static int
getUST(int64_t *ust)
{
struct timeval tv;
if (ust == NULL)
return -EFAULT;
if (gettimeofday(&tv, NULL) == 0) {
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
return 0;
} else {
return -errno;
}
}
static void __glXReportDamage(__DRIdrawable *driDraw,
int x, int y,
drm_clip_rect_t *rects, int num_rects,
@ -833,12 +812,6 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
__glXleaveServer(GL_FALSE);
}
static const __DRIsystemTimeExtension systemTimeExtension = {
{ __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
getUST,
NULL,
};
static const __DRIgetDrawableInfoExtension getDrawableInfoExtension = {
{ __DRI_GET_DRAWABLE_INFO, __DRI_GET_DRAWABLE_INFO_VERSION },
getDrawableInfo

View File

@ -29,7 +29,6 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/time.h>
#include <dlfcn.h>
#include <drm.h>
@ -47,6 +46,7 @@
#include "glxserver.h"
#include "glxutil.h"
#include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h"
@ -58,7 +58,6 @@
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
typedef struct __GLXDRIconfig __GLXDRIconfig;
struct __GLXDRIscreen {
__GLXscreen base;
@ -88,11 +87,6 @@ struct __GLXDRIdrawable {
__GLXDRIscreen *screen;
};
struct __GLXDRIconfig {
__GLXconfig config;
const __DRIconfig *driConfig;
};
static void
__glXDRIdrawableDestroy(__GLXdrawable *drawable)
{
@ -359,28 +353,6 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
return &private->base;
}
static int
getUST(int64_t *ust)
{
struct timeval tv;
if (ust == NULL)
return -EFAULT;
if (gettimeofday(&tv, NULL) == 0) {
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
return 0;
} else {
return -errno;
}
}
static const __DRIsystemTimeExtension systemTimeExtension = {
{ __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
getUST,
NULL,
};
static void dri2ReemitDrawableInfo(__DRIdrawable *draw, unsigned int *tail,
void *loaderPrivate)
{
@ -491,156 +463,6 @@ initializeExtensions(__GLXDRIscreen *screen)
}
}
#define __ATTRIB(attrib, field) \
{ attrib, offsetof(__GLXconfig, field) }
static const struct { unsigned int attrib, offset; } attribMap[] = {
__ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits),
__ATTRIB(__DRI_ATTRIB_LEVEL, level),
__ATTRIB(__DRI_ATTRIB_RED_SIZE, redBits),
__ATTRIB(__DRI_ATTRIB_GREEN_SIZE, greenBits),
__ATTRIB(__DRI_ATTRIB_BLUE_SIZE, blueBits),
__ATTRIB(__DRI_ATTRIB_ALPHA_SIZE, alphaBits),
__ATTRIB(__DRI_ATTRIB_DEPTH_SIZE, depthBits),
__ATTRIB(__DRI_ATTRIB_STENCIL_SIZE, stencilBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_RED_SIZE, accumRedBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_GREEN_SIZE, accumGreenBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_BLUE_SIZE, accumBlueBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_ALPHA_SIZE, accumAlphaBits),
__ATTRIB(__DRI_ATTRIB_SAMPLE_BUFFERS, sampleBuffers),
__ATTRIB(__DRI_ATTRIB_SAMPLES, samples),
__ATTRIB(__DRI_ATTRIB_DOUBLE_BUFFER, doubleBufferMode),
__ATTRIB(__DRI_ATTRIB_STEREO, stereoMode),
__ATTRIB(__DRI_ATTRIB_AUX_BUFFERS, numAuxBuffers),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_TYPE, transparentPixel),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_INDEX_VALUE, transparentPixel),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_RED_VALUE, transparentRed),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_GREEN_VALUE, transparentGreen),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_BLUE_VALUE, transparentBlue),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE, transparentAlpha),
__ATTRIB(__DRI_ATTRIB_FLOAT_MODE, floatMode),
__ATTRIB(__DRI_ATTRIB_RED_MASK, redMask),
__ATTRIB(__DRI_ATTRIB_GREEN_MASK, greenMask),
__ATTRIB(__DRI_ATTRIB_BLUE_MASK, blueMask),
__ATTRIB(__DRI_ATTRIB_ALPHA_MASK, alphaMask),
__ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_WIDTH, maxPbufferWidth),
__ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_HEIGHT, maxPbufferHeight),
__ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_PIXELS, maxPbufferPixels),
__ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH, optimalPbufferWidth),
__ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT, optimalPbufferHeight),
__ATTRIB(__DRI_ATTRIB_SWAP_METHOD, swapMethod),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba),
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),
__ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),
};
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
static void
setScalar(__GLXconfig *config, unsigned int attrib, unsigned int value)
{
int i;
for (i = 0; i < ARRAY_SIZE(attribMap); i++)
if (attribMap[i].attrib == attrib) {
*(unsigned int *) ((char *) config + attribMap[i].offset) = value;
return;
}
}
static __GLXconfig *
createModeFromConfig(const __DRIcoreExtension *core,
const __DRIconfig *driConfig,
unsigned int visualType)
{
__GLXDRIconfig *config;
unsigned int attrib, value;
int i;
config = xalloc(sizeof *config);
config->driConfig = driConfig;
i = 0;
while (core->indexConfigAttrib(driConfig, i++, &attrib, &value)) {
switch (attrib) {
case __DRI_ATTRIB_RENDER_TYPE:
if (value & __DRI_ATTRIB_RGBA_BIT) {
config->config.renderType |= GLX_RGBA_BIT;
config->config.rgbMode = GL_TRUE;
} else if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) {
config->config.renderType |= GLX_COLOR_INDEX_BIT;
config->config.rgbMode = GL_FALSE;
} else {
config->config.renderType = 0;
config->config.rgbMode = GL_FALSE;
}
break;
case __DRI_ATTRIB_CONFIG_CAVEAT:
if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG)
config->config.visualRating = GLX_NON_CONFORMANT_CONFIG;
else if (value & __DRI_ATTRIB_SLOW_BIT)
config->config.visualRating = GLX_SLOW_CONFIG;
else
config->config.visualRating = GLX_NONE;
break;
case __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS:
config->config.bindToTextureTargets = 0;
if (value & __DRI_ATTRIB_TEXTURE_1D_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_1D_BIT_EXT;
if (value & __DRI_ATTRIB_TEXTURE_2D_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_2D_BIT_EXT;
if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_RECTANGLE_BIT_EXT;
break;
default:
setScalar(&config->config, attrib, value);
break;
}
}
config->config.next = NULL;
config->config.xRenderable = GL_TRUE;
config->config.visualType = visualType;
config->config.drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
return &config->config;
}
__GLXconfig *
glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs);
__GLXconfig *
glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs)
{
__GLXconfig head, *tail;
int i;
tail = &head;
head.next = NULL;
for (i = 0; configs[i]; i++) {
tail->next = createModeFromConfig(core,
configs[i], GLX_TRUE_COLOR);
if (tail->next == NULL)
break;
tail = tail->next;
}
for (i = 0; configs[i]; i++) {
tail->next = createModeFromConfig(core,
configs[i], GLX_DIRECT_COLOR);
if (tail->next == NULL)
break;
tail = tail->next;
}
return head.next;
}
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{

209
glx/glxdricommon.c Normal file
View File

@ -0,0 +1,209 @@
/*
* Copyright © 2008 Red Hat, Inc
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of the
* copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdint.h>
#include <errno.h>
#include <sys/time.h>
#include <GL/gl.h>
#include <GL/glxtokens.h>
#include <GL/internal/dri_interface.h>
#include <os.h>
#include "glxserver.h"
#include "glxcontext.h"
#include "glxscreens.h"
#include "glxdricommon.h"
static int
getUST(int64_t *ust)
{
struct timeval tv;
if (ust == NULL)
return -EFAULT;
if (gettimeofday(&tv, NULL) == 0) {
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
return 0;
} else {
return -errno;
}
}
const __DRIsystemTimeExtension systemTimeExtension = {
{ __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
getUST,
NULL,
};
#define __ATTRIB(attrib, field) \
{ attrib, offsetof(__GLXconfig, field) }
static const struct { unsigned int attrib, offset; } attribMap[] = {
__ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits),
__ATTRIB(__DRI_ATTRIB_LEVEL, level),
__ATTRIB(__DRI_ATTRIB_RED_SIZE, redBits),
__ATTRIB(__DRI_ATTRIB_GREEN_SIZE, greenBits),
__ATTRIB(__DRI_ATTRIB_BLUE_SIZE, blueBits),
__ATTRIB(__DRI_ATTRIB_ALPHA_SIZE, alphaBits),
__ATTRIB(__DRI_ATTRIB_DEPTH_SIZE, depthBits),
__ATTRIB(__DRI_ATTRIB_STENCIL_SIZE, stencilBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_RED_SIZE, accumRedBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_GREEN_SIZE, accumGreenBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_BLUE_SIZE, accumBlueBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_ALPHA_SIZE, accumAlphaBits),
__ATTRIB(__DRI_ATTRIB_SAMPLE_BUFFERS, sampleBuffers),
__ATTRIB(__DRI_ATTRIB_SAMPLES, samples),
__ATTRIB(__DRI_ATTRIB_DOUBLE_BUFFER, doubleBufferMode),
__ATTRIB(__DRI_ATTRIB_STEREO, stereoMode),
__ATTRIB(__DRI_ATTRIB_AUX_BUFFERS, numAuxBuffers),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_TYPE, transparentPixel),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_INDEX_VALUE, transparentPixel),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_RED_VALUE, transparentRed),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_GREEN_VALUE, transparentGreen),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_BLUE_VALUE, transparentBlue),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE, transparentAlpha),
__ATTRIB(__DRI_ATTRIB_FLOAT_MODE, floatMode),
__ATTRIB(__DRI_ATTRIB_RED_MASK, redMask),
__ATTRIB(__DRI_ATTRIB_GREEN_MASK, greenMask),
__ATTRIB(__DRI_ATTRIB_BLUE_MASK, blueMask),
__ATTRIB(__DRI_ATTRIB_ALPHA_MASK, alphaMask),
__ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_WIDTH, maxPbufferWidth),
__ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_HEIGHT, maxPbufferHeight),
__ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_PIXELS, maxPbufferPixels),
__ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH, optimalPbufferWidth),
__ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT, optimalPbufferHeight),
__ATTRIB(__DRI_ATTRIB_SWAP_METHOD, swapMethod),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba),
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),
__ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),
};
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
static void
setScalar(__GLXconfig *config, unsigned int attrib, unsigned int value)
{
int i;
for (i = 0; i < ARRAY_SIZE(attribMap); i++)
if (attribMap[i].attrib == attrib) {
*(unsigned int *) ((char *) config + attribMap[i].offset) = value;
return;
}
}
static __GLXconfig *
createModeFromConfig(const __DRIcoreExtension *core,
const __DRIconfig *driConfig,
unsigned int visualType)
{
__GLXDRIconfig *config;
unsigned int attrib, value;
int i;
config = xalloc(sizeof *config);
config->driConfig = driConfig;
i = 0;
while (core->indexConfigAttrib(driConfig, i++, &attrib, &value)) {
switch (attrib) {
case __DRI_ATTRIB_RENDER_TYPE:
if (value & __DRI_ATTRIB_RGBA_BIT) {
config->config.renderType |= GLX_RGBA_BIT;
config->config.rgbMode = GL_TRUE;
} else if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) {
config->config.renderType |= GLX_COLOR_INDEX_BIT;
config->config.rgbMode = GL_FALSE;
} else {
config->config.renderType = 0;
config->config.rgbMode = GL_FALSE;
}
break;
case __DRI_ATTRIB_CONFIG_CAVEAT:
if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG)
config->config.visualRating = GLX_NON_CONFORMANT_CONFIG;
else if (value & __DRI_ATTRIB_SLOW_BIT)
config->config.visualRating = GLX_SLOW_CONFIG;
else
config->config.visualRating = GLX_NONE;
break;
case __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS:
config->config.bindToTextureTargets = 0;
if (value & __DRI_ATTRIB_TEXTURE_1D_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_1D_BIT_EXT;
if (value & __DRI_ATTRIB_TEXTURE_2D_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_2D_BIT_EXT;
if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_RECTANGLE_BIT_EXT;
break;
default:
setScalar(&config->config, attrib, value);
break;
}
}
config->config.next = NULL;
config->config.xRenderable = GL_TRUE;
config->config.visualType = visualType;
config->config.drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
return &config->config;
}
__GLXconfig *
glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs)
{
__GLXconfig head, *tail;
int i;
tail = &head;
head.next = NULL;
for (i = 0; configs[i]; i++) {
tail->next = createModeFromConfig(core,
configs[i], GLX_TRUE_COLOR);
if (tail->next == NULL)
break;
tail = tail->next;
}
for (i = 0; configs[i]; i++) {
tail->next = createModeFromConfig(core,
configs[i], GLX_DIRECT_COLOR);
if (tail->next == NULL)
break;
tail = tail->next;
}
return head.next;
}

40
glx/glxdricommon.h Normal file
View File

@ -0,0 +1,40 @@
/*
* Copyright © 2008 Red Hat, Inc
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of the
* copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifndef _GLX_dri_common_h
#define _GLX_dri_common_h
typedef struct __GLXDRIconfig __GLXDRIconfig;
struct __GLXDRIconfig {
__GLXconfig config;
const __DRIconfig *driConfig;
};
__GLXconfig *
glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs);
extern const __DRIsystemTimeExtension systemTimeExtension;
#endif

544
glx/glxdriswrast.c Normal file
View File

@ -0,0 +1,544 @@
/*
* Copyright © 2008 George Sapountzis <gsap7@yahoo.gr>
* Copyright © 2008 Red Hat, Inc
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of the
* copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/time.h>
#include <dlfcn.h>
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#include <GL/glxtokens.h>
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "gcstruct.h"
#include "os.h"
#include "glxserver.h"
#include "glxutil.h"
#include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h"
#include "glapi.h"
#include "glthread.h"
#include "dispatch.h"
#include "extension_string.h"
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
struct __GLXDRIscreen {
__GLXscreen base;
__DRIscreen *driScreen;
void *driver;
const __DRIcoreExtension *core;
const __DRIswrastExtension *swrast;
const __DRIcopySubBufferExtension *copySubBuffer;
const __DRItexBufferExtension *texBuffer;
};
struct __GLXDRIcontext {
__GLXcontext base;
__DRIcontext *driContext;
};
struct __GLXDRIdrawable {
__GLXdrawable base;
__DRIdrawable *driDrawable;
__GLXDRIscreen *screen;
GCPtr gc; /* scratch GC for span drawing */
GCPtr cleargc; /* GC for clearing the color buffer */
GCPtr swapgc; /* GC for swapping the color buffers */
};
static void
__glXDRIdrawableDestroy(__GLXdrawable *drawable)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
const __DRIcoreExtension *core = private->screen->core;
(*core->destroyDrawable)(private->driDrawable);
FreeScratchGC(private->gc);
FreeScratchGC(private->cleargc);
FreeScratchGC(private->swapgc);
xfree(private);
}
static GLboolean
__glXDRIdrawableResize(__GLXdrawable *drawable)
{
/* Nothing to do here, the DRI driver asks the server for drawable
* geometry appropriately. */
return GL_TRUE;
}
static GLboolean
__glXDRIdrawableSwapBuffers(__GLXdrawable *drawable)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
const __DRIcoreExtension *core = private->screen->core;
(*core->swapBuffers)(private->driDrawable);
return TRUE;
}
static void
__glXDRIdrawableCopySubBuffer(__GLXdrawable *basePrivate,
int x, int y, int w, int h)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate;
const __DRIcopySubBufferExtension *copySubBuffer =
private->screen->copySubBuffer;
if (copySubBuffer)
(*copySubBuffer->copySubBuffer)(private->driDrawable, x, y, w, h);
}
static void
__glXDRIcontextDestroy(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
(*screen->core->destroyContext)(context->driContext);
__glXContextDestroy(&context->base);
xfree(context);
}
static int
__glXDRIcontextMakeCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
static int
__glXDRIcontextLoseCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*screen->core->unbindContext)(context->driContext);
}
static int
__glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
unsigned long mask)
{
__GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst;
__GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc;
__GLXDRIscreen *screen = (__GLXDRIscreen *) dst->base.pGlxScreen;
return (*screen->core->copyContext)(dst->driContext,
src->driContext, mask);
}
static int
__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
#ifdef __DRI_TEX_BUFFER
static int
__glXDRIbindTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *glxPixmap)
{
__GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap;
const __DRItexBufferExtension *texBuffer = drawable->screen->texBuffer;
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
if (texBuffer == NULL)
return Success;
texBuffer->setTexBuffer(context->driContext,
glxPixmap->target,
drawable->driDrawable);
return Success;
}
static int
__glXDRIreleaseTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *pixmap)
{
/* FIXME: Just unbind the texture? */
return Success;
}
#else
static int
__glXDRIbindTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *glxPixmap)
{
return Success;
}
static int
__glXDRIreleaseTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *pixmap)
{
return Success;
}
#endif
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
__glXDRIbindTexImage,
__glXDRIreleaseTexImage
};
static void
__glXDRIscreenDestroy(__GLXscreen *baseScreen)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
(*screen->core->destroyScreen)(screen->driScreen);
dlclose(screen->driver);
__glXScreenDestroy(baseScreen);
xfree(screen);
}
static __GLXcontext *
__glXDRIscreenCreateContext(__GLXscreen *baseScreen,
__GLXconfig *glxConfig,
__GLXcontext *baseShareContext)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
__GLXDRIcontext *context, *shareContext;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
const __DRIcoreExtension *core = screen->core;
__DRIcontext *driShare;
shareContext = (__GLXDRIcontext *) baseShareContext;
if (shareContext)
driShare = shareContext->driContext;
else
driShare = NULL;
context = xalloc(sizeof *context);
if (context == NULL)
return NULL;
memset(context, 0, sizeof *context);
context->base.destroy = __glXDRIcontextDestroy;
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy;
context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
context->driContext =
(*core->createNewContext)(screen->driScreen,
config->driConfig, driShare, context);
return &context->base;
}
static void
glxChangeGC(GCPtr gc, BITS32 mask, CARD32 val)
{
CARD32 v[1];
v[0] = val;
dixChangeGC(NullClient, gc, mask, v, NULL);
}
static __GLXdrawable *
__glXDRIscreenCreateDrawable(__GLXscreen *screen,
DrawablePtr pDraw,
int type,
XID drawId,
__GLXconfig *glxConfig)
{
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private;
ScreenPtr pScreen = driScreen->base.pScreen;
private = xalloc(sizeof *private);
if (private == NULL)
return NULL;
memset(private, 0, sizeof *private);
private->screen = driScreen;
if (!__glXDrawableInit(&private->base, screen,
pDraw, type, drawId, glxConfig)) {
xfree(private);
return NULL;
}
private->base.destroy = __glXDRIdrawableDestroy;
private->base.resize = __glXDRIdrawableResize;
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
private->gc = CreateScratchGC(pScreen, pDraw->depth);
private->cleargc = CreateScratchGC(pScreen, pDraw->depth);
private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
glxChangeGC(private->gc, GCFunction, GXcopy);
glxChangeGC(private->cleargc, GCFunction, GXcopy);
glxChangeGC(private->swapgc, GCFunction, GXcopy);
glxChangeGC(private->swapgc, GCGraphicsExposures, FALSE);
private->driDrawable =
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
config->driConfig,
private);
return &private->base;
}
static void
swrastGetDrawableInfo(__DRIdrawable *draw,
int *x, int *y, int *w, int *h,
void *loaderPrivate)
{
__GLXDRIdrawable *drawable = loaderPrivate;
DrawablePtr pDraw = drawable->base.pDraw;
*x = pDraw->x;
*y = pDraw->x;
*w = pDraw->width;
*h = pDraw->height;
}
static void
swrastPutImage(__DRIdrawable *draw, int op,
int x, int y, int w, int h, char *data,
void *loaderPrivate)
{
__GLXDRIdrawable *drawable = loaderPrivate;
DrawablePtr pDraw = drawable->base.pDraw;
GCPtr gc;
switch (op) {
case __DRI_SWRAST_IMAGE_OP_DRAW:
gc = drawable->gc;
break;
case __DRI_SWRAST_IMAGE_OP_CLEAR:
gc = drawable->cleargc;
break;
case __DRI_SWRAST_IMAGE_OP_SWAP:
gc = drawable->swapgc;
break;
default:
return;
}
ValidateGC(pDraw, gc);
gc->ops->PutImage(pDraw, gc, pDraw->depth,
x, y, w, h, 0, ZPixmap, data);
}
static void
swrastGetImage(__DRIdrawable *draw,
int x, int y, int w, int h, char *data,
void *loaderPrivate)
{
__GLXDRIdrawable *drawable = loaderPrivate;
DrawablePtr pDraw = drawable->base.pDraw;
ScreenPtr pScreen = pDraw->pScreen;
pScreen->GetImage(pDraw, x, y, w, h, ZPixmap, ~0L, data);
}
static const __DRIswrastLoaderExtension swrastLoaderExtension = {
{ __DRI_SWRAST_LOADER, __DRI_SWRAST_LOADER_VERSION },
swrastGetDrawableInfo,
swrastPutImage,
swrastGetImage
};
static const __DRIextension *loader_extensions[] = {
&systemTimeExtension.base,
&swrastLoaderExtension.base,
NULL
};
static void
initializeExtensions(__GLXDRIscreen *screen)
{
const __DRIextension **extensions;
int i;
extensions = screen->core->getExtensions(screen->driScreen);
for (i = 0; extensions[i]; i++) {
#ifdef __DRI_COPY_SUB_BUFFER
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
screen->copySubBuffer =
(const __DRIcopySubBufferExtension *) extensions[i];
/* GLX_MESA_copy_sub_buffer is always enabled. */
}
#endif
#ifdef __DRI_TEX_BUFFER
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
screen->texBuffer =
(const __DRItexBufferExtension *) extensions[i];
/* GLX_EXT_texture_from_pixmap is always enabled. */
}
#endif
/* Ignore unknown extensions */
}
}
static const char dri_driver_path[] = DRI_DRIVER_PATH;
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
const char *driverName = "swrast";
__GLXDRIscreen *screen;
char filename[128];
const __DRIextension **extensions;
const __DRIconfig **driConfigs;
int i;
screen = xalloc(sizeof *screen);
if (screen == NULL)
return NULL;
memset(screen, 0, sizeof *screen);
screen->base.destroy = __glXDRIscreenDestroy;
screen->base.createContext = __glXDRIscreenCreateContext;
screen->base.createDrawable = __glXDRIscreenCreateDrawable;
screen->base.swapInterval = NULL;
screen->base.pScreen = pScreen;
snprintf(filename, sizeof filename,
"%s/%s_dri.so", dri_driver_path, driverName);
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
if (screen->driver == NULL) {
LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
filename, dlerror());
goto handle_error;
}
extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
if (extensions == NULL) {
LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
driverName, dlerror());
goto handle_error;
}
for (i = 0; extensions[i]; i++) {
if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
extensions[i]->version >= __DRI_CORE_VERSION) {
screen->core = (const __DRIcoreExtension *) extensions[i];
}
if (strcmp(extensions[i]->name, __DRI_SWRAST) == 0 &&
extensions[i]->version >= __DRI_SWRAST_VERSION) {
screen->swrast = (const __DRIswrastExtension *) extensions[i];
}
}
if (screen->core == NULL || screen->swrast == NULL) {
LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n",
driverName);
goto handle_error;
}
screen->driScreen =
(*screen->swrast->createNewScreen)(pScreen->myNum,
loader_extensions,
&driConfigs,
screen);
if (screen->driScreen == NULL) {
LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed");
goto handle_error;
}
initializeExtensions(screen);
screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs);
__glXScreenInit(&screen->base, pScreen);
LogMessage(X_INFO,
"AIGLX: Loaded and initialized %s\n", filename);
return &screen->base;
handle_error:
if (screen->driver)
dlclose(screen->driver);
xfree(screen);
FatalError("GLX: could not load software renderer\n");
return NULL;
}
__GLXprovider __glXDRISWRastProvider = {
__glXDRIscreenProbe,
"DRISWRAST",
NULL
};

View File

@ -420,10 +420,13 @@ findFirstSet(unsigned int v)
static void
initGlxVisual(VisualPtr visual, __GLXconfig *config)
{
int maxBits;
maxBits = max(config->redBits, max(config->greenBits, config->blueBits));
config->visualID = visual->vid;
visual->class = glxConvertToXVisualType(config->visualType);
visual->bitsPerRGBValue = config->redBits;
visual->ColormapEntries = 1 << config->redBits;
visual->bitsPerRGBValue = maxBits;
visual->ColormapEntries = 1 << maxBits;
visual->nplanes = config->redBits + config->greenBits + config->blueBits;
visual->redMask = config->redMask;

View File

@ -42,13 +42,7 @@
#include <string.h>
#include "glxserver.h"
#include <GL/glxtokens.h>
#include <unpack.h>
#include <pixmapstr.h>
#include <windowstr.h>
#include "glxutil.h"
#include "GL/internal/glcore.h"
#include "GL/glxint.h"
/************************************************************************/
/* Context stuff */

5889
glx/indirect_dispatch.c Normal file

File diff suppressed because it is too large Load Diff

1047
glx/indirect_dispatch.h Normal file

File diff suppressed because it is too large Load Diff

6051
glx/indirect_dispatch_swap.c Normal file

File diff suppressed because it is too large Load Diff

832
glx/indirect_reqsize.c Normal file
View File

@ -0,0 +1,832 @@
/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
/*
* (C) Copyright IBM Corporation 2005
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* IBM,
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <GL/gl.h>
#include "glxserver.h"
#include "glxbyteorder.h"
#include "indirect_size.h"
#include "indirect_reqsize.h"
#define __GLX_PAD(x) (((x) + 3) & ~3)
#if defined(__CYGWIN__) || defined(__MINGW32__)
# undef HAVE_ALIAS
#endif
#ifdef HAVE_ALIAS
# define ALIAS2(from,to) \
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
__attribute__ ((alias( # to )));
# define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )
#else
# define ALIAS(from,to) \
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
{ return __glX ## to ## ReqSize( pc, swap ); }
#endif
int
__glXCallListsReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 0);
GLenum type = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
n = bswap_32(n);
type = bswap_32(type);
}
compsize = __glCallLists_size(type);
return __GLX_PAD((compsize * n));
}
int
__glXBitmapReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLsizei width = *(GLsizei *) (pc + 20);
GLsizei height = *(GLsizei *) (pc + 24);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
width = bswap_32(width);
height = bswap_32(height);
}
return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXFogfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 0);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glFogfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXLightfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glLightfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXLightModelfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 0);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glLightModelfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXMaterialfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glMaterialfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXPolygonStippleReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
}
return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, 32, 32, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexParameterfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glTexParameterfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXTexImage1DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 32);
GLenum format = *(GLenum *) (pc + 44);
GLenum type = *(GLenum *) (pc + 48);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexImage2DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 32);
GLsizei height = *(GLsizei *) (pc + 36);
GLenum format = *(GLenum *) (pc + 44);
GLenum type = *(GLenum *) (pc + 48);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexEnvfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glTexEnvfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXTexGendvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glTexGendv_size(pname);
return __GLX_PAD((compsize * 8));
}
int
__glXTexGenfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glTexGenfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXPixelMapfvReqSize(const GLbyte *pc, Bool swap)
{
GLsizei mapsize = *(GLsizei *) (pc + 4);
if (swap) {
mapsize = bswap_32(mapsize);
}
return __GLX_PAD((mapsize * 4));
}
int
__glXPixelMapusvReqSize(const GLbyte *pc, Bool swap)
{
GLsizei mapsize = *(GLsizei *) (pc + 4);
if (swap) {
mapsize = bswap_32(mapsize);
}
return __GLX_PAD((mapsize * 2));
}
int
__glXDrawPixelsReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLsizei width = *(GLsizei *) (pc + 20);
GLsizei height = *(GLsizei *) (pc + 24);
GLenum format = *(GLenum *) (pc + 28);
GLenum type = *(GLenum *) (pc + 32);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
width = bswap_32(width);
height = bswap_32(height);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, 0, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 0);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 4) + (n * 4));
}
int
__glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 36);
GLenum format = *(GLenum *) (pc + 44);
GLenum type = *(GLenum *) (pc + 48);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 36);
GLsizei height = *(GLsizei *) (pc + 40);
GLenum format = *(GLenum *) (pc + 44);
GLenum type = *(GLenum *) (pc + 48);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXColorTableReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 28);
GLenum format = *(GLenum *) (pc + 32);
GLenum type = *(GLenum *) (pc + 36);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glColorTableParameterfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXColorSubTableReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei count = *(GLsizei *) (pc + 28);
GLenum format = *(GLenum *) (pc + 32);
GLenum type = *(GLenum *) (pc + 36);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
count = bswap_32(count);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, count, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 28);
GLenum format = *(GLenum *) (pc + 36);
GLenum type = *(GLenum *) (pc + 40);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 28);
GLsizei height = *(GLsizei *) (pc + 32);
GLenum format = *(GLenum *) (pc + 36);
GLenum type = *(GLenum *) (pc + 40);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glConvolutionParameterfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXTexImage3DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = *(GLint *) (pc + 8);
GLint skip_rows = *(GLint *) (pc + 16);
GLint skip_images = *(GLint *) (pc + 20);
GLint alignment = *(GLint *) (pc + 32);
GLenum target = *(GLenum *) (pc + 36);
GLsizei width = *(GLsizei *) (pc + 48);
GLsizei height = *(GLsizei *) (pc + 52);
GLsizei depth = *(GLsizei *) (pc + 56);
GLenum format = *(GLenum *) (pc + 68);
GLenum type = *(GLenum *) (pc + 72);
if (swap) {
row_length = bswap_32(row_length);
image_height = bswap_32(image_height);
skip_rows = bswap_32(skip_rows);
skip_images = bswap_32(skip_images);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
depth = bswap_32(depth);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, depth,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = *(GLint *) (pc + 8);
GLint skip_rows = *(GLint *) (pc + 16);
GLint skip_images = *(GLint *) (pc + 20);
GLint alignment = *(GLint *) (pc + 32);
GLenum target = *(GLenum *) (pc + 36);
GLsizei width = *(GLsizei *) (pc + 60);
GLsizei height = *(GLsizei *) (pc + 64);
GLsizei depth = *(GLsizei *) (pc + 68);
GLenum format = *(GLenum *) (pc + 76);
GLenum type = *(GLenum *) (pc + 80);
if (swap) {
row_length = bswap_32(row_length);
image_height = bswap_32(image_height);
skip_rows = bswap_32(skip_rows);
skip_images = bswap_32(skip_images);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
depth = bswap_32(depth);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, depth,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei imageSize = *(GLsizei *) (pc + 20);
if (swap) {
imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
__glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei imageSize = *(GLsizei *) (pc + 24);
if (swap) {
imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
__glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei imageSize = *(GLsizei *) (pc + 28);
if (swap) {
imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
__glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei imageSize = *(GLsizei *) (pc + 36);
if (swap) {
imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
__glXProgramStringARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei len = *(GLsizei *) (pc + 8);
if (swap) {
len = bswap_32(len);
}
return __GLX_PAD(len);
}
int
__glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 0);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 4));
}
int
__glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 0);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glPointParameterfvEXT_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLuint num = *(GLuint *) (pc + 8);
if (swap) {
num = bswap_32(num);
}
return __GLX_PAD((num * 32));
}
int
__glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap)
{
GLuint num = *(GLuint *) (pc + 8);
if (swap) {
num = bswap_32(num);
}
return __GLX_PAD((num * 16));
}
int
__glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 8));
}
int
__glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 16));
}
int
__glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 24));
}
int
__glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 12));
}
int
__glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 6));
}
int
__glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 32));
}
int
__glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei len = *(GLsizei *) (pc + 4);
if (swap) {
len = bswap_32(len);
}
return __GLX_PAD(len);
}
ALIAS(Fogiv, Fogfv)
ALIAS(Lightiv, Lightfv)
ALIAS(LightModeliv, LightModelfv)
ALIAS(Materialiv, Materialfv)
ALIAS(TexParameteriv, TexParameterfv)
ALIAS(TexEnviv, TexEnvfv)
ALIAS(TexGeniv, TexGenfv)
ALIAS(PixelMapuiv, PixelMapfv)
ALIAS(ColorTableParameteriv, ColorTableParameterfv)
ALIAS(ConvolutionParameteriv, ConvolutionParameterfv)
ALIAS(CompressedTexSubImage1DARB, CompressedTexImage1DARB)
ALIAS(CompressedTexSubImage2DARB, CompressedTexImage3DARB)
ALIAS(LoadProgramNV, ProgramStringARB)
ALIAS(RequestResidentProgramsNV, DrawBuffersARB)
ALIAS(VertexAttribs1fvNV, PixelMapfv)
ALIAS(VertexAttribs1svNV, PixelMapusv)
ALIAS(VertexAttribs2fvNV, VertexAttribs1dvNV)
ALIAS(VertexAttribs2svNV, PixelMapfv)
ALIAS(VertexAttribs4fvNV, VertexAttribs2dvNV)
ALIAS(VertexAttribs4svNV, VertexAttribs1dvNV)
ALIAS(VertexAttribs4ubvNV, PixelMapfv)
ALIAS(PointParameterivNV, PointParameterfvEXT)
ALIAS(ProgramNamedParameter4dvNV, CompressedTexSubImage3DARB)
ALIAS(DeleteFramebuffersEXT, DrawBuffersARB)
ALIAS(DeleteRenderbuffersEXT, DrawBuffersARB)

121
glx/indirect_reqsize.h Normal file
View File

@ -0,0 +1,121 @@
/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
/*
* (C) Copyright IBM Corporation 2005
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* IBM,
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#if !defined( _INDIRECT_REQSIZE_H_ )
# define _INDIRECT_REQSIZE_H_
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
# define HIDDEN __attribute__((visibility("hidden")))
# else
# define HIDDEN
# endif
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define PURE __attribute__((pure))
# else
# define PURE
# endif
extern PURE HIDDEN int __glXCallListsReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXBitmapReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXFogfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXFogivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXLightfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXLightivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXLightModelfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXLightModelivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXMaterialfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXMaterialivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXPolygonStippleReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexParameterfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexParameterivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexImage1DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexImage2DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexEnvfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexEnvivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexGendvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexGenfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexGenivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXMap1dReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXMap1fReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXMap2dReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXMap2fReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXPixelMapfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXPixelMapuivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXPixelMapusvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXDrawPixelsReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXDrawArraysReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXColorTableReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXColorTableParameterivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXColorSubTableReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexImage3DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXCompressedTexSubImage1DARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXProgramStringARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXLoadProgramNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXRequestResidentProgramsNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs1fvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs1svNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs2fvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs2svNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXPointParameterivNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXProgramNamedParameter4dvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXDeleteFramebuffersEXTReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte *pc, Bool swap);
# undef HIDDEN
# undef PURE
#endif /* !defined( _INDIRECT_REQSIZE_H_ ) */

88
glx/indirect_size.h Normal file
View File

@ -0,0 +1,88 @@
/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
/*
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* IBM,
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#if !defined( _INDIRECT_SIZE_H_ )
# define _INDIRECT_SIZE_H_
/**
* \file
* Prototypes for functions used to determine the number of data elements in
* various GLX protocol messages.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define PURE __attribute__((pure))
# else
# define PURE
# endif
# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
# define FASTCALL __attribute__((fastcall))
# else
# define FASTCALL
# endif
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
# define INTERNAL __attribute__((visibility("internal")))
# else
# define INTERNAL
# endif
extern INTERNAL PURE FASTCALL GLint __glCallLists_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glFogfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glFogiv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glLightfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glLightiv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glLightModelfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glLightModeliv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glMaterialfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glMaterialiv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glTexParameterfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glTexParameteriv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glTexEnvfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glTexEnviv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glTexGendv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glTexGenfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glTexGeniv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glMap1d_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glMap1f_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glMap2d_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glMap2f_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glColorTableParameterfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glColorTableParameteriv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glConvolutionParameterfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glConvolutionParameteriv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glPointParameterfvEXT_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glPointParameterivNV_size(GLenum);
# undef PURE
# undef FASTCALL
# undef INTERNAL
#endif /* !defined( _INDIRECT_SIZE_H_ ) */

1210
glx/indirect_size_get.c Normal file

File diff suppressed because it is too large Load Diff

102
glx/indirect_size_get.h Normal file
View File

@ -0,0 +1,102 @@
/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
/*
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* IBM,
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#if !defined( _INDIRECT_SIZE_GET_H_ )
# define _INDIRECT_SIZE_GET_H_
/**
* \file
* Prototypes for functions used to determine the number of data elements in
* various GLX protocol messages.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define PURE __attribute__((pure))
# else
# define PURE
# endif
# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
# define FASTCALL __attribute__((fastcall))
# else
# define FASTCALL
# endif
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
# define INTERNAL __attribute__((visibility("internal")))
# else
# define INTERNAL
# endif
extern INTERNAL PURE FASTCALL GLint __glGetBooleanv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetDoublev_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetFloatv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetIntegerv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetLightfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetLightiv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetMaterialfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetMaterialiv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetTexEnvfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetTexEnviv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetTexGendv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetTexGenfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetTexGeniv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetTexParameterfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetTexParameteriv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetTexLevelParameterfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetTexLevelParameteriv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameterfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameteriv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint
__glGetConvolutionParameterfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint
__glGetConvolutionParameteriv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetHistogramParameterfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetHistogramParameteriv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetMinmaxParameterfv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetMinmaxParameteriv_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribivARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectivARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectuivARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetQueryivARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetProgramivNV_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvNV_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvNV_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribivNV_size(GLenum);
extern INTERNAL PURE FASTCALL GLint
__glGetFramebufferAttachmentParameterivEXT_size(GLenum);
# undef PURE
# undef FASTCALL
# undef INTERNAL
#endif /* !defined( _INDIRECT_SIZE_GET_H_ ) */

1596
glx/indirect_table.c Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More