Skip to content

Fix profiling output when rendering with OpenGL

Alexander Larsson requested to merge alexl/gtk:fix-opengl-profiling into gtk-3-24

I was not getting any gtk+ profile markers output from the frame clock when I was profiling an OpenGL app (gnome-hexgl). I debugged this and it turns out that the profiling depends on getting the _NET_WM_FRAME_TIMINGS event from the compositor, and once we switched to OpenGL rendering this never appeared.

It turns out the reason it didn't is that the compositor only does so if the client increases the counter tied to the window, and the x11 gdk code has this optimization where if we do a draw pass but nothing is actually drawn we don't update the counter.

Unfortunately the detection of whether something was draw or not is based on some cairo surface hack that breaks when we render with OpenGL instead. The fix is to just always update the counter if we're drawing with OpenGL.

Merge request reports