call driUpdateFramebufferSize() when window size/position changes.
* that may not be valid everywhere.
*/
-#include "driver.h"
+/*#include "driver.h"*/
#include "drm.h"
#include "utils.h"
#include "drirenderbuffer.h"
}
+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);
}
}
+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);
}
*/
#include "mtypes.h"
-#include "buffers.h"
#include "colormac.h"
#include "mm.h"
#include "ffb_dd.h"
static void ffbDDViewport(GLcontext *ctx, GLint x, GLint y,
GLsizei width, GLsizei height)
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
ffbCalcViewport(ctx);
}
#include "drm_sarea.h"
+#include "drirenderbuffer.h"
+
static GLboolean
ffbInitDriver(__DRIscreenPrivate *sPriv)
{
GLcontext *ctx = fmesa->glCtx;
ffbCalcViewport(ctx);
- if (ctx->Polygon.StippleFlag)
+ driUpdateFramebufferSize(ctx, dPriv);
+ if (ctx->Polygon.StippleFlag) {
ffbXformAreaPattern(fmesa,
(const GLubyte *)ctx->PolygonStipple);
+ }
}
}
#include "gamma_context.h"
#include "gamma_lock.h"
+#include "drirenderbuffer.h"
#ifdef DEBUG_LOCKING
char *prevLockFile = NULL;
DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
if ( gmesa->lastStamp != dPriv->lastStamp ) {
+ driUpdateFramebufferSize(gmesa->glCtx, dPriv);
gmesa->lastStamp = dPriv->lastStamp;
gmesa->new_state |= GAMMA_NEW_WINDOW | GAMMA_NEW_CLIP;
}
static void gammaDDViewport( GLcontext *ctx, GLint x, GLint y,
GLsizei width, GLsizei height )
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
gammaUpdateWindow( ctx );
}
* more broken than usual.
*/
if (sarea->ctxOwner != me) {
+ driUpdateFramebufferSize(imesa->glCtx, dPriv);
imesa->upload_cliprects = GL_TRUE;
imesa->dirty = I810_UPLOAD_CTX|I810_UPLOAD_BUFFERS;
if (imesa->CurrentTexObj[0]) imesa->dirty |= I810_UPLOAD_TEX0;
#include <stdio.h>
#include "glheader.h"
-#include "buffers.h"
#include "context.h"
#include "macros.h"
-#include "enums.h"
#include "dd.h"
#include "colormac.h"
GLint x, GLint y,
GLsizei width, GLsizei height )
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
i810CalcViewport( ctx );
}
#include "i830_tris.h"
#include "i830_ioctl.h"
-
+#include "drirenderbuffer.h"
#include "utils.h"
#define need_GL_ARB_multisample
*/
if (sarea->ctxOwner != me) {
+ driUpdateFramebufferSize(imesa->glCtx, dPriv);
imesa->upload_cliprects = GL_TRUE;
imesa->dirty |= (I830_UPLOAD_CTX |
I830_UPLOAD_BUFFERS |
*/
#include "glheader.h"
-#include "buffers.h"
#include "context.h"
#include "macros.h"
#include "enums.h"
GLint x, GLint y,
GLsizei width, GLsizei height )
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
i830CalcViewport( ctx );
}
#include "vblank.h"
#include "extensions.h"
+#include "drirenderbuffer.h"
#include "GL/internal/dri_interface.h"
mmesa->SetupNewInputs |= VERT_BIT_POS;
mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK);
mgaUpdateRects( mmesa, (MGA_FRONT|MGA_BACK) );
+ driUpdateFramebufferSize(mmesa->glCtx, dPriv);
}
mmesa->dirty |= MGA_UPLOAD_CONTEXT | MGA_UPLOAD_CLIPRECTS;
#include "mtypes.h"
-#include "buffers.h"
#include "colormac.h"
#include "dd.h"
GLint x, GLint y,
GLsizei width, GLsizei height )
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
mgaCalcViewport( ctx );
}
if ( rmesa->lastStamp != dPriv->lastStamp ) {
r128UpdatePageFlipping( rmesa );
+ driUpdateFramebufferSize(rmesa->glCtx, dPriv);
rmesa->lastStamp = dPriv->lastStamp;
rmesa->new_state |= R128_NEW_CLIP;
rmesa->tnl_state = ~0;
#include "r128_tex.h"
#include "context.h"
-#include "buffers.h"
#include "enums.h"
#include "colormac.h"
#include "swrast/swrast.h"
GLint x, GLint y,
GLsizei width, GLsizei height )
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
r128CalcViewport( ctx );
}
*/
switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
case BUFFER_BIT_FRONT_LEFT:
- FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
- break;
case BUFFER_BIT_BACK_LEFT:
FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
#include "savage_dri.h"
+#include "drirenderbuffer.h"
#include "texmem.h"
#define need_GL_ARB_multisample
DRI_AGE_TEXTURES( imesa->textureHeaps[heap] );
}
- if (dPriv->lastStamp != stamp)
+ if (dPriv->lastStamp != stamp) {
+ driUpdateFramebufferSize(imesa->glCtx, dPriv);
savageXMesaWindowMoved( imesa );
-
-
-
+ }
}
#include <stdio.h>
#include "mtypes.h"
-#include "buffers.h"
#include "enums.h"
#include "macros.h"
#include "dd.h"
GLint x, GLint y,
GLsizei width, GLsizei height )
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
savageCalcViewport( ctx );
}
#include "sis_lock.h"
#include "sis_dd.h"
#include "sis_state.h"
+#include "drirenderbuffer.h"
/* Update the hardware state. This is called if another context has
* grabbed the hardware lock, which includes the X server. This
sisUpdateBufferSize( smesa );
sisUpdateClipping( smesa->glCtx );
sisDDDrawBuffer( smesa->glCtx, smesa->glCtx->Color.DrawBuffer[0] );
+ driUpdateFramebufferSize(smesa->glCtx, dPriv);
smesa->lastStamp = dPriv->lastStamp;
}
#include "sis_tex.h"
#include "context.h"
-#include "buffers.h"
#include "enums.h"
#include "colormac.h"
#include "swrast/swrast.h"
GLint x, GLint y,
GLsizei width, GLsizei height )
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
sisCalcViewport( ctx );
}
#include "tdfx_texman.h"
#include "tdfx_tris.h"
+#include "drirenderbuffer.h"
+
void tdfxGetLock( tdfxContextPtr fxMesa )
{
if ( *dPriv->pStamp != stamp || saPriv->ctxOwner != fxMesa->hHWContext ) {
tdfxUpdateClipping(fxMesa->glCtx);
tdfxUploadClipping(fxMesa);
+ driUpdateFramebufferSize(fxMesa->glCtx, dPriv);
}
DEBUG_LOCK();
*/
#include "mtypes.h"
-#include "buffers.h"
#include "colormac.h"
#include "texformat.h"
#include "texstore.h"
GLsizei w, GLsizei h )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_VIEWPORT;
}
#include <stdio.h>
#include "macros.h"
+#include "drirenderbuffer.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_point_parameters
if (vmesa->lastStamp != dPriv->lastStamp) {
viaXMesaWindowMoved(vmesa);
+ driUpdateFramebufferSize(vmesa->glCtx, dPriv);
vmesa->newEmitState = ~0;
vmesa->lastStamp = dPriv->lastStamp;
}
#include <stdio.h>
#include "glheader.h"
-#include "buffers.h"
#include "context.h"
#include "macros.h"
#include "colormac.h"
GLint x, GLint y,
GLsizei width, GLsizei height)
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
viaCalcViewport(ctx);
}