From 2deff37f2cbdd649465dd80f61bbcfd231e2fb16 Mon Sep 17 00:00:00 2001 From: m00472246 Date: Thu, 13 Jun 2024 09:35:44 +0800 Subject: [PATCH] =?UTF-8?q?sdk=E8=93=9D=E5=8C=BAbeta=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=20Signed-off-by:=20m00472246=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m00472246 --- .../native_image/libnative_image.ndk.json | 3 +- .../graphic_2d/native_image/native_image.h | 13 ++++++++ .../native_window/external_window.h | 33 ++++++++++++++----- .../native_window/libnative_window.ndk.json | 3 +- 4 files changed, 42 insertions(+), 10 deletions(-) diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index 45bb3093e..fbc8a27c0 100644 --- a/graphic/graphic_2d/native_image/libnative_image.ndk.json +++ b/graphic/graphic_2d/native_image/libnative_image.ndk.json @@ -9,5 +9,6 @@ { "name": "OH_NativeImage_GetSurfaceId" }, { "name": "OH_NativeImage_SetOnFrameAvailableListener" }, { "name": "OH_NativeImage_UnsetOnFrameAvailableListener" }, - { "name": "OH_NativeImage_Destroy" } + { "name": "OH_NativeImage_Destroy" }, + { "name": "OH_NativeImage_GetTransformMatrixV2" } ] \ No newline at end of file diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index b344a332c..77577ff3f 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -201,6 +201,19 @@ int32_t OH_NativeImage_UnsetOnFrameAvailableListener(OH_NativeImage* image); */ void OH_NativeImage_Destroy(OH_NativeImage** image); +/** + * @brief Obtains the transform matrix of the texture image by producer transform type.\n + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeImage + * @param image Indicates the pointer to a OH_NativeImage instance. + * @param matrix Indicates the retrieved 4*4 transform matrix . + * @return 0 - Success. + * 40001000 - image is NULL. + * @since 12 + * @version 1.0 + */ +int32_t OH_NativeImage_GetTransformMatrixV2(OH_NativeImage* image, float matrix[16]); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index db6607b5f..2437fac73 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -94,7 +94,7 @@ typedef enum NativeWindowOperation { /** * set native window buffer geometry, * variable parameter in function is - * [in] int32_t width, [in] int32_t height + * [in] int32_t height, [in] int32_t width */ SET_BUFFER_GEOMETRY, /** @@ -638,26 +638,43 @@ int32_t OH_NativeWindow_GetSurfaceId(OHNativeWindow *window, uint64_t *surfaceId int32_t OH_NativeWindow_CreateNativeWindowFromSurfaceId(uint64_t surfaceId, OHNativeWindow **window); /** - * @brief Sets scalingMode of a native window. + * @brief Set native window buffer hold. * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - * @param window indicates the pointer to an OHNativeWindow instance. - * @param scalingMode Indicates the enum value to OHScalingModeV2 - * @return Returns an error code, 0 is Success, otherwise, failed. + * @param window Indicates the pointer to an OHNativeWindow instance. * @since 12 * @version 1.0 */ -int32_t OH_NativeWindow_NativeWindowSetScalingModeV2(OHNativeWindow *window, OHScalingModeV2 scalingMode); +void OH_NativeWindow_SetBufferHold(OHNativeWindow *window); /** - * @brief Set native window buffer hold. + * @brief Get the last flushed OHNativeWindowBuffer from an OHNativeWindow instance. * * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow * @param window Indicates the pointer to an OHNativeWindow instance. + * @param buffer Indicates the pointer to an OHNativeWindowBuffer pointer. + * @param fenceFd Indicates the pointer to a file descriptor handle. + * @param matrix Indicates the retrieved 4*4 transform matrix. + * @return 0 - Success. + * 40001000 - window is NULL or buffer is NULL or fenceFd is NULL. + * 41207000 - buffer state is wrong. * @since 12 * @version 1.0 */ -void OH_NativeWindow_SetBufferHold(OHNativeWindow *window); +int32_t OH_NativeWindow_GetLastFlushedBufferV2(OHNativeWindow *window, OHNativeWindowBuffer **buffer, + int *fenceFd, float matrix[16]); + +/** + * @brief Sets scalingMode of a native window. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + * @param window indicates the pointer to an OHNativeWindow instance. + * @param scalingMode Indicates the enum value to OHScalingModeV2 + * @return Returns an error code, 0 is Success, otherwise, failed. + * @since 12 + * @version 1.0 + */ +int32_t OH_NativeWindow_NativeWindowSetScalingModeV2(OHNativeWindow *window, OHScalingModeV2 scalingMode); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_window/libnative_window.ndk.json b/graphic/graphic_2d/native_window/libnative_window.ndk.json index 668400ec6..5707571da 100644 --- a/graphic/graphic_2d/native_window/libnative_window.ndk.json +++ b/graphic/graphic_2d/native_window/libnative_window.ndk.json @@ -25,5 +25,6 @@ { "name": "OH_NativeWindow_CreateNativeWindowFromSurfaceId"}, { "name": "OH_NativeWindow_NativeWindowAttachBuffer" }, { "name": "OH_NativeWindow_NativeWindowDetachBuffer" }, - { "name": "OH_NativeWindow_SetBufferHold" } + { "name": "OH_NativeWindow_SetBufferHold" }, + { "name": "OH_NativeWindow_GetLastFlushedBufferV2" } ] \ No newline at end of file -- Gitee