wayland_shm: Return buffer age from shm_surface_assign

This makes refactoring the Surface abstraction a little easier.
This commit is contained in:
Derek Foreman 2016-04-08 13:24:22 -05:00 committed by Mike Blumenkrantz
parent 7c743b6754
commit f92c2d2330
3 changed files with 5 additions and 7 deletions

View File

@ -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);

View File

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

View File

@ -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 *