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/llcharacter/llkeyframewalkmotion.cpp | 2 +- indra/llcommon/llfasttimer.cpp | 10 +- indra/llcommon/llfasttimer.h | 2 +- indra/llcommon/lltimer.cpp | 2 +- indra/llcommon/lltraceaccumulators.h | 6 +- indra/llcommon/lltracerecording.cpp | 62 +++--- indra/llcommon/lltracerecording.h | 36 +-- indra/llcommon/llunit.h | 342 +++++++++++++++-------------- indra/llinventory/llparcel.cpp | 2 +- indra/llrender/llimagegl.cpp | 8 +- indra/llrender/llimagegl.h | 6 +- indra/llui/llstatbar.cpp | 14 +- indra/newview/llconversationlog.cpp | 6 +- indra/newview/llconversationlog.h | 6 +- indra/newview/llconversationloglist.cpp | 4 +- indra/newview/llfasttimerview.cpp | 36 +-- indra/newview/llfasttimerview.h | 6 +- indra/newview/llscenemonitor.cpp | 2 +- indra/newview/llstartup.cpp | 2 +- indra/newview/lltexturefetch.cpp | 8 +- indra/newview/lltexturefetch.h | 12 +- indra/newview/lltextureinfo.cpp | 26 +-- indra/newview/lltextureinfo.h | 14 +- indra/newview/lltextureinfodetails.h | 4 +- indra/newview/lltextureview.cpp | 20 +- indra/newview/llviewerassetstats.cpp | 10 +- indra/newview/llviewerassetstats.h | 2 +- indra/newview/llviewermessage.cpp | 18 +- indra/newview/llviewerobjectlist.cpp | 6 +- indra/newview/llviewerstats.cpp | 54 ++--- indra/newview/llviewerstats.h | 30 +-- indra/newview/llviewertexture.cpp | 16 +- indra/newview/llviewertexture.h | 14 +- indra/newview/llviewertexturelist.cpp | 8 +- indra/newview/llviewertexturelist.h | 8 +- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llvoavatarself.cpp | 2 +- indra/newview/llvoicevivox.cpp | 2 +- indra/newview/llworld.cpp | 6 +- 39 files changed, 414 insertions(+), 402 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index 66e4b947c4..65c1fcd99d 100755 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -383,7 +383,7 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask) F32 target_roll = llclamp(ang_vel.mV[VZ], -4.f, 4.f) * roll_factor; // roll is critically damped interpolation between current roll and angular velocity-derived target roll - mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, LLUnits::U32Milliseconds(100)); + mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, U32Milliseconds(100)); LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f)); mPelvisState->setRotation(roll); diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index a91e716f19..5f92c66f47 100755 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -339,7 +339,7 @@ void TimeBlock::logStats() } call_count++; - LLUnits::F64Seconds total_time(0); + F64Seconds total_time(0); LLSD sd; { @@ -382,11 +382,11 @@ void TimeBlock::dumpCurTimes() ++it) { TimeBlock* timerp = (*it); - LLUnits::F64Seconds total_time = last_frame_recording.getSum(*timerp); + F64Seconds total_time = last_frame_recording.getSum(*timerp); U32 num_calls = last_frame_recording.getSum(timerp->callCount()); // Don't bother with really brief times, keep output concise - if (total_time < LLUnits::F32Milliseconds(0.1f)) continue; + if (total_time < F32Milliseconds(0.1f)) continue; std::ostringstream out_str; TimeBlock* parent_timerp = timerp; @@ -466,11 +466,11 @@ void TimeBlockAccumulator::reset( const TimeBlockAccumulator* other ) } } -LLUnits::F64Seconds BlockTimer::getElapsedTime() +F64Seconds BlockTimer::getElapsedTime() { U64 total_time = TimeBlock::getCPUClockCount64() - mStartTime; - return LLUnits::F64Seconds((F64)total_time / (F64)TimeBlock::countsPerSecond()); + return F64Seconds((F64)total_time / (F64)TimeBlock::countsPerSecond()); } diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 589b9bb941..ccf71c3f4c 100755 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -48,7 +48,7 @@ public: BlockTimer(TimeBlock& timer); ~BlockTimer(); - LLUnits::F64Seconds getElapsedTime(); + F64Seconds getElapsedTime(); private: diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 7077ea4b4f..74f3a7f587 100755 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -262,7 +262,7 @@ LLUnitImplicit totalTime() } // Return the total clock tick count in microseconds. - return LLUnits::U64Microseconds(gTotalTimeClockCount*gClocksToMicroseconds); + return U64Microseconds(gTotalTimeClockCount*gClocksToMicroseconds); } diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index 4d79964526..73da6bd2d8 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -418,7 +418,7 @@ namespace LLTrace class TimeBlockAccumulator { public: - typedef LLUnits::F64Seconds value_t; + typedef F64Seconds value_t; typedef TimeBlockAccumulator self_t; // fake classes that allows us to view different facets of underlying statistic @@ -429,7 +429,7 @@ namespace LLTrace struct SelfTimeFacet { - typedef LLUnits::F64Seconds value_t; + typedef F64Seconds value_t; }; TimeBlockAccumulator(); @@ -492,7 +492,7 @@ namespace LLTrace struct ChildMemFacet { - typedef LLUnit value_t; + typedef F64Bytes value_t; }; MemStatAccumulator() diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 963f0cd174..bc98eebf31 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -95,7 +95,7 @@ void Recording::handleReset() { mBuffers.write()->reset(); - mElapsedSeconds = LLUnits::F64Seconds(0.0); + mElapsedSeconds = F64Seconds(0.0); mSamplingTimer.reset(); } @@ -128,17 +128,17 @@ void Recording::appendRecording( Recording& other ) mElapsedSeconds += other.mElapsedSeconds; } -LLUnits::F64Seconds Recording::getSum(const TraceType& stat) +F64Seconds Recording::getSum(const TraceType& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; - return LLUnits::F64Seconds((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) + return F64Seconds((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond()); } -LLUnits::F64Seconds Recording::getSum(const TraceType& stat) +F64Seconds Recording::getSum(const TraceType& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; - return LLUnits::F64Seconds((F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond()); + return F64Seconds((F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond()); } @@ -147,19 +147,19 @@ U32 Recording::getSum(const TraceType& sta return mBuffers->mStackTimers[stat.getIndex()].mCalls; } -LLUnits::F64Seconds Recording::getPerSec(const TraceType& stat) +F64Seconds Recording::getPerSec(const TraceType& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; - return LLUnits::F64Seconds((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) + return F64Seconds((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value())); } -LLUnits::F64Seconds Recording::getPerSec(const TraceType& stat) +F64Seconds Recording::getPerSec(const TraceType& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; - return LLUnits::F64Seconds((F64)(accumulator.mSelfTimeCounter) + return F64Seconds((F64)(accumulator.mSelfTimeCounter) / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value())); } @@ -168,54 +168,54 @@ F32 Recording::getPerSec(const TraceType& return (F32)mBuffers->mStackTimers[stat.getIndex()].mCalls / mElapsedSeconds.value(); } -LLUnits::F64Bytes Recording::getMin(const TraceType& stat) +F64Bytes Recording::getMin(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMin()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMin()); } -LLUnits::F64Bytes Recording::getMean(const TraceType& stat) +F64Bytes Recording::getMean(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMean()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMean()); } -LLUnits::F64Bytes Recording::getMax(const TraceType& stat) +F64Bytes Recording::getMax(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMax()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMax()); } -LLUnits::F64Bytes Recording::getStandardDeviation(const TraceType& stat) +F64Bytes Recording::getStandardDeviation(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation()); } -LLUnits::F64Bytes Recording::getLastValue(const TraceType& stat) +F64Bytes Recording::getLastValue(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue()); } -LLUnits::F64Bytes Recording::getMin(const TraceType& stat) +F64Bytes Recording::getMin(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin()); } -LLUnits::F64Bytes Recording::getMean(const TraceType& stat) +F64Bytes Recording::getMean(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean()); } -LLUnits::F64Bytes Recording::getMax(const TraceType& stat) +F64Bytes Recording::getMax(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax()); } -LLUnits::F64Bytes Recording::getStandardDeviation(const TraceType& stat) +F64Bytes Recording::getStandardDeviation(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation()); } -LLUnits::F64Bytes Recording::getLastValue(const TraceType& stat) +F64Bytes Recording::getLastValue(const TraceType& stat) { - return LLUnits::F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue()); } U32 Recording::getSum(const TraceType& stat) @@ -427,9 +427,9 @@ void PeriodicRecording::appendPeriodicRecording( PeriodicRecording& other ) getCurRecording().setPlayState(getPlayState()); } -LLUnits::F64Seconds PeriodicRecording::getDuration() const +F64Seconds PeriodicRecording::getDuration() const { - LLUnits::F64Seconds duration; + F64Seconds duration; size_t num_periods = mRecordingPeriods.size(); for (size_t i = 1; i <= num_periods; i++) { diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 3c23c6a3f6..68b95a1003 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -166,26 +166,26 @@ namespace LLTrace void makeUnique() { mBuffers.makeUnique(); } // Timer accessors - LLUnits::F64Seconds getSum(const TraceType& stat); - LLUnits::F64Seconds getSum(const TraceType& stat); + F64Seconds getSum(const TraceType& stat); + F64Seconds getSum(const TraceType& stat); U32 getSum(const TraceType& stat); - LLUnits::F64Seconds getPerSec(const TraceType& stat); - LLUnits::F64Seconds getPerSec(const TraceType& stat); + F64Seconds getPerSec(const TraceType& stat); + F64Seconds getPerSec(const TraceType& stat); F32 getPerSec(const TraceType& stat); // Memory accessors - LLUnit getMin(const TraceType& stat); - LLUnit getMean(const TraceType& stat); - LLUnit getMax(const TraceType& stat); - LLUnit getStandardDeviation(const TraceType& stat); - LLUnit getLastValue(const TraceType& stat); - - LLUnit getMin(const TraceType& stat); - LLUnit getMean(const TraceType& stat); - LLUnit getMax(const TraceType& stat); - LLUnit getStandardDeviation(const TraceType& stat); - LLUnit getLastValue(const TraceType& stat); + F64Bytes getMin(const TraceType& stat); + F64Bytes getMean(const TraceType& stat); + F64Bytes getMax(const TraceType& stat); + F64Bytes getStandardDeviation(const TraceType& stat); + F64Bytes getLastValue(const TraceType& stat); + + F64Bytes getMin(const TraceType& stat); + F64Bytes getMean(const TraceType& stat); + F64Bytes getMax(const TraceType& stat); + F64Bytes getStandardDeviation(const TraceType& stat); + F64Bytes getLastValue(const TraceType& stat); U32 getSum(const TraceType& stat); U32 getSum(const TraceType& stat); @@ -295,7 +295,7 @@ namespace LLTrace U32 getSampleCount(const TraceType& stat); - LLUnits::F64Seconds getDuration() const { return mElapsedSeconds; } + F64Seconds getDuration() const { return mElapsedSeconds; } protected: friend class ThreadRecorder; @@ -310,7 +310,7 @@ namespace LLTrace class ThreadRecorder* getThreadRecorder(); LLTimer mSamplingTimer; - LLUnits::F64Seconds mElapsedSeconds; + F64Seconds mElapsedSeconds; LLCopyOnWritePointer mBuffers; bool mInHandOff; @@ -325,7 +325,7 @@ namespace LLTrace void nextPeriod(); size_t getNumRecordedPeriods() { return mNumPeriods; } - LLUnits::F64Seconds getDuration() const; + F64Seconds getDuration() const; void appendPeriodicRecording(PeriodicRecording& other); void appendRecording(Recording& recording); diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index 9a367d9182..b62bebc440 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -643,55 +643,58 @@ LL_DECLARE_DERIVED_UNIT(Megabytes, * 1000, Gigabytes, "GB"); LL_DECLARE_DERIVED_UNIT(Bytes, * 1024, Kibibytes, "KiB"); LL_DECLARE_DERIVED_UNIT(Kibibytes, * 1024, Mibibytes, "MiB"); LL_DECLARE_DERIVED_UNIT(Mibibytes, * 1024, Gibibytes, "GiB"); +} -typedef LLUnit F32Bytes; -typedef LLUnit F32KiloBytes; -typedef LLUnit F32MegaBytes; -typedef LLUnit F32GigaBytes; -typedef LLUnit F32KibiBytes; -typedef LLUnit F32MibiBytes; -typedef LLUnit F32GibiBytes; - -typedef LLUnit F64Bytes; -typedef LLUnit F64KiloBytes; -typedef LLUnit F64MegaBytes; -typedef LLUnit F64GigaBytes; -typedef LLUnit F64KibiBytes; -typedef LLUnit F64MibiBytes; -typedef LLUnit F64GibiBytes; - -typedef LLUnit S32Bytes; -typedef LLUnit S32KiloBytes; -typedef LLUnit S32MegaBytes; -typedef LLUnit S32GigaBytes; -typedef LLUnit S32KibiBytes; -typedef LLUnit S32MibiBytes; -typedef LLUnit S32GibiBytes; - -typedef LLUnit U32Bytes; -typedef LLUnit U32KiloBytes; -typedef LLUnit U32MegaBytes; -typedef LLUnit U32GigaBytes; -typedef LLUnit U32KibiBytes; -typedef LLUnit U32MibiBytes; -typedef LLUnit U32GibiBytes; - -typedef LLUnit S64Bytes; -typedef LLUnit S64KiloBytes; -typedef LLUnit S64MegaBytes; -typedef LLUnit S64GigaBytes; -typedef LLUnit S64KibiBytes; -typedef LLUnit S64MibiBytes; -typedef LLUnit S64GibiBytes; - -typedef LLUnit U64Bytes; -typedef LLUnit U64KiloBytes; -typedef LLUnit U64MegaBytes; -typedef LLUnit U64GigaBytes; -typedef LLUnit U64KibiBytes; -typedef LLUnit U64MibiBytes; -typedef LLUnit U64GibiBytes; +typedef LLUnit F32Bytes; +typedef LLUnit F32Kilobytes; +typedef LLUnit F32Megabytes; +typedef LLUnit F32Gigabytes; +typedef LLUnit F32Kibibytes; +typedef LLUnit F32Mibibytes; +typedef LLUnit F32Gibibytes; + +typedef LLUnit F64Bytes; +typedef LLUnit F64Kilobytes; +typedef LLUnit F64Megabytes; +typedef LLUnit F64Gigabytes; +typedef LLUnit F64Kibibytes; +typedef LLUnit F64Mibibytes; +typedef LLUnit F64Gibibytes; + +typedef LLUnit S32Bytes; +typedef LLUnit S32Kilobytes; +typedef LLUnit S32Megabytes; +typedef LLUnit S32Gigabytes; +typedef LLUnit S32Kibibytes; +typedef LLUnit S32Mibibytes; +typedef LLUnit S32Gibibytes; + +typedef LLUnit U32Bytes; +typedef LLUnit U32Kilobytes; +typedef LLUnit U32Megabytes; +typedef LLUnit U32Gigabytes; +typedef LLUnit U32Kibibytes; +typedef LLUnit U32Mibibytes; +typedef LLUnit U32Gibibytes; + +typedef LLUnit S64Bytes; +typedef LLUnit S64Kilobytes; +typedef LLUnit S64Megabytes; +typedef LLUnit S64Gigabytes; +typedef LLUnit S64Kibibytes; +typedef LLUnit S64Mibibytes; +typedef LLUnit S64Gibibytes; + +typedef LLUnit U64Bytes; +typedef LLUnit U64Kilobytes; +typedef LLUnit U64Megabytes; +typedef LLUnit U64Gigabytes; +typedef LLUnit U64Kibibytes; +typedef LLUnit U64Mibibytes; +typedef LLUnit U64Gibibytes; +namespace LLUnits +{ LL_DECLARE_DERIVED_UNIT(Bytes, / 8, Bits, "b"); LL_DECLARE_DERIVED_UNIT(Bits, * 1000, Kilobits, "Kb"); LL_DECLARE_DERIVED_UNIT(Kilobits, * 1000, Megabits, "Mb"); @@ -699,55 +702,58 @@ LL_DECLARE_DERIVED_UNIT(Megabits, * 1000, Gigabits, "Gb"); LL_DECLARE_DERIVED_UNIT(Bits, * 1024, Kibibits, "Kib"); LL_DECLARE_DERIVED_UNIT(Kibibits, * 1024, Mibibits, "Mib"); LL_DECLARE_DERIVED_UNIT(Mibibits, * 1024, Gibibits, "Gib"); +} -typedef LLUnit F32Bits; -typedef LLUnit F32KiloBits; -typedef LLUnit F32MegaBits; -typedef LLUnit F32GigaBits; -typedef LLUnit F32KibiBits; -typedef LLUnit F32MibiBits; -typedef LLUnit F32GibiBits; - -typedef LLUnit F64Bits; -typedef LLUnit F64KiloBits; -typedef LLUnit F64MegaBits; -typedef LLUnit F64GigaBits; -typedef LLUnit F64KibiBits; -typedef LLUnit F64MibiBits; -typedef LLUnit F64GibiBits; - -typedef LLUnit S32Bits; -typedef LLUnit S32KiloBits; -typedef LLUnit S32MegaBits; -typedef LLUnit S32GigaBits; -typedef LLUnit S32KibiBits; -typedef LLUnit S32MibiBits; -typedef LLUnit S32GibiBits; - -typedef LLUnit U32Bits; -typedef LLUnit U32KiloBits; -typedef LLUnit U32MegaBits; -typedef LLUnit U32GigaBits; -typedef LLUnit U32KibiBits; -typedef LLUnit U32MibiBits; -typedef LLUnit U32GibiBits; - -typedef LLUnit S64Bits; -typedef LLUnit S64KiloBits; -typedef LLUnit S64MegaBits; -typedef LLUnit S64GigaBits; -typedef LLUnit S64KibiBits; -typedef LLUnit S64MibiBits; -typedef LLUnit S64GibiBits; - -typedef LLUnit U64Bits; -typedef LLUnit U64KiloBits; -typedef LLUnit U64MegaBits; -typedef LLUnit U64GigaBits; -typedef LLUnit U64KibiBits; -typedef LLUnit U64MibiBits; -typedef LLUnit U64GibiBits; +typedef LLUnit F32Bits; +typedef LLUnit F32Kilobits; +typedef LLUnit F32Megabits; +typedef LLUnit F32Gigabits; +typedef LLUnit F32Kibibits; +typedef LLUnit F32Mibibits; +typedef LLUnit F32Gibibits; + +typedef LLUnit F64Bits; +typedef LLUnit F64Kilobits; +typedef LLUnit F64Megabits; +typedef LLUnit F64Gigabits; +typedef LLUnit F64Kibibits; +typedef LLUnit F64Mibibits; +typedef LLUnit F64Gibibits; + +typedef LLUnit S32Bits; +typedef LLUnit S32Kilobits; +typedef LLUnit S32Megabits; +typedef LLUnit S32Gigabits; +typedef LLUnit S32Kibibits; +typedef LLUnit S32Mibibits; +typedef LLUnit S32Gibibits; + +typedef LLUnit U32Bits; +typedef LLUnit U32Kilobits; +typedef LLUnit U32Megabits; +typedef LLUnit U32Gigabits; +typedef LLUnit U32Kibibits; +typedef LLUnit U32Mibibits; +typedef LLUnit U32Gibibits; + +typedef LLUnit S64Bits; +typedef LLUnit S64Kilobits; +typedef LLUnit S64Megabits; +typedef LLUnit S64Gigabits; +typedef LLUnit S64Kibibits; +typedef LLUnit S64Mibibits; +typedef LLUnit S64Gibibits; + +typedef LLUnit U64Bits; +typedef LLUnit U64Kilobits; +typedef LLUnit U64Megabits; +typedef LLUnit U64Gigabits; +typedef LLUnit U64Kibibits; +typedef LLUnit U64Mibibits; +typedef LLUnit U64Gibibits; +namespace LLUnits +{ LL_DECLARE_BASE_UNIT(Seconds, "s"); LL_DECLARE_DERIVED_UNIT(Seconds, * 60, Minutes, "min"); LL_DECLARE_DERIVED_UNIT(Minutes, * 60, Hours, "h"); @@ -755,90 +761,96 @@ LL_DECLARE_DERIVED_UNIT(Hours, * 24, Days, "d"); LL_DECLARE_DERIVED_UNIT(Seconds, / 1000, Milliseconds, "ms"); LL_DECLARE_DERIVED_UNIT(Milliseconds, / 1000, Microseconds, "\x09\x3cs"); LL_DECLARE_DERIVED_UNIT(Microseconds, / 1000, Nanoseconds, "ns"); +} -typedef LLUnit F32Seconds; -typedef LLUnit F32Minutes; -typedef LLUnit F32Hours; -typedef LLUnit F32Days; -typedef LLUnit F32Milliseconds; -typedef LLUnit F32Microseconds; -typedef LLUnit F32Nanoseconds; - -typedef LLUnit F64Seconds; -typedef LLUnit F64Minutes; -typedef LLUnit F64Hours; -typedef LLUnit F64Days; -typedef LLUnit F64Milliseconds; -typedef LLUnit F64Microseconds; -typedef LLUnit F64Nanoseconds; - -typedef LLUnit S32Seconds; -typedef LLUnit S32Minutes; -typedef LLUnit S32Hours; -typedef LLUnit S32Days; -typedef LLUnit S32Milliseconds; -typedef LLUnit S32Microseconds; -typedef LLUnit S32Nanoseconds; - -typedef LLUnit U32Seconds; -typedef LLUnit U32Minutes; -typedef LLUnit U32Hours; -typedef LLUnit U32Days; -typedef LLUnit U32Milliseconds; -typedef LLUnit U32Microseconds; -typedef LLUnit U32Nanoseconds; - -typedef LLUnit S64Seconds; -typedef LLUnit S64Minutes; -typedef LLUnit S64Hours; -typedef LLUnit S64Days; -typedef LLUnit S64Milliseconds; -typedef LLUnit S64Microseconds; -typedef LLUnit S64Nanoseconds; - -typedef LLUnit U64Seconds; -typedef LLUnit U64Minutes; -typedef LLUnit U64Hours; -typedef LLUnit U64Days; -typedef LLUnit U64Milliseconds; -typedef LLUnit U64Microseconds; -typedef LLUnit U64Nanoseconds; +typedef LLUnit F32Seconds; +typedef LLUnit F32Minutes; +typedef LLUnit F32Hours; +typedef LLUnit F32Days; +typedef LLUnit F32Milliseconds; +typedef LLUnit F32Microseconds; +typedef LLUnit F32Nanoseconds; + +typedef LLUnit F64Seconds; +typedef LLUnit F64Minutes; +typedef LLUnit F64Hours; +typedef LLUnit F64Days; +typedef LLUnit F64Milliseconds; +typedef LLUnit F64Microseconds; +typedef LLUnit F64Nanoseconds; + +typedef LLUnit S32Seconds; +typedef LLUnit S32Minutes; +typedef LLUnit S32Hours; +typedef LLUnit S32Days; +typedef LLUnit S32Milliseconds; +typedef LLUnit S32Microseconds; +typedef LLUnit S32Nanoseconds; + +typedef LLUnit U32Seconds; +typedef LLUnit U32Minutes; +typedef LLUnit U32Hours; +typedef LLUnit U32Days; +typedef LLUnit U32Milliseconds; +typedef LLUnit U32Microseconds; +typedef LLUnit U32Nanoseconds; + +typedef LLUnit S64Seconds; +typedef LLUnit S64Minutes; +typedef LLUnit S64Hours; +typedef LLUnit S64Days; +typedef LLUnit S64Milliseconds; +typedef LLUnit S64Microseconds; +typedef LLUnit S64Nanoseconds; + +typedef LLUnit U64Seconds; +typedef LLUnit U64Minutes; +typedef LLUnit U64Hours; +typedef LLUnit U64Days; +typedef LLUnit U64Milliseconds; +typedef LLUnit U64Microseconds; +typedef LLUnit U64Nanoseconds; +namespace LLUnits +{ LL_DECLARE_BASE_UNIT(Meters, "m"); LL_DECLARE_DERIVED_UNIT(Meters, * 1000, Kilometers, "km"); LL_DECLARE_DERIVED_UNIT(Meters, / 100, Centimeters, "cm"); LL_DECLARE_DERIVED_UNIT(Meters, / 1000, Millimeters, "mm"); +} -typedef LLUnit F32Meters; -typedef LLUnit F32Kilometers; -typedef LLUnit F32Centimeters; -typedef LLUnit F32Millimeters; +typedef LLUnit F32Meters; +typedef LLUnit F32Kilometers; +typedef LLUnit F32Centimeters; +typedef LLUnit F32Millimeters; -typedef LLUnit F64Meters; -typedef LLUnit F64Kilometers; -typedef LLUnit F64Centimeters; -typedef LLUnit F64Millimeters; +typedef LLUnit F64Meters; +typedef LLUnit F64Kilometers; +typedef LLUnit F64Centimeters; +typedef LLUnit F64Millimeters; -typedef LLUnit S32Meters; -typedef LLUnit S32Kilometers; -typedef LLUnit S32Centimeters; -typedef LLUnit S32Millimeters; +typedef LLUnit S32Meters; +typedef LLUnit S32Kilometers; +typedef LLUnit S32Centimeters; +typedef LLUnit S32Millimeters; -typedef LLUnit U32Meters; -typedef LLUnit U32Kilometers; -typedef LLUnit U32Centimeters; -typedef LLUnit U32Millimeters; +typedef LLUnit U32Meters; +typedef LLUnit U32Kilometers; +typedef LLUnit U32Centimeters; +typedef LLUnit U32Millimeters; -typedef LLUnit S64Meters; -typedef LLUnit S64Kilometers; -typedef LLUnit S64Centimeters; -typedef LLUnit S64Millimeters; +typedef LLUnit S64Meters; +typedef LLUnit S64Kilometers; +typedef LLUnit S64Centimeters; +typedef LLUnit S64Millimeters; -typedef LLUnit U64Meters; -typedef LLUnit U64Kilometers; -typedef LLUnit U64Centimeters; -typedef LLUnit U64Millimeters; +typedef LLUnit U64Meters; +typedef LLUnit U64Kilometers; +typedef LLUnit U64Centimeters; +typedef LLUnit U64Millimeters; +namespace LLUnits +{ // rare units LL_DECLARE_BASE_UNIT(Hertz, "Hz"); LL_DECLARE_DERIVED_UNIT(Hertz, * 1000, Kilohertz, "KHz"); diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 25c7f58c91..2bb78ea839 100755 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -1082,7 +1082,7 @@ void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group) mGroupID.setNull(); } mSaleTimerExpires.start(); - mSaleTimerExpires.setTimerExpirySec(LLUnits::U64Microseconds(DEFAULT_USEC_SALE_TIMEOUT)); + mSaleTimerExpires.setTimerExpirySec(U64Microseconds(DEFAULT_USEC_SALE_TIMEOUT)); mStatus = OS_LEASE_PENDING; mClaimDate = time(NULL); setAuctionID(0); diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 6a45ebc598..b63ee7f9f9 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); +S32Bytes LLImageGL::sGlobalTextureMemory(0); +S32Bytes LLImageGL::sBoundTextureMemory(0); +S32Bytes 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 = LLUnits::S32Bytes(0); + sCurBoundTextureMemory = S32Bytes(0); } //static diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index c38b8d3cfa..035d42c3ad 100755 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -246,9 +246,9 @@ public: static F32 sLastFrameTime; // Global memory statistics - static LLUnit sGlobalTextureMemory; // Tracks main memory texmem - static LLUnit sBoundTextureMemory; // Tracks bound texmem for last completed frame - static LLUnit sCurBoundTextureMemory; // Tracks bound texmem for current frame + static S32Bytes sGlobalTextureMemory; // Tracks main memory texmem + static S32Bytes sBoundTextureMemory; // Tracks bound texmem for last completed frame + static S32Bytes sCurBoundTextureMemory; // Tracks bound texmem for current frame static U32 sBindCount; // Tracks number of texture binds for current frame static U32 sUniqueCount; // Tracks number of unique texture binds for current frame static BOOL sGlobalUseAnisotropic; 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; diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index a17a4e5e21..9311056a27 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -39,7 +39,7 @@ const int CONVERSATION_LIFETIME = 30; // lifetime of LLConversation is 30 days b struct ConversationParams : public LLInitParam::Block { - Mandatory > time; + Mandatory time; Mandatory timestamp; Mandatory conversation_type; Mandatory conversation_name, @@ -113,7 +113,7 @@ void LLConversation::onIMFloaterShown(const LLUUID& session_id) } // static -const std::string LLConversation::createTimestamp(const LLUnit& utc_time) +const std::string LLConversation::createTimestamp(const U64Seconds& utc_time) { std::string timeStr; LLSD substitution; @@ -132,7 +132,7 @@ const std::string LLConversation::createTimestamp(const LLUnit now(time_corrected()); + U64Seconds now(time_corrected()); LLUnit age = now - mTime; return age > days; diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 5d94cb6497..fd6ad9ad66 100755 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -55,7 +55,7 @@ public: const LLUUID& getSessionID() const { return mSessionID; } const LLUUID& getParticipantID() const { return mParticipantID; } const std::string& getTimestamp() const { return mTimestamp; } - const LLUnit& + const U64Seconds& getTime() const { return mTime; } bool hasOfflineMessages() const { return mHasOfflineIMs; } @@ -76,7 +76,7 @@ public: /* * returns string representation(in form of: mm/dd/yyyy hh:mm) of time when conversation was started */ - static const std::string createTimestamp(const LLUnit& utc_time); + static const std::string createTimestamp(const U64Seconds& utc_time); private: @@ -88,7 +88,7 @@ private: boost::signals2::connection mIMFloaterShowedConnection; - LLUnit mTime; // last interaction time + U64Seconds mTime; // last interaction time SessionType mConversationType; std::string mConversationName; std::string mHistoryFileName; diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index bd5e0b8f88..93719ac7fb 100755 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -518,8 +518,8 @@ bool LLConversationLogListNameComparator::doCompare(const LLConversationLogListI bool LLConversationLogListDateComparator::doCompare(const LLConversationLogListItem* conversation1, const LLConversationLogListItem* conversation2) const { - LLUnit date1 = conversation1->getConversation()->getTime(); - LLUnit date2 = conversation2->getConversation()->getTime(); + U64Seconds date1 = conversation1->getConversation()->getTime(); + U64Seconds date2 = conversation2->getConversation()->getTime(); const LLUUID& id1 = conversation1->getConversation()->getParticipantID(); const LLUUID& id2 = conversation2->getConversation()->getParticipantID(); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 11a9a70b18..725a2f2daf 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -260,7 +260,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) TimerBarRow& row = mHoverBarIndex == 0 ? mAverageTimerRow : mTimerBarRows[mScrollIndex + mHoverBarIndex - 1]; TimerBar* hover_bar = NULL; - LLUnits::F32Seconds mouse_time_offset = ((F32)(x - mBarRect.mLeft) / (F32)mBarRect.getWidth()) * mTotalTimeDisplay; + F32Seconds mouse_time_offset = ((F32)(x - mBarRect.mLeft) / (F32)mBarRect.getWidth()) * mTotalTimeDisplay; for (int bar_index = 0, end_index = LLInstanceTracker::instanceCount(); bar_index < end_index; ++bar_index) @@ -317,11 +317,11 @@ static std::string get_tooltip(TimeBlock& timer, S32 history_index, PeriodicReco if (history_index == 0) { // by default, show average number of call - tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)LLUnit(frame_recording.getPeriodMean (timer, RUNNING_AVERAGE_WIDTH)).value(), (S32)frame_recording.getPeriodMean(timer.callCount(), RUNNING_AVERAGE_WIDTH)); + tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)F64Milliseconds(frame_recording.getPeriodMean (timer, RUNNING_AVERAGE_WIDTH)).value(), (S32)frame_recording.getPeriodMean(timer.callCount(), RUNNING_AVERAGE_WIDTH)); } else { - tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)LLUnit(frame_recording.getPrevRecording(history_index).getSum(timer)).value(), (S32)frame_recording.getPrevRecording(history_index).getSum(timer.callCount())); + tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)F64Milliseconds(frame_recording.getPrevRecording(history_index).getSum(timer)).value(), (S32)frame_recording.getPrevRecording(history_index).getSum(timer.callCount())); } return tooltip; } @@ -996,7 +996,7 @@ void LLFastTimerView::printLineStats() } first = false; - LLUnits::F32Seconds ticks; + F32Seconds ticks; if (mStatsIndex == 0) { ticks = mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH); @@ -1005,7 +1005,7 @@ void LLFastTimerView::printLineStats() { ticks = mRecording.getPrevRecording(mStatsIndex).getSum(*idp); } - LLUnit ms = ticks; + F32Milliseconds ms = ticks; timer_stat += llformat("%.1f",ms.value()); @@ -1029,7 +1029,7 @@ void LLFastTimerView::drawLineGraph() LLLocalClipRect clip(mGraphRect); //normalize based on last frame's maximum - static LLUnits::F32Seconds max_time(0.000001); + static F32Seconds max_time(0.000001); static U32 max_calls = 0; static F32 alpha_interp = 0.f; @@ -1060,7 +1060,7 @@ void LLFastTimerView::drawLineGraph() } } - LLUnits::F32Seconds cur_max(0); + F32Seconds cur_max(0); U32 cur_max_calls = 0; for(timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME); it != end_timer_tree(); @@ -1101,7 +1101,7 @@ void LLFastTimerView::drawLineGraph() j--) { LLTrace::Recording& recording = mRecording.getPrevRecording(j); - LLUnits::F32Seconds time = llmax(recording.getSum(*idp), LLUnits::F64Seconds(0.000001)); + F32Seconds time = llmax(recording.getSum(*idp), F64Seconds(0.000001)); U32 calls = recording.getSum(idp->callCount()); if (is_hover_timer) @@ -1146,7 +1146,7 @@ void LLFastTimerView::drawLineGraph() max_time = lerp(max_time.value(), cur_max.value(), LLSmoothInterpolation::getInterpolant(0.1f)); if (llabs((max_time - cur_max).value()) <= 1) { - max_time = llmax(LLUnits::F32Microseconds(1.f), LLUnits::F32Microseconds(cur_max)); + max_time = llmax(F32Microseconds(1.f), F32Microseconds(cur_max)); } max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f))); @@ -1179,7 +1179,7 @@ void LLFastTimerView::drawLineGraph() switch(mDisplayType) { case DISPLAY_TIME: - axis_label = llformat("%4.2f ms", LLUnit(max_time).value()); + axis_label = llformat("%4.2f ms", F32Milliseconds(max_time).value()); break; case DISPLAY_CALLS: axis_label = llformat("%d calls", (int)max_calls); @@ -1230,7 +1230,7 @@ void LLFastTimerView::drawLegend() llassert(idp->getIndex() < sTimerColors.size()); gl_rect_2d(bar_rect, sTimerColors[idp->getIndex()]); - LLUnit ms(0); + F32Milliseconds ms(0); S32 calls = 0; if (mHoverBarIndex > 0 && mHoverID) { @@ -1240,7 +1240,7 @@ void LLFastTimerView::drawLegend() } else { - ms = LLUnits::F64Seconds(mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH)); + ms = F64Seconds(mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH)); calls = (S32)mRecording.getPeriodMean(idp->callCount(), RUNNING_AVERAGE_WIDTH); } @@ -1346,7 +1346,7 @@ void LLFastTimerView::drawTicks() { // Draw MS ticks { - LLUnit ms = mTotalTimeDisplay; + U32Milliseconds ms = mTotalTimeDisplay; std::string tick_label; S32 x; S32 barw = mBarRect.getWidth(); @@ -1423,7 +1423,7 @@ void LLFastTimerView::updateTotalTime() mTotalTimeDisplay = mRecording.getPeriodMax(FTM_FRAME, 20); break; default: - mTotalTimeDisplay = LLUnits::F64Milliseconds(100); + mTotalTimeDisplay = F64Milliseconds(100); break; } @@ -1511,14 +1511,14 @@ void LLFastTimerView::drawBars() static LLFastTimer::DeclareTimer FTM_UPDATE_TIMER_BAR_WIDTHS("Update timer bar widths"); -LLUnits::F32Seconds LLFastTimerView::updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index) +F32Seconds LLFastTimerView::updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index) { LLFastTimer _(FTM_UPDATE_TIMER_BAR_WIDTHS); - const LLUnits::F32Seconds self_time = history_index == -1 + const F32Seconds self_time = history_index == -1 ? mRecording.getPeriodMean(time_block->selfTime(), RUNNING_AVERAGE_WIDTH) : mRecording.getPrevRecording(history_index).getSum(time_block->selfTime()); - LLUnits::F32Seconds full_time = self_time; + F32Seconds full_time = self_time; // reserve a spot for this bar to be rendered before its children // even though we don't know its size yet @@ -1544,7 +1544,7 @@ S32 LLFastTimerView::updateTimerBarOffsets(LLTrace::TimeBlock* time_block, Timer LLFastTimer _(FTM_UPDATE_TIMER_BAR_FRACTIONS); TimerBar& timer_bar = row.mBars[timer_bar_index]; - const LLUnits::F32Seconds bar_time = timer_bar.mTotalTime - timer_bar.mSelfTime; + const F32Seconds bar_time = timer_bar.mTotalTime - timer_bar.mSelfTime; timer_bar.mChildrenStart = timer_bar.mSelfStart + timer_bar.mSelfTime / 2; timer_bar.mChildrenEnd = timer_bar.mChildrenStart + timer_bar.mTotalTime - timer_bar.mSelfTime; diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 8f61a2fc87..d184aae03d 100755 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -87,7 +87,7 @@ private: mFirstChild(false), mLastChild(false) {} - LLUnits::F32Seconds mTotalTime, + F32Seconds mTotalTime, mSelfTime, mChildrenStart, mChildrenEnd, @@ -113,7 +113,7 @@ private: TimerBar* mBars; }; - LLUnits::F32Seconds updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index); + F32Seconds updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index); S32 updateTimerBarOffsets(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 timer_bar_index = 0); S32 drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, S32 image_height, bool hovered = false, bool visible = true, S32 bar_index = 0); void setPauseState(bool pause_state); @@ -128,7 +128,7 @@ private: DISPLAY_HZ } mDisplayType; bool mPauseHistory; - LLUnits::F64Seconds mAllTimeMax, + F64Seconds mAllTimeMax, mTotalTimeDisplay; S32 mScrollIndex, mHoverBarIndex, diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index d16c2d3984..ecee801e8e 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -525,7 +525,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name) PeriodicRecording& scene_load_recording = mSceneLoadRecording.getResults(); const U32 frame_count = scene_load_recording.getNumRecordedPeriods(); - LLUnits::F64Seconds frame_time; + F64Seconds frame_time; os << "Stat"; for (S32 frame = 1; frame <= frame_count; frame++) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3a3731d519..61def8f723 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1429,7 +1429,7 @@ bool idle_startup() LL_DEBUGS("AppInit") << "Initializing camera..." << LL_ENDL; gFrameTime = totalTime(); - LLUnits::F32Seconds last_time = gFrameTimeSeconds; + F32Seconds last_time = gFrameTimeSeconds; gFrameTimeSeconds = (gFrameTime - gStartTime); gFrameIntervalSeconds = gFrameTimeSeconds - last_time; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 0e6ef76845..07ff1de702 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -66,7 +66,7 @@ bool LLTextureFetchDebugger::sDebuggerEnabled = false; LLTrace::EventStatHandle > LLTextureFetch::sCacheHitRate("texture_cache_hits"); -LLTrace::EventStatHandle > LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); +LLTrace::EventStatHandle LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); ////////////////////////////////////////////////////////////////////////////// @@ -2393,7 +2393,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mFetcherLocked(FALSE) { mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); - mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), LLUnits::U32Bytes(gSavedSettings.getU32("TextureLoggingThreshold"))); + mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), U32Bytes(gSavedSettings.getU32("TextureLoggingThreshold"))); LLTextureFetchDebugger::sDebuggerEnabled = gSavedSettings.getBOOL("TextureFetchDebuggerEnabled"); if(LLTextureFetchDebugger::isEnabled()) @@ -2761,7 +2761,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, discard_level = worker->mDecodedDiscard; raw = worker->mRawImage; aux = worker->mAuxImage; - LLUnits::F32Seconds cache_read_time(worker->mCacheReadTime); + F32Seconds cache_read_time(worker->mCacheReadTime); if (cache_read_time != 0.f) { record(sCacheReadLatency, cache_read_time); @@ -3372,7 +3372,7 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1 if (log_to_viewer_log || log_to_sim) { - LLUnit timeNow = LLTimer::getTotalTime(); + U64Microseconds timeNow = LLTimer::getTotalTime(); mTextureInfo.setRequestSize(id, worker->mFileSize); mTextureInfo.setRequestCompleteTimeAndLog(id, timeNow); } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 38272b40dc..78b13cdd80 100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -107,10 +107,10 @@ public: bool receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data); // Threads: T* (but not safe) - void setTextureBandwidth(LLUnit bandwidth) { mTextureBandwidth = bandwidth; } + void setTextureBandwidth(F32Kibibits bandwidth) { mTextureBandwidth = bandwidth; } // Threads: T* (but not safe) - LLUnit getTextureBandwidth() { return mTextureBandwidth; } + F32Kibibits getTextureBandwidth() { return mTextureBandwidth; } // Threads: T* BOOL isFromLocalCache(const LLUUID& id); @@ -310,7 +310,7 @@ private: LLMutex mNetworkQueueMutex; //to protect mNetworkQueue, mHTTPTextureQueue and mCancelQueue. static LLTrace::EventStatHandle > sCacheHitRate; - static LLTrace::EventStatHandle > sCacheReadLatency; + static LLTrace::EventStatHandle sCacheReadLatency; LLTextureCache* mTextureCache; LLImageDecodeThread* mImageDecodeThread; @@ -325,12 +325,12 @@ private: queue_t mHTTPTextureQueue; // Mfnq typedef std::map > cancel_queue_t; cancel_queue_t mCancelQueue; // Mfnq - LLUnit mTextureBandwidth; // - LLUnit mMaxBandwidth; // Mfnq + F32Kibibits mTextureBandwidth; // + F32Kibibits mMaxBandwidth; // Mfnq LLTextureInfo mTextureInfo; // XXX possible delete - LLUnit mHTTPTextureBits; // Mfnq + U32Bits mHTTPTextureBits; // Mfnq // XXX possible delete //debug use diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp index 9dee92bf12..6906f82c1c 100755 --- a/indra/newview/lltextureinfo.cpp +++ b/indra/newview/lltextureinfo.cpp @@ -33,8 +33,8 @@ static LLTrace::CountStatHandle sTextureDownloadsStarted("texture_downloads_started", "number of texture downloads initiated"); static LLTrace::CountStatHandle sTextureDownloadsCompleted("texture_downloads_completed", "number of texture downloads completed"); -static LLTrace::CountStatHandle > sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded"); -static LLTrace::CountStatHandle > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures"); +static LLTrace::CountStatHandle sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded"); +static LLTrace::CountStatHandle sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures"); LLTextureInfo::LLTextureInfo() : mLogTextureDownloadsToViewerLog(false), @@ -46,11 +46,11 @@ LLTextureInfo::LLTextureInfo() : mRecording.start(); } -void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, LLUnit textureLogThreshold) +void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold) { mLogTextureDownloadsToViewerLog = writeToViewerLog; mLogTextureDownloadsToSimulator = sendToSim; - mTextureLogThreshold = LLUnit(textureLogThreshold); + mTextureLogThreshold = U32Bytes(textureLogThreshold); } LLTextureInfo::~LLTextureInfo() @@ -126,7 +126,7 @@ void LLTextureInfo::setRequestType(const LLUUID& id, LLTextureInfoDetails::LLReq mTextures[id]->mType = type; } -void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, LLUnit completeTime) +void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microseconds completeTime) { if (!has(id)) { @@ -160,7 +160,7 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, LLUnitgetTextureBandwidth(); + F32Kibibits max_bandwidth(gSavedSettings.getF32("ThrottleBandwidthKBPS")); color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color; color[VALPHA] = text_color[VALPHA]; text = llformat("BW:%.0f/%.0f",bandwidth.value(), max_bandwidth.value()); diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index b176c69691..e009863002 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -233,7 +233,7 @@ namespace LLViewerAssetStatsFF &sDequeuedAssetRequestsOther }; - static LLTrace::EventStatHandle sResponseAssetRequestsTempTextureHTTP ("assetresponsetimestemptexturehttp", + static LLTrace::EventStatHandle sResponseAssetRequestsTempTextureHTTP ("assetresponsetimestemptexturehttp", "Time spent responding to temporary texture asset http requests"), sResponseAssetRequestsTempTextureUDP ("assetresponsetimestemptextureudp", "Time spent responding to temporary texture asset udp requests"), @@ -250,7 +250,7 @@ namespace LLViewerAssetStatsFF sResponsedAssetRequestsOther ("assetresponsetimesother", "Time spent responding to other asset requests"); - static LLTrace::EventStatHandle* sResponse[EVACCount] = { + static LLTrace::EventStatHandle* sResponse[EVACCount] = { &sResponseAssetRequestsTempTextureHTTP, &sResponseAssetRequestsTempTextureUDP, &sResponseAssetRequestsNonTempTextureHTTP, @@ -487,10 +487,10 @@ void LLViewerAssetStats::getStats(AssetStats& stats, bool compact_output) grid_from_region_handle(it->first, &grid_x, &grid_y); r .grid_x(grid_x) .grid_y(grid_y) - .duration(LLUnit(rec.getDuration()).value()); + .duration(F64Microseconds(rec.getDuration()).value()); } - stats.duration(mCurRecording ? LLUnit(mCurRecording->getDuration()).value() : 0.0); + stats.duration(mCurRecording ? F64Microseconds(mCurRecording->getDuration()).value() : 0.0); } LLSD LLViewerAssetStats::asLLSD(bool compact_output) @@ -540,7 +540,7 @@ void record_response(LLViewerAssetType::EType at, bool with_http, bool is_temp, { const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp)); - record(*sResponse[int(eac)], LLUnit(duration)); + record(*sResponse[int(eac)], F64Microseconds(duration)); } void init() diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index a42060d4d8..aaa299bf4b 100755 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -82,7 +82,7 @@ public: * for compatibility with the pre-existing timestamp on the texture * fetcher class, LLTextureFetch. */ - typedef LLUnit duration_t; + typedef U64Microseconds duration_t; /** * Type for the region identifier used in stats. Currently uses diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f12df23a36..6c435bf147 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4487,18 +4487,18 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) // *TODO: Remove this dependency, or figure out a better way to handle // this hack. -extern LLUnit gObjectData; +extern U32Bits gObjectData; void process_object_update(LLMessageSystem *mesgsys, void **user_data) { // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit)mesgsys->getReceiveCompressedSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit)mesgsys->getReceiveSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveSize(); } // Update the object... @@ -4510,11 +4510,11 @@ void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit)mesgsys->getReceiveCompressedSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit)mesgsys->getReceiveSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveSize(); } // Update the object... @@ -4526,11 +4526,11 @@ void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data) // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit)mesgsys->getReceiveCompressedSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit)mesgsys->getReceiveSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveSize(); } // Update the object... @@ -4542,11 +4542,11 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_ { if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit)mesgsys->getReceiveCompressedSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit)mesgsys->getReceiveSize(); + gObjectData += (U32Bytes)mesgsys->getReceiveSize(); } gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_TERSE_IMPROVED); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index a8183e76b4..4643430c6b 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -995,13 +995,13 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) // update global timer F32 last_time = gFrameTimeSeconds; - LLUnit time = totalTime(); // this will become the new gFrameTime when the update is done + U64Microseconds time = totalTime(); // this will become the new gFrameTime when the update is done // Time _can_ go backwards, for example if the user changes the system clock. // It doesn't cause any fatal problems (just some oddness with stats), so we shouldn't assert here. // llassert(time > gFrameTime); - LLUnits::F64Seconds time_diff = time - gFrameTime; + F64Seconds time_diff = time - gFrameTime; gFrameTime = time; - LLUnits::F64Seconds time_since_start = gFrameTime - gStartTime; + F64Seconds time_since_start = gFrameTime - gStartTime; gFrameTimeSeconds = time_since_start; gFrameIntervalSeconds = gFrameTimeSeconds - last_time; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 568d4b42ca..67005e1978 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -95,7 +95,7 @@ LLTrace::CountStatHandle > LLTrace::EventStatHandle > TRIANGLES_DRAWN_PER_FRAME("trianglesdrawnperframestat"); -LLTrace::CountStatHandle > +LLTrace::CountStatHandle ACTIVE_MESSAGE_DATA_RECEIVED("activemessagedatareceived", "Message system data received on all active regions"), LAYERS_NETWORK_DATA_RECEIVED("layersdatareceived", "Network data received for layer data (terrain)"), OBJECT_NETWORK_DATA_RECEIVED("objectdatareceived", "Network data received for objects"), @@ -104,7 +104,7 @@ LLTrace::CountStatHandle > MESSAGE_SYSTEM_DATA_IN("messagedatain", "Incoming message system network data"), MESSAGE_SYSTEM_DATA_OUT("messagedataout", "Outgoing message system network data"); -LLTrace::CountStatHandle +LLTrace::CountStatHandle SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); @@ -152,15 +152,15 @@ LLTrace::SampleStatHandle > static LLTrace::SampleStatHandle CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); -LLTrace::SampleStatHandle > GL_TEX_MEM("gltexmemstat"), +LLTrace::SampleStatHandle GL_TEX_MEM("gltexmemstat"), GL_BOUND_MEM("glboundmemstat"), RAW_MEM("rawmemstat"), FORMATTED_MEM("formattedmemstat"); -LLTrace::SampleStatHandle > DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), +LLTrace::SampleStatHandle DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); -SimMeasurement > SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), +SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), @@ -175,10 +175,10 @@ SimMeasurement > SIM_FRAME_TIME("simframemsec SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -SimMeasurement > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES); -SimMeasurement > SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); +SimMeasurement SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES); +SimMeasurement SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); -LLTrace::SampleStatHandle > FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), +LLTrace::SampleStatHandle FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), SIM_PING("simpingstat"); @@ -186,7 +186,7 @@ LLTrace::EventStatHandle > AGENT_POSITION_SNAP("age LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"); -LLTrace::EventStatHandle > REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), +LLTrace::EventStatHandle REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), FRAME_STACKTIME("framestacktime", "FRAME_SECS"), UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), @@ -194,7 +194,7 @@ LLTrace::EventStatHandle > REGION_CROSSING_TI REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); -LLTrace::EventStatHandle AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), +LLTrace::EventStatHandle AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), FPS_10_TIME("fps10time", "Seconds below 10 FPS"), @@ -219,7 +219,7 @@ void LLViewerStats::resetStats() LLViewerStats::instance().mRecording.reset(); } -void LLViewerStats::updateFrameStats(const LLUnits::F64Seconds time_diff) +void LLViewerStats::updateFrameStats(const F64Seconds time_diff) { if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) { @@ -258,15 +258,15 @@ void LLViewerStats::updateFrameStats(const LLUnits::F64Seconds time_diff) add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); // old stats that were never really used - sample(LLStatViewer::FRAMETIME_JITTER, LLUnit (mLastTimeDiff - time_diff)); + sample(LLStatViewer::FRAMETIME_JITTER, F64Milliseconds (mLastTimeDiff - time_diff)); F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; - sample(LLStatViewer::FRAMETIME_SLEW, LLUnit (average_frametime - time_diff)); + sample(LLStatViewer::FRAMETIME_SLEW, F64Milliseconds (average_frametime - time_diff)); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; - sample(LLStatViewer::DELTA_BANDWIDTH, LLUnit(delta_bandwidth)); - sample(LLStatViewer::MAX_BANDWIDTH, LLUnit(max_bandwidth)); + sample(LLStatViewer::DELTA_BANDWIDTH, F64Bits(delta_bandwidth)); + sample(LLStatViewer::MAX_BANDWIDTH, F64Bits(max_bandwidth)); } mLastTimeDiff = time_diff; @@ -299,13 +299,13 @@ F32 gAveLandCompression = 0.f, gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; -LLUnits::U32Bytes gTotalWorldData, +U32Bytes gTotalWorldData, gTotalObjectData, gTotalTextureData; U32 gSimPingCount = 0; -LLUnits::U32Bits gObjectData; +U32Bits gObjectData; F32 gAvgSimPing = 0.f; -LLUnits::U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {LLUnits::U32Bytes(0)}; +U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)}; extern U32 gVisCompared; extern U32 gVisTested; @@ -345,8 +345,8 @@ void update_statistics() typedef LLInstanceTracker, std::string> trace_type_t; - LLUnits::F64Seconds idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); - LLUnits::F64Seconds network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); + F64Seconds idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); + F64Seconds network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame"))); record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); @@ -358,13 +358,13 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - sample(LLStatViewer::SIM_PING, LLUnit (cdp->getPingDelay())); + sample(LLStatViewer::SIM_PING, F64Milliseconds (cdp->getPingDelay())); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - sample(LLStatViewer::SIM_PING, LLUnits::U32Seconds(10)); + sample(LLStatViewer::SIM_PING, U32Seconds(10)); } if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS)) @@ -374,10 +374,10 @@ void update_statistics() add(LLStatViewer::FPS, 1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, LLUnit(layer_bits)); + add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, F64Bits(layer_bits)); add(LLStatViewer::OBJECT_NETWORK_DATA_RECEIVED, gObjectData); sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending()); - add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, LLUnit(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); + add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, F64Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -553,9 +553,9 @@ void send_stats() LLSD &download = body["downloads"]; - download["world_kbytes"] = LLUnit(gTotalWorldData).value(); - download["object_kbytes"] = LLUnit(gTotalObjectData).value(); - download["texture_kbytes"] = LLUnit(gTotalTextureData).value(); + download["world_kbytes"] = F64Kibibytes(gTotalWorldData).value(); + download["object_kbytes"] = F64Kibibytes(gTotalObjectData).value(); + download["texture_kbytes"] = F64Kibibytes(gTotalTextureData).value(); download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 2cea575252..42c56e8835 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -142,7 +142,7 @@ extern LLTrace::CountStatHandle<> FPS, extern LLTrace::CountStatHandle > TRIANGLES_DRAWN; -extern LLTrace::CountStatHandle > ACTIVE_MESSAGE_DATA_RECEIVED, +extern LLTrace::CountStatHandle ACTIVE_MESSAGE_DATA_RECEIVED, LAYERS_NETWORK_DATA_RECEIVED, OBJECT_NETWORK_DATA_RECEIVED, ASSET_UDP_DATA_RECEIVED, @@ -150,7 +150,7 @@ extern LLTrace::CountStatHandle > ACTIVE_MESSAGE MESSAGE_SYSTEM_DATA_IN, MESSAGE_SYSTEM_DATA_OUT; -extern LLTrace::CountStatHandle SIM_20_FPS_TIME, +extern LLTrace::CountStatHandle SIM_20_FPS_TIME, SIM_PHYSICS_20_FPS_TIME, LOSS_5_PERCENT_TIME; @@ -192,13 +192,13 @@ extern LLTrace::SampleStatHandle<> FPS_SAMPLE, extern LLTrace::SampleStatHandle > PACKETS_LOST_PERCENT; -extern LLTrace::SampleStatHandle > GL_TEX_MEM, +extern LLTrace::SampleStatHandle GL_TEX_MEM, GL_BOUND_MEM, RAW_MEM, FORMATTED_MEM; -extern LLTrace::SampleStatHandle > DELTA_BANDWIDTH, +extern LLTrace::SampleStatHandle DELTA_BANDWIDTH, MAX_BANDWIDTH; -extern SimMeasurement > SIM_FRAME_TIME, +extern SimMeasurement SIM_FRAME_TIME, SIM_NET_TIME, SIM_OTHER_TIME, SIM_PHYSICS_TIME, @@ -213,11 +213,11 @@ extern SimMeasurement > SIM_FRAME_TIME, SIM_SLEEP_TIME, SIM_PUMP_IO_TIME; -extern SimMeasurement > SIM_UNACKED_BYTES; -extern SimMeasurement > SIM_PHYSICS_MEM; +extern SimMeasurement SIM_UNACKED_BYTES; +extern SimMeasurement SIM_PHYSICS_MEM; -extern LLTrace::SampleStatHandle > FRAMETIME_JITTER, +extern LLTrace::SampleStatHandle FRAMETIME_JITTER, FRAMETIME_SLEW, SIM_PING; @@ -225,7 +225,7 @@ extern LLTrace::EventStatHandle > AGENT_POSITION_SN extern LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY; -extern LLTrace::EventStatHandle > REGION_CROSSING_TIME, +extern LLTrace::EventStatHandle REGION_CROSSING_TIME, FRAME_STACKTIME, UPDATE_STACKTIME, NETWORK_STACKTIME, @@ -233,7 +233,7 @@ extern LLTrace::EventStatHandle > REGION_CROS REBUILD_STACKTIME, RENDER_STACKTIME; -extern LLTrace::EventStatHandle AVATAR_EDIT_TIME, +extern LLTrace::EventStatHandle AVATAR_EDIT_TIME, TOOLBOX_TIME, MOUSELOOK_TIME, FPS_10_TIME, @@ -254,7 +254,7 @@ public: LLViewerStats(); ~LLViewerStats(); - void updateFrameStats(const LLUnits::F64Seconds time_diff); + void updateFrameStats(const F64Seconds time_diff); void addToMessage(LLSD &body); @@ -370,7 +370,7 @@ public: private: LLTrace::Recording mRecording; - LLUnits::F64Seconds mLastTimeDiff; // used for time stat updates + F64Seconds mLastTimeDiff; // used for time stat updates }; static const F32 SEND_STATS_PERIOD = 300.0f; @@ -380,7 +380,7 @@ void update_statistics(); void send_stats(); extern LLFrameTimer gTextureTimer; -extern LLUnit gTotalTextureData; -extern LLUnit gTotalObjectData; -extern LLUnit gTotalTextureBytesPerBoostLevel[] ; +extern U32Bytes gTotalTextureData; +extern U32Bytes gTotalObjectData; +extern U32Bytes gTotalTextureBytesPerBoostLevel[] ; #endif // LL_LLVIEWERSTATS_H diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index c780814e50..4290d338c1 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -63,8 +63,8 @@ /////////////////////////////////////////////////////////////////////////////// // extern -const LLUnit gMinVideoRam(32); -const LLUnit gMaxVideoRam(512); +const S32Mibibytes gMinVideoRam(32); +const S32Mibibytes gMaxVideoRam(512); // statics @@ -86,11 +86,11 @@ S32 LLViewerTexture::sAuxCount = 0; LLFrameTimer LLViewerTexture::sEvaluationTimer; F32 LLViewerTexture::sDesiredDiscardBias = 0.f; F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; -LLUnit LLViewerTexture::sBoundTextureMemory; -LLUnit LLViewerTexture::sTotalTextureMemory; -LLUnit LLViewerTexture::sMaxBoundTextureMem; -LLUnit LLViewerTexture::sMaxTotalTextureMem; -LLUnit LLViewerTexture::sMaxDesiredTextureMem; +S32Bytes LLViewerTexture::sBoundTextureMemory; +S32Bytes LLViewerTexture::sTotalTextureMemory; +S32Mibibytes LLViewerTexture::sMaxBoundTextureMem; +S32Mibibytes LLViewerTexture::sMaxTotalTextureMem; +S32Bytes LLViewerTexture::sMaxDesiredTextureMem; S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ; F32 LLViewerTexture::sCameraMovingBias = 0.0f ; S32 LLViewerTexture::sMaxSculptRez = 128 ; //max sculpt image size @@ -540,7 +540,7 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sTotalTextureMemory >= sMaxTotalTextureMem) { //when texture memory overflows, lower down the threshold to release the textures more aggressively. - sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, LLUnit(gMaxVideoRam)); + sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, S32Bytes(gMaxVideoRam)); // If we are using more texture memory than we should, // scale up the desired discard level diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b0eae7c071..9a00ccd8c6 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -38,8 +38,8 @@ #include #include -extern const LLUnit gMinVideoRam; -extern const LLUnit gMaxVideoRam; +extern const S32Mibibytes gMinVideoRam; +extern const S32Mibibytes gMaxVideoRam; class LLImageGL ; class LLImageRaw; @@ -205,11 +205,11 @@ public: static LLFrameTimer sEvaluationTimer; static F32 sDesiredDiscardBias; static F32 sDesiredDiscardScale; - static LLUnit sBoundTextureMemory; - static LLUnit sTotalTextureMemory; - static LLUnit sMaxBoundTextureMem; - static LLUnit sMaxTotalTextureMem; - static LLUnit sMaxDesiredTextureMem ; + static S32Bytes sBoundTextureMemory; + static S32Bytes sTotalTextureMemory; + static S32Mibibytes sMaxBoundTextureMem; + static S32Mibibytes sMaxTotalTextureMem; + static S32Bytes sMaxDesiredTextureMem ; static S8 sCameraMovingDiscardBias; static F32 sCameraMovingBias; static S32 sMaxSculptRez ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 2030b490e4..888174a6cf 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -670,8 +670,8 @@ void LLViewerTextureList::updateImages(F32 max_time) sample(NUM_RAW_IMAGES, LLImageRaw::sRawImageCount); sample(GL_TEX_MEM, LLImageGL::sGlobalTextureMemory); sample(GL_BOUND_MEM, LLImageGL::sBoundTextureMemory); - sample(RAW_MEM, LLUnit(LLImageRaw::sGlobalRawMemory)); - sample(FORMATTED_MEM, LLUnit(LLImageFormatted::sGlobalFormattedMemory)); + sample(RAW_MEM, F64Bytes(LLImageRaw::sGlobalRawMemory)); + sample(FORMATTED_MEM, F64Bytes(LLImageFormatted::sGlobalFormattedMemory)); } { @@ -1373,7 +1373,7 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d { received_size = msg->getReceiveSize() ; } - add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, LLUnit(received_size)); + add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, F64Bytes(received_size)); add(LLStatViewer::TEXTURE_PACKETS, 1); U8 codec; @@ -1447,7 +1447,7 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d received_size = msg->getReceiveSize() ; } - add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, LLUnit(received_size)); + add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, F64Bytes(received_size)); add(LLStatViewer::TEXTURE_PACKETS, 1); //llprintline("Start decode, image header..."); diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 673b55be69..53bda6e6ab 100755 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -101,8 +101,8 @@ public: void setUpdateStats(BOOL b) { mUpdateStats = b; } - LLUnit getMaxResidentTexMem() const { return mMaxResidentTexMemInMegaBytes; } - LLUnit getMaxTotalTextureMem() const { return mMaxTotalTextureMemInMegaBytes;} + S32Mibibytes getMaxResidentTexMem() const { return mMaxResidentTexMemInMegaBytes; } + S32Mibibytes getMaxTotalTextureMem() const { return mMaxTotalTextureMemInMegaBytes;} S32 getNumImages() { return mImageList.size(); } void updateMaxResidentTexMem(S32 mem); @@ -200,8 +200,8 @@ private: BOOL mInitialized ; BOOL mUpdateStats; - LLUnit mMaxResidentTexMemInMegaBytes; - LLUnit mMaxTotalTextureMemInMegaBytes; + S32Mibibytes mMaxResidentTexMemInMegaBytes; + S32Mibibytes mMaxTotalTextureMemInMegaBytes; LLFrameTimer mForceDecodeTimer; private: diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 12d58b7521..1e60b59932 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -738,7 +738,7 @@ public: { if(gTotalTextureBytesPerBoostLevel[i] > 0) { - addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit(gTotalTextureBytesPerBoostLevel[i]).value())); + addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, F32Mibibytes(gTotalTextureBytesPerBoostLevel[i]).value())); ypos += y_inc; } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 66206fe53e..db6d2d6fe9 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -899,7 +899,7 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) if (mLastRegionHandle != 0) { ++mRegionCrossingCount; - LLUnits::F64Seconds delta(mRegionCrossingTimer.getElapsedTimeF32()); + F64Seconds delta(mRegionCrossingTimer.getElapsedTimeF32()); record(LLStatViewer::REGION_CROSSING_TIME, delta); // Diagnostics diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 31b7e5a01c..93351d21f5 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6547,7 +6547,7 @@ void LLVivoxVoiceClient::expireVoiceFonts() // Give a warning notification if any voice fonts are due to expire. if (will_expire) { - LLUnit seconds(gSavedSettings.getS32("VoiceEffectExpiryWarningTime")); + S32Seconds seconds(gSavedSettings.getS32("VoiceEffectExpiryWarningTime")); args["INTERVAL"] = llformat("%d", LLUnit(seconds).value()); LLNotificationsUtil::add("VoiceEffectsWillExpire", args); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 38818e242b..9d727dafbe 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -717,7 +717,7 @@ void LLWorld::renderPropertyLines() void LLWorld::updateNetStats() { - LLUnits::F64Bits bits; + F64Bits bits; U32 packets = 0; for (region_list_t::iterator iter = mActiveRegionList.begin(); @@ -735,8 +735,8 @@ void LLWorld::updateNetStats() S32 packets_out = gMessageSystem->mPacketsOut - mLastPacketsOut; S32 packets_lost = gMessageSystem->mDroppedPackets - mLastPacketsLost; - LLUnit actual_in_bits(gMessageSystem->mPacketRing.getAndResetActualInBits()); - LLUnit actual_out_bits(gMessageSystem->mPacketRing.getAndResetActualOutBits()); + F64Bits actual_in_bits(gMessageSystem->mPacketRing.getAndResetActualInBits()); + F64Bits actual_out_bits(gMessageSystem->mPacketRing.getAndResetActualOutBits()); add(LLStatViewer::MESSAGE_SYSTEM_DATA_IN, actual_in_bits); add(LLStatViewer::MESSAGE_SYSTEM_DATA_OUT, actual_out_bits); -- cgit v1.2.3