gl-renderer: Move shader functions into it's own file.

This moves all shader functions into it's own file in preparation of a more
flexible shader generation. It adds gl-internal.h for shared definitions
between the files.
gl-renderer: Add flexible shader generation.

This add a more flexible way of generating shaders. It generates all valid
combinations of different input, conversion and output pipelines, which
can easily be extended with more if desired.
gl-renderer: Add optional support for desktop OpenGL.

This adds support for desktop OpenGL which can be enabled by with
./configure --enable-opengl.

Most of the differences in API between OpenGL and OpenGL ES is hidden by
the new gl_renderer fields.

It also accesses GLES2 extensions by including GLES2/gl2platform.h directly.
gl-renderer: Adds the ability to draw damage to a texture and in turn to the framebuffer.
gl-renderer: Add support for blending in linear space.

This makes compositing gamma correct by assuming all input surfaces are in
the sRGB color space. It can be enabled by setting color-managed to true
in the compositor section of weston.ini.

It's implemented by converting from sRGB gamma using the new CONVERSION_FROM_SRGB
shader attribute and drawing the surfaces into a temporary buffer (the
indirect rendering introduced in the previous patch). That buffer is then
drawed to the framebuffer using the OUTPUT_TO_SRGB shader attribute which
converts back into sRGB gamma.

Both the temporary buffer and sRGB decode LUT needs atleast 12-bits per
channel for flawless results with 8-bit input/output. This is not provided
by OpenGL ES 2 by default so desktop OpenGL is required for usable results.

It also adds a check to ensure we have enough texture units for the planes
and the LUT.
gl-renderer: Don't multiply with alpha uniform when it's 1.0.

This eliminates the multiplication of the alpha uniform for the common case
of surfaces with 1.0 as alpha.
gl-renderer: Remove unneeded glActiveTexture call.
gl-renderer: Clean up EGL image and GL texture destruction.

This also ensures we destroy all EGL images if a plane fails to be created.
It also free the EGL images when we switch from a EGL to wl_shm buffer.
gl-renderer: Use hardware sRGB gamma decoding when possible.