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 From 935dce7d6b0a343cef5b13f53d6da5d0c2dc6a73 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 25 Mar 2013 00:18:06 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics fixed some compile errors made label spacing automatic on stat bars fixed infinite values coming from stats --- indra/llui/llstatbar.cpp | 107 +++++++++++++++++++++++++---------------------- indra/llui/llstatbar.h | 4 +- 2 files changed, 58 insertions(+), 53 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index cda40aac72..d9f3d14ef0 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -52,7 +52,6 @@ LLStatBar::LLStatBar(const Params& p) mMeasurementFloatp(LLTrace::MeasurementStatHandle<>::getInstance(p.stat)), mMeasurementIntp(LLTrace::MeasurementStatHandle::getInstance(p.stat)), mTickSpacing(p.tick_spacing), - mLabelSpacing(p.label_spacing), mPrecision(p.precision), mUpdatesPerSec(p.update_rate), mUnitScale(p.unit_scale), @@ -68,26 +67,32 @@ LLStatBar::LLStatBar(const Params& p) BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) { - if (mDisplayBar) + BOOL handled = LLView::handleMouseDown(x, y, mask); + if (!handled) { - if (mDisplayHistory) + if (mDisplayBar) { - mDisplayBar = FALSE; - mDisplayHistory = FALSE; + if (mDisplayHistory || mOrientation == HORIZONTAL) + { + mDisplayBar = FALSE; + mDisplayHistory = FALSE; + } + else + { + mDisplayHistory = TRUE; + } } else { - mDisplayHistory = TRUE; + mDisplayBar = TRUE; + if (mOrientation == HORIZONTAL) + { + mDisplayHistory = TRUE; + } } + LLView* parent = getParent(); + parent->reshape(parent->getRect().getWidth(), parent->getRect().getHeight(), FALSE); } - else - { - mDisplayBar = TRUE; - } - - LLView* parent = getParent(); - parent->reshape(parent->getRect().getWidth(), parent->getRect().getHeight(), FALSE); - return TRUE; } @@ -200,10 +205,10 @@ void LLStatBar::draw() if (mScaleRange && num_samples) { - F32 cur_max = mLabelSpacing; - while(max > cur_max) + F32 cur_max = mTickSpacing; + while(max > cur_max && mMaxBar > cur_max) { - cur_max += mLabelSpacing; + cur_max += mTickSpacing; } mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, cur_max, 0.05f); } @@ -254,42 +259,51 @@ void LLStatBar::draw() // Draw the tick marks. LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - for (F32 tick_value = mMinBar + mLabelSpacing; tick_value <= mCurMaxBar; tick_value += mTickSpacing) + S32 last_tick = 0; + S32 last_label = 0; + const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30; + const S32 MIN_LABEL_SPACING = mOrientation == HORIZONTAL ? 40 : 60; + for (F32 tick_value = mMinBar + mTickSpacing; tick_value <= mCurMaxBar; tick_value += mTickSpacing) { const S32 begin = llfloor((tick_value - mMinBar)*value_scale); const S32 end = begin + tick_width; - if (mOrientation == HORIZONTAL) + if (begin - last_tick < MIN_TICK_SPACING) { - gl_rect_2d(bar_left, end, bar_right - tick_length/2, begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); + continue; } - else - { - gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length/2, LLColor4(1.f, 1.f, 1.f, 0.1f)); - } - } + last_tick = begin; - // Draw the tick labels (and big ticks). - 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; tick_label = llformat( value_format.c_str(), tick_value); - // 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); + if (begin - last_label > MIN_LABEL_SPACING) + { + 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); + last_label = begin; + } + else + { + gl_rect_2d(bar_left, end, bar_right - tick_length/2, begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); + } } 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::RIGHT, LLFontGL::TOP); + if (begin - last_label > MIN_LABEL_SPACING) + { + 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::RIGHT, LLFontGL::TOP); + last_label = begin; + } + else + { + gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length/2, LLColor4(1.f, 1.f, 1.f, 0.1f)); + } } } @@ -457,12 +471,11 @@ void LLStatBar::setStat(const std::string& stat_name) } -void LLStatBar::setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing) +void LLStatBar::setRange(F32 bar_min, F32 bar_max, F32 tick_spacing) { mMinBar = bar_min; mMaxBar = bar_max; mTickSpacing = tick_spacing; - mLabelSpacing = label_spacing; } LLRect LLStatBar::getRequiredRect() @@ -473,14 +486,7 @@ LLRect LLStatBar::getRequiredRect() { if (mDisplayHistory) { - if (mOrientation == HORIZONTAL) - { - rect.mTop = mMaxHeight; - } - else - { - rect.mTop = 35 + llmin(mMaxHeight, llmin(mNumFrames, (S32)LLTrace::get_frame_recording().getNumPeriods())); - } + rect.mTop = mMaxHeight; } else { @@ -493,3 +499,4 @@ LLRect LLStatBar::getRequiredRect() } return rect; } + diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 74a3ebde2f..db667aa07d 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -43,7 +43,6 @@ public: Optional bar_min, bar_max, tick_spacing, - label_spacing, update_rate, unit_scale; @@ -66,7 +65,6 @@ public: bar_min("bar_min", 0.0f), bar_max("bar_max", 50.0f), tick_spacing("tick_spacing", 10.0f), - label_spacing("label_spacing", 10.0f), precision("precision", 0), update_rate("update_rate", 5.0f), unit_scale("unit_scale", 1.f), @@ -90,7 +88,7 @@ public: void setStat(const std::string& stat_name); - void setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing); + void setRange(F32 bar_min, F32 bar_max, F32 tick_spacing); void getRange(F32& bar_min, F32& bar_max) { bar_min = mMinBar; bar_max = mMaxBar; } /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. -- cgit v1.2.3 From faebbb23f87a855463aba611ca8944ec7f4e0a9c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 10 Apr 2013 15:31:44 -0700 Subject: BUILDFIX: gcc error about type conversion --- indra/llui/llstatbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index d9f3d14ef0..d73cd74651 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -421,10 +421,10 @@ void LLStatBar::draw() } else { - 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.vertex2f(begin, (F32)bar_bottom+offset+1.f); + gGL.vertex2f(begin, (F32)bar_bottom+offset); + gGL.vertex2f(end, (F32)bar_bottom+offset); + gGL.vertex2f(end, (F32)bar_bottom+offset+1.f); } } gGL.end(); -- cgit v1.2.3 From 07ca6fce7c9cffe1b8f215f25bb826fedf57a5b7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 10 Apr 2013 21:51:56 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics removed PeriodicRecording::getTotalRecording as it was showing up at the top on the profiler renamed getPrevRecordingPeriod, etc. to getPrevRecording --- indra/llui/llstatbar.cpp | 37 ++++++++++++++++--------------------- indra/llui/llstatgraph.cpp | 4 ++-- 2 files changed, 18 insertions(+), 23 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index d9f3d14ef0..46eea368e5 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -103,12 +103,11 @@ void LLStatBar::draw() max = 0.f, mean = 0.f; - S32 num_samples = 0; LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); if (mCountFloatp) { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecordingPeriod(); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); if (mPerSec) { @@ -116,7 +115,6 @@ 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 { @@ -124,12 +122,11 @@ 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) { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecordingPeriod(); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); if (mPerSec) { @@ -137,7 +134,6 @@ 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 { @@ -145,26 +141,25 @@ 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) { - LLTrace::Recording& recording = frame_recording.getTotalRecording(); - current = recording.getLastValue(*mMeasurementFloatp); - min = recording.getMin(*mMeasurementFloatp); - max = recording.getMax(*mMeasurementFloatp); - mean = recording.getMean(*mMeasurementFloatp); - num_samples = frame_recording.getTotalRecording().getSampleCount(*mMeasurementFloatp); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + + current = last_frame_recording.getLastValue(*mMeasurementFloatp); + min = frame_recording.getPeriodMin(*mMeasurementFloatp); + max = frame_recording.getPeriodMax(*mMeasurementFloatp); + mean = frame_recording.getPeriodMean(*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); - num_samples = frame_recording.getTotalRecording().getSampleCount(*mMeasurementIntp); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + + current = last_frame_recording.getLastValue(*mMeasurementIntp); + min = frame_recording.getPeriodMin(*mMeasurementIntp); + max = frame_recording.getPeriodMax(*mMeasurementIntp); + mean = frame_recording.getPeriodMean(*mMeasurementIntp); } current *= mUnitScale; @@ -203,7 +198,7 @@ void LLStatBar::draw() const S32 tick_length = 4; const S32 tick_width = 1; - if (mScaleRange && num_samples) + if (mScaleRange && min < max) { F32 cur_max = mTickSpacing; while(max > cur_max && mMaxBar > cur_max) @@ -352,7 +347,7 @@ void LLStatBar::draw() for (i = 1; i <= max_frame; i++) { F32 offset = ((F32)i / (F32)mNumFrames) * span; - LLTrace::Recording& recording = frame_recording.getPrevRecordingPeriod(i); + LLTrace::Recording& recording = frame_recording.getPrevRecording(i); if (mPerSec) { if (mCountFloatp) diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index bdb378c9c5..af01e66095 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -66,7 +66,7 @@ void LLStatGraph::draw() range = mMax - mMin; if (mNewStatFloatp) { - LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); + LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecording(); if (mPerSec) { @@ -79,7 +79,7 @@ void LLStatGraph::draw() } else if (mNewStatIntp) { - LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); + LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecording(); if (mPerSec) { -- cgit v1.2.3 From bdc6d58b7e84bc81977148995b0028f7420eee65 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 11 Apr 2013 19:12:27 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics added ability to query periodic timer for specific number of periods used that to do smaller time averaged window for camera speed --- indra/llui/llstatbar.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 46eea368e5..70ba59b130 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -112,16 +112,16 @@ void LLStatBar::draw() if (mPerSec) { current = last_frame_recording.getPerSec(*mCountFloatp); - min = frame_recording.getPeriodMinPerSec(*mCountFloatp); - max = frame_recording.getPeriodMaxPerSec(*mCountFloatp); - mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp); + min = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames); + max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); + mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp, mNumFrames); } else { current = last_frame_recording.getSum(*mCountFloatp); - min = frame_recording.getPeriodMin(*mCountFloatp); - max = frame_recording.getPeriodMax(*mCountFloatp); - mean = frame_recording.getPeriodMean(*mCountFloatp); + min = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames); + max = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); + mean = frame_recording.getPeriodMean(*mCountFloatp, mNumFrames); } } else if (mCountIntp) @@ -131,16 +131,16 @@ void LLStatBar::draw() if (mPerSec) { current = last_frame_recording.getPerSec(*mCountIntp); - min = frame_recording.getPeriodMinPerSec(*mCountIntp); - max = frame_recording.getPeriodMaxPerSec(*mCountIntp); - mean = frame_recording.getPeriodMeanPerSec(*mCountIntp); + min = frame_recording.getPeriodMinPerSec(*mCountIntp, mNumFrames); + max = frame_recording.getPeriodMaxPerSec(*mCountIntp, mNumFrames); + mean = frame_recording.getPeriodMeanPerSec(*mCountIntp, mNumFrames); } else { current = last_frame_recording.getSum(*mCountIntp); - min = frame_recording.getPeriodMin(*mCountIntp); - max = frame_recording.getPeriodMax(*mCountIntp); - mean = frame_recording.getPeriodMean(*mCountIntp); + min = frame_recording.getPeriodMin(*mCountIntp, mNumFrames); + max = frame_recording.getPeriodMax(*mCountIntp, mNumFrames); + mean = frame_recording.getPeriodMean(*mCountIntp, mNumFrames); } } else if (mMeasurementFloatp) @@ -148,18 +148,18 @@ void LLStatBar::draw() LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); current = last_frame_recording.getLastValue(*mMeasurementFloatp); - min = frame_recording.getPeriodMin(*mMeasurementFloatp); - max = frame_recording.getPeriodMax(*mMeasurementFloatp); - mean = frame_recording.getPeriodMean(*mMeasurementFloatp); + min = frame_recording.getPeriodMin(*mMeasurementFloatp, mNumFrames); + max = frame_recording.getPeriodMax(*mMeasurementFloatp, mNumFrames); + mean = frame_recording.getPeriodMean(*mMeasurementFloatp, mNumFrames); } else if (mMeasurementIntp) { LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); current = last_frame_recording.getLastValue(*mMeasurementIntp); - min = frame_recording.getPeriodMin(*mMeasurementIntp); - max = frame_recording.getPeriodMax(*mMeasurementIntp); - mean = frame_recording.getPeriodMean(*mMeasurementIntp); + min = frame_recording.getPeriodMin(*mMeasurementIntp, mNumFrames); + max = frame_recording.getPeriodMax(*mMeasurementIntp, mNumFrames); + mean = frame_recording.getPeriodMean(*mMeasurementIntp, mNumFrames); } current *= mUnitScale; -- cgit v1.2.3 From 9b48f536c112dc68f8cbda9870587f0d16b9bc9d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 11 Apr 2013 19:41:36 -0700 Subject: deleted unused .cpp file --- indra/llui/CMakeLists.txt | 1 - indra/llui/llfunctorregistry.cpp | 33 --------------------------------- indra/llui/llnotificationtemplate.h | 24 ------------------------ 3 files changed, 58 deletions(-) delete mode 100644 indra/llui/llfunctorregistry.cpp (limited to 'indra/llui') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index d92b6aa1c0..afcaee9980 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -52,7 +52,6 @@ set(llui_SOURCE_FILES llfloaterreglistener.cpp llflyoutbutton.cpp llfocusmgr.cpp - llfunctorregistry.cpp lliconctrl.cpp llkeywords.cpp lllayoutstack.cpp diff --git a/indra/llui/llfunctorregistry.cpp b/indra/llui/llfunctorregistry.cpp deleted file mode 100644 index 8003324973..0000000000 --- a/indra/llui/llfunctorregistry.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file llfunctorregistry.cpp - * @author Kent Quirk - * @brief Maintains a registry of named callback functors taking a single LLSD parameter - * - * $LicenseInfo:firstyear=2008&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - **/ - -#include "linden_common.h" -#include "llfunctorregistry.h" - -// This is a default functor always resident in the system. -// It's used whenever a functor isn't found in the registry, so that -// we at least log the data relating to the user response. diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h index b3b0bae862..98ed602a09 100644 --- a/indra/llui/llnotificationtemplate.h +++ b/indra/llui/llnotificationtemplate.h @@ -28,33 +28,9 @@ #ifndef LL_LLNOTIFICATION_TEMPLATE_H #define LL_LLNOTIFICATION_TEMPLATE_H -//#include -//#include -//#include -//#include -//#include -//#include -//#include -// -//#include -//#include -//#include -//#include -// -//// we want to minimize external dependencies, but this one is important -//#include "llsd.h" -// -//// and we need this to manage the notification callbacks -//#include "llevents.h" -//#include "llfunctorregistry.h" -//#include "llpointer.h" #include "llinitparam.h" -//#include "llnotificationslistener.h" -//#include "llnotificationptr.h" -//#include "llcachename.h" #include "llnotifications.h" - typedef boost::shared_ptr LLNotificationFormPtr; // This is the class of object read from the XML file (notifications.xml, -- cgit v1.2.3 From 6b81b8629e67d82a7620e48781ded73b6e6126ea Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 5 May 2013 17:45:35 -0700 Subject: Spring cleaning: removed unused .cpp and.h files, and cleaned up header dependencies --- indra/llui/llnotifications.h | 5 +++-- indra/llui/llui.h | 4 ++-- indra/llui/lluiimage.h | 2 -- indra/llui/llxuiparser.cpp | 2 ++ indra/llui/llxuiparser.h | 12 +++--------- 5 files changed, 10 insertions(+), 15 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index d7534c416d..76c6877440 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -96,7 +96,8 @@ #include "llfunctorregistry.h" #include "llpointer.h" #include "llinitparam.h" -#include "llnotificationslistener.h" +#include "llinstancetracker.h" +//#include "llnotificationslistener.h" #include "llnotificationptr.h" class LLAvatarName; @@ -966,7 +967,7 @@ private: bool mIgnoreAllNotifications; - boost::scoped_ptr mListener; + boost::scoped_ptr mListener; }; /** diff --git a/indra/llui/llui.h b/indra/llui/llui.h index dfb9fa60c9..69490d8668 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -31,15 +31,14 @@ #include "llpointer.h" // LLPointer<> #include "llrect.h" -#include "llcontrol.h" #include "llcoord.h" +#include "llcontrol.h" #include "llglslshader.h" #include "llinitparam.h" #include "llregistry.h" #include "lluicolor.h" #include "lluicolortable.h" #include -#include "lllazyvalue.h" #include "llframetimer.h" #include @@ -59,6 +58,7 @@ class LLWindow; class LLView; class LLHelp; class LLRenderTarget; +class LLControlGroup; // UI colors extern const LLColor4 UI_VERTEX_COLOR; diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h index f07e8fa746..f9c191e65f 100644 --- a/indra/llui/lluiimage.h +++ b/indra/llui/lluiimage.h @@ -30,9 +30,7 @@ #include "v4color.h" #include "llpointer.h" #include "llrefcount.h" -#include "llrefcount.h" #include "llrect.h" -#include #include #include "llinitparam.h" #include "lltexture.h" diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 903f10ce10..0291843758 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -338,6 +338,8 @@ LLXSDWriter::LLXSDWriter() registerInspectFunc(boost::bind(&LLXSDWriter::writeAttribute, this, "xs:string", _1, _2, _3, _4)); } +LLXSDWriter::~LLXSDWriter() {} + void LLXSDWriter::writeXSD(const std::string& type_name, LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const std::string& xml_namespace) { Schema schema(xml_namespace); diff --git a/indra/llui/llxuiparser.h b/indra/llui/llxuiparser.h index 8d0276a8ad..e6bb552623 100644 --- a/indra/llui/llxuiparser.h +++ b/indra/llui/llxuiparser.h @@ -29,21 +29,15 @@ #include "llinitparam.h" #include "llregistry.h" -#include "llpointer.h" +#include "llxmlnode.h" #include #include #include #include - - class LLView; - -typedef LLPointer LLXMLNodePtr; - - // lookup widget type by name class LLWidgetTypeRegistry : public LLRegistrySingleton @@ -59,8 +53,6 @@ class LLChildRegistryRegistry : public LLRegistrySingleton {}; - - class LLXSDWriter : public LLInitParam::Parser { LOG_CLASS(LLXSDWriter); @@ -70,6 +62,7 @@ public: /*virtual*/ std::string getCurrentElementName() { return LLStringUtil::null; } LLXSDWriter(); + ~LLXSDWriter(); protected: void writeAttribute(const std::string& type, const Parser::name_stack_t&, S32 min_count, S32 max_count, const std::vector* possible_values); @@ -124,6 +117,7 @@ public: } private: + LLXUIParser(const LLXUIParser& other); // no-copy void writeXUIImpl(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const LLInitParam::predicate_rule_t rules, -- cgit v1.2.3 From 41b4374760dd060a7f51a4a837851d5a03b7242a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 10 May 2013 17:57:12 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics renamed LLView::handleVisibilityChange to onVisibilityChange to reflect standard naming conventions for handlers vs. reactors --- indra/llui/llaccordionctrltab.cpp | 4 ++-- indra/llui/llaccordionctrltab.h | 2 +- indra/llui/llfloater.cpp | 8 ++++---- indra/llui/llfloater.h | 2 +- indra/llui/llmenugl.cpp | 8 ++++---- indra/llui/llmenugl.h | 4 ++-- indra/llui/llpanel.cpp | 4 ++-- indra/llui/llpanel.h | 2 +- indra/llui/lltextbase.cpp | 4 ++-- indra/llui/lltextbase.h | 2 +- indra/llui/lltoggleablemenu.cpp | 2 +- indra/llui/lltoggleablemenu.h | 2 +- indra/llui/llview.cpp | 6 +++--- indra/llui/llview.h | 2 +- 14 files changed, 26 insertions(+), 26 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index c025cd7939..0cd5fd938f 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -444,9 +444,9 @@ void LLAccordionCtrlTab::changeOpenClose(bool is_open) } } -void LLAccordionCtrlTab::handleVisibilityChange(BOOL new_visibility) +void LLAccordionCtrlTab::onVisibilityChange(BOOL new_visibility) { - LLUICtrl::handleVisibilityChange(new_visibility); + LLUICtrl::onVisibilityChange(new_visibility); notifyParent(LLSD().with("child_visibility_change", new_visibility)); } diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index dddaa581e6..7a78700e0f 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -158,7 +158,7 @@ public: /** * Raises notifyParent event with "child_visibility_change" = new_visibility */ - void handleVisibilityChange(BOOL new_visibility); + void onVisibilityChange(BOOL new_visibility); // Changes expand/collapse state and triggers expand/collapse callbacks virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a29ad12d23..7d84b2a392 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -596,7 +596,7 @@ LLControlGroup* LLFloater::getControlGroup() void LLFloater::setVisible( BOOL visible ) { - LLPanel::setVisible(visible); // calls handleVisibilityChange() + LLPanel::setVisible(visible); // calls onVisibilityChange() if( visible && mFirstLook ) { mFirstLook = FALSE; @@ -628,14 +628,14 @@ void LLFloater::setVisible( BOOL visible ) } // virtual -void LLFloater::handleVisibilityChange ( BOOL new_visibility ) +void LLFloater::onVisibilityChange ( BOOL new_visibility ) { if (new_visibility) { if (getHost()) getHost()->setFloaterFlashing(this, FALSE); } - LLPanel::handleVisibilityChange ( new_visibility ); + LLPanel::onVisibilityChange ( new_visibility ); } void LLFloater::openFloater(const LLSD& key) @@ -779,7 +779,7 @@ void LLFloater::closeFloater(bool app_quitting) } else { - setVisible(FALSE); // hide before destroying (so handleVisibilityChange() gets called) + setVisible(FALSE); // hide before destroying (so onVisibilityChange() gets called) if (!mReuseInstance) { destroy(); diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index aef63bcf93..939b2ddde3 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -298,7 +298,7 @@ public: virtual BOOL canClose() { return TRUE; } /*virtual*/ void setVisible(BOOL visible); // do not override - /*virtual*/ void handleVisibilityChange ( BOOL new_visibility ); // do not override + /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); // do not override void setFrontmost(BOOL take_focus = TRUE); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 13888920f9..51cf352645 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -549,13 +549,13 @@ BOOL LLMenuItemGL::setLabelArg( const std::string& key, const LLStringExplicit& return TRUE; } -void LLMenuItemGL::handleVisibilityChange(BOOL new_visibility) +void LLMenuItemGL::onVisibilityChange(BOOL new_visibility) { if (getMenu()) { getMenu()->needsArrange(); } - LLView::handleVisibilityChange(new_visibility); + LLView::onVisibilityChange(new_visibility); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1146,13 +1146,13 @@ void LLMenuItemBranchGL::updateBranchParent(LLView* parentp) } } -void LLMenuItemBranchGL::handleVisibilityChange( BOOL new_visibility ) +void LLMenuItemBranchGL::onVisibilityChange( BOOL new_visibility ) { if (new_visibility == FALSE && getBranch() && !getBranch()->getTornOff()) { getBranch()->setVisible(FALSE); } - LLMenuItemGL::handleVisibilityChange(new_visibility); + LLMenuItemGL::onVisibilityChange(new_visibility); } BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 00899020bc..b1d2223588 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -82,7 +82,7 @@ protected: friend class LLUICtrlFactory; public: // LLView overrides - /*virtual*/ void handleVisibilityChange(BOOL new_visibility); + /*virtual*/ void onVisibilityChange(BOOL new_visibility); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); @@ -631,7 +631,7 @@ public: virtual void updateBranchParent( LLView* parentp ); // LLView Functionality - virtual void handleVisibilityChange( BOOL curVisibilityIn ); + virtual void onVisibilityChange( BOOL curVisibilityIn ); virtual void draw(); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 188a0fea74..f157d6a923 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -342,9 +342,9 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask ) return handled; } -void LLPanel::handleVisibilityChange ( BOOL new_visibility ) +void LLPanel::onVisibilityChange ( BOOL new_visibility ) { - LLUICtrl::handleVisibilityChange ( new_visibility ); + LLUICtrl::onVisibilityChange ( new_visibility ); if (mVisibleSignal) (*mVisibleSignal)(this, LLSD(new_visibility) ); // Pass BOOL as LLSD } diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index e63b41f97c..ac8583ece9 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -115,7 +115,7 @@ public: /*virtual*/ BOOL isPanel() const; /*virtual*/ void draw(); /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); - /*virtual*/ void handleVisibilityChange ( BOOL new_visibility ); + /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); // From LLFocusableElement /*virtual*/ void setFocus( BOOL b ); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 680b6ed16d..025b3c4165 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1222,13 +1222,13 @@ void LLTextBase::setReadOnlyColor(const LLColor4 &c) } //virtual -void LLTextBase::handleVisibilityChange( BOOL new_visibility ) +void LLTextBase::onVisibilityChange( BOOL new_visibility ) { if(!new_visibility && mPopupMenu) { mPopupMenu->hide(); } - LLUICtrl::handleVisibilityChange(new_visibility); + LLUICtrl::onVisibilityChange(new_visibility); } //virtual diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 2ce15d891a..bd0c8949dc 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -310,7 +310,7 @@ public: /*virtual*/ BOOL acceptsTextInput() const { return !mReadOnly; } /*virtual*/ void setColor( const LLColor4& c ); virtual void setReadOnlyColor(const LLColor4 &c); - virtual void handleVisibilityChange( BOOL new_visibility ); + virtual void onVisibilityChange( BOOL new_visibility ); /*virtual*/ void setValue(const LLSD& value ); /*virtual*/ LLTextViewModel* getViewModel() const; diff --git a/indra/llui/lltoggleablemenu.cpp b/indra/llui/lltoggleablemenu.cpp index 00d52fe10d..ccb92ffbb2 100644 --- a/indra/llui/lltoggleablemenu.cpp +++ b/indra/llui/lltoggleablemenu.cpp @@ -52,7 +52,7 @@ boost::signals2::connection LLToggleableMenu::setVisibilityChangeCallback(const } // virtual -void LLToggleableMenu::handleVisibilityChange (BOOL curVisibilityIn) +void LLToggleableMenu::onVisibilityChange (BOOL curVisibilityIn) { S32 x,y; LLUI::getMousePositionLocal(LLUI::getRootView(), &x, &y); diff --git a/indra/llui/lltoggleablemenu.h b/indra/llui/lltoggleablemenu.h index 4717b0d0ba..47e3b9f824 100644 --- a/indra/llui/lltoggleablemenu.h +++ b/indra/llui/lltoggleablemenu.h @@ -45,7 +45,7 @@ public: boost::signals2::connection setVisibilityChangeCallback( const commit_signal_t::slot_type& cb ); - virtual void handleVisibilityChange (BOOL curVisibilityIn); + virtual void onVisibilityChange (BOOL curVisibilityIn); virtual bool addChild (LLView* view, S32 tab_group = 0); diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index ba88396294..23bb3a1f27 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -641,21 +641,21 @@ void LLView::setVisible(BOOL visible) { // tell all children of this view that the visibility may have changed dirtyRect(); - handleVisibilityChange( visible ); + onVisibilityChange( visible ); } updateBoundingRect(); } } // virtual -void LLView::handleVisibilityChange ( BOOL new_visibility ) +void LLView::onVisibilityChange ( BOOL new_visibility ) { BOOST_FOREACH(LLView* viewp, mChildList) { // only views that are themselves visible will have their overall visibility affected by their ancestors if (viewp->getVisible()) { - viewp->handleVisibilityChange ( new_visibility ); + viewp->onVisibilityChange ( new_visibility ); } } } diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 88813da3c6..224d75bb85 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -308,7 +308,7 @@ public: virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); - virtual void handleVisibilityChange ( BOOL new_visibility ); + virtual void onVisibilityChange ( BOOL new_visibility ); void pushVisible(BOOL visible) { mLastVisible = mVisible; setVisible(visible); } void popVisible() { setVisible(mLastVisible); } -- cgit v1.2.3 From c9595b00188f8a6ebcd55418768a99c2942bb75e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 13 May 2013 13:44:31 -0700 Subject: BUILDFIX: potential fix for linux build --- indra/llui/llnotificationsutil.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llnotificationsutil.cpp b/indra/llui/llnotificationsutil.cpp index cc791c26d1..7b9676f45b 100644 --- a/indra/llui/llnotificationsutil.cpp +++ b/indra/llui/llnotificationsutil.cpp @@ -27,6 +27,7 @@ #include "llnotificationsutil.h" #include "llnotifications.h" +#include "llnotificationslistener.h" #include "llsd.h" #include "llxmlnode.h" // apparently needed to call LLNotifications::instance() -- cgit v1.2.3 From 7b86d10c2d116637e4c8f2533c4fbb5ac601c522 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 14 May 2013 13:24:14 -0700 Subject: BUILDFIX: attempted fix for gcc build --- indra/llui/llnotifications.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 76c6877440..25a137bb41 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -97,7 +97,7 @@ #include "llpointer.h" #include "llinitparam.h" #include "llinstancetracker.h" -//#include "llnotificationslistener.h" +#include "llnotificationslistener.h" #include "llnotificationptr.h" class LLAvatarName; -- cgit v1.2.3 From 9ae76d12157641033431381959ef4f798a119b8d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 29 May 2013 17:00:50 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics fixed copy construction behavior of Recordings to not zero out data split measurement into event and sample, with sample representing a continuous function --- indra/llui/llstatbar.cpp | 118 ++++++++++++++++++++++++++++++++--------------- indra/llui/llstatbar.h | 10 ++-- indra/llui/llstatgraph.h | 10 ++-- 3 files changed, 93 insertions(+), 45 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 972b436bdc..22ca90df7a 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -47,10 +47,6 @@ LLStatBar::LLStatBar(const Params& p) 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)), - mMeasurementIntp(LLTrace::MeasurementStatHandle::getInstance(p.stat)), mTickSpacing(p.tick_spacing), mPrecision(p.precision), mUpdatesPerSec(p.update_rate), @@ -63,7 +59,9 @@ LLStatBar::LLStatBar(const Params& p) mDisplayMean(p.show_mean), mOrientation(p.orientation), mScaleRange(p.scale_range) -{} +{ + setStat(p.stat); +} BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) { @@ -143,23 +141,41 @@ void LLStatBar::draw() mean = frame_recording.getPeriodMean(*mCountIntp, mNumFrames); } } - else if (mMeasurementFloatp) + else if (mEventFloatp) { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - current = last_frame_recording.getLastValue(*mMeasurementFloatp); - min = frame_recording.getPeriodMin(*mMeasurementFloatp, mNumFrames); - max = frame_recording.getPeriodMax(*mMeasurementFloatp, mNumFrames); - mean = frame_recording.getPeriodMean(*mMeasurementFloatp, mNumFrames); + current = last_frame_recording.getMean(*mEventFloatp); + min = frame_recording.getPeriodMin(*mEventFloatp, mNumFrames); + max = frame_recording.getPeriodMax(*mEventFloatp, mNumFrames); + mean = frame_recording.getPeriodMean(*mEventFloatp, mNumFrames); } - else if (mMeasurementIntp) + else if (mEventIntp) { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + + current = last_frame_recording.getLastValue(*mEventIntp); + min = frame_recording.getPeriodMin(*mEventIntp, mNumFrames); + max = frame_recording.getPeriodMax(*mEventIntp, mNumFrames); + mean = frame_recording.getPeriodMean(*mEventIntp, mNumFrames); + } + else if (mSampleFloatp) + { + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + + current = last_frame_recording.getLastValue(*mSampleFloatp); + min = frame_recording.getPeriodMin(*mSampleFloatp, mNumFrames); + max = frame_recording.getPeriodMax(*mSampleFloatp, mNumFrames); + mean = frame_recording.getPeriodMean(*mSampleFloatp, mNumFrames); + } + else if (mSampleIntp) + { + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - current = last_frame_recording.getLastValue(*mMeasurementIntp); - min = frame_recording.getPeriodMin(*mMeasurementIntp, mNumFrames); - max = frame_recording.getPeriodMax(*mMeasurementIntp, mNumFrames); - mean = frame_recording.getPeriodMean(*mMeasurementIntp, mNumFrames); + current = last_frame_recording.getLastValue(*mSampleIntp); + min = frame_recording.getPeriodMin(*mSampleIntp, mNumFrames); + max = frame_recording.getPeriodMax(*mSampleIntp, mNumFrames); + mean = frame_recording.getPeriodMean(*mSampleIntp, mNumFrames); } current *= mUnitScale; @@ -247,7 +263,7 @@ void LLStatBar::draw() } value_format = llformat( "%%.%df", mPrecision); - if (mDisplayBar && (mCountFloatp || mCountIntp || mMeasurementFloatp || mMeasurementIntp)) + if (mDisplayBar && (mCountFloatp || mCountIntp || mEventFloatp || mEventIntp || mSampleFloatp || mSampleIntp)) { std::string tick_label; @@ -334,7 +350,7 @@ void LLStatBar::draw() ? (bar_right - bar_left) : (bar_top - bar_bottom); - if (mDisplayHistory && (mCountFloatp || mCountIntp || mMeasurementFloatp || mMeasurementIntp)) + if (mDisplayHistory && (mCountFloatp || mCountIntp || mEventFloatp || mEventIntp || mSampleFloatp || mSampleIntp)) { const S32 num_values = frame_recording.getNumPeriods() - 1; F32 begin = 0; @@ -362,19 +378,33 @@ void LLStatBar::draw() end = ((recording.getPerSec(*mCountIntp) - mMinBar) * value_scale) + 1; num_samples = recording.getSampleCount(*mCountIntp); } - else if (mMeasurementFloatp) + else if (mEventFloatp) { //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); + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mEventFloatp); } - else if (mMeasurementIntp) + else if (mEventIntp) { //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); + begin = ((recording.getMean(*mEventIntp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mEventIntp); + } + else if (mSampleFloatp) + { + //rate isn't defined for sample stats, so use mean + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mEventFloatp); + } + else if (mSampleIntp) + { + //rate isn't defined for sample stats, so use mean + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mEventFloatp); } } else @@ -391,17 +421,29 @@ void LLStatBar::draw() end = ((recording.getSum(*mCountIntp) - mMinBar) * value_scale) + 1; num_samples = recording.getSampleCount(*mCountIntp); } - else if (mMeasurementFloatp) + else if (mEventFloatp) + { + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mEventFloatp); + } + else if (mEventIntp) + { + begin = ((recording.getMean(*mEventIntp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mEventIntp); + } + else if (mSampleFloatp) { - begin = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mMeasurementFloatp); + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mEventFloatp); } - else if (mMeasurementIntp) + else if (mSampleIntp) { - begin = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale); - end = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mMeasurementIntp); + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mEventFloatp); } } @@ -461,8 +503,10 @@ void LLStatBar::setStat(const std::string& 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); + mEventFloatp = LLTrace::EventStatHandle<>::getInstance(stat_name); + mEventIntp = LLTrace::EventStatHandle::getInstance(stat_name); + mSampleFloatp = LLTrace::SampleStatHandle<>::getInstance(stat_name); + mSampleIntp = LLTrace::SampleStatHandle::getInstance(stat_name); } diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index db667aa07d..a0ed9699aa 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -111,10 +111,12 @@ private: bool mScaleRange; EOrientation mOrientation; - LLTrace::TraceType >* mCountFloatp; - LLTrace::TraceType >* mCountIntp; - LLTrace::TraceType >* mMeasurementFloatp; - LLTrace::TraceType >* mMeasurementIntp; + LLTrace::TraceType >* mCountFloatp; + LLTrace::TraceType >* mCountIntp; + LLTrace::TraceType >* mEventFloatp; + LLTrace::TraceType >* mEventIntp; + LLTrace::TraceType >* mSampleFloatp; + LLTrace::TraceType >* mSampleIntp; LLFrameTimer mUpdateTimer; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index c9e33ed902..08681b3704 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,10 +57,12 @@ 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 >* > event_stat_float; + Alternative >* > event_stat_int; + Alternative >* > sample_stat_float; + Alternative >* > sample_stat_int; }; struct Params : public LLInitParam::Block -- cgit v1.2.3 From 233201f8227f92e93061d3e2393a17b42dfa3dd1 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 2 Jun 2013 22:49:17 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics removed unnecessary templates from accumulator types...now always track data in double precision floating point, using templated accessors to convert to and from arbitrary types --- indra/llui/llstatbar.cpp | 170 ++++++++++++--------------------------------- indra/llui/llstatbar.h | 9 +-- indra/llui/llstatgraph.cpp | 16 +---- indra/llui/llstatgraph.h | 12 ++-- 4 files changed, 54 insertions(+), 153 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 22ca90df7a..6966df8213 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -97,9 +97,9 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) void LLStatBar::draw() { F32 current = 0.f, - min = 0.f, - max = 0.f, - mean = 0.f; + min = 0.f, + max = 0.f, + mean = 0.f; LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); @@ -110,35 +110,16 @@ void LLStatBar::draw() if (mPerSec) { current = last_frame_recording.getPerSec(*mCountFloatp); - min = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames); - max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); - mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp, mNumFrames); + min = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames); + max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); + mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp, mNumFrames); } else { current = last_frame_recording.getSum(*mCountFloatp); - min = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames); - max = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); - mean = frame_recording.getPeriodMean(*mCountFloatp, mNumFrames); - } - } - else if (mCountIntp) - { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - - if (mPerSec) - { - current = last_frame_recording.getPerSec(*mCountIntp); - min = frame_recording.getPeriodMinPerSec(*mCountIntp, mNumFrames); - max = frame_recording.getPeriodMaxPerSec(*mCountIntp, mNumFrames); - mean = frame_recording.getPeriodMeanPerSec(*mCountIntp, mNumFrames); - } - else - { - current = last_frame_recording.getSum(*mCountIntp); - min = frame_recording.getPeriodMin(*mCountIntp, mNumFrames); - max = frame_recording.getPeriodMax(*mCountIntp, mNumFrames); - mean = frame_recording.getPeriodMean(*mCountIntp, mNumFrames); + min = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames); + max = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); + mean = frame_recording.getPeriodMean(*mCountFloatp, mNumFrames); } } else if (mEventFloatp) @@ -146,42 +127,24 @@ void LLStatBar::draw() LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); current = last_frame_recording.getMean(*mEventFloatp); - min = frame_recording.getPeriodMin(*mEventFloatp, mNumFrames); - max = frame_recording.getPeriodMax(*mEventFloatp, mNumFrames); - mean = frame_recording.getPeriodMean(*mEventFloatp, mNumFrames); - } - else if (mEventIntp) - { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - - current = last_frame_recording.getLastValue(*mEventIntp); - min = frame_recording.getPeriodMin(*mEventIntp, mNumFrames); - max = frame_recording.getPeriodMax(*mEventIntp, mNumFrames); - mean = frame_recording.getPeriodMean(*mEventIntp, mNumFrames); + min = frame_recording.getPeriodMin(*mEventFloatp, mNumFrames); + max = frame_recording.getPeriodMax(*mEventFloatp, mNumFrames); + mean = frame_recording.getPeriodMean(*mEventFloatp, mNumFrames); } else if (mSampleFloatp) { LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); current = last_frame_recording.getLastValue(*mSampleFloatp); - min = frame_recording.getPeriodMin(*mSampleFloatp, mNumFrames); - max = frame_recording.getPeriodMax(*mSampleFloatp, mNumFrames); - mean = frame_recording.getPeriodMean(*mSampleFloatp, mNumFrames); - } - else if (mSampleIntp) - { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - - current = last_frame_recording.getLastValue(*mSampleIntp); - min = frame_recording.getPeriodMin(*mSampleIntp, mNumFrames); - max = frame_recording.getPeriodMax(*mSampleIntp, mNumFrames); - mean = frame_recording.getPeriodMean(*mSampleIntp, mNumFrames); + min = frame_recording.getPeriodMin(*mSampleFloatp, mNumFrames); + max = frame_recording.getPeriodMax(*mSampleFloatp, mNumFrames); + mean = frame_recording.getPeriodMean(*mSampleFloatp, mNumFrames); } current *= mUnitScale; - min *= mUnitScale; - max *= mUnitScale; - mean *= mUnitScale; + min *= mUnitScale; + max *= mUnitScale; + mean *= mUnitScale; if ((mUpdatesPerSec == 0.f) || (mUpdateTimer.getElapsedTimeF32() > 1.f/mUpdatesPerSec) || (mValue == 0.f)) { @@ -199,16 +162,16 @@ void LLStatBar::draw() S32 bar_top, bar_left, bar_right, bar_bottom; if (mOrientation == HORIZONTAL) { - bar_top = llmax(5, getRect().getHeight() - 15); - bar_left = 0; - bar_right = getRect().getWidth() - 40; + bar_top = llmax(5, getRect().getHeight() - 15); + bar_left = 0; + bar_right = getRect().getWidth() - 40; bar_bottom = llmin(bar_top - 5, 0); } else // VERTICAL { - bar_top = llmax(5, getRect().getHeight() - 15); - bar_left = 0; - bar_right = getRect().getWidth(); + bar_top = llmax(5, getRect().getHeight() - 15); + bar_left = 0; + bar_right = getRect().getWidth(); bar_bottom = llmin(bar_top - 5, 20); } const S32 tick_length = 4; @@ -263,7 +226,7 @@ void LLStatBar::draw() } value_format = llformat( "%%.%df", mPrecision); - if (mDisplayBar && (mCountFloatp || mCountIntp || mEventFloatp || mEventIntp || mSampleFloatp || mSampleIntp)) + if (mDisplayBar && (mCountFloatp || mEventFloatp || mSampleFloatp)) { std::string tick_label; @@ -272,7 +235,7 @@ void LLStatBar::draw() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); S32 last_tick = 0; S32 last_label = 0; - const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30; + const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30; const S32 MIN_LABEL_SPACING = mOrientation == HORIZONTAL ? 40 : 60; for (F32 tick_value = mMinBar + mTickSpacing; tick_value <= mCurMaxBar; tick_value += mTickSpacing) { @@ -350,7 +313,7 @@ void LLStatBar::draw() ? (bar_right - bar_left) : (bar_top - bar_bottom); - if (mDisplayHistory && (mCountFloatp || mCountIntp || mEventFloatp || mEventIntp || mSampleFloatp || mSampleIntp)) + if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) { const S32 num_values = frame_recording.getNumPeriods() - 1; F32 begin = 0; @@ -368,42 +331,22 @@ void LLStatBar::draw() { if (mCountFloatp) { - begin = ((recording.getPerSec(*mCountFloatp) - mMinBar) * value_scale); - end = ((recording.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 = ((recording.getPerSec(*mCountIntp) - mMinBar) * value_scale); - end = ((recording.getPerSec(*mCountIntp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mCountIntp); - } else if (mEventFloatp) { //rate isn't defined for measurement stats, so use mean - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; num_samples = recording.getSampleCount(*mEventFloatp); } - else if (mEventIntp) - { - //rate isn't defined for measurement stats, so use mean - begin = ((recording.getMean(*mEventIntp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventIntp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mEventIntp); - } else if (mSampleFloatp) { //rate isn't defined for sample stats, so use mean - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mEventFloatp); - } - else if (mSampleIntp) - { - //rate isn't defined for sample stats, so use mean - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; num_samples = recording.getSampleCount(*mEventFloatp); } } @@ -411,41 +354,23 @@ void LLStatBar::draw() { if (mCountFloatp) { - begin = ((recording.getSum(*mCountFloatp) - mMinBar) * value_scale); - end = ((recording.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 = ((recording.getSum(*mCountIntp) - mMinBar) * value_scale); - end = ((recording.getSum(*mCountIntp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mCountIntp); - } else if (mEventFloatp) { - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; num_samples = recording.getSampleCount(*mEventFloatp); } - else if (mEventIntp) - { - begin = ((recording.getMean(*mEventIntp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventIntp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mEventIntp); - } else if (mSampleFloatp) { - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; num_samples = recording.getSampleCount(*mEventFloatp); } - else if (mSampleIntp) - { - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mEventFloatp); - } - } + } if (!num_samples) continue; @@ -501,20 +426,17 @@ void LLStatBar::draw() void LLStatBar::setStat(const std::string& stat_name) { - mCountFloatp = LLTrace::CountStatHandle<>::getInstance(stat_name); - mCountIntp = LLTrace::CountStatHandle::getInstance(stat_name); - mEventFloatp = LLTrace::EventStatHandle<>::getInstance(stat_name); - mEventIntp = LLTrace::EventStatHandle::getInstance(stat_name); - mSampleFloatp = LLTrace::SampleStatHandle<>::getInstance(stat_name); - mSampleIntp = LLTrace::SampleStatHandle::getInstance(stat_name); + mCountFloatp = LLTrace::TraceType::getInstance(stat_name); + mEventFloatp = LLTrace::TraceType::getInstance(stat_name); + mSampleFloatp = LLTrace::TraceType::getInstance(stat_name); } void LLStatBar::setRange(F32 bar_min, F32 bar_max, F32 tick_spacing) { - mMinBar = bar_min; - mMaxBar = bar_max; - mTickSpacing = tick_spacing; + mMinBar = bar_min; + mMaxBar = bar_max; + mTickSpacing = tick_spacing; } LLRect LLStatBar::getRequiredRect() diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index a0ed9699aa..3daec297bb 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -111,12 +111,9 @@ private: bool mScaleRange; EOrientation mOrientation; - LLTrace::TraceType >* mCountFloatp; - LLTrace::TraceType >* mCountIntp; - LLTrace::TraceType >* mEventFloatp; - LLTrace::TraceType >* mEventIntp; - LLTrace::TraceType >* mSampleFloatp; - LLTrace::TraceType >* mSampleIntp; + LLTrace::TraceType* mCountFloatp; + LLTrace::TraceType* mEventFloatp; + LLTrace::TraceType* mSampleFloatp; LLFrameTimer mUpdateTimer; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index af01e66095..a44bc18733 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -47,8 +47,7 @@ LLStatGraph::LLStatGraph(const Params& p) mPerSec(true), mPrecision(p.precision), mValue(p.value), - mNewStatFloatp(p.stat.count_stat_float), - mNewStatIntp(p.stat.count_stat_int) + mNewStatFloatp(p.stat.count_stat_float) { setToolTip(p.name()); @@ -77,19 +76,6 @@ void LLStatGraph::draw() mValue = recording.getSum(*mNewStatFloatp); } } - else if (mNewStatIntp) - { - LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecording(); - - if (mPerSec) - { - mValue = recording.getPerSec(*mNewStatIntp); - } - else - { - mValue = recording.getSum(*mNewStatIntp); - } - } frac = (mValue - mMin) / range; frac = llmax(0.f, frac); diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 08681b3704..38fe12d18b 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,12 +57,9 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative >* > count_stat_float; - Alternative >* > count_stat_int; - Alternative >* > event_stat_float; - Alternative >* > event_stat_int; - Alternative >* > sample_stat_float; - Alternative >* > sample_stat_int; + Alternative* > count_stat_float; + Alternative* > event_stat_float; + Alternative* > sample_stat_float; }; struct Params : public LLInitParam::Block @@ -107,8 +104,7 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLTrace::TraceType >* mNewStatFloatp; - LLTrace::TraceType >* mNewStatIntp; + LLTrace::TraceType* mNewStatFloatp; BOOL mPerSec; -- cgit v1.2.3 From 9fd3af3c389ed491b515cbb5136b344b069913e4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 13 Jun 2013 15:29:15 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics changed Units macros and argument order to make it more clear optimized units for integer types fixed merging of periodicrecordings...should eliminate duplicate entries in sceneloadmonitor history --- indra/llui/llstatbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 6966df8213..d3cc2733e6 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -284,7 +284,7 @@ void LLStatBar::draw() // draw background bar. 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) + if (frame_recording.getNumRecordedPeriods() == 0) { // No data, don't draw anything... return; @@ -315,7 +315,7 @@ void LLStatBar::draw() if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) { - const S32 num_values = frame_recording.getNumPeriods() - 1; + const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; F32 begin = 0; F32 end = 0; S32 i; -- cgit v1.2.3 From 8554eb5fcd1bfe7066ae6f6130378a1dfa3141dc Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 24 Jun 2013 15:01:16 -0700 Subject: SH-4242 FIX interesting: Mac viewer crashes on exit made notifications subsystem touch instancetracker in constructor so that teardown order is preserved --- indra/llui/llnotifications.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 37b0a52036..7932299281 100755 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1207,6 +1207,9 @@ LLNotifications::LLNotifications() mIgnoreAllNotifications(false) { LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2)); + + // touch the instance tracker for notification channels, so that it will still be around in our destructor + LLInstanceTracker::instanceCount(); } -- cgit v1.2.3 From 04bdc8ba83c297945dd60489c241b88adf892ff4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Jul 2013 17:04:01 -0700 Subject: SH-4294 FIX Interesting: Statistics Texture cache hit rate is always 0% also, removed LLTrace::init and cleanup removed derived class implementation of memory stat for LLMemTrackable is automatic now --- indra/llui/llstatbar.cpp | 12 ++++++------ indra/llui/lltextbase.cpp | 2 -- indra/llui/lltextbase.h | 2 -- indra/llui/llview.cpp | 1 - indra/llui/llview.h | 1 - indra/llui/llviewmodel.cpp | 2 -- indra/llui/llviewmodel.h | 2 -- 7 files changed, 6 insertions(+), 16 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index d3cc2733e6..fd88565de4 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -345,9 +345,9 @@ void LLStatBar::draw() else if (mSampleFloatp) { //rate isn't defined for sample stats, so use mean - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mEventFloatp); + begin = ((recording.getMean(*mSampleFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mSampleFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mSampleFloatp); } } else @@ -366,9 +366,9 @@ void LLStatBar::draw() } else if (mSampleFloatp) { - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mEventFloatp); + begin = ((recording.getMean(*mSampleFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mSampleFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mSampleFloatp); } } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7243931dbb..9845941778 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -48,8 +48,6 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. -LLTrace::MemStatHandle 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 74dc7f9693..3e93b7de65 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -100,8 +100,6 @@ public: S32 getEnd() const { return mEnd; } void setEnd( S32 end ) { mEnd = end; } - static LLTrace::MemStatHandle sMemStat; - protected: S32 mStart; S32 mEnd; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index daeb4d7939..b2805a32e8 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -69,7 +69,6 @@ LLView* LLView::sPreviewClickedElement = NULL; BOOL LLView::sDrawPreviewHighlights = FALSE; S32 LLView::sLastLeftXML = S32_MIN; S32 LLView::sLastBottomXML = S32_MIN; -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 0568fa889a..62bfb54566 100755 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -675,7 +675,6 @@ public: static S32 sLastLeftXML; static S32 sLastBottomXML; static BOOL sForceReshape; - static LLTrace::MemStatHandle sMemStat; }; namespace LLInitParam diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index 901260bec8..dff0dcb2fd 100755 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -35,8 +35,6 @@ // external library headers // other Linden headers -LLTrace::MemStatHandle LLViewModel::sMemStat("LLViewModel"); - /// LLViewModel::LLViewModel() : mDirty(false) diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index 2c016d2560..a2ca20c739 100755 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -83,8 +83,6 @@ public: // void setDirty() { mDirty = true; } - static LLTrace::MemStatHandle sMemStat; - protected: LLSD mValue; bool mDirty; -- cgit v1.2.3 From 8208a40412fac35593d4b8b13f43c6be5e4d6990 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Jul 2013 18:50:51 -0700 Subject: BUILDFIX: reverted changes that attempted to automate mem track stat definition as they don't work on gcc/clang --- indra/llui/lltextbase.cpp | 2 ++ indra/llui/lltextbase.h | 2 ++ indra/llui/llview.cpp | 1 + indra/llui/llview.h | 1 + indra/llui/llviewmodel.cpp | 2 ++ indra/llui/llviewmodel.h | 2 ++ 6 files changed, 10 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 9845941778..7243931dbb 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -48,6 +48,8 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. +LLTrace::MemStatHandle 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 3e93b7de65..74dc7f9693 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -100,6 +100,8 @@ public: S32 getEnd() const { return mEnd; } void setEnd( S32 end ) { mEnd = end; } + static LLTrace::MemStatHandle sMemStat; + protected: S32 mStart; S32 mEnd; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index b2805a32e8..daeb4d7939 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -69,6 +69,7 @@ LLView* LLView::sPreviewClickedElement = NULL; BOOL LLView::sDrawPreviewHighlights = FALSE; S32 LLView::sLastLeftXML = S32_MIN; S32 LLView::sLastBottomXML = S32_MIN; +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 62bfb54566..0568fa889a 100755 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -675,6 +675,7 @@ public: static S32 sLastLeftXML; static S32 sLastBottomXML; static BOOL sForceReshape; + static LLTrace::MemStatHandle sMemStat; }; namespace LLInitParam diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index dff0dcb2fd..901260bec8 100755 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -35,6 +35,8 @@ // external library headers // other Linden headers +LLTrace::MemStatHandle LLViewModel::sMemStat("LLViewModel"); + /// LLViewModel::LLViewModel() : mDirty(false) diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index a2ca20c739..2c016d2560 100755 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -83,6 +83,8 @@ public: // void setDirty() { mDirty = true; } + static LLTrace::MemStatHandle sMemStat; + protected: LLSD mValue; bool mDirty; -- cgit v1.2.3 From d122318bef2ff0eced7641dc24f411f792bd2935 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 8 Jul 2013 00:55:17 -0700 Subject: SH-4299 WIP: Interesting: High fps shown temporarily off scale in statistics console added percentage/ratio units added auto-range and auto tick calculation to stat bar to automate display stats --- indra/llui/llcontainerview.cpp | 2 +- indra/llui/llstatbar.cpp | 301 ++++++++++++++++++++++++++--------------- indra/llui/llstatbar.h | 75 +++++----- indra/llui/lltooltip.cpp | 3 + 4 files changed, 231 insertions(+), 150 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llcontainerview.cpp b/indra/llui/llcontainerview.cpp index 06f8e72c9c..6b1e3ce669 100755 --- a/indra/llui/llcontainerview.cpp +++ b/indra/llui/llcontainerview.cpp @@ -167,7 +167,7 @@ void LLContainerView::arrange(S32 width, S32 height, BOOL called_from_parent) //LLView *childp; // These will be used for the children - left = 4; + left = 10; top = getRect().getHeight() - 4; right = width - 2; bottom = top; diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index fd88565de4..46e15af66e 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -37,32 +37,137 @@ #include "lluictrlfactory.h" #include "lltracerecording.h" #include "llcriticaldamp.h" +#include "lltooltip.h" +#include + +F32 calc_reasonable_tick_value(F32 min, F32 max) +{ + F32 range = max - min; + const S32 DIVISORS[] = {6, 8, 10, 4, 5}; + // try storing + S32 best_decimal_digit_count = S32_MAX; + S32 best_divisor = 10; + for (U32 divisor_idx = 0; divisor_idx < LL_ARRAY_SIZE(DIVISORS); divisor_idx++) + { + S32 divisor = DIVISORS[divisor_idx]; + F32 possible_tick_value = range / divisor; + S32 num_whole_digits = llceil(logf(min + possible_tick_value) * OO_LN10); + for (S32 digit_count = -(num_whole_digits - 1); digit_count < 6; digit_count++) + { + F32 test_tick_value = min + (possible_tick_value * pow(10.0, digit_count)); + + if (is_approx_equal((F32)(S32)test_tick_value, (F32)test_tick_value)) + { + if (digit_count < best_decimal_digit_count) + { + best_decimal_digit_count = digit_count; + best_divisor = divisor; + } + break; + } + } + } + + return is_approx_equal(range, 0.f) ? 1.f : range / best_divisor; +} + +void calc_display_range(F32& min, F32& max) +{ + const F32 RANGES[] = {1.f, 1.5f, 2.f, 3.f, 5.f, 10.f}; + + const S32 num_digits_max = is_approx_equal(fabs(max), 0.f) + ? S32_MIN + 1 + : llceil(logf(fabs(max)) * OO_LN10); + const S32 num_digits_min = is_approx_equal(fabs(min), 0.f) + ? S32_MIN + 1 + : llceil(logf(fabs(min)) * OO_LN10); + + const S32 num_digits = llmax(num_digits_max, num_digits_min); + const F32 starting_max = pow(10.0, num_digits - 1) * ((max < 0.f) ? -1 : 1); + const F32 starting_min = pow(10.0, num_digits - 1) * ((min < 0.f) ? -1 : 1); + + F32 new_max = starting_max; + F32 new_min = starting_min; + F32 out_max = max; + F32 out_min = min; + + for (S32 range_idx = 0; range_idx < LL_ARRAY_SIZE(RANGES); range_idx++) + { + new_max = starting_max * RANGES[range_idx]; + new_min = starting_min * RANGES[range_idx]; + + if (min > 0.f && new_min < min) + { + out_min = new_min; + } + if (max < 0.f && new_max > max) + { + out_max = new_max; + } + } + + new_max = starting_max; + new_min = starting_min; + for (S32 range_idx = LL_ARRAY_SIZE(RANGES) - 1; range_idx >= 0; range_idx--) + { + new_max = starting_max * RANGES[range_idx]; + new_min = starting_min * RANGES[range_idx]; + + if (min < 0.f && new_min < min) + { + out_min = new_min; + } + if (max > 0.f && new_max > max) + { + out_max = new_max; + } + } + + min = out_min; + max = out_max; +} /////////////////////////////////////////////////////////////////////////////////// LLStatBar::LLStatBar(const Params& p) - : LLView(p), - mLabel(p.label), - mUnitLabel(p.unit_label), - mMinBar(p.bar_min), - mMaxBar(p.bar_max), - mCurMaxBar(p.bar_max), - mTickSpacing(p.tick_spacing), - 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), - mScaleRange(p.scale_range) +: LLView(p), + mLabel(p.label), + mUnitLabel(p.unit_label), + mMinBar(p.bar_min), + mMaxBar(p.bar_max), + mCurMaxBar(p.bar_max), + mTickValue(p.tick_spacing.isProvided() ? p.tick_spacing : calc_reasonable_tick_value(p.bar_min, p.bar_max)), + mDecimalDigits(p.decimal_digits), + 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), + mScaleMax(!p.bar_max.isProvided()), + mScaleMin(!p.bar_min.isProvided()) { setStat(p.stat); } +BOOL LLStatBar::handleHover(S32 x, S32 y, MASK mask) +{ + if (mCountFloatp) + { + LLToolTipMgr::instance().show(LLToolTip::Params().message(mCountFloatp->getDescription()).sticky_rect(calcScreenRect())); + } + else if ( mEventFloatp) + { + LLToolTipMgr::instance().show(LLToolTip::Params().message(mEventFloatp->getDescription()).sticky_rect(calcScreenRect())); + } + else if (mSampleFloatp) + { + LLToolTipMgr::instance().show(LLToolTip::Params().message(mSampleFloatp->getDescription()).sticky_rect(calcScreenRect())); + } + return TRUE; +} + BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLView::handleMouseDown(x, y, mask); @@ -96,23 +201,27 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) void LLStatBar::draw() { - F32 current = 0.f, - min = 0.f, - max = 0.f, - mean = 0.f; + F32 current = 0, + min = 0, + max = 0, + mean = 0, + value = 0; LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); + std::string unit_label; if (mCountFloatp) { LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - + unit_label = mUnitLabel.empty() ? mCountFloatp->getUnitLabel() : mUnitLabel; if (mPerSec) { + unit_label += "/s"; current = last_frame_recording.getPerSec(*mCountFloatp); min = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames); max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp, mNumFrames); + value = mDisplayMean ? mean : current; } else { @@ -120,43 +229,30 @@ void LLStatBar::draw() min = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); mean = frame_recording.getPeriodMean(*mCountFloatp, mNumFrames); + value = mDisplayMean ? mean : current; } } else if (mEventFloatp) { LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + unit_label = mUnitLabel.empty() ? mEventFloatp->getUnitLabel() : mUnitLabel; current = last_frame_recording.getMean(*mEventFloatp); min = frame_recording.getPeriodMin(*mEventFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mEventFloatp, mNumFrames); mean = frame_recording.getPeriodMean(*mEventFloatp, mNumFrames); + value = mDisplayMean ? mean : current; } else if (mSampleFloatp) { LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + unit_label = mUnitLabel.empty() ? mSampleFloatp->getUnitLabel() : mUnitLabel; current = last_frame_recording.getLastValue(*mSampleFloatp); min = frame_recording.getPeriodMin(*mSampleFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mSampleFloatp, mNumFrames); mean = frame_recording.getPeriodMean(*mSampleFloatp, mNumFrames); - } - - current *= mUnitScale; - min *= mUnitScale; - max *= mUnitScale; - mean *= mUnitScale; - - if ((mUpdatesPerSec == 0.f) || (mUpdateTimer.getElapsedTimeF32() > 1.f/mUpdatesPerSec) || (mValue == 0.f)) - { - if (mDisplayMean) - { - mValue = mean; - } - else - { - mValue = current; - } - mUpdateTimer.reset(); + value = mDisplayMean ? mean : current; } S32 bar_top, bar_left, bar_right, bar_bottom; @@ -177,39 +273,40 @@ void LLStatBar::draw() const S32 tick_length = 4; const S32 tick_width = 1; - if (mScaleRange && min < max) + if ((mScaleMax && max >= mCurMaxBar)|| (mScaleMin && min <= mCurMinBar)) { - F32 cur_max = mTickSpacing; - while(max > cur_max && mMaxBar > cur_max) - { - cur_max += mTickSpacing; - } - mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, cur_max, 0.05f); + F32 range_min = min; + F32 range_max = max; + calc_display_range(range_min, range_max); + if (mScaleMax) { mMaxBar = llmax(mMaxBar, range_max); } + if (mScaleMin) { mMinBar = llmin(mMinBar, range_min); } + mTickValue = calc_reasonable_tick_value(mMinBar, mMaxBar); + + } + mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mMaxBar, 0.05f); + mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mMinBar, 0.05f); + + F32 value_scale; + if (mCurMaxBar == mCurMinBar) + { + value_scale = 0.f; } else { - mCurMaxBar = mMaxBar; + value_scale = (mOrientation == HORIZONTAL) + ? (bar_top - bar_bottom)/(mCurMaxBar - mCurMinBar) + : (bar_right - bar_left)/(mCurMaxBar - mCurMinBar); } - F32 value_scale = (mOrientation == HORIZONTAL) - ? (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); - - std::string value_format; - std::string value_str; - if (!mUnitLabel.empty()) - { - value_format = llformat( "%%.%df%%s", mPrecision); - value_str = llformat( value_format.c_str(), mValue, mUnitLabel.c_str()); - } - else + + S32 decimal_digits = mDecimalDigits; + if (is_approx_equal((F32)(S32)value, value)) { - value_format = llformat( "%%.%df", mPrecision); - value_str = llformat( value_format.c_str(), mValue); + decimal_digits = 0; } + std::string value_str = llformat("%10.*f %s", decimal_digits, value, unit_label.c_str()); // Draw the value. if (mOrientation == HORIZONTAL) @@ -225,11 +322,8 @@ void LLStatBar::draw() LLFontGL::RIGHT, LLFontGL::TOP); } - value_format = llformat( "%%.%df", mPrecision); if (mDisplayBar && (mCountFloatp || mEventFloatp || mSampleFloatp)) { - std::string tick_label; - // Draw the tick marks. LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -237,9 +331,10 @@ void LLStatBar::draw() S32 last_label = 0; const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30; const S32 MIN_LABEL_SPACING = mOrientation == HORIZONTAL ? 40 : 60; - for (F32 tick_value = mMinBar + mTickSpacing; tick_value <= mCurMaxBar; tick_value += mTickSpacing) + // start counting from actual min, not current, animating min, so that ticks don't float between numbers + for (F32 tick_value = mMinBar; tick_value <= mCurMaxBar; tick_value += mTickValue) { - const S32 begin = llfloor((tick_value - mMinBar)*value_scale); + const S32 begin = llfloor((tick_value - mCurMinBar)*value_scale); const S32 end = begin + tick_width; if (begin - last_tick < MIN_TICK_SPACING) { @@ -247,14 +342,19 @@ void LLStatBar::draw() } last_tick = begin; - tick_label = llformat( value_format.c_str(), tick_value); + S32 decimal_digits = mDecimalDigits; + if (is_approx_equal((F32)(S32)tick_value, tick_value)) + { + decimal_digits = 0; + } + std::string tick_string = llformat("%10.*f", decimal_digits, tick_value); if (mOrientation == HORIZONTAL) { if (begin - last_label > MIN_LABEL_SPACING) { 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, + LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, bar_right, begin, LLColor4(1.f, 1.f, 1.f, 0.5f), LLFontGL::LEFT, LLFontGL::VCENTER); last_label = begin; @@ -269,7 +369,7 @@ void LLStatBar::draw() if (begin - last_label > MIN_LABEL_SPACING) { 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, + LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, begin - 1, bar_bottom - tick_length, LLColor4(1.f, 1.f, 1.f, 0.5f), LLFontGL::RIGHT, LLFontGL::TOP); last_label = begin; @@ -291,7 +391,7 @@ void LLStatBar::draw() } // draw min and max - S32 begin = (S32) ((min - mMinBar) * value_scale); + S32 begin = (S32) ((min - mCurMinBar) * value_scale); if (begin < 0) { @@ -299,7 +399,7 @@ void LLStatBar::draw() llwarns << "Min:" << min << llendl; } - S32 end = (S32) ((max - mMinBar) * value_scale); + S32 end = (S32) ((max - mCurMinBar) * value_scale); if (mOrientation == HORIZONTAL) { gl_rect_2d(bar_left, end, bar_right, begin, LLColor4(1.f, 0.f, 0.f, 0.25f)); @@ -327,47 +427,30 @@ void LLStatBar::draw() { F32 offset = ((F32)i / (F32)mNumFrames) * span; LLTrace::Recording& recording = frame_recording.getPrevRecording(i); - if (mPerSec) + if (mPerSec && mCountFloatp) { - if (mCountFloatp) - { - begin = ((recording.getPerSec(*mCountFloatp) - mMinBar) * value_scale); - end = ((recording.getPerSec(*mCountFloatp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mCountFloatp); - } - else if (mEventFloatp) - { - //rate isn't defined for measurement stats, so use mean - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mEventFloatp); - } - else if (mSampleFloatp) - { - //rate isn't defined for sample stats, so use mean - begin = ((recording.getMean(*mSampleFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mSampleFloatp) - mMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mSampleFloatp); - } + begin = ((recording.getPerSec(*mCountFloatp) - mCurMinBar) * value_scale); + end = ((recording.getPerSec(*mCountFloatp) - mCurMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mCountFloatp); } else { if (mCountFloatp) { - begin = ((recording.getSum(*mCountFloatp) - mMinBar) * value_scale); - end = ((recording.getSum(*mCountFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getSum(*mCountFloatp) - mCurMinBar) * value_scale); + end = ((recording.getSum(*mCountFloatp) - mCurMinBar) * value_scale) + 1; num_samples = recording.getSampleCount(*mCountFloatp); } else if (mEventFloatp) { - begin = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mEventFloatp) - mCurMinBar) * value_scale); + end = ((recording.getMean(*mEventFloatp) - mCurMinBar) * value_scale) + 1; num_samples = recording.getSampleCount(*mEventFloatp); } else if (mSampleFloatp) { - begin = ((recording.getMean(*mSampleFloatp) - mMinBar) * value_scale); - end = ((recording.getMean(*mSampleFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mSampleFloatp) - mCurMinBar) * value_scale); + end = ((recording.getMean(*mSampleFloatp) - mCurMinBar) * value_scale) + 1; num_samples = recording.getSampleCount(*mSampleFloatp); } } @@ -393,8 +476,8 @@ void LLStatBar::draw() } else { - S32 begin = (S32) ((current - mMinBar) * value_scale) - 1; - S32 end = (S32) ((current - mMinBar) * value_scale) + 1; + S32 begin = (S32) ((current - mCurMinBar) * value_scale) - 1; + S32 end = (S32) ((current - mCurMinBar) * value_scale) + 1; // draw current if (mOrientation == HORIZONTAL) { @@ -408,8 +491,8 @@ void LLStatBar::draw() // draw mean bar { - const S32 begin = (S32) ((mean - mMinBar) * value_scale) - 1; - const S32 end = (S32) ((mean - mMinBar) * value_scale) + 1; + const S32 begin = (S32) ((mean - mCurMinBar) * value_scale) - 1; + const S32 end = (S32) ((mean - mCurMinBar) * 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)); @@ -432,11 +515,11 @@ void LLStatBar::setStat(const std::string& stat_name) } -void LLStatBar::setRange(F32 bar_min, F32 bar_max, F32 tick_spacing) +void LLStatBar::setRange(F32 bar_min, F32 bar_max) { - mMinBar = bar_min; - mMaxBar = bar_max; - mTickSpacing = tick_spacing; + mMinBar = bar_min; + mMaxBar = bar_max; + mTickValue = calc_reasonable_tick_value(mMinBar, mMaxBar); } LLRect LLStatBar::getRequiredRect() diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 3daec297bb..a0299c0efb 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -42,11 +42,9 @@ public: Optional bar_min, bar_max, - tick_spacing, - update_rate, - unit_scale; + tick_spacing; - Optional precision; + Optional decimal_digits; Optional show_per_sec, show_bar, @@ -60,23 +58,21 @@ public: Optional orientation; Params() - : label("label"), - unit_label("unit_label"), - bar_min("bar_min", 0.0f), - bar_max("bar_max", 50.0f), - tick_spacing("tick_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), - 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) + : label("label"), + unit_label("unit_label"), + bar_min("bar_min", 0.0f), + bar_max("bar_max", 0.0f), + tick_spacing("tick_spacing", 10.0f), + decimal_digits("decimal_digits", 3), + show_per_sec("show_per_sec", true), + show_bar("show_bar", false), + show_history("show_history", false), + show_mean("show_mean", true), + scale_range("scale_range", true), + num_frames("num_frames", 200), + max_height("max_height", 100), + stat("stat"), + orientation("orientation", VERTICAL) { changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT); } @@ -85,40 +81,39 @@ public: virtual void draw(); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleHover(S32 x, S32 y, MASK mask); void setStat(const std::string& stat_name); - void setRange(F32 bar_min, F32 bar_max, F32 tick_spacing); + void setRange(F32 bar_min, F32 bar_max); void getRange(F32& bar_min, F32& bar_max) { bar_min = mMinBar; bar_max = mMaxBar; } /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. private: - F32 mMinBar; - F32 mMaxBar; - F32 mCurMaxBar; - F32 mTickSpacing; - F32 mLabelSpacing; - U32 mPrecision; - F32 mUpdatesPerSec; - F32 mUnitScale; + F32 mMinBar, + mMaxBar, + mCurMaxBar, + mCurMinBar, + mLabelSpacing; + F32 mTickValue; + U32 mDecimalDigits; 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; + bool mPerSec, // Use the per sec stats. + mDisplayBar, // Display the bar graph. + mDisplayHistory, + mDisplayMean, // If true, display mean, if false, display current value + mScaleMax, + mScaleMin; EOrientation mOrientation; - LLTrace::TraceType* mCountFloatp; - LLTrace::TraceType* mEventFloatp; - LLTrace::TraceType* mSampleFloatp; + LLTrace::TraceType* mCountFloatp; + LLTrace::TraceType* mEventFloatp; + LLTrace::TraceType* mSampleFloatp; - LLFrameTimer mUpdateTimer; LLUIString mLabel; std::string mUnitLabel; - F32 mValue; }; #endif diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index f52a3b3323..782d26fccb 100755 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -476,6 +476,9 @@ void LLToolTipMgr::show(const std::string& msg) void LLToolTipMgr::show(const LLToolTip::Params& params) { + if (!params.styled_message.isProvided() + && (!params.message.isProvided() || params.message().empty())) return; + // fill in default tooltip params from tool_tip.xml LLToolTip::Params params_with_defaults(params); params_with_defaults.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); -- cgit v1.2.3 From c95042db3e8d2f1a938e7d6e9ca625700d634639 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 12 Jul 2013 00:52:31 -0700 Subject: SH-4299 WIP: Interesting: High fps shown temporarily off scale in statistics console improved calculation of display range for stat bars --- indra/llui/llstatbar.cpp | 262 ++++++++++++++++++++++++++--------------------- indra/llui/llstatbar.h | 13 +-- 2 files changed, 149 insertions(+), 126 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 46e15af66e..a0a14f4610 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -38,9 +38,10 @@ #include "lltracerecording.h" #include "llcriticaldamp.h" #include "lltooltip.h" +#include "lllocalcliprect.h" #include -F32 calc_reasonable_tick_value(F32 min, F32 max) +F32 calc_tick_value(F32 min, F32 max) { F32 range = max - min; const S32 DIVISORS[] = {6, 8, 10, 4, 5}; @@ -56,7 +57,7 @@ F32 calc_reasonable_tick_value(F32 min, F32 max) { F32 test_tick_value = min + (possible_tick_value * pow(10.0, digit_count)); - if (is_approx_equal((F32)(S32)test_tick_value, (F32)test_tick_value)) + if (is_approx_equal((F32)(S32)test_tick_value, test_tick_value)) { if (digit_count < best_decimal_digit_count) { @@ -68,12 +69,16 @@ F32 calc_reasonable_tick_value(F32 min, F32 max) } } - return is_approx_equal(range, 0.f) ? 1.f : range / best_divisor; + return is_approx_equal(range, 0.f) ? 0.f : range / best_divisor; } -void calc_display_range(F32& min, F32& max) +void calc_auto_scale_range(F32& min, F32& max, F32& tick) { - const F32 RANGES[] = {1.f, 1.5f, 2.f, 3.f, 5.f, 10.f}; + min = llmin(0.f, min, max); + max = llmax(0.f, min, max); + + const F32 RANGES[] = {0.f, 1.f, 1.5f, 2.f, 3.f, 5.f, 10.f}; + const F32 TICKS[] = {0.f, 0.25f, 0.5f, 1.f, 1.f, 1.f, 2.f }; const S32 num_digits_max = is_approx_equal(fabs(max), 0.f) ? S32_MIN + 1 @@ -83,46 +88,55 @@ void calc_display_range(F32& min, F32& max) : llceil(logf(fabs(min)) * OO_LN10); const S32 num_digits = llmax(num_digits_max, num_digits_min); - const F32 starting_max = pow(10.0, num_digits - 1) * ((max < 0.f) ? -1 : 1); - const F32 starting_min = pow(10.0, num_digits - 1) * ((min < 0.f) ? -1 : 1); + const F32 power_of_10 = pow(10.0, num_digits - 1); + const F32 starting_max = power_of_10 * ((max < 0.f) ? -1 : 1); + const F32 starting_min = power_of_10 * ((min < 0.f) ? -1 : 1); - F32 new_max = starting_max; - F32 new_min = starting_min; + F32 cur_max = starting_max; + F32 cur_min = starting_min; F32 out_max = max; F32 out_min = min; + F32 cur_tick_min = 0.f; + F32 cur_tick_max = 0.f; + for (S32 range_idx = 0; range_idx < LL_ARRAY_SIZE(RANGES); range_idx++) { - new_max = starting_max * RANGES[range_idx]; - new_min = starting_min * RANGES[range_idx]; + cur_max = starting_max * RANGES[range_idx]; + cur_min = starting_min * RANGES[range_idx]; - if (min > 0.f && new_min < min) + if (min > 0.f && cur_min <= min) { - out_min = new_min; + out_min = cur_min; + cur_tick_min = TICKS[range_idx]; } - if (max < 0.f && new_max > max) + if (max < 0.f && cur_max >= max) { - out_max = new_max; + out_max = cur_max; + cur_tick_max = TICKS[range_idx]; } } - new_max = starting_max; - new_min = starting_min; + cur_max = starting_max; + cur_min = starting_min; for (S32 range_idx = LL_ARRAY_SIZE(RANGES) - 1; range_idx >= 0; range_idx--) { - new_max = starting_max * RANGES[range_idx]; - new_min = starting_min * RANGES[range_idx]; + cur_max = starting_max * RANGES[range_idx]; + cur_min = starting_min * RANGES[range_idx]; - if (min < 0.f && new_min < min) + if (min < 0.f && cur_min <= min) { - out_min = new_min; + out_min = cur_min; + cur_tick_min = TICKS[range_idx]; } - if (max > 0.f && new_max > max) + if (max > 0.f && cur_max >= max) { - out_max = new_max; + out_max = cur_max; + cur_tick_max = TICKS[range_idx]; } } + tick = power_of_10 * llmax(cur_tick_min, cur_tick_max); min = out_min; max = out_max; } @@ -133,21 +147,26 @@ LLStatBar::LLStatBar(const Params& p) : LLView(p), mLabel(p.label), mUnitLabel(p.unit_label), - mMinBar(p.bar_min), - mMaxBar(p.bar_max), + mMinBar(llmin(p.bar_min, p.bar_max)), + mMaxBar(llmax(p.bar_max, p.bar_min)), mCurMaxBar(p.bar_max), - mTickValue(p.tick_spacing.isProvided() ? p.tick_spacing : calc_reasonable_tick_value(p.bar_min, p.bar_max)), mDecimalDigits(p.decimal_digits), 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), - mScaleMax(!p.bar_max.isProvided()), - mScaleMin(!p.bar_min.isProvided()) + mAutoScaleMax(!p.bar_max.isProvided()), + mAutoScaleMin(!p.bar_min.isProvided()), + mTickValue(p.tick_spacing) { + // tick value will be automatically calculated later + if (!p.tick_spacing.isProvided() && p.bar_min.isProvided() && p.bar_max.isProvided()) + { + mTickValue = calc_tick_value(mMinBar, mMaxBar); + } + setStat(p.stat); } @@ -204,9 +223,9 @@ void LLStatBar::draw() F32 current = 0, min = 0, max = 0, - mean = 0, - value = 0; + mean = 0; + LLLocalClipRect _(getLocalRect()); LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); std::string unit_label; @@ -221,7 +240,6 @@ void LLStatBar::draw() min = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames); max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp, mNumFrames); - value = mDisplayMean ? mean : current; } else { @@ -229,7 +247,6 @@ void LLStatBar::draw() min = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); mean = frame_recording.getPeriodMean(*mCountFloatp, mNumFrames); - value = mDisplayMean ? mean : current; } } else if (mEventFloatp) @@ -241,18 +258,16 @@ void LLStatBar::draw() min = frame_recording.getPeriodMin(*mEventFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mEventFloatp, mNumFrames); mean = frame_recording.getPeriodMean(*mEventFloatp, mNumFrames); - value = mDisplayMean ? mean : current; } else if (mSampleFloatp) { LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); unit_label = mUnitLabel.empty() ? mSampleFloatp->getUnitLabel() : mUnitLabel; - current = last_frame_recording.getLastValue(*mSampleFloatp); + current = last_frame_recording.getMean(*mSampleFloatp); min = frame_recording.getPeriodMin(*mSampleFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mSampleFloatp, mNumFrames); mean = frame_recording.getPeriodMean(*mSampleFloatp, mNumFrames); - value = mDisplayMean ? mean : current; } S32 bar_top, bar_left, bar_right, bar_bottom; @@ -273,16 +288,24 @@ void LLStatBar::draw() const S32 tick_length = 4; const S32 tick_width = 1; - if ((mScaleMax && max >= mCurMaxBar)|| (mScaleMin && min <= mCurMinBar)) + if ((mAutoScaleMax && max >= mCurMaxBar)|| (mAutoScaleMin && min <= mCurMinBar)) { - F32 range_min = min; - F32 range_max = max; - calc_display_range(range_min, range_max); - if (mScaleMax) { mMaxBar = llmax(mMaxBar, range_max); } - if (mScaleMin) { mMinBar = llmin(mMinBar, range_min); } - mTickValue = calc_reasonable_tick_value(mMinBar, mMaxBar); - + F32 range_min = mAutoScaleMin ? llmin(mMinBar, min) : mMinBar; + F32 range_max = mAutoScaleMax ? llmax(mMaxBar, max) : mMaxBar; + F32 tick_value = 0.f; + calc_auto_scale_range(range_min, range_max, tick_value); + if (mAutoScaleMin) { mMinBar = range_min; } + if (mAutoScaleMax) { mMaxBar = range_max; } + if (mAutoScaleMin && mAutoScaleMax) + { + mTickValue = tick_value; + } + else + { + mTickValue = calc_tick_value(mMinBar, mMaxBar); + } } + mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mMaxBar, 0.05f); mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mMinBar, 0.05f); @@ -302,13 +325,13 @@ void LLStatBar::draw() LLFontGL::LEFT, LLFontGL::TOP); S32 decimal_digits = mDecimalDigits; - if (is_approx_equal((F32)(S32)value, value)) + if (is_approx_equal((F32)(S32)mean, mean)) { decimal_digits = 0; } - std::string value_str = llformat("%10.*f %s", decimal_digits, value, unit_label.c_str()); + std::string value_str = llformat("%10.*f %s", decimal_digits, mean, unit_label.c_str()); - // Draw the value. + // Draw the current value. if (mOrientation == HORIZONTAL) { LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, bar_right, getRect().getHeight(), @@ -330,53 +353,65 @@ void LLStatBar::draw() S32 last_tick = 0; S32 last_label = 0; const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30; - const S32 MIN_LABEL_SPACING = mOrientation == HORIZONTAL ? 40 : 60; + const S32 MIN_LABEL_SPACING = mOrientation == HORIZONTAL ? 30 : 60; // start counting from actual min, not current, animating min, so that ticks don't float between numbers - for (F32 tick_value = mMinBar; tick_value <= mCurMaxBar; tick_value += mTickValue) + // ensure ticks always hit 0 + if (mTickValue > 0.f) { - const S32 begin = llfloor((tick_value - mCurMinBar)*value_scale); - const S32 end = begin + tick_width; - if (begin - last_tick < MIN_TICK_SPACING) + F32 start = mCurMinBar < 0.f + ? llceil(-mCurMinBar / mTickValue) * -mTickValue + : 0.f; + for (F32 tick_value = start; ;tick_value += mTickValue) { - continue; - } - last_tick = begin; - - S32 decimal_digits = mDecimalDigits; - if (is_approx_equal((F32)(S32)tick_value, tick_value)) - { - decimal_digits = 0; - } - std::string tick_string = llformat("%10.*f", decimal_digits, tick_value); - - if (mOrientation == HORIZONTAL) - { - if (begin - last_label > MIN_LABEL_SPACING) + const S32 begin = llfloor((tick_value - mCurMinBar)*value_scale); + const S32 end = begin + tick_width; + if (begin - last_tick < MIN_TICK_SPACING) { - gl_rect_2d(bar_left, end, bar_right - tick_length, begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); - LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, bar_right, begin, - LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::LEFT, LLFontGL::VCENTER); - last_label = begin; + continue; } - else + last_tick = begin; + + S32 decimal_digits = mDecimalDigits; + if (is_approx_equal((F32)(S32)tick_value, tick_value)) { - gl_rect_2d(bar_left, end, bar_right - tick_length/2, begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); + decimal_digits = 0; } - } - else - { - if (begin - last_label > MIN_LABEL_SPACING) + std::string tick_string = llformat("%10.*f", decimal_digits, tick_value); + + if (mOrientation == HORIZONTAL) { - gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length, LLColor4(1.f, 1.f, 1.f, 0.25f)); - LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, begin - 1, bar_bottom - tick_length, - LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::RIGHT, LLFontGL::TOP); - last_label = begin; + if (begin - last_label > MIN_LABEL_SPACING) + { + gl_rect_2d(bar_left, end, bar_right - tick_length, begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); + LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, bar_right, begin, + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::LEFT, LLFontGL::VCENTER); + last_label = begin; + } + else + { + gl_rect_2d(bar_left, end, bar_right - tick_length/2, begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); + } } else { - gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length/2, LLColor4(1.f, 1.f, 1.f, 0.1f)); + if (begin - last_label > MIN_LABEL_SPACING) + { + gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length, LLColor4(1.f, 1.f, 1.f, 0.25f)); + LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, begin - 1, bar_bottom - tick_length, + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::RIGHT, LLFontGL::TOP); + last_label = begin; + } + else + { + gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length/2, LLColor4(1.f, 1.f, 1.f, 0.1f)); + } + } + // always draw one tick value past end, so we can see part of the text, if possible + if (tick_value > mCurMaxBar) + { + break; } } } @@ -416,8 +451,7 @@ void LLStatBar::draw() if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) { const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; - F32 begin = 0; - F32 end = 0; + F32 value = 0; S32 i; gGL.color4f( 1.f, 0.f, 0.f, 1.f ); gGL.begin( LLRender::QUADS ); @@ -427,49 +461,41 @@ void LLStatBar::draw() { F32 offset = ((F32)i / (F32)mNumFrames) * span; LLTrace::Recording& recording = frame_recording.getPrevRecording(i); - if (mPerSec && mCountFloatp) + + if (mCountFloatp) { - begin = ((recording.getPerSec(*mCountFloatp) - mCurMinBar) * value_scale); - end = ((recording.getPerSec(*mCountFloatp) - mCurMinBar) * value_scale) + 1; + value = mPerSec + ? recording.getPerSec(*mCountFloatp) + : recording.getSum(*mCountFloatp); num_samples = recording.getSampleCount(*mCountFloatp); } - else + else if (mEventFloatp) { - if (mCountFloatp) - { - begin = ((recording.getSum(*mCountFloatp) - mCurMinBar) * value_scale); - end = ((recording.getSum(*mCountFloatp) - mCurMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mCountFloatp); - } - else if (mEventFloatp) - { - begin = ((recording.getMean(*mEventFloatp) - mCurMinBar) * value_scale); - end = ((recording.getMean(*mEventFloatp) - mCurMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mEventFloatp); - } - else if (mSampleFloatp) - { - begin = ((recording.getMean(*mSampleFloatp) - mCurMinBar) * value_scale); - end = ((recording.getMean(*mSampleFloatp) - mCurMinBar) * value_scale) + 1; - num_samples = recording.getSampleCount(*mSampleFloatp); - } - } + value = recording.getMean(*mEventFloatp); + num_samples = recording.getSampleCount(*mEventFloatp); + } + else if (mSampleFloatp) + { + value = recording.getMean(*mSampleFloatp); + num_samples = recording.getSampleCount(*mSampleFloatp); + } if (!num_samples) continue; + F32 begin = (value - mCurMinBar) * value_scale; if (mOrientation == HORIZONTAL) { - gGL.vertex2f((F32)bar_right - offset, end); + gGL.vertex2f((F32)bar_right - offset, begin + 1); 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); + gGL.vertex2f((F32)bar_right - offset - 1, begin); + gGL.vertex2f((F32)bar_right - offset - 1, begin + 1); } else { - gGL.vertex2f(begin, (F32)bar_bottom+offset+1.f); - gGL.vertex2f(begin, (F32)bar_bottom+offset); - gGL.vertex2f(end, (F32)bar_bottom+offset); - gGL.vertex2f(end, (F32)bar_bottom+offset+1.f); + gGL.vertex2f(begin, (F32)bar_bottom + offset + 1); + gGL.vertex2f(begin, (F32)bar_bottom + offset); + gGL.vertex2f(begin + 1, (F32)bar_bottom + offset); + gGL.vertex2f(begin + 1, (F32)bar_bottom + offset + 1 ); } } gGL.end(); @@ -517,9 +543,9 @@ void LLStatBar::setStat(const std::string& stat_name) void LLStatBar::setRange(F32 bar_min, F32 bar_max) { - mMinBar = bar_min; - mMaxBar = bar_max; - mTickValue = calc_reasonable_tick_value(mMinBar, mMaxBar); + mMinBar = llmin(bar_min, bar_max); + mMaxBar = llmax(bar_min, bar_max); + mTickValue = calc_tick_value(mMinBar, mMaxBar); } LLRect LLStatBar::getRequiredRect() diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index a0299c0efb..fc925b1a74 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -49,7 +49,6 @@ public: Optional show_per_sec, show_bar, show_history, - show_mean, scale_range; Optional num_frames, @@ -60,14 +59,13 @@ public: Params() : label("label"), unit_label("unit_label"), - bar_min("bar_min", 0.0f), - bar_max("bar_max", 0.0f), - tick_spacing("tick_spacing", 10.0f), + bar_min("bar_min", 0.f), + bar_max("bar_max", 0.f), + tick_spacing("tick_spacing", 0.f), decimal_digits("decimal_digits", 3), show_per_sec("show_per_sec", true), show_bar("show_bar", false), show_history("show_history", false), - show_mean("show_mean", true), scale_range("scale_range", true), num_frames("num_frames", 200), max_height("max_height", 100), @@ -103,9 +101,8 @@ private: bool mPerSec, // Use the per sec stats. mDisplayBar, // Display the bar graph. mDisplayHistory, - mDisplayMean, // If true, display mean, if false, display current value - mScaleMax, - mScaleMin; + mAutoScaleMax, + mAutoScaleMin; EOrientation mOrientation; LLTrace::TraceType* mCountFloatp; -- cgit v1.2.3 From c2a456e9f2d92a62551cfbd1367c9a0303a1570d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 15 Jul 2013 11:41:47 -0700 Subject: BUILDFIX: remove ambiguity of is_approx_equal, use llabs instead of fabs --- indra/llui/llstatbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index a0a14f4610..3cd60a3f73 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -80,12 +80,12 @@ void calc_auto_scale_range(F32& min, F32& max, F32& tick) const F32 RANGES[] = {0.f, 1.f, 1.5f, 2.f, 3.f, 5.f, 10.f}; const F32 TICKS[] = {0.f, 0.25f, 0.5f, 1.f, 1.f, 1.f, 2.f }; - const S32 num_digits_max = is_approx_equal(fabs(max), 0.f) + const S32 num_digits_max = is_approx_equal(llabs(max), 0.f) ? S32_MIN + 1 - : llceil(logf(fabs(max)) * OO_LN10); - const S32 num_digits_min = is_approx_equal(fabs(min), 0.f) + : llceil(logf(llabs(max)) * OO_LN10); + const S32 num_digits_min = is_approx_equal(llabs(min), 0.f) ? S32_MIN + 1 - : llceil(logf(fabs(min)) * OO_LN10); + : llceil(logf(llabs(min)) * OO_LN10); const S32 num_digits = llmax(num_digits_max, num_digits_min); const F32 power_of_10 = pow(10.0, num_digits - 1); -- cgit v1.2.3 From 075a7bcc980b0ca0d2888d344b6afa8ab5b52d85 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 18 Jul 2013 15:09:45 -0700 Subject: SH-4297 WIP interesting: viewer-interesting starts loading cached scene late dependency cleanup - removed a lot of unecessary includes --- indra/llui/llflashtimer.h | 1 + indra/llui/llrngwriter.cpp | 1 + indra/llui/llxuiparser.cpp | 1 + 3 files changed, 3 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h index c60f99a8ea..db8d49f009 100755 --- a/indra/llui/llflashtimer.h +++ b/indra/llui/llflashtimer.h @@ -28,6 +28,7 @@ #define LL_FLASHTIMER_H #include "lleventtimer.h" +#include "boost/function.hpp" class LLFlashTimer : public LLEventTimer { diff --git a/indra/llui/llrngwriter.cpp b/indra/llui/llrngwriter.cpp index 5e6840d7df..cd9fe3610e 100755 --- a/indra/llui/llrngwriter.cpp +++ b/indra/llui/llrngwriter.cpp @@ -29,6 +29,7 @@ #include "llrngwriter.h" #include "lluicolor.h" #include "lluictrlfactory.h" +#include "boost/bind.hpp" static LLInitParam::Parser::parser_read_func_map_t sReadFuncs; static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs; diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 2814efec47..4cbf84be73 100755 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -38,6 +38,7 @@ #include #include +#include //#include #include -- cgit v1.2.3 From e40065f82c797eab41006a448c838f4f1089a2e8 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 19 Jul 2013 15:03:05 -0700 Subject: BUILDFIX: #include and dependency cleanup --- indra/llui/llnotificationsutil.h | 1 + indra/llui/lltrans.h | 1 + 2 files changed, 2 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llnotificationsutil.h b/indra/llui/llnotificationsutil.h index 4093324d0c..9f29087b4a 100755 --- a/indra/llui/llnotificationsutil.h +++ b/indra/llui/llnotificationsutil.h @@ -30,6 +30,7 @@ // to avoid including the heavyweight llnotifications.h #include "llnotificationptr.h" +#include "lluuid.h" #include diff --git a/indra/llui/lltrans.h b/indra/llui/lltrans.h index 128b51d383..a47ce94f08 100755 --- a/indra/llui/lltrans.h +++ b/indra/llui/lltrans.h @@ -28,6 +28,7 @@ #define LL_TRANS_H #include +#include #include "llpointer.h" #include "llstring.h" -- cgit v1.2.3 From 0127e66228acd41402da9acab8ce91d394c3096f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Jul 2013 16:42:22 -0700 Subject: stat bars with no stats now show n/a instead of o --- indra/llui/llstatbar.cpp | 180 +++++++++++++++++++++++++---------------------- 1 file changed, 96 insertions(+), 84 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 3cd60a3f73..7f1632b48b 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -225,6 +225,9 @@ void LLStatBar::draw() max = 0, mean = 0; + + S32 num_samples = 0; + LLLocalClipRect _(getLocalRect()); LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); @@ -236,6 +239,7 @@ void LLStatBar::draw() if (mPerSec) { unit_label += "/s"; + num_samples = frame_recording.getSampleCount(*mCountFloatp, mNumFrames); current = last_frame_recording.getPerSec(*mCountFloatp); min = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames); max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); @@ -243,6 +247,7 @@ void LLStatBar::draw() } else { + num_samples = frame_recording.getSampleCount(*mCountFloatp, mNumFrames); current = last_frame_recording.getSum(*mCountFloatp); min = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); @@ -254,6 +259,7 @@ void LLStatBar::draw() LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); unit_label = mUnitLabel.empty() ? mEventFloatp->getUnitLabel() : mUnitLabel; + num_samples = frame_recording.getSampleCount(*mEventFloatp, mNumFrames); current = last_frame_recording.getMean(*mEventFloatp); min = frame_recording.getPeriodMin(*mEventFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mEventFloatp, mNumFrames); @@ -264,6 +270,7 @@ void LLStatBar::draw() LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); unit_label = mUnitLabel.empty() ? mSampleFloatp->getUnitLabel() : mUnitLabel; + num_samples = frame_recording.getSampleCount(*mSampleFloatp, mNumFrames); current = last_frame_recording.getMean(*mSampleFloatp); min = frame_recording.getPeriodMin(*mSampleFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mSampleFloatp, mNumFrames); @@ -329,7 +336,9 @@ void LLStatBar::draw() { decimal_digits = 0; } - std::string value_str = llformat("%10.*f %s", decimal_digits, mean, unit_label.c_str()); + std::string value_str = num_samples + ? llformat("%10.*f %s", decimal_digits, mean, unit_label.c_str()) + : "n/a"; // Draw the current value. if (mOrientation == HORIZONTAL) @@ -345,7 +354,8 @@ void LLStatBar::draw() LLFontGL::RIGHT, LLFontGL::TOP); } - if (mDisplayBar && (mCountFloatp || mEventFloatp || mSampleFloatp)) + if (mDisplayBar + && (mCountFloatp || mEventFloatp || mSampleFloatp)) { // Draw the tick marks. LLGLSUIDefault gls_ui; @@ -431,7 +441,6 @@ void LLStatBar::draw() if (begin < 0) { begin = 0; - llwarns << "Min:" << min << llendl; } S32 end = (S32) ((max - mCurMinBar) * value_scale); @@ -444,90 +453,93 @@ 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) + if (num_samples) + { + F32 span = (mOrientation == HORIZONTAL) ? (bar_right - bar_left) : (bar_top - bar_bottom); - if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) - { - const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; - F32 value = 0; - S32 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.getPrevRecording(i); - - if (mCountFloatp) - { - value = mPerSec - ? recording.getPerSec(*mCountFloatp) - : recording.getSum(*mCountFloatp); - num_samples = recording.getSampleCount(*mCountFloatp); - } - else if (mEventFloatp) - { - value = recording.getMean(*mEventFloatp); - num_samples = recording.getSampleCount(*mEventFloatp); - } - else if (mSampleFloatp) - { - value = recording.getMean(*mSampleFloatp); - num_samples = recording.getSampleCount(*mSampleFloatp); - } - - if (!num_samples) continue; - - F32 begin = (value - mCurMinBar) * value_scale; - if (mOrientation == HORIZONTAL) - { - gGL.vertex2f((F32)bar_right - offset, begin + 1); - gGL.vertex2f((F32)bar_right - offset, begin); - gGL.vertex2f((F32)bar_right - offset - 1, begin); - gGL.vertex2f((F32)bar_right - offset - 1, begin + 1); - } - else - { - gGL.vertex2f(begin, (F32)bar_bottom + offset + 1); - gGL.vertex2f(begin, (F32)bar_bottom + offset); - gGL.vertex2f(begin + 1, (F32)bar_bottom + offset); - gGL.vertex2f(begin + 1, (F32)bar_bottom + offset + 1 ); - } - } - gGL.end(); - } - else - { - S32 begin = (S32) ((current - mCurMinBar) * value_scale) - 1; - S32 end = (S32) ((current - mCurMinBar) * value_scale) + 1; - // draw current - 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 - { - const S32 begin = (S32) ((mean - mCurMinBar) * value_scale) - 1; - const S32 end = (S32) ((mean - mCurMinBar) * 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)); - } - } + if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) + { + const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; + F32 value = 0; + S32 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.getPrevRecording(i); + + if (mCountFloatp) + { + value = mPerSec + ? recording.getPerSec(*mCountFloatp) + : recording.getSum(*mCountFloatp); + num_samples = recording.getSampleCount(*mCountFloatp); + } + else if (mEventFloatp) + { + value = recording.getMean(*mEventFloatp); + num_samples = recording.getSampleCount(*mEventFloatp); + } + else if (mSampleFloatp) + { + value = recording.getMean(*mSampleFloatp); + num_samples = recording.getSampleCount(*mSampleFloatp); + } + + if (!num_samples) continue; + + F32 begin = (value - mCurMinBar) * value_scale; + if (mOrientation == HORIZONTAL) + { + gGL.vertex2f((F32)bar_right - offset, begin + 1); + gGL.vertex2f((F32)bar_right - offset, begin); + gGL.vertex2f((F32)bar_right - offset - 1, begin); + gGL.vertex2f((F32)bar_right - offset - 1, begin + 1); + } + else + { + gGL.vertex2f(begin, (F32)bar_bottom + offset + 1); + gGL.vertex2f(begin, (F32)bar_bottom + offset); + gGL.vertex2f(begin + 1, (F32)bar_bottom + offset); + gGL.vertex2f(begin + 1, (F32)bar_bottom + offset + 1 ); + } + } + gGL.end(); + } + else + { + S32 begin = (S32) ((current - mCurMinBar) * value_scale) - 1; + S32 end = (S32) ((current - mCurMinBar) * value_scale) + 1; + // draw current + 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 + { + const S32 begin = (S32) ((mean - mCurMinBar) * value_scale) - 1; + const S32 end = (S32) ((mean - mCurMinBar) * 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(); -- cgit v1.2.3 From d9b8544fd437aaed14091c6642fb7da19e146b34 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Jul 2013 17:30:56 -0700 Subject: SH-4366 FIX: Interesting Viewer Crashes when opening Statistics floater --- indra/llui/llstatbar.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 7f1632b48b..d9f4a36f8d 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -150,6 +150,7 @@ LLStatBar::LLStatBar(const Params& p) mMinBar(llmin(p.bar_min, p.bar_max)), mMaxBar(llmax(p.bar_max, p.bar_min)), mCurMaxBar(p.bar_max), + mCurMinBar(0), mDecimalDigits(p.decimal_digits), mNumFrames(p.num_frames), mMaxHeight(p.max_height), -- cgit v1.2.3 From 1e8f9fd80d0ac4e0eab656ed8e8e32f91ab8b533 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 24 Jul 2013 19:36:43 -0700 Subject: SH-4376 FIX: Interesting: in Statistics, replace the text "0" with "n/a" when there are no samples during the time period. added hasValue to SampleAccumulator so we don't print a value when we don't have a single sample yet added some disabled log output for scene load timing --- indra/llui/llnotifications.h | 5 +---- indra/llui/llstatbar.cpp | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 2948f88755..f9089b8cc9 100755 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -1056,15 +1056,13 @@ class LLPersistentNotificationChannel : public LLNotificationChannel public: LLPersistentNotificationChannel() : LLNotificationChannel("Persistent", "Visible", ¬ificationFilter) - { - } + {} typedef std::vector history_list_t; history_list_t::iterator beginHistory() { sortHistory(); return mHistory.begin(); } history_list_t::iterator endHistory() { return mHistory.end(); } private: - struct sortByTime { S32 operator ()(const LLNotificationPtr& a, const LLNotificationPtr& b) @@ -1078,7 +1076,6 @@ private: std::sort(mHistory.begin(), mHistory.end(), sortByTime()); } - // The channel gets all persistent notifications except those that have been canceled static bool notificationFilter(LLNotificationPtr pNotification) { diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index d9f4a36f8d..2543bd8f0a 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -226,8 +226,7 @@ void LLStatBar::draw() max = 0, mean = 0; - - S32 num_samples = 0; + bool show_data = false; LLLocalClipRect _(getLocalRect()); LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); @@ -240,7 +239,6 @@ void LLStatBar::draw() if (mPerSec) { unit_label += "/s"; - num_samples = frame_recording.getSampleCount(*mCountFloatp, mNumFrames); current = last_frame_recording.getPerSec(*mCountFloatp); min = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames); max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); @@ -248,34 +246,41 @@ void LLStatBar::draw() } else { - num_samples = frame_recording.getSampleCount(*mCountFloatp, mNumFrames); current = last_frame_recording.getSum(*mCountFloatp); min = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); mean = frame_recording.getPeriodMean(*mCountFloatp, mNumFrames); } + + // always show count-style data + show_data = true; } else if (mEventFloatp) { LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); unit_label = mUnitLabel.empty() ? mEventFloatp->getUnitLabel() : mUnitLabel; - num_samples = frame_recording.getSampleCount(*mEventFloatp, mNumFrames); + // only show data if there is an event in the relevant time period current = last_frame_recording.getMean(*mEventFloatp); min = frame_recording.getPeriodMin(*mEventFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mEventFloatp, mNumFrames); mean = frame_recording.getPeriodMean(*mEventFloatp, mNumFrames); + + show_data = frame_recording.getSampleCount(*mEventFloatp, mNumFrames) != 0; } else if (mSampleFloatp) { + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); unit_label = mUnitLabel.empty() ? mSampleFloatp->getUnitLabel() : mUnitLabel; - num_samples = frame_recording.getSampleCount(*mSampleFloatp, mNumFrames); current = last_frame_recording.getMean(*mSampleFloatp); min = frame_recording.getPeriodMin(*mSampleFloatp, mNumFrames); max = frame_recording.getPeriodMax(*mSampleFloatp, mNumFrames); mean = frame_recording.getPeriodMean(*mSampleFloatp, mNumFrames); + + // always show sample data if we've ever grabbed any samples + show_data = mSampleFloatp->getPrimaryAccumulator()->hasValue(); } S32 bar_top, bar_left, bar_right, bar_bottom; @@ -337,7 +342,7 @@ void LLStatBar::draw() { decimal_digits = 0; } - std::string value_str = num_samples + std::string value_str = show_data ? llformat("%10.*f %s", decimal_digits, mean, unit_label.c_str()) : "n/a"; @@ -454,7 +459,7 @@ void LLStatBar::draw() gl_rect_2d(begin, bar_top, end, bar_bottom, LLColor4(1.f, 0.f, 0.f, 0.25f)); } - if (num_samples) + if (show_data) { F32 span = (mOrientation == HORIZONTAL) ? (bar_right - bar_left) -- cgit v1.2.3 From a2e22732f195dc075a733c79f15156752f522a43 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 30 Jul 2013 19:13:45 -0700 Subject: Summer cleaning - removed a lot of llcommon dependencies to speed up build times consolidated most indra-specific constants in llcommon under indra_constants.h fixed issues with operations on mixed unit types (implicit and explicit) made LL_INFOS() style macros variadic in order to subsume other logging methods such as ll_infos added optional tag output to error recorders --- indra/llui/CMakeLists.txt | 5 +- indra/llui/llbutton.cpp | 2 +- indra/llui/llchat.h | 109 ++++++++++++++++++++++++++++++++++ indra/llui/llclipboard.cpp | 1 + indra/llui/llclipboard.h | 1 - indra/llui/llctrlselectioninterface.h | 2 +- indra/llui/lldraghandle.cpp | 4 +- indra/llui/llflatlistview.cpp | 2 +- indra/llui/llfloater.cpp | 4 +- indra/llui/llfolderview.cpp | 23 ++++--- indra/llui/llfolderview.h | 1 - indra/llui/llfolderviewitem.cpp | 4 +- indra/llui/lliconctrl.h | 1 - indra/llui/llkeywords.cpp | 22 +++---- indra/llui/lllineeditor.cpp | 4 +- indra/llui/llmodaldialog.cpp | 2 +- indra/llui/llmultislider.cpp | 4 +- indra/llui/llresmgr.cpp | 27 --------- indra/llui/llscrollbar.cpp | 4 +- indra/llui/llscrollcontainer.cpp | 2 - indra/llui/llscrollcontainer.h | 1 - indra/llui/llscrolllistctrl.cpp | 2 - indra/llui/llscrolllistctrl.h | 1 - indra/llui/llslider.cpp | 4 +- indra/llui/llstatbar.cpp | 58 ++++++++---------- indra/llui/llstatbar.h | 12 ++-- indra/llui/lltexteditor.cpp | 2 +- indra/llui/lltexteditor.h | 2 - indra/llui/llui.h | 46 ++++++++++++++ indra/llui/lluistring.h | 6 +- indra/llui/llurlentry.h | 1 + indra/llui/llview.h | 2 +- indra/llui/llviewmodel.h | 2 +- 33 files changed, 237 insertions(+), 126 deletions(-) create mode 100755 indra/llui/llchat.h (limited to 'indra/llui') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index c4270a62bd..b3864b3711 100755 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -142,6 +142,7 @@ set(llui_HEADER_FILES llbutton.h llcallbackmap.h llchatentry.h + llchat.h llcheckboxctrl.h llclipboard.h llcombobox.h @@ -281,7 +282,9 @@ if(LL_TESTS) include(LLAddBuildTest) SET(llui_TEST_SOURCE_FILES llurlmatch.cpp - llurlentry.cpp ) LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}") + # INTEGRATION TESTS + set(test_libs llui llmessage llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES}) + LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") endif(LL_TESTS) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index ce4d137478..ed12f686a1 100755 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -591,7 +591,7 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) // We only handle the click if the click both started and ended within us getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << llendl; } return TRUE; } diff --git a/indra/llui/llchat.h b/indra/llui/llchat.h new file mode 100755 index 0000000000..f5b242fdfc --- /dev/null +++ b/indra/llui/llchat.h @@ -0,0 +1,109 @@ +/** + * @file llchat.h + * @author James Cook + * @brief Chat constants and data structures. + * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLCHAT_H +#define LL_LLCHAT_H + +#include "lluuid.h" +#include "v3math.h" + +// enumerations used by the chat system +typedef enum e_chat_source_type +{ + CHAT_SOURCE_SYSTEM = 0, + CHAT_SOURCE_AGENT = 1, + CHAT_SOURCE_OBJECT = 2, + CHAT_SOURCE_UNKNOWN = 3 +} EChatSourceType; + +typedef enum e_chat_type +{ + CHAT_TYPE_WHISPER = 0, + CHAT_TYPE_NORMAL = 1, + CHAT_TYPE_SHOUT = 2, + CHAT_TYPE_START = 4, + CHAT_TYPE_STOP = 5, + CHAT_TYPE_DEBUG_MSG = 6, + CHAT_TYPE_REGION = 7, + CHAT_TYPE_OWNER = 8, + CHAT_TYPE_DIRECT = 9 // From llRegionSayTo() +} EChatType; + +typedef enum e_chat_audible_level +{ + CHAT_AUDIBLE_NOT = -1, + CHAT_AUDIBLE_BARELY = 0, + CHAT_AUDIBLE_FULLY = 1 +} EChatAudible; + +typedef enum e_chat_style +{ + CHAT_STYLE_NORMAL, + CHAT_STYLE_IRC, + CHAT_STYLE_HISTORY +}EChatStyle; + +// A piece of chat +class LLChat +{ +public: + LLChat(const std::string& text = std::string()) + : mText(text), + mFromName(), + mFromID(), + mNotifId(), + mOwnerID(), + mSourceType(CHAT_SOURCE_AGENT), + mChatType(CHAT_TYPE_NORMAL), + mAudible(CHAT_AUDIBLE_FULLY), + mMuted(FALSE), + mTime(0.0), + mTimeStr(), + mPosAgent(), + mURL(), + mChatStyle(CHAT_STYLE_NORMAL), + mSessionID() + { } + + std::string mText; // UTF-8 line of text + std::string mFromName; // agent or object name + LLUUID mFromID; // agent id or object id + LLUUID mNotifId; + LLUUID mOwnerID; + EChatSourceType mSourceType; + EChatType mChatType; + EChatAudible mAudible; + BOOL mMuted; // pass muted chat to maintain list of chatters + F64 mTime; // viewer only, seconds from viewer start + std::string mTimeStr; + LLVector3 mPosAgent; + std::string mURL; + EChatStyle mChatStyle; + LLUUID mSessionID; +}; + +#endif diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 14173fdbb0..1d18cb2bb0 100755 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -88,6 +88,7 @@ bool LLClipboard::pasteFromClipboard(std::vector& inv_objects) const { bool res = false; S32 count = mObjects.size(); + inv_objects.reserve(inv_objects.size() + count); if (count > 0) { res = true; diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h index fd2e7610df..58d80e2687 100755 --- a/indra/llui/llclipboard.h +++ b/indra/llui/llclipboard.h @@ -31,7 +31,6 @@ #include "llstring.h" #include "lluuid.h" -#include "stdenums.h" #include "llsingleton.h" #include "llassettype.h" #include "llinventory.h" diff --git a/indra/llui/llctrlselectioninterface.h b/indra/llui/llctrlselectioninterface.h index 2cdcbd88fe..a7b089c8f9 100755 --- a/indra/llui/llctrlselectioninterface.h +++ b/indra/llui/llctrlselectioninterface.h @@ -28,8 +28,8 @@ #define LLCTRLSELECTIONINTERFACE_H #include "stdtypes.h" -#include "stdenums.h" #include "llstring.h" +#include "llui.h" class LLSD; class LLUUID; diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 5f69c6af31..a36bc4743e 100755 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -365,13 +365,13 @@ BOOL LLDragHandle::handleHover(S32 x, S32 y, MASK mask) mDragLastScreenY += delta_y; getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" <setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; handled = TRUE; } diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 97a52fada4..43c22f8bf3 100755 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -520,7 +520,7 @@ void LLFlatListView::onItemMouseClick(item_pair_t* item_pair, MASK mask) if (!item_pair->first) { - llwarning("Attempt to selet an item pair containing null panel item", 0); + LL_WARNS() << "Attempt to selet an item pair containing null panel item" << LL_ENDL; return; } diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d06e2c9334..11802904e4 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -653,7 +653,7 @@ void LLFloater::onVisibilityChange ( BOOL new_visibility ) void LLFloater::openFloater(const LLSD& key) { - llinfos << "Opening floater " << getName() << llendl; + LL_INFOS() << "Opening floater " << getName() << LL_ENDL; mKey = key; // in case we need to open ourselves again if (getSoundFlags() != SILENT @@ -706,7 +706,7 @@ void LLFloater::openFloater(const LLSD& key) void LLFloater::closeFloater(bool app_quitting) { - llinfos << "Closing floater " << getName() << llendl; + LL_INFOS() << "Closing floater " << getName() << LL_ENDL; if (app_quitting) { LLFloater::sQuitting = true; diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 8aa1eb7cd5..5628baa4a1 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -255,8 +255,6 @@ LLFolderView::~LLFolderView( void ) mRenamer = NULL; mStatusTextBox = NULL; - mAutoOpenItems.removeAllNodes(); - if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die(); mAutoOpenItems.removeAllNodes(); @@ -736,7 +734,7 @@ void LLFolderView::removeSelectedItems() } else { - llinfos << "Cannot delete " << item->getName() << llendl; + LL_INFOS() << "Cannot delete " << item->getName() << LL_ENDL; return; } } @@ -762,20 +760,21 @@ void LLFolderView::removeSelectedItems() } else if (count > 1) { - LLDynamicArray listeners; + std::vector listeners; LLFolderViewModelItem* listener; setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel->hasFocus()); + listeners.reserve(count); for(S32 i = 0; i < count; ++i) { listener = items[i]->getViewModelItem(); - if(listener && (listeners.find(listener) == LLDynamicArray::FAIL)) + if(listener && (std::find(listeners.begin(), listeners.end(), listener) == listeners.end())) { - listeners.put(listener); + listeners.push_back(listener); } } - listener = static_cast(listeners.get(0)); + listener = static_cast(listeners.at(0)); if(listener) { listener->removeBatch(listeners); @@ -1282,7 +1281,7 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char) if (uni_char > 0x7f) { - llwarns << "LLFolderView::handleUnicodeCharHere - Don't handle non-ascii yet, aborting" << llendl; + LL_WARNS() << "LLFolderView::handleUnicodeCharHere - Don't handle non-ascii yet, aborting" << LL_ENDL; return FALSE; } @@ -1744,14 +1743,14 @@ void LLFolderView::update() void LLFolderView::dumpSelectionInformation() { - llinfos << "LLFolderView::dumpSelectionInformation()" << llendl; - llinfos << "****************************************" << llendl; + LL_INFOS() << "LLFolderView::dumpSelectionInformation()" << LL_NEWLINE + << "****************************************" << LL_ENDL; selected_items_t::iterator item_it; for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) { - llinfos << " " << (*item_it)->getName() << llendl; + LL_INFOS() << " " << (*item_it)->getName() << LL_ENDL; } - llinfos << "****************************************" << llendl; + LL_INFOS() << "****************************************" << LL_ENDL; } void LLFolderView::updateRenamerPosition() diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 11fccdace4..652e22c7bc 100755 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -39,7 +39,6 @@ #include "lluictrl.h" #include "v4color.h" -#include "stdenums.h" #include "lldepthstack.h" #include "lleditmenuhandler.h" #include "llfontgl.h" diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index c7910cb883..b5ac7db4e7 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -636,7 +636,7 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, } if (handled) { - lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFolderViewItem" << llendl; + LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFolderViewItem" << llendl; } return handled; @@ -1753,7 +1753,7 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask, { handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); - lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFolderViewFolder" << llendl; + LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFolderViewFolder" << llendl; } return TRUE; diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index efa0925a4a..a19bb99d9d 100755 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -31,7 +31,6 @@ #include "v4color.h" #include "lluictrl.h" #include "lluiimage.h" -#include "stdenums.h" class LLTextBox; class LLUICtrlFactory; diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 795dacdbb0..0d232cc2cf 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -94,7 +94,7 @@ BOOL LLKeywords::loadFromFile( const std::string& filename ) file.open(filename); /* Flawfinder: ignore */ if( file.fail() ) { - llinfos << "LLKeywords::loadFromFile() Unable to open file: " << filename << llendl; + LL_INFOS() << "LLKeywords::loadFromFile() Unable to open file: " << filename << LL_ENDL; return mLoaded; } @@ -102,7 +102,7 @@ BOOL LLKeywords::loadFromFile( const std::string& filename ) file >> buffer; if( strcmp( buffer, "llkeywords" ) ) { - llinfos << filename << " does not appear to be a keyword file" << llendl; + LL_INFOS() << filename << " does not appear to be a keyword file" << LL_ENDL; return mLoaded; } @@ -112,7 +112,7 @@ BOOL LLKeywords::loadFromFile( const std::string& filename ) file >> version_num; if( strcmp(buffer, "version") || version_num != (U32)KEYWORD_FILE_CURRENT_VERSION ) { - llinfos << filename << " does not appear to be a version " << KEYWORD_FILE_CURRENT_VERSION << " keyword file" << llendl; + LL_INFOS() << filename << " does not appear to be a version " << KEYWORD_FILE_CURRENT_VERSION << " keyword file" << LL_ENDL; return mLoaded; } @@ -342,7 +342,7 @@ LLColor3 LLKeywords::readColor( const std::string& s ) S32 values_read = sscanf(s.c_str(), "%f, %f, %f]", &r, &g, &b ); if( values_read != 3 ) { - llinfos << " poorly formed color in keyword file" << llendl; + LL_INFOS() << " poorly formed color in keyword file" << LL_ENDL; } return LLColor3( r, g, b ); } @@ -553,7 +553,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW S32 seg_start = cur - base; S32 seg_end = seg_start + seg_len; - // llinfos << "Seg: [" << word.c_str() << "]" << llendl; + // LL_INFOS() << "Seg: [" << word.c_str() << "]" << LL_ENDL; insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, defaultColor, editor); } @@ -620,10 +620,10 @@ void LLKeywords::insertSegment(std::vector& seg_list, LLTextSe #ifdef _DEBUG void LLKeywords::dump() { - llinfos << "LLKeywords" << llendl; + LL_INFOS() << "LLKeywords" << LL_ENDL; - llinfos << "LLKeywords::sWordTokenMap" << llendl; + LL_INFOS() << "LLKeywords::sWordTokenMap" << LL_ENDL; word_token_map_t::iterator word_token_iter = mWordTokenMap.begin(); while( word_token_iter != mWordTokenMap.end() ) { @@ -632,7 +632,7 @@ void LLKeywords::dump() ++word_token_iter; } - llinfos << "LLKeywords::sLineTokenList" << llendl; + LL_INFOS() << "LLKeywords::sLineTokenList" << LL_ENDL; for (token_list_t::iterator iter = mLineTokenList.begin(); iter != mLineTokenList.end(); ++iter) { @@ -641,7 +641,7 @@ void LLKeywords::dump() } - llinfos << "LLKeywords::sDelimiterTokenList" << llendl; + LL_INFOS() << "LLKeywords::sDelimiterTokenList" << LL_ENDL; for (token_list_t::iterator iter = mDelimiterTokenList.begin(); iter != mDelimiterTokenList.end(); ++iter) { @@ -652,12 +652,12 @@ void LLKeywords::dump() void LLKeywordToken::dump() { - llinfos << "[" << + LL_INFOS() << "[" << mColor.mV[VX] << ", " << mColor.mV[VY] << ", " << mColor.mV[VZ] << "] [" << wstring_to_utf8str(mToken) << "]" << - llendl; + LL_ENDL; } #endif // DEBUG diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 5478e85e13..f2e9843bf3 100755 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -855,14 +855,14 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) mKeystrokeTimer.reset(); getWindow()->setCursor(UI_CURSOR_IBEAM); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; handled = TRUE; } if( !handled ) { getWindow()->setCursor(UI_CURSOR_IBEAM); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; handled = TRUE; } diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 8c2be44904..8aefef07e2 100755 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -181,7 +181,7 @@ BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask) if( childrenHandleHover(x, y, mask) == NULL ) { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << llendl; } return TRUE; } diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index 70bcfb5b4f..17d07f4dae 100755 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -356,12 +356,12 @@ BOOL LLMultiSlider::handleHover(S32 x, S32 y, MASK mask) onCommit(); getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; } else { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; } return TRUE; } diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 820e7cb26a..7488af2e05 100755 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -45,33 +45,6 @@ LLResMgr::LLResMgr() void LLResMgr::setLocale( LLLOCALE_ID locale_id ) { mLocale = locale_id; - - //RN: for now, use normal 'C' locale for everything but specific UI input/output routines -// switch( locale_id ) -// { -// case LLLOCALE_USA: -//#if LL_WINDOWS -// // Windows doesn't use ISO country codes. -// llinfos << "Setting locale to " << setlocale( LC_ALL, "english-usa" ) << llendl; -//#else -// // posix version should work everywhere else. -// llinfos << "Setting locale to " << setlocale( LC_ALL, "en_US" ) << llendl; -//#endif -// break; -// case LLLOCALE_UK: -//#if LL_WINDOWS -// // Windows doesn't use ISO country codes. -// llinfos << "Setting locale to " << setlocale( LC_ALL, "english-uk" ) << llendl; -//#else -// // posix version should work everywhere else. -// llinfos << "Setting locale to " << setlocale( LC_ALL, "en_GB" ) << llendl; -//#endif -// break; -// default: -// llassert(0); -// setLocale(LLLOCALE_USA); -// break; -// } } char LLResMgr::getDecimalPoint() const diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index bef1854748..f92e8f41ea 100755 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -381,7 +381,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) } getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; handled = TRUE; } else @@ -393,7 +393,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) if( !handled ) { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; handled = TRUE; } diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 3b5fb2adfb..93eea75952 100755 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -155,7 +155,6 @@ LLScrollContainer::~LLScrollContainer( void ) // virtual void LLScrollContainer::scrollHorizontal( S32 new_pos ) { - //llinfos << "LLScrollContainer::scrollHorizontal()" << llendl; if( mScrolledView ) { LLRect doc_rect = mScrolledView->getRect(); @@ -167,7 +166,6 @@ void LLScrollContainer::scrollHorizontal( S32 new_pos ) // virtual void LLScrollContainer::scrollVertical( S32 new_pos ) { - // llinfos << "LLScrollContainer::scrollVertical() " << new_pos << llendl; if( mScrolledView ) { LLRect doc_rect = mScrolledView->getRect(); diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index b67236c939..f64cf43a8e 100755 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -31,7 +31,6 @@ #ifndef LL_V4COLOR_H #include "v4color.h" #endif -#include "stdenums.h" #include "llcoord.h" #include "llscrollbar.h" diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 7f04c92b27..f335b5dec3 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1464,8 +1464,6 @@ void LLScrollListCtrl::drawItems() mLineHeight ); item->setRect(item_rect); - //llinfos << item_rect.getWidth() << llendl; - max_columns = llmax(max_columns, item->getNumColumns()); LLColor4 fg_color; diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 8fa06cc499..40a49074c1 100755 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -34,7 +34,6 @@ #include "lluictrl.h" #include "llctrlselectioninterface.h" -//#include "lldarray.h" #include "llfontgl.h" #include "llui.h" #include "llstring.h" // LLWString diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp index db72234f94..ddddbe6f30 100755 --- a/indra/llui/llslider.cpp +++ b/indra/llui/llslider.cpp @@ -188,12 +188,12 @@ BOOL LLSlider::handleHover(S32 x, S32 y, MASK mask) setValueAndCommit(t * (mMaxValue - mMinValue) + mMinValue ); } getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; } else { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; } return TRUE; } diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 2543bd8f0a..1af36c6fdb 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -152,9 +152,9 @@ LLStatBar::LLStatBar(const Params& p) mCurMaxBar(p.bar_max), mCurMinBar(0), mDecimalDigits(p.decimal_digits), - mNumFrames(p.num_frames), + mNumHistoryFrames(p.num_frames), + mNumShortHistoryFrames(p.num_frames_short), mMaxHeight(p.max_height), - mPerSec(p.show_per_sec), mDisplayBar(p.show_bar), mDisplayHistory(p.show_history), mOrientation(p.orientation), @@ -221,36 +221,28 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) void LLStatBar::draw() { - F32 current = 0, - min = 0, - max = 0, - mean = 0; + F32 current = 0, + min = 0, + max = 0, + mean = 0; bool show_data = false; LLLocalClipRect _(getLocalRect()); LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); + S32 num_frames = mDisplayHistory ? mNumHistoryFrames : mNumShortHistoryFrames; + std::string unit_label; if (mCountFloatp) { LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); unit_label = mUnitLabel.empty() ? mCountFloatp->getUnitLabel() : mUnitLabel; - if (mPerSec) - { - unit_label += "/s"; - current = last_frame_recording.getPerSec(*mCountFloatp); - min = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames); - max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); - mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp, mNumFrames); - } - else - { - current = last_frame_recording.getSum(*mCountFloatp); - min = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames); - max = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); - mean = frame_recording.getPeriodMean(*mCountFloatp, mNumFrames); - } + unit_label += "/s"; + current = last_frame_recording.getPerSec(*mCountFloatp); + min = frame_recording.getPeriodMinPerSec(*mCountFloatp, num_frames); + max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, num_frames); + mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp, num_frames); // always show count-style data show_data = true; @@ -262,11 +254,11 @@ void LLStatBar::draw() // only show data if there is an event in the relevant time period current = last_frame_recording.getMean(*mEventFloatp); - min = frame_recording.getPeriodMin(*mEventFloatp, mNumFrames); - max = frame_recording.getPeriodMax(*mEventFloatp, mNumFrames); - mean = frame_recording.getPeriodMean(*mEventFloatp, mNumFrames); - - show_data = frame_recording.getSampleCount(*mEventFloatp, mNumFrames) != 0; + min = frame_recording.getPeriodMin(*mEventFloatp, num_frames); + max = frame_recording.getPeriodMax(*mEventFloatp, num_frames); + mean = frame_recording.getPeriodMean(*mEventFloatp, num_frames); + + show_data = frame_recording.getSampleCount(*mEventFloatp, num_frames) != 0; } else if (mSampleFloatp) { @@ -275,9 +267,9 @@ void LLStatBar::draw() unit_label = mUnitLabel.empty() ? mSampleFloatp->getUnitLabel() : mUnitLabel; current = last_frame_recording.getMean(*mSampleFloatp); - min = frame_recording.getPeriodMin(*mSampleFloatp, mNumFrames); - max = frame_recording.getPeriodMax(*mSampleFloatp, mNumFrames); - mean = frame_recording.getPeriodMean(*mSampleFloatp, mNumFrames); + min = frame_recording.getPeriodMin(*mSampleFloatp, num_frames); + max = frame_recording.getPeriodMax(*mSampleFloatp, num_frames); + mean = frame_recording.getPeriodMean(*mSampleFloatp, num_frames); // always show sample data if we've ever grabbed any samples show_data = mSampleFloatp->getPrimaryAccumulator()->hasValue(); @@ -472,18 +464,16 @@ void LLStatBar::draw() S32 i; gGL.color4f( 1.f, 0.f, 0.f, 1.f ); gGL.begin( LLRender::QUADS ); - const S32 max_frame = llmin(mNumFrames, num_values); + const S32 max_frame = llmin(num_frames, num_values); U32 num_samples = 0; for (i = 1; i <= max_frame; i++) { - F32 offset = ((F32)i / (F32)mNumFrames) * span; + F32 offset = ((F32)i / (F32)num_frames) * span; LLTrace::Recording& recording = frame_recording.getPrevRecording(i); if (mCountFloatp) { - value = mPerSec - ? recording.getPerSec(*mCountFloatp) - : recording.getSum(*mCountFloatp); + value = recording.getPerSec(*mCountFloatp); num_samples = recording.getSampleCount(*mCountFloatp); } else if (mEventFloatp) diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index fc925b1a74..5aed98fecf 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -46,12 +46,12 @@ public: Optional decimal_digits; - Optional show_per_sec, - show_bar, + Optional show_bar, show_history, scale_range; Optional num_frames, + num_frames_short, max_height; Optional stat; Optional orientation; @@ -63,11 +63,11 @@ public: bar_max("bar_max", 0.f), tick_spacing("tick_spacing", 0.f), decimal_digits("decimal_digits", 3), - show_per_sec("show_per_sec", true), show_bar("show_bar", false), show_history("show_history", false), scale_range("scale_range", true), num_frames("num_frames", 200), + num_frames_short("num_frames_short", 20), max_height("max_height", 100), stat("stat"), orientation("orientation", VERTICAL) @@ -96,10 +96,10 @@ private: mLabelSpacing; F32 mTickValue; U32 mDecimalDigits; - S32 mNumFrames; + S32 mNumHistoryFrames, + mNumShortHistoryFrames; S32 mMaxHeight; - bool mPerSec, // Use the per sec stats. - mDisplayBar, // Display the bar graph. + bool mDisplayBar, // Display the bar graph. mDisplayHistory, mAutoScaleMax, mAutoScaleMin; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 834f213097..eb5a04d8e5 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -781,7 +781,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) setCursorAtLocalPos( clamped_x, clamped_y, true ); mSelectionEnd = mCursorPos; } - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; getWindow()->setCursor(UI_CURSOR_IBEAM); handled = TRUE; } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 969e072704..49b6980c81 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -32,10 +32,8 @@ #include "llrect.h" #include "llkeywords.h" #include "llframetimer.h" -#include "lldarray.h" #include "llstyle.h" #include "lleditmenuhandler.h" -#include "lldarray.h" #include "llviewborder.h" // for params #include "lltextbase.h" #include "lltextvalidate.h" diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 4ebfd0fd6e..f3ed3fcb49 100755 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -55,6 +55,52 @@ class LLWindow; class LLView; class LLHelp; + +// this enum is used by the llview.h (viewer) and the llassetstorage.h (viewer and sim) +enum EDragAndDropType +{ + DAD_NONE = 0, + DAD_TEXTURE = 1, + DAD_SOUND = 2, + DAD_CALLINGCARD = 3, + DAD_LANDMARK = 4, + DAD_SCRIPT = 5, + DAD_CLOTHING = 6, + DAD_OBJECT = 7, + DAD_NOTECARD = 8, + DAD_CATEGORY = 9, + DAD_ROOT_CATEGORY = 10, + DAD_BODYPART = 11, + DAD_ANIMATION = 12, + DAD_GESTURE = 13, + DAD_LINK = 14, + DAD_MESH = 15, + DAD_WIDGET = 16, + DAD_PERSON = 17, + DAD_COUNT = 18, // number of types in this enum +}; + +// Reasons for drags to be denied. +// ordered by priority for multi-drag +enum EAcceptance +{ + ACCEPT_POSTPONED, // we are asynchronously determining acceptance + ACCEPT_NO, // Uninformative, general purpose denial. + ACCEPT_NO_LOCKED, // Operation would be valid, but permissions are set to disallow it. + ACCEPT_YES_COPY_SINGLE, // We'll take a copy of a single item + ACCEPT_YES_SINGLE, // Accepted. OK to drag and drop single item here. + ACCEPT_YES_COPY_MULTI, // We'll take a copy of multiple items + ACCEPT_YES_MULTI // Accepted. OK to drag and drop multiple items here. +}; + +enum EAddPosition +{ + ADD_TOP, + ADD_BOTTOM, + ADD_DEFAULT +}; + + void make_ui_sound(const char* name); void make_ui_sound_deferred(const char * name); diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index cb40c85582..07e02de6d8 100755 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -42,12 +42,12 @@ // LLUIString mMessage("Welcome [USERNAME] to [SECONDLIFE]!"); // mMessage.setArg("[USERNAME]", "Steve"); // mMessage.setArg("[SECONDLIFE]", "Second Life"); -// llinfos << mMessage.getString() << llendl; // outputs "Welcome Steve to Second Life" +// LL_INFOS() << mMessage.getString() << LL_ENDL; // outputs "Welcome Steve to Second Life" // mMessage.setArg("[USERNAME]", "Joe"); -// llinfos << mMessage.getString() << llendl; // outputs "Welcome Joe to Second Life" +// LL_INFOS() << mMessage.getString() << LL_ENDL; // outputs "Welcome Joe to Second Life" // mMessage = "Bienvenido a la [SECONDLIFE] [USERNAME]" // mMessage.setArg("[SECONDLIFE]", "Segunda Vida"); -// llinfos << mMessage.getString() << llendl; // outputs "Bienvenido a la Segunda Vida Joe" +// LL_INFOS() << mMessage.getString() << LL_ENDL; // outputs "Bienvenido a la Segunda Vida Joe" // Implementation Notes: // Attempting to have operator[](const std::string& s) return mArgs[s] fails because we have diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 8c6c32178a..d4684e2e1e 100755 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -32,6 +32,7 @@ #include "lluicolor.h" #include "llstyle.h" +#include "llavatarname.h" #include "llhost.h" // for resolving parcel name by parcel id #include diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 0568fa889a..cd23ce7df1 100755 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -42,7 +42,6 @@ #include "llui.h" #include "lluistring.h" #include "llviewquery.h" -#include "stdenums.h" #include "lluistring.h" #include "llcursortypes.h" #include "lluictrlfactory.h" @@ -67,6 +66,7 @@ const BOOL NOT_MOUSE_OPAQUE = FALSE; const U32 GL_NAME_UI_RESERVED = 2; + // maintains render state during traversal of UI tree class LLViewDrawContext { diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index 2c016d2560..a0a13267ac 100755 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -37,9 +37,9 @@ #include "llpointer.h" #include "llsd.h" #include "llrefcount.h" -#include "stdenums.h" #include "llstring.h" #include "lltrace.h" +#include "llui.h" #include class LLScrollListItem; -- cgit v1.2.3 From f58eb60b1e0bbdf2148255c61100cbc20d1ba1b0 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Aug 2013 08:17:21 -0700 Subject: SH-4374 WIP Interesting: Statistics Object cache hit rate is always 100% --- indra/llui/llstatbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 1af36c6fdb..ee73cfa40d 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -272,7 +272,7 @@ void LLStatBar::draw() mean = frame_recording.getPeriodMean(*mSampleFloatp, num_frames); // always show sample data if we've ever grabbed any samples - show_data = mSampleFloatp->getPrimaryAccumulator()->hasValue(); + show_data = last_frame_recording.hasValue(*mSampleFloatp); } S32 bar_top, bar_left, bar_right, bar_bottom; -- cgit v1.2.3 From 8d3daa141e9ea14f533559843d77ab5c0f715421 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 16:14:19 -0700 Subject: SH-4374 FIX Interesting: Statistics Object cache hit rate is always 100% moved object cache sampling code so that it actually gets executed default values for stats are NaN instead of 0 in many cases --- indra/llui/lllayoutstack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 5930741d5c..dbc4999678 100755 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -62,7 +62,7 @@ public: /*virtual*/ void draw(); /*virtual*/ void removeChild(LLView*); /*virtual*/ BOOL postBuild(); - /*virtual*/ bool addChild(LLView* child, S32 tab_groupdatefractuiona = 0); + /*virtual*/ bool addChild(LLView* child, S32 tab_group = 0); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/llui/llaccordionctrl.cpp | 4 ++-- indra/llui/llbadge.cpp | 4 ++-- indra/llui/llbutton.cpp | 8 ++++---- indra/llui/llcommandmanager.cpp | 6 +++--- indra/llui/llcontainerview.cpp | 2 +- indra/llui/lldraghandle.cpp | 4 ++-- indra/llui/llflatlistview.cpp | 2 +- indra/llui/llfloater.cpp | 14 +++++++------- indra/llui/llfloaterreg.cpp | 8 ++++---- indra/llui/llfocusmgr.cpp | 4 ++-- indra/llui/llfolderviewitem.cpp | 4 ++-- indra/llui/llfunctorregistry.h | 8 ++++---- indra/llui/lllineeditor.cpp | 12 ++++++------ indra/llui/llmenubutton.cpp | 2 +- indra/llui/llmenugl.cpp | 16 ++++++++-------- indra/llui/llmodaldialog.cpp | 8 ++++---- indra/llui/llmultifloater.cpp | 2 +- indra/llui/llmultislider.cpp | 6 +++--- indra/llui/llmultisliderctrl.cpp | 2 +- indra/llui/llnotifications.cpp | 38 ++++++++++++++++++------------------- indra/llui/llpanel.cpp | 18 +++++++++--------- indra/llui/llradiogroup.cpp | 4 ++-- indra/llui/llresmgr.cpp | 2 +- indra/llui/llscrollbar.cpp | 4 ++-- indra/llui/llscrollcontainer.cpp | 2 +- indra/llui/llscrollingpanellist.cpp | 2 +- indra/llui/llscrolllistitem.cpp | 2 +- indra/llui/llslider.cpp | 4 ++-- indra/llui/llsliderctrl.cpp | 2 +- indra/llui/llspinctrl.cpp | 4 ++-- indra/llui/lltabcontainer.cpp | 2 +- indra/llui/lltextbase.cpp | 20 +++++++++---------- indra/llui/lltexteditor.cpp | 22 ++++++++++----------- indra/llui/lltextparser.cpp | 2 +- indra/llui/lltoolbar.cpp | 4 ++-- indra/llui/lltooltip.cpp | 2 +- indra/llui/lltrans.cpp | 12 ++++++------ indra/llui/lltransutil.cpp | 4 ++-- indra/llui/llui.cpp | 10 +++++----- indra/llui/llui.h | 6 +++--- indra/llui/lluicolortable.cpp | 10 +++++----- indra/llui/lluictrl.cpp | 6 +++--- indra/llui/lluictrlfactory.cpp | 4 ++-- indra/llui/lluictrlfactory.h | 6 +++--- indra/llui/llundo.cpp | 2 +- indra/llui/llurlentry.cpp | 4 ++-- indra/llui/llview.cpp | 28 +++++++++++++-------------- indra/llui/llview.h | 6 +++--- 48 files changed, 174 insertions(+), 174 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index d636161baf..b787794b95 100755 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -69,7 +69,7 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) mSingleExpansion = params.single_expansion; if(mFitParent && !mSingleExpansion) { - llinfos << "fit_parent works best when combined with single_expansion" << llendl; + LL_INFOS() << "fit_parent works best when combined with single_expansion" << LL_ENDL; } } @@ -845,7 +845,7 @@ void LLAccordionCtrl::sort() { if (!mTabComparator) { - llwarns << "No comparator specified for sorting accordion tabs." << llendl; + LL_WARNS() << "No comparator specified for sorting accordion tabs." << LL_ENDL; return; } diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index 8ede4e3468..30cb18812b 100755 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -105,7 +105,7 @@ LLBadge::LLBadge(const LLBadge::Params& p) { if (mImage.isNull()) { - llwarns << "Badge: " << getName() << " with no image!" << llendl; + LL_WARNS() << "Badge: " << getName() << " with no image!" << LL_ENDL; } if (p.location_offset_hcenter.isProvided()) @@ -335,7 +335,7 @@ void LLBadge::draw() } else { - lldebugs << "No image for badge " << getName() << " on owner " << owner_view->getName() << llendl; + LL_DEBUGS() << "No image for badge " << getName() << " on owner " << owner_view->getName() << LL_ENDL; renderBadgeBackground(badge_center_x, badge_center_y, badge_width, badge_height, diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index ed12f686a1..913793803c 100755 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -252,7 +252,7 @@ LLButton::LLButton(const LLButton::Params& p) if (mImageUnselected.isNull()) { - llwarns << "Button: " << getName() << " with no image!" << llendl; + LL_WARNS() << "Button: " << getName() << " with no image!" << LL_ENDL; } if (p.click_callback.isProvided()) @@ -591,7 +591,7 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) // We only handle the click if the click both started and ended within us getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL; } return TRUE; } @@ -816,7 +816,7 @@ void LLButton::draw() else { // no image - lldebugs << "No image for button " << getName() << llendl; + LL_DEBUGS() << "No image for button " << getName() << LL_ENDL; // draw it in pink so we can find it gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4::pink1 % alpha, FALSE); } @@ -1039,7 +1039,7 @@ void LLButton::setImageUnselected(LLPointer image) mImageUnselected = image; if (mImageUnselected.isNull()) { - llwarns << "Setting default button image for: " << getName() << " to NULL" << llendl; + LL_WARNS() << "Setting default button image for: " << getName() << " to NULL" << LL_ENDL; } } diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 625fb8e870..74ef8dd0c3 100755 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -137,7 +137,7 @@ void LLCommandManager::addCommand(LLCommand * command) mCommandIndices[command_id.uuid()] = mCommands.size(); mCommands.push_back(command); - lldebugs << "Successfully added command: " << command->name() << llendl; + LL_DEBUGS() << "Successfully added command: " << command->name() << LL_ENDL; } //static @@ -153,13 +153,13 @@ bool LLCommandManager::load() if (!parser.readXUI(commands_file, commandsParams)) { - llerrs << "Unable to load xml file: " << commands_file << llendl; + LL_ERRS() << "Unable to load xml file: " << commands_file << LL_ENDL; return false; } if (!commandsParams.validateBlock()) { - llerrs << "Invalid commands file: " << commands_file << llendl; + LL_ERRS() << "Invalid commands file: " << commands_file << LL_ENDL; return false; } diff --git a/indra/llui/llcontainerview.cpp b/indra/llui/llcontainerview.cpp index 6b1e3ce669..727fbe850e 100755 --- a/indra/llui/llcontainerview.cpp +++ b/indra/llui/llcontainerview.cpp @@ -188,7 +188,7 @@ void LLContainerView::arrange(S32 width, S32 height, BOOL called_from_parent) LLView *childp = *child_iter; if (!childp->getVisible()) { - llwarns << "Incorrect visibility!" << llendl; + LL_WARNS() << "Incorrect visibility!" << LL_ENDL; } LLRect child_rect = childp->getRequiredRect(); child_height += child_rect.getHeight(); diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index a36bc4743e..b7f67f8556 100755 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -365,13 +365,13 @@ BOOL LLDragHandle::handleHover(S32 x, S32 y, MASK mask) mDragLastScreenY += delta_y; getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" <setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; handled = TRUE; } diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 43c22f8bf3..299f5e42d4 100755 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -347,7 +347,7 @@ void LLFlatListView::sort() { if (!mItemComparator) { - llwarns << "No comparator specified for sorting FlatListView items." << llendl; + LL_WARNS() << "No comparator specified for sorting FlatListView items." << LL_ENDL; return; } diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 11802904e4..7d0779d88d 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -133,7 +133,7 @@ bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b) { if (a.type() != b.type()) { - //llerrs << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << llendl; + //LL_ERRS() << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << LL_ENDL; return false; } else if (a.isUndefined()) @@ -1102,7 +1102,7 @@ BOOL LLFloater::canSnapTo(const LLView* other_view) { if (NULL == other_view) { - llwarns << "other_view is NULL" << llendl; + LL_WARNS() << "other_view is NULL" << LL_ENDL; return FALSE; } @@ -3158,7 +3158,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str LLFastTimer _(FTM_EXTERNAL_FLOATER_LOAD); if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml)) { - llwarns << "Couldn't parse panel from: " << xml_filename << llendl; + LL_WARNS() << "Couldn't parse panel from: " << xml_filename << LL_ENDL; return FALSE; } @@ -3239,7 +3239,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str if (!result) { - llerrs << "Failed to construct floater " << getName() << llendl; + LL_ERRS() << "Failed to construct floater " << getName() << LL_ENDL; } applyRectControl(); // If we have a saved rect control, apply it @@ -3284,20 +3284,20 @@ bool LLFloater::buildFromFile(const std::string& filename) if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) { - llwarns << "Couldn't find (or parse) floater from: " << filename << llendl; + LL_WARNS() << "Couldn't find (or parse) floater from: " << filename << LL_ENDL; return false; } // root must be called floater if( !(root->hasName("floater") || root->hasName("multi_floater")) ) { - llwarns << "Root node should be named floater in: " << filename << llendl; + LL_WARNS() << "Root node should be named floater in: " << filename << LL_ENDL; return false; } bool res = true; - lldebugs << "Building floater " << filename << llendl; + LL_DEBUGS() << "Building floater " << filename << LL_ENDL; LLUICtrlFactory::instance().pushFileName(filename); { if (!getFactoryMap().empty()) diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 1cdddf0d5b..072addfa4a 100755 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -151,13 +151,13 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) res = build_func(key); if (!res) { - llwarns << "Failed to build floater type: '" << name << "'." << llendl; + LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL; return NULL; } bool success = res->buildFromFile(xui_file); if (!success) { - llwarns << "Failed to build floater type: '" << name << "'." << llendl; + LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL; return NULL; } @@ -179,7 +179,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) } if (!res) { - llwarns << "Floater type: '" << name << "' not registered." << llendl; + LL_WARNS() << "Floater type: '" << name << "' not registered." << LL_ENDL; } } return res; @@ -475,7 +475,7 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& if (!instance) { - lldebugs << "Unable to get instance of floater '" << name << "'" << llendl; + LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL; return; } diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 724d190307..c1fe70bc26 100755 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -358,11 +358,11 @@ void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor ) { if (new_captor) { - llinfos << "New mouse captor: " << new_captor->getName() << llendl; + LL_INFOS() << "New mouse captor: " << new_captor->getName() << LL_ENDL; } else { - llinfos << "New mouse captor: NULL" << llendl; + LL_INFOS() << "New mouse captor: NULL" << LL_ENDL; } } diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index b5ac7db4e7..92504ba8c2 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -636,7 +636,7 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, } if (handled) { - LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFolderViewItem" << llendl; + LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFolderViewItem" << LL_ENDL; } return handled; @@ -1753,7 +1753,7 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask, { handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); - LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFolderViewFolder" << llendl; + LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFolderViewFolder" << LL_ENDL; } return TRUE; diff --git a/indra/llui/llfunctorregistry.h b/indra/llui/llfunctorregistry.h index beac212441..f5364f4863 100755 --- a/indra/llui/llfunctorregistry.h +++ b/indra/llui/llfunctorregistry.h @@ -75,7 +75,7 @@ public: } else { - llerrs << "attempt to store duplicate name '" << name << "' in LLFunctorRegistry. NOT ADDED." << llendl; + LL_ERRS() << "attempt to store duplicate name '" << name << "' in LLFunctorRegistry. NOT ADDED." << LL_ENDL; retval = false; } @@ -86,7 +86,7 @@ public: { if (mMap.count(name) == 0) { - llwarns << "trying to remove '" << name << "' from LLFunctorRegistry but it's not there." << llendl; + LL_WARNS() << "trying to remove '" << name << "' from LLFunctorRegistry but it's not there." << LL_ENDL; return false; } mMap.erase(name); @@ -101,7 +101,7 @@ public: } else { - lldebugs << "tried to find '" << name << "' in LLFunctorRegistry, but it wasn't there." << llendl; + LL_DEBUGS() << "tried to find '" << name << "' in LLFunctorRegistry, but it wasn't there." << LL_ENDL; return mMap[LOGFUNCTOR]; } } @@ -113,7 +113,7 @@ private: static void log_functor(const LLSD& notification, const LLSD& payload) { - lldebugs << "log_functor called with payload: " << payload << llendl; + LL_DEBUGS() << "log_functor called with payload: " << payload << LL_ENDL; } static void do_nothing(const LLSD& notification, const LLSD& payload) diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index f2e9843bf3..d410a2de33 100755 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -785,7 +785,7 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLLineEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) { - // llinfos << "MiddleMouseDown" << llendl; + // LL_INFOS() << "MiddleMouseDown" << LL_ENDL; setFocus( TRUE ); if( canPastePrimary() ) { @@ -855,14 +855,14 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) mKeystrokeTimer.reset(); getWindow()->setCursor(UI_CURSOR_IBEAM); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; handled = TRUE; } if( !handled ) { getWindow()->setCursor(UI_CURSOR_IBEAM); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; handled = TRUE; } @@ -1347,7 +1347,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) case KEY_BACKSPACE: if (!mReadOnly) { - //llinfos << "Handling backspace" << llendl; + //LL_INFOS() << "Handling backspace" << LL_ENDL; if( hasSelection() ) { deleteSelection(); @@ -2379,7 +2379,7 @@ void LLLineEditor::resetPreedit() { if (hasPreeditString()) { - llwarns << "Preedit and selection!" << llendl; + LL_WARNS() << "Preedit and selection!" << LL_ENDL; deselect(); } else @@ -2543,7 +2543,7 @@ void LLLineEditor::markAsPreedit(S32 position, S32 length) setCursor(position); if (hasPreeditString()) { - llwarns << "markAsPreedit invoked when hasPreeditString is true." << llendl; + LL_WARNS() << "markAsPreedit invoked when hasPreeditString is true." << LL_ENDL; } mPreeditWString.assign( LLWString( mText.getWString(), position, length ) ); if (length > 0) diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp index 746ade4648..0609cd8b42 100755 --- a/indra/llui/llmenubutton.cpp +++ b/indra/llui/llmenubutton.cpp @@ -96,7 +96,7 @@ void LLMenuButton::setMenu(const std::string& menu_filename, EMenuPosition posit LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile(menu_filename, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance()); if (!menu) { - llwarns << "Error loading menu_button menu" << llendl; + LL_WARNS() << "Error loading menu_button menu" << LL_ENDL; return; } diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 385dbc6e19..38afee9b79 100755 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -280,7 +280,7 @@ BOOL LLMenuItemGL::addToAcceleratorList(std::list *listp) // warning.append("\n "); // warning.append(mLabel); - // llwarns << warning << llendl; + // LL_WARNS() << warning << LL_ENDL; // LLAlertDialog::modalAlert(warning); return FALSE; } @@ -1962,7 +1962,7 @@ bool LLMenuGL::scrollItems(EScrollingDirection direction) break; } default: - llwarns << "Unknown scrolling direction: " << direction << llendl; + LL_WARNS() << "Unknown scrolling direction: " << direction << LL_ENDL; } mNeedsArrange = TRUE; @@ -2562,8 +2562,8 @@ BOOL LLMenuGL::appendMenu( LLMenuGL* menu ) { if( menu == this ) { - llerrs << "** Attempt to attach menu to itself. This is certainly " - << "a logic error." << llendl; + LL_ERRS() << "** Attempt to attach menu to itself. This is certainly " + << "a logic error." << LL_ENDL; } BOOL success = TRUE; @@ -2591,7 +2591,7 @@ BOOL LLMenuGL::appendContextSubMenu(LLMenuGL *menu) { if (menu == this) { - llerrs << "Can't attach a context menu to itself" << llendl; + LL_ERRS() << "Can't attach a context menu to itself" << LL_ENDL; } LLContextMenuBranch *item; @@ -3114,7 +3114,7 @@ LLMenuGL* LLMenuGL::findChildMenuByName(const std::string& name, BOOL recurse) c return menup; } } - llwarns << "Child Menu " << name << " not found in menu " << getName() << llendl; + LL_WARNS() << "Child Menu " << name << " not found in menu " << getName() << LL_ENDL; return NULL; } @@ -3419,8 +3419,8 @@ BOOL LLMenuBarGL::appendMenu( LLMenuGL* menu ) { if( menu == this ) { - llerrs << "** Attempt to attach menu to itself. This is certainly " - << "a logic error." << llendl; + LL_ERRS() << "** Attempt to attach menu to itself. This is certainly " + << "a logic error." << LL_ENDL; } BOOL success = TRUE; diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 8aefef07e2..45505e232e 100755 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -65,7 +65,7 @@ LLModalDialog::~LLModalDialog() std::list::iterator iter = std::find(sModalStack.begin(), sModalStack.end(), this); if (iter != sModalStack.end()) { - llerrs << "Attempt to delete dialog while still in sModalStack!" << llendl; + LL_ERRS() << "Attempt to delete dialog while still in sModalStack!" << LL_ENDL; } } @@ -126,7 +126,7 @@ void LLModalDialog::stopModal() } else { - llwarns << "LLModalDialog::stopModal not in list!" << llendl; + LL_WARNS() << "LLModalDialog::stopModal not in list!" << LL_ENDL; } } if (!sModalStack.empty()) @@ -181,7 +181,7 @@ BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask) if( childrenHandleHover(x, y, mask) == NULL ) { getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL; } return TRUE; } @@ -300,7 +300,7 @@ void LLModalDialog::shutdownModals() // app, we shouldn't have to care WHAT's open. Put differently, if a modal // dialog is so crucial that we can't let the user terminate until s/he // addresses it, we should reject a termination request. The current state - // of affairs is that we accept it, but then produce an llerrs popup that + // of affairs is that we accept it, but then produce an LL_ERRS() popup that // simply makes our software look unreliable. sModalStack.clear(); } diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 179b251cdb..48b5b08c1b 100755 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -159,7 +159,7 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater, if (!mTabContainer) { - llerrs << "Tab Container used without having been initialized." << llendl; + LL_ERRS() << "Tab Container used without having been initialized." << LL_ENDL; return; } diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index 17d07f4dae..0aa3e17075 100755 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -301,7 +301,7 @@ bool LLMultiSlider::findUnusedValue(F32& initVal) // stop if it's filled if(initVal == mInitialValue && !firstTry) { - llwarns << "Whoa! Too many multi slider elements to add one to" << llendl; + LL_WARNS() << "Whoa! Too many multi slider elements to add one to" << LL_ENDL; return false; } @@ -356,12 +356,12 @@ BOOL LLMultiSlider::handleHover(S32 x, S32 y, MASK mask) onCommit(); getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; } else { getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; } return TRUE; } diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index 91e5b6b9de..c460a08afc 100755 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -450,7 +450,7 @@ void LLMultiSliderCtrl::setPrecision(S32 precision) { if (precision < 0 || precision > 10) { - llerrs << "LLMultiSliderCtrl::setPrecision - precision out of range" << llendl; + LL_ERRS() << "LLMultiSliderCtrl::setPrecision - precision out of range" << LL_ENDL; return; } diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7932299281..fbeb8355db 100755 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -246,7 +246,7 @@ LLNotificationForm::LLNotificationForm(const LLSD& sd) } else { - llwarns << "Invalid form data " << sd << llendl; + LL_WARNS() << "Invalid form data " << sd << LL_ENDL; mFormData = LLSD::emptyArray(); } } @@ -438,11 +438,11 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par mUniqueContext.push_back(context.value); } - lldebugs << "notification \"" << mName << "\": tag count is " << p.tags.size() << llendl; + LL_DEBUGS() << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL; BOOST_FOREACH(const LLNotificationTemplate::Tag& tag, p.tags) { - lldebugs << " tag \"" << std::string(tag.value) << "\"" << llendl; + LL_DEBUGS() << " tag \"" << std::string(tag.value) << "\"" << LL_ENDL; mTags.push_back(tag.value); } @@ -1405,7 +1405,7 @@ void LLNotifications::forceResponse(const LLNotification::Params& params, S32 op if (selected_item.isUndefined()) { - llwarns << "Invalid option" << option << " for notification " << (std::string)params.name << llendl; + LL_WARNS() << "Invalid option" << option << " for notification " << (std::string)params.name << LL_ENDL; return; } response[selected_item["name"].asString()] = true; @@ -1439,12 +1439,12 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements) if (found != replacements.end()) { replacement = found->second; - lldebugs << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << llendl; + LL_DEBUGS() << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << LL_ENDL; it->second->setValue(replacement); } else { - llwarns << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << llendl; + LL_WARNS() << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << LL_ENDL; } } } @@ -1483,7 +1483,7 @@ void addPathIfExists(const std::string& new_path, std::vector& path bool LLNotifications::loadTemplates() { - llinfos << "Reading notifications template" << llendl; + LL_INFOS() << "Reading notifications template" << LL_ENDL; // Passing findSkinnedFilenames(constraint=LLDir::ALL_SKINS) makes it // output all relevant pathnames instead of just the ones from the most // specific skin. @@ -1496,7 +1496,7 @@ bool LLNotifications::loadTemplates() if (!success || root.isNull() || !root->hasName( "notifications" )) { - llerrs << "Problem reading XML from UI Notifications file: " << base_filename << llendl; + LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL; return false; } @@ -1506,7 +1506,7 @@ bool LLNotifications::loadTemplates() if(!params.validateBlock()) { - llerrs << "Problem reading XUI from UI Notifications file: " << base_filename << llendl; + LL_ERRS() << "Problem reading XUI from UI Notifications file: " << base_filename << LL_ENDL; return false; } @@ -1554,7 +1554,7 @@ bool LLNotifications::loadTemplates() mTemplates[notification.name] = LLNotificationTemplatePtr(new LLNotificationTemplate(notification)); } - llinfos << "...done" << llendl; + LL_INFOS() << "...done" << LL_ENDL; return true; } @@ -1572,7 +1572,7 @@ bool LLNotifications::loadVisibilityRules() if(!params.validateBlock()) { - llerrs << "Problem reading UI Notification Visibility Rules file: " << full_filename << llendl; + LL_ERRS() << "Problem reading UI Notification Visibility Rules file: " << full_filename << LL_ENDL; return false; } @@ -1637,7 +1637,7 @@ void LLNotifications::add(const LLNotificationPtr pNotif) LLNotificationSet::iterator it=mItems.find(pNotif); if (it != mItems.end()) { - llerrs << "Notification added a second time to the master notification channel." << llendl; + LL_ERRS() << "Notification added a second time to the master notification channel." << LL_ENDL; } updateItem(LLSD().with("sigtype", "add").with("id", pNotif->id()), pNotif); @@ -1695,7 +1695,7 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid) LLNotificationSet::iterator it=mItems.find(target); if (it == mItems.end()) { - LL_DEBUGS("Notifications") << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << llendl; + LL_DEBUGS("Notifications") << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << LL_ENDL; return LLNotificationPtr((LLNotification*)NULL); } else @@ -1746,13 +1746,13 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) for(it = mVisibilityRules.begin(); it != mVisibilityRules.end(); it++) { // An empty type/tag/name string will match any notification, so only do the comparison when the string is non-empty in the rule. - lldebugs + LL_DEBUGS() << "notification \"" << n->getName() << "\" " << "testing against " << ((*it)->mVisible?"show":"hide") << " rule, " << "name = \"" << (*it)->mName << "\" " << "tag = \"" << (*it)->mTag << "\" " << "type = \"" << (*it)->mType << "\" " - << llendl; + << LL_ENDL; if(!(*it)->mType.empty()) { @@ -1791,7 +1791,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) if((*it)->mResponse.empty()) { // Response property is empty. Cancel this notification. - lldebugs << "cancelling notification " << n->getName() << llendl; + LL_DEBUGS() << "cancelling notification " << n->getName() << LL_ENDL; cancel(n); } @@ -1802,7 +1802,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) // TODO: verify that the response template has an item with the correct name response[(*it)->mResponse] = true; - lldebugs << "responding to notification " << n->getName() << " with response = " << response << llendl; + LL_DEBUGS() << "responding to notification " << n->getName() << " with response = " << response << LL_ENDL; n->respond(response); } @@ -1814,7 +1814,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) break; } - lldebugs << "allowing notification " << n->getName() << llendl; + LL_DEBUGS() << "allowing notification " << n->getName() << LL_ENDL; return true; } @@ -1875,7 +1875,7 @@ void LLPostponedNotification::onAvatarNameCache(const LLUUID& agent_id, // from PE merge - we should figure out if this is the right thing to do if (name.empty()) { - llwarns << "Empty name received for Id: " << agent_id << llendl; + LL_WARNS() << "Empty name received for Id: " << agent_id << LL_ENDL; name = SYSTEM_FROM; } diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index f157d6a923..389d18a350 100755 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -391,7 +391,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_ panelp = LLRegisterPanelClass::instance().createPanelClass(class_attr); if (!panelp) { - llwarns << "Panel class \"" << class_attr << "\" not registered." << llendl; + LL_WARNS() << "Panel class \"" << class_attr << "\" not registered." << LL_ENDL; } } @@ -529,7 +529,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu LLFastTimer timer(FTM_EXTERNAL_PANEL_LOAD); if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml)) { - llwarns << "Couldn't parse panel from: " << xml_filename << llendl; + LL_WARNS() << "Couldn't parse panel from: " << xml_filename << LL_ENDL; return FALSE; } @@ -599,11 +599,11 @@ std::string LLPanel::getString(const std::string& name, const LLStringUtil::form std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate if(LLUI::sSettingGroups["config"]->getBOOL("QAMode")) { - llerrs << err_str << llendl; + LL_ERRS() << err_str << LL_ENDL; } else { - llwarns << err_str << llendl; + LL_WARNS() << err_str << LL_ENDL; } return LLStringUtil::null; } @@ -618,11 +618,11 @@ std::string LLPanel::getString(const std::string& name) const std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate if(LLUI::sSettingGroups["config"]->getBOOL("QAMode")) { - llerrs << err_str << llendl; + LL_ERRS() << err_str << LL_ENDL; } else { - llwarns << err_str << llendl; + LL_WARNS() << err_str << LL_ENDL; } return LLStringUtil::null; } @@ -976,18 +976,18 @@ BOOL LLPanel::buildFromFile(const std::string& filename, const LLPanel::Params& if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) { - llwarns << "Couldn't parse panel from: " << filename << llendl; + LL_WARNS() << "Couldn't parse panel from: " << filename << LL_ENDL; return didPost; } // root must be called panel if( !root->hasName("panel" ) ) { - llwarns << "Root node should be named panel in : " << filename << llendl; + LL_WARNS() << "Root node should be named panel in : " << filename << LL_ENDL; return didPost; } - lldebugs << "Building panel " << filename << llendl; + LL_DEBUGS() << "Building panel " << filename << LL_ENDL; LLUICtrlFactory::instance().pushFileName(filename); { diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 95a7d09382..b53bb16d97 100755 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -289,7 +289,7 @@ BOOL LLRadioGroup::handleMouseDown(S32 x, S32 y, MASK mask) void LLRadioGroup::onClickButton(LLUICtrl* ctrl) { - // llinfos << "LLRadioGroup::onClickButton" << llendl; + // LL_INFOS() << "LLRadioGroup::onClickButton" << LL_ENDL; LLRadioCtrl* clicked_radio = dynamic_cast(ctrl); if (!clicked_radio) return; @@ -319,7 +319,7 @@ void LLRadioGroup::onClickButton(LLUICtrl* ctrl) index++; } - llwarns << "LLRadioGroup::onClickButton - clicked button that isn't a child" << llendl; + LL_WARNS() << "LLRadioGroup::onClickButton - clicked button that isn't a child" << LL_ENDL; } void LLRadioGroup::setValue( const LLSD& value ) diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 7488af2e05..6e924c1f19 100755 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -315,7 +315,7 @@ LLLocale::LLLocale(const std::string& locale_string) } //else //{ - // llinfos << "Set locale to " << new_locale_string << llendl; + // LL_INFOS() << "Set locale to " << new_locale_string << LL_ENDL; //} } diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index f92e8f41ea..76134144a0 100755 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -381,7 +381,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) } getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; handled = TRUE; } else @@ -393,7 +393,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) if( !handled ) { getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; handled = TRUE; } diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 93eea75952..e1d401d94a 100755 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -643,7 +643,7 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLRect& const { if (!mScrolledView) { - llwarns << "LLScrollContainer::scrollToShowRect with no view!" << llendl; + LL_WARNS() << "LLScrollContainer::scrollToShowRect with no view!" << LL_ENDL; return; } diff --git a/indra/llui/llscrollingpanellist.cpp b/indra/llui/llscrollingpanellist.cpp index 9b65c2b79d..b6f2eb8ba2 100755 --- a/indra/llui/llscrollingpanellist.cpp +++ b/indra/llui/llscrollingpanellist.cpp @@ -111,7 +111,7 @@ void LLScrollingPanelList::removePanel( U32 panel_index ) { if ( mPanelList.empty() || panel_index >= mPanelList.size() ) { - llwarns << "Panel index " << panel_index << " is out of range!" << llendl; + LL_WARNS() << "Panel index " << panel_index << " is out of range!" << LL_ENDL; return; } else diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp index 5a1e96ab03..87cd71c505 100755 --- a/indra/llui/llscrolllistitem.cpp +++ b/indra/llui/llscrolllistitem.cpp @@ -82,7 +82,7 @@ void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell ) } else { - llerrs << "LLScrollListItem::setColumn: bad column: " << column << llendl; + LL_ERRS() << "LLScrollListItem::setColumn: bad column: " << column << LL_ENDL; } } diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp index ddddbe6f30..ebbb951ee6 100755 --- a/indra/llui/llslider.cpp +++ b/indra/llui/llslider.cpp @@ -188,12 +188,12 @@ BOOL LLSlider::handleHover(S32 x, S32 y, MASK mask) setValueAndCommit(t * (mMaxValue - mMinValue) + mMinValue ); } getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; } else { getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; } return TRUE; } diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 583ed1ed2e..62c5ecb8f1 100755 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -403,7 +403,7 @@ void LLSliderCtrl::setPrecision(S32 precision) { if (precision < 0 || precision > 10) { - llerrs << "LLSliderCtrl::setPrecision - precision out of range" << llendl; + LL_ERRS() << "LLSliderCtrl::setPrecision - precision out of range" << LL_ENDL; return; } diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index 8a728df2e7..ebdbdf59c0 100755 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -384,7 +384,7 @@ void LLSpinCtrl::setPrecision(S32 precision) { if (precision < 0 || precision > 10) { - llerrs << "LLSpinCtrl::setPrecision - precision out of range" << llendl; + LL_ERRS() << "LLSpinCtrl::setPrecision - precision out of range" << LL_ENDL; return; } @@ -400,7 +400,7 @@ void LLSpinCtrl::setLabel(const LLStringExplicit& label) } else { - llwarns << "Attempting to set label on LLSpinCtrl constructed without one " << getName() << llendl; + LL_WARNS() << "Attempting to set label on LLSpinCtrl constructed without one " << getName() << LL_ENDL; } updateLabelColor(); } diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 415da0b3d6..180120c0cb 100755 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1572,7 +1572,7 @@ BOOL LLTabContainer::selectTabByName(const std::string& name) LLPanel* panel = getPanelByName(name); if (!panel) { - llwarns << "LLTabContainer::selectTabByName(" << name << ") failed" << llendl; + LL_WARNS() << "LLTabContainer::selectTabByName(" << name << ") failed" << LL_ENDL; return FALSE; } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7243931dbb..94cf93bd3c 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -687,7 +687,7 @@ void LLTextBase::drawText() seg_iter++; if (seg_iter == mSegments.end()) { - llwarns << "Ran off the segmentation end!" << llendl; + LL_WARNS() << "Ran off the segmentation end!" << LL_ENDL; return; } @@ -1487,7 +1487,7 @@ void LLTextBase::reflow() // use an even number of iterations to avoid user visible oscillation of the layout if(++reflow_count > 2) { - lldebugs << "Breaking out of reflow due to possible infinite loop in " << getName() << llendl; + LL_DEBUGS() << "Breaking out of reflow due to possible infinite loop in " << getName() << LL_ENDL; break; } @@ -2120,7 +2120,7 @@ void LLTextBase::setFont(const LLFontGL* font) void LLTextBase::needsReflow(S32 index) { - lldebugs << "reflow on object " << (void*)this << " index = " << mReflowIndex << ", new index = " << index << llendl; + LL_DEBUGS() << "reflow on object " << (void*)this << " index = " << mReflowIndex << ", new index = " << index << LL_ENDL; mReflowIndex = llmin(mReflowIndex, index); } @@ -3162,7 +3162,7 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) // we cannot replace a keyword tooltip that's loaded from a file if (mToken) { - llwarns << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << llendl; + LL_WARNS() << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << LL_ENDL; return; } memDisclaim(mTooltip); @@ -3220,14 +3220,14 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin if(getLength() < segment_offset + mStart) { - llinfos << "getLength() < segment_offset + mStart\t getLength()\t" << getLength() << "\tsegment_offset:\t" - << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << llendl; + LL_INFOS() << "getLength() < segment_offset + mStart\t getLength()\t" << getLength() << "\tsegment_offset:\t" + << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << LL_ENDL; } if(offsetString.length() + 1 < max_chars) { - llinfos << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetString.length() << " getLength() : " - << getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << llendl; + LL_INFOS() << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetString.length() << " getLength() : " + << getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << LL_ENDL; } S32 num_chars = mStyle->getFont()->maxDrawableChars(offsetString.c_str(), @@ -3257,13 +3257,13 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin void LLNormalTextSegment::dump() const { - llinfos << "Segment [" << + LL_INFOS() << "Segment [" << // mColor.mV[VX] << ", " << // mColor.mV[VY] << ", " << // mColor.mV[VZ] << "]\t[" << mStart << ", " << getEnd() << "]" << - llendl; + LL_ENDL; } /*virtual*/ diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index eb5a04d8e5..36431d3723 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -781,7 +781,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) setCursorAtLocalPos( clamped_x, clamped_y, true ); mSelectionEnd = mCursorPos; } - LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; getWindow()->setCursor(UI_CURSOR_IBEAM); handled = TRUE; } @@ -2586,20 +2586,20 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length ) instream.getline(tbuf, MAX_STRING); if( 1 != sscanf(tbuf, "Linden text version %d", &version) ) { - llwarns << "Invalid Linden text file header " << llendl; + LL_WARNS() << "Invalid Linden text file header " << LL_ENDL; return FALSE; } if( 1 != version ) { - llwarns << "Invalid Linden text file version: " << version << llendl; + LL_WARNS() << "Invalid Linden text file version: " << version << LL_ENDL; return FALSE; } instream.getline(tbuf, MAX_STRING); if( 0 != sscanf(tbuf, "{") ) { - llwarns << "Invalid Linden text file format" << llendl; + LL_WARNS() << "Invalid Linden text file format" << LL_ENDL; return FALSE; } @@ -2607,13 +2607,13 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length ) instream.getline(tbuf, MAX_STRING); if( 1 != sscanf(tbuf, "Text length %d", &text_len) ) { - llwarns << "Invalid Linden text length field" << llendl; + LL_WARNS() << "Invalid Linden text length field" << LL_ENDL; return FALSE; } if( text_len > mMaxTextByteLength ) { - llwarns << "Invalid Linden text length: " << text_len << llendl; + LL_WARNS() << "Invalid Linden text length: " << text_len << LL_ENDL; return FALSE; } @@ -2622,21 +2622,21 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length ) char* text = new char[ text_len + 1]; if (text == NULL) { - llerrs << "Memory allocation failure." << llendl; + LL_ERRS() << "Memory allocation failure." << LL_ENDL; return FALSE; } instream.get(text, text_len + 1, '\0'); text[text_len] = '\0'; if( text_len != (S32)strlen(text) )/* Flawfinder: ignore */ { - llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl;/* Flawfinder: ignore */ + LL_WARNS() << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << LL_ENDL;/* Flawfinder: ignore */ success = FALSE; } instream.getline(tbuf, MAX_STRING); if( success && (0 != sscanf(tbuf, "}")) ) { - llwarns << "Invalid Linden text file format: missing terminal }" << llendl; + LL_WARNS() << "Invalid Linden text file format: missing terminal }" << LL_ENDL; success = FALSE; } @@ -2699,7 +2699,7 @@ void LLTextEditor::resetPreedit() { if (hasSelection()) { - llwarns << "Preedit and selection!" << llendl; + LL_WARNS() << "Preedit and selection!" << LL_ENDL; deselect(); } @@ -2889,7 +2889,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length) setCursorPos(position); if (hasPreeditString()) { - llwarns << "markAsPreedit invoked when hasPreeditString is true." << llendl; + LL_WARNS() << "markAsPreedit invoked when hasPreeditString is true." << LL_ENDL; } mPreeditWString = LLWString( getWText(), position, length ); if (length > 0) diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp index 8a85f99e0c..0b36241da0 100755 --- a/indra/llui/lltextparser.cpp +++ b/indra/llui/lltextparser.cpp @@ -228,7 +228,7 @@ bool LLTextParser::saveToDisk(LLSD highlights) std::string filename=getFileName(); if (filename.empty()) { - llwarns << "LLTextParser::saveToDisk() no valid user directory." << llendl; + LL_WARNS() << "LLTextParser::saveToDisk() no valid user directory." << LL_ENDL; return FALSE; } llofstream file; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index f683758962..8d1017c1b4 100755 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -157,7 +157,7 @@ void LLToolBar::createContextMenu() } else { - llwarns << "Unable to load toolbars context menu." << llendl; + LL_WARNS() << "Unable to load toolbars context menu." << LL_ENDL; } } @@ -1063,7 +1063,7 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, mDragRank = getRankFromPosition(x, y); // Don't DaD if we're dragging a command on itself mDragAndDropTarget = ((orig_rank != RANK_NONE) && ((mDragRank == orig_rank) || ((mDragRank-1) == orig_rank)) ? false : true); - //llinfos << "Merov debug : DaD, rank = " << mDragRank << ", dragged uui = " << inv_item->getUUID() << llendl; + //LL_INFOS() << "Merov debug : DaD, rank = " << mDragRank << ", dragged uui = " << inv_item->getUUID() << LL_ENDL; /* Do the following if you want to animate the button itself LLCommandId dragged_command(inv_item->getUUID()); removeCommand(dragged_command); diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 782d26fccb..5e1f12996e 100755 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -484,7 +484,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) params_with_defaults.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); if (!params_with_defaults.validateBlock()) { - llwarns << "Could not display tooltip!" << llendl; + LL_WARNS() << "Could not display tooltip!" << LL_ENDL; return; } diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp index 5388069c24..5131f6b704 100755 --- a/indra/llui/lltrans.cpp +++ b/indra/llui/lltrans.cpp @@ -63,8 +63,8 @@ bool LLTrans::parseStrings(LLXMLNodePtr &root, const std::set& defa std::string xml_filename = "(strings file)"; if (!root->hasName("strings")) { - llerrs << "Invalid root node name in " << xml_filename - << ": was " << root->getName() << ", expected \"strings\"" << llendl; + LL_ERRS() << "Invalid root node name in " << xml_filename + << ": was " << root->getName() << ", expected \"strings\"" << LL_ENDL; } StringTable string_table; @@ -73,7 +73,7 @@ bool LLTrans::parseStrings(LLXMLNodePtr &root, const std::set& defa if (!string_table.validateBlock()) { - llerrs << "Problem reading strings: " << xml_filename << llendl; + LL_ERRS() << "Problem reading strings: " << xml_filename << LL_ENDL; return false; } @@ -107,8 +107,8 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root) std::string xml_filename = "(language strings file)"; if (!root->hasName("strings")) { - llerrs << "Invalid root node name in " << xml_filename - << ": was " << root->getName() << ", expected \"strings\"" << llendl; + LL_ERRS() << "Invalid root node name in " << xml_filename + << ": was " << root->getName() << ", expected \"strings\"" << LL_ENDL; } StringTable string_table; @@ -117,7 +117,7 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root) if (!string_table.validateBlock()) { - llerrs << "Problem reading strings: " << xml_filename << llendl; + LL_ERRS() << "Problem reading strings: " << xml_filename << LL_ENDL; return false; } diff --git a/indra/llui/lltransutil.cpp b/indra/llui/lltransutil.cpp index 80d079cbc8..220cee4c90 100755 --- a/indra/llui/lltransutil.cpp +++ b/indra/llui/lltransutil.cpp @@ -44,7 +44,7 @@ bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::setcontrolExists(name)) { - llwarns << "tried to make UI sound for unknown sound name: " << name << llendl; + LL_WARNS() << "tried to make UI sound for unknown sound name: " << name << LL_ENDL; } else { @@ -118,19 +118,19 @@ LLUUID find_ui_sound(const char * namep) { if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle")) { - llinfos << "UI sound name: " << name << " triggered but silent (null uuid)" << llendl; + LL_INFOS() << "UI sound name: " << name << " triggered but silent (null uuid)" << LL_ENDL; } } else { - llwarns << "UI sound named: " << name << " does not translate to a valid uuid" << llendl; + LL_WARNS() << "UI sound named: " << name << " does not translate to a valid uuid" << LL_ENDL; } } else if (LLUI::sAudioCallback != NULL) { if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle")) { - llinfos << "UI sound name: " << name << llendl; + LL_INFOS() << "UI sound name: " << name << LL_ENDL; } } } @@ -170,7 +170,7 @@ void LLUI::initClass(const settings_map_t& settings, (get_ptr_in_map(sSettingGroups, std::string("floater")) == NULL) || (get_ptr_in_map(sSettingGroups, std::string("ignores")) == NULL)) { - llerrs << "Failure to initialize configuration groups" << llendl; + LL_ERRS() << "Failure to initialize configuration groups" << LL_ENDL; } sAudioCallback = audio_callback; diff --git a/indra/llui/llui.h b/indra/llui/llui.h index f3ed3fcb49..f7426a703a 100755 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -171,7 +171,7 @@ public: { if (mMin > mMax) { - llwarns << "Bad interval range (" << mMin << ", " << mMax << ")" << llendl; + LL_WARNS() << "Bad interval range (" << mMin << ", " << mMax << ")" << LL_ENDL; // since max is usually the most dangerous one to ignore (buffer overflow, etc), prefer it // in the case of a malformed range mMin = mMax; @@ -410,7 +410,7 @@ private: static void initClass() { - llerrs << "No static initClass() method defined for " << typeid(T).name() << llendl; + LL_ERRS() << "No static initClass() method defined for " << typeid(T).name() << LL_ENDL; } }; @@ -425,7 +425,7 @@ private: static void destroyClass() { - llerrs << "No static destroyClass() method defined for " << typeid(T).name() << llendl; + LL_ERRS() << "No static destroyClass() method defined for " << typeid(T).name() << LL_ENDL; } }; diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index ffeff15968..244f0c6f00 100755 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -117,7 +117,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table unresolved_refs.erase(iter->second); } - llwarns << warning + ending_ref << llendl; + LL_WARNS() << warning + ending_ref << LL_ENDL; break; } @@ -156,7 +156,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table iter != visited_refs.end(); ++iter) { - llwarns << iter->first << " references a non-existent color" << llendl; + LL_WARNS() << iter->first << " references a non-existent color" << LL_ENDL; unresolved_refs.erase(iter->second); } @@ -293,13 +293,13 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename, string_color_ if(!LLXMLNode::parseFile(filename, root, NULL)) { - llwarns << "Unable to parse color file " << filename << llendl; + LL_WARNS() << "Unable to parse color file " << filename << LL_ENDL; return false; } if(!root->hasName("colors")) { - llwarns << filename << " is not a valid color definition file" << llendl; + LL_WARNS() << filename << " is not a valid color definition file" << LL_ENDL; return false; } @@ -313,7 +313,7 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename, string_color_ } else { - llwarns << filename << " failed to load" << llendl; + LL_WARNS() << filename << " failed to load" << LL_ENDL; return false; } diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 08358484ef..abcd5da6c4 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -212,7 +212,7 @@ LLUICtrl::~LLUICtrl() if( gFocusMgr.getTopCtrl() == this ) { - llwarns << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl; + LL_WARNS() << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << LL_ENDL; gFocusMgr.removeTopCtrlWithoutCallback( this ); } @@ -258,7 +258,7 @@ LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCa } else if (!function_name.empty()) { - llwarns << "No callback found for: '" << function_name << "' in control: " << getName() << llendl; + LL_WARNS() << "No callback found for: '" << function_name << "' in control: " << getName() << LL_ENDL; } } return default_commit_handler; @@ -452,7 +452,7 @@ void LLUICtrl::setControlVariable(LLControlVariable* control) if (mControlVariable) { //RN: this will happen in practice, should we try to avoid it? - //llwarns << "setControlName called twice on same control!" << llendl; + //LL_WARNS() << "setControlName called twice on same control!" << LL_ENDL; mControlConnection.disconnect(); // disconnect current signal mControlVariable = NULL; } diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 60fee47ae0..291da2ce48 100755 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -131,11 +131,11 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid // for the child widget // You might need to add something like: // static ParentWidgetRegistry::Register register("child_widget_name"); - llwarns << child_name << " is not a valid child of " << node->getName()->mString << llendl; + LL_WARNS() << child_name << " is not a valid child of " << node->getName()->mString << LL_ENDL; } else { - llwarns << "Could not create widget named " << child_node->getName()->mString << llendl; + LL_WARNS() << "Could not create widget named " << child_node->getName()->mString << LL_ENDL; } } diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index f2fe4334ee..87b3937417 100755 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -171,7 +171,7 @@ public: if (!LLUICtrlFactory::getLayeredXMLNode(filename, root_node)) { - llwarns << "Couldn't parse XUI file: " << instance().getCurFileName() << llendl; + LL_WARNS() << "Couldn't parse XUI file: " << instance().getCurFileName() << LL_ENDL; goto fail; } @@ -182,7 +182,7 @@ public: // not of right type, so delete it if (!widget) { - llwarns << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << llendl; + LL_WARNS() << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << LL_ENDL; delete view; view = NULL; } @@ -225,7 +225,7 @@ private: if (!params.validateBlock()) { - llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; + LL_WARNS() << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << LL_ENDL; //return NULL; } diff --git a/indra/llui/llundo.cpp b/indra/llui/llundo.cpp index 06b0514223..7c4c183a30 100755 --- a/indra/llui/llundo.cpp +++ b/indra/llui/llundo.cpp @@ -51,7 +51,7 @@ LLUndoBuffer::LLUndoBuffer( LLUndoAction (*create_func()), S32 initial_count ) mActions[i] = create_func(); if (!mActions[i]) { - llerrs << "Unable to create action for undo buffer" << llendl; + LL_ERRS() << "Unable to create action for undo buffer" << LL_ENDL; } } } diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 99ee688888..bef9034e55 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -785,7 +785,7 @@ std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelC if (path_parts < 3) // no parcel id { - llwarns << "Failed to parse url [" << url << "]" << llendl; + LL_WARNS() << "Failed to parse url [" << url << "]" << LL_ENDL; return url; } @@ -925,7 +925,7 @@ std::string LLUrlEntryRegion::getLabel(const std::string &url, const LLUrlLabelC if (path_parts < 3) // no region name { - llwarns << "Failed to parse url [" << url << "]" << llendl; + LL_WARNS() << "Failed to parse url [" << url << "]" << LL_ENDL; return url; } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index daeb4d7939..ae62d72f73 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -159,10 +159,10 @@ LLView::LLView(const LLView::Params& p) LLView::~LLView() { dirtyRect(); - //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl; + //LL_INFOS() << "Deleting view " << mName << ":" << (void*) this << LL_ENDL; if (LLView::sIsDrawing) { - lldebugs << "Deleting view " << mName << " during UI draw() phase" << llendl; + LL_DEBUGS() << "Deleting view " << mName << " during UI draw() phase" << LL_ENDL; } // llassert(LLView::sIsDrawing == FALSE); @@ -170,7 +170,7 @@ LLView::~LLView() if( hasMouseCapture() ) { - //llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl; + //LL_WARNS() << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << LL_ENDL; gFocusMgr.removeMouseCaptureWithoutCallback( this ); } @@ -300,7 +300,7 @@ bool LLView::addChild(LLView* child, S32 tab_group) } if (mParentView == child) { - llerrs << "Adding view " << child->getName() << " as child of itself" << llendl; + LL_ERRS() << "Adding view " << child->getName() << " as child of itself" << LL_ENDL; } // remove from current parent @@ -361,7 +361,7 @@ void LLView::removeChild(LLView* child) } else { - llwarns << "\"" << child->getName() << "\" is not a child of " << getName() << llendl; + LL_WARNS() << "\"" << child->getName() << "\" is not a child of " << getName() << LL_ENDL; } updateBoundingRect(); } @@ -687,12 +687,12 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask) void LLView::onMouseEnter(S32 x, S32 y, MASK mask) { - //llinfos << "Mouse entered " << getName() << llendl; + //LL_INFOS() << "Mouse entered " << getName() << LL_ENDL; } void LLView::onMouseLeave(S32 x, S32 y, MASK mask) { - //llinfos << "Mouse left " << getName() << llendl; + //LL_INFOS() << "Mouse left " << getName() << LL_ENDL; } bool LLView::visibleAndContains(S32 local_x, S32 local_y) @@ -727,7 +727,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m { if (LLView::sDebugKeys) { - llinfos << desc << " handled by " << viewp->getName() << llendl; + LL_INFOS() << desc << " handled by " << viewp->getName() << LL_ENDL; } return viewp; } @@ -920,7 +920,7 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent) handled = handleKeyHere( key, mask ); if (handled && LLView::sDebugKeys) { - llinfos << "Key handled by " << getName() << llendl; + LL_INFOS() << "Key handled by " << getName() << LL_ENDL; } } } @@ -957,7 +957,7 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) handled = handleUnicodeCharHere(uni_char); if (handled && LLView::sDebugKeys) { - llinfos << "Unicode key handled by " << getName() << llendl; + LL_INFOS() << "Unicode key handled by " << getName() << LL_ENDL; } } } @@ -1130,7 +1130,7 @@ void LLView::drawChildren() // Check for bogus rectangle if (!getRect().isValid()) { - llwarns << "Bogus rectangle for " << getName() << " with " << mRect << llendl; + LL_WARNS() << "Bogus rectangle for " << getName() << " with " << mRect << LL_ENDL; } } } @@ -2000,7 +2000,7 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna } break; default: - llerrs << "Invalid snap edge" << llendl; + LL_ERRS() << "Invalid snap edge" << LL_ENDL; } } @@ -2102,7 +2102,7 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna } break; default: - llerrs << "Invalid snap edge" << llendl; + LL_ERRS() << "Invalid snap edge" << LL_ENDL; } } } @@ -2429,7 +2429,7 @@ static S32 invert_vertical(S32 y, LLView* parent) } else { - llwarns << "Attempting to convert layout to top-left with no parent" << llendl; + LL_WARNS() << "Attempting to convert layout to top-left with no parent" << LL_ENDL; return y; } } diff --git a/indra/llui/llview.h b/indra/llui/llview.h index cd23ce7df1..e224233c3c 100755 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -709,7 +709,7 @@ template T* LLView::getChild(const std::string& name, BOOL recurse) co // did we find *something* with that name? if (child) { - llwarns << "Found child named \"" << name << "\" but of wrong type " << typeid(*child).name() << ", expecting " << typeid(T*).name() << llendl; + LL_WARNS() << "Found child named \"" << name << "\" but of wrong type " << typeid(*child).name() << ", expecting " << typeid(T*).name() << LL_ENDL; } result = getDefaultWidget(name); if (!result) @@ -721,11 +721,11 @@ template T* LLView::getChild(const std::string& name, BOOL recurse) co // *NOTE: You cannot call mFoo = getChild("bar") // in a floater or panel constructor. The widgets will not // be ready. Instead, put it in postBuild(). - llwarns << "Making dummy " << typeid(T).name() << " named \"" << name << "\" in " << getName() << llendl; + LL_WARNS() << "Making dummy " << typeid(T).name() << " named \"" << name << "\" in " << getName() << LL_ENDL; } else { - llwarns << "Failed to create dummy " << typeid(T).name() << llendl; + LL_WARNS() << "Failed to create dummy " << typeid(T).name() << LL_ENDL; return NULL; } -- cgit v1.2.3 From cc31b4ae7934010762b8aaaa7e190c74a1cd7820 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 12 Aug 2013 20:05:16 -0700 Subject: SH-4399 FIX: Interesting: Texture console MB Bound 0/384 and texture queue bounces once per second SH-4346 FIX: Interesting: some integer Statistics are displayed as floating point after crossing region boundary made llerrs/infos/etc properly variadic wrt tags LL_INFOS("A", "B", "C") works, for example fixed unit tests remove llsimplestat --- indra/llui/llstatbar.cpp | 600 +++++++++++++++++++++++++-------------------- indra/llui/llstatbar.h | 11 +- indra/llui/llxuiparser.cpp | 10 +- 3 files changed, 353 insertions(+), 268 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index ee73cfa40d..900f81992c 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -160,7 +160,8 @@ LLStatBar::LLStatBar(const Params& p) mOrientation(p.orientation), mAutoScaleMax(!p.bar_max.isProvided()), mAutoScaleMin(!p.bar_min.isProvided()), - mTickValue(p.tick_spacing) + mTickValue(p.tick_spacing), + mLastDisplayValue(0.f) { // tick value will be automatically calculated later if (!p.tick_spacing.isProvided() && p.bar_min.isProvided() && p.bar_max.isProvided()) @@ -219,323 +220,281 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) return TRUE; } -void LLStatBar::draw() +template +S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const LLUnit time_period) { - F32 current = 0, - min = 0, - max = 0, - mean = 0; + LLUnit elapsed_time, + time_since_value_changed; + S32 num_rapid_changes = 0; + const LLUnit RAPID_CHANGE_THRESHOLD = LLUnits::Seconds::fromValue(0.3f); - bool show_data = false; - - LLLocalClipRect _(getLocalRect()); - LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); + F64 last_value = periodic_recording.getPrevRecording(1).getLastValue(stat); + for (S32 i = 2; i < periodic_recording.getNumRecordedPeriods(); i++) + { + LLTrace::Recording& recording = periodic_recording.getPrevRecording(i); + F64 cur_value = recording.getLastValue(stat); - S32 num_frames = mDisplayHistory ? mNumHistoryFrames : mNumShortHistoryFrames; + if (last_value != cur_value) + { + if (time_since_value_changed < RAPID_CHANGE_THRESHOLD) num_rapid_changes++; + time_since_value_changed = 0; + } + last_value = cur_value; - std::string unit_label; - if (mCountFloatp) - { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - unit_label = mUnitLabel.empty() ? mCountFloatp->getUnitLabel() : mUnitLabel; - unit_label += "/s"; - current = last_frame_recording.getPerSec(*mCountFloatp); - min = frame_recording.getPeriodMinPerSec(*mCountFloatp, num_frames); - max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, num_frames); - mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp, num_frames); - - // always show count-style data - show_data = true; + elapsed_time += recording.getDuration(); + if (elapsed_time > time_period) break; } - else if (mEventFloatp) + + return num_rapid_changes; +} + +S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::TraceType& stat, const LLUnit time_period) +{ + LLUnit elapsed_time, + time_since_value_changed; + S32 num_rapid_changes = 0; + const LLUnit RAPID_CHANGE_THRESHOLD = LLUnits::Seconds::fromValue(0.3f); + + F64 last_value = periodic_recording.getPrevRecording(1).getSum(stat); + for (S32 i = 1; i < periodic_recording.getNumRecordedPeriods(); i++) { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - unit_label = mUnitLabel.empty() ? mEventFloatp->getUnitLabel() : mUnitLabel; + LLTrace::Recording& recording = periodic_recording.getPrevRecording(i); + F64 cur_value = recording.getSum(stat); - // only show data if there is an event in the relevant time period - current = last_frame_recording.getMean(*mEventFloatp); - min = frame_recording.getPeriodMin(*mEventFloatp, num_frames); - max = frame_recording.getPeriodMax(*mEventFloatp, num_frames); - mean = frame_recording.getPeriodMean(*mEventFloatp, num_frames); + if (last_value != cur_value) + { + if (time_since_value_changed < RAPID_CHANGE_THRESHOLD) num_rapid_changes++; + time_since_value_changed = 0; + } + last_value = cur_value; - show_data = frame_recording.getSampleCount(*mEventFloatp, num_frames) != 0; + elapsed_time += recording.getDuration(); + if (elapsed_time > time_period) break; } - else if (mSampleFloatp) - { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - unit_label = mUnitLabel.empty() ? mSampleFloatp->getUnitLabel() : mUnitLabel; + return num_rapid_changes; +} - current = last_frame_recording.getMean(*mSampleFloatp); - min = frame_recording.getPeriodMin(*mSampleFloatp, num_frames); - max = frame_recording.getPeriodMax(*mSampleFloatp, num_frames); - mean = frame_recording.getPeriodMean(*mSampleFloatp, num_frames); +void LLStatBar::draw() +{ + LLLocalClipRect _(getLocalRect()); - // always show sample data if we've ever grabbed any samples - show_data = last_frame_recording.hasValue(*mSampleFloatp); - } + LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); - S32 bar_top, bar_left, bar_right, bar_bottom; - if (mOrientation == HORIZONTAL) + std::string unit_label; + F32 current = 0, + min = 0, + max = 0, + mean = 0, + display_value = 0; + S32 num_frames = mDisplayHistory + ? mNumHistoryFrames + : mNumShortHistoryFrames; + S32 num_rapid_changes = 0; + + const S32 MAX_RAPID_CHANGES = 6; + const F32 MIN_VALUE_UPDATE_TIME = 1.f / 4.f; + const LLUnit CHANGE_WINDOW = LLUnits::Seconds::fromValue(2.f); + + if (mCountFloatp) { - bar_top = llmax(5, getRect().getHeight() - 15); - bar_left = 0; - bar_right = getRect().getWidth() - 40; - bar_bottom = llmin(bar_top - 5, 0); + const LLTrace::TraceType& count_stat = *mCountFloatp; + + unit_label = mUnitLabel.empty() ? (std::string(count_stat.getUnitLabel()) + "/s") : mUnitLabel; + current = last_frame_recording.getPerSec(count_stat); + min = frame_recording.getPeriodMinPerSec(count_stat, num_frames); + max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames); + mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames); + num_rapid_changes = calc_num_rapid_changes(frame_recording, count_stat, CHANGE_WINDOW); } - else // VERTICAL + else if (mEventFloatp) { - bar_top = llmax(5, getRect().getHeight() - 15); - bar_left = 0; - bar_right = getRect().getWidth(); - bar_bottom = llmin(bar_top - 5, 20); - } - const S32 tick_length = 4; - const S32 tick_width = 1; + const LLTrace::TraceType& event_stat = *mEventFloatp; - if ((mAutoScaleMax && max >= mCurMaxBar)|| (mAutoScaleMin && min <= mCurMinBar)) - { - F32 range_min = mAutoScaleMin ? llmin(mMinBar, min) : mMinBar; - F32 range_max = mAutoScaleMax ? llmax(mMaxBar, max) : mMaxBar; - F32 tick_value = 0.f; - calc_auto_scale_range(range_min, range_max, tick_value); - if (mAutoScaleMin) { mMinBar = range_min; } - if (mAutoScaleMax) { mMaxBar = range_max; } - if (mAutoScaleMin && mAutoScaleMax) - { - mTickValue = tick_value; - } - else - { - mTickValue = calc_tick_value(mMinBar, mMaxBar); - } + unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel; + + current = last_frame_recording.getLastValue(event_stat); + min = frame_recording.getPeriodMin(event_stat, num_frames); + max = frame_recording.getPeriodMax(event_stat, num_frames); + mean = frame_recording.getPeriodMean(event_stat, num_frames); + num_rapid_changes = calc_num_rapid_changes(frame_recording, event_stat, CHANGE_WINDOW); } + else if (mSampleFloatp) + { + const LLTrace::TraceType& sample_stat = *mSampleFloatp; - mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mMaxBar, 0.05f); - mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mMinBar, 0.05f); + unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel; - F32 value_scale; - if (mCurMaxBar == mCurMinBar) - { - value_scale = 0.f; + current = last_frame_recording.getLastValue(sample_stat); + min = frame_recording.getPeriodMin(sample_stat, num_frames); + max = frame_recording.getPeriodMax(sample_stat, num_frames); + mean = frame_recording.getPeriodMean(sample_stat, num_frames); + num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, CHANGE_WINDOW); } - else + + if (mLastDisplayValueTimer.getElapsedTimeF32() > MIN_VALUE_UPDATE_TIME) { - value_scale = (mOrientation == HORIZONTAL) - ? (bar_top - bar_bottom)/(mCurMaxBar - mCurMinBar) - : (bar_right - bar_left)/(mCurMaxBar - mCurMinBar); + mLastDisplayValueTimer.reset(); + display_value = (num_rapid_changes > MAX_RAPID_CHANGES) + ? mean + : current; + mLastDisplayValue = display_value; } - - LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), - LLFontGL::LEFT, LLFontGL::TOP); - - S32 decimal_digits = mDecimalDigits; - if (is_approx_equal((F32)(S32)mean, mean)) + else { - decimal_digits = 0; + display_value = mLastDisplayValue; } - std::string value_str = show_data - ? llformat("%10.*f %s", decimal_digits, mean, unit_label.c_str()) - : "n/a"; - // Draw the current value. + LLRect bar_rect; 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); + bar_rect.mTop = llmax(5, getRect().getHeight() - 15); + bar_rect.mLeft = 0; + bar_rect.mRight = getRect().getWidth() - 40; + bar_rect.mBottom = llmin(bar_rect.mTop - 5, 0); } - else + else // VERTICAL { - LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, bar_right, getRect().getHeight(), - LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::RIGHT, LLFontGL::TOP); + bar_rect.mTop = llmax(5, getRect().getHeight() - 15); + bar_rect.mLeft = 0; + bar_rect.mRight = getRect().getWidth(); + bar_rect.mBottom = llmin(bar_rect.mTop - 5, 20); } + mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mMaxBar, 0.05f); + mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mMinBar, 0.05f); + + drawLabelAndValue(display_value, unit_label, bar_rect); + if (mDisplayBar && (mCountFloatp || mEventFloatp || mSampleFloatp)) { // Draw the tick marks. LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - S32 last_tick = 0; - S32 last_label = 0; - const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30; - const S32 MIN_LABEL_SPACING = mOrientation == HORIZONTAL ? 30 : 60; - // start counting from actual min, not current, animating min, so that ticks don't float between numbers - // ensure ticks always hit 0 - if (mTickValue > 0.f) + + F32 value_scale; + if (mCurMaxBar == mCurMinBar) + { + value_scale = 0.f; + } + else { - F32 start = mCurMinBar < 0.f - ? llceil(-mCurMinBar / mTickValue) * -mTickValue - : 0.f; - for (F32 tick_value = start; ;tick_value += mTickValue) + value_scale = (mOrientation == HORIZONTAL) + ? (bar_rect.getHeight())/(mCurMaxBar - mCurMinBar) + : (bar_rect.getWidth())/(mCurMaxBar - mCurMinBar); + } + + drawTicks(min, max, value_scale, bar_rect); + + // draw background bar. + gl_rect_2d(bar_rect.mLeft, bar_rect.mTop, bar_rect.mRight, bar_rect.mBottom, LLColor4(0.f, 0.f, 0.f, 0.25f)); + + // draw values + if (!llisnan(display_value) && frame_recording.getNumRecordedPeriods() != 0) + { + // draw min and max + S32 begin = (S32) ((min - mCurMinBar) * value_scale); + + if (begin < 0) { - const S32 begin = llfloor((tick_value - mCurMinBar)*value_scale); - const S32 end = begin + tick_width; - if (begin - last_tick < MIN_TICK_SPACING) - { - continue; - } - last_tick = begin; + begin = 0; + } - S32 decimal_digits = mDecimalDigits; - if (is_approx_equal((F32)(S32)tick_value, tick_value)) - { - decimal_digits = 0; - } - std::string tick_string = llformat("%10.*f", decimal_digits, tick_value); + S32 end = (S32) ((max - mCurMinBar) * value_scale); + if (mOrientation == HORIZONTAL) + { + gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight, begin, LLColor4(1.f, 0.f, 0.f, 0.25f)); + } + else // VERTICAL + { + gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom, LLColor4(1.f, 0.f, 0.f, 0.25f)); + } - if (mOrientation == HORIZONTAL) + F32 span = (mOrientation == HORIZONTAL) + ? (bar_rect.getWidth()) + : (bar_rect.getHeight()); + + if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) + { + const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; + F32 value = 0; + S32 i; + gGL.color4f( 1.f, 0.f, 0.f, 1.f ); + gGL.begin( LLRender::QUADS ); + const S32 max_frame = llmin(num_frames, num_values); + U32 num_samples = 0; + for (i = 1; i <= max_frame; i++) { - if (begin - last_label > MIN_LABEL_SPACING) + F32 offset = ((F32)i / (F32)num_frames) * span; + LLTrace::Recording& recording = frame_recording.getPrevRecording(i); + + if (mCountFloatp) { - gl_rect_2d(bar_left, end, bar_right - tick_length, begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); - LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, bar_right, begin, - LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::LEFT, LLFontGL::VCENTER); - last_label = begin; + value = recording.getPerSec(*mCountFloatp); + num_samples = recording.getSampleCount(*mCountFloatp); } - else + else if (mEventFloatp) { - gl_rect_2d(bar_left, end, bar_right - tick_length/2, begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); + value = recording.getMean(*mEventFloatp); + num_samples = recording.getSampleCount(*mEventFloatp); } - } - else - { - if (begin - last_label > MIN_LABEL_SPACING) + else if (mSampleFloatp) + { + value = recording.getMean(*mSampleFloatp); + num_samples = recording.getSampleCount(*mSampleFloatp); + } + + if (!num_samples) continue; + + F32 begin = (value - mCurMinBar) * value_scale; + if (mOrientation == HORIZONTAL) { - gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length, LLColor4(1.f, 1.f, 1.f, 0.25f)); - LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, begin - 1, bar_bottom - tick_length, - LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::RIGHT, LLFontGL::TOP); - last_label = begin; + gGL.vertex2f((F32)bar_rect.mRight - offset, begin + 1); + gGL.vertex2f((F32)bar_rect.mRight - offset, begin); + gGL.vertex2f((F32)bar_rect.mRight - offset - 1, begin); + gGL.vertex2f((F32)bar_rect.mRight - offset - 1, begin + 1); } else { - gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length/2, LLColor4(1.f, 1.f, 1.f, 0.1f)); + gGL.vertex2f(begin, (F32)bar_rect.mBottom + offset + 1); + gGL.vertex2f(begin, (F32)bar_rect.mBottom + offset); + gGL.vertex2f(begin + 1, (F32)bar_rect.mBottom + offset); + gGL.vertex2f(begin + 1, (F32)bar_rect.mBottom + offset + 1 ); } } - // always draw one tick value past end, so we can see part of the text, if possible - if (tick_value > mCurMaxBar) + gGL.end(); + } + else + { + S32 begin = (S32) ((current - mCurMinBar) * value_scale) - 1; + S32 end = (S32) ((current - mCurMinBar) * value_scale) + 1; + // draw current + if (mOrientation == HORIZONTAL) + { + gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight, begin, LLColor4(1.f, 0.f, 0.f, 1.f)); + } + else { - break; + gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom, LLColor4(1.f, 0.f, 0.f, 1.f)); } } - } - - // draw background bar. - gl_rect_2d(bar_left, bar_top, bar_right, bar_bottom, LLColor4(0.f, 0.f, 0.f, 0.25f)); - - if (frame_recording.getNumRecordedPeriods() == 0) - { - // No data, don't draw anything... - return; - } - // draw min and max - S32 begin = (S32) ((min - mCurMinBar) * value_scale); - - if (begin < 0) - { - begin = 0; - } - - S32 end = (S32) ((max - mCurMinBar) * 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)); + // draw mean bar + { + const S32 begin = (S32) ((mean - mCurMinBar) * value_scale) - 1; + const S32 end = (S32) ((mean - mCurMinBar) * value_scale) + 1; + if (mOrientation == HORIZONTAL) + { + gl_rect_2d(bar_rect.mLeft - 2, begin, bar_rect.mRight + 2, end, LLColor4(0.f, 1.f, 0.f, 1.f)); + } + else + { + gl_rect_2d(begin, bar_rect.mTop + 2, end, bar_rect.mBottom - 2, LLColor4(0.f, 1.f, 0.f, 1.f)); + } + } } - - if (show_data) - { - F32 span = (mOrientation == HORIZONTAL) - ? (bar_right - bar_left) - : (bar_top - bar_bottom); - - if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) - { - const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; - F32 value = 0; - S32 i; - gGL.color4f( 1.f, 0.f, 0.f, 1.f ); - gGL.begin( LLRender::QUADS ); - const S32 max_frame = llmin(num_frames, num_values); - U32 num_samples = 0; - for (i = 1; i <= max_frame; i++) - { - F32 offset = ((F32)i / (F32)num_frames) * span; - LLTrace::Recording& recording = frame_recording.getPrevRecording(i); - - if (mCountFloatp) - { - value = recording.getPerSec(*mCountFloatp); - num_samples = recording.getSampleCount(*mCountFloatp); - } - else if (mEventFloatp) - { - value = recording.getMean(*mEventFloatp); - num_samples = recording.getSampleCount(*mEventFloatp); - } - else if (mSampleFloatp) - { - value = recording.getMean(*mSampleFloatp); - num_samples = recording.getSampleCount(*mSampleFloatp); - } - - if (!num_samples) continue; - - F32 begin = (value - mCurMinBar) * value_scale; - if (mOrientation == HORIZONTAL) - { - gGL.vertex2f((F32)bar_right - offset, begin + 1); - gGL.vertex2f((F32)bar_right - offset, begin); - gGL.vertex2f((F32)bar_right - offset - 1, begin); - gGL.vertex2f((F32)bar_right - offset - 1, begin + 1); - } - else - { - gGL.vertex2f(begin, (F32)bar_bottom + offset + 1); - gGL.vertex2f(begin, (F32)bar_bottom + offset); - gGL.vertex2f(begin + 1, (F32)bar_bottom + offset); - gGL.vertex2f(begin + 1, (F32)bar_bottom + offset + 1 ); - } - } - gGL.end(); - } - else - { - S32 begin = (S32) ((current - mCurMinBar) * value_scale) - 1; - S32 end = (S32) ((current - mCurMinBar) * value_scale) + 1; - // draw current - 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 - { - const S32 begin = (S32) ((mean - mCurMinBar) * value_scale) - 1; - const S32 end = (S32) ((mean - mCurMinBar) * 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(); @@ -578,3 +537,124 @@ LLRect LLStatBar::getRequiredRect() return rect; } +void LLStatBar::drawLabelAndValue( F32 value, std::string &label, LLRect &bar_rect ) +{ + LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), + LLFontGL::LEFT, LLFontGL::TOP); + + S32 decimal_digits = mDecimalDigits; + if (is_approx_equal((F32)(S32)value, value)) + { + decimal_digits = 0; + } + std::string value_str = !llisnan(value) + ? llformat("%10.*f %s", decimal_digits, value, label.c_str()) + : "n/a"; + + // Draw the current value. + if (mOrientation == HORIZONTAL) + { + LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, bar_rect.mRight, getRect().getHeight(), + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::RIGHT, LLFontGL::TOP); + } + else + { + LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, bar_rect.mRight, getRect().getHeight(), + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::RIGHT, LLFontGL::TOP); + } +} + +void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) +{ + if ((mAutoScaleMax && max >= mCurMaxBar)|| (mAutoScaleMin && min <= mCurMinBar)) + { + F32 range_min = mAutoScaleMin ? llmin(mMinBar, min) : mMinBar; + F32 range_max = mAutoScaleMax ? llmax(mMaxBar, max) : mMaxBar; + F32 tick_value = 0.f; + calc_auto_scale_range(range_min, range_max, tick_value); + if (mAutoScaleMin) { mMinBar = range_min; } + if (mAutoScaleMax) { mMaxBar = range_max; } + if (mAutoScaleMin && mAutoScaleMax) + { + mTickValue = tick_value; + } + else + { + mTickValue = calc_tick_value(mMinBar, mMaxBar); + } + } + + // start counting from actual min, not current, animating min, so that ticks don't float between numbers + // ensure ticks always hit 0 + S32 last_tick = 0; + S32 last_label = 0; + if (mTickValue > 0.f && value_scale > 0.f) + { + const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30; + const S32 MIN_LABEL_SPACING = mOrientation == HORIZONTAL ? 30 : 60; + const S32 TICK_LENGTH = 4; + const S32 TICK_WIDTH = 1; + + F32 start = mCurMinBar < 0.f + ? llceil(-mCurMinBar / mTickValue) * -mTickValue + : 0.f; + for (F32 tick_value = start; ;tick_value += mTickValue) + { + const S32 begin = llfloor((tick_value - mCurMinBar)*value_scale); + const S32 end = begin + TICK_WIDTH; + if (begin - last_tick < MIN_TICK_SPACING) + { + continue; + } + last_tick = begin; + + S32 decimal_digits = mDecimalDigits; + if (is_approx_equal((F32)(S32)tick_value, tick_value)) + { + decimal_digits = 0; + } + std::string tick_string = llformat("%10.*f", decimal_digits, tick_value); + + if (mOrientation == HORIZONTAL) + { + if (begin - last_label > MIN_LABEL_SPACING) + { + gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight - TICK_LENGTH, begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); + LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, bar_rect.mRight, begin, + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::LEFT, LLFontGL::VCENTER); + last_label = begin; + } + else + { + gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight - TICK_LENGTH/2, begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); + } + } + else + { + if (begin - last_label > MIN_LABEL_SPACING) + { + gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f)); + LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, begin - 1, bar_rect.mBottom - TICK_LENGTH, + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::RIGHT, LLFontGL::TOP); + last_label = begin; + } + else + { + gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom - TICK_LENGTH/2, LLColor4(1.f, 1.f, 1.f, 0.1f)); + } + } + // always draw one tick value past end, so we can see part of the text, if possible + if (tick_value > mCurMaxBar) + { + break; + } + } + } +} + + + diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 5aed98fecf..dd4d9400a5 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -89,6 +89,9 @@ public: /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. private: + void drawLabelAndValue( F32 mean, std::string &unit_label, LLRect &bar_rect ); + void drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ); + F32 mMinBar, mMaxBar, mCurMaxBar, @@ -104,10 +107,12 @@ private: mAutoScaleMax, mAutoScaleMin; EOrientation mOrientation; + F32 mLastDisplayValue; + LLFrameTimer mLastDisplayValueTimer; - LLTrace::TraceType* mCountFloatp; - LLTrace::TraceType* mEventFloatp; - LLTrace::TraceType* mSampleFloatp; + const LLTrace::TraceType* mCountFloatp; + const LLTrace::TraceType* mEventFloatp; + const LLTrace::TraceType* mSampleFloatp; LLUIString mLabel; std::string mUnitLabel; diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 4cbf84be73..6a1f937340 100755 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -1313,7 +1313,7 @@ void LLXUIParser::parserWarning(const std::string& message) { #ifdef LL_WINDOWS // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str())); + LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL; #else Parser::parserWarning(message); #endif @@ -1322,8 +1322,8 @@ void LLXUIParser::parserWarning(const std::string& message) void LLXUIParser::parserError(const std::string& message) { #ifdef LL_WINDOWS - // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str())); + // use Visual Studio friendly formatting of output message for easy access to originating xml + LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL; #else Parser::parserError(message); #endif @@ -1641,7 +1641,7 @@ void LLSimpleXUIParser::parserWarning(const std::string& message) { #ifdef LL_WINDOWS // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str())); + LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL; #else Parser::parserWarning(message); #endif @@ -1651,7 +1651,7 @@ void LLSimpleXUIParser::parserError(const std::string& message) { #ifdef LL_WINDOWS // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str())); + LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL; #else Parser::parserError(message); #endif -- cgit v1.2.3 From 9faaa28f4445425e8c5b7b002faffbe0365b905d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 13 Aug 2013 18:33:07 -0700 Subject: SH-4346 FIX Interesting: some integer Statistics are displayed as floating point after crossing region boundary fine-tuned heuristics for switching between mean and current values in stat bar display added comments to LLUnits unit test --- indra/llui/llstatbar.cpp | 107 ++++++++++++++++++++++++++++++----------------- indra/llui/llstatbar.h | 19 +-------- 2 files changed, 70 insertions(+), 56 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 900f81992c..b564ad5cee 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -41,6 +41,16 @@ #include "lllocalcliprect.h" #include +// rate at which to update display of value that is rapidly changing +const F32 MEAN_VALUE_UPDATE_TIME = 1.f / 4.f; +// time between value changes that qualifies as a "rapid change" +const LLUnit RAPID_CHANGE_THRESHOLD = 0.2f; +// maximum number of rapid changes in RAPID_CHANGE_WINDOW before switching over to displaying the mean +// instead of latest value +const S32 MAX_RAPID_CHANGES_PER_SEC = 10; +// period of time over which to measure rapid changes +const LLUnit RAPID_CHANGE_WINDOW = 1.f; + F32 calc_tick_value(F32 min, F32 max) { F32 range = max - min; @@ -141,6 +151,25 @@ void calc_auto_scale_range(F32& min, F32& max, F32& tick) max = out_max; } +LLStatBar::Params::Params() +: label("label"), + unit_label("unit_label"), + bar_min("bar_min", 0.f), + bar_max("bar_max", 0.f), + tick_spacing("tick_spacing", 0.f), + decimal_digits("decimal_digits", 3), + show_bar("show_bar", false), + show_history("show_history", false), + scale_range("scale_range", true), + num_frames("num_frames", 200), + num_frames_short("num_frames_short", 20), + max_height("max_height", 100), + stat("stat"), + orientation("orientation", VERTICAL) +{ + changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT); +} + /////////////////////////////////////////////////////////////////////////////////// LLStatBar::LLStatBar(const Params& p) @@ -253,7 +282,6 @@ S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLUnit elapsed_time, time_since_value_changed; S32 num_rapid_changes = 0; - const LLUnit RAPID_CHANGE_THRESHOLD = LLUnits::Seconds::fromValue(0.3f); F64 last_value = periodic_recording.getPrevRecording(1).getSum(stat); for (S32 i = 1; i < periodic_recording.getNumRecordedPeriods(); i++) @@ -293,57 +321,50 @@ void LLStatBar::draw() : mNumShortHistoryFrames; S32 num_rapid_changes = 0; - const S32 MAX_RAPID_CHANGES = 6; - const F32 MIN_VALUE_UPDATE_TIME = 1.f / 4.f; - const LLUnit CHANGE_WINDOW = LLUnits::Seconds::fromValue(2.f); - if (mCountFloatp) { const LLTrace::TraceType& count_stat = *mCountFloatp; - unit_label = mUnitLabel.empty() ? (std::string(count_stat.getUnitLabel()) + "/s") : mUnitLabel; - current = last_frame_recording.getPerSec(count_stat); - min = frame_recording.getPeriodMinPerSec(count_stat, num_frames); - max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames); - mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames); - num_rapid_changes = calc_num_rapid_changes(frame_recording, count_stat, CHANGE_WINDOW); + unit_label = mUnitLabel.empty() ? (std::string(count_stat.getUnitLabel()) + "/s") : mUnitLabel; + current = last_frame_recording.getPerSec(count_stat); + min = frame_recording.getPeriodMinPerSec(count_stat, num_frames); + max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames); + mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames); + display_value = mean; } else if (mEventFloatp) { const LLTrace::TraceType& event_stat = *mEventFloatp; - unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel; - - current = last_frame_recording.getLastValue(event_stat); - min = frame_recording.getPeriodMin(event_stat, num_frames); - max = frame_recording.getPeriodMax(event_stat, num_frames); - mean = frame_recording.getPeriodMean(event_stat, num_frames); - num_rapid_changes = calc_num_rapid_changes(frame_recording, event_stat, CHANGE_WINDOW); + unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel; + current = last_frame_recording.getLastValue(event_stat); + min = frame_recording.getPeriodMin(event_stat, num_frames); + max = frame_recording.getPeriodMax(event_stat, num_frames); + mean = frame_recording.getPeriodMean(event_stat, num_frames); + num_rapid_changes = calc_num_rapid_changes(frame_recording, event_stat, RAPID_CHANGE_WINDOW); + display_value = mean; } else if (mSampleFloatp) { const LLTrace::TraceType& sample_stat = *mSampleFloatp; - unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel; + unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel; + current = last_frame_recording.getLastValue(sample_stat); + min = frame_recording.getPeriodMin(sample_stat, num_frames); + max = frame_recording.getPeriodMax(sample_stat, num_frames); + mean = frame_recording.getPeriodMean(sample_stat, num_frames); + num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW); - current = last_frame_recording.getLastValue(sample_stat); - min = frame_recording.getPeriodMin(sample_stat, num_frames); - max = frame_recording.getPeriodMax(sample_stat, num_frames); - mean = frame_recording.getPeriodMean(sample_stat, num_frames); - num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, CHANGE_WINDOW); - } - - if (mLastDisplayValueTimer.getElapsedTimeF32() > MIN_VALUE_UPDATE_TIME) - { - mLastDisplayValueTimer.reset(); - display_value = (num_rapid_changes > MAX_RAPID_CHANGES) - ? mean - : current; - mLastDisplayValue = display_value; - } - else - { - display_value = mLastDisplayValue; + if (num_rapid_changes / RAPID_CHANGE_WINDOW > MAX_RAPID_CHANGES_PER_SEC) + { + display_value = mean; + } + else + { + display_value = current; + // always display current value, don't rate limit + mLastDisplayValue = current; + } } LLRect bar_rect; @@ -365,7 +386,17 @@ void LLStatBar::draw() mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mMaxBar, 0.05f); mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mMinBar, 0.05f); - drawLabelAndValue(display_value, unit_label, bar_rect); + // rate limited updates + if (mLastDisplayValueTimer.getElapsedTimeF32() > MEAN_VALUE_UPDATE_TIME) + { + mLastDisplayValueTimer.reset(); + drawLabelAndValue(display_value, unit_label, bar_rect); + mLastDisplayValue = display_value; + } + else + { + drawLabelAndValue(mLastDisplayValue, unit_label, bar_rect); + } if (mDisplayBar && (mCountFloatp || mEventFloatp || mSampleFloatp)) diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index dd4d9400a5..bf2bd3e259 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -56,24 +56,7 @@ public: Optional stat; Optional orientation; - Params() - : label("label"), - unit_label("unit_label"), - bar_min("bar_min", 0.f), - bar_max("bar_max", 0.f), - tick_spacing("tick_spacing", 0.f), - decimal_digits("decimal_digits", 3), - show_bar("show_bar", false), - show_history("show_history", false), - scale_range("scale_range", true), - num_frames("num_frames", 200), - num_frames_short("num_frames_short", 20), - max_height("max_height", 100), - stat("stat"), - orientation("orientation", VERTICAL) - { - changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT); - } + Params(); }; LLStatBar(const Params&); -- cgit v1.2.3 From 26581404e426b00cd0a07c38b5cb858d5d5faa28 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 14 Aug 2013 11:51:49 -0700 Subject: BUILDFIX: added header for numeric_limits support on gcc added convenience types for units F32Seconds, etc. --- indra/llui/llstatbar.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index b564ad5cee..5857e32821 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -44,12 +44,12 @@ // rate at which to update display of value that is rapidly changing const F32 MEAN_VALUE_UPDATE_TIME = 1.f / 4.f; // time between value changes that qualifies as a "rapid change" -const LLUnit RAPID_CHANGE_THRESHOLD = 0.2f; +const LLUnits::F32Seconds RAPID_CHANGE_THRESHOLD(0.2f); // maximum number of rapid changes in RAPID_CHANGE_WINDOW before switching over to displaying the mean // instead of latest value const S32 MAX_RAPID_CHANGES_PER_SEC = 10; // period of time over which to measure rapid changes -const LLUnit RAPID_CHANGE_WINDOW = 1.f; +const LLUnits::F32Seconds RAPID_CHANGE_WINDOW(1.f); F32 calc_tick_value(F32 min, F32 max) { @@ -250,12 +250,12 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) } template -S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const LLUnit time_period) +S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const LLUnits::F32Seconds time_period) { - LLUnit elapsed_time, + LLUnits::F32Seconds elapsed_time, time_since_value_changed; S32 num_rapid_changes = 0; - const LLUnit RAPID_CHANGE_THRESHOLD = LLUnits::Seconds::fromValue(0.3f); + const LLUnits::F32Seconds RAPID_CHANGE_THRESHOLD = LLUnits::F32Seconds(0.3f); F64 last_value = periodic_recording.getPrevRecording(1).getLastValue(stat); for (S32 i = 2; i < periodic_recording.getNumRecordedPeriods(); i++) @@ -277,9 +277,9 @@ S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const return num_rapid_changes; } -S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::TraceType& stat, const LLUnit time_period) +S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::TraceType& stat, const LLUnits::F32Seconds time_period) { - LLUnit elapsed_time, + LLUnits::F32Seconds elapsed_time, time_since_value_changed; S32 num_rapid_changes = 0; -- cgit v1.2.3 From 9f7bfa1c3710856cd2b0a0a8a429d6c45b0fcd09 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 15 Aug 2013 00:02:23 -0700 Subject: moved unit types out of LLUnits namespace, since they are prefixed --- indra/llui/llstatbar.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 5857e32821..4c64cc944e 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -44,12 +44,12 @@ // rate at which to update display of value that is rapidly changing const F32 MEAN_VALUE_UPDATE_TIME = 1.f / 4.f; // time between value changes that qualifies as a "rapid change" -const LLUnits::F32Seconds RAPID_CHANGE_THRESHOLD(0.2f); +const F32Seconds RAPID_CHANGE_THRESHOLD(0.2f); // maximum number of rapid changes in RAPID_CHANGE_WINDOW before switching over to displaying the mean // instead of latest value const S32 MAX_RAPID_CHANGES_PER_SEC = 10; // period of time over which to measure rapid changes -const LLUnits::F32Seconds RAPID_CHANGE_WINDOW(1.f); +const F32Seconds RAPID_CHANGE_WINDOW(1.f); F32 calc_tick_value(F32 min, F32 max) { @@ -250,12 +250,12 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) } template -S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const LLUnits::F32Seconds time_period) +S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const F32Seconds time_period) { - LLUnits::F32Seconds elapsed_time, + F32Seconds elapsed_time, time_since_value_changed; S32 num_rapid_changes = 0; - const LLUnits::F32Seconds RAPID_CHANGE_THRESHOLD = LLUnits::F32Seconds(0.3f); + const F32Seconds RAPID_CHANGE_THRESHOLD = F32Seconds(0.3f); F64 last_value = periodic_recording.getPrevRecording(1).getLastValue(stat); for (S32 i = 2; i < periodic_recording.getNumRecordedPeriods(); i++) @@ -277,9 +277,9 @@ S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const return num_rapid_changes; } -S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::TraceType& stat, const LLUnits::F32Seconds time_period) +S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::TraceType& stat, const F32Seconds time_period) { - LLUnits::F32Seconds elapsed_time, + F32Seconds elapsed_time, time_since_value_changed; S32 num_rapid_changes = 0; -- cgit v1.2.3 From 25937040de9a787c221aae7f178f43827c799028 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 16 Aug 2013 12:38:12 -0700 Subject: SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms converted many values over to units system in effort to track down source of 0 ping --- indra/llui/llscrolllistctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index f335b5dec3..224c2b918d 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1443,7 +1443,7 @@ void LLScrollListCtrl::drawItems() LLColor4 highlight_color = LLColor4::white; static LLUICachedControl type_ahead_timeout ("TypeAheadTimeout", 0); - highlight_color.mV[VALPHA] = clamp_rescale(mSearchTimer.getElapsedTimeF32(), type_ahead_timeout * 0.7f, type_ahead_timeout, 0.4f, 0.f); + highlight_color.mV[VALPHA] = clamp_rescale(mSearchTimer.getElapsedTimeF32(), type_ahead_timeout * 0.7f, type_ahead_timeout(), 0.4f, 0.f); S32 first_line = mScrollLines; S32 last_line = llmin((S32)mItemList.size() - 1, mScrollLines + getLinesPerPage()); -- cgit v1.2.3 From 612892b45a3413b16e40c49d3bfde77a4ca927fd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 18 Aug 2013 22:30:27 -0700 Subject: SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms continued conversion to units system made units perform type promotion correctly and preserve type in arithmetic e.g. can now do LLVector3 in units added typedefs for remaining common unit types, including implicits --- indra/llui/llstatbar.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 4c64cc944e..03a2895289 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -253,7 +253,7 @@ template S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const F32Seconds time_period) { F32Seconds elapsed_time, - time_since_value_changed; + time_since_value_changed; S32 num_rapid_changes = 0; const F32Seconds RAPID_CHANGE_THRESHOLD = F32Seconds(0.3f); @@ -266,7 +266,7 @@ S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const if (last_value != cur_value) { if (time_since_value_changed < RAPID_CHANGE_THRESHOLD) num_rapid_changes++; - time_since_value_changed = 0; + time_since_value_changed = (F32Seconds)0; } last_value = cur_value; @@ -280,7 +280,7 @@ S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::TraceType& stat, const F32Seconds time_period) { F32Seconds elapsed_time, - time_since_value_changed; + time_since_value_changed; S32 num_rapid_changes = 0; F64 last_value = periodic_recording.getPrevRecording(1).getSum(stat); @@ -292,7 +292,7 @@ S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const if (last_value != cur_value) { if (time_since_value_changed < RAPID_CHANGE_THRESHOLD) num_rapid_changes++; - time_since_value_changed = 0; + time_since_value_changed = (F32Seconds)0; } last_value = cur_value; @@ -355,7 +355,7 @@ void LLStatBar::draw() mean = frame_recording.getPeriodMean(sample_stat, num_frames); num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW); - if (num_rapid_changes / RAPID_CHANGE_WINDOW > MAX_RAPID_CHANGES_PER_SEC) + if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC) { display_value = mean; } -- cgit v1.2.3 From 2c6bc5afa59a88136fd6de4ebf0cb99ea7cdef3f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 21 Aug 2013 14:06:57 -0700 Subject: SH-4433 WIP Interesting: Statistics > Ping Sim is always 0 ms made getPrimaryAccumulator return a reference since it was an always non-null pointer changed unit conversion to perform lazy division in order to avoid truncation of timer values --- indra/llui/llstatbar.cpp | 24 +++++++++++++----------- indra/llui/llstatbar.h | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 03a2895289..8658a2f968 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -386,17 +386,24 @@ void LLStatBar::draw() mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mMaxBar, 0.05f); mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mMinBar, 0.05f); + S32 decimal_digits = mDecimalDigits; + if (is_approx_equal((F32)(S32)display_value, display_value)) + { + decimal_digits = 0; + } + // rate limited updates - if (mLastDisplayValueTimer.getElapsedTimeF32() > MEAN_VALUE_UPDATE_TIME) + if (mLastDisplayValueTimer.getElapsedTimeF32() < MEAN_VALUE_UPDATE_TIME) { - mLastDisplayValueTimer.reset(); - drawLabelAndValue(display_value, unit_label, bar_rect); - mLastDisplayValue = display_value; + display_value = mLastDisplayValue; } else { - drawLabelAndValue(mLastDisplayValue, unit_label, bar_rect); + mLastDisplayValueTimer.reset(); } + drawLabelAndValue(display_value, unit_label, bar_rect, mDecimalDigits); + mLastDisplayValue = display_value; + if (mDisplayBar && (mCountFloatp || mEventFloatp || mSampleFloatp)) @@ -568,16 +575,11 @@ LLRect LLStatBar::getRequiredRect() return rect; } -void LLStatBar::drawLabelAndValue( F32 value, std::string &label, LLRect &bar_rect ) +void LLStatBar::drawLabelAndValue( F32 value, std::string &label, LLRect &bar_rect, S32 decimal_digits ) { LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), LLFontGL::LEFT, LLFontGL::TOP); - S32 decimal_digits = mDecimalDigits; - if (is_approx_equal((F32)(S32)value, value)) - { - decimal_digits = 0; - } std::string value_str = !llisnan(value) ? llformat("%10.*f %s", decimal_digits, value, label.c_str()) : "n/a"; diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index bf2bd3e259..f311e4a13c 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -72,7 +72,7 @@ public: /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. private: - void drawLabelAndValue( F32 mean, std::string &unit_label, LLRect &bar_rect ); + void drawLabelAndValue( F32 mean, std::string &unit_label, LLRect &bar_rect, S32 decimal_digits ); void drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ); F32 mMinBar, -- cgit v1.2.3 From cf014375b8b408d58bd35deb4e58e4369fb3bf62 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 22 Aug 2013 14:21:16 -0700 Subject: SH-4433 FIX: Interesting: Statistics > Ping Sim is always 0 ms removed bad assert fixed precision issues during int->unsigned int conversions and vice versa --- indra/llui/llstatbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 8658a2f968..3cd2e53001 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -401,7 +401,7 @@ void LLStatBar::draw() { mLastDisplayValueTimer.reset(); } - drawLabelAndValue(display_value, unit_label, bar_rect, mDecimalDigits); + drawLabelAndValue(display_value, unit_label, bar_rect, decimal_digits); mLastDisplayValue = display_value; -- cgit v1.2.3 From 662d6a17712fbba5cea0d9cf20f5a2f32e2dd537 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 26 Aug 2013 10:51:08 -0700 Subject: added compile time warnings to use of deprecated llinfos, llwarns, etc. --- indra/llui/llstatbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 3cd2e53001..725a835f7f 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -325,7 +325,7 @@ void LLStatBar::draw() { const LLTrace::TraceType& count_stat = *mCountFloatp; - unit_label = mUnitLabel.empty() ? (std::string(count_stat.getUnitLabel()) + "/s") : mUnitLabel; + unit_label = std::string(count_stat.getUnitLabel()) + "/s"; current = last_frame_recording.getPerSec(count_stat); min = frame_recording.getPeriodMinPerSec(count_stat, num_frames); max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames); -- cgit v1.2.3 From cbe397ad13665c7bc993e10d8fe1e4a876253378 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 5 Sep 2013 14:04:13 -0700 Subject: changed fast timer over to using macro another attempt to move mem stat into base class --- indra/llui/llfloater.cpp | 12 ++++++------ indra/llui/llfolderview.cpp | 16 ++++++++-------- indra/llui/llfolderviewitem.cpp | 4 ++-- indra/llui/llkeywords.cpp | 4 ++-- indra/llui/lllayoutstack.cpp | 4 ++-- indra/llui/llpanel.cpp | 22 +++++++++++----------- indra/llui/llscrolllistctrl.cpp | 8 ++++---- indra/llui/lltextbase.cpp | 18 +++++++++--------- indra/llui/lltextbase.h | 2 +- indra/llui/lltexteditor.cpp | 6 +++--- indra/llui/lltrans.cpp | 10 +++++----- indra/llui/lluictrl.cpp | 4 ++-- indra/llui/lluictrlfactory.cpp | 18 +++++++++--------- indra/llui/lluictrlfactory.h | 12 ++++++------ indra/llui/lluistring.cpp | 6 +++--- indra/llui/llview.cpp | 6 +++--- indra/llui/llview.h | 2 +- indra/llui/llviewmodel.cpp | 2 +- indra/llui/llviewmodel.h | 2 +- indra/llui/llxuiparser.cpp | 6 +++--- 20 files changed, 82 insertions(+), 82 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 7d0779d88d..7a71946290 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3124,8 +3124,8 @@ boost::signals2::connection LLFloater::setCloseCallback( const commit_signal_t:: return mCloseSignal.connect(cb); } -LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build"); -static LLFastTimer::DeclareTimer FTM_EXTERNAL_FLOATER_LOAD("Load Extern Floater Reference"); +LLTrace::TimeBlock POST_BUILD("Floater Post Build"); +static LLTrace::TimeBlock FTM_EXTERNAL_FLOATER_LOAD("Load Extern Floater Reference"); bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node) { @@ -3155,7 +3155,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str LLUICtrlFactory::instance().pushFileName(xml_filename); - LLFastTimer _(FTM_EXTERNAL_FLOATER_LOAD); + LL_RECORD_BLOCK_TIME(FTM_EXTERNAL_FLOATER_LOAD); if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml)) { LL_WARNS() << "Couldn't parse panel from: " << xml_filename << LL_ENDL; @@ -3232,7 +3232,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str BOOL result; { - LLFastTimer ft(POST_BUILD); + LL_RECORD_BLOCK_TIME(POST_BUILD); result = postBuild(); } @@ -3275,11 +3275,11 @@ bool LLFloater::isVisible(const LLFloater* floater) return floater && floater->getVisible(); } -static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters"); +static LLTrace::TimeBlock FTM_BUILD_FLOATERS("Build Floaters"); bool LLFloater::buildFromFile(const std::string& filename) { - LLFastTimer timer(FTM_BUILD_FLOATERS); + LL_RECORD_BLOCK_TIME(FTM_BUILD_FLOATERS); LLXMLNodePtr root; if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 5628baa4a1..419ad56e64 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -317,11 +317,11 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height ) return llround(mTargetHeight); } -static LLFastTimer::DeclareTimer FTM_FILTER("Filter Folder View"); +static LLTrace::TimeBlock FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { - LLFastTimer t2(FTM_FILTER); + LL_RECORD_BLOCK_TIME(FTM_FILTER); filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); getViewModelItem()->filter(filter); @@ -480,10 +480,10 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected) return rv; } -static LLFastTimer::DeclareTimer FTM_SANITIZE_SELECTION("Sanitize Selection"); +static LLTrace::TimeBlock FTM_SANITIZE_SELECTION("Sanitize Selection"); void LLFolderView::sanitizeSelection() { - LLFastTimer _(FTM_SANITIZE_SELECTION); + LL_RECORD_BLOCK_TIME(FTM_SANITIZE_SELECTION); // store off current item in case it is automatically deselected // and we want to preserve context LLFolderViewItem* original_selected_item = getCurSelectedItem(); @@ -1586,15 +1586,15 @@ void LLFolderView::setShowSingleSelection(BOOL show) } } -static LLFastTimer::DeclareTimer FTM_AUTO_SELECT("Open and Select"); -static LLFastTimer::DeclareTimer FTM_INVENTORY("Inventory"); +static LLTrace::TimeBlock FTM_AUTO_SELECT("Open and Select"); +static LLTrace::TimeBlock FTM_INVENTORY("Inventory"); // Main idle routine void LLFolderView::update() { // If this is associated with the user's inventory, don't do anything // until that inventory is loaded up. - LLFastTimer t2(FTM_INVENTORY); + LL_RECORD_BLOCK_TIME(FTM_INVENTORY); if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) { @@ -1612,7 +1612,7 @@ void LLFolderView::update() // automatically show matching items, and select first one if we had a selection if (mNeedsAutoSelect) { - LLFastTimer t3(FTM_AUTO_SELECT); + LL_RECORD_BLOCK_TIME(FTM_AUTO_SELECT); // select new item only if a filtered item not currently selected LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back(); if (!mAutoSelectOverride && (!selected_itemp || !selected_itemp->getViewModelItem()->potentiallyVisible())) diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 92504ba8c2..aab9a4e84a 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -941,7 +941,7 @@ void LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder) folder->addFolder(this); } -static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); +static LLTrace::TimeBlock FTM_ARRANGE("Arrange"); // Finds width and height of this object and its children. Also // makes sure that this view and its children are the right size. @@ -950,7 +950,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) // sort before laying out contents getRoot()->getFolderViewModel()->sort(this); - LLFastTimer t2(FTM_ARRANGE); + LL_RECORD_BLOCK_TIME(FTM_ARRANGE); // evaluate mHasVisibleChildren mHasVisibleChildren = false; diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 0d232cc2cf..240a6fff81 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -347,13 +347,13 @@ LLColor3 LLKeywords::readColor( const std::string& s ) return LLColor3( r, g, b ); } -LLFastTimer::DeclareTimer FTM_SYNTAX_COLORING("Syntax Coloring"); +LLTrace::TimeBlock FTM_SYNTAX_COLORING("Syntax Coloring"); // Walk through a string, applying the rules specified by the keyword token list and // create a list of color segments. void LLKeywords::findSegments(std::vector* seg_list, const LLWString& wtext, const LLColor4 &defaultColor, LLTextEditor& editor) { - LLFastTimer ft(FTM_SYNTAX_COLORING); + LL_RECORD_BLOCK_TIME(FTM_SYNTAX_COLORING); seg_list->clear(); if( wtext.empty() ) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index edb32954c6..e40dcb28ef 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -316,11 +316,11 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed) mNeedsLayout = true; } -static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); +static LLTrace::TimeBlock FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout() { - LLFastTimer ft(FTM_UPDATE_LAYOUT); + LL_RECORD_BLOCK_TIME(FTM_UPDATE_LAYOUT); if (!mNeedsLayout) return; diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 389d18a350..f0157a2dec 100755 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -372,7 +372,7 @@ void LLPanel::setBorderVisible(BOOL b) } } -LLFastTimer::DeclareTimer FTM_PANEL_CONSTRUCTION("Panel Construction"); +LLTrace::TimeBlock FTM_PANEL_CONSTRUCTION("Panel Construction"); LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_node) { @@ -384,7 +384,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_ LLPanel* panelp = NULL; - { LLFastTimer _(FTM_PANEL_CONSTRUCTION); + { LL_RECORD_BLOCK_TIME(FTM_PANEL_CONSTRUCTION); if(!class_attr.empty()) { @@ -488,15 +488,15 @@ void LLPanel::initFromParams(const LLPanel::Params& p) setAcceptsBadge(p.accepts_badge); } -static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); -static LLFastTimer::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); -static LLFastTimer::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild"); +static LLTrace::TimeBlock FTM_PANEL_SETUP("Panel Setup"); +static LLTrace::TimeBlock FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); +static LLTrace::TimeBlock FTM_PANEL_POSTBUILD("Panel PostBuild"); BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node, const LLPanel::Params& default_params) { Params params(default_params); { - LLFastTimer timer(FTM_PANEL_SETUP); + LL_RECORD_BLOCK_TIME(FTM_PANEL_SETUP); LLXMLNodePtr referenced_xml; std::string xml_filename = mXMLFilename; @@ -526,7 +526,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu LLUICtrlFactory::instance().pushFileName(xml_filename); - LLFastTimer timer(FTM_EXTERNAL_PANEL_LOAD); + LL_RECORD_BLOCK_TIME(FTM_EXTERNAL_PANEL_LOAD); if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml)) { LL_WARNS() << "Couldn't parse panel from: " << xml_filename << LL_ENDL; @@ -557,7 +557,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu params.from_xui = true; applyXUILayout(params, parent); { - LLFastTimer timer(FTM_PANEL_CONSTRUCTION); + LL_RECORD_BLOCK_TIME(FTM_PANEL_CONSTRUCTION); initFromParams(params); } @@ -574,7 +574,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu } { - LLFastTimer timer(FTM_PANEL_POSTBUILD); + LL_RECORD_BLOCK_TIME(FTM_PANEL_POSTBUILD); postBuild(); } } @@ -963,14 +963,14 @@ boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t:: return mVisibleSignal->connect(cb); } -static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels"); +static LLTrace::TimeBlock FTM_BUILD_PANELS("Build Panels"); //----------------------------------------------------------------------------- // buildPanel() //----------------------------------------------------------------------------- BOOL LLPanel::buildFromFile(const std::string& filename, const LLPanel::Params& default_params) { - LLFastTimer timer(FTM_BUILD_PANELS); + LL_RECORD_BLOCK_TIME(FTM_BUILD_PANELS); BOOL didPost = FALSE; LLXMLNodePtr root; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index f54fb36abe..79284c9528 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2840,10 +2840,10 @@ LLScrollListColumn* LLScrollListCtrl::getColumn(const std::string& name) return NULL; } -LLFastTimer::DeclareTimer FTM_ADD_SCROLLLIST_ELEMENT("Add Scroll List Item"); +LLTrace::TimeBlock FTM_ADD_SCROLLLIST_ELEMENT("Add Scroll List Item"); LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata) { - LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT); + LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT); LLScrollListItem::Params item_params; LLParamSDParser parser; parser.readSD(element, item_params); @@ -2853,14 +2853,14 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition LLScrollListItem* LLScrollListCtrl::addRow(const LLScrollListItem::Params& item_p, EAddPosition pos) { - LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT); + LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT); LLScrollListItem *new_item = new LLScrollListItem(item_p); return addRow(new_item, item_p, pos); } LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLScrollListItem::Params& item_p, EAddPosition pos) { - LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT); + LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT); if (!item_p.validateBlock() || !new_item) return NULL; new_item->setNumColumns(mColumns.size()); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 94cf93bd3c..3f4dcb7579 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -48,7 +48,7 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. -LLTrace::MemStatHandle 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), @@ -1442,10 +1442,10 @@ S32 LLTextBase::getLeftOffset(S32 width) } -static LLFastTimer::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow"); +static LLTrace::TimeBlock FTM_TEXT_REFLOW ("Text Reflow"); void LLTextBase::reflow() { - LLFastTimer ft(FTM_TEXT_REFLOW); + LL_RECORD_BLOCK_TIME(FTM_TEXT_REFLOW); updateSegments(); @@ -1784,10 +1784,10 @@ void LLTextBase::removeDocumentChild(LLView* view) } -static LLFastTimer::DeclareTimer FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); +static LLTrace::TimeBlock FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); void LLTextBase::updateSegments() { - LLFastTimer ft(FTM_UPDATE_TEXT_SEGMENTS); + LL_RECORD_BLOCK_TIME(FTM_UPDATE_TEXT_SEGMENTS); createDefaultSegment(); } @@ -1990,7 +1990,7 @@ static LLUIImagePtr image_from_icon_name(const std::string& icon_name) } } -static LLFastTimer::DeclareTimer FTM_PARSE_HTML("Parse HTML"); +static LLTrace::TimeBlock FTM_PARSE_HTML("Parse HTML"); void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params) { @@ -2000,7 +2000,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para S32 part = (S32)LLTextParser::WHOLE; if (mParseHTML && !style_params.is_link) // Don't search for URLs inside a link segment (STORM-358). { - LLFastTimer _(FTM_PARSE_HTML); + LL_RECORD_BLOCK_TIME(FTM_PARSE_HTML); S32 start=0,end=0; LLUrlMatch match; std::string text = new_text; @@ -2067,11 +2067,11 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para } } -static LLFastTimer::DeclareTimer FTM_APPEND_TEXT("Append Text"); +static LLTrace::TimeBlock FTM_APPEND_TEXT("Append Text"); void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, const LLStyle::Params& input_params) { - LLFastTimer _(FTM_APPEND_TEXT); + LL_RECORD_BLOCK_TIME(FTM_APPEND_TEXT); if (new_text.empty()) return; diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 74dc7f9693..5b7f0a7fa4 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -100,7 +100,7 @@ public: S32 getEnd() const { return mEnd; } void setEnd( S32 end ) { mEnd = end; } - static LLTrace::MemStatHandle sMemStat; + //static LLTrace::MemStatHandle sMemStat; protected: S32 mStart; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 36431d3723..2ed9c58442 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2484,13 +2484,13 @@ BOOL LLTextEditor::tryToRevertToPristineState() } -static LLFastTimer::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); +static LLTrace::TimeBlock FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); void LLTextEditor::loadKeywords(const std::string& filename, const std::vector& funcs, const std::vector& tooltips, const LLColor3& color) { - LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING); + LL_RECORD_BLOCK_TIME(FTM_SYNTAX_HIGHLIGHTING); if(mKeywords.loadFromFile(filename)) { S32 count = llmin(funcs.size(), tooltips.size()); @@ -2515,7 +2515,7 @@ void LLTextEditor::updateSegments() { if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly) { - LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING); + LL_RECORD_BLOCK_TIME(FTM_SYNTAX_HIGHLIGHTING); // HACK: No non-ascii keywords for now segment_vec_t segment_list; mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this); diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp index 5131f6b704..ad7fb005f5 100755 --- a/indra/llui/lltrans.cpp +++ b/indra/llui/lltrans.cpp @@ -135,14 +135,14 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root) -static LLFastTimer::DeclareTimer FTM_GET_TRANS("Translate string"); +static LLTrace::TimeBlock FTM_GET_TRANS("Translate string"); //static std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args) { // Don't care about time as much as call count. Make sure we're not // calling LLTrans::getString() in an inner loop. JC - LLFastTimer timer(FTM_GET_TRANS); + LL_RECORD_BLOCK_TIME(FTM_GET_TRANS); template_map_t::iterator iter = sStringTemplates.find(xml_desc); if (iter != sStringTemplates.end()) @@ -166,7 +166,7 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args { // Don't care about time as much as call count. Make sure we're not // calling LLTrans::getString() in an inner loop. JC - LLFastTimer timer(FTM_GET_TRANS); + LL_RECORD_BLOCK_TIME(FTM_GET_TRANS); template_map_t::iterator iter = sStringTemplates.find(xml_desc); if (iter != sStringTemplates.end()) @@ -185,7 +185,7 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args //static bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args) { - LLFastTimer timer(FTM_GET_TRANS); + LL_RECORD_BLOCK_TIME(FTM_GET_TRANS); template_map_t::iterator iter = sStringTemplates.find(xml_desc); if (iter != sStringTemplates.end()) @@ -207,7 +207,7 @@ bool LLTrans::findString(std::string &result, const std::string &xml_desc, const //static bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLSD& msg_args) { - LLFastTimer timer(FTM_GET_TRANS); + LL_RECORD_BLOCK_TIME(FTM_GET_TRANS); template_map_t::iterator iter = sStringTemplates.find(xml_desc); if (iter != sStringTemplates.end()) diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index abcd5da6c4..9a1a0e0677 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -737,11 +737,11 @@ public: } }; -LLFastTimer::DeclareTimer FTM_FOCUS_FIRST_ITEM("Focus First Item"); +LLTrace::TimeBlock FTM_FOCUS_FIRST_ITEM("Focus First Item"); BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash) { - LLFastTimer _(FTM_FOCUS_FIRST_ITEM); + LL_RECORD_BLOCK_TIME(FTM_FOCUS_FIRST_ITEM); // try to select default tab group child LLCtrlQuery query = getTabOrderQuery(); // sort things such that the default tab group is at the front diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 291da2ce48..1f5d77a958 100755 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -44,9 +44,9 @@ // this library includes #include "llpanel.h" -LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction"); -LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams"); -LLFastTimer::DeclareTimer FTM_WIDGET_SETUP("Widget Setup"); +LLTrace::TimeBlock FTM_WIDGET_CONSTRUCTION("Widget Construction"); +LLTrace::TimeBlock FTM_INIT_FROM_PARAMS("Widget InitFromParams"); +LLTrace::TimeBlock FTM_WIDGET_SETUP("Widget Setup"); //----------------------------------------------------------------------------- @@ -105,12 +105,12 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa } } -static LLFastTimer::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children"); +static LLTrace::TimeBlock FTM_CREATE_CHILDREN("Create XUI Children"); //static void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node) { - LLFastTimer ft(FTM_CREATE_CHILDREN); + LL_RECORD_BLOCK_TIME(FTM_CREATE_CHILDREN); if (node.isNull()) return; for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling()) @@ -147,14 +147,14 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid } -static LLFastTimer::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing"); +static LLTrace::TimeBlock FTM_XML_PARSE("XML Reading/Parsing"); //----------------------------------------------------------------------------- // getLayeredXMLNode() //----------------------------------------------------------------------------- bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNodePtr& root, LLDir::ESkinConstraint constraint) { - LLFastTimer timer(FTM_XML_PARSE); + LL_RECORD_BLOCK_TIME(FTM_XML_PARSE); std::vector paths = gDirUtilp->findSkinnedFilenames(LLDir::XUI, xui_filename, constraint); @@ -179,11 +179,11 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static LLFastTimer::DeclareTimer FTM_CREATE_FROM_XML("Create child widget"); +static LLTrace::TimeBlock FTM_CREATE_FROM_XML("Create child widget"); LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t& registry, LLXMLNodePtr output_node) { - LLFastTimer timer(FTM_CREATE_FROM_XML); + LL_RECORD_BLOCK_TIME(FTM_CREATE_FROM_XML); std::string ctrl_type = node->getName()->mString; LLStringUtil::toLower(ctrl_type); diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 87b3937417..678e837fa1 100755 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -74,9 +74,9 @@ class LLWidgetNameRegistry //: public LLRegistrySingleton //{}; -extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP; -extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; -extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; +extern LLTrace::TimeBlock FTM_WIDGET_SETUP; +extern LLTrace::TimeBlock FTM_WIDGET_CONSTRUCTION; +extern LLTrace::TimeBlock FTM_INIT_FROM_PARAMS; // Build time optimization, generate this once in .cpp file #ifndef LLUICTRLFACTORY_CPP @@ -229,10 +229,10 @@ private: //return NULL; } - { LLFastTimer _(FTM_WIDGET_CONSTRUCTION); + { LL_RECORD_BLOCK_TIME(FTM_WIDGET_CONSTRUCTION); widget = new T(params); } - { LLFastTimer _(FTM_INIT_FROM_PARAMS); + { LL_RECORD_BLOCK_TIME(FTM_INIT_FROM_PARAMS); widget->initFromParams(params); } @@ -247,7 +247,7 @@ private: template static T* defaultBuilder(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { - LLFastTimer timer(FTM_WIDGET_SETUP); + LL_RECORD_BLOCK_TIME(FTM_WIDGET_SETUP); typename T::Params params(getDefaultParams()); diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index 23fc53ea88..9a6810947e 100755 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -31,7 +31,7 @@ #include "llsd.h" #include "lltrans.h" -LLFastTimer::DeclareTimer FTM_UI_STRING("UI String"); +LLTrace::TimeBlock FTM_UI_STRING("UI String"); LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args) @@ -56,7 +56,7 @@ void LLUIString::setArgList(const LLStringUtil::format_map_t& args) void LLUIString::setArgs(const LLSD& sd) { - LLFastTimer timer(FTM_UI_STRING); + LL_RECORD_BLOCK_TIME(FTM_UI_STRING); if (!sd.isMap()) return; for(LLSD::map_const_iterator sd_it = sd.beginMap(); @@ -119,7 +119,7 @@ void LLUIString::updateResult() const { mNeedsResult = false; - LLFastTimer timer(FTM_UI_STRING); + LL_RECORD_BLOCK_TIME(FTM_UI_STRING); // optimize for empty strings (don't attempt string replacement) if (mOrig.empty()) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index ae62d72f73..22461083a6 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -69,7 +69,7 @@ LLView* LLView::sPreviewClickedElement = NULL; BOOL LLView::sDrawPreviewHighlights = FALSE; S32 LLView::sLastLeftXML = S32_MIN; S32 LLView::sLastBottomXML = S32_MIN; -LLTrace::MemStatHandle LLView::sMemStat("LLView"); +//LLTrace::MemStatHandle LLView::sMemStat("LLView"); std::vector LLViewDrawContext::sDrawContextStack; LLView::DrilldownFunc LLView::sDrilldown = @@ -1504,11 +1504,11 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const return getChild(name, recurse); } -static LLFastTimer::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); +static LLTrace::TimeBlock FTM_FIND_VIEWS("Find Widgets"); LLView* LLView::findChildView(const std::string& name, BOOL recurse) const { - LLFastTimer ft(FTM_FIND_VIEWS); + LL_RECORD_BLOCK_TIME(FTM_FIND_VIEWS); //richard: should we allow empty names? //if(name.empty()) // return NULL; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index e224233c3c..f6799d8cd9 100755 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -675,7 +675,7 @@ public: static S32 sLastLeftXML; static S32 sLastBottomXML; static BOOL sForceReshape; - static LLTrace::MemStatHandle sMemStat; + //static LLTrace::MemStatHandle sMemStat; }; namespace LLInitParam diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index 901260bec8..1b0ab6d92c 100755 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -35,7 +35,7 @@ // external library headers // other Linden headers -LLTrace::MemStatHandle LLViewModel::sMemStat("LLViewModel"); +//LLTrace::MemStatHandle LLViewModel::sMemStat("LLViewModel"); /// LLViewModel::LLViewModel() diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index a0a13267ac..f329201b9f 100755 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -83,7 +83,7 @@ public: // void setDirty() { mDirty = true; } - static LLTrace::MemStatHandle sMemStat; + //static LLTrace::MemStatHandle sMemStat; protected: LLSD mValue; diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 6a1f937340..46b089fd02 100755 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -677,12 +677,12 @@ LLXUIParser::LLXUIParser() } } -static LLFastTimer::DeclareTimer FTM_PARSE_XUI("XUI Parsing"); +static LLTrace::TimeBlock FTM_PARSE_XUI("XUI Parsing"); const LLXMLNodePtr DUMMY_NODE = new LLXMLNode(); void LLXUIParser::readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, const std::string& filename, bool silent) { - LLFastTimer timer(FTM_PARSE_XUI); + LL_RECORD_BLOCK_TIME(FTM_PARSE_XUI); mNameStack.clear(); mRootNodeName = node->getName()->mString; mCurFileName = filename; @@ -1394,7 +1394,7 @@ LLSimpleXUIParser::~LLSimpleXUIParser() bool LLSimpleXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent) { - LLFastTimer timer(FTM_PARSE_XUI); + LL_RECORD_BLOCK_TIME(FTM_PARSE_XUI); mParser = XML_ParserCreate(NULL); XML_SetUserData(mParser, this); -- cgit v1.2.3 From 3cd3d9f60e816a31ce46682bc4d2dddf909b7076 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 17 Sep 2013 17:02:13 -0700 Subject: removed spurious dependency of llui on newview --- indra/llui/llflashtimer.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp index e49628acd5..6d9c429b08 100755 --- a/indra/llui/llflashtimer.cpp +++ b/indra/llui/llflashtimer.cpp @@ -23,29 +23,27 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -#include "../newview/llviewerprecompiledheaders.h" - #include "llflashtimer.h" -#include "../newview/llviewercontrol.h" #include "lleventtimer.h" +#include "llui.h" LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period) - : LLEventTimer(period) - , mCallback(cb) - , mCurrentTickCount(0) - , mIsFlashingInProgress(false) - , mIsCurrentlyHighlighted(false) - , mUnset(false) +: LLEventTimer(period), + mCallback(cb), + mCurrentTickCount(0), + mIsFlashingInProgress(false), + mIsCurrentlyHighlighted(false), + mUnset(false) { mEventTimer.stop(); // By default use settings from settings.xml to be able change them via Debug settings. See EXT-5973. // Due to Timer is implemented as derived class from EventTimer it is impossible to change period // in runtime. So, both settings are made as required restart. - mFlashCount = 2 * ((count > 0) ? count : gSavedSettings.getS32("FlashCount")); + mFlashCount = 2 * ((count > 0) ? count : LLUI::sSettingGroups["config"]->getS32("FlashCount")); if (mPeriod <= 0) { - mPeriod = gSavedSettings.getF32("FlashPeriod"); + mPeriod = LLUI::sSettingGroups["config"]->getF32("FlashPeriod"); } } -- cgit v1.2.3 From 0dfc08d22a21728ec670bd75e6fd0ed60c97bf06 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 19 Sep 2013 15:21:46 -0700 Subject: BUILDFIX: more bad merge stuff also added ability for statbar to show memtrackable info --- indra/llui/llstatbar.cpp | 195 ++++++++++++++++++++++++++++++----------------- indra/llui/llstatbar.h | 20 ++++- 2 files changed, 140 insertions(+), 75 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 725a835f7f..9f96dd642d 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -190,8 +190,10 @@ LLStatBar::LLStatBar(const Params& p) mAutoScaleMax(!p.bar_max.isProvided()), mAutoScaleMin(!p.bar_min.isProvided()), mTickValue(p.tick_spacing), - mLastDisplayValue(0.f) + mLastDisplayValue(0.f), + mStatType(STAT_NONE) { + mStat.valid = NULL; // tick value will be automatically calculated later if (!p.tick_spacing.isProvided() && p.bar_min.isProvided() && p.bar_max.isProvided()) { @@ -203,17 +205,22 @@ LLStatBar::LLStatBar(const Params& p) BOOL LLStatBar::handleHover(S32 x, S32 y, MASK mask) { - if (mCountFloatp) + switch(mStatType) { - LLToolTipMgr::instance().show(LLToolTip::Params().message(mCountFloatp->getDescription()).sticky_rect(calcScreenRect())); - } - else if ( mEventFloatp) - { - LLToolTipMgr::instance().show(LLToolTip::Params().message(mEventFloatp->getDescription()).sticky_rect(calcScreenRect())); - } - else if (mSampleFloatp) - { - LLToolTipMgr::instance().show(LLToolTip::Params().message(mSampleFloatp->getDescription()).sticky_rect(calcScreenRect())); + case STAT_COUNT: + LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.countStatp->getDescription()).sticky_rect(calcScreenRect())); + break; + case STAT_EVENT: + LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.eventStatp->getDescription()).sticky_rect(calcScreenRect())); + break; + case STAT_SAMPLE: + LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.sampleStatp->getDescription()).sticky_rect(calcScreenRect())); + break; + case STAT_MEM: + LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.memStatp->getDescription()).sticky_rect(calcScreenRect())); + break; + default: + break; } return TRUE; } @@ -321,50 +328,69 @@ void LLStatBar::draw() : mNumShortHistoryFrames; S32 num_rapid_changes = 0; - if (mCountFloatp) - { - const LLTrace::TraceType& count_stat = *mCountFloatp; - - unit_label = std::string(count_stat.getUnitLabel()) + "/s"; - current = last_frame_recording.getPerSec(count_stat); - min = frame_recording.getPeriodMinPerSec(count_stat, num_frames); - max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames); - mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames); - display_value = mean; - } - else if (mEventFloatp) - { - const LLTrace::TraceType& event_stat = *mEventFloatp; - - unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel; - current = last_frame_recording.getLastValue(event_stat); - min = frame_recording.getPeriodMin(event_stat, num_frames); - max = frame_recording.getPeriodMax(event_stat, num_frames); - mean = frame_recording.getPeriodMean(event_stat, num_frames); - num_rapid_changes = calc_num_rapid_changes(frame_recording, event_stat, RAPID_CHANGE_WINDOW); - display_value = mean; - } - else if (mSampleFloatp) + switch(mStatType) { - const LLTrace::TraceType& sample_stat = *mSampleFloatp; - - unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel; - current = last_frame_recording.getLastValue(sample_stat); - min = frame_recording.getPeriodMin(sample_stat, num_frames); - max = frame_recording.getPeriodMax(sample_stat, num_frames); - mean = frame_recording.getPeriodMean(sample_stat, num_frames); - num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW); - - if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC) + case STAT_COUNT: { + const LLTrace::TraceType& count_stat = *mStat.countStatp; + + unit_label = std::string(count_stat.getUnitLabel()) + "/s"; + current = last_frame_recording.getPerSec(count_stat); + min = frame_recording.getPeriodMinPerSec(count_stat, num_frames); + max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames); + mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames); display_value = mean; } - else + break; + case STAT_EVENT: + { + const LLTrace::TraceType& event_stat = *mStat.eventStatp; + + unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel; + current = last_frame_recording.getLastValue(event_stat); + min = frame_recording.getPeriodMin(event_stat, num_frames); + max = frame_recording.getPeriodMax(event_stat, num_frames); + mean = frame_recording.getPeriodMean(event_stat, num_frames); + display_value = mean; + } + break; + case STAT_SAMPLE: + { + const LLTrace::TraceType& sample_stat = *mStat.sampleStatp; + + unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel; + current = last_frame_recording.getLastValue(sample_stat); + min = frame_recording.getPeriodMin(sample_stat, num_frames); + max = frame_recording.getPeriodMax(sample_stat, num_frames); + mean = frame_recording.getPeriodMean(sample_stat, num_frames); + num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW); + + if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC) + { + display_value = mean; + } + else + { + display_value = current; + // always display current value, don't rate limit + mLastDisplayValue = current; + } + } + break; + case STAT_MEM: { - display_value = current; - // always display current value, don't rate limit - mLastDisplayValue = current; + const LLTrace::TraceType& mem_stat = *mStat.memStatp; + + unit_label = mUnitLabel.empty() ? mem_stat.getUnitLabel() : mUnitLabel; + current = last_frame_recording.getLastValue(mem_stat).value(); + min = frame_recording.getPeriodMin(mem_stat, num_frames).value(); + max = frame_recording.getPeriodMax(mem_stat, num_frames).value(); + mean = frame_recording.getPeriodMean(mem_stat, num_frames).value(); + display_value = current; } + break; + default: + break; } LLRect bar_rect; @@ -405,8 +431,7 @@ void LLStatBar::draw() mLastDisplayValue = display_value; - if (mDisplayBar - && (mCountFloatp || mEventFloatp || mSampleFloatp)) + if (mDisplayBar && mStat.valid) { // Draw the tick marks. LLGLSUIDefault gls_ui; @@ -454,7 +479,7 @@ void LLStatBar::draw() ? (bar_rect.getWidth()) : (bar_rect.getHeight()); - if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) + if (mDisplayHistory && mStat.valid) { const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; F32 value = 0; @@ -468,22 +493,28 @@ void LLStatBar::draw() F32 offset = ((F32)i / (F32)num_frames) * span; LLTrace::Recording& recording = frame_recording.getPrevRecording(i); - if (mCountFloatp) - { - value = recording.getPerSec(*mCountFloatp); - num_samples = recording.getSampleCount(*mCountFloatp); - } - else if (mEventFloatp) + switch(mStatType) { - value = recording.getMean(*mEventFloatp); - num_samples = recording.getSampleCount(*mEventFloatp); + case STAT_COUNT: + value = recording.getPerSec(*mStat.countStatp); + num_samples = recording.getSampleCount(*mStat.countStatp); + break; + case STAT_EVENT: + value = recording.getMean(*mStat.eventStatp); + num_samples = recording.getSampleCount(*mStat.eventStatp); + break; + case STAT_SAMPLE: + value = recording.getMean(*mStat.sampleStatp); + num_samples = recording.getSampleCount(*mStat.sampleStatp); + break; + case STAT_MEM: + value = recording.getMean(*mStat.memStatp).value(); + num_samples = 1; + break; + default: + break; } - else if (mSampleFloatp) - { - value = recording.getMean(*mSampleFloatp); - num_samples = recording.getSampleCount(*mSampleFloatp); - } - + if (!num_samples) continue; F32 begin = (value - mCurMinBar) * value_scale; @@ -540,9 +571,32 @@ void LLStatBar::draw() void LLStatBar::setStat(const std::string& stat_name) { - mCountFloatp = LLTrace::TraceType::getInstance(stat_name); - mEventFloatp = LLTrace::TraceType::getInstance(stat_name); - mSampleFloatp = LLTrace::TraceType::getInstance(stat_name); + using namespace LLTrace; + const TraceType* count_stat; + const TraceType* event_stat; + const TraceType* sample_stat; + const TraceType* mem_stat; + + if ((count_stat = TraceType::getInstance(stat_name))) + { + mStat.countStatp = count_stat; + mStatType = STAT_COUNT; + } + else if ((event_stat = TraceType::getInstance(stat_name))) + { + mStat.eventStatp = event_stat; + mStatType = STAT_EVENT; + } + else if ((sample_stat = TraceType::getInstance(stat_name))) + { + mStat.sampleStatp = sample_stat; + mStatType = STAT_SAMPLE; + } + else if ((mem_stat = TraceType::getInstance(stat_name))) + { + mStat.memStatp = mem_stat; + mStatType = STAT_MEM; + } } @@ -688,6 +742,3 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) } } } - - - diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index f311e4a13c..5e9255b9eb 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -93,9 +93,23 @@ private: F32 mLastDisplayValue; LLFrameTimer mLastDisplayValueTimer; - const LLTrace::TraceType* mCountFloatp; - const LLTrace::TraceType* mEventFloatp; - const LLTrace::TraceType* mSampleFloatp; + enum + { + STAT_NONE, + STAT_COUNT, + STAT_EVENT, + STAT_SAMPLE, + STAT_MEM + } mStatType; + + union + { + void* valid; + const LLTrace::TraceType* countStatp; + const LLTrace::TraceType* eventStatp; + const LLTrace::TraceType* sampleStatp; + const LLTrace::TraceType* memStatp; + } mStat; LLUIString mLabel; std::string mUnitLabel; -- cgit v1.2.3 From 6c856aba6bdb0d136133a344e13fe13978e1be01 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 19 Sep 2013 15:23:17 -0700 Subject: line endings fix --- indra/llui/llstatbar.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 9f96dd642d..a6f7dd0ea4 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -495,23 +495,23 @@ void LLStatBar::draw() switch(mStatType) { - case STAT_COUNT: - value = recording.getPerSec(*mStat.countStatp); - num_samples = recording.getSampleCount(*mStat.countStatp); - break; - case STAT_EVENT: - value = recording.getMean(*mStat.eventStatp); - num_samples = recording.getSampleCount(*mStat.eventStatp); - break; - case STAT_SAMPLE: - value = recording.getMean(*mStat.sampleStatp); - num_samples = recording.getSampleCount(*mStat.sampleStatp); - break; - case STAT_MEM: - value = recording.getMean(*mStat.memStatp).value(); - num_samples = 1; - break; - default: + case STAT_COUNT: + value = recording.getPerSec(*mStat.countStatp); + num_samples = recording.getSampleCount(*mStat.countStatp); + break; + case STAT_EVENT: + value = recording.getMean(*mStat.eventStatp); + num_samples = recording.getSampleCount(*mStat.eventStatp); + break; + case STAT_SAMPLE: + value = recording.getMean(*mStat.sampleStatp); + num_samples = recording.getSampleCount(*mStat.sampleStatp); + break; + case STAT_MEM: + value = recording.getMean(*mStat.memStatp).value(); + num_samples = 1; + break; + default: break; } -- cgit v1.2.3 From 05ec5ca3d592ed7c730026582a2573d04c6e4c16 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 19 Sep 2013 20:05:53 -0700 Subject: BUILDFIX: forgot forward declaration better overrides for memclaim and memdisclaim of sizes added occlusion stats to stats floater stats now render range instead of mean --- indra/llui/llstatbar.cpp | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index a6f7dd0ea4..222db70d2b 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -482,13 +482,14 @@ void LLStatBar::draw() if (mDisplayHistory && mStat.valid) { const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; - F32 value = 0; - S32 i; - gGL.color4f( 1.f, 0.f, 0.f, 1.f ); + F32 min_value = 0.f, + max_value = 0.f; + + gGL.color4f(1.f, 0.f, 0.f, 1.f); gGL.begin( LLRender::QUADS ); const S32 max_frame = llmin(num_frames, num_values); U32 num_samples = 0; - for (i = 1; i <= max_frame; i++) + for (S32 i = 1; i <= max_frame; i++) { F32 offset = ((F32)i / (F32)num_frames) * span; LLTrace::Recording& recording = frame_recording.getPrevRecording(i); @@ -496,19 +497,23 @@ void LLStatBar::draw() switch(mStatType) { case STAT_COUNT: - value = recording.getPerSec(*mStat.countStatp); - num_samples = recording.getSampleCount(*mStat.countStatp); + min_value = recording.getPerSec(*mStat.countStatp); + max_value = min_value; + num_samples = recording.getSampleCount(*mStat.countStatp); break; case STAT_EVENT: - value = recording.getMean(*mStat.eventStatp); - num_samples = recording.getSampleCount(*mStat.eventStatp); + min_value = recording.getMin(*mStat.eventStatp); + max_value = recording.getMax(*mStat.eventStatp); + num_samples = recording.getSampleCount(*mStat.eventStatp); break; case STAT_SAMPLE: - value = recording.getMean(*mStat.sampleStatp); - num_samples = recording.getSampleCount(*mStat.sampleStatp); + min_value = recording.getMin(*mStat.sampleStatp); + max_value = recording.getMax(*mStat.sampleStatp); + num_samples = recording.getSampleCount(*mStat.sampleStatp); break; case STAT_MEM: - value = recording.getMean(*mStat.memStatp).value(); + min_value = recording.getMin(*mStat.memStatp).value(); + max_value = recording.getMax(*mStat.memStatp).value(); num_samples = 1; break; default: @@ -517,20 +522,21 @@ void LLStatBar::draw() if (!num_samples) continue; - F32 begin = (value - mCurMinBar) * value_scale; + F32 min = (min_value - mCurMinBar) * value_scale; + F32 max = llmax(min + 1, (max_value - mCurMinBar) * value_scale); if (mOrientation == HORIZONTAL) { - gGL.vertex2f((F32)bar_rect.mRight - offset, begin + 1); - gGL.vertex2f((F32)bar_rect.mRight - offset, begin); - gGL.vertex2f((F32)bar_rect.mRight - offset - 1, begin); - gGL.vertex2f((F32)bar_rect.mRight - offset - 1, begin + 1); + gGL.vertex2f((F32)bar_rect.mRight - offset, max); + gGL.vertex2f((F32)bar_rect.mRight - offset, min); + gGL.vertex2f((F32)bar_rect.mRight - offset - 1, min); + gGL.vertex2f((F32)bar_rect.mRight - offset - 1, max); } else { - gGL.vertex2f(begin, (F32)bar_rect.mBottom + offset + 1); - gGL.vertex2f(begin, (F32)bar_rect.mBottom + offset); - gGL.vertex2f(begin + 1, (F32)bar_rect.mBottom + offset); - gGL.vertex2f(begin + 1, (F32)bar_rect.mBottom + offset + 1 ); + gGL.vertex2f(min, (F32)bar_rect.mBottom + offset + 1); + gGL.vertex2f(min, (F32)bar_rect.mBottom + offset); + gGL.vertex2f(max, (F32)bar_rect.mBottom + offset); + gGL.vertex2f(max, (F32)bar_rect.mBottom + offset + 1 ); } } gGL.end(); -- cgit v1.2.3 From ab8f64a96754edaa68dd1ff97b9519eff4496aa6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 24 Sep 2013 00:05:43 -0700 Subject: converted memory tracking units to KB from B added more memory tracking to LLFolderView and kin --- indra/llui/llfolderview.cpp | 3 ++- indra/llui/llfolderview.h | 32 ++++++++++++++++---------------- indra/llui/llfolderviewitem.cpp | 8 ++++++++ indra/llui/llfolderviewmodel.h | 24 ++++++++++++------------ indra/llui/llstatview.h | 3 ++- indra/llui/llviewmodel.cpp | 5 +++++ 6 files changed, 45 insertions(+), 30 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 373b0e05ac..f0caba3e13 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -174,6 +174,7 @@ LLFolderView::LLFolderView(const Params& p) mShowItemLinkOverlays(p.show_item_link_overlays), mViewModel(p.view_model) { + memClaim(mViewModel); mViewModel->setFolderView(this); mRoot = this; @@ -1578,7 +1579,7 @@ BOOL LLFolderView::getShowSelectionContext() return FALSE; } -void LLFolderView::setShowSingleSelection(BOOL show) +void LLFolderView::setShowSingleSelection(bool show) { if (show != mShowSingleSelection) { diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 652e22c7bc..4ef685ba0c 100755 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -208,9 +208,9 @@ public: LLRect getVisibleRect(); BOOL search(LLFolderViewItem* first_item, const std::string &search_string, BOOL backward); - void setShowSelectionContext(BOOL show) { mShowSelectionContext = show; } + void setShowSelectionContext(bool show) { mShowSelectionContext = show; } BOOL getShowSelectionContext(); - void setShowSingleSelection(BOOL show); + void setShowSingleSelection(bool show); BOOL getShowSingleSelection() { return mShowSingleSelection; } F32 getSelectionFadeElapsedTime() { return mMultiSelectionFadeTimer.getElapsedTimeF32(); } bool getUseEllipses() { return mUseEllipses; } @@ -260,31 +260,32 @@ protected: LLHandle mPopupMenuHandle; selected_items_t mSelectedItems; - BOOL mKeyboardSelection; - BOOL mAllowMultiSelect; - BOOL mShowEmptyMessage; - BOOL mShowFolderHierarchy; + bool mKeyboardSelection, + mAllowMultiSelect, + mShowEmptyMessage, + mShowFolderHierarchy, + mNeedsScroll, + mPinningSelectedItem, + mNeedsAutoSelect, + mAutoSelectOverride, + mNeedsAutoRename, + mUseLabelSuffix, + mDragAndDropThisFrame, + mShowItemLinkOverlays, + mShowSelectionContext, + mShowSingleSelection; // Renaming variables and methods LLFolderViewItem* mRenameItem; // The item currently being renamed LLLineEditor* mRenamer; - BOOL mNeedsScroll; - BOOL mPinningSelectedItem; LLRect mScrollConstraintRect; - BOOL mNeedsAutoSelect; - BOOL mAutoSelectOverride; - BOOL mNeedsAutoRename; - bool mUseLabelSuffix; - bool mShowItemLinkOverlays; LLDepthStack mAutoOpenItems; LLFolderViewFolder* mAutoOpenCandidate; LLFrameTimer mAutoOpenTimer; LLFrameTimer mSearchTimer; std::string mSearchString; - BOOL mShowSelectionContext; - BOOL mShowSingleSelection; LLFrameTimer mMultiSelectionFadeTimer; S32 mArrangeGeneration; @@ -292,7 +293,6 @@ protected: signal_t mReshapeSignal; S32 mSignalSelectCallback; S32 mMinWidth; - BOOL mDragAndDropThisFrame; LLPanel* mParentPanel; diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index ac36cd1173..26ea9651b5 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -1496,12 +1496,16 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item ) ft = std::find(mFolders.begin(), mFolders.end(), f); if (ft != mFolders.end()) { + memDisclaim(mFolders); mFolders.erase(ft); + memClaim(mFolders); } } else { + memDisclaim(mItems); mItems.erase(it); + memClaim(mItems); } //item has been removed, need to update filter getViewModelItem()->removeChild(item->getViewModelItem()); @@ -1578,7 +1582,9 @@ void LLFolderViewFolder::addItem(LLFolderViewItem* item) } item->setParentFolder(this); + memDisclaim(mItems); mItems.push_back(item); + memClaim(mItems); item->setRect(LLRect(0, 0, getRect().getWidth(), 0)); item->setVisible(FALSE); @@ -1601,7 +1607,9 @@ void LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) folder->mParentFolder->extractItem(folder); } folder->mParentFolder = this; + memDisclaim(mFolders); mFolders.push_back(folder); + memClaim(mFolders); folder->setOrigin(0, 0); folder->reshape(getRect().getWidth(), 0); folder->setVisible(FALSE); diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index b1bcc8bbb4..3f62d133e4 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -108,7 +108,7 @@ public: virtual S32 getFirstRequiredGeneration() const = 0; }; -class LLFolderViewModelInterface +class LLFolderViewModelInterface : public LLTrace::MemTrackable { public: virtual ~LLFolderViewModelInterface() {} @@ -128,7 +128,7 @@ public: // This is an abstract base class that users of the folderview classes // would use to bridge the folder view with the underlying data -class LLFolderViewModelItem : public LLRefCount +class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable { public: LLFolderViewModelItem() { } @@ -336,18 +336,18 @@ protected: virtual void setParent(LLFolderViewModelItem* parent) { mParent = parent; } virtual bool hasParent() { return mParent != NULL; } - S32 mSortVersion; - bool mPassedFilter; - bool mPassedFolderFilter; - std::string::size_type mStringMatchOffsetFilter; - std::string::size_type mStringFilterSize; + S32 mSortVersion; + bool mPassedFilter; + bool mPassedFolderFilter; + std::string::size_type mStringMatchOffsetFilter; + std::string::size_type mStringFilterSize; - S32 mLastFilterGeneration; - S32 mLastFolderFilterGeneration; - S32 mMostFilteredDescendantGeneration; + S32 mLastFilterGeneration, + mLastFolderFilterGeneration, + mMostFilteredDescendantGeneration; - child_list_t mChildren; - LLFolderViewModelItem* mParent; + child_list_t mChildren; + LLFolderViewModelItem* mParent; LLFolderViewModelInterface& mRootViewModel; void setFolderViewItem(LLFolderViewItem* folder_view_item) { mFolderViewItem = folder_view_item;} diff --git a/indra/llui/llstatview.h b/indra/llui/llstatview.h index 5abdc42448..bc78d3b5fd 100755 --- a/indra/llui/llstatview.h +++ b/indra/llui/llstatview.h @@ -46,7 +46,8 @@ public: Params() : setting("setting") { - changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT); + changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); + changeDefault(show_label, true); } }; diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index 1b0ab6d92c..21c4e0fcac 100755 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -82,9 +82,12 @@ LLTextViewModel::LLTextViewModel(const LLSD& value) void LLTextViewModel::setValue(const LLSD& value) { LLViewModel::setValue(value); + // approximate LLSD storage usage + memDisclaim(mDisplay.size()); memDisclaim(mDisplay); mDisplay = utf8str_to_wstring(value.asString()); memClaim(mDisplay); + memClaim(mDisplay.size()); // mDisplay and mValue agree mUpdateFromDisplay = false; @@ -96,9 +99,11 @@ 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.size()); memDisclaim(mDisplay); mDisplay = value; memClaim(mDisplay); + memClaim(mDisplay.size()); 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 -- cgit v1.2.3 From 053d97db1b283ca2548dc1f64756ddfc5166158f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 25 Sep 2013 19:12:35 -0700 Subject: better memory usage for LLTrace (tighter packing of recording arrays) removed complicated and unnecessary fast timer gapless handoff logic (it should be gapless anyway) improved MemTrackable API, better separation of shadow and footprint added memory usage stats to floater_stats.xml --- indra/llui/llfolderview.cpp | 2 +- indra/llui/llfolderviewitem.cpp | 16 ++++++++-------- indra/llui/lltextbase.cpp | 26 ++++++++++++-------------- indra/llui/lltextbase.h | 2 -- indra/llui/lluictrl.cpp | 22 +++++++++++----------- indra/llui/llview.cpp | 1 - indra/llui/llview.h | 1 - indra/llui/llviewmodel.cpp | 18 ++++++++---------- indra/llui/llviewmodel.h | 2 -- 9 files changed, 40 insertions(+), 50 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index f0caba3e13..e6582a7ae9 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -174,7 +174,7 @@ LLFolderView::LLFolderView(const Params& p) mShowItemLinkOverlays(p.show_item_link_overlays), mViewModel(p.view_model) { - memClaim(mViewModel); + claimMem(mViewModel); mViewModel->setFolderView(this); mRoot = this; diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 26ea9651b5..802cb783ed 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -1496,16 +1496,16 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item ) ft = std::find(mFolders.begin(), mFolders.end(), f); if (ft != mFolders.end()) { - memDisclaim(mFolders); + disclaimMem(mFolders); mFolders.erase(ft); - memClaim(mFolders); + claimMem(mFolders); } } else { - memDisclaim(mItems); + disclaimMem(mItems); mItems.erase(it); - memClaim(mItems); + claimMem(mItems); } //item has been removed, need to update filter getViewModelItem()->removeChild(item->getViewModelItem()); @@ -1582,9 +1582,9 @@ void LLFolderViewFolder::addItem(LLFolderViewItem* item) } item->setParentFolder(this); - memDisclaim(mItems); + disclaimMem(mItems); mItems.push_back(item); - memClaim(mItems); + claimMem(mItems); item->setRect(LLRect(0, 0, getRect().getWidth(), 0)); item->setVisible(FALSE); @@ -1607,9 +1607,9 @@ void LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) folder->mParentFolder->extractItem(folder); } folder->mParentFolder = this; - memDisclaim(mFolders); + disclaimMem(mFolders); mFolders.push_back(folder); - memClaim(mFolders); + claimMem(mFolders); folder->setOrigin(0, 0); folder->reshape(getRect().getWidth(), 0); folder->setVisible(FALSE); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 975f9df382..5c221edea7 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -48,8 +48,6 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. -//LLTrace::MemStatHandle 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), @@ -578,7 +576,7 @@ void LLTextBase::drawText() if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) ) { const LLWString& wstrText = getWText(); - memDisclaim(mMisspellRanges).clear(); + disclaimMem(mMisspellRanges).clear(); segment_set_t::const_iterator seg_it = getSegIterContaining(start); while (mSegments.end() != seg_it) @@ -654,7 +652,7 @@ void LLTextBase::drawText() mSpellCheckStart = start; mSpellCheckEnd = end; - memClaim(mMisspellRanges); + claimMem(mMisspellRanges); } } else @@ -924,11 +922,11 @@ void LLTextBase::createDefaultSegment() if (mSegments.empty()) { LLStyleConstSP sp(new LLStyle(getStyleParams())); - memDisclaim(mSegments); + disclaimMem(mSegments); LLTextSegmentPtr default_segment = new LLNormalTextSegment( sp, 0, getLength() + 1, *this); mSegments.insert(default_segment); default_segment->linkToDocument(this); - memClaim(mSegments); + claimMem(mSegments); } } @@ -939,7 +937,7 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) return; } - memDisclaim(mSegments); + disclaimMem(mSegments); segment_set_t::iterator cur_seg_iter = getSegIterContaining(segment_to_insert->getStart()); S32 reflow_start_index = 0; @@ -1013,7 +1011,7 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) // layout potentially changed needsReflow(reflow_start_index); - memClaim(mSegments); + claimMem(mSegments); } BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) @@ -1324,10 +1322,10 @@ void LLTextBase::replaceWithSuggestion(U32 index) removeStringNoUndo(it->first, it->second - it->first); // Insert the suggestion in its place - memDisclaim(mSuggestionList); + disclaimMem(mSuggestionList); LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]); insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index])); - memClaim(mSuggestionList); + claimMem(mSuggestionList); setCursorPos(it->first + (S32)suggestion.length()); @@ -1390,7 +1388,7 @@ bool LLTextBase::isMisspelledWord(U32 pos) const void LLTextBase::onSpellCheckSettingsChange() { // Recheck the spelling on every change - memDisclaim(mMisspellRanges).clear(); + disclaimMem(mMisspellRanges).clear(); mSpellCheckStart = mSpellCheckEnd = -1; } @@ -1668,7 +1666,7 @@ LLRect LLTextBase::getTextBoundingRect() void LLTextBase::clearSegments() { - memDisclaim(mSegments).clear(); + disclaimMem(mSegments).clear(); createDefaultSegment(); } @@ -3212,9 +3210,9 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) LL_WARNS() << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << LL_ENDL; return; } - memDisclaim(mTooltip); + disclaimMem(mTooltip); mTooltip = tooltip; - memClaim(mTooltip); + claimMem(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 8925ec9e45..b1558a7abe 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -100,8 +100,6 @@ public: S32 getEnd() const { return mEnd; } void setEnd( S32 end ) { mEnd = end; } - //static LLTrace::MemStatHandle sMemStat; - protected: S32 mStart; S32 mEnd; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 9a1a0e0677..9a81c91e0d 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -118,7 +118,7 @@ LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) mDoubleClickSignal(NULL), mTransparencyType(TT_DEFAULT) { - memClaim(viewmodel.get()); + claimMem(viewmodel.get()); } void LLUICtrl::initFromParams(const Params& p) @@ -941,7 +941,7 @@ boost::signals2::connection LLUICtrl::setCommitCallback( boost::function cb ) { - if (!mValidateSignal) mValidateSignal = memClaim(new enable_signal_t()); + if (!mValidateSignal) mValidateSignal = claimMem(new enable_signal_t()); return mValidateSignal->connect(boost::bind(cb, _2)); } @@ -1004,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 = memClaim(new commit_signal_t()); + if (!mCommitSignal) mCommitSignal = claimMem(new commit_signal_t()); return mCommitSignal->connect(cb); } boost::signals2::connection LLUICtrl::setValidateCallback( const enable_signal_t::slot_type& cb ) { - if (!mValidateSignal) mValidateSignal = memClaim(new enable_signal_t()); + if (!mValidateSignal) mValidateSignal = claimMem(new enable_signal_t()); return mValidateSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { - if (!mMouseEnterSignal) mMouseEnterSignal = memClaim(new commit_signal_t()); + if (!mMouseEnterSignal) mMouseEnterSignal = claimMem(new commit_signal_t()); return mMouseEnterSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { - if (!mMouseLeaveSignal) mMouseLeaveSignal = memClaim(new commit_signal_t()); + if (!mMouseLeaveSignal) mMouseLeaveSignal = claimMem(new commit_signal_t()); return mMouseLeaveSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseDownCallback( const mouse_signal_t::slot_type& cb ) { - if (!mMouseDownSignal) mMouseDownSignal = memClaim(new mouse_signal_t()); + if (!mMouseDownSignal) mMouseDownSignal = claimMem(new mouse_signal_t()); return mMouseDownSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseUpCallback( const mouse_signal_t::slot_type& cb ) { - if (!mMouseUpSignal) mMouseUpSignal = memClaim(new mouse_signal_t()); + if (!mMouseUpSignal) mMouseUpSignal = claimMem(new mouse_signal_t()); return mMouseUpSignal->connect(cb); } boost::signals2::connection LLUICtrl::setRightMouseDownCallback( const mouse_signal_t::slot_type& cb ) { - if (!mRightMouseDownSignal) mRightMouseDownSignal = memClaim(new mouse_signal_t()); + if (!mRightMouseDownSignal) mRightMouseDownSignal = claimMem(new mouse_signal_t()); return mRightMouseDownSignal->connect(cb); } boost::signals2::connection LLUICtrl::setRightMouseUpCallback( const mouse_signal_t::slot_type& cb ) { - if (!mRightMouseUpSignal) mRightMouseUpSignal = memClaim(new mouse_signal_t()); + if (!mRightMouseUpSignal) mRightMouseUpSignal = claimMem(new mouse_signal_t()); return mRightMouseUpSignal->connect(cb); } boost::signals2::connection LLUICtrl::setDoubleClickCallback( const mouse_signal_t::slot_type& cb ) { - if (!mDoubleClickSignal) mDoubleClickSignal = memClaim(new mouse_signal_t()); + if (!mDoubleClickSignal) mDoubleClickSignal = claimMem(new mouse_signal_t()); return mDoubleClickSignal->connect(cb); } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 22461083a6..e81d19ae3a 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -69,7 +69,6 @@ LLView* LLView::sPreviewClickedElement = NULL; BOOL LLView::sDrawPreviewHighlights = FALSE; S32 LLView::sLastLeftXML = S32_MIN; S32 LLView::sLastBottomXML = S32_MIN; -//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 f6799d8cd9..3a0dfb5f42 100755 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -675,7 +675,6 @@ public: static S32 sLastLeftXML; static S32 sLastBottomXML; static BOOL sForceReshape; - //static LLTrace::MemStatHandle sMemStat; }; namespace LLInitParam diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index 21c4e0fcac..6459ade027 100755 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -35,8 +35,6 @@ // external library headers // other Linden headers -//LLTrace::MemStatHandle LLViewModel::sMemStat("LLViewModel"); - /// LLViewModel::LLViewModel() : mDirty(false) @@ -83,11 +81,11 @@ void LLTextViewModel::setValue(const LLSD& value) { LLViewModel::setValue(value); // approximate LLSD storage usage - memDisclaim(mDisplay.size()); - memDisclaim(mDisplay); + disclaimMem(mDisplay.size()); + disclaimMem(mDisplay); mDisplay = utf8str_to_wstring(value.asString()); - memClaim(mDisplay); - memClaim(mDisplay.size()); + claimMem(mDisplay); + claimMem(mDisplay.size()); // mDisplay and mValue agree mUpdateFromDisplay = false; @@ -99,11 +97,11 @@ 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.size()); - memDisclaim(mDisplay); + disclaimMem(mDisplay.size()); + disclaimMem(mDisplay); mDisplay = value; - memClaim(mDisplay); - memClaim(mDisplay.size()); + claimMem(mDisplay); + claimMem(mDisplay.size()); 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 f329201b9f..49d7c322a3 100755 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -83,8 +83,6 @@ public: // void setDirty() { mDirty = true; } - //static LLTrace::MemStatHandle sMemStat; - protected: LLSD mValue; bool mDirty; -- cgit v1.2.3 From 4db06820f0a89d480a3d5c49c26313a3bb78544d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 26 Sep 2013 11:34:07 -0700 Subject: fix for display of joystick statbar monitors --- indra/llui/llstatbar.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 222db70d2b..4ee10837b6 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -62,7 +62,7 @@ F32 calc_tick_value(F32 min, F32 max) { S32 divisor = DIVISORS[divisor_idx]; F32 possible_tick_value = range / divisor; - S32 num_whole_digits = llceil(logf(min + possible_tick_value) * OO_LN10); + S32 num_whole_digits = llceil(logf(llabs(min + possible_tick_value)) * OO_LN10); for (S32 digit_count = -(num_whole_digits - 1); digit_count < 6; digit_count++) { F32 test_tick_value = min + (possible_tick_value * pow(10.0, digit_count)); @@ -681,8 +681,8 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) // start counting from actual min, not current, animating min, so that ticks don't float between numbers // ensure ticks always hit 0 - S32 last_tick = 0; - S32 last_label = 0; + S32 last_tick = S32_MIN; + S32 last_label = S32_MIN; if (mTickValue > 0.f && value_scale > 0.f) { const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30; @@ -697,7 +697,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) { const S32 begin = llfloor((tick_value - mCurMinBar)*value_scale); const S32 end = begin + TICK_WIDTH; - if (begin - last_tick < MIN_TICK_SPACING) + if (begin < last_tick + MIN_TICK_SPACING) { continue; } @@ -712,7 +712,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) if (mOrientation == HORIZONTAL) { - if (begin - last_label > MIN_LABEL_SPACING) + if (begin > last_label + MIN_LABEL_SPACING) { gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight - TICK_LENGTH, begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, bar_rect.mRight, begin, @@ -727,7 +727,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) } else { - if (begin - last_label > MIN_LABEL_SPACING) + if (begin > last_label + MIN_LABEL_SPACING) { gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f)); LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, begin - 1, bar_rect.mBottom - TICK_LENGTH, -- cgit v1.2.3 From e0a443f5a6b76fd1ab5ffaa8e7a1941d47c80f4f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 27 Sep 2013 11:18:39 -0700 Subject: BUILDFIX: fix for mac builds also, fixed alignment of tick labels on stat bars --- indra/llui/llstatbar.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 4ee10837b6..bc8235132e 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -708,14 +708,14 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) { decimal_digits = 0; } - std::string tick_string = llformat("%10.*f", decimal_digits, tick_value); - + std::string tick_label = llformat("%.*f", decimal_digits, tick_value); + S32 tick_label_width = LLFontGL::getFontMonospace()->getWidth(tick_label); if (mOrientation == HORIZONTAL) { if (begin > last_label + MIN_LABEL_SPACING) { gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight - TICK_LENGTH, begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); - LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, bar_rect.mRight, begin, + LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, bar_rect.mRight, begin, LLColor4(1.f, 1.f, 1.f, 0.5f), LLFontGL::LEFT, LLFontGL::VCENTER); last_label = begin; @@ -730,10 +730,11 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) if (begin > last_label + MIN_LABEL_SPACING) { gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f)); - LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, begin - 1, bar_rect.mBottom - TICK_LENGTH, + S32 label_pos = begin - llround((F32)tick_label_width * ((F32)begin / (F32)bar_rect.getWidth())); + LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, label_pos, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::RIGHT, LLFontGL::TOP); - last_label = begin; + LLFontGL::LEFT, LLFontGL::TOP); + last_label = label_pos; } else { -- cgit v1.2.3 From 12f0f8cb72f789e21b01b45063dcc5f1f5292087 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 1 Oct 2013 13:46:43 -0700 Subject: changed over to manual naming of MemTrackable stats changed claimMem and disclaimMem behavior to not pass through argument added more mem tracking stats to floater_stats --- indra/llui/llfolderviewitem.cpp | 8 -------- indra/llui/llfolderviewmodel.h | 9 ++++++++- indra/llui/lltextbase.cpp | 16 +++------------- indra/llui/lltextbase.h | 8 +++++--- indra/llui/lluictrl.cpp | 40 ++++++++++++++++++++++++++++++---------- indra/llui/llview.cpp | 3 ++- indra/llui/llview.h | 2 +- indra/llui/llviewmodel.cpp | 10 +++++++--- 8 files changed, 56 insertions(+), 40 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 802cb783ed..ac36cd1173 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -1496,16 +1496,12 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item ) ft = std::find(mFolders.begin(), mFolders.end(), f); if (ft != mFolders.end()) { - disclaimMem(mFolders); mFolders.erase(ft); - claimMem(mFolders); } } else { - disclaimMem(mItems); mItems.erase(it); - claimMem(mItems); } //item has been removed, need to update filter getViewModelItem()->removeChild(item->getViewModelItem()); @@ -1582,9 +1578,7 @@ void LLFolderViewFolder::addItem(LLFolderViewItem* item) } item->setParentFolder(this); - disclaimMem(mItems); mItems.push_back(item); - claimMem(mItems); item->setRect(LLRect(0, 0, getRect().getWidth(), 0)); item->setVisible(FALSE); @@ -1607,9 +1601,7 @@ void LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) folder->mParentFolder->extractItem(folder); } folder->mParentFolder = this; - disclaimMem(mFolders); mFolders.push_back(folder); - claimMem(mFolders); folder->setOrigin(0, 0); folder->reshape(getRect().getWidth(), 0); folder->setVisible(FALSE); diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 3f62d133e4..c665dce509 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -111,6 +111,10 @@ public: class LLFolderViewModelInterface : public LLTrace::MemTrackable { public: + LLFolderViewModelInterface() + : LLTrace::MemTrackable("LLFolderViewModelInterface") + {} + virtual ~LLFolderViewModelInterface() {} virtual void requestSortAll() = 0; @@ -131,7 +135,10 @@ public: class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable { public: - LLFolderViewModelItem() { } + LLFolderViewModelItem() + : LLTrace::MemTrackable("LLFolderViewModelItem") + {} + virtual ~LLFolderViewModelItem() { } virtual void update() {} //called when drawing diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 5c221edea7..730c3b2ada 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -576,7 +576,7 @@ void LLTextBase::drawText() if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) ) { const LLWString& wstrText = getWText(); - disclaimMem(mMisspellRanges).clear(); + mMisspellRanges.clear(); segment_set_t::const_iterator seg_it = getSegIterContaining(start); while (mSegments.end() != seg_it) @@ -652,7 +652,6 @@ void LLTextBase::drawText() mSpellCheckStart = start; mSpellCheckEnd = end; - claimMem(mMisspellRanges); } } else @@ -922,11 +921,9 @@ void LLTextBase::createDefaultSegment() if (mSegments.empty()) { LLStyleConstSP sp(new LLStyle(getStyleParams())); - disclaimMem(mSegments); LLTextSegmentPtr default_segment = new LLNormalTextSegment( sp, 0, getLength() + 1, *this); mSegments.insert(default_segment); default_segment->linkToDocument(this); - claimMem(mSegments); } } @@ -937,8 +934,6 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) return; } - disclaimMem(mSegments); - segment_set_t::iterator cur_seg_iter = getSegIterContaining(segment_to_insert->getStart()); S32 reflow_start_index = 0; @@ -1011,7 +1006,6 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) // layout potentially changed needsReflow(reflow_start_index); - claimMem(mSegments); } BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) @@ -1322,10 +1316,8 @@ void LLTextBase::replaceWithSuggestion(U32 index) removeStringNoUndo(it->first, it->second - it->first); // Insert the suggestion in its place - disclaimMem(mSuggestionList); LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]); insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index])); - claimMem(mSuggestionList); setCursorPos(it->first + (S32)suggestion.length()); @@ -1388,7 +1380,7 @@ bool LLTextBase::isMisspelledWord(U32 pos) const void LLTextBase::onSpellCheckSettingsChange() { // Recheck the spelling on every change - disclaimMem(mMisspellRanges).clear(); + mMisspellRanges.clear(); mSpellCheckStart = mSpellCheckEnd = -1; } @@ -1666,7 +1658,7 @@ LLRect LLTextBase::getTextBoundingRect() void LLTextBase::clearSegments() { - disclaimMem(mSegments).clear(); + mSegments.clear(); createDefaultSegment(); } @@ -3210,9 +3202,7 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) LL_WARNS() << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << LL_ENDL; return; } - disclaimMem(mTooltip); mTooltip = tooltip; - claimMem(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 b1558a7abe..87f1a10cc5 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -53,11 +53,13 @@ class LLUrlMatch; /// class LLTextSegment : public LLRefCount, - public LLMouseHandler, - public LLTrace::MemTrackable + public LLMouseHandler { public: - LLTextSegment(S32 start, S32 end) : mStart(start), mEnd(end){}; + LLTextSegment(S32 start, S32 end) + : mStart(start), + mEnd(end) + {} virtual ~LLTextSegment(); virtual bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 9a81c91e0d..546cd6fc46 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -941,7 +941,9 @@ boost::signals2::connection LLUICtrl::setCommitCallback( boost::function cb ) { - if (!mValidateSignal) mValidateSignal = claimMem(new enable_signal_t()); + if (!mValidateSignal) mValidateSignal = new enable_signal_t(); + claimMem(mValidateSignal); + return mValidateSignal->connect(boost::bind(cb, _2)); } @@ -1004,55 +1006,73 @@ boost::signals2::connection LLUICtrl::setValidateCallback(const EnableCallbackPa boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb ) { - if (!mCommitSignal) mCommitSignal = claimMem(new commit_signal_t()); + if (!mCommitSignal) mCommitSignal = new commit_signal_t(); + claimMem(mCommitSignal); + return mCommitSignal->connect(cb); } boost::signals2::connection LLUICtrl::setValidateCallback( const enable_signal_t::slot_type& cb ) { - if (!mValidateSignal) mValidateSignal = claimMem(new enable_signal_t()); + if (!mValidateSignal) mValidateSignal = new enable_signal_t(); + claimMem(mValidateSignal); + return mValidateSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { - if (!mMouseEnterSignal) mMouseEnterSignal = claimMem(new commit_signal_t()); + if (!mMouseEnterSignal) mMouseEnterSignal = new commit_signal_t(); + claimMem(mMouseEnterSignal); + return mMouseEnterSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { - if (!mMouseLeaveSignal) mMouseLeaveSignal = claimMem(new commit_signal_t()); + if (!mMouseLeaveSignal) mMouseLeaveSignal = new commit_signal_t(); + claimMem(mMouseLeaveSignal); + return mMouseLeaveSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseDownCallback( const mouse_signal_t::slot_type& cb ) { - if (!mMouseDownSignal) mMouseDownSignal = claimMem(new mouse_signal_t()); + if (!mMouseDownSignal) mMouseDownSignal = new mouse_signal_t(); + claimMem(mMouseDownSignal); + return mMouseDownSignal->connect(cb); } boost::signals2::connection LLUICtrl::setMouseUpCallback( const mouse_signal_t::slot_type& cb ) { - if (!mMouseUpSignal) mMouseUpSignal = claimMem(new mouse_signal_t()); + if (!mMouseUpSignal) mMouseUpSignal = new mouse_signal_t(); + claimMem(mMouseUpSignal); + return mMouseUpSignal->connect(cb); } boost::signals2::connection LLUICtrl::setRightMouseDownCallback( const mouse_signal_t::slot_type& cb ) { - if (!mRightMouseDownSignal) mRightMouseDownSignal = claimMem(new mouse_signal_t()); + if (!mRightMouseDownSignal) mRightMouseDownSignal = new mouse_signal_t(); + claimMem(mRightMouseDownSignal); + return mRightMouseDownSignal->connect(cb); } boost::signals2::connection LLUICtrl::setRightMouseUpCallback( const mouse_signal_t::slot_type& cb ) { - if (!mRightMouseUpSignal) mRightMouseUpSignal = claimMem(new mouse_signal_t()); + if (!mRightMouseUpSignal) mRightMouseUpSignal = new mouse_signal_t(); + claimMem(mRightMouseUpSignal); + return mRightMouseUpSignal->connect(cb); } boost::signals2::connection LLUICtrl::setDoubleClickCallback( const mouse_signal_t::slot_type& cb ) { - if (!mDoubleClickSignal) mDoubleClickSignal = claimMem(new mouse_signal_t()); + if (!mDoubleClickSignal) mDoubleClickSignal = new mouse_signal_t(); + claimMem(mDoubleClickSignal); + return mDoubleClickSignal->connect(cb); } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index e81d19ae3a..e3b3444a00 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -131,7 +131,8 @@ LLView::Params::Params() } LLView::LLView(const LLView::Params& p) -: mVisible(p.visible), +: LLTrace::MemTrackable("LLView"), + mVisible(p.visible), mInDraw(false), mName(p.name), mParentView(NULL), diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 3a0dfb5f42..665aad70cf 100755 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -167,7 +167,7 @@ protected: private: // widgets in general are not copyable - LLView(const LLView& other) {}; + LLView(const LLView& other); public: //#if LL_DEBUG static BOOL sIsDrawing; diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index 6459ade027..282addf692 100755 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -37,13 +37,15 @@ /// LLViewModel::LLViewModel() - : mDirty(false) +: LLTrace::MemTrackable("LLViewModel"), + mDirty(false) { } /// Instantiate an LLViewModel with an existing data value LLViewModel::LLViewModel(const LLSD& value) - : mDirty(false) +: LLTrace::MemTrackable("LLViewModel"), + mDirty(false) { setValue(value); } @@ -79,12 +81,14 @@ LLTextViewModel::LLTextViewModel(const LLSD& value) /// Update the stored value void LLTextViewModel::setValue(const LLSD& value) { - LLViewModel::setValue(value); // approximate LLSD storage usage disclaimMem(mDisplay.size()); + LLViewModel::setValue(value); disclaimMem(mDisplay); mDisplay = utf8str_to_wstring(value.asString()); + claimMem(mDisplay); + // approximate LLSD storage usage claimMem(mDisplay.size()); // mDisplay and mValue agree -- cgit v1.2.3 From 17df8988fec3f2ba991ca9e34ff8148253a2fc04 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 7 Oct 2013 13:38:03 -0700 Subject: renamed TraceType to StatType added more MemTrackable types optimized memory usage of LLTrace some more --- indra/llui/llstatbar.cpp | 26 +++++++++++++------------- indra/llui/llstatbar.h | 8 ++++---- indra/llui/llstatgraph.h | 8 ++++---- indra/llui/lltextbase.cpp | 1 - 4 files changed, 21 insertions(+), 22 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index bc8235132e..24256c3193 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -284,7 +284,7 @@ S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const return num_rapid_changes; } -S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::TraceType& stat, const F32Seconds time_period) +S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::StatType& stat, const F32Seconds time_period) { F32Seconds elapsed_time, time_since_value_changed; @@ -332,7 +332,7 @@ void LLStatBar::draw() { case STAT_COUNT: { - const LLTrace::TraceType& count_stat = *mStat.countStatp; + const LLTrace::StatType& count_stat = *mStat.countStatp; unit_label = std::string(count_stat.getUnitLabel()) + "/s"; current = last_frame_recording.getPerSec(count_stat); @@ -344,7 +344,7 @@ void LLStatBar::draw() break; case STAT_EVENT: { - const LLTrace::TraceType& event_stat = *mStat.eventStatp; + const LLTrace::StatType& event_stat = *mStat.eventStatp; unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel; current = last_frame_recording.getLastValue(event_stat); @@ -356,7 +356,7 @@ void LLStatBar::draw() break; case STAT_SAMPLE: { - const LLTrace::TraceType& sample_stat = *mStat.sampleStatp; + const LLTrace::StatType& sample_stat = *mStat.sampleStatp; unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel; current = last_frame_recording.getLastValue(sample_stat); @@ -379,7 +379,7 @@ void LLStatBar::draw() break; case STAT_MEM: { - const LLTrace::TraceType& mem_stat = *mStat.memStatp; + const LLTrace::StatType& mem_stat = *mStat.memStatp; unit_label = mUnitLabel.empty() ? mem_stat.getUnitLabel() : mUnitLabel; current = last_frame_recording.getLastValue(mem_stat).value(); @@ -578,27 +578,27 @@ void LLStatBar::draw() void LLStatBar::setStat(const std::string& stat_name) { using namespace LLTrace; - const TraceType* count_stat; - const TraceType* event_stat; - const TraceType* sample_stat; - const TraceType* mem_stat; + const StatType* count_stat; + const StatType* event_stat; + const StatType* sample_stat; + const StatType* mem_stat; - if ((count_stat = TraceType::getInstance(stat_name))) + if ((count_stat = StatType::getInstance(stat_name))) { mStat.countStatp = count_stat; mStatType = STAT_COUNT; } - else if ((event_stat = TraceType::getInstance(stat_name))) + else if ((event_stat = StatType::getInstance(stat_name))) { mStat.eventStatp = event_stat; mStatType = STAT_EVENT; } - else if ((sample_stat = TraceType::getInstance(stat_name))) + else if ((sample_stat = StatType::getInstance(stat_name))) { mStat.sampleStatp = sample_stat; mStatType = STAT_SAMPLE; } - else if ((mem_stat = TraceType::getInstance(stat_name))) + else if ((mem_stat = StatType::getInstance(stat_name))) { mStat.memStatp = mem_stat; mStatType = STAT_MEM; diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 5e9255b9eb..57e492bc80 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -105,10 +105,10 @@ private: union { void* valid; - const LLTrace::TraceType* countStatp; - const LLTrace::TraceType* eventStatp; - const LLTrace::TraceType* sampleStatp; - const LLTrace::TraceType* memStatp; + const LLTrace::StatType* countStatp; + const LLTrace::StatType* eventStatp; + const LLTrace::StatType* sampleStatp; + const LLTrace::StatType* memStatp; } mStat; LLUIString mLabel; diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 38fe12d18b..f381e92a4d 100755 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,9 +57,9 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative* > count_stat_float; - Alternative* > event_stat_float; - Alternative* > sample_stat_float; + Alternative* > count_stat_float; + Alternative* > event_stat_float; + Alternative* > sample_stat_float; }; struct Params : public LLInitParam::Block @@ -104,7 +104,7 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLTrace::TraceType* mNewStatFloatp; + LLTrace::StatType* mNewStatFloatp; BOOL mPerSec; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 730c3b2ada..00382125a8 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1871,7 +1871,6 @@ LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index) // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } - //FIXME: avoid operator new somehow (without running into refcount problems) index_segment->setStart(index); index_segment->setEnd(index); segment_set_t::iterator it = mSegments.upper_bound(index_segment); -- cgit v1.2.3 From 697d2e720ba75e142a4d56ae8794bab8d7698dad Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 15 Oct 2013 20:24:42 -0700 Subject: renamed TimeBlock to BlockTimerStatHandle --- indra/llui/llfloater.cpp | 6 +++--- indra/llui/llfolderview.cpp | 8 ++++---- indra/llui/llfolderviewitem.cpp | 2 +- indra/llui/llkeywords.cpp | 2 +- indra/llui/lllayoutstack.cpp | 2 +- indra/llui/llpanel.cpp | 10 +++++----- indra/llui/llscrolllistctrl.cpp | 2 +- indra/llui/lltextbase.cpp | 8 ++++---- indra/llui/lltexteditor.cpp | 2 +- indra/llui/lltrans.cpp | 2 +- indra/llui/lluictrl.cpp | 2 +- indra/llui/lluictrlfactory.cpp | 12 ++++++------ indra/llui/lluictrlfactory.h | 6 +++--- indra/llui/lluistring.cpp | 2 +- indra/llui/llview.cpp | 2 +- indra/llui/llxuiparser.cpp | 2 +- 16 files changed, 35 insertions(+), 35 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d077c6cf08..6cb77e51a9 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3114,8 +3114,8 @@ boost::signals2::connection LLFloater::setCloseCallback( const commit_signal_t:: return mCloseSignal.connect(cb); } -LLTrace::TimeBlock POST_BUILD("Floater Post Build"); -static LLTrace::TimeBlock FTM_EXTERNAL_FLOATER_LOAD("Load Extern Floater Reference"); +LLTrace::BlockTimerStatHandle POST_BUILD("Floater Post Build"); +static LLTrace::BlockTimerStatHandle FTM_EXTERNAL_FLOATER_LOAD("Load Extern Floater Reference"); bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node) { @@ -3270,7 +3270,7 @@ bool LLFloater::isVisible(const LLFloater* floater) return floater && floater->getVisible(); } -static LLTrace::TimeBlock FTM_BUILD_FLOATERS("Build Floaters"); +static LLTrace::BlockTimerStatHandle FTM_BUILD_FLOATERS("Build Floaters"); bool LLFloater::buildFromFile(const std::string& filename) { diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index e6582a7ae9..253b23b2fb 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -318,7 +318,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height ) return llround(mTargetHeight); } -static LLTrace::TimeBlock FTM_FILTER("Filter Folder View"); +static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { @@ -482,7 +482,7 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected) return rv; } -static LLTrace::TimeBlock FTM_SANITIZE_SELECTION("Sanitize Selection"); +static LLTrace::BlockTimerStatHandle FTM_SANITIZE_SELECTION("Sanitize Selection"); void LLFolderView::sanitizeSelection() { LL_RECORD_BLOCK_TIME(FTM_SANITIZE_SELECTION); @@ -1588,8 +1588,8 @@ void LLFolderView::setShowSingleSelection(bool show) } } -static LLTrace::TimeBlock FTM_AUTO_SELECT("Open and Select"); -static LLTrace::TimeBlock FTM_INVENTORY("Inventory"); +static LLTrace::BlockTimerStatHandle FTM_AUTO_SELECT("Open and Select"); +static LLTrace::BlockTimerStatHandle FTM_INVENTORY("Inventory"); // Main idle routine void LLFolderView::update() diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index ac36cd1173..c8c0603abf 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -942,7 +942,7 @@ void LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder) folder->addFolder(this); } -static LLTrace::TimeBlock FTM_ARRANGE("Arrange"); +static LLTrace::BlockTimerStatHandle FTM_ARRANGE("Arrange"); // Make everything right and in the right place ready for drawing (CHUI-849) // * Sort everything correctly if necessary diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 569e8be450..d830df8772 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -347,7 +347,7 @@ LLColor3 LLKeywords::readColor( const std::string& s ) return LLColor3( r, g, b ); } -LLTrace::TimeBlock FTM_SYNTAX_COLORING("Syntax Coloring"); +LLTrace::BlockTimerStatHandle FTM_SYNTAX_COLORING("Syntax Coloring"); // Walk through a string, applying the rules specified by the keyword token list and // create a list of color segments. diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 762869fa1e..b13f61ea7e 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -349,7 +349,7 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed) mNeedsLayout = true; } -static LLTrace::TimeBlock FTM_UPDATE_LAYOUT("Update LayoutStacks"); +static LLTrace::BlockTimerStatHandle FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout() { diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index f0157a2dec..f2acff9d55 100755 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -372,7 +372,7 @@ void LLPanel::setBorderVisible(BOOL b) } } -LLTrace::TimeBlock FTM_PANEL_CONSTRUCTION("Panel Construction"); +LLTrace::BlockTimerStatHandle FTM_PANEL_CONSTRUCTION("Panel Construction"); LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_node) { @@ -488,9 +488,9 @@ void LLPanel::initFromParams(const LLPanel::Params& p) setAcceptsBadge(p.accepts_badge); } -static LLTrace::TimeBlock FTM_PANEL_SETUP("Panel Setup"); -static LLTrace::TimeBlock FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); -static LLTrace::TimeBlock FTM_PANEL_POSTBUILD("Panel PostBuild"); +static LLTrace::BlockTimerStatHandle FTM_PANEL_SETUP("Panel Setup"); +static LLTrace::BlockTimerStatHandle FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); +static LLTrace::BlockTimerStatHandle FTM_PANEL_POSTBUILD("Panel PostBuild"); BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node, const LLPanel::Params& default_params) { @@ -963,7 +963,7 @@ boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t:: return mVisibleSignal->connect(cb); } -static LLTrace::TimeBlock FTM_BUILD_PANELS("Build Panels"); +static LLTrace::BlockTimerStatHandle FTM_BUILD_PANELS("Build Panels"); //----------------------------------------------------------------------------- // buildPanel() diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 777a4b80b9..b9c87cc631 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2840,7 +2840,7 @@ LLScrollListColumn* LLScrollListCtrl::getColumn(const std::string& name) return NULL; } -LLTrace::TimeBlock FTM_ADD_SCROLLLIST_ELEMENT("Add Scroll List Item"); +LLTrace::BlockTimerStatHandle FTM_ADD_SCROLLLIST_ELEMENT("Add Scroll List Item"); LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata) { LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 1c64751fbc..f08aeecc99 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1437,7 +1437,7 @@ S32 LLTextBase::getLeftOffset(S32 width) } -static LLTrace::TimeBlock FTM_TEXT_REFLOW ("Text Reflow"); +static LLTrace::BlockTimerStatHandle FTM_TEXT_REFLOW ("Text Reflow"); void LLTextBase::reflow() { LL_RECORD_BLOCK_TIME(FTM_TEXT_REFLOW); @@ -1779,7 +1779,7 @@ void LLTextBase::removeDocumentChild(LLView* view) } -static LLTrace::TimeBlock FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); +static LLTrace::BlockTimerStatHandle FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); void LLTextBase::updateSegments() { LL_RECORD_BLOCK_TIME(FTM_UPDATE_TEXT_SEGMENTS); @@ -2020,7 +2020,7 @@ static LLUIImagePtr image_from_icon_name(const std::string& icon_name) } } -static LLTrace::TimeBlock FTM_PARSE_HTML("Parse HTML"); +static LLTrace::BlockTimerStatHandle FTM_PARSE_HTML("Parse HTML"); void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params) { @@ -2097,7 +2097,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para } } -static LLTrace::TimeBlock FTM_APPEND_TEXT("Append Text"); +static LLTrace::BlockTimerStatHandle FTM_APPEND_TEXT("Append Text"); void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, const LLStyle::Params& input_params) { diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 4467f04e5b..04ea60a4c2 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2501,7 +2501,7 @@ BOOL LLTextEditor::tryToRevertToPristineState() } -static LLTrace::TimeBlock FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); +static LLTrace::BlockTimerStatHandle FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); void LLTextEditor::loadKeywords(const std::string& filename, const std::vector& funcs, const std::vector& tooltips, diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp index ad7fb005f5..4d4ff4236d 100755 --- a/indra/llui/lltrans.cpp +++ b/indra/llui/lltrans.cpp @@ -135,7 +135,7 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root) -static LLTrace::TimeBlock FTM_GET_TRANS("Translate string"); +static LLTrace::BlockTimerStatHandle FTM_GET_TRANS("Translate string"); //static std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args) diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 546cd6fc46..ef364dd3d3 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -737,7 +737,7 @@ public: } }; -LLTrace::TimeBlock FTM_FOCUS_FIRST_ITEM("Focus First Item"); +LLTrace::BlockTimerStatHandle FTM_FOCUS_FIRST_ITEM("Focus First Item"); BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash) { diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 1f5d77a958..4cc7da1267 100755 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -44,9 +44,9 @@ // this library includes #include "llpanel.h" -LLTrace::TimeBlock FTM_WIDGET_CONSTRUCTION("Widget Construction"); -LLTrace::TimeBlock FTM_INIT_FROM_PARAMS("Widget InitFromParams"); -LLTrace::TimeBlock FTM_WIDGET_SETUP("Widget Setup"); +LLTrace::BlockTimerStatHandle FTM_WIDGET_CONSTRUCTION("Widget Construction"); +LLTrace::BlockTimerStatHandle FTM_INIT_FROM_PARAMS("Widget InitFromParams"); +LLTrace::BlockTimerStatHandle FTM_WIDGET_SETUP("Widget Setup"); //----------------------------------------------------------------------------- @@ -105,7 +105,7 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa } } -static LLTrace::TimeBlock FTM_CREATE_CHILDREN("Create XUI Children"); +static LLTrace::BlockTimerStatHandle FTM_CREATE_CHILDREN("Create XUI Children"); //static void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node) @@ -147,7 +147,7 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid } -static LLTrace::TimeBlock FTM_XML_PARSE("XML Reading/Parsing"); +static LLTrace::BlockTimerStatHandle FTM_XML_PARSE("XML Reading/Parsing"); //----------------------------------------------------------------------------- // getLayeredXMLNode() //----------------------------------------------------------------------------- @@ -179,7 +179,7 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static LLTrace::TimeBlock FTM_CREATE_FROM_XML("Create child widget"); +static LLTrace::BlockTimerStatHandle FTM_CREATE_FROM_XML("Create child widget"); LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t& registry, LLXMLNodePtr output_node) { diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 678e837fa1..a5796c8af2 100755 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -74,9 +74,9 @@ class LLWidgetNameRegistry //: public LLRegistrySingleton //{}; -extern LLTrace::TimeBlock FTM_WIDGET_SETUP; -extern LLTrace::TimeBlock FTM_WIDGET_CONSTRUCTION; -extern LLTrace::TimeBlock FTM_INIT_FROM_PARAMS; +extern LLTrace::BlockTimerStatHandle FTM_WIDGET_SETUP; +extern LLTrace::BlockTimerStatHandle FTM_WIDGET_CONSTRUCTION; +extern LLTrace::BlockTimerStatHandle FTM_INIT_FROM_PARAMS; // Build time optimization, generate this once in .cpp file #ifndef LLUICTRLFACTORY_CPP diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index 9a6810947e..98d0c215e6 100755 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -31,7 +31,7 @@ #include "llsd.h" #include "lltrans.h" -LLTrace::TimeBlock FTM_UI_STRING("UI String"); +LLTrace::BlockTimerStatHandle FTM_UI_STRING("UI String"); LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index e3b3444a00..1982c97b8c 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1504,7 +1504,7 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const return getChild(name, recurse); } -static LLTrace::TimeBlock FTM_FIND_VIEWS("Find Widgets"); +static LLTrace::BlockTimerStatHandle FTM_FIND_VIEWS("Find Widgets"); LLView* LLView::findChildView(const std::string& name, BOOL recurse) const { diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 46b089fd02..4390ca83e9 100755 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -677,7 +677,7 @@ LLXUIParser::LLXUIParser() } } -static LLTrace::TimeBlock FTM_PARSE_XUI("XUI Parsing"); +static LLTrace::BlockTimerStatHandle FTM_PARSE_XUI("XUI Parsing"); const LLXMLNodePtr DUMMY_NODE = new LLXMLNode(); void LLXUIParser::readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, const std::string& filename, bool silent) -- cgit v1.2.3 From 04397a095acd6ceeb280b3fc82cf122fd6ccf43a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 21 Oct 2013 12:29:33 -0700 Subject: more buildfix --- indra/llui/llbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 2c6aab9fff..f51dfe4707 100755 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -778,7 +778,7 @@ void LLButton::draw() if (use_glow_effect) { mCurGlowStrength = lerp(mCurGlowStrength, - mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.0 : 0.0) : mHoverGlowStrength, + mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.f : 0.f) : mHoverGlowStrength, LLSmoothInterpolation::getInterpolant(0.05f)); } else -- cgit v1.2.3 From 155ca2f926afcbfd86b42ce6db68684ed266ef67 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 29 Oct 2013 16:23:53 -0700 Subject: fixed timer bars not appearing in fast timer view fixed "bouncing" stat values when a value ended in zeroes --- indra/llui/llstatbar.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 24256c3193..2b325c27f0 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -327,6 +327,7 @@ void LLStatBar::draw() ? mNumHistoryFrames : mNumShortHistoryFrames; S32 num_rapid_changes = 0; + S32 decimal_digits = mDecimalDigits; switch(mStatType) { @@ -374,6 +375,10 @@ void LLStatBar::draw() display_value = current; // always display current value, don't rate limit mLastDisplayValue = current; + if (is_approx_equal((F32)(S32)display_value, display_value)) + { + decimal_digits = 0; + } } } break; @@ -412,12 +417,6 @@ void LLStatBar::draw() mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mMaxBar, 0.05f); mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mMinBar, 0.05f); - S32 decimal_digits = mDecimalDigits; - if (is_approx_equal((F32)(S32)display_value, display_value)) - { - decimal_digits = 0; - } - // rate limited updates if (mLastDisplayValueTimer.getElapsedTimeF32() < MEAN_VALUE_UPDATE_TIME) { -- cgit v1.2.3 From ea2494a0839ec02d3889a405306009c2f4f9aea7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 30 Oct 2013 00:37:11 -0700 Subject: stats now autoscale back down in range, instead of sticking at high water mark --- indra/llui/llstatbar.cpp | 132 ++++++++++++++++++++--------------------------- indra/llui/llstatbar.h | 30 ++++++----- 2 files changed, 73 insertions(+), 89 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 2b325c27f0..bfdc6571c2 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -176,8 +176,8 @@ LLStatBar::LLStatBar(const Params& p) : LLView(p), mLabel(p.label), mUnitLabel(p.unit_label), - mMinBar(llmin(p.bar_min, p.bar_max)), - mMaxBar(llmax(p.bar_max, p.bar_min)), + mTargetMinBar(llmin(p.bar_min, p.bar_max)), + mTargetMaxBar(llmax(p.bar_max, p.bar_min)), mCurMaxBar(p.bar_max), mCurMinBar(0), mDecimalDigits(p.decimal_digits), @@ -189,15 +189,18 @@ LLStatBar::LLStatBar(const Params& p) mOrientation(p.orientation), mAutoScaleMax(!p.bar_max.isProvided()), mAutoScaleMin(!p.bar_min.isProvided()), - mTickValue(p.tick_spacing), + mTickSpacing(p.tick_spacing), mLastDisplayValue(0.f), mStatType(STAT_NONE) { + mFloatingTargetMinBar = mTargetMinBar; + mFloatingTargetMaxBar = mTargetMaxBar; + mStat.valid = NULL; // tick value will be automatically calculated later if (!p.tick_spacing.isProvided() && p.bar_min.isProvided() && p.bar_max.isProvided()) { - mTickValue = calc_tick_value(mMinBar, mMaxBar); + mTickSpacing = calc_tick_value(mTargetMinBar, mTargetMaxBar); } setStat(p.stat); @@ -259,12 +262,12 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) template S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const F32Seconds time_period) { - F32Seconds elapsed_time, - time_since_value_changed; - S32 num_rapid_changes = 0; - const F32Seconds RAPID_CHANGE_THRESHOLD = F32Seconds(0.3f); + F32Seconds elapsed_time, + time_since_value_changed; + S32 num_rapid_changes = 0; + const F32Seconds RAPID_CHANGE_THRESHOLD = F32Seconds(0.3f); + F64 last_value = periodic_recording.getPrevRecording(1).getLastValue(stat); - F64 last_value = periodic_recording.getPrevRecording(1).getLastValue(stat); for (S32 i = 2; i < periodic_recording.getNumRecordedPeriods(); i++) { LLTrace::Recording& recording = periodic_recording.getPrevRecording(i); @@ -284,32 +287,6 @@ S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const return num_rapid_changes; } -S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::StatType& stat, const F32Seconds time_period) -{ - F32Seconds elapsed_time, - time_since_value_changed; - S32 num_rapid_changes = 0; - - F64 last_value = periodic_recording.getPrevRecording(1).getSum(stat); - for (S32 i = 1; i < periodic_recording.getNumRecordedPeriods(); i++) - { - LLTrace::Recording& recording = periodic_recording.getPrevRecording(i); - F64 cur_value = recording.getSum(stat); - - if (last_value != cur_value) - { - if (time_since_value_changed < RAPID_CHANGE_THRESHOLD) num_rapid_changes++; - time_since_value_changed = (F32Seconds)0; - } - last_value = cur_value; - - elapsed_time += recording.getDuration(); - if (elapsed_time > time_period) break; - } - - return num_rapid_changes; -} - void LLStatBar::draw() { LLLocalClipRect _(getLocalRect()); @@ -318,16 +295,16 @@ void LLStatBar::draw() LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); std::string unit_label; - F32 current = 0, - min = 0, - max = 0, - mean = 0, - display_value = 0; - S32 num_frames = mDisplayHistory - ? mNumHistoryFrames - : mNumShortHistoryFrames; - S32 num_rapid_changes = 0; - S32 decimal_digits = mDecimalDigits; + F32 current = 0, + min = 0, + max = 0, + mean = 0, + display_value = 0; + S32 num_frames = mDisplayHistory + ? mNumHistoryFrames + : mNumShortHistoryFrames; + S32 num_rapid_changes = 0; + S32 decimal_digits = mDecimalDigits; switch(mStatType) { @@ -414,8 +391,8 @@ void LLStatBar::draw() bar_rect.mBottom = llmin(bar_rect.mTop - 5, 20); } - mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mMaxBar, 0.05f); - mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mMinBar, 0.05f); + mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mTargetMaxBar, 0.05f); + mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mTargetMinBar, 0.05f); // rate limited updates if (mLastDisplayValueTimer.getElapsedTimeF32() < MEAN_VALUE_UPDATE_TIME) @@ -429,7 +406,6 @@ void LLStatBar::draw() drawLabelAndValue(display_value, unit_label, bar_rect, decimal_digits); mLastDisplayValue = display_value; - if (mDisplayBar && mStat.valid) { // Draw the tick marks. @@ -607,9 +583,11 @@ void LLStatBar::setStat(const std::string& stat_name) void LLStatBar::setRange(F32 bar_min, F32 bar_max) { - mMinBar = llmin(bar_min, bar_max); - mMaxBar = llmax(bar_min, bar_max); - mTickValue = calc_tick_value(mMinBar, mMaxBar); + mTargetMinBar = llmin(bar_min, bar_max); + mTargetMaxBar = llmax(bar_min, bar_max); + mFloatingTargetMinBar = mTargetMinBar; + mFloatingTargetMaxBar = mTargetMaxBar; + mTickSpacing = calc_tick_value(mTargetMinBar, mTargetMaxBar); } LLRect LLStatBar::getRequiredRect() @@ -660,21 +638,24 @@ void LLStatBar::drawLabelAndValue( F32 value, std::string &label, LLRect &bar_re void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) { - if ((mAutoScaleMax && max >= mCurMaxBar)|| (mAutoScaleMin && min <= mCurMinBar)) + if (mAutoScaleMax || mAutoScaleMin) { - F32 range_min = mAutoScaleMin ? llmin(mMinBar, min) : mMinBar; - F32 range_max = mAutoScaleMax ? llmax(mMaxBar, max) : mMaxBar; + F32 u = LLSmoothInterpolation::getInterpolant(10.f); + mFloatingTargetMinBar = llmin(min, lerp(mFloatingTargetMinBar, min, u)); + mFloatingTargetMaxBar = llmax(max, lerp(mFloatingTargetMaxBar, max, u)); + F32 range_min = mAutoScaleMin ? mFloatingTargetMinBar : mTargetMinBar; + F32 range_max = mAutoScaleMax ? mFloatingTargetMaxBar : mTargetMaxBar; F32 tick_value = 0.f; calc_auto_scale_range(range_min, range_max, tick_value); - if (mAutoScaleMin) { mMinBar = range_min; } - if (mAutoScaleMax) { mMaxBar = range_max; } + if (mAutoScaleMin) { mTargetMinBar = range_min; } + if (mAutoScaleMax) { mTargetMaxBar = range_max; } if (mAutoScaleMin && mAutoScaleMax) { - mTickValue = tick_value; + mTickSpacing = tick_value; } else { - mTickValue = calc_tick_value(mMinBar, mMaxBar); + mTickSpacing = calc_tick_value(mTargetMinBar, mTargetMaxBar); } } @@ -682,7 +663,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) // ensure ticks always hit 0 S32 last_tick = S32_MIN; S32 last_label = S32_MIN; - if (mTickValue > 0.f && value_scale > 0.f) + if (mTickSpacing > 0.f && value_scale > 0.f) { const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30; const S32 MIN_LABEL_SPACING = mOrientation == HORIZONTAL ? 30 : 60; @@ -690,17 +671,18 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) const S32 TICK_WIDTH = 1; F32 start = mCurMinBar < 0.f - ? llceil(-mCurMinBar / mTickValue) * -mTickValue + ? llceil(-mCurMinBar / mTickSpacing) * -mTickSpacing : 0.f; - for (F32 tick_value = start; ;tick_value += mTickValue) + for (F32 tick_value = start; ;tick_value += mTickSpacing) { - const S32 begin = llfloor((tick_value - mCurMinBar)*value_scale); - const S32 end = begin + TICK_WIDTH; - if (begin < last_tick + MIN_TICK_SPACING) + // clamp to S32_MAX / 2 to avoid floating point to integer overflow resulting in S32_MIN + const S32 tick_begin = llfloor(llmin((F32)(S32_MAX / 2), (tick_value - mCurMinBar)*value_scale)); + const S32 tick_end = tick_begin + TICK_WIDTH; + if (tick_begin < last_tick + MIN_TICK_SPACING) { continue; } - last_tick = begin; + last_tick = tick_begin; S32 decimal_digits = mDecimalDigits; if (is_approx_equal((F32)(S32)tick_value, tick_value)) @@ -711,25 +693,25 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) S32 tick_label_width = LLFontGL::getFontMonospace()->getWidth(tick_label); if (mOrientation == HORIZONTAL) { - if (begin > last_label + MIN_LABEL_SPACING) + if (tick_begin > last_label + MIN_LABEL_SPACING) { - gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight - TICK_LENGTH, begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); - LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, bar_rect.mRight, begin, + gl_rect_2d(bar_rect.mLeft, tick_end, bar_rect.mRight - TICK_LENGTH, tick_begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); + LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, bar_rect.mRight, tick_begin, LLColor4(1.f, 1.f, 1.f, 0.5f), LLFontGL::LEFT, LLFontGL::VCENTER); - last_label = begin; + last_label = tick_begin; } else { - gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight - TICK_LENGTH/2, begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); + gl_rect_2d(bar_rect.mLeft, tick_end, bar_rect.mRight - TICK_LENGTH/2, tick_begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); } } else { - if (begin > last_label + MIN_LABEL_SPACING) + if (tick_begin > last_label + MIN_LABEL_SPACING) { - gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f)); - S32 label_pos = begin - llround((F32)tick_label_width * ((F32)begin / (F32)bar_rect.getWidth())); + gl_rect_2d(tick_begin, bar_rect.mTop, tick_end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f)); + S32 label_pos = tick_begin - llround((F32)tick_label_width * ((F32)tick_begin / (F32)bar_rect.getWidth())); LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, label_pos, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.5f), LLFontGL::LEFT, LLFontGL::TOP); @@ -737,10 +719,10 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) } else { - gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom - TICK_LENGTH/2, LLColor4(1.f, 1.f, 1.f, 0.1f)); + gl_rect_2d(tick_begin, bar_rect.mTop, tick_end, bar_rect.mBottom - TICK_LENGTH/2, LLColor4(1.f, 1.f, 1.f, 0.1f)); } } - // always draw one tick value past end, so we can see part of the text, if possible + // always draw one tick value past tick_end, so we can see part of the text, if possible if (tick_value > mCurMaxBar) { break; diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 57e492bc80..89d7ff24ed 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -44,13 +44,12 @@ public: bar_max, tick_spacing; - Optional decimal_digits; - Optional show_bar, show_history, scale_range; - Optional num_frames, + Optional decimal_digits, + num_frames, num_frames_short, max_height; Optional stat; @@ -67,7 +66,7 @@ public: void setStat(const std::string& stat_name); void setRange(F32 bar_min, F32 bar_max); - void getRange(F32& bar_min, F32& bar_max) { bar_min = mMinBar; bar_max = mMaxBar; } + void getRange(F32& bar_min, F32& bar_max) { bar_min = mTargetMinBar; bar_max = mTargetMaxBar; } /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. @@ -75,20 +74,18 @@ private: void drawLabelAndValue( F32 mean, std::string &unit_label, LLRect &bar_rect, S32 decimal_digits ); void drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ); - F32 mMinBar, - mMaxBar, + F32 mTargetMinBar, + mTargetMaxBar, + mFloatingTargetMinBar, + mFloatingTargetMaxBar, mCurMaxBar, mCurMinBar, - mLabelSpacing; - F32 mTickValue; - U32 mDecimalDigits; - S32 mNumHistoryFrames, + mLabelSpacing, + mTickSpacing; + S32 mDecimalDigits, + mNumHistoryFrames, mNumShortHistoryFrames; S32 mMaxHeight; - bool mDisplayBar, // Display the bar graph. - mDisplayHistory, - mAutoScaleMax, - mAutoScaleMin; EOrientation mOrientation; F32 mLastDisplayValue; LLFrameTimer mLastDisplayValueTimer; @@ -113,6 +110,11 @@ private: LLUIString mLabel; std::string mUnitLabel; + + bool mDisplayBar, // Display the bar graph. + mDisplayHistory, + mAutoScaleMax, + mAutoScaleMin; }; #endif -- cgit v1.2.3 From c35801ef1c56b6c84063f47b490a8d2220b77ca7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 5 Nov 2013 19:26:23 -0800 Subject: fixed focus issue on inventory --- indra/llui/lliconctrl.cpp | 26 +++++----- indra/llui/lliconctrl.h | 10 ++-- indra/llui/lllayoutstack.cpp | 118 ++++++++++++++++++++++++++++++++++--------- indra/llui/llresizebar.cpp | 78 +--------------------------- indra/llui/llresizebar.h | 15 ++---- 5 files changed, 117 insertions(+), 130 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index 30b79b4d20..58b66f60ca 100755 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -42,7 +42,9 @@ LLIconCtrl::Params::Params() : image("image_name"), color("color"), use_draw_context_alpha("use_draw_context_alpha", true), - scale_image("scale_image") + scale_image("scale_image"), + min_width("min_width", 0), + min_height("min_height", 0) {} LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) @@ -51,8 +53,8 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) mImagep(p.image), mUseDrawContextAlpha(p.use_draw_context_alpha), mPriority(0), - mDrawWidth(0), - mDrawHeight(0) + mMinWidth(p.min_width), + mMinHeight(p.min_height) { if (mImagep.notNull()) { @@ -97,7 +99,13 @@ void LLIconCtrl::setValue(const LLSD& value ) mImagep = LLUI::getUIImage(tvalue.asString(), mPriority); } - setIconImageDrawSize(); + if(mImagep.notNull() + && mImagep->getImage().notNull() + && mMinWidth + && mMinHeight) + { + mImagep->getImage()->setKnownDrawSize(llmax(mMinWidth, mImagep->getWidth()), llmax(mMinHeight, mImagep->getHeight())); + } } std::string LLIconCtrl::getImageName() const @@ -108,14 +116,4 @@ std::string LLIconCtrl::getImageName() const return std::string(); } -void LLIconCtrl::setIconImageDrawSize() -{ - if(mImagep.notNull() && mDrawWidth && mDrawHeight) - { - if(mImagep->getImage().notNull()) - { - mImagep->getImage()->setKnownDrawSize(mDrawWidth, mDrawHeight) ; - } - } -} diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index a19bb99d9d..8b1092df46 100755 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -49,7 +49,10 @@ public: Optional image; Optional color; Optional use_draw_context_alpha; + Optional min_width, + min_height; Ignored scale_image; + Params(); }; protected: @@ -71,15 +74,12 @@ public: void setImage(LLPointer image) { mImagep = image; } const LLPointer getImage() { return mImagep; } -private: - void setIconImageDrawSize() ; - protected: S32 mPriority; //the output size of the icon image if set. - S32 mDrawWidth ; - S32 mDrawHeight ; + S32 mMinWidth, + mMinHeight; // If set to true (default), use the draw context transparency. // If false, will use transparency returned by getCurrentTransparency(). See STORM-698. diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index b13f61ea7e..c59286fc60 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -33,6 +33,7 @@ #include "lllocalcliprect.h" #include "llpanel.h" #include "llcriticaldamp.h" +#include "lliconctrl.h" #include "boost/foreach.hpp" static const F32 MIN_FRACTIONAL_SIZE = 0.00001f; @@ -268,25 +269,9 @@ void LLLayoutStack::draw() // only force drawing invisible children if visible amount is non-zero drawChild(panelp, 0, 0, !clip_rect.isEmpty()); } - } - - const LLView::child_list_t * child_listp = getChildList(); - BOOST_FOREACH(LLView * childp, * child_listp) - { - LLResizeBar * resize_barp = dynamic_cast(childp); - if (resize_barp && resize_barp->isShowDragHandle() && resize_barp->getVisible() && resize_barp->getRect().isValid()) + if (panelp->getResizeBar()->getVisible()) { - LLRect screen_rect = resize_barp->calcScreenRect(); - if (LLUI::getRootView()->getLocalRect().overlaps(screen_rect) && LLUI::sDirtyRect.overlaps(screen_rect)) - { - LLUI::pushMatrix(); - { - const LLRect& rb_rect(resize_barp->getRect()); - LLUI::translate(rb_rect.mLeft, rb_rect.mBottom); - resize_barp->draw(); - } - LLUI::popMatrix(); - } + drawChild(panelp->getResizeBar()); } } } @@ -351,6 +336,31 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed) static LLTrace::BlockTimerStatHandle FTM_UPDATE_LAYOUT("Update LayoutStacks"); +class LLImagePanel : public LLPanel +{ +public: + struct Params : public LLInitParam::Block + { + Optional horizontal; + Params() : horizontal("horizontal", false) {} + }; + LLImagePanel(const Params& p) : LLPanel(p), mHorizontal(p.horizontal) {} + virtual ~LLImagePanel() {} + + void draw() + { + const LLRect& parent_rect = getParent()->getRect(); + const LLRect& rect = getRect(); + LLRect clip_rect( -rect.mLeft, parent_rect.getHeight() - rect.mBottom - 2 + , parent_rect.getWidth() - rect.mLeft - (mHorizontal ? 2 : 0), -rect.mBottom); + LLLocalClipRect clip(clip_rect); + LLPanel::draw(); + } + +private: + bool mHorizontal; +}; + void LLLayoutStack::updateLayout() { LL_RECORD_BLOCK_TIME(FTM_UPDATE_LAYOUT); @@ -435,8 +445,6 @@ void LLLayoutStack::updateLayout() } LLRect resize_bar_rect(panel_rect); - LLResizeBar * resize_barp = panelp->getResizeBar(); - bool show_drag_handle = resize_barp->isShowDragHandle(); F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount(); F32 panel_visible_dim = panelp->getVisibleDim(); S32 panel_spacing_round = (S32)(llround(panel_spacing)); @@ -445,7 +453,7 @@ void LLLayoutStack::updateLayout() { cur_pos += panel_visible_dim + panel_spacing; - if (show_drag_handle && panel_spacing_round > mDragHandleThickness) + if (mShowDragHandle && panel_spacing_round > mDragHandleThickness) { resize_bar_rect.mLeft = panel_rect.mRight + mDragHandleShift; resize_bar_rect.mRight = resize_bar_rect.mLeft + mDragHandleThickness; @@ -456,7 +464,7 @@ void LLLayoutStack::updateLayout() resize_bar_rect.mRight = panel_rect.mRight + panel_spacing_round + mResizeBarOverlap; } - if (show_drag_handle) + if (mShowDragHandle) { resize_bar_rect.mBottom += mDragHandleSecondIndent; resize_bar_rect.mTop -= mDragHandleFirstIndent; @@ -467,7 +475,7 @@ void LLLayoutStack::updateLayout() { cur_pos -= panel_visible_dim + panel_spacing; - if (show_drag_handle && panel_spacing_round > mDragHandleThickness) + if (mShowDragHandle && panel_spacing_round > mDragHandleThickness) { resize_bar_rect.mTop = panel_rect.mBottom - mDragHandleShift; resize_bar_rect.mBottom = resize_bar_rect.mTop - mDragHandleThickness; @@ -478,7 +486,7 @@ void LLLayoutStack::updateLayout() resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing_round - mResizeBarOverlap; } - if (show_drag_handle) + if (mShowDragHandle) { resize_bar_rect.mLeft += mDragHandleFirstIndent; resize_bar_rect.mRight -= mDragHandleSecondIndent; @@ -541,9 +549,69 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp) resize_params.min_size(lp->getRelevantMinDim()); resize_params.side((mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM); resize_params.snapping_enabled(false); - resize_params.show_drag_handle(mShowDragHandle); LLResizeBar* resize_bar = LLUICtrlFactory::create(resize_params); lp->mResizeBar = resize_bar; + + if (mShowDragHandle) + { + LLPanel::Params resize_bar_bg_panel_p; + resize_bar_bg_panel_p.name = "resize_handle_bg_panel"; + resize_bar_bg_panel_p.rect = lp->mResizeBar->getLocalRect(); + resize_bar_bg_panel_p.follows.flags = FOLLOWS_ALL; + resize_bar_bg_panel_p.tab_stop = false; + resize_bar_bg_panel_p.background_visible = true; + resize_bar_bg_panel_p.bg_alpha_color = LLUIColorTable::instance().getColor("ResizebarBody"); + resize_bar_bg_panel_p.has_border = true; + resize_bar_bg_panel_p.border.border_thickness = 1; + resize_bar_bg_panel_p.border.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderLight"); + resize_bar_bg_panel_p.border.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark"); + + LLPanel* resize_bar_bg_panel = LLUICtrlFactory::create(resize_bar_bg_panel_p); + + LLIconCtrl::Params icon_p; + icon_p.name = "resize_handle_image"; + icon_p.rect = lp->mResizeBar->getLocalRect(); + icon_p.follows.flags = FOLLOWS_ALL; + icon_p.image = LLUI::getUIImage(mOrientation == HORIZONTAL ? "Vertical Drag Handle" : "Horizontal Drag Handle"); + resize_bar_bg_panel->addChild(LLUICtrlFactory::create(icon_p)); + + lp->mResizeBar->addChild(resize_bar_bg_panel); + } + + /*if (mShowDragHandle) + { + LLViewBorder::Params border_params; + border_params.border_thickness = 1; + border_params.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderLight"); + border_params.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark"); + + addBorder(border_params); + setBorderVisible(TRUE); + + LLImagePanel::Params image_panel; + mDragHandleImage = LLUI::getUIImage(LLResizeBar::RIGHT == mSide ? "Vertical Drag Handle" : "Horizontal Drag Handle"); + image_panel.bg_alpha_image = mDragHandleImage; + image_panel.background_visible = true; + image_panel.horizontal = (LLResizeBar::BOTTOM == mSide); + mImagePanel = LLUICtrlFactory::create(image_panel); + setImagePanel(mImagePanel); + }*/ + + //if (mShowDragHandle) + //{ + // setBackgroundVisible(TRUE); + // setTransparentColor(LLUIColorTable::instance().getColor("ResizebarBody")); + //} + + /*if (mShowDragHandle) + { + S32 image_width = mDragHandleImage->getTextureWidth(); + S32 image_height = mDragHandleImage->getTextureHeight(); + const LLRect& panel_rect = getRect(); + S32 image_left = (panel_rect.getWidth() - image_width) / 2 - 1; + S32 image_bottom = (panel_rect.getHeight() - image_height) / 2; + mImagePanel->setRect(LLRect(image_left, image_bottom + image_height, image_left + image_width, image_bottom)); + }*/ LLView::addChild(resize_bar, 0); } } diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index e67b22c977..115c4e23be 100755 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -35,46 +35,18 @@ #include "llfocusmgr.h" #include "llwindow.h" -class LLImagePanel : public LLPanel -{ -public: - struct Params : public LLInitParam::Block - { - Optional horizontal; - Params() : horizontal("horizontal", false) {} - }; - LLImagePanel(const Params& p) : LLPanel(p), mHorizontal(p.horizontal) {} - virtual ~LLImagePanel() {} - - void draw() - { - const LLRect& parent_rect = getParent()->getRect(); - const LLRect& rect = getRect(); - LLRect clip_rect( -rect.mLeft, parent_rect.getHeight() - rect.mBottom - 2 - , parent_rect.getWidth() - rect.mLeft - (mHorizontal ? 2 : 0), -rect.mBottom); - LLLocalClipRect clip(clip_rect); - LLPanel::draw(); - } - -private: - bool mHorizontal; -}; - -static LLDefaultChildRegistry::Register t1("resize_bar_image_panel"); - LLResizeBar::Params::Params() : max_size("max_size", S32_MAX), snapping_enabled("snapping_enabled", true), resizing_view("resizing_view"), side("side"), - allow_double_click_snapping("allow_double_click_snapping", true), - show_drag_handle("show_drag_handle", false) + allow_double_click_snapping("allow_double_click_snapping", true) { name = "resize_bar"; } LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) -: LLPanel(p), +: LLView(p), mDragLastScreenX( 0 ), mDragLastScreenY( 0 ), mLastMouseScreenX( 0 ), @@ -86,7 +58,6 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) mAllowDoubleClickSnapping(p.allow_double_click_snapping), mResizingView(p.resizing_view), mResizeListener(NULL), - mShowDragHandle(p.show_drag_handle), mImagePanel(NULL) { setFollowsNone(); @@ -116,36 +87,6 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) default: break; } - - if (mShowDragHandle) - { - LLViewBorder::Params border_params; - border_params.border_thickness = 1; - border_params.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderLight"); - border_params.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark"); - - addBorder(border_params); - setBorderVisible(TRUE); - - LLImagePanel::Params image_panel; - mDragHandleImage = LLUI::getUIImage(LLResizeBar::RIGHT == mSide ? "Vertical Drag Handle" : "Horizontal Drag Handle"); - image_panel.bg_alpha_image = mDragHandleImage; - image_panel.background_visible = true; - image_panel.horizontal = (LLResizeBar::BOTTOM == mSide); - mImagePanel = LLUICtrlFactory::create(image_panel); - setImagePanel(mImagePanel); - } -} - -BOOL LLResizeBar::postBuild() -{ - if (mShowDragHandle) - { - setBackgroundVisible(TRUE); - setTransparentColor(LLUIColorTable::instance().getColor("ResizebarBody")); - } - - return LLPanel::postBuild(); } BOOL LLResizeBar::handleMouseDown(S32 x, S32 y, MASK mask) @@ -433,18 +374,3 @@ LLPanel * LLResizeBar::getImagePanel() const { return getChildCount() > 0 ? (LLPanel *)getChildList()->back() : NULL; } - -void LLResizeBar::draw() -{ - if (mShowDragHandle) - { - S32 image_width = mDragHandleImage->getTextureWidth(); - S32 image_height = mDragHandleImage->getTextureHeight(); - const LLRect& panel_rect = getRect(); - S32 image_left = (panel_rect.getWidth() - image_width) / 2 - 1; - S32 image_bottom = (panel_rect.getHeight() - image_height) / 2; - mImagePanel->setRect(LLRect(image_left, image_bottom + image_height, image_left + image_width, image_bottom)); - } - - LLPanel::draw(); -} diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index bcf8ea0b40..20a2406484 100755 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -27,14 +27,14 @@ #ifndef LL_RESIZEBAR_H #define LL_RESIZEBAR_H -#include "llpanel.h" +#include "llview.h" -class LLResizeBar : public LLPanel +class LLResizeBar : public LLView { public: enum Side { LEFT, TOP, RIGHT, BOTTOM }; - struct Params : public LLInitParam::Block + struct Params : public LLInitParam::Block { Mandatory resizing_view; Mandatory side; @@ -43,7 +43,6 @@ public: Optional max_size; Optional snapping_enabled; Optional allow_double_click_snapping; - Optional show_drag_handle; Params(); }; @@ -52,10 +51,8 @@ protected: LLResizeBar(const LLResizeBar::Params& p); friend class LLUICtrlFactory; - /*virtual*/ BOOL postBuild(); public: - virtual void draw(); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -66,7 +63,6 @@ public: void setAllowDoubleClickSnapping(BOOL allow) { mAllowDoubleClickSnapping = allow; } bool canResize() { return getEnabled() && mMaxSize > mMinSize; } void setResizeListener(boost::function listener) {mResizeListener = listener;} - BOOL isShowDragHandle() const { return mShowDragHandle; } void setImagePanel(LLPanel * panelp); LLPanel * getImagePanel() const; @@ -79,9 +75,8 @@ private: S32 mMinSize; S32 mMaxSize; const Side mSide; - BOOL mSnappingEnabled; - BOOL mAllowDoubleClickSnapping; - BOOL mShowDragHandle; + bool mSnappingEnabled, + mAllowDoubleClickSnapping; LLView* mResizingView; boost::function mResizeListener; LLPointer mDragHandleImage; -- cgit v1.2.3 From a10eb7b240675b009430f6718d410399d8045581 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 5 Nov 2013 19:30:38 -0800 Subject: further fix of inventory keyboard focus and tab order calculations --- indra/llui/llfloater.cpp | 7 -- indra/llui/llpanel.cpp | 201 +++++---------------------------------------- indra/llui/llpanel.h | 38 +-------- indra/llui/lluictrl.cpp | 149 +++++++++++++++------------------ indra/llui/lluictrl.h | 3 - indra/llui/llview.cpp | 172 +++++++++++++++++--------------------- indra/llui/llview.h | 34 ++------ indra/llui/llviewquery.cpp | 25 ++---- indra/llui/llviewquery.h | 7 +- 9 files changed, 177 insertions(+), 459 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 6cb77e51a9..44a919a303 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2905,13 +2905,6 @@ void LLFloaterView::syncFloaterTabOrder() } } } - - // sync draw order to tab order - for ( child_list_const_reverse_iter_t child_it = getChildList()->rbegin(); child_it != getChildList()->rend(); ++child_it) - { - LLFloater* floaterp = (LLFloater*)*child_it; - moveChildToFrontOfTabGroup(floaterp); - } } LLFloater* LLFloaterView::getParentFloater(LLView* viewp) const diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index f2acff9d55..ee90574161 100755 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -38,10 +38,8 @@ #include "lldir.h" #include "lltimer.h" -#include "llaccordionctrltab.h" #include "llbutton.h" #include "llmenugl.h" -//#include "llstatusbar.h" #include "llui.h" #include "llkeyboard.h" #include "lllineeditor.h" @@ -50,7 +48,6 @@ #include "lluictrl.h" #include "lluictrlfactory.h" #include "llviewborder.h" -#include "lltabcontainer.h" static LLDefaultChildRegistry::Register r1("panel", &LLPanel::fromXML); LLPanel::factory_stack_t LLPanel::sFactoryStack; @@ -166,8 +163,8 @@ void LLPanel::removeBorder() // virtual void LLPanel::clearCtrls() { - LLView::ctrl_list_t ctrls = getCtrlList(); - for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it) + LLPanel::ctrl_list_t ctrls = getCtrlList(); + for (LLPanel::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it) { LLUICtrl* ctrl = *ctrl_it; ctrl->setFocus( FALSE ); @@ -178,14 +175,29 @@ void LLPanel::clearCtrls() void LLPanel::setCtrlsEnabled( BOOL b ) { - LLView::ctrl_list_t ctrls = getCtrlList(); - for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it) + LLPanel::ctrl_list_t ctrls = getCtrlList(); + for (LLPanel::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it) { LLUICtrl* ctrl = *ctrl_it; ctrl->setEnabled( b ); } } +LLPanel::ctrl_list_t LLPanel::getCtrlList() const +{ + ctrl_list_t controls; + for(child_list_t::const_iterator it = getChildList()->begin(), end_it = getChildList()->end(); it != end_it; ++it) + { + LLView* viewp = *it; + if(viewp->isCtrl()) + { + controls.push_back(static_cast(viewp)); + } + } + return controls; +} + + void LLPanel::draw() { F32 alpha = getDrawContext().mAlpha; @@ -637,16 +649,6 @@ void LLPanel::childSetVisible(const std::string& id, bool visible) } } -bool LLPanel::childIsVisible(const std::string& id) const -{ - LLView* child = findChild(id); - if (child) - { - return (bool)child->getVisible(); - } - return false; -} - void LLPanel::childSetEnabled(const std::string& id, bool enabled) { LLView* child = findChild(id); @@ -656,55 +658,6 @@ void LLPanel::childSetEnabled(const std::string& id, bool enabled) } } -void LLPanel::childSetTentative(const std::string& id, bool tentative) -{ - LLUICtrl* child = findChild(id); - if (child) - { - child->setTentative(tentative); - } -} - -bool LLPanel::childIsEnabled(const std::string& id) const -{ - LLView* child = findChild(id); - if (child) - { - return (bool)child->getEnabled(); - } - return false; -} - - -void LLPanel::childSetToolTip(const std::string& id, const std::string& msg) -{ - LLView* child = findChild(id); - if (child) - { - child->setToolTip(msg); - } -} - -void LLPanel::childSetRect(const std::string& id, const LLRect& rect) -{ - LLView* child = findChild(id); - if (child) - { - child->setRect(rect); - } -} - -bool LLPanel::childGetRect(const std::string& id, LLRect& rect) const -{ - LLView* child = findChild(id); - if (child) - { - rect = child->getRect(); - return true; - } - return false; -} - void LLPanel::childSetFocus(const std::string& id, BOOL focus) { LLUICtrl* child = findChild(id); @@ -740,15 +693,6 @@ void LLPanel::childSetCommitCallback(const std::string& id, boost::function cb) -{ - LLUICtrl* child = findChild(id); - if (child) - { - child->setValidateBeforeCommit(cb); - } -} - void LLPanel::childSetColor(const std::string& id, const LLColor4& color) { LLUICtrl* child = findChild(id); @@ -828,95 +772,6 @@ BOOL LLPanel::childSetLabelArg(const std::string& id, const std::string& key, co return FALSE; } -BOOL LLPanel::childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text) -{ - LLView* child = findChild(id); - if (child) - { - return child->setToolTipArg(key, text); - } - return FALSE; -} - -void LLPanel::childShowTab(const std::string& id, const std::string& tabname, bool visible) -{ - LLTabContainer* child = findChild(id); - if (child) - { - child->selectTabByName(tabname); - } -} - -LLPanel *LLPanel::childGetVisibleTab(const std::string& id) const -{ - LLTabContainer* child = findChild(id); - if (child) - { - return child->getCurrentPanel(); - } - return NULL; -} - -LLPanel* LLPanel::childGetVisibleTabWithHelp() -{ - LLView *child; - - bfs_tree_iterator_t it = beginTreeBFS(); - // skip ourselves - ++it; - for (; it != endTreeBFS(); ++it) - { - child = *it; - LLPanel *curTabPanel = NULL; - - // do we have a tab container? - LLTabContainer *tab = dynamic_cast(child); - if (tab && tab->getVisible()) - { - curTabPanel = tab->getCurrentPanel(); - } - - // do we have an accordion tab? - LLAccordionCtrlTab* accordion = dynamic_cast(child); - if (accordion && accordion->getDisplayChildren()) - { - curTabPanel = dynamic_cast(accordion->getAccordionView()); - } - - // if we found a valid tab, does it have a help topic? - if (curTabPanel && !curTabPanel->getHelpTopic().empty()) - { - return curTabPanel; - } - } - - // couldn't find any active tabs with a help topic string - return NULL; -} - - -LLPanel *LLPanel::childGetVisiblePanelWithHelp() -{ - LLView *child; - - bfs_tree_iterator_t it = beginTreeBFS(); - // skip ourselves - ++it; - for (; it != endTreeBFS(); ++it) - { - child = *it; - // do we have a panel with a help topic? - LLPanel *panel = dynamic_cast(child); - if (panel && panel->isInVisibleChain() && !panel->getHelpTopic().empty()) - { - return panel; - } - } - - // couldn't find any active panels with a help topic string - return NULL; -} - void LLPanel::childSetAction(const std::string& id, const commit_signal_t::slot_type& function) { LLButton* button = findChild(id); @@ -935,24 +790,6 @@ void LLPanel::childSetAction(const std::string& id, boost::function } } -void LLPanel::childSetActionTextbox(const std::string& id, boost::function function, void* value) -{ - LLTextBox* textbox = findChild(id); - if (textbox) - { - textbox->setClickedCallback(boost::bind(function, value)); - } -} - -void LLPanel::childSetControlName(const std::string& id, const std::string& control_name) -{ - LLUICtrl* view = findChild(id); - if (view) - { - view->setControlName(control_name, NULL); - } -} - boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t::slot_type& cb ) { if (!mVisibleSignal) diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index ac8583ece9..9f2a31e632 100755 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -105,6 +105,8 @@ protected: LLPanel(const LLPanel::Params& params = getDefaultParams()); public: + typedef std::vector ctrl_list_t; + BOOL buildFromFile(const std::string &filename, const LLPanel::Params& default_params = getDefaultParams()); static LLPanel* createFactoryPanel(const std::string& name); @@ -154,6 +156,7 @@ public: std::string getHelpTopic() const { return mHelpTopic; } void setCtrlsEnabled(BOOL b); + ctrl_list_t getCtrlList() const; LLHandle getHandle() const { return getDerivedHandle(); } @@ -174,19 +177,10 @@ public: // LLView void childSetVisible(const std::string& name, bool visible); - void childShow(const std::string& name) { childSetVisible(name, true); } - void childHide(const std::string& name) { childSetVisible(name, false); } - bool childIsVisible(const std::string& id) const; - void childSetTentative(const std::string& name, bool tentative); void childSetEnabled(const std::string& name, bool enabled); void childEnable(const std::string& name) { childSetEnabled(name, true); } void childDisable(const std::string& name) { childSetEnabled(name, false); }; - bool childIsEnabled(const std::string& id) const; - - void childSetToolTip(const std::string& id, const std::string& msg); - void childSetRect(const std::string& id, const LLRect &rect); - bool childGetRect(const std::string& id, LLRect& rect) const; // LLUICtrl void childSetFocus(const std::string& id, BOOL focus = TRUE); @@ -197,9 +191,6 @@ public: // which takes a generic slot. Or use mCommitCallbackRegistrar.add() with // a named callback and reference it in XML. void childSetCommitCallback(const std::string& id, boost::function cb, void* data); - - void childSetValidate(const std::string& id, boost::function cb ); - void childSetColor(const std::string& id, const LLColor4& color); LLCtrlSelectionInterface* childGetSelectionInterface(const std::string& id) const; @@ -214,34 +205,11 @@ public: // Not implemented for all types, defaults to noop, returns FALSE if not applicaple BOOL childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text); BOOL childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text); - BOOL childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text); - // LLTabContainer - void childShowTab(const std::string& id, const std::string& tabname, bool visible = true); - LLPanel *childGetVisibleTab(const std::string& id) const; - - // Find a child with a nonempty Help topic - LLPanel *childGetVisibleTabWithHelp(); - LLPanel *childGetVisiblePanelWithHelp(); - - // LLTextBox/LLTextEditor/LLLineEditor - void childSetText(const std::string& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } - - // *NOTE: Does not return text from tags, use getString() - std::string childGetText(const std::string& id) const { return childGetValue(id).asString(); } - - // LLLineEditor - void childSetPrevalidate(const std::string& id, bool (*func)(const LLWString &) ); - // LLButton void childSetAction(const std::string& id, boost::function function, void* value); void childSetAction(const std::string& id, const commit_signal_t::slot_type& function); - // LLTextBox - void childSetActionTextbox(const std::string& id, boost::function function, void* value = NULL); - - void childSetControlName(const std::string& id, const std::string& control_name); - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL); //call onOpen to let panel know when it's about to be shown or activated diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index ef364dd3d3..d0a5931e8c 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -33,6 +33,8 @@ #include "llfocusmgr.h" #include "llpanel.h" #include "lluictrlfactory.h" +#include "lltabcontainer.h" +#include "llaccordionctrltab.h" static LLDefaultChildRegistry::Register r("ui_ctrl"); @@ -702,54 +704,19 @@ BOOL LLUICtrl::getIsChrome() const } } -// this comparator uses the crazy disambiguating logic of LLCompareByTabOrder, -// but to switch up the order so that children that have the default tab group come first -// and those that are prior to the default tab group come last -class CompareByDefaultTabGroup: public LLCompareByTabOrder -{ -public: - CompareByDefaultTabGroup(const LLView::child_tab_order_t& order, S32 default_tab_group): - LLCompareByTabOrder(order), - mDefaultTabGroup(default_tab_group) {} -private: - /*virtual*/ bool compareTabOrders(const LLView::tab_order_t & a, const LLView::tab_order_t & b) const - { - S32 ag = a.first; // tab group for a - S32 bg = b.first; // tab group for b - // these two ifs have the effect of moving elements prior to the default tab group to the end of the list - // (still sorted relative to each other, though) - if(ag < mDefaultTabGroup && bg >= mDefaultTabGroup) return false; - if(bg < mDefaultTabGroup && ag >= mDefaultTabGroup) return true; - return a < b; // sort correctly if they're both on the same side of the default tab group - } - S32 mDefaultTabGroup; -}; -// Sorter for plugging into the query. -// I'd have defined it local to the one method that uses it but that broke the VS 05 compiler. -MG -class LLUICtrl::DefaultTabGroupFirstSorter : public LLQuerySorter, public LLSingleton -{ -public: - /*virtual*/ void operator() (LLView * parent, viewList_t &children) const - { - children.sort(CompareByDefaultTabGroup(parent->getCtrlOrder(), parent->getDefaultTabGroup())); - } -}; - LLTrace::BlockTimerStatHandle FTM_FOCUS_FIRST_ITEM("Focus First Item"); BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash) { LL_RECORD_BLOCK_TIME(FTM_FOCUS_FIRST_ITEM); // try to select default tab group child - LLCtrlQuery query = getTabOrderQuery(); - // sort things such that the default tab group is at the front - query.setSorter(DefaultTabGroupFirstSorter::getInstance()); + LLViewQuery query = getTabOrderQuery(); child_list_t result = query(this); if(result.size() > 0) { - LLUICtrl * ctrl = static_cast(result.front()); + LLUICtrl * ctrl = static_cast(result.back()); if(!ctrl->hasFocus()) { ctrl->setFocus(TRUE); @@ -764,17 +731,20 @@ BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash) // search for text field first if(prefer_text_fields) { - LLCtrlQuery query = getTabOrderQuery(); + LLViewQuery query = getTabOrderQuery(); query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance()); child_list_t result = query(this); if(result.size() > 0) { - LLUICtrl * ctrl = static_cast(result.front()); + LLUICtrl * ctrl = static_cast(result.back()); if(!ctrl->hasFocus()) { ctrl->setFocus(TRUE); ctrl->onTabInto(); - gFocusMgr.triggerFocusFlash(); + if(focus_flash) + { + gFocusMgr.triggerFocusFlash(); + } } return TRUE; } @@ -783,58 +753,26 @@ BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash) result = getTabOrderQuery().run(this); if(result.size() > 0) { - LLUICtrl * ctrl = static_cast(result.front()); + LLUICtrl * ctrl = static_cast(result.back()); if(!ctrl->hasFocus()) { ctrl->setFocus(TRUE); ctrl->onTabInto(); - gFocusMgr.triggerFocusFlash(); - } - return TRUE; - } - return FALSE; -} - -BOOL LLUICtrl::focusLastItem(BOOL prefer_text_fields) -{ - // search for text field first - if(prefer_text_fields) - { - LLCtrlQuery query = getTabOrderQuery(); - query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance()); - child_list_t result = query(this); - if(result.size() > 0) - { - LLUICtrl * ctrl = static_cast(result.back()); - if(!ctrl->hasFocus()) + if(focus_flash) { - ctrl->setFocus(TRUE); - ctrl->onTabInto(); gFocusMgr.triggerFocusFlash(); } - return TRUE; - } - } - // no text field found, or we don't care about text fields - child_list_t result = getTabOrderQuery().run(this); - if(result.size() > 0) - { - LLUICtrl * ctrl = static_cast(result.back()); - if(!ctrl->hasFocus()) - { - ctrl->setFocus(TRUE); - ctrl->onTabInto(); - gFocusMgr.triggerFocusFlash(); } return TRUE; } return FALSE; } + BOOL LLUICtrl::focusNextItem(BOOL text_fields_only) { // this assumes that this method is called on the focus root. - LLCtrlQuery query = getTabOrderQuery(); + LLViewQuery query = getTabOrderQuery(); static LLUICachedControl tab_to_text_fields_only ("TabToTextFieldsOnly", false); if(text_fields_only || tab_to_text_fields_only) { @@ -847,7 +785,7 @@ BOOL LLUICtrl::focusNextItem(BOOL text_fields_only) BOOL LLUICtrl::focusPrevItem(BOOL text_fields_only) { // this assumes that this method is called on the focus root. - LLCtrlQuery query = getTabOrderQuery(); + LLViewQuery query = getTabOrderQuery(); static LLUICachedControl tab_to_text_fields_only ("TabToTextFieldsOnly", false); if(text_fields_only || tab_to_text_fields_only) { @@ -904,8 +842,26 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) if (panel) { + + LLView *child; + LLPanel *subpanel = NULL; + // does the panel have a sub-panel with a help topic? - LLPanel *subpanel = panel->childGetVisiblePanelWithHelp(); + bfs_tree_iterator_t it = beginTreeBFS(); + // skip ourselves + ++it; + for (; it != endTreeBFS(); ++it) + { + child = *it; + // do we have a panel with a help topic? + LLPanel *panel = dynamic_cast(child); + if (panel && panel->isInVisibleChain() && !panel->getHelpTopic().empty()) + { + subpanel = panel; + break; + } + } + if (subpanel) { help_topic_out = subpanel->getHelpTopic(); @@ -913,10 +869,41 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) } // does the panel have an active tab with a help topic? - LLPanel *tab = panel->childGetVisibleTabWithHelp(); - if (tab) + LLPanel *tab_panel = NULL; + + it = beginTreeBFS(); + // skip ourselves + ++it; + for (; it != endTreeBFS(); ++it) + { + child = *it; + LLPanel *curTabPanel = NULL; + + // do we have a tab container? + LLTabContainer *tab = dynamic_cast(child); + if (tab && tab->getVisible()) + { + curTabPanel = tab->getCurrentPanel(); + } + + // do we have an accordion tab? + LLAccordionCtrlTab* accordion = dynamic_cast(child); + if (accordion && accordion->getDisplayChildren()) + { + curTabPanel = dynamic_cast(accordion->getAccordionView()); + } + + // if we found a valid tab, does it have a help topic? + if (curTabPanel && !curTabPanel->getHelpTopic().empty()) + { + tab_panel = curTabPanel; + break; + } + } + + if (tab_panel) { - help_topic_out = tab->getHelpTopic(); + help_topic_out = tab_panel->getHelpTopic(); return true; // success (tab) } diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index fb2196bb16..99553ee0d2 100755 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -220,7 +220,6 @@ public: BOOL focusNextItem(BOOL text_entry_only); BOOL focusPrevItem(BOOL text_entry_only); BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE ); - BOOL focusLastItem(BOOL prefer_text_fields = FALSE); // Non Virtuals LLHandle getHandle() const { return getDerivedHandle(); } @@ -315,8 +314,6 @@ private: BOOL mTentative; ETypeTransparency mTransparencyType; - - class DefaultTabGroupFirstSorter; }; // Build time optimization, generate once in .cpp file diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 1982c97b8c..e0fa59793c 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -140,7 +140,6 @@ LLView::LLView(const LLView::Params& p) mFromXUI(p.from_xui), mIsFocusRoot(p.focus_root), mLastVisible(FALSE), - mNextInsertionOrdinal(0), mHoverCursor(getCursorFromString(p.hover_cursor)), mEnabled(p.enabled), mMouseOpaque(p.mouse_opaque), @@ -275,22 +274,6 @@ void LLView::sendChildToBack(LLView* child) } } -void LLView::moveChildToFrontOfTabGroup(LLUICtrl* child) -{ - if(mCtrlOrder.find(child) != mCtrlOrder.end()) - { - mCtrlOrder[child].second = -1 * mNextInsertionOrdinal++; - } -} - -void LLView::moveChildToBackOfTabGroup(LLUICtrl* child) -{ - if(mCtrlOrder.find(child) != mCtrlOrder.end()) - { - mCtrlOrder[child].second = mNextInsertionOrdinal++; - } -} - // virtual bool LLView::addChild(LLView* child, S32 tab_group) { @@ -298,7 +281,8 @@ bool LLView::addChild(LLView* child, S32 tab_group) { return false; } - if (mParentView == child) + + if (this == child) { LL_ERRS() << "Adding view " << child->getName() << " as child of itself" << LL_ENDL; } @@ -312,14 +296,10 @@ bool LLView::addChild(LLView* child, S32 tab_group) // add to front of child list, as normal mChildList.push_front(child); - // add to ctrl list if is LLUICtrl - if (child->isCtrl()) + // add to tab order list + if (tab_group != 0) { - LLUICtrl* ctrl = static_cast(child); - mCtrlOrder.insert(tab_order_pair_t(ctrl, - tab_order_t(tab_group, mNextInsertionOrdinal))); - - mNextInsertionOrdinal++; + mTabOrder.insert(tab_order_pair_t(child, tab_group)); } child->mParentView = this; @@ -350,13 +330,10 @@ void LLView::removeChild(LLView* child) llassert(child->mInDraw == false); mChildList.remove( child ); child->mParentView = NULL; - if (child->isCtrl()) + child_tab_order_t::iterator found = mTabOrder.find(child); + if(found != mTabOrder.end()) { - child_tab_order_t::iterator found = mCtrlOrder.find(static_cast(child)); - if(found != mCtrlOrder.end()) - { - mCtrlOrder.erase(found); - } + mTabOrder.erase(found); } } else @@ -366,53 +343,6 @@ void LLView::removeChild(LLView* child) updateBoundingRect(); } -LLView::ctrl_list_t LLView::getCtrlList() const -{ - ctrl_list_t controls; - BOOST_FOREACH(LLView* viewp, mChildList) - { - if(viewp->isCtrl()) - { - controls.push_back(static_cast(viewp)); - } - } - return controls; -} - -LLView::ctrl_list_t LLView::getCtrlListSorted() const -{ - ctrl_list_t controls = getCtrlList(); - std::sort(controls.begin(), controls.end(), LLCompareByTabOrder(mCtrlOrder)); - return controls; -} - - -// This method compares two LLViews by the tab order specified in the comparator object. The -// code for this is a little convoluted because each argument can have four states: -// 1) not a control, 2) a control but not in the tab order, 3) a control in the tab order, 4) null -bool LLCompareByTabOrder::operator() (const LLView* const a, const LLView* const b) const -{ - S32 a_score = 0, b_score = 0; - if(a) a_score--; - if(b) b_score--; - if(a && a->isCtrl()) a_score--; - if(b && b->isCtrl()) b_score--; - if(a_score == -2 && b_score == -2) - { - const LLUICtrl * const a_ctrl = static_cast(a); - const LLUICtrl * const b_ctrl = static_cast(b); - LLView::child_tab_order_const_iter_t a_found = mTabOrder.find(a_ctrl), b_found = mTabOrder.find(b_ctrl); - if(a_found != mTabOrder.end()) a_score--; - if(b_found != mTabOrder.end()) b_score--; - if(a_score == -3 && b_score == -3) - { - // whew! Once we're in here, they're both in the tab order, and we can compare based on that - return compareTabOrders(a_found->second, b_found->second); - } - } - return (a_score == b_score) ? a < b : a_score < b_score; -} - BOOL LLView::isInVisibleChain() const { BOOL visible = TRUE; @@ -536,9 +466,9 @@ BOOL LLView::focusPrevRoot() // static BOOL LLView::focusNext(LLView::child_list_t & result) { - LLView::child_list_iter_t focused = result.end(); - for(LLView::child_list_iter_t iter = result.begin(); - iter != result.end(); + LLView::child_list_reverse_iter_t focused = result.rend(); + for(LLView::child_list_reverse_iter_t iter = result.rbegin(); + iter != result.rend(); ++iter) { if(gFocusMgr.childHasKeyboardFocus(*iter)) @@ -547,14 +477,14 @@ BOOL LLView::focusNext(LLView::child_list_t & result) break; } } - LLView::child_list_iter_t next = focused; - next = (next == result.end()) ? result.begin() : ++next; + LLView::child_list_reverse_iter_t next = focused; + next = (next == result.rend()) ? result.rbegin() : ++next; while(next != focused) { // wrap around to beginning if necessary - if(next == result.end()) + if(next == result.rend()) { - next = result.begin(); + next = result.rbegin(); } if((*next)->isCtrl()) { @@ -572,9 +502,9 @@ BOOL LLView::focusNext(LLView::child_list_t & result) // static BOOL LLView::focusPrev(LLView::child_list_t & result) { - LLView::child_list_reverse_iter_t focused = result.rend(); - for(LLView::child_list_reverse_iter_t iter = result.rbegin(); - iter != result.rend(); + LLView::child_list_iter_t focused = result.end(); + for(LLView::child_list_iter_t iter = result.begin(); + iter != result.end(); ++iter) { if(gFocusMgr.childHasKeyboardFocus(*iter)) @@ -583,14 +513,14 @@ BOOL LLView::focusPrev(LLView::child_list_t & result) break; } } - LLView::child_list_reverse_iter_t next = focused; - next = (next == result.rend()) ? result.rbegin() : ++next; + LLView::child_list_iter_t next = focused; + next = (next == result.end()) ? result.begin() : ++next; while(next != focused) { // wrap around to beginning if necessary - if(next == result.rend()) + if(next == result.end()) { - next = result.rbegin(); + next = result.begin(); } if((*next)->isCtrl()) { @@ -614,7 +544,7 @@ BOOL LLView::focusPrev(LLView::child_list_t & result) void LLView::deleteAllChildren() { // clear out the control ordering - mCtrlOrder.clear(); + mTabOrder.clear(); while (!mChildList.empty()) { @@ -1823,15 +1753,63 @@ BOOL LLView::localRectToOtherView( const LLRect& local, LLRect* other, const LLV return FALSE; } + +class CompareByTabOrder +{ +public: + CompareByTabOrder(const LLView::child_tab_order_t& order, S32 default_tab_group = 0) + : mTabOrder(order), + mDefaultTabGroup(default_tab_group) + {} + virtual ~CompareByTabOrder() {} + + // This method compares two LLViews by the tab order specified in the comparator object. The + // code for this is a little convoluted because each argument can have four states: + // 1) not a control, 2) a control but not in the tab order, 3) a control in the tab order, 4) null + bool operator() (const LLView* const a, const LLView* const b) const + { + S32 a_group = 0, b_group = 0; + if(!a) return false; + if(!b) return true; + + LLView::child_tab_order_const_iter_t a_found = mTabOrder.find(a), b_found = mTabOrder.find(b); + if(a_found != mTabOrder.end()) + { + a_group = a_found->second; + } + if(b_found != mTabOrder.end()) + { + b_group = b_found->second; + } + + if(a_group < mDefaultTabGroup && b_group >= mDefaultTabGroup) return true; + if(b_group < mDefaultTabGroup && a_group >= mDefaultTabGroup) return false; + return a_group > b_group; // sort correctly if they're both on the same side of the default tab groupreturn a > b; + } +private: + // ok to store a reference, as this should only be allocated on stack during view query operations + const LLView::child_tab_order_t& mTabOrder; + const S32 mDefaultTabGroup; +}; + +class SortByTabOrder : public LLQuerySorter, public LLSingleton +{ + /*virtual*/ void sort(LLView * parent, LLView::child_list_t &children) const + { + children.sort(CompareByTabOrder(parent->getTabOrder(), parent->getDefaultTabGroup())); + } +}; + // static -const LLCtrlQuery & LLView::getTabOrderQuery() +const LLViewQuery & LLView::getTabOrderQuery() { - static LLCtrlQuery query; + static LLViewQuery query; if(query.getPreFilters().size() == 0) { query.addPreFilter(LLVisibleFilter::getInstance()); query.addPreFilter(LLEnabledFilter::getInstance()); query.addPreFilter(LLTabStopFilter::getInstance()); query.addPostFilter(LLLeavesFilter::getInstance()); + query.setSorter(SortByTabOrder::getInstance()); } return query; } @@ -1846,9 +1824,9 @@ class LLFocusRootsFilter : public LLQueryFilter, public LLSingleton ctrl_list_t; - - typedef std::pair tab_order_t; - typedef std::pair tab_order_pair_t; + typedef std::pair tab_order_pair_t; // this structure primarily sorts by the tab group, secondarily by the insertion ordinal (lastly by the value of the pointer) - typedef std::map child_tab_order_t; + typedef std::map child_tab_order_t; typedef child_tab_order_t::iterator child_tab_order_iter_t; typedef child_tab_order_t::const_iterator child_tab_order_const_iter_t; typedef child_tab_order_t::reverse_iterator child_tab_order_reverse_iter_t; @@ -251,8 +248,6 @@ public: void sendChildToFront(LLView* child); void sendChildToBack(LLView* child); - void moveChildToFrontOfTabGroup(LLUICtrl* child); - void moveChildToBackOfTabGroup(LLUICtrl* child); virtual bool addChild(LLView* view, S32 tab_group = 0); @@ -264,9 +259,7 @@ public: virtual BOOL postBuild() { return TRUE; } - const child_tab_order_t& getCtrlOrder() const { return mCtrlOrder; } - ctrl_list_t getCtrlList() const; - ctrl_list_t getCtrlListSorted() const; + const child_tab_order_t& getTabOrder() const { return mTabOrder; } void setDefaultTabGroup(S32 d) { mDefaultTabGroup = d; } S32 getDefaultTabGroup() const { return mDefaultTabGroup; } @@ -500,9 +493,9 @@ public: static BOOL focusPrev(LLView::child_list_t & result); // returns query for iterating over controls in tab order - static const LLCtrlQuery & getTabOrderQuery(); + static const LLViewQuery & getTabOrderQuery(); // return query for iterating over focus roots in tab order - static const LLCtrlQuery & getFocusRootsQuery(); + static const LLViewQuery & getFocusRootsQuery(); static LLWindow* getWindow(void) { return LLUI::sWindow; } @@ -596,7 +589,7 @@ private: U32 mReshapeFlags; - child_tab_order_t mCtrlOrder; + child_tab_order_t mTabOrder; S32 mDefaultTabGroup; S32 mLastTabGroup; @@ -613,8 +606,6 @@ private: BOOL mLastVisible; - S32 mNextInsertionOrdinal; - bool mInDraw; static LLWindow* sWindow; // All root views must know about their window. @@ -686,19 +677,6 @@ struct TypeValues : public LLInitParam::TypeValuesHelper T* LLView::getChild(const std::string& name, BOOL recurse) const { LLView* child = findChildView(name, recurse); diff --git a/indra/llui/llviewquery.cpp b/indra/llui/llviewquery.cpp index d0b78ba186..66262609ae 100755 --- a/indra/llui/llviewquery.cpp +++ b/indra/llui/llviewquery.cpp @@ -30,7 +30,7 @@ #include "lluictrl.h" #include "llviewquery.h" -void LLQuerySorter::operator() (LLView * parent, viewList_t &children) const {} +void LLQuerySorter::sort(LLView * parent, viewList_t &children) const {} filterResult_t LLLeavesFilter::operator() (const LLView* const view, const viewList_t & children) const { @@ -89,8 +89,8 @@ viewList_t LLViewQuery::run(LLView* view) const if (pre.first) { post = runFilters(view, filtered_children, mPostFilters); - } } + } if(pre.first && post.first) { @@ -105,12 +105,12 @@ viewList_t LLViewQuery::run(LLView* view) const return result; } -void LLViewQuery::filterChildren(LLView * view, viewList_t & filtered_children) const +void LLViewQuery::filterChildren(LLView* parent_view, viewList_t & filtered_children) const { - LLView::child_list_t views(*(view->getChildList())); + LLView::child_list_t views(*(parent_view->getChildList())); if (mSorterp) { - (*mSorterp)(view, views); // sort the children per the sorter + mSorterp->sort(parent_view, views); // sort the children per the sorter } for(LLView::child_list_iter_t iter = views.begin(); iter != views.end(); @@ -134,18 +134,3 @@ filterResult_t LLViewQuery::runFilters(LLView * view, const viewList_t children, } return result; } - -class SortByTabOrder : public LLQuerySorter, public LLSingleton -{ - /*virtual*/ void operator() (LLView * parent, LLView::child_list_t &children) const - { - children.sort(LLCompareByTabOrder(parent->getCtrlOrder())); - } -}; - -LLCtrlQuery::LLCtrlQuery() : - LLViewQuery() -{ - setSorter(SortByTabOrder::getInstance()); -} - diff --git a/indra/llui/llviewquery.h b/indra/llui/llviewquery.h index 210f95162a..9044c4ff29 100755 --- a/indra/llui/llviewquery.h +++ b/indra/llui/llviewquery.h @@ -49,7 +49,7 @@ class LLQuerySorter { public: virtual ~LLQuerySorter() {}; - virtual void operator() (LLView * parent, viewList_t &children) const; + virtual void sort(LLView * parent, viewList_t &children) const; }; class LLLeavesFilter : public LLQueryFilter, public LLSingleton @@ -127,10 +127,5 @@ private: const LLQuerySorter* mSorterp; }; -class LLCtrlQuery : public LLViewQuery -{ -public: - LLCtrlQuery(); -}; #endif // LL_LLVIEWQUERY_H -- cgit v1.2.3 From c4fc085f74392d8bd2746134e703edbbbc911012 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 6 Nov 2013 18:16:57 -0800 Subject: fixed some warnings --- indra/llui/llfloater.cpp | 2 +- indra/llui/lluictrl.cpp | 8 ++++---- indra/llui/llview.cpp | 6 +++--- indra/llui/llviewereventrecorder.cpp | 30 +++++++++++++++--------------- 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d12f8a032d..513a7e2ab0 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1549,7 +1549,7 @@ BOOL LLFloater::handleScrollWheel(S32 x, S32 y, S32 clicks) // virtual BOOL LLFloater::handleMouseUp(S32 x, S32 y, MASK mask) { - lldebugs << "LLFloater::handleMouseUp calling LLPanel (really LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << llendl; + LL_DEBUGS() << "LLFloater::handleMouseUp calling LLPanel (really LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << LL_ENDL; BOOL handled = LLPanel::handleMouseUp(x,y,mask); // Not implemented in LLPanel so this actually calls LLView if (handled) { LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 8f075771a8..df74e113e9 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -312,7 +312,7 @@ void LLUICtrl::onMouseLeave(S32 x, S32 y, MASK mask) BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask) { - lldebugs << "LLUICtrl::handleMouseDown calling LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << llendl; + LL_DEBUGS() << "LLUICtrl::handleMouseDown calling LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << LL_ENDL; BOOL handled = LLView::handleMouseDown(x,y,mask); @@ -320,7 +320,7 @@ BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask) { (*mMouseDownSignal)(this,x,y,mask); } - lldebugs << "LLUICtrl::handleMousedown - handled is returning as: " << handled << " " << llendl; + LL_DEBUGS() << "LLUICtrl::handleMousedown - handled is returning as: " << handled << " " << LL_ENDL; if (handled) { LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-56,-56,getPathname()); @@ -332,7 +332,7 @@ BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask) { - lldebugs << "LLUICtrl::handleMouseUp calling LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << llendl; + LL_DEBUGS() << "LLUICtrl::handleMouseUp calling LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << LL_ENDL; BOOL handled = LLView::handleMouseUp(x,y,mask); if (handled) { @@ -343,7 +343,7 @@ BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask) (*mMouseUpSignal)(this,x,y,mask); } - lldebugs << "LLUICtrl::handleMouseUp - handled for xui " << getPathname() << " - is returning as: " << handled << " " << llendl; + LL_DEBUGS() << "LLUICtrl::handleMouseUp - handled for xui " << getPathname() << " - is returning as: " << handled << " " << LL_ENDL; return handled; } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 7f21522942..357948b6fe 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -603,7 +603,7 @@ void LLView::onVisibilityChange ( BOOL new_visibility ) // Consider changing returns to confirm success and know which widget grabbed it // For now assume success and log at highest xui possible // NOTE we log actual state - which may differ if it somehow failed to set visibility - lldebugs << "LLView::handleVisibilityChange - now: " << getVisible() << " xui: " << viewp->getPathname() << " name: " << viewp->getName() << llendl; + LL_DEBUGS() << "LLView::handleVisibilityChange - now: " << getVisible() << " xui: " << viewp->getPathname() << " name: " << viewp->getName() << LL_ENDL; } } @@ -700,8 +700,8 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA if ((viewp->*method)( local_x, local_y, extra ) || (allow_mouse_block && viewp->blockMouseEvent( local_x, local_y ))) { - lldebugs << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << llendl; - lldebugs << "LLView::childrenHandleMouseEvent getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << llendl; + LL_DEBUGS() << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << LL_ENDL; + LL_DEBUGS() << "LLView::childrenHandleMouseEvent getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << LL_ENDL; LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp index a352f621eb..556b45a9ba 100644 --- a/indra/llui/llviewereventrecorder.cpp +++ b/indra/llui/llviewereventrecorder.cpp @@ -53,14 +53,14 @@ void LLViewerEventRecorder::setEventLoggingOn() { mLog.open(mLogFilename, llofstream::out); } logEvents=true; - lldebugs << "LLViewerEventRecorder::setEventLoggingOn event logging turned on" << llendl; + LL_DEBUGS() << "LLViewerEventRecorder::setEventLoggingOn event logging turned on" << LL_ENDL; } void LLViewerEventRecorder::setEventLoggingOff() { logEvents=false; mLog.flush(); mLog.close(); - lldebugs << "LLViewerEventRecorder::setEventLoggingOff event logging turned off" << llendl; + LL_DEBUGS() << "LLViewerEventRecorder::setEventLoggingOff event logging turned off" << LL_ENDL; } @@ -101,10 +101,10 @@ void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 g LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), xui); if (! target_view) { - lldebugs << "LLViewerEventRecorder::updateMouseEventInfo - xui path on file at moment is NOT valid - so DO NOT record these local coords" << llendl; + LL_DEBUGS() << "LLViewerEventRecorder::updateMouseEventInfo - xui path on file at moment is NOT valid - so DO NOT record these local coords" << LL_ENDL; return; } - lldebugs << "LLViewerEventRecorder::updateMouseEventInfo b4 updatemouseeventinfo - local_x|global x "<< this->local_x << " " << this->global_x << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << llendl; + LL_DEBUGS() << "LLViewerEventRecorder::updateMouseEventInfo b4 updatemouseeventinfo - local_x|global x "<< this->local_x << " " << this->global_x << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << LL_ENDL; if (this->local_x < 1 && this->local_y<1 && local_x && local_y) { @@ -121,7 +121,7 @@ void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 g xui = mName; // TODO review confirm we never call with partial path - also cAN REMOVE CHECK FOR "" - ON OTHER HAND IT'S PRETTY HARMLESS } - lldebugs << "LLViewerEventRecorder::updateMouseEventInfo after updatemouseeventinfo - local_x|global x "<< this->local_x << " " << this->global_x << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << llendl; + LL_DEBUGS() << "LLViewerEventRecorder::updateMouseEventInfo after updatemouseeventinfo - local_x|global x "<< this->local_x << " " << this->global_x << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << LL_ENDL; } void LLViewerEventRecorder::logVisibilityChange(std::string xui, std::string name, BOOL visibility, std::string event_subtype) { @@ -158,10 +158,10 @@ std::string LLViewerEventRecorder::get_xui() { } void LLViewerEventRecorder::update_xui(std::string xui) { if (xui!="" && this->xui=="" ) { - lldebugs << "LLViewerEventRecorder::update_xui to " << xui << llendl; + LL_DEBUGS() << "LLViewerEventRecorder::update_xui to " << xui << LL_ENDL; this->xui=xui; } else { - lldebugs << "LLViewerEventRecorder::update_xui called with empty string" << llendl; + LL_DEBUGS() << "LLViewerEventRecorder::update_xui called with empty string" << LL_ENDL; } } @@ -200,11 +200,11 @@ void LLViewerEventRecorder::logKeyEvent(KEY key, MASK mask) { // (maybe it should) - instead it has a convenience method that generates the keydown and keyup events // Here we will use "type" as our event type - lldebugs << "LLVIewerEventRecorder::logKeyEvent Serialized LLSD for event " << event.asString() << "\n" << llendl; + LL_DEBUGS() << "LLVIewerEventRecorder::logKeyEvent Serialized LLSD for event " << event.asString() << "\n" << LL_ENDL; - //lldebugs << "[VITA] key_name: " << LLKeyboard::stringFromKey(key) << "mask: "<< mask << "handled by " << getName() << llendl; - lldebugs << "LLVIewerEventRecorder::logKeyEvent key_name: " << LLKeyboard::stringFromKey(key) << "mask: "<< mask << llendl; + //LL_DEBUGS() << "[VITA] key_name: " << LLKeyboard::stringFromKey(key) << "mask: "<< mask << "handled by " << getName() << LL_ENDL; + LL_DEBUGS() << "LLVIewerEventRecorder::logKeyEvent key_name: " << LLKeyboard::stringFromKey(key) << "mask: "<< mask << LL_ENDL; recordEvent(event); @@ -218,14 +218,14 @@ void LLViewerEventRecorder::playbackRecording() { // ivita sets this on startup, it also sends commands to the viewer to make start, stop, and playback menu items visible in viewer LeapCommand =LLUI::sSettingGroups["config"]->getLLSD("LeapPlaybackEventsCommand"); - lldebugs << "[VITA] launching playback - leap command is: " << LLSDXMLStreamer(LeapCommand) << llendl; + LL_DEBUGS() << "[VITA] launching playback - leap command is: " << LLSDXMLStreamer(LeapCommand) << LL_ENDL; LLLeap::create("", LeapCommand, false); // exception=false } void LLViewerEventRecorder::recordEvent(LLSD event) { - lldebugs << "LLViewerEventRecorder::recordEvent event written to log: " << LLSDXMLStreamer(event) << llendl; + LL_DEBUGS() << "LLViewerEventRecorder::recordEvent event written to log: " << LLSDXMLStreamer(event) << LL_ENDL; mLog << event << std::endl; } @@ -243,7 +243,7 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) { // keycode...or // char - lldebugs << "Wrapped in conversion to wstring " << wstring_to_utf8str(LLWString( 1, uni_char)) << "\n" << llendl; + LL_DEBUGS() << "Wrapped in conversion to wstring " << wstring_to_utf8str(LLWString( 1, uni_char)) << "\n" << LL_ENDL; event.insert("char", LLSD( wstring_to_utf8str(LLWString( 1,uni_char)) ) @@ -257,8 +257,8 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) { event.insert("event",LLSD("keyDown")); - lldebugs << "[VITA] unicode key: " << uni_char << llendl; - lldebugs << "[VITA] dumpxml " << LLSDXMLStreamer(event) << "\n" << llendl; + LL_DEBUGS() << "[VITA] unicode key: " << uni_char << LL_ENDL; + LL_DEBUGS() << "[VITA] dumpxml " << LLSDXMLStreamer(event) << "\n" << LL_ENDL; recordEvent(event); -- cgit v1.2.3 From 6ddfc8031c73f342cf8459445a20cd50ceb3efba Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 12 Nov 2013 11:42:06 -0800 Subject: BUILDFIX - miscellaneous stuff missed in the merge --- indra/llui/llmodaldialog.cpp | 2 +- indra/llui/llmultifloater.cpp | 13 ++++++------- indra/llui/llmultifloater.h | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 47cdd098fa..d83028ec4a 100755 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -195,7 +195,7 @@ BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask) if( childrenHandleHover(x, y, mask) == NULL ) { getWindow()->setCursor(UI_CURSOR_ARROW); - LL_DEBUGS(LLERR_USER_INPUT) << "hover handled by " << getName() << LL_ENDL; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL; } LLView* popup_menu = LLMenuGL::sMenuContainer->getVisibleMenu(); diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 48b5b08c1b..d1a597511e 100755 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -67,14 +67,13 @@ void LLMultiFloater::buildTabContainer() } } -void LLMultiFloater::onOpen(const LLSD& key) +void LLMultiFloater::onClose(bool app_quitting) { -// if (mTabContainer->getTabCount() <= 0) -// { -// // for now, don't allow multifloaters -// // without any child floaters -// closeFloater(); -// } + if(isMinimized()) + { + setMinimized(FALSE); + } + LLFloater::onClose(app_quitting); } void LLMultiFloater::draw() diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h index c1b1a357ed..c106a62527 100755 --- a/indra/llui/llmultifloater.h +++ b/indra/llui/llmultifloater.h @@ -44,7 +44,7 @@ public: void buildTabContainer(); virtual BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); virtual void draw(); virtual void setVisible(BOOL visible); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); -- cgit v1.2.3 From 391ac367d6922f30bf3a186bc15e1fc38366eecf Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 19 Nov 2013 17:40:44 -0800 Subject: SH-4634 FIX Interesting: Viewer crashes when receiving teleport offer renamed fast timers to have unique names, changes instance tracker to never allow duplicates --- indra/llui/llstatbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index bfdc6571c2..1bd2bc06f4 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -553,10 +553,10 @@ void LLStatBar::draw() void LLStatBar::setStat(const std::string& stat_name) { using namespace LLTrace; - const StatType* count_stat; - const StatType* event_stat; - const StatType* sample_stat; - const StatType* mem_stat; + const StatType* count_stat; + const StatType* event_stat; + const StatType* sample_stat; + const StatType* mem_stat; if ((count_stat = StatType::getInstance(stat_name))) { -- cgit v1.2.3 From 1a456c2e41905e93e393dc2dda0d143ee7611275 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 9 Dec 2013 13:02:06 +0200 Subject: MAINT-3539 Additional checking was added to avoid possible crash. --- indra/llui/llview.cpp | 89 ++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 43 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9cc8c951d5..5ee2169b66 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1314,52 +1314,55 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent) // move child views according to reshape flags BOOST_FOREACH(LLView* viewp, mChildList) { - LLRect child_rect( viewp->mRect ); - - if (viewp->followsRight() && viewp->followsLeft()) - { - child_rect.mRight += delta_width; - } - else if (viewp->followsRight()) - { - child_rect.mLeft += delta_width; - child_rect.mRight += delta_width; - } - else if (viewp->followsLeft()) + if (viewp != NULL) { - // left is 0, don't need to adjust coords - } - else - { - // BUG what to do when we don't follow anyone? - // for now, same as followsLeft - } + LLRect child_rect( viewp->mRect ); - if (viewp->followsTop() && viewp->followsBottom()) - { - child_rect.mTop += delta_height; - } - else if (viewp->followsTop()) - { - child_rect.mTop += delta_height; - child_rect.mBottom += delta_height; - } - else if (viewp->followsBottom()) - { - // bottom is 0, so don't need to adjust coords - } - else - { - // BUG what to do when we don't follow? - // for now, same as bottom - } + if (viewp->followsRight() && viewp->followsLeft()) + { + child_rect.mRight += delta_width; + } + else if (viewp->followsRight()) + { + child_rect.mLeft += delta_width; + child_rect.mRight += delta_width; + } + else if (viewp->followsLeft()) + { + // left is 0, don't need to adjust coords + } + else + { + // BUG what to do when we don't follow anyone? + // for now, same as followsLeft + } - S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft; - S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom; - viewp->translate( delta_x, delta_y ); - if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight()) - { - viewp->reshape(child_rect.getWidth(), child_rect.getHeight()); + if (viewp->followsTop() && viewp->followsBottom()) + { + child_rect.mTop += delta_height; + } + else if (viewp->followsTop()) + { + child_rect.mTop += delta_height; + child_rect.mBottom += delta_height; + } + else if (viewp->followsBottom()) + { + // bottom is 0, so don't need to adjust coords + } + else + { + // BUG what to do when we don't follow? + // for now, same as bottom + } + + S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft; + S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom; + viewp->translate( delta_x, delta_y ); + if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight()) + { + viewp->reshape(child_rect.getWidth(), child_rect.getHeight()); + } } } } -- cgit v1.2.3 From 813bc232e7175ba3e20a70f16427d12c7681a996 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 9 Dec 2013 15:42:51 -0800 Subject: MAINT-3017 FIX Inventory filter for Recent tab does not persist between sessions as it used to. added names back to inventory filters, so they can be deserialized --- indra/llui/llfolderview.cpp | 12 +++++++----- indra/llui/llfolderviewmodel.h | 33 +++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 17 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index f32a52e6c6..884fd0ed0f 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1599,19 +1599,21 @@ void LLFolderView::update() // until that inventory is loaded up. LLFastTimer t2(FTM_INVENTORY); - if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) + LLFolderViewFilter& filter_object = getFolderViewModel()->getFilter(); + + if (filter_object.isModified() && filter_object.isNotDefault()) { mNeedsAutoSelect = TRUE; } // Filter to determine visibility before arranging - filter(getFolderViewModel()->getFilter()); + filter(filter_object); // Clear the modified setting on the filter only if the filter finished after running the filter process // Note: if the filter count has timed out, that means the filter halted before completing the entire set of items - if (getFolderViewModel()->getFilter().isModified() && (!getFolderViewModel()->getFilter().isTimedOut())) + if (filter_object.isModified() && (!filter_object.isTimedOut())) { - getFolderViewModel()->getFilter().clearModified(); + filter_object.clearModified(); } // automatically show matching items, and select first one if we had a selection @@ -1630,7 +1632,7 @@ void LLFolderView::update() // Open filtered folders for folder views with mAutoSelectOverride=TRUE. // Used by LLPlacesFolderView. - if (getFolderViewModel()->getFilter().showAllResults()) + if (filter_object.showAllResults()) { // these are named variables to get around gcc not binding non-const references to rvalues // and functor application is inherently non-const to allow for stateful functors diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index b1bcc8bbb4..a909d13f97 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -386,27 +386,36 @@ template Date: Wed, 8 Jan 2014 12:34:35 +0200 Subject: =?UTF-8?q?MAINT-3520=20FIXED=20=D0=A1all=20arrange(NULL,=20NULL)?= =?UTF-8?q?=20to=20avoid=20occasional=20drag'n'drop=20folders=20after=20re?= =?UTF-8?q?naming.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/llui/llfolderview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 884fd0ed0f..13d231d712 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -629,6 +629,8 @@ bool LLFolderView::startDrag() void LLFolderView::commitRename( const LLSD& data ) { finishRenamingItem(); + arrange( NULL, NULL ); + } void LLFolderView::draw() -- cgit v1.2.3 From 4d81b1d967fbfa68f97f37d8d162b1ac9900a4b0 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Tue, 14 Jan 2014 10:00:30 +0200 Subject: MAINT-3510 (Incorrect context menu entry in Places floater) --- indra/llui/llfolderview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 11fccdace4..c28660819f 100755 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -236,7 +236,7 @@ public: virtual S32 notify(const LLSD& info) ; bool useLabelSuffix() { return mUseLabelSuffix; } - void updateMenu(); + virtual void updateMenu(); private: void updateMenuOptions(LLMenuGL* menu); -- cgit v1.2.3 From 74c7460846f08d0a2c45589c670e55988a951965 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Mon, 20 Jan 2014 12:48:58 +0200 Subject: MAINT-3618 FIXED Don't copy spaces after cursor to the next line. --- indra/llui/lltexteditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 81d9fd1ec9..7896fcef95 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2338,7 +2338,8 @@ void LLTextEditor::autoIndent() S32 i; LLWString text = getWText(); - while( ' ' == text[line_start] ) + S32 offset = getLineOffsetFromDocIndex(mCursorPos); + while(( ' ' == text[line_start] ) && (space_count < offset)) { space_count++; line_start++; -- cgit v1.2.3 From 1033c9d67f6bf3fd317bc2e6a6990e2b7e5d80c8 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 5 Feb 2014 20:45:09 +0200 Subject: MAINT-3555 crash in LLPanel::~LLPanel() on shutdown: - memory leaks fixing; --- indra/llui/llpanel.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index e63b41f97c..17b9b91ba7 100755 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -330,17 +330,16 @@ private: // local static instance for registering a particular panel class template -class LLRegisterPanelClassWrapper -: public LLRegisterPanelClass + class LLPanelInjector { public: - // reigister with either the provided builder, or the generic templated builder - LLRegisterPanelClassWrapper(const std::string& tag); + // register with either the provided builder, or the generic templated builder + LLPanelInjector(const std::string& tag); }; template -LLRegisterPanelClassWrapper::LLRegisterPanelClassWrapper(const std::string& tag) + LLPanelInjector::LLPanelInjector(const std::string& tag) { LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder); } -- cgit v1.2.3