#include "savagecontext.h"
extern void savageGetLock( savageContextPtr imesa, GLuint flags );
-extern void savageXMesaSetBackClipRects( savageContextPtr imesa );
-extern void savageXMesaSetFrontClipRects( savageContextPtr imesa );
+extern void savageXMesaSetClipRects(savageContextPtr imesa);
#define GET_DISPATCH_AGE( imesa ) imesa->sarea->last_dispatch
}
#endif
-void savageXMesaSetFrontClipRects( savageContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- imesa->numClipRects = dPriv->numClipRects;
- imesa->pClipRects = dPriv->pClipRects;
- imesa->drawX = dPriv->x;
- imesa->drawY = dPriv->y;
-
- savageCalcViewport( imesa->glCtx );
-}
-
-void savageXMesaSetBackClipRects( savageContextPtr imesa )
+void savageXMesaSetClipRects(savageContextPtr imesa)
{
__DRIdrawablePrivate *dPriv = imesa->driDrawable;
- if (dPriv->numBackClipRects == 0)
- {
-
-
+ if ((dPriv->numBackClipRects == 0)
+ || (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT)) {
imesa->numClipRects = dPriv->numClipRects;
imesa->pClipRects = dPriv->pClipRects;
imesa->drawX = dPriv->x;
imesa->drawY = dPriv->y;
} else {
-
-
imesa->numClipRects = dPriv->numBackClipRects;
imesa->pClipRects = dPriv->pBackClipRects;
imesa->drawX = dPriv->backX;
if (0)
fprintf(stderr, "savageXMesaWindowMoved\n\n");
- switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- savageXMesaSetFrontClipRects( imesa );
- break;
- case BUFFER_BIT_BACK_LEFT:
- savageXMesaSetBackClipRects( imesa );
- break;
- default:
- break;
- }
+ savageXMesaSetClipRects(imesa);
driUpdateFramebufferSize(imesa->glCtx, drawable);
if (drawable != readable) {
case BUFFER_BIT_FRONT_LEFT:
imesa->IsDouble = GL_FALSE;
imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->frontOffset>>11;
-
- imesa->NotFirstFrame = GL_FALSE;
- savageXMesaSetFrontClipRects( imesa );
- FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case BUFFER_BIT_BACK_LEFT:
imesa->IsDouble = GL_TRUE;
imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11;
- imesa->NotFirstFrame = GL_FALSE;
- savageXMesaSetBackClipRects( imesa );
- FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
+ imesa->NotFirstFrame = GL_FALSE;
+ savageXMesaSetClipRects(imesa);
+ FALLBACK(ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE);
+
if (destCtrl != imesa->regs.s4.destCtrl.ui)
imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
}