summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-04-12 13:03:37 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-04-19 15:11:09 -0400
commite5fb4cada756f0870745cc759045afd16404890d (patch)
tree3cd2dcf411a2177559517bf60e3eea2ec8bc4303
parent405b278528305936cd173b2782c839b8f34a6064 (diff)
downloadefl-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.c27
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;