diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-05 13:15:42 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-05 23:13:15 +0200 |
commit | 515d2579d305a6127c6c194319a58eac62437e33 (patch) | |
tree | e283e99d3ed36c2f3a954df976604c7fea8d29fe /canvas | |
parent | edd163b5e148d1c71ff2c3f55455c971513a6f62 (diff) |
Replace legacy dynamically-loaded functions with statically linked ones
We don't need the dynamic load complexity for these now with baseline
Windows version being Windows 7 SP1. Stuff used only for compatibility
with older versions was dumped.
Change-Id: I810f271796cfd875cfa18a3081c9ad444fe57b3e
Reviewed-on: https://gerrit.libreoffice.org/70321
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/directx/dx_9rm.cxx | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index 988f4a06d618..f1557af69961 100644 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.cxx @@ -65,50 +65,6 @@ namespace dxcanvas { namespace { - - // monitorSupport - - - class monitorSupport - { - public: - - monitorSupport() : - mhLibrary(LoadLibraryW(L"user32.dll")), - mpMonitorFromWindow(nullptr) - { - if(mhLibrary) - mpMonitorFromWindow = reinterpret_cast<fMonitorFromWindow>( - GetProcAddress( - mhLibrary,"MonitorFromWindow")); - } - - ~monitorSupport() - { - if(mhLibrary) - FreeLibrary(mhLibrary); - mhLibrary=nullptr; - } - - HMONITOR MonitorFromWindow( HWND hwnd ) - { - // return adapter_default in case something went wrong... - if(!mpMonitorFromWindow) - return HMONITOR(nullptr); - // MONITOR_DEFAULTTONEAREST - const DWORD dwFlags(0x00000002); - return mpMonitorFromWindow(hwnd,dwFlags); - } - private: - - HINSTANCE mhLibrary; - typedef HMONITOR (WINAPI *fMonitorFromWindow )( HWND hwnd, DWORD dwFlags ); - fMonitorFromWindow mpMonitorFromWindow; - }; - - monitorSupport aMonitorSupport; - - class DXRenderModule; @@ -1100,7 +1056,7 @@ namespace dxcanvas UINT DXRenderModule::getAdapterFromWindow() { - HMONITOR hMonitor(aMonitorSupport.MonitorFromWindow(mhWnd)); + HMONITOR hMonitor(MonitorFromWindow(mhWnd, MONITOR_DEFAULTTONEAREST)); UINT aAdapterCount(mpDirect3D9->GetAdapterCount()); for(UINT i=0; i<aAdapterCount; ++i) if(hMonitor == mpDirect3D9->GetAdapterMonitor(i)) |