summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llcombobox.cpp76
-rw-r--r--indra/llui/llscrolllistctrl.cpp126
-rw-r--r--indra/llui/llscrolllistctrl.h9
-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
13 files changed, 307 insertions, 225 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 6e2af4c853..b64794a244 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -107,7 +107,7 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p)
button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT);
button_params.rect(p.rect);
- if(mAllowTextEntry)
+ if (mAllowTextEntry)
{
button_params.pad_right(2);
}
@@ -121,7 +121,7 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p)
mButton = LLUICtrlFactory::create<LLButton>(button_params);
- if(mAllowTextEntry)
+ if (mAllowTextEntry)
{
//redo to compensate for button hack that leaves space for a character
//unless it is a "minimal combobox"(drop down)
@@ -207,14 +207,27 @@ void LLComboBox::clear()
void LLComboBox::onCommit()
{
- if (mAllowTextEntry && getCurrentIndex() != -1)
+ if (LLScrollListItem* item = mList->getFirstSelected())
{
- // we have selected an existing item, blitz the manual text entry with
- // the properly capitalized item
- mTextEntry->setValue(getSimple());
- mTextEntry->setTentative(false);
+ if (mAllowTextEntry && mTextEntry)
+ {
+ // we have selected an existing item, blitz the manual text entry with
+ // the properly capitalized item
+ LLSD label = item->getColumn(0)->getValue();
+ mTextEntry->setValue(label);
+ mTextEntry->setTentative(false);
+ }
+ setControlValue(item->getValue());
+ }
+ else if (mAllowTextEntry)
+ {
+ setControlValue(mTextEntry->getValue());
}
- setControlValue(getValue());
+ else
+ {
+ setControlValue(LLSD());
+ }
+
LLUICtrl::onCommit();
}
@@ -349,6 +362,13 @@ bool LLComboBox::setSimple(const LLStringExplicit& name)
// virtual
void LLComboBox::setValue(const LLSD& value)
{
+ if (LLScrollListItem* item = mList->getFirstSelected())
+ {
+ LLSD item_value = item->getValue();
+ if (item_value.asStringRef() == value.asStringRef())
+ return;
+ }
+
bool found = mList->selectByValue(value);
if (found)
{
@@ -372,10 +392,8 @@ const std::string LLComboBox::getSimple() const
{
return mTextEntry->getText();
}
- else
- {
- return res;
- }
+
+ return res;
}
const std::string LLComboBox::getSelectedItemLabel(S32 column) const
@@ -386,24 +404,22 @@ const std::string LLComboBox::getSelectedItemLabel(S32 column) const
// virtual
LLSD LLComboBox::getValue() const
{
- LLScrollListItem* item = mList->getFirstSelected();
- if( item )
+ if (LLScrollListItem* item = mList->getFirstSelected())
{
return item->getValue();
}
- else if (mAllowTextEntry)
+
+ if (mAllowTextEntry)
{
return mTextEntry->getValue();
}
- else
- {
- return LLSD();
- }
+
+ return LLSD();
}
void LLComboBox::setLabel(const LLStringExplicit& name)
{
- if ( mTextEntry )
+ if (mTextEntry)
{
mTextEntry->setText(name);
if (mList->selectItemByLabel(name, false))
@@ -500,13 +516,23 @@ void LLComboBox::setButtonVisible(bool visible)
bool LLComboBox::setCurrentByIndex(S32 index)
{
- bool found = mList->selectNthItem(index);
- if (found)
+ if (LLScrollListItem* item = mList->getItemByIndex(index))
{
- setLabel(getSelectedItemLabel());
- mLastSelectedIndex = index;
+ if (item->getEnabled())
+ {
+ mList->selectItem(item, -1, true);
+ if (mTextEntry)
+ {
+ LLSD::String label = item->getColumn(0)->getValue().asString();
+ mTextEntry->setText(label);
+ mTextEntry->setTentative(false);
+ }
+ mLastSelectedIndex = index;
+ return true;
+ }
}
- return found;
+
+ return false;
}
S32 LLComboBox::getCurrentIndex() const
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 5ae133a075..445377d3a2 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -410,10 +410,8 @@ void LLScrollListCtrl::clearRows()
LLScrollListItem* LLScrollListCtrl::getFirstSelected() const
{
- item_list::const_iterator iter;
- for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
+ for (LLScrollListItem* item : mItemList)
{
- LLScrollListItem* item = *iter;
if (item->getSelected())
{
return item;
@@ -425,10 +423,8 @@ LLScrollListItem* LLScrollListCtrl::getFirstSelected() const
std::vector<LLScrollListItem*> LLScrollListCtrl::getAllSelected() const
{
std::vector<LLScrollListItem*> ret;
- item_list::const_iterator iter;
- for(iter = mItemList.begin(); iter != mItemList.end(); iter++)
+ for (LLScrollListItem* item : mItemList)
{
- LLScrollListItem* item = *iter;
if (item->getSelected())
{
ret.push_back(item);
@@ -441,9 +437,8 @@ S32 LLScrollListCtrl::getNumSelected() const
{
S32 numSelected = 0;
- for(item_list::const_iterator iter = mItemList.begin(); iter != mItemList.end(); ++iter)
+ for (LLScrollListItem* item : mItemList)
{
- LLScrollListItem* item = *iter;
if (item->getSelected())
{
++numSelected;
@@ -460,10 +455,8 @@ S32 LLScrollListCtrl::getFirstSelectedIndex() const
// make sure sort is up to date before returning an index
updateSort();
- item_list::const_iterator iter;
- for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
+ for (LLScrollListItem* item : mItemList)
{
- LLScrollListItem* item = *iter;
if (item->getSelected())
{
return CurSelectedIndex;
@@ -476,29 +469,19 @@ S32 LLScrollListCtrl::getFirstSelectedIndex() const
LLScrollListItem* LLScrollListCtrl::getFirstData() const
{
- if (mItemList.size() == 0)
- {
- return NULL;
- }
- return mItemList[0];
+ return mItemList.empty() ? NULL : mItemList.front();
}
LLScrollListItem* LLScrollListCtrl::getLastData() const
{
- if (mItemList.size() == 0)
- {
- return NULL;
- }
- return mItemList[mItemList.size() - 1];
+ return mItemList.empty() ? NULL : mItemList.back();
}
std::vector<LLScrollListItem*> LLScrollListCtrl::getAllData() const
{
std::vector<LLScrollListItem*> ret;
- item_list::const_iterator iter;
- for(iter = mItemList.begin(); iter != mItemList.end(); iter++)
+ for (LLScrollListItem* item : mItemList)
{
- LLScrollListItem* item = *iter;
ret.push_back(item);
}
return ret;
@@ -507,22 +490,20 @@ std::vector<LLScrollListItem*> LLScrollListCtrl::getAllData() const
// returns first matching item
LLScrollListItem* LLScrollListCtrl::getItem(const LLSD& sd) const
{
- std::string string_val = sd.asString();
+ const std::string& string_val = sd.asStringRef();
- item_list::const_iterator iter;
- for(iter = mItemList.begin(); iter != mItemList.end(); iter++)
+ for (LLScrollListItem* item : mItemList)
{
- LLScrollListItem* item = *iter;
// assumes string representation is good enough for comparison
- if (item->getValue().asString() == string_val)
+ if (item->getValue().asStringRef() == string_val)
{
return item;
}
}
+
return NULL;
}
-
void LLScrollListCtrl::reshape( S32 width, S32 height, bool called_from_parent )
{
LLUICtrl::reshape( width, height, called_from_parent );
@@ -567,15 +548,16 @@ void LLScrollListCtrl::updateLayout()
void LLScrollListCtrl::fitContents(S32 max_width, S32 max_height)
{
S32 height = llmin( getRequiredRect().getHeight(), max_height );
- if(mPageLines)
- height = llmin( mPageLines * mLineHeight + 2*mBorderThickness + (mDisplayColumnHeaders ? mHeadingHeight : 0), height );
+ if (mPageLines)
+ {
+ height = llmin(mPageLines * mLineHeight + 2 * mBorderThickness + (mDisplayColumnHeaders ? mHeadingHeight : 0), height);
+ }
S32 width = getRect().getWidth();
reshape( width, height );
}
-
LLRect LLScrollListCtrl::getRequiredRect()
{
S32 heading_size = (mDisplayColumnHeaders ? mHeadingHeight : 0);
@@ -627,7 +609,8 @@ bool LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, bool r
S32 i = 0;
for (LLScrollListCell* cell = item->getColumn(i); i < num_cols; cell = item->getColumn(++i))
{
- if (i >= (S32)mColumnsIndexed.size()) break;
+ if (i >= (S32)mColumnsIndexed.size())
+ break;
cell->setWidth(mColumnsIndexed[i]->getWidth());
}
@@ -650,23 +633,21 @@ S32 LLScrollListCtrl::calcMaxContentWidth()
S32 max_item_width = 0;
- ordered_columns_t::iterator column_itor;
- for (column_itor = mColumnsIndexed.begin(); column_itor != mColumnsIndexed.end(); ++column_itor)
+ for (LLScrollListColumn* column : mColumnsIndexed)
{
- LLScrollListColumn* column = *column_itor;
- if (!column) continue;
+ if (!column)
+ continue;
if (mColumnWidthsDirty)
{
// update max content width for this column, by looking at all items
column->mMaxContentWidth = column->mHeader ? LLFontGL::getFontSansSerifSmall()->getWidth(column->mLabel.getWString().c_str()) + mColumnPadding + HEADING_TEXT_PADDING : 0;
- item_list::iterator iter;
- for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
+ for (LLScrollListItem* item : mItemList)
{
- LLScrollListCell* cellp = (*iter)->getColumn(column->mIndex);
- if (!cellp) continue;
-
- column->mMaxContentWidth = llmax(LLFontGL::getFontSansSerifSmall()->getWidth(cellp->getValue().asString()) + mColumnPadding + COLUMN_TEXT_PADDING, column->mMaxContentWidth);
+ if (LLScrollListCell* cellp = item->getColumn(column->mIndex))
+ {
+ column->mMaxContentWidth = llmax(LLFontGL::getFontSansSerifSmall()->getWidth(cellp->getValue().asString()) + mColumnPadding + COLUMN_TEXT_PADDING, column->mMaxContentWidth);
+ }
}
}
max_item_width += column->mMaxContentWidth;
@@ -683,7 +664,8 @@ bool LLScrollListCtrl::updateColumnWidths()
for (column_itor = mColumnsIndexed.begin(); column_itor != mColumnsIndexed.end(); ++column_itor)
{
LLScrollListColumn* column = *column_itor;
- if (!column) continue;
+ if (!column)
+ continue;
// update column width
S32 new_width = 0;
@@ -737,7 +719,6 @@ void LLScrollListCtrl::updateLineHeightInsert(LLScrollListItem* itemp)
}
}
-
void LLScrollListCtrl::updateColumns(bool force_update)
{
if (!mColumnsDirty && !force_update)
@@ -810,7 +791,8 @@ void LLScrollListCtrl::updateColumns(bool force_update)
S32 i = 0;
for (LLScrollListCell* cell = itemp->getColumn(i); i < num_cols; cell = itemp->getColumn(++i))
{
- if (i >= (S32)mColumnsIndexed.size()) break;
+ if (i >= (S32)mColumnsIndexed.size())
+ break;
cell->setWidth(mColumnsIndexed[i]->getWidth());
}
@@ -837,8 +819,8 @@ void LLScrollListCtrl::setHeadingHeight(S32 heading_height)
mHeadingHeight = heading_height;
updateLayout();
-
}
+
void LLScrollListCtrl::setPageLines(S32 new_page_lines)
{
mPageLines = new_page_lines;
@@ -880,6 +862,7 @@ bool LLScrollListCtrl::selectFirstItem()
}
first_item = false;
}
+
if (mCommitOnSelectionChange)
{
commitIfChanged();
@@ -1169,7 +1152,6 @@ void LLScrollListCtrl::selectPrevItem( bool extend_selection)
mSearchString.clear();
}
-
void LLScrollListCtrl::selectNextItem( bool extend_selection)
{
LLScrollListItem* next_item = NULL;
@@ -1213,8 +1195,6 @@ void LLScrollListCtrl::selectNextItem( bool extend_selection)
mSearchString.clear();
}
-
-
void LLScrollListCtrl::deselectAllItems(bool no_commit_on_change)
{
item_list::iterator iter;
@@ -1286,16 +1266,14 @@ LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, boo
LLStringUtil::toLower(target_text);
}
- item_list::iterator iter;
- for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
+ for (LLScrollListItem* item : mItemList)
{
- LLScrollListItem* item = *iter;
std::string item_text = item->getColumn(column)->getValue().asString(); // Only select enabled items with matching names
if (!case_sensitive)
{
LLStringUtil::toLower(item_text);
}
- if(item_text == target_text)
+ if (item_text == target_text)
{
return item;
}
@@ -1303,6 +1281,15 @@ LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, boo
return NULL;
}
+LLScrollListItem* LLScrollListCtrl::getItemByIndex(S32 index)
+{
+ if (index >= 0 && index < (S32)mItemList.size())
+ {
+ return mItemList[index];
+ }
+
+ return NULL;
+}
bool LLScrollListCtrl::selectItemByPrefix(const std::string& target, bool case_sensitive, S32 column)
{
@@ -1463,7 +1450,7 @@ U32 LLScrollListCtrl::searchItems(const LLWString& substring, bool case_sensitiv
return found;
}
-const std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const
+std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const
{
LLScrollListItem* item;
@@ -1507,7 +1494,10 @@ bool LLScrollListCtrl::setSelectedByValue(const LLSD& value, bool selected)
{
bool found = false;
- if (selected && !mAllowMultipleSelection) deselectAllItems(true);
+ if (selected && !mAllowMultipleSelection)
+ {
+ deselectAllItems(true);
+ }
item_list::iterator iter;
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
@@ -2634,9 +2624,7 @@ bool LLScrollListCtrl::isRepeatedChars(const LLWString& string) const
void LLScrollListCtrl::selectItem(LLScrollListItem* itemp, S32 cell, bool select_single_item)
{
- if (!itemp) return;
-
- if (!itemp->getSelected())
+ if (itemp && !itemp->getSelected())
{
if (mLastSelected)
{
@@ -2670,9 +2658,7 @@ void LLScrollListCtrl::selectItem(LLScrollListItem* itemp, S32 cell, bool select
void LLScrollListCtrl::deselectItem(LLScrollListItem* itemp)
{
- if (!itemp) return;
-
- if (itemp->getSelected())
+ if (itemp && itemp->getSelected())
{
if (mLastSelected == itemp)
{
@@ -2878,7 +2864,7 @@ void LLScrollListCtrl::updateStaticColumnWidth(LLScrollListColumn* col, S32 new_
// LLEditMenuHandler functions
// virtual
-void LLScrollListCtrl::copy()
+void LLScrollListCtrl::copy()
{
std::string buffer;
@@ -2892,26 +2878,26 @@ void LLScrollListCtrl::copy()
}
// virtual
-bool LLScrollListCtrl::canCopy() const
+bool LLScrollListCtrl::canCopy() const
{
return (getFirstSelected() != NULL);
}
// virtual
-void LLScrollListCtrl::cut()
+void LLScrollListCtrl::cut()
{
copy();
doDelete();
}
// virtual
-bool LLScrollListCtrl::canCut() const
+bool LLScrollListCtrl::canCut() const
{
return canCopy() && canDoDelete();
}
// virtual
-void LLScrollListCtrl::selectAll()
+void LLScrollListCtrl::selectAll()
{
// Deselects all other items
item_list::iterator iter;
@@ -2931,13 +2917,13 @@ void LLScrollListCtrl::selectAll()
}
// virtual
-bool LLScrollListCtrl::canSelectAll() const
+bool LLScrollListCtrl::canSelectAll() const
{
return getCanSelect() && mAllowMultipleSelection && !(mMaxSelectable > 0 && mItemList.size() > mMaxSelectable);
}
// virtual
-void LLScrollListCtrl::deselect()
+void LLScrollListCtrl::deselect()
{
deselectAllItems();
}
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index 1f9f26e08b..c24784338a 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -260,11 +260,12 @@ public:
// one of which can be selected at a time.
virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD());
- bool selectItemByLabel( const std::string& item, bool case_sensitive = true, S32 column = 0 ); // false if item not found
+ bool selectItemByLabel(const std::string& item, bool case_sensitive = true, S32 column = 0); // false if item not found
bool selectItemByPrefix(const std::string& target, bool case_sensitive = true, S32 column = -1);
bool selectItemByPrefix(const LLWString& target, bool case_sensitive = true, S32 column = -1);
- LLScrollListItem* getItemByLabel( const std::string& item, bool case_sensitive = true, S32 column = 0 );
- const std::string getSelectedItemLabel(S32 column = 0) const;
+ LLScrollListItem* getItemByLabel(const std::string& item, bool case_sensitive = true, S32 column = 0);
+ LLScrollListItem* getItemByIndex(S32 index);
+ std::string getSelectedItemLabel(S32 column = 0) const;
LLSD getSelectedValue();
// If multi select is on, select all element that include substring,
@@ -559,6 +560,8 @@ private:
sort_signal_t* mSortCallback;
is_friend_signal_t* mIsFriendSignal;
+
+ friend class LLComboBox;
}; // end class LLScrollListCtrl
#endif // LL_SCROLLLISTCTRL_H
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"