]> git.mdlowis.com Git - proto/labwc.git/commit
common/font: avoid rendering semi-transparent background twice
authorJohn Lindgren <john@jlindgren.net>
Sun, 7 Apr 2024 07:26:16 +0000 (03:26 -0400)
committerJohn Lindgren <john@jlindgren.net>
Mon, 8 Apr 2024 13:55:37 +0000 (09:55 -0400)
commit45c60de263ae00051248116ae6a272f6d9e7198b
treef2f630328ab7ba0f7a1ba69fbf23c355fc1ebacc
parenteb5e855b6949c47b007f62562d75eac0a5a6c60f
common/font: avoid rendering semi-transparent background twice

Fill with the background color first only if the background color is
opaque. This is necessary for subpixel rendering to work properly (it
does not work on top of transparency).

However, if the background color is not opaque, leave the buffer
unfilled (completely transparent) since the background is already
rendered by the scene element underneath. In this case we have to
disable subpixel rendering.

v2: use 0.999 alpha cutoff and fix CodeStyleCheck

Fixes: (the rest of) #1684
scripts/checkpatch.pl
src/common/font.c