wayland-shm: Remove curr_buff from Shm_Surface

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
This commit is contained in:
Derek Foreman 2015-07-30 11:45:17 -04:00 committed by Chris Michael
parent 157ad667b4
commit cf3434a927
3 changed files with 5 additions and 8 deletions

View 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;

View 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;

View 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;
}