Skip to content
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

Optional C++ version of plutovg #154

Open
Randalphwa opened this issue Jan 26, 2024 · 1 comment
Open

Optional C++ version of plutovg #154

Randalphwa opened this issue Jan 26, 2024 · 1 comment

Comments

@Randalphwa
Copy link

I wanted to check to see if this would be of interest. In a private build, I copied all the C code in plutovg to a different directory and converted it to C++ code. I changed all but one case of malloc/free to std::vector<> or new/delete, though I left the realloc calls untouched. The rest were minor changes -- changing NULL to nullptr, removing the volatile keyword to potentially improve compiler optimization, removed some (now) unused macros, etc.

The reason I did this was to avoid the current mechanism of building two libraries, as well as making it easier to build the sources directly into an external app or library. I was not able to detect any differences in either performance or accuracy in the suite of tests I normally run.

My thinking is not to necessarily replace the current C code and plutovg.lib build, but just to add an additional directory with the C++ sources. That way you aren't breaking anyone expecting the plutovg.lib build, but you are providing an alternative for those who want to use the C++ sources directly.

Let me know if you want this, and I'll submit a PR.

@sammycage
Copy link
Owner

Let me know if you want this, and I'll submit a PR.

Please go ahead and submit a pull request with the modified C++ code. This will allow us to thoroughly review the changes and discuss them within the context of the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants