forked from enlightenment/efl
evas: make the info size a parameter of the function to make it safer to roll in.
This commit is contained in:
parent
22beae8b73
commit
29cde0ee81
|
@ -765,7 +765,7 @@ evas_module_shutdown(void)
|
|||
}
|
||||
|
||||
EAPI int
|
||||
_evas_module_engine_inherit(Evas_Func *funcs, char *name)
|
||||
_evas_module_engine_inherit(Evas_Func *funcs, char *name, size_t info)
|
||||
{
|
||||
Evas_Module *em;
|
||||
|
||||
|
@ -778,6 +778,7 @@ _evas_module_engine_inherit(Evas_Func *funcs, char *name)
|
|||
evas_module_ref(em);
|
||||
evas_module_use(em);
|
||||
*funcs = *((Evas_Func *)(em->functions));
|
||||
funcs->info_size = info;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2036,7 +2036,7 @@ EAPI void evas_module_task_register(Eina_Bool (*cancelled)(void *data), void *da
|
|||
EAPI void evas_module_task_unregister(void);
|
||||
|
||||
// expose for use in engines
|
||||
EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name);
|
||||
EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name, size_t info);
|
||||
EAPI const char *_evas_module_libdir_get(void);
|
||||
const char *_evas_module_datadir_get(void);
|
||||
EAPI Eina_List *_evas_canvas_image_data_unset(Evas *eo_e);
|
||||
|
|
|
@ -163,7 +163,7 @@ module_open(Evas_Module *em)
|
|||
{
|
||||
if (!em) return 0;
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic", sizeof (Evas_Engine_Info_Buffer))) return 0;
|
||||
|
||||
_evas_engine_buffer_log_dom = eina_log_domain_register
|
||||
("evas-buffer", EINA_COLOR_BLUE);
|
||||
|
@ -182,8 +182,6 @@ module_open(Evas_Module *em)
|
|||
ORD(canvas_alpha_get);
|
||||
ORD(output_free);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_Buffer);
|
||||
|
||||
/* now advertise out own api */
|
||||
em->functions = (void *)(&func);
|
||||
return 1;
|
||||
|
|
|
@ -214,10 +214,10 @@ module_open(Evas_Module *em)
|
|||
if (!em) return 0;
|
||||
|
||||
/* try to inherit functions from software_generic engine */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic", sizeof (Evas_Engine_Info_Drm))) return 0;
|
||||
|
||||
/* try to create eina logging domain */
|
||||
_evas_engine_drm_log_dom =
|
||||
_evas_engine_drm_log_dom =
|
||||
eina_log_domain_register("evas-drm", EVAS_DEFAULT_LOG_COLOR);
|
||||
|
||||
/* if we could not create a logging domain, error out */
|
||||
|
@ -240,15 +240,13 @@ module_open(Evas_Module *em)
|
|||
EVAS_API_OVERRIDE(image_plane_assign, &func, eng_);
|
||||
EVAS_API_OVERRIDE(image_plane_release, &func, eng_);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_Drm);
|
||||
|
||||
/* advertise our engine functions */
|
||||
em->functions = (void *)(&func);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
module_close(Evas_Module *em EINA_UNUSED)
|
||||
{
|
||||
/* unregister the eina log domain for this engine */
|
||||
|
|
|
@ -1091,7 +1091,7 @@ module_open(Evas_Module *em)
|
|||
if (!em) return 0;
|
||||
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic", sizeof (Evas_Engine_Info_Eglfs))) return 0;
|
||||
|
||||
/* try to create eina logging domain */
|
||||
if (_evas_engine_eglfs_log_dom < 0)
|
||||
|
@ -1119,8 +1119,6 @@ module_open(Evas_Module *em)
|
|||
EVAS_API_OVERRIDE(output_dump, &func, eng_);
|
||||
EVAS_API_OVERRIDE(image_native_set, &func, eng_);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_Eglfs);
|
||||
|
||||
setenv("EGL_PLATFORM", "fbdev", 1);
|
||||
|
||||
gl_symbols();
|
||||
|
|
|
@ -111,7 +111,7 @@ module_open(Evas_Module *em)
|
|||
{
|
||||
if (!em) return 0;
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic", sizeof (Evas_Engine_Info_FB))) return 0;
|
||||
_evas_engine_fb_log_dom = eina_log_domain_register
|
||||
("evas-fb", EVAS_DEFAULT_LOG_COLOR);
|
||||
if (_evas_engine_fb_log_dom < 0)
|
||||
|
@ -129,8 +129,6 @@ module_open(Evas_Module *em)
|
|||
ORD(canvas_alpha_get);
|
||||
ORD(output_free);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_FB);
|
||||
|
||||
/* now advertise out own api */
|
||||
em->functions = (void *)(&func);
|
||||
return 1;
|
||||
|
|
|
@ -265,7 +265,7 @@ module_open(Evas_Module *em)
|
|||
if (!em) return 0;
|
||||
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic", sizeof (Evas_Engine_Info_GL_Cocoa))) return 0;
|
||||
|
||||
if (_evas_engine_gl_cocoa_log_dom < 0)
|
||||
{
|
||||
|
@ -288,8 +288,6 @@ module_open(Evas_Module *em)
|
|||
ORD(canvas_alpha_get);
|
||||
ORD(output_free);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_GL_Cocoa);
|
||||
|
||||
_gl_symbols();
|
||||
|
||||
/* now advertise out own api */
|
||||
|
|
|
@ -1451,7 +1451,7 @@ module_open(Evas_Module *em)
|
|||
if (!em) return 0;
|
||||
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic", sizeof (Evas_Engine_Info_GL_Drm))) return 0;
|
||||
|
||||
/* try to create eina logging domain */
|
||||
if (_evas_engine_gl_drm_log_dom < 0)
|
||||
|
@ -1485,8 +1485,6 @@ module_open(Evas_Module *em)
|
|||
EVAS_API_OVERRIDE(image_plane_assign, &func, eng_);
|
||||
EVAS_API_OVERRIDE(image_plane_release, &func, eng_);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_GL_Drm);
|
||||
|
||||
/* Mesa's EGL driver loads wayland egl by default. (called by eglGetProcaddr() )
|
||||
* implicit env set (EGL_PLATFORM=drm) prevent that. */
|
||||
setenv("EGL_PLATFORM", "drm", 1);
|
||||
|
|
|
@ -3107,7 +3107,7 @@ module_open(Evas_Module *em)
|
|||
if (!em) return 0;
|
||||
if (!evas_gl_common_module_open()) return 0;
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic", 0)) return 0;
|
||||
if (_evas_engine_GL_log_dom < 0)
|
||||
_evas_engine_GL_log_dom = eina_log_domain_register("evas-gl_generic", EVAS_DEFAULT_LOG_COLOR);
|
||||
if (_evas_engine_GL_log_dom < 0)
|
||||
|
|
|
@ -367,7 +367,7 @@ module_open(Evas_Module *em)
|
|||
{
|
||||
if (!em) return 0;
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic", sizeof (Evas_Engine_Info_GL_SDL))) return 0;
|
||||
if (_evas_engine_GL_SDL_log_dom < 0)
|
||||
_evas_engine_GL_SDL_log_dom = eina_log_domain_register
|
||||
("evas-gl_sdl", EVAS_DEFAULT_LOG_COLOR);
|
||||
|
@ -385,8 +385,6 @@ module_open(Evas_Module *em)
|
|||
ORD(output_free);
|
||||
ORD(output_dump);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_GL_SDL);
|
||||
|
||||
gl_symbols();
|
||||
|
||||
/* now advertise out own api */
|
||||
|
|
|
@ -3010,7 +3010,7 @@ module_open(Evas_Module *em)
|
|||
}
|
||||
if (!em) return 0;
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic", sizeof (Evas_Engine_Info_GL_X11))) return 0;
|
||||
if (_evas_engine_GL_X11_log_dom < 0)
|
||||
_evas_engine_GL_X11_log_dom = eina_log_domain_register
|
||||
("evas-gl_x11", EVAS_DEFAULT_LOG_COLOR);
|
||||
|
@ -3046,8 +3046,6 @@ module_open(Evas_Module *em)
|
|||
// gl_current_surface_get is in gl generic
|
||||
ORD(gl_current_context_get);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_GL_X11);
|
||||
|
||||
if (!(platform_env = getenv("EGL_PLATFORM")))
|
||||
setenv("EGL_PLATFORM", "x11", 0);
|
||||
|
||||
|
|
|
@ -389,7 +389,7 @@ module_open(Evas_Module *em)
|
|||
{
|
||||
if (!em) return 0;
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic", sizeof (Evas_Engine_Info_PSL1GHT))) return 0;
|
||||
_evas_engine_psl1ght_log_dom = eina_log_domain_register
|
||||
("evas-psl1ght", EVAS_DEFAULT_LOG_COLOR);
|
||||
if (_evas_engine_psl1ght_log_dom < 0)
|
||||
|
@ -416,8 +416,6 @@ module_open(Evas_Module *em)
|
|||
ORD(output_flush);
|
||||
ORD(output_idle_flush);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_PSL1GHT);
|
||||
|
||||
/* now advertise out own api */
|
||||
em->functions = (void *)(&func);
|
||||
return 1;
|
||||
|
|
|
@ -110,7 +110,7 @@ module_open(Evas_Module *em)
|
|||
{
|
||||
if (!em) return 0;
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic", sizeof (Evas_Engine_Info_Software_DDraw))) return 0;
|
||||
_evas_log_dom_module = eina_log_domain_register
|
||||
("evas-software_ddraw", EVAS_DEFAULT_LOG_COLOR);
|
||||
if (_evas_log_dom_module < 0)
|
||||
|
@ -127,8 +127,6 @@ module_open(Evas_Module *em)
|
|||
ORD(canvas_alpha_get);
|
||||
ORD(output_free);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_Software_DDraw);
|
||||
|
||||
/* now advertise out own api */
|
||||
em->functions = (void *)(&func);
|
||||
return 1;
|
||||
|
|
|
@ -141,7 +141,7 @@ module_open(Evas_Module *em)
|
|||
{
|
||||
if (!em) return 0;
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic", sizeof (Evas_Engine_Info_Software_Gdi))) return 0;
|
||||
|
||||
_evas_engine_soft_gdi_log_dom = eina_log_domain_register
|
||||
("evas-software_gdi", EVAS_DEFAULT_LOG_COLOR);
|
||||
|
@ -159,7 +159,6 @@ module_open(Evas_Module *em)
|
|||
ORD(canvas_alpha_get);
|
||||
ORD(output_free);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_Software_Gdi);
|
||||
/* now advertise out own api */
|
||||
em->functions = (void *)(&func);
|
||||
return 1;
|
||||
|
|
|
@ -560,7 +560,7 @@ module_open(Evas_Module *em)
|
|||
if (!em) return 0;
|
||||
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic", sizeof (Evas_Engine_Info_Software_X11))) return 0;
|
||||
|
||||
_evas_engine_soft_x11_log_dom =
|
||||
eina_log_domain_register("evas-software_x11", EVAS_DEFAULT_LOG_COLOR);
|
||||
|
@ -586,8 +586,6 @@ module_open(Evas_Module *em)
|
|||
ORD(image_native_set);
|
||||
ORD(image_native_get);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_Software_X11);
|
||||
|
||||
_symbols();
|
||||
/* now advertise out own api */
|
||||
em->functions = (void *)(&func);
|
||||
|
|
|
@ -1394,7 +1394,7 @@ module_open(Evas_Module *em)
|
|||
if (!em) return 0;
|
||||
|
||||
/* get whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "gl_generic", sizeof (Evas_Engine_Info_Wayland))) return 0;
|
||||
|
||||
/* setup logging domain */
|
||||
if (_evas_engine_wl_egl_log_dom < 0)
|
||||
|
@ -1426,8 +1426,6 @@ module_open(Evas_Module *em)
|
|||
ORD(image_native_init);
|
||||
ORD(image_native_shutdown);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_Wayland);
|
||||
|
||||
symbols();
|
||||
|
||||
/* advertise out which functions we support */
|
||||
|
|
|
@ -314,7 +314,7 @@ eng_image_native_get(void *engine EINA_UNUSED, void *image)
|
|||
}
|
||||
|
||||
/* EVAS MODULE FUNCTIONS */
|
||||
static int
|
||||
static int
|
||||
module_open(Evas_Module *em)
|
||||
{
|
||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||
|
@ -323,10 +323,10 @@ module_open(Evas_Module *em)
|
|||
if (!em) return 0;
|
||||
|
||||
/* try to get functions from whatever engine module we inherit from */
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
|
||||
if (!_evas_module_engine_inherit(&pfunc, "software_generic", sizeof (Evas_Engine_Info_Wayland))) return 0;
|
||||
|
||||
/* try to create our logging domain */
|
||||
_evas_engine_way_shm_log_dom =
|
||||
_evas_engine_way_shm_log_dom =
|
||||
eina_log_domain_register("evas-wayland_shm", EVAS_DEFAULT_LOG_COLOR);
|
||||
if (_evas_engine_way_shm_log_dom < 0)
|
||||
{
|
||||
|
@ -349,8 +349,6 @@ module_open(Evas_Module *em)
|
|||
ORD(image_native_init);
|
||||
ORD(image_native_shutdown);
|
||||
|
||||
func.info_size = sizeof (Evas_Engine_Info_Wayland);
|
||||
|
||||
_symbols();
|
||||
/* advertise our own engine functions */
|
||||
em->functions = (void *)(&func);
|
||||
|
@ -358,7 +356,7 @@ module_open(Evas_Module *em)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
module_close(Evas_Module *em EINA_UNUSED)
|
||||
{
|
||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||
|
|
Loading…
Reference in New Issue