mirror of
https://gitee.com/openharmony/interface_sdk_c
synced 2024-11-23 06:39:54 +00:00
去掉非ndk文件
Signed-off-by: huangdongting <huangdongting3@huawei.com>
This commit is contained in:
parent
edb445afe5
commit
362e2cdbce
24
OAT.xml
24
OAT.xml
@ -29,14 +29,26 @@
|
||||
</policylist>
|
||||
<filefilterlist>
|
||||
<filefilter name="defaultPolicyFilter" desc="compatibility,License Header Invalid">
|
||||
<filteritem type="filepath" name="third_party/musl/ndk_musl_include/*.h" desc="License matcher rules, NoLicenseHeader"/>
|
||||
<filteritem type="filepath" name="third_party/musl/ndk_script/*.h" desc="License matcher rules, NoLicenseHeader"/>
|
||||
<filteritem type="filepath" name="third_party/zlib/BUILD.gn" desc="License matcher rules, NoLicenseHeader"/>
|
||||
<filteritem type="filepath" name="third_party/node/src/*.h" desc="License matcher rules, NoLicenseHeader"/>
|
||||
<filteritem type="filepath" name="third_party/musl/.*" desc="License matcher rules, 三方软件不检查许可头"/>
|
||||
<filteritem type="filepath" name="third_party/libuv/.*" desc="License matcher rules, 三方软件不检查许可头"/>
|
||||
<filteritem type="filepath" name="third_party/zlib/.*" desc="License matcher rules, 三方软件不检查许可头"/>
|
||||
<filteritem type="filepath" name="third_party/node/.*" desc="License matcher rules, 三方软件不检查许可头"/>
|
||||
<filteritem type="filepath" name="third_party/openSLES/.*" desc="License matcher rules, 三方软件不检查许可头"/>
|
||||
<filteritem type="filepath" name="third_party/mindspore/.*" desc="License matcher rules, 三方软件不检查许可头"/>
|
||||
<filteritem type="filepath" name="third_party/egl/.*" desc="License matcher rules, 三方软件不检查许可头"/>
|
||||
<filteritem type="filepath" name="third_party/openGLES/.*" desc="License matcher rules, 三方软件不检查许可头"/>
|
||||
<filteritem type="filepath" name="third_party/vulkan-headers/.*" desc="License matcher rules, 三方软件不检查许可头"/>
|
||||
</filefilter>
|
||||
<filefilter name="copyrightPolicyFilter" desc="Copyright Header Invalid">
|
||||
<filteritem type="filepath" name="third_party/musl/ndk_musl_include/*.h" desc="Copyright matcher rules, NULL"/>
|
||||
<filteritem type="filepath" name="third_party/node/src/*.h" desc="Copyright matcher rules, NULL"/>
|
||||
<filteritem type="filepath" name="third_party/musl/.*" desc="Copyright matcher rules, 三方软件不检查版权"/>
|
||||
<filteritem type="filepath" name="third_party/libuv/.*" desc="Copyright matcher rules, 三方软件不检查版权"/>
|
||||
<filteritem type="filepath" name="third_party/zlib/.*" desc="Copyright matcher rules, 三方软件不检查版权"/>
|
||||
<filteritem type="filepath" name="third_party/node/.*" desc="Copyright matcher rules, 三方软件不检查版权"/>
|
||||
<filteritem type="filepath" name="third_party/openSLES/.*" desc="Copyright matcher rules, 三方软件不检查版权"/>
|
||||
<filteritem type="filepath" name="third_party/mindspore/.*" desc="Copyright matcher rules, 三方软件不检查版权"/>
|
||||
<filteritem type="filepath" name="third_party/egl/.*" desc="Copyright matcher rules, 三方软件不检查版权"/>
|
||||
<filteritem type="filepath" name="third_party/openGLES/.*" desc="Copyright matcher rules, 三方软件不检查版权"/>
|
||||
<filteritem type="filepath" name="third_party/vulkan-headers/.*" desc="Copyright matcher rules, 三方软件不检查版权"/>
|
||||
</filefilter>
|
||||
</filefilterlist>
|
||||
<licensematcherlist>
|
||||
|
@ -52,5 +52,32 @@
|
||||
"Owner": "yangshuai67@huawei.com",
|
||||
"Upstream URL": "https://github.com/KhronosGroup/OpenSL-ES-Registry.git",
|
||||
"Description": "OpenSL ES™ is a royalty-free, cross-platform, hardware-accelerated audio API tuned for embedded systems."
|
||||
},
|
||||
{
|
||||
"Name": "EGL",
|
||||
"License": "MIT License",
|
||||
"License File": "LICENSE",
|
||||
"Version Number": "1.5",
|
||||
"Owner": "lizheng2@huawei.com",
|
||||
"Upstream URL": "https://github.com/KhronosGroup/EGL-Registry.git",
|
||||
"Description": "EGL is an interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system."
|
||||
},
|
||||
{
|
||||
"Name": "openGLES",
|
||||
"License": "Apache-2.0",
|
||||
"License File": "NOTICE",
|
||||
"Version Number": "a301c9b4600e4074008b93fba17744a859fb763b",
|
||||
"Owner": "lizheng2@huawei.com",
|
||||
"Upstream URL": "https://github.com/KhronosGroup/OpenGL-Registry.git",
|
||||
"Description": "The OpenGL ES registry contains specifications of the core API and shading language; specifications of Khronos- and vendor-approved OpenGL ES extensions; header files corresponding to the specificatio"
|
||||
},
|
||||
{
|
||||
"Name": "Vulkan",
|
||||
"License": "Apache-2.0",
|
||||
"License File": "LICENSE",
|
||||
"Version Number": "v1.3.231",
|
||||
"Owner": "mengzhaobing@huawei.com",
|
||||
"Upstream URL": "https://github.com/KhronosGroup/Vulkan-Headers.git",
|
||||
"Description": "Vulkan header files and API registry"
|
||||
}
|
||||
]
|
||||
|
12
README.md
12
README.md
@ -2,12 +2,12 @@
|
||||
|
||||
## 简介
|
||||
|
||||
C API 公共仓,用来提交 C API 声明文件。
|
||||
C API 公共仓,用来提交 C API 声明头文件。
|
||||
|
||||
## 目录
|
||||
|
||||
```
|
||||
─ai
|
||||
|─ai
|
||||
| ├─neural_network_runtime
|
||||
├─arkui
|
||||
| ├─ace_engine
|
||||
@ -45,6 +45,14 @@ C API 公共仓,用来提交 C API 声明文件。
|
||||
|
||||
```
|
||||
|
||||
## C API规范指导
|
||||
|
||||
[C API用户指导]([docs/user_guide.md · OpenHarmony-SIG/interface_sdk_c - Gitee.com](https://gitee.com/openharmony-sig/interface_sdk_c/blob/master/docs/user_guide.md))
|
||||
|
||||
[C API接口编码规范]([docs/capi_naming.md · OpenHarmony-SIG/interface_sdk_c - Gitee.com](https://gitee.com/openharmony-sig/interface_sdk_c/blob/master/docs/capi_naming.md))
|
||||
|
||||
[C API构建添加指南]([docs/howto_add.md · OpenHarmony-SIG/interface_sdk_c - Gitee.com](https://gitee.com/openharmony-sig/interface_sdk_c/blob/master/docs/howto_add.md))
|
||||
|
||||
## 相关仓
|
||||
|
||||
[interface_sdk_c](https://gitee.com/openharmony-sig/interface_sdk_c/)
|
||||
|
@ -29,46 +29,3 @@ if (!is_cross_platform_build) {
|
||||
output_name = "ace_ndk"
|
||||
}
|
||||
}
|
||||
|
||||
ohos_shared_library("ace_ndk") {
|
||||
if (current_os == "ohos") {
|
||||
sanitize = {
|
||||
integer_overflow = true
|
||||
boundary_sanitize = true
|
||||
debug = ace_sanitize_debug
|
||||
}
|
||||
}
|
||||
include_dirs = [
|
||||
"//foundation/arkui/ace_engine",
|
||||
"//foundation/arkui/ace_engine/frameworks",
|
||||
"//foundation/arkui/ace_engine/interfaces/native",
|
||||
]
|
||||
|
||||
sources = [
|
||||
"//foundation/arkui/ace_engine/frameworks/core/components/xcomponent/native_interface_xcomponent_impl.cpp",
|
||||
"native_interface_xcomponent.cpp",
|
||||
]
|
||||
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
|
||||
cflags_cc = [ "-Wno-missing-braces" ]
|
||||
|
||||
if (target_os == "ohos") {
|
||||
sources += [ "$ace_root/adapter/ohos/osal/log_wrapper.cpp" ]
|
||||
deps += [ ":libace_ndk" ]
|
||||
external_deps = [ "hilog:libhilog" ]
|
||||
version_script =
|
||||
get_label_info(":libace_ndk", "target_gen_dir") + "/" +
|
||||
get_label_info(":libace_ndk", "name") + version_script_suffix
|
||||
} else if (target_os == "android") {
|
||||
sources += [ "$ace_root/adapter/android/osal/log_wrapper.cpp" ]
|
||||
libs = [ "log" ]
|
||||
}
|
||||
|
||||
subsystem_name = ace_engine_subsystem
|
||||
part_name = ace_engine_part
|
||||
}
|
||||
|
||||
group("ace_packages_ndk") {
|
||||
deps = [ ":ace_ndk" ]
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/distributeddatamgr/relational_store/relational_store.gni")
|
||||
|
||||
ohos_ndk_headers("native_rdb_ndk_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/database/rdb/"
|
||||
|
@ -17,9 +17,9 @@ import("//build/ohos/ndk/ndk.gni")
|
||||
ohos_ndk_headers("EGL_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/EGL"
|
||||
sources = [
|
||||
"//third_party/EGL/api/EGL/egl.h",
|
||||
"//third_party/EGL/api/EGL/eglext.h",
|
||||
"//third_party/EGL/api/EGL/eglplatform.h",
|
||||
"//interface/sdk_c/third_party/egl/EGL/egl.h",
|
||||
"//interface/sdk_c/third_party/egl/EGL/eglext.h",
|
||||
"//interface/sdk_c/third_party/egl/EGL/eglplatform.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -17,10 +17,10 @@ import("//build/ohos/ndk/ndk.gni")
|
||||
ohos_ndk_headers("GLES3_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/GLES3"
|
||||
sources = [
|
||||
"//third_party/openGLES/api/GLES3/gl3.h",
|
||||
"//third_party/openGLES/api/GLES3/gl31.h",
|
||||
"//third_party/openGLES/api/GLES3/gl32.h",
|
||||
"//third_party/openGLES/api/GLES3/gl3platform.h",
|
||||
"//interface/sdk_c/third_party/openGLES/GLES3/gl3.h",
|
||||
"//interface/sdk_c/third_party/openGLES/GLES3/gl31.h",
|
||||
"//interface/sdk_c/third_party/openGLES/GLES3/gl32.h",
|
||||
"//interface/sdk_c/third_party/openGLES/GLES3/gl3platform.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -16,5 +16,5 @@ import("//build/ohos/ndk/ndk.gni")
|
||||
|
||||
ohos_ndk_headers("KHR_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/KHR"
|
||||
sources = [ "//third_party/EGL/api/KHR/khrplatform.h" ]
|
||||
sources = [ "//interface/sdk_c/third_party/egl/KHR/khrplatform.h" ]
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import("//build/ohos/ndk/ndk.gni")
|
||||
|
||||
ohos_ndk_headers("native_buffer_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/native_buffer"
|
||||
sources = [ "//foundation/graphic/graphic_2d/interfaces/inner_api/surface/native_buffer.h" ]
|
||||
sources = [ "//interface/sdk_c/graphic/graphic_2d/native_buffer/native_buffer.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_buffer_ndk") {
|
||||
|
151
graphic/graphic_2d/native_buffer/native_buffer.h
Normal file
151
graphic/graphic_2d/native_buffer/native_buffer.h
Normal file
@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Copyright (c) 2022 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 NDK_INCLUDE_NATIVE_BUFFER_H_
|
||||
#define NDK_INCLUDE_NATIVE_BUFFER_H_
|
||||
|
||||
/**
|
||||
* @addtogroup OH_NativeBuffer
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the native buffer capability.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_buffer.h
|
||||
*
|
||||
* @brief Defines the functions for obtaining and using a native buffer.
|
||||
*
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct OH_NativeBuffer;
|
||||
typedef struct OH_NativeBuffer OH_NativeBuffer;
|
||||
|
||||
/**
|
||||
* @brief <b>OH_NativeBuffer</b> config. \n
|
||||
* Used to allocating new <b>OH_NativeBuffer</b> andquery parameters if existing ones.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct {
|
||||
int32_t width; ///< Width in pixels
|
||||
int32_t height; ///< Height in pixels
|
||||
int32_t format; ///< One of PixelFormat
|
||||
int32_t usage; ///< Combination of buffer usage
|
||||
} OH_NativeBuffer_Config;
|
||||
|
||||
/**
|
||||
* @brief Alloc a <b>OH_NativeBuffer</b> that matches the passed BufferRequestConfig. \n
|
||||
* A new <b>OH_NativeBuffer</b> instance is created each time this function is called.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer
|
||||
* @param config Indicates the pointer to a <b>BufferRequestConfig</b> instance.
|
||||
* @return Returns the pointer to the <b>OH_NativeBuffer</b> instance created if the operation is successful, \n
|
||||
* returns <b>NULL</b> otherwise.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_NativeBuffer* OH_NativeBuffer_Alloc(const OH_NativeBuffer_Config* config);
|
||||
|
||||
/**
|
||||
* @brief Adds the reference count of a OH_NativeBuffer.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer
|
||||
* @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeBuffer_Reference(OH_NativeBuffer *buffer);
|
||||
|
||||
/**
|
||||
* @brief Decreases the reference count of a OH_NativeBuffer and, when the reference count reaches 0, \n
|
||||
* destroys this OH_NativeBuffer.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer
|
||||
* @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeBuffer_Unreference(OH_NativeBuffer *buffer);
|
||||
|
||||
/**
|
||||
* @brief Return a config of the OH_NativeBuffer in the passed OHNativeBufferConfig struct.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer
|
||||
* @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
|
||||
* @param config Indicates the pointer to the <b>NativeBufferConfig</b> of the buffer.
|
||||
* @return <b>void</b>
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_NativeBuffer_GetConfig(OH_NativeBuffer *buffer, OH_NativeBuffer_Config* config);
|
||||
|
||||
/**
|
||||
* @brief Provide direct cpu access to the OH_NativeBuffer in the process's address space.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer
|
||||
* @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
|
||||
* @param virAddr Indicates the address of the <b>OH_NativeBuffer</b> in virtual memory.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
int32_t OH_NativeBuffer_Map(OH_NativeBuffer *buffer, void **virAddr);
|
||||
|
||||
/**
|
||||
* @brief Remove direct cpu access ability of the OH_NativeBuffer in the process's address space.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer
|
||||
* @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeBuffer_Unmap(OH_NativeBuffer *buffer);
|
||||
|
||||
/**
|
||||
* @brief Get the systen wide unique sequence number of the OH_NativeBuffer.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer
|
||||
* @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.
|
||||
* @return Returns the sequence number, which is unique for each OH_NativeBuffer.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
uint32_t OH_NativeBuffer_GetSeqNum(OH_NativeBuffer *buffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
@ -17,16 +17,16 @@ import("//build/ohos/ndk/ndk.gni")
|
||||
ohos_ndk_headers("native_drawing_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/native_drawing"
|
||||
sources = [
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_bitmap.h",
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_brush.h",
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_canvas.h",
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_color.h",
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_font_collection.h",
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_path.h",
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_pen.h",
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_text_declaration.h",
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_text_typography.h",
|
||||
"//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include/c/drawing_types.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_bitmap.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_brush.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_canvas.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_color.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_font_collection.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_path.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_pen.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_declaration.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_typography.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_types.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
132
graphic/graphic_2d/native_drawing/drawing_bitmap.h
Normal file
132
graphic/graphic_2d/native_drawing/drawing_bitmap.h
Normal file
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_BITMAP_H
|
||||
#define C_INCLUDE_DRAWING_BITMAP_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_bitmap.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>bitmap</b> object in the drawing module.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Defines the pixel format of a bitmap, including the color type and alpha type.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct {
|
||||
/** Storage format of bitmap pixels */
|
||||
OH_Drawing_ColorFormat colorFormat;
|
||||
/** Alpha format of bitmap pixels */
|
||||
OH_Drawing_AlphaFormat alphaFormat;
|
||||
} OH_Drawing_BitmapFormat;
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Bitmap</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Bitmap</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Bitmap* OH_Drawing_BitmapCreate(void);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_Bitmap</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_BitmapDestroy(OH_Drawing_Bitmap*);
|
||||
|
||||
/**
|
||||
* @brief Initializes the width and height of an <b>OH_Drawing_Bitmap</b> object
|
||||
* and sets the pixel format for the bitmap.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
|
||||
* @param width Indicates the width of the bitmap to be initialized.
|
||||
* @param height Indicates the height of the bitmap to be initialized.
|
||||
* @param OH_Drawing_BitmapFormat Indicates the pixel format of the bitmap to be initialized,
|
||||
* including the pixel color type and alpha type.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_BitmapBuild(
|
||||
OH_Drawing_Bitmap*, const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat*);
|
||||
|
||||
/**
|
||||
* @brief Obtains the width of a bitmap.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
|
||||
* @return Returns the width.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
uint32_t OH_Drawing_BitmapGetWidth(OH_Drawing_Bitmap*);
|
||||
|
||||
/**
|
||||
* @brief Obtains the height of a bitmap.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
|
||||
* @return Returns the height.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
uint32_t OH_Drawing_BitmapGetHeight(OH_Drawing_Bitmap*);
|
||||
|
||||
/**
|
||||
* @brief Obtains the pixel address of a bitmap. You can use this address to obtain the pixel data of the bitmap.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
|
||||
* @return Returns the pixel address.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void* OH_Drawing_BitmapGetPixels(OH_Drawing_Bitmap*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
117
graphic/graphic_2d/native_drawing/drawing_brush.h
Normal file
117
graphic/graphic_2d/native_drawing/drawing_brush.h
Normal file
@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_BRUSH_H
|
||||
#define C_INCLUDE_DRAWING_BRUSH_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_brush.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>brush</b> object in the drawing module.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Brush</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Brush</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Brush* OH_Drawing_BrushCreate(void);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_Brush</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Brush Indicates the pointer to an <b>OH_Drawing_Brush</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_BrushDestroy(OH_Drawing_Brush*);
|
||||
|
||||
/**
|
||||
* @brief Checks whether anti-aliasing is enabled for a brush. If anti-aliasing is enabled,
|
||||
* edges will be drawn with partial transparency.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Brush Indicates the pointer to an <b>OH_Drawing_Brush</b> object.
|
||||
* @return Returns <b>true</b> if anti-aliasing is enabled; returns <b>false</b> otherwise.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_Drawing_BrushIsAntiAlias(const OH_Drawing_Brush*);
|
||||
|
||||
/**
|
||||
* @brief Enables or disables anti-aliasing for a brush. If anti-aliasing is enabled,
|
||||
* edges will be drawn with partial transparency.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Brush Indicates the pointer to an <b>OH_Drawing_Brush</b> object.
|
||||
* @param bool Specifies whether to enable anti-aliasing. The value <b>true</b> means
|
||||
* to enable anti-aliasing, and <b>false</b> means the opposite.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_BrushSetAntiAlias(OH_Drawing_Brush*, bool);
|
||||
|
||||
/**
|
||||
* @brief Obtains the color of a brush. The color is used by the brush to fill in a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Brush Indicates the pointer to an <b>OH_Drawing_Brush</b> object.
|
||||
* @return Returns a 32-bit (ARGB) variable that describes the color.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
uint32_t OH_Drawing_BrushGetColor(const OH_Drawing_Brush*);
|
||||
|
||||
/**
|
||||
* @brief Sets the color for a brush. The color will be used by the brush to fill in a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Brush Indicates the pointer to an <b>OH_Drawing_Brush</b> object.
|
||||
* @param color Indicates the color to set, which is a 32-bit (ARGB) variable.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_BrushSetColor(OH_Drawing_Brush*, uint32_t color);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
182
graphic/graphic_2d/native_drawing/drawing_canvas.h
Normal file
182
graphic/graphic_2d/native_drawing/drawing_canvas.h
Normal file
@ -0,0 +1,182 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_H
|
||||
#define C_INCLUDE_DRAWING_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_canvas.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>canvas</b> object in the drawing module.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Canvas</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Canvas</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Canvas* OH_Drawing_CanvasCreate(void);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_Canvas</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasDestroy(OH_Drawing_Canvas*);
|
||||
|
||||
/**
|
||||
* @brief Binds a bitmap to a canvas so that the content drawn on the canvas
|
||||
* is output to the bitmap (this process is called CPU rendering).
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasBind(OH_Drawing_Canvas*, OH_Drawing_Bitmap*);
|
||||
|
||||
/**
|
||||
* @brief Attaches a pen to a canvas so that the canvas will use the style and color of the pen to outline a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasAttachPen(OH_Drawing_Canvas*, const OH_Drawing_Pen*);
|
||||
|
||||
/**
|
||||
* @brief Detaches the pen from a canvas so that the canvas will not use the style
|
||||
* and color of the pen to outline a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasDetachPen(OH_Drawing_Canvas*);
|
||||
|
||||
/**
|
||||
* @brief Attaches a brush to a canvas so that the canvas will use the style and color of the brush to fill in a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Brush Indicates the pointer to an <b>OH_Drawing_Brush</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasAttachBrush(OH_Drawing_Canvas*, const OH_Drawing_Brush*);
|
||||
|
||||
/**
|
||||
* @brief Detaches the brush from a canvas so that the canvas will not use the style
|
||||
* and color of the brush to fill in a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasDetachBrush(OH_Drawing_Canvas*);
|
||||
|
||||
/**
|
||||
* @brief Saves the current canvas status (canvas matrix) to the top of the stack.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasSave(OH_Drawing_Canvas*);
|
||||
|
||||
/**
|
||||
* @brief Restores the canvas status (canvas matrix) saved on the top of the stack.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasRestore(OH_Drawing_Canvas*);
|
||||
|
||||
/**
|
||||
* @brief Draws a line segment.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param x1 Indicates the x coordinate of the start point of the line segment.
|
||||
* @param y1 Indicates the y coordinate of the start point of the line segment.
|
||||
* @param x2 Indicates the x coordinate of the end point of the line segment.
|
||||
* @param y2 Indicates the y coordinate of the end point of the line segment.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasDrawLine(OH_Drawing_Canvas*, float x1, float y1, float x2, float y2);
|
||||
|
||||
/**
|
||||
* @brief Draws a path.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasDrawPath(OH_Drawing_Canvas*, const OH_Drawing_Path*);
|
||||
|
||||
/**
|
||||
* @brief Clears a canvas by using a specified color.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param color Indicates the color, which is a 32-bit (ARGB) variable.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasClear(OH_Drawing_Canvas*, uint32_t color);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
64
graphic/graphic_2d/native_drawing/drawing_color.h
Normal file
64
graphic/graphic_2d/native_drawing/drawing_color.h
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_COLOR_H
|
||||
#define C_INCLUDE_DRAWING_COLOR_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_color.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>color</b> object in the drawing module.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Converts four variables (alpha, red, green, and blue) into a 32-bit (ARGB) variable that describes a color.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param alpha Indicates a variable that describes alpha. The value ranges from 0x00 to 0xFF.
|
||||
* @param red Indicates a variable that describes red. The value ranges from 0x00 to 0xFF.
|
||||
* @param green Indicates a variable that describes green. The value ranges from 0x00 to 0xFF.
|
||||
* @param blue Indicates a variable that describes blue. The value ranges from 0x00 to 0xFF.
|
||||
* @return Returns a 32-bit (ARGB) variable that describes the color.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
uint32_t OH_Drawing_ColorSetArgb(uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
69
graphic/graphic_2d/native_drawing/drawing_font_collection.h
Normal file
69
graphic/graphic_2d/native_drawing/drawing_font_collection.h
Normal file
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_FONT_COLLECTION_H
|
||||
#define C_INCLUDE_DRAWING_FONT_COLLECTION_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the 2D drawing capability.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_font_collection.h
|
||||
*
|
||||
* @brief Declares functions related to <b>FontCollection</b> in the drawing module.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_text_declaration.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_FontCollection</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_FontCollection</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection(void);
|
||||
|
||||
/**
|
||||
* @brief Releases the memory occupied by an <b>OH_Drawing_FontCollection</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_FontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_DestroyFontCollection(OH_Drawing_FontCollection*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
166
graphic/graphic_2d/native_drawing/drawing_path.h
Normal file
166
graphic/graphic_2d/native_drawing/drawing_path.h
Normal file
@ -0,0 +1,166 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_PATH_H
|
||||
#define C_INCLUDE_DRAWING_PATH_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_path.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>path</b> object in the drawing module.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Path</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Path</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Path* OH_Drawing_PathCreate(void);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_Path</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathDestroy(OH_Drawing_Path*);
|
||||
|
||||
/**
|
||||
* @brief Sets the start point of a path.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param x Indicates the x coordinate of the start point.
|
||||
* @param y Indicates the y coordinate of the start point.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathMoveTo(OH_Drawing_Path*, float x, float y);
|
||||
|
||||
/**
|
||||
* @brief Draws a line segment from the last point of a path to the target point.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param x Indicates the x coordinate of the target point.
|
||||
* @param y Indicates the y coordinate of the target point.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathLineTo(OH_Drawing_Path*, float x, float y);
|
||||
|
||||
/**
|
||||
* @brief Draws an arc to a path.
|
||||
*
|
||||
* This is done by using angle arc mode. In this mode, a rectangle that encloses an ellipse is specified first,
|
||||
* and then a start angle and a sweep angle are specified.
|
||||
* The arc is a portion of the ellipse defined by the start angle and the sweep angle.
|
||||
* By default, a line segment from the last point of the path to the start point of the arc is also added.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param x1 Indicates the x coordinate of the upper left corner of the rectangle.
|
||||
* @param y1 Indicates the y coordinate of the upper left corner of the rectangle.
|
||||
* @param x2 Indicates the x coordinate of the lower right corner of the rectangle.
|
||||
* @param y2 Indicates the y coordinate of the lower right corner of the rectangle.
|
||||
* @param startDeg Indicates the start angle, in degrees.
|
||||
* @param sweepDeg Indicates the angle to sweep, in degrees.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathArcTo(OH_Drawing_Path*, float x1, float y1, float x2, float y2, float startDeg, float sweepDeg);
|
||||
|
||||
/**
|
||||
* @brief Draws a quadratic Bezier curve from the last point of a path to the target point.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param ctrlX Indicates the x coordinate of the control point.
|
||||
* @param ctrlY Indicates the y coordinate of the control point.
|
||||
* @param endX Indicates the x coordinate of the target point.
|
||||
* @param endY Indicates the y coordinate of the target point.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathQuadTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float endX, float endY);
|
||||
|
||||
/**
|
||||
* @brief Draws a cubic Bezier curve from the last point of a path to the target point.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param ctrlX1 Indicates the x coordinate of the first control point.
|
||||
* @param ctrlY1 Indicates the y coordinate of the first control point.
|
||||
* @param ctrlX2 Indicates the x coordinate of the second control point.
|
||||
* @param ctrlY2 Indicates the y coordinate of the second control point.
|
||||
* @param endX Indicates the x coordinate of the target point.
|
||||
* @param endY Indicates the y coordinate of the target point.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathCubicTo(
|
||||
OH_Drawing_Path*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY);
|
||||
|
||||
/**
|
||||
* @brief Closes a path. A line segment from the start point to the last point of the path is added.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathClose(OH_Drawing_Path*);
|
||||
|
||||
/**
|
||||
* @brief Resets path data.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathReset(OH_Drawing_Path*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
254
graphic/graphic_2d/native_drawing/drawing_pen.h
Normal file
254
graphic/graphic_2d/native_drawing/drawing_pen.h
Normal file
@ -0,0 +1,254 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_PEN_H
|
||||
#define C_INCLUDE_DRAWING_PEN_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_pen.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>pen</b> object in the drawing module.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Pen</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Pen</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Pen* OH_Drawing_PenCreate(void);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_Pen</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PenDestroy(OH_Drawing_Pen*);
|
||||
|
||||
/**
|
||||
* @brief Checks whether anti-aliasing is enabled for a pen. If anti-aliasing is enabled,
|
||||
* edges will be drawn with partial transparency.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @return Returns <b>true</b> if anti-aliasing is enabled; returns <b>false</b> otherwise.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_Drawing_PenIsAntiAlias(const OH_Drawing_Pen*);
|
||||
|
||||
/**
|
||||
* @brief Enables or disables anti-aliasing for a pen. If anti-aliasing is enabled,
|
||||
* edges will be drawn with partial transparency.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @param bool Specifies whether to enable anti-aliasing. The value <b>true</b> means
|
||||
* to enable anti-aliasing, and <b>false</b> means the opposite.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PenSetAntiAlias(OH_Drawing_Pen*, bool);
|
||||
|
||||
/**
|
||||
* @brief Obtains the color of a pen. The color is used by the pen to outline a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @return Returns a 32-bit (ARGB) variable that describes the color.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
uint32_t OH_Drawing_PenGetColor(const OH_Drawing_Pen*);
|
||||
|
||||
/**
|
||||
* @brief Sets the color for a pen. The color is used by the pen to outline a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @param color Indicates the color to set, which is a 32-bit (ARGB) variable.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PenSetColor(OH_Drawing_Pen*, uint32_t color);
|
||||
|
||||
/**
|
||||
* @brief Obtains the thickness of a pen. This thickness determines the width of the outline of a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @return Returns the thickness.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
float OH_Drawing_PenGetWidth(const OH_Drawing_Pen*);
|
||||
|
||||
/**
|
||||
* @brief Sets the thickness for a pen. This thickness determines the width of the outline of a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @param width Indicates the thickness to set, which is a variable.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PenSetWidth(OH_Drawing_Pen*, float width);
|
||||
|
||||
/**
|
||||
* @brief Obtains the stroke miter limit of a polyline drawn by a pen.
|
||||
*
|
||||
* When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded,
|
||||
* and a mitered corner is displayed if the miter limit is not exceeded.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @return Returns the miter limit.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
float OH_Drawing_PenGetMiterLimit(const OH_Drawing_Pen*);
|
||||
|
||||
/**
|
||||
* @brief Sets the stroke miter limit for a polyline drawn by a pen.
|
||||
*
|
||||
* When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded,
|
||||
* and a mitered corner is displayed if the miter limit is not exceeded.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @param miter Indicates a variable that describes the miter limit.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PenSetMiterLimit(OH_Drawing_Pen*, float miter);
|
||||
|
||||
/**
|
||||
* @brief Enumerates line cap styles of a pen. The line cap style defines
|
||||
* the style of both ends of a line segment drawn by the pen.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
* There is no cap style. Both ends of the line segment are cut off square.
|
||||
*/
|
||||
LINE_FLAT_CAP,
|
||||
/**
|
||||
* Square cap style. Both ends have a square, the height of which
|
||||
* is half of the width of the line segment, with the same width.
|
||||
*/
|
||||
LINE_SQUARE_CAP,
|
||||
/**
|
||||
* Round cap style. Both ends have a semicircle centered, the diameter of which
|
||||
* is the same as the width of the line segment.
|
||||
*/
|
||||
LINE_ROUND_CAP
|
||||
} OH_Drawing_PenLineCapStyle;
|
||||
|
||||
/**
|
||||
* @brief Obtains the line cap style of a pen.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @return Returns the line cap style.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_PenLineCapStyle OH_Drawing_PenGetCap(const OH_Drawing_Pen*);
|
||||
|
||||
/**
|
||||
* @brief Sets the line cap style for a pen.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @param OH_Drawing_PenLineCapStyle Indicates a variable that describes the line cap style.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PenSetCap(OH_Drawing_Pen*, OH_Drawing_PenLineCapStyle);
|
||||
|
||||
/**
|
||||
* @brief Enumerates pen line join styles. The line join style defines
|
||||
* the shape of the joints of a polyline segment drawn by the pen.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
* Mitered corner. If the angle of a polyline is small, its miter length may be inappropriate.
|
||||
* In this case, you need to use the miter limit to limit the miter length.
|
||||
*/
|
||||
LINE_MITER_JOIN,
|
||||
/** Round corner. */
|
||||
LINE_ROUND_JOIN,
|
||||
/** Beveled corner. */
|
||||
LINE_BEVEL_JOIN
|
||||
} OH_Drawing_PenLineJoinStyle;
|
||||
|
||||
/**
|
||||
* @brief Obtains the line join style of a pen.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @return Returns the line join style.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_PenLineJoinStyle OH_Drawing_PenGetJoin(const OH_Drawing_Pen*);
|
||||
|
||||
/**
|
||||
* @brief Sets the line join style for a pen.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @param OH_Drawing_PenLineJoinStyle Indicates a variable that describes the line join style.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PenSetJoin(OH_Drawing_Pen*, OH_Drawing_PenLineJoinStyle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
89
graphic/graphic_2d/native_drawing/drawing_text_declaration.h
Normal file
89
graphic/graphic_2d/native_drawing/drawing_text_declaration.h
Normal file
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_TEXT_DECLARATION_H
|
||||
#define C_INCLUDE_DRAWING_TEXT_DECLARATION_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the 2D drawing capability.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_text_declaration.h
|
||||
*
|
||||
* @brief Declares the data structure related to text in 2D drawing.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Defines an <b>OH_Drawing_FontCollection</b>, which is used to load fonts.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_FontCollection OH_Drawing_FontCollection;
|
||||
|
||||
/**
|
||||
* @brief Defines an <b>OH_Drawing_Typography</b>, which is used to manage the typography layout and display.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_Typography OH_Drawing_Typography;
|
||||
|
||||
/**
|
||||
* @brief Defines an <b>OH_Drawing_TextStyle</b>, which is used to manage text colors and decorations.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_TextStyle OH_Drawing_TextStyle;
|
||||
|
||||
/**
|
||||
* @brief Defines an <b>OH_Drawing_TypographyStyle</b>, which is used to manage the typography style,
|
||||
* such as the text direction.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_TypographyStyle OH_Drawing_TypographyStyle;
|
||||
|
||||
/**
|
||||
* @brief Defines an <b>OH_Drawing_TypographyCreate</b>, which is used to create an <b>OH_Drawing_Typography</b> object.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_TypographyCreate OH_Drawing_TypographyCreate;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
518
graphic/graphic_2d/native_drawing/drawing_text_typography.h
Normal file
518
graphic/graphic_2d/native_drawing/drawing_text_typography.h
Normal file
@ -0,0 +1,518 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_TEXT_TYPOGRAPHY_H
|
||||
#define C_INCLUDE_DRAWING_TEXT_TYPOGRAPHY_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the 2D drawing capability.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_text_typography.h
|
||||
*
|
||||
* @brief Declares functions related to <b>typography</b> in the drawing module.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "cstddef"
|
||||
#include "drawing_canvas.h"
|
||||
#include "drawing_color.h"
|
||||
#include "drawing_text_declaration.h"
|
||||
#include "drawing_types.h"
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enumerates text directions.
|
||||
*/
|
||||
enum OH_Drawing_TextDirection {
|
||||
/** Right to left (RTL) */
|
||||
TEXT_DIRECTION_RTL,
|
||||
/** Left to right (LTR) */
|
||||
TEXT_DIRECTION_LTR,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enumerates text alignment modes.
|
||||
*/
|
||||
enum OH_Drawing_TextAlign {
|
||||
/** Left-aligned */
|
||||
TEXT_ALIGN_LEFT,
|
||||
/** Right-aligned */
|
||||
TEXT_ALIGN_RIGHT,
|
||||
/** Center-aligned */
|
||||
TEXT_ALIGN_CENTER,
|
||||
/**
|
||||
* Justified, which means that each line (except the last line) is stretched so that every line has equal width,
|
||||
* and the left and right margins are straight.
|
||||
*/
|
||||
TEXT_ALIGN_JUSTIFY,
|
||||
/**
|
||||
* <b>TEXT_ALIGN_START</b> achieves the same effect as <b>TEXT_ALIGN_LEFT</b>
|
||||
* when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_LTR</b>;
|
||||
* it achieves the same effect as <b>TEXT_ALIGN_RIGHT</b>
|
||||
* when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_RTL</b>.
|
||||
*/
|
||||
TEXT_ALIGN_START,
|
||||
/**
|
||||
* <b>TEXT_ALIGN_END</b> achieves the same effect as <b>TEXT_ALIGN_RIGHT</b>
|
||||
* when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_LTR</b>;
|
||||
* it achieves the same effect as <b>TEXT_ALIGN_LEFT</b>
|
||||
* when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_RTL</b>.
|
||||
*/
|
||||
TEXT_ALIGN_END,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enumerates font weights.
|
||||
*/
|
||||
enum OH_Drawing_FontWeight {
|
||||
/** Thin */
|
||||
FONT_WEIGHT_100,
|
||||
/** Extra-light */
|
||||
FONT_WEIGHT_200,
|
||||
/** Light */
|
||||
FONT_WEIGHT_300,
|
||||
/** Normal/Regular */
|
||||
FONT_WEIGHT_400,
|
||||
/** Medium*/
|
||||
FONT_WEIGHT_500,
|
||||
/** Semi-bold */
|
||||
FONT_WEIGHT_600,
|
||||
/** Bold */
|
||||
FONT_WEIGHT_700,
|
||||
/** Extra-bold */
|
||||
FONT_WEIGHT_800,
|
||||
/** Black */
|
||||
FONT_WEIGHT_900,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enumerates text baselines.
|
||||
*/
|
||||
enum OH_Drawing_TextBaseline {
|
||||
/** Alphabetic, where the letters in alphabets like English sit on. */
|
||||
TEXT_BASELINE_ALPHABETIC,
|
||||
/** Ideographic. The baseline is at the bottom of the text area. */
|
||||
TEXT_BASELINE_IDEOGRAPHIC,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enumerates text decorations.
|
||||
*/
|
||||
enum OH_Drawing_TextDecoration {
|
||||
/** No decoration. */
|
||||
TEXT_DECORATION_NONE = 0x0,
|
||||
/** A underline is used for decoration. */
|
||||
TEXT_DECORATION_UNDERLINE = 0x1,
|
||||
/** An overline is used for decoration. */
|
||||
TEXT_DECORATION_OVERLINE = 0x2,
|
||||
/** A strikethrough is used for decoration. */
|
||||
TEXT_DECORATION_LINE_THROUGH = 0x4,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enumerates font styles.
|
||||
*/
|
||||
enum OH_Drawing_FontStyle {
|
||||
/** Normal style */
|
||||
FONT_STYLE_NORMAL,
|
||||
/** Italic style */
|
||||
FONT_STYLE_ITALIC,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_TypographyStyle</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_TypographyStyle</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_TypographyStyle* OH_Drawing_CreateTypographyStyle(void);
|
||||
|
||||
/**
|
||||
* @brief Releases the memory occupied by an <b>OH_Drawing_TypographyStyle</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_DestroyTypographyStyle(OH_Drawing_TypographyStyle*);
|
||||
|
||||
/**
|
||||
* @brief Sets the text direction.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
|
||||
* @param int Indicates the text direction to set. For details, see the enum <b>OH_Drawing_TextDirection</b>.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTypographyTextDirection(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextDirection */);
|
||||
|
||||
/**
|
||||
* @brief Sets the text alignment mode.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
|
||||
* @param int Indicates the text alignment mode to set. For details, see the enum <b>OH_Drawing_TextAlign</b>.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTypographyTextAlign(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextAlign */);
|
||||
|
||||
/**
|
||||
* @brief Sets the maximum number of lines in a text file.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
|
||||
* @param int Indicates the maximum number of lines to set.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTypographyTextMaxLines(OH_Drawing_TypographyStyle*, int /* maxLines */);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_TextStyle</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_TextStyle</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_TextStyle* OH_Drawing_CreateTextStyle(void);
|
||||
|
||||
/**
|
||||
* @brief Releases the memory occupied by an <b>OH_Drawing_TextStyle</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_DestroyTextStyle(OH_Drawing_TextStyle*);
|
||||
|
||||
/**
|
||||
* @brief Sets the text color.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param uint32_t Indicates the color to set.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleColor(OH_Drawing_TextStyle*, uint32_t /* color */);
|
||||
|
||||
/**
|
||||
* @brief Sets the font size.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param double Indicates the font size to set.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleFontSize(OH_Drawing_TextStyle*, double /* fontSize */);
|
||||
|
||||
/**
|
||||
* @brief Sets the font weight.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param int Indicates the font weight to set. For details, see the enum <b>OH_Drawing_FontWeight</b>.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleFontWeight(OH_Drawing_TextStyle*, int /* OH_Drawing_FontWeight */);
|
||||
|
||||
/**
|
||||
* @brief Sets the text baseline.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param int Indicates the text baseline to set. For details, see the enum <b>OH_Drawing_TextBaseline</b>.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleBaseLine(OH_Drawing_TextStyle*, int /* OH_Drawing_TextBaseline */);
|
||||
|
||||
/**
|
||||
* @brief Sets the text decoration.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param int Indicates the text decoration to set. For details, see the enum <b>OH_Drawing_TextDecoration</b>.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleDecoration(OH_Drawing_TextStyle*, int /* OH_Drawing_TextDecoration */);
|
||||
|
||||
/**
|
||||
* @brief Sets the color for the text decoration.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param uint32_t Indicates the color to set.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleDecorationColor(OH_Drawing_TextStyle*, uint32_t /* color */);
|
||||
|
||||
/**
|
||||
* @brief Sets the font height.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param double Indicates the font height to set.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleFontHeight(OH_Drawing_TextStyle*, double /* fontHeight */);
|
||||
|
||||
/**
|
||||
* @brief Sets the font families.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param int Indicates the number of font families to set.
|
||||
* @param char Indicates the pointer to the font families to set.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleFontFamilies(OH_Drawing_TextStyle*,
|
||||
int /* fontFamiliesNumber */, const char* fontFamilies[]);
|
||||
|
||||
/**
|
||||
* @brief Sets the font style.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param int Indicates the font style to set. For details, see the enum <b>OH_Drawing_FontStyle</b>.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleFontStyle(OH_Drawing_TextStyle*, int /* OH_Drawing_FontStyle */);
|
||||
|
||||
/**
|
||||
* @brief Sets the locale.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @param char Indicates the pointer to the locale to set.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SetTextStyleLocale(OH_Drawing_TextStyle*, const char*);
|
||||
|
||||
/**
|
||||
* @brief Creates a pointer to an <b>OH_Drawing_TypographyCreate</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
|
||||
* @param OH_Drawing_FontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_TypographyCreate</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler(OH_Drawing_TypographyStyle*,
|
||||
OH_Drawing_FontCollection*);
|
||||
|
||||
/**
|
||||
* @brief Releases the memory occupied by an <b>OH_Drawing_TypographyCreate</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_DestroyTypographyHandler(OH_Drawing_TypographyCreate*);
|
||||
|
||||
/**
|
||||
* @brief Sets the text style.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
|
||||
* @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_TypographyHandlerPushTextStyle(OH_Drawing_TypographyCreate*, OH_Drawing_TextStyle*);
|
||||
|
||||
/**
|
||||
* @brief Sets the text content.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
|
||||
* @param char Indicates the pointer to the text content to set.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_TypographyHandlerAddText(OH_Drawing_TypographyCreate*, const char*);
|
||||
|
||||
/**
|
||||
* @brief Removes the topmost style in the stack, leaving the remaining styles in effect.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_TypographyHandlerPopTextStyle(OH_Drawing_TypographyCreate*);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Typography</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Typography</b> object created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Typography* OH_Drawing_CreateTypography(OH_Drawing_TypographyCreate*);
|
||||
|
||||
/**
|
||||
* @brief Releases the memory occupied by an <b>OH_Drawing_Typography</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_DestroyTypography(OH_Drawing_Typography*);
|
||||
|
||||
/**
|
||||
* @brief Lays out the typography.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @param double Indicates the maximum text width to set.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_TypographyLayout(OH_Drawing_Typography*, double /* maxWidth */);
|
||||
|
||||
/**
|
||||
* @brief Paints text on the canvas.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param double Indicates the x coordinate.
|
||||
* @param double Indicates the y coordinate.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_TypographyPaint(OH_Drawing_Typography*, OH_Drawing_Canvas*,
|
||||
double /* potisionX */, double /* potisionY */);
|
||||
|
||||
/**
|
||||
* @brief Gets the max width.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @return Returns the max width.
|
||||
* @since 9
|
||||
* @version 1.1
|
||||
*/
|
||||
double OH_Drawing_TypographyGetMaxWidth(OH_Drawing_Typography*);
|
||||
|
||||
/**
|
||||
* @brief Gets the height.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @return Returns the height.
|
||||
* @since 9
|
||||
* @version 1.1
|
||||
*/
|
||||
double OH_Drawing_TypographyGetHeight(OH_Drawing_Typography*);
|
||||
|
||||
/**
|
||||
* @brief Gets the longest line.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @return Returns the length of the longest line.
|
||||
* @since 9
|
||||
* @version 1.1
|
||||
*/
|
||||
double OH_Drawing_TypographyGetLongestLine(OH_Drawing_Typography*);
|
||||
|
||||
/**
|
||||
* @brief Gets the min intrinsic width.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @return Returns the min intrinsic width.
|
||||
* @since 9
|
||||
* @version 1.1
|
||||
*/
|
||||
double OH_Drawing_TypographyGetMinIntrinsicWidth(OH_Drawing_Typography*);
|
||||
|
||||
/**
|
||||
* @brief Gets the max intrinsic width.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @return Returns the max intrinsic width.
|
||||
* @since 9
|
||||
* @version 1.1
|
||||
*/
|
||||
double OH_Drawing_TypographyGetMaxIntrinsicWidth(OH_Drawing_Typography*);
|
||||
|
||||
/**
|
||||
* @brief Gets the alphabetic baseline.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @return Returns the alphabetic baseline.
|
||||
* @since 9
|
||||
* @version 1.1
|
||||
*/
|
||||
double OH_Drawing_TypographyGetAlphabeticBaseline(OH_Drawing_Typography*);
|
||||
|
||||
/**
|
||||
* @brief Gets the ideographic baseline.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @return Returns the ideographic baseline.
|
||||
* @since 9
|
||||
* @version 1.1
|
||||
*/
|
||||
double OH_Drawing_TypographyGetIdeographicBaseline(OH_Drawing_Typography*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
141
graphic/graphic_2d/native_drawing/drawing_types.h
Normal file
141
graphic/graphic_2d/native_drawing/drawing_types.h
Normal file
@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 C_INCLUDE_DRAWING_TYPES_H
|
||||
#define C_INCLUDE_DRAWING_TYPES_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_types.h
|
||||
*
|
||||
* @brief Declares the data types for drawing 2D graphics, including the canvas, brush, pen, bitmap, and path.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Defines a rectangular canvas on which various shapes, images,
|
||||
* and texts can be drawn by using the brush and pen.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_Canvas OH_Drawing_Canvas;
|
||||
|
||||
/**
|
||||
* @brief Defines a pen, which is used to describe the style and color to outline a shape.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_Pen OH_Drawing_Pen;
|
||||
|
||||
/**
|
||||
* @brief Defines as a brush, which is used to describe the style and color to fill in a shape.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_Brush OH_Drawing_Brush;
|
||||
|
||||
/**
|
||||
* @brief Defines a path, which is used to customize various shapes.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_Path OH_Drawing_Path;
|
||||
|
||||
/**
|
||||
* @brief Defines a bitmap, which is a memory that contains the pixel data of a shape.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap;
|
||||
|
||||
/**
|
||||
* @brief Enumerates storage formats of bitmap pixels.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/** Unknown format. */
|
||||
COLOR_FORMAT_UNKNOWN,
|
||||
/** Each pixel is represented by 8 bits, which together indicate alpha. */
|
||||
COLOR_FORMAT_ALPHA_8,
|
||||
/**
|
||||
* Each pixel is represented by 16 bits. From the most significant bit to the least significant bit,
|
||||
* the first 5 bits indicate red, the subsequent 6 bits indicate green, and the last 5 bits indicate blue.
|
||||
*/
|
||||
COLOR_FORMAT_RGB_565,
|
||||
/**
|
||||
* Each pixel is represented by 16 bits. From the most significant bit to the least significant bit,
|
||||
* every 4 bits indicate alpha, red, green, and blue, respectively.
|
||||
*/
|
||||
COLOR_FORMAT_ARGB_4444,
|
||||
/**
|
||||
* Each pixel is represented by 32 bits. From the most significant bit to the least significant bit,
|
||||
* every 8 bits indicate alpha, red, green, and blue, respectively.
|
||||
*/
|
||||
COLOR_FORMAT_RGBA_8888,
|
||||
/**
|
||||
* Each pixel is represented by 32 bits. From the most significant bit to the least significant bit,
|
||||
* every 8 bits indicate blue, green, red, and alpha, respectively.
|
||||
*/
|
||||
COLOR_FORMAT_BGRA_8888
|
||||
} OH_Drawing_ColorFormat;
|
||||
|
||||
/**
|
||||
* @brief Enumerates alpha formats of bitmap pixels.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/** Unknown format. */
|
||||
ALPHA_FORMAT_UNKNOWN,
|
||||
/** The bitmap does not have the alpha component. */
|
||||
ALPHA_FORMAT_OPAQUE,
|
||||
/** The color component of each pixel is premultiplied by the alpha component. */
|
||||
ALPHA_FORMAT_PREMUL,
|
||||
/** The color component of each pixel is not premultiplied by the alpha component. */
|
||||
ALPHA_FORMAT_UNPREMUL
|
||||
} OH_Drawing_AlphaFormat;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
@ -16,7 +16,7 @@ import("//build/ohos/ndk/ndk.gni")
|
||||
|
||||
ohos_ndk_headers("native_image_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/native_image"
|
||||
sources = [ "//foundation/graphic/graphic_2d/interfaces/inner_api/surface/native_image.h" ]
|
||||
sources = [ "//interface/sdk_c/graphic/graphic_2d/native_image/native_image.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_image_ndk") {
|
||||
|
150
graphic/graphic_2d/native_image/native_image.h
Normal file
150
graphic/graphic_2d/native_image/native_image.h
Normal file
@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2022 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 NDK_INCLUDE_NATIVE_IMAGE_H_
|
||||
#define NDK_INCLUDE_NATIVE_IMAGE_H_
|
||||
|
||||
/**
|
||||
* @addtogroup OH_NativeImage
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the native image capability.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_image.h
|
||||
*
|
||||
* @brief Defines the functions for obtaining and using a native image.
|
||||
*
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct OH_NativeImage;
|
||||
typedef struct OH_NativeImage OH_NativeImage;
|
||||
typedef struct NativeWindow OHNativeWindow;
|
||||
|
||||
/**
|
||||
* @brief Create a <b>OH_NativeImage</b> related to an Opengl ES texture and target. \n
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
|
||||
* @param textureId Indicates the id of the Opengl ES texture which the native image attached to.
|
||||
* @param textureTarget Indicates the Opengl ES target.
|
||||
* @return Returns the pointer to the <b>OH_NativeImage</b> instance created if the operation is successful, \n
|
||||
* returns <b>NULL</b> otherwise.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_NativeImage* OH_NativeImage_Create(uint32_t textureId, uint32_t textureTarget);
|
||||
|
||||
/**
|
||||
* @brief Acquire the OHNativeWindow for the OH_NativeImage. This OHNativeWindow should be released by \n
|
||||
* OH_NativeWindow_DestroyNativeWindow when no longer needed.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
|
||||
* @param image Indicates the pointer to a <b>OH_NativeImage</b> instance.
|
||||
* @return Returns the pointer to the OHNativeWindow if the operation is successful, returns <b>NULL</b> otherwise.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
OHNativeWindow* OH_NativeImage_AcquireNativeWindow(OH_NativeImage* image);
|
||||
|
||||
/**
|
||||
* @brief Attach the OH_NativeImage to Opengl ES context, and the Opengl ES texture is bound to the \n
|
||||
* GL_TEXTURE_EXTERNAL_OES, which will update by the OH_NativeImage.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
|
||||
* @param image Indicates the pointer to a <b>OH_NativeImage</b> instance.
|
||||
* @param textureId Indicates the id of the Opengl ES texture which the native image attached to.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeImage_AttachContext(OH_NativeImage* image, uint32_t textureId);
|
||||
|
||||
/**
|
||||
* @brief Detach the OH_NativeImage from the Opengl ES context.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
|
||||
* @param image Indicates the pointer to a <b>OH_NativeImage</b> instance.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
int32_t OH_NativeImage_DetachContext(OH_NativeImage* image);
|
||||
|
||||
/**
|
||||
* @brief Update the related Opengl ES texture with the OH_NativeImage acquired buffer.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
|
||||
* @param image Indicates the pointer to a <b>OH_NativeImage</b> instance.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeImage_UpdateSurfaceImage(OH_NativeImage* image);
|
||||
|
||||
/**
|
||||
* @brief Get the timestamp of the texture image set by the most recent call to OH_NativeImage_UpdateSurfaceImage.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
|
||||
* @param image Indicates the pointer to a <b>OH_NativeImage</b> instance.
|
||||
* @return Returns the timestamp associated to the texture image.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
int64_t OH_NativeImage_GetTimestamp(OH_NativeImage* image);
|
||||
|
||||
/**
|
||||
* @brief Return the transform matrix of the texture image set by the most recent call to \n
|
||||
* OH_NativeImage_UpdateSurfaceImage.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
|
||||
* @param image Indicates the pointer to a <b>OH_NativeImage</b> instance.
|
||||
* @param matrix Indicates the retrieved 4*4 transform matrix .
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeImage_GetTransformMatrix(OH_NativeImage* image, float matrix[16]);
|
||||
|
||||
/**
|
||||
* @brief Destroy the <b>OH_NativeImage</b> created by OH_NativeImage_Create, and the pointer to \n
|
||||
* <b>OH_NativeImage</b> will be null after this operation.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeImage
|
||||
* @param image Indicates the pointer to a <b>OH_NativeImage</b> pointer.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_NativeImage_Destroy(OH_NativeImage** image);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
@ -16,7 +16,7 @@ import("//build/ohos/ndk/ndk.gni")
|
||||
|
||||
ohos_ndk_headers("native_vsync_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/native_vsync"
|
||||
sources = [ "//foundation/graphic/graphic_2d/interfaces/inner_api/composer/native_vsync.h" ]
|
||||
sources = [ "//interface/sdk_c/graphic/graphic_2d/native_vsync/native_vsync.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_vsync_ndk") {
|
||||
|
87
graphic/graphic_2d/native_vsync/native_vsync.h
Normal file
87
graphic/graphic_2d/native_vsync/native_vsync.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2022-2022 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 NDK_INCLUDE_NATIVE_VSYNC_H_
|
||||
#define NDK_INCLUDE_NATIVE_VSYNC_H_
|
||||
|
||||
/**
|
||||
* @addtogroup NativeVsync
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the native vsync capability.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeVsync
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_vsync.h
|
||||
*
|
||||
* @brief Defines the functions for obtaining and using a native vsync.
|
||||
*
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct OH_NativeVSync;
|
||||
typedef struct OH_NativeVSync OH_NativeVSync;
|
||||
typedef void (*OH_NativeVSync_FrameCallback)(long long timestamp, void *data);
|
||||
|
||||
/**
|
||||
* @brief Creates a <b>NativeVsync</b> instance.\n
|
||||
* A new <b>NativeVsync</b> instance is created each time this function is called.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeVsync
|
||||
* @param name Indicates the vsync connection name.
|
||||
* @param length Indicates the name's length.
|
||||
* @return Returns the pointer to the <b>NativeVsync</b> instance created.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_NativeVSync* OH_NativeVSync_Create(const char* name, unsigned int length);
|
||||
|
||||
/**
|
||||
* @brief Delete the NativeVsync instance.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeVsync
|
||||
* @param window Indicates the pointer to a <b>NativeVsync</b> instance.
|
||||
* @return Returns int32_t, return value == 0, success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_NativeVSync_Destroy(OH_NativeVSync* nativeVsync);
|
||||
|
||||
/**
|
||||
* @brief Request next vsync with callback.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeVsync
|
||||
* @param nativeVsync Indicates the pointer to a NativeVsync.
|
||||
* @param callback Indicates the OH_NativeVSync_FrameCallback which will be called when next vsync coming.
|
||||
* @param data Indicates data whick will be used in callback.
|
||||
* @return Returns int32_t, return value == 0, success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
*/
|
||||
int OH_NativeVSync_RequestFrame(OH_NativeVSync* nativeVsync, OH_NativeVSync_FrameCallback callback, void* data);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -13,13 +13,12 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/graphic/graphic_2d/graphic_config.gni")
|
||||
|
||||
ohos_ndk_headers("native_window_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/native_window"
|
||||
sources = [
|
||||
"$graphic_2d_root/frameworks/surface/include/buffer_handle.h",
|
||||
"$graphic_2d_root/interfaces/inner_api/surface/external_window.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_window/buffer_handle.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_window/external_window.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
45
graphic/graphic_2d/native_window/buffer_handle.h
Normal file
45
graphic/graphic_2d/native_window/buffer_handle.h
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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_BUFFER_HANDLE_H
|
||||
#define INCLUDE_BUFFER_HANDLE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int32_t fd; /**< buffer fd, -1 if not supported */
|
||||
int32_t width; /**< the width of memory */
|
||||
int32_t stride; /**< the stride of memory */
|
||||
int32_t height; /**< the height of memory */
|
||||
int32_t size; /* < size of memory */
|
||||
int32_t format; /**< the format of memory */
|
||||
uint64_t usage; /**< the usage of memory */
|
||||
void *virAddr; /**< Virtual address of memory */
|
||||
int32_t key; /**< Shared memory key */
|
||||
uint64_t phyAddr; /**< Physical address */
|
||||
uint32_t reserveFds; /**< the number of reserved fd value */
|
||||
uint32_t reserveInts; /**< the number of reserved integer value */
|
||||
int32_t reserve[0]; /**< the data */
|
||||
} BufferHandle;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_BUFFER_HANDLE_H
|
475
graphic/graphic_2d/native_window/external_window.h
Normal file
475
graphic/graphic_2d/native_window/external_window.h
Normal file
@ -0,0 +1,475 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 NDK_INCLUDE_EXTERNAL_NATIVE_WINDOW_H_
|
||||
#define NDK_INCLUDE_EXTERNAL_NATIVE_WINDOW_H_
|
||||
|
||||
/**
|
||||
* @addtogroup NativeWindow
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the native window capability for connection to the EGL.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file external_window.h
|
||||
*
|
||||
* @brief Defines the functions for obtaining and using a native window.
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "buffer_handle.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief native window.
|
||||
* @since 8
|
||||
*/
|
||||
struct NativeWindow;
|
||||
|
||||
/**
|
||||
* @brief native window buffer.
|
||||
* @since 8
|
||||
*/
|
||||
struct NativeWindowBuffer;
|
||||
|
||||
/**
|
||||
* @brief define the new type name OHNativeWindow for struct NativeWindow.
|
||||
* @since 8
|
||||
*/
|
||||
typedef struct NativeWindow OHNativeWindow;
|
||||
|
||||
/**
|
||||
* @brief define the new type name OHNativeWindowBuffer for struct NativeWindowBuffer.
|
||||
* @since 8
|
||||
*/
|
||||
typedef struct NativeWindowBuffer OHNativeWindowBuffer;
|
||||
|
||||
/**
|
||||
* @brief indicates a dirty region where content is updated.
|
||||
* @since 8
|
||||
*/
|
||||
typedef struct Region {
|
||||
/** if rects is nullptr, fill the Buffer dirty size by default */
|
||||
struct Rect {
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
uint32_t w;
|
||||
uint32_t h;
|
||||
} *rects;
|
||||
/** if rectNumber is 0, fill the Buffer dirty size by default */
|
||||
int32_t rectNumber;
|
||||
}Region;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Indicates the operation code in the function OH_NativeWindow_NativeWindowHandleOpt.
|
||||
* @since 8
|
||||
*/
|
||||
enum NativeWindowOperation {
|
||||
/**
|
||||
* set native window buffer geometry,
|
||||
* variable parameter in function is
|
||||
* [in] int32_t height, [in] int32_t width
|
||||
*/
|
||||
SET_BUFFER_GEOMETRY,
|
||||
/**
|
||||
* get native window buffer geometry,
|
||||
* variable parameter in function is
|
||||
* [out] int32_t *height, [out] int32_t *width
|
||||
*/
|
||||
GET_BUFFER_GEOMETRY,
|
||||
/**
|
||||
* get native window buffer format,
|
||||
* variable parameter in function is
|
||||
* [out] int32_t *format
|
||||
*/
|
||||
GET_FORMAT,
|
||||
/**
|
||||
* set native window buffer format,
|
||||
* variable parameter in function is
|
||||
* [in] int32_t format
|
||||
*/
|
||||
SET_FORMAT,
|
||||
/**
|
||||
* get native window buffer usage,
|
||||
* variable parameter in function is
|
||||
* [out] int32_t *usage.
|
||||
*/
|
||||
GET_USAGE,
|
||||
/**
|
||||
* set native window buffer usage,
|
||||
* variable parameter in function is
|
||||
* [in] int32_t usage.
|
||||
*/
|
||||
SET_USAGE,
|
||||
/**
|
||||
* set native window buffer stride,
|
||||
* variable parameter in function is
|
||||
* [in] int32_t stride.
|
||||
*/
|
||||
SET_STRIDE,
|
||||
/**
|
||||
* get native window buffer stride,
|
||||
* variable parameter in function is
|
||||
* [out] int32_t *stride.
|
||||
*/
|
||||
GET_STRIDE,
|
||||
/**
|
||||
* set native window buffer swap interval,
|
||||
* variable parameter in function is
|
||||
* [in] int32_t interval.
|
||||
*/
|
||||
SET_SWAP_INTERVAL,
|
||||
/**
|
||||
* get native window buffer swap interval,
|
||||
* variable parameter in function is
|
||||
* [out] int32_t *interval.
|
||||
*/
|
||||
GET_SWAP_INTERVAL,
|
||||
/**
|
||||
* set native window buffer timeout,
|
||||
* variable parameter in function is
|
||||
* [in] int32_t timeout.
|
||||
*/
|
||||
SET_TIMEOUT,
|
||||
/**
|
||||
* get native window buffer timeout,
|
||||
* variable parameter in function is
|
||||
* [out] int32_t *timeout.
|
||||
*/
|
||||
GET_TIMEOUT,
|
||||
/**
|
||||
* set native window buffer colorGamut,
|
||||
* variable parameter in function is
|
||||
* [in] int32_t colorGamut.
|
||||
*/
|
||||
SET_COLOR_GAMUT,
|
||||
/**
|
||||
* get native window buffer colorGamut,
|
||||
* variable parameter in function is
|
||||
* [out int32_t *colorGamut].
|
||||
*/
|
||||
GET_COLOR_GAMUT,
|
||||
/**
|
||||
* set native window buffer transform,
|
||||
* variable parameter in function is
|
||||
* [in] int32_t transform.
|
||||
*/
|
||||
SET_TRANSFORM,
|
||||
/**
|
||||
* get native window buffer transform,
|
||||
* variable parameter in function is
|
||||
* [out] int32_t *transform.
|
||||
*/
|
||||
GET_TRANSFORM,
|
||||
/**
|
||||
* set native window buffer uiTimestamp,
|
||||
* variable parameter in function is
|
||||
* [in] uint64_t uiTimestamp.
|
||||
*/
|
||||
SET_UI_TIMESTAMP,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Indicates Scaling Mode.
|
||||
* @since 9
|
||||
* @deprecated(since = "10")
|
||||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
* the window content is not updated until a buffer of
|
||||
* the window size is received
|
||||
*/
|
||||
OH_SCALING_MODE_FREEZE = 0,
|
||||
/**
|
||||
* the buffer is scaled in two dimensions to match the window size
|
||||
*/
|
||||
OH_SCALING_MODE_SCALE_TO_WINDOW,
|
||||
/**
|
||||
* the buffer is uniformly scaled so that the smaller size of
|
||||
* the buffer matches the window size
|
||||
*/
|
||||
OH_SCALING_MODE_SCALE_CROP,
|
||||
/**
|
||||
* the window is clipped to the size of the buffer's clipping rectangle
|
||||
* pixels outside the clipping rectangle are considered fully transparent.
|
||||
*/
|
||||
OH_SCALING_MODE_NO_SCALE_CROP,
|
||||
} OHScalingMode;
|
||||
|
||||
/**
|
||||
* @brief Enumerates the HDR metadata keys.
|
||||
* @since 9
|
||||
* @deprecated(since = "10")
|
||||
*/
|
||||
typedef enum {
|
||||
OH_METAKEY_RED_PRIMARY_X = 0,
|
||||
OH_METAKEY_RED_PRIMARY_Y = 1,
|
||||
OH_METAKEY_GREEN_PRIMARY_X = 2,
|
||||
OH_METAKEY_GREEN_PRIMARY_Y = 3,
|
||||
OH_METAKEY_BLUE_PRIMARY_X = 4,
|
||||
OH_METAKEY_BLUE_PRIMARY_Y = 5,
|
||||
OH_METAKEY_WHITE_PRIMARY_X = 6,
|
||||
OH_METAKEY_WHITE_PRIMARY_Y = 7,
|
||||
OH_METAKEY_MAX_LUMINANCE = 8,
|
||||
OH_METAKEY_MIN_LUMINANCE = 9,
|
||||
OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL = 10,
|
||||
OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11,
|
||||
OH_METAKEY_HDR10_PLUS = 12,
|
||||
OH_METAKEY_HDR_VIVID = 13,
|
||||
} OHHDRMetadataKey;
|
||||
|
||||
/**
|
||||
* @brief Defines the HDR metadata.
|
||||
* @since 9
|
||||
* @deprecated(since = "10")
|
||||
*/
|
||||
typedef struct {
|
||||
OHHDRMetadataKey key;
|
||||
float value;
|
||||
} OHHDRMetaData;
|
||||
|
||||
/**
|
||||
* @brief Defines the ExtData Handle
|
||||
* @since 9
|
||||
* @deprecated(since = "10")
|
||||
*/
|
||||
typedef struct OHExtDataHandle {
|
||||
/**< Handle fd, -1 if not supported */
|
||||
int32_t fd;
|
||||
/**< the number of reserved integer value */
|
||||
uint32_t reserveInts;
|
||||
/**< the reserved data */
|
||||
int32_t reserve[0];
|
||||
} OHExtDataHandle;
|
||||
|
||||
/**
|
||||
* @brief Creates a <b>OHNativeWindow</b> instance. A new <b>OHNativeWindow</b> instance is created each time this function is called.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param pSurface Indicates the pointer to a <b>ProduceSurface</b>. The type is a pointer to <b>sptr<OHOS::Surface></b>.
|
||||
* @return Returns the pointer to the <b>OHNativeWindow</b> instance created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OHNativeWindow* OH_NativeWindow_CreateNativeWindow(void* pSurface);
|
||||
|
||||
/**
|
||||
* @brief Decreases the reference count of a <b>OHNativeWindow</b> instance by 1, and when the reference count reaches 0, destroys the instance.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param window Indicates the pointer to a <b>OHNativeWindow</b> instance.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_NativeWindow_DestroyNativeWindow(OHNativeWindow* window);
|
||||
|
||||
/**
|
||||
* @brief Creates a <b>OHNativeWindowBuffer</b> instance. A new <b>OHNativeWindowBuffer</b> instance is created each time this function is called.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param pSurfaceBuffer Indicates the pointer to a produce buffer. The type is <b>sptr<OHOS::SurfaceBuffer></b>.
|
||||
* @return Returns the pointer to the <b>OHNativeWindowBuffer</b> instance created.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer(void* pSurfaceBuffer);
|
||||
|
||||
/**
|
||||
* @brief Decreases the reference count of a <b>OHNativeWindowBuffer</b> instance by 1 and, when the reference count reaches 0, destroys the instance.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param buffer Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_NativeWindow_DestroyNativeWindowBuffer(OHNativeWindowBuffer* buffer);
|
||||
|
||||
/**
|
||||
* @brief Requests a <b>OHNativeWindowBuffer</b> through a <b>OHNativeWindow</b> instance for content production.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param window Indicates the pointer to a <b>OHNativeWindow</b> instance.
|
||||
* @param buffer Indicates the double pointer to a <b>OHNativeWindowBuffer</b> instance.
|
||||
* @param fenceFd Indicates the pointer to a file descriptor handle.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeWindowRequestBuffer(OHNativeWindow *window,
|
||||
OHNativeWindowBuffer **buffer, int *fenceFd);
|
||||
|
||||
/**
|
||||
* @brief Flushes the <b>OHNativeWindowBuffer</b> filled with the content to the buffer queue through a <b>OHNativeWindow</b> instance for content consumption.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param window Indicates the pointer to a <b>OHNativeWindow</b> instance.
|
||||
* @param buffer Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
|
||||
* @param fenceFd Indicates a file descriptor handle, which is used for timing synchronization.
|
||||
* @param region Indicates a dirty region where content is updated.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeWindowFlushBuffer(OHNativeWindow *window, OHNativeWindowBuffer *buffer,
|
||||
int fenceFd, Region region);
|
||||
|
||||
/**
|
||||
* @brief Returns the <b>OHNativeWindowBuffer</b> to the buffer queue through a <b>OHNativeWindow</b> instance, without filling in any content. The <b>OHNativeWindowBuffer</b> can be used for another request.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param window Indicates the pointer to a <b>OHNativeWindow</b> instance.
|
||||
* @param buffer Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeWindowAbortBuffer(OHNativeWindow *window, OHNativeWindowBuffer *buffer);
|
||||
|
||||
/**
|
||||
* @brief Sets or obtains the attributes of a native window, including the width, height, and content format.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param window Indicates the pointer to a <b>OHNativeWindow</b> instance.
|
||||
* @param code Indicates the operation code, pointer to <b>NativeWindowOperation</b>.
|
||||
* @param ... variable parameter, must correspond to code one-to-one.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeWindowHandleOpt(OHNativeWindow *window, int code, ...);
|
||||
|
||||
/**
|
||||
* @brief Obtains the pointer to a <b>BufferHandle</b> of a <b>OHNativeWindowBuffer</b> instance.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param buffer Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
|
||||
* @return Returns the pointer to the <b>BufferHandle</b> instance obtained.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
BufferHandle *OH_NativeWindow_GetBufferHandleFromNative(OHNativeWindowBuffer *buffer);
|
||||
|
||||
/**
|
||||
* @brief Adds the reference count of a native object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param obj Indicates the pointer to a <b>OHNativeWindow</b> or <b>OHNativeWindowBuffer</b> instance.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeObjectReference(void *obj);
|
||||
|
||||
/**
|
||||
* @brief Decreases the reference count of a native object and, when the reference count reaches 0, destroys this object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param obj Indicates the pointer to a <b>OHNativeWindow</b> or <b>OHNativeWindowBuffer</b> instance.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeObjectUnreference(void *obj);
|
||||
|
||||
/**
|
||||
* @brief Obtains the magic ID of a native object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param obj Indicates the pointer to a <b>OHNativeWindow</b> or <b>OHNativeWindowBuffer</b> instance.
|
||||
* @return Returns the magic ID, which is unique for each native object.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_NativeWindow_GetNativeObjectMagic(void *obj);
|
||||
|
||||
/**
|
||||
* @brief Sets scalingMode of a native window.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param window Indicates the pointer to a <b>OHNativeWindow</b> instance.
|
||||
* @param sequence Indicates the sequence to a produce buffer.
|
||||
* @param scalingMode Indicates the enum value to <b>OHScalingMode</b>
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
* @deprecated(since = "10")
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeWindowSetScalingMode(OHNativeWindow *window, uint32_t sequence,
|
||||
OHScalingMode scalingMode);
|
||||
|
||||
/**
|
||||
* @brief Sets metaData of a native window.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param window Indicates the pointer to a <b>OHNativeWindow</b> instance.
|
||||
* @param sequence Indicates the sequence to a produce buffer.
|
||||
* @param size Indicates the size of a <b>OHHDRMetaData</b> vector.
|
||||
* @param metaDate Indicates the pointer to a <b>OHHDRMetaData</b> vector.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
* @deprecated(since = "10")
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeWindowSetMetaData(OHNativeWindow *window, uint32_t sequence, int32_t size,
|
||||
const OHHDRMetaData *metaData);
|
||||
|
||||
/**
|
||||
* @brief Sets metaDataSet of a native window.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param window Indicates the pointer to a <b>OHNativeWindow</b> instance.
|
||||
* @param sequence Indicates the sequence to a produce buffer.
|
||||
* @param key Indicates the enum value to <b>OHHDRMetadataKey</b>
|
||||
* @param size Indicates the size of a uint8_t vector.
|
||||
* @param metaDate Indicates the pointer to a uint8_t vector.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
* @deprecated(since = "10")
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeWindowSetMetaDataSet(OHNativeWindow *window, uint32_t sequence, OHHDRMetadataKey key,
|
||||
int32_t size, const uint8_t *metaData);
|
||||
|
||||
/**
|
||||
* @brief Sets tunnel handle of a native window.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
|
||||
* @param window Indicates the pointer to a <b>OHNativeWindow</b> instance.
|
||||
* @param handle Indicates the pointer to a <b>OHExtDataHandle</b>.
|
||||
* @return Returns an error code, 0 is success, otherwise, failed.
|
||||
* @since 9
|
||||
* @version 1.0
|
||||
* @deprecated(since = "10")
|
||||
*/
|
||||
int32_t OH_NativeWindow_NativeWindowSetTunnelHandle(OHNativeWindow *window, const OHExtDataHandle *handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
@ -17,10 +17,10 @@ import("//build/ohos/ndk/ndk.gni")
|
||||
ohos_ndk_headers("vulkan_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/vulkan"
|
||||
sources = [
|
||||
"//third_party/vulkan-headers/include/vulkan/vk_platform.h",
|
||||
"//third_party/vulkan-headers/include/vulkan/vulkan.h",
|
||||
"//third_party/vulkan-headers/include/vulkan/vulkan_core.h",
|
||||
"//third_party/vulkan-headers/include/vulkan/vulkan_ohos.h",
|
||||
"//interface/sdk_c/third_party/vulkan-headers/vulkan/vk_platform.h",
|
||||
"//interface/sdk_c/third_party/vulkan-headers/vulkan/vulkan.h",
|
||||
"//interface/sdk_c/third_party/vulkan-headers/vulkan/vulkan_core.h",
|
||||
"//interface/sdk_c/third_party/vulkan-headers/vulkan/vulkan_ohos.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/audio_framework/config.gni")
|
||||
|
||||
ohos_ndk_headers("ohaudio_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/ohaudio"
|
||||
|
@ -1,274 +0,0 @@
|
||||
# Copyright (C) 2023 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.
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
|
||||
group("capi_packages") {
|
||||
deps = []
|
||||
if (av_codec_support_capi) {
|
||||
deps += [
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_adec",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_aenc",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_avdemuxer",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_avmuxer",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_avsource",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_core",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_vdec",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_venc",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
config("av_codec_capi_config") {
|
||||
include_dirs = [
|
||||
"$av_codec_root_dir/frameworks/native/capi/common",
|
||||
"$av_codec_root_dir/interfaces/inner_api/native",
|
||||
"$av_codec_root_dir/interfaces/kits/c",
|
||||
"$av_codec_root_dir/services/dfx/include",
|
||||
"$av_codec_root_dir/services/utils/include",
|
||||
"//foundation/graphic/graphic_2d/frameworks/surface/include",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
"-fno-exceptions",
|
||||
"-Wall",
|
||||
"-fno-common",
|
||||
"-fstack-protector-all",
|
||||
"-Wshadow",
|
||||
"-FPIC",
|
||||
"-FS",
|
||||
"-O2",
|
||||
"-D_FORTIFY_SOURCE=2",
|
||||
"-Wformat=2",
|
||||
"-Wdate-time",
|
||||
]
|
||||
|
||||
cflags_cc = [
|
||||
"-std=c++17",
|
||||
"-fno-rtti",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("native_media_core") {
|
||||
install_enable = true
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
blocklist = "../../../cfi_blocklist.txt"
|
||||
}
|
||||
|
||||
configs = [ ":av_codec_capi_config" ]
|
||||
|
||||
sources = [
|
||||
"$av_codec_root_dir/frameworks/native/capi/common/native_avformat.cpp",
|
||||
"$av_codec_root_dir/frameworks/native/capi/common/native_avmemory.cpp",
|
||||
]
|
||||
|
||||
if (av_codec_support_codeclist) {
|
||||
sources += [ "$av_codec_root_dir/frameworks/native/capi/common/native_avcapability.cpp" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
|
||||
"$av_codec_root_dir/services/utils:av_codec_format",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"graphic_2d:surface",
|
||||
"hilog:libhilog",
|
||||
]
|
||||
output_extension = "so"
|
||||
subsystem_name = "multimedia"
|
||||
part_name = "av_codec"
|
||||
}
|
||||
|
||||
ohos_shared_library("native_media_avmuxer") {
|
||||
install_enable = true
|
||||
sources = [
|
||||
"$av_codec_root_dir/frameworks/native/capi/avcodec/native_avcodec_base.cpp",
|
||||
"$av_codec_root_dir/frameworks/native/capi/avmuxer/native_avmuxer.cpp",
|
||||
"$av_codec_root_dir/frameworks/native/capi/common/native_avformat.cpp",
|
||||
"$av_codec_root_dir/frameworks/native/capi/common/native_avmemory.cpp",
|
||||
]
|
||||
|
||||
public_configs = [ ":av_codec_capi_config" ]
|
||||
|
||||
deps = [
|
||||
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
|
||||
"$av_codec_root_dir/services/utils:av_codec_format",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
"hilog:libhilog",
|
||||
]
|
||||
output_extension = "so"
|
||||
subsystem_name = "multimedia"
|
||||
part_name = "av_codec"
|
||||
}
|
||||
|
||||
ohos_shared_library("native_media_avdemuxer") {
|
||||
install_enable = true
|
||||
sources = [
|
||||
"$av_codec_root_dir/frameworks/native/capi/avdemuxer/native_avdemuxer.cpp",
|
||||
]
|
||||
|
||||
public_configs = [ ":av_codec_capi_config" ]
|
||||
|
||||
deps = [
|
||||
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_core",
|
||||
"$av_codec_root_dir/services/utils:av_codec_format",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
"graphic_2d:surface",
|
||||
"hilog:libhilog",
|
||||
]
|
||||
output_extension = "so"
|
||||
subsystem_name = "multimedia"
|
||||
part_name = "av_codec"
|
||||
}
|
||||
|
||||
ohos_shared_library("native_media_avsource") {
|
||||
install_enable = true
|
||||
sources = [
|
||||
"$av_codec_root_dir/frameworks/native/capi/avsource/native_avsource.cpp",
|
||||
]
|
||||
|
||||
public_configs = [ ":av_codec_capi_config" ]
|
||||
|
||||
deps = [
|
||||
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_core",
|
||||
"$av_codec_root_dir/services/utils:av_codec_format",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
"graphic_2d:surface",
|
||||
"hilog:libhilog",
|
||||
]
|
||||
output_extension = "so"
|
||||
subsystem_name = "multimedia"
|
||||
part_name = "av_codec"
|
||||
}
|
||||
|
||||
ohos_shared_library("native_media_codecbase") {
|
||||
install_enable = true
|
||||
sources = [
|
||||
"$av_codec_root_dir/frameworks/native/capi/avcodec/native_avcodec_base.cpp",
|
||||
]
|
||||
|
||||
public_configs = [ ":av_codec_capi_config" ]
|
||||
|
||||
external_deps = [ "hilog:libhilog" ]
|
||||
output_extension = "so"
|
||||
subsystem_name = "multimedia"
|
||||
part_name = "av_codec"
|
||||
}
|
||||
|
||||
ohos_shared_library("native_media_adec") {
|
||||
install_enable = true
|
||||
sources = [ "$av_codec_root_dir/frameworks/native/capi/avcodec/native_audio_decoder.cpp" ]
|
||||
|
||||
public_configs = [ ":av_codec_capi_config" ]
|
||||
|
||||
deps = [
|
||||
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_core",
|
||||
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
"hilog:libhilog",
|
||||
]
|
||||
output_extension = "so"
|
||||
subsystem_name = "multimedia"
|
||||
part_name = "av_codec"
|
||||
}
|
||||
|
||||
ohos_shared_library("native_media_aenc") {
|
||||
install_enable = true
|
||||
sources = [ "$av_codec_root_dir/frameworks/native/capi/avcodec/native_audio_encoder.cpp" ]
|
||||
|
||||
public_configs = [ ":av_codec_capi_config" ]
|
||||
|
||||
deps = [
|
||||
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_core",
|
||||
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
"hilog:libhilog",
|
||||
]
|
||||
output_extension = "so"
|
||||
subsystem_name = "multimedia"
|
||||
part_name = "av_codec"
|
||||
}
|
||||
|
||||
ohos_shared_library("native_media_vdec") {
|
||||
install_enable = true
|
||||
sources = [ "$av_codec_root_dir/frameworks/native/capi/avcodec/native_video_decoder.cpp" ]
|
||||
|
||||
public_configs = [ ":av_codec_capi_config" ]
|
||||
|
||||
deps = [
|
||||
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_core",
|
||||
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
"graphic_2d:surface",
|
||||
"hilog:libhilog",
|
||||
]
|
||||
output_extension = "so"
|
||||
subsystem_name = "multimedia"
|
||||
part_name = "av_codec"
|
||||
}
|
||||
|
||||
ohos_shared_library("native_media_venc") {
|
||||
install_enable = true
|
||||
sources = [ "$av_codec_root_dir/frameworks/native/capi/avcodec/native_video_encoder.cpp" ]
|
||||
|
||||
public_configs = [ ":av_codec_capi_config" ]
|
||||
|
||||
deps = [
|
||||
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_codecbase",
|
||||
"$av_codec_root_dir/interfaces/kits/c:native_media_core",
|
||||
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"c_utils:utils",
|
||||
"graphic_2d:surface",
|
||||
"hilog:libhilog",
|
||||
]
|
||||
output_extension = "so"
|
||||
subsystem_name = "multimedia"
|
||||
part_name = "av_codec"
|
||||
}
|
@ -13,11 +13,10 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
ohos_ndk_headers("native_media_adec_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
|
||||
sources =
|
||||
[ "$av_codec_root_dir/interfaces/kits/c/native_avcodec_audiodecoder.h" ]
|
||||
[ "//interface/sdk_c/multimedia/av_codec/native_avcodec_audiodecoder.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_media_adec") {
|
||||
|
@ -13,11 +13,10 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
ohos_ndk_headers("native_media_aenc_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
|
||||
sources =
|
||||
[ "$av_codec_root_dir/interfaces/kits/c/native_avcodec_audioencoder.h" ]
|
||||
[ "//interface/sdk_c/multimedia/av_codec/native_avcodec_audioencoder.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_media_aenc") {
|
||||
|
@ -13,10 +13,9 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
ohos_ndk_headers("native_media_avdemuxer_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
|
||||
sources = [ "$av_codec_root_dir/interfaces/kits/c/native_avdemuxer.h" ]
|
||||
sources = [ "//interface/sdk_c/multimedia/av_codec/native_avdemuxer.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_media_avdemuxer") {
|
||||
|
@ -13,10 +13,9 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
ohos_ndk_headers("native_media_avmuxer_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
|
||||
sources = [ "$av_codec_root_dir/interfaces/kits/c/native_avmuxer.h" ]
|
||||
sources = [ "//interface/sdk_c/multimedia/av_codec/native_avmuxer.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_media_avmuxer") {
|
||||
|
@ -13,10 +13,9 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
ohos_ndk_headers("native_media_avsource_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
|
||||
sources = [ "$av_codec_root_dir/interfaces/kits/c/native_avsource.h" ]
|
||||
sources = [ "//interface/sdk_c/multimedia/av_codec/native_avsource.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_media_avsource") {
|
||||
|
@ -13,13 +13,12 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
ohos_ndk_headers("native_media_codecbase_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
|
||||
sources = [
|
||||
"$av_codec_root_dir/interfaces/kits/c/avcodec_audio_channel_layout.h",
|
||||
"$av_codec_root_dir/interfaces/kits/c/native_avcapability.h",
|
||||
"$av_codec_root_dir/interfaces/kits/c/native_avcodec_base.h",
|
||||
"//interface/sdk_c/multimedia/av_codec/avcodec_audio_channel_layout.h",
|
||||
"//interface/sdk_c/multimedia/av_codec/native_avcapability.h",
|
||||
"//interface/sdk_c/multimedia/av_codec/native_avcodec_base.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -13,13 +13,12 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
ohos_ndk_headers("native_media_core_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
|
||||
sources = [
|
||||
"$av_codec_root_dir/interfaces/kits/c/native_averrors.h",
|
||||
"$av_codec_root_dir/interfaces/kits/c/native_avformat.h",
|
||||
"$av_codec_root_dir/interfaces/kits/c/native_avmemory.h",
|
||||
"//interface/sdk_c/multimedia/av_codec/native_averrors.h",
|
||||
"//interface/sdk_c/multimedia/av_codec/native_avformat.h",
|
||||
"//interface/sdk_c/multimedia/av_codec/native_avmemory.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -13,11 +13,10 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
ohos_ndk_headers("native_media_vdec_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
|
||||
sources =
|
||||
[ "$av_codec_root_dir/interfaces/kits/c/native_avcodec_videodecoder.h" ]
|
||||
[ "//interface/sdk_c/multimedia/av_codec/native_avcodec_videodecoder.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_media_vdec") {
|
||||
|
@ -13,11 +13,10 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
import("//foundation/multimedia/av_codec/config.gni")
|
||||
ohos_ndk_headers("native_media_venc_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/player_framework"
|
||||
sources =
|
||||
[ "$av_codec_root_dir/interfaces/kits/c/native_avcodec_videoencoder.h" ]
|
||||
[ "//interface/sdk_c/multimedia/av_codec/native_avcodec_videoencoder.h" ]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_media_venc") {
|
||||
|
@ -30,42 +30,3 @@ ohos_ndk_headers("huks_header") {
|
||||
"./include/native_huks_type.h",
|
||||
]
|
||||
}
|
||||
|
||||
config("huks_config") {
|
||||
include_dirs = [ "include" ]
|
||||
}
|
||||
|
||||
ohos_shared_library("huks_ndk") {
|
||||
public_configs = [ ":huks_config" ]
|
||||
defines = [
|
||||
"L2_STANDARD",
|
||||
"_HARDWARE_ROOT_KEY_",
|
||||
"_HUKS_LOG_ENABLE_",
|
||||
]
|
||||
|
||||
include_dirs = [
|
||||
"//base/security/huks/interfaces/kits/c/include",
|
||||
"//base/security/huks/interfaces/inner_api/huks_standard/main/include",
|
||||
"//base/security/huks/frameworks/huks_standard/main/common/include",
|
||||
]
|
||||
|
||||
sources = [
|
||||
"//base/security/huks/interfaces/kits/c/src/native_huks_api_adapter.c",
|
||||
"src/native_huks_api.c",
|
||||
"src/native_huks_param.c",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//base/security/huks/interfaces/inner_api/huks_standard/main:libhukssdk",
|
||||
]
|
||||
|
||||
external_deps = [ "hilog:libhilog" ]
|
||||
|
||||
cflags_cc = [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
]
|
||||
|
||||
part_name = "huks"
|
||||
subsystem_name = "security"
|
||||
}
|
||||
|
@ -13,18 +13,6 @@
|
||||
|
||||
import("//build/ohos.gni")
|
||||
|
||||
ohos_shared_library("deviceinfo_ndk") {
|
||||
cflags = [ "-fstack-protector-all" ]
|
||||
sources = [
|
||||
"src/deviceinfo.c",
|
||||
"src/syscap_ndk.c",
|
||||
]
|
||||
include_dirs = [ "./include" ]
|
||||
deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ]
|
||||
part_name = "init"
|
||||
subsystem_name = "startup"
|
||||
}
|
||||
|
||||
ohos_ndk_library("libdeviceinfo_ndk") {
|
||||
cflags = [ "-fstack-protector-all" ]
|
||||
output_name = "deviceinfo_ndk"
|
||||
|
24
third_party/egl/BUILD.gn
vendored
Normal file
24
third_party/egl/BUILD.gn
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
# Copyright (c) 2021-2023 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.
|
||||
|
||||
config("libEGL_public_config") {
|
||||
include_dirs = [ "api" ]
|
||||
defines = [ "ENABLE_EGL" ]
|
||||
if (current_os == "ohos") {
|
||||
defines += [ "OHOS_PLATFORM" ]
|
||||
}
|
||||
}
|
||||
|
||||
group("libEGL") {
|
||||
public_configs = [ ":libEGL_public_config" ]
|
||||
}
|
342
third_party/egl/EGL/egl.h
vendored
Normal file
342
third_party/egl/EGL/egl.h
vendored
Normal file
@ -0,0 +1,342 @@
|
||||
#ifndef __egl_h_
|
||||
#define __egl_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
**
|
||||
** This header is generated from the Khronos EGL XML API Registry.
|
||||
** The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** http://www.khronos.org/registry/egl
|
||||
**
|
||||
** Khronos $Git commit SHA1: 76c9410321 $ on $Git commit date: 2022-01-04 20:51:44 +0800 $
|
||||
*/
|
||||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
#ifndef EGL_EGL_PROTOTYPES
|
||||
#define EGL_EGL_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
/* Generated on date 20220105 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: egl
|
||||
* Versions considered: .*
|
||||
* Versions emitted: .*
|
||||
* Default extensions included: None
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
|
||||
#ifndef EGL_VERSION_1_0
|
||||
#define EGL_VERSION_1_0 1
|
||||
typedef unsigned int EGLBoolean;
|
||||
typedef void *EGLDisplay;
|
||||
#include <KHR/khrplatform.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
typedef void *EGLConfig;
|
||||
typedef void *EGLSurface;
|
||||
typedef void *EGLContext;
|
||||
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
|
||||
#define EGL_ALPHA_SIZE 0x3021
|
||||
#define EGL_BAD_ACCESS 0x3002
|
||||
#define EGL_BAD_ALLOC 0x3003
|
||||
#define EGL_BAD_ATTRIBUTE 0x3004
|
||||
#define EGL_BAD_CONFIG 0x3005
|
||||
#define EGL_BAD_CONTEXT 0x3006
|
||||
#define EGL_BAD_CURRENT_SURFACE 0x3007
|
||||
#define EGL_BAD_DISPLAY 0x3008
|
||||
#define EGL_BAD_MATCH 0x3009
|
||||
#define EGL_BAD_NATIVE_PIXMAP 0x300A
|
||||
#define EGL_BAD_NATIVE_WINDOW 0x300B
|
||||
#define EGL_BAD_PARAMETER 0x300C
|
||||
#define EGL_BAD_SURFACE 0x300D
|
||||
#define EGL_BLUE_SIZE 0x3022
|
||||
#define EGL_BUFFER_SIZE 0x3020
|
||||
#define EGL_CONFIG_CAVEAT 0x3027
|
||||
#define EGL_CONFIG_ID 0x3028
|
||||
#define EGL_CORE_NATIVE_ENGINE 0x305B
|
||||
#define EGL_DEPTH_SIZE 0x3025
|
||||
#define EGL_DONT_CARE EGL_CAST(EGLint,-1)
|
||||
#define EGL_DRAW 0x3059
|
||||
#define EGL_EXTENSIONS 0x3055
|
||||
#define EGL_FALSE 0
|
||||
#define EGL_GREEN_SIZE 0x3023
|
||||
#define EGL_HEIGHT 0x3056
|
||||
#define EGL_LARGEST_PBUFFER 0x3058
|
||||
#define EGL_LEVEL 0x3029
|
||||
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
|
||||
#define EGL_MAX_PBUFFER_PIXELS 0x302B
|
||||
#define EGL_MAX_PBUFFER_WIDTH 0x302C
|
||||
#define EGL_NATIVE_RENDERABLE 0x302D
|
||||
#define EGL_NATIVE_VISUAL_ID 0x302E
|
||||
#define EGL_NATIVE_VISUAL_TYPE 0x302F
|
||||
#define EGL_NONE 0x3038
|
||||
#define EGL_NON_CONFORMANT_CONFIG 0x3051
|
||||
#define EGL_NOT_INITIALIZED 0x3001
|
||||
#define EGL_NO_CONTEXT EGL_CAST(EGLContext,0)
|
||||
#define EGL_NO_DISPLAY EGL_CAST(EGLDisplay,0)
|
||||
#define EGL_NO_SURFACE EGL_CAST(EGLSurface,0)
|
||||
#define EGL_PBUFFER_BIT 0x0001
|
||||
#define EGL_PIXMAP_BIT 0x0002
|
||||
#define EGL_READ 0x305A
|
||||
#define EGL_RED_SIZE 0x3024
|
||||
#define EGL_SAMPLES 0x3031
|
||||
#define EGL_SAMPLE_BUFFERS 0x3032
|
||||
#define EGL_SLOW_CONFIG 0x3050
|
||||
#define EGL_STENCIL_SIZE 0x3026
|
||||
#define EGL_SUCCESS 0x3000
|
||||
#define EGL_SURFACE_TYPE 0x3033
|
||||
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
|
||||
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
|
||||
#define EGL_TRANSPARENT_RED_VALUE 0x3037
|
||||
#define EGL_TRANSPARENT_RGB 0x3052
|
||||
#define EGL_TRANSPARENT_TYPE 0x3034
|
||||
#define EGL_TRUE 1
|
||||
#define EGL_VENDOR 0x3053
|
||||
#define EGL_VERSION 0x3054
|
||||
#define EGL_WIDTH 0x3057
|
||||
#define EGL_WINDOW_BIT 0x0004
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
|
||||
typedef EGLContext (EGLAPIENTRYP PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETCURRENTDISPLAYPROC) (void);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw);
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLGETERRORPROC) (void);
|
||||
typedef __eglMustCastToProperFunctionPointerType (EGLAPIENTRYP PFNEGLGETPROCADDRESSPROC) (const char *procname);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
|
||||
typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLTERMINATEPROC) (EGLDisplay dpy);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITGLPROC) (void);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITNATIVEPROC) (EGLint engine);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
|
||||
EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw);
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id);
|
||||
EGLAPI EGLint EGLAPIENTRY eglGetError (void);
|
||||
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
|
||||
EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_0 */
|
||||
|
||||
#ifndef EGL_VERSION_1_1
|
||||
#define EGL_VERSION_1_1 1
|
||||
#define EGL_BACK_BUFFER 0x3084
|
||||
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
|
||||
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
|
||||
#define EGL_CONTEXT_LOST 0x300E
|
||||
#define EGL_MIN_SWAP_INTERVAL 0x303B
|
||||
#define EGL_MAX_SWAP_INTERVAL 0x303C
|
||||
#define EGL_MIPMAP_TEXTURE 0x3082
|
||||
#define EGL_MIPMAP_LEVEL 0x3083
|
||||
#define EGL_NO_TEXTURE 0x305C
|
||||
#define EGL_TEXTURE_2D 0x305F
|
||||
#define EGL_TEXTURE_FORMAT 0x3080
|
||||
#define EGL_TEXTURE_RGB 0x305D
|
||||
#define EGL_TEXTURE_RGBA 0x305E
|
||||
#define EGL_TEXTURE_TARGET 0x3081
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_1 */
|
||||
|
||||
#ifndef EGL_VERSION_1_2
|
||||
#define EGL_VERSION_1_2 1
|
||||
typedef unsigned int EGLenum;
|
||||
typedef void *EGLClientBuffer;
|
||||
#define EGL_ALPHA_FORMAT 0x3088
|
||||
#define EGL_ALPHA_FORMAT_NONPRE 0x308B
|
||||
#define EGL_ALPHA_FORMAT_PRE 0x308C
|
||||
#define EGL_ALPHA_MASK_SIZE 0x303E
|
||||
#define EGL_BUFFER_PRESERVED 0x3094
|
||||
#define EGL_BUFFER_DESTROYED 0x3095
|
||||
#define EGL_CLIENT_APIS 0x308D
|
||||
#define EGL_COLORSPACE 0x3087
|
||||
#define EGL_COLORSPACE_sRGB 0x3089
|
||||
#define EGL_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_COLOR_BUFFER_TYPE 0x303F
|
||||
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
|
||||
#define EGL_DISPLAY_SCALING 10000
|
||||
#define EGL_HORIZONTAL_RESOLUTION 0x3090
|
||||
#define EGL_LUMINANCE_BUFFER 0x308F
|
||||
#define EGL_LUMINANCE_SIZE 0x303D
|
||||
#define EGL_OPENGL_ES_BIT 0x0001
|
||||
#define EGL_OPENVG_BIT 0x0002
|
||||
#define EGL_OPENGL_ES_API 0x30A0
|
||||
#define EGL_OPENVG_API 0x30A1
|
||||
#define EGL_OPENVG_IMAGE 0x3096
|
||||
#define EGL_PIXEL_ASPECT_RATIO 0x3092
|
||||
#define EGL_RENDERABLE_TYPE 0x3040
|
||||
#define EGL_RENDER_BUFFER 0x3086
|
||||
#define EGL_RGB_BUFFER 0x308E
|
||||
#define EGL_SINGLE_BUFFER 0x3085
|
||||
#define EGL_SWAP_BEHAVIOR 0x3093
|
||||
#define EGL_UNKNOWN EGL_CAST(EGLint,-1)
|
||||
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDAPIPROC) (EGLenum api);
|
||||
typedef EGLenum (EGLAPIENTRYP PFNEGLQUERYAPIPROC) (void);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETHREADPROC) (void);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITCLIENTPROC) (void);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api);
|
||||
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_2 */
|
||||
|
||||
#ifndef EGL_VERSION_1_3
|
||||
#define EGL_VERSION_1_3 1
|
||||
#define EGL_CONFORMANT 0x3042
|
||||
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
||||
#define EGL_MATCH_NATIVE_PIXMAP 0x3041
|
||||
#define EGL_OPENGL_ES2_BIT 0x0004
|
||||
#define EGL_VG_ALPHA_FORMAT 0x3088
|
||||
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040
|
||||
#define EGL_VG_COLORSPACE 0x3087
|
||||
#define EGL_VG_COLORSPACE_sRGB 0x3089
|
||||
#define EGL_VG_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020
|
||||
#endif /* EGL_VERSION_1_3 */
|
||||
|
||||
#ifndef EGL_VERSION_1_4
|
||||
#define EGL_VERSION_1_4 1
|
||||
#define EGL_DEFAULT_DISPLAY EGL_CAST(EGLNativeDisplayType,0)
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200
|
||||
#define EGL_MULTISAMPLE_RESOLVE 0x3099
|
||||
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B
|
||||
#define EGL_OPENGL_API 0x30A2
|
||||
#define EGL_OPENGL_BIT 0x0008
|
||||
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
|
||||
typedef EGLContext (EGLAPIENTRYP PFNEGLGETCURRENTCONTEXTPROC) (void);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_4 */
|
||||
|
||||
#ifndef EGL_VERSION_1_5
|
||||
#define EGL_VERSION_1_5 1
|
||||
typedef void *EGLSync;
|
||||
typedef intptr_t EGLAttrib;
|
||||
typedef khronos_utime_nanoseconds_t EGLTime;
|
||||
typedef void *EGLImage;
|
||||
#define EGL_CONTEXT_MAJOR_VERSION 0x3098
|
||||
#define EGL_CONTEXT_MINOR_VERSION 0x30FB
|
||||
#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
|
||||
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
|
||||
#define EGL_NO_RESET_NOTIFICATION 0x31BE
|
||||
#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF
|
||||
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
|
||||
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002
|
||||
#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0
|
||||
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
|
||||
#define EGL_OPENGL_ES3_BIT 0x00000040
|
||||
#define EGL_CL_EVENT_HANDLE 0x309C
|
||||
#define EGL_SYNC_CL_EVENT 0x30FE
|
||||
#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0
|
||||
#define EGL_SYNC_TYPE 0x30F7
|
||||
#define EGL_SYNC_STATUS 0x30F1
|
||||
#define EGL_SYNC_CONDITION 0x30F8
|
||||
#define EGL_SIGNALED 0x30F2
|
||||
#define EGL_UNSIGNALED 0x30F3
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001
|
||||
#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_TIMEOUT_EXPIRED 0x30F5
|
||||
#define EGL_CONDITION_SATISFIED 0x30F6
|
||||
#define EGL_NO_SYNC EGL_CAST(EGLSync,0)
|
||||
#define EGL_SYNC_FENCE 0x30F9
|
||||
#define EGL_GL_COLORSPACE 0x309D
|
||||
#define EGL_GL_COLORSPACE_SRGB 0x3089
|
||||
#define EGL_GL_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_GL_RENDERBUFFER 0x30B9
|
||||
#define EGL_GL_TEXTURE_2D 0x30B1
|
||||
#define EGL_GL_TEXTURE_LEVEL 0x30BC
|
||||
#define EGL_GL_TEXTURE_3D 0x30B2
|
||||
#define EGL_GL_TEXTURE_ZOFFSET 0x30BD
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
|
||||
#define EGL_IMAGE_PRESERVED 0x30D2
|
||||
#define EGL_NO_IMAGE EGL_CAST(EGLImage,0)
|
||||
typedef EGLSync (EGLAPIENTRYP PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
|
||||
typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image);
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
|
||||
EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image);
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_5 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
1489
third_party/egl/EGL/eglext.h
vendored
Normal file
1489
third_party/egl/EGL/eglext.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
177
third_party/egl/EGL/eglplatform.h
vendored
Normal file
177
third_party/egl/EGL/eglplatform.h
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
#ifndef __eglplatform_h_
|
||||
#define __eglplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright 2007-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for egl.h
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* You are encouraged to submit all modifications to the Khronos group so that
|
||||
* they can be included in future versions of this file. Please submit changes
|
||||
* by filing an issue or pull request on the public Khronos EGL Registry, at
|
||||
* https://www.github.com/KhronosGroup/EGL-Registry/
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
/* Macros used in EGL function prototype declarations.
|
||||
*
|
||||
* EGL functions should be prototyped as:
|
||||
*
|
||||
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
|
||||
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
|
||||
*
|
||||
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
|
||||
*/
|
||||
|
||||
#ifndef EGLAPI
|
||||
#define EGLAPI KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef EGLAPIENTRY
|
||||
#define EGLAPIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
#define EGLAPIENTRYP EGLAPIENTRY*
|
||||
|
||||
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
|
||||
* are aliases of window-system-dependent types, such as X Display * or
|
||||
* Windows Device Context. They must be defined in platform-specific
|
||||
* code below. The EGL-prefixed versions of Native*Type are the same
|
||||
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
|
||||
*
|
||||
* Khronos STRONGLY RECOMMENDS that you use the default definitions
|
||||
* provided below, since these changes affect both binary and source
|
||||
* portability of applications using EGL running on different EGL
|
||||
* implementations.
|
||||
*/
|
||||
|
||||
#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(OHOS_PLATFORM)
|
||||
|
||||
struct NativeWindow;
|
||||
|
||||
typedef void* EGLNativeDisplayType;
|
||||
typedef void* EGLNativePixmapType;
|
||||
typedef struct NativeWindow* EGLNativeWindowType;
|
||||
|
||||
#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
typedef HDC EGLNativeDisplayType;
|
||||
typedef HBITMAP EGLNativePixmapType;
|
||||
typedef HWND EGLNativeWindowType;
|
||||
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef int EGLNativePixmapType;
|
||||
typedef int EGLNativeWindowType;
|
||||
|
||||
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(WL_EGL_PLATFORM)
|
||||
|
||||
typedef struct wl_display *EGLNativeDisplayType;
|
||||
typedef struct wl_egl_pixmap *EGLNativePixmapType;
|
||||
typedef struct wl_egl_window *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__GBM__)
|
||||
|
||||
typedef struct gbm_device *EGLNativeDisplayType;
|
||||
typedef struct gbm_bo *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__ANDROID__) || defined(ANDROID)
|
||||
|
||||
struct ANativeWindow;
|
||||
struct egl_native_pixmap_t;
|
||||
|
||||
typedef void* EGLNativeDisplayType;
|
||||
typedef struct egl_native_pixmap_t* EGLNativePixmapType;
|
||||
typedef struct ANativeWindow* EGLNativeWindowType;
|
||||
|
||||
#elif defined(USE_OZONE)
|
||||
|
||||
typedef intptr_t EGLNativeDisplayType;
|
||||
typedef intptr_t EGLNativePixmapType;
|
||||
typedef intptr_t EGLNativeWindowType;
|
||||
|
||||
#elif defined(USE_X11)
|
||||
|
||||
/* X11 (tentative) */
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
typedef Display *EGLNativeDisplayType;
|
||||
typedef Pixmap EGLNativePixmapType;
|
||||
typedef Window EGLNativeWindowType;
|
||||
|
||||
#elif defined(__unix__)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
|
||||
#include <kernel/image.h>
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#elif defined(__Fuchsia__)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#else
|
||||
#error "Platform not recognized"
|
||||
#endif
|
||||
|
||||
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
|
||||
typedef EGLNativeDisplayType NativeDisplayType;
|
||||
typedef EGLNativePixmapType NativePixmapType;
|
||||
typedef EGLNativeWindowType NativeWindowType;
|
||||
|
||||
|
||||
/* Define EGLint. This must be a signed integral type large enough to contain
|
||||
* all legal attribute names and values passed into and out of EGL, whether
|
||||
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
|
||||
* handle, or other. While in general a 32-bit integer will suffice, if
|
||||
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
|
||||
* integer type.
|
||||
*/
|
||||
typedef khronos_int32_t EGLint;
|
||||
|
||||
|
||||
/* C++ / C typecast macros for special EGL handle values */
|
||||
#if defined(__cplusplus)
|
||||
#define EGL_CAST(type, value) (static_cast<type>(value))
|
||||
#else
|
||||
#define EGL_CAST(type, value) ((type) (value))
|
||||
#endif
|
||||
|
||||
#endif /* __eglplatform_h */
|
311
third_party/egl/KHR/khrplatform.h
vendored
Normal file
311
third_party/egl/KHR/khrplatform.h
vendored
Normal file
@ -0,0 +1,311 @@
|
||||
#ifndef __khrplatform_h_
|
||||
#define __khrplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2008-2018 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Khronos platform-specific types and definitions.
|
||||
*
|
||||
* The master copy of khrplatform.h is maintained in the Khronos EGL
|
||||
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
|
||||
* The last semantic modification to khrplatform.h was at commit ID:
|
||||
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
|
||||
*
|
||||
* Adopters may modify this file to suit their platform. Adopters are
|
||||
* encouraged to submit platform specific modifications to the Khronos
|
||||
* group so that they can be included in future versions of this file.
|
||||
* Please submit changes by filing pull requests or issues on
|
||||
* the EGL Registry repository linked above.
|
||||
*
|
||||
*
|
||||
* See the Implementer's Guidelines for information about where this file
|
||||
* should be located on your system and for more details of its use:
|
||||
* http://www.khronos.org/registry/implementers_guide.pdf
|
||||
*
|
||||
* This file should be included as
|
||||
* #include <KHR/khrplatform.h>
|
||||
* by Khronos client API header files that use its types and defines.
|
||||
*
|
||||
* The types in khrplatform.h should only be used to define API-specific types.
|
||||
*
|
||||
* Types defined in khrplatform.h:
|
||||
* khronos_int8_t signed 8 bit
|
||||
* khronos_uint8_t unsigned 8 bit
|
||||
* khronos_int16_t signed 16 bit
|
||||
* khronos_uint16_t unsigned 16 bit
|
||||
* khronos_int32_t signed 32 bit
|
||||
* khronos_uint32_t unsigned 32 bit
|
||||
* khronos_int64_t signed 64 bit
|
||||
* khronos_uint64_t unsigned 64 bit
|
||||
* khronos_intptr_t signed same number of bits as a pointer
|
||||
* khronos_uintptr_t unsigned same number of bits as a pointer
|
||||
* khronos_ssize_t signed size
|
||||
* khronos_usize_t unsigned size
|
||||
* khronos_float_t signed 32 bit floating point
|
||||
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
||||
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
||||
* nanoseconds
|
||||
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
||||
* khronos_boolean_enum_t enumerated boolean type. This should
|
||||
* only be used as a base type when a client API's boolean type is
|
||||
* an enum. Client APIs which use an integer or other type for
|
||||
* booleans cannot use this as the base type for their boolean.
|
||||
*
|
||||
* Tokens defined in khrplatform.h:
|
||||
*
|
||||
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
||||
*
|
||||
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
||||
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
||||
*
|
||||
* Calling convention macros defined in this file:
|
||||
* KHRONOS_APICALL
|
||||
* KHRONOS_APIENTRY
|
||||
* KHRONOS_APIATTRIBUTES
|
||||
*
|
||||
* These may be used in function prototypes as:
|
||||
*
|
||||
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
||||
* int arg1,
|
||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||
*/
|
||||
|
||||
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
|
||||
# define KHRONOS_STATIC 1
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL
|
||||
*-------------------------------------------------------------------------
|
||||
* This precedes the return type of the function in the function prototype.
|
||||
*/
|
||||
#if defined(KHRONOS_STATIC)
|
||||
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
|
||||
* header compatible with static linking. */
|
||||
# define KHRONOS_APICALL
|
||||
#elif defined(_WIN32)
|
||||
# define KHRONOS_APICALL __declspec(dllimport)
|
||||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
#elif defined(__ANDROID__)
|
||||
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||
#else
|
||||
# define KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIENTRY
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the return type of the function and precedes the function
|
||||
* name in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||
/* Win32 but not WinCE */
|
||||
# define KHRONOS_APIENTRY __stdcall
|
||||
#else
|
||||
# define KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIATTRIBUTES
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the closing parenthesis of the function prototype arguments.
|
||||
*/
|
||||
#if defined (__ARMCC_2__)
|
||||
#define KHRONOS_APIATTRIBUTES __softfp
|
||||
#else
|
||||
#define KHRONOS_APIATTRIBUTES
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* basic type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
||||
|
||||
|
||||
/*
|
||||
* Using <stdint.h>
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
/*
|
||||
* To support platform where unsigned long cannot be used interchangeably with
|
||||
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
|
||||
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
|
||||
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
|
||||
* unsigned long long or similar (this results in different C++ name mangling).
|
||||
* To avoid changes for existing platforms, we restrict usage of intptr_t to
|
||||
* platforms where the size of a pointer is larger than the size of long.
|
||||
*/
|
||||
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
|
||||
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
|
||||
#define KHRONOS_USE_INTPTR_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
/*
|
||||
* Using <inttypes.h>
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
|
||||
/*
|
||||
* Win32
|
||||
*/
|
||||
typedef __int32 khronos_int32_t;
|
||||
typedef unsigned __int32 khronos_uint32_t;
|
||||
typedef __int64 khronos_int64_t;
|
||||
typedef unsigned __int64 khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
|
||||
/*
|
||||
* Sun or Digital
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int khronos_int64_t;
|
||||
typedef unsigned long int khronos_uint64_t;
|
||||
#else
|
||||
typedef long long int khronos_int64_t;
|
||||
typedef unsigned long long int khronos_uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif 0
|
||||
|
||||
/*
|
||||
* Hypothetical platform with no float or int64 support
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#define KHRONOS_SUPPORT_INT64 0
|
||||
#define KHRONOS_SUPPORT_FLOAT 0
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Generic fallback
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types that are (so far) the same on all platforms
|
||||
*/
|
||||
typedef signed char khronos_int8_t;
|
||||
typedef unsigned char khronos_uint8_t;
|
||||
typedef signed short int khronos_int16_t;
|
||||
typedef unsigned short int khronos_uint16_t;
|
||||
|
||||
/*
|
||||
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef KHRONOS_USE_INTPTR_T
|
||||
typedef intptr_t khronos_intptr_t;
|
||||
typedef uintptr_t khronos_uintptr_t;
|
||||
#elif defined(_WIN64)
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64)
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_FLOAT
|
||||
/*
|
||||
* Float type
|
||||
*/
|
||||
typedef float khronos_float_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
/* Time types
|
||||
*
|
||||
* These types can be used to represent a time interval in nanoseconds or
|
||||
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
||||
* of nanoseconds since some arbitrary system event (e.g. since the last
|
||||
* time the system booted). The Unadjusted System Time is an unsigned
|
||||
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
||||
* may be either signed or unsigned.
|
||||
*/
|
||||
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
||||
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dummy value used to pad enum types to 32 bits.
|
||||
*/
|
||||
#ifndef KHRONOS_MAX_ENUM
|
||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enumerated boolean type
|
||||
*
|
||||
* Values other than zero should be considered to be true. Therefore
|
||||
* comparisons should not be made against KHRONOS_TRUE.
|
||||
*/
|
||||
typedef enum {
|
||||
KHRONOS_FALSE = 0,
|
||||
KHRONOS_TRUE = 1,
|
||||
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
||||
} khronos_boolean_enum_t;
|
||||
|
||||
#endif /* __khrplatform_h_ */
|
11
third_party/egl/README.OpenSource
vendored
Normal file
11
third_party/egl/README.OpenSource
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"Name": "EGL",
|
||||
"License": "MIT License",
|
||||
"License File": "LICENSE",
|
||||
"Version Number": "1.5",
|
||||
"Owner": "lizheng2@huawei.com",
|
||||
"Upstream URL": "https://github.com/KhronosGroup/EGL-Registry.git",
|
||||
"Description": "EGL is an interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system."
|
||||
}
|
||||
]
|
20
third_party/openGLES/BUILD.gn
vendored
Normal file
20
third_party/openGLES/BUILD.gn
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2021 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.
|
||||
|
||||
config("libGLES_public_config") {
|
||||
include_dirs = [ "api" ]
|
||||
}
|
||||
|
||||
group("libGLES") {
|
||||
public_configs = [ ":libGLES_public_config" ]
|
||||
}
|
1192
third_party/openGLES/GLES3/gl3.h
vendored
Normal file
1192
third_party/openGLES/GLES3/gl3.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1507
third_party/openGLES/GLES3/gl31.h
vendored
Normal file
1507
third_party/openGLES/GLES3/gl31.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1808
third_party/openGLES/GLES3/gl32.h
vendored
Normal file
1808
third_party/openGLES/GLES3/gl32.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
27
third_party/openGLES/GLES3/gl3platform.h
vendored
Normal file
27
third_party/openGLES/GLES3/gl3platform.h
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef __gl3platform_h_
|
||||
#define __gl3platform_h_
|
||||
|
||||
/*
|
||||
** Copyright 2017-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 3.X gl3.h
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* Please contribute modifications back to Khronos as pull requests on the
|
||||
* public github repository:
|
||||
* https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifndef GL_APICALL
|
||||
#define GL_APICALL KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef GL_APIENTRY
|
||||
#define GL_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
#endif /* __gl3platform_h_ */
|
11
third_party/openGLES/README.OpenSource
vendored
Normal file
11
third_party/openGLES/README.OpenSource
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"Name": "openGLES",
|
||||
"License": "Apache-2.0",
|
||||
"License File": "NOTICE",
|
||||
"Version Number": "a301c9b4600e4074008b93fba17744a859fb763b",
|
||||
"Owner": "lizheng2@huawei.com",
|
||||
"Upstream URL": "https://github.com/KhronosGroup/OpenGL-Registry.git",
|
||||
"Description": "The OpenGL ES registry contains specifications of the core API and shading language; specifications of Khronos- and vendor-approved OpenGL ES extensions; header files corresponding to the specificatio"
|
||||
}
|
||||
]
|
74
third_party/vulkan-headers/BUILD.gn
vendored
Normal file
74
third_party/vulkan-headers/BUILD.gn
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
# Copyright (C) 2018-2019 The ANGLE Project Authors.
|
||||
# Copyright (C) 2019 LunarG, Inc.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# https://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.
|
||||
|
||||
import("//build/ohos.gni")
|
||||
|
||||
is_ohos = current_os == "ohos"
|
||||
is_android = current_os == "android"
|
||||
is_mac = current_os == "ios" || current_os == "tvos" || current_os == "mac"
|
||||
is_win = current_os == "win" || current_os == "mingw"
|
||||
is_linux = current_os == "linux"
|
||||
is_fuchsia = current_os == "fuchsia"
|
||||
|
||||
config("vulkan_headers_config") {
|
||||
include_dirs = [ "include" ]
|
||||
defines = []
|
||||
|
||||
if (is_ohos) {
|
||||
defines += [ "VK_USE_PLATFORM_OHOS" ]
|
||||
}
|
||||
|
||||
if (is_win) {
|
||||
defines += [ "VK_USE_PLATFORM_WIN32_KHR" ]
|
||||
}
|
||||
if (is_linux) {
|
||||
if (defined(vulkan_use_x11) && vulkan_use_x11) {
|
||||
defines += [ "VK_USE_PLATFORM_XCB_KHR" ]
|
||||
}
|
||||
}
|
||||
if (defined(vulkan_use_wayland) && vulkan_use_wayland) {
|
||||
defines += [ "VK_USE_PLATFORM_WAYLAND_KHR" ]
|
||||
if (defined(vulkan_wayland_include_dirs)) {
|
||||
include_dirs += vulkan_wayland_include_dirs
|
||||
}
|
||||
}
|
||||
if (is_android) {
|
||||
defines += [ "VK_USE_PLATFORM_ANDROID_KHR" ]
|
||||
}
|
||||
if (is_fuchsia) {
|
||||
defines += [ "VK_USE_PLATFORM_FUCHSIA" ]
|
||||
}
|
||||
if (is_mac) {
|
||||
defines += [ "VK_USE_PLATFORM_METAL_EXT" ]
|
||||
}
|
||||
if (defined(is_ggp) && is_ggp) {
|
||||
defines += [ "VK_USE_PLATFORM_GGP" ]
|
||||
}
|
||||
}
|
||||
|
||||
# Vulkan headers only, no compiled sources.
|
||||
source_set("vulkan_headers") {
|
||||
sources = [
|
||||
"include/vulkan/vk_icd.h",
|
||||
"include/vulkan/vk_layer.h",
|
||||
"include/vulkan/vk_platform.h",
|
||||
"include/vulkan/vk_sdk_platform.h",
|
||||
"include/vulkan/vulkan.h",
|
||||
"include/vulkan/vulkan.hpp",
|
||||
"include/vulkan/vulkan_core.h",
|
||||
"include/vulkan/vulkan_ohos.h",
|
||||
]
|
||||
public_configs = [ ":vulkan_headers_config" ]
|
||||
}
|
11
third_party/vulkan-headers/README.OpenSource
vendored
Normal file
11
third_party/vulkan-headers/README.OpenSource
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"Name": "Vulkan",
|
||||
"License": "Apache-2.0",
|
||||
"License File": "LICENSE",
|
||||
"Version Number": "v1.3.231",
|
||||
"Owner": "mengzhaobing@huawei.com",
|
||||
"Upstream URL": "https://github.com/KhronosGroup/Vulkan-Headers.git",
|
||||
"Description": "Vulkan header files and API registry"
|
||||
}
|
||||
]
|
84
third_party/vulkan-headers/vulkan/vk_platform.h
vendored
Normal file
84
third_party/vulkan-headers/vulkan/vk_platform.h
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
//
|
||||
// File: vk_platform.h
|
||||
//
|
||||
/*
|
||||
** Copyright 2014-2022 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
|
||||
#ifndef VK_PLATFORM_H_
|
||||
#define VK_PLATFORM_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
|
||||
/*
|
||||
***************************************************************************************************
|
||||
* Platform-specific directives and type declarations
|
||||
***************************************************************************************************
|
||||
*/
|
||||
|
||||
/* Platform-specific calling convention macros.
|
||||
*
|
||||
* Platforms should define these so that Vulkan clients call Vulkan commands
|
||||
* with the same calling conventions that the Vulkan implementation expects.
|
||||
*
|
||||
* VKAPI_ATTR - Placed before the return type in function declarations.
|
||||
* Useful for C++11 and GCC/Clang-style function attribute syntax.
|
||||
* VKAPI_CALL - Placed after the return type in function declarations.
|
||||
* Useful for MSVC-style calling convention syntax.
|
||||
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
|
||||
*
|
||||
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
|
||||
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
// On Windows, Vulkan commands use the stdcall convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL __stdcall
|
||||
#define VKAPI_PTR VKAPI_CALL
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
|
||||
#error "Vulkan is not supported for the 'armeabi' NDK ABI"
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
|
||||
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
|
||||
// calling convention, i.e. float parameters are passed in registers. This
|
||||
// is true even if the rest of the application passes floats on the stack,
|
||||
// as it does by default when compiling for the armeabi-v7a NDK ABI.
|
||||
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR VKAPI_ATTR
|
||||
#else
|
||||
// On other platforms, use the default calling convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR
|
||||
#endif
|
||||
|
||||
#if !defined(VK_NO_STDDEF_H)
|
||||
#include <stddef.h>
|
||||
#endif // !defined(VK_NO_STDDEF_H)
|
||||
|
||||
#if !defined(VK_NO_STDINT_H)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#endif // !defined(VK_NO_STDINT_H)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
95
third_party/vulkan-headers/vulkan/vulkan.h
vendored
Normal file
95
third_party/vulkan-headers/vulkan/vulkan.h
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
#ifndef VULKAN_H_
|
||||
#define VULKAN_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2022 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "vk_platform.h"
|
||||
#include "vulkan_core.h"
|
||||
|
||||
#ifdef VK_USE_PLATFORM_ANDROID_KHR
|
||||
#include "vulkan_android.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_FUCHSIA
|
||||
#include <zircon/types.h>
|
||||
#include "vulkan_fuchsia.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_IOS_MVK
|
||||
#include "vulkan_ios.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_MACOS_MVK
|
||||
#include "vulkan_macos.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_METAL_EXT
|
||||
#include "vulkan_metal.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_VI_NN
|
||||
#include "vulkan_vi.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#include "vulkan_wayland.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||
#include <windows.h>
|
||||
#include "vulkan_win32.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XCB_KHR
|
||||
#include <xcb/xcb.h>
|
||||
#include "vulkan_xcb.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
||||
#include <X11/Xlib.h>
|
||||
#include "vulkan_xlib.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
|
||||
#include <directfb.h>
|
||||
#include "vulkan_directfb.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#include "vulkan_xlib_xrandr.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_GGP
|
||||
#include <ggp_c/vulkan_types.h>
|
||||
#include "vulkan_ggp.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_SCREEN_QNX
|
||||
#include <screen/screen.h>
|
||||
#include "vulkan_screen.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_ENABLE_BETA_EXTENSIONS
|
||||
#include "vulkan_beta.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_OHOS
|
||||
#include "vulkan_ohos.h"
|
||||
#endif
|
||||
|
||||
#endif // VULKAN_H_
|
16038
third_party/vulkan-headers/vulkan/vulkan_core.h
vendored
Normal file
16038
third_party/vulkan-headers/vulkan/vulkan_core.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
199
third_party/vulkan-headers/vulkan/vulkan_ohos.h
vendored
Normal file
199
third_party/vulkan-headers/vulkan/vulkan_ohos.h
vendored
Normal file
@ -0,0 +1,199 @@
|
||||
#ifndef VULKAN_OHOS_H_
|
||||
#define VULKAN_OHOS_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2022 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_OHOS_surface 1
|
||||
typedef struct NativeWindow OHNativeWindow;
|
||||
#define VK_OHOS_SURFACE_SPEC_VERSION 1
|
||||
#define VK_OHOS_SURFACE_EXTENSION_NAME "VK_OHOS_surface"
|
||||
typedef VkFlags VkSurfaceCreateFlagsOHOS;
|
||||
typedef struct VkSurfaceCreateInfoOHOS {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSurfaceCreateFlagsOHOS flags;
|
||||
OHNativeWindow* window;
|
||||
} VkSurfaceCreateInfoOHOS;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateSurfaceOHOS)(VkInstance instance, const VkSurfaceCreateInfoOHOS* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateSurfaceOHOS(
|
||||
VkInstance instance,
|
||||
const VkSurfaceCreateInfoOHOS* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_OHOS_native_buffer 1
|
||||
struct OHBufferHandle;
|
||||
#define VK_OHOS_NATIVE_BUFFER_SPEC_VERSION 1
|
||||
#define VK_OHOS_NATIVE_BUFFER_EXTENSION_NAME "VK_OHOS_native_buffer"
|
||||
|
||||
typedef enum VkSwapchainImageUsageFlagBitsOHOS {
|
||||
VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_OHOS = 0x00000001,
|
||||
VK_SWAPCHAIN_IMAGE_USAGE_FLAG_BITS_MAX_ENUM_OHOS = 0x7FFFFFFF
|
||||
} VkSwapchainImageUsageFlagBitsOHOS;
|
||||
typedef VkFlags VkSwapchainImageUsageFlagsOHOS;
|
||||
typedef struct VkNativeBufferOHOS {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
struct OHBufferHandle* handle;
|
||||
} VkNativeBufferOHOS;
|
||||
|
||||
typedef struct VkSwapchainImageCreateInfoOHOS {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSwapchainImageUsageFlagsOHOS usage;
|
||||
} VkSwapchainImageCreateInfoOHOS;
|
||||
|
||||
typedef struct VkPhysicalDevicePresentationPropertiesOHOS {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkBool32 sharedImage;
|
||||
} VkPhysicalDevicePresentationPropertiesOHOS;
|
||||
|
||||
/**
|
||||
* @brief this type is deprecated, please use PFN_vkAcquireImageOHOS instead
|
||||
* @deprecated
|
||||
*/
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetNativeFenceFdOpenHarmony)(VkDevice device, int32_t nativeFenceFd, VkSemaphore semaphore, VkFence fence);
|
||||
|
||||
/**
|
||||
* @brief this type is deprecated, please use PFN_vkQueueSignalReleaseImageOHOS instead
|
||||
* @deprecated
|
||||
*/
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetNativeFenceFdOpenHarmony)(VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image, int32_t* pNativeFenceFd);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainGrallocUsageOHOS)(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, uint64_t* grallocUsage);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkAcquireImageOHOS)(VkDevice device, VkImage image, int32_t nativeFenceFd, VkSemaphore semaphore, VkFence fence);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkQueueSignalReleaseImageOHOS)(VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image, int32_t* pNativeFenceFd);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
/**
|
||||
* @brief this interface is deprecated, please use vkAcquireImageOHOS instead
|
||||
* @deprecated
|
||||
*/
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkSetNativeFenceFdOpenHarmony(
|
||||
VkDevice device,
|
||||
int32_t nativeFenceFd,
|
||||
VkSemaphore semaphore,
|
||||
VkFence fence);
|
||||
|
||||
/**
|
||||
* @brief this interface is deprecated, please use vkQueueSignalReleaseImageOHOS instead
|
||||
* @deprecated
|
||||
*/
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetNativeFenceFdOpenHarmony(
|
||||
VkQueue queue,
|
||||
uint32_t waitSemaphoreCount,
|
||||
const VkSemaphore* pWaitSemaphores,
|
||||
VkImage image,
|
||||
int32_t* pNativeFenceFd);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsageOHOS(
|
||||
VkDevice device,
|
||||
VkFormat format,
|
||||
VkImageUsageFlags imageUsage,
|
||||
uint64_t* grallocUsage);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireImageOHOS(
|
||||
VkDevice device,
|
||||
VkImage image,
|
||||
int32_t nativeFenceFd,
|
||||
VkSemaphore semaphore,
|
||||
VkFence fence);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkQueueSignalReleaseImageOHOS(
|
||||
VkQueue queue,
|
||||
uint32_t waitSemaphoreCount,
|
||||
const VkSemaphore* pWaitSemaphores,
|
||||
VkImage image,
|
||||
int32_t* pNativeFenceFd);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_OHOS_external_memory 1
|
||||
struct OH_NativeBuffer;
|
||||
#define VK_OHOS_EXTERNAL_MEMORY_SPEC_VERSION 1
|
||||
#define VK_OHOS_EXTERNAL_MEMORY_EXTENSION_NAME "VK_OHOS_external_memory"
|
||||
typedef struct VkNativeBufferUsageOHOS {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint64_t OHOSNativeBufferUsage;
|
||||
} VkNativeBufferUsageOHOS;
|
||||
|
||||
typedef struct VkNativeBufferPropertiesOHOS {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkDeviceSize allocationSize;
|
||||
uint32_t memoryTypeBits;
|
||||
} VkNativeBufferPropertiesOHOS;
|
||||
|
||||
typedef struct VkNativeBufferFormatPropertiesOHOS {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkFormat format;
|
||||
uint64_t externalFormat;
|
||||
VkFormatFeatureFlags formatFeatures;
|
||||
VkComponentMapping samplerYcbcrConversionComponents;
|
||||
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
|
||||
VkSamplerYcbcrRange suggestedYcbcrRange;
|
||||
VkChromaLocation suggestedXChromaOffset;
|
||||
VkChromaLocation suggestedYChromaOffset;
|
||||
} VkNativeBufferFormatPropertiesOHOS;
|
||||
|
||||
typedef struct VkImportNativeBufferInfoOHOS {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
struct OH_NativeBuffer* buffer;
|
||||
} VkImportNativeBufferInfoOHOS;
|
||||
|
||||
typedef struct VkMemoryGetNativeBufferInfoOHOS {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDeviceMemory memory;
|
||||
} VkMemoryGetNativeBufferInfoOHOS;
|
||||
|
||||
typedef struct VkExternalFormatOHOS {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint64_t externalFormat;
|
||||
} VkExternalFormatOHOS;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetNativeBufferPropertiesOHOS)(VkDevice device, const struct OH_NativeBuffer* buffer, VkNativeBufferPropertiesOHOS* pProperties);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryNativeBufferOHOS)(VkDevice device, const VkMemoryGetNativeBufferInfoOHOS* pInfo, struct OH_NativeBuffer** pBuffer);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetNativeBufferPropertiesOHOS(
|
||||
VkDevice device,
|
||||
const struct OH_NativeBuffer* buffer,
|
||||
VkNativeBufferPropertiesOHOS* pProperties);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryNativeBufferOHOS(
|
||||
VkDevice device,
|
||||
const VkMemoryGetNativeBufferInfoOHOS* pInfo,
|
||||
struct OH_NativeBuffer** pBuffer);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user