Render in pre resume callback forcefully 72/151272/2
authorSemun Lee <semun.lee@samsung.com>
Tue, 5 Sep 2017 09:12:48 +0000 (18:12 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Wed, 20 Sep 2017 10:16:23 +0000 (19:16 +0900)
PRE_RESUME assumes at least one render, so render forcefully
in time tick callback.

Change-Id: I58cb8be2b041d6eb70683b04b025442e67950942
Signed-off-by: Semun Lee <semun.lee@samsung.com>
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
src/watch_app_main.c

index b9c9315..e6ce778 100755 (executable)
@@ -161,6 +161,7 @@ static int __app_event_converter[APPCORE_BASE_EVENT_MAX] = {
 
 struct watch_app_context __context;
 static double __prev_target_tick = -1;
+static Evas_Object *__watch_win;
 
 static void __on_ambient_tick(void *watchtime, void *data);
 static void __on_ambient_changed(int ambient, void *data);
@@ -579,6 +580,30 @@ static int __on_pause(void *data)
 }
 /* LCOV_EXCL_STOP */
 
+static void __on_pre_resume(void *data)
+{
+       int w, h;
+       Ecore_Evas *ee;
+       struct _watch_time_s timeinfo = {
+               .timezone = NULL
+       };
+
+       __get_timeinfo(&timeinfo);
+       __on_time_tick(&timeinfo, data);
+
+       if (timeinfo.timezone)
+               free(timeinfo.timezone);
+
+       if (__watch_win == NULL)
+               return;
+
+       ee = ecore_evas_ecore_evas_get(evas_object_evas_get(__watch_win));
+       evas_output_viewport_get(ecore_evas_get(ee), NULL, NULL, &w, &h);
+       evas_obscured_clear(ecore_evas_get(ee));
+       evas_damage_rectangle_add(ecore_evas_get(ee), 0, 0, w, h);
+       ecore_evas_manual_render(ee);
+}
+
 static int __on_resume(void *data)
 {
        _W("_watch_core_resume");
@@ -782,9 +807,8 @@ static int __viewer_state_handler(const char *widget_id, aul_app_com_result_e e,
                __on_pause(NULL);
        } else if (*state == AUL_SCREEN_STATUS_PRE_RESUME
                        && __pre_resume_called == 0) {
-               __get_timeinfo(&timeinfo);
                _D("call pre resume tick");
-               __on_time_tick(&timeinfo, NULL);
+               __on_pre_resume(NULL);
                __pre_resume_called = 1;
        }
 
@@ -1155,6 +1179,9 @@ static void __win_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info
        char *plug_id;
        plug_id = evas_object_data_del(obj, "___PLUGID");
        free(plug_id);
+
+       if (__watch_win == obj)
+               __watch_win = NULL;
 }
 
 EXPORT_API int watch_app_get_elm_win(Evas_Object **win)
@@ -1187,6 +1214,8 @@ EXPORT_API int watch_app_get_elm_win(Evas_Object **win)
        evas_object_event_callback_add(ret_win, EVAS_CALLBACK_DEL, __win_del_cb, NULL);
 
        *win = ret_win;
+       __watch_win = ret_win;
+
        return APP_ERROR_NONE;
 }