diff options
author | Richard Linden <none@none> | 2013-01-24 19:53:17 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2013-01-24 19:53:17 -0800 |
commit | 3a555a2ff84d9b340e33673d7a03f37c966f06e6 (patch) | |
tree | 4e4129ad9a7c78c6c1543fa3b9d57561d93df380 /indra/newview/llfasttimerview.cpp | |
parent | 096b2738c2213281b463d0de093c08a406f53946 (diff) |
SH-3275 WIP interesting Update viewer metrics system to be more flexible
removed LLFastTimerView::getFrameTimer()
dead code elimination
fixed off by one array access crash
Diffstat (limited to 'indra/newview/llfasttimerview.cpp')
-rw-r--r-- | indra/newview/llfasttimerview.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 59a52fdaea..7858378f00 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -107,7 +107,7 @@ LLFastTimerView::LLFastTimerView(const LLSD& key) mRecording(&get_frame_recording()), mPauseHistory(false) { - mBarRects = new std::vector<LLRect>[MAX_VISIBLE_HISTORY]; + mBarRects = new std::vector<LLRect>[MAX_VISIBLE_HISTORY + 1]; } LLFastTimerView::~LLFastTimerView() @@ -189,7 +189,7 @@ TimeBlock* LLFastTimerView::getLegendID(S32 y) BOOL LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask) { - for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != end_timer_tree(); ++it) { @@ -277,7 +277,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) } S32 i = 0; - for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != end_timer_tree(); ++it, ++i) { @@ -412,7 +412,7 @@ void LLFastTimerView::draw() printLineStats(); LLView::draw(); - mAllTimeMax = llmax(mAllTimeMax, mRecording->getLastRecordingPeriod().getSum(getFrameTimer())); + mAllTimeMax = llmax(mAllTimeMax, mRecording->getLastRecordingPeriod().getSum(FTM_FRAME)); mHoverID = NULL; mHoverBarIndex = -1; } @@ -935,11 +935,6 @@ void LLFastTimerView::onClickCloseBtn() setVisible(false); } -TimeBlock& LLFastTimerView::getFrameTimer() -{ - return FTM_FRAME; -} - void LLFastTimerView::printLineStats() { // Output stats for clicked bar to log @@ -947,7 +942,7 @@ void LLFastTimerView::printLineStats() { std::string legend_stat; bool first = true; - for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != end_timer_tree(); ++it) { @@ -969,7 +964,7 @@ void LLFastTimerView::printLineStats() std::string timer_stat; first = true; - for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != end_timer_tree(); ++it) { @@ -1061,7 +1056,7 @@ void LLFastTimerView::drawLineGraph() LLUnit<LLUnits::Seconds, F32> cur_max = 0; U32 cur_max_calls = 0; - for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != end_timer_tree(); ++it) { @@ -1169,7 +1164,7 @@ void LLFastTimerView::drawLegend( S32 y ) S32 cur_line = 0; ft_display_idx.clear(); std::map<TimeBlock*, S32> display_line; - for (timer_tree_iterator_t it = begin_timer_tree(getFrameTimer()); + for (timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != timer_tree_iterator_t(); ++it) { @@ -1258,11 +1253,11 @@ void LLFastTimerView::generateUniqueColors() { // generate unique colors { - sTimerColors[&getFrameTimer()] = LLColor4::grey; + sTimerColors[&FTM_FRAME] = LLColor4::grey; F32 hue = 0.f; - for (timer_tree_iterator_t it = begin_timer_tree(getFrameTimer()); + for (timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != timer_tree_iterator_t(); ++it) { @@ -1388,14 +1383,14 @@ LLUnit<LLUnits::Seconds, F64> LLFastTimerView::getTotalTime() switch(mDisplayMode) { case 0: - total_time = mRecording->getPeriodMean(getFrameTimer())*2; + total_time = mRecording->getPeriodMean(FTM_FRAME)*2; break; case 1: total_time = mAllTimeMax; break; case 2: // Calculate the max total ticks for the current history - total_time = mRecording->getPeriodMax(getFrameTimer()); + total_time = mRecording->getPeriodMax(FTM_FRAME); break; default: total_time = LLUnit<LLUnits::Milliseconds, F32>(100); @@ -1443,7 +1438,7 @@ void LLFastTimerView::drawBars() TimeBlock* prev_id = NULL; S32 i = 0; - for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != end_timer_tree(); ++it, ++i) { |