forked from qt-creator/qt-creator
QmlProfiler: Rename Qt5 "Painting" to "Animations" and always show it
"Animations" is a much better name as that's what it actually shows. It also serves to distinguish from the QtQuick 1 only "Painting" category that really does show the time QPainter took to paint the scene. Hiding the "Animations" category when profiling QtQuick 1 makes no sense as we also don't hide the JavaScript category or any of the commercial addons which are only available from QtQuick 2. As QtQuick 1 is deprecated we keep hiding the Painting category when profiling QtQuick 2 to reduce clutter in the UI for the more common case. Change-Id: I0e14fab8abf427dc1abb6d00874e7e4af0fa30e5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -54,7 +54,6 @@ public:
|
||||
|
||||
int maxGuiThreadAnimations;
|
||||
int maxRenderThreadAnimations;
|
||||
bool seenForeignPaintEvent;
|
||||
int rowFromThreadId(QmlDebug::AnimationThread threadId) const;
|
||||
|
||||
private:
|
||||
@@ -63,11 +62,10 @@ private:
|
||||
|
||||
PaintEventsModelProxy::PaintEventsModelProxy(QObject *parent)
|
||||
: AbstractTimelineModel(new PaintEventsModelProxyPrivate,
|
||||
QLatin1String("PaintEventsModelProxy"), tr("Painting"),
|
||||
QLatin1String("PaintEventsModelProxy"), tr("Animations"),
|
||||
QmlDebug::Event, QmlDebug::MaximumRangeType, parent)
|
||||
{
|
||||
Q_D(PaintEventsModelProxy);
|
||||
d->seenForeignPaintEvent = false;
|
||||
d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0;
|
||||
}
|
||||
|
||||
@@ -78,7 +76,6 @@ void PaintEventsModelProxy::clear()
|
||||
d->clear();
|
||||
d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0;
|
||||
d->expanded = false;
|
||||
d->seenForeignPaintEvent = false;
|
||||
d->modelManager->modelProxyCountUpdated(d->modelId, 0, 1);
|
||||
}
|
||||
|
||||
@@ -105,11 +102,8 @@ void PaintEventsModelProxy::loadData()
|
||||
|
||||
foreach (const QmlProfilerDataModel::QmlEventData &event, referenceList) {
|
||||
const QmlProfilerDataModel::QmlEventTypeData &type = typeList[event.typeIndex];
|
||||
if (!eventAccepted(type)) {
|
||||
if (type.rangeType == QmlDebug::Painting)
|
||||
d->seenForeignPaintEvent = true;
|
||||
if (!eventAccepted(type))
|
||||
continue;
|
||||
}
|
||||
|
||||
lastEvent.threadId = (QmlDebug::AnimationThread)event.numericData3;
|
||||
|
||||
@@ -156,7 +150,7 @@ int PaintEventsModelProxy::rowCount() const
|
||||
{
|
||||
Q_D(const PaintEventsModelProxy);
|
||||
if (isEmpty())
|
||||
return d->seenForeignPaintEvent ? 0 : 1;
|
||||
return 1;
|
||||
else
|
||||
return (d->maxGuiThreadAnimations == 0 || d->maxRenderThreadAnimations == 0) ? 2 : 3;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user