forked from enlightenment/efl
evas gl: Properly verify that Evas GL works
For SW engine we need to verify that OSMesa is present. The patch
fb048e7312
broke the logic.
Tested by temporarily removing OSMesa from my system.
Fixes T6617 (again)
This commit is contained in:
parent
2a31883f5a
commit
24447641d3
|
@ -147,7 +147,10 @@ evas_gl_new(Evas *e)
|
|||
evas_gl->evas = efl_data_ref(e, EVAS_CANVAS_CLASS);
|
||||
LKI(evas_gl->lck);
|
||||
|
||||
if (!evas_gl->evas->engine.func->gl_context_create)
|
||||
if (!evas_gl->evas->engine.func->gl_context_create ||
|
||||
!evas_gl->evas->engine.func->gl_supports_evas_gl ||
|
||||
!evas_gl->evas->engine.func->gl_supports_evas_gl(
|
||||
_evas_engine_context(evas_gl->evas)))
|
||||
{
|
||||
ERR("Evas GL engine not available.");
|
||||
efl_data_unref(e, evas_gl->evas);
|
||||
|
|
|
@ -1432,6 +1432,7 @@ struct _Evas_Func
|
|||
int (*font_right_inset_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *text_props);
|
||||
|
||||
/* EFL-GL Glue Layer */
|
||||
Eina_Bool (*gl_supports_evas_gl) (void *engine);
|
||||
void *(*gl_output_set) (void *engine, void *output);
|
||||
void *(*gl_surface_create) (void *engine, void *config, int w, int h);
|
||||
void *(*gl_pbuffer_surface_create) (void *engine, void *config, int w, int h, int const *attrib_list);
|
||||
|
|
|
@ -1528,6 +1528,14 @@ evgl_init(Render_Engine_GL_Generic *engine)
|
|||
|
||||
#define EVGLINIT(_ret) Render_Output_GL_Generic *re; if ((re = evgl_init(engine)) == NULL) return _ret
|
||||
|
||||
static Eina_Bool
|
||||
eng_gl_supports_evas_gl(void *engine EINA_UNUSED)
|
||||
{
|
||||
// Evas GL should always work... But let's do a full init anyway.
|
||||
EVGLINIT(EINA_FALSE);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gl_output_set(void *eng, void *output)
|
||||
{
|
||||
|
@ -3166,6 +3174,7 @@ module_open(Evas_Module *em)
|
|||
ORD(font_cache_set);
|
||||
ORD(font_cache_get);
|
||||
|
||||
ORD(gl_supports_evas_gl);
|
||||
ORD(gl_output_set);
|
||||
ORD(gl_surface_create);
|
||||
ORD(gl_pbuffer_surface_create);
|
||||
|
|
|
@ -3461,13 +3461,19 @@ _tls_check(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
static inline Eina_Bool
|
||||
_check_gl(void)
|
||||
{
|
||||
if (!gl_lib_init()) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
eng_gl_supports_evas_gl(void *data EINA_UNUSED)
|
||||
{
|
||||
return _check_gl();
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gl_surface_create(void *data EINA_UNUSED, void *config, int w, int h)
|
||||
{
|
||||
|
@ -4815,6 +4821,7 @@ static Evas_Func func =
|
|||
eng_font_pen_coords_get,
|
||||
eng_font_text_props_info_create,
|
||||
eng_font_right_inset_get,
|
||||
eng_gl_supports_evas_gl, // returns true iif OSMesa is present
|
||||
NULL, // No need to set output for software engine
|
||||
eng_gl_surface_create, // need software mesa for gl rendering <- gl_surface_create
|
||||
NULL, // need software mesa for gl rendering <- gl_pbuffer_surface_create
|
||||
|
|
Loading…
Reference in New Issue