Visual Studio Code, rebuilt in Rust
Rust
Merge gpui-fast B3: platform glue
rokartur7303f2ede113
diff --cc port/notes.mdindex 6cf31705869,a3e77657845..8dcb6fa4e6a--- a/port/notes.md+++ b/port/notes.md@@@ -1109,10 -1109,11 +1109,12 @@@ Work the port does at another time tha- Risks: one company's experimental fork; Retained Mode shows a stale view wherever the port changes state without `cx.notify()` (Wu repainted everything each frame, so a missing notify went unseen); gpui-fast's `view.rs` drops upstream's cache-by-bounds for `fast::retained` (its docs/upstream-sync.md), and `workbench/part_view.rs` (`AnyView::cached`) is the port's one cached view; the Chromium-fidelity patches below land in files gpui-fast rewrote (`taffy.rs` is a dead file behind `#[path = "fast/taffy.rs"]`, text and list layout go through `fast/`), so they are re-ports, not cherry-picks; the README's benchmark baseline changes with the GPUI. Retained Mode off for a comparison: `GPUI_VIEW_RETENTION=0`, or `Window::set_view_retention(false)` in tests.- Sync: read gpui-fast's `UPSTREAM` and `script/check-upstream`, bump the rev in `native/Cargo.toml` and the vendored copy in one commit, reapply the port's vendor commits, rerun the M26 gate. Rollback: `main` is on Wu; dropping the branch undoes everything.- Forced API changes (the build had 11 errors in `app` and 18 more in its tests, 0 on Wu; now 0 and 0):- - Ported on `gpui-fast-b1-fidelity`, so the `shortcut:` fallbacks are gone: `Window::paint_backdrop_blur` (`quick_input_view.rs` `frosted_glass`, `corner_lab.rs`), `Window::layout_subpixel_x` and `TextStyle::strut_size` (189efc4c454; `file_icons.rs`, `icon_label.rs`), `ListState::with_whole_pixel_item_heights` (40f47558cba; `settings_editor_view.rs`). Still missing: `Menu::window_menu` (gpui-fast's gpui_macos makes the menu titled "Window" the windows menu; a translated title loses it), a gpui_macos change outside the fidelity work.- - Missing from gpui-fast, so the call sites fall back to plain paint, each with a `shortcut:` comment, until the patch is ported: `Window::paint_backdrop_blur` (Wu's own; `quick_input_view.rs` `frosted_glass` paints the tint without blur, `corner_lab.rs` too), `Window::layout_subpixel_x` and `TextStyleRefinement::strut_size` (189efc4c454; the `file_icons.rs` glyph at x 0, `icon_label.rs` without the 13px strut), `ListState::with_whole_pixel_item_heights` (40f47558cba; `settings_editor_view.rs`).++ - Ported on `gpui-fast-b1-fidelity`, so the `shortcut:` fallbacks are gone: `Window::paint_backdrop_blur` (`quick_input_view.rs` `frosted_glass`, `corner_lab.rs`), `Window::layout_subpixel_x` and `TextStyle::strut_size` (189efc4c454; `file_icons.rs`, `icon_label.rs`), `ListState::with_whole_pixel_item_heights` (40f47558cba; `settings_editor_view.rs`).+ - `Menu::window_menu` (Wu's own) is gone: gpui-fast's gpui_macos makes only the menu titled "Window" the windows menu (zed's rule). `menubar.rs` `fix_up_app_kit_menus` sets the translated one with `setWindowsMenu` and lists the open windows with `addWindowsItem` (set after the menu is in the menu bar, AppKit lists only windows ordered in later), as tauri-apps/muda `set_as_windows_menu_for_nsapp` does (MIT/Apache-2.0); vendoring gpui_macos for a flag was the other choice. Checked with the German language pack (`--locale de`): "Fenster" holds AppKit's Minimize, Zoom and tiling items and the window, as "Window" does in English; without the change it held only the port's three items.+ - Open, for the merge with M23: on Linux gpui-fast's `Keystroke::unparse(OperatingSystem::Linux)` writes the platform key as `super-q` where Wu wrote `cmd-q`, so `menubar::tests::native_menus_show_keybindings_as_key_equivalents_or_in_the_label` fails on Linux only; the test is unchanged.- - `chromium_baseline` (189efc4c454) is pure math: now a local function in `file_icons.rs`.- - `Window::paint_drop_shadows` lost Wu's `opaque_background` argument; the terminal passed `false`, which is what gpui-fast always does.+ - `chromium_baseline` (189efc4c454) is `gpui::chromium_baseline` again, used by `text_system/line.rs` and `file_icons.rs`.+- Backdrop blur on gpui-fast: a polychrome sprite with texture index `u32::MAX` (`fast/backdrop.rs`, above the layer tile, rounded clip and dynamic texture ranges), blur radius and tint in the tile's fields, so the scene orders, replays and clips it like any sprite without a new primitive kind; `gpui_apple/src/fast/backdrop.rs` draws it with Wu's renderer (cc9caa16123, 471caaf3f25: mirrored crop, Skia's progressive downscale to sigma 4, `MPSImageGaussianBlur`). Reading the drawable ends the render pass, so a frame with a blur skips the opaque pre-pass and clears `framebufferOnly`. On other platforms and inside `paint_layer` (tiles do not hold what is under them) the tint paints as a quad. Compared: Wu's own patch (ours, fits the corner lab's 9 and 1 limits, chosen); lattice-writer/lattice `gpui/patches/gpui-fast-backdrop-blur.diff` (Apache-2.0, same sprite trick and `MPSImageGaussianBlur` on a newer gpui-fast with element scale, but clamped at the region's edge, not mirrored, and without the downscale, so it misses the lab's limits; does not apply here; its layer and non-Metal fallback was taken); zed and gpui-component have only the window-level `WindowBackgroundAppearance::Blurred`.+ - `Window::paint_drop_shadows` lost Wu's `opaque_background` argument; the terminal passed `false`, which is what gpui-fast always does. Open gap, the shadow half of 471caaf3f25: gpui-fast does not clip an outer shadow out of the border box at all, so the port needs `element_bounds` and `element_corner_radii` in `Shadow` (scene.rs), read by gpui_apple's and gpui_windows' shadow shaders.- `Keystroke::parse` and `KeyBinding::new` take `&'static str`, `Keystroke::unparse` an `OperatingSystem`: runtime strings go through `crate::parse_keystroke` (`parse_with_os` with `crate::host_os()`, Wu's `secondary-` rule) and the menu bar's key equivalents through `KeyBinding::load` with the `App`, so `native_menus` takes `cx`.- `ScrollEvent` has a `source` (the scroll frame-time test sends `ScrollSource::Pointer`); `ScrollWheelEvent` and `on_scroll_wheel` are deprecated aliases, left as they are (warnings only).- `Glyph` lost its `IntoElement` impl: gpui-fast implements it for every `Element`.