Skip to content

Conversation

@madsmtm
Copy link
Member

@madsmtm madsmtm commented Jan 27, 2026

Move the list of alternatives and license lower, and instead write some high-level information on how to use Softbuffer and how it works (or at least how it should work once we're zero-copy on all platforms).

It's more relevant to list actual features etc. at the top, than to list
alternatives.
@madsmtm madsmtm added the documentation Improvements or additions to documentation label Jan 27, 2026
Comment on lines 11 to 38
## How it works

## License & Credits
Most platforms have a compositor of some sort (WindowServer on macOS, Desktop Window Manager on
Windows, the Wayland compositor, etc). This is a separate process that applications communicate
with over IPC, and it is responsible for taking the various surfaces that applications send to it
and mash ("composite") them together in the right way to render the user's desktop on the
connected monitors.

This library is dual-licensed under MIT or Apache-2.0, just like minifb and rust. Significant portions of code were taken
from the minifb library to do platform-specific work.
The role of Softbuffer then is to create a shared memory region (i.e. [`Buffer`]) that can be
written to from the CPU, and then handed to the compositor (in [`Buffer::present`]). Softbuffer
keeps a set of buffers around per surface to implement double-buffering (depending on platform
requirements).

Softbuffer strives to present buffers in a zero-copy manner. One interesting wrinkle here is that
the compositor is often GPU-accelerated, so on platforms without a unified memory architecture,
some copying is inherently necessary (though when possible, it is done in hardware using DMA).
Copy link
Member Author

@madsmtm madsmtm Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly confident in most this section, or at least confident that this is a good mental model for how Softbuffer should work internally, but would ideally like some more eyes on it.

Provide motivation and recommend `tiny-skia` and `vello_cpu` for drawing
primitives.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Development

Successfully merging this pull request may close these issues.

2 participants