Skip to content

Support PixmapMut<'_> and stride in vello_cpu? #1382

@madsmtm

Description

@madsmtm

Hey! I'm working on improving Softbuffer, which you use in vello_cpu's examples to render to a window. I believe that this combination of winit, softbuffer and either tiny-skia or vello_cpu is a good match for simple demos and such, and I'll be recommending using your crates in our documentation in rust-windowing/softbuffer#325.

Softbuffer works by creating special shared memory that can be efficiently sent to the compositor, so for it to be zero-copy, it has to be in control of the buffer (it cannot just create its buffers from a Vec<u8>). Additionally, for it to be zero-copy on Android and macOS, the buffer needs to have a stride, see rust-windowing/softbuffer#315. Both of these are a bit unfortunate, because it means that integration with vello_cpu requires rendering into a separate buffer first.

Would it be possible (and desirable) for vello_cpu to support something like tiny-skia's PixmapMut<'_>, and to support passing a byte stride != width * 4 in its creation method?

This is the complementary issue to linebender/tiny-skia#168, see that for a code example of how I imagine an integration would look like in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cpuApplies to the vello_cpu crateenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions