Timeline: Use QRgb and a lookup table for colors

It makes no sense to return a QColor as the only things we are using
are the red, green, and blue components. Furthermore, colorFromHue()
can only generate 360 different colors which we can easily cache
instead of recalculating them on each request.

This significantly reduces the time it takes to update the timeline
render nodes.

Change-Id: I7961014364a1bec5b089285148b2e6c141a6dc7d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2016-11-08 18:11:36 +01:00
parent aaca50f705
commit faf77fd0e5
18 changed files with 46 additions and 29 deletions

View File

@@ -180,7 +180,7 @@ int QmlProfilerRangeModel::bindingLoopDest(int index) const
return m_data[index].bindingLoopHead;
}
QColor QmlProfilerRangeModel::color(int index) const
QRgb QmlProfilerRangeModel::color(int index) const
{
return colorBySelectionId(index);
}