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.
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.
This uses MultiTileLayer instead of SingleTileLayer for devices that don't have
gralloc support. This has the advantage of reduced memory usage due to less
wastage from power-of-two textures, and can be a performance boost due to slow
sub-image updates on some devices.
The lock on the software buffer was not being respected when destroying the
surface on screen rotation, meaning we could destroy it while Gecko was still
drawing to it. This would certainly cause a crash on rotation under the right
conditions. The same situation also occurred in
GeckoSoftwareLayerClient.getBitmap().
We also waited until the next redraw when freeing the old texture associated
with the surface. This had the effect of temporarily increasing the memory
usage (generally by either 4.5 or 9 megabytes). If memory pressure is high,
this could also cause a crash, though it is far less likely than the above case.
We only ever want to respond to the latest viewport sent, separate the
viewport change into its own event and remove all but the latest in the queue
when processing events.
Since the geometryChanged function does nothing if the parameter passed
in is false, better to rename the function to be more indicative of
what it actually does, and remove all the resulting dead code.
This removes the hard-coded limit of 1024x2048 tile sizes, and allows for
arbitrary tile-sizes. It will still only allocate texture sizes in powers of
two, however. It replaces the tile size with a buffered-area size, which can be
re-allocated as the screen dimensions change.
This removes the hard-coded limit of 1024x2048 tile sizes, and allows for
arbitrary tile-sizes. It will still only allocate texture sizes in powers of
two, however. It replaces the tile size with a buffered-area size, which can be
re-allocated as the screen dimensions change.