summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-07-19 15:03:05 -0700
committerRichard Linden <none@none>2013-07-19 15:03:05 -0700
commite40065f82c797eab41006a448c838f4f1089a2e8 (patch)
tree7abaeeae98304308bc3812531f682de3cda4bb72
parenteb8d552df76540e7b0b533f0c10c5faa541299a4 (diff)
BUILDFIX: #include and dependency cleanup
-rwxr-xr-xindra/llcommon/llcommonutils.h2
-rwxr-xr-xindra/llcommon/llcriticaldamp.cpp2
-rwxr-xr-xindra/llcommon/llcriticaldamp.h4
-rwxr-xr-xindra/llcommon/lldate.cpp2
-rwxr-xr-xindra/llcommon/lldate.h2
-rwxr-xr-xindra/llcommon/llfasttimer.cpp22
-rwxr-xr-xindra/llcommon/llinitparam.h1
-rwxr-xr-xindra/llcommon/llsdutil.h2
-rwxr-xr-xindra/llcommon/llstring.cpp1
-rwxr-xr-xindra/llcommon/llstring.h6
-rwxr-xr-xindra/llcommon/llsys.cpp6
-rw-r--r--indra/llcommon/lltraceaccumulators.h1
-rw-r--r--indra/llcommon/lltracerecording.cpp38
-rw-r--r--indra/llcommon/llunit.h110
-rwxr-xr-xindra/llcommon/lluuid.h1
-rwxr-xr-xindra/llimage/llimagej2c.cpp1
-rwxr-xr-xindra/llmath/llcalcparser.h5
-rw-r--r--indra/llprimitive/llmaterialid.h1
-rw-r--r--indra/llrender/llimagegl.cpp8
-rwxr-xr-xindra/llui/llnotificationsutil.h1
-rwxr-xr-xindra/llui/lltrans.h1
-rwxr-xr-xindra/llxml/llxmlnode.h3
-rw-r--r--indra/newview/llscenemonitor.cpp14
-rw-r--r--indra/newview/llscenemonitor.h36
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<F32, LLUnits::Seconds> time_constant, bool use_cache)
+F32 LLSmoothInterpolation::getInterpolant(LLUnitImplicit<F32, LLUnits::Seconds> 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<F32, LLUnits::Seconds> time_constant, bool use_cache = true);
+ static F32 getInterpolant(LLUnitImplicit<F32, LLUnits::Seconds> time_constant, bool use_cache = true);
template<typename T>
- static T lerp(T a, T b, LLUnit<F32, LLUnits::Seconds> time_constant, bool use_cache = true)
+ static T lerp(T a, T b, LLUnitImplicit<F32, LLUnits::Seconds> 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<F64, LLUnits::Seconds> seconds_since_epoch) :
+LLDate::LLDate(LLUnitImplicit<F64, LLUnits::Seconds> 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<F64, LLUnits::Seconds> seconds_since_epoch);
+ LLDate(LLUnitImplicit<F64, LLUnits::Seconds> 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<F64, LLUnits::Seconds> 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 <string>
#include <cstdio>
-#include <locale>
+//#include <locale>
#include <iomanip>
#include <algorithm>
-#include "llsd.h"
+#include <vector>
+#include <map>
#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 <limits>
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<F64, LLUnits::Seconds> Recording::getSum(const TraceType<TimeBlockAccumulator>& 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<F64, LLUnits::Seconds> Recording::getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& 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<F64, LLUnits::Seconds> Recording::getPerSec(const TraceType<TimeBlockAccu
{
const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[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<F64, LLUnits::Seconds> Recording::getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& 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<TimeBlockAccumulator::CallCountFacet>& stat)
@@ -170,52 +170,52 @@ F32 Recording::getPerSec(const TraceType<TimeBlockAccumulator::CallCountFacet>&
LLUnit<F64, LLUnits::Bytes> Recording::getMin(const TraceType<MemStatAccumulator>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mSize.getMin();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMin());
}
LLUnit<F64, LLUnits::Bytes> Recording::getMean(const TraceType<MemStatAccumulator>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mSize.getMean();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMean());
}
LLUnit<F64, LLUnits::Bytes> Recording::getMax(const TraceType<MemStatAccumulator>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mSize.getMax();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMax());
}
LLUnit<F64, LLUnits::Bytes> Recording::getStandardDeviation(const TraceType<MemStatAccumulator>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation());
}
LLUnit<F64, LLUnits::Bytes> Recording::getLastValue(const TraceType<MemStatAccumulator>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue());
}
LLUnit<F64, LLUnits::Bytes> Recording::getMin(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin());
}
LLUnit<F64, LLUnits::Bytes> Recording::getMean(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean());
}
LLUnit<F64, LLUnits::Bytes> Recording::getMax(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax());
}
LLUnit<F64, LLUnits::Bytes> Recording::getStandardDeviation(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation());
}
LLUnit<F64, LLUnits::Bytes> Recording::getLastValue(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue();
+ return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue());
}
U32 Recording::getSum(const TraceType<MemStatAccumulator::AllocationCountFacet>& stat)
@@ -603,7 +603,7 @@ F64 PeriodicRecording::getPeriodMean( const TraceType<SampleAccumulator>& stat,
size_t total_periods = mRecordingPeriods.size();
num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods);
- LLUnit<F64, LLUnits::Seconds> total_duration = 0.f;
+ LLUnit<F64, LLUnits::Seconds> 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<typename STORAGE_TYPE, typename UNIT_TYPE>
std::ostream& operator <<(std::ostream& s, const LLUnit<STORAGE_TYPE, UNIT_TYPE>& unit)
{
- s << unit.value() << UNIT_TYPE::getUnitLabel();
- return s;
+ s << unit.value() << UNIT_TYPE::getUnitLabel();
+ return s;
+}
+
+template<typename STORAGE_TYPE, typename UNIT_TYPE>
+std::istream& operator >>(std::istream& s, LLUnit<STORAGE_TYPE, UNIT_TYPE>& unit)
+{
+ STORAGE_TYPE val;
+ s >> val;
+ unit = val;
+ return s;
}
template<typename STORAGE_TYPE, typename UNIT_TYPE>
@@ -172,8 +181,17 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNIT_TYPE>
template<typename STORAGE_TYPE, typename UNIT_TYPE>
std::ostream& operator <<(std::ostream& s, const LLUnitImplicit<STORAGE_TYPE, UNIT_TYPE>& unit)
{
- s << unit.value() << UNIT_TYPE::getUnitLabel();
- return s;
+ s << unit.value() << UNIT_TYPE::getUnitLabel();
+ return s;
+}
+
+template<typename STORAGE_TYPE, typename UNIT_TYPE>
+std::istream& operator >>(std::istream& s, LLUnitImplicit<STORAGE_TYPE, UNIT_TYPE>& unit)
+{
+ STORAGE_TYPE val;
+ s >> val;
+ unit = val;
+ return s;
}
template<typename S, typename T>
@@ -201,7 +219,7 @@ LL_FORCE_INLINE void ll_convert_units(LLUnit<S1, T1> in, LLUnit<S2, T2>& out, ..
{
// T1 and T2 fully reduced and equal...just copy
- out = (S2)in.value();
+ out = LLUnit<S2, T2>((S2)in.value());
}
else
{
@@ -447,33 +465,33 @@ template<typename VALUE_TYPE>
struct LLUnitLinearOps
{
typedef LLUnitLinearOps<VALUE_TYPE> 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<typename T>
self_t operator * (T other)
{
- return mValue * other;
+ return mResult * other;
}
template<typename T>
self_t operator / (T other)
{
- return mValue / other;
+ return mResult / other;
}
template<typename T>
self_t operator + (T other)
{
- return mValue + other;
+ return mResult + other;
}
template<typename T>
self_t operator - (T other)
{
- return mValue - other;
+ return mResult - other;
}
};
@@ -482,32 +500,32 @@ struct LLUnitInverseLinearOps
{
typedef LLUnitInverseLinearOps<VALUE_TYPE> 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<typename T>
self_t operator * (T other)
{
- return mValue / other;
+ return mResult / other;
}
template<typename T>
self_t operator / (T other)
{
- return mValue * other;
+ return mResult * other;
}
template<typename T>
self_t operator + (T other)
{
- return mValue - other;
+ return mResult - other;
}
template<typename T>
self_t operator - (T other)
{
- return mValue + other;
+ return mResult + other;
}
};
@@ -521,35 +539,31 @@ struct base_unit_name
template<typename STORAGE_T, typename UNIT_T> \
static LLUnit<STORAGE_T, base_unit_name> fromValue(LLUnit<STORAGE_T, UNIT_T> value) \
{ return LLUnit<STORAGE_T, base_unit_name>(value); } \
-}; \
-template<typename T> std::ostream& operator<<(std::ostream& s, const LLUnit<T, base_unit_name>& 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<typename T> \
- static LLUnit<T, unit_name> fromValue(T value) { return LLUnit<T, unit_name>(value); } \
- template<typename STORAGE_T, typename UNIT_T> \
- static LLUnit<STORAGE_T, unit_name> fromValue(LLUnit<STORAGE_T, UNIT_T> value) \
- { return LLUnit<STORAGE_T, unit_name>(value); } \
-}; \
-template<typename T> std::ostream& operator<<(std::ostream& s, const LLUnit<T, unit_name>& val) \
-{ s << val.value() << unit_name::getUnitLabel; return s; } \
- \
-template<typename S1, typename S2> \
-void ll_convert_units(LLUnit<S1, unit_name> in, LLUnit<S2, base_unit_name>& out) \
-{ \
- out = (S2)(LLUnitLinearOps<S1>(in.value()) conversion_operation).mValue; \
-} \
- \
-template<typename S1, typename S2> \
-void ll_convert_units(LLUnit<S1, base_unit_name> in, LLUnit<S2, unit_name>& out) \
-{ \
- out = (S2)(LLUnitInverseLinearOps<S1>(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<typename T> \
+ static LLUnit<T, unit_name> fromValue(T value) { return LLUnit<T, unit_name>(value); } \
+ template<typename STORAGE_T, typename UNIT_T> \
+ static LLUnit<STORAGE_T, unit_name> fromValue(LLUnit<STORAGE_T, UNIT_T> value) \
+ { return LLUnit<STORAGE_T, unit_name>(value); } \
+}; \
+ \
+template<typename S1, typename S2> \
+void ll_convert_units(LLUnit<S1, unit_name> in, LLUnit<S2, base_unit_name>& out) \
+{ \
+ out = LLUnit<S2, base_unit_name>((S2)(LLUnitLinearOps<S1>(in.value()) conversion_operation)); \
+} \
+ \
+template<typename S1, typename S2> \
+void ll_convert_units(LLUnit<S1, base_unit_name> in, LLUnit<S2, unit_name>& out) \
+{ \
+ out = LLUnit<S2, unit_name>((S2)(LLUnitInverseLinearOps<S1>(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 <iostream>
#include <set>
+#include <vector>
#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 <string>
+#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<S32, LLUnits::Bytes> LLImageGL::sGlobalTextureMemory = 0;
-LLUnit<S32, LLUnits::Bytes> LLImageGL::sBoundTextureMemory = 0;
-LLUnit<S32, LLUnits::Bytes> LLImageGL::sCurBoundTextureMemory = 0;
+LLUnit<S32, LLUnits::Bytes> LLImageGL::sGlobalTextureMemory(0);
+LLUnit<S32, LLUnits::Bytes> LLImageGL::sBoundTextureMemory(0);
+LLUnit<S32, LLUnits::Bytes> 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 <boost/function.hpp>
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 <map>
+#include <set>
#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<bool> monitor_enabled(gSavedSettings, "SceneLoadingMonitorEnabled");
static LLCachedControl<F32> 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<F32> 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<F32> 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<LLViewerTexture> mDitheringTexture;
+ S32 mDitherMatrixWidth;
+ F32 mDitherScale,
+ mDitherScaleS,
+ mDitherScaleT;
- LLPointer<LLViewerTexture> mDitheringTexture;
- S32 mDitherMatrixWidth;
- F32 mDitherScale;
- F32 mDitherScaleS;
- F32 mDitherScaleT;
+ std::vector<LLAnimPauseRequest> mAvatarPauseHandles;
- std::vector<LLAnimPauseRequest> mAvatarPauseHandles;
-
- LLTrace::ExtendablePeriodicRecording mSceneLoadRecording;
- LLTrace::Recording mMonitorRecording;
+ LLFrameTimer mRecordingTimer;
+ LLTrace::ExtendablePeriodicRecording mSceneLoadRecording;
+ LLTrace::Recording mMonitorRecording;
};
class LLSceneMonitorView : public LLFloater