[Marble-devel] Re: Review Request: introduce optimized code path for Mercator projection

Bernhard Beschow bbeschow at cs.tu-berlin.de
Thu Dec 23 14:22:50 CET 2010



> On 2010-12-13 20:27:26, Torsten Rahn wrote:
> > /trunk/KDE/kdeedu/marble/src/lib/FastMercatorTextureMapper.cpp, line 76
> > <http://svn.reviewboard.kde.org/r/6109/diff/1/?file=42509#file42509line76>
> >
> >     waht happens if numTilesX or -Y or radius becomes 0 ? :)
> 
> Bernhard Beschow wrote:
>     That's not supposed to happen. :) I'll Q_ASSERT it.
> 
> Bernhard Beschow wrote:
>     I've now Q_ASSERTed it.
> 
> Torsten Rahn wrote:
>     Q_ASSERTs should only be used in a way that with debug mode disabled the code will still not crash if the situation is likely to occur. I think it's pretty likely that a radius of 0 or a numTilesX/Y value of 0 can possibly occur. So that case should get caught after the assert and in that case it just should bail out gracefully (by calling return without rendering anything).

The values for numTilesX/Y should always be greater than zero. Otherwise this implies that there are no textures, in which case instantiating the whole texture stack was pointless. Thus, the assertions for numTilesX/Y are primarily of documentatory purpose.

Since we currently only support textured map themes, the TextureLayer class is instantiated as a value in MarbleMap. This should of course change when we support plain vector maps or when the new LayerInterface is there.

As for the radius, it looks like Marble prevents the radius to become smaller than a certain value. But you're right, the radius might become zero in some corner cases, for which I added a return statement.


- Bernhard


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/6109/#review9241
-----------------------------------------------------------


On 2010-12-22 22:33:36, Bernhard Beschow wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/6109/
> -----------------------------------------------------------
> 
> (Updated 2010-12-22 22:33:36)
> 
> 
> Review request for marble.
> 
> 
> Summary
> -------
> 
> This patch introduces an optimized code path for the case that both the tile projection and the map projection are of type Mercator. In this very common case, the tiles can be scaled rather than reprojected, promising a significant speedup. Moreover, it seems to avoid crashes in high zoom levels on the N900.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h 1208706 
>   /trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp 1208706 
>   /trunk/KDE/kdeedu/marble/src/lib/CMakeLists.txt 1208706 
>   /trunk/KDE/kdeedu/marble/src/lib/TextureLayer.cpp 1208706 
>   /trunk/KDE/kdeedu/marble/src/lib/TileScalingTextureMapper.h PRE-CREATION 
>   /trunk/KDE/kdeedu/marble/src/lib/TileScalingTextureMapper.cpp PRE-CREATION 
> 
> Diff: http://svn.reviewboard.kde.org/r/6109/diff
> 
> 
> Testing
> -------
> 
> I have measured speedups of up to 2.7 on my system. This seems to depend on the QImage::Format, so format conversion should be avoided in a future version if possible.
> The image quality is roughly of outline quality when a discrete zoom level isn't hit.
> 
> I get crashes on my Netbook, but not on my other machine. The error message is: "QPaintDevice: Cannot destroy paint device that is being painted". I've got no idea what's going on here. Please help.
> 
> 
> Thanks,
> 
> Bernhard
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/marble-devel/attachments/20101223/4533934b/attachment.htm 


More information about the Marble-devel mailing list