~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/r200/r200_ioctl.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
605
605
/* ================================================================
606
606
 * Buffer clear
607
607
 */
608
 
static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
609
 
                         GLint cx, GLint cy, GLint cw, GLint ch )
 
608
static void r200Clear( GLcontext *ctx, GLbitfield mask )
610
609
{
611
610
   r200ContextPtr rmesa = R200_CONTEXT(ctx);
612
611
   __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
613
612
   GLuint flags = 0;
614
613
   GLuint color_mask = 0;
615
614
   GLint ret, i;
 
615
   GLint cx, cy, cw, ch;
616
616
 
617
617
   if ( R200_DEBUG & DEBUG_IOCTL ) {
618
 
      fprintf( stderr, "%s:  all=%d cx=%d cy=%d cw=%d ch=%d\n",
619
 
               __FUNCTION__, all, cx, cy, cw, ch );
 
618
      fprintf( stderr, "r200Clear\n");
620
619
   }
621
620
 
622
621
   {
653
652
   if ( mask ) {
654
653
      if (R200_DEBUG & DEBUG_FALLBACKS)
655
654
         fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask);
656
 
      _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
 
655
      _swrast_Clear( ctx, mask );
657
656
   }
658
657
 
659
658
   if ( !flags ) 
670
669
      }
671
670
   }
672
671
 
 
672
   LOCK_HARDWARE( rmesa );
 
673
 
 
674
   /* compute region after locking: */
 
675
   cx = ctx->DrawBuffer->_Xmin;
 
676
   cy = ctx->DrawBuffer->_Ymin;
 
677
   cw = ctx->DrawBuffer->_Xmax - cx;
 
678
   ch = ctx->DrawBuffer->_Ymax - cy;
 
679
 
673
680
   /* Flip top to bottom */
674
681
   cx += dPriv->x;
675
682
   cy  = dPriv->y + dPriv->h - cy - ch;
676
683
 
677
 
   LOCK_HARDWARE( rmesa );
678
 
 
679
684
   /* Throttle the number of clear ioctls we do.
680
685
    */
681
686
   while ( 1 ) {
717
722
      drm_radeon_clear_rect_t depth_boxes[RADEON_NR_SAREA_CLIPRECTS];
718
723
      GLint n = 0;
719
724
 
720
 
      if ( !all ) {
 
725
      if (cw != dPriv->w || ch != dPriv->h) {
 
726
         /* clear subregion */
721
727
         for ( ; i < nr ; i++ ) {
722
728
            GLint x = box[i].x1;
723
729
            GLint y = box[i].y1;
739
745
            n++;
740
746
         }
741
747
      } else {
 
748
         /* clear whole window */
742
749
         for ( ; i < nr ; i++ ) {
743
750
            *b++ = box[i];
744
751
            n++;