From 1bdec451b065fadbe537fd33097ad175f4249c6d Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Thu, 9 Jul 2020 17:26:53 +0900 Subject: [PATCH] e_comp_wl: remove include Evas_GL.h in header file 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 | 94 ++++++++++++++++++++++++++++++--------------- src/bin/e_comp_wl.h | 11 ++---- src/bin/e_hwc.c | 1 + src/bin/e_pixmap.c | 19 +-------- 4 files changed, 70 insertions(+), 55 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 1537d05077..84b8846a13 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -2,6 +2,7 @@ #include #include +#include /* 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 diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index ac95bd0140..b3621f0378 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -32,7 +32,6 @@ typedef struct _E_Comp_Wl_Pid_Hook E_Comp_Wl_Pid_Hook; (type *)( (char *)__mptr - offsetof(type,member) ); \ }) -#include #include #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 diff --git a/src/bin/e_hwc.c b/src/bin/e_hwc.c index 34c70433c9..3726f9be61 100644 --- a/src/bin/e_hwc.c +++ b/src/bin/e_hwc.c @@ -1,5 +1,6 @@ #include "e.h" #include "services/e_service_quickpanel.h" +#include #define EHERR(f, hwc, x...) \ do \ diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index 0b43419acd..bcc4e5ebbb 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -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: -- 2.34.1