gl-renderer: provide platform_base fallbacks and remove ifdefs
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
74eed31108
commit
f1ec506048
+3
-13
@@ -37,7 +37,6 @@
|
|||||||
#include "gl-renderer.h"
|
#include "gl-renderer.h"
|
||||||
#include "vertex-clipping.h"
|
#include "vertex-clipping.h"
|
||||||
|
|
||||||
#include <EGL/eglext.h>
|
|
||||||
#include "weston-egl-ext.h"
|
#include "weston-egl-ext.h"
|
||||||
|
|
||||||
struct gl_shader {
|
struct gl_shader {
|
||||||
@@ -140,9 +139,7 @@ struct gl_renderer {
|
|||||||
PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage;
|
PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EGL_EXT_platform_base
|
|
||||||
PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC create_platform_window;
|
PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC create_platform_window;
|
||||||
#endif
|
|
||||||
|
|
||||||
int has_unpack_subimage;
|
int has_unpack_subimage;
|
||||||
|
|
||||||
@@ -170,9 +167,7 @@ struct gl_renderer {
|
|||||||
struct wl_signal destroy_signal;
|
struct wl_signal destroy_signal;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef EGL_EXT_platform_base
|
|
||||||
static PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display = NULL;
|
static PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline struct gl_output_state *
|
static inline struct gl_output_state *
|
||||||
get_output_state(struct weston_output *output)
|
get_output_state(struct weston_output *output)
|
||||||
@@ -2006,19 +2001,18 @@ gl_renderer_output_create(struct weston_output *output,
|
|||||||
if (go == NULL)
|
if (go == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef EGL_EXT_platform_base
|
|
||||||
if (gr->create_platform_window) {
|
if (gr->create_platform_window) {
|
||||||
go->egl_surface =
|
go->egl_surface =
|
||||||
gr->create_platform_window(gr->egl_display,
|
gr->create_platform_window(gr->egl_display,
|
||||||
egl_config,
|
egl_config,
|
||||||
window_for_platform,
|
window_for_platform,
|
||||||
NULL);
|
NULL);
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
go->egl_surface =
|
go->egl_surface =
|
||||||
eglCreateWindowSurface(gr->egl_display,
|
eglCreateWindowSurface(gr->egl_display,
|
||||||
egl_config,
|
egl_config,
|
||||||
window_for_legacy, NULL);
|
window_for_legacy, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (go->egl_surface == EGL_NO_SURFACE) {
|
if (go->egl_surface == EGL_NO_SURFACE) {
|
||||||
weston_log("failed to create egl surface\n");
|
weston_log("failed to create egl surface\n");
|
||||||
@@ -2138,7 +2132,6 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
|
|||||||
"supported. Performance could be affected.\n");
|
"supported. Performance could be affected.\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EGL_EXT_platform_base
|
|
||||||
extensions =
|
extensions =
|
||||||
(const char *) eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|
(const char *) eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|
||||||
if (!extensions) {
|
if (!extensions) {
|
||||||
@@ -2151,7 +2144,6 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
|
|||||||
(void *) eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
|
(void *) eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
|
||||||
else
|
else
|
||||||
weston_log("warning: EGL_EXT_platform_base not supported.\n");
|
weston_log("warning: EGL_EXT_platform_base not supported.\n");
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef EGL_MESA_configless_context
|
#ifdef EGL_MESA_configless_context
|
||||||
if (strstr(extensions, "EGL_MESA_configless_context"))
|
if (strstr(extensions, "EGL_MESA_configless_context"))
|
||||||
@@ -2286,8 +2278,7 @@ gl_renderer_create(struct weston_compositor *ec, EGLenum platform,
|
|||||||
gr->base.surface_copy_content = gl_renderer_surface_copy_content;
|
gr->base.surface_copy_content = gl_renderer_surface_copy_content;
|
||||||
gr->egl_display = NULL;
|
gr->egl_display = NULL;
|
||||||
|
|
||||||
#ifdef EGL_EXT_platform_base
|
/* extension_suffix is supported */
|
||||||
/* the platform extension is supported */
|
|
||||||
if (supports) {
|
if (supports) {
|
||||||
if (!get_platform_display) {
|
if (!get_platform_display) {
|
||||||
get_platform_display = (void *) eglGetProcAddress(
|
get_platform_display = (void *) eglGetProcAddress(
|
||||||
@@ -2304,7 +2295,6 @@ gl_renderer_create(struct weston_compositor *ec, EGLenum platform,
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!gr->egl_display) {
|
if (!gr->egl_display) {
|
||||||
weston_log("warning: either no EGL_EXT_platform_base "
|
weston_log("warning: either no EGL_EXT_platform_base "
|
||||||
|
|||||||
@@ -35,12 +35,18 @@ typedef int EGLint;
|
|||||||
typedef int EGLenum;
|
typedef int EGLenum;
|
||||||
typedef void *EGLDisplay;
|
typedef void *EGLDisplay;
|
||||||
typedef void *EGLSurface;
|
typedef void *EGLSurface;
|
||||||
|
typedef void *EGLConfig;
|
||||||
typedef intptr_t EGLNativeDisplayType;
|
typedef intptr_t EGLNativeDisplayType;
|
||||||
typedef intptr_t EGLNativeWindowType;
|
typedef intptr_t EGLNativeWindowType;
|
||||||
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
|
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
|
||||||
|
|
||||||
#endif /* ENABLE_EGL */
|
#endif /* ENABLE_EGL */
|
||||||
|
|
||||||
|
#ifndef EGL_EXT_platform_base
|
||||||
|
typedef EGLDisplay (*PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list);
|
||||||
|
typedef EGLSurface (*PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef EGL_PLATFORM_GBM_KHR
|
#ifndef EGL_PLATFORM_GBM_KHR
|
||||||
#define EGL_PLATFORM_GBM_KHR 0x31D7
|
#define EGL_PLATFORM_GBM_KHR 0x31D7
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user