-
Notifications
You must be signed in to change notification settings - Fork 25
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
High CPU load with "fillText" #21
Comments
Hi @jvondrus, thank you for reporting this. The problem is this: node-openvg-canvas does not use OpenVG APIs for text rendering (at the time I couldn't figure out how to load the fonts properly into it.) (Without pursuing much more investigation...) What's happening is that for each string you are displaying a new path is being constructed by concatenating paths of all the characters. This is 50/50 CPU/GPU work, but the CPU part itself is so slow/heavy that it undermines all the rest. While I don't find out how to use the text APIs, here are somethings you can do to mitigate this:
|
Hello.
2,3) I'm using 9 text fields, 5 of these are changing maybe one per day. If there is any way, how to cache it, it would be nice. Other 4 fields are fields with increasing numbers with user interacting. |
So, go for 2: For each string create a Path and add the text to it (look at the examples for this). Rendering the paths later on is really fast, so I think you'll be good. |
Thank you very much, I will look to examples how to "Patch it" :) |
Please, can you help me add text to Path and next draw it? :D Font: 'normal 10px Impact, serif' Thank you very much. |
Hello to all,
I'm working on my touch screen project on Raspberry Pi with framebuffer at console. It works very well but it has high CPU load.
All my graphic (some PNG import, come Rect and some Circle) take around 20% od CPU, but CPU load come to 80% when I add just 1 line of text with Openvg-canvas. And to full load with more than 5 text field.
Here is part of my code with text print:
What is wrong with text rendering than CPU load going so high?
The text was updated successfully, but these errors were encountered: