summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-05-09 17:42:18 +0000
committerKeith Whitwell <[email protected]>2005-05-09 17:42:18 +0000
commitff6723e3264df15d443a0d6af8baafbab141089c (patch)
tree846df4fadb47d2ac522abbf27097995ad1bfaeb1
parent1180fc13db5fba0a3ec95630f520128f628c58ac (diff)
check for null DrawBuffer values
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c25
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel.c1
-rw-r--r--src/mesa/drivers/dri/i915/intel_state.c3
3 files changed, 20 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 0dabfad5ffd..f6012373534 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -494,17 +494,22 @@ void intelSetBackClipRects( intelContextPtr intel )
void intelWindowMoved( intelContextPtr intel )
{
- switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- intelSetFrontClipRects( intel );
- break;
- case BUFFER_BIT_BACK_LEFT:
- intelSetBackClipRects( intel );
- break;
- default:
- /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */
+ if (!intel->ctx.DrawBuffer) {
intelSetFrontClipRects( intel );
}
+ else {
+ switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) {
+ case BUFFER_BIT_FRONT_LEFT:
+ intelSetFrontClipRects( intel );
+ break;
+ case BUFFER_BIT_BACK_LEFT:
+ intelSetBackClipRects( intel );
+ break;
+ default:
+ /* glDrawBuffer(GL_NONE or GL_FRONT_AND_BACK): software fallback */
+ intelSetFrontClipRects( intel );
+ }
+ }
}
GLboolean intelUnbindContext(__DRIcontextPrivate *driContextPriv)
@@ -529,6 +534,8 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
_mesa_make_current(&intel->ctx,
(GLframebuffer *) driDrawPriv->driverPrivate,
(GLframebuffer *) driReadPriv->driverPrivate);
+
+ intel->ctx.Driver.DrawBuffer( &intel->ctx, intel->ctx.Color.DrawBuffer[0] );
} else {
_mesa_make_current(NULL, NULL, NULL);
}
diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c
index d842273a80d..e56e46b4d7f 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel.c
@@ -286,6 +286,7 @@ static void do_draw_pix( GLcontext *ctx,
intelFlush( &intel->ctx );
LOCK_HARDWARE( intel );
+ if (ctx->DrawBuffer)
{
y -= height; /* cope with pixel zoom */
diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c
index db6a140d2d5..cf1f3c58036 100644
--- a/src/mesa/drivers/dri/i915/intel_state.c
+++ b/src/mesa/drivers/dri/i915/intel_state.c
@@ -170,6 +170,9 @@ static void intelDrawBuffer(GLcontext *ctx, GLenum mode )
intelScreenPrivate *screen = intel->intelScreen;
int front = 0;
+ if (!ctx->DrawBuffer)
+ return;
+
switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
case BUFFER_BIT_FRONT_LEFT:
front = 1;