diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2009-04-09 14:31:01 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2009-04-10 12:00:36 -0700 |
commit | f1a995d1496d73741731e32f475097c44a8da972 (patch) | |
tree | 1625b7bb7d1483518bc0681419a532a7c86b8a79 | |
parent | aa2928325fe51d94a636dde9c090e8f54a311a12 (diff) |
DRI2: Do not send the real front buffer of a window to the client
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r-- | glx/glxdri2.c | 10 | ||||
-rw-r--r-- | hw/xfree86/dri2/dri2ext.c | 24 |
2 files changed, 32 insertions, 2 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c index c896536c8..ea5b5ef72 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -408,2 +408,3 @@ dri2GetBuffers(__DRIdrawable *driDrawable, int i; + int skip = 0; @@ -422,2 +423,10 @@ dri2GetBuffers(__DRIdrawable *driDrawable, for (i = 0; i < *out_count; i++) { + /* Do not send the real front buffer of a window to the client. + */ + if ((private->base.pDraw->type == DRAWABLE_WINDOW) + && (buffers[i].attachment == DRI2BufferFrontLeft)) { + skip++; + continue; + } + private->buffers[i].attachment = buffers[i].attachment; @@ -429,2 +438,3 @@ dri2GetBuffers(__DRIdrawable *driDrawable, + *out_count -= skip; return private->buffers; diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index d6e1c9689..503f82716 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -204,2 +204,3 @@ ProcDRI2GetBuffers(ClientPtr client) xDRI2Buffer buffer; + int skip; @@ -213,4 +214,16 @@ ProcDRI2GetBuffers(ClientPtr client) + skip = 0; + if (pDrawable->type == DRAWABLE_WINDOW) { + for (i = 0; i < count; i++) { + /* Do not send the real front buffer of a window to the client. + */ + if (buffers[i].attachment == DRI2BufferFrontLeft) { + skip++; + continue; + } + } + } + rep.type = X_Reply; - rep.length = count * sizeof(xDRI2Buffer) / 4; + rep.length = (count - skip) * sizeof(xDRI2Buffer) / 4; rep.sequenceNumber = client->sequence; @@ -218,3 +231,3 @@ ProcDRI2GetBuffers(ClientPtr client) rep.height = height; - rep.count = count; + rep.count = count - skip; WriteToClient(client, sizeof(xDRI2GetBuffersReply), &rep); @@ -222,2 +235,9 @@ ProcDRI2GetBuffers(ClientPtr client) for (i = 0; i < count; i++) { + /* Do not send the real front buffer of a window to the client. + */ + if ((pDrawable->type == DRAWABLE_WINDOW) + && (buffers[i].attachment == DRI2BufferFrontLeft)) { + continue; + } + buffer.attachment = buffers[i].attachment; |