wayland_shm: Store width and height in surface struct
authorDerek Foreman <derekf@osg.samsung.com>
Wed, 29 Nov 2017 21:31:17 +0000 (15:31 -0600)
committerDerek Foreman <derekf@osg.samsung.com>
Fri, 1 Dec 2017 16:58:44 +0000 (10:58 -0600)
No longer query these from the outbuf.

src/modules/evas/engines/wayland_shm/evas_dmabuf.c

index 46cea14..521c2c6 100644 (file)
@@ -15,6 +15,7 @@ struct _Dmabuf_Surface
    Ecore_Wl2_Buffer *current;
    Eina_List *buffers;
 
+   int w, h;
    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);
         surface->buffers = eina_list_remove_list(surface->buffers, l);
      }
+   surface->w = w;
+   surface->h = h;
 }
 
 static void *
@@ -90,7 +93,7 @@ _evas_dmabuf_surface_wait(Dmabuf_Surface *s)
      {
         Outbuf *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 */
         best->age = -1;
         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->alpha = info->info.destination_alpha;
+   surf->w = 0;
+   surf->h = 0;
 
    /* create surface buffers */
    if (!ecore_wl2_buffer_init(ewd, types)) goto err;