Ecore_Evas (wayland_shm): Allocate the shm_pool according to output
authordevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 12 Apr 2012 20:46:48 +0000 (20:46 +0000)
committerdevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 12 Apr 2012 20:46:48 +0000 (20:46 +0000)
size. Don't set the engine destination until we have created the pool
& buffer.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@70159 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_evas/ecore_evas_wayland_shm.c

index 37e74ec..39f7214 100644 (file)
@@ -539,13 +539,6 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
 
    if ((!ee) || (ee->visible)) return;
 
-   einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
-   if (!einfo)
-     {
-        ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
-        return;
-     }
-
    if (ee->engine.wl.win)
      ecore_wl_window_show(ee->engine.wl.win);
 
@@ -559,20 +552,16 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
      }
    else
      {
-        int size = 0;
+        int w = 0, size = 0;
 
         /* FIXME: This should use output size */
-        size = 6 * 1024 * 1024;
+        ecore_wl_screen_size_get(&w, NULL);
+        size = 6 * w * w;
         pool = 
           _ecore_evas_wl_shm_pool_create(size, &data);
         ee->engine.wl.pool_size = size;
      }
 
-   _ecore_evas_wl_buffer_new(ee, pool);
-
-   einfo->info.dest = data;
-   evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
-
    if (data != ee->engine.wl.pool_data)
      {
         if (ee->engine.wl.pool)
@@ -582,6 +571,18 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
         ee->engine.wl.pool_data = data;
      }
 
+   _ecore_evas_wl_buffer_new(ee, pool);
+
+   einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
+   if (!einfo)
+     {
+        ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
+        return;
+     }
+
+   einfo->info.dest = data;
+   evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
+
    /* ecore_wl_flush(); */
 
    if (ee->engine.wl.win)