QmlProfiler: refactored the event views into a single class

Change-Id: I4fd193490c42894da73951afcf50e40a44abaa07
Reviewed-on: http://codereview.qt.nokia.com/1019
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
Christiaan Janssen
2011-06-29 15:05:45 +02:00
parent c172e9ed65
commit c5d6bc49e5
13 changed files with 771 additions and 1146 deletions

View File

@@ -42,14 +42,14 @@ QmlProfilerTraceClient::QmlProfilerTraceClient(QDeclarativeDebugConnection *clie
: QDeclarativeDebugClient(QLatin1String("CanvasFrameRate"), client),
m_inProgressRanges(0), m_maximumTime(0), m_recording(false), m_nestingLevel(0)
{
::memset(m_rangeCount, 0, MaximumRangeType * sizeof(int));
::memset(m_nestingInType, 0, MaximumRangeType * sizeof(int));
::memset(m_rangeCount, 0, MaximumQmlEventType * sizeof(int));
::memset(m_nestingInType, 0, MaximumQmlEventType * sizeof(int));
}
void QmlProfilerTraceClient::clearView()
{
::memset(m_rangeCount, 0, MaximumRangeType * sizeof(int));
::memset(m_nestingInType, 0, MaximumRangeType * sizeof(int));
::memset(m_rangeCount, 0, MaximumQmlEventType * sizeof(int));
::memset(m_nestingInType, 0, MaximumQmlEventType * sizeof(int));
m_nestingLevel = 0;
emit clear();
}
@@ -111,7 +111,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
int range;
stream >> range;
if (range >= MaximumRangeType)
if (range >= MaximumQmlEventType)
return;
if (messageType == RangeStart) {
@@ -150,7 +150,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
Location location = m_rangeLocations[range].count() ? m_rangeLocations[range].pop() : Location();
qint64 startTime = m_rangeStartTimes[range].pop();
emit this->range((RangeType)range, m_nestingLevel, m_nestingInType[range], startTime,
emit this->range((QmlEventType)range, m_nestingLevel, m_nestingInType[range], startTime,
time - startTime, data, location.fileName, location.line);
--m_nestingLevel;
--m_nestingInType[range];