summaryrefslogtreecommitdiff
path: root/cogl/winsys/cogl-winsys-egl-private.h
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2011-12-09 16:10:01 +0000
committerNeil Roberts <neil@linux.intel.com>2011-12-09 17:29:49 +0000
commitdd75926c1ab9be3de17a8cdf9d5a531c9a771a51 (patch)
treee1ac9718963c2f7258db05ae2aa48cf53ad0b37f /cogl/winsys/cogl-winsys-egl-private.h
parent93e6e2051fd34dbf65070db4a539ffacb997c338 (diff)
downloadcogl-dd75926c1ab9be3de17a8cdf9d5a531c9a771a51.tar.gz
egl: Split out the KMS winsys as overrides of the EGL winsys
Instead of having #ifdefs to hook into the normal EGL winsys, the KMS winsys now overrides any winsys functions that it wants. Where the winsys wants to hook into a point within a function provided by the EGL winsys there is a EGL-platform vtable which gets set on the EGL renderer data during renderer_connect. The KMS-specific data on all of the structures is now allocated separately by the KMS winsys and is pointed to by a new 'platform' pointer in the EGL data. Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/winsys/cogl-winsys-egl-private.h')
-rw-r--r--cogl/winsys/cogl-winsys-egl-private.h64
1 files changed, 55 insertions, 9 deletions
diff --git a/cogl/winsys/cogl-winsys-egl-private.h b/cogl/winsys/cogl-winsys-egl-private.h
index 5e3895df..cb6b13ae 100644
--- a/cogl/winsys/cogl-winsys-egl-private.h
+++ b/cogl/winsys/cogl-winsys-egl-private.h
@@ -28,9 +28,6 @@
#include "cogl-winsys-private.h"
#include "cogl-context.h"
#include "cogl-context-private.h"
-#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
-#include "cogl-winsys-kms.h"
-#endif
#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT
#include "cogl-xlib-renderer-private.h"
#include "cogl-xlib-display-private.h"
@@ -40,6 +37,23 @@
#include <wayland-egl.h>
#endif
+typedef struct _CoglWinsysEGLVtable
+{
+ gboolean
+ (* display_setup) (CoglDisplay *display,
+ GError **error);
+ void
+ (* display_destroy) (CoglDisplay *display);
+
+ gboolean
+ (* try_create_context) (CoglDisplay *display,
+ EGLint *attribs,
+ GError **error);
+
+ void
+ (* cleanup_context) (CoglDisplay *display);
+} CoglWinsysEGLVtable;
+
typedef enum _CoglEGLWinsysFeature
{
COGL_EGL_WINSYS_FEATURE_SWAP_REGION =1L<<0,
@@ -72,9 +86,11 @@ typedef struct _CoglRendererEGL
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
gboolean gdl_initialized;
#endif
-#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
- CoglRendererKMS kms_renderer;
-#endif
+
+ /* Data specific to the EGL platform */
+ void *platform;
+ /* vtable for platform specific parts */
+ const CoglWinsysEGLVtable *platform_vtable;
/* Function pointers for GLX specific extensions */
#define COGL_WINSYS_FEATURE_BEGIN(a, b, c, d)
@@ -103,9 +119,6 @@ typedef struct _CoglDisplayEGL
struct wl_surface *wayland_surface;
struct wl_egl_window *wayland_egl_native_window;
#endif
-#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
- CoglDisplayKMS kms_display;
-#endif
#if defined (COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT) || \
defined (COGL_HAS_EGL_PLATFORM_GDL_SUPPORT) || \
defined (COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT) || \
@@ -119,6 +132,9 @@ typedef struct _CoglDisplayEGL
EGLConfig egl_config;
gboolean found_egl_config;
gboolean stencil_disabled;
+
+ /* Platform specific display data */
+ void *platform;
} CoglDisplayEGL;
typedef struct _CoglContextEGL
@@ -126,6 +142,32 @@ typedef struct _CoglContextEGL
EGLSurface current_surface;
} CoglContextEGL;
+#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT
+typedef struct _CoglOnscreenXlib
+{
+ Window xwin;
+ gboolean is_foreign_xwin;
+} CoglOnscreenXlib;
+#endif
+
+typedef struct _CoglOnscreenEGL
+{
+#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT
+ CoglOnscreenXlib _parent;
+#endif
+
+#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
+ struct wl_egl_window *wayland_egl_native_window;
+ struct wl_surface *wayland_surface;
+ struct wl_shell_surface *wayland_shell_surface;
+#endif
+
+ EGLSurface egl_surface;
+
+ /* Platform specific data */
+ void *platform;
+} CoglOnscreenEGL;
+
const CoglWinsysVtable *
_cogl_winsys_egl_get_vtable (void);
@@ -141,4 +183,8 @@ _cogl_egl_destroy_image (CoglContext *ctx,
EGLImageKHR image);
#endif
+gboolean
+_cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
+ GError **error);
+
#endif /* __COGL_WINSYS_EGL_PRIVATE_H */