diff options
Diffstat (limited to 'indra')
69 files changed, 997 insertions, 1221 deletions
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 7bad780dd8..478f2fedbd 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -70,6 +70,7 @@ set(llcommon_SOURCE_FILES llmemorystream.cpp llmemtype.cpp llmetrics.cpp + llmetricperformancetester.cpp llmortician.cpp lloptioninterface.cpp llptrto.cpp @@ -186,6 +187,7 @@ set(llcommon_HEADER_FILES llmemorystream.h llmemtype.h llmetrics.h + llmetricperformancetester.h llmortician.h llnametable.h lloptioninterface.h diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index c45921cdec..bce87ada96 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -56,6 +56,7 @@ bool LLFastTimer::sPauseHistory = 0; bool LLFastTimer::sResetHistory = 0; LLFastTimer::CurTimerData LLFastTimer::sCurTimerData; BOOL LLFastTimer::sLog = FALSE; +std::string LLFastTimer::sLogName = ""; BOOL LLFastTimer::sMetricLog = FALSE; LLMutex* LLFastTimer::sLogLock = NULL; std::queue<LLSD> LLFastTimer::sLogQueue; diff --git a/indra/llcommon/llfasttimer_class.h b/indra/llcommon/llfasttimer_class.h index 1158ac5140..eb9789682b 100644 --- a/indra/llcommon/llfasttimer_class.h +++ b/indra/llcommon/llfasttimer_class.h @@ -211,6 +211,7 @@ public: static std::queue<LLSD> sLogQueue; static BOOL sLog; static BOOL sMetricLog; + static std::string sLogName; static bool sPauseHistory; static bool sResetHistory; static U64 sTimerCycles; diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp new file mode 100644 index 0000000000..5fa3a5ea07 --- /dev/null +++ b/indra/llcommon/llmetricperformancetester.cpp @@ -0,0 +1,254 @@ +/** + * @file llmetricperformancetester.cpp + * @brief LLMetricPerformanceTesterBasic and LLMetricPerformanceTesterWithSession classes implementation + * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "indra_constants.h" +#include "llerror.h" +#include "llsdserialize.h" +#include "llstat.h" +#include "lltreeiterators.h" +#include "llmetricperformancetester.h" + +//---------------------------------------------------------------------------------------------- +// LLMetricPerformanceTesterBasic : static methods and testers management +//---------------------------------------------------------------------------------------------- + +LLMetricPerformanceTesterBasic::name_tester_map_t LLMetricPerformanceTesterBasic::sTesterMap ; + +/*static*/ +void LLMetricPerformanceTesterBasic::cleanClass() +{ + for (name_tester_map_t::iterator iter = sTesterMap.begin() ; iter != sTesterMap.end() ; ++iter) + { + delete iter->second ; + } + sTesterMap.clear() ; +} + +/*static*/ +BOOL LLMetricPerformanceTesterBasic::addTester(LLMetricPerformanceTesterBasic* tester) +{ + llassert_always(tester != NULL); + std::string name = tester->getTesterName() ; + if (getTester(name)) + { + llerrs << "Tester name is already used by some other tester : " << name << llendl ; + return FALSE; + } + + sTesterMap.insert(std::make_pair(name, tester)); + return TRUE; +} + +/*static*/ +LLMetricPerformanceTesterBasic* LLMetricPerformanceTesterBasic::getTester(std::string name) +{ + // Check for the requested metric name + name_tester_map_t::iterator found_it = sTesterMap.find(name) ; + if (found_it != sTesterMap.end()) + { + return found_it->second ; + } + return NULL ; +} + +/*static*/ +// Return TRUE if this metric is requested or if the general default "catch all" metric is requested +BOOL LLMetricPerformanceTesterBasic::isMetricLogRequested(std::string name) +{ + return (LLFastTimer::sMetricLog && ((LLFastTimer::sLogName == name) || (LLFastTimer::sLogName == DEFAULT_METRIC_NAME))); +} + + +//---------------------------------------------------------------------------------------------- +// LLMetricPerformanceTesterBasic : Tester instance methods +//---------------------------------------------------------------------------------------------- + +LLMetricPerformanceTesterBasic::LLMetricPerformanceTesterBasic(std::string name) : + mName(name), + mCount(0) +{ + if (mName == std::string()) + { + llerrs << "LLMetricPerformanceTesterBasic construction invalid : Empty name passed to constructor" << llendl ; + } + + mValidInstance = LLMetricPerformanceTesterBasic::addTester(this) ; +} + +LLMetricPerformanceTesterBasic::~LLMetricPerformanceTesterBasic() +{ +} + +void LLMetricPerformanceTesterBasic::preOutputTestResults(LLSD* sd) +{ + incrementCurrentCount() ; + (*sd)[getCurrentLabelName()]["Name"] = mName ; +} + +void LLMetricPerformanceTesterBasic::postOutputTestResults(LLSD* sd) +{ + LLMutexLock lock(LLFastTimer::sLogLock); + LLFastTimer::sLogQueue.push((*sd)); +} + +void LLMetricPerformanceTesterBasic::outputTestResults() +{ + LLSD sd; + + preOutputTestResults(&sd) ; + outputTestRecord(&sd) ; + postOutputTestResults(&sd) ; +} + +void LLMetricPerformanceTesterBasic::addMetric(std::string str) +{ + mMetricStrings.push_back(str) ; +} + +/*virtual*/ +void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) +{ + resetCurrentCount() ; + + std::string current_label = getCurrentLabelName(); + BOOL in_base = (*base).has(current_label) ; + BOOL in_current = (*current).has(current_label) ; + + while(in_base || in_current) + { + LLSD::String label = current_label ; + + if(in_base && in_current) + { + *os << llformat("%s\n", label.c_str()) ; + + for(U32 index = 0 ; index < mMetricStrings.size() ; index++) + { + switch((*current)[label][ mMetricStrings[index] ].type()) + { + case LLSD::TypeInteger: + compareTestResults(os, mMetricStrings[index], + (S32)((*base)[label][ mMetricStrings[index] ].asInteger()), (S32)((*current)[label][ mMetricStrings[index] ].asInteger())) ; + break ; + case LLSD::TypeReal: + compareTestResults(os, mMetricStrings[index], + (F32)((*base)[label][ mMetricStrings[index] ].asReal()), (F32)((*current)[label][ mMetricStrings[index] ].asReal())) ; + break; + default: + llerrs << "unsupported metric " << mMetricStrings[index] << " LLSD type: " << (S32)(*current)[label][ mMetricStrings[index] ].type() << llendl ; + } + } + } + + incrementCurrentCount(); + current_label = getCurrentLabelName(); + in_base = (*base).has(current_label) ; + in_current = (*current).has(current_label) ; + } +} + +/*virtual*/ +void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) +{ + *os << llformat(" ,%s, %d, %d, %d, %.4f\n", metric_string.c_str(), v_base, v_current, + v_current - v_base, (v_base != 0) ? 100.f * v_current / v_base : 0) ; +} + +/*virtual*/ +void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) +{ + *os << llformat(" ,%s, %.4f, %.4f, %.4f, %.4f\n", metric_string.c_str(), v_base, v_current, + v_current - v_base, (fabs(v_base) > 0.0001f) ? 100.f * v_current / v_base : 0.f ) ; +} + +//---------------------------------------------------------------------------------------------- +// LLMetricPerformanceTesterWithSession +//---------------------------------------------------------------------------------------------- + +LLMetricPerformanceTesterWithSession::LLMetricPerformanceTesterWithSession(std::string name) : + LLMetricPerformanceTesterBasic(name), + mBaseSessionp(NULL), + mCurrentSessionp(NULL) +{ +} + +LLMetricPerformanceTesterWithSession::~LLMetricPerformanceTesterWithSession() +{ + if (mBaseSessionp) + { + delete mBaseSessionp ; + mBaseSessionp = NULL ; + } + if (mCurrentSessionp) + { + delete mCurrentSessionp ; + mCurrentSessionp = NULL ; + } +} + +/*virtual*/ +void LLMetricPerformanceTesterWithSession::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) +{ + // Load the base session + resetCurrentCount() ; + mBaseSessionp = loadTestSession(base) ; + + // Load the current session + resetCurrentCount() ; + mCurrentSessionp = loadTestSession(current) ; + + if (!mBaseSessionp || !mCurrentSessionp) + { + llerrs << "Error loading test sessions." << llendl ; + } + + // Compare + compareTestSessions(os) ; + + // Release memory + if (mBaseSessionp) + { + delete mBaseSessionp ; + mBaseSessionp = NULL ; + } + if (mCurrentSessionp) + { + delete mCurrentSessionp ; + mCurrentSessionp = NULL ; + } +} + + +//---------------------------------------------------------------------------------------------- +// LLTestSession +//---------------------------------------------------------------------------------------------- + +LLMetricPerformanceTesterWithSession::LLTestSession::~LLTestSession() +{ +} + diff --git a/indra/llcommon/llmetricperformancetester.h b/indra/llcommon/llmetricperformancetester.h new file mode 100644 index 0000000000..925010ac96 --- /dev/null +++ b/indra/llcommon/llmetricperformancetester.h @@ -0,0 +1,206 @@ +/** + * @file llmetricperformancetester.h + * @brief LLMetricPerformanceTesterBasic and LLMetricPerformanceTesterWithSession classes definition + * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_METRICPERFORMANCETESTER_H +#define LL_METRICPERFORMANCETESTER_H + +const std::string DEFAULT_METRIC_NAME("metric"); + +/** + * @class LLMetricPerformanceTesterBasic + * @brief Performance Metric Base Class + */ +class LL_COMMON_API LLMetricPerformanceTesterBasic +{ +public: + /** + * @brief Creates a basic tester instance. + * @param[in] name - Unique string identifying this tester instance. + */ + LLMetricPerformanceTesterBasic(std::string name); + virtual ~LLMetricPerformanceTesterBasic(); + + /** + * @return Returns true if the instance has been added to the tester map. + * Need to be tested after creation of a tester instance so to know if the tester is correctly handled. + * A tester might not be added to the map if another tester with the same name already exists. + */ + BOOL isValid() const { return mValidInstance; } + + /** + * @brief Write a set of test results to the log LLSD. + */ + void outputTestResults() ; + + /** + * @brief Compare the test results. + * By default, compares the test results against the baseline one by one, item by item, + * in the increasing order of the LLSD record counter, starting from the first one. + */ + virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; + + /** + * @return Returns the number of the test metrics in this tester instance. + */ + S32 getNumberOfMetrics() const { return mMetricStrings.size() ;} + /** + * @return Returns the metric name at index + * @param[in] index - Index on the list of metrics managed by this tester instance. + */ + std::string getMetricName(S32 index) const { return mMetricStrings[index] ;} + +protected: + /** + * @return Returns the name of this tester instance. + */ + std::string getTesterName() const { return mName ;} + + /** + * @brief Insert a new metric to be managed by this tester instance. + * @param[in] str - Unique string identifying the new metric. + */ + void addMetric(std::string str) ; + + /** + * @brief Compare test results, provided in 2 flavors: compare integers and compare floats. + * @param[out] os - Formatted output string holding the compared values. + * @param[in] metric_string - Name of the metric. + * @param[in] v_base - Base value of the metric. + * @param[in] v_current - Current value of the metric. + */ + virtual void compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) ; + virtual void compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) ; + + /** + * @brief Reset internal record count. Count starts with 1. + */ + void resetCurrentCount() { mCount = 1; } + /** + * @brief Increment internal record count. + */ + void incrementCurrentCount() { mCount++; } + /** + * @return Returns the label to be used for the current count. It's "TesterName"-"Count". + */ + std::string getCurrentLabelName() const { return llformat("%s-%d", mName.c_str(), mCount) ;} + + /** + * @brief Write a test record to the LLSD. Implementers need to overload this method. + * @param[out] sd - The LLSD record to store metric data into. + */ + virtual void outputTestRecord(LLSD* sd) = 0 ; + +private: + void preOutputTestResults(LLSD* sd) ; + void postOutputTestResults(LLSD* sd) ; + + std::string mName ; // Name of this tester instance + S32 mCount ; // Current record count + BOOL mValidInstance; // TRUE if the instance is managed by the map + std::vector< std::string > mMetricStrings ; // Metrics strings + +// Static members managing the collection of testers +public: + // Map of all the tester instances in use + typedef std::map< std::string, LLMetricPerformanceTesterBasic* > name_tester_map_t; + static name_tester_map_t sTesterMap ; + + /** + * @return Returns a pointer to the tester + * @param[in] name - Name of the tester instance queried. + */ + static LLMetricPerformanceTesterBasic* getTester(std::string name) ; + + /** + * @return Returns TRUE if that metric *or* the default catch all metric has been requested to be logged + * @param[in] name - Name of the tester queried. + */ + static BOOL isMetricLogRequested(std::string name); + + /** + * @return Returns TRUE if there's a tester defined, FALSE otherwise. + */ + static BOOL hasMetricPerformanceTesters() { return !sTesterMap.empty() ;} + /** + * @brief Delete all testers and reset the tester map + */ + static void cleanClass() ; + +private: + // Add a tester to the map. Returns false if adding fails. + static BOOL addTester(LLMetricPerformanceTesterBasic* tester) ; +}; + +/** + * @class LLMetricPerformanceTesterWithSession + * @brief Performance Metric Class with custom session + */ +class LL_COMMON_API LLMetricPerformanceTesterWithSession : public LLMetricPerformanceTesterBasic +{ +public: + /** + * @param[in] name - Unique string identifying this tester instance. + */ + LLMetricPerformanceTesterWithSession(std::string name); + virtual ~LLMetricPerformanceTesterWithSession(); + + /** + * @brief Compare the test results. + * This will be loading the base and current sessions and compare them using the virtual + * abstract methods loadTestSession() and compareTestSessions() + */ + virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; + +protected: + /** + * @class LLMetricPerformanceTesterWithSession::LLTestSession + * @brief Defines an interface for the two abstract virtual functions loadTestSession() and compareTestSessions() + */ + class LL_COMMON_API LLTestSession + { + public: + virtual ~LLTestSession() ; + }; + + /** + * @brief Convert an LLSD log into a test session. + * @param[in] log - The LLSD record + * @return Returns the record as a test session + */ + virtual LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) = 0; + + /** + * @brief Compare the base session and the target session. Assumes base and current sessions have been loaded. + * @param[out] os - The comparison result as a standard stream + */ + virtual void compareTestSessions(std::ofstream* os) = 0; + + LLTestSession* mBaseSessionp; + LLTestSession* mCurrentSessionp; +}; + +#endif + diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index c8c866b7f2..d005aaf29f 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -30,6 +30,8 @@ #include "lldir.h" #include "llimagej2c.h" #include "llmemtype.h" +#include "lltimer.h" +#include "llmath.h" typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)(); typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*); @@ -51,6 +53,10 @@ LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl(); void fallbackDestroyLLImageJ2CImpl(LLImageJ2CImpl* impl); const char* fallbackEngineInfoLLImageJ2CImpl(); +// Test data gathering handle +LLImageCompressionTester* LLImageJ2C::sTesterp = NULL ; +const std::string sTesterName("ImageCompressionTester"); + //static //Loads the required "create", "destroy" and "engineinfo" functions needed void LLImageJ2C::openDSO() @@ -71,8 +77,8 @@ void LLImageJ2C::openDSO() #endif dso_path = gDirUtilp->findFile(dso_name, - gDirUtilp->getAppRODataDir(), - gDirUtilp->getExecutableDir()); + gDirUtilp->getAppRODataDir(), + gDirUtilp->getExecutableDir()); j2cimpl_dso_handle = NULL; j2cimpl_dso_memory_pool = NULL; @@ -102,7 +108,7 @@ void LLImageJ2C::openDSO() //so lets check for a destruction function rv = apr_dso_sym((apr_dso_handle_sym_t*)&dest_func, j2cimpl_dso_handle, - "destroyLLImageJ2CKDU"); + "destroyLLImageJ2CKDU"); if ( rv == APR_SUCCESS ) { //we've loaded the destroy function ok @@ -195,6 +201,17 @@ LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C), { // Array size is MAX_DISCARD_LEVEL+1 mDataSizes[i] = 0; } + + // If that test log has ben requested but not yet created, create it + if (LLMetricPerformanceTesterBasic::isMetricLogRequested(sTesterName) && !LLMetricPerformanceTesterBasic::getTester(sTesterName)) + { + sTesterp = new LLImageCompressionTester() ; + if (!sTesterp->isValid()) + { + delete sTesterp; + sTesterp = NULL; + } + } } // virtual @@ -280,6 +297,7 @@ BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time) // Returns TRUE to mean done, whether successful or not. BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count ) { + LLTimer elapsed; LLMemType mt1(mMemType); BOOL res = TRUE; @@ -318,6 +336,21 @@ BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 fir LLImage::setLastError(mLastError); } + LLImageCompressionTester* tester = (LLImageCompressionTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName); + if (tester) + { + // Decompression stat gathering + // Note that we *do not* take into account the decompression failures data so we might overestimate the time spent processing + + // Always add the decompression time to the stat + tester->updateDecompressionStats(elapsed.getElapsedTimeF32()) ; + if (res) + { + // The whole data stream is finally decompressed when res is returned as TRUE + tester->updateDecompressionStats(this->getDataSize(), raw_imagep->getDataSize()) ; + } + } + return res; } @@ -330,6 +363,7 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, F32 encode_time) BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, F32 encode_time) { + LLTimer elapsed; LLMemType mt1(mMemType); resetLastError(); BOOL res = mImpl->encodeImpl(*this, *raw_imagep, comment_text, encode_time, mReversible); @@ -337,6 +371,22 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, { LLImage::setLastError(mLastError); } + + LLImageCompressionTester* tester = (LLImageCompressionTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName); + if (tester) + { + // Compression stat gathering + // Note that we *do not* take into account the compression failures cases so we night overestimate the time spent processing + + // Always add the compression time to the stat + tester->updateCompressionStats(elapsed.getElapsedTimeF32()) ; + if (res) + { + // The whole data stream is finally compressed when res is returned as TRUE + tester->updateCompressionStats(this->getDataSize(), raw_imagep->getDataSize()) ; + } + } + return res; } @@ -540,3 +590,125 @@ void LLImageJ2C::updateRawDiscardLevel() LLImageJ2CImpl::~LLImageJ2CImpl() { } + +//---------------------------------------------------------------------------------------------- +// Start of LLImageCompressionTester +//---------------------------------------------------------------------------------------------- +LLImageCompressionTester::LLImageCompressionTester() : LLMetricPerformanceTesterBasic(sTesterName) +{ + addMetric("Time Decompression (s)"); + addMetric("Volume In Decompression (kB)"); + addMetric("Volume Out Decompression (kB)"); + addMetric("Decompression Ratio (x:1)"); + addMetric("Perf Decompression (kB/s)"); + + addMetric("Time Compression (s)"); + addMetric("Volume In Compression (kB)"); + addMetric("Volume Out Compression (kB)"); + addMetric("Compression Ratio (x:1)"); + addMetric("Perf Compression (kB/s)"); + + mRunBytesInDecompression = 0; + mRunBytesInCompression = 0; + + mTotalBytesInDecompression = 0; + mTotalBytesOutDecompression = 0; + mTotalBytesInCompression = 0; + mTotalBytesOutCompression = 0; + + mTotalTimeDecompression = 0.0f; + mTotalTimeCompression = 0.0f; +} + +LLImageCompressionTester::~LLImageCompressionTester() +{ + LLImageJ2C::sTesterp = NULL; +} + +//virtual +void LLImageCompressionTester::outputTestRecord(LLSD *sd) +{ + std::string currentLabel = getCurrentLabelName(); + + F32 decompressionPerf = 0.0f; + F32 compressionPerf = 0.0f; + F32 decompressionRate = 0.0f; + F32 compressionRate = 0.0f; + + F32 totalkBInDecompression = (F32)(mTotalBytesInDecompression) / 1000.0; + F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.0; + F32 totalkBInCompression = (F32)(mTotalBytesInCompression) / 1000.0; + F32 totalkBOutCompression = (F32)(mTotalBytesOutCompression) / 1000.0; + + if (!is_approx_zero(mTotalTimeDecompression)) + { + decompressionPerf = totalkBInDecompression / mTotalTimeDecompression; + } + if (!is_approx_zero(totalkBInDecompression)) + { + decompressionRate = totalkBOutDecompression / totalkBInDecompression; + } + if (!is_approx_zero(mTotalTimeCompression)) + { + compressionPerf = totalkBInCompression / mTotalTimeCompression; + } + if (!is_approx_zero(totalkBOutCompression)) + { + compressionRate = totalkBInCompression / totalkBOutCompression; + } + + (*sd)[currentLabel]["Time Decompression (s)"] = (LLSD::Real)mTotalTimeDecompression; + (*sd)[currentLabel]["Volume In Decompression (kB)"] = (LLSD::Real)totalkBInDecompression; + (*sd)[currentLabel]["Volume Out Decompression (kB)"]= (LLSD::Real)totalkBOutDecompression; + (*sd)[currentLabel]["Decompression Ratio (x:1)"] = (LLSD::Real)decompressionRate; + (*sd)[currentLabel]["Perf Decompression (kB/s)"] = (LLSD::Real)decompressionPerf; + + (*sd)[currentLabel]["Time Compression (s)"] = (LLSD::Real)mTotalTimeCompression; + (*sd)[currentLabel]["Volume In Compression (kB)"] = (LLSD::Real)totalkBInCompression; + (*sd)[currentLabel]["Volume Out Compression (kB)"] = (LLSD::Real)totalkBOutCompression; + (*sd)[currentLabel]["Compression Ratio (x:1)"] = (LLSD::Real)compressionRate; + (*sd)[currentLabel]["Perf Compression (kB/s)"] = (LLSD::Real)compressionPerf; +} + +void LLImageCompressionTester::updateCompressionStats(const F32 deltaTime) +{ + mTotalTimeCompression += deltaTime; +} + +void LLImageCompressionTester::updateCompressionStats(const S32 bytesCompress, const S32 bytesRaw) +{ + mTotalBytesInCompression += bytesRaw; + mRunBytesInCompression += bytesRaw; + mTotalBytesOutCompression += bytesCompress; + if (mRunBytesInCompression > (1000000)) + { + // Output everything + outputTestResults(); + // Reset the compression data of the run + mRunBytesInCompression = 0; + } +} + +void LLImageCompressionTester::updateDecompressionStats(const F32 deltaTime) +{ + mTotalTimeDecompression += deltaTime; +} + +void LLImageCompressionTester::updateDecompressionStats(const S32 bytesIn, const S32 bytesOut) +{ + mTotalBytesInDecompression += bytesIn; + mRunBytesInDecompression += bytesIn; + mTotalBytesOutDecompression += bytesOut; + if (mRunBytesInDecompression > (1000000)) + { + // Output everything + outputTestResults(); + // Reset the decompression data of the run + mRunBytesInDecompression = 0; + } +} + +//---------------------------------------------------------------------------------------------- +// End of LLTexturePipelineTester +//---------------------------------------------------------------------------------------------- + diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index cdb3faa207..cc3dabd7d8 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -29,8 +29,11 @@ #include "llimage.h" #include "llassettype.h" +#include "llmetricperformancetester.h" class LLImageJ2CImpl; +class LLImageCompressionTester ; + class LLImageJ2C : public LLImageFormatted { protected: @@ -72,11 +75,12 @@ public: static void openDSO(); static void closeDSO(); static std::string getEngineInfo(); - + protected: friend class LLImageJ2CImpl; friend class LLImageJ2COJ; friend class LLImageJ2CKDU; + friend class LLImageCompressionTester; void decodeFailed(); void updateRawDiscardLevel(); @@ -90,6 +94,9 @@ protected: BOOL mReversible; LLImageJ2CImpl *mImpl; std::string mLastError; + + // Image compression/decompression tester + static LLImageCompressionTester* sTesterp; }; // Derive from this class to implement JPEG2000 decoding @@ -118,4 +125,40 @@ protected: #define LINDEN_J2C_COMMENT_PREFIX "LL_" +// +// This class is used for performance data gathering only. +// Tracks the image compression / decompression data, +// records and outputs them to the log file. +// +class LLImageCompressionTester : public LLMetricPerformanceTesterBasic +{ + public: + LLImageCompressionTester(); + ~LLImageCompressionTester(); + + void updateDecompressionStats(const F32 deltaTime) ; + void updateDecompressionStats(const S32 bytesIn, const S32 bytesOut) ; + void updateCompressionStats(const F32 deltaTime) ; + void updateCompressionStats(const S32 bytesIn, const S32 bytesOut) ; + + protected: + /*virtual*/ void outputTestRecord(LLSD* sd); + + private: + // + // Data size + // + U32 mTotalBytesInDecompression; // Total bytes fed to decompressor + U32 mTotalBytesOutDecompression; // Total bytes produced by decompressor + U32 mTotalBytesInCompression; // Total bytes fed to compressor + U32 mTotalBytesOutCompression; // Total bytes produced by compressor + U32 mRunBytesInDecompression; // Bytes fed to decompressor in this run + U32 mRunBytesInCompression; // Bytes fed to compressor in this run + // + // Time + // + F32 mTotalTimeDecompression; // Total time spent in computing decompression + F32 mTotalTimeCompression; // Total time spent in computing compression + }; + #endif diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 2f2d9099a3..7396117d84 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -286,18 +286,8 @@ public: } // No information in header, make a guess - if (status == 503) - { - // ...service unavailable, retry soon - const F64 SERVICE_UNAVAILABLE_DELAY = 600.0; // 10 min - return now + SERVICE_UNAVAILABLE_DELAY; - } - else - { - // ...other unexpected error - const F64 DEFAULT_DELAY = 3600.0; // 1 hour - return now + DEFAULT_DELAY; - } + const F64 DEFAULT_DELAY = 120.0; // 2 mintues + return now + DEFAULT_DELAY; } }; diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index b758070419..34d8e9c500 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -61,6 +61,9 @@ // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; +// static +F32 LLFloater::sActiveFloaterTransparency = 0.0f; +F32 LLFloater::sInactiveFloaterTransparency = 0.0f; std::string LLFloater::sButtonNames[BUTTON_COUNT] = { @@ -200,6 +203,21 @@ void LLFloater::initClass() { sButtonToolTips[i] = LLTrans::getString( sButtonToolTipsIndex[i] ); } + + LLControlVariable* ctrl = LLUI::sSettingGroups["config"]->getControl("ActiveFloaterTransparency").get(); + if (ctrl) + { + ctrl->getSignal()->connect(boost::bind(&LLFloater::updateActiveFloaterTransparency)); + sActiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency"); + } + + ctrl = LLUI::sSettingGroups["config"]->getControl("InactiveFloaterTransparency").get(); + if (ctrl) + { + ctrl->getSignal()->connect(boost::bind(&LLFloater::updateInactiveFloaterTransparency)); + sInactiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency"); + } + } // defaults for floater param block pulled from widgets/floater.xml @@ -347,6 +365,18 @@ void LLFloater::layoutDragHandle() updateTitleButtons(); } +// static +void LLFloater::updateActiveFloaterTransparency() +{ + sActiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency"); +} + +// static +void LLFloater::updateInactiveFloaterTransparency() +{ + sInactiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency"); +} + void LLFloater::addResizeCtrls() { // Resize bars (sides) @@ -1622,7 +1652,8 @@ void LLFloater::onClickCloseBtn() // virtual void LLFloater::draw() { - F32 alpha = getDrawContext().mAlpha; + mCurrentTransparency = hasFocus() ? sActiveFloaterTransparency : sInactiveFloaterTransparency; + // draw background if( isBackgroundVisible() ) { @@ -1653,12 +1684,12 @@ void LLFloater::draw() if (image) { // We're using images for this floater's backgrounds - image->draw(getLocalRect(), overlay_color % alpha); + image->draw(getLocalRect(), overlay_color % mCurrentTransparency); } else { // We're not using images, use old-school flat colors - gl_rect_2d( left, top, right, bottom, color % alpha ); + gl_rect_2d( left, top, right, bottom, color % mCurrentTransparency ); // draw highlight on title bar to indicate focus. RDW if(hasFocus() @@ -1670,7 +1701,7 @@ void LLFloater::draw() const LLFontGL* font = LLFontGL::getFontSansSerif(); LLRect r = getRect(); gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, - titlebar_focus_color % alpha, 0, TRUE); + titlebar_focus_color % mCurrentTransparency, 0, TRUE); } } } @@ -1720,7 +1751,6 @@ void LLFloater::draw() void LLFloater::drawShadow(LLPanel* panel) { - F32 alpha = panel->getDrawContext().mAlpha; S32 left = LLPANEL_BORDER_WIDTH; S32 top = panel->getRect().getHeight() - LLPANEL_BORDER_WIDTH; S32 right = panel->getRect().getWidth() - LLPANEL_BORDER_WIDTH; @@ -1737,7 +1767,7 @@ void LLFloater::drawShadow(LLPanel* panel) shadow_color.mV[VALPHA] *= 0.5f; } gl_drop_shadow(left, top, right, bottom, - shadow_color % alpha, + shadow_color % mCurrentTransparency, llround(shadow_offset)); } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 32d03f9f83..fa806bb632 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -341,6 +341,9 @@ private: void addDragHandle(); void layoutDragHandle(); // repair layout + static void updateActiveFloaterTransparency(); + static void updateInactiveFloaterTransparency(); + public: // Called when floater is opened, passes mKey // Public so external views or floaters can watch for this floater opening @@ -408,6 +411,11 @@ private: bool mDocked; bool mTornOff; + F32 mCurrentTransparency; + + static F32 sActiveFloaterTransparency; + static F32 sInactiveFloaterTransparency; + static LLMultiFloater* sHostp; static BOOL sQuitting; static std::string sButtonNames[BUTTON_COUNT]; diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index dd6c632d10..a3df6a3ced 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -64,7 +64,7 @@ LLNotificationForm::FormElementBase::FormElementBase() LLNotificationForm::FormIgnore::FormIgnore() : text("text"), control("control"), - invert_control("invert_control", true), + invert_control("invert_control", false), save_option("save_option", false) {} @@ -194,7 +194,7 @@ LLNotificationForm::LLNotificationForm() LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotificationForm::Params& p) : mIgnore(IGNORE_NO), - mInvertSetting(true) // ignore settings by default mean true=show, false=ignore + mInvertSetting(false) // ignore settings by default mean true=show, false=ignore { if (p.ignore.isProvided()) { @@ -219,7 +219,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica } else { - LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Ignore notification with this name", TRUE); + LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", TRUE); mIgnoreSetting = LLUI::sSettingGroups["ignores"]->getControl(name); } } @@ -357,15 +357,15 @@ LLControlVariablePtr LLNotificationForm::getIgnoreSetting() bool LLNotificationForm::getIgnored() { - bool ignored = false; + bool show = true; if (mIgnore != LLNotificationForm::IGNORE_NO && mIgnoreSetting) { - ignored = mIgnoreSetting->getValue().asBoolean(); - if (mInvertSetting) ignored = !ignored; + show = mIgnoreSetting->getValue().asBoolean(); + if (mInvertSetting) show = !show; } - return ignored; + return !show; } void LLNotificationForm::setIgnored(bool ignored) @@ -373,7 +373,7 @@ void LLNotificationForm::setIgnored(bool ignored) if (mIgnoreSetting) { if (mInvertSetting) ignored = !ignored; - mIgnoreSetting->setValue(ignored); + mIgnoreSetting->setValue(!ignored); } } diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 9b91c103ef..1a16056041 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -183,7 +183,7 @@ private: /// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) /// that displays various forms of user name /// This is a base class for the various implementations of name display -class LLUrlEntryAgentName : public LLUrlEntryBase +class LLUrlEntryAgentName : public LLUrlEntryBase, public boost::signals2::trackable { public: LLUrlEntryAgentName(); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index bf885e5934..09622d3af5 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -290,7 +290,6 @@ set(viewer_SOURCE_FILES llmediadataclient.cpp llmemoryview.cpp llmenucommands.cpp - llmetricperformancetester.cpp llmimetypes.cpp llmorphview.cpp llmoveview.cpp @@ -822,7 +821,6 @@ set(viewer_HEADER_FILES llmediadataclient.h llmemoryview.h llmenucommands.h - llmetricperformancetester.h llmimetypes.h llmorphview.h llmoveview.h diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index ba3b6a42a4..0562cf5480 100644 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -118,6 +118,8 @@ <map> <key>desc</key> <string>Log metrics for benchmarking</string> + <key>count</key> + <integer>1</integer> <key>map-to</key> <string>LogMetrics</string> </map> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 097fdfbb99..ebd93b5987 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -35,6 +35,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>ActiveFloaterTransparency</key> + <map> + <key>Comment</key> + <string>Transparency of active floaters (floaters that have focus)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.95</real> + </map> <key>AdvanceSnapshot</key> <map> <key>Comment</key> @@ -3986,6 +3997,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>InactiveFloaterTransparency</key> + <map> + <key>Comment</key> + <string>Transparency of inactive floaters (floaters that have no focus)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.5</real> + </map> <key>InBandwidth</key> <map> <key>Comment</key> diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 62074ddcd5..4e0bfb2e22 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2437,6 +2437,12 @@ public: virtual ~LLShowCreatedOutfit() { + if (!LLApp::isRunning()) + { + llwarns << "called during shutdown, skipping" << llendl; + return; + } + LLSD key; //EXT-7727. For new accounts LLShowCreatedOutfit is created during login process diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 60ed37bdfb..bf0f948a6d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -510,16 +510,10 @@ class LLFastTimerLogThread : public LLThread public: std::string mFile; - LLFastTimerLogThread() : LLThread("fast timer log") + LLFastTimerLogThread(std::string& test_name) : LLThread("fast timer log") { - if(LLFastTimer::sLog) - { - mFile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance.slp"); - } - if(LLFastTimer::sMetricLog) - { - mFile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric.slp"); - } + std::string file_name = test_name + std::string(".slp"); + mFile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, file_name); } void run() @@ -535,6 +529,7 @@ public: os.close(); } + }; //virtual @@ -1643,22 +1638,16 @@ bool LLAppViewer::cleanup() { llinfos << "Analyzing performance" << llendl; - if(LLFastTimer::sLog) - { - LLFastTimerView::doAnalysis( - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance_baseline.slp"), - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance.slp"), - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance_report.csv")); - } - if(LLFastTimer::sMetricLog) - { - LLFastTimerView::doAnalysis( - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric_baseline.slp"), - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric.slp"), - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric_report.csv")); - } + std::string baseline_name = LLFastTimer::sLogName + "_baseline.slp"; + std::string current_name = LLFastTimer::sLogName + ".slp"; + std::string report_name = LLFastTimer::sLogName + "_report.csv"; + + LLFastTimerView::doAnalysis( + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, baseline_name), + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, current_name), + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, report_name)); } - LLMetricPerformanceTester::cleanClass() ; + LLMetricPerformanceTesterBasic::cleanClass() ; llinfos << "Cleaning up Media and Textures" << llendflush; @@ -1765,7 +1754,7 @@ bool LLAppViewer::initThreads() if (LLFastTimer::sLog || LLFastTimer::sMetricLog) { LLFastTimer::sLogLock = new LLMutex(NULL); - mFastTimerLogThread = new LLFastTimerLogThread(); + mFastTimerLogThread = new LLFastTimerLogThread(LLFastTimer::sLogName); mFastTimerLogThread->start(); } @@ -2116,11 +2105,25 @@ bool LLAppViewer::initConfiguration() if (clp.hasOption("logperformance")) { LLFastTimer::sLog = TRUE; + LLFastTimer::sLogName = std::string("performance"); } - if(clp.hasOption("logmetrics")) + if (clp.hasOption("logmetrics")) { LLFastTimer::sMetricLog = TRUE ; + // '--logmetrics' can be specified with a named test metric argument so the data gathering is done only on that test + // In the absence of argument, every metric is gathered (makes for a rather slow run and hard to decipher report...) + std::string test_name = clp.getOption("logmetrics")[0]; + llinfos << "'--logmetrics' argument : " << test_name << llendl; + if (test_name == "") + { + llwarns << "No '--logmetrics' argument given, will output all metrics to " << DEFAULT_METRIC_NAME << llendl; + LLFastTimer::sLogName = DEFAULT_METRIC_NAME; + } + else + { + LLFastTimer::sLogName = test_name; + } } if (clp.hasOption("graphicslevel")) diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index a40cd83182..a14ab4362f 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -251,7 +251,9 @@ private: LLWatchdogTimeout* mMainloopTimeout; + // For performance and metric gathering LLThread* mFastTimerLogThread; + // for tracking viewer<->region circuit death bool mAgentRegionLastAlive; LLUUID mAgentRegionLastID; diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index e394aeaaf1..1d6f99d346 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -168,7 +168,6 @@ public: LLFacePool(const U32 type); virtual ~LLFacePool(); - virtual void renderForSelect() = 0; BOOL isDead() { return mReferences.empty(); } virtual LLViewerTexture *getTexture(); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 8cf4dc1b95..dbd5da31a6 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -743,79 +743,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } } -//----------------------------------------------------------------------------- -// renderForSelect() -//----------------------------------------------------------------------------- -void LLDrawPoolAvatar::renderForSelect() -{ - - - if (mDrawFace.empty()) - { - return; - } - - const LLFace *facep = mDrawFace[0]; - if (!facep->getDrawable()) - { - return; - } - LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); - - if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull()) - { - return; - } - - S32 curr_shader_level = getVertexShaderLevel(); - S32 name = avatarp->mDrawable->getVObj()->mGLName; - LLColor4U color((U8)(name >> 16), (U8)(name >> 8), (U8)name); - - BOOL impostor = avatarp->isImpostor(); - if (impostor) - { - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_VERT_COLOR); - gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); - - avatarp->renderImpostor(color); - - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); - return; - } - - sVertexProgram = &gAvatarPickProgram; - if (curr_shader_level > 0) - { - gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; - } - gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); - gGL.setSceneBlendType(LLRender::BT_REPLACE); - - glColor4ubv(color.mV); - - if (curr_shader_level > 0) // for hardware blending - { - sRenderingSkinned = TRUE; - sVertexProgram->bind(); - enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); - } - - avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); - - // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done - if (curr_shader_level > 0) - { - sRenderingSkinned = FALSE; - sVertexProgram->unbind(); - disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); - } - - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - gGL.setSceneBlendType(LLRender::BT_ALPHA); - - // restore texture mode - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); -} //----------------------------------------------------------------------------- // getDebugTexture() diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index c46fed824e..f536d3c911 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -64,7 +64,6 @@ public: /*virtual*/ void endRenderPass(S32 pass); /*virtual*/ void prerender(); /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void renderForSelect(); /*virtual*/ S32 getNumDeferredPasses(); /*virtual*/ void beginDeferredPass(S32 pass); diff --git a/indra/newview/lldrawpoolclouds.cpp b/indra/newview/lldrawpoolclouds.cpp index f7da144671..5db1d8cfed 100644 --- a/indra/newview/lldrawpoolclouds.cpp +++ b/indra/newview/lldrawpoolclouds.cpp @@ -95,6 +95,3 @@ void LLDrawPoolClouds::render(S32 pass) } -void LLDrawPoolClouds::renderForSelect() -{ -} diff --git a/indra/newview/lldrawpoolclouds.h b/indra/newview/lldrawpoolclouds.h index 548720ed9c..019f11a795 100644 --- a/indra/newview/lldrawpoolclouds.h +++ b/indra/newview/lldrawpoolclouds.h @@ -49,7 +49,6 @@ public: /*virtual*/ void enqueue(LLFace *face); /*virtual*/ void beginRenderPass(S32 pass); /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void renderForSelect(); }; #endif // LL_LLDRAWPOOLSKY_H diff --git a/indra/newview/lldrawpoolground.cpp b/indra/newview/lldrawpoolground.cpp index b4dc0c26a6..ce07e62122 100644 --- a/indra/newview/lldrawpoolground.cpp +++ b/indra/newview/lldrawpoolground.cpp @@ -85,7 +85,3 @@ void LLDrawPoolGround::render(S32 pass) glPopMatrix(); } -void LLDrawPoolGround::renderForSelect() -{ -} - diff --git a/indra/newview/lldrawpoolground.h b/indra/newview/lldrawpoolground.h index c6c7cbf964..a4f8a3fcf5 100644 --- a/indra/newview/lldrawpoolground.h +++ b/indra/newview/lldrawpoolground.h @@ -47,7 +47,6 @@ public: /*virtual*/ void prerender(); /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void renderForSelect(); }; #endif // LL_LLDRAWPOOLGROUND_H diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 9eb45a952c..6b45c5abb0 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -143,10 +143,6 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side) } } -void LLDrawPoolSky::renderForSelect() -{ -} - void LLDrawPoolSky::endRenderPass( S32 pass ) { } diff --git a/indra/newview/lldrawpoolsky.h b/indra/newview/lldrawpoolsky.h index 15d643c886..098bd2134a 100644 --- a/indra/newview/lldrawpoolsky.h +++ b/indra/newview/lldrawpoolsky.h @@ -58,7 +58,6 @@ public: /*virtual*/ void prerender(); /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void renderForSelect(); /*virtual*/ void endRenderPass(S32 pass); void setSkyTex(LLSkyTex* const st) { mSkyTex = st; } diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 3dede9d8fc..84eeace9c6 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -899,27 +899,6 @@ void LLDrawPoolTerrain::renderOwnership() } -void LLDrawPoolTerrain::renderForSelect() -{ - if (mDrawFace.empty()) - { - return; - } - - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); - iter != mDrawFace.end(); iter++) - { - LLFace *facep = *iter; - if (!facep->getDrawable()->isDead() && (facep->getDrawable()->getVObj()->mGLName)) - { - facep->renderForSelect(LLVertexBuffer::MAP_VERTEX); - } - } -} - void LLDrawPoolTerrain::dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures) { LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(mTexturep) ; diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h index 730298609d..3056da44d5 100644 --- a/indra/newview/lldrawpoolterrain.h +++ b/indra/newview/lldrawpoolterrain.h @@ -66,7 +66,6 @@ public: /*virtual*/ void prerender(); /*virtual*/ void beginRenderPass( S32 pass ); /*virtual*/ void endRenderPass( S32 pass ); - /*virtual*/ void renderForSelect(); /*virtual*/ void dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures); /*virtual*/ LLViewerTexture *getTexture(); /*virtual*/ LLViewerTexture *getDebugTexture(); diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 09cca8b73c..f1198c9a8d 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -183,68 +183,6 @@ void LLDrawPoolTree::endShadowPass(S32 pass) } -void LLDrawPoolTree::renderForSelect() -{ - if (mDrawFace.empty()) - { - return; - } - - LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); - - LLGLSObjectSelectAlpha gls_alpha; - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - gGL.setSceneBlendType(LLRender::BT_REPLACE); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); - - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); - gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); - - if (gSavedSettings.getBOOL("RenderAnimateTrees")) - { - renderTree(TRUE); - } - else - { - gGL.getTexUnit(sDiffTex)->bind(mTexturep); - - for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); - iter != mDrawFace.end(); iter++) - { - LLFace *face = *iter; - LLDrawable *drawablep = face->getDrawable(); - - if (drawablep->isDead() || face->mVertexBuffer.isNull()) - { - continue; - } - - // Render each of the trees - LLVOTree *treep = (LLVOTree *)drawablep->getVObj().get(); - - LLColor4U color(255,255,255,255); - - if (treep->mGLName != 0) - { - S32 name = treep->mGLName; - color = LLColor4U((U8)(name >> 16), (U8)(name >> 8), (U8)name, 255); - - LLFacePool::LLOverrideFaceColor col(this, color); - - face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); - face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0); - gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices()); - } - } - } - - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - gGL.setSceneBlendType(LLRender::BT_ALPHA); - - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); -} - void LLDrawPoolTree::renderTree(BOOL selecting) { LLGLState normalize(GL_NORMALIZE, TRUE); diff --git a/indra/newview/lldrawpooltree.h b/indra/newview/lldrawpooltree.h index cebe41f75f..ddb259bb82 100644 --- a/indra/newview/lldrawpooltree.h +++ b/indra/newview/lldrawpooltree.h @@ -62,7 +62,6 @@ public: /*virtual*/ void render(S32 pass = 0); /*virtual*/ void endRenderPass( S32 pass ); /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void renderForSelect(); /*virtual*/ BOOL verify() const; /*virtual*/ LLViewerTexture *getTexture(); /*virtual*/ LLViewerTexture *getDebugTexture(); diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 6126908231..0ee70bcdd1 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -591,12 +591,6 @@ void LLDrawPoolWater::shade() } -void LLDrawPoolWater::renderForSelect() -{ - // Can't select water! - return; -} - LLViewerTexture *LLDrawPoolWater::getDebugTexture() { return LLViewerFetchedTexture::sSmokeImagep; diff --git a/indra/newview/lldrawpoolwater.h b/indra/newview/lldrawpoolwater.h index 3ab4bc5e2c..2648a5276c 100644 --- a/indra/newview/lldrawpoolwater.h +++ b/indra/newview/lldrawpoolwater.h @@ -74,7 +74,6 @@ public: /*virtual*/ S32 getNumPasses(); /*virtual*/ void render(S32 pass = 0); /*virtual*/ void prerender(); - /*virtual*/ void renderForSelect(); /*virtual*/ LLViewerTexture *getDebugTexture(); /*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index d22950cad3..2471da9da5 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -399,84 +399,6 @@ void LLFace::updateCenterAgent() } } -void LLFace::renderForSelect(U32 data_mask) -{ - if(mDrawablep.isNull() || mVertexBuffer.isNull()) - { - return; - } - - LLSpatialGroup* group = mDrawablep->getSpatialGroup(); - if (!group || group->isState(LLSpatialGroup::GEOM_DIRTY)) - { - return; - } - - if (mVObjp->mGLName) - { - S32 name = mVObjp->mGLName; - - LLColor4U color((U8)(name >> 16), (U8)(name >> 8), (U8)name); -#if 0 // *FIX: Postponing this fix until we have texcoord pick info... - if (mTEOffset != -1) - { - color.mV[VALPHA] = (U8)(getTextureEntry()->getColor().mV[VALPHA] * 255.f); - } -#endif - glColor4ubv(color.mV); - - if (!getPool()) - { - switch (getPoolType()) - { - case LLDrawPool::POOL_ALPHA: - gGL.getTexUnit(0)->bind(getTexture()); - break; - default: - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - break; - } - } - - mVertexBuffer->setBuffer(data_mask); -#if !LL_RELEASE_FOR_DOWNLOAD - LLGLState::checkClientArrays("", data_mask); -#endif - if (mTEOffset != -1) - { - // mask off high 4 bits (16 total possible faces) - color.mV[0] &= 0x0f; - color.mV[0] |= (mTEOffset & 0x0f) << 4; - glColor4ubv(color.mV); - } - - if (mIndicesCount) - { - if (isState(GLOBAL)) - { - if (mDrawablep->getVOVolume()) - { - glPushMatrix(); - glMultMatrixf((float*) mDrawablep->getRegion()->mRenderMatrix.mMatrix); - mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); - glPopMatrix(); - } - else - { - mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); - } - } - else - { - glPushMatrix(); - glMultMatrixf((float*)getRenderMatrix().mMatrix); - mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); - glPopMatrix(); - } - } - } -} - void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) { if (mDrawablep->getSpatialGroup() == NULL) diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 0166e45bee..6c941bd092 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -173,7 +173,6 @@ public: void updateCenterAgent(); // Update center when xform has changed. void renderSelectedUV(); - void renderForSelect(U32 data_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); void renderSelected(LLViewerTexture *image, const LLColor4 &color); F32 getKey() const { return mDistance; } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index a09c0ea0f8..92a3b9b2f5 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -1086,14 +1086,22 @@ LLSD LLFastTimerView::analyzePerformanceLogDefault(std::istream& is) //static void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target, std::string output) { + // Open baseline and current target, exit if one is inexistent + std::ifstream base_is(baseline.c_str()); + std::ifstream target_is(target.c_str()); + if (!base_is.is_open() || !target_is.is_open()) + { + llwarns << "'-analyzeperformance' error : baseline or current target file inexistent" << llendl; + base_is.close(); + target_is.close(); + return; + } //analyze baseline - std::ifstream base_is(baseline.c_str()); LLSD base = analyzePerformanceLogDefault(base_is); base_is.close(); //analyze current - std::ifstream target_is(target.c_str()); LLSD current = analyzePerformanceLogDefault(target_is); target_is.close(); @@ -1154,15 +1162,15 @@ LLSD LLFastTimerView::analyzeMetricPerformanceLog(std::istream& is) { std::string label = iter->first; - LLMetricPerformanceTester* tester = LLMetricPerformanceTester::getTester(iter->second["Name"].asString()) ; + LLMetricPerformanceTesterBasic* tester = LLMetricPerformanceTesterBasic::getTester(iter->second["Name"].asString()) ; if(tester) { ret[label]["Name"] = iter->second["Name"] ; - S32 num_of_strings = tester->getNumOfMetricStrings() ; - for(S32 index = 0 ; index < num_of_strings ; index++) + S32 num_of_metrics = tester->getNumberOfMetrics() ; + for(S32 index = 0 ; index < num_of_metrics ; index++) { - ret[label][ tester->getMetricString(index) ] = iter->second[ tester->getMetricString(index) ] ; + ret[label][ tester->getMetricName(index) ] = iter->second[ tester->getMetricName(index) ] ; } } } @@ -1172,20 +1180,43 @@ LLSD LLFastTimerView::analyzeMetricPerformanceLog(std::istream& is) } //static +void LLFastTimerView::outputAllMetrics() +{ + if (LLMetricPerformanceTesterBasic::hasMetricPerformanceTesters()) + { + for (LLMetricPerformanceTesterBasic::name_tester_map_t::iterator iter = LLMetricPerformanceTesterBasic::sTesterMap.begin(); + iter != LLMetricPerformanceTesterBasic::sTesterMap.end(); ++iter) + { + LLMetricPerformanceTesterBasic* tester = ((LLMetricPerformanceTesterBasic*)iter->second); + tester->outputTestResults(); + } + } +} + +//static void LLFastTimerView::doAnalysisMetrics(std::string baseline, std::string target, std::string output) { - if(!LLMetricPerformanceTester::hasMetricPerformanceTesters()) + if(!LLMetricPerformanceTesterBasic::hasMetricPerformanceTesters()) { return ; } - //analyze baseline + // Open baseline and current target, exit if one is inexistent std::ifstream base_is(baseline.c_str()); + std::ifstream target_is(target.c_str()); + if (!base_is.is_open() || !target_is.is_open()) + { + llwarns << "'-analyzeperformance' error : baseline or current target file inexistent" << llendl; + base_is.close(); + target_is.close(); + return; + } + + //analyze baseline LLSD base = analyzeMetricPerformanceLog(base_is); base_is.close(); //analyze current - std::ifstream target_is(target.c_str()); LLSD current = analyzeMetricPerformanceLog(target_is); target_is.close(); @@ -1193,10 +1224,10 @@ void LLFastTimerView::doAnalysisMetrics(std::string baseline, std::string target std::ofstream os(output.c_str()); os << "Label, Metric, Base(B), Target(T), Diff(T-B), Percentage(100*T/B)\n"; - for(LLMetricPerformanceTester::name_tester_map_t::iterator iter = LLMetricPerformanceTester::sTesterMap.begin() ; - iter != LLMetricPerformanceTester::sTesterMap.end() ; ++iter) + for(LLMetricPerformanceTesterBasic::name_tester_map_t::iterator iter = LLMetricPerformanceTesterBasic::sTesterMap.begin() ; + iter != LLMetricPerformanceTesterBasic::sTesterMap.end() ; ++iter) { - LLMetricPerformanceTester* tester = ((LLMetricPerformanceTester*)iter->second) ; + LLMetricPerformanceTesterBasic* tester = ((LLMetricPerformanceTesterBasic*)iter->second) ; tester->analyzePerformance(&os, &base, ¤t) ; } diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 3788897cec..1a54a53f09 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -37,6 +37,7 @@ public: static BOOL sAnalyzePerformance; + static void outputAllMetrics(); static void doAnalysis(std::string baseline, std::string target, std::string output); private: diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 2bea3d37ff..5becd8f990 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -803,7 +803,7 @@ void LLFloaterPreference::buildPopupLists() LLScrollListItem* item = NULL; - bool show_popup = formp->getIgnored(); + bool show_popup = !formp->getIgnored(); if (!show_popup) { if (ignore == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE) @@ -1155,7 +1155,7 @@ void LLFloaterPreference::onClickDisablePopup() for (itor = items.begin(); itor != items.end(); ++itor) { LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata())); - templatep->mForm->setIgnored(false); + templatep->mForm->setIgnored(true); } buildPopupLists(); @@ -1169,7 +1169,7 @@ void LLFloaterPreference::resetAllIgnored() { if (iter->second->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO) { - iter->second->mForm->setIgnored(true); + iter->second->mForm->setIgnored(false); } } } @@ -1182,7 +1182,7 @@ void LLFloaterPreference::setAllIgnored() { if (iter->second->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO) { - iter->second->mForm->setIgnored(false); + iter->second->mForm->setIgnored(true); } } } diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 36e8ad9dfc..51ee38bd65 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1212,8 +1212,6 @@ LLViewerWindow::ESnapshotType LLFloaterSnapshot::Impl::getLayerType(LLFloaterSna type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; else if (id == "depth") type = LLViewerWindow::SNAPSHOT_TYPE_DEPTH; - else if (id == "objects") - type = LLViewerWindow::SNAPSHOT_TYPE_OBJECT_ID; return type; } diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index e5c4547226..2aaf403d5f 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -147,17 +147,6 @@ void LLFloaterTopObjects::handle_land_reply(LLMessageSystem* msg, void** data) } -void LLFloaterTopObjects::onAvatarNameCache(const LLUUID& agent_id, - const LLAvatarName& av_name, - LLSD element) -{ - LLScrollListCtrl *list = getChild<LLScrollListCtrl>("objects_list"); - - element["columns"][2]["value"] = av_name.getCompleteName(); - - list->addElement(element); -} - void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) { U32 request_flags; @@ -182,7 +171,6 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) F32 mono_score = 0.f; bool have_extended_data = false; S32 public_urls = 0; - LLUUID owner_id; msg->getU32Fast(_PREHASH_ReportData, _PREHASH_TaskLocalID, task_local_id, block); msg->getUUIDFast(_PREHASH_ReportData, _PREHASH_TaskID, task_id, block); @@ -198,10 +186,8 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) msg->getU32("DataExtended", "TimeStamp", time_stamp, block); msg->getF32("DataExtended", "MonoScore", mono_score, block); msg->getS32(_PREHASH_ReportData,"PublicURLs",public_urls,block); - msg->getUUID("DataExtended","OwnerID",owner_id,block); } - LLSD element; element["id"] = task_id; @@ -252,16 +238,8 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) columns[6]["font"] = "SANSSERIF"; } element["columns"] = columns; + list->addElement(element); - if (!owner_id.isNull()) - { - LLAvatarNameCache::get(owner_id, boost::bind(&LLFloaterTopObjects::onAvatarNameCache, this, _1, _2, element)); - } - else - { - list->addElement(element); - } - mObjectListData.append(element); mObjectListIDs.push_back(task_id); diff --git a/indra/newview/llfloatertopobjects.h b/indra/newview/llfloatertopobjects.h index edd91c491f..a608ca20f1 100644 --- a/indra/newview/llfloatertopobjects.h +++ b/indra/newview/llfloatertopobjects.h @@ -29,11 +29,8 @@ #include "llfloater.h" -class LLAvatarName; class LLUICtrl; -#include <boost/signals2.hpp> // boost::signals2::trackable - class LLFloaterTopObjects : public LLFloater { friend class LLFloaterReg; @@ -54,8 +51,6 @@ public: static void setMode(U32 mode); - void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name, LLSD element); - private: LLFloaterTopObjects(const LLSD& key); ~LLFloaterTopObjects(); diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index d43b3a5d6e..842911ecc0 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -663,35 +663,27 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV x2 = x1 + PARCEL_GRID_STEP_METERS; y2 = y1; - if (gRenderForSelect) - { - LLColor4U color((U8)(GL_NAME_PARCEL_WALL >> 16), (U8)(GL_NAME_PARCEL_WALL >> 8), (U8)GL_NAME_PARCEL_WALL); - gGL.color4ubv(color.mV); - } - else - { - dy = (pos_y - y1) + DIST_OFFSET; - - if (pos_x < x1) - dx = pos_x - x1; - else if (pos_x > x2) - dx = pos_x - x2; - else - dx = 0; + dy = (pos_y - y1) + DIST_OFFSET; - dist = dx*dx+dy*dy; - - if (dist < MIN_DIST_SQ) - alpha = MAX_ALPHA; - else if (dist > MAX_DIST_SQ) - alpha = 0.0f; - else - alpha = 30/dist; - - alpha = llclamp(alpha, 0.0f, MAX_ALPHA); - - gGL.color4f(1.f, 1.f, 1.f, alpha); - } + if (pos_x < x1) + dx = pos_x - x1; + else if (pos_x > x2) + dx = pos_x - x2; + else + dx = 0; + + dist = dx*dx+dy*dy; + + if (dist < MIN_DIST_SQ) + alpha = MAX_ALPHA; + else if (dist > MAX_DIST_SQ) + alpha = 0.0f; + else + alpha = 30/dist; + + alpha = llclamp(alpha, 0.0f, MAX_ALPHA); + + gGL.color4f(1.f, 1.f, 1.f, alpha); if ((pos_y - y1) < 0) direction = SOUTH_MASK; else direction = NORTH_MASK; @@ -709,35 +701,27 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV x2 = x1; y2 = y1 + PARCEL_GRID_STEP_METERS; - if (gRenderForSelect) - { - LLColor4U color((U8)(GL_NAME_PARCEL_WALL >> 16), (U8)(GL_NAME_PARCEL_WALL >> 8), (U8)GL_NAME_PARCEL_WALL); - gGL.color4ubv(color.mV); - } + dx = (pos_x - x1) + DIST_OFFSET; + + if (pos_y < y1) + dy = pos_y - y1; + else if (pos_y > y2) + dy = pos_y - y2; + else + dy = 0; + + dist = dx*dx+dy*dy; + + if (dist < MIN_DIST_SQ) + alpha = MAX_ALPHA; + else if (dist > MAX_DIST_SQ) + alpha = 0.0f; else - { - dx = (pos_x - x1) + DIST_OFFSET; - - if (pos_y < y1) - dy = pos_y - y1; - else if (pos_y > y2) - dy = pos_y - y2; - else - dy = 0; - - dist = dx*dx+dy*dy; - - if (dist < MIN_DIST_SQ) - alpha = MAX_ALPHA; - else if (dist > MAX_DIST_SQ) - alpha = 0.0f; - else - alpha = 30/dist; - - alpha = llclamp(alpha, 0.0f, MAX_ALPHA); + alpha = 30/dist; + + alpha = llclamp(alpha, 0.0f, MAX_ALPHA); - gGL.color4f(1.f, 1.f, 1.f, alpha); - } + gGL.color4f(1.f, 1.f, 1.f, alpha); if ((pos_x - x1) > 0) direction = WEST_MASK; else direction = EAST_MASK; diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp index aea8c5928b..568b0ae585 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -201,11 +201,6 @@ void LLHUDIcon::render() renderIcon(FALSE); } -void LLHUDIcon::renderForSelect() -{ - renderIcon(TRUE); -} - BOOL LLHUDIcon::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, LLVector3* intersection) { if (mHidden) diff --git a/indra/newview/llhudicon.h b/indra/newview/llhudicon.h index 8d7b8d4288..644daa0299 100644 --- a/indra/newview/llhudicon.h +++ b/indra/newview/llhudicon.h @@ -52,7 +52,6 @@ friend class LLHUDObject; public: /*virtual*/ void render(); - /*virtual*/ void renderForSelect(); /*virtual*/ void markDead(); /*virtual*/ F32 getDistance() const { return mDistance; } diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp index 09200ee5be..5e762ee037 100644 --- a/indra/newview/llhudobject.cpp +++ b/indra/newview/llhudobject.cpp @@ -284,27 +284,6 @@ void LLHUDObject::renderAll() } // static -void LLHUDObject::renderAllForSelect() -{ - LLHUDObject *hud_objp; - - hud_object_list_t::iterator object_it; - for (object_it = sHUDObjects.begin(); object_it != sHUDObjects.end(); ) - { - hud_object_list_t::iterator cur_it = object_it++; - hud_objp = (*cur_it); - if (hud_objp->getNumRefs() == 1) - { - sHUDObjects.erase(cur_it); - } - else if (hud_objp->isVisible()) - { - hud_objp->renderForSelect(); - } - } -} - -// static void LLHUDObject::renderAllForTimer() { LLHUDObject *hud_objp; diff --git a/indra/newview/llhudobject.h b/indra/newview/llhudobject.h index 4282ade34d..33e6394445 100644 --- a/indra/newview/llhudobject.h +++ b/indra/newview/llhudobject.h @@ -104,7 +104,6 @@ protected: ~LLHUDObject(); virtual void render() = 0; - virtual void renderForSelect() {}; virtual void renderForTimer() {}; protected: diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 6a423e529a..f7e5103d88 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -113,36 +113,21 @@ void LLHUDText::render() if (!mOnHUDAttachment && sDisplayText) { LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - renderText(FALSE); + renderText(); } } -void LLHUDText::renderForSelect() -{ - if (!mOnHUDAttachment) - { - LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - renderText(TRUE); - } -} - -void LLHUDText::renderText(BOOL for_select) +void LLHUDText::renderText() { if (!mVisible || mHidden) { return; } - // don't pick text - if (for_select) - { - return; - } - gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - LLGLState gls_blend(GL_BLEND, for_select ? FALSE : TRUE); - LLGLState gls_alpha(GL_ALPHA_TEST, for_select ? FALSE : TRUE); + LLGLState gls_blend(GL_BLEND, TRUE); + LLGLState gls_alpha(GL_ALPHA_TEST, TRUE); LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f); F32 alpha_factor = 1.f; @@ -594,7 +579,7 @@ void LLHUDText::renderAllHUD() for (text_it = sVisibleHUDTextObjects.begin(); text_it != sVisibleHUDTextObjects.end(); ++text_it) { - (*text_it)->renderText(FALSE); + (*text_it)->renderText(); } } diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index f05ee4d594..36015d51f0 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -128,8 +128,7 @@ protected: LLHUDText(const U8 type); /*virtual*/ void render(); - /*virtual*/ void renderForSelect(); - void renderText(BOOL for_select); + void renderText(); static void updateAll(); S32 getMaxLines(); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 650d329e18..3f72d66bfb 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -62,7 +62,7 @@ class LLIMModel : public LLSingleton<LLIMModel> { public: - struct LLIMSession + struct LLIMSession : public boost::signals2::trackable { typedef enum e_session_type { // for now we have 4 predefined types for a session diff --git a/indra/newview/llmetricperformancetester.cpp b/indra/newview/llmetricperformancetester.cpp deleted file mode 100644 index 903c97378e..0000000000 --- a/indra/newview/llmetricperformancetester.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/** - * @file llmetricperformancetester.cpp - * @brief LLMetricPerformanceTester class implementation - * - * $LicenseInfo:firstyear=2004&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "indra_constants.h" -#include "llerror.h" -#include "llmath.h" -#include "llfontgl.h" -#include "llsdserialize.h" -#include "llstat.h" -#include "lltreeiterators.h" -#include "llmetricperformancetester.h" - -LLMetricPerformanceTester::name_tester_map_t LLMetricPerformanceTester::sTesterMap ; - -//static -void LLMetricPerformanceTester::initClass() -{ -} -//static -void LLMetricPerformanceTester::cleanClass() -{ - for(name_tester_map_t::iterator iter = sTesterMap.begin() ; iter != sTesterMap.end() ; ++iter) - { - delete iter->second ; - } - sTesterMap.clear() ; -} - -//static -void LLMetricPerformanceTester::addTester(LLMetricPerformanceTester* tester) -{ - if(!tester) - { - llerrs << "invalid tester!" << llendl ; - return ; - } - - std::string name = tester->getName() ; - if(getTester(name)) - { - llerrs << "Tester name is used by some other tester: " << name << llendl ; - return ; - } - - sTesterMap.insert(std::make_pair(name, tester)); - - return ; -} - -//static -LLMetricPerformanceTester* LLMetricPerformanceTester::getTester(std::string label) -{ - name_tester_map_t::iterator found_it = sTesterMap.find(label) ; - if(found_it != sTesterMap.end()) - { - return found_it->second ; - } - - return NULL ; -} - -LLMetricPerformanceTester::LLMetricPerformanceTester(std::string name, BOOL use_default_performance_analysis) - : mName(name), - mBaseSessionp(NULL), - mCurrentSessionp(NULL), - mCount(0), - mUseDefaultPerformanceAnalysis(use_default_performance_analysis) -{ - if(mName == std::string()) - { - llerrs << "invalid name." << llendl ; - } - - LLMetricPerformanceTester::addTester(this) ; -} - -/*virtual*/ -LLMetricPerformanceTester::~LLMetricPerformanceTester() -{ - if(mBaseSessionp) - { - delete mBaseSessionp ; - mBaseSessionp = NULL ; - } - if(mCurrentSessionp) - { - delete mCurrentSessionp ; - mCurrentSessionp = NULL ; - } -} - -void LLMetricPerformanceTester::incLabel() -{ - mCurLabel = llformat("%s-%d", mName.c_str(), mCount++) ; -} -void LLMetricPerformanceTester::preOutputTestResults(LLSD* sd) -{ - incLabel() ; - (*sd)[mCurLabel]["Name"] = mName ; -} -void LLMetricPerformanceTester::postOutputTestResults(LLSD* sd) -{ - LLMutexLock lock(LLFastTimer::sLogLock); - LLFastTimer::sLogQueue.push((*sd)); -} - -void LLMetricPerformanceTester::outputTestResults() -{ - LLSD sd ; - preOutputTestResults(&sd) ; - - outputTestRecord(&sd) ; - - postOutputTestResults(&sd) ; -} - -void LLMetricPerformanceTester::addMetricString(std::string str) -{ - mMetricStrings.push_back(str) ; -} - -const std::string& LLMetricPerformanceTester::getMetricString(U32 index) const -{ - return mMetricStrings[index] ; -} - -void LLMetricPerformanceTester::prePerformanceAnalysis() -{ - mCount = 0 ; - incLabel() ; -} - -// -//default analyzing the performance -// -/*virtual*/ -void LLMetricPerformanceTester::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) -{ - if(mUseDefaultPerformanceAnalysis)//use default performance analysis - { - prePerformanceAnalysis() ; - - BOOL in_base = (*base).has(mCurLabel) ; - BOOL in_current = (*current).has(mCurLabel) ; - - while(in_base || in_current) - { - LLSD::String label = mCurLabel ; - - if(in_base && in_current) - { - *os << llformat("%s\n", label.c_str()) ; - - for(U32 index = 0 ; index < mMetricStrings.size() ; index++) - { - switch((*current)[label][ mMetricStrings[index] ].type()) - { - case LLSD::TypeInteger: - compareTestResults(os, mMetricStrings[index], - (S32)((*base)[label][ mMetricStrings[index] ].asInteger()), (S32)((*current)[label][ mMetricStrings[index] ].asInteger())) ; - break ; - case LLSD::TypeReal: - compareTestResults(os, mMetricStrings[index], - (F32)((*base)[label][ mMetricStrings[index] ].asReal()), (F32)((*current)[label][ mMetricStrings[index] ].asReal())) ; - break; - default: - llerrs << "unsupported metric " << mMetricStrings[index] << " LLSD type: " << (S32)(*current)[label][ mMetricStrings[index] ].type() << llendl ; - } - } - } - - incLabel() ; - in_base = (*base).has(mCurLabel) ; - in_current = (*current).has(mCurLabel) ; - } - }//end of default - else - { - //load the base session - prePerformanceAnalysis() ; - mBaseSessionp = loadTestSession(base) ; - - //load the current session - prePerformanceAnalysis() ; - mCurrentSessionp = loadTestSession(current) ; - - if(!mBaseSessionp || !mCurrentSessionp) - { - llerrs << "memory error during loading test sessions." << llendl ; - } - - //compare - compareTestSessions(os) ; - - //release memory - if(mBaseSessionp) - { - delete mBaseSessionp ; - mBaseSessionp = NULL ; - } - if(mCurrentSessionp) - { - delete mCurrentSessionp ; - mCurrentSessionp = NULL ; - } - } -} - -//virtual -void LLMetricPerformanceTester::compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) -{ - *os << llformat(" ,%s, %d, %d, %d, %.4f\n", metric_string.c_str(), v_base, v_current, - v_current - v_base, (v_base != 0) ? 100.f * v_current / v_base : 0) ; -} - -//virtual -void LLMetricPerformanceTester::compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) -{ - *os << llformat(" ,%s, %.4f, %.4f, %.4f, %.4f\n", metric_string.c_str(), v_base, v_current, - v_current - v_base, (fabs(v_base) > 0.0001f) ? 100.f * v_current / v_base : 0.f ) ; -} - -//virtual -LLMetricPerformanceTester::LLTestSession::~LLTestSession() -{ -} - diff --git a/indra/newview/llmetricperformancetester.h b/indra/newview/llmetricperformancetester.h deleted file mode 100644 index 6f5dc03564..0000000000 --- a/indra/newview/llmetricperformancetester.h +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file LLMetricPerformanceTester.h - * @brief LLMetricPerformanceTester class definition - * - * $LicenseInfo:firstyear=2004&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_METRICPERFORMANCETESTER_H -#define LL_METRICPERFORMANCETESTER_H - -class LLMetricPerformanceTester -{ -public: - // - //name passed to the constructor is a unique string for each tester. - //an error is reported if the name is already used by some other tester. - // - LLMetricPerformanceTester(std::string name, BOOL use_default_performance_analysis) ; - virtual ~LLMetricPerformanceTester(); - - // - //return the name of the tester - // - std::string getName() const { return mName ;} - // - //return the number of the test metrics in this tester - // - S32 getNumOfMetricStrings() const { return mMetricStrings.size() ;} - // - //return the metric string at the index - // - const std::string& getMetricString(U32 index) const ; - - // - //this function to compare the test results. - //by default, it compares the test results against the baseline one by one, item by item, - //in the increasing order of the LLSD label counter, starting from the first one. - //you can define your own way to analyze performance by passing FALSE to "use_default_performance_analysis", - //and implement two abstract virtual functions below: loadTestSession(...) and compareTestSessions(...). - // - void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; - -protected: - // - //insert metric strings used in the tester. - // - void addMetricString(std::string str) ; - - // - //increase LLSD label by 1 - // - void incLabel() ; - - // - //the function to write a set of test results to the log LLSD. - // - void outputTestResults() ; - - // - //compare the test results. - //you can write your own to overwrite the default one. - // - virtual void compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) ; - virtual void compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) ; - - // - //for performance analysis use - //it defines an interface for the two abstract virtual functions loadTestSession(...) and compareTestSessions(...). - //please make your own test session class derived from it. - // - class LLTestSession - { - public: - virtual ~LLTestSession() ; - }; - - // - //load a test session for log LLSD - //you need to implement it only when you define your own way to analyze performance. - //otherwise leave it empty. - // - virtual LLMetricPerformanceTester::LLTestSession* loadTestSession(LLSD* log) = 0 ; - // - //compare the base session and the target session - //you need to implement it only when you define your own way to analyze performance. - //otherwise leave it empty. - // - virtual void compareTestSessions(std::ofstream* os) = 0 ; - // - //the function to write a set of test results to the log LLSD. - //you have to write you own version of this function. - // - virtual void outputTestRecord(LLSD* sd) = 0 ; - -private: - void preOutputTestResults(LLSD* sd) ; - void postOutputTestResults(LLSD* sd) ; - void prePerformanceAnalysis() ; - -protected: - // - //the unique name string of the tester - // - std::string mName ; - // - //the current label counter for the log LLSD - // - std::string mCurLabel ; - S32 mCount ; - - BOOL mUseDefaultPerformanceAnalysis ; - LLTestSession* mBaseSessionp ; - LLTestSession* mCurrentSessionp ; - - //metrics strings - std::vector< std::string > mMetricStrings ; - -//static members -private: - static void addTester(LLMetricPerformanceTester* tester) ; - -public: - typedef std::map< std::string, LLMetricPerformanceTester* > name_tester_map_t; - static name_tester_map_t sTesterMap ; - - static LLMetricPerformanceTester* getTester(std::string label) ; - static BOOL hasMetricPerformanceTesters() {return !sTesterMap.empty() ;} - - static void initClass() ; - static void cleanClass() ; -}; - -#endif - diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index d6d38de225..13fd51f473 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1574,7 +1574,6 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con if (!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C)) { // Only do partial requests for J2C at the moment - //llinfos << "Merov : LLTextureFetch::createRequest(), blocking fetch on " << url << llendl; desired_size = MAX_IMAGE_DATA_SIZE; desired_discard = 0; } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 1d5caabebb..ddb11829df 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -95,6 +95,7 @@ BOOL gForceRenderLandFence = FALSE; BOOL gDisplaySwapBuffers = FALSE; BOOL gDepthDirty = FALSE; BOOL gResizeScreenTexture = FALSE; +BOOL gWindowResized = FALSE; BOOL gSnapshot = FALSE; U32 gRecentFrameCount = 0; // number of 'recent' frames @@ -218,22 +219,15 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLMemType mt_render(LLMemType::MTYPE_RENDER); LLFastTimer t(FTM_RENDER); - if (gResizeScreenTexture) - { //skip render on frames where screen texture is resizing + if (gWindowResized) + { //skip render on frames where window has been resized gGL.flush(); - if (!for_snapshot) - { - glClear(GL_COLOR_BUFFER_BIT); - gViewerWindow->mWindow->swapBuffers(); - } - - gResizeScreenTexture = FALSE; + glClear(GL_COLOR_BUFFER_BIT); + gViewerWindow->mWindow->swapBuffers(); gPipeline.resizeScreenTexture(); - - if (!for_snapshot) - { - return; - } + gResizeScreenTexture = FALSE; + gWindowResized = FALSE; + return; } if (LLPipeline::sRenderDeferred) @@ -666,11 +660,11 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLVertexBuffer::clientCopy(0.016); } - //if (gResizeScreenTexture) - //{ - // gResizeScreenTexture = FALSE; - // gPipeline.resizeScreenTexture(); - //} + if (gResizeScreenTexture) + { + gResizeScreenTexture = FALSE; + gPipeline.resizeScreenTexture(); + } gGL.setColorMask(true, true); glClearColor(0,0,0,0); diff --git a/indra/newview/llviewerdisplay.h b/indra/newview/llviewerdisplay.h index c6e86751e8..f6467d7f93 100644 --- a/indra/newview/llviewerdisplay.h +++ b/indra/newview/llviewerdisplay.h @@ -40,5 +40,6 @@ extern BOOL gTeleportDisplay; extern LLFrameTimer gTeleportDisplayTimer; extern BOOL gForceRenderLandFence; extern BOOL gResizeScreenTexture; +extern BOOL gWindowResized; #endif // LL_LLVIEWERDISPLAY_H diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index 0cf5fe0ada..baf85d6884 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -257,7 +257,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) // if object is transparent, defer it, otherwise // give the joint subclass a chance to draw itself //---------------------------------------------------------------- - if ( gRenderForSelect || is_dummy ) + if ( is_dummy ) { triangle_count += drawShape( pixelArea, first_pass, is_dummy ); } diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index ae2aa41b3a..e59e685f53 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -61,7 +61,6 @@ extern PFNGLWEIGHTPOINTERARBPROC glWeightPointerARB; extern PFNGLWEIGHTFVARBPROC glWeightfvARB; extern PFNGLVERTEXBLENDARBPROC glVertexBlendARB; #endif -extern BOOL gRenderForSelect; static LLPointer<LLVertexBuffer> sRenderBuffer = NULL; static const U32 sRenderMask = LLVertexBuffer::MAP_VERTEX | @@ -515,17 +514,14 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) //---------------------------------------------------------------- // setup current color //---------------------------------------------------------------- - if (!gRenderForSelect) - { - if (is_dummy) - glColor4fv(LLVOAvatar::getDummyColor().mV); - else - glColor4fv(mColor.mV); - } + if (is_dummy) + glColor4fv(LLVOAvatar::getDummyColor().mV); + else + glColor4fv(mColor.mV); stop_glerror(); - LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), gRenderForSelect ? 0.0f : mShiny && !(mFace->getPool()->getVertexShaderLevel() > 0)); + LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), mShiny && !(mFace->getPool()->getVertexShaderLevel() > 0)); //---------------------------------------------------------------- // setup current texture @@ -580,19 +576,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) gGL.getTexUnit(0)->bind(LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT)); } - if (gRenderForSelect) - { - if (isTransparent()) - { - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); - gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_CONST_ALPHA); - } - else - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - } - } - mFace->mVertexBuffer->setBuffer(sRenderMask); U32 start = mMesh->mFaceVertexOffset; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 598ad7afc6..0ca30d5f3d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2509,15 +2509,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) invite_bucket = (struct invite_bucket_t*) &binary_bucket[0]; S32 membership_fee = ntohl(invite_bucket->membership_fee); - // IDEVO Clean up legacy name "Resident" in message constructed in - // lldatagroups.cpp - U32 pos = message.find(" has invited you to join a group.\n"); - if (pos != std::string::npos) - { - // use cleaned-up name from above - message = name + message.substr(pos); - } - LLSD payload; payload["transaction_id"] = session_id; payload["group_id"] = from_id; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index f9bf0543c4..a414e86866 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1274,34 +1274,6 @@ void LLViewerObjectList::generatePickList(LLCamera &camera) } } -void LLViewerObjectList::renderPickList(const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent) -{ - gRenderForSelect = TRUE; - - gPipeline.renderForSelect(mSelectPickList, render_transparent, screen_rect); - - // - // Render pass for selected objects - // - gGL.color4f(1,1,1,1); - gViewerWindow->renderSelections( TRUE, pick_parcel_wall, FALSE ); - - //fix for DEV-19335. Don't pick hud objects when customizing avatar (camera mode doesn't play nice with nametags). - if (!gAgentCamera.cameraCustomizeAvatar()) - { - // render pickable ui elements, like names, etc. - LLHUDObject::renderAllForSelect(); - } - - gGL.flush(); - LLVertexBuffer::unbind(); - - gRenderForSelect = FALSE; - - //llinfos << "Rendered " << count << " for select" << llendl; - //llinfos << "Took " << pick_timer.getElapsedTimeF32()*1000.f << "ms to pick" << llendl; -} - LLViewerObject *LLViewerObjectList::getSelectedObject(const U32 object_id) { std::set<LLViewerObject*>::iterator pick_it; diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index eba5584b57..605bac8e89 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -104,7 +104,6 @@ public: // Selection related stuff void generatePickList(LLCamera &camera); - void renderPickList(const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent); LLViewerObject *getSelectedObject(const U32 object_id); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index f96b93da4d..6160510c0e 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -72,6 +72,7 @@ LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sDefaultImagep = NULL; LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sSmokeImagep = NULL; LLViewerMediaTexture::media_map_t LLViewerMediaTexture::sMediaMap ; LLTexturePipelineTester* LLViewerTextureManager::sTesterp = NULL ; +const std::string sTesterName("TextureTester"); S32 LLViewerTexture::sImageCount = 0; S32 LLViewerTexture::sRawCount = 0; @@ -341,9 +342,14 @@ void LLViewerTextureManager::init() LLViewerTexture::initClass() ; - if(LLFastTimer::sMetricLog) + if (LLMetricPerformanceTesterBasic::isMetricLogRequested(sTesterName) && !LLMetricPerformanceTesterBasic::getTester(sTesterName)) { - LLViewerTextureManager::sTesterp = new LLTexturePipelineTester() ; + sTesterp = new LLTexturePipelineTester() ; + if (!sTesterp->isValid()) + { + delete sTesterp; + sTesterp = NULL; + } } } @@ -408,9 +414,10 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity { sCurrentTime = gFrameTimeSeconds ; - if(LLViewerTextureManager::sTesterp) + LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName); + if (tester) { - LLViewerTextureManager::sTesterp->update() ; + tester->update() ; } LLViewerMediaTexture::updateClass() ; @@ -603,9 +610,10 @@ bool LLViewerTexture::bindDefaultImage(S32 stage) //check if there is cached raw image and switch to it if possible switchToCachedImage() ; - if(LLViewerTextureManager::sTesterp) + LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName); + if (tester) { - LLViewerTextureManager::sTesterp->updateGrayTextureBinding() ; + tester->updateGrayTextureBinding() ; } return res; } @@ -1066,9 +1074,10 @@ BOOL LLViewerTexture::isLargeImage() //virtual void LLViewerTexture::updateBindStatsForTester() { - if(LLViewerTextureManager::sTesterp) + LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName); + if (tester) { - LLViewerTextureManager::sTesterp->updateTextureBindingStats(this) ; + tester->updateTextureBindingStats(this) ; } } @@ -1849,10 +1858,11 @@ bool LLViewerFetchedTexture::updateFetch() // We may have data ready regardless of whether or not we are finished (e.g. waiting on write) if (mRawImage.notNull()) { - if(LLViewerTextureManager::sTesterp) + LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName); + if (tester) { mIsFetched = TRUE ; - LLViewerTextureManager::sTesterp->updateTextureLoadingStats(this, mRawImage, LLAppViewer::getTextureFetch()->isFromLocalCache(mID)) ; + tester->updateTextureLoadingStats(this, mRawImage, LLAppViewer::getTextureFetch()->isFromLocalCache(mID)) ; } mRawDiscardLevel = fetch_discard; if ((mRawImage->getDataSize() > 0 && mRawDiscardLevel >= 0) && @@ -3076,9 +3086,10 @@ void LLViewerLODTexture::scaleDown() { switchToCachedImage() ; - if(LLViewerTextureManager::sTesterp) + LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName); + if (tester) { - LLViewerTextureManager::sTesterp->setStablizingTime() ; + tester->setStablizingTime() ; } } } @@ -3588,23 +3599,22 @@ F32 LLViewerMediaTexture::getMaxVirtualSize() //---------------------------------------------------------------------------------------------- //start of LLTexturePipelineTester //---------------------------------------------------------------------------------------------- -LLTexturePipelineTester::LLTexturePipelineTester() : - LLMetricPerformanceTester("TextureTester", FALSE) -{ - addMetricString("TotalBytesLoaded") ; - addMetricString("TotalBytesLoadedFromCache") ; - addMetricString("TotalBytesLoadedForLargeImage") ; - addMetricString("TotalBytesLoadedForSculpties") ; - addMetricString("StartFetchingTime") ; - addMetricString("TotalGrayTime") ; - addMetricString("TotalStablizingTime") ; - addMetricString("StartTimeLoadingSculpties") ; - addMetricString("EndTimeLoadingSculpties") ; - - addMetricString("Time") ; - addMetricString("TotalBytesBound") ; - addMetricString("TotalBytesBoundForLargeImage") ; - addMetricString("PercentageBytesBound") ; +LLTexturePipelineTester::LLTexturePipelineTester() : LLMetricPerformanceTesterWithSession(sTesterName) +{ + addMetric("TotalBytesLoaded") ; + addMetric("TotalBytesLoadedFromCache") ; + addMetric("TotalBytesLoadedForLargeImage") ; + addMetric("TotalBytesLoadedForSculpties") ; + addMetric("StartFetchingTime") ; + addMetric("TotalGrayTime") ; + addMetric("TotalStablizingTime") ; + addMetric("StartTimeLoadingSculpties") ; + addMetric("EndTimeLoadingSculpties") ; + + addMetric("Time") ; + addMetric("TotalBytesBound") ; + addMetric("TotalBytesBoundForLargeImage") ; + addMetric("PercentageBytesBound") ; mTotalBytesLoaded = 0 ; mTotalBytesLoadedFromCache = 0 ; @@ -3616,7 +3626,7 @@ LLTexturePipelineTester::LLTexturePipelineTester() : LLTexturePipelineTester::~LLTexturePipelineTester() { - LLViewerTextureManager::sTesterp = NULL ; + LLViewerTextureManager::sTesterp = NULL; } void LLTexturePipelineTester::update() @@ -3682,22 +3692,23 @@ void LLTexturePipelineTester::reset() //virtual void LLTexturePipelineTester::outputTestRecord(LLSD *sd) { - (*sd)[mCurLabel]["TotalBytesLoaded"] = (LLSD::Integer)mTotalBytesLoaded ; - (*sd)[mCurLabel]["TotalBytesLoadedFromCache"] = (LLSD::Integer)mTotalBytesLoadedFromCache ; - (*sd)[mCurLabel]["TotalBytesLoadedForLargeImage"] = (LLSD::Integer)mTotalBytesLoadedForLargeImage ; - (*sd)[mCurLabel]["TotalBytesLoadedForSculpties"] = (LLSD::Integer)mTotalBytesLoadedForSculpties ; + std::string currentLabel = getCurrentLabelName(); + (*sd)[currentLabel]["TotalBytesLoaded"] = (LLSD::Integer)mTotalBytesLoaded ; + (*sd)[currentLabel]["TotalBytesLoadedFromCache"] = (LLSD::Integer)mTotalBytesLoadedFromCache ; + (*sd)[currentLabel]["TotalBytesLoadedForLargeImage"] = (LLSD::Integer)mTotalBytesLoadedForLargeImage ; + (*sd)[currentLabel]["TotalBytesLoadedForSculpties"] = (LLSD::Integer)mTotalBytesLoadedForSculpties ; - (*sd)[mCurLabel]["StartFetchingTime"] = (LLSD::Real)mStartFetchingTime ; - (*sd)[mCurLabel]["TotalGrayTime"] = (LLSD::Real)mTotalGrayTime ; - (*sd)[mCurLabel]["TotalStablizingTime"] = (LLSD::Real)mTotalStablizingTime ; + (*sd)[currentLabel]["StartFetchingTime"] = (LLSD::Real)mStartFetchingTime ; + (*sd)[currentLabel]["TotalGrayTime"] = (LLSD::Real)mTotalGrayTime ; + (*sd)[currentLabel]["TotalStablizingTime"] = (LLSD::Real)mTotalStablizingTime ; - (*sd)[mCurLabel]["StartTimeLoadingSculpties"] = (LLSD::Real)mStartTimeLoadingSculpties ; - (*sd)[mCurLabel]["EndTimeLoadingSculpties"] = (LLSD::Real)mEndTimeLoadingSculpties ; + (*sd)[currentLabel]["StartTimeLoadingSculpties"] = (LLSD::Real)mStartTimeLoadingSculpties ; + (*sd)[currentLabel]["EndTimeLoadingSculpties"] = (LLSD::Real)mEndTimeLoadingSculpties ; - (*sd)[mCurLabel]["Time"] = LLImageGL::sLastFrameTime ; - (*sd)[mCurLabel]["TotalBytesBound"] = (LLSD::Integer)mLastTotalBytesUsed ; - (*sd)[mCurLabel]["TotalBytesBoundForLargeImage"] = (LLSD::Integer)mLastTotalBytesUsedForLargeImage ; - (*sd)[mCurLabel]["PercentageBytesBound"] = (LLSD::Real)(100.f * mLastTotalBytesUsed / mTotalBytesLoaded) ; + (*sd)[currentLabel]["Time"] = LLImageGL::sLastFrameTime ; + (*sd)[currentLabel]["TotalBytesBound"] = (LLSD::Integer)mLastTotalBytesUsed ; + (*sd)[currentLabel]["TotalBytesBoundForLargeImage"] = (LLSD::Integer)mLastTotalBytesUsedForLargeImage ; + (*sd)[currentLabel]["PercentageBytesBound"] = (LLSD::Real)(100.f * mLastTotalBytesUsed / mTotalBytesLoaded) ; } void LLTexturePipelineTester::updateTextureBindingStats(const LLViewerTexture* imagep) @@ -3786,7 +3797,7 @@ void LLTexturePipelineTester::compareTestSessions(std::ofstream* os) } //compare and output the comparison - *os << llformat("%s\n", mName.c_str()) ; + *os << llformat("%s\n", getTesterName().c_str()) ; *os << llformat("AggregateResults\n") ; compareTestResults(os, "TotalFetchingTime", base_sessionp->mTotalFetchingTime, current_sessionp->mTotalFetchingTime) ; @@ -3841,7 +3852,7 @@ void LLTexturePipelineTester::compareTestSessions(std::ofstream* os) } //virtual -LLMetricPerformanceTester::LLTestSession* LLTexturePipelineTester::loadTestSession(LLSD* log) +LLMetricPerformanceTesterWithSession::LLTestSession* LLTexturePipelineTester::loadTestSession(LLSD* log) { LLTexturePipelineTester::LLTextureTestSession* sessionp = new LLTexturePipelineTester::LLTextureTestSession() ; if(!sessionp) @@ -3868,12 +3879,11 @@ LLMetricPerformanceTester::LLTestSession* LLTexturePipelineTester::loadTestSessi sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ; //load a session - BOOL in_log = (*log).has(mCurLabel) ; - while(in_log) + std::string currentLabel = getCurrentLabelName(); + BOOL in_log = (*log).has(currentLabel) ; + while (in_log) { - LLSD::String label = mCurLabel ; - incLabel() ; - in_log = (*log).has(mCurLabel) ; + LLSD::String label = currentLabel ; if(sessionp->mInstantPerformanceListCounter >= (S32)sessionp->mInstantPerformanceList.size()) { @@ -3939,7 +3949,11 @@ LLMetricPerformanceTester::LLTestSession* LLTexturePipelineTester::loadTestSessi sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond = 0 ; sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond = 0.f ; sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ; - } + } + // Next label + incrementCurrentCount() ; + currentLabel = getCurrentLabelName(); + in_log = (*log).has(currentLabel) ; } sessionp->mTotalFetchingTime += total_fetching_time ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b779396293..b5636bbdc7 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -735,7 +735,7 @@ public: //it tracks the activities of the texture pipeline //records them, and outputs them to log files // -class LLTexturePipelineTester : public LLMetricPerformanceTester +class LLTexturePipelineTester : public LLMetricPerformanceTesterWithSession { enum { @@ -751,8 +751,6 @@ public: void updateGrayTextureBinding() ; void setStablizingTime() ; - /*virtual*/ void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; - private: void reset() ; void updateStablizingTime() ; @@ -823,7 +821,7 @@ private: S32 mInstantPerformanceListCounter ; }; - /*virtual*/ LLMetricPerformanceTester::LLTestSession* loadTestSession(LLSD* log) ; + /*virtual*/ LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) ; /*virtual*/ void compareTestSessions(std::ofstream* os) ; }; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ea407c8f29..743def4a0c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1863,6 +1863,8 @@ void LLViewerWindow::reshape(S32 width, S32 height) return; } + gWindowResized = TRUE; + // update our window rectangle mWindowRectRaw.mRight = mWindowRectRaw.mLeft + width; mWindowRectRaw.mTop = mWindowRectRaw.mBottom + height; @@ -4009,30 +4011,19 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei { gDisplaySwapBuffers = FALSE; gDepthDirty = TRUE; - if (type == SNAPSHOT_TYPE_OBJECT_ID) - { - glClearColor(0.f, 0.f, 0.f, 0.f); - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - LLViewerCamera::getInstance()->setZoomParameters(scale_factor, subimage_x+(subimage_y*llceil(scale_factor))); - setup3DRender(); - gObjectList.renderPickList(gViewerWindow->getWindowRectScaled(), FALSE, FALSE); + const U32 subfield = subimage_x+(subimage_y*llceil(scale_factor)); + + if (LLPipeline::sRenderDeferred) + { + display(do_rebuild, scale_factor, subfield, TRUE); } else { - const U32 subfield = subimage_x+(subimage_y*llceil(scale_factor)); - - if (LLPipeline::sRenderDeferred) - { - display(do_rebuild, scale_factor, subfield, TRUE); - } - else - { - display(do_rebuild, scale_factor, subfield, TRUE); + display(do_rebuild, scale_factor, subfield, TRUE); // Required for showing the GUI in snapshots and performing bloom composite overlay // Call even if show_ui is FALSE - render_ui(scale_factor, subfield); - } + render_ui(scale_factor, subfield); } S32 subimage_x_offset = llclamp(buffer_x_offset - (subimage_x * window_width), 0, window_width); @@ -4055,7 +4046,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei LLAppViewer::instance()->pingMainloopTimeout("LLViewerWindow::rawSnapshot"); } - if (type == SNAPSHOT_TYPE_OBJECT_ID || type == SNAPSHOT_TYPE_COLOR) + if (type == SNAPSHOT_TYPE_COLOR) { glReadPixels( subimage_x_offset, out_y + subimage_y_offset, @@ -4439,6 +4430,7 @@ void LLViewerWindow::restoreGL(const std::string& progress_message) LLVOAvatar::restoreGL(); gResizeScreenTexture = TRUE; + gWindowResized = TRUE; if (isAgentAvatarValid() && !gAgentAvatarp->isUsingBakedTextures()) { diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 633c3a41d2..47fb7c4883 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -316,8 +316,7 @@ public: typedef enum { SNAPSHOT_TYPE_COLOR, - SNAPSHOT_TYPE_DEPTH, - SNAPSHOT_TYPE_OBJECT_ID + SNAPSHOT_TYPE_DEPTH } ESnapshotType; BOOL saveSnapshot(const std::string& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, ESnapshotType type = SNAPSHOT_TYPE_COLOR); BOOL rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, BOOL is_texture = FALSE, diff --git a/indra/newview/llviewerwindowlistener.cpp b/indra/newview/llviewerwindowlistener.cpp index 4473b5820d..0b52948680 100644 --- a/indra/newview/llviewerwindowlistener.cpp +++ b/indra/newview/llviewerwindowlistener.cpp @@ -54,7 +54,7 @@ LLViewerWindowListener::LLViewerWindowListener(LLViewerWindow* llviewerwindow): // saveSnapshotArgs["type"] = LLSD::String(); add("saveSnapshot", "Save screenshot: [\"filename\"], [\"width\"], [\"height\"], [\"showui\"], [\"rebuild\"], [\"type\"]\n" - "type: \"COLOR\", \"DEPTH\", \"OBJECT_ID\"\n" + "type: \"COLOR\", \"DEPTH\"\n" "Post on [\"reply\"] an event containing [\"ok\"]", &LLViewerWindowListener::saveSnapshot, saveSnapshotArgs); @@ -71,7 +71,6 @@ void LLViewerWindowListener::saveSnapshot(const LLSD& event) const #define tp(name) types[#name] = LLViewerWindow::SNAPSHOT_TYPE_##name tp(COLOR); tp(DEPTH); - tp(OBJECT_ID); #undef tp // Our add() call should ensure that the incoming LLSD does in fact // contain our required arguments. Deal with the optional ones. diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8738ad7687..6f3aba29c6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3992,7 +3992,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) // *NOTE: this is disabled (there is no UI for enabling sShowFootPlane) due // to DEV-14477. the code is left here to aid in tracking down the cause // of the crash in the future. -brad - if (!gRenderForSelect && sShowFootPlane && mDrawable.notNull()) + if (sShowFootPlane && mDrawable.notNull()) { LLVector3 slaved_pos = mDrawable->getPositionAgent(); LLVector3 foot_plane_normal(mFootPlane.mV[VX], mFootPlane.mV[VY], mFootPlane.mV[VZ]); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e6c6c74fce..15477e0a80 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -130,8 +130,6 @@ static S32 sDelayedVBOEnable = 0; BOOL gAvatarBacklight = FALSE; -BOOL gRenderForSelect = FALSE; - BOOL gDebugPipeline = FALSE; LLPipeline gPipeline; const LLMatrix4* gGLLastMatrix = NULL; @@ -3807,185 +3805,6 @@ void LLPipeline::renderDebug() gGL.flush(); } -void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects, BOOL render_transparent, const LLRect& screen_rect) -{ - assertInitialized(); - - gGL.setColorMask(true, false); - gPipeline.resetDrawOrders(); - - LLViewerCamera* camera = LLViewerCamera::getInstance(); - for (std::set<LLViewerObject*>::iterator iter = objects.begin(); iter != objects.end(); ++iter) - { - stateSort((*iter)->mDrawable, *camera); - } - - LLMemType mt(LLMemType::MTYPE_PIPELINE_RENDER_SELECT); - - - - glMatrixMode(GL_MODELVIEW); - - LLGLSDefault gls_default; - LLGLSObjectSelect gls_object_select; - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE); - disableLights(); - - LLVertexBuffer::unbind(); - - //for each drawpool - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); - U32 last_type = 0; - - // If we don't do this, we crash something on changing graphics settings - // from Medium -> Low, because we unload all the shaders and the - // draw pools aren't aware. I don't know if this has to be a separate - // loop before actual rendering. JC - for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) - { - LLDrawPool *poolp = *iter; - if (poolp->isFacePool() && hasRenderType(poolp->getType())) - { - poolp->prerender(); - } - } - for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) - { - LLDrawPool *poolp = *iter; - if (poolp->isFacePool() && hasRenderType(poolp->getType())) - { - LLFacePool* face_pool = (LLFacePool*) poolp; - face_pool->renderForSelect(); - LLVertexBuffer::unbind(); - gGLLastMatrix = NULL; - glLoadMatrixd(gGLModelView); - - if (poolp->getType() != last_type) - { - last_type = poolp->getType(); - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); - } - } - } - - LLGLEnable alpha_test(GL_ALPHA_TEST); - if (render_transparent) - { - gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.f); - } - else - { - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.2f); - } - - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_VERT_COLOR); - gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); - - U32 prim_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_TEXCOORD0; - - for (std::set<LLViewerObject*>::iterator i = objects.begin(); i != objects.end(); ++i) - { - LLViewerObject* vobj = *i; - LLDrawable* drawable = vobj->mDrawable; - if (vobj->isDead() || - vobj->isHUDAttachment() || - (LLSelectMgr::getInstance()->mHideSelectedObjects && vobj->isSelected()) || - drawable->isDead() || - !hasRenderType(drawable->getRenderType())) - { - continue; - } - - for (S32 j = 0; j < drawable->getNumFaces(); ++j) - { - LLFace* facep = drawable->getFace(j); - if (!facep->getPool()) - { - facep->renderForSelect(prim_mask); - } - } - } - - // pick HUD objects - if (isAgentAvatarValid() && sShowHUDAttachments) - { - glh::matrix4f save_proj(glh_get_current_projection()); - glh::matrix4f save_model(glh_get_current_modelview()); - - setup_hud_matrices(screen_rect); - for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); - iter != gAgentAvatarp->mAttachmentPoints.end(); ) - { - LLVOAvatar::attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if (attachment->getIsHUDAttachment()) - { - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) - { - if (LLViewerObject* attached_object = (*attachment_iter)) - { - LLDrawable* drawable = attached_object->mDrawable; - if (drawable->isDead()) - { - continue; - } - - for (S32 j = 0; j < drawable->getNumFaces(); ++j) - { - LLFace* facep = drawable->getFace(j); - if (!facep->getPool()) - { - facep->renderForSelect(prim_mask); - } - } - - //render child faces - LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); iter++) - { - LLViewerObject* child = *iter; - LLDrawable* child_drawable = child->mDrawable; - for (S32 l = 0; l < child_drawable->getNumFaces(); ++l) - { - LLFace* facep = child_drawable->getFace(l); - if (!facep->getPool()) - { - facep->renderForSelect(prim_mask); - } - } - } - } - } - } - } - - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(save_proj.m); - glh_set_current_projection(save_proj); - - glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(save_model.m); - glh_set_current_modelview(save_model); - - - } - - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); - - LLVertexBuffer::unbind(); - - gGL.setColorMask(true, true); -} - void LLPipeline::rebuildPools() { LLMemType mt(LLMemType::MTYPE_PIPELINE_REBUILD_POOLS); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 790b595626..3f785a99fe 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -245,7 +245,6 @@ public: void renderHighlights(); void renderDebug(); - void renderForSelect(std::set<LLViewerObject*>& objects, BOOL render_transparent, const LLRect& screen_rect); void rebuildPools(); // Rebuild pools void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object @@ -713,7 +712,6 @@ void render_bbox(const LLVector3 &min, const LLVector3 &max); void render_hud_elements(); extern LLPipeline gPipeline; -extern BOOL gRenderForSelect; extern BOOL gDebugPipeline; extern const LLMatrix4* gGLLastMatrix; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 1f747ab997..a0fd0a13cc 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6539,7 +6539,7 @@ Mute everyone? <form name="form"> <ignore name="ignore" control="MediaEnablePopups" - invert_control="false" + invert_control="true" text="Enable all pop-ups"/> <button default="true" index="0" diff --git a/indra/newview/skins/default/xui/en/panel_edit_classified.xml b/indra/newview/skins/default/xui/en/panel_edit_classified.xml index ce0438fbc9..f60c1e62ac 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_classified.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_classified.xml @@ -147,7 +147,7 @@ layout="topleft" left="10" top_pad="2" - max_length="64" + max_length="256" name="classified_desc" text_color="black" word_wrap="true" /> |