X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fx11%2Fdri_glx.c;h=44724d2c7d0ffce3ed21a356afca549eb4c3cc36;hb=b4866f8a5229d4769a49b4c54a1675a61497d206;hp=82653f1625b82cb51aa7b9b34ce8dbcd71821b5e;hpb=1e645b365900cf1c71ca5594bd6b549a1f203040;p=mesa.git diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index 82653f1625b..44724d2c7d0 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -37,7 +37,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include -#include "glheader.h" #include "glxclient.h" #include "glcontextmodes.h" #include "xf86dri.h" @@ -445,6 +444,7 @@ static void driDestroyContext(__GLXDRIcontext *context, (*psc->core->destroyContext)(pcp->driContext); XF86DRIDestroyContext(psc->dpy, psc->scr, pcp->hwContextID); + Xfree(pcp); } static Bool driBindContext(__GLXDRIcontext *context, @@ -569,6 +569,18 @@ static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc, return pdraw; } +static void driSwapBuffers(__GLXDRIdrawable *pdraw) +{ + (*pdraw->psc->core->swapBuffers)(pdraw->driDrawable); +} + +static void driCopySubBuffer(__GLXDRIdrawable *pdraw, + int x, int y, int width, int height) +{ + (*pdraw->psc->driCopySubBuffer->copySubBuffer)(pdraw->driDrawable, + x, y, width, height); +} + static void driDestroyScreen(__GLXscreenConfigs *psc) { /* Free the direct rendering per screen data */ @@ -636,10 +648,13 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen, } driBindExtensions(psc, 0); + if (psc->driCopySubBuffer) + psp->copySubBuffer = driCopySubBuffer; psp->destroyScreen = driDestroyScreen; psp->createContext = driCreateContext; psp->createDrawable = driCreateDrawable; + psp->swapBuffers = driSwapBuffers; return psp; }