Fix booting performance issue 57/174557/2 accepted/tizen/unified/20180405.005245 submit/tizen/20180403.101617 submit/tizen/20180404.045219 submit/tizen/20180404.084838
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 3 Apr 2018 04:07:12 +0000 (13:07 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 3 Apr 2018 04:36:33 +0000 (13:36 +0900)
The efl_config is setting device scale information in booting time.
After EFL 1.20 migration, the booting time became longer than before.
It is because The Efl.Ui.Win uses a frame object which is NOT used on Tizen.
Please refer to following stack. The evas_font_load needs around 3 seconds.

  evas_font_load
  _evas_text_font_reload
  efl_text_properties_font_set
  efl_gfx_scale_set
  _edje_text_recalc_apply
  _edje_part_recalc_single_text
  _edje_part_recalc_single
  _edje_part_recalc
  _edje_recalc_do
  _edje_program_run
  _edje_program_run
  _edje_program_run
  _edje_emit_handle
  _edje_message_process
  _edje_object_message_signal_process_do
  _efl_canvas_layout_efl_layout_signal_signal_process
  efl_layout_signal_process
  edje_object_message_signal_process
  _elm_win_frame_style_update
  _elm_win_frame_add
  _efl_win_finalize_internal
  _efl_ui_win_efl_object_finalize
  efl_finalize
  _efl_add_end
  main ()

Setting device scale information does not need to use the frame object.
Moreover Tizen does not use the frame object. So we was about to use Efl.Ui.Win
without the frame object by checking _elm_config->win_no_border.

BUT, we might use Efl.Ui.Win frame object some day.
This patch set is making Efl.Ui.Win keep creating the frame object by checking
ecore_wl2 only (without Efl.Ui.Win).

Change-Id: Ib46fb752e195d41aa0a42169e24e0b5b85b27aa6

src/efl_config.c

index 3230c9a..1e854f8 100644 (file)
@@ -71,15 +71,22 @@ static inline tizen_profile_t get_tizen_profile()
 }
 
 static void
-_scale_set(Evas_Object *win)
+_scale_set(void)
 {
    Evas_Coord w, h;
    float inch, scale = 0.0, saved_scale = 0.0, profile_factor = 1.0;
    int dpi;
 
-   Ecore_Wl2_Window *wlwin = elm_win_wl_window_get(win);
+   Ecore_Wl2_Display *wldp = ecore_wl2_display_connect(NULL);
+   Ecore_Wl2_Window *wlwin = ecore_wl2_window_new(wldp, NULL, 0, 0, 1, 1);
    Ecore_Wl2_Output *wlout = ecore_wl2_window_output_find(wlwin);
-   Ecore_Wl2_Display *wldp = ecore_wl2_window_display_get(wlwin);
+
+   if (!wldp || !wlwin || !wlout)
+     {
+        EINA_LOG_ERR("efl-config :: %s is NULL",
+                     !wldp ? "display" : (!wlwin ? "window" : "output"));
+        return;
+     }
 
    ecore_wl2_sync();
    dpi = ecore_wl2_output_dpi_get(wlout);
@@ -118,6 +125,8 @@ _scale_set(Evas_Object *win)
         elm_config_save();
         elm_config_all_flush();
      }
+
+   ecore_wl2_window_free(wlwin);
 }
 
 static void
@@ -326,8 +335,6 @@ int main(int argc, char **argv)
 
    EINA_LOG_INFO("efl-config :: START");
 
-   Evas_Object *win = elm_win_add(NULL, "config", ELM_WIN_BASIC);
-
    if (argc > 1)
      {
         /* do if this daemon launched by system socket */
@@ -343,7 +350,7 @@ int main(int argc, char **argv)
    else
      {
         EINA_LOG_DBG("efl-config :: Launching without option. Call _scale_set()");
-        _scale_set(win);
+        _scale_set();
      }
 
    if (opt_with_message)