mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
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:
parent
f277b525c3
commit
31afa976f3
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue