renderer: drop GDL support

This commit is contained in:
Ray Strode 2016-01-12 16:30:03 -05:00 committed by Rui Matos
parent 9246c9a505
commit 7e8e1dfc8f
11 changed files with 0 additions and 508 deletions

View File

@ -482,11 +482,6 @@ cogl_sources_c += \
winsys/cogl-winsys-egl-x11.c \ winsys/cogl-winsys-egl-x11.c \
winsys/cogl-winsys-egl-x11-private.h winsys/cogl-winsys-egl-x11-private.h
endif endif
if SUPPORT_EGL_PLATFORM_GDL
cogl_sources_c += \
winsys/cogl-winsys-egl-gdl.c \
winsys/cogl-winsys-egl-gdl-private.h
endif
if SUPPORT_EGL_PLATFORM_ANDROID if SUPPORT_EGL_PLATFORM_ANDROID
cogl_sources_c += \ cogl_sources_c += \
winsys/cogl-winsys-egl-android.c \ winsys/cogl-winsys-egl-android.c \

View File

@ -48,10 +48,6 @@ struct _CoglDisplay
struct wl_display *wayland_compositor_display; struct wl_display *wayland_compositor_display;
#endif #endif
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
gdl_plane_id_t gdl_plane;
#endif
void *winsys; void *winsys;
}; };

View File

@ -104,10 +104,6 @@ cogl_display_new (CoglRenderer *renderer,
display->setup = FALSE; display->setup = FALSE;
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
display->gdl_plane = GDL_PLANE_ID_UPP_C;
#endif
display = _cogl_display_object_new (display); display = _cogl_display_object_new (display);
cogl_display_set_onscreen_template (display, onscreen_template); cogl_display_set_onscreen_template (display, onscreen_template);
@ -159,17 +155,6 @@ cogl_display_setup (CoglDisplay *display,
return TRUE; return TRUE;
} }
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
void
cogl_gdl_display_set_plane (CoglDisplay *display,
gdl_plane_id_t plane)
{
_COGL_RETURN_IF_FAIL (display->setup == FALSE);
display->gdl_plane = plane;
}
#endif
#ifdef COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT #ifdef COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT
void void
cogl_wayland_display_set_compositor_display (CoglDisplay *display, cogl_wayland_display_set_compositor_display (CoglDisplay *display,

View File

@ -46,10 +46,6 @@
COGL_BEGIN_DECLS COGL_BEGIN_DECLS
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
#include <libgdl.h>
#endif
/** /**
* SECTION:cogl-display * SECTION:cogl-display
* @short_description: Common aspects of a display pipeline * @short_description: Common aspects of a display pipeline
@ -198,22 +194,6 @@ CoglBool
cogl_display_setup (CoglDisplay *display, cogl_display_setup (CoglDisplay *display,
CoglError **error); CoglError **error);
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
/**
* cogl_gdl_display_set_plane:
* @display: a #CoglDisplay
* @plane: the GDL plane id
*
* Request that Cogl output to a specific GDL overlay @plane.
*
* Since: 1.10
* Stability: unstable
*/
void
cogl_gdl_display_set_plane (CoglDisplay *display,
gdl_plane_id_t plane);
#endif
/** /**
* cogl_is_display: * cogl_is_display:
* @object: A #CoglObject pointer * @object: A #CoglObject pointer

View File

@ -60,9 +60,6 @@
#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT #ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
#include "cogl-winsys-egl-kms-private.h" #include "cogl-winsys-egl-kms-private.h"
#endif #endif
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
#include "cogl-winsys-egl-gdl-private.h"
#endif
#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT #ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
#include "cogl-winsys-egl-android-private.h" #include "cogl-winsys-egl-android-private.h"
#endif #endif
@ -207,9 +204,6 @@ static CoglWinsysVtableGetter _cogl_winsys_vtable_getters[] =
#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT #ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
_cogl_winsys_egl_kms_get_vtable, _cogl_winsys_egl_kms_get_vtable,
#endif #endif
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
_cogl_winsys_egl_gdl_get_vtable,
#endif
#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT #ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
_cogl_winsys_egl_android_get_vtable, _cogl_winsys_egl_android_get_vtable,
#endif #endif

View File

@ -163,7 +163,6 @@ cogl_renderer_new (void);
* @COGL_WINSYS_ID_STUB: Use the no-op stub backend * @COGL_WINSYS_ID_STUB: Use the no-op stub backend
* @COGL_WINSYS_ID_GLX: Use the GLX window system binding API * @COGL_WINSYS_ID_GLX: Use the GLX window system binding API
* @COGL_WINSYS_ID_EGL_XLIB: Use EGL with the X window system via XLib * @COGL_WINSYS_ID_EGL_XLIB: Use EGL with the X window system via XLib
* @COGL_WINSYS_ID_EGL_GDL: Use EGL with the GDL platform
* @COGL_WINSYS_ID_EGL_WAYLAND: Use EGL with the Wayland window system * @COGL_WINSYS_ID_EGL_WAYLAND: Use EGL with the Wayland window system
* @COGL_WINSYS_ID_EGL_KMS: Use EGL with the KMS platform * @COGL_WINSYS_ID_EGL_KMS: Use EGL with the KMS platform
* @COGL_WINSYS_ID_EGL_ANDROID: Use EGL with the Android platform * @COGL_WINSYS_ID_EGL_ANDROID: Use EGL with the Android platform
@ -182,7 +181,6 @@ typedef enum
COGL_WINSYS_ID_STUB, COGL_WINSYS_ID_STUB,
COGL_WINSYS_ID_GLX, COGL_WINSYS_ID_GLX,
COGL_WINSYS_ID_EGL_XLIB, COGL_WINSYS_ID_EGL_XLIB,
COGL_WINSYS_ID_EGL_GDL,
COGL_WINSYS_ID_EGL_WAYLAND, COGL_WINSYS_ID_EGL_WAYLAND,
COGL_WINSYS_ID_EGL_KMS, COGL_WINSYS_ID_EGL_KMS,
COGL_WINSYS_ID_EGL_ANDROID, COGL_WINSYS_ID_EGL_ANDROID,

View File

@ -322,10 +322,6 @@ cogl_frame_info_get_output
cogl_frame_info_get_presentation_time cogl_frame_info_get_presentation_time
cogl_frame_info_get_refresh_rate cogl_frame_info_get_refresh_rate
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
cogl_gdl_display_set_plane
#endif
cogl_frustum cogl_frustum
cogl_get_backface_culling_enabled cogl_get_backface_culling_enabled

View File

@ -1,39 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2011 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*
*/
#ifndef __COGL_WINSYS_EGL_GDL_PRIVATE_H
#define __COGL_WINSYS_EGL_GDL_PRIVATE_H
#include "cogl-winsys-private.h"
const CoglWinsysVtable *
_cogl_winsys_egl_gdl_get_vtable (void);
#endif /* __COGL_WINSYS_EGL_GDL_PRIVATE_H */

View File

@ -1,380 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2011 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*
* Authors:
* Robert Bragg <robert@linux.intel.com>
* Neil Roberts <neil@linux.intel.com>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "cogl-winsys-egl-gdl-private.h"
#include "cogl-winsys-egl-private.h"
#include "cogl-renderer-private.h"
#include "cogl-framebuffer-private.h"
#include "cogl-onscreen-private.h"
#include "cogl-onscreen-template-private.h"
#include "cogl-swap-chain-private.h"
static const CoglWinsysEGLVtable _cogl_winsys_egl_vtable;
typedef struct _CoglRendererGDL
{
CoglBool gdl_initialized;
} CoglRendererGDL;
typedef struct _CoglDisplayGDL
{
int egl_surface_width;
int egl_surface_height;
CoglBool have_onscreen;
} CoglDisplayGDL;
static void
_cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
{
CoglRendererEGL *egl_renderer = renderer->winsys;
CoglRendererGDL *gdl_renderer = egl_renderer->platform;
if (gdl_renderer->gdl_initialized)
gdl_close ();
eglTerminate (egl_renderer->edpy);
g_slice_free (CoglRendererEGL, egl_renderer);
}
static CoglBool
_cogl_winsys_renderer_connect (CoglRenderer *renderer,
CoglError **error)
{
CoglRendererEGL *egl_renderer;
CoglRendererGDL *gdl_renderer;
gdl_ret_t rc = GDL_SUCCESS;
gdl_display_info_t gdl_display_info;
renderer->winsys = g_slice_new0 (CoglRendererEGL);
egl_renderer = renderer->winsys;
gdl_renderer = g_slice_new0 (CoglRendererGDL);
egl_renderer->platform = gdl_renderer;
egl_renderer->platform_vtable = &_cogl_winsys_egl_vtable;
egl_renderer->edpy = eglGetDisplay (EGL_DEFAULT_DISPLAY);
if (!_cogl_winsys_egl_renderer_connect_common (renderer, error))
goto error;
/* Check we can talk to the GDL library */
rc = gdl_init (NULL);
if (rc != GDL_SUCCESS)
{
_cogl_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT,
"GDL initialize failed. %s",
gdl_get_error_string (rc));
goto error;
}
rc = gdl_get_display_info (GDL_DISPLAY_ID_0, &gdl_display_info);
if (rc != GDL_SUCCESS)
{
_cogl_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT,
"GDL failed to get display information: %s",
gdl_get_error_string (rc));
gdl_close ();
goto error;
}
gdl_close ();
return TRUE;
error:
_cogl_winsys_renderer_disconnect (renderer);
return FALSE;
}
static CoglBool
_cogl_winsys_egl_context_created (CoglDisplay *display,
CoglError **error)
{
CoglRenderer *renderer = display->renderer;
CoglRendererEGL *egl_renderer = renderer->winsys;
CoglDisplayEGL *egl_display = display->winsys;
CoglDisplayGDL *gdl_display = egl_display->platform;
const char *error_message;
egl_display->egl_surface =
eglCreateWindowSurface (egl_renderer->edpy,
egl_display->egl_config,
(EGLNativeWindowType) display->gdl_plane,
NULL);
if (egl_display->egl_surface == EGL_NO_SURFACE)
{
error_message = "Unable to create EGL window surface";
goto fail;
}
if (!_cogl_winsys_egl_make_current (display,
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,
&gdl_display->egl_surface_width);
eglQuerySurface (egl_renderer->edpy,
egl_display->egl_surface,
EGL_HEIGHT,
&gdl_display->egl_surface_height);
return TRUE;
fail:
_cogl_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT,
"%s", error_message);
return FALSE;
}
static CoglBool
gdl_plane_init (CoglDisplay *display, CoglError **error)
{
CoglBool 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;
if (!display->gdl_plane)
{
_cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"No GDL plane specified with "
"cogl_gdl_display_set_plane");
return FALSE;
}
rc = gdl_init (NULL);
if (rc != GDL_SUCCESS)
{
_cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"GDL initialize failed. %s", gdl_get_error_string (rc));
return FALSE;
}
rc = gdl_get_display_info (GDL_DISPLAY_ID_0, &display_info);
if (rc != GDL_SUCCESS)
{
_cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"GDL failed to get display infomation: %s",
gdl_get_error_string (rc));
gdl_close ();
return FALSE;
}
dstRect.origin.x = 0;
dstRect.origin.y = 0;
dstRect.width = display_info.tvmode.width;
dstRect.height = display_info.tvmode.height;
/* Configure the plane attribute. */
rc = gdl_plane_reset (display->gdl_plane);
if (rc == GDL_SUCCESS)
rc = gdl_plane_config_begin (display->gdl_plane);
if (rc == GDL_SUCCESS)
rc = gdl_plane_set_attr (GDL_PLANE_SRC_COLOR_SPACE, &colorSpace);
if (rc == GDL_SUCCESS)
rc = gdl_plane_set_attr (GDL_PLANE_PIXEL_FORMAT, &pixfmt);
if (rc == GDL_SUCCESS)
rc = gdl_plane_set_attr (GDL_PLANE_DST_RECT, &dstRect);
/* Default to triple buffering if the swap_chain doesn't have an explicit
* length */
if (rc == GDL_SUCCESS)
{
if (display->onscreen_template->config.swap_chain &&
display->onscreen_template->config.swap_chain->length != -1)
rc = gdl_plane_set_uint (GDL_PLANE_NUM_GFX_SURFACES,
display->onscreen_template->
config.swap_chain->length);
else
rc = gdl_plane_set_uint (GDL_PLANE_NUM_GFX_SURFACES, 3);
}
if (rc == GDL_SUCCESS)
rc = gdl_plane_config_end (GDL_FALSE);
else
gdl_plane_config_end (GDL_TRUE);
if (rc != GDL_SUCCESS)
{
_cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"GDL configuration failed: %s.", gdl_get_error_string (rc));
ret = FALSE;
}
gdl_close ();
return ret;
}
static CoglBool
_cogl_winsys_egl_display_setup (CoglDisplay *display,
CoglError **error)
{
CoglDisplayEGL *egl_display = display->winsys;
CoglDisplayGDL *gdl_display;
gdl_display = g_slice_new0 (CoglDisplayGDL);
egl_display->platform = gdl_display;
if (!gdl_plane_init (display, error))
return FALSE;
return TRUE;
}
static void
_cogl_winsys_egl_display_destroy (CoglDisplay *display)
{
CoglDisplayEGL *egl_display = display->winsys;
g_slice_free (CoglDisplayGDL, egl_display->platform);
}
static void
_cogl_winsys_egl_cleanup_context (CoglDisplay *display)
{
CoglRenderer *renderer = display->renderer;
CoglRendererEGL *egl_renderer = renderer->winsys;
CoglDisplayEGL *egl_display = display->winsys;
if (egl_display->egl_surface != EGL_NO_SURFACE)
{
eglDestroySurface (egl_renderer->edpy, egl_display->egl_surface);
egl_display->egl_surface = EGL_NO_SURFACE;
}
}
static CoglBool
_cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
EGLConfig egl_config,
CoglError **error)
{
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
CoglContext *context = framebuffer->context;
CoglDisplay *display = context->display;
CoglDisplayEGL *egl_display = display->winsys;
CoglDisplayGDL *gdl_display = egl_display->platform;
CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
if (gdl_display->have_onscreen)
{
_cogl_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_ONSCREEN,
"EGL platform only supports a single onscreen window");
return FALSE;
}
egl_onscreen->egl_surface = egl_display->egl_surface;
_cogl_framebuffer_winsys_update_size (framebuffer,
gdl_display->egl_surface_width,
gdl_display->egl_surface_height);
gdl_display->have_onscreen = TRUE;
return TRUE;
}
static int
_cogl_winsys_egl_add_config_attributes (CoglDisplay *display,
CoglFramebufferConfig *config,
EGLint *attributes)
{
int i = 0;
/* XXX: Why does the GDL platform choose these by default? */
attributes[i++] = EGL_BIND_TO_TEXTURE_RGBA;
attributes[i++] = EGL_TRUE;
attributes[i++] = EGL_BIND_TO_TEXTURE_RGB;
attributes[i++] = EGL_TRUE;
return i;
}
static const CoglWinsysEGLVtable
_cogl_winsys_egl_vtable =
{
.display_setup = _cogl_winsys_egl_display_setup,
.display_destroy = _cogl_winsys_egl_display_destroy,
.context_created = _cogl_winsys_egl_context_created,
.cleanup_context = _cogl_winsys_egl_cleanup_context,
.onscreen_init = _cogl_winsys_egl_onscreen_init,
.add_config_attributes = _cogl_winsys_egl_add_config_attributes
};
const CoglWinsysVtable *
_cogl_winsys_egl_gdl_get_vtable (void)
{
static CoglBool vtable_inited = FALSE;
static CoglWinsysVtable vtable;
if (!vtable_inited)
{
/* The EGL_GDL winsys is a subclass of the EGL winsys so we
start by copying its vtable */
vtable = *_cogl_winsys_egl_get_vtable ();
vtable.id = COGL_WINSYS_ID_EGL_GDL;
vtable.name = "EGL_GDL";
vtable.renderer_connect = _cogl_winsys_renderer_connect;
vtable.renderer_disconnect = _cogl_winsys_renderer_disconnect;
vtable_inited = TRUE;
}
return &vtable;
}

View File

@ -1008,37 +1008,6 @@ AS_IF([test "x$SUPPORT_SDL2" = "xyes" -a "x$SUPPORT_SDL" = "xyes"],
EGL_PLATFORM_COUNT=0 EGL_PLATFORM_COUNT=0
AC_ARG_ENABLE(
[gdl-egl-platform],
[AC_HELP_STRING([--enable-gdl-egl-platform=@<:@no/yes@:>@], [Enable support for the GDL egl platform @<:@default=no@:>@])],
[],
enable_gdl_egl_platform=no
)
AS_IF([test "x$enable_gdl_egl_platform" = "xyes"],
[
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
NEED_EGL=yes
EGL_PLATFORMS="$EGL_PLATFORMS gdl"
AC_CHECK_HEADERS(
[libgdl.h],
[],
[
AC_CHECK_HEADERS(
[CE4100/libgdl.h],
[
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I/usr/include/CE4100"
],
[AC_MSG_ERROR([libgdl.h not found])])
])
COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lgdl"
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_GDL_SUPPORT"
])
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_GDL,
[test "x$enable_gdl_egl_platform" = "xyes"])
AC_ARG_ENABLE( AC_ARG_ENABLE(
[wayland-egl-platform], [wayland-egl-platform],
[AC_HELP_STRING([--enable-wayland-egl-platform=@<:@no/yes@:>@], [Enable support for the Wayland egl platform @<:@default=no@:>@])], [AC_HELP_STRING([--enable-wayland-egl-platform=@<:@no/yes@:>@], [Enable support for the Wayland egl platform @<:@default=no@:>@])],

View File

@ -137,8 +137,6 @@ get_winsys_name_for_id (CoglWinsysID winsys_id)
return "GLX"; return "GLX";
case COGL_WINSYS_ID_EGL_XLIB: case COGL_WINSYS_ID_EGL_XLIB:
return "EGL + Xlib platform"; return "EGL + Xlib platform";
case COGL_WINSYS_ID_EGL_GDL:
return "EGL + GDL platform";
case COGL_WINSYS_ID_EGL_WAYLAND: case COGL_WINSYS_ID_EGL_WAYLAND:
return "EGL + Wayland platform"; return "EGL + Wayland platform";
case COGL_WINSYS_ID_EGL_KMS: case COGL_WINSYS_ID_EGL_KMS: