Repository navigation
Conversation
Metal 合成缓冲要求清屏色为预乘值。终端画布把编辑器底色以 alpha 0 交给 SwiftTerm,清屏后得到「有效 RGB + 零 alpha」,文字混合后画布 alpha 等于覆盖度,合成器再叠加一次底层颜色,亮色背景上字缘过曝成白框、正文发浅。 - 无壁纸:画布改为不透明编辑器底色,view 与 Metal renderer 的 `isOpaque` 同步为 true - 有壁纸:清屏色改为预乘合法的透明 `(0,0,0,0)`,保留壁纸透出 - OSC 11 应答与清屏色一致:无壁纸报告编辑器底色,有壁纸报告黑色 - 单测覆盖壁纸、无壁纸、状态切换与 OSC 11 契约
Lithe Review结论: 未发现需要阻塞合并的问题。 Findings
Scope Check
Suggestions
Summary改动集中在正确的平台适配层,新增测试覆盖主要配置分支。需要补齐配色主题刷新路径和矩阵记录;图层属性断言尚不能证明实际字缘合成效果。 Verification
|
Collaborator
|
这是啥改动?有点没看懂 |
Author
Collaborator
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




背景
亮色模式下终端文字发浅、字缘出现白色小框;暗色模式不易察觉。开启壁纸后同样复现。
根因:
LitheTerminalView把nativeBackgroundColor设为编辑器底色的 alpha 0,SwiftTerm 直接把它交给MTLClearColorMake。Metal 的合成缓冲要求预乘值,A=0 时 RGB 必须为 0;否则清屏写入的是「有效 RGB + 零 alpha」,文字混合后画布 alpha 等于文字覆盖度,窗口合成器再叠加一次底层颜色,亮色背景上边缘像素过曝。改动
isOpaque同步为 true,画布自己承担底色(0,0,0,0),壁纸正常透出,字缘不再泛白验证
TerminalCanvasCompositingTests+TerminalInputFocusTests:13 tests passedNSAppearance(无壁纸用例同时覆盖aqua/darkAqua),并断言layer.backgroundColor与isOpaque两处,避免 Core Graphics 回退路径回归rgb:ffff/ffff/ffffrgb:0000/0000/0000备注
有壁纸时报告黑色是本次修复的已知取舍:SwiftTerm 1.15 用同一个
nativeBackgroundColor既做 Metal 清屏色又做 OSC 11 应答值,且setBackgroundColor为public(非open),应用侧无法拆开两者。若后续在 SwiftTerm 上游把清屏色改为预乘(MTLClearColorMake(r*a, g*a, b*a, a)),Lithe 可以继续用「编辑器底色 + alpha 0」,同时满足透明清屏与正确的 OSC 11 应答。