Skip to content

Conversation

@sebuntin
Copy link

ohos: Add skeleton code for OHOS text measurement and rendering to prevent text rendering process from crashing

bulloo and others added 2 commits October 9, 2025 12:05
@tencent-adm
Copy link

tencent-adm commented Oct 9, 2025

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ sebuntin
✅ bulloo
❌ ywenjing


sebuntin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch 2 times, most recently from 06f7176 to bd77e49 Compare October 10, 2025 02:47
@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch from bd77e49 to c4be0c4 Compare October 10, 2025 03:14
@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch from 6eb53db to fc27bab Compare October 11, 2025 07:18
@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch from 5608dc4 to f2b2658 Compare October 14, 2025 03:55
@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch from 6690afd to ff6eb1c Compare October 16, 2025 13:44
@sebuntin sebuntin changed the title ohos: Add skeleton code for OHOS text measurement and rendering ohos: Improve the skeleton code of ovCompose access to OHOS unified rendering (Render Service) Oct 17, 2025

void OHRenderNodeDrawClipRect(float left, float top, float right, float bottom, const RenderNodeSaveState *saveState,
BaseRenderNode *renderNodeForDrawing) {
ArkUI_RectShapeOption *shape = OH_ArkUI_RenderNodeUtils_CreateRectShapeOption();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clip 频率非常高,这个 shape 有办法全局复用吗?或者能否先判断当前的 renderNode 上是否已经存在了 shape ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以考虑将这个shape提取到renderNode中,跟随renderNode的生命周期,只要renderNode不被销毁,shape也可以被这个renderNode一直复用

return this;
}

BaseRenderNode* setTransform(float* matrix) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面已经有了 BaseRenderNode* setTransform(const float* matrix),应该可以删除这个了 BaseRenderNode* setTransform(float* matrix)


// 释放绘制资源
OH_Drawing_CanvasDetachPen(canvas);
OH_Drawing_PathClose(path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看上去少了 OH_Drawing_PathDetory(path) 的调用


// 释放绘制资源
OH_Drawing_CanvasDetachPen(canvas);
OH_Drawing_PathClose(path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OH_Drawing_PathClose 这个会释放 path 吗?看上去和 OH_Drawing_PathDestory 语义不一样

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该是写错了,应该调用OH_Drawing_PathDestroy方法

auto *data = static_cast<RectGradientRenderNode *>(userData);
auto *canvas1 = OH_ArkUI_DrawContext_GetCanvas(context);
OH_Drawing_Canvas *canvas = reinterpret_cast<OH_Drawing_Canvas *>(canvas1);
OH_Drawing_ShaderEffect *shaderEffect = CreateShaderEffect(data->shader);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里一定要创建 shaderEffect 吗?

import androidx.compose.ui.graphics.StrokeJoin
import platform.arkui.OH_Drawing_BlendMode

internal fun BlendMode.asNativeBlendMode(): OH_Drawing_BlendMode {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议加上 inline

class OHComposeNativePaint(val handle: OHComposeNativePaint_Handle?) {
fun sync(paint: Paint) {
// 实现与 OHComposeNativePaint 的同步逻辑
LogPrintUtil.verbose("OHComposeNativePaint::sync, compose paint: (${paint.toReadableString()})")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里要小心,日志创建的字符串,是 100% 创建的

helenyan and others added 4 commits October 22, 2025 18:19
ohos: Fix OverScroll animation issues by correctly parsing VSync sign…
@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch 4 times, most recently from 176137b to 1d59d24 Compare October 24, 2025 06:16
@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch from 1d59d24 to 3a977da Compare October 24, 2025 06:17
@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch from f47f615 to c03c114 Compare October 30, 2025 04:28
@sebuntin sebuntin force-pushed the ohos-compose-1.6.1-20250919 branch from c03c114 to 1b2af1e Compare October 30, 2025 04:30
bulloo and others added 17 commits November 3, 2025 19:19
feat:implement drawingItem diff
- Add LayerSourceType enum (LAZY_LIST_ITEM, REGULAR)
- Extend OwnedLayer interface with getSourceType() method
- Update Owner.createLayer() API with sourceType parameter (default=REGULAR)
- Update OwnedLayerFactory.createLayer() with sourceType parameter
- Implement sourceType in ArkUIRenderNodeLayer with isLazyListItem() helper
- Update Placeable.placeWithLayer() and placeRelativeWithLayer() APIs
- Update NodeCoordinator and RootNodeOwner to propagate sourceType
- LazyListMeasuredItem now passes LAZY_LIST_ITEM when placing items

This enables OHOS platform to identify LazyList item layers.
fix: 解决LazyColumn组件的滑动问题
…nvas

feat: Add support for drawing oval, arc, and path shapes in canvas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants