summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.h
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-02-02 18:24:11 -0800
committerMonroe Linden <monroe@lindenlab.com>2010-02-02 18:24:11 -0800
commit5491dd6e983f8fccbd687c7c45ef43125dfc0f6c (patch)
treee4a1486f308680b969ddcd3e15602b3e0bd27c81 /indra/llui/lltextbase.h
parent785d771eaf83bbf056cabe05e639fce8b234e0cc (diff)
Further fixes for EXT-4689 (Long-word chat spam cripples fps and/or disconnects client).
This should fix the inefficiencies in the append path that made viewer FPS drop severely when addinglarge amounts of text to the nearby chat floater. Resizing the floater with a huge amount of text in it is still pretty bad, but fixing that will require some bigger architectural changes. Changed LLTextBase::needsReflow() to take an offset at which to start reflow processing. Changed most needsReflow() calls in LLTextBase to supply a proper index. Changed LLTextBase::reflow() to use the reflow index maintained by needsReflow(). Removed all needsReflow() calls from LLTextEditor (the only way for it to manipulate the text is through functions in LLTextBase that already manage reflowing internally). Removed LLTextEditor::replaceUrlLabel(), since it was identical to the inherited version LLTextBase::replaceUrlLabel(). Reviewed by Richard.
Diffstat (limited to 'indra/llui/lltextbase.h')
-rw-r--r--indra/llui/lltextbase.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index ed2f239476..3dda6f4cc8 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -150,7 +150,7 @@ public:
void appendText(const std::string &new_text, bool prepend_newline, const LLStyle::Params& input_params = LLStyle::Params());
// force reflow of text
- void needsReflow() { mReflowNeeded = TRUE; }
+ void needsReflow(S32 index = 0);
S32 getLength() const { return getWText().length(); }
S32 getLineCount() const { return mLineInfoList.size(); }
@@ -292,7 +292,7 @@ protected:
S32 getFirstVisibleLine() const;
std::pair<S32, S32> getVisibleLines(bool fully_visible = false);
S32 getLeftOffset(S32 width);
- void reflow(S32 start_index = 0);
+ void reflow();
// cursor
void updateCursorXPos();
@@ -362,7 +362,7 @@ protected:
class LLScrollContainer* mScroller;
// transient state
- bool mReflowNeeded; // need to reflow text because of change to text contents or display region
+ S32 mReflowIndex; // index at which to start reflow. S32_MAX indicates no reflow needed.
bool mScrollNeeded; // need to change scroll region because of change to cursor position
S32 mScrollIndex; // index of first character to keep visible in scroll region