summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_drawpix.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-05-24 13:59:50 -0700
committerEric Anholt <eric@anholt.net>2007-05-24 16:46:54 -0700
commitfd9d27e0686f5a15803d13d207e58be1972fdf31 (patch)
tree79f8847e0fd723567032fa201d7b3ff2fdf5621d /src/mesa/swrast/s_drawpix.c
parentb1fcabefa2f3fa81a20c1556383458315bb49bbf (diff)
parentf116aed1ede0d802e9f3c5989290002975c00330 (diff)
Merge branch 'master' into i915-unification
Conflicts: src/mesa/drivers/dri/i915tex/i830_texstate.c src/mesa/drivers/dri/i915tex/i915_texstate.c
Diffstat (limited to 'src/mesa/swrast/s_drawpix.c')
-rw-r--r--src/mesa/swrast/s_drawpix.c43
1 files changed, 9 insertions, 34 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index cd5b7bc293..d971d90fb9 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -71,13 +71,7 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y,
}
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
- _swrast_span_default_secondary_color(ctx, &span);
- if (ctx->Depth.Test)
- _swrast_span_default_z(ctx, &span);
- if (swrast->_FogEnabled)
- _swrast_span_default_fog(ctx, &span);
- if (ctx->Texture._EnabledCoordUnits)
- _swrast_span_default_texcoords(ctx, &span);
+ _swrast_span_default_attribs(ctx, &span);
/* copy input params since clipping may change them */
unpack = *userUnpack;
@@ -274,9 +268,9 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y,
for (row = 0; row < drawHeight; row++) {
ASSERT(drawWidth <= MAX_WIDTH);
_mesa_map_ci8_to_rgba8(ctx, drawWidth, src,
- span.array->color.sz1.rgba);
+ span.array->rgba8);
rb->PutRow(ctx, rb, drawWidth, destX, destY,
- span.array->color.sz1.rgba, NULL);
+ span.array->rgba8, NULL);
src += unpack.RowLength;
destY += yStep;
}
@@ -287,12 +281,12 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y,
for (row = 0; row < drawHeight; row++) {
ASSERT(drawWidth <= MAX_WIDTH);
_mesa_map_ci8_to_rgba8(ctx, drawWidth, src,
- span.array->color.sz1.rgba);
+ span.array->rgba8);
span.x = destX;
span.y = destY;
span.end = drawWidth;
_swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
- span.array->color.sz1.rgba);
+ span.array->rgba8);
src += unpack.RowLength;
destY++;
}
@@ -333,18 +327,13 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLint imgX = x, imgY = y;
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
GLint row, skipPixels;
SWspan span;
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX);
-
- if (ctx->Depth.Test)
- _swrast_span_default_z(ctx, &span);
- if (swrast->_FogEnabled)
- _swrast_span_default_fog(ctx, &span);
+ _swrast_span_default_attribs(ctx, &span);
/*
* General solution
@@ -433,20 +422,13 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLboolean scaleOrBias
= ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
SWspan span;
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z);
-
- _swrast_span_default_color(ctx, &span);
- _swrast_span_default_secondary_color(ctx, &span);
- if (swrast->_FogEnabled)
- _swrast_span_default_fog(ctx, &span);
- if (ctx->Texture._EnabledCoordUnits)
- _swrast_span_default_texcoords(ctx, &span);
+ _swrast_span_default_attribs(ctx, &span);
if (type == GL_UNSIGNED_SHORT
&& ctx->DrawBuffer->Visual.depthBits == 16
@@ -550,7 +532,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLint imgX = x, imgY = y;
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
GLfloat *convImage = NULL;
@@ -562,14 +543,8 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
unpack, pixels))
return;
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
- _swrast_span_default_secondary_color(ctx, &span);
- if (ctx->Depth.Test)
- _swrast_span_default_z(ctx, &span);
- if (swrast->_FogEnabled)
- _swrast_span_default_fog(ctx, &span);
- if (ctx->Texture._EnabledCoordUnits)
- _swrast_span_default_texcoords(ctx, &span);
+ INIT_SPAN(span, GL_BITMAP, 0, 0x0, SPAN_RGBA);
+ _swrast_span_default_attribs(ctx, &span);
if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
/* Convolution has to be handled specially. We'll create an