wayland-shm: Remove curr_buff from Shm_Surface
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 30 Jul 2015 15:45:17 +0000 (11:45 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 30 Jul 2015 15:45:17 +0000 (11:45 -0400)
Summary:
We already have *current, but we're not using it properly.  Let's throw
out curr_buff and just use *current.

This temporarily makes swapmode_get do full renders, this will be
fixed in a future commit that adds proper buffer ages.

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2890

src/modules/evas/engines/wayland_shm/evas_engine.h
src/modules/evas/engines/wayland_shm/evas_outbuf.c
src/modules/evas/engines/wayland_shm/evas_shm.c

index a702155..94779e9 100644 (file)
@@ -79,7 +79,6 @@ struct _Shm_Surface
    int w, h;
    int dx, dy;
    int num_buff;
-   int curr_buff;
 
    Shm_Leaf leaf[MAX_BUFFERS];
    Shm_Leaf *current;
index 6fac50e..68bf028 100644 (file)
@@ -251,15 +251,12 @@ _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects EINA_UNUSED, Evas_Render_Mode
 Render_Engine_Swap_Mode 
 _evas_outbuf_swapmode_get(Outbuf *ob)
 {
-   int i = 0, n = 0, count = 0, ret = 0;
+   int count = 0, ret = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
-   for (; i < ob->surface->num_buff; i++)
-     {
-        n = (ob->surface->num_buff + ob->surface->curr_buff - (i)) % ob->surface->num_buff;
-        if (ob->surface->leaf[n].busy) count++;
-     }
+   /* This was broken, for now we just do full redraws */
+   return MODE_FULL;
 
    if (count == ob->surface->num_buff) ret = MODE_FULL;
    else if (count == 0) ret = MODE_COPY;
index ee01f12..90df693 100644 (file)
@@ -453,7 +453,7 @@ _evas_shm_surface_post(Shm_Surface *surface, Eina_Rectangle *rects, unsigned int
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
-   leaf = &surface->leaf[surface->curr_buff];
+   leaf = surface->current;
    if (!leaf) return;
 
    if (!surface->surface) return;
@@ -478,4 +478,5 @@ _evas_shm_surface_post(Shm_Surface *surface, Eina_Rectangle *rects, unsigned int
    wl_surface_commit(surface->surface);
 
    leaf->busy = 1;
+   surface->current = NULL;
 }