This adds checkerboard profiling to LayerRenderer, that can be enabled either
by enabling debug logging of the "GeckoLayerRendererProf" tag, or via
reflection using PanningPerfAPI.
The buffer in MultiTileLayer is invalidated each time the origin or resolution
changes. MultiTileLayer was using the last updated origin/resolution instead of
the last set, so if Gecko was animating and locked the layer for long enough,
the buffer would be incorrectly invalidated due to the origin/resolution not
being updated.
Prevent trying to resize the buffer before the surface has been created. At
that point, we wouldn't know our maximum texture size, so we would've thrown a
RuntimeException.
Certain conditions would cause MultiTileLayer to incorrectly invalidate tiles,
or to reuse tiles incorrectly, which would cause checkerboarding (sometimes
permanent until a redraw occurs).
This addresses said issues:
- Removes manual invalidation on Document:Shown and Tab:Selected. This is
unnecessary, as the entire buffer will be invalidated when this happens
anyway. Sometimes Document:Shown happens *after* drawing has occurred,
which caused the entire screen to checkerboard incorrectly.
- Fix re-using off-screen tiles with the incorrect resolution. Tiles are stored
in a hash-map based on their unscaled position. As only tiles that intersect
with the update region in tile-space are invalidated, sometimes tiles that
were off-screen, but whose unscaled tile origin appears on-screen would be
incorrectly re-used. Fix this by checking that a tile's resolution matches the
current resolution before reusing it.
When rendering with an offset for MultiTileLayer, the tile origin was moved
to compensate, but this lead to there being a mismatch between Gecko's
displayport origin and the one recorded on the Java side.
Instead of altering the origin, allow setting a render offset on MultiTileLayer
instead, so the origin remains correct.
Instead of tying the tile-buffer in MultiTileLayer directly to the back-buffer
of the page, make sure rendering is always aligned to the tile grid and use
tiles on-demand. This makes better use of tiles when panning/zooming, and opens
up the route for further optimisations.
Instead of tying the tile-buffer in MultiTileLayer directly to the back-buffer
of the page, make sure rendering is always aligned to the tile grid and use
tiles on-demand. This makes better use of tiles when panning/zooming, and opens
up the route for further optimisations.
Instead of tying the tile-buffer in MultiTileLayer directly to the back-buffer
of the page, make sure rendering is always aligned to the tile grid and use
tiles on-demand. This makes better use of tiles when panning/zooming, and opens
up the route for further optimisations.