Middleware Pattern
notgull opened this issue · comments
I'm designing an API that uses tiny-skia
as a public dependency. So far I've designed it to just take a PixmapMut<'_>
to render into and a specialized cache object that contains some allocations to re-use.
Other graphics APIs, like wgpu
, have an established middleware pattern that helps API users make their APIs composable with other graphics modules. Does tiny-skia
have a model like this to ensure maximum compatibility with other packages?
If it's not just "pass along the pixmap" it should be written down somewhere.
If it's not just "pass along the pixmap" it should be written down somewhere.
It is just "pass along the pixmap". The whole point of tiny-skia is to remove as much abstractions as possible. You have a pixmap and you can draw directly onto it. That's it. It's intentionally low-level.
I would describe tiny-skia as a foundation for a 2D library and not the one.
That makes sense, thanks!