forked from AuroraMiddleware/gtk
rate-limit the glyph cache dumping
Writing the file out every frame really isn't necessary. Do it once per second.
This commit is contained in:
parent
47cf17c70c
commit
781821bae4
@ -642,10 +642,18 @@ dump_glyph_cache_stats (GlyphCache *cache)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
FontEntry *fe;
|
||||
static gint64 time;
|
||||
gint64 now;
|
||||
|
||||
if (!cache->fonts)
|
||||
return;
|
||||
|
||||
now = g_get_monotonic_time ();
|
||||
if (now - time < 1000000)
|
||||
return;
|
||||
|
||||
time = now;
|
||||
|
||||
g_print ("Glyph cache:\n");
|
||||
g_hash_table_iter_init (&iter, cache->fonts);
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&fe))
|
||||
|
Loading…
Reference in New Issue
Block a user