When adjusting allocations, treat BASELINE more like CENTER
than like FILL. The results are better, in particular for
controls like entries or switches, which we never want to
scale up vertically, but still want to align to the baseline.
A grid layout lets us get the baseline right in
vertical orientation, by setting a baseline row.
It would be nice if the box layout supported this
as well, but currently it doesn't, and adding that
feature isn't trivial.
Pass the GLsync object from texture into our
command queue, and when executing the queue,
wait on the sync object the first time we
use its associated texture.
Add a new function to TextureBuilder that takes a GLsync that
requires internal code to wait on before using the texture.
Somewhat sneakily, we don't take the sync if syncs are not supported by
the current GL context.
As public API has no code to query the sync for the destroy notify, this
is fine and it means we don't have to do the check every time we want to
call gdk_texture_get_sync() internally.
Building GL textures is complicated, so create an object to make them.
So far, this object just contains the functionality of
gdk_gl_texture_new(), but that will change in the future.
In particular, we want to get the GL version, when the Windows box/VM
has an unsuitable GL implementation.
This is somewhat helpful in analyzing failures to bring up GL on
machines where users claim GL does work.
This way, we can realize it and either print success information about
it or return NULL if that fails.
This makes it more likely that we fail early, which means we can then
initialize EGL.
This refactor achieves the following:
* check GL version against proper matching context version
In particular, for legacy contexts, we now actually check
* make sure the actual version is set, even for legacy contexts
* make sure set_is_legacy() is set properly
Now that all contexts do that, insist that they keep doing it.
And because they keep doing it, we can support querying the GL version
from gdk_gl_context_get_version() without requiring the context to be
made current.
The EGL spec states:
The context returned must be the specified version, or a later
version which is backwards compatible with that version.
Even if a later version is returned, the specified version
must correspond to a defined version of the client API.
GTK has so far been relying on EGL implementations returning a
later version, because that is what Mesa does.
But ANGLE does not do that and only provides the minimum version, which
means Windows EGL has been forced to use a lower EGL version for no
reason.
So fix this and try versions in order from highest to lowest.