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>
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>
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>
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>
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>
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>
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>
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>
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>
Add a cogl-point-sprites example

This updates the old point sprites interactive test from Clutter to be
a standalone Cogl example using the 2.0 API.
cogl-path: Generate the primitive before using it for clipping

The data->fill_primitive member is meant to be generated on demand in
an accessor function. However when using it for clipping the code was
trying to directly use it without calling the accessor so it would
crash if nothing else caused the primitive to be generated. This was
making the texture-fbo test in Clutter crash.