summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0f08aa4)
Doing this had noticeable (and bad) performance implications so cache the
value of the option during the first call. This doesn't allow changing its
value during the program execution so we may want to provide some way to
update its value later if really needed.
Closes #11172.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61967
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#ifdef __WIN32__
// use MaskBlt() with ROP which doesn't do anything to dst in the mask
// points
#ifdef __WIN32__
// use MaskBlt() with ROP which doesn't do anything to dst in the mask
// points
+ bool ok = false;
+
+#if wxUSE_SYSTEM_OPTIONS
// On some systems, MaskBlt succeeds yet is much much slower
// than the wxWidgets fall-back implementation. So we need
// to be able to switch this on and off at runtime.
// On some systems, MaskBlt succeeds yet is much much slower
// than the wxWidgets fall-back implementation. So we need
// to be able to switch this on and off at runtime.
- bool ok = false;
-#if wxUSE_SYSTEM_OPTIONS
- if (wxSystemOptions::GetOptionInt(wxT("no-maskblt")) == 0)
-#endif
+ //
+ // NB: don't query the value of the option every time but do it only
+ // once as otherwise it can have real (and bad) performance
+ // implications (see #11172)
+ static bool
+ s_maskBltAllowed = wxSystemOptions::GetOptionInt("no-maskblt") == 0;
+ if ( s_maskBltAllowed )
+#endif // wxUSE_SYSTEM_OPTIONS
{
HDC cdc = GetHdc();
HDC hdcMem = ::CreateCompatibleDC(GetHdc());
{
HDC cdc = GetHdc();
HDC hdcMem = ::CreateCompatibleDC(GetHdc());