efl_ui_win: add window configuring feature on WL 38/167638/3
authorDaekwang Ryu <dkdk.ryu@samsung.com>
Thu, 18 Jan 2018 02:44:19 +0000 (11:44 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 19 Jan 2018 02:33:43 +0000 (02:33 +0000)
Change-Id: Ifb354a0f3b31fa748fbac9ef08395108e6106963

src/lib/ecore_evas/Ecore_Evas.h
src/lib/ecore_evas/ecore_evas.c
src/lib/elementary/efl_ui_win.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h

index 6bb4701..d6c7fa2 100644 (file)
@@ -162,6 +162,22 @@ typedef enum _Ecore_Evas_Object_Associate_Flags
   ECORE_EVAS_OBJECT_ASSOCIATE_DEL = 1 << 2
 } Ecore_Evas_Object_Associate_Flags;
 
+#define ECORE_EVAS_OPT_NONE         0
+#define ECORE_EVAS_OPT_INDIRECT     1
+#define ECORE_EVAS_OPT_VSYNC        2
+#define ECORE_EVAS_OPT_SWAP_MODE    3
+#define ECORE_EVAS_OPT_GL_DEPTH     4
+#define ECORE_EVAS_OPT_GL_STENCIL   5
+#define ECORE_EVAS_OPT_GL_MSAA      6
+#define ECORE_EVAS_OPT_LAST         7
+
+#define ECORE_EVAS_SWAP_MODE_AUTO      0
+#define ECORE_EVAS_SWAP_MODE_FULL      1
+#define ECORE_EVAS_SWAP_MODE_COPY      2
+#define ECORE_EVAS_SWAP_MODE_DOUBLE    3
+#define ECORE_EVAS_SWAP_MODE_TRIPLE    4
+#define ECORE_EVAS_SWAP_MODE_QUADRUPLE 5
+
 /* module setup/shutdown calls */
 
 EAPI int         ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
@@ -1324,20 +1340,20 @@ EAPI Ecore_Evas     *ecore_evas_software_x11_pixmap_new(const char *disp_name, E
  */
 EAPI Ecore_X_Pixmap ecore_evas_software_x11_pixmap_get(const Ecore_Evas *ee);
 
-#define ECORE_EVAS_GL_X11_OPT_NONE         0
-#define ECORE_EVAS_GL_X11_OPT_INDIRECT     1
-#define ECORE_EVAS_GL_X11_OPT_VSYNC        2
-#define ECORE_EVAS_GL_X11_OPT_SWAP_MODE    3
-#define ECORE_EVAS_GL_X11_OPT_GL_DEPTH     4
-#define ECORE_EVAS_GL_X11_OPT_GL_STENCIL   5
-#define ECORE_EVAS_GL_X11_OPT_GL_MSAA      6
-#define ECORE_EVAS_GL_X11_OPT_LAST         7
+#define ECORE_EVAS_GL_X11_OPT_NONE         ECORE_EVAS_OPT_NONE
+#define ECORE_EVAS_GL_X11_OPT_INDIRECT     ECORE_EVAS_OPT_INDIRECT
+#define ECORE_EVAS_GL_X11_OPT_VSYNC        ECORE_EVAS_OPT_VSYNC
+#define ECORE_EVAS_GL_X11_OPT_SWAP_MODE    ECORE_EVAS_OPT_SWAP_MODE
+#define ECORE_EVAS_GL_X11_OPT_GL_DEPTH     ECORE_EVAS_OPT_GL_DEPTH
+#define ECORE_EVAS_GL_X11_OPT_GL_STENCIL   ECORE_EVAS_OPT_GL_STENCIL
+#define ECORE_EVAS_GL_X11_OPT_GL_MSAA      ECORE_EVAS_OPT_GL_MSAA
+#define ECORE_EVAS_GL_X11_OPT_LAST         ECORE_EVAS_OPT_LAST
 
-#define ECORE_EVAS_GL_X11_SWAP_MODE_AUTO   0
-#define ECORE_EVAS_GL_X11_SWAP_MODE_FULL   1
-#define ECORE_EVAS_GL_X11_SWAP_MODE_COPY   2
-#define ECORE_EVAS_GL_X11_SWAP_MODE_DOUBLE 3
-#define ECORE_EVAS_GL_X11_SWAP_MODE_TRIPLE 4
+#define ECORE_EVAS_GL_X11_SWAP_MODE_AUTO   ECORE_EVAS_SWAP_MODE_AUTO
+#define ECORE_EVAS_GL_X11_SWAP_MODE_FULL   ECORE_EVAS_SWAP_MODE_FULL
+#define ECORE_EVAS_GL_X11_SWAP_MODE_COPY   ECORE_EVAS_SWAP_MODE_COPY
+#define ECORE_EVAS_GL_X11_SWAP_MODE_DOUBLE ECORE_EVAS_SWAP_MODE_DOUBLE
+#define ECORE_EVAS_GL_X11_SWAP_MODE_TRIPLE ECORE_EVAS_SWAP_MODE_TRIPLE
 
 /**
  * @brief Creates Ecore_Evas using opengl x11.
@@ -1547,6 +1563,7 @@ 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.
index 7f15def..1101108 100644 (file)
@@ -4870,6 +4870,27 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent,
    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))
+     {
+        ecore_evas_free(ee);
+        return NULL;
+     }
+   return ee;
+}
+
 EAPI void
 ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
 {
index 84935a7..f26a2a7 100644 (file)
@@ -5756,7 +5756,35 @@ _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 = ecore_evas_wayland_shm_new(NULL, parent_id, 0, 0, 0, 0, 0);
              else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
-               tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0);
+               {
+                  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, 0, 0, 0, 0, 0, 0, opt);
+                  else
+                    tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 0, 0, 0);
+               }
              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))
index 7c458f5..03b0aab 100644 (file)
@@ -3305,6 +3305,13 @@ 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_Wl2_Display *ewd;
    Ecore_Wl2_Window *p = NULL;
    Evas_Engine_Info_Wayland *einfo;
@@ -3425,6 +3432,30 @@ _ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, i
         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;
              einfo->info.rotation = ee->rotation;
              einfo->info.depth = 32;
index 0ecd868..ae0c660 100644 (file)
@@ -38,4 +38,14 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
                                              "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");
+}
+
 #endif
index fcc1d8b..f7ade96 100644 (file)
@@ -115,4 +115,5 @@ struct _Ecore_Evas_Engine_Wl_Data
  */
 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_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_ */