summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2015-11-26 17:53:42 +0100
committerNeil Roberts <[email protected]>2015-11-27 10:55:22 +0100
commitbc2470d5d3e9788af8d6aee0a001b7de9cd4972b (patch)
tree49835848a363ac6d09763341d02cba83dd2c9575 /src/util
parent27a88a947c78c9af5eaeb6587fb5211057931d8c (diff)
util: Tiny optimisation for the linear→srgb conversion
When converting 0.0 it would be nice if it didn't do any arithmetic. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/format_srgb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/format_srgb.h b/src/util/format_srgb.h
index 4a8d73f125f..34b50afe3d1 100644
--- a/src/util/format_srgb.h
+++ b/src/util/format_srgb.h
@@ -57,7 +57,7 @@ util_format_linear_to_srgb_helper_table[104];
static inline float
util_format_linear_to_srgb_float(float cl)
{
- if (cl < 0.0f)
+ if (cl <= 0.0f)
return 0.0f;
else if (cl < 0.0031308f)
return 12.92f * cl;