已合并
feat(utils): add selection geometry utils for rect/point operations #158
feat(utils): add selection geometry utils for rect/point operations #158
已合并
no86创建于 7月31日
no86
no86
7月31日

修改说明

新增选区几何矩形工具集,作为 utils 可复用能力储备,不影响主业务运行时行为。对应 issue #190。

修改内容

  • 新增 utils/include/selection_geometry_utils.h:声明 SelectionRect/SelectionPoint 值结构 + SelectionGeometryUtils 静态工具类 + SelectionRectCombiner 增量合并器。
  • 新增 utils/src/selection_geometry_utils.cpp:纯实现,无注释;坐标运算全部走 int64_t 中间值 + ClampToInt32,规避 integer_overflow / INT32_MIN 取反 UB。
  • service/BUILD.gn:两处 sources 增加 ../utils/src/selection_geometry_utils.cpp(与 selection_timer.cpp 同模式接入)。

不影响主业务的保证

  • 全部为无状态纯函数/静态方法,无全局可变状态,静态初始化无副作用;
  • 不被任何业务文件 include 或调用,运行时无路径触发;
  • 配合 -fvisibility=hidden + --gc-sections,未引用符号被链接器 GC,二进制与运行时零影响;
  • 仅修改 BUILD.gnsources 列表,未改任何业务文件逻辑。

验证

  • g++ -std=c++17 -fsyntax-only -Wall -Wextra -Iutils/include utils/src/selection_geometry_utils.cpp 通过(exit 0,零错误零警告)。
  • 待补:OpenHarmony 树下完整构建 + CFI/UBSan 运行时检查。

相关的Issue

#190

likedislike
Pull Request已成功合入, 合并人@openharmony_ci
(感谢 no86 的贡献)
no86no86
7月31日 关联了issue:[utils] 新增选区几何矩形工具集 SelectionGeometryUtils
openharmony_ciopenharmony_ci成员
7月31日 添加了label:waiting_on_author
openharmony_ci
openharmony_ci成员
7月31日 评论:

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

start build

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

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

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

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

静态检查:

# check type result report
1 codeCheck noPass >>>

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

likedislike
zl_startup成员7月31日进行代码检视2
utils/include/selection_geometry_utils.h
已过期
@@ -0,0 +1,1 @@
1+/*
2+ * Copyright (c) 2025 Huawei Device Co., Ltd.
zl_startup7月31日评论:

版权时间不对

likedislike
System
系统消息系统
7月31日 评论:

changed this line on 35b6957c view diff detail

zl_startup成员7月31日进行代码检视2
utils/src/selection_geometry_utils.cpp
已过期
@@ -0,0 +1,1 @@
1+/*
2+ * Copyright (c) 2025 Huawei Device Co., Ltd.
zl_startup7月31日评论:

版权时间不对

likedislike
System
系统消息系统
7月31日 评论:

changed this line on 35b6957c view diff detail

no86no86
7月31日 强制推送  1 个提交:35b6957c-feat(utils): add selection geometry utils for rect/point operations
openharmony_ciopenharmony_ci成员
7月31日 删除了label:静态检查失败
openharmony_ci
openharmony_ci成员
7月31日 评论:

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

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

感谢提交 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
no86
no86
7月31日 评论:

start build

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

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

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

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

静态检查:

# check type result report
1 codeCheck noPass >>>

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

likedislike
no86no86
7月31日 强制推送  1 个提交:caf17225-feat(utils): add selection geometry utils for rect/point operations
openharmony_ciopenharmony_ci成员
7月31日 删除了label:静态检查失败
openharmony_ci
openharmony_ci成员
7月31日 评论:

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

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

感谢提交 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
no86
no86
7月31日 评论:

start build

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

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

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

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

静态检查:

# check type result report
1 codeCheck pass >>>

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

likedislike
openharmony_dcp
openharmony_dcp成员
7月31日 评论:

你因提交次数过多被限制提交,为保障上库效率、避免资源浪费,请先观看学习视频:https://dcp.openharmony.cn/workbench/video/videoDisplay

likedislike
no86no86
7月31日 强制推送  1 个提交:0ba0de28-feat(utils): add selection geometry utils for rect/point operations
openharmony_ciopenharmony_ci成员
7月31日 删除了label:编译失败
openharmony_ciopenharmony_ci成员
7月31日 删除了label:静态检查成功
openharmony_ciopenharmony_ci成员
7月31日 删除了label:冒烟测试成功
openharmony_ci
openharmony_ci成员
7月31日 评论:

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

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

感谢提交 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
no86
no86
7月31日 评论:

start build

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

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

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

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

静态检查:

# check type result report
1 codeCheck pass >>>

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

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

您好,Committer @Dufree @hwymlgitcode @zl_startup ,请分配检视人员检视该PR,可以通过命令"assign [@someone_id]"分配检视人员,也可以直接评论"assign"分配给自己进行检视。


Hello, Committer @Dufree @hwymlgitcode @zl_startup . 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
openharmony_ciopenharmony_ci成员
7月31日 关闭了关联的issue
openharmony_ciopenharmony_ci成员
7月31日 合入了pull request,合并节点 SHA:924009cc78b3e159ba916e082cb0ad9f1a93f265
openharmony_ciopenharmony_ci成员
7月31日 删除了label:waiting_for_review
openharmony_ciopenharmony_ci成员
7月31日 添加了label:merged