Add bind display function 27/60727/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 26 Feb 2016 13:31:53 +0000 (22:31 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 26 Feb 2016 13:31:53 +0000 (22:31 +0900)
Change-Id: Ibe7b74943f5d302f7d5b3e4771903fd3bb7b1d1a

src/tbm_bufmgr.c
src/tbm_bufmgr_backend.h

index f54fdf5..4895ca7 100644 (file)
@@ -1832,3 +1832,23 @@ _tbm_bo_set_surface(tbm_bo bo, tbm_surface_h surface)
        return 1;
 }
 
+int
+tbm_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *NativeDisplay)
+{
+       TBM_RETURN_VAL_IF_FAIL(TBM_BUFMGR_IS_VALID(bufmgr), 0);
+
+       int ret;
+
+       pthread_mutex_lock(&bufmgr->lock);
+
+       ret = bufmgr->backend->bufmgr_bind_native_display(bufmgr, NativeDisplay);
+       if (!ret) {
+               pthread_mutex_unlock(&bufmgr->lock);
+               return 0;
+       }
+
+       pthread_mutex_unlock(&bufmgr->lock);
+
+       return 1;
+}
+
index a1a6f34..a52af91 100644 (file)
@@ -295,6 +295,14 @@ struct _tbm_bufmgr_backend {
        */
        int (*bo_get_flags)(tbm_bo bo);
 
+       /**
+       * @brief get the tbm flags of memory type
+       * @param[in] bo : the buffer object
+       * @see #TBM_BO_FLAGS
+       * @return tbm flags of memory type is this function succeeds, otherwise 0.
+       */
+       int (*bufmgr_bind_native_display)(tbm_bufmgr bufmgr, void *NativeDisplay);
+
        /* Padding for future extension */
        void (*reserved1)(void);
        void (*reserved2)(void);