diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2015-01-06 16:04:13 +0000 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2015-01-06 16:04:32 +0000 |
commit | 57fde136618a31f9e195827eaf1428f4fbcf8ad5 (patch) | |
tree | 469994a2f74df9c73a855e144c223329243e7384 | |
parent | a95ed3a75d7a8eb13f61c48dcf07a1599834caa9 (diff) |
gl-renderer: add legacy arg to output_create as windows can be different typesegl-platform
-rw-r--r-- | src/compositor-drm.c | 3 | ||||
-rw-r--r-- | src/compositor-fbdev.c | 3 | ||||
-rw-r--r-- | src/compositor-wayland.c | 1 | ||||
-rw-r--r-- | src/compositor-x11.c | 14 | ||||
-rw-r--r-- | src/gl-renderer.c | 7 | ||||
-rw-r--r-- | src/gl-renderer.h | 3 |
6 files changed, 15 insertions, 16 deletions
diff --git a/src/compositor-drm.c b/src/compositor-drm.c index bd8762a2..73686c60 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -1605,7 +1605,8 @@ drm_output_init_egl(struct drm_output *output, struct drm_compositor *ec) return -1; } - if (gl_renderer->output_create(&output->base, output->surface, + if (gl_renderer->output_create(&output->base, + output->surface, output->surface, gl_renderer->opaque_attribs, &format) < 0) { weston_log("failed to create gl renderer output state\n"); diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c index 2183017d..669854b7 100644 --- a/src/compositor-fbdev.c +++ b/src/compositor-fbdev.c @@ -621,7 +621,8 @@ fbdev_output_create(struct fbdev_compositor *compositor, goto out_shadow_surface; } else { setenv("HYBRIS_EGLPLATFORM", "wayland", 1); - if (gl_renderer->output_create(&output->base, NULL, + if (gl_renderer->output_create(&output->base, + (EGLNativeWindowType) NULL, NULL, gl_renderer->opaque_attribs, NULL) < 0) { weston_log("gl_renderer_output_create failed.\n"); diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c index b2ece3d6..3c21023f 100644 --- a/src/compositor-wayland.c +++ b/src/compositor-wayland.c @@ -644,6 +644,7 @@ wayland_output_init_gl_renderer(struct wayland_output *output) if (gl_renderer->output_create(&output->base, output->gl.egl_window, + output->gl.egl_window, gl_renderer->alpha_attribs, NULL) < 0) goto cleanup_window; diff --git a/src/compositor-x11.c b/src/compositor-x11.c index 323d1bea..a664fbd8 100644 --- a/src/compositor-x11.c +++ b/src/compositor-x11.c @@ -897,18 +897,12 @@ x11_compositor_create_output(struct x11_compositor *c, int x, int y, } } else { /* eglCreatePlatformWindowSurfaceEXT takes a Window* - * but eglCreateWindowSurface takes a Window, so we need to - * check which one to give. - * XXX: But this is broken, since which one we use is a runtime - * rather than compile-time decision ... */ -#ifdef EGL_EXT_platform_x11 + * but eglCreateWindowSurface takes a Window. */ Window xid = (Window) output->window; - void *native_window = &xid; -#else - void *native_window = (void *) output->window; -#endif - ret = gl_renderer->output_create(&output->base, native_window, + ret = gl_renderer->output_create(&output->base, + (EGLNativeWindowType) output->window, + &xid, gl_renderer->opaque_attribs, NULL); if (ret < 0) diff --git a/src/gl-renderer.c b/src/gl-renderer.c index b00a403b..aae18122 100644 --- a/src/gl-renderer.c +++ b/src/gl-renderer.c @@ -1801,7 +1801,8 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface); static int gl_renderer_output_create(struct weston_output *output, - void *native_window, + EGLNativeWindowType window_for_legacy, + void *window_for_platform, const EGLint *attribs, const EGLint *visual_id) { @@ -1832,13 +1833,13 @@ gl_renderer_output_create(struct weston_output *output, go->egl_surface = gr->create_platform_window(gr->egl_display, egl_config, - native_window, + window_for_platform, NULL); } else { go->egl_surface = eglCreateWindowSurface(gr->egl_display, egl_config, - (EGLNativeWindowType) native_window, NULL); + window_for_legacy, NULL); } if (go->egl_surface == EGL_NO_SURFACE) { diff --git a/src/gl-renderer.h b/src/gl-renderer.h index 2de641e4..b8c83c91 100644 --- a/src/gl-renderer.h +++ b/src/gl-renderer.h @@ -62,7 +62,8 @@ struct gl_renderer_interface { EGLDisplay (*display)(struct weston_compositor *ec); int (*output_create)(struct weston_output *output, - void *native_window, + EGLNativeWindowType window_for_legacy, + void *window_for_platform, const EGLint *attribs, const EGLint *visual_id); |