From 536f25412270d4ca31e46d1bdd8b13631022f02e Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi

Date: Wed, 31 Mar 2021 09:16:13 +0300

Subject: [PATCH 1/1] Text: Preserve alpha when caching glyphs

Ensure no blending is done. Glyphs are supposed to be cached as-is.


src/ui/text.c | 3 +++

1 file changed, 3 insertions(+)

diff --git a/src/ui/text.c b/src/ui/text.c

index dd5c5e4c..8c98cd03 100644

--- a/src/ui/text.c

+++ b/src/ui/text.c

@@ -483,10 +483,12 @@ static SDL_Surface *rasterizeGlyph_Font_(const iFont *d, uint32_t glyphIndex, fl

     &d->font, d->xScale, d->yScale, xShift, 0.0f, glyphIndex, &w, &h, 0, 0);

 SDL_Surface *surface8 =

     SDL_CreateRGBSurfaceWithFormatFrom(bmp, w, h, 8, w, SDL_PIXELFORMAT_INDEX8);

 SDL_SetSurfacePalette(surface8, text_.grayscale);

#if LAGRANGE_RASTER_DEPTH != 8

 /* Convert to the cache format. */

 SDL_Surface *surf = SDL_ConvertSurfaceFormat(surface8, LAGRANGE_RASTER_FORMAT, 0);

 free(bmp);

 SDL_FreeSurface(surface8);

 return surf;

@@ -730,6 +732,7 @@ void cacheTextGlyphs_Font_(iFont *d, const iRangecc text) {

                             0, bufSize.x, bufSize.y,

                             LAGRANGE_RASTER_DEPTH,

                             LAGRANGE_RASTER_FORMAT);

                 SDL_SetSurfacePalette(buf, text_.grayscale);

             }

             SDL_Surface *surfaces[2] = {

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.8/patch/536f25412270d4ca31e46d1bdd8b13631022f02e.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
59.911721 milliseconds
Gemini-to-HTML Time
0.620702 milliseconds

This content has been proxied by September (ba2dc).