From bd9e1f3915ec45342f1cd9a70be3ee4dca4b322e Mon Sep 17 00:00:00 2001 From: Louai Al-Khanji Date: Fri, 17 Jan 2014 12:01:22 +0200 Subject: Improve direct2d backing store implementation Add a per-window swap chain to a QPlatformWindow subclass instead of tying it to the backing store. This is needed to support native widgets (as opposed to alien widgets). Change the backing store to draw to an intermediate pixmap and flush to the requested window by using the per-window swap chain. This also opens the door for faster window presentation later on by using the swap chain more intelligently. Also add a changelog entry for the direct2d plugin, which was omitted earlier. [ChangeLog][QtGui][Windows] Introduce experimental direct2d platform plugin for Windows. This plugin shares most code with the current windows plugin, but substitutes a direct2d-based paint engine for window backing stores and pixmaps. Change-Id: I5f54e7e4c1fb15b1639bd26b712fb40ac141e4ac Reviewed-by: Friedemann Kleint --- .../platforms/direct2d/qwindowsdirect2dintegration.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp') diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp index c2f3c05bde..1a26d7029e 100644 --- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp +++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp @@ -44,11 +44,13 @@ #include "qwindowsdirect2dbackingstore.h" #include "qwindowsdirect2dplatformpixmap.h" #include "qwindowsdirect2dnativeinterface.h" +#include "qwindowsdirect2dwindow.h" #include "qwindowscontext.h" #include #include +#include QT_BEGIN_NAMESPACE @@ -81,6 +83,13 @@ QWindowsDirect2DIntegration::~QWindowsDirect2DIntegration() return static_cast(QWindowsIntegration::instance()); } + QPlatformWindow *QWindowsDirect2DIntegration::createPlatformWindow(QWindow *window) const + { + QWindowsWindowData data = createWindowData(window); + return data.hwnd ? new QWindowsDirect2DWindow(window, data) + : Q_NULLPTR; + } + QPlatformNativeInterface *QWindowsDirect2DIntegration::nativeInterface() const { return &d->m_nativeInterface; @@ -100,7 +109,7 @@ QPlatformPixmap *QWindowsDirect2DIntegration::createPlatformPixmap(QPlatformPixm QPlatformBackingStore *QWindowsDirect2DIntegration::createPlatformBackingStore(QWindow *window) const { - return QWindowsDirect2DBackingStore::create(window); + return new QWindowsDirect2DBackingStore(window); } QWindowsDirect2DContext *QWindowsDirect2DIntegration::direct2DContext() const -- cgit v1.2.3