wayland_shm: Pass Evas_Engine_Info_Wayland_Shm directly to setup functions

We pretty much pass all its contents anyway.
This commit is contained in:
Derek Foreman 2016-04-12 12:39:45 -05:00 committed by Mike Blumenkrantz
parent 34e539a3c1
commit 405b278528
3 changed files with 22 additions and 34 deletions

View File

@ -27,8 +27,8 @@ struct _Render_Engine
};
/* LOCAL FUNCTIONS */
Render_Engine *
_render_engine_swapbuf_setup(int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface, struct wl_display *disp, int compositor_version)
static Render_Engine *
_render_engine_swapbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *einfo)
{
Render_Engine *re;
Outbuf *ob;
@ -40,8 +40,7 @@ _render_engine_swapbuf_setup(int w, int h, unsigned int rotation, unsigned int d
/* try to allocate space for new render engine */
if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
ob = _evas_outbuf_setup(w, h, rotation, depth, alpha, shm, surface, disp,
compositor_version);
ob = _evas_outbuf_setup(w, h, einfo);
if (!ob) goto err;
if (!evas_render_engine_software_generic_init(&re->generic, ob,
@ -151,14 +150,7 @@ eng_setup(Evas *eo_evas, void *info)
/* if we have no engine data, assume we have not initialized yet */
evas_common_init();
re = _render_engine_swapbuf_setup(epd->output.w, epd->output.h,
einfo->info.rotation,
einfo->info.depth,
einfo->info.destination_alpha,
einfo->info.wl_shm,
einfo->info.wl_surface,
einfo->info.wl_disp,
einfo->info.compositor_version);
re = _render_engine_swapbuf_setup(epd->output.w, epd->output.h, einfo);
if (re)
re->generic.ob->info = einfo;
@ -169,19 +161,10 @@ eng_setup(Evas *eo_evas, void *info)
{
Outbuf *ob;
ob = _evas_outbuf_setup(epd->output.w, epd->output.h,
einfo->info.rotation, einfo->info.depth,
einfo->info.destination_alpha,
einfo->info.wl_shm, einfo->info.wl_surface,
einfo->info.wl_disp,
einfo->info.compositor_version);
if (ob)
{
ob->info = einfo;
evas_render_engine_software_generic_update(&re->generic, ob,
epd->output.w,
epd->output.h);
}
ob = _evas_outbuf_setup(epd->output.w, epd->output.h, einfo);
if (ob) evas_render_engine_software_generic_update(&re->generic, ob,
epd->output.w,
epd->output.h);
}
epd->engine.data.output = re;

View File

@ -127,7 +127,7 @@ struct _Outbuf
Surface *_evas_shm_surface_create(struct wl_display *disp, struct wl_shm *shm, struct wl_surface *surface, int w, int h, int num_buff, Eina_Bool alpha, int compositor_version);
Outbuf *_evas_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface, struct wl_display *disp, int compositor_version);
Outbuf *_evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *info);
void _evas_outbuf_free(Outbuf *ob);
void _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode);
void _evas_outbuf_idle_flush(Outbuf *ob);

View File

@ -10,7 +10,7 @@
#define BLUE_MASK 0x0000ff
Outbuf *
_evas_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface, struct wl_display *disp, int compositor_version)
_evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *info)
{
Outbuf *ob = NULL;
char *num;
@ -23,9 +23,10 @@ _evas_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, s
/* set outbuf properties */
ob->w = w;
ob->h = h;
ob->rotation = rot;
ob->depth = depth;
ob->priv.destination_alpha = alpha;
ob->info = info;
ob->rotation = info->info.rotation;
ob->depth = info->info.depth;
ob->priv.destination_alpha = info->info.destination_alpha;
/* default to double buffer */
ob->num_buff = 2;
@ -46,15 +47,19 @@ _evas_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, s
if ((ob->rotation == 0) || (ob->rotation == 180))
{
ob->surface =
_evas_shm_surface_create(disp, shm, surface, w, h, ob->num_buff,
alpha, compositor_version);
_evas_shm_surface_create(info->info.wl_disp, info->info.wl_shm,
info->info.wl_surface, w, h, ob->num_buff,
info->info.destination_alpha,
info->info.compositor_version);
if (!ob->surface) goto surf_err;
}
else if ((ob->rotation == 90) || (ob->rotation == 270))
{
ob->surface =
_evas_shm_surface_create(disp, shm, surface, h, w, ob->num_buff,
alpha, compositor_version);
_evas_shm_surface_create(info->info.wl_disp, info->info.wl_shm,
info->info.wl_surface, h, w, ob->num_buff,
info->info.destination_alpha,
info->info.compositor_version);
if (!ob->surface) goto surf_err;
}