summaryrefslogtreecommitdiff
path: root/vcl/win/app/salinst.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-03-14 20:05:50 +0100
committerMichael Meeks <michael.meeks@collabora.com>2018-03-21 16:32:41 +0100
commit8e870ea9b828166b89a5c3f6c4f060bde6082f26 (patch)
tree24b85e2be2f02ddb8e180d6e923bf63d42bfad32 /vcl/win/app/salinst.cxx
parentb0e7b2336d5d5723a9feab124f7c8a152f96dda4 (diff)
tdf#115420 fix DC usecount and drop wrong asserts
For DC initialization we check the thread ID to assign a normal or cached DC to the corresponding WinSalGraphics variable. The cached DC has a usage count, as there are some limits on cached DCs count (DCX_CACHE). But for the WinSalGraphics DC init and release the variable just matters for the accounting, and generally which thread is doing the calls: the non-main thread always has to relay them to the main application thread. Since we're releasing all WinSalGraphics in ~WinSalFrame and do all release and re-init in ImplSetParentFrame, there is no way to correspond the thread ID to the WinSalGraphics variable. So this drops the wrong assertions based on the WinSalGraphics variables and renames the GETDC message to GETCACHEDDC to make usage of a cached DC (DCX_CACHE) more obvious. As a consequence of the different release DC handling this also fixes the accounting of the cached DCs, wich was broken in the initial fix; commit c15ea73f960bbd3d2a4b0c43b467ac62eeba3505 Change-Id: I11ce52a1b4005f26567f92588437fa37bf227a2e Reviewed-on: https://gerrit.libreoffice.org/51318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 8939cb9456ee76a848cc8089747f280751092cf8) Reviewed-on: https://gerrit.libreoffice.org/51549 Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/win/app/salinst.cxx')
-rw-r--r--vcl/win/app/salinst.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 5671361c987b..b13360f40b16 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -639,7 +639,7 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, b
CASE_NOYIELDLOCK_RESULT( SAL_MSG_CREATEOBJECT, ImplSalCreateObject(
GetSalData()->mpInstance, reinterpret_cast<WinSalFrame*>(lParam)) )
CASE_NOYIELDLOCK( SAL_MSG_DESTROYOBJECT, delete reinterpret_cast<SalObject*>(lParam) )
- CASE_NOYIELDLOCK_RESULT( SAL_MSG_GETDC, GetDCEx(
+ CASE_NOYIELDLOCK_RESULT( SAL_MSG_GETCACHEDDC, GetDCEx(
reinterpret_cast<HWND>(wParam), nullptr, DCX_CACHE) )
CASE_NOYIELDLOCK( SAL_MSG_RELEASEDC, ReleaseDC(
reinterpret_cast<HWND>(wParam), reinterpret_cast<HDC>(lParam)) )