wayland_shm: Add a force flag to surface reconfigure

We're going to need a way to force reconfigure unconditionally to make
session recovery work again.
This commit is contained in:
Derek Foreman 2017-01-05 13:33:19 -06:00
parent bc000f3ad2
commit 7b0f937880
4 changed files with 8 additions and 6 deletions

View File

@ -558,7 +558,7 @@ _evas_dmabuf_buffer_destroy(Dmabuf_Buffer *b)
} }
static void static void
_evas_dmabuf_surface_reconfigure(Surface *s, int w, int h, uint32_t flags EINA_UNUSED) _evas_dmabuf_surface_reconfigure(Surface *s, int w, int h, uint32_t flags EINA_UNUSED, Eina_Bool force)
{ {
Dmabuf_Buffer *buf; Dmabuf_Buffer *buf;
Dmabuf_Surface *surface; Dmabuf_Surface *surface;
@ -571,7 +571,7 @@ _evas_dmabuf_surface_reconfigure(Surface *s, int w, int h, uint32_t flags EINA_U
int stride = b->stride; int stride = b->stride;
/* If stride is a little bigger than width we still fit */ /* If stride is a little bigger than width we still fit */
if ((w >= b->w) && (w <= stride / 4) && (h == b->h)) if (!force && (w >= b->w) && (w <= stride / 4) && (h == b->h))
{ {
b->w = w; b->w = w;
continue; continue;

View File

@ -96,7 +96,7 @@ struct _Surface
struct struct
{ {
void (*destroy)(Surface *surface); void (*destroy)(Surface *surface);
void (*reconfigure)(Surface *surface, int w, int h, uint32_t flags); void (*reconfigure)(Surface *surface, int w, int h, uint32_t flags, Eina_Bool force);
void *(*data_get)(Surface *surface, int *w, int *h); void *(*data_get)(Surface *surface, int *w, int *h);
int (*assign)(Surface *surface); int (*assign)(Surface *surface);
void (*post)(Surface *surface, Eina_Rectangle *rects, unsigned int count, Eina_Bool hidden); void (*post)(Surface *surface, Eina_Rectangle *rects, unsigned int count, Eina_Bool hidden);

View File

@ -368,11 +368,11 @@ _evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth,
if ((ob->rotation == 0) || (ob->rotation == 180)) if ((ob->rotation == 0) || (ob->rotation == 180))
{ {
ob->surface->funcs.reconfigure(ob->surface, w, h, resize); ob->surface->funcs.reconfigure(ob->surface, w, h, resize, EINA_FALSE);
} }
else if ((ob->rotation == 90) || (ob->rotation == 270)) else if ((ob->rotation == 90) || (ob->rotation == 270))
{ {
ob->surface->funcs.reconfigure(ob->surface, h, w, resize); ob->surface->funcs.reconfigure(ob->surface, h, w, resize, EINA_FALSE);
} }
_evas_outbuf_idle_flush(ob); _evas_outbuf_idle_flush(ob);

View File

@ -414,7 +414,7 @@ _evas_shm_surface_destroy(Surface *surface)
} }
void void
_evas_shm_surface_reconfigure(Surface *s, int w, int h, uint32_t flags) _evas_shm_surface_reconfigure(Surface *s, int w, int h, uint32_t flags, Eina_Bool force)
{ {
Shm_Surface *surface; Shm_Surface *surface;
int i = 0, resize = 0; int i = 0, resize = 0;
@ -424,6 +424,8 @@ _evas_shm_surface_reconfigure(Surface *s, int w, int h, uint32_t flags)
surface = s->surf.shm; surface = s->surf.shm;
resize = !!flags; resize = !!flags;
if (force) for (; i < surface->num_buff; i++) surface->leaf[i].busy = EINA_FALSE;
for (; i < surface->num_buff; i++) for (; i < surface->num_buff; i++)
{ {
/* don't resize any busy leafs */ /* don't resize any busy leafs */