From 74c8b028d42a8c5b080bb861e427f38cedd4ad7c Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 15 Dec 2023 18:26:14 +0100 Subject: SL-20743 Use LLMutex in LLImageBase for internal data thread-safety --- indra/newview/llfasttimerview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfasttimerview.cpp') diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 5b8ca6c49c..9cf9f45bfb 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -448,6 +448,8 @@ void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch // disable use of glReadPixels which messes up nVidia nSight graphics debugging if (!LLRender::sNsightDebugSupport) { + LLImageDataSharedLock lock(scratch); + //read result back into raw image glReadPixels(0, 0, 1024, 512, GL_RGB, GL_UNSIGNED_BYTE, scratch->getData()); -- cgit v1.2.3 From c285f59ce2a05703e3a1232fcaf3ee3aea714b3f Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 18 Feb 2024 12:52:19 +0100 Subject: Replace BOOL with bool in llwindow and dependent classes --- indra/newview/llfasttimerview.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'indra/newview/llfasttimerview.cpp') diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 9cf9f45bfb..b5650d719d 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -135,7 +135,7 @@ BOOL LLFastTimerView::postBuild() return TRUE; } -BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) +bool LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) { if (mHoverTimer ) { @@ -148,14 +148,14 @@ BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) { mHoverTimer->getParent()->getTreeNode().mCollapsed = true; } - return TRUE; + return true; } else if (mBarRect.pointInRect(x, y)) { S32 bar_idx = MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight()); bar_idx = llclamp(bar_idx, 0, MAX_VISIBLE_HISTORY); mStatsIndex = mScrollIndex + bar_idx; - return TRUE; + return true; } return LLFloater::handleRightMouseDown(x, y, mask); } @@ -172,7 +172,7 @@ BlockTimerStatHandle* LLFastTimerView::getLegendID(S32 y) return NULL; } -BOOL LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask) +bool LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask) { for(LLTrace::block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME); it != LLTrace::end_block_timer_tree_df(); @@ -180,10 +180,10 @@ BOOL LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask) { (*it)->getTreeNode().mCollapsed = false; } - return TRUE; + return true; } -BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) +bool LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) { if (x < mScrollBar->getRect().mLeft) { @@ -201,13 +201,13 @@ BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) else if (mGraphRect.pointInRect(x, y)) { gFocusMgr.setMouseCapture(this); - return TRUE; + return true; } return LLFloater::handleMouseDown(x, y, mask); } -BOOL LLFastTimerView::handleMouseUp(S32 x, S32 y, MASK mask) +bool LLFastTimerView::handleMouseUp(S32 x, S32 y, MASK mask) { if (hasMouseCapture()) { @@ -216,14 +216,14 @@ BOOL LLFastTimerView::handleMouseUp(S32 x, S32 y, MASK mask) return LLFloater::handleMouseUp(x, y, mask);; } -BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) +bool LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) { if (hasMouseCapture()) { F32 lerp = llclamp(1.f - (F32) (x - mGraphRect.mLeft) / (F32) mGraphRect.getWidth(), 0.f, 1.f); mScrollIndex = ll_round( lerp * (F32)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); mScrollIndex = llclamp( mScrollIndex, 0, (S32)mRecording.getNumRecordedPeriods()); - return TRUE; + return true; } mHoverTimer = NULL; mHoverID = NULL; @@ -314,7 +314,7 @@ static std::string get_tooltip(BlockTimerStatHandle& timer, S32 history_index, P return tooltip; } -BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) +bool LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) { if(mPauseHistory && mBarRect.pointInRect(x, y)) { @@ -331,7 +331,7 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) .sticky_rect(screen_rect) .delay_time(0.f)); - return TRUE; + return true; } } else @@ -344,7 +344,7 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) { LLToolTipMgr::instance().show(get_tooltip(*idp, 0, mRecording)); - return TRUE; + return true; } } } @@ -352,7 +352,7 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) return LLFloater::handleToolTip(x, y, mask); } -BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) +bool LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) { if (x < mBarRect.mLeft) { @@ -366,7 +366,7 @@ BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) 0, llmin((S32)mRecording.getNumRecordedPeriods(), (S32)mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); } - return TRUE; + return true; } static BlockTimerStatHandle FTM_RENDER_TIMER("Timers"); -- cgit v1.2.3 From a5261a5fa8fad810ecb5c260d92c3e771822bf58 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 20 Feb 2024 23:46:23 +0100 Subject: Convert BOOL to bool in llui --- indra/newview/llfasttimerview.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfasttimerview.cpp') diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index b5650d719d..ee1e0ed00f 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -59,11 +59,11 @@ using namespace LLTrace; -static const S32 MAX_VISIBLE_HISTORY = 12; -static const S32 LINE_GRAPH_HEIGHT = 240; -static const S32 MIN_BAR_HEIGHT = 3; -static const S32 RUNNING_AVERAGE_WIDTH = 100; -static const S32 NUM_FRAMES_HISTORY = 200; +static constexpr S32 MAX_VISIBLE_HISTORY = 12; +static constexpr S32 LINE_GRAPH_HEIGHT = 240; +static constexpr S32 MIN_BAR_HEIGHT = 3; +static constexpr S32 RUNNING_AVERAGE_WIDTH = 100; +static constexpr S32 NUM_FRAMES_HISTORY = 200; std::vector ft_display_idx; // line of table entry for display purposes (for collapse) @@ -126,13 +126,13 @@ void LLFastTimerView::setPauseState(bool pause_state) mPauseHistory = pause_state; } -BOOL LLFastTimerView::postBuild() +bool LLFastTimerView::postBuild() { LLButton& pause_btn = getChildRef("pause_btn"); mScrollBar = getChild("scroll_vert"); pause_btn.setCommitCallback(boost::bind(&LLFastTimerView::onPause, this)); - return TRUE; + return true; } bool LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) -- cgit v1.2.3 From 60d3dd98a44230c21803c1606552ee098ed9fa7c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 21 Feb 2024 21:05:14 +0100 Subject: Convert remaining BOOL to bool --- indra/newview/llfasttimerview.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview/llfasttimerview.cpp') diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index ee1e0ed00f..46ebb10dbd 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -67,7 +67,7 @@ static constexpr S32 NUM_FRAMES_HISTORY = 200; std::vector ft_display_idx; // line of table entry for display purposes (for collapse) -BOOL LLFastTimerView::sAnalyzePerformance = FALSE; +bool LLFastTimerView::sAnalyzePerformance = false; S32 get_depth(const BlockTimerStatHandle* blockp) { @@ -238,7 +238,7 @@ bool LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) MAX_VISIBLE_HISTORY); if (mHoverBarIndex == 0) { - return TRUE; + return true; } else if (mHoverBarIndex < 0) { @@ -440,7 +440,7 @@ void LLFastTimerView::onOpen(const LLSD& key) void LLFastTimerView::onClose(bool app_quitting) { - setVisible(FALSE); + setVisible(false); } void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch) @@ -1276,7 +1276,7 @@ void LLFastTimerView::drawLegend() } x += dx; - BOOL is_child_of_hover_item = (idp == mHoverID); + bool is_child_of_hover_item = (idp == mHoverID); BlockTimerStatHandle* next_parent = idp->getParent(); while(!is_child_of_hover_item && next_parent) { @@ -1385,31 +1385,31 @@ void LLFastTimerView::drawBorders( S32 y, const S32 x_start, S32 bar_height, S32 S32 by = y + 6 + (S32)LLFontGL::getFontMonospace()->getLineHeight(); //heading - gl_rect_2d(x_start-5, by, getRect().getWidth()-5, y+5, LLColor4::grey, FALSE); + gl_rect_2d(x_start-5, by, getRect().getWidth()-5, y+5, LLColor4::grey, false); //tree view - gl_rect_2d(5, by, x_start-10, 5, LLColor4::grey, FALSE); + gl_rect_2d(5, by, x_start-10, 5, LLColor4::grey, false); by = y + 5; //average bar - gl_rect_2d(x_start-5, by, getRect().getWidth()-5, by-bar_height-dy-5, LLColor4::grey, FALSE); + gl_rect_2d(x_start-5, by, getRect().getWidth()-5, by-bar_height-dy-5, LLColor4::grey, false); by -= bar_height*2+dy; //current frame bar - gl_rect_2d(x_start-5, by, getRect().getWidth()-5, by-bar_height-dy-2, LLColor4::grey, FALSE); + gl_rect_2d(x_start-5, by, getRect().getWidth()-5, by-bar_height-dy-2, LLColor4::grey, false); by -= bar_height+dy+1; //history bars - gl_rect_2d(x_start-5, by, getRect().getWidth()-5, LINE_GRAPH_HEIGHT-bar_height-dy-2, LLColor4::grey, FALSE); + gl_rect_2d(x_start-5, by, getRect().getWidth()-5, LINE_GRAPH_HEIGHT-bar_height-dy-2, LLColor4::grey, false); by = LINE_GRAPH_HEIGHT-dy; //line graph //mGraphRect = LLRect(x_start-5, by, getRect().getWidth()-5, 5); - gl_rect_2d(mGraphRect, FALSE); + gl_rect_2d(mGraphRect, false); } } -- cgit v1.2.3