summaryrefslogtreecommitdiff
path: root/glx/glxcmds.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2012-11-09 17:52:12 -0500
committerAdam Jackson <ajax@redhat.com>2013-09-11 14:37:32 -0400
commit22fbfdcb31f335c22053a0e29f0e73c03cd70a76 (patch)
tree73b3f1e440cd31856446e61a4a3e3c428983282e /glx/glxcmds.c
parent2e20b8382cdf37ae5a2802f85b8f06a370f9645d (diff)
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>
Diffstat (limited to 'glx/glxcmds.c')
-rw-r--r--glx/glxcmds.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 553b3b652..27a68aa37 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1457,7 +1457,6 @@ __glXDisp_CreatePbuffer(__GLXclientState * cl, GLbyte * pc)
height = attrs[i * 2 + 1];
break;
case GLX_LARGEST_PBUFFER:
- case GLX_PRESERVED_CONTENTS:
/* FIXME: huh... */
break;
}
@@ -1475,6 +1474,10 @@ __glXDisp_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc)
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,
req->width, req->height, req->pbuffer);
}
@@ -1892,7 +1895,7 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
ClientPtr client = cl->client;
xGLXGetDrawableAttributesReply reply;
__GLXdrawable *pGlxDraw;
- CARD32 attributes[12];
+ CARD32 attributes[14];
int numAttribs = 0, error;
if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
@@ -1918,6 +1921,11 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
attributes[10] = GLX_FBCONFIG_ID;
attributes[11] = pGlxDraw->config->fbconfigID;
numAttribs++;
+ if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER) {
+ attributes[12] = GLX_PRESERVED_CONTENTS;
+ attributes[13] = GL_TRUE;
+ numAttribs++;
+ }
reply = (xGLXGetDrawableAttributesReply) {
.type = X_Reply,