已合并
fix SetCacheDir: early return on empty path and apply cache dir in non-uniform-render mode #31456
fix SetCacheDir: early return on empty path and apply cache dir in non-uniform-render mode #31456
已合并
LyBbq创建于 7月21日
LyBbq成员
7月21日

Description:

问题背景:

RSUIDirector::SetCacheDir 此前将空路径检查放在 RS_MODIFIERS_DRAW_ENABLE 分支与 rsUIContext_ 判空之后:空路径仍会继续走混合渲染逻辑;且非统一渲染(!isUniRenderEnabled_)模式下从未将 cacheDir 传递给 RSRenderThread,该模式下缓存目录设置不生效。

修复方案:

空路径检查前置、命中即提前返回;!isUniRenderEnabled_ 时调用 RSRenderThread::Instance().SetCacheDir(cacheDir_) 使非统一渲染模式同样生效;混合渲染(RS_MODIFIERS_DRAW_ENABLE)分支逻辑保持不变(rs_ui_director.cpp)。

Issue number:https://gitcode.com/openharmony/graphic_graphic_2d/issues/25043

Test & Result:

  • 门禁通过:编译、静态检查、冒烟测试均成功,已合入 master
  • 两种渲染模式下 SetCacheDir 均正确生效,空路径不再继续下发

CodeCheck:

类型 自检项 自检结果
多线程 在类的成员变量中定义了vector/map/list等容器类型,且在多个成员函数中有操作时,需要加锁保护 自检结果:
定义全局变量,在多个函数中都有操作时,需要加锁保护 自检结果:
内存操作 调用外部接口时,确认是否对返回值做了判空判断,尤其外部接口返回了nullptr的情况,避免进程崩溃 自检结果:
内存操作优先使用安全函数,并检查其返回值 自检结果:
注意每个异常退出流程,是否都已经将资源释放(推荐使用RAII) 自检结果:
隐式内存分配场景:realpath、ReadParcelable序列化、cJSON相关函数时等,需主动释放或使用智能指针 自检结果:
外部输入 所有外部输入均不可信,需判断外部输入是否直接作为内存分配的大小,数组下标、循环条件、SQL查询等 自检结果:
注意外部字符串数据有无尾0 自检结果:
外部输入的路径不可信,需使用realpath做标准化处理,并判断路径的合法性 自检结果:
敏感信息 注意日志中打印敏感信息需匿名化 自检结果:
数学运算 代码中是否混合了加减乘除等运算,需检查是否可能导致整数溢出或符号翻转 自检结果:
初始化 类成员、局部变量使用前需初始化 自检结果:
权限管理 作为系统服务对外提供了接口(或RSCmd),是否做了权限保护和校验,只允许申请了权限的应用访问 自检结果:

L0新增用例自检结果

likedislike
Pull Request已成功合入, 合并人@openharmony_ci
(感谢 LyBbq 的贡献)
LLyBbq成员
7月21日 关联了issue:[Bug]: fix SetCache
openharmony_ciopenharmony_ci成员
7月21日 添加了label:waiting_on_author
openharmony_ci
openharmony_ci成员
7月21日 评论:

感谢提交 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成员
7月21日 添加了label:dco检查成功
LyBbq成员
7月21日 评论:

start build

likedislike
openharmony_ci
openharmony_ci成员
7月21日 评论:

首次触发
门禁构建开始,包含静态检查、代码编译和测试【dayu200编译, dayu200_tdd编译, ohos-sdk编译, mac-sdk编译, hap_build编译, x86_64_virt编译, dayu200测试, master_inner_build编译, dayu600_7885编译, ohos-host_mini_tdd编译, part_compile编译】,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/6a5f375a64650f998b6ab519/runlist

likedislike
openharmony_ciopenharmony_ci成员
7月21日 添加了label:静态检查失败
openharmony_ci
openharmony_ci成员
7月21日 评论:

代码门禁未通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/6a5f375a64650f998b6ab519/runlist

静态检查:

# check type result report
1 codeCheck noPass >>>

编译测试:
# Device build result package
1 ohos-sdk pending NA
2 dayu200 pending NA
3 dayu200_tdd pending NA
4 hap_build pending NA
5 part_compile pending NA
6 master_inner_build pending NA
7 mac-sdk pending NA
8 ohos-host_mini_tdd pending NA
9 x86_64_virt pending NA
10 dayu600_7885 pending NA

likedislike
LLyBbq成员
7月21日 审查状态已重置,审查人: gaoshuai3011
LLyBbq成员
7月21日 推送  1 个提交:3c3499a5-fix
openharmony_ciopenharmony_ci成员
7月21日 删除了label:静态检查失败
openharmony_ci
openharmony_ci成员
7月21日 评论:

代码有更新,重置PR验证状态

likedislike
openharmony_ci
openharmony_ci成员
7月21日 评论:

感谢提交 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
LLyBbq成员
7月21日 审查状态已重置,审查人: gaoshuai3011
LLyBbq成员
7月21日 推送  1 个提交:03eb857e-fix
openharmony_ci
openharmony_ci成员
7月21日 评论:

感谢提交 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
LyBbq成员
7月21日 评论:

start build

likedislike
openharmony_ci
openharmony_ci成员
7月21日 评论:

本地或库上代码有更新,全量重新构建,重置所有关联PR的验证状态
门禁构建开始,包含静态检查、代码编译和测试【dayu200编译, dayu600_7885编译, mac-sdk编译, master_inner_build编译, dayu200_tdd编译, ohos-host_mini_tdd编译, part_compile编译, ohos-sdk编译, dayu200测试, x86_64_virt编译, hap_build编译】,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/6a5f535064650f998b748248/runlist

likedislike
openharmony_ciopenharmony_ci成员
7月21日 添加了label:编译成功
openharmony_ciopenharmony_ci成员
7月21日 添加了label:静态检查成功
openharmony_ciopenharmony_ci成员
7月21日 添加了label:冒烟测试成功
openharmony_ciopenharmony_ci成员
7月21日 通过测试
openharmony_ci
openharmony_ci成员
7月21日 评论:

代码门禁通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/6a5f535064650f998b748248/runlist

静态检查:

# check type result report
1 codeCheck pass >>>

编译测试:
# Device build result test result package
1 ohos-sdk success NA >>>
2 dayu200 success success >>>
3 dayu200_tdd success NA >>>
4 hap_build success NA >>>
5 part_compile success(IGNORE) NA >>>
6 master_inner_build success(IGNORE) NA >>>
7 mac-sdk success NA >>>
8 ohos-host_mini_tdd success NA >>>
9 x86_64_virt success NA >>>
10 dayu600_7885 (IGNORE) NA >>>

likedislike
openharmony_ciopenharmony_ci成员
7月21日 删除了label:waiting_on_author
openharmony_ciopenharmony_ci成员
7月21日 添加了label:waiting_for_review
openharmony_ci
openharmony_ci成员
7月21日 评论:

您好,Committer @liumingxiang1 @comicchang @aslklw @wang-luyu4 @lijj01 @stonesxd @xuyuqiong @kroswang @djnash @gmiao522 @wh_qwe @liuchao-huawei @BruceXu @liuchuan666 @gaoweihua ,请分配检视人员检视该PR,可以通过命令"assign [@someone_id]"分配检视人员,也可以直接评论"assign"分配给自己进行检视。


Hello, Committer @liumingxiang1 @comicchang @aslklw @wang-luyu4 @lijj01 @stonesxd @xuyuqiong @kroswang @djnash @gmiao522 @wh_qwe @liuchao-huawei @BruceXu @liuchuan666 @gaoweihua . Please assign someone to review the PR. You can assign a reviewer by using the command "assign [@someone_id]", or you can comment "assign" to review the PR by yourself.

likedislike
gaoshuai3011gaoshuai3011成员
7月21日 通过审查
此处折叠了6条事件消息 查看更多
LLyBbq成员
29 天前 修改了pull request 的描述