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.
Don't notify during destruction, notify afterwards.
This way we don't call into user code from a half-destructed node.
Note that this changes the order in which those notifies happen when
collapsing a large tree: From parent node before child nodes to child
nodes before parent node.
No actual use case for this, just thought it would be safer.
While we are collapsing a subtree, some signal handlers may not be
disconnected while we are doing this. By adding this check and not
giving those nodes no longer access to the model, we can stop it from
modifying it while we are trying to collapse stuff.
Fixes some crashes in gnome-builder.