tpl_display: Added a new frontend API that returns appropriate backend type. 64/139564/1
authorjoonbum.ko <joonbum.ko@samsung.com>
Wed, 19 Jul 2017 08:38:01 +0000 (17:38 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Wed, 19 Jul 2017 08:38:33 +0000 (17:38 +0900)
 - New API :
 tpl_backend_type_t tpl_display_get_backend_type(tpl_handle_t native_dpy)

 - The native_dpy, which can be supported by tpl,
  this function will return the corresponding backend type.
 - It is preferable to explicitly pass the returned backend type
  to tpl_display_create.

Change-Id: I987335e6e30c774b73d6bb79ff8c65fd05141baf
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl.h
src/tpl_display.c

index 8748add..b8277ba 100644 (file)
--- a/src/tpl.h
+++ b/src/tpl.h
@@ -367,6 +367,20 @@ tpl_display_filter_config(tpl_display_t *display, int *visual_id,
                                                  int alpha_size);
 
 /**
+ * Get the tpl_backend_type from given native_dpy.
+ *
+ * native_dpy, which can be supported by tpl, this function will return the
+ * corresponding backend type. It is preferable to explicitly pass
+ * the returned backend type to tpl_display_create.
+ *
+ * @param native_dpy handle to the native display.
+ * @return backend type for native_dpy, TPL_BACKEND_UNKNOWN if there is no
+ *  supported backend.
+ */
+tpl_backend_type_t
+tpl_display_get_backend_type(tpl_handle_t native_dpy);
+
+/**
  * Create a TPL surface for the given native surface.
  *
  * @param display display used for surface creation.
index d78f67a..f62fcfe 100644 (file)
@@ -137,6 +137,18 @@ tpl_display_filter_config(tpl_display_t *display, int *visual_id,
        return display->backend.filter_config(display, visual_id, alpha_size);
 }
 
+tpl_backend_type_t
+tpl_display_get_backend_type(tpl_handle_t native_dpy)
+{
+       tpl_backend_type_t ret = TPL_BACKEND_UNKNOWN;
+
+       ret = __tpl_display_choose_backend(native_dpy);
+
+       TPL_LOG_F("native_dpy(%p) choose backend type(%d)", native_dpy, ret);
+
+       return ret;
+}
+
 tpl_result_t
 tpl_display_get_native_window_info(tpl_display_t *display, tpl_handle_t window,
                                                                   int *width, int *height, tbm_format *format,