summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2012-11-09 17:07:20 -0500
committerAdam Jackson <ajax@redhat.com>2013-09-11 14:37:32 -0400
commitd11f13e383dda1e9cabe32793d261d46edc44418 (patch)
treed73871985a98f7fd6a966513a0218c8cfc6dc67f /glx
parent468b57324f838144d79e3a9d85a0bde853578c4b (diff)
glx: Compute number of attributes in GetDrawableAttributes on the fly
This doesn't have any effect yet, but is needed to properly build the reply for pbuffers. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index cbbdae8e8..cecbf7bd3 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1893,27 +1893,29 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
xGLXGetDrawableAttributesReply reply;
__GLXdrawable *pGlxDraw;
CARD32 attributes[6];
- int numAttribs, error;
+ int numAttribs = 0, error;
if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
DixGetAttrAccess, &pGlxDraw, &error))
return error;
- numAttribs = 3;
- reply = (xGLXGetDrawableAttributesReply) {
- .type = X_Reply,
- .sequenceNumber = client->sequence,
- .length = numAttribs << 1,
- .numAttribs = numAttribs
- };
-
attributes[0] = GLX_TEXTURE_TARGET_EXT;
attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT :
GLX_TEXTURE_RECTANGLE_EXT;
+ numAttribs++;
attributes[2] = GLX_Y_INVERTED_EXT;
attributes[3] = GL_FALSE;
+ numAttribs++;
attributes[4] = GLX_EVENT_MASK;
attributes[5] = pGlxDraw->eventMask;
+ numAttribs++;
+
+ reply = (xGLXGetDrawableAttributesReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = numAttribs << 1,
+ .numAttribs = numAttribs
+ };
if (client->swapped) {
__glXSwapGetDrawableAttributesReply(client, &reply, attributes);