SL-13729 Performance of LLUI and LLRender2D #3
parent
a5c8b1cbe2
commit
0d7f6d917a
|
|
@ -977,7 +977,7 @@ void LLAccordionCtrlTab::drawChild(const LLRect& root_rect,LLView* child)
|
|||
LLRect screen_rect;
|
||||
localRectToScreen(child->getRect(),&screen_rect);
|
||||
|
||||
if ( root_rect.overlaps(screen_rect) && LLUI::getInstance()->mDirtyRect.overlaps(screen_rect))
|
||||
if ( root_rect.overlaps(screen_rect) && sDirtyRect.overlaps(screen_rect))
|
||||
{
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
LLUI::pushMatrix();
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ void LLConsole::draw()
|
|||
LLUIImagePtr imagep = LLUI::getUIImage("transparent");
|
||||
|
||||
static LLCachedControl<F32> console_bg_opacity(*LLUI::getInstance()->mSettingGroups["config"], "ConsoleBackgroundOpacity", 0.7f);
|
||||
F32 console_opacity = llclamp((F32)console_bg_opacity, 0.f, 1.f);
|
||||
F32 console_opacity = llclamp(console_bg_opacity(), 0.f, 1.f);
|
||||
|
||||
LLColor4 color = LLUIColorTable::instance().getColor("ConsoleBackground");
|
||||
color.mV[VALPHA] *= console_opacity;
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ void LLFolderView::filter( LLFolderViewFilter& filter )
|
|||
LL_RECORD_BLOCK_TIME(FTM_FILTER);
|
||||
static LLCachedControl<S32> time_visible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible", 10);
|
||||
static LLCachedControl<S32> time_invisible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameUnvisible", 1);
|
||||
filter.resetTime(llclamp((S32)(mParentPanel.get()->getVisible() ? time_visible : time_invisible), 1, 100));
|
||||
filter.resetTime(llclamp((mParentPanel.get()->getVisible() ? time_visible() : time_invisible()), 1, 100));
|
||||
|
||||
// Note: we filter the model, not the view
|
||||
getViewModelItem()->filter(filter);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ std::string LLFolderViewModelCommon::getStatusText()
|
|||
void LLFolderViewModelCommon::filter()
|
||||
{
|
||||
static LLCachedControl<S32> max_time(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible", 10);
|
||||
getFilter().resetTime(llclamp((S32)max_time, 1, 100));
|
||||
getFilter().resetTime(llclamp(max_time(), 1, 100));
|
||||
mFolderView->getViewModelItem()->filter(getFilter());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ void LLToolTip::draw()
|
|||
if (mFadeTimer.getStarted())
|
||||
{
|
||||
static LLCachedControl<F32> tool_tip_fade_time(*LLUI::getInstance()->mSettingGroups["config"], "ToolTipFadeTime", 0.2f);
|
||||
alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, (F32)tool_tip_fade_time, 1.f, 0.f);
|
||||
alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, tool_tip_fade_time(), 1.f, 0.f);
|
||||
if (alpha == 0.f)
|
||||
{
|
||||
// finished fading out, so hide ourselves
|
||||
|
|
|
|||
|
|
@ -154,7 +154,6 @@ mAudioCallback(audio_callback),
|
|||
mDeferredAudioCallback(deferred_audio_callback),
|
||||
mWindow(NULL), // set later in startup
|
||||
mRootView(NULL),
|
||||
mDirty(FALSE),
|
||||
mHelpImpl(NULL)
|
||||
{
|
||||
LLRender2D::initParamSingleton(image_provider);
|
||||
|
|
@ -203,19 +202,6 @@ void LLUI::setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t& rem
|
|||
mClearPopupsFunc = clear_popups;
|
||||
}
|
||||
|
||||
void LLUI::dirtyRect(LLRect rect)
|
||||
{
|
||||
if (!mDirty)
|
||||
{
|
||||
mDirtyRect = rect;
|
||||
mDirty = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mDirtyRect.unionWith(rect);
|
||||
}
|
||||
}
|
||||
|
||||
void LLUI::setMousePositionScreen(S32 x, S32 y)
|
||||
{
|
||||
#if defined(LL_DARWIN)
|
||||
|
|
|
|||
|
|
@ -245,10 +245,6 @@ public:
|
|||
|
||||
void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& );
|
||||
|
||||
LLRect mDirtyRect;
|
||||
BOOL mDirty;
|
||||
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
|
||||
std::string getUILanguage();
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ static const S32 LINE_HEIGHT = 15;
|
|||
|
||||
S32 LLView::sDepth = 0;
|
||||
bool LLView::sDebugRects = false;
|
||||
bool LLView::sIsRectDirty = false;
|
||||
LLRect LLView::sDirtyRect;
|
||||
bool LLView::sDebugRectsShowNames = true;
|
||||
bool LLView::sDebugKeys = false;
|
||||
bool LLView::sDebugMouseHandling = false;
|
||||
|
|
@ -1181,7 +1183,7 @@ void LLView::drawChildren()
|
|||
if (viewp->getVisible() && viewp->getRect().isValid())
|
||||
{
|
||||
LLRect screen_rect = viewp->calcScreenRect();
|
||||
if ( rootp->getLocalRect().overlaps(screen_rect) && LLUI::getInstance()->mDirtyRect.overlaps(screen_rect))
|
||||
if ( rootp->getLocalRect().overlaps(screen_rect) && sDirtyRect.overlaps(screen_rect))
|
||||
{
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
|
|
@ -1223,7 +1225,15 @@ void LLView::dirtyRect()
|
|||
parent = parent->getParent();
|
||||
}
|
||||
|
||||
LLUI::getInstance()->dirtyRect(cur->calcScreenRect());
|
||||
if (!sIsRectDirty)
|
||||
{
|
||||
sDirtyRect = cur->calcScreenRect();
|
||||
sIsRectDirty = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sDirtyRect.unionWith(cur->calcScreenRect());
|
||||
}
|
||||
}
|
||||
|
||||
//Draw a box for debugging.
|
||||
|
|
|
|||
|
|
@ -656,6 +656,9 @@ public:
|
|||
// Draw debug rectangles around widgets to help with alignment and spacing
|
||||
static bool sDebugRects;
|
||||
|
||||
static bool sIsRectDirty;
|
||||
static LLRect sDirtyRect;
|
||||
|
||||
// Draw widget names and sizes when drawing debug rectangles, turning this
|
||||
// off is useful to make the rectangles themselves easier to see.
|
||||
static bool sDebugRectsShowNames;
|
||||
|
|
|
|||
|
|
@ -1524,10 +1524,9 @@ void render_ui_2d()
|
|||
|
||||
if (gSavedSettings.getBOOL("RenderUIBuffer"))
|
||||
{
|
||||
LLUI* ui_inst = LLUI::getInstance();
|
||||
if (ui_inst->mDirty)
|
||||
if (LLView::sIsRectDirty)
|
||||
{
|
||||
ui_inst->mDirty = FALSE;
|
||||
LLView::sIsRectDirty = false;
|
||||
LLRect t_rect;
|
||||
|
||||
gPipeline.mUIScreen.bindTarget();
|
||||
|
|
@ -1535,25 +1534,25 @@ void render_ui_2d()
|
|||
{
|
||||
static const S32 pad = 8;
|
||||
|
||||
ui_inst->mDirtyRect.mLeft -= pad;
|
||||
ui_inst->mDirtyRect.mRight += pad;
|
||||
ui_inst->mDirtyRect.mBottom -= pad;
|
||||
ui_inst->mDirtyRect.mTop += pad;
|
||||
LLView::sDirtyRect.mLeft -= pad;
|
||||
LLView::sDirtyRect.mRight += pad;
|
||||
LLView::sDirtyRect.mBottom -= pad;
|
||||
LLView::sDirtyRect.mTop += pad;
|
||||
|
||||
LLGLEnable scissor(GL_SCISSOR_TEST);
|
||||
static LLRect last_rect = ui_inst->mDirtyRect;
|
||||
static LLRect last_rect = LLView::sDirtyRect;
|
||||
|
||||
//union with last rect to avoid mouse poop
|
||||
last_rect.unionWith(ui_inst->mDirtyRect);
|
||||
last_rect.unionWith(LLView::sDirtyRect);
|
||||
|
||||
t_rect = ui_inst->mDirtyRect;
|
||||
ui_inst->mDirtyRect = last_rect;
|
||||
t_rect = LLView::sDirtyRect;
|
||||
LLView::sDirtyRect = last_rect;
|
||||
last_rect = t_rect;
|
||||
|
||||
last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / ui_inst->getScaleFactor().mV[0]);
|
||||
last_rect.mRight = LLRect::tCoordType(last_rect.mRight / ui_inst->getScaleFactor().mV[0]);
|
||||
last_rect.mTop = LLRect::tCoordType(last_rect.mTop / ui_inst->getScaleFactor().mV[1]);
|
||||
last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / ui_inst->getScaleFactor().mV[1]);
|
||||
|
||||
last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / LLUI::getScaleFactor().mV[0]);
|
||||
last_rect.mRight = LLRect::tCoordType(last_rect.mRight / LLUI::getScaleFactor().mV[0]);
|
||||
last_rect.mTop = LLRect::tCoordType(last_rect.mTop / LLUI::getScaleFactor().mV[1]);
|
||||
last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / LLUI::getScaleFactor().mV[1]);
|
||||
|
||||
LLRect clip_rect(last_rect);
|
||||
|
||||
|
|
@ -1565,7 +1564,7 @@ void render_ui_2d()
|
|||
gPipeline.mUIScreen.flush();
|
||||
gGL.setColorMask(true, false);
|
||||
|
||||
ui_inst->mDirtyRect = t_rect;
|
||||
LLView::sDirtyRect = t_rect;
|
||||
}
|
||||
|
||||
LLGLDisable cull(GL_CULL_FACE);
|
||||
|
|
|
|||
|
|
@ -2580,7 +2580,7 @@ void LLViewerWindow::draw()
|
|||
|
||||
if (!gSavedSettings.getBOOL("RenderUIBuffer"))
|
||||
{
|
||||
LLUI::getInstance()->mDirtyRect = getWindowRectScaled();
|
||||
LLView::sDirtyRect = getWindowRectScaled();
|
||||
}
|
||||
|
||||
// HACK for timecode debugging
|
||||
|
|
|
|||
Loading…
Reference in New Issue