https://blogs.igalia.com/carlosgc/2024/02/19/webkit-switching-to-skia-for-2d-graphics-rendering/ Carlos Garcia Campos Search for: [ ] [Search] Main menu Skip to content * Home * About WebKitGTK and WPEWebKit Switching to Skia for 2D Graphics Rendering February 19, 2024 In recent years we have had an ongoing effort to improve graphics performance of the WebKit GTK and WPE ports. As a result of this we shipped features like threaded rendering, the DMA-BUF renderer, or proper vertical retrace synchronization (VSync). While these improvements have helped keep WebKit competitive, and even perform better than other engines in some scenarios, it has been clear for a while that we were reaching the limits of what can be achieved with a CPU based 2D renderer. There was an attempt at making Cairo support GPU rendering, which did not work particularly well due to the library being designed around stateful operation based upon the PostScript model--resulting in a convenient and familiar API, great output quality, but hard to retarget and with some particularly slow corner cases. Meanwhile, other web engines have moved more work to the GPU, including 2D rendering, where many operations are considerably faster. We checked all the available 2D rendering libraries we could find, but none of them met all our requirements, so we decided to try writing our own library. At the beginning it worked really well, with impressive results in performance even compared to other GPU based alternatives. However, it proved challenging to find the right balance between performance and rendering quality, so we decided to try other alternatives before continuing with its development. Our next option had always been Skia. The main reason why we didn't choose Skia from the beginning was that it didn't provide a public library with API stability that distros can package and we can use like most of our dependencies. It still wasn't what we wanted, but now we have more experience in WebKit maintaining third party dependencies inside the source tree like ANGLE and libwebrtc, so it was no longer a blocker either. In December 2023 we made the decision of giving Skia a try internally and see if it would be worth the effort of maintaining the project as a third party module inside WebKit. In just one month we had implemented enough features to be able to run all MotionMark tests. The results in the desktop were quite impressive, getting double the score of MotionMark global result. We still had to do more tests in embedded devices which are the actual target of WPE, but it was clear that, at least in the desktop, with this very initial implementation that was not even optimized (we kept our current architecture that is optimized for CPU rendering) we got much better results. We decided that Skia was the option, so we continued working on it and doing more tests in embedded devices. In the boards that we tried we also got better results than CPU rendering, but the difference was not so big, which means that with less powerful GPUs and with our current architecture designed for CPU rendering we were not that far from CPU rendering. That's the reason why we managed to keep WPE competitive in embeeded devices, but Skia will not only bring performance improvements, it will also simplify the code and will allow us to implement new features . So, we had enough data already to make the final decision of going with Skia. In February 2024 we reached a point in which our Skia internal branch was in an "upstreamable" state, so there was no reason to continue working privately. We met with several teams from Google, Sony, Apple and Red Hat to discuss with them about our intention to switch from Cairo to Skia, upstreaming what we had as soon as possible. We got really positive feedback from all of them, so we sent an email to the WebKit developers mailing list to make it public. And again we only got positive feedback, so we started to prepare the patches to import Skia into WebKit, add the CMake integration and the initial Skia implementation for the WPE port that already landed in main. We will continue working on the Skia implementation in upstream WebKit, and we also have plans to change our architecture to better support the GPU rendering case in a more efficient way. We don't have a deadline, it will be ready when we have implemented everything currently supported by Cairo, we don't plan to switch with regressions. We are focused on the WPE port for now, but at some point we will start working on GTK too and other ports using cairo will eventually start getting Skia support as well. This entry was tagged cairo, skia, WebKit. Bookmark the permalink. Post navigation - WebKitGTK accelerated compositing rendering A Clarification About WebKit Switching to Skia - Leave a Reply Cancel reply Your email address will not be published. Required fields are marked * [ ] [ ] [ ] [ ] [ ] [ ] [ ] Comment [ ] [ ] Name * [ ] Email * [ ] Website [ ] CAPTCHA Refresh [ ] CAPTCHA Code * [Post Comment] February 2024 M T W T F S S << Apr 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Tags cairo cpufreq dbus epiphany evince gnome-applets gnome-panel gtk+ libsoup libspectre pdf poppler skia WebDriver WebKit xps Categories * Free Software (94) + freedesktop.org (4) + GNOME (87) + WebKit (25) * General (12) * Igalia (35) * Uncategorized (1) Links * freedesktop.org * GNOME * GNOME Hispano * Igalia * LibreSoft * Linups * Planet GNOME * Planet Igalia * Planeta GNOME Hispano Archives * February 2024 * April 2023 * June 2022 * January 2019 * September 2017 * May 2017 * March 2017 * February 2017 * September 2016 * March 2016 * September 2015 * March 2015 * August 2014 * July 2014 * March 2014 * December 2013 * September 2013 * April 2013 * December 2012 * August 2012 * July 2012 * March 2012 * February 2012 * January 2012 * December 2011 * November 2011 * May 2011 * April 2011 * March 2011 * February 2011 * September 2010 * July 2010 * June 2010 * February 2010 * September 2009 * May 2009 * February 2009 * May 2008 * March 2008 * December 2007 * November 2007 * September 2007 * May 2007 * April 2007 * February 2007 * January 2007 * December 2006 * October 2006 * June 2006 * April 2006 * March 2006 * December 2005 * November 2005 * September 2005 * June 2005 * May 2005 * April 2005 * March 2005 * February 2005 * January 2005 * December 2004 * November 2004 * October 2004 * September 2004 * August 2004 * July 2004 * June 2004 Powered by WordPress & simpleX.