e_comp_wl_rsm: use output transform of pending viewport if buffer is pending 92/238492/3 accepted/tizen/5.5/unified/20200717.033433 submit/tizen_5.5/20200715.011607
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 14 Jul 2020 10:10:29 +0000 (19:10 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 14 Jul 2020 11:12:40 +0000 (20:12 +0900)
Change-Id: I278978ab56ca59544215092d8b1c1a405de8b0aa

src/bin/e_comp_wl.c
src/bin/e_comp_wl.h
src/bin/e_comp_wl_rsm.c

index 25bb7c61346958caf19c0c160e1549fe38acdd30..57c945a74d3b9adef2835a2f97f94d599cb52423 100644 (file)
@@ -281,6 +281,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)
 {
index 0806a940ed99d0d94ec21a44906d4c4451a83de5..292e33118ce26d90b521297c606c53eb177d20c2 100644 (file)
@@ -585,6 +585,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);
index f324bb878e2f9e413eca86a0a3b412d41bb86180..af64d9eb6589009c7ed136a8358d206c72316972 100644 (file)
@@ -569,7 +569,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;
@@ -578,6 +579,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)
      {
@@ -600,7 +602,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;
@@ -742,7 +749,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
      {
@@ -766,7 +773,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);
      }
 
@@ -948,7 +955,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);
           }
      }
 
@@ -1115,7 +1122,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);
@@ -1561,7 +1568,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)
      {
@@ -1596,7 +1603,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
           {
@@ -2910,7 +2917,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;
@@ -2929,7 +2936,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);
      }
 }
 
@@ -3083,13 +3090,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 */
@@ -3239,7 +3246,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;