2013-08-08 13:28:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-08-08 13:28:08 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-08-08 13:28:08 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-08-08 13:28:08 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-10-28 19:01:43 +01:00
|
|
|
#include "qmlprofilertimelinemodel.h"
|
2016-05-02 12:18:57 +02:00
|
|
|
#include "qmlprofilereventtypes.h"
|
2016-05-04 18:54:59 +02:00
|
|
|
#include "qmleventlocation.h"
|
2014-02-18 17:32:20 +01:00
|
|
|
#include "qmlprofilerdatamodel.h"
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2016-05-02 12:18:57 +02:00
|
|
|
#include <QVariantList>
|
|
|
|
|
#include <QColor>
|
|
|
|
|
#include <QObject>
|
2013-08-08 13:28:08 +02:00
|
|
|
|
|
|
|
|
namespace QmlProfiler {
|
|
|
|
|
class QmlProfilerModelManager;
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-10-28 19:01:43 +01:00
|
|
|
class QmlProfilerAnimationsModel : public QmlProfilerTimelineModel
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
struct QmlPaintEventData {
|
|
|
|
|
int framerate;
|
|
|
|
|
int animationcount;
|
2014-10-28 14:26:57 +01:00
|
|
|
int typeId;
|
2013-08-08 13:28:08 +02:00
|
|
|
};
|
|
|
|
|
|
2014-10-28 17:37:11 +01:00
|
|
|
QmlProfilerAnimationsModel(QmlProfilerModelManager *manager, QObject *parent = 0);
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2016-05-24 14:03:39 +02:00
|
|
|
int rowMaxValue(int rowNumber) const override;
|
2014-06-23 12:38:53 +02:00
|
|
|
|
2016-05-24 14:03:39 +02:00
|
|
|
int typeId(int index) const override;
|
|
|
|
|
Q_INVOKABLE int expandedRow(int index) const override;
|
|
|
|
|
Q_INVOKABLE int collapsedRow(int index) const override;
|
2014-02-14 16:20:13 +01:00
|
|
|
|
2016-05-24 14:03:39 +02:00
|
|
|
QColor color(int index) const override;
|
|
|
|
|
float relativeHeight(int index) const override;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2016-05-24 14:03:39 +02:00
|
|
|
QVariantList labels() const override;
|
|
|
|
|
QVariantMap details(int index) const override;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-09-11 11:12:47 +02:00
|
|
|
protected:
|
2016-04-26 13:23:35 +02:00
|
|
|
bool accepted(const QmlEventType &event) const override;
|
|
|
|
|
void loadEvent(const QmlEvent &event, const QmlEventType &type) override;
|
|
|
|
|
void finalize() override;
|
|
|
|
|
void clear() override;
|
2014-09-11 11:12:47 +02:00
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
private:
|
2014-10-28 10:57:32 +01:00
|
|
|
QVector<QmlProfilerAnimationsModel::QmlPaintEventData> m_data;
|
2016-04-26 13:23:35 +02:00
|
|
|
int m_maxGuiThreadAnimations = 0;
|
|
|
|
|
int m_maxRenderThreadAnimations = 0;
|
2016-05-24 09:28:58 +02:00
|
|
|
qint64 m_minNextStartTimes[2];
|
2016-04-26 13:23:35 +02:00
|
|
|
|
2014-10-28 14:26:57 +01:00
|
|
|
int rowFromThreadId(int threadId) const;
|
2013-08-08 13:28:08 +02:00
|
|
|
};
|
|
|
|
|
|
2016-04-28 16:02:54 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|