diff options
author | marha <marha@users.sourceforge.net> | 2012-03-23 10:05:55 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-23 10:05:55 +0100 |
commit | 0f834b91a4768673833ab4917e87d86c237bb1a6 (patch) | |
tree | 363489504ed4b2d360259b8de4c9e392918e5d02 /xorg-server/glx/indirect_texture_compression.c | |
parent | fc72edebf875378459368c5383d9023730cbca54 (diff) | |
download | vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.gz vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.bz2 vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.zip |
libX11 xserver fontconfig mesa pixman xkbcomp xkeyboard-config git update
23 Mar 2012
Diffstat (limited to 'xorg-server/glx/indirect_texture_compression.c')
-rw-r--r-- | xorg-server/glx/indirect_texture_compression.c | 129 |
1 files changed, 70 insertions, 59 deletions
diff --git a/xorg-server/glx/indirect_texture_compression.c b/xorg-server/glx/indirect_texture_compression.c index 5f44d7b1a..49d6db57f 100644 --- a/xorg-server/glx/indirect_texture_compression.c +++ b/xorg-server/glx/indirect_texture_compression.c @@ -39,80 +39,91 @@ #include "glthread.h" #include "dispatch.h" -int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc) +int +__glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte * pc) { - xGLXSingleReq * const req = (xGLXSingleReq *) pc; + xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; - __GLXcontext * const cx = __glXForceCurrent( cl, req->contextTag, & error ); + __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); ClientPtr client = cl->client; - pc += __GLX_SINGLE_HDR_SIZE; - if ( cx != NULL ) { - const GLenum target = *(GLenum *)(pc + 0); - const GLint level = *(GLint *)(pc + 4); - GLint compsize = 0; - char *answer = NULL, answerBuffer[200]; - - CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize)); - - if ( compsize != 0 ) { - __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); - __glXClearErrorOccured(); - CALL_GetCompressedTexImageARB(GET_DISPATCH(), (target, level, answer)); - } - - if (__glXErrorOccured()) { - __GLX_BEGIN_REPLY(0); - __GLX_SEND_HEADER(); - } else { - __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *)&__glXReply)->width = compsize; - __GLX_SEND_HEADER(); - __GLX_SEND_VOID_ARRAY(compsize); - } - - error = Success; + if (cx != NULL) { + const GLenum target = *(GLenum *) (pc + 0); + const GLint level = *(GLint *) (pc + 4); + GLint compsize = 0; + char *answer = NULL, answerBuffer[200]; + + CALL_GetTexLevelParameteriv(GET_DISPATCH(), + (target, level, + GL_TEXTURE_COMPRESSED_IMAGE_SIZE, + &compsize)); + + if (compsize != 0) { + __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); + __glXClearErrorOccured(); + CALL_GetCompressedTexImageARB(GET_DISPATCH(), + (target, level, answer)); + } + + if (__glXErrorOccured()) { + __GLX_BEGIN_REPLY(0); + __GLX_SEND_HEADER(); + } + else { + __GLX_BEGIN_REPLY(compsize); + ((xGLXGetTexImageReply *) & __glXReply)->width = compsize; + __GLX_SEND_HEADER(); + __GLX_SEND_VOID_ARRAY(compsize); + } + + error = Success; } return error; } - -int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc) +int +__glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, + GLbyte * pc) { - xGLXSingleReq * const req = (xGLXSingleReq *) pc; + xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; - __GLXcontext * const cx = __glXForceCurrent( cl, bswap_32( req->contextTag ), & error ); + __GLXcontext *const cx = + __glXForceCurrent(cl, bswap_32(req->contextTag), &error); ClientPtr client = cl->client; - pc += __GLX_SINGLE_HDR_SIZE; - if ( cx != NULL ) { - const GLenum target = (GLenum) bswap_32( *(int *)(pc + 0) ); - const GLint level = (GLint ) bswap_32( *(int *)(pc + 4) ); - GLint compsize = 0; - char *answer = NULL, answerBuffer[200]; - - CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize)); - - if ( compsize != 0 ) { - __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); - __glXClearErrorOccured(); - CALL_GetCompressedTexImageARB(GET_DISPATCH(), (target, level, answer)); - } - - if (__glXErrorOccured()) { - __GLX_BEGIN_REPLY(0); - __GLX_SEND_HEADER(); - } else { - __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *)&__glXReply)->width = compsize; - __GLX_SEND_HEADER(); - __GLX_SEND_VOID_ARRAY(compsize); - } - - error = Success; + if (cx != NULL) { + const GLenum target = (GLenum) bswap_32(*(int *) (pc + 0)); + const GLint level = (GLint) bswap_32(*(int *) (pc + 4)); + GLint compsize = 0; + char *answer = NULL, answerBuffer[200]; + + CALL_GetTexLevelParameteriv(GET_DISPATCH(), + (target, level, + GL_TEXTURE_COMPRESSED_IMAGE_SIZE, + &compsize)); + + if (compsize != 0) { + __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1); + __glXClearErrorOccured(); + CALL_GetCompressedTexImageARB(GET_DISPATCH(), + (target, level, answer)); + } + + if (__glXErrorOccured()) { + __GLX_BEGIN_REPLY(0); + __GLX_SEND_HEADER(); + } + else { + __GLX_BEGIN_REPLY(compsize); + ((xGLXGetTexImageReply *) & __glXReply)->width = compsize; + __GLX_SEND_HEADER(); + __GLX_SEND_VOID_ARRAY(compsize); + } + + error = Success; } return error; |