From b3e9c46c94dad0c81a5adcb9152521b5368c66a7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 29 Aug 2012 22:50:56 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages further cleanup of LLStat removed llfloaterlagmeter --- indra/llui/llstatbar.cpp | 2 +- indra/llui/llstatbar.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 04cce7878e..a21d7aa6a1 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -45,7 +45,7 @@ LLStatBar::LLStatBar(const Params& p) mUnitLabel(p.unit_label), mMinBar(p.bar_min), mMaxBar(p.bar_max), - mStatp(LLStat::getStat(p.stat)), + mStatp(LLStat::getInstance(p.stat)), mTickSpacing(p.tick_spacing), mLabelSpacing(p.label_spacing), mPrecision(p.precision), diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 513fff3234..7e636d0aa7 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -59,10 +59,10 @@ public: label_spacing("label_spacing", 10.0f), precision("precision", 0), update_rate("update_rate", 5.0f), - show_per_sec("show_per_sec", TRUE), + show_per_sec("show_per_sec", true), show_bar("show_bar", TRUE), - show_history("show_history", FALSE), - show_mean("show_mean", TRUE), + show_history("show_history", false), + show_mean("show_mean", true), stat("stat") { changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT); -- cgit v1.2.3 From b1baf982b1bd41a150233d0a28d3601226924c65 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 30 Sep 2012 10:41:29 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages factored out lltrace::sampler into separate file added rudimentary lltrace support to llstatgraph made llstatgraph use param blocks more effectively moves initial set of stats over to lltrace removed windows.h #defines for min and max --- indra/llui/llstatbar.cpp | 79 +++++++++++++++++++++-------- indra/llui/llstatbar.h | 3 ++ indra/llui/llstatgraph.cpp | 123 ++++++++++++++++++++++++--------------------- indra/llui/llstatgraph.h | 99 +++++++++++++++++++++++++++++++----- 4 files changed, 216 insertions(+), 88 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index a21d7aa6a1..2d1b582598 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -36,6 +36,7 @@ #include "llstat.h" #include "lluictrlfactory.h" +#include "lltracesampler.h" /////////////////////////////////////////////////////////////////////////////////// @@ -46,6 +47,8 @@ LLStatBar::LLStatBar(const Params& p) mMinBar(p.bar_min), mMaxBar(p.bar_max), mStatp(LLStat::getInstance(p.stat)), + mFloatStatp(LLTrace::Stat::getInstance(p.stat)), + mIntStatp(LLTrace::Stat::getInstance(p.stat)), mTickSpacing(p.tick_spacing), mLabelSpacing(p.label_spacing), mPrecision(p.precision), @@ -84,30 +87,66 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) void LLStatBar::draw() { - if (!mStatp) + F32 current = 0.f, + min = 0.f, + max = 0.f, + mean = 0.f; + + if (mStatp) { -// llinfos << "No stats for statistics bar!" << llendl; - return; + // Get the values. + if (mPerSec) + { + current = mStatp->getCurrentPerSec(); + min = mStatp->getMinPerSec(); + max = mStatp->getMaxPerSec(); + mean = mStatp->getMeanPerSec(); + } + else + { + current = mStatp->getCurrent(); + min = mStatp->getMin(); + max = mStatp->getMax(); + mean = mStatp->getMean(); + } } - - // Get the values. - F32 current, min, max, mean; - if (mPerSec) + else if (mFloatStatp) { - current = mStatp->getCurrentPerSec(); - min = mStatp->getMinPerSec(); - max = mStatp->getMaxPerSec(); - mean = mStatp->getMeanPerSec(); + LLTrace::Sampler* sampler = LLThread::getTraceData()->getPrimarySampler(); + if (mPerSec) + { + current = sampler->getSum(*mFloatStatp) / sampler->getSampleTime(); + min = sampler->getMin(*mFloatStatp) / sampler->getSampleTime(); + max = sampler->getMax(*mFloatStatp) / sampler->getSampleTime(); + mean = sampler->getMean(*mFloatStatp) / sampler->getSampleTime(); + } + else + { + current = sampler->getSum(*mFloatStatp); + min = sampler->getMin(*mFloatStatp); + max = sampler->getMax(*mFloatStatp); + mean = sampler->getMean(*mFloatStatp); + } } - else + else if (mIntStatp) { - current = mStatp->getCurrent(); - min = mStatp->getMin(); - max = mStatp->getMax(); - mean = mStatp->getMean(); + LLTrace::Sampler* sampler = LLThread::getTraceData()->getPrimarySampler(); + if (mPerSec) + { + current = (F32)sampler->getSum(*mIntStatp) / sampler->getSampleTime(); + min = (F32)sampler->getMin(*mIntStatp) / sampler->getSampleTime(); + max = (F32)sampler->getMax(*mIntStatp) / sampler->getSampleTime(); + mean = (F32)sampler->getMean(*mIntStatp) / sampler->getSampleTime(); + } + else + { + current = (F32)sampler->getSum(*mIntStatp); + min = (F32)sampler->getMin(*mIntStatp); + max = (F32)sampler->getMax(*mIntStatp); + mean = (F32)sampler->getMean(*mIntStatp); + } } - if ((mUpdatesPerSec == 0.f) || (mUpdateTimer.getElapsedTimeF32() > 1.f/mUpdatesPerSec) || (mValue == 0.f)) { if (mDisplayMean) @@ -153,7 +192,7 @@ void LLStatBar::draw() LLFontGL::RIGHT, LLFontGL::TOP); value_format = llformat( "%%.%df", mPrecision); - if (mDisplayBar) + if (mDisplayBar && mStatp) { std::string tick_label; @@ -213,9 +252,9 @@ void LLStatBar::draw() right = (S32) ((max - mMinBar) * value_scale); gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 0.f, 0.f, 0.25f)); - S32 num_values = mStatp->getNumValues() - 1; if (mDisplayHistory) { + S32 num_values = mStatp->getNumValues() - 1; S32 i; for (i = 0; i < num_values; i++) { @@ -270,7 +309,7 @@ LLRect LLStatBar::getRequiredRect() if (mDisplayBar) { - if (mDisplayHistory) + if (mDisplayHistory && mStatp) { rect.mTop = 35 + mStatp->getNumBins(); } diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 7e636d0aa7..8348290abf 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -29,6 +29,7 @@ #include "llview.h" #include "llframetimer.h" +#include "lltrace.h" class LLStat; @@ -92,6 +93,8 @@ private: BOOL mDisplayMean; // If true, display mean, if false, display current value LLStat* mStatp; + LLTrace::Stat* mFloatStatp; + LLTrace::Stat* mIntStatp; LLFrameTimer mUpdateTimer; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index e44887ebf0..19896c4597 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -35,28 +35,38 @@ #include "llstat.h" #include "llgl.h" #include "llglheaders.h" +#include "lltracesampler.h" //#include "llviewercontrol.h" /////////////////////////////////////////////////////////////////////////////////// -LLStatGraph::LLStatGraph(const LLView::Params& p) -: LLView(p) +LLStatGraph::LLStatGraph(const Params& p) +: LLView(p), + mMin(p.min), + mMax(p.max), + mPerSec(true), + mPrecision(p.precision), + mValue(p.value), + mStatp(p.stat.legacy_stat), + mF32Statp(p.stat.f32_stat), + mS32Statp(p.stat.s32_stat) { - mStatp = NULL; setToolTip(p.name()); - mNumThresholds = 3; - mThresholdColors[0] = LLColor4(0.f, 1.f, 0.f, 1.f); - mThresholdColors[1] = LLColor4(1.f, 1.f, 0.f, 1.f); - mThresholdColors[2] = LLColor4(1.f, 0.f, 0.f, 1.f); - mThresholdColors[3] = LLColor4(1.f, 0.f, 0.f, 1.f); - mThresholds[0] = 50.f; - mThresholds[1] = 75.f; - mThresholds[2] = 100.f; - mMin = 0.f; - mMax = 125.f; - mPerSec = TRUE; - mValue = 0.f; - mPrecision = 0; + + for(LLInitParam::ParamIterator::const_iterator it = p.thresholds.threshold.begin(), end_it = p.thresholds.threshold.end(); + it != end_it; + ++it) + { + mThresholds.push_back(Threshold(it->value(), it->color)); + } + + //mThresholdColors[0] = LLColor4(0.f, 1.f, 0.f, 1.f); + //mThresholdColors[1] = LLColor4(1.f, 1.f, 0.f, 1.f); + //mThresholdColors[2] = LLColor4(1.f, 0.f, 0.f, 1.f); + //mThresholdColors[3] = LLColor4(1.f, 0.f, 0.f, 1.f); + //mThresholds[0] = 50.f; + //mThresholds[1] = 75.f; + //mThresholds[2] = 100.f; } void LLStatGraph::draw() @@ -74,6 +84,33 @@ void LLStatGraph::draw() mValue = mStatp->getMean(); } } + else if (mF32Statp) + { + LLTrace::Sampler* sampler = LLThread::getTraceData()->getPrimarySampler(); + + if (mPerSec) + { + mValue = sampler->getSum(*mF32Statp) / sampler->getSampleTime(); + } + else + { + mValue = sampler->getSum(*mF32Statp); + } + + } + else if (mS32Statp) + { + LLTrace::Sampler* sampler = LLThread::getTraceData()->getPrimarySampler(); + + if (mPerSec) + { + mValue = sampler->getSum(*mS32Statp) / sampler->getSampleTime(); + } + else + { + mValue = sampler->getSum(*mS32Statp); + } + } frac = (mValue - mMin) / range; frac = llmax(0.f, frac); frac = llmin(1.f, frac); @@ -91,19 +128,22 @@ void LLStatGraph::draw() LLColor4 color; - S32 i; - for (i = 0; i < mNumThresholds - 1; i++) + //S32 i; + //for (i = 0; i < mNumThresholds - 1; i++) + //{ + // if (mThresholds[i] > mValue) + // { + // break; + // } + //} + + threshold_vec_t::iterator it = std::lower_bound(mThresholds.begin(), mThresholds.end(), Threshold(mValue / mMax, LLUIColor())); + + if (it != mThresholds.begin()) { - if (mThresholds[i] > mValue) - { - break; - } + it--; } - //gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, - // LLUIColorTable::instance().getColor("ColorDropShadow"), - // (S32) gSavedSettings.getF32("DropShadowFloater") ); - color = LLUIColorTable::instance().getColor( "MenuDefaultBgColor" ); gGL.color4fv(color.mV); gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE); @@ -111,16 +151,11 @@ void LLStatGraph::draw() gGL.color4fv(LLColor4::black.mV); gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, FALSE); - color = mThresholdColors[i]; + color = it->mColor; gGL.color4fv(color.mV); gl_rect_2d(1, llround(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE); } -void LLStatGraph::setValue(const LLSD& value) -{ - mValue = (F32)value.asReal(); -} - void LLStatGraph::setMin(const F32 min) { mMin = min; @@ -131,27 +166,3 @@ void LLStatGraph::setMax(const F32 max) mMax = max; } -void LLStatGraph::setStat(LLStat *statp) -{ - mStatp = statp; -} - -void LLStatGraph::setLabel(const std::string& label) -{ - mLabel = label; -} - -void LLStatGraph::setUnits(const std::string& units) -{ - mUnits = units; -} - -void LLStatGraph::setPrecision(const S32 precision) -{ - mPrecision = precision; -} - -void LLStatGraph::setThreshold(const S32 i, F32 value) -{ - mThresholds[i] = value; -} diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 757525e232..e7de945694 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -30,29 +30,88 @@ #include "llview.h" #include "llframetimer.h" #include "v4color.h" +#include "lltrace.h" class LLStat; class LLStatGraph : public LLView { public: - LLStatGraph(const LLView::Params&); + struct ThresholdParams : public LLInitParam::Block + { + Mandatory value; + Optional color; - virtual void draw(); + ThresholdParams() + : value("value"), + color("color", LLColor4::white) + {} + }; + + struct Thresholds : public LLInitParam::Block + { + Multiple threshold; + + Thresholds() + : threshold("threshold") + {} + }; + + struct StatParams : public LLInitParam::ChoiceBlock + { + Alternative legacy_stat; + Alternative* > f32_stat; + Alternative* > s32_stat; + }; + + struct Params : public LLInitParam::Block + { + Mandatory stat; + Optional label, + units; + Optional precision; + Optional min, + max; + Optional per_sec; + Optional value; + + Optional thresholds; + + Params() + : stat("stat"), + label("label"), + units("units"), + precision("precision", 0), + min("min", 0.f), + max("max", 125.f), + per_sec("per_sec", true), + value("value", 0.f), + thresholds("thresholds") + { + Thresholds _thresholds; + _thresholds.threshold.add(ThresholdParams().value(0.f).color(LLColor4::green)) + .add(ThresholdParams().value(0.33f).color(LLColor4::yellow)) + .add(ThresholdParams().value(0.5f).color(LLColor4::red)) + .add(ThresholdParams().value(0.75f).color(LLColor4::red)); + thresholds = _thresholds; + } + }; + LLStatGraph(const Params&); - void setLabel(const std::string& label); - void setUnits(const std::string& units); - void setPrecision(const S32 precision); - void setStat(LLStat *statp); - void setThreshold(const S32 i, F32 value); void setMin(const F32 min); void setMax(const F32 max); + virtual void draw(); + /*virtual*/ void setValue(const LLSD& value); - LLStat *mStatp; - BOOL mPerSec; private: + LLStat* mStatp; + LLTrace::Stat* mF32Statp; + LLTrace::Stat* mS32Statp; + + BOOL mPerSec; + F32 mValue; F32 mMin; @@ -62,9 +121,25 @@ private: std::string mUnits; S32 mPrecision; // Num of digits of precision after dot - S32 mNumThresholds; - F32 mThresholds[4]; - LLColor4 mThresholdColors[4]; + struct Threshold + { + Threshold(F32 value, const LLUIColor& color) + : mValue(value), + mColor(color) + {} + + F32 mValue; + LLUIColor mColor; + bool operator <(const Threshold& other) + { + return mValue < other.mValue; + } + }; + typedef std::vector threshold_vec_t; + threshold_vec_t mThresholds; + //S32 mNumThresholds; + //F32 mThresholds[4]; + //LLColor4 mThresholdColors[4]; }; #endif // LL_LLSTATGRAPH_H -- cgit v1.2.3 From 14b1b0b2bb6bac5bc688cc4d14c33f1b680dd3b4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Oct 2012 19:39:04 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages cleaned up API samplers are now value types with copy-on-write buffers under the hood removed coupling with LLThread --- indra/llui/llstatbar.cpp | 36 +++++++++--------------------------- indra/llui/llstatbar.h | 4 ++-- indra/llui/llstatgraph.cpp | 17 ++--------------- indra/llui/llstatgraph.h | 7 +++---- 4 files changed, 16 insertions(+), 48 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 2d1b582598..1f8be3da62 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -47,8 +47,7 @@ LLStatBar::LLStatBar(const Params& p) mMinBar(p.bar_min), mMaxBar(p.bar_max), mStatp(LLStat::getInstance(p.stat)), - mFloatStatp(LLTrace::Stat::getInstance(p.stat)), - mIntStatp(LLTrace::Stat::getInstance(p.stat)), + mFloatStatp(LLTrace::Rate::getInstance(p.stat)), mTickSpacing(p.tick_spacing), mLabelSpacing(p.label_spacing), mPrecision(p.precision), @@ -112,40 +111,23 @@ void LLStatBar::draw() } else if (mFloatStatp) { - LLTrace::Sampler* sampler = LLThread::getTraceData()->getPrimarySampler(); + LLTrace::Sampler* sampler = LLTrace::get_thread_trace()->getPrimarySampler(); if (mPerSec) { current = sampler->getSum(*mFloatStatp) / sampler->getSampleTime(); - min = sampler->getMin(*mFloatStatp) / sampler->getSampleTime(); - max = sampler->getMax(*mFloatStatp) / sampler->getSampleTime(); - mean = sampler->getMean(*mFloatStatp) / sampler->getSampleTime(); + //min = sampler->getMin(*mFloatStatp) / sampler->getSampleTime(); + //max = sampler->getMax(*mFloatStatp) / sampler->getSampleTime(); + //mean = sampler->getMean(*mFloatStatp) / sampler->getSampleTime(); } else { current = sampler->getSum(*mFloatStatp); - min = sampler->getMin(*mFloatStatp); - max = sampler->getMax(*mFloatStatp); - mean = sampler->getMean(*mFloatStatp); - } - } - else if (mIntStatp) - { - LLTrace::Sampler* sampler = LLThread::getTraceData()->getPrimarySampler(); - if (mPerSec) - { - current = (F32)sampler->getSum(*mIntStatp) / sampler->getSampleTime(); - min = (F32)sampler->getMin(*mIntStatp) / sampler->getSampleTime(); - max = (F32)sampler->getMax(*mIntStatp) / sampler->getSampleTime(); - mean = (F32)sampler->getMean(*mIntStatp) / sampler->getSampleTime(); - } - else - { - current = (F32)sampler->getSum(*mIntStatp); - min = (F32)sampler->getMin(*mIntStatp); - max = (F32)sampler->getMax(*mIntStatp); - mean = (F32)sampler->getMean(*mIntStatp); + //min = sampler->getMin(*mFloatStatp); + //max = sampler->getMax(*mFloatStatp); + //mean = sampler->getMean(*mFloatStatp); } } + if ((mUpdatesPerSec == 0.f) || (mUpdateTimer.getElapsedTimeF32() > 1.f/mUpdatesPerSec) || (mValue == 0.f)) { diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 8348290abf..c735e7045b 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -36,6 +36,7 @@ class LLStat; class LLStatBar : public LLView { public: + struct Params : public LLInitParam::Block { Optional label; @@ -93,8 +94,7 @@ private: BOOL mDisplayMean; // If true, display mean, if false, display current value LLStat* mStatp; - LLTrace::Stat* mFloatStatp; - LLTrace::Stat* mIntStatp; + LLTrace::Rate* mFloatStatp; LLFrameTimer mUpdateTimer; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index 19896c4597..e0d7623999 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -48,8 +48,7 @@ LLStatGraph::LLStatGraph(const Params& p) mPrecision(p.precision), mValue(p.value), mStatp(p.stat.legacy_stat), - mF32Statp(p.stat.f32_stat), - mS32Statp(p.stat.s32_stat) + mF32Statp(p.stat.rate_stat) { setToolTip(p.name()); @@ -86,7 +85,7 @@ void LLStatGraph::draw() } else if (mF32Statp) { - LLTrace::Sampler* sampler = LLThread::getTraceData()->getPrimarySampler(); + LLTrace::Sampler* sampler = LLTrace::get_thread_trace()->getPrimarySampler(); if (mPerSec) { @@ -98,19 +97,7 @@ void LLStatGraph::draw() } } - else if (mS32Statp) - { - LLTrace::Sampler* sampler = LLThread::getTraceData()->getPrimarySampler(); - if (mPerSec) - { - mValue = sampler->getSum(*mS32Statp) / sampler->getSampleTime(); - } - else - { - mValue = sampler->getSum(*mS32Statp); - } - } frac = (mValue - mMin) / range; frac = llmax(0.f, frac); frac = llmin(1.f, frac); diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index e7de945694..69fc36ea52 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -60,8 +60,7 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { Alternative legacy_stat; - Alternative* > f32_stat; - Alternative* > s32_stat; + Alternative* > rate_stat; }; struct Params : public LLInitParam::Block @@ -107,8 +106,8 @@ public: private: LLStat* mStatp; - LLTrace::Stat* mF32Statp; - LLTrace::Stat* mS32Statp; + LLTrace::Rate* mF32Statp; + LLTrace::Rate* mS32Statp; BOOL mPerSec; -- cgit v1.2.3 From dbe9742703cf14db85ec3d16c540efc68dce95a6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 2 Oct 2012 15:37:16 -0700 Subject: SH-3404 create sampler class renamed LLTrace::ThreadTrace to LLTrace::ThreadRecorder renamed LLTrace::Sampler to LLTrace::Recording --- indra/llui/llstatbar.cpp | 20 ++++++++++---------- indra/llui/llstatgraph.cpp | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 1f8be3da62..bc9603804b 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -36,7 +36,7 @@ #include "llstat.h" #include "lluictrlfactory.h" -#include "lltracesampler.h" +#include "lltracerecording.h" /////////////////////////////////////////////////////////////////////////////////// @@ -111,20 +111,20 @@ void LLStatBar::draw() } else if (mFloatStatp) { - LLTrace::Sampler* sampler = LLTrace::get_thread_trace()->getPrimarySampler(); + LLTrace::Recording* recording = LLTrace::get_thread_recorder()->getPrimaryRecording(); if (mPerSec) { - current = sampler->getSum(*mFloatStatp) / sampler->getSampleTime(); - //min = sampler->getMin(*mFloatStatp) / sampler->getSampleTime(); - //max = sampler->getMax(*mFloatStatp) / sampler->getSampleTime(); - //mean = sampler->getMean(*mFloatStatp) / sampler->getSampleTime(); + current = recording->getSum(*mFloatStatp) / recording->getSampleTime(); + //min = recording->getMin(*mFloatStatp) / recording->getSampleTime(); + //max = recording->getMax(*mFloatStatp) / recording->getSampleTime(); + //mean = recording->getMean(*mFloatStatp) / recording->getSampleTime(); } else { - current = sampler->getSum(*mFloatStatp); - //min = sampler->getMin(*mFloatStatp); - //max = sampler->getMax(*mFloatStatp); - //mean = sampler->getMean(*mFloatStatp); + current = recording->getSum(*mFloatStatp); + //min = recording->getMin(*mFloatStatp); + //max = recording->getMax(*mFloatStatp); + //mean = recording->getMean(*mFloatStatp); } } diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index e0d7623999..aed9e4ec93 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -35,7 +35,7 @@ #include "llstat.h" #include "llgl.h" #include "llglheaders.h" -#include "lltracesampler.h" +#include "lltracerecording.h" //#include "llviewercontrol.h" /////////////////////////////////////////////////////////////////////////////////// @@ -85,15 +85,15 @@ void LLStatGraph::draw() } else if (mF32Statp) { - LLTrace::Sampler* sampler = LLTrace::get_thread_trace()->getPrimarySampler(); + LLTrace::Recording* recording = LLTrace::get_thread_recorder()->getPrimaryRecording(); if (mPerSec) { - mValue = sampler->getSum(*mF32Statp) / sampler->getSampleTime(); + mValue = recording->getSum(*mF32Statp) / recording->getSampleTime(); } else { - mValue = sampler->getSum(*mF32Statp); + mValue = recording->getSum(*mF32Statp); } } -- cgit v1.2.3 From 74ac0182ec8f7a0f6d0ea89f5814f0998ab90b62 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 10 Oct 2012 19:25:56 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system fixed units conversion so that trace getters return convertable units removed circular dependencies from lltrace* converted more stats to lltrace --- indra/llui/llstatbar.cpp | 1 + indra/llui/llstatgraph.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index bc9603804b..4cbf695059 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -37,6 +37,7 @@ #include "llstat.h" #include "lluictrlfactory.h" #include "lltracerecording.h" +#include "lltracethreadrecorder.h" /////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index aed9e4ec93..1d4527aaa3 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -36,6 +36,7 @@ #include "llgl.h" #include "llglheaders.h" #include "lltracerecording.h" +#include "lltracethreadrecorder.h" //#include "llviewercontrol.h" /////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 0f58ca02cdec62711eadb82ba28fcff08faef2ee Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 12 Oct 2012 00:20:19 -0700 Subject: SH-3275 WIP Update viewer metrics system to be more flexible cleaned up accumulator merging logic introduced frame recording to LLTrace directly instead of going through LLViewerStats moved consumer code over to frame recording instead of whatever the current active recording was --- indra/llui/llstatbar.cpp | 7 +++---- indra/llui/llstatbar.h | 35 ++++++++++++++++++++--------------- indra/llui/llstatgraph.cpp | 6 +++--- 3 files changed, 26 insertions(+), 22 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 4cbf695059..b73007e107 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -37,7 +37,6 @@ #include "llstat.h" #include "lluictrlfactory.h" #include "lltracerecording.h" -#include "lltracethreadrecorder.h" /////////////////////////////////////////////////////////////////////////////////// @@ -112,17 +111,17 @@ void LLStatBar::draw() } else if (mFloatStatp) { - LLTrace::Recording* recording = LLTrace::get_thread_recorder()->getPrimaryRecording(); + LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); if (mPerSec) { - current = recording->getSum(*mFloatStatp) / recording->getSampleTime(); + current = recording.getPerSec(*mFloatStatp); //min = recording->getMin(*mFloatStatp) / recording->getSampleTime(); //max = recording->getMax(*mFloatStatp) / recording->getSampleTime(); //mean = recording->getMean(*mFloatStatp) / recording->getSampleTime(); } else { - current = recording->getSum(*mFloatStatp); + current = recording.getSum(*mFloatStatp); //min = recording->getMin(*mFloatStatp); //max = recording->getMax(*mFloatStatp); //mean = recording->getMean(*mFloatStatp); diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index c735e7045b..bfc49b9204 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -29,8 +29,7 @@ #include "llview.h" #include "llframetimer.h" -#include "lltrace.h" - +#include "lltracerecording.h" class LLStat; class LLStatBar : public LLView @@ -39,19 +38,24 @@ public: struct Params : public LLInitParam::Block { - Optional label; - Optional unit_label; - Optional bar_min; - Optional bar_max; - Optional tick_spacing; - Optional label_spacing; - Optional precision; - Optional update_rate; - Optional show_per_sec; - Optional show_bar; - Optional show_history; - Optional show_mean; - Optional stat; + Optional label, + unit_label; + + Optional bar_min, + bar_max, + tick_spacing, + label_spacing, + update_rate; + + Optional precision; + + Optional show_per_sec, + show_bar, + show_history, + show_mean; + + Optional stat; + Params() : label("label"), unit_label("unit_label"), @@ -92,6 +96,7 @@ private: BOOL mDisplayBar; // Display the bar graph. BOOL mDisplayHistory; BOOL mDisplayMean; // If true, display mean, if false, display current value + LLTrace::PeriodicRecording* mFrameRecording; LLStat* mStatp; LLTrace::Rate* mFloatStatp; diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index 1d4527aaa3..21b55c7c5a 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -86,15 +86,15 @@ void LLStatGraph::draw() } else if (mF32Statp) { - LLTrace::Recording* recording = LLTrace::get_thread_recorder()->getPrimaryRecording(); + LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); if (mPerSec) { - mValue = recording->getSum(*mF32Statp) / recording->getSampleTime(); + mValue = recording.getPerSec(*mF32Statp); } else { - mValue = recording->getSum(*mF32Statp); + mValue = recording.getSum(*mF32Statp); } } -- cgit v1.2.3 From 041dfccd1ea5b59c1b3c4e37e9a5495cad342c8f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 12 Oct 2012 20:17:52 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system default to double precision now fixed unit conversion logic for LLUnit renamed LLTrace::Rate to LLTrace::Count and got rid of the old count as it was confusing some const correctness changes --- indra/llui/llstatbar.cpp | 25 ++++++++++++++----------- indra/llui/llstatbar.h | 2 +- indra/llui/llstatgraph.cpp | 8 ++++---- indra/llui/llstatgraph.h | 5 ++--- 4 files changed, 21 insertions(+), 19 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index b73007e107..c60e5431ae 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -47,7 +47,7 @@ LLStatBar::LLStatBar(const Params& p) mMinBar(p.bar_min), mMaxBar(p.bar_max), mStatp(LLStat::getInstance(p.stat)), - mFloatStatp(LLTrace::Rate::getInstance(p.stat)), + mNewStatp(LLTrace::Count<>::getInstance(p.stat)), mTickSpacing(p.tick_spacing), mLabelSpacing(p.label_spacing), mPrecision(p.precision), @@ -109,22 +109,25 @@ void LLStatBar::draw() mean = mStatp->getMean(); } } - else if (mFloatStatp) + else if (mNewStatp) { - LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); + LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecordingPeriod(); + LLTrace::Recording& windowed_frame_recording = frame_recording.getTotalRecording(); + if (mPerSec) { - current = recording.getPerSec(*mFloatStatp); - //min = recording->getMin(*mFloatStatp) / recording->getSampleTime(); - //max = recording->getMax(*mFloatStatp) / recording->getSampleTime(); - //mean = recording->getMean(*mFloatStatp) / recording->getSampleTime(); + current = last_frame_recording.getPerSec(*mNewStatp); + //min = frame_window_recording.getMin(*mNewStatp) / frame_window_recording.getDuration(); + //max = frame_window_recording.getMax(*mNewStatp) / frame_window_recording.getDuration(); + mean = windowed_frame_recording.getPerSec(*mNewStatp);//frame_window_recording.getMean(*mNewStatp) / frame_window_recording.getDuration(); } else { - current = recording.getSum(*mFloatStatp); - //min = recording->getMin(*mFloatStatp); - //max = recording->getMax(*mFloatStatp); - //mean = recording->getMean(*mFloatStatp); + current = last_frame_recording.getSum(*mNewStatp); + //min = last_frame_recording.getMin(*mNewStatp); + //max = last_frame_recording.getMax(*mNewStatp); + mean = windowed_frame_recording.getSum(*mNewStatp); } } diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index bfc49b9204..e4b0c61c42 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -99,7 +99,7 @@ private: LLTrace::PeriodicRecording* mFrameRecording; LLStat* mStatp; - LLTrace::Rate* mFloatStatp; + LLTrace::Count<>* mNewStatp; LLFrameTimer mUpdateTimer; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index 21b55c7c5a..be3baeea76 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -49,7 +49,7 @@ LLStatGraph::LLStatGraph(const Params& p) mPrecision(p.precision), mValue(p.value), mStatp(p.stat.legacy_stat), - mF32Statp(p.stat.rate_stat) + mNewStatp(p.stat.rate_stat) { setToolTip(p.name()); @@ -84,17 +84,17 @@ void LLStatGraph::draw() mValue = mStatp->getMean(); } } - else if (mF32Statp) + else if (mNewStatp) { LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); if (mPerSec) { - mValue = recording.getPerSec(*mF32Statp); + mValue = recording.getPerSec(*mNewStatp); } else { - mValue = recording.getSum(*mF32Statp); + mValue = recording.getSum(*mNewStatp); } } diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 69fc36ea52..54a959f49e 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -60,7 +60,7 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { Alternative legacy_stat; - Alternative* > rate_stat; + Alternative* > rate_stat; }; struct Params : public LLInitParam::Block @@ -106,8 +106,7 @@ public: private: LLStat* mStatp; - LLTrace::Rate* mF32Statp; - LLTrace::Rate* mS32Statp; + LLTrace::Count<>* mNewStatp; BOOL mPerSec; -- cgit v1.2.3 From 8d2f7a526545a10cd3669bf837a0b6f02cf5fe71 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 15 Oct 2012 19:43:35 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system converted all remaining LLViewerStats to lltrace --- indra/llui/llstatgraph.cpp | 2 +- indra/llui/llstatgraph.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index be3baeea76..e961e7d3c0 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -49,7 +49,7 @@ LLStatGraph::LLStatGraph(const Params& p) mPrecision(p.precision), mValue(p.value), mStatp(p.stat.legacy_stat), - mNewStatp(p.stat.rate_stat) + mNewStatp(p.stat.count_stat) { setToolTip(p.name()); diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 54a959f49e..5bbd9e9d24 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -60,7 +60,8 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { Alternative legacy_stat; - Alternative* > rate_stat; + Alternative* > count_stat; + Alternative* > measurement_stat; }; struct Params : public LLInitParam::Block -- cgit v1.2.3 From a52d203a4f1d2988e8ffba16258f3f132f22f56d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 17 Oct 2012 20:00:07 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system started conversion of llviewerassetstats removed old, dead LLViewerStats code made units tracing require units declaration clean up of units handling --- indra/llui/llstatbar.cpp | 3 +-- indra/llui/llstatbar.h | 2 +- indra/llui/llstatgraph.h | 10 +++++----- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index c60e5431ae..535c6f96e3 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -56,8 +56,7 @@ LLStatBar::LLStatBar(const Params& p) mDisplayBar(p.show_bar), mDisplayHistory(p.show_history), mDisplayMean(p.show_mean) -{ -} +{} BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) { diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index e4b0c61c42..d510f0e3fe 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -99,7 +99,7 @@ private: LLTrace::PeriodicRecording* mFrameRecording; LLStat* mStatp; - LLTrace::Count<>* mNewStatp; + LLTrace::count_common_t* mNewStatp; LLFrameTimer mUpdateTimer; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 5bbd9e9d24..b20966d608 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -59,9 +59,9 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative legacy_stat; - Alternative* > count_stat; - Alternative* > measurement_stat; + Alternative legacy_stat; + Alternative count_stat; + Alternative measurement_stat; }; struct Params : public LLInitParam::Block @@ -106,8 +106,8 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLStat* mStatp; - LLTrace::Count<>* mNewStatp; + LLStat* mStatp; + LLTrace::count_common_t* mNewStatp; BOOL mPerSec; -- cgit v1.2.3 From 638a16eedd12fe03b85703fb821bc05f40aab355 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Oct 2012 22:35:47 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system improved predicate system, added uncertain/unknown predicates --- indra/llui/llxuiparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index afc76024d1..179a1184af 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -865,7 +865,7 @@ void LLXUIParser::writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock &bloc { mWriteRootNode = node; name_stack_t name_stack = Parser::name_stack_t(); - block.serializeBlock(*this, name_stack, diff_block); + block.serializeBlock(*this, name_stack, LLPredicate::Rule(), diff_block); mOutNodes.clear(); } -- cgit v1.2.3 From 7f97aa2d5db0d1429136a40d04d2e4428cb184fe Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 25 Oct 2012 17:30:03 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system fixed crash on exit --- indra/llui/llxuiparser.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 179a1184af..95cda92632 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -880,16 +880,24 @@ LLXMLNodePtr LLXUIParser::getNode(name_stack_t& stack) it = next_it) { ++next_it; + bool force_new_node = false; + if (it->first.empty()) { it->second = false; continue; } + if (next_it != stack.end() && next_it->first.empty() && next_it->second) + { + force_new_node = true; + } + + out_nodes_t::iterator found_it = mOutNodes.find(it->first); // node with this name not yet written - if (found_it == mOutNodes.end() || it->second) + if (found_it == mOutNodes.end() || it->second || force_new_node) { // make an attribute if we are the last element on the name stack bool is_attribute = next_it == stack.end(); -- cgit v1.2.3 From 819adb5eb4d7f982121f3dbd82750e05d26864d9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Nov 2012 00:26:44 -0700 Subject: SH-3405 FIX convert existing stats to lltrace system final removal of remaining LLStat code --- indra/llui/llstatbar.cpp | 138 ++++++++++++++++++++++++++++++++------------- indra/llui/llstatbar.h | 11 ++-- indra/llui/llstatgraph.cpp | 20 +++---- indra/llui/llstatgraph.h | 13 ++--- 4 files changed, 120 insertions(+), 62 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 535c6f96e3..6b40f8d475 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -34,7 +34,6 @@ #include "llgl.h" #include "llfontgl.h" -#include "llstat.h" #include "lluictrlfactory.h" #include "lltracerecording.h" @@ -46,8 +45,10 @@ LLStatBar::LLStatBar(const Params& p) mUnitLabel(p.unit_label), mMinBar(p.bar_min), mMaxBar(p.bar_max), - mStatp(LLStat::getInstance(p.stat)), - mNewStatp(LLTrace::Count<>::getInstance(p.stat)), + mCountFloatp(LLTrace::Count<>::getInstance(p.stat)), + mCountIntp(LLTrace::Count::getInstance(p.stat)), + mMeasurementFloatp(LLTrace::Measurement<>::getInstance(p.stat)), + mMeasurementIntp(LLTrace::Measurement::getInstance(p.stat)), mTickSpacing(p.tick_spacing), mLabelSpacing(p.label_spacing), mPrecision(p.precision), @@ -90,46 +91,62 @@ void LLStatBar::draw() max = 0.f, mean = 0.f; - if (mStatp) + LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); + + if (mCountFloatp) { - // Get the values. + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecordingPeriod(); + if (mPerSec) { - current = mStatp->getCurrentPerSec(); - min = mStatp->getMinPerSec(); - max = mStatp->getMaxPerSec(); - mean = mStatp->getMeanPerSec(); + current = last_frame_recording.getPerSec(*mCountFloatp); + min = frame_recording.getPeriodMinPerSec(*mCountFloatp); + max = frame_recording.getPeriodMaxPerSec(*mCountFloatp); + mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp); } else { - current = mStatp->getCurrent(); - min = mStatp->getMin(); - max = mStatp->getMax(); - mean = mStatp->getMean(); + current = last_frame_recording.getSum(*mCountFloatp); + min = frame_recording.getPeriodMin(*mCountFloatp); + max = frame_recording.getPeriodMax(*mCountFloatp); + mean = frame_recording.getPeriodMean(*mCountFloatp); } } - else if (mNewStatp) + else if (mCountIntp) { - LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); LLTrace::Recording& last_frame_recording = frame_recording.getLastRecordingPeriod(); - LLTrace::Recording& windowed_frame_recording = frame_recording.getTotalRecording(); if (mPerSec) { - current = last_frame_recording.getPerSec(*mNewStatp); - //min = frame_window_recording.getMin(*mNewStatp) / frame_window_recording.getDuration(); - //max = frame_window_recording.getMax(*mNewStatp) / frame_window_recording.getDuration(); - mean = windowed_frame_recording.getPerSec(*mNewStatp);//frame_window_recording.getMean(*mNewStatp) / frame_window_recording.getDuration(); + current = last_frame_recording.getPerSec(*mCountIntp); + min = frame_recording.getPeriodMinPerSec(*mCountIntp); + max = frame_recording.getPeriodMaxPerSec(*mCountIntp); + mean = frame_recording.getPeriodMeanPerSec(*mCountIntp); } else { - current = last_frame_recording.getSum(*mNewStatp); - //min = last_frame_recording.getMin(*mNewStatp); - //max = last_frame_recording.getMax(*mNewStatp); - mean = windowed_frame_recording.getSum(*mNewStatp); + current = last_frame_recording.getSum(*mCountIntp); + min = frame_recording.getPeriodMin(*mCountIntp); + max = frame_recording.getPeriodMax(*mCountIntp); + mean = frame_recording.getPeriodMean(*mCountIntp); } } - + else if (mMeasurementFloatp) + { + LLTrace::Recording& recording = frame_recording.getTotalRecording(); + current = recording.getLastValue(*mMeasurementFloatp); + min = recording.getMin(*mMeasurementFloatp); + max = recording.getMax(*mMeasurementFloatp); + mean = recording.getMean(*mMeasurementFloatp); + } + else if (mMeasurementIntp) + { + LLTrace::Recording& recording = frame_recording.getTotalRecording(); + current = recording.getLastValue(*mMeasurementIntp); + min = recording.getMin(*mMeasurementIntp); + max = recording.getMax(*mMeasurementIntp); + mean = recording.getMean(*mMeasurementIntp); + } if ((mUpdatesPerSec == 0.f) || (mUpdateTimer.getElapsedTimeF32() > 1.f/mUpdatesPerSec) || (mValue == 0.f)) { @@ -176,7 +193,7 @@ void LLStatBar::draw() LLFontGL::RIGHT, LLFontGL::TOP); value_format = llformat( "%%.%df", mPrecision); - if (mDisplayBar && mStatp) + if (mDisplayBar && (mCountFloatp || mCountIntp || mMeasurementFloatp || mMeasurementIntp)) { std::string tick_label; @@ -219,7 +236,7 @@ void LLStatBar::draw() right = width; gl_rect_2d(left, top, right, bottom, LLColor4(0.f, 0.f, 0.f, 0.25f)); - if (mStatp->getNumValues() == 0) + if (frame_recording.getNumPeriods() == 0) { // No data, don't draw anything... return; @@ -236,26 +253,58 @@ void LLStatBar::draw() right = (S32) ((max - mMinBar) * value_scale); gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 0.f, 0.f, 0.25f)); - if (mDisplayHistory) + if (mDisplayHistory && (mCountFloatp || mCountIntp || mMeasurementFloatp || mMeasurementIntp)) { - S32 num_values = mStatp->getNumValues() - 1; + S32 num_values = frame_recording.getNumPeriods() - 1; S32 i; - for (i = 0; i < num_values; i++) + for (i = 1; i <= num_values; i++) { - if (i == mStatp->getNextBin()) - { - continue; - } if (mPerSec) { - left = (S32)((mStatp->getPrevPerSec(i) - mMinBar) * value_scale); - right = (S32)((mStatp->getPrevPerSec(i) - mMinBar) * value_scale) + 1; + if (mCountFloatp) + { + left = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale); + right = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale) + 1; + } + else if (mCountIntp) + { + left = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale); + right = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale) + 1; + } + else if (mMeasurementFloatp) + { + left = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale); + right = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + } + else if (mMeasurementIntp) + { + left = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale); + right = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + } gl_rect_2d(left, bottom+i+1, right, bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f)); } else { - left = (S32)((mStatp->getPrev(i) - mMinBar) * value_scale); - right = (S32)((mStatp->getPrev(i) - mMinBar) * value_scale) + 1; + if (mCountFloatp) + { + left = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale); + right = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale) + 1; + } + else if (mCountIntp) + { + left = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale); + right = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale) + 1; + } + else if (mMeasurementFloatp) + { + left = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale); + right = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + } + else if (mMeasurementIntp) + { + left = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale); + right = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + } gl_rect_2d(left, bottom+i+1, right, bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f)); } } @@ -279,6 +328,15 @@ void LLStatBar::draw() LLView::draw(); } +void LLStatBar::setStat(const std::string& stat_name) +{ + mCountFloatp = LLTrace::Count<>::getInstance(stat_name); + mCountIntp = LLTrace::Count::getInstance(stat_name); + mMeasurementFloatp = LLTrace::Measurement<>::getInstance(stat_name); + mMeasurementIntp = LLTrace::Measurement::getInstance(stat_name); +} + + void LLStatBar::setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing) { mMinBar = bar_min; @@ -293,9 +351,9 @@ LLRect LLStatBar::getRequiredRect() if (mDisplayBar) { - if (mDisplayHistory && mStatp) + if (mDisplayHistory) { - rect.mTop = 35 + mStatp->getNumBins(); + rect.mTop = 35 + LLTrace::get_frame_recording().getNumPeriods(); } else { diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index d510f0e3fe..6aefb1e213 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -30,7 +30,6 @@ #include "llview.h" #include "llframetimer.h" #include "lltracerecording.h" -class LLStat; class LLStatBar : public LLView { @@ -79,7 +78,8 @@ public: virtual void draw(); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - void setStat(LLStat* stat) { mStatp = stat; } + void setStat(const std::string& stat_name); + void setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing); void getRange(F32& bar_min, F32& bar_max) { bar_min = mMinBar; bar_max = mMaxBar; } @@ -96,10 +96,11 @@ private: BOOL mDisplayBar; // Display the bar graph. BOOL mDisplayHistory; BOOL mDisplayMean; // If true, display mean, if false, display current value - LLTrace::PeriodicRecording* mFrameRecording; - LLStat* mStatp; - LLTrace::count_common_t* mNewStatp; + LLTrace::count_common_float_t* mCountFloatp; + LLTrace::count_common_int_t* mCountIntp; + LLTrace::measurement_common_float_t* mMeasurementFloatp; + LLTrace::measurement_common_int_t* mMeasurementIntp; LLFrameTimer mUpdateTimer; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index e961e7d3c0..22c276a018 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -32,7 +32,6 @@ #include "llmath.h" #include "llui.h" -#include "llstat.h" #include "llgl.h" #include "llglheaders.h" #include "lltracerecording.h" @@ -48,8 +47,8 @@ LLStatGraph::LLStatGraph(const Params& p) mPerSec(true), mPrecision(p.precision), mValue(p.value), - mStatp(p.stat.legacy_stat), - mNewStatp(p.stat.count_stat) + mNewStatFloatp(p.stat.count_stat_float), + mNewStatIntp(p.stat.count_stat_int) { setToolTip(p.name()); @@ -73,30 +72,31 @@ void LLStatGraph::draw() { F32 range, frac; range = mMax - mMin; - if (mStatp) + if (mNewStatFloatp) { + LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); + if (mPerSec) { - mValue = mStatp->getMeanPerSec(); + mValue = recording.getPerSec(*mNewStatFloatp); } else { - mValue = mStatp->getMean(); + mValue = recording.getSum(*mNewStatFloatp); } } - else if (mNewStatp) + else if (mNewStatIntp) { LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); if (mPerSec) { - mValue = recording.getPerSec(*mNewStatp); + mValue = recording.getPerSec(*mNewStatIntp); } else { - mValue = recording.getSum(*mNewStatp); + mValue = recording.getSum(*mNewStatIntp); } - } frac = (mValue - mMin) / range; diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index b20966d608..f33c784262 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -32,8 +32,6 @@ #include "v4color.h" #include "lltrace.h" -class LLStat; - class LLStatGraph : public LLView { public: @@ -59,9 +57,10 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative legacy_stat; - Alternative count_stat; - Alternative measurement_stat; + Alternative count_stat_float; + Alternative count_stat_int; + Alternative measurement_stat_float; + Alternative measurement_stat_int; }; struct Params : public LLInitParam::Block @@ -106,8 +105,8 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLStat* mStatp; - LLTrace::count_common_t* mNewStatp; + LLTrace::count_common_float_t* mNewStatFloatp; + LLTrace::count_common_int_t* mNewStatIntp; BOOL mPerSec; -- cgit v1.2.3 From 74fe126590fba03752d1d8d88dd3bb59c6900026 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Nov 2012 17:52:11 -0700 Subject: SH-3405 FIX convert existing stats to lltrace system output of floater_stats is now identical to pre-lltrace system (with some tweaks) --- indra/llui/llstatbar.cpp | 6 ++++++ indra/llui/llstatbar.h | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 6b40f8d475..1bc9a9fc67 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -53,6 +53,7 @@ LLStatBar::LLStatBar(const Params& p) mLabelSpacing(p.label_spacing), mPrecision(p.precision), mUpdatesPerSec(p.update_rate), + mUnitScale(p.unit_scale), mPerSec(p.show_per_sec), mDisplayBar(p.show_bar), mDisplayHistory(p.show_history), @@ -148,6 +149,11 @@ void LLStatBar::draw() mean = recording.getMean(*mMeasurementIntp); } + current *= mUnitScale; + min *= mUnitScale; + max *= mUnitScale; + mean *= mUnitScale; + if ((mUpdatesPerSec == 0.f) || (mUpdateTimer.getElapsedTimeF32() > 1.f/mUpdatesPerSec) || (mValue == 0.f)) { if (mDisplayMean) diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 6aefb1e213..083da8444e 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -44,7 +44,8 @@ public: bar_max, tick_spacing, label_spacing, - update_rate; + update_rate, + unit_scale; Optional precision; @@ -64,6 +65,7 @@ public: label_spacing("label_spacing", 10.0f), precision("precision", 0), update_rate("update_rate", 5.0f), + unit_scale("unit_scale", 1.f), show_per_sec("show_per_sec", true), show_bar("show_bar", TRUE), show_history("show_history", false), @@ -92,6 +94,7 @@ private: F32 mLabelSpacing; U32 mPrecision; F32 mUpdatesPerSec; + F32 mUnitScale; BOOL mPerSec; // Use the per sec stats. BOOL mDisplayBar; // Display the bar graph. BOOL mDisplayHistory; -- cgit v1.2.3 From bb6bda9eef48f5b08b56af46321b79fe7f1d49d7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Nov 2012 19:55:06 -0700 Subject: SH-3499 Ensure asset stats output is correct added support for specifying predicates for xui and llsd serialization --- indra/llui/llfloater.cpp | 4 ++-- indra/llui/llpanel.cpp | 4 ++-- indra/llui/lluictrlfactory.h | 2 +- indra/llui/llxuiparser.cpp | 4 ++-- indra/llui/llxuiparser.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d14fe441fb..c4a5d1f05e 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3085,7 +3085,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str parser.readXUI(node, output_params, LLUICtrlFactory::getInstance()->getCurFileName()); setupParamsForExport(output_params, parent); output_node->setName(node->getName()->mString); - parser.writeXUI(output_node, output_params, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); return TRUE; } @@ -3117,7 +3117,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str setupParamsForExport(output_params, parent); Params default_params(LLUICtrlFactory::getDefaultParams()); output_node->setName(node->getName()->mString); - parser.writeXUI(output_node, output_params, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); } // Default floater position to top-left corner of screen diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 00318cec6b..f3d6687e40 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -520,7 +520,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu Params output_params(params); setupParamsForExport(output_params, parent); output_node->setName(node->getName()->mString); - parser.writeXUI(output_node, output_params, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); return TRUE; } @@ -551,7 +551,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu Params output_params(params); setupParamsForExport(output_params, parent); output_node->setName(node->getName()->mString); - parser.writeXUI(output_node, output_params, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); } params.from_xui = true; diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 4e54354731..6513f97ca0 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -273,7 +273,7 @@ private: // Export only the differences between this any default params typename T::Params default_params(getDefaultParams()); copyName(node, output_node); - parser.writeXUI(output_node, output_params, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); } // Apply layout transformations, usually munging rect diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 95cda92632..6fc32dbf9c 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -861,11 +861,11 @@ bool LLXUIParser::readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& blo return any_parsed; } -void LLXUIParser::writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock &block, const LLInitParam::BaseBlock* diff_block) +void LLXUIParser::writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock &block, LLInitParam::predicate_rule_t rules, const LLInitParam::BaseBlock* diff_block) { mWriteRootNode = node; name_stack_t name_stack = Parser::name_stack_t(); - block.serializeBlock(*this, name_stack, LLPredicate::Rule(), diff_block); + block.serializeBlock(*this, name_stack, rules, diff_block); mOutNodes.clear(); } diff --git a/indra/llui/llxuiparser.h b/indra/llui/llxuiparser.h index d7cd256967..9b6b2a321b 100644 --- a/indra/llui/llxuiparser.h +++ b/indra/llui/llxuiparser.h @@ -109,7 +109,7 @@ public: /*virtual*/ void parserError(const std::string& message); void readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, const std::string& filename = LLStringUtil::null, bool silent=false); - void writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const LLInitParam::BaseBlock* diff_block = NULL); + void writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, LLInitParam::predicate_rule_t rules = LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, const LLInitParam::BaseBlock* diff_block = NULL); private: bool readXUIImpl(LLXMLNodePtr node, LLInitParam::BaseBlock& block); -- cgit v1.2.3 From f8eaee753174d0cab4e4edcf795f422706d6f302 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 2 Nov 2012 20:03:44 -0700 Subject: SH-3499 Ensure asset stats output is correct improvements to predicate API default rules encapsulated in LLInitParam removed empty flag from viewer asset stats --- indra/llui/llfloater.cpp | 5 ++--- indra/llui/llpanel.cpp | 4 ++-- indra/llui/lluictrlfactory.h | 4 +--- indra/llui/llxuiparser.cpp | 2 +- indra/llui/llxuiparser.h | 18 +++++++++++++++++- 5 files changed, 23 insertions(+), 10 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c4a5d1f05e..34556b8aeb 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3085,7 +3085,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str parser.readXUI(node, output_params, LLUICtrlFactory::getInstance()->getCurFileName()); setupParamsForExport(output_params, parent); output_node->setName(node->getName()->mString); - parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &default_params); return TRUE; } @@ -3115,9 +3115,8 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str { Params output_params(params); setupParamsForExport(output_params, parent); - Params default_params(LLUICtrlFactory::getDefaultParams()); output_node->setName(node->getName()->mString); - parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &default_params); } // Default floater position to top-left corner of screen diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index f3d6687e40..a5ffcc8ec7 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -520,7 +520,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu Params output_params(params); setupParamsForExport(output_params, parent); output_node->setName(node->getName()->mString); - parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &default_params); return TRUE; } @@ -551,7 +551,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu Params output_params(params); setupParamsForExport(output_params, parent); output_node->setName(node->getName()->mString); - parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &default_params); } params.from_xui = true; diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 6513f97ca0..b53b71f690 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -270,10 +270,8 @@ private: // We always want to output top-left coordinates typename T::Params output_params(params); T::setupParamsForExport(output_params, parent); - // Export only the differences between this any default params - typename T::Params default_params(getDefaultParams()); copyName(node, output_node); - parser.writeXUI(output_node, output_params, LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, &default_params); + parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &getDefaultParams()); } // Apply layout transformations, usually munging rect diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 6fc32dbf9c..0c91390bc1 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -861,7 +861,7 @@ bool LLXUIParser::readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& blo return any_parsed; } -void LLXUIParser::writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock &block, LLInitParam::predicate_rule_t rules, const LLInitParam::BaseBlock* diff_block) +void LLXUIParser::writeXUIImpl(LLXMLNodePtr node, const LLInitParam::BaseBlock &block, const LLInitParam::predicate_rule_t rules, const LLInitParam::BaseBlock* diff_block) { mWriteRootNode = node; name_stack_t name_stack = Parser::name_stack_t(); diff --git a/indra/llui/llxuiparser.h b/indra/llui/llxuiparser.h index 9b6b2a321b..8d0276a8ad 100644 --- a/indra/llui/llxuiparser.h +++ b/indra/llui/llxuiparser.h @@ -109,9 +109,25 @@ public: /*virtual*/ void parserError(const std::string& message); void readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, const std::string& filename = LLStringUtil::null, bool silent=false); - void writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, LLInitParam::predicate_rule_t rules = LLInitParam::predicate_rule_t(LLInitParam::PROVIDED) && LLInitParam::NON_DEFAULT, const LLInitParam::BaseBlock* diff_block = NULL); + template + void writeXUI(LLXMLNodePtr node, + const BLOCK& block, + const LLInitParam::predicate_rule_t rules = LLInitParam::default_parse_rules(), + const LLInitParam::BaseBlock* diff_block = NULL) + { + if (!diff_block + && !rules.isAmbivalent(LLInitParam::HAS_DEFAULT_VALUE)) + { + diff_block = &LLInitParam::defaultValue(); + } + writeXUIImpl(node, block, rules, diff_block); + } private: + void writeXUIImpl(LLXMLNodePtr node, + const LLInitParam::BaseBlock& block, + const LLInitParam::predicate_rule_t rules, + const LLInitParam::BaseBlock* diff_block); bool readXUIImpl(LLXMLNodePtr node, LLInitParam::BaseBlock& block); bool readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block); -- cgit v1.2.3 From ed17c181dd37f56b808838748d289ee7bb5567ec Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 7 Nov 2012 15:32:12 -0800 Subject: SH-3499 WIP Ensure asset stats output is correct further fixes to implicit conversion of unit types --- indra/llui/llnotifications.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 629eef2c3b..118c74b9b2 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -464,7 +464,7 @@ LLNotification::LLNotification(const LLNotification::Params& p) : mTimestamp(p.time_stamp), mSubstitutions(p.substitutions), mPayload(p.payload), - mExpiresAt(0), + mExpiresAt(0.0), mTemporaryResponder(false), mRespondedTo(false), mPriority(p.priority), -- cgit v1.2.3 From 67ec47e6da389661934ed2ddfa55ca58455fa7e5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 13 Nov 2012 17:10:10 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system moving fast timers into lltrace namespace and accumulation system --- indra/llui/llstatbar.h | 8 ++++---- indra/llui/llstatgraph.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 083da8444e..17c9c09cb2 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -100,10 +100,10 @@ private: BOOL mDisplayHistory; BOOL mDisplayMean; // If true, display mean, if false, display current value - LLTrace::count_common_float_t* mCountFloatp; - LLTrace::count_common_int_t* mCountIntp; - LLTrace::measurement_common_float_t* mMeasurementFloatp; - LLTrace::measurement_common_int_t* mMeasurementIntp; + LLTrace::TraceType >* mCountFloatp; + LLTrace::TraceType >* mCountIntp; + LLTrace::TraceType >* mMeasurementFloatp; + LLTrace::TraceType >* mMeasurementIntp; LLFrameTimer mUpdateTimer; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index f33c784262..09b34c2358 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,10 +57,10 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative count_stat_float; - Alternative count_stat_int; - Alternative measurement_stat_float; - Alternative measurement_stat_int; + Alternative >* > count_stat_float; + Alternative >* > count_stat_int; + Alternative >* > measurement_stat_float; + Alternative >* > measurement_stat_int; }; struct Params : public LLInitParam::Block -- cgit v1.2.3 From 9d77e030d9a0d23cebce616631677459eec1612c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 14 Nov 2012 23:52:27 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system cleaning up build moved most includes of windows.h to llwin32headers.h to disable min/max macros, etc streamlined Time class and consolidated functionality in BlockTimer class llfasttimer is no longer included via llstring.h, so had to add it manually in several places --- indra/llui/llfloaterreg.h | 1 + indra/llui/llstatbar.h | 8 ++++---- indra/llui/llstatgraph.h | 12 ++++++------ indra/llui/lluistring.cpp | 2 ++ indra/llui/llxuiparser.cpp | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index a1e1f8a988..e3b17dcb4f 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -30,6 +30,7 @@ #include "llrect.h" #include "llsd.h" +#include #include //******************************************************* diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 17c9c09cb2..c366fd65db 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -100,10 +100,10 @@ private: BOOL mDisplayHistory; BOOL mDisplayMean; // If true, display mean, if false, display current value - LLTrace::TraceType >* mCountFloatp; - LLTrace::TraceType >* mCountIntp; - LLTrace::TraceType >* mMeasurementFloatp; - LLTrace::TraceType >* mMeasurementIntp; + LLTrace::TraceType >* mCountFloatp; + LLTrace::TraceType >* mCountIntp; + LLTrace::TraceType >* mMeasurementFloatp; + LLTrace::TraceType >* mMeasurementIntp; LLFrameTimer mUpdateTimer; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 09b34c2358..57856ff6f2 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,10 +57,10 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative >* > count_stat_float; - Alternative >* > count_stat_int; - Alternative >* > measurement_stat_float; - Alternative >* > measurement_stat_int; + Alternative >* > count_stat_float; + Alternative >* > count_stat_int; + Alternative >* > measurement_stat_float; + Alternative >* > measurement_stat_int; }; struct Params : public LLInitParam::Block @@ -105,8 +105,8 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLTrace::count_common_float_t* mNewStatFloatp; - LLTrace::count_common_int_t* mNewStatIntp; + LLTrace::TraceType >* mNewStatFloatp; + LLTrace::TraceType >* mNewStatIntp; BOOL mPerSec; diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index c4e073ccdb..23fc53ea88 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -26,6 +26,8 @@ #include "linden_common.h" #include "lluistring.h" + +#include "llfasttimer.h" #include "llsd.h" #include "lltrans.h" diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 0c91390bc1..903f10ce10 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -29,7 +29,7 @@ #include "llxuiparser.h" #include "llxmlnode.h" - +#include "llfasttimer.h" #ifdef LL_STANDALONE #include #else -- cgit v1.2.3 From c180fe2ae2b5d2e00149f9902717e02ed7042143 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 19 Nov 2012 22:28:12 -0700 Subject: for SH-3561: capture the frame buffer contents and compare pixel differences between frames. --- indra/llui/llui.cpp | 28 +++++++++++++++++++++++----- indra/llui/llui.h | 4 +++- 2 files changed, 26 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 87bf518aa1..1dac622f32 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -724,9 +724,14 @@ void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LL gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), degrees, image, color, uv_rect ); } -void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect) +void gl_draw_scaled_target(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* target, const LLColor4& color, const LLRectf& uv_rect) { - if (NULL == image) + gl_draw_scaled_rotated_image(x, y, width, height, 0.f, NULL, color, uv_rect, target); +} + +void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect, LLRenderTarget* target) +{ + if (!image && !target) { llwarns << "image == NULL; aborting function" << llendl; return; @@ -734,8 +739,14 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre LLGLSUIDefault gls_ui; - - gGL.getTexUnit(0)->bind(image, true); + if(image != NULL) + { + gGL.getTexUnit(0)->bind(image, true); + } + else + { + gGL.getTexUnit(0)->bind(target); + } gGL.color4fv(color.mV); @@ -788,7 +799,14 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre LLMatrix3 quat(0.f, 0.f, degrees*DEG_TO_RAD); - gGL.getTexUnit(0)->bind(image, true); + if(image != NULL) + { + gGL.getTexUnit(0)->bind(image, true); + } + else + { + gGL.getTexUnit(0)->bind(target); + } gGL.color4fv(color.mV); diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 28e84fa444..d3c88cfb5f 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -58,6 +58,7 @@ class LLUUID; class LLWindow; class LLView; class LLHelp; +class LLRenderTarget; // UI colors extern const LLColor4 UI_VERTEX_COLOR; @@ -93,8 +94,9 @@ void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, void gl_draw_image(S32 x, S32 y, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); +void gl_draw_scaled_target(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* target, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); +void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), LLRenderTarget* target = NULL); void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -- cgit v1.2.3 From 2facd6374517d88f03e3f06b1ccc02565da26b45 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 6 Dec 2012 14:30:56 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system improved LLUnit compile time errors removed cassert in favor of llstatic_assert --- indra/llui/llview.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index ad9bec9f61..59577e95ac 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -30,7 +30,6 @@ #define LLVIEW_CPP #include "llview.h" -#include #include #include #include -- cgit v1.2.3 From 1f56e57008f5a50c9e75fc0b4512c483ac359a52 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 18 Dec 2012 00:58:26 -0800 Subject: SH-3468 WIP add memory tracking base class created memory tracking trace type instrumented a few classes with memory tracking --- indra/llui/lltextbase.cpp | 17 ++++++++++++++--- indra/llui/lltextbase.h | 5 ++++- indra/llui/lluictrl.cpp | 21 +++++++++++---------- indra/llui/llview.h | 3 ++- indra/llui/llviewmodel.cpp | 5 +++++ indra/llui/llviewmodel.h | 4 +++- 6 files changed, 39 insertions(+), 16 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 3815eec447..31d67a9e08 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -561,7 +561,7 @@ void LLTextBase::drawText() if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) ) { const LLWString& wstrText = getWText(); - mMisspellRanges.clear(); + memDisclaim(mMisspellRanges).clear(); segment_set_t::const_iterator seg_it = getSegIterContaining(start); while (mSegments.end() != seg_it) @@ -632,6 +632,7 @@ void LLTextBase::drawText() mSpellCheckStart = start; mSpellCheckEnd = end; + memClaim(mMisspellRanges); } } @@ -890,10 +891,12 @@ void LLTextBase::createDefaultSegment() // ensures that there is always at least one segment if (mSegments.empty()) { + memDisclaim(mSegments); LLStyleConstSP sp(new LLStyle(getDefaultStyleParams())); LLTextSegmentPtr default_segment = new LLNormalTextSegment( sp, 0, getLength() + 1, *this); mSegments.insert(default_segment); default_segment->linkToDocument(this); + memClaim(mSegments); } } @@ -904,6 +907,8 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) return; } + memDisclaim(mSegments); + segment_set_t::iterator cur_seg_iter = getSegIterContaining(segment_to_insert->getStart()); S32 reflow_start_index = 0; @@ -976,6 +981,7 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) // layout potentially changed needsReflow(reflow_start_index); + memClaim(mSegments); } BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) @@ -1271,8 +1277,11 @@ void LLTextBase::replaceWithSuggestion(U32 index) removeStringNoUndo(it->first, it->second - it->first); // Insert the suggestion in its place + memDisclaim(mSuggestionList); LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]); insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index])); + memClaim(mSuggestionList); + setCursorPos(it->first + (S32)suggestion.length()); break; @@ -1334,7 +1343,7 @@ bool LLTextBase::isMisspelledWord(U32 pos) const void LLTextBase::onSpellCheckSettingsChange() { // Recheck the spelling on every change - mMisspellRanges.clear(); + memDisclaim(mMisspellRanges).clear(); mSpellCheckStart = mSpellCheckEnd = -1; } @@ -1593,7 +1602,7 @@ LLRect LLTextBase::getTextBoundingRect() void LLTextBase::clearSegments() { - mSegments.clear(); + memDisclaim(mSegments).clear(); createDefaultSegment(); } @@ -3057,7 +3066,9 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) llwarns << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << llendl; return; } + memDisclaim(mTooltip); mTooltip = tooltip; + memClaim(mTooltip); } bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 90b147cee1..966dd93888 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -50,7 +50,10 @@ class LLUrlMatch; /// includes a start/end offset from the start of the string, a /// style to render with, an optional tooltip, etc. /// -class LLTextSegment : public LLRefCount, public LLMouseHandler +class LLTextSegment +: public LLRefCount, + public LLMouseHandler, + public LLTrace::MemTrackable { public: LLTextSegment(S32 start, S32 end) : mStart(start), mEnd(end){}; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index b9c843e931..08358484ef 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -118,6 +118,7 @@ LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) mDoubleClickSignal(NULL), mTransparencyType(TT_DEFAULT) { + memClaim(viewmodel.get()); } void LLUICtrl::initFromParams(const Params& p) @@ -940,7 +941,7 @@ boost::signals2::connection LLUICtrl::setCommitCallback( boost::function cb ) { - if (!mValidateSignal) mValidateSignal = new enable_signal_t(); + if (!mValidateSignal) mValidateSignal = memClaim(new enable_signal_t()); return mValidateSignal->connect(boost::bind(cb, _2)); } @@ -1003,55 +1004,55 @@ boost::signals2::connection LLUICtrl::setValidateCallback(const EnableCallbackPa boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb ) { - if (!mCommitSignal) mCommitSignal = new commit_signal_t(); + if (!mCommitSignal) mCommitSignal = memClaim(new commit_signal_t()); return mCommitSignal->connect(cb); } boost::signals2::connection LLUICtrl::setValidateCallback( const enable_signal_t::slot_type& cb ) { - if (!mValidateSignal) mValidateSignal = new enable_signal_t(); + if (!mValidateSignal) mValidateSignal = memClaim(new enable_signal_t()); return mValidateSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { - if (!mMouseEnterSignal) mMouseEnterSignal = new commit_signal_t(); + if (!mMouseEnterSignal) mMouseEnterSignal = memClaim(new commit_signal_t()); return mMouseEnterSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { - if (!mMouseLeaveSignal) mMouseLeaveSignal = new commit_signal_t(); + if (!mMouseLeaveSignal) mMouseLeaveSignal = memClaim(new commit_signal_t()); return mMouseLeaveSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseDownCallback( const mouse_signal_t::slot_type& cb ) { - if (!mMouseDownSignal) mMouseDownSignal = new mouse_signal_t(); + if (!mMouseDownSignal) mMouseDownSignal = memClaim(new mouse_signal_t()); return mMouseDownSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseUpCallback( const mouse_signal_t::slot_type& cb ) { - if (!mMouseUpSignal) mMouseUpSignal = new mouse_signal_t(); + if (!mMouseUpSignal) mMouseUpSignal = memClaim(new mouse_signal_t()); return mMouseUpSignal->connect(cb); } boost::signals2::connection LLUICtrl::setRightMouseDownCallback( const mouse_signal_t::slot_type& cb ) { - if (!mRightMouseDownSignal) mRightMouseDownSignal = new mouse_signal_t(); + if (!mRightMouseDownSignal) mRightMouseDownSignal = memClaim(new mouse_signal_t()); return mRightMouseDownSignal->connect(cb); } boost::signals2::connection LLUICtrl::setRightMouseUpCallback( const mouse_signal_t::slot_type& cb ) { - if (!mRightMouseUpSignal) mRightMouseUpSignal = new mouse_signal_t(); + if (!mRightMouseUpSignal) mRightMouseUpSignal = memClaim(new mouse_signal_t()); return mRightMouseUpSignal->connect(cb); } boost::signals2::connection LLUICtrl::setDoubleClickCallback( const mouse_signal_t::slot_type& cb ) { - if (!mDoubleClickSignal) mDoubleClickSignal = new mouse_signal_t(); + if (!mDoubleClickSignal) mDoubleClickSignal = memClaim(new mouse_signal_t()); return mDoubleClickSignal->connect(cb); } diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 1c35349510..29ee2125f9 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -101,7 +101,8 @@ class LLView : public LLMouseHandler, // handles mouse events public LLFocusableElement, // handles keyboard events public LLMortician, // lazy deletion - public LLHandleProvider // passes out weak references to self + public LLHandleProvider, // passes out weak references to self + public LLTrace::MemTrackable // track memory usage { public: struct Follows : public LLInitParam::ChoiceBlock diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index a9f8acc440..dff0dcb2fd 100644 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -80,7 +80,10 @@ LLTextViewModel::LLTextViewModel(const LLSD& value) void LLTextViewModel::setValue(const LLSD& value) { LLViewModel::setValue(value); + memDisclaim(mDisplay); mDisplay = utf8str_to_wstring(value.asString()); + memClaim(mDisplay); + // mDisplay and mValue agree mUpdateFromDisplay = false; } @@ -91,7 +94,9 @@ void LLTextViewModel::setDisplay(const LLWString& value) // and do the utf8str_to_wstring() to get the corresponding mDisplay // value. But a text editor might want to edit the display string // directly, then convert back to UTF8 on commit. + memDisclaim(mDisplay); mDisplay = value; + memClaim(mDisplay); mDirty = true; // Don't immediately convert to UTF8 -- do it lazily -- we expect many // more setDisplay() calls than getValue() calls. Just flag that it needs diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index ef2e314799..cec0368460 100644 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -60,7 +60,9 @@ typedef LLPointer LLListViewModelPtr; * LLViewModel data. This way, the LLViewModel is quietly deleted when the * last referencing widget is destroyed. */ -class LLViewModel: public LLRefCount +class LLViewModel +: public LLRefCount, + public LLTrace::MemTrackable { public: LLViewModel(); -- cgit v1.2.3 From c219282f5de753a044cecb53bd806145f68add9a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 18 Dec 2012 20:07:25 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system removed some potential data races got memory stats recording in trace system --- indra/llui/llviewmodel.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index cec0368460..a2ca20c739 100644 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -39,6 +39,7 @@ #include "llrefcount.h" #include "stdenums.h" #include "llstring.h" +#include "lltrace.h" #include class LLScrollListItem; -- cgit v1.2.3 From cbff0e7ab8afeebb6ddab854d35ea12ef9a9930a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 4 Jan 2013 13:48:35 -0800 Subject: SH-3468 WIP add memory tracking base class attempted fix for gcc compile errors can't use typeid() on a class that doesn't have a method defined in a translation unit fix is to force classes deriving from LLMemTrackable to use their own static member named sMemStat --- indra/llui/lltextbase.cpp | 2 ++ indra/llui/lltextbase.h | 10 ++++++---- indra/llui/llview.cpp | 1 + indra/llui/llview.h | 1 + indra/llui/llviewmodel.cpp | 2 ++ indra/llui/llviewmodel.h | 2 ++ 6 files changed, 14 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 31d67a9e08..74e966560e 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -47,6 +47,8 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; +LLTrace::MemStat LLTextSegment::sMemStat("LLTextSegment"); + LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num) : mDocIndexStart(index_start), mDocIndexEnd(index_end), diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 966dd93888..7d791ec75a 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -94,10 +94,12 @@ public: /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; /*virtual*/ BOOL hasMouseCapture(); - S32 getStart() const { return mStart; } - void setStart(S32 start) { mStart = start; } - S32 getEnd() const { return mEnd; } - void setEnd( S32 end ) { mEnd = end; } + S32 getStart() const { return mStart; } + void setStart(S32 start) { mStart = start; } + S32 getEnd() const { return mEnd; } + void setEnd( S32 end ) { mEnd = end; } + + static LLTrace::MemStat sMemStat; protected: S32 mStart; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 59577e95ac..47bf410af6 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -67,6 +67,7 @@ LLView* LLView::sPreviewClickedElement = NULL; BOOL LLView::sDrawPreviewHighlights = FALSE; S32 LLView::sLastLeftXML = S32_MIN; S32 LLView::sLastBottomXML = S32_MIN; +LLTrace::MemStat LLView::sMemStat("LLView"); std::vector LLViewDrawContext::sDrawContextStack; LLView::DrilldownFunc LLView::sDrilldown = diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 29ee2125f9..256f86c00d 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -673,6 +673,7 @@ public: static S32 sLastLeftXML; static S32 sLastBottomXML; static BOOL sForceReshape; + static LLTrace::MemStat sMemStat; }; class LLCompareByTabOrder diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index dff0dcb2fd..1bd09e8086 100644 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -35,6 +35,8 @@ // external library headers // other Linden headers +LLTrace::MemStat LLViewModel::sMemStat("LLViewModel"); + /// LLViewModel::LLViewModel() : mDirty(false) diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index a2ca20c739..214780393b 100644 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -83,6 +83,8 @@ public: // void setDirty() { mDirty = true; } + static LLTrace::MemStat sMemStat; + protected: LLSD mValue; bool mDirty; -- cgit v1.2.3 From a441664c109e4fca4154dbf80e108c27b3e9e601 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 31 Jan 2013 00:50:54 -0800 Subject: SH-3275 WIP interesting Update viewer metrics system to be more flexible fast timer bars render correctly --- indra/llui/llui.cpp | 21 +++++++++++---------- indra/llui/llui.h | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 6a87977718..fe6203f51d 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1306,10 +1306,7 @@ void gl_segmented_rect_2d_tex(const S32 left, } //FIXME: rewrite to use scissor? -void gl_segmented_rect_2d_fragment_tex(const S32 left, - const S32 top, - const S32 right, - const S32 bottom, +void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, const S32 texture_width, const S32 texture_height, const S32 border_size, @@ -1317,6 +1314,10 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, const F32 end_fragment, const U32 edges) { + const S32 left = rect.mLeft; + const S32 right = rect.mRight; + const S32 top = rect.mTop; + const S32 bottom = rect.mBottom; S32 width = llabs(right - left); S32 height = llabs(top - bottom); @@ -1354,9 +1355,9 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, { if (start_fragment < middle_start) { - u_min = (start_fragment / middle_start) * border_uv_scale.mV[VX]; + u_min = (start_fragment / middle_start) * border_uv_scale.mV[VX]; u_max = llmin(end_fragment / middle_start, 1.f) * border_uv_scale.mV[VX]; - x_min = (start_fragment / middle_start) * border_width_left; + x_min = (start_fragment / middle_start) * border_width_left; x_max = llmin(end_fragment / middle_start, 1.f) * border_width_left; // draw bottom left @@ -1446,10 +1447,10 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, if (end_fragment > middle_end) { - u_min = (1.f - llmax(0.f, ((start_fragment - middle_end) / middle_start))) * border_uv_scale.mV[VX]; - u_max = (1.f - ((end_fragment - middle_end) / middle_start)) * border_uv_scale.mV[VX]; - x_min = width_vec - ((1.f - llmax(0.f, ((start_fragment - middle_end) / middle_start))) * border_width_right); - x_max = width_vec - ((1.f - ((end_fragment - middle_end) / middle_start)) * border_width_right); + u_min = 1.f - ((1.f - llmax(0.f, (start_fragment - middle_end) / middle_start)) * border_uv_scale.mV[VX]); + u_max = 1.f - ((1.f - ((end_fragment - middle_end) / middle_start)) * border_uv_scale.mV[VX]); + x_min = width_vec - ((1.f - llmax(0.f, (start_fragment - middle_end) / middle_start)) * border_width_right); + x_max = width_vec - ((1.f - ((end_fragment - middle_end) / middle_start)) * border_width_right); // draw bottom right gGL.texCoord2f(u_min, 0.f); diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 90a4617c4e..dfb9fa60c9 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -128,7 +128,7 @@ typedef enum e_rounded_edge void gl_segmented_rect_2d_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const U32 edges = ROUNDED_RECT_ALL); -void gl_segmented_rect_2d_fragment_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const F32 start_fragment, const F32 end_fragment, const U32 edges = ROUNDED_RECT_ALL); +void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, const S32 texture_width, const S32 texture_height, const S32 border_size, const F32 start_fragment, const F32 end_fragment, const U32 edges = ROUNDED_RECT_ALL); void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec, U32 edges = ROUNDED_RECT_ALL); void gl_segmented_rect_3d_tex_top(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec); -- cgit v1.2.3 From eb6c8959ca5b8b3c100114d4d659a48bb4d56b2c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sat, 2 Feb 2013 01:09:52 -0800 Subject: SH-3275 WIP interesting Update viewer metrics system to be more flexible fixed most fast timer display and interaction issues --- indra/llui/llui.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index fe6203f51d..b9d935847b 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1147,6 +1147,8 @@ void gl_rect_2d_simple( S32 width, S32 height ) gGL.end(); } +static LLFastTimer::DeclareTimer FTM_RENDER_SEGMENTED_RECT ("Render segmented rectangle"); + void gl_segmented_rect_2d_tex(const S32 left, const S32 top, const S32 right, @@ -1156,6 +1158,7 @@ void gl_segmented_rect_2d_tex(const S32 left, const S32 border_size, const U32 edges) { + LLFastTimer _(FTM_RENDER_SEGMENTED_RECT); S32 width = llabs(right - left); S32 height = llabs(top - bottom); @@ -1314,6 +1317,7 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, const F32 end_fragment, const U32 edges) { + LLFastTimer _(FTM_RENDER_SEGMENTED_RECT); const S32 left = rect.mLeft; const S32 right = rect.mRight; const S32 top = rect.mTop; @@ -1501,6 +1505,7 @@ void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& bo const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec, const U32 edges) { + LLFastTimer _(FTM_RENDER_SEGMENTED_RECT); LLVector3 left_border_width = ((edges & (~(U32)ROUNDED_RECT_RIGHT)) != 0) ? border_width : LLVector3::zero; LLVector3 right_border_width = ((edges & (~(U32)ROUNDED_RECT_LEFT)) != 0) ? border_width : LLVector3::zero; -- cgit v1.2.3 From f07b9c2c69f1f6882dcf249aacf33cdfacf878ab Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 6 Mar 2013 11:08:25 -0800 Subject: renamed LLTrace stat gathering classes/methods to make the structure of LLTrace clearer Count becomes CountStatHandle Count.sum becomes sum(Count, value), etc. --- indra/llui/llstatbar.cpp | 16 ++++++++-------- indra/llui/lltextbase.cpp | 2 +- indra/llui/lltextbase.h | 2 +- indra/llui/llview.cpp | 2 +- indra/llui/llview.h | 2 +- indra/llui/llviewmodel.cpp | 2 +- indra/llui/llviewmodel.h | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 1bc9a9fc67..954f615210 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -45,10 +45,10 @@ LLStatBar::LLStatBar(const Params& p) mUnitLabel(p.unit_label), mMinBar(p.bar_min), mMaxBar(p.bar_max), - mCountFloatp(LLTrace::Count<>::getInstance(p.stat)), - mCountIntp(LLTrace::Count::getInstance(p.stat)), - mMeasurementFloatp(LLTrace::Measurement<>::getInstance(p.stat)), - mMeasurementIntp(LLTrace::Measurement::getInstance(p.stat)), + mCountFloatp(LLTrace::CountStatHandle<>::getInstance(p.stat)), + mCountIntp(LLTrace::CountStatHandle::getInstance(p.stat)), + mMeasurementFloatp(LLTrace::MeasurementStatHandle<>::getInstance(p.stat)), + mMeasurementIntp(LLTrace::MeasurementStatHandle::getInstance(p.stat)), mTickSpacing(p.tick_spacing), mLabelSpacing(p.label_spacing), mPrecision(p.precision), @@ -336,10 +336,10 @@ void LLStatBar::draw() void LLStatBar::setStat(const std::string& stat_name) { - mCountFloatp = LLTrace::Count<>::getInstance(stat_name); - mCountIntp = LLTrace::Count::getInstance(stat_name); - mMeasurementFloatp = LLTrace::Measurement<>::getInstance(stat_name); - mMeasurementIntp = LLTrace::Measurement::getInstance(stat_name); + mCountFloatp = LLTrace::CountStatHandle<>::getInstance(stat_name); + mCountIntp = LLTrace::CountStatHandle::getInstance(stat_name); + mMeasurementFloatp = LLTrace::MeasurementStatHandle<>::getInstance(stat_name); + mMeasurementIntp = LLTrace::MeasurementStatHandle::getInstance(stat_name); } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 74e966560e..680b6ed16d 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -47,7 +47,7 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; -LLTrace::MemStat LLTextSegment::sMemStat("LLTextSegment"); +LLTrace::MemStatHandle LLTextSegment::sMemStat("LLTextSegment"); LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num) : mDocIndexStart(index_start), diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 7d791ec75a..2ce15d891a 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -99,7 +99,7 @@ public: S32 getEnd() const { return mEnd; } void setEnd( S32 end ) { mEnd = end; } - static LLTrace::MemStat sMemStat; + static LLTrace::MemStatHandle sMemStat; protected: S32 mStart; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 47bf410af6..587953477d 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -67,7 +67,7 @@ LLView* LLView::sPreviewClickedElement = NULL; BOOL LLView::sDrawPreviewHighlights = FALSE; S32 LLView::sLastLeftXML = S32_MIN; S32 LLView::sLastBottomXML = S32_MIN; -LLTrace::MemStat LLView::sMemStat("LLView"); +LLTrace::MemStatHandle LLView::sMemStat("LLView"); std::vector LLViewDrawContext::sDrawContextStack; LLView::DrilldownFunc LLView::sDrilldown = diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 256f86c00d..e18cfff8e5 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -673,7 +673,7 @@ public: static S32 sLastLeftXML; static S32 sLastBottomXML; static BOOL sForceReshape; - static LLTrace::MemStat sMemStat; + static LLTrace::MemStatHandle sMemStat; }; class LLCompareByTabOrder diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index 1bd09e8086..901260bec8 100644 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -35,7 +35,7 @@ // external library headers // other Linden headers -LLTrace::MemStat LLViewModel::sMemStat("LLViewModel"); +LLTrace::MemStatHandle LLViewModel::sMemStat("LLViewModel"); /// LLViewModel::LLViewModel() diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index 214780393b..2c016d2560 100644 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -83,7 +83,7 @@ public: // void setDirty() { mDirty = true; } - static LLTrace::MemStat sMemStat; + static LLTrace::MemStatHandle sMemStat; protected: LLSD mValue; -- cgit v1.2.3 From 7b4d27ecbcb5ac702459be97cbf6b81354850658 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 14 Mar 2013 19:36:50 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics collapsed Orientation enums to all use LLView::EOrientation added ability to display stat bar horizontally --- indra/llui/lllayoutstack.cpp | 8 +- indra/llui/lllayoutstack.h | 19 +--- indra/llui/llscrollbar.h | 6 +- indra/llui/llscrollcontainer.cpp | 4 +- indra/llui/llscrollcontainer.h | 3 +- indra/llui/llslider.h | 4 +- indra/llui/llstatbar.cpp | 187 +++++++++++++++++++++++++-------------- indra/llui/llstatbar.h | 39 ++++---- indra/llui/llstatgraph.cpp | 17 ---- indra/llui/llstatgraph.h | 4 +- indra/llui/lltoolbar.cpp | 10 +-- indra/llui/lltoolbar.h | 2 +- indra/llui/llview.cpp | 10 +++ indra/llui/llview.h | 13 +++ 14 files changed, 182 insertions(+), 144 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 4c730286da..194d2b700c 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -42,12 +42,6 @@ static const F32 MAX_FRACTIONAL_SIZE = 1.f; static LLDefaultChildRegistry::Register register_layout_stack("layout_stack"); static LLLayoutStack::LayoutStackRegistry::Register register_layout_panel("layout_panel"); -void LLLayoutStack::OrientationNames::declareValues() -{ - declare("horizontal", HORIZONTAL); - declare("vertical", VERTICAL); -} - // // LLLayoutPanel // @@ -141,7 +135,7 @@ S32 LLLayoutPanel::getVisibleDim() const + (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt)))); } -void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientation ) +void LLLayoutPanel::setOrientation( LLView::EOrientation orientation ) { mOrientation = orientation; S32 layout_dim = llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL) diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 648cd5fdce..f1668d7473 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -37,24 +37,13 @@ class LLLayoutPanel; class LLLayoutStack : public LLView, public LLInstanceTracker { public: - typedef enum e_layout_orientation - { - HORIZONTAL, - VERTICAL - } ELayoutOrientation; - - struct OrientationNames - : public LLInitParam::TypeValuesHelper - { - static void declareValues(); - }; struct LayoutStackRegistry : public LLChildRegistry {}; struct Params : public LLInitParam::Block { - Mandatory orientation; + Mandatory orientation; Optional border_size; Optional animate, clip; @@ -104,7 +93,7 @@ private: bool animatePanels(); void createResizeBar(LLLayoutPanel* panel); - const ELayoutOrientation mOrientation; + const EOrientation mOrientation; typedef std::vector e_panel_list_t; e_panel_list_t mPanels; @@ -179,7 +168,7 @@ public: F32 getVisibleAmount() const; S32 getVisibleDim() const; - void setOrientation(LLLayoutStack::ELayoutOrientation orientation); + void setOrientation(LLView::EOrientation orientation); void storeOriginalDim(); void setIgnoreReshape(bool ignore) { mIgnoreReshape = ignore; } @@ -198,7 +187,7 @@ protected: F32 mFractionalSize; S32 mTargetDim; bool mIgnoreReshape; - LLLayoutStack::ELayoutOrientation mOrientation; + LLView::EOrientation mOrientation; class LLResizeBar* mResizeBar; }; diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index ff74f753b9..3f3ca1378b 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -40,13 +40,11 @@ class LLScrollbar { public: - enum ORIENTATION { HORIZONTAL, VERTICAL }; - typedef boost::function callback_t; struct Params : public LLInitParam::Block { - Mandatory orientation; + Mandatory orientation; Mandatory doc_size; Mandatory doc_pos; Mandatory page_size; @@ -131,7 +129,7 @@ private: callback_t mChangeCallback; - const ORIENTATION mOrientation; + const EOrientation mOrientation; S32 mDocSize; // Size of the document that the scrollbar is modeling. Units depend on the user. 0 <= mDocSize. S32 mDocPos; // Position within the doc that the scrollbar is modeling, in "lines" (user size) S32 mPageSize; // Maximum number of lines that can be seen at one time. diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 2fd187a526..2abfb15494 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -140,7 +140,7 @@ LLScrollContainer::~LLScrollContainer( void ) { // mScrolledView and mScrollbar are child views, so the LLView // destructor takes care of memory deallocation. - for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) + for( S32 i = 0; i < ORIENTATION_COUNT; i++ ) { mScrollbar[i] = NULL; } @@ -211,7 +211,7 @@ BOOL LLScrollContainer::handleKeyHere(KEY key, MASK mask) { return TRUE; } - for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) + for( S32 i = 0; i < ORIENTATION_COUNT; i++ ) { if( mScrollbar[i]->handleKeyHere(key, mask) ) { diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index d87c95b3d7..f9ce4a74ef 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -56,7 +56,6 @@ class LLScrollContainer : public LLUICtrl public: // Note: vertical comes before horizontal because vertical // scrollbars have priority for mouse and keyboard events. - enum SCROLL_ORIENTATION { VERTICAL, HORIZONTAL, SCROLLBAR_COUNT }; struct Params : public LLInitParam::Block { @@ -126,7 +125,7 @@ private: void updateScroll(); void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const; - LLScrollbar* mScrollbar[SCROLLBAR_COUNT]; + LLScrollbar* mScrollbar[ORIENTATION_COUNT]; S32 mSize; BOOL mIsOpaque; LLUIColor mBackgroundColor; diff --git a/indra/llui/llslider.h b/indra/llui/llslider.h index 700c17ea3e..3b492d8182 100644 --- a/indra/llui/llslider.h +++ b/indra/llui/llslider.h @@ -34,8 +34,6 @@ class LLSlider : public LLF32UICtrl { public: - enum ORIENTATION { HORIZONTAL, VERTICAL }; - struct Params : public LLInitParam::Block { Optional orientation; @@ -98,7 +96,7 @@ private: LLPointer mTrackHighlightHorizontalImage; LLPointer mTrackHighlightVerticalImage; - const ORIENTATION mOrientation; + const EOrientation mOrientation; LLRect mThumbRect; LLUIColor mTrackColor; diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 954f615210..2bc385061a 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -57,7 +57,8 @@ LLStatBar::LLStatBar(const Params& p) mPerSec(p.show_per_sec), mDisplayBar(p.show_bar), mDisplayHistory(p.show_history), - mDisplayMean(p.show_mean) + mDisplayMean(p.show_mean), + mOrientation(p.orientation) {} BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) @@ -167,15 +168,27 @@ void LLStatBar::draw() mUpdateTimer.reset(); } - S32 width = getRect().getWidth() - 40; - S32 max_width = width; - S32 bar_top = getRect().getHeight() - 15; // 16 pixels from top. - S32 bar_height = bar_top - 20; - S32 tick_height = 4; - S32 tick_width = 1; - S32 left, top, right, bottom; + S32 bar_top, bar_left, bar_right, bar_bottom; + if (mOrientation == HORIZONTAL) + { + bar_top = getRect().getHeight() - 15; + bar_left = 0; + bar_right = getRect().getWidth() - 80; + bar_bottom = 0; + } + else // VERTICAL + { + bar_top = getRect().getHeight() - 15; // 16 pixels from top. + bar_left = 0; + bar_right = getRect().getWidth(); + bar_bottom = 20; + } + const S32 tick_length = 4; + const S32 tick_width = 1; - F32 value_scale = max_width/(mMaxBar - mMinBar); + F32 value_scale = (mOrientation == HORIZONTAL) + ? (bar_top - bar_bottom)/(mMaxBar - mMinBar) + : (bar_right - bar_left)/(mMaxBar - mMinBar); LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), LLFontGL::LEFT, LLFontGL::TOP); @@ -194,9 +207,16 @@ void LLStatBar::draw() } // Draw the value. - LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, width, getRect().getHeight(), - LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::RIGHT, LLFontGL::TOP); + if (mOrientation == HORIZONTAL) + { + + } + else + { + LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, bar_right, getRect().getHeight(), + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::RIGHT, LLFontGL::TOP); + } value_format = llformat( "%%.%df", mPrecision); if (mDisplayBar && (mCountFloatp || mCountIntp || mMeasurementFloatp || mMeasurementIntp)) @@ -204,64 +224,75 @@ void LLStatBar::draw() std::string tick_label; // Draw the tick marks. - F32 tick_value; - top = bar_top; - bottom = bar_top - bar_height - tick_height/2; - LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - for (tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mTickSpacing) + for (F32 tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mTickSpacing) { - left = llfloor((tick_value - mMinBar)*value_scale); - right = left + tick_width; - gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.1f)); + const S32 begin = llfloor((tick_value - mMinBar)*value_scale); + const S32 end = begin + tick_width; + if (mOrientation == HORIZONTAL) + { + } + else + { + gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length/2, LLColor4(1.f, 1.f, 1.f, 0.1f)); + } } // Draw the tick labels (and big ticks). - bottom = bar_top - bar_height - tick_height; - for (tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mLabelSpacing) + for (F32 tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mLabelSpacing) { - left = llfloor((tick_value - mMinBar)*value_scale); - right = left + tick_width; - gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f)); - + const S32 begin = llfloor((tick_value - mMinBar)*value_scale); + const S32 end = begin + tick_width; tick_label = llformat( value_format.c_str(), tick_value); + // draw labels for the tick marks - LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height, - LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::LEFT, LLFontGL::TOP); + if (mOrientation == HORIZONTAL) + { + } + else + { + gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length, LLColor4(1.f, 1.f, 1.f, 0.25f)); + LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, begin - 1, bar_bottom - tick_length, + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::LEFT, LLFontGL::TOP); + } } - // Now, draw the bars - top = bar_top; - bottom = bar_top - bar_height; - // draw background bar. - left = 0; - right = width; - gl_rect_2d(left, top, right, bottom, LLColor4(0.f, 0.f, 0.f, 0.25f)); + gl_rect_2d(bar_left, bar_top, bar_right, bar_bottom, LLColor4(0.f, 0.f, 0.f, 0.25f)); if (frame_recording.getNumPeriods() == 0) { // No data, don't draw anything... return; } + // draw min and max - left = (S32) ((min - mMinBar) * value_scale); + S32 begin = (S32) ((min - mMinBar) * value_scale); - if (left < 0) + if (begin < 0) { - left = 0; + begin = 0; llwarns << "Min:" << min << llendl; } - right = (S32) ((max - mMinBar) * value_scale); - gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 0.f, 0.f, 0.25f)); + S32 end = (S32) ((max - mMinBar) * value_scale); + if (mOrientation == HORIZONTAL) + { + gl_rect_2d(bar_left, end, bar_right, begin, LLColor4(1.f, 0.f, 0.f, 0.25f)); + } + else // VERTICAL + { + gl_rect_2d(begin, bar_top, end, bar_bottom, LLColor4(1.f, 0.f, 0.f, 0.25f)); + } if (mDisplayHistory && (mCountFloatp || mCountIntp || mMeasurementFloatp || mMeasurementIntp)) { - S32 num_values = frame_recording.getNumPeriods() - 1; + const S32 num_values = frame_recording.getNumPeriods() - 1; + S32 begin = 0; + S32 end = 0; S32 i; for (i = 1; i <= num_values; i++) { @@ -269,66 +300,86 @@ void LLStatBar::draw() { if (mCountFloatp) { - left = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale); - right = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale) + 1; + begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale); + end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale) + 1; } else if (mCountIntp) { - left = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale); - right = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale) + 1; + begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale); + end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale) + 1; } else if (mMeasurementFloatp) { - left = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale); - right = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale); + end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; } else if (mMeasurementIntp) { - left = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale); - right = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale); + end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale) + 1; } - gl_rect_2d(left, bottom+i+1, right, bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f)); } else { if (mCountFloatp) { - left = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale); - right = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale) + 1; + begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale); + end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale) + 1; } else if (mCountIntp) { - left = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale); - right = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale) + 1; + begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale); + end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale) + 1; } else if (mMeasurementFloatp) { - left = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale); - right = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale); + end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; } else if (mMeasurementIntp) { - left = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale); - right = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale); + end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale) + 1; } - gl_rect_2d(left, bottom+i+1, right, bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f)); + } + if (mOrientation == HORIZONTAL) + { + gl_rect_2d(bar_right - i, end, bar_right - i - 1, begin, LLColor4(1.f, 0.f, 0.f, 1.f)); + } + else + { + gl_rect_2d(begin, bar_bottom+i+1, end, bar_bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f)); } } } else { + S32 begin = (S32) ((current - mMinBar) * value_scale) - 1; + S32 end = (S32) ((current - mMinBar) * value_scale) + 1; // draw current - left = (S32) ((current - mMinBar) * value_scale) - 1; - right = (S32) ((current - mMinBar) * value_scale) + 1; - gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 0.f, 0.f, 1.f)); + if (mOrientation == HORIZONTAL) + { + gl_rect_2d(bar_left, end, bar_right, begin, LLColor4(1.f, 0.f, 0.f, 1.f)); + } + else + { + gl_rect_2d(begin, bar_top, end, bar_bottom, LLColor4(1.f, 0.f, 0.f, 1.f)); + } } // draw mean bar - top = bar_top + 2; - bottom = bar_top - bar_height - 2; - left = (S32) ((mean - mMinBar) * value_scale) - 1; - right = (S32) ((mean - mMinBar) * value_scale) + 1; - gl_rect_2d(left, top, right, bottom, LLColor4(0.f, 1.f, 0.f, 1.f)); + { + const S32 begin = (S32) ((mean - mMinBar) * value_scale) - 1; + const S32 end = (S32) ((mean - mMinBar) * value_scale) + 1; + if (mOrientation == HORIZONTAL) + { + gl_rect_2d(bar_left - 2, begin, bar_right + 2, end, LLColor4(0.f, 1.f, 0.f, 1.f)); + } + else + { + gl_rect_2d(begin, bar_top + 2, end, bar_bottom - 2, LLColor4(0.f, 1.f, 0.f, 1.f)); + } + } } LLView::draw(); diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index c366fd65db..0ec8aaeaa9 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -55,6 +55,7 @@ public: show_mean; Optional stat; + Optional orientation; Params() : label("label"), @@ -70,7 +71,8 @@ public: show_bar("show_bar", TRUE), show_history("show_history", false), show_mean("show_mean", true), - stat("stat") + stat("stat"), + orientation("orientation", VERTICAL) { changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT); } @@ -88,27 +90,28 @@ public: /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. private: - F32 mMinBar; - F32 mMaxBar; - F32 mTickSpacing; - F32 mLabelSpacing; - U32 mPrecision; - F32 mUpdatesPerSec; - F32 mUnitScale; - BOOL mPerSec; // Use the per sec stats. - BOOL mDisplayBar; // Display the bar graph. - BOOL mDisplayHistory; - BOOL mDisplayMean; // If true, display mean, if false, display current value - - LLTrace::TraceType >* mCountFloatp; - LLTrace::TraceType >* mCountIntp; + F32 mMinBar; + F32 mMaxBar; + F32 mTickSpacing; + F32 mLabelSpacing; + U32 mPrecision; + F32 mUpdatesPerSec; + F32 mUnitScale; + bool mPerSec; // Use the per sec stats. + bool mDisplayBar; // Display the bar graph. + bool mDisplayHistory; + bool mDisplayMean; // If true, display mean, if false, display current value + EOrientation mOrientation; + + LLTrace::TraceType >* mCountFloatp; + LLTrace::TraceType >* mCountIntp; LLTrace::TraceType >* mMeasurementFloatp; LLTrace::TraceType >* mMeasurementIntp; LLFrameTimer mUpdateTimer; - LLUIString mLabel; - std::string mUnitLabel; - F32 mValue; + LLUIString mLabel; + std::string mUnitLabel; + F32 mValue; }; #endif diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index 22c276a018..bdb378c9c5 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -58,14 +58,6 @@ LLStatGraph::LLStatGraph(const Params& p) { mThresholds.push_back(Threshold(it->value(), it->color)); } - - //mThresholdColors[0] = LLColor4(0.f, 1.f, 0.f, 1.f); - //mThresholdColors[1] = LLColor4(1.f, 1.f, 0.f, 1.f); - //mThresholdColors[2] = LLColor4(1.f, 0.f, 0.f, 1.f); - //mThresholdColors[3] = LLColor4(1.f, 0.f, 0.f, 1.f); - //mThresholds[0] = 50.f; - //mThresholds[1] = 75.f; - //mThresholds[2] = 100.f; } void LLStatGraph::draw() @@ -116,15 +108,6 @@ void LLStatGraph::draw() LLColor4 color; - //S32 i; - //for (i = 0; i < mNumThresholds - 1; i++) - //{ - // if (mThresholds[i] > mValue) - // { - // break; - // } - //} - threshold_vec_t::iterator it = std::lower_bound(mThresholds.begin(), mThresholds.end(), Threshold(mValue / mMax, LLUIColor())); if (it != mThresholds.begin()) diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 57856ff6f2..c9e33ed902 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,8 +57,8 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative >* > count_stat_float; - Alternative >* > count_stat_int; + Alternative >* > count_stat_float; + Alternative >* > count_stat_int; Alternative >* > measurement_stat_float; Alternative >* > measurement_stat_int; }; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 81ea0ebf0c..2297285c39 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -42,9 +42,9 @@ namespace LLToolBarEnums { - LLLayoutStack::ELayoutOrientation getOrientation(SideType sideType) + LLView::EOrientation getOrientation(SideType sideType) { - LLLayoutStack::ELayoutOrientation orientation = LLLayoutStack::HORIZONTAL; + LLView::EOrientation orientation = LLLayoutStack::HORIZONTAL; if ((sideType == SIDE_LEFT) || (sideType == SIDE_RIGHT)) { @@ -172,7 +172,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) // Initialize the base object LLUICtrl::initFromParams(p); - LLLayoutStack::ELayoutOrientation orientation = getOrientation(p.side); + LLView::EOrientation orientation = getOrientation(p.side); LLLayoutStack::Params centering_stack_p; centering_stack_p.name = "centering_stack"; @@ -524,7 +524,7 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y) int rank = 0; // Convert the toolbar coord into button panel coords - LLLayoutStack::ELayoutOrientation orientation = getOrientation(mSideType); + LLView::EOrientation orientation = getOrientation(mSideType); S32 button_panel_x = 0; S32 button_panel_y = 0; localPointToOtherView(x, y, &button_panel_x, &button_panel_y, mButtonPanel); @@ -643,7 +643,7 @@ void LLToolBar::updateLayoutAsNeeded() { if (!mNeedsLayout) return; - LLLayoutStack::ELayoutOrientation orientation = getOrientation(mSideType); + LLView::EOrientation orientation = getOrientation(mSideType); // our terminology for orientation-agnostic layout is such that // length refers to a distance in the direction we stack the buttons diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index a50c60282c..2ffcc8b574 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -124,7 +124,7 @@ namespace LLToolBarEnums SIDE_TOP, }; - LLLayoutStack::ELayoutOrientation getOrientation(SideType sideType); + LLView::EOrientation getOrientation(SideType sideType); } // NOTE: This needs to occur before Param block declaration for proper compilation. diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 587953477d..ba88396294 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -83,6 +83,16 @@ template class LLView* LLView::getChild( static LLDefaultChildRegistry::Register r("view"); +namespace LLInitParam +{ + void TypeValues::declareValues() + { + declare("horizontal", LLView::HORIZONTAL); + declare("vertical", LLView::VERTICAL); + } +} + + LLView::Follows::Follows() : string(""), flags("flags", FOLLOWS_LEFT | FOLLOWS_TOP) diff --git a/indra/llui/llview.h b/indra/llui/llview.h index e18cfff8e5..88813da3c6 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -105,6 +105,9 @@ class LLView public LLTrace::MemTrackable // track memory usage { public: + + enum EOrientation { HORIZONTAL, VERTICAL, ORIENTATION_COUNT }; + struct Follows : public LLInitParam::ChoiceBlock { Alternative string; @@ -676,6 +679,16 @@ public: static LLTrace::MemStatHandle sMemStat; }; +namespace LLInitParam +{ +template<> +struct TypeValues : public LLInitParam::TypeValuesHelper +{ + static void declareValues(); +}; +} + + class LLCompareByTabOrder { public: -- cgit v1.2.3 From 8de397b19ec9e2f6206fd5ae57dba96c70e78b74 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 18 Mar 2013 08:43:03 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics changed LLCriticalDamp to LLSmoothInterpolation and sped up interpolator lookup improvements to stats display of llstatbar added scene load stats floater accessed with ctrl|shift|2 --- indra/llui/llbutton.cpp | 4 +- indra/llui/lllayoutstack.cpp | 6 +- indra/llui/llmenugl.cpp | 2 +- indra/llui/llscrollbar.cpp | 4 +- indra/llui/llstatbar.cpp | 131 +++++++++++++++++++++++++++++++----------- indra/llui/llstatbar.h | 12 +++- indra/llui/lltabcontainer.cpp | 2 +- 7 files changed, 117 insertions(+), 44 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 705fe16559..93ffa7b70d 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -758,11 +758,11 @@ void LLButton::draw() mCurGlowStrength = lerp(mCurGlowStrength, mFlashing ? (flash? 1.0 : 0.0) : mHoverGlowStrength, - LLCriticalDamp::getInterpolant(0.05f)); + LLSmoothInterpolation::getInterpolant(0.05f)); } else { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLSmoothInterpolation::getInterpolant(0.05f)); } // Draw button image, if available. diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 194d2b700c..d4a310b8cf 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -586,7 +586,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLSmoothInterpolation::getInterpolant(mOpenTimeConstant)); if (panelp->mVisibleAmt > 0.99f) { panelp->mVisibleAmt = 1.f; @@ -611,7 +611,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLSmoothInterpolation::getInterpolant(mCloseTimeConstant)); if (panelp->mVisibleAmt < 0.001f) { panelp->mVisibleAmt = 0.f; @@ -638,7 +638,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLSmoothInterpolation::getInterpolant(mCloseTimeConstant)); } if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index cd6cc6a75e..13888920f9 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3673,7 +3673,7 @@ void LLTearOffMenu::draw() if (getRect().getHeight() != mTargetHeight) { // animate towards target height - reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(0.05f)))); + reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLSmoothInterpolation::getInterpolant(0.05f)))); } LLFloater::draw(); } diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 5d3bf7a670..92a80c73fe 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -493,11 +493,11 @@ void LLScrollbar::draw() BOOL hovered = getEnabled() && !other_captor && (hasMouseCapture() || mThumbRect.pointInRect(local_mouse_x, local_mouse_y)); if (hovered) { - mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); + mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLSmoothInterpolation::getInterpolant(0.05f)); } else { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLSmoothInterpolation::getInterpolant(0.05f)); } // Draw background and thumb. diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 2bc385061a..219ddad452 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -36,6 +36,7 @@ #include "lluictrlfactory.h" #include "lltracerecording.h" +#include "llcriticaldamp.h" /////////////////////////////////////////////////////////////////////////////////// @@ -45,6 +46,7 @@ LLStatBar::LLStatBar(const Params& p) mUnitLabel(p.unit_label), mMinBar(p.bar_min), mMaxBar(p.bar_max), + mCurMaxBar(p.bar_max), mCountFloatp(LLTrace::CountStatHandle<>::getInstance(p.stat)), mCountIntp(LLTrace::CountStatHandle::getInstance(p.stat)), mMeasurementFloatp(LLTrace::MeasurementStatHandle<>::getInstance(p.stat)), @@ -54,11 +56,14 @@ LLStatBar::LLStatBar(const Params& p) mPrecision(p.precision), mUpdatesPerSec(p.update_rate), mUnitScale(p.unit_scale), + mNumFrames(p.num_frames), + mMaxHeight(p.max_height), mPerSec(p.show_per_sec), mDisplayBar(p.show_bar), mDisplayHistory(p.show_history), mDisplayMean(p.show_mean), - mOrientation(p.orientation) + mOrientation(p.orientation), + mScaleRange(p.scale_range) {} BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) @@ -171,24 +176,38 @@ void LLStatBar::draw() S32 bar_top, bar_left, bar_right, bar_bottom; if (mOrientation == HORIZONTAL) { - bar_top = getRect().getHeight() - 15; + bar_top = llmax(5, getRect().getHeight() - 15); bar_left = 0; - bar_right = getRect().getWidth() - 80; - bar_bottom = 0; + bar_right = getRect().getWidth() - 40; + bar_bottom = llmin(bar_top - 5, 0); } else // VERTICAL { - bar_top = getRect().getHeight() - 15; // 16 pixels from top. + bar_top = llmax(5, getRect().getHeight() - 15); bar_left = 0; bar_right = getRect().getWidth(); - bar_bottom = 20; + bar_bottom = llmin(bar_top - 5, 20); } const S32 tick_length = 4; const S32 tick_width = 1; + if (mScaleRange) + { + F32 cur_max = mLabelSpacing; + while(max > cur_max) + { + cur_max += mLabelSpacing; + } + mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, cur_max, 0.05f); + } + else + { + mCurMaxBar = mMaxBar; + } + F32 value_scale = (mOrientation == HORIZONTAL) - ? (bar_top - bar_bottom)/(mMaxBar - mMinBar) - : (bar_right - bar_left)/(mMaxBar - mMinBar); + ? (bar_top - bar_bottom)/(mCurMaxBar - mMinBar) + : (bar_right - bar_left)/(mCurMaxBar - mMinBar); LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), LLFontGL::LEFT, LLFontGL::TOP); @@ -209,7 +228,9 @@ void LLStatBar::draw() // Draw the value. if (mOrientation == HORIZONTAL) { - + LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, bar_right, getRect().getHeight(), + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::RIGHT, LLFontGL::TOP); } else { @@ -227,12 +248,13 @@ void LLStatBar::draw() LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - for (F32 tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mTickSpacing) + for (F32 tick_value = mMinBar + mLabelSpacing; tick_value <= mCurMaxBar; tick_value += mTickSpacing) { const S32 begin = llfloor((tick_value - mMinBar)*value_scale); const S32 end = begin + tick_width; if (mOrientation == HORIZONTAL) { + gl_rect_2d(bar_left, end, bar_right - tick_length/2, begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); } else { @@ -241,7 +263,7 @@ void LLStatBar::draw() } // Draw the tick labels (and big ticks). - for (F32 tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mLabelSpacing) + for (F32 tick_value = mMinBar + mLabelSpacing; tick_value <= mCurMaxBar; tick_value += mLabelSpacing) { const S32 begin = llfloor((tick_value - mMinBar)*value_scale); const S32 end = begin + tick_width; @@ -250,13 +272,17 @@ void LLStatBar::draw() // draw labels for the tick marks if (mOrientation == HORIZONTAL) { + gl_rect_2d(bar_left, end, bar_right - tick_length, begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); + LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, bar_right, begin, + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::LEFT, LLFontGL::VCENTER); } else { gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length, LLColor4(1.f, 1.f, 1.f, 0.25f)); LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, begin - 1, bar_bottom - tick_length, LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::LEFT, LLFontGL::TOP); + LLFontGL::RIGHT, LLFontGL::TOP); } } @@ -288,69 +314,99 @@ void LLStatBar::draw() gl_rect_2d(begin, bar_top, end, bar_bottom, LLColor4(1.f, 0.f, 0.f, 0.25f)); } + F32 span = (mOrientation == HORIZONTAL) + ? (bar_right - bar_left) + : (bar_top - bar_bottom); + if (mDisplayHistory && (mCountFloatp || mCountIntp || mMeasurementFloatp || mMeasurementIntp)) { const S32 num_values = frame_recording.getNumPeriods() - 1; - S32 begin = 0; - S32 end = 0; + F32 begin = 0; + F32 end = 0; S32 i; - for (i = 1; i <= num_values; i++) + gGL.color4f( 1.f, 0.f, 0.f, 1.f ); + gGL.begin( LLRender::QUADS ); + const S32 max_frame = llmin(mNumFrames, num_values); + U32 num_samples = 0; + for (i = 1; i <= max_frame; i++) { + F32 offset = ((F32)i / (F32)mNumFrames) * span; + LLTrace::Recording& recording = frame_recording.getPrevRecordingPeriod(i); if (mPerSec) { if (mCountFloatp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getPerSec(*mCountFloatp) - mMinBar) * value_scale); + end = ((recording.getPerSec(*mCountFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mCountFloatp); } else if (mCountIntp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale) + 1; + begin = ((recording.getPerSec(*mCountIntp) - mMinBar) * value_scale); + end = ((recording.getPerSec(*mCountIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mCountIntp); } else if (mMeasurementFloatp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + //rate isn't defined for measurement stats, so use mean + begin = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mMeasurementFloatp); } else if (mMeasurementIntp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + //rate isn't defined for measurement stats, so use mean + begin = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale); + end = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mMeasurementIntp); } } else { if (mCountFloatp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getSum(*mCountFloatp) - mMinBar) * value_scale); + end = ((recording.getSum(*mCountFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mCountFloatp); } else if (mCountIntp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale) + 1; + begin = ((recording.getSum(*mCountIntp) - mMinBar) * value_scale); + end = ((recording.getSum(*mCountIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mCountIntp); } else if (mMeasurementFloatp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mMeasurementFloatp); } else if (mMeasurementIntp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale); + end = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mMeasurementIntp); } } + + if (!num_samples) continue; + if (mOrientation == HORIZONTAL) { - gl_rect_2d(bar_right - i, end, bar_right - i - 1, begin, LLColor4(1.f, 0.f, 0.f, 1.f)); + gGL.vertex2f((F32)bar_right - offset, end); + gGL.vertex2f((F32)bar_right - offset, begin); + gGL.vertex2f((F32)bar_right - offset - 1.f, begin); + gGL.vertex2f((F32)bar_right - offset - 1.f, end); } else { - gl_rect_2d(begin, bar_bottom+i+1, end, bar_bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f)); + gGL.vertex2i(begin, (F32)bar_bottom+offset+1.f); + gGL.vertex2i(begin, (F32)bar_bottom+offset); + gGL.vertex2i(end, (F32)bar_bottom+offset); + gGL.vertex2i(end, (F32)bar_bottom+offset+1.f); } } + gGL.end(); } else { @@ -410,7 +466,14 @@ LLRect LLStatBar::getRequiredRect() { if (mDisplayHistory) { - rect.mTop = 35 + LLTrace::get_frame_recording().getNumPeriods(); + if (mOrientation == HORIZONTAL) + { + rect.mTop = mMaxHeight; + } + else + { + rect.mTop = 35 + llmin(mMaxHeight, llmin(mNumFrames, LLTrace::get_frame_recording().getNumPeriods())); + } } else { diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 0ec8aaeaa9..a83ccbe9e5 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -52,8 +52,11 @@ public: Optional show_per_sec, show_bar, show_history, - show_mean; + show_mean, + scale_range; + Optional num_frames, + max_height; Optional stat; Optional orientation; @@ -71,6 +74,9 @@ public: show_bar("show_bar", TRUE), show_history("show_history", false), show_mean("show_mean", true), + scale_range("scale_range", true), + num_frames("num_frames", 300), + max_height("max_height", 200), stat("stat"), orientation("orientation", VERTICAL) { @@ -92,15 +98,19 @@ public: private: F32 mMinBar; F32 mMaxBar; + F32 mCurMaxBar; F32 mTickSpacing; F32 mLabelSpacing; U32 mPrecision; F32 mUpdatesPerSec; F32 mUnitScale; + S32 mNumFrames; + S32 mMaxHeight; bool mPerSec; // Use the per sec stats. bool mDisplayBar; // Display the bar graph. bool mDisplayHistory; bool mDisplayMean; // If true, display mean, if false, display current value + bool mScaleRange; EOrientation mOrientation; LLTrace::TraceType >* mCountFloatp; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 5fc2cc350d..4df35f77a5 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -406,7 +406,7 @@ void LLTabContainer::draw() } } - setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(0.08f))); + setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLSmoothInterpolation::getInterpolant(0.08f))); BOOL has_scroll_arrows = !getTabsHidden() && ((mMaxScrollPos > 0) || (mScrollPosPixels > 0)); if (!mIsVertical) -- cgit v1.2.3 From 1f507c3cfca0c7722ebeaf71883fbaa83988e1a9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 21 Mar 2013 00:37:20 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics copied over scene load frame differencing changes from viewer-interesting made periodicrecording flexible enough to allow for indefinite number of periods added scene loading stats floater fixed collapsing behavior of container views --- indra/llui/llcontainerview.cpp | 8 ++++++-- indra/llui/llcontainerview.h | 4 +--- indra/llui/llmultifloater.h | 3 --- indra/llui/llstatbar.cpp | 13 ++++++++++--- indra/llui/llstatbar.h | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llcontainerview.cpp b/indra/llui/llcontainerview.cpp index e08ccb0b78..06f8e72c9c 100644 --- a/indra/llui/llcontainerview.cpp +++ b/indra/llui/llcontainerview.cpp @@ -49,7 +49,6 @@ LLContainerView::LLContainerView(const LLContainerView::Params& p) mLabel(p.label), mDisplayChildren(p.display_children) { - mCollapsible = TRUE; mScrollContainer = NULL; } @@ -75,6 +74,11 @@ bool LLContainerView::addChild(LLView* child, S32 tab_group) return res; } +BOOL LLContainerView::handleDoubleClick(S32 x, S32 y, MASK mask) +{ + return handleMouseDown(x, y, mask); +} + BOOL LLContainerView::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; @@ -84,7 +88,7 @@ BOOL LLContainerView::handleMouseDown(S32 x, S32 y, MASK mask) } if (!handled) { - if( mCollapsible && mShowLabel && (y >= getRect().getHeight() - 10) ) + if( mShowLabel && (y >= getRect().getHeight() - 10) ) { setDisplayChildren(!mDisplayChildren); reshape(getRect().getWidth(), getRect().getHeight(), FALSE); diff --git a/indra/llui/llcontainerview.h b/indra/llui/llcontainerview.h index e81600fd6c..ac92b19977 100644 --- a/indra/llui/llcontainerview.h +++ b/indra/llui/llcontainerview.h @@ -66,6 +66,7 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -87,8 +88,5 @@ public: protected: BOOL mDisplayChildren; std::string mLabel; -public: - BOOL mCollapsible; - }; #endif // LL_CONTAINERVIEW_ diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h index 9fa917eca1..6c97f80e31 100644 --- a/indra/llui/llmultifloater.h +++ b/indra/llui/llmultifloater.h @@ -96,6 +96,3 @@ protected: }; #endif // LL_MULTI_FLOATER_H - - - diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 219ddad452..cda40aac72 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -88,7 +88,7 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) LLView* parent = getParent(); parent->reshape(parent->getRect().getWidth(), parent->getRect().getHeight(), FALSE); - return FALSE; + return TRUE; } void LLStatBar::draw() @@ -98,6 +98,7 @@ void LLStatBar::draw() max = 0.f, mean = 0.f; + S32 num_samples = 0; LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); if (mCountFloatp) @@ -110,6 +111,7 @@ void LLStatBar::draw() min = frame_recording.getPeriodMinPerSec(*mCountFloatp); max = frame_recording.getPeriodMaxPerSec(*mCountFloatp); mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp); + num_samples = frame_recording.getTotalRecording().getSampleCount(*mCountFloatp); } else { @@ -117,6 +119,7 @@ void LLStatBar::draw() min = frame_recording.getPeriodMin(*mCountFloatp); max = frame_recording.getPeriodMax(*mCountFloatp); mean = frame_recording.getPeriodMean(*mCountFloatp); + num_samples = frame_recording.getTotalRecording().getSampleCount(*mCountFloatp); } } else if (mCountIntp) @@ -129,6 +132,7 @@ void LLStatBar::draw() min = frame_recording.getPeriodMinPerSec(*mCountIntp); max = frame_recording.getPeriodMaxPerSec(*mCountIntp); mean = frame_recording.getPeriodMeanPerSec(*mCountIntp); + num_samples = frame_recording.getTotalRecording().getSampleCount(*mCountIntp); } else { @@ -136,6 +140,7 @@ void LLStatBar::draw() min = frame_recording.getPeriodMin(*mCountIntp); max = frame_recording.getPeriodMax(*mCountIntp); mean = frame_recording.getPeriodMean(*mCountIntp); + num_samples = frame_recording.getTotalRecording().getSampleCount(*mCountIntp); } } else if (mMeasurementFloatp) @@ -145,6 +150,7 @@ void LLStatBar::draw() min = recording.getMin(*mMeasurementFloatp); max = recording.getMax(*mMeasurementFloatp); mean = recording.getMean(*mMeasurementFloatp); + num_samples = frame_recording.getTotalRecording().getSampleCount(*mMeasurementFloatp); } else if (mMeasurementIntp) { @@ -153,6 +159,7 @@ void LLStatBar::draw() min = recording.getMin(*mMeasurementIntp); max = recording.getMax(*mMeasurementIntp); mean = recording.getMean(*mMeasurementIntp); + num_samples = frame_recording.getTotalRecording().getSampleCount(*mMeasurementIntp); } current *= mUnitScale; @@ -191,7 +198,7 @@ void LLStatBar::draw() const S32 tick_length = 4; const S32 tick_width = 1; - if (mScaleRange) + if (mScaleRange && num_samples) { F32 cur_max = mLabelSpacing; while(max > cur_max) @@ -472,7 +479,7 @@ LLRect LLStatBar::getRequiredRect() } else { - rect.mTop = 35 + llmin(mMaxHeight, llmin(mNumFrames, LLTrace::get_frame_recording().getNumPeriods())); + rect.mTop = 35 + llmin(mMaxHeight, llmin(mNumFrames, (S32)LLTrace::get_frame_recording().getNumPeriods())); } } else diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index a83ccbe9e5..74a3ebde2f 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -71,7 +71,7 @@ public: update_rate("update_rate", 5.0f), unit_scale("unit_scale", 1.f), show_per_sec("show_per_sec", true), - show_bar("show_bar", TRUE), + show_bar("show_bar", true), show_history("show_history", false), show_mean("show_mean", true), scale_range("scale_range", true), -- cgit v1.2.3