summaryrefslogtreecommitdiff
path: root/indra/newview/llfasttimerview.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2014-01-09 12:22:24 -0800
committerRichard Linden <none@none>2014-01-09 12:22:24 -0800
commit15e6939342956f830996299352bcf7fffa7c3b85 (patch)
treedcd6443f049d35b3f3401d768b1eab735eda363b /indra/newview/llfasttimerview.h
parentd8a81b240e828a8ab27709fb11038a4b5c4d5428 (diff)
parent1d0d485b69bbbfd63d2d56a795d818131db2667c (diff)
merge with release
Diffstat (limited to 'indra/newview/llfasttimerview.h')
-rwxr-xr-xindra/newview/llfasttimerview.h112
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