/* Copy the back color buffer to the front color buffer. */ void FBMesaSwapBuffers( __DRIdrawablePrivate *driDrawPriv ) { /* FIXME: This assumes buffer is currently bound to a context. This * needs to be able to swap buffers when not currently bound. Also, * this needs to swap according to buffer, and NOT according to * context! */ //printf("FBMesaSwapBuffers 1\n"); if ( radeonCtx == NULL ) return; //printf("FBMesaSwapBuffers 2\n"); /* Only swap buffers when a back buffer exists. */ if ( radeonCtx->glCtx->Visual->DBflag ) { FLUSH_VB( radeonCtx->glCtx, "swap buffers" ); //radeonCtx->doPageFlip = 1; if ( !radeonCtx->doPageFlip ) { radeonSwapBuffers( radeonCtx ); } else { radeonPageFlip( radeonCtx ); } } }
void radeonSwapBuffers( __DRIdrawablePrivate *dPriv ) { if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { radeonContextPtr rmesa; GLcontext *ctx; rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate; ctx = rmesa->glCtx; if (ctx->Visual.doubleBufferMode) { _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ if ( rmesa->doPageFlip ) { radeonPageFlip( dPriv ); } else { radeonCopyBuffer( dPriv, NULL ); } } } else { /* XXX this shouldn't be an error but we can't handle it for now */ _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__); } }