summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pixeltransfer.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-05-18 14:45:20 -0600
committerBrian Paul <brianp@vmware.com>2012-05-19 08:28:57 -0600
commitc9cb9cf0502f4ca179ed1b4dd763c94912843d38 (patch)
treef518f7d395fe4919d8db078c7613a8d0316107af /src/mesa/main/pixeltransfer.c
parent699c1894eea6a42a747ebbc3974bf0abf3d1dd88 (diff)
downloadexternal_mesa3d-c9cb9cf0502f4ca179ed1b4dd763c94912843d38.zip
external_mesa3d-c9cb9cf0502f4ca179ed1b4dd763c94912843d38.tar.gz
external_mesa3d-c9cb9cf0502f4ca179ed1b4dd763c94912843d38.tar.bz2
mesa: use F_TO_I() instead of IROUND()
Use it where performance matters more and the exact method of float->int conversion/rounding isn't terribly important. There should no net change here since F_TO_I() is the new name of the old IROUND() function. Reviewed-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/mesa/main/pixeltransfer.c')
-rw-r--r--src/mesa/main/pixeltransfer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/main/pixeltransfer.c b/src/mesa/main/pixeltransfer.c
index c6172b9..fa355eb 100644
--- a/src/mesa/main/pixeltransfer.c
+++ b/src/mesa/main/pixeltransfer.c
@@ -93,10 +93,10 @@ _mesa_map_rgba( const struct gl_context *ctx, GLuint n, GLfloat rgba[][4] )
GLfloat g = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F);
GLfloat b = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F);
GLfloat a = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F);
- rgba[i][RCOMP] = rMap[IROUND(r * rscale)];
- rgba[i][GCOMP] = gMap[IROUND(g * gscale)];
- rgba[i][BCOMP] = bMap[IROUND(b * bscale)];
- rgba[i][ACOMP] = aMap[IROUND(a * ascale)];
+ rgba[i][RCOMP] = rMap[F_TO_I(r * rscale)];
+ rgba[i][GCOMP] = gMap[F_TO_I(g * gscale)];
+ rgba[i][BCOMP] = bMap[F_TO_I(b * bscale)];
+ rgba[i][ACOMP] = aMap[F_TO_I(a * ascale)];
}
}
@@ -235,7 +235,7 @@ _mesa_apply_ci_transfer_ops(const struct gl_context *ctx,
GLuint i;
for (i = 0; i < n; i++) {
const GLuint j = indexes[i] & mask;
- indexes[i] = IROUND(ctx->PixelMaps.ItoI.Map[j]);
+ indexes[i] = F_TO_I(ctx->PixelMaps.ItoI.Map[j]);
}
}
}