Support an environment variable to set the number of buffers (double
authorChristopher Michael <cp.michael@samsung.com>
Thu, 24 Jan 2013 09:21:12 +0000 (09:21 +0000)
committerChristopher Michael <cpmichael1@comcast.net>
Thu, 24 Jan 2013 09:21:12 +0000 (09:21 +0000)
buffer by default).

Signed-off-by: Christopher Michael <cp.michael@samsung.com>
SVN revision: 83281

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

index 66cd243..445f2c1 100644 (file)
@@ -53,6 +53,7 @@ evas_swapper_setup(int w, int h, Outbuf_Depth depth, Eina_Bool alpha, struct wl_
 {
    Wl_Swapper *ws;
    int i = 0;
+   char *num_buffers;
 
    /* try to allocate a new swapper */
    if (!(ws = calloc(1, sizeof(Wl_Swapper)))) 
@@ -69,6 +70,19 @@ evas_swapper_setup(int w, int h, Outbuf_Depth depth, Eina_Bool alpha, struct wl_
    /* double buffer by default */
    ws->buff_num = 2;
 
+   /* check for buffer override number */
+   if ((num_buffers = getenv("EVAS_WAYLAND_SHM_BUFFERS")))
+     {
+        int num = 0;
+
+        num = atoi(num_buffers);
+
+        if (num <= 0) num = 1;
+        if (num > 3) num = 3;
+
+        ws->buff_num = num;
+     }
+
    for (i = 0; i < ws->buff_num; i++)
      {
         /* try to create new internal Wl_Buffer */