summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Windows QPA: Fix clang warnings about repetitive type namesFriedemann Kleint2019-06-131-1/+1
| | | | | | | | | | Fix warning like: warning: use auto when initializing with new/reinterpret_cast to avoid duplicating the type name [modernize-use-auto] Change-Id: Ieb7f052919173f6923e68de9f9e849dee45e36e7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows/Direct2d QPA: Use nullptrFriedemann Kleint2019-01-281-8/+8
| | | | | Change-Id: I6ce01caa58de78e0eb61e243ee1e7b05cc1f5568 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-3/+3
| | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Direct2D QPA: Fix g++ warningsFriedemann Kleint2016-11-051-7/+7
| | | | | | | | | | | | | Fix warnings like: qwindowsdirect2dpaintengine.cpp:722:107: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'HRESULT {aka long int}' [-Werror=format=] qWarning("%s: Could not convert Direct2D linear gradient brush: %#x", __FUNCTION__, hr); qwindowsdirect2dintegration.cpp:112:88: error: passing NULL to non-pointer argument 2 of 'WINBOOL GetFileVersionInfoW(LPCWSTR, DWORD, DWORD, LPVOID)' [-Werror=conversion-null] if (GetFileVersionInfo(filename, NULL, versionInfoSize, info.data())) { ^ Change-Id: Ie03abdb5f4ba47b4803c283b9a4ec10181aae76e Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
* Direct2D QPA plugin: Use member initializationFriedemann Kleint2016-10-271-1/+0
| | | | | | | | Use C++ 11 member initialization in value-type structs. Task-number: QTBUG-51673 Change-Id: I2e609337cfc057d1de23b3de62b9ed43a4ecec9c Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
* Direct2d: Fix some CLANG warningsFriedemann Kleint2016-10-271-6/+6
| | | | | | | Fix warnings about integer and double to float conversions, mostly. Change-Id: I7c0568051eabea9af9cbdaeb36da0b2affb174e1 Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
* QtOpenGL/plugins/platformsupport: use new QRegion::begin()/end() instead of ↵Marc Mutz2016-03-021-1/+1
| | | | | | | | | | rect() Saves e.g. ~900b and ~2900b in text size in QtOpenGL and XcbQpa libs, resp., on optimized GCC 5.3 Linux AMD64 builds. Change-Id: Id904689164ca32df41118a23747c70048d8e6604 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Direct2D: Fix MSVC2015 warnings.Friedemann Kleint2015-05-231-1/+1
| | | | | | | | | | | | | qwindowsdirect2dpaintengine.cpp(365): warning C4838: conversion from 'const qreal' to 'FLOAT' requires a narrowing conversion qwindowsdirect2dpaintengine.cpp(928): warning C4838: conversion from 'const qreal' to 'FLOAT' requires a narrowing conversion qwindowsdirect2dpaintengine.cpp(928): warning C4838: conversion from 'int' to 'UINT32' requires a narrowing conversion qwindowsdirect2dpaintengine.cpp(1398): warning C4838: conversion from 'qreal' to 'FLOAT' requires a narrowing conversion qwindowsdirect2dpaintengine.cpp(1426): warning C4838: conversion from 'double' to 'FLOAT' requires a narrowing conversion qwindowsdirect2dbitmap.cpp(78): warning C4838: conversion from 'int' to 'UINT32' requires a narrowing conversion qwindowsdirect2dwindow.cpp(166): warning C4838: conversion from 'double' to 'BYTE' requires a narrowing conversion Change-Id: I6992260ed2696fa4c47c1c0dd666f448f115879a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Clean headers in the Direct2D plugin.Friedemann Kleint2015-03-051-0/+3
| | | | | Change-Id: Iab85ccdf49ee81214ada87a2e476f650b39a29ce Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* direct2d: Fix window resize with translucent windowsAndrew Knight2014-10-281-5/+4
| | | | | | | | If the size of the window has changed, the backing bitmap should be reset with the new geometry. Change-Id: I1ca430cd7b5df1845b4fef31f5bf8f05d889a2fc Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* direct2d qpa: fix text selectionLouai Al-Khanji2014-09-221-1/+1
| | | | | | | | 1cdcf64ad5c0f42d23ad1a53c965df5c69a6bb4b recently introduced a rendering bug whereby certain clips would be handled incorrectly. Change-Id: I3f486819c66b1d665243c8dc1e9d077dd2f64f25 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* direct2d: Work around ClearType rendering bug in translucent modeAndrew Knight2014-09-031-0/+4
| | | | | | | | | | | | This switches the font rendering to use gray scale antialiasing when in translucent rendering mode. It does so by adding a flags argument to the paint engine, allowing for future expansion in communicating render hints from the device to the engine. Task-number: QTBUG-41002 Change-Id: I0265154716a12060e851b603a109e9c693f5e843 Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* direct2d: Fix translucent/frameless window renderingAndrew Knight2014-09-011-35/+115
| | | | | | | | | | | | | | | | | | | | 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>
* Direct2D QPA: Draw directly to swap chainLouai Al-Khanji2014-05-051-18/+74
| | | | | | | | | | | | | | | | | | | Remove the intermediate pixmap in the backing store and draw directly to the window swap chain. This is faster and reduces memory pressure on the graphics card. In case of native child widgets we need to read back the back buffer, which incurs an extra copy in this case. In an artificial benchmark drawing animated full screen gradients as fast as possible this patch increases performance by 42% on my current machine from 480fps to around 680fps, i.e. the time for actually getting the pixels to the screen is now lower. Change-Id: Ifbeda0e199afec03cecfe76337679a9e9d082bdd Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Direct2D QPA: Disable vsyncLouai Al-Khanji2014-04-251-1/+1
| | | | | | | | | We shouldn't block the whole gui thread for vsyncing. This can slow things down a lot if a lot of drawing happens. Change-Id: Ie459f9dee2271e7908e2b7f56873393c67f82836 Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Direct2D QPA: Do not attempt to create swap chain for desktop widgetLouai Al-Khanji2014-04-241-0/+3
| | | | | | | | | We can't and don't need to create a swap chain for the desktop widget. Change-Id: I84cd5c753710af09bab5c7afc27e202e661343db Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Risto Avila <risto.avila@digia.com>
* Improve direct2d backing store implementationLouai Al-Khanji2014-01-271-0/+177
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 <Friedemann.Kleint@digia.com>