From 6308743fd2c9fde30277c7c63aeeacd8facd9419 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Fri, 8 Feb 2019 19:26:28 -0800 Subject: Fix issue where gamma was being corrupted on windows with night light enabled --- indra/llwindow/llwindowwin32.cpp | 24 ++++++++++++++++++++---- indra/llwindow/llwindowwin32.h | 5 +++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 504c1589b0..27787a51a8 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -425,6 +425,9 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, mKeyVirtualKey = 0; mhDC = NULL; mhRC = NULL; + memset(mCurrentGammaRamp, 0, sizeof(mCurrentGammaRamp)); + memset(mPrevGammaRamp, 0, sizeof(mPrevGammaRamp)); + mCustomGammaSet = FALSE; if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &mMouseVanish, 0)) { @@ -2989,13 +2992,26 @@ F32 LLWindowWin32::getGamma() BOOL LLWindowWin32::restoreGamma() { - return SetDeviceGammaRamp(mhDC, mPrevGammaRamp); + if (mCustomGammaSet != FALSE) + { + mCustomGammaSet = FALSE; + return SetDeviceGammaRamp(mhDC, mPrevGammaRamp); + } + return TRUE; } BOOL LLWindowWin32::setGamma(const F32 gamma) { mCurrentGamma = gamma; + //Get the previous gamma ramp to restore later. + if (mCustomGammaSet == FALSE) + { + if (GetDeviceGammaRamp(mhDC, mPrevGammaRamp) == FALSE) + return FALSE; + mCustomGammaSet = TRUE; + } + LL_DEBUGS("Window") << "Setting gamma to " << gamma << LL_ENDL; for ( int i = 0; i < 256; ++i ) @@ -3007,9 +3023,9 @@ BOOL LLWindowWin32::setGamma(const F32 gamma) if ( value > 0xffff ) value = 0xffff; - mCurrentGammaRamp [ 0 * 256 + i ] = - mCurrentGammaRamp [ 1 * 256 + i ] = - mCurrentGammaRamp [ 2 * 256 + i ] = ( WORD )value; + mCurrentGammaRamp[0][i] = + mCurrentGammaRamp[1][i] = + mCurrentGammaRamp[2][i] = (WORD) value; }; return SetDeviceGammaRamp ( mhDC, mCurrentGammaRamp ); diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index d72623a6f4..9cd16eb993 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -184,8 +184,9 @@ protected: F32 mCurrentGamma; U32 mFSAASamples; - WORD mPrevGammaRamp[256*3]; - WORD mCurrentGammaRamp[256*3]; + WORD mPrevGammaRamp[3][256]; + WORD mCurrentGammaRamp[3][256]; + BOOL mCustomGammaSet; LPWSTR mIconResource; BOOL mMousePositionModified; -- cgit v1.2.3 From b996c95f32e9fa27206c4ed7ca20853c80c5e297 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 28 May 2019 23:52:23 +0300 Subject: SL-11079 Updated contributions.txt --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index a73bd10295..466dffded7 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1323,6 +1323,7 @@ Sovereign Engineer STORM-2143 STORM-2148 MAINT-7343 + SL-11079 SpacedOut Frye VWR-34 VWR-45 -- cgit v1.2.3 From 9212c1f33e6790c50957c4c46b8e1a386990aef9 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 4 Jun 2019 00:03:03 +0300 Subject: SL-11341 Skip storing the previous gamma value on Intel GPUs + more logging --- indra/llwindow/llwindowwin32.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 27787a51a8..97cd31de81 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2994,6 +2994,7 @@ BOOL LLWindowWin32::restoreGamma() { if (mCustomGammaSet != FALSE) { + LL_DEBUGS("Window") << "Restoring gamma" << LL_ENDL; mCustomGammaSet = FALSE; return SetDeviceGammaRamp(mhDC, mPrevGammaRamp); } @@ -3007,8 +3008,15 @@ BOOL LLWindowWin32::setGamma(const F32 gamma) //Get the previous gamma ramp to restore later. if (mCustomGammaSet == FALSE) { - if (GetDeviceGammaRamp(mhDC, mPrevGammaRamp) == FALSE) - return FALSE; + if (!gGLManager.mIsIntel) // skip for Intel GPUs (see SL-11341) + { + LL_DEBUGS("Window") << "Getting the previous gamma ramp to restore later" << LL_ENDL; + if(GetDeviceGammaRamp(mhDC, mPrevGammaRamp) == FALSE) + { + LL_WARNS("Window") << "Failed to get the previous gamma ramp" << LL_ENDL; + return FALSE; + } + } mCustomGammaSet = TRUE; } -- cgit v1.2.3 From 2baff8e016e4cccf61b1f1ed756f6712e1ca7345 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 20 Jun 2019 14:18:41 -0400 Subject: Added tag 6.2.3-release for changeset ab2ec5c5423b --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index d440a39e8e..c5d9c8f7f5 100755 --- a/.hgtags +++ b/.hgtags @@ -549,3 +549,4 @@ a3143db58a0f6b005232bf9018e7fef17ff9ec90 6.1.0-release 82a89165e5929a6c3073d6cd60a543cb395f147b 6.2.0-release 706bdc7e25c6e6b8fb56f4a13fcce2936e70a79c 6.2.1-release ec09daf1899c1c01c4ba0ba950fae572f2a612a8 6.2.2-release +ab2ec5c5423b277d23fd0511ce50c15123ff2e03 6.2.3-release -- cgit v1.2.3 From 6f95100f7e33e6cd6e5bc462b1577c3a45fd964c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 20 Jun 2019 14:18:42 -0400 Subject: increment viewer version to 6.2.4 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index bee9433817..42cc526d6c 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.2.3 +6.2.4 -- cgit v1.2.3