Files

2.5 KiB

Chapter 44

T50b Rendering · Surface — src/rendering

gpui at 1a28cff paints pixels three ways: RenderImage through paint_image on every platform and the web; CVPixelBuffer through paint_surface, NV12 on macOS alone, dropped by the wgpu and DirectX renderers; a native view over the window. It shares no device and runs no outside shader.

  • RenderSurface — the host draws a frame at the box's size in device pixels; a new size or revision draws again; the old frame leaves the atlas
  • FramebufferView / OffscreenRenderSurface / CustomRendererSurface / TextureView → rendering::RenderSurface
  • ShaderView / GpuSurface / WebGPUSurface / Compute Visualization / GPU Particle View — host: the host renders on its own device and reads back into rendering::RenderSurface
  • CameraTexture / GStreamerTexture / ExternalTexture — host: the host's frames reach rendering::RenderSurface
  • ZeroCopyTexture / SharedTextureView — blocked: only macOS's Metal renderer draws paint_surface, NV12 alone
  • MetalSurface / OpenGLSurface / VulkanSurface / D3D11/D3D12Surface — blocked: gpui shares no device; a host renders offscreen and feeds rendering::RenderSurface
  • 3D Scene / 3D Viewport → media::ModelViewer

T50g Acceptance

Asked Done Proof
Can a canvas or render surface be real on GPUI? Yes, through RenderImage; nothing shares GPUI's device gpui at 1a28cff: paint_image, paint_surface (NV12, Metal alone), no device hook; T50a review
List what can be added Every draft entry judged above: build, alias, host or blocked this file; PRD chapter 44
Scope the owner chose RenderSurface alone, chapter 44 owner's answer, 2026-10-04
Linux, macOS, Windows, arm64 and x86_64 Lib tests pass on all six; the gallery builds on five and passes clippy on macOS arm64 CI run 37177191793 on b85955a
Gallery example Rendering page, its story in stories.json ran on Linux: 720x360 in 22 ms, debug
WebAssembly on the website The story runs live from the wasm gallery headless shots light and dark; e2e/live.spec.ts fails when the surface never redraws
Docs Rendering guide, docs_render compiled by check.sh e2e/docs.spec.ts 24 passed
Reviews Each item in a herdr pane, codex gpt-6.1-sol at max tasks/reviews.md
Files at or under 500 lines Largest new file 138 lines check.sh
Not done Site not deployed; section notes clip at the frame's right edge on every story owner's call; seen on MapView too