Treat external as the normal case, and only try importing dmabufs
as non-external images if their format is on the internal formats
list.
Also add internal linear formats to the internal formats list.
This fixes an issue where AR24:0 dmabufs were imported as external
textures, causing some of the compare tests to fail.
Make this function return whether it was successful, and only emit
a debug message if we succeeded. In particular, make it return FALSE
if the dmabuf format is not linear.
The current context might be the last reference to the context, which
would make it go away when the renderer calls make_current().
See commit 0fa2ae48d4 for a similar case.
When we use download in the middle of an upload operation (or the
other way around), we may end up making a different GL context
current. The downloader code is reponsible for reestablishing
the previous context when it is done. The old GL renderer was
doing that, NGL wasn't, until now.
For dmabufs, the format is not an exact description of the data, it only
gives the closest memory format for a given fourcc.
This of course means that multiple different fourccs may report the same
format.
So when deciding if we need to copy the image to get the right data to
download, we need to check if the fourcc is correct, not if the format
is.
Related: #7046
When we want to download a dmabuf, we want to download the actual
dmabuf.
If we just grab the cached image and use that, we might get the
(reuploaded) copy of the dmabuf. This happens when this renderer
doesn't support downloading this dmabuf but has used it before.
Worse, this is a reentrancy issue, where this renderer is trying to
render the dmabuf and has already scheduled the upload but the upload
has not finished. We will then download from an empty image, which is
very wrong.
The way to check that we have the actual dmabuf is a bit brittle, but it
should work.
Fixes#7046
I've seen valgrind complain about external_only being uninitialized
after the call, when using llvmpipe. Better be safe than sorry, and
initialize these arrays.
Compositors don't guarantee that there's any physical devices
around to correspond to the input capabilities.
This was found running the tests against mutter headless.
Previously it was unclear why passing an input stream would crash a video,
unless you went into the source and read it.
This adds a clarifying message that only file based media files are supported.
The clip might be different from the scissor due to incompatible
intersections.
But the resulting intersection might be fully clipped, so we should
consider it.
Testsuite with longer explanation attached.
Fixes#7044
Doing otherwise risks that the focus is moved back to the entry,
causing everything to be selected, and then replaced by the Emoji
we insert. Which is not the desired effect!
When picking a cursor image size for a given size, look for sizes
that do better when scaled by the viewporter:
- exact size
- twice the size
- closest larger size
- closest size
This was a thinko in 403da9a2d5. We have the cursor
image in device pixels, but we still need to apply the viewporter
to inform the compositor about the desired pointer size in
application pixels.