From 369c38c41a791c22fb3e9dac9aab61db5217ddfd Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Mon, 1 Apr 2024 11:11:06 +0900 Subject: [PATCH] e_comp_wl: do not eglBind/UnbindWaylandDisplay if gl does not support it Change-Id: I840b021dab44230100ceb689a0767b5c7b59240f --- src/bin/e_comp_wl.c | 12 ++++++++++-- src/bin/e_hwc.c | 31 ------------------------------- 2 files changed, 10 insertions(+), 33 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index f00f5d7..5822fd6 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -3348,7 +3348,14 @@ _e_comp_wl_gl_init(void *data EINA_UNUSED) glapi = evas_gl_api_get(evasgl); EINA_SAFETY_ON_NULL_GOTO(glapi, err); - EINA_SAFETY_ON_NULL_GOTO(glapi->evasglBindWaylandDisplay, err); + + if (!glapi->evasglBindWaylandDisplay) + { + evas_gl_free(evasgl); + e_comp->gl = 1; + e_main_ts_end("\tE_Comp_Wl_GL Init Done"); + return; + } cfg = evas_gl_config_new(); EINA_SAFETY_ON_NULL_GOTO(cfg, err); @@ -3580,7 +3587,8 @@ _e_comp_wl_gl_shutdown(void) { if (!e_comp_wl->evas_gl) return; - e_comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay(e_comp_wl->evas_gl->gl, e_comp_wl->wl.disp); + if (e_comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay) + e_comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay(e_comp_wl->evas_gl->gl, e_comp_wl->wl.disp); evas_gl_make_current(e_comp_wl->evas_gl->gl, NULL, NULL); evas_gl_context_destroy(e_comp_wl->evas_gl->gl, e_comp_wl->evas_gl->glctx); diff --git a/src/bin/e_hwc.c b/src/bin/e_hwc.c index 9d077c0..bbcfdb8 100644 --- a/src/bin/e_hwc.c +++ b/src/bin/e_hwc.c @@ -432,37 +432,6 @@ e_hwc_ecore_evas_init(void) if (!ee) e_comp_gl_set(EINA_FALSE); - else - { - Evas_GL *evasgl = NULL; - Evas_GL_API *glapi = NULL; - - e_main_ts_begin("\tEvas_GL New"); - evasgl = evas_gl_new(ecore_evas_get(ee)); - if (evasgl) - { - glapi = evas_gl_api_get(evasgl); - if (!((glapi) && (glapi->evasglBindWaylandDisplay))) - { - e_comp_gl_set(EINA_FALSE); - ecore_evas_free(ee); - ee = NULL; - e_main_ts_end("\tEvas_GL New Failed 1"); - } - else - { - e_main_ts_end("\tEvas_GL New Done"); - } - } - else - { - e_comp_gl_set(EINA_FALSE); - ecore_evas_free(ee); - ee = NULL; - e_main_ts_end("\tEvas_GL New Failed 2"); - } - evas_gl_free(evasgl); - } } /* fallback to framebuffer drm (non-accel) */ -- 2.7.4