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>
This commit is contained in:
Dirk Hohndel 2020-02-17 10:45:28 -08:00
parent f277b525c3
commit 31afa976f3

View file

@ -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)