aboutsummaryrefslogtreecommitdiff
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-12-20 11:25:12 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-12-20 14:46:32 +0000
commita2ce0622c5396774c64245bb6cbd6b7dbd0d339d (patch)
tree5b56f3445f9f1fa928762ded725f5220d29fe782 /CHANGELOG.md
parentmeson: add wl_proto_headers to pgo executable (diff)
render: fix rounding error when calculating background color with alpha
We use pre-multiplied alpha color channels, but were having bad rounding errors due to the alpha divider being truncated to an integer. The algorithm for pre-multiplying a color channel is: alpha_divider = 0xffff / alpha pre_mult_color = color / alpha_divider In order to fix the rounding errors, we could turn ‘alpha_divider’ into a double. That however would introduce a performance penalty since now we’d need to do floating point math for each cell. The algorithm can be trivially converted to: pre_mult_color = color * alpha / 0xffff Since both color and alpa values are < 65536, the multiplication is “safe”; it will not overflow an uint32_t. Closes #249
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9210188c..88d827e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,8 @@
* Missing dependencies in meson, causing heavily parallelized builds
to fail.
+* Background color when alpha < 1.0 being wrong
+ (https://codeberg.org/dnkl/foot/issues/249).
### Security