Merge branch 'wip/chergert/for-main' into 'main'

gdk/gdkglcontext: include duration of eglSwapBuffers

See merge request GNOME/gtk!6964
This commit is contained in:
Matthias Clasen 2024-03-02 00:03:58 +00:00
commit 6c39a5946e

View File

@ -658,6 +658,7 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
GdkSurface *surface = gdk_gl_context_get_surface (context);
GdkDisplay *display = gdk_surface_get_display (surface);
EGLSurface egl_surface;
G_GNUC_UNUSED gint64 begin_time = GDK_PROFILER_CURRENT_TIME;
if (priv->egl_context == NULL)
return;
@ -666,8 +667,6 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
egl_surface = gdk_surface_get_egl_surface (surface);
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "EGL swap buffers", NULL);
if (priv->eglSwapBuffersWithDamage)
{
EGLint stack_rects[4 * 4]; /* 4 rects */
@ -698,6 +697,8 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
else
eglSwapBuffers (gdk_display_get_egl_display (display), egl_surface);
#endif
gdk_profiler_add_mark (begin_time, GDK_PROFILER_CURRENT_TIME - begin_time, "EGL swap buffers", NULL);
}
static void