From: Francisco J. <cur...@ri...> - 2010-01-22 14:30:11
|
Signed-off-by: Francisco Jerez <cur...@ri...> --- glx/glxdri2.c | 31 ++++++++++++++++++++++++++++--- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 69fd39b..5cb15d9 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -67,6 +67,7 @@ struct __GLXDRIscreen { xf86EnterVTProc *enterVT; xf86LeaveVTProc *leaveVT; + PreConfigureWindowProcPtr PreConfigureWindow; const __DRIcoreExtension *core; const __DRIdri2Extension *dri2; @@ -217,13 +218,16 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable) __GLXDRIscreen *screen = priv->screen; CARD64 unused; - if (screen->flush) - (*screen->flush->flushInvalidate)(priv->driDrawable); - if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused, __glXdriSwapEvent, drawable->pDraw) != Success) return FALSE; + if (screen->flush) + (*screen->flush->invalidate)(priv->driDrawable); + + if (screen->flush && screen->flush->flushInvalidate) + (*screen->flush->flushInvalidate)(priv->driDrawable); + return TRUE; } @@ -607,6 +611,24 @@ glxDRILeaveVT (int index, int flags) } static void +glxDRIPreConfigureWindow(WindowPtr pWin, int x, int y, int w, int h, int bw, + WindowPtr pSib) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + __GLXDRIscreen *screen = (__GLXDRIscreen *)glxGetScreen(pScreen); + __GLXDRIdrawable *draw = (__GLXDRIdrawable *)glxGetDrawableFromWindow(pWin); + + if (screen->PreConfigureWindow) + (*screen->PreConfigureWindow)(pWin, x, y, w, h, bw, pSib); + + if (!draw || (draw->height == h && draw->width == w)) + return; + + if (screen->flush) + screen->flush->invalidate(draw->driDrawable); +} + +static void initializeExtensions(__GLXDRIscreen *screen) { const __DRIextension **extensions; @@ -782,6 +804,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->leaveVT = pScrn->LeaveVT; pScrn->LeaveVT = glxDRILeaveVT; + screen->PreConfigureWindow = pScreen->PreConfigureWindow; + pScreen->PreConfigureWindow = glxDRIPreConfigureWindow; + LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", filename); -- 1.6.4.4 |