[cairo-commit] 2 commits - src/cairo-ft-font.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Jul 30 10:45:39 UTC 2023
src/cairo-ft-font.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 542bfac286a945aa584f7dc2376f1f9f33b37ac9
Merge: 00d8d3117 05ba8e975
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Jul 30 10:45:38 2023 +0000
Merge branch 'big-endian-swap' into 'master'
Fix FT color glyphs on big endian systems
Closes #787
See merge request cairo/cairo!500
commit 05ba8e975102bc4a0e4e5e5cb24571288ff78d8b
Author: Uli Schlachter <psychon at znc.in>
Date: Sun Jul 30 11:15:49 2023 +0200
Fix FT color glyphs on big endian systems
Andreas Falkenhahn reported the issue below and indicated that the color
channels are swapped. This commit fixes the byte swap.
The problem is that be32_to_cpu() is a no-op on big endian systems.
However, we also have a bswap_32() function available that always works.
Testing done: None by me, but Andreas Falkenhahn reported that his patch
fixes colors on a PowerPC system.
Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/787
Signed-off-by: Uli Schlachter <psychon at znc.in>
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index bc0d5485f..21d6c6193 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -1334,7 +1334,7 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
unsigned int i, count = height * width;
uint32_t *p = (uint32_t *) data;
for (i = 0; i < count; i++)
- p[i] = be32_to_cpu (p[i]);
+ p[i] = bswap_32 (p[i]);
}
format = CAIRO_FORMAT_ARGB32;
break;
More information about the cairo-commit
mailing list