Move texture debug floater back to the bottom of the screen.

Liny 2012-06-22 16:25:43 -07:00
parent 215365276a
commit 5166d95a0c
2 changed files with 53 additions and 4 deletions

View File

@ -96,6 +96,10 @@ LLFastTimerView::LLFastTimerView(const LLSD& key)
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>
}
void LLFastTimerView::onPause()
@ -243,6 +247,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))
{
@ -295,6 +300,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);
@ -339,10 +345,36 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask)
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;
}
@ -460,11 +492,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++;

View File

@ -92,6 +92,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