diff options
Diffstat (limited to 'glx/glxdri2.c')
-rw-r--r-- | glx/glxdri2.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 8d21c937b..027615ae2 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -88,6 +88,7 @@ struct __GLXDRIdrawable { __GLXdrawable base; __DRIdrawable *driDrawable; __GLXDRIscreen *screen; + DRI2DrawablePtr pDRI2Draw; /* Dimensions as last reported by DRI2GetBuffers. */ int width; @@ -123,7 +124,7 @@ __glXDRIdrawableCopySubBuffer(__GLXdrawable *drawable, box.y2 = private->height - y; RegionInit(®ion, &box, 0); - DRI2CopyRegion(drawable->pDraw, ®ion, + DRI2CopyRegion(private->pDRI2Draw, ®ion, DRI2BufferFrontLeft, DRI2BufferBackLeft); } @@ -140,7 +141,7 @@ __glXDRIdrawableWaitX(__GLXdrawable *drawable) box.y2 = private->height; RegionInit(®ion, &box, 0); - DRI2CopyRegion(drawable->pDraw, ®ion, + DRI2CopyRegion(private->pDRI2Draw, ®ion, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); } @@ -157,7 +158,7 @@ __glXDRIdrawableWaitGL(__GLXdrawable *drawable) box.y2 = private->height; RegionInit(®ion, &box, 0); - DRI2CopyRegion(drawable->pDraw, ®ion, + DRI2CopyRegion(private->pDRI2Draw, ®ion, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); } @@ -220,7 +221,7 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable) (*screen->flush->flushInvalidate)(priv->driDrawable); #endif - if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused, + if (DRI2SwapBuffers(client, priv->pDRI2Draw, 0, 0, 0, &unused, __glXdriSwapEvent, drawable->pDraw) != Success) return FALSE; @@ -230,10 +231,11 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable) static int __glXDRIdrawableSwapInterval(__GLXdrawable *drawable, int interval) { + __GLXDRIdrawable *priv = (__GLXDRIdrawable *) drawable; if (interval <= 0) /* || interval > BIGNUM? */ return GLX_BAD_VALUE; - DRI2SwapInterval(drawable->pDraw, interval); + DRI2SwapInterval(priv->pDRI2Draw, interval); return 0; } @@ -300,7 +302,8 @@ static Bool __glXDRIcontextWait(__GLXcontext *baseContext, __GLXclientState *cl, int *error) { - if (DRI2WaitSwap(cl->client, baseContext->drawPriv->pDraw)) { + __GLXDRIdrawable *priv = (__GLXDRIdrawable *) baseContext->drawPriv; + if (DRI2WaitSwap(cl->client, priv->pDRI2Draw)) { *error = cl->client->noClientException; return TRUE; } @@ -428,7 +431,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, } static void -__glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv) +__glXDRIinvalidateBuffers(DRI2DrawablePtr pDRI2Draw, void *priv, XID id) { #if __DRI2_FLUSH_VERSION >= 3 __GLXDRIdrawable *private = priv; @@ -475,6 +478,8 @@ __glXDRIscreenCreateDrawable(ClientPtr client, return NULL; } + private->pDRI2Draw = DRI2GetDrawable(pDraw); + private->driDrawable = (*driScreen->dri2->createNewDrawable)(driScreen->driScreen, config->driConfig, private); @@ -493,7 +498,7 @@ dri2GetBuffers(__DRIdrawable *driDrawable, int i; int j; - buffers = DRI2GetBuffers(private->base.pDraw, + buffers = DRI2GetBuffers(private->pDRI2Draw, width, height, attachments, count, out_count); if (*out_count > MAX_DRAWABLE_BUFFERS) { *out_count = 0; @@ -537,7 +542,7 @@ dri2GetBuffersWithFormat(__DRIdrawable *driDrawable, int i; int j = 0; - buffers = DRI2GetBuffersWithFormat(private->base.pDraw, + buffers = DRI2GetBuffersWithFormat(private->pDRI2Draw, width, height, attachments, count, out_count); if (*out_count > MAX_DRAWABLE_BUFFERS) { |