From e19474af225400de107a1d212ff443f9a16af850 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Mon, 23 May 2016 22:15:41 +0900 Subject: [PATCH] Add dump type E_COMP_WL_BUFFER_TYPE_TBM Change-Id: I283f7a8f65c9e15f48078acb5b590a33734c24cd --- src/bin/e_info_server.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/bin/e_info_server.c b/src/bin/e_info_server.c index edf767a..6519871 100644 --- a/src/bin/e_info_server.c +++ b/src/bin/e_info_server.c @@ -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 -- 2.7.4