From 5491dd6e983f8fccbd687c7c45ef43125dfc0f6c Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Tue, 2 Feb 2010 18:24:11 -0800 Subject: 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. --- indra/llui/lltextbase.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llui/lltextbase.h') 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 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 -- cgit v1.2.3