mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-03 14:48:03 +02:00
initial commits to branch of fb, render, and GLX changes for Xgl some of
the GLX changes stop X.org server from working
This commit is contained in:
parent
e70b64b930
commit
198ea994a2
44 changed files with 2310 additions and 660 deletions
|
|
@ -1,10 +1,3 @@
|
|||
2006-01-18 Dave Airlie <airlied@linux.ie>
|
||||
|
||||
Update XGL server from the xserver tree, and fix to work
|
||||
in X.org tree (look out for a branch appearing RSN),
|
||||
Most of the changes are from David Reveman @ Novell
|
||||
and the rest are from either myself or Eric Anholt.
|
||||
|
||||
2006-01-18 Dave Airlie <airlied@linux.ie>
|
||||
|
||||
* Xext/Makefile.am:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ AM_CFLAGS = \
|
|||
-I@MESA_SOURCE@/src/mesa/main \
|
||||
@SERVER_DEFINES@ \
|
||||
@MODULE_DEFINES@ \
|
||||
@LOADER_DEFINES@
|
||||
@LOADER_DEFINES@ -DUSE_MGL_NAMESPACE
|
||||
|
||||
# none yet
|
||||
#sdk_HEADERS =
|
||||
|
|
|
|||
342
GL/glx/glxcmds.c
342
GL/glx/glxcmds.c
|
|
@ -59,6 +59,11 @@
|
|||
|
||||
/************************************************************************/
|
||||
|
||||
void GlxSetRenderTables (struct _glapi_table *table)
|
||||
{
|
||||
_glapi_set_dispatch(table);
|
||||
}
|
||||
|
||||
static __GLimports imports = {
|
||||
__glXImpMalloc,
|
||||
__glXImpCalloc,
|
||||
|
|
@ -1211,11 +1216,29 @@ int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual,
|
|||
|
||||
pGlxPixmap->modes = modes;
|
||||
|
||||
/*
|
||||
** Allocate buffers.
|
||||
*/
|
||||
pGlxPixmap->glxPriv = __glXCreateDrawablePrivate (pDraw, glxpixmapId,
|
||||
modes);
|
||||
if (!pGlxPixmap->glxPriv)
|
||||
{
|
||||
FreeResource(glxpixmapId, FALSE);
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
__glXRefDrawablePrivate (pGlxPixmap->glxPriv);
|
||||
/*
|
||||
** Bump the ref count on the X pixmap so it won't disappear.
|
||||
*/
|
||||
((PixmapPtr) pDraw)->refcnt++;
|
||||
|
||||
/*
|
||||
** XXX: Reset refcnt. Ignores references to this pixmap made by
|
||||
** __glXCreateDrawablePrivate. Need to fix this.
|
||||
*/
|
||||
pGlxPixmap->refcnt = 0;
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
@ -1319,6 +1342,7 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
|
|||
if (!glxc) {
|
||||
return __glXBadContextTag;
|
||||
}
|
||||
#if 0 //XGL
|
||||
/*
|
||||
** The calling thread is swapping its current drawable. In this case,
|
||||
** glxSwapBuffers is in both GL and X streams, in terms of
|
||||
|
|
@ -1334,6 +1358,7 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
|
|||
} else {
|
||||
return error;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (pDraw) {
|
||||
|
|
@ -1409,9 +1434,289 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int __glXGetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXGetDrawableAttributesReply reply;
|
||||
ClientPtr client = cl->client;
|
||||
GLXDrawable drawId;
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
int numAttribs;
|
||||
int sendBuf[2];
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = *((GLXDrawable *) (pc));
|
||||
|
||||
glxPriv = __glXFindDrawablePrivate (drawId);
|
||||
if (!glxPriv)
|
||||
{
|
||||
client->errorValue = drawId;
|
||||
return __glXBadDrawable;
|
||||
}
|
||||
|
||||
numAttribs = 1; /* XXX: Only GLX_TEXTURE_TARGET_EXT right now */
|
||||
reply.length = numAttribs << 1;
|
||||
reply.type = X_Reply;
|
||||
reply.sequenceNumber = client->sequence;
|
||||
reply.numAttribs = numAttribs;
|
||||
|
||||
sendBuf[0] = GLX_TEXTURE_TARGET_EXT;
|
||||
sendBuf[1] = (int) (glxPriv->texTarget);
|
||||
|
||||
if (client->swapped)
|
||||
{
|
||||
__glXSwapGetDrawableAttributesReply (client, &reply, sendBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteToClient (client, sz_xGLXGetDrawableAttributesReply,
|
||||
(char *) &reply);
|
||||
WriteToClient (client, sizeof (sendBuf), (char *) sendBuf);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXBindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
||||
ClientPtr client = cl->client;
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
__GLXcontext *cx;
|
||||
GLXDrawable drawId;
|
||||
int buffer;
|
||||
int error;
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = *((CARD32 *) (pc));
|
||||
buffer = *((INT32 *) (pc + 4));
|
||||
|
||||
cx = __glXForceCurrent (cl, req->contextTag, &error);
|
||||
if (!cx)
|
||||
return error;
|
||||
|
||||
glxPriv = __glXFindDrawablePrivate (drawId);
|
||||
if (!glxPriv)
|
||||
{
|
||||
client->errorValue = drawId;
|
||||
return __glXBadDrawable;
|
||||
}
|
||||
|
||||
return (*glxPriv->bindBuffers) (glxPriv, buffer);
|
||||
}
|
||||
|
||||
int __glXReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
||||
ClientPtr client = cl->client;
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
__GLXcontext *cx;
|
||||
GLXDrawable drawId;
|
||||
int buffer;
|
||||
int error;
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = *((CARD32 *) (pc));
|
||||
buffer = *((INT32 *) (pc + 4));
|
||||
|
||||
cx = __glXForceCurrent (cl, req->contextTag, &error);
|
||||
if (!cx)
|
||||
return error;
|
||||
|
||||
glxPriv = __glXFindDrawablePrivate (drawId);
|
||||
if (!glxPriv)
|
||||
{
|
||||
client->errorValue = drawId;
|
||||
return __glXBadDrawable;
|
||||
}
|
||||
|
||||
return (*glxPriv->releaseBuffers) (glxPriv, buffer);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
static int
|
||||
__glXRenderBeginEnd (__GLXclientState *cl,
|
||||
int *commandsDone,
|
||||
GLbyte **ppc,
|
||||
int *pleft)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
int left, cmdlen;
|
||||
CARD16 opcode;
|
||||
__GLXrenderHeader *hdr;
|
||||
GLbyte *pc;
|
||||
__GLXrenderSizeData *entry;
|
||||
int extra;
|
||||
void (*proc) (GLbyte *);
|
||||
|
||||
pc = *ppc;
|
||||
left = *pleft;
|
||||
opcode = 0;
|
||||
|
||||
while (left > 0 && opcode != X_GLrop_End)
|
||||
{
|
||||
/*
|
||||
** Verify that the header length and the overall length agree.
|
||||
** Also, each command must be word aligned.
|
||||
*/
|
||||
hdr = (__GLXrenderHeader *) pc;
|
||||
cmdlen = hdr->length;
|
||||
opcode = hdr->opcode;
|
||||
|
||||
/*
|
||||
** Check for core opcodes and grab entry data.
|
||||
*/
|
||||
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
|
||||
entry = &__glXRenderSizeTable[opcode];
|
||||
proc = __glXRenderTable[opcode];
|
||||
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
||||
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
|
||||
entry =
|
||||
&__glXRenderSizeTable_EXT[opcode -
|
||||
__GLX_MIN_RENDER_OPCODE_EXT];
|
||||
proc = __glXRenderTable_EXT[opcode -
|
||||
__GLX_MIN_RENDER_OPCODE_EXT];
|
||||
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
|
||||
} else {
|
||||
client->errorValue = *commandsDone;
|
||||
cl->beBufLen = 0;
|
||||
return __glXBadRenderRequest;
|
||||
}
|
||||
|
||||
if (!entry->bytes) {
|
||||
/* unused opcode */
|
||||
client->errorValue = *commandsDone;
|
||||
cl->beBufLen = 0;
|
||||
return __glXBadRenderRequest;
|
||||
}
|
||||
if (entry->varsize) {
|
||||
/* variable size command */
|
||||
extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, False);
|
||||
if (extra < 0) {
|
||||
extra = 0;
|
||||
}
|
||||
if (cmdlen != __GLX_PAD(entry->bytes + extra)) {
|
||||
cl->beBufLen = 0;
|
||||
return BadLength;
|
||||
}
|
||||
} else {
|
||||
/* constant size command */
|
||||
if (cmdlen != __GLX_PAD(entry->bytes)) {
|
||||
cl->beBufLen = 0;
|
||||
return BadLength;
|
||||
}
|
||||
}
|
||||
if (left < cmdlen) {
|
||||
cl->beBufLen = 0;
|
||||
return BadLength;
|
||||
}
|
||||
|
||||
(*commandsDone)++;
|
||||
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
}
|
||||
|
||||
if (opcode == X_GLrop_End)
|
||||
{
|
||||
pc = cl->beBuf;
|
||||
left = cl->beBufLen;
|
||||
opcode = 0;
|
||||
|
||||
while (left > 0 && opcode != X_GLrop_End)
|
||||
{
|
||||
hdr = (__GLXrenderHeader *) pc;
|
||||
cmdlen = hdr->length;
|
||||
opcode = hdr->opcode;
|
||||
|
||||
if ((opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE))
|
||||
{
|
||||
entry = &__glXRenderSizeTable[opcode];
|
||||
proc = __glXRenderTable[opcode];
|
||||
}
|
||||
|
||||
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
||||
else
|
||||
{
|
||||
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
||||
|
||||
entry = &__glXRenderSizeTable_EXT[index];
|
||||
proc = __glXRenderTable_EXT[index];
|
||||
}
|
||||
#endif
|
||||
|
||||
(*proc) (pc + __GLX_RENDER_HDR_SIZE);
|
||||
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
}
|
||||
|
||||
cl->beBufLen = 0;
|
||||
|
||||
pc = *ppc;
|
||||
left = *pleft;
|
||||
opcode = 0;
|
||||
|
||||
while (opcode != X_GLrop_End)
|
||||
{
|
||||
hdr = (__GLXrenderHeader *) pc;
|
||||
cmdlen = hdr->length;
|
||||
opcode = hdr->opcode;
|
||||
|
||||
if ((opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE))
|
||||
{
|
||||
entry = &__glXRenderSizeTable[opcode];
|
||||
proc = __glXRenderTable[opcode];
|
||||
}
|
||||
|
||||
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
||||
else
|
||||
{
|
||||
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
||||
entry = &__glXRenderSizeTable_EXT[index];
|
||||
proc = __glXRenderTable_EXT[index];
|
||||
}
|
||||
#endif
|
||||
|
||||
(*proc) (pc + __GLX_RENDER_HDR_SIZE);
|
||||
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int size;
|
||||
|
||||
size = pc - *ppc;
|
||||
if (cl->beBufSize < cl->beBufLen + size)
|
||||
{
|
||||
cl->beBuf = (GLbyte *) Xrealloc (cl->beBuf, cl->beBufLen + size);
|
||||
if (!cl->beBuf)
|
||||
cl->beBufLen = size = 0;
|
||||
|
||||
cl->beBufSize = cl->beBufLen + size;
|
||||
}
|
||||
|
||||
if (size)
|
||||
memcpy (cl->beBuf + cl->beBufLen, *ppc, size);
|
||||
|
||||
cl->beBufLen += size;
|
||||
}
|
||||
|
||||
*ppc = pc;
|
||||
*pleft = left;
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
** Render and Renderlarge are not in the GLX API. They are used by the GLX
|
||||
** client library to send batches of GL rendering commands.
|
||||
|
|
@ -1503,17 +1808,26 @@ int __glXRender(__GLXclientState *cl, GLbyte *pc)
|
|||
return BadLength;
|
||||
}
|
||||
|
||||
/*
|
||||
** Skip over the header and execute the command. We allow the
|
||||
** caller to trash the command memory. This is useful especially
|
||||
** for things that require double alignment - they can just shift
|
||||
** the data towards lower memory (trashing the header) by 4 bytes
|
||||
** and achieve the required alignment.
|
||||
*/
|
||||
(*proc)(pc + __GLX_RENDER_HDR_SIZE);
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
commandsDone++;
|
||||
if (opcode == X_GLrop_Begin || cl->beBufLen > 0)
|
||||
{
|
||||
error = __glXRenderBeginEnd (cl, &commandsDone, &pc, &left);
|
||||
if (error != Success)
|
||||
return error;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
** Skip over the header and execute the command. We allow the
|
||||
** caller to trash the command memory. This is useful especially
|
||||
** for things that require double alignment - they can just shift
|
||||
** the data towards lower memory (trashing the header) by 4 bytes
|
||||
** and achieve the required alignment.
|
||||
*/
|
||||
(*proc)(pc + __GLX_RENDER_HDR_SIZE);
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
commandsDone++;
|
||||
}
|
||||
}
|
||||
__GLX_NOTE_UNFLUSHED_CMDS(glxc);
|
||||
return Success;
|
||||
|
|
@ -1983,6 +2297,10 @@ int __glXVendorPrivate(__GLXclientState *cl, GLbyte *pc)
|
|||
return Success;
|
||||
case X_GLXvop_BindSwapBarrierSGIX:
|
||||
return __glXBindSwapBarrierSGIX(cl, pc);
|
||||
case X_GLXvop_BindTexImageMESA:
|
||||
return __glXBindTexImageEXT(cl, pc);
|
||||
case X_GLXvop_ReleaseTexImageMESA:
|
||||
return __glXReleaseTexImageEXT(cl, pc);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -2028,6 +2346,8 @@ int __glXVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
|
|||
return __glXCreateContextWithConfigSGIX(cl, pc);
|
||||
case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
|
||||
return __glXCreateGLXPixmapWithConfigSGIX(cl, pc);
|
||||
case X_GLXvop_GetDrawableAttributesSGIX:
|
||||
return __glXGetDrawableAttributesSGIX(cl, pc);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -389,6 +389,66 @@ int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
|
|||
return __glXQueryContextInfoEXT(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapGetDrawableAttributesSGIX(__GLXclientState *cl, char *pc)
|
||||
{
|
||||
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
||||
GLXDrawable *drawId;
|
||||
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = ((GLXDrawable *) (pc));
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
__GLX_SWAP_INT(drawId);
|
||||
|
||||
return __glXGetDrawableAttributesSGIX(cl, (GLbyte *)pc);
|
||||
}
|
||||
|
||||
int __glXSwapBindTexImageEXT(__GLXclientState *cl, GLchar *pc)
|
||||
{
|
||||
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
||||
GLXDrawable *drawId;
|
||||
int *buffer;
|
||||
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = ((GLXDrawable *) (pc));
|
||||
buffer = ((int *) (pc + 4));
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
__GLX_SWAP_INT(drawId);
|
||||
__GLX_SWAP_INT(buffer);
|
||||
|
||||
return __glXBindTexImageEXT(cl, (GLbyte *)pc);
|
||||
}
|
||||
|
||||
int __glXSwapReleaseTexImageEXT(__GLXclientState *cl, GLchar *pc)
|
||||
{
|
||||
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
||||
GLXDrawable *drawId;
|
||||
int *buffer;
|
||||
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
|
||||
drawId = ((GLXDrawable *) (pc));
|
||||
buffer = ((int *) (pc + 4));
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
__GLX_SWAP_INT(drawId);
|
||||
__GLX_SWAP_INT(buffer);
|
||||
|
||||
return __glXReleaseTexImageEXT(cl, (GLbyte *)pc);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
|
|
@ -463,9 +523,199 @@ void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXT
|
|||
WriteToClient(client, length << 2, (char *)buf);
|
||||
}
|
||||
|
||||
void __glXSwapGetDrawableAttributesReply(ClientPtr client, xGLXGetDrawableAttributesReply *reply, int *buf)
|
||||
{
|
||||
int length = reply->length;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
||||
__GLX_SWAP_INT(&reply->length);
|
||||
__GLX_SWAP_INT(&reply->numAttribs);
|
||||
WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *)reply);
|
||||
__GLX_SWAP_INT_ARRAY((int *)buf, length);
|
||||
WriteToClient(client, length << 2, (char *)buf);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
static int
|
||||
__glXSwapRenderBeginEnd (__GLXclientState *cl,
|
||||
int *commandsDone,
|
||||
GLbyte **ppc,
|
||||
int *pleft)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
int left, cmdlen;
|
||||
CARD16 opcode;
|
||||
__GLXrenderHeader *hdr;
|
||||
GLbyte *pc;
|
||||
__GLXrenderSizeData *entry;
|
||||
int extra;
|
||||
void (*proc) (GLbyte *);
|
||||
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
pc = *ppc;
|
||||
left = *pleft;
|
||||
opcode = 0;
|
||||
|
||||
while (left > 0 && opcode != X_GLrop_End)
|
||||
{
|
||||
/*
|
||||
** Verify that the header length and the overall length agree.
|
||||
** Also, each command must be word aligned.
|
||||
*/
|
||||
hdr = (__GLXrenderHeader *) pc;
|
||||
__GLX_SWAP_SHORT(&hdr->length);
|
||||
__GLX_SWAP_SHORT(&hdr->opcode);
|
||||
cmdlen = hdr->length;
|
||||
opcode = hdr->opcode;
|
||||
|
||||
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
|
||||
entry = &__glXRenderSizeTable[opcode];
|
||||
proc = __glXSwapRenderTable[opcode];
|
||||
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
||||
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
|
||||
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
||||
entry = &__glXRenderSizeTable_EXT[index];
|
||||
proc = __glXSwapRenderTable_EXT[index];
|
||||
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
|
||||
} else {
|
||||
client->errorValue = *commandsDone;
|
||||
cl->beBufLen = 0;
|
||||
return __glXBadRenderRequest;
|
||||
}
|
||||
|
||||
if (!entry->bytes) {
|
||||
/* unused opcode */
|
||||
client->errorValue = *commandsDone;
|
||||
cl->beBufLen = 0;
|
||||
return __glXBadRenderRequest;
|
||||
}
|
||||
if (entry->varsize) {
|
||||
/* variable size command */
|
||||
extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True);
|
||||
if (extra < 0) {
|
||||
extra = 0;
|
||||
}
|
||||
if (cmdlen != __GLX_PAD(entry->bytes + extra)) {
|
||||
cl->beBufLen = 0;
|
||||
return BadLength;
|
||||
}
|
||||
} else {
|
||||
/* constant size command */
|
||||
if (cmdlen != __GLX_PAD(entry->bytes)) {
|
||||
cl->beBufLen = 0;
|
||||
return BadLength;
|
||||
}
|
||||
}
|
||||
if (left < cmdlen) {
|
||||
cl->beBufLen = 0;
|
||||
return BadLength;
|
||||
}
|
||||
|
||||
(*commandsDone)++;
|
||||
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
}
|
||||
|
||||
if (opcode == X_GLrop_End)
|
||||
{
|
||||
pc = cl->beBuf;
|
||||
left = cl->beBufLen;
|
||||
opcode = 0;
|
||||
|
||||
while (left > 0 && opcode != X_GLrop_End)
|
||||
{
|
||||
hdr = (__GLXrenderHeader *) pc;
|
||||
cmdlen = hdr->length;
|
||||
opcode = hdr->opcode;
|
||||
|
||||
if ((opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE))
|
||||
{
|
||||
entry = &__glXRenderSizeTable[opcode];
|
||||
proc = __glXSwapRenderTable[opcode];
|
||||
}
|
||||
|
||||
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
||||
else
|
||||
{
|
||||
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
||||
|
||||
entry = &__glXRenderSizeTable_EXT[index];
|
||||
proc = __glXSwapRenderTable_EXT[index];
|
||||
}
|
||||
#endif
|
||||
|
||||
(*proc) (pc + __GLX_RENDER_HDR_SIZE);
|
||||
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
}
|
||||
|
||||
cl->beBufLen = 0;
|
||||
|
||||
pc = *ppc;
|
||||
left = *pleft;
|
||||
opcode = 0;
|
||||
|
||||
while (opcode != X_GLrop_End)
|
||||
{
|
||||
hdr = (__GLXrenderHeader *) pc;
|
||||
cmdlen = hdr->length;
|
||||
opcode = hdr->opcode;
|
||||
|
||||
if ((opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE))
|
||||
{
|
||||
entry = &__glXRenderSizeTable[opcode];
|
||||
proc = __glXRenderTable[opcode];
|
||||
}
|
||||
|
||||
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
||||
else
|
||||
{
|
||||
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
||||
|
||||
entry = &__glXRenderSizeTable_EXT[index];
|
||||
proc = __glXRenderTable_EXT[index];
|
||||
}
|
||||
#endif
|
||||
|
||||
(*proc) (pc + __GLX_RENDER_HDR_SIZE);
|
||||
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int size;
|
||||
|
||||
size = pc - *ppc;
|
||||
if (cl->beBufSize < cl->beBufLen + size)
|
||||
{
|
||||
cl->beBuf = (GLbyte *) Xrealloc (cl->beBuf, cl->beBufLen + size);
|
||||
if (!cl->beBuf)
|
||||
cl->beBufLen = size = 0;
|
||||
|
||||
cl->beBufSize = cl->beBufLen + size;
|
||||
}
|
||||
|
||||
if (size)
|
||||
memcpy (cl->beBuf + cl->beBufLen, *ppc, size);
|
||||
}
|
||||
|
||||
*ppc = pc;
|
||||
*pleft = left;
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
** Render and Renderlarge are not in the GLX API. They are used by the GLX
|
||||
** client library to send batches of GL rendering commands.
|
||||
|
|
@ -554,17 +804,26 @@ int __glXSwapRender(__GLXclientState *cl, GLbyte *pc)
|
|||
return BadLength;
|
||||
}
|
||||
|
||||
/*
|
||||
** Skip over the header and execute the command. We allow the
|
||||
** caller to trash the command memory. This is useful especially
|
||||
** for things that require double alignment - they can just shift
|
||||
** the data towards lower memory (trashing the header) by 4 bytes
|
||||
** and achieve the required alignment.
|
||||
*/
|
||||
(*proc)(pc + __GLX_RENDER_HDR_SIZE);
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
commandsDone++;
|
||||
if (opcode == X_GLrop_Begin || cl->beBufLen > 0)
|
||||
{
|
||||
error = __glXSwapRenderBeginEnd (cl, &commandsDone, &pc, &left);
|
||||
if (error != Success)
|
||||
return error;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
** Skip over the header and execute the command. We allow the
|
||||
** caller to trash the command memory. This is useful especially
|
||||
** for things that require double alignment - they can just shift
|
||||
** the data towards lower memory (trashing the header) by 4 bytes
|
||||
** and achieve the required alignment.
|
||||
*/
|
||||
(*proc)(pc + __GLX_RENDER_HDR_SIZE);
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
commandsDone++;
|
||||
}
|
||||
}
|
||||
__GLX_NOTE_UNFLUSHED_CMDS(cx);
|
||||
return Success;
|
||||
|
|
@ -824,6 +1083,10 @@ int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
|
|||
__GLX_SWAP_INT(pc + 4);
|
||||
CALL_SamplePatternSGIS( GET_DISPATCH(), (*(GLenum *)(pc + 4)) );
|
||||
return Success;
|
||||
case X_GLXvop_BindTexImageMESA:
|
||||
return __glXSwapBindTexImageEXT(cl, pc);
|
||||
case X_GLXvop_ReleaseTexImageMESA:
|
||||
return __glXSwapReleaseTexImageEXT(cl, pc);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -861,6 +1124,8 @@ int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
|
|||
return __glXSwapCreateContextWithConfigSGIX(cl, pc);
|
||||
case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
|
||||
return __glXSwapCreateGLXPixmapWithConfigSGIX(cl, pc);
|
||||
case X_GLXvop_GetDrawableAttributesSGIX:
|
||||
return __glXGetDrawableAttributesSGIX(cl, pc);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ typedef struct {
|
|||
__GLXscreenInfo *pGlxScreen;
|
||||
ScreenPtr pScreen;
|
||||
Bool idExists;
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
int refcnt;
|
||||
|
||||
} __GLXpixmap;
|
||||
|
|
@ -97,6 +98,13 @@ struct __GLXdrawablePrivateRec {
|
|||
void (*freeBuffers)(struct __GLXdrawablePrivateRec *);
|
||||
void (*updatePalette)(struct __GLXdrawablePrivateRec *);
|
||||
GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *);
|
||||
int (*bindBuffers)(struct __GLXdrawablePrivateRec *, int);
|
||||
int (*releaseBuffers)(struct __GLXdrawablePrivateRec *, int);
|
||||
|
||||
/*
|
||||
** Used by EXT_render_texture.
|
||||
*/
|
||||
GLenum texTarget;
|
||||
|
||||
/*
|
||||
** The GL drawable (information shared between GLX and the GL core)
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ static char GLXServerExtensions[] =
|
|||
"GLX_SGIX_swap_barrier "
|
||||
#endif
|
||||
"GLX_SGIX_fbconfig "
|
||||
"GLX_MESA_render_texture "
|
||||
;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -65,6 +65,15 @@
|
|||
#include <GL/glxproto.h>
|
||||
#include <GL/glxint.h>
|
||||
|
||||
/* XXX: should go into glxext.h */
|
||||
#ifndef GLX_EXT_render_texture
|
||||
#define GLX_TEXTURE_TARGET_EXT 0x6001
|
||||
#define GLX_TEXTURE_2D_EXT 0x6002
|
||||
#define GLX_TEXTURE_RECTANGLE_EXT 0x6003
|
||||
#define GLX_NO_TEXTURE_EXT 0x6004
|
||||
#define GLX_FRONT_LEFT_EXT 0x6005
|
||||
#endif
|
||||
|
||||
/* For glxscreens.h */
|
||||
typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate;
|
||||
|
||||
|
|
@ -131,6 +140,13 @@ struct __GLXclientStateRec {
|
|||
GLbyte *returnBuf;
|
||||
GLint returnBufSize;
|
||||
|
||||
/*
|
||||
** Begin/End buffer.
|
||||
*/
|
||||
GLbyte *beBuf;
|
||||
GLint beBufLen;
|
||||
GLint beBufSize;
|
||||
|
||||
/*
|
||||
** Keep track of large rendering commands, which span multiple requests.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -505,3 +505,14 @@ __glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv)
|
|||
|
||||
/************************************************************************/
|
||||
|
||||
GLuint __glFloorLog2(GLuint val)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (val > 1) {
|
||||
c++;
|
||||
val >>= 1;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
SUBDIRS = main math array_cache swrast swrast_setup tnl shader X
|
||||
SUBDIRS = main math array_cache swrast swrast_setup tnl shader X glapi
|
||||
|
||||
noinst_LTLIBRARIES = libGLcore.la
|
||||
|
||||
libGLcore_la_CFLAGS = -DUSE_MGL_NAMESPACE -UHAVE_CONFIG_H -DGLXEXT -DXF86DRI \
|
||||
-DGLX_DIRECT_RENDERING -DGLX_USE_DLOPEN -DGLX_USE_MESA
|
||||
|
||||
libGLcore_la_SOURCES = dummy.c
|
||||
libGLcore_la_LIBADD = main/libmain.la \
|
||||
math/libmath.la \
|
||||
|
|
@ -12,4 +15,5 @@ libGLcore_la_LIBADD = main/libmain.la \
|
|||
shader/libshader.la \
|
||||
shader/grammar/libgrammar.la \
|
||||
shader/slang/libslang.la \
|
||||
X/libX.la
|
||||
X/libX.la \
|
||||
glapi/libglapi.la
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ INCLUDES = -I@MESA_SOURCE@/include \
|
|||
# -DXFree86Server is required because the X11 driver in Mesa thinks that
|
||||
# symbol means "being built in the server"
|
||||
AM_CFLAGS = $(DIX_CFLAGS) @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@ \
|
||||
-DXFree86Server
|
||||
-DXFree86Server -DUSE_MGL_NAMESPACE
|
||||
|
||||
libX_la_SOURCES = xf86glx.c \
|
||||
xf86glx_util.c \
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <regionstr.h>
|
||||
#include <resource.h>
|
||||
#include <GL/gl.h>
|
||||
|
|
@ -258,6 +258,79 @@ static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
|
|||
},
|
||||
};
|
||||
|
||||
void *__glXMalloc(size_t size) __attribute__((weak));
|
||||
void *__glXCalloc(size_t numElements, size_t elementSize) __attribute__((weak));void *__glXRealloc(void *addr, size_t newSize) __attribute__((weak));
|
||||
void __glXFree(void *addr) __attribute__((weak));
|
||||
|
||||
void *
|
||||
__glXMalloc(size_t size)
|
||||
{
|
||||
void *addr;
|
||||
|
||||
if (size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
addr = (void *) xalloc(size);
|
||||
if (addr == NULL) {
|
||||
/* XXX: handle out of memory error */
|
||||
return NULL;
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
void *
|
||||
__glXCalloc(size_t numElements, size_t elementSize)
|
||||
{
|
||||
void *addr;
|
||||
size_t size;
|
||||
|
||||
if ((numElements == 0) || (elementSize == 0)) {
|
||||
return NULL;
|
||||
}
|
||||
size = numElements * elementSize;
|
||||
addr = (void *) xalloc(size);
|
||||
if (addr == NULL) {
|
||||
/* XXX: handle out of memory error */
|
||||
return NULL;
|
||||
}
|
||||
__glXMemset(addr, 0, size);
|
||||
return addr;
|
||||
}
|
||||
|
||||
void *
|
||||
__glXRealloc(void *addr, size_t newSize)
|
||||
{
|
||||
void *newAddr;
|
||||
|
||||
if (addr) {
|
||||
if (newSize == 0) {
|
||||
xfree(addr);
|
||||
return NULL;
|
||||
} else {
|
||||
newAddr = xrealloc(addr, newSize);
|
||||
}
|
||||
} else {
|
||||
if (newSize == 0) {
|
||||
return NULL;
|
||||
} else {
|
||||
newAddr = xalloc(newSize);
|
||||
}
|
||||
}
|
||||
if (newAddr == NULL) {
|
||||
return NULL; /* XXX: out of memory */
|
||||
}
|
||||
|
||||
return newAddr;
|
||||
}
|
||||
|
||||
void
|
||||
__glXFree(void *addr)
|
||||
{
|
||||
if (addr) {
|
||||
xfree(addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
|
||||
VisualID *defaultVisp,
|
||||
|
|
@ -693,15 +766,9 @@ void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv)
|
|||
glxPriv->modes->visualID);
|
||||
}
|
||||
buf = (__MESA_buffer)__glXMalloc(sizeof(struct __MESA_bufferRec));
|
||||
|
||||
/* Create Mesa's buffers */
|
||||
if (glxPriv->type == DRAWABLE_WINDOW) {
|
||||
buf->xm_buf = (void *)XMesaCreateWindowBuffer(xm_vis,
|
||||
(WindowPtr)pDraw);
|
||||
} else {
|
||||
buf->xm_buf = (void *)XMesaCreatePixmapBuffer(xm_vis,
|
||||
(PixmapPtr)pDraw, 0);
|
||||
}
|
||||
buf->xm_buf = 0;
|
||||
buf->pDraw = pDraw;
|
||||
buf->xm_vis = xm_vis;
|
||||
|
||||
/* Wrap the front buffer's resize routine */
|
||||
buf->fbresize = glPriv->frontBuffer.resize;
|
||||
|
|
@ -711,11 +778,40 @@ void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv)
|
|||
buf->fbswap = glxPriv->swapBuffers;
|
||||
glxPriv->swapBuffers = __MESA_swapBuffers;
|
||||
|
||||
/* Wrap the render texture routines */
|
||||
buf->fbbind = glxPriv->bindBuffers;
|
||||
glxPriv->bindBuffers = __MESA_bindBuffers;
|
||||
buf->fbrelease = glxPriv->releaseBuffers;
|
||||
glxPriv->releaseBuffers = __MESA_releaseBuffers;
|
||||
|
||||
/* Mesa doesn't support render texture on its own */
|
||||
glxPriv->texTarget = GLX_NO_TEXTURE_EXT;
|
||||
|
||||
/* Save Mesa's private buffer structure */
|
||||
glPriv->private = (void *)buf;
|
||||
glPriv->freePrivate = __MESA_destroyBuffer;
|
||||
}
|
||||
|
||||
static void __MESA_allocateBuffer (__GLdrawablePrivate *glPriv)
|
||||
{
|
||||
__MESA_buffer buf = glPriv->private;
|
||||
|
||||
if (!buf->xm_buf)
|
||||
{
|
||||
/* Create Mesa's buffers */
|
||||
if (buf->pDraw->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
buf->xm_buf = (void *)
|
||||
XMesaCreateWindowBuffer (buf->xm_vis, (WindowPtr) buf->pDraw);
|
||||
}
|
||||
else
|
||||
{
|
||||
buf->xm_buf = (void *)
|
||||
XMesaCreatePixmapBuffer (buf->xm_vis, (PixmapPtr) buf->pDraw, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buffer,
|
||||
GLint x, GLint y,
|
||||
GLuint width, GLuint height,
|
||||
|
|
@ -743,6 +839,18 @@ GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
int __MESA_bindBuffers(__GLXdrawablePrivate *glxPriv,
|
||||
int buffer)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int __MESA_releaseBuffers(__GLXdrawablePrivate *glxPriv,
|
||||
int buffer)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv)
|
||||
{
|
||||
__MESA_buffer buf = (__MESA_buffer)glPriv->private;
|
||||
|
|
@ -815,7 +923,7 @@ GLboolean __MESA_loseCurrent(__GLcontext *gc)
|
|||
{
|
||||
XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
|
||||
MESA_CC = NULL;
|
||||
__glXLastContext = NULL;
|
||||
GlxFlushContextCache();
|
||||
return XMesaLoseCurrent(xmesa);
|
||||
}
|
||||
|
||||
|
|
@ -827,6 +935,12 @@ GLboolean __MESA_makeCurrent(__GLcontext *gc)
|
|||
__MESA_buffer readBuf = (__MESA_buffer)readPriv->private;
|
||||
XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
|
||||
|
||||
if (!drawBuf->xm_buf)
|
||||
__MESA_allocateBuffer (drawPriv);
|
||||
|
||||
if (!readBuf->xm_buf)
|
||||
__MESA_allocateBuffer (readPriv);
|
||||
|
||||
MESA_CC = gc;
|
||||
return XMesaMakeCurrent2(xmesa, drawBuf->xm_buf, readBuf->xm_buf);
|
||||
}
|
||||
|
|
@ -852,6 +966,7 @@ GLboolean __MESA_forceCurrent(__GLcontext *gc)
|
|||
{
|
||||
XMesaContext xmesa = (XMesaContext) gc->DriverCtx;
|
||||
MESA_CC = gc;
|
||||
GlxSetRenderTables (gc->CurrentDispatch);
|
||||
return XMesaForceCurrent(xmesa);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,10 +54,17 @@ struct __MESA_screenRec {
|
|||
typedef struct __MESA_bufferRec *__MESA_buffer;
|
||||
struct __MESA_bufferRec {
|
||||
XMesaBuffer xm_buf;
|
||||
DrawablePtr pDraw;
|
||||
XMesaVisual xm_vis;
|
||||
GLboolean (*fbresize)(__GLdrawableBuffer *buf,
|
||||
GLint x, GLint y, GLuint width, GLuint height,
|
||||
__GLdrawablePrivate *glPriv, GLuint bufferMask);
|
||||
GLboolean (*fbswap)(__GLXdrawablePrivate *glxPriv);
|
||||
int (*fbbind)(__GLXdrawablePrivate *glxPriv, int buffer);
|
||||
int (*fbrelease)(__GLXdrawablePrivate *glxPriv, int buffer);
|
||||
int (*fbquery)(__GLXdrawablePrivate *glxPriv, int attribute,
|
||||
unsigned int *value);
|
||||
|
||||
};
|
||||
|
||||
extern void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
|
||||
|
|
@ -77,6 +84,10 @@ extern GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buf,
|
|||
__GLdrawablePrivate *glPriv,
|
||||
GLuint bufferMask);
|
||||
extern GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv);
|
||||
extern int __MESA_bindBuffers(__GLXdrawablePrivate *glxPriv, int buffer);
|
||||
extern int __MESA_releaseBuffers(__GLXdrawablePrivate *glxPriv, int buffer);
|
||||
extern int __MESA_queryBuffers(__GLXdrawablePrivate *glxPriv, int attribute,
|
||||
unsigned int *value);
|
||||
extern void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv);
|
||||
|
||||
extern __GLinterface *__MESA_createContext(__GLimports *imports,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
noinst_LTLIBRARIES = libac.la
|
||||
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@ -DUSE_MGL_NAMESPACE
|
||||
|
||||
INCLUDES = -I@MESA_SOURCE@/include \
|
||||
-I../X \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
noinst_LTLIBRARIES = libglapi.la
|
||||
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@ -DUSE_MGL_NAMESPACE
|
||||
|
||||
INCLUDES = -I@MESA_SOURCE@/include \
|
||||
-I../X \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
noinst_LTLIBRARIES = libmain.la
|
||||
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@ -DUSE_MGL_NAMESPACE
|
||||
|
||||
INCLUDES = -I@MESA_SOURCE@/include \
|
||||
-I../X \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
noinst_LTLIBRARIES = libmath.la
|
||||
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@ -DUSE_MGL_NAMESPACE
|
||||
|
||||
INCLUDES = -I@MESA_SOURCE@/include \
|
||||
-I../X \
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ SUBDIRS = grammar slang
|
|||
|
||||
noinst_LTLIBRARIES = libshader.la
|
||||
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@ -DUSE_MGL_NAMESPACE
|
||||
|
||||
INCLUDES = -I@MESA_SOURCE@/include \
|
||||
-I../X \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
noinst_LTLIBRARIES = libswrast.la
|
||||
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@ -DUSE_MGL_NAMESPACE
|
||||
|
||||
INCLUDES = -I@MESA_SOURCE@/include \
|
||||
-I../X \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
noinst_LTLIBRARIES = libss.la
|
||||
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@ -DUSE_MGL_NAMESPACE
|
||||
|
||||
INCLUDES = -I@MESA_SOURCE@/include \
|
||||
-I../X \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
noinst_LTLIBRARIES = libtnl.la
|
||||
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@
|
||||
AM_CFLAGS = @SERVER_DEFINES@ @MODULE_DEFINES@ @LOADER_DEFINES@ -DUSE_MGL_NAMESPACE
|
||||
|
||||
INCLUDES = -I@MESA_SOURCE@/include \
|
||||
-I../X \
|
||||
|
|
|
|||
|
|
@ -921,6 +921,7 @@ if test "x$XGL" = xyes; then
|
|||
XGL_LIBS="$FB_LIB $MI_LIB $COMPOSITE_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 $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $LBX_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB"
|
||||
AC_SUBST([XGL_LIBS])
|
||||
AC_DEFINE(XGL_MODULAR, 1, [Use loadable XGL modules])
|
||||
SERVER_DEFINES="$SERVER_DEFINES -DXGLServer"
|
||||
|
||||
xglmoduledir="$moduledir/xgl"
|
||||
AC_SUBST([xglmoduledir])
|
||||
|
|
|
|||
5
fb/fb.h
5
fb/fb.h
|
|
@ -22,7 +22,7 @@
|
|||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $XdotOrg: xc/programs/Xserver/fb/fb.h,v 1.12 2005/08/24 11:18:33 daniels Exp $ */
|
||||
/* $XdotOrg: xserver/xorg/fb/fb.h,v 1.13 2005/10/02 08:28:26 anholt Exp $ */
|
||||
|
||||
#ifndef _FB_H_
|
||||
#define _FB_H_
|
||||
|
|
@ -677,7 +677,7 @@ typedef struct {
|
|||
(yoff) = __fbPixOffYPix(_pPix); \
|
||||
} \
|
||||
(pointer) = (FbBits *) _pPix->devPrivate.ptr; \
|
||||
(stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
|
||||
(stride) = (_pPix->devKind) / (FbStride) sizeof (FbBits); (void)(stride); \
|
||||
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
|
||||
}
|
||||
|
||||
|
|
@ -1940,6 +1940,7 @@ fbEvenTile (FbBits *dst,
|
|||
int height,
|
||||
|
||||
FbBits *tile,
|
||||
FbStride tileStride,
|
||||
int tileHeight,
|
||||
|
||||
int alu,
|
||||
|
|
|
|||
|
|
@ -829,8 +829,6 @@ POLYSEGMENT (DrawablePtr pDrawable,
|
|||
ul = coordToInt(pBox->x1 - xoff, pBox->y1 - yoff);
|
||||
lr = coordToInt(pBox->x2 - xoff - 1, pBox->y2 - yoff - 1);
|
||||
|
||||
bits += bitsStride * yoff + xoff * MUL;
|
||||
|
||||
capNotLast = pGC->capStyle == CapNotLast;
|
||||
|
||||
while (nseg--)
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ fbBltOne (FbStip *src,
|
|||
srcinc++;
|
||||
if (endmask)
|
||||
{
|
||||
endNeedsLoad = nDst % unitsPerSrc == 0;
|
||||
endNeedsLoad = nmiddle % unitsPerSrc == 0;
|
||||
if (endNeedsLoad)
|
||||
srcinc++;
|
||||
}
|
||||
|
|
|
|||
1539
fb/fbcompose.c
1539
fb/fbcompose.c
File diff suppressed because it is too large
Load diff
|
|
@ -875,6 +875,8 @@ fbComposite (CARD8 op,
|
|||
if (pSrc->pDrawable && (!pMask || pMask->pDrawable)
|
||||
&& !pSrc->transform && !(pMask && pMask->transform)
|
||||
&& !maskAlphaMap && !srcAlphaMap && !dstAlphaMap
|
||||
&& (!pSrc->repeat || srcRepeat)
|
||||
&& (!pMask || (!pMask->repeat || maskRepeat))
|
||||
&& (pSrc->filter != PictFilterConvolution)
|
||||
&& (!pMask || pMask->filter != PictFilterConvolution))
|
||||
switch (op) {
|
||||
|
|
|
|||
10
fb/fbtile.c
10
fb/fbtile.c
|
|
@ -43,6 +43,7 @@ fbEvenTile (FbBits *dst,
|
|||
int height,
|
||||
|
||||
FbBits *tile,
|
||||
FbStride tileStride,
|
||||
int tileHeight,
|
||||
|
||||
int alu,
|
||||
|
|
@ -69,9 +70,9 @@ fbEvenTile (FbBits *dst,
|
|||
/*
|
||||
* Compute tile start scanline and rotation parameters
|
||||
*/
|
||||
tileEnd = tile + tileHeight;
|
||||
tileEnd = tile + tileHeight * tileStride;
|
||||
modulus (- yRot, tileHeight, tileY);
|
||||
t = tile + tileY;
|
||||
t = tile + tileY * tileStride;
|
||||
modulus (- xRot, FB_UNIT, tileX);
|
||||
rot = tileX;
|
||||
|
||||
|
|
@ -81,7 +82,8 @@ fbEvenTile (FbBits *dst,
|
|||
/*
|
||||
* Pick up bits for this scanline
|
||||
*/
|
||||
bits = *t++;
|
||||
bits = *t;
|
||||
t += tileStride;
|
||||
if (t == tileEnd) t = tile;
|
||||
bits = FbRotLeft(bits,rot);
|
||||
and = fbAnd(alu,bits,pm);
|
||||
|
|
@ -195,7 +197,7 @@ fbTile (FbBits *dst,
|
|||
{
|
||||
if (FbEvenTile (tileWidth))
|
||||
fbEvenTile (dst, dstStride, dstX, width, height,
|
||||
tile, tileHeight,
|
||||
tile, tileStride, tileHeight,
|
||||
alu, pm, xRot, yRot);
|
||||
else
|
||||
fbOddTile (dst, dstStride, dstX, width, height,
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ xf86cos(double x)
|
|||
|
||||
|
||||
|
||||
$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.10 2001/12/17 20:00:45 dawes Exp $
|
||||
$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.9 2001/07/23 13:15:48 dawes Exp $
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.h,v 1.1 2002/10/11 01:40:34 dawes Exp $ */
|
||||
/* $XFree86$ */
|
||||
|
||||
extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
|
||||
CARD8 *pModMap);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.3,v 1.1 2000/02/11 18:06:50 dawes Exp $
|
||||
.\" $XFree86: xc/programs/Xserver/hw/xfree86/os-support/libusb/usb.3,v 1.1.2.2 1999/12/03 10:12:42 hohndel Exp $
|
||||
.\"
|
||||
.Dd May 11, 1999
|
||||
.Dt USB 3
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/libusb/usb.h,v 1.1.2.2 1999/12/03 10:12:43 hohndel Exp $ */
|
||||
|
||||
#define _DIAGASSERT(e) assert(e)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usbvar.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/libusb/usbvar.h,v 1.1.2.2 1999/12/03 10:12:43 hohndel Exp $ */
|
||||
|
||||
struct report_desc {
|
||||
unsigned int size;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.h,v 1.1 2002/10/11 01:40:35 dawes Exp $ */
|
||||
/* $XFree86$ */
|
||||
|
||||
extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
|
||||
CARD8 *pModMap);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.c,v 1.1 2002/12/14 04:41:14 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.S,v 1.1 1999/07/10 07:24:49 dawes Exp $ */
|
||||
/*
|
||||
* Copyright 1998 by Metro Link Incorporated
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.S,v 1.1 1999/07/10 07:24:50 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.s,v 1.2 1998/07/25 16:56:49 dawes Exp $ */
|
||||
/*******************************************************************************
|
||||
Copyright 1994 by Glenn G. Lai
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.S,v 1.1 1999/07/10 07:24:51 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.s,v 1.2 1998/07/25 16:56:50 dawes Exp $ */
|
||||
/*******************************************************************************
|
||||
Copyright 1994 by Glenn G. Lai
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
|
||||
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/inout.S,v 1.1 1999/07/10 07:24:52 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/inout.s,v 3.5 1996/12/23 06:50:58 dawes Exp $ */
|
||||
|
||||
#include "assyntax.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/ $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s,v 1.1 2001/05/28 02:42:31 tsi Exp $
|
||||
/ $XFree86$
|
||||
/
|
||||
/ Copyright 1994-2001 The XFree86 Project, Inc. All Rights Reserved.
|
||||
/
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XdotOrg: xserver/xorg/mi/miinitext.c,v 1.29 2006/01/06 23:06:15 ajax Exp $ */
|
||||
/* $XdotOrg: xserver/xorg/mi/miinitext.c,v 1.30 2006/01/08 23:43:54 ajax Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.67 2003/01/12 02:44:27 dawes Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
|
|
@ -669,7 +669,7 @@ InitExtensions(argc, argv)
|
|||
if (!noXevieExtension) XevieExtensionInit();
|
||||
#endif
|
||||
#ifdef COMPOSITE
|
||||
if (!noCompositeExtension) CompositeExtensionInit();
|
||||
if (1/*!noCompositeExtension*/) CompositeExtensionInit();
|
||||
#endif
|
||||
#ifdef DAMAGE
|
||||
if (!noDamageExtension) DamageExtensionInit();
|
||||
|
|
|
|||
|
|
@ -271,12 +271,19 @@ PictureResetFilters (ScreenPtr pScreen)
|
|||
int
|
||||
SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams)
|
||||
{
|
||||
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
PictFilterPtr pFilter = PictureFindFilter (pScreen, name, len);
|
||||
ScreenPtr pScreen;
|
||||
PictureScreenPtr ps;
|
||||
PictFilterPtr pFilter;
|
||||
xFixed *new_params;
|
||||
int i, result;
|
||||
|
||||
if (!pPicture->pDrawable)
|
||||
return Success;
|
||||
|
||||
pScreen = pPicture->pDrawable->pScreen;
|
||||
ps = GetPictureScreen(pScreen);
|
||||
pFilter = PictureFindFilter (pScreen, name, len);
|
||||
|
||||
if (!pFilter)
|
||||
return BadName;
|
||||
if (pFilter->ValidateParams)
|
||||
|
|
|
|||
417
render/picture.c
417
render/picture.c
|
|
@ -661,6 +661,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
|||
xfree (formats);
|
||||
return FALSE;
|
||||
}
|
||||
a = r = g = b = 0;
|
||||
if (formats[n].type == PictTypeIndexed)
|
||||
{
|
||||
VisualPtr pVisual = PictureFindVisual (pScreen, formats[n].index.vid);
|
||||
|
|
@ -668,9 +669,8 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
|||
type = PICT_TYPE_COLOR;
|
||||
else
|
||||
type = PICT_TYPE_GRAY;
|
||||
a = r = g = b = 0;
|
||||
}
|
||||
else
|
||||
else if (formats[n].type == PictTypeDirect)
|
||||
{
|
||||
if ((formats[n].direct.redMask|
|
||||
formats[n].direct.blueMask|
|
||||
|
|
@ -685,6 +685,10 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
|||
g = Ones (formats[n].direct.greenMask);
|
||||
b = Ones (formats[n].direct.blueMask);
|
||||
}
|
||||
else
|
||||
{
|
||||
type = PICT_FORMAT_TYPE (formats[n].format);
|
||||
}
|
||||
formats[n].format = PICT_FORMAT(0,type,a,r,g,b);
|
||||
}
|
||||
ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec));
|
||||
|
|
@ -887,41 +891,72 @@ static unsigned int INTERPOLATE_PIXEL_256(unsigned int x, unsigned int a,
|
|||
return x;
|
||||
}
|
||||
|
||||
static void initGradientColorTable(SourcePictPtr pGradient, int *error)
|
||||
CARD32
|
||||
PictureGradientColor (PictGradientStopPtr stop1,
|
||||
PictGradientStopPtr stop2,
|
||||
CARD32 x)
|
||||
{
|
||||
int dist, idist;
|
||||
|
||||
dist = (int) (256 * (x - stop1->x) / (stop2->x - stop1->x));
|
||||
idist = 256 - dist;
|
||||
|
||||
return premultiply (INTERPOLATE_PIXEL_256 (stop1->color, idist,
|
||||
stop2->color, dist));
|
||||
}
|
||||
|
||||
static void
|
||||
initGradientColorTable(PictGradientPtr gradient,
|
||||
int tableSize,
|
||||
int *error)
|
||||
{
|
||||
int begin_pos, end_pos;
|
||||
xFixed incr, dpos;
|
||||
int pos, current_stop;
|
||||
PictGradientStopPtr stops = pGradient->linear.stops;
|
||||
int nstops = pGradient->linear.nstops;
|
||||
PictGradientStopPtr stops = gradient->stops;
|
||||
int nstops = gradient->nstops;
|
||||
|
||||
if (gradient->colorTableSize < tableSize)
|
||||
{
|
||||
CARD32 *newColorTable;
|
||||
|
||||
newColorTable = realloc (gradient->colorTable,
|
||||
tableSize * sizeof (CARD32));
|
||||
if (!newColorTable)
|
||||
{
|
||||
*error = BadAlloc;
|
||||
return;
|
||||
}
|
||||
|
||||
gradient->colorTable = newColorTable;
|
||||
gradient->colorTableSize = tableSize;
|
||||
}
|
||||
|
||||
gradient->stopRange = tableSize;
|
||||
|
||||
/* The position where the gradient begins and ends */
|
||||
begin_pos = (stops[0].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16;
|
||||
end_pos = (stops[nstops - 1].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16;
|
||||
begin_pos = (stops[0].x * gradient->colorTableSize) >> 16;
|
||||
end_pos = (stops[nstops - 1].x * gradient->colorTableSize) >> 16;
|
||||
|
||||
pos = 0; /* The position in the color table. */
|
||||
|
||||
/* Up to first point */
|
||||
while (pos <= begin_pos) {
|
||||
pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[0].color);
|
||||
gradient->colorTable[pos] = stops[0].color;
|
||||
++pos;
|
||||
}
|
||||
|
||||
incr = (1<<16)/ PICT_GRADIENT_STOPTABLE_SIZE; /* the double increment. */
|
||||
incr = (1<<16)/ gradient->colorTableSize; /* the double increment. */
|
||||
dpos = incr * pos; /* The position in terms of 0-1. */
|
||||
|
||||
current_stop = 0; /* We always interpolate between current and current + 1. */
|
||||
|
||||
/* Gradient area */
|
||||
while (pos < end_pos) {
|
||||
unsigned int current_color = xRenderColorToCard32(stops[current_stop].color);
|
||||
unsigned int next_color = xRenderColorToCard32(stops[current_stop + 1].color);
|
||||
|
||||
int dist = (int)(256*(dpos - stops[current_stop].x)
|
||||
/ (stops[current_stop+1].x - stops[current_stop].x));
|
||||
int idist = 256 - dist;
|
||||
|
||||
pGradient->linear.colorTable[pos] = premultiply(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
|
||||
gradient->colorTable[pos] =
|
||||
PictureGradientColor (&stops[current_stop],
|
||||
&stops[current_stop + 1],
|
||||
dpos);
|
||||
|
||||
++pos;
|
||||
dpos += incr;
|
||||
|
|
@ -931,56 +966,96 @@ static void initGradientColorTable(SourcePictPtr pGradient, int *error)
|
|||
}
|
||||
|
||||
/* After last point */
|
||||
while (pos < PICT_GRADIENT_STOPTABLE_SIZE) {
|
||||
pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[nstops - 1].color);
|
||||
while (pos < gradient->colorTableSize) {
|
||||
gradient->colorTable[pos] = stops[nstops - 1].color;
|
||||
++pos;
|
||||
}
|
||||
}
|
||||
|
||||
static void initGradient(SourcePictPtr pGradient, int stopCount,
|
||||
xFixed *stopPoints, xRenderColor *stopColors, int *error)
|
||||
static void
|
||||
SourcePictureInit (PicturePtr pPicture,
|
||||
SourcePictPtr pSourcePict,
|
||||
int type)
|
||||
{
|
||||
pPicture->pDrawable = 0;
|
||||
pPicture->pFormat = 0;
|
||||
pPicture->pNext = 0;
|
||||
pPicture->format = PICT_a8r8g8b8;
|
||||
|
||||
SetPictureToDefaults (pPicture);
|
||||
|
||||
pPicture->pSourcePict = pSourcePict;
|
||||
|
||||
pSourcePict->source.type = type;
|
||||
pSourcePict->source.class = SourcePictClassUnknown;
|
||||
pSourcePict->source.devPrivate.ptr = NULL;
|
||||
pSourcePict->source.Destroy = NULL;
|
||||
}
|
||||
|
||||
static Bool
|
||||
GradientPictureInit (PicturePtr pPicture,
|
||||
PictGradientPtr pGradient,
|
||||
int type,
|
||||
int stopCount,
|
||||
xFixed *stopPoints,
|
||||
xRenderColor *stopColors,
|
||||
int *error)
|
||||
{
|
||||
int i;
|
||||
xFixed dpos;
|
||||
|
||||
if (stopCount <= 0) {
|
||||
*error = BadValue;
|
||||
return;
|
||||
if (stopCount <= 0)
|
||||
{
|
||||
*error = BadValue;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SourcePictureInit (pPicture, (SourcePictPtr) pGradient, type);
|
||||
|
||||
dpos = -1;
|
||||
for (i = 0; i < stopCount; ++i) {
|
||||
if (stopPoints[i] <= dpos || stopPoints[i] > (1<<16)) {
|
||||
*error = BadValue;
|
||||
return;
|
||||
}
|
||||
dpos = stopPoints[i];
|
||||
for (i = 0; i < stopCount; ++i)
|
||||
{
|
||||
if (stopPoints[i] < dpos || stopPoints[i] > (1 << 16))
|
||||
{
|
||||
*error = BadValue;
|
||||
return FALSE;
|
||||
}
|
||||
dpos = stopPoints[i];
|
||||
}
|
||||
|
||||
pGradient->linear.stops = xalloc(stopCount*sizeof(PictGradientStop));
|
||||
if (!pGradient->linear.stops) {
|
||||
*error = BadAlloc;
|
||||
return;
|
||||
for (i = 0; i < stopCount; ++i)
|
||||
{
|
||||
pGradient->stops[i].x = stopPoints[i];
|
||||
pGradient->stops[i].color = xRenderColorToCard32 (stopColors[i]);
|
||||
}
|
||||
|
||||
pGradient->linear.nstops = stopCount;
|
||||
pGradient->class = SourcePictClassUnknown;
|
||||
pGradient->stopRange = 0xffff;
|
||||
pGradient->colorTable = NULL;
|
||||
pGradient->colorTableSize = 0;
|
||||
|
||||
for (i = 0; i < stopCount; ++i) {
|
||||
pGradient->linear.stops[i].x = stopPoints[i];
|
||||
pGradient->linear.stops[i].color = stopColors[i];
|
||||
}
|
||||
initGradientColorTable(pGradient, error);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static PicturePtr createSourcePicture(void)
|
||||
PicturePtr
|
||||
CreateDevicePicture (Picture pid,
|
||||
int *error)
|
||||
{
|
||||
PicturePtr pPicture;
|
||||
pPicture = (PicturePtr) xalloc(sizeof(PictureRec));
|
||||
pPicture->pDrawable = 0;
|
||||
pPicture->pFormat = 0;
|
||||
pPicture->pNext = 0;
|
||||
|
||||
SetPictureToDefaults(pPicture);
|
||||
pPicture = xalloc (sizeof (PictureRec) + sizeof (PictSourceRec));
|
||||
if (!pPicture)
|
||||
{
|
||||
*error = BadAlloc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SourcePictureInit (pPicture,
|
||||
(SourcePictPtr) (pPicture + 1),
|
||||
SourcePictTypeOther);
|
||||
|
||||
pPicture->id = pid;
|
||||
|
||||
return pPicture;
|
||||
}
|
||||
|
||||
|
|
@ -988,21 +1063,22 @@ PicturePtr
|
|||
CreateSolidPicture (Picture pid, xRenderColor *color, int *error)
|
||||
{
|
||||
PicturePtr pPicture;
|
||||
pPicture = createSourcePicture();
|
||||
if (!pPicture) {
|
||||
*error = BadAlloc;
|
||||
return 0;
|
||||
|
||||
pPicture = xalloc (sizeof (PictureRec) + sizeof (PictSolidFill));
|
||||
if (!pPicture)
|
||||
{
|
||||
*error = BadAlloc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SourcePictureInit (pPicture,
|
||||
(SourcePictPtr) (pPicture + 1),
|
||||
SourcePictTypeSolidFill);
|
||||
|
||||
pPicture->id = pid;
|
||||
pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill));
|
||||
if (!pPicture->pSourcePict) {
|
||||
*error = BadAlloc;
|
||||
xfree(pPicture);
|
||||
return 0;
|
||||
}
|
||||
pPicture->pSourcePict->type = SourcePictTypeSolidFill;
|
||||
pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color);
|
||||
|
||||
pPicture->pSourcePict->solidFill.color = xRenderColorToCard32 (*color);
|
||||
|
||||
return pPicture;
|
||||
}
|
||||
|
||||
|
|
@ -1010,103 +1086,109 @@ PicturePtr
|
|||
CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
|
||||
int nStops, xFixed *stops, xRenderColor *colors, int *error)
|
||||
{
|
||||
PicturePtr pPicture;
|
||||
PictLinearGradientPtr pLinear;
|
||||
PicturePtr pPicture;
|
||||
|
||||
if (nStops < 2) {
|
||||
*error = BadValue;
|
||||
return 0;
|
||||
if (nStops < 2)
|
||||
{
|
||||
*error = BadValue;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pPicture = createSourcePicture();
|
||||
if (!pPicture) {
|
||||
*error = BadAlloc;
|
||||
return 0;
|
||||
pPicture = xalloc (sizeof (PictureRec) +
|
||||
sizeof (PictLinearGradient) +
|
||||
sizeof (PictGradientStop) * nStops);
|
||||
if (!pPicture)
|
||||
{
|
||||
*error = BadAlloc;
|
||||
return 0;
|
||||
}
|
||||
if (p1->x == p2->x && p1->y == p2->y) {
|
||||
*error = BadValue;
|
||||
return 0;
|
||||
|
||||
pLinear = (PictLinearGradientPtr) (pPicture + 1);
|
||||
pLinear->stops = (PictGradientStopPtr) (pLinear + 1);
|
||||
pLinear->nstops = nStops;
|
||||
pLinear->p1 = *p1;
|
||||
pLinear->p2 = *p2;
|
||||
|
||||
if (!GradientPictureInit (pPicture,
|
||||
(PictGradientPtr) pLinear,
|
||||
SourcePictTypeLinear,
|
||||
nStops, stops, colors, error))
|
||||
{
|
||||
xfree (pPicture);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pPicture->id = pid;
|
||||
pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient));
|
||||
if (!pPicture->pSourcePict) {
|
||||
*error = BadAlloc;
|
||||
xfree(pPicture);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pPicture->pSourcePict->linear.type = SourcePictTypeLinear;
|
||||
pPicture->pSourcePict->linear.p1 = *p1;
|
||||
pPicture->pSourcePict->linear.p2 = *p2;
|
||||
|
||||
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
|
||||
if (*error) {
|
||||
xfree(pPicture);
|
||||
return 0;
|
||||
}
|
||||
return pPicture;
|
||||
}
|
||||
|
||||
#define FixedToDouble(x) ((x)/65536.)
|
||||
|
||||
PicturePtr
|
||||
CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer,
|
||||
xFixed innerRadius, xFixed outerRadius,
|
||||
int nStops, xFixed *stops, xRenderColor *colors, int *error)
|
||||
CreateRadialGradientPicture (Picture pid,
|
||||
xPointFixed *inner,
|
||||
xPointFixed *outer,
|
||||
xFixed innerRadius,
|
||||
xFixed outerRadius,
|
||||
int nStops,
|
||||
xFixed *stops,
|
||||
xRenderColor *colors,
|
||||
int *error)
|
||||
{
|
||||
PicturePtr pPicture;
|
||||
PictRadialGradient *radial;
|
||||
PicturePtr pPicture;
|
||||
PictRadialGradientPtr pRadial;
|
||||
double x;
|
||||
|
||||
if (nStops < 2) {
|
||||
*error = BadValue;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pPicture = createSourcePicture();
|
||||
if (!pPicture) {
|
||||
*error = BadAlloc;
|
||||
return 0;
|
||||
}
|
||||
pPicture = xalloc (sizeof (PictureRec) +
|
||||
sizeof (PictRadialGradient) +
|
||||
sizeof (PictGradientStop) * nStops);
|
||||
if (!pPicture)
|
||||
{
|
||||
double dx = (double)(inner->x - outer->x);
|
||||
double dy = (double)(inner->y - outer->y);
|
||||
if (sqrt(dx*dx + dy*dy) + (double)(innerRadius) > (double)(outerRadius)) {
|
||||
*error = BadValue;
|
||||
return 0;
|
||||
}
|
||||
*error = BadAlloc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pRadial = (PictRadialGradientPtr) (pPicture + 1);
|
||||
pRadial->stops = (PictGradientStopPtr) (pRadial + 1);
|
||||
pRadial->nstops = nStops;
|
||||
|
||||
pRadial->inner = *inner;
|
||||
pRadial->outer = *outer;
|
||||
pRadial->inner_radius = innerRadius;
|
||||
pRadial->outer_radius = outerRadius;
|
||||
|
||||
x = (double) innerRadius / (double) outerRadius;
|
||||
pRadial->dx = (outer->x - inner->x);
|
||||
pRadial->dy = (outer->y - inner->y);
|
||||
pRadial->fx = (inner->x) - x * pRadial->dx;
|
||||
pRadial->fy = (inner->y) - x * pRadial->dy;
|
||||
pRadial->m = 1. / (1 + x);
|
||||
pRadial->b = -x * pRadial->m;
|
||||
pRadial->dx /= 65536.;
|
||||
pRadial->dy /= 65536.;
|
||||
pRadial->fx /= 65536.;
|
||||
pRadial->fy /= 65536.;
|
||||
x = outerRadius / 65536.;
|
||||
pRadial->a = x * x - pRadial->dx * pRadial->dx - pRadial->dy * pRadial->dy;
|
||||
|
||||
if (!GradientPictureInit (pPicture,
|
||||
(PictGradientPtr) pRadial,
|
||||
SourcePictTypeRadial,
|
||||
nStops, stops, colors, error))
|
||||
{
|
||||
xfree (pPicture);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pPicture->id = pid;
|
||||
pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient));
|
||||
if (!pPicture->pSourcePict) {
|
||||
*error = BadAlloc;
|
||||
xfree(pPicture);
|
||||
return 0;
|
||||
}
|
||||
radial = &pPicture->pSourcePict->radial;
|
||||
|
||||
radial->type = SourcePictTypeRadial;
|
||||
{
|
||||
double x = (double)innerRadius / (double)outerRadius;
|
||||
radial->dx = (outer->x - inner->x);
|
||||
radial->dy = (outer->y - inner->y);
|
||||
radial->fx = (inner->x) - x*radial->dx;
|
||||
radial->fy = (inner->y) - x*radial->dy;
|
||||
radial->m = 1./(1+x);
|
||||
radial->b = -x*radial->m;
|
||||
radial->dx /= 65536.;
|
||||
radial->dy /= 65536.;
|
||||
radial->fx /= 65536.;
|
||||
radial->fy /= 65536.;
|
||||
x = outerRadius/65536.;
|
||||
radial->a = x*x - radial->dx*radial->dx - radial->dy*radial->dy;
|
||||
}
|
||||
|
||||
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
|
||||
if (*error) {
|
||||
xfree(pPicture);
|
||||
return 0;
|
||||
}
|
||||
return pPicture;
|
||||
}
|
||||
|
||||
|
|
@ -1114,36 +1196,42 @@ PicturePtr
|
|||
CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle,
|
||||
int nStops, xFixed *stops, xRenderColor *colors, int *error)
|
||||
{
|
||||
PicturePtr pPicture;
|
||||
PicturePtr pPicture;
|
||||
PictConicalGradientPtr pConical;
|
||||
|
||||
if (nStops < 2) {
|
||||
*error = BadValue;
|
||||
return 0;
|
||||
if (nStops < 2)
|
||||
{
|
||||
*error = BadValue;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pPicture = createSourcePicture();
|
||||
if (!pPicture) {
|
||||
*error = BadAlloc;
|
||||
return 0;
|
||||
pPicture = xalloc (sizeof (PictureRec) +
|
||||
sizeof (PictConicalGradient) +
|
||||
sizeof (PictGradientStop) * nStops);
|
||||
if (!pPicture)
|
||||
{
|
||||
*error = BadAlloc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pConical = (PictConicalGradientPtr) (pPicture + 1);
|
||||
pConical->stops = (PictGradientStopPtr) (pConical + 1);
|
||||
pConical->nstops = nStops;
|
||||
|
||||
pConical->center = *center;
|
||||
pConical->angle = angle;
|
||||
|
||||
if (!GradientPictureInit (pPicture,
|
||||
(PictGradientPtr) pConical,
|
||||
SourcePictTypeConical,
|
||||
nStops, stops, colors, error))
|
||||
{
|
||||
xfree (pPicture);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pPicture->id = pid;
|
||||
pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictConicalGradient));
|
||||
if (!pPicture->pSourcePict) {
|
||||
*error = BadAlloc;
|
||||
xfree(pPicture);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pPicture->pSourcePict->conical.type = SourcePictTypeConical;
|
||||
pPicture->pSourcePict->conical.center = *center;
|
||||
pPicture->pSourcePict->conical.angle = angle;
|
||||
|
||||
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
|
||||
if (*error) {
|
||||
xfree(pPicture);
|
||||
return 0;
|
||||
}
|
||||
return pPicture;
|
||||
}
|
||||
|
||||
|
|
@ -1463,9 +1551,8 @@ SetPictureTransform (PicturePtr pPicture,
|
|||
{ 0x00000, xFixed1, 0x00000 },
|
||||
{ 0x00000, 0x00000, xFixed1 },
|
||||
} };
|
||||
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int result;
|
||||
PictureScreenPtr ps = pPicture->pDrawable ? GetPictureScreen(pPicture->pDrawable->pScreen) : 0;
|
||||
int result = 0;
|
||||
|
||||
if (transform && memcmp (transform, &identity, sizeof (PictTransform)) == 0)
|
||||
transform = 0;
|
||||
|
|
@ -1489,7 +1576,7 @@ SetPictureTransform (PicturePtr pPicture,
|
|||
}
|
||||
}
|
||||
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
|
||||
|
||||
if (ps)
|
||||
result = (*ps->ChangePictureTransform) (pPicture, transform);
|
||||
|
||||
return result;
|
||||
|
|
@ -1608,15 +1695,11 @@ FreePicture (pointer value,
|
|||
|
||||
if (--pPicture->refcnt == 0)
|
||||
{
|
||||
if (pPicture->transform)
|
||||
xfree (pPicture->transform);
|
||||
if (!pPicture->pDrawable) {
|
||||
if (pPicture->pSourcePict) {
|
||||
if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
|
||||
xfree(pPicture->pSourcePict->linear.stops);
|
||||
xfree(pPicture->pSourcePict);
|
||||
}
|
||||
} else {
|
||||
if (pPicture->transform)
|
||||
xfree (pPicture->transform);
|
||||
|
||||
if (pPicture->pDrawable)
|
||||
{
|
||||
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
|
||||
|
|
@ -1645,6 +1728,10 @@ FreePicture (pointer value,
|
|||
(*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable);
|
||||
}
|
||||
}
|
||||
|
||||
if (pPicture->pSourcePict && pPicture->pSourcePict->source.Destroy)
|
||||
(*pPicture->pSourcePict->source.Destroy) (pPicture);
|
||||
|
||||
xfree (pPicture);
|
||||
}
|
||||
return Success;
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ typedef struct _Picture *PicturePtr;
|
|||
#define PICT_TYPE_ABGR 3
|
||||
#define PICT_TYPE_COLOR 4
|
||||
#define PICT_TYPE_GRAY 5
|
||||
#define PICT_TYPE_YUY2 6
|
||||
#define PICT_TYPE_YV12 7
|
||||
|
||||
#define PICT_FORMAT_COLOR(f) (PICT_FORMAT_TYPE(f) & 2)
|
||||
|
||||
|
|
@ -115,6 +117,11 @@ typedef struct _Picture *PicturePtr;
|
|||
|
||||
#define PICT_g1 PICT_FORMAT(1,PICT_TYPE_GRAY,0,0,0,0)
|
||||
|
||||
/* YUV formats */
|
||||
#define PICT_yuy2 PICT_FORMAT(16,PICT_TYPE_YUY2,0,0,0,0)
|
||||
#define PICT_yv12 PICT_FORMAT(12,PICT_TYPE_YV12,0,0,0,0)
|
||||
|
||||
|
||||
/*
|
||||
* For dynamic indexed visuals (GrayScale and PseudoColor), these control the
|
||||
* selection of colors allocated for drawing to Pictures. The default
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@
|
|||
#include "scrnintstr.h"
|
||||
#include "resource.h"
|
||||
|
||||
#define PictTypeOther 0xff
|
||||
|
||||
typedef struct _DirectFormat {
|
||||
CARD16 red, redMask;
|
||||
CARD16 green, greenMask;
|
||||
|
|
@ -62,43 +64,79 @@ typedef struct _PictTransform {
|
|||
xFixed matrix[3][3];
|
||||
} PictTransform, *PictTransformPtr;
|
||||
|
||||
typedef void (*DestroySourcePictProcPtr) (PicturePtr pPicture);
|
||||
|
||||
#define PICT_GRADIENT_STOPTABLE_SIZE 1024
|
||||
#define SourcePictTypeSolidFill 0
|
||||
#define SourcePictTypeLinear 1
|
||||
#define SourcePictTypeRadial 2
|
||||
#define SourcePictTypeConical 3
|
||||
#define SourcePictTypeLinear 1
|
||||
#define SourcePictTypeRadial 2
|
||||
#define SourcePictTypeConical 3
|
||||
#define SourcePictTypeOther 4
|
||||
|
||||
#define SourcePictClassUnknown 0
|
||||
#define SourcePictClassHorizontal 1
|
||||
#define SourcePictClassVertical 2
|
||||
|
||||
typedef struct _PictSource {
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
DevUnion devPrivate;
|
||||
DestroySourcePictProcPtr Destroy;
|
||||
} PictSourceRec, *PictSourcePtr;
|
||||
|
||||
typedef struct _PictSolidFill {
|
||||
unsigned int type;
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
DevUnion devPrivate;
|
||||
DestroySourcePictProcPtr Destroy;
|
||||
CARD32 color;
|
||||
} PictSolidFill, *PictSolidFillPtr;
|
||||
|
||||
typedef struct _PictGradientStop {
|
||||
xFixed x;
|
||||
xRenderColor color;
|
||||
CARD32 color;
|
||||
} PictGradientStop, *PictGradientStopPtr;
|
||||
|
||||
typedef struct _PictGradient {
|
||||
unsigned int type;
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
DevUnion devPrivate;
|
||||
DestroySourcePictProcPtr Destroy;
|
||||
int nstops;
|
||||
PictGradientStopPtr stops;
|
||||
CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
|
||||
int stopRange;
|
||||
CARD32 *colorTable;
|
||||
int colorTableSize;
|
||||
} PictGradient, *PictGradientPtr;
|
||||
|
||||
typedef struct _PictLinearGradient {
|
||||
unsigned int type;
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
DevUnion devPrivate;
|
||||
DestroySourcePictProcPtr Destroy;
|
||||
int nstops;
|
||||
PictGradientStopPtr stops;
|
||||
CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
|
||||
int stopRange;
|
||||
CARD32 *colorTable;
|
||||
int colorTableSize;
|
||||
xPointFixed p1;
|
||||
xPointFixed p2;
|
||||
} PictLinearGradient, *PictLinearGradientPtr;
|
||||
|
||||
typedef struct _PictRadialGradient {
|
||||
unsigned int type;
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
DevUnion devPrivate;
|
||||
DestroySourcePictProcPtr Destroy;
|
||||
int nstops;
|
||||
PictGradientStopPtr stops;
|
||||
CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
|
||||
int stopRange;
|
||||
CARD32 *colorTable;
|
||||
int colorTableSize;
|
||||
xPointFixed inner;
|
||||
xPointFixed outer;
|
||||
xFixed inner_radius;
|
||||
xFixed outer_radius;
|
||||
double fx;
|
||||
double fy;
|
||||
double dx;
|
||||
|
|
@ -109,16 +147,22 @@ typedef struct _PictRadialGradient {
|
|||
} PictRadialGradient, *PictRadialGradientPtr;
|
||||
|
||||
typedef struct _PictConicalGradient {
|
||||
unsigned int type;
|
||||
unsigned int type;
|
||||
unsigned int class;
|
||||
DevUnion devPrivate;
|
||||
DestroySourcePictProcPtr Destroy;
|
||||
int nstops;
|
||||
PictGradientStopPtr stops;
|
||||
CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
|
||||
int stopRange;
|
||||
CARD32 *colorTable;
|
||||
int colorTableSize;
|
||||
xPointFixed center;
|
||||
xFixed angle;
|
||||
} PictConicalGradient, *PictConicalGradientPtr;
|
||||
|
||||
typedef union _SourcePict {
|
||||
unsigned int type;
|
||||
PictSourceRec source;
|
||||
PictSolidFill solidFill;
|
||||
PictGradient gradient;
|
||||
PictLinearGradient linear;
|
||||
|
|
@ -614,6 +658,11 @@ Bool
|
|||
PictureTransformPoint3d (PictTransformPtr transform,
|
||||
PictVectorPtr vector);
|
||||
|
||||
CARD32
|
||||
PictureGradientColor (PictGradientStopPtr stop1,
|
||||
PictGradientStopPtr stop2,
|
||||
CARD32 x);
|
||||
|
||||
void RenderExtensionInit (void);
|
||||
|
||||
Bool
|
||||
|
|
@ -629,6 +678,10 @@ AddTraps (PicturePtr pPicture,
|
|||
int ntraps,
|
||||
xTrap *traps);
|
||||
|
||||
PicturePtr
|
||||
CreateDevicePicture (Picture pid,
|
||||
int *error);
|
||||
|
||||
PicturePtr
|
||||
CreateSolidPicture (Picture pid,
|
||||
xRenderColor *color,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XdotOrg: xc/programs/Xserver/render/render.c,v 1.8 2005/07/01 10:05:43 lars Exp $ */
|
||||
/* $XdotOrg: xserver/xorg/render/render.c,v 1.12 2005/08/28 19:47:39 ajax Exp $ */
|
||||
/*
|
||||
* $XFree86: xc/programs/Xserver/render/render.c,v 1.27tsi Exp $
|
||||
*
|
||||
|
|
@ -389,7 +389,14 @@ ProcRenderQueryPictFormats (ClientPtr client)
|
|||
}
|
||||
ps = GetPictureScreenIfSet(pScreen);
|
||||
if (ps)
|
||||
nformat += ps->nformats;
|
||||
{
|
||||
for (d = 0; d < ps->nformats; d++)
|
||||
{
|
||||
if (ps->formats[d].type == PictTypeIndexed ||
|
||||
ps->formats[d].type == PictTypeDirect)
|
||||
nformat++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pRenderClient->major_version == 0 && pRenderClient->minor_version < 6)
|
||||
numSubpixel = 0;
|
||||
|
|
@ -426,6 +433,10 @@ ProcRenderQueryPictFormats (ClientPtr client)
|
|||
nformat < ps->nformats;
|
||||
nformat++, pFormat++)
|
||||
{
|
||||
if (pFormat->type != PictTypeIndexed &&
|
||||
pFormat->type != PictTypeDirect)
|
||||
continue;
|
||||
|
||||
pictForm->id = pFormat->id;
|
||||
pictForm->type = pFormat->type;
|
||||
pictForm->depth = pFormat->depth;
|
||||
|
|
@ -749,8 +760,8 @@ ProcRenderComposite (ClientPtr client)
|
|||
RenderErrBase + BadPicture);
|
||||
VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess,
|
||||
RenderErrBase + BadPicture);
|
||||
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
|
||||
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
|
||||
if (pSrc->pDrawable && ((pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
|
||||
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)))
|
||||
return BadMatch;
|
||||
CompositePicture (stuff->op,
|
||||
pSrc,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue