Downstream / opt-in

Extensions to GPUI

Independent paint, presentation, text and SVG extensions.

Downstream extensions to GPUI. Paints, window color presentation, text backends and SVG rendering are independent opt-in capabilities.

Browser extension demos → · Demo source

LIVE BROWSER DEMOSBrowse all demos →

Color tasks

Color and wide-gamut workflows →

Start here: wide gamut versus Display P3; choose a practical task.

Display supplied pixels correctly →

Supply pixels, transfer, alpha and storage explicitly.

Use a supplied RGB ICC profile →

Use a supplied RGB matrix/TRC profile within the supported subset.

Explore and verify color behavior →

Browser previews, native presentation and what the measurements prove.

1. Paints and shaders

use xgpui_shader::{painted, SolidColor};
use std::sync::Arc;

painted().bg_paint(Arc::new(SolidColor::new([1.0, 0.2, 0.0, 1.0])?));

xgpui-shader: gradients, meshes and portable WGSL. Metal, wgpu and native D3D11 adapters; ordinary programs use sRGB. Explicit linear-P3 programs require a native wide-gamut window.

Shader paints and instanced shaders →

Choose shader paints or instanced shaders; migrate existing names.

Paint and shader extension →

Start here: dependencies, containers, borders, paths and interaction.

Selectable typography →

Gradient fills, glyph glow/shadows, typewriter, wave and scramble with stable selection and native accessibility.

Main-pass brushes →

Universal brushes, glyphs, paths, mesh gradients and cached layer effects.

Shader producer reference →

Mesh sources, parameters, limits and caches.

Paint preparation and failure contracts →

Preparation, recording and failure behavior.

Shader paints (experimental) →

Rust parameters + portable WGSL source.

Instanced shaders (experimental) →

Typed main-pass instances, ordered batching, native app and WASM companion.

Portable wgpu paints →

wgpu support and validation.

Native D3D11 paints →

Native D3D11 adapter and Windows acceptance.

just --justfile apps/xgpui-ext-lab/paint-lab/justfile radial
just --justfile apps/xgpui-ext-lab/paint-lab/justfile --list

Instanced shaders · native app first

Typed fragment instances, ordered batching, configurable gradient shadows, soft animated borders and direct main-pass rendering. Experimental SDR subset; Windows runtime acceptance remains outstanding.

just --justfile apps/xgpui-ext-lab/shader-examples/justfile ui
just --justfile apps/xgpui-ext-lab/shader-examples/justfile composition

API, examples and implementation status → · WASM companion → · Demo source

2. Wide-gamut presentation

use gpui::WindowColorMode;

// During window construction or an update outside drawing:
window.set_color_mode(WindowColorMode::WideGamutSdr)?;
let status = window.color_status();

// Explicit producer output; legacy paints and controls remain sRGB:
MetalWideSdrOutput::from_linear_p3_premultiplied(context, texture, commands)?;

xgpui-gamut produces bounded linear-P3 SDR surfaces. GPUI backends own window negotiation and composition; Metal and native D3D11 presentation are implemented. Windows native execution/display validation remains outstanding; Linux is deferred.

xgpui-gamut →

Start here: window setup, complete Metal producer, color contract, composition and validation.

just --justfile apps/xgpui-ext-lab/gamut-lab/justfile ui
just --justfile apps/xgpui-ext-lab/gamut-lab/justfile test

Color comparison · browser and native desktop

Open Chromaticity & gamut ↗Demo source

Open Pixels + metadata ↗Demo source

Open Color & gamut ↗Demo source

Start with a color task → · What each lab proves →

The browser compares interpolation and gamut mapping as an sRGB preview. Its runtime panel reports source space, mapping, actual canvas color space (or unknown) and browser-reported wide-gamut capability (at least P3).

cargo run --locked --config .cargo/validation.toml --manifest-path apps/xgpui-ext-lab/Cargo.toml --bin color-lab

The native companion pairs mapped sRGB and Display P3 swatches using the same 32 reference samples per row. Check effective WideGamutSdr and display support, then compare on your wide-gamut monitor. Display capability does not verify calibration.

3. Parley text

Shared text backend with flat-LTR compatibility, BiDi paragraph layout and editing/IME geometry. Precise font axes and feature inspection use existing GPUI caches and the glyph atlas. Font-controls labs/tests are verified on macOS and Windows; Linux acceptance remains separate.

xgpui-parley →

Construction, paragraphs, precise axes, preview policy, cache and face identity, supported subset and validation.

Variable fonts and OpenType inspection →

Weight, width, slant and optical size; inspection, native/Parley lab, backend support and core 3.0 migration.

4. Progressive SVG

Experimental full-color static SVG elements with preview/detail refinement, shared FIFO admission and aggregate image accounting. Native lab and attributed offline samples; smaller budgets reduce deep-zoom detail.

xgpui-svg — experimental →

Use SvgImage and SvgScheduler, understand accounting limits, and run the native sample.

5. Standalone color math

xgpui-color provides color conversions, gamut mapping, OkLab/OkLCh interpolation and reusable WGSL helpers with zero runtime dependencies in its default configuration. Optional ICC parsing adds a parser dependency. Use it without GPUI or a GPU context.

xgpui-color: standalone color math →

CPU types, browser runtime diagnostics, native P3 comparison, dependency boundaries and validation.

6. Dedicated media images

Display large images at several sizes, adjust their colors, or show frames from a native producer. Start with small examples and the browser demos.

xgpui-media →

Examples, loading limits, platform support and test results.

7. Spatial canvas

Spatial canvas →

Native lab, camera and scene API, controls and known limits. Explore the card canvas and CPU Mandelbrot browser companions.

8. Desktop shell

Desktop shell →

Alpha window frames, app-composed title bars, desktop preferences and the native shell lab.

9. GPU interop

GPU interop →

Show frames from your own GPU engine in xgpui windows, with no copies: wide colour, heavy-engine pacing and the GPU Canvas Workbench example.

Shared GPUI integration

GPUI public API changes →

Public additions and altered upstream types, separated by capability.