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 */ /* LOCAL FUNCTIONS */
Render_Engine * static 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) _render_engine_swapbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *einfo)
{ {
Render_Engine *re; Render_Engine *re;
Outbuf *ob; 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 */ /* try to allocate space for new render engine */
if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
ob = _evas_outbuf_setup(w, h, rotation, depth, alpha, shm, surface, disp, ob = _evas_outbuf_setup(w, h, einfo);
compositor_version);
if (!ob) goto err; if (!ob) goto err;
if (!evas_render_engine_software_generic_init(&re->generic, ob, 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 */ /* if we have no engine data, assume we have not initialized yet */
evas_common_init(); evas_common_init();
re = _render_engine_swapbuf_setup(epd->output.w, epd->output.h, re = _render_engine_swapbuf_setup(epd->output.w, epd->output.h, einfo);
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 (re) if (re)
re->generic.ob->info = einfo; re->generic.ob->info = einfo;
@ -169,19 +161,10 @@ eng_setup(Evas *eo_evas, void *info)
{ {
Outbuf *ob; Outbuf *ob;
ob = _evas_outbuf_setup(epd->output.w, epd->output.h, ob = _evas_outbuf_setup(epd->output.w, epd->output.h, einfo);
einfo->info.rotation, einfo->info.depth, if (ob) evas_render_engine_software_generic_update(&re->generic, ob,
einfo->info.destination_alpha, epd->output.w,
einfo->info.wl_shm, einfo->info.wl_surface, epd->output.h);
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);
}
} }
epd->engine.data.output = re; 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); 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_free(Outbuf *ob);
void _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode); void _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode);
void _evas_outbuf_idle_flush(Outbuf *ob); void _evas_outbuf_idle_flush(Outbuf *ob);

View File

@ -10,7 +10,7 @@
#define BLUE_MASK 0x0000ff #define BLUE_MASK 0x0000ff
Outbuf * 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; Outbuf *ob = NULL;
char *num; 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 */ /* set outbuf properties */
ob->w = w; ob->w = w;
ob->h = h; ob->h = h;
ob->rotation = rot; ob->info = info;
ob->depth = depth; ob->rotation = info->info.rotation;
ob->priv.destination_alpha = alpha; ob->depth = info->info.depth;
ob->priv.destination_alpha = info->info.destination_alpha;
/* default to double buffer */ /* default to double buffer */
ob->num_buff = 2; 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)) if ((ob->rotation == 0) || (ob->rotation == 180))
{ {
ob->surface = ob->surface =
_evas_shm_surface_create(disp, shm, surface, w, h, ob->num_buff, _evas_shm_surface_create(info->info.wl_disp, info->info.wl_shm,
alpha, compositor_version); info->info.wl_surface, w, h, ob->num_buff,
info->info.destination_alpha,
info->info.compositor_version);
if (!ob->surface) goto surf_err; if (!ob->surface) goto surf_err;
} }
else if ((ob->rotation == 90) || (ob->rotation == 270)) else if ((ob->rotation == 90) || (ob->rotation == 270))
{ {
ob->surface = ob->surface =
_evas_shm_surface_create(disp, shm, surface, h, w, ob->num_buff, _evas_shm_surface_create(info->info.wl_disp, info->info.wl_shm,
alpha, compositor_version); info->info.wl_surface, h, w, ob->num_buff,
info->info.destination_alpha,
info->info.compositor_version);
if (!ob->surface) goto surf_err; if (!ob->surface) goto surf_err;
} }