diff options
author | David Parks <davep@lindenlab.com> | 2009-09-22 11:11:45 +0000 |
---|---|---|
committer | David Parks <davep@lindenlab.com> | 2009-09-22 11:11:45 +0000 |
commit | 536e38ad51b89808f26d8e3cd107fe093862d22a (patch) | |
tree | 230159ae9e319f5c419f1a643177b2bbb17d52c5 /indra/llui | |
parent | 760adead96e62cab8f9cdacc6469773a87dfbc1a (diff) |
Merging render-pipeline-6-qa-2 into viewer-2
Self reviewed.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfloater.cpp | 22 | ||||
-rw-r--r-- | indra/llui/llmenugl.cpp | 8 | ||||
-rw-r--r-- | indra/llui/lltabcontainer.cpp | 9 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 17 | ||||
-rw-r--r-- | indra/llui/llui.h | 4 | ||||
-rw-r--r-- | indra/llui/llview.cpp | 27 | ||||
-rw-r--r-- | indra/llui/llview.h | 1 |
7 files changed, 74 insertions, 14 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 228e23b67e..81915731c3 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -602,6 +602,8 @@ void LLFloater::openFloater(const LLSD& key) mOpenSignal(this, key); onOpen(key); + + dirtyRect(); } void LLFloater::closeFloater(bool app_quitting) @@ -667,7 +669,9 @@ void LLFloater::closeFloater(bool app_quitting) } } } - + + dirtyRect(); + // Close callback mCloseSignal(this, LLSD(app_quitting)); @@ -1933,8 +1937,8 @@ void LLFloaterView::restoreAll() LLRect LLFloaterView::findNeighboringPosition( LLFloater* reference_floater, LLFloater* neighbor ) { LLRect base_rect = reference_floater->getRect(); - S32 width = neighbor->getRect().getWidth(); - S32 height = neighbor->getRect().getHeight(); + LLRect::tCoordType width = neighbor->getRect().getWidth(); + LLRect::tCoordType height = neighbor->getRect().getHeight(); LLRect new_rect = neighbor->getRect(); LLRect expanded_base_rect = base_rect; @@ -1953,10 +1957,10 @@ LLRect LLFloaterView::findNeighboringPosition( LLFloater* reference_floater, LLF } } - S32 left_margin = llmax(0, base_rect.mLeft); - S32 right_margin = llmax(0, getRect().getWidth() - base_rect.mRight); - S32 top_margin = llmax(0, getRect().getHeight() - base_rect.mTop); - S32 bottom_margin = llmax(0, base_rect.mBottom); + LLRect::tCoordType left_margin = llmax(0, base_rect.mLeft); + LLRect::tCoordType right_margin = llmax(0, getRect().getWidth() - base_rect.mRight); + LLRect::tCoordType top_margin = llmax(0, getRect().getHeight() - base_rect.mTop); + LLRect::tCoordType bottom_margin = llmax(0, base_rect.mBottom); // find position for floater in following order // right->left->bottom->top @@ -2262,8 +2266,8 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out // floater is hosted elsewhere, so ignore return; } - S32 screen_width = getSnapRect().getWidth(); - S32 screen_height = getSnapRect().getHeight(); + LLRect::tCoordType screen_width = getSnapRect().getWidth(); + LLRect::tCoordType screen_height = getSnapRect().getHeight(); // convert to local coordinate frame LLRect snap_rect_local = getLocalSnapRect(); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index e0bb6bd5d3..03374b856b 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -408,6 +408,12 @@ void LLMenuItemGL::onCommit( void ) { getMenu()->clearHoverItem(); } + + if (mHighlight != highlight) + { + dirtyRect(); + } + mHighlight = highlight; } @@ -1233,6 +1239,8 @@ void LLMenuItemBranchGL::openMenu() branch->translate( delta_x, delta_y ); branch->setVisible( TRUE ); branch->getParent()->sendChildToFront(branch); + + dirtyRect(); } } diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 720ca692f7..b6eed3ef18 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -329,10 +329,13 @@ void LLTabContainer::draw() } // Hide all the buttons - for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) + if (getTabsHidden()) { - LLTabTuple* tuple = *iter; - tuple->mButton->setVisible( FALSE ); + for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) + { + LLTabTuple* tuple = *iter; + tuple->mButton->setVisible( FALSE ); + } } LLPanel::draw(); diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 950eaf2ea7..000e85f78c 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -81,7 +81,8 @@ std::list<std::string> gUntranslated; /*static*/ LLWindow* LLUI::sWindow = NULL; /*static*/ LLHtmlHelp* LLUI::sHtmlHelp = NULL; /*static*/ LLView* LLUI::sRootView = NULL; - +/*static*/ BOOL LLUI::sDirty = FALSE; +/*static*/ LLRect LLUI::sDirtyRect; /*static*/ std::vector<std::string> LLUI::sXUIPaths; /*static*/ LLFrameTimer LLUI::sMouseIdleTimer; @@ -1603,6 +1604,20 @@ void LLUI::cleanupClass() sImageProvider->cleanUp(); } +//static +void LLUI::dirtyRect(LLRect rect) +{ + if (!sDirty) + { + sDirtyRect = rect; + sDirty = TRUE; + } + else + { + sDirtyRect.unionWith(rect); + } +} + //static void LLUI::translate(F32 x, F32 y, F32 z) diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 33338f30f9..fddf8192ad 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -174,6 +174,10 @@ public: static void loadIdentity(); static void translate(F32 x, F32 y, F32 z = 0.0f); + static LLRect sDirtyRect; + static BOOL sDirty; + static void dirtyRect(LLRect rect); + // Return the ISO639 language name ("en", "ko", etc.) for the viewer UI. // http://www.loc.gov/standards/iso639-2/php/code_list.php static std::string getLanguage(); diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 46510804f8..8d723877d6 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -143,6 +143,7 @@ LLView::LLView(const LLView::Params& p) LLView::~LLView() { + dirtyRect(); //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl; // llassert(LLView::sIsDrawing == FALSE); @@ -602,6 +603,7 @@ void LLView::setVisible(BOOL visible) if (!getParent() || getParent()->isInVisibleChain()) { // tell all children of this view that the visibility may have changed + dirtyRect(); handleVisibilityChange( visible ); } updateBoundingRect(); @@ -1297,7 +1299,7 @@ void LLView::drawChildren() { // Only draw views that are within the root view localRectToScreen(viewp->getRect(),&screenRect); - if ( rootRect.overlaps(screenRect) ) + if ( rootRect.overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect)) { glMatrixMode(GL_MODELVIEW); LLUI::pushMatrix(); @@ -1316,6 +1318,21 @@ void LLView::drawChildren() gGL.getTexUnit(0)->disable(); } +void LLView::dirtyRect() +{ + LLView* child = getParent(); + LLView* parent = child ? child->getParent() : NULL; + LLView* cur = this; + while (child && parent && parent->getParent()) + { //find third to top-most view + cur = child; + child = parent; + parent = parent->getParent(); + } + + LLUI::dirtyRect(cur->calcScreenRect()); +} + //Draw a box for debugging. void LLView::drawDebugRect() { @@ -1529,6 +1546,8 @@ void LLView::updateBoundingRect() { if (isDead()) return; + LLRect cur_rect = mBoundingRect; + if (mUseBoundingRect) { mBoundingRect = calcBoundingRect(); @@ -1543,6 +1562,12 @@ void LLView::updateBoundingRect() { getParent()->updateBoundingRect(); } + + if (mBoundingRect != cur_rect) + { + dirtyRect(); + } + } LLRect LLView::calcScreenRect() const diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 1f7e5afaae..bf3b5d0614 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -519,6 +519,7 @@ public: virtual BOOL handleUnicodeCharHere(llwchar uni_char); virtual void handleReshape(const LLRect& rect, bool by_user); + virtual void dirtyRect(); virtual void notifyParent(const LLSD& info); virtual void notifyChildren(const LLSD& info); |