diff options
author | Jouk <[email protected]> | 2007-10-02 15:17:23 +0200 |
---|---|---|
committer | Jouk <[email protected]> | 2007-10-02 15:17:23 +0200 |
commit | 584b84256b07e106cd7295495355eb21226465d7 (patch) | |
tree | 028d47d265d01f3f96787792fbd41d495d60856c /src/mesa/swrast | |
parent | eb9a5b6d5127858b01ec12672c999e7d25cd7aed (diff) | |
parent | de1d725f442caa4d8ecbac3256b5a33d1f4a1257 (diff) |
Merge branch 'master' of git+ssh://[email protected]/git/mesa/mesa
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_copypix.c | 11 | ||||
-rw-r--r-- | src/mesa/swrast/s_lines.c | 6 | ||||
-rw-r--r-- | src/mesa/swrast/s_points.c | 10 | ||||
-rw-r--r-- | src/mesa/swrast/s_span.c | 11 | ||||
-rw-r--r-- | src/mesa/swrast/s_stencil.c | 7 |
5 files changed, 32 insertions, 13 deletions
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index bbe1081860d..218a3b5590b 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -71,13 +71,20 @@ regions_overlap(GLint srcx, GLint srcy, } else { /* add one pixel of slop when zooming, just to be safe */ - if ((srcx > dstx + (width * zoomX) + 1) || (srcx + width + 1 < dstx)) { + if (srcx > (dstx + ((zoomX > 0.0F) ? (width * zoomX + 1.0F) : 0.0F))) { + /* src is completely right of dest */ + return GL_FALSE; + } + else if (srcx + width + 1.0F < dstx + ((zoomX > 0.0F) ? 0.0F : (width * zoomX))) { + /* src is completely left of dest */ return GL_FALSE; } else if ((srcy < dsty) && (srcy + height < dsty + (height * zoomY))) { + /* src is completely below dest */ return GL_FALSE; } else if ((srcy > dsty) && (srcy + height > dsty + (height * zoomY))) { + /* src is completely above dest */ return GL_FALSE; } else { diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 15ef6233eda..3de438760b5 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -279,7 +279,11 @@ _swrast_choose_line( GLcontext *ctx ) || ctx->Line.StippleFlag) { /* no texture, but Z, fog, width>1, stipple, etc. */ if (rgbmode) +#if CHAN_BITS == 32 + USE(general_line); +#else USE(rgba_line); +#endif else USE(ci_line); } diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 4768fbea972..d54adc8fd18 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -172,9 +172,10 @@ sprite_point(GLcontext *ctx, const SWvertex *vert) } else { /* even size */ - xmin = (GLint) x - iRadius + 1; + /* 0.501 factor allows conformance to pass */ + xmin = (GLint) (x + 0.501) - iRadius; xmax = xmin + iSize - 1; - ymin = (GLint) y - iRadius + 1; + ymin = (GLint) (y + 0.501) - iRadius; ymax = ymin + iSize - 1; } @@ -418,9 +419,10 @@ large_point(GLcontext *ctx, const SWvertex *vert) } else { /* even size */ - xmin = (GLint) x - iRadius + 1; + /* 0.501 factor allows conformance to pass */ + xmin = (GLint) (x + 0.501) - iRadius; xmax = xmin + iSize - 1; - ymin = (GLint) y - iRadius + 1; + ymin = (GLint) (y + 0.501) - iRadius; ymax = ymin + iSize - 1; } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index f23272c2bee..f1e58bd3d81 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -64,8 +64,11 @@ _swrast_span_default_attribs(GLcontext *ctx, SWspan *span) const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; if (ctx->DrawBuffer->Visual.depthBits <= 16) span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F); - else - span->z = (GLint) (ctx->Current.RasterPos[2] * depthMax + 0.5F); + else { + GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax; + tmpf = MIN2(tmpf, depthMax); + span->z = (GLint)tmpf; + } span->zStep = 0; span->interpMask |= SPAN_Z; } @@ -873,7 +876,7 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) #endif /* we have to wait until after occlusion to do this test */ - if (ctx->Color.DrawBuffer == GL_NONE || ctx->Color.IndexMask == 0) { + if (ctx->Color.IndexMask == 0) { /* write no pixels */ span->arrayMask = origArrayMask; return; @@ -1358,7 +1361,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) #if CHAN_BITS == 32 if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { - interpolate_int_colors(ctx, span); + interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); } #else if ((span->arrayMask & SPAN_RGBA) == 0) { diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index d0cbdd6917d..cae1e09929b 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -923,6 +923,8 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) ASSERT(rb->DataType == GL_UNSIGNED_BYTE); _swrast_get_values(ctx, rb, n, x, y, stencil, sizeof(GLubyte)); + _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + (void) do_stencil_test(ctx, face, n, stencil, mask); if (ctx->Depth.Test == GL_FALSE) { @@ -930,11 +932,12 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) n, stencil, mask); } else { - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + GLubyte tmpMask[MAX_WIDTH]; + _mesa_memcpy(tmpMask, mask, n * sizeof(GLubyte)); _swrast_depth_test_span(ctx, span); - compute_pass_fail_masks(n, origMask, mask, passMask, failMask); + compute_pass_fail_masks(n, tmpMask, mask, passMask, failMask); if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) { apply_stencil_op(ctx, ctx->Stencil.ZFailFunc[face], face, |