[gtk/matthiasc/for-master: 2/3] icontheme: Add profiler marks around icon theme loading



commit bad978a2e1fdbe397c0929de2e12e5ca9585c5cb
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 22 21:31:08 2020 -0500

    icontheme: Add profiler marks around icon theme loading
    
    This is happening during the first frame.

 gtk/gtkicontheme.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 25f010d644..38a0bd2761 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -1363,6 +1363,7 @@ ensure_valid_themes (GtkIconTheme *self)
 {
   GTimeVal tv;
   gboolean was_valid = self->themes_valid;
+  gint64 before = g_get_monotonic_time ();
 
   if (self->loading_themes)
     return;
@@ -1389,6 +1390,9 @@ ensure_valid_themes (GtkIconTheme *self)
         queue_theme_changed (self);
     }
 
+  if (gdk_profiler_is_running ())
+    gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "icon theme load", 
NULL);
+
   self->loading_themes = FALSE;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]