Adapt to centralization of type data.

Change-Id: Ie2ad2f7ab326adb88334b3bd686cbde0f25f1a83
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-06-13 16:56:46 +02:00
parent 14babc5395
commit 71f04e35d7
3 changed files with 17 additions and 11 deletions

View File

@@ -159,11 +159,13 @@ void MemoryUsageModel::loadData()
qint64 currentUsage = 0; qint64 currentUsage = 0;
int currentUsageIndex = -1; int currentUsageIndex = -1;
int currentJSHeapIndex = -1; int currentJSHeapIndex = -1;
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes();
foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) {
if (!eventAccepted(event)) const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex];
if (!eventAccepted(type))
continue; continue;
if (event.detailType == QmlDebug::SmallItem || event.detailType == QmlDebug::LargeItem) { if (type.detailType == QmlDebug::SmallItem || type.detailType == QmlDebug::LargeItem) {
currentUsage += event.numericData1; currentUsage += event.numericData1;
MemoryAllocation allocation = { MemoryAllocation allocation = {
QmlDebug::SmallItem, QmlDebug::SmallItem,
@@ -177,10 +179,10 @@ void MemoryUsageModel::loadData()
currentUsageIndex = d->insertStart(event.startTime, allocation); currentUsageIndex = d->insertStart(event.startTime, allocation);
} }
if (event.detailType == QmlDebug::HeapPage || event.detailType == QmlDebug::LargeItem) { if (type.detailType == QmlDebug::HeapPage || type.detailType == QmlDebug::LargeItem) {
currentSize += event.numericData1; currentSize += event.numericData1;
MemoryAllocation allocation = { MemoryAllocation allocation = {
(QmlDebug::MemoryType)event.detailType, (QmlDebug::MemoryType)type.detailType,
currentSize, currentSize,
event.numericData1 event.numericData1
}; };

View File

@@ -272,17 +272,19 @@ void PixmapCacheModel::loadData()
int lastCacheSizeEvent = -1; int lastCacheSizeEvent = -1;
int cumulatedCount = 0; int cumulatedCount = 0;
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes();
foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) {
if (!eventAccepted(event)) const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex];
if (!eventAccepted(type))
continue; continue;
PixmapCacheEvent newEvent; PixmapCacheEvent newEvent;
newEvent.pixmapEventType = event.detailType; newEvent.pixmapEventType = type.detailType;
qint64 startTime = event.startTime; qint64 startTime = event.startTime;
newEvent.urlIndex = -1; newEvent.urlIndex = -1;
for (QVector<Pixmap>::const_iterator it(d->pixmaps.cend()); it != d->pixmaps.cbegin();) { for (QVector<Pixmap>::const_iterator it(d->pixmaps.cend()); it != d->pixmaps.cbegin();) {
if ((--it)->url == event.location.filename) { if ((--it)->url == type.location.filename) {
newEvent.urlIndex = it - d->pixmaps.cbegin(); newEvent.urlIndex = it - d->pixmaps.cbegin();
break; break;
} }
@@ -291,7 +293,7 @@ void PixmapCacheModel::loadData()
newEvent.sizeIndex = -1; newEvent.sizeIndex = -1;
if (newEvent.urlIndex == -1) { if (newEvent.urlIndex == -1) {
newEvent.urlIndex = d->pixmaps.count(); newEvent.urlIndex = d->pixmaps.count();
d->pixmaps << Pixmap(event.location.filename); d->pixmaps << Pixmap(type.location.filename);
} }
Pixmap &pixmap = d->pixmaps[newEvent.urlIndex]; Pixmap &pixmap = d->pixmaps[newEvent.urlIndex];

View File

@@ -200,11 +200,13 @@ void SceneGraphTimelineModel::loadData()
int lastRenderEvent = -1; int lastRenderEvent = -1;
// combine the data of several eventtypes into two rows // combine the data of several eventtypes into two rows
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes();
foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) {
if (!eventAccepted(event)) const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex];
if (!eventAccepted(type))
continue; continue;
if (event.detailType == SceneGraphRenderLoopFrame) { if (type.detailType == SceneGraphRenderLoopFrame) {
SceneGraphEvent newEvent; SceneGraphEvent newEvent;
newEvent.sgEventType = SceneGraphRenderThread; newEvent.sgEventType = SceneGraphRenderThread;
qint64 duration = event.numericData1 + event.numericData2 + event.numericData3; qint64 duration = event.numericData1 + event.numericData2 + event.numericData3;
@@ -219,7 +221,7 @@ void SceneGraphTimelineModel::loadData()
if (lastRenderEvent >= 0) { if (lastRenderEvent >= 0) {
qint64 *timing = d->data(lastRenderEvent).timing; qint64 *timing = d->data(lastRenderEvent).timing;
switch ((SceneGraphEventType)event.detailType) { switch ((SceneGraphEventType)type.detailType) {
case SceneGraphRendererFrame: { case SceneGraphRendererFrame: {
timing[1] = event.numericData1; timing[1] = event.numericData1;
timing[10] = event.numericData2; timing[10] = event.numericData2;