wayland evas engines: share engine info structure

These engines are incredibly similar - by sharing the same engine info
structure we'll be able to simplify the wayland ecore_evas bits and
make them much more maintainable.
This commit is contained in:
Derek Foreman 2016-11-01 15:46:35 -05:00
parent 55de5c61cd
commit af4a71bcf0
13 changed files with 95 additions and 105 deletions

View File

@ -2710,6 +2710,19 @@ fi
AM_CONDITIONAL([EVAS_STATIC_BUILD_GL_COMMON], [test "x${have_static_evas_engine_gl_common}" = "xyes"])
have_evas_engine_wayland_common="no"
if test "x$have_evas_engine_wayland_egl" = "xstatic" || \
test "x$have_evas_engine_wayland_shm" = "xstatic" || \
test "x$have_evas_engine_wayland_egl" = "xyes" || \
test "x$have_evas_engine_wayland_shm" = "xyes"; then
have_evas_engine_wayland_common="yes"
fi
if test "x$have_evas_engine_wayland_common" = "xyes"; then
AC_DEFINE([BUILD_ENGINE_WAYLAND_COMMON], [1], [Building any wayland evas engine])
fi
AM_CONDITIONAL([BUILD_ENGINE_WAYLAND_COMMON], [test "x${have_evas_engine_wayland_common}" = "xyes"])
## Vg Loaders
EVAS_CHECK_VG_LOADER([SVG], [${want_evas_vg_loader_svg}])

View File

@ -189,6 +189,7 @@ modules_ecore_evas_engines_wayland_module_la_CPPFLAGS = -I$(top_builddir)/src/li
@ECORE_WL2_CFLAGS@ \
-I$(top_srcdir)/src/modules/evas/engines/wayland_shm \
-I$(top_srcdir)/src/modules/evas/engines/wayland_egl \
-I$(top_srcdir)/src/modules/evas/engines/wayland_common \
@ECORE_WAYLAND_CFLAGS@ \
@ECORE_WL2_CFLAGS@
modules_ecore_evas_engines_wayland_module_la_LIBADD = \

View File

@ -1207,8 +1207,11 @@ modules_evas_engines_software_x11_module_la_LIBTOOLFLAGS = --tag=disable-static
endif
endif
if BUILD_ENGINE_WAYLAND_COMMON
dist_installed_evasmainheaders_DATA += modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
endif
if BUILD_ENGINE_WAYLAND_EGL
dist_installed_evasmainheaders_DATA += modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
WAYLAND_EGL_SOURCES = \
modules/evas/engines/wayland_egl/evas_engine.c \
modules/evas/engines/wayland_egl/evas_wl_main.c \
@ -1231,6 +1234,7 @@ modules_evas_engines_wayland_egl_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/
-I$(top_srcdir)/src/lib/evas/include \
-I$(top_srcdir)/src/lib/evas/cserve2 \
-I$(top_srcdir)/src/modules/evas/engines/wayland_egl \
-I$(top_srcdir)/src/modules/evas/engines/wayland_common \
@EVAS_CFLAGS@ \
@evas_engine_wayland_egl_cflags@
modules_evas_engines_wayland_egl_module_la_LIBADD = \
@ -1243,9 +1247,8 @@ endif
endif
if BUILD_ENGINE_WAYLAND_SHM
dist_installed_evasmainheaders_DATA += modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h
WAYLAND_SHM_SOURCES = \
modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h \
modules/evas/engines/wayland_common/Evas_Engine_Wayland.h \
modules/evas/engines/wayland_shm/evas_engine.c \
modules/evas/engines/wayland_shm/evas_engine.h \
modules/evas/engines/wayland_shm/evas_shm.c \
@ -1280,6 +1283,7 @@ modules_evas_engines_wayland_shm_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/
-I$(top_srcdir)/src/lib/evas/cserve2 \
-I$(top_srcdir)/src/lib/ecore_wl2 \
-I$(top_srcdir)/src/static_libs/libdrm \
-I$(top_srcdir)/src/modules/evas/engines/wayland_common \
@EVAS_CFLAGS@ \
@evas_engine_wayland_shm_cflags@
modules_evas_engines_wayland_shm_module_la_LIBADD = \

View File

@ -6,7 +6,7 @@
# include <unistd.h>
# include <sys/types.h>
# include <sys/mman.h>
# include <Evas_Engine_Wayland_Egl.h>
# include <Evas_Engine_Wayland.h>
#ifdef EAPI
# undef EAPI
@ -124,10 +124,10 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
void
_ee_egl_display_unset(Ecore_Evas *ee)
{
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
einfo->info.wl_display = NULL;
wdata = ee->engine.data;
wdata->regen_objs = _evas_canvas_image_data_unset(ecore_evas_get(ee));
@ -138,7 +138,7 @@ static Eina_Bool
_ee_cb_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
{
Ecore_Evas *ee;
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
ee = data;
@ -146,7 +146,7 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
if (wdata->sync_done) return ECORE_CALLBACK_PASS_ON;
wdata->sync_done = EINA_TRUE;
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
einfo->info.wl_display = ecore_wl2_display_get(wdata->display);
einfo->info.destination_alpha = EINA_TRUE;
@ -187,7 +187,7 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
if (wdata->win)
{
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
if (einfo)
{
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w + fw, ee->h + fh);
@ -221,11 +221,11 @@ static void
_ecore_evas_wl_egl_render_flush_pre(void *data, Evas *e, void *event_info EINA_UNUSED)
{
Ecore_Evas *ee = data;
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
int fx, fy;
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(e);
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(e);
wdata = ee->engine.data;
einfo->window.x = wdata->win->geometry.x;
einfo->window.y = wdata->win->geometry.y;
@ -263,7 +263,7 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
{
Ecore_Wl2_Display *ewd;
Ecore_Wl2_Window *p = NULL;
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Interface_Wayland *iface;
Ecore_Evas_Engine_Wl_Data *wdata;
Ecore_Evas *ee = NULL;
@ -389,7 +389,7 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
if (ewd->sync_done)
{
wdata->sync_done = EINA_TRUE;
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
einfo->info.wl_display = ecore_wl2_display_get(ewd);
einfo->info.destination_alpha = EINA_TRUE;
@ -452,7 +452,7 @@ conn_err:
static void
_ecore_evas_wl_rotation_set(Ecore_Evas *ee, int rotation, int resize)
{
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -460,7 +460,7 @@ _ecore_evas_wl_rotation_set(Ecore_Evas *ee, int rotation, int resize)
_ecore_evas_wl_common_rotation_set(ee, rotation, resize);
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
if (!einfo) return;
einfo->info.rotation = rotation;
@ -472,7 +472,7 @@ _ecore_evas_wl_rotation_set(Ecore_Evas *ee, int rotation, int resize)
static void
_ecore_evas_wl_show(Ecore_Evas *ee)
{
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
int fw, fh;
@ -494,7 +494,7 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
ecore_wl2_window_show(wdata->win);
ecore_wl2_window_alpha_set(wdata->win, ee->alpha);
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
if (einfo)
{
struct wl_surface *surf;
@ -531,7 +531,7 @@ static void
_ecore_evas_wl_hide(Ecore_Evas *ee)
{
Ecore_Evas_Engine_Wl_Data *wdata;
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -540,7 +540,7 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
evas_sync(ee->evas);
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
if (einfo)
{
einfo->info.wl_surface = NULL;
@ -567,7 +567,7 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
static void
_ecore_evas_wayland_egl_alpha_do(Ecore_Evas *ee, int alpha)
{
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
int fw, fh;
@ -583,7 +583,7 @@ _ecore_evas_wayland_egl_alpha_do(Ecore_Evas *ee, int alpha)
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
einfo->info.destination_alpha = EINA_TRUE;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
@ -608,7 +608,7 @@ _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
static void
_ecore_evas_wayland_egl_transparent_do(Ecore_Evas *ee, int transparent)
{
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
int fw, fh;
@ -626,7 +626,7 @@ _ecore_evas_wayland_egl_transparent_do(Ecore_Evas *ee, int transparent)
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
einfo->info.destination_alpha = EINA_TRUE;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
@ -671,9 +671,9 @@ _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
void
_ecore_evas_wayland_egl_resize_edge_set(Ecore_Evas *ee, int edge)
{
Evas_Engine_Info_Wayland_Egl *einfo;
Evas_Engine_Info_Wayland *einfo;
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
einfo->info.edges = edge;
}

View File

@ -1,7 +1,7 @@
#include "ecore_evas_wayland_private.h"
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
# include <Evas_Engine_Wayland_Shm.h>
# include <Evas_Engine_Wayland.h>
# include <stdlib.h>
# include <string.h>
# include <unistd.h>
@ -122,7 +122,7 @@ static Eina_Bool
_ee_cb_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
{
Ecore_Evas *ee;
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
ee = data;
@ -130,7 +130,7 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
if (wdata->sync_done) return ECORE_CALLBACK_PASS_ON;
wdata->sync_done = EINA_TRUE;
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
ecore_evas_manual_render_set(ee, 0);
einfo->info.wl_display = ecore_wl2_display_get(wdata->display);
@ -193,7 +193,7 @@ ecore_evas_wayland_shm_new_internal(const char *disp_name, unsigned int parent,
{
Ecore_Wl2_Display *ewd;
Ecore_Wl2_Window *p = NULL;
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
Ecore_Evas_Interface_Wayland *iface;
Ecore_Evas *ee;
@ -314,7 +314,7 @@ ecore_evas_wayland_shm_new_internal(const char *disp_name, unsigned int parent,
if (ewd->sync_done)
{
wdata->sync_done = EINA_TRUE;
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
einfo->info.wl_display = ecore_wl2_display_get(ewd);
einfo->info.wl_dmabuf = ecore_wl2_display_dmabuf_get(ewd);
@ -381,7 +381,7 @@ conn_err:
static void
_ecore_evas_wl_rotation_set(Ecore_Evas *ee, int rotation, int resize)
{
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -389,7 +389,7 @@ _ecore_evas_wl_rotation_set(Ecore_Evas *ee, int rotation, int resize)
_ecore_evas_wl_common_rotation_set(ee, rotation, resize);
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
if (!einfo) return;
einfo->info.rotation = rotation;
@ -401,7 +401,7 @@ _ecore_evas_wl_rotation_set(Ecore_Evas *ee, int rotation, int resize)
static void
_ecore_evas_wl_show(Ecore_Evas *ee)
{
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
int fw, fh;
@ -423,7 +423,7 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
ecore_wl2_window_show(wdata->win);
ecore_wl2_window_alpha_set(wdata->win, ee->alpha);
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
if (einfo)
{
struct wl_surface *surf;
@ -458,7 +458,7 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
static void
_ecore_evas_wl_hide(Ecore_Evas *ee)
{
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -468,7 +468,7 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
evas_sync(ee->evas);
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
if (einfo)
{
einfo->info.wl_surface = NULL;
@ -498,7 +498,7 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
void
_ecore_evas_wayland_shm_alpha_do(Ecore_Evas *ee, int alpha)
{
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
int fw, fh;
@ -514,7 +514,7 @@ _ecore_evas_wayland_shm_alpha_do(Ecore_Evas *ee, int alpha)
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
einfo->info.destination_alpha = EINA_TRUE;//ee->alpha;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
@ -538,7 +538,7 @@ _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
void
_ecore_evas_wayland_shm_transparent_do(Ecore_Evas *ee, int transparent)
{
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
Ecore_Evas_Engine_Wl_Data *wdata;
int fw, fh;
@ -556,7 +556,7 @@ _ecore_evas_wayland_shm_transparent_do(Ecore_Evas *ee, int transparent)
evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
einfo->info.destination_alpha = EINA_TRUE;//ee->transparent;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
@ -600,9 +600,9 @@ _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location)
void
_ecore_evas_wayland_shm_resize_edge_set(Ecore_Evas *ee, int edge)
{
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
einfo->info.edges = edge;
}

View File

@ -1,25 +1,30 @@
#ifndef _EVAS_ENGINE_WAYLAND_EGL_H
# define _EVAS_ENGINE_WAYLAND_EGL_H
#ifndef _EVAS_ENGINE_WAYLAND_COMMON_H
# define _EVAS_ENGINE_WAYLAND_COMMON_H
typedef struct _Evas_Engine_Info_Wayland_Egl Evas_Engine_Info_Wayland_Egl;
typedef struct _Evas_Engine_Info_Wayland Evas_Engine_Info_Wayland;
struct _Evas_Engine_Info_Wayland_Egl
struct _Evas_Engine_Info_Wayland
{
/* PRIVATE - don't mess with this baby or evas will poke its tongue out
* at you and make nasty noises */
Evas_Engine_Info magic;
/* engine specific data & parameters it needs to set up */
struct
struct
{
/* the wayland shm object used to create new shm pool */
struct wl_shm *wl_shm;
struct zwp_linux_dmabuf_v1 *wl_dmabuf;
struct wl_display *wl_display;
struct wl_surface *wl_surface;
int depth, rotation, edges;
unsigned int destination_alpha : 1;
int compositor_version;
Eina_Bool destination_alpha : 1;
} info;
/* non-blocking or blocking mode */
Evas_Engine_Render_Mode render_mode;
Evas *evas;
Eina_Bool vsync : 1;
Eina_Bool indirect : 1;

View File

@ -503,10 +503,10 @@ static const EVGL_Interface evgl_funcs =
static void *
eng_info(Evas *evas EINA_UNUSED)
{
Evas_Engine_Info_Wayland_Egl *info;
Evas_Engine_Info_Wayland *info;
/* try to allocate space for our engine info */
if (!(info = calloc(1, sizeof(Evas_Engine_Info_Wayland_Egl))))
if (!(info = calloc(1, sizeof(Evas_Engine_Info_Wayland))))
return NULL;
info->magic.magic = rand();
@ -518,9 +518,9 @@ eng_info(Evas *evas EINA_UNUSED)
static void
eng_info_free(Evas *evas EINA_UNUSED, void *info)
{
Evas_Engine_Info_Wayland_Egl *inf;
Evas_Engine_Info_Wayland *inf;
if ((inf = (Evas_Engine_Info_Wayland_Egl *)info))
if ((inf = (Evas_Engine_Info_Wayland *)info))
free(inf);
}
@ -528,13 +528,13 @@ static int
eng_setup(Evas *evas, void *info)
{
Render_Engine_Swap_Mode swap_mode = MODE_FULL;
Evas_Engine_Info_Wayland_Egl *inf;
Evas_Engine_Info_Wayland *inf;
Evas_Public_Data *epd;
Render_Engine *re;
Outbuf *ob;
const char *s;
inf = (Evas_Engine_Info_Wayland_Egl *)info;
inf = (Evas_Engine_Info_Wayland *)info;
epd = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
if ((s = getenv("EVAS_GL_SWAP_MODE")))

View File

@ -5,7 +5,7 @@
# include "evas_common_private.h"
# include "evas_private.h"
# include "Evas.h"
# include "Evas_Engine_Wayland_Egl.h"
# include "Evas_Engine_Wayland.h"
/* NB: This already includes wayland-client.h */
# include <wayland-egl.h>
@ -62,7 +62,7 @@ struct _Outbuf
int depth, screen, rot, alpha;
Evas *evas;
Evas_Engine_Info_Wayland_Egl *info;
Evas_Engine_Info_Wayland *info;
Evas_Engine_GL_Context *gl_context;
Render_Engine_Swap_Mode swap_mode;
@ -107,7 +107,7 @@ extern Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_unlock;
extern unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c);
extern unsigned int (*glsym_eglSetDamageRegionKHR) (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d);
Outbuf *eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode);
Outbuf *eng_window_new(Evas *evas, Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode);
void eng_window_free(Outbuf *gw);
void eng_window_use(Outbuf *gw);
void eng_window_unsurf(Outbuf *gw);

View File

@ -9,7 +9,7 @@ static struct wl_display *display = NULL;
static int win_count = 0;
Outbuf *
eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode)
eng_window_new(Evas *evas, Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode)
{
Outbuf *gw;
int context_attrs[3];

View File

@ -1,33 +0,0 @@
#ifndef _EVAS_ENGINE_WAYLAND_SHM_H
# define _EVAS_ENGINE_WAYLAND_SHM_H
typedef struct _Evas_Engine_Info_Wayland_Shm Evas_Engine_Info_Wayland_Shm;
struct _Evas_Engine_Info_Wayland_Shm
{
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
/* at you and make nasty noises */
Evas_Engine_Info magic;
/* engine specific data and parameters for setup */
struct
{
/* the wayland shm object used to create new shm pool */
struct wl_shm *wl_shm;
struct zwp_linux_dmabuf_v1 *wl_dmabuf;
struct wl_surface *wl_surface;
unsigned int rotation, depth;
Eina_Bool destination_alpha : 1;
int edges;
struct wl_display *wl_display;
int compositor_version;
} info;
/* non-blocking or blocking mode */
Evas_Engine_Render_Mode render_mode;
Evas *evas;
};
#endif

View File

@ -29,7 +29,7 @@ struct _Render_Engine
/* LOCAL FUNCTIONS */
static Render_Engine *
_render_engine_swapbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *einfo)
_render_engine_swapbuf_setup(int w, int h, Evas_Engine_Info_Wayland *einfo)
{
Render_Engine *re;
Outbuf *ob;
@ -103,12 +103,12 @@ _symbols(void)
static void *
eng_info(Evas *eo_evas EINA_UNUSED)
{
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
/* try to allocate space for new engine info */
if (!(einfo = calloc(1, sizeof(Evas_Engine_Info_Wayland_Shm))))
if (!(einfo = calloc(1, sizeof(Evas_Engine_Info_Wayland))))
return NULL;
/* fill in engine info */
@ -123,26 +123,26 @@ eng_info(Evas *eo_evas EINA_UNUSED)
static void
eng_info_free(Evas *eo_evas EINA_UNUSED, void *info)
{
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
/* try to free previously allocated engine info */
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)info))
if ((einfo = (Evas_Engine_Info_Wayland *)info))
free(einfo);
}
static int
eng_setup(Evas *eo_evas, void *info)
{
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
Evas_Public_Data *epd;
Render_Engine *re = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
/* try to cast to our engine info */
if (!(einfo = (Evas_Engine_Info_Wayland_Shm *)info))
if (!(einfo = (Evas_Engine_Info_Wayland *)info))
return 0;
/* try to get evas public data */
@ -210,7 +210,7 @@ static void
eng_output_resize(void *data, int w, int h)
{
Render_Engine *re;
Evas_Engine_Info_Wayland_Shm *einfo;
Evas_Engine_Info_Wayland *einfo;
Eina_Bool resize = EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);

View File

@ -68,7 +68,7 @@ extern int _evas_engine_way_shm_log_dom;
# include <wayland-client.h>
# include "linux-dmabuf-unstable-v1-client-protocol.h"
# include "../software_generic/Evas_Engine_Software_Generic.h"
# include "Evas_Engine_Wayland_Shm.h"
# include "Evas_Engine_Wayland.h"
# define MAX_BUFFERS 4
@ -92,7 +92,7 @@ struct _Surface
Shm_Surface *shm;
Dmabuf_Surface *dmabuf;
} surf;
Evas_Engine_Info_Wayland_Shm *info;
Evas_Engine_Info_Wayland *info;
struct
{
void (*destroy)(Surface *surface);
@ -111,7 +111,7 @@ struct _Outbuf
int num_buff;
Outbuf_Depth depth;
Evas_Engine_Info_Wayland_Shm *info;
Evas_Engine_Info_Wayland *info;
Surface *surface;
@ -138,7 +138,7 @@ struct _Outbuf
Eina_Bool _evas_dmabuf_surface_create(Surface *s, int w, int h, int num_buff);
Eina_Bool _evas_shm_surface_create(Surface *s, int w, int h, int num_buff);
Outbuf *_evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *info);
Outbuf *_evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland *info);
void _evas_outbuf_free(Outbuf *ob);
void _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode);
void _evas_outbuf_idle_flush(Outbuf *ob);

View File

@ -21,7 +21,7 @@ _evas_surface_init(Surface *s, int w, int h, int num_buf)
}
static Surface *
_evas_surface_create(Evas_Engine_Info_Wayland_Shm *info, int w, int h, int num_buf)
_evas_surface_create(Evas_Engine_Info_Wayland *info, int w, int h, int num_buf)
{
Surface *out;
@ -37,7 +37,7 @@ _evas_surface_create(Evas_Engine_Info_Wayland_Shm *info, int w, int h, int num_b
}
Outbuf *
_evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *info)
_evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland *info)
{
Outbuf *ob = NULL;
char *num;