discomfitor pushed a commit to branch master.

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

commit f92c2d2330fc168e9ec611d6808fe5849b24edf2
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Fri Apr 8 13:24:22 2016 -0500

    wayland_shm: Return buffer age from shm_surface_assign
    
    This makes refactoring the Surface abstraction a little easier.
---
 src/modules/evas/engines/wayland_shm/evas_engine.h | 2 +-
 src/modules/evas/engines/wayland_shm/evas_outbuf.c | 4 +---
 src/modules/evas/engines/wayland_shm/evas_shm.c    | 6 +++---
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h 
b/src/modules/evas/engines/wayland_shm/evas_engine.h
index 6bea9bc..daea5df 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.h
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.h
@@ -150,7 +150,7 @@ Shm_Surface *_evas_shm_surface_create(struct wl_display 
*disp, struct wl_shm *sh
 void _evas_shm_surface_destroy(Shm_Surface *surface);
 void _evas_shm_surface_reconfigure(Shm_Surface *surface, int dx, int dy, int 
w, int h, int num_buff, uint32_t flags);
 void *_evas_shm_surface_data_get(Shm_Surface *surface, int *w, int *h);
-Eina_Bool _evas_shm_surface_assign(Shm_Surface *surface);
+int _evas_shm_surface_assign(Shm_Surface *surface);
 void _evas_shm_surface_post(Shm_Surface *surface, Eina_Rectangle *rects, 
unsigned int count);
 
 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);
diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c 
b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
index 492607a..e03c1e2 100644
--- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
@@ -269,9 +269,7 @@ _evas_outbuf_swap_mode_get(Outbuf *ob)
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
-   if (!_evas_shm_surface_assign(ob->surface)) return MODE_FULL;
-
-   age = ob->surface->current->age;
+   age = _evas_shm_surface_assign(ob->surface);
    if (age > ob->surface->num_buff) return MODE_FULL;
    else if (age == 1) return MODE_COPY;
    else if (age == 2) return MODE_DOUBLE;
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c 
b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 22f3ec4..6fd8153 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -468,7 +468,7 @@ _evas_shm_surface_wait(Shm_Surface *surface)
    return NULL;
 }
 
-Eina_Bool
+int
 _evas_shm_surface_assign(Shm_Surface *surface)
 {
    int i;
@@ -487,7 +487,7 @@ _evas_shm_surface_assign(Shm_Surface *surface)
                   surface->leaf[i].age = 0;
                }
           }
-        return EINA_FALSE;
+        return 0;
      }
 
    /* Increment ages of all valid buffers */
@@ -504,7 +504,7 @@ _evas_shm_surface_assign(Shm_Surface *surface)
           }
      }
 
-   return EINA_TRUE;
+   return surface->current->age;
 }
 
 void *

-- 


Reply via email to