aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-09-14 11:08:57 +0100
committerDave Airlie <[email protected]>2011-09-14 11:18:08 +0100
commit81a86aea4f0990a1b8795f9e00e7a6c4ba368281 (patch)
tree9798a61c65a74aba6790849544afcd6b32e15f51 /src/mesa/main/image.c
parent093dc9e548537e6c77e33064a584f849ad90dfa5 (diff)
mesa/colormac: introduce inline helper for 4 unclamped float to ubyte.
This introduces an UNCLAMPED_FLOAT_TO_UBYTE x 4 inline function, as suggested by Brian. It uses it in a few places I noticed from previous color changes, and also some core mesa places. I haven't updated other places yet. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 3e75e7c6bd9..66d7eec6588 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1513,12 +1513,8 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src,
GLubyte (*dst1)[4] = (GLubyte (*)[4]) (useTemp ? tempBuffer : dst);
GLuint i;
for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][RCOMP], src4[i][RCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][GCOMP], src4[i][GCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][BCOMP], src4[i][BCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(dst1[i][ACOMP], src4[i][ACOMP]);
- }
+ if (!mask || mask[i])
+ _mesa_unclamped_float_rgba_to_ubyte(dst1[i], src4[i]);
}
if (useTemp)
memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte));