diff options
author | Ben Skeggs <[email protected]> | 2006-12-08 03:01:33 +0000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2006-12-08 03:01:33 +0000 |
commit | 4cfb762c3eb2ea9a764c7ba0811c338ef5fba8fe (patch) | |
tree | 1fd9ce0a7a22e2bed4b4c83a374b78cf78c4b0f7 /src/mesa/drivers/dri/nouveau/nouveau_lock.c | |
parent | 3867bc97800ef3072a70565559c11badba3ed55a (diff) |
Some work on buffer handling, most likely not entirely correct and
incomplete. But, it works well enough that windows can be
moved/resized.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_lock.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_lock.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_lock.c b/src/mesa/drivers/dri/nouveau/nouveau_lock.c index 7dd67a143a9..c119d14dd75 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_lock.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_lock.c @@ -29,6 +29,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "nouveau_lock.h" #include "drirenderbuffer.h" +#include "framebuffer.h" /* Update the hardware state. This is called if another context has @@ -57,6 +58,23 @@ void nouveauGetLock( nouveauContextPtr nmesa, GLuint flags ) */ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); + /* If timestamps don't match, the window has been changed */ + if (nmesa->lastStamp != dPriv->lastStamp) { + struct gl_framebuffer *fb = (struct gl_framebuffer *)dPriv->driverPrivate; + + /* _mesa_resize_framebuffer will take care of calling the renderbuffer's + * AllocStorage function if we need more memory to hold it */ + if (fb->Width != dPriv->w || fb->Height != dPriv->h) { + _mesa_resize_framebuffer(nmesa->glCtx, fb, dPriv->w, dPriv->h); + /* resize buffers, will call nouveau_window_moved */ + nouveau_build_framebuffer(nmesa->glCtx, fb); + } else { + nouveau_window_moved(nmesa->glCtx); + } + + nmesa->lastStamp = dPriv->lastStamp; + } + nmesa->numClipRects = dPriv->numClipRects; nmesa->pClipRects = dPriv->pClipRects; |