devilhorns pushed a commit to branch master.

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

commit 43ddf5b69d3a5ee9d86063d84bf433c0553badeb
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Mon Jul 27 15:53:02 2015 -0400

    evas-wayland-shm: Don't call surface commit until we've setup the frame 
listener
    
    Summary: This fixes an issue where we may been missing a frame
    callback due to the wl_surface_commit being called before the frame
    callback listener was setup. Now we will setup the frame callback
    listener before doing any wl_surface_commit so that we don't miss
    frames.
    
    @fix
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/modules/evas/engines/wayland_shm/evas_outbuf.c |  8 ++++----
 src/modules/evas/engines/wayland_shm/evas_shm.c    | 13 ++++++++++---
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c 
b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
index 7571566..3d3bea8 100644
--- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
@@ -162,11 +162,11 @@ _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects 
EINA_UNUSED, Evas_Render_Mode
         EINA_ARRAY_ITER_NEXT(&ob->priv.onebuf_regions, i, rect, it)
           result[i] = *rect;
 
-        _evas_shm_surface_redraw(ob->surface);
-
         /* force a buffer swap */
         _evas_shm_surface_swap(ob->surface, result, n);
 
+        _evas_shm_surface_redraw(ob->surface);
+
         /* clean array */
         eina_array_clean(&ob->priv.onebuf_regions);
 
@@ -247,10 +247,10 @@ _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects 
EINA_UNUSED, Evas_Render_Mode
              i++;
           }
 
-        _evas_shm_surface_redraw(ob->surface);
-
         /* force a buffer swap */
         _evas_shm_surface_swap(ob->surface, result, n);
+
+        _evas_shm_surface_redraw(ob->surface);
      }
 }
 
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c 
b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 724f42c..f483823 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -62,6 +62,9 @@ _shm_pool_make(struct wl_shm *shm, int size, void **data)
         goto fd_err;
      }
 
+   /* NB: Commented out. Used for debugging rendering issues */
+   /* memset(*data, 127, size); */
+
    /* create wl_shm_pool using fd */
    pool = wl_shm_create_pool(shm, fd, size);
 
@@ -438,9 +441,6 @@ _evas_shm_surface_swap(Shm_Surface *surface, Eina_Rectangle 
*rects, unsigned int
    else
      wl_surface_damage(surface->surface, 0, 0, leaf->w, leaf->h);
 
-   wl_surface_commit(surface->surface);
-
-   leaf->busy = 1;
    surface->dx = 0;
    surface->dy = 0;
    surface->redraw = EINA_TRUE;
@@ -487,6 +487,8 @@ _evas_shm_surface_data_get(Shm_Surface *surface, int *w, 
int *h)
 void 
 _evas_shm_surface_redraw(Shm_Surface *surface)
 {
+   Shm_Leaf *leaf = NULL;
+
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    if (surface->frame_cb)
@@ -499,4 +501,9 @@ _evas_shm_surface_redraw(Shm_Surface *surface)
 
    surface->frame_cb = wl_surface_frame(surface->surface);
    wl_callback_add_listener(surface->frame_cb, &_shm_frame_listener, surface);
+
+   wl_surface_commit(surface->surface);
+
+   leaf = &surface->leaf[surface->curr_buff];
+   leaf->busy = 1;
 }

-- 


Reply via email to