modify the update render at zoom set/unset.
authorSooChan Lim <sc1.lim@samsung.com>
Sun, 18 Jun 2017 07:59:34 +0000 (16:59 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 26 Jun 2017 08:29:52 +0000 (17:29 +0900)
Change-Id: I1314573a76e43db211d248874f0a0ba733f319ab

src/bin/e_output.c
src/bin/e_plane.c
src/bin/e_plane_renderer.c

index f2c279b4145547c61d37828ce890d19e4ba6f55c..14a21bc60d988b23e5a487410e7035f330e50431 100644 (file)
@@ -683,7 +683,7 @@ e_output_commit(E_Output *output)
 
         if (!e_plane_fetch(plane))
           {
-//            ERR("fail to fetch the plane.");
+            ERR("fail to fetch the plane.");
             return EINA_FALSE;
           }
 
@@ -977,12 +977,24 @@ _e_output_zoom_scaled_rect_get(int out_w, int out_h, double zoomx, double zoomy,
    rect->y = (int)(dy / zoomy);
 }
 
+static void
+_e_output_render_update(E_Output *output)
+{
+   E_Client *ec = NULL;
+
+   E_CLIENT_FOREACH(ec)
+     {
+        if (ec->visible && (!ec->input_only))
+          e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
+     }
+
+   e_output_render(output);
+}
+
 EINTERN Eina_Bool
 e_output_zoom_set(E_Output *eout, double zoomx, double zoomy, int cx, int cy)
 {
-   E_Zone *zone = NULL;
    E_Plane *ep = NULL;
-   Eina_List *l;
    Eina_Rectangle rect = {0, };
    int w, h;
 
@@ -1031,16 +1043,16 @@ e_output_zoom_set(E_Output *eout, double zoomx, double zoomy, int cx, int cy)
    if (!eout->zoom_set) eout->zoom_set = EINA_TRUE;
    DBG("zoom set output:%s", eout->id);
 
+   /* update the ecore_evas */
+   _e_output_render_update(eout);
+
    return EINA_TRUE;
 }
 
 EINTERN void
 e_output_zoom_unset(E_Output *eout)
 {
-   E_Zone *zone = NULL;
    E_Plane *ep = NULL;
-   Eina_List *l;
-   Eina_Bool ret = EINA_FALSE;
 
    EINA_SAFETY_ON_NULL_RETURN(eout);
 
@@ -1063,6 +1075,9 @@ e_output_zoom_unset(E_Output *eout)
    e_comp_hwc_multi_plane_set(EINA_TRUE);
 #endif
 
+   /* update the ecore_evas */
+   _e_output_render_update(eout);
+
    DBG("e_output_zoom_unset: output:%s", eout->id);
 }
 #endif
index 2ef7bbec4e807a1009026e3ac6112428ef212500..54cb1a5b74fe8e4d603658db774d4c4a7acd6e50 100644 (file)
@@ -1863,7 +1863,6 @@ EINTERN Eina_Bool
 e_plane_zoom_commit(E_Plane *plane)
 {
    tbm_surface_h tsurface = plane->tsurface;
-   tbm_surface_info_s surf_info;
    E_Plane_Commit_Data *data = NULL;
    E_Plane_Pp_Data *pp_data = NULL;
    int count = 0;
@@ -1932,141 +1931,6 @@ pp_fail:
    return EINA_FALSE;
 }
 
-static void
-_e_plane_zoom_set_show(E_Plane *plane)
-{
-   E_Plane_Pp_Data *pp_data = NULL;
-   tbm_surface_h zoom_tsurface = NULL;
-   tbm_error_e tbm_err = TBM_ERROR_NONE;
-   tdm_error tdm_err = TDM_ERROR_NONE;
-
-   if (!plane->tsurface)
-     return;
-
-   if (eina_list_count(plane->pending_commit_zoom_data_list) != 0)
-     return;
-
-   if (plane->pending_commit)
-     return;
-
-   plane->pending_commit = EINA_TRUE;
-
-   tbm_err = tbm_surface_queue_dequeue(plane->zoom_tqueue, &zoom_tsurface);
-   if (tbm_err != TBM_ERROR_NONE)
-     {
-        plane->pending_commit = EINA_FALSE;
-        ERR("_e_plane_zoom_set_show: fail tbm_surface_queue_dequeue");
-        return;
-     }
-   tbm_surface_internal_ref(zoom_tsurface);
-
-   pp_data = E_NEW(E_Plane_Pp_Data, 1);
-   pp_data->zoom_tsurface = zoom_tsurface;
-   pp_data->data = NULL;
-   pp_data->plane = plane;
-
-   plane->pending_commit_zoom_data_list = eina_list_append(plane->pending_commit_zoom_data_list, pp_data);
-
-   if (plane->zoom_rect.x != plane->zoom_rect_temp.x || plane->zoom_rect.y != plane->zoom_rect_temp.y ||
-       plane->zoom_rect.w != plane->zoom_rect_temp.w || plane->zoom_rect.h != plane->zoom_rect_temp.h)
-     {
-        if (!_e_plane_zoom_set_pp_info(plane))
-          {
-             ERR("e_plane_zoom_commit: fail _e_plane_zoom_set_pp_info");
-             goto pp_fail;
-          }
-     }
-
-   tdm_err = tdm_pp_set_done_handler(plane->tpp, _e_plane_zoom_pp_cb, pp_data);
-   EINA_SAFETY_ON_FALSE_GOTO(tdm_err == TDM_ERROR_NONE, pp_fail);
-
-   tdm_err = tdm_pp_attach(plane->tpp, plane->tsurface, zoom_tsurface);
-   EINA_SAFETY_ON_FALSE_GOTO(tdm_err == TDM_ERROR_NONE, pp_fail);
-
-   tdm_err = tdm_pp_commit(plane->tpp);
-   EINA_SAFETY_ON_FALSE_GOTO(tdm_err == TDM_ERROR_NONE, pp_fail);
-
-   DBG("_e_plane_zoom_set_show: done pp_data:%p", pp_data);
-
-   return;
-
-pp_fail:
-   plane->pending_commit = EINA_FALSE;
-   plane->pending_commit_zoom_data_list = eina_list_remove(plane->pending_commit_zoom_data_list, pp_data);
-   tbm_surface_queue_release(plane->zoom_tqueue, zoom_tsurface);
-   tbm_surface_internal_unref(zoom_tsurface);
-   free(pp_data);
-   ERR("_e_plane_zoom_set_show: fail");
-}
-
-static void
-_e_plane_zoom_unset_show(E_Plane *plane)
-{
-   E_Plane_Pp_Data *pp_data = NULL;
-   tbm_surface_info_s src_info, dst_info;
-   tbm_surface_h zoom_tsurface = NULL;
-   tbm_surface_h dst_tsurface = NULL;
-   tbm_error_e tbm_err = TBM_ERROR_NONE;
-   tdm_error tdm_err = TDM_ERROR_NONE;
-   tdm_layer *tlayer = NULL;
-
-   if (!plane->tsurface)
-     return;
-
-   if (eina_list_count(plane->pending_commit_zoom_data_list) != 0)
-     return;
-
-   if (plane->pending_commit)
-     return;
-
-   tbm_err = tbm_surface_queue_dequeue(plane->zoom_tqueue, &zoom_tsurface);
-   if (tbm_err != TBM_ERROR_NONE)
-     {
-        ERR("_e_plane_zoom_unset_show: fail tbm_surface_queue_dequeue");
-        return;
-     }
-   tbm_surface_internal_ref(zoom_tsurface);
-
-   pp_data = E_NEW(E_Plane_Pp_Data, 1);
-   pp_data->zoom_tsurface = zoom_tsurface;
-   pp_data->data = NULL;
-   pp_data->plane = plane;
-
-   plane->pending_commit_zoom_data_list = eina_list_append(plane->pending_commit_zoom_data_list, pp_data);
-
-   tbm_err = tbm_surface_map(plane->tsurface, TBM_SURF_OPTION_READ, &src_info);
-   if (tbm_err != TBM_SURFACE_ERROR_NONE)
-     {
-        ERR("_e_plane_zoom_unset_show: fail to map the src_tsurface.");
-        goto map_fail;
-     }
-
-   tbm_err = tbm_surface_map(zoom_tsurface, TBM_SURF_OPTION_WRITE, &dst_info);
-   if (tbm_err != TBM_SURFACE_ERROR_NONE)
-     {
-        tbm_surface_unmap(plane->tsurface);
-        ERR("_e_plane_zoom_unset_show: fail to map the dst_tsurface.");
-        goto map_fail;
-     }
-   memcpy(dst_info.planes[0].ptr, src_info.planes[0].ptr, src_info.planes[0].size);
-
-   tbm_surface_unmap(zoom_tsurface);
-   tbm_surface_unmap(plane->tsurface);
-
-   _e_plane_zoom_pp_cb(plane->tpp, plane->tsurface, zoom_tsurface, pp_data);
-
-   DBG("_e_plane_zoom_unset_show: done pp_data:%p", pp_data);
-
-   return;
-
-map_fail:
-   plane->pending_commit_zoom_data_list = eina_list_remove(plane->pending_commit_zoom_data_list, pp_data);
-   tbm_surface_queue_release(plane->zoom_tqueue, zoom_tsurface);
-   tbm_surface_internal_unref(zoom_tsurface);
-   free(pp_data);
-   ERR("_e_plane_zoom_unset_show: fail");
-}
-
 EINTERN Eina_Bool
 e_plane_zoom_set(E_Plane *plane, Eina_Rectangle *rect)
 {
@@ -2076,8 +1940,11 @@ e_plane_zoom_set(E_Plane *plane, Eina_Rectangle *rect)
    tdm_error ret = TDM_ERROR_NONE;
    int w, h;
 
-   if (plane->zoom_unset)
-     plane->zoom_unset = EINA_FALSE;
+   if ((plane->zoom_rect_temp.x == rect->x) && (plane->zoom_rect_temp.y == rect->y) &&
+       (plane->zoom_rect_temp.w == rect->w) && (plane->zoom_rect_temp.h == rect->h))
+     return EINA_TRUE;
+
+   if (plane->zoom_unset) plane->zoom_unset = EINA_FALSE;
 
    e_comp_screen = e_comp->e_comp_screen;
    e_output_size_get(plane->output, &w, &h);
@@ -2102,17 +1969,11 @@ e_plane_zoom_set(E_Plane *plane, Eina_Rectangle *rect)
           }
      }
 
-   if ((plane->zoom_rect_temp.x == rect->x) && (plane->zoom_rect_temp.y == rect->y) &&
-       (plane->zoom_rect_temp.w == rect->w) && (plane->zoom_rect_temp.h == rect->h))
-     return EINA_TRUE;
-
    plane->zoom_rect_temp.x = rect->x;
    plane->zoom_rect_temp.y = rect->y;
    plane->zoom_rect_temp.w = rect->w;
    plane->zoom_rect_temp.h = rect->h;
 
-   _e_plane_zoom_set_show(plane);
-
    return EINA_TRUE;
 
 fail:
@@ -2135,7 +1996,5 @@ e_plane_zoom_unset(E_Plane *plane)
    plane->zoom_rect.w = plane->zoom_rect_temp.w = 0;
    plane->zoom_rect.h = plane->zoom_rect_temp.h = 0;
 
-   _e_plane_zoom_unset_show(plane);
-
    plane->zoom_unset = EINA_TRUE;
 }
index 53bc55ec5250b66802a7d83ebe137d9304c002ae..26f0c071104002f4cada0d54824c65e10de142d0 100644 (file)
@@ -1382,7 +1382,12 @@ e_plane_renderer_render(E_Plane_Renderer *renderer, Eina_Bool is_fb)
         TRACE_DS_BEGIN(MANUAL RENDER);
 
         if (e_plane_renderer_surface_queue_can_dequeue(renderer) || !renderer->tqueue)
-           ecore_evas_manual_render(renderer->ee);
+          {
+             if (renderer_trace_debug)
+               ELOGF("E_PLANE_RENDERER", "Canvas Manual Render.", NULL, NULL);
+
+             ecore_evas_manual_render(renderer->ee);
+          }
 
         TRACE_DS_END();
      }