[Kstars-devel] KDE/kdeedu/kstars/kstars/skycomponents

James Bowlin bowlin at mindspring.com
Wed Aug 22 04:47:44 CEST 2007


SVN commit 703134 by jbowlin:

Further reduced the HTM mesh level from 4 down to 3 which has further
improved the drawing speed when zoomed out.  A level-3 mesh has 512
trixels total down from 2048 for level-4 and 8192 for level-5.

Fixed a bug in deciding when to calculate the no-precess aperture
which caused the equator to sometimes not get displayed.

Added timing code in SkyMapComposite::draw() to time the entire draw
cycle.  Uncomment line 293 to get the times to print out:

//kDebug() << QString("draw took %1 ms").arg( t.elapsed() ) << endl;

I discovered that the anti-aliased drawing can take about ten times
longer than the integer drawing.  It is important to turn the
anti-aliasing off in order to test the timing of the rest of the
system.

I can now draw a reasonable skymap, fully zoomed out, with star
labels in about 50 ms.  This increases to about 100 ms when I
include the solar system and asteroid labels.  This then jumps
to about 600 ms if I turn the anti-aliasing on.

CCMAIL:kstars-devel at kde.org


 M  +7 -3      skymapcomposite.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skymapcomposite.cpp #703133:703134
@@ -52,7 +52,7 @@
 {
     m_skyLabeler = SkyLabeler::Instance();
 
-    m_skyMesh = SkyMesh::Create( data, 4 );  // level 5 mesh = 8192 trixels
+    m_skyMesh = SkyMesh::Create( data, 3 );  // level 5 mesh = 8192 trixels
 
     m_skyMesh->debug( 0 );               //  1 => print "indexing ..."
                                          //  2 => prints totals too
@@ -167,6 +167,8 @@
 //should appear "behind" others should be drawn first.
 void SkyMapComposite::draw(KStars *ks, QPainter& psky, double scale)
 {
+	QTime t;
+	t.start();
     m_map = ks->map();
 
 	// We delay one draw cycle before re-indexing
@@ -194,8 +196,8 @@
     m_skyMesh->aperture( focus, radius + 1.0, DRAW_BUF ); // divide by 2 for testing
 
 	// create the no-precess aperture only if needed
-    if ( Options::showGrid() || Options::showCBounds() || 
-			Options::showEquator() && ! m_skyMesh->isZoomedIn() ) {
+    if ( ( Options::showGrid() || Options::showCBounds() || 
+			Options::showEquator() ) && m_skyMesh->isZoomedIn() ) {
 
         m_skyMesh->index( focus, radius + 1.0, NO_PRECESS_BUF );
     }
@@ -288,6 +290,8 @@
 
 	m_skyMesh->inDraw( false );
 
+	//kDebug() << QString("draw took %1 ms").arg( t.elapsed() ) << endl;
+
     // -jbb uncomment these to see trixel outlines:
 	//
     //psky.setPen(  QPen( QBrush( QColor( "yellow" ) ), 1, Qt::SolidLine ) );


More information about the Kstars-devel mailing list