diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2014-05-22 22:08:54 +0000 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2014-05-22 22:08:54 +0000 |
commit | 060c728970dc78d30f2cebdbeda7e56ea8de46e2 (patch) | |
tree | 8f00ce1b3bd564bc6cb81a2bc39a081eb3deca35 /indra/newview/llfasttimerview.h | |
parent | f8874d04b8ca238ee99dc464055295cff417a9b2 (diff) | |
parent | 644ca6a0f8a7759119814f88df93b8e838321a12 (diff) |
Merge. Pull in viewer-release after release of 3.7.8
Diffstat (limited to 'indra/newview/llfasttimerview.h')
-rwxr-xr-x | indra/newview/llfasttimerview.h | 112 |
1 files changed, 81 insertions, 31 deletions
diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 1349b1e99c..3e30bd86ba 100755 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -29,11 +29,15 @@ #include "llfloater.h" #include "llfasttimer.h" +#include "llunits.h" +#include "lltracerecording.h" +#include <deque> class LLFastTimerView : public LLFloater { public: LLFastTimerView(const LLSD&); + ~LLFastTimerView(); BOOL postBuild(); static BOOL sAnalyzePerformance; @@ -46,7 +50,6 @@ private: static LLSD analyzePerformanceLogDefault(std::istream& is) ; static void exportCharts(const std::string& base, const std::string& target); void onPause(); - LLFastTimer::NamedTimer& getFrameTimer(); public: @@ -58,40 +61,87 @@ public: virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual void draw(); + virtual void onOpen(const LLSD& key); + virtual void onClose(bool app_quitting); + LLTrace::BlockTimerStatHandle* getLegendID(S32 y); - LLFastTimer::NamedTimer* getLegendID(S32 y); - F64 getTime(const std::string& name); - -protected: - virtual void onClickCloseBtn(bool app_quitting = false); private: - typedef std::vector<std::vector<S32> > bar_positions_t; - bar_positions_t mBarStart; - bar_positions_t mBarEnd; - S32 mDisplayMode; + void drawTicks(); + void drawLineGraph(); + void drawLegend(); + void drawHelp(S32 y); + void drawBorders( S32 y, const S32 x_start, S32 barh, S32 dy); + void drawBars(); + + void printLineStats(); + void generateUniqueColors(); + void updateTotalTime(); + + struct TimerBar + { + TimerBar() + : mTotalTime(0), + mSelfTime(0), + mStartFraction(0.f), + mEndFraction(1.f), + mFirstChild(false), + mLastChild(false) + {} + F32Seconds mTotalTime, + mSelfTime, + mChildrenStart, + mChildrenEnd, + mSelfStart, + mSelfEnd; + LLTrace::BlockTimerStatHandle* mTimeBlock; + bool mVisible, + mFirstChild, + mLastChild; + F32 mStartFraction, + mEndFraction; + }; + + struct TimerBarRow + { + TimerBarRow() + : mBottom(0), + mTop(0), + mBars(NULL) + {} + S32 mBottom, + mTop; + TimerBar* mBars; + }; + + F32Seconds updateTimerBarWidths(LLTrace::BlockTimerStatHandle* time_block, TimerBarRow& row, S32 history_index, U32& bar_index); + S32 updateTimerBarOffsets(LLTrace::BlockTimerStatHandle* time_block, TimerBarRow& row, S32 timer_bar_index = 0); + S32 drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, S32 image_height, bool hovered = false, bool visible = true, S32 bar_index = 0); + void setPauseState(bool pause_state); + + std::deque<TimerBarRow> mTimerBarRows; + TimerBarRow mAverageTimerRow; - typedef enum child_alignment + enum EDisplayType { - ALIGN_LEFT, - ALIGN_CENTER, - ALIGN_RIGHT, - ALIGN_COUNT - } ChildAlignment; - - ChildAlignment mDisplayCenter; - S32 mDisplayCalls; - S32 mDisplayHz; - U64 mAvgCountTotal; - U64 mMaxCountTotal; - LLRect mBarRect; - S32 mScrollIndex; - LLFastTimer::NamedTimer* mHoverID; - LLFastTimer::NamedTimer* mHoverTimer; - LLRect mToolTipRect; - S32 mHoverBarIndex; - LLFrameTimer mHighlightTimer; - S32 mPrintStats; - LLRect mGraphRect; + DISPLAY_TIME, + DISPLAY_CALLS, + DISPLAY_HZ + } mDisplayType; + bool mPauseHistory; + F64Seconds mAllTimeMax, + mTotalTimeDisplay; + S32 mScrollIndex, + mHoverBarIndex, + mStatsIndex; + S32 mDisplayMode; + LLTrace::BlockTimerStatHandle* mHoverID; + LLTrace::BlockTimerStatHandle* mHoverTimer; + LLRect mToolTipRect, + mGraphRect, + mBarRect, + mLegendRect; + LLFrameTimer mHighlightTimer; + LLTrace::PeriodicRecording mRecording; }; #endif |