diff options
author | David Reveman <davidr@novell.com> | 2008-01-25 16:17:04 -0500 |
---|---|---|
committer | David Reveman <davidr@novell.com> | 2008-01-25 16:17:04 -0500 |
commit | 5934d2734d94ce92d08a0a81078d75aabf5ebb1e (patch) | |
tree | e74732ae116070ceba6e1288dd0ac75976d3c267 | |
parent | 4e65c6ec69af131def0f92bb85eee84aab54aacd (diff) |
Handle root window size changes properly by checking if size of
drawable changed instead of if the pixmap changed.
-rw-r--r-- | hw/xgl/glxext/xglglxext.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/hw/xgl/glxext/xglglxext.c b/hw/xgl/glxext/xglglxext.c index c2fcdd906..0f1f11c90 100644 --- a/hw/xgl/glxext/xglglxext.c +++ b/hw/xgl/glxext/xglglxext.c @@ -69,12 +69,12 @@ typedef struct _xglGLBuffer { xglVisualPtr pVisual; glitz_drawable_t *drawable; glitz_surface_t *backSurface; - PixmapPtr pPixmap; GCPtr pGC; RegionRec damage; int screenX, screenY; int xOff, yOff; int yFlip; + int width, height; } xglGLBufferRec, *xglGLBufferPtr; typedef int xglGLXVisualConfigRec, *xglGLXVisualConfigPtr; @@ -5562,7 +5562,6 @@ xglCreateDrawable (__GLXcontext *context, pBufferPriv->pScreen = pScreen; pBufferPriv->pDrawable = NULL; - pBufferPriv->pPixmap = NULL; pBufferPriv->pGC = NULL; pBufferPriv->base.destroy = xglDestroyDrawable; @@ -5573,6 +5572,9 @@ xglCreateDrawable (__GLXcontext *context, pBufferPriv->drawable = NULL; pBufferPriv->backSurface = NULL; + pBufferPriv->width = -1; + pBufferPriv->height = -1; + REGION_INIT (pScreen, &pBufferPriv->damage, NullBox, 0); pBufferPriv->pVisual = 0; @@ -5903,8 +5905,10 @@ xglMakeCurrent (__GLXcontext *context) ValidateGC (pDrawBufferPriv->pDrawable, pDrawBufferPriv->pGC); - pReadBufferPriv->pPixmap = (PixmapPtr) 0; - pDrawBufferPriv->pPixmap = (PixmapPtr) 0; + pReadBufferPriv->width = -1; + pReadBufferPriv->height = -1; + pDrawBufferPriv->width = -1; + pDrawBufferPriv->height = -1; pContext->pReadBuffer = pReadBufferPriv; pContext->pDrawBuffer = pDrawBufferPriv; @@ -6021,17 +6025,25 @@ xglForceCurrent (__GLXcontext *context) } /* buffer changed */ - if (cctx->pDrawBuffer->pPixmap != pDrawPixmap || - cctx->pReadBuffer->pPixmap != pReadPixmap) + if (cctx->pDrawBuffer->width != pDrawPixmap->drawable.width || + cctx->pDrawBuffer->height != pDrawPixmap->drawable.height) { if (!xglResizeBuffer (cctx->pDrawBuffer)) return FALSE; + cctx->pDrawBuffer->width = pDrawPixmap->drawable.width; + cctx->pDrawBuffer->height = pDrawPixmap->drawable.height; + } + + /* buffer changed */ + if (cctx->pReadBuffer->width != pReadPixmap->drawable.width || + cctx->pReadBuffer->height != pReadPixmap->drawable.height) + { if (!xglResizeBuffer (cctx->pReadBuffer)) return FALSE; - cctx->pReadBuffer->pPixmap = pReadPixmap; - cctx->pDrawBuffer->pPixmap = pDrawPixmap; + cctx->pReadBuffer->width = pReadPixmap->drawable.width; + cctx->pReadBuffer->height = pReadPixmap->drawable.height; } if (!xglSyncSurface (pContext->pDrawBuffer->pDrawable)) |