wayland_shm: Store width and height in surface struct

No longer query these from the outbuf.
This commit is contained in:
Derek Foreman 2017-11-29 15:31:17 -06:00
parent 6a48d56dca
commit d1a4f38a96
1 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,7 @@ struct _Dmabuf_Surface
Ecore_Wl2_Buffer *current; Ecore_Wl2_Buffer *current;
Eina_List *buffers; Eina_List *buffers;
int w, h;
Eina_Bool alpha : 1; Eina_Bool alpha : 1;
}; };
@ -40,6 +41,8 @@ _evas_dmabuf_surface_reconfigure(Surface *s, int w, int h, uint32_t flags EINA_U
ecore_wl2_buffer_destroy(b); ecore_wl2_buffer_destroy(b);
surface->buffers = eina_list_remove_list(surface->buffers, l); surface->buffers = eina_list_remove_list(surface->buffers, l);
} }
surface->w = w;
surface->h = h;
} }
static void * static void *
@ -90,7 +93,7 @@ _evas_dmabuf_surface_wait(Dmabuf_Surface *s)
{ {
Outbuf *ob; Outbuf *ob;
ob = s->surface->ob; ob = s->surface->ob;
best = ecore_wl2_buffer_create(ob->ewd, ob->w, ob->h, s->alpha); best = ecore_wl2_buffer_create(ob->ewd, s->w, s->h, s->alpha);
/* Start at -1 so it's age is incremented to 0 for first draw */ /* Start at -1 so it's age is incremented to 0 for first draw */
best->age = -1; best->age = -1;
s->buffers = eina_list_append(s->buffers, best); s->buffers = eina_list_append(s->buffers, best);
@ -189,6 +192,8 @@ _evas_surface_create(Evas_Engine_Info_Wayland *info, Outbuf *ob)
surf->surface = out; surf->surface = out;
surf->alpha = info->info.destination_alpha; surf->alpha = info->info.destination_alpha;
surf->w = 0;
surf->h = 0;
/* create surface buffers */ /* create surface buffers */
if (!ecore_wl2_buffer_init(ewd, types)) goto err; if (!ecore_wl2_buffer_init(ewd, types)) goto err;