mutter/cogl/winsys
Neil Roberts 52a646abc5 Use the EGL_KHR_surfacless_context extension
The surfaceless context extension can be used to bind a context
without a surface. We can use this to avoid creating a dummy surface
when the CoglContext is first created. Otherwise we have to have the
dummy surface so that we can bind it before the first onscreen is
created.

The main awkward part of this patch is that theoretically according to
the GL and GLES spec if you first bind a context without a surface
then the default state for glDrawBuffers is GL_NONE instead of
GL_BACK. In practice Mesa doesn't seem to do this but we need to be
robust against a GL implementation that does. Therefore we track when
the CoglContext is first used with a CoglOnscreen and force the
glDrawBuffers state to be GL_BACK.

There is a further awkward part in that GLES2 doesn't actually have a
glDrawBuffers state but GLES3 does. GLES3 also defaults to GL_NONE in
this case so if GLES3 is available then we have to be sure to set the
state to GL_BACK. As far as I can tell that actually makes GLES3
incompatible with GLES2 because in theory if the application is not
aware of GLES3 then it should be able to assume the draw buffer is
always GL_BACK.

Reviewed-by: Robert Bragg <robert.bragg@intel.com>
(cherry picked from commit e5f28f1e75db9bdc4f2688f420a74f908f96cf76)

Conflicts:
	cogl/winsys/cogl-winsys-egl-kms.c
	cogl/winsys/cogl-winsys-egl-x11.c
2014-06-17 13:31:03 +01:00
..
cogl-texture-pixmap-x11-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-texture-pixmap-x11.c Registers gtypes for all public objects and structs 2014-03-20 18:27:12 +00:00
cogl-texture-pixmap-x11.h Registers gtypes for all public objects and structs 2014-03-20 18:27:12 +00:00
cogl-winsys-egl-android-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-egl-android.c egl: remove NativeWindowType/NativeDisplayType defines 2014-03-20 17:34:04 +00:00
cogl-winsys-egl-feature-functions.h Use the EGL_KHR_surfacless_context extension 2014-06-17 13:31:03 +01:00
cogl-winsys-egl-gdl-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-egl-gdl.c egl: remove NativeWindowType/NativeDisplayType defines 2014-03-20 17:34:04 +00:00
cogl-winsys-egl-kms-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-egl-kms.c Use the EGL_KHR_surfacless_context extension 2014-06-17 13:31:03 +01:00
cogl-winsys-egl-null-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-egl-null.c egl: remove NativeWindowType/NativeDisplayType defines 2014-03-20 17:34:04 +00:00
cogl-winsys-egl-private.h Use the EGL_KHR_surfacless_context extension 2014-06-17 13:31:03 +01:00
cogl-winsys-egl-wayland-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-egl-wayland.c Use the EGL_KHR_surfacless_context extension 2014-06-17 13:31:03 +01:00
cogl-winsys-egl-x11-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-egl-x11.c Use the EGL_KHR_surfacless_context extension 2014-06-17 13:31:03 +01:00
cogl-winsys-egl.c Expose EGL context/display and GLX context 2014-03-20 17:34:04 +00:00
cogl-winsys-glx-feature-functions.h glx-feature-functions: update misleading comment 2014-03-20 17:34:04 +00:00
cogl-winsys-glx-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-glx.c Expose EGL context/display and GLX context 2014-03-20 17:34:04 +00:00
cogl-winsys-private.h Expose EGL context/display and GLX context 2014-03-20 17:34:04 +00:00
cogl-winsys-sdl2.c sdl2: fix GL driver selection 2014-03-20 17:34:04 +00:00
cogl-winsys-sdl-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-sdl.c This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-stub-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-stub.c This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-wgl-feature-functions.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-wgl-private.h This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys-wgl.c This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00
cogl-winsys.c This re-licenses Cogl 1.18 under the MIT license 2014-02-22 02:02:53 +00:00