WebRender newsletter #19

I skipped a newsletter again (I’m trying to put publish one every two weeks or so), sorry! As usual a lot of fixes and a few performance improvement, and sometimes both the same time. For example the changes around image and gradient repetition were primarily motivated by bugs we were encountering when dealing with repeated backgrounds containing very large amounts of repetitions, and we decided to solve these issues by moving all images to the “brush” infrastructure (bringing better batching, faster fragment shader and the ability to move more pixels out of the alpha pass), and optimize the common cases by letting the CPU generate a single primitive that is repeated in the shader. I don’t always properly highlight fixes that benefit performance but they are here.
The most exciting (in my humble opinion) advancement lately is Kats’ work on integrating of asynchronous panning and zooming (which we refer to as APZ) with WebRender’s asynchronous scene building infrastructure. This lets us perform some potentially expensive operations (such as scene building) asynchronously and allow the critical path to prioritize scrolling, animations and video playback. It is a lot more complicated than it might sound (in part due to how it works on the Gecko side) and I am very impressed with how quickly it is taking shape.

Enough with my ramblings, let’s have a look at the highlight of the last two weeks month.

Notable WebRender changes

  • Kats integrated APZ with async scene building (spread over many pull requests).
  • Nical implemented and enabled repeating images and gradients directly in the shader when there is no tile spacing.
  • Nical implemented decomposing repeated linear and radial gradients during frame building when it can’t be done in the shader.
  • Nical and Jeff implemented decomposing tiled images during frame building when it can’t be done in the shader.
  • Nical implemented baking repeated image spacing into a texture to allow repeating them in the shader in more cases.
  • Gankro fixed serialization of gradient stops for the frame capture tool.
  • Kvark implemented clipping against the near plane for bounds calculus (fixes a few correctness bugs and improves performance in some cases).
  • Jeff fixed blob images incorrectly marked as opaque.
  • Martin implemented scrolling using the hit tester.
  • fschutt fixed some build issues with pathfinder, and some other build issues.
  • Martin prevented unnecessary clipping computations in some cases.
  • Jeff simplified the way we clip blob image tiles.
  • Gankro fixed an infinite loop.
  • Martin fixed another infinite loop.
  • Martin made the border image API more general.
  • Kvark reduced the size of the aColorTexCoord shader vertex attribute.
  • Kvark implemented taking the clip chains clip rect into account for local_rect computation.
  • Glenn added the initial implementation for brush border primitives.
  • Kvark gracefully handled invalid gradient stops.
  • Glenn implemented sub-pixel aa with specified background color in off-screen targets.
  • Martin fixed an issue with optimized away clip segments.
  • Gankro worked around a rustc bug.
  • Glenn implemented storing non-rectangular UVs in texture cache entries.
  • Glenn implemented non-square slab allocations in the texture cache.
  • Martin improved the performance of rendering dotted/dashed borders.
  • Glenn implemented collapsing opacity filters when they contain a single item.
  • Glenn fixed the clipping of elements which bounds depend on an animated property.
  • Glenn made various chnages in preparation for text run caching.
  • Kvark fixed a GPU cache invalidation bug.
  • Gankro fixed an issue with sub-pixel aa and masks.

Notable Gecko changes

  • Kats made a ton of progress on integrating APZ with async scene building (spread over many bugzilla entries).
  • Kats implemented paint skipping with WebRender.
  • Jeff enabled blob image invalidation by default.
  • Jeff fixed a ton of blob image related bugs (spread over many bugzilla entries).
  • Kats enabled some linux64-qr mochitests in the CI.
  • Hiro fixed tab throbbers that weren’t throbbing.
  • Hiro fixed another animation related bug.
  • Hiro fixed yet another animation issue.
  • Hiro fixed more animation stuff.
  • Jeff fixed a blob image assertion, and another one.
  • Kats fixed a bug with scrollbar not being rendered properly in some cases.
  • Gankro fixed some complicated text decoration cases.
  • Gankro fixed a bug with table and border-collapse.
  • Gankro fixed janky animations of text caused by pixel-snapping under certain types of transforms.
  • Gankro implemented proper hit-testing support within blob images.
  • Andrew reduced the amount of copying happening with blob images.
  • Andrew fixed an assertion in the image sharing code.
  • Kats fixed a crash.
  • Kats batched the removal of async pipelines which were causing the scene to be rebuilt a lot on some sites.
  • Kats reduced the amount of allocations happening when updating animated properties.
  • Sotaro improved the way logging is integrated with WebRender (2), (3).
  • Kats avoided the use of static initializers for APZ.
  • Hiro fixed the way we sample time stamps for tests.
  • Hiro enabled some animation tests with WebRender.
  • Lee fixed an issue with the lifetime of blob image resources.
  • Lee fixed emoji transparency.

Enabling WebRender in Firefox Nightly

In about:config, just set “gfx.webrender.all” to true and restart the browser. No need to toggle any other pref.

Reporting bugs

The best place to report bugs related to WebRender in Gecko is the Graphics :: WebRender component in bugzilla.
Note that it is possible to log in with a github account.

8 thoughts on “WebRender newsletter #19

  1. Can’t wait for WebRender to be moved into Firefox Developer builds. I always look forward to reading your WebRender newsletter. What you all are working on is simply amazing and I applaud your work! Keep up the good work!!

    1. 64 is the optimistic target for a small and specific subset of the user base. The rest of the users will progressively get it rolled out as we get some testing on a wider variety of hardware/driver configurations.

  2. I’m using Firefox Nightly 62 64bit, an Intel i7 7th gen 12 gb with integrated gpu, and windows 10 April 2018 laptop.
    I still like what you do Nical but… This is known issue but at least for me the CPU usage is high and is a lot higher then the ram usage but both are high, and the GPU use is low to none when I only use non privacy windows. The ram usage is the highest when least for me when…. privacy windows and a non privacy windows used together at least for me that makes higher ram usage and no GPU usage. Thank you

    1. Huh interesting. There is definitely extra overhead per-window (or rather, per window where something changes frequently). I hadn’t thought about private windows and wouldn’t expect them to have a diffenrent impact than regular windows, but I’ll keep an eye on this.
      On the broader topic of CPU overhead, there are definitely many improvements we need t make in this area, we haven’t gotten to them yet but we’ll get there eventually.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s