WebKit adopts Skia library for 2D graphic rendering

Browser engine developed by Apple WebKitused in browsers such as Safari and Epiphany (GNOME Web), goes over to use the library for rendering 2D graphics Skiaused in Google Chrome, ChromeOS, Android and Flutter, and supportive rendering using GPU. The porting was carried out by Igalia as part of an initiative to optimize the performance of WebKitGTK for GNOME. The reason cited for the migration was reaching a limit in the process of optimizing 2D rendering performance using the CPU, and the need to use the GPU to further improve performance.

Attempts to add 2D GPU rendering capabilities to WebKit's Cairo library were unsuccessful due to the architecture of the library, and a project to write a custom rendering library was abandoned due to the difficulty of balancing performance and rendering quality. As a result, the developers from Igalia returned to the idea of ​​​​using the Skia library, which was the optimal solution, but was initially rejected due to the lack of a stable API, problems with use as an external dependency and the need to maintain a third-party module in WebKit.

The decision to move WebKit to the Skia library was facilitated by the fact that the disadvantages associated with replacing dependencies outweighed the advantages, which were expressed not only in increasing rendering performance, but also in simplifying the code base and expanding the possibilities for developing new functionality. In terms of performance, the initial port of WebKit on Skia showed twice the rendering speed of older code using the CPU when running MotionMark tests on a PC.

In February 2024, the WebKit branch migrated to Skia was ready to be transferred to the main WebKit codebase. After discussions with developers from Google, Sony, Apple and Red Hat, it was decided to migrate WebKit from the Cairo library to Skia and currently the code to support Skia is already accepted to main branch WebKit.

Thanks for reading: