[Marble-commits] branches/KDE/4.6/kdeedu/marble/src/lib

Bernhard Beschow bbeschow at cs.tu-berlin.de
Mon Jan 3 12:53:05 CET 2011


SVN commit 1211245 by beschow:

TileScalingTextureMapper: do not paint the background black if the map doesn't cover the whole viewport

* this code doesn't seem to be needed (tested visually)
* this code depended on the canvas image, which we want to get rid of for pixmap caching

 M  +1 -31     TileScalingTextureMapper.cpp  
 M  +0 -1      TileScalingTextureMapper.h  


--- branches/KDE/4.6/kdeedu/marble/src/lib/TileScalingTextureMapper.cpp #1211244:1211245
@@ -34,8 +34,7 @@
 TileScalingTextureMapper::TileScalingTextureMapper( StackedTileLoader *tileLoader,
                                                     QObject *parent )
     : AbstractScanlineTextureMapper( tileLoader, parent ),
-      m_repaintNeeded( true ),
-      m_oldYPaintedTop( 0 )
+      m_repaintNeeded( true )
 {
 }
 
@@ -119,35 +118,6 @@
 
     painter.end();
 
-    int yTop;
-    int yPaintedTop;
-    int yPaintedBottom;
-
-    // Calculate y-range the represented by the center point, yTop and
-    // what actually can be painted
-    yPaintedTop = yTop = (     - yNormalizedCenter ) * ( 4 * radius ) + imageHeight / 2;
-    yPaintedBottom    = ( 1.0 - yNormalizedCenter ) * ( 4 * radius ) + imageHeight / 2;
-
-    if (yPaintedTop < 0)                yPaintedTop = 0;
-    if (yPaintedTop > imageHeight)    yPaintedTop = imageHeight;
-    if (yPaintedBottom < 0)             yPaintedBottom = 0;
-    if (yPaintedBottom > imageHeight) yPaintedBottom = imageHeight;
-
-    // Remove unused lines
-    const int clearStart = ( yPaintedTop - m_oldYPaintedTop <= 0 ) ? yPaintedBottom : 0;
-    const int clearStop  = ( yPaintedTop - m_oldYPaintedTop <= 0 ) ? imageHeight  : yTop;
-
-    QRgb * const clearBegin = (QRgb*)( canvasImage->scanLine( clearStart ) );
-    QRgb * const clearEnd = (QRgb*)( canvasImage->scanLine( clearStop ) );
-
-    QRgb * it = clearBegin;
-
-    for ( ; it < clearEnd; ++it ) {
-        *(it) = 0;
-    }
-
-    m_oldYPaintedTop = yPaintedTop;
-
     m_tileLoader->cleanupTilehash();
 
     if ( texColorizer ) {
--- branches/KDE/4.6/kdeedu/marble/src/lib/TileScalingTextureMapper.h #1211244:1211245
@@ -37,7 +37,6 @@
 
  private:
     bool   m_repaintNeeded;
-    int m_oldYPaintedTop;
 };
 
 }


More information about the Marble-commits mailing list