Added Skia WebKitGTK and WPEWebKit support for 2D graphics rendering

Skia Logo

Skia is an open source 2D graphics library

In the world of development web browsers and desktop environments, optimization and performance are a of the most requested features by users and these are critical aspects that directly influence the user experience and one of the main factors when choosing a web browser.

In this context, development teams behind WPEWebKit and WebKitGTK (the browser engine used in browsers such as Safari and Epiphany/GNOME Web), have incorporated the ability to use the Skia library for rendering 2D graphics.

During the last years, WebKit developers have been working hard to improve performance WebKitGTK and WPEWebKit graph. Althoughand features have been implemented such as threaded rendering and VSync, and it became clear that the CPU-based 2D renderer had reached its limits in terms of performance and efficiency. It is mentioned that they explored various options before opting for Skia. Attempts to add 2D GPU rendering capabilities to the Cairo library, used by WebKitGTK, were unsuccessful due to limitations in the library's architecture. Additionally, a project to develop a custom rendering library was abandoned due to difficulties striking a balance between performance and rendering quality.

There was an attempt to make Cairo support GPU rendering, which didn't work particularly well because the library was designed around a stateful operation based on the PostScript model, resulting in a convenient and familiar API, with excellent output quality, but difficult to reorient and with some particularly slow corner cases. Meanwhile, other web engines have shifted more work to the GPU, including 2D rendering, where many operations are considerably faster

Although The idea of ​​using Skia was initially rejected due to issues with API stability, its use as an external dependency, and the need to maintain a third-party module in WebKit, was finally considered the optimal solution to improve graphics rendering performance in WebKitGTK.

Skia is a graphics library used in several Google products, such as Chrome, Firefox, ChromeOS, Android, and Flutter. This addition enables rendering using the GPU, which can significantly improve graphics rendering performance.

The migration to Skia was carried out by Igalia as part of an initiative to optimize the performance of WebKitGTK for GNOME. It is mentioned that the main reason behind this migration was to reach a limit in the process of optimizing 2D rendering performance using the CPU. Using the GPU provides additional capability to improve graphics rendering performance.

The transition process to Skia began with internal testing in December 2023 and the initial results were impressive, as significant improvements in performance were seen right away, especially on the desktop. As testing progressed, it became clear that Skia not only offered superior performance, but would also simplify the code and open the door to new functionality.

In February 2024, after an intense period of development and testing, the implementation of Skia reached an “upstreamable” state, which means that it was ready to be integrated into WebKitGTK and WPEWebKit publicly, with which the initial response from the developer community was positive, marking an important milestone in the transition process.

The team is committed to continuing to improve the Skia implementation in WebKitGTK and WPEWebKit going forward, with plans to further optimize GPU rendering performance and efficiency. Although the focus is currently on the WPE port, it is expected that other ports, such as GTK, will also receive support from Skia in the future.

Finally if you are interested in knowing more about it, you can check the details in the next link.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.