~ubuntu-branches/ubuntu/precise/mesa/precise-updates

« back to all changes in this revision

Viewing changes to src/mesa/swrast/s_aatritemp.h

  • Committer: Package Import Robot
  • Author(s): Robert Hooker
  • Date: 2012-02-02 12:05:48 UTC
  • mfrom: (1.7.1) (3.3.27 sid)
  • Revision ID: package-import@ubuntu.com-20120202120548-nvkma85jq0h4coix
Tags: 8.0~rc2-0ubuntu4
Drop drisearchdir handling, it is no longer needed with multiarch
and dri-alternates being removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
      const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS];
182
182
      const GLfloat dxdy = majDx / majDy;
183
183
      const GLfloat xAdj = dxdy < 0.0F ? -dxdy : 0.0F;
184
 
      GLfloat x = pMin[0] - (yMin - iyMin) * dxdy;
185
184
      GLint iy;
186
 
      for (iy = iyMin; iy < iyMax; iy++, x += dxdy) {
 
185
#ifdef _OPENMP
 
186
#pragma omp parallel for schedule(dynamic) private(iy) firstprivate(span)
 
187
#endif
 
188
      for (iy = iyMin; iy < iyMax; iy++) {
 
189
         GLfloat x = pMin[0] - (yMin - iy) * dxdy;
187
190
         GLint ix, startX = (GLint) (x - xAdj);
188
191
         GLuint count;
189
192
         GLfloat coverage = 0.0F;
190
193
 
 
194
#ifdef _OPENMP
 
195
         /* each thread needs to use a different (global) SpanArrays variable */
 
196
         span.array = SWRAST_CONTEXT(ctx)->SpanArrays + omp_get_thread_num();
 
197
#endif
191
198
         /* skip over fragments with zero coverage */
192
199
         while (startX < MAX_WIDTH) {
193
200
            coverage = compute_coveragef(pMin, pMid, pMax, startX, iy);
228
235
            coverage = compute_coveragef(pMin, pMid, pMax, ix, iy);
229
236
         }
230
237
         
231
 
         if (ix <= startX)
232
 
            continue;
233
 
         
234
 
         span.x = startX;
235
 
         span.y = iy;
236
 
         span.end = (GLuint) ix - (GLuint) startX;
237
 
         _swrast_write_rgba_span(ctx, &span);
 
238
         if (ix > startX) {
 
239
            span.x = startX;
 
240
            span.y = iy;
 
241
            span.end = (GLuint) ix - (GLuint) startX;
 
242
            _swrast_write_rgba_span(ctx, &span);
 
243
         }
238
244
      }
239
245
   }
240
246
   else {
244
250
      const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS];
245
251
      const GLfloat dxdy = majDx / majDy;
246
252
      const GLfloat xAdj = dxdy > 0 ? dxdy : 0.0F;
247
 
      GLfloat x = pMin[0] - (yMin - iyMin) * dxdy;
248
253
      GLint iy;
249
 
      for (iy = iyMin; iy < iyMax; iy++, x += dxdy) {
 
254
#ifdef _OPENMP
 
255
#pragma omp parallel for schedule(dynamic) private(iy) firstprivate(span)
 
256
#endif
 
257
      for (iy = iyMin; iy < iyMax; iy++) {
 
258
         GLfloat x = pMin[0] - (yMin - iy) * dxdy;
250
259
         GLint ix, left, startX = (GLint) (x + xAdj);
251
260
         GLuint count, n;
252
261
         GLfloat coverage = 0.0F;
253
262
         
 
263
#ifdef _OPENMP
 
264
         /* each thread needs to use a different (global) SpanArrays variable */
 
265
         span.array = SWRAST_CONTEXT(ctx)->SpanArrays + omp_get_thread_num();
 
266
#endif
254
267
         /* make sure we're not past the window edge */
255
268
         if (startX >= ctx->DrawBuffer->_Xmax) {
256
269
            startX = ctx->DrawBuffer->_Xmax - 1;
296
309
         ATTRIB_LOOP_END
297
310
#endif
298
311
 
299
 
         if (startX <= ix)
300
 
            continue;
301
 
 
302
 
         n = (GLuint) startX - (GLuint) ix;
303
 
 
304
 
         left = ix + 1;
305
 
 
306
 
         /* shift all values to the left */
307
 
         /* XXX this is temporary */
308
 
         {
309
 
            SWspanarrays *array = span.array;
310
 
            GLint j;
311
 
            for (j = 0; j < (GLint) n; j++) {
312
 
               array->coverage[j] = array->coverage[j + left];
313
 
               COPY_CHAN4(array->rgba[j], array->rgba[j + left]);
 
312
         if (startX > ix) {
 
313
            n = (GLuint) startX - (GLuint) ix;
 
314
 
 
315
            left = ix + 1;
 
316
 
 
317
            /* shift all values to the left */
 
318
            /* XXX this is temporary */
 
319
            {
 
320
               SWspanarrays *array = span.array;
 
321
               GLint j;
 
322
               for (j = 0; j < (GLint) n; j++) {
 
323
                  array->coverage[j] = array->coverage[j + left];
 
324
                  COPY_CHAN4(array->rgba[j], array->rgba[j + left]);
314
325
#ifdef DO_Z
315
 
               array->z[j] = array->z[j + left];
 
326
                  array->z[j] = array->z[j + left];
316
327
#endif
 
328
               }
317
329
            }
 
330
 
 
331
            span.x = left;
 
332
            span.y = iy;
 
333
            span.end = n;
 
334
            _swrast_write_rgba_span(ctx, &span);
318
335
         }
319
 
 
320
 
         span.x = left;
321
 
         span.y = iy;
322
 
         span.end = n;
323
 
         _swrast_write_rgba_span(ctx, &span);
324
336
      }
325
337
   }
326
338
}