Scrollable fast timer view, by Liny
This commit is contained in:
@@ -103,6 +103,10 @@ LLFastTimerView::LLFastTimerView(const std::string& name, const LLRect& rect)
|
||||
FTV_NUM_TIMERS = LLFastTimer::NamedTimer::instanceCount();
|
||||
mPrintStats = -1;
|
||||
mAverageCyclesPerTimer = 0;
|
||||
// <FS:LO> Making the ledgend part of fast timers scrollable
|
||||
mOverLegend = false;
|
||||
mScrollOffset = 0;
|
||||
// </FS:LO>
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_fast_timers.xml");
|
||||
}
|
||||
|
||||
@@ -258,6 +262,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
|
||||
}
|
||||
mHoverTimer = NULL;
|
||||
mHoverID = NULL;
|
||||
mOverLegend = false; // <FS:LO> Making the ledgend part of fast timers scrollable
|
||||
|
||||
if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y))
|
||||
{
|
||||
@@ -311,6 +316,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
mHoverID = timer_id;
|
||||
}
|
||||
mOverLegend = true; // <FS:LO> Making the ledgend part of fast timers scrollable
|
||||
}
|
||||
|
||||
return LLFloater::handleHover(x, y, mask);
|
||||
@@ -358,10 +364,36 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* stic
|
||||
|
||||
BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
||||
{
|
||||
LLFastTimer::sPauseHistory = TRUE;
|
||||
mScrollIndex = llclamp( mScrollIndex + clicks,
|
||||
0,
|
||||
llmin(LLFastTimer::getLastFrameIndex(), (S32)LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY));
|
||||
//LLFastTimer::sPauseHistory = TRUE;
|
||||
//mScrollIndex = llclamp( mScrollIndex + clicks,
|
||||
//0,
|
||||
//llmin(LLFastTimer::getLastFrameIndex(), (S32)LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY));
|
||||
// <FS:LO> Making the ledgend part of fast timers scrollable
|
||||
if(mOverLegend)
|
||||
{
|
||||
mScrollOffset += clicks;
|
||||
S32 count = 0;
|
||||
for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer());
|
||||
it != timer_tree_iterator_t();
|
||||
++it)
|
||||
{
|
||||
count++;
|
||||
LLFastTimer::NamedTimer* idp = (*it);
|
||||
if (idp->getCollapsed())
|
||||
{
|
||||
it.skipDescendants();
|
||||
}
|
||||
}
|
||||
mScrollOffset = llclamp(mScrollOffset,0,count-5);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLFastTimer::sPauseHistory = TRUE;
|
||||
mScrollIndex = llclamp( mScrollIndex + clicks,
|
||||
0,
|
||||
llmin(LLFastTimer::getLastFrameIndex(), (S32)LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY));
|
||||
}
|
||||
// </FS:LO>
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -479,11 +511,23 @@ void LLFastTimerView::draw()
|
||||
S32 cur_line = 0;
|
||||
ft_display_idx.clear();
|
||||
std::map<LLFastTimer::NamedTimer*, S32> display_line;
|
||||
S32 mScrollOffset_tmp = mScrollOffset; // <FS:LO> Making the ledgend part of fast timers scrollable
|
||||
for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer());
|
||||
it != timer_tree_iterator_t();
|
||||
++it)
|
||||
{
|
||||
LLFastTimer::NamedTimer* idp = (*it);
|
||||
// <FS:LO> Making the ledgend part of fast timers scrollable
|
||||
if(mScrollOffset_tmp)
|
||||
{
|
||||
--mScrollOffset_tmp;
|
||||
if (idp->getCollapsed())
|
||||
{
|
||||
it.skipDescendants();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// </FS:LO>
|
||||
display_line[idp] = cur_line;
|
||||
ft_display_idx.push_back(idp);
|
||||
cur_line++;
|
||||
|
||||
@@ -99,6 +99,11 @@ private:
|
||||
S32 mPrintStats;
|
||||
S32 mAverageCyclesPerTimer;
|
||||
LLRect mGraphRect;
|
||||
|
||||
// <FS:LO> Making the ledgend part of fast timers scrollable
|
||||
bool mOverLegend;
|
||||
S32 mScrollOffset;
|
||||
// </FS:LO>
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user