Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alchemy/viewer
  • Miezhiko/alchemy-next
  • JennaHuntsman/xdg-integration
  • logue/alchemy-next
  • FelixWolf/alchemy-viewer
  • XenHat/xdg-integration
6 results
Show changes
Commits on Source (141)
Showing
with 173 additions and 118 deletions
......@@ -214,9 +214,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>322dd6c45c384d454ae14ef127984a4e</string>
<string>ae90d19cdcddf539f6d0b41cab12f918</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65457/612879/bugsplat-1.0.7.546418-darwin64-546418.tar.bz2</string>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/72773/702861/bugsplat-1.0.7.552580-darwin64-552580.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
......@@ -226,9 +226,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>010a0e73c0fddaa2316411803fad8e69</string>
<string>f5936eceb6a33ff0f1cc31996a40f29c</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65456/612876/bugsplat-3.6.0.8.546418-windows-546418.tar.bz2</string>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/72774/702905/bugsplat-3.6.0.8.552580-windows-552580.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
......@@ -238,16 +238,16 @@
<key>archive</key>
<map>
<key>hash</key>
<string>7e8530762e7b50663708a888c23b8780</string>
<string>9cd940754e53e0670030b3da5ba8f373</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65455/612874/bugsplat-3.6.0.8.546418-windows64-546418.tar.bz2</string>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/72775/702906/bugsplat-3.6.0.8.552580-windows64-552580.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>3.6.0.8.546418</string>
<string>3.6.0.8.552580</string>
</map>
<key>colladadom</key>
<map>
......
......@@ -171,10 +171,9 @@ LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo()
//-----------------------------------------------------------------------------
// Static Data
//-----------------------------------------------------------------------------
LLXmlTree LLAvatarAppearance::sXMLTree;
LLXmlTree LLAvatarAppearance::sSkeletonXMLTree;
LLAvatarSkeletonInfo* LLAvatarAppearance::sAvatarSkeletonInfo = NULL;
LLAvatarAppearance::LLAvatarXmlInfo* LLAvatarAppearance::sAvatarXmlInfo = NULL;
LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAvatarDictionary = NULL;
LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
......@@ -202,7 +201,7 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
mBakedTextureDatas[i].mIsLoaded = false;
mBakedTextureDatas[i].mIsUsed = false;
mBakedTextureDatas[i].mMaskTexName = 0;
mBakedTextureDatas[i].mTextureIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((LLAvatarAppearanceDefines::EBakedTextureIndex)i);
mBakedTextureDatas[i].mTextureIndex = sAvatarDictionary->bakedToLocalTextureIndex((LLAvatarAppearanceDefines::EBakedTextureIndex)i);
}
}
......@@ -215,7 +214,7 @@ void LLAvatarAppearance::initInstance()
mRoot = createAvatarJoint();
mRoot->setName( "mRoot" );
for (const auto& mesh_entry_pair : LLAvatarAppearanceDictionary::getInstance()->getMeshEntries())
for (const auto& mesh_entry_pair : sAvatarDictionary->getMeshEntries())
{
const EMeshIndex mesh_index = mesh_entry_pair.first;
const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_entry_pair.second;
......@@ -259,7 +258,7 @@ void LLAvatarAppearance::initInstance()
//-------------------------------------------------------------------------
// associate baked textures with meshes
//-------------------------------------------------------------------------
for (const auto& mesh_entry_pair : LLAvatarAppearanceDictionary::getInstance()->getMeshEntries())
for (const auto& mesh_entry_pair : sAvatarDictionary->getMeshEntries())
{
const EMeshIndex mesh_index = mesh_entry_pair.first;
const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_entry_pair.second;
......@@ -333,6 +332,12 @@ void LLAvatarAppearance::initClass()
//static
void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, const std::string& skeleton_file_name_arg)
{
// init dictionary (don't repeat on second login attempt)
if (!sAvatarDictionary)
{
sAvatarDictionary = new LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary();
}
std::string avatar_file_name;
if (!avatar_file_name_arg.empty())
......@@ -343,14 +348,15 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
{
avatar_file_name = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR + "_lad.xml");
}
BOOL success = sXMLTree.parseFile( avatar_file_name, FALSE );
LLXmlTree xml_tree;
BOOL success = xml_tree.parseFile( avatar_file_name, FALSE );
if (!success)
{
LL_ERRS() << "Problem reading avatar configuration file:" << avatar_file_name << LL_ENDL;
}
// now sanity check xml file
LLXmlTreeNode* root = sXMLTree.getRoot();
LLXmlTreeNode* root = xml_tree.getRoot();
if (!root)
{
LL_ERRS() << "No root node found in avatar configuration file: " << avatar_file_name << LL_ENDL;
......@@ -395,8 +401,9 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
}
std::string skeleton_path;
LLXmlTree skeleton_xml_tree;
skeleton_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,skeleton_file_name);
if (!parseSkeletonFile(skeleton_path))
if (!parseSkeletonFile(skeleton_path, skeleton_xml_tree))
{
LL_ERRS() << "Error parsing skeleton file: " << skeleton_path << LL_ENDL;
}
......@@ -409,7 +416,7 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
delete sAvatarSkeletonInfo;
}
sAvatarSkeletonInfo = new LLAvatarSkeletonInfo;
if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot()))
if (!sAvatarSkeletonInfo->parseXml(skeleton_xml_tree.getRoot()))
{
LL_ERRS() << "Error parsing skeleton XML file: " << skeleton_path << LL_ENDL;
}
......@@ -448,9 +455,8 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
void LLAvatarAppearance::cleanupClass()
{
delete_and_clear(sAvatarXmlInfo);
delete_and_clear(sAvatarSkeletonInfo);
sSkeletonXMLTree.cleanup();
sXMLTree.cleanup();
delete_and_clear(sAvatarDictionary);
delete_and_clear(sAvatarSkeletonInfo);
}
using namespace LLAvatarAppearanceDefines;
......@@ -574,12 +580,12 @@ void LLAvatarAppearance::computeBodySize()
//-----------------------------------------------------------------------------
// parseSkeletonFile()
//-----------------------------------------------------------------------------
BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree)
{
//-------------------------------------------------------------------------
// parse the file
//-------------------------------------------------------------------------
BOOL parsesuccess = sSkeletonXMLTree.parseFile( filename, FALSE );
BOOL parsesuccess = skeleton_xml_tree.parseFile( filename, FALSE );
if (!parsesuccess)
{
......@@ -588,7 +594,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
}
// now sanity check xml file
LLXmlTreeNode* root = sSkeletonXMLTree.getRoot();
LLXmlTreeNode* root = skeleton_xml_tree.getRoot();
if (!root)
{
LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL;
......@@ -998,7 +1004,7 @@ BOOL LLAvatarAppearance::loadAvatar()
{
LLAvatarXmlInfo::LLAvatarMorphInfo *info = *iter;
EBakedTextureIndex baked = LLAvatarAppearanceDictionary::findBakedByRegionName(info->mRegion);
EBakedTextureIndex baked = sAvatarDictionary->findBakedByRegionName(info->mRegion);
if (baked != BAKED_NUM_INDICES)
{
LLVisualParam* morph_param;
......@@ -1134,7 +1140,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
switch(lod)
case 0:
mesh = &mHairMesh0; */
for (const auto& mesh_entry_pair : LLAvatarAppearanceDictionary::getInstance()->getMeshEntries())
for (const auto& mesh_entry_pair : sAvatarDictionary->getMeshEntries())
{
const EMeshIndex mesh_index = mesh_entry_pair.first;
const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_entry_pair.second;
......@@ -1261,7 +1267,7 @@ BOOL LLAvatarAppearance::loadLayersets()
// scan baked textures and associate the layerset with the appropriate one
EBakedTextureIndex baked_index = BAKED_NUM_INDICES;
for (const auto& baked_tex_pair : LLAvatarAppearanceDictionary::getInstance()->getBakedTextures())
for (const auto& baked_tex_pair : sAvatarDictionary->getBakedTextures())
{
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_tex_pair.second;
if (layer_set->isBodyRegion(baked_dict->mName))
......@@ -1965,7 +1971,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
{
delete morphinfo;
delete info;
return -1;
return FALSE;
}
BOOL shared = FALSE;
static LLStdStringHandle shared_string = LLXmlTree::addAttributeString("shared");
......
......@@ -158,7 +158,7 @@ class LLAvatarAppearance : public LLCharacter
protected:
static BOOL parseSkeletonFile(const std::string& filename);
static BOOL parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree);
virtual void buildCharacter();
virtual BOOL loadAvatar();
......@@ -213,9 +213,6 @@ class LLAvatarAppearance : public LLCharacter
// XML parse tree
//--------------------------------------------------------------------
protected:
static LLXmlTree sXMLTree; // avatar config file
static LLXmlTree sSkeletonXMLTree; // avatar skeleton file
static LLAvatarSkeletonInfo* sAvatarSkeletonInfo;
static LLAvatarXmlInfo* sAvatarXmlInfo;
......@@ -257,6 +254,7 @@ class LLAvatarAppearance : public LLCharacter
public:
virtual void updateMeshTextures() = 0;
virtual void dirtyMesh() = 0; // Dirty the avatar mesh
static const LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary *getDictionary() { return sAvatarDictionary; }
protected:
virtual void dirtyMesh(S32 priority) = 0; // Dirty the avatar mesh, with priority
......@@ -265,6 +263,9 @@ class LLAvatarAppearance : public LLCharacter
polymesh_map_t mPolyMeshes;
avatar_joint_list_t mMeshLOD;
// mesh entries and backed textures
static LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* sAvatarDictionary;
/** Meshes
** **
*******************************************************************************/
......
......@@ -254,19 +254,17 @@ LLAvatarAppearanceDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index,
va_end(argp);
}
// static
ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index)
ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index) const
{
return LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(index)->mTextureIndex;
return getBakedTexture(index)->mTextureIndex;
}
// static
EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::string name)
{
U8 index = 0;
while (index < BAKED_NUM_INDICES)
{
const BakedEntry *be = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index);
const BakedEntry *be = getBakedTexture((EBakedTextureIndex) index);
if (be && be->mName.compare(name) == 0)
{
// baked texture found
......@@ -278,16 +276,15 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::stri
return BAKED_NUM_INDICES;
}
// static
EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::string name)
{
U8 index = 0;
while (index < BAKED_NUM_INDICES)
{
const BakedEntry *be = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index);
const BakedEntry *be = getBakedTexture((EBakedTextureIndex) index);
if (be)
{
const TextureEntry *te = LLAvatarAppearanceDictionary::getInstance()->getTexture(be->mTextureIndex);
const TextureEntry *te = getTexture(be->mTextureIndex);
if (te && te->mDefaultImageName.compare(name) == 0)
{
// baked texture found
......@@ -300,10 +297,9 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::strin
return BAKED_NUM_INDICES;
}
// static
LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index )
LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index ) const
{
return getInstance()->getTexture(index)->mWearableType;
return getTexture(index)->mWearableType;
}
// static
......
......@@ -143,13 +143,14 @@ typedef std::vector<LLWearableType::EType> wearables_vec_t;
//
// This holds const data - it is initialized once and the contents never change after that.
//------------------------------------------------------------------------
class LLAvatarAppearanceDictionary final : public LLSingleton<LLAvatarAppearanceDictionary>
class LLAvatarAppearanceDictionary
{
//--------------------------------------------------------------------
// Constructors and Destructors
//--------------------------------------------------------------------
LLSINGLETON(LLAvatarAppearanceDictionary);
virtual ~LLAvatarAppearanceDictionary() = default;
public:
LLAvatarAppearanceDictionary();
~LLAvatarAppearanceDictionary() = default;
private:
void createAssociations();
......@@ -235,14 +236,14 @@ class LLAvatarAppearanceDictionary final : public LLSingleton<LLAvatarAppearance
//--------------------------------------------------------------------
public:
// Convert from baked texture to associated texture; e.g. BAKED_HEAD -> TEX_HEAD_BAKED
static ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t);
ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t) const;
// find a baked texture index based on its name
static EBakedTextureIndex findBakedByRegionName(std::string name);
static EBakedTextureIndex findBakedByImageName(std::string name);
EBakedTextureIndex findBakedByRegionName(std::string name);
EBakedTextureIndex findBakedByImageName(std::string name);
// Given a texture entry, determine which wearable type owns it.
static LLWearableType::EType getTEWearableType(ETextureIndex index);
LLWearableType::EType getTEWearableType(ETextureIndex index) const;
static BOOL isBakedImageId(const LLUUID& id);
static EBakedTextureIndex assetIdToBakedTextureIndex(const LLUUID& id);
......
......@@ -724,7 +724,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
/* if ("upper_shirt" == local_texture_name)
mLocalTexture = TEX_UPPER_SHIRT; */
mLocalTexture = TEX_NUM_INDICES;
for (const auto& tex_pair : LLAvatarAppearanceDictionary::getInstance()->getTextures())
for (const auto& tex_pair : LLAvatarAppearance::getDictionary()->getTextures())
{
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = tex_pair.second;
if (local_texture_name == texture_dict->mName)
......@@ -973,7 +973,7 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const
return type;
}
return LLAvatarAppearanceDictionary::getTEWearableType(te);
return LLAvatarAppearance::getDictionary()->getTEWearableType(te);
}
LLTexLayerInterface::ERenderPass LLTexLayerInterface::getRenderPass() const
......
......@@ -183,7 +183,7 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
{
LLTexLayerSet *layer_set = NULL;
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te);
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearance::getDictionary()->getTexture((ETextureIndex)te);
if (texture_dict && texture_dict->mIsUsedByBakedTexture)
{
const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
......@@ -606,7 +606,7 @@ void LLWearable::syncImages(te_map_t &src, te_map_t &dst)
// Deep copy of src (copies only those tes that are current, filling in defaults where needed)
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex) te) == mType)
if (LLAvatarAppearance::getDictionary()->getTEWearableType((ETextureIndex) te) == mType)
{
te_map_t::const_iterator iter = src.find(te);
LLUUID image_id;
......
......@@ -343,7 +343,7 @@ U32 LLWearableData::getWearableCount(const LLWearableType::EType type) const
U32 LLWearableData::getWearableCount(const U32 tex_index) const
{
const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType((LLAvatarAppearanceDefines::ETextureIndex)tex_index);
const LLWearableType::EType wearable_type = LLAvatarAppearance::getDictionary()->getTEWearableType((LLAvatarAppearanceDefines::ETextureIndex)tex_index);
return getWearableCount(wearable_type);
}
......@@ -353,7 +353,7 @@ LLUUID LLWearableData::computeBakedTextureHash(LLAvatarAppearanceDefines::EBaked
LLUUID hash_id;
bool hash_computed = false;
LLMD5 hash;
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index);
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearance::getDictionary()->getBakedTexture(baked_index);
for (U8 i=0; i < baked_dict->mWearables.size(); i++)
{
......
......@@ -568,16 +568,9 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
// Use the viewer-based thread-safe API which has a
// fast/safe check for proxy enable. Would like to
// encapsulate this someway...
if (LLProxy::instanceExists())
{
// Make sure proxy won't be initialized from here,
// it might conflict with LLStartUp::startLLProxy()
LLProxy::getInstance()->applyProxySettings(mCurlHandle);
}
else
{
LL_WARNS() << "Proxy is not initialized!" << LL_ENDL;
}
// Make sure proxy won't be getInstance() from here,
// it is not thread safe
LLProxy::applyProxySettings(mCurlHandle);
}
else if (gpolicy.mHttpProxy.size())
......@@ -819,6 +812,7 @@ size_t HttpOpRequest::readCallback(void * data, size_t size, size_t nmemb, void
const size_t do_size((std::min)(req_size, body_size - op->mCurlBodyPos));
const size_t read_size(op->mReqBody->read(op->mCurlBodyPos, static_cast<char *>(data), do_size));
// FIXME: singleton's instance() is Thread unsafe! Even if stats accumulators inside are.
HTTPStats::instance().recordDataUp(read_size);
op->mCurlBodyPos += read_size;
return read_size;
......
......@@ -584,29 +584,39 @@ static void bilinear_scale(const U8 *src, U32 srcW, U32 srcH, U32 srcCh, U32 src
// LLImage
//---------------------------------------------------------------------------
LLImage::LLImage(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent)
//static
std::string LLImage::sLastErrorMessage;
LLMutex* LLImage::sMutex = NULL;
bool LLImage::sUseNewByteRange = false;
S32 LLImage::sMinimalReverseByteRangePercent = 75;
//static
void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent)
{
mMutex = new LLMutex();
mUseNewByteRange = use_new_byte_range;
mMinimalReverseByteRangePercent = minimal_reverse_byte_range_percent;
sUseNewByteRange = use_new_byte_range;
sMinimalReverseByteRangePercent = minimal_reverse_byte_range_percent;
sMutex = new LLMutex();
}
LLImage::~LLImage()
//static
void LLImage::cleanupClass()
{
delete mMutex;
mMutex = NULL;
delete sMutex;
sMutex = NULL;
}
const std::string& LLImage::getLastErrorMessage()
//static
const std::string& LLImage::getLastError()
{
static const std::string noerr("No Error");
return mLastErrorMessage.empty() ? noerr : mLastErrorMessage;
return sLastErrorMessage.empty() ? noerr : sLastErrorMessage;
}
void LLImage::setLastErrorMessage(const std::string& message)
//static
void LLImage::setLastError(const std::string& message)
{
LLMutexLock m(mMutex);
mLastErrorMessage = message;
LLMutexLock m(sMutex);
sLastErrorMessage = message;
}
//---------------------------------------------------------------------------
......
......@@ -30,7 +30,6 @@
#include "lluuid.h"
#include "llstring.h"
#include "llpointer.h"
#include "llsingleton.h"
#include "lltrace.h"
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
......@@ -89,26 +88,25 @@ typedef enum e_image_codec
//============================================================================
// library initialization class
// LLImage is frequently used in threads so do not convert it to LLSingleton
class LLImage final : public LLParamSingleton<LLImage>
class LLImage
{
LLSINGLETON(LLImage, bool use_new_byte_range = false, S32 minimal_reverse_byte_range_percent = 75);
~LLImage();
public:
static void initClass(bool use_new_byte_range = false, S32 minimal_reverse_byte_range_percent = 75);
static void cleanupClass();
const std::string& getLastErrorMessage();
static const std::string& getLastError() { return getInstance()->getLastErrorMessage(); };
void setLastErrorMessage(const std::string& message);
static void setLastError(const std::string& message) { getInstance()->setLastErrorMessage(message); }
bool useNewByteRange() { return mUseNewByteRange; }
S32 getReverseByteRangePercent() { return mMinimalReverseByteRangePercent; }
private:
LLMutex* mMutex;
std::string mLastErrorMessage;
bool mUseNewByteRange;
S32 mMinimalReverseByteRangePercent;
static const std::string& getLastError();
static void setLastError(const std::string& message);
static bool useNewByteRange() { return sUseNewByteRange; }
static S32 getReverseByteRangePercent() { return sMinimalReverseByteRangePercent; }
protected:
static LLMutex* sMutex;
static std::string sLastErrorMessage;
static bool sUseNewByteRange;
static S32 sMinimalReverseByteRangePercent;
};
//============================================================================
......
......@@ -277,7 +277,7 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r
S32 bytes;
S32 new_bytes = (S32) (sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor);
S32 old_bytes = (S32)((F32)(w*h*comp)*rate);
bytes = (LLImage::getInstance()->useNewByteRange() && (new_bytes < old_bytes) ? new_bytes : old_bytes);
bytes = (LLImage::useNewByteRange() && (new_bytes < old_bytes) ? new_bytes : old_bytes);
bytes = llmax(bytes, calcHeaderSizeJ2C());
return bytes;
}
......@@ -318,7 +318,7 @@ S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes)
{
S32 bytes_needed = calcDataSize(discard_level);
// Use TextureReverseByteRange percent (see settings.xml) of the optimal size to qualify as correct rendering for the given discard level
if (bytes >= (bytes_needed*LLImage::getInstance()->getReverseByteRangePercent()/100))
if (bytes >= (bytes_needed*LLImage::getReverseByteRangePercent()/100))
{
break;
}
......
......@@ -244,7 +244,7 @@ class LLInventoryCategory : public LLInventoryObject
LLInventoryCategory(const LLInventoryCategory* other);
void copyCategory(const LLInventoryCategory* other); // LLRefCount requires custom copy
protected:
~LLInventoryCategory() = default;
virtual ~LLInventoryCategory() = default;
//--------------------------------------------------------------------
// Accessors And Mutators
......
......@@ -285,12 +285,27 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName&
return;
}
bool updated_account = true; // assume obsolete value for new arrivals by default
auto it = mCache.find(agent_id);
if (it != mCache.end()
&& (*it).second.getAccountName() == av_name.getAccountName())
{
updated_account = false;
}
// Add to the cache
mCache[agent_id] = av_name;
// Suppress request from the queue
mPendingQueue.erase(agent_id);
// notify mute list about changes
if (updated_account && mAccountNameChangedCallback)
{
mAccountNameChangedCallback(agent_id, av_name);
}
// Signal everyone waiting on this name
signal_map_t::iterator sig_it = mSignalMap.find(agent_id);
if (sig_it != mSignalMap.end())
......@@ -303,6 +318,8 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName&
delete signal;
signal = NULL;
}
}
void LLAvatarNameCache::requestNamesViaCapability()
......
......@@ -45,6 +45,7 @@ class LLAvatarNameCache final : public LLSingleton<LLAvatarNameCache>
~LLAvatarNameCache();
public:
typedef boost::signals2::signal<void (void)> use_display_name_signal_t;
typedef boost::function<void (const LLUUID id, const LLAvatarName& av_name)> account_name_changed_callback_t;
// Import/export the name cache to file.
bool importFile(std::istream& istr);
......@@ -112,6 +113,8 @@ class LLAvatarNameCache final : public LLSingleton<LLAvatarNameCache>
void addUseDisplayNamesCallback(const use_display_name_signal_t::slot_type& cb);
void setAccountNameChangedCallback(const account_name_changed_callback_t& cb) { mAccountNameChangedCallback = cb; }
private:
// Handle name response off network.
void processName(const LLUUID& agent_id,
......@@ -150,6 +153,7 @@ class LLAvatarNameCache final : public LLSingleton<LLAvatarNameCache>
private:
use_display_name_signal_t mUseDisplayNamesSignal;
account_name_changed_callback_t mAccountNameChangedCallback;
// Cache starts in a paused state until we can determine if the
// current region supports display names.
......
......@@ -40,6 +40,7 @@
// incoming packet just to do a simple bool test. The getter for this
// member is also static
bool LLProxy::sUDPProxyEnabled = false;
LLProxy* LLProxy::sProxyInstance = NULL;
// Some helpful TCP static functions.
static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataout, apr_size_t outlen, char * datain, apr_size_t maxinlen); // Do a TCP data handshake
......@@ -60,11 +61,21 @@ LLProxy::LLProxy():
LLProxy::~LLProxy()
{
if (ll_apr_is_initialized())
{
stopSOCKSProxy();
disableHTTPProxy();
}
if (ll_apr_is_initialized())
{
// locks mutex
stopSOCKSProxy();
disableHTTPProxy();
}
// The primary safety of sProxyInstance is the fact that by the
// point SUBSYSTEM_CLEANUP(LLProxy) gets called, nothing should
// be capable of using proxy
sProxyInstance = NULL;
}
void LLProxy::initSingleton()
{
sProxyInstance = this;
}
/**
......@@ -424,28 +435,28 @@ void LLProxy::cleanupClass()
void LLProxy::applyProxySettings(CURL* handle)
{
// Do a faster unlocked check to see if we are supposed to proxy.
if (mHTTPProxyEnabled)
if (sProxyInstance && sProxyInstance->mHTTPProxyEnabled)
{
// We think we should proxy, lock the proxy mutex.
LLMutexLock lock(&mProxyMutex);
// We think we should proxy, lock the proxy mutex. sProxyInstance is not protected by mutex
LLMutexLock lock(&sProxyInstance->mProxyMutex);
// Now test again to verify that the proxy wasn't disabled between the first check and the lock.
if (mHTTPProxyEnabled)
if (sProxyInstance->mHTTPProxyEnabled)
{
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXY, mHTTPProxy.getIPString().c_str()), CURLOPT_PROXY);
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYPORT, mHTTPProxy.getPort()), CURLOPT_PROXYPORT);
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXY, sProxyInstance->mHTTPProxy.getIPString().c_str()), CURLOPT_PROXY);
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYPORT, sProxyInstance->mHTTPProxy.getPort()), CURLOPT_PROXYPORT);
if (mProxyType == LLPROXY_SOCKS)
if (sProxyInstance->mProxyType == LLPROXY_SOCKS)
{
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5), CURLOPT_PROXYTYPE);
if (mAuthMethodSelected == METHOD_PASSWORD)
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5), CURLOPT_PROXYTYPE);
if (sProxyInstance->mAuthMethodSelected == METHOD_PASSWORD)
{
std::string auth_string = mSocksUsername + ":" + mSocksPassword;
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYUSERPWD, auth_string.c_str()), CURLOPT_PROXYUSERPWD);
std::string auth_string = sProxyInstance->mSocksUsername + ":" + sProxyInstance->mSocksPassword;
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYUSERPWD, auth_string.c_str()), CURLOPT_PROXYUSERPWD);
}
}
else
{
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP), CURLOPT_PROXYTYPE);
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP), CURLOPT_PROXYTYPE);
}
}
}
......
......@@ -226,6 +226,8 @@ class LLProxy final : public LLSingleton<LLProxy>
LLSINGLETON(LLProxy);
LOG_CLASS(LLProxy);
/*virtual*/ void initSingleton();
public:
// Static check for enabled status for UDP packets. Call from main thread only.
static bool isSOCKSProxyEnabled() { return sUDPProxyEnabled; }
......@@ -251,7 +253,7 @@ class LLProxy final : public LLSingleton<LLProxy>
// Apply the current proxy settings to a curl request. Doesn't do anything if mHTTPProxyEnabled is false.
// Safe to call from any thread.
void applyProxySettings(CURL* handle);
static void applyProxySettings(CURL* handle);
// Start a connection to the SOCKS 5 proxy. Call from main thread only.
S32 startSOCKSProxy(LLHost host);
......@@ -344,6 +346,10 @@ class LLProxy final : public LLSingleton<LLProxy>
/*###########################################################################################
END OF SHARED MEMBERS
###########################################################################################*/
// A hack to get arround getInstance() and capture_dependency() which are unsafe to use inside threads
// set/reset on init/cleanup, strictly for use in applyProxySettings
static LLProxy* sProxyInstance;
};
#endif
......@@ -152,8 +152,18 @@ void LLPluginProcessParent::shutdown()
mapInstances_t::iterator it;
for (it = sInstances.begin(); it != sInstances.end(); ++it)
{
(*it).second->setState(STATE_GOODBYE);
(*it).second->idle();
EState state = (*it).second->mState;
if (state != STATE_CLEANUP
|| state != STATE_EXITING
|| state != STATE_DONE
|| state != STATE_ERROR)
{
(*it).second->setState(STATE_GOODBYE);
}
if (state != STATE_DONE)
{
(*it).second->idle();
}
}
sInstances.clear();
}
......
......@@ -1479,7 +1479,8 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
std::string lookingForJoint = (*jointIt).c_str();
//Look for the joint xform that we extracted from the skeleton, using the jointIt as the key
//and store it in the alternate bind matrix
if ( mJointMap.find( lookingForJoint ) != mJointMap.end() )
if (mJointMap.find(lookingForJoint) != mJointMap.end()
&& model->mSkinInfo.mInvBindMatrix.size() > i)
{
alignas(16) F32 bind_matrix[16];
model->mSkinInfo.mInvBindMatrix[i].store4a(bind_matrix);
......
......@@ -1019,7 +1019,7 @@ LLFontGL* LLFontGL::getFontSansSerifBig()
//static
LLFontGL* LLFontGL::getFontSansSerifHuge()
{
static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Large",0));
static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Huge",0));
return fontp;
}
......