mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
Refactor savageXMesaSet{Back,Front}ClipRects.
Refactor savageXMesaSetBackClipRects and savageXMesaSetFrontClipRects into a single new routine called savageXMesaSetClipRects. This allows a few cleanups in the code.
This commit is contained in:
parent
6e2c952537
commit
5c38472152
3 changed files with 10 additions and 39 deletions
|
|
@ -83,8 +83,7 @@ typedef struct {
|
|||
#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
|
||||
|
|
|
|||
|
|
@ -724,34 +724,18 @@ void XMesaSwapBuffers(__DRIdrawablePrivate *driDrawPriv)
|
|||
}
|
||||
#endif
|
||||
|
||||
void savageXMesaSetFrontClipRects( savageContextPtr imesa )
|
||||
|
||||
void savageXMesaSetClipRects(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 )
|
||||
{
|
||||
__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;
|
||||
|
|
@ -770,16 +754,7 @@ static void savageXMesaWindowMoved( savageContextPtr imesa )
|
|||
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) {
|
||||
|
|
|
|||
|
|
@ -647,23 +647,20 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode )
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue