summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-16 12:28:56 -0700
committerBrian Paul <[email protected]>2012-01-24 14:12:28 -0700
commit881ef2a9db22cff4c7d07b873d23b0c324da555a (patch)
treedbea6a00e0a9d31fe5dafc60c10e0825c8099966 /src/mesa/swrast/s_span.c
parent8696a5210289166ce39d765d771258258400e876 (diff)
swrast: use color packing functions in s_span.c
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 1ad8396f55c..fa63ade89ce 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -1052,20 +1052,25 @@ put_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
const void *values, const GLubyte *mask)
{
+ gl_pack_ubyte_rgba_func pack_ubyte;
+ gl_pack_float_rgba_func pack_float;
GLuint i;
+ if (datatype == GL_UNSIGNED_BYTE)
+ pack_ubyte = _mesa_get_pack_ubyte_rgba_function(rb->Format);
+ else
+ pack_float = _mesa_get_pack_float_rgba_function(rb->Format);
+
for (i = 0; i < count; i++) {
if (mask[i]) {
GLubyte *dst = _swrast_pixel_address(rb, x[i], y[i]);
if (datatype == GL_UNSIGNED_BYTE) {
- _mesa_pack_ubyte_rgba_row(rb->Format, 1,
- (const GLubyte (*)[4]) values + i, dst);
+ pack_ubyte((const GLubyte *) values + 4 * i, dst);
}
else {
assert(datatype == GL_FLOAT);
- _mesa_pack_float_rgba_row(rb->Format, count,
- (const GLfloat (*)[4]) values + i, dst);
+ pack_float((const GLfloat *) values + 4 * i, dst);
}
}
}