From deb4b3beeed300d6e37e09dda5262977b57fc74e Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Thu, 26 May 2016 20:25:25 +0900 Subject: [PATCH] e_comp_hwc:Reference e_comp_wl_buffer which is commited and displayed buffer in nocomp Change-Id: Ibd4072070ea055721648b791843824803a6f1f0d --- src/bin/e_comp_hwc.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/bin/e_comp_hwc.c b/src/bin/e_comp_hwc.c index de6bf2ee11..569b6246b4 100644 --- a/src/bin/e_comp_hwc.c +++ b/src/bin/e_comp_hwc.c @@ -52,6 +52,7 @@ struct _E_Comp_Hwc_Client struct _E_Comp_Hwc_Commit_Data { E_Comp_Hwc_Layer *hwc_layer; + E_Comp_Wl_Buffer_Ref buffer_ref; tbm_surface_h tsurface; E_Client *ec; Eina_Bool is_canvas; @@ -85,6 +86,8 @@ struct _E_Comp_Hwc_Layer { tbm_surface_h pending_tsurface; tbm_surface_h tsurface; + E_Comp_Wl_Buffer_Ref displaying_buffer_ref; + E_Client *ec; /* ec which display on this layer directly */ E_Comp_Hwc_Renderer *hwc_renderer; @@ -259,8 +262,9 @@ _e_comp_hwc_commit_data_create(void) static void _e_comp_hwc_commit_data_destroy(E_Comp_Hwc_Commit_Data *data) { - if (data) return; + if (!data) return; + e_comp_wl_buffer_reference(&data->buffer_ref, NULL); free(data); } @@ -903,6 +907,7 @@ _e_comp_hwc_output_commit_handler_reserved_memory(tdm_output *output, unsigned i else { _e_comp_hwc_layer_queue_release(hwc_layer, hwc_layer->tsurface); + e_comp_wl_buffer_reference(&hwc_layer->displaying_buffer_ref, NULL); hwc_layer->tsurface = tsurface; } } @@ -916,7 +921,8 @@ _e_comp_hwc_output_commit_handler_reserved_memory(tdm_output *output, unsigned i /* release */ if (hwc_layer->tsurface) { - _e_comp_hwc_layer_queue_release(hwc_layer, tsurface); + _e_comp_hwc_layer_queue_release(hwc_layer, hwc_layer->tsurface); + e_comp_wl_buffer_reference(&hwc_layer->displaying_buffer_ref, data->buffer_ref.buffer); hwc_layer->tsurface = tsurface; } @@ -986,7 +992,6 @@ _e_comp_hwc_output_commit_handler(tdm_output *output, unsigned int sequence, tbm_surface_internal_unref(tsurface); _e_comp_hwc_commit_data_destroy(data); - } else { @@ -1032,7 +1037,11 @@ _e_comp_hwc_output_commit(E_Comp_Hwc_Output *hwc_output, E_Comp_Hwc_Layer *hwc_l /* hwc_renderer->activated_ec can be changed at the time of commit handler , so we stores the current activated_ec at data */ if (hwc_renderer->activated_ec) - data->ec = hwc_renderer->activated_ec; + { + data->ec = hwc_renderer->activated_ec; + e_comp_wl_buffer_reference(&data->buffer_ref, e_pixmap_resource_get(hwc_renderer->activated_ec->pixmap)); + } + data->is_canvas = is_canvas; /* set layer when the layer infomation is different from the previous one */ -- 2.34.1