From: Hermet Park Date: Thu, 25 Apr 2019 07:56:40 +0000 (+0900) Subject: ecore wayland: expand internal interface to pass engine option list. X-Git-Tag: accepted/tizen/unified/20190429.103734~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F204739%2F3;p=platform%2Fupstream%2Fefl.git ecore wayland: expand internal interface to pass engine option list. This is a prepartion patch to support msaa in wayland. ui window needs to deliver engine options (stencil, depth, msaa bits) to evas engine side, ecore_evas_wayland_egl should have the argument to pass. Change-Id: I7f529f0e0ae2f1f46062dfc7d6a4dd7beaed8382 --- diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h index 68b8100..be77bf5 100755 --- a/src/lib/ecore_evas/Ecore_Evas.h +++ b/src/lib/ecore_evas/Ecore_Evas.h @@ -1563,7 +1563,6 @@ EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, unsigned * @see ecore_evas_wayland_shm_new() */ EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame); -EAPI Ecore_Evas *ecore_evas_wayland_egl_options_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt); /** * @brief Begin resizing the Ecore_Evas window. diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index cb42f29..7f53c18 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -4969,7 +4969,7 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame) { Ecore_Evas *ee; - Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool); + Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool, const int*); Eina_Module *m = _ecore_evas_engine_load("wayland"); EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); @@ -4978,7 +4978,7 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, if (parent) ERR("Wayland windows with parents not supported through legacy API"); - ee = new(disp_name, 0, x, y, w, h, frame); + ee = new(disp_name, 0, x, y, w, h, frame, NULL); if (!_ecore_evas_cursors_init(ee)) { ecore_evas_free(ee); @@ -5010,37 +5010,16 @@ _wayland_shm_new(const char *disp_name, Ecore_Window parent, Ecore_Evas * _wayland_egl_new(const char *disp_name, Ecore_Window parent, - int x, int y, int w, int h, Eina_Bool frame) + int x, int y, int w, int h, Eina_Bool frame, const int *opt) { Ecore_Evas *ee; - Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool); + Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool, const int *); Eina_Module *m = _ecore_evas_engine_load("wayland"); EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); new = eina_module_symbol_get(m, "ecore_evas_wayland_egl_new_internal"); EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); - ee = new(disp_name, parent, x, y, w, h, frame); - if (!_ecore_evas_cursors_init(ee)) - { - ecore_evas_free(ee); - return NULL; - } - return ee; -} - -EAPI Ecore_Evas * -ecore_evas_wayland_egl_options_new(const char *disp_name, unsigned int parent, - int x, int y, int w, int h, Eina_Bool frame, const int *opt) -{ - Ecore_Evas *ee; - Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int, Eina_Bool, const int *); - Eina_Module *m = _ecore_evas_engine_load("wayland"); - EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); - - new = eina_module_symbol_get(m, "ecore_evas_wayland_egl_options_new_internal"); - EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); - ee = new(disp_name, parent, x, y, w, h, frame, opt); if (!_ecore_evas_cursors_init(ee)) { diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h index 97626f3..34c611e 100644 --- a/src/lib/ecore_evas/ecore_evas_private.h +++ b/src/lib/ecore_evas/ecore_evas_private.h @@ -564,7 +564,7 @@ EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window); #ifdef IPA_YLNO_ESU_LANRETNI_MLE EAPI Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame); -EAPI Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame); +EAPI Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt); #else #define _wayland_shm_new DONT_USE_INTERNAL_API #define _wayland_egl_new DONT_USE_INTERNAL_API diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 7c3a64e..46df9bd 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -44,7 +44,7 @@ #define FRAME_OBJ_THEME_MIN_VERSION 119 Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame); -Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame); +Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt); static const Elm_Win_Trap *trap = NULL; @@ -6358,35 +6358,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM)) tmp_sd.ee = _wayland_shm_new(NULL, parent_id, 0, 0, 0, 0, 0); else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL)) - { - int opt[20], opt_i = 0; - - if (_elm_config->vsync) - { - opt[opt_i++] = ECORE_EVAS_OPT_VSYNC; - opt[opt_i++] = 1; - } - if (_elm_config->gl_depth) - { - opt[opt_i++] = ECORE_EVAS_OPT_GL_DEPTH; - opt[opt_i++] = _elm_config->gl_depth; - } - if (_elm_config->gl_stencil) - { - opt[opt_i++] = ECORE_EVAS_OPT_GL_STENCIL; - opt[opt_i++] = _elm_config->gl_stencil; - } - if (_elm_config->gl_msaa) - { - opt[opt_i++] = ECORE_EVAS_OPT_GL_MSAA; - opt[opt_i++] = _elm_config->gl_msaa; - } - opt[opt_i] = 0; - if (opt_i > 0) - tmp_sd.ee = ecore_evas_wayland_egl_options_new(NULL, parent_id, 0, 0, 0, 0, 0, opt); - else - tmp_sd.ee = _wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0); - } + tmp_sd.ee = _wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0, NULL); else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32)) tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1); else if (!strcmp(enginelist[i], ELM_SOFTWARE_DDRAW)) diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index ab741a1..4f095cd 100755 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -319,6 +319,13 @@ _ecore_evas_wl_common_cb_disconnect(void *data EINA_UNUSED, int type EINA_UNUSED return ECORE_CALLBACK_RENEW; } +static Eina_Bool +ee_needs_alpha(Ecore_Evas *ee) +{ + return ee->shadow.l || ee->shadow.r || ee->shadow.t || ee->shadow.b || + ee->alpha; +} + // TIZEN_ONLY(20160630) void _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y) @@ -3355,14 +3362,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func = }; Ecore_Evas * -_ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name) -{ - return _ecore_evas_wl_common_options_new_internal(disp_name, parent, x, y, w, h, - frame, NULL, engine_name); -} - -Ecore_Evas * -_ecore_evas_wl_common_options_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt, const char *engine_name) +_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt, const char *engine_name) { Ecore_Wl2_Display *ewd; Ecore_Wl2_Window *p = NULL; @@ -3485,31 +3485,30 @@ _ecore_evas_wl_common_options_new_internal(const char *disp_name, unsigned int p wdata->sync_done = EINA_TRUE; if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas))) { - if (opt) - { - int op; - - for (op = 0; opt[op]; op++) - { - if (opt[op] == ECORE_EVAS_OPT_GL_DEPTH) - { - op++; - einfo->depth_bits = opt[op]; - } - else if (opt[op] == ECORE_EVAS_OPT_GL_STENCIL) - { - op++; - einfo->stencil_bits = opt[op]; - } - else if (opt[op] == ECORE_EVAS_OPT_GL_MSAA) - { - op++; - einfo->msaa_bits = opt[op]; - } - } - } - - einfo->info.destination_alpha = EINA_TRUE; + if (opt) + { + int op; + for (op = 0; opt[op]; op++) + { + if (opt[op] == ECORE_EVAS_OPT_GL_DEPTH) + { + op++; + einfo->depth_bits = opt[op]; + } + else if (opt[op] == ECORE_EVAS_OPT_GL_STENCIL) + { + op++; + einfo->stencil_bits = opt[op]; + } + else if (opt[op] == ECORE_EVAS_OPT_GL_MSAA) + { + op++; + einfo->msaa_bits = opt[op]; + } + } + } + + einfo->info.destination_alpha = ee_needs_alpha(ee); einfo->info.rotation = ee->rotation; einfo->info.depth = 32; einfo->info.wl2_win = wdata->win; diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c index 14cd0be..f5530bc 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c @@ -29,23 +29,13 @@ /* external functions */ EAPI Ecore_Evas * -ecore_evas_wayland_egl_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame) +ecore_evas_wayland_egl_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt) { LOGFN(__FILE__, __LINE__, __FUNCTION__); return _ecore_evas_wl_common_new_internal(disp_name, parent, x, y, w, h, frame, - "wayland_egl"); -} - -EAPI Ecore_Evas * -ecore_evas_wayland_egl_options_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt) -{ - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - return _ecore_evas_wl_common_options_new_internal(disp_name, parent, - x, y, w, h, frame, opt, - "wayland_egl"); + opt, "wayland_egl"); } #endif diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h index dc43765..22f0099 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h @@ -94,6 +94,7 @@ struct _Ecore_Evas_Engine_Wl_Data * @param w Width of the Ecore_Evas window to be created. * @param h Height of the Ecore_Evas window to be created. * @param frame Deprecated. (Just pass EINA_FALSE.) + * @param opt engine option list * @param engine_name Wayland engine to use for rendering. * @return Ecore_Evas instance or @c NULL if creation failed. * @@ -112,7 +113,6 @@ struct _Ecore_Evas_Engine_Wl_Data * @see ecore_evas_wayland_shm_new() * @see ecore_evas_wayland_egl_new() */ -Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name); +Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt, const char *engine_name); -Ecore_Evas *_ecore_evas_wl_common_options_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt, const char *engine_name); #endif /* _ECORE_EVAS_WAYLAND_PRIVATE_H_ */