[gtk/ebassi/egl-x11: 3/4] x11: Add profiler marks for SwapBuffers
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/egl-x11: 3/4] x11: Add profiler marks for SwapBuffers
- Date: Mon, 10 May 2021 18:50:49 +0000 (UTC)
commit 55569dc182f99d2bac3fc710264317541ec576eb
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon May 10 18:22:34 2021 +0100
x11: Add profiler marks for SwapBuffers
gdk/x11/gdkglcontext-egl.c | 3 ++-
gdk/x11/gdkglcontext-glx.c | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-egl.c b/gdk/x11/gdkglcontext-egl.c
index a03a5b75f0..2f26133604 100644
--- a/gdk/x11/gdkglcontext-egl.c
+++ b/gdk/x11/gdkglcontext-egl.c
@@ -34,7 +34,7 @@
#include <X11/Xatom.h>
#include "gdkinternals.h"
-
+#include "gdkprofilerprivate.h"
#include "gdkintl.h"
#include <cairo-xlib.h>
@@ -285,6 +285,7 @@ gdk_x11_gl_context_egl_end_frame (GdkDrawContext *draw_context,
egl_surface = gdk_x11_surface_get_egl_surface (surface, context_egl->egl_config);
+ gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "x11", "swap buffers");
if (display_x11->has_egl_swap_buffers_with_damage)
{
int i, j, n_rects = cairo_region_num_rectangles (painted);
diff --git a/gdk/x11/gdkglcontext-glx.c b/gdk/x11/gdkglcontext-glx.c
index a623066a66..9b7d285de5 100644
--- a/gdk/x11/gdkglcontext-glx.c
+++ b/gdk/x11/gdkglcontext-glx.c
@@ -24,7 +24,7 @@
#include <X11/Xatom.h>
#include "gdkinternals.h"
-
+#include "gdkprofilerprivate.h"
#include "gdkintl.h"
#include <cairo-xlib.h>
@@ -194,6 +194,8 @@ gdk_x11_gl_context_glx_end_frame (GdkDrawContext *draw_context,
(unsigned long) gdk_x11_surface_get_xid (surface),
context_x11->do_frame_sync ? "yes" : "no"));
+ gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "x11", "swap buffers");
+
/* if we are going to wait for the vertical refresh manually
* we need to flush pending redraws, and we also need to wait
* for that to finish, otherwise we are going to tear.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]