From: Changyeon Lee Date: Wed, 2 Mar 2016 08:42:01 +0000 (+0900) Subject: Add get plane data 2 X-Git-Tag: accepted/tizen/common/20160307.153307~2^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=feec3b7e45a49e7013b3c2446e9f94ec25232568;p=platform%2Fcore%2Fuifw%2Flibtbm.git Add get plane data 2 Change-Id: I9d44b01c425c1ae99c32fade829095fa9ac9a059 --- diff --git a/src/tbm_bufmgr_backend.h b/src/tbm_bufmgr_backend.h index 3c71a25..722c4e3 100644 --- a/src/tbm_bufmgr_backend.h +++ b/src/tbm_bufmgr_backend.h @@ -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); diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index bb51da2..e606913 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -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;