Commit 293d1861 authored by AndreyL ProductEngine's avatar AndreyL ProductEngine
Browse files

Merged in lindenlab/viewer-release

parents 87d4cb9c 6f95100f
......@@ -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
......@@ -1323,6 +1323,7 @@ Sovereign Engineer
STORM-2143
STORM-2148
MAINT-7343
SL-11079
SpacedOut Frye
VWR-34
VWR-45
......
......@@ -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,34 @@ F32 LLWindowWin32::getGamma()
BOOL LLWindowWin32::restoreGamma()
{
return SetDeviceGammaRamp(mhDC, mPrevGammaRamp);
if (mCustomGammaSet != FALSE)
{
LL_DEBUGS("Window") << "Restoring gamma" << LL_ENDL;
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 (!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;
}
LL_DEBUGS("Window") << "Setting gamma to " << gamma << LL_ENDL;
for ( int i = 0; i < 256; ++i )
......@@ -3007,9 +3031,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 );
......
......@@ -184,8 +184,9 @@ class LLWindowWin32 : public LLWindow
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment