platforms: remove ifdefs around mg::NativeBuffer to make it simply a forward-declared class for server code. Platforms can define what mg::NativeBuffer is to whatever works best. (eg, Android defines it to be an interface that makes it easy to convert to different android types and manage the buffer fences).
Android defines it to be an interface that makes it easy to convert to different android types and manage the buffer fences.
Mesa was hacking around the POD type it was using with GBMNativeBuffer to get the gbm_bo*. GBMNativeBuffer is just mg::NativeBuffer for that platform now.
Eglstream could use ShmFile as its native type (although I didn't make that change in this MP)
Nested will want a mg::NativeBuffer that gives access to its underlying MirBuffer*.
Approved by mir-ci-bot, Chris Halse Rogers, Alexandros Frantzis.
mir_acceptance_tests: Check that we don't double-close file descriptors, then fix the places we do.
This adds a close() shim to mir_acceptance_tests, which calls the real close() and then aborts if the close() call failed with EBADF, indicating that we've passed in an already closed (or simply nonsensical) file descriptor.
Then fix the double-closes this exposes.
Approved by mir-ci-bot, Cemil Azizoglu, Alan Griffiths.
BufferStream: Don't leak buffer FDs on create_egl_native_window() failure.
The buffer_depository constructors take ownership of any buffer FDs in the protobuf
object passed in, so move create_egl_native_window() call to after the buffer_depository
has been created.