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);
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);
#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)
{
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);
}
#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)
{
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