summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/savage/savage_xmesa.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2006-11-10 18:57:30 +0000
committerIan Romanick <[email protected]>2006-11-10 18:57:30 +0000
commit5c384721522d6a2f9a500e26f0805dda77a31126 (patch)
treef78ce38b26bb98d5ee9acb2304dfa79b492f559b /src/mesa/drivers/dri/savage/savage_xmesa.c
parent6e2c95253718e9ba294a788ba3bb37b7c9603409 (diff)
Refactor savageXMesaSet{Back,Front}ClipRects.
Refactor savageXMesaSetBackClipRects and savageXMesaSetFrontClipRects into a single new routine called savageXMesaSetClipRects. This allows a few cleanups in the code.
Diffstat (limited to 'src/mesa/drivers/dri/savage/savage_xmesa.c')
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index f8d68d7874e..f51e321a4a6 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -724,34 +724,18 @@ void XMesaSwapBuffers(__DRIdrawablePrivate *driDrawPriv)
}
#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;
@@ -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) {