diff options
author | Rye Mutt <rye@alchemyviewer.org> | 2024-08-03 10:10:17 -0400 |
---|---|---|
committer | Rye Mutt <rye@alchemyviewer.org> | 2024-08-04 23:11:57 -0400 |
commit | c4e921828a41c0e759ee103c6cfdb2cc40c1a581 (patch) | |
tree | 4e26ceeb63a58d1490a976794911c1342cbdd473 /indra/llui/lltextbase.cpp | |
parent | 874794ea584588457dfde7ef17c447e2a0eb46bb (diff) |
Optimization and cleanup of various color finds during draw
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r-- | indra/llui/lltextbase.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 8c3b317838..b7af5d2b1b 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -584,9 +584,8 @@ void LLTextBase::drawCursor() if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection() && text[mCursorPos] != '\n') { - LLColor4 text_color; const LLFontGL* fontp; - text_color = segmentp->getColor(); + const LLColor4& text_color = segmentp->getColor(); fontp = segmentp->getStyle()->getFont(); fontp->render(text, mCursorPos, cursor_rect, LLColor4(1.f - text_color.mV[VRED], 1.f - text_color.mV[VGREEN], 1.f - text_color.mV[VBLUE], alpha), @@ -1368,7 +1367,7 @@ void LLTextBase::draw() { bg_rect.intersectWith(text_rect); } - LLColor4 bg_color = mReadOnly + const LLColor4& bg_color = mReadOnly ? mReadOnlyBgColor.get() : hasFocus() ? mFocusBgColor.get() @@ -1379,7 +1378,7 @@ void LLTextBase::draw() // Draw highlighted if needed if( ll::ui::SearchableControl::getHighlighted() ) { - LLColor4 bg_color = ll::ui::SearchableControl::getHighlightColor(); + const LLColor4& bg_color = ll::ui::SearchableControl::getHighlightColor(); LLRect bg_rect = mVisibleTextRect; if( mScroller ) bg_rect.intersectWith( text_rect ); |