This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch v-1.29
in repository efl.
View the commit online.
commit 192c4cbf9477cab89198c2970d5065bc00331e28
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 21 11:51:46 2026 -0600
evas/gl: set up the font target once per font array
GL had no multi_font_draw of its own and inherited the software one,
which draws with the software glyph routines. That never ran, because
the textgrid only called multi_font_draw in async mode, which GL never
uses. The next change makes the textgrid use it on every engine, so GL
needs its own first, or it would draw software glyphs into a GL
surface.
GL's font_draw sets the target surface and installs the font_ext
callbacks for every glyph run. Its multi_font_draw does that once for
the whole array and clears the callbacks once at the end.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/modules/evas/engines/gl_generic/evas_engine.c | 80 +++++++++++++++--------
1 file changed, 54 insertions(+), 26 deletions(-)
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 96f1f7b78c..a22b53d2d1 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -1540,39 +1540,66 @@ eng_image_stride_get(void *engine EINA_UNUSED, void *image, int *stride)
}
}
-static Eina_Bool
-eng_font_draw(void *engine EINA_UNUSED, void *data, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Text_Props *intl_props, Eina_Bool do_async EINA_UNUSED)
+static Evas_Engine_GL_Context *
+_font_ext_set(void *data, void *context, void *surface)
{
Evas_Engine_GL_Context *gl_context;
gl_context = gl_generic_context_get(data, 1);
evas_gl_common_context_target_surface_set(gl_context, surface);
gl_context->dc = context;
- {
- if (!gl_context->font_surface)
- gl_context->font_surface = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
- gl_context->font_surface->cache_entry.w = gl_context->shared->w;
- gl_context->font_surface->cache_entry.h = gl_context->shared->h;
+ if (!gl_context->font_surface)
+ gl_context->font_surface = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
+ gl_context->font_surface->cache_entry.w = gl_context->shared->w;
+ gl_context->font_surface->cache_entry.h = gl_context->shared->h;
- evas_common_draw_context_font_ext_set(context,
- gl_context,
- evas_gl_font_texture_new,
- evas_gl_font_texture_free,
- evas_gl_font_texture_draw,
- evas_gl_font_image_new,
- evas_gl_font_image_free,
- evas_gl_font_image_draw);
- evas_common_font_draw_prepare(intl_props);
- evas_common_font_draw(gl_context->font_surface, context, x, y, intl_props->glyphs);
- evas_common_draw_context_font_ext_set(context,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL);
- }
+ evas_common_draw_context_font_ext_set(context,
+ gl_context,
+ evas_gl_font_texture_new,
+ evas_gl_font_texture_free,
+ evas_gl_font_texture_draw,
+ evas_gl_font_image_new,
+ evas_gl_font_image_free,
+ evas_gl_font_image_draw);
+ return gl_context;
+}
+
+static void
+_font_ext_clear(void *context)
+{
+ evas_common_draw_context_font_ext_set(context,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+}
+
+static Eina_Bool
+eng_font_draw(void *engine EINA_UNUSED, void *data, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Text_Props *intl_props, Eina_Bool do_async EINA_UNUSED)
+{
+ Evas_Engine_GL_Context *gl_context;
+
+ gl_context = _font_ext_set(data, context, surface);
+ evas_common_font_draw_prepare(intl_props);
+ evas_common_font_draw(gl_context->font_surface, context, x, y, intl_props->glyphs);
+ _font_ext_clear(context);
+
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+eng_multi_font_draw(void *engine EINA_UNUSED, void *data, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Font_Array *texts, Eina_Bool do_async EINA_UNUSED)
+{
+ Evas_Engine_GL_Context *gl_context;
+
+ if (!texts) return EINA_FALSE;
+
+ gl_context = _font_ext_set(data, context, surface);
+ evas_common_font_draw_array(gl_context->font_surface, context, x, y, texts);
+ _font_ext_clear(context);
return EINA_FALSE;
}
@@ -4081,6 +4108,7 @@ module_open(Evas_Module *em)
ORD(image_native_get);
ORD(font_draw);
+ ORD(multi_font_draw);
ORD(image_scale_hint_set);
ORD(image_scale_hint_get);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.