rust-windowing / rust-windowing/softbuffer
Zero-copying on Android
Open
Nobody has claimed this yet.
DS - Android NDK
enhancement
- Dominant language
- Rust
- Stars
- 506
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
There's a few things that make zero-copying difficult on Android:
- Buffers are in
RGBXformat instead ofBGRX. Should be fixed by github.com/rust-windowing/softbuffer/pull/289. - Buffers have stride. Should be fixed by https://github.com/rust-windowing/softbuffer/pull/315.
- Buffers are exposed as
&mut [MaybeUninit<u8>], seeNativeWindowBufferLockGuard::bytes. Is this really necessary, or could we rely on the buffer being zero-initialized? If not, we'll have to do a zeroing step ourselves inbuffer_mut. - The surface is both unlocked and presented in
NativeWindowBufferLockGuard::drop, whereas Softbuffer allows these two steps to be separate (e.g. you canDropan in-progressBuffer<'_>and request a new one inSurface::buffer_mut, with no side-effects).
Maybe the SurfaceControl stuff @MarijnS95 is working on will allow fixing the last point?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with NativeWindowBufferLockGuard::bytes and drop, then trace Softbuffer's Surface::buffer_mut behavior for comparison. Determine whether Android buffers can avoid an explicit zeroing step and how unlock and present should be separated; done means both remaining unchecked Android zero-copy concerns are resolved consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, rust
- Domain
- mobile, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100