define for timing
authorGunnar Sletta <gunnar.sletta@nokia.com>
Mon, 1 Aug 2011 11:30:46 +0000 (13:30 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 1 Aug 2011 11:35:42 +0000 (13:35 +0200)
Change-Id: Id91e47be0c2706de7871f3492725c577063ae5fb
Reviewed-on: http://codereview.qt.nokia.com/2438
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp

index 2cd3db4..a1df05c 100644 (file)
@@ -1170,6 +1170,12 @@ void QSGDistanceFieldGlyphCache::updateCache()
     // ### Remove before final release
     static bool cacheDistanceFields = QApplication::arguments().contains("--cache-distance-fields");
 
+// #define QSGDISTANCEFIELDS_TIME_CREATION
+#ifdef QSGDISTANCEFIELDS_TIME_CREATION
+    QTime time;
+    time.start();
+#endif
+
     QString tmpPath = QString::fromLatin1("%1/.qt/").arg(QDir::tempPath());
     QString keyBase = QString::fromLatin1("%1%2%3_%4_%5_%6.fontblob")
             .arg(tmpPath)
@@ -1218,6 +1224,13 @@ void QSGDistanceFieldGlyphCache::updateCache()
             file.write((const char *) glyph.constBits(), glyph.width() * glyph.height());
         }
     }
+
+#ifdef QSGDISTANCEFIELDS_TIME_CREATION
+        static int totalTime;
+    totalTime += time.elapsed();
+    printf("time: %d\n", totalTime);
+#endif
+
     m_textureData->pendingGlyphs.reset();
 }