Use COGL_FLAGS_* for the context's private feature flags

Previously the private feature flags were stored in an enum and we
already had 31 flags. Adding the 32nd flag would presumably make it
add -2³¹ as one of the values which might cause problems. To avoid
this we'll just use an fixed-size array of longs and use indices for
the enum values like we do for the public features.

A slight complication with this is in the CoglDriverDescription where
we were previously using a static intialised value to describe the set
of features that the driver supports. We can't easily do this with the
flags array so instead the features are stored in a fixed-size array
of indices.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
wayland: Add a convenience function to update a region from SHM buffer

Adds cogl_wayland_texture_set_region_from_shm_buffer which is a
convenience wrapper around cogl_texture_set_region but it uses the
correct format to copy the data from a Wayland SHM buffer. This will
typically be used by compositors to update the texture for a surface
when an SHM buffer is attached. The ordering of the arguments is based
on cogl_texture_set_region_from_bitmap.

Based on a patch by Jasper St. Pierre.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
build: fix building introspection data

This fixes the build with --enable-introspection. I'm not sure why
g-ir-scanner seems to parse all public headers in isolation instead of
being able take a more limited list of top-level public headers and
automatically parse all necessary #include directives but this means we
have to special case how we define and undefine __COGL_H_INSIDE__ to
subvert the guards we have in place for detecting misuse of the headers.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
configure: improve the error message if gbm missing

This improves the error message in the case where libgbm is missing when
the KMS egl platform has been enabled.

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

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Make cogl-sdl.h a top-level header

This makes it so that cogl-sdl.h is a top-level header no longer
automatically included by cogl.h. This avoids lots of warnings building
the conformance tests and examples due to SDL.h warning when
__STRICT_ANSI__ isn't defined.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Update .gitignore
Remove the framebuffer's stack of clip stacks

There used to be a function called cogl_clip_stack_save in the public
API which was used when temporarily switching to an offscreen buffer
to save the clip state. This is no longer necessary because each
framebuffer has its own clip stack anyway so the function was removed
in master. However the code to maintain the stack of stacks was
retained. This patch removes it in an effort to simplify the code.

On the 1.18 branch this function is deprecated and the documentation
says that it does nothing. However that is incorrect because it does
actually the push clip stack. I think it would be safe to backport
this patch to the 1.18 branch and actually make it do nothing like it
is documented to do.

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

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Add a test for cogl_framebuffer_push_path_clip

The test makes an L-shaped path that fills the whole framebuffer
except for the top right quadrant. It then clips to that and tries to
fill the framebuffer with a rectangle. Then it verifies that all of
the quadrants have the expected colour.

This is currently failing due to a bug in the primitive clipping.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Fix calculating the bounds when clipping from a primitive

When projecting the bounding rectangle of a primitive it was using the
modelview matrix twice instead of the modelview and projection
matrices so it was coming out with garbage.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
cogl-framebuffer: Don't mark the clear clip dirty from the journal

This means that we can't cache the journal read_pixels optimization.

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

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