summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llinventory.cpp148
-rw-r--r--indra/llinventory/llinventory.h6
-rw-r--r--indra/llinventory/tests/inventorymisc_test.cpp20
-rw-r--r--indra/llmessage/message.cpp1
-rw-r--r--indra/newview/llaisapi.cpp30
-rw-r--r--indra/newview/llaisapi.h3
-rw-r--r--indra/newview/llappearancemgr.cpp8
-rw-r--r--indra/newview/lldrawpoolbump.cpp4
-rw-r--r--indra/newview/llinventorymodel.cpp42
-rw-r--r--indra/newview/llviewertexture.cpp16
-rw-r--r--indra/newview/llviewertexture.h5
11 files changed, 86 insertions, 197 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 81261f0767..b897198d10 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -40,9 +40,11 @@
///----------------------------------------------------------------------------
/// Exported functions
///----------------------------------------------------------------------------
+// FIXME D567 - what's the point of these, especially if we don't even use them consistently?
static const std::string INV_ITEM_ID_LABEL("item_id");
static const std::string INV_FOLDER_ID_LABEL("cat_id");
static const std::string INV_PARENT_ID_LABEL("parent_id");
+static const std::string INV_THUMBNAIL_ID_LABEL("thumbnail_id");
static const std::string INV_ASSET_TYPE_LABEL("type");
static const std::string INV_PREFERRED_TYPE_LABEL("preferred_type");
static const std::string INV_INVENTORY_TYPE_LABEL("inv_type");
@@ -99,6 +101,7 @@ void LLInventoryObject::copyObject(const LLInventoryObject* other)
mParentUUID = other->mParentUUID;
mType = other->mType;
mName = other->mName;
+ mThumbnailUUID = other->mThumbnailUUID;
}
const LLUUID& LLInventoryObject::getUUID() const
@@ -111,6 +114,11 @@ const LLUUID& LLInventoryObject::getParentUUID() const
return mParentUUID;
}
+const LLUUID& LLInventoryObject::getThumbnailUUID() const
+{
+ return mThumbnailUUID;
+}
+
const std::string& LLInventoryObject::getName() const
{
return mName;
@@ -160,6 +168,11 @@ void LLInventoryObject::setParent(const LLUUID& new_parent)
mParentUUID = new_parent;
}
+void LLInventoryObject::setThumbnailUUID(const LLUUID& thumbnail_uuid)
+{
+ mThumbnailUUID = thumbnail_uuid;
+}
+
void LLInventoryObject::setType(LLAssetType::EType type)
{
mType = type;
@@ -972,135 +985,6 @@ fail:
}
-// Deleted LLInventoryItem::exportFileXML() and LLInventoryItem::importXML()
-// because I can't find any non-test code references to it. 2009-05-04 JC
-
-S32 LLInventoryItem::packBinaryBucket(U8* bin_bucket, LLPermissions* perm_override) const
-{
- // Figure out which permissions to use.
- LLPermissions perm;
- if (perm_override)
- {
- // Use the permissions override.
- perm = *perm_override;
- }
- else
- {
- // Use the current permissions.
- perm = getPermissions();
- }
-
- // describe the inventory item
- char* buffer = (char*) bin_bucket;
- std::string creator_id_str;
-
- perm.getCreator().toString(creator_id_str);
- std::string owner_id_str;
- perm.getOwner().toString(owner_id_str);
- std::string last_owner_id_str;
- perm.getLastOwner().toString(last_owner_id_str);
- std::string group_id_str;
- perm.getGroup().toString(group_id_str);
- std::string asset_id_str;
- getAssetUUID().toString(asset_id_str);
- S32 size = sprintf(buffer, /* Flawfinder: ignore */
- "%d|%d|%s|%s|%s|%s|%s|%x|%x|%x|%x|%x|%s|%s|%d|%d|%x",
- getType(),
- getInventoryType(),
- getName().c_str(),
- creator_id_str.c_str(),
- owner_id_str.c_str(),
- last_owner_id_str.c_str(),
- group_id_str.c_str(),
- perm.getMaskBase(),
- perm.getMaskOwner(),
- perm.getMaskGroup(),
- perm.getMaskEveryone(),
- perm.getMaskNextOwner(),
- asset_id_str.c_str(),
- getDescription().c_str(),
- getSaleInfo().getSaleType(),
- getSaleInfo().getSalePrice(),
- getFlags()) + 1;
-
- return size;
-}
-
-void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size)
-{
- // Early exit on an empty binary bucket.
- if (bin_bucket_size <= 1) return;
-
- if (NULL == bin_bucket)
- {
- LL_ERRS() << "unpackBinaryBucket failed. bin_bucket is NULL." << LL_ENDL;
- return;
- }
-
- // Convert the bin_bucket into a string.
- std::vector<char> item_buffer(bin_bucket_size+1);
- memcpy(&item_buffer[0], bin_bucket, bin_bucket_size); /* Flawfinder: ignore */
- item_buffer[bin_bucket_size] = '\0';
- std::string str(&item_buffer[0]);
-
- LL_DEBUGS() << "item buffer: " << str << LL_ENDL;
-
- // Tokenize the string.
- typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
- boost::char_separator<char> sep("|", "", boost::keep_empty_tokens);
- tokenizer tokens(str, sep);
- tokenizer::iterator iter = tokens.begin();
-
- // Extract all values.
- LLUUID item_id;
- item_id.generate();
- setUUID(item_id);
-
- LLAssetType::EType type;
- type = (LLAssetType::EType)(atoi((*(iter++)).c_str()));
- setType( type );
-
- LLInventoryType::EType inv_type;
- inv_type = (LLInventoryType::EType)(atoi((*(iter++)).c_str()));
- setInventoryType( inv_type );
-
- std::string name((*(iter++)).c_str());
- rename( name );
-
- LLUUID creator_id((*(iter++)).c_str());
- LLUUID owner_id((*(iter++)).c_str());
- LLUUID last_owner_id((*(iter++)).c_str());
- LLUUID group_id((*(iter++)).c_str());
- PermissionMask mask_base = strtoul((*(iter++)).c_str(), NULL, 16);
- PermissionMask mask_owner = strtoul((*(iter++)).c_str(), NULL, 16);
- PermissionMask mask_group = strtoul((*(iter++)).c_str(), NULL, 16);
- PermissionMask mask_every = strtoul((*(iter++)).c_str(), NULL, 16);
- PermissionMask mask_next = strtoul((*(iter++)).c_str(), NULL, 16);
- LLPermissions perm;
- perm.init(creator_id, owner_id, last_owner_id, group_id);
- perm.initMasks(mask_base, mask_owner, mask_group, mask_every, mask_next);
- setPermissions(perm);
- //LL_DEBUGS() << "perm: " << perm << LL_ENDL;
-
- LLUUID asset_id((*(iter++)).c_str());
- setAssetUUID(asset_id);
-
- std::string desc((*(iter++)).c_str());
- setDescription(desc);
-
- LLSaleInfo::EForSale sale_type;
- sale_type = (LLSaleInfo::EForSale)(atoi((*(iter++)).c_str()));
- S32 price = atoi((*(iter++)).c_str());
- LLSaleInfo sale_info(sale_type, price);
- setSaleInfo(sale_info);
-
- U32 flags = strtoul((*(iter++)).c_str(), NULL, 16);
- setFlags(flags);
-
- time_t now = time(NULL);
- setCreationDate(now);
-}
-
///----------------------------------------------------------------------------
/// Class LLInventoryCategory
///----------------------------------------------------------------------------
@@ -1152,6 +1036,7 @@ LLSD LLInventoryCategory::asLLSD() const
LLSD sd = LLSD();
sd["item_id"] = mUUID;
sd["parent_id"] = mParentUUID;
+ sd["thumbnail_id"] = mThumbnailUUID;
S8 type = static_cast<S8>(mPreferredType);
sd["type"] = type;
sd["name"] = mName;
@@ -1184,6 +1069,11 @@ bool LLInventoryCategory::fromLLSD(const LLSD& sd)
{
mParentUUID = sd[w];
}
+ w = INV_THUMBNAIL_ID_LABEL;
+ if (sd.has(w))
+ {
+ mThumbnailUUID = sd[w];
+ }
w = INV_ASSET_TYPE_LABEL;
if (sd.has(w))
{
diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h
index 7d9f9704f1..dfe8b7659b 100644
--- a/indra/llinventory/llinventory.h
+++ b/indra/llinventory/llinventory.h
@@ -70,6 +70,7 @@ public:
virtual const LLUUID& getUUID() const; // inventoryID that this item points to
virtual const LLUUID& getLinkedUUID() const; // inventoryID that this item points to, else this item's inventoryID
const LLUUID& getParentUUID() const;
+ virtual const LLUUID& getThumbnailUUID() const;
virtual const std::string& getName() const;
virtual LLAssetType::EType getType() const;
LLAssetType::EType getActualType() const; // bypasses indirection for linked items
@@ -84,6 +85,7 @@ public:
void setUUID(const LLUUID& new_uuid);
virtual void rename(const std::string& new_name);
void setParent(const LLUUID& new_parent);
+ virtual void setThumbnailUUID(const LLUUID& thumbnail_uuid);
void setType(LLAssetType::EType type);
virtual void setCreationDate(time_t creation_date_utc); // only stored for items
@@ -108,6 +110,7 @@ public:
protected:
LLUUID mUUID;
LLUUID mParentUUID; // Parent category. Root categories have LLUUID::NULL.
+ LLUUID mThumbnailUUID;
LLAssetType::EType mType;
std::string mName;
time_t mCreationDate; // seconds from 1/1/1970, UTC
@@ -203,9 +206,6 @@ public:
// Helper Functions
//--------------------------------------------------------------------
public:
- // Pack all information needed to reconstruct this item into the given binary bucket.
- S32 packBinaryBucket(U8* bin_bucket, LLPermissions* perm_override = NULL) const;
- void unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size);
LLSD asLLSD() const;
void asLLSD( LLSD& sd ) const;
bool fromLLSD(const LLSD& sd, bool is_new = true);
diff --git a/indra/llinventory/tests/inventorymisc_test.cpp b/indra/llinventory/tests/inventorymisc_test.cpp
index e8b063bffe..039fa938dd 100644
--- a/indra/llinventory/tests/inventorymisc_test.cpp
+++ b/indra/llinventory/tests/inventorymisc_test.cpp
@@ -400,27 +400,7 @@ namespace tut
// Deleted LLInventoryItem::exportFileXML() and LLInventoryItem::importXML()
// because I can't find any non-test code references to it. 2009-05-04 JC
}
-
- template<> template<>
- void inventory_object::test<10>()
- {
- LLPointer<LLInventoryItem> src1 = create_random_inventory_item();
- U8* bin_bucket = new U8[300];
- S32 bin_bucket_size = src1->packBinaryBucket(bin_bucket, NULL);
-
- LLPointer<LLInventoryItem> src2 = new LLInventoryItem();
- src2->unpackBinaryBucket(bin_bucket, bin_bucket_size);
- ensure_equals("1.sale price::getSalePrice() failed price", src1->getSaleInfo().getSalePrice(), src2->getSaleInfo().getSalePrice());
- ensure_equals("2.sale type::getSaleType() failed type", src1->getSaleInfo().getSaleType(), src2->getSaleInfo().getSaleType());
- ensure_equals("3.type::getType() failed", src1->getType(), src2->getType());
- ensure_equals("4.inventory type::getInventoryType() failed type", src1->getInventoryType(), src2->getInventoryType());
- ensure_equals("5.name::getName() failed", src1->getName(), src2->getName());
- ensure_equals("6.description::getDescription() failed", src1->getDescription(), src2->getDescription());
- ensure_equals("7.flags::getFlags() failed", src1->getFlags(), src2->getFlags());
-
- }
-
template<> template<>
void inventory_object::test<11>()
{
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 19146c64f4..31acc65642 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -3402,6 +3402,7 @@ typedef std::map<const char*, LLMessageBuilder*> BuilderMap;
void LLMessageSystem::newMessageFast(const char *name)
{
+ //LL_DEBUGS("Messaging") << "creating new message: " << name << LL_ENDL;
LLMessageConfig::Flavor message_flavor =
LLMessageConfig::getMessageFlavor(name);
LLMessageConfig::Flavor server_flavor =
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 005259bcb8..d2c59cfaba 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -100,7 +100,7 @@ void AISAPI::CreateInventory(const LLUUID& parentId, const LLSD& newInventory, c
tid.generate();
std::string url = cap + std::string("/category/") + parentId.asString() + "?tid=" + tid.asString();
- LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
+ LL_DEBUGS("Inventory") << "url: " << url << " parentID " << parentId << " newInventory " << newInventory << LL_ENDL;
// I may be suffering from golden hammer here, but the first part of this bind
// is actually a static cast for &HttpCoroutineAdapter::postAndSuspend so that
@@ -124,7 +124,7 @@ void AISAPI::CreateInventory(const LLUUID& parentId, const LLSD& newInventory, c
(&LLCoreHttpUtil::HttpCoroutineAdapter::postAndSuspend), _1, _2, _3, _4, _5, _6);
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
- _1, postFn, url, parentId, newInventory, callback, COPYINVENTORY));
+ _1, postFn, url, parentId, newInventory, callback, CREATEINVENTORY));
EnqueueAISCommand("CreateInventory", proc);
}
@@ -478,6 +478,7 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
LL_WARNS("Inventory") << ll_pretty_print_sd(result) << LL_ENDL;
}
+ LL_DEBUGS("Inventory") << result << LL_ENDL;
gInventory.onAISUpdateReceived("AISCommand", result);
if (callback && !callback.empty())
@@ -487,9 +488,32 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
if (result.has("category_id") && (type == COPYLIBRARYCATEGORY))
{
id = result["category_id"];
+ callback(id);
}
+ if (type == CREATEINVENTORY)
+ {
+ if (result.has("_created_categories"))
+ {
+ LLSD& cats = result["_created_categories"];
+ LLSD::array_const_iterator cat_iter;
+ for (cat_iter = cats.beginArray(); cat_iter != cats.endArray(); ++cat_iter)
+ {
+ LLUUID cat_id = *cat_iter;
+ callback(cat_id);
+ }
+ }
+ if (result.has("_created_items"))
+ {
+ LLSD& items = result["_created_items"];
+ LLSD::array_const_iterator item_iter;
+ for (item_iter = items.beginArray(); item_iter != items.endArray(); ++item_iter)
+ {
+ LLUUID item_id = *item_iter;
+ callback(item_id);
+ }
+ }
+ }
- callback(id);
}
}
diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h
index 856f3fc180..6e9cc19baa 100644
--- a/indra/newview/llaisapi.h
+++ b/indra/newview/llaisapi.h
@@ -61,7 +61,8 @@ private:
PURGEDESCENDENTS,
UPDATECATEGORY,
UPDATEITEM,
- COPYLIBRARYCATEGORY
+ COPYLIBRARYCATEGORY,
+ CREATEINVENTORY
} COMMAND_TYPE;
static const std::string INVENTORY_CAP_NAME;
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 909f32cd21..4fc09c7739 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -1701,6 +1701,7 @@ void LLAppearanceMgr::shallowCopyCategory(const LLUUID& src_id, const LLUUID& ds
{
parent_id = gInventory.getRootFolderID();
}
+ // USES UDP PATH
LLUUID subfolder_id = gInventory.createNewCategory( parent_id,
LLFolderType::FT_NONE,
src_cat->getName());
@@ -2725,7 +2726,8 @@ void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool ap
{
pid = gInventory.getRootFolderID();
}
-
+
+ // UDP PATH
LLUUID new_cat_id = gInventory.createNewCategory(
pid,
LLFolderType::FT_NONE,
@@ -3987,6 +3989,7 @@ void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, boo
// existence of AIS as an indicator the fix is present. Does
// not actually use AIS to create the category.
inventory_func_type func = boost::bind(&LLAppearanceMgr::onOutfitFolderCreated,this,_1,show_panel);
+
LLUUID folder_id = gInventory.createNewCategory(
parent_id,
LLFolderType::FT_OUTFIT,
@@ -3994,7 +3997,8 @@ void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, boo
func);
}
else
- {
+ {
+ // UDP PATH
LLUUID folder_id = gInventory.createNewCategory(
parent_id,
LLFolderType::FT_OUTFIT,
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index c4c88d304c..e6b6b10408 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -78,7 +78,9 @@ static S32 cube_channel = -1;
static S32 diffuse_channel = -1;
static S32 bump_channel = -1;
-#define LL_BUMPLIST_MULTITHREADED 0 // TODO -- figure out why this doesn't work
+// Enabled after changing LLViewerTexture::mNeedsCreateTexture to an
+// LLAtomicBool; this should work just fine, now. HB
+#define LL_BUMPLIST_MULTITHREADED 1
// static
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 6ba04cdff2..3a9622f4d4 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -664,24 +664,25 @@ const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::ETyp
// updateCategory() with a newly generated UUID category, but this
// version will take care of details like what the name should be
// based on preferred type. Returns the UUID of the new category.
+//
+// On failure, returns a null UUID.
+// FIXME: callers do not check for or handle a null results currently.
LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
LLFolderType::EType preferred_type,
const std::string& pname,
inventory_func_type callback)
{
- LLUUID id;
+ LLUUID id; // Initially null.
if (!isInventoryUsable())
{
LL_WARNS(LOG_INV) << "Inventory is not usable; can't create requested category of type "
<< preferred_type << LL_ENDL;
- // FIXME failing but still returning an id?
return id;
}
if(LLFolderType::lookup(preferred_type) == LLFolderType::badLookup())
{
LL_DEBUGS(LOG_INV) << "Attempt to create undefined category." << LL_ENDL;
- // FIXME failing but still returning an id?
return id;
}
@@ -693,38 +694,20 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
LL_WARNS(LOG_INV) << "Creating new system folder, type " << preferred_type << LL_ENDL;
}
- id.generate();
std::string name = pname;
- if(!pname.empty())
- {
- name.assign(pname);
- }
- else
+ if (pname.empty())
{
name.assign(LLViewerFolderType::lookupNewCategoryName(preferred_type));
}
- LLViewerRegion* viewer_region = gAgent.getRegion();
- std::string url;
- if ( viewer_region )
- url = viewer_region->getCapability("CreateInventoryCategory");
-
- if (!url.empty() && callback)
+ if (callback)
{
- //Let's use the new capability.
-
- LLSD request, body;
- body["folder_id"] = id;
- body["parent_id"] = parent_id;
- body["type"] = (LLSD::Integer) preferred_type;
- body["name"] = name;
-
- request["message"] = "CreateInventoryCategory";
- request["payload"] = body;
-
- LL_DEBUGS(LOG_INV) << "Creating category via request: " << ll_pretty_print_sd(request) << LL_ENDL;
- LLCoros::instance().launch("LLInventoryModel::createNewCategoryCoro",
- boost::bind(&LLInventoryModel::createNewCategoryCoro, this, url, body, callback));
+ LLSD new_inventory = LLSD::emptyMap();
+ new_inventory["categories"] = LLSD::emptyArray();
+ LLViewerInventoryCategory cat(LLUUID::null, parent_id, preferred_type, name, gAgent.getID());
+ LLSD cat_sd = cat.asLLSD();
+ new_inventory["categories"].append(cat_sd);
+ AISAPI::CreateInventory(parent_id, new_inventory, callback);
return LLUUID::null;
}
@@ -739,6 +722,7 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
// assuming instant success.
// Add the category to the internal representation
+ id.generate();
LLPointer<LLViewerInventoryCategory> cat =
new LLViewerInventoryCategory(id, parent_id, preferred_type, name, gAgent.getID());
cat->setVersion(LLViewerInventoryCategory::VERSION_INITIAL - 1); // accountForUpdate() will icrease version by 1
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index e3ac56d0d3..8a11c5cf8f 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -1118,7 +1118,7 @@ void LLViewerFetchedTexture::init(bool firstinit)
mLoadedCallbackDesiredDiscardLevel = S8_MAX;
mPauseLoadedCallBacks = FALSE;
- mNeedsCreateTexture = FALSE;
+ mNeedsCreateTexture = false;
mIsRawImageValid = FALSE;
mRawDiscardLevel = INVALID_DISCARD_LEVEL;
@@ -1400,12 +1400,12 @@ void LLViewerFetchedTexture::addToCreateTexture()
{
//just update some variables, not to create a real GL texture.
createGLTexture(mRawDiscardLevel, mRawImage, 0, FALSE);
- mNeedsCreateTexture = FALSE;
+ mNeedsCreateTexture = false;
destroyRawImage();
}
else if(!force_update && getDiscardLevel() > -1 && getDiscardLevel() <= mRawDiscardLevel)
{
- mNeedsCreateTexture = FALSE;
+ mNeedsCreateTexture = false;
destroyRawImage();
}
else
@@ -1441,7 +1441,7 @@ void LLViewerFetchedTexture::addToCreateTexture()
mRawDiscardLevel += i;
if(mRawDiscardLevel >= getDiscardLevel() && getDiscardLevel() > 0)
{
- mNeedsCreateTexture = FALSE;
+ mNeedsCreateTexture = false;
destroyRawImage();
return;
}
@@ -1473,7 +1473,7 @@ BOOL LLViewerFetchedTexture::preCreateTexture(S32 usename/*= 0*/)
destroyRawImage();
return FALSE;
}
- mNeedsCreateTexture = FALSE;
+ mNeedsCreateTexture = false;
if (mRawImage.isNull())
{
@@ -1609,14 +1609,14 @@ void LLViewerFetchedTexture::postCreateTexture()
destroyRawImage();
}
- mNeedsCreateTexture = FALSE;
+ mNeedsCreateTexture = false;
}
void LLViewerFetchedTexture::scheduleCreateTexture()
{
if (!mNeedsCreateTexture)
{
- mNeedsCreateTexture = TRUE;
+ mNeedsCreateTexture = true;
if (preCreateTexture())
{
#if LL_IMAGEGL_THREAD_CHECK
@@ -1630,7 +1630,7 @@ void LLViewerFetchedTexture::scheduleCreateTexture()
memcpy(data_copy, data, size);
}
#endif
- mNeedsCreateTexture = TRUE;
+ mNeedsCreateTexture = true;
auto mainq = LLImageGLThread::sEnabled ? mMainQueue.lock() : nullptr;
if (mainq)
{
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index b953d7006b..2f5e0d01df 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -27,6 +27,7 @@
#ifndef LL_LLVIEWERTEXTURE_H
#define LL_LLVIEWERTEXTURE_H
+#include "llatomic.h"
#include "llgltexture.h"
#include "lltimer.h"
#include "llframetimer.h"
@@ -528,7 +529,9 @@ protected:
LLFrameTimer mStopFetchingTimer; // Time since mDecodePriority == 0.f.
BOOL mInImageList; // TRUE if image is in list (in which case don't reset priority!)
- BOOL mNeedsCreateTexture;
+ // This needs to be atomic, since it is written both in the main thread
+ // and in the GL image worker thread... HB
+ LLAtomicBool mNeedsCreateTexture;
BOOL mForSculpt ; //a flag if the texture is used as sculpt data.
BOOL mIsFetched ; //is loaded from remote or from cache, not generated locally.