cogl-winsys-egl-wayland: Report an error if we can't find the globals we need

Instead of spinning forever, do a roundtrip, which guarantees that the
global messages have been sent by the time we read the sync message.

If the proper globals aren't initialized yet, error out immediately. This
does mean that users can't use CoglOnscreen with foreign custom surface
types without xdg_shell, but when a use case comes for this, we'll
investigate then...

Reviewed-by: Neil Roberts <neil@linux.intel.com>
cogl-winsys-egl-kms: Add cogl_kms_renderer_set_kms_fd

Reviewed-by: Neil Roberts <neil@linux.intel.com>
cogl-winsys-egl-kms: Make sure to close our connection to DRM at shutdown

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Set COGL_WINSYS_FEATURE_BUFFER_AGE on EGL

This winsys feature flag is exposed via the deprecated
cogl_clutter_winsys_has_feature function and Clutter is curently
relying on it. Previously the EGL winsys was only setting the internal
COGL_EGL_WINSYS_FEATURE_BUFFER_AGE flag and there was no mapping to
the public flag. Therefore the feature would only be used on GLX. This
patch just adds the mapping.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
cogl-gst: allocate textures synchronously

This makes sure video textures being uploaded via
video_texture_new_from_data are allocated before the function returns.
This function create a CoglBitmap to wrap the data from gstreamer and by
allowing cogl to allocate the texture lazily it's possible that the data
being pointed to by the bitmap won't remain valid until we actually come
to allocate the texture.

Note: we don't simply use cogl_texture_2d_[sliced_]new_from_data() here
because we need to be able to call cogl_texture_set_premultiplied()
before allocating the texture.
Fix _COGL_RETURN_VAL_IF_FAIL return type warning

This fixes a warning by making the _COGL_RETURN_VAL_IF_FAIL check in
_cogl_offscreen_gl_allocate return FALSE not NULL, since the api returns
a CoglBool not a pointer.
stb_image: upgrade to version 1.33

This upgrades stb_image to 1.33 which notably fixes some problems with
inconsistently using #if and #ifdef to check the STBI_SIMD define.
gmacros: Use _Static_assert for G_STATIC_ASSERT

This now simply defines G_STATIC_ASSERT in terms of _Static_assert if __GNUC__ is
defined, and disables the assertion if not. This stops lots of verbose
compiler warnings caused by the previous typedef based approach.
standalone: Fix building standalone

This fixes a few build issues with compiling Cogl against our internal
deps/glib and deps/gmodule libraries.
Add deps/eglib library from the mono project

This adds a deps/eglib api which is a small MIT licensed library that is
api compatible with enough of the glib api to run Cogl. This replaces
deps/glib and deps/gmodule for use when Cogl is built with
--enable-standalone.

This code is based on eglib from the mono project, with a few updates
and additions to handle apis that Cogl uses that mono doesn't.

As a reference point for monitoring eglib changes in the mono project,
this code is based on commit d50c836721f22df74a45185d51d0b9d37c370e33
eglib: remove some redundant files

The eglib as found in the mono git repository can be built separately
from the rest of mono, but to avoid maintaining parallel build scripts
for eglib this strips away the autotool related files from deps/eglib.
eglib: remove unused gpattern and gmarkup apis

This simply removes a couple of eglib apis that aren't needed by Cogl
and the corresponding tests.
eglib: simplify compiler checks

This removes a number of ./configure time compiler checks in favour of
compile time checks and also assumes you are building with a modern
compiler. For example we assume <stdint.h> and <inttypes.h> headers are
available.

These changes will make it easier to maintain the ability to build Cogl
on Android via an Android.mk file where it's not usual to use the build
system to check compiler features.
Tightly integrate ulib (was eglib)

Instead of maintaining optional support for using deps/eglib instead of
glib we now always use this code. This way the code is always being
tested so we are less likely to break support for building Cogl without
glib, and because the api no longer needs to be swappable we are free to
make Cogl specific changes to the api.

So that we can still support glib integration the eglib library has been
renamed to ulib and symbols are prefixed with 'u_' or 'U_' so that they
don't clash with glib.

GLib integration for GError and GType continues to be supported.
build: split out list of deps into Makefile.sources

This splits out the list of build dependencies for Cogl into a
Makefile.sources file that could be shared with other build systems.
configure: check for sdl2-rig instead of sdl2 pkg-config file

Rig uses a patched version of SDL maintained at:
https://github.com/rig-project/sdl.git
sdl2: Add android support

This adds Android support to the SDL2 winsys. Unlike some other window
systems, Android's SDL2 backend only allows you to create one window.
Since the Cogl SDL2 winsys creates a "dummy" window when setting up the
display (so we have something to bind a GL context to) it wasn't then
possible to create a CoglOnscreen framebuffer for rendering. This
updates the winsys so that the first CoglOnscreen framebuffer created
will actually refer to the dummy window we created earlier.

Note: it doesn't matter that we request the dummy window to have a 1x1
size, and request for it to be hidden because these are overridden by
SDL's Android backend.
examples: Add a new SDL2 based Android example

This adds another examples/android project that uses SDL instead of
glib. The example itself is a copy of examples/cogl-sdl2-hello.c
which includes basic input handling to move a triangle around the
screen.
Adds CoglAtlasSet and CoglAtlas apis

This enables applications to more closely manage their own texture atlases
via a CoglAtlasSet api. A CoglAtlasSet represents a set of CoglAtlases
and a CoglAtlas represents one large texture that is subdivided into
smaller "allocations".

The intention is to enable functionality like cogl-pango to be
implemented outside of Cogl; specifically to allow Rig to handle its own
glyph caches for text rendering.
check if we need to explicitly link with a libiconv library