diff options
author | richard <none@none> | 2009-12-21 17:32:21 -0800 |
---|---|---|
committer | richard <none@none> | 2009-12-21 17:32:21 -0800 |
commit | 2c42062c107c1299e6cf5ea2a689cfb2a2e575e5 (patch) | |
tree | 83bfe39c6c05a83d4aa3c9f0dbd2944ebff77630 /indra/newview | |
parent | 470dba630b2a161e786d5fec9488a25fdbd43f13 (diff) | |
parent | 093795c10c9a15f293416467bf686f87f0fdbc8b (diff) |
merge
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfasttimerview.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llfasttimerview.h | 1 |
2 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 0b27001f10..effa57b1ef 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -98,6 +98,7 @@ LLFastTimerView::LLFastTimerView(const LLRect& rect) mHoverBarIndex = -1; FTV_NUM_TIMERS = LLFastTimer::NamedTimer::instanceCount(); mPrintStats = -1; + mAverageCyclesPerTimer = 0; } @@ -306,8 +307,9 @@ void LLFastTimerView::draw() S32 height = (S32) (gViewerWindow->getWindowRectScaled().getHeight()*0.75f); S32 width = (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f); - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast<LLRect&>(getRect()).setLeftTopAndSize(getRect().mLeft, getRect().mTop, width, height); + LLRect new_rect; + new_rect.setLeftTopAndSize(getRect().mLeft, getRect().mTop, width, height); + setRect(new_rect); S32 left, top, right, bottom; S32 x, y, barw, barh, dx, dy; @@ -321,6 +323,10 @@ void LLFastTimerView::draw() S32 xleft = margin; S32 ytop = margin; + mAverageCyclesPerTimer = llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f)); + LLFastTimer::sTimerCycles = 0; + LLFastTimer::sTimerCalls = 0; + // Draw some help { @@ -328,6 +334,10 @@ void LLFastTimerView::draw() y = height - ytop; texth = (S32)LLFontGL::getFontMonospace()->getLineHeight(); +#if TIME_FAST_TIMERS + tdesc = llformat("Cycles per timer call: %d", mAverageCyclesPerTimer); + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); +#else char modedesc[][32] = { "2 x Average ", "Max ", @@ -342,7 +352,6 @@ void LLFastTimerView::draw() tdesc = llformat("Full bar = %s [Click to pause/reset] [SHIFT-Click to toggle]",modedesc[mDisplayMode]); LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); - textw = LLFontGL::getFontMonospace()->getWidth(tdesc); x = xleft, y -= (texth + 2); @@ -352,6 +361,7 @@ void LLFastTimerView::draw() LLFontGL::getFontMonospace()->renderUTF8(std::string("[Right-Click log selected] [ALT-Click toggle counts] [ALT-SHIFT-Click sub hidden]"), 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); +#endif y -= (texth + 2); } diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 2bb023ab14..f5c8f23818 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -91,6 +91,7 @@ private: S32 mHoverBarIndex; LLFrameTimer mHighlightTimer; S32 mPrintStats; + S32 mAverageCyclesPerTimer; }; #endif |