forked from qt-creator/qt-creator
Adapt to merging of AbstractTimelineModel and SortedTimelineModel
Change-Id: I13cbcf98934daef075080a8bf27d505a673103cf Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -46,7 +46,7 @@ quint64 InputEventsModel::features() const
|
|||||||
int InputEventsModel::selectionId(int index) const
|
int InputEventsModel::selectionId(int index) const
|
||||||
{
|
{
|
||||||
Q_D(const InputEventsModel);
|
Q_D(const InputEventsModel);
|
||||||
return d->modelManager->qmlModel()->getEventTypes()[range(index).typeId].detailType;
|
return d->modelManager->qmlModel()->getEventTypes()[typeId(index)].detailType;
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor InputEventsModel::color(int index) const
|
QColor InputEventsModel::color(int index) const
|
||||||
|
@@ -206,7 +206,7 @@ void MemoryUsageModel::loadData()
|
|||||||
MemoryAllocation &last = currentUsageIndex > -1 ? d->data[currentUsageIndex] : dummy;
|
MemoryAllocation &last = currentUsageIndex > -1 ? d->data[currentUsageIndex] : dummy;
|
||||||
if (!rangeStack.empty() && type.detailType == last.type &&
|
if (!rangeStack.empty() && type.detailType == last.type &&
|
||||||
last.originTypeIndex == rangeStack.top().originTypeIndex &&
|
last.originTypeIndex == rangeStack.top().originTypeIndex &&
|
||||||
rangeStack.top().startTime < range(currentUsageIndex).start) {
|
rangeStack.top().startTime < startTime(currentUsageIndex)) {
|
||||||
last.update(event.numericData1);
|
last.update(event.numericData1);
|
||||||
currentUsage = last.size;
|
currentUsage = last.size;
|
||||||
} else {
|
} else {
|
||||||
@@ -217,7 +217,7 @@ void MemoryUsageModel::loadData()
|
|||||||
|
|
||||||
if (currentUsageIndex != -1) {
|
if (currentUsageIndex != -1) {
|
||||||
insertEnd(currentUsageIndex,
|
insertEnd(currentUsageIndex,
|
||||||
event.startTime - range(currentUsageIndex).start - 1);
|
event.startTime - startTime(currentUsageIndex) - 1);
|
||||||
}
|
}
|
||||||
currentUsageIndex = insertStart(event.startTime, event.typeIndex);
|
currentUsageIndex = insertStart(event.startTime, event.typeIndex);
|
||||||
d->data.insert(currentUsageIndex, allocation);
|
d->data.insert(currentUsageIndex, allocation);
|
||||||
@@ -228,7 +228,7 @@ void MemoryUsageModel::loadData()
|
|||||||
MemoryAllocation &last = currentJSHeapIndex > -1 ? d->data[currentJSHeapIndex] : dummy;
|
MemoryAllocation &last = currentJSHeapIndex > -1 ? d->data[currentJSHeapIndex] : dummy;
|
||||||
if (!rangeStack.empty() && type.detailType == last.type &&
|
if (!rangeStack.empty() && type.detailType == last.type &&
|
||||||
last.originTypeIndex == rangeStack.top().originTypeIndex &&
|
last.originTypeIndex == rangeStack.top().originTypeIndex &&
|
||||||
rangeStack.top().startTime < range(currentJSHeapIndex).start) {
|
rangeStack.top().startTime < startTime(currentJSHeapIndex)) {
|
||||||
last.update(event.numericData1);
|
last.update(event.numericData1);
|
||||||
currentSize = last.size;
|
currentSize = last.size;
|
||||||
} else {
|
} else {
|
||||||
@@ -241,7 +241,7 @@ void MemoryUsageModel::loadData()
|
|||||||
d->maxSize = currentSize;
|
d->maxSize = currentSize;
|
||||||
if (currentJSHeapIndex != -1)
|
if (currentJSHeapIndex != -1)
|
||||||
insertEnd(currentJSHeapIndex,
|
insertEnd(currentJSHeapIndex,
|
||||||
event.startTime - range(currentJSHeapIndex).start - 1);
|
event.startTime - startTime(currentJSHeapIndex) - 1);
|
||||||
currentJSHeapIndex = insertStart(event.startTime, event.typeIndex);
|
currentJSHeapIndex = insertStart(event.startTime, event.typeIndex);
|
||||||
d->data.insert(currentJSHeapIndex, allocation);
|
d->data.insert(currentJSHeapIndex, allocation);
|
||||||
}
|
}
|
||||||
@@ -253,10 +253,10 @@ void MemoryUsageModel::loadData()
|
|||||||
|
|
||||||
if (currentJSHeapIndex != -1)
|
if (currentJSHeapIndex != -1)
|
||||||
insertEnd(currentJSHeapIndex, d->modelManager->traceTime()->endTime() -
|
insertEnd(currentJSHeapIndex, d->modelManager->traceTime()->endTime() -
|
||||||
range(currentJSHeapIndex).start - 1);
|
startTime(currentJSHeapIndex) - 1);
|
||||||
if (currentUsageIndex != -1)
|
if (currentUsageIndex != -1)
|
||||||
insertEnd(currentUsageIndex, d->modelManager->traceTime()->endTime() -
|
insertEnd(currentUsageIndex, d->modelManager->traceTime()->endTime() -
|
||||||
range(currentUsageIndex).start - 1);
|
startTime(currentUsageIndex) - 1);
|
||||||
|
|
||||||
|
|
||||||
computeNesting();
|
computeNesting();
|
||||||
|
@@ -187,7 +187,7 @@ QVariantMap PixmapCacheModel::details(int index) const
|
|||||||
if (d->pixmaps[ev->urlIndex].sizes[ev->sizeIndex].loadState != Finished)
|
if (d->pixmaps[ev->urlIndex].sizes[ev->sizeIndex].loadState != Finished)
|
||||||
result.insert(tr("Result"), tr("Load Error"));
|
result.insert(tr("Result"), tr("Load Error"));
|
||||||
}
|
}
|
||||||
result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(range(index).duration));
|
result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(duration(index)));
|
||||||
}
|
}
|
||||||
|
|
||||||
result.insert(tr("Cache Size"), QString::fromLatin1("%1 px").arg(ev->cacheSize));
|
result.insert(tr("Cache Size"), QString::fromLatin1("%1 px").arg(ev->cacheSize));
|
||||||
@@ -248,7 +248,7 @@ void PixmapCacheModel::loadData()
|
|||||||
|
|
||||||
PixmapCacheEvent newEvent;
|
PixmapCacheEvent newEvent;
|
||||||
newEvent.pixmapEventType = type.detailType;
|
newEvent.pixmapEventType = type.detailType;
|
||||||
qint64 startTime = event.startTime;
|
qint64 pixmapStartTime = 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();) {
|
||||||
@@ -290,7 +290,7 @@ void PixmapCacheModel::loadData()
|
|||||||
|
|
||||||
PixmapState &state = pixmap.sizes[newEvent.sizeIndex];
|
PixmapState &state = pixmap.sizes[newEvent.sizeIndex];
|
||||||
if (state.cacheState == ToBeCached) {
|
if (state.cacheState == ToBeCached) {
|
||||||
lastCacheSizeEvent = d->updateCacheCount(lastCacheSizeEvent, startTime,
|
lastCacheSizeEvent = d->updateCacheCount(lastCacheSizeEvent, pixmapStartTime,
|
||||||
state.size.width() * state.size.height(), newEvent,
|
state.size.width() * state.size.height(), newEvent,
|
||||||
event.typeIndex);
|
event.typeIndex);
|
||||||
state.cacheState = Cached;
|
state.cacheState = Cached;
|
||||||
@@ -298,7 +298,7 @@ void PixmapCacheModel::loadData()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PixmapCacheCountChanged: {// Cache Size Changed Event
|
case PixmapCacheCountChanged: {// Cache Size Changed Event
|
||||||
startTime = event.startTime + 1; // delay 1 ns for proper sorting
|
pixmapStartTime = event.startTime + 1; // delay 1 ns for proper sorting
|
||||||
|
|
||||||
bool uncache = cumulatedCount > event.numericData3;
|
bool uncache = cumulatedCount > event.numericData3;
|
||||||
cumulatedCount = event.numericData3;
|
cumulatedCount = event.numericData3;
|
||||||
@@ -351,7 +351,7 @@ void PixmapCacheModel::loadData()
|
|||||||
pixmap.sizes << PixmapState(uncache ? Uncached : ToBeCached);
|
pixmap.sizes << PixmapState(uncache ? Uncached : ToBeCached);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastCacheSizeEvent = d->updateCacheCount(lastCacheSizeEvent, startTime, pixSize,
|
lastCacheSizeEvent = d->updateCacheCount(lastCacheSizeEvent, pixmapStartTime, pixSize,
|
||||||
newEvent, event.typeIndex);
|
newEvent, event.typeIndex);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -372,7 +372,7 @@ void PixmapCacheModel::loadData()
|
|||||||
|
|
||||||
PixmapState &state = pixmap.sizes[newEvent.sizeIndex];
|
PixmapState &state = pixmap.sizes[newEvent.sizeIndex];
|
||||||
state.loadState = Loading;
|
state.loadState = Loading;
|
||||||
state.started = insertStart(startTime, event.typeIndex);
|
state.started = insertStart(pixmapStartTime, event.typeIndex);
|
||||||
d->data.insert(state.started, newEvent);
|
d->data.insert(state.started, newEvent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -416,7 +416,7 @@ void PixmapCacheModel::loadData()
|
|||||||
// If the pixmap loading wasn't started, start it at traceStartTime()
|
// If the pixmap loading wasn't started, start it at traceStartTime()
|
||||||
if (state.loadState == Initial) {
|
if (state.loadState == Initial) {
|
||||||
newEvent.pixmapEventType = PixmapLoadingStarted;
|
newEvent.pixmapEventType = PixmapLoadingStarted;
|
||||||
state.started = insert(d->modelManager->traceTime()->startTime(), startTime -
|
state.started = insert(d->modelManager->traceTime()->startTime(), pixmapStartTime -
|
||||||
d->modelManager->traceTime()->startTime(), event.typeIndex);
|
d->modelManager->traceTime()->startTime(), event.typeIndex);
|
||||||
d->data.insert(state.started, newEvent);
|
d->data.insert(state.started, newEvent);
|
||||||
|
|
||||||
@@ -436,7 +436,7 @@ void PixmapCacheModel::loadData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
insertEnd(state.started, startTime - range(state.started).start);
|
insertEnd(state.started, pixmapStartTime - startTime(state.started));
|
||||||
if (newEvent.pixmapEventType == PixmapLoadingError) {
|
if (newEvent.pixmapEventType == PixmapLoadingError) {
|
||||||
state.loadState = Error;
|
state.loadState = Error;
|
||||||
switch (state.cacheState) {
|
switch (state.cacheState) {
|
||||||
@@ -467,7 +467,7 @@ void PixmapCacheModel::loadData()
|
|||||||
|
|
||||||
if (lastCacheSizeEvent != -1)
|
if (lastCacheSizeEvent != -1)
|
||||||
insertEnd(lastCacheSizeEvent, d->modelManager->traceTime()->endTime() -
|
insertEnd(lastCacheSizeEvent, d->modelManager->traceTime()->endTime() -
|
||||||
range(lastCacheSizeEvent).start);
|
startTime(lastCacheSizeEvent));
|
||||||
|
|
||||||
d->resizeUnfinishedLoads();
|
d->resizeUnfinishedLoads();
|
||||||
|
|
||||||
@@ -504,8 +504,8 @@ void PixmapCacheModel::PixmapCacheModelPrivate::resizeUnfinishedLoads()
|
|||||||
// all the "load start" events with duration 0 continue till the end of the trace
|
// all the "load start" events with duration 0 continue till the end of the trace
|
||||||
for (int i = 0; i < q->count(); i++) {
|
for (int i = 0; i < q->count(); i++) {
|
||||||
if (data[i].pixmapEventType == PixmapCacheModel::PixmapLoadingStarted &&
|
if (data[i].pixmapEventType == PixmapCacheModel::PixmapLoadingStarted &&
|
||||||
q->range(i).duration == 0) {
|
ranges[i].duration == 0) {
|
||||||
q->insertEnd(i, modelManager->traceTime()->endTime() - q->range(i).start);
|
q->insertEnd(i, modelManager->traceTime()->endTime() - ranges[i].start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -519,7 +519,7 @@ void PixmapCacheModel::PixmapCacheModelPrivate::flattenLoads()
|
|||||||
QVector <qint64> eventEndTimes;
|
QVector <qint64> eventEndTimes;
|
||||||
for (int i = 0; i < q->count(); i++) {
|
for (int i = 0; i < q->count(); i++) {
|
||||||
PixmapCacheModel::PixmapCacheEvent &event = data[i];
|
PixmapCacheModel::PixmapCacheEvent &event = data[i];
|
||||||
const Range &start = q->range(i);
|
const Range &start = ranges[i];
|
||||||
if (event.pixmapEventType == PixmapCacheModel::PixmapLoadingStarted) {
|
if (event.pixmapEventType == PixmapCacheModel::PixmapLoadingStarted) {
|
||||||
event.rowNumberCollapsed = 0;
|
event.rowNumberCollapsed = 0;
|
||||||
while (eventEndTimes.count() > event.rowNumberCollapsed &&
|
while (eventEndTimes.count() > event.rowNumberCollapsed &&
|
||||||
@@ -552,7 +552,7 @@ int PixmapCacheModel::PixmapCacheModelPrivate::updateCacheCount(int lastCacheSiz
|
|||||||
qint64 prevSize = 0;
|
qint64 prevSize = 0;
|
||||||
if (lastCacheSizeEvent != -1) {
|
if (lastCacheSizeEvent != -1) {
|
||||||
prevSize = data[lastCacheSizeEvent].cacheSize;
|
prevSize = data[lastCacheSizeEvent].cacheSize;
|
||||||
q->insertEnd(lastCacheSizeEvent, startTime - q->range(lastCacheSizeEvent).start);
|
q->insertEnd(lastCacheSizeEvent, startTime - ranges[lastCacheSizeEvent].start);
|
||||||
}
|
}
|
||||||
|
|
||||||
newEvent.cacheSize = prevSize + pixSize;
|
newEvent.cacheSize = prevSize + pixSize;
|
||||||
|
@@ -178,7 +178,7 @@ QVariantMap SceneGraphTimelineModel::details(int index) const
|
|||||||
result.insert(QLatin1String("displayName"),
|
result.insert(QLatin1String("displayName"),
|
||||||
tr(d->threadLabel(static_cast<SceneGraphStage>(ev->stage))));
|
tr(d->threadLabel(static_cast<SceneGraphStage>(ev->stage))));
|
||||||
result.insert(tr("Stage"), tr(StageLabels[ev->stage]));
|
result.insert(tr("Stage"), tr(StageLabels[ev->stage]));
|
||||||
result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(range(index).duration));
|
result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(duration(index)));
|
||||||
if (ev->glyphCount >= 0)
|
if (ev->glyphCount >= 0)
|
||||||
result.insert(tr("Glyphs"), QString::number(ev->glyphCount));
|
result.insert(tr("Glyphs"), QString::number(ev->glyphCount));
|
||||||
|
|
||||||
@@ -296,7 +296,7 @@ void SceneGraphTimelineModel::SceneGraphTimelineModelPrivate::flattenLoads()
|
|||||||
|
|
||||||
for (int i = 0; i < q->count(); i++) {
|
for (int i = 0; i < q->count(); i++) {
|
||||||
SceneGraphEvent &event = data[i];
|
SceneGraphEvent &event = data[i];
|
||||||
const Range &start = q->range(i);
|
const Range &start = ranges[i];
|
||||||
// Don't try to put render thread events in GUI row and vice versa.
|
// Don't try to put render thread events in GUI row and vice versa.
|
||||||
// Rows below those are free for all.
|
// Rows below those are free for all.
|
||||||
if (event.stage < MaximumGUIThreadStage)
|
if (event.stage < MaximumGUIThreadStage)
|
||||||
|
Reference in New Issue
Block a user