summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2014-08-27 16:23:28 +0300
committerAndrew Knight <andrew.knight@digia.com>2014-09-01 18:08:43 +0200
commit1cdcf64ad5c0f42d23ad1a53c965df5c69a6bb4b (patch)
tree1aba794e7125cea85e14376b1c078221fe283204 /src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h
parentfc3acdd9d2766637e0410f7de83b63116df7e053 (diff)
direct2d: Fix translucent/frameless window rendering
When using WA_TranslucentBackground/FramelessWindowHint, the backing store must paint to an offscreen texture instead of the swap chain in order to achieve the desired results. This texture is then presented to the screen using UpdateLayeredWindowIndirect(). As the swap chain is not needed in this mode, its construction is skipped if indirect rendering is active. Furthermore, the layering options were updated to fix an issue with transparent layers overpainting the background. The layer options were switched to D2D1_LAYER_OPTIONS1_NONE, which appears to work for both translucent and non-translucent rendering modes. Task-number: QTBUG-40601 Change-Id: I656f7cdfb424d1eda6f82c2c69500e78d8c1726a Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h')
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h
index 47c790da5d..6835c9cf6f 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h
@@ -56,9 +56,12 @@ public:
QWindowsDirect2DWindow(QWindow *window, const QWindowsWindowData &data);
~QWindowsDirect2DWindow();
+ void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
+
QPixmap *pixmap();
void flush(QWindowsDirect2DBitmap *bitmap, const QRegion &region, const QPoint &offset);
- void present();
+ void present(const QRegion &region);
+ void setupSwapChain();
void resizeSwapChain(const QSize &size);
QSharedPointer<QWindowsDirect2DBitmap> copyBackBuffer() const;
@@ -72,6 +75,7 @@ private:
QScopedPointer<QWindowsDirect2DBitmap> m_bitmap;
QScopedPointer<QPixmap> m_pixmap;
bool m_needsFullFlush;
+ bool m_directRendering;
};
QT_END_NAMESPACE