summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml22
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredTonemap.glsl52
-rw-r--r--indra/newview/llfloatersnapshot.cpp7
-rw-r--r--indra/newview/llinventorymodelbackgroundfetch.cpp162
-rw-r--r--indra/newview/llinventorymodelbackgroundfetch.h10
-rw-r--r--indra/newview/llviewermenu.cpp40
-rw-r--r--indra/newview/llwebprofile.cpp14
-rw-r--r--indra/newview/pipeline.cpp10
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml2
10 files changed, 194 insertions, 127 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d2c3c96317..a52d21edb5 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9832,6 +9832,28 @@
<key>Value</key>
<real>0.4</real>
</map>
+ <key>RenderTonemapMix</key>
+ <map>
+ <key>Comment</key>
+ <string>Mix between linear and tonemapped colors (0.0(Linear) - 1.0(Tonemapped)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>1.0</real>
+ </map>
+ <key>RenderTonemapType</key>
+ <map>
+ <key>Comment</key>
+ <string>What tonemapper to use: 0 = Khronos Neutral, 1 = ACES</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>ReplaySession</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
index 0673159ab7..befd2ae6da 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
@@ -29,9 +29,7 @@ out vec4 frag_color;
uniform sampler2D diffuseRect;
-uniform float exposure;
uniform float gamma;
-uniform float aces_mix;
uniform vec2 screen_res;
in vec2 vary_fragcoord;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredTonemap.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredTonemap.glsl
index c16ab2f9c4..fc6d4d7727 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredTonemap.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredTonemap.glsl
@@ -95,9 +95,33 @@ vec3 toneMapACES_Hill(vec3 color)
return color;
}
+// Khronos Neutral tonemapping
+// https://github.com/KhronosGroup/ToneMapping/tree/main
+// Input color is non-negative and resides in the Linear Rec. 709 color space.
+// Output color is also Linear Rec. 709, but in the [0, 1] range.
+vec3 PBRNeutralToneMapping( vec3 color )
+{
+ const float startCompression = 0.8 - 0.04;
+ const float desaturation = 0.15;
+
+ float x = min(color.r, min(color.g, color.b));
+ float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
+ color -= offset;
+
+ float peak = max(color.r, max(color.g, color.b));
+ if (peak < startCompression) return color;
+
+ const float d = 1. - startCompression;
+ float newPeak = 1. - d * d / (peak + d - startCompression);
+ color *= newPeak / peak;
+
+ float g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);
+ return mix(color, newPeak * vec3(1, 1, 1), g);
+}
+
uniform float exposure;
-uniform float gamma;
-uniform float aces_mix;
+uniform float tonemap_mix;
+uniform int tonemap_type;
vec3 toneMap(vec3 color)
{
@@ -106,8 +130,20 @@ vec3 toneMap(vec3 color)
color *= exposure * exp_scale;
- // mix ACES and Linear here as a compromise to avoid over-darkening legacy content
- color = mix(toneMapACES_Hill(color), color, aces_mix);
+ vec3 clamped_color = clamp(color.rgb, vec3(0.0), vec3(1.0));
+
+ switch(tonemap_type)
+ {
+ case 0:
+ color = PBRNeutralToneMapping(color);
+ break;
+ case 1:
+ color = toneMapACES_Hill(color);
+ break;
+ }
+
+ // mix tonemapped and linear here to provide adjustment
+ color = mix(clamped_color, color, tonemap_mix);
#endif
return color;
@@ -125,14 +161,6 @@ void debugExposure(inout vec3 color)
}
}
-vec3 legacyGamma(vec3 color)
-{
- vec3 c = 1. - clamp(color, vec3(0.), vec3(1.));
- c = 1. - pow(c, vec3(gamma)); // s/b inverted already CPU-side
-
- return c;
-}
-
void main()
{
//this is the one of the rare spots where diffuseRect contains linear color values (not sRGB)
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index f7c82621fb..1f52f1d180 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -324,7 +324,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater)
bool got_bytes = previewp && previewp->getDataSize() > 0;
bool got_snap = previewp && previewp->getSnapshotUpToDate();
- // *TODO: Separate maximum size for Web images from postcards
LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL;
LLLocale locale(LLLocale::USER_LOCALE);
@@ -343,7 +342,8 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater)
image_res_tb->setTextArg("[HEIGHT]", llformat("%d", previewp->getEncodedImageHeight()));
}
- floater->getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown"));
+ LLTextBox* file_size_label = floater->getChild<LLTextBox>("file_size_label");
+ file_size_label->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown"));
LLUIColor color = LLUIColorTable::instance().getColor( "LabelTextColor" );
if (shot_type == LLSnapshotModel::SNAPSHOT_POSTCARD
@@ -359,7 +359,8 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater)
color = LLUIColor(LLColor4::red);
}
- floater->getChild<LLUICtrl>("file_size_label")->setColor(color);
+ file_size_label->setColor(color);
+ file_size_label->setReadOnlyColor(color); // field gets disabled during upload
// Update the width and height spinners based on the corresponding resolution combos. (?)
switch(shot_type)
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index 8a0dd2c0a9..d8e6bf380e 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -113,7 +113,7 @@ class BGItemHttpHandler : public LLInventoryModel::FetchItemHttpHandler
LOG_CLASS(BGItemHttpHandler);
public:
- BGItemHttpHandler(const LLSD & request_sd)
+ BGItemHttpHandler(const LLSD& request_sd)
: LLInventoryModel::FetchItemHttpHandler(request_sd)
{
LLInventoryModelBackgroundFetch::instance().incrFetchCount(1);
@@ -125,8 +125,8 @@ public:
}
protected:
- BGItemHttpHandler(const BGItemHttpHandler &); // Not defined
- void operator=(const BGItemHttpHandler &); // Not defined
+ BGItemHttpHandler(const BGItemHttpHandler&); // Not defined
+ void operator=(const BGItemHttpHandler&); // Not defined
};
@@ -144,7 +144,7 @@ class BGFolderHttpHandler : public LLCore::HttpHandler
LOG_CLASS(BGFolderHttpHandler);
public:
- BGFolderHttpHandler(const LLSD & request_sd, const uuid_vec_t & recursive_cats)
+ BGFolderHttpHandler(const LLSD& request_sd, const uuid_vec_t& recursive_cats)
: LLCore::HttpHandler(),
mRequestSD(request_sd),
mRecursiveCatUUIDs(recursive_cats)
@@ -158,18 +158,18 @@ public:
}
protected:
- BGFolderHttpHandler(const BGFolderHttpHandler &); // Not defined
- void operator=(const BGFolderHttpHandler &); // Not defined
+ BGFolderHttpHandler(const BGFolderHttpHandler&); // Not defined
+ void operator=(const BGFolderHttpHandler&); // Not defined
public:
- virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response);
+ virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse* response);
- bool getIsRecursive(const LLUUID & cat_id) const;
+ bool getIsRecursive(const LLUUID& cat_id) const;
private:
- void processData(LLSD & body, LLCore::HttpResponse * response);
- void processFailure(LLCore::HttpStatus status, LLCore::HttpResponse * response);
- void processFailure(const char * const reason, LLCore::HttpResponse * response);
+ void processData(LLSD& body, LLCore::HttpResponse* response);
+ void processFailure(LLCore::HttpStatus status, LLCore::HttpResponse* response);
+ void processFailure(const char* const reason, LLCore::HttpResponse* response);
private:
LLSD mRequestSD;
@@ -177,7 +177,7 @@ private:
};
-const char * const LOG_INV("Inventory");
+const char* const LOG_INV("Inventory");
} // end of namespace anonymous
@@ -391,7 +391,7 @@ void LLInventoryModelBackgroundFetch::scheduleFolderFetch(const LLUUID& cat_id,
else
{
// Specific folder requests go to front of queue.
- // version presence acts as dupplicate prevention for normal fetches
+ // version presence acts as duplicate prevention for normal fetches
mFetchFolderQueue.emplace_front(cat_id, FT_DEFAULT);
}
@@ -415,7 +415,7 @@ void LLInventoryModelBackgroundFetch::scheduleItemFetch(const LLUUID& item_id, b
}
else
{
- // 'isFinished' being set acts as dupplicate prevention for normal fetches
+ // 'isFinished' being set acts as duplicate prevention for normal fetches
mFetchItemQueue.emplace_front(item_id, FT_DEFAULT, false);
}
@@ -449,7 +449,7 @@ void LLInventoryModelBackgroundFetch::fetchFolderAndLinks(const LLUUID& cat_id,
// start idle loop to track completion
mBackgroundFetchActive = true;
mFolderFetchActive = true;
- gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+ gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr);
}
void LLInventoryModelBackgroundFetch::fetchCOF(nullary_func_t callback)
@@ -513,7 +513,7 @@ boost::signals2::connection LLInventoryModelBackgroundFetch::setFetchCompletionC
return mFoldersFetchedSignal.connect(cb);
}
-void LLInventoryModelBackgroundFetch::backgroundFetchCB(void *)
+void LLInventoryModelBackgroundFetch::backgroundFetchCB(void*)
{
LLInventoryModelBackgroundFetch::instance().backgroundFetch();
}
@@ -566,7 +566,7 @@ void LLInventoryModelBackgroundFetch::onAISContentCalback(
const LLUUID& response_id,
EFetchType fetch_type)
{
- // Don't push_front on failure - there is a chance it was fired from inside bulkFetchViaAis
+ // Don't emplace_front on failure - there is a chance it was fired from inside bulkFetchViaAis
incrFetchFolderCount(-1);
uuid_vec_t::const_iterator folder_iter = content_ids.begin();
@@ -587,7 +587,7 @@ void LLInventoryModelBackgroundFetch::onAISContentCalback(
if (response_id.isNull())
{
// Failed to fetch, get it individually
- mFetchFolderQueue.push_back(FetchQueueInfo(*folder_iter, FT_RECURSIVE));
+ mFetchFolderQueue.emplace_back(*folder_iter, FT_RECURSIVE);
}
else
{
@@ -601,7 +601,7 @@ void LLInventoryModelBackgroundFetch::onAISContentCalback(
it != categories->end();
++it)
{
- mFetchFolderQueue.push_back(FetchQueueInfo((*it)->getUUID(), FT_RECURSIVE));
+ mFetchFolderQueue.emplace_back((*it)->getUUID(), FT_RECURSIVE);
}
}
}
@@ -613,12 +613,12 @@ void LLInventoryModelBackgroundFetch::onAISContentCalback(
{
mBackgroundFetchActive = true;
mFolderFetchActive = true;
- gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+ gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr);
}
}
-void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_id, const LLUUID &response_id, EFetchType fetch_type)
+void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID& request_id, const LLUUID& response_id, EFetchType fetch_type)
{
- // Don't push_front on failure - there is a chance it was fired from inside bulkFetchViaAis
+ // Don't emplace_front on failure - there is a chance it was fired from inside bulkFetchViaAis
incrFetchFolderCount(-1);
std::list<LLUUID>::const_iterator found = std::find(mExpectedFolderIds.begin(), mExpectedFolderIds.end(), request_id);
if (found != mExpectedFolderIds.end())
@@ -634,7 +634,7 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i
if (request_id.isNull())
{
- // orhans, no other actions needed
+ // orphans, no other actions needed
return;
}
@@ -647,12 +647,12 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i
{
// A full recursive request failed.
// Try requesting folder and nested content separately
- mFetchFolderQueue.push_back(FetchQueueInfo(request_id, FT_FOLDER_AND_CONTENT));
+ mFetchFolderQueue.emplace_back(request_id, FT_FOLDER_AND_CONTENT);
}
else if (fetch_type == FT_FOLDER_AND_CONTENT)
{
LL_WARNS() << "Failed to download folder: " << request_id << " Requesting known content separately" << LL_ENDL;
- mFetchFolderQueue.push_back(FetchQueueInfo(request_id, FT_CONTENT_RECURSIVE));
+ mFetchFolderQueue.emplace_back(request_id, FT_CONTENT_RECURSIVE);
// set folder's version to prevent viewer from trying to request folder indefinetely
LLViewerInventoryCategory* cat(gInventory.getCategory(request_id));
@@ -670,15 +670,15 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i
{
// Got the folder and content, now verify content
// Request content even for FT_RECURSIVE in case of changes, failures
- // or if depth limit gets imlemented.
+ // or if depth limit gets implemented.
// This shouldn't redownload folders if they already have version
request_descendants = true;
LL_DEBUGS(LOG_INV, "AIS3") << "Got folder " << request_id << ". Requesting content" << LL_ENDL;
}
else if (fetch_type == FT_FOLDER_AND_CONTENT)
{
- // readd folder for content request
- mFetchFolderQueue.push_front(FetchQueueInfo(request_id, FT_CONTENT_RECURSIVE));
+ // read folder for content request
+ mFetchFolderQueue.emplace_front(request_id, FT_CONTENT_RECURSIVE);
}
else
{
@@ -698,7 +698,7 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i
it != categories->end();
++it)
{
- mFetchFolderQueue.push_back(FetchQueueInfo((*it)->getUUID(), FT_RECURSIVE));
+ mFetchFolderQueue.emplace_back((*it)->getUUID(), FT_RECURSIVE);
}
}
}
@@ -707,11 +707,11 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i
{
mBackgroundFetchActive = true;
mFolderFetchActive = true;
- gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+ gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr);
}
// done
- LLViewerInventoryCategory * cat(gInventory.getCategory(request_id));
+ LLViewerInventoryCategory* cat(gInventory.getCategory(request_id));
if (cat)
{
cat->setFetching(new_state);
@@ -749,7 +749,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
while (!mFetchFolderQueue.empty() && (U32)mFetchCount < max_concurrent_fetches && curent_time < end_time)
{
- const FetchQueueInfo & fetch_info(mFetchFolderQueue.front());
+ const FetchQueueInfo& fetch_info(mFetchFolderQueue.front());
bulkFetchViaAis(fetch_info);
mFetchFolderQueue.pop_front();
curent_time = LLTimer::getTotalSeconds();
@@ -757,7 +757,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
// Ideally we shouldn't fetch items if recursive fetch isn't done,
// but there is a chance some request will start timeouting and recursive
- // fetch will get stuck on a signle folder, don't block item fetch in such case
+ // fetch will get stuck on a single folder, don't block item fetch in such case
while (!mFetchItemQueue.empty() && (U32)mFetchCount < max_concurrent_fetches && curent_time < end_time)
{
const FetchQueueInfo& fetch_info(mFetchItemQueue.front());
@@ -815,7 +815,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS);
if (marketplacelistings_id.notNull())
{
- mFetchFolderQueue.push_front(FetchQueueInfo(marketplacelistings_id, FT_FOLDER_AND_CONTENT));
+ mFetchFolderQueue.emplace_front(marketplacelistings_id, FT_FOLDER_AND_CONTENT);
}
else
{
@@ -835,11 +835,11 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
{
if (fetch_info.mIsCategory)
{
- const LLUUID & cat_id(fetch_info.mUUID);
+ const LLUUID& cat_id(fetch_info.mUUID);
if (cat_id.isNull())
{
incrFetchFolderCount(1);
- mExpectedFolderIds.push_back(cat_id);
+ mExpectedFolderIds.emplace_back(cat_id);
// Lost and found
// Should it actually be recursive?
AISAPI::FetchOrphans([](const LLUUID& response_id)
@@ -851,7 +851,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
}
else
{
- LLViewerInventoryCategory * cat(gInventory.getCategory(cat_id));
+ LLViewerInventoryCategory* cat(gInventory.getCategory(cat_id));
if (cat)
{
if (fetch_info.mFetchType == FT_CONTENT_RECURSIVE)
@@ -886,8 +886,8 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
continue;
}
- children.push_back(child_cat->getUUID());
- mExpectedFolderIds.push_back(child_cat->getUUID());
+ children.emplace_back(child_cat->getUUID());
+ mExpectedFolderIds.emplace_back(child_cat->getUUID());
child_cat->setFetching(target_state);
if (children.size() >= batch_limit)
@@ -921,7 +921,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
if (content_done)
{
// This will have a bit of overlap with onAISContentCalback,
- // but something else might have dowloaded folders, so verify
+ // but something else might have downloaded folders, so verify
// every child that is complete has it's children done as well
for (LLInventoryModel::cat_array_t::iterator it = categories->begin();
it != categories->end();
@@ -930,14 +930,14 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
LLViewerInventoryCategory* child_cat = (*it);
if (LLViewerInventoryCategory::VERSION_UNKNOWN != child_cat->getVersion())
{
- mFetchFolderQueue.push_back(FetchQueueInfo(child_cat->getUUID(), FT_RECURSIVE));
+ mFetchFolderQueue.emplace_back(child_cat->getUUID(), FT_RECURSIVE);
}
}
}
else
{
// send it back to get the rest
- mFetchFolderQueue.push_back(FetchQueueInfo(cat_id, FT_CONTENT_RECURSIVE));
+ mFetchFolderQueue.emplace_back(cat_id, FT_CONTENT_RECURSIVE);
}
}
else if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion()
@@ -954,7 +954,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
// increment before call in case of immediate callback
incrFetchFolderCount(1);
cat->setFetching(target_state);
- mExpectedFolderIds.push_back(cat_id);
+ mExpectedFolderIds.emplace_back(cat_id);
EFetchType type = fetch_info.mFetchType;
LLUUID cat_cb_id = cat_id;
@@ -978,15 +978,15 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
if (fetch_info.mFetchType == FT_RECURSIVE
|| fetch_info.mFetchType == FT_FOLDER_AND_CONTENT)
{
- LLInventoryModel::cat_array_t * categories(NULL);
- LLInventoryModel::item_array_t * items(NULL);
+ LLInventoryModel::cat_array_t* categories(NULL);
+ LLInventoryModel::item_array_t* items(NULL);
gInventory.getDirectDescendentsOf(cat_id, categories, items);
for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
it != categories->end();
++it)
{
- // not push_front to not cause an infinite loop
- mFetchFolderQueue.push_back(FetchQueueInfo((*it)->getUUID(), FT_RECURSIVE));
+ // not emplace_front to not cause an infinite loop
+ mFetchFolderQueue.emplace_back((*it)->getUUID(), FT_RECURSIVE);
}
}
}
@@ -995,7 +995,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
}
else
{
- LLViewerInventoryItem * itemp(gInventory.getItem(fetch_info.mUUID));
+ LLViewerInventoryItem* itemp(gInventory.getItem(fetch_info.mUUID));
if (itemp)
{
@@ -1033,7 +1033,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
//Background fetch is called from gIdleCallbacks in a loop until background fetch is stopped.
//If there are items in mFetchQueue, we want to check the time since the last bulkFetch was
//sent. If it exceeds our retry time, go ahead and fire off another batch.
- LLViewerRegion * region(gAgent.getRegion());
+ LLViewerRegion* region(gAgent.getRegion());
if (! region || gDisconnected || LLApp::isExiting())
{
return;
@@ -1053,7 +1053,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
// Just processed a bunch of items.
// Note: do we really need notifyObservers() here?
// OnIdle it will be called anyway due to Add flag for processed item.
- // It seems like in some cases we are updaiting on fail (no flag),
+ // It seems like in some cases we are updating on fail (no flag),
// but is there anything to update?
gInventory.notifyObservers();
}
@@ -1071,7 +1071,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
// *TODO: Think I'd like to get a shared pointer to this and share it
// among all the folder requests.
uuid_vec_t recursive_cats;
- uuid_vec_t all_cats; // dupplicate avoidance
+ uuid_vec_t all_cats; // duplicate avoidance
LLSD folder_request_body;
LLSD folder_request_body_lib;
@@ -1081,10 +1081,10 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
while (! mFetchFolderQueue.empty()
&& (item_count + folder_count) < max_batch_size)
{
- const FetchQueueInfo & fetch_info(mFetchFolderQueue.front());
+ const FetchQueueInfo& fetch_info(mFetchFolderQueue.front());
if (fetch_info.mIsCategory)
{
- const LLUUID & cat_id(fetch_info.mUUID);
+ const LLUUID& cat_id(fetch_info.mUUID);
if (cat_id.isNull()) //DEV-17797 Lost and found
{
LLSD folder_sd;
@@ -1098,7 +1098,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
}
else
{
- const LLViewerInventoryCategory * cat(gInventory.getCategory(cat_id));
+ const LLViewerInventoryCategory* cat(gInventory.getCategory(cat_id));
if (cat)
{
if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion())
@@ -1128,14 +1128,14 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
// May already have this folder, but append child folders to list.
if (fetch_info.mFetchType >= FT_CONTENT_RECURSIVE)
{
- LLInventoryModel::cat_array_t * categories(NULL);
- LLInventoryModel::item_array_t * items(NULL);
+ LLInventoryModel::cat_array_t* categories(NULL);
+ LLInventoryModel::item_array_t* items(NULL);
gInventory.getDirectDescendentsOf(cat_id, categories, items);
for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin();
it != categories->end();
++it)
{
- mFetchFolderQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mFetchType));
+ mFetchFolderQueue.emplace_back((*it)->getUUID(), fetch_info.mFetchType);
}
}
}
@@ -1143,9 +1143,9 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
}
if (fetch_info.mFetchType >= FT_CONTENT_RECURSIVE)
{
- recursive_cats.push_back(cat_id);
+ recursive_cats.emplace_back(cat_id);
}
- all_cats.push_back(cat_id);
+ all_cats.emplace_back(cat_id);
}
mFetchFolderQueue.pop_front();
@@ -1155,9 +1155,9 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
while (!mFetchItemQueue.empty()
&& (item_count + folder_count) < max_batch_size)
{
- const FetchQueueInfo & fetch_info(mFetchItemQueue.front());
+ const FetchQueueInfo& fetch_info(mFetchItemQueue.front());
- LLViewerInventoryItem * itemp(gInventory.getItem(fetch_info.mUUID));
+ LLViewerInventoryItem* itemp(gInventory.getItem(fetch_info.mUUID));
if (itemp)
{
@@ -1245,13 +1245,13 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
}
}
-bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LLUUID & cat_id) const
+bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LLUUID& cat_id) const
{
for (fetch_queue_t::const_iterator it = mFetchFolderQueue.begin();
it != mFetchFolderQueue.end();
++it)
{
- const LLUUID & fetch_id = (*it).mUUID;
+ const LLUUID& fetch_id = (*it).mUUID;
if (gInventory.isObjectDescendentOf(fetch_id, cat_id))
return false;
}
@@ -1259,7 +1259,7 @@ bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LL
it != mFetchItemQueue.end();
++it)
{
- const LLUUID & fetch_id = (*it).mUUID;
+ const LLUUID& fetch_id = (*it).mUUID;
if (gInventory.isObjectDescendentOf(fetch_id, cat_id))
return false;
}
@@ -1274,7 +1274,7 @@ namespace
/// Class <anonymous>::BGFolderHttpHandler
///----------------------------------------------------------------------------
-void BGFolderHttpHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response)
+void BGFolderHttpHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse* response)
{
do // Single-pass do-while used for common exit handling
{
@@ -1287,7 +1287,7 @@ void BGFolderHttpHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRes
}
// Response body should be present.
- LLCore::BufferArray * body(response->getBody());
+ LLCore::BufferArray* body(response->getBody());
// body = NULL; // Dev tool to force error handling
if (! body || ! body->size())
{
@@ -1336,9 +1336,9 @@ void BGFolderHttpHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRes
}
-void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * response)
+void BGFolderHttpHandler::processData(LLSD& content, LLCore::HttpResponse* response)
{
- LLInventoryModelBackgroundFetch * fetcher(LLInventoryModelBackgroundFetch::getInstance());
+ LLInventoryModelBackgroundFetch* fetcher(LLInventoryModelBackgroundFetch::getInstance());
// API V2 and earlier should probably be testing for "error" map
// in response as an application-level error.
@@ -1356,7 +1356,7 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
//LLUUID agent_id = folder_sd["agent_id"];
- //if(agent_id != gAgent.getID()) //This should never happen.
+ //if (agent_id != gAgent.getID()) //This should never happen.
//{
// LL_WARNS(LOG_INV) << "Got a UpdateInventoryItem for the wrong agent."
// << LL_ENDL;
@@ -1388,7 +1388,7 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
LLInventoryModel::update_list_t update;
LLInventoryModel::LLCategoryUpdate new_folder(lost_uuid, 1);
- update.push_back(new_folder);
+ update.emplace_back(new_folder);
gInventory.accountForUpdate(update);
titem->setParent(lost_uuid);
@@ -1398,7 +1398,7 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
}
}
- LLViewerInventoryCategory * pcat(gInventory.getCategory(parent_id));
+ LLViewerInventoryCategory* pcat(gInventory.getCategory(parent_id));
if (! pcat)
{
continue;
@@ -1436,7 +1436,7 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
}
// Set version and descendentcount according to message.
- LLViewerInventoryCategory * cat(gInventory.getCategory(parent_id));
+ LLViewerInventoryCategory* cat(gInventory.getCategory(parent_id));
if (cat)
{
cat->setVersion(version);
@@ -1469,9 +1469,9 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res
}
-void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::HttpResponse * response)
+void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::HttpResponse* response)
{
- const std::string & ct(response->getContentType());
+ const std::string& ct(response->getContentType());
LL_WARNS(LOG_INV) << "Inventory folder fetch failure\n"
<< "[Status: " << status.toTerseString() << "]\n"
<< "[Reason: " << status.toString() << "]\n"
@@ -1481,7 +1481,7 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http
// Could use a 404 test here to try to detect revoked caps...
- if(status == LLCore::HttpStatus(HTTP_FORBIDDEN))
+ if (status == LLCore::HttpStatus(HTTP_FORBIDDEN))
{
// Too large, split into two if possible
if (gDisconnected || LLApp::isExiting())
@@ -1511,7 +1511,7 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http
LLUUID folder_id = iter->get("folder_id").asUUID();
if (std::find(mRecursiveCatUUIDs.begin(), mRecursiveCatUUIDs.end(), folder_id) != mRecursiveCatUUIDs.end())
{
- recursive_cats.push_back(folder_id);
+ recursive_cats.emplace_back(folder_id);
}
if (folders.size() == (size / 2))
{
@@ -1542,9 +1542,9 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http
// request which tested on HTTP_INTERNAL_ERROR status. This
// retry logic was unbounded and lacked discrimination as to the
// cause of the retry. The new http library should be doing
- // adquately on retries but I want to keep the structure of a
+ // adequately on retries but I want to keep the structure of a
// retry for reference.
- LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance();
+ LLInventoryModelBackgroundFetch* fetcher = LLInventoryModelBackgroundFetch::getInstance();
if (false)
{
// timed out or curl failure
@@ -1568,7 +1568,7 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http
}
-void BGFolderHttpHandler::processFailure(const char * const reason, LLCore::HttpResponse * response)
+void BGFolderHttpHandler::processFailure(const char* const reason, LLCore::HttpResponse* response)
{
LL_WARNS(LOG_INV) << "Inventory folder fetch failure\n"
<< "[Status: internal error]\n"
@@ -1582,7 +1582,7 @@ void BGFolderHttpHandler::processFailure(const char * const reason, LLCore::Http
// the same but be aware that this may be a source of problems.
// Philosophy is that inventory folders are so essential to
// operation that this is a reasonable action.
- LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance();
+ LLInventoryModelBackgroundFetch* fetcher = LLInventoryModelBackgroundFetch::getInstance();
if (true)
{
for (LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray();
@@ -1605,7 +1605,7 @@ void BGFolderHttpHandler::processFailure(const char * const reason, LLCore::Http
}
-bool BGFolderHttpHandler::getIsRecursive(const LLUUID & cat_id) const
+bool BGFolderHttpHandler::getIsRecursive(const LLUUID& cat_id) const
{
return std::find(mRecursiveCatUUIDs.begin(), mRecursiveCatUUIDs.end(), cat_id) != mRecursiveCatUUIDs.end();
}
diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h
index b3fbe66c69..2e9f69ee29 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.h
+++ b/indra/newview/llinventorymodelbackgroundfetch.h
@@ -54,7 +54,7 @@ public:
void scheduleItemFetch(const LLUUID& item_id, bool forced = false);
typedef boost::function<void()> nullary_func_t;
- // AIS3 only, Fetches folder and everithing links inside the folder point to
+ // AIS3 only, Fetches folder and everything links inside the folder point to
// Intended for outfits
void fetchFolderAndLinks(const LLUUID& cat_id, nullary_func_t callback);
// AIS3 only
@@ -81,8 +81,8 @@ public:
typedef boost::function<void()> folders_fetched_callback_t;
boost::signals2::connection setFetchCompletionCallback(folders_fetched_callback_t cb);
- void addRequestAtFront(const LLUUID & id, bool recursive, bool is_category);
- void addRequestAtBack(const LLUUID & id, bool recursive, bool is_category);
+ void addRequestAtFront(const LLUUID& id, bool recursive, bool is_category);
+ void addRequestAtBack(const LLUUID& id, bool recursive, bool is_category);
protected:
bool isFolderFetchProcessingComplete() const;
@@ -108,8 +108,8 @@ protected:
};
typedef std::deque<FetchQueueInfo> fetch_queue_t;
- void onAISContentCalback(const LLUUID& request_id, const uuid_vec_t &content_ids, const LLUUID& response_id, EFetchType fetch_type);
- void onAISFolderCalback(const LLUUID &request_id, const LLUUID &response_id, EFetchType fetch_type);
+ void onAISContentCalback(const LLUUID& request_id, const uuid_vec_t& content_ids, const LLUUID& response_id, EFetchType fetch_type);
+ void onAISFolderCalback(const LLUUID& request_id, const LLUUID& response_id, EFetchType fetch_type);
void bulkFetchViaAis();
void bulkFetchViaAis(const FetchQueueInfo& fetch_info);
void bulkFetch();
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index e1664752e7..a32e5d23e3 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6748,17 +6748,11 @@ class LLAvatarToggleSearch : public view_listener_t
}
};
-class LLAvatarResetSkeleton: public view_listener_t
+class LLAvatarResetSkeleton : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLVOAvatar* avatar = NULL;
- LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
- if (obj)
- {
- avatar = obj->getAvatar();
- }
- if(avatar)
+ if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
{
avatar->resetSkeleton(false);
}
@@ -6766,12 +6760,11 @@ class LLAvatarResetSkeleton: public view_listener_t
}
};
-class LLAvatarEnableResetSkeleton: public view_listener_t
+class LLAvatarEnableResetSkeleton : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
- if (obj && obj->getAvatar())
+ if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
{
return true;
}
@@ -6779,13 +6772,11 @@ class LLAvatarEnableResetSkeleton: public view_listener_t
}
};
-
class LLAvatarResetSkeletonAndAnimations : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
- if (avatar)
+ if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
{
avatar->resetSkeleton(true);
}
@@ -6793,12 +6784,27 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t
}
};
+class LLAvatarResetSelfSkeleton : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
+ {
+ avatar->resetSkeleton(false);
+ }
+ else
+ {
+ gAgentAvatarp->resetSkeleton(false);
+ }
+ return true;
+ }
+};
+
class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
- if (avatar)
+ if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
{
avatar->resetSkeleton(true);
}
@@ -6810,7 +6816,6 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t
}
};
-
class LLAvatarAddContact : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -10106,6 +10111,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton");
view_listener_t::addMenu(new LLAvatarEnableResetSkeleton(), "Avatar.EnableResetSkeleton");
view_listener_t::addMenu(new LLAvatarResetSkeletonAndAnimations(), "Avatar.ResetSkeletonAndAnimations");
+ view_listener_t::addMenu(new LLAvatarResetSelfSkeleton(), "Avatar.ResetSelfSkeleton");
view_listener_t::addMenu(new LLAvatarResetSelfSkeletonAndAnimations(), "Avatar.ResetSelfSkeletonAndAnimations");
enable.add("Avatar.IsMyProfileOpen", boost::bind(&my_profile_visible));
enable.add("Avatar.IsPicksTabOpen", boost::bind(&picks_tab_visible));
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index feb5ecb1fb..4528ad012d 100644
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -133,12 +133,12 @@ void LLWebProfile::uploadImageCoro(LLPointer<LLImageFormatted> image, std::strin
if (!status)
{
+ LL_WARNS("Snapshots") << "Failed to get image upload config" << LL_ENDL;
+ LLWebProfile::reportImageUploadStatus(false);
if (image->getDataSize() > MAX_WEB_DATASIZE)
{
LLNotificationsUtil::add("CannotUploadSnapshotWebTooBig");
}
- LL_WARNS("Snapshots") << "Failed to get image upload config" << LL_ENDL;
- LLWebProfile::reportImageUploadStatus(false);
return;
}
@@ -166,6 +166,10 @@ void LLWebProfile::uploadImageCoro(LLPointer<LLImageFormatted> image, std::strin
{
LL_WARNS("Snapshots") << "Failed to upload image data." << LL_ENDL;
LLWebProfile::reportImageUploadStatus(false);
+ if (image->getDataSize() > MAX_WEB_DATASIZE)
+ {
+ LLNotificationsUtil::add("CannotUploadSnapshotWebTooBig");
+ }
return;
}
@@ -193,6 +197,10 @@ void LLWebProfile::uploadImageCoro(LLPointer<LLImageFormatted> image, std::strin
{
LL_WARNS("Snapshots") << "Failed to upload image." << LL_ENDL;
LLWebProfile::reportImageUploadStatus(false);
+ if (image->getDataSize() > MAX_WEB_DATASIZE)
+ {
+ LLNotificationsUtil::add("CannotUploadSnapshotWebTooBig");
+ }
return;
}
@@ -201,8 +209,6 @@ void LLWebProfile::uploadImageCoro(LLPointer<LLImageFormatted> image, std::strin
LL_INFOS("Snapshots") << "Image uploaded." << LL_ENDL;
//LL_DEBUGS("Snapshots") << "Uploading image succeeded. Response: [" << raw.asString() << "]" << LL_ENDL;
LLWebProfile::reportImageUploadStatus(true);
-
-
}
/*static*/
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 91ade0eef1..3b1da8668b 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7087,10 +7087,16 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst)
F32 e = llclamp(exposure(), 0.5f, 4.f);
static LLStaticHashedString s_exposure("exposure");
- static LLStaticHashedString aces_mix("aces_mix");
+ static LLStaticHashedString tonemap_mix("tonemap_mix");
+ static LLStaticHashedString tonemap_type("tonemap_type");
shader.uniform1f(s_exposure, e);
- shader.uniform1f(aces_mix, gEXRImage.notNull() ? 0.f : 0.3f);
+
+ static LLCachedControl<U32> tonemap_type_setting(gSavedSettings, "RenderTonemapType", 0U);
+ shader.uniform1i(tonemap_type, tonemap_type_setting);
+
+ static LLCachedControl<F32> tonemap_mix_setting(gSavedSettings, "RenderTonemapMix", 1.f);
+ shader.uniform1f(tonemap_mix, tonemap_mix_setting);
mScreenTriangleVB->setBuffer();
mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3);
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 40f3e51fca..82d2277dfa 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -483,7 +483,7 @@
layout="topleft"
name="Reset Skeleton">
<menu_item_call.on_click
- function="Avatar.ResetSkeleton" />
+ function="Avatar.ResetSelfSkeleton" />
</menu_item_call>
<menu_item_call
label="Reset skeleton and animations"