From 699a3995021b62bb99e06b5644b8e66ee0880230 Mon Sep 17 00:00:00 2001 From: lihui Date: Wed, 28 Aug 2024 11:31:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Enative=20image=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=80=82=E9=85=8D=E4=B8=89=E6=96=B9wx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lihui --- .../native_image/libnative_image.ndk.json | 8 ++++++ .../graphic_2d/native_image/native_image.h | 28 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index 4d9f20d89..cc12b88ad 100644 --- a/graphic/graphic_2d/native_image/libnative_image.ndk.json +++ b/graphic/graphic_2d/native_image/libnative_image.ndk.json @@ -22,5 +22,13 @@ { "first_introduced": "12", "name": "OH_ConsumerSurface_Create" + }, + { + "first_introduced": "13", + "name": "OH_ConsumerSuface_SetDefaultUsage" + }, + { + "first_introduced": "13", + "name": "OH_ConsumerSuface_SetDefaultSize" } ] \ 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 0a12a14dc..acac1ca3a 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -300,6 +300,34 @@ int32_t OH_NativeImage_ReleaseNativeWindowBuffer(OH_NativeImage* image, */ OH_NativeImage* OH_ConsumerSurface_Create(); +/** + * @brief Set the default usage of the OH_NativeImage.\n + * This interface dose not support concurrency.\n + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeImage + * @param image Indicates the pointer to a OH_NativeImage instance. + * @param usage Indicates the usage of the OH_NativeImage.Refer to the enum OH_NativeBuffer_Usage. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image is NULL. + * @since 13 + * @version 1.0 + */ +int32_t OH_ConsumerSuface_SetDefaultUsage(OH_NativeImage* image, uint64_t usage); + +/** + * @brief Set the default size of the OH_NativeImage.\n + * This interface dose not support concurrency.\n + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeImage + * @param image Indicates the pointer to a OH_NativeImage instance. + * @param width Indicates the width of the OH_NativeImage, and it should be greater than 0. + * @param height Indicates the height of the OH_NativeImage, and it should be greater than 0. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image is NULL or width, height less than or equal to 0. + * @since 13 + * @version 1.0 + */ +int32_t OH_ConsumerSuface_SetDefaultSize(OH_NativeImage* image, int32_t width, int32_t height); #ifdef __cplusplus } #endif