check glapi better and report errors sensibly if it fails init

devs/bu5hm4n/pointer-fix
Carsten Haitzler 1 year ago
parent 1c225c082d
commit 0bd602b7ed
  1. 19
      src/bin/e_comp_wl.c
  2. 3
      src/bin/e_pixmap.c

@ -2959,6 +2959,7 @@ e_comp_wl_query_dmabuf_formats(int max_formats, int *formats, int *num_formats)
{
*num_formats = 0;
#if EVAS_GL_API_VERSION >= 7
if (!e_comp_wl->wl.glapi) return EINA_FALSE;
if (!e_comp_wl->wl.glapi->evasglQueryDmaBufFormats) return EINA_FALSE;
return e_comp_wl->wl.glapi->evasglQueryDmaBufFormats(e_comp_wl->wl.gl, max_formats, formats, num_formats);
#else
@ -2971,6 +2972,7 @@ e_comp_wl_query_dmabuf_modifiers(int format, int max_modifiers, uint64_t *modifi
{
*num_modifiers = 0;
#if EVAS_GL_API_VERSION >= 7
if (!e_comp_wl->wl.glapi) return EINA_FALSE;
if (!e_comp_wl->wl.glapi->evasglQueryDmaBufModifiers) return EINA_FALSE;
return e_comp_wl->wl.glapi->evasglQueryDmaBufModifiers(e_comp_wl->wl.gl, format, max_modifiers, modifiers, external_only, num_modifiers);
#else
@ -2991,12 +2993,19 @@ _e_comp_wl_gl_init(void)
if (!e_comp_wl->wl.glsfc) goto end;
if (!evas_gl_make_current(e_comp_wl->wl.gl, e_comp_wl->wl.glsfc, e_comp_wl->wl.glctx)) goto end;
e_comp_wl->wl.glapi = evas_gl_context_api_get(e_comp_wl->wl.gl, e_comp_wl->wl.glctx);
if (e_comp_wl->wl.glapi->evasglBindWaylandDisplay)
e_comp->gl = e_comp_wl->wl.glapi->evasglBindWaylandDisplay(e_comp_wl->wl.gl, e_comp_wl->wl.disp);
if (e_comp->gl)
if (e_comp_wl->wl.glapi)
{
e_util_env_set("ELM_ACCEL", "gl");
return;
if (e_comp_wl->wl.glapi->evasglBindWaylandDisplay)
e_comp->gl = e_comp_wl->wl.glapi->evasglBindWaylandDisplay(e_comp_wl->wl.gl, e_comp_wl->wl.disp);
if (e_comp->gl)
{
e_util_env_set("ELM_ACCEL", "gl");
return;
}
}
else
{
ERR("Cannot get glapi. Is osmesa installed?");
}
end:
_e_comp_wl_gl_shutdown();

@ -591,12 +591,13 @@ e_pixmap_refresh(E_Pixmap *cp)
format = wl_shm_buffer_get_format(buffer->shm_buffer);
else if (buffer->dmabuf_buffer)
format = buffer->dmabuf_buffer->attributes.format;
else
else if (e_comp_wl->wl.glapi)
{
e_comp_wl->wl.glapi->evasglQueryWaylandBuffer
(e_comp_wl->wl.gl, buffer->resource, EGL_TEXTURE_FORMAT,
&format);
}
else return EINA_FALSE;
switch (format)
{

Loading…
Cancel
Save