How rust-windowing/softbuffer works
Softbuffer is a cross-platform CPU image presentation library: an application supplies a window/display handle, obtains a writable surface buffer, draws pixels, and presents it. The public API dispatches through a backend interface to platform-specific presentation implementations; the README describes compositor handoff and double buffering. Platform source is only sampled for some backends, so platform-specific internals and compositor links are limited to documented or excerpted relationships.
Main entry points: mod.rs Platform Registry · util.rs Buffer Utilities · lib.rs Context and Surface · backend_dispatch.rs Backend Dispatch
Components 21
Public API
- Context and Surface
src/lib.rs - Pixel Buffer
src/lib.rs
Dispatch and Core
- Backend Dispatch
src/backend_dispatch.rs - Backend Interface
src/backend_interface.rs - Platform Registry
src/backends/mod.rs
Platform Backends
- Android Backend
src/backends/android.rs - CoreGraphics Backend
src/backends/cg.rs - DRM/KMS Backend
src/backends/kms.rs - Orbital Backend
src/backends/orbital.rs - Wayland Backend
src/backends/wayland/mod.rs - Wayland Shared Buffer
src/backends/wayland/buffer.rs - Web Backend
src/backends/web.rs - Win32 Backend
src/backends/win32.rs - X11 Backend
src/backends/x11.rs
Shared Support
- Pixel Type
src/pixel.rs - Pixel Format
src/format.rs - Error Types
src/error.rs - Buffer Utilities
src/util.rs
Other components
- Application
- Window Provider
- Window Compositor
Connections 26
- Application → Context and Surface: creates surface
README.md - Window Provider → Context and Surface: provides handles
README.md - Application → Pixel Buffer: draws pixels
README.md - Context and Surface → Backend Dispatch: delegates backend
src/lib.rs - Context and Surface → Pixel Buffer: yields buffer
README.md - Pixel Buffer → Backend Dispatch: presents through
src/lib.rs - Backend Dispatch → Backend Interface: implements traits
src/backend_dispatch.rs - Backend Dispatch → Platform Registry: selects backend
src/backend_dispatch.rs - Platform Registry → Android Backend: registers
src/backends/mod.rs - Platform Registry → CoreGraphics Backend: registers
src/backends/mod.rs - Platform Registry → DRM/KMS Backend: registers
src/backends/mod.rs - Platform Registry → Orbital Backend: registers
src/backends/mod.rs - Platform Registry → Wayland Backend: registers
src/backends/mod.rs - Platform Registry → Web Backend: registers
src/backends/mod.rs - Platform Registry → Win32 Backend: registers
src/backends/mod.rs - Platform Registry → X11 Backend: registers
src/backends/mod.rs - Wayland Backend → Wayland Shared Buffer: allocates buffers
src/backends/wayland/mod.rs - Wayland Backend → Window Compositor: commits surface
README.md - Android Backend → Buffer Utilities: uses helpers
src/backends/android.rs - CoreGraphics Backend → Buffer Utilities: uses helpers
src/backends/cg.rs - DRM/KMS Backend → Buffer Utilities: uses helpers
src/backends/kms.rs - Orbital Backend → Buffer Utilities: uses helpers
src/backends/orbital.rs - Web Backend → Buffer Utilities: uses helpers
src/backends/web.rs - Win32 Backend → Buffer Utilities: uses helpers
src/backends/win32.rs - X11 Backend → Buffer Utilities: uses helpers
src/backends/x11.rs - Pixel Buffer → Pixel Type: exposes pixels
src/lib.rs