discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e5fb4cada756f0870745cc759045afd16404890d

commit e5fb4cada756f0870745cc759045afd16404890d
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Tue Apr 12 13:03:37 2016 -0500

    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.
---
 src/modules/evas/engines/wayland_shm/evas_outbuf.c | 27 ++++++++++++----------
 1 file 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 ee9210d..606cac1 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;

-- 


Reply via email to