You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by wy...@apache.org on 2026/10/20 08:24:43 UTC
(maka) 05/24: test(gpui): observe referenced rounded-clip scenes
This is an automated email from the ASF dual-hosted git repository.
M4n5ter pushed a commit to branch feat/nsh-tui-shell
in repository https://gitbox.apache.org/repos/asf/maka.git
commit 1b447d3a82b76b240f14b7c54e7a3d62e33f4a44
Author: M4n5ter <m4...@gmail.com>
AuthorDate: Tue Oct 20 13:28:55 2026 +0800
test(gpui): observe referenced rounded-clip scenes
Follow the renderer clip-group graph in painted_quads instead of only reading the root scene. Preserve the original Kit table geometry assertions and cover nested nonzero coordinates plus unreferenced frames.
Generated-by: OpenAI Codex
---
third-party/gpui-fast/SOURCE.md | 2 ++
third-party/gpui-fast/SOURCE.zh-CN.md | 2 ++
.../gpui-fast/crates/gpui/src/fast/rounded_clip.rs | 34 ++++++++++++++++++++++
.../crates/gpui/src/fast/rounded_clip_scene.rs | 23 +++++++++++++++
third-party/gpui-fast/crates/gpui/src/window.rs | 3 +-
5 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/third-party/gpui-fast/SOURCE.md b/third-party/gpui-fast/SOURCE.md
index a66e38d107..1bb83e4035 100644
--- a/third-party/gpui-fast/SOURCE.md
+++ b/third-party/gpui-fast/SOURCE.md
@@ -104,3 +104,5 @@ Programmatic list offsets still bump their original dependency version, includin
The five adapted crates now track `b836dd970b26830f2124b7cf91b0e19018fd12da` (`v0.1.10`). Their manifests follow upstream `script/prepare-release.ts`; all nine Fast packages resolve to 0.1.10, support snapshots and the adapted scheduler remain at 0.3.9, and the published WGPU backend uses registry `wgpu =30.0.1` with upstream's release adaptations. This published WGPU version does not include upstream's unreleased Vulkan surface-drop fix. Kit remains at its existing revision, whose Fast [...]
Three-way integration preserves Maka's physical input provenance, exact published IME-handler slot, selection context, scheduler cancellation and native cleanup receipts. Upstream field identity and handler restoration notifications use those same existing owners. The native timer patch retains its explicit async-io dependency. The profiler counter uses stable `AtomicUsize::try_update` in place of its deprecated alias, with the same orderings and checked subtraction.
+
+The test-support `Window::painted_quads` observation follows the final scene's referenced rounded-clip groups, as the renderers do. It preserves each quad's coordinates and geometry, without treating retained paint operations or unreferenced layer frames as presented output. Kit's table corner assertions remain unchanged.
diff --git a/third-party/gpui-fast/SOURCE.zh-CN.md b/third-party/gpui-fast/SOURCE.zh-CN.md
index 3dcbf63c2c..1fe2e7e6de 100644
--- a/third-party/gpui-fast/SOURCE.zh-CN.md
+++ b/third-party/gpui-fast/SOURCE.zh-CN.md
@@ -79,3 +79,5 @@ Window 可根据原 ClickInputState interruption 创建不可 clone 的 InputGes
五个适配 crate 现固定到 `b836dd970b26830f2124b7cf91b0e19018fd12da`(`v0.1.10`)。清单采用上游 `script/prepare-release.ts` 的发布规范;九个 Fast 包统一解析为 0.1.10,支持快照及适配 scheduler 保持 0.3.9。发布的 WGPU 后端按上游受检适配使用 registry `wgpu =30.0.1`,其中不含上游尚未发布的 Vulkan surface-drop 修复。Kit 保持原固定版本,其 Fast 版本约束接受本次更新。新增 rounded-clip、composition 和 hot-reload 源码已纳入原始字节清单;无关示例及 iOS 实现不导入,由 registry 依赖提供。
三方整合保留 Maka 原物理输入来源、实际发布的 IME-handler 槽位、选区上下文、定时器取消及原生清理回执。上游字段身份和 handler 恢复通知接入同一既有 owner。原生定时器补丁保留显式 async-io 依赖;profiler 计数器改用稳定的 `AtomicUsize::try_update` 替代弃用别名,保持原内存顺序和 checked subtraction。
+
+测试接口 `Window::painted_quads` 按渲染器实际引用路径读取最终 scene 的 rounded-clip 子组,保留 quad 原坐标与几何;保留的绘制操作和未引用的图层 frame 不作为已呈现输出。Kit 原表格四角断言不变。
diff --git a/third-party/gpui-fast/crates/gpui/src/fast/rounded_clip.rs b/third-party/gpui-fast/crates/gpui/src/fast/rounded_clip.rs
index f8df69fa20..74233ec8ca 100644
--- a/third-party/gpui-fast/crates/gpui/src/fast/rounded_clip.rs
+++ b/third-party/gpui-fast/crates/gpui/src/fast/rounded_clip.rs
@@ -274,6 +274,40 @@ mod tests {
}
}
+ #[test]
+ fn painted_quads_follow_only_referenced_nested_clip_groups() {
+ let mut scene = Scene::default();
+ let mut outer = shape();
+ outer.bounds.origin = at(10., 20.);
+ let mut inner = outer;
+ inner.bounds.origin = at(17., 27.);
+ inner.bounds.size = size(ScaledPixels(48.), ScaledPixels(48.));
+ let bounds = Bounds::new(at(23., 31.), size(ScaledPixels(12.), ScaledPixels(15.)));
+ let target = Quad {
+ bounds,
+ content_mask: crate::ContentMask { bounds },
+ corner_radii: Corners::all(ScaledPixels(3.)),
+ ..Default::default()
+ };
+ record(&mut scene, ClipOperation::Begin(outer));
+ record(&mut scene, ClipOperation::Begin(inner));
+ scene.insert_primitive(target);
+ record(&mut scene, ClipOperation::End);
+ record(&mut scene, ClipOperation::End);
+ scene.finish();
+
+ let quads = crate::fast::rounded_clip_scene::painted_quads(&scene);
+ assert_eq!(quads.len(), 1);
+ assert_eq!(quads[0].bounds, bounds);
+ assert_eq!(quads[0].content_mask, target.content_mask);
+ assert_eq!(quads[0].corner_radii, Corners::all(ScaledPixels(3.)));
+
+ scene.polychrome_sprites.clear();
+ assert!(!scene.layers.frames.is_empty());
+ assert!(!scene.paint_operations.is_empty());
+ assert!(crate::fast::rounded_clip_scene::painted_quads(&scene).is_empty());
+ }
+
#[test]
fn rounded_clip_preserves_original_geometry_under_rectangular_cropping() {
let mut shape = shape();
diff --git a/third-party/gpui-fast/crates/gpui/src/fast/rounded_clip_scene.rs b/third-party/gpui-fast/crates/gpui/src/fast/rounded_clip_scene.rs
index c78beec0d4..06af930572 100644
--- a/third-party/gpui-fast/crates/gpui/src/fast/rounded_clip_scene.rs
+++ b/third-party/gpui-fast/crates/gpui/src/fast/rounded_clip_scene.rs
@@ -19,6 +19,29 @@ use crate::{
const CLIP_TEXTURE_BASE: u32 = 0xF100_0000;
const GEOMETRY_KEY: LayerKey = LayerKey(u32::MAX);
+/// Observe the final drawable graph using the renderers' clip-group references.
+#[cfg(any(test, feature = "test-support"))]
+pub(crate) fn painted_quads(scene: &Scene) -> Vec<crate::Quad> {
+ let mut quads = scene.quads.clone();
+ for sprite in &scene.polychrome_sprites {
+ let index = sprite.tile.texture_id.index;
+ if index < CLIP_TEXTURE_BASE {
+ continue;
+ }
+ let key = LayerKey(index - CLIP_TEXTURE_BASE + 0x0100_0000);
+ if let Some(child) = scene
+ .layers
+ .frames
+ .iter()
+ .find(|frame| frame.key == key && frame.tile_size == 0)
+ .and_then(|frame| frame.content.scene())
+ {
+ quads.extend(painted_quads(child));
+ }
+ }
+ quads
+}
+
/// Materialize private paint scopes as existing, renderer-readable layer
/// objects. Preserve the original operation stream for retained paint ranges.
pub(crate) fn compile(scene: &mut Scene) {
diff --git a/third-party/gpui-fast/crates/gpui/src/window.rs b/third-party/gpui-fast/crates/gpui/src/window.rs
index 83c54b82e4..9ff25a5c76 100644
--- a/third-party/gpui-fast/crates/gpui/src/window.rs
+++ b/third-party/gpui-fast/crates/gpui/src/window.rs
@@ -3188,9 +3188,10 @@ impl Window {
/// painted output without rasterizing the frame. Quad bounds are in scaled pixels and are
/// not clipped; each quad carries the content mask it will be clipped to when drawn. Quads
/// whose bounds don't intersect their content mask are culled at paint time and won't appear.
+ /// Includes quads in rounded-clip groups referenced by the final scene's sprites.
#[cfg(any(test, feature = "test-support"))]
pub fn painted_quads(&self) -> Vec<Quad> {
- self.rendered_frame.scene.quads.clone()
+ crate::fast::rounded_clip_scene::painted_quads(&self.rendered_frame.scene)
}
/// Returns the underlines in the most recently rendered frame's scene.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org