For a given OpenGL context, macOS in particular does not support enumeration / detection of OpenGL features that have been promoted to core OpenGL functionality. It is possible other drivers are the same. This change assumes support for GL_ARB_texture_non_power_of_two with OpenGL 2.0+, GL_ARB_texture_rectangle with OpenGL 3.1+ and GL_EXT_framebuffer_blit with OpenGL 3.0+. I failed to find definitive information on whether GL_GREMEDY_frame_terminator has been promoted to OpenGL core, or whether GL_ANGLE_framebuffer_blit or GL_EXT_unpack_subimage have been promoted to core in OpenGL ES. This change results in a significant GtkGLArea performance boost on macOS.
Closes#2428
The function is fundamentally broken for unbounded surfaces.
If a surface is unbounded, we cannot represent this as a
cairo_rectangle_int_t, and using the return value doesn't work because
it's already used for something else.
In GTK3, unbounded surfaces aren't a problem, but GTK4 uses recording
surfaces.
So better remove that function before we keep using it and using it
wrong.
The marks are averaged based on the name, so this makes more sense.
Also rename the map/unmap marks to have the same capitalization as
everything else.
I was getting CI failures like:
../gdk/gdkprofiler.c: In function ‘add_markvf’:
../gdk/gdkprofiler.c:111:3: error: function ‘add_markvf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
This drops the marks for before/after-paint as they are internal
things that very rarely use any time, and also flush/resume-events
as any events reported here will get separate marks so will be easy
to see anyway.
Also, we rename the entire frameclock cycle to "frameclock cycle"
rather than "paint_idle" which is rather cryptic.
These don't take a duration, instead they call g_get_monotonic_time() to
and subtract the start time for it.
Almost all our calls are like this, and this makes the callsites clearer
and avoids inlining the clock call into the call site.
When we use if (GDK_PROFILER_IS_RUNNING) this means we get an
inlined if (FALSE) when the compiler support is not compiled in, which
gets rid of all the related code completely.
We also expand to G_UNLIKELY(gdk_profiler_is_running ()) in the supported
case which might cause somewhat better code generation.
usec is the scale of the monotonic timer which is where we get almost
all the times from. The only actual source of nsec is the opengl
GPU time (but who knows what the actual resulution of that is).
Changing this to usec allows us to get rid of " * 1000" in a *lot* of
places all over the codebase, which are ugly and confusing.
This allows us to avoid hand-rolling g_strdup_printf calls,
but also moves the printf into the called function where
it doesn't bloat the code of the calling function if the profiler
is not running.
All the code in e.g. init_randr15() divides the physical resolutions with
the screen scale, however if we get the screen scale from xsettings
rather than e.g. GDK_SCALE the initial setup is using the wrong value.
So, whenever the screen scale size is changed we need to trigger
a re-read of the randr data
1. Rename the thing
2. Turn it from a signal to a vfunc
3. Pass the GtkCssStyleChange to it
We don't export any public API about the GtkCssStyleChange yet, it's
just a boring opaque struct.
We're not in the business of adding Cairo APIs. That's Cairo's job.
Also, we don't need this API anywhere like the original commit claimed,
so there's no need to make it available in any way.
This reverts commit afa6cc2369.
This was blocking the clean exit from the testdbus shutdown in
the defaultvalues test. The proxy was keeping the connection alive
which blocks g_test_dbus_down().
This adds a GDK_DEBUG=default-settings flag which disables reads
from xsettings and Xft resources, and enables this for the testsuite.
This is one less way to get different testresults depending on the
environment. In particular, it was failing the css tests for me
due to getting the wrong font size because i have a different dpi.
We only have implementations of this on X11 and Win32,
so make it available as backend api there.
Update all callers to use either the backend api, or
just monitor 0.
When a device is added, there are two references to it by the device
manager, the initial one and the one used for the id_table. Removing a
device only removed the reference added by the id_table resulting in the
GdkDevice being leaked.
https://gitlab.gnome.org/GNOME/gtk/merge_requests/1358