已合并
material overlay split #88098
material overlay split #88098
已合并
chenwenchang101创建于 12 天前
chenwenchang101
12 天前

IssueNo:[新需求]: material overlay split
Description: [新需求]: material overlay split
Sig: SIG_ApplicationFramework
Binary Source: No(涉及则Yes)

请勿修改以下选项内容,仅需保存后点击复选框,或在编辑时将对应项前面的[ ]改为[x]

Do not modify the following option content. Simply save and click the checkbox, or when editing, change [ ] to [x] for the relevant item.

Feature or Bugfix

  • 需求/Feature
  • 缺陷/Bugfix

是否涉及非兼容变更/Whether it involves incompatible changes

  • 是/Yes
  • 否/No

TDD自验结果/TDD Self-Verification Results

  • 通过,请在下方提供截图/Pass. Provide execution details in picture below.
  • 失败,请在下方提供基线执行情况截图/Fail. Provide baseline execution details in picture below.
  • 不涉及/Not Involved

XTS自验结果/XTS Self-Verification Results

  • 通过,请在下方提供截图/Pass. Provide execution details in picture below.
  • 失败,请在下方提供基线执行情况截图/Fail. Provide baseline execution details in picture below.
  • 不涉及/Not Involved

检视意见是否都已闭环/Have all review comments been resolved

  • 是/Yes
  • 否/No

是否已执行L0用例

  • 已验证/Yes
  • 不涉及,请在下方说明原因/Not Involved. Please specify the reasons below.
likedislike
Pull Request已成功合入, 合并人@openharmony_ci
(感谢 chenwenchang101 的贡献)
openharmony_ciopenharmony_ci成员
12 天前 添加了label:waiting_on_author
openharmony_ci
openharmony_ci成员
12 天前 评论:

感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接


Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ciopenharmony_ci成员
12 天前 添加了label:dco检查成功
chenwenchang101chenwenchang101
12 天前 强制推送  1 个提交:8e575495-material overlay split
openharmony_ci
openharmony_ci成员
12 天前 评论:

感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接


Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
此处折叠了82条消息 查看更多
yylong成员
2 天前 评论:

material overlay split 检视:发现 4 个问题(1 中、3 低)。详见行评论。核心关注点:动态材质库符号签名变更的同步依赖、static_pointer_cast 空检失效、UpdateAppendOverlayShader 串联逻辑缺单测、RequestNextFrame 触发不一致。

likedislike
yylong成员2 天前进行代码检视1
frameworks/core/components/common/properties/ui_material.cpp
@@ -549,0 +560,4 @@
560+ std::call_once(onceFlag, []() {
561+ auto handle = GetMaterialLib();
562+ CHECK_NULL_VOID(handle);
563+ createFunc = reinterpret_cast<CreateMaterialFilterWithSplitFunc>(
yylong2 天前评论:

问题影响【一般】 CreateUiMaterialShaderECSub 的函数指针类型由 1 参 CreateMaterialFilterFunc 改为 2 参 CreateMaterialFilterWithSplitFunc(新增 bool needSplitOverlayShader),但 dlsym 加载的符号名未变。

若部署侧材质库(GetMaterialLib() 返回的 .so)未同步升级到新签名,旧实现会忽略多传的 bool,导致 split overlay 特性静默失效(不报错,仅 base shader 不拆分),并在部分调用约定下存在参数传递不匹配的风险。

建议:确认材质库已同步导出 2 参版本的 CreateUiMaterialShaderECSub;或为旧库保留兼容分支(按符号版本探测后回退到 1 参调用)。

likedislike
yylong成员2 天前进行代码检视1
frameworks/core/components_ng/render/adapter/ui_material_filter_creator.cpp
@@ -806,0 +821,4 @@
821+ overlay =
822+ RosenEffectConverter::ConvertToRSNGFrostedGlassEffectECSubOverlay(*(iter->second), newConfig.dipScale);
823+ }
824+ auto glassEffect = std::static_pointer_cast<Rosen::RSNGFrostedGlassEffect>(overlay);
yylong2 天前评论:

问题影响【一般】 std::static_pointer_cast<Rosen::RSNGFrostedGlassEffect>(overlay) 后接 CHECK_NULL_RETURN(glassEffect, nullptr) 是无效防护:static_pointer_cast 对非空 shared_ptr 永远返回非空,空检永不触发。

overlay 来自动态库路径 MaterialUtils::GetUiMaterialECSubShaderOverlay(其返回 shaderStruct->shader,具体派生类型未知)而非本地 ConvertToRSNGFrostedGlassEffectECSubOverlay(必为 RSNGFrostedGlassEffect)时,若实际类型不符,后续 Setter<FrostedGlassEffectWeightsEmbossTag> 会触发 UB。

建议:改用 dynamic_pointer_cast<Rosen::RSNGFrostedGlassEffect>(overlay) 并做空检;或固化不变量"overlay 必为 RSNGFrostedGlassEffect"并在该处加注释断言。(注:与既有 ConvertToUiMaterialECSubShader 同一模式,建议借此次新增一并加固。)

likedislike
yylong成员2 天前进行代码检视1
test/unittest/core/pattern/overlay/sheet_presentation_test_five_ng.cpp
@@ -2062,0 +2064,4 @@
2064+ * @tc.desc: Test SetMaterialNeedSplitOverlayShader with valid material and immersive options.
2065+ * @tc.type: FUNC
2066+ */
2067+HWTEST_F(SheetPresentationTestFiveNg, SetMaterialNeedSplitOverlayShader001, TestSize.Level1)
yylong2 天前评论:

问题影响【提示】 新增用例仅覆盖 SetMaterialNeedSplitOverlayShader 标志位写入;本次核心新增逻辑均无单测覆盖:

  • ConvertToUiMaterialECSubShaderOverlay(split 开关分支、动态库/本地回退)
  • SetMaterialShaderECSubOverlay / UpdateAppendOverlayShaderappendOverlayShader_[2]CopyAsSingleEffect+Append 串联、清空顺序、early-return 守卫)
  • 重命名的 SetOverlayNGShader

mock ConvertToUiMaterialECSubShaderOverlay 直接返回 nullptr,使 overlay 路径在 UT 中根本不被执行。UpdateAppendOverlayShader 依赖 CopyAsSingleEffect"只复制单效果不带子节点"的语义,缺少回归用例后一旦 RS 侧语义变化难以及时发现。

建议:补 UpdateAppendOverlayShader 多 shader 串联/单清/双清的 UT(可用 fake RSNGShaderBase 记录 Append/CopyAsSingleEffect 调用)。

likedislike
yylong成员2 天前进行代码检视1
frameworks/core/components_ng/render/adapter/rosen_render_context.cpp
@@ -1909,3 +1909,3 @@
19091909}
19101910 
1911-void RosenRenderContext::SetForegroundShader(const std::shared_ptr<OHOS::Ace::RenderEdgeLightModifier>& edgeLightFilter)
1911+void RosenRenderContext::SetOverlayNGShader(const std::shared_ptr<OHOS::Ace::RenderEdgeLightModifier>& edgeLightFilter)
yylong2 天前评论:

问题影响【提示】 SetOverlayNGShader(边缘光路径)更新 appendOverlayShader_[1] 后调 UpdateAppendOverlayShader(),但未调 RequestNextFrame();而同文件 SetMaterialShaderECSubOverlayUpdateAppendOverlayShader() 之后显式调了 RequestNextFrame()

这与既有行为一致(SetMaterialShaderECSub 本就请求下一帧,旧 SetForegroundShader 不请求、依赖 RS 脏标记),大概率是有意为之。但边缘光在动画过程中会高频调 SetOverlayNGShader,请确认:仅依赖 rsNode_->SetOverlayNGShader 的 RS 侧脏标记足以驱动重绘,无需 ace 侧主动请求下一帧。

likedislike