[evas_sw] enable EVAS_WAYLAND_SHM_BUFFERS setting in evas_tbmbuf 96/133096/2
authorJoogab Yun <joogab.yun@samsung.com>
Fri, 9 Jun 2017 02:16:45 +0000 (11:16 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 13 Jun 2017 07:26:58 +0000 (07:26 +0000)
you can change the default buffer count, but not yet support single buffer.
It support at least double buffers at evas_tbmbuf.

Change-Id: If8d22e9456ac02e914f14acd48a919a349b5160c

src/modules/evas/engines/wayland_shm/evas_outbuf.c
src/modules/evas/engines/wayland_shm/evas_tbmbuf.c

index 7c191ca..57d9e91 100644 (file)
@@ -60,8 +60,11 @@ _evas_outbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *info)
    ob->depth = info->info.depth;
    ob->priv.destination_alpha = info->info.destination_alpha;
 
-   /* default to double buffer */
-   ob->num_buff = 2;
+   /* default buffer */
+   if (getenv("EVAS_WAYLAND_USE_SHMBUF"))
+     ob->num_buff = 2;
+   else
+     ob->num_buff = 3;
 
    /* check for any 'number of buffers' override in the environment */
    if ((num = getenv("EVAS_WAYLAND_SHM_BUFFERS")))
index 08607df..7bdb7ac 100644 (file)
@@ -544,7 +544,7 @@ _evas_tbmbuf_surface_destroy(Surface *s)
 }
 
 Eina_Bool
-_evas_tbmbuf_surface_create(Surface *s, int w, int h, int num_buff EINA_UNUSED)
+_evas_tbmbuf_surface_create(Surface *s, int w, int h, int num_buff)
 {
    Tbmbuf_Surface *surf = NULL;
 
@@ -574,12 +574,15 @@ _evas_tbmbuf_surface_create(Surface *s, int w, int h, int num_buff EINA_UNUSED)
          goto err;
    }
 
+   /* check num_buff, not yet support single buffer */
+   if (num_buff == 1) num_buff = 2;
+
    /* create surface buffers */
    if (!s->info->info.tbm_queue)
       {
          s->info->info.tbm_queue = sym_wayland_tbm_client_create_surface_queue(surf->tbm_client,
                                                                        surf->wl_surface,
-                                                                       3,
+                                                                       num_buff,
                                                                        w, h,
                                                                        TBM_FORMAT_ARGB8888);
          surf->tbm_queue = s->info->info.tbm_queue;