summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-05-29 04:18:44 -0500
committerDave Parks <davep@lindenlab.com>2010-05-29 04:18:44 -0500
commit1655256c0c1f536593292d81b89f3580ad1dee73 (patch)
treebf55669c08886b9a64a1663c14243754ac9e7a83 /indra/llui
parent82c7088932061de1f1e5f75945a063be4d506447 (diff)
UI rendering optimization.
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llview.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index e67f0ec3fc..459041f67d 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -123,7 +123,8 @@ LLView::Params::Params()
}
LLView::LLView(const LLView::Params& p)
-: mName(p.name),
+: mVisible(p.visible),
+ mName(p.name),
mParentView(NULL),
mReshapeFlags(FOLLOWS_NONE),
mFromXUI(p.from_xui),
@@ -132,7 +133,6 @@ LLView::LLView(const LLView::Params& p)
mNextInsertionOrdinal(0),
mHoverCursor(getCursorFromString(p.hover_cursor)),
mEnabled(p.enabled),
- mVisible(p.visible),
mMouseOpaque(p.mouse_opaque),
mSoundFlags(p.sound_flags),
mUseBoundingRect(p.use_bounding_rect),
@@ -1309,7 +1309,13 @@ void LLView::drawChildren()
{
if (!mChildList.empty())
{
- LLRect rootRect = getRootView()->getRect();
+ static const LLRect* rootRect = NULL;
+
+ if (!mParentView)
+ {
+ rootRect = &mRect;
+ }
+
LLRect screenRect;
++sDepth;
@@ -1319,13 +1325,15 @@ void LLView::drawChildren()
child_list_reverse_iter_t child = child_iter++;
LLView *viewp = *child;
- if (viewp->getVisible() && viewp->getRect().isValid())
+ if (!viewp->getVisible() || !viewp->getRect().isValid())
+ {
+ continue;
+ }
+
{
- // check for bad data
- llassert_always(viewp->getVisible() == TRUE);
// Only draw views that are within the root view
localRectToScreen(viewp->getRect(),&screenRect);
- if ( rootRect.overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect))
+ if ( rootRect->overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect))
{
LLUI::pushMatrix();
{