2013-06-11 15:13:33 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2013-06-20 12:34:02 +02:00
|
|
|
** Copyright (C) 2013 Digia Plc
|
|
|
|
|
** All rights reserved.
|
|
|
|
|
** For any questions to Digia, please use contact form at http://qt.digia.com <http://qt.digia.com/>
|
2013-06-11 15:13:33 +02:00
|
|
|
**
|
2013-06-20 12:34:02 +02:00
|
|
|
** This file is part of the Qt Enterprise Qt Quick Profiler Add-on.
|
2013-06-11 15:13:33 +02:00
|
|
|
**
|
2013-06-20 12:34:02 +02:00
|
|
|
** Licensees holding valid Qt Enterprise licenses may use this file in
|
|
|
|
|
** accordance with the Qt Enterprise License Agreement provided with the
|
2013-06-11 15:13:33 +02:00
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2013-06-20 12:34:02 +02:00
|
|
|
** a written agreement between you and Digia.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please use
|
|
|
|
|
** contact form at http://qt.digia.com <http://qt.digia.com/>
|
2013-06-11 15:13:33 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "scenegraphtimelinemodel.h"
|
|
|
|
|
#include "qmldebug/qmlprofilereventtypes.h"
|
|
|
|
|
#include "qmlprofiler/qmlprofilermodelmanager.h"
|
2013-12-06 15:38:22 +01:00
|
|
|
#include "qmlprofiler/sortedtimelinemodel.h"
|
2013-06-11 15:13:33 +02:00
|
|
|
|
2013-06-20 10:11:52 +02:00
|
|
|
#include <QCoreApplication>
|
2013-06-11 15:13:33 +02:00
|
|
|
#include <QDebug>
|
|
|
|
|
|
2013-06-24 14:17:43 +02:00
|
|
|
namespace QmlProfilerExtension {
|
2013-06-11 15:13:33 +02:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2013-08-12 11:44:35 +02:00
|
|
|
using namespace QmlProfiler;
|
2013-06-11 15:13:33 +02:00
|
|
|
|
|
|
|
|
enum SceneGraphEventType {
|
|
|
|
|
SceneGraphRendererFrame,
|
|
|
|
|
SceneGraphAdaptationLayerFrame,
|
|
|
|
|
SceneGraphContextFrame,
|
|
|
|
|
SceneGraphRenderLoopFrame,
|
|
|
|
|
SceneGraphTexturePrepare,
|
|
|
|
|
SceneGraphTextureDeletion,
|
|
|
|
|
SceneGraphPolishAndSync,
|
|
|
|
|
SceneGraphWindowsRenderShow,
|
|
|
|
|
SceneGraphWindowsAnimations,
|
|
|
|
|
SceneGraphWindowsPolishFrame,
|
|
|
|
|
|
|
|
|
|
MaximumSceneGraphFrameType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum SceneGraphCategoryType {
|
|
|
|
|
SceneGraphRenderThread,
|
|
|
|
|
SceneGraphGUIThread,
|
|
|
|
|
|
|
|
|
|
MaximumSceneGraphCategoryType
|
|
|
|
|
};
|
|
|
|
|
|
2013-12-06 15:38:22 +01:00
|
|
|
class SceneGraphTimelineModel::SceneGraphTimelineModelPrivate : public SortedTimelineModel<SceneGraphTimelineModel::SceneGraphEvent> {
|
2013-06-11 15:13:33 +02:00
|
|
|
public:
|
|
|
|
|
SceneGraphTimelineModelPrivate(SceneGraphTimelineModel *qq):q(qq) {}
|
|
|
|
|
~SceneGraphTimelineModelPrivate();
|
|
|
|
|
|
|
|
|
|
SceneGraphTimelineModel *q;
|
|
|
|
|
|
|
|
|
|
bool isExpanded;
|
|
|
|
|
QString displayTime(double time);
|
|
|
|
|
void addVP(QVariantList &l, QString label, qint64 time);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SceneGraphTimelineModel::SceneGraphTimelineModel(QObject *parent)
|
|
|
|
|
: AbstractTimelineModel(parent), d(new SceneGraphTimelineModelPrivate(this))
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SceneGraphTimelineModel::~SceneGraphTimelineModel()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString SceneGraphTimelineModel::name() const
|
|
|
|
|
{
|
|
|
|
|
return QLatin1String("SceneGraphTimeLineModel");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::count() const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->count();
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool SceneGraphTimelineModel::isEmpty() const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->count() == 0;
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
2013-08-12 11:44:35 +02:00
|
|
|
bool SceneGraphTimelineModel::eventAccepted(const QmlProfiler::QmlProfilerSimpleModel::QmlEventData &event) const
|
2013-06-11 15:13:33 +02:00
|
|
|
{
|
|
|
|
|
return (event.eventType == QmlDebug::SceneGraphFrameEvent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qint64 SceneGraphTimelineModel::lastTimeMark() const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->lastEndTime();
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
2013-07-25 17:29:22 +02:00
|
|
|
bool SceneGraphTimelineModel::expanded(int ) const
|
2013-07-15 16:54:50 +02:00
|
|
|
{
|
|
|
|
|
return d->isExpanded;
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-11 15:13:33 +02:00
|
|
|
void SceneGraphTimelineModel::setExpanded(int category, bool expanded)
|
|
|
|
|
{
|
2013-06-20 16:29:37 +02:00
|
|
|
Q_UNUSED(category);
|
|
|
|
|
d->isExpanded = expanded;
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::categoryDepth(int categoryIndex) const
|
|
|
|
|
{
|
2013-06-20 16:29:37 +02:00
|
|
|
Q_UNUSED(categoryIndex);
|
2013-06-11 15:13:33 +02:00
|
|
|
if (isEmpty())
|
|
|
|
|
return 1;
|
|
|
|
|
return 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::categoryCount() const
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString SceneGraphTimelineModel::categoryLabel(int categoryIndex) const
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(categoryIndex);
|
2013-06-18 16:06:12 +02:00
|
|
|
return tr("Scene Graph");
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::findFirstIndex(qint64 startTime) const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->findFirstIndex(startTime);
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::findFirstIndexNoParents(qint64 startTime) const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->findFirstIndexNoParents(startTime);
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::findLastIndex(qint64 endTime) const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->findLastIndex(endTime);
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::getEventType(int index) const
|
|
|
|
|
{
|
2013-06-20 16:29:37 +02:00
|
|
|
Q_UNUSED(index);
|
|
|
|
|
return QmlDebug::SceneGraphFrameEvent;
|
2013-06-14 15:46:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::getEventCategory(int index) const
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(index);
|
|
|
|
|
return 0;
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::getEventRow(int index) const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->range(index).sgEventType + 1;
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qint64 SceneGraphTimelineModel::getDuration(int index) const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->range(index).duration;
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qint64 SceneGraphTimelineModel::getStartTime(int index) const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->range(index).start;
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qint64 SceneGraphTimelineModel::getEndTime(int index) const
|
|
|
|
|
{
|
|
|
|
|
return getStartTime(index)+getDuration(index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::getEventId(int index) const
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
return d->range(index).sgEventType;
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QColor SceneGraphTimelineModel::getColor(int index) const
|
|
|
|
|
{
|
|
|
|
|
// get duration in seconds
|
|
|
|
|
double eventDuration = getDuration(index) / 1e9;
|
|
|
|
|
|
|
|
|
|
// supposedly never above 60 frames per second
|
|
|
|
|
// limit it in that case
|
|
|
|
|
if (eventDuration < 1/60.0)
|
|
|
|
|
eventDuration = 1/60.0;
|
|
|
|
|
|
|
|
|
|
// generate hue based on fraction of the 60fps
|
|
|
|
|
double fpsFraction = 1 / (eventDuration * 60.0);
|
|
|
|
|
if (fpsFraction > 1.0)
|
|
|
|
|
fpsFraction = 1.0;
|
|
|
|
|
return QColor::fromHsl((fpsFraction*96)+10, 76, 166);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float SceneGraphTimelineModel::getHeight(int index) const
|
|
|
|
|
{
|
2013-06-20 16:29:37 +02:00
|
|
|
Q_UNUSED(index);
|
2013-06-11 15:13:33 +02:00
|
|
|
return 1.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString labelForSGType(int t)
|
|
|
|
|
{
|
|
|
|
|
switch ((SceneGraphCategoryType)t) {
|
2013-06-18 16:06:12 +02:00
|
|
|
case SceneGraphRenderThread:
|
2013-06-20 10:11:52 +02:00
|
|
|
return QCoreApplication::translate("SceneGraphTimelineModel", "Renderer Thread");
|
2013-06-18 16:06:12 +02:00
|
|
|
case SceneGraphGUIThread:
|
2013-06-20 10:11:52 +02:00
|
|
|
return QCoreApplication::translate("SceneGraphTimelineModel", "GUI Thread");
|
2013-06-18 16:06:12 +02:00
|
|
|
default: return QString();
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QVariantList SceneGraphTimelineModel::getLabelsForCategory(int category) const
|
|
|
|
|
{
|
2013-06-20 16:29:37 +02:00
|
|
|
Q_UNUSED(category);
|
2013-06-11 15:13:33 +02:00
|
|
|
QVariantList result;
|
|
|
|
|
|
2013-06-13 13:05:14 +02:00
|
|
|
if (d->isExpanded && !isEmpty()) {
|
|
|
|
|
for (int i = 0; i < MaximumSceneGraphCategoryType; i++) {
|
|
|
|
|
QVariantMap element;
|
2013-06-18 16:06:12 +02:00
|
|
|
|
2013-06-13 13:05:14 +02:00
|
|
|
element.insert(QLatin1String("displayName"), QVariant(labelForSGType(i)));
|
|
|
|
|
element.insert(QLatin1String("description"), QVariant(labelForSGType(i)));
|
|
|
|
|
element.insert(QLatin1String("id"), QVariant(i));
|
|
|
|
|
result << element;
|
|
|
|
|
}
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString SceneGraphTimelineModel::SceneGraphTimelineModelPrivate::displayTime(double time)
|
|
|
|
|
{
|
|
|
|
|
if (time < 1e6)
|
|
|
|
|
return QString::number(time/1e3,'f',3) + trUtf8(" \xc2\xb5s");
|
|
|
|
|
if (time < 1e9)
|
|
|
|
|
return QString::number(time/1e6,'f',3) + tr(" ms");
|
|
|
|
|
|
|
|
|
|
return QString::number(time/1e9,'f',3) + tr(" s");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SceneGraphTimelineModel::SceneGraphTimelineModelPrivate::addVP(QVariantList &l, QString label, qint64 time)
|
|
|
|
|
{
|
|
|
|
|
if (time > 0) {
|
|
|
|
|
QVariantMap res;
|
|
|
|
|
res.insert(label, QVariant(displayTime(time)));
|
|
|
|
|
l << res;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QVariantList SceneGraphTimelineModel::getEventDetails(int index) const
|
|
|
|
|
{
|
|
|
|
|
QVariantList result;
|
2013-12-06 15:38:22 +01:00
|
|
|
const SortedTimelineModel<SceneGraphEvent>::Range *ev = &d->range(index);
|
2013-06-11 15:13:33 +02:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
QVariantMap res;
|
2013-06-14 15:51:53 +02:00
|
|
|
res.insert(QLatin1String("title"), QVariant(labelForSGType(ev->sgEventType)));
|
2013-06-11 15:13:33 +02:00
|
|
|
result << res;
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-14 15:50:55 +02:00
|
|
|
d->addVP(result, tr("Duration"), ev->duration );
|
2013-06-11 15:13:33 +02:00
|
|
|
|
|
|
|
|
if (ev->sgEventType == SceneGraphRenderThread) {
|
2013-06-14 15:50:55 +02:00
|
|
|
d->addVP(result, tr("Polish"), ev->timing[14]);
|
|
|
|
|
d->addVP(result, tr("Sync"), ev->timing[0]);
|
|
|
|
|
d->addVP(result, tr("Preprocess"), ev->timing[1]);
|
|
|
|
|
d->addVP(result, tr("Upload"), ev->timing[2]);
|
|
|
|
|
d->addVP(result, tr("Swizzle"), ev->timing[3]);
|
|
|
|
|
d->addVP(result, tr("Convert"), ev->timing[4]);
|
|
|
|
|
d->addVP(result, tr("Mipmap"), ev->timing[5]);
|
|
|
|
|
d->addVP(result, tr("Bind"), ev->timing[6]);
|
|
|
|
|
d->addVP(result, tr("Material"), ev->timing[7]);
|
|
|
|
|
d->addVP(result, tr("Glyph Render"), ev->timing[8]);
|
|
|
|
|
d->addVP(result, tr("Glyph Store"), ev->timing[9]);
|
|
|
|
|
d->addVP(result, tr("Update"), ev->timing[10]);
|
|
|
|
|
d->addVP(result, tr("Binding"), ev->timing[11]);
|
|
|
|
|
d->addVP(result, tr("Render"), ev->timing[12]);
|
|
|
|
|
d->addVP(result, tr("Swap"), ev->timing[13]);
|
|
|
|
|
d->addVP(result, tr("Animations"), ev->timing[15]);
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
if (ev->sgEventType == SceneGraphGUIThread) {
|
2013-06-14 15:50:55 +02:00
|
|
|
d->addVP(result, tr("Polish"), ev->timing[0]);
|
|
|
|
|
d->addVP(result, tr("Wait"), ev->timing[1]);
|
|
|
|
|
d->addVP(result, tr("Sync"), ev->timing[2]);
|
|
|
|
|
d->addVP(result, tr("Animations"), ev->timing[3]);
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-11 16:18:02 +02:00
|
|
|
const QVariantMap SceneGraphTimelineModel::getEventLocation(int /*index*/) const
|
|
|
|
|
{
|
|
|
|
|
QVariantMap map;
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-10 16:47:16 +02:00
|
|
|
int SceneGraphTimelineModel::getEventIdForHash(const QString &) const
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int SceneGraphTimelineModel::getEventIdForLocation(const QString &/*filename*/, int /*line*/, int /*column*/) const
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-11 15:13:33 +02:00
|
|
|
void SceneGraphTimelineModel::loadData()
|
|
|
|
|
{
|
|
|
|
|
clear();
|
|
|
|
|
QmlProfilerSimpleModel *simpleModel = m_modelManager->simpleModel();
|
|
|
|
|
if (simpleModel->isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
int lastRenderEvent = -1;
|
|
|
|
|
|
|
|
|
|
// combine the data of several eventtypes into two rows
|
|
|
|
|
foreach (const QmlProfilerSimpleModel::QmlEventData &event, simpleModel->getEvents()) {
|
|
|
|
|
if (!eventAccepted(event))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (event.bindingType == SceneGraphRenderLoopFrame) {
|
|
|
|
|
SceneGraphEvent newEvent;
|
|
|
|
|
newEvent.sgEventType = SceneGraphRenderThread;
|
2013-12-06 15:38:22 +01:00
|
|
|
qint64 duration = event.numericData1 + event.numericData2 + event.numericData3;
|
|
|
|
|
qint64 startTime = event.startTime - duration;
|
2013-06-11 15:13:33 +02:00
|
|
|
for (int i=0; i < timingFieldCount; i++)
|
|
|
|
|
newEvent.timing[i] = 0;
|
|
|
|
|
|
2013-08-07 15:46:15 +02:00
|
|
|
// Filter out events with incorrect timings due to interrupted thread on server side
|
2013-12-06 15:38:22 +01:00
|
|
|
if (duration > 0 && startTime > 0)
|
|
|
|
|
lastRenderEvent = d->insert(startTime, duration, newEvent);
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lastRenderEvent >= 0) {
|
2013-12-06 15:38:22 +01:00
|
|
|
qint64 *timing = d->data(lastRenderEvent).timing;
|
2013-06-11 15:13:33 +02:00
|
|
|
switch ((SceneGraphEventType)event.bindingType) {
|
|
|
|
|
case SceneGraphRendererFrame: {
|
2013-12-06 15:38:22 +01:00
|
|
|
timing[1] = event.numericData1;
|
|
|
|
|
timing[10] = event.numericData2;
|
|
|
|
|
timing[11] = event.numericData3;
|
|
|
|
|
timing[12] = event.numericData4;
|
2013-06-11 15:13:33 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SceneGraphAdaptationLayerFrame: {
|
2013-12-06 15:38:22 +01:00
|
|
|
timing[8] = event.numericData2;
|
|
|
|
|
timing[9] = event.numericData3;
|
2013-06-11 15:13:33 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SceneGraphContextFrame: {
|
2013-12-06 15:38:22 +01:00
|
|
|
timing[7] = event.numericData1;
|
2013-06-11 15:13:33 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SceneGraphRenderLoopFrame: {
|
2013-12-06 15:38:22 +01:00
|
|
|
timing[0] = event.numericData1;
|
|
|
|
|
timing[13] = event.numericData3;
|
2013-06-11 15:13:33 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SceneGraphTexturePrepare: {
|
2013-12-06 15:38:22 +01:00
|
|
|
timing[2] = event.numericData4;
|
|
|
|
|
timing[3] = event.numericData3;
|
|
|
|
|
timing[4] = event.numericData2;
|
|
|
|
|
timing[5] = event.numericData5;
|
|
|
|
|
timing[6] = event.numericData1;
|
2013-06-11 15:13:33 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SceneGraphPolishAndSync: {
|
|
|
|
|
// GUI thread
|
|
|
|
|
SceneGraphEvent newEvent;
|
|
|
|
|
newEvent.sgEventType = SceneGraphGUIThread;
|
2013-12-06 15:38:22 +01:00
|
|
|
qint64 duration = event.numericData1 + event.numericData2 + event.numericData3 + event.numericData4;
|
|
|
|
|
qint64 startTime = event.startTime - duration;
|
2013-06-11 15:13:33 +02:00
|
|
|
for (int i=0; i < timingFieldCount; i++)
|
|
|
|
|
newEvent.timing[i] = 0;
|
|
|
|
|
|
|
|
|
|
newEvent.timing[0] = event.numericData1;
|
|
|
|
|
newEvent.timing[1] = event.numericData2;
|
|
|
|
|
newEvent.timing[2] = event.numericData3;
|
|
|
|
|
newEvent.timing[3] = event.numericData4;
|
|
|
|
|
|
2013-08-07 15:46:15 +02:00
|
|
|
// Filter out events with incorrect timings due to interrupted thread on server side
|
2013-12-06 15:38:22 +01:00
|
|
|
if (duration > 0 && startTime > 0)
|
|
|
|
|
d->insert(startTime, duration, newEvent);
|
2013-08-07 15:46:15 +02:00
|
|
|
|
2013-06-11 15:13:33 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SceneGraphWindowsAnimations: {
|
2013-12-06 15:38:22 +01:00
|
|
|
timing[14] = event.numericData1;
|
2013-06-11 15:13:33 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SceneGraphWindowsPolishFrame: {
|
2013-12-06 15:38:22 +01:00
|
|
|
timing[15] = event.numericData1;
|
2013-06-11 15:13:33 +02:00
|
|
|
break;
|
|
|
|
|
}
|
2013-06-20 16:29:37 +02:00
|
|
|
default: break;
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
}
|
2013-07-25 17:29:22 +02:00
|
|
|
|
2013-12-06 15:38:22 +01:00
|
|
|
m_modelManager->modelProxyCountUpdated(m_modelId, d->count(), simpleModel->getEvents().count());
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
2013-12-06 15:38:22 +01:00
|
|
|
d->computeNesting();
|
2013-07-25 17:29:22 +02:00
|
|
|
m_modelManager->modelProxyCountUpdated(m_modelId, 1, 1);
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SceneGraphTimelineModel::clear()
|
|
|
|
|
{
|
2013-12-06 15:38:22 +01:00
|
|
|
d->clear();
|
2013-07-15 16:54:50 +02:00
|
|
|
d->isExpanded = false;
|
2013-07-25 17:29:22 +02:00
|
|
|
m_modelManager->modelProxyCountUpdated(m_modelId, 0, 1);
|
2013-06-11 15:13:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
2013-06-24 14:17:43 +02:00
|
|
|
} // namespace QmlProfilerExtension
|