summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2011-07-26 17:23:37 +0300
committerDamien Lespiau <damien.lespiau@intel.com>2011-07-29 11:50:15 +0100
commitff5a3503aff1ba5b2671ccab394e6f3b606d755a (patch)
tree853a892cb0173ad56ac93a6b6723260dc3c34232
parent388abe29071257325513bc40ebdfb66247b1ed01 (diff)
downloadcogl-ff5a3503aff1ba5b2671ccab394e6f3b606d755a.tar.gz
egl-gdl: Make the egl winsys know about the GDL platform
The egl winsys has a few code paths depending on the platform we are compiling for. The GDL platform needs those defined as well. A few tweaks were needed here and there to make it compile again. https://bugzilla.gnome.org/show_bug.cgi?id=655355
-rw-r--r--cogl/winsys/cogl-winsys-egl.c47
1 files changed, 43 insertions, 4 deletions
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index 2c84ff63..db01709b 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -845,6 +845,40 @@ try_create_context (CoglDisplay *display,
EGL_HEIGHT,
&egl_display->egl_surface_height);
}
+
+#elif defined (COGL_HAS_EGL_PLATFORM_GDL_SUPPORT)
+
+ egl_display->egl_surface =
+ eglCreateWindowSurface (edpy,
+ config,
+ (NativeWindowType) display->gdl_plane,
+ NULL);
+
+ if (egl_display->egl_surface == EGL_NO_SURFACE)
+ {
+ error_message = "Unable to create EGL window surface";
+ goto fail;
+ }
+
+ if (!eglMakeCurrent (egl_renderer->edpy,
+ egl_display->egl_surface,
+ egl_display->egl_surface,
+ egl_display->egl_context))
+ {
+ error_message = "Unable to eglMakeCurrent with egl surface";
+ goto fail;
+ }
+
+ eglQuerySurface (egl_renderer->edpy,
+ egl_display->egl_surface,
+ EGL_WIDTH,
+ &egl_display->egl_surface_width);
+
+ eglQuerySurface (egl_renderer->edpy,
+ egl_display->egl_surface,
+ EGL_HEIGHT,
+ &egl_display->egl_surface_height);
+
#elif defined (COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT)
egl_display->egl_surface =
@@ -1007,6 +1041,7 @@ gdl_plane_init (CoglDisplay *display, GError **error)
{
gboolean ret = TRUE;
gdl_color_space_t colorSpace = GDL_COLOR_SPACE_RGB;
+ gdl_pixel_format_t pixfmt = GDL_PF_ARGB_32;
gdl_rectangle_t dstRect;
gdl_display_info_t display_info;
gdl_ret_t rc = GDL_SUCCESS;
@@ -1043,9 +1078,9 @@ gdl_plane_init (CoglDisplay *display, GError **error)
dstRect.height = display_info.tvmode.height;
/* Configure the plane attribute. */
- rc = gdl_plane_reset (plane);
+ rc = gdl_plane_reset (display->gdl_plane);
if (rc == GDL_SUCCESS)
- rc = gdl_plane_config_begin (plane);
+ rc = gdl_plane_config_begin (display->gdl_plane);
if (rc == GDL_SUCCESS)
rc = gdl_plane_set_attr (GDL_PLANE_SRC_COLOR_SPACE, &colorSpace);
@@ -1073,6 +1108,8 @@ gdl_plane_init (CoglDisplay *display, GError **error)
}
gdl_close ();
+
+ return TRUE;
}
#endif
@@ -1326,7 +1363,8 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
wl_surface_map_toplevel (egl_onscreen->wayland_surface);
#elif defined (COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT) || \
- defined (COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT)
+ defined (COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT) || \
+ defined (COGL_HAS_EGL_PLATFORM_GDL_SUPPORT)
if (egl_display->have_onscreen)
{
g_set_error (error, COGL_WINSYS_ERROR,
@@ -1437,7 +1475,8 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
egl_display->egl_context);
egl_context->current_surface = egl_display->dummy_surface;
#elif defined (COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT) || \
- defined (COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT)
+ defined (COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT) || \
+ defined (COGL_HAS_EGL_PLATFORM_GDL_SUPPORT)
return;
#else
#error "Unknown EGL platform"