B2G/TiledLayers

From MozillaWiki
< B2G
Jump to: navigation, search

This page tracks the work necessary to enable the tiled layers backend on b2g. It's generally agreed that it's a good idea to use this backend, as it has shown massive performance improvements on Android.

Switching on

The layers backend needs to be multi-process safe before it can be switched on. As it was only necessary for it to work with multi-threading initially, there are places where raw pointers are passed around. This work is tracked in bug 747811.

Additional work

There are additional pieces of work necessary to fully take advantage of the tiled layers backend in the same way that Firefox on Android does. These are tracked in the following bugs, and detailed below.

Bugzilla query error


Display-port strategies

When scrolling in Firefox for Android, we always align the display-port with tile boundaries and we size the display-port based on the contextual information of how the user is scrolling. For example, if the user is scrolling vertically and we've initiated a vertical axis-lock, we can shrink the display-port on the horizontal axis and expand it on the vertical axis. This reduces the chances of the user seeing 'checkerboard' (blank, unrendered area).

Progressive rendering

As the tiled layers backend forces us, to some extent, to do our drawing updates in batches of tiles, it also gives us the opportunity to allow batches to be split up and for drawing to be cancelled. This happens on Firefox for Android, and is one of the largest performance benefits of the tiles backend.

Low precision rendering

When drawing is falling behind too much, we expand the display port and render at a lower resolution to present the user with something (as opposed to just blank page) while we catch up. This is especially effective on low-end devices that regularly fall behind on rendering during fast panning. This depends on progressive rendering.