diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-07-22 11:36:29 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-07-22 12:51:32 -0400 |
commit | a10b1b7341822ca751709459f1e21a31641df9a2 (patch) | |
tree | 2afeaa563bb382796598c3af7180abb53f54cb4c /gdk/gdkdisplay.c | |
parent | 02c62267413c2c187a77f7f91610690f8b0a5d0a (diff) | |
download | gtk+-a10b1b7341822ca751709459f1e21a31641df9a2.tar.gz |
Add more sysprof marks
Add a few more marks during gtk_init to figure out where
our startup time goes, and avoid the sysprof initialization
from distorting the first mark.
Diffstat (limited to 'gdk/gdkdisplay.c')
-rw-r--r-- | gdk/gdkdisplay.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index 8da1a4cc9f..5067065b03 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -1200,6 +1200,10 @@ gdk_display_init_gl (GdkDisplay *self) { GdkDisplayPrivate *priv = gdk_display_get_instance_private (self); GdkGLContext *context; + gint64 before G_GNUC_UNUSED; + gint64 before2 G_GNUC_UNUSED; + + before = GDK_PROFILER_CURRENT_TIME; if (GDK_DISPLAY_DEBUG_CHECK (self, GL_DISABLE)) { @@ -1213,17 +1217,23 @@ gdk_display_init_gl (GdkDisplay *self) if (context == NULL) return; + before2 = GDK_PROFILER_CURRENT_TIME; + if (!gdk_gl_context_realize (context, &priv->gl_error)) { g_object_unref (context); return; } + gdk_profiler_end_mark (before2, "realize OpenGL context", NULL); + /* Only assign after realize, so GdkGLContext::realize() can use * gdk_display_get_gl_context() == NULL to differentiate between * the display's context and any other context. */ priv->gl_context = context; + + gdk_profiler_end_mark (before, "initialize OpenGL", NULL); } /** @@ -1268,6 +1278,8 @@ gdk_display_prepare_gl (GdkDisplay *self, { if (error) *error = g_error_copy (priv->gl_error); + + return FALSE; } |