e_comp_wl: remove include Evas_GL.h in header file 94/238194/4 accepted/tizen/unified/20200710.114027 submit/tizen/20200709.104250
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 9 Jul 2020 08:26:53 +0000 (17:26 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 9 Jul 2020 10:09:00 +0000 (19:09 +0900)
If Evas_GL and EGL hedaer are included, build error is ouccured in 64bit system.
becase Evas_GL define khronos_unit64_t and khronos_int64_t and
e_egl_sync include EGL header.

Change-Id: Ifde7aa0f88b055deb157c4d50c0df20653a9b927

src/bin/e_comp_wl.c
src/bin/e_comp_wl.h
src/bin/e_hwc.c
src/bin/e_pixmap.c

index 1537d050773c4920656f1c16e293830cbafbb5e8..84b8846a13166af08de6d1b0618473a862a6eb63 100644 (file)
@@ -2,6 +2,7 @@
 #include <tizen-extension-server-protocol.h>
 
 #include <wayland-tbm-server.h>
+#include <Evas_GL.h>
 
 /* handle include for printing uint64_t */
 #define __STDC_FORMAT_MACROS
@@ -46,6 +47,15 @@ typedef struct _E_Comp_Wl_Key_Data
    Ecore_Device *dev;
 } E_Comp_Wl_Key_Data;
 
+struct _E_Comp_Wl_Evas_Gl
+{
+   Evas_GL *gl;
+   Evas_GL_Config *glcfg;
+   Evas_GL_Context *glctx;
+   Evas_GL_Surface *glsfc;
+   Evas_GL_API *glapi;
+};
+
 static Eina_List *handlers = NULL;
 static E_Client *cursor_timer_ec = NULL;
 static Eina_Bool need_send_released = EINA_FALSE;
@@ -3849,9 +3859,13 @@ _e_comp_wl_gl_init(void *data EINA_UNUSED)
    Evas_GL_Surface *sfc = NULL;
    Evas_GL_Config *cfg = NULL;
    Eina_Bool res;
+   E_Comp_Wl_Evas_Gl *evas_gl = NULL;
 
    if (!e_comp_gl_get()) return;
 
+   evas_gl = E_NEW(E_Comp_Wl_Evas_Gl, 1);
+   EINA_SAFETY_ON_NULL_RETURN(evas_gl);
+
    /* create dummy evas gl to bind wayland display of enlightenment to egl display */
    e_main_ts_begin("\tE_Comp_Wl_GL Init");
 
@@ -3887,10 +3901,12 @@ _e_comp_wl_gl_init(void *data EINA_UNUSED)
 
    evas_gl_config_free(cfg);
 
-   e_comp_wl->wl.gl = evasgl;
-   e_comp_wl->wl.glapi = glapi;
-   e_comp_wl->wl.glsfc = sfc;
-   e_comp_wl->wl.glctx = ctx;
+   evas_gl->gl = evasgl;
+   evas_gl->glapi = glapi;
+   evas_gl->glsfc = sfc;
+   evas_gl->glctx = ctx;
+
+   e_comp_wl->evas_gl = evas_gl;
 
    /* for native surface */
    e_comp->gl = 1;
@@ -3905,6 +3921,7 @@ err:
    evas_gl_context_destroy(evasgl, ctx);
    evas_gl_surface_destroy(evasgl, sfc);
    evas_gl_free(evasgl);
+   free(evas_gl);
 }
 
 // FIXME
@@ -4094,19 +4111,16 @@ disp_err:
 static void
 _e_comp_wl_gl_shutdown(void)
 {
-   if (!e_comp_wl->wl.gl) return;
+   if (!e_comp_wl->evas_gl) return;
 
-   e_comp_wl->wl.glapi->evasglUnbindWaylandDisplay(e_comp_wl->wl.gl, e_comp_wl->wl.disp);
+   e_comp_wl->evas_gl->glapi->evasglUnbindWaylandDisplay(e_comp_wl->evas_gl->gl, e_comp_wl->wl.disp);
 
-   evas_gl_make_current(e_comp_wl->wl.gl, NULL, NULL);
-   evas_gl_context_destroy(e_comp_wl->wl.gl, e_comp_wl->wl.glctx);
-   evas_gl_surface_destroy(e_comp_wl->wl.gl, e_comp_wl->wl.glsfc);
-   evas_gl_free(e_comp_wl->wl.gl);
+   evas_gl_make_current(e_comp_wl->evas_gl->gl, NULL, NULL);
+   evas_gl_context_destroy(e_comp_wl->evas_gl->gl, e_comp_wl->evas_gl->glctx);
+   evas_gl_surface_destroy(e_comp_wl->evas_gl->gl, e_comp_wl->evas_gl->glsfc);
+   evas_gl_free(e_comp_wl->evas_gl->gl);
 
-   e_comp_wl->wl.glsfc = NULL;
-   e_comp_wl->wl.glctx = NULL;
-   e_comp_wl->wl.glapi = NULL;
-   e_comp_wl->wl.gl = NULL;
+   E_FREE(e_comp_wl->evas_gl);
 }
 
 /* public functions */
@@ -4460,6 +4474,7 @@ e_comp_wl_buffer_get(struct wl_resource *resource, E_Client *ec)
 
              buffer->w = wl_shm_buffer_get_width(shmbuff);
              buffer->h = wl_shm_buffer_get_height(shmbuff);
+             buffer->format = wl_shm_buffer_get_format(shmbuff);
           }
         else
           {
@@ -4467,6 +4482,7 @@ e_comp_wl_buffer_get(struct wl_resource *resource, E_Client *ec)
                {
                   buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
                   buffer->w = buffer->h = 1;
+                  buffer->format = 0;
                }
              else if ((ec) && (e_client_video_hw_composition_check(ec)))
                {
@@ -4477,22 +4493,29 @@ e_comp_wl_buffer_get(struct wl_resource *resource, E_Client *ec)
                   buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
                   buffer->w = tbm_surface_get_width(tbm_surf);
                   buffer->h = tbm_surface_get_height(tbm_surf);
+                  buffer->format = tbm_surface_get_format(tbm_surf);
                   buffer->tbm_surface = tbm_surf;
                }
              else if (e_comp->gl)
                {
                   buffer->type = E_COMP_WL_BUFFER_TYPE_NATIVE;
 
-                  res = e_comp_wl->wl.glapi->evasglQueryWaylandBuffer(e_comp_wl->wl.gl,
-                                                                      resource,
-                                                                      EVAS_GL_WIDTH,
-                                                                      &buffer->w);
+                  res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+                                                                            resource,
+                                                                            EVAS_GL_WIDTH,
+                                                                            &buffer->w);
                   EINA_SAFETY_ON_FALSE_GOTO(res, err);
 
-                  res = e_comp_wl->wl.glapi->evasglQueryWaylandBuffer(e_comp_wl->wl.gl,
-                                                                      resource,
-                                                                      EVAS_GL_HEIGHT,
-                                                                      &buffer->h);
+                  res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+                                                                            resource,
+                                                                            EVAS_GL_HEIGHT,
+                                                                            &buffer->h);
+                  EINA_SAFETY_ON_FALSE_GOTO(res, err);
+
+                  res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+                                                                            resource,
+                                                                            EVAS_GL_TEXTURE_FORMAT,
+                                                                            &buffer->format);
                   EINA_SAFETY_ON_FALSE_GOTO(res, err);
                }
              else
@@ -4504,6 +4527,7 @@ e_comp_wl_buffer_get(struct wl_resource *resource, E_Client *ec)
                   buffer->type = E_COMP_WL_BUFFER_TYPE_NATIVE;
                   buffer->w = tbm_surface_get_width(tbm_surf);
                   buffer->h = tbm_surface_get_height(tbm_surf);
+                  buffer->format = tbm_surface_get_format(tbm_surf);
                   buffer->tbm_surface = tbm_surf;
                }
           }
@@ -4519,6 +4543,7 @@ e_comp_wl_buffer_get(struct wl_resource *resource, E_Client *ec)
 
                buffer->w = wl_shm_buffer_get_width(shmbuff);
                buffer->h = wl_shm_buffer_get_height(shmbuff);
+               buffer->format = wl_shm_buffer_get_format(shmbuff);
             }
           else if (tbm_surf)
             {
@@ -4530,34 +4555,43 @@ e_comp_wl_buffer_get(struct wl_resource *resource, E_Client *ec)
                  {
                     buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
                     buffer->w = buffer->h = 1;
+                    buffer->format = 0;
                  }
                else if ((ec) && (e_client_video_hw_composition_check(ec)))
                  {
                     buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
                     buffer->w = tbm_surface_get_width(tbm_surf);
                     buffer->h = tbm_surface_get_height(tbm_surf);
+                    buffer->format = tbm_surface_get_format(tbm_surf);
                  }
                else
                  {
                     buffer->type = E_COMP_WL_BUFFER_TYPE_TBM;
                     buffer->w = tbm_surface_get_width(tbm_surf);
                     buffer->h = tbm_surface_get_height(tbm_surf);
+                    buffer->format = tbm_surface_get_format(tbm_surf);
                  }
             }
           else if (e_comp->gl)
             {
                 buffer->type = E_COMP_WL_BUFFER_TYPE_NATIVE;
 
-                res = e_comp_wl->wl.glapi->evasglQueryWaylandBuffer(e_comp_wl->wl.gl,
-                                                                    resource,
-                                                                    EVAS_GL_WIDTH,
-                                                                    &buffer->w);
+                res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+                                                                          resource,
+                                                                          EVAS_GL_WIDTH,
+                                                                          &buffer->w);
+                EINA_SAFETY_ON_FALSE_GOTO(res, err);
+
+                res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+                                                                          resource,
+                                                                          EVAS_GL_HEIGHT,
+                                                                          &buffer->h);
                 EINA_SAFETY_ON_FALSE_GOTO(res, err);
 
-                res = e_comp_wl->wl.glapi->evasglQueryWaylandBuffer(e_comp_wl->wl.gl,
-                                                                    resource,
-                                                                    EVAS_GL_HEIGHT,
-                                                                    &buffer->h);
+                res = e_comp_wl->evas_gl->glapi->evasglQueryWaylandBuffer(e_comp_wl->evas_gl->gl,
+                                                                          resource,
+                                                                          EVAS_GL_TEXTURE_FORMAT,
+                                                                          &buffer->format);
                 EINA_SAFETY_ON_FALSE_GOTO(res, err);
             }
           else
index ac95bd0140534e9daaf78e47770bfe3b51d1a414..b3621f037890948984145490ffd19f07470e62dc 100644 (file)
@@ -32,7 +32,6 @@ typedef struct _E_Comp_Wl_Pid_Hook E_Comp_Wl_Pid_Hook;
       (type *)( (char *)__mptr - offsetof(type,member) ); \
    })
 
-#include <Evas_GL.h>
 #include <tbm_surface.h>
 
 #define E_COMP_WL_TOUCH_MAX 10
@@ -47,7 +46,7 @@ typedef struct _E_Comp_Wl_Client_Data E_Comp_Wl_Client_Data;
 typedef struct _E_Comp_Wl_Data E_Comp_Wl_Data;
 typedef struct _E_Comp_Wl_Output E_Comp_Wl_Output;
 typedef struct _E_Comp_Wl_Intercept_Hook E_Comp_Wl_Intercept_Hook;
-
+typedef struct _E_Comp_Wl_Evas_Gl E_Comp_Wl_Evas_Gl;
 
 typedef enum _E_Comp_Wl_Buffer_Type
 {
@@ -116,6 +115,7 @@ struct _E_Comp_Wl_Buffer
       void *owner_ptr;
    } debug_info;
    int32_t w, h;
+   int format;
    int transform; // the value of wl_tbm.set_buffer_transform
    uint32_t busy;
 
@@ -200,11 +200,6 @@ struct _E_Comp_Wl_Data
      {
         struct wl_display *disp;
         struct wl_event_loop *loop;
-        Evas_GL *gl;
-        Evas_GL_Config *glcfg;
-        Evas_GL_Context *glctx;
-        Evas_GL_Surface *glsfc;
-        Evas_GL_API *glapi;
      } wl;
 
    struct
@@ -378,6 +373,8 @@ struct _E_Comp_Wl_Data
    E_Client *drag_client;
    void *drag_source;
    void *drag_offer;
+
+   E_Comp_Wl_Evas_Gl *evas_gl;
 };
 
 struct _E_Comp_Wl_Client_Data
index 34c70433c9c579164d5cda1cfbd3df3dcca639a0..3726f9be619939036df39a4e8fafb019e56f3a8a 100644 (file)
@@ -1,5 +1,6 @@
 #include "e.h"
 #include "services/e_service_quickpanel.h"
+#include <Evas_GL.h>
 
 #define EHERR(f, hwc, x...)                                           \
    do                                                                 \
index 0b43419acdc9979e67ff61d860b7d57e9a9887a2..bcc4e5ebbb79ed4baf07d7565f1f3760d1f03994 100644 (file)
@@ -454,8 +454,6 @@ E_API Eina_Bool
 e_pixmap_refresh(E_Pixmap *cp)
 {
    E_Comp_Wl_Buffer *buffer;
-   struct wl_shm_buffer *shm_buffer;
-   int format;
    Eina_Bool success = EINA_FALSE;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
@@ -474,25 +472,10 @@ e_pixmap_refresh(E_Pixmap *cp)
    buffer = cp->buffer;
    if (!buffer) return EINA_FALSE;
 
-   shm_buffer = buffer->shm_buffer;
    cp->w = buffer->w;
    cp->h = buffer->h;
 
-   if (shm_buffer)
-     format = wl_shm_buffer_get_format(shm_buffer);
-   else if (buffer->tbm_surface)
-     format = tbm_surface_get_format(buffer->tbm_surface);
-   else if (e_comp->gl && buffer->resource)
-     e_comp_wl->wl.glapi->evasglQueryWaylandBuffer(e_comp_wl->wl.gl,
-                                                   buffer->resource,
-                                                   EVAS_GL_TEXTURE_FORMAT,
-                                                   &format);
-   else if (buffer->type == E_COMP_WL_BUFFER_TYPE_VIDEO)
-      format = 0;
-   else
-      return EINA_FALSE;
-
-   switch (format)
+   switch (buffer->format)
      {
       case WL_SHM_FORMAT_ARGB8888:
       case EGL_TEXTURE_RGBA: