Revision: 152 http://trac.macosforge.org/projects/xquartz/changeset/152 Author: gstaplin@apple.com Date: 2009-02-16 15:02:51 -0800 (Mon, 16 Feb 2009) Log Message: ----------- Finish the XAppleDRIDestroyPixmap code and X protocol data. Modified Paths: -------------- AppleSGLX/trunk/appledri.c AppleSGLX/trunk/appledri.h AppleSGLX/trunk/appledristr.h Modified: AppleSGLX/trunk/appledri.c =================================================================== --- AppleSGLX/trunk/appledri.c 2009-02-16 22:51:15 UTC (rev 151) +++ AppleSGLX/trunk/appledri.c 2009-02-16 23:02:51 UTC (rev 152) @@ -386,14 +386,14 @@ req->drawable = drawable; if(!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - puts("REPLY ERROR"); - UnlockDisplay(dpy); SyncHandle(); return False; } + /* printf("rep.stringLength %d\n", (int) rep.stringLength); + */ if(rep.stringLength > 0 && rep.stringLength <= bufnamesize) { _XReadPad(dpy, bufname, rep.stringLength); @@ -417,6 +417,23 @@ return True; } -void XAppleDRIDestroyPixmap(Display *dpy, Pixmap pixmap) { +/* + * Call it a drawable, because we really don't know what it is + * until it reaches the server, and we should keep that in mind. + */ +Bool XAppleDRIDestroyPixmap(Display *dpy, Pixmap drawable) { + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIDestroyPixmapReq *req; + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIDestroyPixmap, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIDestroyPixmap; + req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); + + return True; } Modified: AppleSGLX/trunk/appledri.h =================================================================== --- AppleSGLX/trunk/appledri.h 2009-02-16 22:51:15 UTC (rev 151) +++ AppleSGLX/trunk/appledri.h 2009-02-16 23:02:51 UTC (rev 152) @@ -50,8 +50,8 @@ #define X_AppleDRICreateSharedBuffer 5 #define X_AppleDRISwapBuffers 6 #define X_AppleDRICreatePixmap 7 +#define X_AppleDRIDestroyPixmap 8 - /* Requests up to and including 18 were used in a previous version */ /* Events */ @@ -116,7 +116,7 @@ int *width, int *height, size_t *size, char *bufname, size_t bufnamesize); -void XAppleDRIDestroyPixmap(Display *dpy, Pixmap pixmap); +Bool XAppleDRIDestroyPixmap(Display *dpy, Pixmap pixmap); _XFUNCPROTOEND Modified: AppleSGLX/trunk/appledristr.h =================================================================== --- AppleSGLX/trunk/appledristr.h 2009-02-16 22:51:15 UTC (rev 151) +++ AppleSGLX/trunk/appledristr.h 2009-02-16 23:02:51 UTC (rev 152) @@ -223,6 +223,15 @@ #define sz_xAppleDRICreatePixmapReply 32 +typedef struct { + CARD8 reqType; /*1*/ + CARD8 driReqType; /*2*/ + CARD16 length; /*4*/ + CARD32 drawable B32; /*8*/ +} xAppleDRIDestroyPixmapReq; + +#define sz_xAppleDRIDestroyPixmapReq 8 + #ifdef _APPLEDRI_SERVER_ void AppleDRISendEvent (
participants (1)
-
source_changes@macosforge.org