[Marble-commits] KDE/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Thu Mar 31 17:31:03 CEST 2011
SVN commit 1226643 by beschow:
call StackedTile::initResultTile() only within StackedTileLoader::mergeDecorations()
Both methods were always called in a row, except for one occurrence, which seems to be a mistake.
At least I don't see a reason why StackedTileLoader::reloadTile() should deal with tile decorations differently than StackedTileLoader::loadTile().
Since StackedTileLoader::reloadTile() is only called for visible tiles in TextureLayer::reload(), d->m_tilesOnDisplay should contain every tile in question.
Therefore, the code path is never executed anyway.
M +5 -6 StackedTileLoader.cpp
--- trunk/KDE/kdeedu/marble/src/lib/StackedTileLoader.cpp #1226642:1226643
@@ -235,7 +235,6 @@
stackedTile = new StackedTile( stackedTileId, tiles );
d->m_tilesOnDisplay[ stackedTileId ] = stackedTile;
- stackedTile->initResultTile();
mergeDecorations( stackedTile );
return stackedTile;
@@ -285,7 +284,7 @@
StackedTile * const stackedTile = new StackedTile( stackedTileId, tiles );
d->m_tilesOnDisplay[ stackedTileId ] = stackedTile;
- stackedTile->initResultTile();
+ mergeDecorations( stackedTile );
return stackedTile;
}
@@ -401,14 +400,12 @@
StackedTile * const displayedTile = d->m_tilesOnDisplay.value( stackedTileId, 0 );
if ( displayedTile ) {
- displayedTile->initResultTile();
mergeDecorations( displayedTile );
emit tileUpdateAvailable( stackedTileId );
}
else {
StackedTile * const cachedTile = d->m_tileCache.object( stackedTileId );
if ( cachedTile ) {
- cachedTile->initResultTile();
mergeDecorations( cachedTile );
emit tileUpdateAvailable( stackedTileId );
}
@@ -448,11 +445,14 @@
void StackedTileLoader::mergeDecorations( StackedTile * const tile ) const
{
- Q_ASSERT( !tile->resultTile()->isNull() );
+ Q_ASSERT( tile != 0 );
+ Q_ASSERT( !tile->tiles()->isEmpty() );
Q_ASSERT( !d->m_textureLayers.isEmpty() );
// mDebug() << "MarbleModel::paintTile: " << "x: " << x << "y:" << y << "level: " << level
// << "requestTileUpdate" << requestTileUpdate;
+ tile->initResultTile();
+
d->m_layerDecorator.setInfo( tile->id() );
d->m_layerDecorator.setTile( tile->resultTile() );
@@ -472,7 +472,6 @@
for (; pos != end; ++pos ) {
d->m_tileLoader->reloadTile( *pos, usage );
}
- cachedTile->initResultTile();
mergeDecorations( cachedTile );
emit tileUpdateAvailable( cachedTile->id() );
}
More information about the Marble-commits
mailing list