glx: Implement GLX_PRESERVED_CONTENTS drawable attribute

We back pixmaps with pbuffers so they're never actually clobbered.  Say
so when asked.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2012-11-09 17:52:12 -05:00
parent 2e20b8382c
commit 22fbfdcb31

View File

@ -1457,7 +1457,6 @@ __glXDisp_CreatePbuffer(__GLXclientState * cl, GLbyte * pc)
height = attrs[i * 2 + 1]; height = attrs[i * 2 + 1];
break; break;
case GLX_LARGEST_PBUFFER: case GLX_LARGEST_PBUFFER:
case GLX_PRESERVED_CONTENTS:
/* FIXME: huh... */ /* FIXME: huh... */
break; break;
} }
@ -1475,6 +1474,10 @@ __glXDisp_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc)
REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq); REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq);
/*
* We should really handle attributes correctly, but this extension
* is so rare I have difficulty caring.
*/
return DoCreatePbuffer(cl->client, req->screen, req->fbconfig, return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
req->width, req->height, req->pbuffer); req->width, req->height, req->pbuffer);
} }
@ -1892,7 +1895,7 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXGetDrawableAttributesReply reply; xGLXGetDrawableAttributesReply reply;
__GLXdrawable *pGlxDraw; __GLXdrawable *pGlxDraw;
CARD32 attributes[12]; CARD32 attributes[14];
int numAttribs = 0, error; int numAttribs = 0, error;
if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
@ -1918,6 +1921,11 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
attributes[10] = GLX_FBCONFIG_ID; attributes[10] = GLX_FBCONFIG_ID;
attributes[11] = pGlxDraw->config->fbconfigID; attributes[11] = pGlxDraw->config->fbconfigID;
numAttribs++; numAttribs++;
if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER) {
attributes[12] = GLX_PRESERVED_CONTENTS;
attributes[13] = GL_TRUE;
numAttribs++;
}
reply = (xGLXGetDrawableAttributesReply) { reply = (xGLXGetDrawableAttributesReply) {
.type = X_Reply, .type = X_Reply,