19

moz://gfx newsletter #48

 4 years ago
source link: https://www.tuicool.com/articles/ueQJfua
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Greetings! This issue of the newsletter is long overdue. Without further ado:

What’s new in gfx

Wayland dmabuf textures

Martin Stransky landed the dmabuf texture work which was at the prototype stage at the time of the previous newsletter. This is only used with the GL compositor at the moment which is not enabled by default ( gfx.acceleration.force-enabled pref in about:config ). Work to get dmabuf textures with WebRender is in progress .

CoreAnimation integration

Markus landed a number of infrastructure changes towards integrating with CoreAnimation and doing partial present optimizations on MacOS.

This short description doesn’t do justice to the amount of work that went into this. Stay tuned, you might read some more about this on this blog soon.

Direct Composition integration

Sotaro has been working on a number of bugs in support for Direct Composition integration, including some ground work and investigation such as bugs 1585893 , 1585619 and 1585278 , and bug fixes like an issue involving the tab bar, direct composition, the high contrast theme and WebRender.

RGB, RGBA, BGRA, BLARGH!

Andrew landed a number of image decoding performance improvements, using SIMD to speed up pixel format conversion.

Benchmarks targeting the improvements suggested a ceiling of 25-50% faster for pixel format conversions, initial telemetry data suggesting 5-10% real world average decoder performance improvement. Not bad!

What’s new in WebRender

WebRender is a GPU based 2D rendering engine for web written in Rust , currently powering Firefox ‘s rendering engine as well as the research web browser servo .

To enable WebRender in Firefox, in the about:config , enable the pref gfx.webrender.all and restart the browser.

WebRender is available as a standalone crate on crates.io ( documentation ) for use in your own rust projects.

WebRender enabled in Firefox Preview Nightly on the Pixel 2

This is the first configuration on Android that Jamie enabled WebRender on by default. A pretty cool milestone to build upon!

Download it here: https://play.google.com/store/apps/details?id=org.mozilla.fenix.nightly

WebRender is only enabled by default for pixel 2 phones at the moment but on other configurations it can be enabled in about:config .

Pixel snapping

Andrew rewrote pixel snapping in WebRender. See the bug description and the six patches series that followed to get an idea of how much work went into this.

Blob image recoordination

If you have been following this newsletter you might remember reading hearing about “blob image recoordination” for a while now. That’s because work has been ongoing for quite a while. A lot of these patches that have been in the work for months landed recently. Blobs are now “recoordinated”.

In other words, Jeff and Nical landed a lot of infrastructure work went into handling the coordinate system of blob images, webrender’s fallback software rendering path.

This puts the fallback code on a saner foundation and allows reducing the invalidation of blob images in various scenarios such as scrolling large SVG elements, or when animations cause the bounds of a blob image to change. This translates to performance improvements on web pages that use SVG a lot.

Picture caching

Glenn landed some pretty big changes to picture caching:

  • The cache is now organized as a quad-tree.
  • Picture cached tiles that are only solid color use a fast path to optimize speed and memory consumption.
  • There is a new composite pass with a simpler drawing model than other render passes. It is a first step towards deferring the composition of cached tiles to OS compositor APIs such as Direct Composition and Core animation, and will allow optimizations for the upcoming software backend.
  • There are now separate picture cache slices for web content, the browser UI and scroll bars.
  • WebRender now generates dirty rects to allow partial present optimizations.

YUV image rendering performance

Kvark fixed YUV images being accidentally rendered in the alpha pass instead of the opaque pass. A very simple change yielding pretty significant performance improvements as it reduces the overdraw while rendering video frames.

Text rendering improvements

Lee removed Cairo usage from the Skia FreeType font host. SkFontHost_cairo depended on the interposition of Cairo for dealing with creating/loading FreeType faces. This imposed annoying limits on our Skia text rasterization such as a lack of sub-pixel text positioning on Android and Linux. It also forced us to build and maintain FcPattern structures that caused memory bloat and had performance overhead to interpret.

With this fixed, Lee enabled sub-pixel positioning on Linux and Android.

Various fixes and improvements

  • Botond fixed a regression affecting WebExtensions that move a tab into a popup or panel window (1) , (2) .
  • Botond fixed an issue that prevented Windows users with certain Acer and Asus laptops from being able to two-finger scroll on Gmail and various other websites.
  • Botond fixed one of the prerequisites for enabling a hiding URL bar in Firefox Preview.
  • Kvark improved WebRender’s performance when allocating a page requires a lot of cached texture memory.
  • Kvark added support for the Solus linux distribution in Gecko’s build system.
  • Kvark updated the WebGPU IDL
  • Kvark fixed a few IDL bindgen issues in the process (1) , (2) .
  • Andrew prevented border raster images from going through a slow fallback path.
  • AWilcox fixed YUV image rendering on big-endian machines.
  • Nical cleaned up a lot of the scene building and render graph code in WebRender.
  • Kris fixed an opacity rendering issue on SVG USE elements with D2D.
  • Jonathan Kew fixed a rendering issue with stroked text with ligatures.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK