[Marble-devel] Review Request 123306: Patch that clarifies the non-intuitive flow of scaling tiles
Torsten Rahn
tackat at kde.org
Thu Apr 9 14:08:01 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123306/#review78710
-----------------------------------------------------------
As discussed with Adam on IRC: nice patch :)
The best solution seems to be what we had in a prior implementation already (ca. Marble < 1.4): partWidth and partHeight should always at least match 1 (and never get down to 0) so that in the worst case where no bigger portion of a different level is available the least tile level is chose (likely level zero) and the single pixel in the right spot is enlarged to cover the full extent of the desired tile. So something like:
int const partWidth = qMax(1, textureLayer->tileSize().width() >> deltaLevel);
int const partHeight = qMax(1, textureLayer->tileSize().height() >> deltaLevel);
.. if that works as intended.
- Torsten Rahn
On April 9, 2015, 9:40 vorm., Adam Dabrowski wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123306/
> -----------------------------------------------------------
>
> (Updated April 9, 2015, 9:40 vorm.)
>
>
> Review request for Marble.
>
>
> Repository: marble
>
>
> Description
> -------
>
> QDoesn't change functionality.
>
> Does clarify the code as flow was very non-intuitive previously (especially in case when deltaLevel > 8 for tileSize = 256).
>
> if/when the scaledLowerLevelTile "for" loop reached zoom level where 2^deltaLevel > tileSize, a peculiar thing was happening.
> In this situation, in part "// which rect to scale?", the image was copied first from 0 sized-image. Calling the QImage::copy function with null rectangle (or 0 width and 0 height) results in copying a whole image instead. As a result, instead of level_N tile, a level_N-9 (or later) tile was returned unscaled, resulting in curious displays (i.e. multiple copies of the same tile image).
> While for textures that are downloadable this was a temporary case, offline textures would just stop there and display this curious images. Additionally it was very unclear and took me some time to figure out what's happening.
>
> This version does clearly what previously was done due to specific QImage::copy behaviour.
>
> Let's discuss if this behaviour is desired (or we want to display a full white opaque tile or a tile with a loading icon if there are download urls etc.).
>
>
> Diffs
> -----
>
> src/lib/marble/TileLoader.cpp 01994eb
>
> Diff: https://git.reviewboard.kde.org/r/123306/diff/
>
>
> Testing
> -------
>
> Tested with zooming in and out and two layers of texture as well as one. No change noticed (as intended).
>
>
> Thanks,
>
> Adam Dabrowski
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20150409/d6cd9afb/attachment.html>
More information about the Marble-devel
mailing list