summaryrefslogtreecommitdiff
path: root/gtk/gtkicontheme.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-21 23:58:09 +0000
committerMatthias Clasen <mclasen@redhat.com>2020-08-21 23:58:09 +0000
commit125ed52ccb7922e57c1200f64daabf415c6da9f5 (patch)
tree8cb85fb1d192f7fb1445439b6d2b4232ea2ee267 /gtk/gtkicontheme.c
parent7a9501b1fbae43f9500c68469f2e81224b5caa84 (diff)
parente915a1aa7f850745bb626bd3342d0f65ee27181b (diff)
downloadgtk+-125ed52ccb7922e57c1200f64daabf415c6da9f5.tar.gz
Merge branch 'new-sysprof' into 'master'
Port profiling to sysprof-collector api See merge request GNOME/gtk!2457
Diffstat (limited to 'gtk/gtkicontheme.c')
-rw-r--r--gtk/gtkicontheme.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index c7822ad129..db786a383e 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -2070,16 +2070,16 @@ ensure_valid_themes (GtkIconTheme *self,
if (!self->themes_valid)
{
- gint64 before;
+ gint64 before G_GNUC_UNUSED;
+
if (non_blocking)
return FALSE;
- before = g_get_monotonic_time ();
+ before = GDK_PROFILER_CURRENT_TIME;
load_themes (self);
- if (GDK_PROFILER_IS_RUNNING)
- gdk_profiler_end_mark (before, "icon theme load", self->current_theme);
+ gdk_profiler_end_mark (before, "icon theme load", self->current_theme);
if (was_valid)
queue_theme_changed (self);
@@ -3720,7 +3720,7 @@ icon_ensure_texture__locked (GtkIconPaintable *icon,
if (icon->texture)
return;
- before = g_get_monotonic_time ();
+ before = GDK_PROFILER_CURRENT_TIME;
/* This is the natural pixel size for the requested icon size + scale in this directory.
* We precalculate this so we can use it as a rasterization size for svgs.
@@ -3825,11 +3825,13 @@ icon_ensure_texture__locked (GtkIconPaintable *icon,
if (GDK_PROFILER_IS_RUNNING)
{
- guint64 end = g_get_monotonic_time ();
+ gint64 end = GDK_PROFILER_CURRENT_TIME;
/* Don't report quick (< 0.5 msec) parses */
- if (end - before > 500 || !in_thread)
- gdk_profiler_add_markf (before, (end - before), in_thread ? "icon load (thread)" : "icon load" ,
- "%s size %d@%d", icon->filename, icon->desired_size, icon->desired_scale);
+ if (end - before > 500000 || !in_thread)
+ {
+ gdk_profiler_add_markf (before, (end - before), in_thread ? "icon load (thread)" : "icon load" ,
+ "%s size %d@%d", icon->filename, icon->desired_size, icon->desired_scale);
+ }
}
}