summaryrefslogtreecommitdiff
path: root/xc/lib/GL/mesa/src/drv/mga
diff options
context:
space:
mode:
authorkeithw <keithw>2001-01-18 04:34:36 +0000
committerkeithw <keithw>2001-01-18 04:34:36 +0000
commit17dd2c2d0e5c3fe55ac13a0b8d0250f9c6e86607 (patch)
tree6c8b969cc0feb5b8a159c5e639a6716cb61dafd4 /xc/lib/GL/mesa/src/drv/mga
parentabfde79fc2d1ebc8a451f63170b2b0b480d81947 (diff)
Fix detection of logicop fallback in most drvers.
Apply mga obscured-window patch from Geoff Reedy.
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/mga')
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgabuffers.c20
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgastate.c16
2 files changed, 31 insertions, 5 deletions
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
index 518587eac..5dd11b7e0 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgabuffers.c
@@ -43,8 +43,14 @@ static void mgaXMesaSetFrontClipRects( mgaContextPtr mmesa )
{
__DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
- mmesa->numClipRects = driDrawable->numClipRects;
- mmesa->pClipRects = driDrawable->pClipRects;
+ if (driDrawable->numClipRects == 0) {
+ static XF86DRIClipRectRec zeroareacliprect = {0,0,0,0};
+ mmesa->numClipRects = 1;
+ mmesa->pClipRects = &zeroareacliprect;
+ } else {
+ mmesa->numClipRects = driDrawable->numClipRects;
+ mmesa->pClipRects = driDrawable->pClipRects;
+ }
mmesa->drawX = driDrawable->x;
mmesa->drawY = driDrawable->y;
@@ -60,8 +66,14 @@ static void mgaXMesaSetBackClipRects( mgaContextPtr mmesa )
if (driDrawable->numBackClipRects == 0)
{
- mmesa->numClipRects = driDrawable->numClipRects;
- mmesa->pClipRects = driDrawable->pClipRects;
+ if (driDrawable->numClipRects == 0) {
+ static XF86DRIClipRectRec zeroareacliprect = {0,0,0,0};
+ mmesa->numClipRects = 1;
+ mmesa->pClipRects = &zeroareacliprect;
+ } else {
+ mmesa->numClipRects = driDrawable->numClipRects;
+ mmesa->pClipRects = driDrawable->pClipRects;
+ }
mmesa->drawX = driDrawable->x;
mmesa->drawY = driDrawable->y;
} else {
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgastate.c b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
index 1dbf2371d..33ca1b89d 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgastate.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
@@ -241,6 +241,12 @@ static void mgaDDBlendEquation(GLcontext *ctx, GLenum mode)
{
FLUSH_BATCH( MGA_CONTEXT(ctx) );
MGA_CONTEXT(ctx)->new_state |= MGA_NEW_ALPHA;
+
+ if (ctx->Color.ColorLogicOpEnabled && ctx->Color.LogicOp != GL_COPY)
+ MGA_CONTEXT(ctx)->Fallback |= MGA_FALLBACK_LOGICOP;
+ else
+ MGA_CONTEXT(ctx)->Fallback &= ~MGA_FALLBACK_LOGICOP;
+
}
static void mgaDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
@@ -305,6 +311,8 @@ static void mgaDDLogicOp( GLcontext *ctx, GLenum opcode )
else
MGA_CONTEXT(ctx)->Fallback |= MGA_FALLBACK_LOGICOP;
}
+ else
+ MGA_CONTEXT(ctx)->Fallback &= ~MGA_FALLBACK_LOGICOP;
}
#endif
@@ -856,6 +864,13 @@ static void mgaDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
case GL_BLEND:
FLUSH_BATCH( mmesa );
mmesa->new_state |= MGA_NEW_ALPHA;
+
+ /* For some reason enable(GL_BLEND) affects ColorLogicOpEnabled.
+ */
+ if (ctx->Color.ColorLogicOpEnabled && ctx->Color.LogicOp != GL_COPY)
+ mmesa->Fallback |= MGA_FALLBACK_LOGICOP;
+ else
+ mmesa->Fallback &= ~MGA_FALLBACK_LOGICOP;
break;
case GL_DEPTH_TEST:
FLUSH_BATCH( mmesa );
@@ -892,7 +907,6 @@ static void mgaDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
}
break;
case GL_COLOR_LOGIC_OP:
- case GL_INDEX_LOGIC_OP:
FLUSH_BATCH( mmesa );
#if !defined(ACCEL_ROP)
mmesa->Fallback &= ~MGA_FALLBACK_LOGICOP;