mirror of
https://github.com/brl/mutter.git
synced 2025-08-05 16:14:51 +00:00
cogl-pango-glyph-cache: Don't put zero-sized glyphs in the cache
It now avoids trying to reserve space for zero-sized glyphs. That happens for example when the layout contains a space. This was causing the regular glyph cache to be used because the global atlas does not support zero-sized images. That would then break up the batching. Instead it now still reserves an entry in the cache but leaves the texture as COGL_INVALID_HANDLE.
This commit is contained in:

committed by
Robert Bragg

parent
f098f8fdec
commit
b83069f3b2
@@ -501,6 +501,11 @@ cogl_pango_renderer_set_dirty_glyph (PangoFont *font,
|
||||
|
||||
COGL_NOTE (PANGO, "redrawing glyph %i", glyph);
|
||||
|
||||
/* Glyphs that don't take up any space will end up without a
|
||||
texture. These should never become dirty so they shouldn't end up
|
||||
here */
|
||||
g_return_if_fail (value->texture != COGL_INVALID_HANDLE);
|
||||
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_A8,
|
||||
value->draw_width,
|
||||
value->draw_height);
|
||||
@@ -824,7 +829,7 @@ cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer,
|
||||
PANGO_UNKNOWN_GLYPH_WIDTH,
|
||||
PANGO_UNKNOWN_GLYPH_HEIGHT);
|
||||
}
|
||||
else
|
||||
else if (cache_value->texture)
|
||||
{
|
||||
x += (float)(cache_value->draw_x);
|
||||
y += (float)(cache_value->draw_y);
|
||||
|
Reference in New Issue
Block a user