diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-05-31 01:58:09 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-05-31 01:58:09 +0300 |
commit | 9b0569840f06137ee2379463f5028a5342c3555a (patch) | |
tree | 279eaa517131fe4e073d8d9781e0b69e747a0bb9 /indra/llui | |
parent | 1e09d25d9ce8b7ec8da28ad5364d81c0faab9d0a (diff) | |
parent | cdbd06e8ed6e3f4285a61f5c0b607a65dfdf8dfd (diff) |
Merge branch 'master' into DRTVWR-544-maint
# Conflicts:
# indra/llprimitive/llmodel.cpp
# indra/llprimitive/llmodel.h
# indra/newview/llappviewer.cpp
# indra/newview/llappviewer.h
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/CMakeLists.txt | 6 | ||||
-rw-r--r-- | indra/llui/llcombobox.cpp | 29 | ||||
-rw-r--r-- | indra/llui/llcombobox.h | 3 | ||||
-rw-r--r-- | indra/llui/llfloater.cpp | 17 | ||||
-rw-r--r-- | indra/llui/llfloater.h | 2 | ||||
-rw-r--r-- | indra/llui/llfolderview.cpp | 12 | ||||
-rw-r--r-- | indra/llui/llfolderviewmodel.h | 6 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 4 | ||||
-rw-r--r-- | indra/llui/llnotifications.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llpanel.cpp | 4 | ||||
-rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 7 | ||||
-rw-r--r-- | indra/llui/llstatbar.cpp | 37 | ||||
-rw-r--r-- | indra/llui/llstatbar.h | 6 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 16 | ||||
-rw-r--r-- | indra/llui/lltrans.cpp | 8 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 17 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 15 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 16 | ||||
-rw-r--r-- | indra/llui/llview.cpp | 13 | ||||
-rw-r--r-- | indra/llui/llview.h | 3 | ||||
-rw-r--r-- | indra/llui/llviewereventrecorder.h | 10 | ||||
-rw-r--r-- | indra/llui/llviewmodel.cpp | 20 | ||||
-rw-r--r-- | indra/llui/llviewmodel.h | 3 |
23 files changed, 114 insertions, 142 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index d96824bbf8..e0579352d3 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -308,6 +308,10 @@ if(LL_TESTS) ${BOOST_FIBER_LIBRARY} ${BOOST_CONTEXT_LIBRARY} ${BOOST_SYSTEM_LIBRARY} ${WINDOWS_LIBRARIES}) if(NOT LINUX) - LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") + if(WINDOWS) + LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "imm32;${test_libs}") + else(WINDOWS) + LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") + endif(WINDOWS) endif(NOT LINUX) endif(LL_TESTS) diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index bcc653a602..9ca05a16f3 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -113,6 +113,10 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p) } mArrowImage = button_params.image_unselected; + if (mArrowImage.notNull()) + { + mImageLoadedConnection = mArrowImage->addLoadedCallback(boost::bind(&LLComboBox::imageLoaded, this)); + } mButton = LLUICtrlFactory::create<LLButton>(button_params); @@ -183,6 +187,7 @@ LLComboBox::~LLComboBox() // explicitly disconect this signal, since base class destructor might fire top lost mTopLostSignalConnection.disconnect(); + mImageLoadedConnection.disconnect(); } @@ -1074,6 +1079,30 @@ void LLComboBox::onSetHighlight() const } } +void LLComboBox::imageLoaded() +{ + static LLUICachedControl<S32> drop_shadow_button("DropShadowButton", 0); + + if (mAllowTextEntry) + { + LLRect rect = getLocalRect(); + S32 arrow_width = mArrowImage ? mArrowImage->getWidth() : 0; + S32 shadow_size = drop_shadow_button; + mButton->setRect(LLRect(getRect().getWidth() - llmax(8, arrow_width) - 2 * shadow_size, + rect.mTop, rect.mRight, rect.mBottom)); + if (mButton->getVisible()) + { + // recalculate field size + if (mTextEntry) + { + LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); + text_entry_rect.mRight -= llmax(8, arrow_width) + 2 * drop_shadow_button; + mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE); + } + } + } +} + //============================================================================ // LLCtrlListInterface functions diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index e17d6cdfb4..cac8850a25 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -105,6 +105,8 @@ protected: virtual std::string _getSearchText() const; virtual void onSetHighlight() const; + void imageLoaded(); + public: // LLView interface virtual void onFocusLost(); @@ -244,6 +246,7 @@ private: commit_callback_t mTextChangedCallback; commit_callback_t mSelectionCallback; boost::signals2::connection mTopLostSignalConnection; + boost::signals2::connection mImageLoadedConnection; commit_signal_t mOnReturnSignal; S32 mLastSelectedIndex; }; diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index f4e395a0b8..156d1e83c9 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3264,11 +3264,9 @@ boost::signals2::connection LLFloater::setCloseCallback( const commit_signal_t:: return mCloseSignal.connect(cb); } -LLTrace::BlockTimerStatHandle POST_BUILD("Floater Post Build"); -static LLTrace::BlockTimerStatHandle FTM_EXTERNAL_FLOATER_LOAD("Load Extern Floater Reference"); - bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node) { + LL_PROFILE_ZONE_SCOPED; Params default_params(LLUICtrlFactory::getDefaultParams<LLFloater>()); Params params(default_params); @@ -3295,7 +3293,6 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str LLUICtrlFactory::instance().pushFileName(xml_filename); - LL_RECORD_BLOCK_TIME(FTM_EXTERNAL_FLOATER_LOAD); if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml)) { LL_WARNS() << "Couldn't parse panel from: " << xml_filename << LL_ENDL; @@ -3371,12 +3368,8 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str } BOOL result; - { - LL_RECORD_BLOCK_TIME(POST_BUILD); - - result = postBuild(); - } - + result = postBuild(); + if (!result) { LL_ERRS() << "Failed to construct floater " << getName() << LL_ENDL; @@ -3420,11 +3413,9 @@ bool LLFloater::isVisible(const LLFloater* floater) return floater && floater->getVisible(); } -static LLTrace::BlockTimerStatHandle FTM_BUILD_FLOATERS("Build Floaters"); - bool LLFloater::buildFromFile(const std::string& filename) { - LL_RECORD_BLOCK_TIME(FTM_BUILD_FLOATERS); + LL_PROFILE_ZONE_SCOPED; LLXMLNodePtr root; if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 2672d600c6..306760b7fb 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -346,6 +346,8 @@ public: // handle refocusing. static void closeFrontmostFloater(); + static bool isQuitRequested() { return sQuitting; } + // LLNotification::Params contextualNotification(const std::string& name) // { // return LLNotification::Params(name).context(mNotificationContext); diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 54fdee6901..ea2ca68e47 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -189,7 +189,6 @@ LLFolderView::LLFolderView(const Params& p) mViewModel(p.view_model), mGroupedItemModel(p.grouped_item_model) { - claimMem(mViewModel); LLPanel* panel = p.parent_panel; mParentPanel = panel->getHandle(); mViewModel->setFolderView(this); @@ -339,11 +338,9 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height ) return ll_round(mTargetHeight); } -static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View"); - void LLFolderView::filter( LLFolderViewFilter& filter ) { - LL_RECORD_BLOCK_TIME(FTM_FILTER); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; static LLCachedControl<S32> time_visible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible", 10); static LLCachedControl<S32> time_invisible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameUnvisible", 1); filter.resetTime(llclamp((mParentPanel.get()->getVisible() ? time_visible() : time_invisible()), 1, 100)); @@ -505,10 +502,9 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected) return rv; } -static LLTrace::BlockTimerStatHandle FTM_SANITIZE_SELECTION("Sanitize Selection"); void LLFolderView::sanitizeSelection() { - LL_RECORD_BLOCK_TIME(FTM_SANITIZE_SELECTION); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; // store off current item in case it is automatically deselected // and we want to preserve context LLFolderViewItem* original_selected_item = getCurSelectedItem(); @@ -1623,7 +1619,6 @@ void LLFolderView::setShowSingleSelection(bool show) } } -static LLTrace::BlockTimerStatHandle FTM_AUTO_SELECT("Open and Select"); static LLTrace::BlockTimerStatHandle FTM_INVENTORY("Inventory"); // Main idle routine @@ -1631,7 +1626,7 @@ void LLFolderView::update() { // If this is associated with the user's inventory, don't do anything // until that inventory is loaded up. - LL_RECORD_BLOCK_TIME(FTM_INVENTORY); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; //LL_RECORD_BLOCK_TIME(FTM_INVENTORY); // If there's no model, the view is in suspended state (being deleted) and shouldn't be updated if (getFolderViewModel() == NULL) @@ -1659,7 +1654,6 @@ void LLFolderView::update() // automatically show matching items, and select first one if we had a selection if (mNeedsAutoSelect) { - LL_RECORD_BLOCK_TIME(FTM_AUTO_SELECT); // select new item only if a filtered item not currently selected and there was a selection LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back(); if (!mAutoSelectOverride && selected_itemp && !selected_itemp->getViewModelItem()->potentiallyVisible()) diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index e62b2779dd..093e213be3 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -108,11 +108,10 @@ public: virtual S32 getFirstRequiredGeneration() const = 0; }; -class LLFolderViewModelInterface : public LLTrace::MemTrackable<LLFolderViewModelInterface> +class LLFolderViewModelInterface { public: LLFolderViewModelInterface() - : LLTrace::MemTrackable<LLFolderViewModelInterface>("LLFolderViewModelInterface") {} virtual ~LLFolderViewModelInterface() {} @@ -133,11 +132,10 @@ public: // This is an abstract base class that users of the folderview classes // would use to bridge the folder view with the underlying data -class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable<LLFolderViewModelItem> +class LLFolderViewModelItem : public LLRefCount { public: LLFolderViewModelItem() - : LLTrace::MemTrackable<LLFolderViewModelItem>("LLFolderViewModelItem") {} virtual ~LLFolderViewModelItem() { } diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 29a156e933..aac28e04b9 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -340,8 +340,6 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed) mNeedsLayout = true; } -static LLTrace::BlockTimerStatHandle FTM_UPDATE_LAYOUT("Update LayoutStacks"); - class LLImagePanel : public LLPanel { public: @@ -369,7 +367,7 @@ private: void LLLayoutStack::updateLayout() { - LL_RECORD_BLOCK_TIME(FTM_UPDATE_LAYOUT); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; if (!mNeedsLayout) return; diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index a1f0e78bf3..7c381161c9 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1387,7 +1387,7 @@ bool LLNotifications::failedUniquenessTest(const LLSD& payload) LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelName) { - return LLNotificationChannelPtr(LLNotificationChannel::getInstance(channelName)); + return LLNotificationChannelPtr(LLNotificationChannel::getInstance(channelName).get()); } diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 00da0f5fec..f770920c4a 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -800,14 +800,12 @@ boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t:: return mVisibleSignal->connect(cb); } -static LLTrace::BlockTimerStatHandle FTM_BUILD_PANELS("Build Panels"); - //----------------------------------------------------------------------------- // buildPanel() //----------------------------------------------------------------------------- BOOL LLPanel::buildFromFile(const std::string& filename, const LLPanel::Params& default_params) { - LL_RECORD_BLOCK_TIME(FTM_BUILD_PANELS); + LL_PROFILE_ZONE_SCOPED; BOOL didPost = FALSE; LLXMLNodePtr root; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 2d3f3f5a60..65c7b420ce 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -3144,10 +3144,9 @@ LLScrollListColumn* LLScrollListCtrl::getColumn(const std::string& name) return NULL; } -LLTrace::BlockTimerStatHandle FTM_ADD_SCROLLLIST_ELEMENT("Add Scroll List Item"); LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata) { - LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; LLScrollListItem::Params item_params; LLParamSDParser parser; parser.readSD(element, item_params); @@ -3157,14 +3156,14 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition LLScrollListItem* LLScrollListCtrl::addRow(const LLScrollListItem::Params& item_p, EAddPosition pos) { - LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; LLScrollListItem *new_item = new LLScrollListItem(item_p); return addRow(new_item, item_p, pos); } LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLScrollListItem::Params& item_p, EAddPosition pos) { - LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; if (!item_p.validateBlock() || !new_item) return NULL; new_item->setNumColumns(mColumns.size()); diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 6c8e63442b..2449100952 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -160,6 +160,7 @@ LLStatBar::Params::Params() tick_spacing("tick_spacing", 0.f), decimal_digits("decimal_digits", 3), show_bar("show_bar", false), + show_median("show_median", false), show_history("show_history", false), scale_range("scale_range", true), num_frames("num_frames", 200), @@ -186,6 +187,7 @@ LLStatBar::LLStatBar(const Params& p) mNumShortHistoryFrames(p.num_frames_short), mMaxHeight(p.max_height), mDisplayBar(p.show_bar), + mShowMedian(p.show_median), mDisplayHistory(p.show_history), mOrientation(p.orientation), mAutoScaleMax(!p.bar_max.isProvided()), @@ -318,7 +320,14 @@ void LLStatBar::draw() min = frame_recording.getPeriodMinPerSec(count_stat, num_frames); max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames); mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames); - display_value = mean; + if (mShowMedian) + { + display_value = frame_recording.getPeriodMedianPerSec(count_stat, num_frames); + } + else + { + display_value = mean; + } } break; case STAT_EVENT: @@ -344,7 +353,11 @@ void LLStatBar::draw() mean = frame_recording.getPeriodMean(sample_stat, num_frames); num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW); - if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC) + if (mShowMedian) + { + display_value = frame_recording.getPeriodMedian(sample_stat, num_frames); + } + else if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC) { display_value = mean; } @@ -554,29 +567,25 @@ void LLStatBar::draw() void LLStatBar::setStat(const std::string& stat_name) { using namespace LLTrace; - const StatType<CountAccumulator>* count_stat; - const StatType<EventAccumulator>* event_stat; - const StatType<SampleAccumulator>* sample_stat; - const StatType<MemAccumulator>* mem_stat; - if ((count_stat = StatType<CountAccumulator>::getInstance(stat_name))) + if (auto count_stat = StatType<CountAccumulator>::getInstance(stat_name)) { - mStat.countStatp = count_stat; + mStat.countStatp = count_stat.get(); mStatType = STAT_COUNT; } - else if ((event_stat = StatType<EventAccumulator>::getInstance(stat_name))) + else if (auto event_stat = StatType<EventAccumulator>::getInstance(stat_name)) { - mStat.eventStatp = event_stat; + mStat.eventStatp = event_stat.get(); mStatType = STAT_EVENT; } - else if ((sample_stat = StatType<SampleAccumulator>::getInstance(stat_name))) + else if (auto sample_stat = StatType<SampleAccumulator>::getInstance(stat_name)) { - mStat.sampleStatp = sample_stat; + mStat.sampleStatp = sample_stat.get(); mStatType = STAT_SAMPLE; } - else if ((mem_stat = StatType<MemAccumulator>::getInstance(stat_name))) + else if (auto mem_stat = StatType<MemAccumulator>::getInstance(stat_name)) { - mStat.memStatp = mem_stat; + mStat.memStatp = mem_stat.get(); mStatType = STAT_MEM; } } diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 1ff4c67fc5..6b481ca68f 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -44,9 +44,10 @@ public: bar_max, tick_spacing; - Optional<bool> show_bar, + Optional<bool> show_bar, show_history, - scale_range; + scale_range, + show_median; // default is mean Optional<S32> decimal_digits, num_frames, @@ -112,6 +113,7 @@ private: bool mDisplayBar, // Display the bar graph. mDisplayHistory, + mShowMedian, mAutoScaleMax, mAutoScaleMin; }; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 979503bb67..bb2a57bf36 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1490,11 +1490,9 @@ S32 LLTextBase::getLeftOffset(S32 width) } } - -static LLTrace::BlockTimerStatHandle FTM_TEXT_REFLOW ("Text Reflow"); void LLTextBase::reflow() { - LL_RECORD_BLOCK_TIME(FTM_TEXT_REFLOW); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; updateSegments(); @@ -1842,10 +1840,9 @@ void LLTextBase::removeDocumentChild(LLView* view) } -static LLTrace::BlockTimerStatHandle FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); void LLTextBase::updateSegments() { - LL_RECORD_BLOCK_TIME(FTM_UPDATE_TEXT_SEGMENTS); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; createDefaultSegment(); } @@ -2106,19 +2103,16 @@ static LLUIImagePtr image_from_icon_name(const std::string& icon_name) } } -static LLTrace::BlockTimerStatHandle FTM_PARSE_HTML("Parse HTML"); - - void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; LLStyle::Params style_params(input_params); style_params.fillFrom(getStyleParams()); S32 part = (S32)LLTextParser::WHOLE; if (mParseHTML && !style_params.is_link) // Don't search for URLs inside a link segment (STORM-358). { - LL_RECORD_BLOCK_TIME(FTM_PARSE_HTML); S32 start=0,end=0; LLUrlMatch match; std::string text = new_text; @@ -2212,11 +2206,9 @@ void LLTextBase::setLastSegmentToolTip(const std::string &tooltip) } } -static LLTrace::BlockTimerStatHandle FTM_APPEND_TEXT("Append Text"); - void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, const LLStyle::Params& input_params) { - LL_RECORD_BLOCK_TIME(FTM_APPEND_TEXT); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; if (new_text.empty()) return; diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp index a1a8feedaa..a1ef34159d 100644 --- a/indra/llui/lltrans.cpp +++ b/indra/llui/lltrans.cpp @@ -147,7 +147,7 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil:: { // Don't care about time as much as call count. Make sure we're not // calling LLTrans::getString() in an inner loop. JC - LL_RECORD_BLOCK_TIME(FTM_GET_TRANS); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; if (def_string) { @@ -196,7 +196,7 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args { // Don't care about time as much as call count. Make sure we're not // calling LLTrans::getString() in an inner loop. JC - LL_RECORD_BLOCK_TIME(FTM_GET_TRANS); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; if (def_string) { @@ -237,7 +237,7 @@ std::string LLTrans::getDefString(const std::string &xml_desc, const LLSD& msg_a //static bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args) { - LL_RECORD_BLOCK_TIME(FTM_GET_TRANS); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; template_map_t::iterator iter = sStringTemplates.find(xml_desc); if (iter != sStringTemplates.end()) @@ -259,7 +259,7 @@ bool LLTrans::findString(std::string &result, const std::string &xml_desc, const //static bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLSD& msg_args) { - LL_RECORD_BLOCK_TIME(FTM_GET_TRANS); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; template_map_t::iterator iter = sStringTemplates.find(xml_desc); if (iter != sStringTemplates.end()) diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 5924542a19..2196ba201b 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -121,7 +121,6 @@ LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) mDoubleClickSignal(NULL), mTransparencyType(TT_DEFAULT) { - claimMem(viewmodel.get()); } void LLUICtrl::initFromParams(const Params& p) @@ -476,6 +475,7 @@ LLViewModel* LLUICtrl::getViewModel() const //virtual BOOL LLUICtrl::postBuild() { + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; // // Find all of the children that want to be in front and move them to the front // @@ -781,12 +781,9 @@ BOOL LLUICtrl::getIsChrome() const } - -LLTrace::BlockTimerStatHandle FTM_FOCUS_FIRST_ITEM("Focus First Item"); - BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash) { - LL_RECORD_BLOCK_TIME(FTM_FOCUS_FIRST_ITEM); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; // try to select default tab group child LLViewQuery query = getTabOrderQuery(); child_list_t result = query(this); @@ -1005,7 +1002,6 @@ boost::signals2::connection LLUICtrl::setCommitCallback( boost::function<void (L boost::signals2::connection LLUICtrl::setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb ) { if (!mValidateSignal) mValidateSignal = new enable_signal_t(); - claimMem(mValidateSignal); return mValidateSignal->connect(boost::bind(cb, _2)); } @@ -1070,7 +1066,6 @@ boost::signals2::connection LLUICtrl::setValidateCallback(const EnableCallbackPa boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb ) { if (!mCommitSignal) mCommitSignal = new commit_signal_t(); - claimMem(mCommitSignal); return mCommitSignal->connect(cb); } @@ -1078,7 +1073,6 @@ boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t:: boost::signals2::connection LLUICtrl::setValidateCallback( const enable_signal_t::slot_type& cb ) { if (!mValidateSignal) mValidateSignal = new enable_signal_t(); - claimMem(mValidateSignal); return mValidateSignal->connect(cb); } @@ -1086,7 +1080,6 @@ boost::signals2::connection LLUICtrl::setValidateCallback( const enable_signal_t boost::signals2::connection LLUICtrl::setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { if (!mMouseEnterSignal) mMouseEnterSignal = new commit_signal_t(); - claimMem(mMouseEnterSignal); return mMouseEnterSignal->connect(cb); } @@ -1094,7 +1087,6 @@ boost::signals2::connection LLUICtrl::setMouseEnterCallback( const commit_signal boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { if (!mMouseLeaveSignal) mMouseLeaveSignal = new commit_signal_t(); - claimMem(mMouseLeaveSignal); return mMouseLeaveSignal->connect(cb); } @@ -1102,7 +1094,6 @@ boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal boost::signals2::connection LLUICtrl::setMouseDownCallback( const mouse_signal_t::slot_type& cb ) { if (!mMouseDownSignal) mMouseDownSignal = new mouse_signal_t(); - claimMem(mMouseDownSignal); return mMouseDownSignal->connect(cb); } @@ -1110,7 +1101,6 @@ boost::signals2::connection LLUICtrl::setMouseDownCallback( const mouse_signal_t boost::signals2::connection LLUICtrl::setMouseUpCallback( const mouse_signal_t::slot_type& cb ) { if (!mMouseUpSignal) mMouseUpSignal = new mouse_signal_t(); - claimMem(mMouseUpSignal); return mMouseUpSignal->connect(cb); } @@ -1118,7 +1108,6 @@ boost::signals2::connection LLUICtrl::setMouseUpCallback( const mouse_signal_t:: boost::signals2::connection LLUICtrl::setRightMouseDownCallback( const mouse_signal_t::slot_type& cb ) { if (!mRightMouseDownSignal) mRightMouseDownSignal = new mouse_signal_t(); - claimMem(mRightMouseDownSignal); return mRightMouseDownSignal->connect(cb); } @@ -1126,7 +1115,6 @@ boost::signals2::connection LLUICtrl::setRightMouseDownCallback( const mouse_sig boost::signals2::connection LLUICtrl::setRightMouseUpCallback( const mouse_signal_t::slot_type& cb ) { if (!mRightMouseUpSignal) mRightMouseUpSignal = new mouse_signal_t(); - claimMem(mRightMouseUpSignal); return mRightMouseUpSignal->connect(cb); } @@ -1134,7 +1122,6 @@ boost::signals2::connection LLUICtrl::setRightMouseUpCallback( const mouse_signa boost::signals2::connection LLUICtrl::setDoubleClickCallback( const mouse_signal_t::slot_type& cb ) { if (!mDoubleClickSignal) mDoubleClickSignal = new mouse_signal_t(); - claimMem(mDoubleClickSignal); return mDoubleClickSignal->connect(cb); } diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index fdefae01b1..a85db17c7f 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -44,10 +44,6 @@ // this library includes #include "llpanel.h" -LLTrace::BlockTimerStatHandle FTM_WIDGET_CONSTRUCTION("Widget Construction"); -LLTrace::BlockTimerStatHandle FTM_INIT_FROM_PARAMS("Widget InitFromParams"); -LLTrace::BlockTimerStatHandle FTM_WIDGET_SETUP("Widget Setup"); - //----------------------------------------------------------------------------- // UI Ctrl class for padding @@ -117,12 +113,10 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa } } -static LLTrace::BlockTimerStatHandle FTM_CREATE_CHILDREN("Create XUI Children"); - //static void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node) { - LL_RECORD_BLOCK_TIME(FTM_CREATE_CHILDREN); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; if (node.isNull()) return; for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling()) @@ -159,14 +153,13 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid } -static LLTrace::BlockTimerStatHandle FTM_XML_PARSE("XML Reading/Parsing"); //----------------------------------------------------------------------------- // getLayeredXMLNode() //----------------------------------------------------------------------------- bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNodePtr& root, LLDir::ESkinConstraint constraint) { - LL_RECORD_BLOCK_TIME(FTM_XML_PARSE); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; std::vector<std::string> paths = gDirUtilp->findSkinnedFilenames(LLDir::XUI, xui_filename, constraint); @@ -191,11 +184,9 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static LLTrace::BlockTimerStatHandle FTM_CREATE_FROM_XML("Create child widget"); - LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t& registry, LLXMLNodePtr output_node) { - LL_RECORD_BLOCK_TIME(FTM_CREATE_FROM_XML); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; std::string ctrl_type = node->getName()->mString; LLStringUtil::toLower(ctrl_type); diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 135ed57a4f..6e585abfc0 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -79,10 +79,6 @@ class LLWidgetNameRegistry // LLSINGLETON(LLDefaultParamBlockRegistry); //}; -extern LLTrace::BlockTimerStatHandle FTM_WIDGET_SETUP; -extern LLTrace::BlockTimerStatHandle FTM_WIDGET_CONSTRUCTION; -extern LLTrace::BlockTimerStatHandle FTM_INIT_FROM_PARAMS; - // Build time optimization, generate this once in .cpp file #ifndef LLUICTRLFACTORY_CPP extern template class LLUICtrlFactory* LLSingleton<class LLUICtrlFactory>::getInstance(); @@ -213,6 +209,7 @@ private: template<typename T> static T* createWidgetImpl(const typename T::Params& params, LLView* parent = NULL) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; T* widget = NULL; if (!params.validateBlock()) @@ -221,12 +218,9 @@ private: //return NULL; } - { LL_RECORD_BLOCK_TIME(FTM_WIDGET_CONSTRUCTION); - widget = new T(params); - } - { LL_RECORD_BLOCK_TIME(FTM_INIT_FROM_PARAMS); - widget->initFromParams(params); - } + widget = new T(params); + + widget->initFromParams(params); if (parent) { @@ -239,7 +233,7 @@ private: template<typename T> static T* defaultBuilder(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { - LL_RECORD_BLOCK_TIME(FTM_WIDGET_SETUP); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; typename T::Params params(getDefaultParams<T>()); diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index b942be2a4a..9ba71913d0 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -140,8 +140,7 @@ LLView::Params::Params() } LLView::LLView(const LLView::Params& p) -: LLTrace::MemTrackable<LLView>("LLView"), - mVisible(p.visible), +: mVisible(p.visible), mInDraw(false), mName(p.name), mParentView(NULL), @@ -1597,15 +1596,11 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const return getChild<LLView>(name, recurse); } -static LLTrace::BlockTimerStatHandle FTM_FIND_VIEWS("Find Widgets"); - LLView* LLView::findChildView(const std::string& name, BOOL recurse) const { - LL_RECORD_BLOCK_TIME(FTM_FIND_VIEWS); - //richard: should we allow empty names? - //if(name.empty()) - // return NULL; - // Look for direct children *first* + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; + + // Look for direct children *first* BOOST_FOREACH(LLView* childp, mChildList) { llassert(childp); diff --git a/indra/llui/llview.h b/indra/llui/llview.h index c60dcf3344..bec45df78a 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -100,8 +100,7 @@ class LLView : public LLMouseHandler, // handles mouse events public LLFocusableElement, // handles keyboard events public LLMortician, // lazy deletion - public LLHandleProvider<LLView>, // passes out weak references to self - public LLTrace::MemTrackable<LLView> // track memory usage + public LLHandleProvider<LLView> // passes out weak references to self { public: diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h index 94e66f5dc4..6170005b2b 100644 --- a/indra/llui/llviewereventrecorder.h +++ b/indra/llui/llviewereventrecorder.h @@ -41,12 +41,12 @@ #include "llsingleton.h" // includes llerror which we need here so we can skip the include here -class LLViewerEventRecorder : public LLSingleton<LLViewerEventRecorder> +class LLViewerEventRecorder : public LLSimpleton<LLViewerEventRecorder> { - LLSINGLETON(LLViewerEventRecorder); - ~LLViewerEventRecorder(); - - public: +public: + LLViewerEventRecorder(); + ~LLViewerEventRecorder(); + void updateMouseEventInfo(S32 local_x,S32 local_y, S32 global_x, S32 global_y, std::string mName); void setMouseLocalCoords(S32 x,S32 y); void setMouseGlobalCoords(S32 x,S32 y); diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp index 282addf692..a400eb70c0 100644 --- a/indra/llui/llviewmodel.cpp +++ b/indra/llui/llviewmodel.cpp @@ -37,15 +37,13 @@ /// LLViewModel::LLViewModel() -: LLTrace::MemTrackable<LLViewModel>("LLViewModel"), - mDirty(false) +: mDirty(false) { } /// Instantiate an LLViewModel with an existing data value LLViewModel::LLViewModel(const LLSD& value) -: LLTrace::MemTrackable<LLViewModel>("LLViewModel"), - mDirty(false) +: mDirty(false) { setValue(value); } @@ -82,15 +80,9 @@ LLTextViewModel::LLTextViewModel(const LLSD& value) void LLTextViewModel::setValue(const LLSD& value) { // approximate LLSD storage usage - disclaimMem(mDisplay.size()); LLViewModel::setValue(value); - disclaimMem(mDisplay); mDisplay = utf8str_to_wstring(value.asString()); - claimMem(mDisplay); - // approximate LLSD storage usage - claimMem(mDisplay.size()); - // mDisplay and mValue agree mUpdateFromDisplay = false; } @@ -101,12 +93,8 @@ void LLTextViewModel::setDisplay(const LLWString& value) // and do the utf8str_to_wstring() to get the corresponding mDisplay // value. But a text editor might want to edit the display string // directly, then convert back to UTF8 on commit. - disclaimMem(mDisplay.size()); - disclaimMem(mDisplay); - mDisplay = value; - claimMem(mDisplay); - claimMem(mDisplay.size()); - mDirty = true; + mDisplay = value; + mDirty = true; // Don't immediately convert to UTF8 -- do it lazily -- we expect many // more setDisplay() calls than getValue() calls. Just flag that it needs // doing. diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h index 49d7c322a3..e7dceb6c31 100644 --- a/indra/llui/llviewmodel.h +++ b/indra/llui/llviewmodel.h @@ -62,8 +62,7 @@ typedef LLPointer<LLListViewModel> LLListViewModelPtr; * last referencing widget is destroyed. */ class LLViewModel -: public LLRefCount, - public LLTrace::MemTrackable<LLViewModel> +: public LLRefCount { public: LLViewModel(); |