[Extn_GL] Fix build error in other OS
authorsunghyun kim <scholb.kim@samsung.com>
Thu, 22 Dec 2016 06:38:15 +0000 (15:38 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 2 Jan 2017 07:27:05 +0000 (16:27 +0900)
fix build error in other OS ( such as MacOS, Window ..)

Extn_GL can't use without wayland_egl and tizen-remote-surface-client.
so add build define and check this in extn_gl feature.

Change-Id: I28b4b53e91b9f20f1e6f722900749427ade4f28e

configure.ac
src/Makefile_Ecore_Evas.am
src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h

index 647a56bc0bbd9ec1f25b7b2f749f106313c540bb..d3822d2bdcb4d818ac5bdb1878465489f7b7933e 100755 (executable)
@@ -4005,15 +4005,15 @@ want_ecore_evas_wayland_egl="${have_evas_engine_wayland_egl}"
 want_ecore_evas_tbm="${have_evas_engine_tbm}"
 want_ecore_evas_extn="yes"
 want_ecore_evas_drm="${have_evas_engine_drm}"
-want_remote_surface="no"
+want_ecore_evas_extn_gl="${have_evas_engine_wayland_egl}"
 
 if test "x${have_ecore_ipc}" = "xno" || \
    test "x${efl_func_shm_open}" = "xno" || \
    test "x${have_windows}" = "xyes" ; then
    want_ecore_evas_extn="no"
+   want_ecore_evas_extn_gl="no"
 fi
 
-want_remote_surface="${want_ecore_evas_extn}"
 build_ecore_evas_tbm="no"
 
 ### Checks for programs
@@ -4031,7 +4031,10 @@ EFL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [efl])
 EFL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [eo])
 EFL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [eina])
 EFL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [emile])
-EFL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [ecore-wayland])
+if test "x${want_wayland}" = "xyes"; then
+   EFL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [ecore-wayland])
+fi
+
 
 ## modules
 ECORE_EVAS_MODULE([extn], [${want_ecore_evas_extn}])
@@ -4047,7 +4050,7 @@ ECORE_EVAS_MODULE([opengl-cocoa], [${want_ecore_evas_gl_cocoa}])
 
 ECORE_EVAS_MODULE([software-sdl], [${want_sdl}])
 ECORE_EVAS_MODULE([opengl-sdl], [${want_gl_sdl}])
-ECORE_EVAS_MODULE([tizen-remote-surface-client],[${want_remote_surface}])
+ECORE_EVAS_MODULE([tizen-remote-surface-client],[${want_ecore_evas_extn_gl}])
 
 build_ecore_evas_sdl="no"
 if test "x${have_ecore_evas_software_sdl}" = "xyes" || \
@@ -4094,7 +4097,16 @@ fi
 AM_CONDITIONAL([BUILD_ECORE_EVAS_WIN32],
    [test "${build_ecore_evas_win32}" = "yes"])
 
-PKG_CHECK_MODULES([TIZEN_REMOTE_SURFACE], [tizen-remote-surface-client])
+build_ecore_evas_extn_gl="no"
+if test "${want_ecore_evas_extn_gl}" = "yes"; then
+   PKG_CHECK_MODULES([TIZEN_REMOTE_SURFACE], [tizen-remote-surface-client],
+   [
+      build_ecore_evas_extn_gl="yes"
+      AC_DEFINE(BUILD_TIZEN_REMOTE_SURFACE, 1, [Support Tizen remote surface])
+   ])
+fi
+AM_CONDITIONAL([BUILD_TIZEN_REMOTE_SURFACE],
+   [test "${build_ecore_evas_extn_gl}" = "yes"])
 
 # XXX TODO: ecore_evas_x11
 
index a27f5860e9ec9b3a706fcd90718fe7b76ce7b49d..703d3c557f2bfc83285762619a66291b37db4049 100755 (executable)
@@ -68,21 +68,29 @@ modules_ecore_evas_engines_extn_module_la_SOURCES = $(EXTNSOURCES)
 modules_ecore_evas_engines_extn_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
 @ECORE_EVAS_CFLAGS@ \
 @ECORE_IPC_CFLAGS@ \
-@TIZEN_REMOTE_SURFACE_CFLAGS@ \
 -I$(top_srcdir)/src/modules/evas/engines/buffer \
--I$(top_srcdir)/src/modules/evas/engines/wayland_egl \
 -I$(top_srcdir)/src/modules/ecore_evas/engines/extn
+
 modules_ecore_evas_engines_extn_module_la_LIBADD = \
 @USE_ECORE_EVAS_LIBS@ \
 @USE_ECORE_IPC_LIBS@ \
-@USE_ECORE_WAYLAND_LIBS@ \
-@TIZEN_REMOTE_SURFACE_LIBS@ \
 @SHM_LIBS@
+
 modules_ecore_evas_engines_extn_module_la_DEPENDENCIES = \
 @USE_ECORE_EVAS_INTERNAL_LIBS@ \
 @USE_ECORE_IPC_INTERNAL_LIBS@
 modules_ecore_evas_engines_extn_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
 modules_ecore_evas_engines_extn_module_la_LIBTOOLFLAGS = --tag=disable-static
+
+if BUILD_TIZEN_REMOTE_SURFACE
+modules_ecore_evas_engines_extn_module_la_CPPFLAGS += \
+@TIZEN_REMOTE_SURFACE_CFLAGS@ \
+-I$(top_srcdir)/src/modules/evas/engines/wayland_egl
+
+modules_ecore_evas_engines_extn_module_la_LIBADD += \
+@USE_ECORE_WAYLAND_LIBS@ \
+@TIZEN_REMOTE_SURFACE_LIBS@
+endif
 endif
 
 if BUILD_ECORE_EVAS_X11
index 4878c7f40d3344db84a4ced6f3a6b141438c9933..b428c63b63d636b93ebc5b408785458c12c8d635 100644 (file)
@@ -32,6 +32,8 @@ static Ecore_Evas_Interface_Extn *_ecore_evas_extn_interface_new(void);
 static void *_ecore_evas_socket_switch(void *data, void *dest_buf);
 
 /* Tizen Only : Callback function  & listener for tizen remote surface */
+
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
 // For Provider
 static void _ecore_evas_extn_rsp_cb_resource_id(void *data, struct tizen_remote_surface_provider *provider, uint32_t res_id);
 static void _ecore_evas_extn_rsp_cb_visibility(void *data, struct tizen_remote_surface_provider *provider, uint32_t visibility);
@@ -52,6 +54,7 @@ static const struct tizen_remote_surface_listener _ecore_evas_extn_gl_plug_liste
    _ecore_evas_extn_rs_cb_missing,
 };
 
+#endif
 /* Tizen Only : --- End */
 typedef struct _Extn Extn;
 
@@ -83,11 +86,14 @@ struct _Extn
    } profile;
 
    /* Tizen Only : for tizen remote surface */
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
    struct tizen_remote_surface_provider *tizen_rsp;
    struct wayland_tbm_client *tbm_client;
    struct tizen_remote_surface *tizen_rs;
    uint32_t resource_id;
+#endif
    int extn_type_client;
+
    /* Tizen Only : --- End */
 };
 
@@ -95,11 +101,14 @@ static Eina_List *extn_ee_list = NULL;
 
 /* Tizen Only : for tizen remote surface */
 /* local value for tizen remote manager */
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
 struct tizen_remote_surface_manager *tizen_rsm = NULL;
-static int extn_type = EXTN_TYPE_NONE;
 struct wl_buffer *pre_buffer; //pre_buffer for tizen remote surface
+#endif
+static int extn_type = EXTN_TYPE_NONE;
 
 /* Tizen Only : Callback function  & listener for tizen remote surface */
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
 static void _ecore_evas_extn_rsp_cb_resource_id(void *data, struct tizen_remote_surface_provider *provider, uint32_t res_id)
 {
    /* to get resource id of this remote surface */
@@ -214,7 +223,7 @@ _tizen_remote_surface_init(void)
 
    return EINA_TRUE;
 }
-
+#endif
 
 void
 _ecore_evas_extn_type_set(int type)
@@ -229,6 +238,7 @@ _ecore_evas_extn_type_get()
    if( extn_type != EXTN_TYPE_NONE)
      return extn_type;
 
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
    extn_type = EXTN_TYPE_SHM;
 
    engine = getenv("ECORE_EVAS_EXTN_SOCKET_ENGINE");
@@ -242,6 +252,10 @@ _ecore_evas_extn_type_get()
         else
            extn_type = EXTN_TYPE_SHM;
      }
+#else
+   extn_type = EXTN_TYPE_SHM;
+#endif
+
    return extn_type;
 }
 
@@ -376,6 +390,7 @@ _ecore_evas_extn_free(Ecore_Evas *ee)
              evas_object_image_pixels_dirty_set(bdata->image, EINA_TRUE);
           }
         bdata->pixels = NULL;
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
         if(extn->extn_type_client ==  EXTN_TYPE_WAYLAND_EGL)
           {
              extn->resource_id = NULL;
@@ -385,6 +400,7 @@ _ecore_evas_extn_free(Ecore_Evas *ee)
              if(tizen_rsm) tizen_remote_surface_manager_destroy(tizen_rsm);
           }
         else
+#endif
           {
              for (i = 0; i < NBUF; i++)
                {
@@ -1312,6 +1328,7 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
                 }
            }
          break;
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
       case OP_GL_REF:
            {
               // save resouce id
@@ -1354,6 +1371,7 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
               extn->extn_type_client = EXTN_TYPE_WAYLAND_EGL;
            }
          break;
+ #endif
       case OP_RESIZE:
          if ((e->data) && (e->size >= (int)sizeof(Ipc_Data_Resize)))
            {
@@ -1533,8 +1551,10 @@ _ecore_evas_extn_plug_connect(Ecore_Evas *ee, const char *svcname, int svcnum, E
    extn->svc.sys = svcsys;
 
    extn->extn_type_client = EXTN_TYPE_SHM;
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
    extn->tizen_rs = NULL;
    extn->tbm_client = NULL;
+#endif
 
    if (extn->svc.sys) ipctype = ECORE_IPC_LOCAL_SYSTEM;
    extn->ipc.server = ecore_ipc_server_connect(ipctype, (char *)extn->svc.name,
@@ -1582,6 +1602,7 @@ _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
    evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
    evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
    extn = bdata->data;
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
    if(_ecore_evas_extn_type_get() == EXTN_TYPE_WAYLAND_EGL)
      {
         if ( extn && extn->ipc.clients)
@@ -1601,6 +1622,9 @@ _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
           }
      }
    else if (extn)
+#else
+   if(extn)
+#endif
      {
         int i, last_try = 0;
 
@@ -1755,6 +1779,7 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
    if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
 
    cur_b = extn->cur_b;
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
    if( _ecore_evas_extn_type_get() == EXTN_TYPE_WAYLAND_EGL )
      {
         updates = evas_render_updates(ee->evas);
@@ -1767,6 +1792,7 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
           }
      }
    else
+#endif
      {
         if (bdata->pixels)
           {
@@ -1825,6 +1851,7 @@ _ipc_client_add(void *data, int type EINA_UNUSED, void *event)
 
    extn->ipc.clients = eina_list_append(extn->ipc.clients, e->client);
 
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
    if (_ecore_evas_extn_type_get() == EXTN_TYPE_WAYLAND_EGL)
      {
         INF("[EXTN_GL] send resouce id to client ( %dx%d,  resource_id:%u)",ee->w,ee->h,extn->resource_id);
@@ -1837,6 +1864,7 @@ _ipc_client_add(void *data, int type EINA_UNUSED, void *event)
                               0, 0, 0, &ipc, sizeof(ipc));
      }
    else
+#endif
      {
         for (i = 0; i < NBUF; i++)
           {
@@ -2180,6 +2208,7 @@ _ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
    extn = bdata->data;
    if (extn)
      {
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
         if (_ecore_evas_extn_type_get() == EXTN_TYPE_WAYLAND_EGL)
           {
              Evas_Engine_Info_Wayland_Egl *einfo;
@@ -2196,6 +2225,7 @@ _ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
                }
           }
         else
+#endif
           {
              Evas_Engine_Info_Buffer *einfo;
 
@@ -2375,6 +2405,7 @@ ecore_evas_extn_socket_new_internal(int w, int h)
    Ecore_Evas *ee;
    int rmethod;
 
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
    if (_ecore_evas_extn_type_get() == EXTN_TYPE_WAYLAND_EGL)
      {
         Ecore_Evas_Engine_Buffer_Data *bdata;
@@ -2402,6 +2433,7 @@ ecore_evas_extn_socket_new_internal(int w, int h)
                }
           }
      }
+#endif
 
    if (_ecore_evas_extn_type_get() == EXTN_TYPE_SHM)
      {
@@ -2519,8 +2551,9 @@ _ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum,
         extn->svc.name = eina_stringshare_add(svcname);
         extn->svc.num = svcnum;
         extn->svc.sys = svcsys;
-        extn->tizen_rsp = NULL;
 
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
+        extn->tizen_rsp = NULL;
         if (_ecore_evas_extn_type_get() == EXTN_TYPE_WAYLAND_EGL)
           {
              if (extn->svc.sys) ipctype = ECORE_IPC_LOCAL_SYSTEM;
@@ -2569,6 +2602,7 @@ _ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum,
                }
           }
         else
+#endif
           {
              for (i = 0; i < NBUF; i++)
                {
index 76400a7879513ec067ecf9e3bbbf253954785527..3f3bc117a6861bd47e65ed8f24bf9e56fffdfa42 100644 (file)
 #include <Ecore_Evas.h>
 #include <Ecore_Input.h>
 #include <Ecore_Ipc.h>
-#include <wayland-extension/tizen-remote-surface-client-protocol.h>
-#include <wayland-tbm-client.h>
-#include <Ecore_Wayland.h>
-#include <tbm_surface.h>
-#include <Evas_Engine_Wayland_Egl.h>
+#ifdef BUILD_TIZEN_REMOTE_SURFACE
+# include <wayland-extension/tizen-remote-surface-client-protocol.h>
+# include <wayland-tbm-client.h>
+# include <Ecore_Wayland.h>
+# include <tbm_surface.h>
+# include <Evas_Engine_Wayland_Egl.h>
+#endif
 
 #include "ecore_private.h" // FIXME: Because of ECORE_MAGIC
 #include "ecore_evas_private.h"