From f4ff1430f0d6ae7dd5a6be0bd665678b30a63aca Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 3 Dec 2010 22:16:16 -0700 Subject: first iteration of memory pool code --- indra/newview/app_settings/settings.xml | 22 ++++ indra/newview/llappviewer.cpp | 128 ++++++++++++++++----- indra/newview/llappviewer.h | 10 +- indra/newview/lldynamictexture.cpp | 6 +- indra/newview/llfloatermemleak.cpp | 5 + indra/newview/llviewerdisplay.cpp | 7 +- indra/newview/llviewertexture.cpp | 12 +- indra/newview/llviewertexture.h | 2 +- indra/newview/llviewerwindow.cpp | 13 +++ indra/newview/pipeline.cpp | 22 +++- indra/newview/pipeline.h | 5 +- .../newview/skins/default/xui/en/notifications.xml | 16 ++- 12 files changed, 206 insertions(+), 42 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 535bc95287..905c683f69 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5153,6 +5153,17 @@ Value 48.0 + MaxHeapSize + + Comment + Maximum heap size (GB) + Persist + 1 + Type + F32 + Value + 1.6 + MaxSelectDistance Comment @@ -5329,6 +5340,17 @@ Value 1 + MemeoyFailurePreventionEnabled + + Comment + If set, the viewer will quit to avoid crash when memory failure happens + Persist + 0 + Type + Boolean + Value + 1 + MemoryLogFrequency Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3a98749c0f..84e36ac3c7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -604,7 +604,7 @@ LLAppViewer::~LLAppViewer() } bool LLAppViewer::init() -{ +{ // // Start of the application // @@ -632,6 +632,9 @@ bool LLAppViewer::init() if (!initConfiguration()) return false; + //set the max heap size. + initMaxHeapSize() ; + // write Google Breakpad minidump files to our log directory std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); logdir += gDirUtilp->getDirDelimiter(); @@ -949,6 +952,96 @@ bool LLAppViewer::init() return true; } +void LLAppViewer::initMaxHeapSize() +{ + //set the max heap size. + //here is some info regarding to the max heap size: + //------------------------------------------------------------------------------------------ + // OS | setting | SL address bits | max manageable memory space | max heap size + // Win 32 | default | 32-bit | 2GB | < 1.7GB + // Win 32 | /3G | 32-bit | 3GB | < 1.7GB or 2.7GB + //Linux 32 | default | 32-bit | 3GB | < 2.7GB + //Linux 32 |HUGEMEM | 32-bit | 4GB | < 3.7GB + //64-bit OS |default | 32-bit | 4GB | < 3.7GB + //64-bit OS |default | 64-bit | N/A (> 4GB) | N/A (> 4GB) + //------------------------------------------------------------------------------------------ + //currently SL is built under 32-bit setting, we set its max heap size no more than 1.6 GB. + + //F32 max_heap_size_gb = llmin(1.6f, (F32)gSavedSettings.getF32("MaxHeapSize")) ; + F32 max_heap_size_gb = gSavedSettings.getF32("MaxHeapSize") ; + BOOL enable_mem_failure_prevention = (BOOL)gSavedSettings.getBOOL("MemeoyFailurePreventionEnabled") ; + + LLMemory::initMaxHeapSizeGB(max_heap_size_gb, enable_mem_failure_prevention) ; +} + +void LLAppViewer::checkMemory() +{ + const static F32 MEMORY_CHECK_INTERVAL = 1.0f ; //second + const static F32 MAX_QUIT_WAIT_TIME = 30.0f ; //seconds + const static U32 MAX_SIZE_CHECKED_MEMORY_BLOCK = 64 * 1024 * 1024 ; //64 MB + //static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ; + static void* last_reserved_address = NULL ; + + if(MEMORY_CHECK_INTERVAL > mMemCheckTimer.getElapsedTimeF32()) + { + return ; + } + mMemCheckTimer.reset() ; + + if(gGLManager.mDebugGPU) + { + //update the availability of memory + LLMemory::updateMemoryInfo() ; + } + + //check the virtual address space fragmentation + if(!last_reserved_address) + { + last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ; + } + else + { + last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ; + if(!last_reserved_address) //failed, try once more + { + last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ; + } + } + + S32 is_low = !last_reserved_address || LLMemory::isMemoryPoolLow() ; + + //if(is_low < 0) //to force quit + //{ + // if(force_quit_timer > MAX_QUIT_WAIT_TIME) //just hit the limit for the first time + // { + // //send out the notification to tell the viewer is about to quit in 30 seconds. + // LLNotification::Params params("ForceQuitDueToLowMemory"); + // LLNotifications::instance().add(params); + + // force_quit_timer = MAX_QUIT_WAIT_TIME - MEMORY_CHECK_INTERVAL ; + // } + // else + // { + // force_quit_timer -= MEMORY_CHECK_INTERVAL ; + // if(force_quit_timer < 0.f) + // { + // forceQuit() ; //quit + // } + // } + //} + //else + //{ + // force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ; + //} + + LLPipeline::throttleNewMemoryAllocation(!is_low ? FALSE : TRUE) ; + + if(is_low) + { + LLMemory::logMemoryInfo() ; + } +} + static LLFastTimer::DeclareTimer FTM_MESSAGES("System Messages"); static LLFastTimer::DeclareTimer FTM_SLEEP("Sleep"); static LLFastTimer::DeclareTimer FTM_TEXTURE_CACHE("Texture Cache"); @@ -983,8 +1076,7 @@ bool LLAppViewer::mainLoop() LLVoiceChannel::initClass(); LLVoiceClient::getInstance()->init(gServicePump); LLTimer frameTimer,idleTimer; - LLTimer debugTime; - LLFrameTimer memCheckTimer; + LLTimer debugTime; LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); joystick->setNeedsReset(true); @@ -993,9 +1085,7 @@ bool LLAppViewer::mainLoop() // with each frame, no need to instantiate a new LLSD event object each // time. Obviously, if that changes, just instantiate the LLSD at the // point of posting. - LLSD newFrame; - - const F32 memory_check_interval = 1.0f ; //second + LLSD newFrame; // Handle messages while (!LLApp::isExiting()) @@ -1006,18 +1096,8 @@ bool LLAppViewer::mainLoop() llclearcallstacks; //check memory availability information - { - if(memory_check_interval < memCheckTimer.getElapsedTimeF32()) - { - memCheckTimer.reset() ; - - //update the availability of memory - LLMemoryInfo::getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; - } - llcallstacks << "Available physical mem(KB): " << mAvailPhysicalMemInKB << llcallstacksendl ; - llcallstacks << "Available virtual mem(KB): " << mAvailVirtualMemInKB << llcallstacksendl ; - } - + checkMemory() ; + try { pingMainloopTimeout("Main:MiscNativeWindowEvents"); @@ -1181,7 +1261,7 @@ bool LLAppViewer::mainLoop() idleTimer.reset(); bool is_slow = (frameTimer.getElapsedTimeF64() > FRAME_SLOW_THRESHOLD) ; S32 total_work_pending = 0; - S32 total_io_pending = 0; + S32 total_io_pending = 0; while(!is_slow)//do not unpause threads if the frame rates are very low. { S32 work_pending = 0; @@ -1248,15 +1328,7 @@ bool LLAppViewer::mainLoop() } catch(std::bad_alloc) { - { - llinfos << "Availabe physical memory(KB) at the beginning of the frame: " << mAvailPhysicalMemInKB << llendl ; - llinfos << "Availabe virtual memory(KB) at the beginning of the frame: " << mAvailVirtualMemInKB << llendl ; - - LLMemoryInfo::getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; - - llinfos << "Current availabe physical memory(KB): " << mAvailPhysicalMemInKB << llendl ; - llinfos << "Current availabe virtual memory(KB): " << mAvailVirtualMemInKB << llendl ; - } + LLMemory::logMemoryInfo(TRUE) ; //stop memory leaking simulation LLFloaterMemLeak* mem_leak_instance = diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index a70a727c5d..7761a10f1c 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -166,8 +166,8 @@ public: // mute/unmute the system's master audio virtual void setMasterSystemAudioMute(bool mute); - virtual bool getMasterSystemAudioMute(); - + virtual bool getMasterSystemAudioMute(); + protected: virtual bool initWindow(); // Initialize the viewer's window. virtual bool initLogging(); // Initialize log files, logging system, return false on failure. @@ -184,11 +184,12 @@ protected: private: + void initMaxHeapSize(); bool initThreads(); // Initialize viewer threads, return false on failure. bool initConfiguration(); // Initialize settings from the command line/config file. bool initCache(); // Initialize local client cache. - + void checkMemory() ; // We have switched locations of both Mac and Windows cache, make sure // files migrate and old cache is cleared out. @@ -258,8 +259,7 @@ private: std::set mPlugins; - U32 mAvailPhysicalMemInKB ; - U32 mAvailVirtualMemInKB ; + LLFrameTimer mMemCheckTimer; public: //some information for updater typedef struct diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index a3d2941114..58eef45935 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -40,6 +40,7 @@ #include "llvertexbuffer.h" #include "llviewerdisplay.h" #include "llrender.h" +#include "pipeline.h" // static LLViewerDynamicTexture::instance_list_t LLViewerDynamicTexture::sInstances[ LLViewerDynamicTexture::ORDER_COUNT ]; @@ -205,7 +206,7 @@ void LLViewerDynamicTexture::postRender(BOOL success) BOOL LLViewerDynamicTexture::updateAllInstances() { sNumRenders = 0; - if (gGLManager.mIsDisabled) + if (gGLManager.mIsDisabled || LLPipeline::sMemAllocationThrottled) { return TRUE; } @@ -221,9 +222,8 @@ BOOL LLViewerDynamicTexture::updateAllInstances() if (dynamicTexture->needsRender()) { if(gGLManager.mDebugGPU) - { + { llinfos << "class type: " << (S32)dynamicTexture->getType() << llendl; - LLGLState::dumpStates() ; } glClear(GL_DEPTH_BUFFER_BIT); diff --git a/indra/newview/llfloatermemleak.cpp b/indra/newview/llfloatermemleak.cpp index 58931d112e..9edfe1e354 100644 --- a/indra/newview/llfloatermemleak.cpp +++ b/indra/newview/llfloatermemleak.cpp @@ -90,6 +90,11 @@ LLFloaterMemLeak::~LLFloaterMemLeak() void LLFloaterMemLeak::release() { + if(mLeakedMem.empty()) + { + return ; + } + for(S32 i = 0 ; i < (S32)mLeakedMem.size() ; i++) { delete[] mLeakedMem[i] ; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 7c8b52d0b6..e7153f7ffc 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -202,6 +202,7 @@ void display_stats() gMemoryAllocated = LLMemory::getCurrentRSS(); U32 memory = (U32)(gMemoryAllocated / (1024*1024)); llinfos << llformat("MEMORY: %d MB", memory) << llendl; + LLMemory::logMemoryInfo() ; gRecentMemoryTime.reset(); } } @@ -672,7 +673,11 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) glh::matrix4f mod = glh_get_current_modelview(); glViewport(0,0,512,512); LLVOAvatar::updateFreezeCounter() ; - LLVOAvatar::updateImpostors(); + + if(!LLPipeline::sMemAllocationThrottled) + { + LLVOAvatar::updateImpostors(); + } glh_set_current_projection(proj); glh_set_current_modelview(mod); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index f96b93da4d..260023a802 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -3068,9 +3068,16 @@ void LLViewerLODTexture::processTextureStats() { mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel) ; } + else if(LLPipeline::sMemAllocationThrottled)//release memory of large textures by decrease their resolutions. + { + if(scaleDown()) + { + mDesiredDiscardLevel = mCachedRawDiscardLevel ; + } + } } -void LLViewerLODTexture::scaleDown() +bool LLViewerLODTexture::scaleDown() { if(hasGLTexture() && mCachedRawDiscardLevel > getDiscardLevel()) { @@ -3080,7 +3087,10 @@ void LLViewerLODTexture::scaleDown() { LLViewerTextureManager::sTesterp->setStablizingTime() ; } + + return true ; } + return false ; } //---------------------------------------------------------------------------------------------- //end of LLViewerLODTexture diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b779396293..ffcbba3efd 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -595,7 +595,7 @@ public: private: void init(bool firstinit) ; - void scaleDown() ; + bool scaleDown() ; private: F32 mDiscardVirtualSize; // Virtual size used to calculate desired discard diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 64698ed006..943b5b5886 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3874,6 +3874,19 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei { return FALSE; } + //check if there is enough memory for the snapshot image + if(LLPipeline::sMemAllocationThrottled) + { + return FALSE ; //snapshot taking is disabled due to memory restriction. + } + if(image_width * image_height > (1 << 22)) //if snapshot image is larger than 2K by 2K + { + if(!LLMemory::tryToAlloc(NULL, image_width * image_height * 3)) + { + llwarns << "No enough memory to take the snapshot with size (w : h): " << image_width << " : " << image_height << llendl ; + return FALSE ; //there is no enough memory for taking this snapshot. + } + } // PRE SNAPSHOT gDisplaySwapBuffers = FALSE; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b4a5777f10..7c69af17f2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -98,6 +98,7 @@ #include "llspatialpartition.h" #include "llmutelist.h" #include "lltoolpie.h" +#include "llnotifications.h" #ifdef _DEBUG @@ -281,6 +282,7 @@ BOOL LLPipeline::sRenderAttachedLights = TRUE; BOOL LLPipeline::sRenderAttachedParticles = TRUE; BOOL LLPipeline::sRenderDeferred = FALSE; BOOL LLPipeline::sAllowRebuildPriorityGroup = FALSE ; +BOOL LLPipeline::sMemAllocationThrottled = FALSE; S32 LLPipeline::sVisibleLightCount = 0; F32 LLPipeline::sMinRenderSize = 0.f; @@ -513,6 +515,24 @@ void LLPipeline::destroyGL() static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); +//static +void LLPipeline::throttleNewMemoryAllocation(BOOL disable) +{ + if(sMemAllocationThrottled != disable) + { + sMemAllocationThrottled = disable ; + + if(sMemAllocationThrottled) + { + //send out notification + LLNotification::Params params("LowMemory"); + LLNotifications::instance().add(params); + + //release some memory. + } + } +} + void LLPipeline::resizeScreenTexture() { LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE); @@ -8792,7 +8812,7 @@ void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL textu void LLPipeline::generateImpostor(LLVOAvatar* avatar) { - LLMemType mt_gi(LLMemType::MTYPE_PIPELINE_GENERATE_IMPOSTOR); + LLMemType mt_gi(LLMemType::MTYPE_PIPELINE_GENERATE_IMPOSTOR); LLGLState::checkStates(); LLGLState::checkTextureChannels(); LLGLState::checkClientArrays(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b80765dac6..f4a7dfd38d 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -334,6 +334,8 @@ public: static void updateRenderDeferred(); + static void throttleNewMemoryAllocation(BOOL disable); + private: void unloadShaders(); void addToQuickLookup( LLDrawPool* new_poolp ); @@ -477,8 +479,9 @@ public: static BOOL sRenderAttachedParticles; static BOOL sRenderDeferred; static BOOL sAllowRebuildPriorityGroup; + static BOOL sMemAllocationThrottled; static S32 sVisibleLightCount; - static F32 sMinRenderSize; + static F32 sMinRenderSize; //screen texture U32 mScreenWidth; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index dfbb408d96..5183788c98 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6450,6 +6450,20 @@ Mute everyone? Here's your current balance of L$. Click Buy L$ to purchase more Linden Dollars. + + Your memory pool is low. Some functions of SL are disabled to avoid crash. Please close other applications. Restart SL if this persists. + + + + SL will quit in 30 seconds due to out of memory. + + - + \ No newline at end of file -- cgit v1.2.3 From 43f4429363e63484f35663c10ca993d0d812e855 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 8 Dec 2010 20:50:39 -0700 Subject: test code and some code change --- indra/newview/llappviewer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 84e36ac3c7..fd7e1eda7f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1087,6 +1087,10 @@ bool LLAppViewer::mainLoop() // point of posting. LLSD newFrame; + LLPrivateMemoryPoolTester::getInstance()->run(false) ; + LLPrivateMemoryPoolTester::getInstance()->run(true) ; + LLPrivateMemoryPoolTester::destroy() ; + // Handle messages while (!LLApp::isExiting()) { -- cgit v1.2.3 From f4a8027feb2bbeafe7b0cfb3b05fd27f3cf243d3 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 6 Jan 2011 12:36:44 -0700 Subject: removed some debug code, redesigned the hash function, fixed bugs --- indra/newview/llappviewer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index fd7e1eda7f..d1727a0e83 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1087,9 +1087,9 @@ bool LLAppViewer::mainLoop() // point of posting. LLSD newFrame; - LLPrivateMemoryPoolTester::getInstance()->run(false) ; - LLPrivateMemoryPoolTester::getInstance()->run(true) ; - LLPrivateMemoryPoolTester::destroy() ; + //LLPrivateMemoryPoolTester::getInstance()->run(false) ; + //LLPrivateMemoryPoolTester::getInstance()->run(true) ; + //LLPrivateMemoryPoolTester::destroy() ; // Handle messages while (!LLApp::isExiting()) -- cgit v1.2.3 From 4de6759cd9d566ab92f0d9efa0c0338359dfa85c Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 6 Jan 2011 16:18:26 -0700 Subject: add debug info to the UI. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llviewerwindow.cpp | 11 +++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 10 ++++++++++ 3 files changed, 32 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 905c683f69..ca48f8b16a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1829,6 +1829,17 @@ Value 0 + DebugShowPrivateMem + + Comment + Show Private Mem Info + Persist + 1 + Type + Boolean + Value + 0 + DebugShowRenderInfo Comment diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 943b5b5886..f1d0cf2128 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -548,6 +548,17 @@ public: addText(xpos, ypos, llformat("%d %d %d %d", color[0], color[1], color[2], color[3])); ypos += y_inc; } + + if (gSavedSettings.getBOOL("DebugShowPrivateMem")) + { + LLPrivateMemoryPoolManager::getInstance()->updateStatistics() ; + addText(xpos, ypos, llformat("Total Reserved(KB): %d", LLPrivateMemoryPoolManager::getInstance()->mTotalReservedSize / 1024)); + ypos += y_inc; + + addText(xpos, ypos, llformat("Total Allocated(KB): %d", LLPrivateMemoryPoolManager::getInstance()->mTotalAllocatedSize / 1024)); + ypos += y_inc; + } + // only display these messages if we are actually rendering beacons at this moment if (LLPipeline::getRenderBeacons(NULL) && LLFloaterReg::instanceVisible("beacons")) { diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 9a08be2405..1371411656 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1937,6 +1937,16 @@ function="ToggleControl" parameter="DebugShowColor" /> + + + + -- cgit v1.2.3 From 611d8bdf6155f6c7b440ab745f197d278a74b209 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 6 Jan 2011 16:20:21 -0700 Subject: use the private pool in the texture pipeline --- indra/newview/llappviewer.cpp | 3 +++ indra/newview/lltexturecache.cpp | 30 +++++++++++++++--------------- indra/newview/lltexturefetch.cpp | 14 +++++++------- 3 files changed, 25 insertions(+), 22 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d1727a0e83..664ec7b0fb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1797,6 +1797,9 @@ bool LLAppViewer::cleanup() llinfos << "File launched." << llendflush; } + //release all private memory pools. + LLPrivateMemoryPoolManager::destroyClass() ; + ll_close_fail_log(); llinfos << "Goodbye!" << llendflush; diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 6a213309a0..d64345deee 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -113,7 +113,7 @@ public: ~LLTextureCacheWorker() { llassert_always(!haveWork()); - delete[] mReadData; + LLImageBase::deleteMemory(mReadData); } // override this interface @@ -215,7 +215,7 @@ bool LLTextureCacheLocalFileWorker::doRead() mDataSize = 0; return true; } - mReadData = new U8[mDataSize]; + mReadData = (U8*)LLImageBase::allocateMemory(mDataSize); mBytesRead = -1; mBytesToRead = mDataSize; setPriority(LLWorkerThread::PRIORITY_LOW | mPriority); @@ -233,7 +233,7 @@ bool LLTextureCacheLocalFileWorker::doRead() // << " Bytes: " << mDataSize << " Offset: " << mOffset // << " / " << mDataSize << llendl; mDataSize = 0; // failed - delete[] mReadData; + LLImageBase::deleteMemory(mReadData); mReadData = NULL; } return true; @@ -248,7 +248,7 @@ bool LLTextureCacheLocalFileWorker::doRead() { mDataSize = local_size; } - mReadData = new U8[mDataSize]; + mReadData = (U8*)LLImageBase::allocateMemory(mDataSize); S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); @@ -258,7 +258,7 @@ bool LLTextureCacheLocalFileWorker::doRead() // << " Bytes: " << mDataSize << " Offset: " << mOffset // << " / " << mDataSize << llendl; mDataSize = 0; - delete[] mReadData; + LLImageBase::deleteMemory(mReadData); mReadData = NULL; } else @@ -371,7 +371,7 @@ bool LLTextureCacheRemoteWorker::doRead() mDataSize = local_size; } // Allocate read buffer - mReadData = new U8[mDataSize]; + mReadData = (U8*)LLImageBase::allocateMemory(mDataSize); S32 bytes_read = LLAPRFile::readEx(local_filename, mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); if (bytes_read != mDataSize) @@ -380,7 +380,7 @@ bool LLTextureCacheRemoteWorker::doRead() << " Bytes: " << mDataSize << " Offset: " << mOffset << " / " << mDataSize << llendl; mDataSize = 0; - delete[] mReadData; + LLImageBase::deleteMemory(mReadData); mReadData = NULL; } else @@ -423,7 +423,7 @@ bool LLTextureCacheRemoteWorker::doRead() S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset; size = llmin(size, mDataSize); // Allocate the read buffer - mReadData = new U8[size]; + mReadData = (U8*)LLImageBase::allocateMemory(size); S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, mReadData, offset, size, mCache->getLocalAPRFilePool()); if (bytes_read != size) @@ -431,7 +431,7 @@ bool LLTextureCacheRemoteWorker::doRead() llwarns << "LLTextureCacheWorker: " << mID << " incorrect number of bytes read from header: " << bytes_read << " / " << size << llendl; - delete[] mReadData; + LLImageBase::deleteMemory(mReadData); mReadData = NULL; mDataSize = -1; // failed done = true; @@ -461,7 +461,7 @@ bool LLTextureCacheRemoteWorker::doRead() S32 data_offset, file_size, file_offset; // Reserve the whole data buffer first - U8* data = new U8[mDataSize]; + U8* data = (U8*)LLImageBase::allocateMemory(mDataSize); // Set the data file pointers taking the read offset into account. 2 cases: if (mOffset < TEXTURE_CACHE_ENTRY_SIZE) @@ -474,7 +474,7 @@ bool LLTextureCacheRemoteWorker::doRead() // Copy the raw data we've been holding from the header cache into the new sized buffer llassert_always(mReadData); memcpy(data, mReadData, data_offset); - delete[] mReadData; + LLImageBase::deleteMemory(mReadData); mReadData = NULL; } else @@ -500,7 +500,7 @@ bool LLTextureCacheRemoteWorker::doRead() llwarns << "LLTextureCacheWorker: " << mID << " incorrect number of bytes read from body: " << bytes_read << " / " << file_size << llendl; - delete[] mReadData; + LLImageBase::deleteMemory(mReadData); mReadData = NULL; mDataSize = -1; // failed done = true; @@ -592,11 +592,11 @@ bool LLTextureCacheRemoteWorker::doWrite() { // We need to write a full record in the header cache so, if the amount of data is smaller // than a record, we need to transfer the data to a buffer padded with 0 and write that - U8* padBuffer = new U8[TEXTURE_CACHE_ENTRY_SIZE]; + U8* padBuffer = (U8*)LLImageBase::allocateMemory(TEXTURE_CACHE_ENTRY_SIZE); memset(padBuffer, 0, TEXTURE_CACHE_ENTRY_SIZE); // Init with zeros memcpy(padBuffer, mWriteData, mDataSize); // Copy the write buffer bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, padBuffer, offset, size, mCache->getLocalAPRFilePool()); - delete [] padBuffer; + LLImageBase::deleteMemory(padBuffer); } else { @@ -692,7 +692,7 @@ void LLTextureCacheWorker::finishWork(S32 param, bool completed) } else { - delete[] mReadData; + LLImageBase::deleteMemory(mReadData); mReadData = NULL; } } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index d6d38de225..510afc6b9b 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -572,7 +572,7 @@ void LLTextureFetchWorker::setImagePriority(F32 priority) void LLTextureFetchWorker::resetFormattedData() { - delete[] mBuffer; + LLImageBase::deleteMemory(mBuffer); mBuffer = NULL; mBufferSize = 0; if (mFormattedImage.notNull()) @@ -642,7 +642,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mSentRequest = UNSENT; mDecoded = FALSE; mWritten = FALSE; - delete[] mBuffer; + LLImageBase::deleteMemory(mBuffer); mBuffer = NULL; mBufferSize = 0; mHaveAllData = FALSE; @@ -997,7 +997,7 @@ bool LLTextureFetchWorker::doWork(S32 param) llassert_always(mBufferSize == cur_size + mRequestedSize); if(!mBufferSize)//no data received. { - delete[] mBuffer; + LLImageBase::deleteMemory(mBuffer); mBuffer = NULL; //abort. @@ -1025,7 +1025,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mFileSize = mBufferSize + 1 ; //flag the file is not fully loaded. } - U8* buffer = new U8[mBufferSize]; + U8* buffer = (U8*)LLImageBase::allocateMemory(mBufferSize); if (cur_size > 0) { memcpy(buffer, mFormattedImage->getData(), cur_size); @@ -1034,7 +1034,7 @@ bool LLTextureFetchWorker::doWork(S32 param) // NOTE: setData releases current data and owns new data (buffer) mFormattedImage->setData(buffer, mBufferSize); // delete temp data - delete[] mBuffer; // Note: not 'buffer' (assigned in setData()) + LLImageBase::deleteMemory(mBuffer); // Note: not 'buffer' (assigned in setData()) mBuffer = NULL; mBufferSize = 0; mLoadedDiscard = mRequestedDiscard; @@ -1331,7 +1331,7 @@ bool LLTextureFetchWorker::processSimulatorPackets() if (buffer_size > cur_size) { /// We have new data - U8* buffer = new U8[buffer_size]; + U8* buffer = (U8*)LLImageBase::allocateMemory(buffer_size); S32 offset = 0; if (cur_size > 0 && mFirstPacket > 0) { @@ -1383,7 +1383,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, if (data_size > 0) { // *TODO: set the formatted image data here directly to avoid the copy - mBuffer = new U8[data_size]; + mBuffer = (U8*)LLImageBase::allocateMemory(data_size); buffer->readAfter(channels.in(), NULL, mBuffer, data_size); mBufferSize += data_size; if (data_size < mRequestedSize && mRequestedDiscard == 0) -- cgit v1.2.3 From bcb5b209d1813681202524362dd186c8b0982357 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 12 Jan 2011 07:51:14 -0800 Subject: trivial: fix some mac compiling errors --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 664ec7b0fb..c3122504cc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -977,7 +977,7 @@ void LLAppViewer::initMaxHeapSize() void LLAppViewer::checkMemory() { const static F32 MEMORY_CHECK_INTERVAL = 1.0f ; //second - const static F32 MAX_QUIT_WAIT_TIME = 30.0f ; //seconds + //const static F32 MAX_QUIT_WAIT_TIME = 30.0f ; //seconds const static U32 MAX_SIZE_CHECKED_MEMORY_BLOCK = 64 * 1024 * 1024 ; //64 MB //static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ; static void* last_reserved_address = NULL ; -- cgit v1.2.3 From 01d219ed4c140fbc54069cdcb6d1b671f91e9923 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 1 Feb 2011 17:26:23 -0500 Subject: removing particle disabling from performance testing so that I can test performance of particles --- indra/newview/llviewercontrol.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 444d5cb902..bc34c369da 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -141,7 +141,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) LLPipeline::RENDER_TYPE_WATER, LLPipeline::RENDER_TYPE_PASS_GRASS, LLPipeline::RENDER_TYPE_HUD, - LLPipeline::RENDER_TYPE_PARTICLES, LLPipeline::RENDER_TYPE_CLOUDS, LLPipeline::RENDER_TYPE_HUD_PARTICLES, LLPipeline::END_RENDER_TYPES); @@ -157,7 +156,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) LLPipeline::RENDER_TYPE_WATER, LLPipeline::RENDER_TYPE_PASS_GRASS, LLPipeline::RENDER_TYPE_HUD, - LLPipeline::RENDER_TYPE_PARTICLES, LLPipeline::RENDER_TYPE_CLOUDS, LLPipeline::RENDER_TYPE_HUD_PARTICLES, LLPipeline::END_RENDER_TYPES); -- cgit v1.2.3 From ef490e308ccce8e6df85144784a0f4580f5ac6a1 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 5 Feb 2011 15:58:07 +0100 Subject: Introduces a LLThreadLocalData class that can be accessed through the static LLThread::tldata(). Currently this object contains two (public) thread-local objects: a LLAPRRootPool and a LLVolatileAPRPool. The first is the general memory pool used by this thread (and this thread alone), while the second is intended for short lived memory allocations (needed for APR). The advantages of not mixing those two is that the latter is used most frequently, and as a result of it's nature can be destroyed and reconstructed on a "regular" basis. This patch adds LLAPRPool (completely replacing the old one), which is a wrapper around apr_pool_t* and has complete thread-safity checking. Whenever an apr call requires memory for some resource, a memory pool in the form of an LLAPRPool object can be created with the same life-time as this resource; assuring clean up of the memory no sooner, but also not much later than the life-time of the resource that needs the memory. Many, many function calls and constructors had the pool parameter simply removed (it is no longer the concern of the developer, if you don't write code that actually does an libapr call then you are no longer bothered with memory pools at all). However, I kept the notion of short-lived and long-lived allocations alive (see my remark in the jira here: https://jira.secondlife.com/browse/STORM-864?focusedCommentId=235356&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-235356 which requires that the LLAPRFile API needs to allow the user to specify how long they think a file will stay open. By choosing 'short_lived' as default for the constructor that immediately opens a file, the number of instances where this needs to be specified is drastically reduced however (obviously, any automatic LLAPRFile is short lived). *** Addressed Boroondas remarks in https://codereview.secondlife.com/r/99/ regarding (doxygen) comments. This patch effectively only changes comments. Includes some 'merge' stuff that ended up in llvocache.cpp (while starting as a bug fix, now only resulting in a cleanup). *** Added comment 'The use of apr_pool_t is OK here'. Added this comment on every line where apr_pool_t is correctly being used. This should make it easier to spot (future) errors where someone started to use apr_pool_t; you can just grep all sources for 'apr_pool_t' and immediately see where it's being used while LLAPRPool should have been used. Note that merging this patch is very easy: If there are no other uses of apr_pool_t in the code (one grep) and it compiles, then it will work. *** Second Merge (needed to remove 'delete mCreationMutex' from LLImageDecodeThread::~LLImageDecodeThread). *** Added back #include . Apparently that is needed on libapr version 1.2.8., the version used by Linden Lab, for calls to apr_queue_*. This is a bug in libapr (we also include , that is fixed in (at least) 1.3.7. Note that 1.2.8 is VERY old. Even 1.3.x is old. *** License fixes (GPL -> LGPL). And typo in comments. Addresses merov's comments on the review board. *** Added Merov's compile fixes for windows. --- indra/newview/llappviewer.cpp | 47 +++++++++++----------- indra/newview/llappviewer.h | 2 +- indra/newview/llappviewerlinux.cpp | 1 + indra/newview/llappviewerlinux_api_dbus.cpp | 14 +++---- indra/newview/llappviewermacosx.cpp | 1 + indra/newview/llfloateranimpreview.cpp | 3 +- indra/newview/llmainlooprepeater.cpp | 2 +- indra/newview/lltexturecache.cpp | 61 +++++++++++++---------------- indra/newview/lltexturecache.h | 3 -- indra/newview/lltexturefetch.cpp | 3 -- indra/newview/llviewermenufile.cpp | 3 +- indra/newview/llvoavatar.cpp | 3 +- indra/newview/llvocache.cpp | 54 ++++++++++++------------- indra/newview/llvocache.h | 5 +-- indra/newview/llvoicevivox.cpp | 2 +- indra/newview/llwatchdog.cpp | 4 +- indra/newview/tests/llworldmap_test.cpp | 1 - 17 files changed, 93 insertions(+), 116 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a23f809b71..1f76e2af40 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1026,7 +1026,7 @@ bool LLAppViewer::mainLoop() //------------------------------------------- // Create IO Pump to use for HTTP Requests. - gServicePump = new LLPumpIO(gAPRPoolp); + gServicePump = new LLPumpIO; LLHTTPClient::setPump(*gServicePump); LLCurl::setCAFile(gDirUtilp->getCAFile()); @@ -1387,16 +1387,16 @@ bool LLAppViewer::cleanup() } // *TODO - generalize this and move DSO wrangling to a helper class -brad - std::set::const_iterator i; - for(i = mPlugins.begin(); i != mPlugins.end(); ++i) + for(std::map >::iterator plugin = mPlugins.begin(); + plugin != mPlugins.end(); ++plugin) { int (*ll_plugin_stop_func)(void) = NULL; - apr_status_t rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_stop_func, *i, "ll_plugin_stop"); + apr_status_t rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_stop_func, plugin->first, "ll_plugin_stop"); ll_plugin_stop_func(); - rv = apr_dso_unload(*i); + rv = apr_dso_unload(plugin->first); } - mPlugins.clear(); + mPlugins.clear(); // Forget handles and destroy all memory pools. //flag all elements as needing to be destroyed immediately // to ensure shutdown order @@ -1828,7 +1828,7 @@ bool LLAppViewer::initThreads() if (LLFastTimer::sLog || LLFastTimer::sMetricLog) { - LLFastTimer::sLogLock = new LLMutex(NULL); + LLFastTimer::sLogLock = new LLMutex; mFastTimerLogThread = new LLFastTimerLogThread(LLFastTimer::sLogName); mFastTimerLogThread->start(); } @@ -2969,8 +2969,7 @@ void LLAppViewer::handleViewerCrash() else crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,ERROR_MARKER_FILE_NAME); llinfos << "Creating crash marker file " << crash_file_name << llendl; - LLAPRFile crash_file ; - crash_file.open(crash_file_name, LL_APR_W); + LLAPRFile crash_file(crash_file_name, LL_APR_W); if (crash_file.getFileHandle()) { LL_INFOS("MarkerFile") << "Created crash marker file " << crash_file_name << LL_ENDL; @@ -3034,11 +3033,10 @@ bool LLAppViewer::anotherInstanceRunning() LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL; //Freeze case checks - if (LLAPRFile::isExist(marker_file, NULL, LL_APR_RB)) + if (LLAPRFile::isExist(marker_file, LL_APR_RB)) { // File exists, try opening with write permissions - LLAPRFile outfile ; - outfile.open(marker_file, LL_APR_WB); + LLAPRFile outfile(marker_file, LL_APR_WB); apr_file_t* fMarker = outfile.getFileHandle() ; if (!fMarker) { @@ -3077,25 +3075,25 @@ void LLAppViewer::initMarkerFile() std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME); std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB) && !anotherInstanceRunning()) + if (LLAPRFile::isExist(mMarkerFileName, LL_APR_RB) && !anotherInstanceRunning()) { gLastExecEvent = LAST_EXEC_FROZE; LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; } - if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB)) + if(LLAPRFile::isExist(logout_marker_file, LL_APR_RB)) { gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; LLAPRFile::remove(logout_marker_file); } - if(LLAPRFile::isExist(llerror_marker_file, NULL, LL_APR_RB)) + if(LLAPRFile::isExist(llerror_marker_file, LL_APR_RB)) { if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; else gLastExecEvent = LAST_EXEC_LLERROR_CRASH; LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; LLAPRFile::remove(llerror_marker_file); } - if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) + if(LLAPRFile::isExist(error_marker_file, LL_APR_RB)) { if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; else gLastExecEvent = LAST_EXEC_OTHER_CRASH; @@ -3111,7 +3109,7 @@ void LLAppViewer::initMarkerFile() // Create the marker file for this execution & lock it apr_status_t s; - s = mMarkerFile.open(mMarkerFileName, LL_APR_W, TRUE); + s = mMarkerFile.open(mMarkerFileName, LL_APR_W, LLAPRFile::long_lived); if (s == APR_SUCCESS && mMarkerFile.getFileHandle()) { @@ -4327,8 +4325,7 @@ void LLAppViewer::sendLogoutRequest() gLogoutInProgress = TRUE; mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME); - LLAPRFile outfile ; - outfile.open(mLogoutMarkerFileName, LL_APR_W); + LLAPRFile outfile(mLogoutMarkerFileName, LL_APR_W); mLogoutMarkerFile = outfile.getFileHandle() ; if (mLogoutMarkerFile) { @@ -4778,14 +4775,15 @@ void LLAppViewer::loadEventHostModule(S32 listen_port) } #endif // LL_WINDOWS - apr_dso_handle_t * eventhost_dso_handle = NULL; - apr_pool_t * eventhost_dso_memory_pool = NULL; + boost::shared_ptr eventhost_dso_memory_pool_ptr(new LLAPRPool); + LLAPRPool& eventhost_dso_memory_pool(*eventhost_dso_memory_pool_ptr); + apr_dso_handle_t* eventhost_dso_handle = NULL; //attempt to load the shared library - apr_pool_create(&eventhost_dso_memory_pool, NULL); + eventhost_dso_memory_pool.create(); apr_status_t rv = apr_dso_load(&eventhost_dso_handle, dso_path.c_str(), - eventhost_dso_memory_pool); + eventhost_dso_memory_pool()); llassert_always(! ll_apr_warn_status(rv, eventhost_dso_handle)); llassert_always(eventhost_dso_handle != NULL); @@ -4805,7 +4803,8 @@ void LLAppViewer::loadEventHostModule(S32 listen_port) llerrs << "problem loading eventhost plugin, status: " << status << llendl; } - mPlugins.insert(eventhost_dso_handle); + // Store the handle and link it to the pool that was used to allocate it. + mPlugins[eventhost_dso_handle] = eventhost_dso_memory_pool_ptr; } void LLAppViewer::launchUpdater() diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index a18e6cbb02..00b12d50ae 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -266,7 +266,7 @@ private: LLAllocator mAlloc; - std::set mPlugins; + std::map > mPlugins; U32 mAvailPhysicalMemInKB ; U32 mAvailVirtualMemInKB ; diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index 898cc1c0ba..d4c6131c80 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -110,6 +110,7 @@ int main( int argc, char **argv ) } delete viewer_app_ptr; viewer_app_ptr = NULL; + return 0; } diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp index 32e7e0a83d..1ae469dfcf 100644 --- a/indra/newview/llappviewerlinux_api_dbus.cpp +++ b/indra/newview/llappviewerlinux_api_dbus.cpp @@ -27,11 +27,11 @@ #if LL_DBUS_ENABLED #include "linden_common.h" +#include "llaprpool.h" extern "C" { #include -#include "apr_pools.h" #include "apr_dso.h" } @@ -44,7 +44,7 @@ extern "C" { #undef LL_DBUS_SYM static bool sSymsGrabbed = false; -static apr_pool_t *sSymDBUSDSOMemoryPool = NULL; +static LLAPRPool sSymDBUSDSOMemoryPool; static apr_dso_handle_t *sSymDBUSDSOHandleG = NULL; bool grab_dbus_syms(std::string dbus_dso_name) @@ -63,11 +63,11 @@ bool grab_dbus_syms(std::string dbus_dso_name) #define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##DBUSSYM, sSymDBUSDSOHandle, #DBUSSYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #DBUSSYM); if (REQUIRED) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #DBUSSYM, (void*)ll##DBUSSYM);}while(0) //attempt to load the shared library - apr_pool_create(&sSymDBUSDSOMemoryPool, NULL); + sSymDBUSDSOMemoryPool.create(); if ( APR_SUCCESS == (rv = apr_dso_load(&sSymDBUSDSOHandle, dbus_dso_name.c_str(), - sSymDBUSDSOMemoryPool) )) + sSymDBUSDSOMemoryPool()) )) { INFOMSG("Found DSO: %s", dbus_dso_name.c_str()); @@ -109,11 +109,7 @@ void ungrab_dbus_syms() sSymDBUSDSOHandleG = NULL; } - if ( sSymDBUSDSOMemoryPool ) - { - apr_pool_destroy(sSymDBUSDSOMemoryPool); - sSymDBUSDSOMemoryPool = NULL; - } + sSymDBUSDSOMemoryPool.destroy(); // NULL-out all of the symbols we'd grabbed #define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{ll##DBUSSYM = NULL;}while(0) diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 1cd80986d8..13c8745eaf 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -113,6 +113,7 @@ int main( int argc, char **argv ) } delete viewer_app_ptr; viewer_app_ptr = NULL; + return 0; } diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index deebd69ec1..9b96332c10 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -223,8 +223,7 @@ BOOL LLFloaterAnimPreview::postBuild() // now load bvh file S32 file_size; - LLAPRFile infile ; - infile.open(mFilenameAndPath, LL_APR_RB, NULL, &file_size); + LLAPRFile infile(mFilenameAndPath, LL_APR_RB, &file_size); if (!infile.getFileHandle()) { diff --git a/indra/newview/llmainlooprepeater.cpp b/indra/newview/llmainlooprepeater.cpp index 5c020e6d98..d73048a28b 100644 --- a/indra/newview/llmainlooprepeater.cpp +++ b/indra/newview/llmainlooprepeater.cpp @@ -46,7 +46,7 @@ void LLMainLoopRepeater::start(void) { if(mQueue != 0) return; - mQueue = new LLThreadSafeQueue(gAPRPoolp, 1024); + mQueue = new LLThreadSafeQueue(1024); mMainLoopConnection = LLEventPumps::instance(). obtain("mainloop").listen(LLEventPump::inventName(), boost::bind(&LLMainLoopRepeater::onMainLoop, this, _1)); mRepeaterConnection = LLEventPumps::instance(). diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index f54214b95c..a47ea8581a 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -176,7 +176,7 @@ private: bool LLTextureCacheLocalFileWorker::doRead() { - S32 local_size = LLAPRFile::size(mFileName, mCache->getLocalAPRFilePool()); + S32 local_size = LLAPRFile::size(mFileName); if (local_size > 0 && mFileName.size() > 4) { @@ -250,7 +250,7 @@ bool LLTextureCacheLocalFileWorker::doRead() } mReadData = new U8[mDataSize]; - S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); + S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize); if (bytes_read != mDataSize) { @@ -331,7 +331,7 @@ bool LLTextureCacheRemoteWorker::doRead() // Is it a JPEG2000 file? { local_filename = filename + ".j2c"; - local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); + local_size = LLAPRFile::size(local_filename); if (local_size > 0) { mImageFormat = IMG_CODEC_J2C; @@ -341,7 +341,7 @@ bool LLTextureCacheRemoteWorker::doRead() if (local_size == 0) { local_filename = filename + ".jpg"; - local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); + local_size = LLAPRFile::size(local_filename); if (local_size > 0) { mImageFormat = IMG_CODEC_JPEG; @@ -352,7 +352,7 @@ bool LLTextureCacheRemoteWorker::doRead() if (local_size == 0) { local_filename = filename + ".tga"; - local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); + local_size = LLAPRFile::size(local_filename); if (local_size > 0) { mImageFormat = IMG_CODEC_TGA; @@ -378,8 +378,7 @@ bool LLTextureCacheRemoteWorker::doRead() } // Allocate read buffer mReadData = new U8[mDataSize]; - S32 bytes_read = LLAPRFile::readEx(local_filename, - mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); + S32 bytes_read = LLAPRFile::readEx(local_filename, mReadData, mOffset, mDataSize); if (bytes_read != mDataSize) { llwarns << "Error reading file from local cache: " << local_filename @@ -430,8 +429,7 @@ bool LLTextureCacheRemoteWorker::doRead() size = llmin(size, mDataSize); // Allocate the read buffer mReadData = new U8[size]; - S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, - mReadData, offset, size, mCache->getLocalAPRFilePool()); + S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, mReadData, offset, size); if (bytes_read != size) { llwarns << "LLTextureCacheWorker: " << mID @@ -457,7 +455,7 @@ bool LLTextureCacheRemoteWorker::doRead() if (!done && (mState == BODY)) { std::string filename = mCache->getTextureFileName(mID); - S32 filesize = LLAPRFile::size(filename, mCache->getLocalAPRFilePool()); + S32 filesize = LLAPRFile::size(filename); if (filesize && (filesize + TEXTURE_CACHE_ENTRY_SIZE) > mOffset) { @@ -499,8 +497,7 @@ bool LLTextureCacheRemoteWorker::doRead() // Read the data at last S32 bytes_read = LLAPRFile::readEx(filename, mReadData + data_offset, - file_offset, file_size, - mCache->getLocalAPRFilePool()); + file_offset, file_size); if (bytes_read != file_size) { llwarns << "LLTextureCacheWorker: " << mID @@ -601,13 +598,13 @@ bool LLTextureCacheRemoteWorker::doWrite() U8* padBuffer = new U8[TEXTURE_CACHE_ENTRY_SIZE]; memset(padBuffer, 0, TEXTURE_CACHE_ENTRY_SIZE); // Init with zeros memcpy(padBuffer, mWriteData, mDataSize); // Copy the write buffer - bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, padBuffer, offset, size, mCache->getLocalAPRFilePool()); + bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, padBuffer, offset, size); delete [] padBuffer; } else { // Write the header record (== first TEXTURE_CACHE_ENTRY_SIZE bytes of the raw file) in the header file - bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, mWriteData, offset, size, mCache->getLocalAPRFilePool()); + bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, mWriteData, offset, size); } if (bytes_written <= 0) @@ -642,8 +639,7 @@ bool LLTextureCacheRemoteWorker::doWrite() // llinfos << "Writing Body: " << filename << " Bytes: " << file_offset+file_size << llendl; S32 bytes_written = LLAPRFile::writeEx( filename, mWriteData + TEXTURE_CACHE_ENTRY_SIZE, - 0, file_size, - mCache->getLocalAPRFilePool()); + 0, file_size); if (bytes_written <= 0) { llwarns << "LLTextureCacheWorker: " << mID @@ -740,9 +736,6 @@ void LLTextureCacheWorker::endWork(S32 param, bool aborted) LLTextureCache::LLTextureCache(bool threaded) : LLWorkerThread("TextureCache", threaded), - mWorkersMutex(NULL), - mHeaderMutex(NULL), - mListMutex(NULL), mHeaderAPRFile(NULL), mReadOnly(TRUE), //do not allow to change the texture cache until setReadOnly() is called. mTexturesSizeTotal(0), @@ -846,7 +839,7 @@ BOOL LLTextureCache::isInLocal(const LLUUID& id) // Is it a JPEG2000 file? { local_filename = filename + ".j2c"; - local_size = LLAPRFile::size(local_filename, getLocalAPRFilePool()); + local_size = LLAPRFile::size(local_filename); if (local_size > 0) { return TRUE ; @@ -856,7 +849,7 @@ BOOL LLTextureCache::isInLocal(const LLUUID& id) // If not, is it a jpeg file? { local_filename = filename + ".jpg"; - local_size = LLAPRFile::size(local_filename, getLocalAPRFilePool()); + local_size = LLAPRFile::size(local_filename); if (local_size > 0) { return TRUE ; @@ -866,7 +859,7 @@ BOOL LLTextureCache::isInLocal(const LLUUID& id) // Hmm... What about a targa file? (used for UI texture mostly) { local_filename = filename + ".tga"; - local_size = LLAPRFile::size(local_filename, getLocalAPRFilePool()); + local_size = LLAPRFile::size(local_filename); if (local_size > 0) { return TRUE ; @@ -912,10 +905,10 @@ void LLTextureCache::purgeCache(ELLPath location) if(LLFile::isdir(mTexturesDirName)) { std::string file_name = gDirUtilp->getExpandedFilename(location, entries_filename); - LLAPRFile::remove(file_name, getLocalAPRFilePool()); + LLAPRFile::remove(file_name); file_name = gDirUtilp->getExpandedFilename(location, cache_filename); - LLAPRFile::remove(file_name, getLocalAPRFilePool()); + LLAPRFile::remove(file_name); purgeAllTextures(true); } @@ -991,7 +984,9 @@ LLAPRFile* LLTextureCache::openHeaderEntriesFile(bool readonly, S32 offset) { llassert_always(mHeaderAPRFile == NULL); apr_int32_t flags = readonly ? APR_READ|APR_BINARY : APR_READ|APR_WRITE|APR_BINARY; - mHeaderAPRFile = new LLAPRFile(mHeaderEntriesFileName, flags, getLocalAPRFilePool()); + // All code calling openHeaderEntriesFile, immediately calls closeHeaderEntriesFile, + // so this file is very short-lived. + mHeaderAPRFile = new LLAPRFile(mHeaderEntriesFileName, flags); if(offset > 0) { mHeaderAPRFile->seek(APR_SET, offset); @@ -1014,10 +1009,9 @@ void LLTextureCache::readEntriesHeader() { // mHeaderEntriesInfo initializes to default values so safe not to read it llassert_always(mHeaderAPRFile == NULL); - if (LLAPRFile::isExist(mHeaderEntriesFileName, getLocalAPRFilePool())) + if (LLAPRFile::isExist(mHeaderEntriesFileName)) { - LLAPRFile::readEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), - getLocalAPRFilePool()); + LLAPRFile::readEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo)); } else //create an empty entries header. { @@ -1032,8 +1026,7 @@ void LLTextureCache::writeEntriesHeader() llassert_always(mHeaderAPRFile == NULL); if (!mReadOnly) { - LLAPRFile::writeEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), - getLocalAPRFilePool()); + LLAPRFile::writeEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo)); } } @@ -1623,7 +1616,7 @@ void LLTextureCache::purgeTextures(bool validate) if (uuididx == validate_idx) { LL_DEBUGS("TextureCache") << "Validating: " << filename << "Size: " << entries[idx].mBodySize << LL_ENDL; - S32 bodysize = LLAPRFile::size(filename, getLocalAPRFilePool()); + S32 bodysize = LLAPRFile::size(filename); if (bodysize != entries[idx].mBodySize) { LL_WARNS("TextureCache") << "TEXTURE CACHE BODY HAS BAD SIZE: " << bodysize << " != " << entries[idx].mBodySize @@ -1858,7 +1851,7 @@ void LLTextureCache::removeCachedTexture(const LLUUID& id) mTexturesSizeMap.erase(id); } mHeaderIDMap.erase(id); - LLAPRFile::remove(getTextureFileName(id), getLocalAPRFilePool()); + LLAPRFile::remove(getTextureFileName(id)); } //called after mHeaderMutex is locked. @@ -1870,7 +1863,7 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename) { if (entry.mBodySize == 0) // Always attempt to remove when mBodySize > 0. { - if (LLAPRFile::isExist(filename, getLocalAPRFilePool())) // Sanity check. Shouldn't exist when body size is 0. + if (LLAPRFile::isExist(filename)) // Sanity check. Shouldn't exist when body size is 0. { LL_WARNS("TextureCache") << "Entry has body size of zero but file " << filename << " exists. Deleting this file, too." << LL_ENDL; } @@ -1891,7 +1884,7 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename) if (file_maybe_exists) { - LLAPRFile::remove(filename, getLocalAPRFilePool()); + LLAPRFile::remove(filename); } } diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 64e3a2658c..79f5ba5835 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -142,9 +142,6 @@ protected: std::string getTextureFileName(const LLUUID& id); void addCompleted(Responder* responder, bool success); -protected: - //void setFileAPRPool(apr_pool_t* pool) { mFileAPRPool = pool ; } - private: void setDirNames(ELLPath location); void readHeaderCache(); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 18c3a3b87d..139b434aeb 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -674,7 +674,6 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mRetryAttempt(0), mActiveCount(0), mGetStatus(0), - mWorkMutex(NULL), mFirstPacket(0), mLastPacket(-1), mTotalPackets(0), @@ -1816,8 +1815,6 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mDebugPause(FALSE), mPacketCount(0), mBadPacketCount(0), - mQueueMutex(getAPRPool()), - mNetworkQueueMutex(getAPRPool()), mTextureCache(cache), mImageDecodeThread(imagedecodethread), mTextureBandwidth(0), diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index fda291f3c1..6bee7556cd 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -736,8 +736,7 @@ void upload_new_resource(const std::string& src_filename, std::string name, uuid = tid.makeAssetID(gAgent.getSecureSessionID()); // copy this file into the vfs for upload S32 file_size; - LLAPRFile infile ; - infile.open(filename, LL_APR_RB, NULL, &file_size); + LLAPRFile infile(filename, LL_APR_RB, &file_size); if (infile.getFileHandle()) { LLVFile file(gVFS, uuid, asset_type, LLVFile::WRITE); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fd89044995..2cd9b09932 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7190,8 +7190,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) // static void LLVOAvatar::dumpArchetypeXML( void* ) { - LLAPRFile outfile; - outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"new archetype.xml"), LL_APR_WB ); + LLAPRFile outfile(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER, "new archetype.xml"), LL_APR_WB); apr_file_t* file = outfile.getFileHandle() ; if (!file) { diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index a933500706..d25831b4f1 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -30,14 +30,14 @@ #include "llregionhandle.h" #include "llviewercontrol.h" -BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes) +static BOOL check_read(LLAPRFile& apr_file, void* src, S32 n_bytes) { - return apr_file->read(src, n_bytes) == n_bytes ; + return apr_file.read(src, n_bytes) == n_bytes ; } -BOOL check_write(LLAPRFile* apr_file, void* src, S32 n_bytes) +static BOOL check_write(LLAPRFile& apr_file, void* src, S32 n_bytes) { - return apr_file->write(src, n_bytes) == n_bytes ; + return apr_file.write(src, n_bytes) == n_bytes ; } @@ -70,7 +70,7 @@ LLVOCacheEntry::LLVOCacheEntry() mDP.assignBuffer(mBuffer, 0); } -LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) +LLVOCacheEntry::LLVOCacheEntry(LLAPRFile& apr_file) { S32 size = -1; BOOL success; @@ -185,7 +185,7 @@ void LLVOCacheEntry::dump() const << llendl; } -BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const +BOOL LLVOCacheEntry::writeToFile(LLAPRFile& apr_file) const { BOOL success; success = check_write(apr_file, (void*)&mLocalID, sizeof(U32)); @@ -266,7 +266,6 @@ LLVOCache::LLVOCache(): mCacheSize(1) { mEnabled = gSavedSettings.getBOOL("ObjectCacheEnabled"); - mLocalAPRFilePoolp = new LLVolatileAPRPool() ; } LLVOCache::~LLVOCache() @@ -276,7 +275,6 @@ LLVOCache::~LLVOCache() writeCacheHeader(); clearCacheInMemory(); } - delete mLocalAPRFilePoolp; } void LLVOCache::setDirNames(ELLPath location) @@ -437,7 +435,7 @@ void LLVOCache::removeFromCache(HeaderEntryInfo* entry) std::string filename; getObjectCacheFilename(entry->mHandle, filename); - LLAPRFile::remove(filename, mLocalAPRFilePoolp); + LLAPRFile::remove(filename); entry->mTime = INVALID_TIME ; updateEntry(entry) ; //update the head file. } @@ -454,12 +452,12 @@ void LLVOCache::readCacheHeader() clearCacheInMemory(); bool success = true ; - if (LLAPRFile::isExist(mHeaderFileName, mLocalAPRFilePoolp)) + if (LLAPRFile::isExist(mHeaderFileName)) { - LLAPRFile apr_file(mHeaderFileName, APR_READ|APR_BINARY, mLocalAPRFilePoolp); + LLAPRFile apr_file(mHeaderFileName, APR_READ|APR_BINARY); //read the meta element - success = check_read(&apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; + success = check_read(apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; if(success) { @@ -472,7 +470,7 @@ void LLVOCache::readCacheHeader() { entry = new HeaderEntryInfo() ; } - success = check_read(&apr_file, entry, sizeof(HeaderEntryInfo)); + success = check_read(apr_file, entry, sizeof(HeaderEntryInfo)); if(!success) //failed { @@ -541,17 +539,17 @@ void LLVOCache::writeCacheHeader() bool success = true ; { - LLAPRFile apr_file(mHeaderFileName, APR_CREATE|APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); + LLAPRFile apr_file(mHeaderFileName, APR_CREATE|APR_WRITE|APR_BINARY); //write the meta element - success = check_write(&apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; + success = check_write(apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; mNumEntries = 0 ; for(header_entry_queue_t::iterator iter = mHeaderEntryQueue.begin() ; success && iter != mHeaderEntryQueue.end(); ++iter) { (*iter)->mIndex = mNumEntries++ ; - success = check_write(&apr_file, (void*)*iter, sizeof(HeaderEntryInfo)); + success = check_write(apr_file, (void*)*iter, sizeof(HeaderEntryInfo)); } mNumEntries = mHeaderEntryQueue.size() ; @@ -562,7 +560,7 @@ void LLVOCache::writeCacheHeader() for(S32 i = mNumEntries ; success && i < MAX_NUM_OBJECT_ENTRIES ; i++) { //fill the cache with the default entry. - success = check_write(&apr_file, entry, sizeof(HeaderEntryInfo)) ; + success = check_write(apr_file, entry, sizeof(HeaderEntryInfo)) ; } delete entry ; @@ -579,10 +577,10 @@ void LLVOCache::writeCacheHeader() BOOL LLVOCache::updateEntry(const HeaderEntryInfo* entry) { - LLAPRFile apr_file(mHeaderFileName, APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); - apr_file.seek(APR_SET, entry->mIndex * sizeof(HeaderEntryInfo) + sizeof(HeaderMetaInfo)) ; + LLAPRFile apr_file(mHeaderFileName, APR_WRITE|APR_BINARY); + apr_file.seek(APR_SET, entry->mIndex * sizeof(HeaderEntryInfo) + sizeof(HeaderMetaInfo)); - return check_write(&apr_file, (void*)entry, sizeof(HeaderEntryInfo)) ; + return check_write(apr_file, (void*)entry, sizeof(HeaderEntryInfo)) ; } void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) @@ -605,10 +603,10 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca { std::string filename; getObjectCacheFilename(handle, filename); - LLAPRFile apr_file(filename, APR_READ|APR_BINARY, mLocalAPRFilePoolp); + LLAPRFile apr_file(filename, APR_READ|APR_BINARY); LLUUID cache_id ; - success = check_read(&apr_file, cache_id.mData, UUID_BYTES) ; + success = check_read(apr_file, cache_id.mData, UUID_BYTES) ; if(success) { @@ -621,11 +619,11 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca if(success) { S32 num_entries; - success = check_read(&apr_file, &num_entries, sizeof(S32)) ; + success = check_read(apr_file, &num_entries, sizeof(S32)) ; for (S32 i = 0; success && i < num_entries; i++) { - LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file); + LLVOCacheEntry* entry = new LLVOCacheEntry(apr_file); if (!entry->getLocalID()) { llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl; @@ -724,19 +722,19 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: { std::string filename; getObjectCacheFilename(handle, filename); - LLAPRFile apr_file(filename, APR_CREATE|APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); + LLAPRFile apr_file(filename, APR_CREATE|APR_WRITE|APR_BINARY); - success = check_write(&apr_file, (void*)id.mData, UUID_BYTES) ; + success = check_write(apr_file, (void*)id.mData, UUID_BYTES) ; if(success) { S32 num_entries = cache_entry_map.size() ; - success = check_write(&apr_file, &num_entries, sizeof(S32)); + success = check_write(apr_file, &num_entries, sizeof(S32)); for (LLVOCacheEntry::vocache_entry_map_t::const_iterator iter = cache_entry_map.begin(); success && iter != cache_entry_map.end(); ++iter) { - success = iter->second->writeToFile(&apr_file) ; + success = iter->second->writeToFile(apr_file) ; } } } diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 14e3b4c793..76456b9e98 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -41,7 +41,7 @@ class LLVOCacheEntry { public: LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp); - LLVOCacheEntry(LLAPRFile* apr_file); + LLVOCacheEntry(LLAPRFile& apr_file); LLVOCacheEntry(); ~LLVOCacheEntry(); @@ -51,7 +51,7 @@ public: S32 getCRCChangeCount() const { return mCRCChangeCount; } void dump() const; - BOOL writeToFile(LLAPRFile* apr_file) const; + BOOL writeToFile(LLAPRFile& apr_file) const; void assignCRC(U32 crc, LLDataPackerBinaryBuffer &dp); LLDataPackerBinaryBuffer *getDP(U32 crc); void recordHit(); @@ -142,7 +142,6 @@ private: U32 mNumEntries; std::string mHeaderFileName ; std::string mObjectCacheDirName; - LLVolatileAPRPool* mLocalAPRFilePoolp ; header_entry_queue_t mHeaderEntryQueue; handle_entry_map_t mHandleEntryMap; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 08e242af8e..828207ce1a 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -961,7 +961,7 @@ void LLVivoxVoiceClient::stateMachine() if(!mSocket) { - mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); + mSocket = LLSocket::create(LLSocket::STREAM_TCP); } mConnected = mSocket->blockingConnect(mDaemonHost); diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp index 1694126802..d982ca5020 100644 --- a/indra/newview/llwatchdog.cpp +++ b/indra/newview/llwatchdog.cpp @@ -178,8 +178,8 @@ void LLWatchdog::init(killer_event_callback func) mKillerCallback = func; if(!mSuspectsAccessMutex && !mTimer) { - mSuspectsAccessMutex = new LLMutex(NULL); - mTimer = new LLWatchdogTimerThread(); + mSuspectsAccessMutex = new LLMutex; + mTimer = new LLWatchdogTimerThread; mTimer->setSleepTime(WATCHDOG_SLEEP_TIME_USEC / 1000); mLastClockCount = LLTimer::getTotalTime(); diff --git a/indra/newview/tests/llworldmap_test.cpp b/indra/newview/tests/llworldmap_test.cpp index acc6e814bc..102294959a 100644 --- a/indra/newview/tests/llworldmap_test.cpp +++ b/indra/newview/tests/llworldmap_test.cpp @@ -27,7 +27,6 @@ // Dependencies #include "linden_common.h" -#include "llapr.h" #include "llsingleton.h" #include "lltrans.h" #include "lluistring.h" -- cgit v1.2.3 From e3816f4577a74bba42ae9091461125ec9698b583 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 8 Feb 2011 17:00:36 -0500 Subject: adding pausing on startup for windows to help debug application not starting. --- indra/newview/llappviewerwin32.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index d328567a0e..b0bf36f688 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -57,7 +57,7 @@ #include "llcommandlineparser.h" #include "lltrans.h" - +#include "runtimediagnostics.h" #ifndef LL_RELEASE_FOR_DOWNLOAD #include "llwindebug.h" #endif @@ -110,6 +110,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) { + RuntimeDiagnostics::CheckPauseOnStartupOption(); LLMemType mt1(LLMemType::MTYPE_STARTUP); const S32 MAX_HEAPS = 255; -- cgit v1.2.3 From 9ef62ba2cecbed3db3eff74a294eb252f018399c Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 9 Feb 2011 14:01:36 -0500 Subject: forgot to add runtimediagnostics.h. whoops. --- indra/newview/CMakeLists.txt | 1 + indra/newview/runtimediagnostics.h | 256 +++++++++++++++++++++++++++++++++++++ 2 files changed, 257 insertions(+) create mode 100644 indra/newview/runtimediagnostics.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8ea0dd1089..ca408d032a 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1136,6 +1136,7 @@ set(viewer_HEADER_FILES macmain.h noise.h pipeline.h + runtimediagnostics.h VertexCache.h VorbisFramework.h ) diff --git a/indra/newview/runtimediagnostics.h b/indra/newview/runtimediagnostics.h new file mode 100644 index 0000000000..b1c2662958 --- /dev/null +++ b/indra/newview/runtimediagnostics.h @@ -0,0 +1,256 @@ + once + + + +#include + + + +/* static*/ class RuntimeDiagnostics + +{ + +public: + + static void CheckPauseOnStartupOption( + + ) + + { + + DWORD dwPause; + + if (GetExecutionOption(TEXT("PauseOnStartup"), &dwPause) == S_OK && dwPause != 0) + + { + + while (true) + + { + + if (IsDebuggerPresent()) + + { + + __debugbreak(); + + break; + + } + + + + Sleep(1000); + + } + + } + + } + + + +private: + + static HRESULT GetExecutionOption( + + LPCTSTR szOptionName, + + DWORD *pValue + + ) + + { + + HRESULT hr; + + DWORD nChar; + + + + *pValue = 0; + + + + CRegKey rkeyExecutionOptions; + + hr = WIN32_ERROR_CALL( rkeyExecutionOptions.Open( + + HKEY_LOCAL_MACHINE, + + TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options"), + + KEY_READ + + ) ); + + + + if (hr == S_OK) + + { + + TCHAR szModPath[MAX_PATH + 1]; + + nChar = GetModuleFileName(NULL, szModPath, ARRAYSIZE(szModPath)); + + hr = WIN32_BOOL_CALL(nChar > 0 && nChar < ARRAYSIZE(szModPath)); + + + + if (hr == S_OK) + + { + + nChar = GetFileNameCharOffset(szModPath); + + + + if (nChar != MAXDWORD) + + { + + CRegKey rkeyExe; + + hr = WIN32_ERROR_CALL( rkeyExe.Open(rkeyExecutionOptions, szModPath + nChar, KEY_QUERY_VALUE) ); + + if (hr == S_OK) + + { + + hr = WIN32_ERROR_CALL( rkeyExe.QueryDWORDValue(szOptionName, *pValue) ); + + } + + } + + else + + { + + hr = E_FAIL; + + } + + } + + } + + + + return hr; + + } + + + + static DWORD GetFileNameCharOffset(LPCTSTR szPath) + + { + + if (!szPath) + + { + + return MAXDWORD; + + } + + + + // Find the last slash + + DWORD dwReturn = 0; + + for (DWORD c = 0; szPath[c] != 0; c++) + + { + + if (c >= INT_MAX) + + { + + return MAXDWORD; // string did not terminate + + } + + + + if (szPath[c] == '\\' || szPath[c] == '/' || (szPath[c] == ':' && c == 1)) + + { + + dwReturn = c + 1; + + } + + } + + + + // Make sure that the string doesn't end at the slash + + if (szPath[dwReturn] == 0) + + { + + dwReturn = MAXDWORD; + + } + + + + return dwReturn; + + } + + + + static inline HRESULT WIN32_ERROR(LONG lError) + + { + + return HRESULT_FROM_WIN32(lError); + + } + + + + static inline HRESULT WIN32_LAST_ERROR() + + { + + return WIN32_ERROR(GetLastError()); + + } + + + + static inline HRESULT WIN32_BOOL_CALL(BOOL rc) + + { + + if (!rc) + + return WIN32_LAST_ERROR(); + + return S_OK; + + } + + + + static inline HRESULT WIN32_ERROR_CALL(LONG lError) + + { + + if (lError != ERROR_SUCCESS) + + return WIN32_ERROR(lError); + + return S_OK; + + } + +}; + -- cgit v1.2.3 From 86a2c4912c72a735f713dfc40a053335a21f3350 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 9 Feb 2011 16:10:01 -0500 Subject: header got cut off. ugh. --- indra/newview/runtimediagnostics.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/runtimediagnostics.h b/indra/newview/runtimediagnostics.h index b1c2662958..bf385a6361 100644 --- a/indra/newview/runtimediagnostics.h +++ b/indra/newview/runtimediagnostics.h @@ -1,7 +1,4 @@ - once - - - +#pragma once #include -- cgit v1.2.3 From 344ddaf9f5945c63c39774f9619069629430e70b Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 11 Feb 2011 17:30:09 -0500 Subject: reverting windows debugging commits. --- indra/newview/CMakeLists.txt | 1 - indra/newview/llappviewerwin32.cpp | 3 +- indra/newview/runtimediagnostics.h | 253 ------------------------------------- 3 files changed, 1 insertion(+), 256 deletions(-) delete mode 100644 indra/newview/runtimediagnostics.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index ca408d032a..8ea0dd1089 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1136,7 +1136,6 @@ set(viewer_HEADER_FILES macmain.h noise.h pipeline.h - runtimediagnostics.h VertexCache.h VorbisFramework.h ) diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index b0bf36f688..d328567a0e 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -57,7 +57,7 @@ #include "llcommandlineparser.h" #include "lltrans.h" -#include "runtimediagnostics.h" + #ifndef LL_RELEASE_FOR_DOWNLOAD #include "llwindebug.h" #endif @@ -110,7 +110,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) { - RuntimeDiagnostics::CheckPauseOnStartupOption(); LLMemType mt1(LLMemType::MTYPE_STARTUP); const S32 MAX_HEAPS = 255; diff --git a/indra/newview/runtimediagnostics.h b/indra/newview/runtimediagnostics.h deleted file mode 100644 index bf385a6361..0000000000 --- a/indra/newview/runtimediagnostics.h +++ /dev/null @@ -1,253 +0,0 @@ -#pragma once -#include - - - -/* static*/ class RuntimeDiagnostics - -{ - -public: - - static void CheckPauseOnStartupOption( - - ) - - { - - DWORD dwPause; - - if (GetExecutionOption(TEXT("PauseOnStartup"), &dwPause) == S_OK && dwPause != 0) - - { - - while (true) - - { - - if (IsDebuggerPresent()) - - { - - __debugbreak(); - - break; - - } - - - - Sleep(1000); - - } - - } - - } - - - -private: - - static HRESULT GetExecutionOption( - - LPCTSTR szOptionName, - - DWORD *pValue - - ) - - { - - HRESULT hr; - - DWORD nChar; - - - - *pValue = 0; - - - - CRegKey rkeyExecutionOptions; - - hr = WIN32_ERROR_CALL( rkeyExecutionOptions.Open( - - HKEY_LOCAL_MACHINE, - - TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options"), - - KEY_READ - - ) ); - - - - if (hr == S_OK) - - { - - TCHAR szModPath[MAX_PATH + 1]; - - nChar = GetModuleFileName(NULL, szModPath, ARRAYSIZE(szModPath)); - - hr = WIN32_BOOL_CALL(nChar > 0 && nChar < ARRAYSIZE(szModPath)); - - - - if (hr == S_OK) - - { - - nChar = GetFileNameCharOffset(szModPath); - - - - if (nChar != MAXDWORD) - - { - - CRegKey rkeyExe; - - hr = WIN32_ERROR_CALL( rkeyExe.Open(rkeyExecutionOptions, szModPath + nChar, KEY_QUERY_VALUE) ); - - if (hr == S_OK) - - { - - hr = WIN32_ERROR_CALL( rkeyExe.QueryDWORDValue(szOptionName, *pValue) ); - - } - - } - - else - - { - - hr = E_FAIL; - - } - - } - - } - - - - return hr; - - } - - - - static DWORD GetFileNameCharOffset(LPCTSTR szPath) - - { - - if (!szPath) - - { - - return MAXDWORD; - - } - - - - // Find the last slash - - DWORD dwReturn = 0; - - for (DWORD c = 0; szPath[c] != 0; c++) - - { - - if (c >= INT_MAX) - - { - - return MAXDWORD; // string did not terminate - - } - - - - if (szPath[c] == '\\' || szPath[c] == '/' || (szPath[c] == ':' && c == 1)) - - { - - dwReturn = c + 1; - - } - - } - - - - // Make sure that the string doesn't end at the slash - - if (szPath[dwReturn] == 0) - - { - - dwReturn = MAXDWORD; - - } - - - - return dwReturn; - - } - - - - static inline HRESULT WIN32_ERROR(LONG lError) - - { - - return HRESULT_FROM_WIN32(lError); - - } - - - - static inline HRESULT WIN32_LAST_ERROR() - - { - - return WIN32_ERROR(GetLastError()); - - } - - - - static inline HRESULT WIN32_BOOL_CALL(BOOL rc) - - { - - if (!rc) - - return WIN32_LAST_ERROR(); - - return S_OK; - - } - - - - static inline HRESULT WIN32_ERROR_CALL(LONG lError) - - { - - if (lError != ERROR_SUCCESS) - - return WIN32_ERROR(lError); - - return S_OK; - - } - -}; - -- cgit v1.2.3 From 4046a9082d793e71cac26a31d44c127decd6821f Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 11 Feb 2011 17:37:07 -0500 Subject: re-applying render cost changes for experimentations --- indra/newview/llfloatertools.cpp | 32 +----- indra/newview/llfloatertools.h | 1 - indra/newview/llselectmgr.cpp | 4 +- indra/newview/llvoavatar.cpp | 16 ++- indra/newview/llvovolume.cpp | 237 ++++++++++++++++++++++++++++++--------- indra/newview/llvovolume.h | 5 +- 6 files changed, 198 insertions(+), 97 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index bef830a93e..ceaf3c1449 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -476,7 +476,8 @@ void LLFloaterTools::refresh() if (sShowObjectCost) { std::string prim_cost_string; - LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost()); + S32 cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost(); + LLResMgr::getInstance()->getIntegerString(prim_cost_string, cost); getChild("RenderingCost")->setTextArg("[COUNT]", prim_cost_string); } @@ -1037,35 +1038,6 @@ void LLFloaterTools::onClickGridOptions() //floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE); } -S32 LLFloaterTools::calcRenderCost() -{ - S32 cost = 0; - std::set textures; - - for (LLObjectSelection::iterator selection_iter = LLSelectMgr::getInstance()->getSelection()->begin(); - selection_iter != LLSelectMgr::getInstance()->getSelection()->end(); - ++selection_iter) - { - LLSelectNode *select_node = *selection_iter; - if (select_node) - { - LLViewerObject *vobj = select_node->getObject(); - if (vobj->getVolume()) - { - LLVOVolume* volume = (LLVOVolume*) vobj; - - cost += volume->getRenderCost(textures); - cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST; - textures.clear(); - } - } - } - - - return cost; -} - - // static void LLFloaterTools::setEditTool(void* tool_pointer) { diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index 87c3d2ab47..d5595445e0 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -114,7 +114,6 @@ private: static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response); static void setObjectType( LLPCode pcode ); void onClickGridOptions(); - S32 calcRenderCost(); public: LLButton *mBtnFocus; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 93c9131424..90c2cf1eb4 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6391,7 +6391,7 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount() return count; } -/*S32 LLObjectSelection::getSelectedObjectRenderCost() +S32 LLObjectSelection::getSelectedObjectRenderCost() { S32 cost = 0; LLVOVolume::texture_cost_t textures; @@ -6415,7 +6415,7 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount() return cost; -}*/ +} //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a257703b24..950d050f26 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8241,7 +8241,7 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d void LLVOAvatar::idleUpdateRenderCost() { - static const U32 ARC_BODY_PART_COST = 20; + static const U32 ARC_BODY_PART_COST = 200; static const U32 ARC_LIMIT = 2048; static std::set all_textures; @@ -8252,7 +8252,7 @@ void LLVOAvatar::idleUpdateRenderCost() } U32 cost = 0; - std::set textures; + LLVOVolume::texture_cost_t textures; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { @@ -8293,15 +8293,21 @@ void LLVOAvatar::idleUpdateRenderCost() } + for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) + { + // add the cost of each individual texture in the linkset + cost += iter->second; + } + // Diagnostic output to identify all avatar-related textures. // Does not affect rendering cost calculation. // Could be wrapped in a debug option if output becomes problematic. if (isSelf()) { // print any attachment textures we didn't already know about. - for (std::set::iterator it = textures.begin(); it != textures.end(); ++it) + for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) { - LLUUID image_id = *it; + LLUUID image_id = it->first; if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) continue; if (all_textures.find(image_id) == all_textures.end()) @@ -8333,8 +8339,6 @@ void LLVOAvatar::idleUpdateRenderCost() } } - cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST; - setDebugText(llformat("%d", cost)); F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index be987a2310..01027e6a11 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2931,24 +2931,35 @@ const LLMatrix4 LLVOVolume::getRenderMatrix() const // total cost is returned value + 5 * size of the resulting set. // Cannot include cost of textures, as they may be re-used in linked // children, and cost should only be increased for unique textures -Nyx -U32 LLVOVolume::getRenderCost(std::set &textures) const +U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const { - // base cost of each prim should be 10 points - static const U32 ARC_PRIM_COST = 10; + // Get access to params we'll need at various points. + // Skip if this is object doesn't have a volume (e.g. is an avatar). + BOOL has_volume = (getVolume() != NULL); + LLVolumeParams volume_params; + LLPathParams path_params; + LLProfileParams profile_params; + + U32 num_triangles = 0; + // per-prim costs - static const U32 ARC_INVISI_COST = 1; - static const U32 ARC_SHINY_COST = 1; - static const U32 ARC_GLOW_COST = 1; - static const U32 ARC_FLEXI_COST = 8; - static const U32 ARC_PARTICLE_COST = 16; - static const U32 ARC_BUMP_COST = 4; + static const U32 ARC_PARTICLE_COST = 1; + static const U32 ARC_PARTICLE_MAX = 2048; + static const U32 ARC_TEXTURE_COST = 5; - // per-face costs - static const U32 ARC_PLANAR_COST = 1; - static const U32 ARC_ANIM_TEX_COST = 4; - static const U32 ARC_ALPHA_COST = 4; + // per-prim multipliers + static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance + static const F32 ARC_BUMP_MULT = 1.25f; // tested based on performance + static const F32 ARC_FLEXI_MULT = 4; + static const F32 ARC_SHINY_MULT = 1.6f; // tested based on performance + static const F32 ARC_INVISI_COST = 1.2f; // tested based on performance + static const F32 ARC_WEIGHTED_MESH = 1.2f; - U32 shame = ARC_PRIM_COST; + static const F32 ARC_PLANAR_COST = 1.2f; // 1.2x max + static const F32 ARC_ANIM_TEX_COST = 1.4f; // 1.4x max + static const F32 ARC_ALPHA_COST = 4.f; // 4x max + + F32 shame = 0; U32 invisi = 0; U32 shiny = 0; @@ -2957,9 +2968,87 @@ U32 LLVOVolume::getRenderCost(std::set &textures) const U32 flexi = 0; U32 animtex = 0; U32 particles = 0; - U32 scale = 0; U32 bump = 0; U32 planar = 0; + U32 weighted_mesh = 0; + + // these multipliers are variable and can be floating point + F32 scale = 0.f; + + const LLDrawable* drawablep = mDrawable; + U32 num_faces = drawablep->getNumFaces(); + + if (has_volume) + { + volume_params = getVolume()->getParams(); + path_params = volume_params.getPathParams(); + profile_params = volume_params.getProfileParams(); + + F32 radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length(); + S32 default_detail = llclamp((S32) (sqrtf(radius)*LLVOVolume::sLODFactor*4.f), 0, 3); + if (default_detail == getLOD()) + { + num_triangles = getTriangleCount(); + } + else + { + LLVolume* default_volume = LLPrimitive::getVolumeManager()->refVolume(volume_params, default_detail); + if(default_volume != NULL) + { + num_triangles = default_volume->getNumTriangles(); + LLPrimitive::getVolumeManager()->unrefVolume(default_volume); + default_volume = NULL; + } + else + { + has_volume = false; + } + } + } + + if (isSculpted()) + { + if (isMesh()) + { + // base cost is dependent on mesh complexity + // note that 3 is the highest LOD as of the time of this coding. + S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(),3); + if ( size > 0) + { + num_triangles = (U32)(size / 10.f); // avg 1 triangle per 10 bytes + if (gMeshRepo.getSkinInfo(volume_params.getSculptID())) + { + // weighted attachment - 1 point for every 3 bytes + weighted_mesh = 1; + } + + if (num_triangles == 0) + { + // someone made a really tiny mesh. Approximate with a tetrahedron. + num_triangles = 4; + } + } + else + { + // something went wrong - user should know their content isn't render-free + return 0; + } + } + else + { + const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT); + LLUUID sculpt_id = sculpt_params->getSculptTexture(); + if (textures.find(sculpt_id) == textures.end()) + { + LLViewerFetchedTexture *texture = LLViewerTextureManager::getFetchedTexture(sculpt_id); + if (texture) + { + S32 texture_cost = (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f + 1)); + textures.insert(texture_cost_t::value_type(sculpt_id, texture_cost)); + } + } + } + } if (isFlexible()) { @@ -2971,18 +3060,12 @@ U32 LLVOVolume::getRenderCost(std::set &textures) const } const LLVector3& sc = getScale(); - scale += (U32) sc.mV[0] + (U32) sc.mV[1] + (U32) sc.mV[2]; - - const LLDrawable* drawablep = mDrawable; + scale += (sc.mV[0] + sc.mV[1] + sc.mV[2]) / 4.f; // scale to 1/4 the sum of the size + // enforce scale multiplier to be in the range [1,7] (7 was determined to experimentally be a reasonable max) + scale = scale > 7.f ? 7.f : scale; + scale = scale < 1.f ? 1.f : scale; - if (isSculpted()) - { - const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT); - LLUUID sculpt_id = sculpt_params->getSculptTexture(); - textures.insert(sculpt_id); - } - - for (S32 i = 0; i < drawablep->getNumFaces(); ++i) + for (S32 i = 0; i < num_faces; ++i) { const LLFace* face = drawablep->getFace(i); const LLTextureEntry* te = face->getTextureEntry(); @@ -2990,12 +3073,16 @@ U32 LLVOVolume::getRenderCost(std::set &textures) const if (img) { - textures.insert(img->getID()); + if (textures.find(img->getID()) == textures.end()) + { + S32 texture_cost = (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f + 1)); + textures.insert(texture_cost_t::value_type(img->getID(), texture_cost)); + } } if (face->getPoolType() == LLDrawPool::POOL_ALPHA) { - alpha++; + alpha = 1; } else if (img && img->getPrimaryFormat() == GL_ALPHA) { @@ -3006,58 +3093,98 @@ U32 LLVOVolume::getRenderCost(std::set &textures) const { if (te->getBumpmap()) { + // bump is a multiplier, don't add per-face bump = 1; } if (te->getShiny()) { + // shiny is a multiplier, don't add per-face shiny = 1; } if (te->getGlow() > 0.f) { + // glow is a multiplier, don't add per-face glow = 1; } if (face->mTextureMatrix != NULL) { - animtex++; + animtex = 1; } if (te->getTexGen()) { - planar++; + planar = 1; } } } + // shame currently has the "base" cost of 1 point per 50 triangles, min 2. + shame = num_triangles / 50.f; + shame = shame < 2.f ? 2.f : shame; - shame += invisi * ARC_INVISI_COST; - shame += shiny * ARC_SHINY_COST; - shame += glow * ARC_GLOW_COST; - shame += alpha * ARC_ALPHA_COST; - shame += flexi * ARC_FLEXI_COST; - shame += animtex * ARC_ANIM_TEX_COST; - shame += particles * ARC_PARTICLE_COST; - shame += bump * ARC_BUMP_COST; - shame += planar * ARC_PLANAR_COST; - shame += scale; + // factor in scale + shame *= scale; - LLViewerObject::const_child_list_t& child_list = getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); - ++iter) + // multiply by per-face modifiers + if (planar) { - const LLViewerObject* child_objectp = *iter; - const LLDrawable* child_drawablep = child_objectp->mDrawable; - if (child_drawablep) - { - const LLVOVolume* child_volumep = child_drawablep->getVOVolume(); - if (child_volumep) - { - shame += child_volumep->getRenderCost(textures); - } - } + shame *= planar * ARC_PLANAR_COST; + } + + if (animtex) + { + shame *= animtex * ARC_ANIM_TEX_COST; + } + + if (alpha) + { + shame *= alpha * ARC_ALPHA_COST; + } + + if(invisi) + { + shame *= invisi * ARC_INVISI_COST; + } + + if (glow) + { + shame *= glow * ARC_GLOW_MULT; + } + + if (bump) + { + shame *= bump * ARC_BUMP_MULT; + } + + if (shiny) + { + shame *= shiny * ARC_SHINY_MULT; } - return shame; + // multiply shame by multipliers + if (weighted_mesh) + { + shame *= weighted_mesh * ARC_WEIGHTED_MESH; + } + + if (flexi) + { + shame *= flexi * ARC_FLEXI_MULT; + } + + + // add additional costs + if (particles) + { + const LLPartSysData *part_sys_data = &(mPartSourcep->mPartSysData); + const LLPartData *part_data = &(part_sys_data->mPartData); + U32 num_particles = (U32)(part_sys_data->mBurstPartCount * llceil( part_data->mMaxAge / part_sys_data->mBurstRate)); + num_particles = num_particles > ARC_PARTICLE_MAX ? ARC_PARTICLE_MAX : num_particles; + F32 part_size = (llmax(part_data->mStartScale[0], part_data->mEndScale[0]) + llmax(part_data->mStartScale[1], part_data->mEndScale[1])) / 2.f; + shame += num_particles * part_size * ARC_PARTICLE_COST; + } + + return (U32)shame; } F32 LLVOVolume::getStreamingCost() diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 0c12f14832..e02a5d5675 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -129,7 +129,8 @@ public: const LLMatrix4& getRelativeXform() const { return mRelativeXform; } const LLMatrix3& getRelativeXformInvTrans() const { return mRelativeXformInvTrans; } /*virtual*/ const LLMatrix4 getRenderMatrix() const; - U32 getRenderCost(std::set &textures) const; + typedef std::map texture_cost_t; + U32 getRenderCost(texture_cost_t &textures) const; /*virtual*/ F32 getStreamingCost(); /*virtual*/ U32 getTriangleCount() const; /*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, @@ -358,8 +359,6 @@ public: static LLPointer sObjectMediaClient; static LLPointer sObjectMediaNavigateClient; - static const U32 ARC_TEXTURE_COST = 5; - protected: static S32 sNumLODChanges; -- cgit v1.2.3 From c10494e370f6399deea835964760628b14f7e299 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 16 Feb 2011 15:32:48 -0500 Subject: SH-997 FIX verify texture performance stats Got some better, reproducible numbers, which puts 32x32 textures at 538 points and 1024x1024 textures at 1024 points. --- indra/newview/llfloatertools.cpp | 3 ++- indra/newview/llvovolume.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index ceaf3c1449..1410facb53 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -427,7 +427,8 @@ void LLFloaterTools::refresh() if (sShowObjectCost) { std::string prim_cost_string; - LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost()); + S32 cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost(); + LLResMgr::getInstance()->getIntegerString(prim_cost_string, cost); getChild("RenderingCost")->setTextArg("[COUNT]", prim_cost_string); } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 01027e6a11..7703019f99 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2945,7 +2945,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const // per-prim costs static const U32 ARC_PARTICLE_COST = 1; static const U32 ARC_PARTICLE_MAX = 2048; - static const U32 ARC_TEXTURE_COST = 5; + static const U32 ARC_TEXTURE_COST = 32; // per-prim multipliers static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance @@ -3043,7 +3043,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const LLViewerFetchedTexture *texture = LLViewerTextureManager::getFetchedTexture(sculpt_id); if (texture) { - S32 texture_cost = (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f + 1)); + S32 texture_cost = 512 + (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f)); textures.insert(texture_cost_t::value_type(sculpt_id, texture_cost)); } } @@ -3075,7 +3075,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const { if (textures.find(img->getID()) == textures.end()) { - S32 texture_cost = (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f + 1)); + S32 texture_cost = 512 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f)); textures.insert(texture_cost_t::value_type(img->getID(), texture_cost)); } } -- cgit v1.2.3 From 24c353a1ad00366b9f4ce57492059ce8caf84ba0 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 22 Feb 2011 17:29:38 -0500 Subject: first pass at clouding avatars that are too complex --- indra/newview/llviewercontrol.cpp | 6 ++++++ indra/newview/llvoavatar.cpp | 16 ++++++++++++++++ indra/newview/llvoavatar.h | 2 ++ indra/newview/llvovolume.cpp | 10 +++++----- 4 files changed, 29 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index e319eba0ee..d99f3b6c88 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -165,6 +165,11 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) return true; } +bool handleRenderAvatarComplexityLimitChanged(const LLSD& newvalue) +{ + return true; +} + bool handleRenderTransparentWaterChanged(const LLSD& newvalue) { LLWorld::getInstance()->updateWaterObjects(); @@ -586,6 +591,7 @@ void settings_setup_listeners() gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderAvatarMaxVisible")->getSignal()->connect(boost::bind(&handleAvatarMaxVisibleChanged, _2)); + gSavedSettings.getControl("RenderAvatarComplexityLimit")->getSignal()->connect(boost::bind(&handleRenderAvatarComplexityLimitChanged, _2)); gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2)); gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _2)); gSavedSettings.getControl("RenderTerrainLODFactor")->getSignal()->connect(boost::bind(&handleTerrainLODChanged, _2)); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 856c068a44..be65af1e71 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6307,6 +6307,11 @@ BOOL LLVOAvatar::getIsCloud() { return TRUE; } + + if (isTooComplex()) + { + return TRUE; + } return FALSE; } @@ -6401,6 +6406,16 @@ BOOL LLVOAvatar::isFullyLoaded() const return mFullyLoaded; } +bool LLVOAvatar::isTooComplex() const +{ + if (gSavedSettings.getS32("RenderAvatarComplexityLimit") > 0 && mVisualComplexity >= gSavedSettings.getS32("RenderAvatarComplexityLimit")) + { + return true; + } + + return false; +} + //----------------------------------------------------------------------------- // findMotion() @@ -8338,6 +8353,7 @@ void LLVOAvatar::idleUpdateRenderCost() } setDebugText(llformat("%d", cost)); + mVisualComplexity = cost; F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f); mText->setColor(LLColor4(red,green,0,1)); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 1152475383..f41c385894 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -263,6 +263,7 @@ public: //-------------------------------------------------------------------- public: BOOL isFullyLoaded() const; + bool isTooComplex() const; bool visualParamWeightsAreDefault(); protected: virtual BOOL getIsCloud(); @@ -275,6 +276,7 @@ private: BOOL mPreviousFullyLoaded; BOOL mFullyLoadedInitialized; S32 mFullyLoadedFrameCounter; + S32 mVisualComplexity; LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; protected: diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e3dea5c788..f5b31d25ac 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2943,9 +2943,9 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const U32 num_triangles = 0; // per-prim costs - static const U32 ARC_PARTICLE_COST = 1; - static const U32 ARC_PARTICLE_MAX = 2048; - static const U32 ARC_TEXTURE_COST = 32; + static const U32 ARC_PARTICLE_COST = 1; // determined experimentally + static const U32 ARC_PARTICLE_MAX = 2048; // default values + static const U32 ARC_TEXTURE_COST = 32; // multiplier for texture resolution - performance tested // per-prim multipliers static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance @@ -2955,9 +2955,9 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const static const F32 ARC_INVISI_COST = 1.2f; // tested based on performance static const F32 ARC_WEIGHTED_MESH = 1.2f; - static const F32 ARC_PLANAR_COST = 1.2f; // 1.2x max + static const F32 ARC_PLANAR_COST = 1.0f; // tested based on performance to have negligible impact static const F32 ARC_ANIM_TEX_COST = 1.4f; // 1.4x max - static const F32 ARC_ALPHA_COST = 4.f; // 4x max + static const F32 ARC_ALPHA_COST = 4.f; // 4x max - based on performance F32 shame = 0; -- cgit v1.2.3 From d06cab548d7e4daa7a120692f64c10c05927143f Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 23 Feb 2011 12:56:05 -0500 Subject: forgot to add the new setting to settings.xml --- indra/newview/app_settings/settings.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d71b84739c..1bae39d5d7 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7046,7 +7046,18 @@ Value 1 - RenderAvatarLODFactor + RenderAvatarComplexityLimit + + Comment + Max visual complexity of avatars in a scens + Persist + 1 + Type + S32 + Value + -1 + + RenderAvatarLODFactor Comment Controls level of detail of avatars (multiplier for current screen area when calculated level of detail) -- cgit v1.2.3 From 77fff26431671ffef8cf482044b1fcd98262d3e0 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 23 Feb 2011 17:21:54 -0500 Subject: suppressing particles in overly complex avatars when clouding - they should appear as white spheres. --- indra/newview/llvoavatar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index be65af1e71..7dadf34a2a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2716,7 +2716,10 @@ void LLVOAvatar::idleUpdateLoadingEffect() LLPartData::LL_PART_EMISSIVE_MASK | // LLPartData::LL_PART_FOLLOW_SRC_MASK | LLPartData::LL_PART_TARGET_POS_MASK ); - setParticleSource(particle_parameters, getID()); + if (!isTooComplex()) // do not generate particles for overly-complex avatars + { + setParticleSource(particle_parameters, getID()); + } } } } -- cgit v1.2.3 From 844bf22d250833b000d306b9179580d6e032a632 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 23 Feb 2011 19:48:08 -0700 Subject: apply private pool to VBO --- indra/newview/llviewerwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index dfdf429455..8ce367efd2 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1489,6 +1489,7 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.setBOOL("RenderVBOEnable", FALSE); } LLVertexBuffer::initClass(gSavedSettings.getBOOL("RenderVBOEnable"), gSavedSettings.getBOOL("RenderVBOMappingDisable")); + gGL.init() ; if (LLFeatureManager::getInstance()->isSafe() || (gSavedSettings.getS32("LastFeatureVersion") != LLFeatureManager::getInstance()->getVersion()) -- cgit v1.2.3 From ae65347e3391be56b8919349a269e0abe52cf656 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 23 Feb 2011 20:11:01 -0700 Subject: fix an exit crash. --- indra/newview/llviewerwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8ce367efd2..b8f70e1705 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1877,9 +1877,7 @@ void LLViewerWindow::shutdownGL() llinfos << "All textures and llimagegl images are destroyed!" << llendl ; llinfos << "Cleaning up select manager" << llendl; - LLSelectMgr::getInstance()->cleanup(); - - LLVertexBuffer::cleanupClass(); + LLSelectMgr::getInstance()->cleanup(); llinfos << "Stopping GL during shutdown" << llendl; if (!gNoRender) @@ -1889,6 +1887,10 @@ void LLViewerWindow::shutdownGL() } gGL.shutdown(); + + LLVertexBuffer::cleanupClass(); + + llinfos << "LLVertexBuffer cleaned." << llendl ; } // shutdownViews() and shutdownGL() need to be called first -- cgit v1.2.3 From 29dc641fbe7ab77f77fe19e2e7976980f0649b5b Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 22 Mar 2011 20:39:31 -0400 Subject: initial effort to enable a debug display to show render complexity. Using for internal demo, will get it code reviewed if it merges in. --- indra/newview/llspatialpartition.cpp | 38 ++++++++++++++++++++++ indra/newview/llviewermenu.cpp | 4 +++ indra/newview/llviewerobjectlist.cpp | 4 +++ indra/newview/llvovolume.cpp | 18 ++++++++-- indra/newview/llvovolume.h | 10 +++++- indra/newview/pipeline.h | 1 + indra/newview/skins/default/xui/en/menu_viewer.xml | 10 ++++++ .../skins/default/xui/en/panel_region_terrain.xml | 34 +++++++++++++++++++ 8 files changed, 116 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5e7af6bbb3..b604908474 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2792,6 +2792,40 @@ void renderUpdateType(LLDrawable* drawablep) } } +void renderComplexityDisplay(LLDrawable* drawablep) +{ + LLViewerObject* vobj = drawablep->getVObj(); + if (!vobj) + { + return; + } + + LLVOVolume *voVol = dynamic_cast(vobj); + + if (!voVol) + { + return; + } + + LLVOVolume::texture_cost_t textures; + F32 cost = (F32) voVol->getRenderCost(textures) / (F32) LLVOVolume::getRenderComplexityMax(); + + LLGLEnable blend(GL_BLEND); + + F32 red = cost; + F32 green = 1.0f - cost; + + glColor4f(red,green,0,0.5f); + + S32 num_faces = drawablep->getNumFaces(); + if (num_faces) + { + for (S32 i = 0; i < num_faces; ++i) + { + pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX); + } + } +} void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) { @@ -3906,6 +3940,10 @@ public: { renderUpdateType(drawable); } + if(gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY)) + { + renderComplexityDisplay(drawable); + } LLVOAvatar* avatar = dynamic_cast(drawable->getVObj().get()); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f5b0857425..30be2fb8e0 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -993,6 +993,10 @@ U32 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_AGENT_TARGET; } + else if ("" == info_display) + { + return LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY; + } else { return 0; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 0071753831..2e8eb9f4a8 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -58,6 +58,7 @@ #include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerstatsrecorder.h" +#include "llvovolume.h" #include "llvoavatarself.h" #include "lltoolmgr.h" #include "lltoolpie.h" @@ -997,6 +998,9 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) mNumSizeCulled = 0; mNumVisCulled = 0; + // update max computed render cost + LLVOVolume::updateRenderComplexity(); + // compute all sorts of time-based stats // don't factor frames that were paused into the stats if (! mWasPaused) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e2d1850e58..7c772ce835 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -87,6 +87,8 @@ F32 LLVOVolume::sLODFactor = 1.f; F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop F32 LLVOVolume::sDistanceFactor = 1.0f; S32 LLVOVolume::sNumLODChanges = 0; +S32 LLVOVolume::mRenderComplexity_last = 0; +S32 LLVOVolume::mRenderComplexity_current = 0; LLPointer LLVOVolume::sObjectMediaClient = NULL; LLPointer LLVOVolume::sObjectMediaNavigateClient = NULL; @@ -3206,6 +3208,11 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const shame += num_particles * part_size * ARC_PARTICLE_COST; } + if (shame > mRenderComplexity_current) + { + mRenderComplexity_current = (S32)shame; + } + return (U32)shame; } @@ -3223,7 +3230,14 @@ F32 LLVOVolume::getStreamingCost() return 0.f; } -U32 LLVOVolume::getTriangleCount() +//static +void LLVOVolume::updateRenderComplexity() +{ + mRenderComplexity_last = mRenderComplexity_current; + mRenderComplexity_current = 0; +} + +U32 LLVOVolume::getTriangleCount() const { U32 count = 0; LLVolume* volume = getVolume(); @@ -4068,7 +4082,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if ( bindCnt > 0 ) { const int jointCnt = pSkinData->mJointNames.size(); - const int pelvisZOffset = pSkinData->mPelvisOffset; + const int pelvisZOffset = (int)pSkinData->mPelvisOffset; bool fullRig = (jointCnt>=20) ? true : false; if ( fullRig ) { diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 5af88c6cbd..57faee556f 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -132,7 +132,7 @@ public: typedef std::map texture_cost_t; U32 getRenderCost(texture_cost_t &textures) const; /*virtual*/ F32 getStreamingCost(); - /*virtual*/ U32 getTriangleCount(); + /*virtual*/ U32 getTriangleCount() const; /*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, @@ -320,11 +320,19 @@ protected: LLFace* addFace(S32 face_index); void updateTEData(); + // stats tracking for render complexity + static S32 mRenderComplexity_last; + static S32 mRenderComplexity_current; + void requestMediaDataUpdate(bool isNew); void cleanUpMediaImpls(); void addMediaImpl(LLViewerMediaImpl* media_impl, S32 texture_index) ; void removeMediaImpl(S32 texture_index) ; public: + + static S32 getRenderComplexityMax() {return mRenderComplexity_last;} + static void updateRenderComplexity(); + LLViewerTextureAnim *mTextureAnimp; U8 mTexAnimMode; private: diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index be58af947c..02bb6d618e 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -448,6 +448,7 @@ public: RENDER_DEBUG_PHYSICS_SHAPES = 0x1000000, RENDER_DEBUG_NORMALS = 0x2000000, RENDER_DEBUG_LOD_INFO = 0x4000000, + RENDER_DEBUG_RENDER_COMPLEXITY = 0x8000000 }; public: diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index ea40a08c95..7a227fb5f9 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2338,6 +2338,16 @@ function="Advanced.ToggleInfoDisplay" parameter="raycast" /> + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_region_terrain.xml b/indra/newview/skins/default/xui/en/panel_region_terrain.xml index bbb8b40594..5d060c0a0d 100644 --- a/indra/newview/skins/default/xui/en/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml @@ -193,7 +193,7 @@ + -- cgit v1.2.3 From 02658d9725435ee14b21183365388deacb5e88e5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 1 Sep 2011 16:12:39 -0700 Subject: EXP-1001 FIX -- Newness is removed on next login if you log out or crash before opening inventory panel EXP-1148 FIX -- New Tags can show in incorrect locations when opening folder with drop down arrow in Received Items panel EXP-1163 FIX -- When ordering a Direct Delivery item in Basic Mode, item is not shown as new on login to Advanced mode EXP-1172 FIX -- New tags not displayed for items delivered while not logged in on next login to viewer EXP-1173 FIX -- New tags are removed for all new items when Inventory side panel is opened * New tag now set when an item folder is added to the inbox. * Update to new tag only happens when a valid date exists. * Inbox collapsed time now only set when inbox panel is in a visible chain. --- indra/newview/llpanelmarketplaceinbox.cpp | 2 +- indra/newview/llpanelmarketplaceinboxinventory.cpp | 40 +++++++++++++--------- indra/newview/llpanelmarketplaceinboxinventory.h | 4 +-- indra/newview/llsidepanelinventory.cpp | 6 ++-- indra/newview/llsidetray.cpp | 2 +- 5 files changed, 31 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 5a835eadf1..a73742b68f 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -53,7 +53,7 @@ LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() { - if (getVisible() && getChild("inbox_btn")->getToggleState()) + if (isInVisibleChain() && getChild("inbox_btn")->getToggleState()) { gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index e2f8af1280..f6a4b6e26b 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -173,19 +173,6 @@ LLInboxFolderViewFolder::~LLInboxFolderViewFolder() { } -// virtual -time_t LLInboxFolderViewFolder::getCreationDate() const -{ - time_t ret_val = LLFolderViewFolder::getCreationDate(); - - if (!mCreationDate) - { - updateFlag(); - } - - return ret_val; -} - // virtual void LLInboxFolderViewFolder::draw() { @@ -201,32 +188,53 @@ void LLInboxFolderViewFolder::draw() LLFolderViewFolder::draw(); } +BOOL LLInboxFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) +{ + BOOL retval = LLFolderViewFolder::addToFolder(folder, root); + + // Only mark top-level inbox folders as fresh + mFresh = (mParentFolder == mRoot); + + return retval; +} + void LLInboxFolderViewFolder::updateFlag() const { const std::string& last_collapse = gSavedPerAccountSettings.getString("LastInventoryInboxCollapse"); + if (!last_collapse.empty()) { LLDate saved_freshness_date = LLDate(last_collapse); + //llinfos << "Saved freshness: " << saved_freshness_date.secondsSinceEpoch() << llendl; + mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch()); + + //llinfos << " Creation date: " << mCreationDate << " -- fresh -- " << mFresh << " -- this -- " << (void*)&*(this) << llendl; } } void LLInboxFolderViewFolder::selectItem() { - mFresh = false; LLFolderViewFolder::selectItem(); + + mFresh = false; } void LLInboxFolderViewFolder::toggleOpen() { - mFresh = false; LLFolderViewFolder::toggleOpen(); + + mFresh = false; } void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const { mCreationDate = creation_date_utc; - updateFlag(); + + if (mFresh) + { + updateFlag(); + } } // diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 6cb243dbd5..06706539a0 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -73,10 +73,10 @@ public: LLInboxFolderViewFolder(const Params& p); ~LLInboxFolderViewFolder(); - time_t getCreationDate() const; - void draw(); + BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); + void updateFlag() const; void selectItem(); void toggleOpen(); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 9290b7ebef..a8a9f4948b 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -500,7 +500,7 @@ bool LLSidepanelInventory::manageInboxOutboxPanels(LLButton * pressedButton, LLL else { // NOTE: This is an attempt to reshape the inventory panel to the proper size but it doesn't seem to propagate - // propery to the child panels. + // properly to the child panels. S32 new_height = inout_panel->getRect().getHeight(); @@ -527,7 +527,7 @@ void LLSidepanelInventory::onToggleInboxBtn() bool inbox_expanded = manageInboxOutboxPanels(inboxButton, inboxPanel, outboxButton, outboxPanel); - if (!inbox_expanded && inboxPanel->getVisible()) + if (!inbox_expanded && inboxPanel->isInVisibleChain()) { gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); } @@ -543,7 +543,7 @@ void LLSidepanelInventory::onToggleOutboxBtn() bool inbox_was_expanded = inboxButton->getToggleState(); manageInboxOutboxPanels(outboxButton, outboxPanel, inboxButton, inboxPanel); - if (inbox_was_expanded && inboxPanel->getVisible()) + if (inbox_was_expanded && inboxPanel->isInVisibleChain()) { gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); } diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 651897a217..363c8543ed 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -1442,7 +1442,7 @@ void LLSideTray::updateSidetrayVisibility() parent->setVisible(new_visibility); // Signal change of visible width. - llinfos << "Visible: " << new_visibility << llendl; + //llinfos << "Visible: " << new_visibility << llendl; mVisibleWidthChangeSignal(this, new_visibility); } } -- cgit v1.2.3 From 16b34829993c1d59aaeeeafaea68c9aa8e0a5035 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 1 Sep 2011 16:47:14 -0700 Subject: * Changing inbox item "new" tag to off by default rather than on to eliminate false positives. --- indra/newview/llpanelmarketplaceinboxinventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index f6a4b6e26b..e5fe2d0504 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -162,7 +162,7 @@ LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * b LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) : LLFolderViewFolder(p) , LLBadgeOwner(getHandle()) - , mFresh(true) + , mFresh(false) { #if SUPPORTING_FRESH_ITEM_COUNT initBadgeParams(p.new_badge()); -- cgit v1.2.3 From 512c057c2d70314f5c9786e4c5e89ffc05d38190 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 2 Sep 2011 15:43:25 +0300 Subject: VWR-26823 FIXED Removed DigiNotar CA certificate. --- indra/newview/app_settings/CA.pem | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/CA.pem b/indra/newview/app_settings/CA.pem index 6140842a7f..a16b4225e5 100644 --- a/indra/newview/app_settings/CA.pem +++ b/indra/newview/app_settings/CA.pem @@ -4587,38 +4587,6 @@ zo9uoV1/A3U05K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATy wy39FCqQmbkHzJ8= -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- -MIIFijCCA3KgAwIBAgIQDHbanJEMTiye/hXQWJM8TDANBgkqhkiG9w0BAQUFADBf -MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp -Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww -HhcNMDcwNTE2MTcxOTM2WhcNMjUwMzMxMTgxOTIxWjBfMQswCQYDVQQGEwJOTDES -MBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90YXIgUm9vdCBDQTEg -MB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwggIiMA0GCSqGSIb3DQEB -AQUAA4ICDwAwggIKAoICAQCssFjBAL3YIQgLK5r+blYwBZ8bd5AQQVzDDYcRd46B -8cp86Yxq7Th0Nbva3/m7wAk3tJZzgX0zGpg595NvlX89ubF1h7pRSOiLcD6VBMXY -tsMW2YiwsYcdcNqGtA8Ui3rPENF0NqISe3eGSnnme98CEWilToauNFibJBN4ViIl -HgGLS1Fx+4LMWZZpiFpoU8W5DQI3y0u8ZkqQfioLBQftFl9VkHXYRskbg+IIvvEj -zJkd1ioPgyAVWCeCLvriIsJJsbkBgWqdbZ1Ad2h2TiEqbYRAhU52mXyC8/O3AlnU -JgEbjt+tUwbRrhjd4rI6y9eIOI6sWym5GdOY+RgDz0iChmYLG2kPyes4iHomGgVM -ktck1JbyrFIto0fVUvY//s6EBnCmqj6i8rZWNBhXouSBbefK8GrTx5FrAoNBfBXv -a5pkXuPQPOWx63tdhvvL5ndJzaNl3Pe5nLjkC1+Tz8wwGjIczhxjlaX56uF0i57p -K6kwe6AYHw4YC+VbqdPRbB4HZ4+RS6mKvNJmqpMBiLKR+jFc1abBUggJzQpjotMi -puih2TkGl/VujQKQjBR7P4DNG5y6xFhyI6+2Vp/GekIzKQc/gsnmHwUNzUwoNovT -yD4cxojvXu6JZOkd69qJfjKmadHdzIif0dDJZiHcBmfFlHqabWJMfczgZICynkeO -owIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV -HQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wDQYJKoZIhvcNAQEFBQADggIBADsC -jcs8MOhuoK3yc7NfniUTBAXT9uOLuwt5zlPe5JbF0a9zvNXD0EBVfEB/zRtfCdXy -fJ9oHbtdzno5wozWmHvFg1Wo1X1AyuAe94leY12hE8JdiraKfADzI8PthV9xdvBo -Y6pFITlIYXg23PFDk9Qlx/KAZeFTAnVR/Ho67zerhChXDNjU1JlWbOOi/lmEtDHo -M/hklJRRl6s5xUvt2t2AC298KQ3EjopyDedTFLJgQT2EkTFoPSdE2+Xe9PpjRchM -Ppj1P0G6Tss3DbpmmPHdy59c91Q2gmssvBNhl0L4eLvMyKKfyvBovWsdst+Nbwed -2o5nx0ceyrm/KkKRt2NTZvFCo+H0Wk1Ya7XkpDOtXHAd3ODy63MUkZoDweoAZbwH -/M8SESIsrqC9OuCiKthZ6SnTGDWkrBFfGbW1G/8iSlzGeuQX7yCpp/Q/rYqnmgQl -nQ7KN+ZQ/YxCKQSa7LnPS3K94gg2ryMvYuXKAdNw23yCIywWMQzGNgeQerEfZ1jE -O1hZibCMjFCz2IbLaKPECudpSyDOwR5WS5WpI2jYMNjD67BVUc3l/Su49bsRn1NU -9jQZjHkJNsphFyUXC4KYcwx3dMPVDceoEkzHp1RxRy4sGn3J4ys7SN4nhKdjNrN9 -j6BkOSQNPXuHr2ZcdBtLc7LljPCGmbjlxd+Ewbfr ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJO TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFh dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEy -- cgit v1.2.3 From 5da2d4c85370ebe1a14ecbebd8e5df7965e9d02e Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Fri, 2 Sep 2011 17:14:07 +0300 Subject: SH-2309 WIP Priority modifications to mesh uploader UI - Changed representation of Retain% control values - Added "Choose one..." item to the LOD combo_box --- indra/newview/llfloatermodelpreview.cpp | 24 ++++++++++++++++------ .../skins/default/xui/en/floater_model_preview.xml | 2 ++ 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 362a40632a..2d18c2bb24 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -119,6 +119,7 @@ const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PRE const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16; const S32 PREVIEW_TEXTURE_HEIGHT = 300; +const double RETAIN_COEFFICIENT = 100; void drawBoxOutline(const LLVector3& pos, const LLVector3& size); @@ -907,7 +908,15 @@ void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data) { LLCDParam* param = (LLCDParam*) data; std::string name(param->mName); - sInstance->mDecompParams[name] = ctrl->getValue(); + + LLSD value = ctrl->getValue(); + + if("Retain%" == name) + { + value = ctrl->getValue().asReal() / RETAIN_COEFFICIENT; + } + + sInstance->mDecompParams[name] = value; if (name == "Simplify Method") { @@ -980,7 +989,7 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata) //static void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata) { - S32 num_modes = 3; + S32 num_modes = 4; S32 which_mode = 3; static S32 previous_mode = which_mode; @@ -1115,10 +1124,13 @@ void LLFloaterModelPreview::initDecompControls() } else if (LLSpinCtrl* spinner = dynamic_cast(ctrl)) { - spinner->setMinValue(param[i].mDetails.mRange.mLow.mFloat); - spinner->setMaxValue(param[i].mDetails.mRange.mHigh.mFloat); - spinner->setIncrement(param[i].mDetails.mRange.mDelta.mFloat); - spinner->setValue(param[i].mDefault.mFloat); + bool is_retain_ctrl = "Retain%" == name; + double coefficient = is_retain_ctrl ? RETAIN_COEFFICIENT : 1.f; + + spinner->setMinValue(param[i].mDetails.mRange.mLow.mFloat * coefficient); + spinner->setMaxValue(param[i].mDetails.mRange.mHigh.mFloat * coefficient); + spinner->setIncrement(param[i].mDetails.mRange.mDelta.mFloat * coefficient); + spinner->setValue(param[i].mDefault.mFloat * coefficient); spinner->setCommitCallback(onPhysicsParamCommit, (void*) ¶m[i]); } else if (LLComboBox* combo_box = dynamic_cast(ctrl)) diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index d613e42786..39ef844824 100755 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -305,6 +305,7 @@ name="physics_lod_combo" width="130" tool_tip="LOD to use for physics shape"> + Choose one... High Medium Low @@ -521,6 +522,7 @@ width="60"/> Date: Fri, 2 Sep 2011 17:36:54 +0300 Subject: SH-2309 Model preview floater LoD tab updated. - Combo boxes for LoD source added for each level - New option "Use LoD above" added for copying the model from higher LoDs. - Various LoD settings and related controls removed. --- indra/newview/llfloatermodelpreview.cpp | 389 ++++------ indra/newview/llfloatermodelpreview.h | 17 +- .../skins/default/xui/en/floater_model_preview.xml | 790 ++++++++++++++++----- 3 files changed, 780 insertions(+), 416 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 2d18c2bb24..e687b1954c 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -396,21 +396,23 @@ BOOL LLFloaterModelPreview::postBuild() return FALSE; } - childSetAction("lod_browse", onBrowseLOD, this); - childSetCommitCallback("cancel_btn", onCancel, this); childSetCommitCallback("crease_angle", onGenerateNormalsCommit, this); - childSetCommitCallback("generate_normals", onGenerateNormalsCommit, this); + getChild("gen_normals")->setCommitCallback(boost::bind(&LLFloaterModelPreview::toggleGenarateNormals, this)); childSetCommitCallback("lod_generate", onAutoFillCommit, this); - childSetCommitCallback("lod_mode", onLODParamCommit, this); - childSetCommitCallback("lod_error_threshold", onLODParamCommit, this); - childSetCommitCallback("lod_triangle_limit", onLODParamCommitTriangleLimit, this); - childSetCommitCallback("build_operator", onLODParamCommit, this); - childSetCommitCallback("queue_mode", onLODParamCommit, this); - childSetCommitCallback("border_mode", onLODParamCommit, this); - childSetCommitCallback("share_tolerance", onLODParamCommit, this); + for (S32 lod = 0; lod <= LLModel::LOD_HIGH; ++lod) + { + LLComboBox* lod_source_combo = getChild("lod_source_" + lod_name[lod]); + lod_source_combo->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLoDSourceCommit, this, lod)); + lod_source_combo->setCurrentByIndex(mLODMode[lod]); + + getChild("lod_browse_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onBrowseLOD, this, lod)); + getChild("lod_mode_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, false)); + getChild("lod_error_threshold_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, false)); + getChild("lod_triangle_limit_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, true)); + } childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); @@ -431,10 +433,6 @@ BOOL LLFloaterModelPreview::postBuild() childSetCommitCallback("import_scale", onImportScaleCommit, this); childSetCommitCallback("pelvis_offset", onPelvisOffsetCommit, this); - childSetCommitCallback("lod_file_or_limit", refresh, this); - //childSetCommitCallback("physics_optimize", refresh, this); - //childSetCommitCallback("physics_use_hull", refresh, this); - getChild("show_edges")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1)); getChild("show_physics")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1)); getChild("show_textures")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1)); @@ -694,6 +692,12 @@ void LLFloaterModelPreview::onGenerateNormalsCommit(LLUICtrl* ctrl, void* userda fp->mModelPreview->generateNormals(); } +void LLFloaterModelPreview::toggleGenarateNormals() +{ + bool enabled = childGetValue("gen_normals").asBoolean(); + childSetEnabled("crease_angle", enabled); +} + //static void LLFloaterModelPreview::onExplodeCommit(LLUICtrl* ctrl, void* userdata) { @@ -710,19 +714,9 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata) fp->mModelPreview->genLODs(); } -//static -void LLFloaterModelPreview::onLODParamCommit(LLUICtrl* ctrl, void* userdata) -{ - LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata; - - fp->mModelPreview->onLODParamCommit(false); -} - -//static -void LLFloaterModelPreview::onLODParamCommitTriangleLimit(LLUICtrl* ctrl, void* userdata) +void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit) { - LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata; - fp->mModelPreview->onLODParamCommit(true); + mModelPreview->onLODParamCommit(lod, enforce_tri_limit); } @@ -3484,7 +3478,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable if (lod == mPreviewLOD) { - mFMP->childSetText("lod_file", mLODFile[mPreviewLOD]); + mFMP->childSetText("lod_file_" + lod_name[lod], mLODFile[lod]); } else if (lod == LLModel::LOD_PHYSICS) { @@ -3782,21 +3776,21 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim U32 lod_mode = 0; - LLCtrlSelectionInterface* iface = mFMP->childGetSelectionInterface("lod_mode"); + LLCtrlSelectionInterface* iface = mFMP->childGetSelectionInterface("lod_mode_" + lod_name[which_lod]); if (iface) { lod_mode = iface->getFirstSelectedIndex(); } mRequestedLoDMode[mPreviewLOD] = lod_mode; - F32 lod_error_threshold = mFMP->childGetValue("lod_error_threshold").asReal(); + F32 lod_error_threshold = mFMP->childGetValue("lod_error_threshold_" + lod_name[which_lod]).asReal(); if (lod_mode == 0) { lod_mode = GLOD_TRIANGLE_BUDGET; if (which_lod != -1) { - limit = mFMP->childGetValue("lod_triangle_limit").asInteger(); + limit = mFMP->childGetValue("lod_triangle_limit_" + lod_name[which_lod]).asInteger(); } } else @@ -3804,89 +3798,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim lod_mode = GLOD_ERROR_THRESHOLD; } - U32 build_operator = 0; - - iface = mFMP->childGetSelectionInterface("build_operator"); - if (iface) - { - build_operator = iface->getFirstSelectedIndex(); - } - mRequestedBuildOperator[mPreviewLOD] = build_operator; - - if (build_operator == 0) - { - build_operator = GLOD_OPERATOR_EDGE_COLLAPSE; - } - else - { - build_operator = GLOD_OPERATOR_HALF_EDGE_COLLAPSE; - } - - U32 queue_mode=0; - iface = mFMP->childGetSelectionInterface("queue_mode"); - if (iface) - { - queue_mode = iface->getFirstSelectedIndex(); - } - mRequestedQueueMode[mPreviewLOD] = queue_mode; - - if (queue_mode == 0) - { - queue_mode = GLOD_QUEUE_GREEDY; - } - else if (queue_mode == 1) - { - queue_mode = GLOD_QUEUE_LAZY; - } - else - { - queue_mode = GLOD_QUEUE_INDEPENDENT; - } - - U32 border_mode = 0; - - iface = mFMP->childGetSelectionInterface("border_mode"); - if (iface) - { - border_mode = iface->getFirstSelectedIndex(); - } - mRequestedBorderMode[mPreviewLOD] = border_mode; - - if (border_mode == 0) - { - border_mode = GLOD_BORDER_UNLOCK; - } - else - { - border_mode = GLOD_BORDER_LOCK; - } - bool object_dirty = false; - if (border_mode != mBuildBorderMode) - { - mBuildBorderMode = border_mode; - object_dirty = true; - } - - if (queue_mode != mBuildQueueMode) - { - mBuildQueueMode = queue_mode; - object_dirty = true; - } - - if (build_operator != mBuildOperator) - { - mBuildOperator = build_operator; - object_dirty = true; - } - - F32 share_tolerance = mFMP->childGetValue("share_tolerance").asReal(); - if (share_tolerance != mBuildShareTolerance) - { - mBuildShareTolerance = share_tolerance; - object_dirty = true; - } - mRequestedShareTolerance[mPreviewLOD] = share_tolerance; if (mGroup == 0) { @@ -3936,18 +3848,6 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim stop_gloderror(); } - glodObjectParameteri(mObject[mdl], GLOD_BUILD_OPERATOR, build_operator); - stop_gloderror(); - - glodObjectParameteri(mObject[mdl], GLOD_BUILD_QUEUE_MODE, queue_mode); - stop_gloderror(); - - glodObjectParameteri(mObject[mdl], GLOD_BUILD_BORDER_MODE, border_mode); - stop_gloderror(); - - glodObjectParameterf(mObject[mdl], GLOD_BUILD_SHARE_TOLERANCE, share_tolerance); - stop_gloderror(); - glodBuildObject(mObject[mdl]); stop_gloderror(); } @@ -4489,147 +4389,140 @@ void LLModelPreview::updateStatusMessages() } } + if (mFMP->childGetValue("physics_lod_combo").asString() == "From file") + { + mFMP->childEnable("physics_file"); + mFMP->childEnable("physics_browse"); + } + else + { + mFMP->childDisable("physics_file"); + mFMP->childDisable("physics_browse"); + } + + LLSpinCtrl* crease = mFMP->getChild("crease_angle"); + + if (mRequestedCreaseAngle[mPreviewLOD] == -1.f) + { + mFMP->childSetColor("crease_label", LLColor4::grey); + crease->forceSetValue(75.f); + } + else + { + mFMP->childSetColor("crease_label", LLColor4::white); + crease->forceSetValue(mRequestedCreaseAngle[mPreviewLOD]); + } + + mModelUpdatedSignal(true); + +} + +void LLModelPreview::updateLodControls(S32 lod) +{ const char* lod_controls[] = { - "lod_mode", - "lod_triangle_limit", - "lod_error_tolerance", - "build_operator_text", - "queue_mode_text", - "border_mode_text", - "share_tolerance_text", - "build_operator", - "queue_mode", - "border_mode", - "share_tolerance" + "lod_mode_", + "lod_triangle_limit_", }; const U32 num_lod_controls = sizeof(lod_controls)/sizeof(char*); const char* file_controls[] = { - "lod_browse", - "lod_file" + "lod_browse_", + "lod_file_", }; const U32 num_file_controls = sizeof(file_controls)/sizeof(char*); - if (fmp) + LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance; + if (!fmp) return; + + LLComboBox* lod_combo = mFMP->findChild("lod_source_" + lod_name[lod]); + if (!lod_combo) return; + + S32 lod_mode = lod_combo->getCurrentIndex(); + if (lod_mode == 0) // LoD from file { - //enable/disable controls based on radio groups - if (mFMP->childGetValue("lod_from_file").asBoolean()) - { - fmp->mLODMode[mPreviewLOD] = 0; - for (U32 i = 0; i < num_file_controls; ++i) - { - mFMP->childEnable(file_controls[i]); - } + fmp->mLODMode[lod] = 0; + for (U32 i = 0; i < num_file_controls; ++i) + { + mFMP->childShow(file_controls[i] + lod_name[lod]); + } - for (U32 i = 0; i < num_lod_controls; ++i) - { - mFMP->childDisable(lod_controls[i]); - } + for (U32 i = 0; i < num_lod_controls; ++i) + { + mFMP->childHide(lod_controls[i] + lod_name[lod]); + } + } + else if (lod_mode == 2) // use LoD above + { + fmp->mLODMode[lod] = 2; + for (U32 i = 0; i < num_file_controls; ++i) + { + mFMP->childHide(file_controls[i] + lod_name[lod]); } - else if (mFMP->childGetValue("lod_none").asBoolean()) + + for (U32 i = 0; i < num_lod_controls; ++i) { - fmp->mLODMode[mPreviewLOD] = 2; - for (U32 i = 0; i < num_file_controls; ++i) - { - mFMP->childDisable(file_controls[i]); - } + mFMP->childHide(lod_controls[i] + lod_name[lod]); + } - for (U32 i = 0; i < num_lod_controls; ++i) - { - mFMP->childDisable(lod_controls[i]); - } + if (lod < LLModel::LOD_HIGH) + { + mModel[lod] = mModel[lod + 1]; + mScene[lod] = mScene[lod + 1]; + mVertexBuffer[lod].clear(); - if (!mModel[mPreviewLOD].empty()) + // Also update lower LoD + if (lod > LLModel::LOD_IMPOSTOR) { - mModel[mPreviewLOD].clear(); - mScene[mPreviewLOD].clear(); - mVertexBuffer[mPreviewLOD].clear(); - - //this can cause phasing issues with the UI, so reenter this function and return - updateStatusMessages(); - return; + updateLodControls(lod - 1); } } - else - { // auto generate, also the default case for wizard which has no radio selection - fmp->mLODMode[mPreviewLOD] = 1; + } + else // auto generate, the default case for all LoDs except High + { + fmp->mLODMode[lod] = 1; - //don't actually regenerate lod when refreshing UI - mLODFrozen = true; + //don't actually regenerate lod when refreshing UI + mLODFrozen = true; - for (U32 i = 0; i < num_file_controls; ++i) - { - mFMP->childDisable(file_controls[i]); - } + for (U32 i = 0; i < num_file_controls; ++i) + { + mFMP->childHide(file_controls[i] + lod_name[lod]); + } - for (U32 i = 0; i < num_lod_controls; ++i) - { - mFMP->childEnable(lod_controls[i]); - } + for (U32 i = 0; i < num_lod_controls; ++i) + { + mFMP->childShow(lod_controls[i] + lod_name[lod]); + } - //if (threshold) - { - LLSpinCtrl* threshold = mFMP->getChild("lod_error_threshold"); - LLSpinCtrl* limit = mFMP->getChild("lod_triangle_limit"); - limit->setMaxValue(mMaxTriangleLimit); - limit->forceSetValue(mRequestedTriangleCount[mPreviewLOD]); + LLSpinCtrl* threshold = mFMP->getChild("lod_error_threshold_" + lod_name[lod]); + LLSpinCtrl* limit = mFMP->getChild("lod_triangle_limit_" + lod_name[lod]); - threshold->forceSetValue(mRequestedErrorThreshold[mPreviewLOD]); + limit->setMaxValue(mMaxTriangleLimit); + limit->forceSetValue(mRequestedTriangleCount[lod]); - mFMP->getChild("lod_mode")->selectNthItem(mRequestedLoDMode[mPreviewLOD]); - mFMP->getChild("build_operator")->selectNthItem(mRequestedBuildOperator[mPreviewLOD]); - mFMP->getChild("queue_mode")->selectNthItem(mRequestedQueueMode[mPreviewLOD]); - mFMP->getChild("border_mode")->selectNthItem(mRequestedBorderMode[mPreviewLOD]); - mFMP->getChild("share_tolerance")->setValue(mRequestedShareTolerance[mPreviewLOD]); + threshold->forceSetValue(mRequestedErrorThreshold[lod]); - if (mRequestedLoDMode[mPreviewLOD] == 0) - { - limit->setVisible(true); - threshold->setVisible(false); + mFMP->getChild("lod_mode_" + lod_name[lod])->selectNthItem(mRequestedLoDMode[lod]); - limit->setMaxValue(mMaxTriangleLimit); - limit->setIncrement(mMaxTriangleLimit/32); - } - else - { - limit->setVisible(false); - threshold->setVisible(true); - } - } + if (mRequestedLoDMode[lod] == 0) + { + limit->setVisible(true); + threshold->setVisible(false); - mLODFrozen = false; + limit->setMaxValue(mMaxTriangleLimit); + limit->setIncrement(mMaxTriangleLimit/32); + } + else + { + limit->setVisible(false); + threshold->setVisible(true); } - } - - if (mFMP->childGetValue("physics_lod_combo").asString() == "From file") - { - mFMP->childEnable("physics_file"); - mFMP->childEnable("physics_browse"); - } - else - { - mFMP->childDisable("physics_file"); - mFMP->childDisable("physics_browse"); - } - LLSpinCtrl* crease = mFMP->getChild("crease_angle"); - - if (mRequestedCreaseAngle[mPreviewLOD] == -1.f) - { - mFMP->childSetColor("crease_label", LLColor4::grey); - crease->forceSetValue(75.f); - } - else - { - mFMP->childSetColor("crease_label", LLColor4::white); - crease->forceSetValue(mRequestedCreaseAngle[mPreviewLOD]); + mLODFrozen = false; } - - mModelUpdatedSignal(true); - } void LLModelPreview::setPreviewTarget(F32 distance) @@ -5484,8 +5377,7 @@ void LLModelPreview::setPreviewLOD(S32 lod) LLComboBox* combo_box = mFMP->getChild("preview_lod_combo"); combo_box->setCurrentByIndex((NUM_LOD-1)-mPreviewLOD); // combo box list of lods is in reverse order - mFMP->childSetTextArg("lod_table_footer", "[DETAIL]", mFMP->getString(lod_name[mPreviewLOD])); - mFMP->childSetText("lod_file", mLODFile[mPreviewLOD]); + mFMP->childSetText("lod_file_" + lod_name[mPreviewLOD], mLODFile[mPreviewLOD]); // the wizard has three lod drop downs LLComboBox* combo_box2 = mFMP->getChild("preview_lod_combo2"); @@ -5506,25 +5398,16 @@ void LLModelPreview::setPreviewLOD(S32 lod) mFMP->childSetColor(lod_triangles_name[i], color); mFMP->childSetColor(lod_vertices_name[i], color); } - - LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance; - if (fmp) - { - LLRadioGroup* radio = fmp->getChild("lod_file_or_limit"); - radio->selectNthItem(fmp->mLODMode[mPreviewLOD]); - } } refresh(); updateStatusMessages(); } -//static -void LLFloaterModelPreview::onBrowseLOD(void* data) +void LLFloaterModelPreview::onBrowseLOD(S32 lod) { assert_main_thread(); - LLFloaterModelPreview* mp = (LLFloaterModelPreview*) data; - mp->loadModel(mp->mModelPreview->mPreviewLOD); + loadModel(lod); } //static @@ -5566,8 +5449,7 @@ void LLFloaterModelPreview::onUpload(void* user_data) } -//static -void LLFloaterModelPreview::refresh(LLUICtrl* ctrl, void* user_data) +void LLFloaterModelPreview::refresh() { sInstance->toggleCalculateButton(true); sInstance->mModelPreview->mDirty = true; @@ -5588,11 +5470,12 @@ void LLModelPreview::textureLoadedCallback( BOOL success, LLViewerFetchedTexture } } -void LLModelPreview::onLODParamCommit(bool enforce_tri_limit) +void LLModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit) { if (!mLODFrozen) { - genLODs(mPreviewLOD, 3, enforce_tri_limit); + genLODs(lod, 3, enforce_tri_limit); + updateLodControls(lod); updateStatusMessages(); refresh(); } @@ -5655,6 +5538,12 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible) } } +void LLFloaterModelPreview::onLoDSourceCommit(S32 lod) +{ + mModelPreview->updateLodControls(lod); + refresh(); +} + void LLFloaterModelPreview::resetDisplayOptions() { std::map::iterator option_it = mModelPreview->mViewOption.begin(); diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index f93d3b9482..d93940efc2 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -176,13 +176,13 @@ public: void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost); - static void onBrowseLOD(void* data); + void onBrowseLOD(S32 lod); static void onReset(void* data); static void onUpload(void* data); - static void refresh(LLUICtrl* ctrl, void* data); + void refresh(); void loadModel(S32 lod); void loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false); @@ -222,10 +222,12 @@ protected: static void onGenerateNormalsCommit(LLUICtrl*,void*); + void toggleGenarateNormals(); + static void onAutoFillCommit(LLUICtrl*,void*); - static void onLODParamCommit(LLUICtrl*,void*); - static void onLODParamCommitTriangleLimit(LLUICtrl*,void*); + void onLODParamCommit(S32 lod, bool enforce_tri_limit); + static void onExplodeCommit(LLUICtrl*, void*); static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata); @@ -264,7 +266,7 @@ protected: //store which lod mode each LOD is using // 0 - load from file // 1 - auto generate - // 2 - None + // 2 - use LoD above S32 mLODMode[4]; LLMutex* mStatusLock; @@ -275,6 +277,8 @@ private: void onClickCalculateBtn(); void toggleCalculateButton(); + void onLoDSourceCommit(S32 lod); + // Toggles between "Calculate weights & fee" and "Upload" buttons. void toggleCalculateButton(bool visible); @@ -335,8 +339,9 @@ public: void saveUploadData(const std::string& filename, bool save_skinweights, bool save_joint_poisitions); void clearIncompatible(S32 lod); void updateStatusMessages(); + void updateLodControls(S32 lod); void clearGLODGroup(); - void onLODParamCommit(bool enforce_tri_limit); + void onLODParamCommit(S32 lod, bool enforce_tri_limit); const bool getModelPivot( void ) const { return mHasPivot; } void setHasPivot( bool val ) { mHasPivot = val; } diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 39ef844824..21feb9908e 100755 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -100,166 +100,636 @@ name="import_tab" tab_position="top"> - - LOD TABLE - - - - Select Level of Detail: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Level of Detail: [DETAIL] - - - - - - - LOD MESH - - - - Mesh - - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml index 48b987d7e8..ab3de1eaab 100644 --- a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml +++ b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml @@ -1,7 +1,7 @@ + name="colorswatch"> diff --git a/indra/newview/skins/default/xui/en/widgets/layout_stack.xml b/indra/newview/skins/default/xui/en/widgets/layout_stack.xml new file mode 100644 index 0000000000..48bcb46533 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/layout_stack.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/widgets/menu_bar.xml b/indra/newview/skins/default/xui/en/widgets/menu_bar.xml new file mode 100644 index 0000000000..ee3ef0cd7a --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/menu_bar.xml @@ -0,0 +1,7 @@ + + diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml index e5cea476da..7452d685eb 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml @@ -1,6 +1,8 @@ + name="separator" + disabled_color="MenuItemDisabledColor" + highlight_bg_color="MenuItemHighlightBgColor" + highlight_fg_color="MenuItemHighlightFgColor" + label="-----------"> diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml index 185ed6ee3e..72af3924c1 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml @@ -1,7 +1,8 @@  - + name="tear_off" + label = "~~~~~~~~~~~" + disabled_color="MenuItemDisabledColor" + highlight_bg_color="MenuItemHighlightBgColor" + highlight_fg_color="MenuItemHighlightFgColor"/> diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml index e0900b48f3..90b0625982 100644 --- a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml +++ b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml @@ -1,6 +1,7 @@ + mouse_opaque="true" + text_disabled_color="LabelDisabledColor" + draw_track="true" + use_triangle="false" + font="SansSerifSmall"/> diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml index 04a2cd635c..bbcb008df4 100644 --- a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml +++ b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml @@ -1,5 +1,6 @@ - + thumb_width="8" + mouse_opaque="true" + follows="left|top"/> diff --git a/indra/newview/skins/default/xui/en/widgets/name_list.xml b/indra/newview/skins/default/xui/en/widgets/name_list.xml new file mode 100644 index 0000000000..3ae0f68227 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/name_list.xml @@ -0,0 +1,3 @@ + + diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml index 47a210d9b7..b36f723831 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -4,7 +4,8 @@ bg_opaque_image - image name for "in-front" panel look bg_alpha_image - image name for "in-back" or transparent panel look --> - + thickness="15" + tab_stop="false"> - diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml index 86356ff563..70f2e88d13 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml @@ -1,5 +1,8 @@ - diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml index dd93675807..e43989c6c7 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml @@ -1,5 +1,6 @@ - + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/search_editor.xml b/indra/newview/skins/default/xui/en/widgets/search_editor.xml index 32e443a058..faa0404b35 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_editor.xml @@ -1,5 +1,6 @@ - - diff --git a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml index 757f0f49d1..ba2fdf4f1f 100644 --- a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml +++ b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml @@ -1,5 +1,9 @@ - + - \ No newline at end of file + bevel_style="out" + mouse_opaque="false" + follows="all"/> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/web_browser.xml b/indra/newview/skins/default/xui/en/widgets/web_browser.xml index 118d63bbf0..676fafd828 100644 --- a/indra/newview/skins/default/xui/en/widgets/web_browser.xml +++ b/indra/newview/skins/default/xui/en/widgets/web_browser.xml @@ -1,2 +1,4 @@ - + -- cgit v1.2.3 From 12832768e122ba76a12b3b673526f7d36f896618 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 6 Sep 2011 14:45:37 -0700 Subject: EXP-1196 FIX Fix param block template ordering forgot to set menu name in menu.xml reviewed by Leslie --- indra/newview/skins/default/xui/en/widgets/menu.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/widgets/menu.xml b/indra/newview/skins/default/xui/en/widgets/menu.xml index 58543338f6..13ac84beb2 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu.xml @@ -1,5 +1,6 @@ - Date: Wed, 7 Sep 2011 20:53:44 +0300 Subject: SH-2371 FIXED "Not allowed to upload message" flashes when uploader dialog comes up - This is a regression bug caused by changeset:20407 --- indra/newview/skins/default/xui/en/floater_model_preview.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index df4c66c5b6..cae6445b02 100755 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -1296,7 +1296,7 @@ name="warning_title" top_pad="10" text_color="DrYellow" - visible="true" + visible="false" width="40"> NOTE: @@ -1310,7 +1310,7 @@ top_delta="2" wrap="true" width="462" - visible="true"> + visible="false"> You dont have rights to upload mesh models. [[VURL] Find out how] to get certified. -- cgit v1.2.3 From 535710ae25a7f161d2aacf6e12d94a8dfe599d08 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 7 Sep 2011 22:13:05 +0300 Subject: STORM-1587 FIXED Alert notifications were shown in English, no matter what viewer language was. --- indra/newview/llappviewer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7e597fe5dc..4e1ef59765 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -786,6 +786,12 @@ bool LLAppViewer::init() &LLUI::sGLScaleFactor); LL_INFOS("InitInfo") << "UI initialized." << LL_ENDL ; + // Setup paths and LLTrans after LLUI::initClass has been called. + LLUI::setupPaths(); + LLTransUtil::parseStrings("strings.xml", default_trans_args); + LLTransUtil::parseLanguageStrings("language_settings.xml"); + + // Setup notifications after LLUI::setupPaths() has been called. LLNotifications::instance(); LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ; @@ -831,12 +837,6 @@ bool LLAppViewer::init() LLError::setPrintLocation(true); } - - // Setup paths and LLTrans after LLUI::initClass has been called - LLUI::setupPaths(); - LLTransUtil::parseStrings("strings.xml", default_trans_args); - LLTransUtil::parseLanguageStrings("language_settings.xml"); - // LLKeyboard relies on LLUI to know what some accelerator keys are called. LLKeyboard::setStringTranslatorFunc( LLTrans::getKeyboardString ); -- cgit v1.2.3 From 6bb2b2cb99740a00498f5441b8a48b0bf5a04985 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 7 Sep 2011 12:45:50 -0700 Subject: EXP-1194 FIX -- Update New tag behavior to update Newness timestamp when Received Items panel is open and do not auto open Received Items panel * Updated inbox freshness time setting name to "LastInventoryInboxActivity" * New time stamp reflects time of last activity performed on the inbox by the user * Selection and opening items in the inbox both count as activity on the inbox * Focus going to the inbox panel counts as activity on the inbox * Creation date of folders now computed based on date of items being added to them * Creation date of folders no longer relies on queries for creation date, as is done during sorting * Folders are assumed to be "new" if no inbox freshness time setting is saved --- .../newview/app_settings/settings_per_account.xml | 4 +- indra/newview/llfolderviewitem.cpp | 62 ++++++++-------------- indra/newview/llfolderviewitem.h | 4 +- indra/newview/llinventorypanel.cpp | 5 +- indra/newview/llinventorypanel.h | 2 + indra/newview/llpanelmarketplaceinbox.cpp | 6 ++- indra/newview/llpanelmarketplaceinboxinventory.cpp | 44 +++++++++------ indra/newview/llpanelmarketplaceinboxinventory.h | 8 +-- .../newview/llpanelmarketplaceoutboxinventory.cpp | 5 -- indra/newview/llpanelmarketplaceoutboxinventory.h | 2 - indra/newview/llsidepanelinventory.cpp | 4 +- 11 files changed, 71 insertions(+), 75 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 49f8a11e3e..c7140283f1 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -33,10 +33,10 @@ Value - LastInventoryInboxExpansion + LastInventoryInboxActivity Comment - The last time the received items inbox was expanded for view. + The last time the received items inbox was poked by the user. Persist 1 Type diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 72e2294196..00bc63326b 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -2057,23 +2057,42 @@ BOOL LLFolderViewFolder::isRemovable() BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) { mItems.push_back(item); + if (item->isSelected()) { recursiveIncrementNumDescendantsSelected(1); } + item->setRect(LLRect(0, 0, getRect().getWidth(), 0)); item->setVisible(FALSE); - addChild( item ); + + addChild(item); + item->dirtyFilter(); + + // Update the folder creation date if the child is newer than our current date + setCreationDate(llmax(mCreationDate, item->getCreationDate())); + + // Handle sorting requestArrange(); requestSort(); + + // Traverse parent folders and update creation date and resort, if necessary LLFolderViewFolder* parentp = getParentFolder(); - while (parentp && parentp->mSortFunction.isByDate()) + while (parentp) { - // parent folder doesn't have a time stamp yet, so get it from us - parentp->requestSort(); + // Update the folder creation date if the child is newer than our current date + parentp->setCreationDate(llmax(parentp->mCreationDate, item->getCreationDate())); + + if (parentp->mSortFunction.isByDate()) + { + // parent folder doesn't have a time stamp yet, so get it from us + parentp->requestSort(); + } + parentp = parentp->getParentFolder(); } + return TRUE; } @@ -2437,41 +2456,6 @@ void LLFolderViewFolder::draw() time_t LLFolderViewFolder::getCreationDate() const { - // folders have no creation date try to create one from an item somewhere in our folder hierarchy - if (!mCreationDate) - { - for (items_t::const_iterator iit = mItems.begin(); - iit != mItems.end(); ++iit) - { - LLFolderViewItem* itemp = (*iit); - - const time_t item_creation_date = itemp->getCreationDate(); - - if (item_creation_date) - { - setCreationDate(item_creation_date); - break; - } - } - - if (!mCreationDate) - { - for (folders_t::const_iterator fit = mFolders.begin(); - fit != mFolders.end(); ++fit) - { - LLFolderViewFolder* folderp = (*fit); - - const time_t folder_creation_date = folderp->getCreationDate(); - - if (folder_creation_date) - { - setCreationDate(folder_creation_date); - break; - } - } - } - } - return llmax(mCreationDate, mSubtreeCreationDate); } diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index ce936b4991..676eaf825d 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -136,7 +136,7 @@ protected: std::string mSearchableLabel; S32 mLabelWidth; bool mLabelWidthDirty; - mutable time_t mCreationDate; + time_t mCreationDate; LLFolderViewFolder* mParentFolder; LLFolderViewEventListener* mListener; BOOL mIsCurSelection; @@ -174,7 +174,7 @@ protected: static LLFontGL* getLabelFontForStyle(U8 style); - virtual void setCreationDate(time_t creation_date_utc) const { mCreationDate = creation_date_utc; } + virtual void setCreationDate(time_t creation_date_utc) { mCreationDate = creation_date_utc; } public: BOOL postBuild(); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 5f033cf517..173e5c6ae6 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -234,7 +234,6 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); } - mFolderRoot->setSortOrder(getFilter()->getSortOrder()); // hide inbox getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); @@ -347,6 +346,10 @@ U32 LLInventoryPanel::getSortOrder() const return mFolderRoot->getSortOrder(); } +void LLInventoryPanel::requestSort() +{ + mFolderRoot->requestSort(); +} void LLInventoryPanel::setSinceLogoff(BOOL sl) { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 7676bbb6d7..cfb84bf4b7 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -208,6 +208,8 @@ public: void setSortOrder(U32 order); U32 getSortOrder() const; + void requestSort(); + private: std::string mSortOrderSetting; diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 9f17c34dfb..8d0712a328 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -95,8 +95,10 @@ LLInventoryPanel * LLPanelMarketplaceInbox::setupInventoryPanel() LLRect inventory_placeholder_rect = inbox_inventory_placeholder->getRect(); mInventoryPanel->setShape(inventory_placeholder_rect); - // Set the sort order newest to oldest, and a selection change callback + // Set the sort order newest to oldest mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + + // Set selection callback for proper update of inventory status buttons mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); // Set up the note to display when the inbox is empty @@ -113,6 +115,8 @@ void LLPanelMarketplaceInbox::onFocusReceived() LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); sidepanel_inventory->clearSelections(true, false, true); + + gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString()); } BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index e5b0db92f3..47f34434db 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -37,6 +37,8 @@ #include "llviewerfoldertype.h" +#define DEBUGGING_FRESHNESS 0 + // // statics // @@ -188,49 +190,57 @@ void LLInboxFolderViewFolder::draw() LLFolderViewFolder::draw(); } -BOOL LLInboxFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) -{ - BOOL retval = LLFolderViewFolder::addToFolder(folder, root); - - // Only mark top-level inbox folders as fresh - mFresh = (mParentFolder == mRoot); - - return retval; -} - -void LLInboxFolderViewFolder::updateFlag() const +void LLInboxFolderViewFolder::computeFreshness() { - const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxExpansion"); + const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxActivity"); if (!last_expansion.empty()) { LLDate saved_freshness_date = LLDate(last_expansion); mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch()); + +#if DEBUGGING_FRESHNESS + if (mFresh) + { + llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << saved_freshness_date.secondsSinceEpoch() << llendl; + } +#endif + } + else + { + mFresh = true; } } +void LLInboxFolderViewFolder::deFreshify() +{ + mFresh = false; + + gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString()); +} + void LLInboxFolderViewFolder::selectItem() { LLFolderViewFolder::selectItem(); - mFresh = false; + deFreshify(); } void LLInboxFolderViewFolder::toggleOpen() { LLFolderViewFolder::toggleOpen(); - mFresh = false; + deFreshify(); } -void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const +void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) { mCreationDate = creation_date_utc; - if (mFresh) + if (mParentFolder == mRoot) { - updateFlag(); + computeFreshness(); } } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 06706539a0..089facf80c 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -75,18 +75,18 @@ public: void draw(); - BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); + void computeFreshness(); + void deFreshify(); - void updateFlag() const; void selectItem(); void toggleOpen(); bool isFresh() const { return mFresh; } protected: - void setCreationDate(time_t creation_date_utc) const; + void setCreationDate(time_t creation_date_utc); - mutable bool mFresh; + bool mFresh; }; diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.cpp b/indra/newview/llpanelmarketplaceoutboxinventory.cpp index 14b6ee9e0a..ed1206aec8 100644 --- a/indra/newview/llpanelmarketplaceoutboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceoutboxinventory.cpp @@ -259,11 +259,6 @@ void LLOutboxFolderViewFolder::setError(S32 errorCode) } } -void LLOutboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const -{ - mCreationDate = creation_date_utc; -} - // // LLOutboxFolderViewItem Implementation // diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.h b/indra/newview/llpanelmarketplaceoutboxinventory.h index ec55b7eb2e..346680a79d 100644 --- a/indra/newview/llpanelmarketplaceoutboxinventory.h +++ b/indra/newview/llpanelmarketplaceoutboxinventory.h @@ -77,8 +77,6 @@ public: bool hasError() const { return (mError != 0); } protected: - void setCreationDate(time_t creation_date_utc) const; - S32 mError; }; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 522de30467..858639215c 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -539,7 +539,7 @@ void LLSidepanelInventory::onToggleInboxBtn() if (inbox_expanded && inboxPanel->isInVisibleChain()) { - gSavedPerAccountSettings.setString("LastInventoryInboxExpansion", LLDate::now().asString()); + gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString()); } } @@ -568,7 +568,7 @@ void LLSidepanelInventory::onOpen(const LLSD& key) #else if (mInboxEnabled && getChild(INBOX_BUTTON_NAME)->getToggleState()) { - gSavedPerAccountSettings.setString("LastInventoryInboxExpansion", LLDate::now().asString()); + gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString()); } #endif -- cgit v1.2.3 From c64bd7d5cb28fc221716e866ff9c9a28c22e69ce Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 7 Sep 2011 12:46:37 -0700 Subject: Reduced text spam on exit by not trying to set all objects to a NULL region. Reviewed by Richard. --- indra/newview/llviewerobjectlist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index db5684665b..153a91e7d8 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1254,7 +1254,8 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep) BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) { // Don't ever kill gAgentAvatarp, just force it to the agent's region - if (objectp == gAgentAvatarp) + // unless region is NULL which is assumed to mean you are logging out. + if ((objectp == gAgentAvatarp) && gAgent.getRegion()) { objectp->setRegion(gAgent.getRegion()); return FALSE; @@ -1277,6 +1278,7 @@ BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) return TRUE; } + return FALSE; } -- cgit v1.2.3 From 222908e6d56da661fbb6e2153845b62c983f3bd9 Mon Sep 17 00:00:00 2001 From: eli Date: Wed, 7 Sep 2011 17:07:50 -0700 Subject: sync with viewer-development --- .../skins/default/xui/en/menu_media_ctrl.xml | 12 ++++++++ indra/newview/skins/default/xui/en/panel_login.xml | 34 +++++++++++++++------ .../skins/default/xui/en/panel_navigation_bar.xml | 4 +-- .../skins/default/xui/en/panel_status_bar.xml | 35 +++++++++++++--------- .../skins/default/xui/en/widgets/combo_box.xml | 3 ++ 5 files changed, 63 insertions(+), 25 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml index c39c26f25f..960da4bd7a 100644 --- a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml @@ -28,4 +28,16 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 83f1bff91f..983f93cb03 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -117,17 +117,33 @@ label="Remember password" name="connect_btn" top="35" width="90" /> - - + Mode: + + + top_pad="0" + name="mode_combo" + width="110"> + + + + width="226"> - + > + + + + width="75"> 24:00 AM PST diff --git a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml index 48b987d7e8..ab3de1eaab 100644 --- a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml +++ b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml @@ -1,7 +1,7 @@ + name="colorswatch"> diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml index 95f5cf2ecd..77d8024cb2 100644 --- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml +++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml @@ -10,10 +10,12 @@ label="New" label_offset_horiz="-1" location="right" - padding_horiz="4" - padding_vert="1" - location_percent_hcenter="70" - border_image="" - image="Badge_Background_New" + padding_horiz="12.5" + padding_vert="2" + location_offset_hcenter="-23" + border_image="New_Tag_Border" + border_color="DkGray2" + image="New_Tag_Background" + image_color="Black" /> diff --git a/indra/newview/skins/default/xui/en/widgets/menu.xml b/indra/newview/skins/default/xui/en/widgets/menu.xml index 58543338f6..13ac84beb2 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu.xml @@ -1,5 +1,6 @@ - + name="separator" + disabled_color="MenuItemDisabledColor" + highlight_bg_color="MenuItemHighlightBgColor" + highlight_fg_color="MenuItemHighlightFgColor" + label="-----------"> diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml index 185ed6ee3e..72af3924c1 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml @@ -1,7 +1,8 @@  - + name="tear_off" + label = "~~~~~~~~~~~" + disabled_color="MenuItemDisabledColor" + highlight_bg_color="MenuItemHighlightBgColor" + highlight_fg_color="MenuItemHighlightFgColor"/> diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml index e0900b48f3..90b0625982 100644 --- a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml +++ b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml @@ -1,6 +1,7 @@ + mouse_opaque="true" + text_disabled_color="LabelDisabledColor" + draw_track="true" + use_triangle="false" + font="SansSerifSmall"/> diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml index 04a2cd635c..bbcb008df4 100644 --- a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml +++ b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml @@ -1,5 +1,6 @@ - + thumb_width="8" + mouse_opaque="true" + follows="left|top"/> diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml index 47a210d9b7..b36f723831 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -4,7 +4,8 @@ bg_opaque_image - image name for "in-front" panel look bg_alpha_image - image name for "in-back" or transparent panel look --> - - diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml index e6d4bff8b5..682dcf40d8 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml @@ -5,7 +5,8 @@ track_image_horizontal ="ScrollTrack_Horiz" track_color="ScrollbarTrackColor" thumb_color="ScrollbarThumbColor" - thickness="15"> + thickness="15" + tab_stop="false"> - diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml index 86356ff563..a6d096a964 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml @@ -1,5 +1,8 @@ - + max_auto_scroll_rate="500" + tab_stop="false" + mouse_opaque="true" /> diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml index dd93675807..e43989c6c7 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml @@ -1,5 +1,6 @@ - - - diff --git a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml index 757f0f49d1..ba2fdf4f1f 100644 --- a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml +++ b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml @@ -1,5 +1,9 @@ - + - \ No newline at end of file + bevel_style="out" + mouse_opaque="false" + follows="all"/> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/web_browser.xml b/indra/newview/skins/default/xui/en/widgets/web_browser.xml index 118d63bbf0..676fafd828 100644 --- a/indra/newview/skins/default/xui/en/widgets/web_browser.xml +++ b/indra/newview/skins/default/xui/en/widgets/web_browser.xml @@ -1,2 +1,4 @@ - + diff --git a/indra/newview/skins/minimal/xui/en/main_view.xml b/indra/newview/skins/minimal/xui/en/main_view.xml index ec2683880a..0ce6cbc984 100644 --- a/indra/newview/skins/minimal/xui/en/main_view.xml +++ b/indra/newview/skins/minimal/xui/en/main_view.xml @@ -187,9 +187,9 @@ name="status_bar_container" tab_stop="false" height="30" - left="-120" + left="-160" top="0" - width="120" + width="160" visible="false"/> - + + Mode: + + + + + mouse_opaque="false" name="location_combo" top_delta="0" - width="390"> + width="325"> + width="185"> Packet Loss @@ -33,18 +33,27 @@ name="buycurrencylabel"> L$ [AMT] - + + + + - + Geometry preview - + High detail - + Medium detail - + Low detail - + Lowest detail @@ -502,7 +497,7 @@ Higher prim weight height="50" font="SansSerifSmall" layout="topleft" - name="physics_hint" + name="description" word_wrap="true" left_delta="5"> We will create a shape for the outer hull of the model. Adjust the shape's detail level as needed for the intended purpose of your model. @@ -536,16 +531,16 @@ Higher prim weight left="15" height="270" width="505" - name="physics_content_panel" + name="content" bg_opaque_color="DkGray2" background_visible="true" background_opaque="true"> - Performance - Faster rendering + Performance + Faster rendering Less detail Lower prim weight - Accuracy - Slower rendering + Accuracy + Slower rendering More detail Higher prim weight @@ -563,15 +558,15 @@ Higher prim weight show_text="false" top="25" width="22" /> - Examples: + Examples: Moving objects Flying objects Vehicles - Examples: + Examples: Small static objects Less detailed objects Simple furniture - Examples: + Examples: Static objects Detailed objects Buildings @@ -597,7 +592,7 @@ Buildings visible="false" width="150"> - + Physics preview - + High detail - + Medium detail - + Low detail - + Lowest detail @@ -640,7 +635,7 @@ Buildings left="15" height="310" width="505" - name="review_content_panel" + name="content" bg_opaque_color="DkGray2" background_visible="true" background_opaque="true"> @@ -711,7 +706,7 @@ Buildings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 8901583799..9b02f7d273 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -48,11 +48,11 @@ - [OBJ_COUNT] objects ( [PRIM_COUNT] prims[PE_STRING] ) selected + [OBJ_COUNT] objects selected, land impact [LAND_IMPACT] - , [SEL_WEIGHT] prim equivs + name="status_remaining_capacity"> + Remaining capacity [LAND_CAPACITY]. diff --git a/indra/newview/skins/default/xui/de/menu_media_ctrl.xml b/indra/newview/skins/default/xui/de/menu_media_ctrl.xml index 781796670a..59c1c2ee86 100644 --- a/indra/newview/skins/default/xui/de/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/de/menu_media_ctrl.xml @@ -3,4 +3,5 @@ + diff --git a/indra/newview/skins/default/xui/de/menu_mode_change.xml b/indra/newview/skins/default/xui/de/menu_mode_change.xml new file mode 100644 index 0000000000..b8090018b7 --- /dev/null +++ b/indra/newview/skins/default/xui/de/menu_mode_change.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml index e010844206..7c6918a4ee 100644 --- a/indra/newview/skins/default/xui/de/menu_viewer.xml +++ b/indra/newview/skins/default/xui/de/menu_viewer.xml @@ -138,7 +138,6 @@ - @@ -253,6 +252,7 @@ + diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 1971061096..4c53c40d86 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -85,6 +85,19 @@ Stellen Sie sicher, dass Ihre Internetverbindung funktioniert. Änderung an aktueller Kleidung/Körperteil speichern? + + Ihnen fehlt die Berechtigung zum Kopieren dieses Artikels in die Händler-Outbox. Möchten Sie wirklich den folgenden Artikel verschieben? + [ITEM_NAME] + + + + Marktplatz-Upload abgeschlossen. + + + + Marktplatz-Upload mit Fehlern abgeschlossen. Korrigieren Sie die Fehler in Ihrer Outbox und versuchen Sie es erneut. Vielen Dank! + + Der Text für ein Skript konnte aus folgendem Grund nicht hochgeladen werden: [REASON]. Bitte versuchen Sie es erneut. @@ -2436,7 +2449,15 @@ Versuchen Sie es in einigen Minuten erneut. diff --git a/indra/newview/skins/default/xui/es/menu_media_ctrl.xml b/indra/newview/skins/default/xui/es/menu_media_ctrl.xml index 8ea9286d8e..b4dfe9907a 100644 --- a/indra/newview/skins/default/xui/es/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/es/menu_media_ctrl.xml @@ -3,4 +3,5 @@ + diff --git a/indra/newview/skins/default/xui/es/menu_mode_change.xml b/indra/newview/skins/default/xui/es/menu_mode_change.xml new file mode 100644 index 0000000000..608505d192 --- /dev/null +++ b/indra/newview/skins/default/xui/es/menu_mode_change.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml index b0d16d1ca4..bc8a5731ab 100644 --- a/indra/newview/skins/default/xui/es/menu_viewer.xml +++ b/indra/newview/skins/default/xui/es/menu_viewer.xml @@ -138,7 +138,6 @@ - @@ -248,6 +247,7 @@ + diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index 2ec1b333a9..4fb29b9427 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -85,6 +85,19 @@ Asegúrate de que tu conexión a Internet está funcionando adecuadamente. ¿Guardar los cambios en las ropas o partes del cuerpo actuales? + + No tienes permiso para copiar este objeto en el Buzón de salida de comerciante. ¿Estás seguro de que quieres mover el objeto siguiente? + [ITEM_NAME] + + + + Envío al mercado finalizado. + + + + El envío al mercado ha tenido errores. Corrige los problemas de tu buzón de salida y repite la operación. Muchas gracias. + + Hubo un problema al subir el texto de un script por la siguiente razón: [REASON]. Por favor, inténtalo más tarde. @@ -2430,7 +2443,15 @@ Por favor, vuelve a intentarlo en unos momentos. diff --git a/indra/newview/skins/default/xui/fr/menu_media_ctrl.xml b/indra/newview/skins/default/xui/fr/menu_media_ctrl.xml index 787a5b3af2..1941ad2cbf 100644 --- a/indra/newview/skins/default/xui/fr/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/fr/menu_media_ctrl.xml @@ -3,4 +3,5 @@ + diff --git a/indra/newview/skins/default/xui/fr/menu_mode_change.xml b/indra/newview/skins/default/xui/fr/menu_mode_change.xml new file mode 100644 index 0000000000..982a331c5b --- /dev/null +++ b/indra/newview/skins/default/xui/fr/menu_mode_change.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml index 46adc79a00..cf1dac2f3a 100644 --- a/indra/newview/skins/default/xui/fr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml @@ -138,7 +138,6 @@ - @@ -253,6 +252,7 @@ + diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index ef95a1a389..1389c49f5b 100644 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -85,6 +85,19 @@ Veuillez vérifier votre connexion Internet. Enregistrer les changements dans la partie du corps/les habits actuels ? + + Vous n'êtes pas autorisé à copier cet article dans la boîte d'envoi vers la Place du marché. Voulez-vous vraiment déplacer l'article suivant ? + [ITEM_NAME] + + + + Chargement sur la Place du marché terminé. + + + + Chargement sur la Place du marché effectué avec des erreurs ! Corrigez les problèmes dans votre boîte d'envoi et réessayez. Merci ! + + Une erreur est survenue lors du chargement du texte pour un script, suite au problème suivant : [REASON]. Veuillez réessayer ultérieurement. @@ -2422,7 +2435,15 @@ Veuillez réessayer dans quelques minutes. diff --git a/indra/newview/skins/default/xui/it/menu_media_ctrl.xml b/indra/newview/skins/default/xui/it/menu_media_ctrl.xml index a0e7370efd..aa9e583f8e 100644 --- a/indra/newview/skins/default/xui/it/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/it/menu_media_ctrl.xml @@ -3,4 +3,5 @@ + diff --git a/indra/newview/skins/default/xui/it/menu_mode_change.xml b/indra/newview/skins/default/xui/it/menu_mode_change.xml new file mode 100644 index 0000000000..499dcf1873 --- /dev/null +++ b/indra/newview/skins/default/xui/it/menu_mode_change.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml index ef40cbda7c..7e3b344117 100644 --- a/indra/newview/skins/default/xui/it/menu_viewer.xml +++ b/indra/newview/skins/default/xui/it/menu_viewer.xml @@ -138,7 +138,6 @@ - @@ -248,6 +247,7 @@ + diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml index d09f207af2..ab9de43e6e 100644 --- a/indra/newview/skins/default/xui/it/notifications.xml +++ b/indra/newview/skins/default/xui/it/notifications.xml @@ -85,6 +85,19 @@ Accertati che la tua connessione Internet stia funzionando correttamente. Salva i cambiamenti all'attuale parte del corpo/abito? + + Non hai l'autorizzazione necessaria per copiare questo oggetto nella casella in uscita di Marketplace. Sei sicuro di volere spostare gli oggetti seguenti? + [ITEM_NAME] + + + + Caricamento di Marketplace completato. + + + + Caricamento di Marketplace completato senza errori. Correggi i problemi nella casella in uscita e riprova. Grazie. + + C'è stato un problema importando il testo di uno script per la seguente ragione: [REASON]. Riprova più tardi. @@ -2424,7 +2437,15 @@ Riprova tra qualche istante. diff --git a/indra/newview/skins/default/xui/ja/menu_media_ctrl.xml b/indra/newview/skins/default/xui/ja/menu_media_ctrl.xml index d155dc17e0..faae4ef717 100644 --- a/indra/newview/skins/default/xui/ja/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/ja/menu_media_ctrl.xml @@ -3,4 +3,5 @@ + diff --git a/indra/newview/skins/default/xui/ja/menu_mode_change.xml b/indra/newview/skins/default/xui/ja/menu_mode_change.xml new file mode 100644 index 0000000000..dff3392bd5 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/menu_mode_change.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml index 223c1e1f11..edce5c50fc 100644 --- a/indra/newview/skins/default/xui/ja/menu_viewer.xml +++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml @@ -138,7 +138,6 @@ - @@ -253,6 +252,7 @@ + diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml index 6bff82bec4..c138aeb383 100644 --- a/indra/newview/skins/default/xui/ja/notifications.xml +++ b/indra/newview/skins/default/xui/ja/notifications.xml @@ -84,6 +84,19 @@ 現在の衣類、身体部位の変更を保存しますか? + + マーチャントのアウトボックスにこれをコピーする権限があります。次のアイテムを移動しますか? +[ITEM_NAME] + + + + マーケットプレイスへのアップロードが完了しました。 + + + + マーケットプレイスへのアップロードの完了時にエラーが発生しました。アウトボックスの問題を解決して、もう一度お試しください。ありがとうございます。 + + 次の理由で、スクリプト用テキストのアップロード時に問題が起こりました。 [REASON] @@ -2471,7 +2484,15 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ diff --git a/indra/newview/skins/default/xui/pt/menu_media_ctrl.xml b/indra/newview/skins/default/xui/pt/menu_media_ctrl.xml index 44117c8865..ac84b02870 100644 --- a/indra/newview/skins/default/xui/pt/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/pt/menu_media_ctrl.xml @@ -3,4 +3,5 @@ + diff --git a/indra/newview/skins/default/xui/pt/menu_mode_change.xml b/indra/newview/skins/default/xui/pt/menu_mode_change.xml new file mode 100644 index 0000000000..314d3e409b --- /dev/null +++ b/indra/newview/skins/default/xui/pt/menu_mode_change.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml index ea54afed5e..e1d066261a 100644 --- a/indra/newview/skins/default/xui/pt/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml @@ -138,7 +138,6 @@ - @@ -248,6 +247,7 @@ + diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml index 22de7edfdd..70d882822d 100644 --- a/indra/newview/skins/default/xui/pt/notifications.xml +++ b/indra/newview/skins/default/xui/pt/notifications.xml @@ -84,6 +84,19 @@ Verifique se a conexão à internet está funcionando. Salvar modificações? + + Você não tem permissão para copiar este item para a Caixa de saída do lojista. Tem certeza de que deseja mover o itens a seguir? + [ITEM_NAME] + + + + Envio para Mercado concluído. + + + + Envio para Mercado concluído com erros! Corrija os problemas em sua caixa de saída e tente novamente. Obrigado. + + Houve um problema com o carregamento do texto para um script devido à seguinte razão: [REASON]. Por favor, tente novamente mais tarde. @@ -2400,12 +2413,20 @@ Por favor, tente novamente em alguns instantes. Nenhum lote válido foi encontrado. - Um objeto chamado <nolink>[OBJECTFROMNAME]</nolink>, de [NAME_SLURL], lhe deu este(a) [OBJECTTYPE]: + Um objeto chamado <nolink>[OBJECTFROMNAME]</nolink>, de [NAME_SLURL], obteve este(a) [OBJECTTYPE]: <nolink>[ITEM_SLURL]</nolink>