diff options
author | Brian Paul <[email protected]> | 2011-06-16 07:31:58 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-06-16 07:31:58 -0600 |
commit | 37e6ab7b2de90ee90c06ceb08974423248fa6ee5 (patch) | |
tree | a63056f46f4a0cfd90d88724b95b3949b75a0f07 /src/mesa/main/context.c | |
parent | 296052681601f98e16c701299d2b2a6d9bd5eeab (diff) |
mesa: refactor, create _mesa_update_draw_buffers() helper
Move this code out of _mesa_make_current() and put it into a
helper function.
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ef79f1f453c..b83a5d621fa 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1456,21 +1456,12 @@ _mesa_make_current( struct gl_context *newCtx, * or not bound to a user-created FBO. */ if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) { + _mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer); /* Update the FBO's list of drawbuffers/renderbuffers. * For winsys FBOs this comes from the GL state (which may have * changed since the last time this FBO was bound). */ - unsigned int i; - GLenum buffers[MAX_DRAW_BUFFERS]; - - _mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer); - - for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) { - buffers[i] = newCtx->Color.DrawBuffer[i]; - } - - _mesa_drawbuffers(newCtx, newCtx->Const.MaxDrawBuffers, - buffers, NULL); + _mesa_update_draw_buffers(newCtx); } if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) { _mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer); |