devilhorns pushed a commit to branch master.

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

commit f2caeff9c24c81d7bc0a72a29a48c7875f12bde4
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Tue Jul 28 09:13:16 2015 -0400

    wayland_shm: Don't store frame_cb
    
    Summary:
    We don't need to - all the frame callback does for us is ensure a queue
    push.
    
    We should destroy any callback we receive when we receive it.
    
    @fix
    
    Reviewers: zmike, devilhorns
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D2874
---
 src/modules/evas/engines/wayland_shm/evas_engine.h |  2 --
 src/modules/evas/engines/wayland_shm/evas_shm.c    | 15 +++------------
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h 
b/src/modules/evas/engines/wayland_shm/evas_engine.h
index e9ea18d..50def53 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.h
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.h
@@ -75,7 +75,6 @@ struct _Shm_Surface
 {
    struct wl_shm *shm;
    struct wl_surface *surface;
-   struct wl_callback *frame_cb;
    uint32_t flags;
    int w, h;
    int dx, dy;
@@ -86,7 +85,6 @@ struct _Shm_Surface
    Shm_Leaf leaf[MAX_BUFFERS];
    Shm_Leaf *current;
 
-   Eina_Bool redraw : 1;
    Eina_Bool alpha : 1;
    Eina_Bool mapped : 1;
 };
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c 
b/src/modules/evas/engines/wayland_shm/evas_shm.c
index f483823..c6f63a9 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -142,11 +142,8 @@ _shm_frame_release(void *data, struct wl_callback 
*callback, uint32_t timestamp
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    if (!(surf = data)) return;
-   if (callback != surf->frame_cb) return;
 
-   wl_callback_destroy(surf->frame_cb);
-   surf->frame_cb = NULL;
-   surf->redraw = EINA_FALSE;
+   wl_callback_destroy(callback);
 }
 
 static const struct wl_callback_listener _shm_frame_listener = 
@@ -443,7 +440,6 @@ _evas_shm_surface_swap(Shm_Surface *surface, Eina_Rectangle 
*rects, unsigned int
 
    surface->dx = 0;
    surface->dy = 0;
-   surface->redraw = EINA_TRUE;
    surface->mapped = EINA_TRUE;
 }
 
@@ -491,16 +487,11 @@ _evas_shm_surface_redraw(Shm_Surface *surface)
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
-   if (surface->frame_cb)
-     {
-        if (!surface->redraw) return;
-        wl_callback_destroy(surface->frame_cb);
-     }
 
    if (!surface->surface) return;
 
-   surface->frame_cb = wl_surface_frame(surface->surface);
-   wl_callback_add_listener(surface->frame_cb, &_shm_frame_listener, surface);
+   frame_cb = wl_surface_frame(surface->surface);
+   wl_callback_add_listener(frame_cb, &_shm_frame_listener, surface);
 
    wl_surface_commit(surface->surface);
 

-- 


Reply via email to