Fix profiling output when rendering with OpenGL

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.
This commit is contained in:
Alexander Larsson 2019-08-23 23:18:32 +03:00
parent 7101cfe468
commit e417fa1b7a

View File

@ -270,6 +270,16 @@ hook_surface_changed (GdkWindow *window)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
/* The hooking we do below doesn't work if we're rendering with
* OpenGL (the cairo surface is not touched) so just always
* do the frame.
*/
if (window->current_paint.use_gl)
{
window_pre_damage (window);
return;
}
if (impl->cairo_surface)
{
cairo_surface_set_mime_data (impl->cairo_surface,