summaryrefslogtreecommitdiff
path: root/indra/newview/lltextureinfo.cpp
diff options
context:
space:
mode:
authorruslantproductengine <ruslantproductengine@lindenlab.com>2015-08-28 19:20:55 +0300
committerruslantproductengine <ruslantproductengine@lindenlab.com>2015-08-28 19:20:55 +0300
commitb7ce1a52ee246a4c38c909cd7e8128e259b253f7 (patch)
tree46e67dbda2b4cb48db6813bfea6d2dbffc4fc79a /indra/newview/lltextureinfo.cpp
parent0735380c60bb789aa8c1073699df8e473b083534 (diff)
MAINT-4483 (Mesh uploader allows Low LODs to have more triangles than High LODs)
The fix in fllowing: LLTextureFetch has object LLTextureInfo which is has Recorder object. The recorder object activate (Recorder::handleStart()) self AccumulatorBufferGroup (Recorder::mBuffers into the current (LLTrace::get_thread_recorder()) ThreadRecorder object which created (as I understand) one per thread, and time to time send accumulated data to the master ThreadRecorder. The problem is that LLTextureFetch also can uses from the main thread. I decide add parameter to CTOR LLTextureInfo(bool postponeStartRecoreder) - if it false the recorder start immediatly in LLTextureInfo CTOR body, if true we need to start it manually. Also I add another one LLTextureInfo in LLTextureFetch::mTextureInfoMainThread which is intended for accumulate data from the main thread. The postponed Recorder started/stoped from LLTextureFetch::startThread()/endThread(). --HG-- branch : MAINT-4360
Diffstat (limited to 'indra/newview/lltextureinfo.cpp')
-rwxr-xr-xindra/newview/lltextureinfo.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp
index 59d692b287..fbe308595c 100755
--- a/indra/newview/lltextureinfo.cpp
+++ b/indra/newview/lltextureinfo.cpp
@@ -36,14 +36,14 @@ static LLTrace::CountStatHandle<S32> sTextureDownloadsCompleted("texture_downloa
static LLTrace::CountStatHandle<S32Bytes > sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded");
static LLTrace::CountStatHandle<U32Milliseconds > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures");
-LLTextureInfo::LLTextureInfo() :
+LLTextureInfo::LLTextureInfo(bool postponeStartRecoreder) :
mLogTextureDownloadsToViewerLog(false),
mLogTextureDownloadsToSimulator(false),
mTextureDownloadProtocol("NONE"),
mTextureLogThreshold(LLUnits::Kilobytes::fromValue(100))
{
- mTextures.clear();
- mRecording.start();
+ if (!postponeStartRecoreder)
+ mRecording.start();
}
void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold)
@@ -78,15 +78,7 @@ U32 LLTextureInfo::getTextureInfoMapSize()
bool LLTextureInfo::has(const LLUUID& id)
{
- std::map<LLUUID, LLTextureInfoDetails *>::iterator iterator = mTextures.find(id);
- if (iterator == mTextures.end())
- {
- return false;
- }
- else
- {
- return true;
- }
+ return mTextures.end() != mTextures.find(id);
}
void LLTextureInfo::setRequestStartTime(const LLUUID& id, U64 startTime)
@@ -192,15 +184,13 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microsecon
LLSD LLTextureInfo::getAverages()
{
LLSD averagedTextureData;
- S32 averageDownloadRate;
+ S32 averageDownloadRate = 0;
U32Milliseconds download_time = mRecording.getSum(sTexureDownloadTime);
- if(download_time == (U32Milliseconds)0)
- {
- averageDownloadRate = 0;
- }
- else
+ if(download_time != (U32Milliseconds)0)
{
- averageDownloadRate = mRecording.getSum(sTextureDataDownloaded).valueInUnits<LLUnits::Bits>() / download_time.valueInUnits<LLUnits::Seconds>();
+ if (0 != download_time.valueInUnits<LLUnits::Seconds>()) {
+ averageDownloadRate = mRecording.getSum(sTextureDataDownloaded).valueInUnits<LLUnits::Bits>() / download_time.valueInUnits<LLUnits::Seconds>();
+ }
}
averagedTextureData["bits_per_second"] = averageDownloadRate;
@@ -212,6 +202,16 @@ LLSD LLTextureInfo::getAverages()
return averagedTextureData;
}
+void LLTextureInfo::startRecording()
+{
+ mRecording.start();
+}
+
+void LLTextureInfo::stopRecording()
+{
+ mRecording.stop();
+}
+
void LLTextureInfo::resetTextureStatistics()
{
mRecording.restart();