Use HiDpi tiles to produce crisper maps at fractional zoom levels


The current QtLocation renderer uses geotiles of specified size for
each specific zoom level, and show them using nearest neighbor
interpolation when the camera is at that specific zoom level.
Interpolation is changed to linear when the zoom level is in between
two neighboring tile layers, but hasn't reached the next yet, so that
the previous layer can be magnified smoothly.

While this is the correct approach, it produces blurry images most of
the time, while the previous camera mechanics, not allowing continuous
zoom, was able to show crisp images all the time.

To retain the continuous zoom and produce crisp images, this patch
makes use of HiDpi tiles from providers that offer them (HERE and
mapbox).

The way these two providers offer HiDpi is different: HERE scales the
map elements (text, mostly), to address a specific dpi (supported
dpis are 72, the standard, 250, 320, 500), while mapbox returns
the same tile at double resolution.

The way the patch deals with this is by taking the image requested
as is, but setting the tile size in the renderer to be half of that,
while at the same time enabling mip mapping for QSGImageNodes.

In this way, at integer zoom level, texture LOD 1 is shown, that is
an OpenGL-scaled-down version of the downloaded tile, while at the
other fractional zoom levels trilinear interpolation is used to
produce a good image.

This approach was not possible for the openstreetmap geoservice
provider because mapquest (the currently used data provider) does
not offer HiDpi tiles, and a scaled version of the standard tile
would make the text unreadable half of the times.

Further scaling would be possible, e.g., with HERE maps, offering
500ppi maps, to look good during scaling also on HiDpi devices.
This can be addressed in a future patch.

Task-number: QTBUG-53318
Task-number: QTBUG-48868
Task-number: QTBUG-36949
Change-Id: Iaa6f5b1ece9d37a0c85e73efaf1bd3b50b1d5950
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
commitc2329ca8fb48aac7da1694f4b9c3d28924feae63
parenta10b6b5bf6ed29f705c2e3dd85c1206a96171f60
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>
committerPaolo Angelelli <paolo.angelelli@theqtcompany.com>
commit timeFri, 1 Jul 2016 09:29:11 +0000