mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 23:32:26 +00:00
wayland/egl: misc fixes and cleanups
This commit is contained in:
parent
96e75d234a
commit
bb3ea1580e
@ -104,7 +104,7 @@ static bool egl_create_context(struct vo_wayland_state *wl,
|
|||||||
if (!wl->egl_context.egl.ctx) {
|
if (!wl->egl_context.egl.ctx) {
|
||||||
/* fallback to any GL version */
|
/* fallback to any GL version */
|
||||||
MP_WARN(wl, "can't create context for requested OpenGL version: "
|
MP_WARN(wl, "can't create context for requested OpenGL version: "
|
||||||
"fall back to any version available");
|
"fall back to any version available\n");
|
||||||
context_attribs[0] = EGL_NONE;
|
context_attribs[0] = EGL_NONE;
|
||||||
wl->egl_context.egl.ctx = eglCreateContext(wl->egl_context.egl.dpy,
|
wl->egl_context.egl.ctx = eglCreateContext(wl->egl_context.egl.dpy,
|
||||||
wl->egl_context.egl.conf,
|
wl->egl_context.egl.conf,
|
||||||
@ -209,8 +209,6 @@ static void frame_handle_redraw(void *data,
|
|||||||
if (callback)
|
if (callback)
|
||||||
wl_callback_destroy(callback);
|
wl_callback_destroy(callback);
|
||||||
|
|
||||||
//struct wl_callback *tmp = wl_surface_frame(wl->window.surface);
|
|
||||||
//wl_callback_add_listener(tmp, &frame_listener, ctx);
|
|
||||||
wl->egl_context.redraw_callback = wl_surface_frame(wl->window.surface);
|
wl->egl_context.redraw_callback = wl_surface_frame(wl->window.surface);
|
||||||
wl_callback_add_listener(wl->egl_context.redraw_callback, &frame_listener, ctx);
|
wl_callback_add_listener(wl->egl_context.redraw_callback, &frame_listener, ctx);
|
||||||
|
|
||||||
@ -224,7 +222,6 @@ static const struct wl_callback_listener frame_listener = {
|
|||||||
static void swapGlBuffers_wayland(MPGLContext *ctx)
|
static void swapGlBuffers_wayland(MPGLContext *ctx)
|
||||||
{
|
{
|
||||||
struct vo_wayland_state *wl = ctx->vo->wayland;
|
struct vo_wayland_state *wl = ctx->vo->wayland;
|
||||||
// eglSwapBuffers(wl->egl_context.egl.dpy, wl->egl_context.egl_surface);
|
|
||||||
|
|
||||||
if (!wl->egl_context.redraw_callback)
|
if (!wl->egl_context.redraw_callback)
|
||||||
frame_handle_redraw(ctx, NULL, 0);
|
frame_handle_redraw(ctx, NULL, 0);
|
||||||
@ -235,7 +232,6 @@ static int control(struct vo *vo, int *events, int request, void *data)
|
|||||||
struct vo_wayland_state *wl = vo->wayland;
|
struct vo_wayland_state *wl = vo->wayland;
|
||||||
int r = vo_wayland_control(vo, events, request, data);
|
int r = vo_wayland_control(vo, events, request, data);
|
||||||
|
|
||||||
// NOTE: VO_EVENT_EXPOSE is never returned by the wayland backend
|
|
||||||
if (*events & VO_EVENT_RESIZE)
|
if (*events & VO_EVENT_RESIZE)
|
||||||
egl_resize(wl);
|
egl_resize(wl);
|
||||||
|
|
||||||
|
@ -61,7 +61,6 @@ struct vo_wayland_state {
|
|||||||
EGLConfig conf;
|
EGLConfig conf;
|
||||||
} egl;
|
} egl;
|
||||||
|
|
||||||
|
|
||||||
struct wl_callback * redraw_callback;
|
struct wl_callback * redraw_callback;
|
||||||
} egl_context;
|
} egl_context;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user