egl-kms: set the EGL_PLATFORM explicitly

Otherwise, if we try egl-wayland first, we get the environment
variable from that, which crashes mesa trying to open the gbm device
as a wayland display.

https://bugzilla.gnome.org/show_bug.cgi?id=705836
Separate out CoglPath api into sub-library

This splits out the cogl_path_ api into a separate cogl-path sub-library
like cogl-pango and cogl-gst. This enables developers to build Cogl with
this sub-library disabled if they don't need it which can be useful when
its important to keep the size of an application and its dependencies
down to a minimum. The functions cogl_framebuffer_{fill,stroke}_path
have been renamed to cogl_path_{fill,stroke}.

There were a few places in core cogl and cogl-gst that referenced the
CoglPath api and these have been decoupled by using the CoglPrimitive
api instead. In the case of cogl_framebuffer_push_path_clip() the core
clip stack no longer accepts path clips directly but it's now possible
to get a CoglPrimitive for the fill of a path and so the implementation
of cogl_framebuffer_push_path_clip() now lives in cogl-path and works as
a shim that first gets a CoglPrimitive and uses
cogl_framebuffer_push_primitive_clip instead.

We may want to consider renaming cogl_framebuffer_push_path_clip to
put it in the cogl_path_ namespace.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 8aadfd829239534fb4ec8255cdea813d698c5a3f)

So as to avoid breaking the 1.x API or even the ABI since we are quite
late in the 1.16 development cycle the patch was modified to build
cogl-path as a noinst_LTLIBRARY before building cogl and link the code
directly into libcogl.so as it was previously. This way we can wait
until the start of the 1.18 cycle before splitting the code into a
separate libcogl-path.so.

This also adds shims for cogl_framebuffer_fill/stroke_path() to avoid
breaking the 1.x API/ABI.
cogl-path: Fix the uninitialised path->fill_primitive

This was not being uninitialised so it was sometimes causing a crash
when it tried to unref an invalid pointer. This was causing test-path
to fail for me.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit ee834bf10a05cf000d4bc4dd2438ca6cedd8a2b5)
offscreen: Allocate the framebuffer in cogl_offscreen_new_to_texture_full

The API says that it should return NULL on failure but it does not do that
due to the lazy allocation.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=703174
offscreen: rename _new_to_texture to _new_with_texture

This renames cogl_offscreen_new_to_texture to
cogl_offscreen_new_with_texture. The intention is to then cherry-pick
this back to the cogl-1.16 branch so we can maintain a parallel
cogl_offscreen_new_to_texture() function which keeps the synchronous
allocation semantics that some clutter applications are currently
relying on.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit ecc6d2f64481626992b2fe6cdfa7b999270b28f5)

Note: Since we can't break the 1.x api on this branch this keeps a
thin shim around cogl_offscreen_new_with_texture to implement
cogl_offscreen_new_to_texture with its synchronous allocation
semantics.
gl: bind position attribute to location 0

Full GL treats the position attribute specially and requires that it
must be bound to generic attribute location 0 unlike GLES 2.0 or
GL 3.2 core. We now make sure to unconditionally bind the
cogl_position_in attribute to location 0 before linking any glsl program
in cogl.

For reference the relevant part of the GL 3.0 spec that covers these
semantics is Section 2.7 "Vertex Specification" pg 27

After this change there was one remaining problem in
test-custom-attributes where the test_short_verts() test was using its
own "pos" attribute instead of cogl_position_in and so cogl wasn't able
to ensure it would be bound to location 0.

This updates the test to use cogl_position_in but to work around the
fact that glVertexPointer doesn't support UNSIGNED_SHORT components we
force the test to use the glsl backend by setting a shader snippet on
the pipeline.

https://bugs.freedesktop.org/show_bug.cgi?id=67548

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 992ef7b3b49ebb56adde2133bb36330c04133a3f)
Fix the help string for --enable-standalone

The help string had the wrong name presumably resulting from a cut and
paste error of the --enable-debug option.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau at intel.com>

(cherry picked from commit fb6a582ae41a5511c837846e8fbac46462fce93d)
Fix the documented default value for --enable-cogl-path

As far as I can tell --enable-cogl-path is enabled by default but the
help string for it was suggesting otherwise.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 9c75fc5463acf1cb51bf00d9914678013ed9d248)
cogl-gst: emit ready signal on sink only after the first frame is uploaded

Developers listening to the 'ready' signal on CoglGstVideoSink might
call process the current frame once the signal is triggered. We need
to ensure the first frame has been uploaded before letting people know
that the sink is ready.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 53882aa0728c5540d8452045006a763e29d4306d)
MSVC builds: Update pre-defined cogl-define.h

...For both the regular WGL winsys and SDL winsys builds, that
COGL_HAS_GTYPE_SUPPORT is defined, so that the builds won't break as
Visual Studio builds do assume an existing installation of GLib.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit ef41aea2796315a47693bf278f08b41ca6703566)
cogl-texture-gl.c: Don't include strings.h unconditionally

Use the HAVE_STRINGS_H check before we include strings.h, as it is not
universally available.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit ff65144c84a16f9470d3f3931dc91cc9a6ef5938)
cogl-gpu-info.c: Avoid using named initializers

Unfortunately named initializers is a feature that is not supported by
all compilers (such as pre-2013 Visual Studio) so avoid using that.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 5a5659f9861dfe7a4808f2a5284de8fe6175bec2)
Update the cogl.symbols file

Add and rename the symbols that have been added/renamed during the
development cycle, and also remove those that have been dropped during the
process.

Also continue the quest of purging from the exports lists of the internal
APIs as some of those are no longer referenced by other Cogl components.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Fix the placement of deprecation macros

The deprecation macros, which expand to __declspec (deprecated) on Visual
Studio, is expected to be before the return type of the function which
is annotated by them, and having the deprecation macros there is also
accepted by GCC as well.

This will fix the builds of all applications/libraries using Cogl under
Visual Studio,

Reviewed-by: Robert Bragg <robert@linux.intel.com>
framebuffer: restore api to maintain ABI for release

This restores the cogl_framebufer_[v]draw_*_attributes APIs for the 1.16
branch so we can avoid changing the soname for the 1.15.6 release
Updates NEWS for the 1.15.6 release
Release 1.15.6 (snapshot)
Post-release version bump to 1.15.7
wayland: Call eglTerminate before destroying wl_display, not after

The eglTerminate code in Mesa will try to destroy the wl_drm object
which involves using data structures in the wl_display. Cogl was
disconnecting the display before calling eglTerminate which meant that
this would end up accessing potentially garbage data.

https://bugzilla.gnome.org/show_bug.cgi?id=705591

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 358d85f35d0fe36698b758163729c4551fe5fd25)
cogl: fix incorrect guard around cogl-path.h include

cogl.h was meant to include cogl-path.h so long as
COGL_ENABLE_EXPERIMENTAL_2_0_API is not defined but it was actually
requiring it to be defined which was breaking clutter applications.