[gtk+] rate-limit the glyph cache dumping
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] rate-limit the glyph cache dumping
- Date: Mon, 11 Sep 2017 15:20:16 +0000 (UTC)
commit 781821bae4b13612a4df8df80e8b506fcc7a34fc
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Sep 11 11:15:00 2017 -0400
rate-limit the glyph cache dumping
Writing the file out every frame really isn't necessary.
Do it once per second.
gsk/gskvulkanrenderer.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gsk/gskvulkanrenderer.c b/gsk/gskvulkanrenderer.c
index 39313cd..109f487 100644
--- a/gsk/gskvulkanrenderer.c
+++ b/gsk/gskvulkanrenderer.c
@@ -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))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]