diff options
author | Alan Hourihane <[email protected]> | 2003-12-05 00:32:15 +0000 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2003-12-05 00:32:15 +0000 |
commit | eed5ac284cb4edca5400d55040e83fdf2f329f84 (patch) | |
tree | addcbdefa6d8fae9635ee830d9d4cd97d096c110 /src/mesa/drivers/dri/mga/mgaspan.c | |
parent | 1f2d9ae69fa6d368b1df3f316e7bb7186ca8f746 (diff) |
bring over latest mga DRI driver from DRI trunk
Diffstat (limited to 'src/mesa/drivers/dri/mga/mgaspan.c')
-rw-r--r-- | src/mesa/drivers/dri/mga/mgaspan.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c index 684239865f7..c8a55d4cd15 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.c +++ b/src/mesa/drivers/dri/mga/mgaspan.c @@ -37,7 +37,7 @@ #define LOCAL_VARS \ - __DRIdrawablePrivate *dPriv = mmesa->driDrawable; \ + __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \ mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \ __DRIscreenPrivate *sPriv = mmesa->driScreen; \ GLuint pitch = mgaScreen->frontPitch; \ @@ -56,7 +56,7 @@ #define LOCAL_DEPTH_VARS \ - __DRIdrawablePrivate *dPriv = mmesa->driDrawable; \ + __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \ mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \ __DRIscreenPrivate *sPriv = mmesa->driScreen; \ GLuint pitch = mgaScreen->frontPitch; \ @@ -242,20 +242,22 @@ static void mgaDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); + unsigned int offset; - if (bufferBit == FRONT_LEFT_BIT) - { - mmesa->drawOffset = mmesa->mgaScreen->frontOffset; - mmesa->readOffset = mmesa->mgaScreen->frontOffset; - } - else if (bufferBit == BACK_LEFT_BIT) - { - mmesa->drawOffset = mmesa->mgaScreen->backOffset; - mmesa->readOffset = mmesa->mgaScreen->backOffset; - } - else { - assert(0); - } + assert( (bufferBit == FRONT_LEFT_BIT) || (bufferBit == BACK_LEFT_BIT) ); + + offset = (bufferBit == FRONT_LEFT_BIT) + ? mmesa->mgaScreen->frontOffset + : mmesa->mgaScreen->backOffset; + + mmesa->drawOffset = offset; + mmesa->readOffset = offset; + + assert( (buffer == mmesa->driDrawable->driverPrivate) + || (buffer == mmesa->driReadable->driverPrivate) ); + + mmesa->mesa_drawable = (buffer == mmesa->driDrawable->driverPrivate) + ? mmesa->driDrawable : mmesa->driReadable; } void mgaDDInitSpanFuncs( GLcontext *ctx ) |