Menu

QCanvasPainter vs QPainter - New hardware-accelerated custom drawing with Qt | Somco Software
📰

QCanvasPainter vs QPainter - New hardware-accelerated custom drawing with Qt | Somco Software

Planet Qt·5 days ago
#GFHngV3S
Reading 0:00
15s threshold

Qt recently introduced Qt Canvas Painter - a new module for hardware-accelerated 2D painting in Qt Quick. In short, it is a spiritual successor to QPainter, but built from the ground up to sit on top of QRhi (Qt Rendering Hardware Interface). That gives you the flexibility to choose your rendering backend - OpenGL, Metal, Vulkan, Direct3D - and more importantly, the entire rendering pipeline stays on the GPU. No CPU involvement in the loop.

To test it out I decided to port our Aero Pulse Monitor demo from QPainter to Qt Canvas Painter. I did it, and naturally the next question was: does it actually make a difference? How does the performance compare between the two approaches? That curiosity turned into a bit of a rabbit hole, and this post is the result.

What is Qt Canvas Painter - and how does it differ from QPainter?

QPainter has been the workhorse of Qt 2D rendering for a very long time. It works by rasterizing drawing commands - lines, shapes, gradients, text - into pixels.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.