Back to Blog home

Unleashing the power of QPainterPath::addEllipse()

Published on Wednesday October 13, 2010 by Andreas Kling in Performance performance WebKit webkit | Comments

Up until recently, WebKit used to draw SVG circles and ellipses by breaking them down into 100-segment paths. This was done to get consistent auto-test results across different platforms and rendering libraries. Unfortunately, it wasn't very fast. With Qt 4.7's WebKit, my machine reaches a meager 17 FPS on the SVG version of The Man in Blue's benchmark which is pretty sad.

I spent some time digging into this issue and have finally landed a change upstream that makes WebKit take proper advantage of the underlying libraries - in our case by using QPainterPath::addEllipse() to compose the shapes instead of QPainterPath::lineTo(). This bumps our FPS on the aforementioned test to 51, three times faster!


New Ellipse vs. Old Ellipse. Dots mark the relevant path points.



For the specifically curious, here's the webkit.org commit: r69517

Subscribe to Our Blog

Stay up to date with the latest marketing, sales and service tips and news.

The blog comment system has been migrated to a new platform. If you face any issues, please let us know via feedback@qt.io.