summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-02-17 10:45:28 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-02-18 07:34:46 -0800
commit31afa976f3a6425b0cf8cdc77978c4156b726304 (patch)
tree3e70a646bfbc1f3826996feb791ad966c9dc7c6d
parentf277b525c37bb131910140a19d82ed31053fc0e9 (diff)
downloadsubsurface-31afa976f3a6425b0cf8cdc77978c4156b726304.tar.gz
mobile/profile: add elapsed time reporting for profile rendering
In verbose mode we log how long it took us to render the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--profile-widget/qmlprofile.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/profile-widget/qmlprofile.cpp b/profile-widget/qmlprofile.cpp
index e77b4d20c..f1012aca4 100644
--- a/profile-widget/qmlprofile.cpp
+++ b/profile-widget/qmlprofile.cpp
@@ -6,6 +6,7 @@
#include "core/metrics.h"
#include <QTransform>
#include <QScreen>
+#include <QElapsedTimer>
QMLProfile::QMLProfile(QQuickItem *parent) :
QQuickPaintedItem(parent),
@@ -23,6 +24,10 @@ QMLProfile::QMLProfile(QQuickItem *parent) :
void QMLProfile::paint(QPainter *painter)
{
+ QElapsedTimer timer;
+ if (verbose)
+ timer.start();
+
// let's look at the intended size of the content and scale our scene accordingly
QRect painterRect = painter->viewport();
QRect profileRect = m_profileWidget->viewport()->rect();
@@ -73,6 +78,8 @@ void QMLProfile::paint(QPainter *painter)
// finally, render the profile
m_profileWidget->render(painter);
+ if (verbose)
+ qDebug() << "finished rendering profile in" << timer.elapsed() << "ms";
}
void QMLProfile::setMargin(int margin)