Example #1
0
static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode )
{
   mgaContextPtr mmesa = MGA_CONTEXT(ctx);

   FLUSH_BATCH( mmesa );

   /*
    * _DrawDestMask is easier to cope with than <mode>.
    */
   switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
   case BUFFER_BIT_FRONT_LEFT:
      mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset;
      mmesa->dirty |= MGA_UPLOAD_CONTEXT;
      mmesa->draw_buffer = MGA_FRONT;
      mgaXMesaSetFrontClipRects( mmesa );
      FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
      break;
   case BUFFER_BIT_BACK_LEFT:
      mmesa->setup.dstorg = mmesa->mgaScreen->backOffset;
      mmesa->draw_buffer = MGA_BACK;
      mmesa->dirty |= MGA_UPLOAD_CONTEXT;
      mgaXMesaSetBackClipRects( mmesa );
      FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
      break;
   default:
      /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
      FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE );
      return;
   }
}
Example #2
0
static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode )
{
   mgaContextPtr mmesa = MGA_CONTEXT(ctx);

   FLUSH_BATCH( mmesa );

   /*
    * _DrawDestMask is easier to cope with than <mode>.
    */
   switch ( ctx->Color._DrawDestMask[0] ) {
   case DD_FRONT_LEFT_BIT:
      mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset;
      mmesa->dirty |= MGA_UPLOAD_CONTEXT;
      mmesa->draw_buffer = MGA_FRONT;
      mgaXMesaSetFrontClipRects( mmesa );
      FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
      break;
   case DD_BACK_LEFT_BIT:
      mmesa->setup.dstorg = mmesa->mgaScreen->backOffset;
      mmesa->draw_buffer = MGA_BACK;
      mmesa->dirty |= MGA_UPLOAD_CONTEXT;
      mgaXMesaSetBackClipRects( mmesa );
      FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
      break;
   default:
      /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
      FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE );
      return;
   }

   /* We want to update the s/w rast state too so that r200SetBuffer()
    * gets called.
    */
   _swrast_DrawBuffer(ctx, mode);
}
Example #3
0
void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers )
{
   __DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
   drm_mga_sarea_t *sarea = mmesa->sarea;


   DRI_VALIDATE_DRAWABLE_INFO(mmesa->driScreen, driDrawable); 
   mmesa->dirty_cliprects = 0;	

   if (mmesa->draw_buffer == MGA_FRONT)
      mgaXMesaSetFrontClipRects( mmesa );
   else
      mgaXMesaSetBackClipRects( mmesa );

   sarea->req_drawable = driDrawable->draw;
   sarea->req_draw_buffer = mmesa->draw_buffer;

   mgaUpdateClipping( mmesa->glCtx );
   mgaCalcViewport( mmesa->glCtx );

   mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
}