Add dump type E_COMP_WL_BUFFER_TYPE_TBM 87/70987/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 23 May 2016 13:15:41 +0000 (22:15 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 23 May 2016 13:39:41 +0000 (22:39 +0900)
Change-Id: I283f7a8f65c9e15f48078acb5b590a33734c24cd

src/bin/e_info_server.c

index edf767a..6519871 100644 (file)
@@ -1418,7 +1418,7 @@ e_info_server_dump_client(E_Client *ec, char *fname)
         if (shmbuffer)
           {
              data = wl_shm_buffer_get_data(shmbuffer);
-             w = wl_shm_buffer_get_stride(shmbuffer)/4;
+             w = wl_shm_buffer_get_stride(shmbuffer) / 4;
              h = wl_shm_buffer_get_height(shmbuffer);
           }
      }
@@ -1431,7 +1431,19 @@ e_info_server_dump_client(E_Client *ec, char *fname)
         tbm_surface_map(tbm_surface, TBM_SURF_OPTION_READ, &surface_info);
 
         data = surface_info.planes[0].ptr;
-        w = surface_info.planes[0].stride/4;
+        w = surface_info.planes[0].stride / 4;
+        h = surface_info.height;
+     }
+   else if (buffer->type == E_COMP_WL_BUFFER_TYPE_TBM)
+     {
+        tbm_surface_info_s surface_info;
+        tbm_surface_h tbm_surface = buffer->tbm_surface;
+
+        memset(&surface_info, 0, sizeof(tbm_surface_info_s));
+        tbm_surface_map(tbm_surface, TBM_SURF_OPTION_READ, &surface_info);
+
+        data = surface_info.planes[0].ptr;
+        w = surface_info.planes[0].stride / 4;
         h = surface_info.height;
      }
    else
@@ -1457,10 +1469,18 @@ e_info_server_dump_client(E_Client *ec, char *fname)
 
  err:
  #ifdef HAVE_WAYLAND_ONLY
-   if (data && buffer->type == E_COMP_WL_BUFFER_TYPE_NATIVE)
+   if (data)
      {
-        tbm_surface_h tbm_surface = wayland_tbm_server_get_surface(NULL, buffer->resource);
-        tbm_surface_unmap(tbm_surface);
+        if (buffer->type == E_COMP_WL_BUFFER_TYPE_NATIVE)
+          {
+             tbm_surface_h tbm_surface = wayland_tbm_server_get_surface(NULL, buffer->resource);
+             tbm_surface_unmap(tbm_surface);
+          }
+        else if (buffer->type == E_COMP_WL_BUFFER_TYPE_TBM)
+          {
+             tbm_surface_h tbm_surface = buffer->tbm_surface;
+             tbm_surface_unmap(tbm_surface);
+          }
      }
  #endif