Add get plane data 2
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 2 Mar 2016 08:42:01 +0000 (17:42 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Wed, 2 Mar 2016 08:42:01 +0000 (17:42 +0900)
Change-Id: I9d44b01c425c1ae99c32fade829095fa9ac9a059

src/tbm_bufmgr_backend.h
src/tbm_surface_internal.c

index 3c71a25..722c4e3 100644 (file)
@@ -303,6 +303,22 @@ struct _tbm_bufmgr_backend {
        */
        int (*bufmgr_bind_native_display)(tbm_bufmgr bufmgr, void *NativeDisplay);
 
+       /**
+       * @brief get the plane data of the surface.
+       * @param[in] width : the width of the surface
+       * @param[in] height : the height of the surface
+       * @param[in] format : the format of the surface
+       * @param[in] plane_idx : the format of the surface
+       * @param[out] size : the size of the plane
+       * @param[out] offset : the offset of the plane
+       * @param[out] pitch : the pitch of the plane
+       * @param[out] bo_idx : the bo index of the plane
+       * @return 1 if this function succeeds, otherwise 0.
+       */
+       int (*surface_get_plane_data2)(int width, int height,
+                                      tbm_format format, int plane_idx, uint32_t *size, uint32_t *offset,
+                                      uint32_t *pitch, int *bo_idx);
+
        /* Padding for future extension */
        void (*reserved1)(void);
        void (*reserved2)(void);
index bb51da2..e606913 100644 (file)
@@ -230,6 +230,15 @@ _tbm_surface_internal_query_plane_data(tbm_surface_h surface,
        TBM_RETURN_VAL_IF_FAIL(surf->info.height > 0, 0);
        TBM_RETURN_VAL_IF_FAIL(surf->info.format > 0, 0);
 
+       if (mgr->backend->surface_get_plane_data2) {
+               ret = mgr->backend->surface_get_plane_data2(surf->info.width,
+                               surf->info.height, surf->info.format, plane_idx, size, offset, pitch, bo_idx);
+               if (!ret)
+                       return 0;
+
+               return 1;
+       }
+
        if (!mgr->backend->surface_get_plane_data)
                return 0;