Skip to content

Commit de88742

Browse files
RyeMuttclaude
andcommitted
Reduce LLFolderView per-item memory + fix three folderview defects
View items (cost paid per item, per open inventory window): - Intern per-item-constant layout + colors into a shared LLFolderViewItemStyle const*, deduplicated across items (~100 B/item); also drop two dead fields (mLeftPad, mTextPadRight). - Lazily build the label/suffix LLFontVertexBuffers and release them when an item goes off-screen (setVisible override), so only on-screen items hold text geometry instead of every built item. Defects: - draw(): the icon-overlay branch dereferenced the nullable mIcon for its height; fall back to the overlay's own height. - onIdleUpdateFavorites(): the 'nothing changed' path left mFavoritesDirtyFlags set, leaking a per-idle callback that rescanned children every frame; clear it and deregister. - arrange(): drop two redundant sFonts map lookups (use getLabelFont()/sSuffixFont). Inventory bridge: - Remove dead shadowed base LLInvFVBridge::mTimeSinceRequestStart (~16 B per bridge, per window); only LLFolderBridge's own copy is used. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent afae804 commit de88742

5 files changed

Lines changed: 169 additions & 71 deletions

File tree

indra/llui/llfolderview.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ LLFolderView::LLFolderView(const Params& p)
207207
mAutoOpenCandidate = NULL;
208208
mAutoOpenTimer.stop();
209209
mKeyboardSelection = false;
210-
mIndentation = getParentFolder() ? getParentFolder()->getIndentation() + mLocalIndentation : 0;
210+
mIndentation = getParentFolder() ? getParentFolder()->getIndentation() + mStyle->localIndentation : 0;
211211

212212
//clear label
213213
// go ahead and render root folder as usual
@@ -230,11 +230,11 @@ LLFolderView::LLFolderView(const Params& p)
230230
// Textbox
231231
LLTextBox::Params text_p;
232232
LLFontGL* font = getLabelFontForStyle(mLabelStyle);
233-
//mIconPad, mTextPad are set in folder_view_item.xml
234-
LLRect new_r = LLRect(rect.mLeft + mIconPad,
235-
rect.mTop - mTextPad,
233+
//icon_pad, text_pad are set in folder_view_item.xml (shared via mStyle)
234+
LLRect new_r = LLRect(rect.mLeft + mStyle->iconPad,
235+
rect.mTop - mStyle->textPad,
236236
rect.mRight,
237-
rect.mTop - mTextPad - font->getLineHeight());
237+
rect.mTop - mStyle->textPad - font->getLineHeight());
238238
text_p.rect(new_r);
239239
text_p.name(std::string(p.name));
240240
text_p.font(font);

0 commit comments

Comments
 (0)