Open Randalphwa opened 6 months ago
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.
Would you please send it to me?
Attached is the C++ version of plutovg
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.