summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_drawpix.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-08-23 21:40:21 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-08-23 21:40:21 +0000
commit4be6c0f04b9ba81dba144b45f92ab807e141755f (patch)
tree5721caa5db7cdbaa15544fdb9522236917b2c20f /src/mesa/swrast/s_drawpix.c
parenta3a10e6dfc4eadcb8a11b884decdeee607dcf535 (diff)
glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work
Diffstat (limited to 'src/mesa/swrast/s_drawpix.c')
-rw-r--r--src/mesa/swrast/s_drawpix.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 008b60dcff..ab33d61b57 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -627,7 +627,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
GLenum type, const GLvoid *pixels )
{
const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0;
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
const GLint desty = y;
struct sw_span span;
@@ -720,19 +720,13 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
span.array->z[i] = (GLdepth) (floatSpan[i] * zs + 0.5F);
}
}
- if (ctx->Visual.rgbMode) {
- if (zoom) {
- _swrast_write_zoomed_rgba_span(ctx, &span,
- (const GLchan (*)[4]) span.array->rgba,
- desty, skipPixels);
- }
- else
- _swrast_write_rgba_span(ctx, &span);
+ if (zoom) {
+ _swrast_write_zoomed_depth_span(ctx, &span, desty, skipPixels);
+ }
+ else if (ctx->Visual.rgbMode) {
+ _swrast_write_rgba_span(ctx, &span);
}
else {
- if (zoom)
- _swrast_write_zoomed_index_span(ctx, &span, desty, 0);
- else
_swrast_write_index_span(ctx, &span);
}
}