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.

Full Query
ID Priority Summary Status Assigned to
887819 -- Investigate using the tiled layers backend RESOLVED Brad Lassey [:blassey] (use needinfo?)
895358 -- Enable progressive tile rendering in B2G RESOLVED Randall Barker [:rbarker]
895905 -- Contents needs to inform APZC about scroll events on B2G RESOLVED Botond Ballo [:botond]
897996 P2 Enable low precision rendering on B2G RESOLVED Kartikaya Gupta (email:kats@mozilla.staktrace.com)
907743 -- Align calculated display-ports to tile boundaries RESOLVED Chris Lord [:cwiiis]
915673 -- only use tiled layers for scrolling layers RESOLVED Chris Lord [:cwiiis]

6 Total; 0 Open (0%); 6 Resolved (100%); 0 Verified (0%);


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.