WPE WebKit 2.46 highlights

A couple of weeks ago, the WPE WebKit team released version 2.46. This is an important milestone for the project as, for the first time in a stable series, the Skia backend takes over rendering. Skia brings significant improvements to the graphics stack, so we are very happy for this release. The list of changes goes beyond graphics, and it’s not short of awesome, so let’s have a look to what’s new!

Cairo is out, Skia is in

We announced some time ago that a new rendering backend with Skia was on the works and that it would eventually replace Cairo. 2.46 the first release series where Skia is used, bringing important improvements in rendering and performance.

While Skia can use a GPU for rendering, our testing with common embedded SoCs has shown that the way WPE WebKit works may result in slightly worse performance in some cases than letting Skia use the CPU. Hence, for the 2.46 releases the latter is the default, while development continues to improve GPU usage on low-powered devices with the ultimate goal of making accelerated rendering the default choice in all cases.

The Cairo backend is still present and will be selected automatically at build time for big-endian architectures, where Skia is not yet supported. We plan to remove support for Cairo in the near future, and this approach allows us to ship the new renderer while solving the remaining issues. At any rate, the Cairo renderer is no longer receiving active development.

It is important to notice that it is recommended to build WPE with Clang instead of GCC. This comes from upstream Skia; see their supported and preferred compilers page for details.

Graphics stack revamped

Tha switch to Skia has made possible a significant number of changes and improvements in the WebKit graphics stack. These changes relate to accelerated canvas, accelerated CSS filters, color spaces, and more. Carlos García has written extensively about these changes in his blog, we recommend reading his article for more details.

Trace point profiling with sysprof

Sysprof is a profiling and performance analysis tool for Linux. Thanks to integration with libsysprof-capture, it is now possible to use Sysprof to record trace points to do profiling and performance analysis of WebKit internals. This is a major improvement that will allow us to more effectively analyze the code paths that are more performance-sensitive and find ways to optimize them. It will also allow vendors to profile their specific hardware configurations and specific use-cases as well.

For a more in-depth presentation of the integration with Sysprof, please read Georges Stavacras’ blog post on the topic.

API changes

Additions

  • webkit_settings_apply_from_key_file() allows applying WebKit settings directly from a key file
  • The console message API, which had been previously deprecated, has been brought to the current API
  • WebKitAutomationSession::will-close signal, which allows clients to perform cleanup tasks before an automation session is closed
  • enable-2d-canvas-acceleration WebSetting can be used to control 2D-canvas acceleration in Skia-enabled builds
  • webkit_web_view_toggle_inspector() shows or hides the web inspector for a given webview (only available with the WPE platform API)

Deprecations

  • WebKitWebView::insecure-content-detected signal.
  • WebKitWebContext:use-system-appearance-for-scrollbars property.
  • webkit_web_context_set_use_system_appearance_for_scrollbars() and webkit_web_context_get_use_system_appearance_for_scrollbars().

GStreamer customizations

Compile-time platform-specific GStreamer customizations are now done at runtime, using the WEBKIT_GST_QUIRKS and WEBKIT_GST_HOLE_PUNCH_QUIRK environment variables. Setting their value to help will return a help message with the possible values to stderr. A list of the removed CMake defines:

  • USE_GSTREAMER_NATIVE_VIDEO
  • USE_GSTREAMER_NATIVE_AUDIO
  • USE_GSTREAMER_TEXT_SINK
  • USE_GSTREAMER_HOLEPUNCH
  • USE_WPEWEBKIT_PLATFORM_WESTEROS
  • USE_WPEWEBKIT_PLATFORM_BCM_NEXUS
  • USE_WPEWEBKIT_PLATFORM_AMLOGIC
  • USE_WPEWEBKIT_PLATFORM_RPI
  • USE_WPEWEBKIT_PLATFORM_BROADCOM
  • USE_WESTEROS_SINK

Web Platform changes

The changes to supported Web Platform features between releases of WebKit are always substantial, and for that reason listing all of those changes here would be a major endeavour. The following is an incomplete list of some of the features that have been enabled, removed, and marked in preview state since 2.44, in no particular order:

  • CSS Container/Style Queries
  • CSS text-wrap-style
  • CSS background-clip: border-area
  • CSS text-underline-position: left|right
  • CSS scrollbar-width
  • CSS View Transitions
  • CSS Grid Masonry layout (preview)
  • CSS ::target-text pseudo element
  • WebCrypto X25519 algorithm (preview)
  • AppCache support has been removed
  • New Promise.try() method
  • New Observable methods, like .map() and .filter()

Other noteworthy changes

  • Suport for the WebP image format is now always enabled.
  • WebDriver clients may now connect to an already running process, instead of always needing to spawn a new one.
  • The gst-libav AAC decoders are now disabled due to outstanding bugs. Distributors are encouraged to use the GStreamer FDK AAC decoder (part of gst-plugins-bad) instead.

And much more!

WebKit evolves and changes a lot between major stable releases. Listing all changes would not be possible. There are countless bug fixes, performance improvements, new web features supported, and so on. We recommend checking the release notes and the git log for more details.

The WPE WebKit team is already working on the 2.48 release, schedule for early next year. Until then!


This article was written by Claudio Saavedra.

Claudio is long-time WebKit contributor from Igalia, working in different areas of WebKit, WPE, and the stack around it.

If you’re using WPE WebKit, or are considering doing so, please take our brief user survey. Your input will help us make WPE WebKit better for you!

If you’re using WPE WebKit, or are considering doing so, please take our brief user survey! Your input will help us make WPE WebKit better for you.