diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-14 00:36:27 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-14 00:36:27 +0000 |
commit | ff9d235042bb80daf0a6f5af41f7abcb1d552a80 (patch) | |
tree | 072f5e9684e019d3309b942ef7ee038fe027df4f /src/mesa/drivers/dri/fb | |
parent | 48799287b3e88105cdf3f83e97e8bb4a90f8650b (diff) |
Instead of calling _mesa_ResizeBuffersMESA() in the Viewport function,
call driUpdateFramebufferSize() when window size/position changes.
Diffstat (limited to 'src/mesa/drivers/dri/fb')
-rw-r--r-- | src/mesa/drivers/dri/fb/fb_dri.c | 16 | ||||
-rw-r--r-- | src/mesa/drivers/dri/fb/fb_egl.c | 14 |
2 files changed, 27 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index c1fab2d586..ee25096526 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -41,7 +41,7 @@ * that may not be valid everywhere. */ -#include "driver.h" +/*#include "driver.h"*/ #include "drm.h" #include "utils.h" #include "drirenderbuffer.h" @@ -114,9 +114,21 @@ get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) static void +updateFramebufferSize(GLcontext *ctx) +{ + fbContextPtr fbmesa = FB_CONTEXT(ctx); + struct gl_framebuffer *fb = ctx->WinSysDrawBuffer; + if (fbmesa->dri.drawable->w != fb->Width || + fbmesa->dri.drawable->h != fb->Height) { + driUpdateFramebufferSize(ctx, fbmesa->dri.drawable); + } +} + +static void viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { - _mesa_ResizeBuffersMESA(); + /* XXX this should be called after we acquire the DRI lock, not here */ + updateFramebufferSize(ctx); } diff --git a/src/mesa/drivers/dri/fb/fb_egl.c b/src/mesa/drivers/dri/fb/fb_egl.c index 94ff9cbb62..05148b445c 100644 --- a/src/mesa/drivers/dri/fb/fb_egl.c +++ b/src/mesa/drivers/dri/fb/fb_egl.c @@ -399,9 +399,21 @@ get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) static void +updateFramebufferSize(GLcontext *ctx) +{ + fbContextPtr fbmesa = FB_CONTEXT(ctx); + struct gl_framebuffer *fb = ctx->WinSysDrawBuffer; + if (fbmesa->dri.drawable->w != fb->Width || + fbmesa->dri.drawable->h != fb->Height) { + driUpdateFramebufferSize(ctx, fbmesa->dri.drawable); + } +} + +static void viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { - _mesa_ResizeBuffersMESA(); + /* XXX this should be called after we acquire the DRI lock, not here */ + updateFramebufferSize(ctx); } |