From eca8a857617828bc07a0d0a31d39012998fee5cf Mon Sep 17 00:00:00 2001 From: m00472246 Date: Wed, 15 May 2024 17:02:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81sdk=E4=B8=8A?= =?UTF-8?q?=E5=BA=93=20Signed-off-by:=20m00472246=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m00472246 --- graphic/graphic_2d/native_buffer/BUILD.gn | 5 +- graphic/graphic_2d/native_image/BUILD.gn | 5 +- graphic/graphic_2d/native_vsync/BUILD.gn | 6 +- graphic/graphic_2d/native_window/BUILD.gn | 1 + .../native_window/external_window.h | 14 +++ .../native_window/graphic_error_code.h | 87 +++++++++++++++++++ 6 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 graphic/graphic_2d/native_window/graphic_error_code.h diff --git a/graphic/graphic_2d/native_buffer/BUILD.gn b/graphic/graphic_2d/native_buffer/BUILD.gn index e7066d1cd..e6ee8a679 100644 --- a/graphic/graphic_2d/native_buffer/BUILD.gn +++ b/graphic/graphic_2d/native_buffer/BUILD.gn @@ -16,7 +16,10 @@ import("//build/ohos/ndk/ndk.gni") ohos_ndk_headers("native_buffer_header") { dest_dir = "$ndk_headers_out_dir/native_buffer" - sources = [ "//interface/sdk_c/graphic/graphic_2d/native_buffer/native_buffer.h" ] + sources = [ + "//interface/sdk_c/graphic/graphic_2d/native_buffer/native_buffer.h", + "//interface/sdk_c/graphic/graphic_2d/native_window/graphic_error_code.h", + ] } ohos_ndk_library("libnative_buffer_ndk") { diff --git a/graphic/graphic_2d/native_image/BUILD.gn b/graphic/graphic_2d/native_image/BUILD.gn index d4bc4f895..986489e71 100644 --- a/graphic/graphic_2d/native_image/BUILD.gn +++ b/graphic/graphic_2d/native_image/BUILD.gn @@ -16,7 +16,10 @@ import("//build/ohos/ndk/ndk.gni") ohos_ndk_headers("native_image_header") { dest_dir = "$ndk_headers_out_dir/native_image" - sources = [ "//interface/sdk_c/graphic/graphic_2d/native_image/native_image.h" ] + sources = [ + "//interface/sdk_c/graphic/graphic_2d/native_image/native_image.h", + "//interface/sdk_c/graphic/graphic_2d/native_window/graphic_error_code.h", + ] } ohos_ndk_library("libnative_image_ndk") { diff --git a/graphic/graphic_2d/native_vsync/BUILD.gn b/graphic/graphic_2d/native_vsync/BUILD.gn index f731c3b82..a5fdae51f 100644 --- a/graphic/graphic_2d/native_vsync/BUILD.gn +++ b/graphic/graphic_2d/native_vsync/BUILD.gn @@ -16,8 +16,10 @@ import("//build/ohos/ndk/ndk.gni") ohos_ndk_headers("native_vsync_header") { dest_dir = "$ndk_headers_out_dir/native_vsync" - sources = - [ "//interface/sdk_c/graphic/graphic_2d/native_vsync/native_vsync.h" ] + sources = [ + "//interface/sdk_c/graphic/graphic_2d/native_vsync/native_vsync.h", + "//interface/sdk_c/graphic/graphic_2d/native_window/graphic_error_code.h", + ] } ohos_ndk_library("libnative_vsync_ndk") { diff --git a/graphic/graphic_2d/native_window/BUILD.gn b/graphic/graphic_2d/native_window/BUILD.gn index d6f1baafb..054fc6b6d 100644 --- a/graphic/graphic_2d/native_window/BUILD.gn +++ b/graphic/graphic_2d/native_window/BUILD.gn @@ -19,6 +19,7 @@ ohos_ndk_headers("native_window_header") { sources = [ "//interface/sdk_c/graphic/graphic_2d/native_window/buffer_handle.h", "//interface/sdk_c/graphic/graphic_2d/native_window/external_window.h", + "//interface/sdk_c/graphic/graphic_2d/native_window/graphic_error_code.h", ] } diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index f851a3fee..b24a490c8 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -228,6 +228,20 @@ typedef enum NativeWindowOperation { * @since 12 */ GET_APP_FRAMEWORK_TYPE, + /** + * set hdr white point brightness, + * variable parameter in function is + * [in] float brightness. the value range is 0.0f to 1.0f. + * @since 12 + */ + SET_HDR_WHITE_POINT_BRIGHTNESS, + /** + * set sdr white point brightness, + * variable parameter in function is + * [in] float brightness. the value range is 0.0f to 1.0f. + * @since 12 + */ + SET_SDR_WHITE_POINT_BRIGHTNESS, } NativeWindowOperation; /** diff --git a/graphic/graphic_2d/native_window/graphic_error_code.h b/graphic/graphic_2d/native_window/graphic_error_code.h new file mode 100644 index 000000000..e7140bac3 --- /dev/null +++ b/graphic/graphic_2d/native_window/graphic_error_code.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INCLUDE_GRAPHIC_ERROR_CODE_H +#define INCLUDE_GRAPHIC_ERROR_CODE_H + +/** + * @addtogroup NativeWindow + * @{ + * + * @brief Provides the error codes for native window. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + * @since 12 + * @version 1.0 + */ + +/** + * @file external_window.h + * + * @brief Defines the error codes. + * + * @library libnative_window.so + * @since 12 + * @version 1.0 + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief interface error code. + * @since 12 + */ +typedef enum OHNativeErrorCode { + /** succeed */ + NATIVE_ERROR_OK = 0, + /** input invalid parameter */ + NATIVE_ERROR_INVALID_ARGUMENTS = 40001000, + /** unauthorized operation */ + NATIVE_ERROR_NO_PERMISSION = 40301000, + /** no idle buffer is available */ + NATIVE_ERROR_NO_BUFFER = 40601000, + /** the consumer side doesn't exist */ + NATIVE_ERROR_NO_CONSUMER = 41202000, + /** uninitialized */ + NATIVE_ERROR_NOT_INIT = 41203000, + /** the consumer is connected */ + NATIVE_ERROR_CONSUMER_IS_CONNECTED = 41206000, + /** the buffer status did not meet expectations */ + NATIVE_ERROR_BUFFER_STATE_INVALID = 41207000, + /** buffer is already in the cache queue */ + NATIVE_ERROR_BUFFER_IS_INCACHE = 41208000, + /** the buffer queue is full */ + NATIVE_ERROR_BUFFER_QUEUE_FULL = 41209000, + /** buffer is not in the cache queue */ + NATIVE_ERROR_BUFFER_NOT_INCACHE = 41210000, + /** the current device or platform does not support it */ + NATIVE_ERROR_UNSUPPORT = 50102000, + /** unknown error, please check log */ + NATIVE_ERROR_UNKNOW = 50002000, + /** the egl environment is abnormal */ + NATIVE_ERROR_EGL_STATE_UNKNOW = 60001000, + /** egl interface invocation failed */ + NATIVE_ERROR_EGL_API_FAILED = 60002000, +} OHNativeErrorCode; + +#ifdef __cplusplus +} +#endif + +#endif // INCLUDE_GRAPHIC_ERROR_CODE_H \ No newline at end of file -- Gitee From bb3498eb203976650993432d979849272fd12eb8 Mon Sep 17 00:00:00 2001 From: m00472246 Date: Fri, 17 May 2024 14:31:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E6=84=8F=E8=A7=81=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_window/graphic_error_code.h | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/graphic/graphic_2d/native_window/graphic_error_code.h b/graphic/graphic_2d/native_window/graphic_error_code.h index e7140bac3..3c22cbd11 100644 --- a/graphic/graphic_2d/native_window/graphic_error_code.h +++ b/graphic/graphic_2d/native_window/graphic_error_code.h @@ -48,35 +48,35 @@ extern "C" { * @since 12 */ typedef enum OHNativeErrorCode { - /** succeed */ + /** @error succeed */ NATIVE_ERROR_OK = 0, - /** input invalid parameter */ + /** @error input invalid parameter */ NATIVE_ERROR_INVALID_ARGUMENTS = 40001000, - /** unauthorized operation */ + /** @error unauthorized operation */ NATIVE_ERROR_NO_PERMISSION = 40301000, - /** no idle buffer is available */ + /** @error no idle buffer is available */ NATIVE_ERROR_NO_BUFFER = 40601000, - /** the consumer side doesn't exist */ + /** @error the consumer side doesn't exist */ NATIVE_ERROR_NO_CONSUMER = 41202000, - /** uninitialized */ + /** @error uninitialized */ NATIVE_ERROR_NOT_INIT = 41203000, - /** the consumer is connected */ - NATIVE_ERROR_CONSUMER_IS_CONNECTED = 41206000, - /** the buffer status did not meet expectations */ + /** @error the consumer is connected */ + NATIVE_ERROR_CONSUMER_CONNECTED = 41206000, + /** @error the buffer status did not meet expectations */ NATIVE_ERROR_BUFFER_STATE_INVALID = 41207000, - /** buffer is already in the cache queue */ - NATIVE_ERROR_BUFFER_IS_INCACHE = 41208000, - /** the buffer queue is full */ + /** @error buffer is already in the cache queue */ + NATIVE_ERROR_BUFFER_IN_CACHE = 41208000, + /** @error the buffer queue is full */ NATIVE_ERROR_BUFFER_QUEUE_FULL = 41209000, - /** buffer is not in the cache queue */ - NATIVE_ERROR_BUFFER_NOT_INCACHE = 41210000, - /** the current device or platform does not support it */ - NATIVE_ERROR_UNSUPPORT = 50102000, - /** unknown error, please check log */ - NATIVE_ERROR_UNKNOW = 50002000, - /** the egl environment is abnormal */ - NATIVE_ERROR_EGL_STATE_UNKNOW = 60001000, - /** egl interface invocation failed */ + /** @error buffer is not in the cache queue */ + NATIVE_ERROR_BUFFER_NOT_IN_CACHE = 41210000, + /** @error the current device or platform does not support it */ + NATIVE_ERROR_UNSUPPORTED = 50102000, + /** @error unknown error, please check log */ + NATIVE_ERROR_UNKNOWN = 50002000, + /** @error the egl environment is abnormal */ + NATIVE_ERROR_EGL_STATE_UNKNOWN = 60001000, + /** @error egl interface invocation failed */ NATIVE_ERROR_EGL_API_FAILED = 60002000, } OHNativeErrorCode; -- Gitee