mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 23:00:08 +00:00
css: Add a profiler mark around theme loading
This is also time spent before the first frame.
This commit is contained in:
parent
73a214d1a9
commit
0fe9643728
@ -42,6 +42,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include "gdk/gdkprofilerprivate.h"
|
||||
#include <cairo-gobject.h>
|
||||
|
||||
/**
|
||||
@ -1004,6 +1005,8 @@ gtk_css_provider_load_internal (GtkCssProvider *self,
|
||||
GFile *file,
|
||||
GBytes *bytes)
|
||||
{
|
||||
gint64 before = g_get_monotonic_time ();
|
||||
|
||||
if (bytes == NULL)
|
||||
{
|
||||
GError *load_error = NULL;
|
||||
@ -1050,6 +1053,13 @@ gtk_css_provider_load_internal (GtkCssProvider *self,
|
||||
|
||||
g_bytes_unref (bytes);
|
||||
}
|
||||
|
||||
if (gdk_profiler_is_running ())
|
||||
{
|
||||
char *uri = g_file_get_uri (file);
|
||||
gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "theme load", uri);
|
||||
g_free (uri);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user