DRI2: Assume that there is always a front buffer
authorIan Romanick <idr@freedesktop.org>
Mon, 6 Apr 2009 22:35:37 +0000 (15:35 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 9 Apr 2009 21:18:14 +0000 (14:18 -0700)
Assume that the front-buffer exists even if the server didn't tell the
client that it exists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
src/glx/x11/dri2_glx.c

index aa21a97023f9313e4bc3b71323e34c7de847c866..b6eeb913b66632951623e5eb9075c47d5c080479 100644 (file)
@@ -74,7 +74,6 @@ struct __GLXDRIdrawablePrivateRec {
     int bufferCount;
     int width, height;
     int have_back;
-    int have_front;
     int have_fake_front;
 };
 
@@ -195,7 +194,7 @@ static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw,
     XserverRegion region;
 
     /* Check we have the right attachments */
-    if (!(priv->have_front && priv->have_back))
+    if (!priv->have_back)
        return;
 
     xrect.x = x;
@@ -229,7 +228,7 @@ static void dri2WaitX(__GLXDRIdrawable *pdraw)
     XserverRegion region;
 
     /* Check we have the right attachments */
-    if (!(priv->have_fake_front && priv->have_front))
+    if (!priv->have_fake_front)
        return;
 
     xrect.x = 0;
@@ -254,7 +253,7 @@ static void dri2WaitGL(__GLXDRIdrawable *pdraw)
     XRectangle xrect;
     XserverRegion region;
 
-    if (!(priv->have_fake_front && priv->have_front))
+    if (!priv->have_fake_front)
        return;
 
     xrect.x = 0;
@@ -308,7 +307,6 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
     pdraw->width = *width;
     pdraw->height = *height;
     pdraw->bufferCount = *out_count;
-    pdraw->have_front = 0;
     pdraw->have_fake_front = 0;
     pdraw->have_back = 0;
 
@@ -320,8 +318,6 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
        pdraw->buffers[i].pitch = buffers[i].pitch;
        pdraw->buffers[i].cpp = buffers[i].cpp;
        pdraw->buffers[i].flags = buffers[i].flags;
-       if (pdraw->buffers[i].attachment == __DRI_BUFFER_FRONT_LEFT)
-           pdraw->have_front = 1;
        if (pdraw->buffers[i].attachment == __DRI_BUFFER_FAKE_FRONT_LEFT)
            pdraw->have_fake_front = 1;
        if (pdraw->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT)