glFlush before CopySubBuffer, fix coordinates and extension name typo.
authorKristian Høgsberg <krh@redhat.com>
Wed, 12 Nov 2008 20:24:45 +0000 (15:24 -0500)
committerKristian Høgsberg <krh@redhat.com>
Wed, 12 Nov 2008 20:26:25 +0000 (15:26 -0500)
src/glx/x11/dri2_glx.c
src/glx/x11/dri_common.c
src/glx/x11/glxcmds.c

index c16df6b7c2f78690037ae80f3aef6ae5480f4b44..2bee67780bde8defb78725b362af5f7e03be45c6 100644 (file)
@@ -186,11 +186,12 @@ static __GLXDRIdrawable *dri2CreateDrawable(__GLXscreenConfigs *psc,
 static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw,
                              int x, int y, int width, int height)
 {
+    __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
     XRectangle xrect;
     XserverRegion region;
 
     xrect.x = x;
-    xrect.y = y;
+    xrect.y = priv->height - y - height;
     xrect.width = width;
     xrect.height = height;
 
@@ -331,7 +332,11 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
     psp->createContext = dri2CreateContext;
     psp->createDrawable = dri2CreateDrawable;
     psp->swapBuffers = dri2SwapBuffers;
+
+    /* DRI2 suports SubBuffer through DRI2CopyRegion, so it's always
+     * available.*/
     psp->copySubBuffer = dri2CopySubBuffer;
+    __glXEnableDirectExtension(psc, "GLX_MESA_copy_sub_buffer");
 
     Xfree(driverName);
     Xfree(deviceName);
index fcb579f3bf83f5034c4e7ec3f8a359636e23bf64..4fda649e59ab7160b3d737401097bd68cf55975b 100644 (file)
@@ -340,7 +340,7 @@ driBindExtensions(__GLXscreenConfigs *psc, int dri2)
 #ifdef __DRI_COPY_SUB_BUFFER
        if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
            psc->driCopySubBuffer = (__DRIcopySubBufferExtension *) extensions[i];
-           __glXEnableDirectExtension(psc, "GLX_MESA_copy_sub_buffer_bit");
+           __glXEnableDirectExtension(psc, "GLX_MESA_copy_sub_buffer");
        }
 #endif
 
index 4e2641bd6966e3770bc5d1667649172c096c46aa..391e0be05e7a3e0faacf69bb9f360bd4aebd3cc0 100644 (file)
@@ -2500,6 +2500,7 @@ static void __glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable,
     if ( pdraw != NULL ) {
        __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
        if (psc->driScreen->copySubBuffer != NULL) {
+           glFlush();      
            (*psc->driScreen->copySubBuffer)(pdraw, x, y, width, height);
        }