80 likes | 292 Vues
Evas_GL Refactoring. Current Evas GL Framework. Evas Runtime. Engine Interface ( evas_gl ) /* EFL-GL Glue Layer */ void *(* gl_surface_create ) (void *data, void * config , int w, int h); int (* gl_surface_destroy ) ( void *data, void *surface);
E N D
Current Evas GL Framework Evas Runtime Engine Interface (evas_gl) /* EFL-GL Glue Layer */ void *(*gl_surface_create) (void *data, void *config, int w, int h); int (*gl_surface_destroy) (void *data, void *surface); void *(*gl_context_create) (void *data, void *share_context); int (*gl_context_destroy) (void *data, void *context); int (*gl_make_current) (void *data, void *surface, void *context); void *(*gl_string_query) (void *data, int name); void *(*gl_proc_address_get) (void *data, const char *name); int (*gl_native_surface_get) (void *data, void *surface, void *native_surface); void *(*gl_api_get) (void *data); void (*gl_img_obj_set) (void *data, void *image, inthas_alpha); evas_gl.c evas_prviate.h evas_engine.c (gl_x11)
Current Evas GL Framework Evas Runtime Engine Interface (evas_gl) /* EFL-GL Glue Layer */ void *(*gl_surface_create) (void *data, void *config, int w, int h); int (*gl_surface_destroy) (void *data, void *surface); void *(*gl_context_create) (void *data, void *share_context); int (*gl_context_destroy) (void *data, void *context); int (*gl_make_current) (void *data, void *surface, void *context); void *(*gl_string_query) (void *data, int name); void *(*gl_proc_address_get) (void *data, const char *name); int (*gl_native_surface_get) (void *data, void *surface, void *native_surface); void *(*gl_api_get) (void *data); void (*gl_img_obj_set) (void *data, void *image, inthas_alpha); evas_gl.c evas_prviate.h evas_engine.c (gl_x11) evas_engine.c (wayland_egl)
Current Evas GL Framework evas_engine.c (gl_x11) evas_engine.c (wayland_egl) wayland_egl/evas_engine.c /* EFL-GL Glue Layer */ static void * eng_gl_surface_create(void *data, void *config, int w, int h) { …. } static int eng_gl_surface_destroy(void *data, void *surface) { …. } static void * eng_gl_context_create(void *data, void *share_context) { …. } gl_x11/evas_engine.c /* EFL-GL Glue Layer */ void * eng_gl_surface_create(void *data, void *config, int w, int h) { …. } int eng_gl_surface_destroy(void *data, void *surface) { …. } void * eng_gl_context_create(void *data, void *share_context) { …. } Duplicate Code!
Current Evas GL Framework Evas Runtime evas_gl.c evas_prviate.h ./gl_common/ evas_engine.c (gl_x11) evas_gl_core.h evas_gl_core_private.h evas_gl_api_ext_def.h evas_gl_api_ext.h evas_gl_core.c evas_gl_api.c evas_gl_api_ext.c
Current Evas GL Framework Evas GL Core Interface extern EVGL_Engine *evgl_engine_create (EVGL_Interface *efunc, void *engine_data); extern intevgl_engine_destroy(EVGL_Engine*ee); extern void *evgl_surface_create (EVGL_Engine *ee, Evas_GL_Config *cfg, int w, int h); extern intevgl_surface_destroy (EVGL_Engine *ee, EVGL_Surface *sfc); extern void *evgl_context_create (EVGL_Engine *ee, EVGL_Context *share_ctx); extern intevgl_context_destroy (EVGL_Engine *ee, EVGL_Context *ctx); extern intevgl_make_current (EVGL_Engine *ee, EVGL_Surface *sfc, EVGL_Context *ctx); extern void *evgl_string_query (); extern void *evgl_proc_address_get (const char *name); extern intevgl_native_surface_get (EVGL_Engine *ee, EVGL_Surface *sfc, Evas_Native_Surface *ns); extern Evas_GL_API *evgl_api_get (EVGL_Engine *ee); Evas Runtime evas_gl.c evas_prviate.h ./gl_common/ exposes.. evas_engine.c (gl_x11) evas_gl_core.h evas_gl_core_private.h evas_gl_api_ext_def.h evas_gl_api_ext.h engine implements… struct _EVGL_Interface { void *(*surface_create)(void *data); int (*surface_destroy)(void *data, void *surface); void *(*context_create)(void *data, void *share_ctx); int (*context_destroy)(void *data, void *context); int (*make_current)(void *data, void *surface, void *context, int flush); evas_gl_core.c evas_gl_api.c evas_gl_api_ext.c
Evas GL Core Inteface • Used by evas_engine.c Evas GL Core Interface extern EVGL_Engine *evgl_engine_create (EVGL_Interface *efunc, void *engine_data); extern intevgl_engine_destroy(EVGL_Engine*ee); extern void *evgl_surface_create (EVGL_Engine *ee, Evas_GL_Config *cfg, int w, int h); extern intevgl_surface_destroy (EVGL_Engine *ee, EVGL_Surface *sfc); extern void *evgl_context_create (EVGL_Engine *ee, EVGL_Context *share_ctx); extern intevgl_context_destroy (EVGL_Engine *ee, EVGL_Context *ctx); extern intevgl_make_current (EVGL_Engine *ee, EVGL_Surface *sfc, EVGL_Context *ctx); extern void *evgl_string_query (); extern void *evgl_proc_address_get (const char *name); extern intevgl_native_surface_get (EVGL_Engine *ee, EVGL_Surface *sfc, Evas_Native_Surface *ns); extern Evas_GL_API *evgl_api_get (EVGL_Engine *ee); extern intevgl_direct_enabled (EVGL_Engine *ee); extern void evgl_direct_img_obj_set (EVGL_Engine *ee, Evas_Object *img); extern Evas_Object *evgl_direct_img_obj_get (EVGL_Engine *ee);
Evas GL Core Inteface • Implemented by evas_engine.c struct _EVGL_Interface { void *(*display_get)(void *data); void *(*surface_create)(void *data); int (*surface_destroy)(void *data, void *surface); void *(*context_create)(void *data, void *share_ctx); int (*context_destroy)(void *data, void *context); int (*make_current)(void *data, void *surface, void *context, int flush); void *(*proc_address_get)(const char *name); const char *(*ext_string_get)(void *data); int (*rotation_angle_get)(void *data); };