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
* @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.
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);
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);
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))
{
#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
#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;
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))
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)
};
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;
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;
/* 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
* @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.
*
* @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_ */