From: joonbum.ko Date: Tue, 26 Sep 2017 09:53:23 +0000 (+0900) Subject: tpl_wayland_egl_thread: Added internal APIs to get surface capabilities. X-Git-Tag: accepted/tizen/unified/20171206.063114~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F64%2F161964%2F2;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git tpl_wayland_egl_thread: Added internal APIs to get surface capabilities. Change-Id: Ibefc57b2cffe0be2de82d88ba9bce0a42ae1b9bb Signed-off-by: joonbum.ko --- diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index f38c427..688781c 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1015,6 +1015,44 @@ twe_display_unlock(twe_display_h display) TPL_OBJECT_UNLOCK(&disp_source->obj); } +tpl_result_t +twe_display_get_buffer_count(twe_display_h display, + int *min, int *max) +{ + twe_wl_disp_source *disp_source = (twe_wl_disp_source *)display; + if (!disp_source || g_source_is_destroyed(&disp_source->gsource)) { + TPL_ERR("Invalid parameter. display(%p)", display); + return TPL_ERROR_INVALID_PARAMETER; + } + + if (min) *min = disp_source->surface_capabilities.min_buffer; + if (max) *max = disp_source->surface_capabilities.max_buffer; + + return TPL_ERROR_NONE; +} + +tpl_result_t +twe_display_get_present_mode(twe_display_h display, + int *present_modes) +{ + twe_wl_disp_source *disp_source = (twe_wl_disp_source *)display; + if (!disp_source || g_source_is_destroyed(&disp_source->gsource)) { + TPL_ERR("Invalid parameter. display(%p)", display); + return TPL_ERROR_INVALID_PARAMETER; + } + + if (present_modes) { + *present_modes = TPL_DISPLAY_PRESENT_MODE_MAILBOX | + TPL_DISPLAY_PRESENT_MODE_IMMEDIATE | + TPL_DISPLAY_PRESENT_MODE_FIFO | + TPL_DISPLAY_PRESENT_MODE_FIFO_RELAXED | + disp_source->surface_capabilities.present_modes; + } + + return TPL_ERROR_NONE; +} + + static void __cb_destroy_callback(void *private) { diff --git a/src/tpl_wayland_egl_thread.h b/src/tpl_wayland_egl_thread.h index 0348b1c..e7b311c 100644 --- a/src/tpl_wayland_egl_thread.h +++ b/src/tpl_wayland_egl_thread.h @@ -30,6 +30,15 @@ twe_display_lock(twe_display_h display); void twe_display_unlock(twe_display_h display); +tpl_result_t +twe_display_get_buffer_count(twe_display_h display, + int *min, + int *max); + +tpl_result_t +twe_display_get_present_mode(twe_display_h display, + int *present_modes); + twe_surface_h twe_surface_add(twe_thread* thread, twe_display_h twe_display,