提交 08a10e95 编写于 作者: Z zhumingxian

fix some typos

Signed-off-by: Nzhumingxian <zhumingxian@ohos.com.cn>
上级 6737a8cc
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
- Vibrator - Vibrator
- [Vibrator Overview](vibrator-overview.md) - [Vibrator Overview](vibrator-overview.md)
- [Vibrator Development](vibrator-guidelines.md) - [Vibrator Development](vibrator-guidelines.md)
- Update Servcie - Update Service
- [Sample Server Overview](sample-server-overview.md) - [Sample Server Overview](sample-server-overview.md)
- [Sample Server Development](sample-server-guidelines.md) - [Sample Server Development](sample-server-guidelines.md)
...@@ -56,7 +56,7 @@ The following steps describe how to use `OH_NativeXComponent` in OpenHarmony to ...@@ -56,7 +56,7 @@ The following steps describe how to use `OH_NativeXComponent` in OpenHarmony to
3. Define the callback `OnSurfaceCreated`. During the creation of a `Surface`, the callback is used to initialize the rendering environment, for example, the `Skia` rendering environment, and write the content to be displayed to `NativeWindow`. 3. Define the callback `OnSurfaceCreated`. During the creation of a `Surface`, the callback is used to initialize the rendering environment, for example, the `Skia` rendering environment, and write the content to be displayed to `NativeWindow`.
```c++ ```c++
void OnSufaceCreatedCB(NativeXComponent* component, void* window) { void OnSurfaceCreatedCB(NativeXComponent* component, void* window) {
// Obtain the width and height of the native window. // Obtain the width and height of the native window.
uint64_t width_ = 0, height_ = 0; uint64_t width_ = 0, height_ = 0;
OH_NativeXComponent_GetXComponentSize(nativeXComponent, window, &width_, &height_); OH_NativeXComponent_GetXComponentSize(nativeXComponent, window, &width_, &height_);
...@@ -89,8 +89,8 @@ The following steps describe how to use `OH_NativeXComponent` in OpenHarmony to ...@@ -89,8 +89,8 @@ The following steps describe how to use `OH_NativeXComponent` in OpenHarmony to
// Create Skia Canvas and write the content to the native window. // Create Skia Canvas and write the content to the native window.
... ...
// After the write operation is complete, flush the buffer by using OH_NativeWindwo_NativeWindowFlushBuffer so that the data is displayed on the screen. // After the write operation is complete, flush the buffer by using OH_NativeWindow_NativeWindowFlushBuffer so that the data is displayed on the screen.
Regoin region{nullptr, 0}; Region region{nullptr, 0};
OH_NativeWindow_NativeWindowFlushBuffer(nativeWindow_, buffer, fenceFd, region) OH_NativeWindow_NativeWindowFlushBuffer(nativeWindow_, buffer, fenceFd, region)
} }
``` ```
...@@ -99,9 +99,9 @@ The following steps describe how to use `OH_NativeXComponent` in OpenHarmony to ...@@ -99,9 +99,9 @@ The following steps describe how to use `OH_NativeXComponent` in OpenHarmony to
```c++ ```c++
OH_NativeXComponent_Callback &callback_; OH_NativeXComponent_Callback &callback_;
callback_->OnSurfaceCreated = OnSufaceCreatedCB; callback_->OnSurfaceCreated = OnSurfaceCreatedCB;
callback_->OnSurfaceChanged = OnSufaceChangedCB; callback_->OnSurfaceChanged = OnSurfaceChangedCB;
callback_->OnSurfaceDestoryed = OnSufaceDestoryedCB; callback_->OnSurfaceDestoryed = OnSurfaceDestoryedCB;
callback_->DispatchTouchEvent = DispatchTouchEventCB; callback_->DispatchTouchEvent = DispatchTouchEventCB;
OH_NativeXComponent_RegisterCallback(nativeXComponent, callback_) OH_NativeXComponent_RegisterCallback(nativeXComponent, callback_)
``` ```
...@@ -56,7 +56,7 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建 ...@@ -56,7 +56,7 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建
3. **定义回调函数OnSurfaceCreated**。用于在`Surface`创建时,通过回调函数初始化开发者的渲染环境,例如`Skia`渲染环境。并将要显示的内容写入`NativeWindow` 3. **定义回调函数OnSurfaceCreated**。用于在`Surface`创建时,通过回调函数初始化开发者的渲染环境,例如`Skia`渲染环境。并将要显示的内容写入`NativeWindow`
```c++ ```c++
void OnSufaceCreatedCB(NativeXComponent* component, void* window) { void OnSurfaceCreatedCB(NativeXComponent* component, void* window) {
//获取 native window 的宽高 //获取 native window 的宽高
uint64_t width_ = 0, height_ = 0; uint64_t width_ = 0, height_ = 0;
OH_NativeXComponent_GetXComponentSize(nativeXComponent, window, &width_, &height_); OH_NativeXComponent_GetXComponentSize(nativeXComponent, window, &width_, &height_);
...@@ -89,8 +89,8 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建 ...@@ -89,8 +89,8 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建
//创建 Skia Canvas 并将内容写入naitve window //创建 Skia Canvas 并将内容写入naitve window
... ...
//写入完成后,通过OH_NativeWindwo_NativeWindowFlushBuffer 提交给消费者使用,例如:显示在屏幕上 //写入完成后,通过OH_NativeWindow_NativeWindowFlushBuffer 提交给消费者使用,例如:显示在屏幕上
Regoin region{nullptr, 0}; Region region{nullptr, 0};
OH_NativeWindow_NativeWindowFlushBuffer(nativeWindow_, buffer, fenceFd, region) OH_NativeWindow_NativeWindowFlushBuffer(nativeWindow_, buffer, fenceFd, region)
} }
``` ```
...@@ -99,9 +99,9 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建 ...@@ -99,9 +99,9 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建
```c++ ```c++
OH_NativeXComponent_Callback &callback_; OH_NativeXComponent_Callback &callback_;
callback_->OnSurfaceCreated = OnSufaceCreatedCB; callback_->OnSurfaceCreated = OnSurfaceCreatedCB;
callback_->OnSurfaceChanged = OnSufaceChangedCB; callback_->OnSurfaceChanged = OnSurfaceChangedCB;
callback_->OnSurfaceDestoryed = OnSufaceDestoryedCB; callback_->OnSurfaceDestoryed = OnSurfaceDestoryedCB;
callback_->DispatchTouchEvent = DispatchTouchEventCB; callback_->DispatchTouchEvent = DispatchTouchEventCB;
OH_NativeXComponent_RegisterCallback(nativeXComponent, callback_) OH_NativeXComponent_RegisterCallback(nativeXComponent, callback_)
``` ```
...@@ -3292,7 +3292,7 @@ root { ...@@ -3292,7 +3292,7 @@ root {
busType = 0; // 0:i2c 1:spi busType = 0; // 0:i2c 1:spi
busNum = 5; busNum = 5;
busAddr = 0x15; busAddr = 0x15;
regWidth = 1; // 1btye regWidth = 1; // 1byte
} }
sensorIdAttr :: sensorIdInfo { sensorIdAttr :: sensorIdInfo {
chipName = "mxc6655xa"; chipName = "mxc6655xa";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册