wayland: Add a mark for cursor loading
authorMatthias Clasen <mclasen@redhat.com>
Thu, 23 Jan 2020 00:31:21 +0000 (19:31 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 23 Jan 2020 04:44:01 +0000 (23:44 -0500)
This is much too slow.

gdk/wayland/gdkdisplay-wayland.c

index d17638161118299412bce046540726c27a47acf6..57c15281c8cf595fdc793cc8d3da8f53ee80d5ab 100644 (file)
@@ -47,6 +47,7 @@
 #include "gdkglcontext-wayland.h"
 #include "gdkvulkancontext-wayland.h"
 #include "gdkwaylandmonitor.h"
+#include "gdkprofilerprivate.h"
 #include <wayland/pointer-gestures-unstable-v1-client-protocol.h>
 #include "tablet-unstable-v2-client-protocol.h"
 #include <wayland/xdg-shell-unstable-v6-client-protocol.h>
@@ -1131,6 +1132,7 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland)
   guint size;
   const gchar *name;
   GValue v = G_VALUE_INIT;
+  gint64 before = g_get_monotonic_time ();
 
   g_assert (display_wayland);
   g_assert (display_wayland->shm);
@@ -1150,6 +1152,12 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland)
 
   gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (display_wayland), name, size);
   g_value_unset (&v);
+
+  if (gdk_profiler_is_running ())
+    {
+      gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "wayland", "load cursor theme");
+    }
+
 }
 
 guint32