From: Changyeon Lee Date: Tue, 14 Jul 2020 10:10:29 +0000 (+0900) Subject: e_comp_wl_rsm: use output transform of pending viewport if buffer is pending X-Git-Tag: submit/tizen/20200715.044126~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f72789f7a7c724f70873b266305b0cced5f60176;p=platform%2Fupstream%2Fenlightenment.git e_comp_wl_rsm: use output transform of pending viewport if buffer is pending Change-Id: I278978ab56ca59544215092d8b1c1a405de8b0aa --- diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 84b8846a13..41c0a7e8eb 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -291,6 +291,42 @@ e_comp_wl_output_buffer_transform_get(E_Client *ec) return transform; } +EINTERN enum wl_output_transform +e_comp_wl_output_pending_buffer_transform_get(E_Client *ec) +{ + E_Comp_Wl_Buffer_Viewport *vp; + E_Comp_Wl_Buffer *buffer; + enum wl_output_transform transform, rotation; + + if (!ec) return WL_OUTPUT_TRANSFORM_NORMAL; + if (e_object_is_del(E_OBJECT(ec))) return WL_OUTPUT_TRANSFORM_NORMAL; + if (!ec->comp_data) return WL_OUTPUT_TRANSFORM_NORMAL; + + vp = &ec->comp_data->pending.buffer_viewport; + if (ec->comp_data->sub.data) + return vp->buffer.transform; + + buffer = ec->comp_data->pending.buffer; + + if (!buffer || + (buffer->type != E_COMP_WL_BUFFER_TYPE_NATIVE && buffer->type != E_COMP_WL_BUFFER_TYPE_TBM)) + return vp->buffer.transform; + + rotation = buffer->transform; + if (rotation == 0) + return vp->buffer.transform; + + /* ignore the flip value when calculating transform because the screen rotation + * functionality doesn't consider the flip output transform currently + */ + transform = (4 + (vp->buffer.transform & 0x3) - rotation) & 0x3; + + DBG("ec(%p) window rotation(%d) buffer_transform(%d) : transform(%d)", + ec, rotation, vp->buffer.transform, transform); + + return transform; +} + E_API void e_comp_wl_map_size_cal_from_buffer(E_Client *ec) { diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index b3621f0378..553c7c15f4 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -586,6 +586,7 @@ EINTERN void e_comp_wl_shell_surface_ready(E_Client *ec); E_API E_Client* e_comp_wl_topmost_parent_get(E_Client *ec); +EINTERN enum wl_output_transform e_comp_wl_output_pending_buffer_transform_get(E_Client *ec); E_API enum wl_output_transform e_comp_wl_output_buffer_transform_get(E_Client *ec); E_API void e_comp_wl_map_size_cal_from_buffer(E_Client *ec); E_API void e_comp_wl_map_size_cal_from_viewport(E_Client *ec); diff --git a/src/bin/e_comp_wl_rsm.c b/src/bin/e_comp_wl_rsm.c index 050bef9a0c..18c14d12a3 100644 --- a/src/bin/e_comp_wl_rsm.c +++ b/src/bin/e_comp_wl_rsm.c @@ -572,7 +572,8 @@ _remote_surface_changed_buff_protocol_send(E_Comp_Wl_Remote_Surface *rs, unsigned int img_file_size, Eina_Bool ref_set, E_Comp_Wl_Buffer *buff, - tbm_surface_h tbm_surface) + tbm_surface_h tbm_surface, + Eina_Bool pending) { E_Client *src_ec = NULL; struct wl_resource *tbm = NULL; @@ -581,6 +582,7 @@ _remote_surface_changed_buff_protocol_send(E_Comp_Wl_Remote_Surface *rs, Eina_Bool add_opts = EINA_FALSE; char *p, tmp[16]; int len; + enum wl_output_transform output_transform; if (rs->provider) { @@ -603,7 +605,12 @@ _remote_surface_changed_buff_protocol_send(E_Comp_Wl_Remote_Surface *rs, /* if unbinded, buffer_transform should be 0 for consumer to composite buffers. * Otherwise, we skip sending a change_buffer event because buffer is not ready. */ - if (!rs->bind_ec && e_comp_wl_output_buffer_transform_get(src_ec)) + if (pending) + output_transform = e_comp_wl_output_pending_buffer_transform_get(src_ec); + else + output_transform = e_comp_wl_output_buffer_transform_get(src_ec); + + if (!rs->bind_ec && output_transform) { RSMINF("CHANGED_BUFF skiped: buffer not ready", rs->ec, "SURFACE", rs); return EINA_TRUE; @@ -745,7 +752,7 @@ _remote_surface_buff_send(E_Comp_Wl_Remote_Surface *rs) _rsm->dummy_fd, (unsigned int)img_size, EINA_FALSE, - buff, tbm_surface); + buff, tbm_surface, EINA_FALSE); } else { @@ -769,7 +776,7 @@ _remote_surface_buff_send(E_Comp_Wl_Remote_Surface *rs) fd, (unsigned int)img_size, EINA_FALSE, - NULL, NULL); + NULL, NULL, EINA_FALSE); close(fd); } @@ -951,7 +958,7 @@ _remote_surface_bind_client(E_Comp_Wl_Remote_Surface *remote_surface, E_Client * _rsm->dummy_fd, 0, EINA_TRUE, - buffer, NULL); + buffer, NULL, EINA_FALSE); } } @@ -1118,7 +1125,7 @@ _remote_source_send_image_update(E_Comp_Wl_Remote_Source *source) fd, (unsigned int)image_size, EINA_FALSE, - NULL, NULL); + NULL, NULL, EINA_FALSE); } close(fd); @@ -1564,7 +1571,7 @@ _remote_surface_cb_redirect(struct wl_client *client, struct wl_resource *resour _rsm->dummy_fd, 0, EINA_TRUE, - buffer, tbm_surface); + buffer, tbm_surface, EINA_FALSE); } else if (remote_surface->source) { @@ -1599,7 +1606,7 @@ _remote_surface_cb_redirect(struct wl_client *client, struct wl_resource *resour _rsm->dummy_fd, 0, EINA_TRUE, - buffer, tbm_surface); + buffer, tbm_surface, EINA_FALSE); } else { @@ -2913,7 +2920,7 @@ _e_comp_wl_remote_buffer_get(E_Comp_Wl_Remote_Surface *remote_surface, struct wl } static void -_e_comp_wl_remote_surface_source_update(E_Comp_Wl_Remote_Source *source, E_Comp_Wl_Buffer *buffer) +_e_comp_wl_remote_surface_source_update(E_Comp_Wl_Remote_Source *source, E_Comp_Wl_Buffer *buffer, Eina_Bool pending) { E_Comp_Wl_Remote_Surface *remote_surface; Eina_List *l; @@ -2932,7 +2939,7 @@ _e_comp_wl_remote_surface_source_update(E_Comp_Wl_Remote_Source *source, E_Comp_ _rsm->dummy_fd, 0, EINA_TRUE, - buffer, NULL); + buffer, NULL, pending); } } @@ -3086,13 +3093,13 @@ _e_comp_wl_remote_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *st _rsm->dummy_fd, 0, EINA_TRUE, - buffer, NULL); + buffer, NULL, EINA_FALSE); } } } else if ((source = _remote_source_find(ec))) { - _e_comp_wl_remote_surface_source_update(source, buffer); + _e_comp_wl_remote_surface_source_update(source, buffer, EINA_FALSE); } /* send frame done */ @@ -3242,7 +3249,7 @@ e_comp_wl_remote_surface_commit(E_Client *ec) } //send update to remote_surface of source client - _e_comp_wl_remote_surface_source_update(source, ec->comp_data->pending.buffer); + _e_comp_wl_remote_surface_source_update(source, ec->comp_data->pending.buffer, EINA_TRUE); //do normal commit callback process return EINA_FALSE;