Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR adds a cached DTK capability check for the Qt Quick scene graph backend and incorporates it into InWindowBlur's blitter enablement. OpenGL/default backends retain blur behavior, while unsupported RHI backends disable blitting and allow affected FloatingPanel components to fall back to opaque backgrounds rather than showing unblurred transparency. Flow diagram for backend-aware window blurflowchart TD
A[InWindowBlur evaluates blitterEnabled] --> B[isBlurBackendSupported]
B --> C[QQuickWindow.sceneGraphBackend]
C -->|empty or opengl| D[blitterEnabled remains true]
C -->|other RHI backend| E[blitterEnabled becomes false]
D --> F[FloatingPanel uses blur and semi-transparent background]
E --> G[FloatingPanel falls back to opaque background]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
| id: blitter | ||
| anchors.fill: parent | ||
| blitterEnabled: !D.DTK.isSoftwareRender && D.DTK.hasInWindowBlur | ||
| blitterEnabled: !D.DTK.isSoftwareRender && D.DTK.hasInWindowBlur && D.DTK.isBlurBackendSupported |
There was a problem hiding this comment.
要是没有opengl,就用software渲染,这个应该就够了,不用加isBlurBackendSupported吧,
1. Root cause: InWindowBlur.qml blitterEnabled only checked isSoftwareRender and hasInWindowBlur, not RHI backend type; on SW architecture non-OpenGLES2 backends silently skip blur rendering 2. Fix: add isBlurBackendSupported() to check sceneGraphBackend is empty or opengl, gate blitterEnabled with this new condition 3. Impact: non-OpenGL backends fall back to opaque background; OpenGL/default backends unaffected (new condition returns true) Log: Fix semi-transparent blur background on non-OpenGL RHI backends Influence: 1. Test FloatingPanel blur on x86/ARM (OpenGL) — no regression 2. Test FloatingPanel background on SW architecture — should be opaque 3. Verify control center, file manager, album dialogs render correctly fix: 修复非OpenGL后端下窗口模糊背景半透明问题 1. 根因:InWindowBlur.qml 的 blitterEnabled 仅检查 isSoftwareRender 和 hasInWindowBlur,未检测 RHI 后端类型;SW 架构上非 OpenGLES2 后端静默跳过模糊渲染但 blitterEnabled 仍为 true 2. 方案:新增 isBlurBackendSupported() 检测 sceneGraphBackend 是否 为空或 opengl,在 blitterEnabled 中增加此条件 3. 影响:非 OpenGL 后端回退到不透明背景;OpenGL/默认后端不受影响 Log: 修复非OpenGL后端下窗口模糊背景半透明问题 Influence: 1. 测试 x86/ARM 架构(OpenGL)FloatingPanel 模糊效果——无回归 2. 测试 SW 架构 FloatingPanel 背景——应为不透明 3. 验证控制中心、文件管理器、相册弹窗背景显示正确 PMS: BUG-362545
bb28622 to
108ec07
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰。isBlurBackendSupported() 使用 C++11 magic statics 实现线程安全的延迟初始化,逻辑合理。QML 侧在 blitterEnabled 属性中追加条件判断,语法正确且与现有逻辑一致。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 代码结构清晰,注释完整。isBlurBackendSupported() 函数配有详细的多行注释,说明了设计意图、与 isSoftwareRender() 的区别以及不支持后端的行为表现。遵循了现有代码风格和模式。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,资源使用合理。static bool 配合 lambda 初始化确保 sceneGraphBackend() 仅调用一次,后续访问直接返回缓存值,无性能开销。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 存在0个安全漏洞,无安全风险。本次变更不涉及用户输入处理、网络通信或敏感数据操作,安全合规。 💡 改进建议代码示例// 本次变更代码质量优秀,无需修复示例。
// isBlurBackendSupported() 实现简洁高效:
//
// bool DQMLGlobalObject::isBlurBackendSupported()
// {
// static bool supported = []() {
// const QString backend = QQuickWindow::sceneGraphBackend();
// return backend.isEmpty() || backend == QLatin1String("opengl");
// }();
// return supported;
// }本报告由 AI 代码审查工具自动生成 |
Root Cause Analysis
The
InWindowBlur.qmlblitterEnabledcondition only checkedisSoftwareRenderandhasInWindowBlur, but did not detect the RHI backend type. On SW (Shenwei) architecture, non-OpenGLES2 RHI backends silently skip blur rendering inRhiNode::render()(dbackdropnode.cpp:746-747—reset(); return;), yetblitterEnabledstaystrueandblur.validremainstrue. This causesFloatingPanel.qml:53-55to use a semi-transparent background (alpha=0.6) with no actual blur, letting underlying content show through.Key evidence:
InWindowBlur.qml:16→dbackdropnode.cpp:746-747→FloatingPanel.qml:53-55— the code path is self-consistent and matches the screenshot showing semi-transparent background without blur.Fix
Added
isBlurBackendSupported()static function indqmlglobalobject.cppthat checksQQuickWindow::sceneGraphBackend()— returnstrueif the backend is empty (default OpenGL) or"opengl",falseotherwise. Added&& D.DTK.isBlurBackendSupportedto theblitterEnabledcondition inInWindowBlur.qml. When the RHI backend is not OpenGL,blitterEnabledbecomesfalse, triggeringFloatingPanelto fall back to an opaque background color (alpha=1.0).Change Safety Assessment
Code Safety
isSoftwareRender()andhasInWindowBlur()existing logic unchanged; new function is additive onlytrue, no behavior change; non-OpenGL backends:blitterEnabledcorrectly becomesfalseBusiness Impact Scope
All dtkdeclarative
FloatingPanelcomponents are affected. On SW architecture, dialog/panel backgrounds (album import dialog, control center panels, file manager dialogs) will switch from semi-transparent to opaque. On x86/ARM (OpenGL), no visual change.Verification Suggestion
Regression test on x86/ARM: verify FloatingPanel blur effect is unchanged. Fix verification on SW: verify panel backgrounds are opaque with no content bleed-through.
根因分析
InWindowBlur.qml的blitterEnabled条件仅检查isSoftwareRender和hasInWindowBlur,未检测 RHI 后端类型。在 SW(申威)架构上,非 OpenGLES2 的 RHI 后端在RhiNode::render()(dbackdropnode.cpp:746-747)中静默跳过模糊渲染(reset(); return;),但blitterEnabled仍为true,blur.valid也保持true,导致FloatingPanel.qml:53-55使用半透明背景(alpha=0.6)但无模糊效果,底层内容透出。关键证据:
InWindowBlur.qml:16→dbackdropnode.cpp:746-747→FloatingPanel.qml:53-55,代码路径自洽,与截图现象一致。修复方案
在
dqmlglobalobject.cpp中新增isBlurBackendSupported()静态函数,检测QQuickWindow::sceneGraphBackend()——后端为空(默认 OpenGL)或"opengl"时返回true,否则返回false。在InWindowBlur.qml的blitterEnabled条件中增加&& D.DTK.isBlurBackendSupported。当 RHI 后端非 OpenGL 时,blitterEnabled变为false,触发FloatingPanel回退到不透明背景色(alpha=1.0)。改动安全评估
代码安全评估
isSoftwareRender()和hasInWindowBlur()已有逻辑不变,新增函数为纯增量true,无行为变化;非 OpenGL 后端:blitterEnabled正确变为false业务影响范围
所有使用 dtkdeclarative
FloatingPanel的组件受影响。SW 架构上,弹窗/面板背景(相册导入弹窗、控制中心面板、文件管理器弹窗)将从半透明变为不透明。x86/ARM(OpenGL)架构无视觉变化。验证建议
x86/ARM 回归验证:确认 FloatingPanel 模糊效果不变。SW 架构修复验证:确认面板背景不透明,无底层内容透出。
Summary by Sourcery
Bug Fixes: