summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/direct2d
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-071-7/+7
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qftp.cpp src/widgets/itemviews/qheaderview.cpp src/widgets/itemviews/qlistview.cpp tests/auto/network/access/qftp/tst_qftp.cpp Change-Id: I9f928f25d45d8944dd60bb583f649fc1615bc5d9
| * Direct2D QPA: Fix build with clang-cl.Friedemann Kleint2016-04-061-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove overzealous constexpr triggering errors like: in file included from .\qwindowsdirect2dpaintengine.cpp:44: ./qwindowsdirect2dhelpers.h(58,37) : error: constexpr function never produces a constant expression [-Winvalid-constexpr] Q_DECL_CONSTEXPR inline D2D1_RECT_F to_d2d_rect_f(const QRectF &qrect) ^ ./qwindowsdirect2dhelpers.h(60,12) : note: non-constexpr function 'RectF' cannot be used in a constant expression return D2D1::RectF(qrect.x(), qrect.y(), qrect.x() + qrect.width(), qrect.y() + qrect.height()); ^ C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um\d2d1helper.h(160,5) : note: declared here RectF( ^ Task-number: QTBUG-50860 Change-Id: I0bb4d17b7a7db69c5cc7e286ef0b8ff104f72b2e Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-111-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define and undef in src/corelib/tools/qsimd_p.h. This change is also squashed with "Fall back to c++11 standard compiler flag for host builds" which is done by Peter Seiderer. Conflicts: mkspecs/features/default_post.prf src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch src/3rdparty/sqlite/sqlite3.c src/corelib/tools/qsimd_p.h src/gui/kernel/qevent.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/bearer/blackberry/blackberry.pro src/plugins/platforms/cocoa/qcocoasystemsettings.mm src/plugins/platformthemes/gtk2/gtk2.pro src/plugins/styles/bb10style/bb10style.pro src/sql/drivers/sqlite2/qsql_sqlite2.cpp tools/configure/configureapp.cpp Task-number: QTBUG-51644 Done-with: Peter Seiderer <ps.report@gmx.net> Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
| * consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-03-071-5/+5
| | | | | | | | | | | | | | | | this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: Icbce502dcbcb4d4b4d922c42679f44e2cc930bf3 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QPainter: replace an inefficient QList with QVectorMarc Mutz2016-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QPainterClipInfo is larger than a void*, so holding it in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking it movable and holding it in a QVector instead. Port from op<< to append() to reap rvalue push_back(). Change-Id: I3af17eca2443d26a795381635510b8b9a5795e5f Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-112-0/+6
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemwatcher_win.cpp src/corelib/plugin/plugin.pri src/plugins/platforms/cocoa/qcocoaaccessibility.mm tests/auto/corelib/tools/qlocale/tst_qlocale.cpp Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
| * Direct2D: Spell out ~QWindowsDirect2DPaintDevice.Friedemann Kleint2016-02-042-0/+6
| | | | | | | | | | | | | | | | | | Fixes warning about deleting the incomplete type QWindowsDirect2DPaintDevicePrivate. Task-number: QTBUG-50860 Change-Id: I11edb49e6e3996963913155e307fd5f3944bffd2 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-212-4/+3
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice_p.h src/corelib/kernel/qvariant_p.h src/corelib/tools/qsimd.cpp src/gui/kernel/qguiapplication.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp Change-Id: I742a093cbb231b282b43e463ec67173e0d29f57a
| * Windows/Direct2D QPA plugins: Fix overrides.Friedemann Kleint2016-01-142-4/+3
| | | | | | | | | | | | | | Fix warnings found by clang. Change-Id: Ia8e7a271e9d33011eded1e63e61dbcaeaf692600 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-1522-308/+440
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-1/+1
|/ | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Direct2D: Fix build.Friedemann Kleint2015-11-191-1/+1
| | | | | | | | Fix the include path of the event dispatcher which changed after 08a4b7f74507be7aa9dc09a9234d3bc83d4ed908. Change-Id: Ie679b189bd65dc3388ba0d28d01036e3d05683e7 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Windows/Direct2D: Handle screen changes after window creation.Friedemann Kleint2015-11-132-7/+8
| | | | | | | | | | | | | | | | | Call QWindowSystemInterface::handleWindowScreenChanged() in QWindowsIntegration::createPlatformWindow() should the effective screen be different from the initial screen due to the geometry. In order to avoid code duplication in the Direct2D plugin, fold the helper method createWindowData() into QWindowsIntegration::createPlatformWindow() and introduce a new virtual helper to create the actual platform window for QWindowsDirect2DIntegration to hook in. Task-number: QTBUG-48379 Change-Id: I49c7a50a12245691414ab49bffe802239a87d2d6 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Enable non-integer device pixel ratioMorten Johan Sørvig2015-07-301-0/+3
| | | | | | | | | | | | | | | | | | | | Work around QPaintDevice::metric's int return type by adding a new metric that returns a scaled devicePixelRatio. Choose a scale factor that gives us more than enough range. The QPaintDevice::devicePixelRatio() convenience accessor is public API and can unfortunately not be changed to return a qreal. Add devicePixelRatioF() which returns the (unscaled) devicePixelRatio. Change all call sites of QPaintDevice::devicePixelRatio() to use QPainDevice::devicePixelRatioF(). Task-number: QTBUG-46615 Change-Id: I97ec4000fe379b7ff5e1624a871ae2512790aad9 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Direct2D: Fix MSVC2015 warnings.Friedemann Kleint2015-05-232-12/+12
| | | | | | | | | | | | | 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>
* QPA plugins: Use _iid macros instead of strings in Q_PLUGIN_METADATA.Friedemann Kleint2015-05-131-1/+1
| | | | | | | | | This makes it easier to change the version numbers by changing the macros in QtGui. Task-number: QTBUG-46009 Change-Id: I94c9591ec6f7c9173a698df9e1fe8fd6a904caf4 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Clean headers in the Direct2D plugin.Friedemann Kleint2015-03-058-13/+21
| | | | | Change-Id: Iab85ccdf49ee81214ada87a2e476f650b39a29ce Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-242-132/+119
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * direct2d: Optimize dashed [poly]line drawingAndrew Knight2015-02-202-132/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the optimized dash drawing into stroke() in order to apply the optimization to polygons in addition to lines. In the case of polygons/polylines, a vertex patch is redrawn using the original dash brush in order to respect the joinStyle of the line. As the line correction code flows through both the optimized dashed path and the standard geometry code path, line adjustment is now also performed for normal geometry. Task-number: QTBUG-40604 Done-with: Louai Al-Khanji <louai.al-khanji@theqtcompany.com> Done-with: Andrew Knight <andrew.knight@theqtcompany.com> Change-Id: I668369b4aadb6a1bbbd4d621cb8ce1e3b19fbbc9 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-1122-154/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix potential memory access violation issuesKonstantin Ritt2014-12-241-1/+5
|/ | | | | | | | | | | | | | | | LOGFONT docs clearly states `lfFaceName` member is a null-terminated string of length not longer than LF_FACESIZE, including trailing null. This patch covers two cases at once: 1. If family name is longer than LF_FACESIZE - 1, it would be truncated and terminated with null, to prevent memory access beyond the LOGFONT instance. 2. If family name is a fromRawData QString, we don't assume it is null-terminated either and guarantee trailing null ourselves. Change-Id: I8f607efc7d0901537a4179e36cc51df94203f08d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* direct2d: Use simple event posting to avoid event queue lock upAndrew Knight2014-11-072-0/+17
| | | | | | | | | | | | | | | | In rare cases, the Windows event loop can be spinning inside the inner loop and the message hook is never called. This can be triggered on the Direct2D platform by opening 32+ window handles. The issue can be worked around by using the same approach Windows CE uses: don't rely on the message hook to inform the event loop that the post message has been delivered. Instead, uninstall the hook and let it be called directly by the event loop. Task-number: QTBUG-42428 Change-Id: I10280126dd50729bc260aa5f7029549e2e061c01 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
* direct2d: Fix pixmap fills in composition emulation modeAndrew Knight2014-10-281-1/+2
| | | | | | | | When painting a pixmap with rasterFill, the brush should be offset to match the fill path. Change-Id: I4e361932643c4a98dce74e55ed16fae274bce43b Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* Don't use QStringLiteral in comparisonsMarc Mutz2014-10-091-1/+1
| | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* direct2d: Optimize dashed line drawingAndrew Knight2014-09-261-3/+45
| | | | | | | | | | | | | | | | | This introduces a combined brush/dash pattern which can be used to perform faster dashed straight-line drawing. The dash pattern is prerendered to a tiled bitmap brush, resulting in a significant speedup for lines with many elements. As the result of non-rectilinear lines may lose quality compared to the native dashed renderer, the slow/high quality codepath can be activated by setting the QPainter::HighQualityAntialiasing render hint. Task-number: QTBUG-40604 Change-Id: I771e9a81c042b4d8b6891dc9280932696e5a0694 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* direct2d: Fix composition mode supportLouai Al-Khanji2014-09-265-22/+188
| | | | | | | | | | | | When the composition mode changes to a mode which is not supported by Direct2D's primitive blending, the rendering follows the emulated (slow) code path using rasterFill(). This allows the direct2d paint engine to handle all composition modes supported by QImage. Task-number: QTBUG-40602 Change-Id: I0ac0b5c89aab2483cb2ef7768d6dec8e16913249 Done-with: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-2422-396/+220
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* direct2d: Fix font size when display scaling is in useLouai Al-Khanji2014-09-231-15/+8
| | | | | | | | | Since we already tell direct2d that we are using pixel sizes in the QWindowsDirect2DDeviceContextPrivate constructor and thereby enable scaling inside direct2d, there is no need to scale the font size again. Change-Id: Id9c9ed4d2848bcd09f997e41fb87802a3fe2432b Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* direct2d qpa: fix text selectionLouai Al-Khanji2014-09-223-5/+13
| | | | | | | | 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-037-15/+36
| | | | | | | | | | | | 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-014-41/+135
| | | | | | | | | | | | | | | | | | | | 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>
* Fix QGlyphRun text renderingLouai Al-Khanji2014-08-192-129/+95
| | | | | | | | | | | When drawing QGlyphRun objects through QPainter the QFont passed in QStaticTextItem/QTextItem is not properly initialized with the correct size, weight, style strategy etc. Shuffle things around so we always go through QFontEngine for font data, as that should be more reliable. Change-Id: I43811c868ebd4fb1d9e937ee28a6d637267b4c7f Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Fix linking of the Direct2D platform plugin with dynamic Open GL.Friedemann Kleint2014-07-311-1/+1
| | | | | Change-Id: I0a3272233de7e685c750f001eb45a5e326d0f35b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Windows/Direct2D platform plugins: Add Q_DECL_OVERRIDE.Friedemann Kleint2014-07-291-9/+9
| | | | | | | | | | | | Replace old virtual declarations by Q_DECL_OVERRIDE where applicable. Errors discovered: QWindowsScreen::primaryOrientation() did not overwrite any method, changed to orientation(). Task-number: QTBUG-38858 Task-number: QTBUG-38993 Change-Id: Ie85d5235f3cd35c7a24cac3c1c7693c6508b1009 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Direct2D QPA: Match raster engine line outputLouai Al-Khanji2014-05-261-0/+27
| | | | | | | | | | For whatever reason direct2d and the raster engine disagree by one pixel about the positioning of positively sloping aliased lines. To get the same output, we shift such lines by one pixel. Change-Id: I4b20319770c02e3fdd212b3535ccae3c27ca9f2f Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Fix HighRes paintingLouai Al-Khanji2014-05-232-11/+10
| | | | | | | | | | | | | | | | | | | It turns out that supporting HighRes painting with Direct2D is quite simple. Two things are necessary. First, we set the unit mode to D2D1_UNIT_MODE_PIXELS on all our device contexts, which tells Direct2D that we specify everything in pixels. Direct2D will internally do the required conversions. Second, we scale font sizes according to DPI. Previously rendering errors resulted when a highres mode was used, this fixes those errors. Task-number: QTBUG-39105 Change-Id: Ibb4dbea4746687228249e2c36d48c4bd6c5c7bf9 Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Add missing break statementLouai Al-Khanji2014-05-231-0/+1
| | | | | | Change-Id: Ib40daa1ba56cce423b29ac8f1ab50e4638980728 Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Move QVectorPath conversion function into private classLouai Al-Khanji2014-05-221-101/+103
| | | | | | | | | | The function already needs information from the engine for conversion, moving it into the private class makes it possible to get this info directly in the method and makes calling the method nicer. Change-Id: I47fa9a4531d0d0605aa587fba90fbfdf036f0998 Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Get rid of QPainterPath conversion functionLouai Al-Khanji2014-05-221-46/+3
| | | | | | | | | | This function was used only in one place and duplicated a lot of logic with the very similar QVectorPath conversion function. Just use QVectorPath everywhere instead. Change-Id: I3a4821f0452634c309ca0730047ea6ef7a7591ca Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Cache QVectorPaths if drawn more than onceLouai Al-Khanji2014-05-221-6/+43
| | | | | | | | | | Hooking into the caching mechanism gets us a measurable performance boost for paths that are drawn repeatedly, around 10% on my machine when drawing aliased arcs. Change-Id: I32f4ed7daa8a51b5c5a9c6d5414ab5d4ef759f70 Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Use correct buffer size constantLouai Al-Khanji2014-05-191-2/+2
| | | | | Change-Id: I2d8ec5faed959d6d642242b3e26ee0f185ee3d53 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Stroke using direct2d primitivesLouai Al-Khanji2014-05-192-1/+84
| | | | | | | | | | | | | Use native direct2d stroking instead of falling back to QPaintEngineEx::stroke which in turn calls the pure virtual QPaintEngineEx::fill which is reimplemented in QWindowsDirect2DPaintEngine. In some cases like arc stroking this is significantly faster (up to 3x in my measurements) and results in better visual quality. Change-Id: I1c86ff772ba591432ff6550c7c59704ace4f0e0f Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Fix version checkLouai Al-Khanji2014-05-191-2/+2
| | | | | | | | | | | It turns out that the version we were testing against was more recent than basic Windows 7 SP1 + Platform Update. The direct2d version that combination produces without any other updates is 6.2.9200.16492, and it is sufficient for us. Change-Id: Ib9840647371e2bb5c71bf74486348444ed4b4c19 Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Fix check for cosmetic penLouai Al-Khanji2014-05-141-3/+7
| | | | | | | | | When checking whether a QPen should be treated as cosmetic we need to take into account the render hints set on the painter as well. Change-Id: I8200611af08000d2d1626d8ef97eb3f6dac4951c Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Direct2D QPA: Choose linear interpolation for smooth pixmap transformLouai Al-Khanji2014-05-121-2/+1
| | | | | | | | Let's do the same thing the raster engine does. Much faster too. Change-Id: I88ea9d2c2ac78feee1193b75a9e96c62a7bd5979 Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Never queue more than one frameLouai Al-Khanji2014-05-121-1/+4
| | | | | | | | | | | | | | Microsoft recommends setting the maximum frame latency to 1: http://blogs.windows.com/windows/b/appbuilder/archive/2013/12/18/optimizing-directx-apps-for-low-latency-input-and-longer-battery-life.aspx http://msdn.microsoft.com/en-us/library/windows/desktop/hh780339(v=vs.85).aspx Apparently it slightly reduces power consumption and it also slightly increases performance. So let's set it. Change-Id: I8a540f1e54e83d6dc13f25564e10b751e202ce66 Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Bump copyright year to match realityLouai Al-Khanji2014-05-0914-14/+14
| | | | | Change-Id: I443b74e3d464285febc28345f35d1445e8102015 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Check Direct2D versionLouai Al-Khanji2014-05-072-2/+135
| | | | | | | | | | | Since we require a relatively recent system, check the version of the direct2d dll on disk and report an error to the user if it is too old. Previously only a cryptic runtime error resulted from a direct2d version that was too old. Change-Id: I6c3955e1a98326fca6bcdc871b0a25291391ba88 Reviewed-by: Risto Avila <risto.avila@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Direct2D QPA: Speed up text renderingLouai Al-Khanji2014-05-072-53/+60
| | | | | | | | | | | | | | | | | | | | After analysing text drawing performance two things seem to take up most of the time. The first is font lookup, the second is QVector initialization. To address the first point a per paint engine instance font cache is introduced. At the moment no mechanism exists to clear this cache and it is unbounded. To address the second point, we simply switch to using QVarLengthArray instead of QVector. In an artificial benchmark that draws text in a tight loop, the first change raised fps from ~70 to ~100. The second change further raised this number to ~115 fps. Change-Id: Iafa25c3e35bc42bd7c1582b0636e721c5193b494 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>