external/cairo/cairo/cairo.GL_RGBA.patch | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+)
New commits: commit 1f993022c3e890e058e55fc2500b2ff3160fb612 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue May 7 17:05:44 2024 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed May 8 11:52:06 2024 +0200 cool#7015 fix rgba emojis We initially added this for android so we could match the OpenGL GL_RGBA layout available there. Later we made it available for all platforms via --enable-cairo-rgba which is useful for the kit case. But along the line color emoji support was added to cairo which wasn't present at the time of the original patch, so now capture those uses as well. https: //github.com/CollaboraOnline/online/issues/7015 Change-Id: I6039607a46a58a7e9cbf5c052e6fb34234fd19b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167226 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/external/cairo/cairo/cairo.GL_RGBA.patch b/external/cairo/cairo/cairo.GL_RGBA.patch index 648448e9de92..bad6a81ed541 100644 --- a/external/cairo/cairo/cairo.GL_RGBA.patch +++ b/external/cairo/cairo/cairo.GL_RGBA.patch @@ -58,3 +58,63 @@ break; } return ret; +--- misc/cairo-1.10.2/src/cairo-ft-font.c ++++ misc/cairo-1.10.2/src/cairo-ft-font.c +@@ -1318,6 +1321,19 @@ + memcpy (data, bitmap->buffer, (size_t)stride * height); + } + ++ { ++ /* swizzle to rgba */ ++ unsigned int i, count = height * width; ++ unsigned char *p = data; ++ for (i = 0; i < count; i++) ++ { ++ unsigned char tmp = p[0]; ++ p[0] = p[2]; ++ p[2] = tmp; ++ p+=4; ++ } ++ } ++ + if (!_cairo_is_little_endian ()) + { + /* Byteswap. */ +@@ -2573,7 +2589,7 @@ + if (unlikely (status)) + return status; + +- if (pixman_image_get_format (surface->pixman_image) == PIXMAN_a8r8g8b8 && ++ if (pixman_image_get_format (surface->pixman_image) == PIXMAN_a8b8g8r8 && + !pixman_image_get_component_alpha (surface->pixman_image)) { + _cairo_scaled_glyph_set_color_surface (scaled_glyph, + &scaled_font->base, +--- misc/cairo-1.10.2/src/cairo-image-compositor.c ++++ misc/cairo-1.10.2/src/cairo-image-compositor.c +@@ -1074,7 +1074,7 @@ + format = PIXMAN_a8; + i = (info->extents.width + 3) & ~3; + if (scaled_glyph->surface->base.content & CAIRO_CONTENT_COLOR) { +- format = PIXMAN_a8r8g8b8; ++ format = PIXMAN_a8b8g8r8; + i = info->extents.width * 4; + } + +@@ -1126,7 +1126,7 @@ + format == PIXMAN_a8) { + pixman_image_t *ca_mask; + +- format = PIXMAN_a8r8g8b8; ++ format = PIXMAN_a8b8g8r8; + ca_mask = pixman_image_create_bits (format, + info->extents.width, + info->extents.height, +@@ -1175,7 +1175,7 @@ + } + } + +- if (format == PIXMAN_a8r8g8b8) ++ if (format == PIXMAN_a8b8g8r8) + pixman_image_set_component_alpha (mask, TRUE); + + pixman_image_composite32 (_pixman_operator (op),