Merge Firestorm LGPL

meow-7.2.2
Ansariel 2016-11-19 12:27:09 +01:00
commit 8d180a86bf
7 changed files with 62 additions and 22 deletions

View File

@ -721,19 +721,21 @@ void LLImageBase::deleteData()
// virtual
U8* LLImageBase::allocateData(S32 size)
{
//make this function thread-safe.
static const U32 MAX_BUFFER_SIZE = 4096 * 4096 * 16; //256 MB
mBadBufferAllocation = false;
if (size < 0)
{
size = mWidth * mHeight * mComponents;
if (size <= 0)
{
LL_WARNS() << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << LL_ENDL;
return NULL;
mBadBufferAllocation = true;
}
}
//make this function thread-safe.
static const U32 MAX_BUFFER_SIZE = 4096 * 4096 * 16 ; //256 MB
if (size < 1 || size > MAX_BUFFER_SIZE)
}
if (!mBadBufferAllocation && (size < 1 || size > MAX_BUFFER_SIZE))
{
LL_INFOS() << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << LL_ENDL ;
if(mAllowOverSize)
@ -743,26 +745,31 @@ U8* LLImageBase::allocateData(S32 size)
else
{
LL_WARNS() << "LLImageBase::allocateData: bad size: " << size << LL_ENDL;
return NULL;
mBadBufferAllocation = true;
}
}
if (!mData || size != mDataSize)
if (!mBadBufferAllocation && (!mData || size != mDataSize))
{
deleteData(); // virtual
mBadBufferAllocation = false ;
mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
if (!mData)
{
LL_WARNS() << "Failed to allocate image data, size: " << size << " width: " << mWidth << " height: " << mHeight << LL_ENDL;
size = 0 ;
mWidth = mHeight = 0 ;
mBadBufferAllocation = true ;
addAllocationError();
LL_WARNS() << "Failed to allocate image data size [" << size << "]" << LL_ENDL;
mBadBufferAllocation = true;
}
mDataSize = size;
claimMem(mDataSize);
}
if (mBadBufferAllocation)
{
size = 0;
mWidth = mHeight = 0;
mData = NULL;
addAllocationError();
}
mDataSize = size;
claimMem(mDataSize);
return mData;
}

View File

@ -240,6 +240,15 @@ LLLineEditor::~LLLineEditor()
gFocusMgr.releaseFocusIfNeeded( this );
}
// <FS:Ansariel> Enabling LLLineEditor via XUI breaks enabled-state
void LLLineEditor::initFromParams(const LLLineEditor::Params& params)
{
LLUICtrl::initFromParams(params);
LLUICtrl::setEnabled(TRUE);
setEnabled(params.enabled);
}
// </FS:Ansariel>
void LLLineEditor::onFocusReceived()
{
gEditMenuHandler = this;

View File

@ -108,6 +108,10 @@ public:
Params();
};
// <FS:Ansariel> Enabling LLLineEditor via XUI breaks enabled-state
void initFromParams(const LLLineEditor::Params& params);
protected:
LLLineEditor(const Params&);
friend class LLUICtrlFactory;

View File

@ -2644,7 +2644,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_DPICHANGED:
{
LPRECT lprc_new_scale;
F32 new_scale = LOWORD(w_param) / USER_DEFAULT_SCREEN_DPI;
// <FS:Ansariel> Fix DPI scaling
//F32 new_scale = LOWORD(w_param) / USER_DEFAULT_SCREEN_DPI;
F32 new_scale = F32(LOWORD(w_param)) / F32(USER_DEFAULT_SCREEN_DPI);
// </FS:Ansariel>
lprc_new_scale = (LPRECT)l_param;
S32 new_width = lprc_new_scale->right - lprc_new_scale->left;
S32 new_height = lprc_new_scale->bottom - lprc_new_scale->top;
@ -4060,7 +4063,10 @@ F32 LLWindowWin32::getSystemUISize()
hr = pGDFM(hMonitor, MDT_EFFECTIVE_DPI, &dpix, &dpiy);
if (hr == S_OK)
{
scale_value = dpix / USER_DEFAULT_SCREEN_DPI;
// <FS:Ansariel> Fix DPI scaling
//scale_value = dpix / USER_DEFAULT_SCREEN_DPI;
scale_value = F32(dpix) / F32(USER_DEFAULT_SCREEN_DPI);
// </FS:Ansariel>
}
else
{
@ -4079,7 +4085,10 @@ F32 LLWindowWin32::getSystemUISize()
else
{
LL_WARNS() << "Could not load shcore.dll library (included by <ShellScalingAPI.h> from Win 8.1 SDK). Using legacy DPI awareness API of Win XP/7" << LL_ENDL;
scale_value = GetDeviceCaps(hdc, LOGPIXELSX) / USER_DEFAULT_SCREEN_DPI;
// <FS:Ansariel> Fix DPI scaling
//scale_value = GetDeviceCaps(hdc, LOGPIXELSX) / USER_DEFAULT_SCREEN_DPI;
scale_value = F32(GetDeviceCaps(hdc, LOGPIXELSX)) / F32(USER_DEFAULT_SCREEN_DPI);
// </FS:Ansariel>
}
ReleaseDC(hWnd, hdc);

View File

@ -304,7 +304,8 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
DWORD heap_enable_lfh_error[MAX_HEAPS];
S32 num_heaps = 0;
LLWindowWin32::setDPIAwareness();
// <FS:Ansariel> Set via manifest
//LLWindowWin32::setDPIAwareness();
#if WINDOWS_CRT_MEM_CHECKS && !INCLUDE_VLD
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // dump memory leaks on exit
@ -642,7 +643,7 @@ bool LLAppViewerWin32::initHardwareTest()
// Do driver verification and initialization based on DirectX
// hardware polling and driver versions
//
if (TRUE == gSavedSettings.getBOOL("ProbeHardwareOnStartup") && FALSE == gSavedSettings.getBOOL("NoHardwareProbe"))
if (/*TRUE == gSavedSettings.getBOOL("ProbeHardwareOnStartup") &&*/ FALSE == gSavedSettings.getBOOL("NoHardwareProbe")) // <FS:Ansariel> FIRE-20378 / FIRE-20382: Breaks memory detection an 4K monitor workaround
{
// per DEV-11631 - disable hardware probing for everything
// but vram.
@ -673,7 +674,7 @@ bool LLAppViewerWin32::initHardwareTest()
if (OSBTN_NO== button)
{
LL_INFOS("AppInit") << "User quitting after failed DirectX 9 detection" << LL_ENDL;
LLWeb::loadURLExternal("http://secondlife.com/support/", false);
LLWeb::loadURLExternal("http://www.firestormviewer.org/support", false);
return false;
}
gWarningSettings.setBOOL("AboutDirectX9", FALSE);

View File

@ -23,4 +23,9 @@
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true/PM</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

View File

@ -9,4 +9,9 @@
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true/PM</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>