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

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/mga/mgaioctl.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:
204
204
 
205
205
 
206
206
static void
207
 
mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
208
 
            GLint cx, GLint cy, GLint cw, GLint ch )
 
207
mgaClear( GLcontext *ctx, GLbitfield mask )
209
208
{
210
209
   mgaContextPtr mmesa = MGA_CONTEXT(ctx);
211
210
   __DRIdrawablePrivate *dPriv = mmesa->driDrawable;
218
217
   int i;
219
218
   static int nrclears;
220
219
   drm_mga_clear_t clear;
 
220
   GLint cx, cy, cw, ch;
221
221
 
222
222
   FLUSH_BATCH( mmesa );
223
223
 
250
250
   if ( flags ) {
251
251
      LOCK_HARDWARE( mmesa );
252
252
 
 
253
      /* compute region after locking: */
 
254
      cx = ctx->DrawBuffer->_Xmin;
 
255
      cy = ctx->DrawBuffer->_Ymin;
 
256
      cw = ctx->DrawBuffer->_Xmax - cx;
 
257
      ch = ctx->DrawBuffer->_Ymax - cy;
 
258
 
253
259
      if ( mmesa->dirty_cliprects )
254
260
         mgaUpdateRects( mmesa, (MGA_FRONT | MGA_BACK) );
255
261
 
269
275
         drm_clip_rect_t *b = mmesa->sarea->boxes;
270
276
         int n = 0;
271
277
 
272
 
         if (!all) {
 
278
         if (cw != dPriv->w || ch != dPriv->h) {
 
279
            /* clear subregion */
273
280
            for ( ; i < nr ; i++) {
274
281
               GLint x = box[i].x1;
275
282
               GLint y = box[i].y1;
291
298
               n++;
292
299
            }
293
300
         } else {
 
301
            /* clear whole window */
294
302
            for ( ; i < nr ; i++) {
295
303
               *b++ = box[i];
296
304
               n++;
325
333
   }
326
334
 
327
335
   if (mask) 
328
 
      _swrast_Clear( ctx, mask, all, cx, cy, cw, ch );
 
336
      _swrast_Clear( ctx, mask );
329
337
}
330
338
 
331
339