Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
6cbff5ef
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6cbff5ef
编写于
8月 24, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 24, 2023
浏览文件
操作
浏览文件
下载
差异文件
!22818 master:add Native API in NativeVsync and NativeBuffer
Merge pull request !22818 from 葛亚芳/master
上级
467386e6
c1626333
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
176 addition
and
8 deletion
+176
-8
zh-cn/application-dev/reference/native-apis/_native_vsync.md
zh-cn/application-dev/reference/native-apis/_native_vsync.md
+30
-2
zh-cn/application-dev/reference/native-apis/_o_h___native_buffer.md
...ication-dev/reference/native-apis/_o_h___native_buffer.md
+71
-1
zh-cn/application-dev/reference/native-apis/_o_h___native_buffer___config.md
...ev/reference/native-apis/_o_h___native_buffer___config.md
+68
-5
zh-cn/application-dev/reference/native-apis/native__buffer_8h.md
...pplication-dev/reference/native-apis/native__buffer_8h.md
+6
-0
zh-cn/application-dev/reference/native-apis/native__vsync_8h.md
...application-dev/reference/native-apis/native__vsync_8h.md
+1
-0
未找到文件。
zh-cn/application-dev/reference/native-apis/_native_vsync.md
浏览文件 @
6cbff5ef
...
...
@@ -19,7 +19,7 @@
| 名称 | 描述 |
| -------- | -------- |
|
[
native_vsync.h
](
native__vsync_8h.md
)
| 定义获取和使用NativeVsync的相关函数
<br/>
引用文件:
<
native_vsync/native_vsync.h
>
|
|
[
native_vsync.h
](
native__vsync_8h.md
)
| 定义获取和使用NativeVsync的相关函数
<br/>
**引用文件:**
<
native_vsync/native_vsync.h
>
<br/>
**库:**
libnative_vsync.so
|
### 类型定义
...
...
@@ -37,7 +37,7 @@
|
[
OH_NativeVSync_Create
](
#oh_nativevsync_create
)
(
const
char
\*
name, unsigned int length) | 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例 |
|
[
OH_NativeVSync_Destroy
](
#oh_nativevsync_destroy
)
(
[OH_NativeVSync](#oh_nativevsync
)
\*
nativeVsync) | 销毁OH_NativeVSync实例 |
|
[
OH_NativeVSync_RequestFrame
](
#oh_nativevsync_requestframe
)
(
[OH_NativeVSync](#oh_nativevsync
)
\*
nativeVsync,
[
OH_NativeVSync_FrameCallback
](
#oh_nativevsync_framecallback
)
callback, void
\*
data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback |
|
[
OH_NativeVSync_GetPeriod
](
#oh_nativevsync_getperiod
)
(
[OH_NativeVSync](#oh_nativevsync
)
\*
nativeVsync, long long
\*
period) |获取vsync周期。|
## 类型定义说明
...
...
@@ -77,6 +77,34 @@ VSync回调函数类型
## 函数说明
### OH_NativeVSync_GetPeriod()
```
int OH_NativeVSync_GetPeriod (OH_NativeVSync * nativeVsync, long long * period )
```
**描述:**
获取vsync周期。
\@
syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**参数:**
| 名称 | 描述 |
| -------- | -------- |
| nativeVsync | 一个指向OH_NativeVSync实例的指针。|
| period | 用于获取vsync周期的变量。 |
**返回:**
返回值为0表示执行成功。
**起始版本:**
10
### OH_NativeVSync_Create()
...
...
zh-cn/application-dev/reference/native-apis/_o_h___native_buffer.md
浏览文件 @
6cbff5ef
...
...
@@ -19,7 +19,7 @@
| 名称 | 描述 |
| -------- | -------- |
|
[
native_buffer.h
](
native__buffer_8h.md
)
| 定义获取和使用NativeBuffer的相关函数。
<br/>
引用文件:
<
native_buffer/native_buffer.h
>
|
|
[
native_buffer.h
](
native__buffer_8h.md
)
| 定义获取和使用NativeBuffer的相关函数。
<br/>
**引用文件:**
<
native_buffer/native_buffer.h
>
<br/>
**库:**
libnative_buffer.so
|
### 结构体
...
...
@@ -35,6 +35,12 @@
| -------- | -------- |
|
[
OH_NativeBuffer
](
#oh_nativebuffer
)
| 提供OH_NativeBuffer结构体声明。 |
### 枚举
| 名称 | 描述 |
| -------- | -------- |
|
[
OH_NativeBuffer_Usage
](
#oh_nativebuffer_usage
)
{ NATIVEBUFFER_USAGE_CPU_READ = (1ULL
<<
0), NATIVEBUFFER_USAGE_CPU_WRITE = (1ULL
<<
1), NATIVEBUFFER_USAGE_MEM_DMA = (1ULL
<<
3) } | OH_NativeBuffer的用途。 |
|
[
OH_NativeBuffer_Format
](
#oh_nativebuffer_format
)
{
<br/>
NATIVEBUFFER_PIXEL_FMT_RGB_565 = 3, NATIVEBUFFER_PIXEL_FMT_RGBA_5658, NATIVEBUFFER_PIXEL_FMT_RGBX_4444, NATIVEBUFFER_PIXEL_FMT_RGBA_4444,
<br/>
NATIVEBUFFER_PIXEL_FMT_RGB_444, NATIVEBUFFER_PIXEL_FMT_RGBX_5551, NATIVEBUFFER_PIXEL_FMT_RGBA_5551, NATIVEBUFFER_PIXEL_FMT_RGB_555,
<br/>
NATIVEBUFFER_PIXEL_FMT_RGBX_8888, NATIVEBUFFER_PIXEL_FMT_RGBA_8888, NATIVEBUFFER_PIXEL_FMT_RGB_888, NATIVEBUFFER_PIXEL_FMT_BGR_565,
<br/>
NATIVEBUFFER_PIXEL_FMT_BGRX_4444, NATIVEBUFFER_PIXEL_FMT_BGRA_4444, NATIVEBUFFER_PIXEL_FMT_BGRX_5551, NATIVEBUFFER_PIXEL_FMT_BGRA_5551,
<br/>
NATIVEBUFFER_PIXEL_FMT_BGRX_8888, NATIVEBUFFER_PIXEL_FMT_BGRA_8888, NATIVEBUFFER_PIXEL_FMT_BUTT = 0X7FFFFFFF
<br/>
} | OH_NativeBuffer的格式。 |
### 函数
...
...
@@ -63,6 +69,70 @@ typedef struct OH_NativeBuffer OH_NativeBuffer
提供OH_NativeBuffer结构体声明。
## 枚举类型说明
### OH_NativeBuffer_Format
```
enum OH_NativeBuffer_Format
```
**描述:**
OH_NativeBuffer的格式。
\@
SysCap SystemCapability.Graphic.Graphic2D.NativeBuffer
| 枚举值 | 描述 |
| -------- | -------- |
| NATIVEBUFFER_PIXEL_FMT_RGB_565 | RGB565格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBA_5658 | RGBA5658格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBX_4444 | RGBX4444格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBA_4444 | RGBA4444格式 |
| NATIVEBUFFER_PIXEL_FMT_RGB_444 | RGB444格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBX_5551 | RGBX5551格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBA_5551 | RGBA5551格式 |
| NATIVEBUFFER_PIXEL_FMT_RGB_555 | RGB555格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBX_8888 | RGBX8888格式 |
| NATIVEBUFFER_PIXEL_FMT_RGBA_8888 | RGBA8888格式 |
| NATIVEBUFFER_PIXEL_FMT_RGB_888 | RGB888格式 |
| NATIVEBUFFER_PIXEL_FMT_BGR_565 | BGR565格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRX_4444 | BGRX4444格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRA_4444 | BGRA4444格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRX_5551 | BGRX5551格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRA_5551 | BGRA5551格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRX_8888 | BGRX8888格式 |
| NATIVEBUFFER_PIXEL_FMT_BGRA_8888 | BGRA8888格式 |
| NATIVEBUFFER_PIXEL_FMT_BUTT | 无效格式 |
**起始版本:**
10
### OH_NativeBuffer_Usage
```
enum OH_NativeBuffer_Usage
```
**描述:**
OH_NativeBuffer的用途。
\@
SysCap SystemCapability.Graphic.Graphic2D.NativeBuffer
| 枚举值 | 描述 |
| -------- | -------- |
| NATIVEBUFFER_USAGE_CPU_READ | CPU可读 |
| NATIVEBUFFER_USAGE_CPU_WRITE | CPU可写 |
| NATIVEBUFFER_USAGE_MEM_DMA | 直接内存访问缓冲区 |
**起始版本:**
10
## 函数说明
...
...
zh-cn/application-dev/reference/native-apis/_o_h___native_buffer___config.md
浏览文件 @
6cbff5ef
...
...
@@ -21,9 +21,72 @@ OH_NativeBuffer的属性配置,用于申请新的OH_NativeBuffer实例或查
### 成员变量
|
成员变量
名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| width | 宽度(像素)。 |
| height | 高度(像素)。 |
| format | 像素格式。 |
| usage | buffer的用途说明。 |
|
[
width
](
#width
)
| 宽度(像素)。 |
|
[
height
](
#height
)
| 高度(像素)。 |
|
[
format
](
#format
)
| 像素格式。 |
|
[
usage
](
#usage
)
| buffer的用途说明。 |
|
[
stride
](
#stride
)
| 本地窗口缓冲区步幅。 |
## 结构体成员变量说明
### format
```
int32_t OH_NativeBuffer_Config::format
```
**描述:**
像素格式
### height
```
int32_t OH_NativeBuffer_Config::height
```
**描述:**
高度(像素)。
### stride
```
int32_t OH_NativeBuffer_Config::stride
```
**描述:**
本地窗口缓冲区步幅。
**起始版本:**
10
### usage
```
int32_t OH_NativeBuffer_Config::usage
```
**描述:**
buffer的用途说明。
### width
```
int32_t OH_NativeBuffer_Config::width
```
**描述:**
宽度(像素)。
zh-cn/application-dev/reference/native-apis/native__buffer_8h.md
浏览文件 @
6cbff5ef
...
...
@@ -30,6 +30,12 @@
| -------- | -------- |
|
[
OH_NativeBuffer
](
_o_h___native_buffer.md#oh_nativebuffer
)
| 提供OH_NativeBuffer结构体声明 |
### 枚举
| 名称 | 描述 |
| -------- | -------- |
|
[
OH_NativeBuffer_Usage
](
_o_h___native_buffer.md#oh_nativebuffer_usage
)
{ NATIVEBUFFER_USAGE_CPU_READ = (1ULL
<<
0), NATIVEBUFFER_USAGE_CPU_WRITE = (1ULL
<<
1), NATIVEBUFFER_USAGE_MEM_DMA = (1ULL
<<
3) } | OH_NativeBuffer的用途。 |
|
[
OH_NativeBuffer_Format
](
_o_h___native_buffer.md#oh_nativebuffer_format
)
{
<br/>
NATIVEBUFFER_PIXEL_FMT_RGB_565 = 3, NATIVEBUFFER_PIXEL_FMT_RGBA_5658, NATIVEBUFFER_PIXEL_FMT_RGBX_4444, NATIVEBUFFER_PIXEL_FMT_RGBA_4444,
<br/>
NATIVEBUFFER_PIXEL_FMT_RGB_444, NATIVEBUFFER_PIXEL_FMT_RGBX_5551, NATIVEBUFFER_PIXEL_FMT_RGBA_5551, NATIVEBUFFER_PIXEL_FMT_RGB_555,
<br/>
NATIVEBUFFER_PIXEL_FMT_RGBX_8888, NATIVEBUFFER_PIXEL_FMT_RGBA_8888, NATIVEBUFFER_PIXEL_FMT_RGB_888, NATIVEBUFFER_PIXEL_FMT_BGR_565,
<br/>
NATIVEBUFFER_PIXEL_FMT_BGRX_4444, NATIVEBUFFER_PIXEL_FMT_BGRA_4444, NATIVEBUFFER_PIXEL_FMT_BGRX_5551, NATIVEBUFFER_PIXEL_FMT_BGRA_5551,
<br/>
NATIVEBUFFER_PIXEL_FMT_BGRX_8888, NATIVEBUFFER_PIXEL_FMT_BGRA_8888, NATIVEBUFFER_PIXEL_FMT_BUTT = 0X7FFFFFFF
<br/>
} | OH_NativeBuffer的格式。 |
### 函数
...
...
zh-cn/application-dev/reference/native-apis/native__vsync_8h.md
浏览文件 @
6cbff5ef
...
...
@@ -32,3 +32,4 @@
|
[
OH_NativeVSync_Create
](
_native_vsync.md#oh_nativevsync_create
)
(
const
char
\*
name, unsigned int length) | 创建一个OH_NativeVSync实例,每次调用都会产生一个新的实例 |
|
[
OH_NativeVSync_Destroy
](
_native_vsync.md#oh_nativevsync_destroy
)
(
OH_NativeVSync
\*
nativeVsync) | 销毁OH_NativeVSync实例 |
|
[
OH_NativeVSync_RequestFrame
](
_native_vsync.md#oh_nativevsync_requestframe
)
(
OH_NativeVSync
\*
nativeVsync, OH_NativeVSync_FrameCallback callback, void
\*
data) | 请求下一次vsync信号,当信号到来时,调用回调函数callback |
|
[
OH_NativeVSync_GetPeriod
](
_native_vsync.md#oh_nativevsync_getperiod
)
(
OH_NativeVSync
\*
nativeVsync, long long
\*
period) |获取vsync周期。|
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录