Add API for improving launching performance of 3rd party applications 88/59688/3
authorHosang Kim <hosang12.kim@samsung.com>
Wed, 17 Feb 2016 10:46:00 +0000 (19:46 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Thu, 25 Feb 2016 02:08:06 +0000 (11:08 +0900)
Change-Id: I4e04de13def191cc0e7cc21dce0703ba6ced0869

src/lib/elm_bg.c
src/lib/elm_bg_legacy.h
src/lib/elm_conform.c
src/lib/elm_conform_legacy.h
src/lib/elm_win.c
src/lib/elm_win_legacy.h

index 90e0119..1864da0 100644 (file)
@@ -20,6 +20,10 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
    {NULL, NULL}
 };
 
+// TIZEN_ONLY(20160218): Improve launching performance.
+static Evas_Object *_precreated_bg_obj = NULL;
+//
+
 EOLIAN static void
 _elm_bg_elm_layout_sizing_eval(Eo *obj, Elm_Bg_Data *sd)
 {
@@ -109,10 +113,45 @@ _elm_bg_elm_layout_content_aliases_get(Eo *obj EINA_UNUSED, Elm_Bg_Data *_pd EIN
    return _content_aliases;
 }
 
+// TIZEN_ONLY(20160218): Improve launching performance.
+EAPI void
+elm_bg_precreated_object_set(Evas_Object *obj)
+{
+   INF("Set precreated obj(%p).", obj);
+   _precreated_bg_obj = obj;
+}
+
+EAPI Evas_Object *
+elm_bg_precreated_object_get(void)
+{
+   INF("Get precreated obj(%p).", _precreated_bg_obj);
+   return _precreated_bg_obj;
+}
+//
+
 EAPI Evas_Object *
 elm_bg_add(Evas_Object *parent)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+// TIZEN_ONLY(20160218): Improve launching performance.
+   if (_precreated_bg_obj)
+     {
+        Evas_Object *par_obj = elm_widget_parent_get(_precreated_bg_obj);
+
+        if (par_obj == parent)
+          {
+             Evas_Object *above_obj = evas_object_above_get(_precreated_bg_obj);
+             if (above_obj)
+               evas_object_raise(_precreated_bg_obj);
+
+             Evas_Object *tmp = _precreated_bg_obj;
+             _precreated_bg_obj = NULL;
+             INF("Return precreated obj(%p).", tmp);
+             return tmp;
+          }
+     }
+//
+
    Evas_Object *obj = eo_add(MY_CLASS, parent);
    return obj;
 }
index f6f3f3e..d1fbd7d 100644 (file)
@@ -91,4 +91,32 @@ EAPI Eina_Bool elm_bg_file_set(Eo *obj, const char *file, const char *group);
  */
 EAPI void elm_bg_file_get(const Eo *obj, const char **file, const char **group);
 
+// TIZEN_ONLY(20160218): Improve launching performance.
+/**
+ * @internal
+ *
+ * Set the precreated object.
+ *
+ * @param obj The background object
+ *
+ * @ingroup Bg
+ * @see elm_bg_precreated_object_get()
+ * @since Tizen 2.4
+ */
+EAPI void elm_bg_precreated_object_set(Evas_Object *obj);
+
+/**
+ * @internal
+ *
+ * Get the precreated object.
+ *
+ * @return The precreated background object
+ *
+ * @ingroup Bg
+ * @see elm_bg_precreated_object_set()
+ * @since Tizen 2.4
+ */
+EAPI Evas_Object *elm_bg_precreated_object_get(void);
+//
+
 #include "elm_bg.eo.legacy.h"
index 2c47100..00217d0 100644 (file)
@@ -43,6 +43,10 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
    {NULL, NULL}
 };
 
+// TIZEN_ONLY(20160218): Improve launching performance.
+static Evas_Object *_precreated_conform_obj = NULL;
+//
+
 /* Example of env vars:
  * ILLUME_KBD="0, 0, 800, 301"
  * ILLUME_IND="0, 0, 800, 32"
@@ -996,10 +1000,44 @@ _elm_conformant_elm_layout_content_aliases_get(Eo *obj EINA_UNUSED, Elm_Conforma
    return _content_aliases;
 }
 
+// TIZEN_ONLY(20160218): Improve launching performance.
+EAPI void
+elm_conformant_precreated_object_set(Evas_Object *obj)
+{
+   INF("Set precreated obj(%p).", obj);
+   _precreated_conform_obj = obj;
+}
+
+EAPI Evas_Object *
+elm_conformant_precreated_object_get(void)
+{
+   INF("Get precreated obj(%p).", _precreated_conform_obj);
+   return _precreated_conform_obj;
+}
+//
+
 EAPI Evas_Object *
 elm_conformant_add(Evas_Object *parent)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+// TIZEN_ONLY(20160218): Improve launching performance.
+   if (_precreated_conform_obj)
+     {
+        Evas_Object *par_obj = elm_widget_parent_get(_precreated_conform_obj);
+
+        if (par_obj == parent)
+          {
+             Evas_Object *above_obj = evas_object_above_get(_precreated_conform_obj);
+             if (above_obj)
+               evas_object_raise(_precreated_conform_obj);
+
+             Evas_Object *tmp = _precreated_conform_obj;
+             _precreated_conform_obj = NULL;
+             INF("Return precreated obj(%p).", tmp);
+             return tmp;
+          }
+     }
+//
    Evas_Object *obj = eo_add(MY_CLASS, parent);
    return obj;
 }
index e47991a..9315c5e 100644 (file)
  */
 EAPI Evas_Object                 *elm_conformant_add(Evas_Object *parent);
 
+// TIZEN_ONLY(20160218): Improve launching performance.
+/**
+ * @internal
+ *
+ * Set the precreated object.
+ *
+ * @param obj The conformant object
+ *
+ * @ingroup Conformant
+ * @see elm_conformant_precreated_object_get()
+ * @since Tizen 2.4
+ */
+EAPI void                         elm_conformant_precreated_object_set(Evas_Object *obj);
+
+/**
+ * @internal
+ *
+ * Get the precreated object.
+ *
+ * @return The precreated conformant object
+ *
+ * @ingroup Conformant
+ * @see elm_conformant_precreated_object_set()
+ * @since Tizen 2.4
+ */
+EAPI Evas_Object                 *elm_conformant_precreated_object_get(void);
+//
index 5fd22d1..f09270a 100644 (file)
@@ -294,6 +294,10 @@ int _elm_win_deferred_free = 0;
 
 static int _elm_win_count = 0;
 
+// TIZEN_ONLY(20160218): Improve launching performance.
+static Evas_Object *_precreated_win_obj = NULL;
+//
+
 static Eina_Bool _elm_win_auto_throttled = EINA_FALSE;
 
 static Ecore_Timer *_elm_win_state_eval_timer = NULL;
@@ -3260,11 +3264,47 @@ _elm_x_io_err(void *data EINA_UNUSED)
 }
 #endif
 
+// TIZEN_ONLY(20160218): Improve launching performance.
+EAPI void
+elm_win_precreated_object_set(Evas_Object *obj)
+{
+   INF("Set precreated obj(%p).", obj);
+   _precreated_win_obj = obj;
+}
+
+EAPI Evas_Object *
+elm_win_precreated_object_get(void)
+{
+   INF("Get precreated obj(%p).", _precreated_win_obj);
+   return _precreated_win_obj;
+}
+//
+
 EAPI Evas_Object *
 elm_win_add(Evas_Object *parent,
             const char *name,
             Elm_Win_Type type)
 {
+// TIZEN_ONLY(20160218): Improve launching performance.
+   if (_precreated_win_obj)
+     {
+        ELM_WIN_DATA_GET(_precreated_win_obj, sd);
+
+        if (sd)
+          {
+             if ((sd->type == type) && (sd->parent == parent))
+               {
+                  Evas_Object *tmp = _precreated_win_obj;
+                  TRAP(sd, name_class_set, name, _elm_appname);
+                  _precreated_win_obj = NULL;
+                  INF("Return precreated obj(%p).", tmp);
+
+                  return tmp;
+               }
+          }
+     }
+//
+
    Evas_Object *obj = eo_add(MY_CLASS, parent,
                              elm_obj_win_name_set(name),
                              elm_obj_win_type_set(type));
index 883b375..091d1cc 100644 (file)
@@ -227,3 +227,31 @@ EAPI void                  elm_win_wm_rotation_preferred_rotation_set(const Evas
  * this is definitely not the function you are looking for.
  */
 EAPI Ecore_Window          elm_win_window_id_get(const Evas_Object *obj);
+
+// TIZEN_ONLY(20160218): Improve launching performance.
+/**
+ * @internal
+ *
+ * Set the precreated object.
+ *
+ * @param obj The window object
+ *
+ * @ingroup Win
+ * @see elm_win_precreated_object_get()
+ * @since Tizen 2.4
+ */
+EAPI void                  elm_win_precreated_object_set(Evas_Object *obj);
+
+/**
+ * @internal
+ *
+ * Get the precreated object.
+ *
+ * @return The precreated window object
+ *
+ * @ingroup Win
+ * @see elm_win_precreated_object_set()
+ * @since Tizen 2.4
+ */
+EAPI Evas_Object          *elm_win_precreated_object_get(void);
+//