WebRender newsletter #32

Hey there! Did you hear this? Me neither. The 32nd episode of WebRender’s newsletter made its way to your screen without a sound. In the previous episode, nic4r asked in the comments section a lot of technical and interesting questions. There is a lot to cover so I’ll start by answering a couple here by way of introduction and will go through the other questions in later posts.

How do the strategies for OMTP and WebRender relate? Would OMTP have benefits for expensive blob rasterization since that used Skia?

OMTP, for off-main-thread painting, is a project completely separate from WebRender that was implemented by Ryan. Without WebRender, painting used to happen on the main thread (the thread that runs the JS event loop). Since this thread is often the busiest, moving things out of it, for example painting, is a nice win for multi core processors since the main thread gets to go back to working on JS more quickly while painting is carried out in parallel. This work is pretty much done now and Ryan is working on project Fission.

What about WebRender? WebRender moved all of painting off of the main thread by default. The main thread translates Gecko’s displaylist into a WebRender displaylist which is sent to the GPU process and the latter renders everything. So WebRender and OMTP, while independent projects both fulfill the goal of OMTP which was to remove work from the main thread. OMTP can be seen as a very nice performance win while waiting for WebRender.

Expensive blob rasterization is already carried out asynchronously by the scene builder thread (helped by a thread pool) which means we get with blob rasterization the same property that OMTP provides. This is a good segue to another question:

How do APZ and async scene building tie together?

APZ (for Asynchronous Panning and Zooming) refers to how we organize the rendering architecture in such a way that panning and zooming can happen at a frame rate that is decoupled from the expensive parts of the rendering pipeline. This is important because the perceived performance of the browser largely relies on quickly and smoothly reacting to some basic interactions such as scrolling.

With WebRender there are some operations that can cost more than our frame budget such as scene building and blob image rasterization. In order to keep the nice and smooth feel of APZ we made these asynchronous. In practice this means that when layout changes happen, we re-build the scene and perform the rasterization of blob images on the side while still responding to input events so that we can continue scrolling the previous version of the scene until the new one is ready. I hope this answers the question. Async scene building is one of the ways we “preserve APZ” so to speak with WebRender.

* Do you still plan to use pathfinder for font-rendering any time soon?
* What about planeshift?
* Using gfx-rs probably isn’t all that high in the priority list, but is this still being actively scoped?

We’d like to use pathfinder eventually but it’ll have to wait until we WebRender is shipped and stable, for now pathfinder can only emulate the native font look on mac and there are known issues so I suspect there’s some non-trivial amount of work left before we can ship it.

For planeshift I haven’t looked closely into it, I don’t know if it’s high level enough for us to bolt it onto Firefox or if we’ll need something a bit more specific, but we want to better integrate with OS compositors in the long run so the feature itself will make its way eventually.

There are people working on the gfx-rs port of WebRender. Still a lot to do but they have promising results. It’s most likely going to take a while before we ship it as well.

People, you keep posting tons of interesting stuff. But whats the ETA on WebRender????? Just keep us posted instead of keeping us in limbo. Its very very disappointing!!! When can be expect webrender in the release channel? In short, is it weeks away? Or months away? Or years away?

I’d guess 2-4 months for the Nvidia desktop configuration, 6 months for the general desktop population, and around a year for Android. But I’m not involved in WebRender development nor affiliated with Mozilla so who knows how close I am.

It’s probably hard even for Mozilla developers to say because something new like WebRender always has unexpected obstacles. I’m sure there’s a target version they’d like to release WebRender for, but it comes with a degree of uncertainty which is why it’s not public yet (as far as I know).