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/llcommon/llcommonutils.h | 2 + indra/llcommon/llcriticaldamp.cpp | 2 +- indra/llcommon/llcriticaldamp.h | 4 +- indra/llcommon/lldate.cpp | 2 +- indra/llcommon/lldate.h | 2 +- indra/llcommon/llfasttimer.cpp | 22 +++---- indra/llcommon/llinitparam.h | 1 + indra/llcommon/llsdutil.h | 2 +- indra/llcommon/llstring.cpp | 1 + indra/llcommon/llstring.h | 6 +- indra/llcommon/llsys.cpp | 6 +- indra/llcommon/lltraceaccumulators.h | 1 + indra/llcommon/lltracerecording.cpp | 38 ++++++------ indra/llcommon/llunit.h | 110 ++++++++++++++++++++--------------- indra/llcommon/lluuid.h | 1 + indra/llimage/llimagej2c.cpp | 1 + indra/llmath/llcalcparser.h | 5 +- indra/llprimitive/llmaterialid.h | 1 + indra/llrender/llimagegl.cpp | 8 +-- indra/llui/llnotificationsutil.h | 1 + indra/llui/lltrans.h | 1 + indra/llxml/llxmlnode.h | 3 +- indra/newview/llscenemonitor.cpp | 14 ++--- indra/newview/llscenemonitor.h | 36 ++++++------ 24 files changed, 144 insertions(+), 126 deletions(-) diff --git a/indra/llcommon/llcommonutils.h b/indra/llcommon/llcommonutils.h index 755dc41fb4..20ada27830 100755 --- a/indra/llcommon/llcommonutils.h +++ b/indra/llcommon/llcommonutils.h @@ -27,6 +27,8 @@ #ifndef LL_LLCOMMONUTILS_H #define LL_LLCOMMONUTILS_H +#include "lluuid.h" + namespace LLCommonUtils { /** diff --git a/indra/llcommon/llcriticaldamp.cpp b/indra/llcommon/llcriticaldamp.cpp index 575fc4149e..5ffad88973 100755 --- a/indra/llcommon/llcriticaldamp.cpp +++ b/indra/llcommon/llcriticaldamp.cpp @@ -81,7 +81,7 @@ void LLSmoothInterpolation::updateInterpolants() //----------------------------------------------------------------------------- // getInterpolant() //----------------------------------------------------------------------------- -F32 LLSmoothInterpolation::getInterpolant(LLUnit time_constant, bool use_cache) +F32 LLSmoothInterpolation::getInterpolant(LLUnitImplicit time_constant, bool use_cache) { if (time_constant == 0.f) { diff --git a/indra/llcommon/llcriticaldamp.h b/indra/llcommon/llcriticaldamp.h index e174643cd0..7b2a414459 100755 --- a/indra/llcommon/llcriticaldamp.h +++ b/indra/llcommon/llcriticaldamp.h @@ -42,10 +42,10 @@ public: static void updateInterpolants(); // ACCESSORS - static F32 getInterpolant(LLUnit time_constant, bool use_cache = true); + static F32 getInterpolant(LLUnitImplicit time_constant, bool use_cache = true); template - static T lerp(T a, T b, LLUnit time_constant, bool use_cache = true) + static T lerp(T a, T b, LLUnitImplicit time_constant, bool use_cache = true) { F32 interpolant = getInterpolant(time_constant, use_cache); return ((a * (1.f - interpolant)) diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index 7892269e35..cec4047c1f 100755 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -55,7 +55,7 @@ LLDate::LLDate(const LLDate& date) : mSecondsSinceEpoch(date.mSecondsSinceEpoch) {} -LLDate::LLDate(LLUnit seconds_since_epoch) : +LLDate::LLDate(LLUnitImplicit seconds_since_epoch) : mSecondsSinceEpoch(seconds_since_epoch.value()) {} diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h index 1067ac5280..816bc62b14 100755 --- a/indra/llcommon/lldate.h +++ b/indra/llcommon/lldate.h @@ -59,7 +59,7 @@ public: * * @param seconds_since_epoch The number of seconds since UTC epoch. */ - LLDate(LLUnit seconds_since_epoch); + LLDate(LLUnitImplicit seconds_since_epoch); /** * @brief Construct a date from a string representation diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 79aa0c8722..6f046c18ff 100755 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -111,9 +111,9 @@ static timer_tree_dfs_iterator_t end_timer_tree() struct SortTimerByName { bool operator()(const TimeBlock* i1, const TimeBlock* i2) - { + { return i1->getName() < i2->getName(); - } + } }; TimeBlock& TimeBlock::getRootTimeBlock() @@ -227,17 +227,17 @@ void TimeBlock::incrementalUpdateTimerTree() if (accumulator->mMoveUpTree) { - // since ancestors have already been visited, re-parenting won't affect tree traversal + // since ancestors have already been visited, re-parenting won't affect tree traversal //step up tree, bringing our descendants with us LL_DEBUGS("FastTimers") << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() << " to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL; timerp->setParent(timerp->getParent()->getParent()); - accumulator->mParent = timerp->getParent(); - accumulator->mMoveUpTree = false; + accumulator->mParent = timerp->getParent(); + accumulator->mMoveUpTree = false; // don't bubble up any ancestors until descendants are done bubbling up - // as ancestors may call this timer only on certain paths, so we want to resolve - // child-most block locations before their parents + // as ancestors may call this timer only on certain paths, so we want to resolve + // child-most block locations before their parents it.skipAncestors(); } } @@ -357,7 +357,7 @@ void TimeBlock::logStats() // doesn't work correctly on the first frame total_time += frame_recording.getLastRecording().getSum(timer); } - } +} sd["Total"]["Time"] = (LLSD::Real) total_time.value(); sd["Total"]["Calls"] = (LLSD::Integer) 1; @@ -366,7 +366,7 @@ void TimeBlock::logStats() LLMutexLock lock(sLogLock); sLogQueue.push(sd); } - } +} } @@ -413,7 +413,7 @@ void TimeBlock::writeLog(std::ostream& os) LLSDSerialize::toXML(sd, os); LLMutexLock lock(sLogLock); sLogQueue.pop(); - } + } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -470,7 +470,7 @@ LLUnit BlockTimer::getElapsedTime() { U64 total_time = TimeBlock::getCPUClockCount64() - mStartTime; - return (F64)total_time / (F64)TimeBlock::countsPerSecond(); + return LLUnits::Seconds::fromValue((F64)total_time / (F64)TimeBlock::countsPerSecond()); } diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 879ea4fe2a..812071efdd 100755 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -38,6 +38,7 @@ #include "llerror.h" #include "llstl.h" #include "llpredicate.h" +#include "llsd.h" namespace LLTypeTags { diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index 532d3f9341..d0b536c39a 100755 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -29,7 +29,7 @@ #ifndef LL_LLSDUTIL_H #define LL_LLSDUTIL_H -class LLSD; +#include "llsd.h" // U32 LL_COMMON_API LLSD ll_sd_from_U32(const U32); diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 66c416bfdd..6f92c7d5d4 100755 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -29,6 +29,7 @@ #include "llstring.h" #include "llerror.h" #include "llfasttimer.h" +#include "llsd.h" #if LL_WINDOWS #include "llwin32headerslean.h" diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 17893c1910..fdf9f3ce89 100755 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -29,10 +29,11 @@ #include #include -#include +//#include #include #include -#include "llsd.h" +#include +#include #include "llformat.h" #if LL_LINUX || LL_SOLARIS @@ -50,6 +51,7 @@ #endif const char LL_UNKNOWN_CHAR = '?'; +class LLSD; #if LL_DARWIN || LL_LINUX || LL_SOLARIS // Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already) diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 5d805ba841..8d2045dfa0 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -1396,13 +1396,13 @@ public: << " seconds "; } - S32 precision = LL_CONT.precision(); + S32 precision = LL_CONT.precision(); LL_CONT << std::fixed << std::setprecision(1) << framerate << '\n' << LLMemoryInfo(); - LL_CONT.precision(precision); - LL_CONT << LL_ENDL; + LL_CONT.precision(precision); + LL_CONT << LL_ENDL; return false; } diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index a2f9f4c090..efc8b43f6a 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -34,6 +34,7 @@ #include "lltimer.h" #include "llrefcount.h" #include "llthreadlocalstorage.h" +#include namespace LLTrace { diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 48b5a7c3fa..2150a44f12 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -95,7 +95,7 @@ void Recording::handleReset() { mBuffers.write()->reset(); - mElapsedSeconds = 0.0; + mElapsedSeconds = LLUnits::Seconds::fromValue(0.0); mSamplingTimer.reset(); } @@ -131,14 +131,14 @@ void Recording::appendRecording( Recording& other ) LLUnit Recording::getSum(const TraceType& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; - return (F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) - / (F64)LLTrace::TimeBlock::countsPerSecond(); + return LLUnits::Seconds::fromValue((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) + / (F64)LLTrace::TimeBlock::countsPerSecond()); } LLUnit Recording::getSum(const TraceType& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; - return (F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond(); + return LLUnits::Seconds::fromValue((F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond()); } @@ -151,16 +151,16 @@ LLUnit Recording::getPerSec(const TraceTypemStackTimers[stat.getIndex()]; - return (F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) - / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value()); + return LLUnits::Seconds::fromValue((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) + / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value())); } LLUnit Recording::getPerSec(const TraceType& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; - return (F64)(accumulator.mSelfTimeCounter) - / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value()); + return LLUnits::Seconds::fromValue((F64)(accumulator.mSelfTimeCounter) + / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value())); } F32 Recording::getPerSec(const TraceType& stat) @@ -170,52 +170,52 @@ F32 Recording::getPerSec(const TraceType& LLUnit Recording::getMin(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mSize.getMin(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMin()); } LLUnit Recording::getMean(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mSize.getMean(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMean()); } LLUnit Recording::getMax(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mSize.getMax(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMax()); } LLUnit Recording::getStandardDeviation(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation()); } LLUnit Recording::getLastValue(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue()); } LLUnit Recording::getMin(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin()); } LLUnit Recording::getMean(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean()); } LLUnit Recording::getMax(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax()); } LLUnit Recording::getStandardDeviation(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation()); } LLUnit Recording::getLastValue(const TraceType& stat) { - return mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue(); + return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue()); } U32 Recording::getSum(const TraceType& stat) @@ -603,7 +603,7 @@ F64 PeriodicRecording::getPeriodMean( const TraceType& stat, size_t total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); - LLUnit total_duration = 0.f; + LLUnit total_duration(0.f); F64 mean = 0; if (num_periods <= 0) { return mean; } diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index 51f14a5948..f81e746c77 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -141,8 +141,17 @@ protected: template std::ostream& operator <<(std::ostream& s, const LLUnit& unit) { - s << unit.value() << UNIT_TYPE::getUnitLabel(); - return s; + s << unit.value() << UNIT_TYPE::getUnitLabel(); + return s; +} + +template +std::istream& operator >>(std::istream& s, LLUnit& unit) +{ + STORAGE_TYPE val; + s >> val; + unit = val; + return s; } template @@ -172,8 +181,17 @@ struct LLUnitImplicit : public LLUnit template std::ostream& operator <<(std::ostream& s, const LLUnitImplicit& unit) { - s << unit.value() << UNIT_TYPE::getUnitLabel(); - return s; + s << unit.value() << UNIT_TYPE::getUnitLabel(); + return s; +} + +template +std::istream& operator >>(std::istream& s, LLUnitImplicit& unit) +{ + STORAGE_TYPE val; + s >> val; + unit = val; + return s; } template @@ -201,7 +219,7 @@ LL_FORCE_INLINE void ll_convert_units(LLUnit in, LLUnit& out, .. { // T1 and T2 fully reduced and equal...just copy - out = (S2)in.value(); + out = LLUnit((S2)in.value()); } else { @@ -447,33 +465,33 @@ template struct LLUnitLinearOps { typedef LLUnitLinearOps self_t; - LLUnitLinearOps(VALUE_TYPE val) : mValue (val) {} + LLUnitLinearOps(VALUE_TYPE val) : mResult (val) {} - operator VALUE_TYPE() const { return mValue; } - VALUE_TYPE mValue; + operator VALUE_TYPE() const { return mResult; } + VALUE_TYPE mResult; template self_t operator * (T other) { - return mValue * other; + return mResult * other; } template self_t operator / (T other) { - return mValue / other; + return mResult / other; } template self_t operator + (T other) { - return mValue + other; + return mResult + other; } template self_t operator - (T other) { - return mValue - other; + return mResult - other; } }; @@ -482,32 +500,32 @@ struct LLUnitInverseLinearOps { typedef LLUnitInverseLinearOps self_t; - LLUnitInverseLinearOps(VALUE_TYPE val) : mValue (val) {} - operator VALUE_TYPE() const { return mValue; } - VALUE_TYPE mValue; + LLUnitInverseLinearOps(VALUE_TYPE val) : mResult (val) {} + operator VALUE_TYPE() const { return mResult; } + VALUE_TYPE mResult; template self_t operator * (T other) { - return mValue / other; + return mResult / other; } template self_t operator / (T other) { - return mValue * other; + return mResult * other; } template self_t operator + (T other) { - return mValue - other; + return mResult - other; } template self_t operator - (T other) { - return mValue + other; + return mResult + other; } }; @@ -521,35 +539,31 @@ struct base_unit_name template \ static LLUnit fromValue(LLUnit value) \ { return LLUnit(value); } \ -}; \ -template std::ostream& operator<<(std::ostream& s, const LLUnit& val) \ -{ s << val.value() << base_unit_name::getUnitLabel; return s; } - - -#define LL_DECLARE_DERIVED_UNIT(unit_name, unit_label, base_unit_name, conversion_operation) \ -struct unit_name \ -{ \ - typedef base_unit_name base_unit_t; \ - static const char* getUnitLabel() { return unit_label; } \ - template \ - static LLUnit fromValue(T value) { return LLUnit(value); } \ - template \ - static LLUnit fromValue(LLUnit value) \ - { return LLUnit(value); } \ -}; \ -template std::ostream& operator<<(std::ostream& s, const LLUnit& val) \ -{ s << val.value() << unit_name::getUnitLabel; return s; } \ - \ -template \ -void ll_convert_units(LLUnit in, LLUnit& out) \ -{ \ - out = (S2)(LLUnitLinearOps(in.value()) conversion_operation).mValue; \ -} \ - \ -template \ -void ll_convert_units(LLUnit in, LLUnit& out) \ -{ \ - out = (S2)(LLUnitInverseLinearOps(in.value()) conversion_operation).mValue; \ +} + + +#define LL_DECLARE_DERIVED_UNIT(unit_name, unit_label, base_unit_name, conversion_operation) \ +struct unit_name \ +{ \ + typedef base_unit_name base_unit_t; \ + static const char* getUnitLabel() { return unit_label; } \ + template \ + static LLUnit fromValue(T value) { return LLUnit(value); } \ + template \ + static LLUnit fromValue(LLUnit value) \ + { return LLUnit(value); } \ +}; \ + \ +template \ +void ll_convert_units(LLUnit in, LLUnit& out) \ +{ \ + out = LLUnit((S2)(LLUnitLinearOps(in.value()) conversion_operation)); \ +} \ + \ +template \ +void ll_convert_units(LLUnit in, LLUnit& out) \ +{ \ + out = LLUnit((S2)(LLUnitInverseLinearOps(in.value()) conversion_operation)); \ } // diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index 7889828c85..0699dcda83 100755 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -28,6 +28,7 @@ #include #include +#include #include "stdtypes.h" #include "llpreprocessor.h" diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 65cdcd6923..8e2bcc3f94 100755 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -30,6 +30,7 @@ #include "lltimer.h" #include "llmath.h" #include "llmemory.h" +#include "llsd.h" typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)(); typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*); diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h index e0ad270266..faa699ff7b 100755 --- a/indra/llmath/llcalcparser.h +++ b/indra/llmath/llcalcparser.h @@ -163,7 +163,7 @@ private: bool checkNaN(const F32& a) const { return !llisnan(a); } - //FIX* non ambigious function fix making SIN() work for calc -Cryogenic Blitz + //FIX* non ambiguous function fix making SIN() work for calc -Cryogenic Blitz F32 _sin(const F32& a) const { return sin(DEG_TO_RAD * a); } F32 _cos(const F32& a) const { return cos(DEG_TO_RAD * a); } F32 _tan(const F32& a) const { return tan(DEG_TO_RAD * a); } @@ -176,11 +176,8 @@ private: F32 _fabs(const F32& a) const { return fabs(a); } F32 _floor(const F32& a) const { return (F32)llfloor(a); } F32 _ceil(const F32& a) const { return llceil(a); } - F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); } - - LLCalc::calc_map_t* mConstants; LLCalc::calc_map_t* mVariables; // LLCalc::calc_map_t* mUserVariables; diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h index 0a95204085..b4c82d3b7b 100644 --- a/indra/llprimitive/llmaterialid.h +++ b/indra/llprimitive/llmaterialid.h @@ -30,6 +30,7 @@ #define MATERIAL_ID_SIZE 16 #include +#include "llsd.h" class LLMaterialID { diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 01ed946d40..1d4be1f53c 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -51,9 +51,9 @@ U32 wpo2(U32 i); U32 LLImageGL::sUniqueCount = 0; U32 LLImageGL::sBindCount = 0; -LLUnit LLImageGL::sGlobalTextureMemory = 0; -LLUnit LLImageGL::sBoundTextureMemory = 0; -LLUnit LLImageGL::sCurBoundTextureMemory = 0; +LLUnit LLImageGL::sGlobalTextureMemory(0); +LLUnit LLImageGL::sBoundTextureMemory(0); +LLUnit LLImageGL::sCurBoundTextureMemory(0); S32 LLImageGL::sCount = 0; LLImageGL::dead_texturelist_t LLImageGL::sDeadTextureList[LLTexUnit::TT_NONE]; U32 LLImageGL::sCurTexName = 1; @@ -249,7 +249,7 @@ void LLImageGL::updateStats(F32 current_time) LLFastTimer t(FTM_IMAGE_UPDATE_STATS); sLastFrameTime = current_time; sBoundTextureMemory = sCurBoundTextureMemory; - sCurBoundTextureMemory = 0; + sCurBoundTextureMemory = LLUnits::Bytes::fromValue(0); } //static 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" diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h index d7681c54a0..f7c32c4cf5 100755 --- a/indra/llxml/llxmlnode.h +++ b/indra/llxml/llxmlnode.h @@ -42,12 +42,11 @@ #include "llstring.h" #include "llstringtable.h" #include "llfile.h" - +#include "lluuid.h" class LLVector3; class LLVector3d; class LLQuaternion; -class LLUUID; class LLColor4; class LLColor4U; diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index 3f4f872174..29dd140158 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -89,6 +89,7 @@ void LLSceneMonitor::reset() mMonitorRecording.reset(); mSceneLoadRecording.reset(); + mRecordingTimer.reset(); unfreezeScene(); @@ -259,7 +260,6 @@ void LLSceneMonitor::capture() static U32 last_capture_frame = 0; static LLCachedControl monitor_enabled(gSavedSettings, "SceneLoadingMonitorEnabled"); static LLCachedControl scene_load_sample_time(gSavedSettings, "SceneLoadingMonitorSampleTime"); - static LLFrameTimer timer; static bool force_capture = true; bool enabled = monitor_enabled || mDebugViewerVisible; @@ -288,7 +288,7 @@ void LLSceneMonitor::capture() force_capture = true; } - if((timer.getElapsedTimeF32() > scene_load_sample_time() + if((mRecordingTimer.getElapsedTimeF32() > scene_load_sample_time() || force_capture) && mEnabled && LLGLSLShader::sNoFixedFunction @@ -299,8 +299,6 @@ void LLSceneMonitor::capture() mSceneLoadRecording.resume(); mMonitorRecording.resume(); - timer.reset(); - last_capture_frame = gFrameCount; LLRenderTarget& cur_target = getCaptureTarget(); @@ -467,7 +465,6 @@ void LLSceneMonitor::fetchQueryResult() // also throttle timing here, to avoid going below sample time due to phasing with frame capture static LLCachedControl scene_load_sample_time(gSavedSettings, "SceneLoadingMonitorSampleTime"); - static LLFrameTimer timer; if(mDiffState == WAIT_ON_RESULT && !LLAppViewer::instance()->quitRequested()) @@ -483,11 +480,11 @@ void LLSceneMonitor::fetchQueryResult() mDiffResult = sqrtf(count * 0.5f / (mDiff->getWidth() * mDiff->getHeight() * mDiffPixelRatio * mDiffPixelRatio)); //0.5 -> (front face + back face) - LL_DEBUGS("SceneMonitor") << "Frame difference: " << std::setprecision(4) << mDiffResult << LL_ENDL; + LL_DEBUGS("SceneMonitor") << "Frame difference: " << mDiffResult << LL_ENDL; record(sFramePixelDiff, mDiffResult); static LLCachedControl diff_threshold(gSavedSettings,"SceneLoadingPixelDiffThreshold"); - F32 elapsed_time = timer.getElapsedTimeF32(); + F32 elapsed_time = mRecordingTimer.getElapsedTimeF32(); if (elapsed_time > scene_load_sample_time) { @@ -501,10 +498,9 @@ void LLSceneMonitor::fetchQueryResult() { mSceneLoadRecording.nextPeriod(); } + mRecordingTimer.reset(); } } - - timer.reset(); } } diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h index 7088d529d6..b857389243 100644 --- a/indra/newview/llscenemonitor.h +++ b/indra/newview/llscenemonitor.h @@ -72,8 +72,8 @@ private: void generateDitheringTexture(S32 width, S32 height); private: - bool mEnabled; - bool mDebugViewerVisible; + bool mEnabled, + mDebugViewerVisible; enum EDiffState { @@ -82,27 +82,27 @@ private: EXECUTE_DIFF, WAIT_ON_RESULT, VIEWER_QUITTING - } mDiffState; + } mDiffState; - LLRenderTarget* mFrames[2]; - LLRenderTarget* mDiff; + LLRenderTarget* mFrames[2]; + LLRenderTarget* mDiff; - GLuint mQueryObject; //used for glQuery - F32 mDiffResult; //aggregate results of mDiff. - F32 mDiffTolerance; //pixels are filtered out when R+G+B < mDiffTolerance + GLuint mQueryObject; //used for glQuery + F32 mDiffResult, //aggregate results of mDiff. + mDiffTolerance, //pixels are filtered out when R+G+B < mDiffTolerance + mDiffPixelRatio; //ratio of pixels used for comparison against the original mDiff size along one dimension - F32 mDiffPixelRatio; //ratio of pixels used for comparison against the original mDiff size along one dimension + LLPointer mDitheringTexture; + S32 mDitherMatrixWidth; + F32 mDitherScale, + mDitherScaleS, + mDitherScaleT; - LLPointer mDitheringTexture; - S32 mDitherMatrixWidth; - F32 mDitherScale; - F32 mDitherScaleS; - F32 mDitherScaleT; + std::vector mAvatarPauseHandles; - std::vector mAvatarPauseHandles; - - LLTrace::ExtendablePeriodicRecording mSceneLoadRecording; - LLTrace::Recording mMonitorRecording; + LLFrameTimer mRecordingTimer; + LLTrace::ExtendablePeriodicRecording mSceneLoadRecording; + LLTrace::Recording mMonitorRecording; }; class LLSceneMonitorView : public LLFloater -- cgit v1.2.3