From: SooChan Lim Date: Tue, 3 May 2016 11:26:04 +0000 (+0900) Subject: find surface at queue_list X-Git-Tag: accepted/tizen/common/20160504.130224^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0e58518b53943f6ee44075e227a4cca5c17692d;p=platform%2Fcore%2Fuifw%2Fwayland-tbm.git find surface at queue_list Change-Id: I107a839dd5f37972701f9f4af3c46bf2628ee8d1 --- diff --git a/src/wayland-tbm-client.c b/src/wayland-tbm-client.c index 1c9e886..019450d 100644 --- a/src/wayland-tbm-client.c +++ b/src/wayland-tbm-client.c @@ -51,9 +51,6 @@ struct wayland_tbm_client { tbm_bufmgr bufmgr; struct wl_list queue_info_list; - - // TODO: make the queue_info list - struct wayland_tbm_surface_queue *queue_info; }; struct wayland_tbm_buffer { @@ -244,16 +241,17 @@ wayland_tbm_client_create_buffer(struct wayland_tbm_client *tbm_client, int i; uint32_t flags = 0; struct wayland_tbm_buffer *buffer, *tmp; - struct wayland_tbm_surface_queue *queue_info = NULL; + struct wayland_tbm_surface_queue *queue_info = NULL, *tmp_info = NULL; - if (tbm_client->queue_info) { - queue_info = tbm_client->queue_info; - /* if the surface is the attached surface from display server, - * return the wl_buffer of the attached surface - */ - wl_list_for_each_safe(buffer, tmp, &queue_info->attach_bufs, link) { - if (buffer->tbm_surface == surface) { - return buffer->wl_buffer; + /* if the surface is the attached surface from display server, + * return the wl_buffer of the attached surface + */ + if (!wl_list_empty(&tbm_client->queue_info_list)) { + wl_list_for_each_safe(queue_info, tmp_info, &tbm_client->queue_info_list, link) { + wl_list_for_each_safe(buffer, tmp, &queue_info->attach_bufs, link) { + if (buffer->tbm_surface == surface) { + return buffer->wl_buffer; + } } } } @@ -933,11 +931,15 @@ fail: struct wl_tbm_queue * wayland_tbm_client_get_wl_tbm_queue(struct wayland_tbm_client *tbm_client, struct wl_surface *surface) { + struct wayland_tbm_surface_queue *queue_info = NULL; + WL_TBM_RETURN_VAL_IF_FAIL(tbm_client != NULL, NULL); WL_TBM_RETURN_VAL_IF_FAIL(surface != NULL, NULL); - WL_TBM_RETURN_VAL_IF_FAIL(tbm_client->queue_info != NULL, NULL); - WL_TBM_RETURN_VAL_IF_FAIL(tbm_client->queue_info->wl_tbm_queue != NULL, NULL); - return tbm_client->queue_info->wl_tbm_queue; + queue_info = _wayland_tbm_client_find_queue_info_wl_surface(tbm_client, surface); + WL_TBM_RETURN_VAL_IF_FAIL(queue_info != NULL, NULL); + WL_TBM_RETURN_VAL_IF_FAIL(queue_info->wl_tbm_queue != NULL, NULL); + + return queue_info->wl_tbm_queue; }