diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 219462faab..3025bdaf6e 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -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; } diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 559be2503f..ab126c8501 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -240,6 +240,15 @@ LLLineEditor::~LLLineEditor() gFocusMgr.releaseFocusIfNeeded( this ); } +// Enabling LLLineEditor via XUI breaks enabled-state +void LLLineEditor::initFromParams(const LLLineEditor::Params& params) +{ + LLUICtrl::initFromParams(params); + LLUICtrl::setEnabled(TRUE); + setEnabled(params.enabled); +} +// + void LLLineEditor::onFocusReceived() { gEditMenuHandler = this; diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 8f6c2d30b4..0e623b23fd 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -108,6 +108,10 @@ public: Params(); }; + + // Enabling LLLineEditor via XUI breaks enabled-state + void initFromParams(const LLLineEditor::Params& params); + protected: LLLineEditor(const Params&); friend class LLUICtrlFactory; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 8ef742262a..f55be68520 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -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; + // 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); + // 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; + // Fix DPI scaling + //scale_value = dpix / USER_DEFAULT_SCREEN_DPI; + scale_value = F32(dpix) / F32(USER_DEFAULT_SCREEN_DPI); + // } else { @@ -4079,7 +4085,10 @@ F32 LLWindowWin32::getSystemUISize() else { LL_WARNS() << "Could not load shcore.dll library (included by 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; + // Fix DPI scaling + //scale_value = GetDeviceCaps(hdc, LOGPIXELSX) / USER_DEFAULT_SCREEN_DPI; + scale_value = F32(GetDeviceCaps(hdc, LOGPIXELSX)) / F32(USER_DEFAULT_SCREEN_DPI); + // } ReleaseDC(hWnd, hdc); diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 0a20e796c5..f17628980b 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -304,7 +304,8 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, DWORD heap_enable_lfh_error[MAX_HEAPS]; S32 num_heaps = 0; - LLWindowWin32::setDPIAwareness(); + // 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")) // 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); diff --git a/indra/tools/manifests/compatibility.manifest b/indra/tools/manifests/compatibility.manifest index 31106cc4d5..6e80aff779 100644 --- a/indra/tools/manifests/compatibility.manifest +++ b/indra/tools/manifests/compatibility.manifest @@ -23,4 +23,9 @@ + + + true/PM + + diff --git a/indra/tools/manifests/legacy.manifest b/indra/tools/manifests/legacy.manifest index 2ec1cfcee6..899438c020 100644 --- a/indra/tools/manifests/legacy.manifest +++ b/indra/tools/manifests/legacy.manifest @@ -9,4 +9,9 @@ + + + true/PM + +