forked from AuroraMiddleware/gtk
gl: Improve debug spew for caches
Dump similar information for both caches, and correct the unused percentage for the atlases.
This commit is contained in:
parent
b8f62d1e10
commit
60d63bbada
@ -357,5 +357,7 @@ gsk_gl_glyph_cache_begin_frame (GskGLGlyphCache *self,
|
||||
|
||||
value->accessed = FALSE;
|
||||
}
|
||||
|
||||
GSK_NOTE(GLYPH_CACHE, g_message ("%d glyphs cached", g_hash_table_size (self->hash_table)));
|
||||
}
|
||||
}
|
||||
|
@ -76,12 +76,19 @@ gsk_gl_icon_cache_begin_frame (GskGLIconCache *self,
|
||||
/* Drop icons on removed atlases */
|
||||
if (removed_atlases->len > 0)
|
||||
{
|
||||
guint dropped = 0;
|
||||
|
||||
g_hash_table_iter_init (&iter, self->icons);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *)&texture, (gpointer *)&icon_data))
|
||||
{
|
||||
if (g_ptr_array_find (removed_atlases, icon_data->atlas, NULL))
|
||||
g_hash_table_iter_remove (&iter);
|
||||
{
|
||||
g_hash_table_iter_remove (&iter);
|
||||
dropped++;
|
||||
}
|
||||
}
|
||||
|
||||
GSK_NOTE(GLYPH_CACHE, if (dropped > 0) g_message ("Dropped %d icons", dropped));
|
||||
}
|
||||
|
||||
if (self->timestamp % MAX_FRAME_AGE == 0)
|
||||
@ -102,6 +109,8 @@ gsk_gl_icon_cache_begin_frame (GskGLIconCache *self,
|
||||
|
||||
icon_data->accessed = FALSE;
|
||||
}
|
||||
|
||||
GSK_NOTE(GLYPH_CACHE, g_message ("%d icons cached", g_hash_table_size (self->icons)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ gsk_gl_texture_atlases_begin_frame (GskGLTextureAtlases *self,
|
||||
{
|
||||
GSK_NOTE(GLYPH_CACHE,
|
||||
g_message ("Dropping atlas %d (%g.2%% old)", i,
|
||||
gsk_gl_texture_atlas_get_unused_ratio (atlas)));
|
||||
100.0 * gsk_gl_texture_atlas_get_unused_ratio (atlas)));
|
||||
|
||||
if (atlas->texture_id != 0)
|
||||
{
|
||||
@ -100,6 +100,8 @@ gsk_gl_texture_atlases_begin_frame (GskGLTextureAtlases *self,
|
||||
}
|
||||
}
|
||||
|
||||
GSK_NOTE(GLYPH_CACHE, if (removed->len > 0) g_message ("%d atlases left", self->atlases->len));
|
||||
|
||||
#if 0
|
||||
{
|
||||
static guint timestamp;
|
||||
|
Loading…
Reference in New Issue
Block a user