From: Hwankyu Jhun Date: Mon, 18 Sep 2017 00:43:19 +0000 (+0900) Subject: Merge branch 'tizen_3.0' into devel/tizen X-Git-Tag: accepted/tizen/4.0/unified/20170925.151101~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6e0e9298b1043ba8e5ef19bcfa8a98438f498cb;p=platform%2Fcore%2Fappfw%2Fscreen-connector.git Merge branch 'tizen_3.0' into devel/tizen Change-Id: Ia7fb9598eaac1524b06f7fd3fcebf38f1dfab254 Signed-off-by: Hwankyu Jhun --- f6e0e9298b1043ba8e5ef19bcfa8a98438f498cb diff --cc screen_connector_provider/src/screen_connector_provider.c index 403c975,70575e4..44225b2 --- a/screen_connector_provider/src/screen_connector_provider.c +++ b/screen_connector_provider/src/screen_connector_provider.c @@@ -95,18 -93,12 +95,18 @@@ EXPORT_API screen_connector_provider_h if (!__rsm) { LOGE("__rsm is not ready"); - return NULL; + goto out; } - rsm_wrapper = wl_proxy_create_wrapper(__rsm); - if (!rsm_wrapper) { - LOGE("failed to create wl display wrapper"); + if (!surface || !id) { + LOGE("invalid parameter"); - return NULL; + goto out; + } + - if (!surface || !id) { - LOGE("invalid parameter"); ++ rsm_wrapper = wl_proxy_create_wrapper(__rsm); ++ if (!rsm_wrapper) { ++ LOGE("failed to create wl display wrapper"); + goto out; } display = ecore_wl_display_get(); diff --cc screen_connector_watcher/include/screen_connector_toolkit.h index 473b072,1d91eee..d0e535c --- a/screen_connector_watcher/include/screen_connector_toolkit.h +++ b/screen_connector_watcher/include/screen_connector_toolkit.h @@@ -83,7 -82,11 +82,8 @@@ screen_connector_toolkit_h screen_conne int screen_connector_toolkit_bind(screen_connector_toolkit_h h, struct wl_surface *surface); int screen_connector_toolkit_unbind(screen_connector_toolkit_h h); -bool screen_connector_toolkit_is_exist(char *id, - screen_connector_screen_type_e type); -int screen_connector_toolkit_set_changed_event_filter( - screen_connector_toolkit_h h, - screen_connector_changed_event_filter_type type); +bool screen_connector_toolkit_is_exist(const char *id, screen_connector_screen_type_e type); ++int screen_connector_toolkit_set_changed_event_filter(screen_connector_toolkit_h h, screen_connector_changed_event_filter_type type); #ifdef __cplusplus } diff --cc screen_connector_watcher/src/screen_connector_toolkit.c index 1e3dcd6,5a7e018..343b420 --- a/screen_connector_watcher/src/screen_connector_toolkit.c +++ b/screen_connector_watcher/src/screen_connector_toolkit.c @@@ -552,4 -560,21 +559,19 @@@ EXPORT_API int screen_connector_toolkit return 0; } - + EXPORT_API int screen_connector_toolkit_set_changed_event_filter( + screen_connector_toolkit_h h, + screen_connector_changed_event_filter_type type) + { + if (!h || !(h->surface)) { + LOGE("Invalid param"); + return -1; + } + + tizen_remote_surface_set_changed_buffer_event_filter(h->surface, type); + h->changed_filter = type; + LOGD("set filter [%d] for [%s]", + h->changed_filter, h->instance_id); + return 0; + } - diff --cc screen_connector_watcher/src/screen_connector_watcher.c index e9dd976,d4653a7..596533a --- a/screen_connector_watcher/src/screen_connector_watcher.c +++ b/screen_connector_watcher/src/screen_connector_watcher.c @@@ -76,7 -76,7 +76,6 @@@ static void __buffer_changed(void *data screen_connector_info_h info = (screen_connector_info_h)data; if (info && info->ops) { -- if (info->renderable) { info->renderable = false; tizen_remote_surface_set_remote_render(info->surface, 0); diff --cc screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h index 65c7724,fbf9356..b5150cc --- a/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h +++ b/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h @@@ -113,7 -115,11 +115,9 @@@ int screen_connector_toolkit_evas_get_r screen_connector_toolkit_evas_h screen_connector_toolkit_evas_add_with_win(screen_connector_toolkit_evas_ops *ops, char *id, screen_connector_screen_type_e type, Evas_Object *win, void *data); int screen_connector_toolkit_evas_is_visible(Evas_Object *obj, bool *is_visible); - -visibility_type screen_connector_toolkit_evas_auto_visibility( - screen_connector_toolkit_evas_h h); -int screen_connector_toolkit_evas_set_changed_event_filter( - screen_connector_toolkit_evas_h toolkit_evas_h, ++visibility_type screen_connector_toolkit_evas_auto_visibility(screen_connector_toolkit_evas_h h); ++int screen_connector_toolkit_evas_set_changed_event_filter(screen_connector_toolkit_evas_h toolkit_evas_h, + screen_connector_evas_changed_event_filter_type type); /** * @} diff --cc screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c index 7a2f98f,0812e0e..a176d9f --- a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c +++ b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c @@@ -218,19 -332,15 +332,19 @@@ EXPORT_API int screen_connector_toolkit type_h = g_hash_table_lookup(__type_table, GINT_TO_POINTER(type)); if (type_h == NULL) { - type_h = (screen_connector_type_evas_h)calloc(1, sizeof(struct _screen_connector_type_evas_h)); + if (type_h == NULL) { + LOGE("Out of memory"); + return -1; + } + - type_h->toolkit_table = g_hash_table_new_full(g_str_hash, g_str_equal, free, __destroy_toolkit_evas_h); + g_hash_table_insert(__type_table, GINT_TO_POINTER(type), type_h); + + type_h->toolkit_table = g_hash_table_new_full(g_str_hash, g_str_equal, free, NULL); if (!type_h->toolkit_table) { LOGE("failed to create table"); - free(type_h); return -1; } - g_hash_table_insert(__type_table, GINT_TO_POINTER(type), type_h); } type_h->viewer_win = win; @@@ -350,7 -466,12 +470,12 @@@ static int __set_visibility(screen_conn if (!surface) return -1; - if (__delayed_resuming_time == 0) { + if (__delayed_resuming_time == 0 || - toolkit_evas_h->screen_type == SCREEN_CONNECTOR_SCREEEN_TYPE_WATCH) { ++ toolkit_evas_h->screen_type == SCREEN_CONNECTOR_SCREEN_TYPE_WATCH) { + if (obscured == TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_INVISIBLE) + tizen_remote_surface_transfer_touch_cancel(surface); + + LOGI("normal resume"); tizen_remote_surface_transfer_visibility(surface, obscured); return 0; @@@ -758,15 -965,12 +969,16 @@@ static void __toolkit_update_cb(struct c_buf_info = g_hash_table_lookup(__cur_buffer_table, toolkit_evas_h->cur_buffer); if (c_buf_info == NULL) { c_buf_info = (cur_buffer_info_h)calloc(1, sizeof(struct _cur_buffer_info_h)); - c_buf_info->cur_buffer = toolkit_evas_h->cur_buffer; - __cur_buffer_info_ref(c_buf_info); - g_hash_table_insert(__cur_buffer_table, toolkit_evas_h->cur_buffer, c_buf_info); + if (c_buf_info == NULL) { + LOGE("Out of memory"); + } else { + c_buf_info->cur_buffer = toolkit_evas_h->cur_buffer; + __cur_buffer_info_ref(c_buf_info); + g_hash_table_insert(__cur_buffer_table, toolkit_evas_h->cur_buffer, c_buf_info); + } } else { - __cur_buffer_info_ref(c_buf_info); + if (!duplicate_buffer) + __cur_buffer_info_ref(c_buf_info); } if (is_added) { @@@ -810,6 -1016,8 +1024,8 @@@ static void __toolkit_removed_cb(const return; } - toolkit_table = toolkit_evas_h->type_h->toolkit_table; + ++ toolkit_table = toolkit_evas_h->type_h->toolkit_table; if (toolkit_evas_h->img_tbm != NULL) { plug_id = evas_object_data_del(toolkit_evas_h->img_tbm, "___PLUGID"); if (plug_id) @@@ -979,7 -1194,26 +1202,25 @@@ static void __send_visibility(gpointer else type = VISIBILITY_TYPE_UNOBSCURED; - + __set_window_visibility_info(toolkit_evas_h, ev->win, type); + type = VISIBILITY_TYPE_FULLY_OBSCURED; + iter = toolkit_evas_h->viewer_visibility_list; + while (iter != NULL) { + visibility_h = (viewer_visibility_h)iter->data; + if (visibility_h->visibility == VISIBILITY_TYPE_UNKNOWN) { + LOGE("viewer not ready"); + return; + } else if (visibility_h->visibility == + VISIBILITY_TYPE_UNOBSCURED) { + type = VISIBILITY_TYPE_UNOBSCURED; + break; + } + iter = g_list_next(iter); + } + + LOGW("set visibility to %d", type); ret = __set_visibility(toolkit_evas_h, type); + toolkit_evas_h->auto_visibility = type; if (ret == -1) LOGE("failed to set object visibility set %p to %d", toolkit_evas_h->img_tbm, type); } diff --cc screen_connector_watcher_evas/src/screen_connector_watcher_evas.c index d5fa954,b39b4cf..a9719a1 --- a/screen_connector_watcher_evas/src/screen_connector_watcher_evas.c +++ b/screen_connector_watcher_evas/src/screen_connector_watcher_evas.c @@@ -76,27 -76,9 +76,28 @@@ static void __clear_img_file(img_info_ static img_info_h __create_img_info(const char *appid, const char *instance_id, int pid) { img_info_h info = (img_info_h)calloc(1, sizeof(struct _img_info_h)); ++ + if (info == NULL) { + LOGE("Fail to calloc img info"); + return NULL; + } + info->appid = strdup(appid); + if (info->appid == NULL) { + LOGE("Fail to strdup appid"); + free(info); + return NULL; + } + info->instance_id = strdup(instance_id); + if (info->instance_id == NULL) { + LOGE("Fail to strdup appid"); + free(info->appid); + free(info); + return NULL; + } info->pid = pid; + return info; }