-
Notifications
You must be signed in to change notification settings - Fork 69
Improve the README #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the README #325
Conversation
| ## 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). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a fairly good description to me.
662e552 to
819d5f4
Compare
91395ac to
57835ec
Compare
notgull
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one has been a long time coming.
It's more relevant to list actual features etc. at the top, than to list alternatives.
Provide motivation and recommend `tiny-skia` and `vello_cpu` for drawing primitives.
57835ec to
0798573
Compare
|
Thanks for the reviews! |
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).