-
Notifications
You must be signed in to change notification settings - Fork 83
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
optionally use stb_image and nanosvg #242
Comments
I also tried my hand at using https://github.com/memononen/nanosvg instead of librsvg. |
No real reason for separating USE_CAIRO and USE_RSVG. I could imagine using it separately (no plans to do so though). |
Most of the overhead seems like it would be the processing of the image. If you did something like use the filename and store the processed image @ /tmp/jwm/filename/wXh with bgra data only in the file, that would cut a lot out. |
Commit 588b736 might help with the memory footprint. JWM doesn't store the image data for images loaded from files any more. Instead, it reloads the image from disk for each size that is needed. Of course, when the render extension is used, it doesn't even have to do that. |
I just dropped a pull request to nanosvg to support independent x and y scaling ( If anyone is still interested in this, please check out the pull request - I'd rather not have to maintain patches from upstream. |
I wrote a small patch to use https://github.com/nothings/stb/blob/master/stb_image.h
(for smaller static builds using musl-libc, but it does support some additional image types)
It supports the following image types:
With the following patches, You still need to manually add
#define USE_STB_IMAGE 1
to config.h (autotools are the bane of my existence)https://gist.github.com/technosaurus/76942ee935bdcc81d1fb
... I wasn't thinking about the case of adding more support when I wrote this; however if we just want the support for additional image formats, it should go after png and jpeg
Please don't feel any pressure to add this to mainline, I only wanted to make the patches available for embedded devs doing static builds.
The text was updated successfully, but these errors were encountered: