Speakerlist was taking a ridiculous amount of frame time when displaying large groups.

This commit is contained in:
Shyotl
2018-02-13 23:06:41 -06:00
parent 410d2a83a2
commit c77699dcd5
7 changed files with 302 additions and 188 deletions

View File

@@ -502,12 +502,14 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r
case ADD_SORTED:
{
// sort by column 0, in ascending order
std::vector<sort_column_t> single_sort_column;
single_sort_column.push_back(std::make_pair(0, TRUE));
mItemList.push_back(item);
std::stable_sort(mItemList.begin(), mItemList.end(), SortScrollListItem(single_sort_column,mSortCallback));
// std::stable_sort is expensive. Only do this if the user sort criteria is not column 0, otherwise
// setNeedsSort does what we want.
if (mSortColumns.empty() || mSortColumns[0].first != 0)
{
// sort by column 0, in ascending order
std::stable_sort(mItemList.begin(), mItemList.end(), SortScrollListItem({ {0,true} }, mSortCallback));
}
// ADD_SORTED just sorts by first column...
// this might not match user sort criteria, so flag list as being in unsorted state

View File

@@ -369,6 +369,7 @@ public:
return mSortCallback->connect(cb);
}
S32 getLinesPerPage();
protected:
// "Full" interface: use this when you're creating a list that has one or more of the following:
@@ -405,7 +406,6 @@ private:
void deselectItem(LLScrollListItem* itemp);
void commitIfChanged();
BOOL setSort(S32 column, BOOL ascending);
S32 getLinesPerPage();
S32 mLineHeight; // the max height of a single line
S32 mScrollLines; // how many lines we've scrolled down