diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2016-04-12 13:03:37 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-04-19 15:11:09 -0400 |
commit | e5fb4cada756f0870745cc759045afd16404890d (patch) | |
tree | 3cd2dcf411a2177559517bf60e3eea2ec8bc4303 | |
parent | 405b278528305936cd173b2782c839b8f34a6064 (diff) | |
download | efl-e5fb4cada756f0870745cc759045afd16404890d.tar.gz |
wayland_shm: Gratuitous code simplification
Refactor evas_outbuf_setup a bit so there's only one call to
_evas_shm_surface_create.
Also makes the NULL return on unhandled rotation a lot more obvious.
-rw-r--r-- | src/modules/evas/engines/wayland_shm/evas_outbuf.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c b/src/modules/evas/engines/wayland_shm/evas_outbuf.c index ee9210d34a..606cac1a73 100644 --- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c @@ -14,6 +14,7 @@ _evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *info) { Outbuf *ob = NULL; char *num; + int sw, sh; LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -46,23 +47,25 @@ _evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *info) /* try to create the outbuf surface */ if ((ob->rotation == 0) || (ob->rotation == 180)) { - ob->surface = - _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; + sw = w; + sh = h; } else if ((ob->rotation == 90) || (ob->rotation == 270)) { - ob->surface = - _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; + sw = h; + sh = w; } + else goto unhandled_rotation; + ob->surface = _evas_shm_surface_create(info->info.wl_disp, + info->info.wl_shm, + info->info.wl_surface, + sw, sh, ob->num_buff, + info->info.destination_alpha, + info->info.compositor_version); + if (!ob->surface) goto surf_err; + +unhandled_rotation: eina_array_step_set(&ob->priv.onebuf_regions, sizeof(Eina_Array), 8); return ob; |