From a2e33f5a5f80b2afa3677af3c1ef84bb0a3b4d2b Mon Sep 17 00:00:00 2001 From: m00472246 Date: Sat, 11 May 2024 09:24:01 +0800 Subject: [PATCH] =?UTF-8?q?matrix=E6=8C=89=E7=85=A7=E6=96=B0=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E6=8F=90=E4=BE=9B=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/graphic_2d/native_image/native_image.h | 13 +++++++++++++ .../graphic_2d/native_window/external_window.h | 18 ++++++++++++++++++ .../native_window/libnative_window.ndk.json | 3 ++- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index 45bb3093e47..63f539f2c73 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 b344a332cc9..77577ff3f6d 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 db6607b5f7f..f851a3fee9b 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -658,6 +658,24 @@ int32_t OH_NativeWindow_NativeWindowSetScalingModeV2(OHNativeWindow *window, OHS * @version 1.0 */ void OH_NativeWindow_SetBufferHold(OHNativeWindow *window); + +/** + * @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 + */ +int32_t OH_NativeWindow_GetLastFlushedBufferV2(OHNativeWindow *window, OHNativeWindowBuffer **buffer, + int *fenceFd, float matrix[16]); + #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 668400ec62f..5707571dabd 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