summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-01-22 14:51:40 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-01-22 15:12:03 -0500
commitdfea9bf0e8f30eab1532c74b55904a960f74435f (patch)
tree5417365746f807e8e254675ffe3ee0d6b8e14db8
parent36cb812ad8725e2b3f2887c3d4a6a16b987dddfb (diff)
downloadgtk+-dfea9bf0e8f30eab1532c74b55904a960f74435f.tar.gz
wayland: Add profiler marks around surface handling
Add marks for when we do commits, swap buffer or receive frame events. These are the low-level start and end points of the frame cycle, and it is useful to see them in the profiler.
-rw-r--r--gdk/wayland/gdkglcontext-wayland.c2
-rw-r--r--gdk/wayland/gdksurface-wayland.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index c6b2116b26..ec647c7764 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -31,6 +31,7 @@
#include "gdkinternals.h"
#include "gdksurfaceprivate.h"
+#include "gdkprofilerprivate.h"
#include "gdkintl.h"
@@ -238,6 +239,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
gdk_wayland_surface_sync (surface);
gdk_wayland_surface_request_frame (surface);
+ gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "swap buffers");
if (display_wayland->have_egl_swap_buffers_with_damage)
{
int i, j, n_rects = cairo_region_num_rectangles (painted);
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 7aa8125048..ac42a28145 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -357,6 +357,7 @@ frame_callback (void *data,
GdkFrameClock *clock = gdk_surface_get_frame_clock (surface);
GdkFrameTimings *timings;
+ gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "frame event");
GDK_DISPLAY_NOTE (GDK_DISPLAY (display_wayland), EVENTS, g_message ("frame %p", surface));
wl_callback_destroy (callback);
@@ -477,6 +478,7 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
* before we need to stage any changes, then we can take it back and
* use it again.
*/
+ gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "surface commit");
wl_surface_commit (impl->display_server.wl_surface);
impl->pending_commit = FALSE;
@@ -1508,6 +1510,7 @@ gdk_wayland_surface_create_xdg_toplevel (GdkSurface *surface)
if (impl->hint == GDK_SURFACE_TYPE_HINT_DIALOG)
_gdk_wayland_screen_add_orphan_dialog (surface);
+ gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "surface commit");
wl_surface_commit (impl->display_server.wl_surface);
}
@@ -2302,6 +2305,7 @@ gdk_wayland_surface_create_xdg_popup (GdkSurface *surface,
}
}
+ gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "surface commit");
wl_surface_commit (impl->display_server.wl_surface);
impl->popup_parent = parent;