Alter GeckoSoftwareLayerClient.beginDrawing so that it can return a rectangle
of the buffer that it's interested in. Gecko then uses this to clip the dirty
region, which often saves on unnecessary drawing during flings.
This backs out changes d8fc13006aa4, ddde7a49f6f7, 34b1cc9454d2 and
8919c54229e1, leaving in some initialisation fixes that were introduced when
rebasing.
This work may be re-applied at a later date.
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.