summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-09-24 00:05:43 -0700
committerRichard Linden <none@none>2013-09-24 00:05:43 -0700
commitab8f64a96754edaa68dd1ff97b9519eff4496aa6 (patch)
tree79261fb8093affd8d7cb94f492b19ad9eec6e0e2 /indra/llui
parent0a87ffb876f3beec6bc7d192c3aba6edf9ded828 (diff)
converted memory tracking units to KB from B
added more memory tracking to LLFolderView and kin
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llfolderview.cpp3
-rwxr-xr-xindra/llui/llfolderview.h32
-rw-r--r--indra/llui/llfolderviewitem.cpp8
-rwxr-xr-xindra/llui/llfolderviewmodel.h24
-rwxr-xr-xindra/llui/llstatview.h3
-rwxr-xr-xindra/llui/llviewmodel.cpp5
6 files changed, 45 insertions, 30 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 373b0e05ac..f0caba3e13 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -174,6 +174,7 @@ LLFolderView::LLFolderView(const Params& p)
mShowItemLinkOverlays(p.show_item_link_overlays),
mViewModel(p.view_model)
{
+ memClaim(mViewModel);
mViewModel->setFolderView(this);
mRoot = this;
@@ -1578,7 +1579,7 @@ BOOL LLFolderView::getShowSelectionContext()
return FALSE;
}
-void LLFolderView::setShowSingleSelection(BOOL show)
+void LLFolderView::setShowSingleSelection(bool show)
{
if (show != mShowSingleSelection)
{
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index 652e22c7bc..4ef685ba0c 100755
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -208,9 +208,9 @@ public:
LLRect getVisibleRect();
BOOL search(LLFolderViewItem* first_item, const std::string &search_string, BOOL backward);
- void setShowSelectionContext(BOOL show) { mShowSelectionContext = show; }
+ void setShowSelectionContext(bool show) { mShowSelectionContext = show; }
BOOL getShowSelectionContext();
- void setShowSingleSelection(BOOL show);
+ void setShowSingleSelection(bool show);
BOOL getShowSingleSelection() { return mShowSingleSelection; }
F32 getSelectionFadeElapsedTime() { return mMultiSelectionFadeTimer.getElapsedTimeF32(); }
bool getUseEllipses() { return mUseEllipses; }
@@ -260,31 +260,32 @@ protected:
LLHandle<LLView> mPopupMenuHandle;
selected_items_t mSelectedItems;
- BOOL mKeyboardSelection;
- BOOL mAllowMultiSelect;
- BOOL mShowEmptyMessage;
- BOOL mShowFolderHierarchy;
+ bool mKeyboardSelection,
+ mAllowMultiSelect,
+ mShowEmptyMessage,
+ mShowFolderHierarchy,
+ mNeedsScroll,
+ mPinningSelectedItem,
+ mNeedsAutoSelect,
+ mAutoSelectOverride,
+ mNeedsAutoRename,
+ mUseLabelSuffix,
+ mDragAndDropThisFrame,
+ mShowItemLinkOverlays,
+ mShowSelectionContext,
+ mShowSingleSelection;
// Renaming variables and methods
LLFolderViewItem* mRenameItem; // The item currently being renamed
LLLineEditor* mRenamer;
- BOOL mNeedsScroll;
- BOOL mPinningSelectedItem;
LLRect mScrollConstraintRect;
- BOOL mNeedsAutoSelect;
- BOOL mAutoSelectOverride;
- BOOL mNeedsAutoRename;
- bool mUseLabelSuffix;
- bool mShowItemLinkOverlays;
LLDepthStack<LLFolderViewFolder> mAutoOpenItems;
LLFolderViewFolder* mAutoOpenCandidate;
LLFrameTimer mAutoOpenTimer;
LLFrameTimer mSearchTimer;
std::string mSearchString;
- BOOL mShowSelectionContext;
- BOOL mShowSingleSelection;
LLFrameTimer mMultiSelectionFadeTimer;
S32 mArrangeGeneration;
@@ -292,7 +293,6 @@ protected:
signal_t mReshapeSignal;
S32 mSignalSelectCallback;
S32 mMinWidth;
- BOOL mDragAndDropThisFrame;
LLPanel* mParentPanel;
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index ac36cd1173..26ea9651b5 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -1496,12 +1496,16 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item )
ft = std::find(mFolders.begin(), mFolders.end(), f);
if (ft != mFolders.end())
{
+ memDisclaim(mFolders);
mFolders.erase(ft);
+ memClaim(mFolders);
}
}
else
{
+ memDisclaim(mItems);
mItems.erase(it);
+ memClaim(mItems);
}
//item has been removed, need to update filter
getViewModelItem()->removeChild(item->getViewModelItem());
@@ -1578,7 +1582,9 @@ void LLFolderViewFolder::addItem(LLFolderViewItem* item)
}
item->setParentFolder(this);
+ memDisclaim(mItems);
mItems.push_back(item);
+ memClaim(mItems);
item->setRect(LLRect(0, 0, getRect().getWidth(), 0));
item->setVisible(FALSE);
@@ -1601,7 +1607,9 @@ void LLFolderViewFolder::addFolder(LLFolderViewFolder* folder)
folder->mParentFolder->extractItem(folder);
}
folder->mParentFolder = this;
+ memDisclaim(mFolders);
mFolders.push_back(folder);
+ memClaim(mFolders);
folder->setOrigin(0, 0);
folder->reshape(getRect().getWidth(), 0);
folder->setVisible(FALSE);
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index b1bcc8bbb4..3f62d133e4 100755
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -108,7 +108,7 @@ public:
virtual S32 getFirstRequiredGeneration() const = 0;
};
-class LLFolderViewModelInterface
+class LLFolderViewModelInterface : public LLTrace::MemTrackable<LLFolderViewModelInterface>
{
public:
virtual ~LLFolderViewModelInterface() {}
@@ -128,7 +128,7 @@ 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
+class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable<LLFolderViewModelItem>
{
public:
LLFolderViewModelItem() { }
@@ -336,18 +336,18 @@ protected:
virtual void setParent(LLFolderViewModelItem* parent) { mParent = parent; }
virtual bool hasParent() { return mParent != NULL; }
- S32 mSortVersion;
- bool mPassedFilter;
- bool mPassedFolderFilter;
- std::string::size_type mStringMatchOffsetFilter;
- std::string::size_type mStringFilterSize;
+ S32 mSortVersion;
+ bool mPassedFilter;
+ bool mPassedFolderFilter;
+ std::string::size_type mStringMatchOffsetFilter;
+ std::string::size_type mStringFilterSize;
- S32 mLastFilterGeneration;
- S32 mLastFolderFilterGeneration;
- S32 mMostFilteredDescendantGeneration;
+ S32 mLastFilterGeneration,
+ mLastFolderFilterGeneration,
+ mMostFilteredDescendantGeneration;
- child_list_t mChildren;
- LLFolderViewModelItem* mParent;
+ child_list_t mChildren;
+ LLFolderViewModelItem* mParent;
LLFolderViewModelInterface& mRootViewModel;
void setFolderViewItem(LLFolderViewItem* folder_view_item) { mFolderViewItem = folder_view_item;}
diff --git a/indra/llui/llstatview.h b/indra/llui/llstatview.h
index 5abdc42448..bc78d3b5fd 100755
--- a/indra/llui/llstatview.h
+++ b/indra/llui/llstatview.h
@@ -46,7 +46,8 @@ public:
Params()
: setting("setting")
{
- changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
+ changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT);
+ changeDefault(show_label, true);
}
};
diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp
index 1b0ab6d92c..21c4e0fcac 100755
--- a/indra/llui/llviewmodel.cpp
+++ b/indra/llui/llviewmodel.cpp
@@ -82,9 +82,12 @@ LLTextViewModel::LLTextViewModel(const LLSD& value)
void LLTextViewModel::setValue(const LLSD& value)
{
LLViewModel::setValue(value);
+ // approximate LLSD storage usage
+ memDisclaim(mDisplay.size());
memDisclaim(mDisplay);
mDisplay = utf8str_to_wstring(value.asString());
memClaim(mDisplay);
+ memClaim(mDisplay.size());
// mDisplay and mValue agree
mUpdateFromDisplay = false;
@@ -96,9 +99,11 @@ 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.
+ memDisclaim(mDisplay.size());
memDisclaim(mDisplay);
mDisplay = value;
memClaim(mDisplay);
+ memClaim(mDisplay.size());
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