mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
## Screenshot testing Adds visual testing infrastructure for GPUI that captures screenshots by rendering directly to Metal textures. The The screenshots end up in `target/visual_tests/` and look like this: <img width="2560" height="1600" alt="workspace_with_editor2" src="https://github.com/user-attachments/assets/54112343-4af1-4347-9bab-f099de97dd29" /> <img width="2560" height="1600" alt="project_panel2" src="https://github.com/user-attachments/assets/0cd54b61-dace-4398-a28e-0b4d7c2968f6" /> ### Key Features - **Direct texture capture**: Screenshots are captured by rendering the scene to a Metal texture and reading pixels directly from GPU memory, rather than using ScreenCaptureKit - **No visibility requirements**: Windows don't need to be visible on screen since we read directly from the render pipeline - **Deterministic output**: Captures exactly what GPUI renders, not what the OS compositor displays - **No permissions needed**: Doesn't require Screen Recording permission like ScreenCaptureKit would ### Running the Visual Tests ```bash # Run visual tests (compares against baselines) cargo run -p zed --bin visual_test_runner --features visual-tests # Update baseline images (when UI intentionally changes) UPDATE_BASELINE=1 cargo run -p zed --bin visual_test_runner --features visual-tests # View the captured screenshots open target/visual_tests/ ``` ### Implementation - `Window::render_to_image()` - Renders the current scene to a texture and returns an `RgbaImage` - `MetalRenderer::render_to_image()` - Core implementation that renders to a non-framebuffer-only texture - `VisualTestAppContext` - Test context that uses real macOS platform rendering - `VisualTestAppContext::capture_screenshot()` - Synchronous screenshot capture using direct texture rendering ### Usage ```rust let mut cx = VisualTestAppContext::new(); let window = cx.open_window(...)?; let screenshot: RgbaImage = cx.capture_screenshot(window.into())?; ``` Release Notes: - N/A --------- Co-authored-by: Amp <amp@ampcode.com> |
||
|---|---|---|
| .cargo | ||
| .cloudflare | ||
| .config | ||
| .factory/prompts/docs-automation | ||
| .github | ||
| .zed | ||
| assets | ||
| ci | ||
| crates | ||
| docs | ||
| extensions | ||
| legal | ||
| nix | ||
| script | ||
| tooling | ||
| .clinerules | ||
| .cursorrules | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| .prettierrc | ||
| .rules | ||
| .windsurfrules | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| clippy.toml | ||
| CODE_OF_CONDUCT.md | ||
| compose.yml | ||
| CONTRIBUTING.md | ||
| debug.plist | ||
| default.nix | ||
| docker-compose.sql | ||
| Dockerfile-collab | ||
| Dockerfile-collab.dockerignore | ||
| Dockerfile-cross.dockerignore | ||
| Dockerfile-distros | ||
| Dockerfile-distros.dockerignore | ||
| flake.lock | ||
| flake.nix | ||
| GEMINI.md | ||
| LICENSE-AGPL | ||
| LICENSE-APACHE | ||
| LICENSE-GPL | ||
| livekit.yaml | ||
| lychee.toml | ||
| Procfile | ||
| Procfile.web | ||
| README.md | ||
| renovate.json | ||
| REVIEWERS.conl | ||
| rust-toolchain.toml | ||
| shell.nix | ||
| typos.toml | ||
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking issue)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.