summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2012-12-31 18:31:19 +1100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-04 13:20:06 +0100
commitd75b21790162694ce5f595ddf330af06df09644b (patch)
tree45eef341b6a25bd2c02e6d2e3dddb9c9273bac3c /src
parent4250fa2cf607a21dedc0588497498f82e77fb390 (diff)
Windows: Add fallback for UpdateLayeredWindowIndirect
The UpdateLayeredWindowIndirect function is only available on Windows Vista and later. If UpdateLayeredWindowIndirect is not available (e.g. on Windows XP), use UpdateLayeredWindow instead. Change-Id: I8af23c051560f7e54eda390dae7553543c00a94b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index 04fe558541..b7937b4d84 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -100,10 +100,15 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion &region,
POINT ptDst = {r.x(), r.y()};
POINT ptSrc = {0, 0};
BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * rw->opacity()), AC_SRC_ALPHA};
- RECT dirty = {dirtyRect.x(), dirtyRect.y(),
- dirtyRect.x() + dirtyRect.width(), dirtyRect.y() + dirtyRect.height()};
- UPDATELAYEREDWINDOWINFO info = {sizeof(info), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA, &dirty};
- QWindowsContext::user32dll.updateLayeredWindowIndirect(rw->handle(), &info);
+
+ if (QWindowsContext::user32dll.updateLayeredWindowIndirect) {
+ RECT dirty = {dirtyRect.x(), dirtyRect.y(),
+ dirtyRect.x() + dirtyRect.width(), dirtyRect.y() + dirtyRect.height()};
+ UPDATELAYEREDWINDOWINFO info = {sizeof(info), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA, &dirty};
+ QWindowsContext::user32dll.updateLayeredWindowIndirect(rw->handle(), &info);
+ } else {
+ QWindowsContext::user32dll.updateLayeredWindow(rw->handle(), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA);
+ }
} else {
#endif
const HDC dc = rw->getDC();